From 2046103f77de1ec27ef6fdb8ab890f674233683c Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:32:59 +0800 Subject: [PATCH 01/81] Add files via upload --- source/source_estate/density_matrix.cpp | 643 ++++++++++++++++++++++++ source/source_estate/density_matrix.h | 291 +++++++++++ 2 files changed, 934 insertions(+) create mode 100644 source/source_estate/density_matrix.cpp create mode 100644 source/source_estate/density_matrix.h diff --git a/source/source_estate/density_matrix.cpp b/source/source_estate/density_matrix.cpp new file mode 100644 index 0000000000..19d83a76d8 --- /dev/null +++ b/source/source_estate/density_matrix.cpp @@ -0,0 +1,643 @@ +#include "density_matrix.h" + +#include "module_parameter/parameter.h" +#include "source_base/libm/libm.h" +#include "source_base/memory.h" +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/klist.h" + +namespace elecstate +{ + +//---------------------------------------------------- +// density matrix class +//---------------------------------------------------- + +// destructor +template +DensityMatrix::~DensityMatrix() +{ + for (auto& it: this->_DMR) + { + delete it; + } + delete[] this->dmr_tmp_; +} + +template +DensityMatrix::DensityMatrix(const Parallel_Orbitals* paraV_in, const int nspin, const std::vector>& kvec_d, const int nk) + : _paraV(paraV_in), _nspin(nspin), _kvec_d(kvec_d), _nk((nk > 0 && nk <= _kvec_d.size()) ? nk : _kvec_d.size()) +{ + ModuleBase::TITLE("DensityMatrix", "DensityMatrix-MK"); + const int nks = _nk * _nspin; + this->_DMK.resize(nks); + for (int ik = 0; ik < nks; ik++) + { + this->_DMK[ik].resize(this->_paraV->get_row_size() * this->_paraV->get_col_size()); + } + ModuleBase::Memory::record("DensityMatrix::DMK", this->_DMK.size() * this->_DMK[0].size() * sizeof(TK)); +} + +template +DensityMatrix::DensityMatrix(const Parallel_Orbitals* paraV_in, const int nspin) :_paraV(paraV_in), _nspin(nspin), _kvec_d({ ModuleBase::Vector3(0,0,0) }), _nk(1) +{ + ModuleBase::TITLE("DensityMatrix", "DensityMatrix-GO"); + this->_DMK.resize(_nspin); + for (int ik = 0; ik < this->_nspin; ik++) + { + this->_DMK[ik].resize(this->_paraV->get_row_size() * this->_paraV->get_col_size()); + } + ModuleBase::Memory::record("DensityMatrix::DMK", this->_DMK.size() * this->_DMK[0].size() * sizeof(TK)); +} + +// calculate DMR from DMK using blas for multi-k calculation +template <> +void DensityMatrix, double>::cal_DMR(const int ik_in) +{ + ModuleBase::TITLE("DensityMatrix", "cal_DMR"); + + // To check whether DMR has been initialized +#ifdef __DEBUG + assert(!this->_DMR.empty() && "DMR has not been initialized!"); +#endif + + ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); + int ld_hk = this->_paraV->nrow; + for (int is = 1; is <= this->_nspin; ++is) + { + int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 + hamilt::HContainer* target_DMR = this->_DMR[is - 1]; + // set zero since this function is called in every scf step + target_DMR->set_zero(); +#ifdef _OPENMP +#pragma omp parallel for schedule(dynamic) +#endif + for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) + { + hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); + int iat1 = target_ap.get_atom_i(); + int iat2 = target_ap.get_atom_j(); + // get global indexes of whole matrix for each atom in this process + int row_ap = this->_paraV->atom_begin_row[iat1]; + int col_ap = this->_paraV->atom_begin_col[iat2]; + const int row_size = this->_paraV->get_row_size(iat1); + const int col_size = this->_paraV->get_col_size(iat2); + const int mat_size = row_size * col_size; + const int r_size = target_ap.get_R_size(); + if (row_ap == -1 || col_ap == -1) + { + throw std::string("Atom-pair not belong this process"); + } + std::vector> tmp_DMR; + if (PARAM.inp.nspin == 4) + { + tmp_DMR.resize(mat_size * r_size, 0); + } + + // calculate kphase and target_mat_ptr + std::vector> kphase_vec(r_size * this->_nk); + std::vector target_DMR_mat_vec(r_size); + for(int ir = 0; ir < r_size; ++ir) + { + const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); + hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); +#ifdef __DEBUG + if (target_mat == nullptr) + { + std::cout << "target_mat is nullptr" << std::endl; + continue; + } +#endif + target_DMR_mat_vec[ir] = target_mat->get_pointer(); + for(int ik = 0; ik < this->_nk; ++ik) + { + if(ik_in >= 0 && ik_in != ik) + { + continue; + } + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); + const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); + } + } + + std::vector> tmp_DMK_mat(mat_size); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + // step_trace is used when nspin = 4; + int step_trace[4]{}; + if(PARAM.inp.nspin == 4) + { + const int npol = 2; + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = target_ap.get_col_size() * is + is2; + } + } + } + for(int ik = 0; ik < this->_nk; ++ik) + { + if(ik_in >= 0 && ik_in != ik) + { + continue; + } + + // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) + const std::complex* DMK_mat_ptr = this->_DMK[ik + ik_begin].data() + col_ap * this->_paraV->nrow + row_ap; + for(int icol = 0; icol < col_size; ++icol) + { + for(int irow = 0; irow < row_size; ++irow) + { + tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; + } + } + + // if nspin != 4, fill DMR + // if nspin == 4, fill tmp_DMR + for(int ir = 0; ir < r_size; ++ir) + { + std::complex kphase = kphase_vec[ik * r_size + ir]; + if(PARAM.inp.nspin != 4) + { + double* target_DMR_mat = target_DMR_mat_vec[ir]; + for(int i = 0; i < mat_size; i++) + { + target_DMR_mat[i] += kphase.real() * tmp_DMK_mat[i].real() + - kphase.imag() * tmp_DMK_mat[i].imag(); + } + } else if(PARAM.inp.nspin == 4) + { + std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; + BlasConnector::axpy(mat_size, + kphase, + tmp_DMK_mat.data(), + 1, + tmp_DMR_mat, + 1); + } + } + } + + // if nspin == 4 + // copy tmp_DMR to fill target_DMR + if(PARAM.inp.nspin == 4) + { + std::complex tmp[4]{}; + for(int ir = 0; ir < r_size; ++ir) + { + std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; + double* target_DMR_mat = target_DMR_mat_vec[ir]; + for (int irow = 0; irow < row_size; irow += 2) + { + for (int icol = 0; icol < col_size; icol += 2) + { + // catch the 4 spin component value of one orbital pair + tmp[0] = tmp_DMR_mat[icol + step_trace[0]]; + tmp[1] = tmp_DMR_mat[icol + step_trace[1]]; + tmp[2] = tmp_DMR_mat[icol + step_trace[2]]; + tmp[3] = tmp_DMR_mat[icol + step_trace[3]]; + // transfer to Pauli matrix and save the real part + // save them back to the target_mat + target_DMR_mat[icol + step_trace[0]] = tmp[0].real() + tmp[3].real(); + target_DMR_mat[icol + step_trace[1]] = tmp[1].real() + tmp[2].real(); + target_DMR_mat[icol + step_trace[2]] + = -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() + target_DMR_mat[icol + step_trace[3]] = tmp[0].real() - tmp[3].real(); + } + tmp_DMR_mat += col_size * 2; + target_DMR_mat += col_size * 2; + } + } + } + } + } + ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); +} + +// calculate DMR from DMK using blas for multi-k calculation +template <> +void DensityMatrix, double>::cal_DMR_td(const UnitCell& ucell, const ModuleBase::Vector3 At, const int ik_in) +{ + ModuleBase::TITLE("DensityMatrix", "cal_DMR_td"); + // To check whether DMR has been initialized +#ifdef __DEBUG + assert(!this->_DMR.empty() && "DMR has not been initialized!"); +#endif + + ModuleBase::timer::tick("DensityMatrix", "cal_DMR_td"); + int ld_hk = this->_paraV->nrow; + for (int is = 1; is <= this->_nspin; ++is) + { + int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 + hamilt::HContainer* target_DMR = this->_DMR[is - 1]; + // set zero since this function is called in every scf step + target_DMR->set_zero(); +#ifdef _OPENMP +#pragma omp parallel for schedule(dynamic) +#endif + for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) + { + hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); + int iat1 = target_ap.get_atom_i(); + int iat2 = target_ap.get_atom_j(); + // get global indexes of whole matrix for each atom in this process + int row_ap = this->_paraV->atom_begin_row[iat1]; + int col_ap = this->_paraV->atom_begin_col[iat2]; + const int row_size = this->_paraV->get_row_size(iat1); + const int col_size = this->_paraV->get_col_size(iat2); + const int mat_size = row_size * col_size; + const int r_size = target_ap.get_R_size(); + if (row_ap == -1 || col_ap == -1) + { + throw std::string("Atom-pair not belong this process"); + } + std::vector> tmp_DMR; + if (PARAM.inp.nspin == 4) + { + tmp_DMR.resize(mat_size * r_size, 0); + } + + // calculate kphase and target_mat_ptr + std::vector> kphase_vec(r_size * this->_nk); + std::vector target_DMR_mat_vec(r_size); + for(int ir = 0; ir < r_size; ++ir) + { + const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); + hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); +#ifdef __DEBUG + if (target_mat == nullptr) + { + std::cout << "target_mat is nullptr" << std::endl; + continue; + } +#endif + target_DMR_mat_vec[ir] = target_mat->get_pointer(); + double arg_td = 0.0; + //cal tddft phase for hybrid gague + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + arg_td = At * dtau * ucell.lat0; + for(int ik = 0; ik < this->_nk; ++ik) + { + if(ik_in >= 0 && ik_in != ik) + { + continue; + } + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); + const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); + } + } + + std::vector> tmp_DMK_mat(mat_size); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + // step_trace is used when nspin = 4; + int step_trace[4]{}; + if(PARAM.inp.nspin == 4) + { + const int npol = 2; + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = target_ap.get_col_size() * is + is2; + } + } + } + for(int ik = 0; ik < this->_nk; ++ik) + { + if(ik_in >= 0 && ik_in != ik) + { + continue; + } + + // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) + const std::complex* DMK_mat_ptr = this->_DMK[ik + ik_begin].data() + col_ap * this->_paraV->nrow + row_ap; + for(int icol = 0; icol < col_size; ++icol) + { + for(int irow = 0; irow < row_size; ++irow) + { + tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; + } + } + + // if nspin != 4, fill DMR + // if nspin == 4, fill tmp_DMR + for(int ir = 0; ir < r_size; ++ir) + { + std::complex kphase = kphase_vec[ik * r_size + ir]; + if(PARAM.inp.nspin != 4) + { + double* target_DMR_mat = target_DMR_mat_vec[ir]; + for(int i = 0; i < mat_size; i++) + { + target_DMR_mat[i] += kphase.real() * tmp_DMK_mat[i].real() + - kphase.imag() * tmp_DMK_mat[i].imag(); + } + } else if(PARAM.inp.nspin == 4) + { + std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; + BlasConnector::axpy(mat_size, + kphase, + tmp_DMK_mat.data(), + 1, + tmp_DMR_mat, + 1); + } + } + } + + // if nspin == 4 + // copy tmp_DMR to fill target_DMR + if(PARAM.inp.nspin == 4) + { + std::complex tmp[4]{}; + for(int ir = 0; ir < r_size; ++ir) + { + std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; + double* target_DMR_mat = target_DMR_mat_vec[ir]; + for (int irow = 0; irow < row_size; irow += 2) + { + for (int icol = 0; icol < col_size; icol += 2) + { + // catch the 4 spin component value of one orbital pair + tmp[0] = tmp_DMR_mat[icol + step_trace[0]]; + tmp[1] = tmp_DMR_mat[icol + step_trace[1]]; + tmp[2] = tmp_DMR_mat[icol + step_trace[2]]; + tmp[3] = tmp_DMR_mat[icol + step_trace[3]]; + // transfer to Pauli matrix and save the real part + // save them back to the target_mat + target_DMR_mat[icol + step_trace[0]] = tmp[0].real() + tmp[3].real(); + target_DMR_mat[icol + step_trace[1]] = tmp[1].real() + tmp[2].real(); + target_DMR_mat[icol + step_trace[2]] + = -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() + target_DMR_mat[icol + step_trace[3]] = tmp[0].real() - tmp[3].real(); + } + tmp_DMR_mat += col_size * 2; + target_DMR_mat += col_size * 2; + } + } + } + } + } + ModuleBase::timer::tick("DensityMatrix", "cal_DMR_td"); +} + +// calculate DMR from DMK using blas for multi-k calculation +template <> +void DensityMatrix::cal_DMR_full(hamilt::HContainer>* dmR_out)const{} +template <> +void DensityMatrix, double>::cal_DMR_full(hamilt::HContainer>* dmR_out)const +{ + ModuleBase::TITLE("DensityMatrix", "cal_DMR_full"); + + ModuleBase::timer::tick("DensityMatrix", "cal_DMR_full"); + int ld_hk = this->_paraV->nrow; + hamilt::HContainer>* target_DMR = dmR_out; + // set zero since this function is called in every scf step + target_DMR->set_zero(); +#ifdef _OPENMP +#pragma omp parallel for schedule(dynamic) +#endif + for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) + { + auto& target_ap = target_DMR->get_atom_pair(i); + int iat1 = target_ap.get_atom_i(); + int iat2 = target_ap.get_atom_j(); + // get global indexes of whole matrix for each atom in this process + int row_ap = this->_paraV->atom_begin_row[iat1]; + int col_ap = this->_paraV->atom_begin_col[iat2]; + const int row_size = this->_paraV->get_row_size(iat1); + const int col_size = this->_paraV->get_col_size(iat2); + const int mat_size = row_size * col_size; + const int r_size = target_ap.get_R_size(); + + // calculate kphase and target_mat_ptr + std::vector> kphase_vec(r_size * this->_nk); + std::vector*> target_DMR_mat_vec(r_size); + for(int ir = 0; ir < r_size; ++ir) + { + const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); + hamilt::BaseMatrix>* target_mat = target_ap.find_matrix(r_index); +#ifdef __DEBUG + if (target_mat == nullptr) + { + std::cout << "target_mat is nullptr" << std::endl; + continue; + } +#endif + target_DMR_mat_vec[ir] = target_mat->get_pointer(); + for(int ik = 0; ik < this->_nk; ++ik) + { + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); + const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); + } + } + + std::vector> tmp_DMK_mat(mat_size); + for(int ik = 0; ik < this->_nk; ++ik) + { + // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) + const std::complex* DMK_mat_ptr = this->_DMK[ik].data() + col_ap * this->_paraV->nrow + row_ap; + for(int icol = 0; icol < col_size; ++icol) + { + for(int irow = 0; irow < row_size; ++irow) + { + tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; + } + } + + for(int ir = 0; ir < r_size; ++ir) + { + std::complex kphase = kphase_vec[ik * r_size + ir]; + std::complex* target_DMR_mat = target_DMR_mat_vec[ir]; + BlasConnector::axpy(mat_size, + kphase, + tmp_DMK_mat.data(), + 1, + target_DMR_mat, + 1); + } + } + } + ModuleBase::timer::tick("DensityMatrix", "cal_DMR_full"); +} + +// calculate DMR from DMK using blas for gamma-only calculation +template <> +void DensityMatrix::cal_DMR(const int ik_in) +{ + ModuleBase::TITLE("DensityMatrix", "cal_DMR"); + + assert(ik_in == -1 || ik_in == 0); + + // To check whether DMR has been initialized +#ifdef __DEBUG + assert(!this->_DMR.empty() && "DMR has not been initialized!"); +#endif + + ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); + int ld_hk = this->_paraV->nrow; + for (int is = 1; is <= this->_nspin; ++is) + { + int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 + hamilt::HContainer* target_DMR = this->_DMR[is - 1]; + // set zero since this function is called in every scf step + target_DMR->set_zero(); + +#ifdef __DEBUG + // assert(target_DMR->is_gamma_only() == true); + assert(this->_nk == 1); +#endif +#ifdef _OPENMP +#pragma omp parallel for schedule(dynamic) +#endif + for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) + { + hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); + int iat1 = target_ap.get_atom_i(); + int iat2 = target_ap.get_atom_j(); + // get global indexes of whole matrix for each atom in this process + int row_ap = this->_paraV->atom_begin_row[iat1]; + int col_ap = this->_paraV->atom_begin_col[iat2]; + const int row_size = this->_paraV->get_row_size(iat1); + const int col_size = this->_paraV->get_col_size(iat2); + const int r_size = target_ap.get_R_size(); + if (row_ap == -1 || col_ap == -1) + { + throw std::string("Atom-pair not belong this process"); + } + // R index + const ModuleBase::Vector3 r_index = target_ap.get_R_index(0); +#ifdef __DEBUG + assert(r_size == 1); + assert(r_index.x == 0 && r_index.y == 0 && r_index.z == 0); +#endif + hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); +#ifdef __DEBUG + if (target_mat == nullptr) + { + std::cout << "target_mat is nullptr" << std::endl; + continue; + } +#endif + // k index + double kphase = 1; + // set DMR element + double* target_DMR_ptr = target_mat->get_pointer(); + double* DMK_ptr = this->_DMK[0 + ik_begin].data(); + // transpose DMK col=>row + DMK_ptr += col_ap * this->_paraV->nrow + row_ap; + for (int mu = 0; mu < row_size; ++mu) + { + BlasConnector::axpy(col_size, + kphase, + DMK_ptr, + ld_hk, + target_DMR_ptr, + 1); + DMK_ptr += 1; + target_DMR_ptr += col_size; + } + } + } + ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); +} + +// switch_dmr +template +void DensityMatrix::switch_dmr(const int mode) +{ + ModuleBase::TITLE("DensityMatrix", "switch_dmr"); + if (this->_nspin != 2) + { + return; + } + else + { + ModuleBase::timer::tick("DensityMatrix", "switch_dmr"); + switch(mode) + { + case 0: + // switch to original density matrix + if (this->dmr_tmp_ != nullptr && this->dmr_origin_.size() != 0) + { + this->_DMR[0]->allocate(this->dmr_origin_.data(), false); + delete[] this->dmr_tmp_; + this->dmr_tmp_ = nullptr; + } + // else: do nothing + break; + case 1: + // switch to total magnetization density matrix, dmr_up + dmr_down + if(this->dmr_tmp_ == nullptr) + { + const size_t size = this->_DMR[0]->get_nnr(); + this->dmr_tmp_ = new TR[size]; + this->dmr_origin_.resize(size); + for (int i = 0; i < size; ++i) + { + this->dmr_origin_[i] = this->_DMR[0]->get_wrapper()[i]; + this->dmr_tmp_[i] = this->dmr_origin_[i] + this->_DMR[1]->get_wrapper()[i]; + } + this->_DMR[0]->allocate(this->dmr_tmp_, false); + } + else + { + const size_t size = this->_DMR[0]->get_nnr(); + for (int i = 0; i < size; ++i) + { + this->dmr_tmp_[i] = this->dmr_origin_[i] + this->_DMR[1]->get_wrapper()[i]; + } + } + break; + case 2: + // switch to magnetization density matrix, dmr_up - dmr_down + if(this->dmr_tmp_ == nullptr) + { + const size_t size = this->_DMR[0]->get_nnr(); + this->dmr_tmp_ = new TR[size]; + this->dmr_origin_.resize(size); + for (int i = 0; i < size; ++i) + { + this->dmr_origin_[i] = this->_DMR[0]->get_wrapper()[i]; + this->dmr_tmp_[i] = this->dmr_origin_[i] - this->_DMR[1]->get_wrapper()[i]; + } + this->_DMR[0]->allocate(this->dmr_tmp_, false); + } + else + { + const size_t size = this->_DMR[0]->get_nnr(); + for (int i = 0; i < size; ++i) + { + this->dmr_tmp_[i] = this->dmr_origin_[i] - this->_DMR[1]->get_wrapper()[i]; + } + } + break; + default: + throw std::string("Unknown mode in switch_dmr"); + } + ModuleBase::timer::tick("DensityMatrix", "switch_dmr"); + } +} + +// T of HContainer can be double or complex +template class DensityMatrix; // Gamma-Only case +template class DensityMatrix, double>; // Multi-k case +template class DensityMatrix, std::complex>; // For EXX in future + +} // namespace elecstate diff --git a/source/source_estate/density_matrix.h b/source/source_estate/density_matrix.h new file mode 100644 index 0000000000..267138564a --- /dev/null +++ b/source/source_estate/density_matrix.h @@ -0,0 +1,291 @@ +#ifndef DENSITY_MATRIX_H +#define DENSITY_MATRIX_H + +#include + +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/hamilt_lcaodft/record_adj.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" + +namespace elecstate +{ +/** + * @brief DensityMatrix Class + * = for Gamma-only calculation + * = ,double> for multi-k calculation + */ +template struct ShiftRealComplex +{ + using type = void; +}; + +template<> +struct ShiftRealComplex +{ + using type = std::complex; +}; + +template<> +struct ShiftRealComplex> +{ + using type = double; +}; + +template +class DensityMatrix +{ + using TRShift = typename ShiftRealComplex::type; + + public: + /** + * @brief Destructor of class DensityMatrix + */ + ~DensityMatrix(); + + /** + * @brief Constructor of class DensityMatrix for multi-k calculation + * @param _paraV pointer of Parallel_Orbitals object + * @param nspin number of spin of the density matrix, set by user according to global nspin + * (usually {nspin_global -> nspin_dm} = {1->1, 2->2, 4->1}, but sometimes 2->1 like in LR-TDDFT) + * @param kvec_d direct coordinates of kpoints + * @param nk number of k-points, not always equal to K_Vectors::get_nks()/nspin_dm. + * it will be set to kvec_d.size() if the value is invalid + */ + DensityMatrix(const Parallel_Orbitals* _paraV, const int nspin, const std::vector>& kvec_d, const int nk); + + /** + * @brief Constructor of class DensityMatrix for gamma-only calculation, where kvector is not required + * @param _paraV pointer of Parallel_Orbitals object + * @param nspin number of spin of the density matrix, set by user according to global nspin + * (usually {nspin_global -> nspin_dm} = {1->1, 2->2, 4->1}, but sometimes 2->1 like in LR-TDDFT) + */ + DensityMatrix(const Parallel_Orbitals* _paraV, const int nspin); + + /** + * @brief initialize density matrix DMR from UnitCell + * @param GridD_in pointer of Grid_Driver object (used to find ajacent atoms) + * @param ucell pointer of UnitCell object + */ + void init_DMR(const Grid_Driver* GridD_in, const UnitCell* ucell); + + /** + * @brief initialize density matrix DMR from UnitCell and RA + * @param ra pointer of Record_adj object (used to find ajacent atoms) + * @param ucell pointer of UnitCell object + */ + void init_DMR(Record_adj& ra, const UnitCell* ucell); + + /** + * @brief initialize density matrix DMR from another HContainer + * now only support HContainer + * @param _DMR_in pointer of another HContainer object + */ + void init_DMR(const hamilt::HContainer& _DMR_in); + + /// @brief initialize density matrix DMR from another HContainer + /// this is a temprory function for NSPIN=4 case + /// since copy HContainer from another HContainer with different TR is not supported yet + /// would be refactor in the future + /// @param _DMR_in + // the old input type ``:HContainer` causes redefination error if TR = complex + void init_DMR(const hamilt::HContainer& _DMR_in); + + /** + * @brief set _DMK element directly + * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) + * @param ik k-point index + * @param i row index + * @param j column index + * @param value value to be set + */ + void set_DMK(const int ispin, const int ik, const int i, const int j, const TK value); + + /** + * @brief set _DMK element to zero + */ + void set_DMK_zero(); + + /** + * @brief get a matrix element of density matrix dm(k) + * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) + * @param ik k-point index + * @param i row index + * @param j column index + * @return T a matrix element of density matrix dm(k) + */ + TK get_DMK(const int ispin, const int ik, const int i, const int j) const; + + /** + * @brief get total number of k-points of density matrix dm(k) + */ + int get_DMK_nks() const; + int get_DMK_size() const; + + /** + * @brief get number of rows of density matrix dm(k) + */ + int get_DMK_nrow() const; + + /** + * @brief get number of columns of density matrix dm(k) + */ + int get_DMK_ncol() const; + + /** + * @brief get pointer of DMR + * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) + * @return HContainer* pointer of DMR + */ + hamilt::HContainer* get_DMR_pointer(const int ispin) const; + + /** + * @brief get pointer vector of DMR + * @return HContainer* vector of DMR + */ + const std::vector*>& get_DMR_vector() const {return this->_DMR;} + std::vector*>& get_DMR_vector() {return this->_DMR;} + + const std::vector>& get_DMR_save() const {return this->_DMR_save;} + std::vector>& get_DMR_save() {return this->_DMR_save;} + + /** + * @brief get pointer of DMK + * @param ik k-point index, which is the index of _DMK + * @return TK* pointer of DMK + */ + TK* get_DMK_pointer(const int ik) const; + + /** + * @brief get pointer vector of DMK + */ + const std::vector>& get_DMK_vector() const {return this->_DMK;} + std::vector>& get_DMK_vector() {return this->_DMK;} + + /** + * @brief set _DMK using a input TK* pointer + * please make sure the size of TK* is correct + */ + void set_DMK_pointer(const int ik, TK* DMK_in); + + /** + * @brief get pointer of paraV + */ + const Parallel_Orbitals* get_paraV_pointer() const {return this->_paraV;} + + const std::vector>& get_kvec_d() const { return this->_kvec_d; } + + /** + * @brief calculate density matrix DMR from dm(k) using blas::axpy + * if ik_in < 0, calculate all k-points + * if ik_in >= 0, calculate only one k-point without summing over k-points + */ + void cal_DMR(const int ik_in = -1); + + /** + * @brief calculate density matrix DMR with additional vector potential phase, used for hybrid gague tddft + * if ik_in < 0, calculate all k-points + * if ik_in >= 0, calculate only one k-point without summing over k-points + */ + void cal_DMR_td(const UnitCell& ucell, const ModuleBase::Vector3 At, const int ik_in = -1); + + /** + * @brief calculate complex density matrix DMR with both real and imaginary part for noncollinear-spin calculation + * the stored dm(k) has been used to calculate the passin DMR + * @param dmR_out pointer of HContainer object to store the calculated complex DMR + */ + void cal_DMR_full(hamilt::HContainer>* dmR_out) const; + + /** + * @brief (Only nspin=2) switch DMR to total density matrix or magnetization density matrix + * @param mode 0 - original density matrix; 1 - total density matrix; 2 - magnetization density matrix + */ + void switch_dmr(const int mode); + + /** + * @brief write density matrix dm(ik) into *.dmk + * @param directory directory of *.dmk files + * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) + * @param ik k-point index + */ + void write_DMK(const std::string directory, const int ispin, const int ik); + + /** + * @brief read *.dmk into density matrix dm(ik) + * @param directory directory of *.dmk files + * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) + * @param ik k-point index + */ + void read_DMK(const std::string directory, const int ispin, const int ik); + + /** + * @brief save _DMR into _DMR_save + */ + void save_DMR(); + + std::vector EDMK; // for TD-DFT + +#ifdef __PEXSI + /** + * @brief EDM storage for PEXSI + * used in MD calculation + */ + std::vector pexsi_EDM; +#endif + + private: + /** + * @brief HContainer for density matrix in real space for 2D parallelization + * vector.size() = 1 for non-polarization and SOC + * vector.size() = 2 for spin-polarization + */ + std::vector*> _DMR; + std::vector> _DMR_save; + + /** + * @brief HContainer for density matrix in real space for gird parallelization + * vector.size() = 1 for non-polarization and SOC + * vector.size() = 2 for spin-polarization + */ + std::vector*> _DMR_grid; + + /** + * @brief density matrix in k space, which is a vector[ik] + * DMK should be a [_nspin][_nk][i][j] matrix, + * whose size is _nspin * _nk * _paraV->get_nrow() * _paraV->get_ncol() + */ + // std::vector _DMK; + std::vector> _DMK; + + /** + * @brief K_Vectors object, which is used to get k-point information + */ + const std::vector> _kvec_d; + + /** + * @brief Parallel_Orbitals object, which contain all information of 2D block cyclic distribution + */ + const Parallel_Orbitals* _paraV = nullptr; + + /** + * @brief spin-polarization index (1 - none spin and SOC ; 2 - spin polarization) + * Attention: this is not as same as GlovalV::NSPIN + * _nspin means the number of isolated spin-polarization states + */ + int _nspin = 1; + + /** + * @brief real number of k-points + * _nk is not equal to _kv->get_nks() when spin-polarization is considered + * _nk = kv->get_nks() / nspin when nspin=2 + */ + int _nk = 0; + + /// temporary pointers for switch DMR, only used with nspin=2 + std::vector dmr_origin_; + TR* dmr_tmp_ = nullptr; + +}; + +} // namespace elecstate + +#endif From 2f07ba2ab804e32790a2a02b42a2cc5ef7b081aa Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:37:35 +0800 Subject: [PATCH 02/81] Update global_file.cpp --- source/source_base/global_file.cpp | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/source/source_base/global_file.cpp b/source/source_base/global_file.cpp index b77fec489c..6d7f5a84a9 100644 --- a/source/source_base/global_file.cpp +++ b/source/source_base/global_file.cpp @@ -25,6 +25,7 @@ void ModuleBase::Global_File::make_dir_out( const std::string &suffix, const std::string &calculation, const bool &out_dir, + const bool &out_wfc_dir, const int rank, const bool &restart, const bool out_alllog) @@ -153,6 +154,46 @@ void ModuleBase::Global_File::make_dir_out( #endif } + if(out_wfc_dir) + { + int make_dir_wfc = 0; + std::string command1 = "test -d " + PARAM.globalv.global_wfc_dir + " || mkdir " + PARAM.globalv.global_wfc_dir; + + times = 0; + while(times0) { break; +} + ++times; + } + +#ifdef __MPI + if(make_dir_wfc==0) + { + std::cout << " CAN NOT MAKE THE WFC DIR......." << std::endl; + ModuleBase::QUIT(); + } + MPI_Barrier(MPI_COMM_WORLD); +#endif + } + + if(PARAM.inp.of_ml_gene_data == 1) { int make_dir_descrip = 0; From 1dc6abc0c4b5c4542215bc91a961815087398600 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:38:45 +0800 Subject: [PATCH 03/81] Update global_file.h --- source/source_base/global_file.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/source_base/global_file.h b/source/source_base/global_file.h index 9b6895388c..2b52b838ce 100644 --- a/source/source_base/global_file.h +++ b/source/source_base/global_file.h @@ -23,6 +23,7 @@ namespace Global_File void make_dir_out(const std::string &suffix, const std::string &calculation, const bool &out_dir, + const bool &out_wfc_dir, const int rank, const bool &restart, const bool out_alllog = false); From 94c45bd4f907738e0030b0c8b660bf0ba0294506 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:40:38 +0800 Subject: [PATCH 04/81] Update ORB_nonlocal_lm.h --- source/source_basis/module_ao/ORB_nonlocal_lm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/source_basis/module_ao/ORB_nonlocal_lm.h b/source/source_basis/module_ao/ORB_nonlocal_lm.h index 31ed209f14..b3504065ae 100644 --- a/source/source_basis/module_ao/ORB_nonlocal_lm.h +++ b/source/source_basis/module_ao/ORB_nonlocal_lm.h @@ -45,6 +45,9 @@ class Numerical_Nonlocal_Lm const double& getKpoint(const int &ik) const { return this->k_radial[ik]; } const double* getBeta_k() const { return this->beta_k; } const double& getBeta_k(const int &ik) const { return this->beta_k[ik]; } + + const int& getNk() const { return nk; } + const double& getDruniform() const { return dr_uniform; } // enables deep copy Numerical_Nonlocal_Lm& operator= (const Numerical_Nonlocal_Lm& nol ); From 6bd0ee5083d28bca6c9d6df8f51540f68c53bd2e Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:42:41 +0800 Subject: [PATCH 05/81] Update H_TDDFT_pw.cpp --- .../source_estate/module_pot/H_TDDFT_pw.cpp | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/source/source_estate/module_pot/H_TDDFT_pw.cpp b/source/source_estate/module_pot/H_TDDFT_pw.cpp index bd008b1626..226966ad86 100644 --- a/source/source_estate/module_pot/H_TDDFT_pw.cpp +++ b/source/source_estate/module_pot/H_TDDFT_pw.cpp @@ -44,7 +44,9 @@ double H_TDDFT_pw::lcut2; // velocity gauge ModuleBase::Vector3 H_TDDFT_pw::At; - +ModuleBase::Vector3 H_TDDFT_pw::At_laststep; +// hybrid gague +ModuleBase::Vector3 H_TDDFT_pw::Et; // time domain parameters // Gauss @@ -83,15 +85,18 @@ std::vector H_TDDFT_pw::heavi_amp; // Ry/bohr void H_TDDFT_pw::current_step_info(const std::string& file_dir, int& istep) { std::stringstream ssc; - ssc << file_dir << "Restart_md.dat"; + ssc << file_dir << "Restart_td.dat"; std::ifstream file(ssc.str().c_str()); if (!file) { - ModuleBase::WARNING_QUIT("H_TDDFT_pw::current_step_info", "No Restart_md.dat!"); + ModuleBase::WARNING_QUIT("H_TDDFT_pw::current_step_info", "No Restart_td.dat!"); } file >> istep; + file >> At[0] >> At[1] >>At[2]; + file >> At_laststep[0] >> At_laststep[1] >> At_laststep[2]; + At_laststep=-At_laststep; file.close(); } @@ -99,8 +104,8 @@ void H_TDDFT_pw::cal_fixed_v(double* vl_pseudo) { ModuleBase::TITLE("H_TDDFT_pw", "cal_fixed_v"); - // skip if velocity_gauge - if (stype == 1) + // skip if not length gague + if (stype != 0) { return; } @@ -283,6 +288,10 @@ void H_TDDFT_pw::update_At() //std::cout << "calculate electric potential" << std::endl; // time evolve H_TDDFT_pw::istep++; + // midpoint rule should be used both in Hamiltonian and here. + At = At + At_laststep/2.0; + At_laststep.set(0.0, 0.0, 0.0); + Et.set(0.0, 0.0, 0.0); // judgement to skip vext if (!PARAM.inp.td_vext || istep > tend || istep < tstart) @@ -329,7 +338,11 @@ void H_TDDFT_pw::update_At() switch (stype) { case 1: - At[direc - 1] -= out; + At_laststep[direc - 1] -= out; + break; + case 2: + At_laststep[direc-1] -= out; + Et[direc-1] += vext_time[0]; break; default: std::cout << "space_domain_type of electric field is wrong" << std::endl; @@ -349,6 +362,7 @@ void H_TDDFT_pw::update_At() // total count++ count++; } + At = At + At_laststep/2.0; ModuleBase::timer::tick("H_TDDFT_pw", "update_At"); return; @@ -373,7 +387,7 @@ double H_TDDFT_pw::cal_v_time(int t_type, const bool last) break; case 3: - vext_time = cal_v_time_heaviside(); + vext_time = cal_v_time_heaviside(last); break; // case 4: @@ -460,7 +474,7 @@ double H_TDDFT_pw::cal_v_time_trigonometric(const bool last) return vext_time; } -double H_TDDFT_pw::cal_v_time_heaviside() +double H_TDDFT_pw::cal_v_time_heaviside(const bool last) { double t0 = *(heavi_t0.begin() + heavi_count); double amp = *(heavi_amp.begin() + heavi_count); @@ -473,7 +487,7 @@ double H_TDDFT_pw::cal_v_time_heaviside() { vext_time = 0.0; } - heavi_count++; + if(last)heavi_count++; return vext_time; } @@ -524,3 +538,4 @@ void H_TDDFT_pw::compute_force(const UnitCell& cell, ModuleBase::matrix& fe) } } // namespace elecstate + From 0a0f953f733ca81b437abe48da387202625444f0 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:43:31 +0800 Subject: [PATCH 06/81] Update H_TDDFT_pw.h --- source/source_estate/module_pot/H_TDDFT_pw.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/source_estate/module_pot/H_TDDFT_pw.h b/source/source_estate/module_pot/H_TDDFT_pw.h index d1dc718530..997ca29944 100644 --- a/source/source_estate/module_pot/H_TDDFT_pw.h +++ b/source/source_estate/module_pot/H_TDDFT_pw.h @@ -72,6 +72,8 @@ class H_TDDFT_pw : public PotBase // velocity gauge, vector magnetic potential static ModuleBase::Vector3 At; + static ModuleBase::Vector3 At_laststep; + static ModuleBase::Vector3 Et; // time domain parameters @@ -144,7 +146,7 @@ class H_TDDFT_pw : public PotBase static double cal_v_time_Gauss(const bool last); static double cal_v_time_trapezoid(const bool last); static double cal_v_time_trigonometric(const bool last); - static double cal_v_time_heaviside(); + static double cal_v_time_heaviside(const bool last); // double cal_v_time_HHG(); // get ncut number for At integral @@ -156,3 +158,4 @@ class H_TDDFT_pw : public PotBase } // namespace elecstate #endif + From 851a9a7c0ae4222e5fa646eef91e5183e8019cc3 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:48:20 +0800 Subject: [PATCH 07/81] Update esolver_ks_lcao_tddft.cpp --- .../source_esolver/esolver_ks_lcao_tddft.cpp | 313 ++++++++++++++---- 1 file changed, 249 insertions(+), 64 deletions(-) diff --git a/source/source_esolver/esolver_ks_lcao_tddft.cpp b/source/source_esolver/esolver_ks_lcao_tddft.cpp index f116b0d801..20803dd35f 100644 --- a/source/source_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/source_esolver/esolver_ks_lcao_tddft.cpp @@ -3,8 +3,10 @@ #include "module_io/cal_r_overlap_R.h" #include "module_io/dipole_io.h" #include "module_io/td_current_io.h" +#include "module_io/read_wfc_nao.h" #include "module_io/write_HS.h" #include "module_io/write_HS_R.h" +#include "module_io/output_log.h" #include "source_estate/elecstate_tools.h" //--------------temporary---------------------------- @@ -18,7 +20,6 @@ #include "source_estate/module_dm/density_matrix.h" #include "source_estate/occupy.h" #include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_io/print_info.h" @@ -29,6 +30,7 @@ #include "source_hsolver/hsolver_lcao.h" #include "module_parameter/parameter.h" #include "source_psi/psi.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" //-----force& stress------------------- #include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" @@ -38,11 +40,11 @@ namespace ModuleESolver { -template -ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() +template +ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() { - classname = "ESolver_rtTDDFT"; - basisname = "LCAO"; + this->classname = "ESolver_rtTDDFT"; + this->basisname = "LCAO"; // If the device is GPU, we must open use_tensor and use_lapack ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; @@ -53,13 +55,13 @@ ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() } } -template -ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() +template +ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() { delete psi_laststep; if (Hk_laststep != nullptr) { - for (int ik = 0; ik < kv.get_nks(); ++ik) + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { delete[] Hk_laststep[ik]; } @@ -67,38 +69,192 @@ ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() } if (Sk_laststep != nullptr) { - for (int ik = 0; ik < kv.get_nks(); ++ik) + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { delete[] Sk_laststep[ik]; } delete[] Sk_laststep; } + if (td_p != nullptr) + { + delete td_p; + } + TD_info::td_vel_op = nullptr; } -template -void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const Input_para& inp) +template +void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const Input_para& inp) { // 1) run before_all_runners in ESolver_KS_LCAO - ESolver_KS_LCAO, double>::before_all_runners(ucell, inp); + ESolver_KS_LCAO, TR>::before_all_runners(ucell, inp); // this line should be optimized // this->pelec = dynamic_cast(this->pelec); + + td_p = new TD_info(&ucell); + TD_info::td_vel_op = td_p; + totstep += TD_info::estep_shift; + + if (PARAM.inp.init_wfc == "file") + { + if (!ModuleIO::read_wfc_nao(PARAM.globalv.global_readin_dir, + this->pv, + *(this->psi), + this->pelec, + this->pelec->klist->ik2iktot, + this->pelec->klist->get_nkstot(), + PARAM.inp.nspin, + TD_info::estep_shift)) + { + ModuleBase::WARNING_QUIT("ESolver_KS_LCAO", "read electronic wave functions failed"); + } + } } +template +void ESolver_KS_LCAO_TDDFT::runner(UnitCell& ucell, const int istep) +{ + ModuleBase::TITLE("ESolver_KS_LCAO_TDDFT", "runner"); + ModuleBase::timer::tick(this->classname, "runner"); + + //---------------------------------------------------------------- + // 1) before_scf (electronic iteration loops) + //---------------------------------------------------------------- + this->before_scf(ucell, istep); + ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT SCF"); + + // things only initialize once + //this->pelec_td->first_evolve = true; + if(PARAM.inp.td_stype!=1 && TD_info::out_current) + { + // initialize the velocity operator + velocity_mat = new Velocity_op(&ucell, &(this->gd), &this->pv, this->orb_, this->two_center_bundle_.overlap_orb.get()); + //calculate velocity operator + velocity_mat->calculate_grad_term(); + velocity_mat->calculate_vcomm_r(); + } + int estep_max = (istep == 0) ? PARAM.inp.estep_per_md +1 : PARAM.inp.estep_per_md; + //int estep_max = PARAM.inp.estep_per_md; + for(int estep =0; estep < estep_max; estep++) + { + // calculate total time step + this->totstep++; + this->print_step(); + //update At + if(PARAM.inp.td_stype > 0) + { + elecstate::H_TDDFT_pw::update_At(); + td_p->cal_cart_At(elecstate::H_TDDFT_pw::At); + } + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", td_p->cart_At[0]); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ay(t)", td_p->cart_At[1]); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Az(t)", td_p->cart_At[2]); + //std::cout<<"Et: "<CE.update_all_dis(ucell); + this->CE.extrapolate_charge(&this->Pgrid, + ucell, + &this->chr, + &this->sf, + GlobalV::ofs_running, + GlobalV::ofs_warning); + //need to test if correct when estep>0 + this->pelec->init_scf(totstep, ucell, this->Pgrid, this->sf.strucFac, this->locpp.numeric, ucell.symm); + /*if(PARAM.inp.td_stype == 2) + { + dynamic_cast>*>(this->pelec)->get_DM()->cal_DMR_td(ucell, td_p->cart_At); + } + else + { + dynamic_cast>*>(this->pelec)->get_DM()->cal_DMR(); + }*/ + + if(totstep <= PARAM.inp.td_tend + 1) + { + TD_info::evolve_once = true; + } + } + //---------------------------------------------------------------- + // 2) SCF iterations + //---------------------------------------------------------------- + bool conv_esolver = false; + this->niter = this->maxniter; + this->diag_ethr = PARAM.inp.pw_diag_thr; + for (int iter = 1; iter <= this->maxniter; ++iter) + { + ModuleIO::write_head_td(GlobalV::ofs_running, istep, estep, iter, this->basisname); + //---------------------------------------------------------------- + // 3) initialization of SCF iterations + //---------------------------------------------------------------- + this->iter_init(ucell, totstep, iter); + + //---------------------------------------------------------------- + // 4) use Hamiltonian to obtain charge density + //---------------------------------------------------------------- + this->hamilt2rho(ucell, totstep, iter, this->diag_ethr); + + //---------------------------------------------------------------- + // 5) finish scf iterations + //---------------------------------------------------------------- + this->iter_finish(ucell, totstep, iter, conv_esolver); + + //---------------------------------------------------------------- + // 6) check convergence + //---------------------------------------------------------------- + if (conv_esolver || this->oscillate_esolver) + { + this->niter = iter; + if (this->oscillate_esolver) + { + std::cout << " !! Density oscillation is found, STOP HERE !!" << std::endl; + } + break; + } + } // end scf iterations -template -void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, + //---------------------------------------------------------------- + // 7) after scf + //---------------------------------------------------------------- + this->after_scf(ucell, totstep, conv_esolver); + if(!restart_done && PARAM.inp.mdp.md_restart) + { + estep += TD_info::estep_shift%PARAM.inp.estep_per_md; + restart_done = true; + if(estep==0)break; + } + } + if(PARAM.inp.td_stype!=1 && TD_info::out_current) + { + delete velocity_mat; + } + ModuleBase::timer::tick(this->classname, "runner"); + return; +} +//output electronic step infos +template +void ESolver_KS_LCAO_TDDFT::print_step() +{ + std::cout << " -------------------------------------------" << std::endl; + GlobalV::ofs_running << "\n -------------------------------------------" << std::endl; + std::cout << " STEP OF ELECTRON EVOLVE : " << unsigned(totstep) << std::endl; + GlobalV::ofs_running << " STEP OF ELECTRON EVOLVE : " << unsigned(totstep) << std::endl; + std::cout << " -------------------------------------------" << std::endl; + GlobalV::ofs_running << " -------------------------------------------" << std::endl; +} +template +void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) { if (PARAM.inp.init_wfc == "file") { - if (istep >= 1) + if (istep >= TD_info::estep_shift + 1) { module_tddft::Evolve_elec::solve_psi(istep, PARAM.inp.nbands, PARAM.globalv.nlocal, - kv.get_nks(), + this->kv.get_nks(), this->p_hamilt, this->pv, this->psi, @@ -111,16 +267,15 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, PARAM.inp.propagator, use_tensor, use_lapack); - this->weight_dm_rho(); } - this->weight_dm_rho(); + this->weight_dm_rho(ucell); } - else if (istep >= 2) + else if (istep >= 1) { module_tddft::Evolve_elec::solve_psi(istep, PARAM.inp.nbands, PARAM.globalv.nlocal, - kv.get_nks(), + this->kv.get_nks(), this->p_hamilt, this->pv, this->psi, @@ -133,7 +288,7 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, PARAM.inp.propagator, use_tensor, use_lapack); - this->weight_dm_rho(); + this->weight_dm_rho(ucell); } else { @@ -154,7 +309,7 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, Symmetry_rho srho; for (int is = 0; is < PARAM.inp.nspin; is++) { - srho.begin(is, this->chr, pw_rho, ucell.symm); + srho.begin(is, this->chr, this->pw_rho, ucell.symm); } } @@ -162,8 +317,8 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); } -template -void ESolver_KS_LCAO_TDDFT::iter_finish( +template +void ESolver_KS_LCAO_TDDFT::iter_finish( UnitCell& ucell, const int istep, int& iter, @@ -179,7 +334,7 @@ void ESolver_KS_LCAO_TDDFT::iter_finish( GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); GlobalV::ofs_running << std::left; std::setprecision(6); - for (int ik = 0; ik < kv.get_nks(); ik++) + for (int ik = 0; ik < this->kv.get_nks(); ik++) { for (int ib = 0; ib < PARAM.inp.nbands; ib++) { @@ -192,11 +347,11 @@ void ESolver_KS_LCAO_TDDFT::iter_finish( << std::endl; } - ESolver_KS_LCAO, double>::iter_finish(ucell, istep, iter, conv_esolver); + ESolver_KS_LCAO, TR>::iter_finish(ucell, istep, iter, conv_esolver); } -template -void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, +template +void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver) @@ -220,7 +375,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, const int nlocal = PARAM.globalv.nlocal; // store wfc and Hk laststep - if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) && conv_esolver) + if (conv_esolver) { if (this->psi_laststep == nullptr) { @@ -233,7 +388,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, ncol_tmp = nbands; nrow_tmp = nlocal; #endif - this->psi_laststep = new psi::Psi>(kv.get_nks(), ncol_tmp, nrow_tmp, kv.ngk, true); + this->psi_laststep = new psi::Psi>(this->kv.get_nks(), ncol_tmp, nrow_tmp, this->kv.ngk, true); } @@ -245,8 +400,8 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, if (this->Hk_laststep == nullptr) { - this->Hk_laststep = new std::complex*[kv.get_nks()]; - for (int ik = 0; ik < kv.get_nks(); ++ik) + this->Hk_laststep = new std::complex*[this->kv.get_nks()]; + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { // Allocate memory for Hk_laststep, if (use_tensor && use_lapack), should be global this->Hk_laststep[ik] = new std::complex[len_HS]; @@ -255,8 +410,8 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, } if (this->Sk_laststep == nullptr) { - this->Sk_laststep = new std::complex*[kv.get_nks()]; - for (int ik = 0; ik < kv.get_nks(); ++ik) + this->Sk_laststep = new std::complex*[this->kv.get_nks()]; + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { // Allocate memory for Sk_laststep, if (use_tensor && use_lapack), should be global this->Sk_laststep[ik] = new std::complex[len_HS]; @@ -266,16 +421,16 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, } // put information to Hk_laststep and Sk_laststep - for (int ik = 0; ik < kv.get_nks(); ++ik) + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { this->psi->fix_k(ik); this->psi_laststep->fix_k(ik); // copy the data from psi to psi_laststep - const int size0 = psi->get_nbands() * psi->get_nbasis(); + const int size0 = this->psi->get_nbands() * this->psi->get_nbasis(); for (int index = 0; index < size0; ++index) { - psi_laststep[0].get_pointer()[index] = psi[0].get_pointer()[index]; + psi_laststep[0].get_pointer()[index] = this->psi[0].get_pointer()[index]; } // store Hamiltonian @@ -316,7 +471,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, } // calculate energy density matrix for tddft - if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 2) && PARAM.inp.td_edm == 0) + if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) && PARAM.inp.td_edm == 0) { elecstate::cal_edm_tddft(this->pv, this->pelec, this->kv, this->p_hamilt); } @@ -336,7 +491,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, GlobalV::ofs_running << std::setprecision(6); GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); - for (int ik = 0; ik < kv.get_nks(); ik++) + for (int ik = 0; ik < this->kv.get_nks(); ik++) { for (int ib = 0; ib < PARAM.inp.nbands; ib++) { @@ -350,13 +505,13 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, */ } -template -void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) +template +void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) { ModuleBase::TITLE("ESolver_LCAO_TDDFT", "after_scf"); ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); - ESolver_KS_LCAO, double>::after_scf(ucell, istep, conv_esolver); + ESolver_KS_LCAO, TR>::after_scf(ucell, istep, conv_esolver); // (1) write dipole information for (int is = 0; is < PARAM.inp.nspin; is++) @@ -373,31 +528,52 @@ void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, ss_dipole.str()); } } - - // (2) write current information - if (TD_Velocity::out_current == true) - { - elecstate::DensityMatrix, double>* tmp_DM + elecstate::DensityMatrix, double>* tmp_DM = dynamic_cast>*>(this->pelec)->get_DM(); - - ModuleIO::write_current(ucell, - this->gd, - istep, - this->psi, - pelec, - kv, - two_center_bundle_.overlap_orb.get(), - tmp_DM->get_paraV_pointer(), - orb_, - this->RA); + // (2) write current information + if(TD_info::out_current) + { + if(TD_info::out_current_k) + { + ModuleIO::write_current_eachk(ucell, + istep, + this->psi, + this->pelec, + this->kv, + this->two_center_bundle_.overlap_orb.get(), + tmp_DM->get_paraV_pointer(), + this->orb_, + this->velocity_mat, + this->RA); + } + else + { + ModuleIO::write_current(ucell, + istep, + this->psi, + this->pelec, + this->kv, + this->two_center_bundle_.overlap_orb.get(), + tmp_DM->get_paraV_pointer(), + this->orb_, + this->velocity_mat, + this->RA); + } } + // (3) output energy for sub loop + std::cout << "Potential (Ry): " << std::setprecision(15) << this->pelec->f_en.etot <out_restart_info(istep, elecstate::H_TDDFT_pw::At, elecstate::H_TDDFT_pw::At_laststep); + } + ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); } -template -void ESolver_KS_LCAO_TDDFT::weight_dm_rho() +template +void ESolver_KS_LCAO_TDDFT::weight_dm_rho(const UnitCell& ucell) { if (PARAM.inp.ocp == 1) { @@ -417,15 +593,24 @@ void ESolver_KS_LCAO_TDDFT::weight_dm_rho() auto _pes = dynamic_cast>*>(this->pelec); elecstate::cal_dm_psi(_pes->DM->get_paraV_pointer(), _pes->wg, this->psi[0], *(_pes->DM)); - _pes->DM->cal_DMR(); + if(PARAM.inp.td_stype == 2) + { + _pes->DM->cal_DMR_td(ucell, td_p->cart_At); + } + else + { + _pes->DM->cal_DMR(); + } // get the real-space charge density this->pelec->psiToRho(this->psi[0]); } -template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT, base_device::DEVICE_CPU>; #if ((defined __CUDA) /* || (defined __ROCM) */) -template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT, base_device::DEVICE_GPU>; #endif } // namespace ModuleESolver From a40adcd99720dde72324f6594347daaf565459bd Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:49:56 +0800 Subject: [PATCH 08/81] Update esolver_ks_lcao_tddft.h --- source/source_esolver/esolver_ks_lcao_tddft.h | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/source/source_esolver/esolver_ks_lcao_tddft.h b/source/source_esolver/esolver_ks_lcao_tddft.h index d3a7780c68..491d8e842f 100644 --- a/source/source_esolver/esolver_ks_lcao_tddft.h +++ b/source/source_esolver/esolver_ks_lcao_tddft.h @@ -5,6 +5,8 @@ #include "source_base/scalapack_connector.h" // Cpxgemr2d #include "module_hamilt_lcao/hamilt_lcaodft/record_adj.h" #include "source_psi/psi.h" +#include "module_hamilt_lcao/module_tddft/velocity_op.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" namespace ModuleESolver { @@ -47,8 +49,8 @@ void gatherMatrix(const int myid, const int root_proc, const hamilt::MatrixBlock } //------------------------ MPI gathering and distributing functions ------------------------// -template -class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO, double> +template +class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO, TR> { public: ESolver_KS_LCAO_TDDFT(); @@ -58,6 +60,8 @@ class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO, doubl void before_all_runners(UnitCell& ucell, const Input_para& inp) override; protected: + virtual void runner(UnitCell& cell, const int istep) override; + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; virtual void update_pot(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver) override; @@ -66,6 +70,7 @@ class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO, doubl virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override; + void print_step(); //! wave functions of last time step psi::Psi>* psi_laststep = nullptr; @@ -81,9 +86,21 @@ class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO, doubl bool use_tensor = false; bool use_lapack = false; + //! Total steps for evolving the wave function + int totstep = -1; + + //! Velocity matrix for calculating current + Velocity_op* velocity_mat = nullptr; + + TD_info* td_p = nullptr; + + //! doubt + bool restart_done = false; + private: - void weight_dm_rho(); + void weight_dm_rho(const UnitCell& ucell); }; } // namespace ModuleESolver #endif + From ff8bbaa951f9322f78cc96f3974fefdcbbd5def2 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:50:52 +0800 Subject: [PATCH 09/81] Update esolver_ks_lcao.cpp --- source/source_esolver/esolver_ks_lcao.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/source_esolver/esolver_ks_lcao.cpp b/source/source_esolver/esolver_ks_lcao.cpp index 483ae23d5a..d2578954a8 100644 --- a/source/source_esolver/esolver_ks_lcao.cpp +++ b/source/source_esolver/esolver_ks_lcao.cpp @@ -159,7 +159,7 @@ void ESolver_KS_LCAO::before_all_runners(UnitCell& ucell, const Input_pa } // 5) read psi from file - if (PARAM.inp.init_wfc == "file") + if (PARAM.inp.init_wfc == "file" && PARAM.inp.esolver_type != "tddft") { if (!ModuleIO::read_wfc_nao(PARAM.globalv.global_readin_dir, this->pv, From 975362775f1f3800bd187ac30656547f3a9e7a72 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:52:33 +0800 Subject: [PATCH 10/81] Update esolver_ks.cpp --- source/source_esolver/esolver_ks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/source_esolver/esolver_ks.cpp b/source/source_esolver/esolver_ks.cpp index 81397e2565..6bd1cd1222 100644 --- a/source/source_esolver/esolver_ks.cpp +++ b/source/source_esolver/esolver_ks.cpp @@ -287,7 +287,10 @@ void ESolver_KS::before_scf(UnitCell& ucell, const int istep) template void ESolver_KS::iter_init(UnitCell& ucell, const int istep, const int iter) { - ModuleIO::write_head(GlobalV::ofs_running, istep, iter, this->basisname); + if(PARAM.inp.esolver_type != "tddft") + { + ModuleIO::write_head(GlobalV::ofs_running, istep, iter, this->basisname); + } #ifdef __MPI iter_time = MPI_Wtime(); From d9edeedb76b05d2b05b465c1036fb9fddf805925 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:54:35 +0800 Subject: [PATCH 11/81] Update esolver.cpp --- source/source_esolver/esolver.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/source/source_esolver/esolver.cpp b/source/source_esolver/esolver.cpp index bac35d027b..fcf8927d17 100644 --- a/source/source_esolver/esolver.cpp +++ b/source/source_esolver/esolver.cpp @@ -230,13 +230,26 @@ ESolver* init_esolver(const Input_para& inp, UnitCell& ucell) } else if (esolver_type == "ksdft_lcao_tddft") { -#if ((defined __CUDA) /* || (defined __ROCM) */) - if (PARAM.inp.device == "gpu") + if (PARAM.inp.nspin < 4) { - return new ESolver_KS_LCAO_TDDFT(); +#if ((defined __CUDA) /* || (defined __ROCM) */) + if (PARAM.inp.device == "gpu") + { + return new ESolver_KS_LCAO_TDDFT(); + } +#endif + return new ESolver_KS_LCAO_TDDFT(); } + else + { +#if ((defined __CUDA) /* || (defined __ROCM) */) + if (PARAM.inp.device == "gpu") + { + return new ESolver_KS_LCAO_TDDFT, base_device::DEVICE_GPU>(); + } #endif - return new ESolver_KS_LCAO_TDDFT(); + return new ESolver_KS_LCAO_TDDFT, base_device::DEVICE_CPU>(); + } } else if (esolver_type == "lr_lcao") { From 138811fb6292b164e24c5cc827d48bddac78cfd0 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:55:13 +0800 Subject: [PATCH 12/81] Update operator.h --- source/source_hamilt/operator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/source_hamilt/operator.h b/source/source_hamilt/operator.h index 4f7c9e2a0f..4198220a02 100644 --- a/source/source_hamilt/operator.h +++ b/source/source_hamilt/operator.h @@ -26,7 +26,7 @@ enum class calculation_type lcao_exx, lcao_dftu, lcao_sc_lambda, - lcao_tddft_velocity, + lcao_tddft_periodic, }; // Basic class for operator module, From d143d8ef8d9c1fa9bef6d06a6c913d35978f37b7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:56:34 +0800 Subject: [PATCH 13/81] Update CMakeLists.txt --- source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt b/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt index 2f1cd951ae..ba00725b73 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt +++ b/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt @@ -13,6 +13,7 @@ if(ENABLE_LCAO) operator_lcao/nonlocal_new.cpp operator_lcao/td_ekinetic_lcao.cpp operator_lcao/td_nonlocal_lcao.cpp + operator_lcao/td_pot_hybrid.cpp operator_lcao/dspin_lcao.cpp operator_lcao/dftu_lcao.cpp pulay_force_stress_center2.cpp From f25b3a26fc066c85dc18f26579553fde3bddfb24 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:56:47 +0800 Subject: [PATCH 14/81] Update CMakeLists.txt --- .../hamilt_lcaodft/operator_lcao/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt index 2e1afc328e..0e49a9dc43 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt @@ -11,6 +11,7 @@ add_library( nonlocal_new.cpp td_ekinetic_lcao.cpp td_nonlocal_lcao.cpp + td_pot_hybrid.cpp dspin_lcao.cpp dftu_lcao.cpp ) From 63101bd89ec56b06e6f509a829ec8294b9c1f6e5 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:58:24 +0800 Subject: [PATCH 15/81] Update operator_lcao.cpp --- .../operator_lcao/operator_lcao.cpp | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp index cb7b1d0169..1657e4de80 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp @@ -12,6 +12,8 @@ #include "source_hsolver/diago_elpa_native.h" #endif +#include "module_hamilt_lcao/module_tddft/td_info.h" + namespace hamilt { template <> @@ -240,8 +242,8 @@ void OperatorLCAO::init(const int ik_in) { } // contributeHk() -template -void OperatorLCAO::contributeHk(int ik) { +template <> +void OperatorLCAO::contributeHk(int ik) { ModuleBase::TITLE("OperatorLCAO", "contributeHk"); ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) @@ -256,6 +258,37 @@ void OperatorLCAO::contributeHk(int ik) { } ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); } +// contributeHk() +template +void OperatorLCAO::contributeHk(int ik) { + ModuleBase::TITLE("OperatorLCAO", "contributeHk"); + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); + if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->hsk->get_pv()->get_row_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + else + { + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + } + else + { + const int ncol = this->hsk->get_pv()->get_col_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + else + { + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + } + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); +} template class OperatorLCAO; template class OperatorLCAO, double>; From 0583ba42192c6514094e28128e6e719fc4cc8cf6 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:59:27 +0800 Subject: [PATCH 16/81] Update overlap_new.cpp --- .../operator_lcao/overlap_new.cpp | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp index 74aa5452ab..f96f8fd67f 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp @@ -7,6 +7,7 @@ #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" #include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" #include +#include "module_hamilt_lcao/module_tddft/td_info.h" template hamilt::OverlapNew>::OverlapNew(HS_Matrix_K* hsk_in, @@ -188,11 +189,11 @@ void hamilt::OverlapNew>::contributeHR() } // contributeHk() -template -void hamilt::OverlapNew>::contributeHk(int ik) +template <> +void hamilt::OverlapNew>::contributeHk(int ik) { //! if k vector is not changed, then do nothing and return, only for gamma_only case - if (this->kvec_d[ik] == this->kvec_d_old && std::is_same::value) + if (this->kvec_d[ik] == this->kvec_d_old) { return; } @@ -217,7 +218,44 @@ void hamilt::OverlapNew>::contributeHk(int ik) ModuleBase::timer::tick("OverlapNew", "contributeHk"); } +template +void hamilt::OverlapNew>::contributeHk(int ik) +{ + ModuleBase::TITLE("OverlapNew", "contributeHk"); + ModuleBase::timer::tick("OverlapNew", "contributeHk"); + + //! set SK to zero and then calculate SK for each k vector + this->hsk->set_zero_sk(); + if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + else + { + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + } + else + { + const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + else + { + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + } + + // update kvec_d_old + this->kvec_d_old = this->kvec_d[ik]; + ModuleBase::timer::tick("OverlapNew", "contributeHk"); +} template TK* hamilt::OverlapNew>::getSk() { From 0a3bd92a07b818b41fa46361d358111fd97eaa79 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:00:34 +0800 Subject: [PATCH 17/81] Update td_ekinetic_lcao.cpp --- .../operator_lcao/td_ekinetic_lcao.cpp | 67 ++++++------------- 1 file changed, 20 insertions(+), 47 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp index e9f611b91c..2b202b7811 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp @@ -25,9 +25,8 @@ TDEkinetic>::TDEkinetic(HS_Matrix_K* hsk_in, : OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), orb_cutoff_(orb_cutoff), kv(kv_in), intor_(intor) { this->ucell = ucell_in; - this->cal_type = calculation_type::lcao_tddft_velocity; + this->cal_type = calculation_type::lcao_tddft_periodic; this->Grid = GridD_in; - this->init_td(); // initialize HR to get adjs info. this->initialize_HR(Grid); } @@ -39,28 +38,19 @@ TDEkinetic>::~TDEkinetic() { delete this->hR_tmp; } - TD_Velocity::td_vel_op = nullptr; + TD_info::td_vel_op = nullptr; } // term A^2*S template -void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc,const TR& overlap, int nnr) -{ - return; -} - -// term A^2*S -template <> -void TDEkinetic, double>>::td_ekinetic_scalar(std::complex* Hloc, - const double& overlap, - int nnr) +void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc, + const TR& overlap, + int nnr) { // the correction term A^2/2. From Hatree to Ry, it needs to be multiplied by 2.0 - std::complex tmp = {cart_At.norm2() * overlap, 0}; - Hloc[nnr] += tmp; + Hloc[nnr] += cart_At.norm2() * overlap; return; } - // term A dot āˆ‡ template void TDEkinetic>::td_ekinetic_grad(std::complex* Hloc, @@ -106,12 +96,12 @@ void TDEkinetic>::calculate_HR() hamilt::BaseMatrix>* tmp = this->hR_tmp->find_matrix(iat1, iat2, R_index2); if (tmp != nullptr) { - if (TD_Velocity::out_current) + if (TD_info::out_current) { std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; for (int i = 0; i < 3; i++) { - tmp_c[i] = td_velocity.get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); + tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); } this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_c); } @@ -233,19 +223,12 @@ void TDEkinetic>::cal_HR_IJR(const int& iat1, } } } -// init two center integrals and vector potential for td_ekintic term +//update vector potential for td_ekintic term template -void TDEkinetic>::init_td() +void TDEkinetic>::update_td() { - TD_Velocity::td_vel_op = &td_velocity; - // calculate At in cartesian coorinates. - td_velocity.cal_cart_At(elecstate::H_TDDFT_pw::At); - this->cart_At = td_velocity.cart_At; - - // mohan update 2025-04-20 - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", cart_At[0]); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ay(t)", cart_At[1]); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Az(t)", cart_At[2]); + //std::cout<<"velocity"<cart_At = TD_info::td_vel_op->cart_At; } template @@ -343,7 +326,7 @@ void TDEkinetic>::contributeHR() { return; } - if (!this->hR_tmp_done) + if (!this->hR_tmp_done || TD_info::evolve_once) { const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); // if this Operator is the first node of the sub_chain, then hR_tmp is nullptr @@ -360,11 +343,13 @@ void TDEkinetic>::contributeHR() static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); } // initialize current term if needed - if (TD_Velocity::out_current) + if (TD_info::out_current) { - td_velocity.initialize_current_term(this->hR_tmp, paraV); + TD_info::td_vel_op->initialize_current_term(this->hR_tmp, paraV); } // calculate the values in hR_tmp + this->update_td(); + this->hR_tmp->set_zero(); this->calculate_HR(); this->hR_tmp_done = true; } @@ -376,12 +361,7 @@ void TDEkinetic>::contributeHR() template void TDEkinetic>::contributeHk(int ik) { - return; -} -template <> -void TDEkinetic, double>>::contributeHk(int ik) -{ - if (TD_Velocity::tddft_velocity == false) + if (PARAM.inp.td_stype != 1) { return; } @@ -392,12 +372,7 @@ void TDEkinetic, double>>::contributeHk(int ik const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); // save HR data for output int spin_tot = PARAM.inp.nspin; - - if (spin_tot == 4) - { - - } - else if (!output_hR_done && TD_Velocity::out_mat_R) + if (!output_hR_done && TD_info::out_mat_R) { for (int spin_now = 0; spin_now < spin_tot; spin_now++) { @@ -405,11 +380,10 @@ void TDEkinetic, double>>::contributeHk(int ik spin_now, 1e-10, *hR_tmp, - td_velocity.HR_sparse_td_vel[spin_now]); + TD_info::td_vel_op->HR_sparse_td_vel[spin_now]); } output_hR_done = true; } - // folding inside HR to HK if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) { @@ -426,7 +400,6 @@ void TDEkinetic, double>>::contributeHk(int ik } } -template class TDEkinetic>; template class TDEkinetic, double>>; template class TDEkinetic, std::complex>>; From b378c104bad91e8dc9d42ec9c0d11fa159faf28f Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:01:40 +0800 Subject: [PATCH 18/81] Update td_ekinetic_lcao.h --- .../hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h index 6b9ca3e547..310504aa07 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h @@ -5,7 +5,7 @@ #include "source_cell/klist.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include "operator_lcao.h" #include @@ -48,8 +48,8 @@ class TDEkinetic> : public OperatorLCAO virtual void contributeHk(int ik) override; - /// @brief init two center integrals and vector potential for td_ekintic term - void init_td(); + /// @brief update vector potential + void update_td(); /** * @brief initialize HR, search the nearest neighbor atoms @@ -83,7 +83,6 @@ class TDEkinetic> : public OperatorLCAO virtual void set_HR_fixed(void*) override; - TD_Velocity td_velocity; private: @@ -124,3 +123,4 @@ class TDEkinetic> : public OperatorLCAO } // namespace hamilt #endif + From dad7c0db24c561a2f60362e54a91e24ddc02934d Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:03:04 +0800 Subject: [PATCH 19/81] Update td_nonlocal_lcao.cpp --- .../operator_lcao/td_nonlocal_lcao.cpp | 51 ++++--------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp index 5a11adb57b..391dca66f0 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp @@ -22,14 +22,13 @@ hamilt::TDNonlocal>::TDNonlocal(HS_Matrix_K* hs const Grid_Driver* GridD_in) : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_(orb) { - this->cal_type = calculation_type::lcao_tddft_velocity; + this->cal_type = calculation_type::lcao_tddft_periodic; this->ucell = ucell_in; this->Grid = GridD_in; #ifdef __DEBUG assert(this->ucell != nullptr); #endif // initialize HR to get adjs info. - this->init_td(); this->initialize_HR(Grid); } @@ -43,10 +42,10 @@ hamilt::TDNonlocal>::~TDNonlocal() } } template -void hamilt::TDNonlocal>::init_td() +void hamilt::TDNonlocal>::update_td() { // calculate At in cartesian coorinates. - this->cart_At = TD_Velocity::td_vel_op->cart_At; + this->cart_At = TD_info::td_vel_op->cart_At; } // initialize_HR() template @@ -130,7 +129,7 @@ void hamilt::TDNonlocal>::calculate_HR() const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); const int npol = this->ucell->get_npol(); - const int nlm_dim = TD_Velocity::out_current ? 4 : 1; + const int nlm_dim = TD_info::out_current ? 4 : 1; // 1. calculate for each pair of atoms for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) @@ -182,7 +181,7 @@ void hamilt::TDNonlocal>::calculate_HR() tau0 * this->ucell->lat0, T0, cart_At, - TD_Velocity::out_current); + TD_info::out_current); for (int dir = 0; dir < nlm_dim; dir++) { nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); @@ -245,12 +244,12 @@ void hamilt::TDNonlocal>::calculate_HR() // if not found , skip this pair of atoms if (tmp != nullptr) { - if (TD_Velocity::out_current) + if (TD_info::out_current) { std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; for (int i = 0; i < 3; i++) { - tmp_c[i] = TD_Velocity::td_vel_op->get_current_term_pointer(i) + tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i) ->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]) ->get_pointer(); } @@ -295,7 +294,7 @@ void hamilt::TDNonlocal>::cal_HR_IJR( std::complex* data_pointer, std::complex** data_pointer_c) { - const int nlm_dim = TD_Velocity::out_current ? 4 : 1; + const int nlm_dim = TD_info::out_current ? 4 : 1; // npol is the number of polarizations, // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) @@ -411,7 +410,7 @@ void hamilt::TDNonlocal>::contributeHR() ModuleBase::timer::tick("TDNonlocal", "contributeHR"); - if (!this->hR_tmp_done) + if (!this->hR_tmp_done || TD_info::evolve_once) { if (this->hR_tmp == nullptr) { @@ -427,8 +426,10 @@ void hamilt::TDNonlocal>::contributeHR() } // calculate the values in hR_tmp + this->update_td(); this->calculate_HR(); this->hR_tmp_done = true; + TD_info::evolve_once = false; } ModuleBase::timer::tick("TDNonlocal", "contributeHR"); @@ -442,35 +443,5 @@ void hamilt::TDNonlocal>::contributeHk(int ik) return; } - -template <> -void hamilt::TDNonlocal, double>>::contributeHk(int ik) -{ - if (TD_Velocity::tddft_velocity == false) - { - return; - } - else - { - ModuleBase::TITLE("TDNonlocal", "contributeHk"); - ModuleBase::timer::tick("TDNonlocal", "contributeHk"); - - // folding inside HR to HK - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - - ModuleBase::timer::tick("TDNonlocal", "contributeHk"); - } -} - -template class hamilt::TDNonlocal>; template class hamilt::TDNonlocal, double>>; template class hamilt::TDNonlocal, std::complex>>; From 3aefc9f08cddceb26968b1d4c790ccfe3e193a83 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:03:34 +0800 Subject: [PATCH 20/81] Update td_nonlocal_lcao.h --- .../hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h index 6487bc0fc2..d89e7b38e5 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h @@ -6,7 +6,7 @@ #include "source_estate/module_pot/H_TDDFT_pw.h" #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" #include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include @@ -78,7 +78,7 @@ class TDNonlocal> : public OperatorLCAO */ void initialize_HR_tmp(const Parallel_Orbitals* paraV); /// @brief init vector potential for td_nonlocal term - void init_td(); + void update_td(); /** * @brief calculate the non-local pseudopotential matrix with specific atom-pairs * nearest neighbor atoms don't need to be calculated again From 741c4e1124e2f24c389a55c36b76b1a70782a411 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:08:20 +0800 Subject: [PATCH 21/81] Add files via upload --- .../operator_lcao/td_pot_hybrid.cpp | 300 ++++++++++++++++++ .../operator_lcao/td_pot_hybrid.h | 129 ++++++++ 2 files changed, 429 insertions(+) create mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp create mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp new file mode 100644 index 0000000000..54b5471c5d --- /dev/null +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp @@ -0,0 +1,300 @@ +#include "td_pot_hybrid.h" + +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_pw/hamilt_pwdft/global.h" + +// Constructor +template +cal_r_overlap_R hamilt::TD_pot_hybrid>::r_calculator; + +template +hamilt::TD_pot_hybrid>::TD_pot_hybrid( + HS_Matrix_K* hsk_in, + const K_Vectors* kv_in, + hamilt::HContainer* hR_in, + hamilt::HContainer* SR_in, + const LCAO_Orbitals& orb, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor) + : hamilt::OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), SR(SR_in), orb_(orb), orb_cutoff_(orb_cutoff), intor_(intor) +{ + this->cal_type = calculation_type::lcao_tddft_periodic; + this->ucell = ucell_in; +#ifdef __DEBUG + assert(this->ucell != nullptr); + assert(this->hsk != nullptr); +#endif + this->init_td(); + // initialize HR to allocate sparse Ekinetic matrix memory + this->initialize_HR(GridD_in); +} + +// destructor +template +hamilt::TD_pot_hybrid>::~TD_pot_hybrid() +{ + if (this->allocated) + { + delete this->HR_fixed; + } + /*if(TD_info::td_vel_op!=nullptr) + { + TD_info::td_vel_op->hk_hybrid = nullptr; + }*/ +} + +// initialize_HR() +template +void hamilt::TD_pot_hybrid>::initialize_HR(const Grid_Driver* GridD) +{ + ModuleBase::TITLE("TD_pot_hybrid", "initialize_HR"); + ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); + + auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR + // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. + + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_cutoff_[T1] + orb_cutoff_[T2]) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_all.push_back(adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index = adjs.box[ad]; + hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); + this->hR->insert_pair(tmp); + } + } + // allocate the memory of BaseMatrix in HR, and set the new values to zero + this->hR->allocate(nullptr, true); + + ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); +} + +template +void hamilt::TD_pot_hybrid>::calculate_HR() +{ + ModuleBase::TITLE("TD_pot_hybrid", "calculate_HR"); + if (this->HR_fixed == nullptr || this->HR_fixed->size_atom_pairs() <= 0) + { + ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "HR_fixed is nullptr or empty"); + } + ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); + + const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_all[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + hamilt::BaseMatrix* tmp = this->HR_fixed->find_matrix(iat1, iat2, R_index2); + hamilt::BaseMatrix* tmp_overlap = this->SR->find_matrix(iat1, iat2, R_index2); + if (tmp != nullptr) + { + this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_overlap->get_pointer()); + } + else + { + ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "R_index not found in HR"); + } + } + } + + ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); +} + +// cal_HR_IJR() +template +void hamilt::TD_pot_hybrid>::cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* hr_mat_p, + TR* sr_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1, I1; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2, I2; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double olm[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + + ModuleBase::Vector3 tmp_r = r_calculator.get_psi_r_psi(tau1 * this->ucell->lat0, T1, L1, m1, N1, tau2 * this->ucell->lat0, T2, L2, m2, N2); + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + for (int ipol = 0; ipol < npol; ipol++) + { + hr_mat_p[ipol * step_trace] += tmp_r * Et; + hr_mat_p[ipol * step_trace] -= ((dtau + tau1) * Et) * sr_p[ipol * step_trace] * this->ucell->lat0; + } + hr_mat_p += npol; + sr_p += npol; + } + hr_mat_p += (npol - 1) * col_indexes.size(); + sr_p += (npol - 1) * col_indexes.size(); + } +} +// init two center integrals and vector potential for td_ekintic term +template +void hamilt::TD_pot_hybrid>::init_td() +{ + // initialize the r_calculator + if(TD_info::td_vel_op->get_istep()==(TD_info::estep_shift-1)) + { + //std::cout << "init_r_overlap" <hR->get_paraV(), orb_); + } + //hk_hybrid.resize(this->hR->get_paraV()->nloc); +} +template +void hamilt::TD_pot_hybrid>::update_td() +{ + //std::cout<<"hybrid gague" <cart_At = TD_info::td_vel_op->cart_At; + //std::cout<<"At: "<< TD_info::td_vel_op->cart_At[0] <<" "<cart_At[1]<<" "<cart_At[2]<<" "< +void hamilt::TD_pot_hybrid>::set_HR_fixed(void* HR_fixed_in) +{ + this->HR_fixed = static_cast*>(HR_fixed_in); + this->allocated = false; +} + +// contributeHR() +template +void hamilt::TD_pot_hybrid>::contributeHR() +{ + ModuleBase::TITLE("TD_pot_hybrid", "contributeHR"); + ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); + + if (!this->HR_fixed_done || TD_info::evolve_once) + { + // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr + if (this->HR_fixed == nullptr) + { + this->HR_fixed = new hamilt::HContainer(*this->hR); + this->HR_fixed->set_zero(); + this->allocated = true; + } + if (this->next_sub_op != nullptr) + { + // pass pointer of HR_fixed to the next node + static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); + } + // calculate the values in HR_fixed + this->update_td(); + this->HR_fixed->set_zero(); + this->calculate_HR(); + this->HR_fixed_done = true; + TD_info::evolve_once = false; + } + // last node of sub-chain, add HR_fixed into HR + if (this->next_sub_op == nullptr) + { + this->hR->add(*(this->HR_fixed)); + } + + ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); + return; +} + +//ETD +// contributeHk() +template +void hamilt::TD_pot_hybrid>::contributeHk(int ik) { + return; +} + +template class hamilt::TD_pot_hybrid, double>>; +template class hamilt::TD_pot_hybrid, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h new file mode 100644 index 0000000000..4d7b577e32 --- /dev/null +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h @@ -0,0 +1,129 @@ +#ifndef TD_POT_HYBRID_H +#define TD_POT_HYBRID_H +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_cell/klist.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include +#include "module_io/cal_r_overlap_R.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" + +namespace hamilt +{ + +#ifndef __TD_POT_HYBRIDTEMPLATE +#define __TD_POT_HYBRIDTEMPLATE + +/// The EkineticNew class template inherits from class T +/// it is used to calculate the electronic kinetic +/// Template parameters: +/// - T: base class, it would be OperatorLCAO or OperatorPW +/// - TR: data type of real space Hamiltonian, it would be double or std::complex +template +class TD_pot_hybrid : public T +{ +}; + +#endif + +/// EkineticNew class template specialization for OperatorLCAO base class +/// It is used to calculate the electronic kinetic matrix in real space and fold it to k-space +/// HR = +/// HK = = \sum_{R} e^{ikR} HR +/// Template parameters: +/// - TK: data type of k-space Hamiltonian +/// - TR: data type of real space Hamiltonian +template +class TD_pot_hybrid> : public OperatorLCAO +{ + public: + /** + * @brief Construct a new EkineticNew object + */ + TD_pot_hybrid>(HS_Matrix_K* hsk_in, + const K_Vectors* kv_in, + HContainer* hR_in, + HContainer* SR_in, + const LCAO_Orbitals& orb, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor); + + /** + * @brief Destroy the EkineticNew object + */ + ~TD_pot_hybrid>(); + + /** + * @brief contributeHR() is used to calculate the HR matrix + * + */ + virtual void contributeHR() override; + //ETD + virtual void contributeHk(int ik) override; + //ETD + + virtual void set_HR_fixed(void*) override; + + + private: + const UnitCell* ucell = nullptr; + std::vector orb_cutoff_; + const LCAO_Orbitals& orb_; + + hamilt::HContainer* HR_fixed = nullptr; + + hamilt::HContainer* SR = nullptr; + + const TwoCenterIntegrator* intor_ = nullptr; + + bool allocated = false; + + bool HR_fixed_done = false; + //tddft part + static cal_r_overlap_R r_calculator; + //ETD + //std::vector> hk_hybrid; + //ETD + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + ModuleBase::Vector3 Et; + + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the electronic kinetic matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_HR(const Grid_Driver* GridD_in); + + void init_td(); + void update_td(); + + /** + * @brief calculate the electronic kinetic matrix with specific atom-pairs + * use the adjs_all to calculate the HR matrix + */ + void calculate_HR(); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* hr_mat_p, + TR* sr_p); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_all; +}; + +} // namespace hamilt +#endif From aa0859b8b75dfd4729a7154dc57fe8bbba5c74e3 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:10:43 +0800 Subject: [PATCH 22/81] Update hamilt_lcao.cpp --- .../hamilt_lcaodft/hamilt_lcao.cpp | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp index f44586413a..87867bb927 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp @@ -38,6 +38,7 @@ #include "operator_lcao/overlap_new.h" #include "operator_lcao/td_ekinetic_lcao.h" #include "operator_lcao/td_nonlocal_lcao.h" +#include "operator_lcao/td_pot_hybrid.h" #include "operator_lcao/veff_lcao.h" namespace hamilt @@ -344,12 +345,8 @@ HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, } #endif // TDDFT_velocity_gauge - if (TD_Velocity::tddft_velocity) + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { - if (!TD_Velocity::init_vecpot_file) - { - elecstate::H_TDDFT_pw::update_At(); - } Operator* td_ekinetic = new TDEkinetic>(this->hsk, this->hR, this->kv, @@ -359,10 +356,27 @@ HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, two_center_bundle.overlap_orb.get()); this->getOperator()->add(td_ekinetic); - Operator* td_nonlocal - = new TDNonlocal>(this->hsk, this->kv->kvec_d, this->hR, &ucell, orb, &grid_d); + Operator* td_nonlocal = new TDNonlocal>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb, + &grid_d); this->getOperator()->add(td_nonlocal); } + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 2) + { + Operator* td_pot_hybrid = new TD_pot_hybrid>(this->hsk, + this->kv, + this->hR, + this->sR, + orb, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.kinetic_orb.get()); + this->getOperator()->add(td_pot_hybrid); + } if (PARAM.inp.dft_plus_u) { Operator* dftu = nullptr; From 7ea87e2babe0d52cc9542b8779bf0d02d23e8425 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:11:42 +0800 Subject: [PATCH 23/81] Update spar_hsr.cpp --- source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp index fa29bdec7c..6c75edb73e 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp @@ -1,7 +1,7 @@ #include "spar_hsr.h" #include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include "module_parameter/parameter.h" #include "spar_dh.h" #include "spar_exx.h" @@ -96,7 +96,7 @@ void sparse_format::cal_HSR(const UnitCell& ucell, HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); - if (TD_Velocity::tddft_velocity) + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { sparse_format::cal_HContainer_td(pv, current_spin, @@ -334,7 +334,7 @@ void sparse_format::clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& cu } } } - if (TD_Velocity::tddft_velocity) + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { for (auto& R_loop: TD_Velocity::td_vel_op->HR_sparse_td_vel[current_spin]) { @@ -451,4 +451,4 @@ void sparse_format::destroy_HS_R_sparse(LCAO_HS_Arrays& HS_Arrays) // all_R_coor.swap(empty_all_R_coor); return; -} \ No newline at end of file +} From d0353dc85ebe0b34b47be2389df30f376b01128c Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:12:18 +0800 Subject: [PATCH 24/81] Update spar_hsr.cpp --- source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp index 6c75edb73e..786d7809f5 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp @@ -102,7 +102,7 @@ void sparse_format::cal_HSR(const UnitCell& ucell, current_spin, sparse_thr, *(p_ham_lcao->getHR()), - TD_Velocity::td_vel_op->HR_sparse_td_vel[current_spin]); + TD_info::td_vel_op->HR_sparse_td_vel[current_spin]); } else { @@ -336,7 +336,7 @@ void sparse_format::clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& cu } if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { - for (auto& R_loop: TD_Velocity::td_vel_op->HR_sparse_td_vel[current_spin]) + for (auto& R_loop: TD_info::td_vel_op->HR_sparse_td_vel[current_spin]) { for (auto& row_loop: R_loop.second) { From 8ba4c698548dea9800fe3815b9ab61dcae8ef475 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:13:06 +0800 Subject: [PATCH 25/81] Update CMakeLists.txt --- source/module_hamilt_lcao/module_tddft/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/module_hamilt_lcao/module_tddft/CMakeLists.txt b/source/module_hamilt_lcao/module_tddft/CMakeLists.txt index e81ceb3368..58bc834a5f 100644 --- a/source/module_hamilt_lcao/module_tddft/CMakeLists.txt +++ b/source/module_hamilt_lcao/module_tddft/CMakeLists.txt @@ -10,9 +10,10 @@ if(ENABLE_LCAO) propagator_taylor.cpp propagator_etrs.cpp upsi.cpp - td_velocity.cpp - td_current.cpp + td_info.cpp + velocity_op.cpp snap_psibeta_half_tddft.cpp + td_folding.cpp solve_propagation.cpp ) From ca5e69288058d9d34377ddab677e8a4e666c6025 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:14:03 +0800 Subject: [PATCH 26/81] Update evolve_elec.h --- source/module_hamilt_lcao/module_tddft/evolve_elec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/module_hamilt_lcao/module_tddft/evolve_elec.h b/source/module_hamilt_lcao/module_tddft/evolve_elec.h index 3433b5d223..44972bae3f 100644 --- a/source/module_hamilt_lcao/module_tddft/evolve_elec.h +++ b/source/module_hamilt_lcao/module_tddft/evolve_elec.h @@ -143,7 +143,8 @@ class Evolve_elec friend class ModuleESolver::ESolver_KS_LCAO, double>; // Template parameter is needed for the friend class declaration - friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; + friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; + friend class ModuleESolver::ESolver_KS_LCAO_TDDFT, Device>; public: Evolve_elec(); From 5642fefb84f3a44c33ae05146009ea76013b78ea Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:15:01 +0800 Subject: [PATCH 27/81] Update evolve_psi.cpp --- source/module_hamilt_lcao/module_tddft/evolve_psi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp b/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp index 01c81995da..29c9e88125 100644 --- a/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp +++ b/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp @@ -76,7 +76,7 @@ void evolve_psi(const int nband, /// @brief compute U_operator /// @input Stmp, Htmp, print_matrix /// @output U_operator - Propagator prop(propagator, pv, PARAM.mdp.md_dt); + Propagator prop(propagator, pv, PARAM.inp.td_dt); prop.compute_propagator(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); } @@ -93,7 +93,7 @@ void evolve_psi(const int nband, /// @brief solve the propagation equation /// @input Stmp, Htmp, psi_k_laststep /// @output psi_k - solve_propagation(pv, nband, nlocal, PARAM.mdp.md_dt / ModuleBase::AU_to_FS, Stmp, Htmp, psi_k_laststep, psi_k); + solve_propagation(pv, nband, nlocal, PARAM.inp.td_dt, Stmp, Htmp, psi_k_laststep, psi_k); } // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> From de01481a9d7d7a65908b84dbcf5f9d76733b9ece Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:16:20 +0800 Subject: [PATCH 28/81] Update solve_propagation.cpp --- .../module_hamilt_lcao/module_tddft/solve_propagation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp b/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp index f8df6a6c71..5271f2fec3 100644 --- a/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp +++ b/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp @@ -4,6 +4,7 @@ #include "source_base/lapack_connector.h" #include "source_base/scalapack_connector.h" +#include "source_pw/hamilt_pwdft/global.h" namespace module_tddft { @@ -25,14 +26,16 @@ void solve_propagation(const Parallel_Orbitals* pv, std::complex* operator_B = new std::complex[pv->nloc]; ModuleBase::GlobalFunc::ZEROS(operator_B, pv->nloc); BlasConnector::copy(pv->nloc, Htmp, 1, operator_B, 1); + + const double dt_au = dt / ModuleBase::AU_to_FS; // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // (2) compute operator_A & operator_B by GEADD // operator_A = Stmp + i*para * Htmp; beta2 = para = 0.25 * dt // operator_B = Stmp - i*para * Htmp; beta1 = - para = -0.25 * dt std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * dt}; - std::complex beta2 = {0.0, 0.25 * dt}; + std::complex beta1 = {0.0, -0.25 * dt_au}; + std::complex beta2 = {0.0, 0.25 * dt_au}; ScalapackConnector::geadd('N', nlocal, From 812904e6fa7cbc418a86f17decad421a99ac978a Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:17:45 +0800 Subject: [PATCH 29/81] Add files via upload --- .../module_tddft/td_folding.cpp | 53 ++ .../module_tddft/td_info.cpp | 227 ++++++++ .../module_hamilt_lcao/module_tddft/td_info.h | 108 ++++ .../module_tddft/velocity_op.cpp | 534 ++++++++++++++++++ .../module_tddft/velocity_op.h | 81 +++ 5 files changed, 1003 insertions(+) create mode 100644 source/module_hamilt_lcao/module_tddft/td_folding.cpp create mode 100644 source/module_hamilt_lcao/module_tddft/td_info.cpp create mode 100644 source/module_hamilt_lcao/module_tddft/td_info.h create mode 100644 source/module_hamilt_lcao/module_tddft/velocity_op.cpp create mode 100644 source/module_hamilt_lcao/module_tddft/velocity_op.h diff --git a/source/module_hamilt_lcao/module_tddft/td_folding.cpp b/source/module_hamilt_lcao/module_tddft/td_folding.cpp new file mode 100644 index 0000000000..d7eefd240e --- /dev/null +++ b/source/module_hamilt_lcao/module_tddft/td_folding.cpp @@ -0,0 +1,53 @@ +#include "td_info.h" +#include "source_base/libm/libm.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +template +void TD_info::folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type) +{ +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int i = 0; i < hR.size_atom_pairs(); ++i) + { + hamilt::AtomPair& tmp = hR.get_atom_pair(i); + for(int ir = 0;ir < tmp.get_R_size(); ++ir ) + { + const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); + + //new + //cal tddft phase for hybrid gague + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + ModuleBase::Vector3 dtau = ucell->cal_dtau(iat1, iat2, r_index); + const double arg_td = cart_At * dtau * ucell->lat0; + //new + + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + + tmp.find_R(r_index); + tmp.add_to_matrix(hk, ncol, kphase, hk_type); + } + } +} +template +void TD_info::folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); +template +void TD_info::folding_HR_td>(const hamilt::HContainer>& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/td_info.cpp b/source/module_hamilt_lcao/module_tddft/td_info.cpp new file mode 100644 index 0000000000..26e2bab0a5 --- /dev/null +++ b/source/module_hamilt_lcao/module_tddft/td_info.cpp @@ -0,0 +1,227 @@ +#include "td_info.h" + +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "module_parameter/parameter.h" + +bool TD_info::out_mat_R = false; +bool TD_info::out_vecpot = false; +bool TD_info::out_current = false; +bool TD_info::out_current_k = false; +bool TD_info::init_vecpot_file = false; +bool TD_info::evolve_once = false; + +TD_info* TD_info::td_vel_op = nullptr; + +int TD_info::estep_shift = 0; +int TD_info::istep = -1; +int TD_info::max_istep = -1; +std::vector> TD_info::At_from_file; + +TD_info::TD_info(const UnitCell* ucell_in) +{ + this->ucell = ucell_in; + if (init_vecpot_file && istep == -1) + { + this->read_cart_At(); + } + //read in restart step + if(PARAM.inp.mdp.md_restart) + { + std::stringstream ssc; + ssc << PARAM.globalv.global_readin_dir << "Restart_td.dat"; + std::ifstream file(ssc.str().c_str()); + if (!file) + { + ModuleBase::WARNING_QUIT("TD_info::TD_info", "No Restart_td.dat!"); + } + file >> estep_shift; + std::cout<<"estep_shift"<istep += estep_shift; + return; +} +TD_info::~TD_info() +{ + if(elecstate::H_TDDFT_pw::stype == 1) + { + this->destroy_HS_R_td_sparse(); + } + for (int dir = 0; dir < 3; dir++) + { + if (this->current_term[dir] != nullptr) + { + delete this->current_term[dir]; + } + } +} + +void TD_info::output_cart_At(const std::string& out_dir) +{ + if (GlobalV::MY_RANK == 0) + { + std::string out_file; + // generate the output file name + out_file = out_dir + "At.dat"; + std::ofstream ofs; + // output title + if (istep == estep_shift) + { + ofs.open(out_file.c_str(), std::ofstream::out); + ofs << std::left << std::setw(8) << "#istep" << std::setw(15) << "A_x" << std::setw(15) << "A_y" + << std::setw(15) << "A_z" << std::endl; + } + else + { + ofs.open(out_file.c_str(), std::ofstream::app); + } + // output the vector potential + ofs << std::left << std::setw(8) << istep; + // divide by 2.0 to get the atomic unit + for (int i = 0; i < 3; i++) + { + ofs << std::scientific << std::setprecision(4) << std::setw(15) << cart_At[i]; + } + ofs << std::endl; + ofs.close(); + } + return; +} + +void TD_info::cal_cart_At(const ModuleBase::Vector3& At) +{ + istep++; + if (init_vecpot_file) + { + this->cart_At = At_from_file[istep > max_istep ? max_istep : istep]; + } + else + { + // transfrom into atomic unit + this->cart_At = At / 2.0; + } + // output the vector potential if needed + if (out_vecpot == true) + { + this->output_cart_At(PARAM.globalv.global_out_dir); + } +} + +void TD_info::read_cart_At(void) +{ + std::string in_file; + // generate the input file name + in_file = "At.dat"; + std::ifstream ifs(in_file.c_str()); + // check if the file is exist + if (!ifs) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Cannot open Vector potential file!"); + } + std::string line; + std::vector str_vec; + // use tmp to skip the istep number + int tmp = 0; + while (std::getline(ifs, line)) + { + // A tmporary vector3 to store the data of this line + ModuleBase::Vector3 At; + if (line[0] == '#') + { + continue; + } + std::istringstream iss(line); + // skip the istep number + if (!(iss >> tmp)) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Error reading istep!"); + } + // read the vector potential + double component = 0; + // Read three components + for (int i = 0; i < 3; i++) + { + if (!(iss >> component)) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", + "Error reading component " + std::to_string(i + 1) + " for istep " + + std::to_string(tmp) + "!"); + } + At[i] = component; + } + // add the tmporary vector3 to the vector potential vector + At_from_file.push_back(At); + } + // set the max_istep + max_istep = At_from_file.size() - 1; + ifs.close(); + + return; +} +void TD_info::out_restart_info(const int nstep, + const ModuleBase::Vector3& At_current, + const ModuleBase::Vector3& At_laststep) +{ + if (GlobalV::MY_RANK == 0) + { + // open file + std::string outdir = PARAM.globalv.global_out_dir + "Restart_td.dat"; + std::ofstream outFile(outdir); + if (!outFile) { + ModuleBase::WARNING_QUIT("out_restart_info", "no Restart_td.dat!"); + } + // write data + outFile << nstep << std::endl; + outFile << At_current[0] << " " << At_current[1] << " " << At_current[2] << std::endl; + outFile << At_laststep[0] << " " << At_laststep[1] << " " << At_laststep[2] << std::endl; + outFile.close(); + } + + + return; +} + +void TD_info::initialize_current_term(const hamilt::HContainer>* HR, + const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("TD_info", "initialize_current_term"); + ModuleBase::timer::tick("TD_info", "initialize_current_term"); + + for (int dir = 0; dir < 3; dir++) + { + if (this->current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + + for (int i = 0; i < HR->size_atom_pairs(); ++i) + { + hamilt::AtomPair>& tmp = HR->get_atom_pair(i); + for (int ir = 0; ir < tmp.get_R_size(); ++ir) + { + const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + + hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); + for (int dir = 0; dir < 3; dir++) + { + this->current_term[dir]->insert_pair(tmp1); + } + } + } + for (int dir = 0; dir < 3; dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + + ModuleBase::timer::tick("TD_info", "initialize_current_term"); +} + +void TD_info::destroy_HS_R_td_sparse(void) +{ + std::map, std::map>>> + empty_HR_sparse_td_vel_up; + std::map, std::map>>> + empty_HR_sparse_td_vel_down; + HR_sparse_td_vel[0].swap(empty_HR_sparse_td_vel_up); + HR_sparse_td_vel[1].swap(empty_HR_sparse_td_vel_down); +} diff --git a/source/module_hamilt_lcao/module_tddft/td_info.h b/source/module_hamilt_lcao/module_tddft/td_info.h new file mode 100644 index 0000000000..79026c3b64 --- /dev/null +++ b/source/module_hamilt_lcao/module_tddft/td_info.h @@ -0,0 +1,108 @@ +#ifndef TD_INFO_H +#define TD_INFO_H +#include "source_base/abfs-vector3_order.h" +#include "source_base/timer.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" + +#include +// Class to store TDDFT infos, mainly for periodic system. +class TD_info +{ + public: + TD_info(const UnitCell* ucell_in); + ~TD_info(); + + void init(); + + /// @brief switch to control the output of HR + static bool out_mat_R; + + /// @brief pointer to the only TD_info object itself + static TD_info* td_vel_op; + + /// @brief switch to control the output of At + static bool out_vecpot; + + /// @brief switch to control the output of current + static bool out_current; + + /// @brief switch to control the format of the output current, in total or in each k-point + static bool out_current_k; + + /// @brief switch to control the source of At + static bool init_vecpot_file; + + /// @brief if need to calculate more than once + static bool evolve_once; + + /// @brief Restart step + static int estep_shift; + + /// @brief Store the vector potential for tddft calculation + ModuleBase::Vector3 cart_At; + + /// @brief calculate the At in cartesian coordinate + void cal_cart_At(const ModuleBase::Vector3& At); + + /// @brief output RT-TDDFT info for restart + void out_restart_info(const int nstep, + const ModuleBase::Vector3& At_current, + const ModuleBase::Vector3& At_laststep); + + // allocate memory for current term. + void initialize_current_term(const hamilt::HContainer>* HR, const Parallel_Orbitals* paraV); + + hamilt::HContainer>* get_current_term_pointer(const int& i) const + { + return this->current_term[i]; + } + + + // folding HR to hk, for hybrid gague + template + void folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); + + int get_istep() + { + return istep; + } + + const UnitCell* get_ucell() + { + return this->ucell; + } + + // For TDDFT velocity gauge, to fix the output of HR + std::map, std::map>>> HR_sparse_td_vel[2]; + + private: + /// @brief pointer to the unit cell + const UnitCell* ucell = nullptr; + + /// @brief read At from output file + void read_cart_At(); + + /// @brief output cart_At to output file + void output_cart_At(const std::string& out_dir); + + /// @brief store isteps now + static int istep; + + /// @brief total steps of read in At + static int max_istep; + + /// @brief store the read in At_data + static std::vector> At_from_file; + + /// @brief destory HSR data stored + void destroy_HS_R_td_sparse(); + + /// @brief part of Momentum operator, -iāˆ‡ - i[r,Vnl]. Used to calculate current. + std::vector>*> current_term = {nullptr, nullptr, nullptr}; +}; + +#endif diff --git a/source/module_hamilt_lcao/module_tddft/velocity_op.cpp b/source/module_hamilt_lcao/module_tddft/velocity_op.cpp new file mode 100644 index 0000000000..640ebe37f0 --- /dev/null +++ b/source/module_hamilt_lcao/module_tddft/velocity_op.cpp @@ -0,0 +1,534 @@ +#include "velocity_op.h" +#ifdef __LCAO +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" +#ifdef _OPENMP +#include +#include +#endif +#include "module_parameter/parameter.h" +template +cal_r_overlap_R Velocity_op::r_calculator; +template +bool Velocity_op::init_done = false; +template +Velocity_op::Velocity_op(const UnitCell* ucell_in, + const Grid_Driver* GridD_in, + const Parallel_Orbitals* paraV, + const LCAO_Orbitals& orb, + const TwoCenterIntegrator* intor) + : ucell(ucell_in), paraV(paraV) , orb_(orb), intor_(intor) +{ + // for length gague, the A(t) = 0 for all the time. + this->cart_At = ModuleBase::Vector3(0,0,0); + this->initialize_grad_term(GridD_in, paraV); + this->initialize_vcomm_r(GridD_in, paraV); +} +template +Velocity_op::~Velocity_op() +{ + for (int dir=0;dir<3;dir++) + { + delete this->current_term[dir]; + } +} +//allocate space for current_term +template +void Velocity_op::initialize_vcomm_r(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("Velocity_op", "initialize_vcomm_r"); + ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); + if(!init_done) + { + std::cout << "init_r_overlap_nonlocal" <current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + this->adjs_vcommr.clear(); + this->adjs_vcommr.reserve(this->ucell->nat); + for (int iat0 = 0; iat0 < ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_vcommr.push_back(adjs); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) + { + continue; + } + hamilt::AtomPair> tmp(iat1, + iat2, + R_index2.x - R_index1.x, + R_index2.y - R_index1.y, + R_index2.z - R_index1.z, + paraV); + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->insert_pair(tmp); + } + } + } + } + // allocate the memory of BaseMatrix in cal_vcomm_r_IJR, and set the new values to zero + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); +} +template +void Velocity_op::initialize_grad_term(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("Velocity_op", "initialize_grad_term"); + ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); + for (int dir=0;dir<3;dir++) + { + if (this->current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + this->adjs_grad.clear(); + this->adjs_grad.reserve(this->ucell->nat); + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + orb_.Phi[T2].getRcut()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_grad.push_back(adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index = adjs.box[ad]; + hamilt::AtomPair> tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->insert_pair(tmp); + } + } + } + // allocate the memory of BaseMatrix in HR, and set the new values to zero + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + + ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); +} +template +void Velocity_op::calculate_vcomm_r() +{ + ModuleBase::TITLE("Velocity_op", "calculate_vcomm_r"); + ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); + + const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); + const int npol = this->ucell->get_npol(); + + // 1. calculate for each pair of atoms + for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo& adjs = this->adjs_vcommr[iat0]; + std::vector>>> nlm_tot; + nlm_tot.resize(adjs.adj_num + 1); + for (int i = 0; i < adjs.adj_num + 1; i++) + { + nlm_tot[i].resize(4); + } + + #pragma omp parallel + { + #pragma omp for schedule(dynamic) + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; + const Atom* atom1 = &ucell->atoms[T1]; + auto all_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat1); + // insert col_indexes into all_indexes to get universal set with no repeat elements + all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); + std::sort(all_indexes.begin(), all_indexes.end()); + all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); + for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) + { + const int iw1 = all_indexes[iw1l] / npol; + //std::vector>> nlm; + std::vector> nlm; + // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false + // and size of outer vector is 4 when out_current is true (3 for , 1 for + // ) inner loop : all projectors (L0,M0) + + // snap_psibeta_half_tddft() are used to calculate + // and as well if current are needed + ModuleBase::Vector3 dtau = tau0 - tau1; + + r_calculator.get_psi_r_beta(*ucell, + nlm, + tau1 * this->ucell->lat0, + T1, + atom1->iw2l[iw1], + atom1->iw2m[iw1], + atom1->iw2n[iw1], + tau0 * this->ucell->lat0, + T0); + for (int dir = 0; dir < 4; dir++) + { + nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); + } + } + } + + #ifdef _OPENMP + // record the iat number of the adjacent atoms + std::set ad_atom_set; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + ad_atom_set.insert(iat1); + } + + // split the ad_atom_set into num_threads parts + const int num_threads = omp_get_num_threads(); + const int thread_id = omp_get_thread_num(); + std::set ad_atom_set_thread; + int i = 0; + for(const auto iat1 : ad_atom_set) + { + if (i % num_threads == thread_id) + { + ad_atom_set_thread.insert(iat1); + } + i++; + } + #endif + // 2. calculate D for each pair of atoms + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + #ifdef _OPENMP + if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) + { + continue; + } + #endif + ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], + R_index2[1] - R_index1[1], + R_index2[2] - R_index1[2]); + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2])->get_pointer(); + } + // if not found , skip this pair of atoms + if (tmp_c[0] != nullptr) + { + this->cal_vcomm_r_IJR(iat1, + iat2, + T0, + paraV, + nlm_tot[ad1], + nlm_tot[ad2], + tmp_c); + } + } + } + } + } + ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); +} + +// cal_HR_IJR() +template +void Velocity_op::cal_vcomm_r_IJR( + const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>& nlm1_all, + const std::vector>>& nlm2_all, + std::complex** current_mat_p) +{ + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + // --------------------------------------------- + // calculate the Nonlocal matrix for each pair of orbitals + // --------------------------------------------- + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + std::vector step_trace(npol * npol, 0); + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = col_indexes.size() * is + is2; + } + } + // calculate the local matrix + const TR* tmp_d = nullptr; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); + //std::vector>*> nlm1; + std::vector*> nlm1; + for (int dir = 0; dir < 4; dir++) + { + nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); + } + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + //std::vector>*> nlm2; + std::vector*> nlm2; + for (int dir = 0; dir < 4; dir++) + { + nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); + } + +#ifdef __DEBUG + assert(nlm1.size() == nlm2.size()); +#endif + for (int is = 0; is < npol * npol; ++is) + { + for (int dir = 0; dir < 3; dir++) + { + std::complex nlm_r_tmp = std::complex{0, 0}; + std::complex imag_unit = std::complex{0, 1}; + for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) + { + const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; + const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; + this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); + //- + // multiply d in the end + TR tmp = (nlm1[dir + 1]->at(p1) * nlm2[0]->at(p2) + - nlm1[0]->at(p1) * nlm2[dir + 1]->at(p2)) + * (*tmp_d); + nlm_r_tmp += tmp; + } + // -i[r,Vnl], 2.0 due to the unit transformation + current_mat_p[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += npol; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } +} +template +void Velocity_op::calculate_grad_term() +{ + ModuleBase::TITLE("Velocity_op", "calculate_grad_term"); + if(this->current_term[0]==nullptr || this->current_term[0]->size_atom_pairs()<=0) + { + ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "grad_term is nullptr or empty"); + } + ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); + + const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_grad[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_index2)->get_pointer(); + } + if (tmp_c[0] != nullptr) + { + this->cal_grad_IJR(iat1, iat2, paraV, dtau, tmp_c); + } + else + { + ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "R_index not found in HR"); + } + } + } + ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); +} +template +void Velocity_op::cal_grad_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex** current_mat_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1, I1; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2, I2; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + // --------------------------------------------- + // get tau1 (in cell <0,0,0>) and tau2 (in cell R) + // in principle, only dtau is needed in this function + // snap_psipsi should be refactored to use dtau directly + // --------------------------------------------- + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double grad[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + for(int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + // calculate , which equals to -. + intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, nullptr, grad); + ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); + + for (int dir = 0; dir < 3; dir++) + { + for (int ipol = 0; ipol < npol; ipol++) + { + // part of Momentum operator, -iāˆ‡r,used to calculate the current + // here is actually iāˆ‡R + current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); + } + current_mat_p[dir] += npol; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } +} +template class Velocity_op; +template class Velocity_op>; +#endif // __LCAO diff --git a/source/module_hamilt_lcao/module_tddft/velocity_op.h b/source/module_hamilt_lcao/module_tddft/velocity_op.h new file mode 100644 index 0000000000..a820ec81ac --- /dev/null +++ b/source/module_hamilt_lcao/module_tddft/velocity_op.h @@ -0,0 +1,81 @@ +#ifndef TD_VELOCITY_OP_H +#define TD_VELOCITY_OP_H +#include +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_base/vector3.h" +#include "module_io/cal_r_overlap_R.h" + +#ifdef __LCAO +//design to calculate velocity operator +template +class Velocity_op +{ + public: + Velocity_op(const UnitCell* ucell_in, + const Grid_Driver* GridD_in, + const Parallel_Orbitals* paraV, + const LCAO_Orbitals& orb, + const TwoCenterIntegrator* intor); + ~Velocity_op(); + + hamilt::HContainer>* get_current_term_pointer(const int& i)const + { + return this->current_term[i]; + } + void calculate_vcomm_r(); + void calculate_grad_term(); + + private: + const UnitCell* ucell = nullptr; + + const Parallel_Orbitals* paraV = nullptr; + + const LCAO_Orbitals& orb_; + + /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only shared between TD operators. + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + + const TwoCenterIntegrator* intor_ = nullptr; + const TwoCenterIntegrator* intorbeta_ = nullptr; + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_vcomm_r(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); + void initialize_grad_term(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_vcomm_r_IJR(const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>& nlm1_all, + const std::vector>>& nlm2_all, + std::complex** current_mat_p); + void cal_grad_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex** current_mat_p); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_vcommr; + std::vector adjs_grad; + + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + static cal_r_overlap_R r_calculator; + static bool init_done; +}; + + +#endif // __LCAO +#endif // TD_CURRENT_H From dcfcd055d380d9c95f0ce78ca106ee7941930bf2 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:18:13 +0800 Subject: [PATCH 30/81] Delete source/module_hamilt_lcao/module_tddft/td_velocity.cpp --- .../module_tddft/td_velocity.cpp | 186 ------------------ 1 file changed, 186 deletions(-) delete mode 100644 source/module_hamilt_lcao/module_tddft/td_velocity.cpp diff --git a/source/module_hamilt_lcao/module_tddft/td_velocity.cpp b/source/module_hamilt_lcao/module_tddft/td_velocity.cpp deleted file mode 100644 index ab5a595866..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_velocity.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "td_velocity.h" - -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_parameter/parameter.h" - -bool TD_Velocity::tddft_velocity = false; -bool TD_Velocity::out_mat_R = false; -bool TD_Velocity::out_vecpot = false; -bool TD_Velocity::out_current = false; -bool TD_Velocity::out_current_k = false; -bool TD_Velocity::init_vecpot_file = false; - -TD_Velocity* TD_Velocity::td_vel_op = nullptr; - -int TD_Velocity::istep = -1; -int TD_Velocity::max_istep = -1; -std::vector> TD_Velocity::At_from_file; - -TD_Velocity::TD_Velocity() -{ - if (init_vecpot_file && istep == -1) - { - this->read_cart_At(); - } - return; -} -TD_Velocity::~TD_Velocity() -{ - this->destroy_HS_R_td_sparse(); - delete td_vel_op; - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] != nullptr) - { - delete this->current_term[dir]; - } - } -} - -void TD_Velocity::output_cart_At(const std::string& out_dir) -{ - if (GlobalV::MY_RANK == 0) - { - std::string out_file; - // generate the output file name - out_file = out_dir + "At.dat"; - std::ofstream ofs; - // output title - if (istep == 0) - { - ofs.open(out_file.c_str(), std::ofstream::out); - ofs << std::left << std::setw(8) << "#istep" << std::setw(15) << "A_x" << std::setw(15) << "A_y" - << std::setw(15) << "A_z" << std::endl; - } - else - { - ofs.open(out_file.c_str(), std::ofstream::app); - } - // output the vector potential - ofs << std::left << std::setw(8) << istep; - // divide by 2.0 to get the atomic unit - for (int i = 0; i < 3; i++) - { - ofs << std::scientific << std::setprecision(4) << std::setw(15) << cart_At[i]; - } - ofs << std::endl; - ofs.close(); - } - return; -} - -void TD_Velocity::cal_cart_At(const ModuleBase::Vector3& At) -{ - istep++; - if (init_vecpot_file) - { - this->cart_At = At_from_file[istep > max_istep ? max_istep : istep]; - } - else - { - // transfrom into atomic unit - this->cart_At = At / 2.0; - } - // output the vector potential if needed - if (out_vecpot == true) - { - this->output_cart_At(PARAM.globalv.global_out_dir); - } -} - -void TD_Velocity::read_cart_At(void) -{ - std::string in_file; - // generate the input file name - in_file = "At.dat"; - std::ifstream ifs(in_file.c_str()); - // check if the file is exist - if (!ifs) - { - ModuleBase::WARNING_QUIT("TD_Velocity::read_cart_At", "Cannot open Vector potential file!"); - } - std::string line; - std::vector str_vec; - // use tmp to skip the istep number - int tmp = 0; - while (std::getline(ifs, line)) - { - // A tmporary vector3 to store the data of this line - ModuleBase::Vector3 At; - if (line[0] == '#') - { - continue; - } - std::istringstream iss(line); - // skip the istep number - if (!(iss >> tmp)) - { - ModuleBase::WARNING_QUIT("TD_Velocity::read_cart_At", "Error reading istep!"); - } - // read the vector potential - double component = 0; - // Read three components - for (int i = 0; i < 3; i++) - { - if (!(iss >> component)) - { - ModuleBase::WARNING_QUIT("TD_Velocity::read_cart_At", - "Error reading component " + std::to_string(i + 1) + " for istep " - + std::to_string(tmp) + "!"); - } - At[i] = component; - } - // add the tmporary vector3 to the vector potential vector - At_from_file.push_back(At); - } - // set the max_istep - max_istep = At_from_file.size() - 1; - ifs.close(); - - return; -} -void TD_Velocity::initialize_current_term(const hamilt::HContainer>* HR, - const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("TD_Velocity", "initialize_current_term"); - ModuleBase::timer::tick("TD_Velocity", "initialize_current_term"); - - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - - for (int i = 0; i < HR->size_atom_pairs(); ++i) - { - hamilt::AtomPair>& tmp = HR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->insert_pair(tmp1); - } - } - } - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - - ModuleBase::timer::tick("TD_Velocity", "initialize_current_term"); -} - -void TD_Velocity::destroy_HS_R_td_sparse(void) -{ - std::map, std::map>>> - empty_HR_sparse_td_vel_up; - std::map, std::map>>> - empty_HR_sparse_td_vel_down; - HR_sparse_td_vel[0].swap(empty_HR_sparse_td_vel_up); - HR_sparse_td_vel[1].swap(empty_HR_sparse_td_vel_down); -} From 2f4147f988197b1160bc83447cf1fa346972307f Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:18:21 +0800 Subject: [PATCH 31/81] Delete source/module_hamilt_lcao/module_tddft/td_velocity.h --- .../module_tddft/td_velocity.h | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 source/module_hamilt_lcao/module_tddft/td_velocity.h diff --git a/source/module_hamilt_lcao/module_tddft/td_velocity.h b/source/module_hamilt_lcao/module_tddft/td_velocity.h deleted file mode 100644 index a16e2b83e8..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_velocity.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef TD_VELOCITY_H -#define TD_VELOCITY_H -#include "source_base/abfs-vector3_order.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -// Class to store TDDFT velocity gauge infos. -class TD_Velocity -{ - public: - TD_Velocity(); - ~TD_Velocity(); - - void init(); - - /// @brief Judge if in tddft calculation or not - static bool tddft_velocity; - - /// @brief switch to control the output of HR - static bool out_mat_R; - - /// @brief pointer to the only TD_Velocity object itself - static TD_Velocity* td_vel_op; - - /// @brief switch to control the output of At - static bool out_vecpot; - - /// @brief switch to control the output of current - static bool out_current; - - /// @brief switch to control the format of the output current, in total or in each k-point - static bool out_current_k; - - /// @brief switch to control the source of At - static bool init_vecpot_file; - - /// @brief Store the vector potential for tddft calculation - ModuleBase::Vector3 cart_At; - - /// @brief calculate the At in cartesian coordinate - void cal_cart_At(const ModuleBase::Vector3& At); - - // allocate memory for current term. - void initialize_current_term(const hamilt::HContainer>* HR, const Parallel_Orbitals* paraV); - - hamilt::HContainer>* get_current_term_pointer(const int& i) const - { - return this->current_term[i]; - } - - // For TDDFT velocity gauge, to fix the output of HR - std::map, std::map>>> HR_sparse_td_vel[2]; - - private: - /// @brief read At from output file - void read_cart_At(); - - /// @brief output cart_At to output file - void output_cart_At(const std::string& out_dir); - - /// @brief store isteps now - static int istep; - - /// @brief total steps of read in At - static int max_istep; - - /// @brief store the read in At_data - static std::vector> At_from_file; - - /// @brief destory HSR data stored - void destroy_HS_R_td_sparse(); - - /// @brief part of Momentum operator, -iāˆ‡ - i[r,Vnl]. Used to calculate current. - std::vector>*> current_term = {nullptr, nullptr, nullptr}; -}; - -#endif From a19518b2487d686256035b3d1a91bb5bf3446dd7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:18:31 +0800 Subject: [PATCH 32/81] Delete source/module_hamilt_lcao/module_tddft/td_current.cpp --- .../module_tddft/td_current.cpp | 520 ------------------ 1 file changed, 520 deletions(-) delete mode 100644 source/module_hamilt_lcao/module_tddft/td_current.cpp diff --git a/source/module_hamilt_lcao/module_tddft/td_current.cpp b/source/module_hamilt_lcao/module_tddft/td_current.cpp deleted file mode 100644 index d307b5a256..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_current.cpp +++ /dev/null @@ -1,520 +0,0 @@ -#include "td_current.h" -#ifdef __LCAO -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" -#ifdef _OPENMP -#include -#include -#endif - -TD_current::TD_current(const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator* intor) - : ucell(ucell_in), paraV(paraV), orb_(orb), Grid(GridD_in), intor_(intor) -{ - // for length gauge, the A(t) = 0 for all the time. - this->cart_At = ModuleBase::Vector3(0, 0, 0); - this->initialize_vcomm_r(GridD_in, paraV); - this->initialize_grad_term(GridD_in, paraV); -} -TD_current::~TD_current() -{ - for (int dir = 0; dir < 3; dir++) - { - delete this->current_term[dir]; - } -} -// allocate space for current_term -void TD_current::initialize_vcomm_r(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("TD_current", "initialize_vcomm_r"); - ModuleBase::timer::tick("TD_current", "initialize_vcomm_r"); - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - - this->adjs_vcommr.clear(); - this->adjs_vcommr.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_vcommr.push_back(adjs); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) - { - continue; - } - hamilt::AtomPair> tmp(iat1, - iat2, - R_index2.x - R_index1.x, - R_index2.y - R_index1.y, - R_index2.z - R_index1.z, - paraV); - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->insert_pair(tmp); - } - } - } - } - // allocate the memory of BaseMatrix in cal_vcomm_r_IJR, and set the new values to zero - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - ModuleBase::timer::tick("TD_current", "initialize_vcomm_r"); -} -void TD_current::initialize_grad_term(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("TD_current", "initialize_grad_term"); - ModuleBase::timer::tick("TD_current", "initialize_grad_term"); - - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + orb_.Phi[T2].getRcut()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_grad.push_back(adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index = adjs.box[ad]; - hamilt::AtomPair> tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->insert_pair(tmp); - } - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - - ModuleBase::timer::tick("TD_current", "initialize_grad_term"); -} - -void TD_current::calculate_vcomm_r() -{ - ModuleBase::TITLE("TD_current", "calculate_vcomm_r"); - ModuleBase::timer::tick("TD_current", "calculate_vcomm_r"); - - const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - - // 1. calculate for each pair of atoms - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo& adjs = this->adjs_vcommr[iat0]; - - std::vector>>>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - for (int i = 0; i < adjs.adj_num + 1; i++) - { - nlm_tot[i].resize(4); - } - -#pragma omp parallel - { -#pragma omp for schedule(dynamic) - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector>> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false - // and size of outer vector is 4 when out_current is true (3 for , 1 for - // ) inner loop : all projectors (L0,M0) - - // snap_psibeta_half_tddft() are used to calculate - // and as well if current are needed - - module_tddft::snap_psibeta_half_tddft(orb_, - this->ucell->infoNL, - nlm, - tau1 * this->ucell->lat0, - T1, - atom1->iw2l[iw1], - atom1->iw2m[iw1], - atom1->iw2n[iw1], - tau0 * this->ucell->lat0, - T0, - this->cart_At, - true); - for (int dir = 0; dir < 4; dir++) - { - nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); - } - } - } - -#ifdef _OPENMP - // record the iat number of the adjacent atoms - std::set ad_atom_set; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - ad_atom_set.insert(iat1); - } - - // split the ad_atom_set into num_threads parts - const int num_threads = omp_get_num_threads(); - const int thread_id = omp_get_thread_num(); - std::set ad_atom_set_thread; - int i = 0; - for (const auto iat1: ad_atom_set) - { - if (i % num_threads == thread_id) - { - ad_atom_set_thread.insert(iat1); - } - i++; - } -#endif - - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); -#ifdef _OPENMP - if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) - { - continue; - } -#endif - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - hamilt::BaseMatrix>* matrix_ptr - = this->current_term[i]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - if (matrix_ptr != nullptr) - { - tmp_c[i] = matrix_ptr->get_pointer(); - } - } - // if not found , skip this pair of atoms - if (tmp_c[0] != nullptr) - { - this->cal_vcomm_r_IJR(iat1, iat2, T0, paraV, nlm_tot[ad1], nlm_tot[ad2], tmp_c); - } - } - } - } - } - ModuleBase::timer::tick("TD_current", "calculate_vcomm_r"); -} - -// cal_HR_IJR() -void TD_current::cal_vcomm_r_IJR( - const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>>& nlm1_all, - const std::vector>>>& nlm2_all, - std::complex** current_mat_p) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = col_indexes.size() * is + is2; - } - } - // calculate the local matrix - const std::complex* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); - std::vector>*> nlm1; - for (int dir = 0; dir < 4; dir++) - { - nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); - } - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - std::vector>*> nlm2; - for (int dir = 0; dir < 4; dir++) - { - nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); - } -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - for (int dir = 0; dir < 3; dir++) - { - std::complex nlm_r_tmp = std::complex{0, 0}; - std::complex imag_unit = std::complex{0, 1}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - //- - // multiply d in the end - nlm_r_tmp += (nlm1[dir + 1]->at(p1) * std::conj(nlm2[0]->at(p2)) - - nlm1[0]->at(p1) * std::conj(nlm2[dir + 1]->at(p2))) - * (*tmp_d); - } - // -i[r,Vnl], 2.0 due to the unit transformation - current_mat_p[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += npol; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } -} - -void TD_current::calculate_grad_term() -{ - ModuleBase::TITLE("TD_current", "calculate_grad_term"); - if (this->current_term[0] == nullptr || this->current_term[0]->size_atom_pairs() <= 0) - { - ModuleBase::WARNING_QUIT("TD_current::calculate_grad_term", "grad_term is nullptr or empty"); - } - ModuleBase::timer::tick("TD_current", "calculate_grad_term"); - - const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_grad[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - hamilt::BaseMatrix>* matrix_ptr - = this->current_term[i]->find_matrix(iat1, iat2, R_index2); - if (matrix_ptr != nullptr) - { - tmp_c[i] = matrix_ptr->get_pointer(); - } - } - if (tmp_c[0] != nullptr) - { - this->cal_grad_IJR(iat1, iat2, paraV, dtau, tmp_c); - } - else - { - ModuleBase::WARNING_QUIT("TD_current::calculate_grad_term", "R_index not found in HR"); - } - } - } - ModuleBase::timer::tick("TD_current", "calculate_grad_term"); -} - -void TD_current::cal_grad_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex** current_mat_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - // --------------------------------------------- - // get tau1 (in cell <0,0,0>) and tau2 (in cell R) - // in principle, only dtau is needed in this function - // snap_psipsi should be refactored to use dtau directly - // --------------------------------------------- - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double grad[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - // calculate , which equals to -. - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, nullptr, grad); - ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); - - for (int dir = 0; dir < 3; dir++) - { - for (int ipol = 0; ipol < npol; ipol++) - { - // part of Momentum operator, -iāˆ‡r,used to calculate the current - // here is actually iāˆ‡R - current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); - } - current_mat_p[dir] += npol; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } -} - -#endif // __LCAO From 822c3bb213147d5c62103ae7273bf340ac692e0e Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:18:39 +0800 Subject: [PATCH 33/81] Delete source/module_hamilt_lcao/module_tddft/td_current.h --- .../module_tddft/td_current.h | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 source/module_hamilt_lcao/module_tddft/td_current.h diff --git a/source/module_hamilt_lcao/module_tddft/td_current.h b/source/module_hamilt_lcao/module_tddft/td_current.h deleted file mode 100644 index 1b9e48d385..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_current.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef TD_CURRENT_H -#define TD_CURRENT_H -#include -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "td_velocity.h" -#include "source_base/vector3.h" - -#ifdef __LCAO -//design to calculate current for length gauge -class TD_current -{ - public: - TD_current(const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator* intor); - ~TD_current(); - - hamilt::HContainer>* get_current_term_pointer(const int& i)const - { - return this->current_term[i]; - } - - void calculate_vcomm_r(); - void calculate_grad_term(); - - private: - const UnitCell* ucell = nullptr; - - const Parallel_Orbitals* paraV = nullptr; - - const LCAO_Orbitals& orb_; - - const Grid_Driver* Grid = nullptr; - /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only shared between TD operators. - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - - const TwoCenterIntegrator* intor_ = nullptr; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_vcomm_r(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); - void initialize_grad_term(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_vcomm_r_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>>& nlm1_all, - const std::vector>>>& nlm2_all, - std::complex** current_mat_p); - void cal_grad_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex** current_mat_p); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_vcommr; - std::vector adjs_grad; - - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; -}; - - -#endif // __LCAO -#endif // TD_CURRENT_H From 6a75c76e8f09d0185dba13361c60b2388db936b5 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:21:30 +0800 Subject: [PATCH 34/81] Update cal_r_overlap_R.cpp --- source/module_io/cal_r_overlap_R.cpp | 368 +++++++++++++++++++++++++++ 1 file changed, 368 insertions(+) diff --git a/source/module_io/cal_r_overlap_R.cpp b/source/module_io/cal_r_overlap_R.cpp index 237723e06e..3c9a156a8a 100644 --- a/source/module_io/cal_r_overlap_R.cpp +++ b/source/module_io/cal_r_overlap_R.cpp @@ -5,6 +5,7 @@ #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_pw/hamilt_pwdft/global.h" +#include "source_base/mathzone_add1.h" cal_r_overlap_R::cal_r_overlap_R() { @@ -226,6 +227,238 @@ void cal_r_overlap_R::construct_orbs_and_orb_r(const UnitCell& ucell, } } +void cal_r_overlap_R::construct_orbs_and_nonlocal_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb) +{ + const InfoNonlocal& infoNL_ = ucell.infoNL; + + int orb_r_ntype = 0; + int mat_Nr = orb.Phi[0].PhiLN(0, 0).getNr(); + int count_Nr = 0; + + orbs.resize(orb.get_ntype()); + for (int T = 0; T < orb.get_ntype(); ++T) + { + count_Nr = orb.Phi[T].PhiLN(0, 0).getNr(); + if (count_Nr > mat_Nr) + { + mat_Nr = count_Nr; + orb_r_ntype = T; + } + + orbs[T].resize(orb.Phi[T].getLmax() + 1); + for (int L = 0; L <= orb.Phi[T].getLmax(); ++L) + { + orbs[T][L].resize(orb.Phi[T].getNchi(L)); + for (int N = 0; N < orb.Phi[T].getNchi(L); ++N) + { + const auto& orb_origin = orb.Phi[T].PhiLN(L, N); + orbs[T][L][N].set_orbital_info(orb_origin.getLabel(), + orb_origin.getType(), + orb_origin.getL(), + orb_origin.getChi(), + orb_origin.getNr(), + orb_origin.getRab(), + orb_origin.getRadial(), + Numerical_Orbital_Lm::Psi_Type::Psi, + orb_origin.getPsi(), + static_cast(orb_origin.getNk() * kmesh_times) | 1, + orb_origin.getDk(), + orb_origin.getDruniform(), + false, + true, + PARAM.inp.cal_force); + } + } + } + + orb_r.set_orbital_info(orbs[orb_r_ntype][0][0].getLabel(), // atom label + orb_r_ntype, // atom type + 1, // angular momentum L + 1, // number of orbitals of this L , just N + orbs[orb_r_ntype][0][0].getNr(), // number of radial mesh + orbs[orb_r_ntype][0][0].getRab(), // the mesh interval in radial mesh + orbs[orb_r_ntype][0][0].getRadial(), // radial mesh value(a.u.) + Numerical_Orbital_Lm::Psi_Type::Psi, + orbs[orb_r_ntype][0][0].getRadial(), // radial wave function + orbs[orb_r_ntype][0][0].getNk(), + orbs[orb_r_ntype][0][0].getDk(), + orbs[orb_r_ntype][0][0].getDruniform(), + false, + true, + PARAM.inp.cal_force); + + orbs_nonlocal.resize(orb.get_ntype()); + for (int T = 0; T < orb.get_ntype(); ++T) + { + const int nproj = infoNL_.nproj[T]; + orbs_nonlocal[T].resize(nproj); + for (int ip = 0; ip < nproj; ip++) + { + int nr = infoNL_.Beta[T].Proj[ip].getNr(); + double dr_uniform = 0.01; + int nr_uniform = static_cast((infoNL_.Beta[T].Proj[ip].getRadial(nr-1) - infoNL_.Beta[T].Proj[ip].getRadial(0))/dr_uniform) + 1; + double* rad = new double[nr_uniform]; + double* rab = new double[nr_uniform]; + for (int ir = 0; ir < nr_uniform; ir++) + { + rad[ir] = ir*dr_uniform; + rab[ir] = dr_uniform; + } + double* y2 = new double[nr]; + double* Beta_r_uniform = new double[nr_uniform]; + double* dbeta_uniform = new double[nr_uniform]; + ModuleBase::Mathzone_Add1::SplineD2(infoNL_.Beta[T].Proj[ip].getRadial(), infoNL_.Beta[T].Proj[ip].getBeta_r(), nr, 0.0, 0.0, y2); + ModuleBase::Mathzone_Add1::Cubic_Spline_Interpolation( + infoNL_.Beta[T].Proj[ip].getRadial(), + infoNL_.Beta[T].Proj[ip].getBeta_r(), + y2, + nr, + rad, + nr_uniform, + Beta_r_uniform, + dbeta_uniform + ); + + // linear extrapolation at the zero point + if (infoNL_.Beta[T].Proj[ip].getRadial(0) > 1e-10) + { + double slope = (infoNL_.Beta[T].Proj[ip].getBeta_r(1) - infoNL_.Beta[T].Proj[ip].getBeta_r(0)) / (infoNL_.Beta[T].Proj[ip].getRadial(1) - infoNL_.Beta[T].Proj[ip].getRadial(0)); + Beta_r_uniform[0] = infoNL_.Beta[T].Proj[ip].getBeta_r(0) - slope * infoNL_.Beta[T].Proj[ip].getRadial(0); + } + + // Here, the operation beta_r / r is performed. To avoid divergence at r=0, beta_r(0) is set to beta_r(1). + // However, this may introduce issues, so caution is needed. + for (int ir = 1; ir < nr_uniform; ir++) + { + Beta_r_uniform[ir] = Beta_r_uniform[ir] / rad[ir]; + } + Beta_r_uniform[0] = Beta_r_uniform[1]; + + orbs_nonlocal[T][ip].set_orbital_info(infoNL_.Beta[T].getLabel(), + infoNL_.Beta[T].getType(), + infoNL_.Beta[T].Proj[ip].getL(), + 1, + nr_uniform, + rab, + rad, + Numerical_Orbital_Lm::Psi_Type::Psi, + Beta_r_uniform, + static_cast(infoNL_.Beta[T].Proj[ip].getNk() * kmesh_times) | 1, + infoNL_.Beta[T].Proj[ip].getDk(), + infoNL_.Beta[T].Proj[ip].getDruniform(), + false, + true, + PARAM.inp.cal_force); + + delete [] rad; + delete [] rab; + delete [] y2; + delete [] Beta_r_uniform; + delete [] dbeta_uniform; + } + } + + for (int TA = 0; TA < orb.get_ntype(); ++TA) + { + for (int TB = 0; TB < orb.get_ntype(); ++TB) + { + for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) + { + for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) + { + for (int ip = 0; ip < infoNL_.nproj[TB]; ip++) + { + center2_orb11_nonlocal[TA][TB][LA][NA].insert( + std::make_pair(ip, Center2_Orb::Orb11(orbs[TA][LA][NA], orbs_nonlocal[TB][ip], psb_, MGT))); + } + } + } + } + } + + for (int TA = 0; TA < orb.get_ntype(); ++TA) + { + for (int TB = 0; TB < orb.get_ntype(); ++TB) + { + for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) + { + for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) + { + for (int ip = 0; ip < infoNL_.nproj[TB]; ip++) + { + center2_orb21_r_nonlocal[TA][TB][LA][NA].insert(std::make_pair( + ip, + Center2_Orb::Orb21(orbs[TA][LA][NA], orb_r, orbs_nonlocal[TB][ip], psb_, MGT))); + } + } + } + } + } + + for (auto& co1: center2_orb11_nonlocal) + { + for (auto& co2: co1.second) + { + for (auto& co3: co2.second) + { + for (auto& co4: co3.second) + { + for (auto& co5: co4.second) + { + co5.second.init_radial_table(); + } + } + } + } + } + + for (auto& co1: center2_orb21_r_nonlocal) + { + for (auto& co2: co1.second) + { + for (auto& co3: co2.second) + { + for (auto& co4: co3.second) + { + for (auto& co5: co4.second) + { + co5.second.init_radial_table(); + } + } + } + } + } + + iw2it.resize(PARAM.globalv.nlocal); + iw2ia.resize(PARAM.globalv.nlocal); + iw2iL.resize(PARAM.globalv.nlocal); + iw2iN.resize(PARAM.globalv.nlocal); + iw2im.resize(PARAM.globalv.nlocal); + + int iw = 0; + for (int it = 0; it < ucell.ntype; it++) + { + for (int ia = 0; ia < ucell.atoms[it].na; ia++) + { + for (int iL = 0; iL < ucell.atoms[it].nwl + 1; iL++) + { + for (int iN = 0; iN < ucell.atoms[it].l_nchi[iL]; iN++) + { + for (int im = 0; im < (2 * iL + 1); im++) + { + iw2it[iw] = it; + iw2ia[iw] = ia; + iw2iL[iw] = iL; + iw2iN[iw] = iN; + iw2im[iw] = im; + iw++; + } + } + } + } + } +} + void cal_r_overlap_R::init(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb) { ModuleBase::TITLE("cal_r_overlap_R", "init"); @@ -239,6 +472,141 @@ void cal_r_overlap_R::init(const UnitCell& ucell,const Parallel_Orbitals& pv, co return; } +void cal_r_overlap_R::init_nonlocal(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb) +{ + ModuleBase::TITLE("cal_r_overlap_R", "init_nonlocal"); + ModuleBase::timer::tick("cal_r_overlap_R", "init_nonlocal"); + this->ParaV = &pv; + + initialize_orb_table(ucell,orb); + construct_orbs_and_nonlocal_and_orb_r(ucell,orb); + + ModuleBase::timer::tick("cal_r_overlap_R", "init_nonlocal"); + return; +} + +ModuleBase::Vector3 cal_r_overlap_R::get_psi_r_psi(const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2, + const int& L2, + const int& m2, + const int& N2) +{ + ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); + double factor = sqrt(ModuleBase::FOUR_PI / 3.0); + const ModuleBase::Vector3& distance = R2 - R1; + + double overlap_o = center2_orb11[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, distance, m1, m2); + + double overlap_x = -1 * factor + * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, + distance, + m1, + 1, + m2); // m = 1 + + double overlap_y = -1 * factor + * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, + distance, + m1, + 2, + m2); // m = -1 + + double overlap_z = factor + * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, + distance, + m1, + 0, + m2); // m = 0 + + ModuleBase::Vector3 temp_prp + = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) + R1 * overlap_o; + + return temp_prp; +} + +void cal_r_overlap_R::get_psi_r_beta(const UnitCell& ucell, + std::vector>& nlm, + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2) +{ + ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); + double factor = sqrt(ModuleBase::FOUR_PI / 3.0); + const ModuleBase::Vector3& distance = R2 - R1; + const InfoNonlocal& infoNL_ = ucell.infoNL; + const int nproj = infoNL_.nproj[T2]; + nlm.resize(4); + if (nproj == 0) + { + for(int i = 0;i < 4;i++) + { + nlm[i].resize(1); + } + return; + } + + int natomwfc = 0; + for (int ip = 0; ip < nproj; ip++) + { + const int L2 = infoNL_.Beta[T2].Proj[ip].getL(); // mohan add 2021-05-07 + natomwfc += 2 * L2 + 1; + } + for(int i = 0;i < 4;i++) + { + nlm[i].resize(natomwfc); + } + int index = 0; + for (int ip = 0; ip < nproj; ip++) + { + const int L2 = infoNL_.Beta[T2].Proj[ip].getL(); + for (int m2 = 0; m2 < 2 * L2 + 1; m2++) + { + double overlap_o + = center2_orb11_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, distance, m1, m2); + + double overlap_x = -1 * factor + * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, + distance, + m1, + 1, + m2); // m = 1 + + double overlap_y = -1 * factor + * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, + distance, + m1, + 2, + m2); // m = -1 + + double overlap_z = factor + * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, + distance, + m1, + 0, + m2); // m = 0 + + //nlm[index] = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) + R1 * overlap_o; + + //nlm[index] = ModuleBase::Vector3(overlap_o, overlap_y, overlap_z);// + R1 * overlap_o; + nlm[0][index] = overlap_o; + nlm[1][index] = overlap_x + (R1 * overlap_o).x; + nlm[2][index] = overlap_y + (R1 * overlap_o).y; + nlm[3][index] = overlap_z + (R1 * overlap_o).z; + index++; + } + } +} + + void cal_r_overlap_R::out_rR(const UnitCell& ucell, const Grid_Driver& gd, const int& istep) { ModuleBase::TITLE("cal_r_overlap_R", "out_rR"); From 4efbb25c8852944ff36cec465ebc4a6d2779e555 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:22:01 +0800 Subject: [PATCH 35/81] Update cal_r_overlap_R.h --- source/module_io/cal_r_overlap_R.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/module_io/cal_r_overlap_R.h b/source/module_io/cal_r_overlap_R.h index 058a8c35b7..6d9ea5e6c2 100644 --- a/source/module_io/cal_r_overlap_R.h +++ b/source/module_io/cal_r_overlap_R.h @@ -33,6 +33,30 @@ class cal_r_overlap_R bool binary = false; void init(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb); + void init_nonlocal(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb); + ModuleBase::Vector3 get_psi_r_psi( + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2, + const int& L2, + const int& m2, + const int& N2 + ); + void get_psi_r_beta( + const UnitCell& ucell, + std::vector>& nlm, + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2 + ); void out_rR(const UnitCell& ucell, const Grid_Driver& gd, const int& istep); void out_rR_other(const UnitCell& ucell, const int& istep, const std::set>& output_R_coor); From cc85159ef87d7b7adff0937002bac8037bcaed35 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:23:10 +0800 Subject: [PATCH 36/81] Update cal_r_overlap_R.h --- source/module_io/cal_r_overlap_R.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/module_io/cal_r_overlap_R.h b/source/module_io/cal_r_overlap_R.h index 6d9ea5e6c2..07f044f6b0 100644 --- a/source/module_io/cal_r_overlap_R.h +++ b/source/module_io/cal_r_overlap_R.h @@ -63,6 +63,7 @@ class cal_r_overlap_R private: void initialize_orb_table(const UnitCell& ucell, const LCAO_Orbitals& orb); void construct_orbs_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb); + void construct_orbs_and_nonlocal_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb); std::vector iw2ia; std::vector iw2iL; @@ -75,6 +76,7 @@ class cal_r_overlap_R Numerical_Orbital_Lm orb_r; std::vector>> orbs; + std::vector> orbs_nonlocal; std::map< size_t, @@ -86,6 +88,16 @@ class cal_r_overlap_R std::map>>>>> center2_orb21_r; + std::map< + size_t, + std::map>>>> + center2_orb11_nonlocal; + + std::map< + size_t, + std::map>>>> + center2_orb21_r_nonlocal; + const Parallel_Orbitals* ParaV; }; #endif From ff163c74e8df62f15218ace345bbf45355b6b8cd Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:25:55 +0800 Subject: [PATCH 37/81] Update input_conv.cpp --- source/module_io/input_conv.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/source/module_io/input_conv.cpp b/source/module_io/input_conv.cpp index 209c1ea53e..5a451844e3 100644 --- a/source/module_io/input_conv.cpp +++ b/source/module_io/input_conv.cpp @@ -24,7 +24,7 @@ #include "source_estate/module_pot/H_TDDFT_pw.h" #include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" #include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #endif #ifdef __PEXSI #include "source_hsolver/module_pexsi/pexsi_solver.h" @@ -57,24 +57,25 @@ std::vector Input_Conv::convert_units(std::string params, double c) { void Input_Conv::read_td_efield() { elecstate::H_TDDFT_pw::stype = PARAM.inp.td_stype; - if (PARAM.inp.esolver_type == "tddft" && elecstate::H_TDDFT_pw::stype == 1) - { - TD_Velocity::tddft_velocity = true; - } else { - TD_Velocity::tddft_velocity = false; - } if (PARAM.inp.out_mat_hs2 == 1) { - TD_Velocity::out_mat_R = true; + TD_info::out_mat_R = true; } else { - TD_Velocity::out_mat_R = false; + TD_info::out_mat_R = false; } parse_expression(PARAM.inp.td_ttype, elecstate::H_TDDFT_pw::ttype); elecstate::H_TDDFT_pw::tstart = PARAM.inp.td_tstart; elecstate::H_TDDFT_pw::tend = PARAM.inp.td_tend; + if(PARAM.inp.td_dt!=-1.0) + { + elecstate::H_TDDFT_pw::dt = PARAM.inp.td_dt / ModuleBase::AU_to_FS; + } + else + { + elecstate::H_TDDFT_pw::dt = PARAM.mdp.md_dt / PARAM.inp.estep_per_md / ModuleBase::AU_to_FS; + } - elecstate::H_TDDFT_pw::dt = PARAM.mdp.md_dt / ModuleBase::AU_to_FS; elecstate::H_TDDFT_pw::dt_int = elecstate::H_TDDFT_pw::dt; // space domain parameters @@ -247,10 +248,10 @@ void Input_Conv::Convert() // Fuxiang He add 2016-10-26 //---------------------------------------------------------- #ifdef __LCAO - TD_Velocity::out_current = PARAM.inp.out_current; - TD_Velocity::out_current_k = PARAM.inp.out_current_k; - TD_Velocity::out_vecpot = PARAM.inp.out_vecpot; - TD_Velocity::init_vecpot_file = PARAM.inp.init_vecpot_file; + TD_info::out_current = PARAM.inp.out_current; + TD_info::out_current_k = PARAM.inp.out_current_k; + TD_info::out_vecpot = PARAM.inp.out_vecpot; + TD_info::init_vecpot_file = PARAM.inp.init_vecpot_file; read_td_efield(); #endif // __LCAO From 473b094a384f44588e89ce5bf67b3fb7b233a560 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:30:11 +0800 Subject: [PATCH 38/81] Update output_log.cpp --- source/module_io/output_log.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/module_io/output_log.cpp b/source/module_io/output_log.cpp index 52f924b36d..bc202aec03 100644 --- a/source/module_io/output_log.cpp +++ b/source/module_io/output_log.cpp @@ -346,5 +346,17 @@ void write_head(std::ofstream& ofs, const int& istep, const int& iter, const std // ofs << "\n " << basisname << " ALGORITHM --------------- ION=" << std::setw(4) << istep + 1 // << " ELEC=" << std::setw(4) << iter << "--------------------------------\n"; } +void write_head_td(std::ofstream& ofs, const int& istep, const int& estep, const int& iter, const std::string& basisname) +{ + ofs << "\n"; + ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; + ofs << " --> IONIC RELAXATION STEP=" << std::setw(6) << istep+1 + << " ELECTRON PROPAGATION STEP=" << std::setw(6) << estep + << " ELECTRONIC ITERATION STEP=" << std::setw(6) << iter << "\n"; + ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; + +// ofs << "\n " << basisname << " ALGORITHM --------------- ION=" << std::setw(4) << istep + 1 +// << " ELEC=" << std::setw(4) << estep << " iter=" << std::setw(4) << iter << "--------------------------------\n"; +} }// namespace ModuleIO From f8239de15c6131d930ac5a3dfa4746bd40d1185a Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:30:37 +0800 Subject: [PATCH 39/81] Update output_log.h --- source/module_io/output_log.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/module_io/output_log.h b/source/module_io/output_log.h index d1b476fd0f..7eba64b0c4 100644 --- a/source/module_io/output_log.h +++ b/source/module_io/output_log.h @@ -77,6 +77,14 @@ void print_stress(const std::string& name, /// @param basisname basis set name void write_head(std::ofstream& ofs_running, const int& istep, const int& iter, const std::string& basisname); +/// @brief write head for scf iteration +/// @param ofs_running output stream +/// @param istep the ion step +/// @param estep the electron step +/// @param iter the scf iteration step +/// @param basisname basis set name +void write_head_td(std::ofstream& ofs_running, const int& istep, const int& estep, const int& iter, const std::string& basisname); + } // namespace ModuleIO #endif From c9c49f44bda48bc698c927d2d9a800e00e52d631 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:31:53 +0800 Subject: [PATCH 40/81] Update read_input_item_md.cpp --- source/module_io/read_input_item_md.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/module_io/read_input_item_md.cpp b/source/module_io/read_input_item_md.cpp index a49c1bd3e6..4ba795d63a 100644 --- a/source/module_io/read_input_item_md.cpp +++ b/source/module_io/read_input_item_md.cpp @@ -23,7 +23,7 @@ void ReadInput::item_md() Input_Item item("md_nstep"); item.annotation = "md steps"; item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mdp.md_nstep == 0) + if (para.input.mdp.md_nstep == 0 && para.input.esolver_type != "tddft") { GlobalV::ofs_running << "md_nstep should be set. Autoset md_nstep to 50!" << std::endl; para.input.mdp.md_nstep = 50; @@ -40,6 +40,13 @@ void ReadInput::item_md() ModuleBase::WARNING_QUIT("ReadInput", "time interval of MD calculation should be positive"); } }; + item.reset_value = [](const Input_Item& item, Parameter& para) { + if (para.input.td_dt != -1.0) + { + GlobalV::ofs_running << "td_dt exist, set md_dt with td_dt" << std::endl; + para.input.mdp.md_dt = para.input.td_dt * para.input.estep_per_md; + } + }; read_sync_double(input.mdp.md_dt); this->add_item(item); } @@ -403,4 +410,4 @@ void ReadInput::item_md() this->add_item(item); } } -} // namespace ModuleIO \ No newline at end of file +} // namespace ModuleIO From 1f927dd167a8e3d7292fc86cb09d49ab56f9e712 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:34:50 +0800 Subject: [PATCH 41/81] Update read_input_item_system.cpp --- source/module_io/read_input_item_system.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/module_io/read_input_item_system.cpp b/source/module_io/read_input_item_system.cpp index d754f98465..ed8cd2f778 100644 --- a/source/module_io/read_input_item_system.cpp +++ b/source/module_io/read_input_item_system.cpp @@ -158,6 +158,10 @@ void ReadInput::item_system() { para.input.symmetry = "0"; } + if (para.input.esolver_type == "tddft") + { + para.input.symmetry = "-1"; + } if (para.input.qo_switch) { para.input.symmetry = "-1"; // disable kpoint reduce From f1d8f06aed2b7734f8f2ac794fc46cbc09f28aed Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:35:28 +0800 Subject: [PATCH 42/81] Update read_input_item_tddft.cpp --- source/module_io/read_input_item_tddft.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/source/module_io/read_input_item_tddft.cpp b/source/module_io/read_input_item_tddft.cpp index 5a3ffe3214..6b0b103088 100644 --- a/source/module_io/read_input_item_tddft.cpp +++ b/source/module_io/read_input_item_tddft.cpp @@ -8,6 +8,25 @@ namespace ModuleIO void ReadInput::item_rt_tddft() { // real time TDDFT + { + Input_Item item("td_dt"); + item.annotation = "time step for evolving wavefunction"; + item.reset_value = [](const Input_Item& item, Parameter& para) { + if (para.input.td_dt == -1.0) + { + GlobalV::ofs_running << "td_dt don't exist, set td_dt with md_dt" << std::endl; + para.input.td_dt = para.input.mdp.md_dt / para.input.estep_per_md; + } + }; + read_sync_double(input.td_dt); + this->add_item(item); + } + { + Input_Item item("estep_per_md"); + item.annotation = "steps of force change"; + read_sync_int(input.estep_per_md); + this->add_item(item); + } { Input_Item item("td_force_dt"); item.annotation = "time of force change"; @@ -388,4 +407,4 @@ void ReadInput::item_lr_tddft() this->add_item(item); } } -} \ No newline at end of file +} From a9cca5c5787372688e8f94c608160ee610429d96 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:37:06 +0800 Subject: [PATCH 43/81] Update read_input.cpp --- source/module_io/read_input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/module_io/read_input.cpp b/source/module_io/read_input.cpp index e8ee9ef3fd..1bd8520519 100644 --- a/source/module_io/read_input.cpp +++ b/source/module_io/read_input.cpp @@ -194,6 +194,7 @@ void ReadInput::create_directory(const Parameter& param) ModuleBase::Global_File::make_dir_out(param.input.suffix, param.input.calculation, out_dir, + param.input.out_wfc_lcao, this->rank, param.input.mdp.md_restart, param.input.out_alllog); // xiaohui add 2013-09-01 @@ -372,7 +373,7 @@ void ReadInput::write_txt_input(const Parameter& param, const std::string& filen { ofs << "\n#Parameters (8.DeepKS)" << std::endl; } - else if (p_item->label == "td_force_dt") + else if (p_item->label == "td_dt") { ofs << "\n#Parameters (9.rt-tddft)" << std::endl; } From 87c9889b52dfe1367ab396b0c0ef57915ba77a26 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:38:02 +0800 Subject: [PATCH 44/81] Update read_set_globalv.cpp --- source/module_io/read_set_globalv.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/module_io/read_set_globalv.cpp b/source/module_io/read_set_globalv.cpp index be49b0a514..9116a47e04 100644 --- a/source/module_io/read_set_globalv.cpp +++ b/source/module_io/read_set_globalv.cpp @@ -93,6 +93,11 @@ void ReadInput::set_global_dir(const Input_para& inp, System_para& sys) sys.global_matrix_dir = sys.global_out_dir + "matrix/"; sys.global_matrix_dir = to_dir(sys.global_matrix_dir); + /// get the global output directory + sys.global_wfc_dir = sys.global_out_dir + "WFC/"; + sys.global_wfc_dir = to_dir(sys.global_wfc_dir); + + /// get the global ML KEDF descriptor directory sys.global_mlkedf_descriptor_dir = sys.global_out_dir + "MLKEDF_Descriptors/"; sys.global_mlkedf_descriptor_dir = to_dir(sys.global_mlkedf_descriptor_dir); From 3934384b72cb881e53e909c31e22f075cda864a7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:38:17 +0800 Subject: [PATCH 45/81] Update read_set_globalv.cpp --- source/module_io/read_set_globalv.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/module_io/read_set_globalv.cpp b/source/module_io/read_set_globalv.cpp index 9116a47e04..02fb9c8fa0 100644 --- a/source/module_io/read_set_globalv.cpp +++ b/source/module_io/read_set_globalv.cpp @@ -149,6 +149,7 @@ void ReadInput::set_global_dir(const Input_para& inp, System_para& sys) Parallel_Common::bcast_string(sys.global_readin_dir); Parallel_Common::bcast_string(sys.global_stru_dir); Parallel_Common::bcast_string(sys.global_matrix_dir); + Parallel_Common::bcast_string(sys.global_wfc_dir); Parallel_Common::bcast_string(sys.global_in_stru); #endif } From 2a14ab7fe253682b41c4cc2fef472d45cec258d0 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:42:53 +0800 Subject: [PATCH 46/81] Update read_wfc_nao.cpp --- source/module_io/read_wfc_nao.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/module_io/read_wfc_nao.cpp b/source/module_io/read_wfc_nao.cpp index 40ec294295..b6f6262ef9 100644 --- a/source/module_io/read_wfc_nao.cpp +++ b/source/module_io/read_wfc_nao.cpp @@ -30,6 +30,7 @@ bool ModuleIO::read_wfc_nao( const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep, const int skip_band) { ModuleBase::TITLE("ModuleIO", "read_wfc_nao"); @@ -155,11 +156,10 @@ bool ModuleIO::read_wfc_nao( if (myrank == 0) { const bool out_app_flag = false; - const int istep = -1; std::stringstream error_message; - std::string ss = ModuleIO::filename_output(global_readin_dir,"wf","nao", - ik,ik2iktot,nspin,nkstot,out_type,out_app_flag,gamma_only,istep); + std::string ss = ModuleIO::filename_output(global_readin_dir + "WFC/","wf","nao", + ik,ik2iktot,nspin,nkstot,out_type,out_app_flag,gamma_only,nstep); read_success = read_one_file(ss, error_message, ik, ctot); errors = error_message.str(); @@ -207,6 +207,7 @@ template bool ModuleIO::read_wfc_nao(const std::string& global_readin_di const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep, const int skip_band); template bool ModuleIO::read_wfc_nao>(const std::string& global_readin_dir, @@ -216,4 +217,5 @@ template bool ModuleIO::read_wfc_nao>(const std::string& gl const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep, const int skip_band); From e0336ce9e42b232da4f4a4b624fed9f030fac1bf Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:43:24 +0800 Subject: [PATCH 47/81] Update read_wfc_nao.h --- source/module_io/read_wfc_nao.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/module_io/read_wfc_nao.h b/source/module_io/read_wfc_nao.h index 370071f04b..e0993d2482 100644 --- a/source/module_io/read_wfc_nao.h +++ b/source/module_io/read_wfc_nao.h @@ -44,6 +44,7 @@ bool read_wfc_nao( const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep = -1, const int skip_band = 0); } // namespace ModuleIO From a5ba582003fc1f08b87bba0b2ea48740b4fb3633 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:45:23 +0800 Subject: [PATCH 48/81] Update td_current_io.cpp --- source/module_io/td_current_io.cpp | 420 ++++++++++++++++++++++++----- 1 file changed, 360 insertions(+), 60 deletions(-) diff --git a/source/module_io/td_current_io.cpp b/source/module_io/td_current_io.cpp index 5172c1eb0a..cfeb03ce8b 100644 --- a/source/module_io/td_current_io.cpp +++ b/source/module_io/td_current_io.cpp @@ -11,29 +11,210 @@ #include "source_estate/module_pot/H_TDDFT_pw.h" #include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" #include "module_hamilt_lcao/module_tddft/td_current.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #ifdef __LCAO +void ModuleIO::cal_tmp_DM(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, + elecstate::DensityMatrix, double>& DM_imag, + int nspin_dm) +{ + ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + for (int is = 1; is <= nspin_dm; ++is) + { + for (int ik = 0; ik < DM_real.get_DMK_nks() / nspin_dm; ++ik) + { + cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is, false); + } + } + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); +} +template +void ModuleIO::write_current(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra) +{ + + ModuleBase::TITLE("ModuleIO", "write_current"); + ModuleBase::timer::tick("ModuleIO", "write_current"); + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + if (PARAM.inp.td_stype!=1) + { + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = cal_current->get_current_term_pointer(dir); + } + } + else + { + if (TD_info::td_vel_op == nullptr) + { + ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); + } + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); + } + } + double omega=ucell.omega; + // construct a DensityMatrix object + // Since the function cal_dm_psi do not suport DMR in complex type, I replace it with two DMR in double type. Should + // be refactored in the future. + const int nspin0 = PARAM.inp.nspin; + const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; + elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + // calculate DMK + elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); + + // init DMR + DM_real.init_DMR(ra, &ucell); + DM_imag.init_DMR(ra, &ucell); + cal_tmp_DM(ucell, DM_real, DM_imag, nspin_dm); + //DM_real.sum_DMR_spin(); + //DM_imag.sum_DMR_spin(); + + double current_total[3] = {0.0, 0.0, 0.0}; +#ifdef _OPENMP +#pragma omp parallel + { + double local_current[3] = {0.0, 0.0, 0.0}; +#else + // ModuleBase::matrix& local_soverlap = soverlap; + double* local_current = current_total; +#endif + ModuleBase::Vector3 tau1, dtau, tau2; + +#ifdef _OPENMP +#pragma omp for schedule(dynamic) +#endif + for (int iat = 0; iat < ucell.nat; iat++) + { + const int T1 = ucell.iat2it[iat]; + Atom* atom1 = &ucell.atoms[T1]; + const int I1 = ucell.iat2ia[iat]; + // get iat1 + int iat1 = ucell.itia2iat(T1, I1); + const int start1 = ucell.itiaiw2iwt(T1, I1, 0); + for (int cb = 0; cb < ra.na_each[iat]; ++cb) + { + const int T2 = ra.info[iat][cb][3]; + const int I2 = ra.info[iat][cb][4]; + + const int start2 = ucell.itiaiw2iwt(T2, I2, 0); + + Atom* atom2 = &ucell.atoms[T2]; + + // get iat2 + int iat2 = ucell.itia2iat(T2, I2); + double Rx = ra.info[iat][cb][0]; + double Ry = ra.info[iat][cb][1]; + double Rz = ra.info[iat][cb][2]; + //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; + // get BaseMatrix + hamilt::BaseMatrix* tmp_matrix_real + = DM_real.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix* tmp_matrix_imag + = DM_imag.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); + // refactor + hamilt::BaseMatrix>* tmp_m_rvx + = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvy + = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvz + = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); + if (tmp_matrix_real == nullptr) + { + continue; + } + int row_ap = pv->atom_begin_row[iat1]; + int col_ap = pv->atom_begin_col[iat2]; + // get DMR + for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) + { + for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) + { + double dm2d1_real = tmp_matrix_real->get_value(mu, nu); + double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); + + std::complex rvx = {0, 0}; + std::complex rvy = {0, 0}; + std::complex rvz = {0, 0}; + + if (tmp_m_rvx != nullptr) + { + rvx = tmp_m_rvx->get_value(mu, nu); + rvy = tmp_m_rvy->get_value(mu, nu); + rvz = tmp_m_rvz->get_value(mu, nu); + } + //std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; + // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; + //std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; + local_current[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); + local_current[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); + local_current[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); + } // end kk + } // end jj + } // end cb + } // end iat +#ifdef _OPENMP +#pragma omp critical(cal_current_k_reduce) + { + for (int i = 0; i < 3; ++i) + { + current_total[i] += local_current[i]; + } + } + } +#endif + Parallel_Reduce::reduce_all(current_total, 3); + // write end + if (GlobalV::MY_RANK == 0) + { + std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; + std::ofstream fout; + fout.open(filename, std::ios::app); + fout << std::setprecision(16); + fout << std::scientific; + fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; + fout.close(); + } -void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double>& DM_real, + ModuleBase::timer::tick("ModuleIO", "write_current"); + return; +} +void ModuleIO::cal_tmp_DM_k(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, elecstate::DensityMatrix, double>& DM_imag, const int ik, const int nspin, - const int is) + const int is, + const bool reset) { - ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + ModuleBase::TITLE("ModuleIO", "cal_tmp_DM_k"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); int ld_hk = DM_real.get_paraV_pointer()->nrow; int ld_hk2 = 2 * ld_hk; // tmp for is int ik_begin = DM_real.get_DMK_nks() / nspin * (is - 1); // jump nk for spin_down if nspin==2 - - hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[is - 1]; - hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[is - 1]; - tmp_DMR_real->set_zero(); - tmp_DMR_imag->set_zero(); + //sum spin up and down into up + hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[0]; + hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[0]; + if(reset) + { + tmp_DMR_real->set_zero(); + tmp_DMR_imag->set_zero(); + } #ifdef _OPENMP #pragma omp parallel for #endif @@ -46,6 +227,12 @@ void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double> // get global indexes of whole matrix for each atom in this process int row_ap = DM_real.get_paraV_pointer()->atom_begin_row[iat1]; int col_ap = DM_real.get_paraV_pointer()->atom_begin_col[iat2]; + // SOC + std::vector> tmp_DMR; + if (PARAM.inp.nspin == 4) + { + tmp_DMR.resize(tmp_ap_real.get_size()); + } for (int ir = 0; ir < tmp_ap_real.get_R_size(); ++ir) { const ModuleBase::Vector3 r_index = tmp_ap_real.get_R_index(ir); @@ -61,10 +248,20 @@ void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double> // only ik if (PARAM.inp.nspin != 4) { + double arg_td = 0.0; + if(elecstate::H_TDDFT_pw::stype == 2) + { + //cal tddft phase for hybrid gague + const int iat1 = tmp_ap_real.get_atom_i(); + const int iat2 = tmp_ap_real.get_atom_j(); + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + double& tmp_lat0 = ucell.lat0; + arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; + } // cal k_phase // if TK==std::complex, kphase is e^{ikR} const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI; + const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; double sinp, cosp; ModuleBase::libm::sincos(arg, &sinp, &cosp); std::complex kphase = std::complex(cosp, sinp); @@ -112,13 +309,97 @@ void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double> tmp_DMR_imag_pointer += DM_imag.get_paraV_pointer()->get_col_size(iat2); } } + // treat DMR as pauli matrix when NSPIN=4 + if (PARAM.inp.nspin == 4) + { + tmp_DMR.assign(tmp_ap_real.get_size(), std::complex(0.0, 0.0)); + { + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + double arg_td = 0.0; + if(elecstate::H_TDDFT_pw::stype == 2) + { + //new + //cal tddft phase for mixing gague + const int iat1 = tmp_ap_real.get_atom_i(); + const int iat2 = tmp_ap_real.get_atom_j(); + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + double& tmp_lat0 = ucell.lat0; + arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; + } + const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + // set DMR element + std::complex* tmp_DMR_pointer = tmp_DMR.data(); + std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin);; + double* DMK_real_pointer = nullptr; + double* DMK_imag_pointer = nullptr; + // jump DMK to fill DMR + // DMR is row-major, DMK is column-major + tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; + for (int mu = 0; mu < tmp_ap_real.get_row_size(); ++mu) + { + BlasConnector::axpy(tmp_ap_real.get_col_size(), + kphase, + tmp_DMK_pointer, + ld_hk, + tmp_DMR_pointer, + 1); + tmp_DMK_pointer += 1; + tmp_DMR_pointer += tmp_ap_real.get_col_size(); + } + } + int npol = 2; + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + int step_trace[4]; + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = tmp_ap_real.get_col_size() * is + is2; + } + } + std::complex tmp[4]; + double* target_DMR_real = tmp_matrix_real->get_pointer(); + double* target_DMR_imag = tmp_matrix_imag->get_pointer(); + std::complex* tmp_DMR_pointer = tmp_DMR.data(); + for (int irow = 0; irow < tmp_ap_real.get_row_size(); irow += 2) + { + for (int icol = 0; icol < tmp_ap_real.get_col_size(); icol += 2) + { + // catch the 4 spin component value of one orbital pair + tmp[0] = tmp_DMR_pointer[icol + step_trace[0]]; + tmp[1] = tmp_DMR_pointer[icol + step_trace[1]]; + tmp[2] = tmp_DMR_pointer[icol + step_trace[2]]; + tmp[3] = tmp_DMR_pointer[icol + step_trace[3]]; + // transfer to Pauli matrix and save the real part + // save them back to the tmp_matrix + target_DMR_real[icol + step_trace[0]] += tmp[0].real() + tmp[3].real(); + target_DMR_real[icol + step_trace[1]] += tmp[1].real() + tmp[2].real(); + target_DMR_real[icol + step_trace[2]] + += -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() + target_DMR_real[icol + step_trace[3]] += tmp[0].real() - tmp[3].real(); + //imag part + target_DMR_imag[icol + step_trace[0]] += tmp[0].imag() + tmp[3].imag(); + target_DMR_imag[icol + step_trace[1]] += tmp[1].imag() + tmp[2].imag(); + target_DMR_imag[icol + step_trace[2]] + += tmp[1].real() - tmp[2].real(); // (i * (rho_updown - rho_downup)).real() + target_DMR_imag[icol + step_trace[3]] += tmp[0].imag() - tmp[3].imag(); + } + tmp_DMR_pointer += tmp_ap_real.get_col_size() * 2; + target_DMR_real += tmp_ap_real.get_col_size() * 2; + target_DMR_imag += tmp_ap_real.get_col_size() * 2; + } + } } } - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); } - -void ModuleIO::write_current(const UnitCell& ucell, - const Grid_Driver& gd, +template +void ModuleIO::write_current_eachk(const UnitCell& ucell, const int istep, const psi::Psi>* psi, const elecstate::ElecState* pelec, @@ -126,19 +407,15 @@ void ModuleIO::write_current(const UnitCell& ucell, const TwoCenterIntegrator* intor, const Parallel_Orbitals* pv, const LCAO_Orbitals& orb, + const Velocity_op* cal_current, Record_adj& ra) { + ModuleBase::TITLE("ModuleIO", "write_current"); ModuleBase::timer::tick("ModuleIO", "write_current"); - - TD_current* cal_current = nullptr; std::vector>*> current_term = {nullptr, nullptr, nullptr}; - - if (!TD_Velocity::tddft_velocity) + if (PARAM.inp.td_stype != 1) { - cal_current = new TD_current(&ucell, &gd, pv, orb, intor); - cal_current->calculate_vcomm_r(); - cal_current->calculate_grad_term(); for (int dir = 0; dir < 3; dir++) { current_term[dir] = cal_current->get_current_term_pointer(dir); @@ -146,16 +423,16 @@ void ModuleIO::write_current(const UnitCell& ucell, } else { - if (TD_Velocity::td_vel_op == nullptr) + if (TD_info::td_vel_op == nullptr) { - ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gauge infos is null!"); + ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); } for (int dir = 0; dir < 3; dir++) { - current_term[dir] = TD_Velocity::td_vel_op->get_current_term_pointer(dir); + current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); } } - + double omega=ucell.omega; // construct a DensityMatrix object // Since the function cal_dm_psi do not suport DMR in complex type, // I replace it with two DMR in double type. @@ -163,10 +440,8 @@ void ModuleIO::write_current(const UnitCell& ucell, const int nspin0 = PARAM.inp.nspin; const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; - elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - // calculate DMK elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); @@ -174,32 +449,23 @@ void ModuleIO::write_current(const UnitCell& ucell, DM_real.init_DMR(ra, &ucell); DM_imag.init_DMR(ra, &ucell); - int nks = DM_real.get_DMK_nks(); - if (nspin0 == 2) - { - nks /= 2; - } - + int nks = DM_real.get_DMK_nks() / nspin_dm; double current_total[3] = {0.0, 0.0, 0.0}; - for (int is = 1; is <= nspin0; ++is) + for (int is = 1; is <= nspin_dm; ++is) { for (int ik = 0; ik < nks; ++ik) { - cal_tmp_DM(DM_real, DM_imag, ik, nspin0, is); + cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is); // check later double current_ik[3] = {0.0, 0.0, 0.0}; - int total_irr = 0; - #ifdef _OPENMP #pragma omp parallel { int num_threads = omp_get_num_threads(); double local_current_ik[3] = {0.0, 0.0, 0.0}; - int local_total_irr = 0; #else // ModuleBase::matrix& local_soverlap = soverlap; double* local_current_ik = current_ik; - int& local_total_irr = total_irr; #endif ModuleBase::Vector3 tau1, dtau, tau2; @@ -214,8 +480,6 @@ void ModuleIO::write_current(const UnitCell& ucell, const int I1 = ucell.iat2ia[iat]; // get iat1 int iat1 = ucell.itia2iat(T1, I1); - - int irr = pv->nlocstart[iat]; const int start1 = ucell.itiaiw2iwt(T1, I1, 0); for (int cb = 0; cb < ra.na_each[iat]; ++cb) { @@ -231,13 +495,12 @@ void ModuleIO::write_current(const UnitCell& ucell, double Rx = ra.info[iat][cb][0]; double Ry = ra.info[iat][cb][1]; double Rz = ra.info[iat][cb][2]; - + //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; // get BaseMatrix hamilt::BaseMatrix* tmp_matrix_real = DM_real.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); hamilt::BaseMatrix* tmp_matrix_imag = DM_imag.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); - // refactor hamilt::BaseMatrix>* tmp_m_rvx = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); @@ -245,15 +508,12 @@ void ModuleIO::write_current(const UnitCell& ucell, = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); hamilt::BaseMatrix>* tmp_m_rvz = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); - if (tmp_matrix_real == nullptr) { continue; } - int row_ap = pv->atom_begin_row[iat1]; int col_ap = pv->atom_begin_col[iat2]; - // get DMR for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) { @@ -272,12 +532,12 @@ void ModuleIO::write_current(const UnitCell& ucell, rvy = tmp_m_rvy->get_value(mu, nu); rvz = tmp_m_rvz->get_value(mu, nu); } - local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); + // std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; + // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; + // std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; + local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); local_current_ik[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); local_current_ik[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); - - ++local_total_irr; - ++irr; } // end kk } // end jj } // end cb @@ -285,7 +545,6 @@ void ModuleIO::write_current(const UnitCell& ucell, #ifdef _OPENMP #pragma omp critical(cal_current_k_reduce) { - total_irr += local_total_irr; for (int i = 0; i < 3; ++i) { current_ik[i] += local_current_ik[i]; @@ -298,9 +557,8 @@ void ModuleIO::write_current(const UnitCell& ucell, { current_total[i] += current_ik[i]; } - // MPI_Reduce(local_current_ik, current_ik, 3, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); - if (GlobalV::MY_RANK == 0 && TD_Velocity::out_current_k) + if (GlobalV::MY_RANK == 0 && TD_info::out_current_k) { std::string filename = PARAM.globalv.global_out_dir + "current_spin" + std::to_string(is) + "_ik" + std::to_string(ik) + ".dat"; @@ -308,7 +566,7 @@ void ModuleIO::write_current(const UnitCell& ucell, fout.open(filename, std::ios::app); fout << std::setprecision(16); fout << std::scientific; - fout << istep << " " << current_ik[0] << " " << current_ik[1] << " " << current_ik[2] << std::endl; + fout << istep << " " << current_ik[0]/omega << " " << current_ik[1]/omega << " " << current_ik[2]/omega << std::endl; fout.close(); } // write end @@ -321,15 +579,57 @@ void ModuleIO::write_current(const UnitCell& ucell, fout.open(filename, std::ios::app); fout << std::setprecision(16); fout << std::scientific; - fout << istep << " " << current_total[0] << " " << current_total[1] << " " << current_total[2] << std::endl; + fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; fout.close(); } - if (!TD_Velocity::tddft_velocity) - { - delete cal_current; - } ModuleBase::timer::tick("ModuleIO", "write_current"); return; } +template +void ModuleIO::write_current_eachk( + const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current_eachk>(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op>* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current>(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op>* cal_current, + Record_adj& ra); #endif //__LCAO + From 466dfe9fb855486c4ad2d046857f1529c0848643 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:45:59 +0800 Subject: [PATCH 49/81] Update td_current_io.h --- source/module_io/td_current_io.h | 45 +++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/source/module_io/td_current_io.h b/source/module_io/td_current_io.h index 5f1424c3b8..c5642fcefa 100644 --- a/source/module_io/td_current_io.h +++ b/source/module_io/td_current_io.h @@ -5,30 +5,49 @@ #include "source_estate/elecstate_lcao.h" #include "source_estate/module_dm/density_matrix.h" #include "source_psi/psi.h" +#include "module_hamilt_lcao/module_tddft/velocity_op.h" namespace ModuleIO { #ifdef __LCAO /// @brief func to output current, only used in tddft +template +void write_current_eachk(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template void write_current(const UnitCell& ucell, - const Grid_Driver& gd, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - Record_adj& ra); + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); /// @brief calculate sum_n[šœŒ_(š‘›š‘˜,šœ‡šœˆ)] for current calculation -void cal_tmp_DM(elecstate::DensityMatrix, double>& DM_real, +void cal_tmp_DM_k(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, elecstate::DensityMatrix, double>& DM_imag, const int ik, const int nspin, - const int is); + const int is, + const bool reset = true); + +void cal_tmp_DM(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, + elecstate::DensityMatrix, double>& DM_imag, + const int nspin); #endif // __LCAO } // namespace ModuleIO - -#endif +#endif // W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_TD_CURRENT_IO_H From cd4cb691b429b5a8ac26f4fe9c8eb87fc783dbe3 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:47:11 +0800 Subject: [PATCH 50/81] Update write_HS_sparse.cpp --- source/module_io/write_HS_sparse.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/module_io/write_HS_sparse.cpp b/source/module_io/write_HS_sparse.cpp index 39141b7214..dab228a4cf 100644 --- a/source/module_io/write_HS_sparse.cpp +++ b/source/module_io/write_HS_sparse.cpp @@ -3,7 +3,7 @@ #include "module_parameter/parameter.h" #include "source_base/parallel_reduce.h" #include "source_base/timer.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include "source_pw/hamilt_pwdft/global.h" #include "single_R_io.h" @@ -48,7 +48,7 @@ void ModuleIO::save_HSR_sparse(const int& istep, for (auto& R_coor: all_R_coor_ptr) { if (PARAM.inp.nspin != 4) { for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (TD_Velocity::tddft_velocity) { + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { auto iter = TD_Velocity::td_vel_op->HR_sparse_td_vel[ispin].find( R_coor); @@ -254,7 +254,7 @@ void ModuleIO::save_HSR_sparse(const int& istep, // } } else { if (PARAM.inp.nspin != 4) { - if (TD_Velocity::tddft_velocity) { + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { output_single_R(g1[ispin], TD_Velocity::td_vel_op ->HR_sparse_td_vel[ispin][R_coor], From af9f5e78666f83ed99d400f7097be61fb1f81564 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:51:10 +0800 Subject: [PATCH 51/81] Update write_wfc_nao.cpp --- source/module_io/write_wfc_nao.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_io/write_wfc_nao.cpp b/source/module_io/write_wfc_nao.cpp index 162a280b13..8297b7e35c 100644 --- a/source/module_io/write_wfc_nao.cpp +++ b/source/module_io/write_wfc_nao.cpp @@ -269,7 +269,7 @@ void write_wfc_nao(const int out_type, if (myid == 0) { - std::string fn = filename_output(PARAM.globalv.global_out_dir,"wf","nao",ik,ik2iktot,nspin,nkstot, + std::string fn = filename_output(PARAM.globalv.global_wfc_dir,"wf","nao",ik,ik2iktot,nspin,nkstot, out_type,out_app_flag,gamma_only,istep); bool append_flag = (istep > 0 && out_app_flag); From defb3a4f7bbe0388ccf086c0e14d8278b4e39edc Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:52:18 +0800 Subject: [PATCH 52/81] Update lr_spectrum.h --- source/module_lr/lr_spectrum.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/module_lr/lr_spectrum.h b/source/module_lr/lr_spectrum.h index d5a5b0e563..052a85882a 100644 --- a/source/module_lr/lr_spectrum.h +++ b/source/module_lr/lr_spectrum.h @@ -5,7 +5,7 @@ #include "source_estate/module_dm/density_matrix.h" #include "module_lr/utils/lr_util.h" #include "source_basis/module_nao/two_center_bundle.h" -#include "module_hamilt_lcao/module_tddft/td_current.h" +#include "module_hamilt_lcao/module_tddft/velocity_op.h" namespace LR { template @@ -52,8 +52,8 @@ namespace LR /// calculate the transition dipole of all states in length gauge void cal_transition_dipoles_length(); /// calculate the transition dipole of state S in velocity gauge: $i(\sum_{iak}X^S_{iak})/\Omega_S$ - ModuleBase::Vector3 cal_transition_dipole_istate_velocity_R(const int istate, const TD_current& vR); - ModuleBase::Vector3 cal_transition_dipole_istate_velocity_k(const int istate, const TD_current& vR); + ModuleBase::Vector3 cal_transition_dipole_istate_velocity_R(const int istate, const Velocity_op>& vR); + ModuleBase::Vector3 cal_transition_dipole_istate_velocity_k(const int istate, const Velocity_op>& vR); /// calculate the transition dipole of all states in velocity gauge void cal_transition_dipoles_velocity(); double cal_mean_squared_dipole(ModuleBase::Vector3 dipole); From 16132ef0b0b6e4e4cc2874a71c296ab2966bcb25 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:52:47 +0800 Subject: [PATCH 53/81] Update lr_spectrum_velocity.cpp --- source/module_lr/lr_spectrum_velocity.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/module_lr/lr_spectrum_velocity.cpp b/source/module_lr/lr_spectrum_velocity.cpp index 1c3778f973..6322a407a2 100644 --- a/source/module_lr/lr_spectrum_velocity.cpp +++ b/source/module_lr/lr_spectrum_velocity.cpp @@ -7,17 +7,17 @@ namespace LR { /// get the velocity matrix v(R) - inline TD_current get_velocity_matrix_R(const UnitCell& ucell, + inline Velocity_op> get_velocity_matrix_R(const UnitCell& ucell, const Grid_Driver& gd, const Parallel_Orbitals& pmat, const TwoCenterBundle& two_center_bundle) { - // convert the orbital object to the old class for TD_current + // convert the orbital object to the old class for Velocity_op LCAO_Orbitals orb; const auto& inp = PARAM.inp; two_center_bundle.to_LCAO_Orbitals(orb, inp.lcao_ecut, inp.lcao_dk, inp.lcao_dr, inp.lcao_rmax); // actually this class calculates the velocity matrix v(R) at A=0 - TD_current vR(&ucell, &gd, &pmat, orb, two_center_bundle.overlap_orb.get()); + Velocity_op> vR(&ucell, &gd, &pmat, orb, two_center_bundle.overlap_orb.get()); vR.calculate_vcomm_r(); // $<\mu, 0|[Vnl, r]|\nu, R>$ vR.calculate_grad_term(); // $<\mu, 0|\nabla|\nu, R>$ return vR; @@ -47,7 +47,7 @@ namespace LR /// this algorithm has bug in multi-k cases, just for test template - ModuleBase::Vector3 LR::LR_Spectrum::cal_transition_dipole_istate_velocity_R(const int istate, const TD_current& vR) + ModuleBase::Vector3 LR::LR_Spectrum::cal_transition_dipole_istate_velocity_R(const int istate, const Velocity_op>& vR) { // transition density matrix D(R) const elecstate::DensityMatrix& DM_trans = this->cal_transition_density_matrix(istate); @@ -69,7 +69,7 @@ namespace LR // this algorithm is actually in use template - ModuleBase::Vector3 LR::LR_Spectrum::cal_transition_dipole_istate_velocity_k(const int istate, const TD_current& vR) + ModuleBase::Vector3 LR::LR_Spectrum::cal_transition_dipole_istate_velocity_k(const int istate, const Velocity_op>& vR) { // transition density matrix D(R) const elecstate::DensityMatrix& DM_trans = this->cal_transition_density_matrix(istate, this->X, false); @@ -97,7 +97,7 @@ namespace LR template void LR::LR_Spectrum::cal_transition_dipoles_velocity() { - const TD_current& vR = get_velocity_matrix_R(ucell, gd_, pmat, two_center_bundle_); // velocity matrix v(R) + const Velocity_op>& vR = get_velocity_matrix_R(ucell, gd_, pmat, two_center_bundle_); // velocity matrix v(R) transition_dipole_.resize(nstate); this->mean_squared_transition_dipole_.resize(nstate); for (int istate = 0;istate < nstate;++istate) @@ -148,7 +148,7 @@ namespace LR void LR::LR_Spectrum::test_transition_dipoles_velocity_ks(const double* const ks_eig) { // velocity matrix v(R) - const TD_current& vR = get_velocity_matrix_R(ucell, gd_, pmat, two_center_bundle_); + const Velocity_op>& vR = get_velocity_matrix_R(ucell, gd_, pmat, two_center_bundle_); // (e_c-e_v) of KS eigenvalues std::vector eig_ks_diff(this->ldim); for (int is = 0;is < this->nspin_x;++is) @@ -183,4 +183,4 @@ namespace LR } } template class LR::LR_Spectrum; -template class LR::LR_Spectrum>; \ No newline at end of file +template class LR::LR_Spectrum>; From 14fa60935c7aef6bb8b07377564d2498ef05a1cf Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:54:12 +0800 Subject: [PATCH 54/81] Update input_parameter.h --- source/module_parameter/input_parameter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 16db768542..a781ebe035 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -283,7 +283,8 @@ struct Input_para double bessel_descriptor_sigma = 0.1; ///< spherical bessel smearing_sigma // ============== #Parameters (9.rt-tddft) =========================== - double td_force_dt = 0.02; ///<"fs" + double td_dt = -1.0; ///< time step for propagation + int estep_per_md = 1; ///< number of electronic steps per MD step bool td_vext = false; ///< add extern potential or not // std::string td_vext_dire = "1"; ///< vext direction std::vector td_vext_dire = {1}; ///< vector of vext direction From 637b11d6ee1bd8318baf56ebae36817377360ac7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:54:37 +0800 Subject: [PATCH 55/81] Update system_parameter.h --- source/module_parameter/system_parameter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/module_parameter/system_parameter.h b/source/module_parameter/system_parameter.h index 8df781ad0b..f607e42a63 100644 --- a/source/module_parameter/system_parameter.h +++ b/source/module_parameter/system_parameter.h @@ -43,6 +43,7 @@ struct System_para std::string global_readin_dir = ""; ///< global readin directory std::string global_stru_dir = ""; ///< global structure directory std::string global_matrix_dir = ""; ///< global matrix directory + std::string global_wfc_dir = ""; ///< global wavefunction directory std::string global_mlkedf_descriptor_dir = ""; ///< global ML KEDF descriptor directory std::string global_deepks_label_elec_dir = ""; ///< global directory for DeePKS labels during electronic steps std::string log_file = "log"; ///< log file name @@ -65,4 +66,4 @@ struct System_para bool search_pbc = true; ///< whether to search for periodic boundary conditions, force set to true }; -#endif \ No newline at end of file +#endif From d0fdc610ce84c27481b82915b68673421ea7d42c Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:55:37 +0800 Subject: [PATCH 56/81] Update Makefile.Objects --- source/Makefile.Objects | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Makefile.Objects b/source/Makefile.Objects index c94a7f4f9e..afcbe51a74 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -329,6 +329,7 @@ OBJS_HAMILT_LCAO=hamilt_lcao.o\ overlap_new.o\ td_ekinetic_lcao.o\ td_nonlocal_lcao.o\ + td_pot_hybrid.o\ veff_lcao.o\ meta_lcao.o\ op_dftu_lcao.o\ @@ -598,8 +599,8 @@ OBJS_LCAO=evolve_elec.o\ propagator_cn2.o\ propagator_taylor.o\ propagator_etrs.o\ - td_velocity.o\ - td_current.o\ + td_info.o\ + velocity_op.o\ snap_psibeta_half_tddft.o\ solve_propagation.o\ upsi.o\ From a793f903a9be410caa25575d09279d539771206b Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:10:14 +0800 Subject: [PATCH 57/81] Delete source/source_estate/density_matrix.cpp --- source/source_estate/density_matrix.cpp | 643 ------------------------ 1 file changed, 643 deletions(-) delete mode 100644 source/source_estate/density_matrix.cpp diff --git a/source/source_estate/density_matrix.cpp b/source/source_estate/density_matrix.cpp deleted file mode 100644 index 19d83a76d8..0000000000 --- a/source/source_estate/density_matrix.cpp +++ /dev/null @@ -1,643 +0,0 @@ -#include "density_matrix.h" - -#include "module_parameter/parameter.h" -#include "source_base/libm/libm.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/klist.h" - -namespace elecstate -{ - -//---------------------------------------------------- -// density matrix class -//---------------------------------------------------- - -// destructor -template -DensityMatrix::~DensityMatrix() -{ - for (auto& it: this->_DMR) - { - delete it; - } - delete[] this->dmr_tmp_; -} - -template -DensityMatrix::DensityMatrix(const Parallel_Orbitals* paraV_in, const int nspin, const std::vector>& kvec_d, const int nk) - : _paraV(paraV_in), _nspin(nspin), _kvec_d(kvec_d), _nk((nk > 0 && nk <= _kvec_d.size()) ? nk : _kvec_d.size()) -{ - ModuleBase::TITLE("DensityMatrix", "DensityMatrix-MK"); - const int nks = _nk * _nspin; - this->_DMK.resize(nks); - for (int ik = 0; ik < nks; ik++) - { - this->_DMK[ik].resize(this->_paraV->get_row_size() * this->_paraV->get_col_size()); - } - ModuleBase::Memory::record("DensityMatrix::DMK", this->_DMK.size() * this->_DMK[0].size() * sizeof(TK)); -} - -template -DensityMatrix::DensityMatrix(const Parallel_Orbitals* paraV_in, const int nspin) :_paraV(paraV_in), _nspin(nspin), _kvec_d({ ModuleBase::Vector3(0,0,0) }), _nk(1) -{ - ModuleBase::TITLE("DensityMatrix", "DensityMatrix-GO"); - this->_DMK.resize(_nspin); - for (int ik = 0; ik < this->_nspin; ik++) - { - this->_DMK[ik].resize(this->_paraV->get_row_size() * this->_paraV->get_col_size()); - } - ModuleBase::Memory::record("DensityMatrix::DMK", this->_DMK.size() * this->_DMK[0].size() * sizeof(TK)); -} - -// calculate DMR from DMK using blas for multi-k calculation -template <> -void DensityMatrix, double>::cal_DMR(const int ik_in) -{ - ModuleBase::TITLE("DensityMatrix", "cal_DMR"); - - // To check whether DMR has been initialized -#ifdef __DEBUG - assert(!this->_DMR.empty() && "DMR has not been initialized!"); -#endif - - ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); - int ld_hk = this->_paraV->nrow; - for (int is = 1; is <= this->_nspin; ++is) - { - int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 - hamilt::HContainer* target_DMR = this->_DMR[is - 1]; - // set zero since this function is called in every scf step - target_DMR->set_zero(); -#ifdef _OPENMP -#pragma omp parallel for schedule(dynamic) -#endif - for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); - int iat1 = target_ap.get_atom_i(); - int iat2 = target_ap.get_atom_j(); - // get global indexes of whole matrix for each atom in this process - int row_ap = this->_paraV->atom_begin_row[iat1]; - int col_ap = this->_paraV->atom_begin_col[iat2]; - const int row_size = this->_paraV->get_row_size(iat1); - const int col_size = this->_paraV->get_col_size(iat2); - const int mat_size = row_size * col_size; - const int r_size = target_ap.get_R_size(); - if (row_ap == -1 || col_ap == -1) - { - throw std::string("Atom-pair not belong this process"); - } - std::vector> tmp_DMR; - if (PARAM.inp.nspin == 4) - { - tmp_DMR.resize(mat_size * r_size, 0); - } - - // calculate kphase and target_mat_ptr - std::vector> kphase_vec(r_size * this->_nk); - std::vector target_DMR_mat_vec(r_size); - for(int ir = 0; ir < r_size; ++ir) - { - const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); - hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); -#ifdef __DEBUG - if (target_mat == nullptr) - { - std::cout << "target_mat is nullptr" << std::endl; - continue; - } -#endif - target_DMR_mat_vec[ir] = target_mat->get_pointer(); - for(int ik = 0; ik < this->_nk; ++ik) - { - if(ik_in >= 0 && ik_in != ik) - { - continue; - } - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); - const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); - } - } - - std::vector> tmp_DMK_mat(mat_size); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - // step_trace is used when nspin = 4; - int step_trace[4]{}; - if(PARAM.inp.nspin == 4) - { - const int npol = 2; - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = target_ap.get_col_size() * is + is2; - } - } - } - for(int ik = 0; ik < this->_nk; ++ik) - { - if(ik_in >= 0 && ik_in != ik) - { - continue; - } - - // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) - const std::complex* DMK_mat_ptr = this->_DMK[ik + ik_begin].data() + col_ap * this->_paraV->nrow + row_ap; - for(int icol = 0; icol < col_size; ++icol) - { - for(int irow = 0; irow < row_size; ++irow) - { - tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; - } - } - - // if nspin != 4, fill DMR - // if nspin == 4, fill tmp_DMR - for(int ir = 0; ir < r_size; ++ir) - { - std::complex kphase = kphase_vec[ik * r_size + ir]; - if(PARAM.inp.nspin != 4) - { - double* target_DMR_mat = target_DMR_mat_vec[ir]; - for(int i = 0; i < mat_size; i++) - { - target_DMR_mat[i] += kphase.real() * tmp_DMK_mat[i].real() - - kphase.imag() * tmp_DMK_mat[i].imag(); - } - } else if(PARAM.inp.nspin == 4) - { - std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; - BlasConnector::axpy(mat_size, - kphase, - tmp_DMK_mat.data(), - 1, - tmp_DMR_mat, - 1); - } - } - } - - // if nspin == 4 - // copy tmp_DMR to fill target_DMR - if(PARAM.inp.nspin == 4) - { - std::complex tmp[4]{}; - for(int ir = 0; ir < r_size; ++ir) - { - std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; - double* target_DMR_mat = target_DMR_mat_vec[ir]; - for (int irow = 0; irow < row_size; irow += 2) - { - for (int icol = 0; icol < col_size; icol += 2) - { - // catch the 4 spin component value of one orbital pair - tmp[0] = tmp_DMR_mat[icol + step_trace[0]]; - tmp[1] = tmp_DMR_mat[icol + step_trace[1]]; - tmp[2] = tmp_DMR_mat[icol + step_trace[2]]; - tmp[3] = tmp_DMR_mat[icol + step_trace[3]]; - // transfer to Pauli matrix and save the real part - // save them back to the target_mat - target_DMR_mat[icol + step_trace[0]] = tmp[0].real() + tmp[3].real(); - target_DMR_mat[icol + step_trace[1]] = tmp[1].real() + tmp[2].real(); - target_DMR_mat[icol + step_trace[2]] - = -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() - target_DMR_mat[icol + step_trace[3]] = tmp[0].real() - tmp[3].real(); - } - tmp_DMR_mat += col_size * 2; - target_DMR_mat += col_size * 2; - } - } - } - } - } - ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); -} - -// calculate DMR from DMK using blas for multi-k calculation -template <> -void DensityMatrix, double>::cal_DMR_td(const UnitCell& ucell, const ModuleBase::Vector3 At, const int ik_in) -{ - ModuleBase::TITLE("DensityMatrix", "cal_DMR_td"); - // To check whether DMR has been initialized -#ifdef __DEBUG - assert(!this->_DMR.empty() && "DMR has not been initialized!"); -#endif - - ModuleBase::timer::tick("DensityMatrix", "cal_DMR_td"); - int ld_hk = this->_paraV->nrow; - for (int is = 1; is <= this->_nspin; ++is) - { - int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 - hamilt::HContainer* target_DMR = this->_DMR[is - 1]; - // set zero since this function is called in every scf step - target_DMR->set_zero(); -#ifdef _OPENMP -#pragma omp parallel for schedule(dynamic) -#endif - for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); - int iat1 = target_ap.get_atom_i(); - int iat2 = target_ap.get_atom_j(); - // get global indexes of whole matrix for each atom in this process - int row_ap = this->_paraV->atom_begin_row[iat1]; - int col_ap = this->_paraV->atom_begin_col[iat2]; - const int row_size = this->_paraV->get_row_size(iat1); - const int col_size = this->_paraV->get_col_size(iat2); - const int mat_size = row_size * col_size; - const int r_size = target_ap.get_R_size(); - if (row_ap == -1 || col_ap == -1) - { - throw std::string("Atom-pair not belong this process"); - } - std::vector> tmp_DMR; - if (PARAM.inp.nspin == 4) - { - tmp_DMR.resize(mat_size * r_size, 0); - } - - // calculate kphase and target_mat_ptr - std::vector> kphase_vec(r_size * this->_nk); - std::vector target_DMR_mat_vec(r_size); - for(int ir = 0; ir < r_size; ++ir) - { - const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); - hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); -#ifdef __DEBUG - if (target_mat == nullptr) - { - std::cout << "target_mat is nullptr" << std::endl; - continue; - } -#endif - target_DMR_mat_vec[ir] = target_mat->get_pointer(); - double arg_td = 0.0; - //cal tddft phase for hybrid gague - ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); - arg_td = At * dtau * ucell.lat0; - for(int ik = 0; ik < this->_nk; ++ik) - { - if(ik_in >= 0 && ik_in != ik) - { - continue; - } - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); - const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); - } - } - - std::vector> tmp_DMK_mat(mat_size); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - // step_trace is used when nspin = 4; - int step_trace[4]{}; - if(PARAM.inp.nspin == 4) - { - const int npol = 2; - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = target_ap.get_col_size() * is + is2; - } - } - } - for(int ik = 0; ik < this->_nk; ++ik) - { - if(ik_in >= 0 && ik_in != ik) - { - continue; - } - - // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) - const std::complex* DMK_mat_ptr = this->_DMK[ik + ik_begin].data() + col_ap * this->_paraV->nrow + row_ap; - for(int icol = 0; icol < col_size; ++icol) - { - for(int irow = 0; irow < row_size; ++irow) - { - tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; - } - } - - // if nspin != 4, fill DMR - // if nspin == 4, fill tmp_DMR - for(int ir = 0; ir < r_size; ++ir) - { - std::complex kphase = kphase_vec[ik * r_size + ir]; - if(PARAM.inp.nspin != 4) - { - double* target_DMR_mat = target_DMR_mat_vec[ir]; - for(int i = 0; i < mat_size; i++) - { - target_DMR_mat[i] += kphase.real() * tmp_DMK_mat[i].real() - - kphase.imag() * tmp_DMK_mat[i].imag(); - } - } else if(PARAM.inp.nspin == 4) - { - std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; - BlasConnector::axpy(mat_size, - kphase, - tmp_DMK_mat.data(), - 1, - tmp_DMR_mat, - 1); - } - } - } - - // if nspin == 4 - // copy tmp_DMR to fill target_DMR - if(PARAM.inp.nspin == 4) - { - std::complex tmp[4]{}; - for(int ir = 0; ir < r_size; ++ir) - { - std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; - double* target_DMR_mat = target_DMR_mat_vec[ir]; - for (int irow = 0; irow < row_size; irow += 2) - { - for (int icol = 0; icol < col_size; icol += 2) - { - // catch the 4 spin component value of one orbital pair - tmp[0] = tmp_DMR_mat[icol + step_trace[0]]; - tmp[1] = tmp_DMR_mat[icol + step_trace[1]]; - tmp[2] = tmp_DMR_mat[icol + step_trace[2]]; - tmp[3] = tmp_DMR_mat[icol + step_trace[3]]; - // transfer to Pauli matrix and save the real part - // save them back to the target_mat - target_DMR_mat[icol + step_trace[0]] = tmp[0].real() + tmp[3].real(); - target_DMR_mat[icol + step_trace[1]] = tmp[1].real() + tmp[2].real(); - target_DMR_mat[icol + step_trace[2]] - = -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() - target_DMR_mat[icol + step_trace[3]] = tmp[0].real() - tmp[3].real(); - } - tmp_DMR_mat += col_size * 2; - target_DMR_mat += col_size * 2; - } - } - } - } - } - ModuleBase::timer::tick("DensityMatrix", "cal_DMR_td"); -} - -// calculate DMR from DMK using blas for multi-k calculation -template <> -void DensityMatrix::cal_DMR_full(hamilt::HContainer>* dmR_out)const{} -template <> -void DensityMatrix, double>::cal_DMR_full(hamilt::HContainer>* dmR_out)const -{ - ModuleBase::TITLE("DensityMatrix", "cal_DMR_full"); - - ModuleBase::timer::tick("DensityMatrix", "cal_DMR_full"); - int ld_hk = this->_paraV->nrow; - hamilt::HContainer>* target_DMR = dmR_out; - // set zero since this function is called in every scf step - target_DMR->set_zero(); -#ifdef _OPENMP -#pragma omp parallel for schedule(dynamic) -#endif - for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) - { - auto& target_ap = target_DMR->get_atom_pair(i); - int iat1 = target_ap.get_atom_i(); - int iat2 = target_ap.get_atom_j(); - // get global indexes of whole matrix for each atom in this process - int row_ap = this->_paraV->atom_begin_row[iat1]; - int col_ap = this->_paraV->atom_begin_col[iat2]; - const int row_size = this->_paraV->get_row_size(iat1); - const int col_size = this->_paraV->get_col_size(iat2); - const int mat_size = row_size * col_size; - const int r_size = target_ap.get_R_size(); - - // calculate kphase and target_mat_ptr - std::vector> kphase_vec(r_size * this->_nk); - std::vector*> target_DMR_mat_vec(r_size); - for(int ir = 0; ir < r_size; ++ir) - { - const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); - hamilt::BaseMatrix>* target_mat = target_ap.find_matrix(r_index); -#ifdef __DEBUG - if (target_mat == nullptr) - { - std::cout << "target_mat is nullptr" << std::endl; - continue; - } -#endif - target_DMR_mat_vec[ir] = target_mat->get_pointer(); - for(int ik = 0; ik < this->_nk; ++ik) - { - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); - const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); - } - } - - std::vector> tmp_DMK_mat(mat_size); - for(int ik = 0; ik < this->_nk; ++ik) - { - // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) - const std::complex* DMK_mat_ptr = this->_DMK[ik].data() + col_ap * this->_paraV->nrow + row_ap; - for(int icol = 0; icol < col_size; ++icol) - { - for(int irow = 0; irow < row_size; ++irow) - { - tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; - } - } - - for(int ir = 0; ir < r_size; ++ir) - { - std::complex kphase = kphase_vec[ik * r_size + ir]; - std::complex* target_DMR_mat = target_DMR_mat_vec[ir]; - BlasConnector::axpy(mat_size, - kphase, - tmp_DMK_mat.data(), - 1, - target_DMR_mat, - 1); - } - } - } - ModuleBase::timer::tick("DensityMatrix", "cal_DMR_full"); -} - -// calculate DMR from DMK using blas for gamma-only calculation -template <> -void DensityMatrix::cal_DMR(const int ik_in) -{ - ModuleBase::TITLE("DensityMatrix", "cal_DMR"); - - assert(ik_in == -1 || ik_in == 0); - - // To check whether DMR has been initialized -#ifdef __DEBUG - assert(!this->_DMR.empty() && "DMR has not been initialized!"); -#endif - - ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); - int ld_hk = this->_paraV->nrow; - for (int is = 1; is <= this->_nspin; ++is) - { - int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 - hamilt::HContainer* target_DMR = this->_DMR[is - 1]; - // set zero since this function is called in every scf step - target_DMR->set_zero(); - -#ifdef __DEBUG - // assert(target_DMR->is_gamma_only() == true); - assert(this->_nk == 1); -#endif -#ifdef _OPENMP -#pragma omp parallel for schedule(dynamic) -#endif - for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); - int iat1 = target_ap.get_atom_i(); - int iat2 = target_ap.get_atom_j(); - // get global indexes of whole matrix for each atom in this process - int row_ap = this->_paraV->atom_begin_row[iat1]; - int col_ap = this->_paraV->atom_begin_col[iat2]; - const int row_size = this->_paraV->get_row_size(iat1); - const int col_size = this->_paraV->get_col_size(iat2); - const int r_size = target_ap.get_R_size(); - if (row_ap == -1 || col_ap == -1) - { - throw std::string("Atom-pair not belong this process"); - } - // R index - const ModuleBase::Vector3 r_index = target_ap.get_R_index(0); -#ifdef __DEBUG - assert(r_size == 1); - assert(r_index.x == 0 && r_index.y == 0 && r_index.z == 0); -#endif - hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); -#ifdef __DEBUG - if (target_mat == nullptr) - { - std::cout << "target_mat is nullptr" << std::endl; - continue; - } -#endif - // k index - double kphase = 1; - // set DMR element - double* target_DMR_ptr = target_mat->get_pointer(); - double* DMK_ptr = this->_DMK[0 + ik_begin].data(); - // transpose DMK col=>row - DMK_ptr += col_ap * this->_paraV->nrow + row_ap; - for (int mu = 0; mu < row_size; ++mu) - { - BlasConnector::axpy(col_size, - kphase, - DMK_ptr, - ld_hk, - target_DMR_ptr, - 1); - DMK_ptr += 1; - target_DMR_ptr += col_size; - } - } - } - ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); -} - -// switch_dmr -template -void DensityMatrix::switch_dmr(const int mode) -{ - ModuleBase::TITLE("DensityMatrix", "switch_dmr"); - if (this->_nspin != 2) - { - return; - } - else - { - ModuleBase::timer::tick("DensityMatrix", "switch_dmr"); - switch(mode) - { - case 0: - // switch to original density matrix - if (this->dmr_tmp_ != nullptr && this->dmr_origin_.size() != 0) - { - this->_DMR[0]->allocate(this->dmr_origin_.data(), false); - delete[] this->dmr_tmp_; - this->dmr_tmp_ = nullptr; - } - // else: do nothing - break; - case 1: - // switch to total magnetization density matrix, dmr_up + dmr_down - if(this->dmr_tmp_ == nullptr) - { - const size_t size = this->_DMR[0]->get_nnr(); - this->dmr_tmp_ = new TR[size]; - this->dmr_origin_.resize(size); - for (int i = 0; i < size; ++i) - { - this->dmr_origin_[i] = this->_DMR[0]->get_wrapper()[i]; - this->dmr_tmp_[i] = this->dmr_origin_[i] + this->_DMR[1]->get_wrapper()[i]; - } - this->_DMR[0]->allocate(this->dmr_tmp_, false); - } - else - { - const size_t size = this->_DMR[0]->get_nnr(); - for (int i = 0; i < size; ++i) - { - this->dmr_tmp_[i] = this->dmr_origin_[i] + this->_DMR[1]->get_wrapper()[i]; - } - } - break; - case 2: - // switch to magnetization density matrix, dmr_up - dmr_down - if(this->dmr_tmp_ == nullptr) - { - const size_t size = this->_DMR[0]->get_nnr(); - this->dmr_tmp_ = new TR[size]; - this->dmr_origin_.resize(size); - for (int i = 0; i < size; ++i) - { - this->dmr_origin_[i] = this->_DMR[0]->get_wrapper()[i]; - this->dmr_tmp_[i] = this->dmr_origin_[i] - this->_DMR[1]->get_wrapper()[i]; - } - this->_DMR[0]->allocate(this->dmr_tmp_, false); - } - else - { - const size_t size = this->_DMR[0]->get_nnr(); - for (int i = 0; i < size; ++i) - { - this->dmr_tmp_[i] = this->dmr_origin_[i] - this->_DMR[1]->get_wrapper()[i]; - } - } - break; - default: - throw std::string("Unknown mode in switch_dmr"); - } - ModuleBase::timer::tick("DensityMatrix", "switch_dmr"); - } -} - -// T of HContainer can be double or complex -template class DensityMatrix; // Gamma-Only case -template class DensityMatrix, double>; // Multi-k case -template class DensityMatrix, std::complex>; // For EXX in future - -} // namespace elecstate From ae023870e744db824d7fe7ea40177a281fdf21da Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:10:21 +0800 Subject: [PATCH 58/81] Delete source/source_estate/density_matrix.h --- source/source_estate/density_matrix.h | 291 -------------------------- 1 file changed, 291 deletions(-) delete mode 100644 source/source_estate/density_matrix.h diff --git a/source/source_estate/density_matrix.h b/source/source_estate/density_matrix.h deleted file mode 100644 index 267138564a..0000000000 --- a/source/source_estate/density_matrix.h +++ /dev/null @@ -1,291 +0,0 @@ -#ifndef DENSITY_MATRIX_H -#define DENSITY_MATRIX_H - -#include - -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/record_adj.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -namespace elecstate -{ -/** - * @brief DensityMatrix Class - * = for Gamma-only calculation - * = ,double> for multi-k calculation - */ -template struct ShiftRealComplex -{ - using type = void; -}; - -template<> -struct ShiftRealComplex -{ - using type = std::complex; -}; - -template<> -struct ShiftRealComplex> -{ - using type = double; -}; - -template -class DensityMatrix -{ - using TRShift = typename ShiftRealComplex::type; - - public: - /** - * @brief Destructor of class DensityMatrix - */ - ~DensityMatrix(); - - /** - * @brief Constructor of class DensityMatrix for multi-k calculation - * @param _paraV pointer of Parallel_Orbitals object - * @param nspin number of spin of the density matrix, set by user according to global nspin - * (usually {nspin_global -> nspin_dm} = {1->1, 2->2, 4->1}, but sometimes 2->1 like in LR-TDDFT) - * @param kvec_d direct coordinates of kpoints - * @param nk number of k-points, not always equal to K_Vectors::get_nks()/nspin_dm. - * it will be set to kvec_d.size() if the value is invalid - */ - DensityMatrix(const Parallel_Orbitals* _paraV, const int nspin, const std::vector>& kvec_d, const int nk); - - /** - * @brief Constructor of class DensityMatrix for gamma-only calculation, where kvector is not required - * @param _paraV pointer of Parallel_Orbitals object - * @param nspin number of spin of the density matrix, set by user according to global nspin - * (usually {nspin_global -> nspin_dm} = {1->1, 2->2, 4->1}, but sometimes 2->1 like in LR-TDDFT) - */ - DensityMatrix(const Parallel_Orbitals* _paraV, const int nspin); - - /** - * @brief initialize density matrix DMR from UnitCell - * @param GridD_in pointer of Grid_Driver object (used to find ajacent atoms) - * @param ucell pointer of UnitCell object - */ - void init_DMR(const Grid_Driver* GridD_in, const UnitCell* ucell); - - /** - * @brief initialize density matrix DMR from UnitCell and RA - * @param ra pointer of Record_adj object (used to find ajacent atoms) - * @param ucell pointer of UnitCell object - */ - void init_DMR(Record_adj& ra, const UnitCell* ucell); - - /** - * @brief initialize density matrix DMR from another HContainer - * now only support HContainer - * @param _DMR_in pointer of another HContainer object - */ - void init_DMR(const hamilt::HContainer& _DMR_in); - - /// @brief initialize density matrix DMR from another HContainer - /// this is a temprory function for NSPIN=4 case - /// since copy HContainer from another HContainer with different TR is not supported yet - /// would be refactor in the future - /// @param _DMR_in - // the old input type ``:HContainer` causes redefination error if TR = complex - void init_DMR(const hamilt::HContainer& _DMR_in); - - /** - * @brief set _DMK element directly - * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) - * @param ik k-point index - * @param i row index - * @param j column index - * @param value value to be set - */ - void set_DMK(const int ispin, const int ik, const int i, const int j, const TK value); - - /** - * @brief set _DMK element to zero - */ - void set_DMK_zero(); - - /** - * @brief get a matrix element of density matrix dm(k) - * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) - * @param ik k-point index - * @param i row index - * @param j column index - * @return T a matrix element of density matrix dm(k) - */ - TK get_DMK(const int ispin, const int ik, const int i, const int j) const; - - /** - * @brief get total number of k-points of density matrix dm(k) - */ - int get_DMK_nks() const; - int get_DMK_size() const; - - /** - * @brief get number of rows of density matrix dm(k) - */ - int get_DMK_nrow() const; - - /** - * @brief get number of columns of density matrix dm(k) - */ - int get_DMK_ncol() const; - - /** - * @brief get pointer of DMR - * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) - * @return HContainer* pointer of DMR - */ - hamilt::HContainer* get_DMR_pointer(const int ispin) const; - - /** - * @brief get pointer vector of DMR - * @return HContainer* vector of DMR - */ - const std::vector*>& get_DMR_vector() const {return this->_DMR;} - std::vector*>& get_DMR_vector() {return this->_DMR;} - - const std::vector>& get_DMR_save() const {return this->_DMR_save;} - std::vector>& get_DMR_save() {return this->_DMR_save;} - - /** - * @brief get pointer of DMK - * @param ik k-point index, which is the index of _DMK - * @return TK* pointer of DMK - */ - TK* get_DMK_pointer(const int ik) const; - - /** - * @brief get pointer vector of DMK - */ - const std::vector>& get_DMK_vector() const {return this->_DMK;} - std::vector>& get_DMK_vector() {return this->_DMK;} - - /** - * @brief set _DMK using a input TK* pointer - * please make sure the size of TK* is correct - */ - void set_DMK_pointer(const int ik, TK* DMK_in); - - /** - * @brief get pointer of paraV - */ - const Parallel_Orbitals* get_paraV_pointer() const {return this->_paraV;} - - const std::vector>& get_kvec_d() const { return this->_kvec_d; } - - /** - * @brief calculate density matrix DMR from dm(k) using blas::axpy - * if ik_in < 0, calculate all k-points - * if ik_in >= 0, calculate only one k-point without summing over k-points - */ - void cal_DMR(const int ik_in = -1); - - /** - * @brief calculate density matrix DMR with additional vector potential phase, used for hybrid gague tddft - * if ik_in < 0, calculate all k-points - * if ik_in >= 0, calculate only one k-point without summing over k-points - */ - void cal_DMR_td(const UnitCell& ucell, const ModuleBase::Vector3 At, const int ik_in = -1); - - /** - * @brief calculate complex density matrix DMR with both real and imaginary part for noncollinear-spin calculation - * the stored dm(k) has been used to calculate the passin DMR - * @param dmR_out pointer of HContainer object to store the calculated complex DMR - */ - void cal_DMR_full(hamilt::HContainer>* dmR_out) const; - - /** - * @brief (Only nspin=2) switch DMR to total density matrix or magnetization density matrix - * @param mode 0 - original density matrix; 1 - total density matrix; 2 - magnetization density matrix - */ - void switch_dmr(const int mode); - - /** - * @brief write density matrix dm(ik) into *.dmk - * @param directory directory of *.dmk files - * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) - * @param ik k-point index - */ - void write_DMK(const std::string directory, const int ispin, const int ik); - - /** - * @brief read *.dmk into density matrix dm(ik) - * @param directory directory of *.dmk files - * @param ispin spin index (1 - spin up (support SOC) or 2 - spin down) - * @param ik k-point index - */ - void read_DMK(const std::string directory, const int ispin, const int ik); - - /** - * @brief save _DMR into _DMR_save - */ - void save_DMR(); - - std::vector EDMK; // for TD-DFT - -#ifdef __PEXSI - /** - * @brief EDM storage for PEXSI - * used in MD calculation - */ - std::vector pexsi_EDM; -#endif - - private: - /** - * @brief HContainer for density matrix in real space for 2D parallelization - * vector.size() = 1 for non-polarization and SOC - * vector.size() = 2 for spin-polarization - */ - std::vector*> _DMR; - std::vector> _DMR_save; - - /** - * @brief HContainer for density matrix in real space for gird parallelization - * vector.size() = 1 for non-polarization and SOC - * vector.size() = 2 for spin-polarization - */ - std::vector*> _DMR_grid; - - /** - * @brief density matrix in k space, which is a vector[ik] - * DMK should be a [_nspin][_nk][i][j] matrix, - * whose size is _nspin * _nk * _paraV->get_nrow() * _paraV->get_ncol() - */ - // std::vector _DMK; - std::vector> _DMK; - - /** - * @brief K_Vectors object, which is used to get k-point information - */ - const std::vector> _kvec_d; - - /** - * @brief Parallel_Orbitals object, which contain all information of 2D block cyclic distribution - */ - const Parallel_Orbitals* _paraV = nullptr; - - /** - * @brief spin-polarization index (1 - none spin and SOC ; 2 - spin polarization) - * Attention: this is not as same as GlovalV::NSPIN - * _nspin means the number of isolated spin-polarization states - */ - int _nspin = 1; - - /** - * @brief real number of k-points - * _nk is not equal to _kv->get_nks() when spin-polarization is considered - * _nk = kv->get_nks() / nspin when nspin=2 - */ - int _nk = 0; - - /// temporary pointers for switch DMR, only used with nspin=2 - std::vector dmr_origin_; - TR* dmr_tmp_ = nullptr; - -}; - -} // namespace elecstate - -#endif From 9301ecb13c94b695f36e021ddff28928a36708a1 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:10:32 +0800 Subject: [PATCH 59/81] Add files via upload --- .../module_dm/density_matrix.cpp | 172 ++++++++++++++++++ .../source_estate/module_dm/density_matrix.h | 7 + 2 files changed, 179 insertions(+) diff --git a/source/source_estate/module_dm/density_matrix.cpp b/source/source_estate/module_dm/density_matrix.cpp index 4a0d21b377..19d83a76d8 100644 --- a/source/source_estate/module_dm/density_matrix.cpp +++ b/source/source_estate/module_dm/density_matrix.cpp @@ -220,6 +220,178 @@ void DensityMatrix, double>::cal_DMR(const int ik_in) ModuleBase::timer::tick("DensityMatrix", "cal_DMR"); } +// calculate DMR from DMK using blas for multi-k calculation +template <> +void DensityMatrix, double>::cal_DMR_td(const UnitCell& ucell, const ModuleBase::Vector3 At, const int ik_in) +{ + ModuleBase::TITLE("DensityMatrix", "cal_DMR_td"); + // To check whether DMR has been initialized +#ifdef __DEBUG + assert(!this->_DMR.empty() && "DMR has not been initialized!"); +#endif + + ModuleBase::timer::tick("DensityMatrix", "cal_DMR_td"); + int ld_hk = this->_paraV->nrow; + for (int is = 1; is <= this->_nspin; ++is) + { + int ik_begin = this->_nk * (is - 1); // jump this->_nk for spin_down if nspin==2 + hamilt::HContainer* target_DMR = this->_DMR[is - 1]; + // set zero since this function is called in every scf step + target_DMR->set_zero(); +#ifdef _OPENMP +#pragma omp parallel for schedule(dynamic) +#endif + for (int i = 0; i < target_DMR->size_atom_pairs(); ++i) + { + hamilt::AtomPair& target_ap = target_DMR->get_atom_pair(i); + int iat1 = target_ap.get_atom_i(); + int iat2 = target_ap.get_atom_j(); + // get global indexes of whole matrix for each atom in this process + int row_ap = this->_paraV->atom_begin_row[iat1]; + int col_ap = this->_paraV->atom_begin_col[iat2]; + const int row_size = this->_paraV->get_row_size(iat1); + const int col_size = this->_paraV->get_col_size(iat2); + const int mat_size = row_size * col_size; + const int r_size = target_ap.get_R_size(); + if (row_ap == -1 || col_ap == -1) + { + throw std::string("Atom-pair not belong this process"); + } + std::vector> tmp_DMR; + if (PARAM.inp.nspin == 4) + { + tmp_DMR.resize(mat_size * r_size, 0); + } + + // calculate kphase and target_mat_ptr + std::vector> kphase_vec(r_size * this->_nk); + std::vector target_DMR_mat_vec(r_size); + for(int ir = 0; ir < r_size; ++ir) + { + const ModuleBase::Vector3 r_index = target_ap.get_R_index(ir); + hamilt::BaseMatrix* target_mat = target_ap.find_matrix(r_index); +#ifdef __DEBUG + if (target_mat == nullptr) + { + std::cout << "target_mat is nullptr" << std::endl; + continue; + } +#endif + target_DMR_mat_vec[ir] = target_mat->get_pointer(); + double arg_td = 0.0; + //cal tddft phase for hybrid gague + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + arg_td = At * dtau * ucell.lat0; + for(int ik = 0; ik < this->_nk; ++ik) + { + if(ik_in >= 0 && ik_in != ik) + { + continue; + } + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index[0], r_index[1], r_index[2]); + const double arg = (this->_kvec_d[ik] * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + kphase_vec[ik * r_size + ir] = std::complex(cosp, sinp); + } + } + + std::vector> tmp_DMK_mat(mat_size); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + // step_trace is used when nspin = 4; + int step_trace[4]{}; + if(PARAM.inp.nspin == 4) + { + const int npol = 2; + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = target_ap.get_col_size() * is + is2; + } + } + } + for(int ik = 0; ik < this->_nk; ++ik) + { + if(ik_in >= 0 && ik_in != ik) + { + continue; + } + + // copy column-major DMK to row-major tmp_DMK_mat (for the purpose of computational efficiency) + const std::complex* DMK_mat_ptr = this->_DMK[ik + ik_begin].data() + col_ap * this->_paraV->nrow + row_ap; + for(int icol = 0; icol < col_size; ++icol) + { + for(int irow = 0; irow < row_size; ++irow) + { + tmp_DMK_mat[irow * col_size + icol] = DMK_mat_ptr[icol * ld_hk + irow]; + } + } + + // if nspin != 4, fill DMR + // if nspin == 4, fill tmp_DMR + for(int ir = 0; ir < r_size; ++ir) + { + std::complex kphase = kphase_vec[ik * r_size + ir]; + if(PARAM.inp.nspin != 4) + { + double* target_DMR_mat = target_DMR_mat_vec[ir]; + for(int i = 0; i < mat_size; i++) + { + target_DMR_mat[i] += kphase.real() * tmp_DMK_mat[i].real() + - kphase.imag() * tmp_DMK_mat[i].imag(); + } + } else if(PARAM.inp.nspin == 4) + { + std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; + BlasConnector::axpy(mat_size, + kphase, + tmp_DMK_mat.data(), + 1, + tmp_DMR_mat, + 1); + } + } + } + + // if nspin == 4 + // copy tmp_DMR to fill target_DMR + if(PARAM.inp.nspin == 4) + { + std::complex tmp[4]{}; + for(int ir = 0; ir < r_size; ++ir) + { + std::complex* tmp_DMR_mat = &tmp_DMR[ir * mat_size]; + double* target_DMR_mat = target_DMR_mat_vec[ir]; + for (int irow = 0; irow < row_size; irow += 2) + { + for (int icol = 0; icol < col_size; icol += 2) + { + // catch the 4 spin component value of one orbital pair + tmp[0] = tmp_DMR_mat[icol + step_trace[0]]; + tmp[1] = tmp_DMR_mat[icol + step_trace[1]]; + tmp[2] = tmp_DMR_mat[icol + step_trace[2]]; + tmp[3] = tmp_DMR_mat[icol + step_trace[3]]; + // transfer to Pauli matrix and save the real part + // save them back to the target_mat + target_DMR_mat[icol + step_trace[0]] = tmp[0].real() + tmp[3].real(); + target_DMR_mat[icol + step_trace[1]] = tmp[1].real() + tmp[2].real(); + target_DMR_mat[icol + step_trace[2]] + = -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() + target_DMR_mat[icol + step_trace[3]] = tmp[0].real() - tmp[3].real(); + } + tmp_DMR_mat += col_size * 2; + target_DMR_mat += col_size * 2; + } + } + } + } + } + ModuleBase::timer::tick("DensityMatrix", "cal_DMR_td"); +} + // calculate DMR from DMK using blas for multi-k calculation template <> void DensityMatrix::cal_DMR_full(hamilt::HContainer>* dmR_out)const{} diff --git a/source/source_estate/module_dm/density_matrix.h b/source/source_estate/module_dm/density_matrix.h index 8e41508dcf..267138564a 100644 --- a/source/source_estate/module_dm/density_matrix.h +++ b/source/source_estate/module_dm/density_matrix.h @@ -181,6 +181,13 @@ class DensityMatrix */ void cal_DMR(const int ik_in = -1); + /** + * @brief calculate density matrix DMR with additional vector potential phase, used for hybrid gague tddft + * if ik_in < 0, calculate all k-points + * if ik_in >= 0, calculate only one k-point without summing over k-points + */ + void cal_DMR_td(const UnitCell& ucell, const ModuleBase::Vector3 At, const int ik_in = -1); + /** * @brief calculate complex density matrix DMR with both real and imaginary part for noncollinear-spin calculation * the stored dm(k) has been used to calculate the passin DMR From 7e7e396b3bc46b6e011e3d5a7eaa034e17c8c6c7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:15:05 +0800 Subject: [PATCH 60/81] Add files via upload --- source/module_io/read_input_item_tddft.cpp | 6 +++--- source/module_io/td_current_io.cpp | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/module_io/read_input_item_tddft.cpp b/source/module_io/read_input_item_tddft.cpp index 6b0b103088..0e44754db1 100644 --- a/source/module_io/read_input_item_tddft.cpp +++ b/source/module_io/read_input_item_tddft.cpp @@ -28,9 +28,9 @@ void ReadInput::item_rt_tddft() this->add_item(item); } { - Input_Item item("td_force_dt"); - item.annotation = "time of force change"; - read_sync_double(input.td_force_dt); + Input_Item item("td_dt"); + item.annotation = "time step of propagation"; + read_sync_double(input.td_dt); this->add_item(item); } { diff --git a/source/module_io/td_current_io.cpp b/source/module_io/td_current_io.cpp index cfeb03ce8b..c0a76a4612 100644 --- a/source/module_io/td_current_io.cpp +++ b/source/module_io/td_current_io.cpp @@ -10,7 +10,6 @@ #include "source_estate/module_dm/cal_dm_psi.h" #include "source_estate/module_pot/H_TDDFT_pw.h" #include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/module_tddft/td_current.h" #include "module_hamilt_lcao/module_tddft/td_info.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" From 662888f8787feda60ec48b3034921f92aa25c23c Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:15:29 +0800 Subject: [PATCH 61/81] Add files via upload --- .../operator_lcao/td_current_io.cpp | 634 ++++++++++++++++++ 1 file changed, 634 insertions(+) create mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp new file mode 100644 index 0000000000..c0a76a4612 --- /dev/null +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp @@ -0,0 +1,634 @@ +#include "td_current_io.h" + +#include "source_base/global_function.h" +#include "source_base/global_variable.h" +#include "source_base/libm/libm.h" +#include "source_base/parallel_reduce.h" +#include "source_base/timer.h" +#include "source_base/tool_threading.h" +#include "source_base/vector3.h" +#include "source_estate/module_dm/cal_dm_psi.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_pw/hamilt_pwdft/global.h" +#include "module_parameter/parameter.h" + +#ifdef __LCAO +void ModuleIO::cal_tmp_DM(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, + elecstate::DensityMatrix, double>& DM_imag, + int nspin_dm) +{ + ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + for (int is = 1; is <= nspin_dm; ++is) + { + for (int ik = 0; ik < DM_real.get_DMK_nks() / nspin_dm; ++ik) + { + cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is, false); + } + } + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); +} +template +void ModuleIO::write_current(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra) +{ + + ModuleBase::TITLE("ModuleIO", "write_current"); + ModuleBase::timer::tick("ModuleIO", "write_current"); + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + if (PARAM.inp.td_stype!=1) + { + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = cal_current->get_current_term_pointer(dir); + } + } + else + { + if (TD_info::td_vel_op == nullptr) + { + ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); + } + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); + } + } + double omega=ucell.omega; + // construct a DensityMatrix object + // Since the function cal_dm_psi do not suport DMR in complex type, I replace it with two DMR in double type. Should + // be refactored in the future. + const int nspin0 = PARAM.inp.nspin; + const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; + elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + // calculate DMK + elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); + + // init DMR + DM_real.init_DMR(ra, &ucell); + DM_imag.init_DMR(ra, &ucell); + cal_tmp_DM(ucell, DM_real, DM_imag, nspin_dm); + //DM_real.sum_DMR_spin(); + //DM_imag.sum_DMR_spin(); + + double current_total[3] = {0.0, 0.0, 0.0}; +#ifdef _OPENMP +#pragma omp parallel + { + double local_current[3] = {0.0, 0.0, 0.0}; +#else + // ModuleBase::matrix& local_soverlap = soverlap; + double* local_current = current_total; +#endif + ModuleBase::Vector3 tau1, dtau, tau2; + +#ifdef _OPENMP +#pragma omp for schedule(dynamic) +#endif + for (int iat = 0; iat < ucell.nat; iat++) + { + const int T1 = ucell.iat2it[iat]; + Atom* atom1 = &ucell.atoms[T1]; + const int I1 = ucell.iat2ia[iat]; + // get iat1 + int iat1 = ucell.itia2iat(T1, I1); + const int start1 = ucell.itiaiw2iwt(T1, I1, 0); + for (int cb = 0; cb < ra.na_each[iat]; ++cb) + { + const int T2 = ra.info[iat][cb][3]; + const int I2 = ra.info[iat][cb][4]; + + const int start2 = ucell.itiaiw2iwt(T2, I2, 0); + + Atom* atom2 = &ucell.atoms[T2]; + + // get iat2 + int iat2 = ucell.itia2iat(T2, I2); + double Rx = ra.info[iat][cb][0]; + double Ry = ra.info[iat][cb][1]; + double Rz = ra.info[iat][cb][2]; + //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; + // get BaseMatrix + hamilt::BaseMatrix* tmp_matrix_real + = DM_real.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix* tmp_matrix_imag + = DM_imag.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); + // refactor + hamilt::BaseMatrix>* tmp_m_rvx + = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvy + = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvz + = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); + if (tmp_matrix_real == nullptr) + { + continue; + } + int row_ap = pv->atom_begin_row[iat1]; + int col_ap = pv->atom_begin_col[iat2]; + // get DMR + for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) + { + for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) + { + double dm2d1_real = tmp_matrix_real->get_value(mu, nu); + double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); + + std::complex rvx = {0, 0}; + std::complex rvy = {0, 0}; + std::complex rvz = {0, 0}; + + if (tmp_m_rvx != nullptr) + { + rvx = tmp_m_rvx->get_value(mu, nu); + rvy = tmp_m_rvy->get_value(mu, nu); + rvz = tmp_m_rvz->get_value(mu, nu); + } + //std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; + // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; + //std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; + local_current[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); + local_current[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); + local_current[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); + } // end kk + } // end jj + } // end cb + } // end iat +#ifdef _OPENMP +#pragma omp critical(cal_current_k_reduce) + { + for (int i = 0; i < 3; ++i) + { + current_total[i] += local_current[i]; + } + } + } +#endif + Parallel_Reduce::reduce_all(current_total, 3); + // write end + if (GlobalV::MY_RANK == 0) + { + std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; + std::ofstream fout; + fout.open(filename, std::ios::app); + fout << std::setprecision(16); + fout << std::scientific; + fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; + fout.close(); + } + + ModuleBase::timer::tick("ModuleIO", "write_current"); + return; +} +void ModuleIO::cal_tmp_DM_k(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, + elecstate::DensityMatrix, double>& DM_imag, + const int ik, + const int nspin, + const int is, + const bool reset) +{ + ModuleBase::TITLE("ModuleIO", "cal_tmp_DM_k"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); + int ld_hk = DM_real.get_paraV_pointer()->nrow; + int ld_hk2 = 2 * ld_hk; + // tmp for is + int ik_begin = DM_real.get_DMK_nks() / nspin * (is - 1); // jump nk for spin_down if nspin==2 + //sum spin up and down into up + hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[0]; + hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[0]; + if(reset) + { + tmp_DMR_real->set_zero(); + tmp_DMR_imag->set_zero(); + } +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int i = 0; i < tmp_DMR_real->size_atom_pairs(); ++i) + { + hamilt::AtomPair& tmp_ap_real = tmp_DMR_real->get_atom_pair(i); + hamilt::AtomPair& tmp_ap_imag = tmp_DMR_imag->get_atom_pair(i); + int iat1 = tmp_ap_real.get_atom_i(); + int iat2 = tmp_ap_real.get_atom_j(); + // get global indexes of whole matrix for each atom in this process + int row_ap = DM_real.get_paraV_pointer()->atom_begin_row[iat1]; + int col_ap = DM_real.get_paraV_pointer()->atom_begin_col[iat2]; + // SOC + std::vector> tmp_DMR; + if (PARAM.inp.nspin == 4) + { + tmp_DMR.resize(tmp_ap_real.get_size()); + } + for (int ir = 0; ir < tmp_ap_real.get_R_size(); ++ir) + { + const ModuleBase::Vector3 r_index = tmp_ap_real.get_R_index(ir); + hamilt::BaseMatrix* tmp_matrix_real = tmp_ap_real.find_matrix(r_index); + hamilt::BaseMatrix* tmp_matrix_imag = tmp_ap_imag.find_matrix(r_index); +#ifdef __DEBUG + if (tmp_matrix_real == nullptr) + { + std::cout << "tmp_matrix is nullptr" << std::endl; + continue; + } +#endif + // only ik + if (PARAM.inp.nspin != 4) + { + double arg_td = 0.0; + if(elecstate::H_TDDFT_pw::stype == 2) + { + //cal tddft phase for hybrid gague + const int iat1 = tmp_ap_real.get_atom_i(); + const int iat2 = tmp_ap_real.get_atom_j(); + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + double& tmp_lat0 = ucell.lat0; + arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; + } + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + // set DMR element + double* tmp_DMR_real_pointer = tmp_matrix_real->get_pointer(); + double* tmp_DMR_imag_pointer = tmp_matrix_imag->get_pointer(); + std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin); + double* DMK_real_pointer = nullptr; + double* DMK_imag_pointer = nullptr; + // jump DMK to fill DMR + // DMR is row-major, DMK is column-major + tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; + for (int mu = 0; mu < DM_real.get_paraV_pointer()->get_row_size(iat1); ++mu) + { + DMK_real_pointer = (double*)tmp_DMK_pointer; + DMK_imag_pointer = DMK_real_pointer + 1; + // calculate real part + BlasConnector::axpy(DM_real.get_paraV_pointer()->get_col_size(iat2), + -kphase.imag(), + DMK_imag_pointer, + ld_hk2, + tmp_DMR_real_pointer, + 1); + BlasConnector::axpy(DM_real.get_paraV_pointer()->get_col_size(iat2), + kphase.real(), + DMK_real_pointer, + ld_hk2, + tmp_DMR_real_pointer, + 1); + // calculate imag part + BlasConnector::axpy(DM_imag.get_paraV_pointer()->get_col_size(iat2), + kphase.imag(), + DMK_real_pointer, + ld_hk2, + tmp_DMR_imag_pointer, + 1); + BlasConnector::axpy(DM_imag.get_paraV_pointer()->get_col_size(iat2), + kphase.real(), + DMK_imag_pointer, + ld_hk2, + tmp_DMR_imag_pointer, + 1); + tmp_DMK_pointer += 1; + tmp_DMR_real_pointer += DM_real.get_paraV_pointer()->get_col_size(iat2); + tmp_DMR_imag_pointer += DM_imag.get_paraV_pointer()->get_col_size(iat2); + } + } + // treat DMR as pauli matrix when NSPIN=4 + if (PARAM.inp.nspin == 4) + { + tmp_DMR.assign(tmp_ap_real.get_size(), std::complex(0.0, 0.0)); + { + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + double arg_td = 0.0; + if(elecstate::H_TDDFT_pw::stype == 2) + { + //new + //cal tddft phase for mixing gague + const int iat1 = tmp_ap_real.get_atom_i(); + const int iat2 = tmp_ap_real.get_atom_j(); + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + double& tmp_lat0 = ucell.lat0; + arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; + } + const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + // set DMR element + std::complex* tmp_DMR_pointer = tmp_DMR.data(); + std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin);; + double* DMK_real_pointer = nullptr; + double* DMK_imag_pointer = nullptr; + // jump DMK to fill DMR + // DMR is row-major, DMK is column-major + tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; + for (int mu = 0; mu < tmp_ap_real.get_row_size(); ++mu) + { + BlasConnector::axpy(tmp_ap_real.get_col_size(), + kphase, + tmp_DMK_pointer, + ld_hk, + tmp_DMR_pointer, + 1); + tmp_DMK_pointer += 1; + tmp_DMR_pointer += tmp_ap_real.get_col_size(); + } + } + int npol = 2; + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + int step_trace[4]; + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = tmp_ap_real.get_col_size() * is + is2; + } + } + std::complex tmp[4]; + double* target_DMR_real = tmp_matrix_real->get_pointer(); + double* target_DMR_imag = tmp_matrix_imag->get_pointer(); + std::complex* tmp_DMR_pointer = tmp_DMR.data(); + for (int irow = 0; irow < tmp_ap_real.get_row_size(); irow += 2) + { + for (int icol = 0; icol < tmp_ap_real.get_col_size(); icol += 2) + { + // catch the 4 spin component value of one orbital pair + tmp[0] = tmp_DMR_pointer[icol + step_trace[0]]; + tmp[1] = tmp_DMR_pointer[icol + step_trace[1]]; + tmp[2] = tmp_DMR_pointer[icol + step_trace[2]]; + tmp[3] = tmp_DMR_pointer[icol + step_trace[3]]; + // transfer to Pauli matrix and save the real part + // save them back to the tmp_matrix + target_DMR_real[icol + step_trace[0]] += tmp[0].real() + tmp[3].real(); + target_DMR_real[icol + step_trace[1]] += tmp[1].real() + tmp[2].real(); + target_DMR_real[icol + step_trace[2]] + += -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() + target_DMR_real[icol + step_trace[3]] += tmp[0].real() - tmp[3].real(); + //imag part + target_DMR_imag[icol + step_trace[0]] += tmp[0].imag() + tmp[3].imag(); + target_DMR_imag[icol + step_trace[1]] += tmp[1].imag() + tmp[2].imag(); + target_DMR_imag[icol + step_trace[2]] + += tmp[1].real() - tmp[2].real(); // (i * (rho_updown - rho_downup)).real() + target_DMR_imag[icol + step_trace[3]] += tmp[0].imag() - tmp[3].imag(); + } + tmp_DMR_pointer += tmp_ap_real.get_col_size() * 2; + target_DMR_real += tmp_ap_real.get_col_size() * 2; + target_DMR_imag += tmp_ap_real.get_col_size() * 2; + } + } + } + } + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); +} +template +void ModuleIO::write_current_eachk(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra) +{ + + ModuleBase::TITLE("ModuleIO", "write_current"); + ModuleBase::timer::tick("ModuleIO", "write_current"); + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + if (PARAM.inp.td_stype != 1) + { + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = cal_current->get_current_term_pointer(dir); + } + } + else + { + if (TD_info::td_vel_op == nullptr) + { + ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); + } + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); + } + } + double omega=ucell.omega; + // construct a DensityMatrix object + // Since the function cal_dm_psi do not suport DMR in complex type, + // I replace it with two DMR in double type. + // Should be refactored in the future. + + const int nspin0 = PARAM.inp.nspin; + const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; + elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + // calculate DMK + elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); + + // init DMR + DM_real.init_DMR(ra, &ucell); + DM_imag.init_DMR(ra, &ucell); + + int nks = DM_real.get_DMK_nks() / nspin_dm; + double current_total[3] = {0.0, 0.0, 0.0}; + for (int is = 1; is <= nspin_dm; ++is) + { + for (int ik = 0; ik < nks; ++ik) + { + cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is); + // check later + double current_ik[3] = {0.0, 0.0, 0.0}; +#ifdef _OPENMP +#pragma omp parallel + { + int num_threads = omp_get_num_threads(); + double local_current_ik[3] = {0.0, 0.0, 0.0}; +#else + // ModuleBase::matrix& local_soverlap = soverlap; + double* local_current_ik = current_ik; +#endif + + ModuleBase::Vector3 tau1, dtau, tau2; + +#ifdef _OPENMP +#pragma omp for schedule(dynamic) +#endif + for (int iat = 0; iat < ucell.nat; iat++) + { + const int T1 = ucell.iat2it[iat]; + Atom* atom1 = &ucell.atoms[T1]; + const int I1 = ucell.iat2ia[iat]; + // get iat1 + int iat1 = ucell.itia2iat(T1, I1); + const int start1 = ucell.itiaiw2iwt(T1, I1, 0); + for (int cb = 0; cb < ra.na_each[iat]; ++cb) + { + const int T2 = ra.info[iat][cb][3]; + const int I2 = ra.info[iat][cb][4]; + + const int start2 = ucell.itiaiw2iwt(T2, I2, 0); + + Atom* atom2 = &ucell.atoms[T2]; + + // get iat2 + int iat2 = ucell.itia2iat(T2, I2); + double Rx = ra.info[iat][cb][0]; + double Ry = ra.info[iat][cb][1]; + double Rz = ra.info[iat][cb][2]; + //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; + // get BaseMatrix + hamilt::BaseMatrix* tmp_matrix_real + = DM_real.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix* tmp_matrix_imag + = DM_imag.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); + // refactor + hamilt::BaseMatrix>* tmp_m_rvx + = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvy + = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvz + = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); + if (tmp_matrix_real == nullptr) + { + continue; + } + int row_ap = pv->atom_begin_row[iat1]; + int col_ap = pv->atom_begin_col[iat2]; + // get DMR + for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) + { + for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) + { + double dm2d1_real = tmp_matrix_real->get_value(mu, nu); + double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); + + std::complex rvx = {0, 0}; + std::complex rvy = {0, 0}; + std::complex rvz = {0, 0}; + + if (tmp_m_rvx != nullptr) + { + rvx = tmp_m_rvx->get_value(mu, nu); + rvy = tmp_m_rvy->get_value(mu, nu); + rvz = tmp_m_rvz->get_value(mu, nu); + } + // std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; + // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; + // std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; + local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); + local_current_ik[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); + local_current_ik[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); + } // end kk + } // end jj + } // end cb + } // end iat +#ifdef _OPENMP +#pragma omp critical(cal_current_k_reduce) + { + for (int i = 0; i < 3; ++i) + { + current_ik[i] += local_current_ik[i]; + } + } + } +#endif + Parallel_Reduce::reduce_all(current_ik, 3); + for (int i = 0; i < 3; ++i) + { + current_total[i] += current_ik[i]; + } + // MPI_Reduce(local_current_ik, current_ik, 3, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); + if (GlobalV::MY_RANK == 0 && TD_info::out_current_k) + { + std::string filename = PARAM.globalv.global_out_dir + "current_spin" + std::to_string(is) + "_ik" + + std::to_string(ik) + ".dat"; + std::ofstream fout; + fout.open(filename, std::ios::app); + fout << std::setprecision(16); + fout << std::scientific; + fout << istep << " " << current_ik[0]/omega << " " << current_ik[1]/omega << " " << current_ik[2]/omega << std::endl; + fout.close(); + } + // write end + } // end nks + } // end is + if (GlobalV::MY_RANK == 0) + { + std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; + std::ofstream fout; + fout.open(filename, std::ios::app); + fout << std::setprecision(16); + fout << std::scientific; + fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; + fout.close(); + } + + ModuleBase::timer::tick("ModuleIO", "write_current"); + return; +} +template +void ModuleIO::write_current_eachk( + const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current_eachk>(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op>* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current>(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op>* cal_current, + Record_adj& ra); +#endif //__LCAO + From 763b0f9da5d5e3d945bd033ddd44fa87df94b3e6 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:23:10 +0800 Subject: [PATCH 62/81] Update operator_lcao.cpp --- .../hamilt_lcaodft/operator_lcao/operator_lcao.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp index 1657e4de80..ca94601fa9 100644 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp @@ -202,7 +202,7 @@ void OperatorLCAO::init(const int ik_in) { break; } - case calculation_type::lcao_tddft_velocity: { + case calculation_type::lcao_tddft_periodic: { if (!this->hr_done) { // in cal_type=lcao_fixed, HR should be updated by each sub-chain // nodes From fbdd3ba4e63053febdd4c234ad14d5b8c90966b7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:24:59 +0800 Subject: [PATCH 63/81] Update write_HS_sparse.cpp --- source/module_io/write_HS_sparse.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/module_io/write_HS_sparse.cpp b/source/module_io/write_HS_sparse.cpp index dab228a4cf..770776cf37 100644 --- a/source/module_io/write_HS_sparse.cpp +++ b/source/module_io/write_HS_sparse.cpp @@ -50,10 +50,10 @@ void ModuleIO::save_HSR_sparse(const int& istep, for (int ispin = 0; ispin < spin_loop; ++ispin) { if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { auto iter - = TD_Velocity::td_vel_op->HR_sparse_td_vel[ispin].find( + = TD_info::td_vel_op->HR_sparse_td_vel[ispin].find( R_coor); if (iter - != TD_Velocity::td_vel_op->HR_sparse_td_vel[ispin] + != TD_info::td_vel_op->HR_sparse_td_vel[ispin] .end()) { for (auto& row_loop: iter->second) { H_nonzero_num[ispin][count] @@ -256,7 +256,7 @@ void ModuleIO::save_HSR_sparse(const int& istep, if (PARAM.inp.nspin != 4) { if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { output_single_R(g1[ispin], - TD_Velocity::td_vel_op + TD_info::td_vel_op ->HR_sparse_td_vel[ispin][R_coor], sparse_thr, binary, From ad6cbf82b387b2b846145ceb230ed157c9e53ecc Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 20:28:04 +0800 Subject: [PATCH 64/81] Delete source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp --- .../operator_lcao/td_current_io.cpp | 634 ------------------ 1 file changed, 634 deletions(-) delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp deleted file mode 100644 index c0a76a4612..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_current_io.cpp +++ /dev/null @@ -1,634 +0,0 @@ -#include "td_current_io.h" - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/tool_threading.h" -#include "source_base/vector3.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -#ifdef __LCAO -void ModuleIO::cal_tmp_DM(const UnitCell& ucell, - elecstate::DensityMatrix, double>& DM_real, - elecstate::DensityMatrix, double>& DM_imag, - int nspin_dm) -{ - ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); - for (int is = 1; is <= nspin_dm; ++is) - { - for (int ik = 0; ik < DM_real.get_DMK_nks() / nspin_dm; ++ik) - { - cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is, false); - } - } - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); -} -template -void ModuleIO::write_current(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra) -{ - - ModuleBase::TITLE("ModuleIO", "write_current"); - ModuleBase::timer::tick("ModuleIO", "write_current"); - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - if (PARAM.inp.td_stype!=1) - { - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = cal_current->get_current_term_pointer(dir); - } - } - else - { - if (TD_info::td_vel_op == nullptr) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); - } - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); - } - } - double omega=ucell.omega; - // construct a DensityMatrix object - // Since the function cal_dm_psi do not suport DMR in complex type, I replace it with two DMR in double type. Should - // be refactored in the future. - const int nspin0 = PARAM.inp.nspin; - const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; - elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - // calculate DMK - elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); - - // init DMR - DM_real.init_DMR(ra, &ucell); - DM_imag.init_DMR(ra, &ucell); - cal_tmp_DM(ucell, DM_real, DM_imag, nspin_dm); - //DM_real.sum_DMR_spin(); - //DM_imag.sum_DMR_spin(); - - double current_total[3] = {0.0, 0.0, 0.0}; -#ifdef _OPENMP -#pragma omp parallel - { - double local_current[3] = {0.0, 0.0, 0.0}; -#else - // ModuleBase::matrix& local_soverlap = soverlap; - double* local_current = current_total; -#endif - ModuleBase::Vector3 tau1, dtau, tau2; - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - // get iat1 - int iat1 = ucell.itia2iat(T1, I1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int cb = 0; cb < ra.na_each[iat]; ++cb) - { - const int T2 = ra.info[iat][cb][3]; - const int I2 = ra.info[iat][cb][4]; - - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - Atom* atom2 = &ucell.atoms[T2]; - - // get iat2 - int iat2 = ucell.itia2iat(T2, I2); - double Rx = ra.info[iat][cb][0]; - double Ry = ra.info[iat][cb][1]; - double Rz = ra.info[iat][cb][2]; - //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; - // get BaseMatrix - hamilt::BaseMatrix* tmp_matrix_real - = DM_real.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix* tmp_matrix_imag - = DM_imag.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); - // refactor - hamilt::BaseMatrix>* tmp_m_rvx - = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvy - = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvz - = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); - if (tmp_matrix_real == nullptr) - { - continue; - } - int row_ap = pv->atom_begin_row[iat1]; - int col_ap = pv->atom_begin_col[iat2]; - // get DMR - for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) - { - for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) - { - double dm2d1_real = tmp_matrix_real->get_value(mu, nu); - double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); - - std::complex rvx = {0, 0}; - std::complex rvy = {0, 0}; - std::complex rvz = {0, 0}; - - if (tmp_m_rvx != nullptr) - { - rvx = tmp_m_rvx->get_value(mu, nu); - rvy = tmp_m_rvy->get_value(mu, nu); - rvz = tmp_m_rvz->get_value(mu, nu); - } - //std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; - // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; - //std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; - local_current[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); - local_current[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); - local_current[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); - } // end kk - } // end jj - } // end cb - } // end iat -#ifdef _OPENMP -#pragma omp critical(cal_current_k_reduce) - { - for (int i = 0; i < 3; ++i) - { - current_total[i] += local_current[i]; - } - } - } -#endif - Parallel_Reduce::reduce_all(current_total, 3); - // write end - if (GlobalV::MY_RANK == 0) - { - std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; - std::ofstream fout; - fout.open(filename, std::ios::app); - fout << std::setprecision(16); - fout << std::scientific; - fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; - fout.close(); - } - - ModuleBase::timer::tick("ModuleIO", "write_current"); - return; -} -void ModuleIO::cal_tmp_DM_k(const UnitCell& ucell, - elecstate::DensityMatrix, double>& DM_real, - elecstate::DensityMatrix, double>& DM_imag, - const int ik, - const int nspin, - const int is, - const bool reset) -{ - ModuleBase::TITLE("ModuleIO", "cal_tmp_DM_k"); - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); - int ld_hk = DM_real.get_paraV_pointer()->nrow; - int ld_hk2 = 2 * ld_hk; - // tmp for is - int ik_begin = DM_real.get_DMK_nks() / nspin * (is - 1); // jump nk for spin_down if nspin==2 - //sum spin up and down into up - hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[0]; - hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[0]; - if(reset) - { - tmp_DMR_real->set_zero(); - tmp_DMR_imag->set_zero(); - } -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < tmp_DMR_real->size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp_ap_real = tmp_DMR_real->get_atom_pair(i); - hamilt::AtomPair& tmp_ap_imag = tmp_DMR_imag->get_atom_pair(i); - int iat1 = tmp_ap_real.get_atom_i(); - int iat2 = tmp_ap_real.get_atom_j(); - // get global indexes of whole matrix for each atom in this process - int row_ap = DM_real.get_paraV_pointer()->atom_begin_row[iat1]; - int col_ap = DM_real.get_paraV_pointer()->atom_begin_col[iat2]; - // SOC - std::vector> tmp_DMR; - if (PARAM.inp.nspin == 4) - { - tmp_DMR.resize(tmp_ap_real.get_size()); - } - for (int ir = 0; ir < tmp_ap_real.get_R_size(); ++ir) - { - const ModuleBase::Vector3 r_index = tmp_ap_real.get_R_index(ir); - hamilt::BaseMatrix* tmp_matrix_real = tmp_ap_real.find_matrix(r_index); - hamilt::BaseMatrix* tmp_matrix_imag = tmp_ap_imag.find_matrix(r_index); -#ifdef __DEBUG - if (tmp_matrix_real == nullptr) - { - std::cout << "tmp_matrix is nullptr" << std::endl; - continue; - } -#endif - // only ik - if (PARAM.inp.nspin != 4) - { - double arg_td = 0.0; - if(elecstate::H_TDDFT_pw::stype == 2) - { - //cal tddft phase for hybrid gague - const int iat1 = tmp_ap_real.get_atom_i(); - const int iat2 = tmp_ap_real.get_atom_j(); - ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); - double& tmp_lat0 = ucell.lat0; - arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; - } - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - // set DMR element - double* tmp_DMR_real_pointer = tmp_matrix_real->get_pointer(); - double* tmp_DMR_imag_pointer = tmp_matrix_imag->get_pointer(); - std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin); - double* DMK_real_pointer = nullptr; - double* DMK_imag_pointer = nullptr; - // jump DMK to fill DMR - // DMR is row-major, DMK is column-major - tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; - for (int mu = 0; mu < DM_real.get_paraV_pointer()->get_row_size(iat1); ++mu) - { - DMK_real_pointer = (double*)tmp_DMK_pointer; - DMK_imag_pointer = DMK_real_pointer + 1; - // calculate real part - BlasConnector::axpy(DM_real.get_paraV_pointer()->get_col_size(iat2), - -kphase.imag(), - DMK_imag_pointer, - ld_hk2, - tmp_DMR_real_pointer, - 1); - BlasConnector::axpy(DM_real.get_paraV_pointer()->get_col_size(iat2), - kphase.real(), - DMK_real_pointer, - ld_hk2, - tmp_DMR_real_pointer, - 1); - // calculate imag part - BlasConnector::axpy(DM_imag.get_paraV_pointer()->get_col_size(iat2), - kphase.imag(), - DMK_real_pointer, - ld_hk2, - tmp_DMR_imag_pointer, - 1); - BlasConnector::axpy(DM_imag.get_paraV_pointer()->get_col_size(iat2), - kphase.real(), - DMK_imag_pointer, - ld_hk2, - tmp_DMR_imag_pointer, - 1); - tmp_DMK_pointer += 1; - tmp_DMR_real_pointer += DM_real.get_paraV_pointer()->get_col_size(iat2); - tmp_DMR_imag_pointer += DM_imag.get_paraV_pointer()->get_col_size(iat2); - } - } - // treat DMR as pauli matrix when NSPIN=4 - if (PARAM.inp.nspin == 4) - { - tmp_DMR.assign(tmp_ap_real.get_size(), std::complex(0.0, 0.0)); - { - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - double arg_td = 0.0; - if(elecstate::H_TDDFT_pw::stype == 2) - { - //new - //cal tddft phase for mixing gague - const int iat1 = tmp_ap_real.get_atom_i(); - const int iat2 = tmp_ap_real.get_atom_j(); - ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); - double& tmp_lat0 = ucell.lat0; - arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; - } - const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - // set DMR element - std::complex* tmp_DMR_pointer = tmp_DMR.data(); - std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin);; - double* DMK_real_pointer = nullptr; - double* DMK_imag_pointer = nullptr; - // jump DMK to fill DMR - // DMR is row-major, DMK is column-major - tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; - for (int mu = 0; mu < tmp_ap_real.get_row_size(); ++mu) - { - BlasConnector::axpy(tmp_ap_real.get_col_size(), - kphase, - tmp_DMK_pointer, - ld_hk, - tmp_DMR_pointer, - 1); - tmp_DMK_pointer += 1; - tmp_DMR_pointer += tmp_ap_real.get_col_size(); - } - } - int npol = 2; - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - int step_trace[4]; - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = tmp_ap_real.get_col_size() * is + is2; - } - } - std::complex tmp[4]; - double* target_DMR_real = tmp_matrix_real->get_pointer(); - double* target_DMR_imag = tmp_matrix_imag->get_pointer(); - std::complex* tmp_DMR_pointer = tmp_DMR.data(); - for (int irow = 0; irow < tmp_ap_real.get_row_size(); irow += 2) - { - for (int icol = 0; icol < tmp_ap_real.get_col_size(); icol += 2) - { - // catch the 4 spin component value of one orbital pair - tmp[0] = tmp_DMR_pointer[icol + step_trace[0]]; - tmp[1] = tmp_DMR_pointer[icol + step_trace[1]]; - tmp[2] = tmp_DMR_pointer[icol + step_trace[2]]; - tmp[3] = tmp_DMR_pointer[icol + step_trace[3]]; - // transfer to Pauli matrix and save the real part - // save them back to the tmp_matrix - target_DMR_real[icol + step_trace[0]] += tmp[0].real() + tmp[3].real(); - target_DMR_real[icol + step_trace[1]] += tmp[1].real() + tmp[2].real(); - target_DMR_real[icol + step_trace[2]] - += -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() - target_DMR_real[icol + step_trace[3]] += tmp[0].real() - tmp[3].real(); - //imag part - target_DMR_imag[icol + step_trace[0]] += tmp[0].imag() + tmp[3].imag(); - target_DMR_imag[icol + step_trace[1]] += tmp[1].imag() + tmp[2].imag(); - target_DMR_imag[icol + step_trace[2]] - += tmp[1].real() - tmp[2].real(); // (i * (rho_updown - rho_downup)).real() - target_DMR_imag[icol + step_trace[3]] += tmp[0].imag() - tmp[3].imag(); - } - tmp_DMR_pointer += tmp_ap_real.get_col_size() * 2; - target_DMR_real += tmp_ap_real.get_col_size() * 2; - target_DMR_imag += tmp_ap_real.get_col_size() * 2; - } - } - } - } - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); -} -template -void ModuleIO::write_current_eachk(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra) -{ - - ModuleBase::TITLE("ModuleIO", "write_current"); - ModuleBase::timer::tick("ModuleIO", "write_current"); - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - if (PARAM.inp.td_stype != 1) - { - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = cal_current->get_current_term_pointer(dir); - } - } - else - { - if (TD_info::td_vel_op == nullptr) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); - } - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); - } - } - double omega=ucell.omega; - // construct a DensityMatrix object - // Since the function cal_dm_psi do not suport DMR in complex type, - // I replace it with two DMR in double type. - // Should be refactored in the future. - - const int nspin0 = PARAM.inp.nspin; - const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; - elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - // calculate DMK - elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); - - // init DMR - DM_real.init_DMR(ra, &ucell); - DM_imag.init_DMR(ra, &ucell); - - int nks = DM_real.get_DMK_nks() / nspin_dm; - double current_total[3] = {0.0, 0.0, 0.0}; - for (int is = 1; is <= nspin_dm; ++is) - { - for (int ik = 0; ik < nks; ++ik) - { - cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is); - // check later - double current_ik[3] = {0.0, 0.0, 0.0}; -#ifdef _OPENMP -#pragma omp parallel - { - int num_threads = omp_get_num_threads(); - double local_current_ik[3] = {0.0, 0.0, 0.0}; -#else - // ModuleBase::matrix& local_soverlap = soverlap; - double* local_current_ik = current_ik; -#endif - - ModuleBase::Vector3 tau1, dtau, tau2; - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - // get iat1 - int iat1 = ucell.itia2iat(T1, I1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int cb = 0; cb < ra.na_each[iat]; ++cb) - { - const int T2 = ra.info[iat][cb][3]; - const int I2 = ra.info[iat][cb][4]; - - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - Atom* atom2 = &ucell.atoms[T2]; - - // get iat2 - int iat2 = ucell.itia2iat(T2, I2); - double Rx = ra.info[iat][cb][0]; - double Ry = ra.info[iat][cb][1]; - double Rz = ra.info[iat][cb][2]; - //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; - // get BaseMatrix - hamilt::BaseMatrix* tmp_matrix_real - = DM_real.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix* tmp_matrix_imag - = DM_imag.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); - // refactor - hamilt::BaseMatrix>* tmp_m_rvx - = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvy - = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvz - = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); - if (tmp_matrix_real == nullptr) - { - continue; - } - int row_ap = pv->atom_begin_row[iat1]; - int col_ap = pv->atom_begin_col[iat2]; - // get DMR - for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) - { - for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) - { - double dm2d1_real = tmp_matrix_real->get_value(mu, nu); - double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); - - std::complex rvx = {0, 0}; - std::complex rvy = {0, 0}; - std::complex rvz = {0, 0}; - - if (tmp_m_rvx != nullptr) - { - rvx = tmp_m_rvx->get_value(mu, nu); - rvy = tmp_m_rvy->get_value(mu, nu); - rvz = tmp_m_rvz->get_value(mu, nu); - } - // std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; - // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; - // std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; - local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); - local_current_ik[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); - local_current_ik[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); - } // end kk - } // end jj - } // end cb - } // end iat -#ifdef _OPENMP -#pragma omp critical(cal_current_k_reduce) - { - for (int i = 0; i < 3; ++i) - { - current_ik[i] += local_current_ik[i]; - } - } - } -#endif - Parallel_Reduce::reduce_all(current_ik, 3); - for (int i = 0; i < 3; ++i) - { - current_total[i] += current_ik[i]; - } - // MPI_Reduce(local_current_ik, current_ik, 3, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); - if (GlobalV::MY_RANK == 0 && TD_info::out_current_k) - { - std::string filename = PARAM.globalv.global_out_dir + "current_spin" + std::to_string(is) + "_ik" - + std::to_string(ik) + ".dat"; - std::ofstream fout; - fout.open(filename, std::ios::app); - fout << std::setprecision(16); - fout << std::scientific; - fout << istep << " " << current_ik[0]/omega << " " << current_ik[1]/omega << " " << current_ik[2]/omega << std::endl; - fout.close(); - } - // write end - } // end nks - } // end is - if (GlobalV::MY_RANK == 0) - { - std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; - std::ofstream fout; - fout.open(filename, std::ios::app); - fout << std::setprecision(16); - fout << std::scientific; - fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; - fout.close(); - } - - ModuleBase::timer::tick("ModuleIO", "write_current"); - return; -} -template -void ModuleIO::write_current_eachk( - const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra); -template -void ModuleIO::write_current_eachk>(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op>* cal_current, - Record_adj& ra); -template -void ModuleIO::write_current(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra); -template -void ModuleIO::write_current>(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op>* cal_current, - Record_adj& ra); -#endif //__LCAO - From 61534085f9051497410bed59fe892c2e81e57a9e Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 20:43:02 +0800 Subject: [PATCH 65/81] Update velocity_op.cpp --- source/module_hamilt_lcao/module_tddft/velocity_op.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/module_hamilt_lcao/module_tddft/velocity_op.cpp b/source/module_hamilt_lcao/module_tddft/velocity_op.cpp index 640ebe37f0..7534b705ba 100644 --- a/source/module_hamilt_lcao/module_tddft/velocity_op.cpp +++ b/source/module_hamilt_lcao/module_tddft/velocity_op.cpp @@ -1,5 +1,4 @@ #include "velocity_op.h" -#ifdef __LCAO #include "source_base/timer.h" #include "source_base/tool_title.h" #include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" @@ -531,4 +530,3 @@ void Velocity_op::cal_grad_IJR(const int& iat1, } template class Velocity_op; template class Velocity_op>; -#endif // __LCAO From 153211f790550194c42c002a6d1912bce0a1a6df Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 20:43:44 +0800 Subject: [PATCH 66/81] Update velocity_op.h --- source/module_hamilt_lcao/module_tddft/velocity_op.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/module_hamilt_lcao/module_tddft/velocity_op.h b/source/module_hamilt_lcao/module_tddft/velocity_op.h index a820ec81ac..cebf99c214 100644 --- a/source/module_hamilt_lcao/module_tddft/velocity_op.h +++ b/source/module_hamilt_lcao/module_tddft/velocity_op.h @@ -9,7 +9,6 @@ #include "source_base/vector3.h" #include "module_io/cal_r_overlap_R.h" -#ifdef __LCAO //design to calculate velocity operator template class Velocity_op @@ -77,5 +76,4 @@ class Velocity_op }; -#endif // __LCAO #endif // TD_CURRENT_H From 322c85ac36551f5ad54cededb641d4b6149f5356 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 21:56:20 +0800 Subject: [PATCH 67/81] Update Makefile.Objects --- source/Makefile.Objects | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Makefile.Objects b/source/Makefile.Objects index f9a8deab5a..8c76135f18 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -624,6 +624,7 @@ OBJS_LCAO=evolve_elec.o\ propagator_cn2.o\ propagator_taylor.o\ propagator_etrs.o\ + td_folding.o\ td_info.o\ velocity_op.o\ snap_psibeta_half_tddft.o\ From 8864868a5de542769666d13b1ae44a48ad36c89a Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 21:58:34 +0800 Subject: [PATCH 68/81] Update read_input_test.cpp --- source/module_io/test_serial/read_input_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/module_io/test_serial/read_input_test.cpp b/source/module_io/test_serial/read_input_test.cpp index 9a00f9c278..ec72402c29 100644 --- a/source/module_io/test_serial/read_input_test.cpp +++ b/source/module_io/test_serial/read_input_test.cpp @@ -33,6 +33,7 @@ namespace Global_File void make_dir_out(const std::string& suffix, const std::string& calculation, const bool& out_dir, + const bool& out_wfc_lcao, const int rank, const bool& restart, const bool out_alllog) @@ -165,4 +166,4 @@ TEST_F(InputTest, Check) std::string output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output, testing::HasSubstr("INPUT parameters have been successfully checked!")); EXPECT_TRUE(std::remove("./INPUT.ref") == 0); -} \ No newline at end of file +} From 4b8f2d06ed08858c03ee076add5aad9fa957f5ee Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Fri, 27 Jun 2025 21:59:30 +0800 Subject: [PATCH 69/81] Add files via upload --- source/source_base/test/global_file_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/source_base/test/global_file_test.cpp b/source/source_base/test/global_file_test.cpp index 6917fb4b8f..461edfdab3 100644 --- a/source/source_base/test/global_file_test.cpp +++ b/source/source_base/test/global_file_test.cpp @@ -33,7 +33,7 @@ TEST_F(GlobalFile,mkdirout) { std::string output; testing::internal::CaptureStdout(); - ModuleBase::Global_File::make_dir_out("Si","m",false,0,true,true); + ModuleBase::Global_File::make_dir_out("Si","m",false,false,0,true,true); output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output,testing::HasSubstr("MAKE THE DIR")); GlobalV::ofs_warning.close(); @@ -43,7 +43,7 @@ TEST_F(GlobalFile,mkdirout) remove(dd.c_str()); testing::internal::CaptureStdout(); - ModuleBase::Global_File::make_dir_out("Si","md",false,0,true,false); + ModuleBase::Global_File::make_dir_out("Si","md",false,false,0,true,false); output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output,testing::HasSubstr("MAKE THE STRU DIR")); EXPECT_TRUE(GlobalV::ofs_running.is_open()); @@ -53,7 +53,7 @@ TEST_F(GlobalFile,mkdirout) remove(bb.c_str()); testing::internal::CaptureStdout(); - ModuleBase::Global_File::make_dir_out("Si","md",true,0,true,true); + ModuleBase::Global_File::make_dir_out("Si","md",true,false,0,true,true); output = testing::internal::GetCapturedStdout(); EXPECT_THAT(output,testing::HasSubstr("MAKE THE MATRIX DIR")); EXPECT_TRUE(GlobalV::ofs_running.is_open()); From 2e16732c08ae839b3129ee43b7ff35d7257b967d Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:30:20 +0800 Subject: [PATCH 70/81] Delete source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt --- .../hamilt_lcaodft/CMakeLists.txt | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt b/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt deleted file mode 100644 index ba00725b73..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -if(ENABLE_LCAO) - add_subdirectory(operator_lcao) - list(APPEND objects - hamilt_lcao.cpp - operator_lcao/operator_lcao.cpp - operator_lcao/veff_lcao.cpp - operator_lcao/meta_lcao.cpp - operator_lcao/op_dftu_lcao.cpp - operator_lcao/deepks_lcao.cpp - operator_lcao/op_exx_lcao.cpp - operator_lcao/overlap_new.cpp - operator_lcao/ekinetic_new.cpp - operator_lcao/nonlocal_new.cpp - operator_lcao/td_ekinetic_lcao.cpp - operator_lcao/td_nonlocal_lcao.cpp - operator_lcao/td_pot_hybrid.cpp - operator_lcao/dspin_lcao.cpp - operator_lcao/dftu_lcao.cpp - pulay_force_stress_center2.cpp - FORCE_STRESS.cpp - FORCE_gamma.cpp - FORCE_k.cpp - stress_tools.cpp - edm.cpp - grid_init.cpp - spar_dh.cpp - spar_exx.cpp - spar_hsr.cpp - spar_st.cpp - spar_u.cpp - LCAO_set_fs.cpp - LCAO_set_st.cpp - LCAO_nl_mu.cpp - LCAO_set_zero.cpp - LCAO_allocate.cpp - LCAO_set_mat2d.cpp - LCAO_init_basis.cpp - record_adj.cpp - center2_orb.cpp - center2_orb-orb11.cpp - center2_orb-orb21.cpp - center2_orb-orb22.cpp - wavefunc_in_pw.cpp - ) - - add_library( - hamilt_lcao - OBJECT - ${objects} - ) - - if(ENABLE_COVERAGE) - add_coverage(hamilt_lcao) - endif() - -endif() From 4fb2038f251d73c692b63a7043dd8d76eaef9586 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:30:53 +0800 Subject: [PATCH 71/81] Delete source/module_hamilt_lcao directory --- source/module_hamilt_lcao/CMakeLists.txt | 6 - .../module_hamilt_lcao/hamilt_lcaodft/FORCE.h | 146 - .../hamilt_lcaodft/FORCE_STRESS.cpp | 1055 ---- .../hamilt_lcaodft/FORCE_STRESS.h | 129 - .../hamilt_lcaodft/FORCE_gamma.cpp | 292 -- .../hamilt_lcaodft/FORCE_k.cpp | 328 -- .../hamilt_lcaodft/LCAO_HS_arrays.hpp | 74 - .../hamilt_lcaodft/LCAO_allocate.cpp | 55 - .../hamilt_lcaodft/LCAO_domain.h | 192 - .../hamilt_lcaodft/LCAO_hamilt.hpp | 152 - .../hamilt_lcaodft/LCAO_init_basis.cpp | 105 - .../hamilt_lcaodft/LCAO_nl_mu.cpp | 585 --- .../hamilt_lcaodft/LCAO_set_fs.cpp | 134 - .../hamilt_lcaodft/LCAO_set_mat2d.cpp | 59 - .../hamilt_lcaodft/LCAO_set_st.cpp | 554 --- .../hamilt_lcaodft/LCAO_set_zero.cpp | 28 - .../hamilt_lcaodft/center2_orb-orb11.cpp | 234 - .../hamilt_lcaodft/center2_orb-orb11.h | 62 - .../hamilt_lcaodft/center2_orb-orb21.cpp | 161 - .../hamilt_lcaodft/center2_orb-orb21.h | 57 - .../hamilt_lcaodft/center2_orb-orb22.cpp | 159 - .../hamilt_lcaodft/center2_orb-orb22.h | 61 - .../hamilt_lcaodft/center2_orb.cpp | 409 -- .../hamilt_lcaodft/center2_orb.h | 69 - .../module_hamilt_lcao/hamilt_lcaodft/edm.cpp | 103 - .../hamilt_lcaodft/force_stress_arrays.h | 72 - .../hamilt_lcaodft/grid_init.cpp | 71 - .../hamilt_lcaodft/hamilt_lcao.cpp | 548 -- .../hamilt_lcaodft/hamilt_lcao.h | 181 - .../hamilt_lcaodft/hs_matrix_k.hpp | 45 - .../operator_lcao/CMakeLists.txt | 27 - .../operator_lcao/deepks_lcao.cpp | 456 -- .../operator_lcao/deepks_lcao.h | 114 - .../hamilt_lcaodft/operator_lcao/dftu.hpp | 18 - .../operator_lcao/dftu_force_stress.hpp | 449 -- .../operator_lcao/dftu_lcao.cpp | 551 -- .../hamilt_lcaodft/operator_lcao/dftu_lcao.h | 142 - .../operator_lcao/dspin_force_stress.hpp | 394 -- .../operator_lcao/dspin_lcao.cpp | 533 -- .../hamilt_lcaodft/operator_lcao/dspin_lcao.h | 161 - .../operator_lcao/ekinetic_new.cpp | 256 - .../operator_lcao/ekinetic_new.h | 103 - .../operator_lcao/meta_lcao.cpp | 15 - .../hamilt_lcaodft/operator_lcao/meta_lcao.h | 44 - .../operator_lcao/nonlocal_force_stress.hpp | 469 -- .../operator_lcao/nonlocal_new.cpp | 330 -- .../operator_lcao/nonlocal_new.h | 136 - .../operator_lcao/op_dftu_lcao.cpp | 77 - .../operator_lcao/op_dftu_lcao.h | 43 - .../operator_lcao/op_exx_lcao.cpp | 41 - .../operator_lcao/op_exx_lcao.h | 95 - .../operator_lcao/op_exx_lcao.hpp | 397 -- .../operator_lcao/operator_lcao.cpp | 296 -- .../operator_lcao/operator_lcao.h | 135 - .../operator_lcao/overlap_new.cpp | 271 - .../operator_lcao/overlap_new.h | 95 - .../operator_lcao/td_ekinetic_lcao.cpp | 406 -- .../operator_lcao/td_ekinetic_lcao.h | 126 - .../operator_lcao/td_nonlocal_lcao.cpp | 447 -- .../operator_lcao/td_nonlocal_lcao.h | 108 - .../operator_lcao/td_pot_hybrid.cpp | 300 -- .../operator_lcao/td_pot_hybrid.h | 129 - .../operator_lcao/test/CMakeLists.txt | 71 - .../test/parallel_operator_tests.sh | 26 - .../operator_lcao/test/test_T_NL_cd.cpp | 260 - .../operator_lcao/test/test_dftu.cpp | 279 -- .../operator_lcao/test/test_ekineticnew.cpp | 202 - .../operator_lcao/test/test_nonlocalnew.cpp | 250 - .../operator_lcao/test/test_overlapnew.cpp | 186 - .../operator_lcao/test/test_overlapnew_cd.cpp | 191 - .../operator_lcao/test/tmp_mocks.cpp | 206 - .../operator_lcao/veff_lcao.cpp | 211 - .../hamilt_lcaodft/operator_lcao/veff_lcao.h | 116 - .../hamilt_lcaodft/pulay_force_stress.h | 69 - .../pulay_force_stress_center2.cpp | 129 - .../pulay_force_stress_center2_template.hpp | 128 - .../pulay_force_stress_gint.hpp | 65 - .../hamilt_lcaodft/record_adj.cpp | 508 -- .../hamilt_lcaodft/record_adj.h | 66 - .../hamilt_lcaodft/spar_dh.cpp | 333 -- .../hamilt_lcaodft/spar_dh.h | 51 - .../hamilt_lcaodft/spar_exx.cpp | 4 - .../hamilt_lcaodft/spar_exx.h | 30 - .../hamilt_lcaodft/spar_hsr.cpp | 454 -- .../hamilt_lcaodft/spar_hsr.h | 80 - .../hamilt_lcaodft/spar_st.cpp | 208 - .../hamilt_lcaodft/spar_st.h | 37 - .../hamilt_lcaodft/spar_u.cpp | 247 - .../hamilt_lcaodft/spar_u.h | 31 - .../hamilt_lcaodft/stress_tools.cpp | 20 - .../hamilt_lcaodft/stress_tools.h | 8 - .../hamilt_lcaodft/wavefunc_in_pw.cpp | 472 -- .../hamilt_lcaodft/wavefunc_in_pw.h | 47 - .../module_deepks/CMakeLists.txt | 37 - .../module_deepks/LCAO_deepks.cpp | 267 - .../module_deepks/LCAO_deepks.h | 169 - .../module_deepks/LCAO_deepks_interface.cpp | 682 --- .../module_deepks/LCAO_deepks_interface.h | 59 - .../module_deepks/LCAO_deepks_io.cpp | 330 -- .../module_deepks/LCAO_deepks_io.h | 82 - .../module_deepks/deepks_basic.cpp | 279 -- .../module_deepks/deepks_basic.h | 66 - .../module_deepks/deepks_check.cpp | 65 - .../module_deepks/deepks_check.h | 27 - .../module_deepks/deepks_descriptor.cpp | 145 - .../module_deepks/deepks_descriptor.h | 52 - .../module_deepks/deepks_force.cpp | 294 -- .../module_deepks/deepks_force.h | 44 - .../module_deepks/deepks_fpre.cpp | 225 - .../module_deepks/deepks_fpre.h | 66 - .../module_deepks/deepks_iterate.cpp | 179 - .../module_deepks/deepks_iterate.h | 59 - .../module_deepks/deepks_orbital.cpp | 76 - .../module_deepks/deepks_orbital.h | 37 - .../module_deepks/deepks_orbpre.cpp | 331 -- .../module_deepks/deepks_orbpre.h | 46 - .../module_deepks/deepks_pdm.cpp | 524 -- .../module_deepks/deepks_pdm.h | 75 - .../module_deepks/deepks_phialpha.cpp | 341 -- .../module_deepks/deepks_phialpha.h | 53 - .../module_deepks/deepks_spre.cpp | 233 - .../module_deepks/deepks_spre.h | 58 - .../module_deepks/deepks_vdelta.cpp | 217 - .../module_deepks/deepks_vdelta.h | 52 - .../module_deepks/deepks_vdpre.cpp | 356 -- .../module_deepks/deepks_vdpre.h | 75 - .../module_deepks/deepks_vdrpre.cpp | 280 -- .../module_deepks/deepks_vdrpre.h | 66 - .../module_deepks/test/CMakeLists.txt | 57 - .../module_deepks/test/LCAO_deepks_test.cpp | 503 -- .../module_deepks/test/LCAO_deepks_test.h | 115 - .../test/LCAO_deepks_test_prep.cpp | 232 - .../module_deepks/test/Makefile | 101 - .../module_deepks/test/Makefile.Objects | 76 - .../module_deepks/test/klist.h | 72 - .../module_deepks/test/klist_1.cpp | 605 --- .../module_deepks/test/main_deepks.cpp | 97 - .../module_deepks/test/parallel_orbitals.h | 25 - .../module_deltaspin/CMakeLists.txt | 27 - .../module_deltaspin/basic_funcs.cpp | 149 - .../module_deltaspin/basic_funcs.h | 69 - .../module_deltaspin/cal_mw.cpp | 171 - .../module_deltaspin/cal_mw_from_lambda.cpp | 539 -- .../module_deltaspin/init_sc.cpp | 37 - .../module_deltaspin/lambda_loop.cpp | 278 -- .../module_deltaspin/lambda_loop_helper.cpp | 183 - .../module_deltaspin/spin_constrain.cpp | 606 --- .../module_deltaspin/spin_constrain.h | 276 - .../module_deltaspin/template_helpers.cpp | 63 - .../module_deltaspin/test/CMakeLists.txt | 25 - .../module_deltaspin/test/basic_test.cpp | 194 - .../test/lambda_loop_helper_test.cpp | 163 - .../module_deltaspin/test/prepare_unitcell.h | 284 -- .../test/spin_constrain_test.cpp | 192 - .../test/template_helpers_test.cpp | 42 - .../module_dftu/CMakeLists.txt | 21 - .../module_hamilt_lcao/module_dftu/dftu.cpp | 472 -- source/module_hamilt_lcao/module_dftu/dftu.h | 322 -- .../module_dftu/dftu_folding.cpp | 319 -- .../module_dftu/dftu_force.cpp | 665 --- .../module_dftu/dftu_hamilt.cpp | 172 - .../module_dftu/dftu_io.cpp | 516 -- .../module_dftu/dftu_occup.cpp | 565 --- .../module_dftu/dftu_pw.cpp | 212 - .../module_dftu/dftu_tools.cpp | 216 - .../module_dftu/dftu_yukawa.cpp | 310 -- .../module_gint/CMakeLists.txt | 121 - .../module_gint/cal_ddpsir_ylm.cpp | 316 -- .../module_gint/cal_dpsir_ylm.cpp | 138 - .../module_gint/cal_psir_ylm.cpp | 113 - source/module_hamilt_lcao/module_gint/gint.h | 275 - .../module_gint/gint_force_cpu_interface.cpp | 313 -- .../module_gint/gint_force_gpu.cu | 301 -- .../module_gint/gint_force_gpu.h | 55 - .../module_gint/gint_fvl_old.cpp | 76 - .../module_gint/gint_gamma.h | 51 - .../module_gint/gint_gamma_env.cpp | 101 - .../module_gint/gint_gamma_vl.cpp | 96 - .../module_gint/gint_gpu_interface.cpp | 108 - .../module_hamilt_lcao/module_gint/gint_k.h | 86 - .../module_gint/gint_k_env.cpp | 138 - .../module_gint/gint_k_pvdpr.cpp | 53 - .../module_gint/gint_k_pvpr.cpp | 163 - .../module_gint/gint_k_sparse1.cpp | 554 --- .../module_gint/gint_old.cpp | 298 -- .../module_gint/gint_rho_cpu_interface.cpp | 197 - .../module_gint/gint_rho_gpu.cu | 234 - .../module_gint/gint_rho_gpu.h | 68 - .../module_gint/gint_rho_old.cpp | 28 - .../module_gint/gint_tau_old.cpp | 38 - .../module_gint/gint_tools.cpp | 234 - .../module_gint/gint_tools.h | 311 -- .../module_gint/gint_vl_cpu_interface.cpp | 265 - .../module_gint/gint_vl_gpu.cu | 219 - .../module_gint/gint_vl_gpu.h | 53 - .../module_gint/gint_vl_old.cpp | 95 - .../module_gint/grid_bigcell.cpp | 363 -- .../module_gint/grid_bigcell.h | 59 - .../module_gint/grid_meshball.cpp | 142 - .../module_gint/grid_meshball.h | 32 - .../module_gint/grid_meshcell.cpp | 168 - .../module_gint/grid_meshcell.h | 56 - .../module_gint/grid_meshk.cpp | 101 - .../module_gint/grid_meshk.h | 48 - .../module_gint/grid_technique.cpp | 784 --- .../module_gint/grid_technique.h | 172 - .../module_gint/gtask_force.cpp | 152 - .../module_gint/gtask_rho.cpp | 155 - .../module_gint/gtask_vl.cpp | 154 - .../module_gint/init_orb.cpp | 62 - .../module_gint/kernels/cuda/code_gen.cpp | 4426 ----------------- .../module_gint/kernels/cuda/code_gen.cuh | 473 -- .../module_gint/kernels/cuda/code_gen_00.cu | 48 - .../module_gint/kernels/cuda/code_gen_01.cu | 48 - .../module_gint/kernels/cuda/code_gen_02.cu | 48 - .../module_gint/kernels/cuda/code_gen_03.cu | 48 - .../module_gint/kernels/cuda/code_gen_04.cu | 48 - .../module_gint/kernels/cuda/code_gen_05.cu | 48 - .../module_gint/kernels/cuda/code_gen_06.cu | 48 - .../module_gint/kernels/cuda/code_gen_07.cu | 48 - .../module_gint/kernels/cuda/code_gen_08.cu | 48 - .../module_gint/kernels/cuda/code_gen_09.cu | 53 - .../module_gint/kernels/cuda/cuda_tools.cu | 292 -- .../module_gint/kernels/cuda/cuda_tools.cuh | 123 - .../module_gint/kernels/cuda/gemm_selector.cu | 138 - .../kernels/cuda/gemm_selector.cuh | 12 - .../module_gint/kernels/cuda/gint_force.cu | 225 - .../module_gint/kernels/cuda/gint_force.cuh | 46 - .../module_gint/kernels/cuda/gint_rho.cu | 130 - .../module_gint/kernels/cuda/gint_rho.cuh | 41 - .../module_gint/kernels/cuda/gint_vl.cu | 75 - .../module_gint/kernels/cuda/gint_vl.cuh | 40 - .../module_gint/kernels/cuda/interp.cuh | 204 - .../module_gint/kernels/cuda/sph.cuh | 519 -- .../kernels/cuda/vbatch_matrix_mul.cuh | 545 -- .../module_gint/mult_psi_dmr.cpp | 105 - .../module_gint/temp_gint/batch_biggrid.cpp | 34 - .../module_gint/temp_gint/batch_biggrid.h | 50 - .../module_gint/temp_gint/big_grid.cpp | 118 - .../module_gint/temp_gint/big_grid.h | 95 - .../module_gint/temp_gint/biggrid_info.cpp | 66 - .../module_gint/temp_gint/biggrid_info.h | 99 - .../module_gint/temp_gint/divide_info.cpp | 24 - .../module_gint/temp_gint/divide_info.h | 54 - .../module_gint/temp_gint/gint.cpp | 8 - .../module_gint/temp_gint/gint.h | 26 - .../module_gint/temp_gint/gint_atom.cpp | 197 - .../module_gint/temp_gint/gint_atom.h | 122 - .../module_gint/temp_gint/gint_common.cpp | 343 -- .../module_gint/temp_gint/gint_common.h | 24 - .../module_gint/temp_gint/gint_dvlocal.cpp | 271 - .../module_gint/temp_gint/gint_dvlocal.h | 65 - .../module_gint/temp_gint/gint_env_gamma.cpp | 48 - .../module_gint/temp_gint/gint_env_gamma.h | 32 - .../module_gint/temp_gint/gint_env_k.cpp | 54 - .../module_gint/temp_gint/gint_env_k.h | 44 - .../module_gint/temp_gint/gint_fvl.cpp | 98 - .../module_gint/temp_gint/gint_fvl.h | 52 - .../module_gint/temp_gint/gint_fvl_gpu.cpp | 134 - .../module_gint/temp_gint/gint_fvl_gpu.h | 61 - .../module_gint/temp_gint/gint_fvl_meta.cpp | 135 - .../module_gint/temp_gint/gint_fvl_meta.h | 53 - .../temp_gint/gint_fvl_meta_gpu.cpp | 182 - .../module_gint/temp_gint/gint_fvl_meta_gpu.h | 64 - .../module_gint/temp_gint/gint_helper.h | 61 - .../module_gint/temp_gint/gint_info.cpp | 284 -- .../module_gint/temp_gint/gint_info.h | 117 - .../module_gint/temp_gint/gint_interface.cpp | 200 - .../module_gint/temp_gint/gint_interface.h | 71 - .../module_gint/temp_gint/gint_rho.cpp | 57 - .../module_gint/temp_gint/gint_rho.h | 44 - .../module_gint/temp_gint/gint_rho_gpu.cpp | 86 - .../module_gint/temp_gint/gint_rho_gpu.h | 52 - .../module_gint/temp_gint/gint_tau.cpp | 68 - .../module_gint/temp_gint/gint_tau.h | 38 - .../module_gint/temp_gint/gint_tau_gpu.cpp | 98 - .../module_gint/temp_gint/gint_tau_gpu.h | 47 - .../module_gint/temp_gint/gint_type.h | 15 - .../module_gint/temp_gint/gint_vl.cpp | 55 - .../module_gint/temp_gint/gint_vl.h | 42 - .../module_gint/temp_gint/gint_vl_gpu.cpp | 73 - .../module_gint/temp_gint/gint_vl_gpu.h | 49 - .../module_gint/temp_gint/gint_vl_metagga.cpp | 73 - .../module_gint/temp_gint/gint_vl_metagga.h | 45 - .../temp_gint/gint_vl_metagga_gpu.cpp | 98 - .../temp_gint/gint_vl_metagga_gpu.h | 53 - .../temp_gint/gint_vl_metagga_nspin4.cpp | 80 - .../temp_gint/gint_vl_metagga_nspin4.h | 43 - .../temp_gint/gint_vl_metagga_nspin4_gpu.cpp | 113 - .../temp_gint/gint_vl_metagga_nspin4_gpu.h | 52 - .../module_gint/temp_gint/gint_vl_nspin4.cpp | 61 - .../module_gint/temp_gint/gint_vl_nspin4.h | 45 - .../temp_gint/gint_vl_nspin4_gpu.cpp | 91 - .../temp_gint/gint_vl_nspin4_gpu.h | 53 - .../temp_gint/kernel/cuda_mem_wrapper.h | 171 - .../temp_gint/kernel/dgemm_vbatch.cu | 38 - .../temp_gint/kernel/dgemm_vbatch.h | 23 - .../temp_gint/kernel/gemm_nn_vbatch.cuh | 427 -- .../temp_gint/kernel/gemm_tn_vbatch.cuh | 452 -- .../temp_gint/kernel/gint_gpu_vars.cpp | 126 - .../temp_gint/kernel/gint_gpu_vars.h | 46 - .../temp_gint/kernel/gint_helper.cuh | 75 - .../temp_gint/kernel/phi_operator_gpu.cu | 466 -- .../temp_gint/kernel/phi_operator_gpu.h | 110 - .../temp_gint/kernel/phi_operator_kernel.cu | 580 --- .../temp_gint/kernel/phi_operator_kernel.cuh | 135 - .../temp_gint/kernel/set_const_mem.cu | 13 - .../temp_gint/kernel/set_const_mem.cuh | 7 - .../module_gint/temp_gint/kernel/sph.cuh | 396 -- .../module_gint/temp_gint/localcell_info.cpp | 119 - .../module_gint/temp_gint/localcell_info.h | 126 - .../module_gint/temp_gint/meshgrid_info.h | 64 - .../module_gint/temp_gint/phi_operator.cpp | 253 - .../module_gint/temp_gint/phi_operator.h | 167 - .../module_gint/temp_gint/phi_operator.hpp | 188 - .../module_gint/temp_gint/set_ddphi.cpp | 237 - .../module_gint/temp_gint/unitcell_info.cpp | 29 - .../module_gint/temp_gint/unitcell_info.h | 172 - .../module_gint/test/CMakeLists.txt | 7 - .../module_gint/test/test_sph.cpp | 597 --- .../module_gint/test/test_sph.cu | 139 - .../module_gint/test/test_sph.h | 19 - .../module_hcontainer/CMakeLists.txt | 29 - .../module_hcontainer/atom_pair.cpp | 873 ---- .../module_hcontainer/atom_pair.h | 332 -- .../module_hcontainer/base_matrix.cpp | 205 - .../module_hcontainer/base_matrix.h | 142 - .../module_hcontainer/func_folding.cpp | 139 - .../module_hcontainer/func_transfer.cpp | 663 --- .../module_hcontainer/hcontainer.cpp | 862 ---- .../module_hcontainer/hcontainer.h | 507 -- .../module_hcontainer/hcontainer_funcs.h | 82 - .../module_hcontainer/output_hcontainer.cpp | 138 - .../module_hcontainer/output_hcontainer.h | 41 - .../module_hcontainer/test/CMakeLists.txt | 74 - .../test/parallel_hcontainer_tests.sh | 17 - .../module_hcontainer/test/prepare_unitcell.h | 384 -- .../module_hcontainer/test/support/SR.csr | 375 -- .../test/test_func_folding.cpp | 213 - .../test/test_hcontainer.cpp | 673 --- .../test/test_hcontainer_complex.cpp | 576 --- .../test/test_hcontainer_output.cpp | 159 - .../test/test_hcontainer_readCSR.cpp | 168 - .../test/test_hcontainer_time.cpp | 157 - .../module_hcontainer/test/test_transfer.cpp | 413 -- .../module_hcontainer/test/tmp_mocks.cpp | 64 - .../module_hcontainer/transfer.cpp | 672 --- .../module_hcontainer/transfer.h | 184 - .../module_tddft/CMakeLists.txt | 36 - .../module_tddft/band_energy.cpp | 429 -- .../module_tddft/band_energy.h | 53 - .../module_tddft/evolve_elec.cpp | 226 - .../module_tddft/evolve_elec.h | 185 - .../module_tddft/evolve_psi.cpp | 352 -- .../module_tddft/evolve_psi.h | 47 - .../module_tddft/middle_hamilt.cpp | 290 -- .../module_tddft/middle_hamilt.h | 62 - .../module_tddft/norm_psi.cpp | 671 --- .../module_tddft/norm_psi.h | 56 - .../module_tddft/propagator.cpp | 107 - .../module_tddft/propagator.h | 222 - .../module_tddft/propagator_cn2.cpp | 734 --- .../module_tddft/propagator_etrs.cpp | 50 - .../module_tddft/propagator_taylor.cpp | 343 -- .../module_tddft/snap_psibeta_half_tddft.cpp | 247 - .../module_tddft/snap_psibeta_half_tddft.h | 31 - .../module_tddft/solve_propagation.cpp | 114 - .../module_tddft/solve_propagation.h | 34 - .../module_tddft/td_folding.cpp | 53 - .../module_tddft/td_info.cpp | 227 - .../module_hamilt_lcao/module_tddft/td_info.h | 108 - .../module_tddft/test/CMakeLists.txt | 36 - .../module_tddft/test/band_energy_test.cpp | 99 - .../module_tddft/test/middle_hamilt_test.cpp | 149 - .../module_tddft/test/norm_psi_test.cpp | 123 - .../module_tddft/test/propagator_test1.cpp | 114 - .../module_tddft/test/propagator_test2.cpp | 119 - .../module_tddft/test/propagator_test3.cpp | 124 - .../module_tddft/test/tddft_test.cpp | 51 - .../module_tddft/test/tddft_test.h | 49 - .../module_tddft/test/upsi_test1.cpp | 76 - .../module_tddft/test/upsi_test2.cpp | 70 - .../module_tddft/test/upsi_test3.cpp | 87 - .../module_hamilt_lcao/module_tddft/upsi.cpp | 271 - source/module_hamilt_lcao/module_tddft/upsi.h | 60 - .../module_tddft/velocity_op.cpp | 532 -- .../module_tddft/velocity_op.h | 79 - 387 files changed, 73475 deletions(-) delete mode 100644 source/module_hamilt_lcao/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/FORCE.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_allocate.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_hamilt.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_init_basis.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_nl_mu.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_fs.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_mat2d.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_st.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_zero.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/edm.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/grid_init.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_force_stress.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_force_stress.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_force_stress.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/parallel_operator_tests.sh delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_T_NL_cd.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_dftu.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_ekineticnew.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_nonlocalnew.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew_cd.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2_template.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_gint.hpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/record_adj.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/record_adj.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_st.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_st.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_u.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/spar_u.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.h delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.cpp delete mode 100644 source/module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.h delete mode 100644 source/module_hamilt_lcao/module_deepks/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/LCAO_deepks.h delete mode 100644 source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.h delete mode 100644 source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_basic.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_basic.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_check.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_check.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_descriptor.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_descriptor.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_force.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_force.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_fpre.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_fpre.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_iterate.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_iterate.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_orbital.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_orbital.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_orbpre.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_orbpre.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_pdm.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_pdm.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_phialpha.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_phialpha.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_spre.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_spre.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_vdelta.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_vdelta.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_vdpre.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_vdpre.h delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_vdrpre.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/deepks_vdrpre.h delete mode 100644 source/module_hamilt_lcao/module_deepks/test/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.h delete mode 100644 source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test_prep.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/test/Makefile delete mode 100644 source/module_hamilt_lcao/module_deepks/test/Makefile.Objects delete mode 100644 source/module_hamilt_lcao/module_deepks/test/klist.h delete mode 100644 source/module_hamilt_lcao/module_deepks/test/klist_1.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/test/main_deepks.cpp delete mode 100644 source/module_hamilt_lcao/module_deepks/test/parallel_orbitals.h delete mode 100644 source/module_hamilt_lcao/module_deltaspin/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_deltaspin/basic_funcs.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/basic_funcs.h delete mode 100644 source/module_hamilt_lcao/module_deltaspin/cal_mw.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/cal_mw_from_lambda.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/init_sc.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/lambda_loop.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/lambda_loop_helper.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/spin_constrain.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/spin_constrain.h delete mode 100644 source/module_hamilt_lcao/module_deltaspin/template_helpers.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/test/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_deltaspin/test/basic_test.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/test/lambda_loop_helper_test.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/test/prepare_unitcell.h delete mode 100644 source/module_hamilt_lcao/module_deltaspin/test/spin_constrain_test.cpp delete mode 100644 source/module_hamilt_lcao/module_deltaspin/test/template_helpers_test.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu.h delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_folding.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_force.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_hamilt.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_io.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_occup.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_pw.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_tools.cpp delete mode 100644 source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_gint/cal_ddpsir_ylm.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/cal_dpsir_ylm.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/cal_psir_ylm.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_force_cpu_interface.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_force_gpu.cu delete mode 100644 source/module_hamilt_lcao/module_gint/gint_force_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_fvl_old.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_gamma.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_gamma_env.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_gamma_vl.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_gpu_interface.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_k.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_k_env.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_k_pvdpr.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_k_pvpr.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_k_sparse1.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_old.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_rho_cpu_interface.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_rho_gpu.cu delete mode 100644 source/module_hamilt_lcao/module_gint/gint_rho_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_rho_old.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_tau_old.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_tools.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_tools.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_vl_cpu_interface.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu delete mode 100644 source/module_hamilt_lcao/module_gint/gint_vl_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/gint_vl_old.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/grid_bigcell.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/grid_bigcell.h delete mode 100644 source/module_hamilt_lcao/module_gint/grid_meshball.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/grid_meshball.h delete mode 100644 source/module_hamilt_lcao/module_gint/grid_meshcell.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/grid_meshcell.h delete mode 100644 source/module_hamilt_lcao/module_gint/grid_meshk.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/grid_meshk.h delete mode 100644 source/module_hamilt_lcao/module_gint/grid_technique.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/grid_technique.h delete mode 100644 source/module_hamilt_lcao/module_gint/gtask_force.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gtask_rho.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/gtask_vl.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/init_orb.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_00.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_01.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_02.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_03.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_04.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_05.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_06.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_07.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_08.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_09.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cu delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/interp.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/sph.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/kernels/cuda/vbatch_matrix_mul.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/mult_psi_dmr.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/big_grid.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/big_grid.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/divide_info.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/divide_info.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_common.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_common.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_helper.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_info.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_info.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_type.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.cu delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_nn_vbatch.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_tn_vbatch.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_helper.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.cu delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cu delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cu delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/kernel/sph.cuh delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/meshgrid_info.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.h delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.hpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/set_ddphi.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.h delete mode 100644 source/module_hamilt_lcao/module_gint/test/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_gint/test/test_sph.cpp delete mode 100644 source/module_hamilt_lcao/module_gint/test/test_sph.cu delete mode 100644 source/module_hamilt_lcao/module_gint/test/test_sph.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_hcontainer/atom_pair.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/atom_pair.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/base_matrix.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/base_matrix.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/func_folding.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/func_transfer.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/hcontainer.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/hcontainer.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/output_hcontainer.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/output_hcontainer.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/parallel_hcontainer_tests.sh delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/prepare_unitcell.h delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/support/SR.csr delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_func_folding.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_complex.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_output.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_readCSR.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_time.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/test_transfer.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/test/tmp_mocks.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/transfer.cpp delete mode 100644 source/module_hamilt_lcao/module_hcontainer/transfer.h delete mode 100644 source/module_hamilt_lcao/module_tddft/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_tddft/band_energy.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/band_energy.h delete mode 100644 source/module_hamilt_lcao/module_tddft/evolve_elec.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/evolve_elec.h delete mode 100644 source/module_hamilt_lcao/module_tddft/evolve_psi.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/evolve_psi.h delete mode 100644 source/module_hamilt_lcao/module_tddft/middle_hamilt.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/middle_hamilt.h delete mode 100644 source/module_hamilt_lcao/module_tddft/norm_psi.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/norm_psi.h delete mode 100644 source/module_hamilt_lcao/module_tddft/propagator.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/propagator.h delete mode 100644 source/module_hamilt_lcao/module_tddft/propagator_cn2.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/propagator_etrs.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/propagator_taylor.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h delete mode 100644 source/module_hamilt_lcao/module_tddft/solve_propagation.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/solve_propagation.h delete mode 100644 source/module_hamilt_lcao/module_tddft/td_folding.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/td_info.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/td_info.h delete mode 100644 source/module_hamilt_lcao/module_tddft/test/CMakeLists.txt delete mode 100644 source/module_hamilt_lcao/module_tddft/test/band_energy_test.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/middle_hamilt_test.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/norm_psi_test.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/propagator_test1.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/propagator_test2.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/propagator_test3.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/tddft_test.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/tddft_test.h delete mode 100644 source/module_hamilt_lcao/module_tddft/test/upsi_test1.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/upsi_test2.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/test/upsi_test3.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/upsi.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/upsi.h delete mode 100644 source/module_hamilt_lcao/module_tddft/velocity_op.cpp delete mode 100644 source/module_hamilt_lcao/module_tddft/velocity_op.h diff --git a/source/module_hamilt_lcao/CMakeLists.txt b/source/module_hamilt_lcao/CMakeLists.txt deleted file mode 100644 index 116cccbec9..0000000000 --- a/source/module_hamilt_lcao/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(hamilt_lcaodft) -add_subdirectory(module_tddft) -add_subdirectory(module_deepks) -add_subdirectory(module_dftu) -add_subdirectory(module_hcontainer) -add_subdirectory(module_deltaspin) diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE.h b/source/module_hamilt_lcao/hamilt_lcaodft/FORCE.h deleted file mode 100644 index 9466074571..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_FORCE_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_FORCE_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/matrix.h" -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_estate/elecstate.h" -#include "source_estate/module_dm/density_matrix.h" -#include "source_estate/module_pot/potential_new.h" -#include "module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h" -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "source_psi/psi.h" - -#ifndef TGINT_H -#define TGINT_H -template -struct TGint; -template <> -struct TGint -{ - using type = Gint_Gamma; -}; -template <> -struct TGint> -{ - using type = Gint_k; -}; -#endif - -template -class Force_Stress_LCAO; - -template -class Force_LCAO -{ - public: - friend class Force_Stress_LCAO; - - Force_LCAO(){}; - ~Force_LCAO(){}; - - private: - const Parallel_Orbitals* ParaV; - - elecstate::Potential* pot; - - // orthonormal force + contribution from T and VNL - void ftable(const bool isforce, - const bool isstress, - ForceStressArrays& fsr, // mohan add 2024-06-16 - const UnitCell& ucell, - const Grid_Driver& gd, - const psi::Psi* psi, - const elecstate::ElecState* pelec, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& fvnl_dbeta, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& soverlap, - ModuleBase::matrix& stvnl_dphi, - ModuleBase::matrix& svnl_dbeta, - ModuleBase::matrix& svl_dphi, -#ifdef __MLALGO - ModuleBase::matrix& fvnl_dalpha, - ModuleBase::matrix& svnl_dalpha, - LCAO_Deepks& ld, -#endif - typename TGint::type& gint, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const K_Vectors* kv = nullptr, - Record_adj* ra = nullptr); - - // get the ds, dt, dvnl. - void allocate(const UnitCell& ucell, - const Grid_Driver& gd, - const Parallel_Orbitals& pv, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const int& nks = 0, - const std::vector>& kvec_d = {}); - - void finish_ftable(ForceStressArrays& fsr); - - void average_force(double* fm); - - // void test(Parallel_Orbitals& pv, double* mm, const std::string& name); - - //------------------------------------------------------------- - // forces reated to overlap matrix - // forces related to energy density matrix - //------------------------------------------------------------- - - void cal_fedm(const bool isforce, - const bool isstress, - ForceStressArrays& fsr, - const UnitCell& ucell, - const elecstate::DensityMatrix& dm, - const psi::Psi* psi, - const Parallel_Orbitals& pv, - const elecstate::ElecState* pelec, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& soverlap, - const K_Vectors* kv = nullptr, - Record_adj* ra = nullptr); - - //------------------------------------------------------------- - // forces related to kinetic and non-local pseudopotentials - //-------------------------------------------------------------- - void cal_ftvnl_dphi(const elecstate::DensityMatrix* dm, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - ForceStressArrays& fsr, - const bool isforce, - const bool isstress, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& stvnl_dphi, - Record_adj* ra = nullptr); - - //------------------------------------------- - // forces related to local pseudopotentials - //------------------------------------------- - void cal_fvl_dphi(const bool isforce, - const bool isstress, - const elecstate::Potential* pot_in, - typename TGint::type& gint, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& svl_dphi); - - elecstate::DensityMatrix cal_edm(const elecstate::ElecState* pelec, - const psi::Psi& psi, - const elecstate::DensityMatrix& dm, - const K_Vectors& kv, - const Parallel_Orbitals& pv, - const int& nspin, - const int& nbands, - const UnitCell& ucell, - Record_adj& ra) const; -}; - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp deleted file mode 100644 index 574136bf09..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp +++ /dev/null @@ -1,1055 +0,0 @@ -#include "FORCE_STRESS.h" - -#include "module_hamilt_lcao/module_dftu/dftu.h" //Quxin add for DFT+U on 20201029 -#include "source_pw/hamilt_pwdft/global.h" -#include "module_io/output_log.h" -#include "module_parameter/parameter.h" -// new -#include "source_base/timer.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/elecstate_lcao.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" // Taoni add 2025-02-20 -#include "source_estate/module_pot/efield.h" // liuyu add 2022-05-18 -#include "source_estate/module_pot/gatefield.h" // liuyu add 2022-09-13 -#include "source_hamilt/module_surchem/surchem.h" //sunml add 2022-08-10 -#include "source_hamilt/module_vdw/vdw.h" -#include "module_parameter/parameter.h" -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" //caoyu add for deepks 2021-06-03 -#include "module_hamilt_lcao/module_deepks/LCAO_deepks_io.h" // mohan add 2024-07-22 -#endif -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h" - -template -Force_Stress_LCAO::Force_Stress_LCAO(Record_adj& ra, const int nat_in) : RA(&ra), f_pw(nat_in), nat(nat_in) -{ -} -template -Force_Stress_LCAO::~Force_Stress_LCAO() -{ -} -template -void Force_Stress_LCAO::getForceStress(UnitCell& ucell, - const bool isforce, - const bool isstress, - const bool istestf, - const bool istests, - const Grid_Driver& gd, - Parallel_Orbitals& pv, - const elecstate::ElecState* pelec, - const psi::Psi* psi, - Gint_Gamma& gint_gamma, // mohan add 2024-04-01 - Gint_k& gint_k, // mohan add 2024-04-01 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - ModuleBase::matrix& fcs, - ModuleBase::matrix& scs, - const pseudopot_cell_vl& locpp, - const Structure_Factor& sf, - const K_Vectors& kv, - ModulePW::PW_Basis* rhopw, - surchem& solvent, -#ifdef __MLALGO - LCAO_Deepks& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface& exd, - Exx_LRI_Interface>& exc, -#endif - ModuleSymmetry::Symmetry* symm) -{ - ModuleBase::TITLE("Force_Stress_LCAO", "getForceStress"); - ModuleBase::timer::tick("Force_Stress_LCAO", "getForceStress"); - - if (!isforce && !isstress) - { - ModuleBase::timer::tick("Force_Stress_LCAO", "getForceStress"); - return; - } - - const int nat = ucell.nat; - - ForceStressArrays fsr; // mohan add 2024-06-15 - - // total force : ModuleBase::matrix fcs; - - // part of total force - ModuleBase::matrix foverlap; - ModuleBase::matrix ftvnl_dphi; - ModuleBase::matrix fvnl_dbeta; - ModuleBase::matrix fvl_dphi; - ModuleBase::matrix fvl_dvl; - ModuleBase::matrix fewalds; - ModuleBase::matrix fcc; - ModuleBase::matrix fscc; -#ifdef __MLALGO - ModuleBase::matrix fvnl_dalpha; // deepks -#endif - - fvl_dphi.create(nat, 3); // must do it now, update it later, noted by zhengdy - - if (isforce) - { - fcs.create(nat, 3); - foverlap.create(nat, 3); - ftvnl_dphi.create(nat, 3); - fvnl_dbeta.create(nat, 3); - fvl_dvl.create(nat, 3); - fewalds.create(nat, 3); - fcc.create(nat, 3); - fscc.create(nat, 3); -#ifdef __MLALGO - fvnl_dalpha.create(nat, 3); // deepks -#endif - - // calculate basic terms in Force, same method with PW base - this->calForcePwPart(ucell, - fvl_dvl, - fewalds, - fcc, - fscc, - pelec->f_en.etxc, - pelec->vnew, - pelec->vnew_exist, - pelec->charge, - rhopw, - locpp, - sf); - } - - // total stress : ModuleBase::matrix scs - ModuleBase::matrix sigmacc; - ModuleBase::matrix sigmadvl; - ModuleBase::matrix sigmaewa; - ModuleBase::matrix sigmaxc; - ModuleBase::matrix sigmahar; - ModuleBase::matrix soverlap; - ModuleBase::matrix stvnl_dphi; - ModuleBase::matrix svnl_dbeta; - ModuleBase::matrix svl_dphi; -#ifdef __MLALGO - ModuleBase::matrix svnl_dalpha; // deepks -#endif - - //! stress - if (isstress) - { - scs.create(3, 3); - sigmacc.create(3, 3); - sigmadvl.create(3, 3); - sigmaewa.create(3, 3); - sigmaxc.create(3, 3); - sigmahar.create(3, 3); - - soverlap.create(3, 3); - stvnl_dphi.create(3, 3); - svnl_dbeta.create(3, 3); - svl_dphi.create(3, 3); -#ifdef __MLALGO - svnl_dalpha.create(3, 3); -#endif - // calculate basic terms in Stress, similar method with PW base - this->calStressPwPart(ucell, - sigmadvl, - sigmahar, - sigmaewa, - sigmacc, - sigmaxc, - pelec->f_en.etxc, - pelec->charge, - rhopw, - locpp, - sf); - } - - //! atomic forces from integration (4 terms) - this->integral_part(PARAM.globalv.gamma_only_local, - isforce, - isstress, - ucell, - gd, - fsr, - pelec, - psi, - foverlap, - ftvnl_dphi, - fvnl_dbeta, - fvl_dphi, - soverlap, - stvnl_dphi, - svnl_dbeta, - svl_dphi, -#ifdef __MLALGO - fvnl_dalpha, - svnl_dalpha, - ld, -#endif - gint_gamma, - gint_k, - two_center_bundle, - orb, - pv, - kv); - // calculate force and stress for Nonlocal part - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - hamilt::NonlocalNew> tmp_nonlocal(nullptr, - kv.kvec_d, - nullptr, - &ucell, - orb.cutoffs(), - &gd, - two_center_bundle.overlap_orb_beta.get()); - - const auto* dm_p = dynamic_cast*>(pelec)->get_DM(); - if (PARAM.inp.nspin == 2) - { - const_cast*>(dm_p)->switch_dmr(1); - } - const hamilt::HContainer* dmr = dm_p->get_DMR_pointer(1); - tmp_nonlocal.cal_force_stress(isforce, isstress, dmr, fvnl_dbeta, svnl_dbeta); - if (PARAM.inp.nspin == 2) - { - const_cast*>(dm_p)->switch_dmr(0); - } - } - else if (PARAM.inp.nspin == 4) - { - hamilt::NonlocalNew, std::complex>> tmp_nonlocal( - nullptr, - kv.kvec_d, - nullptr, - &ucell, - orb.cutoffs(), - &gd, - two_center_bundle.overlap_orb_beta.get()); - - // calculate temporary complex DMR for nonlocal force&stress - // In fact, only SOC part need the imaginary part of DMR for correct force&stress - const auto* dm_p = dynamic_cast>*>(pelec)->get_DM(); - hamilt::HContainer> tmp_dmr(dm_p->get_DMR_pointer(1)->get_paraV()); - std::vector ijrs = dm_p->get_DMR_pointer(1)->get_ijr_info(); - tmp_dmr.insert_ijrs(&ijrs); - tmp_dmr.allocate(); - dm_p->cal_DMR_full(&tmp_dmr); - tmp_nonlocal.cal_force_stress(isforce, isstress, &tmp_dmr, fvnl_dbeta, svnl_dbeta); - } - - //! forces and stress from vdw - // Peize Lin add 2014-04-04, update 2021-03-09 - // jiyy add 2019-05-18, update 2021-05-02 - ModuleBase::matrix force_vdw; - ModuleBase::matrix stress_vdw; - auto vdw_solver = vdw::make_vdw(ucell, PARAM.inp); - if (vdw_solver != nullptr) - { - if (isforce) - { - force_vdw.create(nat, 3); - const std::vector>& force_vdw_temp = vdw_solver->get_force(); - for (int iat = 0; iat < ucell.nat; ++iat) - { - force_vdw(iat, 0) = force_vdw_temp[iat].x; - force_vdw(iat, 1) = force_vdw_temp[iat].y; - force_vdw(iat, 2) = force_vdw_temp[iat].z; - } - } - if (isstress) - { - stress_vdw = vdw_solver->get_stress().to_matrix(); - } - } - - //! forces from E-field - ModuleBase::matrix fefield; - if (PARAM.inp.efield_flag && isforce) - { - fefield.create(nat, 3); - elecstate::Efield::compute_force(ucell, fefield); - } - - //! atomic forces from E-field of rt-TDDFT - ModuleBase::matrix fefield_tddft; - if (PARAM.inp.esolver_type == "tddft" && isforce) - { - fefield_tddft.create(nat, 3); - elecstate::H_TDDFT_pw::compute_force(ucell, fefield_tddft); - } - - //! atomic forces from gate field - ModuleBase::matrix fgate; - if (PARAM.inp.gate_flag && isforce) - { - fgate.create(nat, 3); - elecstate::Gatefield::compute_force(ucell, fgate); - } - - //! atomic forces from implicit solvation model - ModuleBase::matrix fsol; - if (PARAM.inp.imp_sol && isforce) - { - fsol.create(nat, 3); - solvent.cal_force_sol(ucell, rhopw, locpp.vloc, fsol); - } - - //! atomic forces from DFT+U (Quxin version) - ModuleBase::matrix force_dftu; - ModuleBase::matrix stress_dftu; - - if (PARAM.inp.dft_plus_u) // Quxin add for DFT+U on 20201029 - { - if (isforce) - { - force_dftu.create(nat, 3); - } - if (isstress) - { - stress_dftu.create(3, 3); - } - if (PARAM.inp.dft_plus_u == 2) - { - GlobalC::dftu.force_stress(ucell, gd, pelec, pv, fsr, force_dftu, stress_dftu, kv); - } - else - { - hamilt::DFTU> tmp_dftu(nullptr, // HK and SK are not used for force&stress - kv.kvec_d, - nullptr, // HR are not used for force&stress - ucell, - &gd, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs(), - &GlobalC::dftu); - - tmp_dftu.cal_force_stress(isforce, isstress, force_dftu, stress_dftu); - } - } - - // atomic force and stress for DeltaSpin - ModuleBase::matrix force_dspin; - ModuleBase::matrix stress_dspin; - if (PARAM.inp.sc_mag_switch) - { - if (isforce) - { - force_dspin.create(nat, 3); - } - if (isstress) - { - stress_dspin.create(3, 3); - } - - hamilt::DeltaSpin> tmp_dspin(nullptr, - kv.kvec_d, - nullptr, - ucell, - &gd, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs()); - - const auto* dm_p = dynamic_cast>*>(pelec)->get_DM(); - if (PARAM.inp.nspin == 2) - { - const_cast, double>*>(dm_p)->switch_dmr(2); - } - const hamilt::HContainer* dmr = dm_p->get_DMR_pointer(1); - tmp_dspin.cal_force_stress(isforce, isstress, dmr, force_dspin, stress_dspin); - if (PARAM.inp.nspin == 2) - { - const_cast, double>*>(dm_p)->switch_dmr(0); - } - } - - if (!PARAM.globalv.gamma_only_local) - { - this->flk.finish_ftable(fsr); - } - -#ifdef __EXX - // Force and Stress contribution from exx - ModuleBase::matrix force_exx; - ModuleBase::matrix stress_exx; - if (GlobalC::exx_info.info_global.cal_exx) - { - if (isforce) - { - if (GlobalC::exx_info.info_ri.real_number) - { - exd.cal_exx_force(ucell.nat); - force_exx = GlobalC::exx_info.info_global.hybrid_alpha * exd.get_force(); - } - else - { - exc.cal_exx_force(ucell.nat); - force_exx = GlobalC::exx_info.info_global.hybrid_alpha * exc.get_force(); - } - } - if (isstress) - { - if (GlobalC::exx_info.info_ri.real_number) - { - exd.cal_exx_stress(ucell.omega, ucell.lat0); - stress_exx = GlobalC::exx_info.info_global.hybrid_alpha * exd.get_stress(); - } - else - { - exc.cal_exx_stress(ucell.omega, ucell.lat0); - stress_exx = GlobalC::exx_info.info_global.hybrid_alpha * exc.get_stress(); - } - } - } -#endif - //-------------------------------- - // begin calculate and output force - //-------------------------------- - if (isforce) - { - //--------------------------------- - // sum all parts of force! - //--------------------------------- - for (int i = 0; i < 3; i++) - { - double sum = 0.0; - - for (int iat = 0; iat < nat; iat++) - { - fcs(iat, i) += foverlap(iat, i) + ftvnl_dphi(iat, i) + fvnl_dbeta(iat, i) + fvl_dphi(iat, i) - + fvl_dvl(iat, i) // derivative of local potential force (pw) - + fewalds(iat, i) // ewald force (pw) - + fcc(iat, i) // nonlinear core correction force (pw) - + fscc(iat, i); // self consistent corretion force (pw) - - // Force contribution from DFT+U, Quxin add on 20201029 - if (PARAM.inp.dft_plus_u) - { - fcs(iat, i) += force_dftu(iat, i); - } - if (PARAM.inp.sc_mag_switch) - { - fcs(iat, i) += force_dspin(iat, i); - } -#ifdef __EXX - // Force contribution from exx - if (GlobalC::exx_info.info_global.cal_exx) - { - fcs(iat, i) += force_exx(iat, i); - } -#endif - // VDW force of vdwd2 or vdwd3 - if (vdw_solver != nullptr) - { - fcs(iat, i) += force_vdw(iat, i); - } - // E-field force - if (PARAM.inp.efield_flag) - { - fcs(iat, i) += fefield(iat, i); - } - // E-field force of tddft - if (PARAM.inp.esolver_type == "tddft") - { - fcs(iat, i) += fefield_tddft(iat, i); - } - // Gate field force - if (PARAM.inp.gate_flag) - { - fcs(iat, i) += fgate(iat, i); - } - // implicit solvation model - if (PARAM.inp.imp_sol) - { - fcs(iat, i) += fsol(iat, i); - } -#ifdef __MLALGO - // mohan add 2021-08-04 - if (PARAM.inp.deepks_scf) - { - fcs(iat, i) += fvnl_dalpha(iat, i); - } -#endif - // sum total force for correction - sum += fcs(iat, i); - } - - if (!(PARAM.inp.gate_flag || PARAM.inp.efield_flag)) - { - for (int iat = 0; iat < nat; ++iat) - { - fcs(iat, i) -= sum / nat; - } - } - - // xiaohui add "OUT_LEVEL", 2015-09-16 -// if (PARAM.inp.out_level != "m") -// { -// GlobalV::ofs_running << " correction force for each atom along direction " << i + 1 << " is " -// << sum / nat << std::endl; -// } - } - - if (PARAM.inp.gate_flag || PARAM.inp.efield_flag) - { - GlobalV::ofs_running << "Atomic forces are not shifted if gate_flag or efield_flag == true!" << std::endl; - } - - // pengfei 2016-12-20 - if (ModuleSymmetry::Symmetry::symm_flag == 1) - { - this->forceSymmetry(ucell, fcs, symm); - } - -#ifdef __MLALGO - // DeePKS force - if (PARAM.inp.deepks_out_labels) // not parallelized yet - { - const std::string file_ftot = PARAM.globalv.global_out_dir - + (PARAM.inp.deepks_out_labels == 1 ? "deepks_ftot.npy" : "deepks_force.npy"); - LCAO_deepks_io::save_matrix2npy(file_ftot, fcs, GlobalV::MY_RANK); // Hartree/Bohr, F_tot - - if (PARAM.inp.deepks_out_labels == 1) - { - const std::string file_fbase = PARAM.globalv.global_out_dir + "deepks_fbase.npy"; - if (PARAM.inp.deepks_scf) - { - LCAO_deepks_io::save_matrix2npy(file_fbase, - fcs - fvnl_dalpha, - GlobalV::MY_RANK); // Hartree/Bohr, F_base - } - else - { - LCAO_deepks_io::save_matrix2npy(file_fbase, fcs, GlobalV::MY_RANK); // no scf, F_base=F_tot - } - } - } -#endif - // print Rydberg force or not - bool ry = false; - if (istestf) - { - // test - // ModuleBase::matrix fvlocal; - // fvlocal.create(nat,3); - ModuleBase::matrix ftvnl; - ftvnl.create(nat, 3); - for (int iat = 0; iat < nat; iat++) - { - for (int i = 0; i < 3; i++) - { - // fvlocal(iat,i) = fvl_dphi(iat,i) + fvl_dvl(iat,i); - ftvnl(iat, i) = ftvnl_dphi(iat, i) + fvnl_dbeta(iat, i); - } - } - - GlobalV::ofs_running << "\n PARTS OF FORCE: " << std::endl; - GlobalV::ofs_running << std::setiosflags(std::ios::showpos); - GlobalV::ofs_running << std::setiosflags(std::ios::fixed) << std::setprecision(8) << std::endl; - //----------------------------- - // regular force terms test. - //----------------------------- - // this->print_force("OVERLAP FORCE",foverlap,1,ry); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "OVERLAP FORCE", foverlap, false); - // this->print_force("TVNL_DPHI force",ftvnl_dphi,PARAM.inp.test_force); - // this->print_force("VNL_DBETA force",fvnl_dbeta,PARAM.inp.test_force); - // this->print_force("T_VNL FORCE",ftvnl,1,ry); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "T_VNL FORCE", ftvnl, false); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "VL_dPHI FORCE", fvl_dphi, false); - // this->print_force("VL_dPHI FORCE",fvl_dphi,1,ry); - // this->print_force("VL_dVL FORCE",fvl_dvl,1,ry); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "VL_dVL FORCE", fvl_dvl, false); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "EWALD FORCE", fewalds, false); - // this->print_force("VLOCAL FORCE",fvlocal,PARAM.inp.test_force); - // this->print_force("EWALD FORCE",fewalds,1,ry); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "NLCC FORCE", fcc, false); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "SCC FORCE", fscc, false); - // this->print_force("NLCC FORCE",fcc,1,ry); - // this->print_force("SCC FORCE",fscc,1,ry); - //------------------------------- - // put extra force here for test! - //------------------------------- - if (PARAM.inp.efield_flag) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "EFIELD FORCE", fefield, false); - // this->print_force("EFIELD FORCE",fefield,1,ry); - } - if (PARAM.inp.esolver_type == "tddft") - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "EFIELD_TDDFT FORCE", fefield_tddft, false); - // this->print_force("EFIELD_TDDFT FORCE",fefield_tddft,1,ry); - } - if (PARAM.inp.gate_flag) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "GATEFIELD FORCE", fgate, false); - // this->print_force("GATEFIELD FORCE",fgate,1,ry); - } - if (PARAM.inp.imp_sol) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "IMP_SOL FORCE", fsol, false); - // this->print_force("IMP_SOL FORCE",fsol,1,ry); - } - if (vdw_solver != nullptr) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "VDW FORCE", force_vdw, false); - // this->print_force("VDW FORCE",force_vdw,1,ry); - } - if (PARAM.inp.dft_plus_u) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "DFT+U FORCE", force_dftu, false); - } - if (PARAM.inp.sc_mag_switch) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "DeltaSpin FORCE", force_dspin, false); - } -#ifdef __MLALGO - // caoyu add 2021-06-03 - if (PARAM.inp.deepks_scf) - { - ModuleIO::print_force(GlobalV::ofs_running, ucell, "DeePKS FORCE", fvnl_dalpha, true); - } -#endif - } - - GlobalV::ofs_running << std::setiosflags(std::ios::left); - - // this->printforce_total(ry, istestf, fcs); - ModuleIO::print_force(GlobalV::ofs_running, ucell, "TOTAL-FORCE (eV/Angstrom)", fcs, false); - if (istestf) - { - GlobalV::ofs_running << "\n FORCE INVALID TABLE." << std::endl; - GlobalV::ofs_running << " " << std::setw(8) << "atom" << std::setw(5) << "x" << std::setw(5) << "y" - << std::setw(5) << "z" << std::endl; - for (int iat = 0; iat < ucell.nat; iat++) - { - GlobalV::ofs_running << " " << std::setw(8) << iat; - for (int i = 0; i < 3; i++) - { - if (std::abs(fcs(iat, i) * ModuleBase::Ry_to_eV / 0.529177) - < Force_Stress_LCAO::force_invalid_threshold_ev) - { - fcs(iat, i) = 0.0; - GlobalV::ofs_running << std::setw(5) << "1"; - } - else - { - GlobalV::ofs_running << std::setw(5) << "0"; - } - } - GlobalV::ofs_running << std::endl; - } - } - } // end of force calculation - //--------------------------------- - // begin calculate and output stress - //--------------------------------- - if (isstress) - { - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - scs(i, j) += soverlap(i, j) + stvnl_dphi(i, j) + svnl_dbeta(i, j) + svl_dphi(i, j) - + sigmadvl(i, j) // derivative of local potential stress (pw) - + sigmaewa(i, j) // ewald stress (pw) - + sigmacc(i, j) // nonlinear core correction stress (pw) - + sigmaxc(i, j) // exchange corretion stress - + sigmahar(i, j); // hartree stress - - // VDW stress from linpz and jiyy - if (vdw_solver != nullptr) - { - scs(i, j) += stress_vdw(i, j); - } - // DFT plus U stress from qux - if (PARAM.inp.dft_plus_u) - { - scs(i, j) += stress_dftu(i, j); - } - if (PARAM.inp.sc_mag_switch) - { - scs(i, j) += stress_dspin(i, j); - } -#ifdef __EXX - // Stress contribution from exx - if (GlobalC::exx_info.info_global.cal_exx) - { - scs(i, j) += stress_exx(i, j); - } -#endif -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - scs(i, j) += svnl_dalpha(i, j); - } -#endif - } - } - if (ModuleSymmetry::Symmetry::symm_flag == 1) - { - symm->symmetrize_mat3(scs, ucell.lat); - } // end symmetry - -#ifdef __MLALGO - if (PARAM.inp.deepks_out_labels == 1) - { - const std::string file_stot = PARAM.globalv.global_out_dir + "deepks_stot.npy"; - LCAO_deepks_io::save_matrix2npy(file_stot, - scs, - GlobalV::MY_RANK, - ucell.omega, - 'U'); // change to energy unit Ry when printing, S_tot; - - const std::string file_sbase = PARAM.globalv.global_out_dir + "deepks_sbase.npy"; - if (PARAM.inp.deepks_scf) - { - LCAO_deepks_io::save_matrix2npy(file_sbase, - scs - svnl_dalpha, - GlobalV::MY_RANK, - ucell.omega, - 'U'); // change to energy unit Ry when printing, S_base; - } - else - { - LCAO_deepks_io::save_matrix2npy(file_sbase, - scs, - GlobalV::MY_RANK, - ucell.omega, - 'U'); // sbase = stot - } - } - else if (PARAM.inp.deepks_out_labels == 2) - { - const std::string file_stot = PARAM.globalv.global_out_dir + "deepks_stress.npy"; - LCAO_deepks_io::save_matrix2npy(file_stot, scs, GlobalV::MY_RANK, ucell.omega, - 'F'); // flat mode - } -#endif - - // print Rydberg stress or not - bool ry = false; - - // test stress each terms if needed - if (istests) - { - // test - ModuleBase::matrix svlocal; - svlocal.create(3, 3); - ModuleBase::matrix stvnl; - stvnl.create(3, 3); - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - svlocal(i, j) = svl_dphi(i, j) + sigmadvl(i, j); - stvnl(i, j) = stvnl_dphi(i, j) + svnl_dbeta(i, j); - } - } - - const bool screen = PARAM.inp.test_stress; - - GlobalV::ofs_running << "\n PARTS OF STRESS: " << std::endl; - GlobalV::ofs_running << std::setiosflags(std::ios::showpos); - GlobalV::ofs_running << std::setiosflags(std::ios::fixed) << std::setprecision(10) << std::endl; - ModuleIO::print_stress("OVERLAP STRESS", soverlap, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("T STRESS", stvnl_dphi, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("VNL STRESS", svnl_dbeta, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("T_VNL STRESS", stvnl, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("VL_dPHI STRESS", svl_dphi, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("VL_dVL STRESS", sigmadvl, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("HAR STRESS", sigmahar, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("EWALD STRESS", sigmaewa, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("cc STRESS", sigmacc, screen, ry, GlobalV::ofs_running); - ModuleIO::print_stress("XC STRESS", sigmaxc, screen, ry, GlobalV::ofs_running); - if (vdw_solver != nullptr) - { - ModuleIO::print_stress("VDW STRESS", sigmaxc, screen, ry, GlobalV::ofs_running); - } - if (PARAM.inp.dft_plus_u) - { - ModuleIO::print_stress("DFTU STRESS", stress_dftu, screen, ry, GlobalV::ofs_running); - } - if (PARAM.inp.sc_mag_switch) - { - ModuleIO::print_stress("DeltaSpin STRESS", stress_dspin, screen, ry, GlobalV::ofs_running); - } - ModuleIO::print_stress("TOTAL STRESS", scs, screen, ry, GlobalV::ofs_running); - } // end of test - - GlobalV::ofs_running << std::setiosflags(std::ios::left); - - // print total stress - bool screen = false; - ModuleIO::print_stress("TOTAL-STRESS", scs, screen, ry, GlobalV::ofs_running); - - double unit_transform = 0.0; - unit_transform = ModuleBase::RYDBERG_SI / pow(ModuleBase::BOHR_RADIUS_SI, 3) * 1.0e-8; - double external_stress[3] = {PARAM.inp.press1, PARAM.inp.press2, PARAM.inp.press3}; - - for (int i = 0; i < 3; i++) - { - scs(i, i) -= external_stress[i] / unit_transform; - } - } // end of stress calculation - - ModuleBase::timer::tick("Force_Stress_LCAO", "getForceStress"); - return; -} - -// local pseudopotential, ewald, core correction, scc terms in force -template -void Force_Stress_LCAO::calForcePwPart(UnitCell& ucell, - ModuleBase::matrix& fvl_dvl, - ModuleBase::matrix& fewalds, - ModuleBase::matrix& fcc, - ModuleBase::matrix& fscc, - const double& etxc, - const ModuleBase::matrix& vnew, - const bool vnew_exist, - const Charge* const chr, - ModulePW::PW_Basis* rhopw, - const pseudopot_cell_vl& locpp, - const Structure_Factor& sf) -{ - ModuleBase::TITLE("Force_Stress_LCAO", "calForcePwPart"); - //-------------------------------------------------------- - // local pseudopotential force: - // use charge density; plane wave; local pseudopotential; - //-------------------------------------------------------- - f_pw.cal_force_loc(ucell, fvl_dvl, rhopw, locpp.vloc, chr); - //-------------------------------------------------------- - // ewald force: use plane wave only. - //-------------------------------------------------------- - f_pw.cal_force_ew(ucell, fewalds, rhopw, &sf); // remain problem - - //-------------------------------------------------------- - // force due to core correlation. - //-------------------------------------------------------- - f_pw.cal_force_cc(fcc, rhopw, chr, locpp.numeric, ucell); - //-------------------------------------------------------- - // force due to self-consistent charge. - //-------------------------------------------------------- - f_pw.cal_force_scc(fscc, rhopw, vnew, vnew_exist, locpp.numeric, ucell); - return; -} - -// overlap, kinetic, nonlocal pseudopotential, Local potential terms in force and stress -template <> -void Force_Stress_LCAO::integral_part(const bool isGammaOnly, - const bool isforce, - const bool isstress, - const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const elecstate::ElecState* pelec, - const psi::Psi* psi, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& fvnl_dbeta, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& soverlap, - ModuleBase::matrix& stvnl_dphi, - ModuleBase::matrix& svnl_dbeta, - ModuleBase::matrix& svl_dphi, -#if __MLALGO - ModuleBase::matrix& fvnl_dalpha, - ModuleBase::matrix& svnl_dalpha, - LCAO_Deepks& ld, -#endif - Gint_Gamma& gint_gamma, // mohan add 2024-04-01 - Gint_k& gint_k, // mohan add 2024-04-01 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const K_Vectors& kv) -{ - - flk.ftable(isforce, - isstress, - fsr, // mohan add 2024-06-15 - ucell, - gd, - psi, - pelec, - foverlap, - ftvnl_dphi, - fvnl_dbeta, - fvl_dphi, - soverlap, - stvnl_dphi, - svnl_dbeta, - svl_dphi, -#if __MLALGO - fvnl_dalpha, - svnl_dalpha, - ld, -#endif - gint_gamma, - two_center_bundle, - orb, - pv); - return; -} - -template <> -void Force_Stress_LCAO>::integral_part(const bool isGammaOnly, - const bool isforce, - const bool isstress, - const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const elecstate::ElecState* pelec, - const psi::Psi>* psi, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& fvnl_dbeta, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& soverlap, - ModuleBase::matrix& stvnl_dphi, - ModuleBase::matrix& svnl_dbeta, - ModuleBase::matrix& svl_dphi, -#if __MLALGO - ModuleBase::matrix& fvnl_dalpha, - ModuleBase::matrix& svnl_dalpha, - LCAO_Deepks>& ld, -#endif - Gint_Gamma& gint_gamma, - Gint_k& gint_k, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const K_Vectors& kv) -{ - flk.ftable(isforce, - isstress, - fsr, // mohan add 2024-06-16 - ucell, - gd, - psi, - pelec, - foverlap, - ftvnl_dphi, - fvnl_dbeta, - fvl_dphi, - soverlap, - stvnl_dphi, - svnl_dbeta, - svl_dphi, -#if __MLALGO - fvnl_dalpha, - svnl_dalpha, - ld, -#endif - gint_k, - two_center_bundle, - orb, - pv, - &kv, - this->RA); - return; -} - -// vlocal, hartree, ewald, core correction, exchange-correlation terms in stress -template -void Force_Stress_LCAO::calStressPwPart(UnitCell& ucell, - ModuleBase::matrix& sigmadvl, - ModuleBase::matrix& sigmahar, - ModuleBase::matrix& sigmaewa, - ModuleBase::matrix& sigmacc, - ModuleBase::matrix& sigmaxc, - const double& etxc, - const Charge* const chr, - ModulePW::PW_Basis* rhopw, - const pseudopot_cell_vl& locpp, - const Structure_Factor& sf) -{ - ModuleBase::TITLE("Force_Stress_LCAO", "calStressPwPart"); - //-------------------------------------------------------- - // local pseudopotential stress: - // use charge density; plane wave; local pseudopotential; - //-------------------------------------------------------- - sc_pw.stress_loc(ucell, sigmadvl, rhopw, locpp.vloc, &sf, 0, chr); - - //-------------------------------------------------------- - // hartree term - //-------------------------------------------------------- - sc_pw.stress_har(ucell, sigmahar, rhopw, 0, chr); - - //-------------------------------------------------------- - // ewald stress: use plane wave only. - //-------------------------------------------------------- - sc_pw.stress_ewa(ucell, sigmaewa, rhopw, 0); // remain problem - - //-------------------------------------------------------- - // stress due to core correlation. - //-------------------------------------------------------- - sc_pw.stress_cc(sigmacc, rhopw, ucell, &sf, 0, locpp.numeric, chr); - - //-------------------------------------------------------- - // stress due to self-consistent charge. - //-------------------------------------------------------- - for (int i = 0; i < 3; i++) - { - sigmaxc(i, i) = -etxc / ucell.omega; - } - // Exchange-correlation for PBE - sc_pw.stress_gga(ucell, sigmaxc, rhopw, chr); - - return; -} - -#include "source_base/mathzone.h" -// do symmetry for total force -template -void Force_Stress_LCAO::forceSymmetry(const UnitCell& ucell, ModuleBase::matrix& fcs, ModuleSymmetry::Symmetry* symm) -{ - double d1, d2, d3; - for (int iat = 0; iat < ucell.nat; iat++) - { - ModuleBase::Mathzone::Cartesian_to_Direct(fcs(iat, 0), - fcs(iat, 1), - fcs(iat, 2), - ucell.a1.x, - ucell.a1.y, - ucell.a1.z, - ucell.a2.x, - ucell.a2.y, - ucell.a2.z, - ucell.a3.x, - ucell.a3.y, - ucell.a3.z, - d1, - d2, - d3); - - fcs(iat, 0) = d1; - fcs(iat, 1) = d2; - fcs(iat, 2) = d3; - } - symm->symmetrize_vec3_nat(fcs.c); - for (int iat = 0; iat < ucell.nat; iat++) - { - ModuleBase::Mathzone::Direct_to_Cartesian(fcs(iat, 0), - fcs(iat, 1), - fcs(iat, 2), - ucell.a1.x, - ucell.a1.y, - ucell.a1.z, - ucell.a2.x, - ucell.a2.y, - ucell.a2.z, - ucell.a3.x, - ucell.a3.y, - ucell.a3.z, - d1, - d2, - d3); - - fcs(iat, 0) = d1; - fcs(iat, 1) = d2; - fcs(iat, 2) = d3; - } - return; -} - -template class Force_Stress_LCAO; -template class Force_Stress_LCAO>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h b/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h deleted file mode 100644 index 6cde19ff39..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef FORCE_STRESS_LCAO_H -#define FORCE_STRESS_LCAO_H - -#include "FORCE.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/matrix.h" -#include "source_pw/hamilt_pwdft/forces.h" -#include "source_pw/hamilt_pwdft/stress_func.h" -#include "source_pw/hamilt_pwdft/structure_factor.h" -#include "module_io/input_conv.h" -#include "source_psi/psi.h" -#ifdef __EXX -#include "module_ri/Exx_LRI_interface.h" -#endif -#include "force_stress_arrays.h" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" - -template -class Force_Stress_LCAO -{ - // mohan add 2021-02-09 - friend class md; - friend void Input_Conv::Convert(); - friend class ions; - - public: - Force_Stress_LCAO(Record_adj& ra, const int nat_in); - ~Force_Stress_LCAO(); - - void getForceStress(UnitCell& ucell, - const bool isforce, - const bool isstress, - const bool istestf, - const bool istests, - const Grid_Driver& gd, - Parallel_Orbitals& pv, - const elecstate::ElecState* pelec, - const psi::Psi* psi, - Gint_Gamma& gint_gamma, // mohan add 2024-04-01 - Gint_k& gint_k, // mohan add 2024-04-01 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - ModuleBase::matrix& fcs, - ModuleBase::matrix& scs, - const pseudopot_cell_vl& locpp, - const Structure_Factor& sf, - const K_Vectors& kv, - ModulePW::PW_Basis* rhopw, - surchem& solvent, -#ifdef __MLALGO - LCAO_Deepks& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface& exd, - Exx_LRI_Interface>& exc, -#endif - ModuleSymmetry::Symmetry* symm); - - private: - int nat; - Record_adj* RA; - Force_LCAO flk; - Stress_Func sc_pw; - Forces f_pw; - - void forceSymmetry(const UnitCell& ucell, ModuleBase::matrix& fcs, ModuleSymmetry::Symmetry* symm); - - void calForcePwPart(UnitCell& ucell, - ModuleBase::matrix& fvl_dvl, - ModuleBase::matrix& fewalds, - ModuleBase::matrix& fcc, - ModuleBase::matrix& fscc, - const double& etxc, - const ModuleBase::matrix& vnew, - const bool vnew_exist, - const Charge* const chr, - ModulePW::PW_Basis* rhopw, - const pseudopot_cell_vl& locpp, - const Structure_Factor& sf); - - void integral_part(const bool isGammaOnly, - const bool isforce, - const bool isstress, - const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const elecstate::ElecState* pelec, - const psi::Psi* psi, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& fvnl_dbeta, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& soverlap, - ModuleBase::matrix& stvnl_dphi, - ModuleBase::matrix& svnl_dbeta, - ModuleBase::matrix& svl_dphi, -#if __MLALGO - ModuleBase::matrix& fvnl_dalpha, - ModuleBase::matrix& svnl_dalpha, - LCAO_Deepks& ld, -#endif - Gint_Gamma& gint_gamma, - Gint_k& gint_k, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const K_Vectors& kv); - - void calStressPwPart(UnitCell& ucell, - ModuleBase::matrix& sigmadvl, - ModuleBase::matrix& sigmahar, - ModuleBase::matrix& sigmaewa, - ModuleBase::matrix& sigmacc, - ModuleBase::matrix& sigmaxc, - const double& etxc, - const Charge* const chr, - ModulePW::PW_Basis* rhopw, - const pseudopot_cell_vl& locpp, - const Structure_Factor& sf); - - static double force_invalid_threshold_ev; -}; - -template -double Force_Stress_LCAO::force_invalid_threshold_ev = 0.00; - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp deleted file mode 100644 index 845f2bca8d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp +++ /dev/null @@ -1,292 +0,0 @@ -#include "FORCE.h" -#include "source_base/memory.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" //caoyu add for deepks on 20210813 -#include "module_hamilt_lcao/module_deepks/LCAO_deepks_io.h" -#endif -#include "source_cell/module_neighbor/sltk_grid_driver.h" //GridD -#include "source_estate/elecstate_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress.h" -#include "module_io/write_HS.h" - -template <> -void Force_LCAO::allocate(const UnitCell& ucell, - const Grid_Driver& gd, - const Parallel_Orbitals& pv, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const int& nks, - const std::vector>& kvec_d) -{ - ModuleBase::TITLE("Forces", "allocate"); - ModuleBase::timer::tick("Forces", "allocate"); - - // need to calculate the derivative in build_ST_new - bool cal_deri = true; - this->ParaV = &pv; - - // calculate dS in LCAO - // liaochen add on 2010/7/12 - // save the results in dense matrix by now. - // pv.nloc: number of H elements in this proc. - - assert(pv.nloc > 0); - fsr.DSloc_x = new double[pv.nloc]; - fsr.DSloc_y = new double[pv.nloc]; - fsr.DSloc_z = new double[pv.nloc]; - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_x, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_y, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_z, pv.nloc); - ModuleBase::Memory::record("Force::dS_GO", sizeof(double) * pv.nloc * 3); - // allocate stress part in gamma_only-line, added by zhengdy-stress - if (PARAM.inp.cal_stress) - { - fsr.DSloc_11 = new double[pv.nloc]; - fsr.DSloc_12 = new double[pv.nloc]; - fsr.DSloc_13 = new double[pv.nloc]; - fsr.DSloc_22 = new double[pv.nloc]; - fsr.DSloc_23 = new double[pv.nloc]; - fsr.DSloc_33 = new double[pv.nloc]; - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_11, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_12, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_13, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_22, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_23, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_33, pv.nloc); - fsr.DHloc_fixed_11 = new double[pv.nloc]; - fsr.DHloc_fixed_12 = new double[pv.nloc]; - fsr.DHloc_fixed_13 = new double[pv.nloc]; - fsr.DHloc_fixed_22 = new double[pv.nloc]; - fsr.DHloc_fixed_23 = new double[pv.nloc]; - fsr.DHloc_fixed_33 = new double[pv.nloc]; - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_11, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_12, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_13, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_22, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_23, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_33, pv.nloc); - ModuleBase::Memory::record("Stress::dSH_GO", sizeof(double) * pv.nloc * 12); - } - // calculate dS in LCAO basis - LCAO_domain::build_ST_new(fsr, - 'S', - cal_deri, - PARAM.inp.cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &gd, - nullptr); - - // calculate dT in LCAP - // allocation dt - // liaochen add on 2010/7/12 - fsr.DHloc_fixed_x = new double[pv.nloc]; - fsr.DHloc_fixed_y = new double[pv.nloc]; - fsr.DHloc_fixed_z = new double[pv.nloc]; - ModuleBase::Memory::record("Force::dTVNL", sizeof(double) * pv.nloc * 3); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_x, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_y, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixed_z, pv.nloc); - - // calculate dT - // calculate T + VNL(P1) in LCAO basis - LCAO_domain::build_ST_new(fsr, - 'T', - cal_deri, - PARAM.inp.cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &gd, - nullptr); - - // calculate asynchronous S matrix to output for Hefei-NAMD - if (PARAM.inp.cal_syns) - { - cal_deri = false; - ModuleBase::timer::tick("Forces", "allocate"); - ModuleBase::WARNING_QUIT("cal_syns", "this function has been broken and will be fixed later."); - } - - ModuleBase::timer::tick("Forces", "allocate"); - return; -} - -template <> -void Force_LCAO::finish_ftable(ForceStressArrays& fsr) -{ - delete[] fsr.DSloc_x; - delete[] fsr.DSloc_y; - delete[] fsr.DSloc_z; - delete[] fsr.DHloc_fixed_x; - delete[] fsr.DHloc_fixed_y; - delete[] fsr.DHloc_fixed_z; - - if (PARAM.inp.cal_stress) // added by zhengdy-stress - { - delete[] fsr.DSloc_11; - delete[] fsr.DSloc_12; - delete[] fsr.DSloc_13; - delete[] fsr.DSloc_22; - delete[] fsr.DSloc_23; - delete[] fsr.DSloc_33; - delete[] fsr.DHloc_fixed_11; - delete[] fsr.DHloc_fixed_12; - delete[] fsr.DHloc_fixed_13; - delete[] fsr.DHloc_fixed_22; - delete[] fsr.DHloc_fixed_23; - delete[] fsr.DHloc_fixed_33; - } - return; -} - -// be called in force_lo.cpp -template <> -void Force_LCAO::ftable(const bool isforce, - const bool isstress, - ForceStressArrays& fsr, // mohan add 2024-06-16 - const UnitCell& ucell, - const Grid_Driver& gd, - const psi::Psi* psi, - const elecstate::ElecState* pelec, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& fvnl_dbeta, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& soverlap, - ModuleBase::matrix& stvnl_dphi, - ModuleBase::matrix& svnl_dbeta, - ModuleBase::matrix& svl_dphi, -#ifdef __MLALGO - ModuleBase::matrix& fvnl_dalpha, - ModuleBase::matrix& svnl_dalpha, - LCAO_Deepks& ld, -#endif - TGint::type& gint, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const K_Vectors* kv, - Record_adj* ra) -{ - ModuleBase::TITLE("Forces", "ftable"); - ModuleBase::timer::tick("Forces", "ftable"); - - // get DM - const elecstate::DensityMatrix* dm - = dynamic_cast*>(pelec)->get_DM(); - - this->ParaV = dm->get_paraV_pointer(); - - // allocate DSloc_x, DSloc_y, DSloc_z - // allocate DHloc_fixed_x, DHloc_fixed_y, DHloc_fixed_z - this->allocate(ucell, gd, pv, fsr, two_center_bundle, orb); - - const double* dSx[3] = {fsr.DSloc_x, fsr.DSloc_y, fsr.DSloc_z}; - const double* dSxy[6] = {fsr.DSloc_11, fsr.DSloc_12, fsr.DSloc_13, fsr.DSloc_22, fsr.DSloc_23, fsr.DSloc_33}; - // calculate the force related to 'energy density matrix'. - PulayForceStress::cal_pulay_fs( - foverlap, - soverlap, - this->cal_edm(pelec, *psi, *dm, *kv, pv, PARAM.inp.nspin, PARAM.inp.nbands, ucell, *ra), - ucell, - pv, - dSx, - dSxy, - isforce, - isstress); - - const double* dHx[3] = {fsr.DHloc_fixed_x, fsr.DHloc_fixed_y, fsr.DHloc_fixed_z}; - const double* dHxy[6] = {fsr.DHloc_fixed_11, - fsr.DHloc_fixed_12, - fsr.DHloc_fixed_13, - fsr.DHloc_fixed_22, - fsr.DHloc_fixed_23, - fsr.DHloc_fixed_33}; - // tvnl_dphi - PulayForceStress::cal_pulay_fs(ftvnl_dphi, stvnl_dphi, *dm, ucell, pv, dHx, dHxy, isforce, isstress); - - // vl_dphi - PulayForceStress::cal_pulay_fs(fvl_dphi, - svl_dphi, - *dm, - ucell, - pelec->pot, - gint, - isforce, - isstress, - false /*reset dm to gint*/); - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - // No need to update E_delta here since it have been done in LCAO_Deepks_Interface in after_scf - const int nks = 1; - DeePKS_domain::cal_f_delta(ld.dm_r, - ucell, - orb, - gd, - *this->ParaV, - nks, - kv->kvec_d, - ld.phialpha, - ld.gedm, - ld.inl_index, - fvnl_dalpha, - isstress, - svnl_dalpha); - } -#endif - - if (isforce) - { - Parallel_Reduce::reduce_pool(foverlap.c, foverlap.nr * foverlap.nc); - Parallel_Reduce::reduce_pool(ftvnl_dphi.c, ftvnl_dphi.nr * ftvnl_dphi.nc); - Parallel_Reduce::reduce_pool(fvnl_dbeta.c, fvnl_dbeta.nr * fvnl_dbeta.nc); - Parallel_Reduce::reduce_pool(fvl_dphi.c, fvl_dphi.nr * fvl_dphi.nc); -#ifdef __MLALGO - Parallel_Reduce::reduce_pool(fvnl_dalpha.c, fvnl_dalpha.nr * fvnl_dalpha.nc); -#endif - } - if (isstress) - { - Parallel_Reduce::reduce_pool(soverlap.c, soverlap.nr * soverlap.nc); - Parallel_Reduce::reduce_pool(stvnl_dphi.c, stvnl_dphi.nr * stvnl_dphi.nc); - Parallel_Reduce::reduce_pool(svnl_dbeta.c, svnl_dbeta.nr * svnl_dbeta.nc); - Parallel_Reduce::reduce_pool(svl_dphi.c, svl_dphi.nr * svl_dphi.nc); -#ifdef __MLALGO - Parallel_Reduce::reduce_pool(svnl_dalpha.c, svnl_dalpha.nr * svnl_dalpha.nc); -#endif - } - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf && PARAM.inp.deepks_out_unittest) - { - std::ofstream ofs_f("F_delta.dat"); - std::ofstream ofs_s("stress_delta.dat"); - ofs_f << std::setprecision(10); - ofs_s << std::setprecision(10); - fvnl_dalpha.print(ofs_f); - ofs_f.close(); - svnl_dalpha.print(ofs_s); - ofs_s.close(); - } -#endif - - // delete DSloc_x, DSloc_y, DSloc_z - // delete DHloc_fixed_x, DHloc_fixed_y, DHloc_fixed_z - this->finish_ftable(fsr); - - ModuleBase::timer::tick("Forces", "ftable"); - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp deleted file mode 100644 index 02eb0cc55d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp +++ /dev/null @@ -1,328 +0,0 @@ -#include "FORCE.h" -#include "source_base/memory.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/tool_threading.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/cal_dm.h" -#include "source_estate/elecstate_lcao.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_io/write_HS.h" -#include "module_parameter/parameter.h" - -#include -#include - -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#endif - -#ifdef _OPENMP -#include -#endif - -template <> -void Force_LCAO>::allocate(const UnitCell& ucell, - const Grid_Driver& gd, - const Parallel_Orbitals& pv, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const int& nks, - const std::vector>& kvec_d) -{ - ModuleBase::TITLE("Forces", "allocate"); - ModuleBase::timer::tick("Forces", "allocate"); - - const int nnr = pv.nnr; - - assert(nnr >= 0); - - //-------------------------------- - // (1) allocate for dSx dSy & dSz - //-------------------------------- - fsr.DSloc_Rx = new double[nnr]; - fsr.DSloc_Ry = new double[nnr]; - fsr.DSloc_Rz = new double[nnr]; - - const auto init_DSloc_Rxyz = [this, nnr, &fsr](int num_threads, int thread_id) { - int beg = 0; - int len = 0; - ModuleBase::BLOCK_TASK_DIST_1D(num_threads, thread_id, nnr, 1024, beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_Rx + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_Ry + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DSloc_Rz + beg, len); - }; - - ModuleBase::OMP_PARALLEL(init_DSloc_Rxyz); - ModuleBase::Memory::record("Force::dS_K", sizeof(double) * nnr * 3); - - if (PARAM.inp.cal_stress) - { - fsr.DH_r = new double[3 * nnr]; - fsr.stvnl11 = new double[nnr]; - fsr.stvnl12 = new double[nnr]; - fsr.stvnl13 = new double[nnr]; - fsr.stvnl22 = new double[nnr]; - fsr.stvnl23 = new double[nnr]; - fsr.stvnl33 = new double[nnr]; - const auto init_DH_r_stvnl = [this, nnr, &fsr](int num_threads, int thread_id) { - int beg, len; - ModuleBase::BLOCK_TASK_DIST_1D(num_threads, thread_id, nnr, 1024, beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DH_r + 3 * beg, 3 * len); - ModuleBase::GlobalFunc::ZEROS(fsr.stvnl11 + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.stvnl12 + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.stvnl13 + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.stvnl22 + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.stvnl23 + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.stvnl33 + beg, len); - }; - ModuleBase::OMP_PARALLEL(init_DH_r_stvnl); - - ModuleBase::Memory::record("Stress::dHr", sizeof(double) * nnr * 3); - ModuleBase::Memory::record("Stress::dSR", sizeof(double) * nnr * 6); - } - - //----------------------------- - // calculate dS = - //----------------------------- - bool cal_deri = true; - LCAO_domain::build_ST_new(fsr, - 'S', - cal_deri, - PARAM.inp.cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &gd, - nullptr); // delete lm.SlocR - - //----------------------------------------- - // (2) allocate for - //----------------------------------------- - fsr.DHloc_fixedR_x = new double[nnr]; - fsr.DHloc_fixedR_y = new double[nnr]; - fsr.DHloc_fixedR_z = new double[nnr]; - - const auto init_DHloc_fixedR_xyz = [this, nnr, &fsr](int num_threads, int thread_id) { - int beg = 0; - int len = 0; - ModuleBase::BLOCK_TASK_DIST_1D(num_threads, thread_id, nnr, 1024, beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixedR_x + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixedR_y + beg, len); - ModuleBase::GlobalFunc::ZEROS(fsr.DHloc_fixedR_z + beg, len); - }; - ModuleBase::OMP_PARALLEL(init_DHloc_fixedR_xyz); - ModuleBase::Memory::record("Force::dTVNL", sizeof(double) * nnr * 3); - - // calculate dT= in LCAO - // calculate T + VNL(P1) in LCAO basis - LCAO_domain::build_ST_new(fsr, - 'T', - cal_deri, - PARAM.inp.cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &gd, - nullptr); // delete lm.Hloc_fixedR - - // calculate asynchronous S matrix to output for Hefei-NAMD - if (PARAM.inp.cal_syns) - { - cal_deri = false; - - ModuleBase::WARNING_QUIT("cal_syns", "This function has been broken and will be fixed later."); - - LCAO_domain::build_ST_new(fsr, - 'S', - cal_deri, - PARAM.inp.cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &(gd), - nullptr, // delete lm.SlocR - PARAM.inp.cal_syns, - PARAM.inp.dmax); - - for (int ik = 0; ik < nks; ik++) - { - - bool bit = false; // LiuXh, 2017-03-21 - } - } - - ModuleBase::timer::tick("Forces", "allocate"); - return; -} - -template <> -void Force_LCAO>::finish_ftable(ForceStressArrays& fsr) -{ - delete[] fsr.DSloc_Rx; - delete[] fsr.DSloc_Ry; - delete[] fsr.DSloc_Rz; - delete[] fsr.DHloc_fixedR_x; - delete[] fsr.DHloc_fixedR_y; - delete[] fsr.DHloc_fixedR_z; - - if (PARAM.inp.cal_stress) - { - delete[] fsr.DH_r; - delete[] fsr.stvnl11; - delete[] fsr.stvnl12; - delete[] fsr.stvnl13; - delete[] fsr.stvnl22; - delete[] fsr.stvnl23; - delete[] fsr.stvnl33; - } - return; -} - -// be called in Force_LCAO::start_force_calculation -template <> -void Force_LCAO>::ftable(const bool isforce, - const bool isstress, - ForceStressArrays& fsr, // mohan add 2024-06-15 - const UnitCell& ucell, - const Grid_Driver& gd, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - ModuleBase::matrix& foverlap, - ModuleBase::matrix& ftvnl_dphi, - ModuleBase::matrix& fvnl_dbeta, - ModuleBase::matrix& fvl_dphi, - ModuleBase::matrix& soverlap, - ModuleBase::matrix& stvnl_dphi, - ModuleBase::matrix& svnl_dbeta, - ModuleBase::matrix& svl_dphi, -#ifdef __MLALGO - ModuleBase::matrix& fvnl_dalpha, - ModuleBase::matrix& svnl_dalpha, - LCAO_Deepks>& ld, -#endif - TGint>::type& gint, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const K_Vectors* kv, - Record_adj* ra) -{ - ModuleBase::TITLE("Forces", "ftable"); - ModuleBase::timer::tick("Forces", "ftable"); - - elecstate::DensityMatrix, double>* dm - = dynamic_cast>*>(pelec)->get_DM(); - - this->allocate(ucell, - gd, - pv, - fsr, // mohan add 2024-06-16 - two_center_bundle, - orb, - kv->get_nks(), - kv->kvec_d); - - const double* dSx[3] = {fsr.DSloc_Rx, fsr.DSloc_Ry, fsr.DSloc_Rz}; - // calculate the energy density matrix - // and the force related to overlap matrix and energy density matrix. - PulayForceStress::cal_pulay_fs( - foverlap, - soverlap, - this->cal_edm(pelec, *psi, *dm, *kv, pv, PARAM.inp.nspin, PARAM.inp.nbands, ucell, *ra), - ucell, - pv, - dSx, - fsr.DH_r, - isforce, - isstress, - ra, - -1.0, - 1.0); - - const double* dHx[3] = {fsr.DHloc_fixedR_x, fsr.DHloc_fixedR_y, fsr.DHloc_fixedR_z}; // T+Vnl - const double* dHxy[6] = {fsr.stvnl11, fsr.stvnl12, fsr.stvnl13, fsr.stvnl22, fsr.stvnl23, fsr.stvnl33}; // T - // tvnl_dphi - PulayForceStress::cal_pulay_fs(ftvnl_dphi, stvnl_dphi, *dm, ucell, pv, dHx, dHxy, isforce, isstress, ra, 1.0, -1.0); - - // doing on the real space grid. - // vl_dphi - PulayForceStress::cal_pulay_fs(fvl_dphi, - svl_dphi, - *dm, - ucell, - pelec->pot, - gint, - isforce, - isstress, - false /*reset dm to gint*/); - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - // No need to update E_delta since it have been done in LCAO_Deepks_Interface in after_scf - DeePKS_domain::cal_f_delta>(ld.dm_r, - ucell, - orb, - gd, - pv, - kv->get_nks(), - kv->kvec_d, - ld.phialpha, - ld.gedm, - ld.inl_index, - fvnl_dalpha, - isstress, - svnl_dalpha); - } -#endif - - //---------------------------------------------------------------- - // reduce the force according to 2D distribution of H & S matrix. - //---------------------------------------------------------------- - if (isforce) - { - Parallel_Reduce::reduce_pool(foverlap.c, foverlap.nr * foverlap.nc); - Parallel_Reduce::reduce_pool(ftvnl_dphi.c, ftvnl_dphi.nr * ftvnl_dphi.nc); - Parallel_Reduce::reduce_pool(fvnl_dbeta.c, fvnl_dbeta.nr * fvnl_dbeta.nc); - Parallel_Reduce::reduce_pool(fvl_dphi.c, fvl_dphi.nr * fvl_dphi.nc); -#ifdef __MLALGO - Parallel_Reduce::reduce_pool(fvnl_dalpha.c, fvnl_dalpha.nr * fvnl_dalpha.nc); -#endif - } - if (isstress) - { - Parallel_Reduce::reduce_pool(soverlap.c, soverlap.nr * soverlap.nc); - Parallel_Reduce::reduce_pool(stvnl_dphi.c, stvnl_dphi.nr * stvnl_dphi.nc); - Parallel_Reduce::reduce_pool(svnl_dbeta.c, svnl_dbeta.nr * svnl_dbeta.nc); - Parallel_Reduce::reduce_pool(svl_dphi.c, svl_dphi.nr * svl_dphi.nc); -#ifdef __MLALGO - Parallel_Reduce::reduce_pool(svnl_dalpha.c, svnl_dalpha.nr * svnl_dalpha.nc); -#endif - } - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf && PARAM.inp.deepks_out_unittest) - { - std::ofstream ofs_f("F_delta.dat"); - std::ofstream ofs_s("stress_delta.dat"); - ofs_f << std::setprecision(10); - ofs_s << std::setprecision(10); - fvnl_dalpha.print(ofs_f); - ofs_f.close(); - svnl_dalpha.print(ofs_s); - ofs_s.close(); - } -#endif - - ModuleBase::timer::tick("Forces", "ftable"); - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp deleted file mode 100644 index 5a306918ea..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef LCAO_HS_ARRAYS_H -#define LCAO_HS_ARRAYS_H - -#include "source_base/abfs-vector3_order.h" - -#include -#include - -class LCAO_HS_Arrays { - public: - LCAO_HS_Arrays(){}; - ~LCAO_HS_Arrays(){}; - - //------------------------------ - // Store H(mu,nu') - // nu' : nu in near unitcell R. - // used in kpoint algorithm. - // these matrixed are used - // for 'folding_matrix' in lcao_nnr, - // HlocR -> Hloc2, - // SlocR -> Sloc2, - //------------------------------ - std::vector Hloc_fixedR; - - // For HR_sparse[2], when nspin=1, only 0 is valid, when nspin=2, 0 means - // spin up, 1 means spin down - std::map, - std::map>> - HR_sparse[2]; - std::map, - std::map>> - SR_sparse; - std::map, - std::map>> - TR_sparse; - - std::map, - std::map>> - dHRx_sparse[2]; - std::map, - std::map>> - dHRy_sparse[2]; - std::map, - std::map>> - dHRz_sparse[2]; - - // For nspin = 4 - std::map, - std::map>>> - HR_soc_sparse; - std::map, - std::map>>> - SR_soc_sparse; - - std::map, - std::map>>> - dHRx_soc_sparse; - std::map, - std::map>>> - dHRy_soc_sparse; - std::map, - std::map>>> - dHRz_soc_sparse; - - // Records the R direct coordinates of HR and SR output, This variable will - // be filled with data when HR and SR files are output. - std::set> output_R_coor; - - // Record all R direct coordinate information, even if HR or SR is a zero - // matrix - std::set> all_R_coor; -}; - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_allocate.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_allocate.cpp deleted file mode 100644 index fa58317d62..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_allocate.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "source_base/timer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -namespace LCAO_domain -{ -#ifdef __MLALGO -// It seems it is only related to DeePKS, so maybe we should move it to DeeKS_domain -template -void DeePKS_init(const UnitCell& ucell, - Parallel_Orbitals& pv, - const int& nks, - const LCAO_Orbitals& orb, - LCAO_Deepks& ld, - std::ofstream& ofs) -{ - ModuleBase::TITLE("LCAO_domain", "DeePKS_init"); - // preparation for DeePKS - if (PARAM.inp.deepks_out_labels == 1 || PARAM.inp.deepks_scf) - { - // allocate relevant data structures for calculating descriptors - std::vector na; - na.resize(ucell.ntype); - for (int it = 0; it < ucell.ntype; it++) - { - na[it] = ucell.atoms[it].na; - } - - ld.init(orb, ucell.nat, ucell.ntype, nks, pv, na, ofs); - - if (PARAM.inp.deepks_scf) - { - ld.allocate_V_delta(ucell.nat, nks); - } - } - return; -} - -template void DeePKS_init(const UnitCell& ucell, - Parallel_Orbitals& pv, - const int& nks, - const LCAO_Orbitals& orb, - LCAO_Deepks& ld, - std::ofstream& ofs); - -template void DeePKS_init>(const UnitCell& ucell, - Parallel_Orbitals& pv, - const int& nks, - const LCAO_Orbitals& orb, - LCAO_Deepks>& ld, - std::ofstream& ofs); -#endif -} // namespace LCAO_domain diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h deleted file mode 100644 index 5bffaf3c57..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef LCAO_DOMAIN_H -#define LCAO_DOMAIN_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/vector3.h" -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" -#include "module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h" -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" - -namespace LCAO_domain -{ - -void init_basis_lcao(Parallel_Orbitals& pv, - const double& onsite_radius, - const double& lcao_ecut, - const double& lcao_dk, - const double& lcao_dr, - const double& lcao_rmax, - UnitCell& ucell, - TwoCenterBundle& two_center_bundle, - LCAO_Orbitals& orb); - -void build_Nonlocal_mu_new(const Parallel_Orbitals& pv, - ForceStressArrays& fsr, // mohan 2024-06-16 - double* HlocR, - const bool& calc_deri, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator& intor_orb_beta, - const Grid_Driver* GridD); - -/** - * @brief prepare gird integration - */ -void grid_prepare(const Grid_Technique& gt, - Gint_Gamma& gint_gamma, - Gint_k& gint_k, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const ModulePW::PW_Basis& rhopw, - const ModulePW::PW_Basis_Big& bigpw); - -/** - * @brief set the elements of force-related matrices in LCAO method - */ -void set_force(const Parallel_Orbitals& pv, - const int& iw1_all, - const int& iw2_all, - const double& vx, - const double& vy, - const double& vz, - const char& dtype, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - double* dhloc_fixed_x, - double* dhloc_fixed_y, - double* dhloc_fixed_z); - -/** - * @brief set the elements of stress-related matrices in LCAO method - */ -void set_stress(const Parallel_Orbitals& pv, - const int& iw1_all, - const int& iw2_all, - const double& vx, - const double& vy, - const double& vz, - const char& dtype, - const ModuleBase::Vector3& dtau, - double* dsloc_11, - double* dsloc_12, - double* dsloc_13, - double* dsloc_22, - double* dsloc_23, - double* dsloc_33, - double* dhloc_fixed_11, - double* dhloc_fixed_12, - double* dhloc_fixed_13, - double* dhloc_fixed_22, - double* dhloc_fixed_23, - double* dhloc_fixed_33); - -/** - * @brief set each element without derivatives - */ -void single_overlap(const LCAO_Orbitals& orb, - const TwoCenterBundle& two_center_bundle, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const int nspin, - const bool cal_stress, - const int iw1_all, - const int iw2_all, - const int m1, - const int m2, - const char& dtype, - const int T1, - const int L1, - const int N1, - const int T2, - const int L2, - const int N2, - const ModuleBase::Vector3& dtau, - const ModuleBase::Vector3& tau1, - const ModuleBase::Vector3& tau2, - const int npol, - const int jj, - const int jj0, - const int kk, - const int kk0, - int& nnr, // output value - int& total_nnr, // output value - double* olm, // output value - double* HSloc); // output value - -/** - * @brief set each element of T matrices - */ -void single_derivative(ForceStressArrays& fsr, - const LCAO_Orbitals& orb, - const TwoCenterBundle& two_center_bundle, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const int nspin, - const bool cal_stress, - const int iw1_all, - const int iw2_all, - const int m1, - const int m2, - const char& dtype, - const int T1, - const int L1, - const int N1, - const int T2, - const int L2, - const int N2, - const ModuleBase::Vector3& dtau, - const ModuleBase::Vector3& tau1, - const ModuleBase::Vector3& tau2, - const int npol, - const int jj, - const int jj0, - const int kk, - const int kk0, - int& nnr, // output value - int& total_nnr, // output value - double* olm); // output value - -/** - * @brief set the elements of S and T matrices - */ -void build_ST_new(ForceStressArrays& fsr, - const char& dtype, - const bool& cal_deri, - const bool& cal_stress, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const TwoCenterBundle& two_center_bundle, - const Grid_Driver* GridD, - double* SHlocR, - bool cal_syns = false, - double dmax = 0.0); - -/** - * @brief set zeros for HSR matrices - */ -void zeros_HSR(const char& mtype, LCAO_HS_Arrays& HS_arrays); - -#ifdef __MLALGO -template -void DeePKS_init(const UnitCell& ucell, - Parallel_Orbitals& pv, - const int& nks, - const LCAO_Orbitals& orb, - LCAO_Deepks& ld, - std::ofstream& ofs); -#endif - -template -void set_mat2d(const int& global_ir, const int& global_ic, const T& v, const Parallel_Orbitals& pv, T* mat); - -} // namespace LCAO_domain - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_hamilt.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_hamilt.hpp deleted file mode 100644 index d79f621677..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_hamilt.hpp +++ /dev/null @@ -1,152 +0,0 @@ -#include "module_parameter/parameter.h" - -#ifndef LCAO_HAMILT_HPP -#define LCAO_HAMILT_HPP - -#include "source_base/abfs-vector3_order.h" -#include "source_base/global_variable.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_exx.h" -#include "module_ri/RI_2D_Comm.h" - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __EXX -// Peize Lin add 2022.09.13 - -template -void sparse_format::cal_HR_exx(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const int& current_spin, - const double& sparse_threshold, - const int (&nmp)[3], - const std::vector>, - RI::Tensor>>>& Hexxs) { - ModuleBase::TITLE("sparse_format", "cal_HR_exx"); - ModuleBase::timer::tick("sparse_format", "cal_HR_exx"); - - const Tdata frac = GlobalC::exx_info.info_global.hybrid_alpha; - - std::map> atoms_pos; - for (int iat = 0; iat < ucell.nat; ++iat) { - atoms_pos[iat] = RI_Util::Vector3_to_array3( - ucell.atoms[ucell.iat2it[iat]] - .tau[ucell.iat2ia[iat]]); - } - const std::array, 3> latvec - = {RI_Util::Vector3_to_array3(ucell.a1), // too bad to use GlobalC here, - RI_Util::Vector3_to_array3(ucell.a2), - RI_Util::Vector3_to_array3(ucell.a3)}; - - const std::array Rs_period = {nmp[0], nmp[1], nmp[2]}; - - RI::Cell_Nearest cell_nearest; - cell_nearest.init(atoms_pos, latvec, Rs_period); - - const std::vector is_list = (PARAM.inp.nspin != 4) - ? std::vector{current_spin} - : std::vector{0, 1, 2, 3}; - - for (const int is: is_list) - { - int is0_b = 0; - int is1_b = 0; - std::tie(is0_b, is1_b) = RI_2D_Comm::split_is_block(is); - - if (Hexxs.empty()) - { - break; - } - - for (const auto& HexxA: Hexxs[is]) - { - const int iat0 = HexxA.first; - for (const auto& HexxB: HexxA.second) - { - const int iat1 = HexxB.first.first; - - const Abfs::Vector3_Order R = RI_Util::array3_to_Vector3( - cell_nearest.get_cell_nearest_discrete(iat0, - iat1, - HexxB.first.second)); - - HS_Arrays.all_R_coor.insert(R); - - const RI::Tensor& Hexx = HexxB.second; - - for (size_t iw0 = 0; iw0 < Hexx.shape[0]; ++iw0) - { - const int iwt0 = RI_2D_Comm::get_iwt(ucell,iat0, iw0, is0_b); - const int iwt0_local = pv.global2local_row(iwt0); - - if (iwt0_local < 0) - { - continue; - } - - for (size_t iw1 = 0; iw1 < Hexx.shape[1]; ++iw1) - { - const int iwt1 = RI_2D_Comm::get_iwt(ucell,iat1, iw1, is1_b); - const int iwt1_local = pv.global2local_col(iwt1); - - if (iwt1_local < 0) - { - continue; - } - - if (std::abs(Hexx(iw0, iw1)) > sparse_threshold) - { - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - auto& HR_sparse_ptr - = HS_Arrays - .HR_sparse[current_spin][R][iwt0]; - double& HR_sparse = HR_sparse_ptr[iwt1]; - HR_sparse += RI::Global_Func::convert( - frac * Hexx(iw0, iw1)); - if (std::abs(HR_sparse) <= sparse_threshold) - { - HR_sparse_ptr.erase(iwt1); - } - } - else if (PARAM.inp.nspin == 4) - { - auto& HR_sparse_ptr - = HS_Arrays.HR_soc_sparse[R][iwt0]; - - std::complex& HR_sparse - = HR_sparse_ptr[iwt1]; - - HR_sparse += RI::Global_Func::convert< - std::complex>(frac * Hexx(iw0, iw1)); - - if (std::abs(HR_sparse) <= sparse_threshold) - { - HR_sparse_ptr.erase(iwt1); - } - } - else - { - throw std::invalid_argument(std::string(__FILE__) + " line " - + std::to_string(__LINE__)); - } - } - } - } - } - } - } - - ModuleBase::timer::tick("sparse_format", "cal_HR_exx"); -} -#endif - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_init_basis.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_init_basis.cpp deleted file mode 100644 index af1da82243..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_init_basis.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "LCAO_domain.h" - -#include "module_parameter/parameter.h" -/// once the GlobalC::exx_info has been deleted, this include can be gone -/// mohan note 2024-07-21 -#ifdef __EXX -#include "source_pw/hamilt_pwdft/global.h" -#endif - -namespace LCAO_domain -{ - -void init_basis_lcao(Parallel_Orbitals& pv, - const double &onsite_radius, - const double &lcao_ecut, - const double &lcao_dk, - const double &lcao_dr, - const double &lcao_rmax, - UnitCell& ucell, - TwoCenterBundle& two_center_bundle, - LCAO_Orbitals& orb -) -{ - ModuleBase::TITLE("ESolver_KS_LCAO", "init_basis_lcao"); - - const int nlocal = PARAM.globalv.nlocal; - int nb2d = PARAM.inp.nb2d; - // autoset NB2D first - if (nb2d == 0) - { - if (nlocal > 0) - { - nb2d = (PARAM.inp.nspin == 4) ? 2 : 1; - } - if (nlocal > 500) - { - nb2d = 32; - } - if (nlocal > 1000) - { - nb2d = 64; - } - } - - // * reading the localized orbitals/projectors - // * construct the interpolation tables. - - two_center_bundle.build_orb(ucell.ntype, ucell.orbital_fn.data()); - two_center_bundle.build_alpha(PARAM.globalv.deepks_setorb, &ucell.descriptor_file); - two_center_bundle.build_orb_onsite(onsite_radius); - // currently deepks only use one descriptor file, so cast bool to int is - // fine - - // TODO Due to the omnipresence of LCAO_Orbitals, we still have to rely - // on the old interface for now. - two_center_bundle.to_LCAO_Orbitals(orb, lcao_ecut, lcao_dk, lcao_dr, lcao_rmax); - - if (PARAM.inp.vnl_in_h) - { - ucell.infoNL.setupNonlocal(ucell.ntype, ucell.atoms, GlobalV::ofs_running, orb); - two_center_bundle.build_beta(ucell.ntype, ucell.infoNL.Beta); - } - - int Lmax = 0; -#ifdef __EXX - Lmax = GlobalC::exx_info.info_ri.abfs_Lmax; -#endif - -#ifdef USE_NEW_TWO_CENTER - two_center_bundle.tabulate(); -#else - two_center_bundle.tabulate(lcao_ecut, lcao_dk, lcao_dr, lcao_rmax); -#endif - - // setup_2d_division -#ifdef __MPI - // storage form of H and S matrices on each processor - // is determined in 'divide_HS_2d' subroutine - - int try_nb = pv.init(nlocal, nlocal, nb2d, DIAG_WORLD); - try_nb += pv.set_nloc_wfc_Eij(PARAM.inp.nbands, GlobalV::ofs_running, GlobalV::ofs_warning); - if (try_nb != 0) - { - // fall back to the minimum size, 1 or 2 (nspin=4) - const int min_size = (PARAM.inp.nspin == 4) ? 2 : 1; - pv.set(nlocal, nlocal, min_size, pv.blacs_ctxt); - try_nb = pv.set_nloc_wfc_Eij(PARAM.inp.nbands, GlobalV::ofs_running, GlobalV::ofs_warning); - } - - // init blacs context for genelpa - pv.set_desc_wfc_Eij(nlocal, PARAM.inp.nbands, pv.nrow); - -#else - pv.set_serial(nlocal, nlocal); - pv.nrow_bands = nlocal; - pv.ncol_bands = PARAM.inp.nbands; - // Zhang Xiaoyang enable the serial version of LCAO and recovered this function usage. 2024-07-06 -#endif - - pv.set_atomic_trace(ucell.get_iat2iwt(), ucell.nat, nlocal); - - return; -} - -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_nl_mu.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_nl_mu.cpp deleted file mode 100644 index 665af92afc..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_nl_mu.cpp +++ /dev/null @@ -1,585 +0,0 @@ -#include "source_base/timer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_parameter/parameter.h" - -namespace LCAO_domain -{ - -typedef std::tuple key_tuple; - -#include "record_adj.h" //mohan add 2012-07-06 - -void build_Nonlocal_mu_new(const Parallel_Orbitals& pv, - ForceStressArrays& fsr, - double* NLloc, - const bool& calc_deri, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator& intor_orb_beta, - const Grid_Driver* GridD) -{ - ModuleBase::TITLE("LCAO_domain", "vnl_mu_new"); - ModuleBase::timer::tick("LCAO_domain", "vnl_mu_new"); - - const int nspin = PARAM.inp.nspin; - const int npol = PARAM.globalv.npol; - const bool gamma_only_local = PARAM.globalv.gamma_only_local; - - // < phi1 | beta > < beta | phi2 > - // phi1 is within the unitcell. - // while beta is in the supercell. - // while phi2 is in the supercell. - - // Step 1 : generate - - // This is the data structure for storing - // It is a 4 layer data structure - // The outmost layer is std::vector with size being number of atoms in unit cell - // The second layer is a map, the key being a combination of 4 number (iat, dRx, dRy, dRz) - // which identifies a unique adjacent atom of the first atom - // The third layer is an unordered map, with key being the index of atomic basis |psi> - // The inner layer is a vector, each element representing a projector |beta> - // It then either stores the number (nlm_tot) - // or a vector of 4, storing additionally (nlm_tot1) x_i=x,y,z - std::vector>>> nlm_tot; - std::vector>>>> nlm_tot1; - - if (!calc_deri) - { - nlm_tot.resize(ucell.nat); - } - else - { - nlm_tot1.resize(ucell.nat); - } -#ifdef _OPENMP -#pragma omp parallel for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; iat++) - { - const int it = ucell.iat2it[iat]; - const int ia = ucell.iat2ia[iat]; - - const double Rcut_Beta = ucell.infoNL.Beta[it].get_rcut_max(); - const ModuleBase::Vector3 tau = ucell.atoms[it].tau[ia]; - AdjacentAtomInfo adjs; - GridD->Find_atom(ucell, tau, it, ia, &adjs); - - if (!calc_deri) - { - nlm_tot[iat].clear(); - } - else - { - nlm_tot1[iat].clear(); - } - - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - const double Rcut_AO1 = orb.Phi[T1].getRcut(); - - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell.atoms[T1]; - const int nw1_tot = atom1->nw * npol; - - const ModuleBase::Vector3 dtau = tau1 - tau; - const double dist1 = dtau.norm2() * pow(ucell.lat0, 2); - - if (dist1 > pow(Rcut_Beta + Rcut_AO1, 2)) - { - continue; - } - std::unordered_map> nlm_cur; - std::unordered_map>> nlm_cur1; - - if (!calc_deri) - { - nlm_cur.clear(); - } - else - { - nlm_cur1.clear(); - } - for (int iw1 = 0; iw1 < nw1_tot; ++iw1) - { - const int iw1_all = start1 + iw1; - const int iw1_local = pv.global2local_row(iw1_all); - const int iw2_local = pv.global2local_col(iw1_all); - if (iw1_local < 0 && iw2_local < 0) { - continue; -} - const int iw1_0 = iw1 / npol; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - - int L1 = atom1->iw2l[iw1_0]; - int N1 = atom1->iw2n[iw1_0]; - int m1 = atom1->iw2m[iw1_0]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - ModuleBase::Vector3 dtau = tau - tau1; - intor_orb_beta.snap(T1, L1, N1, M1, it, dtau * ucell.lat0, calc_deri, nlm); - - if (!calc_deri) - { - nlm_cur.insert({iw1_all, nlm[0]}); - } - else - { - nlm_cur1.insert({iw1_all, nlm}); - } - } // end iw - - const int iat1 = ucell.itia2iat(T1, I1); - const int rx1 = adjs.box[ad].x; - const int ry1 = adjs.box[ad].y; - const int rz1 = adjs.box[ad].z; - key_tuple key_1(iat1, rx1, ry1, rz1); - - if (!calc_deri) - { - nlm_tot[iat][key_1] = nlm_cur; - } - else - { - nlm_tot1[iat][key_1] = nlm_cur1; - } - } // end ad - } - - //======================================================= - // Step2: - // calculate sum_(L0,M0) beta - // and accumulate the value to Hloc_fixedR(i,j) - //======================================================= - int total_nnr = 0; -#ifdef _OPENMP -#pragma omp parallel reduction(+ : total_nnr) - { -#endif - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 dtau1, dtau2, tau0; - double distance = 0.0; - double rcut = 0.0; - double rcut1 = 0.0; - double rcut2 = 0.0; - - // Record_adj RA; - // RA.for_2d(); - - // psi1 -#ifdef _OPENMP -// use schedule(dynamic) for load balancing because adj_num is various -#pragma omp for schedule(dynamic) -#endif - for (int iat1 = 0; iat1 < ucell.nat; iat1++) - { - const int T1 = ucell.iat2it[iat1]; - const Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat1]; - { - // GridD->Find_atom( atom1->tau[I1] ); - AdjacentAtomInfo adjs; - GridD->Find_atom(ucell, atom1->tau[I1], T1, I1, &adjs); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - // Record_adj.for_2d() may not called in some case - int nnr = pv.nlocstart ? pv.nlocstart[iat1] : 0; - tau1 = atom1->tau[I1]; - - // psi2 - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const Atom* atom2 = &ucell.atoms[T2]; - - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell.itia2iat(T2, I2); - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - tau2 = adjs.adjacent_tau[ad2]; - - bool is_adj = false; - - const int rx2 = adjs.box[ad2].x; - const int ry2 = adjs.box[ad2].y; - const int rz2 = adjs.box[ad2].z; - - dtau = tau2 - tau1; - distance = dtau.norm2() * pow(ucell.lat0, 2); - // this rcut is in order to make nnr consistent - // with other matrix. - rcut = pow(orb.Phi[T1].getRcut() + orb.Phi[T2].getRcut(), 2); - if (distance < rcut) { - is_adj = true; - } else if (distance >= rcut) - { - for (int ad0 = 0; ad0 < adjs.adj_num + 1; ++ad0) - { - const int T0 = adjs.ntype[ad0]; - - tau0 = adjs.adjacent_tau[ad0]; - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - - const double distance1 = dtau1.norm2() * pow(ucell.lat0, 2); - const double distance2 = dtau2.norm2() * pow(ucell.lat0, 2); - - rcut1 = pow(orb.Phi[T1].getRcut() + ucell.infoNL.Beta[T0].get_rcut_max(), 2); - rcut2 = pow(orb.Phi[T2].getRcut() + ucell.infoNL.Beta[T0].get_rcut_max(), 2); - - if (distance1 < rcut1 && distance2 < rcut2) - { - is_adj = true; - break; - } - } - } - - if (is_adj) - { - // < psi1 | all projectors | psi2 > - // ----------------------------- enter the nnr increaing zone ------------------------- - for (int ad0 = 0; ad0 < adjs.adj_num + 1; ++ad0) - { - const int T0 = adjs.ntype[ad0]; - const int I0 = adjs.natom[ad0]; - const int iat = ucell.itia2iat(T0, I0); - - // mohan add 2010-12-19 - if (ucell.infoNL.nproj[T0] == 0) - { - continue; - } - - tau0 = adjs.adjacent_tau[ad0]; - - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - const double distance1 = dtau1.norm2() * pow(ucell.lat0, 2); - const double distance2 = dtau2.norm2() * pow(ucell.lat0, 2); - - // seems a bug here!! mohan 2011-06-17 - rcut1 = pow(orb.Phi[T1].getRcut() + ucell.infoNL.Beta[T0].get_rcut_max(), 2); - rcut2 = pow(orb.Phi[T2].getRcut() + ucell.infoNL.Beta[T0].get_rcut_max(), 2); - - if (distance1 >= rcut1 || distance2 >= rcut2) - { - continue; - } - // const Atom* atom0 = &ucell.atoms[T0]; - const int rx0 = adjs.box[ad0].x; - const int ry0 = adjs.box[ad0].y; - const int rz0 = adjs.box[ad0].z; - key_tuple key1(iat1, -rx0, -ry0, -rz0); - key_tuple key2(iat2, rx2 - rx0, ry2 - ry0, rz2 - rz0); - - std::unordered_map>* nlm_cur1_e; // left hand side, for energy - std::unordered_map>>* nlm_cur1_f; // lhs, for force - std::unordered_map>* nlm_cur2_e; // rhs, for energy - std::unordered_map>>* nlm_cur2_f; // rhs, for force - - if (!calc_deri) - { - nlm_cur1_e = &nlm_tot[iat][key1]; - nlm_cur2_e = &nlm_tot[iat][key2]; - } - else - { - nlm_cur1_f = &nlm_tot1[iat][key1]; - nlm_cur2_f = &nlm_tot1[iat][key2]; - } - - int nnr_inner = 0; - - for (int j = 0; j < atom1->nw * npol; j++) - { - const int j0 = j / npol; // added by zhengdy-soc - const int iw1_all = start1 + j; - const int mu = pv.global2local_row(iw1_all); - if (mu < 0) { - continue; -} - - // fix a serious bug: atom2[T2] -> atom2 - // mohan 2010-12-20 - for (int k = 0; k < atom2->nw * npol; k++) - { - const int k0 = k / npol; - const int iw2_all = start2 + k; - const int nu = pv.global2local_col(iw2_all); - if (nu < 0) { - continue; -} - - if (!calc_deri) - { - std::vector nlm_1 = (*nlm_cur1_e)[iw1_all]; - std::vector nlm_2 = (*nlm_cur2_e)[iw2_all]; - if (nspin == 2 || nspin == 1) - { - double nlm_tmp = 0.0; - const double* tmp_d = nullptr; - for (int no = 0; no < ucell.atoms[T0].ncpp.non_zero_count_soc[0]; no++) - { - const int p1 = ucell.atoms[T0].ncpp.index1_soc[0][no]; - const int p2 = ucell.atoms[T0].ncpp.index2_soc[0][no]; - ucell.atoms[T0].ncpp.get_d(0, p1, p2, tmp_d); - nlm_tmp += nlm_2[p2] * nlm_1[p1] * (*tmp_d); - } - - if (gamma_only_local) - { - // mohan add 2010-12-20 - if (nlm_tmp != 0.0) - { - LCAO_domain::set_mat2d(iw1_all, - iw2_all, - nlm_tmp, - pv, - NLloc); // N stands for nonlocal. - } - } - else - { - if (nlm_tmp != 0.0) - { - NLloc[nnr + nnr_inner] += nlm_tmp; - } - } - } // end nspin - } // calc_deri - else // calculate the derivative - { - if (nspin == 4) - { - std::vector nlm_1 = (*nlm_cur2_f)[iw2_all][0]; - std::vector> nlm_2; - nlm_2.resize(3); - for (int i = 0; i < 3; i++) - { - nlm_2[i] = (*nlm_cur1_f)[iw1_all][i + 1]; - } - std::complex nlm[4][3] = {ModuleBase::ZERO}; - int is0 = (j - j0 * npol) + (k - k0 * npol) * 2; - for (int no = 0; no < ucell.atoms[T0].ncpp.non_zero_count_soc[is0]; no++) - { - const int p1 = ucell.atoms[T0].ncpp.index1_soc[is0][no]; - const int p2 = ucell.atoms[T0].ncpp.index2_soc[is0][no]; - if (is0 == 0) - { - fsr.DHloc_fixedR_x[nnr + nnr_inner] - += nlm_2[0][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(0, p2, p1).real() - + ucell.atoms[T0].ncpp.d_so(3, p2, p1).real()) - * 0.5; - fsr.DHloc_fixedR_y[nnr + nnr_inner] - += nlm_2[1][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(0, p2, p1).real() - + ucell.atoms[T0].ncpp.d_so(3, p2, p1).real()) - * 0.5; - fsr.DHloc_fixedR_z[nnr + nnr_inner] - += nlm_2[2][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(0, p2, p1).real() - + ucell.atoms[T0].ncpp.d_so(3, p2, p1).real()) - * 0.5; - } - else if (is0 == 1) - { - fsr.DHloc_fixedR_x[nnr + nnr_inner] - += nlm_2[0][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(1, p2, p1).real() - + ucell.atoms[T0].ncpp.d_so(2, p2, p1).real()) - * 0.5; - fsr.DHloc_fixedR_y[nnr + nnr_inner] - += nlm_2[1][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(1, p2, p1).real() - + ucell.atoms[T0].ncpp.d_so(2, p2, p1).real()) - * 0.5; - fsr.DHloc_fixedR_z[nnr + nnr_inner] - += nlm_2[2][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(1, p2, p1).real() - + ucell.atoms[T0].ncpp.d_so(2, p2, p1).real()) - * 0.5; - } - else if (is0 == 2) - { - fsr.DHloc_fixedR_x[nnr + nnr_inner] - += nlm_2[0][p1] * nlm_1[p2] - * (-ucell.atoms[T0].ncpp.d_so(1, p2, p1).imag() - + ucell.atoms[T0].ncpp.d_so(2, p2, p1).imag()) - * 0.5; - fsr.DHloc_fixedR_y[nnr + nnr_inner] - += nlm_2[1][p1] * nlm_1[p2] - * (-ucell.atoms[T0].ncpp.d_so(1, p2, p1).imag() - + ucell.atoms[T0].ncpp.d_so(2, p2, p1).imag()) - * 0.5; - fsr.DHloc_fixedR_z[nnr + nnr_inner] - += nlm_2[2][p1] * nlm_1[p2] - * (-ucell.atoms[T0].ncpp.d_so(1, p2, p1).imag() - + ucell.atoms[T0].ncpp.d_so(2, p2, p1).imag()) - * 0.5; - } - else if (is0 == 3) - { - fsr.DHloc_fixedR_x[nnr + nnr_inner] - += nlm_2[0][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(0, p2, p1).real() - - ucell.atoms[T0].ncpp.d_so(3, p2, p1).real()) - * 0.5; - fsr.DHloc_fixedR_y[nnr + nnr_inner] - += nlm_2[1][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(0, p2, p1).real() - - ucell.atoms[T0].ncpp.d_so(3, p2, p1).real()) - * 0.5; - fsr.DHloc_fixedR_z[nnr + nnr_inner] - += nlm_2[2][p1] * nlm_1[p2] - * (ucell.atoms[T0].ncpp.d_so(0, p2, p1).real() - - ucell.atoms[T0].ncpp.d_so(3, p2, p1).real()) - * 0.5; - } - } - } - else if (nspin == 1 || nspin == 2) - { - if (gamma_only_local) - { - double nlm[3] = {0, 0, 0}; - - // sum all projectors for one atom. - std::vector nlm_1 = (*nlm_cur1_f)[iw1_all][0]; - std::vector> nlm_2; - nlm_2.resize(3); - for (int i = 0; i < 3; i++) - { - nlm_2[i] = (*nlm_cur2_f)[iw2_all][i + 1]; - } - - assert(nlm_1.size() == nlm_2[0].size()); - - const double* tmp_d = nullptr; - for (int no = 0; no < ucell.atoms[T0].ncpp.non_zero_count_soc[0]; no++) - { - const int p1 = ucell.atoms[T0].ncpp.index1_soc[0][no]; - const int p2 = ucell.atoms[T0].ncpp.index2_soc[0][no]; - ucell.atoms[T0].ncpp.get_d(0, p1, p2, tmp_d); - for (int ir = 0; ir < 3; ir++) - { - nlm[ir] += nlm_2[ir][p2] * nlm_1[p1] * (*tmp_d); - } - } - - LCAO_domain::set_force(pv, - iw1_all, - iw2_all, - nlm[0], - nlm[1], - nlm[2], - 'N', - fsr.DSloc_x, - fsr.DSloc_y, - fsr.DSloc_z, - fsr.DHloc_fixed_x, - fsr.DHloc_fixed_y, - fsr.DHloc_fixed_z); - } - else - { - // mohan change the order on 2011-06-17 - // origin: < psi1 | beta > < beta | dpsi2/dtau > - // now: < psi1/dtau | beta > < beta | psi2 > - double nlm[3] = {0, 0, 0}; - - // sum all projectors for one atom. - std::vector nlm_1 = (*nlm_cur2_f)[iw2_all][0]; - std::vector> nlm_2; - nlm_2.resize(3); - for (int i = 0; i < 3; i++) - { - nlm_2[i] = (*nlm_cur1_f)[iw1_all][i + 1]; - } - - assert(nlm_1.size() == nlm_2[0].size()); - - const double* tmp_d = nullptr; - for (int no = 0; no < ucell.atoms[T0].ncpp.non_zero_count_soc[0]; no++) - { - const int p1 = ucell.atoms[T0].ncpp.index1_soc[0][no]; - const int p2 = ucell.atoms[T0].ncpp.index2_soc[0][no]; - ucell.atoms[T0].ncpp.get_d(0, p1, p2, tmp_d); - for (int ir = 0; ir < 3; ir++) - { - nlm[ir] += nlm_2[ir][p2] * nlm_1[p1] * (*tmp_d); - } - } - - fsr.DHloc_fixedR_x[nnr + nnr_inner] += nlm[0]; - fsr.DHloc_fixedR_y[nnr + nnr_inner] += nlm[1]; - fsr.DHloc_fixedR_z[nnr + nnr_inner] += nlm[2]; - } - } - else - { - ModuleBase::WARNING_QUIT("LCAO_domain::build_Nonlocal_mu_new", - "nspin must be 1, 2 or 4"); - } - } //! calc_deri - nnr_inner++; - } // k - } // j - } // ad0 - - // outer circle : accumulate nnr - for (int j = 0; j < atom1->nw * npol; j++) - { - const int j0 = j / npol; // added by zhengdy-soc - const int iw1_all = start1 + j; - const int mu = pv.global2local_row(iw1_all); - if (mu < 0) - { - continue; - } - - // fix a serious bug: atom2[T2] -> atom2 - // mohan 2010-12-20 - for (int k = 0; k < atom2->nw * npol; k++) - { - const int k0 = k / npol; - const int iw2_all = start2 + k; - const int nu = pv.global2local_col(iw2_all); - if (nu < 0) - { - continue; - } - total_nnr++; - nnr++; - } - } - } // end is_adj - } // ad2 - } // I1 - } // T1 -#ifdef _OPENMP - } -#endif - if (!gamma_only_local) - { - if (total_nnr != pv.nnr) - { - GlobalV::ofs_running << " nr=" << total_nnr << std::endl; - GlobalV::ofs_running << " pv->nnr=" << pv.nnr << std::endl; - ModuleBase::WARNING_QUIT("LCAO_domain::build_Nonlocal_mu_new", "nnr!=LNNR.nnr"); - } - } - - ModuleBase::timer::tick("LCAO_domain", "vnl_mu_new"); - return; -} - -} // namespace LCAO_domain diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_fs.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_fs.cpp deleted file mode 100644 index 2aa26ff1fc..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_fs.cpp +++ /dev/null @@ -1,134 +0,0 @@ -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" - -namespace LCAO_domain -{ - -void set_force -( - const Parallel_Orbitals &pv, - const int &iw1_all, - const int &iw2_all, - const double& vx, - const double& vy, - const double& vz, - const char &dtype, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - double* dhloc_fixed_x, - double* dhloc_fixed_y, - double* dhloc_fixed_z) -{ - // use iw1_all and iw2_all to set Hloc - // becareful! The ir and ic may < 0!!!!!!!!!!!!!!!! - const int ir = pv.global2local_row(iw1_all); - const int ic = pv.global2local_col(iw2_all); - const long index = ir * pv.ncol + ic; - - if( index >= pv.nloc) - { - std::cout << " iw1_all = " << iw1_all << std::endl; - std::cout << " iw2_all = " << iw2_all << std::endl; - std::cout << " ir = " << ir << std::endl; - std::cout << " ic = " << ic << std::endl; - std::cout << " index = " << index << std::endl; - std::cout << " pv.nloc = " << pv.nloc << std::endl; - ModuleBase::WARNING_QUIT("LCAO_domain","set_force"); - } - - if (dtype == 'S') - { - dsloc_x[index] += vx; - dsloc_y[index] += vy; - dsloc_z[index] += vz; - } - else if (dtype == 'T') - { - // notice, the sign is '-', minus. - dhloc_fixed_x[index] -= vx; - dhloc_fixed_y[index] -= vy; - dhloc_fixed_z[index] -= vz; - } - else if (dtype == 'N') - { - dhloc_fixed_x[index] += vx; - dhloc_fixed_y[index] += vy; - dhloc_fixed_z[index] += vz; - } - - return; -} - -void set_stress -( - const Parallel_Orbitals &pv, - const int &iw1_all, - const int &iw2_all, - const double& vx, - const double& vy, - const double& vz, - const char &dtype, - const ModuleBase::Vector3 &dtau, - double* dsloc_11, - double* dsloc_12, - double* dsloc_13, - double* dsloc_22, - double* dsloc_23, - double* dsloc_33, - double* dhloc_fixed_11, - double* dhloc_fixed_12, - double* dhloc_fixed_13, - double* dhloc_fixed_22, - double* dhloc_fixed_23, - double* dhloc_fixed_33) -{ - // use iw1_all and iw2_all to set Hloc - // becareful! The ir and ic may < 0!!!!!!!!!!!!!!!! - const int ir = pv.global2local_row(iw1_all); - const int ic = pv.global2local_col(iw2_all); - const long index = ir * pv.ncol + ic; - - if( index >= pv.nloc) - { - std::cout << " iw1_all = " << iw1_all << std::endl; - std::cout << " iw2_all = " << iw2_all << std::endl; - std::cout << " ir = " << ir << std::endl; - std::cout << " ic = " << ic << std::endl; - std::cout << " index = " << index << std::endl; - std::cout << " pv.nloc = " << pv.nloc << std::endl; - ModuleBase::WARNING_QUIT("LCAO_domain","set_stress"); - } - - if (dtype == 'S') - { - dsloc_11[index] += vx * dtau.x; - dsloc_12[index] += vx * dtau.y; - dsloc_13[index] += vx * dtau.z; - dsloc_22[index] += vy * dtau.y; - dsloc_23[index] += vy * dtau.z; - dsloc_33[index] += vz * dtau.z; - } - else if (dtype == 'T') - { - // notice, the sign is '-', minus. - dhloc_fixed_11[index] -= vx * dtau.x; - dhloc_fixed_12[index] -= vx * dtau.y; - dhloc_fixed_13[index] -= vx * dtau.z; - dhloc_fixed_22[index] -= vy * dtau.y; - dhloc_fixed_23[index] -= vy * dtau.z; - dhloc_fixed_33[index] -= vz * dtau.z; - } - else if (dtype == 'N') - { - dhloc_fixed_11[index] += vx * dtau.x; - dhloc_fixed_12[index] += vx * dtau.y; - dhloc_fixed_13[index] += vx * dtau.z; - dhloc_fixed_22[index] += vy * dtau.y; - dhloc_fixed_23[index] += vy * dtau.z; - dhloc_fixed_33[index] += vz * dtau.z; - } - - return; -} - -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_mat2d.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_mat2d.cpp deleted file mode 100644 index 5506ca3904..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_mat2d.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" - -#include "module_parameter/parameter.h" -namespace LCAO_domain -{ - -//------------------------------------------------------ -// DESCRIPTION: -// set 'dtype' matrix element (iw1_all, iw2_all) with -// an input value 'v' -//------------------------------------------------------ -template -void set_mat2d( - const int& global_ir, // index i for atomic orbital (row) - const int& global_ic, // index j for atomic orbital (column) - const T& v, // value for matrix element (i,j) - const Parallel_Orbitals& pv, - T* HSloc) //input pointer for store the matrix -{ - // use iw1_all and iw2_all to set Hloc - // becareful! The ir and ic may be < 0 !!! - const int ir = pv.global2local_row(global_ir); - const int ic = pv.global2local_col(global_ic); - - const long index = - ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver) - ? ic * static_cast(pv.nrow) + ir - : ir * static_cast(pv.ncol) + ic; - - if (index >= pv.nloc) - { - std::cout << " iw1_all = " << global_ir << std::endl; - std::cout << " iw2_all = " << global_ic << std::endl; - std::cout << " ir = " << ir << std::endl; - std::cout << " ic = " << ic << std::endl; - std::cout << " index = " << index << std::endl; - std::cout << " ParaV->nloc = " << pv.nloc << std::endl; - ModuleBase::WARNING_QUIT("LCAO_domain", "set_mat2d"); - } - - //using input pointer HSloc - HSloc[index] += v; -} - -template void set_mat2d( - const int& global_ir, - const int& global_ic, - const double& v, - const Parallel_Orbitals& pv, - double* HSloc); - -template void set_mat2d>( - const int& global_ir, - const int& global_ic, - const std::complex& v, - const Parallel_Orbitals& pv, - std::complex* HSloc); - -} // namespace LCAO_domain diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_st.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_st.cpp deleted file mode 100644 index dbe172261d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_st.cpp +++ /dev/null @@ -1,554 +0,0 @@ -#include "source_base/timer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_parameter/parameter.h" - -namespace LCAO_domain -{ - -void single_derivative(ForceStressArrays& fsr, - const LCAO_Orbitals& orb, - const TwoCenterBundle& two_center_bundle, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const int nspin, - const bool cal_stress, - const int iw1_all, - const int iw2_all, - const int m1, - const int m2, - const char& dtype, - const int T1, - const int L1, - const int N1, - const int T2, - const int L2, - const int N2, - const ModuleBase::Vector3& dtau, - const ModuleBase::Vector3& tau1, - const ModuleBase::Vector3& tau2, - const int npol, - const int jj, - const int jj0, - const int kk, - const int kk0, - int& nnr, - int& total_nnr, - double* olm // output value -) -{ - - const bool gamma_only_local = PARAM.globalv.gamma_only_local; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - const int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - const int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - switch (dtype) - { - case 'S': - two_center_bundle.overlap_orb->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * ucell.lat0, nullptr, olm); - break; - case 'T': - two_center_bundle.kinetic_orb->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * ucell.lat0, nullptr, olm); - break; - default: // not supposed to happen - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "dtype must be S or T"); - } - - // condition 7: gamma only or multiple k - if (gamma_only_local) - { - LCAO_domain::set_force(pv, - iw1_all, - iw2_all, - olm[0], - olm[1], - olm[2], - dtype, - fsr.DSloc_x, - fsr.DSloc_y, - fsr.DSloc_z, - fsr.DHloc_fixed_x, - fsr.DHloc_fixed_y, - fsr.DHloc_fixed_z); - - if (cal_stress) - { - LCAO_domain::set_stress(pv, - iw1_all, - iw2_all, - olm[0], - olm[1], - olm[2], - dtype, - dtau, - fsr.DSloc_11, - fsr.DSloc_12, - fsr.DSloc_13, - fsr.DSloc_22, - fsr.DSloc_23, - fsr.DSloc_33, - fsr.DHloc_fixed_11, - fsr.DHloc_fixed_12, - fsr.DHloc_fixed_13, - fsr.DHloc_fixed_22, - fsr.DHloc_fixed_23, - fsr.DHloc_fixed_33); - } // end stress - } // end gamma_only - else // condition 7, multiple k-points algorithm - { - // condition 8, S or T - if (dtype == 'S') - { - // condition 9, nspin - if (nspin == 1 || nspin == 2) - { - fsr.DSloc_Rx[nnr] = olm[0]; - fsr.DSloc_Ry[nnr] = olm[1]; - fsr.DSloc_Rz[nnr] = olm[2]; - } - else if (nspin == 4) - { - int is = (jj - jj0 * npol) + (kk - kk0 * npol) * 2; - if (is == 0) // is==3 is not needed in force calculation - { - fsr.DSloc_Rx[nnr] = olm[0]; - fsr.DSloc_Ry[nnr] = olm[1]; - fsr.DSloc_Rz[nnr] = olm[2]; - } - else - { - fsr.DSloc_Rx[nnr] = 0.0; - fsr.DSloc_Ry[nnr] = 0.0; - fsr.DSloc_Rz[nnr] = 0.0; - } - } - else - { - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "nspin must be 1, 2 or 4"); - } // end condition 9, nspin - - if (cal_stress) - { - fsr.DH_r[nnr * 3] = dtau.x; - fsr.DH_r[nnr * 3 + 1] = dtau.y; - fsr.DH_r[nnr * 3 + 2] = dtau.z; - } - } - else if (dtype == 'T') // condition 8, S or T - { - // condtion 9, nspin - if (nspin == 1 || nspin == 2) - { - fsr.DHloc_fixedR_x[nnr] = olm[0]; - fsr.DHloc_fixedR_y[nnr] = olm[1]; - fsr.DHloc_fixedR_z[nnr] = olm[2]; - if (cal_stress) - { - fsr.stvnl11[nnr] = olm[0] * dtau.x; - fsr.stvnl12[nnr] = olm[0] * dtau.y; - fsr.stvnl13[nnr] = olm[0] * dtau.z; - fsr.stvnl22[nnr] = olm[1] * dtau.y; - fsr.stvnl23[nnr] = olm[1] * dtau.z; - fsr.stvnl33[nnr] = olm[2] * dtau.z; - } - } - else if (nspin == 4) // condition 9 - { - const int is = (jj - jj0 * npol) + (kk - kk0 * npol) * 2; - // condition 10, details of nspin 4 - if (is == 0) // is==3 is not needed in force calculation - { - fsr.DHloc_fixedR_x[nnr] = olm[0]; - fsr.DHloc_fixedR_y[nnr] = olm[1]; - fsr.DHloc_fixedR_z[nnr] = olm[2]; - if (cal_stress) - { - fsr.stvnl11[nnr] = olm[0] * dtau.x; - fsr.stvnl12[nnr] = olm[0] * dtau.y; - fsr.stvnl13[nnr] = olm[0] * dtau.z; - fsr.stvnl22[nnr] = olm[1] * dtau.y; - fsr.stvnl23[nnr] = olm[1] * dtau.z; - fsr.stvnl33[nnr] = olm[2] * dtau.z; - } - } - else if (is == 1 || is == 2 || is == 3) - { - fsr.DHloc_fixedR_x[nnr] = 0.0; - fsr.DHloc_fixedR_y[nnr] = 0.0; - fsr.DHloc_fixedR_z[nnr] = 0.0; - if (cal_stress) - { - fsr.stvnl11[nnr] = 0.0; - fsr.stvnl12[nnr] = 0.0; - fsr.stvnl13[nnr] = 0.0; - fsr.stvnl22[nnr] = 0.0; - fsr.stvnl23[nnr] = 0.0; - fsr.stvnl33[nnr] = 0.0; - } - } - else - { - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "is must be 0, 1, 2, 3"); - } // end condition 10, details of spin 4 - } - else - { - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "nspin must be 1, 2 or 4"); - } // end condition 9, nspin - } // end condition 8, S or T - ++total_nnr; - ++nnr; - } // end condition 7, gamma or multiple k -} - -void single_overlap(const LCAO_Orbitals& orb, - const TwoCenterBundle& two_center_bundle, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const int nspin, - const bool cal_stress, - const int iw1_all, - const int iw2_all, - const int m1, - const int m2, - const char& dtype, - const int T1, - const int L1, - const int N1, - const int T2, - const int L2, - const int N2, - const ModuleBase::Vector3& dtau, - const ModuleBase::Vector3& tau1, - const ModuleBase::Vector3& tau2, - const int npol, - const int jj, - const int jj0, - const int kk, - const int kk0, - int& nnr, // output value - int& total_nnr, // output value - double* olm, // output value - double* HSloc // output value -) -{ - const bool gamma_only_local = PARAM.globalv.gamma_only_local; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - const int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - const int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - switch (dtype) - { - case 'S': - two_center_bundle.overlap_orb->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * ucell.lat0, olm); - break; - case 'T': - two_center_bundle.kinetic_orb->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * ucell.lat0, olm); - break; - default: // not supposed to happen - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "dtype must be S or T"); - } - - // When NSPIN == 4 , only diagonal term is calculated for T or S Operators - // use olm1 to store the diagonal term with complex data type. - std::complex olm1[4]; - - if (nspin == 4) - { - olm1[0] = std::complex(olm[0], 0.0); - olm1[1] = ModuleBase::ZERO; - olm1[2] = ModuleBase::ZERO; - olm1[3] = std::complex(olm[0], 0.0); - } - - // condition 7, gamma only or multiple k-points - if (gamma_only_local) - { - // mohan add 2010-06-29 - // set the value in Hloc and Sloc - // according to global2local_row and global2local_col - // the last paramete: 1 for Sloc, 2 for Hloc - // and 3 for Hloc_fixed. - LCAO_domain::set_mat2d(iw1_all, iw2_all, olm[0], pv, HSloc); - } - else // condition 7, multiple k-points algorithm - { - // condition 8, S or T - if (dtype == 'S') - { - // condition 9, nspin - if (nspin == 1 || nspin == 2) - { - HSloc[nnr] = olm[0]; - } - else - { - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "nspin must be 1, 2 or 4"); - } - } - else if (dtype == 'T') // condition 8, S or T - { - // condition 9, nspin - if (nspin == 1 || nspin == 2) - { - HSloc[nnr] = olm[0]; // - } - else if (nspin == 4) - { // only has diagonal term here. - } - else - { - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "nspin must be 1, 2 or 4"); - } - } // end condition 8, S or T - ++total_nnr; - ++nnr; - } // end condition 7, gamma point or multiple k-points -} - -void build_ST_new(ForceStressArrays& fsr, - const char& dtype, - const bool& calc_deri, - const bool& cal_stress, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const TwoCenterBundle& two_center_bundle, - const Grid_Driver* GridD, - double* HSloc, - bool cal_syns, - double dmax) -{ - ModuleBase::TITLE("LCAO_domain", "build_ST_new"); - ModuleBase::timer::tick("LCAO_domain", "build_ST_new"); - - const int nspin = PARAM.inp.nspin; - const int npol = PARAM.globalv.npol; - const bool gamma_only_local = PARAM.globalv.gamma_only_local; - - int total_nnr = 0; -#ifdef _OPENMP -#pragma omp parallel reduction(+ : total_nnr) - { -#endif - // array to store data - double olm[3] = {0.0, 0.0, 0.0}; - - //\sum{T} e**{ikT} <\phi_{ia}|d\phi_{k\beta}(T)> - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 dtau1, dtau2, tau0; - -#ifdef _OPENMP -// use schedule(dynamic) for load balancing because adj_num is various -#pragma omp for schedule(dynamic) -#endif - for (int iat1 = 0; iat1 < ucell.nat; iat1++) // loop 1, iat1 - { - const int T1 = ucell.iat2it[iat1]; - const Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat1]; - - tau1 = atom1->tau[I1]; - - // GridD->Find_atom(tau1); - AdjacentAtomInfo adjs; - GridD->Find_atom(ucell, tau1, T1, I1, &adjs); - // Record_adj.for_2d() may not called in some case - int nnr = pv.nlocstart ? pv.nlocstart[iat1] : 0; - - if (cal_syns) - { - for (int k = 0; k < 3; k++) - { - tau1[k] = tau1[k] - atom1->vel[I1][k] * PARAM.mdp.md_dt / ModuleBase::AU_to_FS / ucell.lat0; - } - } - - // loop 2, ad - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - Atom* atom2 = &ucell.atoms[T2]; - tau2 = adjs.adjacent_tau[ad]; - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb.Phi[T1].getRcut() + orb.Phi[T2].getRcut(); - - // condition 3, distance - if (distance < rcut) - { - int iw1_all = ucell.itiaiw2iwt(T1, I1, 0); // iw1_all = combined index (it, ia, iw) - - // loop 4, jj - for (int jj = 0; jj < atom1->nw * npol; ++jj) - { - const int jj0 = jj / npol; - const int L1 = atom1->iw2l[jj0]; - const int N1 = atom1->iw2n[jj0]; - const int m1 = atom1->iw2m[jj0]; - - int iw2_all = ucell.itiaiw2iwt(T2, I2, 0); // zhengdy-soc - - // loop 5, kk - for (int kk = 0; kk < atom2->nw * npol; ++kk) - { - const int kk0 = kk / npol; - const int L2 = atom2->iw2l[kk0]; - const int N2 = atom2->iw2n[kk0]; - const int m2 = atom2->iw2m[kk0]; - - // mohan add 2010-06-29 - // this is in fact the same as in build_Nonlocal_mu, - // the difference is that here we use {L,N,m} for ccycle, - // build_Nonlocal_mu use atom.nw for cycle. - // so, here we use ParaO::in_this_processor, - // in build_Non... use global2local_row - // and global2local_col directly, - if (!pv.in_this_processor(iw1_all, iw2_all)) - { - ++iw2_all; - continue; - } - - olm[0] = 0.0; - olm[1] = 0.0; - olm[2] = 0.0; - - // condition 6, not calculate the derivative - if (!calc_deri) - { - single_overlap(orb, - two_center_bundle, - pv, - ucell, - nspin, - cal_stress, - iw1_all, - iw2_all, - m1, - m2, - dtype, - T1, - L1, - N1, - T2, - L2, - N2, - dtau, - tau1, - tau2, - npol, - jj, - jj0, - kk, - kk0, - nnr, - total_nnr, - olm, - HSloc); - } - else // condition 6, calculate the derivative - { - single_derivative(fsr, - orb, - two_center_bundle, - pv, - ucell, - nspin, - cal_stress, - iw1_all, - iw2_all, - m1, - m2, - dtype, - T1, - L1, - N1, - T2, - L2, - N2, - dtau, - tau1, - tau2, - npol, - jj, - jj0, - kk, - kk0, - nnr, - total_nnr, - olm); - } // end condition 6, calc_deri - ++iw2_all; - } // end loop 5, kk - ++iw1_all; - } // end loop 4, jj - } // condition 3, distance - else if (distance >= rcut && (!gamma_only_local)) - { - int start1 = ucell.itiaiw2iwt(T1, I1, 0); - int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - bool is_adj = false; - for (int ad0 = 0; ad0 < adjs.adj_num + 1; ++ad0) - { - const int T0 = adjs.ntype[ad0]; - tau0 = adjs.adjacent_tau[ad0]; - dtau1 = tau0 - tau1; - double distance1 = dtau1.norm() * ucell.lat0; - double rcut1 = orb.Phi[T1].getRcut() + ucell.infoNL.Beta[T0].get_rcut_max(); - dtau2 = tau0 - tau2; - double distance2 = dtau2.norm() * ucell.lat0; - double rcut2 = orb.Phi[T2].getRcut() + ucell.infoNL.Beta[T0].get_rcut_max(); - if (distance1 < rcut1 && distance2 < rcut2) - { - is_adj = true; - break; - } - } // ad0 - - if (is_adj) - { - for (int jj = 0; jj < atom1->nw * npol; ++jj) - { - const int mu = pv.global2local_row(start1 + jj); - if (mu < 0) { - continue; -} - for (int kk = 0; kk < atom2->nw * npol; ++kk) - { - const int nu = pv.global2local_col(start2 + kk); - if (nu < 0) { - continue; -} - ++total_nnr; - ++nnr; - } // kk - } // jj - } // is_adj - } // distance, end condition 3 - } // end loop 2, ad - } // end loop 1, iat1 - -#ifdef _OPENMP - } -#endif - - if (!gamma_only_local) - { - if (total_nnr != pv.nnr) - { - std::cout << " nnr=" << total_nnr << " LNNR.nnr=" << pv.nnr << std::endl; - GlobalV::ofs_running << " nnr=" << total_nnr << " LNNR.nnr=" << pv.nnr << std::endl; - ModuleBase::WARNING_QUIT("LCAO_domain::build_ST_new", "nnr != LNNR.nnr"); - } - } - - ModuleBase::timer::tick("LCAO_domain", "build_ST_new"); - return; -} - -} // namespace LCAO_domain diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_zero.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_zero.cpp deleted file mode 100644 index 03d7edd99a..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_set_zero.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "source_base/global_variable.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/tool_threading.h" - -namespace LCAO_domain -{ - -void zeros_HSR(const char &mtype, LCAO_HS_Arrays& HS_arrays) -{ - auto zeros_HSR_ker = [&](int num_threads, int thread_id) - { - long long beg, len; - if(PARAM.inp.nspin!=4) - { - if (mtype=='T') - { - ModuleBase::BLOCK_TASK_DIST_1D(num_threads, thread_id, (long long)HS_arrays.Hloc_fixedR.size(), (long long)512, beg, len); - ModuleBase::GlobalFunc::ZEROS(HS_arrays.Hloc_fixedR.data() + beg, len); - } - } - }; - ModuleBase::OMP_PARALLEL(zeros_HSR_ker); - return; -} - -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.cpp deleted file mode 100644 index 394384a3b4..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.cpp +++ /dev/null @@ -1,234 +0,0 @@ -//========================================================= -// AUTHOR : Peize Lin -// DATE : 2016-01-24 -//========================================================= - -#include "center2_orb-orb11.h" - -#include "center2_orb.h" -#include "source_base/constants.h" -#include "source_base/math_polyint.h" -#include "source_base/sph_bessel_recursive.h" -#include "source_base/ylm.h" -#include "source_base/array_pool.h" - -#include - -Center2_Orb::Orb11::Orb11(const Numerical_Orbital_Lm& nA_in, - const Numerical_Orbital_Lm& nB_in, - const ModuleBase::Sph_Bessel_Recursive::D2* psb, - const ORB_gaunt_table& MGT_in) - : nA(nA_in), nB(nB_in), psb_(psb), MGT(MGT_in) -{ -} - -void Center2_Orb::Orb11::init_radial_table() -{ - const int LA = this->nA.getL(); - const int LB = this->nB.getL(); - for (int LAB = std::abs(LA - LB); LAB <= LA + LB; ++LAB) - { - if ((LAB - std::abs(LA - LB)) % 2 == 1) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 - { - continue; - } - - const int rmesh = Center2_Orb::get_rmesh(this->nA.getRcut(), this->nB.getRcut(), dr_); - - this->Table_r[LAB].resize(rmesh, 0); - this->Table_dr[LAB].resize(rmesh, 0); - - Center2_Orb::cal_ST_Phi12_R(1, - LAB, - this->nA, - this->nB, - rmesh, - this->Table_r[LAB].data(), - this->Table_dr[LAB].data(), - psb_); - } - return; -} - -void Center2_Orb::Orb11::init_radial_table(const std::set& radials) -{ - const int LA = this->nA.getL(); - const int LB = this->nB.getL(); - - const size_t rmesh = Center2_Orb::get_rmesh(this->nA.getRcut(), this->nB.getRcut(), dr_); - - std::set radials_used; - for (const size_t& ir: radials) { - if (ir < rmesh) { - radials_used.insert(ir); -} -} - - for (int LAB = std::abs(LA - LB); LAB <= LA + LB; ++LAB) - { - if ((LAB - std::abs(LA - LB)) % 2 == 1) { // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 - continue; -} - - this->Table_r[LAB].resize(rmesh, 0); - this->Table_dr[LAB].resize(rmesh, 0); - - Center2_Orb::cal_ST_Phi12_R(1, - LAB, - this->nA, - this->nB, - radials_used, - this->Table_r[LAB].data(), - this->Table_dr[LAB].data(), - psb_); - } -} - -double Center2_Orb::Orb11::cal_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, - const int& mA, - const int& mB) const -{ - const double tiny1 = 1e-12; // why 1e-12? - const double tiny2 = 1e-10; // why 1e-10? - - const ModuleBase::Vector3 delta_R = RB - RA; - const double distance_true = delta_R.norm(); - const double distance = (distance_true >= tiny1) ? distance_true : distance_true + tiny1; - const double RcutA = this->nA.getRcut(); - const double RcutB = this->nB.getRcut(); - if (distance > (RcutA + RcutB)) { - return 0.0; -} - - const int LA = this->nA.getL(); - const int LB = this->nB.getL(); - - std::vector rly; - ModuleBase::Ylm::rl_sph_harm(LA + LB, // max LAB - delta_R.x, - delta_R.y, - delta_R.z, - rly); - - double overlap = 0.0; - - for (const auto& tb_r: this->Table_r) - { - const int LAB = tb_r.first; - - for (int mAB = 0; mAB != 2 * LAB + 1; ++mAB) - // const int mAB = mA + mB; - { - const double Gaunt_real_A_B_AB = this->MGT.Gaunt_Coefficients(this->MGT.get_lm_index(LA, mA), - this->MGT.get_lm_index(LB, mB), - this->MGT.get_lm_index(LAB, mAB)); - if (0 == Gaunt_real_A_B_AB) { - continue; -} - - const double ylm_solid = rly[this->MGT.get_lm_index(LAB, mAB)]; - if (0 == ylm_solid) { - continue; -} - const double ylm_real = (distance > tiny2) ? ylm_solid / pow(distance, LAB) : ylm_solid; - - const double i_exp = std::pow(-1.0, (LA - LB - LAB) / 2); - - const double Interp_Tlm - = (distance > tiny2) - ? ModuleBase::PolyInt::Polynomial_Interpolation(tb_r.second.data(), - Center2_Orb::get_rmesh(RcutA, RcutB, dr_), - dr_, - distance) - : tb_r.second.at(0); - - overlap += - // pow(2*PI,1.5) - i_exp * Gaunt_real_A_B_AB * Interp_Tlm * ylm_real; - } - } - - return overlap; -} - -ModuleBase::Vector3 Center2_Orb::Orb11::cal_grad_overlap( // caoyu add 2021-11-19 - const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, - const int& mA, - const int& mB) const -{ - const double tiny1 = 1e-12; // same as `cal_overlap` - const double tiny2 = 1e-10; // same as `cal_overlap` - - const ModuleBase::Vector3 delta_R = RB - RA; - const double distance_true = delta_R.norm(); - const double distance = (distance_true >= tiny1) ? distance_true : distance_true + tiny1; - const double RcutA = this->nA.getRcut(); - const double RcutB = this->nB.getRcut(); - if (distance > (RcutA + RcutB)) { - return ModuleBase::Vector3(0.0, 0.0, 0.0); -} - - const int LA = this->nA.getL(); - const int LB = this->nB.getL(); - - std::vector rly((LA + LB + 1) * (LA + LB + 1)); - std::vector> grly; - ModuleBase::Array_Pool tmp_grly((LA + LB + 1) * (LA + LB + 1), 3); - ModuleBase::Ylm::grad_rl_sph_harm(LA + LB, delta_R.x, delta_R.y, delta_R.z, rly.data(), tmp_grly.get_ptr_2D()); - for (int i=0; i<(LA + LB + 1) * (LA + LB + 1); ++i) - { - ModuleBase::Vector3 ele(tmp_grly[i][0], tmp_grly[i][1], tmp_grly[i][2]); - grly.push_back(ele); - } - - ModuleBase::Vector3 grad_overlap(0.0, 0.0, 0.0); - - for (const auto& tb_r: this->Table_r) - { - const int LAB = tb_r.first; - for (int mAB = 0; mAB != 2 * LAB + 1; ++mAB) - // const int mAB = mA + mB; - { - const double Gaunt_real_A_B_AB = this->MGT.Gaunt_Coefficients(this->MGT.get_lm_index(LA, mA), - this->MGT.get_lm_index(LB, mB), - this->MGT.get_lm_index(LAB, mAB)); - if (0 == Gaunt_real_A_B_AB) { - continue; -} - - const double ylm_solid = rly[this->MGT.get_lm_index(LAB, mAB)]; - const double ylm_real = (distance > tiny2) ? ylm_solid / pow(distance, LAB) : ylm_solid; - - const ModuleBase::Vector3 gylm_solid = grly[this->MGT.get_lm_index(LAB, mAB)]; - const ModuleBase::Vector3 gylm_real - = (distance > tiny2) ? gylm_solid / pow(distance, LAB) : gylm_solid; - - const double i_exp = std::pow(-1.0, (LA - LB - LAB) / 2); - - const double Interp_Tlm - = (distance > tiny2) - ? ModuleBase::PolyInt::Polynomial_Interpolation(tb_r.second.data(), - Center2_Orb::get_rmesh(RcutA, RcutB, dr_), - dr_, - distance) - : tb_r.second.at(0); - - const double grad_Interp_Tlm - = (distance > tiny2) - ? ModuleBase::PolyInt::Polynomial_Interpolation(this->Table_dr.at(LAB).data(), - Center2_Orb::get_rmesh(RcutA, RcutB, dr_), - dr_, - distance) // Interp(Table_dr) - - Interp_Tlm * LAB / distance - : 0.0; - - grad_overlap += i_exp // pow(2*PI,1.5) - * Gaunt_real_A_B_AB - * (Interp_Tlm * gylm_real + grad_Interp_Tlm * ylm_real * delta_R / distance); - } - } - - return grad_overlap; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h deleted file mode 100644 index 23ffc898de..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h +++ /dev/null @@ -1,62 +0,0 @@ -//========================================================= -// AUTHOR : Peize Lin -// DATE : 2016-01-24 -//========================================================= - -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_CENTER2_ORB_ORB11_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_CENTER2_ORB_ORB11_H - -#include "center2_orb.h" -#include "source_base/sph_bessel_recursive.h" -#include "source_base/vector3.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" - -#include -#include -#include - -class Center2_Orb::Orb11 -{ - public: - Orb11(const Numerical_Orbital_Lm& nA_in, - const Numerical_Orbital_Lm& nB_in, - const ModuleBase::Sph_Bessel_Recursive::D2* psb, - const ORB_gaunt_table& MGT_in); - - void init_radial_table(); - void init_radial_table(const std::set& radials); // unit: Bohr/MOT.dr - - double cal_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, // unit: Bohr - const int& mA, - const int& mB) const; - - ModuleBase::Vector3 cal_grad_overlap( // caoyu add 2021-11-19 - const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, // unit: Bohr - const int& mA, - const int& mB) const; - - private: - const Numerical_Orbital_Lm& nA; - const Numerical_Orbital_Lm& nB; - - const ModuleBase::Sph_Bessel_Recursive::D2* psb_; - const ORB_gaunt_table& MGT; - - std::map> Table_r; // unit: Bohr/MOT.dr - std::map> Table_dr; - - // NOTE: the following variable is introduced during refactoring in order - // to decouple this class with ORB_table_phi. Before, MOT.dr is widely - // used by this class. MOT.dr, however, is in fact ORB.dR, which is in - // turn lcao_dr, one of the four parameters that define the two-center - // integration grid. This parameter is usually not set and defaults to - // 0.01. - const double dr_ = 0.01; -}; - -// this->Table_r[LAB][ir] - -#endif // W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_CENTER2_ORB_ORB11_H diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.cpp deleted file mode 100644 index 70d85ebebb..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.cpp +++ /dev/null @@ -1,161 +0,0 @@ -//========================================================= -// AUTHOR : Peize Lin -#include "module_parameter/parameter.h" -// DATE : 2016-01-24 -//========================================================= - -#include "center2_orb-orb21.h" - -#include "source_base/constants.h" -#include "source_base/ylm.h" - -#include - -Center2_Orb::Orb21::Orb21(const Numerical_Orbital_Lm& nA1_in, - const Numerical_Orbital_Lm& nA2_in, - const Numerical_Orbital_Lm& nB_in, - const ModuleBase::Sph_Bessel_Recursive::D2* psb, - const ORB_gaunt_table& MGT_in) - : nA1(nA1_in), nA2(nA2_in), nB(nB_in), psb_(psb), MGT(MGT_in) -{ -} - -void Center2_Orb::Orb21::init_radial_table() -{ - const Numerical_Orbital_Lm& nA_short = (this->nA1.getNr() <= this->nA2.getNr()) ? this->nA1 : this->nA2; - - std::vector nA_tmp(nA_short.getNr()); - for (size_t ir = 0; ir != nA_tmp.size(); ++ir) - { - nA_tmp[ir] = this->nA1.getPsi(ir) * this->nA2.getPsi(ir); - } - - const int LA1 = this->nA1.getL(); - const int LA2 = this->nA2.getL(); - for (int LA = std::abs(LA1 - LA2); LA <= LA1 + LA2; ++LA) - { - if ((LA - std::abs(LA1 - LA2)) % 2 == 1) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 - continue; - - this->nA[LA].set_orbital_info(nA_short.getLabel(), - nA_short.getType(), - LA, - 1, // N? - nA_short.getNr(), - nA_short.getRab(), - nA_short.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - nA_tmp.data(), - nA_short.getNk(), - nA_short.getDk(), - nA_short.getDruniform(), - false, - true, - PARAM.inp.cal_force); // mohan add 2021-05-07 - - this->orb11s.insert(std::make_pair(LA, Center2_Orb::Orb11(this->nA[LA], nB, psb_, this->MGT))); - - this->orb11s.at(LA).init_radial_table(); - } -} - -void Center2_Orb::Orb21::init_radial_table(const std::set& radials) -{ - const Numerical_Orbital_Lm& nA_short = (this->nA1.getNr() <= this->nA2.getNr()) ? this->nA1 : this->nA2; - - std::vector nA_tmp(nA_short.getNr()); - for (size_t ir = 0; ir != nA_tmp.size(); ++ir) - { - nA_tmp[ir] = this->nA1.getPsi(ir) * this->nA2.getPsi(ir); - } - - const int LA1 = this->nA1.getL(); - const int LA2 = this->nA2.getL(); - for (int LA = std::abs(LA1 - LA2); LA <= LA1 + LA2; ++LA) - { - if ((LA - std::abs(LA1 - LA2)) % 2 == 1) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 - continue; - - this->nA[LA].set_orbital_info(nA_short.getLabel(), - nA_short.getType(), - LA, - 1, // N? - nA_short.getNr(), - nA_short.getRab(), - nA_short.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - nA_tmp.data(), - nA_short.getNk(), - nA_short.getDk(), - nA_short.getDruniform(), - false, - true, - PARAM.inp.cal_force); // mohan add 2021-05-07 - - this->orb11s.insert(std::make_pair(LA, Center2_Orb::Orb11(this->nA[LA], nB, psb_, this->MGT))); - - this->orb11s.at(LA).init_radial_table(radials); - } -} - -double Center2_Orb::Orb21::cal_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, - const int& mA1, - const int& mA2, - const int& mB) const -{ - const int LA1 = this->nA1.getL(); - const int LA2 = this->nA2.getL(); - - double overlap = 0.0; - - for (const auto& orb11: this->orb11s) - { - const int LA = orb11.first; - - for (int mA = 0; mA != 2 * LA + 1; ++mA) - // const int mA=mA1+mA2; - { - const double Gaunt_real_A1_A2_A12 = this->MGT.Gaunt_Coefficients(this->MGT.get_lm_index(LA1, mA1), - this->MGT.get_lm_index(LA2, mA2), - this->MGT.get_lm_index(LA, mA)); - if (0 == Gaunt_real_A1_A2_A12) - continue; - - overlap += Gaunt_real_A1_A2_A12 * orb11.second.cal_overlap(RA, RB, mA, mB); - } - } - - return overlap; -} - -ModuleBase::Vector3 Center2_Orb::Orb21::cal_grad_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, - const int& mA1, - const int& mA2, - const int& mB) const -{ - const int LA1 = this->nA1.getL(); - const int LA2 = this->nA2.getL(); - - ModuleBase::Vector3 grad_overlap(0.0, 0.0, 0.0); - - for (const auto& orb11: this->orb11s) - { - const int LA = orb11.first; - - for (int mA = 0; mA != 2 * LA + 1; ++mA) - // const int mA=mA1+mA2; - { - const double Gaunt_real_A1_A2_A12 = this->MGT.Gaunt_Coefficients(this->MGT.get_lm_index(LA1, mA1), - this->MGT.get_lm_index(LA2, mA2), - this->MGT.get_lm_index(LA, mA)); - if (0 == Gaunt_real_A1_A2_A12) - continue; - - grad_overlap += Gaunt_real_A1_A2_A12 * orb11.second.cal_grad_overlap(RA, RB, mA, mB); - } - } - - return grad_overlap; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h deleted file mode 100644 index 37d0d8fe78..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h +++ /dev/null @@ -1,57 +0,0 @@ -//========================================================= -// AUTHOR : Peize Lin -// DATE : 2016-01-24 -//========================================================= - -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_CENTER2_ORB_ORB21_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_CENTER2_ORB_ORB21_H - -#include "center2_orb-orb11.h" -#include "center2_orb.h" -#include "source_base/vector3.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" - -#include -#include -#include - -class Center2_Orb::Orb21 -{ - public: - Orb21(const Numerical_Orbital_Lm& nA1_in, - const Numerical_Orbital_Lm& nA2_in, - const Numerical_Orbital_Lm& nB_in, - const ModuleBase::Sph_Bessel_Recursive::D2* psb, - const ORB_gaunt_table& MGT_in); - - void init_radial_table(); - void init_radial_table(const std::set& radials); // unit: Bohr/MOT.dr - - double cal_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, // unit: Bohr - const int& mA1, - const int& mA2, - const int& mB) const; - - ModuleBase::Vector3 cal_grad_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, // unit: Bohr - const int& mA1, - const int& mA2, - const int& mB) const; - - private: - const Numerical_Orbital_Lm& nA1; - const Numerical_Orbital_Lm& nA2; - const Numerical_Orbital_Lm& nB; - - const ModuleBase::Sph_Bessel_Recursive::D2* psb_; - const ORB_gaunt_table& MGT; - - std::map nA; - std::map orb11s; -}; - -// this->orb11s[LA].Table_r[LAB][ir] - -#endif // W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_CENTER2_ORB_ORB21_H diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.cpp deleted file mode 100644 index 54a43b44be..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.cpp +++ /dev/null @@ -1,159 +0,0 @@ -//========================================================= -// AUTHOR : Peize Lin -#include "module_parameter/parameter.h" -// DATE : 2016-01-24 -//========================================================= - -#include "center2_orb-orb22.h" - -Center2_Orb::Orb22::Orb22(const Numerical_Orbital_Lm& nA1_in, - const Numerical_Orbital_Lm& nA2_in, - const Numerical_Orbital_Lm& nB1_in, - const Numerical_Orbital_Lm& nB2_in, - const ModuleBase::Sph_Bessel_Recursive::D2* psb, - const ORB_gaunt_table& MGT_in) - : nA1(nA1_in), nA2(nA2_in), nB1(nB1_in), nB2(nB2_in), psb_(psb), MGT(MGT_in) -{ -} - -void Center2_Orb::Orb22::init_radial_table() -{ - const Numerical_Orbital_Lm& nB_short = (nB1.getNr() <= nB2.getNr()) ? nB1 : nB2; - - std::vector nB_tmp(nB_short.getNr()); - for (size_t ir = 0; ir != nB_tmp.size(); ++ir) - { - nB_tmp[ir] = nB1.getPsi(ir) * nB2.getPsi(ir); - } - - const int LB1 = nB1.getL(); - const int LB2 = nB2.getL(); - for (int LB = std::abs(LB1 - LB2); LB <= LB1 + LB2; ++LB) - { - if ((LB - std::abs(LB1 - LB2)) % 2 == 1) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 - continue; - - this->nB[LB].set_orbital_info(nB_short.getLabel(), - nB_short.getType(), - LB, - 1, // N? - nB_short.getNr(), - nB_short.getRab(), - nB_short.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - nB_tmp.data(), - nB_short.getNk(), - nB_short.getDk(), - nB_short.getDruniform(), - false, - true, - PARAM.inp.cal_force); // mohan add 2021-05-07 - - this->orb21s.insert(std::make_pair(LB, Center2_Orb::Orb21(nA1, nA2, this->nB[LB], psb_, this->MGT))); - - this->orb21s.at(LB).init_radial_table(); - } -} - -void Center2_Orb::Orb22::init_radial_table(const std::set& radials) -{ - const Numerical_Orbital_Lm& nB_short = (nB1.getNr() <= nB2.getNr()) ? nB1 : nB2; - - std::vector nB_tmp(nB_short.getNr()); - for (size_t ir = 0; ir != nB_tmp.size(); ++ir) - { - nB_tmp[ir] = nB1.getPsi(ir) * nB2.getPsi(ir); - } - - const int LB1 = nB1.getL(); - const int LB2 = nB2.getL(); - for (int LB = std::abs(LB1 - LB2); LB <= LB1 + LB2; ++LB) - { - if ((LB - std::abs(LB1 - LB2)) % 2 == 1) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 - continue; - - this->nB[LB].set_orbital_info(nB_short.getLabel(), - nB_short.getType(), - LB, - 1, // N? - nB_short.getNr(), - nB_short.getRab(), - nB_short.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - nB_tmp.data(), - nB_short.getNk(), - nB_short.getDk(), - nB_short.getDruniform(), - false, - true, - PARAM.inp.cal_force); - - this->orb21s.insert(std::make_pair(LB, Center2_Orb::Orb21(nA1, nA2, this->nB[LB], psb_, this->MGT))); - - this->orb21s.at(LB).init_radial_table(radials); - } -} - -double Center2_Orb::Orb22::cal_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, - const int& mA1, - const int& mA2, - const int& mB1, - const int& mB2) const -{ - const int LB1 = nB1.getL(); - const int LB2 = nB2.getL(); - - double overlap = 0.0; - - for (const auto& orb21: this->orb21s) - { - const int LB = orb21.first; - - for (int mB = 0; mB != 2 * LB + 1; ++mB) - // const int mB=mB1+mB2; - { - const double Gaunt_real_B1_B2_B12 = this->MGT.Gaunt_Coefficients(this->MGT.get_lm_index(LB1, mB1), - this->MGT.get_lm_index(LB2, mB2), - this->MGT.get_lm_index(LB, mB)); - if (0 == Gaunt_real_B1_B2_B12) - continue; - - overlap += Gaunt_real_B1_B2_B12 * orb21.second.cal_overlap(RA, RB, mA1, mA2, mB); - } - } - - return overlap; -} - -ModuleBase::Vector3 Center2_Orb::Orb22::cal_grad_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, - const int& mA1, - const int& mA2, - const int& mB1, - const int& mB2) const -{ - const int LB1 = nB1.getL(); - const int LB2 = nB2.getL(); - - ModuleBase::Vector3 grad_overlap(0.0, 0.0, 0.0); - - for (const auto& orb21: this->orb21s) - { - const int LB = orb21.first; - - for (int mB = 0; mB != 2 * LB + 1; ++mB) - // const int mB=mB1+mB2; - { - const double Gaunt_real_B1_B2_B12 = this->MGT.Gaunt_Coefficients(this->MGT.get_lm_index(LB1, mB1), - this->MGT.get_lm_index(LB2, mB2), - this->MGT.get_lm_index(LB, mB)); - if (0 == Gaunt_real_B1_B2_B12) - continue; - - grad_overlap += Gaunt_real_B1_B2_B12 * orb21.second.cal_grad_overlap(RA, RB, mA1, mA2, mB); - } - } - - return grad_overlap; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.h b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.h deleted file mode 100644 index 7a57742f20..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb22.h +++ /dev/null @@ -1,61 +0,0 @@ -//========================================================= -// AUTHOR : Peize Lin -// DATE : 2016-01-24 -//========================================================= - -#ifndef CENTER2_ORB_ORB22_H -#define CENTER2_ORB_ORB22_H - -#include "center2_orb-orb21.h" -#include "center2_orb.h" -#include "source_base/vector3.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" - -#include -#include -#include - -class Center2_Orb::Orb22 -{ - public: - Orb22(const Numerical_Orbital_Lm& nA1_in, - const Numerical_Orbital_Lm& nA2_in, - const Numerical_Orbital_Lm& nB1_in, - const Numerical_Orbital_Lm& nB2_in, - const ModuleBase::Sph_Bessel_Recursive::D2* psb, - const ORB_gaunt_table& MGT_in); - - void init_radial_table(); - void init_radial_table(const std::set& radials); // unit: Bohr/MOT.dr - - double cal_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, // unit: Bohr - const int& mA1, - const int& mA2, - const int& mB1, - const int& mB2) const; - - ModuleBase::Vector3 cal_grad_overlap(const ModuleBase::Vector3& RA, - const ModuleBase::Vector3& RB, // unit: Bohr - const int& mA1, - const int& mA2, - const int& mB1, - const int& mB2) const; - - protected: // Peize Lin test 2016-10-07 - const Numerical_Orbital_Lm& nA1; - const Numerical_Orbital_Lm& nA2; - const Numerical_Orbital_Lm& nB1; - const Numerical_Orbital_Lm& nB2; - - const ModuleBase::Sph_Bessel_Recursive::D2* psb_; - const ORB_gaunt_table& MGT; - - std::map nB; - std::map orb21s; -}; - -// this->orb21s[L34].psi2_center2[L12].Table_r[L1234][ir] - -#endif // CENTER2_ORB_ORB22_H diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.cpp deleted file mode 100644 index a2abeaf8bd..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.cpp +++ /dev/null @@ -1,409 +0,0 @@ -#include "center2_orb.h" - -#include "source_base/constants.h" -#include "source_base/math_integral.h" -#include "source_base/mathzone_add1.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "source_base/tool_quit.h" -#include "source_base/tool_title.h" - -int Center2_Orb::get_rmesh(const double& R1, const double& R2, const double dr) -{ - int rmesh = static_cast((R1 + R2) / dr) + 5; - // mohan update 2009-09-08 +1 ==> +5 - // considering interpolation or so on... - if (rmesh % 2 == 0) { - rmesh++; - } - - if (rmesh <= 0) - { - // GlobalV::ofs_warning << "\n R1 = " << R1 << " R2 = " << R2; - // GlobalV::ofs_warning << "\n rmesh = " << rmesh; - std::cout << "\n R1 = " << R1 << " R2 = " << R2; - std::cout << "\n rmesh = " << rmesh; - ModuleBase::WARNING_QUIT("Center2_Orb::get_rmesh", "rmesh <= 0"); - } - return rmesh; -} - -// Peize Lin update 2016-01-26 -void Center2_Orb::init_Lmax(const int orb_num, - const int mode, - int& Lmax_used, - int& Lmax, - const int& Lmax_exx, - const int lmax_orb, - const int lmax_beta) -{ - - Lmax = -1; - - switch (orb_num) - { - case 2: - switch (mode) - { - case 1: // used in or - Lmax = std::max({Lmax, lmax_orb, lmax_beta}); - // use 2lmax+1 in dS - Lmax_used = 2 * Lmax + 1; - break; - case 2: // used in or - Lmax = std::max(Lmax, Lmax_exx); - Lmax_used = 2 * Lmax + 1; - break; - case 3: // used in berryphase by jingan - Lmax = std::max(Lmax, lmax_orb); - Lmax++; - Lmax_used = 2 * Lmax + 1; - break; - default: - throw std::invalid_argument("Center2_Orb::init_Lmax orb_num=2, mode error"); - break; - } - break; - case 3: - switch (mode) - { - case 1: // used in or - Lmax = std::max(Lmax, lmax_orb); - Lmax_used = 2 * Lmax + 1; - Lmax = std::max(Lmax, Lmax_exx); - Lmax_used += Lmax_exx; - break; - default: - throw std::invalid_argument("Center2_Orb::init_Lmax orb_num=3, mode error"); - break; - } - break; - case 4: - switch (mode) - { - case 1: // used in - Lmax = std::max(Lmax, lmax_orb); - Lmax_used = 2 * (2 * Lmax + 1); - break; - default: - throw std::invalid_argument("Center2_Orb::init_Lmax orb_num=4, mode error"); - break; - } - break; - default: - throw std::invalid_argument("Center2_Orb::init_Lmax orb_num error"); - break; - } - - assert(Lmax_used >= 1); -} - -// Peize Lin update 2016-01-26 -void Center2_Orb::init_Table_Spherical_Bessel(const int orb_num, - const int mode, - int& Lmax_used, - int& Lmax, - const int& Lmax_exx, - const int lmax_orb, - const int lmax_beta, - const double dr, - const double dk, - const int kmesh, - const int Rmesh, - ModuleBase::Sph_Bessel_Recursive::D2*& psb) -{ - ModuleBase::TITLE("Center2_Orb", "init_Table_Spherical_Bessel"); - - init_Lmax(orb_num, mode, Lmax_used, Lmax, Lmax_exx, lmax_orb, lmax_beta); // Peize Lin add 2016-01-26 - - for (auto& sb: ModuleBase::Sph_Bessel_Recursive_Pool::D2::sb_pool) - { - if (dr * dk == sb.get_dx()) - { - psb = &sb; - break; - } - } - - if (!psb) - { - ModuleBase::Sph_Bessel_Recursive_Pool::D2::sb_pool.push_back({}); - psb = &ModuleBase::Sph_Bessel_Recursive_Pool::D2::sb_pool.back(); - } - - psb->set_dx(dr * dk); - psb->cal_jlx(Lmax_used, Rmesh, kmesh); - - ModuleBase::Memory::record("ORB::Jl(x)", sizeof(double) * (Lmax_used + 1) * kmesh * Rmesh); -} - -// Peize Lin accelerate 2017-10-02 -void Center2_Orb::cal_ST_Phi12_R(const int& job, - const int& l, - const Numerical_Orbital_Lm& n1, - const Numerical_Orbital_Lm& n2, - const int& rmesh, - double* rs, - double* drs, - const ModuleBase::Sph_Bessel_Recursive::D2* psb) -{ - ModuleBase::timer::tick("Center2_Orb", "cal_ST_Phi12_R"); - - const int kmesh = n1.getNk(); - const double* kpoint = n1.getKpoint(); - const double dk = n1.getDk(); - - std::vector k1_dot_k2(kmesh); - // Peize Lin change 2017-12-12 - switch (job) - { - case 1: // calculate overlap - if (!n1.get_psif().empty() && !n2.get_psi_k2().empty()) - { - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsif(ik) * n2.getPsi_k2(ik); - } - } - else if (!n1.get_psi_k().empty() && !n2.get_psi_k().empty()) - { - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); - } - } - else if (!n1.get_psi_k2().empty() && !n2.get_psif().empty()) - { - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsif(ik); - } - } - break; - - case 2: // calculate kinetic energy - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsi_k2(ik); - } - break; - } - - std::vector k1_dot_k2_dot_kpoint(kmesh); - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * kpoint[ik]; - } - - // Drs - // djl = (l*j(l-1) - (l+1)j(l+1))/(2l+1) - - // previous version - - // double* integrated_func = new double[kmesh]; - - int ll = 0; - if (l != 0) - { - ll = l - 1; - } - - const std::vector>& jlm1 = psb->get_jlx()[ll]; - const std::vector>& jl = psb->get_jlx()[l]; - const std::vector>& jlp1 = psb->get_jlx()[l + 1]; - -#ifdef _OPENMP -#pragma omp parallel for schedule(static) -#endif - for (int ir = 0; ir < rmesh; ir++) - { - std::vector integrated_func(kmesh); - const std::vector& jl_r = jl[ir]; - for (int ik = 0; ik < kmesh; ++ik) - { - integrated_func[ik] = jl_r[ik] * k1_dot_k2[ik]; - } - // Call simpson integration - double temp = 0.0; - - ModuleBase::Integral::Simpson_Integral(kmesh, integrated_func.data(), dk, temp); - rs[ir] = temp * ModuleBase::FOUR_PI; - - // Peize Lin accelerate 2017-10-02 - const std::vector& jlm1_r = jlm1[ir]; - const std::vector& jlp1_r = jlp1[ir]; - const double fac = l / (l + 1.0); - if (l == 0) - { - for (int ik = 0; ik < kmesh; ++ik) - { - integrated_func[ik] = jlp1_r[ik] * k1_dot_k2_dot_kpoint[ik]; - } - } - else - { - for (int ik = 0; ik < kmesh; ++ik) - { - integrated_func[ik] = (jlp1_r[ik] - fac * jlm1_r[ik]) * k1_dot_k2_dot_kpoint[ik]; - } - } - - ModuleBase::Integral::Simpson_Integral(kmesh, integrated_func.data(), dk, temp); - drs[ir] = -ModuleBase::FOUR_PI * (l + 1) / (2.0 * l + 1) * temp; - } - - // liaochen modify on 2010/4/22 - // special case for R=0 - // we store Slm(R) / R**l at the fisrt point, rather than Slm(R) - - if (l > 0) - { - std::vector integrated_func(kmesh); - double temp = 0.0; - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = k1_dot_k2[ik] * std::pow(kpoint[ik], l); - } - - ModuleBase::Integral::Simpson_Integral(kmesh, integrated_func.data(), dk, temp); - rs[0] = ModuleBase::FOUR_PI / ModuleBase::Mathzone_Add1::dualfac(2 * l + 1) * temp; - } - - ModuleBase::timer::tick("Center2_Orb", "cal_ST_Phi12_R"); -} - -#include "source_base/constants.h" - -// Peize Lin add 2017-10-27 -void Center2_Orb::cal_ST_Phi12_R(const int& job, - const int& l, - const Numerical_Orbital_Lm& n1, - const Numerical_Orbital_Lm& n2, - const std::set& radials, - double* rs, - double* drs, - const ModuleBase::Sph_Bessel_Recursive::D2* psb) -{ - // ModuleBase::TITLE("Center2_Orb","cal_ST_Phi12_R"); - ModuleBase::timer::tick("Center2_Orb", "cal_ST_Phi12_R"); - - const int kmesh = n1.getNk(); - const double* kpoint = n1.getKpoint(); - const double dk = n1.getDk(); - - std::vector k1_dot_k2(kmesh); - switch (job) - { - case 1: // calculate overlap - if (!n1.get_psif().empty() && !n2.get_psi_k2().empty()) - { - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsif(ik) * n2.getPsi_k2(ik); - } - } - else if (!n1.get_psi_k().empty() && !n2.get_psi_k().empty()) - { - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); - } - } - else if (!n1.get_psi_k2().empty() && !n2.get_psif().empty()) - { - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsif(ik); - } - } - break; - - case 2: // calculate kinetic energy - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsi_k2(ik); - } - break; - } - - std::vector k1_dot_k2_dot_kpoint(kmesh); - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * kpoint[ik]; - } - - std::vector integrated_func(kmesh); - - const int lm1 = (l > 0 ? l - 1 : 0); - const std::vector>& jlm1 = psb->get_jlx()[lm1]; - const std::vector>& jl = psb->get_jlx()[l]; - const std::vector>& jlp1 = psb->get_jlx()[l + 1]; - - for (const size_t& ir: radials) - { - // if(rs[ir]) => rs[ir] has been calculated - // if(drs[ir]) => drs[ir] has been calculated - // Actually, if(ir[ir]||dr[ir]) is enough. Double insurance for the sake of avoiding numerical errors - if (rs[ir] && drs[ir]) { - continue; - } - - const std::vector& jl_r = jl[ir]; - for (int ik = 0; ik < kmesh; ++ik) - { - integrated_func[ik] = jl_r[ik] * k1_dot_k2[ik]; - } - double temp = 0.0; - - ModuleBase::Integral::Simpson_Integral(kmesh, ModuleBase::GlobalFunc::VECTOR_TO_PTR(integrated_func), dk, temp); - rs[ir] = temp * ModuleBase::FOUR_PI; - - const std::vector& jlm1_r = jlm1[ir]; - const std::vector& jlp1_r = jlp1[ir]; - const double fac = l / (l + 1.0); - if (l == 0) - { - for (int ik = 0; ik < kmesh; ++ik) - { - integrated_func[ik] = jlp1_r[ik] * k1_dot_k2_dot_kpoint[ik]; - } - } - else - { - for (int ik = 0; ik < kmesh; ++ik) - { - integrated_func[ik] = (jlp1_r[ik] - fac * jlm1_r[ik]) * k1_dot_k2_dot_kpoint[ik]; - } - } - - ModuleBase::Integral::Simpson_Integral(kmesh, ModuleBase::GlobalFunc::VECTOR_TO_PTR(integrated_func), dk, temp); - drs[ir] = -ModuleBase::FOUR_PI * (l + 1) / (2.0 * l + 1) * temp; - } - - // cal rs[0] special - if (l > 0) - { - if (radials.find(0) != radials.end()) - { - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = k1_dot_k2[ik] * pow(kpoint[ik], l); - } - double temp = 0.0; - - ModuleBase::Integral::Simpson_Integral(kmesh, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(integrated_func), - dk, - temp); - - // PLEASE try to make dualfac function as input parameters - // mohan note 2021-03-23 - rs[0] = ModuleBase::FOUR_PI / ModuleBase::Mathzone_Add1::dualfac(2 * l + 1) * temp; - } - } - - ModuleBase::timer::tick("Center2_Orb", "cal_ST_Phi12_R"); - - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.h b/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.h deleted file mode 100644 index a10e3dffe5..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/center2_orb.h +++ /dev/null @@ -1,69 +0,0 @@ -//========================================================== -// AUTHOR : Peize Lin -// DATE : 2016-01-24 -//========================================================== - -#ifndef CENTER2_ORB_H -#define CENTER2_ORB_H - -#include "source_base/sph_bessel_recursive.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" - -#include - -class Center2_Orb -{ - public: - class Orb11; - class Orb21; - class Orb22; - - //========================================================================= - // The following functions used to be in module_ao/ORB_table_phi.h, but - // are moved here to decouple module_ao from Center2_Orb - //========================================================================= - - static int get_rmesh(const double& R1, const double& R2, const double dr); - - static void init_Lmax(const int orb_num, - const int mode, - int& Lmax_used, - int& Lmax, - const int& Lmax_exx, - const int lmax_orb, - const int lmax_beta); - - static void init_Table_Spherical_Bessel(const int orb_num, - const int mode, - int& Lmax_used, - int& Lmax, - const int& Lmax_exx, - const int lmax_orb, - const int lmax_beta, - const double dr, - const double dk, - const int kmesh, - const int Rmesh, - ModuleBase::Sph_Bessel_Recursive::D2*& psb); - - static void cal_ST_Phi12_R(const int& job, - const int& l, - const Numerical_Orbital_Lm& n1, - const Numerical_Orbital_Lm& n2, - const int& rmesh, - double* rs, - double* drs, - const ModuleBase::Sph_Bessel_Recursive::D2* psb); - - // Peize Lin add 2017-10-13 - static void cal_ST_Phi12_R(const int& job, - const int& l, - const Numerical_Orbital_Lm& n1, - const Numerical_Orbital_Lm& n2, - const std::set& radials, // only calculate ir in radials - double* rs, - double* drs, - const ModuleBase::Sph_Bessel_Recursive::D2* psb); -}; - -#endif // CENTER2_ORB_H diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/edm.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/edm.cpp deleted file mode 100644 index 1227b5dd6e..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/edm.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "FORCE.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "source_base/memory.h" -#include "module_parameter/parameter.h" -template<> -elecstate::DensityMatrix Force_LCAO::cal_edm(const elecstate::ElecState* pelec, - const psi::Psi& psi, - const elecstate::DensityMatrix& dm, - const K_Vectors& kv, - const Parallel_Orbitals& pv, - const int& nspin, - const int& nbands, - const UnitCell& ucell, - Record_adj& ra) const -{ - ModuleBase::matrix wg_ekb; - wg_ekb.create(nspin, nbands); - - for(int is=0; iswg(is,ib) * pelec->ekb(is, ib); - } - } - - // construct a DensityMatrix for Gamma-Only - elecstate::DensityMatrix edm(&pv, nspin); - -#ifdef __PEXSI - if (PARAM.inp.ks_solver == "pexsi") - { - auto pes = dynamic_cast*>(pelec); - for (int ik = 0; ik < nspin; ik++) - { - edm.set_DMK_pointer(ik, pes->get_DM()->pexsi_EDM[ik]); - } - - } - else -#endif - { - elecstate::cal_dm_psi(edm.get_paraV_pointer(), wg_ekb, psi, edm); - } - return edm; -} - -template<> -elecstate::DensityMatrix, double> Force_LCAO>::cal_edm(const elecstate::ElecState* pelec, - const psi::Psi>& psi, - const elecstate::DensityMatrix, double>& dm, - const K_Vectors& kv, - const Parallel_Orbitals& pv, - const int& nspin, - const int& nbands, - const UnitCell& ucell, - Record_adj& ra) const -{ - - // construct a DensityMatrix object - const int nspin_dm = nspin == 2 ? 2 : 1; - elecstate::DensityMatrix, double> edm(&pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - - //-------------------------------------------- - // calculate the energy density matrix here. - //-------------------------------------------- - - ModuleBase::matrix wg_ekb; - wg_ekb.create(kv.get_nks(), nbands); - ModuleBase::Memory::record("Force::wg_ekb", sizeof(double) * kv.get_nks() * nbands); -#ifdef _OPENMP -#pragma omp parallel for collapse(2) schedule(static, 1024) -#endif - for (int ik = 0; ik < kv.get_nks(); ik++) - { - for (int ib = 0; ib < nbands; ib++) - { - wg_ekb(ik, ib) = pelec->wg(ik, ib) * pelec->ekb(ik, ib); - } - } - - // use the original formula (Hamiltonian matrix) to calculate energy density matrix - if (dm.EDMK.size()) - { -#ifdef _OPENMP -#pragma omp parallel for schedule(static) -#endif - for (int ik = 0; ik < kv.get_nks(); ++ik) - { - edm.set_DMK_pointer(ik, dm.EDMK[ik].c); - } - } - else - { - // cal_dm_psi - elecstate::cal_dm_psi(edm.get_paraV_pointer(), wg_ekb, psi, edm); - } - - // cal_dm_2d - edm.init_DMR(ra, &ucell); - edm.cal_DMR(); - return edm; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h b/source/module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h deleted file mode 100644 index ab8039ec1d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef FORCESTRESS_ARRAYS_H -#define FORCESTRESS_ARRAYS_H - -class ForceStressArrays -{ - public: - - ForceStressArrays(){}; - ~ForceStressArrays(){}; - - //----------------------------------------- - // force in LCAO - // used in gamma only algorithm. - //----------------------------------------- - double* DSloc_x; - double* DSloc_y; - double* DSloc_z; - - //----------------------------------------- - // force in LCAO - // used in k-points algorithm. - //----------------------------------------- - double* DSloc_Rx; - double* DSloc_Ry; - double* DSloc_Rz; - - //----------------------------------------- - // dT + part of dVNL - // used in gamma only algorithm. - //----------------------------------------- - double* DHloc_fixed_x; - double* DHloc_fixed_y; - double* DHloc_fixed_z; - - //----------------------------------------- - // dT + part of dVNL - // used in kpoint algorithm. - //----------------------------------------- - double* DHloc_fixedR_x; - double* DHloc_fixedR_y; - double* DHloc_fixedR_z; - - //---------------------------------------- - // r_mu - r_nu - //---------------------------------------- - - double* DH_r;//zhengdy added 2017-07 - - double* stvnl11; - double* stvnl12; - double* stvnl13; - double* stvnl22; - double* stvnl23; - double* stvnl33; - - double* DSloc_11; - double* DSloc_12; - double* DSloc_13; - double* DSloc_22; - double* DSloc_23; - double* DSloc_33; - - double* DHloc_fixed_11; - double* DHloc_fixed_12; - double* DHloc_fixed_13; - double* DHloc_fixed_22; - double* DHloc_fixed_23; - double* DHloc_fixed_33; - -}; - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/grid_init.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/grid_init.cpp deleted file mode 100644 index 113148945f..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/grid_init.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#include "source_base/global_variable.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" - -namespace LCAO_domain -{ - -//-------------------------------------------- -// prepare grid network for Gint(grid integral) -//-------------------------------------------- -void grid_prepare( - const Grid_Technique& gt, - Gint_Gamma &gint_gamma, - Gint_k &gint_k, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const ModulePW::PW_Basis& rhopw, - const ModulePW::PW_Basis_Big& bigpw) -{ - ModuleBase::TITLE("LCAO_domain","grid_prepare"); - ModuleBase::timer::tick("LCAO_domain","grid_prepare"); - if(PARAM.globalv.gamma_only_local) - { - gint_gamma.prep_grid( - gt, - bigpw.nbx, - bigpw.nby, - bigpw.nbzp, - bigpw.nbzp_start, - rhopw.nxyz, - bigpw.bx, - bigpw.by, - bigpw.bz, - bigpw.bxyz, - bigpw.nbxx, - rhopw.ny, - rhopw.nplane, - rhopw.startz_current, - &ucell, - &orb); - } - else // multiple k-points - { - // cal the grid integration of 'Vl' matrix for l-points algorithms. - gint_k.prep_grid( - gt, - bigpw.nbx, - bigpw.nby, - bigpw.nbzp, - bigpw.nbzp_start, - rhopw.nxyz, - bigpw.bx, - bigpw.by, - bigpw.bz, - bigpw.bxyz, - bigpw.nbxx, - rhopw.ny, - rhopw.nplane, - rhopw.startz_current, - &ucell, - &orb); - } - - ModuleBase::timer::tick("LCAO_domain","grid_prepare"); - return; -} - -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp deleted file mode 100644 index 87867bb927..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp +++ /dev/null @@ -1,548 +0,0 @@ -#include "hamilt_lcao.h" - -#include "source_base/global_variable.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -#include - -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "operator_lcao/deepks_lcao.h" -#endif - -#ifdef __EXX -#include "module_ri/Exx_LRI_interface.h" -#include "operator_lcao/op_exx_lcao.h" -#endif - -#ifdef __ELPA -#include "source_hsolver/diago_elpa.h" -#endif - -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_hsolver/hsolver_lcao.h" -#include "operator_lcao/dftu_lcao.h" -#include "operator_lcao/dspin_lcao.h" -#include "operator_lcao/ekinetic_new.h" -#include "operator_lcao/meta_lcao.h" -#include "operator_lcao/nonlocal_new.h" -#include "operator_lcao/op_dftu_lcao.h" -#include "operator_lcao/op_exx_lcao.h" -#include "operator_lcao/overlap_new.h" -#include "operator_lcao/td_ekinetic_lcao.h" -#include "operator_lcao/td_nonlocal_lcao.h" -#include "operator_lcao/td_pot_hybrid.h" -#include "operator_lcao/veff_lcao.h" - -namespace hamilt -{ - -template -HamiltLCAO::HamiltLCAO(const UnitCell& ucell, - const Grid_Driver& grid_d, - const Parallel_Orbitals* paraV, - const K_Vectors& kv_in, - const TwoCenterIntegrator& intor_overlap_orb, - const std::vector& orb_cutoff) -{ - this->classname = "HamiltLCAO"; - - this->kv = &kv_in; - - // initialize the overlap matrix - this->sR = new HContainer(paraV); - - this->getOperator() = new OverlapNew>(this->hsk, - this->kv->kvec_d, - this->hR, - this->sR, - &ucell, - orb_cutoff, - &grid_d, - &intor_overlap_orb); -} - -template -HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, - Gint_k* GK_in, - const UnitCell& ucell, - const Grid_Driver& grid_d, - const Parallel_Orbitals* paraV, - elecstate::Potential* pot_in, - const K_Vectors& kv_in, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - elecstate::DensityMatrix* DM_in -#ifdef __MLALGO - , - LCAO_Deepks* ld_in -#endif -#ifdef __EXX - , - const int istep, - int* exx_two_level_step, - std::vector>>>* Hexxd, - std::vector>>>>* Hexxc -#endif -) -{ - this->classname = "HamiltLCAO"; - - this->kv = &kv_in; - - // Real space Hamiltonian is inited with template TR - this->hR = new HContainer(paraV); - this->sR = new HContainer(paraV); - this->hsk = new HS_Matrix_K(paraV); - - // Effective potential term (\sum_r ) is registered without template - std::vector pot_register_in; - if (PARAM.inp.vl_in_h) - { - if (PARAM.inp.vion_in_h) - { - pot_register_in.push_back("local"); - } - if (PARAM.inp.vh_in_h) - { - pot_register_in.push_back("hartree"); - } - pot_register_in.push_back("xc"); - if (PARAM.inp.imp_sol) - { - pot_register_in.push_back("surchem"); - } - if (PARAM.inp.efield_flag) - { - pot_register_in.push_back("efield"); - } - if (PARAM.inp.gate_flag) - { - pot_register_in.push_back("gatefield"); - } - if (PARAM.inp.esolver_type == "tddft") - { - pot_register_in.push_back("tddft"); - } - } - - // Gamma_only case to initialize HamiltLCAO - // - // code block to construct Operator Chains - if (std::is_same::value) - { - // fix HR to gamma case, where SR will be fixed in Overlap Operator - this->hR->fix_gamma(); - // initial operator for Gamma_only case - // overlap term () is indispensable - // in Gamma_only case, target SK is this->hsk->get_sk(), the target SR is this->sR - this->getOperator() = new OverlapNew>(this->hsk, - this->kv->kvec_d, - this->hR, - this->sR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb.get()); - - // kinetic term () - if (PARAM.inp.t_in_h) - { - Operator* ekinetic = new EkineticNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.kinetic_orb.get()); - this->getOperator()->add(ekinetic); - } - - // nonlocal term (D) - // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() - if (PARAM.inp.vnl_in_h) - { - Operator* nonlocal = new NonlocalNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb_beta.get()); - this->getOperator()->add(nonlocal); - } - - // Effective potential term (\sum_r ) - // in general case, target HR is Gint::hRGint, while target HK is this->hsk->get_hk() - if (PARAM.inp.vl_in_h) - { - // only Potential is not empty, Veff and Meta are available - if (pot_register_in.size() > 0) - { - // register Potential by gathered operator - pot_in->pot_register(pot_register_in); - // effective potential term - Operator* veff = new Veff>(GG_in, - this->hsk, - this->kv->kvec_d, - pot_in, - this->hR, // no explicit call yet - &ucell, - orb.cutoffs(), - &grid_d, - PARAM.inp.nspin); - this->getOperator()->add(veff); - } - } - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - Operator* deepks = new DeePKS>(this->hsk, - this->kv->kvec_d, - this->hR, // no explicit call yet - &ucell, - &grid_d, - two_center_bundle.overlap_orb_alpha.get(), - &orb, - this->kv->get_nks(), - DM_in, - ld_in); - this->getOperator()->add(deepks); - this->V_delta_R = dynamic_cast>*>(deepks)->get_V_delta_R(); - } -#endif - - // end node should be OperatorDFTU - if (PARAM.inp.dft_plus_u) - { - Operator* dftu = nullptr; - if (PARAM.inp.dft_plus_u == 2) - { - dftu = new OperatorDFTU>(this->hsk, - this->kv->kvec_d, - this->hR, // no explicit call yet - this->kv->isk); - } - else - { - dftu = new DFTU>(this->hsk, - this->kv->kvec_d, - this->hR, - ucell, - &grid_d, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs(), - &GlobalC::dftu); - } - this->getOperator()->add(dftu); - } - } - // multi-k-points case to initialize HamiltLCAO, ops will be used - else if (std::is_same>::value) - { - // Effective potential term (\sum_r ) - // Meta potential term (\sum_r ) - // in general case, target HR is Gint::pvpR_reduced, while target HK is this->hsk->get_hk() - if (PARAM.inp.vl_in_h) - { - // only Potential is not empty, Veff and Meta are available - if (pot_register_in.size() > 0) - { - // register Potential by gathered operator - pot_in->pot_register(pot_register_in); - // Veff term - this->getOperator() = new Veff>(GK_in, - this->hsk, - this->kv->kvec_d, - pot_in, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - PARAM.inp.nspin); - } - } - - // initial operator for multi-k case - // overlap term is indispensable - Operator* overlap = new OverlapNew>(this->hsk, - this->kv->kvec_d, - this->hR, - this->sR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb.get()); - if (this->getOperator() == nullptr) - { - this->getOperator() = overlap; - } - else - { - this->getOperator()->add(overlap); - } - - // kinetic term (), - // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() - if (PARAM.inp.t_in_h) - { - Operator* ekinetic = new EkineticNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.kinetic_orb.get()); - this->getOperator()->add(ekinetic); - } - - // nonlocal term (D) - // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() - if (PARAM.inp.vnl_in_h) - { - Operator* nonlocal = new NonlocalNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb_beta.get()); - // TDDFT velocity gauge will calculate full non-local potential including the original one and the - // correction on its own. So the original non-local potential term should be skipped - if (PARAM.inp.esolver_type != "tddft" || elecstate::H_TDDFT_pw::stype != 1) - { - this->getOperator()->add(nonlocal); - } - else - { - delete nonlocal; - } - } - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - Operator* deepks = new DeePKS>(this->hsk, - this->kv->kvec_d, - hR, - &ucell, - &grid_d, - two_center_bundle.overlap_orb_alpha.get(), - &orb, - this->kv->get_nks(), - DM_in, - ld_in); - this->getOperator()->add(deepks); - this->V_delta_R = dynamic_cast>*>(deepks)->get_V_delta_R(); - } -#endif - // TDDFT_velocity_gauge - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) - { - Operator* td_ekinetic = new TDEkinetic>(this->hsk, - this->hR, - this->kv, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb.get()); - this->getOperator()->add(td_ekinetic); - - Operator* td_nonlocal = new TDNonlocal>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb, - &grid_d); - this->getOperator()->add(td_nonlocal); - } - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 2) - { - Operator* td_pot_hybrid = new TD_pot_hybrid>(this->hsk, - this->kv, - this->hR, - this->sR, - orb, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.kinetic_orb.get()); - this->getOperator()->add(td_pot_hybrid); - } - if (PARAM.inp.dft_plus_u) - { - Operator* dftu = nullptr; - if (PARAM.inp.dft_plus_u == 2) - { - dftu = new OperatorDFTU>(this->hsk, - this->kv->kvec_d, - this->hR, // no explicit call yet - this->kv->isk); - } - else - { - dftu = new DFTU>(this->hsk, - this->kv->kvec_d, - this->hR, - ucell, - &grid_d, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs(), - &GlobalC::dftu); - } - this->getOperator()->add(dftu); - } - if (PARAM.inp.sc_mag_switch) - { - Operator* sc_lambda = new DeltaSpin>(this->hsk, - this->kv->kvec_d, - this->hR, - ucell, - &grid_d, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs()); - this->getOperator()->add(sc_lambda); - spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); - sc.set_operator(sc_lambda); - } - } - -#ifdef __EXX - if (GlobalC::exx_info.info_global.cal_exx) - { - // Peize Lin add 2016-12-03 - // set xc type before the first cal of xc in pelec->init_scf - // and calculate Cs, Vs - Operator* exx = new OperatorEXX>(this->hsk, - this->hR, - ucell, - *kv, - Hexxd, - Hexxc, - Add_Hexx_Type::R, - istep, - exx_two_level_step, - !GlobalC::restart.info_load.restart_exx - && GlobalC::restart.info_load.load_H); - this->getOperator()->add(exx); - } -#endif - - // if NSPIN==2, HR should be separated into two parts, save HR into this->hRS2 - int memory_fold = 1; - if (PARAM.inp.nspin == 2) - { - this->hRS2.resize(this->hR->get_nnr() * 2); - this->hR->allocate(this->hRS2.data(), 0); - memory_fold = 2; - } - - ModuleBase::Memory::record("HamiltLCAO::hR", this->hR->get_memory_size() * memory_fold); - ModuleBase::Memory::record("HamiltLCAO::sR", this->sR->get_memory_size()); - - return; -} - -// case for multi-k-points -template -void HamiltLCAO::matrix(MatrixBlock& hk_in, MatrixBlock& sk_in) -{ - auto op = dynamic_cast*>(this->getOperator()); - assert(op != nullptr); - op->matrixHk(hk_in, sk_in); -} - -template -void HamiltLCAO::updateHk(const int ik) -{ - ModuleBase::TITLE("HamiltLCAO", "updateHk"); - ModuleBase::timer::tick("HamiltLCAO", "updateHk"); - - // update global spin index - if (PARAM.inp.nspin == 2) - { - // if Veff is added and current_spin is changed, refresh HR - if (PARAM.inp.vl_in_h && this->kv->isk[ik] != this->current_spin) - { - // change data pointer of HR - this->hR->allocate(this->hRS2.data() + this->hRS2.size() / 2 * this->kv->isk[ik], 0); - if (this->refresh_times > 0) - { - this->refresh_times--; - dynamic_cast*>(this->ops)->set_hr_done(false); - } - } - this->current_spin = this->kv->isk[ik]; - } - this->getOperator()->init(ik); - ModuleBase::timer::tick("HamiltLCAO", "updateHk"); -} - -template -void HamiltLCAO::refresh() -{ - ModuleBase::TITLE("HamiltLCAO", "refresh"); - dynamic_cast*>(this->ops)->set_hr_done(false); - if (PARAM.inp.nspin == 2) - { - this->refresh_times = 1; - this->current_spin = 0; - if (this->hR->get_nnr() != this->hRS2.size() / 2) - { - // operator has changed, resize hRS2 - this->hRS2.resize(this->hR->get_nnr() * 2); - } - this->hR->allocate(this->hRS2.data(), 0); - } -} - -// get Operator base class pointer -template -Operator*& HamiltLCAO::getOperator() -{ - return this->ops; -} - -template -void HamiltLCAO::updateSk( - const int ik, - const int hk_type) -{ - ModuleBase::TITLE("HamiltLCAO", "updateSk"); - ModuleBase::timer::tick("HamiltLCAO", "updateSk"); - - ModuleBase::GlobalFunc::ZEROS(this->getSk(), this->get_size_hsk()); - - if (hk_type == 1) // collumn-major matrix for SK - { - const int nrow = this->hsk->get_pv()->get_row_size(); - hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], nrow, 1); - } - else if (hk_type == 0) // row-major matrix for SK - { - const int ncol = this->hsk->get_pv()->get_col_size(); - hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], ncol, 0); - } - else - { - ModuleBase::WARNING_QUIT("updateSk","the value of hk_type is incorrect."); - } - - ModuleBase::timer::tick("HamiltLCAO", "updateSk"); -} - -// case for nspin<4, gamma-only k-point -template class HamiltLCAO; -// case for nspin<4, multi-k-points -template class HamiltLCAO, double>; -// case for nspin == 4, non-collinear spin case -template class HamiltLCAO, std::complex>; -} // namespace hamilt diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h deleted file mode 100644 index 3cc2161912..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef HAMILT_LCAO_H -#define HAMILT_LCAO_H - -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "source_estate/module_dm/density_matrix.h" -#include "source_estate/module_pot/potential_new.h" -#include "source_hamilt/hamilt.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include - -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#endif - -#ifdef __EXX -#include "module_ri/Exx_LRI.h" -#endif -namespace hamilt -{ - -// template first for type of k space H matrix elements -// template second for type of temporary matrix, -// gamma_only fix-gamma-matrix + S-gamma, -// multi-k fix-Real + S-Real -template -class HamiltLCAO : public Hamilt -{ - public: - - - using TAC = std::pair>; - - - /** - * @brief Constructor of Hamiltonian for LCAO base - * HR and SR will be allocated with Operators - */ - HamiltLCAO(Gint_Gamma* GG_in, - Gint_k* GK_in, - const UnitCell& ucell, - const Grid_Driver& grid_d, - const Parallel_Orbitals* paraV, - elecstate::Potential* pot_in, - const K_Vectors& kv_in, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - elecstate::DensityMatrix* DM_in -#ifdef __MLALGO - , - LCAO_Deepks* ld_in -#endif -#ifdef __EXX - , - const int istep, - int* exx_two_level_step = nullptr, - std::vector>>>* Hexxd = nullptr, - std::vector>>>>* Hexxc = nullptr -#endif - ); - - /** - * @brief Constructor of vacuum Operators, only HR and SR will be initialed as empty HContainer - */ - HamiltLCAO(const UnitCell& ucell, - const Grid_Driver& grid_d, - const Parallel_Orbitals* paraV, - const K_Vectors& kv_in, - const TwoCenterIntegrator& intor_overlap_orb, - const std::vector& orb_cutoff); - - ~HamiltLCAO() - { - if (this->ops != nullptr) - { - delete this->ops; - } - delete this->hR; - delete this->sR; - delete this->hsk; - } - - /// get pointer of Operator ops - Operator*& getOperator(); - - /// get H(k) pointer - TK* getHk() const - { - return this->hsk->get_hk(); - } - - /// get S(k) pointer - TK* getSk() const - { - return this->hsk->get_sk(); - } - - int get_size_hsk() const - { - return this->hsk->get_size(); - } - - /// get HR pointer of *this->hR, which is a HContainer and contains H(R) - HContainer*& getHR() - { - return this->hR; - } - - /// get SR pointer of *this->sR, which is a HContainer and contains S(R) - HContainer*& getSR() - { - return this->sR; - } - -#ifdef __MLALGO - /// get V_delta_R pointer of *this->V_delta_R, which is a HContainer and contains V_delta(R) - HContainer*& get_V_delta_R() - { - return this->V_delta_R; - } -#endif - - /// refresh the status of HR - void refresh() override; - - // for target K point, update consequence of hPsi() and matrix() - virtual void updateHk(const int ik) override; - - /** - * @brief special for LCAO, update SK only - * - * @param ik target K point - * @param kvec_d: direct coordinates of k-points - * @param hk_type 0: SK is row-major, 1: SK is collumn-major - * @return void - */ - void updateSk(const int ik, const int hk_type = 0); - - // core function: return H(k) and S(k) matrixs for direct solving eigenvalues. - // not used in PW base - void matrix(MatrixBlock& hk_in, MatrixBlock& sk_in) override; - - private: - - const K_Vectors* kv = nullptr; - - //! Real space Hamiltonian H(R), where R is the Bravis lattice vector - HContainer* hR = nullptr; - - //! Real space overlap matrix S(R), where R is the Bravis lattice vector - HContainer* sR = nullptr; - -#ifdef __MLALGO - HContainer* V_delta_R = nullptr; -#endif - - //! Hamiltonian and overlap matrices for a specific k point - HS_Matrix_K* hsk = nullptr; - - // special case for NSPIN=2 , data of HR should be separated into two parts - // save them in this->hRS2; - std::vector hRS2; - - int refresh_times = 1; - - //! current_spin for NSPIN=2 case - //! 0: Hamiltonian for spin up, - //! 1: Hamiltonian for spin down - int current_spin = 0; - - const int istep = 0; -}; - -} // namespace hamilt - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp deleted file mode 100644 index a347bd2e31..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef HS_MATRIX_K_HPP -#define HS_MATRIX_K_HPP - -#include "source_basis/module_ao/parallel_orbitals.h" - -#include -namespace hamilt -{ - template - class HS_Matrix_K - { - - public: - HS_Matrix_K(const Parallel_Orbitals* paraV, bool no_s=false){ - hk.resize(paraV->nloc); - if(!no_s) - { - sk.resize(paraV->nloc); - } - this->pv = paraV; - } - - TK* get_hk() {return hk.data();} - - TK* get_sk() {return sk.data();} - - int get_size() {return hk.size();} - - void set_zero_hk() {hk.assign(hk.size(), 0);} - - void set_zero_sk() {sk.assign(sk.size(), 0);} - - const Parallel_Orbitals* get_pv() const {return this->pv;} - - private: - - std::vector hk; - - std::vector sk; - - const Parallel_Orbitals* pv = nullptr; - }; -} - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt deleted file mode 100644 index 0e49a9dc43..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -add_library( - operator_ks_lcao - OBJECT - op_exx_lcao.cpp - op_dftu_lcao.cpp - meta_lcao.cpp - veff_lcao.cpp - deepks_lcao.cpp - overlap_new.cpp - ekinetic_new.cpp - nonlocal_new.cpp - td_ekinetic_lcao.cpp - td_nonlocal_lcao.cpp - td_pot_hybrid.cpp - dspin_lcao.cpp - dftu_lcao.cpp -) - -if(ENABLE_COVERAGE) - add_coverage(operator_ks_lcao) -endif() - -IF (BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() -endif() diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp deleted file mode 100644 index f741595a90..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp +++ /dev/null @@ -1,456 +0,0 @@ -#include "deepks_lcao.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "module_parameter/parameter.h" -#ifdef _OPENMP -#include -#endif - -namespace hamilt -{ - -template -DeePKS>::DeePKS(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - HContainer* hR_in, - const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor_orb_alpha, - const LCAO_Orbitals* ptr_orb, - const int& nks_in, - elecstate::DensityMatrix* DM_in -#ifdef __MLALGO - , - LCAO_Deepks* ld_in -#endif - ) - : OperatorLCAO(hsk_in, kvec_d_in, hR_in), DM(DM_in), ucell(ucell_in), intor_orb_alpha_(intor_orb_alpha), - ptr_orb_(ptr_orb), nks(nks_in) -{ - this->cal_type = calculation_type::lcao_deepks; - this->gd = GridD_in; -#ifdef __MLALGO - this->ld = ld_in; - this->initialize_HR(GridD_in); -#endif -} - -template -DeePKS>::~DeePKS() -{ - if (this->V_delta_R != nullptr) - { - delete this->V_delta_R; - } -} - -#ifdef __MLALGO -// initialize_HR() -template -void hamilt::DeePKS>::initialize_HR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("DeePKS", "initialize_HR"); - ModuleBase::timer::tick("DeePKS", "initialize_HR"); - - auto* paraV = this->hR->get_paraV(); // get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - this->V_delta_R = new HContainer(paraV); - if (std::is_same::value) - { - // this->V_delta_R = new HContainer(paraV); - this->V_delta_R->fix_gamma(); - } - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0 = 0; - int I0 = 0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < ptr_orb_->Phi[T1].getRcut() + ptr_orb_->Alpha[0].getRcut()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) - { - continue; - } - hamilt::AtomPair tmp(iat1, - iat2, - R_index2.x - R_index1.x, - R_index2.y - R_index1.y, - R_index2.z - R_index1.z, - paraV); - // if (std::is_same::value) - // { - this->V_delta_R->insert_pair(tmp); - // } - } - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - // if (std::is_same::value) - // { - this->V_delta_R->allocate(nullptr, true); - // expand hR with V_delta_R - // update : for computational rigor, gamma-only and multi-k cases both have full size of Hamiltonian of DeePKS now - this->hR->add(*this->V_delta_R); - this->hR->allocate(nullptr, false); - // } - - ModuleBase::timer::tick("DeePKS", "initialize_HR"); -} -#endif - -template -void hamilt::DeePKS>::contributeHR() -{ -#ifdef __MLALGO - ModuleBase::TITLE("DeePKS", "contributeHR"); - // if DM changed, HR of DeePKS need to refresh. - // the judgement is based on the status of HR in ld - // this operator should be informed that DM has changed and HR need to recalculate. - if (this->ld->get_hr_cal()) - { - ModuleBase::timer::tick("DeePKS", "contributeHR"); - - const int inlmax = ptr_orb_->Alpha[0].getTotal_nchi() * this->ucell->nat; - - DeePKS_domain::cal_pdm(this->ld->init_pdm, - inlmax, - this->ld->lmaxd, - this->ld->inl2l, - this->ld->inl_index, - this->kvec_d, - this->ld->dm_r, - this->ld->phialpha, - *this->ucell, - *ptr_orb_, - *(this->gd), - *(this->hR->get_paraV()), - this->ld->pdm); - - std::vector descriptor; - DeePKS_domain::cal_descriptor(this->ucell->nat, - inlmax, - this->ld->inl2l, - this->ld->pdm, - descriptor, - this->ld->des_per_atom); - if (PARAM.inp.deepks_equiv) - { - DeePKS_domain::cal_edelta_gedm_equiv(this->ucell->nat, - this->ld->lmaxd, - this->ld->nmaxd, - inlmax, - this->ld->des_per_atom, - this->ld->inl2l, - descriptor, - this->ld->gedm, - this->ld->E_delta, - GlobalV::MY_RANK); - } - else - { - DeePKS_domain::cal_edelta_gedm(this->ucell->nat, - inlmax, - this->ld->des_per_atom, - this->ld->inl2l, - descriptor, - this->ld->pdm, - this->ld->model_deepks, - this->ld->gedm, - this->ld->E_delta); - } - - // // recalculate the V_delta_R - // if (this->V_delta_R == nullptr) - // { - // this->V_delta_R = new hamilt::HContainer>(*this->hR); - // } - this->V_delta_R->set_zero(); - this->calculate_HR(); - - this->ld->set_hr_cal(false); - - ModuleBase::timer::tick("DeePKS", "contributeHR"); - } - // save V_delta_R to hR - this->hR->add(*this->V_delta_R); -#endif -} - -#ifdef __MLALGO - -template -void hamilt::DeePKS>::calculate_HR() -{ - ModuleBase::TITLE("DeePKS", "calculate_HR"); - ModuleBase::timer::tick("DeePKS", "calculate_HR"); - if (this->V_delta_R->size_atom_pairs() == 0) - { - return; - } - - const Parallel_Orbitals* paraV = this->V_delta_R->get_paraV(); - const int npol = this->ucell->get_npol(); - - #pragma omp parallel for schedule(dynamic) - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0 = 0; - int I0 = 0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo& adjs = this->adjs_all[iat0]; - - // trace alpha orbital - std::vector trace_alpha_row; - std::vector trace_alpha_col; - std::vector gedms; - if (!PARAM.inp.deepks_equiv) - { - int ib = 0; - for (int L0 = 0; L0 <= ptr_orb_->Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < ptr_orb_->Alpha[0].getNchi(L0); ++N0) - { - const int inl = this->ld->inl_index[T0](I0, L0, N0); - const double* pgedm = this->ld->gedm[inl]; - const int nm = 2 * L0 + 1; - - for (int m1 = 0; m1 < nm; ++m1) // m1 = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // m1 = 1 for s, 3 for p, 5 for d - { - trace_alpha_row.push_back(ib + m1); - trace_alpha_col.push_back(ib + m2); - gedms.push_back(pgedm[m1 * nm + m2]); - } - } - ib += nm; - } - } - } - else - { - const double* pgedm = this->ld->gedm[iat0]; - int nproj = 0; - for (int il = 0; il < this->ld->lmaxd + 1; il++) - { - nproj += (2 * il + 1) * ptr_orb_->Alpha[0].getNchi(il); - } - for (int iproj = 0; iproj < nproj; iproj++) - { - for (int jproj = 0; jproj < nproj; jproj++) - { - trace_alpha_row.push_back(iproj); - trace_alpha_col.push_back(jproj); - gedms.push_back(pgedm[iproj * nproj + jproj]); - } - } - } - const int trace_alpha_size = trace_alpha_row.size(); - - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - auto row_indexes = paraV->get_indexes_row(iat1); - const int row_size = row_indexes.size(); - if (row_size == 0) - { - continue; - } - ModuleBase::Vector3 dR1(adjs.box[ad1].x, adjs.box[ad1].y, adjs.box[ad1].z); - if (this->ld->phialpha[0]->find_matrix(iat0, iat1, dR1.x, dR1.y, dR1.z) == nullptr) - { - continue; - } - - std::vector s_1t(trace_alpha_size * row_size); - for (int irow = 0; irow < row_size; irow++) - { - const hamilt::BaseMatrix* overlap_1 = this->ld->phialpha[0]->find_matrix(iat0, iat1, dR1); - const double* row_ptr = overlap_1->get_pointer() + row_indexes[irow] * overlap_1->get_col_size(); - double* ps1t = &s_1t[irow * trace_alpha_size]; - for (int i = 0; i < trace_alpha_size; i++) - { - ps1t[i] = row_ptr[trace_alpha_row[i]] * gedms[i]; - } - } - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - hamilt::BaseMatrix* tmp - = this->V_delta_R->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp == nullptr) - { - continue; - } - auto col_indexes = paraV->get_indexes_col(iat2); - const int col_size = col_indexes.size(); - - if (col_size == 0) - { - continue; - } - ModuleBase::Vector3 dR2(adjs.box[ad2].x, adjs.box[ad2].y, adjs.box[ad2].z); - if (this->ld->phialpha[0]->find_matrix(iat0, iat2, dR2.x, dR2.y, dR2.z) == nullptr) - { - continue; - } - - std::vector hr_current(row_size * col_size, 0); - std::vector s_2t(trace_alpha_size * col_size); - for (int icol = 0; icol < col_size; icol++) - { - const hamilt::BaseMatrix* overlap_2 = this->ld->phialpha[0]->find_matrix(iat0, iat2, dR2); - const double* col_ptr = overlap_2->get_pointer() + col_indexes[icol] * overlap_2->get_col_size(); - double* ps2t = &s_2t[icol * trace_alpha_size]; - for (int i = 0; i < trace_alpha_size; i++) - { - ps2t[i] = col_ptr[trace_alpha_col[i]]; - } - } - // dgemm for s_2t and s_1t to get HR_12 - constexpr char transa = 'T', transb = 'N'; - const double gemm_alpha = 1.0, gemm_beta = 1.0; - - dgemm_(&transa, - &transb, - &col_size, - &row_size, - &trace_alpha_size, - &gemm_alpha, - s_2t.data(), - &trace_alpha_size, - s_1t.data(), - &trace_alpha_size, - &gemm_beta, - hr_current.data(), - &col_size); - - // add data of HR to target BaseMatrix - #pragma omp critical - { - this->cal_HR_IJR(hr_current.data(), row_size, col_size, tmp->get_pointer()); - } - } - } - } - ModuleBase::timer::tick("DeePKS", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::DeePKS>::cal_HR_IJR(const double* hr_in, - const int& row_size, - const int& col_size, - TR* data_pointer) -{ - - //! npol is the number of polarizations, - //! 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - //! 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - vector step_trace(2, 0); - step_trace[1] = col_size + 1; - - //! calculate the local matrix - for (int iw1l = 0; iw1l < row_size; iw1l += npol) - { - for (int iw2l = 0; iw2l < col_size; iw2l += npol) - { - for (int is = 0; is < npol; ++is) - { - data_pointer[step_trace[is]] += TR(*hr_in); - } - data_pointer += npol; - hr_in += npol; - } - data_pointer += (npol - 1) * col_size; - hr_in += (npol - 1) * col_size; - } -} - -// contributeHk() -template -void hamilt::DeePKS>::contributeHk(int ik) -{ - ModuleBase::TITLE("DeePKS", "contributeHk"); - ModuleBase::timer::tick("DeePKS", "contributeHk"); - - TK* h_delta_k = this->ld->V_delta[ik].data(); - // set SK to zero and then calculate SK for each k vector - ModuleBase::GlobalFunc::ZEROS(h_delta_k, this->hsk->get_size()); - - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - hamilt::folding_HR(*this->V_delta_R, h_delta_k, this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - hamilt::folding_HR(*this->V_delta_R, h_delta_k, this->kvec_d[ik], ncol, 0); - } - ModuleBase::timer::tick("DeePKS", "contributeHk"); -} - -#endif - -template class DeePKS>; -template class DeePKS, double>>; -template class DeePKS, std::complex>>; - -} // namespace hamilt diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.h deleted file mode 100644 index e5ef9d8bdd..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef DEEPKSLCAO_H -#define DEEPKSLCAO_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "operator_lcao.h" - -namespace hamilt -{ - -#ifndef __MLALGOTEMPLATE -#define __MLALGOTEMPLATE - -/// The DeePKS class template inherits from class T -/// it is used to calculate the Deep Potential Kohn-Sham correction from DeePKS method -/// Template parameters: -/// - T: base class, it would be OperatorLCAO -/// - TR: data type of real space Hamiltonian, it would be double or std::complex -template -class DeePKS : public T -{ -}; - -#endif - -template -class DeePKS> : public OperatorLCAO -{ - public: - DeePKS>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - HContainer* hR_in, - const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor_orb_alpha, - const LCAO_Orbitals* ptr_orb, - const int& nks_in, - elecstate::DensityMatrix* DM_in -#ifdef __MLALGO - , - LCAO_Deepks* ld_in -#endif - ); - ~DeePKS(); - - /** - * @brief contribute the DeePKS correction to real space Hamiltonian - * this function is used for update hR and V_delta_R - */ - virtual void contributeHR() override; -#ifdef __MLALGO - /** - * @brief contribute the DeePKS correction for each k-point to V_delta - * this function is not used for update hK, but for DeePKS module - * @param ik: the index of k-point - */ - virtual void contributeHk(int ik) override; - - HContainer* get_V_delta_R() const - { - return this->V_delta_R; - } -#endif - - private: - elecstate::DensityMatrix* DM; - - const UnitCell* ucell = nullptr; - Grid_Driver* gridD = nullptr; - - const Grid_Driver* gd = nullptr; - - HContainer* V_delta_R = nullptr; - - // the following variable is introduced temporarily during LCAO refactoring - const TwoCenterIntegrator* intor_orb_alpha_ = nullptr; - const LCAO_Orbitals* ptr_orb_ = nullptr; - -#ifdef __MLALGO - - LCAO_Deepks* ld = nullptr; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the DeePKS real space Hamiltonian correction with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD); - - /** - * @brief calculate the DeePKS correction matrix with specific atom-pairs - * use the adjs_all to calculate the HR matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const double* hr_in, const int& row_size, const int& col_size, TR* data_pointer); - - /** - * @brief initialize V_delta_R, search the nearest neighbor atoms - * used for calculate the DeePKS real space Hamiltonian correction with specific atom-pairs - */ - std::vector adjs_all; -#endif - const int& nks; -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu.hpp deleted file mode 100644 index 3f8478f7ab..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu.hpp +++ /dev/null @@ -1,18 +0,0 @@ -namespace hamilt -{ - -#ifndef __DFTUTEMPLATE -#define __DFTUTEMPLATE - -/// The DFTU class template inherits from class T -/// it is used to calculate the non-local pseudopotential of wavefunction basis -/// Template parameters: -/// - T: base class, it would be OperatorLCAO or OperatorPW -template -class DFTU : public T -{ -}; - -#endif - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_force_stress.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_force_stress.hpp deleted file mode 100644 index 2ce46854a4..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_force_stress.hpp +++ /dev/null @@ -1,449 +0,0 @@ -#pragma once -#include "dftu_lcao.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" - -namespace hamilt -{ - -template -void DFTU>::cal_force_stress(const bool cal_force, - const bool cal_stress, - ModuleBase::matrix& force, - ModuleBase::matrix& stress) -{ - ModuleBase::TITLE("DFTU", "cal_force_stress"); - if (this->dftu->get_dmr(0) == nullptr) - { - ModuleBase::WARNING_QUIT("DFTU", "dmr is not set"); - } - - // try to get the density matrix, if the density matrix is empty, skip the calculation and return - const hamilt::HContainer* dmR_tmp[this->nspin]; - dmR_tmp[0] = this->dftu->get_dmr(0); - - if (this->nspin == 2) - { - dmR_tmp[1] = this->dftu->get_dmr(1); - } - if (dmR_tmp[0]->size_atom_pairs() == 0) - { - return; - } - - // begin the calculation of force and stress - ModuleBase::timer::tick("DFTU", "cal_force_stress"); - - const Parallel_Orbitals* paraV = dmR_tmp[0]->get_paraV(); - const int npol = this->ucell->get_npol(); - std::vector stress_tmp(6, 0); - if (cal_force) - { - force.zero_out(); - } - // calculate atom_index for adjs_all, induced by omp parallel - int atom_index = 0; - std::vector atom_index_all(this->ucell->nat, -1); - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - int T0=0; - int I0=0; - ucell->iat2iait(iat0, &I0, &T0); - if(this->dftu->orbital_corr[T0] == -1) - { - continue; - } - atom_index_all[iat0] = atom_index; - atom_index++; - } - - // 1. calculate for each pair of atoms - // loop over all on-site atoms - #pragma omp parallel - { - std::vector stress_local(6, 0); - ModuleBase::matrix force_local(force.nr, force.nc); - #pragma omp for schedule(dynamic) - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - // skip the atoms without plus-U - auto tau0 = ucell->get_tau(iat0); - int T0=0; - int I0=0; - ucell->iat2iait(iat0, &I0, &T0); - const int target_L = this->dftu->orbital_corr[T0]; - if (target_L == -1) - { - continue; - } - const int tlp1 = 2 * target_L + 1; - AdjacentAtomInfo& adjs = this->adjs_all[atom_index_all[iat0]]; - - std::vector>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - int L1 = atom1->iw2l[iw1]; - int N1 = atom1->iw2n[iw1]; - int m1 = atom1->iw2m[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - ModuleBase::Vector3 dtau = tau0 - tau1; - intor_->snap(T1, L1, N1, M1, T0, dtau * this->ucell->lat0, 1 /*cal_deri*/, nlm); - - // select the elements of nlm with target_L - std::vector nlm_target(tlp1 * 4); - for (int iw = 0; iw < this->ucell->atoms[T0].nw; iw++) - { - const int L0 = this->ucell->atoms[T0].iw2l[iw]; - if (L0 == target_L) - { - for (int m = 0; m < tlp1; m++) //-l, -l+1, ..., l-1, l - { - for (int n = 0; n < 4; n++) // value, deri_x, deri_y, deri_z - { - nlm_target[m + n * tlp1] = nlm[n][iw + m]; - // if(dtau.norm2 == 0.0) std::cout<<__FILE__<<__LINE__<<" "< occ(tlp1 * tlp1 * this->nspin, 0); - if(this->nspin ==2) - { - for (int i = 0; i < occ.size(); i++) - { - const int is = i / (tlp1 * tlp1); - const int ii = i % (tlp1 * tlp1); - occ[i] = this->dftu->locale[iat0][target_L][0][is].c[ii]; - } - } - else - { - for (int i = 0; i < occ.size(); i++) - { - occ[i] = this->dftu->locale[iat0][target_L][0][0].c[i]; - } - } - - // calculate VU - const double u_value = this->dftu->U[T0]; - std::vector VU(occ.size()); - double eu_tmp = 0; - this->cal_v_of_u(occ, tlp1, u_value, &VU[0], eu_tmp); - if(this->nspin == 4) - { - for (int i = 0; i < VU.size(); i++) - { - VU[i] /= 2.0; - } - } - - // second iteration to calculate force and stress - // calculate Force for atom J - // DMR_{I,J,R'-R} * U*(1/2*delta(m, m')-occ(m, m')) - // \frac{\partial }{\partial \tau_J} for each pair of atoms - // calculate Stress for strain tensor \varepsilon_{\alpha\beta} - // -1/Omega * DMR_{I,J,R'-R} * [ \frac{\partial }{\partial \tau_{J,\alpha}}\tau_{J,\beta} - // U*(1/2*delta(m, m')-occ(m, m')) - // + U*(1/2*delta(m, m')-occ(m, m')) - // \frac{\partial }{\partial \tau_{J,\alpha}}\tau_{J,\beta}] for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - double* force_tmp1 = (cal_force) ? &force_local(iat1, 0) : nullptr; - double* force_tmp2 = (cal_force) ? &force_local(iat0, 0) : nullptr; - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - ModuleBase::Vector3 dis1 = adjs.adjacent_tau[ad1] - tau0; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 dis2 = adjs.adjacent_tau[ad2] - tau0; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - const hamilt::BaseMatrix* tmp[this->nspin]; - tmp[0] = dmR_tmp[0]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - if (this->nspin == 2) - { - tmp[1] = dmR_tmp[1]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - } - // if not found , skip this pair of atoms - if (tmp[0] != nullptr) - { - // calculate force - if (cal_force) { - this->cal_force_IJR(iat1, - iat2, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - VU, - tmp, - this->nspin, - force_tmp1, - force_tmp2); - } - - // calculate stress - if (cal_stress) { - this->cal_stress_IJR(iat1, - iat2, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - VU, - tmp, - this->nspin, - dis1, - dis2, - stress_local.data()); - } - } - } - } - } - #pragma omp critical - { - if(cal_force) - { - force += force_local; - } - if(cal_stress) - { - for(int i = 0; i < 6; i++) - { - stress_tmp[i] += stress_local[i]; - } - } - } - } - - if (cal_force) - { -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(force.c, force.nr * force.nc); -#endif - for (int i = 0; i < force.nr * force.nc; i++) - { - force.c[i] *= 2.0; - } - } - - // stress renormalization - if (cal_stress) - { -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(stress_tmp.data(), 6); -#endif - const double weight = this->ucell->lat0 / this->ucell->omega; - for (int i = 0; i < 6; i++) - { - stress.c[i] = stress_tmp[i] * weight; - } - stress.c[8] = stress.c[5]; // stress(2,2) - stress.c[7] = stress.c[4]; // stress(2,1) - stress.c[6] = stress.c[2]; // stress(2,0) - stress.c[5] = stress.c[4]; // stress(1,2) - stress.c[4] = stress.c[3]; // stress(1,1) - stress.c[3] = stress.c[1]; // stress(1,0) - } - - ModuleBase::timer::tick("DFTU", "cal_force_stress"); -} - - -template -void DFTU>::cal_force_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const std::vector& vu_in, - const hamilt::BaseMatrix** dmR_pointer, - const int nspin, - double* force1, - double* force2) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int m_size = int(sqrt(vu_in.size() / nspin)); - const int m_size2 = m_size * m_size; - - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - - if (npol == 2) - { - step_trace[1] = 1; - step_trace[2] = col_indexes.size(); - step_trace[3] = col_indexes.size() + 1; - } - - double tmp[3]; - // calculate the local matrix - for (int is = 0; is < nspin; is++) - { - const int is0 = nspin==2 ? is : 0; - const int step_is = nspin==4 ? is : 0; - const double* dm_pointer = dmR_pointer[is0]->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - tmp[0] = vu_in[m1 * m_size + m2 + is * m_size2] * nlm1[m1 + m_size] - * nlm2[m2] * dm_pointer[step_trace[step_is]]; - tmp[1] = vu_in[m1 * m_size + m2 + is * m_size2] * nlm1[m1 + m_size * 2] - * nlm2[m2] * dm_pointer[step_trace[step_is]]; - tmp[2] = vu_in[m1 * m_size + m2 + is * m_size2] * nlm1[m1 + m_size * 3] - * nlm2[m2] * dm_pointer[step_trace[step_is]]; - // force1 = - VU * * - // force2 = - VU * * } - force1[0] += tmp[0]; - force1[1] += tmp[1]; - force1[2] += tmp[2]; - force2[0] -= tmp[0]; - force2[1] -= tmp[1]; - force2[2] -= tmp[2]; - } - } - dm_pointer += npol; - } - dm_pointer += (npol - 1) * col_indexes.size(); - } - } -} - -template -void DFTU>::cal_stress_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const std::vector& vu_in, - const hamilt::BaseMatrix** dmR_pointer, - const int nspin, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int m_size = int(sqrt(vu_in.size() / nspin)); - const int m_size2 = m_size * m_size; - - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - - if (npol == 2) - { - step_trace[1] = 1; - step_trace[2] = col_indexes.size(); - step_trace[3] = col_indexes.size() + 1; - } - - // calculate the local matrix - for (int is = 0; is < nspin; is++) - { - const int is0 = nspin==2 ? is : 0; - const int step_is = nspin==4 ? is : 0; - const double* dm_pointer = dmR_pointer[is0]->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - double tmp = vu_in[m1 * m_size + m2 + is * m_size2] * dm_pointer[step_trace[step_is]]; - // std::cout<<__FILE__<<__LINE__<<" "< -#endif -#include "source_base/parallel_reduce.h" - -template -hamilt::DFTU>::DFTU(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell& ucell_in, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor, - const std::vector& orb_cutoff, - ModuleDFTU::DFTU* dftu_in) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), intor_(intor), orb_cutoff_(orb_cutoff) -{ - this->cal_type = calculation_type::lcao_dftu; - this->ucell = &ucell_in; - this->dftu = dftu_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); -#endif - // initialize HR to allocate sparse Nonlocal matrix memory - this->initialize_HR(GridD_in); - // set nspin - this->nspin = PARAM.inp.nspin; -} - -// destructor -template -hamilt::DFTU>::~DFTU() -{ -} - -// initialize_HR() -template -void hamilt::DFTU>::initialize_HR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("DFTU", "initialize_HR"); - ModuleBase::timer::tick("DFTU", "initialize_HR"); - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0=0; - int I0=0; - ucell->iat2iait(iat0, &I0, &T0); - const int target_L = this->dftu->orbital_corr[T0]; - if (target_L == -1) - { - continue; - } - - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + PARAM.inp.onsite_radius) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - } - - ModuleBase::timer::tick("DFTU", "initialize_HR"); -} - -template -void hamilt::DFTU>::cal_nlm_all(const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("DFTU", "cal_nlm_all"); - if (this->precal_nlm_done) - { - return; - } - - ModuleBase::timer::tick("DFTU", "cal_nlm_all"); - nlm_tot.resize(this->ucell->nat); - const int npol = this->ucell->get_npol(); - int atom_index = 0; - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0=0; - int I0=0; - ucell->iat2iait(iat0, &I0, &T0); - const int target_L = this->dftu->orbital_corr[T0]; - if (target_L == -1) - { - continue; - } - const int tlp1 = 2 * target_L + 1; - AdjacentAtomInfo& adjs = this->adjs_all[atom_index++]; - - // calculate and save the table of two-center integrals - nlm_tot[iat0].resize(adjs.adj_num + 1); - - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - // only first zeta orbitals in target L of atom iat0 are needed - std::vector nlm_target(tlp1); - const int L1 = atom1->iw2l[iw1]; - const int N1 = atom1->iw2n[iw1]; - const int m1 = atom1->iw2m[iw1]; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - const int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - ModuleBase::Vector3 dtau = tau0 - tau1; - intor_->snap(T1, L1, N1, M1, T0, dtau * this->ucell->lat0, false /*cal_deri*/, nlm); - // select the elements of nlm with target_L - for (int iw = 0; iw < this->ucell->atoms[T0].nw; iw++) - { - const int L0 = this->ucell->atoms[T0].iw2l[iw]; - if (L0 == target_L) - { - for (int m = 0; m < 2 * L0 + 1; m++) - { - nlm_target[m] = nlm[0][iw + m]; - } - break; - } - } - nlm_tot[iat0][ad].insert({all_indexes[iw1l], nlm_target}); - } - } - } - this->precal_nlm_done = true; - ModuleBase::timer::tick("DFTU", "cal_nlm_all"); -} - -// contributeHR() -template -void hamilt::DFTU>::contributeHR() -{ - ModuleBase::TITLE("DFTU", "contributeHR"); - if (this->dftu->get_dmr(0) == nullptr && this->dftu->initialed_locale == false) - { // skip the calculation if dm_in_dftu is nullptr - return; - } - else - { - // will update this->dftu->locale and this->dftu->EU - if (this->current_spin == 0) - { - this->dftu->EU = 0.0; - } - } - ModuleBase::timer::tick("DFTU", "contributeHR"); - - const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - // 1. calculate for each pair of atoms - this->cal_nlm_all(paraV); - // loop over all on-site atoms - int atom_index = 0; - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - // skip the atoms without plus-U - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - const int target_L = this->dftu->orbital_corr[T0]; - if (target_L == -1) - { - continue; - } - const int tlp1 = 2 * target_L + 1; - AdjacentAtomInfo& adjs = this->adjs_all[atom_index++]; - - ModuleBase::timer::tick("DFTU", "cal_occ"); - // first iteration to calculate occupation matrix - const int spin_fold = (this->nspin == 4) ? 4 : 1; - std::vector occ(tlp1 * tlp1 * spin_fold, 0.0); - if (this->dftu->initialed_locale == false) - { - const hamilt::HContainer* dmR_current = this->dftu->get_dmr(this->current_spin); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - const std::unordered_map>& nlm1 = nlm_tot[iat0][ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - const std::unordered_map>& nlm2 = nlm_tot[iat0][ad2]; - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - const hamilt::BaseMatrix* tmp - = dmR_current->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - this->cal_occ(iat1, iat2, paraV, nlm1, nlm2, tmp->get_pointer(), occ); - } - } - } -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(occ.data(), occ.size()); -#endif - // save occ to dftu - for (int i = 0; i < occ.size(); i++) - { - if (this->nspin == 1) - { - occ[i] *= 0.5; - } - this->dftu->locale[iat0][target_L][0][this->current_spin].c[i] = occ[i]; - } - } - else // use readin locale to calculate occupation matrix - { - for (int i = 0; i < occ.size(); i++) - { - occ[i] = this->dftu->locale[iat0][target_L][0][this->current_spin].c[i]; - } - // set initialed_locale to false to avoid using readin locale in next iteration - } - ModuleBase::timer::tick("DFTU", "cal_occ"); - - // calculate VU - ModuleBase::timer::tick("DFTU", "cal_vu"); - const double u_value = this->dftu->U[T0]; - std::vector VU_tmp(occ.size()); - this->cal_v_of_u(occ, tlp1, u_value, VU_tmp.data(), this->dftu->EU); - // transfer occ from pauli matrix format to normal format - std::vector VU(occ.size()); - this->transfer_vu(VU_tmp, VU); - - // second iteration to calculate Hamiltonian matrix - // calculate U*(1/2*delta(m, m')-occ(m, m')) for each pair of atoms - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - const std::unordered_map>& nlm1 = nlm_tot[iat0][ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - const std::unordered_map>& nlm2 = nlm_tot[iat0][ad2]; - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - hamilt::BaseMatrix* tmp = this->hR->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - this->cal_HR_IJR(iat1, iat2, paraV, nlm1, nlm2, VU, tmp->get_pointer()); - } - } - } - ModuleBase::timer::tick("DFTU", "cal_vu"); - } - - // energy correction for NSPIN=1 - if (this->nspin == 1) - { - this->dftu->EU *= 2.0; - } - // for readin onsite_dm, set initialed_locale to false to avoid using readin locale in next iteration - if (this->current_spin == this->nspin - 1 || this->nspin == 4) - { - this->dftu->initialed_locale = false; - } - - // update this->current_spin: only nspin=2 iterate change it between 0 and 1 - // the key point is only nspin=2 calculate spin-up and spin-down separately, - // and won't calculate spin-up twice without spin-down - if (this->nspin == 2) - { - this->current_spin = 1 - this->current_spin; - } - - ModuleBase::timer::tick("DFTU", "contributeHR"); -} - -// cal_HR_IJR() -template -void hamilt::DFTU>::cal_HR_IJR( - const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const std::vector& VU, - TR* data_pointer) -{ - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int m_size = int(sqrt(VU.size()) / npol); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = paraV->get_col_size(iat2) * is + is2; - } - } - // calculate the local matrix - const TR* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - int start = is * m_size * m_size; - TR nlm_tmp = TR(0); - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - nlm_tmp += nlm1[m1] * nlm2[m2] * VU[m1 * m_size + m2 + start]; - } - } - data_pointer[step_trace[is]] += nlm_tmp; - } - data_pointer += npol; - } - data_pointer += (npol - 1) * col_indexes.size(); - } -} - -template -void hamilt::DFTU>::cal_occ(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const double* dm_pointer, - std::vector& occ) -{ - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int m_size = int(sqrt(occ.size()) / npol); - const int m_size2 = m_size * m_size; -#ifdef __DEBUG - assert(m_size * m_size == occ.size()); -#endif - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = paraV->get_col_size(iat2) * is + is2; - } - } - // calculate the local matrix - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is1 = 0; is1 < npol; ++is1) - { - for (int is2 = 0; is2 < npol; ++is2) - { - for (int m1 = 0; m1 < m_size; ++m1) - { - for (int m2 = 0; m2 < m_size; ++m2) - { - occ[m1 * m_size + m2 + (is1 * npol + is2) * m_size2] - += nlm1[m1] * nlm2[m2] * dm_pointer[step_trace[is1 * npol + is2]]; - } - } - } - } - dm_pointer += npol; - } - dm_pointer += (npol - 1) * col_indexes.size(); - } -} - -template -void hamilt::DFTU>::transfer_vu(std::vector& vu_tmp, std::vector& vu) -{ -#ifdef __DEBUG - assert(vu.size() == vu_tmp.size()); -#endif - for (int i = 0; i < vu_tmp.size(); i++) - { - vu[i] = vu_tmp[i]; - } -} - -template <> -void hamilt::DFTU, std::complex>>::transfer_vu( - std::vector& vu_tmp, - std::vector>& vu) -{ -#ifdef __DEBUG - assert(vu.size() == vu_tmp.size()); -#endif - - // TR == std::complex transfer from double to std::complex - const int m_size = int(sqrt(vu.size()) / 2); - const int m_size2 = m_size * m_size; - vu.resize(vu_tmp.size()); - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - int index[4]; - index[0] = m1 * m_size + m2; - index[1] = m1 * m_size + m2 + m_size2; - index[2] = m2 * m_size + m1 + m_size2 * 2; - index[3] = m2 * m_size + m1 + m_size2 * 3; - vu[index[0]] = 0.5 * (vu_tmp[index[0]] + vu_tmp[index[3]]); - vu[index[3]] = 0.5 * (vu_tmp[index[0]] - vu_tmp[index[3]]); - // vu should be complex type, but here we use double type for test - vu[index[1]] = 0.5 * (vu_tmp[index[1]] + std::complex(0.0, 1.0) * vu_tmp[index[2]]); - vu[index[2]] = 0.5 * (vu_tmp[index[1]] - std::complex(0.0, 1.0) * vu_tmp[index[2]]); - } - } -} - -template -void hamilt::DFTU>::cal_v_of_u(const std::vector& occ, - const int m_size, - const double u_value, - double* vu, - double& eu) -{ - // calculate the local matrix - int spin_fold = occ.size() / m_size / m_size; - if (spin_fold < 4) { - for (int is = 0; is < spin_fold; ++is) - { - int start = is * m_size * m_size; - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - vu[start + m1 * m_size + m2] = u_value * (0.5 * (m1 == m2) - occ[start + m2 * m_size + m1]); - eu += u_value * 0.5 * occ[start + m2 * m_size + m1] * occ[start + m1 * m_size + m2]; - } - } - } - } else - { - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - vu[m1 * m_size + m2] = u_value * (1.0 * (m1 == m2) - occ[m2 * m_size + m1]); - eu += u_value * 0.25 * occ[m2 * m_size + m1] * occ[m1 * m_size + m2]; - } - } - for (int is = 1; is < spin_fold; ++is) - { - int start = is * m_size * m_size; - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - vu[start + m1 * m_size + m2] = u_value * (0 - occ[start + m2 * m_size + m1]); - eu += u_value * 0.25 * occ[start + m2 * m_size + m1] * occ[start + m1 * m_size + m2]; - } - } - } - } -} - -#include "dftu_force_stress.hpp" - -template class hamilt::DFTU>; -template class hamilt::DFTU, double>>; -template class hamilt::DFTU, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_lcao.h deleted file mode 100644 index c8ba4a738e..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_lcao.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef DFTPLUSU_H -#define DFTPLUSU_H -#include "dftu.hpp" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include - -namespace hamilt -{ - -/// DFTU class template specialization for OperatorLCAO base class -/// It is used to calculate the non-local pseudopotential matrix in real space and fold it to k-space -/// HR = D_{p1, p2} -/// HK = D_{p1, p2} = \sum_{R} e^{ikR} HR -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class DFTU> : public OperatorLCAO -{ - public: - DFTU>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell& ucell_in, - const Grid_Driver* gridD_in, - const TwoCenterIntegrator* intor, - const std::vector& orb_cutoff, - ModuleDFTU::DFTU* dftu_in); - ~DFTU>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * D_{p1, p2} - */ - virtual void contributeHR() override; - - /// calculate force and stress for DFT+U - void cal_force_stress(const bool cal_force, - const bool cal_stress, - ModuleBase::matrix& force, - ModuleBase::matrix& stress); - - private: - const UnitCell* ucell = nullptr; - - ModuleDFTU::DFTU* dftu = nullptr; - - hamilt::HContainer* HR = nullptr; - - const TwoCenterIntegrator* intor_ = nullptr; - - std::vector orb_cutoff_; - - /// @brief the number of spin components, 1 for no-spin, 2 for collinear spin case and 4 for non-collinear spin case - int nspin = 0; - - /** - * @brief search the nearest neighbor atoms and save them into this->adjs_all - * the size of HR will not change in DFTU, - * because I don't want to expand HR larger than Nonlocal operator caused by DFTU - */ - void initialize_HR(const Grid_Driver* gridD_in); - - /** - * @brief calculate the overlap values and save them in this->nlm_tot - * it will be reused in the calculation of calculate_HR() - */ - void cal_nlm_all(const Parallel_Orbitals* paraV); - - /** - * @brief calculate the occ_mm' = \sum_R DMR* matrix for each atom to add U - */ - void cal_occ(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const double* data_pointer, - std::vector& occupations); - - /// transfer VU format from pauli matrix to normal for non-collinear spin case - void transfer_vu(std::vector& vu_tmp, std::vector& vu); - /// VU_{m, m'} = sum_{m,m'} (1/2*delta_{m, m'} - occ_{m, m'}) * U - /// EU = sum_{m,m'} 1/2 * U * occ_{m, m'} * occ_{m', m} - void cal_v_of_u(const std::vector& occ, const int m_size, const double u_value, double* vu, double& eu); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const std::vector& vu_in, - TR* data_pointer); - - /** - * @brief calculate the atomic Force of atom pair - */ - void cal_force_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const std::vector& vu_in, - const hamilt::BaseMatrix** dmR_pointer, - const int nspin, - double* force1, - double* force2); - /** - * @brief calculate the Stress of atom pair - */ - void cal_stress_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const std::vector& vu_in, - const hamilt::BaseMatrix** dmR_pointer, - const int nspin, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress); - - std::vector adjs_all; - /// @brief if the nlm_tot is calculated - bool precal_nlm_done = false; - /// @brief the overlap values for all [atoms][nerghbors][orb_index(iw) in NAOs][m of target_l in Projectors] - std::vector>>> nlm_tot; -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_force_stress.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_force_stress.hpp deleted file mode 100644 index ff14029e25..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_force_stress.hpp +++ /dev/null @@ -1,394 +0,0 @@ -#pragma once -#include "dspin_lcao.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" - -namespace hamilt -{ - -template -void DeltaSpin>::cal_force_stress(const bool cal_force, - const bool cal_stress, - const HContainer* dmR, - ModuleBase::matrix& force, - ModuleBase::matrix& stress) -{ - ModuleBase::TITLE("DeltaSpin", "cal_force_stress"); - - // begin the calculation of force and stress - ModuleBase::timer::tick("DeltaSpin", "cal_force_stress"); - - spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); - auto& constrain = sc.get_constrain(); - this->cal_constraint_atom_list(constrain); - auto& lambda = sc.get_sc_lambda(); - - const Parallel_Orbitals* paraV = dmR->get_paraV(); - const int npol = this->ucell->get_npol(); - std::vector stress_tmp(6, 0); - if (cal_force) - { - force.zero_out(); - } - // 1. calculate for each pair of atoms - // loop over all on-site atoms - #pragma omp parallel - { - std::vector stress_local(6, 0); - ModuleBase::matrix force_local(force.nr, force.nc); - #pragma omp for schedule(dynamic) - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - if(!this->constraint_atom_list[iat0]) - { - continue; - } - - // skip the atoms without plus-U - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - - // first step: find the adjacent atoms and filter the real adjacent atoms - AdjacentAtomInfo adjs; - this->gridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < this->orb_cutoff_[T1] + PARAM.inp.onsite_radius) - { - is_adj[ad] = true; - } - } - filter_adjs(is_adj, adjs); - const int max_l_plus_1 = this->ucell->atoms[T0].nwl + 1; - const int length = max_l_plus_1 * max_l_plus_1; - std::vector>> nlm_iat0(adjs.adj_num + 1); - - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - int L1 = atom1->iw2l[iw1]; - int N1 = atom1->iw2n[iw1]; - int m1 = atom1->iw2m[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - ModuleBase::Vector3 dtau = tau0 - tau1; - intor_->snap(T1, L1, N1, M1, T0, dtau * this->ucell->lat0, 1 /*cal_deri*/, nlm); - // select the elements of nlm with target_L - std::vector nlm_target(length * 4); - // select the elements of nlm with target_L (0, 1, 2, 3 ...) - int target_L = 0, index=0; - for(int iw =0;iw < this->ucell->atoms[T0].nw; iw++) - { - const int L0 = this->ucell->atoms[T0].iw2l[iw]; - // only the first zeta of each l-orbital is needed - if(L0 == target_L) - { - for(int m = 0; m < 2*L0+1; m++) - { - for (int n = 0; n < 4; n++) // value, deri_x, deri_y, deri_z - { - nlm_target[index + n * length] = nlm[n][iw + m]; - } - index++; - } - target_L++; - } - } - nlm_iat0[ad].insert({all_indexes[iw1l], nlm_target}); - } - } - - // second iteration to calculate force and stress - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - double* force_tmp1 = (cal_force) ? &force_local(iat1, 0) : nullptr; - double* force_tmp2 = (cal_force) ? &force_local(iat0, 0) : nullptr; - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - ModuleBase::Vector3 dis1 = adjs.adjacent_tau[ad1] - tau0; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 dis2 = adjs.adjacent_tau[ad2] - tau0; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - const hamilt::BaseMatrix* tmp = dmR->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - int row_size = paraV->get_row_size(); - int col_size = paraV->get_col_size(); - if(row_size == 0 || col_size == 0) - { - continue; - } - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - // calculate force - if (cal_force) { - this->cal_force_IJR(iat1, - iat2, - paraV, - nlm_iat0[ad1], - nlm_iat0[ad2], - tmp, - lambda[iat0], - this->nspin, - force_tmp1, - force_tmp2); - } - - // calculate stress - if (cal_stress) { - this->cal_stress_IJR(iat1, - iat2, - paraV, - nlm_iat0[ad1], - nlm_iat0[ad2], - tmp, - lambda[iat0], - this->nspin, - dis1, - dis2, - stress_local.data()); - } - } - } - } - } - #pragma omp critical - { - if(cal_force) - { - force += force_local; - } - if(cal_stress) - { - for(int i = 0; i < 6; i++) - { - stress_tmp[i] += stress_local[i]; - } - } - } - } - - if (cal_force) - { -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(force.c, force.nr * force.nc); -#endif - for (int i = 0; i < force.nr * force.nc; i++) - { - force.c[i] *= 2.0; - } - } - - // stress renormalization - if (cal_stress) - { -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(stress_tmp.data(), 6); -#endif - const double weight = this->ucell->lat0 / this->ucell->omega; - for (int i = 0; i < 6; i++) - { - stress.c[i] = stress_tmp[i] * weight; - } - stress.c[8] = stress.c[5]; // stress(2,2) - stress.c[7] = stress.c[4]; // stress(2,1) - stress.c[6] = stress.c[2]; // stress(2,0) - stress.c[5] = stress.c[4]; // stress(1,2) - stress.c[4] = stress.c[3]; // stress(1,1) - stress.c[3] = stress.c[1]; // stress(1,0) - } - - ModuleBase::timer::tick("DeltaSpin", "cal_force_stress"); -} - -template -void DeltaSpin>::cal_force_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - const ModuleBase::Vector3& lambda, - const int nspin, - double* force1, - double* force2) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(nspin, 0); - if (nspin == 4) { - step_trace[1] = 1; - step_trace[2] = col_indexes.size(); - step_trace[3] = col_indexes.size() + 1; - } - double tmp[3]; - // calculate the local matrix - for (int is = 1; is < nspin; is++) - { - const double lambda_tmp = nspin==2?lambda[2]:lambda[is-1]; - const double* dm_pointer = dmR_pointer->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - const int length = nlm1.size() / 4; - const int lmax = sqrt(length); - int index = 0; - for(int l = 0; l * - // force2 = - VU * * } - force1[0] += tmp[0]; - force1[1] += tmp[1]; - force1[2] += tmp[2]; - force2[0] -= tmp[0]; - force2[1] -= tmp[1]; - force2[2] -= tmp[2]; - } - } - dm_pointer += npol; - } - dm_pointer += (npol - 1) * col_indexes.size(); - } - } -} - -template -void DeltaSpin>::cal_stress_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - const ModuleBase::Vector3& lambda, - const int nspin, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(nspin, 0); - if (nspin == 4) { - step_trace[1] = 1; - step_trace[2] = col_indexes.size(); - step_trace[3] = col_indexes.size() + 1; - } - // calculate the local matrix - for (int is = 1; is < nspin; is++) - { - const double lambda_tmp = nspin==2?lambda[2]:lambda[is-1]; - const double* dm_pointer = dmR_pointer->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - const int length = nlm1.size() / 4; - const int lmax = sqrt(length); - double tmp = lambda_tmp * dm_pointer[step_trace[is]]; - int index = 0; - for(int l = 0; l -hamilt::DeltaSpin>::DeltaSpin(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell& ucell_in, - const Grid_Driver* gridD_in, - const TwoCenterIntegrator* intor, - const std::vector& orb_cutoff) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), intor_(intor), orb_cutoff_(orb_cutoff) -{ - this->cal_type = calculation_type::lcao_sc_lambda; - this->ucell = &ucell_in; - this->gridD = gridD_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); - assert(this->gridD != nullptr); -#endif - //set nspin - this->nspin = PARAM.inp.nspin; - this->spin_num = this->nspin == 2 ? 2 : 1; - - this->lambda_save.resize(this->ucell->nat * 3, 0.0); - this->update_lambda_.resize(this->nspin, false); -} - -// destructor -template -hamilt::DeltaSpin>::~DeltaSpin() -{ - for (auto& hr : this->pre_hr) - { - if (hr != nullptr) - { - delete hr; - hr = nullptr; - } - } - this->pre_hr.clear(); - this->pre_hr.shrink_to_fit(); -} - -// simple functions to calculate the coefficients from lambda -inline void cal_coeff_lambda(const std::vector& current_lambda, std::vector& coefficients) -{ - coefficients[0] = current_lambda[0]; - coefficients[1] = -current_lambda[0]; -} -inline void cal_coeff_lambda(const std::vector& current_lambda, std::vector>& coefficients) -{// {\lambda^{I,3}, \lambda^{I,1}+i\lambda^{I,2}, \lambda^{I,1}-i\lambda^{I,2}, -\lambda^{I,3}} - coefficients[0] = std::complex(current_lambda[2], 0.0); - coefficients[1] = std::complex(current_lambda[0] , current_lambda[1]); - coefficients[2] = std::complex(current_lambda[0] , -1 * current_lambda[1]); - coefficients[3] = std::complex(-1 * current_lambda[2], 0.0); -} - -template -void hamilt::DeltaSpin>::contributeHR() -{ - // if lambda has not changed, calculate the HR^I = lambda^I\sum_{lm} - // if lambda has changed, calculate the dHR^I = dlambda^I\sum_{lm} - spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); - // there are three case for contributeHR - // 1. HR has not been calculated, reset lambda_save and calculate HR = lambda * pre_hr - // 2. HR has been calculated, but lambda has changed, calculate dHR = dlambda * pre_hr - // 3. HR has been calculated, and lambda has not changed, do nothing - if(!this->hr_done) - { - // set the lambda_save to zero if lambda loop is started - this->lambda_save.assign(this->ucell->nat * 3, 0.0); - } - else if(this->hr_done && !this->update_lambda_[this->current_spin]) - { - return; - } - - // calculate Hpre^I = \sum_{lm} - if(!this->initialized) - { - auto& constrain = sc.get_constrain(); - this->cal_constraint_atom_list(constrain); - this->cal_pre_HR(); - this->initialized = true; - } - auto& lambda = sc.get_sc_lambda(); - - for(int iat=0;iatucell->nat;iat++) - { - if(!this->constraint_atom_list[iat]) - { - continue; - } - // calculate the delta lambda to update the real space Hamiltonian - std::vector current_lambda; - if(this->nspin==4) - { - current_lambda = {lambda[iat].x - this->lambda_save[iat*3], - lambda[iat].y - this->lambda_save[iat*3+1], - lambda[iat].z - this->lambda_save[iat*3+2]}; - } - else if(this->nspin==2) - { - current_lambda = {lambda[iat].z-this->lambda_save[iat*3+2], 0.0, 0.0}; - } - std::vector coefficients(this->nspin); - - cal_coeff_lambda(current_lambda, coefficients); - - // magnetic moment = \sum_{\mu\nu,R} dmR * pre_hr - for(int iap=0;iappre_hr[iat]->size_atom_pairs();iap++) - { - hamilt::AtomPair& tmp = this->pre_hr[iat]->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - int row_size = tmp.get_row_size(); - int col_size = tmp.get_col_size(); - if(this->nspin==4) - { - this->pre_coeff_array(coefficients, row_size, col_size); - } - for(int ir = 0;ir < tmp.get_R_size(); ++ir ) - { - const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); - const TR* pre_hr_data = tmp.get_pointer(ir); - TR* dhr_data = this->hR->find_matrix(iat1, iat2, r_index[0], r_index[1], r_index[2])->get_pointer(); - // TR== double: axpy for dhr_data += current_lambda * pre_hr_data - // TR!= double: call cal_lambda_hr_IJR - if (this->nspin==2) - { - //BlasConnector::axpy(row_size*col_size, coefficients[this->current_spin], pre_hr_data, dhr_data); - for(int i=0;icurrent_spin]; - } - } - else - { - for(int i=0;itmp_coeff_array[i]; - } - } - } - } - } - - // save lambda to lambda_save or update the current_spin in NSPIN=2 - this->update_lambda_[this->current_spin] = false; - if(this->current_spin == this->spin_num - 1) - { - for(int i=0;iucell->nat;i++) - { - if(this->constraint_atom_list[i]) - { - for(int j=0;j<3;j++) - { - this->lambda_save[i*3+j] = lambda[i][j]; - } - } - } - } - return; -} - -// cal_lambda_hr_IJR -template -void hamilt::DeltaSpin>::pre_coeff_array( - const std::vector& coeff, const int row_size, const int col_size) -{ - this->tmp_coeff_array.resize(row_size*col_size); - for(int irow=0;irowtmp_coeff_array[irow*col_size+icol] = coeff[0]; - this->tmp_coeff_array[irow*col_size+icol+1] = coeff[1]; - this->tmp_coeff_array[(irow+1)*col_size+icol] = coeff[2]; - this->tmp_coeff_array[(irow+1)*col_size+icol+1] = coeff[3]; - } - } -} - -// cal_constraint_atom_list() -template -void hamilt::DeltaSpin>::cal_constraint_atom_list(const std::vector>& constraints) -{ - this->constraint_atom_list.clear(); - this->constraint_atom_list.resize(this->ucell->nat, false); -#ifdef __DEBUG - assert(this->ucell->nat == constraints.size()); -#endif - for(int iat=0;iatucell->nat;iat++) - { - if(constraints[iat][0] + constraints[iat][1] + constraints[iat][2] == 0) - { - this->constraint_atom_list[iat] = false; - } - else - { - this->constraint_atom_list[iat] = true; - } - } -} - -// cal_pre_HR() -template -void hamilt::DeltaSpin>::cal_pre_HR() -{ - ModuleBase::TITLE("DeltaSpin", "cal_pre_HR"); - if(this->initialized) - { - return; - } - this->paraV = this->hR->get_paraV(); - ModuleBase::timer::tick("DeltaSpin", "cal_pre_HR"); - this->pre_hr.clear(); - this->pre_hr.resize(this->ucell->nat, nullptr); - - const int npol = this->ucell->get_npol(); - size_t memory_cost = 0; - for(int iat=0;iatucell->nat;iat++) - { - if(!this->constraint_atom_list[iat]) - { - continue; - } - - auto tau0 = ucell->get_tau(iat); - int T0, I0; - this->ucell->iat2iait(iat, &I0, &T0); - - // first step: find the adjacent atoms and filter the real adjacent atoms - AdjacentAtomInfo adjs; - this->gridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat, iat1, R_index1).norm() * this->ucell->lat0 - < this->orb_cutoff_[T1] + PARAM.inp.onsite_radius) - { - is_adj[ad] = true; - } - } - filter_adjs(is_adj, adjs); - - // second step: prepare the pairs for each iat-atom - this->pre_hr[iat] = new hamilt::HContainer(this->paraV); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = this->ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = this->ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - int r_vector[3] = {R_index2.x - R_index1.x, R_index2.y - R_index1.y, R_index2.z - R_index1.z}; - // keep the size of pre_hr for each atom less than this->hR - if(this->hR->find_matrix(iat1, iat2, r_vector[0], r_vector[1], r_vector[2]) == nullptr) - { - continue; - } - hamilt::AtomPair tmp(iat1, - iat2, - r_vector[0], - r_vector[1], - r_vector[2], - paraV); - this->pre_hr[iat]->insert_pair(tmp); - } - } - this->pre_hr[iat]->allocate(nullptr, true); - - // third step: calculate the overlap integrals - const int max_l_plus_1 = this->ucell->atoms[T0].nwl + 1; - std::vector>> nlm_iat0(adjs.adj_num + 1); - for(int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = this->ucell->itia2iat(T1, I1); - const Atom* atom1 = &ucell->atoms[T1]; - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - // only first zeta orbitals in target L of atom iat0 are needed - std::vector nlm_target(max_l_plus_1 * max_l_plus_1); - const int L1 = atom1->iw2l[ iw1 ]; - const int N1 = atom1->iw2n[ iw1 ]; - const int m1 = atom1->iw2m[ iw1 ]; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - const int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - ModuleBase::Vector3 dtau = tau0 - tau1; - intor_->snap(T1, L1, N1, M1, T0, dtau * this->ucell->lat0, 0 /*cal_deri*/, nlm); - - // select the elements of nlm with target_L (0, 1, 2, 3 ...) - int target_L = 0, index=0; - for(int iw =0;iw < this->ucell->atoms[T0].nw; iw++) - { - const int L0 = this->ucell->atoms[T0].iw2l[iw]; - // only the first zeta of each l-orbital is needed - if(L0 == target_L) - { - for(int m = 0; m < 2*L0+1; m++) - { - nlm_target[index] = nlm[0][iw+m]; - index++; - } - target_L++; - } - } - nlm_iat0[ad].insert({all_indexes[iw1l], nlm_target}); - } - } - - // fourth step: calculate the - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - const std::unordered_map>& nlm1 = nlm_iat0[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - const std::unordered_map>& nlm2 = nlm_iat0[ad2]; - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - hamilt::BaseMatrix* tmp = this->pre_hr[iat]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - this->cal_HR_IJR(iat1, iat2, nlm1, nlm2, tmp->get_pointer()); - } - } - } - memory_cost += this->pre_hr[iat]->get_memory_size(); - } - ModuleBase::Memory::record("DeltaSpin:pre_HR", memory_cost); - ModuleBase::timer::tick("DeltaSpin", "cal_pre_HR"); -} - -// cal_HR_IJR() -template -void hamilt::DeltaSpin>::cal_HR_IJR(const int& iat1, - const int& iat2, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - TR* data_pointer) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = this->paraV->get_indexes_row(iat1); - auto col_indexes = this->paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol*npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = this->paraV->get_col_size(iat2) * is + is2; - } - } - // calculate the local matrix - const TR* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - TR nlm_tmp = TR(0); - for (int m1 = 0; m1 < nlm1.size(); m1++) - { - nlm_tmp += nlm1[m1] * nlm2[m1]; - } - for (int is = 0; is < npol*npol; ++is) - { - data_pointer[step_trace[is]] += nlm_tmp; - } - data_pointer += npol; - } - data_pointer += (npol - 1) * col_indexes.size(); - } -} - -// cal_moment -template -std::vector hamilt::DeltaSpin>::cal_moment(const HContainer* dmR, const std::vector>& constrain) -{ - const int mag_fold = this->nspin==4?3:1; - std::vector moment(this->ucell->nat * mag_fold, 0.0); - if(dmR == nullptr) - { - return moment; - } - if (!this->initialized) - { - //spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); - //auto& constrain = sc.get_constrain(); - this->cal_constraint_atom_list(constrain); - this->cal_pre_HR(); - this->initialized = true; - } - for(int iat=0;iatucell->nat;iat++) - { - if(!this->constraint_atom_list[iat]) - { - continue; - } - // magnetic moment = \sum_{\mu\nu,R} dmR * pre_hr - for(int iap=0;iappre_hr[iat]->size_atom_pairs();iap++) - { - hamilt::AtomPair& tmp = this->pre_hr[iat]->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - int row_size = tmp.get_row_size(); - int col_size = tmp.get_col_size(); - for(int ir = 0;ir < tmp.get_R_size(); ++ir ) - { - const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); - double* dmr_data = dmR->find_matrix(iat1, iat2, r_index[0], r_index[1], r_index[2])->get_pointer(); - const TR* hr_data = tmp.get_pointer(ir); - this->cal_moment_IJR(dmr_data, hr_data, row_size, col_size, &moment[iat*mag_fold]); - } - } - } -#ifdef __MPI - // sum up the magnetic moments - Parallel_Reduce::reduce_all(moment.data(), moment.size()); -#endif - return moment; -} - -// cal_moment_IJR -template -void hamilt::DeltaSpin>::cal_moment_IJR( - const double* dmR, - const TR* hr, - const int row_size, - const int col_size, - double* moment -) -{ - // collinear spin case - TR tmp_moment = TR(0); - for(int i=0;i -void hamilt::DeltaSpin, std::complex>>::cal_moment_IJR( - const double* dmR, - const std::complex* hr, - const int row_size, - const int col_size, - double* moment -) -{ - const int step_trace[4] = {0, 1, col_size, col_size+1}; - int index = 0; - std::vector> tmp_moment(3, std::complex(0.0, 0.0)); - for(int irow=0;irow>; -template class hamilt::DeltaSpin, double>>; -template class hamilt::DeltaSpin, std::complex>>; \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h deleted file mode 100644 index 71accf34b5..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef DELTA_SPIN_LCAO_H -#define DELTA_SPIN_LCAO_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include - -namespace hamilt -{ - -#ifndef __DELTASPINTEMPLATE -#define __DELTASPINTEMPLATE - -template -class DeltaSpin : public T -{ -}; - -#endif - -template -class DeltaSpin> : public OperatorLCAO -{ - public: - DeltaSpin>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell& ucell_in, - const Grid_Driver* gridD_in, - const TwoCenterIntegrator* intor, - const std::vector& orb_cutoff); - ~DeltaSpin>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * D_{p1, p2} - */ - virtual void contributeHR() override; - - /** - * @brief calculate the magnetization moment for each atom - * @param dmR the density matrix in real space - * @return the magnetization moment for each atom - */ - std::vector cal_moment(const HContainer* dmR, const std::vector>& constrain); - - /** - * @brief set the update_lambda_ to true, which means the lambda will be updated in the next contributeHR() - */ - void update_lambda() - { - for(int is=0;isspin_num;is++) - { - this->update_lambda_[is] = true; - } - } - - /// calculate force and stress for DFT+U - void cal_force_stress(const bool cal_force, - const bool cal_stress, - const HContainer* dmR, - ModuleBase::matrix& force, - ModuleBase::matrix& stress); - - private: - const UnitCell* ucell = nullptr; - - const Grid_Driver* gridD = nullptr; - - const Parallel_Orbitals* paraV = nullptr; - - hamilt::HContainer* HR = nullptr; - - const TwoCenterIntegrator* intor_ = nullptr; - - std::vector orb_cutoff_; - - /// @brief the number of spin components, 1 for no-spin, 2 for collinear spin case and 4 for non-collinear spin case - int nspin = 0; - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - TR* data_pointer); - - /** - * @brief calculate the prepare HR for each atom - * pre_hr^I = \sum_{lm} - */ - void cal_pre_HR(); - - /** - * @brief calculate the constaint atom list - */ - void cal_constraint_atom_list(const std::vector>& constraints); - - /** - * @brief calculate the atomic magnetization moment for each - */ - void cal_moment_IJR(const double* dmR, - const TR* hr, - const int row_size, - const int col_size, - double* moment); - - /** - * @brief calculate the atomic Force of atom pair - */ - void cal_force_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - const ModuleBase::Vector3& lambda, - const int nspin, - double* force1, - double* force2); - /** - * @brief calculate the Stress of atom pair - */ - void cal_stress_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - const ModuleBase::Vector3& lambda, - const int nspin, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress); - - /** - * @brief calculate the array of coefficient of lambda * d\rho^p/drho^{\sigma\sigma'} - */ - void pre_coeff_array(const std::vector& coeff, const int row_size, const int col_size); - - std::vector constraint_atom_list; - std::vector*> pre_hr; - - std::vector tmp_dmr_memory; - std::vector tmp_coeff_array; - std::vector lambda_save; - - bool initialized = false; - int spin_num = 1; - std::vector update_lambda_; -}; - -} - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.cpp deleted file mode 100644 index 4a9e3bc03d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.cpp +++ /dev/null @@ -1,256 +0,0 @@ -#include "ekinetic_new.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" - -// Constructor -template -hamilt::EkineticNew>::EkineticNew( - HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_cutoff_(orb_cutoff), intor_(intor) -{ - this->cal_type = calculation_type::lcao_fixed; - this->ucell = ucell_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); - assert(this->hsk != nullptr); -#endif - // initialize HR to allocate sparse Ekinetic matrix memory - this->initialize_HR(GridD_in); -} - -// destructor -template -hamilt::EkineticNew>::~EkineticNew() -{ - if (this->allocated) - { - delete this->HR_fixed; - } -} - -// initialize_HR() -template -void hamilt::EkineticNew>::initialize_HR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("EkineticNew", "initialize_HR"); - ModuleBase::timer::tick("EkineticNew", "initialize_HR"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1=0; - int I1=0; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + orb_cutoff_[T2]) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index = adjs.box[ad]; - hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); - this->hR->insert_pair(tmp); - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - this->hR->allocate(nullptr, true); - - ModuleBase::timer::tick("EkineticNew", "initialize_HR"); -} - -template -void hamilt::EkineticNew>::calculate_HR() -{ - ModuleBase::TITLE("EkineticNew", "calculate_HR"); - if (this->HR_fixed == nullptr || this->HR_fixed->size_atom_pairs() <= 0) - { - ModuleBase::WARNING_QUIT("hamilt::EkineticNew::calculate_HR", "HR_fixed is nullptr or empty"); - } - ModuleBase::timer::tick("EkineticNew", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1=0; - int I1=0; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_all[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - hamilt::BaseMatrix* tmp = this->HR_fixed->find_matrix(iat1, iat2, R_index2); - if (tmp != nullptr) - { - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer()); - } - else - { - ModuleBase::WARNING_QUIT("hamilt::EkineticNew::calculate_HR", "R_index not found in HR"); - } - } - } - - ModuleBase::timer::tick("EkineticNew", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::EkineticNew>::cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* data_pointer) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, olm); - - for (int ipol = 0; ipol < npol; ipol++) - { - data_pointer[ipol * step_trace] += olm[0]; - } - data_pointer += npol; - } - data_pointer += (npol - 1) * col_indexes.size(); - } -} - -// set_HR_fixed() -template -void hamilt::EkineticNew>::set_HR_fixed(void* HR_fixed_in) -{ - this->HR_fixed = static_cast*>(HR_fixed_in); - this->allocated = false; -} - -// contributeHR() -template -void hamilt::EkineticNew>::contributeHR() -{ - ModuleBase::TITLE("EkineticNew", "contributeHR"); - ModuleBase::timer::tick("EkineticNew", "contributeHR"); - - if (!this->HR_fixed_done) - { - // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr - if (this->HR_fixed == nullptr) - { - this->HR_fixed = new hamilt::HContainer(*this->hR); - this->HR_fixed->set_zero(); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of HR_fixed to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); - } - // calculate the values in HR_fixed - this->calculate_HR(); - this->HR_fixed_done = true; - } - // last node of sub-chain, add HR_fixed into HR - if (this->next_sub_op == nullptr) - { - this->hR->add(*(this->HR_fixed)); - } - - ModuleBase::timer::tick("EkineticNew", "contributeHR"); - return; -} - -template class hamilt::EkineticNew>; -template class hamilt::EkineticNew, double>>; -template class hamilt::EkineticNew, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h deleted file mode 100644 index 4255e4e257..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef EKINETICNEW_H -#define EKINETICNEW_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include - -namespace hamilt -{ - -#ifndef __EKINETICNEWTEMPLATE -#define __EKINETICNEWTEMPLATE - -/// The EkineticNew class template inherits from class T -/// it is used to calculate the electronic kinetic -/// Template parameters: -/// - T: base class, it would be OperatorLCAO or OperatorPW -/// - TR: data type of real space Hamiltonian, it would be double or std::complex -template -class EkineticNew : public T -{ -}; - -#endif - -/// EkineticNew class template specialization for OperatorLCAO base class -/// It is used to calculate the electronic kinetic matrix in real space and fold it to k-space -/// HR = -/// HK = = \sum_{R} e^{ikR} HR -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class EkineticNew> : public OperatorLCAO -{ - public: - /** - * @brief Construct a new EkineticNew object - */ - EkineticNew>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - HContainer* hR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - - /** - * @brief Destroy the EkineticNew object - */ - ~EkineticNew>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * - */ - virtual void contributeHR() override; - - virtual void set_HR_fixed(void*) override; - - private: - const UnitCell* ucell = nullptr; - std::vector orb_cutoff_; - - hamilt::HContainer* HR_fixed = nullptr; - - const TwoCenterIntegrator* intor_ = nullptr; - - bool allocated = false; - - bool HR_fixed_done = false; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the electronic kinetic matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD_in); - - /** - * @brief calculate the electronic kinetic matrix with specific atom-pairs - * use the adjs_all to calculate the HR matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* data_pointer); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.cpp deleted file mode 100644 index 0ac0ca6315..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "meta_lcao.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace hamilt -{ - -template class Meta>; - -template class Meta, double>>; - -template class Meta, std::complex>>; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.h deleted file mode 100644 index 3d05a85396..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/meta_lcao.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef METALCAO_H -#define METALCAO_H -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "operator_lcao.h" - -namespace hamilt -{ - -#ifndef __METATEMPLATE -#define __METATEMPLATE - -template -class Meta : public T -{ -}; - -#endif - -template -class Meta> : public OperatorLCAO -{ - public: - Meta>( - HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - HContainer* hR_in) - : OperatorLCAO(hsk_in, kvec_d_in, hR_in) - { - this->cal_type = calculation_type::lcao_gint; - } - - ~Meta>(){}; - - virtual void contributeHR() override{}//do nothing now - - virtual void contributeHk(int ik) override{};//do nothing now - - private: -}; - -} // namespace hamilt -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_force_stress.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_force_stress.hpp deleted file mode 100644 index 284842ae4d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_force_stress.hpp +++ /dev/null @@ -1,469 +0,0 @@ -#pragma once -#include "nonlocal_new.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" - -namespace hamilt -{ - -template -void NonlocalNew>::cal_force_stress(const bool cal_force, - const bool cal_stress, - const HContainer* dmR, - ModuleBase::matrix& force, - ModuleBase::matrix& stress) -{ - ModuleBase::TITLE("NonlocalNew", "cal_force_stress"); - - // begin the calculation of force and stress - ModuleBase::timer::tick("NonlocalNew", "cal_force_stress"); - - const Parallel_Orbitals* paraV = dmR->get_paraV(); - const int npol = this->ucell->get_npol(); - std::vector stress_tmp(6, 0); - if (cal_force) - { - force.zero_out(); - } - // 1. calculate for each pair of atoms - // loop over all on-site atoms - #pragma omp parallel - { - std::vector stress_local(6, 0); - ModuleBase::matrix force_local(force.nr, force.nc); - #pragma omp for schedule(dynamic) - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - // skip the atoms without plus-U - auto tau0 = ucell->get_tau(iat0); - int I0 = 0; - int T0 = 0; - ucell->iat2iait(iat0, &I0, &T0); - - // first step: find the adjacent atoms and filter the real adjacent atoms - AdjacentAtomInfo adjs; - this->gridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad] = true; - } - } - filter_adjs(is_adj, adjs); - - std::vector>> nlm_iat0(adjs.adj_num + 1); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - int L1 = atom1->iw2l[iw1]; - int N1 = atom1->iw2n[iw1]; - int m1 = atom1->iw2m[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - ModuleBase::Vector3 dtau = tau0 - tau1; - intor_->snap(T1, L1, N1, M1, T0, dtau * this->ucell->lat0, true /*cal_deri*/, nlm); - // select the elements of nlm with target_L - const int length = nlm[0].size(); - std::vector nlm_target(length * 4); - // rearrange the nlm_target to store the gradient - for(int index =0;index < length; index++) - { - for (int n = 0; n < 4; n++) // value, deri_x, deri_y, deri_z - { - nlm_target[index + n * length] = nlm[n][index]; - } - } - nlm_iat0[ad].insert({all_indexes[iw1l], nlm_target}); - } - } - - // second iteration to calculate force and stress - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - double* force_tmp1 = (cal_force) ? &force_local(iat1, 0) : nullptr; - double* force_tmp2 = (cal_force) ? &force_local(iat0, 0) : nullptr; - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - ModuleBase::Vector3 dis1 = adjs.adjacent_tau[ad1] - tau0; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 dis2 = adjs.adjacent_tau[ad2] - tau0; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - const hamilt::BaseMatrix* tmp = dmR->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - int row_size = paraV->get_row_size(); - int col_size = paraV->get_col_size(); - if(row_size == 0 || col_size == 0) - { - continue; - } - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - // calculate force - if (cal_force) { - this->cal_force_IJR(iat1, - iat2, - T0, - paraV, - nlm_iat0[ad1], - nlm_iat0[ad2], - tmp, - force_tmp1, - force_tmp2); - } - - // calculate stress - if (cal_stress) { - this->cal_stress_IJR(iat1, - iat2, - T0, - paraV, - nlm_iat0[ad1], - nlm_iat0[ad2], - tmp, - dis1, - dis2, - stress_local.data()); - } - } - } - } - } - #pragma omp critical - { - if(cal_force) - { - force += force_local; - } - if(cal_stress) - { - for(int i = 0; i < 6; i++) - { - stress_tmp[i] += stress_local[i]; - } - } - - } - } - - if (cal_force) - { -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(force.c, force.nr * force.nc); -#endif - for (int i = 0; i < force.nr * force.nc; i++) - { - force.c[i] *= 2.0; - } - } - - // stress renormalization - if (cal_stress) - { -#ifdef __MPI - // sum up the occupation matrix - Parallel_Reduce::reduce_all(stress_tmp.data(), 6); -#endif - const double weight = this->ucell->lat0 / this->ucell->omega; - for (int i = 0; i < 6; i++) - { - stress.c[i] = stress_tmp[i] * weight; - } - stress.c[8] = stress.c[5]; // stress(2,2) - stress.c[7] = stress.c[4]; // stress(2,1) - stress.c[6] = stress.c[2]; // stress(2,0) - stress.c[5] = stress.c[4]; // stress(1,2) - stress.c[4] = stress.c[3]; // stress(1,1) - stress.c[3] = stress.c[1]; // stress(1,0) - } - - ModuleBase::timer::tick("NonlocalNew", "cal_force_stress"); -} - -template <> -void NonlocalNew, std::complex>>::cal_force_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix>* dmR_pointer, - double* force1, - double* force2) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - if (npol == 2) { - step_trace[1] = 1; - step_trace[2] = col_indexes.size(); - step_trace[3] = col_indexes.size() + 1; - } - // calculate the local matrix - const std::complex* tmp_d = nullptr; - const std::complex* dm_pointer = dmR_pointer->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - const int length = nlm1.size() / 4; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - std::vector> nlm_tmp(12, ModuleBase::ZERO); - for (int is = 0; is < 4; ++is) - { - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - nlm_tmp[is*3] += nlm1[p1 + length] * nlm2[p2] * (*tmp_d); - nlm_tmp[is*3+1] += nlm1[p1 + length * 2] * nlm2[p2] * (*tmp_d); - nlm_tmp[is*3+2] += nlm1[p1 + length * 3] * nlm2[p2] * (*tmp_d); - } - } - // calculate the force, transfer nlm_tmp to pauli matrix - for(int i = 0; i < 3; i++) - { - double tmp = (dm_pointer[step_trace[0]] * nlm_tmp[i] - + dm_pointer[step_trace[1]] * nlm_tmp[i+3] - + dm_pointer[step_trace[2]] * nlm_tmp[i+6] - + dm_pointer[step_trace[3]] * nlm_tmp[i+9]).real(); - force1[i] += tmp; - force2[i] -= tmp; - } - dm_pointer += npol; - } - dm_pointer += (npol - 1) * col_indexes.size(); - } -} - -template <> -void NonlocalNew, std::complex>>::cal_stress_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix>* dmR_pointer, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - const int npol2 = npol * npol; - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol2, 0); - if (npol == 2) { - step_trace[1] = 1; - step_trace[2] = col_indexes.size(); - step_trace[3] = col_indexes.size() + 1; - } - // calculate the local matrix - const std::complex* tmp_d = nullptr; - const std::complex* dm_pointer = dmR_pointer->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - const int length = nlm1.size() / npol2; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - std::vector> nlm_tmp(npol2 * 6, ModuleBase::ZERO); - for (int is = 0; is < 4; ++is) - { - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - nlm_tmp[is*6] += (nlm1[p1 + length] * dis1.x * nlm2[p2] + nlm1[p1] * nlm2[p2 + length] * dis2.x) * (*tmp_d); - nlm_tmp[is*6+1] += (nlm1[p1 + length] * dis1.y * nlm2[p2] + nlm1[p1] * nlm2[p2 + length] * dis2.y) * (*tmp_d); - nlm_tmp[is*6+2] += (nlm1[p1 + length] * dis1.z * nlm2[p2] + nlm1[p1] * nlm2[p2 + length] * dis2.z) * (*tmp_d); - nlm_tmp[is*6+3] += (nlm1[p1 + length * 2] * dis1.y * nlm2[p2] + nlm1[p1] * nlm2[p2 + length * 2] * dis2.y) * (*tmp_d); - nlm_tmp[is*6+4] += (nlm1[p1 + length * 2] * dis1.z * nlm2[p2] + nlm1[p1] * nlm2[p2 + length * 2] * dis2.z) * (*tmp_d); - nlm_tmp[is*6+5] += (nlm1[p1 + length * 3] * dis1.z * nlm2[p2] + nlm1[p1] * nlm2[p2 + length * 3] * dis2.z) * (*tmp_d); - } - } - // calculate the force, transfer nlm_tmp to pauli matrix - for(int i = 0; i < 6; i++) - { - stress[i] += (dm_pointer[step_trace[0]] * nlm_tmp[i] - + dm_pointer[step_trace[1]] * nlm_tmp[i+6] - + dm_pointer[step_trace[2]] * nlm_tmp[i+12] - + dm_pointer[step_trace[3]] * nlm_tmp[i+18]).real(); - } - dm_pointer += npol; - } - dm_pointer += (npol - 1) * col_indexes.size(); - } -} - -template -void NonlocalNew>::cal_force_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - double* force1, - double* force2) -{ - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // calculate the local matrix - const double* tmp_d = nullptr; - const double* dm_pointer = dmR_pointer->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l++) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - const int length = nlm1.size() / 4; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l++) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - std::vector nlm_tmp(3, 0.0); - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[0]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[0][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[0][no]; - this->ucell->atoms[T0].ncpp.get_d(0, p1, p2, tmp_d); - nlm_tmp[0] += nlm1[p1 + length] * nlm2[p2] * (*tmp_d); - nlm_tmp[1] += nlm1[p1 + length * 2] * nlm2[p2] * (*tmp_d); - nlm_tmp[2] += nlm1[p1 + length * 3] * nlm2[p2] * (*tmp_d); - } - // calculate the force, transfer nlm_tmp to pauli matrix - for(int i = 0; i < 3; i++) - { - force1[i] += dm_pointer[0] * nlm_tmp[i]; - force2[i] -= dm_pointer[0] * nlm_tmp[i]; - } - dm_pointer++; - } - } -} - -template -void NonlocalNew>::cal_stress_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress) -{ - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // calculate the local matrix - const double* tmp_d = nullptr; - const double* dm_pointer = dmR_pointer->get_pointer(); - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l++) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - const int length = nlm1.size() / 4; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l++) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - std::vector nlm_tmp(6, 0.0); - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[0]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[0][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[0][no]; - this->ucell->atoms[T0].ncpp.get_d(0, p1, p2, tmp_d); - nlm_tmp[0] += (nlm1[p1 + length] * dis1.x * nlm2[p2] + nlm1[p1] * nlm2[p2 + length] * dis2.x) * (*tmp_d); - nlm_tmp[1] += (nlm1[p1 + length] * dis1.y * nlm2[p2] + nlm1[p1] * nlm2[p2 + length] * dis2.y) * (*tmp_d); - nlm_tmp[2] += (nlm1[p1 + length] * dis1.z * nlm2[p2] + nlm1[p1] * nlm2[p2 + length] * dis2.z) * (*tmp_d); - nlm_tmp[3] += (nlm1[p1 + length * 2] * dis1.y * nlm2[p2] + nlm1[p1] * nlm2[p2 + length * 2] * dis2.y) * (*tmp_d); - nlm_tmp[4] += (nlm1[p1 + length * 2] * dis1.z * nlm2[p2] + nlm1[p1] * nlm2[p2 + length * 2] * dis2.z) * (*tmp_d); - nlm_tmp[5] += (nlm1[p1 + length * 3] * dis1.z * nlm2[p2] + nlm1[p1] * nlm2[p2 + length * 3] * dis2.z) * (*tmp_d); - } - // calculate the force, transfer nlm_tmp to pauli matrix - for(int i = 0; i < 6; i++) - { - stress[i] += dm_pointer[0] * nlm_tmp[i]; - } - dm_pointer++; - } - } -} - -} // namespace hamilt diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.cpp deleted file mode 100644 index 899c8376db..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.cpp +++ /dev/null @@ -1,330 +0,0 @@ -#include "nonlocal_new.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#ifdef _OPENMP -#include -#endif - -template -hamilt::NonlocalNew>::NonlocalNew( - HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_cutoff_(orb_cutoff), intor_(intor) -{ - this->cal_type = calculation_type::lcao_fixed; - this->ucell = ucell_in; - this->gridD = GridD_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); -#endif - // initialize HR to allocate sparse Nonlocal matrix memory - if(hR_in != nullptr) - { - this->initialize_HR(GridD_in); - } -} - -// destructor -template -hamilt::NonlocalNew>::~NonlocalNew() -{ - if (this->allocated) - { - delete this->HR_fixed; - } -} - -// initialize_HR() -template -void hamilt::NonlocalNew>::initialize_HR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("NonlocalNew", "initialize_HR"); - ModuleBase::timer::tick("NonlocalNew", "initialize_HR"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) - { - continue; - } - hamilt::AtomPair tmp(iat1, - iat2, - R_index2.x - R_index1.x, - R_index2.y - R_index1.y, - R_index2.z - R_index1.z, - paraV); - this->hR->insert_pair(tmp); - } - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - this->hR->allocate(nullptr, true); - - ModuleBase::timer::tick("NonlocalNew", "initialize_HR"); -} - -template -void hamilt::NonlocalNew>::calculate_HR() -{ - ModuleBase::TITLE("NonlocalNew", "calculate_HR"); - ModuleBase::timer::tick("NonlocalNew", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - // 1. calculate for each pair of atoms -#ifdef _OPENMP -#pragma omp parallel - { - std::unordered_set atom_row_list; -#pragma omp for - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - atom_row_list.insert(iat0); - } -#endif - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo& adjs = this->adjs_all[iat0]; - - std::vector>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - - auto all_indexes = paraV->get_indexes_row(iat1); -#ifdef _OPENMP - if (atom_row_list.find(iat1) == atom_row_list.end()) - { - all_indexes.clear(); - } -#endif - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 here - // If we are calculating force, we need also to store the gradient - // and size of outer vector is then 4 - // inner loop : all projectors (L0,M0) - int L1 = atom1->iw2l[iw1]; - int N1 = atom1->iw2n[iw1]; - int m1 = atom1->iw2m[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - ModuleBase::Vector3 dtau = tau0 - tau1; - intor_->snap(T1, L1, N1, M1, T0, dtau * this->ucell->lat0, false /*cal_deri*/, nlm); - nlm_tot[ad].insert({all_indexes[iw1l], nlm[0]}); - } - } - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); -#ifdef _OPENMP - if (atom_row_list.find(iat1) == atom_row_list.end()) - { - continue; - } -#endif - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - hamilt::BaseMatrix* tmp - = this->HR_fixed->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - this->cal_HR_IJR(iat1, iat2, T0, paraV, nlm_tot[ad1], nlm_tot[ad2], tmp->get_pointer()); - } - } - } - } -#ifdef _OPENMP - } -#endif - - ModuleBase::timer::tick("NonlocalNew", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::NonlocalNew>::cal_HR_IJR( - const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - TR* data_pointer) -{ - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = col_indexes.size() * is + is2; - } - } - // calculate the local matrix - const TR* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const std::vector& nlm1 = nlm1_all.find(row_indexes[iw1l])->second; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const std::vector& nlm2 = nlm2_all.find(col_indexes[iw2l])->second; -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - TR nlm_tmp = TR(0); - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - nlm_tmp += nlm1[p1] * nlm2[p2] * (*tmp_d); - } - data_pointer[step_trace[is]] += nlm_tmp; - } - data_pointer += npol; - } - data_pointer += (npol - 1) * col_indexes.size(); - } -} - -// set_HR_fixed() -template -void hamilt::NonlocalNew>::set_HR_fixed(void* HR_fixed_in) -{ - this->HR_fixed = static_cast*>(HR_fixed_in); - this->allocated = false; -} - -// contributeHR() -template -void hamilt::NonlocalNew>::contributeHR() -{ - ModuleBase::TITLE("NonlocalNew", "contributeHR"); - ModuleBase::timer::tick("NonlocalNew", "contributeHR"); - if (!this->HR_fixed_done) - { - // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr - if (this->HR_fixed == nullptr) - { - this->HR_fixed = new hamilt::HContainer(*this->hR); - this->HR_fixed->set_zero(); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of HR_fixed to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); - } - // calculate the values in HR_fixed - this->calculate_HR(); - this->HR_fixed_done = true; - } - // last node of sub-chain, add HR_fixed into HR - if (this->next_sub_op == nullptr) - { - this->hR->add(*(this->HR_fixed)); - } - ModuleBase::timer::tick("NonlocalNew", "contributeHR"); - return; -} - -#include "nonlocal_force_stress.hpp" - -template class hamilt::NonlocalNew>; -template class hamilt::NonlocalNew, double>>; -template class hamilt::NonlocalNew, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h deleted file mode 100644 index 5161958e78..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h +++ /dev/null @@ -1,136 +0,0 @@ -#ifndef NONLOCALNEW_H -#define NONLOCALNEW_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace hamilt -{ - -#ifndef __NONLOCALNEWTEMPLATE -#define __NONLOCALNEWTEMPLATE - -/// The NonlocalNew class template inherits from class T -/// it is used to calculate the non-local pseudopotential of wavefunction basis -/// Template parameters: -/// - T: base class, it would be OperatorLCAO or OperatorPW -/// - TR: data type of real space Hamiltonian, it would be double or std::complex -template -class NonlocalNew : public T -{ -}; - -#endif - -/// NonlocalNew class template specialization for OperatorLCAO base class -/// It is used to calculate the non-local pseudopotential matrix in real space and fold it to k-space -/// HR = D_{p1, p2} -/// HK = D_{p1, p2} = \sum_{R} e^{ikR} HR -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class NonlocalNew> : public OperatorLCAO -{ - public: - NonlocalNew>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - ~NonlocalNew>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * D_{p1, p2} - */ - virtual void contributeHR() override; - - void cal_force_stress(const bool cal_force, - const bool cal_stress, - const HContainer* dmR, - ModuleBase::matrix& force, - ModuleBase::matrix& stress); - - virtual void set_HR_fixed(void*) override; - - private: - const UnitCell* ucell = nullptr; - - std::vector orb_cutoff_; - - hamilt::HContainer* HR_fixed = nullptr; - - // the following variable is introduced temporarily during LCAO refactoring - const TwoCenterIntegrator* intor_ = nullptr; - - bool allocated = false; - - bool HR_fixed_done = false; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD_in); - - /** - * @brief calculate the non-local pseudopotential matrix with specific atom-pairs - * nearest neighbor atoms don't need to be calculated again - * loop the atom-pairs in HR and calculate the non-local pseudopotential matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - TR* data_pointer); - - const Grid_Driver* gridD = nullptr; - - /** - * @brief calculate the atomic Force of atom pair - */ - void cal_force_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - double* force1, - double* force2); - /** - * @brief calculate the Stress of atom pair - */ - void cal_stress_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::unordered_map>& nlm1_all, - const std::unordered_map>& nlm2_all, - const hamilt::BaseMatrix* dmR_pointer, - const ModuleBase::Vector3& dis1, - const ModuleBase::Vector3& dis2, - double* stress); - - std::vector adjs_all; -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.cpp deleted file mode 100644 index e615256e1a..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "op_dftu_lcao.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace hamilt -{ - -template class OperatorDFTU>; - -template class OperatorDFTU, double>>; - -template class OperatorDFTU, std::complex>>; - -template -void OperatorDFTU>::contributeHR() -{ - //no calculation of HR yet for DFTU operator - return; -} - -template<> -void OperatorDFTU>::contributeHk(int ik) -{ - ModuleBase::TITLE("OperatorDFTU", "contributeHk"); - ModuleBase::timer::tick("OperatorDFTU", "contributeHk"); - // Effective potential of DFT+U is added to total Hamiltonian here; Quxin adds on 20201029 - std::vector eff_pot(this->hsk->get_pv()->nloc); - GlobalC::dftu.cal_eff_pot_mat_real(ik, &eff_pot[0], isk, this->hsk->get_sk()); - double* hk = this->hsk->get_hk(); - - for (int irc = 0; irc < this->hsk->get_pv()->nloc; irc++) - { - hk[irc] += eff_pot[irc]; - } - - ModuleBase::timer::tick("OperatorDFTU", "contributeHk"); -} - -template<> -void OperatorDFTU, double>>::contributeHk(int ik) -{ - ModuleBase::TITLE("OperatorDFTU", "contributeHk"); - ModuleBase::timer::tick("OperatorDFTU", "contributeHk"); - // Effective potential of DFT+U is added to total Hamiltonian here; Quxin adds on 20201029 - std::vector> eff_pot(this->hsk->get_pv()->nloc); - GlobalC::dftu.cal_eff_pot_mat_complex(ik, &eff_pot[0], isk, this->hsk->get_sk()); - std::complex* hk = this->hsk->get_hk(); - - for (int irc = 0; irc < this->hsk->get_pv()->nloc; irc++) - { - hk[irc] += eff_pot[irc]; - } - - ModuleBase::timer::tick("OperatorDFTU", "contributeHk"); -} - -template<> -void OperatorDFTU, std::complex>>::contributeHk(int ik) -{ - ModuleBase::TITLE("OperatorDFTU", "contributeHk"); - ModuleBase::timer::tick("OperatorDFTU", "contributeHk"); - // Effective potential of DFT+U is added to total Hamiltonian here; Quxin adds on 20201029 - std::vector> eff_pot(this->hsk->get_pv()->nloc); - GlobalC::dftu.cal_eff_pot_mat_complex(ik, &eff_pot[0], isk, this->hsk->get_sk()); - - std::complex* hk = this->hsk->get_hk(); - for (int irc = 0; irc < this->hsk->get_pv()->nloc; irc++) - { - hk[irc] += eff_pot[irc]; - } - - ModuleBase::timer::tick("OperatorDFTU", "contributeHk"); -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.h deleted file mode 100644 index e15f4ae9dd..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef OPDFTULCAO_H -#define OPDFTULCAO_H -#include "source_base/timer.h" -#include "operator_lcao.h" - -namespace hamilt -{ - -#ifndef __OPDFTUTEMPLATE -#define __OPDFTUTEMPLATE - -template -class OperatorDFTU : public T -{ -}; - -#endif - -template -class OperatorDFTU> : public OperatorLCAO -{ - public: - OperatorDFTU>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const std::vector& isk_in) - : isk(isk_in), OperatorLCAO(hsk_in, kvec_d_in, hR_in) - { - this->cal_type = calculation_type::lcao_dftu; - } - - virtual void contributeHR() override; - - virtual void contributeHk(int ik) override; - - private: - - bool HR_fixed_done = false; - - const std::vector& isk; -}; -} // namespace hamilt -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.cpp deleted file mode 100644 index aab8a9b822..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#ifdef __EXX -#include "op_exx_lcao.h" -#include "source_base/blacs_connector.h" - -namespace hamilt -{ - RI::Cell_Nearest init_cell_nearest(const UnitCell& ucell, const std::array& Rs_period) - { - RI::Cell_Nearest cell_nearest; - std::map> atoms_pos; - for (int iat = 0; iat < ucell.nat; ++iat) { - atoms_pos[iat] = RI_Util::Vector3_to_array3( - ucell.atoms[ucell.iat2it[iat]] - .tau[ucell.iat2ia[iat]]); - } - const std::array, 3> latvec - = { RI_Util::Vector3_to_array3(ucell.a1), - RI_Util::Vector3_to_array3(ucell.a2), - RI_Util::Vector3_to_array3(ucell.a3) }; - cell_nearest.init(atoms_pos, latvec, Rs_period); - return cell_nearest; - } - -template<> -void OperatorEXX>::add_loaded_Hexx(const int ik) -{ - BlasConnector::axpy(this->hR->get_paraV()->get_local_size(), 1.0, this->Hexxd_k_load[ik].data(), 1, this->hsk->get_hk(), 1); -} -template<> -void OperatorEXX, double>>::add_loaded_Hexx(const int ik) -{ - BlasConnector::axpy(this->hR->get_paraV()->get_local_size(), 1.0, this->Hexxc_k_load[ik].data(), 1, this->hsk->get_hk(), 1); -} -template<> -void OperatorEXX, std::complex>>::add_loaded_Hexx(const int ik) -{ - BlasConnector::axpy(this->hR->get_paraV()->get_local_size(), 1.0, this->Hexxc_k_load[ik].data(), 1, this->hsk->get_hk(), 1); -} - -} // namespace hamilt -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h deleted file mode 100644 index 628cfb4a1a..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef OPEXXLCAO_H -#define OPEXXLCAO_H - -#ifdef __EXX - -#include -#include -#include "operator_lcao.h" -#include "source_cell/klist.h" - -namespace hamilt -{ - -#ifndef __OPEXXTEMPLATE -#define __OPEXXTEMPLATE - -template -class OperatorEXX : public T -{ -}; - -#endif -enum Add_Hexx_Type { R, k }; -template -class OperatorEXX> : public OperatorLCAO -{ - using TAC = std::pair>; -public: - OperatorEXX>(HS_Matrix_K* hsk_in, - hamilt::HContainer* hR_in, - const UnitCell& ucell, - const K_Vectors& kv_in, - std::vector>>>* Hexxd_in = nullptr, - std::vector>>>>* Hexxc_in = nullptr, - Add_Hexx_Type add_hexx_type_in = Add_Hexx_Type::R, - const int istep_in = 0, - int* two_level_step_in = nullptr, - const bool restart_in = false); - - virtual void contributeHk(int ik) override; - virtual void contributeHR() override; - - private: - Add_Hexx_Type add_hexx_type = Add_Hexx_Type::R; - int current_spin = 0; - bool HR_fixed_done = false; - - std::vector>>>* Hexxd = nullptr; - std::vector>>>>* Hexxc = nullptr; - - /// @brief the step of the outer loop. - /// nullptr: no dependence on the number of two_level_step, contributeHk will do enerything normally. - /// 0: the first outer loop. If restart, contributeHk will directly add Hexx to Hloc. else, do nothing. - /// >0: not the first outer loop. contributeHk will do enerything normally. - int* two_level_step = nullptr; - /// @brief if restart, read and save Hexx, and directly use it during the first outer loop. - bool restart = false; - - const int istep = 0; // the ion step - - void add_loaded_Hexx(const int ik); - - const UnitCell& ucell; - - const K_Vectors& kv; - - // if k points has no shift, use cell_nearest to reduce the memory cost - RI::Cell_Nearest cell_nearest; - bool use_cell_nearest = true; - - /// @brief Hexxk for all k-points, only for the 1st scf loop ofrestart load - std::vector> Hexxd_k_load; - std::vector>> Hexxc_k_load; -}; - -using TAC = std::pair>; - -RI::Cell_Nearest init_cell_nearest(const UnitCell& ucell, const std::array& Rs_period); - -// allocate according to the read-in HexxR, used in nscf -template -void reallocate_hcontainer(const std::vector>>>& Hexxs, - HContainer* hR, - const RI::Cell_Nearest* const cell_nearest = nullptr); - -/// allocate according to BvK cells, used in scf -template -void reallocate_hcontainer(const int nat, HContainer* hR, - const std::array& Rs_period, - const RI::Cell_Nearest* const cell_nearest = nullptr); - -} // namespace hamilt -#endif // __EXX -#include "op_exx_lcao.hpp" -#endif // OPEXXLCAO_H \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp deleted file mode 100644 index 9d87f06b32..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp +++ /dev/null @@ -1,397 +0,0 @@ -#ifndef OPEXXLCAO_HPP -#define OPEXXLCAO_HPP -#ifdef __EXX - -#include "op_exx_lcao.h" -#include "module_parameter/parameter.h" -#include "module_ri/RI_2D_Comm.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "module_io/restart_exx_csr.h" - -namespace hamilt -{ - using TAC = std::pair>; - - // allocate according to the read-in HexxR, used in nscf - template - void reallocate_hcontainer(const std::vector>>>& Hexxs, - HContainer* hR, - const RI::Cell_Nearest* const cell_nearest) - { - auto* pv = hR->get_paraV(); - bool need_allocate = false; - for (auto& Htmp1 : Hexxs[0]) - { - const int& iat0 = Htmp1.first; - for (auto& Htmp2 : Htmp1.second) - { - const int& iat1 = Htmp2.first.first; - if (pv->get_row_size(iat0) > 0 && pv->get_col_size(iat1) > 0) - { - const Abfs::Vector3_Order& R = RI_Util::array3_to_Vector3( - (cell_nearest ? - cell_nearest->get_cell_nearest_discrete(iat0, iat1, Htmp2.first.second) - : Htmp2.first.second)); - BaseMatrix* HlocR = hR->find_matrix(iat0, iat1, R.x, R.y, R.z); - if (HlocR == nullptr) - { // add R to HContainer - need_allocate = true; - AtomPair tmp(iat0, iat1, R.x, R.y, R.z, pv); - hR->insert_pair(tmp); - } - } - } - } - if (need_allocate) { hR->allocate(nullptr, true); } - } - - /// allocate according to BvK cells, used in scf - template - void reallocate_hcontainer(const int nat, HContainer* hR, - const std::array& Rs_period, - const RI::Cell_Nearest* const cell_nearest) - { - auto* pv = hR->get_paraV(); - auto Rs = RI_Util::get_Born_von_Karmen_cells(Rs_period); - bool need_allocate = false; - for (int iat0 = 0;iat0 < nat;++iat0) - { - for (int iat1 = 0;iat1 < nat;++iat1) - { - // complete the atom pairs that has orbitals in this processor but not in hR due to the adj_list - // but adj_list is not enought for EXX, which is more nonlocal than Nonlocal - if(pv->get_row_size(iat0) > 0 && pv->get_col_size(iat1) > 0) - { - for (auto& cell : Rs) - { - const Abfs::Vector3_Order& R = RI_Util::array3_to_Vector3( - (cell_nearest ? - cell_nearest->get_cell_nearest_discrete(iat0, iat1, cell) - : cell)); - BaseMatrix* HlocR = hR->find_matrix(iat0, iat1, R.x, R.y, R.z); - - if (HlocR == nullptr) - { // add R to HContainer - need_allocate = true; - AtomPair tmp(iat0, iat1, R.x, R.y, R.z, pv); - hR->insert_pair(tmp); - } - } - } - } - } - if (need_allocate) { hR->allocate(nullptr, true);} - } - -template -OperatorEXX>::OperatorEXX(HS_Matrix_K* hsk_in, - HContainer*hR_in, - const UnitCell& ucell_in, - const K_Vectors& kv_in, - std::vector>>>* Hexxd_in, - std::vector>>>>* Hexxc_in, - Add_Hexx_Type add_hexx_type_in, - const int istep, - int* two_level_step_in, - const bool restart_in) - : OperatorLCAO(hsk_in, kv_in.kvec_d, hR_in), - ucell(ucell_in), - kv(kv_in), - Hexxd(Hexxd_in), - Hexxc(Hexxc_in), - add_hexx_type(add_hexx_type_in), - istep(istep), - two_level_step(two_level_step_in), - restart(restart_in) -{ - ModuleBase::TITLE("OperatorEXX", "OperatorEXX"); - this->cal_type = calculation_type::lcao_exx; - const Parallel_Orbitals* const pv = hR_in->get_paraV(); - - if (PARAM.inp.calculation == "nscf" && GlobalC::exx_info.info_global.cal_exx) - { // if nscf, read HexxR first and reallocate hR according to the read-in HexxR - auto file_name_list_csr = []() -> std::vector - { - std::vector file_name_list; - for (int irank=0; irank std::vector - { - std::vector file_name_list; - for (int irank=0; irank &file_name_list) -> bool - { - for (const std::string &file_name : file_name_list) - { - std::ifstream ifs(file_name); - if (!ifs.is_open()) - { return false; } - } - return true; - }; - - std::cout<<" Attention: The number of MPI processes must be strictly identical between SCF and NSCF when computing exact-exchange."<add_hexx_type == Add_Hexx_Type::R) - { reallocate_hcontainer(*Hexxd, this->hR); } - } - else - { - ModuleIO::read_Hexxs_csr(file_name_exx_csr, ucell, PARAM.inp.nspin, PARAM.globalv.nlocal, *Hexxc); - if (this->add_hexx_type == Add_Hexx_Type::R) - { reallocate_hcontainer(*Hexxc, this->hR); } - } - } - else if (check_exist(file_name_list_cereal())) - { - // Read HexxR in binary format (old version) - const std::string file_name_exx_cereal = PARAM.globalv.global_readin_dir + "HexxR_" + std::to_string(PARAM.globalv.myrank); - std::ifstream ifs(file_name_exx_cereal, std::ios::binary); - if (!ifs) - { ModuleBase::WARNING_QUIT("OperatorEXX", "Can't open EXX file < " + file_name_exx_cereal + " >."); } - if (GlobalC::exx_info.info_ri.real_number) - { - ModuleIO::read_Hexxs_cereal(file_name_exx_cereal, *Hexxd); - if (this->add_hexx_type == Add_Hexx_Type::R) - { reallocate_hcontainer(*Hexxd, this->hR); } - } - else - { - ModuleIO::read_Hexxs_cereal(file_name_exx_cereal, *Hexxc); - if (this->add_hexx_type == Add_Hexx_Type::R) - { reallocate_hcontainer(*Hexxc, this->hR); } - } - } - else - { - ModuleBase::WARNING_QUIT("OperatorEXX", "Can't open EXX file in " + PARAM.globalv.global_readin_dir); - } - this->use_cell_nearest = false; - } - else - { // if scf and Add_Hexx_Type::R, init cell_nearest and reallocate hR according to BvK cells - if (this->add_hexx_type == Add_Hexx_Type::R) - { - // if k points has no shift, use cell_nearest to reduce the memory cost - this->use_cell_nearest = (ModuleBase::Vector3(std::fmod(this->kv.get_koffset(0), 1.0), - std::fmod(this->kv.get_koffset(1), 1.0), std::fmod(this->kv.get_koffset(2), 1.0)).norm() < 1e-10); - - const std::array Rs_period = { this->kv.nmp[0], this->kv.nmp[1], this->kv.nmp[2] }; - if (this->use_cell_nearest) - { - this->cell_nearest = init_cell_nearest(ucell, Rs_period); - reallocate_hcontainer(ucell.nat, this->hR, Rs_period, &this->cell_nearest); - } - else { reallocate_hcontainer(ucell.nat, this->hR, Rs_period); } - } - - if (this->restart) - {/// Now only Hexx depends on DM, so we can directly read Hexx to reduce the computational cost. - /// If other operators depends on DM, we can also read DM and then calculate the operators to save the memory to store operator terms. - assert(this->two_level_step != nullptr); - - if (this->add_hexx_type == Add_Hexx_Type::k) - { - /// read in Hexx(k) - if (std::is_same::value) - { - this->Hexxd_k_load.resize(this->kv.get_nks()); - for (int ik = 0; ik < this->kv.get_nks(); ik++) - { - this->Hexxd_k_load[ik].resize(pv->get_local_size(), 0.0); - this->restart = GlobalC::restart.load_disk( - "Hexx", ik, - pv->get_local_size(), this->Hexxd_k_load[ik].data(), false); - if (!this->restart) { break; } - } - } - else - { - this->Hexxc_k_load.resize(this->kv.get_nks()); - for (int ik = 0; ik < this->kv.get_nks(); ik++) - { - this->Hexxc_k_load[ik].resize(pv->get_local_size(), 0.0); - this->restart = GlobalC::restart.load_disk( - "Hexx", ik, - pv->get_local_size(), this->Hexxc_k_load[ik].data(), false); - if (!this->restart) { break; } - } - } - } - else if (this->add_hexx_type == Add_Hexx_Type::R) - { - // read in Hexx(R) - const std::string restart_HR_path = GlobalC::restart.folder + "HexxR" + std::to_string(PARAM.globalv.myrank); - int all_exist = 1; - for (int is = 0; is < PARAM.inp.nspin; ++is) - { - std::ifstream ifs(restart_HR_path + "_" + std::to_string(is) + ".csr"); - if (!ifs) { all_exist = 0; break; } - } -// Add MPI communication to synchronize all_exist across processes -#ifdef __MPI - // don't read in any files if one of the processes doesn't have it - MPI_Allreduce(MPI_IN_PLACE, &all_exist, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); -#endif - if (all_exist) - { - // Read HexxR in CSR format - if (GlobalC::exx_info.info_ri.real_number) { - ModuleIO::read_Hexxs_csr(restart_HR_path, ucell, PARAM.inp.nspin, PARAM.globalv.nlocal, *Hexxd); - } - else { - ModuleIO::read_Hexxs_csr(restart_HR_path, ucell, PARAM.inp.nspin, PARAM.globalv.nlocal, *Hexxc); - } - } - else - { - // Read HexxR in binary format (old version) - const std::string restart_HR_path_cereal = GlobalC::restart.folder + "HexxR_" + std::to_string(PARAM.globalv.myrank); - std::ifstream ifs(restart_HR_path_cereal, std::ios::binary); - int all_exist_cereal = ifs ? 1 : 0; -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, &all_exist_cereal, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); -#endif - if (!all_exist_cereal) - { - //no HexxR file in CSR or binary format - this->restart = false; - } - else - { - if (GlobalC::exx_info.info_ri.real_number) { - ModuleIO::read_Hexxs_cereal(restart_HR_path_cereal, *Hexxd); - } - else { - ModuleIO::read_Hexxs_cereal(restart_HR_path_cereal, *Hexxc); - } - } - } - } - - if (!this->restart) { - std::cout << "WARNING: Hexx not found, restart from the non-exx loop." << std::endl - << "If the loaded charge density is EXX-solved, this may lead to poor convergence." << std::endl; - } - GlobalC::restart.info_load.load_H_finish = this->restart; - } - } -} - -template -void OperatorEXX>::contributeHR() -{ - ModuleBase::TITLE("OperatorEXX", "contributeHR"); - // Peize Lin add 2016-12-03 - if (this->istep == 0 - && PARAM.inp.calculation != "nscf" - && this->two_level_step != nullptr && *this->two_level_step == 0 - && PARAM.inp.init_wfc != "file" - && !this->restart) - { - return; - } //in the non-exx loop, do nothing - if (this->add_hexx_type == Add_Hexx_Type::k) { return; } - - if (XC_Functional::get_func_type() == 4 || XC_Functional::get_func_type() == 5) - { - // add H(R) normally - if (GlobalC::exx_info.info_ri.real_number) - { - RI_2D_Comm::add_HexxR( - this->current_spin, - GlobalC::exx_info.info_global.hybrid_alpha, - *this->Hexxd, - *this->hR->get_paraV(), - PARAM.globalv.npol, - *this->hR, - this->use_cell_nearest ? &this->cell_nearest : nullptr); - } - else - { - RI_2D_Comm::add_HexxR( - this->current_spin, - GlobalC::exx_info.info_global.hybrid_alpha, - *this->Hexxc, - *this->hR->get_paraV(), - PARAM.globalv.npol, - *this->hR, - this->use_cell_nearest ? &this->cell_nearest : nullptr); - } - } - if (PARAM.inp.nspin == 2) { this->current_spin = 1 - this->current_spin; } -} - -template -void OperatorEXX>::contributeHk(int ik) -{ - ModuleBase::TITLE("OperatorEXX", "constributeHR"); - // Peize Lin add 2016-12-03 - if (PARAM.inp.calculation != "nscf" && this->two_level_step != nullptr && *this->two_level_step == 0 && !this->restart) { return; } //in the non-exx loop, do nothing - - if (this->add_hexx_type == Add_Hexx_Type::R) { throw std::invalid_argument("Set Add_Hexx_Type::k sto call OperatorEXX::contributeHk()."); } - - if (XC_Functional::get_func_type() == 4 || XC_Functional::get_func_type() == 5) - { - if (this->restart && this->two_level_step != nullptr) - { - if (*this->two_level_step == 0) - { - this->add_loaded_Hexx(ik); - return; - } - else // clear loaded Hexx and release memory - { - if (this->Hexxd_k_load.size() > 0) - { - this->Hexxd_k_load.clear(); - this->Hexxd_k_load.shrink_to_fit(); - } - else if (this->Hexxc_k_load.size() > 0) - { - this->Hexxc_k_load.clear(); - this->Hexxc_k_load.shrink_to_fit(); - } - } - } - // cal H(k) from H(R) normally - - if (GlobalC::exx_info.info_ri.real_number) { - RI_2D_Comm::add_Hexx( - ucell, - this->kv, - ik, - GlobalC::exx_info.info_global.hybrid_alpha, - *this->Hexxd, - *this->hR->get_paraV(), - this->hsk->get_hk()); - } else { - RI_2D_Comm::add_Hexx( - ucell, - this->kv, - ik, - GlobalC::exx_info.info_global.hybrid_alpha, - *this->Hexxc, - *this->hR->get_paraV(), - this->hsk->get_hk()); -} - } -} - -} // namespace hamilt -#endif // __EXX -#endif // OPEXXLCAO_HPP \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp deleted file mode 100644 index ca94601fa9..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ /dev/null @@ -1,296 +0,0 @@ -#include "operator_lcao.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_hsolver/hsolver_lcao.h" - -#include "module_parameter/parameter.h" - -#ifdef __ELPA -#include "source_hsolver/diago_elpa.h" -#include "source_hsolver/diago_elpa_native.h" -#endif - -#include "module_hamilt_lcao/module_tddft/td_info.h" - -namespace hamilt { - -template <> -void OperatorLCAO::get_hs_pointers() { - ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); - this->hmatrix_k = this->hsk->get_hk(); - if ((this->new_e_iteration && ik == 0) || PARAM.inp.out_mat_hs[0]) - { - if (this->smatrix_k == nullptr) - { - this->smatrix_k = new double[this->hsk->get_size()]; - this->allocated_smatrix = true; - } - const int inc = 1; - BlasConnector::copy(this->hsk->get_size(), this->hsk->get_sk(), inc, this->smatrix_k, inc); -#ifdef __ELPA - hsolver::DiagoElpa::DecomposedState = 0; - hsolver::DiagoElpaNative::DecomposedState = 0; -#endif - this->new_e_iteration = false; - } - ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); -} - -template<> -void OperatorLCAO, double>::get_hs_pointers() -{ - this->hmatrix_k = this->hsk->get_hk(); - this->smatrix_k = this->hsk->get_sk(); -} - -template<> -void OperatorLCAO, std::complex>::get_hs_pointers() -{ - this->hmatrix_k = this->hsk->get_hk(); - this->smatrix_k = this->hsk->get_sk(); -} - -template -void OperatorLCAO::refresh_h() -{ - // Set the matrix 'H' to zero. - this->hsk->set_zero_hk(); -} - -template -void OperatorLCAO::set_hr_done(bool hr_done_in) { - this->hr_done = hr_done_in; -} - -template -void OperatorLCAO::set_current_spin(const int current_spin_in) -{ - this->current_spin = current_spin_in; - if(this->next_op != nullptr) - { - dynamic_cast*>(this->next_op)->set_current_spin(current_spin_in); - } - if(this->next_sub_op != nullptr) - { - dynamic_cast*>(this->next_sub_op)->set_current_spin(current_spin_in); - } -} - -template -void OperatorLCAO::init(const int ik_in) { - ModuleBase::TITLE("OperatorLCAO", "init"); - ModuleBase::timer::tick("OperatorLCAO", "init"); - if (this->is_first_node) { - // refresh HK - this->refresh_h(); - if (!this->hr_done) { - // refresh HR - this->hR->set_zero(); - } - } - switch (this->cal_type) { - case calculation_type::lcao_overlap: { - // cal_type=lcao_overlap refer to overlap matrix operators, which are - // only rely on stucture, and not changed during SCF - - if (!this->hr_done) { - // update SR first - // in cal_type=lcao_overlap, SR should be updated by each sub-chain - // nodes - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - } - - // update SK next - // in cal_type=lcao_overlap, SK should be update here - this->contributeHk(ik_in); - - break; - } - case calculation_type::lcao_fixed: { - // cal_type=lcao_fixed refer to fixed matrix operators, which are only - // rely on stucture, and not changed during SCF - - // update HR first - if (!this->hr_done) { - // in cal_type=lcao_fixed, HR should be updated by each sub-chain - // nodes - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - } - - // update HK next - // in cal_type=lcao_fixed, HK will update in the last node with - // OperatorLCAO::contributeHk() - - break; - } - case calculation_type::lcao_gint: { - // cal_type=lcao_gint refer to grid integral operators, which are relied - // on stucture and potential based on real space grids and should be - // updated each SCF steps - - if (!this->hr_done) { - OperatorLCAO* last = this; - while (last != nullptr) { - // update HR first - // in cal_type=lcao_gint, HR should be updated by every - // sub-node. - last->contributeHR(); - - // update HK next - // in cal_type=lcao_gint, HK will update in the last node with - // OperatorLCAO::contributeHk() - last = dynamic_cast*>(last->next_sub_op); - } - } - - break; - } -#ifdef __MLALGO - case calculation_type::lcao_deepks: { - // update HR first - if (!this->hr_done) { - // in cal_type=lcao_deepks, HR should be updated - this->contributeHR(); - } - - // update V_delta in k space next - this->contributeHk(ik_in); - - break; - } -#endif - case calculation_type::lcao_dftu: - { - //only HK should be updated when cal_type=lcao_dftu - //in cal_type=lcao_dftu, HK only need to update from one node - if(!this->hr_done) - { - //in cal_type=lcao_deepks, HR should be updated - this->contributeHR(); - } - break; - } - case calculation_type::lcao_sc_lambda: - { - //update HR first - this->contributeHR(); - //in cal_type=lcao_sc_mag, - //this->contributeHk(ik_in); - break; - } - case calculation_type::lcao_exx: - { - //update HR first - if (!this->hr_done) - { - this->contributeHR(); - } - - //update HK next - //in cal_type=lcao_exx, HK only need to update from one node - // this->contributeHk(ik_in); - - break; - } - case calculation_type::lcao_tddft_periodic: { - if (!this->hr_done) { - // in cal_type=lcao_fixed, HR should be updated by each sub-chain - // nodes - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - } - this->contributeHk(ik_in); - - break; - } - default: { - ModuleBase::WARNING_QUIT("OperatorLCAO::init", "unknown cal_type"); - break; - } - } - if (this->next_op - != nullptr) { // it is not the last node, loop next init() function - // pass HR status to next node and than set HR status of this node to - // done - if (!this->hr_done) { - dynamic_cast*>(this->next_op)->hr_done - = this->hr_done; - } - // call init() function of next node - this->next_op->init(ik_in); - } else { // it is the last node, update HK with the current total HR - OperatorLCAO::contributeHk(ik_in); - } - - // set HR status of this node to done - this->hr_done = true; - - ModuleBase::timer::tick("OperatorLCAO", "init"); -} - -// contributeHk() -template <> -void OperatorLCAO::contributeHk(int ik) { - ModuleBase::TITLE("OperatorLCAO", "contributeHk"); - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); - if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); -} -// contributeHk() -template -void OperatorLCAO::contributeHk(int ik) { - ModuleBase::TITLE("OperatorLCAO", "contributeHk"); - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); - if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - else - { - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - } - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); -} - -template class OperatorLCAO; -template class OperatorLCAO, double>; -template class OperatorLCAO, std::complex>; -} // namespace hamilt diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h deleted file mode 100644 index 2ee6edf256..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h +++ /dev/null @@ -1,135 +0,0 @@ -#ifndef OPERATORLCAO_H -#define OPERATORLCAO_H -#include "source_base/vector3.h" -#include "source_hamilt/matrixblock.h" -#include "source_hamilt/operator.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp" - -namespace hamilt { - -template -class OperatorLCAO : public Operator { - public: - - OperatorLCAO( - HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, //! k-point vectors - HContainer* hR_in) //! H(R) matrix, R is the Bravis lattice vector - : hsk(hsk_in), kvec_d(kvec_d_in), hR(hR_in){} - - virtual ~OperatorLCAO() - { - if (this->allocated_smatrix) - { - delete[] this->smatrix_k; - } - } - - /* Function init(k) is used for update HR and HK , - data pointers of HR and HK are not passed by this function, but passed by - constructors of every derived classes. No need to override init() in base - class, but must override in derived class */ - virtual void init(const int ik_in) override; - - void refresh_h(); - - /* Function getHR() is designed to update HR matrix only, it will loop all - contributeHR() functions in chain table. Detail of this function is still in - developed, HR matrix has two form: HR_all_spin and HR_one_spin. For NSPIN=2 - case, HR_one_spin for spin-up and spin-down is not constructed at same time. - */ - // void getHR(TR* hr_pointer); - - /* Function contributeHR() is defined in derived class, for constructing - * - */ - virtual void contributeHR() { return; } - - /* Function matrixHk() is used for get information of HK matrix and SK matrix for diagolization. - Gamma_only case (TK = double), SK would not changed during one SCF loop, a template triangle matrix SK_temp is used - for accelerating. General case (TK = std::complex), only pointers of HK and SK saved in OperatorLCAO - */ - void matrixHk(MatrixBlock& hk_in, MatrixBlock& sk_in) - { - this->get_hs_pointers(); -#ifdef __MPI - hk_in = MatrixBlock{hmatrix_k, - (size_t)this->hsk->get_pv()->nrow, - (size_t)this->hsk->get_pv()->ncol, - this->hsk->get_pv()->desc}; - sk_in = MatrixBlock{smatrix_k, - (size_t)this->hsk->get_pv()->nrow, - (size_t)this->hsk->get_pv()->ncol, - this->hsk->get_pv()->desc}; -#else - hk_in = MatrixBlock{hmatrix_k, - (size_t)this->hsk->get_pv()->nrow, - (size_t)this->hsk->get_pv()->ncol, - nullptr}; - - sk_in = MatrixBlock{smatrix_k, - (size_t)this->hsk->get_pv()->nrow, - (size_t)this->hsk->get_pv()->ncol, - nullptr}; -#endif - } - - /* Function contributeHk() is defined in derived class, for constructing - * (K) - */ - virtual void contributeHk(int ik); - - /** - * @brief set_HR_fixed() is used for pass HR_fixed matrix to the next node - * in sub-chain table not used in base class, only be override in fixed - * Hamiltonian Operators (e.g. Ekinetic and Nonlocal) - */ - virtual void set_HR_fixed(void*) { return; } - - /** - * @brief reset the status of 'hr_done' (if H(R) is calculated) - */ - void set_hr_done(bool hr_done_in); - - /** - * @brief set current spin index - */ - void set_current_spin(const int current_spin_in); - - // protected: - // Hamiltonian matrices which are calculated in OperatorLCAO - HS_Matrix_K* hsk = nullptr; - - // kvec_d - const std::vector>& kvec_d; - - protected: - bool new_e_iteration = true; - - //! Real-space Hamiltonian pointer - hamilt::HContainer* hR = nullptr; - - //! current spin index - int current_spin = 0; - - //! if H(R) is calculated - bool hr_done = false; - - private: - - void get_hs_pointers(); - - //! there are H and S matrix for each k point in reciprocal space - //! 'double' type for gamma_only case, - //! 'complex' type for multi k-points case - TK* hmatrix_k = nullptr; - TK* smatrix_k = nullptr; - - //! only used for Gamma_only case - bool allocated_smatrix = false; -}; - -} // end namespace hamilt - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp deleted file mode 100644 index f96f8fd67f..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp +++ /dev/null @@ -1,271 +0,0 @@ -#include "overlap_new.h" - -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include -#include "module_hamilt_lcao/module_tddft/td_info.h" - -template -hamilt::OverlapNew>::OverlapNew(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - hamilt::HContainer* SR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_cutoff_(orb_cutoff), intor_(intor) -{ - this->cal_type = calculation_type::lcao_overlap; - this->ucell = ucell_in; - this->SR = SR_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); - assert(this->SR != nullptr); -#endif - // initialize SR to allocate sparse overlap matrix memory - this->initialize_SR(GridD_in); -} - -// initialize_SR() -template -void hamilt::OverlapNew>::initialize_SR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("OverlapNew", "initialize_SR"); - ModuleBase::timer::tick("OverlapNew", "initialize_SR"); - auto* paraV = this->SR->get_paraV(); // get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1=0; - int I1=0; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index = adjs.box[ad]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index).norm() * this->ucell->lat0 - >= orb_cutoff_[T1] + orb_cutoff_[T2]) - { - continue; - } - hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); - SR->insert_pair(tmp); - } - } - // allocate the memory of BaseMatrix in SR, and set the new values to zero - SR->allocate(nullptr, true); - ModuleBase::timer::tick("OverlapNew", "initialize_SR"); -} - -template -void hamilt::OverlapNew>::calculate_SR() -{ - ModuleBase::TITLE("OverlapNew", "calculate_SR"); - ModuleBase::timer::tick("OverlapNew", "calculate_SR"); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iap = 0; iap < this->SR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = this->SR->get_atom_pair(iap); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - const Parallel_Orbitals* paraV = tmp.get_paraV(); - - for (int iR = 0; iR < tmp.get_R_size(); ++iR) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(iR); - auto dtau = ucell->cal_dtau(iat1, iat2, R_index); - TR* data_pointer = tmp.get_pointer(iR); - this->cal_SR_IJR(iat1, iat2, paraV, dtau, data_pointer); - } - } - // if TK == double, then SR should be fixed to gamma case - // judge type of TK equal to double - if (std::is_same::value) - { - this->SR->fix_gamma(); - } - ModuleBase::timer::tick("OverlapNew", "calculate_SR"); -} - -// cal_SR_IJR() -template -void hamilt::OverlapNew>::cal_SR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* data_pointer) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1=0; - int I1=0; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2=0; - int I2=0; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - - // --------------------------------------------- - // calculate the overlap matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, olm); - for (int ipol = 0; ipol < npol; ipol++) - { - data_pointer[ipol * step_trace] += olm[0]; - } - data_pointer += npol; - } - data_pointer += (npol - 1) * col_indexes.size(); - } -} - -// contributeHR() -template -void hamilt::OverlapNew>::contributeHR() -{ - if (this->SR_fixed_done) - { - return; - } - this->calculate_SR(); - this->SR_fixed_done = true; -} - -// contributeHk() -template <> -void hamilt::OverlapNew>::contributeHk(int ik) -{ - //! if k vector is not changed, then do nothing and return, only for gamma_only case - if (this->kvec_d[ik] == this->kvec_d_old) - { - return; - } - ModuleBase::TITLE("OverlapNew", "contributeHk"); - ModuleBase::timer::tick("OverlapNew", "contributeHk"); - - //! set SK to zero and then calculate SK for each k vector - this->hsk->set_zero_sk(); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); - } - - // update kvec_d_old - this->kvec_d_old = this->kvec_d[ik]; - - ModuleBase::timer::tick("OverlapNew", "contributeHk"); -} -template -void hamilt::OverlapNew>::contributeHk(int ik) -{ - ModuleBase::TITLE("OverlapNew", "contributeHk"); - ModuleBase::timer::tick("OverlapNew", "contributeHk"); - - //! set SK to zero and then calculate SK for each k vector - this->hsk->set_zero_sk(); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); - } - else - { - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); - } - } - else - { - const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); - } - else - { - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); - } - } - - // update kvec_d_old - this->kvec_d_old = this->kvec_d[ik]; - - ModuleBase::timer::tick("OverlapNew", "contributeHk"); -} -template -TK* hamilt::OverlapNew>::getSk() -{ - if (this->hsk != nullptr) - { - return this->hsk->get_sk(); - } - return nullptr; -} - -template class hamilt::OverlapNew>; -template class hamilt::OverlapNew, double>>; -template class hamilt::OverlapNew, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.h deleted file mode 100644 index 977279327b..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_OPERATOR_LCAO_OVERLAP_NEW_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_OPERATOR_LCAO_OVERLAP_NEW_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include - -namespace hamilt -{ - -#ifndef __OVERLAPNEWTEMPLATE -#define __OVERLAPNEWTEMPLATE - -/// The OverlapNew class template inherits from class T -/// it is used to calculate the overlap of wavefunction basis -/// Template parameters: -/// - T: base class, it would be OperatorLCAO or OperatorPW -/// - TR: data type of real space Hamiltonian, it would be double or std::complex -template -class OverlapNew : public T -{ -}; - -#endif - -/// OverlapNew class template specialization for OperatorLCAO base class -/// It is used to calculate the overlap matrix in real space and fold it to k-space -/// SR = -/// SK = = \sum_{R} e^{ikR} SR -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class OverlapNew> : public OperatorLCAO -{ - public: - OverlapNew>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - hamilt::HContainer* SR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - - virtual void contributeHR() override; - - virtual void contributeHk(int ik) override; - - TK* getSk(); - - private: - const UnitCell* ucell = nullptr; - - std::vector orb_cutoff_; - - hamilt::HContainer* SR = nullptr; - - const TwoCenterIntegrator* intor_ = nullptr; - - bool SR_fixed_done = false; - - /** - * @brief initialize SR, search the nearest neighbor atoms - * HContainer is used to store the overlap matrix with specific atom-pairs - * the size of SR will be fixed after initialization - */ - void initialize_SR(const Grid_Driver* GridD_in); - - /** - * @brief calculate the overlap matrix with specific atom-pairs - * nearest neighbor atoms don't need to be calculated again - * loop the atom-pairs in SR and calculate the overlap matrix - */ - void calculate_SR(); - - /** - * @brief calculate the SR local matrix of atom pair - */ - void cal_SR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* data_pointer); - - // if k vector is not changed, then do nothing and return - // default of kvec_d_old is (-10,-10,-10), which is not a valid k vector - ModuleBase::Vector3 kvec_d_old = ModuleBase::Vector3(-10, -10, -10); -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp deleted file mode 100644 index 2b202b7811..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp +++ /dev/null @@ -1,406 +0,0 @@ -#include "td_ekinetic_lcao.h" - -#include "module_parameter/parameter.h" -#include "source_base/global_variable.h" -#include "source_base/libm/libm.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace hamilt -{ -template -TDEkinetic>::TDEkinetic(HS_Matrix_K* hsk_in, - hamilt::HContainer* hR_in, - const K_Vectors* kv_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), orb_cutoff_(orb_cutoff), kv(kv_in), intor_(intor) -{ - this->ucell = ucell_in; - this->cal_type = calculation_type::lcao_tddft_periodic; - this->Grid = GridD_in; - // initialize HR to get adjs info. - this->initialize_HR(Grid); -} - -template -TDEkinetic>::~TDEkinetic() -{ - if (this->hR_tmp != nullptr) - { - delete this->hR_tmp; - } - TD_info::td_vel_op = nullptr; -} - -// term A^2*S -template -void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc, - const TR& overlap, - int nnr) -{ - // the correction term A^2/2. From Hatree to Ry, it needs to be multiplied by 2.0 - Hloc[nnr] += cart_At.norm2() * overlap; - return; -} -// term A dot āˆ‡ -template -void TDEkinetic>::td_ekinetic_grad(std::complex* Hloc, - int nnr, - ModuleBase::Vector3 grad_overlap) -{ - // the correction term -iA dot āˆ‡r - //āˆ‡ refer to the integral āˆ«šœ™(š‘Ÿ)šœ•/šœ•š‘Ÿšœ™(š‘Ÿāˆ’š‘…)š‘‘š‘Ÿ,but abacus only provide the integral of āˆ«šœ™(š‘Ÿ)šœ•/šœ•Ršœ™(š‘Ÿāˆ’š‘…)š‘‘š‘Ÿ. An extra - //minus must be counted in. The final term is iA dot āˆ‡R. From Hatree to Ry, it needs to be multiplied by 2.0 - std::complex tmp = {0, grad_overlap * cart_At}; - Hloc[nnr] += tmp * 2.0; - return; -} - -template -void TDEkinetic>::calculate_HR() -{ - ModuleBase::TITLE("TDEkinetic", "calculate_HR"); - if (this->hR_tmp == nullptr || this->hR_tmp->size_atom_pairs() <= 0) - { - ModuleBase::WARNING_QUIT("TDEkinetic::calculate_HR", "hR_tmp is nullptr or empty"); - } - ModuleBase::timer::tick("TDEkinetic", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_all[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - hamilt::BaseMatrix>* tmp = this->hR_tmp->find_matrix(iat1, iat2, R_index2); - if (tmp != nullptr) - { - if (TD_info::out_current) - { - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); - } - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_c); - } - else - { - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), nullptr); - } - } - else - { - ModuleBase::WARNING_QUIT("TDEkinetic::calculate_HR", "R_index not found in HR"); - } - } - } - ModuleBase::timer::tick("TDEkinetic", "calculate_HR"); -} - -template -void TDEkinetic>::cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex* hr_mat_p, - std::complex** current_mat_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1=0; - int I1=0; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2=0; - int I2=0; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - // --------------------------------------------- - // get tau1 (in cell <0,0,0>) and tau2 (in cell R) - // in principle, only dtau is needed in this function - // snap_psipsi should be refactored to use dtau directly - // --------------------------------------------- - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double grad[3] = {0, 0, 0}; - double overlap = 0; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - // calculate , which equals to -. - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, &overlap, grad); - ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); - - for (int ipol = 0; ipol < npol; ipol++) - { - // key change - td_ekinetic_scalar(hr_mat_p, overlap, ipol * step_trace); - td_ekinetic_grad(hr_mat_p, ipol * step_trace, grad_overlap); - } - hr_mat_p += npol; - // current grad part - if (current_mat_p != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - for (int ipol = 0; ipol < npol; ipol++) - { - // part of Momentum operator, -iāˆ‡r,used to calculate the current - // here is actually iāˆ‡R - current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); - // part of Momentum operator, eA,used to calculate the current - current_mat_p[dir][ipol * step_trace] += std::complex(overlap * cart_At[dir], 0); - } - current_mat_p[dir] += npol; - } - } - } - hr_mat_p += (npol - 1) * col_indexes.size(); - if (current_mat_p != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } - } -} -//update vector potential for td_ekintic term -template -void TDEkinetic>::update_td() -{ - //std::cout<<"velocity"<cart_At = TD_info::td_vel_op->cart_At; -} - -template -void hamilt::TDEkinetic>::set_HR_fixed(void* hR_tmp_in) -{ - this->hR_tmp = static_cast>*>(hR_tmp_in); - this->allocated = false; -} -template -void TDEkinetic>::initialize_HR(const Grid_Driver* GridD) -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDEkinetic", "initialize_HR"); - ModuleBase::timer::tick("TDEkinetic", "initialize_HR"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + orb_cutoff_[T2]) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - } - ModuleBase::timer::tick("TDEkinetic", "initialize_HR"); -} -template -void TDEkinetic>::initialize_HR_tmp() -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDEkinetic", "initialize_HR_tmp"); - ModuleBase::timer::tick("TDEkinetic", "initialize_HR_tmp"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - for (int i = 0; i < this->hR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = this->hR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - this->hR_tmp->insert_pair(tmp1); - } - } - this->hR_tmp->allocate(nullptr, true); - - ModuleBase::timer::tick("TDEkinetic", "initialize_HR_tmp"); -} - -template -void TDEkinetic>::contributeHR() -{ - // const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); - ModuleBase::TITLE("TDEkinetic", "contributeHR"); - ModuleBase::timer::tick("TDEkinetic", "contributeHR"); - // skip if not TDDFT velocity gauge - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - if (!this->hR_tmp_done || TD_info::evolve_once) - { - const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); - // if this Operator is the first node of the sub_chain, then hR_tmp is nullptr - if (this->hR_tmp == nullptr) - { - this->hR_tmp = new hamilt::HContainer>(this->hR->get_paraV()); - // allocate memory for hR_tmp use the same memory as hR - this->initialize_HR_tmp(); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of hR_tmp to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); - } - // initialize current term if needed - if (TD_info::out_current) - { - TD_info::td_vel_op->initialize_current_term(this->hR_tmp, paraV); - } - // calculate the values in hR_tmp - this->update_td(); - this->hR_tmp->set_zero(); - this->calculate_HR(); - this->hR_tmp_done = true; - } - - ModuleBase::timer::tick("TDEkinetic", "contributeHR"); - return; -} - -template -void TDEkinetic>::contributeHk(int ik) -{ - if (PARAM.inp.td_stype != 1) - { - return; - } - else - { - ModuleBase::TITLE("TDEkinetic", "contributeHk"); - ModuleBase::timer::tick("TDEkinetic", "contributeHk"); - const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); - // save HR data for output - int spin_tot = PARAM.inp.nspin; - if (!output_hR_done && TD_info::out_mat_R) - { - for (int spin_now = 0; spin_now < spin_tot; spin_now++) - { - sparse_format::cal_HContainer_cd(*(paraV), - spin_now, - 1e-10, - *hR_tmp, - TD_info::td_vel_op->HR_sparse_td_vel[spin_now]); - } - output_hR_done = true; - } - // folding inside HR to HK - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = paraV->get_row_size(); - hamilt::folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = paraV->get_col_size(); - hamilt::folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - - ModuleBase::timer::tick("TDEkinetic", "contributeHk"); - } -} - -template class TDEkinetic, double>>; -template class TDEkinetic, std::complex>>; - -} // namespace hamilt diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h deleted file mode 100644 index 310504aa07..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef TDEKINETIC_H -#define TDEKINETIC_H -#include "source_base/timer.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "operator_lcao.h" -#include - - -namespace hamilt -{ - -#ifndef __TDEKINETICTEMPLATE -#define __TDEKINETICTEMPLATE - -/// The TDEkinetic class template inherits from class T -/// It is used to calculate correction term of kinetic energy in time-dependent DFT -template -class TDEkinetic : public T -{ -}; - -#endif - -/// TDEkinetic class template specialization for OperatorLCAO base class -/// It is used to calculate correction term of kinetic energy in time-dependent DFT -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian - -template -class TDEkinetic> : public OperatorLCAO -{ - public: - TDEkinetic>(HS_Matrix_K* hsk_in, - hamilt::HContainer* hR_in, - const K_Vectors* kv_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - ~TDEkinetic(); - - virtual void contributeHR() override; - - virtual void contributeHk(int ik) override; - - /// @brief update vector potential - void update_td(); - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD); - - /** - * @brief initialize HR_tmp - * Allocate the memory for HR_tmp with the same size as HR - */ - void initialize_HR_tmp(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex* hr_mat_p, - std::complex** current_mat_p); - - /** - * @brief calculate the ekinetic matrix correction term in tddft with specific atom-pairs - * nearest neighbor atoms don't need to be calculated again - * loop the atom-pairs in HR and calculate the ekinetic matrix - */ - void calculate_HR(); - - virtual void set_HR_fixed(void*) override; - - - private: - - const UnitCell* ucell = nullptr; - - std::vector orb_cutoff_; - - HContainer* SR = nullptr; - - /// @brief Store real space hamiltonian. TD term should include imaginary part, - /// thus it has to be complex type. Only shared between TD operators. - HContainer>* hR_tmp = nullptr; - - const Grid_Driver* Grid = nullptr; - - const K_Vectors* kv; - - /// @brief correction term i A nabla - void td_ekinetic_scalar(std::complex* Hloc, const TR& Sloc, int nnr); - - /// @brief correction term A^2*S - void td_ekinetic_grad(std::complex* Hloc, int nnr, ModuleBase::Vector3 grad_overlap); - - const TwoCenterIntegrator* intor_ = nullptr; - - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; - - bool hR_tmp_done = false; - - bool allocated = false; - - bool output_hR_done = false; -}; - -} // namespace hamilt -#endif - diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp deleted file mode 100644 index 391dca66f0..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp +++ /dev/null @@ -1,447 +0,0 @@ -#include "td_nonlocal_lcao.h" - -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" -#include "source_pw/hamilt_pwdft/global.h" -#ifdef _OPENMP -#include -#include -#endif - -template -hamilt::TDNonlocal>::TDNonlocal(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const LCAO_Orbitals& orb, - const Grid_Driver* GridD_in) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_(orb) -{ - this->cal_type = calculation_type::lcao_tddft_periodic; - this->ucell = ucell_in; - this->Grid = GridD_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); -#endif - // initialize HR to get adjs info. - this->initialize_HR(Grid); -} - -// destructor -template -hamilt::TDNonlocal>::~TDNonlocal() -{ - if (this->allocated) - { - delete this->hR_tmp; - } -} -template -void hamilt::TDNonlocal>::update_td() -{ - // calculate At in cartesian coorinates. - this->cart_At = TD_info::td_vel_op->cart_At; -} -// initialize_HR() -template -void hamilt::TDNonlocal>::initialize_HR(const Grid_Driver* GridD) -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDNonlocal", "initialize_HR"); - ModuleBase::timer::tick("TDNonlocal", "initialize_HR"); - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - } - - ModuleBase::timer::tick("TDNonlocal", "initialize_HR"); -} - -// initialize_HR_tmp() -template -void hamilt::TDNonlocal>::initialize_HR_tmp(const Parallel_Orbitals* paraV) -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDNonlocal", "initialize_HR_tmp"); - ModuleBase::timer::tick("TDNonlocal", "initialize_HR_tmp"); - - for (int i = 0; i < this->hR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = this->hR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - this->hR_tmp->insert_pair(tmp1); - } - } - this->hR_tmp->allocate(nullptr, true); - - ModuleBase::timer::tick("TDNonlocal", "initialize_HR_tmp"); -} - -template -void hamilt::TDNonlocal>::calculate_HR() -{ - ModuleBase::TITLE("TDNonlocal", "calculate_HR"); - ModuleBase::timer::tick("TDNonlocal", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - const int nlm_dim = TD_info::out_current ? 4 : 1; - // 1. calculate for each pair of atoms - - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - const auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - const AdjacentAtomInfo& adjs = this->adjs_all[iat0]; - std::vector>>>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - for (int i = 0; i < adjs.adj_num + 1; i++) - { - nlm_tot[i].resize(nlm_dim); - } - - #pragma omp parallel - { - #pragma omp for schedule(dynamic) - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector>> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false - // and size of outer vector is 4 when out_current is true (3 for , 1 for - // ) inner loop : all projectors (L0,M0) - - // snap_psibeta_half_tddft() are used to calculate - // and as well if current are needed - module_tddft::snap_psibeta_half_tddft(orb_, - this->ucell->infoNL, - nlm, - tau1 * this->ucell->lat0, - T1, - atom1->iw2l[iw1], - atom1->iw2m[iw1], - atom1->iw2n[iw1], - tau0 * this->ucell->lat0, - T0, - cart_At, - TD_info::out_current); - for (int dir = 0; dir < nlm_dim; dir++) - { - nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); - } - } - } - -#ifdef _OPENMP - // record the iat number of the adjacent atoms - std::set ad_atom_set; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - ad_atom_set.insert(iat1); - } - - // split the ad_atom_set into num_threads parts - const int num_threads = omp_get_num_threads(); - const int thread_id = omp_get_thread_num(); - std::set ad_atom_set_thread; - int i = 0; - for(const auto iat1 : ad_atom_set) - { - if (i % num_threads == thread_id) - { - ad_atom_set_thread.insert(iat1); - } - i++; - } -#endif - - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - -#ifdef _OPENMP - if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) - { - continue; - } -#endif - - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - const ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - hamilt::BaseMatrix>* tmp - = this->hR_tmp->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - if (TD_info::out_current) - { - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i) - ->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]) - ->get_pointer(); - } - this->cal_HR_IJR(iat1, - iat2, - T0, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - tmp->get_pointer(), - tmp_c); - } - else - { - this->cal_HR_IJR(iat1, - iat2, - T0, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - tmp->get_pointer(), - nullptr); - } - } - } - } - } - } - - ModuleBase::timer::tick("TDNonlocal", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::TDNonlocal>::cal_HR_IJR( - const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>>& nlm1_all, - const std::vector>>>& nlm2_all, - std::complex* data_pointer, - std::complex** data_pointer_c) -{ - const int nlm_dim = TD_info::out_current ? 4 : 1; - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = col_indexes.size() * is + is2; - } - } - // calculate the local matrix - const std::complex* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); - std::vector>*> nlm1; - for (int dir = 0; dir < nlm_dim; dir++) - { - nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); - } - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - std::vector>*> nlm2; - for (int dir = 0; dir < nlm_dim; dir++) - { - nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); - } -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - std::complex nlm_tmp = std::complex{0, 0}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - nlm_tmp += nlm1[0]->at(p1) * std::conj(nlm2[0]->at(p2)) * (*tmp_d); - } - data_pointer[step_trace[is]] += nlm_tmp; - if (data_pointer_c != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - std::complex nlm_r_tmp = std::complex{0, 0}; - std::complex imag_unit = std::complex{0, 1}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - //- - // multiply d in the end - nlm_r_tmp += (nlm1[dir + 1]->at(p1) * std::conj(nlm2[0]->at(p2)) - - nlm1[0]->at(p1) * std::conj(nlm2[dir + 1]->at(p2))) - * (*tmp_d); - } - // -i[r,Vnl], 2.0 due to the unit transformation - data_pointer_c[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; - } - } - } - data_pointer += npol; - if (data_pointer_c != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - data_pointer_c[dir] += npol; - } - } - } - data_pointer += (npol - 1) * col_indexes.size(); - if (data_pointer_c != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - data_pointer_c[dir] += (npol - 1) * col_indexes.size(); - } - } - } -} - -// set_hR_tmp() -template -void hamilt::TDNonlocal>::set_HR_fixed(void* hR_tmp_in) -{ - this->hR_tmp = static_cast>*>(hR_tmp_in); - this->allocated = false; -} - - -// contributeHR() -template -void hamilt::TDNonlocal>::contributeHR() -{ - ModuleBase::TITLE("TDNonlocal", "contributeHR"); - - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - - ModuleBase::timer::tick("TDNonlocal", "contributeHR"); - - if (!this->hR_tmp_done || TD_info::evolve_once) - { - if (this->hR_tmp == nullptr) - { - this->hR_tmp = new hamilt::HContainer>(this->hsk->get_pv()); - // allocate memory for hR_tmp use the same memory as hR - this->initialize_HR_tmp(this->hsk->get_pv()); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of hR_tmp to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); - } - - // calculate the values in hR_tmp - this->update_td(); - this->calculate_HR(); - this->hR_tmp_done = true; - TD_info::evolve_once = false; - } - - ModuleBase::timer::tick("TDNonlocal", "contributeHR"); - return; -} - - -template -void hamilt::TDNonlocal>::contributeHk(int ik) -{ - return; -} - -template class hamilt::TDNonlocal, double>>; -template class hamilt::TDNonlocal, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h deleted file mode 100644 index d89e7b38e5..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef TDNONLOCAL_H -#define TDNONLOCAL_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" - -#include - -namespace hamilt -{ - -#ifndef __TD_NONLOCALTEMPLATE -#define __TD_NONLOCALTEMPLATE - -/// The TDNonlocal class template inherits from class T -/// It is used to calculate correction term of non-local pseudopotential in time-dependent DFT -template -class TDNonlocal : public T -{ -}; - -#endif - -/// TDNonlocal class template specialization for OperatorLCAO base class -/// It is used to calculate correction term of non-local pseudopotential in time-dependent DFT -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class TDNonlocal> : public OperatorLCAO -{ - public: - TDNonlocal>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const LCAO_Orbitals& orb, - const Grid_Driver* GridD_in); - ~TDNonlocal>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * D_{p1, p2} - */ - virtual void contributeHR() override; - virtual void contributeHk(int ik) override; - - virtual void set_HR_fixed(void*) override; - - private: - const UnitCell* ucell = nullptr; - const LCAO_Orbitals& orb_; - - HContainer* HR = nullptr; - /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only - /// shared between TD operators. - HContainer>* hR_tmp = nullptr; - const Grid_Driver* Grid = nullptr; - - bool allocated = false; - - bool hR_tmp_done = false; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD_in); - - /** - * @brief initialize HR_tmp - * Allocate the memory for HR_tmp with the same size as HR - */ - void initialize_HR_tmp(const Parallel_Orbitals* paraV); - /// @brief init vector potential for td_nonlocal term - void update_td(); - /** - * @brief calculate the non-local pseudopotential matrix with specific atom-pairs - * nearest neighbor atoms don't need to be calculated again - * loop the atom-pairs in HR and calculate the non-local pseudopotential matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>>& nlm1_all, - const std::vector>>>& nlm2_all, - std::complex* data_pointer, - std::complex** data_pointer_c); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; - /// @brief Store the vector potential for td_nonlocal term - ModuleBase::Vector3 cart_At; -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp deleted file mode 100644 index 54b5471c5d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp +++ /dev/null @@ -1,300 +0,0 @@ -#include "td_pot_hybrid.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/hamilt_pwdft/global.h" - -// Constructor -template -cal_r_overlap_R hamilt::TD_pot_hybrid>::r_calculator; - -template -hamilt::TD_pot_hybrid>::TD_pot_hybrid( - HS_Matrix_K* hsk_in, - const K_Vectors* kv_in, - hamilt::HContainer* hR_in, - hamilt::HContainer* SR_in, - const LCAO_Orbitals& orb, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : hamilt::OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), SR(SR_in), orb_(orb), orb_cutoff_(orb_cutoff), intor_(intor) -{ - this->cal_type = calculation_type::lcao_tddft_periodic; - this->ucell = ucell_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); - assert(this->hsk != nullptr); -#endif - this->init_td(); - // initialize HR to allocate sparse Ekinetic matrix memory - this->initialize_HR(GridD_in); -} - -// destructor -template -hamilt::TD_pot_hybrid>::~TD_pot_hybrid() -{ - if (this->allocated) - { - delete this->HR_fixed; - } - /*if(TD_info::td_vel_op!=nullptr) - { - TD_info::td_vel_op->hk_hybrid = nullptr; - }*/ -} - -// initialize_HR() -template -void hamilt::TD_pot_hybrid>::initialize_HR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("TD_pot_hybrid", "initialize_HR"); - ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + orb_cutoff_[T2]) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index = adjs.box[ad]; - hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); - this->hR->insert_pair(tmp); - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - this->hR->allocate(nullptr, true); - - ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); -} - -template -void hamilt::TD_pot_hybrid>::calculate_HR() -{ - ModuleBase::TITLE("TD_pot_hybrid", "calculate_HR"); - if (this->HR_fixed == nullptr || this->HR_fixed->size_atom_pairs() <= 0) - { - ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "HR_fixed is nullptr or empty"); - } - ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_all[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - hamilt::BaseMatrix* tmp = this->HR_fixed->find_matrix(iat1, iat2, R_index2); - hamilt::BaseMatrix* tmp_overlap = this->SR->find_matrix(iat1, iat2, R_index2); - if (tmp != nullptr) - { - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_overlap->get_pointer()); - } - else - { - ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "R_index not found in HR"); - } - } - } - - ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::TD_pot_hybrid>::cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* hr_mat_p, - TR* sr_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - ModuleBase::Vector3 tmp_r = r_calculator.get_psi_r_psi(tau1 * this->ucell->lat0, T1, L1, m1, N1, tau2 * this->ucell->lat0, T2, L2, m2, N2); - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - for (int ipol = 0; ipol < npol; ipol++) - { - hr_mat_p[ipol * step_trace] += tmp_r * Et; - hr_mat_p[ipol * step_trace] -= ((dtau + tau1) * Et) * sr_p[ipol * step_trace] * this->ucell->lat0; - } - hr_mat_p += npol; - sr_p += npol; - } - hr_mat_p += (npol - 1) * col_indexes.size(); - sr_p += (npol - 1) * col_indexes.size(); - } -} -// init two center integrals and vector potential for td_ekintic term -template -void hamilt::TD_pot_hybrid>::init_td() -{ - // initialize the r_calculator - if(TD_info::td_vel_op->get_istep()==(TD_info::estep_shift-1)) - { - //std::cout << "init_r_overlap" <hR->get_paraV(), orb_); - } - //hk_hybrid.resize(this->hR->get_paraV()->nloc); -} -template -void hamilt::TD_pot_hybrid>::update_td() -{ - //std::cout<<"hybrid gague" <cart_At = TD_info::td_vel_op->cart_At; - //std::cout<<"At: "<< TD_info::td_vel_op->cart_At[0] <<" "<cart_At[1]<<" "<cart_At[2]<<" "< -void hamilt::TD_pot_hybrid>::set_HR_fixed(void* HR_fixed_in) -{ - this->HR_fixed = static_cast*>(HR_fixed_in); - this->allocated = false; -} - -// contributeHR() -template -void hamilt::TD_pot_hybrid>::contributeHR() -{ - ModuleBase::TITLE("TD_pot_hybrid", "contributeHR"); - ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); - - if (!this->HR_fixed_done || TD_info::evolve_once) - { - // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr - if (this->HR_fixed == nullptr) - { - this->HR_fixed = new hamilt::HContainer(*this->hR); - this->HR_fixed->set_zero(); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of HR_fixed to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); - } - // calculate the values in HR_fixed - this->update_td(); - this->HR_fixed->set_zero(); - this->calculate_HR(); - this->HR_fixed_done = true; - TD_info::evolve_once = false; - } - // last node of sub-chain, add HR_fixed into HR - if (this->next_sub_op == nullptr) - { - this->hR->add(*(this->HR_fixed)); - } - - ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); - return; -} - -//ETD -// contributeHk() -template -void hamilt::TD_pot_hybrid>::contributeHk(int ik) { - return; -} - -template class hamilt::TD_pot_hybrid, double>>; -template class hamilt::TD_pot_hybrid, std::complex>>; diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h deleted file mode 100644 index 4d7b577e32..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef TD_POT_HYBRID_H -#define TD_POT_HYBRID_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include -#include "module_io/cal_r_overlap_R.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" - -namespace hamilt -{ - -#ifndef __TD_POT_HYBRIDTEMPLATE -#define __TD_POT_HYBRIDTEMPLATE - -/// The EkineticNew class template inherits from class T -/// it is used to calculate the electronic kinetic -/// Template parameters: -/// - T: base class, it would be OperatorLCAO or OperatorPW -/// - TR: data type of real space Hamiltonian, it would be double or std::complex -template -class TD_pot_hybrid : public T -{ -}; - -#endif - -/// EkineticNew class template specialization for OperatorLCAO base class -/// It is used to calculate the electronic kinetic matrix in real space and fold it to k-space -/// HR = -/// HK = = \sum_{R} e^{ikR} HR -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class TD_pot_hybrid> : public OperatorLCAO -{ - public: - /** - * @brief Construct a new EkineticNew object - */ - TD_pot_hybrid>(HS_Matrix_K* hsk_in, - const K_Vectors* kv_in, - HContainer* hR_in, - HContainer* SR_in, - const LCAO_Orbitals& orb, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - - /** - * @brief Destroy the EkineticNew object - */ - ~TD_pot_hybrid>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * - */ - virtual void contributeHR() override; - //ETD - virtual void contributeHk(int ik) override; - //ETD - - virtual void set_HR_fixed(void*) override; - - - private: - const UnitCell* ucell = nullptr; - std::vector orb_cutoff_; - const LCAO_Orbitals& orb_; - - hamilt::HContainer* HR_fixed = nullptr; - - hamilt::HContainer* SR = nullptr; - - const TwoCenterIntegrator* intor_ = nullptr; - - bool allocated = false; - - bool HR_fixed_done = false; - //tddft part - static cal_r_overlap_R r_calculator; - //ETD - //std::vector> hk_hybrid; - //ETD - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; - ModuleBase::Vector3 Et; - - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the electronic kinetic matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD_in); - - void init_td(); - void update_td(); - - /** - * @brief calculate the electronic kinetic matrix with specific atom-pairs - * use the adjs_all to calculate the HR matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* hr_mat_p, - TR* sr_p); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/CMakeLists.txt b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/CMakeLists.txt deleted file mode 100644 index 2b3a137e0e..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/CMakeLists.txt +++ /dev/null @@ -1,71 +0,0 @@ -if(ENABLE_LCAO) -remove_definitions(-DUSE_NEW_TWO_CENTER) - -AddTest( - TARGET operator_overlap_test - LIBS parameter ${math_libs} psi base device container - SOURCES test_overlapnew.cpp ../overlap_new.cpp ../../../module_hcontainer/func_folding.cpp - ../../../module_hcontainer/base_matrix.cpp ../../../module_hcontainer/hcontainer.cpp ../../../module_hcontainer/atom_pair.cpp - ../../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../../source_basis/module_ao/ORB_atomic_lm.cpp - tmp_mocks.cpp ../../../../source_hamilt/operator.cpp -) - -AddTest( - TARGET operator_overlap_cd_test - LIBS parameter ${math_libs} psi base device container - SOURCES test_overlapnew_cd.cpp ../overlap_new.cpp ../../../module_hcontainer/func_folding.cpp - ../../../module_hcontainer/base_matrix.cpp ../../../module_hcontainer/hcontainer.cpp ../../../module_hcontainer/atom_pair.cpp - ../../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../../source_basis/module_ao/ORB_atomic_lm.cpp - tmp_mocks.cpp ../../../../source_hamilt/operator.cpp -) - -AddTest( - TARGET operator_ekinetic_test - LIBS parameter ${math_libs} psi base device container - SOURCES test_ekineticnew.cpp ../ekinetic_new.cpp ../../../module_hcontainer/func_folding.cpp - ../../../module_hcontainer/base_matrix.cpp ../../../module_hcontainer/hcontainer.cpp ../../../module_hcontainer/atom_pair.cpp - ../../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../../source_basis/module_ao/ORB_atomic_lm.cpp - tmp_mocks.cpp ../../../../source_hamilt/operator.cpp -) - -AddTest( - TARGET operator_nonlocal_test - LIBS parameter ${math_libs} psi base device container - SOURCES test_nonlocalnew.cpp ../nonlocal_new.cpp ../../../module_hcontainer/func_folding.cpp - ../../../module_hcontainer/base_matrix.cpp ../../../module_hcontainer/hcontainer.cpp ../../../module_hcontainer/atom_pair.cpp - ../../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../../source_basis/module_ao/ORB_atomic_lm.cpp - tmp_mocks.cpp ../../../../source_hamilt/operator.cpp -) - -AddTest( - TARGET operator_T_NL_cd_test - LIBS parameter ${math_libs} psi base device container - SOURCES test_T_NL_cd.cpp ../nonlocal_new.cpp ../ekinetic_new.cpp ../../../module_hcontainer/func_folding.cpp - ../../../module_hcontainer/base_matrix.cpp ../../../module_hcontainer/hcontainer.cpp ../../../module_hcontainer/atom_pair.cpp - ../../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../../source_basis/module_ao/ORB_atomic_lm.cpp - tmp_mocks.cpp ../../../../source_hamilt/operator.cpp -) - -AddTest( - TARGET operator_dftu_test - LIBS parameter ${math_libs} psi base device container - SOURCES test_dftu.cpp ../dftu_lcao.cpp ../../../module_hcontainer/func_folding.cpp - ../../../module_hcontainer/base_matrix.cpp ../../../module_hcontainer/hcontainer.cpp ../../../module_hcontainer/atom_pair.cpp - ../../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../../source_basis/module_ao/ORB_atomic_lm.cpp - tmp_mocks.cpp ../../../../source_hamilt/operator.cpp -) - -install(FILES parallel_operator_tests.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -find_program(BASH bash) -add_test(NAME operators_para_test - COMMAND ${BASH} parallel_operator_tests.sh - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -endif() diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/parallel_operator_tests.sh b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/parallel_operator_tests.sh deleted file mode 100644 index b30c22e774..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/parallel_operator_tests.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -e - -np=`cat /proc/cpuinfo | grep "cpu cores" | uniq| awk '{print $NF}'` -echo "nprocs in this machine is $np" - -for i in 2 3 4; do - if [[ $i -gt $np ]];then - continue - fi - echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./operator_overlap_cd_test - e1=$? - mpirun -np $i ./operator_overlap_test - e2=$? - mpirun -np $i ./operator_ekinetic_test - e3=$? - mpirun -np $i ./operator_nonlocal_test - e4=$? - mpirun -np $i ./operator_T_NL_cd_test - e5=$? - if [[ $e1 -ne 0 || $e2 -ne 0 || $e3 -ne 0 || $e4 -ne 0 || $e5 -ne 0 ]]; then - echo -e "\e[1;33m [ FAILED ] \e[0m"\ - "execute UT with $i cores error." - exit 1 - fi -done diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_T_NL_cd.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_T_NL_cd.cpp deleted file mode 100644 index 5f3aa117ec..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_T_NL_cd.cpp +++ /dev/null @@ -1,260 +0,0 @@ -#include "../ekinetic_new.h" -#include "../nonlocal_new.h" - -#include "gtest/gtest.h" -#include - -//--------------------------------------- -// Unit test of EkineticNew + NonlocalNew class -// EkineticNew and NonlocalNew are derivative classes of Operator, used to calculate the T+VNL matrix -// It use HContainer to store the real space HR matrix -// In this test, we test the correctness and time consuming of 6 functions in T+VNL class -// - initialize_HR() called in two constructors -// - contributeHR() in two Operators -// - contributeHk() in two Operators -// - HR(complex) and HK(complex) are tested in constructHRd2d -//--------------------------------------- - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 10; -class TNLTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.atoms[0].tau.resize(ucell.nat); - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.atoms[0].tau[iat] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.atoms[0].iw2l.resize(test_nw); - ucell.atoms[0].iw2m.resize(test_nw); - ucell.atoms[0].iw2n.resize(test_nw); - for (int iw = 0; iw < test_nw; ++iw) - { - ucell.atoms[0].iw2l[iw] = 0; - ucell.atoms[0].iw2m[iw] = 0; - ucell.atoms[0].iw2n[iw] = 0; - } - ucell.set_iat2iwt(2); - // for NonlocalNew - ucell.infoNL.Beta = new Numerical_Nonlocal[ucell.ntype]; - ucell.atoms[0].ncpp.d_real.create(5, 5); - ucell.atoms[0].ncpp.d_real.zero_out(); - ucell.atoms[0].ncpp.d_so.create(4, 5, 5); - ucell.atoms[0].ncpp.d_so.zero_out(); - ucell.atoms[0].ncpp.non_zero_count_soc[0] = 5; - ucell.atoms[0].ncpp.non_zero_count_soc[1] = 0; - ucell.atoms[0].ncpp.non_zero_count_soc[2] = 0; - ucell.atoms[0].ncpp.non_zero_count_soc[3] = 5; - ucell.atoms[0].ncpp.index1_soc[0] = std::vector(5, 0); - ucell.atoms[0].ncpp.index2_soc[0] = std::vector(5, 0); - ucell.atoms[0].ncpp.index1_soc[3] = std::vector(5, 0); - ucell.atoms[0].ncpp.index2_soc[3] = std::vector(5, 0); - for (int i = 0; i < 5; ++i) - { - ucell.atoms[0].ncpp.d_real(i, i) = 1.0; - ucell.atoms[0].ncpp.d_so(0, i, i) = std::complex(2.0, 0.0); - ucell.atoms[0].ncpp.d_so(3, i, i) = std::complex(2.0, 0.0); - ucell.atoms[0].ncpp.index1_soc[0][i] = i; - ucell.atoms[0].ncpp.index2_soc[0][i] = i; - ucell.atoms[0].ncpp.index1_soc[3][i] = i; - ucell.atoms[0].ncpp.index2_soc[3][i] = i; - } - // end of set up a unitcell - init_parav(); - // set up a HContainer with ucell - HR = new hamilt::HContainer>(paraV); - } - - void TearDown() override - { - delete HR; - delete paraV; - delete[] ucell.atoms; - delete[] ucell.infoNL.Beta; - } - -#ifdef __MPI - void init_parav() - { - int nb = 20; - int global_row = test_size * test_nw * 2; - int global_col = test_size * test_nw * 2; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - { - } -#endif - - UnitCell ucell; - hamilt::HContainer>* HR; - Parallel_Orbitals* paraV; - TwoCenterIntegrator intor_; - - int dsize; - int my_rank = 0; -}; - -TEST_F(TNLTest, testTVNLcd2cd) -{ - int npol = ucell.get_npol(); - std::vector> kvec_d_in(2, ModuleBase::Vector3(0.0, 0.0, 0.0)); - kvec_d_in[1] = ModuleBase::Vector3(0.1, 0.2, 0.3); - hamilt::HS_Matrix_K> hsk(paraV, 1); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - hamilt::Operator>* op - = new hamilt::EkineticNew, std::complex>>(&hsk, - kvec_d_in, - HR, - &ucell, - {1.0}, - &gd, - &intor_); - hamilt::Operator>* op1 - = new hamilt::NonlocalNew, std::complex>>(&hsk, - kvec_d_in, - HR, - &ucell, - {1.0}, - &gd, - &intor_); - // merge two Operators to a chain - op->add(op1); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now(); - // calculate HR and folding HK for gamma point - op->init(0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 - = std::chrono::duration_cast>(end_time - start_time); - - // check the value of HR - double result_ref = test_size * 10; - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair>& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int i = 0; - for (int mu = 0; mu < indexes1.size(); ++mu) - { - for (int nu = 0; nu < indexes2.size(); ++nu) - { - if (mu % npol == nu % npol) - { - EXPECT_EQ(tmp.get_pointer(0)[i].real(), 1.0); - EXPECT_EQ(tmp.get_pointer(0)[i].imag(), 0.0); - EXPECT_EQ(tmp.get_pointer(1)[i].real(), result_ref); - EXPECT_EQ(tmp.get_pointer(1)[i].imag(), 0.0); - } - else - { - EXPECT_EQ(tmp.get_pointer(0)[i].real(), 0.0); - EXPECT_EQ(tmp.get_pointer(0)[i].imag(), 0.0); - EXPECT_EQ(tmp.get_pointer(1)[i].real(), 0.0); - EXPECT_EQ(tmp.get_pointer(1)[i].imag(), 0.0); - } - ++i; - } - } - } - // check the value of HK of gamma point - auto* hk = hsk.get_hk(); - result_ref += 1.0; - int i = 0; - for (int irow = 0; irow < paraV->get_row_size(); ++irow) - { - for (int icol = 0; icol < paraV->get_col_size(); ++icol) - { - if (irow % npol == icol % npol) - { - EXPECT_NEAR(hk[i].real(), result_ref, 1e-10); - EXPECT_NEAR(hk[i].imag(), 0.0, 1e-10); - } - else - { - EXPECT_NEAR(hk[i].real(), 0.0, 1e-10); - EXPECT_NEAR(hk[i].imag(), 0.0, 1e-10); - } - ++i; - } - } - // calculate HK for k point - start_time = std::chrono::high_resolution_clock::now(); - hsk.set_zero_hk(); - op->init(1); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 - = std::chrono::duration_cast>(end_time - start_time); - std::cout << "Test terms: " << std::setw(15) << "constructor" << std::setw(15) << "init(HR+HK)" << std::setw(15) - << "2nd-init(HK)" << std::endl; - std::cout << "Elapsed time: " << std::setw(15) << elapsed_time0.count() << std::setw(15) << elapsed_time1.count() - << std::setw(15) << elapsed_time2.count() << " seconds." << std::endl; - // check the value of HK - double result_ref1 = -1.6180339887498931 / 2 + test_size * 10; - double result_ref2 = -1.1755705045849467 / 2; - i = 0; - for (int irow = 0; irow < paraV->get_row_size(); ++irow) - { - for (int icol = 0; icol < paraV->get_col_size(); ++icol) - { - if (irow % npol == icol % npol) - { - EXPECT_NEAR(hk[i].real(), result_ref1, 1e-10); - EXPECT_NEAR(hk[i].imag(), result_ref2, 1e-10); - } - else - { - EXPECT_NEAR(hk[i].real(), 0.0, 1e-10); - EXPECT_NEAR(hk[i].imag(), 0.0, 1e-10); - } - ++i; - } - } - delete op; -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_dftu.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_dftu.cpp deleted file mode 100644 index d1838bdb0a..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_dftu.cpp +++ /dev/null @@ -1,279 +0,0 @@ -#include "gtest/gtest.h" -#include - -// mock of DFTU -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "../dftu_lcao.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -ModuleDFTU::DFTU::DFTU(){}; -ModuleDFTU::DFTU::~DFTU(){}; -namespace GlobalC -{ -ModuleDFTU::DFTU dftu; -} -const hamilt::HContainer* tmp_DMR; -const hamilt::HContainer* ModuleDFTU::DFTU::get_dmr(int ispin) const -{ - return tmp_DMR; -} - -//--------------------------------------- -// Unit test of DFTU class -// DFTU is a derivative class of Operator, it is used to calculate the kinetic matrix -// It use HContainer to store the real space HR matrix -// In this test, we test the correctness and time consuming of 3 functions in DFTU class -// - initialize_HR() called in constructor -// - contributeHR() -// - contributeHk() -// - HR(double) and SK(complex) are tested in constructHRd2cd -// - HR(double) and SK(double) are tested in constructHRd2d -//--------------------------------------- - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 10; // please larger than 5 -class DFTUTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.atoms[0].tau.resize(ucell.nat); - ucell.lat0 = 1.0; - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.atoms[0].tau[iat] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.atoms[0].iw2l.resize(test_nw); - ucell.atoms[0].iw2m.resize(test_nw); - ucell.atoms[0].iw2n.resize(test_nw); - for (int iw = 0; iw < test_nw; ++iw) - { - ucell.atoms[0].iw2l[iw] = 2; - ucell.atoms[0].iw2m[iw] = 0; - ucell.atoms[0].iw2n[iw] = 0; - } - ucell.set_iat2iwt(1); - init_parav(); - // set up a HContainer with ucell - HR = new hamilt::HContainer(ucell, paraV); - // initialize DMR and set default values of 1.0 - DMR = new hamilt::HContainer(*HR); - tmp_DMR = DMR; - - // setting of DFTU - GlobalC::dftu.locale.resize(test_size); - for (int iat = 0; iat < test_size; iat++) - { - GlobalC::dftu.locale[iat].resize(3); - for (int l = 0; l < 3; l++) - { - GlobalC::dftu.locale[iat][l].resize(1); - GlobalC::dftu.locale[iat][l][0].resize(2); - GlobalC::dftu.locale[iat][l][0][0].create(2 * l + 1, 2 * l + 1); - GlobalC::dftu.locale[iat][l][0][1].create(2 * l + 1, 2 * l + 1); - } - } - GlobalC::dftu.U = {U_test}; - GlobalC::dftu.orbital_corr = {orbital_c_test}; - - PARAM.input.onsite_radius = 1.0; - } - - void TearDown() override - { - delete HR; - delete DMR; - delete paraV; - delete[] ucell.atoms; - } - -#ifdef __MPI - void init_parav() - { - int nb = 10; - int global_row = test_size * test_nw; - int global_col = test_size * test_nw; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - { - } -#endif - - UnitCell ucell; - hamilt::HContainer* HR; - hamilt::HContainer* DMR; - Parallel_Orbitals* paraV; - TwoCenterIntegrator intor_; - - int dsize; - int my_rank = 0; - double U_test = 1.0; - int orbital_c_test = 2; -}; - -// using TEST_F to test DFTU -TEST_F(DFTUTest, constructHRd2d) -{ - // test for nspin=1 - PARAM.input.nspin = 1; - std::vector> kvec_d_in(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - hamilt::HS_Matrix_K hsk(paraV, true); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - // reset HR and DMR - const double factor = 1.0 / test_nw / test_nw / test_size / test_size; - for (int i = 0; i < DMR->get_nnr(); i++) - { - DMR->get_wrapper()[i] = factor; - HR->get_wrapper()[i] = 0.0; - } - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - hamilt::DFTU> - op(&hsk, kvec_d_in, HR, ucell, &gd, &intor_, {1.0}, &GlobalC::dftu); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now(); - op.contributeHR(); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 - = std::chrono::duration_cast>(end_time - start_time); - // check the occupations of dftu - for (int iat = 0; iat < test_size; iat++) - { - for (int icc = 0; icc < 25; icc++) - { - EXPECT_NEAR(GlobalC::dftu.locale[iat][2][0][0].c[icc], 0.5, 1e-10); - } - } - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_NEAR(tmp.get_pointer(0)[i], -10.0 * test_size, 1e-10); - } - } - // calculate SK - start_time = std::chrono::high_resolution_clock::now(); - op.contributeHk(0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 - = std::chrono::duration_cast>(end_time - start_time); - // check the value of HK - double* hk = hsk.get_hk(); - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_NEAR(hk[i], -10.0 * test_size, 1e-10); - } - std::cout << "Test terms: " << std::setw(15) << "initialize_HR" << std::setw(15) << "contributeHR" - << std::setw(15) << "contributeHk" << std::endl; - std::cout << "Elapsed time: " << std::setw(15) << elapsed_time.count() << std::setw(15) << elapsed_time1.count() - << std::setw(15) << elapsed_time2.count() << " seconds." << std::endl; -} - -TEST_F(DFTUTest, constructHRd2cd) -{ - // test for nspin=2 - PARAM.input.nspin = 2; - std::vector> kvec_d_in(2, ModuleBase::Vector3(0.0, 0.0, 0.0)); - hamilt::HS_Matrix_K> hsk(paraV, true); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - // reset HR and DMR - const double factor = 0.5 / test_nw / test_nw / test_size / test_size; - for (int i = 0; i < DMR->get_nnr(); i++) - { - DMR->get_wrapper()[i] = factor; - HR->get_wrapper()[i] = 0.0; - } - hamilt::DFTU, double>> - op(&hsk, kvec_d_in, HR, ucell, &gd, &intor_, {1.0}, &GlobalC::dftu); - op.contributeHR(); - // check the occupations of dftu for spin-up - for (int iat = 0; iat < test_size; iat++) - { - for (int icc = 0; icc < 25; icc++) - { - EXPECT_NEAR(GlobalC::dftu.locale[iat][2][0][0].c[icc], 0.5, 1e-10); - } - } - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_NEAR(tmp.get_pointer(0)[i], -10.0 * test_size, 1e-10); - } - } - // calculate HK for gamma point - op.contributeHk(0); - // check the value of HK of gamma point - std::complex* hk = hsk.get_hk(); - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_NEAR(hk[i].real(), -10.0 * test_size, 1e-10); - EXPECT_NEAR(hk[i].imag(), 0.0, 1e-10); - } - // calculate spin-down hamiltonian - op.contributeHR(); - // check the occupations of dftu for spin-down - for (int iat = 0; iat < test_size; iat++) - { - for (int icc = 0; icc < 25; icc++) - { - EXPECT_NEAR(GlobalC::dftu.locale[iat][2][0][1].c[icc], 0.5, 1e-10); - } - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_ekineticnew.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_ekineticnew.cpp deleted file mode 100644 index dd81b95464..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_ekineticnew.cpp +++ /dev/null @@ -1,202 +0,0 @@ -#include "../ekinetic_new.h" - -#include "gtest/gtest.h" - -//--------------------------------------- -// Unit test of EkineticNew class -// EkineticNew is a derivative class of Operator, it is used to calculate the kinetic matrix -// It use HContainer to store the real space HR matrix -// In this test, we test the correctness and time consuming of 3 functions in EkineticNew class -// - initialize_HR() called in constructor -// - contributeHR() -// - contributeHk() -// - HR(double) and SK(complex) are tested in constructHRd2cd -// - HR(double) and SK(double) are tested in constructHRd2d -//--------------------------------------- - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 10; -class EkineticNewTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.atoms[0].tau.resize(ucell.nat); - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.atoms[0].tau[iat] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.atoms[0].iw2l.resize(test_nw); - ucell.atoms[0].iw2m.resize(test_nw); - ucell.atoms[0].iw2n.resize(test_nw); - for (int iw = 0; iw < test_nw; ++iw) - { - ucell.atoms[0].iw2l[iw] = 0; - ucell.atoms[0].iw2m[iw] = 0; - ucell.atoms[0].iw2n[iw] = 0; - } - ucell.set_iat2iwt(1); - init_parav(); - // set up a HContainer with ucell - HR = new hamilt::HContainer(paraV); - } - - void TearDown() override - { - delete HR; - delete paraV; - delete[] ucell.atoms; - } - -#ifdef __MPI - void init_parav() - { - int nb = 10; - int global_row = test_size * test_nw; - int global_col = test_size * test_nw; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - { - } -#endif - - UnitCell ucell; - hamilt::HContainer* HR; - Parallel_Orbitals* paraV; - TwoCenterIntegrator intor_; - - int dsize; - int my_rank = 0; -}; - -// using TEST_F to test EkineticNew -TEST_F(EkineticNewTest, constructHRd2d) -{ - std::vector> kvec_d_in(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - hamilt::HS_Matrix_K hsk(paraV, true); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - hamilt::EkineticNew> - op(&hsk, kvec_d_in, HR, &ucell, {1.0}, &gd, &intor_); - op.contributeHR(); - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 1.0); - } - } - // calculate HK - op.contributeHk(0); - // check the value of HK - double* hk = hsk.get_hk(); - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_EQ(hk[i], 1.0); - } - // calculate HR again - op.contributeHR(); - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 2.0); - } - } -} - -TEST_F(EkineticNewTest, constructHRd2cd) -{ - std::vector> kvec_d_in(2, ModuleBase::Vector3(0.0, 0.0, 0.0)); - kvec_d_in[1] = ModuleBase::Vector3(0.1, 0.2, 0.3); - hamilt::HS_Matrix_K> hsk(paraV, true); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - hamilt::EkineticNew, double>> - op(&hsk, kvec_d_in, HR, &ucell, {1.0}, &gd, &intor_); - op.contributeHR(); - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 1.0); - } - } - // calculate HK for gamma point - op.contributeHk(0); - auto* hk = hsk.get_hk(); - // check the value of HK of gamma point - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_EQ(hk[i].real(), 1.0); - EXPECT_EQ(hk[i].imag(), 0.0); - } - // calculate HK for k point - hsk.set_zero_hk(); - op.contributeHk(1); - // check the value of HK - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_NEAR(hk[i].real(), -1.6180339887498945 / 2, 1e-10); - EXPECT_NEAR(hk[i].imag(), -1.1755705045849467 / 2, 1e-10); - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_nonlocalnew.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_nonlocalnew.cpp deleted file mode 100644 index e137f7ac73..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_nonlocalnew.cpp +++ /dev/null @@ -1,250 +0,0 @@ -#include "../nonlocal_new.h" - -#include "gtest/gtest.h" -#include - -//--------------------------------------- -// Unit test of NonlocalNew class -// NonlocalNew is a derivative class of Operator, it is used to calculate the kinetic matrix -// It use HContainer to store the real space HR matrix -// In this test, we test the correctness and time consuming of 3 functions in NonlocalNew class -// - initialize_HR() called in constructor -// - contributeHR() -// - contributeHk() -// - HR(double) and SK(complex) are tested in constructHRd2cd -// - HR(double) and SK(double) are tested in constructHRd2d -//--------------------------------------- - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 10; -class NonlocalNewTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.infoNL.Beta = new Numerical_Nonlocal[ucell.ntype]; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.atoms[0].tau.resize(ucell.nat); - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.atoms[0].tau[iat] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.atoms[0].iw2l.resize(test_nw); - ucell.atoms[0].iw2m.resize(test_nw); - ucell.atoms[0].iw2n.resize(test_nw); - for (int iw = 0; iw < test_nw; ++iw) - { - ucell.atoms[0].iw2l[iw] = 0; - ucell.atoms[0].iw2m[iw] = 0; - ucell.atoms[0].iw2n[iw] = 0; - } - ucell.atoms[0].ncpp.d_real.create(5, 5); - ucell.atoms[0].ncpp.d_real.zero_out(); - ucell.atoms[0].ncpp.d_so.create(4, 5, 5); - ucell.atoms[0].ncpp.d_so.zero_out(); - ucell.atoms[0].ncpp.non_zero_count_soc[0] = 5; - ucell.atoms[0].ncpp.non_zero_count_soc[1] = 0; - ucell.atoms[0].ncpp.non_zero_count_soc[2] = 0; - ucell.atoms[0].ncpp.non_zero_count_soc[3] = 5; - ucell.atoms[0].ncpp.index1_soc[0] = std::vector(5, 0); - ucell.atoms[0].ncpp.index2_soc[0] = std::vector(5, 0); - ucell.atoms[0].ncpp.index1_soc[3] = std::vector(5, 0); - ucell.atoms[0].ncpp.index2_soc[3] = std::vector(5, 0); - for (int i = 0; i < 5; ++i) - { - ucell.atoms[0].ncpp.d_real(i, i) = 1.0; - ucell.atoms[0].ncpp.d_so(0, i, i) = std::complex(2.0, 0.0); - ucell.atoms[0].ncpp.d_so(3, i, i) = std::complex(2.0, 0.0); - ucell.atoms[0].ncpp.index1_soc[0][i] = i; - ucell.atoms[0].ncpp.index2_soc[0][i] = i; - ucell.atoms[0].ncpp.index1_soc[3][i] = i; - ucell.atoms[0].ncpp.index2_soc[3][i] = i; - } - ucell.set_iat2iwt(1); - init_parav(); - // set up a HContainer with ucell - HR = new hamilt::HContainer(paraV); - } - - void TearDown() override - { - delete HR; - delete paraV; - delete[] ucell.atoms; - delete[] ucell.infoNL.Beta; - } - -#ifdef __MPI - void init_parav() - { - int nb = 10; - int global_row = test_size * test_nw; - int global_col = test_size * test_nw; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - { - } -#endif - - UnitCell ucell; - hamilt::HContainer* HR; - Parallel_Orbitals* paraV; - TwoCenterIntegrator intor_; - - int dsize; - int my_rank = 0; -}; - -// using TEST_F to test NonlocalNew -TEST_F(NonlocalNewTest, constructHRd2d) -{ - std::vector> kvec_d_in(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - hamilt::HS_Matrix_K hsk(paraV, true); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - // check some input values - EXPECT_EQ(ucell.infoNL.Beta[0].get_rcut_max(), 1.0); - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - hamilt::NonlocalNew> - op(&hsk, kvec_d_in, HR, &ucell, {1.0}, &gd, &intor_); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now(); - op.contributeHR(); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 - = std::chrono::duration_cast>(end_time - start_time); - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 5.0 * test_size); - } - } - // calculate SK - start_time = std::chrono::high_resolution_clock::now(); - op.contributeHk(0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 - = std::chrono::duration_cast>(end_time - start_time); - // check the value of HK - double* hk = hsk.get_hk(); - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_EQ(hk[i], 5.0 * test_size); - } - // calculate HR again - start_time = std::chrono::high_resolution_clock::now(); - op.contributeHR(); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time3 - = std::chrono::duration_cast>(end_time - start_time); - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 10.0 * test_size); - } - } - std::cout << "Test terms: " << std::setw(15) << "initialize_HR" << std::setw(15) << "contributeHR" - << std::setw(15) << "contributeHk" << std::setw(15) << "2nd-calHR" << std::endl; - std::cout << "Elapsed time: " << std::setw(15) << elapsed_time.count() << std::setw(15) << elapsed_time1.count() - << std::setw(15) << elapsed_time2.count() << std::setw(15) << elapsed_time3.count() << " seconds." - << std::endl; -} - -TEST_F(NonlocalNewTest, constructHRd2cd) -{ - std::vector> kvec_d_in(2, ModuleBase::Vector3(0.0, 0.0, 0.0)); - kvec_d_in[1] = ModuleBase::Vector3(0.1, 0.2, 0.3); - hamilt::HS_Matrix_K> hsk(paraV); - hsk.set_zero_hk(); - Grid_Driver gd(0, 0); - hamilt::NonlocalNew, double>> - op(&hsk, kvec_d_in, HR, &ucell, {1.0}, &gd, &intor_); - op.contributeHR(); - // check the value of HR - for (int iap = 0; iap < HR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = HR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 5.0 * test_size); - } - } - // calculate HK for gamma point - op.contributeHk(0); - // check the value of HK of gamma point - auto* hk = hsk.get_hk(); - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_EQ(hk[i].real(), 5.0 * test_size); - EXPECT_EQ(hk[i].imag(), 0.0); - } - // calculate HK for k point - hsk.set_zero_hk(); - op.contributeHk(1); - // check the value of HK - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_NEAR(hk[i].real(), 5.0 * test_size, 1e-10); - EXPECT_NEAR(hk[i].imag(), 0.0, 1e-10); - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew.cpp deleted file mode 100644 index 19d5e57737..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "../overlap_new.h" - -#include "gtest/gtest.h" - -//--------------------------------------- -// Unit test of OverlapNew class -// OverlapNew is a derivative class of Operator, it is used to calculate the overlap matrix -// It use HContainer to store the real space SR matrix -// In this test, we test the correctness and time consuming of 3 functions in OverlapNew class -// - initialize_SR() called in constructor -// - contributeHR() -// - contributeHk() -// - SR(double) and SK(complex) are tested in constructHRd2cd -// - SR(double) and SK(double) are tested in constructHRd2d -//--------------------------------------- - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 10; -class OverlapNewTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.atoms[0].tau.resize(ucell.nat); - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.atoms[0].tau[iat] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.atoms[0].iw2l.resize(test_nw); - ucell.atoms[0].iw2m.resize(test_nw); - ucell.atoms[0].iw2n.resize(test_nw); - for (int iw = 0; iw < test_nw; ++iw) - { - ucell.atoms[0].iw2l[iw] = 0; - ucell.atoms[0].iw2m[iw] = 0; - ucell.atoms[0].iw2n[iw] = 0; - } - ucell.set_iat2iwt(1); - init_parav(); - // set up a HContainer with ucell - SR = new hamilt::HContainer(paraV); - } - - void TearDown() override - { - delete SR; - delete paraV; - delete[] ucell.atoms; - } - -#ifdef __MPI - void init_parav() - { - int nb = 10; - int global_row = test_size * test_nw; - int global_col = test_size * test_nw; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - { - } -#endif - - UnitCell ucell; - hamilt::HContainer* SR; - Parallel_Orbitals* paraV; - TwoCenterIntegrator intor_; - - int dsize; - int my_rank = 0; -}; - -// using TEST_F to test OverlapNew -TEST_F(OverlapNewTest, constructHRd2d) -{ - std::vector> kvec_d_in(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - hamilt::HS_Matrix_K hsk(paraV); - hsk.set_zero_sk(); - Grid_Driver gd(0, 0); - hamilt::OverlapNew> - op(&hsk, kvec_d_in, nullptr, SR, &ucell, {1.0}, &gd, &intor_); - op.contributeHR(); - // check the value of SR - for (int iap = 0; iap < SR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = SR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 1.0); - } - } - // calculate SK - op.contributeHk(0); - // check the value of SK - double* sk = hsk.get_sk(); - for (int i = 0; i < hsk.get_size(); ++i) - { - EXPECT_EQ(sk[i], 1.0); - } -} - -TEST_F(OverlapNewTest, constructHRd2cd) -{ - std::vector> kvec_d_in(2, ModuleBase::Vector3(0.0, 0.0, 0.0)); - kvec_d_in[1] = ModuleBase::Vector3(0.1, 0.2, 0.3); - hamilt::HS_Matrix_K> hsk(paraV); - hsk.set_zero_sk(); - Grid_Driver gd(0, 0); - hamilt::OverlapNew, double>> - op(&hsk, kvec_d_in, nullptr, SR, &ucell, {1.0}, &gd, &intor_); - op.contributeHR(); - // check the value of SR - for (int iap = 0; iap < SR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = SR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int nwt = indexes1.size() * indexes2.size(); - for (int i = 0; i < nwt; ++i) - { - EXPECT_EQ(tmp.get_pointer(0)[i], 1.0); - } - } - // calculate SK for gamma point - op.contributeHk(0); - // check the value of SK of gamma point - auto* sk = hsk.get_sk(); - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_EQ(sk[i].real(), 1.0); - EXPECT_EQ(sk[i].imag(), 0.0); - } - // calculate SK for k point - hsk.set_zero_sk(); - op.contributeHk(1); - // check the value of SK - for (int i = 0; i < paraV->get_row_size() * paraV->get_col_size(); ++i) - { - EXPECT_NEAR(sk[i].real(), -0.80901699437494723, 1e-10); - EXPECT_NEAR(sk[i].imag(), -0.58778525229247336, 1e-10); - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew_cd.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew_cd.cpp deleted file mode 100644 index d29c0cd840..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/test_overlapnew_cd.cpp +++ /dev/null @@ -1,191 +0,0 @@ -#include "../overlap_new.h" - -#include "gtest/gtest.h" - -//--------------------------------------- -// Unit test of OverlapNew class -// OverlapNew is a derivative class of Operator, it is used to calculate the overlap matrix -// It use HContainer to store the real space SR matrix -// In this test, we test the correctness and time consuming of 3 functions in OverlapNew class -// - initialize_SR() called in constructor -// - contributeHR() -// - contributeHk() -// - SR(complex) and SK(complex) are tested in constructHRd2d -//--------------------------------------- - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 10; -class OverlapNewTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.atoms[0].tau.resize(ucell.nat); - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.atoms[0].tau[iat] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.atoms[0].iw2l.resize(test_nw); - ucell.atoms[0].iw2m.resize(test_nw); - ucell.atoms[0].iw2n.resize(test_nw); - for (int iw = 0; iw < test_nw; ++iw) - { - ucell.atoms[0].iw2l[iw] = 0; - ucell.atoms[0].iw2m[iw] = 0; - ucell.atoms[0].iw2n[iw] = 0; - } - ucell.set_iat2iwt(2); - init_parav(); - // set up a HContainer with ucell - SR = new hamilt::HContainer>(paraV); - } - - void TearDown() override - { - delete SR; - delete paraV; - delete[] ucell.atoms; - } - -#ifdef __MPI - void init_parav() - { - int nb = 10; - int global_row = test_size * test_nw * 2; - int global_col = test_size * test_nw * 2; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - { - } -#endif - - UnitCell ucell; - hamilt::HContainer>* SR; - Parallel_Orbitals* paraV; - TwoCenterIntegrator intor_; - - int dsize; - int my_rank = 0; -}; - -TEST_F(OverlapNewTest, constructHRcd2cd) -{ - int npol = ucell.get_npol(); - std::vector> kvec_d_in(2, ModuleBase::Vector3(0.0, 0.0, 0.0)); - kvec_d_in[1] = ModuleBase::Vector3(0.1, 0.2, 0.3); - hamilt::HS_Matrix_K> hsk(paraV); - hsk.set_zero_sk(); - Grid_Driver gd(0, 0); - hamilt::OverlapNew, std::complex>> - op(&hsk, kvec_d_in, nullptr, SR, &ucell, {1.0}, &gd, &intor_); - op.contributeHR(); - // check the value of SR - for (int iap = 0; iap < SR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair>& tmp = SR->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - auto indexes1 = paraV->get_indexes_row(iat1); - auto indexes2 = paraV->get_indexes_col(iat2); - int i = 0; - for (int mu = 0; mu < indexes1.size(); ++mu) - { - for (int nu = 0; nu < indexes2.size(); ++nu) - { - if (mu % npol == nu % npol) - { - EXPECT_EQ(tmp.get_pointer(0)[i].real(), 1.0); - EXPECT_EQ(tmp.get_pointer(0)[i].imag(), 0.0); - } - else - { - EXPECT_EQ(tmp.get_pointer(0)[i].real(), 0.0); - EXPECT_EQ(tmp.get_pointer(0)[i].imag(), 0.0); - } - ++i; - } - } - } - // calculate SK for gamma point - op.contributeHk(0); - // check the value of SK of gamma point - auto* sk = hsk.get_sk(); - int i = 0; - for (int irow = 0; irow < paraV->get_row_size(); ++irow) - { - for (int icol = 0; icol < paraV->get_col_size(); ++icol) - { - if (irow % npol == icol % npol) - { - EXPECT_NEAR(sk[i].real(), 1.0, 1e-10); - EXPECT_NEAR(sk[i].imag(), 0.0, 1e-10); - } - else - { - EXPECT_NEAR(sk[i].real(), 0.0, 1e-10); - EXPECT_NEAR(sk[i].imag(), 0.0, 1e-10); - } - ++i; - } - } - // calculate SK for k point - hsk.set_zero_sk(); - op.contributeHk(1); - // check the value of SK - i = 0; - for (int irow = 0; irow < paraV->get_row_size(); ++irow) - { - for (int icol = 0; icol < paraV->get_col_size(); ++icol) - { - if (irow % npol == icol % npol) - { - EXPECT_NEAR(sk[i].real(), -0.80901699437494723, 1e-10); - EXPECT_NEAR(sk[i].imag(), -0.58778525229247336, 1e-10); - } - else - { - EXPECT_NEAR(sk[i].real(), 0.0, 1e-10); - EXPECT_NEAR(sk[i].imag(), 0.0, 1e-10); - } - ++i; - } - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp deleted file mode 100644 index 05947873c7..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/test/tmp_mocks.cpp +++ /dev/null @@ -1,206 +0,0 @@ - -#include "source_cell/unitcell.h" - -// constructor of Atom -Atom::Atom() {} -Atom::~Atom() {} - -Atom_pseudo::Atom_pseudo() {} -Atom_pseudo::~Atom_pseudo() {} - -Magnetism::Magnetism() {} -Magnetism::~Magnetism() {} - -InfoNonlocal::InfoNonlocal() {} -InfoNonlocal::~InfoNonlocal() {} - -pseudo::pseudo() {} -pseudo::~pseudo() {} - -// constructor of UnitCell -UnitCell::UnitCell() {} -UnitCell::~UnitCell() {} - -void UnitCell::set_iat2iwt(const int& npol_in) { - this->iat2iwt.resize(this->nat); - this->npol = npol_in; - int iat = 0; - int iwt = 0; - for (int it = 0; it < this->ntype; it++) { - for (int ia = 0; ia < atoms[it].na; ia++) { - this->iat2iwt[iat] = iwt; - iwt += atoms[it].nw * this->npol; - ++iat; - } - } - return; -} - -// mock of OperatorLCAO -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" - -/* template -hamilt::Operator::Operator(){} - -template -hamilt::Operator::~Operator(){} - -template -typename hamilt::Operator::hpsi_info hamilt::Operator::hPsi(hpsi_info&) const -{ - return hpsi_info(nullptr, 0, nullptr); -} - -template -void hamilt::Operator::init(const int ik_in) -{ - return; -} - -template -void hamilt::Operator::add(Operator* next) -{ - return; -} - -template -FPTYPE* hamilt::Operator::get_hpsi(const hpsi_info& info) const -{ - return nullptr; -} - -template class hamilt::Operator; -template class hamilt::Operator, -base_device::DEVICE_CPU>;*/ - -// mock of OperatorLCAO -template -void hamilt::OperatorLCAO::init(const int ik_in) { - if (!this->hr_done) { - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - this->hr_done = true; - } - this->contributeHk(ik_in); - return; -} -template -void hamilt::OperatorLCAO::contributeHk(int ik) { - if (!this->is_first_node) { - return; - } else { - const int ncol = this->hR->get_atom_pair(0).get_paraV()->get_col_size(); - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } -} -template -void hamilt::OperatorLCAO::get_hs_pointers() { - return; -} -template class hamilt::OperatorLCAO; -template class hamilt::OperatorLCAO, double>; -template class hamilt::OperatorLCAO, std::complex>; - -// mock of TwoCenterIntegrator and LCAO_Orbitals -#include "source_basis/module_nao/two_center_integrator.h" -TwoCenterIntegrator::TwoCenterIntegrator() {} - -void TwoCenterIntegrator::tabulate(const RadialCollection& bra, - const RadialCollection& ket, - const char op, - const int nr, - const double cutoff) {} - -void TwoCenterIntegrator::calculate( - const int itype1, - const int l1, - const int izeta1, - const int m1, - const int itype2, - const int l2, - const int izeta2, - const int m2, - const ModuleBase::Vector3& vR, // vR = R2 - R1 - double* out, - double* grad_out) const { - out[0] = 1.0; -} - -void TwoCenterIntegrator::snap( - const int itype1, - const int l1, - const int izeta1, - const int m1, - const int itype2, - const ModuleBase::Vector3& vR, // vR = R2 - R1 - const bool deriv, - std::vector>& out) const { - out.resize(1); - for (int i = 0; i < out.size(); ++i) { - out[i].resize(5, 1.0); - } -} - -#include "source_basis/module_ao/ORB_read.h" -LCAO_Orbitals::LCAO_Orbitals() { this->Phi = new Numerical_Orbital[1]; } -LCAO_Orbitals::~LCAO_Orbitals() { delete[] Phi; } - -#include "source_cell/module_neighbor/sltk_grid_driver.h" -// mock find_atom() function -void Grid_Driver::Find_atom(const UnitCell& ucell, - const ModuleBase::Vector3& tau, - const int& T, - const int& I, - AdjacentAtomInfo* adjs) const -{ - adjs->adj_num = ucell.nat - 1; - adjs->adjacent_tau.resize(ucell.nat); - adjs->ntype.resize(ucell.nat, 0); - adjs->natom.resize(ucell.nat); - adjs->box.resize(ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) { - adjs->natom[iat] = iat; - adjs->box[iat].x = 1; - adjs->box[iat].y = 1; - adjs->box[iat].z = 1; - adjs->adjacent_tau[iat] = ucell.get_tau(iat); - } -} -Grid::Grid(const int& test_grid_in) : test_grid(test_grid_in) {} -Grid::~Grid() {} -Grid_Driver::Grid_Driver(const int& test_d_in, - const int& test_grid_in) - : Grid(test_grid_in), test_deconstructor(test_d_in) { -} -Grid_Driver::~Grid_Driver() {} - -// filter_adjs delete not adjacent atoms in adjs -void filter_adjs(const std::vector& is_adj, AdjacentAtomInfo& adjs) { - const int size = adjs.adj_num + 1; - for (int i = size - 1; i >= 0; --i) { - if (!is_adj[i]) { - adjs.adj_num--; - adjs.ntype.erase(adjs.ntype.begin() + i); - adjs.natom.erase(adjs.natom.begin() + i); - adjs.adjacent_tau.erase(adjs.adjacent_tau.begin() + i); - adjs.box.erase(adjs.box.begin() + i); - } - } -} - -Numerical_Nonlocal::Numerical_Nonlocal() { this->rcut_max = 1.0; } -Numerical_Nonlocal::~Numerical_Nonlocal() {} - -Numerical_Orbital::Numerical_Orbital() { this->rcut = 1.0; } -Numerical_Orbital::~Numerical_Orbital() {} - -void Numerical_Orbital::set_orbital_info(const int&, - const std::string&, - const int&, - const int*, - const int&) {} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp deleted file mode 100644 index 6253b1dcf4..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp +++ /dev/null @@ -1,211 +0,0 @@ -#include "veff_lcao.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "source_base/tool_title.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_interface.h" -namespace hamilt -{ - - -// initialize_HR() -template -void Veff>::initialize_HR(const UnitCell* ucell_in, const Grid_Driver* GridD) -{ - ModuleBase::TITLE("Veff", "initialize_HR"); - ModuleBase::timer::tick("Veff", "initialize_HR"); - - this->nspin = PARAM.inp.nspin; - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - for (int iat1 = 0; iat1 < ucell_in->nat; iat1++) - { - auto tau1 = ucell_in->get_tau(iat1); - int T1, I1; - ucell_in->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell_in, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell_in->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (ucell_in->cal_dtau(iat1, iat2, R_index2).norm() * ucell_in->lat0 - < orb_cutoff_[T1] + orb_cutoff_[T2]) - { - hamilt::AtomPair tmp(iat1, iat2, R_index2, paraV); - this->hR->insert_pair(tmp); - } - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - this->hR->allocate(nullptr, true); - - ModuleBase::timer::tick("Veff", "initialize_HR"); -} - -template<> -void Veff>::contributeHR() -{ - ModuleBase::TITLE("Veff", "contributeHR"); - ModuleBase::timer::tick("Veff", "contributeHR"); - //----------------------------------------- - //(1) prepare data for this k point. - // copy the local potential from array. - //----------------------------------------- - double* vr_eff1 = this->pot->get_effective_v(this->current_spin); - double* vofk_eff1 = this->pot->get_effective_vofk(this->current_spin); - -#ifdef __OLD_GINT - if(XC_Functional::get_ked_flag()) - { - Gint_inout inout(vr_eff1, vofk_eff1, Gint_Tools::job_type::vlocal_meta); - this->GG->cal_vlocal(&inout, this->new_e_iteration); - } - else - { - Gint_inout inout(vr_eff1, Gint_Tools::job_type::vlocal); - this->GG->cal_vlocal(&inout, this->new_e_iteration); - } - this->GG->transfer_pvpR(this->hR,this->ucell); - this->new_e_iteration = false; -#else - if(XC_Functional::get_ked_flag()) - { - ModuleGint::cal_gint_vl_metagga(vr_eff1, vofk_eff1, this->hR); - } - else - { - ModuleGint::cal_gint_vl(vr_eff1, this->hR); - } -#endif - - if(this->nspin == 2) - { - this->current_spin = 1 - this->current_spin; - } - - ModuleBase::timer::tick("Veff", "contributeHR"); - return; -} - -template<> -void Veff, double>>::contributeHR() -{ - ModuleBase::TITLE("Veff", "contributeHR"); - ModuleBase::timer::tick("Veff", "contributeHR"); - //----------------------------------------- - //(1) prepare data for this k point. - // copy the local potential from array. - //----------------------------------------- - double* vr_eff1 = this->pot->get_effective_v(this->current_spin); - double* vofk_eff1 = this->pot->get_effective_vofk(this->current_spin); - -#ifdef __OLD_GINT - // if you change the place of the following code, - // rememeber to delete the #include - if(XC_Functional::get_ked_flag()) - { - Gint_inout inout(vr_eff1, vofk_eff1, 0, Gint_Tools::job_type::vlocal_meta); - this->GK->cal_gint(&inout); - } - else - { - // vlocal = Vh[rho] + Vxc[rho] + Vl(pseudo) - Gint_inout inout(vr_eff1, 0, Gint_Tools::job_type::vlocal); - this->GK->cal_gint(&inout); - } - - this->GK->transfer_pvpR(this->hR,this->ucell,this->gd); -#else - if(XC_Functional::get_ked_flag()) - { - ModuleGint::cal_gint_vl_metagga(vr_eff1, vofk_eff1, this->hR); - } - else - { - ModuleGint::cal_gint_vl(vr_eff1, this->hR); - } -#endif - - if(this->nspin == 2) - { - this->current_spin = 1 - this->current_spin; - } - - ModuleBase::timer::tick("Veff", "contributeHR"); - return; -} - -template<> -void Veff, std::complex>>::contributeHR() -{ - ModuleBase::TITLE("Veff", "contributeHR"); - ModuleBase::timer::tick("Veff", "contributeHR"); - -#ifdef __OLD_GINT - double* vr_eff1 = nullptr; - double* vofk_eff1 = nullptr; - for (int is = 0; is < 4; is++) - { - vr_eff1 = this->pot->get_effective_v(is); - if(XC_Functional::get_ked_flag()) - { - vofk_eff1 = this->pot->get_effective_vofk(is); - } - - if(XC_Functional::get_ked_flag()) - { - Gint_inout inout(vr_eff1, vofk_eff1, is, Gint_Tools::job_type::vlocal_meta); - this->GK->cal_gint(&inout); - } - else - { - Gint_inout inout(vr_eff1, is, Gint_Tools::job_type::vlocal); - this->GK->cal_gint(&inout); - } - } - this->GK->transfer_pvpR(this->hR,this->ucell,this->gd); -#else - std::vector vr_eff(4, nullptr); - std::vector vofk_eff(4, nullptr); - for (int is = 0; is < 4; is++) - { - vr_eff[is] = this->pot->get_effective_v(is); - if(XC_Functional::get_ked_flag()) - { - vofk_eff[is] = this->pot->get_effective_vofk(is); - } - } - if(XC_Functional::get_ked_flag()) - { - ModuleGint::cal_gint_vl_metagga(vr_eff, vofk_eff, this->hR); - } else - { - ModuleGint::cal_gint_vl(vr_eff, this->hR); - } -#endif - - ModuleBase::timer::tick("Veff", "contributeHR"); - return; -} - -// definition of class template should in the end of file to avoid compiling warning -template class Veff>; - -template class Veff, double>>; - -template class Veff, std::complex>>; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h b/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h deleted file mode 100644 index 8f456695ce..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef VEFFLCAO_H -#define VEFFLCAO_H -#include "source_base/timer.h" -#include "source_estate/module_pot/potential_new.h" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "operator_lcao.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include - -namespace hamilt -{ - -#ifndef __VEFFTEMPLATE -#define __VEFFTEMPLATE - -template -class Veff : public T -{ -}; - -#endif - -/// @brief Effective potential class, used for calculating Hamiltonian with grid integration tools -/// If user want to separate the contribution of V_{eff} into V_{H} and V_{XC} and V_{local pseudopotential} and so on, -/// the user can separate the Potential class into different parts, and construct different Veff class for each part. -/// @tparam TK -/// @tparam TR -template -class Veff> : public OperatorLCAO -{ - public: - /** - * @brief Construct a new Veff object for multi-kpoint calculation - * @param GK_in: the pointer of Gint_k object, used for grid integration - */ - Veff>(Gint_k* GK_in, - HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - elecstate::Potential* pot_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const int& nspin) - : GK(GK_in), orb_cutoff_(orb_cutoff), pot(pot_in), ucell(ucell_in), - gd(GridD_in), OperatorLCAO(hsk_in, kvec_d_in, hR_in) - { - this->cal_type = calculation_type::lcao_gint; - - this->initialize_HR(ucell_in, GridD_in); -#ifdef __OLD_GINT - GK_in->initialize_pvpR(*ucell_in, GridD_in, nspin); -#endif - } - /** - * @brief Construct a new Veff object for Gamma-only calculation - * @param GG_in: the pointer of Gint_Gamma object, used for grid integration - */ - Veff>(Gint_Gamma* GG_in, - HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - elecstate::Potential* pot_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const int& nspin) - : GG(GG_in), orb_cutoff_(orb_cutoff), pot(pot_in), OperatorLCAO(hsk_in, kvec_d_in, hR_in) - { - this->cal_type = calculation_type::lcao_gint; - this->initialize_HR(ucell_in, GridD_in); -#ifdef __OLD_GINT - GG_in->initialize_pvpR(*ucell_in, GridD_in, nspin); -#endif - } - - ~Veff>(){}; - - /** - * @brief contributeHR() is used to calculate the HR matrix - * - * the contribution of V_{eff} is calculated by the contribution of V_{H} and V_{XC} and V_{local pseudopotential} and so on. - * grid integration is used to calculate the contribution Hamiltonian of effective potential - */ - virtual void contributeHR() override; - - const UnitCell* ucell; - const Grid_Driver* gd; - -private: - // used for k-dependent grid integration. - Gint_k* GK = nullptr; - - // used for gamma only algorithms. - Gint_Gamma* GG = nullptr; - - std::vector orb_cutoff_; - - // Charge calculating method in LCAO base and contained grid base calculation: DM_R, DM, pvpR_reduced - - elecstate::Potential* pot = nullptr; - - int nspin = 1; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the electronic kinetic matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const UnitCell* ucell_in, const Grid_Driver* GridD_in); -}; - -} // namespace hamilt -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress.h b/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress.h deleted file mode 100644 index 2822106b53..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress.h +++ /dev/null @@ -1,69 +0,0 @@ -#pragma once -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "source_estate/module_pot/potential_new.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/stress_tools.h" -#ifndef TGINT_H -#define TGINT_H -template -struct TGint; -template <> struct TGint { using type = Gint_Gamma; }; -template <> struct TGint> { using type = Gint_k; }; -#endif - -/// calculate the abstract formulas: -/// $Tr[D*dH/dx]$ (force) and $1/V Tr[D*(dH/dx_a*x_b)]$ (stress) -/// where D can be any (energy) density matrix -/// and H can be any operator -namespace PulayForceStress -{ - /// for 2-center-integration terms, provided force and stress derivatives - template - void cal_pulay_fs( - ModuleBase::matrix& f, ///< [out] force - ModuleBase::matrix& s, ///< [out] stress - const elecstate::DensityMatrix& dm, ///< [in] density matrix or energy density matrix - const UnitCell& ucell, ///< [in] unit cell - const Parallel_Orbitals& pv, ///< [in] parallel orbitals - const double* (&dHSx)[3], ///< [in] dHSx x, y, z, for force - const double* (&dHSxy)[6], ///< [in] dHSxy 11, 12, 13, 22, 23, 33, for stress - const bool& isforce, - const bool& isstress, - Record_adj* ra = nullptr, - const double& factor_force = 1.0, - const double& factor_stress = 1.0); - - /// for 2-center-integration terms, provided force derivatives and coordinate difference - template - void cal_pulay_fs( - ModuleBase::matrix& f, ///< [out] force - ModuleBase::matrix& s, ///< [out] stress - const elecstate::DensityMatrix& dm, ///< [in] density matrix or energy density matrix - const UnitCell& ucell, ///< [in] unit cell - const Parallel_Orbitals& pv, ///< [in] parallel orbitals - const double* (&dHSx)[3], ///< [in] dHSx x, y, z, for force and stress - const double* dtau, ///< [in] dr x, y, z, for stress - const bool& isforce, - const bool& isstress, - Record_adj* ra = nullptr, - const double& factor_force = 1.0, - const double& factor_stress = 1.0); - - /// for grid-integration terms - template - void cal_pulay_fs( - ModuleBase::matrix& f, ///< [out] force - ModuleBase::matrix& s, ///< [out] stress - const elecstate::DensityMatrix& dm, ///< [in] density matrix or energy density matrix - const UnitCell& ucell, ///< [in] unit cell - const elecstate::Potential* pot, ///< [in] potential on grid - typename TGint::type& gint, ///< [in] Gint object - const bool& isforce, - const bool& isstress, - const bool& set_dmr_gint = true); -} -#include "pulay_force_stress_center2_template.hpp" -#include "pulay_force_stress_gint.hpp" \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2.cpp deleted file mode 100644 index 37f75cd5f0..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include "pulay_force_stress.h" -namespace PulayForceStress -{ - template<> // gamma-only, provided xy - void cal_pulay_fs( - ModuleBase::matrix& f, - ModuleBase::matrix& s, - const elecstate::DensityMatrix& dm, - const UnitCell& ucell, - const Parallel_Orbitals& pv, - const double* (&dHSx)[3], - const double* (&dHSxy)[6], - const bool& isforce, - const bool& isstress, - Record_adj* ra, - const double& factor_force, - const double& factor_stress) - { - ModuleBase::TITLE("Forces", "cal_pulay"); - ModuleBase::timer::tick("Forces", "cal_pulay"); - - const int nspin = PARAM.inp.nspin; - const int nlocal = PARAM.globalv.nlocal; - - for (int i = 0; i < nlocal; ++i) - { - const int iat = ucell.iwt2iat[i]; - for (int j = 0; j < nlocal; ++j) - { - const int mu = pv.global2local_row(j); - const int nu = pv.global2local_col(i); - - if (mu >= 0 && nu >= 0) - { - const int index = mu * pv.ncol + nu; - double sum = 0.0; - for (int is = 0; is < nspin; ++is) { sum += dm.get_DMK(is + 1, 0, nu, mu); } - if (isforce) - { - const double sumf = sum * factor_force; - for (int i = 0; i < 3; ++i) { f(iat, i) += sumf * 2.0 * dHSx[i][index]; } - } - if (isstress) - { - const double sums = sum * factor_stress; - int ij = 0; - for (int i = 0; i < 3;++i) { for (int j = i; j < 3; ++j) { s(i, j) += sums * dHSxy[ij++][index]; } } - } - } - } - } - - if (isstress) { StressTools::stress_fill(ucell.lat0, ucell.omega, s); } - - ModuleBase::timer::tick("Forces", "cal_pulay"); - } - - template<> //multi-k, provided xy - void cal_pulay_fs( - ModuleBase::matrix& f, - ModuleBase::matrix& s, - const elecstate::DensityMatrix, double>& dm, - const UnitCell& ucell, - const Parallel_Orbitals& pv, - const double* (&dHSx)[3], - const double* (&dHSxy)[6], - const bool& isforce, - const bool& isstress, - Record_adj* ra, - const double& factor_force, - const double& factor_stress) - { - auto stress_func = [](ModuleBase::matrix& local_s, - const double& dm2d1_s, - const double** dHSx, - const double** dHSxy, - const double* dtau, - const int& irr) - { - int ij = 0; - for (int i = 0; i < 3; ++i) - { - for (int j = i; j < 3; ++j) - { - local_s(i, j) += dm2d1_s * dHSxy[ij++][irr]; - } - } - }; - cal_pulay_fs(f, s, dm, ucell, pv, dHSx, dHSxy, - nullptr, isforce, isstress, ra, - factor_force, factor_stress, stress_func); - } - - template<> // multi-k, provided x - void cal_pulay_fs( - ModuleBase::matrix& f, - ModuleBase::matrix& s, - const elecstate::DensityMatrix, double>& dm, - const UnitCell& ucell, - const Parallel_Orbitals& pv, - const double* (&dHSx)[3], - const double* dtau, - const bool& isforce, - const bool& isstress, - Record_adj* ra, - const double& factor_force, - const double& factor_stress) - { - auto stress_func = [](ModuleBase::matrix& local_s, - const double& dm2d1_s, - const double** dHSx, - const double** dHSxy, - const double* dtau, - const int& irr) - { - for (int i = 0; i < 3; ++i) - { - for (int j = i; j < 3; ++j) - { - local_s(i, j) += dm2d1_s * dHSx[i][irr] * dtau[irr * 3 + j]; - } - } - }; - cal_pulay_fs(f, s, dm, ucell, pv, dHSx, - nullptr, dtau, isforce, isstress, ra, - factor_force, factor_stress, stress_func); - } - -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2_template.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2_template.hpp deleted file mode 100644 index 1aec69f99e..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2_template.hpp +++ /dev/null @@ -1,128 +0,0 @@ -#pragma once -#include "pulay_force_stress.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -namespace PulayForceStress -{ - // common kernel - template - inline void cal_pulay_fs( - ModuleBase::matrix& f, - ModuleBase::matrix& s, - const elecstate::DensityMatrix& dm, - const UnitCell& ucell, - const Parallel_Orbitals& pv, - const double** dHSx, - const double** dHSxy, - const double* dtau, - const bool& isforce, - const bool& isstress, - Record_adj* ra, - const double& factor_force, - const double& factor_stress, - Tfunc& stress_func) - { - ModuleBase::TITLE("Force_LCAO", "cal_pulay_fs_center2"); - ModuleBase::timer::tick("Force_LCAO", "cal_pulay_fs_center2"); - - const int nspin_DMR = (PARAM.inp.nspin == 2) ? 2 : 1; - int total_irr = 0; -#ifdef _OPENMP -#pragma omp parallel - { - int num_threads = omp_get_num_threads(); - ModuleBase::matrix local_s(3, 3); - int local_total_irr = 0; -#else - ModuleBase::matrix& local_s = s; - int& local_total_irr = total_irr; -#endif - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - // get iat1 - int iat1 = ucell.itia2iat(T1, I1); - double* f_iat; - if (isforce) { f_iat = &f(iat, 0); } -#ifdef _OPENMP - // using local stack to avoid false sharing in multi-threaded case - double f_tmp[3] = { 0.0, 0.0, 0.0 }; - if (num_threads > 1) { f_iat = f_tmp; } -#endif - int irr = pv.nlocstart[iat]; - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int cb = 0; cb < ra->na_each[iat]; ++cb) - { - const int T2 = ra->info[iat][cb][3]; - const int I2 = ra->info[iat][cb][4]; - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - Atom* atom2 = &ucell.atoms[T2]; - // get iat2 - int iat2 = ucell.itia2iat(T2, I2); - double Rx = ra->info[iat][cb][0]; - double Ry = ra->info[iat][cb][1]; - double Rz = ra->info[iat][cb][2]; - // get BaseMatrix - if (pv.get_row_size(iat1) <= 0 || pv.get_col_size(iat2) <= 0) { continue; } - std::vector*> tmp_matrix; - for (int is = 0; is < nspin_DMR; ++is) - { - tmp_matrix.push_back(dm.get_DMR_pointer(is + 1)->find_matrix(iat1, iat2, Rx, Ry, Rz)); - } - for (int mu = 0; mu < pv.get_row_size(iat1); ++mu) - { - for (int nu = 0; nu < pv.get_col_size(iat2); ++nu) - { - // the DMR should not be summed over spin, do the summation here - double dm2d1 = 0.0; - for (int is = 0; is < nspin_DMR; ++is) { dm2d1 += tmp_matrix[is]->get_value(mu, nu); } - double dm2d2 = 2.0 * dm2d1; - if (isforce) - { - const double dm2d2_f = dm2d2 * factor_force; - for (int i = 0; i < 3; ++i) { f_iat[i] += dm2d2_f * dHSx[i][irr]; } - } - if (isstress) - { - const double dm2d1_s = dm2d1 * factor_stress; - stress_func(local_s, dm2d1_s, dHSx, dHSxy, dtau, irr); - } - ++local_total_irr; - ++irr; - } - } - } -#ifdef _OPENMP - if (isforce && num_threads > 1) { for (int i = 0; i < 3; ++i) { f(iat, i) += f_iat[i]; } } -#endif - } // end iat -#ifdef _OPENMP -#pragma omp critical(cal_foverlap_k_reduce) - { - total_irr += local_total_irr; - if (isstress) - { - for (int i = 0; i < 3; ++i) { for (int j = i; j < 3; ++j) { s(i, j) += local_s(i, j); } } - } - } - } -#endif - - if (total_irr != pv.nnr) - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "wrong irr", total_irr); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "wrong pv.nnr", pv.nnr); - ModuleBase::WARNING_QUIT("Force_LCAO::cal_pulay_fs_center2", "irr!=pv.nnr"); - } - - if (isstress) { StressTools::stress_fill(ucell.lat0, ucell.omega, s); } - - ModuleBase::timer::tick("Force_LCAO", "cal_pulay_fs_center2"); - } -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_gint.hpp b/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_gint.hpp deleted file mode 100644 index aa59ad87d4..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_gint.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once -#include "pulay_force_stress.h" -#include "module_hamilt_lcao/hamilt_lcaodft/stress_tools.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "module_parameter/parameter.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_interface.h" -namespace PulayForceStress -{ - template - void cal_pulay_fs( - ModuleBase::matrix& f, ///< [out] force - ModuleBase::matrix& s, ///< [out] stress - const elecstate::DensityMatrix& dm, ///< [in] density matrix - const UnitCell& ucell, ///< [in] unit cell - const elecstate::Potential* pot, ///< [in] potential on grid - typename TGint::type& gint, - const bool& isforce, - const bool& isstress, - const bool& set_dmr_gint) - { - const int nspin = PARAM.inp.nspin; - -#ifdef __OLD_GINT - if (set_dmr_gint) { gint.transfer_DM2DtoGrid(dm.get_DMR_vector()); } // 2d block to grid - for (int is = 0; is < nspin; ++is) - { - const double* vr_eff1 = pot->get_effective_v(is); - const double* vofk_eff1 = nullptr; - if (XC_Functional::get_ked_flag()) - { - vofk_eff1 = pot->get_effective_vofk(is); - Gint_inout inout(is, vr_eff1, vofk_eff1, isforce, isstress, &f, &s, Gint_Tools::job_type::force_meta); - gint.cal_gint(&inout); - } - else - { - Gint_inout inout(is, vr_eff1, isforce, isstress, &f, &s, Gint_Tools::job_type::force); - gint.cal_gint(&inout); - } - } -#else - std::vector vr_eff(nspin, nullptr); - std::vector vofk_eff(nspin, nullptr); - if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - for (int is = 0; is < nspin; ++is) - { - vr_eff[is] = pot->get_effective_v(is); - vofk_eff[is] = pot->get_effective_vofk(is); - } - ModuleGint::cal_gint_fvl_meta(nspin, vr_eff, vofk_eff, dm.get_DMR_vector(), isforce, isstress, &f, &s); - } - else - { - for(int is = 0; is < nspin; ++is) - { - vr_eff[is] = pot->get_effective_v(is); - } - ModuleGint::cal_gint_fvl(nspin, vr_eff, dm.get_DMR_vector(), isforce, isstress, &f, &s); - } -#endif - - if (isstress) { StressTools::stress_fill(-1.0, ucell.omega, s); } - } -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/record_adj.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/record_adj.cpp deleted file mode 100644 index 27cf305aac..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/record_adj.cpp +++ /dev/null @@ -1,508 +0,0 @@ -#include "record_adj.h" - -#include "source_base/timer.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -Record_adj::Record_adj() -{ -} -Record_adj::~Record_adj() -{ - if (info_modified) - { - this->delete_grid(); - } -} - -void Record_adj::delete_grid() -{ - for (int i = 0; i < na_proc; i++) - { - // how many 'numerical orbital' adjacents - // for each atom in this process. - for (int j = 0; j < na_each[i]; j++) - { - delete[] info[i][j]; - } - delete[] info[i]; - } - delete[] info; - delete[] na_each; - if (iat2ca) - { - delete[] iat2ca; - } - info_modified = false; -} - -//-------------------------------------------- -// This will record the orbitals according to -// HPSEPS's 2D block division. -// If multi-k, calculate nnr at the same time. -// be called only once in an ion-step. -//-------------------------------------------- -void Record_adj::for_2d(const UnitCell& ucell, - const Grid_Driver& grid_d, - Parallel_Orbitals& pv, - bool gamma_only, - const std::vector& orb_cutoff) -{ - ModuleBase::TITLE("Record_adj", "for_2d"); - ModuleBase::timer::tick("Record_adj", "for_2d"); - - assert(ucell.nat > 0); - if (!gamma_only) - { - // Record_adj should not modify members of pv, need refactor! mohan add 2025-03-10 - delete[] pv.nlocdim; - delete[] pv.nlocstart; - pv.nlocdim = new int[ucell.nat]; - pv.nlocstart = new int[ucell.nat]; - ModuleBase::GlobalFunc::ZEROS(pv.nlocdim, ucell.nat); - ModuleBase::GlobalFunc::ZEROS(pv.nlocstart, ucell.nat); - pv.nnr = 0; - } - { - // (1) find the adjacent atoms of atom[T1,I1]; - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 dtau1, dtau2, tau0; - - this->na_proc = ucell.nat; - - // number of adjacents for each atom. - this->na_each = new int[na_proc]; - ModuleBase::GlobalFunc::ZEROS(na_each, na_proc); - int iat = 0; - - for (int T1 = 0; T1 < ucell.ntype; ++T1) - { - Atom* atom1 = &ucell.atoms[T1]; - for (int I1 = 0; I1 < atom1->na; ++I1) - { - tau1 = atom1->tau[I1]; - // grid_d.Find_atom( tau1 ); - grid_d.Find_atom(ucell, tau1, T1, I1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - if (!gamma_only) - { - pv.nlocstart[iat] = pv.nnr; - } - - // (2) search among all adjacent atoms. - for (int ad = 0; ad < grid_d.getAdjacentNum() + 1; ++ad) - { - const int T2 = grid_d.getType(ad); - const int I2 = grid_d.getNatom(ad); - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - tau2 = grid_d.getAdjacentTau(ad); - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff[T1] + orb_cutoff[T2]; - - bool is_adj = false; - if (distance < rcut) - { - is_adj = true; - // there is another possibility that i and j are adjacent atoms. - // which is that are adjacents while are also - // adjacents, these considerations are only considered in k-point - // algorithm, - } - else if (distance >= rcut) - { - for (int ad0 = 0; ad0 < grid_d.getAdjacentNum() + 1; ++ad0) - { - const int T0 = grid_d.getType(ad0); - // const int I0 = grid_d.getNatom(ad0); - // const int iat0 = ucell.itia2iat(T0, I0); - // const int start0 = ucell.itiaiw2iwt(T0, I0, 0); - - tau0 = grid_d.getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - double distance1 = dtau1.norm() * ucell.lat0; - double rcut1 = orb_cutoff[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - - dtau2 = tau0 - tau2; - double distance2 = dtau2.norm() * ucell.lat0; - double rcut2 = orb_cutoff[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - - if (distance1 < rcut1 && distance2 < rcut2) - { - is_adj = true; - break; - } // dis1, dis2 - } - } - - if (is_adj) - { - ++na_each[iat]; - if (!gamma_only) - { - for (int ii = 0; ii < atom1->nw * PARAM.globalv.npol; ++ii) - { - // the index of orbitals in this processor - const int iw1_all = start1 + ii; - const int mu = pv.global2local_row(iw1_all); - if (mu < 0) - { - continue; - } - - for (int jj = 0; jj < ucell.atoms[T2].nw * PARAM.globalv.npol; ++jj) - { - const int iw2_all = start2 + jj; - const int nu = pv.global2local_col(iw2_all); - if (nu < 0) - { - continue; - } - - pv.nlocdim[iat]++; - ++(pv.nnr); - } - } - } - } // end is_adj - } // end ad - ++iat; - } // end I1 - } // end T1 - } - // xiaohui add "OUT_LEVEL", 2015-09-16 - if (PARAM.inp.out_level != "m" && !gamma_only) - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "ParaV.nnr", pv.nnr); - } - - //------------------------------------------------ - // info will identify each atom in each unitcell. - //------------------------------------------------ - this->info = new int**[na_proc]; -#ifdef _OPENMP -#pragma omp parallel - { -#endif - - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 dtau1, dtau2, tau0; - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int i = 0; i < na_proc; i++) - { - // GlobalV::ofs_running << " atom" << std::setw(5) << i << std::setw(10) << na_each[i] << std::endl; - if (na_each[i] > 0) - { - info[i] = new int*[na_each[i]]; - for (int j = 0; j < na_each[i]; j++) - { - // (Rx, Ry, Rz, T, I) - info[i][j] = new int[5]; - ModuleBase::GlobalFunc::ZEROS(info[i][j], 5); - } - } - } - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; ++iat) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - { - tau1 = atom1->tau[I1]; - // grid_d.Find_atom( tau1 ); - AdjacentAtomInfo adjs; - grid_d.Find_atom(ucell, tau1, T1, I1, &adjs); - - // (2) search among all adjacent atoms. - int cb = 0; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - tau2 = adjs.adjacent_tau[ad]; - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff[T1] + orb_cutoff[T2]; - - bool is_adj = false; - if (distance < rcut) - { - is_adj = true; - } - else if (distance >= rcut) - { - for (int ad0 = 0; ad0 < adjs.adj_num + 1; ++ad0) - { - const int T0 = adjs.ntype[ad0]; - // const int I0 = grid_d.getNatom(ad0); - // const int iat0 = ucell.itia2iat(T0, I0); - // const int start0 = ucell.itiaiw2iwt(T0, I0, 0); - - tau0 = adjs.adjacent_tau[ad0]; - dtau1 = tau0 - tau1; - double distance1 = dtau1.norm() * ucell.lat0; - double rcut1 = orb_cutoff[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - - dtau2 = tau0 - tau2; - double distance2 = dtau2.norm() * ucell.lat0; - double rcut2 = orb_cutoff[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - - if (distance1 < rcut1 && distance2 < rcut2) - { - is_adj = true; - break; - } // dis1, dis2 - } - } - - if (is_adj) - { - info[iat][cb][0] = adjs.box[ad].x; - info[iat][cb][1] = adjs.box[ad].y; - info[iat][cb][2] = adjs.box[ad].z; - info[iat][cb][3] = T2; - info[iat][cb][4] = I2; - ++cb; - } - } // end ad - // GlobalV::ofs_running << " nadj = " << cb << std::endl; - } // end I1 - } // end T1 -#ifdef _OPENMP - } -#endif - ModuleBase::timer::tick("Record_adj", "for_2d"); - info_modified = true; - return; -} - -//-------------------------------------------- -// This will record the orbitals according to -// grid division (cut along z direction) -//-------------------------------------------- -void Record_adj::for_grid(const UnitCell& ucell, - const Grid_Driver& grid_d, - const Grid_Technique& gt, - const std::vector& orb_cutoff) -{ - ModuleBase::TITLE("Record_adj", "for_grid"); - ModuleBase::timer::tick("Record_adj", "for_grid"); - - this->na_proc = 0; - this->iat2ca = new int[ucell.nat]; - for (int iat = 0; iat < ucell.nat; ++iat) - { - { - if (gt.in_this_processor[iat]) - { - iat2ca[iat] = na_proc; - ++na_proc; - } - else - { - iat2ca[iat] = -1; - } - } - } - - // number of adjacents for each atom. - this->na_each = new int[na_proc]; - ModuleBase::GlobalFunc::ZEROS(na_each, na_proc); - this->info = new int**[na_proc]; -#ifdef _OPENMP -#pragma omp parallel - { -#endif - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 tau0, dtau1, dtau2; - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; ++iat) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - { - const int ca = iat2ca[iat]; - // key in this function - if (gt.in_this_processor[iat]) - { - tau1 = atom1->tau[I1]; - // grid_d.Find_atom(tau1); - AdjacentAtomInfo adjs; - grid_d.Find_atom(ucell, tau1, T1, I1, &adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ad++) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell.itia2iat(T2, I2); - if (gt.in_this_processor[iat2]) - { - // Atom* atom2 = &ucell.atoms[T2]; - tau2 = adjs.adjacent_tau[ad]; - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff[T1] + orb_cutoff[T2]; - - bool is_adj = false; - if (distance < rcut) - { - is_adj = true; - } - /* - else if(distance >= rcut) - { - for (int ad0 = 0; ad0 < grid_d.getAdjacentNum()+1; ++ad0) - { - const int T0 = grid_d.getType(ad0); - const int I0 = grid_d.getNatom(ad0); - const int iat0 = ucell.itia2iat(T0, I0); - const int start0 = ucell.itiaiw2iwt(T0, I0, 0); - - tau0 = grid_d.getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - - double distance1 = dtau1.norm() * ucell.lat0; - double distance2 = dtau2.norm() * ucell.lat0; - - double rcut1 = orb_cutoff[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - double rcut2 = orb_cutoff[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - - if( distance1 < rcut1 && distance2 < rcut2 ) - { - is_adj = true; - break; - } // dis1, dis2 - } - } - */ - - // check the distance - if (is_adj) - { - ++na_each[ca]; - } - } // end judge 2 - } // end ad - } // end judge 1 - } // end I1 - } // end T1 - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int i = 0; i < na_proc; i++) - { - assert(na_each[i] > 0); - info[i] = new int*[na_each[i]]; - for (int j = 0; j < na_each[i]; j++) - { - // (Rx, Ry, Rz, T, I) - info[i][j] = new int[5]; - ModuleBase::GlobalFunc::ZEROS(info[i][j], 5); - } - } - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; ++iat) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - { - const int ca = iat2ca[iat]; - - // key of this function - if (gt.in_this_processor[iat]) - { - tau1 = atom1->tau[I1]; - // grid_d.Find_atom(tau1); - AdjacentAtomInfo adjs; - grid_d.Find_atom(ucell, tau1, T1, I1, &adjs); - - int cb = 0; - for (int ad = 0; ad < adjs.adj_num + 1; ad++) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell.itia2iat(T2, I2); - - // key of this function - if (gt.in_this_processor[iat2]) - { - // Atom* atom2 = &ucell.atoms[T2]; - tau2 = adjs.adjacent_tau[ad]; - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff[T1] + orb_cutoff[T2]; - - // check the distance - if (distance < rcut) - { - info[ca][cb][0] = adjs.box[ad].x; - info[ca][cb][1] = adjs.box[ad].y; - info[ca][cb][2] = adjs.box[ad].z; - info[ca][cb][3] = T2; - info[ca][cb][4] = I2; - ++cb; - } - /* - else if(distance >= rcut) - { - for (int ad0 = 0; ad0 < grid_d.getAdjacentNum()+1; ++ad0) - { - const int T0 = grid_d.getType(ad0); - const int I0 = grid_d.getNatom(ad0); - const int iat0 = ucell.itia2iat(T0, I0); - const int start0 = ucell.itiaiw2iwt(T0, I0, 0); - - tau0 = grid_d.getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - - double distance1 = dtau1.norm() * ucell.lat0; - double distance2 = dtau2.norm() * ucell.lat0; - - double rcut1 = orb_cutoff[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - double rcut2 = orb_cutoff[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - - if( distance1 < rcut1 && distance2 < rcut2 ) - { - info[ca][cb][0] = grid_d.getBox(ad).x; - info[ca][cb][1] = grid_d.getBox(ad).y; - info[ca][cb][2] = grid_d.getBox(ad).z; - info[ca][cb][3] = T2; - info[ca][cb][4] = I2; - ++cb; - break; - } // dis1, dis2 - } - } - */ - } - } // end ad - - assert(cb == na_each[ca]); - } - } - } -#ifdef _OPENMP - } -#endif - ModuleBase::timer::tick("Record_adj", "for_grid"); - info_modified = true; - // std::cout << " after for_grid" << std::endl; - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/record_adj.h b/source/module_hamilt_lcao/hamilt_lcaodft/record_adj.h deleted file mode 100644 index f068973f99..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/record_adj.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef RECORD_ADJ_H -#define RECORD_ADJ_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" - -//--------------------------------------------------- -// FUNCTION: record the adjacent atoms for each atom -//--------------------------------------------------- -class Record_adj -{ - private: - bool info_modified = false; - - public: - Record_adj(); - ~Record_adj(); - - //-------------------------------------------- - // This will record the orbitals according to - // HPSEPS's 2D block division. - //-------------------------------------------- - void for_2d(const UnitCell& ucell, - const Grid_Driver& grid_d, - Parallel_Orbitals& pv, - bool gamma_only, - const std::vector& orb_cutoff); - - //-------------------------------------------- - // This will record the orbitals according to - // grid division (cut along z direction) - //-------------------------------------------- - void for_grid(const UnitCell& ucell, - const Grid_Driver& grid_d, - const Grid_Technique& gt, - const std::vector& orb_cutoff); - - void delete_grid(); - - int na_proc=0; - int* na_each=nullptr; - - //-------------------------------------------- - // record sparse atom index in for_grid(const Grid_Technique >); - // Map iat(dense atom index) to sparse atom index - // Mainly removing the index dependency for OpenMP parallel loop - // - // Meaning: - // 1. if iat2ca[iat] > 0, it contains the sparse atom index - // 2. if iat2ca[iat] < 0, the sparse atom index of iat does not exist - // - // Usage: - // 1. iat2ca[iat] > 0 ? na_each[iat2ca[iat]] : 0 - // 2. iat2ca[iat] > 0 ? info[iat2ca[iat]] : nullptr - //-------------------------------------------- - int* iat2ca=nullptr; - - //------------------------------------------------ - // info will identify each atom in each unitcell. - //------------------------------------------------ - int*** info=nullptr; - - private: -}; - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.cpp deleted file mode 100644 index 381c61ec87..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.cpp +++ /dev/null @@ -1,333 +0,0 @@ -#include "spar_dh.h" - -#include "module_parameter/parameter.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_interface.h" -#include - -void sparse_format::cal_dS(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 double& sparse_thr) -{ -ModuleBase::TITLE("sparse_format", "cal_dS"); - -sparse_format::set_R_range(HS_Arrays.all_R_coor, grid); -const int nnr = pv.nnr; - -ForceStressArrays fsr_dh; -fsr_dh.DHloc_fixedR_x = new double[nnr]; -fsr_dh.DHloc_fixedR_y = new double[nnr]; -fsr_dh.DHloc_fixedR_z = new double[nnr]; -ModuleBase::GlobalFunc::ZEROS(fsr_dh.DHloc_fixedR_x, nnr); -ModuleBase::GlobalFunc::ZEROS(fsr_dh.DHloc_fixedR_y, nnr); -ModuleBase::GlobalFunc::ZEROS(fsr_dh.DHloc_fixedR_z, nnr); -// the pointers of dS is different from dH, use the dh pointers to reuse the print functions -fsr_dh.DSloc_Rx = fsr_dh.DHloc_fixedR_x; -fsr_dh.DSloc_Ry = fsr_dh.DHloc_fixedR_y; -fsr_dh.DSloc_Rz = fsr_dh.DHloc_fixedR_z; -// cal dS= in LCAO -const bool cal_deri = true; -const bool cal_stress = false; -LCAO_domain::build_ST_new(fsr_dh, - 'S', - cal_deri, - cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &grid, - nullptr, - false); // delete unused parameter lm.Hloc_fixedR - -sparse_format::cal_dSTN_R(ucell,pv, HS_Arrays, fsr_dh, grid, orb.cutoffs(), 0, sparse_thr); -delete[] fsr_dh.DHloc_fixedR_x; -delete[] fsr_dh.DHloc_fixedR_y; -delete[] fsr_dh.DHloc_fixedR_z; -return; -} -void sparse_format::cal_dH(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 int& current_spin, - const double& sparse_thr, - const ModuleBase::matrix& v_eff, - Gint_k& gint_k) -{ - ModuleBase::TITLE("sparse_format", "cal_dH"); - - sparse_format::set_R_range(HS_Arrays.all_R_coor, grid); - - const int nnr = pv.nnr; - - ForceStressArrays fsr_dh; - - fsr_dh.DHloc_fixedR_x = new double[nnr]; - fsr_dh.DHloc_fixedR_y = new double[nnr]; - fsr_dh.DHloc_fixedR_z = new double[nnr]; - - ModuleBase::GlobalFunc::ZEROS(fsr_dh.DHloc_fixedR_x, nnr); - ModuleBase::GlobalFunc::ZEROS(fsr_dh.DHloc_fixedR_y, nnr); - ModuleBase::GlobalFunc::ZEROS(fsr_dh.DHloc_fixedR_z, nnr); - // cal dT= in LCAO - // cal T + VNL(P1) in LCAO basis - const bool cal_deri = true; - const bool cal_stress = false; - LCAO_domain::build_ST_new(fsr_dh, - 'T', - cal_deri, - cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &grid, - nullptr, - false); // delete unused parameter lm.Hloc_fixedR - - LCAO_domain::build_Nonlocal_mu_new(pv, - fsr_dh, - nullptr, - true, - ucell, - orb, - *(two_center_bundle.overlap_orb_beta), - &grid); - - sparse_format::cal_dSTN_R(ucell,pv, HS_Arrays, fsr_dh, grid, orb.cutoffs(), current_spin, sparse_thr); - - delete[] fsr_dh.DHloc_fixedR_x; - delete[] fsr_dh.DHloc_fixedR_y; - delete[] fsr_dh.DHloc_fixedR_z; - - if(PARAM.inp.nspin==2) - { -#ifdef __OLD_GINT - gint_k.allocate_pvdpR(); - // note: some MPI process will not have grids when MPI cores are too - // many, v_eff in these processes are empty - const double* vr_eff1 - = v_eff.nc * v_eff.nr > 0 ? &(v_eff(current_spin, 0)) : nullptr; - - if (!PARAM.globalv.gamma_only_local) - { - if (PARAM.inp.vl_in_h) - { - Gint_inout inout(vr_eff1, - current_spin, - Gint_Tools::job_type::dvlocal); - gint_k.cal_gint(&inout); - } - } - gint_k.cal_dvlocal_R_sparseMatrix(current_spin, sparse_thr, HS_Arrays, &pv, ucell, grid); - gint_k.destroy_pvdpR(); -#else - const double* vr_eff1 - = v_eff.nc * v_eff.nr > 0 ? &(v_eff(current_spin, 0)) : nullptr; - if (!PARAM.globalv.gamma_only_local) - { - ModuleGint::cal_dvlocal_R_sparseMatrix( - PARAM.inp.nspin, PARAM.globalv.npol, current_spin, PARAM.globalv.nlocal, - sparse_thr, vr_eff1, pv, ucell, grid, HS_Arrays); - } -#endif - } - return; -} - -void sparse_format::set_R_range(std::set>& all_R_coor, const Grid_Driver& grid) -{ - int RminX = int(-grid.getGlayerX_minus()); - int RminY = int(-grid.getGlayerY_minus()); - int RminZ = int(-grid.getGlayerZ_minus()); - - int Rx = grid.getGlayerX() + grid.getGlayerX_minus(); - int Ry = grid.getGlayerY() + grid.getGlayerY_minus(); - int Rz = grid.getGlayerZ() + grid.getGlayerZ_minus(); - - for (int ix = 0; ix < Rx; ix++) - { - for (int iy = 0; iy < Ry; iy++) - { - for (int iz = 0; iz < Rz; iz++) - { - Abfs::Vector3_Order temp_R(ix + RminX, iy + RminY, iz + RminZ); - all_R_coor.insert(temp_R); - } - } - } - - return; -} - -void sparse_format::cal_dSTN_R(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - ForceStressArrays& fsr, - const Grid_Driver& grid, - const std::vector& orb_cutoff, - const int& current_spin, - const double& sparse_thr) -{ - ModuleBase::TITLE("sparse_format", "cal_dSTN_R"); - - int index = 0; - ModuleBase::Vector3 dtau, tau1, tau2; - ModuleBase::Vector3 dtau1, dtau2, tau0; - - double temp_value_double; - std::complex temp_value_complex; - - for (int T1 = 0; T1 < ucell.ntype; ++T1) - { - Atom* atom1 = &ucell.atoms[T1]; - for (int I1 = 0; I1 < atom1->na; ++I1) - { - tau1 = atom1->tau[I1]; - grid.Find_atom(ucell, tau1, T1, I1); - Atom* atom1 = &ucell.atoms[T1]; - const int start = ucell.itiaiw2iwt(T1, I1, 0); - - for (int ad = 0; ad < grid.getAdjacentNum() + 1; ++ad) - { - const int T2 = grid.getType(ad); - const int I2 = grid.getNatom(ad); - Atom* atom2 = &ucell.atoms[T2]; - - tau2 = grid.getAdjacentTau(ad); - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff[T1] + orb_cutoff[T2]; - - bool adj = false; - - if (distance < rcut) - { - adj = true; - } - else if (distance >= rcut) - { - for (int ad0 = 0; ad0 < grid.getAdjacentNum() + 1; ++ad0) - { - const int T0 = grid.getType(ad0); - - tau0 = grid.getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - - double distance1 = dtau1.norm() * ucell.lat0; - double distance2 = dtau2.norm() * ucell.lat0; - - double rcut1 = orb_cutoff[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - double rcut2 = orb_cutoff[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - - if (distance1 < rcut1 && distance2 < rcut2) - { - adj = true; - break; - } - } - } - - if (adj) - { - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - Abfs::Vector3_Order dR(grid.getBox(ad).x, grid.getBox(ad).y, grid.getBox(ad).z); - - for (int ii = 0; ii < atom1->nw * PARAM.globalv.npol; ii++) - { - const int iw1_all = start + ii; - const int mu = pv.global2local_row(iw1_all); - - if (mu < 0) - { - continue; - } - - for (int jj = 0; jj < atom2->nw * PARAM.globalv.npol; jj++) - { - int iw2_all = start2 + jj; - const int nu = pv.global2local_col(iw2_all); - - if (nu < 0) - { - continue; - } - - if (PARAM.inp.nspin != 4) - { - temp_value_double = fsr.DHloc_fixedR_x[index]; - if (std::abs(temp_value_double) > sparse_thr) - { - HS_Arrays.dHRx_sparse[current_spin][dR][iw1_all][iw2_all] = temp_value_double; - } - temp_value_double = fsr.DHloc_fixedR_y[index]; - if (std::abs(temp_value_double) > sparse_thr) - { - HS_Arrays.dHRy_sparse[current_spin][dR][iw1_all][iw2_all] = temp_value_double; - } - temp_value_double = fsr.DHloc_fixedR_z[index]; - if (std::abs(temp_value_double) > sparse_thr) - { - HS_Arrays.dHRz_sparse[current_spin][dR][iw1_all][iw2_all] = temp_value_double; - } - } - else - { - ModuleBase::WARNING_QUIT("cal_dSTN_R", "nspin=4 with SOC is not supported yet."); - } - ++index; - } - } - } - } - } - } - - return; -} - -void sparse_format::destroy_dH_R_sparse(LCAO_HS_Arrays& HS_Arrays) -{ - ModuleBase::TITLE("LCAO_domain", "destroy_dH_R_sparse"); - - if (PARAM.inp.nspin != 4) - { - std::map, std::map>> empty_dHRx_sparse_up; - std::map, std::map>> empty_dHRx_sparse_down; - std::map, std::map>> empty_dHRy_sparse_up; - std::map, std::map>> empty_dHRy_sparse_down; - std::map, std::map>> empty_dHRz_sparse_up; - std::map, std::map>> empty_dHRz_sparse_down; - - HS_Arrays.dHRx_sparse[0].swap(empty_dHRx_sparse_up); - HS_Arrays.dHRx_sparse[1].swap(empty_dHRx_sparse_down); - HS_Arrays.dHRy_sparse[0].swap(empty_dHRy_sparse_up); - HS_Arrays.dHRy_sparse[1].swap(empty_dHRy_sparse_down); - HS_Arrays.dHRz_sparse[0].swap(empty_dHRz_sparse_up); - HS_Arrays.dHRz_sparse[1].swap(empty_dHRz_sparse_down); - } - else - { - std::map, std::map>>> - empty_dHRx_soc_sparse; - std::map, std::map>>> - empty_dHRy_soc_sparse; - std::map, std::map>>> - empty_dHRz_soc_sparse; - - HS_Arrays.dHRx_soc_sparse.swap(empty_dHRx_soc_sparse); - HS_Arrays.dHRy_soc_sparse.swap(empty_dHRy_soc_sparse); - HS_Arrays.dHRz_soc_sparse.swap(empty_dHRz_soc_sparse); - } - - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.h b/source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.h deleted file mode 100644 index a477a29648..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_SPAR_DH_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_HAMILT_LCAODFT_SPAR_DH_H - -#include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" -#include "module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_pw/hamilt_pwdft/global.h" -#include - -namespace sparse_format -{ -void cal_dH(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 int& current_spin, - const double& sparse_thr, - const ModuleBase::matrix& v_eff, - Gint_k& gint_k); - -// calculated the derivative of the overlap matrix: -void cal_dS(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 double& sparse_thr); - -// be called by 'cal_dH_sparse' -void set_R_range(std::set>& all_R_coor, const Grid_Driver& grid); - -// be called by 'cal_dH_sparse' -void cal_dSTN_R(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - ForceStressArrays& fsr, // mohan add 2024-06-16 - const Grid_Driver& grid, - const std::vector& orb_cutoff, - const int& current_spin, - const double& sparse_thr); - -void destroy_dH_R_sparse(LCAO_HS_Arrays& HS_Arrays); - -} // namespace sparse_format - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.cpp deleted file mode 100644 index 6538da7072..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __EXX -#include "LCAO_hamilt.hpp" -#endif - diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.h b/source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.h deleted file mode 100644 index efa3d64ef1..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_exx.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef SPARSE_FORMAT_EXX_H -#define SPARSE_FORMAT_EXX_H - -#ifdef __EXX - -#include -#include -#include -#include -#include - -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/unitcell.h" -namespace sparse_format -{ - -template -void cal_HR_exx(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const int& current_spin, - const double& sparse_thr, - const int (&nmp)[3], - const std::vector>, RI::Tensor>>>& Hexxs); - -} -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_hamilt.hpp" -#endif -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp deleted file mode 100644 index 786d7809f5..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp +++ /dev/null @@ -1,454 +0,0 @@ -#include "spar_hsr.h" - -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "module_parameter/parameter.h" -#include "spar_dh.h" -#include "spar_exx.h" -#include "spar_u.h" - -#ifdef __MPI -void sparse_format::sync_all_R_coor(std::set>& all_R_coor, MPI_Comm comm) -{ - int my_rank, nproc; - MPI_Comm_rank(comm, &my_rank); - MPI_Comm_size(comm, &nproc); - - // Step 1: Gather the number of R coordinates from each process - int local_size = all_R_coor.size(); - std::vector recv_counts(nproc, 0); - MPI_Allgather(&local_size, 1, MPI_INT, recv_counts.data(), 1, MPI_INT, comm); - - // Step 2: Calculate the number of integers sent by each process (each R coordinate contains 3 integers) - std::vector recv_counts_elements(nproc); - std::vector displacements(nproc, 0); - int total_size_elements = 0; - - for (int i = 0; i < nproc; ++i) - { - recv_counts_elements[i] = recv_counts[i] * 3; // Number of integers sent by each process - displacements[i] = total_size_elements; - total_size_elements += recv_counts_elements[i]; - } - - // Step 3: Gather the raw data of all R coordinates (each R coordinate is stored as 3 integers) - std::vector local_R_data; - local_R_data.reserve(local_size * 3); - for (const auto& R: all_R_coor) - { - local_R_data.push_back(R.x); - local_R_data.push_back(R.y); - local_R_data.push_back(R.z); - } - - // Step 4: Allocate the receive buffer and call MPI_Allgatherv - std::vector global_R_data(total_size_elements); - MPI_Allgatherv(local_R_data.data(), - local_size * 3, - MPI_INT, - global_R_data.data(), - recv_counts_elements.data(), - displacements.data(), - MPI_INT, - comm); - - // Step 5: Merge to create a global set of R coordinates - std::set> global_R_coor; - for (int i = 0; i < total_size_elements; i += 3) - { - int x = global_R_data[i]; - int y = global_R_data[i + 1]; - int z = global_R_data[i + 2]; - global_R_coor.insert(Abfs::Vector3_Order(x, y, z)); - } - - // Step 6: Update all processes' all_R_coor - all_R_coor = std::move(global_R_coor); -} -#endif // __MPI - -void sparse_format::cal_HSR(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, - const int& current_spin, - const double& sparse_thr, - const int (&nmp)[3], - hamilt::Hamilt>* p_ham -#ifdef __EXX - , - const std::vector>>>* Hexxd, - const std::vector>>>>* Hexxc -#endif -) -{ - ModuleBase::TITLE("sparse_format", "cal_HSR"); - - // sparse_format::set_R_range(HS_Arrays.all_R_coor, grid); - - const int nspin = PARAM.inp.nspin; - - // cal_STN_R_sparse(current_spin, sparse_thr); - if (nspin == 1 || nspin == 2) - { - hamilt::HamiltLCAO, double>* p_ham_lcao - = dynamic_cast, double>*>(p_ham); - - HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); - - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) - { - sparse_format::cal_HContainer_td(pv, - current_spin, - sparse_thr, - *(p_ham_lcao->getHR()), - TD_info::td_vel_op->HR_sparse_td_vel[current_spin]); - } - else - { - - sparse_format::cal_HContainer_d(pv, - current_spin, - sparse_thr, - *(p_ham_lcao->getHR()), - HS_Arrays.HR_sparse[current_spin]); - } - - sparse_format::cal_HContainer_d(pv, current_spin, sparse_thr, *(p_ham_lcao->getSR()), HS_Arrays.SR_sparse); - } - else if (nspin == 4) - { - hamilt::HamiltLCAO, std::complex>* p_ham_lcao - = dynamic_cast, std::complex>*>(p_ham); - - HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); - - sparse_format::cal_HContainer_cd(pv, current_spin, sparse_thr, *(p_ham_lcao->getHR()), HS_Arrays.HR_soc_sparse); - - sparse_format::cal_HContainer_cd(pv, current_spin, sparse_thr, *(p_ham_lcao->getSR()), HS_Arrays.SR_soc_sparse); - } - else - { - ModuleBase::WARNING_QUIT("cal_HSR", "check the value of nspin."); - } - - // only old DFT+U method need to cal extra contribution to HR - if (PARAM.inp.dft_plus_u == 2) - { - if (nspin == 1 || nspin == 2) - { - cal_HR_dftu(pv, HS_Arrays.all_R_coor, HS_Arrays.SR_sparse, HS_Arrays.HR_sparse, current_spin, sparse_thr); - } - else if (nspin == 4) - { - cal_HR_dftu_soc(pv, - HS_Arrays.all_R_coor, - HS_Arrays.SR_soc_sparse, - HS_Arrays.HR_soc_sparse, - current_spin, - sparse_thr); - } - else - { - ModuleBase::WARNING_QUIT("cal_HSR", "check the value of nspin."); - } - } - -#ifdef __EXX -#ifdef __MPI - // if EXX is considered - if (GlobalC::exx_info.info_global.cal_exx) - { - - if (Hexxd && GlobalC::exx_info.info_ri.real_number) - { - - sparse_format::cal_HR_exx(ucell, pv, HS_Arrays, current_spin, sparse_thr, nmp, *Hexxd); - } - else if (Hexxc && !GlobalC::exx_info.info_ri.real_number) - { - - sparse_format::cal_HR_exx(ucell, pv, HS_Arrays, current_spin, sparse_thr, nmp, *Hexxc); - } - } -#endif // __MPI -#endif // __EXX - - sparse_format::clear_zero_elements(HS_Arrays, current_spin, sparse_thr); - - return; -} - -void sparse_format::cal_HContainer_d( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_thr, - const hamilt::HContainer& hR, - std::map, std::map>>& target) -{ - ModuleBase::TITLE("sparse_format", "cal_HContainer_d"); - - auto row_indexes = pv.get_indexes_row(); - auto col_indexes = pv.get_indexes_col(); - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - int atom_i = hR.get_atom_pair(iap).get_atom_i(); - int atom_j = hR.get_atom_pair(iap).get_atom_j(); - int start_i = pv.atom_begin_row[atom_i]; - int start_j = pv.atom_begin_col[atom_j]; - int row_size = pv.get_row_size(atom_i); - int col_size = pv.get_col_size(atom_j); - for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - const auto& value_tmp = matrix.get_value(i, j); - if (std::abs(value_tmp) > sparse_thr) - { - target[dR][mu][nu] = value_tmp; - } - } - } - } - } - - return; -} - -void sparse_format::cal_HContainer_cd( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_thr, - const hamilt::HContainer>& hR, - std::map, std::map>>>& target) -{ - ModuleBase::TITLE("sparse_format", "cal_HContainer_cd"); - - auto row_indexes = pv.get_indexes_row(); - auto col_indexes = pv.get_indexes_col(); - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - int atom_i = hR.get_atom_pair(iap).get_atom_i(); - int atom_j = hR.get_atom_pair(iap).get_atom_j(); - int start_i = pv.atom_begin_row[atom_i]; - int start_j = pv.atom_begin_col[atom_j]; - int row_size = pv.get_row_size(atom_i); - int col_size = pv.get_col_size(atom_j); - for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - const auto& value_tmp = matrix.get_value(i, j); - if (std::abs(value_tmp) > sparse_thr) - { - target[dR][mu][nu] = value_tmp; - } - } - } - } - } - - return; -} - -void sparse_format::cal_HContainer_td( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_thr, - const hamilt::HContainer& hR, - std::map, std::map>>>& target) -{ - ModuleBase::TITLE("sparse_format", "cal_HContainer_td"); - - auto row_indexes = pv.get_indexes_row(); - auto col_indexes = pv.get_indexes_col(); - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - int atom_i = hR.get_atom_pair(iap).get_atom_i(); - int atom_j = hR.get_atom_pair(iap).get_atom_j(); - int start_i = pv.atom_begin_row[atom_i]; - int start_j = pv.atom_begin_col[atom_j]; - int row_size = pv.get_row_size(atom_i); - int col_size = pv.get_col_size(atom_j); - for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - const auto& value_tmp = std::complex(matrix.get_value(i, j), 0.0); - if (std::abs(value_tmp) > sparse_thr) - { - target[dR][mu][nu] += value_tmp; - } - } - } - } - } - - return; -} - -// in case there are elements smaller than the threshold -void sparse_format::clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& current_spin, const double& sparse_thr) -{ - ModuleBase::TITLE("sparse_format", "clear_zero_elements"); - - if (PARAM.inp.nspin != 4) - { - for (auto& R_loop: HS_Arrays.HR_sparse[current_spin]) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } - } - } - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) - { - for (auto& R_loop: TD_info::td_vel_op->HR_sparse_td_vel[current_spin]) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } - } - } - } - - for (auto& R_loop: HS_Arrays.SR_sparse) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } - } - } - } - else - { - for (auto& R_loop: HS_Arrays.HR_soc_sparse) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } // end while iter - } // end row loop - } // end R loop - - for (auto& R_loop: HS_Arrays.SR_soc_sparse) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } // end while iter - } // end row_loop - } // end R_loop - } - - return; -} - -void sparse_format::destroy_HS_R_sparse(LCAO_HS_Arrays& HS_Arrays) -{ - ModuleBase::TITLE("sparse_format", "destroy_HS_R_sparse"); - - if (PARAM.inp.nspin != 4) - { - std::map, std::map>> empty_HR_sparse_up; - std::map, std::map>> empty_HR_sparse_down; - std::map, std::map>> empty_SR_sparse; - HS_Arrays.HR_sparse[0].swap(empty_HR_sparse_up); - HS_Arrays.HR_sparse[1].swap(empty_HR_sparse_down); - HS_Arrays.SR_sparse.swap(empty_SR_sparse); - } - else - { - std::map, std::map>>> - empty_HR_soc_sparse; - std::map, std::map>>> - empty_SR_soc_sparse; - HS_Arrays.HR_soc_sparse.swap(empty_HR_soc_sparse); - HS_Arrays.SR_soc_sparse.swap(empty_SR_soc_sparse); - } - - // 'all_R_coor' has a small memory requirement and does not need to be - // deleted. std::set> empty_all_R_coor; - // all_R_coor.swap(empty_all_R_coor); - - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h b/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h deleted file mode 100644 index 8b0e89dd7a..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef SPARSE_FORMAT_HSR_H -#define SPARSE_FORMAT_HSR_H - -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -namespace sparse_format -{ -#ifdef __MPI -// Synchronize all processes' R coordinates, -// otherwise HS_Arrays.all_R_coor would have different sizes on different processes, -// causing MPI communication errors. -void sync_all_R_coor(std::set>& all_R_coor, MPI_Comm comm); -#endif - -template -std::set> get_R_range(const hamilt::HContainer& hR) -{ - std::set> all_R_coor; - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - const hamilt::AtomPair& atom_pair = hR.get_atom_pair(iap); - for (int iR = 0; iR < atom_pair.get_R_size(); ++iR) - { - const auto& r_index = atom_pair.get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - all_R_coor.insert(dR); - } - } - -#ifdef __MPI - // Fix: Sync all_R_coor across processes - sparse_format::sync_all_R_coor(all_R_coor, MPI_COMM_WORLD); -#endif - - return all_R_coor; -}; - -using TAC = std::pair>; -void cal_HSR(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, - const int& current_spin, - const double& sparse_thr, - const int (&nmp)[3], - hamilt::Hamilt>* p_ham -#ifdef __EXX - , - const std::vector>>>* Hexxd = nullptr, - const std::vector>>>>* Hexxc = nullptr -#endif -); - -void cal_HContainer_d(const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_threshold, - const hamilt::HContainer& hR, - std::map, std::map>>& target); - -void cal_HContainer_cd( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_threshold, - const hamilt::HContainer>& hR, - std::map, std::map>>>& target); - -void cal_HContainer_td( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_threshold, - const hamilt::HContainer& hR, - std::map, std::map>>>& target); - -void clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& current_spin, const double& sparse_thr); - -void destroy_HS_R_sparse(LCAO_HS_Arrays& HS_Arrays); - -} // namespace sparse_format - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_st.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_st.cpp deleted file mode 100644 index 9de4711b31..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_st.cpp +++ /dev/null @@ -1,208 +0,0 @@ -#include "spar_st.h" - -#include "module_parameter/parameter.h" -#include "force_stress_arrays.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "source_pw/hamilt_pwdft/global.h" // only for INPUT -#include "spar_dh.h" -#include "spar_hsr.h" - -#include - -void sparse_format::cal_SR( - const Parallel_Orbitals& pv, - std::set>& all_R_coor, - std::map, std::map>>& SR_sparse, - std::map, std::map>>>& SR_soc_sparse, - const Grid_Driver& grid, - const double& sparse_thr, - hamilt::Hamilt>* p_ham) -{ - ModuleBase::TITLE("sparse_format", "cal_SR"); - - sparse_format::set_R_range(all_R_coor, grid); - - const int nspin = PARAM.inp.nspin; - - // cal_STN_R_sparse(current_spin, sparse_thr); - if (nspin == 1 || nspin == 2) { - hamilt::HamiltLCAO, double>* p_ham_lcao - = dynamic_cast, double>*>( - p_ham); - const int cspin = 0; - sparse_format::cal_HContainer_d(pv, - cspin, - sparse_thr, - *(p_ham_lcao->getSR()), - SR_sparse); - } else if (nspin == 4) { - hamilt::HamiltLCAO, std::complex>* - p_ham_lcao - = dynamic_cast, - std::complex>*>(p_ham); - const int cspin = 0; - sparse_format::cal_HContainer_cd(pv, - cspin, - sparse_thr, - *(p_ham_lcao->getSR()), - SR_soc_sparse); - } - - return; -} - -void sparse_format::cal_TR(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 double& sparse_thr) -{ - ModuleBase::TITLE("sparse_format", "cal_TR"); - - // need to rebuild T(R) - HS_Arrays.Hloc_fixedR.resize(pv.nnr); - - LCAO_domain::zeros_HSR('T', HS_Arrays); - - // tmp array, will be deleted later, - // mohan 2024-06-15 - ForceStressArrays fsr_tmp; - - LCAO_domain::build_ST_new(fsr_tmp, - 'T', - false, - PARAM.inp.cal_stress, - ucell, - orb, - pv, - two_center_bundle, - &(grid), - HS_Arrays.Hloc_fixedR.data()); - - sparse_format::set_R_range(HS_Arrays.all_R_coor, grid); - - sparse_format::cal_STN_R_for_T(ucell, pv, HS_Arrays, grid, orb.cutoffs(), sparse_thr); - - return; -} - -void sparse_format::cal_STN_R_for_T(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_arrays, - const Grid_Driver& grid, - const std::vector& orb_cutoff, - const double& sparse_thr) -{ - ModuleBase::TITLE("sparse_format", "cal_STN_R_for_T"); - - const int nspin = PARAM.inp.nspin; - - int index = 0; - ModuleBase::Vector3 dtau, tau1, tau2; - ModuleBase::Vector3 dtau1, dtau2, tau0; - - double tmp = 0.0; - std::complex tmpc = std::complex(0.0, 0.0); - - for (int T1 = 0; T1 < ucell.ntype; ++T1) { - Atom* atom1 = &ucell.atoms[T1]; - for (int I1 = 0; I1 < atom1->na; ++I1) { - tau1 = atom1->tau[I1]; - grid.Find_atom(ucell, tau1, T1, I1); - Atom* atom1 = &ucell.atoms[T1]; - const int start = ucell.itiaiw2iwt(T1, I1, 0); - - for (int ad = 0; ad < grid.getAdjacentNum() + 1; ++ad) { - const int T2 = grid.getType(ad); - const int I2 = grid.getNatom(ad); - Atom* atom2 = &ucell.atoms[T2]; - - tau2 = grid.getAdjacentTau(ad); - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff[T1] + orb_cutoff[T2]; - - bool adj = false; - - if (distance < rcut) { - adj = true; - } - - else if (distance >= rcut) { - for (int ad0 = 0; ad0 < grid.getAdjacentNum() + 1; ++ad0) { - const int T0 = grid.getType(ad0); - - tau0 = grid.getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - - double distance1 = dtau1.norm() * ucell.lat0; - double distance2 = dtau2.norm() * ucell.lat0; - - double rcut1 = orb_cutoff[T1] - + ucell.infoNL.Beta[T0].get_rcut_max(); - double rcut2 = orb_cutoff[T2] - + ucell.infoNL.Beta[T0].get_rcut_max(); - - if (distance1 < rcut1 && distance2 < rcut2) { - adj = true; - break; - } - } - } - - if (adj) { - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - Abfs::Vector3_Order dR(grid.getBox(ad).x, - grid.getBox(ad).y, - grid.getBox(ad).z); - - for (int ii = 0; ii < atom1->nw * PARAM.globalv.npol; ii++) { - const int iw1_all = start + ii; - const int mu = pv.global2local_row(iw1_all); - - if (mu < 0) { - continue; - } - - for (int jj = 0; jj < atom2->nw * PARAM.globalv.npol; jj++) { - int iw2_all = start2 + jj; - const int nu = pv.global2local_col(iw2_all); - - if (nu < 0) { - continue; - } - - if (nspin == 1 || nspin == 2) { - tmp = HS_arrays.Hloc_fixedR[index]; - if (std::abs(tmp) > sparse_thr) { - HS_arrays.TR_sparse[dR][iw1_all][iw2_all] - = tmp; - } - } - - ++index; - } - } - } - } - } - } - - return; -} - -void sparse_format::destroy_T_R_sparse(LCAO_HS_Arrays& HS_Arrays) { - ModuleBase::TITLE("sparse_format", "destroy_T_R_sparse"); - - if (PARAM.inp.nspin != 4) { - std::map, - std::map>> - empty_TR_sparse; - HS_Arrays.TR_sparse.swap(empty_TR_sparse); - } - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_st.h b/source/module_hamilt_lcao/hamilt_lcaodft/spar_st.h deleted file mode 100644 index 6d97edaa9a..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_st.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef SPARSE_FORMAT_ST_H -#define SPARSE_FORMAT_ST_H - -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -namespace sparse_format { -//! calculate overlap matrix with lattice vector R -void cal_SR(const Parallel_Orbitals& pv, - std::set>& all_R_coor, - std::map, std::map>>& SR_sparse, - std::map, std::map>>>& SR_soc_sparse, - const Grid_Driver& grid, - const double& sparse_thr, - hamilt::Hamilt>* p_ham); - -//! calculate kinetic matrix with lattice vector R -void cal_TR(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 double& sparse_thr); - -//! cal_STN_R_for_T is only called by cal_TR -void cal_STN_R_for_T(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_arrays, - const Grid_Driver& grid, - const std::vector& orb_cutoff, - const double& sparse_thr); - -void destroy_T_R_sparse(LCAO_HS_Arrays& HS_Arrays); -} // namespace sparse_format - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_u.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/spar_u.cpp deleted file mode 100644 index de09ac8c5d..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_u.cpp +++ /dev/null @@ -1,247 +0,0 @@ -#include "spar_u.h" -#include "source_base/parallel_reduce.h" -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" - -void sparse_format::cal_HR_dftu( - const Parallel_Orbitals &pv, - std::set> &all_R_coor, - std::map, std::map>> &SR_sparse, - std::map, std::map>> *HR_sparse, - const int ¤t_spin, - const double &sparse_thr) -{ - ModuleBase::TITLE("sparse_format","cal_HR_dftu"); - ModuleBase::timer::tick("sparse_format","cal_HR_dftu"); - - int total_R_num = all_R_coor.size(); - int *nonzero_num = new int[total_R_num](); - ModuleBase::GlobalFunc::ZEROS(nonzero_num, total_R_num); - - int count = 0; - for (auto &R_coor : all_R_coor) - { - auto iter = SR_sparse.find(R_coor); - if (iter != SR_sparse.end()) - { - for (auto &row_loop : iter->second) - { - nonzero_num[count] += row_loop.second.size(); - } - } - count++; - } - - Parallel_Reduce::reduce_all(nonzero_num, total_R_num); - - double *HR_tmp = new double[pv.nloc]; - double *SR_tmp = new double[pv.nloc]; - - int ir=0; - int ic=0; - int iic=0; - auto &temp_HR_sparse = HR_sparse[current_spin]; - - count = 0; - for (auto &R_coor : all_R_coor) - { - if (nonzero_num[count] != 0) - { - ModuleBase::GlobalFunc::ZEROS(HR_tmp, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(SR_tmp, pv.nloc); - - auto iter = SR_sparse.find(R_coor); - if (iter != SR_sparse.end()) - { - for (auto &row_loop : iter->second) - { - ir = pv.global2local_row(row_loop.first); - for (auto &col_loop : row_loop.second) - { - ic = pv.global2local_col(col_loop.first); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - SR_tmp[iic] = col_loop.second; - } - } - } - - GlobalC::dftu.cal_eff_pot_mat_R_double(current_spin, SR_tmp, HR_tmp); - - for (int i = 0; i < PARAM.globalv.nlocal; ++i) - { - ir = pv.global2local_row(i); - if (ir >= 0) - { - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - ic = pv.global2local_col(j); - if (ic >= 0) - { - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - - if (std::abs(HR_tmp[iic]) > sparse_thr) - { - double &value = temp_HR_sparse[R_coor][i][j]; - value += HR_tmp[iic]; - if (std::abs(value) <= sparse_thr) - { - temp_HR_sparse[R_coor][i].erase(j); - } - } - } - } - } - } - - } - - count++; - } - - delete[] nonzero_num; - delete[] HR_tmp; - delete[] SR_tmp; - nonzero_num = nullptr; - HR_tmp = nullptr; - SR_tmp = nullptr; - - ModuleBase::timer::tick("sparse_format","cal_HR_dftu_sparse"); - - return; -} - - -void sparse_format::cal_HR_dftu_soc( - const Parallel_Orbitals &pv, - std::set> &all_R_coor, - std::map, std::map>>> &SR_soc_sparse, - std::map, std::map>>> &HR_soc_sparse, - const int ¤t_spin, - const double &sparse_thr) -{ - ModuleBase::TITLE("sparse_format","cal_HR_dftu_soc"); - ModuleBase::timer::tick("sparse_format","cal_HR_dftu_soc"); - - int total_R_num = all_R_coor.size(); - int *nonzero_num = new int[total_R_num](); - ModuleBase::GlobalFunc::ZEROS(nonzero_num, total_R_num); - int count = 0; - for (auto &R_coor : all_R_coor) - { - auto iter = SR_soc_sparse.find(R_coor); - if (iter != SR_soc_sparse.end()) - { - for (auto &row_loop : iter->second) - { - nonzero_num[count] += row_loop.second.size(); - } - } - count++; - } - - Parallel_Reduce::reduce_all(nonzero_num, total_R_num); - - std::complex *HR_soc_tmp = new std::complex[pv.nloc]; - std::complex *SR_soc_tmp = new std::complex[pv.nloc]; - - int ir=0; - int ic=0; - int iic=0; - - count = 0; - for (auto &R_coor : all_R_coor) - { - if (nonzero_num[count] != 0) - { - ModuleBase::GlobalFunc::ZEROS(HR_soc_tmp, pv.nloc); - ModuleBase::GlobalFunc::ZEROS(SR_soc_tmp, pv.nloc); - - auto iter = SR_soc_sparse.find(R_coor); - if (iter != SR_soc_sparse.end()) - { - for (auto &row_loop : iter->second) - { - ir = pv.global2local_row(row_loop.first); - for (auto &col_loop : row_loop.second) - { - ic = pv.global2local_col(col_loop.first); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - SR_soc_tmp[iic] = col_loop.second; - } - } - } - - GlobalC::dftu.cal_eff_pot_mat_R_complex_double(current_spin, SR_soc_tmp, HR_soc_tmp); - - for (int i = 0; i < PARAM.globalv.nlocal; ++i) - { - ir = pv.global2local_row(i); - if (ir >= 0) - { - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - ic = pv.global2local_col(j); - if (ic >= 0) - { - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - - if (std::abs(HR_soc_tmp[iic]) > sparse_thr) - { - std::complex &value = HR_soc_sparse[R_coor][i][j]; - value += HR_soc_tmp[iic]; - if (std::abs(value) <= sparse_thr) - { - HR_soc_sparse[R_coor][i].erase(j); - } - } - } - } - } - } - - } - - count++; - } - - delete[] nonzero_num; - delete[] HR_soc_tmp; - delete[] SR_soc_tmp; - nonzero_num = nullptr; - HR_soc_tmp = nullptr; - SR_soc_tmp = nullptr; - - ModuleBase::timer::tick("sparse_format","calculat_HR_dftu_soc"); - - return; -} diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/spar_u.h b/source/module_hamilt_lcao/hamilt_lcaodft/spar_u.h deleted file mode 100644 index 51f884e1b8..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/spar_u.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SPARSE_FORMAT_U_H -#define SPARSE_FORMAT_U_H - -#include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - - -namespace sparse_format -{ - - void cal_HR_dftu( - const Parallel_Orbitals &pv, - std::set> &all_R_coor, - std::map, std::map>> &SR_sparse, - std::map, std::map>> *HR_sparse, - const int ¤t_spin, - const double &sparse_thr); - - void cal_HR_dftu_soc( - const Parallel_Orbitals &pv, - std::set> &all_R_coor, - std::map, std::map>>> &SR_soc_sparse, - std::map, std::map>>> &HR_soc_sparse, - const int ¤t_spin, - const double &sparse_thr); - -} - -#endif diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.cpp deleted file mode 100644 index 9a62eae1a5..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "stress_tools.h" -namespace StressTools -{ -void stress_fill(const double& lat0_, const double& omega_, ModuleBase::matrix& stress_matrix) -{ - assert(omega_ > 0.0); - double weight = lat0_ / omega_; - for (int i = 0; i < 3; ++i) - { - for (int j = 0; j < 3; ++j) - { - if (j > i) - { - stress_matrix(j, i) = stress_matrix(i, j); - } - stress_matrix(i, j) *= weight; - } - } -} -} // namespace StressTools \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.h b/source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.h deleted file mode 100644 index 305870e3d7..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/stress_tools.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "source_base/matrix.h" -// this namespace used to store global function for some stress operation -namespace StressTools -{ -// set upper matrix to whole matrix -void stress_fill(const double& lat0_, const double& omega_, ModuleBase::matrix& stress_matrix); -} // namespace StressTools \ No newline at end of file diff --git a/source/module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.cpp b/source/module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.cpp deleted file mode 100644 index ca9bc591a4..0000000000 --- a/source/module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "wavefunc_in_pw.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#include // Peize Lin fix bug about strcmp 2016-08-02 -#include "source_base/math_integral.h" -#include "source_base/math_sphbes.h" -#include "source_base/math_polyint.h" -#include "source_base/math_ylmreal.h" -#include "source_pw/hamilt_pwdft/soc.h" - -void Wavefunc_in_pw::make_table_q( - const UnitCell &ucell, - std::vector &fn, - ModuleBase::realArray &table_local) -{ - ModuleBase::TITLE("Wavefunc_in_pw","make_table_q"); - - if( fn.size() != static_cast(ucell.ntype) ) - { - ModuleBase::WARNING_QUIT("Wavefunc_in_pw::make_table_q","maybe NUMERICAL_ORBITAL is not read in, please check."); - } - - for(int it=0; it> word; - if (std::strcmp(word , "END") == 0) // Peize Lin fix bug about strcmp 2016-08-02 - { - break; - } - } - - ModuleBase::CHECK_NAME(in, "Mesh"); - in >> meshr; - int meshr_read = meshr; - if(meshr%2==0) - { - ++meshr; - } - GlobalV::ofs_running << " meshr=" << meshr; - - ModuleBase::CHECK_NAME(in, "dr"); - in >> dr; - GlobalV::ofs_running << " dr=" << dr; - - double* radial = new double[meshr]; - double *psi = new double[meshr]; - double* psir = new double[meshr]; - double* rab = new double[meshr]; - - ModuleBase::GlobalFunc::ZEROS(radial, meshr); - ModuleBase::GlobalFunc::ZEROS(psi, meshr); - ModuleBase::GlobalFunc::ZEROS(psir, meshr); - ModuleBase::GlobalFunc::ZEROS(rab, meshr); - for(int ir=0; ir> name1 >> name2 >> name3; - assert( name1 == "Type" ); - in >> tmp_it >> tmp_l >> tmp_n; - if( L == tmp_l && N == tmp_n ) - { - // meshr_read is different from meshr if meshr is even number. - for(int ir=0; ir> psi[ir]; - //psi[ir] = 1.0; //hahaha - psir[ir] = psi[ir] * radial[ir]; - } - find = true; - } - else - { - double no_use; - for(int ir=0; ir> no_use; - } - } - } - double* table = new double[PARAM.globalv.nqx]; - Wavefunc_in_pw::integral(ucell,meshr, psir, radial, rab, L, table); - for(int iq=0; iq= 1.0 || beta<0 ) - { - ModuleBase::WARNING_QUIT("wavefunc_in_pw::smearing", "beta must between 0 ~ 1 "); - } - - if (energy_x < beta_e) - { - w = 1.0; - } - else if (energy_x >= beta_e && energy_x <= ecut) - { - const double arg = ModuleBase::PI * (ecut - energy_x) * 0.5 / (1-beta) / ecut ; - // const double sin_arg = sin(arg); // gong 2009. 7. 12 , correct - // w = sin_arg*sin_argi ; - w = 0.5 * (1 - cos(2.0 * arg)); - } - else if (energy_x > ecut) - { - w = 0.0 ; - } - - return w ; -} - - -void Wavefunc_in_pw::integral(const UnitCell& ucell, - const int meshr, - const double *psir, - const double *r, - const double *rab, - const int &l, - double* table) -{ - const double pref = ModuleBase::FOUR_PI / sqrt(ucell.omega); - - double *inner_part = new double[meshr]; - for(int ir=0; ir=0); - const int npw = wfc_basis->npwk[ik]; - const int total_lm = ( ucell.lmax + 1) * ( ucell.lmax + 1); - ModuleBase::matrix ylm(total_lm, npw); - std::complex *aux = new std::complex[npw]; - double *chiaux = nullptr; - - ModuleBase::Vector3 *gk = new ModuleBase::Vector3[npw]; - for(int ig=0;iggetgpluskcar(ik, ig); - } - - ModuleBase::YlmReal::Ylm_Real(total_lm, npw, gk, ylm); - - //int index = 0; - double *flq = new double[npw]; - int iwall=0; - for (int it = 0;it < ucell.ntype;it++) - { - for (int ia = 0;ia < ucell.atoms[it].na;ia++) - { - std::complex* sk = sf.get_sk(ik, it, ia, wfc_basis); - int ic = 0; - for(int L = 0; L < ucell.atoms[it].nwl+1; L++) - { - std::complex lphase = pow(ModuleBase::NEG_IMAG_UNIT, L); //mohan 2010-04-19 - for(int N=0; N < ucell.atoms[it].l_nchi[L]; N++) - { -// GlobalV::ofs_running << " it=" << it << " ia=" << ia << " L=" << L << " N=" << N << std::endl; - - for(int ig=0; ignpwk_max) - = lphase * sk[ig] * ylm(lm, ig) * flq[ig]; - } - iwall += 2; - } - }//if - else - {//atomic_wfc_so_mag - double alpha, gamma; - std::complex fup,fdown; - //int nc; - //This routine creates two functions only in the case j=l+1/2 or exit in the other case - if(fabs(j-L+0.5)<1e-4) { continue; -} - delete[] chiaux; - chiaux = new double [npw]; - //Find the functions j= l- 1/2 - if(L==0) { - for(int ig=0;ig ucell.natomwfc) - { - ModuleBase::WARNING_QUIT("this->wf.atomic_wfc()", "error: too many wfcs"); - } - for (int ig = 0; ig < npw; ig++) - { - aux[ig] = sk[ig] * ylm(lm,ig) * chiaux[ig]; - } - //rotate wfc as needed - //first rotation with angle alpha around (OX) - for(int ig = 0;ignpwk_max) - = (cos(0.5 * gamma) - ModuleBase::IMAG_UNIT * sin(0.5 * gamma)) * fdown; - // second rotation with angle gamma around(OZ) - fup = cos(0.5 * (alpha + ModuleBase::PI)) * aux[ig]; - fdown = ModuleBase::IMAG_UNIT * sin(0.5 * (alpha + ModuleBase::PI))*aux[ig]; - psi(iwall+2*L+1,ig) = (cos(0.5*gamma) + ModuleBase::IMAG_UNIT*sin(0.5*gamma))*fup; - psi(iwall + 2 * L + 1, ig + wfc_basis->npwk_max) - = (cos(0.5 * gamma) - ModuleBase::IMAG_UNIT * sin(0.5 * gamma)) * fdown; - } - iwall++; - } - iwall += 2*L +1; - } // end else INPUT.starting_spin_angle || !PARAM.globalv.domag - } // end if ucell.atoms[it].has_so - else - {//atomic_wfc_nc - double alpha, gamman; - std::complex fup, fdown; - //alpha = ucell.magnet.angle1_[it]; - //gamman = -ucell.magnet.angle2_[it] + 0.5*ModuleBase::PI; - alpha = ucell.atoms[it].angle1[ia]; - gamman = -ucell.atoms[it].angle2[ia] + 0.5*ModuleBase::PI; - for(int m = 0;m<2*L+1;m++) - { - const int lm = L*L +m; - if (iwall + 2 * L + 1 > ucell.natomwfc) - { - ModuleBase::WARNING_QUIT("this->wf.atomic_wfc()", "error: too many wfcs"); - } - for (int ig = 0; ig < npw; ig++) - { - aux[ig] = sk[ig] * ylm(lm,ig) * flq[ig]; - } - //rotate function - //first, rotation with angle alpha around(OX) - for(int ig = 0;ignpwk_max) - = (cos(0.5 * gamman) - ModuleBase::IMAG_UNIT * sin(0.5 * gamman)) * fdown; - // second rotation with angle gamma around(OZ) - fup = cos(0.5 * (alpha + ModuleBase::PI)) * aux[ig]; - fdown = ModuleBase::IMAG_UNIT * sin(0.5 * (alpha + ModuleBase::PI)) * aux[ig]; - psi(iwall+2*L+1,ig) = (cos(0.5*gamman) + ModuleBase::IMAG_UNIT*sin(0.5*gamman))*fup; - psi(iwall + 2 * L + 1, ig + wfc_basis->npwk_max) - = (cos(0.5 * gamman) - ModuleBase::IMAG_UNIT * sin(0.5 * gamman)) * fdown; - } // end ig - iwall++; - } // end m - iwall += 2*L+1; - } // end else ucell.atoms[it].has_so - } // end for is_N - } // end if PARAM.inp.noncolin - else - {//LSDA and nomagnet case - for(int m=0; m<2*L+1; m++) - { - const int lm = L*L+m; - for(int ig=0; ig &orbital_files, - ModuleBase::realArray &table_local); - - void integral( - const UnitCell& ucell, - const int meshr, // number of mesh points - const double *psir, - const double *r, - const double *rab, - const int &l, - double* table); - - //mohan add 2010-04-20 - double smearing( - const double &energy_x, - const double &ecut, - const double &beta); - - void produce_local_basis_in_pw(const UnitCell& ucell, - const int& ik, - const ModulePW::PW_Basis_K* wfc_basis, - const Structure_Factor& sf, - ModuleBase::ComplexMatrix& psi, - const ModuleBase::realArray& table_local); - -} -#endif diff --git a/source/module_hamilt_lcao/module_deepks/CMakeLists.txt b/source/module_hamilt_lcao/module_deepks/CMakeLists.txt deleted file mode 100644 index 332b0a77db..0000000000 --- a/source/module_hamilt_lcao/module_deepks/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -if(ENABLE_MLALGO) - list(APPEND objects - LCAO_deepks.cpp - deepks_basic.cpp - deepks_check.cpp - deepks_descriptor.cpp - deepks_force.cpp - deepks_fpre.cpp - deepks_iterate.cpp - deepks_spre.cpp - deepks_orbital.cpp - deepks_orbpre.cpp - deepks_vdelta.cpp - deepks_vdpre.cpp - deepks_vdrpre.cpp - deepks_pdm.cpp - deepks_phialpha.cpp - LCAO_deepks_io.cpp - LCAO_deepks_interface.cpp - ) - - add_library( - deepks - OBJECT - ${objects} - ) - - if(ENABLE_COVERAGE) - add_coverage(deepks) - endif() - -# I will rewrite the test later, the current test rely on too many modules - if(BUILD_TESTING) - add_subdirectory(test) - endif() -endif() - diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp b/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp deleted file mode 100644 index 079e377d50..0000000000 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp +++ /dev/null @@ -1,267 +0,0 @@ -// wenfei 2022-1-5 -// This file contains constructor and destructor of the class LCAO_deepks, -#include "module_parameter/parameter.h" -// as well as subroutines for initializing and releasing relevant data structures - -// Other than the constructor and the destructor, it contains 3 types of subroutines: -// 1. subroutines that are related to calculating descriptors: -// - init : allocates some arrays -// - init_index : records the index (inl) -// 2. subroutines that are related to V_delta: -// - allocate_V_delta : allocates V_delta; if calculating force, it also allocates F_delta - -#ifdef __MLALGO - -#include "LCAO_deepks.h" -#include "deepks_iterate.h" -#include "source_pw/hamilt_pwdft/global.h" - -// Constructor of the class -template -LCAO_Deepks::LCAO_Deepks() -{ - inl_index = new ModuleBase::IntArray[1]; - gedm = nullptr; - this->phialpha.resize(1); -} - -// Desctructor of the class -template -LCAO_Deepks::~LCAO_Deepks() -{ - delete[] inl_index; - - //=======1. to use deepks, pdm is required========== - pdm.clear(); - //=======2. "deepks_scf" part========== - // if (PARAM.inp.deepks_scf) - if (gedm) - { - // delete gedm** - for (int inl = 0; inl < this->inlmax; inl++) - { - delete[] gedm[inl]; - } - delete[] gedm; - } -} - -template -void LCAO_Deepks::init(const LCAO_Orbitals& orb, - const int nat, - const int ntype, - const int nks, - const Parallel_Orbitals& pv_in, - std::vector na, - std::ofstream& ofs) -{ - ModuleBase::TITLE("LCAO_Deepks", "init"); - ModuleBase::timer::tick("LCAO_Deepks", "init"); - - ofs << " Initialize the descriptor index for DeePKS (lcao line)" << std::endl; - - const int lm = orb.get_lmax_d(); - const int nm = orb.get_nchimax_d(); - const int tot_inl_per_atom = orb.Alpha[0].getTotal_nchi(); - - assert(lm >= 0); - assert(nm >= 0); - assert(tot_inl_per_atom >= 0); - - int tot_inl = tot_inl_per_atom * nat; - - if (PARAM.inp.deepks_equiv) - { - tot_inl = nat; - } - - this->lmaxd = lm; - this->nmaxd = nm; - - ofs << " lmax of descriptor = " << this->lmaxd << std::endl; - ofs << " nmax of descriptor = " << nmaxd << std::endl; - - int pdm_size = 0; - this->inlmax = tot_inl; - this->pdm.resize(this->inlmax); - - // cal n(descriptor) per atom , related to Lmax, nchi(L) and m. (not total_nchi!) - if (!PARAM.inp.deepks_equiv) - { - this->des_per_atom = 0; // mohan add 2021-04-21 - for (int l = 0; l <= this->lmaxd; l++) - { - this->des_per_atom += orb.Alpha[0].getNchi(l) * (2 * l + 1); - } - this->n_descriptor = nat * this->des_per_atom; - - this->init_index(ntype, nat, na, tot_inl, orb, ofs); - } - - if (!PARAM.inp.deepks_equiv) - { - ofs << " total basis (all atoms) for descriptor = " << std::endl; - - // init pdm - for (int inl = 0; inl < this->inlmax; inl++) - { - int nm = 2 * inl2l[inl] + 1; - pdm_size += nm * nm; - this->pdm[inl] = torch::zeros({nm, nm}, torch::kFloat64); - } - } - else - { - for (int il = 0; il < this->lmaxd + 1; il++) - { - pdm_size += (2 * il + 1) * orb.Alpha[0].getNchi(il); - } - pdm_size = pdm_size * pdm_size; - this->des_per_atom = pdm_size; - ofs << " Equivariant version, size of pdm matrices : " << pdm_size << std::endl; - for (int iat = 0; iat < nat; iat++) - { - this->pdm[iat] = torch::zeros({pdm_size}, torch::kFloat64); - } - } - - this->pv = &pv_in; - - ModuleBase::timer::tick("LCAO_Deepks", "init"); - return; -} - -template -void LCAO_Deepks::init_index(const int ntype, - const int nat, - std::vector na, - const int Total_nchi, - const LCAO_Orbitals& orb, - std::ofstream& ofs) -{ - delete[] this->inl_index; - this->inl_index = new ModuleBase::IntArray[ntype]; - this->inl2l.resize(this->inlmax, 0); - - int inl = 0; - int alpha = 0; - for (int it = 0; it < ntype; it++) - { - this->inl_index[it].create(na[it], this->lmaxd + 1, this->nmaxd); - - ofs << " Type " << it + 1 << " number_of_atoms " << na[it] << std::endl; - - for (int ia = 0; ia < na[it]; ia++) - { - // alpha - for (int l = 0; l < this->lmaxd + 1; l++) - { - for (int n = 0; n < orb.Alpha[0].getNchi(l); n++) - { - this->inl_index[it](ia, l, n) = inl; - this->inl2l[inl] = l; - inl++; - } - } - } // end ia - } // end it - assert(Total_nchi == inl); - ofs << " descriptors_per_atom " << this->des_per_atom << std::endl; - ofs << " total_descriptors " << this->n_descriptor << std::endl; - return; -} - -template -void LCAO_Deepks::allocate_V_delta(const int nat, const int nks) -{ - ModuleBase::TITLE("LCAO_Deepks", "allocate_V_delta"); - ModuleBase::timer::tick("LCAO_Deepks", "allocate_V_delta"); - - // initialize the H matrix V_delta - V_delta.resize(nks); - for (int ik = 0; ik < nks; ik++) - { - this->V_delta[ik].resize(pv->nloc); - ModuleBase::GlobalFunc::ZEROS(this->V_delta[ik].data(), pv->nloc); - } - - // init gedm** - int pdm_size = 0; - if (!PARAM.inp.deepks_equiv) - { - pdm_size = (this->lmaxd * 2 + 1) * (this->lmaxd * 2 + 1); - } - else - { - pdm_size = this->des_per_atom; - } - - this->gedm = new double*[this->inlmax]; - for (int inl = 0; inl < this->inlmax; inl++) - { - this->gedm[inl] = new double[pdm_size]; - ModuleBase::GlobalFunc::ZEROS(this->gedm[inl], pdm_size); - } - - ModuleBase::timer::tick("LCAO_Deepks", "allocate_V_delta"); - return; -} - -template -void LCAO_Deepks::init_DMR(const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD) -{ - this->dm_r = new hamilt::HContainer(&pv); - DeePKS_domain::iterate_ad2( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1, - const int ibt2, - const ModuleBase::Vector3& tau2, - const int start2, - const int nw2_tot, - ModuleBase::Vector3 dR2) - { - auto row_indexes = pv.get_indexes_row(ibt1); - auto col_indexes = pv.get_indexes_col(ibt2); - if (row_indexes.size() * col_indexes.size() == 0) - { - return; // to next loop - } - - int dRx = 0; - int dRy = 0; - int dRz = 0; - if (std::is_same>::value) - { - dRx = (dR1 - dR2).x; - dRy = (dR1 - dR2).y; - dRz = (dR1 - dR2).z; - } - hamilt::AtomPair dm_pair(ibt1, ibt2, dRx, dRy, dRz, &pv); - this->dm_r->insert_pair(dm_pair); - } - ); - this->dm_r->allocate(nullptr, true); -} - -template -void LCAO_Deepks::dpks_cal_e_delta_band(const std::vector>& dm, const int nks) -{ - DeePKS_domain::cal_e_delta_band(dm, this->V_delta, nks, PARAM.inp.nspin, this->pv, this->e_delta_band); -} - -template class LCAO_Deepks; -template class LCAO_Deepks>; - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h b/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h deleted file mode 100644 index 6d22ff5664..0000000000 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef LCAO_DEEPKS_H -#define LCAO_DEEPKS_H - -#ifdef __MLALGO - -#include "deepks_basic.h" -#include "deepks_check.h" -#include "deepks_descriptor.h" -#include "deepks_force.h" -#include "deepks_fpre.h" -#include "deepks_orbital.h" -#include "deepks_orbpre.h" -#include "deepks_pdm.h" -#include "deepks_phialpha.h" -#include "deepks_spre.h" -#include "deepks_vdelta.h" -#include "deepks_vdpre.h" -#include "deepks_vdrpre.h" -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_io/winput.h" - -#include -#include - -/// -/// The LCAO_Deepks contains subroutines for implementation of the DeePKS method in atomic basis. -/// In essential, it is a machine-learned correction term to the XC potential -/// in the form of delta_V=|alpha> V(D) -/// and then descriptors D=eig(pdm) -/// as well as their gradients with regard to atomic position, gdmx = d/dX (pdm) -/// and grad_vx = d/dX (D) -/// 2. loading the model, which requires interfaces with libtorch -/// 3. applying the correction potential, delta_V, in Kohn-Sham Hamiltonian and calculation of energy, force, stress -/// -/// For details of DeePKS method, you can refer to [DeePKS paper](https://pubs.acs.org/doi/10.1021/acs.jctc.0c00872). -/// -/// -// caoyu add 2021-03-29 -// wenfei modified 2022-1-5 -// -template -class LCAO_Deepks -{ - - //------------------- - // public variables - //------------------- - public: - ///(Unit: Ry) Correction energy provided by NN - double E_delta = 0.0; - ///(Unit: Ry) \f$tr(\rho H_\delta), \rho = \sum_i{c_{i, \mu}c_{i,\nu}} \f$ - double e_delta_band = 0.0; - - /// Correction term to the Hamiltonian matrix: \f$\langle\phi|V_\delta|\phi\rangle\f$ - /// The first dimension is for k-points V_delta(k) - std::vector> V_delta; - - //------------------- - // private variables - //------------------- - // private: - public: // change to public to reconstuct the code, 2024-07-22 by mohan - int lmaxd = 0; // max l of descirptors - int nmaxd = 0; //#. descriptors per l - int inlmax = 0; // tot. number {i,n,l} - atom, n, l - int n_descriptor; // natoms * des_per_atom, size of descriptor(projector) basis set - int des_per_atom; // \sum_L{Nchi(L)*(2L+1)} - std::vector inl2l; // inl2l[inl] = inl2l[nl] = l (not related to iat) of descriptor with inl_index - ModuleBase::IntArray* inl_index; // caoyu add 2021-05-07 - - bool init_pdm = false; // for DeePKS NSCF calculation, set init_pdm to skip the calculation of pdm in SCF iteration - - // deep neural network module that provides corrected Hamiltonian term and - // related derivatives. Used in cal_edelta_gedm. - torch::jit::script::Module model_deepks; - - // saves and its derivatives - // index 0 for itself and index 1-3 for derivatives over x,y,z - std::vector*> phialpha; - - // density matrix in real space - hamilt::HContainer* dm_r = nullptr; - - // projected density matrix - // [tot_Inl][2l+1][2l+1], here l is corresponding to inl; - // [nat][nlm*nlm] for equivariant version - std::vector pdm; - - /// dE/dD, autograd from loaded model(E: Ry) - double** gedm; //[tot_Inl][(2l+1)*(2l+1)] - - // functions for hr status: 1. get value; 2. set value; - int get_hr_cal() - { - return this->hr_cal; - } - void set_hr_cal(bool cal) - { - this->hr_cal = cal; - } - - //------------------- - // LCAO_deepks.cpp - //------------------- - - // This file contains constructor and destructor of the class LCAO_deepks, - // as well as subroutines for initializing and releasing relevant data structures - - // Other than the constructor and the destructor, it contains 3 types of subroutines: - // 1. subroutines that are related to calculating descriptors: - // - init : allocates some arrays - // - init_index : records the index (inl) - // 2. subroutines that are related to V_delta: - // - allocate_V_delta : allocates V_delta; if calculating force, it also allocates F_delta - - public: - explicit LCAO_Deepks(); - ~LCAO_Deepks(); - - /// Allocate memory and calculate the index of descriptor in all atoms. - ///(only for descriptor part, not including scf) - void init(const LCAO_Orbitals& orb, - const int nat, - const int ntype, - const int nks, - const Parallel_Orbitals& pv_in, - std::vector na, - std::ofstream& ofs); - - /// Allocate memory for correction to Hamiltonian - void allocate_V_delta(const int nat, const int nks = 1); - - /// Initialize the dm_r container - void init_DMR(const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD); - - //! a temporary interface for cal_e_delta_band - void dpks_cal_e_delta_band(const std::vector>& dm, const int nks); - - private: - // flag of HR status, - // true : HR should be calculated - // false : HR has been calculated - bool hr_cal = true; - - // arrange index of descriptor in all atoms - void init_index(const int ntype, - const int nat, - std::vector na, - const int tot_inl, - const LCAO_Orbitals& orb, - std::ofstream& ofs); - - const Parallel_Orbitals* pv; -}; - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp b/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp deleted file mode 100644 index 0df76b92af..0000000000 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp +++ /dev/null @@ -1,682 +0,0 @@ -#ifdef __MLALGO -#include "LCAO_deepks_interface.h" - -#include "LCAO_deepks_io.h" // mohan add 2024-07-22 -#include "source_estate/cal_dm.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_hcontainer/output_hcontainer.h" -#include "module_parameter/parameter.h" -#include "source_base/global_variable.h" -#include "source_base/tool_title.h" - -#include - -template -LCAO_Deepks_Interface::LCAO_Deepks_Interface(std::shared_ptr> ld_in) : ld(ld_in) -{ -} - -// Helper function to map file_type to true names -std::string true_file_type(const std::string& file_type) -{ - static const std::unordered_map file_type_map = { - {"etot", "energy"}, - {"ftot", "force"}, - {"stot", "stress"}, - {"otot", "orbital"}, - {"htot", "hamiltonian"} - }; - - auto it = file_type_map.find(file_type); - return it != file_type_map.end() ? it->second : file_type; -} - -// global_out_dir/deepks_*.npy for iter=-1 (called in after_scf) -// global_out_dir/DeePKS_Labels_Elec/*_e*.npy for iter>0 (called during electronic steps) -std::string get_filename(const std::string& file_type, - const int& label_type, - const int& iter) -{ - std::ostringstream file_name; - file_name << (iter == -1 ? PARAM.globalv.global_out_dir : PARAM.globalv.global_deepks_label_elec_dir); - if (iter == -1) - { - file_name << "deepks_"; - } - file_name << (label_type == 2 ? true_file_type(file_type) : file_type); - if (iter != -1) - { - file_name << "_e" << iter; - } - file_name << ".npy"; - return file_name.str(); -} - -template -void LCAO_Deepks_Interface::out_deepks_labels(const double& etot, - const int& nks, - const int& nat, - const int& nlocal, - const ModuleBase::matrix& ekb, - const std::vector>& kvec_d, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* ParaV, - const psi::Psi& psi, - const elecstate::DensityMatrix* dm, - hamilt::HamiltLCAO* p_ham, - const int& iter, - const bool& conv_esolver, - const int rank, - std::ostream& ofs_running) -{ - ModuleBase::TITLE("LCAO_Deepks_Interface", "out_deepks_labels"); - ModuleBase::timer::tick("LCAO_Deepks_Interface", "out_deepks_labels"); - - // Note: out_deepks_labels does not support equivariant version now! - - // define TH for different types - using TH = std::conditional_t::value, ModuleBase::matrix, ModuleBase::ComplexMatrix>; - - // These variables are frequently used in the following code - const int nlmax = orb.Alpha[0].getTotal_nchi(); - const int inlmax = nlmax * nat; - const int lmaxd = orb.get_lmax_d(); - const int nmaxd = ld->nmaxd; - - const int des_per_atom = ld->des_per_atom; - const std::vector inl2l = ld->inl2l; - const ModuleBase::IntArray* inl_index = ld->inl_index; - const std::vector*> phialpha = ld->phialpha; - - std::vector pdm = ld->pdm; - bool init_pdm = ld->init_pdm; - double E_delta = ld->E_delta; - double e_delta_band = ld->e_delta_band; - hamilt::HContainer* dmr = ld->dm_r; - - const int nspin = PARAM.inp.nspin; - const int nk = nks / nspin; - - const bool not_first_step = (iter != 1); // not output in the first electronic step, for energy and otot/obase - const bool not_last_step = (iter == -1) || !conv_esolver; //not output in the last electronic step - const bool is_after_scf = (iter == -1); // called in after_scf, not in electronic steps - - // Update DMR in any case of deepks_out_labels/deepks_scf - DeePKS_domain::update_dmr(kvec_d, dm->get_DMK_vector(), ucell, orb, *ParaV, GridD, dmr); - - // Note : update PDM and all other quantities with the current dm - // DeePKS PDM and descriptor - if (PARAM.inp.deepks_out_labels == 1 || PARAM.inp.deepks_scf) - { - // this part is for integrated test of deepks - // so it is printed no matter even if deepks_out_labels is not used - DeePKS_domain::cal_pdm< - TK>(init_pdm, inlmax, lmaxd, inl2l, inl_index, kvec_d, dmr, phialpha, ucell, orb, GridD, *ParaV, pdm); - - DeePKS_domain::check_pdm(inlmax, inl2l, pdm); // print out the projected dm for NSCF calculaiton - - std::vector descriptor; - DeePKS_domain::cal_descriptor(nat, inlmax, inl2l, pdm, descriptor, - des_per_atom); // final descriptor - DeePKS_domain::check_descriptor(inlmax, - des_per_atom, - inl2l, - ucell, - PARAM.globalv.global_out_dir, - descriptor, - rank); - - if ( not_last_step ) - { - const int true_iter = is_after_scf ? iter : iter + 1; - const std::string file_d = get_filename("dm_eig", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_npy_d(nat, - des_per_atom, - inlmax, - inl2l, - PARAM.inp.deepks_equiv, - descriptor, - file_d, - rank); // libnpy needed - } - - - if (PARAM.inp.deepks_scf) - { - // update E_delta and gedm - // new gedm is also useful in cal_f_delta, so it should be ld->gedm - if (PARAM.inp.deepks_equiv) - { - DeePKS_domain::cal_edelta_gedm_equiv(nat, - lmaxd, - nmaxd, - inlmax, - des_per_atom, - inl2l, - descriptor, - ld->gedm, - E_delta, - rank); - } - else - { - DeePKS_domain::cal_edelta_gedm(nat, - inlmax, - des_per_atom, - inl2l, - descriptor, - pdm, - ld->model_deepks, - ld->gedm, - E_delta); - } - } - } - - // Used for deepks_bandgap == 1 and deepks_v_delta > 0 - std::vector>* h_delta = &ld->V_delta; - - // calculating deepks correction and save the results - if (PARAM.inp.deepks_out_labels) - { - // Used for deepks_scf == 1 or deepks_out_freq_elec!=0, for *precalc items, not for deepks_out_labels=2 - std::vector gevdm; - if ((PARAM.inp.deepks_scf || PARAM.inp.deepks_out_freq_elec) && PARAM.inp.deepks_out_labels !=2 ) - { - DeePKS_domain::cal_gevdm(nat, inlmax, inl2l, pdm, gevdm); - } - - if ( not_first_step) - { - // Energy Part - const std::string file_etot = get_filename("etot", PARAM.inp.deepks_out_labels, iter); - LCAO_deepks_io::save_npy_e(etot, file_etot, rank); - - if (PARAM.inp.deepks_out_labels == 1) - { - const std::string file_ebase = get_filename("ebase", PARAM.inp.deepks_out_labels, iter); - if (PARAM.inp.deepks_scf) - { - /// ebase :no deepks E_delta including - LCAO_deepks_io::save_npy_e(etot - E_delta, file_ebase, rank); - } - else // deepks_scf = 0; base calculation - { - /// no scf, e_tot=e_base - LCAO_deepks_io::save_npy_e(etot, file_ebase, rank); - } - } - } - - // Bandgap Part - if (PARAM.inp.deepks_bandgap > 0) - { - // Get the number of the occupied bands - // Notice that the index of band starts from 0, so actually (nocc - 1) is the index of HOMO state - int nocc = (PARAM.inp.nelec + 1) / 2; - if (PARAM.inp.deepks_bandgap == 3) - { - int natom_H = 0; - for (int it = 0; it < ucell.ntype; it++) - { - if (ucell.atoms[it].label == "H") - { - natom_H = ucell.atoms[it].na; - break; - } - } - nocc = (PARAM.inp.nelec - natom_H) / 2; - } - - // Get the number of bandgap to be recorded - int range = 1; // normally use only one gap - if (PARAM.inp.deepks_bandgap == 2) // for bandgap label 2, use multi bandgap - { - range = PARAM.inp.deepks_band_range[1] - PARAM.inp.deepks_band_range[0] + 1; - // For cases where HOMO(nocc - 1) is included in the range - if ((PARAM.inp.deepks_band_range[0] <= -1) && (PARAM.inp.deepks_band_range[1] >= -1)) - { - range -= 1; - } - } - - // Calculate the bandgap for each k point - ModuleBase::matrix o_tot(nks, range); - if ( not_first_step) - { - for (int iks = 0; iks < nks; ++iks) - { - int ib = 0; - if (PARAM.inp.deepks_bandgap == 1 || PARAM.inp.deepks_bandgap == 3) - { - o_tot(iks, ib) = ekb(iks, nocc + PARAM.inp.deepks_band_range[1]) - - ekb(iks, nocc + PARAM.inp.deepks_band_range[0]); - } - else if (PARAM.inp.deepks_bandgap == 2) - { - for (int ir = PARAM.inp.deepks_band_range[0]; ir <= PARAM.inp.deepks_band_range[1]; ++ir) - { - if (ir != -1) - { - o_tot(iks, ib) = ekb(iks, nocc + ir) - ekb(iks, nocc - 1); - ib++; - } - } - assert(ib == range); // ensure that we have filled all the bandgap values - } - } - - const std::string file_otot = get_filename("otot", PARAM.inp.deepks_out_labels, iter); - LCAO_deepks_io::save_matrix2npy(file_otot, o_tot, rank); // Unit: Hartree - } - - - if (PARAM.inp.deepks_out_labels == 1) // don't need these when deepks_out_labels == 2 - { - if (PARAM.inp.deepks_scf || PARAM.inp.deepks_out_freq_elec) - { - std::vector wg_hl_range(range); - for (int ir = 0; ir < range; ++ir) - { - wg_hl_range[ir].create(nks, PARAM.inp.nbands); - wg_hl_range[ir].zero_out(); - } - - // Calculate O_delta - for (int iks = 0; iks < nks; ++iks) - { - int ib = 0; - if (PARAM.inp.deepks_bandgap == 1 || PARAM.inp.deepks_bandgap == 3) - { - wg_hl_range[ib](iks, nocc + PARAM.inp.deepks_band_range[0]) = -1.0; - wg_hl_range[ib](iks, nocc + PARAM.inp.deepks_band_range[1]) = 1.0; - } - else if (PARAM.inp.deepks_bandgap == 2) - { - for (int ir = PARAM.inp.deepks_band_range[0]; ir <= PARAM.inp.deepks_band_range[1]; ++ir) - { - if (ir != -1) - { - wg_hl_range[ib](iks, nocc - 1) = -1.0; - wg_hl_range[ib](iks, nocc + ir) = 1.0; - ib++; - } - } - } - } - - ModuleBase::matrix o_delta(nks, range); - torch::Tensor orbital_precalc; - for (int ir = 0; ir < range; ++ir) - { - std::vector dm_bandgap(nks); - elecstate::cal_dm(ParaV, wg_hl_range[ir], psi, dm_bandgap); - - torch::Tensor orbital_precalc_temp; - ModuleBase::matrix o_delta_temp(nks, 1); - DeePKS_domain::cal_orbital_precalc(dm_bandgap, - lmaxd, - inlmax, - nat, - nks, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - orbital_precalc_temp); - if (ir == 0) - { - orbital_precalc = orbital_precalc_temp; - } - else - { - orbital_precalc = torch::cat({orbital_precalc, orbital_precalc_temp}, 0); - } - - if (PARAM.inp.deepks_scf) - { - DeePKS_domain::cal_o_delta(dm_bandgap, *h_delta, o_delta_temp, *ParaV, nks, nspin); - for (int iks = 0; iks < nks; ++iks) - { - o_delta(iks, ir) = o_delta_temp(iks, 0); - } - } - } - // save obase and orbital_precalc - if ( not_last_step ) - { - const int true_iter = (iter == -1) ? iter : iter + 1; - const std::string file_orbpre = get_filename("orbpre", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_tensor2npy(file_orbpre, orbital_precalc, rank); - } - - if ( not_first_step) - { - if (PARAM.inp.deepks_scf) - { - const std::string file_obase = get_filename("obase", PARAM.inp.deepks_out_labels, iter); - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot - o_delta, rank); // Unit: Hartree - } - else - { - const std::string file_obase = get_filename("obase", PARAM.inp.deepks_out_labels, iter); - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot, rank); // no scf, o_tot=o_base - } - } - } - } // end deepks_out_labels == 1 - } // end deepks_bandgap > 0 - - if ( is_after_scf ) - { - // Force Part - if (PARAM.inp.cal_force) - { - // these items are not related to model, so can output without deepks_scf - if (PARAM.inp.deepks_out_labels == 1 // don't need these when deepks_out_labels == 2 - && !PARAM.inp.deepks_equiv) // training with force label not supported by equivariant version now - { - torch::Tensor gdmx; - DeePKS_domain::cal_gdmx< - TK>(lmaxd, inlmax, nks, kvec_d, phialpha, inl_index, dmr, ucell, orb, *ParaV, GridD, gdmx); - - torch::Tensor gvx; - DeePKS_domain::cal_gvx(ucell.nat, inlmax, des_per_atom, inl2l, gevdm, gdmx, gvx, rank); - const std::string file_gradvx = get_filename("gradvx", PARAM.inp.deepks_out_labels, iter); - LCAO_deepks_io::save_tensor2npy(file_gradvx, gvx, rank); - - if (PARAM.inp.deepks_out_unittest) - { - DeePKS_domain::check_tensor(gdmx, "gdmx.dat", rank); - DeePKS_domain::check_tensor(gvx, "gvx.dat", rank); - } - } - } - - // Stress Part - if (PARAM.inp.cal_stress) - { - // these items are not related to model, so can output without deepks_scf - if (PARAM.inp.deepks_out_labels == 1 // don't need these when deepks_out_labels == 2 - && !PARAM.inp.deepks_equiv) // training with stress label not supported by equivariant version now - { - torch::Tensor gdmepsl; - DeePKS_domain::cal_gdmepsl< - TK>(lmaxd, inlmax, nks, kvec_d, phialpha, inl_index, dmr, ucell, orb, *ParaV, GridD, gdmepsl); - - torch::Tensor gvepsl; - DeePKS_domain::cal_gvepsl(ucell.nat, inlmax, des_per_atom, inl2l, gevdm, gdmepsl, gvepsl, rank); - const std::string file_gvepsl = get_filename("gvepsl", PARAM.inp.deepks_out_labels, iter); - LCAO_deepks_io::save_tensor2npy(file_gvepsl, gvepsl, rank); - - if (PARAM.inp.deepks_out_unittest) - { - DeePKS_domain::check_tensor(gdmepsl, "gdmepsl.dat", rank); - DeePKS_domain::check_tensor(gvepsl, "gvepsl.dat", rank); - } - } - } - - - - // not add deepks_out_labels = 2 and deepks_out_freq_elec for HR yet - // H(R) matrix part, for HR, base will not be calculated since they are HContainer objects - if (PARAM.inp.deepks_v_delta < 0) - { - // set the output - const double sparse_threshold = 1e-10; - const int precision = 8; - const std::string file_hrtot - = PARAM.globalv.global_out_dir - + (PARAM.inp.deepks_out_labels == 1 ? "deepks_hrtot.csr" : "deepks_hamiltonian_r.csr"); - hamilt::HContainer* hR_tot = (p_ham->getHR()); - - if (rank == 0) - { - std::ofstream ofs_hr(file_hrtot, std::ios::out); - ofs_hr << "Matrix Dimension of H(R): " << hR_tot->get_nbasis() << std::endl; - ofs_hr << "Matrix number of H(R): " << hR_tot->size_R_loop() << std::endl; - hamilt::Output_HContainer out_hr(hR_tot, ofs_hr, sparse_threshold, precision); - out_hr.write(true); // write all the matrices, including empty ones - ofs_hr.close(); - } - - if (PARAM.inp.deepks_scf) - { - if (PARAM.inp.deepks_out_labels == 1) - { - const std::string file_vdeltar = PARAM.globalv.global_out_dir + "deepks_hrdelta.csr"; - hamilt::HContainer* h_deltaR = p_ham->get_V_delta_R(); - - if (rank == 0) - { - std::ofstream ofs_hr(file_vdeltar, std::ios::out); - ofs_hr << "Matrix Dimension of H_delta(R): " << h_deltaR->get_nbasis() << std::endl; - ofs_hr << "Matrix number of H_delta(R): " << h_deltaR->size_R_loop() << std::endl; - hamilt::Output_HContainer out_hr(h_deltaR, ofs_hr, sparse_threshold, precision); - out_hr.write(true); // write all the matrices, including empty ones - ofs_hr.close(); - } - - if (PARAM.inp.deepks_v_delta == -1) - { - int R_size = DeePKS_domain::get_R_size(*h_deltaR); - torch::Tensor vdr_precalc; - DeePKS_domain::cal_vdr_precalc(nlocal, - lmaxd, - inlmax, - nat, - nks, - R_size, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - vdr_precalc); - - const std::string file_vdrpre = PARAM.globalv.global_out_dir + "deepks_vdrpre.npy"; - LCAO_deepks_io::save_tensor2npy(file_vdrpre, vdr_precalc, rank); - } - else if (PARAM.inp.deepks_v_delta == -2) - { - int R_size = DeePKS_domain::get_R_size(*h_deltaR); - torch::Tensor phialpha_r_out; - DeePKS_domain::prepare_phialpha_r(nlocal, - lmaxd, - inlmax, - nat, - R_size, - phialpha, - ucell, - orb, - *ParaV, - GridD, - phialpha_r_out); - const std::string file_phialpha_r = PARAM.globalv.global_out_dir + "deepks_phialpha_r.npy"; - LCAO_deepks_io::save_tensor2npy(file_phialpha_r, phialpha_r_out, rank); - - torch::Tensor gevdm_out; - DeePKS_domain::prepare_gevdm(nat, lmaxd, inlmax, orb, gevdm, gevdm_out); - const std::string file_gevdm = PARAM.globalv.global_out_dir + "deepks_gevdm.npy"; - LCAO_deepks_io::save_tensor2npy(file_gevdm, gevdm_out, rank); - } - } - } - } - } - - if ( not_last_step ) - { - const int true_iter = is_after_scf ? iter : iter + 1; - // H(k) matrix part - if (PARAM.inp.deepks_v_delta > 0) - { - std::vector h_tot(nks); - DeePKS_domain::get_h_tot(*ParaV, p_ham, h_tot, nlocal, nks, 'H'); - - const std::string file_htot = get_filename("htot", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_npy_h(h_tot, file_htot, nlocal, nks, rank); - - if (PARAM.inp.deepks_out_labels == 1) // don't need these when deepks_out_labels == 2 - { - if (PARAM.inp.deepks_scf || PARAM.inp.deepks_out_freq_elec) - { - if (PARAM.inp.deepks_scf) - { - std::vector v_delta(nks); - std::vector h_base(nks); - for (int ik = 0; ik < nks; ik++) - { - v_delta[ik].create(nlocal, nlocal); - h_base[ik].create(nlocal, nlocal); - } - DeePKS_domain::collect_h_mat(*ParaV, *h_delta, v_delta, nlocal, nks); - - // save v_delta and h_base - const std::string file_hbase = get_filename("hbase", PARAM.inp.deepks_out_labels, true_iter); - for (int ik = 0; ik < nks; ik++) - { - h_base[ik] = h_tot[ik] - v_delta[ik]; - } - LCAO_deepks_io::save_npy_h(h_base, file_hbase, nlocal, nks, rank); - - const std::string file_vdelta = get_filename("vdelta", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_npy_h(v_delta, file_vdelta, nlocal, nks, rank); - } - else // deepks_scf == 0 - { - const std::string file_hbase = get_filename("hbase", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_npy_h(h_tot, file_hbase, nlocal, nks, rank); - } - - if (PARAM.inp.deepks_v_delta == 1) // v_delta_precalc storage method 1 - { - torch::Tensor v_delta_precalc; - DeePKS_domain::cal_v_delta_precalc(nlocal, - lmaxd, - inlmax, - nat, - nks, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - v_delta_precalc); - - const std::string file_vdpre = get_filename("vdpre", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_tensor2npy(file_vdpre, v_delta_precalc, rank); - } - else if (PARAM.inp.deepks_v_delta == 2) // v_delta_precalc storage method 2 - { - torch::Tensor phialpha_out; - DeePKS_domain::prepare_phialpha(nlocal, - lmaxd, - inlmax, - nat, - nks, - kvec_d, - phialpha, - ucell, - orb, - *ParaV, - GridD, - phialpha_out); - const std::string file_phialpha = get_filename("phialpha", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_tensor2npy(file_phialpha, phialpha_out, rank); - - torch::Tensor gevdm_out; - DeePKS_domain::prepare_gevdm(nat, lmaxd, inlmax, orb, gevdm, gevdm_out); - const std::string file_gevdm = get_filename("gevdm", PARAM.inp.deepks_out_labels, true_iter); - LCAO_deepks_io::save_tensor2npy(file_gevdm, gevdm_out, rank); - } - } - } // end deepks_out_labels == 1 - } // end v_delta label - } - - } // end deepks_out_labels - - if (iter < 0)// only output when called in after_scf - { - // don't need to output in multiple electronic steps - if (PARAM.inp.deepks_out_labels == 2) - { - // output atom.npy and box.npy - torch::Tensor atom_out; - DeePKS_domain::prepare_atom(ucell, atom_out); - const std::string file_atom = PARAM.globalv.global_out_dir + "deepks_atom.npy"; - LCAO_deepks_io::save_tensor2npy(file_atom, atom_out, rank); - - torch::Tensor box_out; - DeePKS_domain::prepare_box(ucell, box_out); - const std::string file_box = PARAM.globalv.global_out_dir + "deepks_box.npy"; - LCAO_deepks_io::save_tensor2npy(file_box, box_out, rank); - - if (PARAM.inp.deepks_v_delta > 0) - { - // prepare for overlap.npy, very much like h_tot except for p_ham->getSk() - std::vector s_tot(nks); - DeePKS_domain::get_h_tot(*ParaV, p_ham, s_tot, nlocal, nks, 'S'); - const std::string file_stot = PARAM.globalv.global_out_dir + "deepks_overlap.npy"; - LCAO_deepks_io::save_npy_h(s_tot, - file_stot, - nlocal, - nks, - rank, - 1.0); // don't need unit_scale for overlap - } - } - - /// print out deepks information to the screen - if (PARAM.inp.deepks_scf) - { - DeePKS_domain::cal_e_delta_band(dm->get_DMK_vector(), *h_delta, nks, nspin, ParaV, e_delta_band); - if (rank == 0) - { - ofs_running << " DeePKS Energy Correction" << std::endl; - ofs_running << " -----------------------------------------------" << std::endl; - ofs_running << " E_delta_band = " << std::setprecision(8) << e_delta_band << " Ry" - << " = " << std::setprecision(8) << e_delta_band * ModuleBase::Ry_to_eV << " eV" << std::endl; - ofs_running << " E_delta_NN = " << std::setprecision(8) << E_delta << " Ry" - << " = " << std::setprecision(8) << E_delta * ModuleBase::Ry_to_eV << " eV" << std::endl; - ofs_running << " -----------------------------------------------" << std::endl; - } - if (PARAM.inp.deepks_out_unittest) - { - LCAO_deepks_io::print_dm(nks, PARAM.globalv.nlocal, ParaV->nrow, dm->get_DMK_vector()); - - DeePKS_domain::check_gedm(inlmax, inl2l, ld->gedm); - - std::ofstream ofs("E_delta_bands.dat"); - ofs << std::setprecision(10) << e_delta_band; - - std::ofstream ofs1("E_delta.dat"); - ofs1 << std::setprecision(10) << E_delta; - } - } - } - ModuleBase::timer::tick("LCAO_Deepks_Interface", "out_deepks_labels"); -} - -template class LCAO_Deepks_Interface; -template class LCAO_Deepks_Interface, double>; -template class LCAO_Deepks_Interface, std::complex>; - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.h b/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.h deleted file mode 100644 index 2a8057a637..0000000000 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef LCAO_DEEPKS_INTERFACE_H -#define LCAO_DEEPKS_INTERFACE_H - -#ifdef __MLALGO -#include "LCAO_deepks.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_base/complexmatrix.h" -#include "source_base/matrix.h" - -#include - -template -class LCAO_Deepks_Interface -{ - public: - /// @brief Constructor for LCAO_Deepks_Interface - /// @param ld_in - LCAO_Deepks_Interface(std::shared_ptr> ld_in); - /// @brief output deepks-related labels, descriptors and energy corrections - /// @param[in] etot - /// @param[in] nks - /// @param[in] nat - /// @param[in] nlocal - /// @param[in] ekb - /// @param[in] kvec_d - /// @param[in] ucell - /// @param[in] orb - /// @param[in] GridD - /// @param[in] ParaV - /// @param[in] psid - /// @param[in] dm - /// @param[in] p_ham - /// @param[in] iter - /// @param[in] conv_esolver - /// @param[in] rank - void out_deepks_labels(const double& etot, - const int& nks, - const int& nat, - const int& nlocal, - const ModuleBase::matrix& ekb, - const std::vector>& kvec_d, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* ParaV, - const psi::Psi& psid, - const elecstate::DensityMatrix* dm, - hamilt::HamiltLCAO* p_ham, - const int& iter, - const bool& conv_esolver, - const int rank, - std::ostream& ofs_running); - - private: - std::shared_ptr> ld; -}; - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.cpp b/source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.cpp deleted file mode 100644 index e5c75d6402..0000000000 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.cpp +++ /dev/null @@ -1,330 +0,0 @@ -#include "module_parameter/parameter.h" - -#ifdef __MLALGO - -#include "LCAO_deepks_io.h" -#include "source_base/tool_quit.h" -#include "npy.hpp" - -#include - -template -void LCAO_deepks_io::print_dm(const int nks, const int nlocal, const int nrow, const std::vector>& dm) -{ - std::stringstream ss; - for (int ik = 0; ik < nks; ik++) - { - ss.str(""); - ss << "dm_" << ik; - std::ofstream ofs(ss.str().c_str()); - ofs << std::setprecision(15); - - for (int mu = 0; mu < nlocal; mu++) - { - for (int nu = 0; nu < nlocal; nu++) - { - ofs << dm[ik][mu * nrow + nu] << " "; - } - ofs << std::endl; - } - } -} - -void LCAO_deepks_io::load_npy_gedm(const int nat, - const int des_per_atom, - double** gedm, - double& e_delta, - const int rank) -{ - ModuleBase::TITLE("LCAO_deepks_io", "load_npy_gedm"); - - if (rank == 0) - { - // load gedm.npy - std::vector npy_gedm; - std::vector dshape = {static_cast(nat), static_cast(des_per_atom)}; - - std::string gedm_file = "gedm.npy"; - - npy::LoadArrayFromNumpy(gedm_file, dshape, npy_gedm); - - for (int iat = 0; iat < nat; iat++) - { - for (int ides = 0; ides < des_per_atom; ides++) - { - gedm[iat][ides] = npy_gedm[iat * des_per_atom + ides] * 2.0; // Ha to Ry - } - } - - // load ec.npy - std::vector npy_ec; - std::vector eshape = {1ul}; - std::string ec_file = "ec.npy"; - npy::LoadArrayFromNumpy(ec_file, eshape, npy_ec); - e_delta = npy_ec[0] * 2.0; // Ha to Ry - } - -#ifdef __MPI - for (int iat = 0; iat < nat; iat++) - { - MPI_Bcast(gedm[iat], des_per_atom, MPI_DOUBLE, 0, MPI_COMM_WORLD); - } - MPI_Bcast(&e_delta, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); -#endif -} - -// saves descriptor into dm_eig.npy -void LCAO_deepks_io::save_npy_d(const int nat, - const int des_per_atom, - const int inlmax, - const std::vector& inl2l, - const bool deepks_equiv, - const std::vector& descriptor, - const std::string& dm_eig_file, - const int rank) -{ - ModuleBase::TITLE("LCAO_deepks_io", "save_npy_d"); - - if (rank != 0) - { - return; - } - - // save descriptor in .npy format - // deepks_equiv was PARAM.inp.deepks_equiv - if (!deepks_equiv) - { - std::vector npy_des; - for (int inl = 0; inl < inlmax; ++inl) - { - auto accessor = descriptor[inl].accessor(); - int nm = 2 * inl2l[inl] + 1; - for (int im = 0; im < nm; im++) - { - npy_des.push_back(accessor[im]); - } - } - const long unsigned dshape[] = {static_cast(nat), static_cast(des_per_atom)}; - if (rank == 0) - { - npy::SaveArrayAsNumpy(dm_eig_file, false, 2, dshape, npy_des); - } - } - else - { - // a rather unnecessary way of writing this, but I'll do it for now - std::vector npy_des; - for (int iat = 0; iat < nat; iat++) - { - auto accessor = descriptor[iat].accessor(); - for (int i = 0; i < des_per_atom; i++) - { - npy_des.push_back(accessor[i]); - } - } - const long unsigned dshape[] = {static_cast(nat), static_cast(des_per_atom)}; - if (rank == 0) - { - npy::SaveArrayAsNumpy(dm_eig_file, false, 2, dshape, npy_des); - } - } - return; -} - -// saves energy in numpy format -void LCAO_deepks_io::save_npy_e(const double& e, const std::string& e_file, const int rank, const double unit_scale) -{ - ModuleBase::TITLE("LCAO_deepks_io", "save_npy_e"); - if (rank != 0) - { - return; - } - - // save energy in .npy format - const long unsigned eshape[] = {1}; - double e_hartree = e * unit_scale; - npy::SaveArrayAsNumpy(e_file, false, 1, eshape, &e_hartree); - return; -} - -template -void LCAO_deepks_io::save_npy_h(const std::vector& hamilt, - const std::string& h_file, - const int nlocal, - const int nks, - const int rank, - const double unit_scale) -{ - ModuleBase::TITLE("LCAO_deepks_io", "save_npy_h"); - if (rank != 0) - { - return; - } - - const long unsigned hshape[] - = {static_cast(nks), static_cast(nlocal), static_cast(nlocal)}; - - std::vector npy_h; - for (int k = 0; k < nks; k++) - { - for (int i = 0; i < nlocal; i++) - { - for (int j = 0; j < nlocal; j++) - { - npy_h.push_back(hamilt[k](i, j) * unit_scale); - } - } - } - - npy::SaveArrayAsNumpy(h_file, false, 3, hshape, npy_h); - return; -} - -void LCAO_deepks_io::save_matrix2npy(const std::string& file_name, - const ModuleBase::matrix& matrix, - const int rank, - const double& scale, - const char mode, - const double unit_scale) -{ - ModuleBase::TITLE("LCAO_deepks_io", "save_matrix2npy"); - - if (rank != 0) - { - return; - } - const int nr = matrix.nr; - const int nc = matrix.nc; - int size = 0; - std::vector shape; - - if (mode == 'U' || mode == 'L') // upper or lower triangular - { - assert(nr == nc); - size = nr * (nr + 1) / 2; - shape.resize(1); - shape[0] = size; - } - else if (mode == 'N') // normal - { - size = nr * nc; - shape.resize(2); - shape[0] = nr; - shape[1] = nc; - } - else if (mode == 'F') // flat - { - size = nr * nc; - shape.resize(1); - shape[0] = size; - } - else - { - ModuleBase::WARNING_QUIT("save_matrix2npy", "Invalid mode! Support only 'U', 'L', 'N'."); - } - - std::vector scaled_data(size); - if (mode == 'U') // upper triangular - { - int index = 0; - for (int i = 0; i < nr; ++i) - { - for (int j = i; j < nc; ++j) - { - scaled_data[index] = (matrix(i, j) * scale) * unit_scale; - index++; - } - } - } - else if (mode == 'L') // lower triangular - { - int index = 0; - for (int i = 0; i < nr; ++i) - { - for (int j = 0; j <= i; ++j) - { - scaled_data[index] = (matrix(i, j) * scale) * unit_scale; - index++; - } - } - } - else // normal or flat - { - for (int i = 0; i < nr; ++i) - { - for (int j = 0; j < nc; ++j) - { - scaled_data[i * nc + j] = (matrix(i, j) * scale) * unit_scale; - } - } - } - - npy::SaveArrayAsNumpy(file_name, false, shape.size(), shape.data(), scaled_data); - return; -} - -template -void LCAO_deepks_io::save_tensor2npy(const std::string& file_name, const torch::Tensor& tensor, const int rank) -{ - ModuleBase::TITLE("LCAO_deepks_io", "save_tensor2npy"); - if (rank != 0) - { - return; - } - using T_tensor = - typename std::conditional>::value, c10::complex, T>::type; - const int dim = tensor.dim(); - std::vector shape(dim); - for (int i = 0; i < dim; i++) - { - shape[i] = tensor.size(i); - } - - std::vector data(tensor.numel()); - - T_tensor* data_ptr_tensor = tensor.data_ptr(); - T* data_ptr = reinterpret_cast(data_ptr_tensor); - for (size_t i = 0; i < tensor.numel(); ++i) - { - data[i] = data_ptr[i]; - } - - npy::SaveArrayAsNumpy(file_name, false, shape.size(), shape.data(), data); -} - -template void LCAO_deepks_io::print_dm(const int nks, - const int nlocal, - const int nrow, - const std::vector>& dm); - -template void LCAO_deepks_io::print_dm>(const int nks, - const int nlocal, - const int nrow, - const std::vector>>& dm); - -template void LCAO_deepks_io::save_npy_h(const std::vector& hamilt, - const std::string& h_file, - const int nlocal, - const int nks, - const int rank, - const double unit_scale); - -template void LCAO_deepks_io::save_npy_h>(const std::vector& hamilt, - const std::string& h_file, - const int nlocal, - const int nks, - const int rank, - const double unit_scale); - -template void LCAO_deepks_io::save_tensor2npy(const std::string& file_name, - const torch::Tensor& tensor, - const int rank); - -template void LCAO_deepks_io::save_tensor2npy(const std::string& file_name, - const torch::Tensor& tensor, - const int rank); - -template void LCAO_deepks_io::save_tensor2npy>(const std::string& file_name, - const torch::Tensor& tensor, - const int rank); -#endif diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.h b/source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.h deleted file mode 100644 index ba53ce6388..0000000000 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_io.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef LCAO_DEEPKS_IO_H -#define LCAO_DEEPKS_IO_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/matrix.h" -#include "source_base/tool_title.h" - -#include -#include -#include -#include - -namespace LCAO_deepks_io -{ - -/// This file contains subroutines that contains interface with libnpy -/// since many arrays must be saved in numpy format -/// It also contains subroutines for printing density matrices -/// which is used in unit tests - -/// There are 2 subroutines for printing and loading .npy file: -/// 1. print_dm : print density matrices -/// 2. load_npy_gedm : load gedm from .npy file - -/// others print quantities in .npy format - -/// 1. save_npy_d : descriptor -> deepks_dm_eig.npy -/// 2. save_npy_e : energy -/// 3. save_npy_h : Hamiltonian -/// 4. save_matrix2npy : ModuleBase::matrix -> .npy, for force, stress and orbital -/// 5. save_tensor2npy : torch::Tensor -> .npy, for precalculation variables - -/// Ry2Hartree : convert Ry to Hartree, for energy, force, stress, orbital and Hamiltonian, which is consistent with -/// deepks-kit. Used in save_npy_e, save_npy_h and save_matrix2npy by default -constexpr double Ry2Hartree = 0.5; - -/// print density matrices -template -void print_dm(const int nks, const int nlocal, const int nrow, const std::vector>& dm); - -void load_npy_gedm(const int nat, const int des_per_atom, double** gedm, double& e_delta, const int rank); - -/// save descriptor -void save_npy_d(const int nat, - const int des_per_atom, - const int inlmax, - const std::vector& inl2l, - const bool deepks_equiv, - const std::vector& descriptor, - const std::string& dm_eig_file, - const int rank); - -// save energy -void save_npy_e(const double& e, /**<[in] \f$E_{base}\f$ or \f$E_{tot}\f$, in Ry*/ - const std::string& e_file, - const int rank, - const double unit_scale = Ry2Hartree); - -// save Hamiltonian -template -void save_npy_h(const std::vector& hamilt, - const std::string& h_file, - const int nlocal, - const int nks, - const int rank, - const double unit_scale = Ry2Hartree); - -void save_matrix2npy(const std::string& file_name, - const ModuleBase::matrix& matrix, - const int rank, - const double& scale = 1.0, - const char mode = 'N', - const double unit_scale = Ry2Hartree); - -template -void save_tensor2npy(const std::string& file_name, const torch::Tensor& tensor, const int rank); -}; // namespace LCAO_deepks_io - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_basic.cpp b/source/module_hamilt_lcao/module_deepks/deepks_basic.cpp deleted file mode 100644 index 06e1c1653c..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_basic.cpp +++ /dev/null @@ -1,279 +0,0 @@ -// This file contains interfaces with libtorch, -// including loading of model and calculating gradients -// as well as subroutines that prints the results for checking - -#ifdef __MLALGO -#include "deepks_basic.h" - -#include "source_base/atom_in.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" - -// d(Descriptor) / d(projected density matrix) -// Dimension is different for each inl, so there's a vector of tensors -void DeePKS_domain::cal_gevdm(const int nat, - const int inlmax, - const std::vector& inl2l, - const std::vector& pdm, - std::vector& gevdm) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_gevdm"); - ModuleBase::timer::tick("DeePKS_domain", "cal_gevdm"); - // cal gevdm(d(EigenValue(D))/dD) - int nlmax = inlmax / nat; - for (int nl = 0; nl < nlmax; ++nl) - { - std::vector avmmv; - for (int iat = 0; iat < nat; ++iat) - { - int inl = iat * nlmax + nl; - int nm = 2 * inl2l[inl] + 1; - // repeat each block for nm times in an additional dimension - torch::Tensor tmp_x = pdm[inl].reshape({nm, nm}).unsqueeze(0).repeat({nm, 1, 1}); - // torch::Tensor tmp_y = std::get<0>(torch::symeig(tmp_x, true)); - torch::Tensor tmp_y = std::get<0>(torch::linalg::eigh(tmp_x, "U")); - torch::Tensor tmp_yshell = torch::eye(nm, torch::TensorOptions().dtype(torch::kFloat64)); - std::vector tmp_rpt; // repeated-pdm-tensor (x) - std::vector tmp_rdt; // repeated-d-tensor (y) - std::vector tmp_gst; // gvx-shell - tmp_rpt.push_back(tmp_x); - tmp_rdt.push_back(tmp_y); - tmp_gst.push_back(tmp_yshell); - std::vector tmp_res; - tmp_res = torch::autograd::grad(tmp_rdt, - tmp_rpt, - tmp_gst, - false, - false, - /*allow_unused*/ true); // nm(v)**nm*nm - avmmv.push_back(tmp_res[0]); - } - torch::Tensor avmm = torch::stack(avmmv, 0); // nat*nv**nm*nm - gevdm.push_back(avmm); - } - assert(gevdm.size() == nlmax); - ModuleBase::timer::tick("DeePKS_domain", "cal_gevdm"); - return; -} - -void DeePKS_domain::load_model(const std::string& model_file, torch::jit::script::Module& model) -{ - ModuleBase::TITLE("DeePKS_domain", "load_model"); - ModuleBase::timer::tick("DeePKS_domain", "load_model"); - - try - { - model = torch::jit::load(model_file); - } - catch (const c10::Error& e) - { - std::cerr << "error loading the model" << std::endl; - ModuleBase::timer::tick("DeePKS_domain", "load_model"); - return; - } - ModuleBase::timer::tick("DeePKS_domain", "load_model"); - return; -} - -inline void generate_py_files(const int lmaxd, const int nmaxd, const std::string& out_dir) -{ - std::ofstream ofs("cal_edelta_gedm.py"); - ofs << "import torch" << std::endl; - ofs << "import numpy as np" << std::endl << std::endl; - ofs << "import sys" << std::endl; - - ofs << "from deepks.scf.enn.scf import BasisInfo" << std::endl; - ofs << "from deepks.iterate.template_abacus import t_make_pdm" << std::endl; - ofs << "from deepks.utils import load_yaml" << std::endl << std::endl; - - ofs << "basis = load_yaml('basis.yaml')['proj_basis']" << std::endl; - ofs << "model = torch.jit.load(sys.argv[1])" << std::endl; - ofs << "dm_eig = np.expand_dims(np.load('" << out_dir << "dm_eig.npy'),0)" << std::endl; - ofs << "dm_eig = torch.tensor(dm_eig, " - "dtype=torch.float64,requires_grad=True)" - << std::endl - << std::endl; - - ofs << "dm_flat,basis_info = t_make_pdm(dm_eig,basis)" << std::endl; - ofs << "ec = model(dm_flat.double())" << std::endl; - ofs << "gedm = " - "torch.autograd.grad(ec,dm_eig,grad_outputs=torch.ones_like(ec))[0]" - << std::endl - << std::endl; - - ofs << "np.save('ec.npy',ec.double().detach().numpy())" << std::endl; - ofs << "np.save('gedm.npy',gedm.double().numpy())" << std::endl; - ofs.close(); - - ofs.open("basis.yaml"); - ofs << "proj_basis:" << std::endl; - for (int l = 0; l < lmaxd + 1; l++) - { - ofs << " - - " << l << std::endl; - ofs << " - ["; - for (int i = 0; i < nmaxd + 1; i++) - { - ofs << "0"; - if (i != nmaxd) - { - ofs << ", "; - } - } - ofs << "]" << std::endl; - } -} - -void DeePKS_domain::cal_edelta_gedm_equiv(const int nat, - const int lmaxd, - const int nmaxd, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& descriptor, - double** gedm, - double& E_delta, - const int rank) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_edelta_gedm_equiv"); - ModuleBase::timer::tick("DeePKS_domain", "cal_edelta_gedm_equiv"); - - const std::string file_d = PARAM.globalv.global_out_dir + "deepks_dm_eig.npy";; - LCAO_deepks_io::save_npy_d(nat, - des_per_atom, - inlmax, - inl2l, - PARAM.inp.deepks_equiv, - descriptor, - file_d, - rank); // libnpy needed - - if (rank == 0) - { - generate_py_files(lmaxd, nmaxd, PARAM.globalv.global_out_dir); - std::string cmd = "python cal_edelta_gedm.py " + PARAM.inp.deepks_model; - int stat = std::system(cmd.c_str()); - assert(stat == 0); - } - - MPI_Barrier(MPI_COMM_WORLD); - - LCAO_deepks_io::load_npy_gedm(nat, des_per_atom, gedm, E_delta, rank); - - std::string cmd = "rm -f cal_edelta_gedm.py basis.yaml ec.npy gedm.npy"; - std::system(cmd.c_str()); - - ModuleBase::timer::tick("DeePKS_domain", "cal_edelta_gedm_equiv"); - return; -} - -// obtain from the machine learning model dE_delta/dDescriptor -// E_delta is also calculated here -void DeePKS_domain::cal_edelta_gedm(const int nat, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& descriptor, - const std::vector& pdm, - torch::jit::script::Module& model_deepks, - double** gedm, - double& E_delta) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_edelta_gedm"); - ModuleBase::timer::tick("DeePKS_domain", "cal_edelta_gedm"); - - // forward - std::vector inputs; - - // input_dim:(natom, des_per_atom) - inputs.push_back(torch::cat(descriptor, 0).reshape({1, nat, des_per_atom})); - std::vector ec; - ec.push_back(model_deepks.forward(inputs).toTensor()); // Hartree - E_delta = ec[0].item() * 2; // Ry; *2 is for Hartree to Ry - - // cal gedm - std::vector gedm_shell; - gedm_shell.push_back(torch::ones_like(ec[0])); - std::vector gedm_tensor = torch::autograd::grad(ec, - pdm, - gedm_shell, - /*retain_grad=*/true, - /*create_graph=*/false, - /*allow_unused=*/true); - - // gedm_tensor(Hartree) to gedm(Ry) - for (int inl = 0; inl < inlmax; ++inl) - { - int nm = 2 * inl2l[inl] + 1; - auto accessor = gedm_tensor[inl].accessor(); - for (int m1 = 0; m1 < nm; ++m1) - { - for (int m2 = 0; m2 < nm; ++m2) - { - int index = m1 * nm + m2; - gedm[inl][index] = accessor[m1][m2] * 2; //*2 is for Hartree to Ry - } - } - } - ModuleBase::timer::tick("DeePKS_domain", "cal_edelta_gedm"); - return; -} - -void DeePKS_domain::check_gedm(const int inlmax, const std::vector& inl2l, double** gedm) -{ - std::ofstream ofs("gedm.dat"); - - for (int inl = 0; inl < inlmax; inl++) - { - int nm = 2 * inl2l[inl] + 1; - for (int m1 = 0; m1 < nm; ++m1) - { - for (int m2 = 0; m2 < nm; ++m2) - { - int index = m1 * nm + m2; - //*2 is for Hartree to Ry - ofs << gedm[inl][index] << " "; - } - } - ofs << std::endl; - } -} - -void DeePKS_domain::prepare_atom(const UnitCell& ucell, torch::Tensor& atom_out) -{ - int nat = ucell.nat; - atom_out = torch::zeros({nat, 4}, torch::TensorOptions().dtype(torch::kFloat64)); - - // get atom information - atom_in AtomInfo; - int index = 0; - for (int it = 0; it < ucell.ntype; ++it) - { - for (int ia = 0; ia < ucell.atoms[it].na; ++ia) - { - atom_out[index][0] = AtomInfo.atom_Z[ucell.atom_label[it]]; - - // use bohr as unit - atom_out[index][1] = ucell.atoms[it].tau[ia].x * ucell.lat0; - atom_out[index][2] = ucell.atoms[it].tau[ia].y * ucell.lat0; - atom_out[index][3] = ucell.atoms[it].tau[ia].z * ucell.lat0; - index++; - } - } -} -void DeePKS_domain::prepare_box(const UnitCell& ucell, torch::Tensor& box_out) -{ - box_out = torch::zeros({9}, torch::TensorOptions().dtype(torch::kFloat64)); - - // use bohr as unit - box_out[0] = ucell.latvec.e11 * ucell.lat0; - box_out[1] = ucell.latvec.e12 * ucell.lat0; - box_out[2] = ucell.latvec.e13 * ucell.lat0; - box_out[3] = ucell.latvec.e21 * ucell.lat0; - box_out[4] = ucell.latvec.e22 * ucell.lat0; - box_out[5] = ucell.latvec.e23 * ucell.lat0; - box_out[6] = ucell.latvec.e31 * ucell.lat0; - box_out[7] = ucell.latvec.e32 * ucell.lat0; - box_out[8] = ucell.latvec.e33 * ucell.lat0; -} - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_basic.h b/source/module_hamilt_lcao/module_deepks/deepks_basic.h deleted file mode 100644 index 25b4fdb7e9..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_basic.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef DEEPKS_BASIC_H -#define DEEPKS_BASIC_H - -#ifdef __MLALGO -#include "LCAO_deepks_io.h" -#include "source_base/parallel_reduce.h" -#include "source_base/tool_title.h" -#include "source_cell/unitcell.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_basic.cpp -//------------------------ - -// The file contains 2 subroutines: -// 1. load_model : loads model for applying V_delta -// 2. cal_gevdm : d(des)/d(pdm), calculated using torch::autograd::grad -// 3. cal_edelta_gedm : calculates E_delta and d(E_delta)/d(pdm) -// this is the term V(D) that enters the expression V_delta = |alpha>V(D)& inl2l, - const std::vector& pdm, - std::vector& gevdm); - -/// calculate partial of energy correction to descriptors -void cal_edelta_gedm(const int nat, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& descriptor, - const std::vector& pdm, - torch::jit::script::Module& model_deepks, - double** gedm, - double& E_delta); -void check_gedm(const int inlmax, const std::vector& inl2l, double** gedm); -void cal_edelta_gedm_equiv(const int nat, - const int lmaxd, - const int nmaxd, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& descriptor, - double** gedm, - double& E_delta, - const int rank); - -void prepare_atom(const UnitCell& ucell, torch::Tensor& atom_out); -void prepare_box(const UnitCell& ucell, torch::Tensor& box_out); -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_check.cpp b/source/module_hamilt_lcao/module_deepks/deepks_check.cpp deleted file mode 100644 index 16a07bcabb..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_check.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#ifdef __MLALGO - -#include "deepks_check.h" - -template -void DeePKS_domain::check_tensor(const torch::Tensor& tensor, const std::string& filename, const int rank) -{ - if (rank != 0) - { - return; - } - using T_tensor = - typename std::conditional>::value, c10::complex, T>::type; - - std::ofstream ofs(filename.c_str()); - ofs << std::setprecision(10); - - auto sizes = tensor.sizes(); - int ndim = sizes.size(); - auto data_ptr = tensor.data_ptr(); - int64_t numel = tensor.numel(); - - // stride for each dimension - std::vector strides(ndim, 1); - for (int i = ndim - 2; i >= 0; --i) - { - strides[i] = strides[i + 1] * sizes[i + 1]; - } - - for (int64_t idx = 0; idx < numel; ++idx) - { - // index to multi-dimensional indices - std::vector indices(ndim); - int64_t tmp = idx; - for (int d = 0; d < ndim; ++d) - { - indices[d] = tmp / strides[d]; - tmp = tmp % strides[d]; - } - - T_tensor tmp_val = data_ptr[idx]; - T* tmp_ptr = reinterpret_cast(&tmp_val); - ofs << *tmp_ptr; - - // print space or newline - if (((idx + 1) % sizes[ndim - 1]) == 0) - { - ofs << std::endl; - } - else - { - ofs << " "; - } - } - - ofs.close(); -} - - - -template void DeePKS_domain::check_tensor(const torch::Tensor& tensor, const std::string& filename, const int rank); -template void DeePKS_domain::check_tensor(const torch::Tensor& tensor, const std::string& filename, const int rank); -template void DeePKS_domain::check_tensor>(const torch::Tensor& tensor, const std::string& filename, const int rank); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_check.h b/source/module_hamilt_lcao/module_deepks/deepks_check.h deleted file mode 100644 index 53304a1269..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_check.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef DEEPKS_CHECK_H -#define DEEPKS_CHECK_H - -#ifdef __MLALGO - -#include -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_check.cpp -//------------------------ - -// This file contains subroutines for checking files - -// There are 1 subroutines in this file: -// 1. check_tensor, which is used for tensor data checking - -template -void check_tensor(const torch::Tensor& tensor, const std::string& filename, const int rank); - -} // namespace DeePKS_domain - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_descriptor.cpp b/source/module_hamilt_lcao/module_deepks/deepks_descriptor.cpp deleted file mode 100644 index ddfd91ae3d..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_descriptor.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/// 1. cal_descriptor : obtains descriptors which are eigenvalues of pdm -/// by calling torch::linalg::eigh -/// 2. check_descriptor : prints descriptor for checking -/// 3. cal_descriptor_equiv : calculates descriptor in equivalent version - -#ifdef __MLALGO - -#include "deepks_descriptor.h" - -#include "LCAO_deepks_io.h" // mohan add 2024-07-22 -#include "source_base/blas_connector.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "module_parameter/parameter.h" - -void DeePKS_domain::cal_descriptor_equiv(const int nat, - const int des_per_atom, - const std::vector& pdm, - std::vector& descriptor) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_descriptor_equiv"); - ModuleBase::timer::tick("DeePKS_domain", "cal_descriptor_equiv"); - - assert(des_per_atom > 0); - for (int iat = 0; iat < nat; iat++) - { - auto tmp = torch::zeros(des_per_atom, torch::kFloat64); - std::memcpy(tmp.data_ptr(), pdm[iat].data_ptr(), sizeof(double) * tmp.numel()); - descriptor.push_back(tmp); - } - - ModuleBase::timer::tick("DeePKS_domain", "cal_descriptor_equiv"); -} - -// calculates descriptors from projected density matrices -void DeePKS_domain::cal_descriptor(const int nat, - const int inlmax, - const std::vector& inl2l, - const std::vector& pdm, - std::vector& descriptor, - const int des_per_atom = -1) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_descriptor"); - ModuleBase::timer::tick("DeePKS_domain", "cal_descriptor"); - - if (PARAM.inp.deepks_equiv) - { - DeePKS_domain::cal_descriptor_equiv(nat, des_per_atom, pdm, descriptor); - return; - } - - for (int inl = 0; inl < inlmax; ++inl) - { - const int nm = 2 * inl2l[inl] + 1; - pdm[inl].requires_grad_(true); - descriptor.push_back(torch::ones({nm}, torch::requires_grad(true))); - } - - // cal descriptor - for (int inl = 0; inl < inlmax; ++inl) - { - torch::Tensor vd; - std::tuple d_v(descriptor[inl], vd); - // d_v = torch::symeig(pdm[inl], /*eigenvalues=*/true, - // /*upper=*/true); - d_v = torch::linalg::eigh(pdm[inl], /*uplo*/ "U"); - descriptor[inl] = std::get<0>(d_v); - } - ModuleBase::timer::tick("DeePKS_domain", "cal_descriptor"); - return; -} - -void DeePKS_domain::check_descriptor(const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const UnitCell& ucell, - const std::string& out_dir, - const std::vector& descriptor, - const int rank) -{ - ModuleBase::TITLE("DeePKS_domain", "check_descriptor"); - - if (rank != 0) - { - return; - } - - // mohan updated 2024-07-25 - std::string file = out_dir + "deepks_desc.dat"; - - std::ofstream ofs(file.c_str()); - ofs << std::setprecision(10); - if (!PARAM.inp.deepks_equiv) - { - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - int iat = ucell.itia2iat(it, ia); - ofs << ucell.atoms[it].label << " atom_index " << ia + 1 << " n_descriptor " << des_per_atom - << std::endl; - int id = 0; - for (int inl = 0; inl < inlmax / ucell.nat; inl++) - { - int nm = 2 * inl2l[inl] + 1; - const int ind = iat * inlmax / ucell.nat + inl; - auto accessor = descriptor[ind].accessor(); - for (int im = 0; im < nm; im++) - { - ofs << accessor[im] << " "; - if (id % 8 == 7) - { - ofs << std::endl; - } - id++; - } - } - ofs << std::endl << std::endl; - } - } - } - else - { - for (int iat = 0; iat < ucell.nat; iat++) - { - const int it = ucell.iat2it[iat]; - ofs << ucell.atoms[it].label << " atom_index " << iat + 1 << " n_descriptor " << des_per_atom << std::endl; - auto accessor = descriptor[iat].accessor(); - for (int i = 0; i < des_per_atom; i++) - { - ofs << accessor[i] << " "; - if (i % 8 == 7) - { - ofs << std::endl; - } - } - ofs << std::endl << std::endl; - } - } - return; -} - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_descriptor.h b/source/module_hamilt_lcao/module_deepks/deepks_descriptor.h deleted file mode 100644 index a91025503a..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_descriptor.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef DEEPKS_DESCRIPTOR_H -#define DEEPKS_DESCRIPTOR_H - -#ifdef __MLALGO - -#include "source_base/intarray.h" -#include "source_base/timer.h" -#include "source_cell/unitcell.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_descriptor.cpp -//------------------------ - -// This file contains interfaces with libtorch, -// including loading of model and calculating gradients -// as well as subroutines that prints the results for checking - -// The file contains 8 subroutines: -// 1. cal_descriptor : obtains descriptors which are eigenvalues of pdm -// by calling torch::linalg::eigh -// 2. check_descriptor : prints descriptor for checking -// 3. cal_descriptor_equiv : calculates descriptor in equivalent version - -/// Calculates descriptors -/// which are eigenvalues of pdm in blocks of I_n_l -void cal_descriptor(const int nat, - const int inlmax, - const std::vector& inl2l, - const std::vector& pdm, - std::vector& descriptor, - const int des_per_atom); -/// print descriptors based on LCAO basis -void check_descriptor(const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const UnitCell& ucell, - const std::string& out_dir, - const std::vector& descriptor, - const int rank); - -void cal_descriptor_equiv(const int nat, - const int des_per_atom, - const std::vector& pdm, - std::vector& descriptor); -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_force.cpp b/source/module_hamilt_lcao/module_deepks/deepks_force.cpp deleted file mode 100644 index 8c9e9d2e48..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_force.cpp +++ /dev/null @@ -1,294 +0,0 @@ -#include "module_parameter/parameter.h" - -#ifdef __MLALGO - -#include "deepks_force.h" -#include "deepks_iterate.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" - -template -void DeePKS_domain::cal_f_delta(const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - double** gedm, - ModuleBase::IntArray* inl_index, - ModuleBase::matrix& f_delta, - const bool isstress, - ModuleBase::matrix& svnl_dalpha) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_f_delta"); - ModuleBase::timer::tick("DeePKS_domain", "cal_f_delta"); - f_delta.zero_out(); - - const int lmaxd = orb.get_lmax_d(); - const double Rcut_Alpha = orb.Alpha[0].getRcut(); - -#pragma omp parallel -{ - ModuleBase::matrix f_delta_local(f_delta.nr, f_delta.nc); - ModuleBase::matrix svnl_dalpha_local(svnl_dalpha.nr, svnl_dalpha.nc); -#pragma omp for schedule(dynamic) - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T0 = ucell.iat2it[iat]; - const int I0 = ucell.iat2ia[iat]; - Atom* atom0 = &ucell.atoms[T0]; - const ModuleBase::Vector3 tau0 = atom0->tau[I0]; - AdjacentAtomInfo adjs; - GridD.Find_atom(ucell, atom0->tau[I0], T0, I0, &adjs); - - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int ibt1 = ucell.itia2iat(T1, I1); - const ModuleBase::Vector3 tau1 = adjs.adjacent_tau[ad1]; - const Atom* atom1 = &ucell.atoms[T1]; - const int nw1_tot = atom1->nw * PARAM.globalv.npol; - const double Rcut_AO1 = orb.Phi[T1].getRcut(); - - ModuleBase::Vector3 dR1(adjs.box[ad1].x, adjs.box[ad1].y, adjs.box[ad1].z); - - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ad2++) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int ibt2 = ucell.itia2iat(T2, I2); - const ModuleBase::Vector3 tau2 = adjs.adjacent_tau[ad2]; - const Atom* atom2 = &ucell.atoms[T2]; - const int nw2_tot = atom2->nw * PARAM.globalv.npol; - ModuleBase::Vector3 dR2(adjs.box[ad2].x, adjs.box[ad2].y, adjs.box[ad2].z); - - const double Rcut_AO2 = orb.Phi[T2].getRcut(); - const double dist1 = (tau1 - tau0).norm() * ucell.lat0; - const double dist2 = (tau2 - tau0).norm() * ucell.lat0; - - if (dist1 > Rcut_Alpha + Rcut_AO1 || dist2 > Rcut_Alpha + Rcut_AO2) - { - continue; - } - - double r1[3]{}; - double r2[3]{}; - if (isstress) - { - r1[0] = (tau1.x - tau0.x); - r1[1] = (tau1.y - tau0.y); - r1[2] = (tau1.z - tau0.z); - r2[0] = (tau2.x - tau0.x); - r2[1] = (tau2.y - tau0.y); - r2[2] = (tau2.z - tau0.z); - } - - auto row_indexes = pv.get_indexes_row(ibt1); - auto col_indexes = pv.get_indexes_col(ibt2); - - if (row_indexes.size() * col_indexes.size() == 0) - { - continue; - } - - int dRx = 0; - int dRy = 0; - int dRz = 0; - if (std::is_same>::value) // for multi-k - { - dRx = dR1.x - dR2.x; - dRy = dR1.y - dR2.y; - dRz = dR1.z - dR2.z; - } - ModuleBase::Vector3 dR(dRx, dRy, dRz); - const double* dm_current = dmr->find_matrix(ibt1, ibt2, dR.x, dR.y, dR.z)->get_pointer(); - - hamilt::BaseMatrix* overlap_1 = phialpha[0]->find_matrix(iat, ibt1, dR1); - hamilt::BaseMatrix* overlap_2 = phialpha[0]->find_matrix(iat, ibt2, dR2); - if (overlap_1 == nullptr || overlap_2 == nullptr) - { - continue; - } - std::vector*> grad_overlap_1(3); - std::vector*> grad_overlap_2(3); - for (int i = 0; i < 3; ++i) - { - grad_overlap_1[i] = phialpha[i + 1]->find_matrix(iat, ibt1, dR1); - grad_overlap_2[i] = phialpha[i + 1]->find_matrix(iat, ibt2, dR2); - } - - assert(overlap_1->get_col_size() == overlap_2->get_col_size()); - - for (int iw1 = 0; iw1 < row_indexes.size(); ++iw1) - { - for (int iw2 = 0; iw2 < col_indexes.size(); ++iw2) - { - double nlm[3] = {0, 0, 0}; - double nlm_t[3] = {0, 0, 0}; // for stress - - if (!PARAM.inp.deepks_equiv) - { - int ib = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - for (int m1 = 0; m1 < nm; ++m1) - { - for (int m2 = 0; m2 < nm; ++m2) - { - for (int dim = 0; dim < 3; dim++) - { - nlm[dim] - += gedm[inl][m1 * nm + m2] - * overlap_1->get_value(row_indexes[iw1], ib + m1) - * grad_overlap_2[dim]->get_value(col_indexes[iw2], ib + m2); - if (isstress) - { - nlm_t[dim] += gedm[inl][m1 * nm + m2] - * overlap_2->get_value(col_indexes[iw2], ib + m1) - * grad_overlap_1[dim]->get_value(row_indexes[iw1], - ib + m2); - } - } - } - } - ib += nm; - } - } - assert(ib == overlap_1->get_col_size()); - } - else - { - int nproj = 0; - for (int il = 0; il < lmaxd + 1; il++) - { - nproj += (2 * il + 1) * orb.Alpha[0].getNchi(il); - } - for (int iproj = 0; iproj < nproj; iproj++) - { - for (int jproj = 0; jproj < nproj; jproj++) - { - for (int dim = 0; dim < 3; dim++) - { - nlm[dim] += gedm[iat][iproj * nproj + jproj] - * overlap_1->get_value(row_indexes[iw1], iproj) - * grad_overlap_2[dim]->get_value(col_indexes[iw2], jproj); - if (isstress) - { - nlm_t[dim] += gedm[iat][iproj * nproj + jproj] - * overlap_2->get_value(col_indexes[iw2], iproj) - * grad_overlap_1[dim]->get_value(row_indexes[iw1], jproj); - } - } - } - } - } - - // HF term is minus, only one projector for each atom force. - f_delta_local(iat, 0) -= 2.0 * *dm_current * nlm[0]; - f_delta_local(iat, 1) -= 2.0 * *dm_current * nlm[1]; - f_delta_local(iat, 2) -= 2.0 * *dm_current * nlm[2]; - - // Pulay term is plus, only one projector for each atom force. - f_delta_local(ibt2, 0) += 2.0 * *dm_current * nlm[0]; - f_delta_local(ibt2, 1) += 2.0 * *dm_current * nlm[1]; - f_delta_local(ibt2, 2) += 2.0 * *dm_current * nlm[2]; - - if (isstress) - { - for (int ipol = 0; ipol < 3; ipol++) - { - for (int jpol = ipol; jpol < 3; jpol++) - { - svnl_dalpha_local(ipol, jpol) - += *dm_current * (nlm[ipol] * r2[jpol] + nlm_t[ipol] * r1[jpol]); - } - } - } - dm_current++; - } // iw2 - } // iw1 - } // ad2 - } // ad1 - } // iat - if (isstress) - { - for (int ipol = 0; ipol < 3; ipol++) - { - for (int jpol = ipol; jpol < 3; jpol++) - { - #pragma omp atomic - svnl_dalpha(ipol, jpol) += svnl_dalpha_local(ipol, jpol); - } - } - } - for (int iat = 0; iat < ucell.nat; iat++) - { - #pragma omp atomic - f_delta(iat, 0) += f_delta_local(iat, 0); - #pragma omp atomic - f_delta(iat, 1) += f_delta_local(iat, 1); - #pragma omp atomic - f_delta(iat, 2) += f_delta_local(iat, 2); - } -} - - if (isstress) - { - assert(ucell.omega > 0.0); - const double weight = ucell.lat0 / ucell.omega; - // use upper triangle to make symmetric stress tensor - for (int i = 0; i < 3; ++i) - { - for (int j = 0; j < 3; ++j) - { - if (j > i) - { - svnl_dalpha(j, i) = svnl_dalpha(i, j); - } - svnl_dalpha(i, j) *= weight; - } - } - } - ModuleBase::timer::tick("DeePKS_domain", "cal_f_delta"); - return; -} - -template void DeePKS_domain::cal_f_delta(const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - double** gedm, - ModuleBase::IntArray* inl_index, - ModuleBase::matrix& f_delta, - const bool isstress, - ModuleBase::matrix& svnl_dalpha); - -template void DeePKS_domain::cal_f_delta>(const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - double** gedm, - ModuleBase::IntArray* inl_index, - ModuleBase::matrix& f_delta, - const bool isstress, - ModuleBase::matrix& svnl_dalpha); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_force.h b/source/module_hamilt_lcao/module_deepks/deepks_force.h deleted file mode 100644 index a76e88e699..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_force.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef DEEPKS_FORCE_H -#define DEEPKS_FORCE_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/module_dm/density_matrix.h" - -namespace DeePKS_domain -{ -//------------------------ -// deepks_force.cpp -//------------------------ - -// This file contains subroutines for calculating F_delta, -// which is defind as sum_mu,nu rho_mu,nu d/dX (V(D)) - -// There are 1 subroutine in this file: -// 1. cal_f_delta, which is used for F_delta calculation - -template -void cal_f_delta(const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - double** gedm, - ModuleBase::IntArray* inl_index, - ModuleBase::matrix& f_delta, - const bool isstress, - ModuleBase::matrix& svnl_dalpha); -} // namespace DeePKS_domain - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_fpre.cpp b/source/module_hamilt_lcao/module_deepks/deepks_fpre.cpp deleted file mode 100644 index 9bb1a3e12e..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_fpre.cpp +++ /dev/null @@ -1,225 +0,0 @@ -#ifdef __MLALGO - -#include "deepks_fpre.h" - -#include "deepks_iterate.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "module_parameter/parameter.h" - -/// this subroutine calculates the gradient of projected density matrices -/// gdmx_m,m = d/dX sum_{mu,nu} rho_{mu,nu} -template -void DeePKS_domain::cal_gdmx(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmx) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_gdmx"); - ModuleBase::timer::tick("DeePKS_domain", "cal_gdmx"); - // get DS_alpha_mu and S_nu_beta - - int nrow = pv.nrow; - const int nm = 2 * lmaxd + 1; - // gdmx: dD/dX - // \sum_{mu,nu} 2*c_mu*c_nu * - // size: [3][natom][tot_Inl][2l+1][2l+1] - gdmx = torch::zeros({3, ucell.nat, inlmax, nm, nm}, torch::dtype(torch::kFloat64)); - auto accessor = gdmx.accessor(); - - DeePKS_domain::iterate_ad2( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1, - const int ibt2, - const ModuleBase::Vector3& tau2, - const int start2, - const int nw2_tot, - ModuleBase::Vector3 dR2) - { - auto row_indexes = pv.get_indexes_row(ibt1); - auto col_indexes = pv.get_indexes_col(ibt2); - if (row_indexes.size() * col_indexes.size() == 0) - { - return; // to next loop - } - - int dRx = 0; - int dRy = 0; - int dRz = 0; - if (std::is_same>::value) - { - dRx = (dR1 - dR2).x; - dRy = (dR1 - dR2).y; - dRz = (dR1 - dR2).z; - } - ModuleBase::Vector3 dR(dRx, dRy, dRz); - const double* dm_current = dmr->find_matrix(ibt1, ibt2, dR.x, dR.y, dR.z)->get_pointer(); - - hamilt::BaseMatrix* overlap_1 = phialpha[0]->find_matrix(iat, ibt1, dR1); - if (overlap_1 == nullptr) - { - return; // to next loop - } - - std::vector*> grad_overlap_2(3); - for (int i = 0; i < 3; ++i) - { - grad_overlap_2[i] = phialpha[i + 1]->find_matrix(iat, ibt2, dR2); - } - - assert(overlap_1->get_col_size() == grad_overlap_2[0]->get_col_size()); - - for (int iw1 = 0; iw1 < row_indexes.size(); ++iw1) - { - for (int iw2 = 0; iw2 < col_indexes.size(); ++iw2) - { - int ib = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[ucell.iat2it[iat]](ucell.iat2ia[iat], L0, N0); - const int nm = 2 * L0 + 1; - for (int m1 = 0; m1 < nm; ++m1) - { - for (int m2 = 0; m2 < nm; ++m2) - { - for (int i = 0; i < 3; i++) - { - double value = grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2) - * overlap_1->get_value(row_indexes[iw1], ib + m1) * *dm_current; - //() - accessor[i][iat][inl][m1][m2] += value; - - //() - accessor[i][iat][inl][m2][m1] += value; - - // () = -() - accessor[i][ibt2][inl][m1][m2] -= value; - - //() = -() - accessor[i][ibt2][inl][m2][m1] -= value; - } - } - } - ib += nm; - } - } - assert(ib == overlap_1->get_col_size()); - dm_current++; - } // iw2 - } // iw1 - } - ); - -#ifdef __MPI - Parallel_Reduce::reduce_all(gdmx.data_ptr(), 3 * ucell.nat * inlmax * nm * nm); -#endif - ModuleBase::timer::tick("DeePKS_domain", "cal_gdmx"); - return; -} - -// calculates gradient of descriptors from gradient of projected density matrices -void DeePKS_domain::cal_gvx(const int nat, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& gevdm, - const torch::Tensor& gdmx, - torch::Tensor& gvx, - const int rank) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_gvx"); - ModuleBase::timer::tick("DeePKS_domain", "cal_gvx"); - // gdmr : nat(derivative) * 3 * inl(projector) * nm * nm - std::vector gdmr; - auto accessor = gdmx.accessor(); - - if (rank == 0) - { - // make gdmx as tensor - int nlmax = inlmax / nat; - for (int nl = 0; nl < nlmax; ++nl) - { - int nm = 2 * inl2l[nl] + 1; - torch::Tensor gdmx_sliced - = gdmx.slice(2, nl, inlmax, nlmax).slice(3, 0, nm, 1).slice(4, 0, nm, 1).permute({1, 0, 2, 3, 4}); - gdmr.push_back(gdmx_sliced); - } - - assert(gdmr.size() == nlmax); - - // einsum for each inl: - // gdmr : b:nat(derivative) * x:3 * a:inl(projector) * m:nm * n:nm - // gevdm : a:inl * v:nm (descriptor) * m:nm (pdm, dim1) * n:nm (pdm, dim2) - // gvx_vector : b:nat(derivative) * x:3 * a:inl(projector) * m:nm(descriptor) - std::vector gvx_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - gvx_vector.push_back(at::einsum("bxamn, avmn->bxav", {gdmr[nl], gevdm[nl]})); - } - - // cat nv-> \sum_nl(nv) = \sum_nl(nm_nl)=des_per_atom - // concatenate index a(inl) and m(nm) - // gvx:d(d)/dX, size: [natom][3][natom][des_per_atom] - gvx = torch::cat(gvx_vector, -1); - - assert(gvx.size(0) == nat); - assert(gvx.size(1) == 3); - assert(gvx.size(2) == nat); - assert(gvx.size(3) == des_per_atom); - } - ModuleBase::timer::tick("DeePKS_domain", "cal_gvx"); - return; -} - -template void DeePKS_domain::cal_gdmx(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmx); - -template void DeePKS_domain::cal_gdmx>(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmx); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_fpre.h b/source/module_hamilt_lcao/module_deepks/deepks_fpre.h deleted file mode 100644 index 792997d263..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_fpre.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef DEEPKS_FPRE_H -#define DEEPKS_FPRE_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_fpre.cpp -//------------------------ - -// This file contains 2 subroutines for calculating, -// 1. cal_gdmx, calculating gdmx -// 2. cal_gvx : gvx is used for training with force label, which is gradient of descriptors, -// calculated by d(des)/dX = d(pdm)/dX * d(des)/d(pdm) = gdmx * gvdm -// using einsum - -// calculate the gradient of pdm with regard to atomic positions -// d/dX D_{Inl,mm'} -template -void cal_gdmx(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmx); - -/// calculates gradient of descriptors w.r.t atomic positions -///---------------------------------------------------- -/// m, n: 2*l+1 -/// v: eigenvalues of dm , 2*l+1 -/// a,b: natom -/// - (a: the center of descriptor orbitals -/// - b: the atoms whose force being calculated) -/// gevdm*gdmx->gvx -///---------------------------------------------------- -void cal_gvx(const int nat, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& gevdm, - const torch::Tensor& gdmx, - torch::Tensor& gvx, - const int rank); - -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_iterate.cpp b/source/module_hamilt_lcao/module_deepks/deepks_iterate.cpp deleted file mode 100644 index 6aee04a635..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_iterate.cpp +++ /dev/null @@ -1,179 +0,0 @@ -#include - -#ifdef __MLALGO -#include "deepks_iterate.h" - -void DeePKS_domain::iterate_ad1(const UnitCell& ucell, - const Grid_Driver& GridD, - const LCAO_Orbitals& orb, - const bool with_trace, - std::function& /*tau0*/, - const int /*ibt*/, - const ModuleBase::Vector3& /*tau1*/, - const int /*start*/, - const int /*nw1_tot*/, - ModuleBase::Vector3 /*dR*/)> callback) -{ - const double Rcut_Alpha = orb.Alpha[0].getRcut(); - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T0 = ucell.iat2it[iat]; - const int I0 = ucell.iat2ia[iat]; - Atom* atom0 = &ucell.atoms[T0]; - const ModuleBase::Vector3 tau0 = atom0->tau[I0]; - GridD.Find_atom(ucell, tau0, T0, I0); - for (int ad = 0; ad < GridD.getAdjacentNum() + 1; ++ad) - { - const int T1 = GridD.getType(ad); - const int I1 = GridD.getNatom(ad); - const int ibt = ucell.itia2iat(T1, I1); - const int start = ucell.itiaiw2iwt(T1, I1, 0); - - const ModuleBase::Vector3 tau1 = GridD.getAdjacentTau(ad); - const Atom* atom1 = &ucell.atoms[T1]; - const int nw1_tot = atom1->nw * PARAM.globalv.npol; - const double Rcut_AO1 = orb.Phi[T1].getRcut(); - const double dist1 = (tau1 - tau0).norm() * ucell.lat0; - - if (dist1 > Rcut_Alpha + Rcut_AO1) - { - continue; - } - - ModuleBase::Vector3 dR(GridD.getBox(ad).x, GridD.getBox(ad).y, GridD.getBox(ad).z); - - callback(iat, tau0, ibt, tau1, start, nw1_tot, dR); - } - } -} - -// void DeePKS_domain::iterate_ad1(const UnitCell& ucell, -// const Grid_Driver& GridD, -// const LCAO_Orbitals& orb, -// const bool with_trace, -// std::function& /*tau0*/, -// const int /*ibt*/, -// const ModuleBase::Vector3& /*tau1*/, -// const int /*start*/, -// const int /*nw1_tot*/, -// ModuleBase::Vector3 /*dR*/, -// std::vector /*trace_alpha_row*/, -// std::vector /*trace_alpha_col*/)> callback) -// { -// const double Rcut_Alpha = orb.Alpha[0].getRcut(); -// for (int T0 = 0; T0 < ucell.ntype; T0++) -// { -// Atom* atom0 = &ucell.atoms[T0]; -// for (int I0 = 0; I0 < atom0->na; I0++) -// { -// const int iat = ucell.itia2iat(T0, I0); -// const ModuleBase::Vector3 tau0 = atom0->tau[I0]; -// GridD.Find_atom(ucell, tau0, T0, I0); - -// // trace alpha orbital -// std::vector trace_alpha_row; -// std::vector trace_alpha_col; -// int ib = 0; -// for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) -// { -// for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) -// { -// const int inl = inl_index[T0](I0, L0, N0); -// const int nm = 2 * L0 + 1; - -// for (int m1 = 0; m1 < nm; ++m1) // m1 = 1 for s, 3 for p, 5 for d -// { -// for (int m2 = 0; m2 < nm; ++m2) // m1 = 1 for s, 3 for p, 5 for d -// { -// trace_alpha_row.push_back(ib + m1); -// trace_alpha_col.push_back(ib + m2); -// } -// } -// ib += nm; -// } -// } - -// for (int ad = 0; ad < GridD.getAdjacentNum() + 1; ++ad) -// { -// const int T1 = GridD.getType(ad); -// const int I1 = GridD.getNatom(ad); -// const int ibt = ucell.itia2iat(T1, I1); // on which chi_mu is located -// const int start = ucell.itiaiw2iwt(T1, I1, 0); - -// const ModuleBase::Vector3 tau1 = GridD.getAdjacentTau(ad); -// const Atom* atom1 = &ucell.atoms[T1]; -// const int nw1_tot = atom1->nw * PARAM.globalv.npol; -// const double Rcut_AO1 = orb.Phi[T1].getRcut(); -// const double dist1 = (tau1 - tau0).norm() * ucell.lat0; - -// if (dist1 > Rcut_Alpha + Rcut_AO1) -// { -// continue; -// } - -// ModuleBase::Vector3 dR(GridD.getBox(ad).x, GridD.getBox(ad).y, GridD.getBox(ad).z); - -// callback(iat, tau0, ibt, tau1, start, nw1_tot, dR, trace_alpha_row, trace_alpha_col); -// } -// } -// } -// } - -void DeePKS_domain::iterate_ad2(const UnitCell& ucell, - const Grid_Driver& GridD, - const LCAO_Orbitals& orb, - const bool with_trace, - std::function& /*tau0*/, - const int /*ibt1*/, - const ModuleBase::Vector3& /*tau1*/, - const int /*start1*/, - const int /*nw1_tot*/, - ModuleBase::Vector3 /*dR1*/, - const int /*ibt2*/, - const ModuleBase::Vector3& /*tau2*/, - const int /*start2*/, - const int /*nw2_tot*/, - ModuleBase::Vector3 /*dR2*/)> callback) -{ - const double Rcut_Alpha = orb.Alpha[0].getRcut(); - DeePKS_domain::iterate_ad1( - ucell, - GridD, - orb, - with_trace, - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1) { - for (int ad = 0; ad < GridD.getAdjacentNum() + 1; ++ad) - { - const int T2 = GridD.getType(ad); - const int I2 = GridD.getNatom(ad); - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - const int ibt2 = ucell.itia2iat(T2, I2); - const ModuleBase::Vector3 tau2 = GridD.getAdjacentTau(ad); - const Atom* atom2 = &ucell.atoms[T2]; - const int nw2_tot = atom2->nw * PARAM.globalv.npol; - ModuleBase::Vector3 dR2(GridD.getBox(ad).x, GridD.getBox(ad).y, GridD.getBox(ad).z); - - const double Rcut_AO2 = orb.Phi[T2].getRcut(); - const double dist2 = (tau2 - tau0).norm() * ucell.lat0; - - if (dist2 >= Rcut_Alpha + Rcut_AO2) - { - continue; - } - - callback(iat, tau0, ibt1, tau1, start1, nw1_tot, dR1, ibt2, tau2, start2, nw2_tot, dR2); - } - } - ); -} - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_iterate.h b/source/module_hamilt_lcao/module_deepks/deepks_iterate.h deleted file mode 100644 index 0ca6e9276e..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_iterate.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef DEEPKS_ITER_H -#define DEEPKS_ITER_H - -#include "module_parameter/parameter.h" - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" - -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_iterate.cpp -//------------------------ - -// This file contains - -void iterate_ad1(const UnitCell& ucell, - const Grid_Driver& GridD, - const LCAO_Orbitals& orb, - const bool with_trace, - std::function& /*tau0*/, - const int /*ibt*/, - const ModuleBase::Vector3& /*tau1*/, - const int /*start*/, - const int /*nw1_tot*/, - ModuleBase::Vector3 /*dR*/)> callback); - -void iterate_ad2(const UnitCell& ucell, - const Grid_Driver& GridD, - const LCAO_Orbitals& orb, - const bool with_trace, - std::function& /*tau0*/, - const int /*ibt1*/, - const ModuleBase::Vector3& /*tau1*/, - const int /*start1*/, - const int /*nw1_tot*/, - ModuleBase::Vector3 /*dR1*/, - const int /*ibt2*/, - const ModuleBase::Vector3& /*tau2*/, - const int /*start2*/, - const int /*nw2_tot*/, - ModuleBase::Vector3 /*dR2*/)> callback); -} // namespace DeePKS_domain - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_orbital.cpp b/source/module_hamilt_lcao/module_deepks/deepks_orbital.cpp deleted file mode 100644 index 7097a3e242..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_orbital.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "module_parameter/parameter.h" - -#ifdef __MLALGO - -#include "deepks_orbital.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" - -template -void DeePKS_domain::cal_o_delta(const std::vector& dm_hl, - const std::vector>& h_delta, - // std::vector& o_delta, - ModuleBase::matrix& o_delta, - const Parallel_Orbitals& pv, - const int nks, - const int nspin) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_o_delta"); - ModuleBase::timer::tick("DeePKS_domain", "cal_o_delta"); - - for (int ik = 0; ik < nks / nspin; ik++) - { - TK o_delta_tmp = TK(0.0); - for (int i = 0; i < PARAM.globalv.nlocal; ++i) - { - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - const int mu = pv.global2local_row(j); - const int nu = pv.global2local_col(i); - - if (mu >= 0 && nu >= 0) - { - int iic; - if (PARAM.inp.ks_solver == "genelpa" || PARAM.inp.ks_solver == "scalapack_gvx" - || PARAM.inp.ks_solver == "pexsi") // save the matrix as column major format - { - iic = mu + nu * pv.nrow; - } - else - { - iic = mu * pv.ncol + nu; - } - for (int is = 0; is < nspin; is++) - { - o_delta_tmp += dm_hl[ik + is * nks / nspin](nu, mu) * h_delta[ik][iic]; - } - } - } - } - Parallel_Reduce::reduce_all(o_delta_tmp); - - const double* o_delta_ptr = reinterpret_cast(&o_delta_tmp); - o_delta(ik, 0) = o_delta_ptr[0]; // real part in complex case - } - ModuleBase::timer::tick("DeePKS_domain", "cal_o_delta"); - return; -} - -template void DeePKS_domain::cal_o_delta(const std::vector& dm_hl, - const std::vector>& h_delta, - // std::vector& o_delta, - ModuleBase::matrix& o_delta, - const Parallel_Orbitals& pv, - const int nks, - const int nspin); - -template void DeePKS_domain::cal_o_delta, ModuleBase::ComplexMatrix>( - const std::vector& dm_hl, - const std::vector>>& h_delta, - // std::vector& o_delta, - ModuleBase::matrix& o_delta, - const Parallel_Orbitals& pv, - const int nks, - const int nspin); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_orbital.h b/source/module_hamilt_lcao/module_deepks/deepks_orbital.h deleted file mode 100644 index 93bb3421f0..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_orbital.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef DEEPKS_ORBITAL_H -#define DEEPKS_ORBITAL_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_estate/module_dm/density_matrix.h" - -namespace DeePKS_domain -{ -//------------------------ -// deepks_orbital.cpp -//------------------------ - -// This file contains subroutines for calculating O_delta, i.e., corrections of the bandgap, -// which is defind as sum_mu,nu rho^{hl}_mu,nu V(D) -// where rho^{hl}_mu,nu = C_{L\mu}C_{L\nu} - C_{H\mu}C_{H\nu}, L for LUMO, H for HOMO - -// There are 1 subroutine in this file: -// 1. cal_o_delta, which is used for O_delta calculation - -template -void cal_o_delta(const std::vector& dm_hl, - const std::vector>& h_delta, - // std::vector& o_delta, - ModuleBase::matrix& o_delta, - const Parallel_Orbitals& pv, - const int nks, - const int nspin); -} // namespace DeePKS_domain - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_orbpre.cpp b/source/module_hamilt_lcao/module_deepks/deepks_orbpre.cpp deleted file mode 100644 index 6957a86534..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_orbpre.cpp +++ /dev/null @@ -1,331 +0,0 @@ -#ifdef __MLALGO - -/// cal_orbital_precalc : orbital_precalc is used for training with orbital label, -/// which equals gevdm * orbital_pdm, -/// orbital_pdm[nks,Inl,nm,nm] = dm_hl * overlap * overlap - -#include "deepks_orbpre.h" - -#include "LCAO_deepks_io.h" // mohan add 2024-07-22 -#include "source_base/blas_connector.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "module_parameter/parameter.h" - -// calculates orbital_precalc[nks,NAt,NDscrpt] = gevdm * orbital_pdm; -// orbital_pdm[nks,Inl,nm,nm] = dm_hl * overlap * overlap; -template -void DeePKS_domain::cal_orbital_precalc(const std::vector& dm_hl, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& orbital_precalc) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_orbital_precalc"); - ModuleBase::timer::tick("DeePKS_domain", "calc_orbital_precalc"); - - const double Rcut_Alpha = orb.Alpha[0].getRcut(); - - torch::Tensor orbital_pdm - = torch::zeros({nks, inlmax, (2 * lmaxd + 1), (2 * lmaxd + 1)}, torch::dtype(torch::kFloat64)); - auto accessor = orbital_pdm.accessor(); - - for (int T0 = 0; T0 < ucell.ntype; T0++) - { - Atom* atom0 = &ucell.atoms[T0]; - - for (int I0 = 0; I0 < atom0->na; I0++) - { - const int iat = ucell.itia2iat(T0, I0); - const ModuleBase::Vector3 tau0 = atom0->tau[I0]; - GridD.Find_atom(ucell, atom0->tau[I0], T0, I0); - - // trace alpha orbital - std::vector trace_alpha_row; - std::vector trace_alpha_col; - int ib = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - - for (int m1 = 0; m1 < nm; ++m1) // m1 = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // m1 = 1 for s, 3 for p, 5 for d - { - trace_alpha_row.push_back(ib + m1); - trace_alpha_col.push_back(ib + m2); - } - } - ib += nm; - } - } - const int trace_alpha_size = trace_alpha_row.size(); - - for (int ad1 = 0; ad1 < GridD.getAdjacentNum() + 1; ++ad1) - { - const int T1 = GridD.getType(ad1); - const int I1 = GridD.getNatom(ad1); - const int ibt1 = ucell.itia2iat(T1, I1); - const ModuleBase::Vector3 tau1 = GridD.getAdjacentTau(ad1); - const Atom* atom1 = &ucell.atoms[T1]; - const int nw1_tot = atom1->nw * PARAM.globalv.npol; - const double Rcut_AO1 = orb.Phi[T1].getRcut(); - - const double dist1 = (tau1 - tau0).norm() * ucell.lat0; - if (dist1 >= Rcut_Alpha + Rcut_AO1) - { - continue; - } - - ModuleBase::Vector3 dR1(GridD.getBox(ad1).x, GridD.getBox(ad1).y, GridD.getBox(ad1).z); - - if (phialpha[0]->find_matrix(iat, ibt1, dR1.x, dR1.y, dR1.z) == nullptr) - { - continue; - } - - auto row_indexes = pv.get_indexes_row(ibt1); - - const int row_size = row_indexes.size(); - - if (row_size == 0) - { - continue; - } - - std::vector s_1t(trace_alpha_size * row_size); - - std::vector g_1dmt(nks * trace_alpha_size * row_size, 0.0); - - for (int irow = 0; irow < row_size; irow++) - { - hamilt::BaseMatrix* row_ptr = phialpha[0]->find_matrix(iat, ibt1, dR1); - for (int i = 0; i < trace_alpha_size; i++) - { - s_1t[i * row_size + irow] = row_ptr->get_value(row_indexes[irow], trace_alpha_row[i]); - } - } - - for (int ad2 = 0; ad2 < GridD.getAdjacentNum() + 1; ad2++) - { - const int T2 = GridD.getType(ad2); - const int I2 = GridD.getNatom(ad2); - const int ibt2 = ucell.itia2iat(T2, I2); - // skip if ibt1 > ibt2 and set gemm_alpha = 2.0 later, for performance - if (ibt1 > ibt2) - { - continue; - } - const ModuleBase::Vector3 tau2 = GridD.getAdjacentTau(ad2); - const Atom* atom2 = &ucell.atoms[T2]; - const int nw2_tot = atom2->nw * PARAM.globalv.npol; - - const double Rcut_AO2 = orb.Phi[T2].getRcut(); - const double dist2 = (tau2 - tau0).norm() * ucell.lat0; - - if (dist2 >= Rcut_Alpha + Rcut_AO2) - { - continue; - } - - ModuleBase::Vector3 dR2(GridD.getBox(ad2).x, GridD.getBox(ad2).y, GridD.getBox(ad2).z); - - if (phialpha[0]->find_matrix(iat, ibt2, dR2.x, dR2.y, dR2.z) == nullptr) - { - continue; - } - - auto col_indexes = pv.get_indexes_col(ibt2); - const int col_size = col_indexes.size(); - if (col_size == 0) - { - continue; - } - - std::vector s_2t(trace_alpha_size * col_size); - for (int icol = 0; icol < col_size; icol++) - { - hamilt::BaseMatrix* col_ptr = phialpha[0]->find_matrix(iat, ibt2, dR2); - for (int i = 0; i < trace_alpha_size; i++) - { - s_2t[i * col_size + icol] = col_ptr->get_value(col_indexes[icol], trace_alpha_col[i]); - } - } - - std::vector dm_array(row_size * dm_hl.size() * col_size, 0.0); - - const int row_size_nks = row_size * dm_hl.size(); - - int dRx = 0; - int dRy = 0; - int dRz = 0; - if (std::is_same>::value) - { - dRx = dR1.x - dR2.x; - dRy = dR1.y - dR2.y; - dRz = dR1.z - dR2.z; - } - ModuleBase::Vector3 dR(dRx, dRy, dRz); - - hamilt::AtomPair dm_pair(ibt1, ibt2, dR.x, dR.y, dR.z, &pv); - - for (int ik = 0; ik < dm_hl.size(); ik++) - { - dm_pair.allocate(&dm_array[ik * row_size * col_size], 0); - - std::complex kphase = std::complex(1, 0); - if (std::is_same>::value) - { - const double arg - = -(kvec_d[ik] * ModuleBase::Vector3(dR1 - dR2)) * ModuleBase::TWO_PI; - kphase = std::complex(cos(arg), sin(arg)); - } - TK* kphase_ptr = reinterpret_cast(&kphase); - - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - dm_pair.add_from_matrix(dm_hl[ik].c, pv.get_row_size(), *kphase_ptr, 1); - } - else - { - dm_pair.add_from_matrix(dm_hl[ik].c, pv.get_col_size(), *kphase_ptr, 0); - } - } // ik - - // dgemm for s_2t and dm_array to get g_1dmt - constexpr char transa = 'T', transb = 'N'; - double gemm_alpha = 1.0, gemm_beta = 1.0; - if (ibt1 < ibt2) - { - gemm_alpha = 2.0; - } - - dgemm_(&transa, - &transb, - &row_size_nks, - &trace_alpha_size, - &col_size, - &gemm_alpha, - dm_array.data(), - &col_size, - s_2t.data(), - &col_size, - &gemm_beta, - g_1dmt.data(), - &row_size_nks); - } // ad2 - - for (int ik = 0; ik < nks; ik++) - { - // do dot of g_1dmt and s_1t to get orbital_pdm - - const double* p_g1dmt = g_1dmt.data() + ik * row_size; - - int ib = 0, index = 0, inc = 1; - - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - - for (int m1 = 0; m1 < nm; ++m1) // m1 = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // m1 = 1 for s, 3 for p, 5 for d - { - accessor[ik][inl][m1][m2] += ddot_(&row_size, - p_g1dmt + index * row_size * nks, - &inc, - s_1t.data() + index * row_size, - &inc); - index++; - } - } - ib += nm; - } - } - } - } // ad1 - } - } -#ifdef __MPI - const int size = nks * inlmax * (2 * lmaxd + 1) * (2 * lmaxd + 1); - Parallel_Reduce::reduce_all(orbital_pdm.data_ptr(), size); -#endif - - // transfer orbital_pdm [nks,inl,nm,nm] to orbital_pdm_vector [nl,[nks,nat,nm,nm]] - int nlmax = inlmax / nat; - - std::vector orbital_pdm_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - int nm = 2 * inl2l[nl] + 1; - torch::Tensor orbital_pdm_sliced - = orbital_pdm.slice(1, nl, inlmax, nlmax).slice(2, 0, nm, 1).slice(3, 0, nm, 1); - orbital_pdm_vector.push_back(orbital_pdm_sliced); - } - - assert(orbital_pdm_vector.size() == nlmax); - - // einsum for each nl: - std::vector orbital_precalc_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - orbital_precalc_vector.push_back(at::einsum("kamn, avmn->kav", {orbital_pdm_vector[nl], gevdm[nl]})); - } - - orbital_precalc = torch::cat(orbital_precalc_vector, -1); - ModuleBase::timer::tick("DeePKS_domain", "calc_orbital_precalc"); - return; -} - -template void DeePKS_domain::cal_orbital_precalc( - const std::vector& dm_hl, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& orbital_precalc); - -template void DeePKS_domain::cal_orbital_precalc, ModuleBase::ComplexMatrix>( - const std::vector& dm_hl, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& orbital_precalc); -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_orbpre.h b/source/module_hamilt_lcao/module_deepks/deepks_orbpre.h deleted file mode 100644 index 6017937e82..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_orbpre.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef DEEPKS_ORBPRE_H -#define DEEPKS_ORBPRE_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_orbpre.cpp -//------------------------ - -// This file contains one subroutine for calculating orbital_precalc, -// which is defind as gevdm * dm_hl * overlap * overlap - -template -void cal_orbital_precalc(const std::vector& dm_hl, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& orbital_precalc); -} // namespace DeePKS_domain -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_pdm.cpp b/source/module_hamilt_lcao/module_deepks/deepks_pdm.cpp deleted file mode 100644 index 57b7791e0d..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_pdm.cpp +++ /dev/null @@ -1,524 +0,0 @@ -// wenfei 2022-1-11 -// This file contains subroutines for calculating pdm, -#include "module_parameter/parameter.h" -// which is defind as sum_mu,nu rho_mu,nu (); -// as well as gdmx, which is the gradient of pdm, defined as -// sum_mu,nu rho_mu,nu d/dX() - -// It also contains subroutines for printing pdm and gdmx -// for checking purpose - -// There are 3 subroutines in this file: -// 1. read_pdm, which reads pdm from file -// 2. cal_pdm, which is used for calculating pdm -// 3. check_pdm, which prints pdm to descriptor.dat - -#ifdef __MLALGO - -#include "deepks_iterate.h" -#include "deepks_pdm.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#ifdef __MPI -#include "source_base/parallel_reduce.h" -#endif - -void DeePKS_domain::read_pdm(bool read_pdm_file, - bool is_equiv, - bool& init_pdm, - const int nat, - const int inlmax, - const int lmaxd, - const std::vector& inl2l, - const Numerical_Orbital& alpha, - std::vector& pdm) -{ - if (read_pdm_file && !init_pdm) // for DeePKS NSCF calculation - { - const std::string file_projdm = PARAM.globalv.global_out_dir + "deepks_projdm.dat"; - std::ifstream ifs(file_projdm.c_str()); - - if (!ifs) - { - ModuleBase::WARNING_QUIT("DeePKS_domain::read_pdm", "Cannot find the file deepks_projdm.dat"); - } - if (!is_equiv) - { - for (int inl = 0; inl < inlmax; inl++) - { - int nm = 2 * inl2l[inl] + 1; - auto accessor = pdm[inl].accessor(); - for (int m1 = 0; m1 < nm; m1++) - { - for (int m2 = 0; m2 < nm; m2++) - { - double c; - ifs >> c; - accessor[m1][m2] = c; - } - } - } - } - else - { - int pdm_size = 0; - int nproj = 0; - for (int il = 0; il < lmaxd + 1; il++) - { - nproj += (2 * il + 1) * alpha.getNchi(il); - } - pdm_size = nproj * nproj; - for (int iat = 0; iat < nat; iat++) - { - auto accessor = pdm[iat].accessor(); - for (int ind = 0; ind < pdm_size; ind++) - { - double c; - ifs >> c; - accessor[ind] = c; - } - } - } - - init_pdm = true; - } -} - -template -void DeePKS_domain::update_dmr(const std::vector>& kvec_d, - const std::vector>& dmk, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - hamilt::HContainer* dmr_deepks) -{ - dmr_deepks->set_zero(); - // save whether the pair with R has been calculated - std::vector> calculated_pairs(0); - - DeePKS_domain::iterate_ad2( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1, - const int ibt2, - const ModuleBase::Vector3& tau2, - const int start2, - const int nw2_tot, - ModuleBase::Vector3 dR2) - { - auto row_indexes = pv.get_indexes_row(ibt1); - auto col_indexes = pv.get_indexes_col(ibt2); - if (row_indexes.size() * col_indexes.size() == 0) - { - return; // to next loop - } - - hamilt::AtomPair dm_pair = dmr_deepks->get_atom_pair(ibt1, ibt2); - - int dRx = 0; - int dRy = 0; - int dRz = 0; - if (std::is_same>::value) - { - dRx = (dR1 - dR2).x; - dRy = (dR1 - dR2).y; - dRz = (dR1 - dR2).z; - } - ModuleBase::Vector3 dR(dRx, dRy, dRz); - - // avoid duplicate calculation - if (std::find(calculated_pairs.begin(), calculated_pairs.end(), - std::make_tuple(ibt1, ibt2, dR.x, dR.y, dR.z)) - != calculated_pairs.end()) - { - return; - } - calculated_pairs.push_back(std::make_tuple(ibt1, ibt2, dR.x, dR.y, dR.z)); - - dm_pair.find_R(dR); - hamilt::BaseMatrix* dmr_ptr = dm_pair.find_matrix(dR); - dmr_ptr->set_zero(); // must reset to zero to avoid accumulation! - - for (int ik = 0; ik < dmk.size(); ik++) - { - std::complex kphase = std::complex(1, 0); - if (std::is_same>::value) - { - const double arg = -(kvec_d[ik] * ModuleBase::Vector3(dR)) * ModuleBase::TWO_PI; - kphase = std::complex(cos(arg), sin(arg)); - } - TK* kphase_ptr = reinterpret_cast(&kphase); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - dm_pair.add_from_matrix(dmk[ik].data(), pv.get_row_size(), *kphase_ptr, 1); - } - else - { - dm_pair.add_from_matrix(dmk[ik].data(), pv.get_col_size(), *kphase_ptr, 0); - } - } - } - ); - return; -} - -// this subroutine performs the calculation of projected density matrices -// pdm_m,m'=\sum_{mu,nu} rho_{mu,nu} -template -void DeePKS_domain::cal_pdm(bool& init_pdm, - const int inlmax, - const int lmaxd, - const std::vector& inl2l, - const ModuleBase::IntArray* inl_index, - const std::vector>& kvec_d, - const hamilt::HContainer* dmr, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - std::vector& pdm) - -{ - ModuleBase::TITLE("DeePKS_domain", "cal_pdm"); - ModuleBase::timer::tick("DeePKS_domain", "cal_pdm"); - - // if pdm has been initialized, skip the calculation - if (init_pdm) - { - init_pdm = false; - return; - } - - if (!PARAM.inp.deepks_equiv) - { - for (int inl = 0; inl < inlmax; inl++) - { - int nm = 2 * inl2l[inl] + 1; - pdm[inl] = torch::zeros({nm, nm}, torch::kFloat64); - } - } - else - { - int pdm_size = 0; - int nproj = 0; - for (int il = 0; il < lmaxd + 1; il++) - { - nproj += (2 * il + 1) * orb.Alpha[0].getNchi(il); - } - pdm_size = nproj * nproj; - for (int iat = 0; iat < ucell.nat; iat++) - { - pdm[iat] = torch::zeros({pdm_size}, torch::kFloat64); - } - } - - const double Rcut_Alpha = orb.Alpha[0].getRcut(); - -#pragma omp parallel for schedule(dynamic) - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T0 = ucell.iat2it[iat]; - const int I0 = ucell.iat2ia[iat]; - Atom* atom0 = &ucell.atoms[T0]; - const ModuleBase::Vector3 tau0 = atom0->tau[I0]; - AdjacentAtomInfo adjs; - GridD.Find_atom(ucell, tau0, T0, I0, &adjs); - - // trace alpha orbital - std::vector trace_alpha_row; - std::vector trace_alpha_col; - if (!PARAM.inp.deepks_equiv) - { - int ib = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - - for (int m1 = 0; m1 < nm; ++m1) // m1 = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // m1 = 1 for s, 3 for p, 5 for d - { - trace_alpha_row.push_back(ib + m1); - trace_alpha_col.push_back(ib + m2); - } - } - ib += nm; - } - } - } - else - { - int nproj = 0; - for (int il = 0; il < lmaxd + 1; il++) - { - nproj += (2 * il + 1) * orb.Alpha[0].getNchi(il); - } - for (int iproj = 0; iproj < nproj; iproj++) - { - for (int jproj = 0; jproj < nproj; jproj++) - { - trace_alpha_row.push_back(iproj); - trace_alpha_col.push_back(jproj); - } - } - } - const int trace_alpha_size = trace_alpha_row.size(); - - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int ibt1 = ucell.itia2iat(T1, I1); - const ModuleBase::Vector3 tau1 = adjs.adjacent_tau[ad1]; - const Atom* atom1 = &ucell.atoms[T1]; - const int nw1_tot = atom1->nw * PARAM.globalv.npol; - const double Rcut_AO1 = orb.Phi[T1].getRcut(); - const double dist1 = (tau1 - tau0).norm() * ucell.lat0; - if (dist1 >= Rcut_Alpha + Rcut_AO1) - { - continue; - } - - ModuleBase::Vector3 dR1(adjs.box[ad1].x, adjs.box[ad1].y, adjs.box[ad1].z); - if (phialpha[0]->find_matrix(iat, ibt1, dR1.x, dR1.y, dR1.z) == nullptr) - { - continue; - } - - auto row_indexes = pv.get_indexes_row(ibt1); - const int row_size = row_indexes.size(); - if (row_size == 0) - { - continue; - } - - // no possible to unexist key - std::vector s_1t(trace_alpha_size * row_size); - std::vector g_1dmt(trace_alpha_size * row_size, 0.0); - for (int irow = 0; irow < row_size; irow++) - { - hamilt::BaseMatrix* row_ptr = phialpha[0]->find_matrix(iat, ibt1, dR1); - - for (int i = 0; i < trace_alpha_size; i++) - { - s_1t[i * row_size + irow] = row_ptr->get_value(row_indexes[irow], trace_alpha_row[i]); - } - } - - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ad2++) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int ibt2 = ucell.itia2iat(T2, I2); - const ModuleBase::Vector3 tau2 = adjs.adjacent_tau[ad2]; - const Atom* atom2 = &ucell.atoms[T2]; - const int nw2_tot = atom2->nw * PARAM.globalv.npol; - - ModuleBase::Vector3 dR2(adjs.box[ad2].x, adjs.box[ad2].y, adjs.box[ad2].z); - if (phialpha[0]->find_matrix(iat, ibt2, dR2.x, dR2.y, dR2.z) == nullptr) - { - continue; - } - - const double Rcut_AO2 = orb.Phi[T2].getRcut(); - const double dist2 = (tau2 - tau0).norm() * ucell.lat0; - - if (dist2 >= Rcut_Alpha + Rcut_AO2) - { - continue; - } - - auto col_indexes = pv.get_indexes_col(ibt2); - const int col_size = col_indexes.size(); - if (col_size == 0) - { - continue; - } - - std::vector s_2t(trace_alpha_size * col_size); - // no possible to unexist key - for (int icol = 0; icol < col_size; icol++) - { - hamilt::BaseMatrix* col_ptr = phialpha[0]->find_matrix(iat, ibt2, dR2); - for (int i = 0; i < trace_alpha_size; i++) - { - s_2t[i * col_size + icol] = col_ptr->get_value(col_indexes[icol], trace_alpha_col[i]); - } - } - // prepare DM from DMR - int dRx = 0, dRy = 0, dRz = 0; - if (std::is_same>::value) - { - dRx = dR1.x - dR2.x; - dRy = dR1.y - dR2.y; - dRz = dR1.z - dR2.z; - } - ModuleBase::Vector3 dR(dRx, dRy, dRz); - - const double* dm_current = dmr->find_matrix(ibt1, ibt2, dR.x, dR.y, dR.z)->get_pointer(); - - // use s_2t and dm_current to get g_1dmt - // dgemm_: C = alpha * A * B + beta * C - // C = g_1dmt, A = dm_current, B = s_2t - // all the input should be data pointer - constexpr char transa = 'T', transb = 'N'; - const double gemm_alpha = 1.0, gemm_beta = 1.0; - dgemm_(&transa, - &transb, - &row_size, - &trace_alpha_size, - &col_size, - &gemm_alpha, - dm_current, - &col_size, - s_2t.data(), - &col_size, - &gemm_beta, - g_1dmt.data(), - &row_size); - } // ad2 - if (!PARAM.inp.deepks_equiv) - { - int index = 0, inc = 1; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - - auto accessor = pdm[inl].accessor(); - for (int m1 = 0; m1 < nm; ++m1) // m1 = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // m1 = 1 for s, 3 for p, 5 for d - { - accessor[m1][m2] += ddot_(&row_size, - g_1dmt.data() + index * row_size, - &inc, - s_1t.data() + index * row_size, - &inc); - index++; - } - } - } - } - } - else - { - auto accessor = pdm[iat].accessor(); - int index = 0, inc = 1; - int nproj = 0; - for (int il = 0; il < lmaxd + 1; il++) - { - nproj += (2 * il + 1) * orb.Alpha[0].getNchi(il); - } - for (int iproj = 0; iproj < nproj; iproj++) - { - for (int jproj = 0; jproj < nproj; jproj++) - { - // ddot_: dot product of two vectors - // inc means the increment of the index - accessor[iproj * nproj + jproj] += ddot_(&row_size, - g_1dmt.data() + index * row_size, - &inc, - s_1t.data() + index * row_size, - &inc); - index++; - } - } - } - } // ad1 - } // iat - -#ifdef __MPI - for (int inl = 0; inl < inlmax; inl++) - { - int pdm_size = (2 * inl2l[inl] + 1) * (2 * inl2l[inl] + 1); - Parallel_Reduce::reduce_all(pdm[inl].data_ptr(), pdm_size); - } -#endif - ModuleBase::timer::tick("DeePKS_domain", "cal_pdm"); - return; -} - -void DeePKS_domain::check_pdm(const int inlmax, const std::vector& inl2l, const std::vector& pdm) -{ - const std::string file_projdm = PARAM.globalv.global_out_dir + "deepks_projdm.dat"; - std::ofstream ofs(file_projdm.c_str()); - - ofs << std::setprecision(10); - for (int inl = 0; inl < inlmax; inl++) - { - const int nm = 2 * inl2l[inl] + 1; - auto accessor = pdm[inl].accessor(); - for (int m1 = 0; m1 < nm; m1++) - { - for (int m2 = 0; m2 < nm; m2++) - { - ofs << accessor[m1][m2] << " "; - } - } - ofs << std::endl; - } -} - -template void DeePKS_domain::update_dmr(const std::vector>& kvec_d, - const std::vector>& dmk, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - hamilt::HContainer* dmr_deepks); - -template void DeePKS_domain::update_dmr>(const std::vector>& kvec_d, - const std::vector>>& dmk, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - hamilt::HContainer* dmr_deepks); - -template void DeePKS_domain::cal_pdm(bool& init_pdm, - const int inlmax, - const int lmaxd, - const std::vector& inl2l, - const ModuleBase::IntArray* inl_index, - const std::vector>& kvec_d, - const hamilt::HContainer* dmr, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - std::vector& pdm); - -template void DeePKS_domain::cal_pdm>(bool& init_pdm, - const int inlmax, - const int lmaxd, - const std::vector& inl2l, - const ModuleBase::IntArray* inl_index, - const std::vector>& kvec_d, - const hamilt::HContainer* dmr, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - std::vector& pdm); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_pdm.h b/source/module_hamilt_lcao/module_deepks/deepks_pdm.h deleted file mode 100644 index ebb9350c02..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_pdm.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef DEEPKS_PDM_H -#define DEEPKS_PDM_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------- -// deepks_pdm.cpp -//------------------- - -// This file contains subroutines for calculating pdm, -// which is defind as sum_mu,nu rho_mu,nu (); -// It also contains subroutines for printing pdm for checking purpose - -// There are 3 subroutines in this file: -// 1. read_pdm, which reads pdm from file -// 2. cal_pdm, which is used for calculating pdm -// 3. check_pdm, which prints pdm to descriptor.dat - -// read pdm from file, do it only once in whole calculation -void read_pdm(bool read_pdm_file, - bool is_equiv, - bool& init_pdm, - const int nat, - const int inlmax, - const int lmaxd, - const std::vector& inl2l, - const Numerical_Orbital& alpha, - std::vector& pdm); - -template -void update_dmr(const std::vector>& kvec_d, - const std::vector>& dmk, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - hamilt::HContainer* dmr_deepks); - -// calculate projected density matrix: pdm = sum_i,occ -// 3 cases to skip calculation of pdm: -// - NSCF calculation of DeePKS, init_chg = file and pdm has been read -// - SCF calculation of DeePKS with init_chg = file and pdm has been read for restarting SCF -// - Relax/Cell-Relax/MD calculation, non-first step will use the convergence pdm from the last step as initial pdm -template -void cal_pdm(bool& init_pdm, - const int inlmax, - const int lmaxd, - const std::vector& inl2l, - const ModuleBase::IntArray* inl_index, - const std::vector>& kvec_d, - const hamilt::HContainer* dmr, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals& pv, - std::vector& pdm); - -void check_pdm(const int inlmax, const std::vector& inl2l, const std::vector& pdm); -} // namespace DeePKS_domain - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_phialpha.cpp b/source/module_hamilt_lcao/module_deepks/deepks_phialpha.cpp deleted file mode 100644 index 88e6a37565..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_phialpha.cpp +++ /dev/null @@ -1,341 +0,0 @@ -// wenfei 2022-1-11 -// This file contains 2 subroutines: -// 1. build_phialpha, which calculates the overlap -// between atomic basis and projector alpha : -// which will be used in calculating pdm, gdmx, V_delta, F_delta; -// 2. check_phialpha, which prints the results into .dat files -// for checking - -#ifdef __MLALGO - -#include "deepks_phialpha.h" - -#include "deepks_iterate.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "module_parameter/parameter.h" - -void DeePKS_domain::allocate_phialpha(const bool& cal_deri, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* pv, - std::vector*>& phialpha) -{ - ModuleBase::TITLE("DeePKS_domain", "allocate_phialpha"); - ModuleBase::timer::tick("DeePKS_domain", "allocate_phialpha"); - - phialpha.resize(cal_deri ? 4 : 1); - - phialpha[0] = new hamilt::HContainer(ucell.nat); // phialpha is always real - // Do not use fix_gamma, since it may find wrong matrix for gamma-only case in DeePKS - - // Total number of atomic basis of projected orbitals - int nw_alpha = 0; - for (int l = 0; l <= orb.Alpha[0].getLmax(); l++) - { - nw_alpha += orb.Alpha[0].getNchi(l) * (2 * l + 1); - } - - DeePKS_domain::iterate_ad1( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt, - const ModuleBase::Vector3& tau1, - const int start, - const int nw_tot, - ModuleBase::Vector3 dR) - { - // Create virtual atom_begin_row and atom_begin_col for the construction of atom pair - // In DeePKS, phialpha is used to save data, so it is safe to do this - int atom_begin_row[ucell.nat]; - int atom_begin_col[ucell.nat]; - for (int i = 0; i < ucell.nat; ++i) - { - atom_begin_row[i] = -1; - atom_begin_col[i] = pv->atom_begin_col[i]; - } - hamilt::AtomPair pair(iat, ibt, dR.x, dR.y, dR.z, atom_begin_row, atom_begin_col, ucell.nat); - // Notice: in AtomPair, the usage is set_size(ncol, nrow) - pair.set_size(nw_alpha, nw_tot); - phialpha[0]->insert_pair(pair); - } - ); - - phialpha[0]->allocate(nullptr, true); - // whether to calculate the derivative of phialpha - if (cal_deri) - { - for (int i = 1; i < 4; ++i) - { - phialpha[i] = new hamilt::HContainer(*phialpha[0], nullptr); // copy constructor - } - } - ModuleBase::timer::tick("DeePKS_domain", "allocate_phialpha"); - return; -} - -void DeePKS_domain::build_phialpha(const bool& cal_deri, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* pv, - const TwoCenterIntegrator& overlap_orb_alpha, - std::vector*>& phialpha) -{ - ModuleBase::TITLE("DeePKS_domain", "build_phialpha"); - ModuleBase::timer::tick("DeePKS_domain", "build_phialpha"); - - // Total number of atomic basis of projected orbitals - // nw_alpha will be used frequently, better to add a function in Numerical Orbital to get it - int nw_alpha = 0; - for (int l = 0; l <= orb.Alpha[0].getLmax(); l++) - { - nw_alpha += orb.Alpha[0].getNchi(l) * (2 * l + 1); - } - - DeePKS_domain::iterate_ad1( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt, - const ModuleBase::Vector3& tau1, - const int start, - const int nw_tot, - ModuleBase::Vector3 dR) - { - int R[3] = {dR.x, dR.y, dR.z}; - const int T1 = ucell.iat2it[ibt]; - const Atom* atom1 = &ucell.atoms[T1]; - - double* data_pointer = phialpha[0]->data(iat, ibt, R); - std::vector grad_pointer(3); - if (cal_deri) - { - for (int i = 0; i < 3; ++i) - { - grad_pointer[i] = phialpha[i + 1]->data(iat, ibt, R); - } - } - - // Calculate phialpha - // Get all indexes of atomic basis on the neighbour atom in this core - // Notice that atom pair (a,b) and (b,a) are different when the former is changed to projected orbitals - // So we need both row and col indexes for complete calculation - auto all_indexes = pv->get_indexes_row(ibt); - auto col_indexes = pv->get_indexes_col(ibt); - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); // for unique - - // inner loop : all atomic basis on the adjacent atom ad - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += PARAM.globalv.npol) - { - const int iw1 = all_indexes[iw1l] / PARAM.globalv.npol; - - std::vector> nlm; - // 2D, dim 0 contains the overlap - // dim 1-3 contains the gradient of overlap - - const int L1 = atom1->iw2l[iw1]; - const int N1 = atom1->iw2n[iw1]; - const int m1 = atom1->iw2m[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - const int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - const ModuleBase::Vector3 dtau = tau0 - tau1; - const int T0_fixed = 0; // All the projected orbitals are the same, use 0 here - overlap_orb_alpha.snap(T1, L1, N1, M1, T0_fixed, dtau * ucell.lat0, cal_deri, nlm); - - const int index_begin = all_indexes[iw1l] * nw_alpha * PARAM.globalv.npol; - for (int iw0 = 0; iw0 < nw_alpha; iw0++) - { - data_pointer[index_begin + iw0] = nlm[0][iw0]; - if (cal_deri) - { - grad_pointer[0][index_begin + iw0] = nlm[1][iw0]; - grad_pointer[1][index_begin + iw0] = nlm[2][iw0]; - grad_pointer[2][index_begin + iw0] = nlm[3][iw0]; - } - if (PARAM.globalv.npol == 2) - { - data_pointer[index_begin + iw0 + nw_alpha] = nlm[0][iw0]; - if (cal_deri) - { - grad_pointer[0][index_begin + iw0 + nw_alpha] = nlm[1][iw0]; - grad_pointer[1][index_begin + iw0 + nw_alpha] = nlm[2][iw0]; - grad_pointer[2][index_begin + iw0 + nw_alpha] = nlm[3][iw0]; - } - } - } - } // end iw - } - ); - - ModuleBase::timer::tick("DeePKS_domain", "build_phialpha"); - return; -} - -void DeePKS_domain::check_phialpha(const bool& cal_deri, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* pv, - std::vector*>& phialpha, - const int rank) -{ - ModuleBase::TITLE("DeePKS_domain", "check_phialpha"); - ModuleBase::timer::tick("DeePKS_domain", "check_phialpha"); - - if (rank != 0) - { - return; - } - - const double Rcut_Alpha = orb.Alpha[0].getRcut(); - // same for all types of atoms - int nw_alpha = 0; - for (int l = 0; l <= orb.Alpha[0].getLmax(); l++) - { - nw_alpha += orb.Alpha[0].getNchi(l) * (2 * l + 1); - } - - std::ofstream ofs("phialpha.dat"); - std::ofstream ofs_x("dphialpha_x.dat"); - std::ofstream ofs_y("dphialpha_y.dat"); - std::ofstream ofs_z("dphialpha_z.dat"); - - ofs << std::setprecision(10); - ofs_x << std::setprecision(10); - ofs_y << std::setprecision(10); - ofs_z << std::setprecision(10); - - for (int T0 = 0; T0 < ucell.ntype; T0++) - { - Atom* atom0 = &ucell.atoms[T0]; - for (int I0 = 0; I0 < atom0->na; I0++) - { - const int iat = ucell.itia2iat(T0, I0); - //======================================================= - // Step 1 : - // saves , where alpha runs over all projectors - // and phi runs over atomic basis sets on the current core - //======================================================= - - const ModuleBase::Vector3 tau0 = atom0->tau[I0]; - GridD.Find_atom(ucell, atom0->tau[I0], T0, I0); - - ofs << "iat : " << iat << std::endl; - ofs_x << "iat : " << iat << std::endl; - ofs_y << "iat : " << iat << std::endl; - ofs_z << "iat : " << iat << std::endl; - - for (int ad = 0; ad < GridD.getAdjacentNum() + 1; ++ad) - { - const int T1 = GridD.getType(ad); - const int I1 = GridD.getNatom(ad); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - const double Rcut_AO1 = orb.Phi[T1].getRcut(); - - const ModuleBase::Vector3 tau1 = GridD.getAdjacentTau(ad); - const Atom* atom1 = &ucell.atoms[T1]; - const int nw1_tot = atom1->nw * PARAM.globalv.npol; - - const double dist1 = (tau1 - tau0).norm() * ucell.lat0; - - if (dist1 > Rcut_Alpha + Rcut_AO1) - { - continue; - } - - int ibt = ucell.itia2iat(T1, I1); - int R[3]; - - ofs << "ad : " << ad << " " << dist1 << std::endl; - ofs_x << "ad : " << ad << " " << dist1 << std::endl; - ofs_y << "ad : " << ad << " " << dist1 << std::endl; - ofs_z << "ad : " << ad << " " << dist1 << std::endl; - - R[0] = GridD.getBox(ad).x; - R[1] = GridD.getBox(ad).y; - R[2] = GridD.getBox(ad).z; - - if (!PARAM.globalv.gamma_only_local) - { - ofs << "R : " << R[0] << " " << R[1] << " " << R[2] << std::endl; - ofs_x << "R : " << R[0] << " " << R[1] << " " << R[2] << std::endl; - ofs_y << "R : " << R[0] << " " << R[1] << " " << R[2] << std::endl; - ofs_z << "R : " << R[0] << " " << R[1] << " " << R[2] << std::endl; - } - - if (phialpha[0]->find_pair(iat, ibt) == nullptr) - { - continue; - } - const double* data_pointer = phialpha[0]->data(iat, ibt, R); - std::vector grad_pointer(3, nullptr); - if (cal_deri) - { - grad_pointer[0] = phialpha[1]->data(iat, ibt, R); - grad_pointer[1] = phialpha[2]->data(iat, ibt, R); - grad_pointer[2] = phialpha[3]->data(iat, ibt, R); - } - - for (int iw1 = 0; iw1 < nw1_tot; ++iw1) - { - const int iw1_all = start1 + iw1; - ofs << "iw : " << iw1_all << std::endl; - ofs_x << "iw : " << iw1_all << std::endl; - ofs_y << "iw : " << iw1_all << std::endl; - ofs_z << "iw : " << iw1_all << std::endl; - const int iw1_local = pv->global2local_row(iw1_all); - const int iw2_local = pv->global2local_col(iw1_all); - if (iw1_local < 0 && iw2_local < 0) - continue; - - for (int ind = 0; ind < nw_alpha; ind++) - { - ofs << data_pointer[iw1 * nw_alpha + ind] << " "; - if (cal_deri) - { - ofs_x << grad_pointer[0][iw1 * nw_alpha + ind] << " "; - ofs_y << grad_pointer[1][iw1 * nw_alpha + ind] << " "; - ofs_z << grad_pointer[2][iw1 * nw_alpha + ind] << " "; - } - // 6 numbers per line - if (ind % 6 == 5) - { - ofs << "\n"; - if (cal_deri) - { - ofs_x << "\n"; - ofs_y << "\n"; - ofs_z << "\n"; - } - } - } - ofs << std::endl; - if (cal_deri) - { - ofs_x << std::endl; - ofs_y << std::endl; - ofs_z << std::endl; - } - } // end iw - } // end ad - } // end I0 - } // end T0 - - ModuleBase::timer::tick("DeePKS_domain", "check_phialpha"); - return; -} - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_phialpha.h b/source/module_hamilt_lcao/module_deepks/deepks_phialpha.h deleted file mode 100644 index 081e665a11..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_phialpha.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef DEEPKS_PHIALPHA_H -#define DEEPKS_PHIALPHA_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -// This file contains 3 subroutines: -// 1. allocate_phialpha, which allocates memory for phialpha -// 2. build_phialpha, which calculates the overlap -// between atomic basis and projector alpha : -// which will be used in calculating pdm, gdmx, V_delta, F_delta; -// 3. check_phialpha, which prints the results into .dat files -// for checking - -// calculates -void allocate_phialpha(const bool& cal_deri, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* pv, - std::vector*>& phialpha); - -void build_phialpha(const bool& cal_deri /**< [in] 0 for 2-center intergration, 1 for its derivation*/, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* pv, - const TwoCenterIntegrator& overlap_orb_alpha, - std::vector*>& phialpha); - -void check_phialpha(const bool& cal_deri /**< [in] 0 for 2-center intergration, 1 for its derivation*/, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Grid_Driver& GridD, - const Parallel_Orbitals* pv, - std::vector*>& phialpha, - const int rank); -} // namespace DeePKS_domain - -#endif -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_spre.cpp b/source/module_hamilt_lcao/module_deepks/deepks_spre.cpp deleted file mode 100644 index 35c393f2f1..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_spre.cpp +++ /dev/null @@ -1,233 +0,0 @@ -#ifdef __MLALGO - -#include "deepks_spre.h" - -#include "deepks_iterate.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "module_parameter/parameter.h" - -/// this subroutine calculates the gradient of PDM wrt strain tensor: -/// gdmepsl = d/d\epsilon_{ab} * -/// sum_{mu,nu} rho_{mu,nu} -template -void DeePKS_domain::cal_gdmepsl(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmepsl) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_gdmepsl"); - ModuleBase::timer::tick("DeePKS_domain", "cal_gdmepsl"); - // get DS_alpha_mu and S_nu_beta - - int nrow = pv.nrow; - const int nm = 2 * lmaxd + 1; - // gdmepsl: dD/d\epsilon_{\alpha\beta} - // size: [6][tot_Inl][2l+1][2l+1] - gdmepsl = torch::zeros({6, inlmax, nm, nm}, torch::dtype(torch::kFloat64)); - auto accessor = gdmepsl.accessor(); - - DeePKS_domain::iterate_ad2( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1, - const int ibt2, - const ModuleBase::Vector3& tau2, - const int start2, - const int nw2_tot, - ModuleBase::Vector3 dR2) - { - double r1[3] = {0, 0, 0}; - double r2[3] = {0, 0, 0}; - r1[0] = (tau1.x - tau0.x); - r1[1] = (tau1.y - tau0.y); - r1[2] = (tau1.z - tau0.z); - r2[0] = (tau2.x - tau0.x); - r2[1] = (tau2.y - tau0.y); - r2[2] = (tau2.z - tau0.z); - auto row_indexes = pv.get_indexes_row(ibt1); - auto col_indexes = pv.get_indexes_col(ibt2); - if (row_indexes.size() * col_indexes.size() == 0) - { - return; // to next loop - } - - int dRx = 0; - int dRy = 0; - int dRz = 0; - if (std::is_same>::value) - { - dRx = (dR1 - dR2).x; - dRy = (dR1 - dR2).y; - dRz = (dR1 - dR2).z; - } - ModuleBase::Vector3 dR(dRx, dRy, dRz); - - const double* dm_current = dmr->find_matrix(ibt1, ibt2, dR.x, dR.y, dR.z)->get_pointer(); - - hamilt::BaseMatrix* overlap_1 = phialpha[0]->find_matrix(iat, ibt1, dR1); - hamilt::BaseMatrix* overlap_2 = phialpha[0]->find_matrix(iat, ibt2, dR2); - if (overlap_1 == nullptr || overlap_2 == nullptr) - { - return; // to next loop - } - std::vector*> grad_overlap_1(3); - std::vector*> grad_overlap_2(3); - - assert(overlap_1->get_col_size() == overlap_2->get_col_size()); - - for (int i = 0; i < 3; ++i) - { - grad_overlap_1[i] = phialpha[i + 1]->find_matrix(iat, ibt1, dR1); - grad_overlap_2[i] = phialpha[i + 1]->find_matrix(iat, ibt2, dR2); - } - - for (int iw1 = 0; iw1 < row_indexes.size(); ++iw1) - { - for (int iw2 = 0; iw2 < col_indexes.size(); ++iw2) - { - int ib = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[ucell.iat2it[iat]](ucell.iat2ia[iat], L0, N0); - const int nm = 2 * L0 + 1; - for (int m1 = 0; m1 < nm; ++m1) - { - for (int m2 = 0; m2 < nm; ++m2) - { - int mm = 0; - for (int ipol = 0; ipol < 3; ipol++) - { - for (int jpol = ipol; jpol < 3; jpol++) - { - accessor[mm][inl][m2][m1] - += ucell.lat0 * *dm_current - * (grad_overlap_2[jpol]->get_value(col_indexes[iw2], ib + m2) - * overlap_1->get_value(row_indexes[iw1], ib + m1) * r2[ipol]); - accessor[mm][inl][m2][m1] - += ucell.lat0 * *dm_current - * (overlap_2->get_value(col_indexes[iw2], ib + m1) - * grad_overlap_1[jpol]->get_value(row_indexes[iw1], ib + m2) - * r1[ipol]); - mm++; - } - } - } - } - ib += nm; - } - } - assert(ib == overlap_1->get_col_size()); - dm_current++; - } // iw2 - } // iw1 - } - ); - -#ifdef __MPI - Parallel_Reduce::reduce_all(gdmepsl.data_ptr(), 6 * inlmax * nm * nm); -#endif - ModuleBase::timer::tick("DeePKS_domain", "cal_gdmepsl"); - return; -} - -// calculates stress of descriptors from gradient of projected density matrices -// gv_epsl:d(d)/d\epsilon_{\alpha\beta}, [natom][6][des_per_atom] -void DeePKS_domain::cal_gvepsl(const int nat, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& gevdm, - const torch::Tensor& gdmepsl, - torch::Tensor& gvepsl, - const int rank) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_gvepsl"); - ModuleBase::timer::tick("DeePKS_domain", "cal_gvepsl"); - // dD/d\epsilon_{\alpha\beta}, tensor vector form of gdmepsl - std::vector gdmepsl_vector; - auto accessor = gdmepsl.accessor(); - if (rank == 0) - { - // make gdmepsl as tensor - int nlmax = inlmax / nat; - for (int nl = 0; nl < nlmax; ++nl) - { - int nm = 2 * inl2l[nl] + 1; - torch::Tensor gdmepsl_sliced = gdmepsl.slice(1, nl, inlmax, nlmax).slice(2, 0, nm, 1).slice(3, 0, nm, 1); - gdmepsl_vector.push_back(gdmepsl_sliced); - } - assert(gdmepsl_vector.size() == nlmax); - - // einsum for each inl: - // gdmepsl_vector : b:npol * a:inl(projector) * m:nm * n:nm - // gevdm : a:inl * v:nm (descriptor) * m:nm (pdm, dim1) * n:nm - // (pdm, dim2) gvepsl_vector : b:npol * a:inl(projector) * - // m:nm(descriptor) - std::vector gvepsl_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - gvepsl_vector.push_back(at::einsum("bamn, avmn->bav", {gdmepsl_vector[nl], gevdm[nl]})); - } - - // cat nv-> \sum_nl(nv) = \sum_nl(nm_nl)=des_per_atom - // concatenate index a(inl) and m(nm) - gvepsl = torch::cat(gvepsl_vector, -1); - assert(gvepsl.size(0) == 6); - assert(gvepsl.size(1) == nat); - assert(gvepsl.size(2) == des_per_atom); - } - - ModuleBase::timer::tick("DeePKS_domain", "cal_gvepsl"); - return; -} - -template void DeePKS_domain::cal_gdmepsl(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmepsl); - -template void DeePKS_domain::cal_gdmepsl>(const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmepsl); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_spre.h b/source/module_hamilt_lcao/module_deepks/deepks_spre.h deleted file mode 100644 index 4b5b9b9969..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_spre.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef DEEPKS_SPRE_H -#define DEEPKS_SPRE_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_spre.cpp -//------------------------ - -// This file contains 2 subroutines for calculating, -// 1. cal_gdmepsl, calculating gdmepsl -// 2. cal_gvepsl : gvepsl is used for training with stress label, which is derivative of -// descriptors wrt strain tensor, calculated by -// d(des)/d\epsilon_{ab} = d(pdm)/d\epsilon_{ab} * d(des)/d(pdm) = gdmepsl * gvdm -// using einsum - -// calculate the gradient of pdm with regard to atomic virial stress tensor -// d/d\epsilon D_{Inl,mm'} -template -void cal_gdmepsl( // const ModuleBase::matrix& dm, - const int lmaxd, - const int inlmax, - const int nks, - const std::vector>& kvec_d, - std::vector*> phialpha, - const ModuleBase::IntArray* inl_index, - const hamilt::HContainer* dmr, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& gdmepsl); - -void cal_gvepsl(const int nat, - const int inlmax, - const int des_per_atom, - const std::vector& inl2l, - const std::vector& gevdm, - const torch::Tensor& gdmepsl, - torch::Tensor& gvepsl, - const int rank); -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_vdelta.cpp b/source/module_hamilt_lcao/module_deepks/deepks_vdelta.cpp deleted file mode 100644 index 4a2f156eda..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_vdelta.cpp +++ /dev/null @@ -1,217 +0,0 @@ -// This file contains subroutines related to V_delta, which is the deepks contribution to Hamiltonian -// defined as |alpha>V(D) -void DeePKS_domain::cal_e_delta_band(const std::vector>& dm, - const std::vector>& V_delta, - const int nks, - const int nspin, - const Parallel_Orbitals* pv, - double& e_delta_band) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_e_delta_band"); - ModuleBase::timer::tick("DeePKS_domain", "cal_e_delta_band"); - TK e_delta_band_tmp = TK(0); - for (int i = 0; i < PARAM.globalv.nlocal; ++i) - { - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - const int mu = pv->global2local_row(j); - const int nu = pv->global2local_col(i); - - if (mu >= 0 && nu >= 0) - { - int iic; - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = mu + nu * pv->nrow; - } - else - { - iic = mu * pv->ncol + nu; - } - for (int is = 0; is < nspin; is++) - { - for (int ik = 0; ik < nks / nspin; ik++) - { - e_delta_band_tmp += dm[ik + is * nks / nspin][nu * pv->nrow + mu] * V_delta[ik][iic]; - } - } - } - } - } - const double* e_delta_band_ptr = reinterpret_cast(&e_delta_band_tmp); - e_delta_band = e_delta_band_ptr[0]; // real part in complex case -#ifdef __MPI - Parallel_Reduce::reduce_all(e_delta_band); -#endif - ModuleBase::timer::tick("DeePKS_domain", "cal_e_delta_band"); - return; -} - -template -void DeePKS_domain::collect_h_mat(const Parallel_Orbitals& pv, - const std::vector>& h_in, - std::vector& h_out, - const int nlocal, - const int nks) -{ - ModuleBase::TITLE("DeePKS_domain", "collect_h_tot"); - - // construct the total H matrix - for (int k = 0; k < nks; k++) - { -#ifdef __MPI - int ir = 0; - int ic = 0; - for (int i = 0; i < nlocal; i++) - { - std::vector lineH(nlocal - i, TK(0.0)); - - ir = pv.global2local_row(i); - if (ir >= 0) - { - // data collection - for (int j = i; j < nlocal; j++) - { - ic = pv.global2local_col(j); - if (ic >= 0) - { - int iic = 0; - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - lineH[j - i] = h_in[k][iic]; - } - } - } - - Parallel_Reduce::reduce_all(lineH.data(), nlocal - i); - - for (int j = i; j < nlocal; j++) - { - h_out[k](i, j) = lineH[j - i]; - h_out[k](j, i) = h_out[k](i, j); // H is a symmetric matrix - } - } -#else - for (int i = 0; i < nlocal; i++) - { - for (int j = i; j < nlocal; j++) - { - h_out[k](i, j) = h_in[k][i * nlocal + j]; - h_out[k](j, i) = h_out[k](i, j); // H is a symmetric matrix - } - } -#endif - } -} - -template -void DeePKS_domain::get_h_tot(const Parallel_Orbitals& pv, - hamilt::HamiltLCAO* p_ham, - std::vector& h_tot, - const int nlocal, - const int nks, - const char matrix_type) // 'H' for H(k), 'S' for S(k) -{ - ModuleBase::TITLE("DeePKS_domain", "get_h_tot"); - TK* (hamilt::HamiltLCAO::*getMatrixFunc)() const = nullptr; - if (matrix_type == 'H') - { - getMatrixFunc = &hamilt::HamiltLCAO::getHk; - } - else if (matrix_type == 'S') - { - getMatrixFunc = &hamilt::HamiltLCAO::getSk; - } - else - { - throw std::invalid_argument("Invalid matrix_type. Use 'H' for H(k) or 'S' for S(k)."); - } - std::vector> h_mat(nks, std::vector(pv.nloc)); - for (int ik = 0; ik < nks; ik++) - { - h_tot[ik].create(nlocal, nlocal); - p_ham->updateHk(ik); - const TK* hk_ptr = (p_ham->*getMatrixFunc)(); - for (int i = 0; i < pv.nloc; i++) - { - h_mat[ik][i] = hk_ptr[i]; - } - } - DeePKS_domain::collect_h_mat(pv, h_mat, h_tot, nlocal, nks); -} - -template void DeePKS_domain::cal_e_delta_band(const std::vector>& dm, - const std::vector>& V_delta, - const int nks, - const int nspin, - const Parallel_Orbitals* pv, - double& e_delta_band); -template void DeePKS_domain::cal_e_delta_band>( - const std::vector>>& dm, - const std::vector>>& V_delta, - const int nks, - const int nspin, - const Parallel_Orbitals* pv, - double& e_delta_band); - -template void DeePKS_domain::collect_h_mat(const Parallel_Orbitals& pv, - const std::vector>& h_in, - std::vector& h_out, - const int nlocal, - const int nks); - -template void DeePKS_domain::collect_h_mat, ModuleBase::ComplexMatrix>( - const Parallel_Orbitals& pv, - const std::vector>>& h_in, - std::vector& h_out, - const int nlocal, - const int nks); - -template void DeePKS_domain::get_h_tot(const Parallel_Orbitals& pv, - hamilt::HamiltLCAO* p_ham, - std::vector& h_tot, - const int nlocal, - const int nks, - const char matrix_type); - -template void DeePKS_domain::get_h_tot, ModuleBase::ComplexMatrix, double>( - const Parallel_Orbitals& pv, - hamilt::HamiltLCAO, double>* p_ham, - std::vector& h_tot, - const int nlocal, - const int nks, - const char matrix_type); - -template void DeePKS_domain::get_h_tot, ModuleBase::ComplexMatrix, std::complex>( - const Parallel_Orbitals& pv, - hamilt::HamiltLCAO, std::complex>* p_ham, - std::vector& h_tot, - const int nlocal, - const int nks, - const char matrix_type); -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_vdelta.h b/source/module_hamilt_lcao/module_deepks/deepks_vdelta.h deleted file mode 100644 index 9c7649a633..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_vdelta.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef DEEPKS_VDELTA_H -#define DEEPKS_VDELTA_H - -#ifdef __MLALGO -#include "source_base/complexmatrix.h" -#include "source_base/matrix.h" -#include "source_basis/module_ao/parallel_orbitals.h" - -// break the circular dependency of HamiltLCAO -namespace hamilt -{ -template -class HamiltLCAO; -} -namespace DeePKS_domain -{ -//------------------------ -// deepks_vdelta.cpp -//------------------------ - -// This file contains 2 subroutine for calculating e_delta_bands -// 1. cal_e_delta_band : calculates e_delta_bands -// 2. collect_h_mat, which collect H(k) data from different processes - -/// calculate tr(\rho V_delta) -template -void cal_e_delta_band(const std::vector>& dm, - const std::vector>& V_delta, - const int nks, - const int nspin, - const Parallel_Orbitals* pv, - double& e_delta_band); - -// Collect data in h_in to matrix h_out. Note that left lower trianger in h_out is filled -template -void collect_h_mat(const Parallel_Orbitals& pv, - const std::vector>& h_in, - std::vector& h_out, - const int nlocal, - const int nks); - -// Get H(k) or S(k) matrix from p_hamilt and store it in h_tot -template -void get_h_tot(const Parallel_Orbitals& pv, - hamilt::HamiltLCAO* p_ham, - std::vector& h_tot, - const int nlocal, - const int nks, - const char matrix_type); // 'H' for H(k), 'S' for S(k) -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_vdpre.cpp b/source/module_hamilt_lcao/module_deepks/deepks_vdpre.cpp deleted file mode 100644 index d6e4cd4bc6..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_vdpre.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/// cal_v_delta_precalc : v_delta_precalc is used for training with v_delta label, -// which equals gevdm * v_delta_pdm, -// v_delta_pdm = overlap * overlap -// prepare_phialpha : prepare phialpha for outputting npy file -// prepare_gevdm : prepare gevdm for outputting npy file - -#ifdef __MLALGO - -#include "deepks_vdpre.h" - -#include "LCAO_deepks_io.h" // mohan add 2024-07-22 -#include "deepks_iterate.h" -#include "source_base/blas_connector.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "module_parameter/parameter.h" - -// calculates v_delta_precalc[nks,nlocal,nlocal,NAt,NDscrpt] = gevdm * v_delta_pdm; -// v_delta_pdm[nks,nlocal,nlocal,Inl,nm,nm] = overlap * overlap; -// for deepks_v_delta = 1 -template -void DeePKS_domain::cal_v_delta_precalc(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& v_delta_precalc) -{ - ModuleBase::TITLE("DeePKS_domain", "cal_v_delta_precalc"); - ModuleBase::timer::tick("DeePKS_domain", "cal_v_delta_precalc"); - // timeval t_start; - // gettimeofday(&t_start,NULL); - - constexpr torch::Dtype dtype = std::is_same::value ? torch::kFloat64 : torch::kComplexDouble; - using TK_tensor = - typename std::conditional>::value, c10::complex, TK>::type; - - torch::Tensor v_delta_pdm - = torch::zeros({nks, nlocal, nlocal, inlmax, (2 * lmaxd + 1), (2 * lmaxd + 1)}, torch::dtype(dtype)); - auto accessor = v_delta_pdm.accessor(); - - DeePKS_domain::iterate_ad2( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1, - const int ibt2, - const ModuleBase::Vector3& tau2, - const int start2, - const int nw2_tot, - ModuleBase::Vector3 dR2) - { - const int T0 = ucell.iat2it[iat]; - const int I0 = ucell.iat2ia[iat]; - if (phialpha[0]->find_matrix(iat, ibt1, dR1.x, dR1.y, dR1.z) == nullptr - || phialpha[0]->find_matrix(iat, ibt2, dR2.x, dR2.y, dR2.z) == nullptr) - { - return; // to next loop - } - - for (int iw1 = 0; iw1 < nw1_tot; ++iw1) - { - const int iw1_all = start1 + iw1; // this is \mu - const int iw1_local = pv.global2local_row(iw1_all); - if (iw1_local < 0) - { - continue; - } - for (int iw2 = 0; iw2 < nw2_tot; ++iw2) - { - const int iw2_all = start2 + iw2; // this is \nu - const int iw2_local = pv.global2local_col(iw2_all); - if (iw2_local < 0) - { - continue; - } - - hamilt::BaseMatrix* overlap_1 = phialpha[0]->find_matrix(iat, ibt1, dR1); - hamilt::BaseMatrix* overlap_2 = phialpha[0]->find_matrix(iat, ibt2, dR2); - assert(overlap_1->get_col_size() == overlap_2->get_col_size()); - - for (int ik = 0; ik < nks; ik++) - { - int ib = 0; - std::complex kphase = std::complex(1.0, 0.0); - if (std::is_same>::value) - { - const double arg - = (kvec_d[ik] * ModuleBase::Vector3(dR1 - dR2)) * ModuleBase::TWO_PI; - kphase = std::complex(cos(arg), sin(arg)); - } - TK* kpase_ptr = reinterpret_cast(&kphase); - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - for (int m1 = 0; m1 < nm; ++m1) // nm = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // nm = 1 for s, 3 for p, 5 for d - { - TK tmp = overlap_1->get_value(iw1, ib + m1) - * overlap_2->get_value(iw2, ib + m2) * *kpase_ptr; - TK_tensor tmp_tensor = TK_tensor(tmp); - accessor[ik][iw1_all][iw2_all][inl][m1][m2] += tmp_tensor; - } - } - ib += nm; - } - } - } // ik - } // iw2 - } // iw1 - } - ); -#ifdef __MPI - const int size = nks * nlocal * nlocal * inlmax * (2 * lmaxd + 1) * (2 * lmaxd + 1); - TK_tensor* data_tensor_ptr = v_delta_pdm.data_ptr(); - TK* data_ptr = reinterpret_cast(data_tensor_ptr); - Parallel_Reduce::reduce_all(data_ptr, size); -#endif - - // transfer v_delta_pdm to v_delta_pdm_vector - int nlmax = inlmax / nat; - std::vector v_delta_pdm_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - int nm = 2 * inl2l[nl] + 1; - torch::Tensor v_delta_pdm_sliced - = v_delta_pdm.slice(3, nl, inlmax, nlmax).slice(4, 0, nm, 1).slice(5, 0, nm, 1); - v_delta_pdm_vector.push_back(v_delta_pdm_sliced); - } - - assert(v_delta_pdm_vector.size() == nlmax); - - // einsum for each nl: - std::vector v_delta_precalc_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - torch::Tensor gevdm_totype = gevdm[nl].to(dtype); - v_delta_precalc_vector.push_back(at::einsum("kxyamn, avmn->kxyav", {v_delta_pdm_vector[nl], gevdm_totype})); - } - - v_delta_precalc = torch::cat(v_delta_precalc_vector, -1); - // timeval t_end; - // gettimeofday(&t_end,NULL); - // std::cout<<"calculate v_delta_precalc time:\t"<<(double)(t_end.tv_sec-t_start.tv_sec) + - // (double)(t_end.tv_usec-t_start.tv_usec)/1000000.0< -void DeePKS_domain::prepare_phialpha(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& phialpha_out) -{ - ModuleBase::TITLE("DeePKS_domain", "prepare_phialpha"); - ModuleBase::timer::tick("DeePKS_domain", "prepare_phialpha"); - constexpr torch::Dtype dtype = std::is_same::value ? torch::kFloat64 : torch::kComplexDouble; - using TK_tensor = - typename std::conditional>::value, c10::complex, TK>::type; - int nlmax = inlmax / nat; - int mmax = 2 * lmaxd + 1; - phialpha_out = torch::zeros({nat, nlmax, nks, nlocal, mmax}, dtype); - auto accessor = phialpha_out.accessor(); - - DeePKS_domain::iterate_ad1( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt, - const ModuleBase::Vector3& tau, - const int start, - const int nw_tot, - ModuleBase::Vector3 dR) - { - if (phialpha[0]->find_matrix(iat, ibt, dR.x, dR.y, dR.z) == nullptr) - { - return; // to next loop - } - - // middle loop : all atomic basis on the adjacent atom ad - for (int iw1 = 0; iw1 < nw_tot; ++iw1) - { - const int iw1_all = start + iw1; - const int iw1_local = pv.global2local_row(iw1_all); - const int iw2_local = pv.global2local_col(iw1_all); - if (iw1_local < 0 || iw2_local < 0) - { - continue; - } - hamilt::BaseMatrix* overlap = phialpha[0]->find_matrix(iat, ibt, dR); - - for (int ik = 0; ik < nks; ik++) - { - std::complex kphase = std::complex(1.0, 0.0); - if (std::is_same>::value) - { - const double arg = -(kvec_d[ik] * ModuleBase::Vector3(dR)) * ModuleBase::TWO_PI; - kphase = std::complex(cos(arg), sin(arg)); - } - TK_tensor* kpase_ptr = reinterpret_cast(&kphase); - int ib = 0; - int nl = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int nm = 2 * L0 + 1; - for (int m1 = 0; m1 < nm; ++m1) // nm = 1 for s, 3 for p, 5 for d - { - TK_tensor tmp = overlap->get_value(iw1, ib + m1) * *kpase_ptr; - accessor[iat][nl][ik][iw1_all][m1] += tmp; - } - ib += nm; - nl++; - } - } - } // end ik - } // end iw - } - ); - -#ifdef __MPI - int size = nat * nlmax * nks * nlocal * mmax; - TK_tensor* data_tensor_ptr = phialpha_out.data_ptr(); - TK* data_ptr = reinterpret_cast(data_tensor_ptr); - Parallel_Reduce::reduce_all(data_ptr, size); - -#endif - - ModuleBase::timer::tick("DeePKS_domain", "prepare_phialpha"); - return; -} - -void DeePKS_domain::prepare_gevdm(const int nat, - const int lmaxd, - const int inlmax, - const LCAO_Orbitals& orb, - const std::vector& gevdm_in, - torch::Tensor& gevdm_out) -{ - ModuleBase::TITLE("DeePKS_domain", "prepare_gevdm"); - ModuleBase::timer::tick("DeePKS_domain", "prepare_gevdm"); - int nlmax = inlmax / nat; - int mmax = 2 * lmaxd + 1; - gevdm_out = torch::zeros({nat, nlmax, mmax, mmax, mmax}, torch::TensorOptions().dtype(torch::kFloat64)); - - std::vector gevdm_out_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - torch::Tensor gevdm_tmp = torch::zeros({nat, mmax, mmax, mmax}, torch::TensorOptions().dtype(torch::kFloat64)); - int nm = gevdm_in[nl].size(-1); - gevdm_tmp.slice(0, 0, nat).slice(1, 0, nm).slice(2, 0, nm).slice(3, 0, nm).copy_(gevdm_in[nl]); - gevdm_out_vector.push_back(gevdm_tmp); - } - gevdm_out = torch::stack(gevdm_out_vector, 1); - - ModuleBase::timer::tick("DeePKS_domain", "prepare_gevdm"); - return; -} - -template void DeePKS_domain::cal_v_delta_precalc(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& v_delta_precalc); -template void DeePKS_domain::cal_v_delta_precalc>( - const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& v_delta_precalc); - -template void DeePKS_domain::prepare_phialpha(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& phialpha_out); - -template void DeePKS_domain::prepare_phialpha>( - const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& phialpha_out); - -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_vdpre.h b/source/module_hamilt_lcao/module_deepks/deepks_vdpre.h deleted file mode 100644 index caf0d936c5..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_vdpre.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef DEEPKS_VDPRE_H -#define DEEPKS_VDPRE_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_vdpre.cpp -//------------------------ - -// This file contains 3 subroutines for calculating v_delta, -// 1. cal_v_delta_precalc : v_delta_precalc is used for training with v_delta label, -// which equals gevdm * v_delta_pdm, -// v_delta_pdm = overlap * overlap -// 2. prepare_phialpha : prepare phialpha for outputting npy file -// 3. prepare_gevdm : prepare gevdm for outputting npy file - -// for deepks_v_delta = 1 -// calculates v_delta_precalc -template -void cal_v_delta_precalc(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& v_delta_precalc); - -// for deepks_v_delta = 2 -// prepare phialpha for outputting npy file -template -void prepare_phialpha(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& phialpha_out); - -// prepare gevdm for outputting npy file -void prepare_gevdm(const int nat, - const int lmaxd, - const int inlmax, - const LCAO_Orbitals& orb, - const std::vector& gevdm_in, - torch::Tensor& gevdm_out); -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/deepks_vdrpre.cpp b/source/module_hamilt_lcao/module_deepks/deepks_vdrpre.cpp deleted file mode 100644 index 0404e1972b..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_vdrpre.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// prepare_phialpha_r : prepare phialpha_r for outputting npy file - -#ifdef __MLALGO - -#include "deepks_vdrpre.h" - -#include "LCAO_deepks_io.h" // mohan add 2024-07-22 -#include "deepks_iterate.h" -#include "source_base/blas_connector.h" -#include "source_base/constants.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "module_parameter/parameter.h" - -void DeePKS_domain::prepare_phialpha_r(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int R_size, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& phialpha_r_out) -{ - ModuleBase::TITLE("DeePKS_domain", "prepare_phialpha_r"); - ModuleBase::timer::tick("DeePKS_domain", "prepare_phialpha_r"); - constexpr torch::Dtype dtype = torch::kFloat64; - int nlmax = inlmax / nat; - int mmax = 2 * lmaxd + 1; - - phialpha_r_out = torch::zeros({R_size, R_size, R_size, nat, nlmax, nlocal, mmax}, dtype); - auto accessor = phialpha_r_out.accessor(); - - DeePKS_domain::iterate_ad1( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt, - const ModuleBase::Vector3& tau, - const int start, - const int nw_tot, - ModuleBase::Vector3 dR) - { - if (phialpha[0]->find_matrix(iat, ibt, dR.x, dR.y, dR.z) == nullptr) - { - return; // to next loop - } - - // middle loop : all atomic basis on the adjacent atom ad - for (int iw1 = 0; iw1 < nw_tot; ++iw1) - { - const int iw1_all = start + iw1; - const int iw1_local = pv.global2local_row(iw1_all); - const int iw2_local = pv.global2local_col(iw1_all); - if (iw1_local < 0 || iw2_local < 0) - { - continue; - } - hamilt::BaseMatrix* overlap = phialpha[0]->find_matrix(iat, ibt, dR); - const int iR = phialpha[0]->find_R(dR); - - int ib = 0; - int nl = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int nm = 2 * L0 + 1; - for (int m1 = 0; m1 < nm; ++m1) // nm = 1 for s, 3 for p, 5 for d - { - int iRx = DeePKS_domain::mapping_R(dR.x); - int iRy = DeePKS_domain::mapping_R(dR.y); - int iRz = DeePKS_domain::mapping_R(dR.z); - accessor[iRx][iRy][iRz][iat][nl][iw1_all][m1] - += overlap->get_value(iw1, ib + m1); - } - ib += nm; - nl++; - } - } - } // end iw - } - ); - -#ifdef __MPI - int size = R_size * R_size * R_size * nat * nlmax * nlocal * mmax; - double* data_ptr = phialpha_r_out.data_ptr(); - Parallel_Reduce::reduce_all(data_ptr, size); - -#endif - - ModuleBase::timer::tick("DeePKS_domain", "prepare_phialpha_r"); - return; -} - -void DeePKS_domain::cal_vdr_precalc(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const int R_size, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& vdr_precalc) -{ - ModuleBase::TITLE("DeePKS_domain", "calc_vdr_precalc"); - ModuleBase::timer::tick("DeePKS_domain", "calc_vdr_precalc"); - - torch::Tensor vdr_pdm - = torch::zeros({R_size, R_size, R_size, nlocal, nlocal, inlmax, (2 * lmaxd + 1), (2 * lmaxd + 1)}, - torch::TensorOptions().dtype(torch::kFloat64)); - auto accessor = vdr_pdm.accessor(); - - DeePKS_domain::iterate_ad2( - ucell, - GridD, - orb, - false, // no trace_alpha - [&](const int iat, - const ModuleBase::Vector3& tau0, - const int ibt1, - const ModuleBase::Vector3& tau1, - const int start1, - const int nw1_tot, - ModuleBase::Vector3 dR1, - const int ibt2, - const ModuleBase::Vector3& tau2, - const int start2, - const int nw2_tot, - ModuleBase::Vector3 dR2) - { - const int T0 = ucell.iat2it[iat]; - const int I0 = ucell.iat2ia[iat]; - if (phialpha[0]->find_matrix(iat, ibt1, dR1.x, dR1.y, dR1.z) == nullptr - || phialpha[0]->find_matrix(iat, ibt2, dR2.x, dR2.y, dR2.z) == nullptr) - { - return; // to next loop - } - - hamilt::BaseMatrix* overlap_1 = phialpha[0]->find_matrix(iat, ibt1, dR1); - hamilt::BaseMatrix* overlap_2 = phialpha[0]->find_matrix(iat, ibt2, dR2); - assert(overlap_1->get_col_size() == overlap_2->get_col_size()); - ModuleBase::Vector3 dR = dR1 - dR2; - int iRx = DeePKS_domain::mapping_R(dR.x); - int iRy = DeePKS_domain::mapping_R(dR.y); - int iRz = DeePKS_domain::mapping_R(dR.z); - - for (int iw1 = 0; iw1 < nw1_tot; ++iw1) - { - const int iw1_all = start1 + iw1; // this is \mu - const int iw1_local = pv.global2local_row(iw1_all); - if (iw1_local < 0) - { - continue; - } - for (int iw2 = 0; iw2 < nw2_tot; ++iw2) - { - const int iw2_all = start2 + iw2; // this is \nu - const int iw2_local = pv.global2local_col(iw2_all); - if (iw2_local < 0) - { - continue; - } - - int ib = 0; - for (int L0 = 0; L0 <= orb.Alpha[0].getLmax(); ++L0) - { - for (int N0 = 0; N0 < orb.Alpha[0].getNchi(L0); ++N0) - { - const int inl = inl_index[T0](I0, L0, N0); - const int nm = 2 * L0 + 1; - - for (int m1 = 0; m1 < nm; ++m1) // nm = 1 for s, 3 for p, 5 for d - { - for (int m2 = 0; m2 < nm; ++m2) // nm = 1 for s, 3 for p, 5 for d - { - double tmp = overlap_1->get_value(iw1, ib + m1) - * overlap_2->get_value(iw2, ib + m2); - accessor[iRx][iRy][iRz][iw1_all][iw2_all][inl][m1][m2] - += tmp; - } - } - ib += nm; - } - } - } // iw2 - } // iw1 - } - ); - -#ifdef __MPI - const int size = R_size * R_size * R_size * nlocal * nlocal * inlmax * (2 * lmaxd + 1) * (2 * lmaxd + 1); - double* data_ptr = vdr_pdm.data_ptr(); - Parallel_Reduce::reduce_all(data_ptr, size); -#endif - - // transfer v_delta_pdm to v_delta_pdm_vector - int nlmax = inlmax / nat; - std::vector vdr_pdm_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - int nm = 2 * inl2l[nl] + 1; - torch::Tensor vdr_pdm_sliced = vdr_pdm.slice(5, nl, inlmax, nlmax).slice(6, 0, nm, 1).slice(7, 0, nm, 1); - vdr_pdm_vector.push_back(vdr_pdm_sliced); - } - - assert(vdr_pdm_vector.size() == nlmax); - - // einsum for each nl: - std::vector vdr_vector; - for (int nl = 0; nl < nlmax; ++nl) - { - vdr_vector.push_back(at::einsum("pqrxyamn, avmn->pqrxyav", {vdr_pdm_vector[nl], gevdm[nl]})); - } - - vdr_precalc = torch::cat(vdr_vector, -1); - - ModuleBase::timer::tick("DeePKS_domain", "calc_vdr_precalc"); - return; -} - -int DeePKS_domain::mapping_R(int R) -{ - // R_index mapping: index(R) = 2R-1 if R > 0, index(R) = -2R if R <= 0 - // after mapping, the new index [0,1,2,3,4,...] -> old index [0,1,-1,2,-2,...] - // This manipulation makes sure that the new index is natural number - // which makes it available to be used as index in torch::Tensor - int R_index = 0; - if (R > 0) - { - R_index = 2 * R - 1; - } - else - { - R_index = -2 * R; - } - return R_index; -} - -template -int DeePKS_domain::get_R_size(const hamilt::HContainer& hcontainer) -{ - // get R_size from hcontainer - int R_size = 0; - if (hcontainer.size_R_loop() > 0) - { - for (int iR = 0; iR < hcontainer.size_R_loop(); ++iR) - { - ModuleBase::Vector3 R_vec; - hcontainer.loop_R(iR, R_vec.x, R_vec.y, R_vec.z); - int R_min = std::min({R_vec.x, R_vec.y, R_vec.z}); - int R_max = std::max({R_vec.x, R_vec.y, R_vec.z}); - int tmp_R_size = std::max(DeePKS_domain::mapping_R(R_min), DeePKS_domain::mapping_R(R_max)) + 1; - if (tmp_R_size > R_size) - { - R_size = tmp_R_size; - } - } - } - assert(R_size > 0); - return R_size; -} - -template int DeePKS_domain::get_R_size(const hamilt::HContainer& hcontainer); -template int DeePKS_domain::get_R_size>( - const hamilt::HContainer>& hcontainer); -#endif diff --git a/source/module_hamilt_lcao/module_deepks/deepks_vdrpre.h b/source/module_hamilt_lcao/module_deepks/deepks_vdrpre.h deleted file mode 100644 index ec47f7c956..0000000000 --- a/source/module_hamilt_lcao/module_deepks/deepks_vdrpre.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef DEEPKS_VDRPRE_H -#define DEEPKS_VDRPRE_H - -#ifdef __MLALGO - -#include "source_base/complexmatrix.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace DeePKS_domain -{ -//------------------------ -// deepks_vdrpre.cpp -//------------------------ - -// This file contains 1 subroutine for calculating v_delta, -// cal_vdr_precalc : v_delta_r_precalc is used for training with v_delta_r label, -// which equals gevdm * v_delta_pdm, -// v_delta_pdm = overlap * overlap - -// for deepks_v_delta = -1 -// calculates v_delta_r_precalc -void prepare_phialpha_r(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int R_size, - const std::vector*> phialpha, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& phialpha_r_out); - -void cal_vdr_precalc(const int nlocal, - const int lmaxd, - const int inlmax, - const int nat, - const int nks, - const int R_size, - const std::vector& inl2l, - const std::vector>& kvec_d, - const std::vector*> phialpha, - const std::vector gevdm, - const ModuleBase::IntArray* inl_index, - const UnitCell& ucell, - const LCAO_Orbitals& orb, - const Parallel_Orbitals& pv, - const Grid_Driver& GridD, - torch::Tensor& vdr_precalc); - -int mapping_R(int R); - -template -int get_R_size(const hamilt::HContainer& hcontainer); -} // namespace DeePKS_domain -#endif -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/test/CMakeLists.txt b/source/module_hamilt_lcao/module_deepks/test/CMakeLists.txt deleted file mode 100644 index 425eaff944..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -add_executable( - test_deepks - main_deepks.cpp klist_1.cpp LCAO_deepks_test_prep.cpp LCAO_deepks_test.cpp - ../../../source_cell/unitcell.cpp - ../../../source_cell/update_cell.cpp - ../../../source_cell/bcast_cell.cpp - ../../../source_cell/atom_spec.cpp - ../../../source_cell/atom_pseudo.cpp - ../../../source_cell/read_atoms.cpp - ../../../source_cell/read_stru.cpp - ../../../source_cell/print_cell.cpp - ../../../source_cell/read_atom_species.cpp - ../../../source_cell/setup_nonlocal.cpp - ../../../source_cell/pseudo.cpp - ../../../source_cell/read_pp.cpp - ../../../source_cell/read_pp_complete.cpp - ../../../source_cell/read_pp_upf100.cpp - ../../../source_cell/read_pp_upf201.cpp - ../../../source_cell/read_pp_vwr.cpp - ../../../source_cell/read_pp_blps.cpp - ../../../source_pw/hamilt_pwdft/soc.cpp - ../../../module_io/output.cpp - ../../../module_io/sparse_matrix.cpp - ../../../source_estate/read_pseudo.cpp - ../../../source_estate/cal_wfc.cpp - ../../../source_estate/read_orb.cpp - ../../../source_estate/cal_nelec_nband.cpp - ../../../source_estate/module_dm/density_matrix.cpp - ../../../source_estate/module_dm/density_matrix_io.cpp - ../../../module_hamilt_lcao/module_hcontainer/base_matrix.cpp - ../../../module_hamilt_lcao/module_hcontainer/hcontainer.cpp - ../../../module_hamilt_lcao/module_hcontainer/atom_pair.cpp - ../../../module_hamilt_lcao/module_hcontainer/func_transfer.cpp - ../../../module_hamilt_lcao/module_hcontainer/func_folding.cpp - ../../../module_hamilt_lcao/module_hcontainer/transfer.cpp - ../../../module_hamilt_lcao/module_hcontainer/output_hcontainer.cpp - ../../../module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp - ../../../module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp - ../../../source_hamilt/operator.cpp -) - -target_link_libraries( - test_deepks - base device parameter deepks psi planewave neighbor container - orb gint numerical_atomic_orbitals - ${math_libs} -) - -if(ENABLE_COVERAGE) - add_coverage(test_deepks) -endif() - - -install( - TARGETS test_deepks - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../../../../tests -) diff --git a/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.cpp b/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.cpp deleted file mode 100644 index 62198a484b..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.cpp +++ /dev/null @@ -1,503 +0,0 @@ -#include "LCAO_deepks_test.h" -#define private public -#include "module_parameter/parameter.h" - -#include -#include -#undef private -#include "module_hamilt_lcao/hamilt_lcaodft/hs_matrix_k.hpp" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.h" -namespace Test_Deepks -{ -Grid_Driver GridD(PARAM.input.test_deconstructor, PARAM.input.test_grid); -} - -template -test_deepks::test_deepks() -{ -} - -template -test_deepks::~test_deepks() -{ -} - -template -void test_deepks::check_dstable() -{ - // OGT.talpha.print_Table_DSR(ORB); - // this->compare_with_ref("S_I_mu_alpha.dat","S_I_mu_alpha_ref.dat"); -} - -template -void test_deepks::check_phialpha() -{ - std::vector na; - na.resize(ucell.ntype); - for (int it = 0; it < ucell.ntype; it++) - { - na[it] = ucell.atoms[it].na; - } - this->ld.init(ORB, ucell.nat, ucell.ntype, kv.nkstot, ParaO, na, GlobalV::ofs_running); - - DeePKS_domain::allocate_phialpha(PARAM.input.cal_force, ucell, ORB, Test_Deepks::GridD, &ParaO, this->ld.phialpha); - - DeePKS_domain::build_phialpha(PARAM.input.cal_force, - ucell, - ORB, - Test_Deepks::GridD, - &ParaO, - overlap_orb_alpha_, - this->ld.phialpha); - - DeePKS_domain::check_phialpha(PARAM.input.cal_force, - ucell, - ORB, - Test_Deepks::GridD, - &ParaO, - this->ld.phialpha, - 0); // 0 for rank - - this->compare_with_ref("phialpha.dat", "phialpha_ref.dat"); - this->compare_with_ref("dphialpha_x.dat", "dphialpha_x_ref.dat"); - this->compare_with_ref("dphialpha_y.dat", "dphialpha_y_ref.dat"); - this->compare_with_ref("dphialpha_z.dat", "dphialpha_z_ref.dat"); -} - -template -void test_deepks::read_dm(const int nks) -{ - dm.resize(nks); - std::stringstream ss; - for (int ik = 0; ik < nks; ik++) - { - ss.str(""); - if (nks == 1) - { - ss << "dm"; - } - else - { - ss << "dm_" << ik; - } - std::ifstream ifs(ss.str().c_str()); - dm[ik].create(PARAM.sys.nlocal, PARAM.sys.nlocal); - - for (int mu = 0; mu < PARAM.sys.nlocal; mu++) - { - for (int nu = 0; nu < PARAM.sys.nlocal; nu++) - { - T c; - ifs >> c; - dm[ik](mu, nu) = c; - } - } - } -} - -template -void test_deepks::set_dm_new() -{ - dm_new.resize(dm.size()); - for (int i = 0; i < dm.size(); i++) - { - dm_new[i].resize(dm[i].nr * dm[i].nc); - dm_new[i].assign(dm[i].c, dm[i].c + dm[i].nr * dm[i].nc); - } -} - -template -void test_deepks::set_p_elec_DM() -{ - int nk = 1; - const int nspin = PARAM.inp.nspin; - if (PARAM.sys.gamma_only_local) - { - nk = nspin; - this->p_elec_DM = new elecstate::DensityMatrix(&ParaO, nspin); - } - else - { - nk = kv.nkstot; - this->p_elec_DM - = new elecstate::DensityMatrix(&ParaO, nspin, kv.kvec_d, kv.nkstot / PARAM.inp.nspin); - } - p_elec_DM->init_DMR(&Test_Deepks::GridD, &ucell); - - for (int ik = 0; ik < nk; ik++) - { - p_elec_DM->set_DMK_pointer(ik, dm_new[ik].data()); - } - p_elec_DM->cal_DMR(); -} - -template -void test_deepks::check_pdm() -{ - this->read_dm(kv.nkstot); - this->set_dm_new(); - this->set_p_elec_DM(); - this->ld.init_DMR(ucell, ORB, ParaO, Test_Deepks::GridD); - DeePKS_domain::update_dmr(kv.kvec_d, - p_elec_DM->get_DMK_vector(), - ucell, - ORB, - ParaO, - Test_Deepks::GridD, - this->ld.dm_r); - DeePKS_domain::cal_pdm(this->ld.init_pdm, - this->ld.inlmax, - this->ld.lmaxd, - this->ld.inl2l, - this->ld.inl_index, - kv.kvec_d, - this->ld.dm_r, - this->ld.phialpha, - ucell, - ORB, - Test_Deepks::GridD, - ParaO, - this->ld.pdm); - DeePKS_domain::check_pdm(this->ld.inlmax, this->ld.inl2l, this->ld.pdm); - this->compare_with_ref("deepks_projdm.dat", "pdm_ref.dat"); -} - -template -void test_deepks::check_descriptor(std::vector& descriptor) -{ - DeePKS_domain::cal_descriptor(ucell.nat, - this->ld.inlmax, - this->ld.inl2l, - this->ld.pdm, - descriptor, - this->ld.des_per_atom); - DeePKS_domain::check_descriptor(this->ld.inlmax, this->ld.des_per_atom, this->ld.inl2l, ucell, "./", descriptor, 0); - this->compare_with_ref("deepks_desc.dat", "descriptor_ref.dat"); -} - -template -void test_deepks::check_gdmx(torch::Tensor& gdmx) -{ - DeePKS_domain::cal_gdmx(this->ld.lmaxd, - this->ld.inlmax, - kv.nkstot, - kv.kvec_d, - this->ld.phialpha, - this->ld.inl_index, - this->ld.dm_r, - ucell, - ORB, - ParaO, - Test_Deepks::GridD, - gdmx); - DeePKS_domain::check_tensor(gdmx, "gdmx.dat", 0); // 0 for rank - this->compare_with_ref("gdmx.dat", "gdmx_ref.dat"); -} - -template -void test_deepks::check_gvx(torch::Tensor& gdmx) -{ - std::vector gevdm; - DeePKS_domain::cal_gevdm(ucell.nat, this->ld.inlmax, this->ld.inl2l, this->ld.pdm, gevdm); - torch::Tensor gvx; - DeePKS_domain::cal_gvx(ucell.nat, this->ld.inlmax, this->ld.des_per_atom, this->ld.inl2l, gevdm, gdmx, gvx, 0); - DeePKS_domain::check_tensor(gvx, "gvx.dat", 0); // 0 for rank - this->compare_with_ref("gvx.dat", "gvx_ref.dat"); -} - -template -void test_deepks::check_gdmepsl(torch::Tensor& gdmepsl) -{ - DeePKS_domain::cal_gdmepsl(this->ld.lmaxd, - this->ld.inlmax, - kv.nkstot, - kv.kvec_d, - this->ld.phialpha, - this->ld.inl_index, - this->ld.dm_r, - ucell, - ORB, - ParaO, - Test_Deepks::GridD, - gdmepsl); - DeePKS_domain::check_tensor(gdmepsl, "gdmepsl.dat", 0); // 0 for rank - this->compare_with_ref("gdmepsl.dat", "gdmepsl_ref.dat"); -} - -template -void test_deepks::check_gvepsl(torch::Tensor& gdmepsl) -{ - std::vector gevdm; - DeePKS_domain::cal_gevdm(ucell.nat, this->ld.inlmax, this->ld.inl2l, this->ld.pdm, gevdm); - torch::Tensor gvepsl; - DeePKS_domain::cal_gvepsl(ucell.nat, - this->ld.inlmax, - this->ld.des_per_atom, - this->ld.inl2l, - gevdm, - gdmepsl, - gvepsl, - 0); - DeePKS_domain::check_tensor(gvepsl, "gvepsl.dat", 0); // 0 for rank - this->compare_with_ref("gvepsl.dat", "gvepsl_ref.dat"); -} - -template -void test_deepks::check_orbpre() -{ - using TH = std::conditional_t::value, ModuleBase::matrix, ModuleBase::ComplexMatrix>; - std::vector gevdm; - torch::Tensor orbpre; - DeePKS_domain::cal_gevdm(ucell.nat, this->ld.inlmax, this->ld.inl2l, this->ld.pdm, gevdm); - DeePKS_domain::cal_orbital_precalc(dm, - this->ld.lmaxd, - this->ld.inlmax, - ucell.nat, - kv.nkstot, - this->ld.inl2l, - kv.kvec_d, - this->ld.phialpha, - gevdm, - this->ld.inl_index, - ucell, - ORB, - ParaO, - Test_Deepks::GridD, - orbpre); - DeePKS_domain::check_tensor(orbpre, "orbital_precalc.dat", 0); // 0 for rank - this->compare_with_ref("orbital_precalc.dat", "orbpre_ref.dat"); -} - -template -void test_deepks::check_vdpre() -{ - std::vector gevdm; - torch::Tensor vdpre; - DeePKS_domain::cal_gevdm(ucell.nat, this->ld.inlmax, this->ld.inl2l, this->ld.pdm, gevdm); - DeePKS_domain::cal_v_delta_precalc(PARAM.sys.nlocal, - this->ld.lmaxd, - this->ld.inlmax, - ucell.nat, - kv.nkstot, - this->ld.inl2l, - kv.kvec_d, - this->ld.phialpha, - gevdm, - this->ld.inl_index, - ucell, - ORB, - ParaO, - Test_Deepks::GridD, - vdpre); - DeePKS_domain::check_tensor(vdpre, "v_delta_precalc.dat", 0); // 0 for rank - this->compare_with_ref("v_delta_precalc.dat", "vdpre_ref.dat"); -} - -template -void test_deepks::check_vdrpre() -{ - std::vector gevdm; - torch::Tensor vdrpre; - DeePKS_domain::cal_gevdm(ucell.nat, this->ld.inlmax, this->ld.inl2l, this->ld.pdm, gevdm); - // normally use hR to get R_size, here use phialpha[0] only for test case - int R_size = DeePKS_domain::get_R_size(*(this->ld.phialpha[0])); - DeePKS_domain::cal_vdr_precalc(PARAM.sys.nlocal, - this->ld.lmaxd, - this->ld.inlmax, - ucell.nat, - kv.nkstot, - R_size, - this->ld.inl2l, - kv.kvec_d, - this->ld.phialpha, - gevdm, - this->ld.inl_index, - ucell, - ORB, - ParaO, - Test_Deepks::GridD, - vdrpre); - // vdrpre is large, we only check the main element in Bravo lattice vector (0, 0, 0) - torch::Tensor vdrpre_sliced = vdrpre.slice(0, 0, 1, 1).slice(1, 0, 1, 1).slice(2, 0, 1, 1); - DeePKS_domain::check_tensor(vdrpre_sliced, "vdr_precalc.dat", 0); // 0 for rank - this->compare_with_ref("vdr_precalc.dat", "vdrpre_ref.dat"); -} - -template -void test_deepks::check_edelta(std::vector& descriptor) -{ - DeePKS_domain::load_model("model.ptg", ld.model_deepks); - ld.allocate_V_delta(ucell.nat, kv.nkstot); - if (PARAM.inp.deepks_equiv) - { - DeePKS_domain::cal_edelta_gedm_equiv(ucell.nat, - this->ld.lmaxd, - this->ld.nmaxd, - this->ld.inlmax, - this->ld.des_per_atom, - this->ld.inl2l, - descriptor, - this->ld.gedm, - this->ld.E_delta, - 0); // 0 for rank - } - else - { - DeePKS_domain::cal_edelta_gedm(ucell.nat, - this->ld.inlmax, - this->ld.des_per_atom, - this->ld.inl2l, - descriptor, - this->ld.pdm, - this->ld.model_deepks, - this->ld.gedm, - this->ld.E_delta); - } - - std::ofstream ofs("E_delta.dat"); - ofs << std::setprecision(10) << this->ld.E_delta << std::endl; - ofs.close(); - this->compare_with_ref("E_delta.dat", "E_delta_ref.dat"); - - // DeePKS_domain::check_gedm(this->ld.inlmax, this->ld.inl2l, this->ld.gedm); - // this->compare_with_ref("gedm.dat", "gedm_ref.dat"); -} - -template -void test_deepks::cal_V_delta() -{ - hamilt::HS_Matrix_K* hsk = new hamilt::HS_Matrix_K(&ParaO); - hamilt::HContainer* hR = new hamilt::HContainer(ucell, &ParaO); - hamilt::Operator* op_deepks = new hamilt::DeePKS>(hsk, - kv.kvec_d, - hR, // no explicit call yet - &ucell, - &Test_Deepks::GridD, - &overlap_orb_alpha_, - &ORB, - kv.nkstot, - p_elec_DM, - &this->ld); - for (int ik = 0; ik < kv.nkstot; ++ik) - { - op_deepks->init(ik); - } -} - -template -void test_deepks::check_e_deltabands() -{ - this->cal_V_delta(); - this->ld.dpks_cal_e_delta_band(dm_new, kv.nkstot); - - std::ofstream ofs("E_delta_bands.dat"); - ofs << std::setprecision(10) << this->ld.e_delta_band << std::endl; - ofs.close(); - this->compare_with_ref("E_delta_bands.dat", "E_delta_bands_ref.dat"); -} - -template -void test_deepks::check_f_delta_and_stress_delta() -{ - ModuleBase::matrix fvnl_dalpha; - fvnl_dalpha.create(ucell.nat, 3); - - ModuleBase::matrix svnl_dalpha; - svnl_dalpha.create(3, 3); - const int cal_stress = 1; - const int nks = kv.nkstot; - DeePKS_domain::cal_f_delta(this->ld.dm_r, - ucell, - ORB, - Test_Deepks::GridD, - ParaO, - nks, - kv.kvec_d, - this->ld.phialpha, - this->ld.gedm, - this->ld.inl_index, - fvnl_dalpha, - cal_stress, - svnl_dalpha); - std::ofstream ofs_f("F_delta.dat"); - std::ofstream ofs_s("stress_delta.dat"); - ofs_f << std::setprecision(10); - ofs_s << std::setprecision(10); - fvnl_dalpha.print(ofs_f); - ofs_f.close(); - svnl_dalpha.print(ofs_s); - ofs_s.close(); - - this->compare_with_ref("F_delta.dat", "F_delta_ref.dat"); - this->compare_with_ref("stress_delta.dat", "stress_delta_ref.dat"); -} - -template -void test_deepks::check_o_delta() -{ - const int nspin = PARAM.inp.nspin; - const int nks = kv.nkstot; - ModuleBase::matrix o_delta; - o_delta.create(nks, 1); - DeePKS_domain::cal_o_delta(dm, ld.V_delta, o_delta, ParaO, nks, nspin); - std::ofstream ofs("o_delta.dat"); - ofs << std::setprecision(10); - o_delta.print(ofs); - ofs.close(); - this->compare_with_ref("o_delta.dat", "o_delta_ref.dat"); -} - -template -void test_deepks::compare_with_ref(const std::string f1, const std::string f2) -{ - this->total_check += 1; - std::ifstream file1(f1.c_str()); - std::ifstream file2(f2.c_str()); - double test_thr = 1e-8; - - std::string word1; - std::string word2; - while (file1 >> word1) - { - file2 >> word2; - if ((word1[0] - '0' >= 0 && word1[0] - '0' < 10) || word1[0] == '-') - { - double num1 = std::stof(word1); - double num2 = std::stof(word2); - if (std::abs(num1 - num2) > test_thr) - { - this->failed_check += 1; - std::cout << "\e[1;31m [ FAILED ] \e[0m" << f1.c_str() << " inconsistent!" << std::endl; - return; - } - } - else if (word1[0] == '(' && word1[word1.size() - 1] == ')' && word2[0] == '(' - && word2[word2.size() - 1] == ')') // complex number - { - std::string word1_str = word1.substr(1, word1.size() - 2); - std::string word2_str = word2.substr(1, word2.size() - 2); - double word1_real = std::stof(word1_str.substr(0, word1_str.find(','))); - double word1_imag = std::stof(word1_str.substr(word1_str.find(',') + 1)); - double word2_real = std::stof(word2_str.substr(0, word2_str.find(','))); - double word2_imag = std::stof(word2_str.substr(word2_str.find(',') + 1)); - if (std::abs(word1_real - word2_real) > test_thr || std::abs(word1_imag - word2_imag) > test_thr) - { - this->failed_check += 1; - std::cout << "\e[1;31m [ FAILED ] \e[0m" << f1.c_str() << " inconsistent!" << std::endl; - return; - } - } - else - { - if (word1 != word2) - { - this->failed_check += 1; - return; - } - } - } - return; -} - -template class test_deepks; -template class test_deepks>; \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.h b/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.h deleted file mode 100644 index 6d819898f8..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test.h +++ /dev/null @@ -1,115 +0,0 @@ -#include "klist.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -//#include "parallel_orbitals.h" - -#include "../LCAO_deepks.h" - -#include -#include -#include -#include -#include -#include - -namespace Test_Deepks -{ -extern Grid_Driver GridD; -} - -template -class test_deepks -{ - - public: - test_deepks(); - ~test_deepks(); - - LCAO_Orbitals ORB; - - RadialCollection orb_; - RadialCollection alpha_; - TwoCenterIntegrator overlap_orb_alpha_; - - UnitCell ucell; - - Parallel_Orbitals ParaO; - Test_Deepks::K_Vectors kv; - LCAO_Deepks ld; - - int failed_check = 0; - int total_check = 0; - - int my_rank = 0; - - double lcao_ecut = 0; // (Ry) - double lcao_dk = 0.01; - double lcao_dr = 0.01; - double lcao_rmax = 30; // (a.u.) - - int out_mat_r = 0; - - int lmax = 2; - int ntype = 0; - - using TH = std::conditional_t::value, ModuleBase::matrix, ModuleBase::ComplexMatrix>; - - std::vector dm; - std::vector> dm_new; - elecstate::DensityMatrix* p_elec_DM; - - // preparation - void preparation(); - void set_parameters(); // set some global variables - void setup_cell(); - - void count_ntype(); // from STRU, count types of elements - void set_ekcut(); // from LCAO files, read and set ekcut - - void prep_neighbour(); - void setup_kpt(); - void set_orbs(); - - // tranfer Matrix into vector - void set_dm_new(); - - // tranfer vector into DensityMatrix - void set_p_elec_DM(); - - // checking - void check_dstable(); - void check_phialpha(); - - void read_dm(const int nks); - - void check_pdm(); - void check_descriptor(std::vector& descriptor); - - void check_gdmx(torch::Tensor& gdmx); - void check_gdmepsl(torch::Tensor& gdmepsl); - - void check_gvx(torch::Tensor& gdmx); - void check_gvepsl(torch::Tensor& gdmepsl); - - void check_orbpre(); - - void check_vdpre(); - - void check_vdrpre(); - - void check_edelta(std::vector& descriptor); - - // calculate V_delta - void cal_V_delta(); - - void check_e_deltabands(); - void check_f_delta_and_stress_delta(); - void check_o_delta(); - - // compares numbers stored in two files - void compare_with_ref(const std::string f1, const std::string f2); -}; diff --git a/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test_prep.cpp b/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test_prep.cpp deleted file mode 100644 index 600d16eb22..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/LCAO_deepks_test_prep.cpp +++ /dev/null @@ -1,232 +0,0 @@ -#include "LCAO_deepks_test.h" -#include "source_base/global_variable.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "source_estate/read_pseudo.h" -#include "source_hamilt/module_xc/exx_info.h" - -Magnetism::Magnetism() -{ - this->tot_mag = 0.0; - this->abs_mag = 0.0; - this->start_mag = nullptr; -} -Magnetism::~Magnetism() -{ - delete[] this->start_mag; -} -namespace GlobalC -{ -Exx_Info exx_info; -} - -template -void test_deepks::preparation() -{ - this->count_ntype(); - this->set_parameters(); - - this->setup_cell(); - - this->setup_kpt(); - - this->set_ekcut(); - this->set_orbs(); - this->prep_neighbour(); - - this->ParaO.set_serial(PARAM.globalv.nlocal, PARAM.globalv.nlocal); - this->ParaO.nrow_bands = PARAM.globalv.nlocal; - this->ParaO.ncol_bands = PARAM.inp.nbands; - // Zhang Xiaoyang enable the serial version of LCAO and recovered this function usage. 2024-07-06 - - this->ParaO.set_atomic_trace(ucell.get_iat2iwt(), ucell.nat, PARAM.globalv.nlocal); -} - -template -void test_deepks::set_parameters() -{ - PARAM.input.basis_type = "lcao"; - // GlobalV::global_pseudo_type= "auto"; - PARAM.input.pseudo_rcut = 15.0; - PARAM.sys.global_out_dir = "./"; - GlobalV::ofs_warning.open("warning.log"); - GlobalV::ofs_running.open("running.log"); - PARAM.sys.deepks_setorb = true; - PARAM.input.cal_force = 1; - - std::ifstream ifs("INPUT"); - char word[80]; - ifs >> word; - ifs >> PARAM.sys.gamma_only_local; - ifs.close(); - - ucell.latName = "none"; - ucell.ntype = ntype; - return; -} - -template -void test_deepks::count_ntype() -{ - GlobalV::ofs_running << "count number of atom types" << std::endl; - std::ifstream ifs("STRU", std::ios::in); - - if (!ifs) - { - GlobalV::ofs_running << "ERROR : file STRU does not exist" << std::endl; - exit(1); - } - - ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "ATOMIC_SPECIES"); - - ntype = 0; - - std::string x; - ifs.rdstate(); - while (ifs.good()) - { - // read a line - std::getline(ifs, x); - - // trim white space - const char* typeOfWhitespaces = " \t\n\r\f\v"; - x.erase(x.find_last_not_of(typeOfWhitespaces) + 1); - x.erase(0, x.find_first_not_of(typeOfWhitespaces)); - - if (x == "LATTICE_CONSTANT" || x == "NUMERICAL_ORBITAL" || x == "LATTICE_VECTORS" || x == "ATOMIC_POSITIONS" - || x == "NUMERICAL_DESCRIPTOR") - { - break; - } - - std::string tmpid = x.substr(0, 1); - if (!x.empty() && tmpid != "#") - { - ntype++; - } - } - - GlobalV::ofs_running << "ntype : " << ntype << std::endl; - ifs.close(); - - return; -} - -template -void test_deepks::set_ekcut() -{ - GlobalV::ofs_running << "set lcao_ecut from LCAO files" << std::endl; - // set as max of ekcut from every element - - lcao_ecut = 0.0; - std::ifstream in_ao; - - for (int it = 0; it < ntype; it++) - { - double ek_current; - - in_ao.open(ucell.orbital_fn[it].c_str()); - if (!in_ao) - { - GlobalV::ofs_running << "error : cannot find LCAO file : " << ucell.orbital_fn[it] << std::endl; - } - - std::string word; - while (in_ao.good()) - { - in_ao >> word; - if (word == "Cutoff(Ry)") - { - break; - } - } - in_ao >> ek_current; - lcao_ecut = std::max(lcao_ecut, ek_current); - - in_ao.close(); - } - - ORB.ecutwfc = lcao_ecut; - GlobalV::ofs_running << "lcao_ecut : " << lcao_ecut << std::endl; - - return; -} - -template -void test_deepks::setup_cell() -{ - ucell.setup_cell("STRU", GlobalV::ofs_running); - elecstate::read_pseudo(GlobalV::ofs_running, ucell); - - return; -} - -template -void test_deepks::prep_neighbour() -{ - double search_radius = atom_arrange::set_sr_NL(GlobalV::ofs_running, - PARAM.input.out_level, - ORB.get_rcutmax_Phi(), - ucell.infoNL.get_rcutmax_Beta(), - PARAM.sys.gamma_only_local); - - atom_arrange::search(PARAM.globalv.search_pbc, - GlobalV::ofs_running, - Test_Deepks::GridD, - ucell, - search_radius, - PARAM.inp.test_atom_input); -} - -template -void test_deepks::set_orbs() -{ - ORB.init(GlobalV::ofs_running, - ucell.ntype, - PARAM.inp.orbital_dir, - ucell.orbital_fn.data(), - ucell.descriptor_file, - ucell.lmax, - lcao_ecut, - lcao_dk, - lcao_dr, - lcao_rmax, - PARAM.sys.deepks_setorb, - out_mat_r, - PARAM.input.cal_force, - my_rank); - - ucell.infoNL.setupNonlocal(ucell.ntype, ucell.atoms, GlobalV::ofs_running, ORB); - - orb_.build(ntype, ucell.orbital_fn.data()); - - std::string file_alpha = PARAM.inp.orbital_dir + ucell.descriptor_file; - alpha_.build(1, &file_alpha); - - double rmax = std::max(orb_.rcut_max(), alpha_.rcut_max()); - double cutoff = 2.0 * rmax; - int nr = static_cast(rmax / lcao_dr) + 1; - - orb_.set_uniform_grid(true, nr, cutoff, 'i', true); - alpha_.set_uniform_grid(true, nr, cutoff, 'i', true); - - overlap_orb_alpha_.tabulate(orb_, alpha_, 'S', nr, cutoff); - - return; -} - -template -void test_deepks::setup_kpt() -{ - this->kv.set("KPT", - PARAM.input.nspin, - ucell.G, - ucell.latvec, - PARAM.sys.gamma_only_local, - GlobalV::ofs_running, - GlobalV::ofs_warning); -} - -template class test_deepks; -template class test_deepks>; diff --git a/source/module_hamilt_lcao/module_deepks/test/Makefile b/source/module_hamilt_lcao/module_deepks/test/Makefile deleted file mode 100644 index 9324bfd6ff..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/Makefile +++ /dev/null @@ -1,101 +0,0 @@ -# This is the Makefile of ABACUS-ORB API - -#========================== -# Compiler information -#========================== -CPLUSPLUS = icpc -CPLUSPLUS_MPI = mpiicpc -FFTW_DIR = /home/wenfei/codes/FFTW -OBJ_DIR = obj_deepks -NP = 4 - -#========================== -# FFTW package needed -#========================== -HONG_FFTW = -D__FFTW3 -D__MLALGO -FFTW_INCLUDE_DIR = ${FFTW_DIR}/include -FFTW_LIB_DIR = ${FFTW_DIR}/lib -FFTW_LIB = -L${FFTW_LIB_DIR} -lfftw3 -Wl,-rpath=${FFTW_LIB_DIR} - -#========================== -# libtorch and libnpy -#========================== -LIBTORCH_DIR = /home/wenfei/codes/libtorch -LIBNPY_DIR = /home/wenfei/codes/libnpy - -LIBTORCH_INCLUDE_DIR = -isystem ${LIBTORCH_DIR}/include -isystem ${LIBTORCH_DIR}/include/torch/csrc/api/include -LIBTORCH_LIB_DIR= ${LIBTORCH_DIR}/lib -LIBTORCH_LIB = -L${LIBTORCH_LIB_DIR} -ltorch -lc10 -Wl,-rpath,${LIBTORCH_LIB_DIR} -Wl,--no-as-needed,"${LIBTORCH_LIB_DIR}/libtorch_cpu.so" -Wl,--as-needed ${LIBTORCH_LIB_DIR}/libc10.so -lpthread -Wl,--no-as-needed,"${LIBTORCH_LIB_DIR}/libtorch.so" -Wl,--as-needed - -CNPY_INCLUDE_DIR = ${LIBNPY_DIR} - -#========================== -# LIBS and INCLUDES -#========================== -LIBS = -lifcore -lm -lpthread ${FFTW_LIB} ${LIBTORCH_LIB} - -#========================== -# OPTIMIZE OPTIONS -#========================== -INCLUDES = -I. -Icommands -I${FFTW_INCLUDE_DIR} ${LIBTORCH_INCLUDE_DIR} -I${CNPY_INCLUDE_DIR} - -# -pedantic turns off more extensions and generates more warnings -# -xHost generates instructions for the highest instruction set available on the compilation host processor -OPTS = ${INCLUDES} -Ofast -std=c++14 -march=native -xHost -m64 -qopenmp -Werror -Wall -pedantic -g - -include Makefile.Objects - -VPATH=../../../source_main\ -:../../source_base\ -:../../module_io\ -:../../source_pw/hamilt_pwdft\ -:../../source_basis/module_ao\ -:../../module_neighbor\ -:../../source_cell\ -:../../source_estate\ -:../../\ -:../\ -:./\ - -#========================== -# Define HONG -#========================== -HONG= -DMETIS -DMKL_ILP64 -D__LCAO ${HONG_FFTW} - -FP_OBJS_0=main.o\ -LCAO_deepks_test.o\ -LCAO_deepks_test_prep.o\ -$(OBJS_MAIN)\ -$(OBJS_IO)\ -$(OBJS_BASE)\ -$(OBJS_CELL)\ -$(OBJS_ORB)\ -$(OBJS_NEIGHBOR)\ -$(OBJS_PW)\ -$(OBJS_ELECSTATE)\ - -FP_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${FP_OBJS_0}) - -#========================== -# MAKING OPTIONS -#========================== -DEEPKS : - @ make init - @ make -j $(NP) serial - -init : - @ if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi - @ if [ ! -d $(OBJ_DIR)/README ]; then echo "This directory contains all of the .o files" > $(OBJ_DIR)/README; fi - -serial : ${FP_OBJS} - ${CPLUSPLUS} ${OPTS} $(FP_OBJS) ${LIBS} -o ${VERSION}.x - -#========================== -# rules -#========================== -${OBJ_DIR}/%.o:%.cpp - ${CPLUSPLUS_MPI} ${OPTS} ${OPTS_MPI} -c ${HONG} $< -o $@ - -.PHONY:clean -clean: - @ if [ -d $(OBJ_DIR) ]; then rm -rf $(OBJ_DIR); fi diff --git a/source/module_hamilt_lcao/module_deepks/test/Makefile.Objects b/source/module_hamilt_lcao/module_deepks/test/Makefile.Objects deleted file mode 100644 index 42b0143270..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/Makefile.Objects +++ /dev/null @@ -1,76 +0,0 @@ -# -# The ABACUS-deepks module -# - -VERSION= ABACUS-deepks -HEADERS= *.h - -OBJS_MAIN=klist_1.o\ -parallel_orbitals.o\ -deepks_basic.o\ -deepks_force.o\ -deepks_iterate.o\ -deepks_vdelta.o\ -deepks_pdm.o\ -deepks_phialpha.o\ -LCAO_deepks.o\ -LCAO_deepks_io.o\ - -OBJS_IO=output.o\ - -OBJS_PW=magnetism.o\ -soc.o\ - -OBJS_BASE=math_integral.o\ -math_sphbes.o\ -math_polyint.o\ -math_ylmreal.o\ -ylm.o\ -memory.o\ -matrix3.o\ -matrix.o\ -intarray.o\ -sph_bessel.o\ -sph_bessel_recursive-d1.o\ -sph_bessel_recursive-d2.o\ -complexarray.o\ -complexmatrix.o\ -timer.o\ -realarray.o\ -global_file.o\ -global_function.o\ -global_variable.o\ -tool_title.o\ -tool_quit.o\ -tool_check.o\ -mathzone_add1.o\ - -OBJS_CELL=pseudo.o\ -atom_spec.o\ -atom_pseudo.o\ -read_pp.o\ -read_pp_complete.o\ -read_pp_upf100.o\ -read_pp_upf201.o\ -read_pp_vwr.o\ -read_pp_blps.o\ -unitcell.o\ -check_atomic_stru.o\ -read_atoms.o\ -read_cell_pseudopots.o\ -setup_nonlocal.o - -OBJS_ORB=ORB_read.o\ -ORB_atomic.o\ -ORB_atomic_lm.o\ -ORB_nonlocal.o\ -ORB_nonlocal_lm.o\ -ORB_gaunt_table.o\ - -OBJS_NEIGHBOR=sltk_atom_arrange.o\ -sltk_atom.o\ -sltk_grid.o\ -sltk_grid_driver.o - -OBJS_ELECSTATE=read_pseudo.o\ -cal_nelec_nband.o\ \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/test/klist.h b/source/module_hamilt_lcao/module_deepks/test/klist.h deleted file mode 100644 index b63e627c9a..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/klist.h +++ /dev/null @@ -1,72 +0,0 @@ -///klist : adapted from klist from source_pw/hamilt_pwdft -///deals with k point sampling - -#include "source_base/vector3.h" -#include "source_base/matrix3.h" -#include "source_base/memory.h" -#include "source_base/global_function.h" -#include -#include - -namespace Test_Deepks -{ -class K_Vectors -{ -public: - - ModuleBase::Vector3 *kvec_c; // Cartesian coordinates of k points - std::vector> kvec_d; // Direct coordinates of k points - - double *wk; // wk, weight of k points - - int *isk; // distinguish spin up and down k points - - int nkstot; // total number of k points - - int nmp[3]; // Number of Monhorst-Pack - - K_Vectors(); - ~K_Vectors(); - - void set( - const std::string &k_file_name, - const int& nspin, - const ModuleBase::Matrix3 &reciprocal_vec, - const ModuleBase::Matrix3 &latvec, - bool &GAMMA_ONLY_LOCAL, - std::ofstream &ofs_running, - std::ofstream &ofs_warning); - -private: - int nspin; - bool kc_done; - bool kd_done; - double koffset[3]; // used only in automatic k-points. - std::string k_kword; //LiuXh add 20180619 - int k_nkstot; //LiuXh add 20180619 - - // step 1 : generate kpoints - bool read_kpoints( - const std::string &fn, - bool &GAMMA_ONLY_LOCAL, - std::ofstream &ofs_warning, - std::ofstream &ofs_running); - void Monkhorst_Pack(const int *nmp_in,const double *koffset_in,const int tipo); - double Monkhorst_Pack_formula( const int &k_type, const double &offset, - const int& n, const int &dim); - - // step 2 : set both kvec and kved; normalize weight - void set_both_kvec(const ModuleBase::Matrix3 &G,const ModuleBase::Matrix3 &Rm, std::ofstream &ofs_running); - void renew(const int &kpoint_number); - void normalize_wk( const int °spin ); - - // step 3 : *2 or *4 kpoints. - // *2 for LSDA - // *4 for non-collinear - void set_kup_and_kdw(std::ofstream &ofs_running); - - // step 4 - // print k lists. - void print_klists(std::ofstream &fn_running); -}; -} diff --git a/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp b/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp deleted file mode 100644 index 3300ea92d0..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/klist_1.cpp +++ /dev/null @@ -1,605 +0,0 @@ -#include "klist.h" - -#include "module_parameter/parameter.h" -namespace Test_Deepks -{ - K_Vectors::K_Vectors() - { - nspin = 0; // default spin. - kc_done = false; - kd_done = false; - - kvec_c = new ModuleBase::Vector3[1]; - kvec_d.resize(1); - - wk = nullptr; - isk = nullptr; - - nkstot = 0; - } - - K_Vectors::~K_Vectors() - { - delete[] kvec_c; - kvec_d.clear(); - delete[] wk; - delete[] isk; - } - - void K_Vectors::set( - const std::string &k_file_name, - const int& nspin_in, - const ModuleBase::Matrix3 &reciprocal_vec, - const ModuleBase::Matrix3 &latvec, - bool &GAMMA_ONLY_LOCAL, - std::ofstream &ofs_running, - std::ofstream &ofs_warning) - { - - ofs_running << "\n\n\n\n"; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " | Setup K-points |" << std::endl; - ofs_running << " | We setup the k-points according to input parameters. |" << std::endl; - ofs_running << " | The reduced k-points are set according to symmetry operations. |" << std::endl; - ofs_running << " | We treat the spin as another set of k-points. |" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - ofs_running << "\n\n\n\n"; - - ofs_running << "\n SETUP K-POINTS" << std::endl; - - // (1) set nspin, read kpoints. - this->nspin = nspin_in; - ModuleBase::GlobalFunc::OUT(ofs_running,"nspin",nspin); - - bool read_succesfully = this->read_kpoints( - k_file_name, - GAMMA_ONLY_LOCAL, - ofs_warning, - ofs_running); - if(!read_succesfully) - { - ofs_warning << "in K_Vectors::set, something wrong while reading KPOINTS." << std::endl; - exit(1); - } - - // (2) - this->set_both_kvec(reciprocal_vec, latvec, ofs_running); - - int deg = 0; - if(PARAM.inp.nspin == 1) - { - deg = 2; - } - else if(PARAM.inp.nspin == 2||PARAM.inp.nspin==4) - { - deg = 1; - } - else - { - ofs_warning << "In K_Vectors::set, Only available for nspin = 1 or 2 or 4" << std::endl; - exit(1); - } - this->normalize_wk(deg); - - // It's very important in parallel case, - // firstly do the mpi_k() and then - // do set_kup_and_kdw() - - this->set_kup_and_kdw(ofs_running); - - this->print_klists(ofs_running); - //std::cout << " NUMBER OF K-POINTS : " << nkstot << std::endl; - - return; - } - - void K_Vectors::renew(const int &kpoint_number) - { - delete[] kvec_c; - delete[] wk; - delete[] isk; - - kvec_c = new ModuleBase::Vector3[kpoint_number]; - kvec_d.resize(kpoint_number); - wk = new double[kpoint_number]; - isk = new int[kpoint_number]; - - ModuleBase::Memory::record("KV::kvec_c",sizeof(double) * kpoint_number*3); - ModuleBase::Memory::record("KV::kvec_d",sizeof(double) * kpoint_number*3); - ModuleBase::Memory::record("KV::wk",sizeof(double) * kpoint_number*3); - ModuleBase::Memory::record("KV::isk",sizeof(int) * kpoint_number*3); - - return; - } - - bool K_Vectors::read_kpoints(const std::string &fn, bool &GAMMA_ONLY_LOCAL, std::ofstream &ofs_warning, std::ofstream &ofs_running) - { - - std::ifstream ifk(fn.c_str()); - ifk >> std::setiosflags(std::ios::uppercase); - - ifk.clear(); - ifk.seekg(0); - - std::string word; - std::string kword; - - int ierr = 0; - - ifk.rdstate(); - - while (ifk.good()) - { - ifk >> word; - ifk.ignore(150, '\n'); //LiuXh add 20180416, fix bug in k-point file when the first line with comments - if (word == "K_POINTS" || word == "KPOINTS" || word == "K" ) - { - ierr = 1; - break; - } - - ifk.rdstate(); - } - - if (ierr == 0) - { - ofs_warning << " symbol K_POINTS not found." << std::endl; - return 0; - } - - //input k-points are in 2pi/a units - ModuleBase::GlobalFunc::READ_VALUE(ifk, nkstot); - - //std::cout << " nkstot = " << nkstot << std::endl; - ModuleBase::GlobalFunc::READ_VALUE(ifk, kword); - - // mohan update 2021-02-22 - int max_kpoints = 100000; - if (nkstot > 100000) - { - ofs_warning << " nkstot > MAX_KPOINTS" << std::endl; - return 0; - } - - int k_type = 0; - if (nkstot == 0) // nkstot==0, use monkhorst_pack. add by dwan - { - if (kword == "Gamma") - { - k_type = 0; - ModuleBase::GlobalFunc::OUT(ofs_running,"Input type of k points","Monkhorst-Pack(Gamma)"); - } - else if (kword == "Monkhorst-Pack" || kword == "MP" || kword == "mp") - { - k_type = 1; - ModuleBase::GlobalFunc::OUT(ofs_running,"Input type of k points","Monkhorst-Pack"); - } - else - { - ofs_warning << " Error: neither Gamma nor Monkhorst-Pack." << std::endl; - return 0; - } - - ifk >> nmp[0] >> nmp[1] >> nmp[2]; - - ifk >> koffset[0] >> koffset[1] >> koffset[2]; - this->Monkhorst_Pack(nmp, koffset, k_type); - } - else if (nkstot > 0) - { - if (kword == "Cartesian" || kword == "C") - { - this->renew(nkstot * nspin);//mohan fix bug 2009-09-01 - for (int i = 0;i < nkstot;i++) - { - ifk >> kvec_c[i].x >> kvec_c[i].y >> kvec_c[i].z; - ModuleBase::GlobalFunc::READ_VALUE(ifk, wk[i]); - } - - this->kc_done = true; - } - else if (kword == "Direct" || kword == "D") - { - this->renew(nkstot * nspin);//mohan fix bug 2009-09-01 - for (int i = 0;i < nkstot;i++) - { - ifk >> kvec_d[i].x >> kvec_d[i].y >> kvec_d[i].z; - ModuleBase::GlobalFunc::READ_VALUE(ifk, wk[i]); - } - this->kd_done = true; - } - else if (kword == "Line_Cartesian" ) - { - //std::cout << " kword = " << kword << std::endl; - - // how many special points. - int nks_special = this->nkstot; - //std::cout << " nks_special = " << nks_special << std::endl; - - //------------------------------------------ - // number of points to the next k points - //------------------------------------------ - int* nkl = new int[nks_special]; - - //------------------------------------------ - // cartesian coordinates of special points. - //------------------------------------------ - double *ksx = new double[nks_special]; - double *ksy = new double[nks_special]; - double *ksz = new double[nks_special]; - std::vector kposx; - std::vector kposy; - std::vector kposz; - ModuleBase::GlobalFunc::ZEROS(nkl, nks_special); - - //recalculate nkstot. - nkstot = 0; - for(int iks=0; iks> ksx[iks]; - ifk >> ksy[iks]; - ifk >> ksz[iks]; - ModuleBase::GlobalFunc::READ_VALUE( ifk, nkl[iks] ); - //std::cout << " nkl[" << iks << "]=" << nkl[iks] << std::endl; - assert(nkl[iks] >= 0); - nkstot += nkl[iks]; - } - assert( nkl[nks_special-1] == 1); - - //std::cout << " nkstot = " << nkstot << std::endl; - this->renew(nkstot * nspin);//mohan fix bug 2009-09-01 - - int count = 0; - for(int iks=1; ikskc_done = true; - - } - - else if (kword == "Line_Direct" || kword == "L" || kword == "Line" ) - { - //std::cout << " kword = " << kword << std::endl; - - // how many special points. - int nks_special = this->nkstot; - //std::cout << " nks_special = " << nks_special << std::endl; - - //------------------------------------------ - // number of points to the next k points - //------------------------------------------ - int* nkl = new int[nks_special]; - - //------------------------------------------ - // cartesian coordinates of special points. - //------------------------------------------ - double *ksx = new double[nks_special]; - double *ksy = new double[nks_special]; - double *ksz = new double[nks_special]; - std::vector kposx; - std::vector kposy; - std::vector kposz; - ModuleBase::GlobalFunc::ZEROS(nkl, nks_special); - - //recalculate nkstot. - nkstot = 0; - for(int iks=0; iks> ksx[iks]; - ifk >> ksy[iks]; - ifk >> ksz[iks]; - ModuleBase::GlobalFunc::READ_VALUE( ifk, nkl[iks] ); - //std::cout << " nkl[" << iks << "]=" << nkl[iks] << std::endl; - assert(nkl[iks] >= 0); - nkstot += nkl[iks]; - } - assert( nkl[nks_special-1] == 1); - - //std::cout << " nkstot = " << nkstot << std::endl; - this->renew(nkstot * nspin);//mohan fix bug 2009-09-01 - - int count = 0; - for(int iks=1; ikskd_done = true; - - } - - else - { - ofs_warning << " Error : neither Cartesian nor Direct kpoint." << std::endl; - return 0; - } - } - - ModuleBase::GlobalFunc::OUT(ofs_running,"nkstot",nkstot); - return 1; - } // END SUBROUTINE - - - double K_Vectors::Monkhorst_Pack_formula( const int &k_type, const double &offset, - const int& n, const int &dim) - { - double coordinate; - if (k_type==1) coordinate = (offset + 2.0 * (double)n - (double)dim - 1.0) / (2.0 * (double)dim); - else coordinate = (offset + (double)n - 1.0) / (double)dim; - - return coordinate; - } - - //add by dwan - void K_Vectors::Monkhorst_Pack(const int *nmp_in, const double *koffset_in, const int k_type) - { - const int mpnx = nmp_in[0]; - const int mpny = nmp_in[1]; - const int mpnz = nmp_in[2]; - - this->nkstot = mpnx * mpny * mpnz; - // only can renew after nkstot is estimated. - this->renew(nkstot * nspin); // mohan fix bug 2009-09-01 - for (int x = 1;x <= mpnx;x++) - { - double v1 = Monkhorst_Pack_formula( k_type, koffset_in[0], x, mpnx); - if( std::abs(v1) < 1.0e-10 ) v1 = 0.0; //mohan update 2012-06-10 - for (int y = 1;y <= mpny;y++) - { - double v2 = Monkhorst_Pack_formula( k_type, koffset_in[1], y, mpny); - if( std::abs(v2) < 1.0e-10 ) v2 = 0.0; - for (int z = 1;z <= mpnz;z++) - { - double v3 = Monkhorst_Pack_formula( k_type, koffset_in[2], z, mpnz); - if( std::abs(v3) < 1.0e-10 ) v3 = 0.0; - // index of nks kpoint - const int i = mpnx * mpny * (z - 1) + mpnx * (y - 1) + (x - 1); - kvec_d[i].set(v1, v2, v3); - } - } - } - - const double weight = 1.0 / static_cast(nkstot); - for (int ik=0; ikkd_done = true; - - return; - } - - void K_Vectors::set_both_kvec(const ModuleBase::Matrix3 &G, const ModuleBase::Matrix3 &R, std::ofstream &ofs_running) - { - // set cartesian k vectors. - if (!kc_done && kd_done) - { - for (int i = 0;i < nkstot;i++) - { - //wrong!! kvec_c[i] = G * kvec_d[i]; - // mohan fixed bug 2010-1-10 - if( std::abs(kvec_d[i].x) < 1.0e-10 ) kvec_d[i].x = 0.0; - if( std::abs(kvec_d[i].y) < 1.0e-10 ) kvec_d[i].y = 0.0; - if( std::abs(kvec_d[i].z) < 1.0e-10 ) kvec_d[i].z = 0.0; - - // mohan add2012-06-10 - if( std::abs(kvec_c[i].x) < 1.0e-10 ) kvec_c[i].x = 0.0; - if( std::abs(kvec_c[i].y) < 1.0e-10 ) kvec_c[i].y = 0.0; - if( std::abs(kvec_c[i].z) < 1.0e-10 ) kvec_c[i].z = 0.0; - } - kc_done = true; - } - - // set direct k vectors - else if (kc_done && !kd_done) - { - ModuleBase::Matrix3 RT = R.Transpose(); - for (int i = 0;i < nkstot;i++) - { - // std::cout << " ik=" << i - // << " kvec.x=" << kvec_c[i].x - // << " kvec.y=" << kvec_c[i].y - // << " kvec.z=" << kvec_c[i].z << std::endl; - //wrong! kvec_d[i] = RT * kvec_c[i]; - // mohan fixed bug 2011-03-07 - kvec_d[i] = kvec_c[i] * RT; - } - kd_done = true; - } - - ofs_running << "\n " << std::setw(8) << "KPOINTS" - << std::setw(20) << "DIRECT_X" - << std::setw(20) << "DIRECT_Y" - << std::setw(20) << "DIRECT_Z" - << std::setw(20) << "WEIGHT" << std::endl; - - for(int i=0; ikvec_d[i].x - << std::setw(20) << this->kvec_d[i].y - << std::setw(20) << this->kvec_d[i].z - << std::setw(20) << this->wk[i] << std::endl; - } - - return; - } - - - void K_Vectors::normalize_wk(const int °spin) - { - double sum = 0.0; - - for (int ik = 0;ik < nkstot;ik++) - { - sum += this->wk[ik]; - } - assert(sum>0.0); - - for (int ik = 0;ik < nkstot;ik++) - { - this->wk[ik] /= sum; - } - - for (int ik = 0;ik < nkstot;ik++) - { - this->wk[ik] *= degspin; - } - - return; - } - - //---------------------------------------------------------- - // This routine sets the k vectors for the up and down spin - //---------------------------------------------------------- - // from set_kup_and_kdw.f90 - void K_Vectors::set_kup_and_kdw(std::ofstream &ofs_running) - { - //========================================================================= - // on output: the number of points is doubled and xk and wk in the - // first (nks/2) positions correspond to up spin - // those in the second (nks/2) ones correspond to down spin - //========================================================================= - switch (nspin) - { - case 1: - - for (int ik = 0; ik < nkstot; ik++) - { - this->isk[ik] = 0; - } - - break; - - case 2: - - for (int ik = 0; ik < nkstot; ik++) - { - this->kvec_c[ik+nkstot] = kvec_c[ik]; - this->kvec_d[ik+nkstot] = kvec_d[ik]; - this->wk[ik+nkstot] = wk[ik]; - this->isk[ik] = 0; - this->isk[ik+nkstot] = 1; - } - - this->nkstot *= 2; - - ModuleBase::GlobalFunc::OUT(ofs_running,"nkstot(nspin=2)",nkstot); - break; - case 4: - - for (int ik = 0; ik < nkstot; ik++) - { - this->isk[ik] = 0; - } - - break; - } - - return; - } // end subroutine set_kup_and_kdw - - - void K_Vectors::print_klists(std::ofstream &ofs_running) - { - ofs_running << "\n " << std::setw(8) << "KPOINTS" - << std::setw(20) << "CARTESIAN_X" - << std::setw(20) << "CARTESIAN_Y" - << std::setw(20) << "CARTESIAN_Z" - << std::setw(20) << "WEIGHT" << std::endl; - for(int i=0; ikvec_c[i].x - << std::setw(20) << this->kvec_c[i].y - << std::setw(20) << this->kvec_c[i].z - << std::setw(20) << this->wk[i] << std::endl; - } - - ofs_running << "\n " << std::setw(8) << "KPOINTS" - << std::setw(20) << "DIRECT_X" - << std::setw(20) << "DIRECT_Y" - << std::setw(20) << "DIRECT_Z" - << std::setw(20) << "WEIGHT" << std::endl; - for(int i=0; ikvec_d[i].x - << std::setw(20) << this->kvec_d[i].y - << std::setw(20) << this->kvec_d[i].z - << std::setw(20) << this->wk[i] << std::endl; - } - - return; - } - -} diff --git a/source/module_hamilt_lcao/module_deepks/test/main_deepks.cpp b/source/module_hamilt_lcao/module_deepks/test/main_deepks.cpp deleted file mode 100644 index a80e07db69..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/main_deepks.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "LCAO_deepks_test.h" -#ifdef __MPI -#include -#endif - -int calculate(); - -template -void run_tests(test_deepks& test); - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - int status = calculate(); -#ifdef __MPI - MPI_Finalize(); -#endif - - if (status > 0) - { - return 1; - } - else - { - return 0; - } -} - -int calculate() -{ - std::ifstream ifs("INPUT"); - char word[80]; - bool gamma_only_local; - ifs >> word; - ifs >> gamma_only_local; - ifs.close(); - - if (gamma_only_local) - { - test_deepks test; - run_tests(test); - return test.failed_check; - } - else - { - test_deepks> test; - run_tests(test); - return test.failed_check; - } -} - -template -void run_tests(test_deepks& test) -{ - test.preparation(); - - test.check_dstable(); - test.check_phialpha(); - - test.check_pdm(); - - std::vector descriptor; - test.check_descriptor(descriptor); - - torch::Tensor gdmx; - test.check_gdmx(gdmx); - test.check_gvx(gdmx); - - torch::Tensor gdmepsl; - test.check_gdmepsl(gdmepsl); - test.check_gvepsl(gdmepsl); - - test.check_orbpre(); - - test.check_vdpre(); - test.check_vdrpre(); - - test.check_edelta(descriptor); - test.check_e_deltabands(); - test.check_f_delta_and_stress_delta(); - test.check_o_delta(); - - std::cout << " [ ------ ] Total checks : " << test.total_check << std::endl; - if (test.failed_check > 0) - { - std::cout << "\e[1;31m [ FAILED ]\e[0m Failed checks : " << test.failed_check << std::endl; - } - else - { - std::cout << "\e[1;32m [ PASS ]\e[0m All checks passed!" << std::endl; - } -} - -template void run_tests(test_deepks& test); -template void run_tests(test_deepks>& test); \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deepks/test/parallel_orbitals.h b/source/module_hamilt_lcao/module_deepks/test/parallel_orbitals.h deleted file mode 100644 index b9371d9a23..0000000000 --- a/source/module_hamilt_lcao/module_deepks/test/parallel_orbitals.h +++ /dev/null @@ -1,25 +0,0 @@ -///adapted from parallel_orbitals from source_basis/module_ao -///deals with the parallelization of atomic basis - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/memory.h" - -namespace Test_Deepks -{ - class Parallel_Orbitals - { - public: - - Parallel_Orbitals(); - ~Parallel_Orbitals(); - - int* global2local_row; - int* global2local_col; - void set_global2local(void); - - int ncol; - int nrow; - int nloc; - }; -} diff --git a/source/module_hamilt_lcao/module_deltaspin/CMakeLists.txt b/source/module_hamilt_lcao/module_deltaspin/CMakeLists.txt deleted file mode 100644 index 02f389e5f1..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -list(APPEND objects - spin_constrain.cpp - init_sc.cpp - cal_mw.cpp - basic_funcs.cpp - lambda_loop_helper.cpp - lambda_loop.cpp - cal_mw_from_lambda.cpp - template_helpers.cpp -) - -add_library( - deltaspin - OBJECT - ${objects} -) - -if(ENABLE_COVERAGE) - add_coverage(deltaspin) -endif() - -if(BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() -endif() - diff --git a/source/module_hamilt_lcao/module_deltaspin/basic_funcs.cpp b/source/module_hamilt_lcao/module_deltaspin/basic_funcs.cpp deleted file mode 100644 index 343b2b37a7..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/basic_funcs.cpp +++ /dev/null @@ -1,149 +0,0 @@ -#include "basic_funcs.h" - -#include -#include "source_base/formatter.h" -#include "source_base/constants.h" - -double maxval_abs_2d(const std::vector>& array) -{ - double max = 0; - for (const auto& value: array) - { - max = std::max(max, std::abs(value.x)); - max = std::max(max, std::abs(value.y)); - max = std::max(max, std::abs(value.z)); - } - return max; -} - -std::pair maxloc_abs_2d(const std::vector>& array) -{ - double max = 0; - int i_max = 0; - int j_max = 0; - for (int i = 0; i < array.size(); i++) - { - for (int j = 0; j < 3; j++) - { - if ((max < std::abs(array[i][j]))) - { - max = std::abs(array[i][j]); - i_max = i; - j_max = j; - } - } - } - return std::make_pair(i_max, j_max); -} - -template -T sum_2d(const std::vector>& array) -{ - ModuleBase::Vector3 sum; - for (const auto& element: array) - { - sum += element; - } - T final_sum = sum.x + sum.y + sum.z; - return final_sum; -} - -// Explicit instantiation -template int sum_2d(const std::vector>& array); -template double sum_2d(const std::vector>& array); - -void scalar_multiply_2d(const std::vector>& array, - double scalar, - std::vector>& result) -{ - int size = array.size(); - result.reserve(size); - for (int i = 0; i < size; i++) - { - result[i] = scalar * array[i]; - } -} - -void add_scalar_multiply_2d(const std::vector>& array_1, - const std::vector>& array_2, - double scalar, - std::vector>& result) -{ - int size = array_1.size(); - result.reserve(size); - for (int i = 0; i < size; i++) - { - result[i] = array_1[i] + scalar * array_2[i]; - } -} - -void subtract_2d(const std::vector>& array_1, - const std::vector>& array_2, - std::vector>& result) -{ - int size = array_1.size(); - result.reserve(size); - for (int i = 0; i < size; i++) - { - result[i] = array_1[i] - array_2[i]; - } -} - -void fill_scalar_2d(double scalar, std::vector>& result) -{ - for (auto& row: result) - { - row.x = scalar; - row.y = scalar; - row.z = scalar; - } -} - -void where_fill_scalar_2d(const std::vector>& array_mask, - int mask, - double scalar, - std::vector>& result) -{ - int size = array_mask.size(); - result.resize(size); - for (int i = 0; i < size; i++) - { - for (int j = 0; j < 3; j++) - { - if (array_mask[i][j] == mask) - { - result[i][j] = scalar; - } - } - } -} - -void where_fill_scalar_else_2d(const std::vector>& array_mask, - int mask, - double scalar, - const std::vector>& rest, - std::vector>& result) -{ - int size = array_mask.size(); - result.resize(size); - for (int i = 0; i < size; i++) - { - for (int j = 0; j < 3; j++) - { - result[i][j] = (array_mask[i][j] == mask) ? scalar : rest[i][j]; - } - } -} - -void print_2d(const std::string info, const std::vector> &array, const int nspin, const double unit_convert, std::ostream& ofs) -{ - ofs << info << std::endl; - int iat = 0; - for (const auto &row : array) - { - iat += 1; - if (nspin == 2) { ofs << FmtCore::format("ATOM %6d %20.10f\n", iat, row.z*unit_convert); - } else if (nspin == 4) { ofs << FmtCore::format("ATOM %6d %20.10f %20.10f %20.10f\n", iat, row.x*unit_convert, row.y*unit_convert, row.z*unit_convert); -} - } -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/basic_funcs.h b/source/module_hamilt_lcao/module_deltaspin/basic_funcs.h deleted file mode 100644 index b1de060c4b..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/basic_funcs.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef BASIC_FUNCS_H -#define BASIC_FUNCS_H - -#include -#include -#include - -#include "source_base/vector3.h" - -/** - * @brief Find the maximum absolute value in a 2D array. - */ -double maxval_abs_2d(const std::vector>& array); - -/** - * @brief Find the maximum absolute value in a 2D array and its index. - */ -std::pair maxloc_abs_2d(const std::vector>& array); - -/** - * @brief sum of all elements in a 2D array. - */ -template -T sum_2d(const std::vector>& array); - -/** - * @brief scalar multiply a 2D array. - */ -void scalar_multiply_2d(const std::vector>& array, - double scalar, - std::vector>& result); - -/** - * @brief array_1 + scalar * array_2. - */ -void add_scalar_multiply_2d(const std::vector>& array_1, - const std::vector>& array_2, - double scalar, - std::vector>& result); - -/** - * @brief array_1 - array_2. - */ -void subtract_2d(const std::vector>& array_1, - const std::vector>& array_2, - std::vector>& result); - -/** - * @brief fill a 2D array with a scalar. - */ -void fill_scalar_2d(double scalar, std::vector>& result); - -/** - * @brief fill a 2D array with a scalar if the corresponding element is equal to mask. - */ -void where_fill_scalar_2d(const std::vector>& array_mask, - int mask, - double scalar, - std::vector>& result); - -void where_fill_scalar_else_2d(const std::vector>& array_mask, - int mask, - double scalar, - const std::vector>& rest, - std::vector>& result); - -void print_2d(const std::string info, const std::vector> &array, const int nspin, const double unit_convert = 1.0, std::ostream& ofs = std::cout); - -#endif // BASIC_FUNCS_H \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/cal_mw.cpp b/source/module_hamilt_lcao/module_deltaspin/cal_mw.cpp deleted file mode 100644 index 5c362c5bcf..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/cal_mw.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include - -#include "source_base/matrix.h" -#include "source_base/name_angular.h" -#include "source_base/scalapack_connector.h" -#include "source_base/tool_title.h" -#include "source_base/timer.h" -#include "source_pw/hamilt_pwdft/onsite_projector.h" -#include "spin_constrain.h" -#include "module_parameter/parameter.h" -#ifdef __LCAO -#include "source_estate/elecstate_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h" - -template <> -void spinconstrain::SpinConstrain>::cal_mi_lcao(const int& step, bool print) -{ - ModuleBase::TITLE("module_deltaspin", "cal_mi_lcao"); - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "cal_mi_lcao"); - // calculate MW from lambda in real space projection method - this->zero_Mi(); - const hamilt::HContainer* dmr - = static_cast>*>(this->pelec)->get_DM()->get_DMR_pointer(1); - std::vector moments; - if(PARAM.inp.nspin==2) - { - static_cast>*>(this->pelec)->get_DM()->switch_dmr(2); - moments = static_cast, double>>*>(this->p_operator)->cal_moment(dmr, this->get_constrain()); - static_cast>*>(this->pelec)->get_DM()->switch_dmr(0); - for(int iat=0;iatMi_.size();iat++) - { - this->Mi_[iat].x = 0.0; - this->Mi_[iat].y = 0.0; - this->Mi_[iat].z = moments[iat]; - } - } - else if(PARAM.inp.nspin==4) - { - moments = static_cast, std::complex>>*>(this->p_operator)->cal_moment(dmr, this->get_constrain()); - for(int iat=0;iatMi_.size();iat++) - { - this->Mi_[iat].x = moments[iat*3]; - this->Mi_[iat].y = moments[iat*3+1]; - this->Mi_[iat].z = moments[iat*3+2]; - } - } - - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "cal_mi_lcao"); -} - -#endif - -template <> -void spinconstrain::SpinConstrain>::cal_mi_pw() -{ - ModuleBase::TITLE("module_deltaspin", "cal_mi_pw"); - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "cal_mi_pw"); - - this->zero_Mi(); - if(PARAM.inp.device == "cpu") - { - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - // loop over k-points to calculate Mi of \sum_{k,i,l,m} - std::complex* psi_pointer = nullptr; - psi::Psi, base_device::DEVICE_CPU>* psi_t = static_cast, base_device::DEVICE_CPU>*>(this->psi); - const int nbands = psi_t->get_nbands(); - const int nks = psi_t->get_nk(); - const int npol = psi_t->get_npol(); - for(int ik = 0; ik < nks; ik++) - { - psi_t->fix_k(ik); - psi_pointer = psi_t->get_pointer(); - onsite_p->tabulate_atomic(ik); // tabulate for each atom at each k-point - // std::cout << __FILE__ << ":" << __LINE__ << " nbands = " << nbands << std::endl; - onsite_p->overlap_proj_psi(nbands * npol, psi_pointer); - const std::complex* becp = onsite_p->get_h_becp(); - // becp(nbands*npol , nkb) - // mag = wg * \sum_{nh}becp * becp - int nkb = onsite_p->get_tot_nproj(); - for(int ib = 0;ibpelec->wg(ik, ib); - int begin_ih = 0; - for(int iat = 0; iat < this->Mi_.size(); iat++) - { - std::complex occ[4] = {ModuleBase::ZERO, ModuleBase::ZERO, ModuleBase::ZERO, ModuleBase::ZERO}; - const int nh = onsite_p->get_nh(iat); - for(int ih = 0; ih < nh; ih++) - { - const int index = ib*2*nkb + begin_ih + ih; - occ[0] += conj(becp[index]) * becp[index]; - occ[1] += conj(becp[index]) * becp[index + nkb]; - occ[2] += conj(becp[index + nkb]) * becp[index]; - occ[3] += conj(becp[index + nkb]) * becp[index + nkb]; - } - // occ has been reduced and calculate mag - this->Mi_[iat].z += weight * (occ[0] - occ[3]).real(); - this->Mi_[iat].x += weight * (occ[1] + occ[2]).real(); - this->Mi_[iat].y += weight * (occ[1] - occ[2]).imag(); - begin_ih += nh; - } - } - } - } -#if ((defined __CUDA) || (defined __ROCM)) - else - { - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - // loop over k-points to calculate Mi of \sum_{k,i,l,m} - std::complex* psi_pointer = nullptr; - psi::Psi, base_device::DEVICE_GPU>* psi_t = static_cast, base_device::DEVICE_GPU>*>(this->psi); - const int nbands = psi_t->get_nbands(); - const int nks = psi_t->get_nk(); - const int npol = psi_t->get_npol(); - for(int ik = 0; ik < nks; ik++) - { - psi_t->fix_k(ik); - psi_pointer = psi_t->get_pointer(); - onsite_p->tabulate_atomic(ik); // tabulate for each atom at each k-point - // std::cout << __FILE__ << ":" << __LINE__ << " nbands = " << nbands << std::endl; - onsite_p->overlap_proj_psi(nbands * npol, psi_pointer); - const std::complex* becp = onsite_p->get_h_becp(); - // becp(nbands*npol , nkb) - // mag = wg * \sum_{nh}becp * becp - int nkb = onsite_p->get_size_becp() / nbands / npol; - for(int ib = 0;ibpelec->wg(ik, ib); - int begin_ih = 0; - for(int iat = 0; iat < this->Mi_.size(); iat++) - { - std::complex occ[4] = {ModuleBase::ZERO, ModuleBase::ZERO, ModuleBase::ZERO, ModuleBase::ZERO}; - const int nh = onsite_p->get_nh(iat); - for(int ih = 0; ih < nh; ih++) - { - const int index = ib*2*nkb + begin_ih + ih; - occ[0] += conj(becp[index]) * becp[index]; - occ[1] += conj(becp[index]) * becp[index + nkb]; - occ[2] += conj(becp[index + nkb]) * becp[index]; - occ[3] += conj(becp[index + nkb]) * becp[index + nkb]; - } - // occ has been reduced and calculate mag - this->Mi_[iat].z += weight * (occ[0] - occ[3]).real(); - this->Mi_[iat].x += weight * (occ[1] + occ[2]).real(); - this->Mi_[iat].y += weight * (occ[1] - occ[2]).imag(); - begin_ih += nh; - } - } - } - } -#endif - // reduce mag from all k-pools - Parallel_Reduce::reduce_double_allpool(PARAM.inp.kpar, GlobalV::NPROC_IN_POOL, &(this->Mi_[0][0]), 3 * this->Mi_.size()); - - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "cal_mi_pw"); -} - -template <> -void spinconstrain::SpinConstrain>::set_operator( - hamilt::Operator>* op_in) -{ - this->p_operator = op_in; -} - -template <> -void spinconstrain::SpinConstrain::set_operator( - hamilt::Operator* op_in) -{ - this->p_operator = op_in; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/cal_mw_from_lambda.cpp b/source/module_hamilt_lcao/module_deltaspin/cal_mw_from_lambda.cpp deleted file mode 100644 index 310250acf6..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/cal_mw_from_lambda.cpp +++ /dev/null @@ -1,539 +0,0 @@ -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_hsolver/diago_iter_assist.h" -#include "module_parameter/parameter.h" -#include "spin_constrain.h" -#include "source_pw/hamilt_pwdft/onsite_projector.h" -#include "source_base/parallel_reduce.h" -#include "source_base/kernels/math_kernel_op.h" -#include "source_hsolver/hsolver_lcao.h" -#include "source_hsolver/hsolver_pw.h" -#include "source_estate/elecstate_pw.h" -#include "source_estate/elecstate_tools.h" - -#ifdef __LCAO -#include "source_estate/elecstate_lcao.h" -#include "source_estate/elecstate_tools.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h" -#endif - -template <> -void spinconstrain::SpinConstrain>::calculate_delta_hcc(std::complex* h_tmp, const std::complex* becp_k, const ModuleBase::Vector3* delta_lambda, const int nbands, const int nkb, const int* nh_iat) -{ - int sum = 0; - int size_ps = nkb * 2 * nbands; - std::complex* becp_cpu = nullptr; - if(PARAM.inp.device == "gpu") - { -#if ((defined __CUDA) || (defined __ROCM)) - base_device::DEVICE_GPU* ctx = {}; - base_device::DEVICE_CPU* cpu_ctx = {}; - base_device::memory::resize_memory_op, base_device::DEVICE_CPU>()(becp_cpu, size_ps); - base_device::memory::synchronize_memory_op, base_device::DEVICE_CPU, base_device::DEVICE_GPU>()(becp_cpu, becp_k, size_ps); -#endif - } - else if (PARAM.inp.device == "cpu") - { - becp_cpu = const_cast*>(becp_k); - } - - std::vector> ps(size_ps, 0.0); - for (int iat = 0; iat < this->Mi_.size(); iat++) - { - const int nproj = nh_iat[iat]; - const std::complex coefficients0(delta_lambda[iat][2], 0.0); - const std::complex coefficients1(delta_lambda[iat][0] , delta_lambda[iat][1]); - const std::complex coefficients2(delta_lambda[iat][0] , -1 * delta_lambda[iat][1]); - const std::complex coefficients3(-1 * delta_lambda[iat][2], 0.0); - // each atom has nproj, means this is with structure factor; - // each projector (each atom) must multiply coefficient - // with all the other projectors. - for (int ib = 0; ib < nbands * 2; ib+=2) - { - for (int ip = 0; ip < nproj; ip++) - { - const int becpind = ib * nkb + sum + ip; - const std::complex becp1 = becp_cpu[becpind]; - const std::complex becp2 = becp_cpu[becpind + nkb]; - ps[becpind] += coefficients0 * becp1 - + coefficients2 * becp2; - ps[becpind + nkb] += coefficients1 * becp1 - + coefficients3 * becp2; - } // end ip - } // end ib - sum += nproj; - } // end iat - std::complex* ps_pointer = nullptr; - if(PARAM.inp.device == "gpu") - { -#if ((defined __CUDA) || (defined __ROCM)) - base_device::DEVICE_GPU* ctx = {}; - base_device::DEVICE_CPU* cpu_ctx = {}; - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(ps_pointer, size_ps); - base_device::memory::synchronize_memory_op, base_device::DEVICE_GPU, base_device::DEVICE_CPU>()(ps_pointer, ps.data(), size_ps); -#endif - } - else if (PARAM.inp.device == "cpu") - { - ps_pointer = ps.data(); - } - // update h_tmp by becp_k * ps - char transa = 'C'; - char transb = 'N'; - const int npm = nkb * 2; - if (PARAM.inp.device == "gpu") - { -#if ((defined __CUDA) || (defined __ROCM)) - base_device::DEVICE_GPU* ctx = {}; - ModuleBase::gemm_op, base_device::DEVICE_GPU>()( - transa, - transb, - nbands, - nbands, - npm, - &ModuleBase::ONE, - becp_k, - npm, - ps_pointer, - npm, - &ModuleBase::ONE, - h_tmp, - nbands - ); - base_device::memory::delete_memory_op, base_device::DEVICE_GPU>()(ps_pointer); - delete[] becp_cpu; -#endif - - } - else if (PARAM.inp.device == "cpu") - { - base_device::DEVICE_CPU* ctx = {}; - ModuleBase::gemm_op, base_device::DEVICE_CPU>()( - transa, - transb, - nbands, - nbands, - npm, - &ModuleBase::ONE, - becp_k, - npm, - ps_pointer, - npm, - &ModuleBase::ONE, - h_tmp, - nbands - ); - } -} - -template <> -void spinconstrain::SpinConstrain>::cal_mw_from_lambda(int i_step, const ModuleBase::Vector3* delta_lambda) -{ - ModuleBase::TITLE("spinconstrain::SpinConstrain", "cal_mw_from_lambda"); - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "cal_mw_from_lambda"); - // lambda has been updated in the lambda loop -#ifdef __LCAO - if (PARAM.inp.basis_type == "lcao") - { - psi::Psi>* psi_t = static_cast>*>(this->psi); - hamilt::Hamilt>* hamilt_t = static_cast>*>(this->p_hamilt); - hsolver::HSolverLCAO> hsolver_t(this->ParaV, PARAM.inp.ks_solver); - if (PARAM.inp.nspin == 2) - { - dynamic_cast, double>>*>(this->p_operator) - ->update_lambda(); - } - else if (PARAM.inp.nspin == 4) - { - dynamic_cast, std::complex>>*>( - this->p_operator) - ->update_lambda(); - } - // diagonalization without update charge - hsolver_t.solve(hamilt_t, psi_t[0], this->pelec, true); - elecstate::calculate_weights(this->pelec->ekb, - this->pelec->wg, - this->pelec->klist, - this->pelec->eferm, - this->pelec->f_en, - this->pelec->nelec_spin, - this->pelec->skip_weights); - elecstate::calEBand(this->pelec->ekb,this->pelec->wg,this->pelec->f_en); - elecstate::ElecStateLCAO>* pelec_lcao - = dynamic_cast>*>(this->pelec); - elecstate::cal_dm_psi(this->ParaV, pelec_lcao->wg, *psi_t, *(pelec_lcao->get_DM())); - pelec_lcao->get_DM()->cal_DMR(); - this->cal_mi_lcao(i_step); - } - else -#endif - { - /*if (i_step == -1 && this->higher_mag_prec) - { - // std::cout<<__FILE__<<__LINE__<<"istep == 0"<>* psi_t = static_cast>*>(this->psi); - hamilt::Hamilt>* hamilt_t = static_cast>*>(this->p_hamilt); - hsolver::HSolver, base_device::DEVICE_CPU>* hsolver_t = static_cast, base_device::DEVICE_CPU>*>(this->phsol); - hsolver_t->solve(hamilt_t, psi_t[0], this->pelec, this->KS_SOLVER, true); - } - else - { - psi::Psi, base_device::DEVICE_GPU>* psi_t = static_cast, base_device::DEVICE_GPU>*>(this->psi); - hamilt::Hamilt, base_device::DEVICE_GPU>* hamilt_t = static_cast, base_device::DEVICE_GPU>*>(this->p_hamilt); - hsolver::HSolver, base_device::DEVICE_GPU>* hsolver_t = static_cast, base_device::DEVICE_GPU>*>(this->phsol); - hsolver_t->solve(hamilt_t, psi_t[0], this->pelec, this->KS_SOLVER, true); - } - this->pelec->calculate_weights(); - this->cal_Mi_pw(); - } - else*/ - { - this->zero_Mi(); - int size_becp = 0; - std::vector> becp_tmp; - int nk = 0; - int nkb = 0; - int nbands = 0; - int npol = 0; - const int* nh_iat = nullptr; - if (PARAM.inp.device == "cpu") - { - psi::Psi>* psi_t = static_cast>*>(this->psi); - hamilt::Hamilt, base_device::DEVICE_CPU>* hamilt_t = static_cast, base_device::DEVICE_CPU>*>(this->p_hamilt); - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - nbands = psi_t->get_nbands(); - npol = psi_t->get_npol(); - nkb = onsite_p->get_tot_nproj(); - nk = psi_t->get_nk(); - nh_iat = &onsite_p->get_nh(0); - size_becp = nbands * nkb * npol; - becp_tmp.resize(size_becp * nk); - std::vector> h_tmp(nbands * nbands), s_tmp(nbands * nbands); - int initial_hs = 0; - if(this->sub_h_save == nullptr) - { - initial_hs = 1; - this->sub_h_save = new std::complex[nbands * nbands * nk]; - this->sub_s_save = new std::complex[nbands * nbands * nk]; - this->becp_save = new std::complex[size_becp * nk]; - } - for (int ik = 0; ik < nk; ++ik) - { - - psi_t->fix_k(ik); - - std::complex* h_k = this->sub_h_save + ik * nbands * nbands; - std::complex* s_k = this->sub_s_save + ik * nbands * nbands; - std::complex* becp_k = this->becp_save + ik * size_becp; - if(initial_hs) - { - /// update H(k) for each k point - hamilt_t->updateHk(ik); - hsolver::DiagoIterAssist>::cal_hs_subspace(hamilt_t, psi_t[0], h_k, s_k); - memcpy(becp_k, onsite_p->get_becp(), sizeof(std::complex) * size_becp); - } - memcpy(h_tmp.data(), h_k, sizeof(std::complex) * nbands * nbands); - memcpy(s_tmp.data(), s_k, sizeof(std::complex) * nbands * nbands); - // update h_tmp by delta_lambda - if (i_step != -1) this->calculate_delta_hcc(h_tmp.data(), becp_k, delta_lambda, nbands, nkb, nh_iat); - - hsolver::DiagoIterAssist>::diag_responce(h_tmp.data(), - s_tmp.data(), - nbands, - becp_k, - &becp_tmp[ik * size_becp], - nkb * 2, - &this->pelec->ekb(ik, 0)); - } - } -#if ((defined __CUDA) || (defined __ROCM)) - else - { - base_device::DEVICE_GPU* ctx = {}; - base_device::DEVICE_CPU* cpu_ctx = {}; - psi::Psi, base_device::DEVICE_GPU>* psi_t = static_cast, base_device::DEVICE_GPU>*>(this->psi); - hamilt::Hamilt, base_device::DEVICE_GPU>* hamilt_t = static_cast, base_device::DEVICE_GPU>*>(this->p_hamilt); - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - nbands = psi_t->get_nbands(); - npol = psi_t->get_npol(); - nkb = onsite_p->get_tot_nproj(); - nk = psi_t->get_nk(); - nh_iat = &onsite_p->get_nh(0); - size_becp = nbands * nkb * npol; - becp_tmp.resize(size_becp * nk); - std::complex* h_tmp = nullptr; - std::complex* s_tmp = nullptr; - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(h_tmp, nbands * nbands); - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(s_tmp, nbands * nbands); - int initial_hs = 0; - if(this->sub_h_save == nullptr) - { - initial_hs = 1; - - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(this->sub_h_save, nbands * nbands * nk); - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(this->sub_s_save, nbands * nbands * nk); - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(this->becp_save, size_becp * nk); - } - std::complex* becp_pointer = nullptr; - // allocate memory for becp_pointer in GPU device - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(becp_pointer, size_becp); - for (int ik = 0; ik < nk; ++ik) - { - psi_t->fix_k(ik); - - std::complex* h_k = this->sub_h_save + ik * nbands * nbands; - std::complex* s_k = this->sub_s_save + ik * nbands * nbands; - std::complex* becp_k = this->becp_save + ik * size_becp; - if(initial_hs) - { - /// update H(k) for each k point - hamilt_t->updateHk(ik); - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::cal_hs_subspace(hamilt_t, psi_t[0], h_k, s_k); - base_device::memory::synchronize_memory_op, base_device::DEVICE_GPU, base_device::DEVICE_GPU>()(becp_k, onsite_p->get_becp(), size_becp); - } - base_device::memory::synchronize_memory_op, base_device::DEVICE_GPU, base_device::DEVICE_GPU>()(h_tmp, h_k, nbands * nbands); - base_device::memory::synchronize_memory_op, base_device::DEVICE_GPU, base_device::DEVICE_GPU>()(s_tmp, s_k, nbands * nbands); - // update h_tmp by delta_lambda - if (i_step != -1) this->calculate_delta_hcc(h_tmp, becp_k, delta_lambda, nbands, nkb, nh_iat); - - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::diag_responce(h_tmp, - s_tmp, - nbands, - becp_k, - becp_pointer, - nkb * npol, - &this->pelec->ekb(ik, 0)); - // copy becp_pointer from GPU to CPU - base_device::memory::synchronize_memory_op, base_device::DEVICE_CPU, base_device::DEVICE_GPU>()(&becp_tmp[ik * size_becp], becp_pointer, size_becp); - } - - // free memory for becp_pointer in GPU device - base_device::memory::delete_memory_op, base_device::DEVICE_GPU>()(becp_pointer); - } -#endif - // calculate weights from ekb to update wg - elecstate::calculate_weights(this->pelec->ekb, - this->pelec->wg, - this->pelec->klist, - this->pelec->eferm, - this->pelec->f_en, - this->pelec->nelec_spin, - this->pelec->skip_weights); - // calculate Mi from existed becp - for (int ik = 0; ik < nk; ik++) - { - const std::complex* becp = &becp_tmp[ik * size_becp]; - // becp(nbands*npol , nkb) - // mag = wg * \sum_{nh}becp * becp - for (int ib = 0; ib < nbands; ib++) - { - const double weight = this->pelec->wg(ik, ib); - int begin_ih = 0; - for (int iat = 0; iat < this->Mi_.size(); iat++) - { - const int nh = nh_iat[iat]; - std::complex occ[4] - = {ModuleBase::ZERO, ModuleBase::ZERO, ModuleBase::ZERO, ModuleBase::ZERO}; - for (int ih = 0; ih < nh; ih++) - { - const int index = ib * npol * nkb + begin_ih + ih; - occ[0] += conj(becp[index]) * becp[index]; - occ[1] += conj(becp[index]) * becp[index + nkb]; - occ[2] += conj(becp[index + nkb]) * becp[index]; - occ[3] += conj(becp[index + nkb]) * becp[index + nkb]; - } - // occ has been reduced and calculate mag - this->Mi_[iat].x += weight * (occ[1] + occ[2]).real(); - this->Mi_[iat].y += weight * (occ[1] - occ[2]).imag(); - this->Mi_[iat].z += weight * (occ[0] - occ[3]).real(); - begin_ih += nh; - } - } - } - Parallel_Reduce::reduce_double_allpool(GlobalV::KPAR, - GlobalV::NPROC_IN_POOL, - &(this->Mi_[0][0]), - 3 * this->Mi_.size()); - // for(int i = 0; i < this->Mi_.size(); i++) - //{ - // std::cout<<"atom"<Mi_[i].x<<" "<Mi_[i].y<<" "<Mi_[i].z<<" - // "<lambda_[i].x<<" "<lambda_[i].y<<" "<lambda_[i].z< -void spinconstrain::SpinConstrain>::update_psi_charge(const ModuleBase::Vector3* delta_lambda, bool pw_solve) -{ - ModuleBase::TITLE("spinconstrain::SpinConstrain", "update_psi_charge"); - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "update_psi_charge"); -#ifdef __LCAO - if (PARAM.inp.basis_type == "lcao") - { - psi::Psi>* psi_t = static_cast>*>(this->psi); - this->pelec->psiToRho(*psi_t); - } - else -#endif - { - int size_becp = 0; - std::vector> becp_tmp; - int nk = 0; - int nkb = 0; - int nbands = 0; - int npol = 0; - const int* nh_iat = nullptr; - if (PARAM.inp.device == "cpu") - { - psi::Psi>* psi_t = static_cast>*>(this->psi); - hamilt::Hamilt, base_device::DEVICE_CPU>* hamilt_t = static_cast, base_device::DEVICE_CPU>*>(this->p_hamilt); - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - nbands = psi_t->get_nbands(); - npol = psi_t->get_npol(); - nkb = onsite_p->get_tot_nproj(); - nk = psi_t->get_nk(); - nh_iat = &onsite_p->get_nh(0); - size_becp = nbands * nkb * npol; - becp_tmp.resize(size_becp * nk); - std::vector> h_tmp(nbands * nbands), s_tmp(nbands * nbands); - assert(this->sub_h_save != nullptr); - assert(this->sub_s_save != nullptr); - assert(this->becp_save != nullptr); - for (int ik = 0; ik < nk; ++ik) - { - std::complex* h_k = this->sub_h_save + ik * nbands * nbands; - std::complex* s_k = this->sub_s_save + ik * nbands * nbands; - std::complex* becp_k = this->becp_save + ik * size_becp; - - psi_t->fix_k(ik); - memcpy(h_tmp.data(), h_k, sizeof(std::complex) * nbands * nbands); - memcpy(s_tmp.data(), s_k, sizeof(std::complex) * nbands * nbands); - this->calculate_delta_hcc(h_tmp.data(), becp_k, delta_lambda, nbands, nkb, nh_iat); - hsolver::DiagoIterAssist>::diag_subspace_psi(h_tmp.data(), - s_tmp.data(), - nbands, - psi_t[0], - &this->pelec->ekb(ik, 0)); - } - - delete[] this->sub_h_save; - delete[] this->sub_s_save; - delete[] this->becp_save; - this->sub_h_save = nullptr; - this->sub_s_save = nullptr; - this->becp_save = nullptr; - - if(pw_solve) - { - hsolver::HSolverPW, base_device::DEVICE_CPU> hsolver_pw_obj(this->pw_wfc_, - PARAM.inp.calculation, - PARAM.inp.basis_type, - PARAM.inp.ks_solver, - false, - PARAM.globalv.use_uspp, - PARAM.inp.nspin, - hsolver::DiagoIterAssist, base_device::DEVICE_CPU>::SCF_ITER, - hsolver::DiagoIterAssist, base_device::DEVICE_CPU>::PW_DIAG_NMAX, - hsolver::DiagoIterAssist, base_device::DEVICE_CPU>::PW_DIAG_THR, - hsolver::DiagoIterAssist, base_device::DEVICE_CPU>::need_subspace); - - hsolver_pw_obj.solve(hamilt_t, - psi_t[0], - this->pelec, - this->pelec->ekb.c, - GlobalV::RANK_IN_POOL, - GlobalV::NPROC_IN_POOL, - false, - this->tpiba, - this->get_nat()); - } - else - {// update charge density only - this->pelec->psiToRho(*psi_t); - } - } -#if ((defined __CUDA) || (defined __ROCM)) - else - { - base_device::DEVICE_GPU* ctx = {}; - base_device::DEVICE_CPU* cpu_ctx = {}; - psi::Psi, base_device::DEVICE_GPU>* psi_t = static_cast, base_device::DEVICE_GPU>*>(this->psi); - hamilt::Hamilt, base_device::DEVICE_GPU>* hamilt_t = static_cast, base_device::DEVICE_GPU>*>(this->p_hamilt); - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - nbands = psi_t->get_nbands(); - npol = psi_t->get_npol(); - nkb = onsite_p->get_tot_nproj(); - nk = psi_t->get_nk(); - nh_iat = &onsite_p->get_nh(0); - size_becp = nbands * nkb * npol; - - std::complex* h_tmp = nullptr; - std::complex* s_tmp = nullptr; - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(h_tmp, nbands * nbands); - base_device::memory::resize_memory_op, base_device::DEVICE_GPU>()(s_tmp, nbands * nbands); - assert(this->sub_h_save != nullptr); - assert(this->sub_s_save != nullptr); - assert(this->becp_save != nullptr); - for (int ik = 0; ik < nk; ++ik) - { - std::complex* h_k = this->sub_h_save + ik * nbands * nbands; - std::complex* s_k = this->sub_s_save + ik * nbands * nbands; - std::complex* becp_k = this->becp_save + ik * size_becp; - - psi_t->fix_k(ik); - base_device::memory::synchronize_memory_op, base_device::DEVICE_GPU, base_device::DEVICE_GPU>()(h_tmp, h_k, nbands * nbands); - base_device::memory::synchronize_memory_op, base_device::DEVICE_GPU, base_device::DEVICE_GPU>()(s_tmp, s_k, nbands * nbands); - this->calculate_delta_hcc(h_tmp, becp_k, delta_lambda, nbands, nkb, nh_iat); - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::diag_subspace_psi(h_tmp, - s_tmp, - nbands, - psi_t[0], - &this->pelec->ekb(ik, 0)); - } - - base_device::memory::delete_memory_op, base_device::DEVICE_GPU>()(sub_h_save); - base_device::memory::delete_memory_op, base_device::DEVICE_GPU>()(sub_s_save); - base_device::memory::delete_memory_op, base_device::DEVICE_GPU>()(becp_save); - this->sub_h_save = nullptr; - this->sub_s_save = nullptr; - this->becp_save = nullptr; - - if(pw_solve) - { - hsolver::HSolverPW, base_device::DEVICE_GPU> hsolver_pw_obj(this->pw_wfc_, - PARAM.inp.calculation, - PARAM.inp.basis_type, - PARAM.inp.ks_solver, - false, - PARAM.globalv.use_uspp, - PARAM.inp.nspin, - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::SCF_ITER, - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::PW_DIAG_NMAX, - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::PW_DIAG_THR, - hsolver::DiagoIterAssist, base_device::DEVICE_GPU>::need_subspace); - - hsolver_pw_obj.solve(hamilt_t, - psi_t[0], - this->pelec, - this->pelec->ekb.c, - GlobalV::RANK_IN_POOL, - GlobalV::NPROC_IN_POOL, - false, - this->tpiba, - this->get_nat()); - } - else - {// update charge density only - reinterpret_cast, base_device::DEVICE_GPU>*>(this->pelec)->psiToRho(*psi_t); - } - - } -#endif - } - ModuleBase::timer::tick("spinconstrain::SpinConstrain", "update_psi_charge"); -} diff --git a/source/module_hamilt_lcao/module_deltaspin/init_sc.cpp b/source/module_hamilt_lcao/module_deltaspin/init_sc.cpp deleted file mode 100644 index fbba82a839..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/init_sc.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "spin_constrain.h" - -// init sc -template -void spinconstrain::SpinConstrain::init_sc(double sc_thr_in, - int nsc_in, - int nsc_min_in, - double alpha_trial_in, - double sccut_in, - double sc_drop_thr_in, - const UnitCell& ucell, - Parallel_Orbitals* ParaV_in, - int nspin_in, - K_Vectors& kv_in, - void* p_hamilt_in, - void* psi_in, - elecstate::ElecState* pelec_in, - ModulePW::PW_Basis_K* pw_wfc_in) -{ - this->set_input_parameters(sc_thr_in, nsc_in, nsc_min_in, alpha_trial_in, sccut_in, sc_drop_thr_in); - this->set_atomCounts(ucell.get_atom_Counts()); - this->set_orbitalCounts(ucell.get_orbital_Counts()); - this->set_lnchiCounts(ucell.get_lnchi_Counts()); - this->set_nspin(nspin_in); - this->set_target_mag(ucell.get_target_mag()); - this->lambda_ = ucell.get_lambda(); - this->constrain_ = ucell.get_constrain(); - this->atomLabels_ = ucell.get_atomLabels(); - this->tpiba = ucell.tpiba; - this->pw_wfc_ = pw_wfc_in; - this->set_decay_grad(); - if(ParaV_in != nullptr) this->set_ParaV(ParaV_in); - this->set_solver_parameters(kv_in, p_hamilt_in, psi_in, pelec_in); -} - -template class spinconstrain::SpinConstrain>; -template class spinconstrain::SpinConstrain; \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/lambda_loop.cpp b/source/module_hamilt_lcao/module_deltaspin/lambda_loop.cpp deleted file mode 100644 index cad7b64c7c..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/lambda_loop.cpp +++ /dev/null @@ -1,278 +0,0 @@ -#include "spin_constrain.h" - -#include -#include -#include - -#include "basic_funcs.h" -#include "module_parameter/parameter.h" - -// lambda = initial_lambda + delta_lambda/(spin2 - spin1) * (target_spin - spin1) -/*inline void next_lambda(std::vector>& initial_lambda, - std::vector>& delta_lambda, - std::vector>& lambda, - std::vector>& spin1, - std::vector>& spin2, - std::vector>& target_spin) -{ - for (int ia = 0; ia < lambda.size(); ia++) - { - for (int ic = 0; ic < 3; ic++) - { - lambda[ia][ic] = initial_lambda[ia][ic] + delta_lambda[ia][ic] / (spin2[ia][ic] - spin1[ia][ic]) * (target_spin[ia][ic] - spin1[ia][ic]); - } - } -} - -template <> -void spinconstrain::SpinConstrain>::run_lambda_loop(int outer_step) -{ - // init parameters - int nat = this->get_nat(); - std::vector> initial_lambda(nat, 0.0); - std::vector> delta_lambda(nat, 0.0); - std::vector> spin1(nat, 0.0); - std::vector> spin2(nat, 0.0); - std::vector> delta_spin(nat, 0.0); - // current lambda is this->lambda_ - // current spin is this->Mi_ - // target spin is this->target_mag_ - // loop to optimize lambda to get target spin - int step = -1; - do - { - // set initial lambda - where_fill_scalar_else_2d(this->constrain_, 0, 0.0, this->lambda_, initial_lambda); - // save current spin to spin1 if step > 0 - if (step > 0) - { - spin1 = this->Mi_; - } - // calculate current spin - this->cal_mw_from_lambda(step); - // save current spin to spin2 - spin2 = this->Mi_; - // calculate delta_spin = target_spin - spin - subtract_2d(this->target_mag_, spin2, delta_spin); - // check RMS error and stop if needed - // calculate RMS error - double sum = 0.0; - for (int ia = 0; ia < nat; ia++) - { - for (int ic = 0; ic < 3; ic++) - { - sum += std::pow(delta_spin[ia][ic],2); - } - } - double rms_error = std::sqrt(sum/nat); - std::cout << "RMS error = " << rms_error <<" in step:" <lambda_[ia][ic] = initial_lambda[ia][ic] + delta_lambda[ia][ic]; - std::cout<<__LINE__<<"lambda["<lambda_[ia][ic]<lambda_, spin1, spin2, this->target_mag_); - // calculate delta_lambda = this->lambda - initial_lambda - subtract_2d(this->lambda_, initial_lambda, delta_lambda); - } - step++; - } while (step < this->nsc_); - -}*/ - - -template <> -void spinconstrain::SpinConstrain>::run_lambda_loop(int outer_step, bool rerun) -{ - // init controlling parameters - int nat = this->get_nat(); - int ntype = this->get_ntype(); - std::vector> initial_lambda(nat,0.0); - std::vector> delta_lambda(nat,0.0); - // set nu, dnu and dnu_last_step - std::vector> dnu(nat, 0.0), dnu_last_step(nat, 0.0); - // two controlling temp variables - std::vector> temp_1(nat, 0.0); - std::vector> spin(nat, 0.0), delta_spin(nat, 0.0); - std::vector> search(nat, 0.0), search_old(nat, 0.0); - std::vector> new_spin(nat, 0.0), spin_plus(nat, 0.0); - - double alpha_opt, alpha_plus; - double beta; - double mean_error, mean_error_old, rms_error; - double g; - - double alpha_trial = this->alpha_trial_; - - const double zero = 0.0; - const double one = 1.0; - -#ifdef __MPI - auto iterstart = MPI_Wtime(); -#else - auto iterstart = std::chrono::system_clock::now(); -#endif - - double inner_loop_duration = 0.0; - - this->print_header(); - // lambda loop - for (int i_step = -1; i_step < this->nsc_; i_step++) - { - double duration = 0.0; - if (i_step == -1) - { - this->cal_mw_from_lambda(i_step); - spin = this->Mi_; - where_fill_scalar_else_2d(this->constrain_, 0, zero, this->lambda_, initial_lambda); - print_2d("initial lambda (eV/uB): ", initial_lambda, this->nspin_, ModuleBase::Ry_to_eV); - print_2d("initial spin (uB): ", spin, this->nspin_); - print_2d("target spin (uB): ", this->target_mag_, this->nspin_); - i_step++; - } - else - { - where_fill_scalar_else_2d(this->constrain_, 0, zero, delta_lambda, delta_lambda); - add_scalar_multiply_2d(initial_lambda, delta_lambda, one, this->lambda_); - this->cal_mw_from_lambda(i_step, delta_lambda.data()); - new_spin = this->Mi_; - bool GradLessThanBound = this->check_gradient_decay(new_spin, spin, delta_lambda, dnu_last_step); - if (i_step >= this->nsc_min_ && GradLessThanBound) - { - add_scalar_multiply_2d(initial_lambda, dnu_last_step, one, this->lambda_); - this->update_psi_charge(dnu_last_step.data()); -#ifdef __MPI - duration = (double)(MPI_Wtime() - iterstart); -#else - duration = - (std::chrono::duration_cast(std::chrono::system_clock::now() - - iterstart)).count() / static_cast(1e6); -#endif - inner_loop_duration += duration; - std::cout << "Total TIME(s) = " << inner_loop_duration << std::endl; - this->print_termination(); - break; - } - spin = new_spin; - } - // continue the lambda loop - subtract_2d(spin, this->target_mag_, delta_spin); - where_fill_scalar_2d(this->constrain_, 0, zero, delta_spin); - search = delta_spin; - for (int ia = 0; ia < nat; ia++) - { - for (int ic = 0; ic < 3; ic++) - { - temp_1[ia][ic] = std::pow(delta_spin[ia][ic],2); - } - } - mean_error = sum_2d(temp_1) / nat; - rms_error = std::sqrt(mean_error); - if(i_step == 0) - { - // set current_sc_thr_ to max(rms_error * sc_drop_thr, this->sc_thr_) - this->current_sc_thr_ = std::max(rms_error * this->sc_drop_thr_, this->sc_thr_); - } -#ifdef __MPI - duration = (double)(MPI_Wtime() - iterstart); -#else - duration = - (std::chrono::duration_cast(std::chrono::system_clock::now() - - iterstart)).count() / static_cast(1e6); -#endif - inner_loop_duration += duration; - if (this->check_rms_stop(outer_step, i_step, rms_error, duration, inner_loop_duration)) - { - //add_scalar_multiply_2d(initial_lambda, dnu_last_step, 1.0, this->lambda_); - this->update_psi_charge(dnu_last_step.data(), rerun); - if(PARAM.inp.basis_type == "pw") - { - //double check Atomic spin moment - this->cal_mi_pw(); - subtract_2d(this->Mi_, this->target_mag_, delta_spin); - where_fill_scalar_2d(this->constrain_, 0, zero, delta_spin); - search = delta_spin; - for (int ia = 0; ia < nat; ia++) - { - for (int ic = 0; ic < 3; ic++) - { - temp_1[ia][ic] = std::pow(delta_spin[ia][ic],2); - } - } - mean_error = sum_2d(temp_1) / nat; - rms_error = std::sqrt(mean_error); - std::cout<<"Current RMS: "< this->current_sc_thr_ * 10 && rerun == true && this->higher_mag_prec == true) - { - std::cout<<"Error: RMS error is too large, rerun the loop"<run_lambda_loop(outer_step, false); - } - } - break; - } -#ifdef __MPI - iterstart = MPI_Wtime(); -#else - iterstart = std::chrono::system_clock::now(); -#endif - if (i_step >= 2) - { - beta = mean_error / mean_error_old; - add_scalar_multiply_2d(search, search_old, beta, search); - } - /// check if restriction is needed - this->check_restriction(search, alpha_trial); - - dnu_last_step = dnu; - add_scalar_multiply_2d(dnu, search, alpha_trial, dnu); - delta_lambda = dnu; - - where_fill_scalar_else_2d(this->constrain_, 0, zero, delta_lambda, delta_lambda); - add_scalar_multiply_2d(initial_lambda, delta_lambda, one, this->lambda_); - this->cal_mw_from_lambda(i_step, delta_lambda.data()); - - spin_plus = this->Mi_; - - alpha_opt = this->cal_alpha_opt(spin, spin_plus, alpha_trial); - /// check if restriction is needed - this->check_restriction(search, alpha_opt); - - alpha_plus = alpha_opt - alpha_trial; - scalar_multiply_2d(search, alpha_plus, temp_1); - add_scalar_multiply_2d(dnu, temp_1, one, dnu); - delta_lambda = dnu; - - search_old = search; - mean_error_old = mean_error; - - g = 1.5 * std::abs(alpha_opt) / alpha_trial; - if (g > 2.0) - { - g = 2; - } - else if (g < 0.5) - { - g = 0.5; - } - alpha_trial = alpha_trial * pow(g, 0.7); - } - - return; -} diff --git a/source/module_hamilt_lcao/module_deltaspin/lambda_loop_helper.cpp b/source/module_hamilt_lcao/module_deltaspin/lambda_loop_helper.cpp deleted file mode 100644 index 6ad4db05ad..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/lambda_loop_helper.cpp +++ /dev/null @@ -1,183 +0,0 @@ -#include "basic_funcs.h" -#include "spin_constrain.h" - -template <> -void spinconstrain::SpinConstrain>::print_termination() -{ - print_2d("after-optimization spin (uB): (print in the inner loop): ", this->Mi_, this->nspin_); - print_2d("after-optimization lambda (eV/uB): (print in the inner loop): ", this->lambda_, this->nspin_, ModuleBase::Ry_to_eV); - std::cout << "Inner optimization for lambda ends." << std::endl; - std::cout << "===============================================================================" << std::endl; -} - -template <> -bool spinconstrain::SpinConstrain>::check_rms_stop(int outer_step, - int i_step, - double rms_error, - double duration, - double total_duration) -{ - std::cout << "Step (Outer -- Inner) = " << outer_step << " -- " << std::left << std::setw(5) << i_step + 1 - << " RMS = " << rms_error << " TIME(s) = " << std::setw(11) << duration << std::endl; - if (rms_error < this->current_sc_thr_ || i_step == this->nsc_ - 1) - { - if (rms_error < this->current_sc_thr_) - { - std::cout << "Meet convergence criterion ( < " << this->current_sc_thr_ << " ), exit."; - std::cout << " Total TIME(s) = " << total_duration << std::endl; - } - else if (i_step == this->nsc_ - 1) - { - std::cout << "Reach maximum number of steps ( " << this->nsc_ << " ), exit."; - std::cout << " Total TIME(s) = " << total_duration << std::endl; - } - this->print_termination(); - return true; - } - return false; -} - -/// print header -template <> -void spinconstrain::SpinConstrain>::print_header() -{ - std::cout << "===============================================================================" << std::endl; - std::cout << "Inner optimization for lambda begins ..." << std::endl; - std::cout << "Covergence criterion for the iteration: " << this->sc_thr_ << std::endl; -} - -/// check restriction -template <> -void spinconstrain::SpinConstrain>::check_restriction( - const std::vector>& search, - double& alpha_trial) -{ - double boundary = std::abs(alpha_trial * maxval_abs_2d(search)); - - if (this->restrict_current_ > 0 && boundary > this->restrict_current_) - { - alpha_trial = copysign(1.0, alpha_trial) * this->restrict_current_ / maxval_abs_2d(search); - boundary = std::abs(alpha_trial * maxval_abs_2d(search)); - std::cout << "alpha after restrict = " << alpha_trial * ModuleBase::Ry_to_eV << std::endl; - std::cout << "boundary after = " << boundary * ModuleBase::Ry_to_eV << std::endl; - } -} - -/// calculate alpha_opt -template <> -double spinconstrain::SpinConstrain>::cal_alpha_opt( - std::vector> spin, - std::vector> spin_plus, - const double alpha_trial) -{ - int nat = this->get_nat(); - const double zero = 0.0; - std::vector> spin_mask(nat, 0.0); - std::vector> target_spin_mask(nat, 0.0); - std::vector> spin_plus_mask(nat, 0.0); - std::vector> temp_1(nat, 0.0); - std::vector> temp_2(nat, 0.0); - where_fill_scalar_else_2d(this->constrain_, 0, zero, this->target_mag_, target_spin_mask); - where_fill_scalar_else_2d(this->constrain_, 0, zero, spin, spin_mask); - where_fill_scalar_else_2d(this->constrain_, 0, zero, spin_plus, spin_plus_mask); - - for (int ia = 0; ia < nat; ia++) - { - for (int ic = 0; ic < 3; ic++) - { - temp_1[ia][ic] - = (target_spin_mask[ia][ic] - spin_mask[ia][ic]) * (spin_plus_mask[ia][ic] - spin_mask[ia][ic]); - temp_2[ia][ic] = std::pow(spin_mask[ia][ic] - spin_plus_mask[ia][ic], 2); - } - } - double sum_k = sum_2d(temp_1); - double sum_k2 = sum_2d(temp_2); - return sum_k * alpha_trial / sum_k2; -} - -/// check gradient decay -template <> -bool spinconstrain::SpinConstrain>::check_gradient_decay( - std::vector> new_spin, - std::vector> spin, - std::vector> delta_lambda, - std::vector> dnu_last_step, - bool print) -{ - const double one = 1.0; - const double zero = 0.0; - int nat = this->get_nat(); - int ntype = this->get_ntype(); - std::vector> spin_change(nat, 0.0); - std::vector> nu_change(nat, 1.0); - std::vector>>> spin_nu_gradient( - nat, - std::vector>>( - 3, - std::vector>(nat, std::vector(3, 0.0)))); - std::vector> spin_nu_gradient_diag(nat, 0.0); - std::vector> max_gradient_index(ntype, std::make_pair(0, 0)); - std::vector max_gradient(ntype, 0.0); - subtract_2d(new_spin, spin, spin_change); - subtract_2d(delta_lambda, dnu_last_step, nu_change); - where_fill_scalar_2d(this->constrain_, 0, zero, spin_change); - where_fill_scalar_2d(this->constrain_, 0, one, nu_change); - // calculate spin_nu_gradient - for (int ia = 0; ia < nat; ia++) - { - for (int ic = 0; ic < 3; ic++) - { - for (int ja = 0; ja < nat; ja++) - { - for (int jc = 0; jc < 3; jc++) - { - spin_nu_gradient[ia][ic][ja][jc] = spin_change[ia][ic] / nu_change[ja][jc]; - } - } - } - } - for (const auto& sc_elem: this->get_atomCounts()) - { - int it = sc_elem.first; - int nat_it = sc_elem.second; - max_gradient[it] = 0.0; - for (int ia = 0; ia < nat_it; ia++) - { - for (int ic = 0; ic < 3; ic++) - { - spin_nu_gradient_diag[ia][ic] = spin_nu_gradient[ia][ic][ia][ic]; - if (std::abs(spin_nu_gradient_diag[ia][ic]) > std::abs(max_gradient[it])) - { - max_gradient[it] = spin_nu_gradient_diag[ia][ic]; - max_gradient_index[it].first = ia; - max_gradient_index[it].second = ic; - } - } - } - } - if (print) - { - print_2d("diagonal gradient: ", spin_nu_gradient_diag, this->nspin_); - std::cout << "maximum gradient appears at: " << std::endl; - for (int it = 0; it < ntype; it++) - { - std::cout << "( " << max_gradient_index[it].first << ", " << max_gradient_index[it].second << " )" - << std::endl; - } - std::cout << "maximum gradient: " << std::endl; - for (int it = 0; it < ntype; it++) - { - std::cout << max_gradient[it]/ModuleBase::Ry_to_eV << std::endl; - } - } - for (int it = 0; it < ntype; it++) - { - if (this->decay_grad_[it] > 0 && std::abs(max_gradient[it]) < this->decay_grad_[it]) - { - std::cout << "Reach limitation of current step ( maximum gradient < " << this->decay_grad_[it]/ModuleBase::Ry_to_eV // uB^2/Ry to uB^2/eV - << " in atom type " << it << " ), exit." << std::endl; - return true; - } - } - return false; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/spin_constrain.cpp b/source/module_hamilt_lcao/module_deltaspin/spin_constrain.cpp deleted file mode 100644 index fb21e1ab7c..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/spin_constrain.cpp +++ /dev/null @@ -1,606 +0,0 @@ -#include "spin_constrain.h" - -#include "source_base/formatter.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h" - -#include - -namespace spinconstrain -{ - -template -SpinConstrain& SpinConstrain::getScInstance() -{ - static SpinConstrain instance; // Guaranteed to be created and destroyed only once - return instance; -} - -template -double SpinConstrain::cal_escon() -{ - this->escon_ = 0.0; - if (!this->is_Mi_converged) - { - return this->escon_; - } - int nat = this->get_nat(); - for (int iat = 0; iat < nat; iat++) - { - this->escon_ -= this->lambda_[iat].x * this->Mi_[iat].x; - this->escon_ -= this->lambda_[iat].y * this->Mi_[iat].y; - this->escon_ -= this->lambda_[iat].z * this->Mi_[iat].z; - } - return this->escon_; -} - -template -double SpinConstrain::get_escon() -{ - return this->escon_; -} - -// set atomCounts -template -void SpinConstrain::set_atomCounts(const std::map& atomCounts_in) -{ - this->atomCounts.clear(); - this->atomCounts = atomCounts_in; -} - -// get atomCounts -template -const std::map& SpinConstrain::get_atomCounts() const -{ - return this->atomCounts; -} - -/// set nspin -template -void SpinConstrain::set_nspin(int nspin_in) -{ - if (nspin_in != 4 && nspin_in != 2) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_nspin", "nspin must be 2 or 4"); - } - this->nspin_ = nspin_in; -} - -/// get nspin -template -int SpinConstrain::get_nspin() -{ - return this->nspin_; -} - -template -int SpinConstrain::get_nat() -{ - int nat = 0; - for (std::map::iterator it = this->atomCounts.begin(); it != this->atomCounts.end(); ++it) - { - nat += it->second; - } - return nat; -} - -template -int SpinConstrain::get_ntype() -{ - return this->atomCounts.size(); -} - -template -void SpinConstrain::check_atomCounts() -{ - if (!this->atomCounts.size()) - { - ModuleBase::WARNING_QUIT("SpinConstrain::check_atomCounts", "atomCounts is not set"); - } - if (this->get_nat() <= 0) - { - ModuleBase::WARNING_QUIT("SpinConstrain::check_atomCounts", "nat <= 0"); - } - for (std::map::iterator it = this->atomCounts.begin(); it != this->atomCounts.end(); ++it) - { - int itype = it->first; - if (itype < 0 || itype >= this->get_ntype()) - { - ModuleBase::WARNING_QUIT("SpinConstrain::check_atomCounts", "itype out of range [0, ntype)"); - } - int inat = it->second; - if (inat <= 0) - { - ModuleBase::WARNING_QUIT("SpinConstrain::check_atomCounts", "number of atoms <= 0 for some element"); - } - } -} - -// get iat -template -int SpinConstrain::get_iat(int itype, int atom_index) -{ - if (itype < 0 || itype >= this->get_ntype()) - { - ModuleBase::WARNING_QUIT("SpinConstrain::get_iat", "itype out of range [0, ntype)"); - } - if (atom_index < 0 || atom_index >= this->atomCounts[itype]) - { - ModuleBase::WARNING_QUIT("SpinConstrain::get_iat", "atom index out of range [0, nat)"); - } - int iat = 0; - for (std::map::iterator it = this->atomCounts.begin(); it != this->atomCounts.end(); ++it) - { - if (it->first == itype) - { - break; - } - iat += it->second; - } - iat += atom_index; - return iat; -} - -// set orbitalCounts -template -void SpinConstrain::set_orbitalCounts(const std::map& orbitalCounts_in) -{ - this->orbitalCounts.clear(); - this->orbitalCounts = orbitalCounts_in; -} - -// get orbitalCounts -template -const std::map& SpinConstrain::get_orbitalCounts() const -{ - return this->orbitalCounts; -} - -// set lnchiCounts -template -void SpinConstrain::set_lnchiCounts(const std::map>& lnchiCounts_in) -{ - this->lnchiCounts.clear(); - this->lnchiCounts = lnchiCounts_in; -} - -// get lnchiCounts -template -const std::map>& SpinConstrain::get_lnchiCounts() const -{ - return this->lnchiCounts; -} - -// set sc_lambda from ScData -template -void SpinConstrain::set_sc_lambda() -{ - this->check_atomCounts(); - int nat = this->get_nat(); - this->lambda_.resize(nat); - for (auto& itype_data: this->ScData) - { - int itype = itype_data.first; - for (auto& element_data: itype_data.second) - { - int index = element_data.index; - int iat = this->get_iat(itype, index); - ModuleBase::Vector3 lambda; - lambda.x = element_data.lambda[0]; - lambda.y = element_data.lambda[1]; - lambda.z = element_data.lambda[2]; - this->lambda_[iat] = lambda; - } - } -} - -// set target_mag from ScData -template -void SpinConstrain::set_target_mag() -{ - this->check_atomCounts(); - int nat = this->get_nat(); - this->target_mag_.resize(nat, 0.0); - for (auto& itype_data: this->ScData) - { - int itype = itype_data.first; - for (auto& element_data: itype_data.second) - { - int index = element_data.index; - int iat = this->get_iat(itype, index); - ModuleBase::Vector3 mag(0.0, 0.0, 0.0); - if (element_data.mag_type == 0) - { - mag.x = element_data.target_mag[0]; - mag.y = element_data.target_mag[1]; - mag.z = element_data.target_mag[2]; - } - else if (element_data.mag_type == 1) - { - double radian_angle1 = element_data.target_mag_angle1 * M_PI / 180.0; - double radian_angle2 = element_data.target_mag_angle2 * M_PI / 180.0; - mag.x = element_data.target_mag_val * std::sin(radian_angle1) * std::cos(radian_angle2); - mag.y = element_data.target_mag_val * std::sin(radian_angle1) * std::sin(radian_angle2); - mag.z = element_data.target_mag_val * std::cos(radian_angle1); - if (std::abs(mag.x) < 1e-14) - mag.x = 0.0; - if (std::abs(mag.y) < 1e-14) - mag.y = 0.0; - if (std::abs(mag.z) < 1e-14) - mag.z = 0.0; - } - this->target_mag_[iat] = mag; - } - } -} - -// set constrain from ScData -template -void SpinConstrain::set_constrain() -{ - this->check_atomCounts(); - int nat = this->get_nat(); - this->constrain_.resize(nat); - // constrain is 0 by default, which means no constrain - // and the corresponding mag moments should be determined - // by the physical nature of the system - for (int iat = 0; iat < nat; iat++) - { - this->constrain_[iat].x = 0; - this->constrain_[iat].y = 0; - this->constrain_[iat].z = 0; - } - for (auto& itype_data: this->ScData) - { - int itype = itype_data.first; - for (auto& element_data: itype_data.second) - { - int index = element_data.index; - int iat = this->get_iat(itype, index); - ModuleBase::Vector3 constr; - constr.x = element_data.constrain[0]; - constr.y = element_data.constrain[1]; - constr.z = element_data.constrain[2]; - this->constrain_[iat] = constr; - } - } -} - -// set sc_lambda from variable -template -void SpinConstrain::set_sc_lambda(const ModuleBase::Vector3* lambda_in, int nat_in) -{ - this->check_atomCounts(); - int nat = this->get_nat(); - if (nat_in != nat) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_sc_lambda", "lambda_in size mismatch with nat"); - } - this->lambda_.resize(nat); - for (int iat = 0; iat < nat; ++iat) - { - this->lambda_[iat] = lambda_in[iat]; - } -} - -// set target_mag from variable -template -void SpinConstrain::set_target_mag(const ModuleBase::Vector3* target_mag_in, int nat_in) -{ - this->check_atomCounts(); - int nat = this->get_nat(); - if (nat_in != nat) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_target_mag", "target_mag_in size mismatch with nat"); - } - this->target_mag_.resize(nat); - for (int iat = 0; iat < nat; ++iat) - { - this->target_mag_[iat] = target_mag_in[iat]; - } -} - -template -void SpinConstrain::set_target_mag(const std::vector>& target_mag_in) -{ - int nat = this->get_nat(); - assert(target_mag_in.size() == nat); - if (this->nspin_ == 2) - { - this->target_mag_.resize(nat, 0.0); - for (int iat = 0; iat < nat; iat++) - { - this->target_mag_[iat].z - = target_mag_in[iat].x; /// this is wired because the UnitCell class set in x direction - } - } - else if (this->nspin_ == 4) - { - this->target_mag_ = target_mag_in; - } - else - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_target_mag", "nspin must be 2 or 4"); - } -} - -/// set constrain from variable -template -void SpinConstrain::set_constrain(const ModuleBase::Vector3* constrain_in, int nat_in) -{ - this->check_atomCounts(); - int nat = this->get_nat(); - if (nat_in != nat) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_constrain", "constrain_in size mismatch with nat"); - } - this->constrain_.resize(nat); - for (int iat = 0; iat < nat; ++iat) - { - this->constrain_[iat] = constrain_in[iat]; - } -} - -template -const std::vector>& SpinConstrain::get_sc_lambda() const -{ - return this->lambda_; -} - -template -const std::vector>& SpinConstrain::get_target_mag() const -{ - return this->target_mag_; -} - -/// get_constrain -template -const std::vector>& SpinConstrain::get_constrain() const -{ - return this->constrain_; -} - -/// zero atomic magnetic moment -template -void SpinConstrain::zero_Mi() -{ - this->check_atomCounts(); - int nat = this->get_nat(); - this->Mi_.resize(nat); - for (int iat = 0; iat < nat; ++iat) - { - this->Mi_[iat].x = 0.0; - this->Mi_[iat].y = 0.0; - this->Mi_[iat].z = 0.0; - } -} - -/// get grad_decay -/// this function can only be called by the root process because only -/// root process reads the ScDecayGrad from json file -template -double SpinConstrain::get_decay_grad(int itype) -{ - return this->ScDecayGrad[itype]; -} - -/// set grad_decy -template -void SpinConstrain::set_decay_grad() -{ - this->check_atomCounts(); - int ntype = this->get_ntype(); - this->decay_grad_.resize(ntype); - for (int itype = 0; itype < ntype; ++itype) - { - this->decay_grad_[itype] = 0.0; - } -} - -/// get decay_grad -template -const std::vector& SpinConstrain::get_decay_grad() -{ - return this->decay_grad_; -} - -/// set grad_decy from variable -template -void SpinConstrain::set_decay_grad(const double* decay_grad_in, int ntype_in) -{ - this->check_atomCounts(); - int ntype = this->get_ntype(); - if (ntype_in != ntype) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_decay_grad", "decay_grad_in size mismatch with ntype"); - } - this->decay_grad_.resize(ntype); - for (int itype = 0; itype < ntype; ++itype) - { - this->decay_grad_[itype] = decay_grad_in[itype]; - } -} - -/// @brief set input parameters -template -void SpinConstrain::set_input_parameters(double sc_thr_in, - int nsc_in, - int nsc_min_in, - double alpha_trial_in, - double sccut_in, - double sc_drop_thr_in) -{ - this->sc_thr_ = sc_thr_in; - this->nsc_ = nsc_in; - this->nsc_min_ = nsc_min_in; - this->alpha_trial_ = alpha_trial_in / ModuleBase::Ry_to_eV; - this->restrict_current_ = sccut_in / ModuleBase::Ry_to_eV; - this->sc_drop_thr_ = sc_drop_thr_in; -} - -/// get sc_thr -template -double SpinConstrain::get_sc_thr() -{ - return this->sc_thr_; -} - -/// get nsc -template -int SpinConstrain::get_nsc() -{ - return this->nsc_; -} - -/// get nsc_min -template -int SpinConstrain::get_nsc_min() -{ - return this->nsc_min_; -} - -/// get alpha_trial -template -double SpinConstrain::get_alpha_trial() -{ - return this->alpha_trial_; -} - -/// get sccut -template -double SpinConstrain::get_sccut() -{ - return this->restrict_current_; -} - -/// set sc_drop_thr -template -void SpinConstrain::set_sc_drop_thr(double sc_drop_thr_in) -{ - this->sc_drop_thr_ = sc_drop_thr_in; -} - -/// get sc_drop_thr -template -double SpinConstrain::get_sc_drop_thr() -{ - return this->sc_drop_thr_; -} - -template -void SpinConstrain::set_solver_parameters(K_Vectors& kv_in, - void* p_hamilt_in, - void* psi_in, - elecstate::ElecState* pelec_in) -{ - this->kv_ = kv_in; - this->p_hamilt = p_hamilt_in; - this->psi = psi_in; - this->pelec = pelec_in; -} - -/// @brief set ParaV -template -void SpinConstrain::set_ParaV(Parallel_Orbitals* ParaV_in) -{ - this->ParaV = ParaV_in; - int nloc = this->ParaV->nloc; - if (nloc <= 0) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_ParaV", "nloc <= 0"); - } -} - -/// print Mi -template -void SpinConstrain::print_Mi(std::ofstream& ofs_running) -{ - this->check_atomCounts(); - int nat = this->get_nat(); - std::vector mag_x(nat, 0.0); - std::vector mag_y(nat, 0.0); - std::vector mag_z(nat, 0.0); - if (this->nspin_ == 2) - { - const std::vector title = {"Total Magnetism (uB)", ""}; - const std::vector fmts = {"%-26s", "%20.10f"}; - FmtTable table(/*titles=*/title, - /*nrows=*/nat, - /*formats=*/fmts, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::LEFT}); - for (int iat = 0; iat < nat; ++iat) - { - mag_z[iat] = Mi_[iat].z; - } - table << this->atomLabels_ << mag_z; - ofs_running << table.str() << std::endl; - } - else if (this->nspin_ == 4) - { - const std::vector title = {"Total Magnetism (uB)", "", "", ""}; - const std::vector fmts = {"%-26s", "%20.10f", "%20.10f", "%20.10f"}; - FmtTable table(/*titles=*/title, - /*nrows=*/nat, - /*formats=*/fmts, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::LEFT}); - for (int iat = 0; iat < nat; ++iat) - { - mag_x[iat] = Mi_[iat].x; - mag_y[iat] = Mi_[iat].y; - mag_z[iat] = Mi_[iat].z; - } - table << this->atomLabels_ << mag_x << mag_y << mag_z; - ofs_running << table.str() << std::endl; - } -} - -/// print magnetic force (defined as \frac{\delta{L}}/{\delta{Mi}} = -lambda[iat]) -template -void SpinConstrain::print_Mag_Force(std::ofstream& ofs_running) -{ - this->check_atomCounts(); - int nat = this->get_nat(); - std::vector mag_force_x(nat, 0.0); - std::vector mag_force_y(nat, 0.0); - std::vector mag_force_z(nat, 0.0); - if (this->nspin_ == 2) - { - const std::vector title = {"Magnetic force (eV/uB)", ""}; - const std::vector fmts = {"%-26s", "%20.10f"}; - FmtTable table(/*titles=*/title, - /*nrows=*/nat, - /*formats=*/fmts, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::LEFT}); - for (int iat = 0; iat < nat; ++iat) - { - mag_force_z[iat] = lambda_[iat].z * ModuleBase::Ry_to_eV; - } - table << this->atomLabels_ << mag_force_z; - ofs_running << table.str() << std::endl; - } - else if (this->nspin_ == 4) - { - const std::vector title = {"Magnetic force (eV/uB)", "", "", ""}; - const std::vector fmts = {"%-26s", "%20.10f", "%20.10f", "%20.10f"}; - FmtTable table(/*titles=*/title, - /*nrows=*/nat, - /*formats=*/fmts, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::LEFT}); - for (int iat = 0; iat < nat; ++iat) - { - mag_force_x[iat] = lambda_[iat].x * ModuleBase::Ry_to_eV; - mag_force_y[iat] = lambda_[iat].y * ModuleBase::Ry_to_eV; - mag_force_z[iat] = lambda_[iat].z * ModuleBase::Ry_to_eV; - } - table << this->atomLabels_ << mag_force_x << mag_force_y << mag_force_z; - ofs_running << table.str() << std::endl; - } -} - -template class SpinConstrain>; -template class SpinConstrain; - -} // namespace spinconstrain \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/spin_constrain.h b/source/module_hamilt_lcao/module_deltaspin/spin_constrain.h deleted file mode 100644 index 8f510db57c..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/spin_constrain.h +++ /dev/null @@ -1,276 +0,0 @@ -#ifndef SPIN_CONSTRAIN_H -#define SPIN_CONSTRAIN_H - -#include -#include - -#include "source_base/constants.h" -#include "source_base/tool_quit.h" -#include "source_base/tool_title.h" -#include "source_base/vector3.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/klist.h" -#include "source_cell/unitcell.h" -#include "source_hamilt/operator.h" -#include "source_estate/elecstate.h" - -namespace spinconstrain -{ - -struct ScAtomData; - -template -class SpinConstrain -{ -public: - /** - * pubic interface for spin-constrained DFT - */ - /// initialize spin-constrained DFT - void init_sc(double sc_thr_in, - int nsc_in, - int nsc_min_in, - double alpha_trial_in, - double sccut_in, - double sc_drop_thr_in, - const UnitCell& ucell, - Parallel_Orbitals* ParaV_in, - int nspin_in, - K_Vectors& kv_in, - void* p_hamilt_in, - void* psi_in, - elecstate::ElecState* pelec_in, - ModulePW::PW_Basis_K* pw_wfc_in = nullptr); - - /// @brief calculate the magnetization of each atom with real space projection method for LCAO base - /// @param step : the step number of the SCF calculation - /// @param print : print the magnetization of each atom if true - void cal_mi_lcao(const int& step, bool print = false); - - void cal_mi_pw(); - - void cal_mw_from_lambda(int i_step, const ModuleBase::Vector3* delta_lambda = nullptr); - - /** - * @brief calculate the energy of \sum_i \lambda_i * Mi - * if this->is_mag_converged is true, then this function will calculate the energy and return the real value - * if this->is_mag_converged is false, then this function will return 0.0 - */ - double cal_escon(); - - double get_escon(); - - void run_lambda_loop(int outer_step, bool rerun = true); - - /// @brief update the charge density for LCAO base with new lambda - /// update the charge density and psi for PW base with new lambda - void update_psi_charge(const ModuleBase::Vector3* delta_lambda, bool pw_solve = true); - - void calculate_delta_hcc(std::complex* h_tmp, const std::complex* becp_k, const ModuleBase::Vector3* delta_lambda, const int nbands, const int nkb, const int* nh_iat); - - /// lambda loop helper functions - bool check_rms_stop(int outer_step, int i_step, double rms_error, double duration, double total_duration); - - /// apply restriction - void check_restriction(const std::vector>& search, double& alpha_trial); - - /// check gradient decay - bool check_gradient_decay(std::vector> new_spin, - std::vector> old_spin, - std::vector> new_delta_lambda, - std::vector> old_delta_lambda, - bool print = false); - /// @brief calculate alpha_opt - double cal_alpha_opt(std::vector> spin, - std::vector> spin_plus, - const double alpha_trial); - /// print header info - void print_header(); - /// print termination message - void print_termination(); - - /// print mi - void print_Mi(std::ofstream& ofs_running); - - /// print magnetic force, defined as \frac{\delta{L}}/{\delta{Mi}} = -lambda[iat]) - void print_Mag_Force(std::ofstream& ofs_running); - - /// @brief use rerun to get higher precision in lambda_loop for PW base - bool higher_mag_prec = false; - -public: - /** - * important outter class pointers used in spin-constrained DFT - */ - Parallel_Orbitals *ParaV = nullptr; - //-------------------------------------------------------------------------------- - // pointers for solve Hamiltonian to get new Magnetization from Lambda - void* p_hamilt = nullptr; - void* psi = nullptr; - elecstate::ElecState* pelec = nullptr; - ModulePW::PW_Basis_K* pw_wfc_ = nullptr; - double tpiba = 0.0; /// save ucell.tpiba - const double meV_to_Ry = 7.349864435130999e-05; - K_Vectors kv_; - //-------------------------------------------------------------------------------- - - public: - /** - * pubic methods for setting and getting spin-constrained DFT parameters - */ - /// Public method to access the Singleton instance - static SpinConstrain& getScInstance(); - /// Delete copy and move constructors and assign operators - SpinConstrain(SpinConstrain const&) = delete; - SpinConstrain(SpinConstrain&&) = delete; - /// set element index to atom index map - void set_atomCounts(const std::map& atomCounts_in); - /// get element index to atom index map - const std::map& get_atomCounts() const; - /// set element index to orbital index map - void set_orbitalCounts(const std::map& orbitalCounts_in); - /// get element index to orbital index map - const std::map& get_orbitalCounts() const; - /// set lnchiCounts - void set_lnchiCounts(const std::map>& lnchiCounts_in); - /// get lnchiCounts - const std::map>& get_lnchiCounts() const; - /// set sc_lambda - void set_sc_lambda(); - /// set sc_lambda from variable - void set_sc_lambda(const ModuleBase::Vector3* lambda_in, int nat_in); - /// set target_mag - void set_target_mag(); - /// set target_mag from variable - void set_target_mag(const ModuleBase::Vector3* target_mag_in, int nat_in); - /// set target magnetic moment - void set_target_mag(const std::vector>& target_mag_in); - /// set constrain - void set_constrain(); - /// set constrain from variable - void set_constrain(const ModuleBase::Vector3* constrain_in, int nat_in); - /// get sc_lambda - const std::vector>& get_sc_lambda() const; - /// get target_mag - const std::vector>& get_target_mag() const; - /// get constrain - const std::vector>& get_constrain() const; - /// get nat - int get_nat(); - /// get ntype - int get_ntype(); - /// check atomCounts - void check_atomCounts(); - /// get iat - int get_iat(int itype, int atom_index); - /// set nspin - void set_nspin(int nspin); - /// get nspin - int get_nspin(); - /// zero atomic magnetic moment - void zero_Mi(); - /// get decay_grad - double get_decay_grad(int itype); - /// set decay_grad - void set_decay_grad(); - /// get decay_grad - const std::vector& get_decay_grad(); - /// set decay_grad from variable - void set_decay_grad(const double* decay_grad_in, int ntype_in); - /// set decay grad switch - void set_sc_drop_thr(double sc_drop_thr_in); - /// set input parameters - void set_input_parameters(double sc_thr_in, - int nsc_in, - int nsc_min_in, - double alpha_trial_in, - double sccut_in, - double sc_drop_thr_in); - /// get sc_thr - double get_sc_thr(); - /// get nsc - int get_nsc(); - /// get nsc_min - int get_nsc_min(); - /// get alpha_trial - double get_alpha_trial(); - /// get sccut - double get_sccut(); - /// get sc_drop_thr - double get_sc_drop_thr(); - /// @brief set orbital parallel info - void set_ParaV(Parallel_Orbitals* ParaV_in); - /// @brief set parameters for solver - void set_solver_parameters(K_Vectors& kv_in, - void* p_hamilt_in, - void* psi_in, - elecstate::ElecState* pelec_in); - - private: - SpinConstrain(){}; // Private constructor - ~SpinConstrain(){}; // Destructor - SpinConstrain& operator=(SpinConstrain const&) = delete; // Copy assign - SpinConstrain& operator=(SpinConstrain &&) = delete; // Move assign - std::map> ScData; - std::map ScDecayGrad; // in unit of uB^2/eV - std::vector decay_grad_; // in unit of uB^2/Ry - std::map atomCounts; - std::map orbitalCounts; - std::map> lnchiCounts; - std::vector> lambda_; // in unit of Ry/uB in code, but in unit of meV/uB in input file - std::vector> target_mag_; // in unit of uB - std::vector> Mi_; // in unit of uB - std::vector atomLabels_; - double escon_ = 0.0; - int nspin_ = 0; - int npol_ = 1; - /** - * input parameters for lambda-loop - */ - int nsc_; - int nsc_min_; - double sc_drop_thr_ = 1e-3; - double sc_thr_; // in unit of uB - double current_sc_thr_; - std::vector> constrain_; - bool debug = false; - double alpha_trial_; // in unit of Ry/uB^2 = 0.01 eV/uB^2 - double restrict_current_; // in unit of Ry/uB = 3 eV/uB - - public: - /// @brief save operator for spin-constrained DFT - /// @param op_in the base pointer of operator, actual type should be DeltaSpin>* - void set_operator(hamilt::Operator* op_in); - /// @brief set is_Mi_converged - void set_mag_converged(bool is_Mi_converged_in){this->is_Mi_converged = is_Mi_converged_in;} - /// @brief get is_Mi_converged - bool mag_converged() const {return this->is_Mi_converged;} - private: - /// operator for spin-constrained DFT, used for calculating current atomic magnetic moment - hamilt::Operator* p_operator = nullptr; - /// @brief if atomic magnetic moment is converged - bool is_Mi_converged = false; - - FPTYPE* sub_h_save; - FPTYPE* sub_s_save; - FPTYPE* becp_save; -}; - - -/** - * @brief struct for storing parameters of non-collinear spin-constrained DFT - */ -struct ScAtomData { - int index; - std::vector lambda; - std::vector target_mag; - std::vector constrain; - int mag_type; - double target_mag_val; - double target_mag_angle1; - double target_mag_angle2; -}; - -} // namespace spinconstrain - -#endif // SPIN_CONSTRAIN_H diff --git a/source/module_hamilt_lcao/module_deltaspin/template_helpers.cpp b/source/module_hamilt_lcao/module_deltaspin/template_helpers.cpp deleted file mode 100644 index 437ecec662..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/template_helpers.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "spin_constrain.h" - -template <> -void spinconstrain::SpinConstrain::cal_mw_from_lambda(int i_step, const ModuleBase::Vector3* delta_lambda) -{ -} - -template <> -void spinconstrain::SpinConstrain::cal_mi_lcao(const int& step, bool print) -{ -} - -template <> -void spinconstrain::SpinConstrain::run_lambda_loop(int outer_step, bool rerun) -{ -} - -template <> -bool spinconstrain::SpinConstrain::check_rms_stop(int outer_step, - int i_step, - double rms_error, - double duration, - double total_duration) -{ - return false; -} - -template <> -void spinconstrain::SpinConstrain::check_restriction( - const std::vector>& search, - double& alpha_trial) -{ -} - -/// calculate alpha_opt -template <> -double spinconstrain::SpinConstrain::cal_alpha_opt(std::vector> spin, - std::vector> spin_plus, - const double alpha_trial) -{ - return 0.0; -} - -template <> -void spinconstrain::SpinConstrain::print_termination() -{ -} - -template <> -void spinconstrain::SpinConstrain::print_header() -{ -} - -template <> -bool spinconstrain::SpinConstrain::check_gradient_decay( - std::vector> new_spin, - std::vector> old_spin, - std::vector> new_delta_lambda, - std::vector> old_delta_lambda, - bool print) -{ - return false; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/test/CMakeLists.txt b/source/module_hamilt_lcao/module_deltaspin/test/CMakeLists.txt deleted file mode 100644 index 2483403d3a..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/test/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -if(ENABLE_LCAO) - -AddTest( - TARGET deltaspin_basic_func_test - LIBS ${math_libs} base device parameter - SOURCES basic_test.cpp - ../basic_funcs.cpp -) - -AddTest( - TARGET deltaspin_spin_constrain_test - LIBS ${math_libs} base device parameter - SOURCES spin_constrain_test.cpp - ../spin_constrain.cpp - ../../../source_basis/module_ao/parallel_orbitals.cpp -) - -AddTest( - TARGET deltaspin_template_helpers - LIBS ${math_libs} base device parameter - SOURCES template_helpers_test.cpp - ../spin_constrain.cpp - ../template_helpers.cpp -) -endif() diff --git a/source/module_hamilt_lcao/module_deltaspin/test/basic_test.cpp b/source/module_hamilt_lcao/module_deltaspin/test/basic_test.cpp deleted file mode 100644 index cf2e776e4e..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/test/basic_test.cpp +++ /dev/null @@ -1,194 +0,0 @@ -#include "../basic_funcs.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -/************************************************ - * unit test of basic_funcs - ***********************************************/ - -/** - * - Tested Functions: - * - maxval_abs_2d(): return the maximum absolute value of an array of Vector3 - * - maxloc_abs_2d(): return the location of the maximum absolute value of an array of Vector3 - * - sum_2d(): return the sum of an array of Vector3 - * - scalar_multiply_2d(): multiply an array of Vector3 by a scalar - * - add_scalar_multiply_2d(): add an array of Vector3 to another array of Vector3 multiplied by a scalar - * result[i] = array_1[i] + scalar * array_2[i]; - * - subtract_2d(): subtract an array of Vector3 from another array of Vector3 - * result[i] = array_1[i] - array_2[i]; - * - fill_scalar_2d(): fill an array of Vector3 with a scalar - * - where_fill_scalar_2d(): fill an array of Vector3 with a scalar if the corresponding element is equal to mask - * - where_fill_scalar_else_2d(): fill an array of Vector3 with a scalar if the corresponding element is equal to mask, other places are filled with another array of Vector3 "rest" - * - print_2d(): print an array of Vector3 - */ - -class BasicFuncsTest : public testing::Test -{ - protected: - std::vector> array; - void SetUp() - { - array.push_back(ModuleBase::Vector3(1.0, 2.0, 3.0)); - array.push_back(ModuleBase::Vector3(4.0, 5.0, 6.0)); - array.push_back(ModuleBase::Vector3(7.0, 8.0, 9.0)); - } - std::string output; -}; - -TEST_F(BasicFuncsTest, MaxvalAbs2d) -{ - EXPECT_DOUBLE_EQ(maxval_abs_2d(array), 9.0); -} - -TEST_F(BasicFuncsTest, MaxlocAbs2d) -{ - std::pair maxloc; - maxloc = maxloc_abs_2d(array); - EXPECT_EQ(maxloc.first, 2); - EXPECT_EQ(maxloc.second, 2); -} - -TEST_F(BasicFuncsTest, Sum2dDoubleArray) -{ - EXPECT_DOUBLE_EQ(sum_2d(array), 45.0); -} - -TEST_F(BasicFuncsTest, Sum2dIntArray) -{ - std::vector> arrayInt; - arrayInt.push_back(ModuleBase::Vector3(1, 2, 3)); - arrayInt.push_back(ModuleBase::Vector3(4, 5, 6)); - arrayInt.push_back(ModuleBase::Vector3(7, 8, 9)); - int sum = sum_2d(arrayInt); - double sum2 = sum_2d(arrayInt); - EXPECT_EQ(sum, 45); - EXPECT_DOUBLE_EQ(sum2, 45.0); -} - -TEST_F(BasicFuncsTest, ScalarMul2d) -{ - std::vector> result; - scalar_multiply_2d(array, 2.0, result); - EXPECT_DOUBLE_EQ(result[0][0], 2.0); - EXPECT_DOUBLE_EQ(result[0][1], 4.0); - EXPECT_DOUBLE_EQ(result[0][2], 6.0); - EXPECT_DOUBLE_EQ(result[1][0], 8.0); - EXPECT_DOUBLE_EQ(result[1][1], 10.0); - EXPECT_DOUBLE_EQ(result[1][2], 12.0); - EXPECT_DOUBLE_EQ(result[2][0], 14.0); - EXPECT_DOUBLE_EQ(result[2][1], 16.0); - EXPECT_DOUBLE_EQ(result[2][2], 18.0); -} - -TEST_F(BasicFuncsTest, AddScalarMul2d) -{ - std::vector> array_2, result; - array_2.push_back(ModuleBase::Vector3(1.0, 2.0, 3.0)); - array_2.push_back(ModuleBase::Vector3(4.0, 5.0, 6.0)); - array_2.push_back(ModuleBase::Vector3(7.0, 8.0, 9.0)); - add_scalar_multiply_2d(array, array_2, 2.0, result); - EXPECT_DOUBLE_EQ(result[0][0], 3.0); - EXPECT_DOUBLE_EQ(result[0][1], 6.0); - EXPECT_DOUBLE_EQ(result[0][2], 9.0); - EXPECT_DOUBLE_EQ(result[1][0], 12.0); - EXPECT_DOUBLE_EQ(result[1][1], 15.0); - EXPECT_DOUBLE_EQ(result[1][2], 18.0); - EXPECT_DOUBLE_EQ(result[2][0], 21.0); - EXPECT_DOUBLE_EQ(result[2][1], 24.0); - EXPECT_DOUBLE_EQ(result[2][2], 27.0); -} - -TEST_F(BasicFuncsTest, Subtract2d) -{ - std::vector> array_2, result; - array_2.push_back(ModuleBase::Vector3(1.0, 2.0, 3.0)); - array_2.push_back(ModuleBase::Vector3(4.0, 5.0, 6.0)); - array_2.push_back(ModuleBase::Vector3(7.0, 8.0, 9.0)); - subtract_2d(array, array_2, result); - EXPECT_DOUBLE_EQ(result[0][0], 0.0); - EXPECT_DOUBLE_EQ(result[0][1], 0.0); - EXPECT_DOUBLE_EQ(result[0][2], 0.0); - EXPECT_DOUBLE_EQ(result[1][0], 0.0); - EXPECT_DOUBLE_EQ(result[1][1], 0.0); - EXPECT_DOUBLE_EQ(result[1][2], 0.0); - EXPECT_DOUBLE_EQ(result[2][0], 0.0); - EXPECT_DOUBLE_EQ(result[2][1], 0.0); - EXPECT_DOUBLE_EQ(result[2][2], 0.0); -} - -TEST_F(BasicFuncsTest, FillScalar2d) -{ - std::vector> result; - result.resize(3); - fill_scalar_2d(2.0, result); - EXPECT_DOUBLE_EQ(result[0][0], 2.0); - EXPECT_DOUBLE_EQ(result[0][1], 2.0); - EXPECT_DOUBLE_EQ(result[0][2], 2.0); - EXPECT_DOUBLE_EQ(result[1][0], 2.0); - EXPECT_DOUBLE_EQ(result[1][1], 2.0); - EXPECT_DOUBLE_EQ(result[1][2], 2.0); - EXPECT_DOUBLE_EQ(result[2][0], 2.0); - EXPECT_DOUBLE_EQ(result[2][1], 2.0); - EXPECT_DOUBLE_EQ(result[2][2], 2.0); -} - -TEST_F(BasicFuncsTest, WhereFillScalar2d) -{ - std::vector> array_mask; - array_mask.push_back(ModuleBase::Vector3(1,0,1)); - array_mask.push_back(ModuleBase::Vector3(0,1,0)); - array_mask.push_back(ModuleBase::Vector3(1,0,1)); - std::vector> result; - where_fill_scalar_2d(array_mask, 1, 2.0, result); - EXPECT_DOUBLE_EQ(result[0][0], 2.0); - EXPECT_DOUBLE_EQ(result[0][1], 0.0); - EXPECT_DOUBLE_EQ(result[0][2], 2.0); - EXPECT_DOUBLE_EQ(result[1][0], 0.0); - EXPECT_DOUBLE_EQ(result[1][1], 2.0); - EXPECT_DOUBLE_EQ(result[1][2], 0.0); - EXPECT_DOUBLE_EQ(result[2][0], 2.0); - EXPECT_DOUBLE_EQ(result[2][1], 0.0); - EXPECT_DOUBLE_EQ(result[2][2], 2.0); -} - -TEST_F(BasicFuncsTest, WhereFillScalarElse2d) -{ - std::vector> array_mask; - array_mask.push_back(ModuleBase::Vector3(1,0,1)); - array_mask.push_back(ModuleBase::Vector3(0,1,0)); - array_mask.push_back(ModuleBase::Vector3(1,0,1)); - std::vector> result; - std::vector> rest; - rest.push_back(ModuleBase::Vector3(1.0, 2.0, 3.0)); - rest.push_back(ModuleBase::Vector3(4.0, 5.0, 6.0)); - rest.push_back(ModuleBase::Vector3(7.0, 8.0, 9.0)); - where_fill_scalar_else_2d(array_mask, 1, 2.0, rest, result); - EXPECT_DOUBLE_EQ(result[0][0], 2.0); - EXPECT_DOUBLE_EQ(result[0][1], 2.0); - EXPECT_DOUBLE_EQ(result[0][2], 2.0); - EXPECT_DOUBLE_EQ(result[1][0], 4.0); - EXPECT_DOUBLE_EQ(result[1][1], 2.0); - EXPECT_DOUBLE_EQ(result[1][2], 6.0); - EXPECT_DOUBLE_EQ(result[2][0], 2.0); - EXPECT_DOUBLE_EQ(result[2][1], 8.0); - EXPECT_DOUBLE_EQ(result[2][2], 2.0); -} - -TEST_F(BasicFuncsTest, Prin2d) -{ - std::string info = "initial spin"; - testing::internal::CaptureStdout(); - print_2d(info, array, 4); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("initial spin")); - EXPECT_THAT(output,testing::HasSubstr("ATOM 1 1.0000000000 2.0000000000 3.0000000000")); - EXPECT_THAT(output,testing::HasSubstr("ATOM 2 4.0000000000 5.0000000000 6.0000000000")); - EXPECT_THAT(output,testing::HasSubstr("ATOM 3 7.0000000000 8.0000000000 9.0000000000")); - testing::internal::CaptureStdout(); - print_2d(info, array, 2); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("initial spin")); - EXPECT_THAT(output,testing::HasSubstr("ATOM 1 3.0000000000")); - EXPECT_THAT(output,testing::HasSubstr("ATOM 2 6.0000000000")); - EXPECT_THAT(output,testing::HasSubstr("ATOM 3 9.0000000000")); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/test/lambda_loop_helper_test.cpp b/source/module_hamilt_lcao/module_deltaspin/test/lambda_loop_helper_test.cpp deleted file mode 100644 index 2acf2d34eb..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/test/lambda_loop_helper_test.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include "../spin_constrain.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#include "source_cell/klist.h" -/************************************************ - * unit test of the functions in lambda_loop_helper.cpp - ***********************************************/ - -/** - * Tested function: - * - spinconstrain::SpinConstrain::check_rms_stop - * - check if the rms error is small enough to stop the lambda loop - * - spinconstrain::SpinConstrain::print_termination - * - print termination message - */ - -class spinconstrain::SpinConstrainTest : public testing::Test -{ - protected: - spinconstrain::SpinConstrain, base_device::DEVICE_CPU>& sc - = spinconstrain::SpinConstrain, base_device::DEVICE_CPU>::getScInstance(); -}; - -TEST_F(spinconstrain::SpinConstrainTest, PrintTermination) -{ - std::map atomCounts = { - {0, 1} - }; - sc.set_nspin(4); - sc.set_atomCounts(atomCounts); - sc.zero_Mi(); - std::vector> sc_lambda = std::vector>(1, {1.0, 2.0, 3.0}); - sc.set_sc_lambda(sc_lambda.data(), 1); - testing::internal::CaptureStdout(); - sc.print_termination(); - //sc.print_Mag_Force(); - //std::string output = testing::internal::GetCapturedStdout(); - //EXPECT_THAT(output, testing::HasSubstr("Inner optimization for lambda ends.")); - //EXPECT_THAT(output, testing::HasSubstr("ATOM 1 0.0000000000 0.0000000000 0.0000000000")); - //EXPECT_THAT(output, testing::HasSubstr("ATOM 1 1.0000000000 2.0000000000 3.0000000000")); - //EXPECT_THAT(output, testing::HasSubstr("Final optimal lambda (Ry/uB):")); - //EXPECT_THAT(output, testing::HasSubstr("ATOM 1 1.0000000000 2.0000000000 3.0000000000")); - //EXPECT_THAT(output, testing::HasSubstr("Magnetic force (Ry/uB):")); - //EXPECT_THAT(output, testing::HasSubstr("ATOM 0 -1.0000000000 -2.0000000000 -3.0000000000")); -} - -TEST_F(spinconstrain::SpinConstrainTest, CheckRmsStop) -{ - double sc_thr = 1e-6; - int nsc = 100; - int nsc_min = 2; - double alpha_trial = 0.01; - double sccut = 3.0; - double sc_drop_thr = 1e-3; - double duration = 10; - double total_duration = 10; - this->sc.set_input_parameters(sc_thr, nsc, nsc_min, alpha_trial, sccut, sc_drop_thr); - testing::internal::CaptureStdout(); - EXPECT_FALSE(sc.check_rms_stop(0, 0, 1e-5, duration, total_duration)); - EXPECT_FALSE(sc.check_rms_stop(0, 11, 1e-5, duration, total_duration)); - EXPECT_TRUE(sc.check_rms_stop(0, 12, 1e-7, duration, total_duration)); - EXPECT_TRUE(sc.check_rms_stop(0, 99, 1e-5, duration, total_duration)); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("Step (Outer -- Inner) = 0 -- 1 RMS = 1e-05")); - EXPECT_THAT(output, testing::HasSubstr("Step (Outer -- Inner) = 0 -- 12 RMS = 1e-05")); - EXPECT_THAT(output, testing::HasSubstr("Step (Outer -- Inner) = 0 -- 13 RMS = 1e-07")); - EXPECT_THAT(output, testing::HasSubstr("Meet convergence criterion ( < 1e-06 ), exit.")); - EXPECT_THAT(output, testing::HasSubstr("Reach maximum number of steps ( 100 ), exit.")); -} - -TEST_F(spinconstrain::SpinConstrainTest, PrintHeader) -{ - testing::internal::CaptureStdout(); - sc.print_header(); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("Inner optimization for lambda begins ...")); - EXPECT_THAT(output, testing::HasSubstr("Covergence criterion for the iteration: 1e-06")); -} - -TEST_F(spinconstrain::SpinConstrainTest, CheckRestriction) -{ - std::vector> search = { - {0.0, 0.0, 40} - }; - double alpha_trial = 0.1 / 13.605698; - testing::internal::CaptureStdout(); - sc.check_restriction(search, alpha_trial); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("alpha after restrict = 0.075")); - EXPECT_THAT(output, testing::HasSubstr("boundary after = 3")); -} - -TEST_F(spinconstrain::SpinConstrainTest, CalAlphaOpt) -{ - std::vector> constrain = { - {1, 1, 1} - }; - std::vector> target_mag = { - {0.0, 0.0, 2.0} - }; - // Set up test input data - std::vector> spin = { - {0.0, 0.0, 0.1} - }; - - std::vector> spin_plus = { - {0.0, 0.0, 0.2} - }; - - sc.set_constrain(constrain.data(), 1); - sc.set_target_mag(target_mag.data(), 1); - - double alpha_trial = 0.5; - - // Set up expected output data - double expected_alpha_opt = 9.5; - - // Call the function being tested - double actual_alpha_opt = sc.cal_alpha_opt(spin, spin_plus, alpha_trial); - - // Compare the expected and actual output - EXPECT_NEAR(expected_alpha_opt, actual_alpha_opt, 1e-14); -} - -TEST_F(spinconstrain::SpinConstrainTest, CheckGradientDecay) -{ - // Set up some data for testing - std::vector> new_spin = { - {0.0, 0.0, 0.1} - }; - - std::vector> new_spin1 = { - {0.0, 0.0, 10.0} - }; - - std::vector> spin = { - {0.0, 0.0, 0.2} - }; - - std::vector> delta_lambda = { - {0.0, 0.0, 1.0} - }; - - std::vector> dnu_last_step = { - {0.0, 0.0, 2.0}, - }; - - std::vector> constrain = { - {0, 0, 1} - }; - - std::vector decay_grad = {0.9}; - sc.set_constrain(constrain.data(), 1); - sc.set_decay_grad(decay_grad.data(), 1); - - // Call the function to test - EXPECT_TRUE(sc.check_gradient_decay(new_spin, spin, delta_lambda, dnu_last_step, false)); - testing::internal::CaptureStdout(); - EXPECT_FALSE(sc.check_gradient_decay(new_spin1, spin, delta_lambda, dnu_last_step, true)); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("maximum gradient appears at:")); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_deltaspin/test/prepare_unitcell.h b/source/module_hamilt_lcao/module_deltaspin/test/prepare_unitcell.h deleted file mode 100644 index 0b280cd2ac..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/test/prepare_unitcell.h +++ /dev/null @@ -1,284 +0,0 @@ -#ifndef PREPARE_UNITCELL_H -#define PREPARE_UNITCELL_H -#include -#include -#include "source_base/mathzone.h" - -class UcellTestPrepare -{ -public: - UcellTestPrepare()=default; - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in); - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in); - UcellTestPrepare(const UcellTestPrepare &utp); - - std::string latname; - int lmaxmax; - bool init_vel; - bool selective_dynamics; - bool relax_new; - std::string fixed_axes; - double lat0; - std::valarray latvec; - std::vector elements; - std::vector pp_files; - std::vector pp_types; - std::vector orb_files; - std::valarray natom; - std::vector atomic_mass; - std::string coor_type; - std::valarray coordinates; - std::valarray mbl; - std::valarray velocity; - // ntype - int ntype; - int atomic_index; - - UnitCell* SetUcellInfo() - { - //basic info - this->ntype = this->elements.size(); - static UnitCell ucell; - ucell.setup(this->latname, this->ntype, this->lmaxmax, this->init_vel, this->fixed_axes); - delete[] ucell.orbital_fn; - delete[] ucell.magnet.start_magnetization; // mag set here - ucell->atom_label.resize(ucell->ntype); - ucell->atom_mass.resize(ucell->ntype); - ucell->pseudo_fn.resize(ucell->ntype); - ucell->pseudo_type.resize(ucell->ntype); - - ucell.orbital_fn.resize(ucell.ntype); - ucell.magnet.start_magnetization = new double[ucell.ntype]; // mag set here - ucell.magnet.ux_[0] = 0.0; // ux_ set here - ucell.magnet.ux_[1] = 0.0; - ucell.magnet.ux_[2] = 0.0; - for (int it = 0; it < ucell.ntype; ++it) - { - ucell.atom_label[it] = this->elements[it]; - ucell.atom_mass[it] = this->atomic_mass[it]; - ucell.pseudo_fn[it] = this->pp_files[it]; - ucell.pseudo_type[it] = this->pp_types[it]; - ucell.orbital_fn[it] = this->orb_files[it]; - ucell.magnet.start_magnetization[it] = 0.0; // mag set here - } - // lattice info - ucell.lat0 = this->lat0; - ucell.lat0_angstrom = ucell.lat0 * 0.529177; - ucell.tpiba = ModuleBase::TWO_PI / ucell.lat0; - ucell.tpiba2 = ucell.tpiba * ucell.tpiba; - ucell.latvec.e11 = this->latvec[0]; - ucell.latvec.e12 = this->latvec[1]; - ucell.latvec.e13 = this->latvec[2]; - ucell.latvec.e21 = this->latvec[3]; - ucell.latvec.e22 = this->latvec[4]; - ucell.latvec.e23 = this->latvec[5]; - ucell.latvec.e31 = this->latvec[6]; - ucell.latvec.e32 = this->latvec[7]; - ucell.latvec.e33 = this->latvec[8]; - ucell.a1.x = ucell.latvec.e11; - ucell.a1.y = ucell.latvec.e12; - ucell.a1.z = ucell.latvec.e13; - ucell.a2.x = ucell.latvec.e21; - ucell.a2.y = ucell.latvec.e22; - ucell.a2.z = ucell.latvec.e23; - ucell.a3.x = ucell.latvec.e31; - ucell.a3.y = ucell.latvec.e32; - ucell.a3.z = ucell.latvec.e33; - ucell.GT = ucell.latvec.Inverse(); - ucell.G = ucell.GT.Transpose(); - ucell.GGT = ucell.G * ucell.GT; - ucell.invGGT = ucell.GGT.Inverse(); - ucell.omega = std::abs(ucell.latvec.Det()) * (ucell.lat0) * (ucell.lat0) * (ucell.lat0); - // atomic info - ucell.Coordinate = this->coor_type; - ucell.atoms = new Atom[ucell.ntype]; - ucell.set_atom_flag = true; - this->atomic_index = 0; - for (int it = 0; it < ucell.ntype; ++it) - { - ucell.atoms[it].label = this->elements[it]; - ucell.atoms[it].nw = 0; - ucell.atoms[it].nwl = 2; - delete[] ucell.atoms[it].l_nchi; - ucell.atoms[it].l_nchi = new int[ ucell.atoms[it].nwl+1]; - for(int L=0; Lnatom[it]; - // coordinates and related physical quantities - delete[] ucell.atoms[it].tau; - delete[] ucell.atoms[it].dis; - delete[] ucell.atoms[it].taud; - delete[] ucell.atoms[it].vel; - delete[] ucell.atoms[it].mag; - delete[] ucell.atoms[it].angle1; - delete[] ucell.atoms[it].angle2; - delete[] ucell.atoms[it].m_loc_; - delete[] ucell.atoms[it].mbl; - ucell.atoms[it].tau = new ModuleBase::Vector3[ucell.atoms[it].na]; - ucell.atoms[it].dis = new ModuleBase::Vector3[ucell.atoms[it].na]; - ucell.atoms[it].taud = new ModuleBase::Vector3[ucell.atoms[it].na]; - ucell.atoms[it].vel = new ModuleBase::Vector3[ucell.atoms[it].na]; - ucell.atoms[it].mag = new double[ucell.atoms[it].na]; - ucell.atoms[it].angle1 = new double[ucell.atoms[it].na]; - ucell.atoms[it].angle2 = new double[ucell.atoms[it].na]; - ucell.atoms[it].m_loc_ = new ModuleBase::Vector3[ucell.atoms[it].na]; - ucell.atoms[it].mbl = new ModuleBase::Vector3[ucell.atoms[it].na]; - ucell.atoms[it].mass = ucell.atom_mass[it]; // mass set here - for (int ia = 0; ia < ucell.atoms[it].na; ++ia) - { - if (ucell.Coordinate == "Cartesian") - { - ucell.atoms[it].tau[ia].x = this->coordinates[this->atomic_index * 3 + 0]; - ucell.atoms[it].tau[ia].y = this->coordinates[this->atomic_index * 3 + 1]; - ucell.atoms[it].tau[ia].z = this->coordinates[this->atomic_index * 3 + 2]; - ModuleBase::Mathzone::Cartesian_to_Direct(ucell.atoms[it].tau[ia].x, - ucell.atoms[it].tau[ia].y, - ucell.atoms[it].tau[ia].z, - ucell.latvec.e11, - ucell.latvec.e12, - ucell.latvec.e13, - ucell.latvec.e21, - ucell.latvec.e22, - ucell.latvec.e23, - ucell.latvec.e31, - ucell.latvec.e32, - ucell.latvec.e33, - ucell.atoms[it].taud[ia].x, - ucell.atoms[it].taud[ia].y, - ucell.atoms[it].taud[ia].z); - } - ucell.atoms[it].dis[ia].set(0, 0, 0); - ucell.atoms[it].vel[ia].set(0, 0, 0); - ucell.atoms[it].m_loc_[ia].set(0, 0, 0); - ucell.atoms[it].angle1[ia] = 0; - ucell.atoms[it].angle2[ia] = 0; - ucell.atoms[it].mbl[ia] = {1, 1, 1}; - ++(this->atomic_index); - } - } - ucell.nat = this->natom.sum(); - return &ucell; - } -}; - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in) -{ - mbl = {0}; - velocity = {0}; -} - -UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): - latname(utp.latname), - lmaxmax(utp.lmaxmax), - init_vel(utp.init_vel), - selective_dynamics(utp.selective_dynamics), - relax_new(utp.relax_new), - fixed_axes(utp.fixed_axes), - lat0(utp.lat0), - latvec(utp.latvec), - elements(utp.elements), - pp_files(utp.pp_files), - pp_types(utp.pp_types), - orb_files(utp.orb_files), - natom(utp.natom), - atomic_mass(utp.atomic_mass), - coor_type(utp.coor_type), - coordinates(utp.coordinates), - mbl(utp.mbl), - velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() -{} - -std::map UcellTestLib -{ - {"SiO", UcellTestPrepare( - "fcc", //latname - 2, //lmaxmax - false, //init_vel - false, //selective_dyanmics - false, //relax_new - "volume", //fixed_axes - 10.2, //lat0 - {-0.5,0.0,0.5, //latvec - 0.0,0.5,0.5, - -0.5,0.5,0.0}, - {"O","Si"}, //elements - {"O.upf","Si.upf"}, //upf file - {"upf201","upf201"}, //upf types - {"O.orb","Si.orb"}, //orb file - {1,5}, //number of each elements - {16.0,28.0}, //atomic mass - "Cartesian", //coordination type - {0.0,0.0,0.0, //atomic coordinates - 0.1,0.0,0.0, //atomic coordinates - 0.2,0.0,0.0, //atomic coordinates - 0.3,0.0,0.0, //atomic coordinates - 0.4,0.0,0.0, //atomic coordinates - 0.25,0.25,0.25})} -}; -#endif diff --git a/source/module_hamilt_lcao/module_deltaspin/test/spin_constrain_test.cpp b/source/module_hamilt_lcao/module_deltaspin/test/spin_constrain_test.cpp deleted file mode 100644 index b58437ea8d..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/test/spin_constrain_test.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include "../spin_constrain.h" - -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -/************************************************ - * unit test of functions in class SpinConstrain - ***********************************************/ - -/** - * - Tested functions: - * - spinconstrain::SpinConstrain::getScInstance() - * get the instance of spinconstrain::SpinConstrain - * - spinconstrain::SpinConstrain::set_atomCounts() - * set the map from element index to atom number - * - spinconstrain::SpinConstrain::get_atomCounts() - * get the map from element index to atom number - * - spinconstrain::SpinConstrain::get_nat() - * get the total number of atoms - * - spinconstrain::SpinConstrain::get_iat() - * get the atom index from (itype, atom_index) - * - spinconstrain::SpinConstrain::set_orbitalCounts() - * set the map from element index to orbital number - * - spinconstrain::SpinConstrain::get_orbitalCounts() - * get the map from element index to orbital number - * - spinconstrain::SpinConstrain::get_nw() - * get the total number of orbitals - * - spinconstrain::SpinConstrain::set_npol() - * set the number of npol, which is the number of spin components - * - spinconstrain::SpinConstrain::get_npol() - * get the number of npol, which is the number of spin components - * - spinconstrain::SpinConstrain::get_iwt() - * get the index of orbital with spin component from (itype, iat, orbital_index) - */ -#include "source_cell/klist.h" - -template -class SpinConstrainTest : public testing::Test -{ - protected: - spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); -}; - -using MyTypes = ::testing::Types>; -TYPED_TEST_SUITE(SpinConstrainTest, MyTypes); - -TYPED_TEST(SpinConstrainTest, CheckAtomCounts) -{ - // Warning 1: atomCounts is not set - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.check_atomCounts(), ::testing::ExitedWithCode(1), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("atomCounts is not set")); - // Warning 2: nat < 0 - std::map atomCounts = { - {0, -1}, - {1, 0 } - }; - this->sc.set_atomCounts(atomCounts); - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.check_atomCounts(), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("nat <= 0")); - // Warning 3: itype out of range - std::map atomCounts1 = { - {1, 1}, - {2, 2} - }; - this->sc.set_atomCounts(atomCounts1); - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.check_atomCounts(), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("itype out of range [0, ntype)")); - // Warning 4: number of atoms <= 0 for some element - std::map atomCounts2 = { - {0, 2 }, - {1, -1} - }; - this->sc.set_atomCounts(atomCounts2); - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.check_atomCounts(), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("number of atoms <= 0 for some element")); -} - -TYPED_TEST(SpinConstrainTest, AtomCounts) -{ - std::map atomCounts = { - {0, 5 }, - {1, 10} - }; - this->sc.set_atomCounts(atomCounts); - std::map atomCounts2 = this->sc.get_atomCounts(); - int ntype = atomCounts2.size(); - EXPECT_EQ(ntype, 2); - int nat = this->sc.get_nat(); - EXPECT_EQ(nat, 15); - EXPECT_EQ(this->sc.get_iat(1, 4), 9); // atom_index starts from 0 - // warning 1: itype out of range - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.get_iat(3, 0);, ::testing::ExitedWithCode(1), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("itype out of range [0, ntype)")); - // warning 2: atom_index out of range - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.get_iat(0, 5);, ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("atom index out of range [0, nat)")); -} - -TYPED_TEST(SpinConstrainTest, NSPIN) -{ - this->sc.set_nspin(4); - int nspin = this->sc.get_nspin(); - EXPECT_EQ(nspin, 4); -} - -TYPED_TEST(SpinConstrainTest, NSPINwarning) -{ - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.set_nspin(1), ::testing::ExitedWithCode(1), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("nspin must be 2 or 4")); -} - -TYPED_TEST(SpinConstrainTest, SetInputParameters) -{ - double sc_thr = 1e-6; - int nsc = 100; - int nsc_min = 2; - double alpha_trial = 0.01; - double sccut = 3.0; - double sc_drop_thr = 1e-3; - this->sc.set_input_parameters(sc_thr, nsc, nsc_min, alpha_trial, sccut, sc_drop_thr); - EXPECT_DOUBLE_EQ(this->sc.get_sc_thr(), sc_thr); - EXPECT_EQ(this->sc.get_nsc(), nsc); - EXPECT_EQ(this->sc.get_nsc_min(), nsc_min); - EXPECT_DOUBLE_EQ(this->sc.get_alpha_trial(), alpha_trial / 13.605698); - EXPECT_DOUBLE_EQ(this->sc.get_sccut(), sccut / 13.605698); - EXPECT_EQ(this->sc.get_sc_drop_thr(), sc_drop_thr); -} - -TYPED_TEST(SpinConstrainTest, SetSolverParameters) -{ - K_Vectors kv; - this->sc.set_nspin(4); - this->sc.set_solver_parameters(kv, nullptr, nullptr, nullptr); - EXPECT_EQ(this->sc.get_nspin(), 4); - EXPECT_EQ(this->sc.p_hamilt, nullptr); - EXPECT_EQ(this->sc.psi, nullptr); - EXPECT_EQ(this->sc.pelec, nullptr); -} - -TYPED_TEST(SpinConstrainTest, SetParaV) -{ - Parallel_Orbitals paraV; - // warning 1 - paraV.nloc = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sc.set_ParaV(¶V), ::testing::ExitedWithCode(1), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("nloc <= 0")); - // normal set - int nrow = 4; - int ncol = 4; - std::ofstream ofs("test.log"); - paraV.set_serial(nrow, ncol); - this->sc.set_ParaV(¶V); - EXPECT_EQ(this->sc.ParaV->nloc, nrow * ncol); - remove("test.log"); -} - -/* -TYPED_TEST(SpinConstrainTest, PrintMi) -{ - this->sc.zero_Mi(); - testing::internal::CaptureStdout(); - this->sc.print_Mi(true); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("Total Magnetism (uB):")); - EXPECT_THAT(output, testing::HasSubstr("ATOM 0 0.0000000000 0.0000000000 0.0000000000")); - this->sc.set_nspin(2); - testing::internal::CaptureStdout(); - this->sc.print_Mi(true); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("Total Magnetism (uB):")); - EXPECT_THAT(output, testing::HasSubstr("ATOM 0 0.0000000000")); -} -*/ diff --git a/source/module_hamilt_lcao/module_deltaspin/test/template_helpers_test.cpp b/source/module_hamilt_lcao/module_deltaspin/test/template_helpers_test.cpp deleted file mode 100644 index be5954f859..0000000000 --- a/source/module_hamilt_lcao/module_deltaspin/test/template_helpers_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include - -#include "../spin_constrain.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -/************************************************ - * unit test of functions in template_helpers.cpp - ***********************************************/ - -/** - * - Tested functions: - * - Functions in template_helpers.cpp are defined by template specialization. - * but they are not used in the code. - * So, we just test if they can be called without error. - */ -#include "source_cell/klist.h" - -class SpinConstrainTest : public testing::Test -{ - protected: - spinconstrain::SpinConstrain& sc - = spinconstrain::SpinConstrain::getScInstance(); -}; - -TEST_F(SpinConstrainTest, TemplatHelpers) -{ - // this is a trivial test as the double version is not used - std::vector> Sloc2; - EXPECT_NO_THROW(sc.cal_mw_from_lambda(0)); - EXPECT_NO_THROW(sc.cal_mi_lcao(0,false)); - EXPECT_NO_THROW(sc.run_lambda_loop(0)); - EXPECT_FALSE(sc.check_rms_stop(0, 0, 0.0, 0.0, 0.0)); - EXPECT_NO_THROW(sc.print_termination()); - EXPECT_NO_THROW(sc.print_header()); - std::vector> new_spin, old_spin, new_delta_lambda, old_delta_lambda; - EXPECT_FALSE(sc.check_gradient_decay(new_spin, old_spin, new_delta_lambda, old_delta_lambda, true)); - double alpha = 0.0; - EXPECT_NO_THROW(sc.check_restriction(new_spin, alpha)); - EXPECT_EQ(sc.cal_alpha_opt(new_spin, old_spin, alpha), 0.0); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_dftu/CMakeLists.txt b/source/module_hamilt_lcao/module_dftu/CMakeLists.txt deleted file mode 100644 index d412154970..0000000000 --- a/source/module_hamilt_lcao/module_dftu/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -list(APPEND objects - dftu.cpp - dftu_force.cpp - dftu_yukawa.cpp - dftu_folding.cpp - dftu_io.cpp - dftu_tools.cpp - dftu_occup.cpp - dftu_hamilt.cpp - dftu_pw.cpp -) - -add_library( - dftu - OBJECT - ${objects} -) - -if(ENABLE_COVERAGE) - add_coverage(dftu) -endif() \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_dftu/dftu.cpp b/source/module_hamilt_lcao/module_dftu/dftu.cpp deleted file mode 100644 index e61c7939a2..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "dftu.h" - -#include "module_parameter/parameter.h" -#include "source_base/constants.h" -#include "source_base/global_function.h" -#include "source_base/inverse_matrix.h" -#include "source_base/memory.h" -#include "source_base/scalapack_connector.h" -#include "source_base/timer.h" -#include "source_estate/magnetism.h" -#include "source_estate/module_charge/charge.h" -#include "source_pw/hamilt_pwdft/global.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace GlobalC -{ -ModuleDFTU::DFTU dftu; -} - -namespace ModuleDFTU -{ -DFTU::DFTU() -{ -} - -DFTU::~DFTU() -{ -} - -void DFTU::init(UnitCell& cell, // unitcell class - const Parallel_Orbitals* pv, - const int nks -#ifdef __LCAO - , const LCAO_Orbitals* orb -#endif - ) -{ - ModuleBase::TITLE("DFTU", "init"); - -#ifndef __MPI - std::cout << "DFT+U module is only accessible in mpi versioin" << std::endl; - exit(0); -#endif - - this->paraV = pv; - -#ifdef __LCAO - ptr_orb_ = orb; - if(ptr_orb_ != nullptr) - { - orb_cutoff_ = orb->cutoffs(); - } - ucell = &cell; -#endif - - // needs reconstructions in future - // global parameters, need to be removed in future - const int npol = PARAM.globalv.npol; // number of polarization directions - const int nlocal = PARAM.globalv.nlocal; // number of total local orbitals - const int nspin = PARAM.inp.nspin; // number of spins - - this->EU = 0.0; - - this->locale.resize(cell.nat); - this->locale_save.resize(cell.nat); - // only for PW base - this->eff_pot_pw_index.resize(cell.nat); - int pot_index = 0; - - this->iatlnmipol2iwt.resize(cell.nat); - - int num_locale = 0; - // it:index of type of atom - for (int it = 0; it < cell.ntype; ++it) - { - for (int ia = 0; ia < cell.atoms[it].na; ia++) - { - // ia:index of atoms of this type - // determine the size of locale - const int iat = cell.itia2iat(it, ia); - - locale[iat].resize(cell.atoms[it].nwl + 1); - locale_save[iat].resize(cell.atoms[it].nwl + 1); - - const int tlp1_npol = (this->orbital_corr[it]*2+1)*npol; - this->eff_pot_pw_index[iat] = pot_index; - pot_index += tlp1_npol * tlp1_npol; - - for (int l = 0; l <= cell.atoms[it].nwl; l++) - { - const int N = cell.atoms[it].l_nchi[l]; - - locale[iat][l].resize(N); - locale_save[iat][l].resize(N); - - for (int n = 0; n < N; n++) - { - if (nspin == 1 || nspin == 2) - { - locale[iat][l][n].resize(2); - locale_save[iat][l][n].resize(2); - - locale[iat][l][n][0].create(2 * l + 1, 2 * l + 1); - locale[iat][l][n][1].create(2 * l + 1, 2 * l + 1); - - locale_save[iat][l][n][0].create(2 * l + 1, 2 * l + 1); - locale_save[iat][l][n][1].create(2 * l + 1, 2 * l + 1); - num_locale += (2 * l + 1) * (2 * l + 1) * 2; - } - else if (nspin == 4) // SOC - { - locale[iat][l][n].resize(1); - locale_save[iat][l][n].resize(1); - - locale[iat][l][n][0].create((2 * l + 1) * npol, (2 * l + 1) * npol); - locale_save[iat][l][n][0].create((2 * l + 1) * npol, (2 * l + 1) * npol); - num_locale += (2 * l + 1) * (2 * l + 1) * npol * npol; - } - } - } - - // initialize the arrry iatlnm2iwt[iat][l][n][m] - this->iatlnmipol2iwt[iat].resize(cell.atoms[it].nwl + 1); - for (int L = 0; L <= cell.atoms[it].nwl; L++) - { - this->iatlnmipol2iwt[iat][L].resize(cell.atoms[it].l_nchi[L]); - - for (int n = 0; n < cell.atoms[it].l_nchi[L]; n++) - { - this->iatlnmipol2iwt[iat][L][n].resize(2 * L + 1); - - for (int m = 0; m < 2 * L + 1; m++) - { - this->iatlnmipol2iwt[iat][L][n][m].resize(npol); - } - } - } - - for (int iw = 0; iw < cell.atoms[it].nw * npol; iw++) - { - int iw0 = iw / npol; - int ipol = iw % npol; - int iwt = cell.itiaiw2iwt(it, ia, iw); - int l = cell.atoms[it].iw2l[iw0]; - int n = cell.atoms[it].iw2n[iw0]; - int m = cell.atoms[it].iw2m[iw0]; - - this->iatlnmipol2iwt[iat][l][n][m][ipol] = iwt; - } - } - } - // allocate memory for eff_pot_pw - this->eff_pot_pw.resize(pot_index, 0.0); - - if (Yukawa) - { - this->Fk.resize(cell.ntype); - - this->U_Yukawa.resize(cell.ntype); - this->J_Yukawa.resize(cell.ntype); - - for (int it = 0; it < cell.ntype; it++) - { - const int NL = cell.atoms[it].nwl + 1; - - this->Fk[it].resize(NL); - this->U_Yukawa[it].resize(NL); - this->J_Yukawa[it].resize(NL); - - for (int l = 0; l < NL; l++) - { - int N = cell.atoms[it].l_nchi[l]; - - this->Fk[it][l].resize(N); - for (int n = 0; n < N; n++) - { - this->Fk[it][l][n].resize(l + 1, 0.0); - } - - this->U_Yukawa[it][l].resize(N, 0.0); - this->J_Yukawa[it][l].resize(N, 0.0); - } - } - } - - if (omc != 0) - { - std::stringstream sst; - sst << "initial_onsite.dm"; - this->read_occup_m(cell,sst.str()); -#ifdef __MPI - this->local_occup_bcast(cell); -#endif - - initialed_locale = true; - this->copy_locale(cell); - } - else - { - if (PARAM.inp.init_chg == "file") - { - std::stringstream sst; - sst << PARAM.globalv.global_out_dir << "onsite.dm"; - this->read_occup_m(cell,sst.str()); -#ifdef __MPI - this->local_occup_bcast(cell); -#endif - initialed_locale = true; - } - else - { - this->zero_locale(cell); - } - } - - ModuleBase::Memory::record("DFTU::locale", sizeof(double) * num_locale); - return; -} - -#ifdef __LCAO - -void DFTU::cal_energy_correction(const UnitCell& ucell, - const int istep) -{ - ModuleBase::TITLE("DFTU", "cal_energy_correction"); - ModuleBase::timer::tick("DFTU", "cal_energy_correction"); - if (!initialed_locale) - { - ModuleBase::timer::tick("DFTU", "cal_energy_correction"); - return; - } - this->EU = 0.0; - double EU_dc = 0.0; - - for (int T = 0; T < ucell.ntype; T++) - { - const int NL = ucell.atoms[T].nwl + 1; - const int LC = orbital_corr[T]; - for (int I = 0; I < ucell.atoms[T].na; I++) - { - if (LC == -1) - { - continue; - } - - const int iat = ucell.itia2iat(T, I); - const int L = orbital_corr[T]; - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[T]) - { - continue; - } - - const int N = ucell.atoms[T].l_nchi[l]; - - const int m_tot = 2 * l + 1; - - // part 1: calculate the DFT+U energy correction - for (int n = 0; n < N; n++) - { - if (n != 0) - { - continue; - } - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - for (int spin = 0; spin < 2; spin++) - { - double nm_trace = 0.0; - double nm2_trace = 0.0; - - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - nm_trace += this->locale[iat][l][n][spin](m0, m0); - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - nm2_trace += this->locale[iat][l][n][spin](m0, m1) - * this->locale[iat][l][n][spin](m1, m0); - } - } - if (Yukawa) - { - this->EU += 0.5 * (this->U_Yukawa[T][l][n] - this->J_Yukawa[T][l][n]) - * (nm_trace - nm2_trace); - } - else - { - this->EU += 0.5 * this->U[T] * (nm_trace - nm2_trace); - } - } - } - else if (PARAM.inp.nspin == 4) // SOC - { - double nm_trace = 0.0; - double nm2_trace = 0.0; - - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int ipol0 = 0; ipol0 < PARAM.globalv.npol; ipol0++) - { - const int m0_all = m0 + (2 * l + 1) * ipol0; - nm_trace += this->locale[iat][l][n][0](m0_all, m0_all); - - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - int m1_all = m1 + (2 * l + 1) * ipol1; - - nm2_trace += this->locale[iat][l][n][0](m0_all, m1_all) - * this->locale[iat][l][n][0](m1_all, m0_all); - } - } - } - } - if (Yukawa) - { - this->EU - += 0.5 * (this->U_Yukawa[T][l][n] - this->J_Yukawa[T][l][n]) * (nm_trace - nm2_trace); - } - else - { - this->EU += 0.5 * this->U[T] * (nm_trace - nm2_trace); - } - } - - // calculate the double counting term included in eband - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - const int m1_all = m1 + ipol1 * (2 * l + 1); - for (int m2 = 0; m2 < 2 * l + 1; m2++) - { - for (int ipol2 = 0; ipol2 < PARAM.globalv.npol; ipol2++) - { - const int m2_all = m2 + ipol2 * (2 * l + 1); - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - for (int is = 0; is < 2; is++) - { - double VU = 0.0; - VU = get_onebody_eff_pot(T, iat, l, n, is, m1_all, m2_all, false); - EU_dc += VU * this->locale[iat][l][n][is](m1_all, m2_all); - } - } - else if (PARAM.inp.nspin == 4) // SOC - { - double VU = 0.0; - VU = get_onebody_eff_pot(T, iat, l, n, 0, m1_all, m2_all, false); - EU_dc += VU * this->locale[iat][l][n][0](m1_all, m2_all); - } - } - } - } - } - } // end n - } // end L - } // end I - } // end T - - // substract the double counting EU_dc included in band energy eband - this->EU -= EU_dc; - - ModuleBase::timer::tick("DFTU", "cal_energy_correction"); - return; -} - -#endif - -void DFTU::uramping_update() -{ - // if uramping < 0.1, use the original U - if (this->uramping < 0.01) { - return; -} - // loop to change U - for (int i = 0; i < this->U0.size(); i++) - { - if (this->U[i] + this->uramping < this->U0[i]) - { - this->U[i] += this->uramping; - } - else - { - this->U[i] = this->U0[i]; - } - } -} - -bool DFTU::u_converged() -{ - for (int i = 0; i < this->U0.size(); i++) - { - if (this->U[i] != this->U0[i]) - { - return false; - } - } - return true; -} - -#ifdef __LCAO - -void DFTU::set_dmr(const elecstate::DensityMatrix, double>* dmr) -{ - this->dm_in_dftu_cd = dmr; - return; -} - -void DFTU::set_dmr(const elecstate::DensityMatrix* dmr) -{ - this->dm_in_dftu_d = dmr; - return; -} - -const hamilt::HContainer* DFTU::get_dmr(int ispin) const -{ - if (this->dm_in_dftu_d != nullptr) - { - return this->dm_in_dftu_d->get_DMR_pointer(ispin + 1); - } - else if (this->dm_in_dftu_cd != nullptr) - { - return this->dm_in_dftu_cd->get_DMR_pointer(ispin + 1); - } - else - { - return nullptr; - } -} - -//! dftu occupation matrix for gamma only using dm(double) -template <> -void dftu_cal_occup_m(const int iter, - const UnitCell& ucell, - const std::vector>& dm, - const K_Vectors& kv, - const double& mixing_beta, - hamilt::Hamilt* p_ham) -{ - GlobalC::dftu.cal_occup_m_gamma(iter, ucell ,dm, mixing_beta, p_ham); -} - -//! dftu occupation matrix for multiple k-points using dm(complex) -template <> -void dftu_cal_occup_m(const int iter, - const UnitCell& ucell, - const std::vector>>& dm, - const K_Vectors& kv, - const double& mixing_beta, - hamilt::Hamilt>* p_ham) -{ - GlobalC::dftu.cal_occup_m_k(iter,ucell, dm, kv, mixing_beta, p_ham); -} - -#endif - -} // namespace ModuleDFTU diff --git a/source/module_hamilt_lcao/module_dftu/dftu.h b/source/module_hamilt_lcao/module_dftu/dftu.h deleted file mode 100644 index 8b8320e4d3..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu.h +++ /dev/null @@ -1,322 +0,0 @@ -#ifndef DFTU_H -#define DFTU_H - -#include "source_cell/klist.h" -#include "source_cell/unitcell.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#ifdef __LCAO -#include "source_estate/module_charge/charge_mixing.h" -#include "source_hamilt/hamilt.h" -#include "source_estate/elecstate.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_hamilt_lcao/hamilt_lcaodft/force_stress_arrays.h" // mohan add 2024-06-15 -#endif - -#include -#include - -//========================================================== -// CLASS : -// NAME : DTFU (DFT+U) -//========================================================== -namespace ModuleDFTU -{ - -class DFTU -{ - - public: - DFTU(); // constructor - ~DFTU(); // deconstructor - - //============================================================= - // In dftu.cpp - // Initialization & Calculating energy - //============================================================= - public: - // allocate relevant data strcutures - void init(UnitCell& cell, // unitcell class - const Parallel_Orbitals* pv, - const int nks -#ifdef __LCAO - , const LCAO_Orbitals* orb = nullptr -#endif - ); - - static DFTU* get_instance(); - - // calculate the energy correction - void cal_energy_correction(const UnitCell& ucell, const int istep); - double get_energy(){return EU;} - void uramping_update(); // update U by uramping - bool u_converged(); // check if U is converged - - std::vector U = {}; // U (Hubbard parameter U) - std::vector U0; // U0 (target Hubbard parameter U0) - std::vector orbital_corr = {}; // - double uramping; // increase U by uramping, default is -1.0 - int omc; // occupation matrix control - int mixing_dftu; //whether to mix locale - - double EU; //+U energy - private: - const Parallel_Orbitals* paraV = nullptr; - int cal_type = 3; // 1:dftu_tpye=1, dc=1; 2:dftu_type=1, dc=2; 3:dftu_tpye=2, dc=1; 4:dftu_tpye=2, dc=2; - - // FIXME: the following variable does not have static lifetime; - // while the present class is used via a global variable. This has - // potential to cause dangling pointer issues. -#ifdef __LCAO - const LCAO_Orbitals* ptr_orb_ = nullptr; - std::vector orb_cutoff_; -#endif - - // transform between iwt index and it, ia, L, N and m index - std::vector>>>> - iatlnmipol2iwt; // iatlnm2iwt[iat][l][n][m][ipol] - -#ifdef __LCAO - //============================================================= - // In dftu_hamilt.cpp - // For calculating contribution to Hamiltonian matrices - //============================================================= - public: - void cal_eff_pot_mat_complex(const int ik, std::complex* eff_pot, const std::vector& isk, const std::complex* sk); - void cal_eff_pot_mat_real(const int ik, double* eff_pot, const std::vector& isk, const double* sk); - void cal_eff_pot_mat_R_double(const int ispin, double* SR, double* HR); - void cal_eff_pot_mat_R_complex_double(const int ispin, std::complex* SR, std::complex* HR); -#endif - - //============================================================= - // In dftu_occup.cpp - // For calculating occupation matrix and saving to locale - // and other operations of locale: copy,zero out,mix - //============================================================= - public: - /// interface for PW base - /// calculate the local occupation number matrix for PW based wave functions - void cal_occ_pw(const int iter, const void* psi_in, const ModuleBase::matrix& wg_in, const UnitCell& cell, const double& mixing_beta); - /// calculate the local DFT+U effective potential matrix for PW base. - void cal_VU_pot_pw(const int spin); - /// get effective potential matrix for PW base - const std::complex* get_eff_pot_pw(const int iat) const { return &(eff_pot_pw[this->eff_pot_pw_index[iat]]); } - int get_size_eff_pot_pw() const { return eff_pot_pw.size(); } - -#ifdef __LCAO - // calculate the local occupation number matrix - void cal_occup_m_k(const int iter, - const UnitCell& ucell, - const std::vector>>& dm_k, - const K_Vectors& kv, - const double& mixing_beta, - hamilt::Hamilt>* p_ham); - void cal_occup_m_gamma(const int iter, - const UnitCell& ucell, - const std::vector>& dm_gamma, - const double& mixing_beta, - hamilt::Hamilt* p_ham); -#endif - - // dftu can be calculated only after locale has been initialed - bool initialed_locale = false; - - private: - void copy_locale(const UnitCell& ucell); - void zero_locale(const UnitCell& ucell); - void mix_locale(const UnitCell& ucell,const double& mixing_beta); - - std::vector> eff_pot_pw; - std::vector eff_pot_pw_index; - -public: - // local occupancy matrix of the correlated subspace - // locale: the out put local occupation number matrix of correlated electrons in the current electronic step - // locale_save: the input local occupation number matrix of correlated electrons in the current electronic step - std::vector>>> locale; // locale[iat][l][n][spin](m1,m2) - std::vector>>> locale_save; // locale_save[iat][l][n][spin](m1,m2) -#ifdef __LCAO -private: - //============================================================= - // In dftu_tools.cpp - // For calculating onsite potential, which is used - // for both Hamiltonian and force/stress - //============================================================= - - void cal_VU_pot_mat_complex(const int spin, const bool newlocale, std::complex* VU); - void cal_VU_pot_mat_real(const int spin, const bool newlocale, double* VU); - - double get_onebody_eff_pot(const int T, - const int iat, - const int L, - const int N, - const int spin, - const int m0, - const int m1, - const bool newlocale); - - //============================================================= - // In dftu_folding.cpp - // Subroutines for folding S and dS matrix - //============================================================= - - void fold_dSR_gamma(const UnitCell& ucell, - const Parallel_Orbitals& pv, - const Grid_Driver* gd, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - double* dh_r, - const int dim1, - const int dim2, - double* dSR_gamma); - - // dim = 0 : S, for Hamiltonian - // dim = 1-3 : dS, for force - // dim = 4-6 : dS * dR, for stress - - void folding_matrix_k(const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, - const Parallel_Orbitals& pv, - const int ik, - const int dim1, - const int dim2, - std::complex* mat_k, - const ModuleBase::Vector3& kvec_d); - - /** - * @brief new function of folding_S_matrix - * only for Hamiltonian now, for force and stress will be developed later - * use HContainer as input and output in mat_k - */ - void folding_matrix_k_new(const int ik, - hamilt::Hamilt>* p_ham); - - //============================================================= - // In dftu_force.cpp - // For calculating force and stress fomr DFT+U - //============================================================= - public: - void force_stress(const UnitCell& ucell, - const Grid_Driver& gd, - const elecstate::ElecState* pelec, - const Parallel_Orbitals& pv, - ForceStressArrays& fsr, - ModuleBase::matrix& force_dftu, - ModuleBase::matrix& stress_dftu, - const K_Vectors& kv); - - private: - void cal_force_k(const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, - const Parallel_Orbitals& pv, - const int ik, - const std::complex* rho_VU, - ModuleBase::matrix& force_dftu, - const ModuleBase::Vector3& kvec_d); - - void cal_stress_k(const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, - const Parallel_Orbitals& pv, - const int ik, - const std::complex* rho_VU, - ModuleBase::matrix& stress_dftu, - const ModuleBase::Vector3& kvec_d); - - void cal_force_gamma(const UnitCell& ucell, - const double* rho_VU, - const Parallel_Orbitals& pv, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - ModuleBase::matrix& force_dftu); - - void cal_stress_gamma(const UnitCell& ucell, - const Parallel_Orbitals& pv, - const Grid_Driver* gd, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - double* dh_r, - const double* rho_VU, - ModuleBase::matrix& stress_dftu); -#endif - - //============================================================= - // In dftu_io.cpp - // For reading/writing/broadcasting/copying relevant data structures - //============================================================= - public: - void output(const UnitCell& ucell); - - private: - void write_occup_m(const UnitCell& ucell, - std::ofstream& ofs, - bool diag=false); - void read_occup_m(const UnitCell& ucell, - const std::string& fn); - void local_occup_bcast(const UnitCell& ucell); - - //============================================================= - // In dftu_yukawa.cpp - // Relevant for calculating U using Yukawa potential - //============================================================= - - public: - bool Yukawa; // 1:use Yukawa potential; 0: do not use Yukawa potential - void cal_slater_UJ(const UnitCell& ucell, double** rho, const int& nrxx); - - private: - double lambda; // the parameter in Yukawa potential - std::vector>>> Fk; // slater integral:Fk[T][L][N][k] - std::vector>> U_Yukawa; // U_Yukawa[T][L][N] - std::vector>> J_Yukawa; // J_Yukawa[T][L][N] - - void cal_slater_Fk(const UnitCell& ucell,const int L, const int T); // L:angular momnet, T:atom type - void cal_yukawa_lambda(double** rho, const int& nrxx); - - double spherical_Bessel(const int k, const double r, const double lambda); - double spherical_Hankel(const int k, const double r, const double lambda); - -#ifdef __LCAO - public: - /** - * @brief get the density matrix of target spin - * nspin = 1 and 4 : ispin should be 0 - * nspin = 2 : ispin should be 0/1 - */ - const hamilt::HContainer* get_dmr(int ispin) const; - /** - * @brief set the density matrix for DFT+U calculation - * if the density matrix is not set or set to nullptr, the DFT+U calculation will not be performed - */ - void set_dmr(const elecstate::DensityMatrix* dm_in_dftu_d); - void set_dmr(const elecstate::DensityMatrix, double>* dm_in_dftu_cd); - - private: - const UnitCell* ucell = nullptr; - const elecstate::DensityMatrix* dm_in_dftu_d = nullptr; - const elecstate::DensityMatrix, double>* dm_in_dftu_cd = nullptr; -#endif -}; - -#ifdef __LCAO -template -void dftu_cal_occup_m(const int iter, - const UnitCell& ucell, - const std::vector>& dm, - const K_Vectors& kv, - const double& mixing_beta, - hamilt::Hamilt* p_ham); -#endif - -} // namespace ModuleDFTU - -namespace GlobalC -{ - extern ModuleDFTU::DFTU dftu; -} -#endif diff --git a/source/module_hamilt_lcao/module_dftu/dftu_folding.cpp b/source/module_hamilt_lcao/module_dftu/dftu_folding.cpp deleted file mode 100644 index 428b1da20a..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_folding.cpp +++ /dev/null @@ -1,319 +0,0 @@ -#ifdef __LCAO -#include "dftu.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" - -namespace ModuleDFTU -{ - -void DFTU::fold_dSR_gamma(const UnitCell& ucell, - const Parallel_Orbitals& pv, - const Grid_Driver* gd, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - double* dh_r, - const int dim1, - const int dim2, - double* dSR_gamma) -{ - ModuleBase::TITLE("DFTU", "fold_dSR_gamma"); - - ModuleBase::GlobalFunc::ZEROS(dSR_gamma, pv.nloc); - - double* dS_ptr = nullptr; - if(dim1 == 0) - { - dS_ptr = dsloc_x; - } - else if(dim1 == 1) - { - dS_ptr = dsloc_y; - } - else if (dim1 == 2) - { - dS_ptr = dsloc_z; - } - - int nnr = 0; - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 dtau1, dtau2, tau0; - - for (int T1 = 0; T1 < ucell.ntype; ++T1) - { - Atom* atom1 = &ucell.atoms[T1]; - for (int I1 = 0; I1 < atom1->na; ++I1) - { - tau1 = atom1->tau[I1]; - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - gd->Find_atom(ucell, tau1, T1, I1); - for (int ad = 0; ad < gd->getAdjacentNum() + 1; ++ad) - { - const int T2 = gd->getType(ad); - const int I2 = gd->getNatom(ad); - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - Atom* atom2 = &ucell.atoms[T2]; - tau2 = gd->getAdjacentTau(ad); - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff_[T1] + orb_cutoff_[T2]; - bool adj = false; - if (distance < rcut) - { - adj = true; - } - else if (distance >= rcut) - { - for (int ad0 = 0; ad0 < gd->getAdjacentNum() + 1; ++ad0) - { - const int T0 = gd->getType(ad0); - const int I0 = gd->getNatom(ad0); - const int iat0 = ucell.itia2iat(T0, I0); - const int start0 = ucell.itiaiw2iwt(T0, I0, 0); - tau0 = gd->getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - double distance1 = dtau1.norm() * ucell.lat0; - double distance2 = dtau2.norm() * ucell.lat0; - double rcut1 = orb_cutoff_[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - double rcut2 = orb_cutoff_[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - if (distance1 < rcut1 && distance2 < rcut2) - { - adj = true; - break; - } - } - } - - if (adj) - { - for (int jj = 0; jj < atom1->nw * PARAM.globalv.npol; ++jj) - { - const int jj0 = jj / PARAM.globalv.npol; - const int iw1_all = start1 + jj0; - const int mu = pv.global2local_row(iw1_all); - if (mu < 0) - { - continue; - } - - for (int kk = 0; kk < atom2->nw * PARAM.globalv.npol; ++kk) - { - const int kk0 = kk / PARAM.globalv.npol; - const int iw2_all = start2 + kk0; - const int nu = pv.global2local_col(iw2_all); - if (nu < 0) - { - continue; - } - - dSR_gamma[nu * pv.nrow + mu] += dS_ptr[nnr] * dh_r[nnr * 3 + dim2]; - - ++nnr; - } // kk - } // jj - } // adj - } // ad - } // I1 - } // T1 - - return; -} - -void DFTU::folding_matrix_k(const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, - const Parallel_Orbitals& pv, - const int ik, - const int dim1, - const int dim2, - std::complex* mat_k, - const ModuleBase::Vector3& kvec_d) -{ - ModuleBase::TITLE("DFTU", "folding_matrix_k"); - ModuleBase::timer::tick("DFTU", "folding_matrix_k"); - ModuleBase::GlobalFunc::ZEROS(mat_k, pv.nloc); - - double* mat_ptr; - if (dim1 == 1 || dim1 == 4) - { - mat_ptr = fsr.DSloc_Rx; - } - else if (dim1 == 2 || dim1 == 5) - { - mat_ptr = fsr.DSloc_Ry; - } - else if (dim1 == 3 || dim1 == 6) - { - mat_ptr = fsr.DSloc_Rz; - } - - int nnr = 0; - ModuleBase::Vector3 dtau; - ModuleBase::Vector3 tau1; - ModuleBase::Vector3 tau2; - - ModuleBase::Vector3 dtau1; - ModuleBase::Vector3 dtau2; - ModuleBase::Vector3 tau0; - - for (int T1 = 0; T1 < ucell.ntype; ++T1) - { - Atom* atom1 = &ucell.atoms[T1]; - for (int I1 = 0; I1 < atom1->na; ++I1) - { - tau1 = atom1->tau[I1]; - gd.Find_atom(ucell, tau1, T1, I1); - Atom* atom1 = &ucell.atoms[T1]; - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - - // (2) search among all adjacent atoms. - for (int ad = 0; ad < gd.getAdjacentNum() + 1; ++ad) - { - const int T2 = gd.getType(ad); - const int I2 = gd.getNatom(ad); - Atom* atom2 = &ucell.atoms[T2]; - - tau2 = gd.getAdjacentTau(ad); - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = orb_cutoff_[T1] + orb_cutoff_[T2]; - - bool adj = false; - - if (distance < rcut) - { - adj = true; - } - else if (distance >= rcut) - { - for (int ad0 = 0; ad0 < gd.getAdjacentNum() + 1; ++ad0) - { - const int T0 = gd.getType(ad0); - const int I0 = gd.getNatom(ad0); - - tau0 = gd.getAdjacentTau(ad0); - dtau1 = tau0 - tau1; - dtau2 = tau0 - tau2; - - double distance1 = dtau1.norm() * ucell.lat0; - double distance2 = dtau2.norm() * ucell.lat0; - - double rcut1 = orb_cutoff_[T1] + ucell.infoNL.Beta[T0].get_rcut_max(); - double rcut2 = orb_cutoff_[T2] + ucell.infoNL.Beta[T0].get_rcut_max(); - - if (distance1 < rcut1 && distance2 < rcut2) - { - adj = true; - break; - } - } - } - - if (adj) - { - // (3) calculate the nu of atom (T2, I2) - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - //------------------------------------------------ - // exp(k dot dR) - // dR is the index of box in Crystal coordinates - //------------------------------------------------ - ModuleBase::Vector3 dR(gd.getBox(ad).x, gd.getBox(ad).y, gd.getBox(ad).z); - const double arg = (kvec_d * dR) * ModuleBase::TWO_PI; - const std::complex kphase = std::complex(cos(arg), sin(arg)); - - //-------------------------------------------------- - // calculate how many matrix elements are in - // this processor. - //-------------------------------------------------- - for (int ii = 0; ii < atom1->nw * PARAM.globalv.npol; ii++) - { - // the index of orbitals in this processor - const int iw1_all = start1 + ii; - const int mu = pv.global2local_row(iw1_all); - if (mu < 0) - { - continue; - } - - for (int jj = 0; jj < atom2->nw * PARAM.globalv.npol; jj++) - { - int iw2_all = start2 + jj; - const int nu = pv.global2local_col(iw2_all); - if (nu < 0) - { - continue; - } - - int iic; - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = mu + nu * pv.nrow; - } - else - { - iic = mu * pv.ncol + nu; - } - - if (dim1 <= 3) - { - mat_k[iic] += mat_ptr[nnr] * kphase; - } - else - { - mat_k[iic] += mat_ptr[nnr] * fsr.DH_r[nnr * 3 + dim2] * kphase; - } - - ++nnr; - } // kk - } // jj - } // adj - - } // ad - } // I1 - } // T1 - ModuleBase::timer::tick("DFTU", "folding_matrix_k"); - - return; -} - -void DFTU::folding_matrix_k_new(const int ik, - hamilt::Hamilt>* p_ham) -{ - ModuleBase::TITLE("DFTU", "folding_matrix_k_new"); - ModuleBase::timer::tick("DFTU", "folding_matrix_k_new"); - - int hk_type = 0; - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - hk_type = 1; - } - - // get SR and fold to mat_k - if(PARAM.globalv.gamma_only_local) - { - dynamic_cast*>(p_ham) - ->updateSk(ik, hk_type); - } - else - { - if(PARAM.inp.nspin != 4) - { - dynamic_cast, double>*>(p_ham) - ->updateSk(ik, hk_type); - } - else - { - dynamic_cast, std::complex>*>(p_ham) - ->updateSk(ik, hk_type); - } - } -} - -} // namespace ModuleDFTU -#endif // __LCAO diff --git a/source/module_hamilt_lcao/module_dftu/dftu_force.cpp b/source/module_hamilt_lcao/module_dftu/dftu_force.cpp deleted file mode 100644 index 1bd62416b3..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_force.cpp +++ /dev/null @@ -1,665 +0,0 @@ -//========================================================== -// Author:Xin Qu -#include "module_parameter/parameter.h" -// DATE : 2019-12-10 -//========================================================== -#ifdef __LCAO -#include "dftu.h" -#include "source_base/constants.h" -#include "source_base/global_function.h" -#include "source_base/inverse_matrix.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_estate/elecstate_lcao.h" -#include "source_estate/magnetism.h" -#include "source_estate/module_charge/charge.h" -#include "source_pw/hamilt_pwdft/global.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -extern "C" -{ - // I'm not sure what's happenig here, but the interface in scalapack_connecter.h - // does not seem to work, so I'll use this one here - void pzgemm_(const char* transa, - const char* transb, - const int* M, - const int* N, - const int* K, - const std::complex* alpha, - const std::complex* A, - const int* IA, - const int* JA, - const int* DESCA, - const std::complex* B, - const int* IB, - const int* JB, - const int* DESCB, - const std::complex* beta, - std::complex* C, - const int* IC, - const int* JC, - const int* DESCC); - - void pdgemm_(const char* transa, - const char* transb, - const int* M, - const int* N, - const int* K, - const double* alpha, - const double* A, - const int* IA, - const int* JA, - const int* DESCA, - const double* B, - const int* IB, - const int* JB, - const int* DESCB, - const double* beta, - double* C, - const int* IC, - const int* JC, - const int* DESCC); -} - -namespace ModuleDFTU -{ - -void DFTU::force_stress(const UnitCell& ucell, - const Grid_Driver& gd, - const elecstate::ElecState* pelec, - const Parallel_Orbitals& pv, - ForceStressArrays& fsr, // mohan add 2024-06-16 - ModuleBase::matrix& force_dftu, - ModuleBase::matrix& stress_dftu, - const K_Vectors& kv) -{ - ModuleBase::TITLE("DFTU", "force_stress"); - ModuleBase::timer::tick("DFTU", "force_stress"); - - const int nlocal = PARAM.globalv.nlocal; - - if (PARAM.inp.cal_force) - { - force_dftu.zero_out(); - } - if (PARAM.inp.cal_stress) - { - stress_dftu.zero_out(); - } - - if (PARAM.globalv.gamma_only_local) - { - const char transN = 'N'; - const char transT = 'T'; - const int one_int = 1; - const double alpha = 1.0; - const double beta = 0.0; - - std::vector rho_VU(pv.nloc); - - for (int ik = 0; ik < kv.get_nks(); ik++) - { - - const int spin = kv.isk[ik]; - - double* VU = new double[pv.nloc]; - - this->cal_VU_pot_mat_real(spin, false, VU); - - const std::vector>& dmk - = dynamic_cast*>(pelec)->get_DM()->get_DMK_vector(); - -#ifdef __MPI - pdgemm_(&transT, - &transN, - &nlocal, - &nlocal, - &nlocal, - &alpha, - dmk[spin].data(), - &one_int, - &one_int, - pv.desc, - VU, - &one_int, - &one_int, - pv.desc, - &beta, - &rho_VU[0], - &one_int, - &one_int, - pv.desc); -#endif - - delete[] VU; - - if (PARAM.inp.cal_force) - { - this->cal_force_gamma(ucell,&rho_VU[0], pv, fsr.DSloc_x, fsr.DSloc_y, fsr.DSloc_z, force_dftu); - } - - if (PARAM.inp.cal_stress) - { - this->cal_stress_gamma(ucell, - pv, - &gd, - fsr.DSloc_x, - fsr.DSloc_y, - fsr.DSloc_z, - fsr.DH_r, - &rho_VU[0], - stress_dftu); - } - } // ik - } - else - { - const char transN = 'N'; - const char transT = 'T'; - const int one_int = 1; - const std::complex alpha(1.0, 0.0); - const std::complex beta(0.0, 0.0); - - std::vector> rho_VU(pv.nloc); - - for (int ik = 0; ik < kv.get_nks(); ik++) - { - const int spin = kv.isk[ik]; - - std::complex* VU = new std::complex[pv.nloc]; - - this->cal_VU_pot_mat_complex(spin, false, VU); - - const std::vector>>& dmk - = dynamic_cast>*>(pelec) - ->get_DM() - ->get_DMK_vector(); - -#ifdef __MPI - pzgemm_(&transT, - &transN, - &nlocal, - &nlocal, - &nlocal, - &alpha, - dmk[ik].data(), - &one_int, - &one_int, - pv.desc, - VU, - &one_int, - &one_int, - pv.desc, - &beta, - &rho_VU[0], - &one_int, - &one_int, - pv.desc); -#endif - - delete[] VU; - - if (PARAM.inp.cal_force) - { - cal_force_k(ucell, gd, fsr, pv, ik, &rho_VU[0], force_dftu, kv.kvec_d[ik]); - } - if (PARAM.inp.cal_stress) - { - cal_stress_k(ucell, gd, fsr, pv, ik, &rho_VU[0], stress_dftu, kv.kvec_d[ik]); - } - } // ik - } - - if (PARAM.inp.cal_force) - { - Parallel_Reduce::reduce_pool(force_dftu.c, force_dftu.nr * force_dftu.nc); - } - - if (PARAM.inp.cal_stress) - { - Parallel_Reduce::reduce_pool(stress_dftu.c, stress_dftu.nr * stress_dftu.nc); - - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - if (i > j) - stress_dftu(i, j) = stress_dftu(j, i); - } - } - - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - stress_dftu(i, j) *= ucell.lat0 / ucell.omega; - } - } - } - ModuleBase::timer::tick("DFTU", "force_stress"); - - return; -} - -void DFTU::cal_force_k(const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, - const Parallel_Orbitals& pv, - const int ik, - const std::complex* rho_VU, - ModuleBase::matrix& force_dftu, - const ModuleBase::Vector3& kvec_d) -{ - ModuleBase::TITLE("DFTU", "cal_force_k"); - ModuleBase::timer::tick("DFTU", "cal_force_k"); - - const char transN = 'N'; - const char transC = 'C'; - const int one_int = 1; - const std::complex zero(0.0, 0.0); - const std::complex one(1.0, 0.0); - - std::vector> dm_VU_dSm(pv.nloc); - std::vector> dSm_k(pv.nloc); - - for (int dim = 0; dim < 3; dim++) - { - this->folding_matrix_k(ucell, gd, fsr, pv, ik, dim + 1, 0, &dSm_k[0], kvec_d); - -#ifdef __MPI - pzgemm_(&transN, - &transC, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one, - &dSm_k[0], - &one_int, - &one_int, - pv.desc, - rho_VU, - &one_int, - &one_int, - pv.desc, - &zero, - &dm_VU_dSm[0], - &one_int, - &one_int, - pv.desc); -#endif - - for (int ir = 0; ir < pv.nrow; ir++) - { - const int iwt1 = pv.local2global_row(ir); - const int iat1 = ucell.iwt2iat[iwt1]; - - for (int ic = 0; ic < pv.ncol; ic++) - { - const int iwt2 = pv.local2global_col(ic); - const int irc = ic * pv.nrow + ir; - - if (iwt1 == iwt2) - force_dftu(iat1, dim) += dm_VU_dSm[irc].real(); - - } // end ic - } // end ir - -#ifdef __MPI - pzgemm_(&transN, - &transN, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one, - &dSm_k[0], - &one_int, - &one_int, - pv.desc, - rho_VU, - &one_int, - &one_int, - pv.desc, - &zero, - &dm_VU_dSm[0], - &one_int, - &one_int, - pv.desc); -#endif - - for (int it = 0; it < ucell.ntype; it++) - { - const int NL = ucell.atoms[it].nwl + 1; - const int LC = orbital_corr[it]; - - if (LC == -1) - continue; - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - const int iat = ucell.itia2iat(it, ia); - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[it]) - continue; - const int N = ucell.atoms[it].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - if (n != 0) - continue; - - for (int m = 0; m < 2 * l + 1; m++) - { - for (int ipol = 0; ipol < PARAM.globalv.npol; ipol++) - { - const int iwt = this->iatlnmipol2iwt[iat][l][n][m][ipol]; - const int mu = pv.global2local_row(iwt); - const int nu = pv.global2local_col(iwt); - if (mu < 0 || nu < 0) - continue; - - force_dftu(iat, dim) += dm_VU_dSm[nu * pv.nrow + mu].real(); - } - } // - } // n - } // l - } // ia - } // it - } // end dim - ModuleBase::timer::tick("DFTU", "cal_force_k"); - - return; -} - -void DFTU::cal_stress_k(const UnitCell& ucell, - const Grid_Driver& gd, - ForceStressArrays& fsr, - const Parallel_Orbitals& pv, - const int ik, - const std::complex* rho_VU, - ModuleBase::matrix& stress_dftu, - const ModuleBase::Vector3& kvec_d) -{ - ModuleBase::TITLE("DFTU", "cal_stress_k"); - ModuleBase::timer::tick("DFTU", "cal_stress_k"); - - const int nlocal = PARAM.globalv.nlocal; - - const char transN = 'N'; - const int one_int = 1; - const std::complex minus_half(-0.5, 0.0); - const std::complex zero(0.0, 0.0); - const std::complex one(1.0, 0.0); - - std::vector> dm_VU_sover(pv.nloc); - std::vector> dSR_k(pv.nloc); - - for (int dim1 = 0; dim1 < 3; dim1++) - { - for (int dim2 = dim1; dim2 < 3; dim2++) - { - this->folding_matrix_k(ucell, gd, fsr, pv, ik, dim1 + 4, dim2, &dSR_k[0], kvec_d); - -#ifdef __MPI - pzgemm_(&transN, - &transN, - &nlocal, - &nlocal, - &nlocal, - &minus_half, - rho_VU, - &one_int, - &one_int, - pv.desc, - &dSR_k[0], - &one_int, - &one_int, - pv.desc, - &zero, - &dm_VU_sover[0], - &one_int, - &one_int, - pv.desc); -#endif - - for (int ir = 0; ir < pv.nrow; ir++) - { - const int iwt1 = pv.local2global_row(ir); - for (int ic = 0; ic < pv.ncol; ic++) - { - const int iwt2 = pv.local2global_col(ic); - const int irc = ic * pv.nrow + ir; - - if (iwt1 == iwt2) - stress_dftu(dim1, dim2) += 2.0 * dm_VU_sover[irc].real(); - } // end ic - } // end ir - - } // end dim2 - } // end dim1 - ModuleBase::timer::tick("DFTU", "cal_stress_k"); - - return; -} - -void DFTU::cal_force_gamma(const UnitCell& ucell, - const double* rho_VU, - const Parallel_Orbitals& pv, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - ModuleBase::matrix& force_dftu) -{ - ModuleBase::TITLE("DFTU", "cal_force_gamma"); - ModuleBase::timer::tick("DFTU", "cal_force_gamma"); - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const double one = 1.0, zero = 0.0, minus_one = -1.0; - - std::vector dm_VU_dSm(pv.nloc); - - for (int dim = 0; dim < 3; dim++) - { - double* tmp_ptr; - if (dim == 0) - { - tmp_ptr = dsloc_x; - } - else if (dim == 1) - { - tmp_ptr = dsloc_y; - } - else if (dim == 2) - { - tmp_ptr = dsloc_z; - } - -#ifdef __MPI - pdgemm_(&transN, - &transT, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one, - tmp_ptr, - &one_int, - &one_int, - pv.desc, - rho_VU, - &one_int, - &one_int, - pv.desc, - &zero, - &dm_VU_dSm[0], - &one_int, - &one_int, - pv.desc); -#endif - - for (int ir = 0; ir < pv.nrow; ir++) - { - const int iwt1 = pv.local2global_row(ir); - const int iat1 = ucell.iwt2iat[iwt1]; - - for (int ic = 0; ic < pv.ncol; ic++) - { - const int iwt2 = pv.local2global_col(ic); - const int irc = ic * pv.nrow + ir; - - if (iwt1 == iwt2) - force_dftu(iat1, dim) += dm_VU_dSm[irc]; - - } // end ic - } // end ir - -#ifdef __MPI - pdgemm_(&transN, - &transT, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one, - tmp_ptr, - &one_int, - &one_int, - pv.desc, - rho_VU, - &one_int, - &one_int, - pv.desc, - &zero, - &dm_VU_dSm[0], - &one_int, - &one_int, - pv.desc); -#endif - - for (int it = 0; it < ucell.ntype; it++) - { - const int NL = ucell.atoms[it].nwl + 1; - const int LC = orbital_corr[it]; - - if (LC == -1) - continue; - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - const int iat = ucell.itia2iat(it, ia); - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[it]) - continue; - - const int N = ucell.atoms[it].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - if (n != 0) - continue; - - // Calculate the local occupation number matrix - for (int m = 0; m < 2 * l + 1; m++) - { - for (int ipol = 0; ipol < PARAM.globalv.npol; ipol++) - { - const int iwt = this->iatlnmipol2iwt[iat][l][n][m][ipol]; - const int mu = pv.global2local_row(iwt); - const int nu = pv.global2local_col(iwt); - if (mu < 0 || nu < 0) - continue; - - force_dftu(iat, dim) += dm_VU_dSm[nu * pv.nrow + mu]; - } - } // - } // n - } // l - } // ia - } // it - - } // end dim - ModuleBase::timer::tick("DFTU", "cal_force_gamma"); - - return; -} - -void DFTU::cal_stress_gamma(const UnitCell& ucell, - const Parallel_Orbitals& pv, - const Grid_Driver* gd, - double* dsloc_x, - double* dsloc_y, - double* dsloc_z, - double* dh_r, - const double* rho_VU, - ModuleBase::matrix& stress_dftu) -{ - ModuleBase::TITLE("DFTU", "cal_stress_gamma"); - ModuleBase::timer::tick("DFTU", "cal_stress_gamma"); - - const char transN = 'N'; - const int one_int = 1; - const double zero = 0.0; - const double minus_half = -0.5; - const double one = 1.0; - - std::vector dSR_gamma(pv.nloc); - std::vector dm_VU_sover(pv.nloc); - - const int nlocal = PARAM.globalv.nlocal; - - for (int dim1 = 0; dim1 < 3; dim1++) - { - for (int dim2 = dim1; dim2 < 3; dim2++) - { - this->fold_dSR_gamma(ucell, pv, gd, dsloc_x, dsloc_y, dsloc_z, dh_r, dim1, dim2, &dSR_gamma[0]); - -#ifdef __MPI - pdgemm_(&transN, - &transN, - &nlocal, - &nlocal, - &nlocal, - &minus_half, - rho_VU, - &one_int, - &one_int, - pv.desc, - &dSR_gamma[0], - &one_int, - &one_int, - pv.desc, - &zero, - &dm_VU_sover[0], - &one_int, - &one_int, - pv.desc); -#endif - - for (int ir = 0; ir < this->paraV->nrow; ir++) - { - const int iwt1 = this->paraV->local2global_row(ir); - - for (int ic = 0; ic < this->paraV->ncol; ic++) - { - const int iwt2 = this->paraV->local2global_col(ic); - const int irc = ic * this->paraV->nrow + ir; - - if (iwt1 == iwt2) - stress_dftu(dim1, dim2) += 2.0 * dm_VU_sover[irc]; - } // end ic - } // end ir - - } // end dim2 - } // end dim1 - ModuleBase::timer::tick("DFTU", "cal_stress_gamma"); - return; -} -} // namespace ModuleDFTU -#endif diff --git a/source/module_hamilt_lcao/module_dftu/dftu_hamilt.cpp b/source/module_hamilt_lcao/module_dftu/dftu_hamilt.cpp deleted file mode 100644 index d3beb62db9..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_hamilt.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "dftu.h" -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace ModuleDFTU -{ - -#ifdef __LCAO -void DFTU::cal_eff_pot_mat_complex(const int ik, std::complex* eff_pot, const std::vector& isk, const std::complex* sk) -{ - ModuleBase::TITLE("DFTU", "cal_eff_pot_mat"); - ModuleBase::timer::tick("DFTU", "cal_eff_pot_mat"); - if (!this->initialed_locale) - { - ModuleBase::timer::tick("DFTU", "cal_eff_pot_mat"); - return; - } - - int spin = isk[ik]; - - ModuleBase::GlobalFunc::ZEROS(eff_pot, this->paraV->nloc); - - //============================================================= - // PART2: call pblas to calculate effective potential matrix - //============================================================= - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const std::complex one(1.0, 0.0); - const std::complex half = 0.5; - const std::complex zero = 0.0; - - std::vector> VU(this->paraV->nloc); - this->cal_VU_pot_mat_complex(spin, true, &VU[0]); - -#ifdef __MPI - pzgemm_(&transN, &transN, - &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &half, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(VU), &one_int, &one_int, this->paraV->desc, - sk, &one_int, &one_int, this->paraV->desc, - &zero, - eff_pot, &one_int, &one_int, this->paraV->desc); -#endif - - for (int irc = 0; irc < this->paraV->nloc; irc++) - VU[irc] = eff_pot[irc]; - -#ifdef __MPI - pztranc_(&PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &one, - &VU[0], &one_int, &one_int, this->paraV->desc, - &one, - eff_pot, &one_int, &one_int, this->paraV->desc); -#endif - - ModuleBase::timer::tick("DFTU", "cal_eff_pot_mat"); - return; -} - -void DFTU::cal_eff_pot_mat_real(const int ik, double* eff_pot, const std::vector& isk, const double* sk) -{ - ModuleBase::TITLE("DFTU", "cal_eff_pot_mat"); - ModuleBase::timer::tick("DFTU", "cal_eff_pot_mat"); - if (!this->initialed_locale) - { - ModuleBase::timer::tick("DFTU", "cal_eff_pot_mat"); - return; - } - - int spin = isk[ik]; - - ModuleBase::GlobalFunc::ZEROS(eff_pot, this->paraV->nloc); - - //============================================================= - // PART2: call pblas to calculate effective potential matrix - //============================================================= - const char transN = 'N', transT = 'T'; - int one_int = 1; - double alpha = 1.0, beta = 0.0, half = 0.5, one = 1.0; - - std::vector VU(this->paraV->nloc); - this->cal_VU_pot_mat_real(spin, 1, &VU[0]); - -#ifdef __MPI - pdgemm_(&transN, &transN, - &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &half, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(VU), &one_int, &one_int, this->paraV->desc, - sk, &one_int, &one_int, this->paraV->desc, - &beta, - eff_pot, &one_int, &one_int, this->paraV->desc); -#endif - - for (int irc = 0; irc < this->paraV->nloc; irc++) - VU[irc] = eff_pot[irc]; - -#ifdef __MPI - pdtran_(&PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &one, - &VU[0], &one_int, &one_int, const_cast(this->paraV->desc), - &one, - eff_pot, &one_int, &one_int, const_cast(this->paraV->desc)); -#endif - - ModuleBase::timer::tick("DFTU", "cal_eff_pot_mat"); - return; -} - -void DFTU::cal_eff_pot_mat_R_double(const int ispin, double* SR, double* HR) -{ - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const double alpha = 1.0, beta = 0.0, one = 1.0, half = 0.5; - - std::vector VU(this->paraV->nloc); - this->cal_VU_pot_mat_real(ispin, 1, &VU[0]); - -#ifdef __MPI - pdgemm_(&transN, &transN, - &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &half, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(VU), &one_int, &one_int, this->paraV->desc, - SR, &one_int, &one_int, this->paraV->desc, - &beta, - HR, &one_int, &one_int, this->paraV->desc); - - pdgemm_(&transN, &transN, - &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &half, - SR, &one_int, &one_int, this->paraV->desc, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(VU), &one_int, &one_int, this->paraV->desc, - &one, - HR, &one_int, &one_int, this->paraV->desc); -#endif - - return; -} - -void DFTU::cal_eff_pot_mat_R_complex_double(const int ispin, std::complex* SR, std::complex* HR) -{ - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const std::complex zero = 0.0, one = 1.0, half = 0.5; - - std::vector> VU(this->paraV->nloc); - this->cal_VU_pot_mat_complex(ispin, 1, &VU[0]); - -#ifdef __MPI - pzgemm_(&transN, &transN, - &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &half, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(VU), &one_int, &one_int, this->paraV->desc, - SR, &one_int, &one_int, this->paraV->desc, - &zero, - HR, &one_int, &one_int, this->paraV->desc); - - pzgemm_(&transN, &transN, - &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, &PARAM.globalv.nlocal, - &half, - SR, &one_int, &one_int, this->paraV->desc, - ModuleBase::GlobalFunc::VECTOR_TO_PTR(VU), &one_int, &one_int, this->paraV->desc, - &one, - HR, &one_int, &one_int, this->paraV->desc); -#endif - - return; -} - -#endif -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_dftu/dftu_io.cpp b/source/module_hamilt_lcao/module_dftu/dftu_io.cpp deleted file mode 100644 index bd0066daf0..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_io.cpp +++ /dev/null @@ -1,516 +0,0 @@ -#include "dftu.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace ModuleDFTU -{ - -void DFTU::output(const UnitCell &ucell) -{ - ModuleBase::TITLE("DFTU", "output"); - - GlobalV::ofs_running << "//=========================L(S)DA+U===========================//" << std::endl; - - for (int T = 0; T < ucell.ntype; T++) - { - const int NL = ucell.atoms[T].nwl + 1; - - for (int L = 0; L < NL; L++) - { - const int N = ucell.atoms[T].l_nchi[L]; - - if (L >= orbital_corr[T] && orbital_corr[T] != -1) - { - if (L != orbital_corr[T]) { - continue; -} - - if (!Yukawa) - { - GlobalV::ofs_running << "atom_type=" << T << " L=" << L << " chi=" << 0 - << " U=" << this->U[T] * ModuleBase::Ry_to_eV << "eV" << std::endl; - } - else - { - for (int n = 0; n < N; n++) - { - if (n != 0) { - continue; -} - double Ueff = (this->U_Yukawa[T][L][n] - this->J_Yukawa[T][L][n]) * ModuleBase::Ry_to_eV; - GlobalV::ofs_running << "atom_type=" << T << " L=" << L << " chi=" << n - << " U=" << this->U_Yukawa[T][L][n] * ModuleBase::Ry_to_eV << "eV " - << "J=" << this->J_Yukawa[T][L][n] * ModuleBase::Ry_to_eV << "eV" - << std::endl; - } - } - } - } - } - - GlobalV::ofs_running << "Local occupation matrices" << std::endl; - this->write_occup_m(ucell,GlobalV::ofs_running, true); - GlobalV::ofs_running << "//=======================================================//" << std::endl; - - //Write onsite.dm - std::ofstream ofdftu; - if(PARAM.inp.out_chg[0]){ - if(GlobalV::MY_RANK == 0){ - ofdftu.open(PARAM.globalv.global_out_dir + "onsite.dm"); - } - } - if(!ofdftu){ - std::cout << "DFTU::write_occup_m. Can't create file onsite.dm!" << std::endl; - exit(0); - } - this->write_occup_m(ucell,ofdftu); - ofdftu.close(); - - return; -} - -// define the function calculate the eigenvalues of a matrix -std::vector CalculateEigenvalues(std::vector>& A, int n); - -void DFTU::write_occup_m(const UnitCell& ucell, - std::ofstream &ofs, - bool diag) -{ - ModuleBase::TITLE("DFTU", "write_occup_m"); - - if(GlobalV::MY_RANK != 0) { return; -} - - for (int T = 0; T < ucell.ntype; T++) - { - if (orbital_corr[T] == -1) { - continue; -} - const int NL = ucell.atoms[T].nwl + 1; - const int LC = orbital_corr[T]; - - for (int I = 0; I < ucell.atoms[T].na; I++) - { - const int iat = ucell.itia2iat(T, I); - ofs << "atoms" - << " " << iat << std::endl; - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[T]) { - continue; -} - - const int N = ucell.atoms[T].l_nchi[l]; - ofs << "L" - << " " << l << std::endl; - - for (int n = 0; n < N; n++) - { - // if(!Yukawa && n!=0) continue; - if (n != 0) { - continue; -} - - ofs << "zeta" - << " " << n << std::endl; - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - double sum0[2]; - for (int is = 0; is < 2; is++) - { - if(diag)// diagonalization for local occupation matrix and print the eigenvalues - { - std::vector> A(2 * l + 1, std::vector(2 * l + 1)); - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - A[m0][m1] = locale[iat][l][n][is](m0, m1); - } - } - std::vector eigenvalues = CalculateEigenvalues(A, 2 * l + 1); - sum0[is] = 0.0; - ofs<< "eigenvalues" - << " " << is << std::endl; - for (int i = 0; i < 2 * l + 1; i++) - { - ofs << std::setw(12) << std::setprecision(8) << std::fixed - << eigenvalues[i]; - sum0[is] += eigenvalues[i]; - } - ofs << std::setw(12) << std::setprecision(8) << std::fixed - << sum0[is] << std::endl; - } - ofs << "spin" - << " " << is << std::endl; - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - ofs << std::setw(12) << std::setprecision(8) << std::fixed - << locale[iat][l][n][is](m0, m1); - } - ofs << std::endl; - } - } - if(diag) - { - ofs << std::setw(12) << std::setprecision(8) << std::fixed<< "atomic mag: "<> A(2 * l + 1, std::vector(2 * l + 1)); - int index = 0; - for(int is=0;is<4;is++) - { - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - A[m0][m1] = locale[iat][l][n][0].c[index]; - index++; - } - } - std::vector eigenvalues = CalculateEigenvalues(A, 2 * l + 1); - sum0[is] = 0.0; - ofs<< "eigenvalues" - << " " << is << std::endl; - for (int i = 0; i < 2 * l + 1; i++) - { - ofs << std::setw(12) << std::setprecision(8) << std::fixed - << eigenvalues[i]; - sum0[is] += eigenvalues[i]; - } - ofs << std::setw(12) << std::setprecision(8) << std::fixed - << sum0[is] << std::endl; - } - ofs << std::setw(12) << std::setprecision(8) << std::fixed<< "atomic mag: "< 0) - { - std::cout - << "DFTU::read_occup_m. Can not find the file initial_onsite.dm . Please check your initial_onsite.dm" - << std::endl; - } - else - { - if (PARAM.inp.init_chg == "file") - { - std::cout << "DFTU::read_occup_m. Can not find the file onsite.dm . Please do scf calculation first" - << std::endl; - } - } - exit(0); - } - - ifdftu.clear(); - ifdftu.seekg(0); - - char word[10]; - - int T, iat, spin, L, zeta; - - ifdftu.rdstate(); - - while (ifdftu.good()) - { - ifdftu >> word; - if (ifdftu.eof()) { - break; -} - - if (strcmp("atoms", word) == 0) - { - ifdftu >> iat; - ifdftu.ignore(150, '\n'); - - T = ucell.iat2it[iat]; - const int NL = ucell.atoms[T].nwl + 1; - const int LC = orbital_corr[T]; - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[T]) { - continue; -} - - ifdftu >> word; - - if (strcmp("L", word) == 0) - { - ifdftu >> L; - ifdftu.ignore(150, '\n'); - - const int N = ucell.atoms[T].l_nchi[L]; - for (int n = 0; n < N; n++) - { - // if(!Yukawa && n!=0) continue; - if (n != 0) { - continue; -} - - ifdftu >> word; - if (strcmp("zeta", word) == 0) - { - ifdftu >> zeta; - ifdftu.ignore(150, '\n'); - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - for (int is = 0; is < 2; is++) - { - ifdftu >> word; - if (strcmp("spin", word) == 0) - { - ifdftu >> spin; - ifdftu.ignore(150, '\n'); - - double value = 0.0; - for (int m0 = 0; m0 < 2 * L + 1; m0++) - { - for (int m1 = 0; m1 < 2 * L + 1; m1++) - { - ifdftu >> value; - locale[iat][L][zeta][spin](m0, m1) = value; - } - ifdftu.ignore(150, '\n'); - } - } - else - { - std::cout << "WRONG IN READING LOCAL OCCUPATION NUMBER MATRIX FROM DFTU FILE" - << std::endl; - exit(0); - } - } - } - else if (PARAM.inp.nspin == 4) // SOC - { - double value = 0.0; - for (int m0 = 0; m0 < 2 * L + 1; m0++) - { - for (int ipol0 = 0; ipol0 < PARAM.globalv.npol; ipol0++) - { - const int m0_all = m0 + (2 * L + 1) * ipol0; - - for (int m1 = 0; m1 < 2 * L + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - int m1_all = m1 + (2 * L + 1) * ipol1; - ifdftu >> value; - locale[iat][L][zeta][0](m0_all, m1_all) = value; - } - } - ifdftu.ignore(150, '\n'); - } - } - } - } - else - { - std::cout << "WRONG IN READING LOCAL OCCUPATION NUMBER MATRIX FROM DFTU FILE" << std::endl; - exit(0); - } - } - } - else - { - std::cout << "WRONG IN READING LOCAL OCCUPATION NUMBER MATRIX FROM DFTU FILE" << std::endl; - exit(0); - } - } - } - else - { - std::cout << "WRONG IN READING LOCAL OCCUPATION NUMBER MATRIX FROM DFTU FILE" << std::endl; - exit(0); - } - - ifdftu.rdstate(); - - if (ifdftu.eof() != 0) - { - break; - } - } - - return; -} - -void DFTU::local_occup_bcast(const UnitCell& ucell) -{ - ModuleBase::TITLE("DFTU", "local_occup_bcast"); - - for (int T = 0; T < ucell.ntype; T++) - { - if (orbital_corr[T] == -1) { - continue; -} - - for (int I = 0; I < ucell.atoms[T].na; I++) - { - const int iat = ucell.itia2iat(T, I); - const int L = orbital_corr[T]; - - for (int l = 0; l <= ucell.atoms[T].nwl; l++) - { - if (l != orbital_corr[T]) { - continue; -} - - for (int n = 0; n < ucell.atoms[T].l_nchi[l]; n++) - { - // if(!Yukawa && n!=0) continue; - if (n != 0) { - continue; -} - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - for (int spin = 0; spin < 2; spin++) - { - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { -#ifdef __MPI - MPI_Bcast(&locale[iat][l][n][spin](m0, m1), 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); -#endif - } - } - } - } - else if (PARAM.inp.nspin == 4) // SOC - { - for (int m0 = 0; m0 < 2 * L + 1; m0++) - { - for (int ipol0 = 0; ipol0 < PARAM.globalv.npol; ipol0++) - { - const int m0_all = m0 + (2 * L + 1) * ipol0; - - for (int m1 = 0; m1 < 2 * L + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - int m1_all = m1 + (2 * L + 1) * ipol1; -#ifdef __MPI - MPI_Bcast(&locale[iat][l][n][0](m0_all, m1_all), - 1, - MPI_DOUBLE, - 0, - MPI_COMM_WORLD); -#endif - } - } - } - } - } - } - } - } - } - return; -} - -inline void JacobiRotate(std::vector>& A, int p, int q, int n) { - if (std::abs(A[p][q]) > 1e-10) { - double r = (A[q][q] - A[p][p]) / (2.0 * A[p][q]); - double t; - if (r >= 0) { - t = 1.0 / (r + sqrt(1.0 + r * r)); - } else { - t = -1.0 / (-r + sqrt(1.0 + r * r)); - } - double c = 1.0 / sqrt(1.0 + t * t); - double s = t * c; - - A[p][p] -= t * A[p][q]; - A[q][q] += t * A[p][q]; - A[p][q] = A[q][p] = 0.0; - - for (int k = 0; k < n; k++) { - if (k != p && k != q) { - double Akp = c * A[k][p] - s * A[k][q]; - double Akq = s * A[k][p] + c * A[k][q]; - A[k][p] = A[p][k] = Akp; - A[k][q] = A[q][k] = Akq; - } - } - } -} - -inline std::vector CalculateEigenvalues(std::vector>& A, int n) { - std::vector eigenvalues(n); - while (true) { - int p = 0, q = 1; - for (int i = 0; i < n; i++) { - for (int j = i + 1; j < n; j++) { - if (std::abs(A[i][j]) > std::abs(A[p][q])) { - p = i; - q = j; - } - } - } - - if (std::abs(A[p][q]) < 1e-10) { - for (int i = 0; i < n; i++) { - eigenvalues[i] = A[i][i]; - } - break; - } - - JacobiRotate(A, p, q, n); - } - return eigenvalues; -} -} // namespace ModuleDFTU \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_dftu/dftu_occup.cpp b/source/module_hamilt_lcao/module_dftu/dftu_occup.cpp deleted file mode 100644 index 60106efa8d..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_occup.cpp +++ /dev/null @@ -1,565 +0,0 @@ -#include "dftu.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" -#ifdef __LCAO -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#endif -#include "source_base/scalapack_connector.h" - -namespace ModuleDFTU -{ -void DFTU::copy_locale(const UnitCell& ucell) -{ - ModuleBase::TITLE("DFTU", "copy_locale"); - ModuleBase::timer::tick("DFTU", "copy_locale"); - - for (int T = 0; T < ucell.ntype; T++) - { - if (orbital_corr[T] == -1) - { - continue; - } - - for (int I = 0; I < ucell.atoms[T].na; I++) - { - const int iat = ucell.itia2iat(T, I); - - for (int l = 0; l < ucell.atoms[T].nwl + 1; l++) - { - const int N = ucell.atoms[T].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - if (PARAM.inp.nspin == 4) - { - locale_save[iat][l][n][0] = locale[iat][l][n][0]; - } - else if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - locale_save[iat][l][n][0] = locale[iat][l][n][0]; - locale_save[iat][l][n][1] = locale[iat][l][n][1]; - } - } - } - } - } - ModuleBase::timer::tick("DFTU", "copy_locale"); -} - -void DFTU::zero_locale(const UnitCell& ucell) -{ - ModuleBase::TITLE("DFTU", "zero_locale"); - ModuleBase::timer::tick("DFTU", "zero_locale"); - - for (int T = 0; T < ucell.ntype; T++) - { - if (orbital_corr[T] == -1) - { - continue; - } - - for (int I = 0; I < ucell.atoms[T].na; I++) - { - const int iat = ucell.itia2iat(T, I); - - for (int l = 0; l < ucell.atoms[T].nwl + 1; l++) - { - const int N = ucell.atoms[T].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - if (PARAM.inp.nspin == 4) - { - locale[iat][l][n][0].zero_out(); - } - else if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - locale[iat][l][n][0].zero_out(); - locale[iat][l][n][1].zero_out(); - } - } - } - } - } - ModuleBase::timer::tick("DFTU", "zero_locale"); -} - -void DFTU::mix_locale(const UnitCell& ucell, - const double& mixing_beta) -{ - ModuleBase::TITLE("DFTU", "mix_locale"); - ModuleBase::timer::tick("DFTU", "mix_locale"); - - double beta = mixing_beta; - - for (int T = 0; T < ucell.ntype; T++) - { - if (orbital_corr[T] == -1) - { - continue; - } - - for (int I = 0; I < ucell.atoms[T].na; I++) - { - const int iat = ucell.itia2iat(T, I); - - for (int l = 0; l < ucell.atoms[T].nwl + 1; l++) - { - const int N = ucell.atoms[T].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - if (PARAM.inp.nspin == 4) - { - locale[iat][l][n][0] = locale[iat][l][n][0]*beta + locale_save[iat][l][n][0]*(1.0-beta); - } - else if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - locale[iat][l][n][0] = locale[iat][l][n][0] * beta + locale_save[iat][l][n][0] * (1.0-beta); - locale[iat][l][n][1] = locale[iat][l][n][1] * beta + locale_save[iat][l][n][1] * (1.0-beta); - } - } - } - } - } - ModuleBase::timer::tick("DFTU", "mix_locale"); -} - -#ifdef __LCAO - -void DFTU::cal_occup_m_k(const int iter, - const UnitCell& ucell, - const std::vector>>& dm_k, - const K_Vectors& kv, - const double& mixing_beta, - hamilt::Hamilt>* p_ham) -{ - ModuleBase::TITLE("DFTU", "cal_occup_m_k"); - ModuleBase::timer::tick("DFTU", "cal_occup_m_k"); - - this->copy_locale(ucell); - this->zero_locale(ucell); - - //=================Part 1====================== - // call SCALAPACK routine to calculate the product of the S and density matrix - const char transN = 'N'; - const char transT = 'T'; - const int one_int = 1; - const std::complex beta(0.0,0.0), alpha(1.0,0.0); - - std::vector> srho(this->paraV->nloc); - - for (int ik = 0; ik < kv.get_nks(); ik++) - { - // srho(mu,nu) = \sum_{iw} S(mu,iw)*dm_k(iw,nu) - this->folding_matrix_k_new(ik, p_ham); - - std::complex* s_k_pointer = nullptr; - - if(PARAM.inp.nspin != 4) - { - s_k_pointer = dynamic_cast, double>*>(p_ham)->getSk(); - } - else - { - s_k_pointer = dynamic_cast, std::complex>*>(p_ham)->getSk(); - } - -#ifdef __MPI - ScalapackConnector::gemm(transN, - transT, - PARAM.globalv.nlocal, - PARAM.globalv.nlocal, - PARAM.globalv.nlocal, - alpha, - s_k_pointer, - one_int, - one_int, - &this->paraV->desc[0], - dm_k[ik].data(), - //dm_k[ik].c, - one_int, - one_int, - &this->paraV->desc[0], - beta, - srho.data(), - one_int, - one_int, - &this->paraV->desc[0]); - /*pzgemm_(&transN, - &transT, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &alpha, - s_k_pointer, - &one_int, - &one_int, - this->paraV->desc, - dm_k[ik].data(), - //dm_k[ik].c, - &one_int, - &one_int, - this->paraV->desc, - &beta, - &srho[0], - &one_int, - &one_int, - this->paraV->desc);*/ -#endif - - const int spin = kv.isk[ik]; - for (int it = 0; it < ucell.ntype; it++) - { - const int NL = ucell.atoms[it].nwl + 1; - const int LC = orbital_corr[it]; - - if (LC == -1) - { - continue; - } - - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - const int iat = ucell.itia2iat(it, ia); - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[it]) - { - continue; - } - - const int N = ucell.atoms[it].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - // if(!Yukawa && n!=0) continue; - if (n != 0) - { - continue; - } - - // Calculate the local occupation number matrix - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int ipol0 = 0; ipol0 < PARAM.globalv.npol; ipol0++) - { - const int iwt0 = this->iatlnmipol2iwt[iat][l][n][m0][ipol0]; - const int mu = this->paraV->global2local_row(iwt0); - const int mu_prime = this->paraV->global2local_col(iwt0); - - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - const int iwt1 = this->iatlnmipol2iwt[iat][l][n][m1][ipol1]; - const int nu = this->paraV->global2local_col(iwt1); - const int nu_prime = this->paraV->global2local_row(iwt1); - - const int irc = nu * this->paraV->nrow + mu; - const int irc_prime = mu_prime * this->paraV->nrow + nu_prime; - - const int m0_all = m0 + ipol0 * (2 * l + 1); - const int m1_all = m1 + ipol1 * (2 * l + 1); - - if ((nu >= 0) && (mu >= 0)) - { - locale[iat][l][n][spin](m0_all, m1_all) += (srho[irc]).real() / 4.0; - } - - if ((nu_prime >= 0) && (mu_prime >= 0)) - { - locale[iat][l][n][spin](m0_all, m1_all) - += (std::conj(srho[irc_prime])).real() / 4.0; - } - } // ipol1 - } // m1 - } // ipol0 - } // m0 - } // end n - } // end l - } // end ia - } // end it - } // ik - - for (int it = 0; it < ucell.ntype; it++) - { - const int NL = ucell.atoms[it].nwl + 1; - const int LC = orbital_corr[it]; - - if (LC == -1) - { - continue; - } - - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - const int iat = ucell.itia2iat(it, ia); - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[it]) - { - continue; - } - - const int N = ucell.atoms[it].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - // if(!Yukawa && n!=0) continue; - if (n != 0) - { - continue; - } - // set the local occupation mumber matrix of spin up and down zeros - -#ifdef __MPI - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - ModuleBase::matrix temp(locale[iat][l][n][0]); - MPI_Allreduce(&temp(0, 0), - &locale[iat][l][n][0](0, 0), - (2 * l + 1) * PARAM.globalv.npol * (2 * l + 1) * PARAM.globalv.npol, - MPI_DOUBLE, - MPI_SUM, - MPI_COMM_WORLD); - } - else if (PARAM.inp.nspin == 2) - { - ModuleBase::matrix temp0(locale[iat][l][n][0]); - MPI_Allreduce(&temp0(0, 0), - &locale[iat][l][n][0](0, 0), - (2 * l + 1) * (2 * l + 1), - MPI_DOUBLE, - MPI_SUM, - MPI_COMM_WORLD); - - ModuleBase::matrix temp1(locale[iat][l][n][1]); - MPI_Allreduce(&temp1(0, 0), - &locale[iat][l][n][1](0, 0), - (2 * l + 1) * (2 * l + 1), - MPI_DOUBLE, - MPI_SUM, - MPI_COMM_WORLD); - } -#endif - - // for the case spin independent calculation - switch (PARAM.inp.nspin) - { - case 1: - locale[iat][l][n][0] += transpose(locale[iat][l][n][0]); - locale[iat][l][n][0] *= 0.5; - locale[iat][l][n][1] += locale[iat][l][n][0]; - break; - - case 2: - for (int is = 0; is < PARAM.inp.nspin; is++) - locale[iat][l][n][is] += transpose(locale[iat][l][n][is]); - break; - - case 4: // SOC - locale[iat][l][n][0] += transpose(locale[iat][l][n][0]); - break; - - default: - std::cout << "Not supported NSPIN parameter" << std::endl; - exit(0); - } - } // end n - } // end l - } // end ia - } // end it - - if(mixing_dftu && initialed_locale) - { - this->mix_locale(ucell,mixing_beta); - } - - this->initialed_locale = true; - ModuleBase::timer::tick("DFTU", "cal_occup_m_k"); - return; -} - -void DFTU::cal_occup_m_gamma(const int iter, - const UnitCell &ucell, - const std::vector> &dm_gamma, - const double& mixing_beta, - hamilt::Hamilt* p_ham) -{ - ModuleBase::TITLE("DFTU", "cal_occup_m_gamma"); - ModuleBase::timer::tick("DFTU", "cal_occup_m_gamma"); - this->copy_locale(ucell); - this->zero_locale(ucell); - - //=================Part 1====================== - // call PBLAS routine to calculate the product of the S and density matrix - char transN = 'N', transT = 'T'; - const int one_int = 1; - const double alpha = 1.0, beta = 0.0; - - std::vector srho(this->paraV->nloc); - for (int is = 0; is < PARAM.inp.nspin; is++) - { - // srho(mu,nu) = \sum_{iw} S(mu,iw)*dm_gamma(iw,nu) - double* s_gamma_pointer = dynamic_cast*>(p_ham)->getSk(); - -#ifdef __MPI - ScalapackConnector::gemm(transN, - transT, - PARAM.globalv.nlocal, - PARAM.globalv.nlocal, - PARAM.globalv.nlocal, - alpha, - s_gamma_pointer, - one_int, - one_int, - &this->paraV->desc[0], - dm_gamma[is].data(), - //dm_gamma[is].c, - one_int, - one_int, - &this->paraV->desc[0], - beta, - srho.data(), - one_int, - one_int, - &this->paraV->desc[0]); - /*pdgemm_(&transN, - &transT, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &alpha, - s_gamma_pointer, - &one_int, - &one_int, - this->paraV->desc, - dm_gamma[is].data(), - //dm_gamma[is].c, - &one_int, - &one_int, - this->paraV->desc, - &beta, - &srho[0], - &one_int, - &one_int, - this->paraV->desc);*/ -#endif - - for (int it = 0; it < ucell.ntype; it++) - { - const int NL = ucell.atoms[it].nwl + 1; - if (orbital_corr[it] == -1) - { - continue; - } - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - const int iat = ucell.itia2iat(it, ia); - - for (int l = 0; l < NL; l++) - { - if (l != orbital_corr[it]) - { - continue; - } - - const int N = ucell.atoms[it].l_nchi[l]; - - for (int n = 0; n < N; n++) - { - if (n != 0) - { - continue; - } - - // Calculate the local occupation number matrix - for (int m0 = 0; m0 < 2 * l + 1; m0++) - { - for (int ipol0 = 0; ipol0 < PARAM.globalv.npol; ipol0++) - { - const int iwt0 = this->iatlnmipol2iwt[iat][l][n][m0][ipol0]; - const int mu = this->paraV->global2local_row(iwt0); - const int mu_prime = this->paraV->global2local_col(iwt0); - - for (int m1 = 0; m1 < 2 * l + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - const int iwt1 = this->iatlnmipol2iwt[iat][l][n][m1][ipol1]; - const int nu = this->paraV->global2local_col(iwt1); - const int nu_prime = this->paraV->global2local_row(iwt1); - - const int irc = nu * this->paraV->nrow + mu; - const int irc_prime = mu_prime * this->paraV->nrow + nu_prime; - - if ((nu >= 0) && (mu >= 0)) - { - int m0_all = m0 + (2 * l + 1) * ipol0; - int m1_all = m0 + (2 * l + 1) * ipol1; - - locale[iat][l][n][is](m0, m1) += srho[irc] / 4.0; - } - - if ((nu_prime >= 0) && (mu_prime >= 0)) - { - int m0_all = m0 + (2 * l + 1) * ipol0; - int m1_all = m0 + (2 * l + 1) * ipol1; - - locale[iat][l][n][is](m0, m1) += srho[irc_prime] / 4.0; - } - } - } - } - } - - ModuleBase::matrix temp(locale[iat][l][n][is]); - -#ifdef __MPI - MPI_Allreduce(&temp(0, 0), - &locale[iat][l][n][is](0, 0), - (2 * l + 1) * PARAM.globalv.npol * (2 * l + 1) * PARAM.globalv.npol, - MPI_DOUBLE, - MPI_SUM, - MPI_COMM_WORLD); -#endif - - // for the case spin independent calculation - switch (PARAM.inp.nspin) - { - case 1: - locale[iat][l][n][0] += transpose(locale[iat][l][n][0]); - locale[iat][l][n][0] *= 0.5; - locale[iat][l][n][1] += locale[iat][l][n][0]; - break; - - case 2: - locale[iat][l][n][is] += transpose(locale[iat][l][n][is]); - break; - - default: - std::cout << "Not supported NSPIN parameter" << std::endl; - exit(0); - } - - } // end for(n) - } // L - } // ia - } // it - } // is - - if(mixing_dftu && initialed_locale) - { - this->mix_locale(ucell,mixing_beta); - } - - this->initialed_locale = true; - ModuleBase::timer::tick("DFTU", "cal_occup_m_gamma"); - return; -} -#endif -} // namespace ModuleDFTU diff --git a/source/module_hamilt_lcao/module_dftu/dftu_pw.cpp b/source/module_hamilt_lcao/module_dftu/dftu_pw.cpp deleted file mode 100644 index 164b4dd30f..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_pw.cpp +++ /dev/null @@ -1,212 +0,0 @@ -#include "dftu.h" -#include "source_pw/hamilt_pwdft/onsite_projector.h" -#include "source_base/parallel_reduce.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" - - -namespace ModuleDFTU -{ -DFTU* DFTU::get_instance() -{ - return &GlobalC::dftu; -} -/// calculate occupation matrix for DFT+U -void DFTU::cal_occ_pw(const int iter, const void* psi_in, const ModuleBase::matrix& wg_in, const UnitCell& cell, const double& mixing_beta) -{ - ModuleBase::timer::tick("DFTU", "cal_occ_pw"); - this->copy_locale(cell); - this->zero_locale(cell); - - if(PARAM.inp.device == "cpu") - { - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - const psi::Psi>* psi_p = (const psi::Psi>*)psi_in; - // loop over k-points to calculate Mi of \sum_{k,i,l,m} - const int nbands = psi_p->get_nbands(); - for(int ik = 0; ik < psi_p->get_nk(); ik++) - { - psi_p->fix_k(ik); - onsite_p->tabulate_atomic(ik); - - onsite_p->overlap_proj_psi(nbands*psi_p->get_npol(), psi_p->get_pointer()); - const std::complex* becp = onsite_p->get_h_becp(); - // becp(nbands*npol , nkb) - // mag = wg * \sum_{nh}becp * becp - int nkb = onsite_p->get_size_becp() / nbands / psi_p->get_npol(); - int begin_ih = 0; - for(int iat = 0; iat < cell.nat; iat++) - { - const int it = cell.iat2it[iat]; - const int nh = onsite_p->get_nh(iat); - const int target_l = this->orbital_corr[it]; - if(target_l == -1) - { - begin_ih += nh; - continue; - } - // m = l^2, l^2+1, ..., (l+1)^2-1 - const int m_begin = target_l * target_l; - const int tlp1 = 2 * target_l + 1; - const int tlp1_2 = tlp1 * tlp1; - for(int ib = 0;ib occ[4]; - occ[0] = weight * conj(becp[index_m1]) * becp[index_m2]; - occ[1] = weight * conj(becp[index_m1]) * becp[index_m2 + nkb]; - occ[2] = weight * conj(becp[index_m1 + nkb]) * becp[index_m2]; - occ[3] = weight * conj(becp[index_m1 + nkb]) * becp[index_m2 + nkb]; - this->locale[iat][target_l][0][0].c[ind_m1m2] += (occ[0] + occ[3]).real(); - this->locale[iat][target_l][0][0].c[ind_m1m2 + tlp1_2] += (occ[1] + occ[2]).real(); - this->locale[iat][target_l][0][0].c[ind_m1m2 + 2 * tlp1_2] += (occ[1] - occ[2]).imag(); - this->locale[iat][target_l][0][0].c[ind_m1m2 + 3 * tlp1_2] += (occ[0] - occ[3]).real(); - ind_m1m2++; - } - } - }// ib - begin_ih += nh; - }// iat - }// ik - } -#if defined(__CUDA) || defined(__ROCM) - else - { - auto* onsite_p = projectors::OnsiteProjector::get_instance(); - const psi::Psi, base_device::DEVICE_GPU>* psi_p = (const psi::Psi, base_device::DEVICE_GPU>*)psi_in; - // loop over k-points to calculate Mi of \sum_{k,i,l,m} - const int nbands = psi_p->get_nbands(); - for(int ik = 0; ik < psi_p->get_nk(); ik++) - { - psi_p->fix_k(ik); - onsite_p->tabulate_atomic(ik); - - onsite_p->overlap_proj_psi(nbands*psi_p->get_npol(), psi_p->get_pointer()); - const std::complex* becp = onsite_p->get_h_becp(); - // becp(nbands*npol , nkb) - // mag = wg * \sum_{nh}becp * becp - int nkb = onsite_p->get_size_becp() / nbands / psi_p->get_npol(); - int begin_ih = 0; - for(int iat = 0; iat < cell.nat; iat++) - { - const int it = cell.iat2it[iat]; - const int nh = onsite_p->get_nh(iat); - const int target_l = this->orbital_corr[it]; - if(target_l == -1) - { - begin_ih += nh; - continue; - } - // m = l^2, l^2+1, ..., (l+1)^2-1 - const int m_begin = target_l * target_l; - const int tlp1 = 2 * target_l + 1; - const int tlp1_2 = tlp1 * tlp1; - for(int ib = 0;ib occ[4]; - occ[0] = weight * conj(becp[index_m1]) * becp[index_m2]; - occ[1] = weight * conj(becp[index_m1]) * becp[index_m2 + nkb]; - occ[2] = weight * conj(becp[index_m1 + nkb]) * becp[index_m2]; - occ[3] = weight * conj(becp[index_m1 + nkb]) * becp[index_m2 + nkb]; - this->locale[iat][target_l][0][0].c[ind_m1m2] += (occ[0] + occ[3]).real(); - this->locale[iat][target_l][0][0].c[ind_m1m2 + tlp1_2] += (occ[1] + occ[2]).real(); - this->locale[iat][target_l][0][0].c[ind_m1m2 + 2 * tlp1_2] += (occ[1] - occ[2]).imag(); - this->locale[iat][target_l][0][0].c[ind_m1m2 + 3 * tlp1_2] += (occ[0] - occ[3]).real(); - ind_m1m2++; - } - } - }// ib - begin_ih += nh; - }// iat - }// ik - } -#endif - - this->EU = 0.0; - // reduce mag from all k-pools - for(int iat = 0; iat < cell.nat; iat++) - { - const int it = cell.iat2it[iat]; - const int target_l = this->orbital_corr[it]; - if(target_l == -1) - { - continue; - } - const int size = (2 * target_l + 1) * (2 * target_l + 1); - Parallel_Reduce::reduce_double_allpool(PARAM.inp.kpar, PARAM.globalv.nproc_in_pool, this->locale[iat][target_l][0][0].c, size * PARAM.inp.nspin); - //update effective potential - const double u_value = this->U[it]; - std::complex* vu_iat = &(this->eff_pot_pw[this->eff_pot_pw_index[iat]]); - const int m_size = 2 * target_l + 1; - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - vu_iat[m1 * m_size + m2] = u_value * (1.0 * (m1 == m2) - this->locale[iat][target_l][0][0].c[m2 * m_size + m1]); - this->EU += u_value * 0.25 * this->locale[iat][target_l][0][0].c[m2 * m_size + m1] * this->locale[iat][target_l][0][0].c[m1 * m_size + m2]; - } - } - for (int is = 1; is < 4; ++is) - { - int start = is * m_size * m_size; - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - vu_iat[start + m1 * m_size + m2] = u_value * (0 - this->locale[iat][target_l][0][0].c[start + m2 * m_size + m1]); - this->EU += u_value * 0.25 * this->locale[iat][target_l][0][0].c[start + m2 * m_size + m1] * this->locale[iat][target_l][0][0].c[start + m1 * m_size + m2]; - } - } - } - // transfer from Pauli matrix representation to spin representation - for (int m1 = 0; m1 < m_size; m1++) - { - for (int m2 = 0; m2 < m_size; m2++) - { - int index[4]; - index[0] = m1 * m_size + m2; - index[1] = m1 * m_size + m2 + size; - index[2] = m1 * m_size + m2 + size * 2; - index[3] = m1 * m_size + m2 + size * 3; - std::complex vu_tmp[4]; - for (int i = 0; i < 4; i++) - { - vu_tmp[i] = vu_iat[index[i]]; - } - vu_iat[index[0]] = 0.5 * (vu_tmp[0] + vu_tmp[3]); - vu_iat[index[3]] = 0.5 * (vu_tmp[0] - vu_tmp[3]); - vu_iat[index[1]] = 0.5 * (vu_tmp[1] + std::complex(0.0, 1.0) * vu_tmp[2]); - vu_iat[index[2]] = 0.5 * (vu_tmp[1] - std::complex(0.0, 1.0) * vu_tmp[2]); - } - } - } - - if(mixing_dftu && initialed_locale) - { - this->mix_locale(cell, mixing_beta); - } - // update effective potential - ModuleBase::timer::tick("DFTU", "cal_occ_pw"); -} -/// calculate the local DFT+U effective potential matrix for PW base. -void DFTU::cal_VU_pot_pw(const int spin) -{ - -} - -} // namespace ModuleDFTU \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_dftu/dftu_tools.cpp b/source/module_hamilt_lcao/module_dftu/dftu_tools.cpp deleted file mode 100644 index 86cd22f35f..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_tools.cpp +++ /dev/null @@ -1,216 +0,0 @@ -#include "dftu.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace ModuleDFTU -{ - -#ifdef __LCAO -void DFTU::cal_VU_pot_mat_complex(const int spin, const bool newlocale, std::complex* VU) -{ - ModuleBase::TITLE("DFTU", "cal_VU_pot_mat_complex"); - ModuleBase::GlobalFunc::ZEROS(VU, this->paraV->nloc); - - for (int it = 0; it < this->ucell->ntype; ++it) - { - if (PARAM.inp.orbital_corr[it] == -1) - { - continue; - } - for (int ia = 0; ia < this->ucell->atoms[it].na; ia++) - { - const int iat = this->ucell->itia2iat(it, ia); - for (int L = 0; L <= this->ucell->atoms[it].nwl; L++) - { - if (L != PARAM.inp.orbital_corr[it]) - { - continue; - } - - for (int n = 0; n < this->ucell->atoms[it].l_nchi[L]; n++) - { - if (n != 0) - { - continue; - } - - for (int m1 = 0; m1 < 2 * L + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - const int mu = this->paraV->global2local_row(this->iatlnmipol2iwt[iat][L][n][m1][ipol1]); - if (mu < 0) - { - continue; - } - - for (int m2 = 0; m2 < 2 * L + 1; m2++) - { - for (int ipol2 = 0; ipol2 < PARAM.globalv.npol; ipol2++) - { - const int nu - = this->paraV->global2local_col(this->iatlnmipol2iwt[iat][L][n][m2][ipol2]); - if (nu < 0) - { - continue; - } - int m1_all = m1 + (2 * L + 1) * ipol1; - int m2_all = m2 + (2 * L + 1) * ipol2; - double val = get_onebody_eff_pot(it, iat, L, n, spin, m1_all, m2_all, newlocale); - VU[nu * this->paraV->nrow + mu] = std::complex(val, 0.0); - } // ipol2 - } // m2 - } // ipol1 - } // m1 - } // n - } // l - } // ia - } // it - - return; -} - -void DFTU::cal_VU_pot_mat_real(const int spin, const bool newlocale, double* VU) -{ - ModuleBase::TITLE("DFTU", "cal_VU_pot_mat_real"); - ModuleBase::GlobalFunc::ZEROS(VU, this->paraV->nloc); - - for (int it = 0; it < this->ucell->ntype; ++it) - { - if (PARAM.inp.orbital_corr[it] == -1) - { - continue; - } - for (int ia = 0; ia < this->ucell->atoms[it].na; ia++) - { - const int iat = this->ucell->itia2iat(it, ia); - for (int L = 0; L <= this->ucell->atoms[it].nwl; L++) - { - if (L != PARAM.inp.orbital_corr[it]) - { - continue; - } - - for (int n = 0; n < this->ucell->atoms[it].l_nchi[L]; n++) - { - if (n != 0) - { - continue; - } - for (int m1 = 0; m1 < 2 * L + 1; m1++) - { - for (int ipol1 = 0; ipol1 < PARAM.globalv.npol; ipol1++) - { - const int mu = this->paraV->global2local_row(this->iatlnmipol2iwt[iat][L][n][m1][ipol1]); - if (mu < 0) - { - continue; - } - for (int m2 = 0; m2 < 2 * L + 1; m2++) - { - for (int ipol2 = 0; ipol2 < PARAM.globalv.npol; ipol2++) - { - const int nu - = this->paraV->global2local_col(this->iatlnmipol2iwt[iat][L][n][m2][ipol2]); - if (nu < 0) - { - continue; - } - - int m1_all = m1 + (2 * L + 1) * ipol1; - int m2_all = m2 + (2 * L + 1) * ipol2; - - VU[nu * this->paraV->nrow + mu] - = this->get_onebody_eff_pot(it, iat, L, n, spin, m1_all, m2_all, newlocale); - - } // ipol2 - } // m2 - } // ipol1 - } // m1 - } // n - } // l - } // ia - } // it - - return; -} - -double DFTU::get_onebody_eff_pot(const int T, - const int iat, - const int L, - const int N, - const int spin, - const int m0, - const int m1, - const bool newlocale) -{ - ModuleBase::TITLE("DFTU", "get_onebody_eff_pot"); - - double VU = 0.0; - - switch (cal_type) - { - case 1: // rotationally invarient formalism and FLL double counting - - break; - - case 2: // rotationally invarient formalism and AMF double counting - - break; - - case 3: // simplified formalism and FLL double counting - if (newlocale) - { - if (Yukawa) - { - if (m0 == m1) - { - VU = (this->U_Yukawa[T][L][N] - this->J_Yukawa[T][L][N]) - * (0.5 - this->locale[iat][L][N][spin](m0, m1)); - } else { - VU = -(this->U_Yukawa[T][L][N] - this->J_Yukawa[T][L][N]) * this->locale[iat][L][N][spin](m0, m1); - } - } - else - { - if (m0 == m1) { - VU = (this->U[T]) * (0.5 - this->locale[iat][L][N][spin](m0, m1)); - } else { - VU = -(this->U[T]) * this->locale[iat][L][N][spin](m0, m1); - } - } - } - else - { - if (Yukawa) - { - if (m0 == m1) { - VU = (this->U_Yukawa[T][L][N] - this->J_Yukawa[T][L][N]) - * (0.5 - this->locale_save[iat][L][N][spin](m0, m1)); - } else { - VU = -(this->U_Yukawa[T][L][N] - this->J_Yukawa[T][L][N]) - * this->locale_save[iat][L][N][spin](m0, m1); - } - } - else - { - if (m0 == m1) { - VU = (this->U[T]) * (0.5 - this->locale_save[iat][L][N][spin](m0, m1)); - } else { - VU = -(this->U[T]) * this->locale_save[iat][L][N][spin](m0, m1); - } - } - } - - break; - - case 4: // simplified formalism and AMF double counting - - break; - } - - return VU; -} -#endif -} // namespace ModuleDFTU \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp b/source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp deleted file mode 100644 index 11a887f6f8..0000000000 --- a/source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp +++ /dev/null @@ -1,310 +0,0 @@ -//========================================================== -// Author:Xin Qu -#ifdef __LCAO -#include "module_parameter/parameter.h" -// DATE : 2019-12-10 -//========================================================== -#include "source_base/constants.h" -#include "source_base/global_function.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "dftu.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ModuleDFTU -{ - -void DFTU::cal_yukawa_lambda(double** rho, const int& nrxx) -{ - ModuleBase::TITLE("DFTU", "cal_yukawa_lambda"); - - if (PARAM.inp.yukawa_lambda > 0) - { - this->lambda = PARAM.inp.yukawa_lambda; - return; - } - - double sum_rho = 0.0; - double sum_rho_lambda = 0.0; - for (int is = 0; is < PARAM.inp.nspin; is++) - { - if(PARAM.inp.nspin == 4 && is > 0) { continue;// for non-collinear spin case, first spin contains the charge density -} - for (int ir = 0; ir < nrxx; ir++) - { - double rho_ir = rho[is][ir]; - sum_rho += rho_ir; - - double lambda_ir = 2 * pow(3 * rho_ir / ModuleBase::PI, (double)1.0 / 6.0); - sum_rho_lambda += lambda_ir * rho_ir; - } - } - - double val1 = 0.0; - double val2 = 0.0; - -#ifdef __MPI - MPI_Allreduce(&sum_rho, &val1, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(&sum_rho_lambda, &val2, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); -#endif - - this->lambda = val2 / val1; - - // rescaling - this->lambda /= 1.6; - - return; -} - -void DFTU::cal_slater_Fk(const UnitCell& ucell, - const int L, - const int T) -{ - ModuleBase::TITLE("DFTU", "cal_slater_Fk"); - - if (Yukawa) - { - for (int chi = 0; chi < ucell.atoms[T].l_nchi[L]; chi++) - { - // if(chi!=0) continue; - const int mesh = ptr_orb_->Phi[T].PhiLN(L, chi).getNr(); - - for (int k = 0; k <= L; k++) - { - for (int ir0 = 1; ir0 < mesh; ir0++) - { - double r0 = ptr_orb_->Phi[T].PhiLN(L, chi).getRadial(ir0); - const double rab0 = ptr_orb_->Phi[T].PhiLN(L, chi).getRab(ir0); - const double R_L0 = ptr_orb_->Phi[T].PhiLN(L, chi).getPsi(ir0); - - for (int ir1 = 1; ir1 < mesh; ir1++) - { - double bslval, hnkval; - double r1 = ptr_orb_->Phi[T].PhiLN(L, chi).getRadial(ir1); - const double rab1 = ptr_orb_->Phi[T].PhiLN(L, chi).getRab(ir1); - const double R_L1 = ptr_orb_->Phi[T].PhiLN(L, chi).getPsi(ir1); - - int l = 2 * k; - if (ir0 < ir1) // less than - { - bslval = this->spherical_Bessel(l, r0, lambda); - hnkval = this->spherical_Hankel(l, r1, lambda); - } - else // greater than - { - bslval = this->spherical_Bessel(l, r1, lambda); - hnkval = this->spherical_Hankel(l, r0, lambda); - } - this->Fk[T][L][chi][k] -= (4 * k + 1) * lambda * pow(R_L0, 2) * bslval * hnkval * pow(R_L1, 2) - * pow(r0, 2) * pow(r1, 2) * rab0 * rab1; - } - } - } - } - } - - return; -} - -void DFTU::cal_slater_UJ(const UnitCell& ucell, double** rho, const int& nrxx) -{ - ModuleBase::TITLE("DFTU", "cal_slater_UJ"); - if (!Yukawa) { - return; -} - - this->cal_yukawa_lambda(rho, nrxx); - - for (int it = 0; it < ucell.ntype; it++) - { - const int NL = ucell.atoms[it].nwl + 1; - - for (int l = 0; l < NL; l++) - { - int N = ucell.atoms[it].l_nchi[l]; - for (int n = 0; n < N; n++) - { - ModuleBase::GlobalFunc::ZEROS(ModuleBase::GlobalFunc::VECTOR_TO_PTR(this->Fk[it][l][n]), l + 1); - } - } - } - - for (int T = 0; T < ucell.ntype; T++) - { - const int NL = ucell.atoms[T].nwl + 1; - - for (int L = 0; L < NL; L++) - { - const int N = ucell.atoms[T].l_nchi[L]; - - if (L >= PARAM.inp.orbital_corr[T] && PARAM.inp.orbital_corr[T] != -1) - { - if (L != PARAM.inp.orbital_corr[T]) { - continue; -} - this->cal_slater_Fk(ucell,L, T); - - for (int n = 0; n < N; n++) - { - if (n != 0) { - continue; -} - - switch (L) - { - case 1: // p electrons - this->U_Yukawa[T][L][n] = this->Fk[T][L][n][0]; - this->J_Yukawa[T][L][n] = this->Fk[T][L][n][1] / 5.0; - break; - - case 2: // d electrons - this->U_Yukawa[T][L][n] = this->Fk[T][L][n][0]; - this->J_Yukawa[T][L][n] = (this->Fk[T][L][n][1] + this->Fk[T][L][n][2]) / 14.0; - break; - - case 3: // f electrons - if (Yukawa) { - this->U_Yukawa[T][L][n] = this->Fk[T][L][n][0]; -} - this->J_Yukawa[T][L][n] = (286.0 * this->Fk[T][L][n][1] + 195.0 * this->Fk[T][L][n][2] - + 250.0 * this->Fk[T][L][n][3]) - / 6435.0; - break; - } - - // Hartree to Rydeberg - this->U_Yukawa[T][L][n] *= 2.0; - this->J_Yukawa[T][L][n] *= 2.0; - // update current U with calculated U-J from Slater integrals - this->U[T] = this->U_Yukawa[T][L][n] - this->J_Yukawa[T][L][n]; - } // end n - } // end if - } // end L - } // end T - - return; -} - -double DFTU::spherical_Bessel(const int k, const double r, const double lambda) -{ - ModuleBase::TITLE("DFTU", "spherical_Bessel"); - - double val=0.0; - double x = r * lambda; - if (k == 0) - { - if (x < 1.0e-3) - { - val = 1 + pow(x, 2) / 6.0; - } - else - { - val = sinh(x) / x; - } - } - else if (k == 2) - { - if (x < 1.0e-2) - { - val = -pow(x, 2) / 15.0 - pow(x, 4) / 210.0 - pow(x, 6) / 7560.0; - } - else - { - val = 3 * cosh(x) / pow(x, 2) + (-3 - pow(x, 2)) * sinh(x) / pow(x, 3); - } - } - else if (k == 4) - { - if (x < 5.0e-1) - { - val = pow(x, 4) / 945.0 + pow(x, 6) / 20790.0 + pow(x, 8) / 1081080.0 + pow(x, 10) / 97297200.0; - } - else - { - val = -5 * (21 + 2 * pow(x, 2)) * cosh(x) / pow(x, 4) - + (105 + 45 * pow(x, 2) + pow(x, 4)) * sinh(x) / pow(x, 5); - } - } - else if (k == 6) - { - if (x < 9.0e-1) - { - val = -pow(x, 6) / 135135.0 - pow(x, 8) / 4054050.0 - pow(x, 10) / 275675400.0; - } - else - { - val = 21 * (495 + 60 * pow(x, 2) + pow(x, 4)) * cosh(x) / pow(x, 6) - + (-10395 - 4725 * pow(x, 2) - 210 * pow(x, 4) - pow(x, 6)) * sinh(x) / pow(x, 7); - } - } - return val; -} - -double DFTU::spherical_Hankel(const int k, const double r, const double lambda) -{ - ModuleBase::TITLE("DFTU", "spherical_Bessel"); - - double val=0.0; - double x = r * lambda; - if (k == 0) - { - if (x < 1.0e-3) - { - val = -1 / x + 1 - x / 2.0 + pow(x, 2) / 6.0; - } - else - { - val = -exp(-x) / x; - } - } - else if (k == 2) - { - if (x < 1.0e-2) - { - val = 3 / pow(x, 3) - 1 / (2 * x) + x / 8 - pow(x, 2) / 15.0 + pow(x, 3) / 48.0; - } - else - { - val = exp(-x) * (3 + 3 * x + pow(x, 2)) / pow(x, 3); - } - } - else if (k == 4) - { - if (x < 5.0e-1) - { - val = -105 / pow(x, 5) + 15 / (2 * pow(x, 3)) - 3 / (8 * x) + x / 48 - pow(x, 3) / 384.0 - + pow(x, 4) / 945.0; - } - else - { - val = -exp(-x) * (105 + 105 * x + 45 * pow(x, 2) + 10 * pow(x, 3) + pow(x, 4)) / pow(x, 5); - } - } - else if (k == 6) - { - if (x < 9.0e-1) - { - val = 10395 / pow(x, 7) - 945 / (2 * pow(x, 5)) + 105 / (8 * pow(x, 3)) - 5 / (16 * x) + x / 128.0 - - pow(x, 3) / 3840.0 + pow(x, 5) / 46080.0 - pow(x, 6) / 135135.0; - } - else - { - val = exp(-x) - * (10395 + 10395 * x + 4725 * pow(x, 2) + 1260 * pow(x, 3) + 210 * pow(x, 4) + 21 * pow(x, 5) - + pow(x, 6)) - / pow(x, 7); - } - } - return val; -} - -} // namespace ModuleDFTU - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/CMakeLists.txt b/source/module_hamilt_lcao/module_gint/CMakeLists.txt deleted file mode 100644 index 0505957b9c..0000000000 --- a/source/module_hamilt_lcao/module_gint/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -#add_subdirectory(kernels/cuda) -if(ENABLE_LCAO) - -list(APPEND objects - gint_old.cpp - gint_gamma_env.cpp - gint_gamma_vl.cpp - gint_fvl_old.cpp - gint_rho_old.cpp - gint_tau_old.cpp - gint_vl_old.cpp - gint_k_env.cpp - gint_k_sparse1.cpp - gint_k_pvpr.cpp - gint_k_pvdpr.cpp - gint_tools.cpp - grid_bigcell.cpp - grid_meshball.cpp - grid_meshcell.cpp - grid_meshk.cpp - grid_technique.cpp - gint_force_cpu_interface.cpp - gint_rho_cpu_interface.cpp - gint_vl_cpu_interface.cpp - cal_psir_ylm.cpp - cal_dpsir_ylm.cpp - cal_ddpsir_ylm.cpp - mult_psi_dmr.cpp - init_orb.cpp -) - -if(NOT DEFINED OLD_GINT) - list(APPEND objects - temp_gint/biggrid_info.cpp - temp_gint/big_grid.cpp - temp_gint/divide_info.cpp - temp_gint/gint_atom.cpp - temp_gint/gint_info.cpp - temp_gint/gint.cpp - temp_gint/gint_vl.cpp - temp_gint/gint_vl_metagga.cpp - temp_gint/gint_vl_nspin4.cpp - temp_gint/gint_vl_metagga_nspin4.cpp - temp_gint/gint_rho.cpp - temp_gint/gint_tau.cpp - temp_gint/gint_fvl.cpp - temp_gint/gint_fvl_meta.cpp - temp_gint/gint_env_gamma.cpp - temp_gint/gint_env_k.cpp - temp_gint/gint_dvlocal.cpp - temp_gint/localcell_info.cpp - temp_gint/phi_operator.cpp - temp_gint/set_ddphi.cpp - temp_gint/unitcell_info.cpp - temp_gint/gint_common.cpp - temp_gint/gint_interface.cpp - ) - if(USE_CUDA) - list(APPEND objects - temp_gint/kernel/gint_gpu_vars.cpp - temp_gint/kernel/phi_operator_gpu.cu - temp_gint/kernel/phi_operator_kernel.cu - temp_gint/kernel/set_const_mem.cu - temp_gint/batch_biggrid.cpp - temp_gint/gint_vl_gpu.cpp - temp_gint/gint_rho_gpu.cpp - temp_gint/gint_fvl_gpu.cpp - temp_gint/gint_vl_metagga_gpu.cpp - temp_gint/gint_vl_nspin4_gpu.cpp - temp_gint/gint_vl_metagga_nspin4_gpu.cpp - temp_gint/gint_tau_gpu.cpp - temp_gint/gint_fvl_meta_gpu.cpp - temp_gint/kernel/dgemm_vbatch.cu - ) - endif() -endif() - -if(USE_CUDA) - list(APPEND objects - gint_gpu_interface.cpp - kernels/cuda/cuda_tools.cu - kernels/cuda/gint_vl.cu - kernels/cuda/gint_rho.cu - kernels/cuda/gint_force.cu - gint_vl_gpu.cu - gint_rho_gpu.cu - gint_force_gpu.cu - kernels/cuda/gemm_selector.cu - kernels/cuda/code_gen_00.cu - kernels/cuda/code_gen_01.cu - kernels/cuda/code_gen_02.cu - kernels/cuda/code_gen_03.cu - kernels/cuda/code_gen_04.cu - kernels/cuda/code_gen_05.cu - kernels/cuda/code_gen_06.cu - kernels/cuda/code_gen_07.cu - kernels/cuda/code_gen_08.cu - kernels/cuda/code_gen_09.cu - gtask_vl.cpp - gtask_rho.cpp - gtask_force.cpp - ) -endif() - -add_library( - gint - OBJECT - ${objects} -) - -if(ENABLE_COVERAGE) - add_coverage(gint) -endif() - -IF (BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() -endif() - -endif() \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/cal_ddpsir_ylm.cpp b/source/module_hamilt_lcao/module_gint/cal_ddpsir_ylm.cpp deleted file mode 100644 index 206c6f95e8..0000000000 --- a/source/module_hamilt_lcao/module_gint/cal_ddpsir_ylm.cpp +++ /dev/null @@ -1,316 +0,0 @@ -#include "gint_tools.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -namespace Gint_Tools{ -void cal_ddpsir_ylm( - const Grid_Technique& gt, const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const double delta_r, // delta_r of the uniform FFT grid - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - double* const* const ddpsir_ylm_xx, double* const* const ddpsir_ylm_xy, double* const* const ddpsir_ylm_xz, - double* const* const ddpsir_ylm_yy, double* const* const ddpsir_ylm_yz, double* const* const ddpsir_ylm_zz) -{ - ModuleBase::timer::tick("Gint_Tools", "cal_ddpsir_ylm"); - const UnitCell& ucell = *gt.ucell; - std::vector it_psi_uniform(gt.nwmax); - std::vector it_dpsi_uniform(gt.nwmax); - std::vector it_d2psi_uniform(gt.nwmax); - std::vector it_psi_nr_uniform(gt.nwmax); - // array to store spherical harmonics and its derivatives - // the first dimension equals 36 because the maximum nwl is 5. - double rly[36]; - ModuleBase::Array_Pool grly(36, 3); - - for (int id = 0; id < na_grid; id++) - { - const int mcell_index = gt.bcell_start[grid_index] + id; - const int imcell = gt.which_bigcell[mcell_index]; - int iat = gt.which_atom[mcell_index]; - const int it = ucell.iat2it[iat]; - const int ia = ucell.iat2ia[iat]; - Atom* atom = &ucell.atoms[it]; - - const double mt[3] = {gt.meshball_positions[imcell][0] - gt.tau_in_bigcell[iat][0], - gt.meshball_positions[imcell][1] - gt.tau_in_bigcell[iat][1], - gt.meshball_positions[imcell][2] - gt.tau_in_bigcell[iat][2]}; - - for (int iw=0; iw< atom->nw; ++iw) - { - if ( atom->iw2_new[iw] ) - { - it_psi_uniform[iw]= gt.psi_u[it*gt.nwmax + iw].data(); - it_dpsi_uniform[iw] = gt.dpsi_u[it*gt.nwmax + iw].data(); - it_psi_nr_uniform[iw]= gt.psi_u[it*gt.nwmax + iw].size(); - } - } - - for (int ib = 0; ib < bxyz; ib++) - { - double* const p_ddpsi_xx = &ddpsir_ylm_xx[ib][block_index[id]]; - double* const p_ddpsi_xy = &ddpsir_ylm_xy[ib][block_index[id]]; - double* const p_ddpsi_xz = &ddpsir_ylm_xz[ib][block_index[id]]; - double* const p_ddpsi_yy = &ddpsir_ylm_yy[ib][block_index[id]]; - double* const p_ddpsi_yz = &ddpsir_ylm_yz[ib][block_index[id]]; - double* const p_ddpsi_zz = &ddpsir_ylm_zz[ib][block_index[id]]; - if (!cal_flag[ib][id]) - { - ModuleBase::GlobalFunc::ZEROS(p_ddpsi_xx, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_ddpsi_xy, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_ddpsi_xz, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_ddpsi_yy, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_ddpsi_yz, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_ddpsi_zz, block_size[id]); - } - else - { - const double dr[3] - = {// vectors between atom and grid - gt.meshcell_pos[ib][0] + mt[0], gt.meshcell_pos[ib][1] + mt[1], gt.meshcell_pos[ib][2] + mt[2]}; - double distance = std::sqrt(dr[0] * dr[0] + dr[1] * dr[1] + dr[2] * dr[2]); - - // for some unknown reason, the finite difference between dpsi and ddpsi - // using analytical expression is always wrong; as a result, - // I switch to explicit finite difference method for evaluating - // the second derivatives of the orbitals - if (/*distance < 1e-9*/ true) - { - double*** dpsi = new double**[atom->nw]; - for (int i = 0; i < atom->nw; i++) - { - dpsi[i] = new double*[6]; - for (int j = 0; j < 6; j++) - { - dpsi[i][j] = new double[3]; - ModuleBase::GlobalFunc::ZEROS(dpsi[i][j], 3); - } - } - - double* dr1 = new double[3]; - - double** displ = new double*[6]; - for (int i = 0; i < 6; i++) - { - displ[i] = new double[3]; - ModuleBase::GlobalFunc::ZEROS(displ[i], 3); - } - displ[0][0] = 0.0001; // in x direction - displ[1][0] = -0.0001; - displ[2][1] = 0.0001; // in y direction - displ[3][1] = -0.0001; - displ[4][2] = 0.0001; // in z direction - displ[5][2] = -0.0001; - - for (int i = 0; i < 6; i++) - { - dr1[0] = dr[0] + displ[i][0]; - dr1[1] = dr[1] + displ[i][1]; - dr1[2] = dr[2] + displ[i][2]; - - ModuleBase::Ylm::grad_rl_sph_harm(ucell.atoms[it].nwl, dr1[0], dr1[1], dr1[2], rly, grly.get_ptr_2D()); - - double distance1 = std::sqrt(dr1[0] * dr1[0] + dr1[1] * dr1[1] + dr1[2] * dr1[2]); - if (distance1 < 1e-9) { - distance1 = 1e-9; -} - - const double position = distance1 / delta_r; - - const int ip = static_cast(position); - const double iq = static_cast(position); - const double x0 = position - iq; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - - double tmp, dtmp; - - for (int iw = 0; iw < atom->nw; ++iw) - { - // this is a new 'l', we need 1D orbital wave - // function from interpolation method. - if (atom->iw2_new[iw]) - { - auto psi_uniform = it_psi_uniform[iw]; - auto dpsi_uniform = it_dpsi_uniform[iw]; - - // if ( iq[id] >= philn.nr_uniform-4) - if (iq >= it_psi_nr_uniform[iw]-4) - { - tmp = dtmp = 0.0; - } - else - { - // use Polynomia Interpolation method to get the - // wave functions - - tmp = x12 * (psi_uniform[ip] * x3 + psi_uniform[ip + 3] * x0) - + x03 * (psi_uniform[ip + 1] * x2 - psi_uniform[ip + 2] * x1); - - dtmp = x12 * (dpsi_uniform[ip] * x3 + dpsi_uniform[ip + 3] * x0) - + x03 * (dpsi_uniform[ip + 1] * x2 - dpsi_uniform[ip + 2] * x1); - } - } // new l is used. - - // get the 'l' of this localized wave function - const int ll = atom->iw2l[iw]; - const int idx_lm = atom->iw2_ylm[iw]; - - const double rl = pow_int(distance1, ll); - - // derivative of wave functions with respect to atom positions. - const double tmpdphi_rly = (dtmp - tmp * ll / distance1) / rl * rly[idx_lm] / distance1; - const double tmprl = tmp / rl; - - dpsi[iw][i][0] = tmpdphi_rly * dr1[0] + tmprl * grly[idx_lm][0]; - dpsi[iw][i][1] = tmpdphi_rly * dr1[1] + tmprl * grly[idx_lm][1]; - dpsi[iw][i][2] = tmpdphi_rly * dr1[2] + tmprl * grly[idx_lm][2]; - } // end iw - } // end i = 0-6 - - for (int iw = 0; iw < atom->nw; iw++) - { - p_ddpsi_xx[iw] = (dpsi[iw][0][0] - dpsi[iw][1][0]) / 0.0002; - p_ddpsi_xy[iw] - = ((dpsi[iw][2][0] - dpsi[iw][3][0]) + (dpsi[iw][0][1] - dpsi[iw][1][1])) / 0.0004; - p_ddpsi_xz[iw] - = ((dpsi[iw][4][0] - dpsi[iw][5][0]) + (dpsi[iw][0][2] - dpsi[iw][1][2])) / 0.0004; - p_ddpsi_yy[iw] = (dpsi[iw][2][1] - dpsi[iw][3][1]) / 0.0002; - p_ddpsi_yz[iw] - = ((dpsi[iw][4][1] - dpsi[iw][5][1]) + (dpsi[iw][2][2] - dpsi[iw][3][2])) / 0.0004; - p_ddpsi_zz[iw] = (dpsi[iw][4][2] - dpsi[iw][5][2]) / 0.0002; - } - - for (int i = 0; i < atom->nw; i++) - { - for (int j = 0; j < 6; j++) - { - delete[] dpsi[i][j]; - } - delete[] dpsi[i]; - } - delete[] dpsi; - - delete[] dr1; - for (int i = 0; i < 6; i++) - { - delete[] displ[i]; - } - delete[] displ; - } - else - // the analytical method for evaluating 2nd derivatives - // it is not used currently - { - // Add it here, but do not run it. If there is a need to run this code - // in the future, include it in the previous initialization process. - for (int iw=0; iw< atom->nw; ++iw) - { - if ( atom->iw2_new[iw] ) - { - it_d2psi_uniform[iw] = gt.d2psi_u[it*gt.nwmax + iw].data(); - } - } - // End of code addition section. - - std::vector> hrly; - ModuleBase::Ylm::grad_rl_sph_harm(ucell.atoms[it].nwl, dr[0], dr[1], dr[2], rly, grly.get_ptr_2D()); - ModuleBase::Ylm::hes_rl_sph_harm(ucell.atoms[it].nwl, dr[0], dr[1], dr[2], hrly); - const double position = distance / delta_r; - - const double iq = static_cast(position); - const int ip = static_cast(position); - const double x0 = position - iq; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - - double tmp, dtmp, ddtmp; - - for (int iw = 0; iw < atom->nw; ++iw) - { - // this is a new 'l', we need 1D orbital wave - // function from interpolation method. - if (atom->iw2_new[iw]) - { - auto psi_uniform = it_psi_uniform[iw]; - auto dpsi_uniform = it_dpsi_uniform[iw]; - auto ddpsi_uniform = it_d2psi_uniform[iw]; - - // if ( iq[id] >= philn.nr_uniform-4) - if (iq >= it_psi_nr_uniform[iw]-4) - { - tmp = dtmp = ddtmp = 0.0; - } - else - { - // use Polynomia Interpolation method to get the - // wave functions - - tmp = x12 * (psi_uniform[ip] * x3 + psi_uniform[ip + 3] * x0) - + x03 * (psi_uniform[ip + 1] * x2 - psi_uniform[ip + 2] * x1); - - dtmp = x12 * (dpsi_uniform[ip] * x3 + dpsi_uniform[ip + 3] * x0) - + x03 * (dpsi_uniform[ip + 1] * x2 - dpsi_uniform[ip + 2] * x1); - - ddtmp = x12 * (ddpsi_uniform[ip] * x3 + ddpsi_uniform[ip + 3] * x0) - + x03 * (ddpsi_uniform[ip + 1] * x2 - ddpsi_uniform[ip + 2] * x1); - } - } // new l is used. - - // get the 'l' of this localized wave function - const int ll = atom->iw2l[iw]; - const int idx_lm = atom->iw2_ylm[iw]; - - const double rl = pow_int(distance, ll); - const double r_lp2 =rl * distance * distance; - - // d/dr (R_l / r^l) - const double tmpdphi = (dtmp - tmp * ll / distance) / rl; - const double term1 = ddtmp / r_lp2; - const double term2 = (2 * ll + 1) * dtmp / r_lp2 / distance; - const double term3 = ll * (ll + 2) * tmp / r_lp2 / distance / distance; - const double term4 = tmpdphi / distance; - const double term5 = term1 - term2 + term3; - - // hessian of (R_l / r^l) - const double term_xx = term4 + dr[0] * dr[0] * term5; - const double term_xy = dr[0] * dr[1] * term5; - const double term_xz = dr[0] * dr[2] * term5; - const double term_yy = term4 + dr[1] * dr[1] * term5; - const double term_yz = dr[1] * dr[2] * term5; - const double term_zz = term4 + dr[2] * dr[2] * term5; - - // d/dr (R_l / r^l) * alpha / r - const double term_1x = dr[0] * term4; - const double term_1y = dr[1] * term4; - const double term_1z = dr[2] * term4; - - p_ddpsi_xx[iw] - = term_xx * rly[idx_lm] + 2.0 * term_1x * grly[idx_lm][0] + tmp / rl * hrly[idx_lm][0]; - p_ddpsi_xy[iw] = term_xy * rly[idx_lm] + term_1x * grly[idx_lm][1] + term_1y * grly[idx_lm][0] - + tmp / rl * hrly[idx_lm][1]; - p_ddpsi_xz[iw] = term_xz * rly[idx_lm] + term_1x * grly[idx_lm][2] + term_1z * grly[idx_lm][0] - + tmp / rl * hrly[idx_lm][2]; - p_ddpsi_yy[iw] - = term_yy * rly[idx_lm] + 2.0 * term_1y * grly[idx_lm][1] + tmp / rl * hrly[idx_lm][3]; - p_ddpsi_yz[iw] = term_yz * rly[idx_lm] + term_1y * grly[idx_lm][2] + term_1z * grly[idx_lm][1] - + tmp / rl * hrly[idx_lm][4]; - p_ddpsi_zz[iw] - = term_zz * rly[idx_lm] + 2.0 * term_1z * grly[idx_lm][2] + tmp / rl * hrly[idx_lm][5]; - - } // iw - } // end if - } // else - } // end ib - } // end id(atom) - ModuleBase::timer::tick("Gint_Tools", "cal_ddpsir_ylm"); - return; -} -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/cal_dpsir_ylm.cpp b/source/module_hamilt_lcao/module_gint/cal_dpsir_ylm.cpp deleted file mode 100644 index 8b32b2fc05..0000000000 --- a/source/module_hamilt_lcao/module_gint/cal_dpsir_ylm.cpp +++ /dev/null @@ -1,138 +0,0 @@ -#include "gint_tools.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_base/array_pool.h" -namespace Gint_Tools{ -void cal_dpsir_ylm( - const Grid_Technique& gt, const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const double delta_r, // delta_r of the uniform FFT grid - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - double* const* const psir_ylm, double* const* const dpsir_ylm_x, double* const* const dpsir_ylm_y, - double* const* const dpsir_ylm_z) -{ - ModuleBase::timer::tick("Gint_Tools", "cal_dpsir_ylm"); - const UnitCell& ucell = *gt.ucell; - std::vector it_psi_uniform(gt.nwmax); - std::vector it_dpsi_uniform(gt.nwmax); - std::vector it_psi_nr_uniform(gt.nwmax); - // array to store spherical harmonics and its derivatives - // the first dimension equals 36 because the maximum nwl is 5. - double rly[36]; - ModuleBase::Array_Pool grly(36, 3); - - for (int id = 0; id < na_grid; id++) - { - const int mcell_index = gt.bcell_start[grid_index] + id; - const int imcell = gt.which_bigcell[mcell_index]; - int iat = gt.which_atom[mcell_index]; - const int it = ucell.iat2it[iat]; - const int ia = ucell.iat2ia[iat]; - Atom* atom = &ucell.atoms[it]; - - const double mt[3] = {gt.meshball_positions[imcell][0] - gt.tau_in_bigcell[iat][0], - gt.meshball_positions[imcell][1] - gt.tau_in_bigcell[iat][1], - gt.meshball_positions[imcell][2] - gt.tau_in_bigcell[iat][2]}; - // preprocess index - for (int iw=0; iw< atom->nw; ++iw) - { - if ( atom->iw2_new[iw] ) - { - it_psi_uniform[iw]= gt.psi_u[it*gt.nwmax + iw].data(); - it_dpsi_uniform[iw] = gt.dpsi_u[it*gt.nwmax + iw].data(); - it_psi_nr_uniform[iw]= gt.psi_u[it*gt.nwmax + iw].size(); - } - } - - for (int ib = 0; ib < bxyz; ib++) - { - double* const p_psi = &psir_ylm[ib][block_index[id]]; - double* const p_dpsi_x = &dpsir_ylm_x[ib][block_index[id]]; - double* const p_dpsi_y = &dpsir_ylm_y[ib][block_index[id]]; - double* const p_dpsi_z = &dpsir_ylm_z[ib][block_index[id]]; - if (!cal_flag[ib][id]) - { - ModuleBase::GlobalFunc::ZEROS(p_psi, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_dpsi_x, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_dpsi_y, block_size[id]); - ModuleBase::GlobalFunc::ZEROS(p_dpsi_z, block_size[id]); - } - else - { - const double dr[3] - = {// vectors between atom and grid - gt.meshcell_pos[ib][0] + mt[0], gt.meshcell_pos[ib][1] + mt[1], gt.meshcell_pos[ib][2] + mt[2]}; - double distance = std::sqrt(dr[0] * dr[0] + dr[1] * dr[1] + dr[2] * dr[2]); - - ModuleBase::Ylm::grad_rl_sph_harm(ucell.atoms[it].nwl, dr[0], dr[1], dr[2], rly, grly.get_ptr_2D()); - if (distance < 1e-9) { - distance = 1e-9; -} - - const double position = distance / delta_r; - - const double iq = static_cast(position); - const int ip = static_cast(position); - const double x0 = position - iq; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - - double tmp, dtmp; - - for (int iw = 0; iw < atom->nw; ++iw) - { - - // this is a new 'l', we need 1D orbital wave - // function from interpolation method. - if (atom->iw2_new[iw]) - { - auto psi_uniform = it_psi_uniform[iw]; - auto dpsi_uniform = it_dpsi_uniform[iw]; - // if ( iq[id] >= philn.nr_uniform-4) - if (iq >= it_psi_nr_uniform[iw] - 4) - { - tmp = dtmp = 0.0; - } - else - { - // use Polynomia Interpolation method to get the - // wave functions - - tmp = x12 * (psi_uniform[ip] * x3 + psi_uniform[ip + 3] * x0) - + x03 * (psi_uniform[ip + 1] * x2 - psi_uniform[ip + 2] * x1); - - dtmp = x12 * (dpsi_uniform[ip] * x3 + dpsi_uniform[ip + 3] * x0) - + x03 * (dpsi_uniform[ip + 1] * x2 - dpsi_uniform[ip + 2] * x1); - } - } // new l is used. - - // get the 'l' of this localized wave function - const int ll = atom->iw2l[iw]; - const int idx_lm = atom->iw2_ylm[iw]; - - const double rl = pow_int(distance, ll); - const double tmprl = tmp / rl; - - // 3D wave functions - p_psi[iw] = tmprl * rly[idx_lm]; - - // derivative of wave functions with respect to atom positions. - const double tmpdphi_rly = (dtmp - tmp * ll / distance) / rl * rly[idx_lm] / distance; - - p_dpsi_x[iw] = tmpdphi_rly * dr[0] + tmprl * grly[idx_lm][0]; - p_dpsi_y[iw] = tmpdphi_rly * dr[1] + tmprl * grly[idx_lm][1]; - p_dpsi_z[iw] = tmpdphi_rly * dr[2] + tmprl * grly[idx_lm][2]; - } // iw - } // else - } - } - ModuleBase::timer::tick("Gint_Tools", "cal_dpsir_ylm"); - return; -} -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/cal_psir_ylm.cpp b/source/module_hamilt_lcao/module_gint/cal_psir_ylm.cpp deleted file mode 100644 index 4eeedd19a5..0000000000 --- a/source/module_hamilt_lcao/module_gint/cal_psir_ylm.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include "gint_tools.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -namespace Gint_Tools{ -void cal_psir_ylm( - const Grid_Technique& gt, - const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const double delta_r, // delta_r of the uniform FFT grid - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, - double* const* const psir_ylm) // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff -{ -// ModuleBase::timer::tick("Gint_Tools", "cal_psir_ylm"); - std::vector ylma; - const UnitCell& ucell = *gt.ucell; - std::vector it_psi_uniform(gt.nwmax); - std::vector it_dpsi_uniform(gt.nwmax); - - for (int id = 0; id < na_grid; id++) - { - // there are two parameters we want to know here: - // in which bigcell of the meshball the atom is in? - // what's the cartesian coordinate of the bigcell? - const int mcell_index = gt.bcell_start[grid_index] + id; - - const int iat = gt.which_atom[mcell_index]; // index of atom - const int it = ucell.iat2it[iat]; // index of atom type - const Atom* const atom = &ucell.atoms[it]; - std::vector it_psi_uniform(atom->nw); - std::vector it_dpsi_uniform(atom->nw); - // preprocess index - for (int iw = 0; iw < atom->nw; ++iw) - { - if (atom->iw2_new[iw]) - { - it_psi_uniform[iw]= gt.psi_u[it*gt.nwmax + iw].data(); - it_dpsi_uniform[iw] = gt.dpsi_u[it*gt.nwmax + iw].data(); - } - } - - // meshball_positions should be the bigcell position in meshball - // to the center of meshball. - // calculated in cartesian coordinates - // the std::vector from the grid which is now being operated to the atom position. - // in meshball language, is the std::vector from imcell to the center cel, plus - // tau_in_bigcell. - const int imcell = gt.which_bigcell[mcell_index]; - const double mt[3] = {gt.meshball_positions[imcell][0] - gt.tau_in_bigcell[iat][0], - gt.meshball_positions[imcell][1] - gt.tau_in_bigcell[iat][1], - gt.meshball_positions[imcell][2] - gt.tau_in_bigcell[iat][2]}; - - // number of grids in each big cell (bxyz) - for (int ib = 0; ib < bxyz; ib++) - { - double* p = &psir_ylm[ib][block_index[id]]; - if (!cal_flag[ib][id]) - { - ModuleBase::GlobalFunc::ZEROS(p, block_size[id]); - } - else - { - // meshcell_pos: z is the fastest - const double dr[3] - = {gt.meshcell_pos[ib][0] + mt[0], gt.meshcell_pos[ib][1] + mt[1], gt.meshcell_pos[ib][2] + mt[2]}; - double distance - = std::sqrt(dr[0] * dr[0] + dr[1] * dr[1] + dr[2] * dr[2]); // distance between atom and grid - // if(distance[id] > gt.orbital_rmax) continue; - if (distance < 1.0E-9) - distance += 1.0E-9; - - //------------------------------------------------------ - // spherical harmonic functions Ylm - //------------------------------------------------------ - // Ylm::get_ylm_real(this->nnn[it], this->dr[id], ylma); - ModuleBase::Ylm::sph_harm(ucell.atoms[it].nwl, dr[0] / distance, dr[1] / distance, dr[2] / distance, - ylma); - // these parameters are related to interpolation - // because once the distance from atom to grid point is known, - // we can obtain the parameters for interpolation and - // store them first! these operations can save lots of efforts. - const double position = distance / delta_r; - const int ip = static_cast(position); - const double dx = position - ip; - const double dx2 = dx * dx; - const double dx3 = dx2 * dx; - - const double c3 = 3.0 * dx2 - 2.0 * dx3; - const double c1 = 1.0 - c3; - const double c2 = (dx - 2.0 * dx2 + dx3) * delta_r; - const double c4 = (dx3 - dx2) * delta_r; - - double phi = 0; - for (int iw = 0; iw < atom->nw; ++iw) - { - if (atom->iw2_new[iw]) - { - auto psi_uniform = it_psi_uniform[iw]; - auto dpsi_uniform = it_dpsi_uniform[iw]; - phi = c1 * psi_uniform[ip] + c2 * dpsi_uniform[ip] // radial wave functions - + c3 * psi_uniform[ip + 1] + c4 * dpsi_uniform[ip + 1]; - } - p[iw] = phi * ylma[atom->iw2_ylm[iw]]; - } // end iw - } // end distance<=(rcuts[it]-1.0e-15) - } // end ib - } // end id -// ModuleBase::timer::tick("Gint_Tools", "cal_psir_ylm"); - return; -} -} diff --git a/source/module_hamilt_lcao/module_gint/gint.h b/source/module_hamilt_lcao/module_gint/gint.h deleted file mode 100644 index 4380559d8d..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint.h +++ /dev/null @@ -1,275 +0,0 @@ -#ifndef GINT_INTERFACE -#define GINT_INTERFACE - -#include "gint_tools.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include - -//---------------------------------------------------------- -//!This class provides a unified interface to the -//!grid intergration operation used to calculate -//!electron density, and the contribution of local -//!potential to Hamiltonian and force/stress. -//!There are two derived classes of this class -//! namely Gint_Gamma and Gint_k, which contain -//! specific operations for gamma point/multi-k calculations -//---------------------------------------------------------- - -class Gint { - public: - ~Gint(); - - //! move operator for the next ESolver to directly use its infomation - Gint& operator=(Gint&& rhs); - - hamilt::HContainer* get_hRGint() const { return hRGint; } - - std::vector*> get_DMRGint() const { return DMRGint; } - - int get_ncxyz() const { return ncxyz; } - - //! the unified interface to grid integration - void cal_gint(Gint_inout* inout); - - //! preparing FFT grid - void prep_grid(const Grid_Technique& gt, - const int& nbx_in, - const int& nby_in, - const int& nbz_in, - const int& nbz_start_in, - const int& ncxyz_in, - const int& bx_in, - const int& by_in, - const int& bz_in, - const int& bxyz_in, - const int& nbxx_in, - const int& ny_in, - const int& nplane_in, - const int& startz_current_in, - const UnitCell* ucell_in, - const LCAO_Orbitals* orb_in); - - /** - * @brief calculate the neighbor atoms of each atom in this processor - * size of BaseMatrix with be the non-parallel version - */ - void initialize_pvpR(const UnitCell& unitcell, const Grid_Driver* gd, const int& nspin); - - /** - * @brief resize DMRGint to nspin and reallocate the memory - */ - void reset_DMRGint(const int& nspin); - - /** - * @brief transfer DMR (2D para) to DMR (Grid para) in elecstate_lcao.cpp - */ - void transfer_DM2DtoGrid(std::vector*> DM2D); - - const Grid_Technique* gridt = nullptr; - const UnitCell* ucell; - - // psir_ylm_new = psir_func(psir_ylm) - // psir_func==nullptr means psir_ylm_new=psir_ylm - using T_psir_func = std::function< - const ModuleBase::Array_Pool&( - const ModuleBase::Array_Pool &psir_ylm, - const Grid_Technique >, - const int grid_index, - const int is, - const std::vector &block_iw, - const std::vector &block_size, - const std::vector &block_index, - const ModuleBase::Array_Pool &cal_flag)>; - - T_psir_func psir_func_1 = nullptr; - T_psir_func psir_func_2 = nullptr; - - protected: - - //! variables related to FFT grid - int nbx; - int nby; - int nbz; - int ncxyz; - int nbz_start; - int bx; - int by; - int bz; - int bxyz; - int nbxx; - int ny; - int nplane; - int startz_current; // from rhopw - - //! in cal_gint_gpu.cpp - void gpu_vlocal_interface(Gint_inout* inout); - - void gpu_rho_interface(Gint_inout* inout); - - void gpu_force_interface(Gint_inout* inout); - - //! in cal_gint_cpu.cpp - void gint_kernel_vlocal(Gint_inout* inout); - - //! calculate H_mu_nu(local)= - void gint_kernel_dvlocal(Gint_inout* inout); - - //! calculate vlocal in meta-GGA functionals - void gint_kernel_vlocal_meta(Gint_inout* inout); - - //! calculate charge density rho(r)=\int D_munu \phi_mu \phi_nu - void gint_kernel_rho(Gint_inout* inout); - - //! used in meta-GGA functional - void gint_kernel_tau(Gint_inout* inout); - - //! compute forces - void gint_kernel_force(Gint_inout* inout); - - //! compute forces related to meta-GGA functionals - void gint_kernel_force_meta(Gint_inout* inout); - - //! calculate local potential contribution to the Hamiltonian - //! na_grid: how many atoms on this (i,j,k) grid - //! block_size: dim is [block_size], number of columns of a band - //! block_index: dim is [na_grid+1], total number of atomic orbitals - //! grid_index: index of grid group, for tracing iat - //! cal_flag: dim is [bxyz][na_grid], whether the atom-grid distance is larger than cutoff - //! psir_ylm: dim is [bxyz][LD_pool] - //! psir_vlbr3: dim is [bxyz][LD_pool] - //! hR: HContainer for storing the matrix elements - //! cal_meshball_vlocal is thread-safe! - void cal_meshball_vlocal( - const int na_grid, - const int LD_pool, - const int* const block_size, - const int* const block_index, - const int grid_index, - const bool* const* const cal_flag, - const double* const* const psir_ylm, - const double* const* const psir_vlbr3, - hamilt::HContainer* hR); - - //! in gint_fvl.cpp - //! calculate vl contributuion to force & stress via grid integrals - void gint_kernel_force(const int na_grid, - const int grid_index, - const double delta_r, - double* vldr3, - const int is, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl_dphi, - ModuleBase::matrix* svl_dphi, - const UnitCell& ucell); - - //! in gint_fvl.cpp - //! calculate vl contributuion to force & stress via grid integrals - //! used in meta-GGA calculations - void gint_kernel_force_meta(const int na_grid, - const int grid_index, - const double delta_r, - double* vldr3, - double* vkdr3, - const int is, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl_dphi, - ModuleBase::matrix* svl_dphi, - const UnitCell& ucell); - - //! Use grid integrals to compute the atomic force contributions - //! na_grid: how many atoms on this (i,j,k) grid - //! block_size: dim is [na_grid], number of columns of a band - //! block_index: dim is [na_grid+1], total number of atomis orbitals - //! psir_vlbr3_DMR: dim is [bxyz][LD_pool] - //! dpsir_x: dim is [bxyz][LD_pool] - //! dpsir_y: dim is [bxyz][LD_pool] - //! dpsir_z: dim is [bxyz][LD_pool] - void cal_meshball_force( - const int grid_index, - const int na_grid, - const int* const block_size, - const int* const block_index, - const double* const* const psir_vlbr3_DMR, - const double* const* const dpsir_x, // psir_vlbr3[bxyz][LD_pool] - const double* const* const dpsir_y, // psir_vlbr3[bxyz][LD_pool] - const double* const* const dpsir_z, // psir_vlbr3[bxyz][LD_pool] - ModuleBase::matrix* force); - - //! Use grid integrals to compute the stress contributions - //! na_grid: how many atoms on this (i,j,k) grid - //! block_index: dim is [na_grid+1], total number of atomis orbitals - void cal_meshball_stress( - const int na_grid, - const int*const block_index, - const double*const psir_vlbr3_DMR, - const double*const dpsirr, - ModuleBase::matrix *stress); - - //! Use grid integrals to compute charge density - //! in gint_k_rho.cpp - //! calculate the charge density & kinetic energy density (tau) via grid integrals - void gint_kernel_rho(const int na_grid, - const int grid_index, - const double delta_r, - int* vindex, - const int LD_pool, - const UnitCell& ucell, - Gint_inout* inout); - - //! Use grid integrals to compute charge density in a meshball - void cal_meshball_rho(const int na_grid, - const int*const block_index, - const int*const vindex, - const double*const*const psir_ylm, - const double*const*const psir_DMR, - double*const rho); - - //! Use grid integrals to compute kinetic energy density tau - //!in meta-GGA functional - void gint_kernel_tau(const int na_grid, - const int grid_index, - const double delta_r, - int* vindex, - const int LD_pool, - Gint_inout* inout, - const UnitCell& ucell); - - //! Use grid integrals to compute kinetic energy density tau - //!in a meshball, used in meta-GGA functional calculations - void cal_meshball_tau(const int na_grid, - int* block_index, - int* vindex, - double** dpsix, - double** dpsiy, - double** dpsiz, - double** dpsix_dm, - double** dpsiy_dm, - double** dpsiz_dm, - double* rho); - - //! save the < phi_0i | V | phi_Rj > in sparse H matrix. - //! stores Hamiltonian in sparse format - hamilt::HContainer* hRGint = nullptr; - - //! size of vec is 4, only used when nspin = 4 - std::vector*> hRGint_tmp; - - //! stores Hamiltonian in sparse format - hamilt::HContainer>* hRGintCd = nullptr; - - //! stores DMR in sparse format - std::vector*> DMRGint; - - //! tmp tools used in transfer_DM2DtoGrid - hamilt::HContainer* DMRGint_full = nullptr; - - std::vector> pvdpRx_reduced; - std::vector> pvdpRy_reduced; - std::vector> pvdpRz_reduced; -}; - -#endif diff --git a/source/module_hamilt_lcao/module_gint/gint_force_cpu_interface.cpp b/source/module_hamilt_lcao/module_gint/gint_force_cpu_interface.cpp deleted file mode 100644 index e3b6a30077..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_force_cpu_interface.cpp +++ /dev/null @@ -1,313 +0,0 @@ -#include "gint.h" -#include "source_base/memory.h" -#include "source_base/timer.h" - -void Gint::gint_kernel_force(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_force"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_force"); - const UnitCell& ucell = *this->ucell; - const int max_size = this->gridt->max_atom; - const int ncyz = this->ny * this->nplane; - const double dv = ucell.omega / this->ncxyz; - const double delta_r = this->gridt->dr_uniform; - - -#pragma omp parallel -{ - ModuleBase::matrix* fvl_dphi_thread=inout->fvl_dphi; - ModuleBase::matrix* svl_dphi_thread=inout->svl_dphi; - if (inout->isforce) { - fvl_dphi_thread=new ModuleBase::matrix(*inout->fvl_dphi); - fvl_dphi_thread->zero_out(); - } - if (inout->isstress) { - svl_dphi_thread=new ModuleBase::matrix(*inout->svl_dphi); - svl_dphi_thread->zero_out(); - } - std::vector block_iw(max_size,0); - std::vector block_index(max_size+1,0); - std::vector block_size(max_size,0); - std::vector vldr3(this->bxyz,0.0); -#pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - Gint_Tools::get_gint_vldr3(vldr3.data(), - inout->vl, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - //prepare block information - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - Gint_Tools::get_block_info(*this->gridt, this->bxyz, na_grid, grid_index, - block_iw.data(), block_index.data(), block_size.data(), - cal_flag.get_ptr_2D()); - const int LD_pool = block_index[na_grid]; - - //evaluate psi and dpsi on grids - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_x(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_y(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_z(this->bxyz, LD_pool); - - Gint_Tools::cal_dpsir_ylm(*this->gridt, this->bxyz, na_grid, grid_index, delta_r, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(),psir_ylm.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D()); - - //calculating f_mu(r) = v(r)*psi_mu(r)*dv - const ModuleBase::Array_Pool psir_vlbr3 = - Gint_Tools::get_psir_vlbr3(this->bxyz, na_grid, LD_pool, block_index.data(), - cal_flag.get_ptr_2D(), vldr3.data(), psir_ylm.get_ptr_2D()); - - ModuleBase::Array_Pool psir_vlbr3_DM(this->bxyz, LD_pool); - ModuleBase::GlobalFunc::ZEROS(psir_vlbr3_DM.get_ptr_1D(), this->bxyz*LD_pool); - - //calculating g_mu(r) = sum_nu rho_mu,nu f_nu(r) - Gint_Tools::mult_psi_DMR( - *this->gridt, - this->bxyz, - LD_pool, - grid_index, - na_grid, - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D(), - psir_vlbr3.get_ptr_2D(), - psir_vlbr3_DM.get_ptr_2D(), - this->DMRGint[inout->ispin], - false); - - if(inout->isforce) - { - //do integration to get force - this-> cal_meshball_force(grid_index, na_grid, block_size.data(), block_index.data(), - psir_vlbr3_DM.get_ptr_2D(), dpsir_ylm_x.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D(), - fvl_dphi_thread); - } - if(inout->isstress) - { - //calculating g_mu(r)*(r-R) where R is the location of atom - - // The array dpsirr contains derivatives of psir in the xx, xy, xz, yy, yz, zz directions, - // with each set of six numbers representing the derivatives in these respective directions. - ModuleBase::Array_Pool dpsirr_ylm(this->bxyz, LD_pool * 6); - Gint_Tools::cal_dpsirr_ylm(*this->gridt, this->bxyz, na_grid, grid_index, block_index.data(), - block_size.data(), cal_flag.get_ptr_2D(),dpsir_ylm_x.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(),dpsir_ylm_z.get_ptr_2D(), - dpsirr_ylm.get_ptr_2D()); - - //do integration to get stress - this-> cal_meshball_stress(na_grid, block_index.data(), psir_vlbr3_DM.get_ptr_1D(), - dpsirr_ylm.get_ptr_1D(), svl_dphi_thread); - } - } -#pragma omp critical(gint) - { - if (inout->isforce) { - inout->fvl_dphi[0] += fvl_dphi_thread[0]; - delete fvl_dphi_thread; - } - if (inout->isstress) { - inout->svl_dphi[0] += svl_dphi_thread[0]; - delete svl_dphi_thread; - } - } -} - ModuleBase::TITLE("Gint_interface", "cal_gint_force"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_force"); -} - -void Gint::gint_kernel_force_meta(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_force_meta"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_force_meta"); - const UnitCell& ucell = *this->ucell; - const int max_size = this->gridt->max_atom; - const int ncyz = this->ny * this->nplane; - const double dv = ucell.omega / this->ncxyz; - const double delta_r = this->gridt->dr_uniform; - - -#pragma omp parallel -{ - ModuleBase::matrix* fvl_dphi_thread=inout->fvl_dphi; - ModuleBase::matrix* svl_dphi_thread=inout->svl_dphi; - if (inout->isforce) { - fvl_dphi_thread=new ModuleBase::matrix(*inout->fvl_dphi); - fvl_dphi_thread->zero_out(); - } - if (inout->isstress) { - svl_dphi_thread=new ModuleBase::matrix(*inout->svl_dphi); - svl_dphi_thread->zero_out(); - } - std::vector block_iw(max_size,0); - std::vector block_index(max_size+1,0); - std::vector block_size(max_size,0); - std::vector vldr3(this->bxyz,0.0); - std::vector vkdr3(this->bxyz,0.0); -#pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - Gint_Tools::get_gint_vldr3(vldr3.data(), - inout->vl, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - - Gint_Tools::get_gint_vldr3(vkdr3.data(), - inout->vofk, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - //prepare block information - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - Gint_Tools::get_block_info(*this->gridt, this->bxyz, na_grid, grid_index, - block_iw.data(), block_index.data(), block_size.data(), cal_flag.get_ptr_2D()); - const int LD_pool = block_index[na_grid]; - - //evaluate psi and dpsi on grids - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_x(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_y(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_z(this->bxyz, LD_pool); - ModuleBase::Array_Pool ddpsir_ylm_xx(this->bxyz, LD_pool); - ModuleBase::Array_Pool ddpsir_ylm_xy(this->bxyz, LD_pool); - ModuleBase::Array_Pool ddpsir_ylm_xz(this->bxyz, LD_pool); - ModuleBase::Array_Pool ddpsir_ylm_yy(this->bxyz, LD_pool); - ModuleBase::Array_Pool ddpsir_ylm_yz(this->bxyz, LD_pool); - ModuleBase::Array_Pool ddpsir_ylm_zz(this->bxyz, LD_pool); - - //psi and gradient of psi - Gint_Tools::cal_dpsir_ylm(*this->gridt, this->bxyz, na_grid, grid_index, delta_r, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D(), dpsir_ylm_x.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D()); - - //hessian of psi - Gint_Tools::cal_ddpsir_ylm(*this->gridt, this->bxyz, na_grid, grid_index, delta_r, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - ddpsir_ylm_xx.get_ptr_2D(), ddpsir_ylm_xy.get_ptr_2D(), ddpsir_ylm_xz.get_ptr_2D(), - ddpsir_ylm_yy.get_ptr_2D(), ddpsir_ylm_yz.get_ptr_2D(), ddpsir_ylm_zz.get_ptr_2D()); - - //calculating f_mu(r) = v(r)*psi_mu(r)*dv - const ModuleBase::Array_Pool psir_vlbr3 - = Gint_Tools::get_psir_vlbr3(this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vldr3.data(), psir_ylm.get_ptr_2D()); - const ModuleBase::Array_Pool dpsir_x_vlbr3 - = Gint_Tools::get_psir_vlbr3(this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vkdr3.data(), dpsir_ylm_x.get_ptr_2D()); - const ModuleBase::Array_Pool dpsir_y_vlbr3 - = Gint_Tools::get_psir_vlbr3(this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vkdr3.data(), dpsir_ylm_y.get_ptr_2D()); - const ModuleBase::Array_Pool dpsir_z_vlbr3 - = Gint_Tools::get_psir_vlbr3(this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vkdr3.data(), dpsir_ylm_z.get_ptr_2D()); - - ModuleBase::Array_Pool psir_vlbr3_DM(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsirx_v_DM(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsiry_v_DM(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsirz_v_DM(this->bxyz, LD_pool); - - ModuleBase::GlobalFunc::ZEROS(psir_vlbr3_DM.get_ptr_1D(), this->bxyz*LD_pool); - ModuleBase::GlobalFunc::ZEROS(dpsirx_v_DM.get_ptr_1D(), this->bxyz*LD_pool); - ModuleBase::GlobalFunc::ZEROS(dpsiry_v_DM.get_ptr_1D(), this->bxyz*LD_pool); - ModuleBase::GlobalFunc::ZEROS(dpsirz_v_DM.get_ptr_1D(), this->bxyz*LD_pool); - - //calculating g_mu(r) = sum_nu rho_mu,nu f_nu(r) - Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, - na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - psir_vlbr3.get_ptr_2D(), psir_vlbr3_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); - - Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, - na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_x_vlbr3.get_ptr_2D(), dpsirx_v_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); - - Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, - na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_y_vlbr3.get_ptr_2D(), dpsiry_v_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); - - Gint_Tools::mult_psi_DMR(*this->gridt, this->bxyz, LD_pool, grid_index, - na_grid, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_z_vlbr3.get_ptr_2D(), dpsirz_v_DM.get_ptr_2D(), this->DMRGint[inout->ispin], false); - - if(inout->isforce) - { - //do integration to get force - this-> cal_meshball_force(grid_index, na_grid, block_size.data(), block_index.data(), - psir_vlbr3_DM.get_ptr_2D(), dpsir_ylm_x.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D(), - fvl_dphi_thread); - - this-> cal_meshball_force(grid_index, na_grid, block_size.data(), block_index.data(), - dpsirx_v_DM.get_ptr_2D(), ddpsir_ylm_xx.get_ptr_2D(), ddpsir_ylm_xy.get_ptr_2D(), ddpsir_ylm_xz.get_ptr_2D(), - fvl_dphi_thread); - this-> cal_meshball_force(grid_index, na_grid, block_size.data(), block_index.data(), - dpsiry_v_DM.get_ptr_2D(), ddpsir_ylm_xy.get_ptr_2D(), ddpsir_ylm_yy.get_ptr_2D(), ddpsir_ylm_yz.get_ptr_2D(), - fvl_dphi_thread); - this-> cal_meshball_force(grid_index, na_grid, block_size.data(), block_index.data(), - dpsirz_v_DM.get_ptr_2D(), ddpsir_ylm_xz.get_ptr_2D(), ddpsir_ylm_yz.get_ptr_2D(), ddpsir_ylm_zz.get_ptr_2D(), - fvl_dphi_thread); - - } - if(inout->isstress) - { - //calculating g_mu(r)*(r-R) where R is the location of atom - ModuleBase::Array_Pool array(this->bxyz, LD_pool * 6); - - //the vxc part - Gint_Tools::cal_dpsirr_ylm(*this->gridt, this->bxyz, na_grid, grid_index, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D(), array.get_ptr_2D()); - //do integration to get stress - this-> cal_meshball_stress(na_grid, block_index.data(), psir_vlbr3_DM.get_ptr_1D(), - array.get_ptr_1D(), svl_dphi_thread); - - //partial x of vtau part - Gint_Tools::cal_dpsirr_ylm(*this->gridt, this->bxyz, na_grid, grid_index, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - ddpsir_ylm_xx.get_ptr_2D(), ddpsir_ylm_xy.get_ptr_2D(), ddpsir_ylm_xz.get_ptr_2D(), array.get_ptr_2D()); - //do integration to get stress - this-> cal_meshball_stress(na_grid, block_index.data(), dpsirx_v_DM.get_ptr_1D(), - array.get_ptr_1D(), svl_dphi_thread); - - //partial y of vtau part - Gint_Tools::cal_dpsirr_ylm(*this->gridt, this->bxyz, na_grid, grid_index, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - ddpsir_ylm_xy.get_ptr_2D(), ddpsir_ylm_yy.get_ptr_2D(), ddpsir_ylm_yz.get_ptr_2D(), array.get_ptr_2D()); - //do integration to get stress - this-> cal_meshball_stress(na_grid, block_index.data(), dpsiry_v_DM.get_ptr_1D(), - array.get_ptr_1D(), svl_dphi_thread); - - //partial z of vtau part - Gint_Tools::cal_dpsirr_ylm(*this->gridt, this->bxyz, na_grid, grid_index, block_index.data(), block_size.data(), cal_flag.get_ptr_2D(), - ddpsir_ylm_xz.get_ptr_2D(), ddpsir_ylm_yz.get_ptr_2D(), ddpsir_ylm_zz.get_ptr_2D(), array.get_ptr_2D()); - //do integration to get stress - this-> cal_meshball_stress(na_grid, block_index.data(), dpsirz_v_DM.get_ptr_1D(), - array.get_ptr_1D(), svl_dphi_thread); - } - } -#pragma omp critical(gint) - { - if (inout->isforce) { - inout->fvl_dphi[0] += fvl_dphi_thread[0]; - delete fvl_dphi_thread; - } - if (inout->isstress) { - inout->svl_dphi[0] += svl_dphi_thread[0]; - delete svl_dphi_thread; - } - } -} - ModuleBase::TITLE("Gint_interface", "cal_gint_force_meta"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_force_meta"); -} diff --git a/source/module_hamilt_lcao/module_gint/gint_force_gpu.cu b/source/module_hamilt_lcao/module_gint/gint_force_gpu.cu deleted file mode 100644 index cb3390aacc..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_force_gpu.cu +++ /dev/null @@ -1,301 +0,0 @@ -#ifdef _OPENMP -#include -#endif - -#include "gint_force_gpu.h" -#include "kernels/cuda/cuda_tools.cuh" -#include "kernels/cuda/gint_force.cuh" -#include "source_base/ylm.h" -#include "gint_tools.h" - -namespace GintKernel -{ -/** - * @brief Calculate forces and stresses - * @note The grid integration on the GPU is mainly divided into the following - * steps: - * 1. Use the CPU to divide the grid integration into subtasks. - * 2. Copy the subtask information to the GPU. - * 3. Calculate the matrix elements on the GPU. - * 4. Perform matrix multiplication on the GPU. - * 5. stress dot on the GPU. - * 6. force dot on the GPU. - * 7. Copy the results back to the host. - */ -void gint_fvl_gpu(const hamilt::HContainer* dm, - const double* vlocal, - double* force_in, - double* stress_in, - double dr, - const double* rcut, - const int isforce, - const int isstress, - const Grid_Technique& gridt, - const UnitCell& ucell) -{ - checkCuda(cudaSetDevice(gridt.dev_id)); - // checkCuda(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync)); - - const int nbzp = gridt.nbzp; - const int max_atom = gridt.max_atom; - const int nwmax = ucell.nwmax; - const int bxyz = gridt.bxyz; - const int max_atom_per_bcell = max_atom * bxyz; - const int max_atom_per_z = max_atom_per_bcell * nbzp; - const int max_phi_per_z = max_atom_per_z * ucell.nwmax; - const int max_atompair_per_z = max_atom * max_atom * nbzp; - const double vfactor = ucell.omega / gridt.ncxyz; - const int nczp = nbzp * gridt.bz; - const int nat=ucell.nat; - - const int num_streams = gridt.nstreams; - - std::vector streams(num_streams); - std::vector events(num_streams); - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamCreate(&streams[i])); - checkCuda(cudaEventCreateWithFlags(&events[i], cudaEventDisableTiming)); - } - - Cuda_Mem_Wrapper dr_part(3 * max_atom_per_z, num_streams, true); - Cuda_Mem_Wrapper atoms_type(max_atom_per_z, num_streams, true); - Cuda_Mem_Wrapper iat_on_nbz(max_atom_per_z, num_streams, true); - // The first number in every group of two represents the number of atoms on that bigcell. - // The second number represents the cumulative number of atoms up to that bigcell. - Cuda_Mem_Wrapper atoms_num_info(2 * nbzp, num_streams, true); - Cuda_Mem_Wrapper vldr3(nbzp * gridt.bxyz, num_streams, true); - - Cuda_Mem_Wrapper psi(max_phi_per_z, num_streams, false); - Cuda_Mem_Wrapper psi_dm(max_phi_per_z, num_streams, false); - Cuda_Mem_Wrapper dpsi(3 * max_phi_per_z, num_streams, false); - Cuda_Mem_Wrapper d2psi(6 * max_phi_per_z, num_streams, false); - - Cuda_Mem_Wrapper gemm_alpha(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_m(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_n(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_k(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_lda(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_ldb(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_ldc(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_A(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_B(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_C(max_atompair_per_z, num_streams, true); - - Cuda_Mem_Wrapper force(3 * nat, num_streams, true); - Cuda_Mem_Wrapper stress(6, num_streams, true); - - Cuda_Mem_Wrapper dm_matrix(dm->get_nnr(), 1, false); - // retrieve the density matrix on the host - checkCuda(cudaMemcpy(dm_matrix.get_device_pointer(), - dm->get_wrapper(), - dm->get_nnr() * sizeof(double), - cudaMemcpyHostToDevice)); - -#ifdef _OPENMP -const int max_thread_num = std::min(omp_get_max_threads(), num_streams); -#endif -#pragma omp parallel num_threads(max_thread_num) -{ -#ifdef _OPENMP - const int tid = omp_get_thread_num(); - const int num_threads = omp_get_num_threads(); - const int sid_start = tid * num_streams / num_threads; - const int thread_num_streams = tid == num_threads - 1 ? num_streams - sid_start : num_streams / num_threads; -#else - const int sid_start = 0; - const int thread_num_streams = num_streams; -#endif -#pragma omp for collapse(2) schedule(dynamic) - for (int i = 0; i < gridt.nbx; i++) - { - for (int j = 0; j < gridt.nby; j++) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gridt.dev_id)); - - const int sid = (i * gridt.nby + j) % thread_num_streams + sid_start; - checkCuda(cudaEventSynchronize(events[sid])); - - int max_m = 0; - int max_n = 0; - int atom_pair_num = 0; - int atoms_per_z = 0; - const int grid_index_ij = i * gridt.nby * nbzp + j * nbzp; - - gtask_force(gridt, - ucell, - grid_index_ij, - nczp, - vfactor, - vlocal, - atoms_per_z, - atoms_num_info.get_host_pointer(sid), - iat_on_nbz.get_host_pointer(sid), - atoms_type.get_host_pointer(sid), - dr_part.get_host_pointer(sid), - vldr3.get_host_pointer(sid)); - - alloc_mult_force(dm, - gridt, - ucell, - grid_index_ij, - max_atom, - atoms_num_info.get_host_pointer(sid), - psi.get_device_pointer(sid), - psi_dm.get_device_pointer(sid), - dm_matrix.get_device_pointer(), - max_m, - max_n, - atom_pair_num, - gemm_m.get_host_pointer(sid), - gemm_n.get_host_pointer(sid), - gemm_k.get_host_pointer(sid), - gemm_lda.get_host_pointer(sid), - gemm_ldb.get_host_pointer(sid), - gemm_ldc.get_host_pointer(sid), - gemm_A.get_host_pointer(sid), - gemm_B.get_host_pointer(sid), - gemm_C.get_host_pointer(sid)); - - dr_part.copy_host_to_device_async(streams[sid], sid, 3 * atoms_per_z); - atoms_type.copy_host_to_device_async(streams[sid], sid, atoms_per_z); - iat_on_nbz.copy_host_to_device_async(streams[sid], sid, atoms_per_z); - vldr3.copy_host_to_device_async(streams[sid], sid); - atoms_num_info.copy_host_to_device_async(streams[sid], sid); - - gemm_m.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_n.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_k.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_lda.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_ldb.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_ldc.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_A.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_B.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_C.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - checkCuda(cudaEventRecord(events[sid], streams[sid])); - - psi.memset_device_async(streams[sid], sid, 0); - psi_dm.memset_device_async(streams[sid], sid, 0); - dpsi.memset_device_async(streams[sid], sid, 0); - d2psi.memset_device_async(streams[sid], sid, 0); - - dim3 grid_psi(nbzp, gridt.bxyz); - dim3 block_psi(64); - get_psi_force<<>>( - gridt.ylmcoef_g, - dr, - bxyz, - nwmax, - max_atom, - gridt.atom_nwl_g, - gridt.atom_new_g, - gridt.atom_ylm_g, - gridt.atom_l_g, - gridt.atom_nw_g, - gridt.rcut_g, - gridt.nr_max, - gridt.psi_u_g, - gridt.mcell_pos_g, - dr_part.get_device_pointer(sid), - vldr3.get_device_pointer(sid), - atoms_type.get_device_pointer(sid), - atoms_num_info.get_device_pointer(sid), - psi.get_device_pointer(sid), - dpsi.get_device_pointer(sid), - d2psi.get_device_pointer(sid)); - checkCudaLastError(); - - gridt.fastest_matrix_mul(max_m, - max_n, - gemm_m.get_device_pointer(sid), - gemm_n.get_device_pointer(sid), - gemm_k.get_device_pointer(sid), - gemm_A.get_device_pointer(sid), - gemm_lda.get_device_pointer(sid), - gemm_B.get_device_pointer(sid), - gemm_ldb.get_device_pointer(sid), - gemm_C.get_device_pointer(sid), - gemm_ldc.get_device_pointer(sid), - atom_pair_num, - streams[sid], - nullptr); - - if (isforce){ - dim3 grid_force(nbzp); - dim3 block_force(64); - dot_product_force<<>>( - bxyz, - nwmax, - atoms_num_info.get_device_pointer(sid), - iat_on_nbz.get_device_pointer(sid), - dpsi.get_device_pointer(sid), - psi_dm.get_device_pointer(sid), - force.get_device_pointer(sid)); - checkCudaLastError(); - } - - if (isstress){ - dim3 grid_stress(nbzp); - dim3 block_stress(64); - dot_product_stress<<>>( - d2psi.get_device_pointer(sid), - psi_dm.get_device_pointer(sid), - atoms_per_z * nwmax * bxyz, - stress.get_device_pointer(sid)); - checkCudaLastError(); - } - } - } -} - - for(int i = 0; i < num_streams; i++) - { - stress.copy_device_to_host_async(streams[i], i); - force.copy_device_to_host_async(streams[i], i); - } - - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamSynchronize(streams[i])); - checkCuda(cudaEventDestroy(events[i])); - } - - if (isstress){ - for (int i = 0; i < num_streams; i++) - { - const int offset = 6 * i; - for (int j = 0; j < 6; j++) - { - stress_in[j] += stress.get_host_pointer()[offset + j]; - } - } - } - if (isforce){ - for (int i = 0; i < num_streams; i++) - { - const int offset = 3 * i * nat; - for (int j = 0; j < 3 * nat; j++) - { - force_in[j] += force.get_host_pointer()[offset + j]; - } - } - } - - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamDestroy(streams[i])); - } -} - -} // namespace GintKernel diff --git a/source/module_hamilt_lcao/module_gint/gint_force_gpu.h b/source/module_hamilt_lcao/module_gint/gint_force_gpu.h deleted file mode 100644 index 8808e6583c..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_force_gpu.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_GINT_GINT_FORCE_GPU_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_GINT_GINT_FORCE_GPU_H - -#include "module_hamilt_lcao/module_gint/gint.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" -namespace GintKernel -{ -void gint_fvl_gpu(const hamilt::HContainer* dm, - const double* vlocal, - double* force_in, - double* stress_in, - double dr, - const double* rcut, - const int isforce, - const int isstress, - const Grid_Technique& gridt, - const UnitCell& ucell); - -void gtask_force(const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int nczp, - const double vfactor, - const double* vlocal_global_value, - int& atoms_per_z, - int* atoms_num_info, - int* iat_on_nbz, - uint8_t* atoms_type, - double* dr_part, - double* vldr3); - -void alloc_mult_force(const hamilt::HContainer* dm, - const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int max_atom, - const int *atoms_num_info, - double* const psi_g, - double* const psi_dm_g, - double* const dm_matrix_g, - int& max_m, - int& max_n, - int& atom_pair_num, - int* mat_m, - int* mat_n, - int* mat_k, - int* mat_lda, - int* mat_ldb, - int* mat_ldc, - double** mat_A, - double** mat_B, - double** mat_C); - -} // namespace GintKernel -#endif diff --git a/source/module_hamilt_lcao/module_gint/gint_fvl_old.cpp b/source/module_hamilt_lcao/module_gint/gint_fvl_old.cpp deleted file mode 100644 index 3880ac8732..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_fvl_old.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "gint_k.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/array_pool.h" - -// This function utilizes the cache more effectively than calling the ddot function, thus performing faster. -void Gint::cal_meshball_force( - const int grid_index, - const int na_grid, // how many atoms on this (i,j,k) grid - const int*const block_size, // block_size[na_grid], number of columns of a band - const int*const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const double*const*const psir_vlbr3_DMR, // psir_vlbr3[this->bxyz][LD_pool] - const double*const*const dpsir_x, // psir_vlbr3[this->bxyz][LD_pool] - const double*const*const dpsir_y, // psir_vlbr3[this->bxyz][LD_pool] - const double*const*const dpsir_z, // psir_vlbr3[this->bxyz][LD_pool] - ModuleBase::matrix *force) -{ - for(int ia1=0;ia1gridt->bcell_start[grid_index] + ia1; - const int iat=this->gridt->which_atom[mcell_index]; // index of atom - double rx = 0; - double ry = 0; - double rz = 0; - for(int ib=0; ibbxyz; ib++) - { - for(int iw=0; iwbxyz; - - for(int i=0; i -#endif - -//========================================================= -// ModuleBase::Integral On 3D Grids, different from Grid_Integral -// Feature : Matrix Elements Of Local Potential For -// Numerical Orbitals -//========================================================= - -class Gint_Gamma : public Gint -{ - public: - - //! @brief move operator for the next ESolver to directly use its infomation - //! @param rhs - //! @return *this - Gint_Gamma& operator=(Gint_Gamma&& rhs); - - //! in gint_gamma_vl.cpp - //! there is an additional step in calculating vlocal for gamma point - //! namely the redistribution of Hamiltonian from grid to 2D block format - //! hence we have an additional layer outside the unified interface - void cal_vlocal(Gint_inout* inout, const bool new_e_iteration); - - //! in gint_gamma_env.cpp - //! calcualte the electronic wave functions via grid integral - void cal_env(const double* wfc, double* rho,const UnitCell &ucell); - - //! transfer this->hRGint to Veff::hR - void transfer_pvpR(hamilt::HContainer* hR,const UnitCell* ucell); - -private: - - //! pointer to density matrix - double*** DM = nullptr; - -}; - -#endif diff --git a/source/module_hamilt_lcao/module_gint/gint_gamma_env.cpp b/source/module_hamilt_lcao/module_gint/gint_gamma_env.cpp deleted file mode 100644 index 9bc4171fea..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_gamma_env.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "gint_gamma.h" -#include "grid_technique.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_base/array_pool.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_pw/hamilt_pwdft/global.h" - -void Gint_Gamma::cal_env(const double* wfc, double* rho,const UnitCell& ucell) -{ - ModuleBase::TITLE("Grid_Integral", "cal_env"); - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - const double delta_r = this->gridt->dr_uniform; - const int max_size = this->gridt->max_atom; - if (max_size <= 0){ - ModuleBase::WARNING_QUIT("Gint_Gamma::cal_env", - "the max_size is less than 0!"); - } - const int nbx = this->gridt->nbx; - const int nby = this->gridt->nby; - const int nbz = this->gridt->nbzp; - const int ncyz = this->ny * this->nplane; // mohan add 2012-03-25 - const int bxyz = this->bxyz; - - #pragma omp parallel - { - std::vector block_iw(max_size, 0); - std::vector block_index(max_size+1, 0); - std::vector block_size(max_size, 0); - std::vector vindex(bxyz,0); - #pragma omp for - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) - { - - // get the value: how many atoms has orbital value on this grid. - const int size = this->gridt->how_many_atoms[grid_index]; - if (size == 0) - continue; - - // int *block_iw, *block_index, *block_size; - ModuleBase::Array_Pool cal_flag(bxyz, size); - Gint_Tools::get_block_info(*this->gridt, - this->bxyz, - size, - grid_index, - block_iw.data(), - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D()); - const int LD_pool = block_index[size]; - - // evaluate psi on grids - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - Gint_Tools::cal_psir_ylm(*this->gridt, - this->bxyz, - size, - grid_index, - delta_r, - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D()); - - Gint_Tools::get_vindex(this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - vindex.data()); - - for (int ia1 = 0; ia1 < size; ia1++) - { - const int mcell_index1 = this->gridt->bcell_start[grid_index] + ia1; - const int iat = this->gridt->which_atom[mcell_index1]; - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - // get the start index of local orbitals. - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int ib = 0; ib < this->bxyz; ib++) - { - if (cal_flag[ib][ia1]) - { - int iw1_lo = this->gridt->trace_lo[start1]; - double* psi1 = &psir_ylm[ib][block_index[ia1]]; - double tmp = 0.0; - for (int iw = 0; iw < atom1->nw; ++iw, ++iw1_lo) - { - tmp += psi1[iw] * wfc[iw1_lo]; - } // iw - rho[vindex[ib]] += tmp; - } // cal_flag - } // ib - } // ia1 - } - } - return; -} diff --git a/source/module_hamilt_lcao/module_gint/gint_gamma_vl.cpp b/source/module_hamilt_lcao/module_gint/gint_gamma_vl.cpp deleted file mode 100644 index 3e16cc44cc..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_gamma_vl.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//========================================================= -// REFACTOR : Peize Lin, 2021.06.28 -//========================================================= -#include "gint_gamma.h" -#include "gint_tools.h" -#include "grid_technique.h" -#include "source_base/blas_connector.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/ORB_read.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/hamilt_pwdft/global.h" - -#ifdef _OPENMP -#include -#endif - -#ifdef __MKL -#include -#endif - -extern "C" -{ - void Cblacs_gridinfo(int icontxt, int* nprow, int* npcol, int* myprow, int* mypcol); - void Cblacs_pinfo(int* myid, int* nprocs); - void Cblacs_pcoord(int icontxt, int pnum, int* prow, int* pcol); -} - -void Gint_Gamma::cal_vlocal(Gint_inout* inout, bool new_e_iteration) -{ - const int max_size = this->gridt->max_atom; - const int lgd = this->gridt->lgd; - - if (inout->job == Gint_Tools::job_type::vlocal || inout->job == Gint_Tools::job_type::vlocal_meta) - { - if (max_size > 0 && lgd > 0) - { - this->hRGint->set_zero(); - } - - this->cal_gint(inout); - } -} - -#ifdef __MPI -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#endif -void Gint_Gamma::transfer_pvpR(hamilt::HContainer* hR, const UnitCell* ucell) -{ - ModuleBase::TITLE("Gint_Gamma", "transfer_pvpR"); - ModuleBase::timer::tick("Gint_Gamma", "transfer_pvpR"); - - for (int iap = 0; iap < this->hRGint->size_atom_pairs(); iap++) - { - auto& ap = this->hRGint->get_atom_pair(iap); - const int iat1 = ap.get_atom_i(); - const int iat2 = ap.get_atom_j(); - if (iat1 > iat2) - { - // fill lower triangle matrix with upper triangle matrix - // gamma_only case, only 1 R_index in each AtomPair - // the upper is - const hamilt::AtomPair* upper_ap = this->hRGint->find_pair(iat2, iat1); -#ifdef __DEBUG - assert(upper_ap != nullptr); -#endif - double* lower_matrix = ap.get_pointer(0); - for (int irow = 0; irow < ap.get_row_size(); ++irow) - { - for (int icol = 0; icol < ap.get_col_size(); ++icol) - { - *lower_matrix++ = upper_ap->get_value(icol, irow); - } - } - } - } - -#ifdef __MPI - int size = 0; - MPI_Comm_size(MPI_COMM_WORLD, &size); - if (size == 1) - { - hR->add(*this->hRGint); - } - else - { - hamilt::transferSerials2Parallels(*this->hRGint, hR); - } -#else - hR->add(*this->hRGint); -#endif - - ModuleBase::timer::tick("Gint_Gamma", "transfer_pvpR"); - - return; -} diff --git a/source/module_hamilt_lcao/module_gint/gint_gpu_interface.cpp b/source/module_hamilt_lcao/module_gint/gint_gpu_interface.cpp deleted file mode 100644 index 683f003f4d..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_gpu_interface.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "gint.h" -#include "gint_force_gpu.h" -#include "module_parameter/parameter.h" -#include "gint_rho_gpu.h" -#include "gint_vl_gpu.h" -#include "source_base/memory.h" -#include "source_base/timer.h" - -void Gint::gpu_vlocal_interface(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_vlocal"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_vlocal"); - - const UnitCell& ucell = *this->ucell; - const double dr = this->gridt->dr_uniform; - double ylmcoef[100]; - ModuleBase::GlobalFunc::ZEROS(ylmcoef, 100); - for (int i = 0; i < 100; i++) { - ylmcoef[i] = ModuleBase::Ylm::ylmcoef[i]; - } - - hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hRGint_tmp[inout->ispin]; - GintKernel::gint_vl_gpu(hRGint_kernel, - inout->vl, - ylmcoef, - dr, - this->gridt->rcuts.data(), - *this->gridt, - ucell); - - ModuleBase::TITLE("Gint_interface", "cal_gint_vlocal"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_vlocal"); -} - -void Gint::gpu_rho_interface(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_rho"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_rho"); - - const UnitCell& ucell = *this->ucell; - const double dr = this->gridt->dr_uniform; - double ylmcoef[100]; - ModuleBase::GlobalFunc::ZEROS(ylmcoef, 100); - for (int i = 0; i < 100; i++) { - ylmcoef[i] = ModuleBase::Ylm::ylmcoef[i]; - } - int nrxx = this->gridt->ncx * this->gridt->ncy * this->nplane; - for (int is = 0; is < PARAM.inp.nspin; ++is) { - ModuleBase::GlobalFunc::ZEROS(inout->rho[is], nrxx); - GintKernel::gint_rho_gpu(this->DMRGint[is], - ylmcoef, - dr, - this->gridt->rcuts.data(), - *this->gridt, - ucell, - inout->rho[is]); - } - ModuleBase::TITLE("Gint_interface", "cal_gint_rho"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_rho"); -} - -void Gint::gpu_force_interface(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_force"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_force"); - - const UnitCell& ucell = *this->ucell; - const double dr = this->gridt->dr_uniform; - double ylmcoef[100]; - ModuleBase::GlobalFunc::ZEROS(ylmcoef, 100); - for (int i = 0; i < 100; i++) { - ylmcoef[i] = ModuleBase::Ylm::ylmcoef[i]; - } - - const int ncyz = this->ny * this->nplane; - int nat = ucell.nat; - const int isforce = inout->isforce; - const int isstress = inout->isstress; - if (isforce || isstress) { - std::vector force(nat * 3, 0.0); - std::vector stress(6, 0.0); - GintKernel::gint_fvl_gpu(this->DMRGint[inout->ispin], - inout->vl, - force.data(), - stress.data(), - dr, - this->gridt->rcuts.data(), - isforce, - isstress, - *this->gridt, - ucell); - if (inout->isforce) { - for (int iat = 0; iat < nat; iat++) { - inout->fvl_dphi[0](iat, 0) += force[iat * 3]; - inout->fvl_dphi[0](iat, 1) += force[iat * 3 + 1]; - inout->fvl_dphi[0](iat, 2) += force[iat * 3 + 2]; - } - } - if (inout->isstress) { - inout->svl_dphi[0](0, 0) += stress[0]; - inout->svl_dphi[0](0, 1) += stress[1]; - inout->svl_dphi[0](0, 2) += stress[2]; - inout->svl_dphi[0](1, 1) += stress[3]; - inout->svl_dphi[0](1, 2) += stress[4]; - inout->svl_dphi[0](2, 2) += stress[5]; - } - } - - ModuleBase::TITLE("Gint_interface", "cal_gint_force"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_force"); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_k.h b/source/module_hamilt_lcao/module_gint/gint_k.h deleted file mode 100644 index d916af8fb8..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_k.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_GINT_GINT_K_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_GINT_GINT_K_H - -#include "gint.h" -#include "grid_technique.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_estate/module_charge/charge.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" - -// add by jingan for map<> in 2021-12-2, will be deleted in the future -#include "source_base/abfs-vector3_order.h" - -class Gint_k : public Gint { - public: - /// @brief move operator for the next ESolver to directly use its infomation - /// @param rhs - /// @return *this - Gint_k& operator=(Gint_k&& rhs); - - //------------------------------------------------------ - // in gint_k_pvpr.cpp - //------------------------------------------------------ - // pvpR and reset_spin/get_spin : auxilliary methods - // for calculating hamiltonian - - // allocate the matrix element. - void allocate_pvdpR(); - // destroy the temporary matrix element. - void destroy_pvdpR(); - - /** - * @brief transfer pvpR to this->hRGint - * then pass this->hRGint to Veff::hR - */ - void transfer_pvpR(hamilt::HContainer* hR, const UnitCell* ucell_in, const Grid_Driver* gd); - void transfer_pvpR(hamilt::HContainer>* hR, const UnitCell* ucell_in, const Grid_Driver* gd); - - //------------------------------------------------------ - // in gint_k_env.cpp - //------------------------------------------------------ - // calculate the envelop function via grid integrals - void cal_env_k(int ik, - const std::complex* psi_k, - double* rho, - const std::vector>& kvec_c, - const std::vector>& kvec_d, - const UnitCell& ucell); - - //------------------------------------------------------ - // in gint_k_sparse1.cpp - //------------------------------------------------------ - // similar to the above 3, just for the derivative - void distribute_pvdpR_sparseMatrix( - const int current_spin, - const int dim, - const double& sparse_threshold, - const std::map, - std::map>>& - pvdpR_sparseMatrix, - LCAO_HS_Arrays& HS_Arrays, - const Parallel_Orbitals* pv); - - void distribute_pvdpR_soc_sparseMatrix( - const int dim, - const double& sparse_threshold, - const std::map< - Abfs::Vector3_Order, - std::map>>>& - pvdpR_soc_sparseMatrix, - LCAO_HS_Arrays& HS_Arrays, - const Parallel_Orbitals* pv); - - void cal_dvlocal_R_sparseMatrix(const int& current_spin, - const double& sparse_threshold, - LCAO_HS_Arrays& HS_Arrays, - const Parallel_Orbitals* pv, - const UnitCell& ucell, - const Grid_Driver& gdriver); - - private: - //---------------------------- - // key variable - //---------------------------- -}; - -#endif diff --git a/source/module_hamilt_lcao/module_gint/gint_k_env.cpp b/source/module_hamilt_lcao/module_gint/gint_k_env.cpp deleted file mode 100644 index 54dad02e68..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_k_env.cpp +++ /dev/null @@ -1,138 +0,0 @@ -#include "gint_k.h" -#include "grid_technique.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/array_pool.h" -#include "source_base/vector3.h" - -void Gint_k::cal_env_k(int ik, - const std::complex* psi_k, - double* rho, - const std::vector>& kvec_c, - const std::vector>& kvec_d, - const UnitCell& ucell) -{ - ModuleBase::TITLE("Gint_k", "cal_env_k"); - ModuleBase::timer::tick("Gint_k", "cal_env_k"); - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - const double delta_r = this->gridt->dr_uniform; - const int max_size = this->gridt->max_atom; - if (max_size <= 0){ - ModuleBase::WARNING_QUIT("Gint_Gamma::cal_env", - "the max_size is less than 0!"); - } - const int nbx = this->gridt->nbx; - const int nby = this->gridt->nby; - const int nbz = this->gridt->nbzp; - const int ncyz = this->ny * this->nplane; // mohan add 2012-03-25 - - #pragma omp parallel - { - std::vector vindex(this->bxyz, 0); - std::vector block_iw(max_size, 0); - std::vector block_index(max_size + 1, 0); - std::vector block_size(max_size, 0); - #pragma omp for - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) - { - - // get the value: how many atoms has orbital value on this grid. - const int size = this->gridt->how_many_atoms[grid_index]; - if (size == 0) - { - continue; - } - ModuleBase::Array_Pool cal_flag(this->bxyz, max_size); - Gint_Tools::get_block_info(*this->gridt, - this->bxyz, - size, - grid_index, - block_iw.data(), - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D()); - const int LD_pool = block_index[size]; - - // evaluate psi on grids - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - Gint_Tools::cal_psir_ylm(*this->gridt, - this->bxyz, - size, - grid_index, - delta_r, - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D()); - - Gint_Tools::get_vindex(this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - vindex.data()); - - for (int ia1 = 0; ia1 < size; ia1++) - { - const int mcell_index1 = this->gridt->bcell_start[grid_index] + ia1; - const int iat = this->gridt->which_atom[mcell_index1]; - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - - // find R by which_unitcell and cal kphase - const int id_ucell = this->gridt->which_unitcell[mcell_index1]; - ModuleBase::Vector3 R(this->gridt->get_ucell_coords(id_ucell)); - // std::cout << "kvec_d: " << kvec_d[ik].x << " " << kvec_d[ik].y << " " << kvec_d[ik].z << std::endl; - // std::cout << "kvec_c: " << kvec_c[ik].x << " " << kvec_c[ik].y << " " << kvec_c[ik].z << std::endl; - // std::cout << "R: " << R.x << " " << R.y << " " << R.z << std::endl; - const double arg = (kvec_d[ik] * R) * ModuleBase::TWO_PI; - const double arg1 - = (kvec_c[ik] * (R.x * ucell.a1 + R.y * ucell.a2 + R.z * ucell.a3)) * ModuleBase::TWO_PI; - // std::cout << "arg0=" << arg << ", arg1=" << arg1 << std::endl; - const std::complex kphase = std::complex(cos(arg), sin(arg)); - - // get the start index of local orbitals. - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int ib = 0; ib < this->bxyz; ib++) - { - if (cal_flag[ib][ia1]) - { - int iw1_lo = 0; - double* psi1 = &psir_ylm[ib][block_index[ia1]]; - std::complex tmp{0.0, 0.0}; - if (PARAM.inp.nspin == 4) // is it a simple add of 2 spins? - { - for (int is = 0; is < 2; ++is) - { - iw1_lo = this->gridt->trace_lo[start1] / PARAM.globalv.npol - + this->gridt->lgd / PARAM.globalv.npol * is; - for (int iw = 0; iw < atom1->nw; ++iw, ++iw1_lo) - { - tmp += std::complex(psi1[iw], 0.0) * psi_k[iw1_lo] * kphase; - } - } - } - else - { - iw1_lo = this->gridt->trace_lo[start1]; - for (int iw = 0; iw < atom1->nw; ++iw, ++iw1_lo) - { - tmp += std::complex(psi1[iw], 0.0) * psi_k[iw1_lo] * kphase; - } - } - rho[vindex[ib]] += tmp.real(); - } // cal_flag - } // ib - } // ia1 - } // i - } - ModuleBase::timer::tick("Gint_k", "cal_env_k"); - return; -} diff --git a/source/module_hamilt_lcao/module_gint/gint_k_pvdpr.cpp b/source/module_hamilt_lcao/module_gint/gint_k_pvdpr.cpp deleted file mode 100644 index 18de479616..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_k_pvdpr.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "gint_k.h" -#include "grid_technique.h" -#include "module_parameter/parameter.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/memory.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/tool_threading.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_pw/hamilt_pwdft/global.h" - -void Gint_k::allocate_pvdpR(void) -{ - ModuleBase::TITLE("Gint_k","allocate_pvpR"); - - const int nspin = PARAM.inp.nspin; - assert(nspin>0); - - //xiaohui modify 2015-05-30 - // the number of matrix element is this->gridt->nnrg. - for(int is =0;ispvdpRx_reduced.push_back(hamilt::HContainer(this->ucell->nat)); - pvdpRx_reduced[is].insert_ijrs(this->gridt->get_ijr_info(), *this->ucell); - pvdpRx_reduced[is].allocate(nullptr, true); - this->pvdpRy_reduced.push_back(hamilt::HContainer(this->ucell->nat)); - pvdpRy_reduced[is].insert_ijrs(this->gridt->get_ijr_info(), *this->ucell); - pvdpRy_reduced[is].allocate(nullptr, true); - this->pvdpRz_reduced.push_back(hamilt::HContainer(this->ucell->nat)); - pvdpRz_reduced[is].insert_ijrs(this->gridt->get_ijr_info(), *this->ucell); - pvdpRz_reduced[is].allocate(nullptr, true); - } - - ModuleBase::Memory::record("pvdpR_reduced", 3 * sizeof(double) * this->gridt->nnrg * nspin); - return; -} - -void Gint_k::destroy_pvdpR(void) -{ - ModuleBase::TITLE("Gint_k","destroy_pvpR"); - - const int nspin = PARAM.inp.nspin; - assert(nspin>0); - pvdpRx_reduced.clear(); - pvdpRy_reduced.clear(); - pvdpRz_reduced.clear(); - pvdpRx_reduced.shrink_to_fit(); - pvdpRy_reduced.shrink_to_fit(); - pvdpRz_reduced.shrink_to_fit(); - return; -} diff --git a/source/module_hamilt_lcao/module_gint/gint_k_pvpr.cpp b/source/module_hamilt_lcao/module_gint/gint_k_pvpr.cpp deleted file mode 100644 index 558290f99d..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_k_pvpr.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include "gint_k.h" -#include "grid_technique.h" -#include "module_parameter/parameter.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/libm/libm.h" -#include "source_base/memory.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/tool_threading.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#ifdef __MPI -#include -#endif - -// transfer_pvpR, NSPIN = 1 or 2 -void Gint_k::transfer_pvpR(hamilt::HContainer* hR, const UnitCell* ucell, const Grid_Driver* gd) -{ - ModuleBase::TITLE("Gint_k", "transfer_pvpR"); - ModuleBase::timer::tick("Gint_k", "transfer_pvpR"); - - for (int iap = 0; iap < this->hRGint->size_atom_pairs(); iap++) - { - auto& ap = this->hRGint->get_atom_pair(iap); - const int iat1 = ap.get_atom_i(); - const int iat2 = ap.get_atom_j(); - if (iat1 > iat2) - { - // fill lower triangle matrix with upper triangle matrix - // the upper is - const hamilt::AtomPair* upper_ap = this->hRGint->find_pair(iat2, iat1); - const hamilt::AtomPair* lower_ap = this->hRGint->find_pair(iat1, iat2); -#ifdef __DEBUG - assert(upper_ap != nullptr); -#endif - for (int ir = 0; ir < ap.get_R_size(); ir++) - { - auto R_index = ap.get_R_index(ir); - auto upper_mat = upper_ap->find_matrix(-R_index); - auto lower_mat = lower_ap->find_matrix(R_index); - for (int irow = 0; irow < upper_mat->get_row_size(); ++irow) - { - for (int icol = 0; icol < upper_mat->get_col_size(); ++icol) - { - lower_mat->get_value(icol, irow) = upper_ap->get_value(irow, icol); - } - } - } - } - } -#ifdef __MPI - int size = 0; - MPI_Comm_size(MPI_COMM_WORLD, &size); - if (size == 1) - { - hR->add(*this->hRGint); - } - else - { - hamilt::transferSerials2Parallels(*this->hRGint, hR); - } -#else - hR->add(*this->hRGint); -#endif - ModuleBase::timer::tick("Gint_k", "transfer_pvpR"); - return; -} - -// transfer_pvpR, NSPIN = 4 -void Gint_k::transfer_pvpR(hamilt::HContainer>* hR, - const UnitCell* ucell_in, - const Grid_Driver* gd) -{ - ModuleBase::TITLE("Gint_k", "transfer_pvpR"); - ModuleBase::timer::tick("Gint_k", "transfer_pvpR"); - - this->hRGintCd->set_zero(); - - for (int iap = 0; iap < this->hRGintCd->size_atom_pairs(); iap++) - { - auto* ap = &this->hRGintCd->get_atom_pair(iap); - const int iat1 = ap->get_atom_i(); - const int iat2 = ap->get_atom_j(); - if (iat1 <= iat2) - { - hamilt::AtomPair>* upper_ap = ap; - hamilt::AtomPair>* lower_ap = this->hRGintCd->find_pair(iat2, iat1); - const hamilt::AtomPair* ap_nspin_0 = this->hRGint_tmp[0]->find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_3 = this->hRGint_tmp[3]->find_pair(iat1, iat2); - for (int ir = 0; ir < upper_ap->get_R_size(); ir++) - { - const auto R_index = upper_ap->get_R_index(ir); - auto upper_mat = upper_ap->find_matrix(R_index); - auto mat_nspin_0 = ap_nspin_0->find_matrix(R_index); - auto mat_nspin_3 = ap_nspin_3->find_matrix(R_index); - - // The row size and the col size of upper_matrix is double that of matrix_nspin_0 - for (int irow = 0; irow < mat_nspin_0->get_row_size(); ++irow) - { - for (int icol = 0; icol < mat_nspin_0->get_col_size(); ++icol) - { - upper_mat->get_value(2*irow, 2*icol) = mat_nspin_0->get_value(irow, icol) + mat_nspin_3->get_value(irow, icol); - upper_mat->get_value(2*irow+1, 2*icol+1) = mat_nspin_0->get_value(irow, icol) - mat_nspin_3->get_value(irow, icol); - } - } - - if (PARAM.globalv.domag) - { - const hamilt::AtomPair* ap_nspin_1 = this->hRGint_tmp[1]->find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_2 = this->hRGint_tmp[2]->find_pair(iat1, iat2); - const auto mat_nspin_1 = ap_nspin_1->find_matrix(R_index); - const auto mat_nspin_2 = ap_nspin_2->find_matrix(R_index); - for (int irow = 0; irow < mat_nspin_1->get_row_size(); ++irow) - { - for (int icol = 0; icol < mat_nspin_1->get_col_size(); ++icol) - { - upper_mat->get_value(2*irow, 2*icol+1) = mat_nspin_1->get_value(irow, icol) + std::complex(0.0, 1.0) * mat_nspin_2->get_value(irow, icol); - upper_mat->get_value(2*irow+1, 2*icol) = mat_nspin_1->get_value(irow, icol) - std::complex(0.0, 1.0) * mat_nspin_2->get_value(irow, icol); - } - } - } - - // fill the lower triangle matrix - if (iat1 < iat2) - { - auto lower_mat = lower_ap->find_matrix(-R_index); - for (int irow = 0; irow < upper_mat->get_row_size(); ++irow) - { - for (int icol = 0; icol < upper_mat->get_col_size(); ++icol) - { - lower_mat->get_value(icol, irow) = conj(upper_mat->get_value(irow, icol)); - } - } - } - } - } - } - - // =================================== - // transfer HR from Gint to Veff, std::complex>> - // =================================== -#ifdef __MPI - int size; - MPI_Comm_size(MPI_COMM_WORLD, &size); - if (size == 1) - { - hR->add(*this->hRGintCd); - } - else - { - hamilt::transferSerials2Parallels>(*this->hRGintCd, hR); - } -#else - hR->add(*this->hRGintCd); -#endif - - ModuleBase::timer::tick("Gint_k", "transfer_pvpR"); - return; -} diff --git a/source/module_hamilt_lcao/module_gint/gint_k_sparse1.cpp b/source/module_hamilt_lcao/module_gint/gint_k_sparse1.cpp deleted file mode 100644 index 4cd9cd7dbb..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_k_sparse1.cpp +++ /dev/null @@ -1,554 +0,0 @@ -#include "gint_k.h" -#include "grid_technique.h" -#include "module_parameter/parameter.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/memory.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" - -void Gint_k::distribute_pvdpR_sparseMatrix( - const int current_spin, - const int dim, - const double& sparse_threshold, - const std::map, std::map>>& pvdpR_sparseMatrix, - LCAO_HS_Arrays& HS_Arrays, - const Parallel_Orbitals* pv) -{ - ModuleBase::TITLE("Gint_k", "distribute_pvdpR_sparseMatrix"); - - int total_R_num = HS_Arrays.all_R_coor.size(); - int* nonzero_num = new int[total_R_num]; - int* minus_nonzero_num = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(nonzero_num, total_R_num); - ModuleBase::GlobalFunc::ZEROS(minus_nonzero_num, total_R_num); - int count = 0; - for (auto& R_coor: HS_Arrays.all_R_coor) - { - auto iter = pvdpR_sparseMatrix.find(R_coor); - if (iter != pvdpR_sparseMatrix.end()) - { - for (auto& row_loop: iter->second) - { - nonzero_num[count] += row_loop.second.size(); - } - } - - auto minus_R_coor = -1 * R_coor; - - iter = pvdpR_sparseMatrix.find(minus_R_coor); - if (iter != pvdpR_sparseMatrix.end()) - { - for (auto& row_loop: iter->second) - { - minus_nonzero_num[count] += row_loop.second.size(); - } - } - - count++; - } - - Parallel_Reduce::reduce_all(nonzero_num, total_R_num); - Parallel_Reduce::reduce_all(minus_nonzero_num, total_R_num); - // Parallel_Reduce::reduce_pool(nonzero_num, total_R_num); - // Parallel_Reduce::reduce_pool(minus_nonzero_num, total_R_num); - - double* tmp = nullptr; - tmp = new double[PARAM.globalv.nlocal]; - - count = 0; - for (auto& R_coor: HS_Arrays.all_R_coor) - { - if (nonzero_num[count] != 0 || minus_nonzero_num[count] != 0) - { - auto minus_R_coor = -1 * R_coor; - - for (int row = 0; row < PARAM.globalv.nlocal; ++row) - { - ModuleBase::GlobalFunc::ZEROS(tmp, PARAM.globalv.nlocal); - - auto iter = pvdpR_sparseMatrix.find(R_coor); - if (iter != pvdpR_sparseMatrix.end()) - { - - if (this->gridt->trace_lo[row] >= 0) - { - auto row_iter = iter->second.find(row); - if (row_iter != iter->second.end()) - { - for (auto& value: row_iter->second) - { - tmp[value.first] = value.second; - } - } - } - } - - auto minus_R_iter = pvdpR_sparseMatrix.find(minus_R_coor); - if (minus_R_iter != pvdpR_sparseMatrix.end()) - { - for (int col = 0; col < row; ++col) - { - if (this->gridt->trace_lo[col] >= 0) - { - auto row_iter = minus_R_iter->second.find(col); - if (row_iter != minus_R_iter->second.end()) - { - auto col_iter = row_iter->second.find(row); - if (col_iter != row_iter->second.end()) - { - tmp[col] = col_iter->second; - } - } - } - } - } - - Parallel_Reduce::reduce_pool(tmp, PARAM.globalv.nlocal); - - if (pv->global2local_row(row) >= 0) - { - for (int col = 0; col < PARAM.globalv.nlocal; ++col) - { - if (pv->global2local_col(col) >= 0) - { - if (std::abs(tmp[col]) > sparse_threshold) - { - if (dim == 0) - { - double& value = HS_Arrays.dHRx_sparse[current_spin][R_coor][row][col]; - value += tmp[col]; - if (std::abs(value) <= sparse_threshold) - { - HS_Arrays.dHRx_sparse[current_spin][R_coor][row].erase(col); - } - } - if (dim == 1) - { - double& value = HS_Arrays.dHRy_sparse[current_spin][R_coor][row][col]; - value += tmp[col]; - if (std::abs(value) <= sparse_threshold) - { - HS_Arrays.dHRy_sparse[current_spin][R_coor][row].erase(col); - } - } - if (dim == 2) - { - double& value = HS_Arrays.dHRz_sparse[current_spin][R_coor][row][col]; - value += tmp[col]; - if (std::abs(value) <= sparse_threshold) - { - HS_Arrays.dHRz_sparse[current_spin][R_coor][row].erase(col); - } - } - } - } - } - } - } - } - - count++; - } - - delete[] nonzero_num; - delete[] minus_nonzero_num; - delete[] tmp; - nonzero_num = nullptr; - minus_nonzero_num = nullptr; - tmp = nullptr; - - return; -} - -void Gint_k::distribute_pvdpR_soc_sparseMatrix( - const int dim, - const double& sparse_threshold, - const std::map, std::map>>>& - pvdpR_soc_sparseMatrix, - LCAO_HS_Arrays& HS_Arrays, - const Parallel_Orbitals* pv) -{ - ModuleBase::TITLE("Gint_k", "distribute_pvdpR_soc_sparseMatrix"); - - int total_R_num = HS_Arrays.all_R_coor.size(); - int* nonzero_num = new int[total_R_num]; - int* minus_nonzero_num = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(nonzero_num, total_R_num); - ModuleBase::GlobalFunc::ZEROS(minus_nonzero_num, total_R_num); - int count = 0; - for (auto& R_coor: HS_Arrays.all_R_coor) - { - auto iter = pvdpR_soc_sparseMatrix.find(R_coor); - if (iter != pvdpR_soc_sparseMatrix.end()) - { - for (auto& row_loop: iter->second) - { - nonzero_num[count] += row_loop.second.size(); - } - } - - auto minus_R_coor = -1 * R_coor; - - iter = pvdpR_soc_sparseMatrix.find(minus_R_coor); - if (iter != pvdpR_soc_sparseMatrix.end()) - { - for (auto& row_loop: iter->second) - { - minus_nonzero_num[count] += row_loop.second.size(); - } - } - - count++; - } - - Parallel_Reduce::reduce_all(nonzero_num, total_R_num); - Parallel_Reduce::reduce_all(minus_nonzero_num, total_R_num); - // Parallel_Reduce::reduce_pool(nonzero_num, total_R_num); - // Parallel_Reduce::reduce_pool(minus_nonzero_num, total_R_num); - - std::complex* tmp_soc = nullptr; - tmp_soc = new std::complex[PARAM.globalv.nlocal]; - - count = 0; - for (auto& R_coor: HS_Arrays.all_R_coor) - { - if (nonzero_num[count] != 0 || minus_nonzero_num[count] != 0) - { - auto minus_R_coor = -1 * R_coor; - - for (int row = 0; row < PARAM.globalv.nlocal; ++row) - { - ModuleBase::GlobalFunc::ZEROS(tmp_soc, PARAM.globalv.nlocal); - - auto iter = pvdpR_soc_sparseMatrix.find(R_coor); - if (iter != pvdpR_soc_sparseMatrix.end()) - { - if (this->gridt->trace_lo[row] >= 0) - { - auto row_iter = iter->second.find(row); - if (row_iter != iter->second.end()) - { - for (auto& value: row_iter->second) - { - tmp_soc[value.first] = value.second; - } - } - } - } - - auto minus_R_iter = pvdpR_soc_sparseMatrix.find(minus_R_coor); - if (minus_R_iter != pvdpR_soc_sparseMatrix.end()) - { - for (int col = 0; col < row; ++col) - { - if (this->gridt->trace_lo[col] >= 0) - { - auto row_iter = minus_R_iter->second.find(col); - if (row_iter != minus_R_iter->second.end()) - { - auto col_iter = row_iter->second.find(row); - if (col_iter != row_iter->second.end()) - { - tmp_soc[col] = conj(col_iter->second); - } - } - } - } - } - - Parallel_Reduce::reduce_pool(tmp_soc, PARAM.globalv.nlocal); - - if (pv->global2local_row(row) >= 0) - { - for (int col = 0; col < PARAM.globalv.nlocal; ++col) - { - if (pv->global2local_col(col) >= 0) - { - if (std::abs(tmp_soc[col]) > sparse_threshold) - { - if (dim == 0) - { - std::complex& value = HS_Arrays.dHRx_soc_sparse[R_coor][row][col]; - value += tmp_soc[col]; - if (std::abs(value) <= sparse_threshold) - { - HS_Arrays.dHRx_soc_sparse[R_coor][row].erase(col); - } - } - if (dim == 1) - { - std::complex& value = HS_Arrays.dHRy_soc_sparse[R_coor][row][col]; - value += tmp_soc[col]; - if (std::abs(value) <= sparse_threshold) - { - HS_Arrays.dHRy_soc_sparse[R_coor][row].erase(col); - } - } - if (dim == 2) - { - std::complex& value = HS_Arrays.dHRz_soc_sparse[R_coor][row][col]; - value += tmp_soc[col]; - if (std::abs(value) <= sparse_threshold) - { - HS_Arrays.dHRz_soc_sparse[R_coor][row].erase(col); - } - } - } - } - } - } - } - } - - count++; - } - - delete[] nonzero_num; - delete[] minus_nonzero_num; - delete[] tmp_soc; - nonzero_num = nullptr; - minus_nonzero_num = nullptr; - tmp_soc = nullptr; - - return; -} - -void Gint_k::cal_dvlocal_R_sparseMatrix(const int& current_spin, - const double& sparse_threshold, - LCAO_HS_Arrays& HS_Arrays, - const Parallel_Orbitals* pv, - const UnitCell& ucell, - const Grid_Driver& gdriver) -{ - ModuleBase::TITLE("Gint_k", "cal_dvlocal_R_sparseMatrix"); - - std::map, std::map>> pvdpRx_sparseMatrix; - std::map, std::map>> pvdpRy_sparseMatrix; - std::map, std::map>> pvdpRz_sparseMatrix; - std::map, std::map>>> - pvdpRx_soc_sparseMatrix; - std::map, std::map>>> - pvdpRy_soc_sparseMatrix; - std::map, std::map>>> - pvdpRz_soc_sparseMatrix; - - double temp_value_double; - std::complex temp_value_complex; - - ModuleBase::Vector3 tau1, dtau; - for (int iap = 0; iap < pvdpRx_reduced[0].size_atom_pairs(); iap++) - { - const auto& ap = pvdpRx_reduced[0].get_atom_pair(iap); - const int iat1 = ap.get_atom_i(); - const int iat2 = ap.get_atom_j(); - const int it1 = ucell.iat2it[iat1]; - const int it2 = ucell.iat2it[iat2]; - const Atom* atom1 = &ucell.atoms[it1]; - const Atom* atom2 = &ucell.atoms[it2]; - const int start1 = ucell.itiaiw2iwt(it1, ucell.iat2ia[iat1], 0); - const int start2 = ucell.itiaiw2iwt(it2, ucell.iat2ia[iat2], 0); - - for (int ir = 0; ir < ap.get_R_size(); ir++) - { - const ModuleBase::Vector3 R = ap.get_R_index(ir); - Abfs::Vector3_Order dR(R.x, R.y, R.z); - std::vector pvdpRx; - std::vector pvdpRy; - std::vector pvdpRz; - for(int i = 0; i < PARAM.inp.nspin; i++) - { - pvdpRx.push_back(pvdpRx_reduced[i].get_atom_pair(iap).get_pointer(ir)); - pvdpRy.push_back(pvdpRy_reduced[i].get_atom_pair(iap).get_pointer(ir)); - pvdpRz.push_back(pvdpRz_reduced[i].get_atom_pair(iap).get_pointer(ir)); - } - - for (int iw = 0; iw < atom1->nw * PARAM.globalv.npol; iw++) - { - for (int iw2 = 0; iw2 < atom2->nw * PARAM.globalv.npol; iw2++) - { - const int nw = atom2->nw; - const int mug0 = iw / PARAM.globalv.npol; - const int nug0 = iw2 / PARAM.globalv.npol; - const int iw_nowg = mug0 * nw + nug0; - - if (PARAM.inp.nspin == 4) - { - // pvp is symmetric, only half is calculated. - - if (iw % 2 == 0 && iw2 % 2 == 0) - { - // spin = 0; - temp_value_complex - = std::complex(1.0, 0.0) * pvdpRx[0][iw_nowg] - + std::complex(1.0, 0.0) * pvdpRx[3][iw_nowg]; - - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRx_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - - temp_value_complex - = std::complex(1.0, 0.0) * pvdpRy[0][iw_nowg] - + std::complex(1.0, 0.0) * pvdpRy[3][iw_nowg]; - - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRy_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = std::complex(1.0, 0.0) * pvdpRz[0][iw_nowg] - + std::complex(1.0, 0.0) * pvdpRz[3][iw_nowg]; - - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRz_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - } - else if (iw % 2 == 1 && iw2 % 2 == 1) - { - // spin = 3; - temp_value_complex - = std::complex(1.0, 0.0) * pvdpRx[0][iw_nowg] - - std::complex(1.0, 0.0) * pvdpRx[3][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRx_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = std::complex(1.0, 0.0) * pvdpRy[0][iw_nowg] - - std::complex(1.0, 0.0) * pvdpRy[3][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRy_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = std::complex(1.0, 0.0) * pvdpRz[0][iw_nowg] - - std::complex(1.0, 0.0) * pvdpRz[3][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRz_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - } - else if (iw % 2 == 0 && iw2 % 2 == 1) - { - // spin = 1; - if (!PARAM.globalv.domag) - { - // do nothing - } - else - { - temp_value_complex - = pvdpRx[1][iw_nowg] - - std::complex(0.0, 1.0) * pvdpRx[2][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRx_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = pvdpRy[1][iw_nowg] - - std::complex(0.0, 1.0) * pvdpRy[2][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRy_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = pvdpRz[1][iw_nowg] - - std::complex(0.0, 1.0) * pvdpRz[2][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRz_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - } - } - else if (iw % 2 == 1 && iw2 % 2 == 0) - { - // spin = 2; - if (!PARAM.globalv.domag) - { - // do nothing - } - else - { - temp_value_complex - = pvdpRx[1][iw_nowg] - + std::complex(0.0, 1.0) * pvdpRx[2][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRx_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = pvdpRy[1][iw_nowg] - + std::complex(0.0, 1.0) * pvdpRy[2][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRy_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - temp_value_complex - = pvdpRz[1][iw_nowg] - + std::complex(0.0, 1.0) * pvdpRz[2][iw_nowg]; - if (std::abs(temp_value_complex) > sparse_threshold) - { - pvdpRz_soc_sparseMatrix[dR][start1 + iw][start2 + iw2] - = temp_value_complex; - } - } - } - else - { - ModuleBase::WARNING_QUIT("Gint_k::folding_vl_k_nc", "index is wrong!"); - } - } // endif NC - else - { - temp_value_double = pvdpRx[current_spin][iw_nowg]; - if (std::abs(temp_value_double) > sparse_threshold) - { - pvdpRx_sparseMatrix[dR][start1 + iw][start2 + iw2] = temp_value_double; - } - temp_value_double = pvdpRy[current_spin][iw_nowg]; - if (std::abs(temp_value_double) > sparse_threshold) - { - pvdpRy_sparseMatrix[dR][start1 + iw][start2 + iw2] = temp_value_double; - } - temp_value_double = pvdpRz[current_spin][iw_nowg]; - if (std::abs(temp_value_double) > sparse_threshold) - { - pvdpRz_sparseMatrix[dR][start1 + iw][start2 + iw2] = temp_value_double; - } - } // endif normal - } - } - } - } - if (PARAM.inp.nspin != 4) - { - distribute_pvdpR_sparseMatrix(current_spin, 0, sparse_threshold, pvdpRx_sparseMatrix, HS_Arrays, pv); - distribute_pvdpR_sparseMatrix(current_spin, 1, sparse_threshold, pvdpRy_sparseMatrix, HS_Arrays, pv); - distribute_pvdpR_sparseMatrix(current_spin, 2, sparse_threshold, pvdpRz_sparseMatrix, HS_Arrays, pv); - } - else - { - distribute_pvdpR_soc_sparseMatrix(0, sparse_threshold, pvdpRx_soc_sparseMatrix, HS_Arrays, pv); - distribute_pvdpR_soc_sparseMatrix(1, sparse_threshold, pvdpRy_soc_sparseMatrix, HS_Arrays, pv); - distribute_pvdpR_soc_sparseMatrix(2, sparse_threshold, pvdpRz_soc_sparseMatrix, HS_Arrays, pv); - } - - return; -} diff --git a/source/module_hamilt_lcao/module_gint/gint_old.cpp b/source/module_hamilt_lcao/module_gint/gint_old.cpp deleted file mode 100644 index 2e98e3d265..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_old.cpp +++ /dev/null @@ -1,298 +0,0 @@ -#include "gint.h" - -#include "module_parameter/parameter.h" -#if ((defined __CUDA)) -#include "gint_force_gpu.h" -#include "gint_rho_gpu.h" -#include "gint_vl_gpu.h" -#endif - -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/ORB_read.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/hamilt_pwdft/global.h" -#ifdef _OPENMP -#include -#endif - -#ifdef __MKL -#include -#endif - -Gint::~Gint() { - - delete this->hRGint; - delete this->hRGintCd; - // in gamma_only case, DMRGint.size()=0, - // in multi-k case, DMRGint.size()=nspin - for (int is = 0; is < this->DMRGint.size(); is++) { - delete this->DMRGint[is]; - } - for(int is = 0; is < this->hRGint_tmp.size(); is++) { - delete this->hRGint_tmp[is]; - } -#ifdef __MPI - delete this->DMRGint_full; -#endif -} - -void Gint::cal_gint(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint"); - ModuleBase::timer::tick("Gint_interface", "cal_gint"); - // In multi-process environments, - // some processes may not be allocated any data. - if (this->gridt->get_init_malloced() == false) { - ModuleBase::WARNING_QUIT("Gint_interface::cal_gint", - "gridt has not been allocated yet!"); - } - if (this->gridt->max_atom > 0) { -#ifdef __CUDA - if (PARAM.inp.device == "gpu" - && (inout->job == Gint_Tools::job_type::vlocal - || inout->job == Gint_Tools::job_type::rho - || inout->job == Gint_Tools::job_type::force)) { - if (inout->job == Gint_Tools::job_type::vlocal) { - gpu_vlocal_interface(inout); - } else if (inout->job == Gint_Tools::job_type::rho) { - gpu_rho_interface(inout); - } else if (inout->job == Gint_Tools::job_type::force) { - gpu_force_interface(inout); - } - } else -#endif - { -#ifdef __MKL - const int mkl_threads = mkl_get_max_threads(); - mkl_set_num_threads(mkl_threads); -#endif - { - if (inout->job == Gint_Tools::job_type::vlocal) { - gint_kernel_vlocal(inout); - } else if (inout->job == Gint_Tools::job_type::dvlocal) { - gint_kernel_dvlocal(inout); - } else if (inout->job == Gint_Tools::job_type::vlocal_meta) { - gint_kernel_vlocal_meta(inout); - } else if (inout->job == Gint_Tools::job_type::rho) { - gint_kernel_rho(inout); - } else if (inout->job == Gint_Tools::job_type::tau) { - gint_kernel_tau(inout); - } else if (inout->job == Gint_Tools::job_type::force) { - gint_kernel_force(inout); - } else if (inout->job == Gint_Tools::job_type::force_meta) { - gint_kernel_force_meta(inout); - } - } - } - } - ModuleBase::timer::tick("Gint_interface", "cal_gint"); - return; -} -void Gint::prep_grid(const Grid_Technique& gt, - const int& nbx_in, - const int& nby_in, - const int& nbz_in, - const int& nbz_start_in, - const int& ncxyz_in, - const int& bx_in, - const int& by_in, - const int& bz_in, - const int& bxyz_in, - const int& nbxx_in, - const int& ny_in, - const int& nplane_in, - const int& startz_current_in, - const UnitCell* ucell_in, - const LCAO_Orbitals* orb_in) { - ModuleBase::TITLE(GlobalV::ofs_running, "Gint_k", "prep_grid"); - - this->gridt = > - this->nbx = nbx_in; - this->nby = nby_in; - this->nbz = nbz_in; - this->ncxyz = ncxyz_in; - this->nbz_start = nbz_start_in; - this->bx = bx_in; - this->by = by_in; - this->bz = bz_in; - this->bxyz = bxyz_in; - this->nbxx = nbxx_in; - this->ny = ny_in; - this->nplane = nplane_in; - this->startz_current = startz_current_in; - this->ucell = ucell_in; - assert(nbx > 0); - assert(nby > 0); - assert(nbz >= 0); - assert(ncxyz > 0); - assert(bx > 0); - assert(by > 0); - assert(bz > 0); - assert(bxyz > 0); - assert(nbxx >= 0); - assert(ny > 0); - assert(nplane >= 0); - assert(startz_current >= 0); - assert(this->ucell->omega > 0.0); - - return; -} - -void Gint::initialize_pvpR(const UnitCell& ucell_in, const Grid_Driver* gd, const int& nspin) -{ - ModuleBase::TITLE("Gint", "initialize_pvpR"); - - int npol = 1; - // there is the only resize code of DMRGint - if (this->DMRGint.size() == 0) { - this->DMRGint.resize(nspin); - } - hRGint_tmp.resize(nspin); - if (nspin != 4) { - if (this->hRGint != nullptr) { - delete this->hRGint; - } - this->hRGint = new hamilt::HContainer(ucell_in.nat); - } else { - npol = 2; - if (this->hRGintCd != nullptr) { - delete this->hRGintCd; - } - this->hRGintCd - = new hamilt::HContainer>(ucell_in.nat); - for (int is = 0; is < nspin; is++) { - if (this->DMRGint[is] != nullptr) { - delete this->DMRGint[is]; - } - if (this->hRGint_tmp[is] != nullptr) { - delete this->hRGint_tmp[is]; - } - this->DMRGint[is] = new hamilt::HContainer(ucell_in.nat); - this->hRGint_tmp[is] = new hamilt::HContainer(ucell_in.nat); - } -#ifdef __MPI - if (this->DMRGint_full != nullptr) { - delete this->DMRGint_full; - } - this->DMRGint_full = new hamilt::HContainer(ucell_in.nat); -#endif - } - - if (PARAM.globalv.gamma_only_local && nspin != 4) { - this->hRGint->fix_gamma(); - } - if (npol == 1) { - this->hRGint->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); - this->hRGint->allocate(nullptr, true); - ModuleBase::Memory::record("Gint::hRGint", - this->hRGint->get_memory_size()); - // initialize DMRGint with hRGint when NSPIN != 4 - for (int is = 0; is < this->DMRGint.size(); is++) { - if (this->DMRGint[is] != nullptr) { - delete this->DMRGint[is]; - } - this->DMRGint[is] = new hamilt::HContainer(*this->hRGint); - } - ModuleBase::Memory::record("Gint::DMRGint", - this->DMRGint[0]->get_memory_size() - * this->DMRGint.size()); - } else { - this->hRGintCd->insert_ijrs(this->gridt->get_ijr_info(), ucell_in, npol); - this->hRGintCd->allocate(nullptr, true); - for(int is = 0; is < nspin; is++) { - this->hRGint_tmp[is]->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); - this->DMRGint[is]->insert_ijrs(this->gridt->get_ijr_info(), ucell_in); - this->hRGint_tmp[is]->allocate(nullptr, true); - this->DMRGint[is]->allocate(nullptr, true); - } - ModuleBase::Memory::record("Gint::hRGint_tmp", - this->hRGint_tmp[0]->get_memory_size()*nspin); - ModuleBase::Memory::record("Gint::DMRGint", - this->DMRGint[0]->get_memory_size() - * this->DMRGint.size()*nspin); -#ifdef __MPI - this->DMRGint_full->insert_ijrs(this->gridt->get_ijr_info(), ucell_in, npol); - this->DMRGint_full->allocate(nullptr, true); - ModuleBase::Memory::record("Gint::DMRGint_full", - this->DMRGint_full->get_memory_size()); -#endif - } -} - -void Gint::reset_DMRGint(const int& nspin) -{ - if (this->hRGint) - { - for (auto& d : this->DMRGint) { delete d; } - this->DMRGint.resize(nspin); - this->DMRGint.shrink_to_fit(); - for (auto& d : this->DMRGint) { d = new hamilt::HContainer(*this->hRGint); } - if (nspin == 4) - { - for (auto& d : this->DMRGint) { d->allocate(nullptr, false); } -#ifdef __MPI - delete this->DMRGint_full; - this->DMRGint_full = new hamilt::HContainer(*this->hRGint); - this->DMRGint_full->allocate(nullptr, false); -#endif - } - } -} - -void Gint::transfer_DM2DtoGrid(std::vector*> DM2D) { - ModuleBase::TITLE("Gint", "transfer_DMR"); - - // To check whether input parameter DM2D has been initialized -#ifdef __DEBUG - assert(!DM2D.empty() - && "Input parameter DM2D has not been initialized while calling " - "function transfer_DM2DtoGrid!"); -#endif - - ModuleBase::timer::tick("Gint", "transfer_DMR"); - if (PARAM.inp.nspin != 4) { - for (int is = 0; is < this->DMRGint.size(); is++) { -#ifdef __MPI - hamilt::transferParallels2Serials(*DM2D[is], DMRGint[is]); -#else - this->DMRGint[is]->set_zero(); - this->DMRGint[is]->add(*DM2D[is]); -#endif - } - } else // NSPIN=4 case - { -#ifdef __MPI - hamilt::transferParallels2Serials(*DM2D[0], this->DMRGint_full); -#else - this->DMRGint_full = DM2D[0]; -#endif - std::vector tmp_pointer(4, nullptr); - for (int iap = 0; iap < this->DMRGint_full->size_atom_pairs(); ++iap) { - auto& ap = this->DMRGint_full->get_atom_pair(iap); - int iat1 = ap.get_atom_i(); - int iat2 = ap.get_atom_j(); - for (int ir = 0; ir < ap.get_R_size(); ++ir) { - const ModuleBase::Vector3 r_index = ap.get_R_index(ir); - for (int is = 0; is < 4; is++) { - tmp_pointer[is] = this->DMRGint[is] - ->find_matrix(iat1, iat2, r_index) - ->get_pointer(); - } - double* data_full = ap.get_pointer(ir); - for (int irow = 0; irow < ap.get_row_size(); irow += 2) { - for (int icol = 0; icol < ap.get_col_size(); icol += 2) { - *(tmp_pointer[0])++ = data_full[icol]; - *(tmp_pointer[1])++ = data_full[icol + 1]; - } - data_full += ap.get_col_size(); - for (int icol = 0; icol < ap.get_col_size(); icol += 2) { - *(tmp_pointer[2])++ = data_full[icol]; - *(tmp_pointer[3])++ = data_full[icol + 1]; - } - data_full += ap.get_col_size(); - } - } - } - } - ModuleBase::timer::tick("Gint", "transfer_DMR"); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_rho_cpu_interface.cpp b/source/module_hamilt_lcao/module_gint/gint_rho_cpu_interface.cpp deleted file mode 100644 index 9454a79edc..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_rho_cpu_interface.cpp +++ /dev/null @@ -1,197 +0,0 @@ -#include "gint.h" -#include "source_base/memory.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" - -void Gint::gint_kernel_rho(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_rho"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_rho"); - const int max_size = this->gridt->max_atom; - const int ncyz = this->ny * this->nplane; - const double delta_r = this->gridt->dr_uniform; - -#pragma omp parallel -{ - std::vector block_iw(max_size, 0); - std::vector block_index(max_size+1, 0); - std::vector block_size(max_size, 0); - std::vector vindex(this->bxyz, 0); -#pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) - { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - Gint_Tools::get_vindex(this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - vindex.data()); - // prepare block information - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - Gint_Tools::get_block_info(*this->gridt, - this->bxyz, - na_grid, - grid_index, - block_iw.data(), - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D()); - - // evaluate psi on grids - const int LD_pool = block_index[na_grid]; - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - Gint_Tools::cal_psir_ylm(*this->gridt, - this->bxyz, - na_grid, - grid_index, - delta_r, - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D()); - - for (int is = 0; is < inout->nspin_rho; ++is) - { - // psir_ylm_new = psir_func(psir_ylm) - // psir_func==nullptr means psir_ylm_new=psir_ylm - const ModuleBase::Array_Pool &psir_ylm_1 = (!this->psir_func_1) ? psir_ylm : this->psir_func_1(psir_ylm, *this->gridt, grid_index, is, block_iw, block_size, block_index, cal_flag); - const ModuleBase::Array_Pool &psir_ylm_2 = (!this->psir_func_2) ? psir_ylm : this->psir_func_2(psir_ylm, *this->gridt, grid_index, is, block_iw, block_size, block_index, cal_flag); - - ModuleBase::Array_Pool psir_DM(this->bxyz, LD_pool); - ModuleBase::GlobalFunc::ZEROS(psir_DM.get_ptr_1D(), this->bxyz * LD_pool); - - // calculating g_mu(r) = sum_nu rho_mu,nu psi_nu(r) - Gint_Tools::mult_psi_DMR(*this->gridt, - this->bxyz, - LD_pool, - grid_index, - na_grid, - block_index.data(), - block_size.data(), - cal_flag.get_ptr_2D(), - psir_ylm_1.get_ptr_2D(), - psir_DM.get_ptr_2D(), - this->DMRGint[is], - inout->if_symm); - - // do sum_mu g_mu(r)psi_mu(r) to get electron density on grid - this->cal_meshball_rho(na_grid, block_index.data(), vindex.data(), psir_ylm_2.get_ptr_2D(), psir_DM.get_ptr_2D(), inout->rho[is]); - } - } -} - ModuleBase::TITLE("Gint_interface", "cal_gint_rho"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_rho"); -} - -void Gint::gint_kernel_tau(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_tau"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_tau"); - const int max_size = this->gridt->max_atom; - const int ncyz = this->ny * this->nplane; - const double delta_r = this->gridt->dr_uniform; - - -#pragma omp parallel -{ - std::vector block_iw(max_size, 0); - std::vector block_index(max_size+1, 0); - std::vector block_size(max_size, 0); - std::vector vindex(bxyz, 0); -#pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) - { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - Gint_Tools::get_vindex(this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - vindex.data()); - //prepare block information - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - Gint_Tools::get_block_info(*this->gridt, this->bxyz, na_grid, grid_index, - block_iw.data(), block_index.data(), block_size.data(), cal_flag.get_ptr_2D()); - - //evaluate psi and dpsi on grids - const int LD_pool = block_index[na_grid]; - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_x(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_y(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_z(this->bxyz, LD_pool); - - Gint_Tools::cal_dpsir_ylm(*this->gridt, - this->bxyz, na_grid, grid_index, delta_r, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(), - dpsir_ylm_z.get_ptr_2D()); - - for(int is=0; is dpsix_DM(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsiy_DM(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsiz_DM(this->bxyz, LD_pool); - ModuleBase::GlobalFunc::ZEROS(dpsix_DM.get_ptr_1D(), this->bxyz*LD_pool); - ModuleBase::GlobalFunc::ZEROS(dpsiy_DM.get_ptr_1D(), this->bxyz*LD_pool); - ModuleBase::GlobalFunc::ZEROS(dpsiz_DM.get_ptr_1D(), this->bxyz*LD_pool); - - //calculating g_i,mu(r) = sum_nu rho_mu,nu d/dx_i psi_nu(r), x_i=x,y,z - Gint_Tools::mult_psi_DMR( - *this->gridt, this->bxyz, - LD_pool, - grid_index, na_grid, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), - dpsix_DM.get_ptr_2D(), - this->DMRGint[is], - true); - Gint_Tools::mult_psi_DMR( - *this->gridt, this->bxyz, - LD_pool, - grid_index, na_grid, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(), - dpsiy_DM.get_ptr_2D(), - this->DMRGint[is], - true); - Gint_Tools::mult_psi_DMR( - *this->gridt, this->bxyz, - LD_pool, - grid_index, na_grid, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(), - dpsir_ylm_z.get_ptr_2D(), - dpsiz_DM.get_ptr_2D(), - this->DMRGint[is], - true); - - //do sum_i,mu g_i,mu(r) * d/dx_i psi_mu(r) to get kinetic energy density on grid - if(inout->job==Gint_Tools::job_type::tau) - { - this->cal_meshball_tau( - na_grid, block_index.data(), - vindex.data(), - dpsir_ylm_x.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D(), - dpsix_DM.get_ptr_2D(), dpsiy_DM.get_ptr_2D(), dpsiz_DM.get_ptr_2D(), - inout->rho[is]); - } - } - } -} - ModuleBase::TITLE("Gint_interface", "cal_gint_tau"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_tau"); -} diff --git a/source/module_hamilt_lcao/module_gint/gint_rho_gpu.cu b/source/module_hamilt_lcao/module_gint/gint_rho_gpu.cu deleted file mode 100644 index c5591e662e..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_rho_gpu.cu +++ /dev/null @@ -1,234 +0,0 @@ -#include "kernels/cuda/cuda_tools.cuh" -#include "source_base/ylm.h" -#include "gint_rho_gpu.h" -#include "gint_tools.h" -#include "kernels/cuda/gint_rho.cuh" - -#ifdef _OPENMP -#include -#endif - -namespace GintKernel -{ - -void gint_rho_gpu(const hamilt::HContainer* dm, - const double* ylmcoef_now, - const double dr, - const double* rcut, - const Grid_Technique& gridt, - const UnitCell& ucell, - double* rho) -{ - checkCuda(cudaSetDevice(gridt.dev_id)); - // checkCuda(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync)); - - const int nbzp = gridt.nbzp; - const int nczp =nbzp * gridt.bz; - const int num_mcell_on_proc = nczp * gridt.ncx * gridt.ncy; - const int lgd = gridt.lgd; - const int max_atom = gridt.max_atom; - const int num_streams = gridt.nstreams; - const int max_atom_per_bcell = max_atom * gridt.bxyz; - const int max_atom_per_z = max_atom * nbzp; - const int max_phi_per_z = max_atom_per_bcell * nbzp * ucell.nwmax; - const int max_atompair_per_z = max_atom * max_atom * nbzp; - - std::vector streams(num_streams); - std::vector events(num_streams); - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamCreate(&streams[i])); - checkCuda(cudaEventCreateWithFlags(&events[i], cudaEventDisableTiming)); - } - - Cuda_Mem_Wrapper dr_part(max_atom_per_z * 3, num_streams, true); - Cuda_Mem_Wrapper atoms_type(max_atom_per_z, num_streams, true); - // The first number in every group of two represents the number of atoms on that bigcell. - // The second number represents the cumulative number of atoms up to that bigcell. - Cuda_Mem_Wrapper atoms_num_info(2 * nbzp, num_streams, true); - - Cuda_Mem_Wrapper psi(max_phi_per_z, num_streams, false); - Cuda_Mem_Wrapper psi_dm(max_phi_per_z, num_streams, false); - - Cuda_Mem_Wrapper gemm_alpha(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_m(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_n(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_k(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_lda(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_ldb(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_ldc(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_A(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_B(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_C(max_atompair_per_z, num_streams, true); - - Cuda_Mem_Wrapper rho_g(num_mcell_on_proc, 1, false); - Cuda_Mem_Wrapper dot_product(nbzp * gridt.bxyz, num_streams, true); - - Cuda_Mem_Wrapper dm_matrix(dm->get_nnr(), 1, false); - // retrieve the density matrix on the host - checkCuda(cudaMemcpy(dm_matrix.get_device_pointer(), - dm->get_wrapper(), - dm->get_nnr() * sizeof(double), - cudaMemcpyHostToDevice)); - -// calculate the rho for every nbzp bigcells -#ifdef _OPENMP -const int max_thread_num = std::min(omp_get_max_threads(), num_streams); -#endif -#pragma omp parallel num_threads(max_thread_num) -{ -#ifdef _OPENMP - const int tid = omp_get_thread_num(); - const int num_threads = omp_get_num_threads(); - const int sid_start = tid * num_streams / num_threads; - const int thread_num_streams = tid == num_threads - 1 ? num_streams - sid_start : num_streams / num_threads; -#else - const int sid_start = 0; - const int thread_num_streams = num_streams; -#endif -#pragma omp for collapse(2) schedule(dynamic) - for (int i = 0; i < gridt.nbx; i++) - { - for (int j = 0; j < gridt.nby; j++) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - - checkCuda(cudaSetDevice(gridt.dev_id)); - - const int sid = (i * gridt.nby + j) % thread_num_streams + sid_start; - checkCuda(cudaEventSynchronize(events[sid])); - - int max_m = 0; - int max_n = 0; - int atom_pair_num = 0; - int atoms_per_z = 0; - const int grid_index_ij = i * gridt.nby * nbzp + j * nbzp; - - // generate GPU tasks, including the calculation of psir, matrix - // multiplication, and dot product - gtask_rho(gridt, - grid_index_ij, - ucell, - dr_part.get_host_pointer(sid), - atoms_type.get_host_pointer(sid), - atoms_num_info.get_host_pointer(sid), - atoms_per_z); - - alloc_mult_dot_rho( - dm, - gridt, - ucell, - grid_index_ij, - max_atom, - lgd, - nczp, - atoms_num_info.get_host_pointer(sid), - psi.get_device_pointer(sid), - psi_dm.get_device_pointer(sid), - dm_matrix.get_device_pointer(), - gemm_alpha.get_host_pointer(sid), - gemm_m.get_host_pointer(sid), - gemm_n.get_host_pointer(sid), - gemm_k.get_host_pointer(sid), - gemm_lda.get_host_pointer(sid), - gemm_ldb.get_host_pointer(sid), - gemm_ldc.get_host_pointer(sid), - gemm_A.get_host_pointer(sid), - gemm_B.get_host_pointer(sid), - gemm_C.get_host_pointer(sid), - max_m, - max_n, - atom_pair_num, - rho_g.get_device_pointer(), - dot_product.get_host_pointer(sid)); - - dr_part.copy_host_to_device_async(streams[sid], sid, atoms_per_z * 3); - atoms_type.copy_host_to_device_async(streams[sid], sid, atoms_per_z); - atoms_num_info.copy_host_to_device_async(streams[sid], sid); - - gemm_alpha.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_m.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_n.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_k.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_lda.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_ldb.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_ldc.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_A.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_B.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_C.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - dot_product.copy_host_to_device_async(streams[sid], sid); - checkCuda(cudaEventRecord(events[sid], streams[sid])); - - psi.memset_device_async(streams[sid], sid, 0); - psi_dm.memset_device_async(streams[sid], sid, 0); - - // Launching kernel to calculate psi - dim3 grid_psi(nbzp, gridt.bxyz); - dim3 block_psi(64); - get_psi<<>>( - gridt.ylmcoef_g, - dr, - gridt.bxyz, - ucell.nwmax, - max_atom, - gridt.atom_nwl_g, - gridt.atom_new_g, - gridt.atom_ylm_g, - gridt.atom_nw_g, - gridt.rcut_g, - gridt.nr_max, - gridt.psi_u_g, - gridt.mcell_pos_g, - dr_part.get_device_pointer(sid), - atoms_type.get_device_pointer(sid), - atoms_num_info.get_device_pointer(sid), - psi.get_device_pointer(sid)); - checkCudaLastError(); - - // Performing matrix multiplication alpha * mat_dm * mat_psir - gridt.fastest_matrix_mul(max_m, - max_n, - gemm_m.get_device_pointer(sid), - gemm_n.get_device_pointer(sid), - gemm_k.get_device_pointer(sid), - gemm_A.get_device_pointer(sid), - gemm_lda.get_device_pointer(sid), - gemm_B.get_device_pointer(sid), - gemm_ldb.get_device_pointer(sid), - gemm_C.get_device_pointer(sid), - gemm_ldc.get_device_pointer(sid), - atom_pair_num, - streams[sid], - gemm_alpha.get_device_pointer(sid)); - checkCudaLastError(); - - // Launching kernel to calculate dot product psir * psir_dm - // if warpSize is not eauql to 32, the psir_dot kernel should be modified - dim3 grid_dot(nbzp, gridt.bxyz); - dim3 block_dot(64); - psir_dot<<>>( - gridt.bxyz, - ucell.nwmax, - atoms_num_info.get_device_pointer(sid), - psi.get_device_pointer(sid), - psi_dm.get_device_pointer(sid), - dot_product.get_device_pointer(sid)); - checkCudaLastError(); - } - } -} - - // Copy rho from device to host - checkCuda(cudaMemcpy(rho, - rho_g.get_device_pointer(), - num_mcell_on_proc * sizeof(double), - cudaMemcpyDeviceToHost)); - - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamDestroy(streams[i])); - checkCuda(cudaEventDestroy(events[i])); - } -} -} // namespace GintKernel diff --git a/source/module_hamilt_lcao/module_gint/gint_rho_gpu.h b/source/module_hamilt_lcao/module_gint/gint_rho_gpu.h deleted file mode 100644 index 77459bfe9a..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_rho_gpu.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef GINT_RHO_H -#define GINT_RHO_H -#include -#include // for CUDA_VERSION -#include - -#include "module_hamilt_lcao/module_gint/gint.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" - -namespace GintKernel -{ - -/** - * calculate the rho by GPU - * - * @param dm density matrix. - * @param ylmcoef_now coefficients for the spherical harmonics expansion. - * @param dr The grid spacing. - * @param rcut Pointer to the cutoff radius array. - * @param gridt Grid_Technique object containing grid information. - * @param ucell UnitCell. - * @param rho rho. - */ -void gint_rho_gpu(const hamilt::HContainer* dm, - const double* ylmcoef_now, - const double dr, - const double* rcut, - const Grid_Technique& gridt, - const UnitCell& ucell, - double* rho); - -void gtask_rho(const Grid_Technique& gridt, - const int grid_index_ij, - const UnitCell& ucell, - double* dr_part, - uint8_t* atoms_type, - int* atoms_num_info, - int& atoms_per_z); - -void alloc_mult_dot_rho(const hamilt::HContainer* dm, - const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int max_atom, - const int lgd, - const int nczp, - const int* atoms_num_info, - double* const psir_ylm_g, - double* const psir_dm_g, - double* const dm_matrix_g, - double* mat_alpha, - int* mat_m, - int* mat_n, - int* mat_k, - int* mat_lda, - int* mat_ldb, - int* mat_ldc, - double** mat_A, - double** mat_B, - double** mat_C, - int& max_m, - int& max_n, - int& atom_pair_num, - double* rho_g, - double** dot_product); - -} // namespace GintKernel -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_rho_old.cpp b/source/module_hamilt_lcao/module_gint/gint_rho_old.cpp deleted file mode 100644 index 45692689b7..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_rho_old.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "gint_k.h" -#include "gint_tools.h" -#include "grid_technique.h" -#include "source_base/blas_connector.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/timer.h" -#include "source_base/array_pool.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_pw/hamilt_pwdft/global.h" - -void Gint::cal_meshball_rho(const int na_grid, - const int*const block_index, - const int*const vindex, - const double*const*const psir_ylm, - const double*const*const psir_DMR, - double*const rho) -{ - const int inc = 1; - // sum over mu to get density on grid - for (int ib = 0; ib < this->bxyz; ++ib) - { - const double r = ddot_(&block_index[na_grid], psir_ylm[ib], &inc, psir_DMR[ib], &inc); - const int grid = vindex[ib]; - rho[grid] += r; - } -} diff --git a/source/module_hamilt_lcao/module_gint/gint_tau_old.cpp b/source/module_hamilt_lcao/module_gint/gint_tau_old.cpp deleted file mode 100644 index 60814da53b..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_tau_old.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "gint_k.h" -#include "source_basis/module_ao/ORB_read.h" -#include "grid_technique.h" -#include "source_base/ylm.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/blas_connector.h" -#include "source_base/timer.h" -#include "source_base/array_pool.h" -#include "gint_tools.h" -#include "source_base/memory.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" - - -void Gint::cal_meshball_tau( - const int na_grid, - int* block_index, - int* vindex, - double** dpsix, - double** dpsiy, - double** dpsiz, - double** dpsix_dm, - double** dpsiy_dm, - double** dpsiz_dm, - double* rho) -{ - const int inc = 1; - // sum over mu to get density on grid - for(int ib=0; ibbxyz; ++ib) - { - double rx=ddot_(&block_index[na_grid], dpsix[ib], &inc, dpsix_dm[ib], &inc); - double ry=ddot_(&block_index[na_grid], dpsiy[ib], &inc, dpsiy_dm[ib], &inc); - double rz=ddot_(&block_index[na_grid], dpsiz[ib], &inc, dpsiz_dm[ib], &inc); - const int grid = vindex[ib]; - rho[ grid ] += rx + ry + rz; - } -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_tools.cpp b/source/module_hamilt_lcao/module_gint/gint_tools.cpp deleted file mode 100644 index e0af4010ec..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_tools.cpp +++ /dev/null @@ -1,234 +0,0 @@ -//========================================================= -//REFACTOR : Peize Lin, 2021.06.28 -//========================================================= -#include "gint_tools.h" - -#include -#include // for std::pair - -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_base/array_pool.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace Gint_Tools{ -void get_vindex(const int bxyz, const int bx, const int by, const int bz, - const int nplane, const int start_ind, - const int ncyz,int* vindex) -{ - int bindex = 0; - - for(int ii=0; ii vindex(bxyz,0); - Gint_Tools::get_vindex(bxyz, bx, by, bz, nplane, start_ind, ncyz,vindex.data()); - for(int ib=0; ib gt.rcuts[it] - 1.0e-10) { - cal_flag[ib][id] = false; - } else { - cal_flag[ib][id] = true; - } - } // end ib - } - } - - -void cal_dpsirr_ylm( - const Grid_Technique& gt, const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - double* const* const dpsir_ylm_x, double* const* const dpsir_ylm_y, double* const* const dpsir_ylm_z, - double* const* const dpsirr_ylm) -{ - ModuleBase::timer::tick("Gint_Tools", "cal_dpsirr_ylm"); - const UnitCell& ucell = *gt.ucell; - for (int id = 0; id < na_grid; id++) - { - const int mcell_index = gt.bcell_start[grid_index] + id; - const int imcell = gt.which_bigcell[mcell_index]; - int iat = gt.which_atom[mcell_index]; - const int it = ucell.iat2it[iat]; - Atom* atom = &ucell.atoms[it]; - - const double mt[3]={ - gt.meshball_positions[imcell][0] - gt.tau_in_bigcell[iat][0], - gt.meshball_positions[imcell][1] - gt.tau_in_bigcell[iat][1], - gt.meshball_positions[imcell][2] - gt.tau_in_bigcell[iat][2]}; - - for(int ib=0; ibnw; ++iw) - { - p_dpsirr[iw * 6] = p_dpsi_x[iw]*dr[0]; - p_dpsirr[iw * 6 + 1] = p_dpsi_x[iw]*dr[1]; - p_dpsirr[iw * 6 + 2] = p_dpsi_x[iw]*dr[2]; - p_dpsirr[iw * 6 + 3] = p_dpsi_y[iw]*dr[1]; - p_dpsirr[iw * 6 + 4] = p_dpsi_y[iw]*dr[2]; - p_dpsirr[iw * 6 + 5] = p_dpsi_z[iw]*dr[2]; - }//iw - }//else - } - } - ModuleBase::timer::tick("Gint_Tools", "cal_dpsirr_ylm"); - return; - } - - // atomic basis sets - // psir_vlbr3[bxyz][LD_pool] - ModuleBase::Array_Pool get_psir_vlbr3( - const int bxyz, - const int na_grid, // how many atoms on this (i,j,k) grid - const int LD_pool, - const int*const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const bool*const*const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - const double*const vldr3, // vldr3[bxyz] - const double*const*const psir_ylm) // psir_ylm[bxyz][LD_pool] - { - ModuleBase::Array_Pool psir_vlbr3(bxyz, LD_pool); - for(int ib=0; ib cal_info(const int bxyz, - const int ia1, - const int ia2, - const bool* const* const cal_flag) -{ - int ib_start = bxyz; - int ib_end = 0; - int ib_length = 0; - for(int ib=0; ib=0; --ib) - { - if(cal_flag[ib][ia1] && cal_flag[ib][ia2]) - { - ib_end = ib; - break; - } - } - } - - ib_length = ib_end - ib_start + 1; - return std::make_pair(ib_start, ib_length); -} - -} // namespace Gint_Tools diff --git a/source/module_hamilt_lcao/module_gint/gint_tools.h b/source/module_hamilt_lcao/module_gint/gint_tools.h deleted file mode 100644 index 285de07715..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_tools.h +++ /dev/null @@ -1,311 +0,0 @@ -//========================================================= -// REFACTOR : Peize Lin, 2021.06.28 -//========================================================= -#ifndef GINT_TOOLS_H -#define GINT_TOOLS_H -#include "grid_technique.h" -#include "source_estate/module_charge/charge.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/array_pool.h" - -#include -#include // for std::pair - -namespace Gint_Tools -{ -enum class job_type -{ - vlocal, - rho, - force, - tau, - vlocal_meta, - force_meta, - dvlocal -}; -// Hamiltonian, electron density, force, kinetic energy density, Hamiltonian for mGGA -} // namespace Gint_Tools - -// the class is used to pass input/output variables -// into the unified interface gint -// not sure if this is the best practice though .. -class Gint_inout -{ - public: - // input - double*** DM=nullptr; - const double* vl=nullptr; - const double* vofk=nullptr; - bool isforce=false; - bool isstress=false; - int ispin=0; - int nspin_rho=0; // usually, but not always, equal to global nspin - bool if_symm = false; // if true, use dsymv in gint_kernel_rho; if false, use dgemv. - - // output - double** rho=nullptr; - ModuleBase::matrix* fvl_dphi=nullptr; - ModuleBase::matrix* svl_dphi=nullptr; - Gint_Tools::job_type job; - - // electron density and kin_r, multi-k - Gint_inout(double** rho_in, Gint_Tools::job_type job_in, const int& nspin_rho_in, bool if_symm_in = true) - { - rho = rho_in; - job = job_in; - nspin_rho = nspin_rho_in; - if_symm = if_symm_in; - } - - // force - Gint_inout(const int ispin_in, - const double* vl_in, - bool isforce_in, - bool isstress_in, - ModuleBase::matrix* fvl_dphi_in, - ModuleBase::matrix* svl_dphi_in, - Gint_Tools::job_type job_in) - { - vl = vl_in; - isforce = isforce_in; - isstress = isstress_in; - fvl_dphi = fvl_dphi_in; - svl_dphi = svl_dphi_in; - job = job_in; - ispin = ispin_in; - } - - // force (mGGA) - Gint_inout(const int ispin_in, - const double* vl_in, - const double* vofk_in, - const bool isforce_in, - const bool isstress_in, - ModuleBase::matrix* fvl_dphi_in, - ModuleBase::matrix* svl_dphi_in, - Gint_Tools::job_type job_in) - { - vl = vl_in; - vofk = vofk_in; - isforce = isforce_in; - isstress = isstress_in; - fvl_dphi = fvl_dphi_in; - svl_dphi = svl_dphi_in; - job = job_in; - ispin = ispin_in; - } - - // vlocal, multi-k - Gint_inout(const double* vl_in, int ispin_in, Gint_Tools::job_type job_in) - { - vl = vl_in; - ispin = ispin_in; - job = job_in; - } - - // mGGA vlocal, multi-k - Gint_inout(const double* vl_in, const double* vofk_in, int ispin_in, Gint_Tools::job_type job_in) - { - vl = vl_in; - vofk = vofk_in; - ispin = ispin_in; - job = job_in; - } - - // vlocal, gamma point - Gint_inout(const double* vl_in, Gint_Tools::job_type job_in) - { - vl = vl_in; - job = job_in; - } - - // mGGA vlocal, gamma point - Gint_inout(const double* vl_in, const double* vofk_in, Gint_Tools::job_type job_in) - { - vl = vl_in; - vofk = vofk_in; - job = job_in; - } -}; - -namespace Gint_Tools -{ -// if exponent is an integer between 0 and 5 (the most common cases in gint), -// pow_int is much faster than std::pow -inline double pow_int(const double base, const int exp) -{ - switch (exp) - { - case 0: - return 1.0; - case 1: - return base; - case 2: - return base * base; - case 3: - return base * base * base; - case 4: - return base * base * base * base; - case 5: - return base * base * base * base * base; - default: - double result = std::pow(base, exp); - return result; - } -} -// vindex[pw.bxyz] - -/** - * @brief Get the vindex form the grid index - * @param bxyz number of big grids - * @param bx number of big grids in x direction - * @param by number of big grids in y direction - * @param bz number of big grids in z direction - * @param nplane Currently using Z-axis 1D division, - * recording the number of the Z-axis process - * (nbz in the current process). - * @param start_ind start index of the grid in the 1D FFT grid - * @param ncyz number of grids in yz plane - * @param vindex the index of the grid -*/ -void get_vindex(const int bxyz, const int bx, const int by, - const int bz, const int nplane, - const int start_ind,const int ncyz,int* vindex); - -/** - * @brief Get the vldr3 form the grid index - * @param vldr3 the local potential multiplied by the grid volume - * @param vlocal the local potential - * @param bxyz number of grids - * @param bx number of grids in x direction - * @param by number of grids in y direction - * @param bz number of grids in z direction - * @param nplane Currently using Z-axis 1D division, - * recording the number of the Z-axis process - * (nbz in the current process). - * @param start_ind start index of the grid in the 1D FFT grid - * @param ncyz number of grids in yz plane - * @param dv the volume of the grid -*/ -void get_gint_vldr3(double* vldr3, - const double* const vlocal, - const int bxyz, - const int bx, - const int by, - const int bz, - const int nplane, - const int start_ind, - const int ncyz, - const double dv); - -/** - * @brief Get the information of a big grid index - * @param gt the grid technique, which contains the tools of the grid intergration - * @param bxyz number of grids - * @param na_grid number of atoms on this grid - * @param grid_index 1d index of FFT index (i,j,k) - * @param block_iw track the atom orbitals in all atoms - * @param block_index count total number of atomis orbitals - * @param block_size count the number of atomis orbitals in each atom - * @param cal_flag whether the atom-grid distance is larger than cutoff -*/ -void get_block_info(const Grid_Technique& gt, const int bxyz, const int na_grid, const int grid_index, - int* block_iw, int* block_index, int* block_size, bool** cal_flag); - -void init_orb(double& dr_uniform, - std::vector& rcuts, - UnitCell& ucell, - const LCAO_Orbitals& orb, - std::vector>& psi_u, - std::vector>& dpsi_u, - std::vector>& d2psi_u); - -// psir_ylm[pw.bxyz][LD_pool] -void cal_psir_ylm(const Grid_Technique& gt, - const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const double delta_r, // delta_r of the uniform FFT grid - const int* const block_index, // count total number of atomis orbitals - const int* const block_size, - const bool* const* const cal_flag, - double* const* const psir_ylm); // whether the atom-grid distance is larger than cutoff - -// psir_ylm and dpsir_ylm, both[pw.bxyz][LD_pool] -void cal_dpsir_ylm( - const Grid_Technique& gt, - const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const double delta_r, // delta_r of the uniform FFT grid - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - double* const* const psir_ylm, - double* const* const dpsir_ylm_x, - double* const* const dpsir_ylm_y, - double* const* const dpsir_ylm_z); - -// dpsir_ylm * (r-R), R is the atomic position -void cal_dpsirr_ylm( - const Grid_Technique& gt, const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - double* const* const dpsir_ylm_x, double* const* const dpsir_ylm_y, double* const* const dpsir_ylm_z, - double* const* const dpsir_ylm); - -void cal_ddpsir_ylm( - const Grid_Technique& gt, - const int bxyz, - const int na_grid, // number of atoms on this grid - const int grid_index, // 1d index of FFT index (i,j,k) - const double delta_r, // delta_r of the uniform FFT grid - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int* const block_size, // block_size[na_grid], number of columns of a band - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - double* const* const ddpsir_ylm_xx, - double* const* const ddpsir_ylm_xy, - double* const* const ddpsir_ylm_xz, - double* const* const ddpsir_ylm_yy, - double* const* const ddpsir_ylm_yz, - double* const* const ddpsir_ylm_zz); - -// psir_ylm * vldr3 -ModuleBase::Array_Pool get_psir_vlbr3( - const int bxyz, - const int na_grid, // how many atoms on this (i,j,k) grid - const int LD_pool, - const int* const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const bool* const* const cal_flag, // cal_flag[bxyz][na_grid], whether the atom-grid distance is larger than cutoff - const double* const vldr3, // vldr3[bxyz] - const double* const* const psir_ylm); // psir_ylm[bxyz][LD_pool] - -// sum_nu,R rho_mu,nu(R) psi_nu, for multi-k and gamma point -void mult_psi_DMR( - const Grid_Technique& gt, - const int bxyz, - const int LD_pool, - const int &grid_index, - const int &na_grid, - const int*const block_index, - const int*const block_size, - const bool*const*const cal_flag, - const double*const*const psi, - double*const*const psi_DMR, - const hamilt::HContainer*const DM, - const bool if_symm); - - -// pair.first is the first index of the meshcell which is inside atoms ia1 and ia2. -// pair.second is the number of meshcells which should be calculated in the following gemm. -// If no meshcell is inside both ia1 and ia2, return [bxyz, 0]. -std::pair cal_info(const int bxyz, - const int ia1, - const int ia2, - const bool* const* const cal_flag); - -} // namespace Gint_Tools -#endif diff --git a/source/module_hamilt_lcao/module_gint/gint_vl_cpu_interface.cpp b/source/module_hamilt_lcao/module_gint/gint_vl_cpu_interface.cpp deleted file mode 100644 index 3f6cf36767..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_vl_cpu_interface.cpp +++ /dev/null @@ -1,265 +0,0 @@ -#include "gint.h" -#include "source_base/memory.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" - -void Gint::gint_kernel_vlocal(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_vlocal"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_vlocal"); - const UnitCell& ucell = *this->ucell; - const int max_size = this->gridt->max_atom; - const int lgd = this->gridt->lgd; - const int ncyz = this->ny * this->nplane; - const double dv = ucell.omega / this->ncxyz; - const double delta_r = this->gridt->dr_uniform; - hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hRGint_tmp[inout->ispin]; - hRGint_kernel->set_zero(); - -#pragma omp parallel - { /** - * @brief When in OpenMP, it points to a newly allocated memory, - */ - std::vector block_iw(max_size,0); - std::vector block_index(max_size+1,0); - std::vector block_size(max_size,0); - std::vector vldr3(this->bxyz,0.0); - #pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - /** - * @brief Prepare block information - */ - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - - Gint_Tools::get_gint_vldr3(vldr3.data(), - inout->vl, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - - Gint_Tools::get_block_info(*this->gridt, this->bxyz, na_grid, grid_index, - block_iw.data(), block_index.data(), block_size.data(), cal_flag.get_ptr_2D()); - - /** - * @brief Evaluate psi and dpsi on grids - */ - const int LD_pool = block_index[na_grid]; - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - Gint_Tools::cal_psir_ylm(*this->gridt, - this->bxyz, na_grid, grid_index, delta_r, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(),psir_ylm.get_ptr_2D()); - - // psir_ylm_new=psir_func(psir_ylm) - // psir_func==nullptr means psir_ylm_new=psir_ylm - const ModuleBase::Array_Pool &psir_ylm_1 = (!this->psir_func_1) ? psir_ylm : this->psir_func_1(psir_ylm, *this->gridt, grid_index, 0, block_iw, block_size, block_index, cal_flag); - const ModuleBase::Array_Pool &psir_ylm_2 = (!this->psir_func_2) ? psir_ylm : this->psir_func_2(psir_ylm, *this->gridt, grid_index, 0, block_iw, block_size, block_index, cal_flag); - - //calculating f_mu(r) = v(r)*psi_mu(r)*dv - const ModuleBase::Array_Pool psir_vlbr3 = Gint_Tools::get_psir_vlbr3( - this->bxyz, na_grid, LD_pool, block_index.data(), - cal_flag.get_ptr_2D(), vldr3.data(), psir_ylm_1.get_ptr_2D()); - - //integrate (psi_mu*v(r)*dv) * psi_nu on grid - //and accumulates to the corresponding element in Hamiltonian - this->cal_meshball_vlocal( - na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, - cal_flag.get_ptr_2D(),psir_ylm.get_ptr_2D(), psir_vlbr3.get_ptr_2D(), - hRGint_kernel); - } - ModuleBase::TITLE("Gint_interface", "cal_gint_vlocal"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_vlocal"); - } -} - -void Gint::gint_kernel_dvlocal(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_dvlocal"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_dvlocal"); - const UnitCell& ucell = *this->ucell; - const int max_size = this->gridt->max_atom; - const int lgd = this->gridt->lgd; - const int nnrg = pvdpRx_reduced[inout->ispin].get_nnr(); - const int ncyz = this->ny * this->nplane; - const double dv = ucell.omega / this->ncxyz; - const double delta_r = this->gridt->dr_uniform; - - if (PARAM.globalv.gamma_only_local) { - ModuleBase::WARNING_QUIT("Gint_interface::cal_gint","dvlocal only for k point!"); - } - pvdpRx_reduced[inout->ispin].set_zero(); - pvdpRy_reduced[inout->ispin].set_zero(); - pvdpRz_reduced[inout->ispin].set_zero(); - -#pragma omp parallel -{ - std::vector block_iw(max_size,0); - std::vector block_index(max_size+1,0); - std::vector block_size(max_size,0); - std::vector vldr3(this->bxyz,0.0); -#pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - Gint_Tools::get_gint_vldr3(vldr3.data(), - inout->vl, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - //prepare block information - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - Gint_Tools::get_block_info(*this->gridt, this->bxyz, na_grid, grid_index, - block_iw.data(), block_index.data(), block_size.data(), cal_flag.get_ptr_2D()); - - //evaluate psi and dpsi on grids - const int LD_pool = block_index[na_grid]; - - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_x(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_y(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_z(this->bxyz, LD_pool); - Gint_Tools::cal_dpsir_ylm(*this->gridt, this->bxyz, na_grid, grid_index, delta_r, - block_index.data(), block_size.data(), cal_flag.get_ptr_2D(),psir_ylm.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), dpsir_ylm_y.get_ptr_2D(), dpsir_ylm_z.get_ptr_2D()); - - //calculating f_mu(r) = v(r)*psi_mu(r)*dv - const ModuleBase::Array_Pool psir_vlbr3 = Gint_Tools::get_psir_vlbr3( - this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vldr3.data(), psir_ylm.get_ptr_2D()); - - //integrate (psi_mu*v(r)*dv) * psi_nu on grid - //and accumulates to the corresponding element in Hamiltonian - this->cal_meshball_vlocal(na_grid, LD_pool, block_size.data(), block_index.data(), - grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), &this->pvdpRx_reduced[inout->ispin]); - this->cal_meshball_vlocal(na_grid, LD_pool, block_size.data(), block_index.data(), - grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(), &this->pvdpRy_reduced[inout->ispin]); - this->cal_meshball_vlocal(na_grid, LD_pool, block_size.data(), block_index.data(), - grid_index, cal_flag.get_ptr_2D(),psir_vlbr3.get_ptr_2D(), - dpsir_ylm_z.get_ptr_2D(), &this->pvdpRz_reduced[inout->ispin]); - } -} - ModuleBase::TITLE("Gint_interface", "cal_gint_dvlocal"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_dvlocal"); -} - -void Gint::gint_kernel_vlocal_meta(Gint_inout* inout) { - ModuleBase::TITLE("Gint_interface", "cal_gint_vlocal_meta"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_vlocal_meta"); - const UnitCell& ucell = *this->ucell; - const int max_size = this->gridt->max_atom; - const int lgd = this->gridt->lgd; - const int ncyz = this->ny * this->nplane; - const double dv = ucell.omega / this->ncxyz; - const double delta_r = this->gridt->dr_uniform; - hamilt::HContainer* hRGint_kernel = PARAM.inp.nspin != 4 ? this->hRGint : this->hRGint_tmp[inout->ispin]; - hRGint_kernel->set_zero(); - const int nnrg = hRGint_kernel->get_nnr(); - -#pragma omp parallel -{ - // define HContainer here to reference. - //Under the condition of gamma_only, hRGint will be instantiated. - std::vector block_iw(max_size,0); - std::vector block_index(max_size+1,0); - std::vector block_size(max_size,0); - std::vector vldr3(this->bxyz,0.0); - std::vector vkdr3(this->bxyz,0.0); - -#pragma omp for schedule(dynamic) - for (int grid_index = 0; grid_index < this->nbxx; grid_index++) { - const int na_grid = this->gridt->how_many_atoms[grid_index]; - if (na_grid == 0) { - continue; - } - Gint_Tools::get_gint_vldr3(vldr3.data(), - inout->vl, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - Gint_Tools::get_gint_vldr3(vkdr3.data(), - inout->vofk, - this->bxyz, - this->bx, - this->by, - this->bz, - this->nplane, - this->gridt->start_ind[grid_index], - ncyz, - dv); - //prepare block information - ModuleBase::Array_Pool cal_flag(this->bxyz,max_size); - Gint_Tools::get_block_info(*this->gridt, this->bxyz, na_grid, grid_index, - block_iw.data(), block_index.data(), block_size.data(), cal_flag.get_ptr_2D()); - - //evaluate psi and dpsi on grids - const int LD_pool = block_index[na_grid]; - ModuleBase::Array_Pool psir_ylm(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_x(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_y(this->bxyz, LD_pool); - ModuleBase::Array_Pool dpsir_ylm_z(this->bxyz, LD_pool); - - Gint_Tools::cal_dpsir_ylm(*this->gridt, - this->bxyz, na_grid, grid_index, delta_r, - block_index.data(), block_size.data(), - cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(), - dpsir_ylm_z.get_ptr_2D() - ); - - //calculating f_mu(r) = v(r)*psi_mu(r)*dv - const ModuleBase::Array_Pool psir_vlbr3 = Gint_Tools::get_psir_vlbr3( - this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vldr3.data(), psir_ylm.get_ptr_2D()); - - //calculating df_mu(r) = vofk(r) * dpsi_mu(r) * dv - const ModuleBase::Array_Pool dpsix_vlbr3 = Gint_Tools::get_psir_vlbr3( - this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vkdr3.data(), dpsir_ylm_x.get_ptr_2D()); - const ModuleBase::Array_Pool dpsiy_vlbr3 = Gint_Tools::get_psir_vlbr3( - this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vkdr3.data(), dpsir_ylm_y.get_ptr_2D()); - const ModuleBase::Array_Pool dpsiz_vlbr3 = Gint_Tools::get_psir_vlbr3( - this->bxyz, na_grid, LD_pool, block_index.data(), cal_flag.get_ptr_2D(), vkdr3.data(), dpsir_ylm_z.get_ptr_2D()); - - - //integrate (psi_mu*v(r)*dv) * psi_nu on grid - //and accumulates to the corresponding element in Hamiltonian - this->cal_meshball_vlocal( - na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(), - psir_ylm.get_ptr_2D(), psir_vlbr3.get_ptr_2D(), hRGint_kernel); - //integrate (d/dx_i psi_mu*vk(r)*dv) * (d/dx_i psi_nu) on grid (x_i=x,y,z) - //and accumulates to the corresponding element in Hamiltonian - this->cal_meshball_vlocal( - na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(), - dpsir_ylm_x.get_ptr_2D(), dpsix_vlbr3.get_ptr_2D(), hRGint_kernel); - this->cal_meshball_vlocal( - na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(), - dpsir_ylm_y.get_ptr_2D(), dpsiy_vlbr3.get_ptr_2D(), hRGint_kernel); - this->cal_meshball_vlocal( - na_grid, LD_pool, block_size.data(), block_index.data(), grid_index, cal_flag.get_ptr_2D(), - dpsir_ylm_z.get_ptr_2D(), dpsiz_vlbr3.get_ptr_2D(), hRGint_kernel); - } -} - - ModuleBase::TITLE("Gint_interface", "cal_gint_vlocal_meta"); - ModuleBase::timer::tick("Gint_interface", "cal_gint_vlocal_meta"); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu b/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu deleted file mode 100644 index ddbca83a60..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu +++ /dev/null @@ -1,219 +0,0 @@ -#ifdef _OPENMP -#include -#endif - -#include "kernels/cuda/cuda_tools.cuh" -#include "source_base/ylm.h" -#include "gint_vl_gpu.h" -#include "kernels/cuda/gint_vl.cuh" - -namespace GintKernel -{ - -/** - * Computes the gamma component of the VL (Vlocal) integral on the GPU. - * - * @note The grid integration on the GPU is mainly divided into the following - * steps: - * 1. Use the CPU to divide the grid integration into subtasks. - * 2. Copy the subtask information to the GPU. - * 3. Calculate the matrix elements on the GPU. - * 4. Perform matrix multiplication on the GPU. - * 5. Copy the results back to the host. - */ -void gint_vl_gpu(hamilt::HContainer* hRGint, - const double* vlocal, - const double* ylmcoef_now, - const double dr, - const double* rcut, - const Grid_Technique& gridt, - const UnitCell& ucell) -{ - checkCuda(cudaSetDevice(gridt.dev_id)); - // checkCuda(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync)); - const int nbzp = gridt.nbzp; - const int num_streams = gridt.nstreams; - const int max_atom = gridt.max_atom; - const int max_atom_per_bcell = max_atom * gridt.bxyz; - const int max_atom_per_z = max_atom_per_bcell * nbzp; - const int max_phi_per_z = max_atom_per_z * ucell.nwmax; - const int max_atompair_per_z = max_atom * max_atom * nbzp; - const double vfactor = ucell.omega / gridt.ncxyz; - const int nczp = nbzp * gridt.bz; - std::vector streams(num_streams); - std::vector events(num_streams); - - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamCreate(&streams[i])); - checkCuda(cudaEventCreateWithFlags(&events[i], cudaEventDisableTiming)); - } - - const int nnrg = hRGint->get_nnr(); - hRGint->set_zero(); - Cuda_Mem_Wrapper grid_vlocal_g(nnrg, 1, false); - grid_vlocal_g.memset_device_sync(); - - Cuda_Mem_Wrapper dr_part(max_atom_per_z * 3, num_streams, true); - Cuda_Mem_Wrapper atoms_type(max_atom_per_z, num_streams, true); - // The first number in every group of two represents the number of atoms on that bigcell. - // The second number represents the cumulative number of atoms up to that bigcell. - Cuda_Mem_Wrapper atoms_num_info(2 * nbzp, num_streams, true); - Cuda_Mem_Wrapper vldr3(nbzp * gridt.bxyz, num_streams, true); - - Cuda_Mem_Wrapper psi(max_phi_per_z, num_streams, false); - Cuda_Mem_Wrapper psi_vldr3(max_phi_per_z, num_streams, false); - - Cuda_Mem_Wrapper gemm_m(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_n(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_k(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_lda(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_ldb(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_ldc(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_A(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_B(max_atompair_per_z, num_streams, true); - Cuda_Mem_Wrapper gemm_C(max_atompair_per_z, num_streams, true); - -#ifdef _OPENMP -const int max_thread_num = std::min(omp_get_max_threads(), num_streams); -#endif -#pragma omp parallel num_threads(max_thread_num) -{ -#ifdef _OPENMP - const int tid = omp_get_thread_num(); - const int num_threads = omp_get_num_threads(); - const int sid_start = tid * num_streams / num_threads; - const int thread_num_streams = tid == num_threads - 1 ? num_streams - sid_start : num_streams / num_threads; -#else - const int sid_start = 0; - const int thread_num_streams = num_streams; -#endif -#pragma omp for collapse(2) schedule(dynamic) - for (int i = 0; i < gridt.nbx; i++) - { - for (int j = 0; j < gridt.nby; j++) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gridt.dev_id)); - - const int sid = (i * gridt.nby + j) % thread_num_streams + sid_start; - checkCuda(cudaEventSynchronize(events[sid])); - int max_m = 0; - int max_n = 0; - int atom_pair_num = 0; - int atoms_per_z = 0; - const int grid_index_ij = i * gridt.nby * nbzp + j * nbzp; - - gtask_vlocal(gridt, - ucell, - grid_index_ij, - nczp, - vfactor, - vlocal, - atoms_per_z, - atoms_num_info.get_host_pointer(sid), - atoms_type.get_host_pointer(sid), - dr_part.get_host_pointer(sid), - vldr3.get_host_pointer(sid)); - - alloc_mult_vlocal(hRGint, - gridt, - ucell, - grid_index_ij, - max_atom, - psi.get_device_pointer(sid), - psi_vldr3.get_device_pointer(sid), - grid_vlocal_g.get_device_pointer(), - gemm_m.get_host_pointer(sid), - gemm_n.get_host_pointer(sid), - gemm_k.get_host_pointer(sid), - gemm_lda.get_host_pointer(sid), - gemm_ldb.get_host_pointer(sid), - gemm_ldc.get_host_pointer(sid), - gemm_A.get_host_pointer(sid), - gemm_B.get_host_pointer(sid), - gemm_C.get_host_pointer(sid), - atom_pair_num, - max_m, - max_n); - - dr_part.copy_host_to_device_async(streams[sid], sid, atoms_per_z * 3); - atoms_type.copy_host_to_device_async(streams[sid], sid, atoms_per_z); - vldr3.copy_host_to_device_async(streams[sid], sid); - atoms_num_info.copy_host_to_device_async(streams[sid], sid, 2 * nbzp); - - gemm_m.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_n.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_k.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_lda.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_ldb.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_ldc.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_A.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_B.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - gemm_C.copy_host_to_device_async(streams[sid], sid, atom_pair_num); - checkCuda(cudaEventRecord(events[sid], streams[sid])); - - psi.memset_device_async(streams[sid], sid, 0); - psi_vldr3.memset_device_async(streams[sid], sid, 0); - - dim3 grid_psi(nbzp, gridt.bxyz); - dim3 block_psi(64); - get_psi_and_vldr3<<>>( - gridt.ylmcoef_g, - dr, - gridt.bxyz, - ucell.nwmax, - max_atom, - gridt.atom_nwl_g, - gridt.atom_new_g, - gridt.atom_ylm_g, - gridt.atom_nw_g, - gridt.rcut_g, - gridt.nr_max, - gridt.psi_u_g, - gridt.mcell_pos_g, - dr_part.get_device_pointer(sid), - vldr3.get_device_pointer(sid), - atoms_type.get_device_pointer(sid), - atoms_num_info.get_device_pointer(sid), - psi.get_device_pointer(sid), - psi_vldr3.get_device_pointer(sid)); - checkCudaLastError(); - - gridt.fastest_matrix_mul(max_m, - max_n, - gemm_m.get_device_pointer(sid), - gemm_n.get_device_pointer(sid), - gemm_k.get_device_pointer(sid), - gemm_A.get_device_pointer(sid), - gemm_lda.get_device_pointer(sid), - gemm_B.get_device_pointer(sid), - gemm_ldb.get_device_pointer(sid), - gemm_C.get_device_pointer(sid), - gemm_ldc.get_device_pointer(sid), - atom_pair_num, - streams[sid], - nullptr); - checkCudaLastError(); - } - } -} - - checkCuda(cudaMemcpy( - hRGint->get_wrapper(), - grid_vlocal_g.get_device_pointer(), - nnrg * sizeof(double), - cudaMemcpyDeviceToHost)); - - for (int i = 0; i < num_streams; i++) - { - checkCuda(cudaStreamDestroy(streams[i])); - checkCuda(cudaEventDestroy(events[i])); - } -} - -} // namespace GintKernel \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_vl_gpu.h b/source/module_hamilt_lcao/module_gint/gint_vl_gpu.h deleted file mode 100644 index a04b6a130d..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_vl_gpu.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef GINT_VL_GPU_H -#define GINT_VL_GPU_H - -#include "gint.h" -#include "grid_technique.h" -#include "kernels/cuda/cuda_tools.cuh" - -namespace GintKernel -{ - -void gint_vl_gpu(hamilt::HContainer* hRGint, - const double* vlocal, - const double* ylmcoef_now, - const double dr, - const double* rcut, - const Grid_Technique& gridt, - const UnitCell& ucell); - -void gtask_vlocal(const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int nczp, - const double vfactor, - const double* vlocal_global_value, - int& atoms_per_z, - int* atoms_num_info, - uint8_t* atoms_type, - double* dr_part, - double* vldr3); - -void alloc_mult_vlocal(const hamilt::HContainer* hRGint, - const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int max_atom, - double* const psi, - double* const psi_vldr3, - double* const grid_vlocal_g, - int* mat_m, - int* mat_n, - int* mat_k, - int* mat_lda, - int* mat_ldb, - int* mat_ldc, - double** mat_A, - double** mat_B, - double** mat_C, - int& atom_pair_num, - int& max_m, - int& max_n); -} // namespace GintKernel - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gint_vl_old.cpp b/source/module_hamilt_lcao/module_gint/gint_vl_old.cpp deleted file mode 100644 index 7c17ebff34..0000000000 --- a/source/module_hamilt_lcao/module_gint/gint_vl_old.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "gint_k.h" -#include "source_basis/module_ao/ORB_read.h" -#include "grid_technique.h" -#include "source_base/ylm.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/blas_connector.h" -#include "source_base/timer.h" -#include "source_base/array_pool.h" -#include "source_base/vector3.h" -//#include - -#ifdef _OPENMP -#include -#endif - -#ifdef __MKL -#include -#endif - -// this is a thread-safe function -void Gint::cal_meshball_vlocal( - const int na_grid, // how many atoms on this (i,j,k) grid - const int LD_pool, - const int*const block_size, // block_size[na_grid], number of columns of a band - const int*const block_index, // block_index[na_grid+1], count total number of atomis orbitals - const int grid_index, // index of grid group, for tracing global atom index - const bool*const*const cal_flag, // cal_flag[this->bxyz][na_grid], whether the atom-grid distance is larger than cutoff - const double*const*const psir_ylm, // psir_ylm[this->bxyz][LD_pool] - const double*const*const psir_vlbr3, // psir_vlbr3[this->bxyz][LD_pool] - hamilt::HContainer* hR) // this->hRGint is the container of matrix element. -{ - const char transa='N', transb='T'; - const double alpha=1, beta=1; - const int lgd_now = this->gridt->lgd; - - const int mcell_index = this->gridt->bcell_start[grid_index]; - std::vector hr_tmp; - for(int ia1=0; ia1gridt->which_atom[bcell1]; - const int id1 = this->gridt->which_unitcell[bcell1]; - const ModuleBase::Vector3 r1 = this->gridt->get_ucell_coords(id1); - - for(int ia2=0; ia2gridt->which_atom[bcell2]; - const int id2 = this->gridt->which_unitcell[bcell2]; - const ModuleBase::Vector3 r2 = this->gridt->get_ucell_coords(id2); - - if(iat1<=iat2) - { - int first_ib=0; - for(int ib=0; ibbxyz; ++ib) - { - if(cal_flag[ib][ia1] && cal_flag[ib][ia2]) - { - first_ib=ib; - break; - } - } - int last_ib=0; - for(int ib=this->bxyz-1; ib>=0; --ib) - { - if(cal_flag[ib][ia1] && cal_flag[ib][ia2]) - { - last_ib=ib+1; - break; - } - } - const int ib_length = last_ib-first_ib; - if(ib_length<=0) { continue; } - - const auto tmp_matrix = hR->find_matrix(iat1, iat2, r1-r2); - if (tmp_matrix == nullptr) - { - continue; - } - const int m = tmp_matrix->get_row_size(); - const int n = tmp_matrix->get_col_size(); - hr_tmp.resize(m * n); - ModuleBase::GlobalFunc::ZEROS(hr_tmp.data(), m*n); - - dgemm_(&transa, &transb, &n, &m, &ib_length, &alpha, - &psir_vlbr3[first_ib][block_index[ia2]], &LD_pool, - &psir_ylm[first_ib][block_index[ia1]], &LD_pool, - &beta, hr_tmp.data(), &n); - tmp_matrix->add_array_ts(hr_tmp.data()); - } - } - } -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/grid_bigcell.cpp b/source/module_hamilt_lcao/module_gint/grid_bigcell.cpp deleted file mode 100644 index b004806d8e..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_bigcell.cpp +++ /dev/null @@ -1,363 +0,0 @@ -#include "grid_bigcell.h" - -#include "module_parameter/parameter.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_cell/unitcell.h" -Grid_BigCell::Grid_BigCell() -{ - this->orbital_rmax = 0.0; - this->nxe = this->nye = this->nze = 0; - this->dxe = 0; - this->dye = 0; - this->dze = 0; - this->nxe = 0; - this->nye = 0; - this->nze = 0; - this->nxyze = 0; -} - -Grid_BigCell::~Grid_BigCell() -{ -} - -void Grid_BigCell::init_big_latvec(const UnitCell& ucell) -{ - ModuleBase::TITLE("Grid_BigCell","init_big_latvec"); - // initialize the mesh cell vectors. - assert(nbx>0); - assert(nby>0); - assert(nbz>=0); - - this->nat=ucell.nat; - //size of each big room (same shape with unitcell) - this->bigcell_vec1=std::vector(3,0.0); - this->bigcell_vec1[0]=ucell.a1.x / (double)nbx * ucell.lat0; - this->bigcell_vec1[1]=ucell.a1.y / (double)nbx * ucell.lat0; - this->bigcell_vec1[2]=ucell.a1.z / (double)nbx * ucell.lat0; - - this->bigcell_vec2=std::vector(3,0.0); - this->bigcell_vec2[0]=ucell.a2.x / (double)nby * ucell.lat0; - this->bigcell_vec2[1]=ucell.a2.y / (double)nby * ucell.lat0; - this->bigcell_vec2[2]=ucell.a2.z / (double)nby * ucell.lat0; - - this->bigcell_vec3=std::vector(3,0.0); - this->bigcell_vec3[0]=ucell.a3.x / (double)nbz * ucell.lat0; - this->bigcell_vec3[1]=ucell.a3.y / (double)nbz * ucell.lat0; - this->bigcell_vec3[2]=ucell.a3.z / (double)nbz * ucell.lat0; - - this->bigcell_latvec0.e11 = this->bigcell_vec1[0]; - this->bigcell_latvec0.e12 = this->bigcell_vec1[1]; - this->bigcell_latvec0.e13 = this->bigcell_vec1[2]; - - this->bigcell_latvec0.e21 = this->bigcell_vec2[0]; - this->bigcell_latvec0.e22 = this->bigcell_vec2[1]; - this->bigcell_latvec0.e23 = this->bigcell_vec2[2]; - - this->bigcell_latvec0.e31 = this->bigcell_vec3[0]; - this->bigcell_latvec0.e32 = this->bigcell_vec3[1]; - this->bigcell_latvec0.e33 = this->bigcell_vec3[2]; - - // why we need GT = bigcell_latvec0^(-1)? - // note that (i,j,k) is a grid point. - // (x,y,z) is the cartesian coordinates. - // because - // (x,y,z) = (i,j,k) * bigcell_latvec0 - // once we know (x,y,z) and bigcell_latvec0 - // we need to transform the formula to - // (x,y,z) * bigcell_latvec0^(-1) = (i,j,k) - this->bigcell_GT = this->bigcell_latvec0.Inverse(); - - if(PARAM.inp.test_gridt) - { - GlobalV::ofs_running << " the VECTORS of BIGCELL are (Bohr): " << std::endl; - GlobalV::ofs_running << " vec1( " - << std::setw(15) << bigcell_vec1[0] - << std::setw(15) << bigcell_vec1[1] - << std::setw(15) << bigcell_vec1[2] - << ")" << std::endl; - - GlobalV::ofs_running << " vec2( " - << std::setw(15) << bigcell_vec2[0] - << std::setw(15) << bigcell_vec2[1] - << std::setw(15) << bigcell_vec2[2] - << ")" << std::endl; - - GlobalV::ofs_running << " vec3( " - << std::setw(15) << bigcell_vec3[0] - << std::setw(15) << bigcell_vec3[1] - << std::setw(15) << bigcell_vec3[2] - << ")" << std::endl; - } - return; -} - - -void Grid_BigCell::init_grid_expansion(const UnitCell& ucell,double* rcut) -{ - ModuleBase::TITLE("Grid_BigCell","init_grid_expansion"); - - // calculate the max cutoff radius among all orbitals. - // then we will use this parameter to generate grid expansion. - - for(int T=0; Torbital_rmax = std::max( rcut[T], this->orbital_rmax); - } - if(PARAM.inp.test_gridt)ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"rmax of periodic grid (bohr)",orbital_rmax); - - // mohan fixed serious bug 2010-03-06 - // G = GT^T - // g1 = the norm of first std::vector of G - // g2 = the norm of second std::vector of G - // g3 = the norm of third std::vector of G - double g1 = sqrt(bigcell_GT.e11 * bigcell_GT.e11 - + bigcell_GT.e21 * bigcell_GT.e21 - + bigcell_GT.e31 * bigcell_GT.e31); - - double g2 = sqrt(bigcell_GT.e12 * bigcell_GT.e12 - + bigcell_GT.e22 * bigcell_GT.e22 - + bigcell_GT.e32 * bigcell_GT.e32); - - double g3 = sqrt(bigcell_GT.e13 * bigcell_GT.e13 - + bigcell_GT.e23 * bigcell_GT.e23 - + bigcell_GT.e33 * bigcell_GT.e33); - - // we assume the added bigcell can present even the atom - // is at the edge of the origin grid. - // mohan add +1, 2011-04-23 - this->dxe = static_cast( this->orbital_rmax * g1) +1; - this->dye = static_cast( this->orbital_rmax * g2) +1; - this->dze = static_cast( this->orbital_rmax * g3) +1; - //xiaohui add 'PARAM.inp.out_level' line, 2015-09-16 - if(PARAM.inp.out_level != "m") ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"extended fft grid",dxe,dye,dze); - - // calculate the dimension of expanded grid. - // +1 in order to cover the spillage atom on the right side. - assert(nbx>0); - assert(nby>0); - assert(nbz>=0); - - this->nxe = nbx + 2*dxe +1; - this->nye = nby + 2*dye +1; - this->nze = nbz + 2*dze +1; - this->nxyze = this->nxe * this->nye * this->nze; - - if(PARAM.inp.out_level != "m") ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"dimension of extened grid",nxe,nye,nze); - return; -} - - -void Grid_BigCell::init_tau_in_bigcell(const UnitCell& ucell) -{ - ModuleBase::TITLE("Grid_BigCell","init_tau_in_bigcell"); - - // allcoate space for atom positions relative - // to meshcell. - this->tau_in_bigcell = std::vector>(ucell.nat,std::vector(3,0.0)); - ModuleBase::Memory::record("tau_in_bigcell", sizeof(double) * ucell.nat*3); - // allocate space, these arrays record which meshcell - // the atom is in. - this->index_atom = std::vector(ucell.nat, 0); - ModuleBase::Memory::record("index_atom", sizeof(double) * ucell.nat); - - // get the fraction number of (i,j,k) - ModuleBase::Vector3 fraction; - int iat=0; - int ii,jj,kk; - double delta[3]; - for(int it=0; itbigcell_GT; - - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // mohan add 2012-07-03, - // this can make sure faction are always larger than 0. - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - fraction.x = ucell.atoms[it].taud[ia].x / (1.0/(double)nbx); - fraction.y = ucell.atoms[it].taud[ia].y / (1.0/(double)nby); - fraction.z = ucell.atoms[it].taud[ia].z / (1.0/(double)nbz); - - // never use the following, especially for k-algorithm, - // it may move the atom to a cell that it doesn't belong - // to - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // mohan add 2012-06-07 - // fraction may be very very small, about -1.0e-15, - // and the fraction must > 0, so I use periodic boundary condition -// if( fraction.x < 0.0 ) fraction.x += nxe; -// if( fraction.y < 0.0 ) fraction.y += nye; -// if( fraction.z < 0.0 ) fraction.z += nze; - - - - if( fraction.x < 0 || fraction.y < 0 || fraction.z < 0) - { - std::cout << " Atom positions " << std::endl; - std::cout << ucell.atoms[it].tau[ia].x << " " ; - std::cout << ucell.atoms[it].tau[ia].y << " " ; - std::cout << ucell.atoms[it].tau[ia].z << " " ; - std::cout << " fraction " << std::endl; - std::cout << fraction.x << " "; - std::cout << fraction.y << " "; - std::cout << fraction.z << " "; - std::cout << std::endl; - ModuleBase::WARNING_QUIT("Grid_BigCell::init_tau_in_bigcell","fraction.x<0 || fraction.y<0 || fraction.z<0"); - } - - assert(fraction.x >= 0.0); - assert(fraction.y >= 0.0); - assert(fraction.z >= 0.0); - - // make clean which meshcell the atom is in. - ii = static_cast(fraction.x+1.0e-8); - jj = static_cast(fraction.y+1.0e-8); - kk = static_cast(fraction.z+1.0e-8); - - // calculate the index of each corresponding meshcell. - // Notice ! In fact, we need to minus ii,jj,kk by 1. - // to label the atom belong to which meshcell - // in a usual way: left, down corner. - // if we dont' do this, means the start position - // of atom is another tyep: right,up corner. - // which cause minus atom position in grid integration. - - // index_atom: atom 'iat' index in extended grid. - this->index_atom[iat] = (kk+dze) + (jj+dye) * this->nze + (ii+dxe) * this->nye * this->nze; - - /* - if(index_atom[iat]==3483935) - { - std::cout << "\n i=" << kk+dze << " j=" << jj+dye << " k=" << ii+dxe; - BLOCK_HERE("check index atom"); - } - */ - - // get the relative position in direct coordinate. - delta[0] = fraction.x - (double)ii; - delta[1] = fraction.y - (double)jj; - delta[2] = fraction.z - (double)kk; - - if( std::abs(delta[0]) < 1.0e-8) delta[0] = 0.0; - if( std::abs(delta[1]) < 1.0e-8) delta[1] = 0.0; - if( std::abs(delta[2]) < 1.0e-8) delta[2] = 0.0; - -// std::cout << " fraction=" << fraction.x << " " << fraction.y << " " << fraction.z << std::endl; -// std::cout << " delta=" << delta[0] << " " << delta[1] << " " << delta[2] << std::endl; - - // get the true relative cartesian coordinate of each atom to the coresponding - // meshcell. - for(int ic=0; ic<3; ic++) - { - this->tau_in_bigcell[iat][ic] = - delta[0] * this->bigcell_vec1[ic] + - delta[1] * this->bigcell_vec2[ic] + - delta[2] * this->bigcell_vec3[ic]; - } - - ++iat; - } - } - - return; -} - -// (3) -// if f2normal == true, calculate the index2normal. -// if f2normal == false, calculate the index2cell. -void Grid_BigCell::grid_expansion_index(bool f2normal, int *target)const -{ - ModuleBase::TITLE("Grid_BigCell","grid_expansion_index"); - ModuleBase::timer::tick("Grid_BigCell","grid_expansion_index"); - - int ii,jj,kk,in_ext,in_normal; - for(int i=0; inxe; i++) - { - for(int j=0; jnye; j++) - { - for(int k=0; knze; k++) - { - in_ext = k + j * this->nze + i * this->nye * this->nze; - - // range from [-dxe,ncx+dxe] - ii = i - this->dxe; - jj = j - this->dye; - kk = k - this->dze; - - //--------------------------------------------------- - // mohan add 2010-10-28 - // be careful of the box. - // it's useful only when k points are used in LCAO. - // for example, we construct a 2D supercell - // and using 32 * 32 FFT grid (bigcell ) to do - // grid integration, - // then the first cell (0,0) along x is [0,31) - // others are: - // cell index: (-2,0) , (-1,0) , (0,0), (0,1) - // fft index: [-64,-33], [-32,-1], [0,31], [32,63]. - // look at the formulas below, - // at first, we take grid_index2ucell1=(ii/nbx) - // but then we found it is wrong if ii < 0. - // for example, if ii is -31, the box is -1, - // so we add -1, the formula turns to ii/nbx-1, - // but if ii is -32, the box is -1-1 = -2, not correct. - // so we add 1 to ii, the box will be -31/32-1=-1, correct! - // the formula is (ii+1)/nbx-1, - // if ii is -1, the box is still -1, correct! - // if ii is -33, the box is -2, correct! - //--------------------------------------------------- - - int cel1, cel2, cel3; - - if(ii<0) cel1 = (ii+1) / nbx - 1; - else cel1 = ii / nbx; - if(jj<0) cel2 = (jj+1) / nby - 1; - else cel2 = jj / nby; - if(kk<0) cel3 = (kk+1) / nbz - 1; - else cel3 = kk / nbz; - - if(!f2normal) - { - // target: index2ucell - target[in_ext] = this->cal_Rindex(cel1, cel2, cel3); - } - else - { - // if ii < 0, we need to make ii > 0. - // so we add 10000 layers. It should be enough. - // ii, jj, kk shoudl -- ????????????? - ii = (ii + 10000 * nbx) % nbx; - jj = (jj + 10000 * nby) % nby; - kk = (kk + 10000 * nbz) % nbz; - - assert(ii>=0); - assert(jj>=0); - assert(kk>=0); - - assert( in_ext < nxyze); - - if(ii> tau_in_bigcell; - - /// move operator for the next ESolver to directly use its infomation - Grid_BigCell& operator=(Grid_BigCell&& rhs) = default; - - protected: - // get the max radius of all orbitals - // which will use to generate grid expansion, - // and the meshball. - double orbital_rmax; - - // the added number of bigcelli each direction. - int dxe; - int dye; - int dze; - - // expansion grid dimension. - int nxe; - int nye; - int nze; - int nxyze; - - std::vector index_atom; - - // save the position of base vector of bigcell. - std::vector bigcell_vec1; - std::vector bigcell_vec2; - std::vector bigcell_vec3; - - ModuleBase::Matrix3 bigcell_latvec0; - ModuleBase::Matrix3 bigcell_GT; - - //--------------------------------- - void grid_expansion_index(bool f2normal, int *target)const; - //--------------------------------- - void init_big_latvec(const UnitCell &ucell); - //--------------------------------- - void init_tau_in_bigcell(const UnitCell& ucell); - //--------------------------------- - void init_grid_expansion(const UnitCell& ucell,double* rcut); -}; -#endif diff --git a/source/module_hamilt_lcao/module_gint/grid_meshball.cpp b/source/module_hamilt_lcao/module_gint/grid_meshball.cpp deleted file mode 100644 index 5a1c395c9a..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_meshball.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include "grid_meshball.h" -#include "source_base/memory.h" -#include "module_parameter/parameter.h" - -Grid_MeshBall::Grid_MeshBall() -{ -} - -Grid_MeshBall::~Grid_MeshBall() -{ -} - -void Grid_MeshBall::init_meshball() -{ - ModuleBase::TITLE("Grid_MeshBall","init_meshball"); - - // init meshball_radius, generally the value - // is same as orbital_rmax, of course you can - // incrase meshball_radius, but there will be - // no atoms in the added bigcells. - // (in case subcell are too many). - this->meshball_radius = this->orbital_rmax; - - // select a ball in a cubic. - double pos[3]; - double r2=0.0; - - //------------------------------------------------------------------ - // const double rcut2 = this->meshball_radius * this->meshball_radius; - // qianrui fix a bug and add 0.001 2022-4-30 - // Sometimes r2 is equal to rcut2, for example they are 36. - // However, r2 is either 35.99.. or 36.0..001, which makes count != this->meshball_ncells - // and segment fault. - // I do not know how to solve it and this may occurs in somewhere else in ABACUS. - // May some genius can give a better solution. - //------------------------------------------------------------------ - const double rcut2 = this->meshball_radius * this->meshball_radius + 0.001; - - //------------------------------------------------------------------- - // calculate twice, the first time find the number of mesh points, - // then allocate array and save each bigcell's cartesian coordinate. - // plus one because we need to cover atom spillage. - // meshball_ncells: How many cells in mesh ball. - //------------------------------------------------------------------- - this->meshball_ncells = 0; - for(int i=-dxe; ideal_with_atom_spillage( pos ); - //r2 = pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2]; - - // calculate the distance. - if( r2 < rcut2 ) - { - ++meshball_ncells; - } - } - } - } - if(PARAM.inp.test_gridt) {ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "how many cells in meshball",this->meshball_ncells); -} - - // prepare for the second calculation. - this->meshball_positions = std::vector>(meshball_ncells, std::vector(3, 0.0)); - ModuleBase::Memory::record("meshball_pos", sizeof(double) * meshball_ncells*3); - this->index_ball = std::vector(meshball_ncells); - ModuleBase::Memory::record("index_ball", sizeof(int) * meshball_ncells); - - // second time. - int count = 0; - for(int i=-dxe; idxe+1; i++) - { - for(int j=-dye; jdye+1; j++) - { - for(int k=-dze; kdze+1; k++) - { - // caclculate the std::vector away from 'zero point'. - // change to cartesian coordinates. - for(int ip=0; ip<3; ip++) - { - pos[ip] = i*bigcell_vec1[ip]+j*bigcell_vec2[ip]+k*bigcell_vec3[ip]; - } - r2 = this->deal_with_atom_spillage( pos ); - - // calculate the distance. - if( r2 < rcut2 ) - { - for(int ip=0; ip<3; ip++) - { - this->meshball_positions[count][ip] = pos[ip]; - } - - // record each position. - this->index_ball[count] = k + j * this->nze + i * this->nye * this->nze; - ++count; - } - } - } - } - - assert(count == this->meshball_ncells); - return; -} - -double Grid_MeshBall::deal_with_atom_spillage(const double *pos) -{ - double dx; - double r2 = 100000; - double *cell=new double[3]; - - for(int i=-1; i<=1; i++) - { - for(int j=-1; j<=1; j++) - { - for(int k=-1; k<=1; k++) - { - dx = 0.0; - for(int ip=0; ip<3; ip++) - { - // change to cartesian coordinates. - cell[ip] = i*this->bigcell_vec1[ip] + - j*this->bigcell_vec2[ip] + - k*this->bigcell_vec3[ip]; - dx += (cell[ip] - pos[ip]) * (cell[ip] - pos[ip]); - } - r2 = std::min(dx, r2); - } - } - } - delete[] cell; - return r2; -} - - diff --git a/source/module_hamilt_lcao/module_gint/grid_meshball.h b/source/module_hamilt_lcao/module_gint/grid_meshball.h deleted file mode 100644 index 571d59126e..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_meshball.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef GRID_MESHBALL_H -#define GRID_MESHBALL_H - -#include "grid_bigcell.h" - -class Grid_MeshBall : public Grid_BigCell -{ - public: - Grid_MeshBall(); - ~Grid_MeshBall(); - // cartesian coordinates of meshball. - std::vector> meshball_positions; - - /// move operator for the next ESolver to directly use its infomation - Grid_MeshBall& operator=(Grid_MeshBall&& rhs) = default; - - protected: - // number of meshcells in meshball. - int meshball_ncells=0; - // used in index2normal - std::vector index_ball; - // search each meshcell of this meshball. - void init_meshball(void); - - private: - // init the meshball radius. - double meshball_radius=0.0; - // Handle as a truncation function. - double deal_with_atom_spillage(const double* pos); - -}; -#endif diff --git a/source/module_hamilt_lcao/module_gint/grid_meshcell.cpp b/source/module_hamilt_lcao/module_gint/grid_meshcell.cpp deleted file mode 100644 index 00e2224513..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_meshcell.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include "grid_meshcell.h" - -#include "module_parameter/parameter.h" -#include "source_base/memory.h" -#include "source_pw/hamilt_pwdft/global.h" - -Grid_MeshCell::Grid_MeshCell() -{ -} - -Grid_MeshCell::~Grid_MeshCell() -{ -} - -void Grid_MeshCell::set_grid_dim( - const int &ncx_in, - const int &ncy_in, - const int &ncz_in, - const int &bx_in, - const int &by_in, - const int &bz_in, - const int &nbx_in, - const int &nby_in, - const int &nbz_in, - const int &nbxx_in, - const int &nbzp_start_in, - const int &nbzp_in - ) -{ - this->ncx = ncx_in; - this->ncy = ncy_in; - this->ncz = ncz_in; - this->ncxyz = ncx * ncy * ncz; - this->bx = bx_in; - this->by = by_in; - this->bz = bz_in; - this->bxyz = bx*by*bz; - this->nbx = nbx_in; - this->nby = nby_in; - this->nbz = nbz_in; - this->nbxyz = nbx*nby*nbz; - this->nbxx = nbxx_in; - this->nbzp_start = nbzp_start_in; - this->nbzp = nbzp_in; - - - //xiaohui add 'PARAM.inp.out_level' line, 2015-09-16 - if(PARAM.inp.out_level != "m") - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"real space grid",ncx,ncy,ncz); // real space uniform grid - } - - if(PARAM.inp.out_level != "m") - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"big cell numbers in grid",nbx,nby,nbz); // reduced by BIG_CELL - } - - if(PARAM.inp.out_level != "m") - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"meshcell numbers in big cell",bx,by,bz); // is small integer, typical number 2*2*2 - } - - return; -} - - - -// (1) -void Grid_MeshCell::init_latvec(const UnitCell &ucell) -{ - ModuleBase::TITLE("Grid_MeshCell","init_latvec"); - // initialize the mesh cell vectors. - assert(ncx>0); - assert(ncy>0); - assert(ncz>0); - - //size of each room (same shape with unitcell) - this->meshcell_vec1=std::vector(3,0.0); - this->meshcell_vec1[0]=ucell.a1.x / (double)ncx * ucell.lat0; - this->meshcell_vec1[1]=ucell.a1.y / (double)ncx * ucell.lat0; - this->meshcell_vec1[2]=ucell.a1.z / (double)ncx * ucell.lat0; - - this->meshcell_vec2=std::vector(3,0.0); - this->meshcell_vec2[0]=ucell.a2.x / (double)ncy * ucell.lat0; - this->meshcell_vec2[1]=ucell.a2.y / (double)ncy * ucell.lat0; - this->meshcell_vec2[2]=ucell.a2.z / (double)ncy * ucell.lat0; - - this->meshcell_vec3=std::vector(3,0.0); - this->meshcell_vec3[0]=ucell.a3.x / (double)ncz * ucell.lat0; - this->meshcell_vec3[1]=ucell.a3.y / (double)ncz * ucell.lat0; - this->meshcell_vec3[2]=ucell.a3.z / (double)ncz * ucell.lat0; - - this->meshcell_latvec0.e11 = this->meshcell_vec1[0]; - this->meshcell_latvec0.e12 = this->meshcell_vec1[1]; - this->meshcell_latvec0.e13 = this->meshcell_vec1[2]; - - this->meshcell_latvec0.e21 = this->meshcell_vec2[0]; - this->meshcell_latvec0.e22 = this->meshcell_vec2[1]; - this->meshcell_latvec0.e23 = this->meshcell_vec2[2]; - - this->meshcell_latvec0.e31 = this->meshcell_vec3[0]; - this->meshcell_latvec0.e32 = this->meshcell_vec3[1]; - this->meshcell_latvec0.e33 = this->meshcell_vec3[2]; - - // why we need GT = meshcell_latvec0^(-1)? - // note that (i,j,k) is a grid point. - // (x,y,z) is the cartesian coordinates. - // because - // (x,y,z) = (i,j,k) * meshcell_latvec0 - // once we know (x,y,z) and meshcell_latvec0 - // we need to transform the formula to - // (x,y,z) * meshcell_latvec0^(-1) = (i,j,k) - this->meshcell_GT = this->meshcell_latvec0.Inverse(); - - if(PARAM.inp.test_gridt) - { - GlobalV::ofs_running << " the VECTORS of MESHCELL are (Bohr): " << std::endl; - GlobalV::ofs_running << " vec1( " - << std::setw(15) << meshcell_vec1[0] - << std::setw(15) << meshcell_vec1[1] - << std::setw(15) << meshcell_vec1[2] - << ")" << std::endl; - - GlobalV::ofs_running << " vec2( " - << std::setw(15) << meshcell_vec2[0] - << std::setw(15) << meshcell_vec2[1] - << std::setw(15) << meshcell_vec2[2] - << ")" << std::endl; - - GlobalV::ofs_running << " vec3( " - << std::setw(15) << meshcell_vec3[0] - << std::setw(15) << meshcell_vec3[1] - << std::setw(15) << meshcell_vec3[2] - << ")" << std::endl; - } - - return; -} - -void Grid_MeshCell::init_meshcell_pos(void) -{ - assert(bx>0); - assert(by>0); - assert(bz>0); - assert(bxyz>0); - - meshcell_pos = std::vector>(bxyz,std::vector(3,0.0)); - ModuleBase::Memory::record("meshcell_pos", sizeof(double) * bxyz*3); - - int index=0; - for(int i=0; i> meshcell_pos; - - private: - // latvec0 and GT are not used in current code. - // these two variables may be removed in the future. - ModuleBase::Matrix3 meshcell_latvec0; - ModuleBase::Matrix3 meshcell_GT; - - protected: - - std::vector meshcell_vec1; - std::vector meshcell_vec2; - std::vector meshcell_vec3; - - /// move operator for the next ESolver to directly use its infomation - Grid_MeshCell& operator=(Grid_MeshCell&& rhs) = default; - - void set_grid_dim( - const int &ncx_in, - const int &ncy_in, - const int &ncz_in, - const int &bx_in, - const int &by_in, - const int &bz_in, - const int &nbx_in, - const int &nby_in, - const int &nbz_in, - const int &nbxx_in, - const int &nbzp_start_in, - const int &nbzp_in); - - void init_latvec(const UnitCell &ucell); - void init_meshcell_pos(); - -}; - -#endif diff --git a/source/module_hamilt_lcao/module_gint/grid_meshk.cpp b/source/module_hamilt_lcao/module_gint/grid_meshk.cpp deleted file mode 100644 index ec62298c8b..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_meshk.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "grid_meshk.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -Grid_MeshK::Grid_MeshK() -{ -} - -Grid_MeshK::~Grid_MeshK() -{ -} - -int Grid_MeshK::cal_Rindex(const int &u1, const int &u2, const int &u3)const -{ - const int x1 = u1 - this->minu1; - const int x2 = u2 - this->minu2; - const int x3 = u3 - this->minu3; - - if(x1<0 || x2<0 || x3<0) - { - std::cout << " u1=" << u1 << " minu1=" << minu1 << std::endl; - std::cout << " u2=" << u2 << " minu2=" << minu2 << std::endl; - std::cout << " u3=" << u3 << " minu3=" << minu3 << std::endl; - ModuleBase::WARNING_QUIT("Grid_MeshK::cal_Rindex","x1<0 || x2<0 || x3<0 !"); - } - - assert(x1>=0); - assert(x2>=0); - assert(x3>=0); - - return (x3 + x2 * this->nu3 + x1 * this->nu2 * this->nu3); -} - -ModuleBase::Vector3 Grid_MeshK::get_ucell_coords(const int &Rindex)const -{ - const int x = ucell_index2x[Rindex]; - const int y = ucell_index2y[Rindex]; - const int z = ucell_index2z[Rindex]; - - return ModuleBase::Vector3(x, y, z); -} - -void Grid_MeshK::cal_extended_cell(const int &dxe, const int &dye, const int &dze,const int& nbx, const int& nby, const int& nbz) -{ - ModuleBase::TITLE("Grid_MeshK","cal_extended_cell"); - - //-------------------------------------- - // max and min unitcell in expaned grid. - //-------------------------------------- - this->maxu1 = dxe / nbx + 1; - this->maxu2 = dye / nby + 1; - this->maxu3 = dze / nbz + 1; - - this->minu1 = (-dxe+1) / nbx - 1; - this->minu2 = (-dye+1) / nby - 1; - this->minu3 = (-dze+1) / nbz - 1; - - if(PARAM.inp.test_gridt) {ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"MaxUnitcell",maxu1,maxu2,maxu3); -} - if(PARAM.inp.test_gridt) {ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"MinUnitcell",minu1,minu2,minu3); -} - - //-------------------------------------- - // number of unitcell in each direction. - //-------------------------------------- - this->nu1 = maxu1 - minu1 + 1; - this->nu2 = maxu2 - minu2 + 1; - this->nu3 = maxu3 - minu3 + 1; - this->nutot = nu1 * nu2 * nu3; - - if(PARAM.inp.test_gridt) {ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"UnitCellNumber",nu1,nu2,nu3); -} - if(PARAM.inp.out_level != "m") { ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"UnitCellTotal",nutot); -} - - - this->ucell_index2x = std::vector(nutot, 0); - this->ucell_index2y = std::vector(nutot, 0); - this->ucell_index2z = std::vector(nutot, 0); - - this->nutot = nu1 * nu2 * nu3; - - for(int i=minu1; i<=maxu1; i++) - { - for(int j=minu2; j<=maxu2; j++) - { - for(int k=minu3; k<=maxu3; k++) - { - const int cell = cal_Rindex(i,j,k); - assert(cellucell_index2x[cell] = i; - this->ucell_index2y[cell] = j; - this->ucell_index2z[cell] = k; - - } - } - } - - return; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/grid_meshk.h b/source/module_hamilt_lcao/module_gint/grid_meshk.h deleted file mode 100644 index fb8d458bb0..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_meshk.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef GRID_MESHK_H -#define GRID_MESHK_H -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/vector3.h" - -class Grid_MeshK -{ - public: - Grid_MeshK(); - ~Grid_MeshK(); - - // calculate the index of unitcell. - int cal_Rindex(const int& u1, const int& u2, const int& u3)const; - - ModuleBase::Vector3 get_ucell_coords(const int& Rindex)const; - - /// move operator for the next ESolver to directly use its infomation - Grid_MeshK& operator=(Grid_MeshK&& rhs) = default; - - private: - // the max and the min unitcell. - int maxu1; - int maxu2; - int maxu3; - - int minu1; - int minu2; - int minu3; - - // the number of unitcells. - int nu1; - int nu2; - int nu3; - int nutot; - - // from 1D index to unitcell. - std::vector ucell_index2x; - std::vector ucell_index2y; - std::vector ucell_index2z; - - protected: - // calculate the extended unitcell. - void cal_extended_cell(const int &dxe, const int &dye, const int &dze, - const int& nbx, const int& nby, const int& nbz); -}; - -#endif diff --git a/source/module_hamilt_lcao/module_gint/grid_technique.cpp b/source/module_hamilt_lcao/module_gint/grid_technique.cpp deleted file mode 100644 index 4469a833dc..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_technique.cpp +++ /dev/null @@ -1,784 +0,0 @@ -#if ((defined __CUDA) /* || (defined __ROCM) */) -#include -#include "module_parameter/parameter.h" -#endif -#include "grid_technique.h" -#include "module_parameter/parameter.h" -#include "source_base/memory.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_hsolver/kernels/cuda/helper_cuda.h" - -#include "module_hamilt_lcao/module_gint/temp_gint/gint_helper.h" - -Grid_Technique::Grid_Technique() { -#if ((defined __CUDA) /* || (defined __ROCM) */) - if (PARAM.inp.device == "gpu") { - is_malloced = false; - } -#endif -} - -Grid_Technique::~Grid_Technique() { - -#if ((defined __CUDA) /* || (defined __ROCM) */) - if (PARAM.inp.device == "gpu") { - free_gpu_gint_variables(this->nat); - } -#endif -} - -// This function is called in esolver_ks_lcao_elec.cpp -// after the orbital information has been read, -// this function control the routinue to generate -// grid technique parameters. -void Grid_Technique::set_pbc_grid(const int& ncx_in, - const int& ncy_in, - const int& ncz_in, - const int& bx_in, - const int& by_in, - const int& bz_in, - const int& nbx_in, - const int& nby_in, - const int& nbz_in, - const int& nbxx_in, - const int& nbzp_start_in, - const int& nbzp_in, - const int& ny, - const int& nplane, - const int& startz_current, - const UnitCell& ucell, - const Grid_Driver& gd, - const double& dr_uniform, - const std::vector& rcuts, - const std::vector>& psi_u, - const std::vector>& dpsi_u, - const std::vector>& d2psi_u, - const int& num_stream) -{ - ModuleBase::TITLE("Grid_Technique", "init"); - ModuleBase::timer::tick("Grid_Technique", "init"); - - if (PARAM.inp.out_level != "m") { - GlobalV::ofs_running - << "\n SETUP EXTENDED REAL SPACE GRID FOR GRID INTEGRATION" - << std::endl; - } - this->init_malloced = true; - - // copy ucell and orb parameters - this->ucell = &ucell; - this->dr_uniform = dr_uniform; - - this->nwmax = ucell.nwmax; - this->ntype = ucell.ntype; - - this->rcuts = rcuts; - double max_cut = *std::max_element(this->rcuts.begin(), this->rcuts.end()); - this->nr_max = static_cast(1 / this->dr_uniform * max_cut) + 10; - this->psi_u = psi_u; - this->dpsi_u = dpsi_u; - this->d2psi_u = d2psi_u; - - // (1) init_meshcell cell and big cell. - this->set_grid_dim(ncx_in, - ncy_in, - ncz_in, - bx_in, - by_in, - bz_in, - nbx_in, - nby_in, - nbz_in, - nbxx_in, - nbzp_start_in, - nbzp_in); - this->init_latvec(ucell); - - this->init_big_latvec(ucell); - - this->init_meshcell_pos(); - - // (2) expand the grid - - this->init_grid_expansion(ucell, this->rcuts.data()); - - // (3) calculate the extended grid. - this->cal_extended_cell(this->dxe, - this->dye, - this->dze, - this->nbx, - this->nby, - this->nbz); - - this->init_tau_in_bigcell(ucell); - - this->init_meshball(); - - this->init_atoms_on_grid(ny, nplane, ucell); - - this->init_ijr_and_nnrg(ucell, gd); - this->cal_trace_lo(ucell); -#if ((defined __CUDA) /* || (defined __ROCM) */) - if (PARAM.inp.device == "gpu") { - this->init_gpu_gint_variables(ucell, num_stream); - } -#endif - - ModuleBase::timer::tick("Grid_Technique", "init"); - return; -} - -void Grid_Technique::get_startind(const int& ny, - const int& nplane) { - ModuleBase::TITLE("Grid_Technique", "get_startind"); - - assert(nbxx >= 0); - - // calculates start_ind, which stores the - // starting index of each bigcell - this->start_ind = std::vector(nbxx, 0); - ModuleBase::Memory::record("GT::start_ind", sizeof(int) * nbxx); - - for (int i = 0; i < nbxx; i++) { - int ibx = 0; - int iby = 0; - int ibz = 0; - - int ix = 0; - int iy = 0; - int iz = 0; - - ibx = i / (nby * nbzp); - iby = (i - ibx * nby * nbzp) / nbzp; - ibz = i % nbzp; - - ix = ibx * this->bx; - iy = iby * this->by; - iz = ibz * this->bz; - - int ind = iz + iy * nplane + ix * ny * nplane; - - start_ind[i] = ind; - } - - return; -} - -// PLEASE update this 'init_atoms_on_grid' to make -// it adapted to 'cuboid' shape of grid -// mohan add 2021-04-06 -void Grid_Technique::init_atoms_on_grid(const int& ny, - const int& nplane, - const UnitCell& ucell) { - ModuleBase::TITLE("Grid_Technique", "init_atoms_on_grid"); - - assert(nbxx >= 0); - this->get_startind(ny, nplane); - - // (1) prepare data. - // counting the number of atoms whose orbitals have - // values on the bigcell. - this->how_many_atoms = std::vector(nbxx, 0); - ModuleBase::Memory::record("GT::how_many_atoms", sizeof(int) * nbxx); - - // (2) information about gloabl grid - // and local grid. - // mohan add 2010-07-02 - std::vector ind_bigcell = std::vector(nbxyz, 0); - ModuleBase::Memory::record("GT::ind_bigcell", sizeof(int) * this->nxyze); - std::vector bigcell_on_processor = std::vector(nbxyz, 0); - ModuleBase::Memory::record("GT::bigcell_on_processor", - sizeof(char) * this->nxyze); - this->check_bigcell(ind_bigcell.data(), bigcell_on_processor.data()); - - // (3) Find the atoms using - // when doing grid integration. - this->in_this_processor = std::vector(ucell.nat, false); - ModuleBase::Memory::record("GT::in_this_processor", - sizeof(int) * this->nxyze); - - // (4) init atoms on grid - std::vector index2normal = std::vector(this->nxyze, 0); - ModuleBase::Memory::record("GT::index2normal", sizeof(int) * this->nxyze); - this->grid_expansion_index(true, index2normal.data()); - - // (5) record how many atoms on - // each local grid point (ix,iy,iz) - int nat_local = 0; - this->total_atoms_on_grid = 0; - for (int iat = 0; iat < ucell.nat; iat++) - { - const int it = ucell.iat2it[iat]; - const double rcut_square = this->rcuts[it] * this->rcuts[it]; - for (int im = 0; im < this->meshball_ncells; im++) - { - // bcell[iat]: which bcell iat atom is in. - // ball[im]: relative position of adjacent bcell. - const int normal = index2normal[this->index_atom[iat] + this->index_ball[im]]; -#ifdef __DEBUG - if (normal >= nbxyz) - { - #pragma omp critical - { - std::cout << " index_atom=" << index_atom[iat] << std::endl; - std::cout << " index_ball=" << index_ball[im] << std::endl; - std::cout << " normal=" << normal << std::endl; - std::cout << " nbxyz=" << nbxyz << std::endl; - ModuleBase::WARNING_QUIT( - "Grid_Technique::init_atoms_on_grid", - "normal >= nbxyz"); - } - } -#endif - assert(normal >= 0); - const int bcell_idx_on_proc = ind_bigcell[normal]; - if (!bigcell_on_processor[normal]) - { - continue; - } - - bool is_atom_on_bcell = false; - const double dr_x_part = this->meshball_positions[im][0] - this->tau_in_bigcell[iat][0]; - const double dr_y_part = this->meshball_positions[im][1] - this->tau_in_bigcell[iat][1]; - const double dr_z_part = this->meshball_positions[im][2] - this->tau_in_bigcell[iat][2]; - for(int imcell = 0; imcell < this -> bxyz; imcell++) - { - const double dr_x = this->meshcell_pos[imcell][0] + dr_x_part; - const double dr_y = this->meshcell_pos[imcell][1] + dr_y_part; - const double dr_z = this->meshcell_pos[imcell][2] + dr_z_part; - const double dist_square = dr_x * dr_x + dr_y * dr_y + dr_z * dr_z; - if(dist_square <= rcut_square) - { - is_atom_on_bcell = true; - break; - } - } - if(is_atom_on_bcell) - { - ++how_many_atoms[bcell_idx_on_proc]; - ++this->total_atoms_on_grid; - this->in_this_processor[iat] = true; - } - } - if (this->in_this_processor[iat]) - { - ++nat_local; - } - } - - if (PARAM.inp.test_gridt) { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, - "Total_atoms_on_grid", - total_atoms_on_grid); -} - - int stop = 0; - if (total_atoms_on_grid == 0) { - GlobalV::ofs_running << " No atoms on this sub-FFT-mesh." << std::endl; - stop = 1; - } - Parallel_Reduce::reduce_all(stop); - if (stop) { - ModuleBase::WARNING("Grid_Technique::init_atoms_on_grid", - "No atom on this sub-FFT-mesh."); - } - - // calculate the trach of local ia to global iat - if (nat_local > 0) { - this->trace_iat.resize(nat_local); - for (int iat = ucell.nat - 1; iat >= 0; iat--) { - if (this->in_this_processor[iat]) { - this->trace_iat[--nat_local] = iat; - } - } - } - - // need how_many_atoms first. - this->cal_grid_integration_index(); - // bcell_start is needed. - this->init_atoms_on_grid2(index2normal.data(), ucell); - return; -} - -void Grid_Technique::check_bigcell(int* ind_bigcell, - char* bigcell_on_processor) { - // check if a given bigcell is treated on this processor - const int zstart = nbzp_start; - const int zend = nbzp + zstart; - const int nbyz = nby * nbz; - const int nz = nbzp; - - int iz_now = 0; - int ix = 0; - int iy = 0; - int iz = 0; - int ind = 0; - bool flag = false; - - for (int i = 0; i < nbxyz; i++) { - int iz_now = i % nbz; - if (iz_now < zstart || iz_now >= zend) { - flag = false; - } else { - flag = true; - ix = i / nbyz; - iy = (i - ix * nbyz) / nbz; - iz = iz_now - zstart; - ind = ix * nby * nz + iy * nz + iz; - // no need to calculate index if bigcell is - // not on this processor - } - - ind_bigcell[i] = ind; - bigcell_on_processor[i] = flag; - } - return; -} - -void Grid_Technique::init_atoms_on_grid2(const int* index2normal, - const UnitCell& ucell) { - ModuleBase::TITLE("Grid_Techinique", "init_atoms_on_grid2"); - - if (total_atoms_on_grid == 0) { - ModuleBase::WARNING("Grid_Technique::init_atoms_on_grid2", - "no atom on this sub FFT grid."); - return; - } - - std::vector index2ucell = std::vector(this->nxyze, 0); - ModuleBase::Memory::record("GT::index2ucell", sizeof(int) * this->nxyze); - this->grid_expansion_index(false, index2ucell.data()); - - std::vector ind_bigcell = std::vector(nbxyz, 0); - ModuleBase::Memory::record("GT::ind_bigcell", sizeof(int) * nbxyz); - std::vector bigcell_on_processor = std::vector(nbxyz, 0); - this->check_bigcell(ind_bigcell.data(), bigcell_on_processor.data()); - - //-------------------------------------- - // save which atom is in the bigcell,unitcell - //-------------------------------------- - assert(total_atoms_on_grid != 0); - this->which_atom = std::vector(total_atoms_on_grid, 0); - ModuleBase::Memory::record("GT::which_atom", - sizeof(int) * total_atoms_on_grid); - - this->which_bigcell = std::vector(total_atoms_on_grid, 0); - ModuleBase::Memory::record("GT::which_bigcell", - sizeof(int) * total_atoms_on_grid); - - this->which_unitcell = std::vector(total_atoms_on_grid, 0); - ModuleBase::Memory::record("GT::which_unitcell", - sizeof(int) * total_atoms_on_grid); - - // for each atom, first we need to locate which cell - // the atom is in, then we search meshball aroung this - // grid, and record each grid's atom position. - int count = 0; - this->how_many_atoms = std::vector(nbxx, 0); - ModuleBase::Memory::record("GT::how many atoms", sizeof(int) * nbxx); - std::vector coord_x(total_atoms_on_grid* bxyz, 0.0); - std::vector coords3(bxyz * 3, 0.0); - for(int iat = 0; iat < ucell.nat; iat++) - { - const int it = ucell.iat2it[iat]; - const double rcut_square = this->rcuts[it] * this->rcuts[it]; - // zero bigcell of meshball indicate ? - for (int im = 0; im < this->meshball_ncells; im++) - { - const int extgrid = this->index_atom[iat] + this->index_ball[im]; - const int normal = index2normal[extgrid]; - - // mohan add 2010-07-01 - const int bcell_idx_on_proc = ind_bigcell[normal]; - if (!bigcell_on_processor[normal]) - { - continue; - } - - bool is_atom_on_bcell = false; - const double dr_x_part = this->meshball_positions[im][0] - this->tau_in_bigcell[iat][0]; - const double dr_y_part = this->meshball_positions[im][1] - this->tau_in_bigcell[iat][1]; - const double dr_z_part = this->meshball_positions[im][2] - this->tau_in_bigcell[iat][2]; - for(int imcell = 0; imcell < this -> bxyz; imcell++) - { - const double dr_x = this->meshcell_pos[imcell][0] + dr_x_part; - const double dr_y = this->meshcell_pos[imcell][1] + dr_y_part; - const double dr_z = this->meshcell_pos[imcell][2] + dr_z_part; - const double dist_square = dr_x * dr_x + dr_y * dr_y + dr_z * dr_z; - if(dist_square <= rcut_square) - { - is_atom_on_bcell = true; - break; - } - } - - if(is_atom_on_bcell) - { - // it's not the normal order to calculate which_atom - // and which_bigcell, especailly in 1D array. - // Each grid's adjacent atom number is different, - // so, first we need to locate which grid, using - // bcell_start, then we need to count which adjacent atom. - // using how_many_atoms. - const int index = this->bcell_start[bcell_idx_on_proc] + this->how_many_atoms[bcell_idx_on_proc]; - - // we save which_atom and which_bigcell in 1D array, - // once you want to use this in grid integration, - // the only information you got is the 'normal' index, - // so you need to use bcell_start - // to get the 'mesh_index', then you can you this mesh_index - // to use which_atom or which_bigcell. - this->which_atom[index] = iat; - this->which_bigcell[index] = im; - this->which_unitcell[index] = index2ucell[extgrid]; - for(int imcell = 0; imcell < this -> bxyz; imcell++) - { - const double dr_x = this->meshcell_pos[imcell][0] + dr_x_part; - coord_x[index * bxyz + imcell] = dr_x; - } - - ++count; - ++how_many_atoms[bcell_idx_on_proc]; - } - } - } - for(int i = 0; i < this->bxyz; i++) - { - for(int j = 0; j < 3; j++) - { - coords3[i * 3 + j] = this->meshcell_pos[i][j]; - } - } - assert(count == total_atoms_on_grid); - return; -} - -void Grid_Technique::cal_grid_integration_index() { - // save the start - this->bcell_start = std::vector(nbxx, 0); - ModuleBase::Memory::record("GT::bcell_start", sizeof(int) * nbxx); - for (int i = 1; i < nbxx; i++) { - this->bcell_start[i] - = this->bcell_start[i - 1] + this->how_many_atoms[i - 1]; - } - - // calculate which grid has the largest number of atoms, - // and how many atoms. - this->max_atom = 0; - for (int i = 0; i < nbxx; i++) { - this->max_atom = std::max(this->max_atom, this->how_many_atoms[i]); - } - -#ifdef __MPI - int* all = new int[GlobalV::NPROC]; - ModuleBase::GlobalFunc::ZEROS(all, GlobalV::NPROC); - Parallel_Reduce::gather_int_all(max_atom, all); - if (GlobalV::MY_RANK == 0) { - GlobalV::ofs_warning << std::setw(15) << "Processor" << std::setw(15) - << "Atom" << std::endl; - for (int i = 0; i < GlobalV::NPROC; i++) { - GlobalV::ofs_warning << std::setw(15) << i + 1 << std::setw(15) - << all[i] << std::endl; - } - } - delete[] all; -#endif - - if (PARAM.inp.test_gridt) { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, - "Max atom on bigcell", - max_atom); - } - return; -} - -// set 'lgd' variable -void Grid_Technique::cal_trace_lo(const UnitCell& ucell) { - ModuleBase::TITLE("Grid_Technique", "cal_trace_lo"); - // save the atom information in trace_lo, - // in fact the trace_lo dimension can be reduced - // to ucell.nat, but I think this is another way. - this->trace_lo = std::vector(PARAM.globalv.nlocal, -1); - ModuleBase::Memory::record("GT::trace_lo", sizeof(int) * PARAM.globalv.nlocal); - - this->lnat = 0; - this->lgd = 0; - int iat = 0; - int iw_all = 0; - int iw_local = 0; - - for (int it = 0; it < ucell.ntype; it++) { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) { - if (this->in_this_processor[iat]) { - ++lnat; - int nw0 = ucell.atoms[it].nw; - if (PARAM.inp.nspin - == 4) { // added by zhengdy-soc, need to be double in soc - nw0 *= 2; - this->lgd += nw0; - } else { - this->lgd += ucell.atoms[it].nw; - } - - for (int iw = 0; iw < nw0; iw++) { - this->trace_lo[iw_all] = iw_local; - ++iw_local; - ++iw_all; - } - } else { - // global index of atomic orbitals - iw_all += ucell.atoms[it].nw; - if (PARAM.inp.nspin == 4) { - iw_all += ucell.atoms[it].nw; -} - } - ++iat; - } - } - - if (PARAM.inp.out_level != "m") { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, - "Atom number in sub-FFT-grid", - lnat); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, - "Local orbitals number in sub-FFT-grid", - lgd); - } - - assert(iw_local == lgd); - assert(iw_all == PARAM.globalv.nlocal); - return; -} - -void Grid_Technique::init_ijr_and_nnrg(const UnitCell& ucell, const Grid_Driver& gd) -{ - ModuleBase::TITLE("Grid_Technique", "init_ijr_and_nnrg"); - - hamilt::HContainer hRGint_tmp(ucell.nat); - // prepare the row_index and col_index for construct AtomPairs, they are - // same, name as orb_index - std::vector orb_index(ucell.nat + 1); - orb_index[0] = 0; - for (int i = 1; i < orb_index.size(); i++) { - int type = ucell.iat2it[i - 1]; - orb_index[i] = orb_index[i - 1] + ucell.atoms[type].nw; - } - - for (int T1 = 0; T1 < ucell.ntype; ++T1) { - const Atom* atom1 = &(ucell.atoms[T1]); - for (int I1 = 0; I1 < atom1->na; ++I1) { - auto& tau1 = atom1->tau[I1]; - - gd.Find_atom(ucell, tau1, T1, I1); - - const int iat1 = ucell.itia2iat(T1, I1); - // whether this atom is in this processor. - if (this->in_this_processor[iat1]) { - for (int ad = 0; ad < gd.getAdjacentNum() + 1; ++ad) { - const int T2 = gd.getType(ad); - const int I2 = gd.getNatom(ad); - const int iat2 = ucell.itia2iat(T2, I2); - const Atom* atom2 = &(ucell.atoms[T2]); - - // NOTE: hRGint wil save total number of atom pairs, - // if only upper triangle is saved, the lower triangle will - // be lost in 2D-block parallelization. if the adjacent atom - // is in this processor. - if (this->in_this_processor[iat2]) { - ModuleBase::Vector3 dtau - = gd.getAdjacentTau(ad) - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut - = this->rcuts[T1] + this->rcuts[T2]; - - // if(distance < rcut) - // mohan reset this 2013-07-02 in Princeton - // we should make absolutely sure that the distance is - // smaller than rcuts[it] this should be consistant - // with LCAO_nnr::cal_nnrg function typical example : 7 - // Bohr cutoff Si orbital in 14 Bohr length of cell. - // distance = 7.0000000000000000 - // rcuts[it] = 7.0000000000000008 - if (distance < rcut - 1.0e-15) { - // calculate R index - auto& R_index = gd.getBox(ad); - // insert this atom-pair into this->hRGint - hamilt::AtomPair tmp_atom_pair( - iat1, - iat2, - R_index.x, - R_index.y, - R_index.z, - orb_index.data(), - orb_index.data(), - ucell.nat); - hRGint_tmp.insert_pair(tmp_atom_pair); - } - } - } - } - } - } - this->ijr_info = hRGint_tmp.get_ijr_info(); - this->nnrg = hRGint_tmp.get_nnr(); - return; -} - -#if ((defined __CUDA) /* || (defined __ROCM) */) - -void Grid_Technique::init_gpu_gint_variables(const UnitCell& ucell, - const int num_stream) { -#ifdef __MPI - dev_id = base_device::information::set_device_by_rank(); -#endif - if (is_malloced) { - free_gpu_gint_variables(this->nat); - } - nstreams = num_stream; - double ylmcoef[100]; - ModuleBase::GlobalFunc::ZEROS(ylmcoef, 100); - for (int i = 0; i < 100; i++) { - ylmcoef[i] = ModuleBase::Ylm::ylmcoef[i]; - } - checkCudaErrors(cudaMalloc((void**)&ylmcoef_g, 100 * sizeof(double))); - checkCudaErrors(cudaMemcpy(ylmcoef_g, - ylmcoef, - 100 * sizeof(double), - cudaMemcpyHostToDevice)); - - double max_cut = *std::max_element(this->rcuts.begin(), this->rcuts.end()); - - int atom_nw_now[ucell.ntype]; - int ucell_atom_nwl_now[ucell.ntype]; - for (int i = 0; i < ucell.ntype; i++) { - atom_nw_now[i] = ucell.atoms[i].nw; - ucell_atom_nwl_now[i] = ucell.atoms[i].nwl; - } - - // double psi_u_now[ucell.ntype * ucell.nwmax * nr_max * - // 2]; - double* psi_u_now = (double*)malloc(ucell.ntype * ucell.nwmax * this->nr_max * 2 * sizeof(double)); - memset(psi_u_now, 0, ucell.ntype * ucell.nwmax * this->nr_max * 2 * sizeof(double)); - bool* atom_iw2_new_now = (bool*)malloc(ucell.ntype * ucell.nwmax * sizeof(bool)); - memset(atom_iw2_new_now, 0, ucell.ntype * ucell.nwmax * sizeof(bool)); - int* atom_iw2_ylm_now - = (int*)malloc(ucell.ntype * ucell.nwmax * sizeof(int)); - memset(atom_iw2_ylm_now, 0, ucell.ntype * ucell.nwmax * sizeof(int)); - int* atom_iw2_l_now = (int*)malloc(ucell.ntype * ucell.nwmax * sizeof(int)); - memset(atom_iw2_l_now, 0, ucell.ntype * ucell.nwmax * sizeof(int)); - - Atom* atomx; - for (int i = 0; i < ucell.ntype; i++) { - atomx = &ucell.atoms[i]; - for (int j = 0; j < ucell.nwmax; j++) { - if (j < atomx->nw) { - atom_iw2_new_now[i * ucell.nwmax + j] = atomx->iw2_new[j]; - atom_iw2_ylm_now[i * ucell.nwmax + j] = atomx->iw2_ylm[j]; - atom_iw2_l_now[i * ucell.nwmax + j] = atomx->iw2l[j]; - for (int k = 0; k < this->nr_max; k++) { - int index_temp = (i * ucell.nwmax * this->nr_max - + j * this->nr_max + k) - * 2; - if (k < this->psi_u[i * this->nwmax + j].size()) { - psi_u_now[index_temp] - = this->psi_u[i * this->nwmax + j].data()[k]; - psi_u_now[index_temp + 1] - = this->dpsi_u[i * this->nwmax + j].data()[k]; - } - } - } - } - } - - checkCudaErrors(cudaMalloc((void**)&atom_nw_g, ucell.ntype * sizeof(int))); - checkCudaErrors(cudaMemcpy(atom_nw_g, - atom_nw_now, - ucell.ntype * sizeof(int), - cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&atom_nwl_g, ucell.ntype * sizeof(int))); - checkCudaErrors(cudaMemcpy(atom_nwl_g, ucell_atom_nwl_now, ucell.ntype * sizeof(int), cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&psi_u_g, ucell.ntype * ucell.nwmax * this->nr_max * sizeof(double) * 2)); - checkCudaErrors(cudaMemcpy(psi_u_g, - psi_u_now, - ucell.ntype * ucell.nwmax * this->nr_max * sizeof(double) * 2, - cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&psi_u_g, - ucell.ntype * ucell.nwmax * nr_max * sizeof(double) * 2)); - checkCudaErrors(cudaMemcpy(psi_u_g, - psi_u_now, - ucell.ntype * ucell.nwmax * nr_max * sizeof(double) * 2, - cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&atom_new_g, - ucell.ntype * ucell.nwmax * sizeof(bool))); - checkCudaErrors(cudaMemcpy(atom_new_g, - atom_iw2_new_now, - ucell.ntype * ucell.nwmax * sizeof(bool), - cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&atom_ylm_g, - ucell.ntype * ucell.nwmax * sizeof(int))); - - checkCudaErrors(cudaMemcpy(atom_ylm_g, - atom_iw2_ylm_now, - ucell.ntype * ucell.nwmax * sizeof(int), - cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&atom_l_g, - ucell.ntype * ucell.nwmax * sizeof(int))); - checkCudaErrors(cudaMemcpy(atom_l_g, - atom_iw2_l_now, - ucell.ntype * ucell.nwmax * sizeof(int), - cudaMemcpyHostToDevice)); - - checkCudaErrors(cudaMalloc((void**)&rcut_g, ucell.ntype * sizeof(double))); - checkCudaErrors(cudaMemcpy(rcut_g, - rcuts.data(), - ucell.ntype * sizeof(double), - cudaMemcpyHostToDevice)); - std::vector mcell_pos(bxyz * 3, 0); - for (int i = 0; i < bxyz; i++) - { - mcell_pos[3 * i] = meshcell_pos[i][0]; - mcell_pos[3 * i + 1] = meshcell_pos[i][1]; - mcell_pos[3 * i + 2] = meshcell_pos[i][2]; - } - checkCudaErrors(cudaMalloc((void**)&mcell_pos_g, - bxyz * 3 * sizeof(double))); - checkCudaErrors(cudaMemcpy(mcell_pos_g, - mcell_pos.data(), - bxyz * 3 * sizeof(double), - cudaMemcpyHostToDevice)); - - gemm_algo_selector(bxyz, fastest_matrix_mul, ucell); - - is_malloced = true; - - free(psi_u_now); - free(atom_iw2_new_now); - free(atom_iw2_ylm_now); -} - -void Grid_Technique::free_gpu_gint_variables(int nat) { - if (!is_malloced) { - return; - } - - checkCudaErrors(cudaFree(ylmcoef_g)); - checkCudaErrors(cudaFree(atom_nwl_g)); - checkCudaErrors(cudaFree(psi_u_g)); - checkCudaErrors(cudaFree(atom_new_g)); - checkCudaErrors(cudaFree(atom_ylm_g)); - checkCudaErrors(cudaFree(atom_nw_g)); - checkCudaErrors(cudaFree(atom_l_g)); - checkCudaErrors(cudaFree(rcut_g)); - checkCudaErrors(cudaFree(mcell_pos_g)); - - is_malloced = false; -} -#endif diff --git a/source/module_hamilt_lcao/module_gint/grid_technique.h b/source/module_hamilt_lcao/module_gint/grid_technique.h deleted file mode 100644 index 026be1f411..0000000000 --- a/source/module_hamilt_lcao/module_gint/grid_technique.h +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef GRID_TECHNIQUE_H -#define GRID_TECHNIQUE_H - -#include "grid_meshball.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#if ((defined __CUDA) /* || (defined __ROCM) */) -#include "kernels/cuda/gemm_selector.cuh" - -#include -#endif - -// Author: mohan -// Date: 2009-10-17 -class Grid_Technique : public Grid_MeshBall { - // public variables. - public: - Grid_Technique(); - ~Grid_Technique(); - - /// move operator for the next ESolver to directly use its infomation - Grid_Technique& operator=(Grid_Technique&& rhs) = default; - //------------------------------------ - // 1: Info about atom number on grid. - //------------------------------------ - // record how many atoms on each grid. - std::vector how_many_atoms; - // max atom on grid - int max_atom=0; - // sum of how_many_atoms - int total_atoms_on_grid=0; - std::vector start_ind; - - //------------------------------------ - // 2: Info about which atom on grid. - //------------------------------------ - // save the start position of each big cell's adjacent - // atoms in 1D grid. - std::vector bcell_start; - // save the 'iat' atom. - // dim: total_atoms_on_grid. - std::vector which_atom; - - //-------------------------------------- - // save the bigcell index in meshball. - // dim: total_atoms_on_grid. - //-------------------------------------- - std::vector which_bigcell; - std::vector which_unitcell; - - //------------------------------------ - // 3: which atom on local grid. - //------------------------------------ - int lnat=0; // local nat. - int lgd=0; // local grid dimension. lgd * lgd symmetry matrix. - std::vector in_this_processor; - std::vector trace_iat; - std::vector trace_lo; // trace local orbital. - - //--------------------------------------- - // nnrg: number of matrix elements on - // each processor's real space grid. - // use: GridT.in_this_processor - //--------------------------------------- - int nnrg = 0; - - // UnitCell and LCAO_Obrbitals - const UnitCell* ucell=nullptr; - const LCAO_Orbitals* orb=nullptr; - - // UnitCell parameters - int nwmax=0; - int nr_max=0; - int ntype=0; - - // LCAO Orbitals - double dr_uniform={0.0}; - std::vector rcuts; - std::vector> psi_u; - std::vector> dpsi_u; - std::vector> d2psi_u; - - // Determine whether the grid point integration is initialized. - bool init_malloced=false; - - bool get_init_malloced() const { return init_malloced; } - - void set_pbc_grid(const int& ncx_in, - const int& ncy_in, - const int& ncz_in, - const int& bx_in, - const int& by_in, - const int& bz_in, - const int& nbx_in, - const int& nby_in, - const int& nbz_in, - const int& nbxx_in, - const int& nbzp_start_in, - const int& nbzp_in, - const int& ny, - const int& nplane, - const int& startz_current, - const UnitCell& ucell, - const Grid_Driver& gd, - const double& dr_uniform, - const std::vector& rcuts, - const std::vector>& psi_u, - const std::vector>& dpsi_u, - const std::vector>& d2psi_u, - const int& num_stream); - - const std::vector* get_ijr_info() const { return &ijr_info; } - - /// number of elements(basis-pairs) in this processon - /// on all adjacent atoms-pairs(Grid division) - int cal_RindexAtom(const int& u1, - const int& u2, - const int& u3, - const int& iat2) const; - - int find_offset(const int id1, const int id2, const int iat1, const int iat2) const; - - private: - - // store the information of atom pairs on this processor, used to initialize hcontainer. - // The meaning of ijr can be referred to in the get_ijr_info function in hcontainer.cpp. - std::vector ijr_info; - - void cal_max_box_index(); - // atoms on meshball - void init_atoms_on_grid(const int& ny, - const int& nplane, - const UnitCell& ucell); - void init_atoms_on_grid2(const int* index2normal, const UnitCell& ucell); - // initialize the ijr_info and nnrg - void init_ijr_and_nnrg(const UnitCell& ucell, const Grid_Driver& gd); - void cal_grid_integration_index(); - void cal_trace_lo(const UnitCell& ucell); - void check_bigcell(int* ind_bigcell, char* bigcell_on_processor); - void get_startind(const int& ny, - const int& nplane); - -#if ((defined __CUDA) /* || (defined __ROCM) */) - public: - double* ylmcoef_g; - bool is_malloced; - - int* atom_nw_g; - int* atom_nwl_g; - double* psi_u_g; - bool* atom_new_g; - int* atom_ylm_g; - int* atom_l_g; - double* rcut_g; - double*mcell_pos_g; - - int dev_id = 0; - int nstreams = 4; - // streams[nstreams] - // TODO it needs to be implemented through configuration files - matrix_multiple_func_type fastest_matrix_mul; - - private: - void init_gpu_gint_variables(const UnitCell& ucell, const int num_stream); - void free_gpu_gint_variables(int nat); - -#endif -}; -#endif diff --git a/source/module_hamilt_lcao/module_gint/gtask_force.cpp b/source/module_hamilt_lcao/module_gint/gtask_force.cpp deleted file mode 100644 index 66efb96f6d..0000000000 --- a/source/module_hamilt_lcao/module_gint/gtask_force.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include - -#include "gint_force_gpu.h" -#include "source_base/ylm.h" -#include "module_hamilt_lcao/module_gint/gint_tools.h" -#include "source_base/vector3.h" -namespace GintKernel -{ - -void gtask_force(const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int nczp, - const double vfactor, - const double* vlocal_global_value, - int& atoms_per_z, - int* atoms_num_info, - int* iat_on_nbz, - uint8_t* atoms_type, - double* dr_part, - double* vldr3) -{ - atoms_per_z = 0; - for (int z_index = 0; z_index < gridt.nbzp; z_index++) - { - const int grid_index = grid_index_ij + z_index; - const int bcell_start_index = gridt.bcell_start[grid_index]; - const int na_grid = gridt.how_many_atoms[grid_index]; - atoms_num_info[z_index * 2] = na_grid; - atoms_num_info[z_index * 2 + 1] = atoms_per_z; - for (int id = 0; id < na_grid; id++) - { - const int mcell_index = bcell_start_index + id; - const int imcell = gridt.which_bigcell[mcell_index]; - const int iat = gridt.which_atom[mcell_index]; - const int it_temp = ucell.iat2it[iat]; - - dr_part[atoms_per_z * 3] = gridt.meshball_positions[imcell][0] - - gridt.tau_in_bigcell[iat][0]; - dr_part[atoms_per_z * 3 + 1] = gridt.meshball_positions[imcell][1] - - gridt.tau_in_bigcell[iat][1]; - dr_part[atoms_per_z * 3 + 2] = gridt.meshball_positions[imcell][2] - - gridt.tau_in_bigcell[iat][2]; - atoms_type[atoms_per_z] = it_temp; - iat_on_nbz[atoms_per_z] = iat; - atoms_per_z++; - } - - const int start_ind_grid = gridt.start_ind[grid_index]; - int id = z_index * gridt.bxyz; - for (int bx_index = 0; bx_index < gridt.bx; bx_index++) - { - for (int by_index = 0; by_index < gridt.by; by_index++) - { - for (int bz_index = 0; bz_index < gridt.bz; bz_index++) - { - int vindex_global = bx_index * gridt.ncy * nczp - + by_index * nczp + bz_index - + start_ind_grid; - vldr3[id]= vlocal_global_value[vindex_global] * vfactor; - id++; - } - } - } - } -} - -void alloc_mult_force(const hamilt::HContainer* dm, - const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int max_atom, - const int *atoms_num_info, - double* const psi_g, - double* const psi_dm_g, - double* const dm_matrix_g, - int& max_m, - int& max_n, - int& atom_pair_num, - int* mat_m, - int* mat_n, - int* mat_k, - int* mat_lda, - int* mat_ldb, - int* mat_ldc, - double** mat_A, - double** mat_B, - double** mat_C) -{ - int tid = 0; - max_m = 0; - max_n = 0; - const int nwmax = ucell.nwmax; - const int lgd = gridt.lgd; - for (int z_index = 0; z_index < gridt.nbzp; z_index++) - { - const int grid_index = grid_index_ij + z_index; - const int bcell_start_index = gridt.bcell_start[grid_index]; - const int pre_atoms = atoms_num_info[z_index * 2 + 1]; - - for (int atom1 = 0; atom1 < gridt.how_many_atoms[grid_index]; atom1++) - { - const int mcell_index1 = bcell_start_index + atom1; - const int iat1 = gridt.which_atom[mcell_index1]; - const int uc1 = gridt.which_unitcell[mcell_index1]; - const ModuleBase::Vector3 r1 = gridt.get_ucell_coords(uc1); - const int it1 = ucell.iat2it[iat1]; - const int nw1 = ucell.atoms[it1].nw; - - for (int atom2 = 0; atom2 < gridt.how_many_atoms[grid_index];atom2++) - { - const int mcell_index2 = bcell_start_index + atom2; - const int iat2 = gridt.which_atom[mcell_index2]; - const int uc2 = gridt.which_unitcell[mcell_index2]; - const ModuleBase::Vector3 r2 = gridt.get_ucell_coords(uc2); - const int offset = dm->find_matrix_offset(iat1, iat2, r1-r2); - if (offset == -1) - { - continue; - } - const int it2 = ucell.iat2it[iat2]; - const int nw2 = ucell.atoms[it2].nw; - - const int mat_A_idx = (pre_atoms + atom2) * nwmax * gridt.bxyz; - const int mat_C_idx = (pre_atoms + atom1) * nwmax * gridt.bxyz; - mat_m[tid] = gridt.bxyz; - mat_n[tid] = nw1; - mat_k[tid] = nw2; - mat_lda[tid] = nwmax; - mat_ldb[tid] = nw2; - mat_ldc[tid] = nwmax; - mat_A[tid] = psi_g + mat_A_idx; - mat_B[tid] = dm_matrix_g + offset; - mat_C[tid] = psi_dm_g + mat_C_idx; - - if (mat_m[tid] > max_m) - { - max_m = mat_m[tid]; - } - - if (mat_n[tid] > max_n) - { - max_n = mat_n[tid]; - } - - tid++; - } - } - } - atom_pair_num = tid; -} -} // namespace GintKernel diff --git a/source/module_hamilt_lcao/module_gint/gtask_rho.cpp b/source/module_hamilt_lcao/module_gint/gtask_rho.cpp deleted file mode 100644 index 917fc2bc25..0000000000 --- a/source/module_hamilt_lcao/module_gint/gtask_rho.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include "gint_rho_gpu.h" -#include "source_base/ylm.h" -#include "module_hamilt_lcao/module_gint/gint_tools.h" -#include "source_base/vector3.h" -#include "omp.h" -namespace GintKernel -{ - -void gtask_rho(const Grid_Technique& gridt, - const int grid_index_ij, - const UnitCell& ucell, - double* dr_part, - uint8_t* atoms_type, - int* atoms_num_info, - int& atoms_per_z) -{ - atoms_per_z = 0; - for (int z_index = 0; z_index < gridt.nbzp; z_index++) - { - const int grid_index = grid_index_ij + z_index; - const int bcell_start_index = gridt.bcell_start[grid_index]; - const int na_grid = gridt.how_many_atoms[grid_index]; - atoms_num_info[2 * z_index] = na_grid; - atoms_num_info[2 * z_index + 1] = atoms_per_z; - for (int id = 0; id < na_grid; id++) - { - const int mcell_index = bcell_start_index + id; - const int imcell = gridt.which_bigcell[mcell_index]; - const int iat = gridt.which_atom[mcell_index]; - const int it_temp = ucell.iat2it[iat]; - - dr_part[atoms_per_z * 3] = gridt.meshball_positions[imcell][0] - - gridt.tau_in_bigcell[iat][0]; - dr_part[atoms_per_z * 3 + 1] = gridt.meshball_positions[imcell][1] - - gridt.tau_in_bigcell[iat][1]; - dr_part[atoms_per_z * 3 + 2] = gridt.meshball_positions[imcell][2] - - gridt.tau_in_bigcell[iat][2]; - atoms_type[atoms_per_z] = it_temp; - atoms_per_z++; - } - } -} - -void alloc_mult_dot_rho(const hamilt::HContainer* dm, - const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int max_atom, - const int lgd, - const int nczp, - const int* atoms_num_info, - double* const psir_ylm_g, - double* const psir_dm_g, - double* const dm_matrix_g, - double* mat_alpha, - int* mat_m, - int* mat_n, - int* mat_k, - int* mat_lda, - int* mat_ldb, - int* mat_ldc, - double** mat_A, - double** mat_B, - double** mat_C, - int& max_m, - int& max_n, - int& atom_pair_num, - double* rho_g, - double** dot_product) -{ - int tid = 0; - int dot_count = 0; - max_m = 0; - max_n = 0; - const int nwmax=ucell.nwmax; - // generate matrix multiplication tasks - for (int z_index = 0; z_index < gridt.nbzp; z_index++) - { - const int grid_index = grid_index_ij + z_index; - const int bcell_start_index = gridt.bcell_start[grid_index]; - const int bcell_start_psir = atoms_num_info[2 * z_index + 1] * gridt.bxyz * nwmax; - const int na_grid = atoms_num_info[2 * z_index]; - - for (int atom1 = 0; atom1 < gridt.how_many_atoms[grid_index]; atom1++) - { - const int mcell_index1 = bcell_start_index + atom1; - const int iat1 = gridt.which_atom[mcell_index1]; - const int uc1 = gridt.which_unitcell[mcell_index1]; - const ModuleBase::Vector3 r1 = gridt.get_ucell_coords(uc1); - const int it1 = ucell.iat2it[iat1]; - const int nw1 = ucell.atoms[it1].nw; - - for (int atom2 = atom1; atom2 < gridt.how_many_atoms[grid_index]; - atom2++) - { - const int mcell_index2 = bcell_start_index + atom2; - const int iat2 = gridt.which_atom[mcell_index2]; - const int uc2 = gridt.which_unitcell[mcell_index2]; - const ModuleBase::Vector3 r2 = gridt.get_ucell_coords(uc2); - const int offset = dm->find_matrix_offset(iat1, iat2, r1-r2); - if (offset == -1) - { - continue; - } - const int it2 = ucell.iat2it[iat2]; - const int nw2 = ucell.atoms[it2].nw; - - const int mat_A_idx = bcell_start_psir + atom2 * nwmax; - const int mat_C_idx = bcell_start_psir + atom1 * nwmax; - - mat_alpha[tid] = atom2 == atom1 ? 1 : 2; - mat_m[tid] = gridt.bxyz; - mat_n[tid] = nw1; - mat_k[tid] = nw2; - mat_lda[tid] = nwmax * na_grid; - mat_ldb[tid] = nw2; - mat_ldc[tid] = nwmax * na_grid; - mat_A[tid] = psir_ylm_g + mat_A_idx; - mat_B[tid] = dm_matrix_g + offset; - mat_C[tid] = psir_dm_g + mat_C_idx; - - if (mat_m[tid] > max_m) - { - max_m = mat_m[tid]; - } - - if (mat_n[tid] > max_n) - { - max_n = mat_n[tid]; - } - - tid++; - } - } - - // generate vec dot product tasks - std::vector vindex(gridt.bxyz); - Gint_Tools::get_vindex(gridt.bxyz, - gridt.bx, - gridt.by, - gridt.bz, - nczp, - gridt.start_ind[grid_index], - gridt.ncy * nczp, - vindex.data()); - for (int i = 0; i < gridt.bxyz; i++) - { - dot_product[dot_count] = rho_g + vindex[i]; - dot_count++; - } - } - atom_pair_num = tid; -} - -} // namespace GintKernel \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/gtask_vl.cpp b/source/module_hamilt_lcao/module_gint/gtask_vl.cpp deleted file mode 100644 index 673e4635a7..0000000000 --- a/source/module_hamilt_lcao/module_gint/gtask_vl.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include - -#include "gint_vl_gpu.h" -#include "source_base/ylm.h" -#include "module_hamilt_lcao/module_gint/gint_tools.h" -#include "source_base/vector3.h" -namespace GintKernel -{ - -void gtask_vlocal(const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int nczp, - const double vfactor, - const double* vlocal_global_value, - int& atoms_per_z, - int* atoms_num_info, - uint8_t* atoms_type, - double* dr_part, - double* vldr3) -{ - atoms_per_z = 0; - for (int z_index = 0; z_index < gridt.nbzp; z_index++) - { - const int grid_index = grid_index_ij + z_index; - const int bcell_start_index = gridt.bcell_start[grid_index]; - const int na_grid = gridt.how_many_atoms[grid_index]; - atoms_num_info[2 * z_index] = na_grid; - atoms_num_info[2 * z_index + 1] = atoms_per_z; - for (int id = 0; id < na_grid; id++) - { - const int mcell_index = bcell_start_index + id; - const int imcell = gridt.which_bigcell[mcell_index]; - const int iat = gridt.which_atom[mcell_index]; - const int it_temp = ucell.iat2it[iat]; - - dr_part[atoms_per_z * 3] = gridt.meshball_positions[imcell][0] - - gridt.tau_in_bigcell[iat][0]; - dr_part[atoms_per_z * 3 + 1] = gridt.meshball_positions[imcell][1] - - gridt.tau_in_bigcell[iat][1]; - dr_part[atoms_per_z * 3 + 2] = gridt.meshball_positions[imcell][2] - - gridt.tau_in_bigcell[iat][2]; - atoms_type[atoms_per_z] = it_temp; - atoms_per_z++; - } - - const int start_ind_grid = gridt.start_ind[grid_index]; - int id = z_index * gridt.bxyz; - for (int bx_index = 0; bx_index < gridt.bx; bx_index++) - { - for (int by_index = 0; by_index < gridt.by; by_index++) - { - for (int bz_index = 0; bz_index < gridt.bz; bz_index++) - { - int vindex_global = bx_index * gridt.ncy * nczp - + by_index * nczp + bz_index - + start_ind_grid; - vldr3[id]= vlocal_global_value[vindex_global] * vfactor; - id++; - } - } - } - } -} - -void alloc_mult_vlocal(const hamilt::HContainer* hRGint, - const Grid_Technique& gridt, - const UnitCell& ucell, - const int grid_index_ij, - const int max_atom, - double* const psi, - double* const psi_vldr3, - double* const grid_vlocal_g, - int* mat_m, - int* mat_n, - int* mat_k, - int* mat_lda, - int* mat_ldb, - int* mat_ldc, - double** mat_A, - double** mat_B, - double** mat_C, - int& atom_pair_num, - int& max_m, - int& max_n) -{ - atom_pair_num = 0; - max_m = 0; - max_n = 0; - const int nwmax = ucell.nwmax; - for (int z_index = 0; z_index < gridt.nbzp; z_index++) - { - const int grid_index = grid_index_ij + z_index; - const int atom_num = gridt.how_many_atoms[grid_index]; - const int vldr3_index = z_index * max_atom * nwmax * gridt.bxyz; - const int bcell_start_index = gridt.bcell_start[grid_index]; - for (int atom1 = 0; atom1 < atom_num; atom1++) - { - const int iat1 = gridt.which_atom[bcell_start_index + atom1]; - const int uc1 = gridt.which_unitcell[bcell_start_index + atom1]; - const ModuleBase::Vector3 r1 = gridt.get_ucell_coords(uc1); - const int it1 = ucell.iat2it[iat1]; - - for (int atom2 = 0; atom2 < atom_num; atom2++) - { - const int iat2 = gridt.which_atom[bcell_start_index + atom2]; - const int uc2 = gridt.which_unitcell[bcell_start_index + atom2]; - const ModuleBase::Vector3 r2 = gridt.get_ucell_coords(uc2); - int offset = hRGint->find_matrix_offset(iat1, iat2, r1-r2); - if (offset == -1) - { - continue; - } - const int it2 = ucell.iat2it[iat2]; - - if (iat1 <= iat2) - { - const int atom_pair_nw - = ucell.atoms[it1].nw * ucell.atoms[it2].nw; - - const int calc_index1 = vldr3_index + atom1 * nwmax * gridt.bxyz; - const int calc_index2 = vldr3_index + atom2 * nwmax * gridt.bxyz; - - mat_A[atom_pair_num] - = psi + calc_index1; - mat_B[atom_pair_num] - = psi_vldr3 + calc_index2; - mat_C[atom_pair_num] - = grid_vlocal_g + offset; - - mat_lda[atom_pair_num] = gridt.bxyz; - mat_ldb[atom_pair_num] = gridt.bxyz; - mat_ldc[atom_pair_num] = ucell.atoms[it2].nw; - - mat_m[atom_pair_num] = ucell.atoms[it1].nw; - mat_n[atom_pair_num] = ucell.atoms[it2].nw; - mat_k[atom_pair_num] = gridt.bxyz; - - if (mat_m[atom_pair_num] > max_m) - { - max_m = mat_m[atom_pair_num]; - } - if (mat_n[atom_pair_num] > max_n) - { - max_n = mat_n[atom_pair_num]; - } - atom_pair_num++; - } - } - } - } -} - -} // namespace GintKernel \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/init_orb.cpp b/source/module_hamilt_lcao/module_gint/init_orb.cpp deleted file mode 100644 index 4ad04e08d6..0000000000 --- a/source/module_hamilt_lcao/module_gint/init_orb.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "gint_tools.h" -#include "source_base/memory.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/unitcell.h" - -namespace Gint_Tools{ - -void init_orb(double& dr_uniform, - std::vector& rcuts, - UnitCell& ucell, - const LCAO_Orbitals& orb, - std::vector>& psi_u, - std::vector>& dpsi_u, - std::vector>& d2psi_u) -{ - //! set the grid parameters - dr_uniform=orb.dr_uniform; - - assert(dr_uniform>0.0); - - const int nwmax=ucell.nwmax; - const int ntype=ucell.ntype; - - assert(nwmax>0); - assert(ntype>0); - - rcuts=std::vector(ntype); - ModuleBase::Memory::record("rcuts", sizeof(double)*ntype*3); - - for(int it=0; it(1/dr_uniform * max_cut) + 10; - psi_u=std::vector>(ntype * nwmax); - dpsi_u=std::vector>(ntype * nwmax); - d2psi_u=std::vector>(ntype * nwmax); - ModuleBase::Memory::record("psi_u", sizeof(double)*nwmax*ntype*3); - - Atom* atomx = nullptr; - const Numerical_Orbital_Lm* pointer = nullptr; - - for (int i = 0; i < ntype; i++) - { - atomx = &ucell.atoms[i]; - for (int j = 0; j < nwmax; j++) - { - const int k=i*nwmax+j; - if (j < atomx->nw) - { - pointer = &orb.Phi[i].PhiLN(atomx->iw2l[j],atomx->iw2n[j]); - psi_u[k]=pointer->psi_uniform; - dpsi_u[k]=pointer->dpsi_uniform; - d2psi_u[k]=pointer->ddpsi_uniform; - } - } - } -}// End of init_orb() - -}// End of Gint_Tools diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cpp b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cpp deleted file mode 100644 index 42e8c4f0c5..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cpp +++ /dev/null @@ -1,4426 +0,0 @@ -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); - -gemm_time_measure(max_m, - max_n, - d_m, - d_n, - d_k, - d_global_A_array, - d_global_lda, - d_global_B_array, - d_global_ldb, - d_global_C_array, - d_global_ldc, - batchCount, - temp_stream, - fastest_time, - fastest_algo, - cpu_result, - h_global_C, - d_global_C); diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cuh deleted file mode 100644 index a4b1a75916..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen.cuh +++ /dev/null @@ -1,473 +0,0 @@ -#ifndef CODE_GEN_CUH -#define CODE_GEN_CUH - -#include "gemm_selector.cuh" -#include - -extern template void gemm_time_measure(int, int, int*, int*, int*, double**, int*, double**, int*, double**, int*, int, cudaStream_t, float&, matrix_multiple_func_type&, double*, double*, double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -extern template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_00.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_00.cu deleted file mode 100644 index a07c411485..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_00.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int, int, int*, int*, int*, double**, int*, double**, int*, double**, int*, int, cudaStream_t, float&, matrix_multiple_func_type&, double*, double*, double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_01.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_01.cu deleted file mode 100644 index 9f725c23c6..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_01.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_02.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_02.cu deleted file mode 100644 index 090eab0709..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_02.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_03.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_03.cu deleted file mode 100644 index 046d0e5063..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_03.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_04.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_04.cu deleted file mode 100644 index f74209d829..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_04.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_05.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_05.cu deleted file mode 100644 index c9cb81bd7c..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_05.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_06.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_06.cu deleted file mode 100644 index f5fac39df2..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_06.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_07.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_07.cu deleted file mode 100644 index 971c6eb0c0..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_07.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_08.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_08.cu deleted file mode 100644 index 8643faae70..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_08.cu +++ /dev/null @@ -1,48 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_09.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_09.cu deleted file mode 100644 index 8cf333bf6f..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/code_gen_09.cu +++ /dev/null @@ -1,53 +0,0 @@ -#include "vbatch_matrix_mul.cuh" - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); - -template void gemm_time_measure(int,int,int*,int*,int*,double**,int*,double**,int*,double**,int*,int,cudaStream_t,float&,matrix_multiple_func_type&,double*,double*,double*); \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cu deleted file mode 100644 index c9bf122628..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cu +++ /dev/null @@ -1,292 +0,0 @@ -#include -#include -#include - -#include "cuda_tools.cuh" - -void dump_cuda_array_to_file(const double* cuda_array, - int width, - int hight, - const std::string& filename) -{ - double* h_data = new double[width * hight]; - cudaMemcpy(h_data, - cuda_array, - width * hight * sizeof(double), - cudaMemcpyDeviceToHost); - - std::ofstream outFile(filename); - if (!outFile.is_open()) - { - std::cerr << "Failed to open file for writing." << std::endl; - } - for (int j = 0; j < hight; ++j) - { - for (int i = 0; i < width; ++i) - { - outFile << "hight" << j << " width:" << i << " " - << h_data[j * width + i] << std::endl; - } - } - outFile.close(); - delete[] h_data; -} - -template -Cuda_Mem_Wrapper::Cuda_Mem_Wrapper() -{ - this->device_pointer = nullptr; - this->host_pointer = nullptr; - this->one_stream_size = 0; - this->one_stream_size_aligned = 0; - this->stream_number = 1; - this->total_size_aligned = 0; -} - -template -Cuda_Mem_Wrapper::Cuda_Mem_Wrapper(int one_stream_size_in, - int one_stream_size_aligned_in, - int stream_number_in, - bool malloc_host_in) -{ - this->stream_number = stream_number_in; - this->one_stream_size = one_stream_size_in; - this->one_stream_size_aligned = one_stream_size_aligned_in; - this->total_size_aligned - = this->one_stream_size_aligned * this->stream_number; - - checkCuda(cudaMalloc((void**)&this->device_pointer, - this->total_size_aligned * sizeof(T))); - checkCuda(cudaMemset(this->device_pointer, - 0, - this->total_size_aligned * sizeof(T))); - this->host_pointer = nullptr; - - if (malloc_host_in) - { - checkCuda(cudaMallocHost((void**)&this->host_pointer, - this->total_size_aligned * sizeof(T))); - memset(this->host_pointer, 0, this->total_size_aligned * sizeof(T)); - } -} - -template -Cuda_Mem_Wrapper::Cuda_Mem_Wrapper(int one_stream_size_in, - int stream_number_in, - bool malloc_host_in) - : Cuda_Mem_Wrapper(one_stream_size_in, - one_stream_size_in, - stream_number_in, - malloc_host_in) -{ -} - -template -Cuda_Mem_Wrapper::Cuda_Mem_Wrapper(Cuda_Mem_Wrapper&& other) noexcept -{ - this->device_pointer = other.device_pointer; - this->host_pointer = other.host_pointer; - this->one_stream_size = other.one_stream_size; - this->one_stream_size_aligned = other.one_stream_size_aligned; - this->stream_number = other.stream_number; - this->total_size_aligned = other.total_size_aligned; - - other.device_pointer = nullptr; - other.host_pointer = nullptr; - other.one_stream_size = 0; - other.one_stream_size_aligned = 0; - other.stream_number = 0; - other.total_size_aligned = 0; -} - -template -Cuda_Mem_Wrapper& Cuda_Mem_Wrapper::operator=(Cuda_Mem_Wrapper&& other) noexcept -{ - if (this != &other) - { - this->free_all(); - this->device_pointer = other.device_pointer; - this->host_pointer = other.host_pointer; - this->one_stream_size = other.one_stream_size; - this->one_stream_size_aligned = other.one_stream_size_aligned; - this->stream_number = other.stream_number; - this->total_size_aligned = other.total_size_aligned; - - other.device_pointer = nullptr; - other.host_pointer = nullptr; - other.one_stream_size = 0; - other.one_stream_size_aligned = 0; - other.stream_number = 0; - other.total_size_aligned = 0; - } - return *this; -} - -template -void Cuda_Mem_Wrapper::free_all() -{ - checkCuda(cudaFree(this->device_pointer)); - if (this->host_pointer != nullptr) - { - checkCuda(cudaFreeHost(this->host_pointer)); - } -} - -template -Cuda_Mem_Wrapper::~Cuda_Mem_Wrapper() -{ - this->free_all(); -} - -template -inline void Cuda_Mem_Wrapper::copy_host_to_device_sync(const int stream_id) -{ - if (this->host_pointer == nullptr || this->device_pointer == nullptr) - { - std::cerr << "host_pointer is nullptr, can not copy host to device" - << std::endl; - exit(1); - } - checkCuda(cudaMemcpy( - this->device_pointer + stream_id * this->one_stream_size_aligned, - this->host_pointer + stream_id * this->one_stream_size_aligned, - this->one_stream_size * sizeof(T), - cudaMemcpyHostToDevice)); -} - -template -inline void Cuda_Mem_Wrapper::copy_host_to_device_async(const cudaStream_t stream, - const int stream_id) -{ - if (this->host_pointer == nullptr || this->device_pointer == nullptr) - { - std::cerr << "host_pointer is nullptr, can not copy host to device" - << std::endl; - exit(1); - } - checkCuda(cudaMemcpyAsync( - this->device_pointer + stream_id * this->one_stream_size_aligned, - this->host_pointer + stream_id * this->one_stream_size_aligned, - this->one_stream_size * sizeof(T), - cudaMemcpyHostToDevice, - stream)); -} - -template -inline void Cuda_Mem_Wrapper::copy_host_to_device_async(const cudaStream_t stream, - const int stream_id, - const int size) -{ - if (this->host_pointer == nullptr || this->device_pointer == nullptr) - { - std::cerr << "host_pointer is nullptr, can not copy host to device" - << std::endl; - exit(1); - } - checkCuda(cudaMemcpyAsync( - this->device_pointer + stream_id * this->one_stream_size_aligned, - this->host_pointer + stream_id * this->one_stream_size_aligned, - size * sizeof(T), - cudaMemcpyHostToDevice, - stream)); -} - -template -inline void Cuda_Mem_Wrapper::copy_device_to_host_sync(const int stream_id) -{ - if (this->host_pointer == nullptr || this->device_pointer == nullptr) - { - std::cerr << "host_pointer is nullptr, can not copy device to host" - << std::endl; - exit(1); - } - checkCuda(cudaMemcpy( - this->host_pointer + stream_id * this->one_stream_size_aligned, - this->device_pointer + stream_id * this->one_stream_size_aligned, - this->one_stream_size * sizeof(T), - cudaMemcpyDeviceToHost)); -} - -template -inline void Cuda_Mem_Wrapper::copy_device_to_host_async(const cudaStream_t stream, - const int stream_id) -{ - if (this->host_pointer == nullptr || this->device_pointer == nullptr) - { - std::cerr << "host_pointer is nullptr, can not copy device to host" - << std::endl; - exit(1); - } - checkCuda(cudaMemcpyAsync( - this->host_pointer + stream_id * this->one_stream_size_aligned, - this->device_pointer + stream_id * this->one_stream_size_aligned, - this->one_stream_size * sizeof(T), - cudaMemcpyDeviceToHost, - stream)); -} - -template -inline void Cuda_Mem_Wrapper::copy_device_to_host_async(const cudaStream_t stream, - const int stream_id, - const int size) -{ - if (this->host_pointer == nullptr || this->device_pointer == nullptr) - { - std::cerr << "host_pointer is nullptr, can not copy device to host" - << std::endl; - exit(1); - } - checkCuda(cudaMemcpyAsync( - this->host_pointer + stream_id * this->one_stream_size_aligned, - this->device_pointer + stream_id * this->one_stream_size_aligned, - size * sizeof(T), - cudaMemcpyDeviceToHost, - stream)); -} - -template -inline void Cuda_Mem_Wrapper::memset_device_sync(const int stream_id, const int value) -{ - checkCuda(cudaMemset(this->device_pointer - + stream_id * this->one_stream_size_aligned, - value, - this->one_stream_size * sizeof(T))); -} - -template -inline void Cuda_Mem_Wrapper::memset_device_async(const cudaStream_t stream, - const int stream_id, - const int value) -{ - checkCuda(cudaMemsetAsync(this->device_pointer - + stream_id * this->one_stream_size_aligned, - value, - this->one_stream_size * sizeof(T), - stream)); -} - -template -inline void Cuda_Mem_Wrapper::memset_host(const int stream_id, const int value) -{ - memset(this->host_pointer + stream_id * this->one_stream_size_aligned, - value, - this->one_stream_size * sizeof(T)); -} - -template -inline T* Cuda_Mem_Wrapper::get_device_pointer(const int stream_id) -{ - return this->device_pointer + stream_id * this->one_stream_size_aligned; -} - -template -inline T* Cuda_Mem_Wrapper::get_host_pointer(const int stream_id) -{ - return this->host_pointer + stream_id * this->one_stream_size_aligned; -} -template class Cuda_Mem_Wrapper; -template class Cuda_Mem_Wrapper; -template class Cuda_Mem_Wrapper; -template class Cuda_Mem_Wrapper; -template class Cuda_Mem_Wrapper; - diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cuh deleted file mode 100644 index dab697df8c..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/cuda_tools.cuh +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef CUDA_TOOLS_CUH -#define CUDA_TOOLS_CUH -#include // for assert -#include -#include // for CUDA_VERSION -#include - -#include -#include -#include - -#define checkCuda(val) check((val), #val, __FILE__, __LINE__) -#define checkCudaLastError() __getLastCudaError(__FILE__, __LINE__) - -inline void check(cudaError_t result, char const *const func, const char *const file, - int const line) { - if (result) { - fprintf(stderr, "CUDA error at %s:%d code=%d(%s) \"%s\" \n", file, line, - static_cast(result), cudaGetErrorString(result), func); - exit(EXIT_FAILURE); - } -} - -inline void __getLastCudaError(const char *file, - const int line) -{ - cudaError_t err = cudaGetLastError(); - - if (cudaSuccess != err) { - fprintf(stderr, - "%s(%i) : getLastCudaError() CUDA error :" - " (%d) %s.\n", - file, line, static_cast(err), - cudaGetErrorString(err)); - exit(EXIT_FAILURE); - } -} - -static inline int ceildiv(int x, int y) -{ - return (x + y - 1) / y; -} - -void dump_cuda_array_to_file(const double* cuda_array, - int width, - int hight, - const std::string& filename); - -// inline int ceil_div(int a, int b) -// { -// return (a + b - 1) / b; -// } - -/* - * @brief: A simple wrapper for cudaMalloc and cudaFree, sync and async CUDA - * memory copy - * @param: T: the type of the data - * - * @note: - * Manual management of CUDA memory is a very delicate task; complex pointers - * and malloc/free operations make it easy for us to encounter memory bugs. The - * severity of the issues increases significantly when introducing multi-node, - * multi-GPU, and multi-stream parallelism. - * Debugging after encountering bugs is also very difficult, finding the leaking - * pointer from dozens of variables can be quite a headache. - * Therefore, considering that our use and management of memory have some - * homogeneity, we have abstracted these needs into the following encapsulations - * to reduce the cost of maintenance and development. The memory is allocated in - * the constructor and freed in the destructor. - * - * The following interface is primarily designed for the following requirements: - * 1. We need to split a large task into multiple subtasks to run on multiple - * streams across multiple GPUs on multiple nodes. - * 2. It is necessary to allocate memory of the same shape on both host and - * device. - * 3. Data copying between host and device sync or async is required. - */ - -template -class Cuda_Mem_Wrapper -{ - public: - - Cuda_Mem_Wrapper(); - Cuda_Mem_Wrapper(int one_stream_size, - int one_stream_size_aligned, - int stream_number = 1, - bool malloc_host = true); - Cuda_Mem_Wrapper(int one_stream_size, - int stream_number = 1, - bool malloc_host = true); - - Cuda_Mem_Wrapper(const Cuda_Mem_Wrapper& other) = delete; - Cuda_Mem_Wrapper& operator=(const Cuda_Mem_Wrapper& other) = delete; - Cuda_Mem_Wrapper(Cuda_Mem_Wrapper&& other) noexcept; - Cuda_Mem_Wrapper& operator=(Cuda_Mem_Wrapper&& other) noexcept; - - ~Cuda_Mem_Wrapper(); - void copy_host_to_device_sync(const int stream_id = 0); - void copy_host_to_device_async(const cudaStream_t stream, const int stream_id); - void copy_host_to_device_async(const cudaStream_t stream, const int stream_id, const int size); - void copy_device_to_host_sync(const int stream_id = 0); - void copy_device_to_host_async(const cudaStream_t stream, const int stream_id); - void copy_device_to_host_async(const cudaStream_t stream, const int stream_id, const int size); - void memset_device_sync(const int stream_id = 0, const int value = 0); - void memset_device_async(const cudaStream_t stream, - const int stream_id = 0, - const int value = 0); - void memset_host(const int stream_id = 0, const int value = 0); - T* get_device_pointer(const int stream_id = 0); - T* get_host_pointer(const int stream_id = 0); - void free_all(); - - private: - T* device_pointer; - T* host_pointer; - int one_stream_size; - int one_stream_size_aligned; - int stream_number; - int total_size_aligned; -}; - -#endif // CUDA_TOOLS_CUH \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cu deleted file mode 100644 index b8dda451f4..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cu +++ /dev/null @@ -1,138 +0,0 @@ -#include - -#include "gemm_selector.cuh" -#include "vbatch_matrix_mul.cuh" -#include "cuda_tools.cuh" -#include "source_base/blas_connector.h" -#include "code_gen.cuh" - -/* - * Here we have utilized a very straightforward and brute-force method to select - * the optimal matrix multiplication kernel for a given scale of computation: we - * compute with all scales of kernels under the current computational task to - * find the fastest parameter combination. This approach can lead to an increase - * in compilation time. - */ -void gemm_algo_selector(int matrix_k, matrix_multiple_func_type& fastest_algo,const UnitCell& ucell) -{ - int batchCount_per_type = 32; - int batchCount - = batchCount_per_type * ucell.ntype * ucell.ntype; - - Cuda_Mem_Wrapper m(batchCount); - Cuda_Mem_Wrapper n(batchCount); - Cuda_Mem_Wrapper k(batchCount); - - int max_m = ucell.nwmax, max_n = ucell.nwmax; - - Cuda_Mem_Wrapper A(batchCount * max_m * matrix_k); - Cuda_Mem_Wrapper B(batchCount * max_n * matrix_k); - Cuda_Mem_Wrapper C(batchCount * max_m * max_n); - - Cuda_Mem_Wrapper lda(batchCount); - Cuda_Mem_Wrapper ldb(batchCount); - Cuda_Mem_Wrapper ldc(batchCount); - - Cuda_Mem_Wrapper A_array(batchCount); - Cuda_Mem_Wrapper B_array(batchCount); - Cuda_Mem_Wrapper C_array(batchCount); - - for (int i = 0; i < batchCount * max_m * matrix_k; ++i) - { - A.get_host_pointer()[i] = i * 0.001; - } - for (int i = 0; i < batchCount * max_n * matrix_k; ++i) - { - B.get_host_pointer()[i] = i * 0.002; - } - - double* cpu_result = new double[batchCount * max_m * max_n]; - memset(cpu_result, 0, batchCount * max_m * max_n * sizeof(double)); - int index = 0; - for (int i = 0; i < batchCount_per_type; ++i) - { - for (int j = 0; j < ucell.ntype; j++) - { - for (int l = 0; l < ucell.ntype; l++) - { - m.get_host_pointer()[index] = ucell.atoms[j].nw; - n.get_host_pointer()[index] = ucell.atoms[l].nw; - k.get_host_pointer()[index] = matrix_k; - - lda.get_host_pointer()[index] = matrix_k; - ldb.get_host_pointer()[index] = matrix_k; - ldc.get_host_pointer()[index] = ucell.atoms[l].nw; - - A_array.get_host_pointer()[index] - = &A.get_device_pointer()[index * max_m * matrix_k]; - B_array.get_host_pointer()[index] - = &B.get_device_pointer()[index * max_n * matrix_k]; - C_array.get_host_pointer()[index] - = &C.get_device_pointer()[index * max_n - * max_m]; // test atom add - BlasConnector::gemm( - 'N', - 'T', - m.get_host_pointer()[index], - n.get_host_pointer()[index], - matrix_k, - 1.0, - &A.get_host_pointer()[index * max_m * matrix_k], - matrix_k, - &B.get_host_pointer()[index * max_n * matrix_k], - matrix_k, - 1.0, - &cpu_result[index * max_m * max_n], - n.get_host_pointer()[index]); - index++; - } - } - } - - m.copy_host_to_device_sync(); - n.copy_host_to_device_sync(); - k.copy_host_to_device_sync(); - - lda.copy_host_to_device_sync(); - ldb.copy_host_to_device_sync(); - ldc.copy_host_to_device_sync(); - - A.copy_host_to_device_sync(); - B.copy_host_to_device_sync(); - A_array.copy_host_to_device_sync(); - B_array.copy_host_to_device_sync(); - C_array.copy_host_to_device_sync(); - - cudaStream_t temp_stream; - checkCuda(cudaStreamCreate(&temp_stream)); - - float fastest_time = 1000000; - fastest_algo = vbatched_gemm_impl; - - int* d_m = m.get_device_pointer(); - int* d_n = n.get_device_pointer(); - int* d_k = k.get_device_pointer(); - - double** d_global_A_array = A_array.get_device_pointer(); - double** d_global_B_array = B_array.get_device_pointer(); - double** d_global_C_array = C_array.get_device_pointer(); - - double* h_global_C = C.get_host_pointer(); - double* d_global_C = C.get_device_pointer(); - - int* d_global_lda = lda.get_device_pointer(); - int* d_global_ldb = ldb.get_device_pointer(); - int* d_global_ldc = ldc.get_device_pointer(); - -/* - * Please do not manually modify the code in the following file; - * it should simply be generated through a loop using a short Python program. - */ -#include "code_gen.cpp" - checkCuda(cudaStreamDestroy(temp_stream)); - std::cout << " gemm_algo_selector::Fastest time: " << fastest_time << " ms" - << std::endl; - // fastest_algo = vbatched_gemm_impl; - delete[] cpu_result; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cuh deleted file mode 100644 index 744f3c887d..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cuh +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef GEMM_SELECTOR_H -#define GEMM_SELECTOR_H - -#include "cuda_runtime.h" -#include "source_cell/unitcell.h" -typedef std::function< - void(int, int, int*, int*, int*, double**, int*, double**, int*, double**, int*, int, cudaStream_t, double* alpha)> - matrix_multiple_func_type; - -void gemm_algo_selector(int k, matrix_multiple_func_type& func, const UnitCell& ucell); - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cu deleted file mode 100644 index 0199c9e37a..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cu +++ /dev/null @@ -1,225 +0,0 @@ -#include "sph.cuh" -#include "interp.cuh" -#include "gint_force.cuh" -#include "cuda_tools.cuh" -#include "source_base/module_device/device.h" -// CUDA kernel to calculate psi and force -namespace GintKernel -{ -__inline__ __device__ double warpReduceSum(double val) -{ - val += __shfl_xor_sync(0xffffffff, val, 16, 32); - val += __shfl_xor_sync(0xffffffff, val, 8, 32); - val += __shfl_xor_sync(0xffffffff, val, 4, 32); - val += __shfl_xor_sync(0xffffffff, val, 2, 32); - val += __shfl_xor_sync(0xffffffff, val, 1, 32); - return val; -} - - -__global__ void get_psi_force(double* ylmcoef, - double delta_r, - int bxyz, - const int nwmax, - const int max_atom, - const int* const ucell_atom_nwl, - const bool* const atom_iw2_new, - const int* const atom_iw2_ylm, - const int* const atom_iw2_l, - const int* const atom_nw, - const double* const rcut, - const int nr_max, - const double* const psi_u, - const double* const mcell_pos, - const double* const dr_part, - const double* const vldr3, - const uint8_t* const atoms_type, - const int* const atoms_num_info, - double* psi, - double* dpsi, - double* d2psi) -{ - const int bcell_id = blockIdx.x; - const int num_atoms = atoms_num_info[2 * bcell_id]; - const int pre_atoms = atoms_num_info[2 * bcell_id + 1]; - const int mcell_id = blockIdx.y; - const double vldr3_value = vldr3[bcell_id*bxyz + mcell_id]; - const double mcell_pos_x = mcell_pos[3 * mcell_id]; - const double mcell_pos_y = mcell_pos[3 * mcell_id + 1]; - const double mcell_pos_z = mcell_pos[3 * mcell_id + 2]; - - for(int atom_id = threadIdx.x; atom_id < num_atoms; atom_id += blockDim.x) - { - const int dr_start = 3 * (pre_atoms + atom_id); - const double dr_x = dr_part[dr_start] + mcell_pos_x; - const double dr_y = dr_part[dr_start + 1] + mcell_pos_y; - const double dr_z = dr_part[dr_start + 2] + mcell_pos_z; - double dist = sqrt(dr_x * dr_x + dr_y * dr_y + dr_z * dr_z); - const int atype = __ldg(atoms_type + pre_atoms + atom_id); - if(dist < rcut[atype]) - { - if (dist < 1.0E-9) - { - dist += 1.0E-9; - } - // dr is different from that in interp_rho and interp_vl - double dr[3] = {dr_x, dr_y, dr_z}; - double ylma[49]; - double grly[49][3]; - const int nwl = __ldg(ucell_atom_nwl + atype); - spherical_harmonics_d(dr, dist*dist, grly, nwl, ylma, ylmcoef); - int psi_idx = ((pre_atoms + atom_id) * bxyz + mcell_id) * nwmax; - interp_f(dist, - delta_r, - atype, - nwmax, - nr_max, - atom_nw, - atom_iw2_new, - psi_u, - ylma, - atom_iw2_l, - atom_iw2_ylm, - vldr3_value, - dr, - grly, - psi_idx, - psi, - dpsi, - d2psi); - } - } -} - - -__global__ void dot_product_stress(const double* d2psi, - const double* psi_dm, - const int size, - double* stress) -{ - __shared__ double cache[32 * 6]; - const int tid = threadIdx.x; - const int stride = blockDim.x * gridDim.x; - const int warp_id = tid / 32; - const int lane_id = tid % 32; - double tmp[6] = {0.0}; - for(int id = threadIdx.x + blockIdx.x * blockDim.x; id < size; id += stride) - { - const double psi_dm_2 = psi_dm[id] * 2; - const int id_stress = id * 6; - tmp[0] += d2psi[id_stress] * psi_dm_2; - tmp[1] += d2psi[id_stress + 1] * psi_dm_2; - tmp[2] += d2psi[id_stress + 2] * psi_dm_2; - tmp[3] += d2psi[id_stress + 3] * psi_dm_2; - tmp[4] += d2psi[id_stress + 4] * psi_dm_2; - tmp[5] += d2psi[id_stress + 5] * psi_dm_2; - } - - for(int i = 0; i<6; i++) - { - tmp[i] = warpReduceSum(tmp[i]); - } - - if (lane_id == 0) - { - for (int i = 0; i < 6; i++) - { - cache[warp_id * 6 + i] = tmp[i]; - } - } - __syncthreads(); - - for (int i = 0; i < 6; i++) - { - tmp[i] = (tid < blockDim.x / 32) ? cache[tid * 6 + i] : 0; - } - - if(warp_id == 0) - { - for (int i = 0; i < 6; i++) - { - tmp[i] = warpReduceSum(tmp[i]); - } - } - - if (tid == 0) - { - for (int i = 0; i < 6; i++) - { - atomicAdd(&stress[i], tmp[i]); // Use atomicAdd() instead of atomic_add(). - } - } -} - - -__global__ void dot_product_force(const int bxyz, - const int nwmax, - const int *atoms_num_info, - const int *iat_on_nbz, - const double* dpsi, - const double* psi_dm, - double* force) -{ - __shared__ double cache[32 * 3]; - const int tid = threadIdx.x; - const int bcell_id = blockIdx.x; - const int warp_id = tid / 32; - const int lane_id = tid % 32; - const int vec_size = bxyz * nwmax; - const int atom_num = atoms_num_info[2 * bcell_id]; - const int pre_atoms = atoms_num_info[2 * bcell_id + 1]; - - for(int k = 0; k < atom_num; k++) - { - const int atom_id = pre_atoms + k; - const int offset = atom_id * vec_size; - const int iat = iat_on_nbz[atom_id]; - double force_iat[3] = {0.0}; - - for(int i =tid; i < vec_size; i += blockDim.x) - { - int psi_offset = offset + i; - double psi_dm_2 = psi_dm[psi_offset] * 2; - force_iat[0] += dpsi[psi_offset * 3] * psi_dm_2; - force_iat[1] += dpsi[psi_offset * 3 + 1] * psi_dm_2; - force_iat[2] += dpsi[psi_offset * 3 + 2] * psi_dm_2; - } - - for (int i = 0; i < 3; i++) - { - force_iat[i] = warpReduceSum(force_iat[i]); - } - - if (lane_id == 0) - { - for (int i = 0; i < 3; i++) - { - cache[warp_id * 3 + i] = force_iat[i]; - } - } - __syncthreads(); - - for (int i = 0; i < 3; i++) - { - force_iat[i] = (tid < blockDim.x / 32) ? cache[tid * 3 + i] : 0; - } - - if (warp_id == 0) - { - for (int i = 0; i < 3; i++) - { - force_iat[i] = warpReduceSum(force_iat[i]); - } - } - - if (tid == 0) - { - for (int i = 0; i < 3; i++) - { - atomicAdd(&force[iat * 3 + i], force_iat[i]); - } - } - } -} - -} // namespace GintKernel diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cuh deleted file mode 100644 index 74b941f32a..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_force.cuh +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef GINT_FORCE_CUH -#define GINT_FORCE_CUH - -#include -#include -namespace GintKernel -{ - -__global__ void get_psi_force(double* ylmcoef, - double delta_r, - int bxyz, - const int nwmax, - const int max_atom, - const int* const ucell_atom_nwl, - const bool* const atom_iw2_new, - const int* const atom_iw2_ylm, - const int* const atom_iw2_l, - const int* const atom_nw, - const double* const rcut, - const int nr_max, - const double* const psi_u, - const double* const mcell_pos, - const double* const dr_part, - const double* const vldr3, - const uint8_t* const atoms_type, - const int* const atoms_num_info, - double* psi, - double* dpsi, - double* d2psi); - - -__global__ void dot_product_stress(const double* d2psi, - const double* psi_dm, - const int size, - double* stress); - -__global__ void dot_product_force(const int bxyz, - const int nwmax, - const int *atoms_num_info, - const int *iat_on_nbz, - const double* dpsi, - const double* psi_dm, - double* force); - -} // namespace GintKernel -#endif // GINT_VL_CUH diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cu deleted file mode 100644 index 6b4069c40b..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cu +++ /dev/null @@ -1,130 +0,0 @@ -#include "interp.cuh" -#include "gint_rho.cuh" -#include "sph.cuh" -#include "cuda_tools.cuh" - -namespace GintKernel -{ -__inline__ __device__ double warpReduceSum(double val) -{ - val += __shfl_xor_sync(0xffffffff, val, 16, 32); - val += __shfl_xor_sync(0xffffffff, val, 8, 32); - val += __shfl_xor_sync(0xffffffff, val, 4, 32); - val += __shfl_xor_sync(0xffffffff, val, 2, 32); - val += __shfl_xor_sync(0xffffffff, val, 1, 32); - return val; -} - - -/* - each block calculates the wavefunction on a meshcell, - and each thread loops over the atoms on a meshcell. -*/ -__global__ void get_psi(const double* const ylmcoef, - const double delta_r, - const int bxyz, - const int nwmax, - const int max_atom, - const int* const ucell_atom_nwl, - const bool* const atom_iw2_new, - const int* const atom_iw2_ylm, - const int* const atom_nw, - const double* const rcut, - const int nr_max, - const double* const psi_u, - const double* const mcell_pos, - const double* const dr_part, - const uint8_t* const atoms_type, - const int* const atoms_num_info, - double* psi) -{ - const int bcell_id = blockIdx.x; - const int num_atoms = atoms_num_info[2 * bcell_id]; - const int pre_atoms = atoms_num_info[2 * bcell_id + 1]; - const int mcell_id = blockIdx.y; - const double mcell_pos_x = mcell_pos[3 * mcell_id]; - const double mcell_pos_y = mcell_pos[3 * mcell_id + 1]; - const double mcell_pos_z = mcell_pos[3 * mcell_id + 2]; - - for(int atom_id = threadIdx.x; atom_id < num_atoms; atom_id += blockDim.x) - { - const int aid = pre_atoms + atom_id; - const double dr_x = dr_part[aid * 3] + mcell_pos_x; - const double dr_y = dr_part[aid * 3 + 1] + mcell_pos_y; - const double dr_z = dr_part[aid * 3 + 2] + mcell_pos_z; - double dist = sqrt(dr_x * dr_x + dr_y * dr_y + dr_z * dr_z); - const int atype = __ldg(atoms_type + aid); - if(dist < rcut[atype]) - { - if (dist < 1.0E-9) - { - dist += 1.0E-9; - } - double dr[3] = {dr_x / dist, dr_y / dist, dr_z / dist}; - double ylma[49]; - const int nwl = __ldg(ucell_atom_nwl + atype); - int psi_idx = (pre_atoms * bxyz + mcell_id * num_atoms + atom_id) * nwmax; - spherical_harmonics(dr, nwl, ylma, ylmcoef); - interp_rho(dist, - delta_r, - atype, - nwmax, - nr_max, - atom_nw, - atom_iw2_new, - psi_u, - ylma, - atom_iw2_ylm, - psi, - psi_idx); - } - } -} - -/* - Each block calculates the dot product on a meshcell, - and each thread loops over the wavefunction of atoms on a meshcell. -*/ -__global__ void psir_dot(const int bxyz, - const int nwmax, - const int* atoms_num_info, - const double* __restrict__ vec_a_g, - const double* __restrict__ vec_b_g, - double** results_g) -{ - __shared__ double s_data[32]; - const int tid = threadIdx.x; - const int bcell_id = blockIdx.x; - const int mcell_id = blockIdx.y; - const int vec_size = atoms_num_info[2 * bcell_id] * nwmax; - const int offset = atoms_num_info[2 * bcell_id + 1] * nwmax * bxyz + mcell_id * vec_size; - const double* vec_a_mcell = vec_a_g + offset; - const double* vec_b_mcell = vec_b_g + offset; - const int warp_id = tid / 32; - const int lane_id = tid % 32; - double mySum = 0; - - for (int k = tid; k < vec_size; k += blockDim.x) - { - mySum += vec_a_mcell[k] * vec_b_mcell[k]; - } - - mySum = warpReduceSum(mySum); - - if (lane_id == 0) - { - s_data[warp_id] = mySum; - } - __syncthreads(); - - mySum = (tid < blockDim.x / 32) ? s_data[tid] : 0; - if (warp_id == 0) - { - mySum = warpReduceSum(mySum); - } - - if (tid == 0) { - *results_g[bcell_id*bxyz + mcell_id] = mySum; - } -} -} // namespace GintKernel \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cuh deleted file mode 100644 index 70cbbb7692..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_rho.cuh +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef GINT_RHO_CUH -#define GINT_RHO_CUH - -#include -#include -namespace GintKernel -{ - -/** - * @brief CUDA kernel to calculate psir. - * - * This kernel calculates the wave function psi using the provided input - * parameters. - */ -__global__ void get_psi(const double* const ylmcoef, - const double delta_r, - const int bxyz, - const int nwmax, - const int max_atom, - const int* const ucell_atom_nwl, - const bool* const atom_iw2_new, - const int* const atom_iw2_ylm, - const int* const atom_nw, - const double* const rcut, - const int nr_max, - const double* const psi_u, - const double* const mcell_pos, - const double* const dr_part, - const uint8_t* const atoms_type, - const int* const atoms_num_info, - double* psi); - -__global__ void psir_dot(const int bxyz, - const int nwmax, - const int* atoms_num_info, - const double* __restrict__ vec_a_g, - const double* __restrict__ vec_b_g, - double** results_g); - -} // namespace GintKernel -#endif // GINT_RHO_CUH \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cu b/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cu deleted file mode 100644 index 3b92455e60..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cu +++ /dev/null @@ -1,75 +0,0 @@ -#include "gint_vl.cuh" -#include "interp.cuh" -#include "cuda_tools.cuh" -#include "sph.cuh" -namespace GintKernel -{ - -__global__ void get_psi_and_vldr3(const double* const ylmcoef, - const double delta_r, - const int bxyz, - const double nwmax, - const double max_atom, - const int* const ucell_atom_nwl, - const bool* const atom_iw2_new, - const int* const atom_iw2_ylm, - const int* const atom_nw, - const double* const rcut, - const int nr_max, - const double* const psi_u, - const double* const mcell_pos, - const double* const dr_part, - const double* const vldr3, - const uint8_t* const atoms_type, - const int* const atoms_num_info, - double* psi, - double* psi_vldr3) -{ - const int bcell_id = blockIdx.x; - const int num_atoms = atoms_num_info[2 * bcell_id]; - const int pre_atoms = atoms_num_info[2 * bcell_id + 1]; - const int mcell_id = blockIdx.y; - const double vldr3_value = vldr3[bcell_id * bxyz + mcell_id]; - const double mcell_pos_x = mcell_pos[3 * mcell_id]; - const double mcell_pos_y = mcell_pos[3 * mcell_id + 1]; - const double mcell_pos_z = mcell_pos[3 * mcell_id + 2]; - - for(int atom_id = threadIdx.x; atom_id < num_atoms; atom_id += blockDim.x) - { - const int dr_start = 3 * (pre_atoms + atom_id); - const double dr_x = dr_part[dr_start] + mcell_pos_x; - const double dr_y = dr_part[dr_start + 1] + mcell_pos_y; - const double dr_z = dr_part[dr_start + 2] + mcell_pos_z; - double dist = sqrt(dr_x * dr_x + dr_y * dr_y + dr_z * dr_z); - const int atype = __ldg(atoms_type + pre_atoms + atom_id); - if(dist < rcut[atype]) - { - if (dist < 1.0E-9) - { - dist += 1.0E-9; - } - double dr[3] = {dr_x / dist, dr_y / dist, dr_z / dist}; - double ylma[49]; - const int nwl = __ldg(ucell_atom_nwl + atype); - spherical_harmonics(dr, nwl, ylma, ylmcoef); - int psi_idx = (bcell_id * max_atom + atom_id) * bxyz * nwmax + mcell_id; - interp_vl(dist, - delta_r, - atype, - nwmax, - bxyz, - nr_max, - atom_nw, - atom_iw2_new, - psi_u, - ylma, - atom_iw2_ylm, - vldr3_value, - psi, - psi_vldr3, - psi_idx); - } - } -} - -} // namespace GintKernel \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cuh deleted file mode 100644 index ada7954968..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/gint_vl.cuh +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef GINT_VL_CUH -#define GINT_VL_CUH - -#include -#include -namespace GintKernel -{ -/* - * @brief: get the value of the spherical harmonics - * - * - * @note the left and right matrix elements of the grid point integral. - * We can understand the grid point integral of the local potential term - * as the following operation: - * H = psi * vlocal * psi * dr^3. - * Here, the matrix element of the left matrix is psi, and the matrix - * element of the right matrix is vlocal * psi * dr^3. - */ -__global__ void get_psi_and_vldr3(const double* const ylmcoef, - const double delta_r, - const int bxyz, - const double nwmax, - const double max_atom, - const int* const ucell_atom_nwl, - const bool* const atom_iw2_new, - const int* const atom_iw2_ylm, - const int* const atom_nw, - const double* const rcut, - const int nr_max, - const double* const psi_u, - const double* const mcell_pos, - const double* const dr_part, - const double* const vldr3, - const uint8_t* const atoms_type, - const int* const atoms_num_info, - double* psi, - double* psi_vldr3); - -} // namespace GintKernel -#endif // GINT_VL_CUH \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/interp.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/interp.cuh deleted file mode 100644 index 31ccf3ca2c..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/interp.cuh +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef INTERP_CUH -#define INTERP_CUH - -#include - -namespace GintKernel -{ -// if exponent is an integer between 0 and 5 (the most common cases in gint), -// pow_int is much faster than std::pow -static __device__ double pow_int(double base, int exp) -{ - switch (exp) - { - case 0: - return 1.0; - case 1: - return base; - case 2: - return base * base; - case 3: - return base * base * base; - case 4: - return base * base * base * base; - case 5: - return base * base * base * base * base; - default: - double result = pow(base, exp); - return result; - } -} - -static __device__ void interp_rho(const double dist, - const double delta_r, - const int atype, - const double nwmax, - const int nr_max, - const int* __restrict__ atom_nw, - const bool* __restrict__ atom_iw2_new, - const double* __restrict__ psi_u, - const double ylma[49], - const int* __restrict__ atom_iw2_ylm, - double* psi, - int psi_idx) -{ - const double distance = dist / delta_r; - - const int ip = (int)(distance); - const double dx = distance - ip; - const double dx2 = dx * dx; - const double dx3 = dx2 * dx; - - const double c3 = 3.0 * dx2 - 2.0 * dx3; - const double c1 = 1.0 - c3; - const double c2 = (dx - 2.0 * dx2 + dx3) * delta_r; - const double c4 = (dx3 - dx2) * delta_r; - - double phi = 0.0; - const int it_nw = atype * nwmax; - int iw_nr = (it_nw * nr_max + ip) * 2; - int it_nw_iw = it_nw; - for (int iw = 0; iw < atom_nw[atype]; ++iw) - { - if (atom_iw2_new[it_nw_iw]) - { - phi = c1 * psi_u[iw_nr] + c2 * psi_u[iw_nr + 1] - + c3 * psi_u[iw_nr + 2] + c4 * psi_u[iw_nr + 3]; - } - psi[psi_idx] = phi * ylma[atom_iw2_ylm[it_nw_iw]]; - psi_idx += 1; - iw_nr += 2 * nr_max; - it_nw_iw++; - } -} - -static __device__ void interp_vl(const double dist, - const double delta_r, - const int atype, - const double nwmax, - const int bxyz, - const int nr_max, - const int* __restrict__ atom_nw, - const bool* __restrict__ atom_iw2_new, - const double* __restrict__ psi_u, - const double ylma[49], - const int* __restrict__ atom_iw2_ylm, - const double vldr3_value, - double* psi, - double* psi_vldr3, - int psi_idx) -{ - const double distance = dist / delta_r; - - const int ip = (int)(distance); - const double dx = distance - ip; - const double dx2 = dx * dx; - const double dx3 = dx2 * dx; - - const double c3 = 3.0 * dx2 - 2.0 * dx3; - const double c1 = 1.0 - c3; - const double c2 = (dx - 2.0 * dx2 + dx3) * delta_r; - const double c4 = (dx3 - dx2) * delta_r; - - double phi = 0.0; - const int it_nw = atype * nwmax; - int iw_nr = (it_nw * nr_max + ip) * 2; - int it_nw_iw = it_nw; - for (int iw = 0; iw < atom_nw[atype]; ++iw) - { - if (atom_iw2_new[it_nw_iw]) - { - phi = c1 * psi_u[iw_nr] + c2 * psi_u[iw_nr + 1] - + c3 * psi_u[iw_nr + 2] + c4 * psi_u[iw_nr + 3]; - } - psi[psi_idx] = phi * ylma[atom_iw2_ylm[it_nw_iw]]; - psi_vldr3[psi_idx] = psi[psi_idx] * vldr3_value; - psi_idx += bxyz; - iw_nr += 2 * nr_max; - it_nw_iw++; - } -} - -static __device__ void interp_f(const double dist, - const double delta_r, - const int atype, - const double nwmax, - const int nr_max, - const int* __restrict__ atom_nw, - const bool* __restrict__ atom_iw2_new, - const double* __restrict__ psi_u, - const double ylma[49], - const int* __restrict__ atom_iw2_l, - const int* __restrict__ atom_iw2_ylm, - const double vldr3_value, - const double * __restrict__ dr, - const double grly[49][3], - int psi_idx, - double* psi, - double* dpsi, - double* d2psi) -{ - // Calculate normalized position for interpolation - const double postion = dist / delta_r; - // Extract integer part and fractional part of the position - const double ip = static_cast(postion); - const double x0 = postion - ip; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - // Temporary variables for interpolation - double tmp = 0.0; - double dtmp = 0.0; - // Loop over non-zero elements in atom_nw array - const int it_nw = atype * nwmax; - int iw_nr = (it_nw * nr_max + ip) * 2; - int it_nw_iw = it_nw; - for (int iw = 0; iw < atom_nw[atype]; ++iw) - { - if (atom_iw2_new[it_nw_iw]) - { - // Perform interpolation using cubic B-spline - // basis functions - tmp = x12 * (psi_u[iw_nr] * x3 + psi_u[iw_nr + 6] * x0) - + x03 * (psi_u[iw_nr + 2] * x2 - psi_u[iw_nr + 4] * x1); - dtmp = x12 * (psi_u[iw_nr + 1] * x3 + psi_u[iw_nr + 7] * x0) - + x03 * (psi_u[iw_nr + 3] * x2 - psi_u[iw_nr + 5] * x1); - } - // Extract information from atom_iw2_* arrays - const int ll = atom_iw2_l[it_nw_iw]; - const int idx_lm = atom_iw2_ylm[it_nw_iw]; - const double rl = pow_int(dist, ll); - const double rl_r = 1.0 / rl; - const double dist_r = 1 / dist; - const int dpsi_idx = psi_idx * 3; - const int d2psi_idx = psi_idx * 6; - // Compute derivatives with respect to spatial - // coordinates - const double tmpdphi_rly - = (dtmp - tmp * ll * dist_r) * rl_r * ylma[idx_lm] * dist_r; - const double tmprl = tmp * rl_r; - const double dpsirx = tmpdphi_rly * dr[0] + tmprl * grly[idx_lm][0]; - const double dpsiry = tmpdphi_rly * dr[1] + tmprl * grly[idx_lm][1]; - const double dpsirz = tmpdphi_rly * dr[2] + tmprl * grly[idx_lm][2]; - - psi[psi_idx] = tmprl * ylma[idx_lm] * vldr3_value; - dpsi[dpsi_idx] = dpsirx; - dpsi[dpsi_idx + 1] = dpsiry; - dpsi[dpsi_idx + 2] = dpsirz; - d2psi[d2psi_idx] = dpsirx * dr[0]; - d2psi[d2psi_idx + 1] = dpsirx * dr[1]; - d2psi[d2psi_idx + 2] = dpsirx * dr[2]; - d2psi[d2psi_idx + 3] = dpsiry * dr[1]; - d2psi[d2psi_idx + 4] = dpsiry * dr[2]; - d2psi[d2psi_idx + 5] = dpsirz * dr[2]; - // Update loop counters and indices - psi_idx += 1; - iw_nr += 2 * nr_max; - it_nw_iw++; - } -} -} // namespace GintKernel - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/sph.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/sph.cuh deleted file mode 100644 index fec963d9fd..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/sph.cuh +++ /dev/null @@ -1,519 +0,0 @@ -#ifndef SPH_CUH -#define SPH_CUH - -#include "cuda_runtime.h" -#include "device_launch_parameters.h" - -namespace GintKernel -{ - -static __device__ void spherical_harmonics(const double* const dr, - const int nwl, - double (&ylma)[49], - const double* const ylmcoef) -{ - /*************************** - L = 0 - ***************************/ - ylma[0] = ylmcoef[0]; // l=0, m=0 - double tmp0; - if (nwl == 0) - return; - - /*************************** - L = 1 - ***************************/ - ylma[1] = ylmcoef[1] * dr[2]; // l=1, m=0 - ylma[2] = -ylmcoef[1] * dr[0]; // l=1, m=1 - ylma[3] = -ylmcoef[1] * dr[1]; // l=1, m=-1 - if (nwl == 1) - return; - - /*************************** - L = 2 - ***************************/ - tmp0=ylmcoef[3] * ylma[0]; - ylma[4] = ylmcoef[2] * dr[2] * ylma[1] - tmp0 ; // l=2, m=0 - tmp0 = ylmcoef[4] * dr[2]; - ylma[5] = tmp0 * ylma[2]; // l=2,m=1 - ylma[6] = tmp0 * ylma[3]; // l=2,m=-1 - - tmp0 = ylmcoef[4] * dr[0]; - ylma[7] = ylmcoef[5] * ylma[4] - ylmcoef[6] * ylma[0] - - tmp0 * ylma[2]; // l=2,m=2 - ylma[8] = -tmp0 * ylma[3]; - if (nwl == 2) - return; - - /*************************** - L = 3 - ***************************/ - tmp0=ylmcoef[8] * ylma[1]; - ylma[9] = ylmcoef[7] * dr[2] * ylma[4] - tmp0; // l=3, m=0 - - tmp0 = ylmcoef[9] * dr[2]; - ylma[10] = tmp0 * ylma[5] - ylmcoef[10] * ylma[2]; // l=3,m=1 - ylma[11] = tmp0 * ylma[6] - ylmcoef[10] * ylma[3]; // l=3,m=-1 - - tmp0 = ylmcoef[11] * dr[2]; - ylma[12] = tmp0 * ylma[7]; // l=3,m=2 - ylma[13] = tmp0 * ylma[8]; // l=3,m=-2 - - tmp0 = ylmcoef[14] * dr[0]; - ylma[14] = ylmcoef[12] * ylma[10] - ylmcoef[13] * ylma[2] - - tmp0 * ylma[7]; // l=3,m=3 - ylma[15] = ylmcoef[12] * ylma[11] - ylmcoef[13] * ylma[3] - - tmp0 * ylma[8]; // l=3,m=-3 - if (nwl == 3) - return; - - /*************************** - L = 4 - ***************************/ - tmp0=ylmcoef[16] * ylma[4]; - ylma[16] = ylmcoef[15] * dr[2] * ylma[9] - tmp0; // l=4,m=0 - - tmp0 = ylmcoef[17] * dr[2]; - ylma[17] = tmp0 * ylma[10] - ylmcoef[18] * ylma[5]; // l=4,m=1 - ylma[18] = tmp0 * ylma[11] - ylmcoef[18] * ylma[6]; // l=4,m=-1 - - tmp0 = ylmcoef[19] * dr[2]; - ylma[19] = tmp0 * ylma[12] - ylmcoef[20] * ylma[7]; // l=4,m=2 - ylma[20] = tmp0 * ylma[13] - ylmcoef[20] * ylma[8]; // l=4,m=-2 - - tmp0 = 3.0 * dr[2]; - ylma[21] = tmp0 * ylma[14]; // l=4,m=3 - ylma[22] = tmp0 * ylma[15]; // l=4,m=-3 - - tmp0 = ylmcoef[23] * dr[0]; - ylma[23] = ylmcoef[21] * ylma[19] - ylmcoef[22] * ylma[7] - - tmp0 * ylma[14]; // l=4,m=4 - ylma[24] = ylmcoef[21] * ylma[20] - ylmcoef[22] * ylma[8] - - tmp0 * ylma[15]; // l=4,m=-4 - if (nwl == 4) - return; - - /*************************** - L = 5 - ***************************/ - tmp0=ylmcoef[25] * ylma[9]; - ylma[25] - = ylmcoef[24] * dr[2] * ylma[16] - tmp0; // l=5,m=0 - - tmp0 = ylmcoef[26] * dr[2]; - ylma[26] = tmp0 * ylma[17] - ylmcoef[27] * ylma[10]; // l=5,m=1 - ylma[27] = tmp0 * ylma[18] - ylmcoef[27] * ylma[11]; // l=5,m=-1 - - tmp0 = ylmcoef[28] * dr[2]; - ylma[28] = tmp0 * ylma[19] - ylmcoef[29] * ylma[12]; // l=5,m=2 - ylma[29] = tmp0 * ylma[20] - ylmcoef[29] * ylma[13]; // l=5,m=-2 - - tmp0 = ylmcoef[30] * dr[2]; - ylma[30] = tmp0 * ylma[21] - ylmcoef[31] * ylma[14]; // l=5,m=3 - ylma[31] = tmp0 * ylma[22] - ylmcoef[31] * ylma[15]; // l=5,m=-3 - - tmp0 = ylmcoef[32] * dr[2]; - ylma[32] = tmp0 * ylma[23]; // l=5,m=4 - ylma[33] = tmp0 * ylma[24]; // l=5,m=-4 - - tmp0 = ylmcoef[35] * dr[0]; - ylma[34] = ylmcoef[33] * ylma[30] - ylmcoef[34] * ylma[14] - - tmp0 * ylma[23]; // l=5,m=5 - ylma[35] = ylmcoef[33] * ylma[31] - ylmcoef[34] * ylma[15] - - tmp0 * ylma[24]; // l=5,m=-5 - if (nwl == 5) - return; - /* - // if nwl > 5 - for (int il = 6; il <= nwl; il++) - { - int istart = il * il; - int istart1 = (il - 1) * (il - 1); - int istart2 = (il - 2) * (il - 2); - - double fac2 = sqrt(4.0 * istart - 1.0); - double fac4 = sqrt(4.0 * istart1 - 1.0); - - for (int im = 0; im < 2 * il - 1; im++) - { - int imm = (im + 1) / 2; - ylma[istart + im] = fac2 / sqrt((double)istart - imm * imm) * (dr[2] - * ylma[istart1 + im] - sqrt((double)istart1 - imm * imm) / fac4 * - ylma[istart2 + im]); - } - - double bl1 = sqrt(2.0 * il / (2.0 * il + 1.0)); - double bl2 = sqrt((2.0 * il - 2.0) / (2.0 * il - 1.0)); - double bl3 = sqrt(2.0) / fac2; - - ylma[istart + 2 * il - 1] = (bl3 * ylma[istart + 2 * il - 5] - bl2 * - ylma[istart2 + 2 * il - 5] - 2.0 * dr[0] * ylma[istart1 + 2 * il - 3]) / - bl1; ylma[istart + 2 * il] = (bl3 * ylma[istart + 2 * il - 4] - bl2 * - ylma[istart2 + 2 * il - 4] - 2.0 * dr[0] * ylma[istart1 + 2 * il - 2]) / - bl1; - }*/ -} - -static __device__ void spherical_harmonics_d(const double* const dr, - const double distance, - double (&grly)[49][3], - const int nwl, - double (&ylma)[49], - const double* const ylmcoef) -{ - double tmp0; - double tx = 2.0 * dr[0]; - double ty = 2.0 * dr[1]; - double tz = 2.0 * dr[2]; - ylma[0] = ylmcoef[0]; // l=0, m=0 - grly[0][0] = grly[0][1] = grly[0][2] = 0.0; - if (nwl == 0) - return; - - /*************************** - L = 1 - ***************************/ - ylma[1] = ylmcoef[1] * dr[2]; // l=1, m=0 - grly[1][0] = grly[1][1] = 0.0; - grly[1][2] = ylmcoef[1]; - ylma[2] = -ylmcoef[1] * dr[0]; // l=1, m=1 - grly[2][1] = grly[2][2] = 0.0; - grly[2][0] = -ylmcoef[1]; - ylma[3] = -ylmcoef[1] * dr[1]; // l=1, m=-1 - grly[3][0] = grly[3][2] = 0.0; - grly[3][1] = -ylmcoef[1]; - if (nwl == 1) - return; - - /*************************** - L = 2 - ***************************/ - ylma[4] = ylmcoef[2] * dr[2] * ylma[1] - - ylmcoef[3] * ylma[0] * distance; // l=2, m=0 - grly[4][0] - = ylmcoef[2] * dr[2] * grly[1][0] - - ylmcoef[3] * (grly[0][0] * distance + ylma[0] * tx); // l=2, m=0 - grly[4][1] - = ylmcoef[2] * dr[2] * grly[1][1] - - ylmcoef[3] * (grly[0][1] * distance + ylma[0] * ty); // l=2, m=0 - grly[4][2] - = ylmcoef[2] * (dr[2] * grly[1][2] + ylma[1]) - - ylmcoef[3] * (grly[0][2] * distance + ylma[0] * tz); // l=2, m=0 - - tmp0 = ylmcoef[4] * dr[2]; - ylma[5] = tmp0 * ylma[2]; // l=2,m=1 - grly[5][0] = tmp0 * grly[2][0]; - grly[5][1] = tmp0 * grly[2][1]; - grly[5][2] = ylmcoef[4] * (ylma[2] + dr[2] * grly[2][2]); - - ylma[6] = tmp0 * ylma[3]; // l=2,m=-1 - grly[6][0] = tmp0 * grly[3][0]; - grly[6][1] = tmp0 * grly[3][1]; - grly[6][2] = ylmcoef[4] * (ylma[3] + dr[2] * grly[3][2]); - - tmp0 = ylmcoef[4] * dr[0]; - ylma[7] = ylmcoef[5] * ylma[4] - ylmcoef[6] * ylma[0] * distance - - tmp0 * ylma[2]; // l=2,m=2 - grly[7][0] = ylmcoef[5] * grly[4][0] - - ylmcoef[6] * (ylma[0] * tx + grly[0][0] * distance) - - ylmcoef[4] * (dr[0] * grly[2][0] + ylma[2]); - grly[7][1] = ylmcoef[5] * grly[4][1] - - ylmcoef[6] * (ylma[0] * ty + grly[0][1] * distance) - - tmp0 * grly[2][1]; - grly[7][2] = ylmcoef[5] * grly[4][2] - - ylmcoef[6] * (ylma[0] * tz + grly[0][2] * distance) - - tmp0 * grly[2][2]; - - ylma[8] = -tmp0 * ylma[3]; - grly[8][0] = -ylmcoef[4] * (ylma[3] + dr[0] * grly[3][0]); - grly[8][1] = -tmp0 * grly[3][1]; - grly[8][2] = -tmp0 * grly[3][2]; - if (nwl == 2) - return; - - /*************************** - L = 3 - ***************************/ - ylma[9] = ylmcoef[7] * dr[2] * ylma[4] - - ylmcoef[8] * ylma[1] * distance; // l=3, m=0 - grly[9][0] = ylmcoef[7] * dr[2] * grly[4][0] - - ylmcoef[8] * (ylma[1] * tx + grly[1][0] * distance); - grly[9][1] = ylmcoef[7] * dr[2] * grly[4][1] - - ylmcoef[8] * (ylma[1] * ty + grly[1][1] * distance); - grly[9][2] = ylmcoef[7] * (ylma[4] + dr[2] * grly[4][2]) - - ylmcoef[8] * (ylma[1] * tz + grly[1][2] * distance); - - tmp0 = ylmcoef[9] * dr[2]; - ylma[10] = tmp0 * ylma[5] - ylmcoef[10] * ylma[2] * distance; // l=3,m=1 - grly[10][0] = tmp0 * grly[5][0] - - ylmcoef[10] * (grly[2][0] * distance + ylma[2] * tx); - grly[10][1] = tmp0 * grly[5][1] - - ylmcoef[10] * (grly[2][1] * distance + ylma[2] * ty); - grly[10][2] = ylmcoef[9] * (dr[2] * grly[5][2] + ylma[5]) - - ylmcoef[10] * (grly[2][2] * distance + ylma[2] * tz); - - ylma[11] = tmp0 * ylma[6] - ylmcoef[10] * ylma[3] * distance; // l=3,m=-1 - grly[11][0] = tmp0 * grly[6][0] - - ylmcoef[10] * (grly[3][0] * distance + ylma[3] * tx); - grly[11][1] = tmp0 * grly[6][1] - - ylmcoef[10] * (grly[3][1] * distance + ylma[3] * ty); - grly[11][2] = ylmcoef[9] * (dr[2] * grly[6][2] + ylma[6]) - - ylmcoef[10] * (grly[3][2] * distance + ylma[3] * tz); - - tmp0 = ylmcoef[11] * dr[2]; - ylma[12] = tmp0 * ylma[7]; // l=3,m=2 - grly[12][0] = tmp0 * grly[7][0]; - grly[12][1] = tmp0 * grly[7][1]; - grly[12][2] = ylmcoef[11] * (dr[2] * grly[7][2] + ylma[7]); - - ylma[13] = tmp0 * ylma[8]; // l=3,m=-2 - grly[13][0] = tmp0 * grly[8][0]; - grly[13][1] = tmp0 * grly[8][1]; - grly[13][2] = ylmcoef[11] * (dr[2] * grly[8][2] + ylma[8]); - - tmp0 = ylmcoef[14] * dr[0]; - ylma[14] = ylmcoef[12] * ylma[10] - ylmcoef[13] * ylma[2] * distance - - tmp0 * ylma[7]; // l=3,m=3 - grly[14][0] = ylmcoef[12] * grly[10][0] - - ylmcoef[13] * (ylma[2] * tx + grly[2][0] * distance) - - ylmcoef[14] * (ylma[7] + dr[0] * grly[7][0]); - grly[14][1] = ylmcoef[12] * grly[10][1] - - ylmcoef[13] * (ylma[2] * ty + grly[2][1] * distance) - - tmp0 * grly[7][1]; - grly[14][2] = ylmcoef[12] * grly[10][2] - - ylmcoef[13] * (ylma[2] * tz + grly[2][2] * distance) - - tmp0 * grly[7][2]; - - ylma[15] = ylmcoef[12] * ylma[11] - ylmcoef[13] * ylma[3] * distance - - tmp0 * ylma[8]; // l=3,m=-3 - grly[15][0] = ylmcoef[12] * grly[11][0] - - ylmcoef[13] * (ylma[3] * tx + grly[3][0] * distance) - - ylmcoef[14] * (ylma[8] + dr[0] * grly[8][0]); - grly[15][1] = ylmcoef[12] * grly[11][1] - - ylmcoef[13] * (ylma[3] * ty + grly[3][1] * distance) - - tmp0 * grly[8][1]; - grly[15][2] = ylmcoef[12] * grly[11][2] - - ylmcoef[13] * (ylma[3] * tz + grly[3][2] * distance) - - tmp0 * grly[8][2]; - if (nwl == 3) - return; - - /*************************** - L = 4 - ***************************/ - ylma[16] = ylmcoef[15] * dr[2] * ylma[9] - - ylmcoef[16] * ylma[4] * distance; // l=4,m=0 - grly[16][0] = ylmcoef[15] * dr[2] * grly[9][0] - - ylmcoef[16] * (ylma[4] * tx + grly[4][0] * distance); - grly[16][1] = ylmcoef[15] * dr[2] * grly[9][1] - - ylmcoef[16] * (ylma[4] * ty + grly[4][1] * distance); - grly[16][2] = ylmcoef[15] * (dr[2] * grly[9][2] + ylma[9]) - - ylmcoef[16] * (ylma[4] * tz + grly[4][2] * distance); - - tmp0 = ylmcoef[17] * dr[2]; - ylma[17] = tmp0 * ylma[10] - ylmcoef[18] * ylma[5] * distance; // l=4,m=1 - grly[17][0] = tmp0 * grly[10][0] - - ylmcoef[18] * (ylma[5] * tx + grly[5][0] * distance); - grly[17][1] = tmp0 * grly[10][1] - - ylmcoef[18] * (ylma[5] * ty + grly[5][1] * distance); - grly[17][2] = ylmcoef[17] * (dr[2] * grly[10][2] + ylma[10]) - - ylmcoef[18] * (ylma[5] * tz + grly[5][2] * distance); - - ylma[18] = tmp0 * ylma[11] - ylmcoef[18] * ylma[6] * distance; // l=4,m=-1 - grly[18][0] = tmp0 * grly[11][0] - - ylmcoef[18] * (ylma[6] * tx + grly[6][0] * distance); - grly[18][1] = tmp0 * grly[11][1] - - ylmcoef[18] * (ylma[6] * ty + grly[6][1] * distance); - grly[18][2] = ylmcoef[17] * (dr[2] * grly[11][2] + ylma[11]) - - ylmcoef[18] * (ylma[6] * tz + grly[6][2] * distance); - - tmp0 = ylmcoef[19] * dr[2]; - ylma[19] = tmp0 * ylma[12] - ylmcoef[20] * ylma[7] * distance; // l=4,m=2 - grly[19][0] = tmp0 * grly[12][0] - - ylmcoef[20] * (ylma[7] * tx + grly[7][0] * distance); - grly[19][1] = tmp0 * grly[12][1] - - ylmcoef[20] * (ylma[7] * ty + grly[7][1] * distance); - grly[19][2] = ylmcoef[19] * (dr[2] * grly[12][2] + ylma[12]) - - ylmcoef[20] * (ylma[7] * tz + grly[7][2] * distance); - - ylma[20] = tmp0 * ylma[13] - ylmcoef[20] * ylma[8] * distance; // l=4,m=-2 - grly[20][0] = tmp0 * grly[13][0] - - ylmcoef[20] * (ylma[8] * tx + grly[8][0] * distance); - grly[20][1] = tmp0 * grly[13][1] - - ylmcoef[20] * (ylma[8] * ty + grly[8][1] * distance); - grly[20][2] = ylmcoef[19] * (dr[2] * grly[13][2] + ylma[13]) - - ylmcoef[20] * (ylma[8] * tz + grly[8][2] * distance); - - tmp0 = 3.0 * dr[2]; - ylma[21] = tmp0 * ylma[14]; // l=4,m=3 - grly[21][0] = tmp0 * grly[14][0]; - grly[21][1] = tmp0 * grly[14][1]; - grly[21][2] = 3.0 * (dr[2] * grly[14][2] + ylma[14]); - - ylma[22] = tmp0 * ylma[15]; // l=4,m=-3 - grly[22][0] = tmp0 * grly[15][0]; - grly[22][1] = tmp0 * grly[15][1]; - grly[22][2] = 3.0 * (dr[2] * grly[15][2] + ylma[15]); - - tmp0 = ylmcoef[23] * dr[0]; - ylma[23] = ylmcoef[21] * ylma[19] - ylmcoef[22] * ylma[7] * distance - - tmp0 * ylma[14]; // l=4,m=4 - grly[23][0] = ylmcoef[21] * grly[19][0] - - ylmcoef[22] * (ylma[7] * tx + grly[7][0] * distance) - - ylmcoef[23] * (dr[0] * grly[14][0] + ylma[14]); - grly[23][1] = ylmcoef[21] * grly[19][1] - - ylmcoef[22] * (ylma[7] * ty + grly[7][1] * distance) - - tmp0 * grly[14][1]; - grly[23][2] = ylmcoef[21] * grly[19][2] - - ylmcoef[22] * (ylma[7] * tz + grly[7][2] * distance) - - tmp0 * grly[14][2]; - - ylma[24] = ylmcoef[21] * ylma[20] - ylmcoef[22] * ylma[8] * distance - - tmp0 * ylma[15]; // l=4,m=-4 - grly[24][0] = ylmcoef[21] * grly[20][0] - - ylmcoef[22] * (ylma[8] * tx + grly[8][0] * distance) - - ylmcoef[23] * (dr[0] * grly[15][0] + ylma[15]); - grly[24][1] = ylmcoef[21] * grly[20][1] - - ylmcoef[22] * (ylma[8] * ty + grly[8][1] * distance) - - tmp0 * grly[15][1]; - grly[24][2] = ylmcoef[21] * grly[20][2] - - ylmcoef[22] * (ylma[8] * tz + grly[8][2] * distance) - - tmp0 * grly[15][2]; - if (nwl == 4) - return; - - /*************************** - L = 5 - ***************************/ - ylma[25] = ylmcoef[24] * dr[2] * ylma[16] - - ylmcoef[25] * ylma[9] * distance; // l=5,m=0 - grly[25][0] = ylmcoef[24] * dr[2] * grly[16][0] - - ylmcoef[25] * (ylma[9] * tx + grly[9][0] * distance); - grly[25][1] = ylmcoef[24] * dr[2] * grly[16][1] - - ylmcoef[25] * (ylma[9] * ty + grly[9][1] * distance); - grly[25][2] = ylmcoef[24] * (dr[2] * grly[16][2] + ylma[16]) - - ylmcoef[25] * (ylma[9] * tz + grly[9][2] * distance); - - tmp0 = ylmcoef[26] * dr[2]; - ylma[26] = tmp0 * ylma[17] - ylmcoef[27] * ylma[10] * distance; // l=5,m=1 - grly[26][0] = tmp0 * grly[17][0] - - ylmcoef[27] * (ylma[10] * tx + grly[10][0] * distance); - grly[26][1] = tmp0 * grly[17][1] - - ylmcoef[27] * (ylma[10] * ty + grly[10][1] * distance); - grly[26][2] = ylmcoef[26] * (dr[2] * grly[17][2] + ylma[17]) - - ylmcoef[27] * (ylma[10] * tz + grly[10][2] * distance); - - ylma[27] = tmp0 * ylma[18] - ylmcoef[27] * ylma[11] * distance; // l=5,m=-1 - grly[27][0] = tmp0 * grly[18][0] - - ylmcoef[27] * (ylma[11] * tx + grly[11][0] * distance); - grly[27][1] = tmp0 * grly[18][1] - - ylmcoef[27] * (ylma[11] * ty + grly[11][1] * distance); - grly[27][2] = ylmcoef[26] * (dr[2] * grly[18][2] + ylma[18]) - - ylmcoef[27] * (ylma[11] * tz + grly[11][2] * distance); - - tmp0 = ylmcoef[28] * dr[2]; - ylma[28] = tmp0 * ylma[19] - ylmcoef[29] * ylma[12] * distance; // l=5,m=2 - grly[28][0] = tmp0 * grly[19][0] - - ylmcoef[29] * (ylma[12] * tx + grly[12][0] * distance); - grly[28][1] = tmp0 * grly[19][1] - - ylmcoef[29] * (ylma[12] * ty + grly[12][1] * distance); - grly[28][2] = ylmcoef[28] * (dr[2] * grly[19][2] + ylma[19]) - - ylmcoef[29] * (ylma[12] * tz + grly[12][2] * distance); - - ylma[29] = tmp0 * ylma[20] - ylmcoef[29] * ylma[13] * distance; // l=5,m=-2 - grly[29][0] = tmp0 * grly[20][0] - - ylmcoef[29] * (ylma[13] * tx + grly[13][0] * distance); - grly[29][1] = tmp0 * grly[20][1] - - ylmcoef[29] * (ylma[13] * ty + grly[13][1] * distance); - grly[29][2] = ylmcoef[28] * (dr[2] * grly[20][2] + ylma[20]) - - ylmcoef[29] * (ylma[13] * tz + grly[13][2] * distance); - - tmp0 = ylmcoef[30] * dr[2]; - ylma[30] = tmp0 * ylma[21] - ylmcoef[31] * ylma[14] * distance; // l=5,m=3 - grly[30][0] = tmp0 * grly[21][0] - - ylmcoef[31] * (grly[14][0] * distance + ylma[14] * tx); - grly[30][1] = tmp0 * grly[21][1] - - ylmcoef[31] * (grly[14][1] * distance + ylma[14] * ty); - grly[30][2] = ylmcoef[30] * (dr[2] * grly[21][2] + ylma[21]) - - ylmcoef[31] * (ylma[14] * tz + grly[14][2] * distance); - - ylma[31] = tmp0 * ylma[22] - ylmcoef[31] * ylma[15] * distance; // l=5,m=-3 - grly[31][0] = tmp0 * grly[22][0] - - ylmcoef[31] * (grly[15][0] * distance + ylma[15] * tx); - grly[31][1] = tmp0 * grly[22][1] - - ylmcoef[31] * (grly[15][1] * distance + ylma[15] * ty); - grly[31][2] = ylmcoef[30] * (dr[2] * grly[22][2] + ylma[22]) - - ylmcoef[31] * (ylma[15] * tz + grly[15][2] * distance); - - tmp0 = ylmcoef[32] * dr[2]; - ylma[32] = tmp0 * ylma[23]; // l=5,m=4 - grly[32][0] = tmp0 * grly[23][0]; - grly[32][1] = tmp0 * grly[23][1]; - grly[32][2] = ylmcoef[32] * (ylma[23] + dr[2] * grly[23][2]); - - ylma[33] = tmp0 * ylma[24]; // l=5,m=-4 - grly[33][0] = tmp0 * grly[24][0]; - grly[33][1] = tmp0 * grly[24][1]; - grly[33][2] = ylmcoef[32] * (ylma[24] + dr[2] * grly[24][2]); - - tmp0 = ylmcoef[35] * dr[0]; - ylma[34] = ylmcoef[33] * ylma[30] - ylmcoef[34] * ylma[14] * distance - - tmp0 * ylma[23]; // l=5,m=5 - grly[34][0] = ylmcoef[33] * grly[30][0] - - ylmcoef[34] * (ylma[14] * tx + grly[14][0] * distance) - - ylmcoef[35] * (dr[0] * grly[23][0] + ylma[23]); - grly[34][1] = ylmcoef[33] * grly[30][1] - - ylmcoef[34] * (ylma[14] * ty + grly[14][1] * distance) - - tmp0 * grly[23][1]; - grly[34][2] = ylmcoef[33] * grly[30][2] - - ylmcoef[34] * (ylma[14] * tz + grly[14][2] * distance) - - tmp0 * grly[23][2]; - - ylma[35] = ylmcoef[33] * ylma[31] - ylmcoef[34] * ylma[15] * distance - - tmp0 * ylma[24]; // l=5,m=-5 - grly[35][0] = ylmcoef[33] * grly[31][0] - - ylmcoef[34] * (ylma[15] * tx + grly[15][0] * distance) - - ylmcoef[35] * (dr[0] * grly[24][0] + ylma[24]); - grly[35][1] = ylmcoef[33] * grly[31][1] - - ylmcoef[34] * (ylma[15] * ty + grly[15][1] * distance) - - tmp0 * grly[24][1]; - grly[35][2] = ylmcoef[33] * grly[31][2] - - ylmcoef[34] * (ylma[15] * tz + grly[15][2] * distance) - - tmp0 * grly[24][2]; - - if (nwl == 5) - return; - /* - // if nwl > 5 - for (int il = 6; il <= nwl; il++) - { - int istart = il * il; - int istart1 = (il - 1) * (il - 1); - int istart2 = (il - 2) * (il - 2); - - double fac2 = sqrt(4.0 * istart - 1.0); - double fac4 = sqrt(4.0 * istart1 - 1.0); - - for (int im = 0; im < 2 * il - 1; im++) - { - int imm = (im + 1) / 2; - ylma[istart + im] = fac2 / sqrt((double)istart - imm * imm) * (dr[2] - * ylma[istart1 + im] - sqrt((double)istart1 - imm * imm) / fac4 * - ylma[istart2 + im]); - } - - double bl1 = sqrt(2.0 * il / (2.0 * il + 1.0)); - double bl2 = sqrt((2.0 * il - 2.0) / (2.0 * il - 1.0)); - double bl3 = sqrt(2.0) / fac2; - - ylma[istart + 2 * il - 1] = (bl3 * ylma[istart + 2 * il - 5] - bl2 * - ylma[istart2 + 2 * il - 5] - 2.0 * dr[0] * ylma[istart1 + 2 * il - 3]) / - bl1; ylma[istart + 2 * il] = (bl3 * ylma[istart + 2 * il - 4] - bl2 * - ylma[istart2 + 2 * il - 4] - 2.0 * dr[0] * ylma[istart1 + 2 * il - 2]) / - bl1; - }*/ -} - -} // namespace GintKernel - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/kernels/cuda/vbatch_matrix_mul.cuh b/source/module_hamilt_lcao/module_gint/kernels/cuda/vbatch_matrix_mul.cuh deleted file mode 100644 index 230e5a6f44..0000000000 --- a/source/module_hamilt_lcao/module_gint/kernels/cuda/vbatch_matrix_mul.cuh +++ /dev/null @@ -1,545 +0,0 @@ -#ifndef VBATCH_MATRIX_MUL_CUH -#define VBATCH_MATRIX_MUL_CUH -#include "cuda_tools.cuh" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/module_device/device.h" -#include "source_cell/unitcell.h" - -#include // for assert -#include -#include // for CUDA_VERSION -#include -#include -#include // for fprintf and stderr - -#define sA(i, j) sA[(j)*slda + (i)] -#define sB(i, j) sB[(j)*sldb + (i)] -#define fetch(A, m, n, bound) offs_d##A[min(n * LD##A + m, bound)] - -template -static __device__ void vbatched_gemm_device(int M, - int N, - int K, - T* __restrict__ A, - int LDA, - T* __restrict__ B, - int LDB, - T* __restrict__ C, - int LDC, - T* sA, - int slda, - T* sB, - int sldb, - T alpha) -{ - int idx = threadIdx.x; // thread's m dimension - int idy = threadIdx.y; // thread's n dimension - - int idt = DIM_X * idy + idx; // thread's global number - - int idxA = idt % DIM_XA; // idx within A - int idyA = idt / DIM_XA; // idy within A - - int idxB = idt % DIM_XB; // idx within B - int idyB = idt / DIM_XB; // idy within B - - int blx = blockIdx.x; // block's m dimension - int bly = blockIdx.y; // block's n dimension - - // Registers for the innermost loop - T rC[THR_N][THR_M]; - T rA[THR_M]; - T rB[THR_N]; - - // Registers for the dev->shmem copy - T ra[BLK_M / DIM_YA][BLK_K / DIM_XA]; - T rb[BLK_N / DIM_YB][BLK_K / DIM_XB]; - - // bound is the correction to offs_d in order to not get out of memory bound - // so bound could be negative value since offs_d could be out of bound - T* offs_dA = A + blx * BLK_M * LDA + idyA * LDA + idxA; - int boundA = (LDA * (M - 1) + K) - (blx * BLK_M * LDA + idyA * LDA + idxA) - 1; - - T* offs_dB = B + bly * BLK_N * LDB + idyB * LDB + idxB; - int boundB = (LDB * (N - 1) + K) - (bly * BLK_N * LDB + idyB * LDB + idxB) - 1; - - int m, n, k, kk; - -// Zero C -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] = 0.0; - } - } - -// Load A dev->shmem -#pragma unroll - for (n = 0; n < BLK_M; n += DIM_YA) - { -#pragma unroll - for (m = 0; m < BLK_K; m += DIM_XA) - { - sA(n + idyA, m + idxA) = fetch(A, m, n, boundA); - } - } - -#pragma unroll - for (n = 0; n < BLK_N; n += DIM_YB) - { -#pragma unroll - for (m = 0; m < BLK_K; m += DIM_XB) - { - sB(m + idxB, n + idyB) = fetch(B, m, n, boundB); - } - } - - __syncthreads(); - - for (kk = 0; kk < K - BLK_K; kk += BLK_K) - { - offs_dA += BLK_K; - boundA -= BLK_K; - - offs_dB += BLK_K; - boundB -= BLK_K; - -// Load A dev->regs -#pragma unroll - for (n = 0; n < BLK_M / DIM_YA; n++) - { -#pragma unroll - for (m = 0; m < BLK_K / DIM_XA; m++) - { - ra[n][m] = fetch(A, m * DIM_XA, n * DIM_YA, boundA); - } - } - -// Load B dev->regs -#pragma unroll - for (n = 0; n < BLK_N / DIM_YB; n++) - { -#pragma unroll - for (m = 0; m < BLK_K / DIM_XB; m++) - { - rb[n][m] = fetch(B, m * DIM_XB, n * DIM_YB, boundB); - } - } - -// Multiply -#pragma unroll - for (k = 0; k < BLK_K; k++) - { -// Load A shmem->regs -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rA[m] = sA(m * DIM_X + idx, k); - } - -// Load B shmem->regs -#pragma unroll - for (n = 0; n < THR_N; n++) - { - rB[n] = sB(k, n * DIM_Y + idy); - } - -// Compute -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] += rA[m] * rB[n]; - } - } - } - - __syncthreads(); - -// Load A regs->shmem -#pragma unroll - for (n = 0; n < BLK_M / DIM_YA; n++) - { -#pragma unroll - for (m = 0; m < BLK_K / DIM_XA; m++) - { - sA(n * DIM_YA + idyA, m * DIM_XA + idxA) = ra[n][m]; - } - } - -// Load B regs->shmem -#pragma unroll - for (n = 0; n < BLK_N / DIM_YB; n++) - { -#pragma unroll - for (m = 0; m < BLK_K / DIM_XB; m++) - { - sB(m * DIM_XB + idxB, n * DIM_YB + idyB) = rb[n][m]; - } - } - __syncthreads(); - } - - // Multiply last full (BLK_K) or partial block of - // columns of op(A) and rows of op(B). - // It's okay that m,n exceed matrix bounds as all work is in registers - // or shared memory, and out-of-bounds rC[n][m] will not be saved later. - kk = K - kk; -#pragma unroll - for (k = 0; k < kk; k++) - { -// Load A shmem->regs -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rA[m] = sA(m * DIM_X + idx, k); - } - -// Load B shmem->regs -#pragma unroll - for (n = 0; n < THR_N; n++) - { - rB[n] = sB(k, n * DIM_Y + idy); - } - -// Compute -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] += rA[m] * rB[n]; - } - } - } - -// Store C regs->dev -#pragma unroll - for (n = 0; n < THR_N; n++) - { - int coord_dCn = bly * BLK_N + n * DIM_Y + idy; -#pragma unroll - for (m = 0; m < THR_M; m++) - { - int coord_dCm = blx * BLK_M + m * DIM_X + idx; - if (coord_dCm < M && coord_dCn < N) - { - int offsC = coord_dCn * LDC + coord_dCm; - - atomicAdd(C + offsC, rC[n][m] * alpha); - } - } - } -} - -/******************************************************************************/ -template -static __global__ void vbatched_gemm_kernel(int* M, - int* N, - int* K, - T** global_A_array, - int* global_lda, - T** global_B_array, - int* global_ldb, - T** global_C_array, - int* global_ldc, - T* alpha) -{ - extern __shared__ __align__(sizeof(T)) unsigned char smem[]; - T* shared_mem = reinterpret_cast(smem); - - int batchid = blockIdx.z; - int local_M = (int)M[batchid]; - int local_N = (int)N[batchid]; - int local_K = (int)K[batchid]; - - if (blockIdx.x >= (local_M + BLK_M - 1) / BLK_M) - return; - if (blockIdx.y >= (local_N + BLK_N - 1) / BLK_N) - return; - - int shared_lda = BLK_M + 1; - int shared_ldb = BLK_K + 1; - T* shared_A = (T*)shared_mem; - T* shared_B = shared_A + shared_lda * BLK_K; - double alpha_tmp = 1.0; - if (alpha != nullptr) - { - alpha_tmp = alpha[batchid]; - } - vbatched_gemm_device(local_M, - local_N, - local_K, - global_A_array[batchid], - (int)global_lda[batchid], - global_B_array[batchid], - (int)global_ldb[batchid], - global_C_array[batchid], - (int)global_ldc[batchid], - shared_A, - shared_lda, - shared_B, - shared_ldb, - alpha_tmp); -} - -/** - * Performs a batched matrix multiplication using the vbatched_gemm_impl - * function. - * - * C = alpha * A * B + C - * @tparam T The data type of the matrices. - * @tparam DIM_X The number of threads in the x-dimension of each block. - * @tparam DIM_Y The number of threads in the y-dimension of each block. - * @tparam BLK_M The number of rows processed by each thread block. - * @tparam BLK_N The number of columns processed by each thread block. - * @tparam BLK_K The number of elements processed by each thread block along the - * K dimension. - * @tparam DIM_XA The number of threads in the x-dimension used for loading - * matrix A. - * @tparam DIM_YA The number of threads in the y-dimension used for loading - * matrix A. - * @tparam DIM_XB The number of threads in the x-dimension used for loading - * matrix B. - * @tparam DIM_YB The number of threads in the y-dimension used for loading - * matrix B. - * @param max_m The maximum number of rows in the matrices. - * @param max_n The maximum number of columns in the matrices. - * @param m An array of batch sizes for the number of rows in each matrix. - * @param n An array of batch sizes for the number of columns in each matrix. - * @param k An array of batch sizes for the number of elements in each matrix - * along the K dimension. - * @param global_A_array An array of pointers to the input matrices A. - * @param global_lda An array of leading dimensions for the input matrices A. - * @param global_B_array An array of pointers to the input matrices B. - * @param global_ldb An array of leading dimensions for the input matrices B. - * @param global_C_array An array of pointers to the output matrices C. - * @param global_ldc An array of leading dimensions for the output matrices C. - * @param batchCount The number of matrices in the batch. - * @param stream The CUDA stream to use for the computation. - * @param alpha The scalar value to multiply the matrices by (optional, default - * is nullptr). generate by copilot - */ - -/* - * Why do we need to implement our own matrix multiplication based on the magma - * code? There are two main reasons. First is when we are doing batch matrix - * multiplication, since we need to accumulate the results of the - * multiplications, it is necessary to pass the same memory address of matrix C - * to different multiplications. This way, the accumulation can be done directly - * through atomic operations during the matrix multiplication, avoiding the - * reduction operations after the multiplication. Secondly, when calculating the - * charge density, where C = alpha * A * B + C, the value of alpha might be - * different for the same batch of matrices. Using the standard matrix - * multiplication interface would require breaking down the batch matrix - * multiplication into smaller batches. In practice, it is difficult to - * accumulate a batch. - * - * Moreover, taking into account the specific requirements of our application, - * especially the fact that we can relatively easily control the arrangement of - * the matrix elements, we have only implemented one type of requirement for - * matrix transposition. That is, we have implemented the operation C = alpha * - * trans(A) * B + C under the constraint of column-major order. - * - * Finally, we would like to thank Magma for its contributions to the field of - * scientific computing. - */ - -template -void vbatched_gemm_impl(int max_m, - int max_n, - int* m, - int* n, - int* k, - T** global_A_array, - int* global_lda, - T** global_B_array, - int* global_ldb, - T** global_C_array, - int* global_ldc, - int batchCount, - cudaStream_t stream, - T* alpha = nullptr) -{ - // The positions of A and B have been swapped here. - // This is because the original code is for column-major matrices. - // We use row-major matrices, so we need to swap A and B. - // The vbatched_gemm_impl is for C = trans(A) * B + C, but we need trans(C). - // Which means: trans(C) = trans(trans(A)*B + C) = trans(B) * A + trans(C) - // Then, ldc should be N, lda and ldb should be K - - size_t shared_mem_size = 0; - shared_mem_size += (BLK_M + 1) * BLK_K * sizeof(T); - shared_mem_size += (BLK_K + 1) * BLK_N * sizeof(T); - dim3 dimBlock(DIM_X, DIM_Y); - const int max_batch_count = 32768; - const int loop_num = batchCount / max_batch_count; - const int remain_num = batchCount % max_batch_count; - - for (int i = 0; i < loop_num; ++i) - { - dim3 dimGrid(ceildiv(max_n, BLK_M), ceildiv(max_m, BLK_N), max_batch_count); - T* alpha_tmp = nullptr; - if (alpha != nullptr) - { - alpha_tmp = alpha + i * max_batch_count; - } - - vbatched_gemm_kernel - <<>>(n + i * max_batch_count, - m + i * max_batch_count, - k + i * max_batch_count, - global_B_array + i * max_batch_count, - global_ldb + i * max_batch_count, - global_A_array + i * max_batch_count, - global_lda + i * max_batch_count, - global_C_array + i * max_batch_count, - global_ldc + i * max_batch_count, - alpha_tmp); - checkCudaLastError(); - } - if (remain_num > 0) - { - dim3 dimGrid(ceildiv(max_n, BLK_M), ceildiv(max_m, BLK_N), remain_num); - T* alpha_tmp = nullptr; - if (alpha != nullptr) - { - alpha_tmp = alpha + loop_num * max_batch_count; - } - vbatched_gemm_kernel - <<>>(n + loop_num * max_batch_count, - m + loop_num * max_batch_count, - k + loop_num * max_batch_count, - global_B_array + loop_num * max_batch_count, - global_ldb + loop_num * max_batch_count, - global_A_array + loop_num * max_batch_count, - global_lda + loop_num * max_batch_count, - global_C_array + loop_num * max_batch_count, - global_ldc + loop_num * max_batch_count, - alpha_tmp); - checkCudaLastError(); - } -} - -template -void gemm_time_measure(int max_m, - int max_n, - int* m, - int* n, - int* k, - T** global_A_array, - int* global_lda, - T** global_B_array, - int* global_ldb, - T** global_C_array, - int* global_ldc, - int batchCount, - cudaStream_t stream, - float& fast_time, - matrix_multiple_func_type& fastest_algo, - double* cpu_result, - double* h_global_C, - double* d_global_C) -{ - cudaEvent_t start, stop; - checkCuda(cudaMemset(d_global_C, 0, batchCount * max_m * max_n * sizeof(double))); - checkCuda(cudaEventCreate(&start)); - checkCuda(cudaEventCreate(&stop)); - checkCuda(cudaEventRecord(start, stream)); - vbatched_gemm_impl(max_m, - max_n, - m, - n, - k, - global_A_array, - global_lda, - global_B_array, - global_ldb, - global_C_array, - global_ldc, - batchCount, - stream); - checkCuda(cudaEventRecord(stop, stream)); - cudaError_t cuda_status = cudaGetLastError(); - checkCuda(cudaStreamSynchronize(stream)); - float milliseconds = 0; - checkCuda(cudaEventElapsedTime(&milliseconds, start, stop)); - - // WARNING !!!!! Here we assume that all m and n are the same - checkCuda(cudaMemcpy(h_global_C, d_global_C, batchCount * max_m * max_n * sizeof(double), cudaMemcpyDeviceToHost)); - bool check_result = true; - for (int i = 0; i < batchCount * max_m * max_n; ++i) - { - if (abs(cpu_result[i] - h_global_C[i]) > 0.001) - { - check_result = false; - break; - } - } - if (milliseconds < fast_time && cuda_status == cudaSuccess && check_result) - { - fast_time = milliseconds; - fastest_algo = vbatched_gemm_impl; -#ifdef __DEBUG - std::cout << "found! fastest time: " << fast_time << std::endl; - std::cout << DIM_X << "," << DIM_Y << "," << BLK_M << "," << BLK_N << "," << BLK_K << "," << DIM_XA << "," - << DIM_YA << "," << DIM_XB << "," << DIM_YB << std::endl; -#endif - } -} -#endif // VBATCH_MATRIX_MUL_CUH \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/mult_psi_dmr.cpp b/source/module_hamilt_lcao/module_gint/mult_psi_dmr.cpp deleted file mode 100644 index aeb6e2f6cb..0000000000 --- a/source/module_hamilt_lcao/module_gint/mult_psi_dmr.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "gint_tools.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "source_base/blas_connector.h" - -namespace Gint_Tools{ - -void mult_psi_DMR( - const Grid_Technique& gt, - const int bxyz, - const int LD_pool, - const int &grid_index, - const int &na_grid, - const int*const block_index, - const int*const block_size, - const bool*const*const cal_flag, - const double*const*const psi, - double*const*const psi_DMR, - const hamilt::HContainer*const DM, - const bool if_symm) -{ - const UnitCell& ucell = *gt.ucell; - - // parameters for lapack subroutines - constexpr char side = 'L'; - constexpr char uplo = 'U'; - const char trans = 'N'; - const double alpha = 1.0; - const double beta = 1.0; - const double alpha1 = if_symm ? 2.0 : 1.0; - - for (int ia1 = 0; ia1 < na_grid; ia1++) - { - const int bcell1 = gt.bcell_start[grid_index] + ia1; - const int iat1 = gt.which_atom[bcell1]; - - //! get cell R1, this step is redundant in gamma_only case. - const int id1 = gt.which_unitcell[bcell1]; - const ModuleBase::Vector3 r1 = gt.get_ucell_coords(id1); - - //! density - if (if_symm) - { - //! ia2==ia1 - const auto tmp_matrix = DM->find_matrix(iat1, iat1, 0, 0, 0); - - //! maybe checking "tmp_matrix == nullptr" is not necessary - if(tmp_matrix == nullptr) - { - continue; - } - - const auto cal_info = Gint_Tools::cal_info(bxyz, ia1, ia1, cal_flag); - const int ib_start = cal_info.first; - const int ib_len = cal_info.second; - - if(ib_len == 0) - { - continue; - } - - const auto tmp_matrix_ptr = tmp_matrix->get_pointer(); - const int idx1 = block_index[ia1]; - BlasConnector::symm_cm(side, uplo, block_size[ia1], ib_len, alpha, tmp_matrix_ptr, block_size[ia1], - &psi[ib_start][idx1], LD_pool, beta, &psi_DMR[ib_start][idx1], LD_pool); - } - - //! get (j,beta,R2) - const int start = if_symm ? ia1 + 1 : 0; - - for (int ia2 = start; ia2 < na_grid; ia2++) - { - const int bcell2 = gt.bcell_start[grid_index] + ia2; - const int iat2 = gt.which_atom[bcell2]; - const int id2 = gt.which_unitcell[bcell2]; - - //! get cell R2, this step is redundant in gamma_only case. - const ModuleBase::Vector3 r2 = gt.get_ucell_coords(id2); - - // get AtomPair - const auto tmp_matrix = DM->find_matrix(iat1, iat2, r1-r2); - if (tmp_matrix == nullptr) - { - continue; - } - const auto tmp_matrix_ptr = tmp_matrix->get_pointer(); - - const auto cal_info = Gint_Tools::cal_info(bxyz, ia1, ia1, cal_flag); - const int ib_start = cal_info.first; - const int ib_len = cal_info.second; - if(ib_len == 0) - { - continue; - } - const int idx1 = block_index[ia1]; - const int idx2 = block_index[ia2]; - - dgemm_(&trans, &trans, &block_size[ia2], &ib_len, &block_size[ia1], &alpha1, tmp_matrix_ptr, &block_size[ia2], - &psi[ib_start][idx1], &LD_pool, &beta, &psi_DMR[ib_start][idx2], &LD_pool); - - } // ia2 - } // ia1 -}// End of mult_psi_DMR - -}// End of Gint_Tools diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.cpp deleted file mode 100644 index 8372506e46..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "batch_biggrid.h" - -namespace ModuleGint -{ - -int BatchBigGrid::max_batch_size_ = 0; -int BatchBigGrid::max_atoms_num_ = 0; -int BatchBigGrid::max_phi_len_ = 0; -int BatchBigGrid::max_atom_pairs_num_ = 0; - -BatchBigGrid::BatchBigGrid(std::vector> biggrids) -{ - biggrids_ = biggrids; - max_batch_size_ = std::max(max_batch_size_, (int)biggrids_.size()); - int atom_pairs_num = 0; - for(const auto& biggrid : biggrids_) - { - for(const auto& atom: biggrid->get_atoms()) - { - max_nw_ = std::max(max_nw_, atom->get_nw()); - } - max_atoms_num_per_bgrid_ = std::max(max_atoms_num_per_bgrid_, biggrid->get_atoms_num()); - atoms_num_ += biggrid->get_atoms_num(); - atom_pairs_num += std::pow(biggrid->get_atoms_num(), 2); - phi_len_ += biggrid->get_phi_len() * biggrid->get_mgrids_num(); - } - max_atoms_num_ = std::max(max_atoms_num_, atoms_num_); - max_phi_len_ = std::max(max_phi_len_, phi_len_); - max_atom_pairs_num_ = std::max(max_atom_pairs_num_, atom_pairs_num); -} - - - -} diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.h b/source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.h deleted file mode 100644 index d4de77d1db..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once -#include -#include -#include "big_grid.h" - -namespace ModuleGint -{ - -class BatchBigGrid -{ - public: - BatchBigGrid(std::vector> biggrids); - - const std::vector>& get_bgrids() { return biggrids_; } - - int get_batch_size() const { return biggrids_.size(); } - int get_atoms_num() const { return atoms_num_; } - int get_phi_len() const { return phi_len_;} - int get_max_atoms_num_per_bgrid() const { return max_atoms_num_per_bgrid_; } - bool empty() {return atoms_num_ == 0; } - static int get_max_batch_size() { return max_batch_size_; } - static int get_max_atoms_num() { return max_atoms_num_; } - static int get_max_phi_len() { return max_phi_len_; } - static int get_max_atom_pairs_num() { return max_atom_pairs_num_; } - static std::shared_ptr get_bgrid_info() { return BigGrid::get_bgrid_info(); } - - private: - std::vector> biggrids_; - - // the max nw of an atom - int max_nw_ = 0; - - int phi_len_ = 0; - // number of atoms in the batch - int atoms_num_ = 0; - - // the max number of atoms of a single biggrid - int max_atoms_num_per_bgrid_ = 0; - - // the max number of biggrids of a biggrids batch - static int max_batch_size_; - // the max number of total atoms of a biggrids batch - static int max_atoms_num_; - // the max number of total wavefunctions of a biggrids batch - static int max_phi_len_; - // the max number of atom pairs of a biggrids batch - static int max_atom_pairs_num_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/big_grid.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/big_grid.cpp deleted file mode 100644 index e20a0fb50a..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/big_grid.cpp +++ /dev/null @@ -1,118 +0,0 @@ -#include "big_grid.h" - -namespace ModuleGint -{ -std::shared_ptr BigGrid::localcell_info_ = nullptr; -std::shared_ptr BigGrid::unitcell_info_ = nullptr; -std::shared_ptr BigGrid::biggrid_info_ = nullptr; - -BigGrid::BigGrid(int idx): idx_(idx){} - -void BigGrid::add_atom(const GintAtom* atom) -{ - atoms_.push_back(atom); -} - -int BigGrid::get_phi_len() const -{ - int len = 0; - for(const auto& atom : atoms_) - { - len += atom->get_nw(); - } - return len; -} - -void BigGrid::set_atoms_startidx(std::vector& startidx) const -{ - startidx.resize(atoms_.size()); - startidx[0] = 0; - for(int i = 1; i < atoms_.size(); ++i) - { - startidx[i] = startidx[i-1] + atoms_[i-1]->get_nw(); - } -} - -void BigGrid::set_atoms_phi_len(std::vector& phi_len) const -{ - phi_len.resize(atoms_.size()); - for(int i = 0; i < atoms_.size(); ++i) - { - phi_len[i] = atoms_[i]->get_nw(); - } -} - -void BigGrid::set_mgrids_coord(std::vector& coord) const -{ - coord.resize(biggrid_info_->get_mgrids_num()); - Vec3d this_bgrid_coord = localcell_info_->get_bgrid_global_coord_3D(idx_); - for(int im = 0; im < biggrid_info_->get_mgrids_num(); ++im) - { - coord[im] = biggrid_info_->get_mgrid_coord(im) + this_bgrid_coord; - } -} - -void BigGrid::set_mgrids_local_idx(std::vector& mgrids_idx) const -{ - auto index_3d = localcell_info_->bgrid_idx_1Dto3D(idx_); - Vec3i startidx( - index_3d.x * biggrid_info_->get_nmx(), - index_3d.y * biggrid_info_->get_nmy(), - index_3d.z * biggrid_info_->get_nmz()); - mgrids_idx.resize(0); - for(int ix = 0; ix < biggrid_info_->get_nmx(); ++ix) - { - for(int iy = 0; iy < biggrid_info_->get_nmy(); ++iy) - { - for(int iz = 0; iz < biggrid_info_->get_nmz(); ++iz) - { - Vec3i idx_3d(startidx.x + ix, startidx.y + iy, startidx.z + iz); - mgrids_idx.push_back(localcell_info_->mgrid_idx_3Dto1D(idx_3d)); - } - } - } -} - -void BigGrid::set_atom_relative_coords(const GintAtom* atom, std::vector& atom_coord) const -{ - set_atom_relative_coords(atom->get_bgrid_idx(), atom->get_tau_in_bgrid(), atom_coord); -} - -void BigGrid::set_atom_relative_coords(const Vec3i bgrid_idx, const Vec3d tau_in_bgrid, std::vector& atom_coord) const -{ - Vec3i this_bgrid_idx = localcell_info_->get_bgrid_global_idx_3D(idx_); - - // the relative coordinates of this big grid and the atom - Vec3d bgrid_relative_coord - = unitcell_info_->get_relative_coord(bgrid_idx, this_bgrid_idx) + tau_in_bgrid; - - atom_coord.resize(biggrid_info_->get_mgrids_num()); - for(int im = 0; im < biggrid_info_->get_mgrids_num(); ++im) - { - const Vec3d& mgrid_coord = biggrid_info_->get_mgrid_coord(im); - atom_coord[im] = mgrid_coord - bgrid_relative_coord; - } -} - -Vec3d BigGrid::get_bgrid_atom_rcoord(const GintAtom* atom) const -{ - Vec3i this_bgrid_idx = localcell_info_->get_bgrid_global_idx_3D(idx_); - return unitcell_info_->get_relative_coord(atom->get_bgrid_idx(), this_bgrid_idx) + atom->get_tau_in_bgrid(); -} - - -bool BigGrid::is_atom_on_bgrid(const GintAtom* atom) const -{ - std::vector coords; - this->set_atom_relative_coords(atom, coords); - for(const auto& dist : coords) - { - if(dist.norm() <= atom->get_rcut()) - { - return true; - } - } - return false; -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/big_grid.h b/source/module_hamilt_lcao/module_gint/temp_gint/big_grid.h deleted file mode 100644 index 55bed7a251..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/big_grid.h +++ /dev/null @@ -1,95 +0,0 @@ -#pragma once - -#include -#include -#include "gint_type.h" -#include "biggrid_info.h" -#include "localcell_info.h" -#include "unitcell_info.h" -#include "gint_atom.h" - -namespace ModuleGint -{ - -class BigGrid -{ - public: - // constructor - BigGrid(int idx); - - static void init_localcell_info(std::shared_ptr localcell_info) { localcell_info_ = localcell_info; } - static void init_unitcell_info(std::shared_ptr unitcell_info) { unitcell_info_ = unitcell_info; } - static void init_bgrid_info(std::shared_ptr biggrid_info) { biggrid_info_ = biggrid_info; } - - // getter functions - int get_idx() const { return idx_; } - static std::shared_ptr get_localcell_info() { return localcell_info_; } - static std::shared_ptr get_unitcell_info() { return unitcell_info_; } - static std::shared_ptr get_bgrid_info() { return biggrid_info_; } - const std::vector& get_atoms() const { return atoms_; } - const GintAtom* get_atom(int i) const { return atoms_[i]; } - - // get the number of meshgrids in the big grid - int get_mgrids_num() const { return biggrid_info_->get_mgrids_num(); } - - // get the number of atoms that can affect the big grid - int get_atoms_num() const { return atoms_.size(); } - - // add an atom to the big grid - void add_atom(const GintAtom* atom); - - // get the total number of phi of a meshgrid - // return: (\sum_{i=0}^{atoms_->size()} atoms_[i]->nw) - int get_phi_len() const; - - // set the start index of the phi of each atom - // return: vector[i] = \sum_{j=0}^{i-1} atoms_[j]->nw - void set_atoms_startidx(std::vector& startidx) const; - - // set the length of phi of each atom - void set_atoms_phi_len(std::vector& phi_len) const; - - // set the coordinates of the meshgrids of the big grid - void set_mgrids_coord(std::vector& coord) const; - - // set the 1D index of the meshgrids in the local cell - void set_mgrids_local_idx(std::vector& mgrids_idx) const; - - // a wrapper function to get the relative coordinates of the atom and the meshgrids - void set_atom_relative_coords(const GintAtom* atom, std::vector& atom_coord) const; - - /** - * @brief Set the coordinates of the meshgrids of the big grid relative to an atom - * - * @param bgrid_idx the 3D index of the big grid, which contains the atom, in the unitcell - * @param tau_in_bgrid the cartesian coordinate of the atom relative to the big grid containing it - * @param atom_coord the relative cartesian coordinates of the atom and the meshgrids - */ - void set_atom_relative_coords(const Vec3i bgrid_idx, const Vec3d tau_in_bgrid, std::vector& atom_coord) const; - - // get the relative coords of the atom and the biggrid (used in gpu code) - Vec3d get_bgrid_atom_rcoord(const GintAtom* atom) const; - - // if the atom affects the big grid, return true, otherwise false - // note when we say an atom affects a big grid, it does not mean that the atom affects all the meshgrid on the big grid, - // it may only affect a part of them. - bool is_atom_on_bgrid(const GintAtom* atom) const; - - private: - // atoms that can affect the big grid - std::vector atoms_; - - // the 1D index of the big grid in the local cell - const int idx_; - - // local cell info - static std::shared_ptr localcell_info_; - - // unitcell info - static std::shared_ptr unitcell_info_; - - // the big grid info - static std::shared_ptr biggrid_info_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.cpp deleted file mode 100644 index f69a7ef0ec..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "biggrid_info.h" -#include "gint_helper.h" -#include "gint_type.h" - -namespace ModuleGint -{ - -BigGridInfo::BigGridInfo( - Vec3d biggrid_vec1, - Vec3d biggrid_vec2, - Vec3d biggrid_vec3, - int nmx, int nmy, int nmz) - : biggrid_vec1_(biggrid_vec1), - biggrid_vec2_(biggrid_vec2), - biggrid_vec3_(biggrid_vec3), - nmx_(nmx), nmy_(nmy), nmz_(nmz), nmxyz_(nmx*nmy*nmz) - { - // initialize the biggrid_latvec0_ - biggrid_latvec0_.e11 = biggrid_vec1_.x; - biggrid_latvec0_.e12 = biggrid_vec1_.y; - biggrid_latvec0_.e13 = biggrid_vec1_.z; - - biggrid_latvec0_.e21 = biggrid_vec2_.x; - biggrid_latvec0_.e22 = biggrid_vec2_.y; - biggrid_latvec0_.e23 = biggrid_vec2_.z; - - biggrid_latvec0_.e31 = biggrid_vec3_.x; - biggrid_latvec0_.e32 = biggrid_vec3_.y; - biggrid_latvec0_.e33 = biggrid_vec3_.z; - - // initialize the GT matrix - biggrid_GT_ = biggrid_latvec0_.Inverse(); - - // initialize the meshgrid_info_ - meshgrid_info_ = std::make_shared( - biggrid_vec1_ / static_cast(nmx), - biggrid_vec2_ / static_cast(nmy), - biggrid_vec3_ / static_cast(nmz)); - - // initialize the meshgrid_coords_ - meshgrid_coords_.resize(nmxyz_); - for(int index_1d = 0; index_1d < nmxyz_; index_1d++) - { - meshgrid_coords_[index_1d] = - meshgrid_info_->get_cartesian_coord(mgrid_idx_1Dto3D(index_1d)); - } - } - - Vec3i BigGridInfo::max_ext_bgrid_num(double r) const - { - const double g1 = sqrt(biggrid_GT_.e11 * biggrid_GT_.e11 - + biggrid_GT_.e21 * biggrid_GT_.e21 - + biggrid_GT_.e31 * biggrid_GT_.e31); - const double g2 = sqrt(biggrid_GT_.e12 * biggrid_GT_.e12 - + biggrid_GT_.e22 * biggrid_GT_.e22 - + biggrid_GT_.e32 * biggrid_GT_.e32); - const double g3 = sqrt(biggrid_GT_.e13 * biggrid_GT_.e13 - + biggrid_GT_.e23 * biggrid_GT_.e23 - + biggrid_GT_.e33 * biggrid_GT_.e33); - int ext_x = static_cast(r * g1) + 1; - int ext_y = static_cast(r * g2) + 1; - int ext_z = static_cast(r * g3) + 1; - return Vec3i(ext_x, ext_y, ext_z); - } - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.h b/source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.h deleted file mode 100644 index c017f87a3d..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/biggrid_info.h +++ /dev/null @@ -1,99 +0,0 @@ -#pragma once - -#include -#include "gint_type.h" -#include "gint_helper.h" -#include "meshgrid_info.h" - -namespace ModuleGint -{ - -/** - * @class BigGridInfo - * @brief This class stores some basic properties common to all big grids. - */ -class BigGridInfo -{ - public: - // constructor - BigGridInfo( - Vec3d biggrid_vec1, - Vec3d biggrid_vec2, - Vec3d biggrid_vec3, - int nmx, int nmy, int nmz); - - Vec3d get_cartesian_coord(const Vec3d& index_3d) const { return index_3d * biggrid_latvec0_; } - Vec3d get_cartesian_coord(const Vec3i& index_3d) const { return index_3d * biggrid_latvec0_; } - Vec3d get_direct_coord(const Vec3d& cart_coord) const { return cart_coord * biggrid_GT_; } - - // Return the maximum number of big grids that can fit inside a sphere of radius r, - // along the three lattice vector directions. - Vec3i max_ext_bgrid_num(double r) const; - - // get number of meshgrids along three lattice directions - int get_nmx() const { return nmx_; } - int get_nmy() const { return nmy_; } - int get_nmz() const { return nmz_; } - int get_mgrids_num() const { return nmxyz_; } - - const std::vector& get_mgrids_coord() const { return meshgrid_coords_; } - const Vec3d& get_mgrid_coord(int index_1d) const { return meshgrid_coords_[index_1d]; } - - std::shared_ptr get_mgrid_info() const { return meshgrid_info_; } - - // get the 3D index of a meshgrid in the big grid from the 1D index - Vec3i mgrid_idx_1Dto3D(int index_1d) const - { - return index1Dto3D(index_1d, nmx_, nmy_, nmz_); - } - - // get the 1D index of a meshgrid in the big grid from the 3D index - int mgrid_idx_3Dto1D(const Vec3i index_3d) const - { - return index3Dto1D(index_3d.x, index_3d.y, index_3d.z, nmx_, nmy_, nmz_); - } - - private: - // basis vectors of the big grid - Vec3d biggrid_vec1_; - Vec3d biggrid_vec2_; - Vec3d biggrid_vec3_; - - // used to convert the (i, j, k) index of the big grid to the Cartesian coordinate - // if biggrid_vec1_ is row vector, - // then biggrid_latvec0_ = [biggrid_vec1_; biggrid_vec2_; biggrid_vec3_], - // (i, j, k) * biggrid_latvec0_ = (x, y, z) - Matrix3 biggrid_latvec0_; - - // used to convert the Cartesian coordinate to the (i, j, k) index of the big grid - // biggrid_GT_ = biggrid_latvec0_.Inverse() - // (x, y, z) * biggrid_GT_ = (i, j, k) - Matrix3 biggrid_GT_; - - //====================================================== - // some member variables related to meshgrid - //====================================================== - - // basic attributes of meshgrid - std::shared_ptr meshgrid_info_; - - // the number of meshgrids of a biggrid along the first basis vector - // nmx may be a confusing name, because it is not the number of meshgrids along x axis - // but it's used in the original code, so I keep it, maybe it will be changed later - int nmx_; - - // the number of meshgrids of a biggrid along the second basis vector - int nmy_; - - // the number of meshgrids of a biggrid along the third basis vector - int nmz_; - - // total number of meshgrids in the biggrid - int nmxyz_; - - // store the relative Cartesian coordinates of all meshgrids in the biggrid - // the size of vector is nbxyz_ - std::vector meshgrid_coords_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/divide_info.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/divide_info.cpp deleted file mode 100644 index c4a5b2a738..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/divide_info.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "divide_info.h" - -namespace ModuleGint -{ - -DivideInfo::DivideInfo( - int startidx_bx_old, int startidx_by_old, int startidx_bz_old, - int nbx_old, int nby_old, int nbz_old, - std::shared_ptr unitcell_info, bool is_redevided) - : startidx_bx_old_(startidx_bx_old), startidx_by_old_(startidx_by_old), startidx_bz_old_(startidx_bz_old), - nbx_old_(nbx_old), nby_old_(nby_old), nbz_old_(nbz_old), - startidx_bx_new_(startidx_bx_old), startidx_by_new_(startidx_by_old), startidx_bz_new_(startidx_bz_old), - nbx_new_(nbx_old), nby_new_(nby_old), nbz_new_(nbz_old), - unitcell_info_(unitcell_info), is_redivided_(is_redevided) - { - if(!is_redivided_) - { - localcell_info_ = std::make_shared(startidx_bx_new_, startidx_by_new_, startidx_bz_new_, - nbx_new_, nby_new_, nbz_new_, unitcell_info_); - } - // TODO: "implement the redivide function"; - } - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/divide_info.h b/source/module_hamilt_lcao/module_gint/temp_gint/divide_info.h deleted file mode 100644 index 374831eeef..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/divide_info.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include "biggrid_info.h" -#include "unitcell_info.h" -#include "localcell_info.h" - -namespace ModuleGint -{ - -class DivideInfo -{ - public: - // constructor - DivideInfo( - int startidx_bx_old, int startidx_by_old, int startidx_bz_old, - int nbx_old, int nby_old, int nbz_old, - std::shared_ptr unitcell_info, bool is_redivided = false); - - // getter functions - std::shared_ptr get_localcell_info() const { return localcell_info_; } - bool get_is_redivided() const { return is_redivided_; } - - private: - // if the grid is redivided, is_redeiided_ is true - bool is_redivided_; - - // the old start index of the local cell - int startidx_bx_old_; - int startidx_by_old_; - int startidx_bz_old_; - - // the old number of big grids in the local cell - int nbx_old_; - int nby_old_; - int nbz_old_; - - // the new start index of the local cell - int startidx_bx_new_; - int startidx_by_new_; - int startidx_bz_new_; - - // the new number of big grids in the local cell - int nbx_new_; - int nby_new_; - int nbz_new_; - - // the unitcell info - std::shared_ptr unitcell_info_; - - // the localcell info - std::shared_ptr localcell_info_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint.cpp deleted file mode 100644 index d7de110f24..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "gint.h" - -namespace ModuleGint -{ - -GintInfo* Gint::gint_info_ = nullptr; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint.h deleted file mode 100644 index 1255bae971..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -#include -#include "gint_info.h" -#include "gint_type.h" - -namespace ModuleGint -{ - -class Gint -{ - public: - Gint() = default; - virtual ~Gint() = default; - - // note that gint_info_ is a static member variable - // it is shared by all instances of Gint - static void set_gint_info(GintInfo* gint_info) - { - gint_info_ = gint_info; - } - - protected: - static GintInfo* gint_info_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.cpp deleted file mode 100644 index 7121694244..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.cpp +++ /dev/null @@ -1,197 +0,0 @@ -#include "source_base/ylm.h" -#include "source_base/array_pool.h" -#include "gint_atom.h" -#include "source_cell/unitcell.h" -#include "gint_helper.h" - -namespace ModuleGint -{ -GintAtom::GintAtom( - const Atom* atom, - int it, int ia, int iat, - Vec3i biggrid_idx, - Vec3i unitcell_idx, - Vec3d tau_in_biggrid, - const Numerical_Orbital* orb, - const UnitCell* ucell) -: atom_(atom), it_(it), ia_(ia), iat_(iat), biggrid_idx_(biggrid_idx), - unitcell_idx_(unitcell_idx), tau_in_biggrid_(tau_in_biggrid), - orb_(orb), ucell_(ucell) -{ - p_psi_uniform_.resize(atom_->nw); - p_dpsi_uniform_.resize(atom_->nw); - p_ddpsi_uniform_.resize(atom_->nw); - for (int iw=0; iw < atom_->nw; ++iw) - { - if ( atom_->iw2_new[iw] ) - { - int l = atom_->iw2l[iw]; - int n = atom_->iw2n[iw]; - p_psi_uniform_[iw] = orb_->PhiLN(l, n).psi_uniform.data(); - p_dpsi_uniform_[iw] = orb_->PhiLN(l, n).dpsi_uniform.data(); - p_ddpsi_uniform_[iw] = orb_->PhiLN(l, n).ddpsi_uniform.data(); - } - } -} - -template -void GintAtom::set_phi(const std::vector& coords, const int stride, T* phi) const -{ - const int num_mgrids = coords.size(); - - // orb_ does not have the member variable dr_uniform - const double dr_uniform = orb_->PhiLN(0, 0).dr_uniform; - - // store the spherical harmonics - // it's outside the loop to reduce the vector allocation overhead - std::vector ylma; - - for(int im = 0; im < num_mgrids; im++) - { - const Vec3d& coord = coords[im]; - // 1e-9 is to avoid division by zero - const double dist = coord.norm() < 1e-9 ? 1e-9 : coord.norm(); - if(dist > orb_->getRcut()) - { - // if the distance is larger than the cutoff radius, - // the wave function values are all zeros - ModuleBase::GlobalFunc::ZEROS(phi + im * stride, atom_->nw); - } - else - { - // spherical harmonics - // TODO: vectorize the sph_harm function, - // the vectorized function can be called once for all meshgrids in a biggrid - ModuleBase::Ylm::sph_harm(atom_->nwl, coord.x/dist, coord.y/dist, coord.z/dist, ylma); - // interpolation - - // these parameters are related to interpolation - // because once the distance from atom to grid point is known, - // we can obtain the parameters for interpolation and - // store them first! these operations can save lots of efforts. - const double position = dist / dr_uniform; - const int ip = static_cast(position); - const double dx = position - ip; - const double dx2 = dx * dx; - const double dx3 = dx2 * dx; - - const double c3 = 3.0 * dx2 - 2.0 * dx3; - const double c1 = 1.0 - c3; - const double c2 = (dx - 2.0 * dx2 + dx3) * dr_uniform; - const double c4 = (dx3 - dx2) * dr_uniform; - - // I'm not sure if the variable name 'psi' is appropriate - double psi = 0; - - for(int iw = 0; iw < atom_->nw; iw++) - { - if(atom_->iw2_new[iw]) - { - auto psi_uniform = p_psi_uniform_[iw]; - auto dpsi_uniform = p_dpsi_uniform_[iw]; - psi = c1 * psi_uniform[ip] + c2 * dpsi_uniform[ip] - + c3 * psi_uniform[ip + 1] + c4 * dpsi_uniform[ip + 1]; - } - phi[im * stride + iw] = psi * ylma[atom_->iw2_ylm[iw]]; - } - } - } -} - -template -void GintAtom::set_phi_dphi( - const std::vector& coords, const int stride, - T* phi, T* dphi_x, T* dphi_y, T* dphi_z) const -{ - const int num_mgrids = coords.size(); - - // orb_ does not have the member variable dr_uniform - const double dr_uniform = orb_->PhiLN(0, 0).dr_uniform; - - std::vector rly(std::pow(atom_->nwl + 1, 2)); - // TODO: replace array_pool with std::vector - ModuleBase::Array_Pool grly(std::pow(atom_->nwl + 1, 2), 3); - - for(int im = 0; im < num_mgrids; im++) - { - const Vec3d& coord = coords[im]; - // 1e-9 is to avoid division by zero - const double dist = coord.norm() < 1e-9 ? 1e-9 : coord.norm(); - - if(dist > orb_->getRcut()) - { - // if the distance is larger than the cutoff radius, - // the wave function values are all zeros - if(phi != nullptr) - { - ModuleBase::GlobalFunc::ZEROS(phi + im * stride, atom_->nw); - } - ModuleBase::GlobalFunc::ZEROS(dphi_x + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(dphi_y + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(dphi_z + im * stride, atom_->nw); - } - else - { - // spherical harmonics - // TODO: vectorize the sph_harm function, - // the vectorized function can be called once for all meshgrids in a biggrid - ModuleBase::Ylm::grad_rl_sph_harm(atom_->nwl, coord.x, coord.y, coord.z, rly.data(), grly.get_ptr_2D()); - - // interpolation - const double position = dist / dr_uniform; - const int ip = static_cast(position); - const double x0 = position - ip; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - - double tmp, dtmp; - for(int iw = 0; iw < atom_->nw; ++iw) - { - // this is a new 'l', we need 1D orbital wave - // function from interpolation method. - if(atom_->iw2_new[iw]) - { - auto psi_uniform = p_psi_uniform_[iw]; - auto dpsi_uniform = p_dpsi_uniform_[iw]; - // use Polynomia Interpolation method to get the - // wave functions - - tmp = x12 * (psi_uniform[ip] * x3 + psi_uniform[ip + 3] * x0) - + x03 * (psi_uniform[ip + 1] * x2 - psi_uniform[ip + 2] * x1); - - dtmp = x12 * (dpsi_uniform[ip] * x3 + dpsi_uniform[ip + 3] * x0) - + x03 * (dpsi_uniform[ip + 1] * x2 - dpsi_uniform[ip + 2] * x1); - } // new l is used. - - // get the 'l' of this localized wave function - const int ll = atom_->iw2l[iw]; - const int idx_lm = atom_->iw2_ylm[iw]; - - const double rl = pow_int(dist, ll); - const double tmprl = tmp / rl; - - // 3D wave functions - if(phi != nullptr) - { - phi[im * stride + iw] = tmprl * rly[idx_lm]; - } - - // derivative of wave functions with respect to atom positions. - const double tmpdphi_rly = (dtmp - tmp * ll / dist) / rl * rly[idx_lm] / dist; - - dphi_x[im * stride + iw] = tmpdphi_rly * coord.x + tmprl * grly[idx_lm][0]; - dphi_y[im * stride + iw] = tmpdphi_rly * coord.y + tmprl * grly[idx_lm][1]; - dphi_z[im * stride + iw] = tmpdphi_rly * coord.z + tmprl * grly[idx_lm][2]; - } - } - } -} - -// explicit instantiation -template void GintAtom::set_phi(const std::vector& coords, const int stride, double* phi) const; -template void GintAtom::set_phi(const std::vector& coords, const int stride, std::complex* phi) const; -template void GintAtom::set_phi_dphi(const std::vector& coords, const int stride, double* phi, double* dphi_x, double* dphi_y, double* dphi_z) const; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.h deleted file mode 100644 index aff8aae5b9..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_atom.h +++ /dev/null @@ -1,122 +0,0 @@ -#pragma once - -#include "source_cell/atom_spec.h" -#include "source_basis/module_ao/ORB_atomic.h" -#include "gint_type.h" - -namespace ModuleGint -{ - -class GintAtom -{ - public: - // constructor - GintAtom( - const Atom* atom, - int it, int ia, int iat, - Vec3i biggrid_idx, - Vec3i unitcell_idx, - Vec3d tau_in_biggrid, - const Numerical_Orbital* orb, - const UnitCell* ucell); - - // getter functions - const Atom* get_atom() const { return atom_; } - int get_ia() const { return ia_; } - int get_iat() const { return iat_; } - int get_start_iw() const { return ucell_->itiaiw2iwt(it_, ia_, 0); } // get the start index of global atomic orbitals - const Vec3i& get_bgrid_idx() const { return biggrid_idx_; } - const Vec3i& get_unitcell_idx() const { return unitcell_idx_; } - const Vec3i& get_R() const { return unitcell_idx_; } - const Vec3d& get_tau_in_bgrid() const { return tau_in_biggrid_; } - const Numerical_Orbital* get_orb() const { return orb_; } - - int get_nw() const { return atom_->nw; } - double get_rcut() const { return orb_->getRcut(); } - - /** - * @brief Get the wave function values of the atom at a meshgrid. - * - * phi[(n-1)*stride] ~ phi[(n-1)*stride + nw] store the wave function values of the first atom at the nth meshgrid - * - * @param coords the cartesian coordinates of the meshgrids of a biggrid relative to the atom - * @param stride the stride of the phi array between two adjacent meshgrids - * @param phi array to store the wave function values - */ - template - void set_phi(const std::vector& coords, const int stride, T* phi) const; - - /** - * @brief Get the wave function values and its derivative - * - * The reason for combining the functions to solve the wave function values - * and wave function derivatives into one function is to improve efficiency. - * phi[(n-1)*stride] ~ phi[(n-1)*stride + nw] store the wave function values of the first atom at the nth meshgrid - * - * @param coords the cartesian coordinates of the meshgrids of a biggrid relative to the atom - * @param stride the stride of the phi array between two adjacent meshgrids - * @param phi array to store the wave function values - * @param dphi_x array to store the derivative wave functions in x direction - * @param dphi_y array to store the derivative wave functions in y direction - * @param dphi_z array to store the derivative wave functions in z direction - */ - template - void set_phi_dphi( - const std::vector& coords, const int stride, - T* phi, T* dphi_x, T* dphi_y, T* dphi_z) const; - - /** - * @brief Get the wave function values and its second derivative - * - * ddphi[(n-1)*stride] ~ ddphi[(n-1)*stride + nw] store the second derivative of - * wave function values of the atom at the first meshgrid - * - * @param coords the cartesian coordinates of the meshgrids of a biggrid relative to the atom - * @param stride the stride of the phi array between two adjacent meshgrids - * @param ddphi_xx array to store the second derivative wave functions in xx direction - * @param ddphi_xy array to store the second derivative wave functions in xy direction - * @param ddphi_xz array to store the second derivative wave functions in xz direction - * @param ddphi_yy array to store the second derivative wave functions in yy direction - * @param ddphi_yz array to store the second derivative wave functions in yz direction - * @param ddphi_zz array to store the second derivative wave functions in zz direction - */ - template - void set_ddphi( - const std::vector& coords, const int stride, - T* ddphi_xx, T* ddphi_xy, T* ddphi_xz, - T* ddphi_yy, T* ddphi_yz, T* ddphi_zz) const; - - private: - // the atom object - const Atom* atom_; - - // the global index of the atom type - int it_; - - // the global index of the atom among the same type of atoms - int ia_; - - // the global index of the atom - int iat_; - - // the index of big grid which contains this atom - Vec3i biggrid_idx_; - - // the index of the unitcell which contains this atom - Vec3i unitcell_idx_; - - // the relative Cartesian coordinates of this atom - // with respect to the big grid that contains it - Vec3d tau_in_biggrid_; - - // the numerical orbitals of this atom - const Numerical_Orbital* orb_; - - const UnitCell* ucell_; - - std::vector p_psi_uniform_; - std::vector p_dpsi_uniform_; - std::vector p_ddpsi_uniform_; -}; - -} // namespace ModuleGint diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_common.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_common.cpp deleted file mode 100644 index 39b63191e7..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_common.cpp +++ /dev/null @@ -1,343 +0,0 @@ -#include "gint_common.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "module_parameter/parameter.h" - -#ifdef __MPI -#include "source_base/blacs_connector.h" -#include -#endif - -namespace ModuleGint -{ - -void compose_hr_gint(HContainer& hr_gint) -{ - ModuleBase::TITLE("Gint", "compose_hr_gint"); - ModuleBase::timer::tick("Gint", "compose_hr_gint"); - for (int iap = 0; iap < hr_gint.size_atom_pairs(); iap++) - { - auto& ap = hr_gint.get_atom_pair(iap); - const int iat1 = ap.get_atom_i(); - const int iat2 = ap.get_atom_j(); - if (iat1 > iat2) - { - // fill lower triangle matrix with upper triangle matrix - // the upper is - const hamilt::AtomPair* upper_ap = hr_gint.find_pair(iat2, iat1); - const hamilt::AtomPair* lower_ap = hr_gint.find_pair(iat1, iat2); -#ifdef __DEBUG - assert(upper_ap != nullptr); -#endif - for (int ir = 0; ir < ap.get_R_size(); ir++) - { - auto R_index = ap.get_R_index(ir); - auto upper_mat = upper_ap->find_matrix(-R_index); - auto lower_mat = lower_ap->find_matrix(R_index); - for (int irow = 0; irow < upper_mat->get_row_size(); ++irow) - { - for (int icol = 0; icol < upper_mat->get_col_size(); ++icol) - { - lower_mat->get_value(icol, irow) = upper_ap->get_value(irow, icol); - } - } - } - } - } - ModuleBase::timer::tick("Gint", "compose_hr_gint"); -} - -void compose_hr_gint(const std::vector>& hr_gint_part, - HContainer>& hr_gint_full) -{ - ModuleBase::TITLE("Gint", "compose_hr_gint"); - ModuleBase::timer::tick("Gint", "compose_hr_gint"); - for (int iap = 0; iap < hr_gint_full.size_atom_pairs(); iap++) - { - auto* ap = &(hr_gint_full.get_atom_pair(iap)); - const int iat1 = ap->get_atom_i(); - const int iat2 = ap->get_atom_j(); - if (iat1 <= iat2) - { - hamilt::AtomPair>* upper_ap = ap; - hamilt::AtomPair>* lower_ap = hr_gint_full.find_pair(iat2, iat1); - const hamilt::AtomPair* ap_nspin_0 = hr_gint_part[0].find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_3 = hr_gint_part[3].find_pair(iat1, iat2); - for (int ir = 0; ir < upper_ap->get_R_size(); ir++) - { - const auto R_index = upper_ap->get_R_index(ir); - auto upper_mat = upper_ap->find_matrix(R_index); - auto mat_nspin_0 = ap_nspin_0->find_matrix(R_index); - auto mat_nspin_3 = ap_nspin_3->find_matrix(R_index); - - // The row size and the col size of upper_matrix is double that of matrix_nspin_0 - for (int irow = 0; irow < mat_nspin_0->get_row_size(); ++irow) - { - for (int icol = 0; icol < mat_nspin_0->get_col_size(); ++icol) - { - upper_mat->get_value(2*irow, 2*icol) = mat_nspin_0->get_value(irow, icol) + mat_nspin_3->get_value(irow, icol); - upper_mat->get_value(2*irow+1, 2*icol+1) = mat_nspin_0->get_value(irow, icol) - mat_nspin_3->get_value(irow, icol); - } - } - - if (PARAM.globalv.domag) - { - const hamilt::AtomPair* ap_nspin_1 = hr_gint_part[1].find_pair(iat1, iat2); - const hamilt::AtomPair* ap_nspin_2 = hr_gint_part[2].find_pair(iat1, iat2); - const auto mat_nspin_1 = ap_nspin_1->find_matrix(R_index); - const auto mat_nspin_2 = ap_nspin_2->find_matrix(R_index); - for (int irow = 0; irow < mat_nspin_1->get_row_size(); ++irow) - { - for (int icol = 0; icol < mat_nspin_1->get_col_size(); ++icol) - { - upper_mat->get_value(2*irow, 2*icol+1) = mat_nspin_1->get_value(irow, icol) + std::complex(0.0, 1.0) * mat_nspin_2->get_value(irow, icol); - upper_mat->get_value(2*irow+1, 2*icol) = mat_nspin_1->get_value(irow, icol) - std::complex(0.0, 1.0) * mat_nspin_2->get_value(irow, icol); - } - } - } - - // fill the lower triangle matrix - if (iat1 < iat2) - { - auto lower_mat = lower_ap->find_matrix(-R_index); - for (int irow = 0; irow < upper_mat->get_row_size(); ++irow) - { - for (int icol = 0; icol < upper_mat->get_col_size(); ++icol) - { - lower_mat->get_value(icol, irow) = conj(upper_mat->get_value(irow, icol)); - } - } - } - } - } - } - ModuleBase::timer::tick("Gint", "compose_hr_gint"); -} - -template -void transfer_hr_gint_to_hR(const HContainer& hr_gint, HContainer& hR) -{ - ModuleBase::TITLE("Gint", "transfer_hr_gint_to_hR"); - ModuleBase::timer::tick("Gint", "transfer_hr_gint_to_hR"); -#ifdef __MPI - int size = 0; - MPI_Comm_size(MPI_COMM_WORLD, &size); - if (size == 1) - { - hR.add(hr_gint); - } - else - { - hamilt::transferSerials2Parallels(hr_gint, &hR); - } -#else - hR.add(hr_gint); -#endif - ModuleBase::timer::tick("Gint", "transfer_hr_gint_to_hR"); -} - -// gint_info should not have been a parameter, but it was added to initialize dm_gint_full -// In the future, we might try to remove the gint_info parameter -template -void transfer_dm_2d_to_gint( - const GintInfo& gint_info, - std::vector*> dm, - std::vector>& dm_gint) -{ - ModuleBase::TITLE("Gint", "transfer_dm_2d_to_gint"); - ModuleBase::timer::tick("Gint", "transfer_dm_2d_to_gint"); - - if (PARAM.inp.nspin != 4) - { - // dm_gint.size() usually equals to PARAM.inp.nspin, - // but there is exception within module_lr - for (int is = 0; is < dm_gint.size(); is++) - { -#ifdef __MPI - hamilt::transferParallels2Serials(*dm[is], &dm_gint[is]); -#else - dm_gint[is].set_zero(); - dm_gint[is].add(*dm[is]); -#endif - } - } else // NSPIN=4 case - { -#ifdef __MPI - const int npol = 2; - HContainer dm_full = gint_info.get_hr(npol); - hamilt::transferParallels2Serials(*dm[0], &dm_full); -#else - HContainer& dm_full = *(dm[0]); -#endif - std::vector tmp_pointer(4, nullptr); - for (int iap = 0; iap < dm_full.size_atom_pairs(); iap++) - { - auto& ap = dm_full.get_atom_pair(iap); - const int iat1 = ap.get_atom_i(); - const int iat2 = ap.get_atom_j(); - for (int ir = 0; ir < ap.get_R_size(); ir++) - { - const ModuleBase::Vector3 r_index = ap.get_R_index(ir); - for (int is = 0; is < 4; is++) - { - tmp_pointer[is] = - dm_gint[is].find_matrix(iat1, iat2, r_index)->get_pointer(); - } - T* data_full = ap.get_pointer(ir); - for (int irow = 0; irow < ap.get_row_size(); irow += 2) - { - for (int icol = 0; icol < ap.get_col_size(); icol += 2) - { - *(tmp_pointer[0])++ = data_full[icol]; - *(tmp_pointer[1])++ = data_full[icol + 1]; - } - data_full += ap.get_col_size(); - for (int icol = 0; icol < ap.get_col_size(); icol += 2) - { - *(tmp_pointer[2])++ = data_full[icol]; - *(tmp_pointer[3])++ = data_full[icol + 1]; - } - data_full += ap.get_col_size(); - } - } - } - } - ModuleBase::timer::tick("Gint", "transfer_dm_2d_to_gint"); -} - -int globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - const int iblock = localindex / nblk; - const int gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} - -int localIndex(int globalindex, int nblk, int nprocs, int& myproc) -{ - myproc = int((globalindex % (nblk * nprocs)) / nblk); - return int(globalindex / (nblk * nprocs)) * nblk + globalindex % nblk; -} - -template -void wfc_2d_to_gint(const T* wfc_2d, - int nbands, // needed if MPI is disabled - int nlocal, // needed if MPI is disabled - const Parallel_Orbitals& pv, - T* wfc_gint, - const GintInfo& gint_info) -{ - ModuleBase::TITLE("Gint", "wfc_2d_to_gint"); - ModuleBase::timer::tick("Gint", "wfc_2d_to_gint"); - -#ifdef __MPI - // dimension related - nlocal = pv.desc_wfc[2]; - nbands = pv.desc_wfc[3]; - - const std::vector& trace_lo = gint_info.get_trace_lo(); - - // MPI and memory related - const int mem_stride = 1; - int mpi_info = 0; - - // get the rank of the current process - int rank = 0; - MPI_Comm_rank(pv.comm(), &rank); - - // calculate the maximum number of nlocal over all processes in pv.comm() range - long buf_size; - mpi_info = MPI_Reduce(&pv.nloc_wfc, &buf_size, 1, MPI_LONG, MPI_MAX, 0, pv.comm()); - mpi_info = MPI_Bcast(&buf_size, 1, MPI_LONG, 0, pv.comm()); // get and then broadcast - std::vector wfc_block(buf_size); - - // this quantity seems to have the value returned by function numroc_ in ScaLAPACK? - int naroc[2]; - - // for BLACS broadcast - char scope = 'A'; - char top = ' '; - - // loop over all processors - for (int iprow = 0; iprow < pv.dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv.dim1; ++ipcol) - { - if (iprow == pv.coord[0] && ipcol == pv.coord[1]) - { - BlasConnector::copy(pv.nloc_wfc, wfc_2d, mem_stride, wfc_block.data(), mem_stride); - naroc[0] = pv.nrow; - naroc[1] = pv.ncol_bands; - Cxgebs2d(pv.blacs_ctxt, &scope, &top, 2, 1, naroc, 2); - Cxgebs2d(pv.blacs_ctxt, &scope, &top, buf_size, 1, wfc_block.data(), buf_size); - } - else - { - Cxgebr2d(pv.blacs_ctxt, &scope, &top, 2, 1, naroc, 2, iprow, ipcol); - Cxgebr2d(pv.blacs_ctxt, &scope, &top, buf_size, 1, wfc_block.data(), buf_size, iprow, ipcol); - } - - // then use it to set the wfc_grid. - const int nb = pv.nb; - const int dim0 = pv.dim0; - const int dim1 = pv.dim1; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, nb, dim1, ipcol); - if (igcol >= PARAM.inp.nbands) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, nb, dim0, iprow); - int mu_local = trace_lo[igrow]; - if (wfc_gint && mu_local >= 0) - { - wfc_gint[igcol * nlocal + mu_local] = wfc_block[j * naroc[0] + i]; - } - } - } - // this operation will let all processors have the same wfc_grid - } - } -#else - for (int i = 0; i < nbands; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - wfc_gint[i * nlocal + j] = wfc_2d[i * nlocal + j]; - } - } -#endif - ModuleBase::timer::tick("Gint", "wfc_2d_to_gint"); -} - -template void transfer_hr_gint_to_hR( - const HContainer& hr_gint, - HContainer& hR); -template void transfer_hr_gint_to_hR( - const HContainer>& hr_gint, - HContainer>& hR); -template void transfer_dm_2d_to_gint( - const GintInfo& gint_info, - std::vector*> dm, - std::vector>& dm_gint); -template void transfer_dm_2d_to_gint( - const GintInfo& gint_info, - std::vector>*> dm, - std::vector>>& dm_gint); -template void wfc_2d_to_gint( - const double* wfc_2d, - int nbands, - int nlocal, - const Parallel_Orbitals& pv, - double* wfc_grid, - const GintInfo& gint_info); -template void wfc_2d_to_gint( - const std::complex* wfc_2d, - int nbands, - int nlocal, - const Parallel_Orbitals& pv, - std::complex* wfc_grid, - const GintInfo& gint_info); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_common.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_common.h deleted file mode 100644 index 485978ccf8..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_common.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_info.h" - -namespace ModuleGint -{ - // fill the lower triangle matrix with the upper triangle matrix - void compose_hr_gint(HContainer& hr_gint); - // for nspin=4 case - void compose_hr_gint(const std::vector>& hr_gint_part, - HContainer>& hr_gint_full); - - template - void transfer_hr_gint_to_hR(const HContainer& hr_gint, HContainer& hR); - - template - void transfer_dm_2d_to_gint( - const GintInfo& gint_info, - std::vector*> dm, - std::vector>& dm_gint); - - template - void wfc_2d_to_gint(const T* wfc_2d, int nbands, int nlocal, const Parallel_Orbitals& pv, T* wfc_grid, const GintInfo& gint_info); -} diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.cpp deleted file mode 100644 index 78a8b91069..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.cpp +++ /dev/null @@ -1,271 +0,0 @@ -#include -#include "gint_dvlocal.h" -#include "phi_operator.h" -#include "source_base/parallel_reduce.h" - -namespace ModuleGint -{ - -void Gint_dvlocal::cal_dvlocal() -{ - ModuleBase::TITLE("Gint", "cal_gint_dvlocal"); - ModuleBase::timer::tick("Gint", "cal_gint_dvlocal"); - init_hr_gint_(); - cal_hr_gint_(); - ModuleBase::timer::tick("Gint", "cal_gint_dvlocal"); -} - -void Gint_dvlocal::init_hr_gint_() -{ - pvdpRx = gint_info_->get_hr(); - pvdpRy = gint_info_->get_hr(); - pvdpRz = gint_info_->get_hr(); -} - -void Gint_dvlocal::cal_hr_gint_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; - std::vector dphi_x; - std::vector dphi_y; - std::vector dphi_z; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().empty()) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - dphi_x.resize(phi_len); - dphi_y.resize(phi_len); - dphi_z.resize(phi_len); - phi_op.set_phi_dphi(phi.data(), dphi_x.data(), dphi_y.data(), dphi_z.data()); - phi_op.phi_mul_vldr3(vr_eff_, dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_phi(phi_vldr3.data(), dphi_x.data(), pvdpRx, PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(phi_vldr3.data(), dphi_y.data(), pvdpRy, PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(phi_vldr3.data(), dphi_z.data(), pvdpRz, PhiOperator::Triangular_Matrix::Upper); - } - } -} - -void Gint_dvlocal::cal_dvlocal_R_sparseMatrix( - const int nspin, - const int cspin, - const int nlocal, - const double sparse_thr, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const Grid_Driver& gdriver, - LCAO_HS_Arrays& hs_arrays) -{ - ModuleBase::TITLE("Gint", "cal_dvlocal_R_sparseMatrix"); - ModuleBase::timer::tick("Gint", "cal_dvlocal_R_sparseMatrix"); - std::map, std::map>> pvdpRx_sparseMatrix; - std::map, std::map>> pvdpRy_sparseMatrix; - std::map, std::map>> pvdpRz_sparseMatrix; - - double temp_value_double; - - Vec3d tau1, dtau; - for (int iap = 0; iap < pvdpRx.size_atom_pairs(); iap++) - { - const auto& ap = pvdpRx.get_atom_pair(iap); - const int iat1 = ap.get_atom_i(); - const int iat2 = ap.get_atom_j(); - const int it1 = ucell.iat2it[iat1]; - const int it2 = ucell.iat2it[iat2]; - const Atom* atom1 = &ucell.atoms[it1]; - const Atom* atom2 = &ucell.atoms[it2]; - const int start1 = ucell.itiaiw2iwt(it1, ucell.iat2ia[iat1], 0); - const int start2 = ucell.itiaiw2iwt(it2, ucell.iat2ia[iat2], 0); - - for (int ir = 0; ir < ap.get_R_size(); ir++) - { - const ModuleBase::Vector3 R = ap.get_R_index(ir); - Abfs::Vector3_Order dR(R.x, R.y, R.z); - double* p_pvdpRx = pvdpRx.get_atom_pair(iap).get_pointer(ir); - double* p_pvdpRy = pvdpRy.get_atom_pair(iap).get_pointer(ir); - double* p_pvdpRz = pvdpRz.get_atom_pair(iap).get_pointer(ir); - - for (int iw = 0; iw < atom1->nw * npol_; iw++) - { - for (int iw2 = 0; iw2 < atom2->nw * npol_; iw2++) - { - const int nw = atom2->nw; - const int mug0 = iw / npol_; - const int nug0 = iw2 / npol_; - const int iw_nowg = mug0 * nw + nug0; - - double temp_value = p_pvdpRx[iw_nowg]; - if (std::abs(temp_value) > sparse_thr) - { - pvdpRx_sparseMatrix[dR][start1 + iw][start2 + iw2] = temp_value; - } - temp_value = p_pvdpRy[iw_nowg]; - if (std::abs(temp_value) > sparse_thr) - { - pvdpRy_sparseMatrix[dR][start1 + iw][start2 + iw2] = temp_value; - } - temp_value = p_pvdpRz[iw_nowg]; - if (std::abs(temp_value) > sparse_thr) - { - pvdpRz_sparseMatrix[dR][start1 + iw][start2 + iw2] = temp_value; - } - } - } - } - } - distribute_pvdpR_sparseMatrix(cspin, 0, nlocal, sparse_thr, pvdpRx_sparseMatrix, pv, hs_arrays); - distribute_pvdpR_sparseMatrix(cspin, 1, nlocal, sparse_thr, pvdpRy_sparseMatrix, pv, hs_arrays); - distribute_pvdpR_sparseMatrix(cspin, 2, nlocal, sparse_thr, pvdpRz_sparseMatrix, pv, hs_arrays); - ModuleBase::timer::tick("Gint", "cal_dvlocal_R_sparseMatrix"); -} - - -void Gint_dvlocal::distribute_pvdpR_sparseMatrix( - const int cspin, - const int dim, - const int nlocal, - const double sparse_threshold, - const std::map, - std::map>>& - pvdpR_sparseMatrix, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& hs_arrays) -{ - int total_R_num = hs_arrays.all_R_coor.size(); - std::vector nonzero_num(total_R_num); - std::vector minus_nonzero_num(total_R_num); - int count = 0; - for (const auto& R_coor: hs_arrays.all_R_coor) - { - auto iter = pvdpR_sparseMatrix.find(R_coor); - if (iter != pvdpR_sparseMatrix.end()) - { - for (auto& row_loop: iter->second) - { - nonzero_num[count] += row_loop.second.size(); - } - } - - auto minus_R_coor = -1 * R_coor; - - iter = pvdpR_sparseMatrix.find(minus_R_coor); - if (iter != pvdpR_sparseMatrix.end()) - { - for (auto& row_loop: iter->second) - { - minus_nonzero_num[count] += row_loop.second.size(); - } - } - count++; - } - - Parallel_Reduce::reduce_all(nonzero_num.data(), total_R_num); - Parallel_Reduce::reduce_all(minus_nonzero_num.data(), total_R_num); - - std::vector tmp(nlocal); - count = 0; - - const std::vector& trace_lo = gint_info_->get_trace_lo(); - for (const auto& R_coor: hs_arrays.all_R_coor) - { - if (nonzero_num[count] != 0 || minus_nonzero_num[count] != 0) - { - auto minus_R_coor = -1 * R_coor; - - for (int row = 0; row < nlocal; ++row) - { - tmp.assign(tmp.size(), 0); - - auto iter = pvdpR_sparseMatrix.find(R_coor); - if (iter != pvdpR_sparseMatrix.end()) - { - - if (trace_lo[row] >= 0) - { - auto row_iter = iter->second.find(row); - if (row_iter != iter->second.end()) - { - for (auto& value: row_iter->second) - { - tmp[value.first] = value.second; - } - } - } - } - - auto minus_R_iter = pvdpR_sparseMatrix.find(minus_R_coor); - if (minus_R_iter != pvdpR_sparseMatrix.end()) - { - for (int col = 0; col < row; ++col) - { - if (trace_lo[col] >= 0) - { - auto row_iter = minus_R_iter->second.find(col); - if (row_iter != minus_R_iter->second.end()) - { - auto col_iter = row_iter->second.find(row); - if (col_iter != row_iter->second.end()) - { - tmp[col] = col_iter->second; - } - } - } - } - } - - Parallel_Reduce::reduce_pool(tmp.data(), nlocal); - - if (pv.global2local_row(row) >= 0) - { - for (int col = 0; col < nlocal; ++col) - { - if (pv.global2local_col(col) >= 0) - { - if (std::abs(tmp[col]) > sparse_threshold) - { - if (dim == 0) - { - double& value = hs_arrays.dHRx_sparse[cspin][R_coor][row][col]; - value += tmp[col]; - if (std::abs(value) <= sparse_threshold) - { - hs_arrays.dHRx_sparse[cspin][R_coor][row].erase(col); - } - } - if (dim == 1) - { - double& value = hs_arrays.dHRy_sparse[cspin][R_coor][row][col]; - value += tmp[col]; - if (std::abs(value) <= sparse_threshold) - { - hs_arrays.dHRy_sparse[cspin][R_coor][row].erase(col); - } - } - if (dim == 2) - { - double& value = hs_arrays.dHRz_sparse[cspin][R_coor][row][col]; - value += tmp[col]; - if (std::abs(value) <= sparse_threshold) - { - hs_arrays.dHRz_sparse[cspin][R_coor][row].erase(col); - } - } - } - } - } - } - } - } - count++; - } -} -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.h deleted file mode 100644 index 77976aad78..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_dvlocal.h +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" -#include "source_base/abfs-vector3_order.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_dvlocal : public Gint -{ - public: - Gint_dvlocal( - const double* vr_eff, - const int nspin, - const int npol) - : vr_eff_(vr_eff), nspin_(nspin), npol_(npol), dr3_(gint_info_->get_mgrid_volume()) - { - assert(nspin_ == 2); // currently only npin == 2 is supported - } - - void cal_dvlocal(); - - void cal_dvlocal_R_sparseMatrix( - const int nspin, - const int cspin, - const int nlocal, - const double sparse_thr, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const Grid_Driver& gdriver, - LCAO_HS_Arrays& hs_arrays); - - private: - void init_hr_gint_(); - - void cal_hr_gint_(); - - void distribute_pvdpR_sparseMatrix( - const int cspin, - const int dim, - const int nlocal, - const double sparse_threshold, - const std::map, - std::map>>& - pvdpR_sparseMatrix, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays); - - // input - const double* vr_eff_; - int nspin_; - int npol_; - - // intermediate variables - double dr3_; - HContainer pvdpRx; - HContainer pvdpRy; - HContainer pvdpRz; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.cpp deleted file mode 100644 index 71fabbd703..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "gint_env_gamma.h" -#include "gint_common.h" -#include "phi_operator.h" - -namespace ModuleGint -{ - -Gint_env_gamma::Gint_env_gamma( - const double* psid, - const Parallel_Orbitals* pv, - const int nbands, - const int nlocal, - double* rho) - :rho_(rho) -{ - wfc_gint_.resize(nbands * gint_info_->get_lgd()); - wfc_2d_to_gint(psid, nbands, nlocal, *pv, wfc_gint_.data(), *gint_info_); -} - -void Gint_env_gamma::cal_env_band(const int iband) -{ - ModuleBase::TITLE("Gint", "cal_gint_env"); - ModuleBase::timer::tick("Gint", "cal_gint_env"); - ModuleBase::GlobalFunc::ZEROS(rho_, gint_info_->get_local_mgrid_num()); - const double* wfc_gint_band = &wfc_gint_[iband * gint_info_->get_lgd()]; -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().empty()) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_op.set_phi(phi.data()); - phi_op.cal_env_gamma(phi.data(), wfc_gint_band, gint_info_->get_trace_lo(), rho_); - } - } - ModuleBase::timer::tick("Gint", "cal_gint_env"); -} - - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.h deleted file mode 100644 index 6ba3dca4fa..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_env_gamma : public Gint -{ - public: - Gint_env_gamma( - const double* psid, - const Parallel_Orbitals* pv, - const int nbands, - const int nlocal, - double* rho); - - void cal_env_band(const int iband); - - private: - // output - double* rho_; - - // intermediate variable - std::vector wfc_gint_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.cpp deleted file mode 100644 index b92ed8ddfc..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "gint_env_k.h" -#include "gint_common.h" -#include "phi_operator.h" - -namespace ModuleGint -{ - -Gint_env_k::Gint_env_k( - const std::complex* psid, - const Parallel_Orbitals* pv, - const std::vector& kvec_c, - const std::vector& kvec_d, - const int nbands, - const int nlocal, - const int ik, - const int nspin, - const int npol, - double* rho) - :kvec_c_(kvec_c), kvec_d_(kvec_d), ik_(ik), nspin_(nspin), npol_(npol), rho_(rho) -{ - wfc_gint_.resize(nbands * gint_info_->get_lgd()); - wfc_2d_to_gint(psid, nbands, nlocal, *pv, wfc_gint_.data(), *gint_info_); -} - -void Gint_env_k::cal_env_band(const int iband) -{ - ModuleBase::TITLE("Gint", "cal_gint_env"); - ModuleBase::timer::tick("Gint", "cal_gint_env"); - ModuleBase::GlobalFunc::ZEROS(rho_, gint_info_->get_local_mgrid_num()); - const std::complex* wfc_gint_band = &wfc_gint_[iband * gint_info_->get_lgd()]; -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().empty()) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_op.set_phi(phi.data()); - phi_op.cal_env_k(phi.data(), wfc_gint_band, gint_info_->get_trace_lo(), ik_, nspin_, - npol_, gint_info_->get_lgd(), kvec_c_, kvec_d_, rho_); - } - } - ModuleBase::timer::tick("Gint", "cal_gint_env"); -} - - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.h deleted file mode 100644 index 4d1232e591..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_env_k.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_env_k : public Gint -{ - public: - Gint_env_k( - const std::complex* psid, - const Parallel_Orbitals* pv, - const std::vector& kvec_c, - const std::vector& kvec_d, - const int nbands, - const int nlocal, - const int ik, - const int nspin, - const int npol, - double* rho); - - void cal_env_band(const int iband); - - private: - // input - const std::vector& kvec_c_; - const std::vector& kvec_d_; - int ik_; - int nspin_; - int npol_; - - // output - double* rho_; - - // intermediate variable - std::vector> wfc_gint_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.cpp deleted file mode 100644 index 3fc9bde005..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "source_base/global_function.h" -#include "gint_fvl.h" -#include "gint_common.h" -#include "phi_operator.h" - -namespace ModuleGint -{ - -void Gint_fvl::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_fvl"); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_fvl_svl_(); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); -} - -void Gint_fvl::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_fvl::cal_fvl_svl_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; - std::vector phi_vldr3_dm; - std::vector dphi_x; - std::vector dphi_y; - std::vector dphi_z; - ModuleBase::matrix* fvl_thread = nullptr; - ModuleBase::matrix* svl_thread = nullptr; - if(isforce_) - { - fvl_thread = new ModuleBase::matrix(*fvl_); - fvl_thread->zero_out(); - } - if(isstress_) - { - svl_thread = new ModuleBase::matrix(*svl_); - svl_thread->zero_out(); - } -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - phi_vldr3_dm.resize(phi_len); - dphi_x.resize(phi_len); - dphi_y.resize(phi_len); - dphi_z.resize(phi_len); - phi_op.set_phi_dphi(phi.data(), dphi_x.data(), dphi_y.data(), dphi_z.data()); - for (int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_vldr3(vr_eff_[is], dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_dm(phi_vldr3.data(), dm_gint_vec_[is], false, phi_vldr3_dm.data()); - if(isforce_) - { - phi_op.phi_dot_dphi(phi_vldr3_dm.data(), dphi_x.data(), dphi_y.data(), dphi_z.data(), fvl_thread); - } - if(isstress_) - { - phi_op.phi_dot_dphi_r(phi_vldr3_dm.data(), dphi_x.data(), dphi_y.data(), dphi_z.data(), svl_thread); - } - } - } -#pragma omp critical - { - if(isforce_) - { - fvl_[0] += fvl_thread[0]; - delete fvl_thread; - } - if(isstress_) - { - svl_[0] += svl_thread[0]; - delete svl_thread; - } - } - } -} - - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.h deleted file mode 100644 index 9e225fed0f..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/matrix.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_fvl : public Gint -{ - public: - Gint_fvl( - const int nspin, - const std::vector& vr_eff, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl) - : nspin_(nspin), vr_eff_(vr_eff), dm_vec_(dm_vec), - isforce_(isforce), isstress_(isstress), fvl_(fvl), svl_(svl), - dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void cal_fvl_svl_(); - - // input - const int nspin_; - std::vector vr_eff_; - std::vector*> dm_vec_; - const bool isforce_; - const bool isstress_; - - // output - ModuleBase::matrix* fvl_; - ModuleBase::matrix* svl_; - - // intermediate variables - std::vector> dm_gint_vec_; - - double dr3_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.cpp deleted file mode 100644 index 1d90304d2c..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.cpp +++ /dev/null @@ -1,134 +0,0 @@ -#include "gint_fvl_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_fvl_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_fvl"); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_fvl_svl_(); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); -} - -void Gint_fvl_gpu::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_fvl_gpu::transfer_cpu_to_gpu_() -{ - dm_gint_d_vec_.resize(nspin_); - vr_eff_d_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_d_vec_[is] = CudaMemWrapper(dm_gint_vec_[is].get_nnr(), 0, false); - checkCuda(cudaMemcpy(dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is].get_wrapper(), - dm_gint_vec_[is].get_nnr() * sizeof(double), cudaMemcpyHostToDevice)); - vr_eff_d_vec_[is] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vr_eff_d_vec_[is].get_device_ptr(), vr_eff_[is], - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - } - if (isforce_) - { - fvl_d_ = CudaMemWrapper(gint_info_->get_nat() * 3, 0, true); - } - if (isstress_) - { - svl_d_ = CudaMemWrapper(6, 0, true); - } -} - -void Gint_fvl_gpu::transfer_gpu_to_cpu_() -{ - if (isforce_) - { - fvl_d_.copy_device_to_host_sync(); - for (int iat = 0; iat < gint_info_->get_nat(); iat++) - { - for (int j = 0; j < 3; j++) - { - fvl_[0](iat, j) += fvl_d_.get_host_ptr()[iat * 3 + j]; - } - } - } - if (isstress_) - { - svl_d_.copy_device_to_host_sync(); - svl_[0](0, 0) += svl_d_.get_host_ptr()[0]; - svl_[0](0, 1) += svl_d_.get_host_ptr()[1]; - svl_[0](0, 2) += svl_d_.get_host_ptr()[2]; - svl_[0](1, 1) += svl_d_.get_host_ptr()[3]; - svl_[0](1, 2) += svl_d_.get_host_ptr()[4]; - svl_[0](2, 2) += svl_d_.get_host_ptr()[5]; - } -} - -void Gint_fvl_gpu::cal_fvl_svl_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z(BatchBigGrid::get_max_phi_len(), stream, false); - - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi_dphi(phi.get_device_ptr(), - dphi_x.get_device_ptr(), - dphi_y.get_device_ptr(), - dphi_z.get_device_ptr()); - for(int is = 0; is < nspin_; is++) - { - const bool is_symm = false; - phi_op.phi_mul_vldr3(vr_eff_d_vec_[is].get_device_ptr(), dr3_, - phi.get_device_ptr(), phi_vldr3.get_device_ptr()); - phi_op.phi_mul_dm(phi_vldr3.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), - dm_gint_vec_[is], is_symm, phi_vldr3_dm.get_device_ptr()); - if (isforce_) - { - phi_op.phi_dot_dphi(phi_vldr3_dm.get_device_ptr(), - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), - dphi_z.get_device_ptr(), fvl_d_.get_device_ptr()); - } - if (isstress_) - { - phi_op.phi_dot_dphi_r(phi_vldr3_dm.get_device_ptr(), - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), - dphi_z.get_device_ptr(), svl_d_.get_device_ptr()); - } - } - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.h deleted file mode 100644 index 6d3d341e64..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_gpu.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/matrix.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_fvl_gpu : public Gint -{ - public: - Gint_fvl_gpu( - const int nspin, - const std::vector& vr_eff, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl) - : nspin_(nspin), vr_eff_(vr_eff), dm_vec_(dm_vec), - isforce_(isforce), isstress_(isstress), fvl_(fvl), svl_(svl), - dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void cal_fvl_svl_(); - - void transfer_cpu_to_gpu_(); - void transfer_gpu_to_cpu_(); - // input - const int nspin_; - std::vector vr_eff_; - std::vector*> dm_vec_; - const bool isforce_; - const bool isstress_; - - // output - ModuleBase::matrix* fvl_; - ModuleBase::matrix* svl_; - - // intermediate variables - std::vector> dm_gint_vec_; - - double dr3_; - - // GPU memory - std::vector> vr_eff_d_vec_; - std::vector> dm_gint_d_vec_; - CudaMemWrapper fvl_d_; - CudaMemWrapper svl_d_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.cpp deleted file mode 100644 index 3299600c99..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include "source_base/global_function.h" -#include "gint_fvl_meta.h" -#include "gint_common.h" -#include "phi_operator.h" - -namespace ModuleGint -{ - -void Gint_fvl_meta::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_fvl"); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_fvl_svl_(); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); -} - -void Gint_fvl_meta::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_fvl_meta::cal_fvl_svl_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; - std::vector phi_vldr3_dm; - std::vector dphi_x; - std::vector dphi_y; - std::vector dphi_z; - std::vector dphi_x_vldr3; - std::vector dphi_y_vldr3; - std::vector dphi_z_vldr3; - std::vector dphi_x_vldr3_dm; - std::vector dphi_y_vldr3_dm; - std::vector dphi_z_vldr3_dm; - std::vector ddphi_xx; - std::vector ddphi_xy; - std::vector ddphi_xz; - std::vector ddphi_yy; - std::vector ddphi_yz; - std::vector ddphi_zz; - ModuleBase::matrix* fvl_thread = nullptr; - ModuleBase::matrix* svl_thread = nullptr; - if(isforce_) - { - fvl_thread = new ModuleBase::matrix(*fvl_); - fvl_thread->zero_out(); - } - if(isstress_) - { - svl_thread = new ModuleBase::matrix(*svl_); - svl_thread->zero_out(); - } -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - phi_vldr3_dm.resize(phi_len); - dphi_x.resize(phi_len); - dphi_y.resize(phi_len); - dphi_z.resize(phi_len); - dphi_x_vldr3.resize(phi_len); - dphi_y_vldr3.resize(phi_len); - dphi_z_vldr3.resize(phi_len); - dphi_x_vldr3_dm.resize(phi_len); - dphi_y_vldr3_dm.resize(phi_len); - dphi_z_vldr3_dm.resize(phi_len); - ddphi_xx.resize(phi_len); - ddphi_xy.resize(phi_len); - ddphi_xz.resize(phi_len); - ddphi_yy.resize(phi_len); - ddphi_yz.resize(phi_len); - ddphi_zz.resize(phi_len); - phi_op.set_phi_dphi(phi.data(), dphi_x.data(), dphi_y.data(), dphi_z.data()); - phi_op.set_ddphi(ddphi_xx.data(), ddphi_xy.data(), ddphi_xz.data(), - ddphi_yy.data(), ddphi_yz.data(), ddphi_zz.data()); - for (int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_vldr3(vr_eff_[is], dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_[is], dr3_, dphi_x.data(), dphi_x_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_[is], dr3_, dphi_y.data(), dphi_y_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_[is], dr3_, dphi_z.data(), dphi_z_vldr3.data()); - phi_op.phi_mul_dm(phi_vldr3.data(), dm_gint_vec_[is], false, phi_vldr3_dm.data()); - phi_op.phi_mul_dm(dphi_x_vldr3.data(), dm_gint_vec_[is], false, dphi_x_vldr3_dm.data()); - phi_op.phi_mul_dm(dphi_y_vldr3.data(), dm_gint_vec_[is], false, dphi_y_vldr3_dm.data()); - phi_op.phi_mul_dm(dphi_z_vldr3.data(), dm_gint_vec_[is], false, dphi_z_vldr3_dm.data()); - if(isforce_) - { - phi_op.phi_dot_dphi(phi_vldr3_dm.data(), dphi_x.data(), dphi_y.data(), dphi_z.data(), fvl_thread); - phi_op.phi_dot_dphi(dphi_x_vldr3_dm.data(), ddphi_xx.data(), ddphi_xy.data(), ddphi_xz.data(), fvl_thread); - phi_op.phi_dot_dphi(dphi_y_vldr3_dm.data(), ddphi_xy.data(), ddphi_yy.data(), ddphi_yz.data(), fvl_thread); - phi_op.phi_dot_dphi(dphi_z_vldr3_dm.data(), ddphi_xz.data(), ddphi_yz.data(), ddphi_zz.data(), fvl_thread); - } - if(isstress_) - { - phi_op.phi_dot_dphi_r(phi_vldr3_dm.data(), dphi_x.data(), dphi_y.data(), dphi_z.data(), svl_thread); - phi_op.phi_dot_dphi_r(dphi_x_vldr3_dm.data(), ddphi_xx.data(), ddphi_xy.data(), ddphi_xz.data(), svl_thread); - phi_op.phi_dot_dphi_r(dphi_y_vldr3_dm.data(), ddphi_xy.data(), ddphi_yy.data(), ddphi_yz.data(), svl_thread); - phi_op.phi_dot_dphi_r(dphi_z_vldr3_dm.data(), ddphi_xz.data(), ddphi_yz.data(), ddphi_zz.data(), svl_thread); - } - } - } -#pragma omp critical - { - if(isforce_) - { - fvl_[0] += fvl_thread[0]; - delete fvl_thread; - } - if(isstress_) - { - svl_[0] += svl_thread[0]; - delete svl_thread; - } - } - } -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.h deleted file mode 100644 index 1abeac9d11..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/matrix.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ -class Gint_fvl_meta : public Gint -{ - public: - Gint_fvl_meta( - const int nspin, - const std::vector& vr_eff, - const std::vector& vofk, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl) - : nspin_(nspin), vr_eff_(vr_eff), vofk_(vofk), dm_vec_(dm_vec), - isforce_(isforce), isstress_(isstress), fvl_(fvl), svl_(svl), - dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void cal_fvl_svl_(); - - // input - const int nspin_; - std::vector vr_eff_; - std::vector vofk_; - std::vector*> dm_vec_; - const bool isforce_; - const bool isstress_; - - // output - ModuleBase::matrix* fvl_; - ModuleBase::matrix* svl_; - - // intermediate variables - std::vector> dm_gint_vec_; - - double dr3_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.cpp deleted file mode 100644 index fa19925d04..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.cpp +++ /dev/null @@ -1,182 +0,0 @@ -#include "gint_fvl_meta_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_fvl_meta_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_fvl"); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_fvl_svl_(); - ModuleBase::timer::tick("Gint", "cal_gint_fvl"); -} - -void Gint_fvl_meta_gpu::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_fvl_meta_gpu::transfer_cpu_to_gpu_() -{ - dm_gint_d_vec_.resize(nspin_); - vr_eff_d_vec_.resize(nspin_); - vofk_d_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_d_vec_[is] = CudaMemWrapper(dm_gint_vec_[is].get_nnr(), 0, false); - checkCuda(cudaMemcpy(dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is].get_wrapper(), - dm_gint_vec_[is].get_nnr() * sizeof(double), cudaMemcpyHostToDevice)); - vr_eff_d_vec_[is] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vr_eff_d_vec_[is].get_device_ptr(), vr_eff_[is], - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - vofk_d_vec_[is] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vofk_d_vec_[is].get_device_ptr(), vofk_[is], - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - } - if (isforce_) - { - fvl_d_ = CudaMemWrapper(gint_info_->get_nat() * 3, 0, true); - } - if (isstress_) - { - svl_d_ = CudaMemWrapper(6, 0, true); - } -} - -void Gint_fvl_meta_gpu::transfer_gpu_to_cpu_() -{ - if (isforce_) - { - fvl_d_.copy_device_to_host_sync(); - for (int iat = 0; iat < gint_info_->get_nat(); iat++) - { - for (int j = 0; j < 3; j++) - { - fvl_[0](iat, j) += fvl_d_.get_host_ptr()[iat * 3 + j]; - } - } - } - if (isstress_) - { - svl_d_.copy_device_to_host_sync(); - svl_[0](0, 0) += svl_d_.get_host_ptr()[0]; - svl_[0](0, 1) += svl_d_.get_host_ptr()[1]; - svl_[0](0, 2) += svl_d_.get_host_ptr()[2]; - svl_[0](1, 1) += svl_d_.get_host_ptr()[3]; - svl_[0](1, 2) += svl_d_.get_host_ptr()[4]; - svl_[0](2, 2) += svl_d_.get_host_ptr()[5]; - } -} - -void Gint_fvl_meta_gpu::cal_fvl_svl_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x_vldr3_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y_vldr3_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z_vldr3_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper ddphi_xx(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper ddphi_xy(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper ddphi_xz(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper ddphi_yy(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper ddphi_yz(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper ddphi_zz(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi_dphi(phi.get_device_ptr(), - dphi_x.get_device_ptr(), - dphi_y.get_device_ptr(), - dphi_z.get_device_ptr()); - phi_op.set_ddphi(ddphi_xx.get_device_ptr(), ddphi_xy.get_device_ptr(), - ddphi_xz.get_device_ptr(), ddphi_yy.get_device_ptr(), - ddphi_yz.get_device_ptr(), ddphi_zz.get_device_ptr()); - for(int is = 0; is < nspin_; is++) - { - const bool is_symm = false; - phi_op.phi_mul_vldr3(vr_eff_d_vec_[is].get_device_ptr(), dr3_, - phi.get_device_ptr(), phi_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_vec_[is].get_device_ptr(), dr3_, - dphi_x.get_device_ptr(), dphi_x_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_vec_[is].get_device_ptr(), dr3_, - dphi_y.get_device_ptr(), dphi_y_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_vec_[is].get_device_ptr(), dr3_, - dphi_z.get_device_ptr(), dphi_z_vldr3.get_device_ptr()); - phi_op.phi_mul_dm(phi_vldr3.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), - dm_gint_vec_[is], is_symm, phi_vldr3_dm.get_device_ptr()); - phi_op.phi_mul_dm(dphi_x_vldr3.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), - dm_gint_vec_[is], is_symm, dphi_x_vldr3_dm.get_device_ptr()); - phi_op.phi_mul_dm(dphi_y_vldr3.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), - dm_gint_vec_[is], is_symm, dphi_y_vldr3_dm.get_device_ptr()); - phi_op.phi_mul_dm(dphi_z_vldr3.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), - dm_gint_vec_[is], is_symm, dphi_z_vldr3_dm.get_device_ptr()); - if (isforce_) - { - phi_op.phi_dot_dphi(phi_vldr3_dm.get_device_ptr(), - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), - dphi_z.get_device_ptr(), fvl_d_.get_device_ptr()); - phi_op.phi_dot_dphi(dphi_x_vldr3_dm.get_device_ptr(), - ddphi_xx.get_device_ptr(), ddphi_xy.get_device_ptr(), - ddphi_xz.get_device_ptr(), fvl_d_.get_device_ptr()); - phi_op.phi_dot_dphi(dphi_y_vldr3_dm.get_device_ptr(), - ddphi_xy.get_device_ptr(), ddphi_yy.get_device_ptr(), - ddphi_yz.get_device_ptr(), fvl_d_.get_device_ptr()); - phi_op.phi_dot_dphi(dphi_z_vldr3_dm.get_device_ptr(), - ddphi_xz.get_device_ptr(), ddphi_yz.get_device_ptr(), - ddphi_zz.get_device_ptr(), fvl_d_.get_device_ptr()); - } - if (isstress_) - { - phi_op.phi_dot_dphi_r(phi_vldr3_dm.get_device_ptr(), - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), - dphi_z.get_device_ptr(), svl_d_.get_device_ptr()); - phi_op.phi_dot_dphi_r(dphi_x_vldr3_dm.get_device_ptr(), - ddphi_xx.get_device_ptr(), ddphi_xy.get_device_ptr(), - ddphi_xz.get_device_ptr(), svl_d_.get_device_ptr()); - phi_op.phi_dot_dphi_r(dphi_y_vldr3_dm.get_device_ptr(), - ddphi_xy.get_device_ptr(), ddphi_yy.get_device_ptr(), - ddphi_yz.get_device_ptr(), svl_d_.get_device_ptr()); - phi_op.phi_dot_dphi_r(dphi_z_vldr3_dm.get_device_ptr(), - ddphi_xz.get_device_ptr(), ddphi_yz.get_device_ptr(), - ddphi_zz.get_device_ptr(), svl_d_.get_device_ptr()); - } - } - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.h deleted file mode 100644 index 22baba9d6d..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_fvl_meta_gpu.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/matrix.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ -class Gint_fvl_meta_gpu : public Gint -{ - public: - Gint_fvl_meta_gpu( - const int nspin, - const std::vector& vr_eff, - const std::vector& vofk, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl) - : nspin_(nspin), vr_eff_(vr_eff), vofk_(vofk), dm_vec_(dm_vec), - isforce_(isforce), isstress_(isstress), fvl_(fvl), svl_(svl), - dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - void cal_fvl_svl_(); - - // input - const int nspin_; - std::vector vr_eff_; - std::vector vofk_; - std::vector*> dm_vec_; - const bool isforce_; - const bool isstress_; - - // output - ModuleBase::matrix* fvl_; - ModuleBase::matrix* svl_; - - // intermediate variables - std::vector> dm_gint_vec_; - - double dr3_; - - std::vector> vr_eff_d_vec_; - std::vector> vofk_d_vec_; - std::vector> dm_gint_d_vec_; - CudaMemWrapper fvl_d_; - CudaMemWrapper svl_d_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_helper.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_helper.h deleted file mode 100644 index a017f81ba0..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_helper.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include -#include -#include "gint_type.h" -#include "source_base/timer.h" - -namespace ModuleGint -{ -inline int index3Dto1D(const int id_x, const int id_y, const int id_z, - const int dim_x, const int dim_y, const int dim_z) -{ - return id_z + id_y * dim_z + id_x * dim_y * dim_z; -} - -inline Vec3i index1Dto3D(const int index_1d, - const int dim_x, const int dim_y, const int dim_z) -{ - int id_x = index_1d / (dim_y * dim_z); - int id_y = (index_1d - id_x * dim_y * dim_z) / dim_z; - int id_z = index_1d % dim_z; - return Vec3i(id_x, id_y, id_z); -} - -// if exponent is an integer between 0 and 5 (the most common cases in gint) and -// and exp is a variable that cannot be determined at compile time (which means the compiler cannot optimize the code), -// pow_int is much faster than std::pow -inline double pow_int(const double base, const int exp) -{ - switch (exp) - { - case 0: - return 1.0; - case 1: - return base; - case 2: - return base * base; - case 3: - return base * base * base; - case 4: - return base * base * base * base; - case 5: - return base * base * base * base * base; - default: - double result = std::pow(base, exp); - return result; - } -} - -inline int floor_div(const int a, const int b) -{ - // a ^ b < 0 means a and b have different signs - return a / b - (a % b != 0 && (a ^ b) < 0); -} - -inline int ceil_div(const int a, const int b) -{ - return a / b + (a % b != 0 && (a ^ b) > 0); -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_info.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_info.cpp deleted file mode 100644 index b0738e28e4..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_info.cpp +++ /dev/null @@ -1,284 +0,0 @@ -#include -#include -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "gint_info.h" -#include "gint_type.h" - -namespace ModuleGint -{ - -GintInfo::GintInfo( - int nbx, int nby, int nbz, - int nmx, int nmy, int nmz, - int startidx_bx, int startidx_by, int startidx_bz, - int nbx_local, int nby_local, int nbz_local, - const Numerical_Orbital* Phi, - const UnitCell& ucell, Grid_Driver& gd) - : ucell_(&ucell) -{ - // initialize the unitcell information - unitcell_info_ = std::make_shared(ucell_->a1 * ucell_->lat0, ucell_->a2 * ucell_->lat0, ucell_->a3 * ucell_->lat0, - nbx, nby, nbz, nmx, nmy, nmz); - - biggrid_info_ = unitcell_info_->get_bgrid_info(); - meshgrid_info_ = biggrid_info_->get_mgrid_info(); - - // initialize the divide information - divide_info_ = std::make_shared(startidx_bx, startidx_by, startidx_bz, - nbx_local, nby_local, nbz_local, unitcell_info_, false); - - // initialize the localcell information - localcell_info_ = divide_info_->get_localcell_info(); - - // initialize the biggrids - BigGrid::init_localcell_info(localcell_info_); - BigGrid::init_unitcell_info(unitcell_info_); - BigGrid::init_bgrid_info(biggrid_info_); - - for (int i = 0; i < localcell_info_->get_bgrids_num(); i++) - { - biggrids_.push_back(std::make_shared(i)); - } - - // initialize the atoms and the numerical orbital - init_atoms_(ucell_->ntype, ucell_->atoms, Phi); - - // initialize trace_lo_ and lgd_ - init_trace_lo_(ucell, PARAM.inp.nspin); - - // initialize the ijr_info - // this step needs to be done after init_atoms_, because it requires the information of is_atom_on_bgrid - init_ijr_info_(ucell, gd); - - #ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - streams_num_ = PARAM.inp.nstream; // the default value of num_stream is 4 - const int batch_size = nbz_local; - init_bgrid_batches_(batch_size); - gpu_vars_ = std::make_shared(biggrid_info_, ucell, Phi); - } - #endif -} - -template -HContainer GintInfo::get_hr(int npol) const -{ - auto hr = HContainer(ucell_->nat); - if(PARAM.inp.gamma_only) - { - hr.fix_gamma(); - } - hr.insert_ijrs(&ijr_info_, *ucell_, npol); - hr.allocate(nullptr, true); - return hr; -} - -void GintInfo::init_atoms_(int ntype, const Atom* atoms, const Numerical_Orbital* Phi) -{ - ModuleBase::timer::tick("GintInfo", "init_atoms"); - int iat = 0; - is_atom_in_proc_.resize(ucell_->nat, false); - atoms_.resize(ucell_->nat); - orbs_.resize(ntype); - -// TODO: USE OPENMP TO PARALLELIZE THIS LOOP - for(int i = 0; i < ntype; i++) - { - const auto& atom = atoms[i]; - orbs_[i] = Phi[i]; - const auto *orb = &orbs_[i]; - - // rcut extends to the maximum big grids in x, y, z directions - Vec3i ext_bgrid = biggrid_info_->max_ext_bgrid_num(atom.Rcut); - - for(int j = 0; j < atom.na; j++) - { - Vec3d fraction; - fraction.x = atom.taud[j].x * unitcell_info_->get_nbx(); - fraction.y = atom.taud[j].y * unitcell_info_->get_nby(); - fraction.z = atom.taud[j].z * unitcell_info_->get_nbz(); - const Vec3i atom_bgrid_idx(static_cast(fraction.x), - static_cast(fraction.y), - static_cast(fraction.z)); - const Vec3d delta(fraction.x - atom_bgrid_idx.x, - fraction.y - atom_bgrid_idx.y, - fraction.z - atom_bgrid_idx.z); - const Vec3d tau_in_biggrid = biggrid_info_->get_cartesian_coord(delta); - - const Vec3i ucell_idx_atom = unitcell_info_->get_unitcell_idx(atom_bgrid_idx); - auto& r_to_atom = atoms_[iat]; - - for(int bgrid_x = atom_bgrid_idx.x - ext_bgrid.x; bgrid_x <= atom_bgrid_idx.x + ext_bgrid.x; bgrid_x++) - { - for(int bgrid_y = atom_bgrid_idx.y - ext_bgrid.y; bgrid_y <= atom_bgrid_idx.y + ext_bgrid.y; bgrid_y++) - { - for(int bgrid_z = atom_bgrid_idx.z - ext_bgrid.z; bgrid_z <= atom_bgrid_idx.z + ext_bgrid.z; bgrid_z++) - { - // get the extended biggrid idx of the affected biggrid - const Vec3i ext_bgrid_idx(bgrid_x, bgrid_y, bgrid_z); - const Vec3i normal_bgrid_idx = unitcell_info_->map_ext_idx_to_ucell(ext_bgrid_idx); - if(localcell_info_->is_bgrid_in_lcell(normal_bgrid_idx) == false) - { - continue; - } - const int bgrid_local_idx = localcell_info_->get_bgrid_local_idx_1D(normal_bgrid_idx); - // get the unitcell idx of the big grid - const Vec3i ucell_idx_bgrid = unitcell_info_->get_unitcell_idx(ext_bgrid_idx); - - // The index of the unitcell containing the biggrid relative to the unitcell containing the atom. - const Vec3i ucell_idx_relative = ucell_idx_bgrid - ucell_idx_atom; - auto it = r_to_atom.find(ucell_idx_relative); - // if the gint_atom is not in the map, - // it means this is the first time we find this atom may affect some biggrids, - // add it to the r_to_atom map - if(it == r_to_atom.end()) - { - Vec3i ext_atom_bgrid_idx(atom_bgrid_idx.x - ucell_idx_bgrid.x * unitcell_info_->get_nbx(), - atom_bgrid_idx.y - ucell_idx_bgrid.y * unitcell_info_->get_nby(), - atom_bgrid_idx.z - ucell_idx_bgrid.z * unitcell_info_->get_nbz()); - r_to_atom.insert(std::make_pair(ucell_idx_relative, - GintAtom(&atom, i, j, iat, ext_atom_bgrid_idx, ucell_idx_relative, tau_in_biggrid, orb, ucell_))); - } - if(biggrids_[bgrid_local_idx]->is_atom_on_bgrid(&r_to_atom.at(ucell_idx_relative))) - { - biggrids_[bgrid_local_idx]->add_atom(&r_to_atom.at(ucell_idx_relative)); - is_atom_in_proc_[iat] = true; - } - } - } - } - iat++; - } - } - ModuleBase::timer::tick("GintInfo", "init_atoms"); -} - -void GintInfo::init_trace_lo_(const UnitCell& ucell, const int nspin) -{ - this->trace_lo_ = std::vector(PARAM.globalv.nlocal, -1); - this->lgd_ = 0; - int iat = 0; - int iw_all = 0; - int iw_local = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - if (is_atom_in_proc_[iat]) - { - int nw0 = ucell.atoms[it].nw; - if (nspin== 4) - { // added by zhengdy-soc, need to be double in soc - nw0 *= 2; - this->lgd_ += nw0; - } else { - this->lgd_ += nw0; - } - - for (int iw = 0; iw < nw0; iw++) - { - this->trace_lo_[iw_all] = iw_local; - ++iw_local; - ++iw_all; - } - } else { - // global index of atomic orbitals - iw_all += ucell.atoms[it].nw; - if (nspin == 4) - { - iw_all += ucell.atoms[it].nw; - } - } - ++iat; - } - } -} - -void GintInfo::init_ijr_info_(const UnitCell& ucell, Grid_Driver& gd) -{ - HContainer hr_gint_local(ucell.nat); - // prepare the row_index and col_index for construct AtomPairs, they are - // same, name as orb_index - std::vector orb_index(ucell.nat + 1); - orb_index[0] = 0; - for (int i = 1; i < orb_index.size(); i++) { - int type = ucell.iat2it[i - 1]; - orb_index[i] = orb_index[i - 1] + ucell.atoms[type].nw; - } - - for (int T1 = 0; T1 < ucell.ntype; ++T1) { - const Atom* atom1 = &(ucell.atoms[T1]); - for (int I1 = 0; I1 < atom1->na; ++I1) { - auto& tau1 = atom1->tau[I1]; - const int iat1 = ucell.itia2iat(T1, I1); - // whether this atom is in this processor. - if (this->is_atom_in_proc_[iat1]) { - gd.Find_atom(ucell, tau1, T1, I1); - for (int ad = 0; ad < gd.getAdjacentNum() + 1; ++ad) { - const int T2 = gd.getType(ad); - const int I2 = gd.getNatom(ad); - const int iat2 = ucell.itia2iat(T2, I2); - const Atom* atom2 = &(ucell.atoms[T2]); - - // NOTE: hr_gint wil save total number of atom pairs, - // if only upper triangle is saved, the lower triangle will - // be lost in 2D-block parallelization. if the adjacent atom - // is in this processor. - if (this->is_atom_in_proc_[iat2]) { - Vec3d dtau = gd.getAdjacentTau(ad) - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = atom1->Rcut + atom2->Rcut; - - // if(distance < rcut) - // mohan reset this 2013-07-02 in Princeton - // we should make absolutely sure that the distance is - // smaller than rcuts[it] this should be consistant - // with LCAO_nnr::cal_nnrg function typical example : 7 - // Bohr cutoff Si orbital in 14 Bohr length of cell. - // distance = 7.0000000000000000 - // rcuts[it] = 7.0000000000000008 - if (distance < rcut - 1.0e-15) { - // calculate R index - auto& R_index = gd.getBox(ad); - // insert this atom-pair into this->hr_gint - hamilt::AtomPair tmp_atom_pair( - iat1, - iat2, - R_index.x, - R_index.y, - R_index.z, - orb_index.data(), - orb_index.data(), - ucell.nat); - hr_gint_local.insert_pair(tmp_atom_pair); - } - } - } - } - } - } - this->ijr_info_ = hr_gint_local.get_ijr_info(); - return; -} - -#ifdef __CUDA -void GintInfo::init_bgrid_batches_(int batch_size) -{ - for (int i = 0; i < biggrids_.size(); i += batch_size) - { - std::vector> bgrid_vec; - for(int j = i; j < i + batch_size && j < biggrids_.size(); j++) - { - bgrid_vec.push_back(biggrids_[j]); - } - auto bgrid_batch = std::make_shared(bgrid_vec); - bgrid_batches_.push_back(bgrid_batch); - } -} -#endif - -template HContainer GintInfo::get_hr(int npol) const; -template HContainer> GintInfo::get_hr>(int npol) const; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_info.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_info.h deleted file mode 100644 index 88f9b7c6bc..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_info.h +++ /dev/null @@ -1,117 +0,0 @@ -#pragma once - -#include -#include -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "source_cell/atom_spec.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint_type.h" -#include "big_grid.h" -#include "gint_atom.h" -#include "unitcell_info.h" -#include "localcell_info.h" -#include "divide_info.h" - -#ifdef __CUDA -#include "batch_biggrid.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.h" -#endif - -namespace ModuleGint -{ - -class GintInfo -{ - public: - // constructor - GintInfo( - int nbx, int nby, int nbz, - int nmx, int nmy, int nmz, - int startidx_bx, int startidx_by, int startidx_bz, - int nbx_local, int nby_local, int nbz_local, - const Numerical_Orbital* Phi, - const UnitCell& ucell, Grid_Driver& gd); - - // getter functions - const std::vector>& get_biggrids() { return biggrids_; } - const std::vector& get_trace_lo() const{ return trace_lo_; } - int get_lgd() const { return lgd_; } - int get_nat() const { return ucell_->nat; } // return the number of atoms in the unitcell - int get_local_mgrid_num() const { return localcell_info_->get_mgrids_num(); } - double get_mgrid_volume() const { return meshgrid_info_->get_volume(); } - - //========================================= - // functions about hcontainer - //========================================= - template - HContainer get_hr(int npol = 1) const; - - private: - // initialize the atoms - void init_atoms_(int ntype, const Atom* atoms, const Numerical_Orbital* Phi); - - // initialize trace_lo_ and lgd_ - void init_trace_lo_(const UnitCell& ucell, const int nspin); - - // initialize the ijr_info - void init_ijr_info_(const UnitCell& ucell, Grid_Driver& gd); - - const UnitCell* ucell_; - - // the unitcell information - std::shared_ptr unitcell_info_; - - // the biggrid information - std::shared_ptr biggrid_info_; - - // the meshgrid information - std::shared_ptr meshgrid_info_; - - // the divide information - std::shared_ptr divide_info_; - - // the localcell information - std::shared_ptr localcell_info_; - - // the big grids on this processor - std::vector> biggrids_; - - // the total atoms in the unitcell(include extended unitcell) on this processor - // atoms[iat][Vec3i] is the atom with index iat in the unitcell with index Vec3i - // Note: Since GintAtom does not implement a default constructor, - // the map should not be accessed using [], but rather using the at function - std::vector> atoms_; - - // if the iat-th(global index) atom is in this processor, return true - std::vector is_atom_in_proc_; - - // format for storing atomic pair information in hcontainer, used for initializing hcontainer - std::vector ijr_info_; - - // map the global index of atomic orbitals to local index - std::vector trace_lo_; - - // store the information about Numerical orbitals - std::vector orbs_; - - // total num of atomic orbitals on this proc - int lgd_ = 0; - - #ifdef __CUDA - public: - std::vector>& get_bgrid_batches() { return bgrid_batches_; }; - std::shared_ptr get_gpu_vars() const { return gpu_vars_; }; - int get_dev_id() const { return gpu_vars_->dev_id_; }; - int get_streams_num() const { return streams_num_; }; - - private: - void init_bgrid_batches_(int batch_size); - std::vector> bgrid_batches_; - std::shared_ptr gpu_vars_; - // More streams can improve parallelism and may speed up grid integration, at the cost of higher GPU memory usage. - int streams_num_; - #endif -}; - -} // namespace ModuleGint diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.cpp deleted file mode 100644 index a66b061ab3..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.cpp +++ /dev/null @@ -1,200 +0,0 @@ -#include "gint_interface.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "gint_vl.h" -#include "gint_vl_metagga.h" -#include "gint_vl_nspin4.h" -#include "gint_vl_metagga_nspin4.h" -#include "gint_fvl.h" -#include "gint_fvl_meta.h" -#include "gint_rho.h" -#include "gint_tau.h" - -#ifdef __CUDA -#include "gint_vl_gpu.h" -#include "gint_rho_gpu.h" -#include "gint_fvl_gpu.h" -#include "gint_vl_nspin4_gpu.h" -#include "gint_vl_metagga_gpu.h" -#include "gint_vl_metagga_nspin4_gpu.h" -#include "gint_tau_gpu.h" -#include "gint_fvl_meta_gpu.h" -#endif - -namespace ModuleGint -{ - -void cal_gint_vl( - const double* vr_eff, - HContainer* hR) -{ -#ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_vl_gpu gint_vl(vr_eff, hR); - gint_vl.cal_gint(); - } else -#endif - { - Gint_vl gint_vl(vr_eff, hR); - gint_vl.cal_gint(); - } -} - -// nspin == 4 case -void cal_gint_vl( - std::vector vr_eff, - HContainer>* hR) -{ - #ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_vl_nspin4_gpu gint_vl_nspin4(vr_eff, hR); - gint_vl_nspin4.cal_gint(); - } else - #endif - { - Gint_vl_nspin4 gint_vl_nspin4(vr_eff, hR); - gint_vl_nspin4.cal_gint(); - } -} - -void cal_gint_vl_metagga( - const double* vr_eff, - const double* vfork, - HContainer* hR) -{ -#ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_vl_metagga_gpu gint_vl_metagga(vr_eff, vfork, hR); - gint_vl_metagga.cal_gint(); - } else -#endif - { - Gint_vl_metagga gint_vl_metagga(vr_eff, vfork, hR); - gint_vl_metagga.cal_gint(); - } -} - -// nspin == 4 case -void cal_gint_vl_metagga( - std::vector vr_eff, - std::vector vofk, - HContainer>* hR) -{ -#ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_vl_metagga_nspin4_gpu gint_vl_metagga_nspin4(vr_eff, vofk, hR); - gint_vl_metagga_nspin4.cal_gint(); - } else -#endif - { - Gint_vl_metagga_nspin4 gint_vl_metagga_nspin4(vr_eff, vofk, hR); - gint_vl_metagga_nspin4.cal_gint(); - } -} - -void cal_gint_rho( - const std::vector*>& dm_vec, - const int nspin, - double **rho, - bool is_dm_symm) -{ - #ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_rho_gpu gint_rho(dm_vec, nspin, rho, is_dm_symm); - gint_rho.cal_gint(); - } else - #endif - { - Gint_rho gint_rho(dm_vec, nspin, rho, is_dm_symm); - gint_rho.cal_gint(); - } -} - -void cal_gint_tau( - const std::vector*>& dm_vec, - const int nspin, - double** tau) -{ - #ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_tau_gpu gint_tau(dm_vec, nspin, tau); - gint_tau.cal_gint(); - } else - #endif - { - Gint_tau gint_tau(dm_vec, nspin, tau); - gint_tau.cal_gint(); - } -} - -void cal_gint_fvl( - const int nspin, - const std::vector& vr_eff, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl) -{ -#ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_fvl_gpu gint_fvl_gpu(nspin, vr_eff, dm_vec, isforce, isstress, fvl, svl); - gint_fvl_gpu.cal_gint(); - } else -#endif - { - Gint_fvl gint_fvl(nspin, vr_eff, dm_vec, isforce, isstress, fvl, svl); - gint_fvl.cal_gint(); - } -} - -void cal_gint_fvl_meta( - const int nspin, - const std::vector& vr_eff, - const std::vector& vofk, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl) -{ -#ifdef __CUDA - if(PARAM.inp.device == "gpu") - { - Gint_fvl_meta_gpu gint_fvl_meta(nspin, vr_eff, vofk, dm_vec, isforce, isstress, fvl, svl); - gint_fvl_meta.cal_gint(); - } else -#endif - { - Gint_fvl_meta gint_fvl_meta(nspin, vr_eff, vofk, dm_vec, isforce, isstress, fvl, svl); - gint_fvl_meta.cal_gint(); - } -} - -void cal_dvlocal_R_sparseMatrix( - const int nspin, - const int npol, - const int current_spin, - const int nlocal, - const double sparse_thr, - const double* vr_eff, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const Grid_Driver& gdriver, - LCAO_HS_Arrays& hs_arrays) -{ - Gint_dvlocal gint_dvlocal(vr_eff, nspin, npol); - gint_dvlocal.cal_dvlocal(); - gint_dvlocal.cal_dvlocal_R_sparseMatrix( - nspin, current_spin, nlocal, sparse_thr, - pv, ucell, gdriver, hs_arrays); -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.h deleted file mode 100644 index f674e24011..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_interface.h +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint_type.h" -#include "gint_dvlocal.h" - -namespace ModuleGint -{ - -void cal_gint_vl( - const double* vr_eff, - HContainer* hR); - -void cal_gint_vl( - std::vector vr_eff, - HContainer>* hR); - -void cal_gint_vl_metagga( - const double* vr_eff, - const double* vfork, - HContainer* hR); - -void cal_gint_vl_metagga( - std::vector vr_eff, - std::vector vofk, - HContainer>* hR); - -void cal_gint_rho( - const std::vector*>& dm_vec, - const int nspin, - double **rho, - bool is_dm_symm = true); - -void cal_gint_tau( - const std::vector*>& dm_vec, - const int nspin, - double**tau); - -void cal_gint_fvl( - const int nspin, - const std::vector& vr_eff, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl); - -void cal_gint_fvl_meta( - const int nspin, - const std::vector& vr_eff, - const std::vector& vofk, - const std::vector*>& dm_vec, - const bool isforce, - const bool isstress, - ModuleBase::matrix* fvl, - ModuleBase::matrix* svl); - -void cal_dvlocal_R_sparseMatrix( - const int nspin, - const int npol, - const int current_spin, - const int nlocal, - const double sparse_thr, - const double* vr_eff, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - const Grid_Driver& gdriver, - LCAO_HS_Arrays& hs_arrays); - - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.cpp deleted file mode 100644 index c96b10a731..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "source_base/global_function.h" -#include "gint_rho.h" -#include "gint_common.h" -#include "phi_operator.h" - -namespace ModuleGint -{ - -void Gint_rho::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_rho"); - ModuleBase::timer::tick("Gint", "cal_gint_rho"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_rho_(); - ModuleBase::timer::tick("Gint", "cal_gint_rho"); -} - -void Gint_rho::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_rho::cal_rho_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_dm; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_dm.resize(phi_len); - phi_op.set_phi(phi.data()); - for (int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_dm(phi.data(), dm_gint_vec_[is], is_dm_symm_, phi_dm.data()); - phi_op.phi_dot_phi(phi.data(), phi_dm.data(), rho_[is]); - } - } - } -} - - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.h deleted file mode 100644 index e0a15edbdc..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_rho : public Gint -{ - public: - Gint_rho( - const std::vector*>& dm_vec, - const int nspin, - double **rho, - bool is_dm_symm = true) - : dm_vec_(dm_vec), nspin_(nspin), rho_(rho), is_dm_symm_(is_dm_symm) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void cal_rho_(); - - // input - const std::vector*> dm_vec_; - const int nspin_; - - // if true, it means the DMR matrix is symmetric, - // which leads to faster computations compared to the asymmetric case. - const bool is_dm_symm_; - - // output - double **rho_; - - // Intermediate variables - std::vector> dm_gint_vec_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.cpp deleted file mode 100644 index ca24002579..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "gint_rho_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_rho_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_rho"); - ModuleBase::timer::tick("Gint", "cal_gint_rho"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_rho_(); - ModuleBase::timer::tick("Gint", "cal_gint_rho"); -} - -void Gint_rho_gpu::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_rho_gpu::transfer_cpu_to_gpu_() -{ - dm_gint_d_vec_.resize(nspin_); - rho_d_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_d_vec_[is] = CudaMemWrapper(dm_gint_vec_[is].get_nnr(), 0, false); - rho_d_vec_[is] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is].get_wrapper(), - dm_gint_vec_[is].get_nnr() * sizeof(double), cudaMemcpyHostToDevice)); - } -} - -void Gint_rho_gpu::transfer_gpu_to_cpu_() -{ - for (int is = 0; is < nspin_; is++) - { - checkCuda(cudaMemcpy(rho_[is], rho_d_vec_[is].get_device_ptr(), - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyDeviceToHost)); - } -} - -void Gint_rho_gpu::cal_rho_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_dm(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi(phi.get_device_ptr()); - for(int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_dm(phi.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is], - is_dm_symm_, phi_dm.get_device_ptr()); - phi_op.phi_dot_phi(phi.get_device_ptr(), phi_dm.get_device_ptr(), rho_d_vec_[is].get_device_ptr()); - } - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.h deleted file mode 100644 index 13db0f5a85..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_rho_gpu.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_rho_gpu: public Gint -{ - public: - Gint_rho_gpu( - const std::vector*>& dm_vec, - const int nspin, - double **rho, - bool is_dm_symm = true) - : dm_vec_(dm_vec), nspin_(nspin), rho_(rho), is_dm_symm_(is_dm_symm) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void cal_rho_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - // input - const std::vector*> dm_vec_; - const int nspin_; - - // if true, it means the DMR matrix is symmetric, - // which leads to faster computations compared to the asymmetric case. - const bool is_dm_symm_; - - // output - double **rho_; - - // Intermediate variables - std::vector> dm_gint_vec_; - - std::vector> dm_gint_d_vec_; - std::vector> rho_d_vec_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.cpp deleted file mode 100644 index 1b5e282384..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "source_base/global_function.h" -#include "gint_tau.h" -#include "gint_common.h" -#include "phi_operator.h" - -namespace ModuleGint -{ - -void Gint_tau::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_tau"); - ModuleBase::timer::tick("Gint", "cal_gint_tau"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_tau_(); - ModuleBase::timer::tick("Gint", "cal_gint_tau"); -} - -void Gint_tau::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_tau::cal_tau_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector dphi_x; - std::vector dphi_y; - std::vector dphi_z; - std::vector dphi_x_dm; - std::vector dphi_y_dm; - std::vector dphi_z_dm; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - dphi_x.resize(phi_len); - dphi_y.resize(phi_len); - dphi_z.resize(phi_len); - dphi_x_dm.resize(phi_len); - dphi_y_dm.resize(phi_len); - dphi_z_dm.resize(phi_len); - phi_op.set_phi_dphi(nullptr, dphi_x.data(), dphi_y.data(), dphi_z.data()); - for (int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_dm(dphi_x.data(), dm_gint_vec_[is], true, dphi_x_dm.data()); - phi_op.phi_mul_dm(dphi_y.data(), dm_gint_vec_[is], true, dphi_y_dm.data()); - phi_op.phi_mul_dm(dphi_z.data(), dm_gint_vec_[is], true, dphi_z_dm.data()); - phi_op.phi_dot_phi(dphi_x.data(), dphi_x_dm.data(), kin_[is]); - phi_op.phi_dot_phi(dphi_y.data(), dphi_y_dm.data(), kin_[is]); - phi_op.phi_dot_phi(dphi_z.data(), dphi_z_dm.data(), kin_[is]); - } - } - } -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.h deleted file mode 100644 index b1d3b0664a..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_tau : public Gint -{ - public: - Gint_tau( - const std::vector*>& dm_vec, - const int nspin, - double** tau) - : dm_vec_(dm_vec), nspin_(nspin), kin_(tau) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void cal_tau_(); - - // input - const std::vector*> dm_vec_; - const int nspin_; - - // output - double **kin_; - - // Intermediate variables - std::vector> dm_gint_vec_; -}; - -} // namespace ModuleGint diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.cpp deleted file mode 100644 index cbeeead322..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "gint_tau_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_tau_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_tau"); - ModuleBase::timer::tick("Gint", "cal_gint_tau"); - init_dm_gint_(); - transfer_dm_2d_to_gint(*gint_info_, dm_vec_, dm_gint_vec_); - cal_tau_(); - ModuleBase::timer::tick("Gint", "cal_gint_tau"); -} - -void Gint_tau_gpu::init_dm_gint_() -{ - dm_gint_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_vec_[is] = gint_info_->get_hr(); - } -} - -void Gint_tau_gpu::transfer_cpu_to_gpu_() -{ - dm_gint_d_vec_.resize(nspin_); - kin_d_vec_.resize(nspin_); - for (int is = 0; is < nspin_; is++) - { - dm_gint_d_vec_[is] = CudaMemWrapper(dm_gint_vec_[is].get_nnr(), 0, false); - kin_d_vec_[is] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is].get_wrapper(), - dm_gint_vec_[is].get_nnr() * sizeof(double), cudaMemcpyHostToDevice)); - } -} - -void Gint_tau_gpu::transfer_gpu_to_cpu_() -{ - for (int is = 0; is < nspin_; is++) - { - checkCuda(cudaMemcpy(kin_[is], kin_d_vec_[is].get_device_ptr(), - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyDeviceToHost)); - } -} - -void Gint_tau_gpu::cal_tau_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper dphi_x(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y_dm(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z_dm(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi_dphi(nullptr, - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), dphi_z.get_device_ptr()); - for(int is = 0; is < nspin_; is++) - { - const bool is_symm = true; - phi_op.phi_mul_dm(dphi_x.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is], - is_symm, dphi_x_dm.get_device_ptr()); - phi_op.phi_mul_dm(dphi_y.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is], - is_symm, dphi_y_dm.get_device_ptr()); - phi_op.phi_mul_dm(dphi_z.get_device_ptr(), dm_gint_d_vec_[is].get_device_ptr(), dm_gint_vec_[is], - is_symm, dphi_z_dm.get_device_ptr()); - phi_op.phi_dot_phi(dphi_x.get_device_ptr(), dphi_x_dm.get_device_ptr(), kin_d_vec_[is].get_device_ptr()); - phi_op.phi_dot_phi(dphi_y.get_device_ptr(), dphi_y_dm.get_device_ptr(), kin_d_vec_[is].get_device_ptr()); - phi_op.phi_dot_phi(dphi_z.get_device_ptr(), dphi_z_dm.get_device_ptr(), kin_d_vec_[is].get_device_ptr()); - } - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.h deleted file mode 100644 index bfac5a48a3..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_tau_gpu.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_tau_gpu : public Gint -{ - public: - Gint_tau_gpu( - const std::vector*>& dm_vec, - const int nspin, - double** tau) - : dm_vec_(dm_vec), nspin_(nspin), kin_(tau) {} - - void cal_gint(); - - private: - void init_dm_gint_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - void cal_tau_(); - - // input - const std::vector*> dm_vec_; - const int nspin_; - - // output - double **kin_; - - // Intermediate variables - std::vector> dm_gint_vec_; - - std::vector> dm_gint_d_vec_; - std::vector> kin_d_vec_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_type.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_type.h deleted file mode 100644 index 4d1b2e8537..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_type.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/vector3.h" -#include "source_base/matrix3.h" - -namespace ModuleGint -{ - using Matrix3 = ModuleBase::Matrix3; - using Vec3d = ModuleBase::Vector3; - using Vec3i = ModuleBase::Vector3; - - template - using HContainer = hamilt::HContainer; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.cpp deleted file mode 100644 index ee40327d72..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "source_base/blas_connector.h" -#include "gint_common.h" -#include "gint_vl.h" -#include "phi_operator.h" -#include "gint_helper.h" - -namespace ModuleGint -{ - -void Gint_vl::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_); - transfer_hr_gint_to_hR(hr_gint_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -//======================== -// Private functions -//======================== - -void Gint_vl::init_hr_gint_() -{ - hr_gint_ = gint_info_->get_hr(); -} - -void Gint_vl::cal_hr_gint_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().empty()) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - phi_op.set_phi(phi.data()); - phi_op.phi_mul_vldr3(vr_eff_, dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_phi(phi.data(), phi_vldr3.data(), hr_gint_, PhiOperator::Triangular_Matrix::Upper); - } - } -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.h deleted file mode 100644 index fc717629c5..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_vl : public Gint -{ - public: - Gint_vl( - const double* vr_eff, - HContainer* hR) - : vr_eff_(vr_eff), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - - void init_hr_gint_(); - - // note that only the upper triangle matrix of hR is calculated - // that's why we need compose_hr_gint() to fill the lower triangle matrix. - void cal_hr_gint_(); - - // input - const double* vr_eff_; - - // output - HContainer* hR_; - - // Intermediate variables - double dr3_; - - HContainer hr_gint_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.cpp deleted file mode 100644 index fe9162bc4e..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "gint_vl_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_vl_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_); - transfer_hr_gint_to_hR(hr_gint_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -void Gint_vl_gpu::init_hr_gint_() -{ - hr_gint_ = gint_info_->get_hr(); -} - -void Gint_vl_gpu::transfer_cpu_to_gpu_() -{ - hr_gint_d_ = CudaMemWrapper(hr_gint_.get_nnr(), 0, false); - vr_eff_d_ = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vr_eff_d_.get_device_ptr(), vr_eff_, - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); -} - -void Gint_vl_gpu::transfer_gpu_to_cpu_() -{ - checkCuda(cudaMemcpy(hr_gint_.get_wrapper(), hr_gint_d_.get_device_ptr(), - hr_gint_.get_nnr() * sizeof(double), cudaMemcpyDeviceToHost)); -} - -void Gint_vl_gpu::cal_hr_gint_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi(phi.get_device_ptr()); - phi_op.phi_mul_vldr3(vr_eff_d_.get_device_ptr(), dr3_, - phi.get_device_ptr(), phi_vldr3.get_device_ptr()); - phi_op.phi_mul_phi(phi.get_device_ptr(), phi_vldr3.get_device_ptr(), - hr_gint_, hr_gint_d_.get_device_ptr()); - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.h deleted file mode 100644 index 53290658c8..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_gpu.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_vl_gpu : public Gint -{ - public: - Gint_vl_gpu( - const double* vr_eff, - HContainer* hR) - : vr_eff_(vr_eff), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - - void init_hr_gint_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - void cal_hr_gint_(); - - // input - const double* vr_eff_; - - - // output - HContainer* hR_; - - // Intermediate variables - double dr3_; - - HContainer hr_gint_; - - CudaMemWrapper hr_gint_d_; - CudaMemWrapper vr_eff_d_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.cpp deleted file mode 100644 index 2c885adca2..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "source_base/blas_connector.h" -#include "gint_common.h" -#include "gint_vl_metagga.h" -#include "phi_operator.h" -#include "gint_helper.h" - -namespace ModuleGint -{ - -void Gint_vl_metagga::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_); - transfer_hr_gint_to_hR(hr_gint_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -//======================== -// Private functions -//======================== - -void Gint_vl_metagga::init_hr_gint_() -{ - hr_gint_ = gint_info_->get_hr(); -} - -void Gint_vl_metagga::cal_hr_gint_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; - std::vector dphi_x; - std::vector dphi_y; - std::vector dphi_z; - std::vector dphi_x_vldr3; - std::vector dphi_y_vldr3; - std::vector dphi_z_vldr3; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - dphi_x.resize(phi_len); - dphi_y.resize(phi_len); - dphi_z.resize(phi_len); - dphi_x_vldr3.resize(phi_len); - dphi_y_vldr3.resize(phi_len); - dphi_z_vldr3.resize(phi_len); - phi_op.set_phi_dphi(phi.data(), dphi_x.data(), dphi_y.data(), dphi_z.data()); - phi_op.phi_mul_vldr3(vr_eff_, dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_, dr3_, dphi_x.data(), dphi_x_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_, dr3_, dphi_y.data(), dphi_y_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_, dr3_, dphi_z.data(), dphi_z_vldr3.data()); - phi_op.phi_mul_phi(phi.data(), phi_vldr3.data(), hr_gint_, PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(dphi_x.data(), dphi_x_vldr3.data(), hr_gint_, PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(dphi_y.data(), dphi_y_vldr3.data(), hr_gint_, PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(dphi_z.data(), dphi_z_vldr3.data(), hr_gint_, PhiOperator::Triangular_Matrix::Upper); - } - } -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.h deleted file mode 100644 index 01bef660a2..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_vl_metagga : public Gint -{ - public: - Gint_vl_metagga( - const double* vr_eff, - const double* vofk, - HContainer* hR) - : vr_eff_(vr_eff), vofk_(vofk), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - - void init_hr_gint_(); - - // note that only the upper triangle matrix of hR is calculated - // that's why we need compose_hr_gint() to fill the lower triangle matrix. - void cal_hr_gint_(); - - // input - const double* vr_eff_; - const double* vofk_; - - // output - HContainer* hR_; - - // Intermediate variables - double dr3_; - - HContainer hr_gint_; - -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.cpp deleted file mode 100644 index 9c2dad8421..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "gint_vl_metagga_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_vl_metagga_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_); - transfer_hr_gint_to_hR(hr_gint_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -//======================== -// Private functions -//======================== - -void Gint_vl_metagga_gpu::init_hr_gint_() -{ - hr_gint_ = gint_info_->get_hr(); -} - -void Gint_vl_metagga_gpu::transfer_cpu_to_gpu_() -{ - hr_gint_d_ = CudaMemWrapper(hr_gint_.get_nnr(), 0, false); - vr_eff_d_ = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - vofk_d_ = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vr_eff_d_.get_device_ptr(), vr_eff_, - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - checkCuda(cudaMemcpy(vofk_d_.get_device_ptr(), vofk_, - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); -} - -void Gint_vl_metagga_gpu::transfer_gpu_to_cpu_() -{ - checkCuda(cudaMemcpy(hr_gint_.get_wrapper(), hr_gint_d_.get_device_ptr(), - hr_gint_.get_nnr() * sizeof(double), cudaMemcpyDeviceToHost)); -} - -void Gint_vl_metagga_gpu::cal_hr_gint_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi_dphi(phi.get_device_ptr(), - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), dphi_z.get_device_ptr()); - phi_op.phi_mul_vldr3(vr_eff_d_.get_device_ptr(), dr3_, - phi.get_device_ptr(), phi_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_.get_device_ptr(), dr3_, - dphi_x.get_device_ptr(), dphi_x_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_.get_device_ptr(), dr3_, - dphi_y.get_device_ptr(), dphi_y_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_.get_device_ptr(), dr3_, - dphi_z.get_device_ptr(), dphi_z_vldr3.get_device_ptr()); - phi_op.phi_mul_phi(phi.get_device_ptr(), phi_vldr3.get_device_ptr(), - hr_gint_, hr_gint_d_.get_device_ptr()); - phi_op.phi_mul_phi(dphi_x.get_device_ptr(), dphi_x_vldr3.get_device_ptr(), - hr_gint_, hr_gint_d_.get_device_ptr()); - phi_op.phi_mul_phi(dphi_y.get_device_ptr(), dphi_y_vldr3.get_device_ptr(), - hr_gint_, hr_gint_d_.get_device_ptr()); - phi_op.phi_mul_phi(dphi_z.get_device_ptr(), dphi_z_vldr3.get_device_ptr(), - hr_gint_, hr_gint_d_.get_device_ptr()); - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.h deleted file mode 100644 index efdc01762a..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_gpu.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_vl_metagga_gpu : public Gint -{ - public: - Gint_vl_metagga_gpu( - const double* vr_eff, - const double* vofk, - HContainer* hR) - : vr_eff_(vr_eff), vofk_(vofk), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - - void init_hr_gint_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - // note that only the upper triangle matrix of hR is calculated - // that's why we need compose_hr_gint() to fill the lower triangle matrix. - void cal_hr_gint_(); - - // input - const double* vr_eff_; - const double* vofk_; - - // output - HContainer* hR_; - - // Intermediate variables - double dr3_; - - HContainer hr_gint_; - - CudaMemWrapper hr_gint_d_; - CudaMemWrapper vr_eff_d_; - CudaMemWrapper vofk_d_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp deleted file mode 100644 index 5c6086031c..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "source_base/global_function.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/blas_connector.h" -#include "gint_common.h" -#include "gint_vl_metagga_nspin4.h" -#include "phi_operator.h" -#include "gint_helper.h" - -namespace ModuleGint -{ - -void Gint_vl_metagga_nspin4::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -void Gint_vl_metagga_nspin4::init_hr_gint_() -{ - hr_gint_part_.resize(nspin_); - for(int i = 0; i < nspin_; i++) - { - hr_gint_part_[i] = gint_info_->get_hr(); - } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); -} - -void Gint_vl_metagga_nspin4::cal_hr_gint_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; - std::vector dphi_x; - std::vector dphi_y; - std::vector dphi_z; - std::vector dphi_x_vldr3; - std::vector dphi_y_vldr3; - std::vector dphi_z_vldr3; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - dphi_x.resize(phi_len); - dphi_y.resize(phi_len); - dphi_z.resize(phi_len); - dphi_x_vldr3.resize(phi_len); - dphi_y_vldr3.resize(phi_len); - dphi_z_vldr3.resize(phi_len); - phi_op.set_phi_dphi(phi.data(), dphi_x.data(), dphi_y.data(), dphi_z.data()); - for(int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_vldr3(vr_eff_[is], dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_[is], dr3_, dphi_x.data(), dphi_x_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_[is], dr3_, dphi_y.data(), dphi_y_vldr3.data()); - phi_op.phi_mul_vldr3(vofk_[is], dr3_, dphi_z.data(), dphi_z_vldr3.data()); - phi_op.phi_mul_phi(phi.data(), phi_vldr3.data(), hr_gint_part_[is], PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(dphi_x.data(), dphi_x_vldr3.data(), hr_gint_part_[is], PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(dphi_y.data(), dphi_y_vldr3.data(), hr_gint_part_[is], PhiOperator::Triangular_Matrix::Upper); - phi_op.phi_mul_phi(dphi_z.data(), dphi_z_vldr3.data(), hr_gint_part_[is], PhiOperator::Triangular_Matrix::Upper); - } - } - } -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h deleted file mode 100644 index abdbde3f08..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_vl_metagga_nspin4 : public Gint -{ - public: - Gint_vl_metagga_nspin4( - std::vector vr_eff, - std::vector vofk, - HContainer>* hR) - : vr_eff_(vr_eff), vofk_(vofk), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - void init_hr_gint_(); - - void cal_hr_gint_(); - - // input - std::vector vr_eff_; - std::vector vofk_; - // output - HContainer>* hR_; - - // Intermediate variables - const double dr3_; - - const int nspin_ = 4; - - std::vector> hr_gint_part_; - HContainer> hr_gint_full_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp deleted file mode 100644 index 9adc4cb137..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include "gint_vl_metagga_nspin4_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_vl_metagga_nspin4_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -void Gint_vl_metagga_nspin4_gpu::init_hr_gint_() -{ - hr_gint_part_.resize(nspin_); - for(int i = 0; i < nspin_; i++) - { - hr_gint_part_[i] = gint_info_->get_hr(); - } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); -} - -void Gint_vl_metagga_nspin4_gpu::transfer_cpu_to_gpu_() -{ - vr_eff_d_.resize(nspin_); - vofk_d_.resize(nspin_); - hr_gint_part_d_.resize(nspin_); - for(int i = 0; i < nspin_; i++) - { - hr_gint_part_d_[i] = CudaMemWrapper(hr_gint_part_[i].get_nnr(), 0, false); - vr_eff_d_[i] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - vofk_d_[i] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vr_eff_d_[i].get_device_ptr(), vr_eff_[i], - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - checkCuda(cudaMemcpy(vofk_d_[i].get_device_ptr(), vofk_[i], - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - } -} - -void Gint_vl_metagga_nspin4_gpu::transfer_gpu_to_cpu_() -{ - for(int i = 0; i < nspin_; i++) - { - checkCuda(cudaMemcpy(hr_gint_part_[i].get_wrapper(), hr_gint_part_d_[i].get_device_ptr(), - hr_gint_part_[i].get_nnr() * sizeof(double), cudaMemcpyDeviceToHost)); - } -} - -void Gint_vl_metagga_nspin4_gpu::cal_hr_gint_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_x_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_y_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper dphi_z_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi_dphi(phi.get_device_ptr(), - dphi_x.get_device_ptr(), dphi_y.get_device_ptr(), dphi_z.get_device_ptr()); - for(int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_vldr3(vr_eff_d_[is].get_device_ptr(), dr3_, - phi.get_device_ptr(), phi_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_[is].get_device_ptr(), dr3_, - dphi_x.get_device_ptr(), dphi_x_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_[is].get_device_ptr(), dr3_, - dphi_y.get_device_ptr(), dphi_y_vldr3.get_device_ptr()); - phi_op.phi_mul_vldr3(vofk_d_[is].get_device_ptr(), dr3_, - dphi_z.get_device_ptr(), dphi_z_vldr3.get_device_ptr()); - phi_op.phi_mul_phi(phi.get_device_ptr(), phi_vldr3.get_device_ptr(), - hr_gint_part_[is], hr_gint_part_d_[is].get_device_ptr()); - phi_op.phi_mul_phi(dphi_x.get_device_ptr(), dphi_x_vldr3.get_device_ptr(), - hr_gint_part_[is], hr_gint_part_d_[is].get_device_ptr()); - phi_op.phi_mul_phi(dphi_y.get_device_ptr(), dphi_y_vldr3.get_device_ptr(), - hr_gint_part_[is], hr_gint_part_d_[is].get_device_ptr()); - phi_op.phi_mul_phi(dphi_z.get_device_ptr(), dphi_z_vldr3.get_device_ptr(), - hr_gint_part_[is], hr_gint_part_d_[is].get_device_ptr()); - } - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h deleted file mode 100644 index d38665dffa..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga_nspin4_gpu.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_vl_metagga_nspin4_gpu : public Gint -{ - public: - Gint_vl_metagga_nspin4_gpu( - std::vector vr_eff, - std::vector vofk, - HContainer>* hR) - : vr_eff_(vr_eff), vofk_(vofk), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - void init_hr_gint_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - void cal_hr_gint_(); - - // input - std::vector vr_eff_; - std::vector vofk_; - // output - HContainer>* hR_; - - // Intermediate variables - const double dr3_; - - const int nspin_ = 4; - - std::vector> hr_gint_part_; - HContainer> hr_gint_full_; - - std::vector> vr_eff_d_; - std::vector> vofk_d_; - std::vector> hr_gint_part_d_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp deleted file mode 100644 index 27db0a7db3..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "source_base/global_function.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/blas_connector.h" -#include "gint_common.h" -#include "gint_vl_nspin4.h" -#include "phi_operator.h" -#include "gint_helper.h" - -namespace ModuleGint -{ -void Gint_vl_nspin4::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -void Gint_vl_nspin4::init_hr_gint_() -{ - hr_gint_part_.resize(nspin_); - for(int i = 0; i < nspin_; i++) - { - hr_gint_part_[i] = gint_info_->get_hr(); - } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); -} - -void Gint_vl_nspin4::cal_hr_gint_() -{ -#pragma omp parallel - { - PhiOperator phi_op; - std::vector phi; - std::vector phi_vldr3; -#pragma omp for schedule(dynamic) - for(const auto& biggrid: gint_info_->get_biggrids()) - { - if(biggrid->get_atoms().size() == 0) - { - continue; - } - phi_op.set_bgrid(biggrid); - const int phi_len = phi_op.get_rows() * phi_op.get_cols(); - phi.resize(phi_len); - phi_vldr3.resize(phi_len); - phi_op.set_phi(phi.data()); - for(int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_vldr3(vr_eff_[is], dr3_, phi.data(), phi_vldr3.data()); - phi_op.phi_mul_phi(phi.data(), phi_vldr3.data(), hr_gint_part_[is], PhiOperator::Triangular_Matrix::Upper); - } - } - } -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.h deleted file mode 100644 index 9436b5c397..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" - -namespace ModuleGint -{ - -class Gint_vl_nspin4 : public Gint -{ - public: - Gint_vl_nspin4( - std::vector vr_eff, - HContainer>* hR) - : vr_eff_(vr_eff), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - - void init_hr_gint_(); - - // note that only the upper triangle matrix of hR is calculated - // that's why we need compose_hr_gint() to fill the lower triangle matrix. - void cal_hr_gint_(); - - // input - std::vector vr_eff_; - - // output - HContainer>* hR_; - - // Intermediate variables - const double dr3_; - - const int nspin_ = 4; - - std::vector> hr_gint_part_; - HContainer> hr_gint_full_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp deleted file mode 100644 index c070258db5..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include "gint_vl_nspin4_gpu.h" -#include "gint_common.h" -#include "gint_helper.h" -#include "batch_biggrid.h" -#include "kernel/phi_operator_gpu.h" - -namespace ModuleGint -{ - -void Gint_vl_nspin4_gpu::cal_gint() -{ - ModuleBase::TITLE("Gint", "cal_gint_vl"); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); - init_hr_gint_(); - cal_hr_gint_(); - compose_hr_gint(hr_gint_part_, hr_gint_full_); - transfer_hr_gint_to_hR(hr_gint_full_, *hR_); - ModuleBase::timer::tick("Gint", "cal_gint_vl"); -} - -void Gint_vl_nspin4_gpu::init_hr_gint_() -{ - hr_gint_part_.resize(nspin_); - for(int i = 0; i < nspin_; i++) - { - hr_gint_part_[i] = gint_info_->get_hr(); - } - const int npol = 2; - hr_gint_full_ = gint_info_->get_hr>(npol); -} - -void Gint_vl_nspin4_gpu::transfer_cpu_to_gpu_() -{ - vr_eff_d_.resize(nspin_); - hr_gint_part_d_.resize(nspin_); - for(int i = 0; i < nspin_; i++) - { - hr_gint_part_d_[i] = CudaMemWrapper(hr_gint_part_[i].get_nnr(), 0, false); - vr_eff_d_[i] = CudaMemWrapper(gint_info_->get_local_mgrid_num(), 0, false); - checkCuda(cudaMemcpy(vr_eff_d_[i].get_device_ptr(), vr_eff_[i], - gint_info_->get_local_mgrid_num() * sizeof(double), cudaMemcpyHostToDevice)); - } -} - -void Gint_vl_nspin4_gpu::transfer_gpu_to_cpu_() -{ - for(int i = 0; i < nspin_; i++) - { - checkCuda(cudaMemcpy(hr_gint_part_[i].get_wrapper(), hr_gint_part_d_[i].get_device_ptr(), - hr_gint_part_[i].get_nnr() * sizeof(double), cudaMemcpyDeviceToHost)); - } -} - - -void Gint_vl_nspin4_gpu::cal_hr_gint_() -{ - transfer_cpu_to_gpu_(); -#pragma omp parallel num_threads(gint_info_->get_streams_num()) - { - // 20240620 Note that it must be set again here because - // cuda's device is not safe in a multi-threaded environment. - checkCuda(cudaSetDevice(gint_info_->get_dev_id())); - cudaStream_t stream; - checkCuda(cudaStreamCreate(&stream)); - PhiOperatorGpu phi_op(gint_info_->get_gpu_vars(), stream); - CudaMemWrapper phi(BatchBigGrid::get_max_phi_len(), stream, false); - CudaMemWrapper phi_vldr3(BatchBigGrid::get_max_phi_len(), stream, false); - #pragma omp for schedule(dynamic) - for(const auto& bgrid_batch: gint_info_->get_bgrid_batches()) - { - if(bgrid_batch->empty()) - { - continue; - } - phi_op.set_bgrid_batch(bgrid_batch); - phi_op.set_phi(phi.get_device_ptr()); - for(int is = 0; is < nspin_; is++) - { - phi_op.phi_mul_vldr3(vr_eff_d_[is].get_device_ptr(), dr3_, - phi.get_device_ptr(), phi_vldr3.get_device_ptr()); - phi_op.phi_mul_phi(phi.get_device_ptr(), phi_vldr3.get_device_ptr(), - hr_gint_part_[is], hr_gint_part_d_[is].get_device_ptr()); - } - } - checkCuda(cudaStreamSynchronize(stream)); - checkCuda(cudaStreamDestroy(stream)); - } - transfer_gpu_to_cpu_(); -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h deleted file mode 100644 index a7decea9e8..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_nspin4_gpu.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "gint.h" -#include "gint_info.h" -#include "module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class Gint_vl_nspin4_gpu : public Gint -{ - public: - Gint_vl_nspin4_gpu( - std::vector vr_eff, - HContainer>* hR) - : vr_eff_(vr_eff), hR_(hR), dr3_(gint_info_->get_mgrid_volume()) {} - - void cal_gint(); - - private: - - void init_hr_gint_(); - - void transfer_cpu_to_gpu_(); - - void transfer_gpu_to_cpu_(); - - // note that only the upper triangle matrix of hR is calculated - // that's why we need compose_hr_gint() to fill the lower triangle matrix. - void cal_hr_gint_(); - - // input - std::vector vr_eff_; - - // output - HContainer>* hR_; - - // Intermediate variables - const double dr3_; - - const int nspin_ = 4; - - std::vector> hr_gint_part_; - HContainer> hr_gint_full_; - - std::vector> vr_eff_d_; - std::vector> hr_gint_part_d_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h deleted file mode 100644 index 9b7ad27e83..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/cuda_mem_wrapper.h +++ /dev/null @@ -1,171 +0,0 @@ -#pragma once -#include -#include "source_base/tool_quit.h" -#include "gint_helper.cuh" - -template -class CudaMemWrapper -{ - public: - - CudaMemWrapper() = default; - CudaMemWrapper(const CudaMemWrapper& other) = delete; - CudaMemWrapper& operator=(const CudaMemWrapper& other) = delete; - CudaMemWrapper(CudaMemWrapper&& other) noexcept - { - this->device_ptr_ = other.device_ptr_; - this->host_ptr_ = other.host_ptr_; - this->size_ = other.size_; - this->malloc_host_ = other.malloc_host_; - this->stream_ = other.stream_; - - other.device_ptr_ = nullptr; - other.host_ptr_ = nullptr; - other.size_ = 0; - other.malloc_host_ = false; - other.stream_ = 0; - } - - CudaMemWrapper& operator=(CudaMemWrapper&& other) noexcept - { - if (this != &other) - { - this->device_ptr_ = other.device_ptr_; - this->host_ptr_ = other.host_ptr_; - this->size_ = other.size_; - this->malloc_host_ = other.malloc_host_; - this->stream_ = other.stream_; - - other.device_ptr_ = nullptr; - other.host_ptr_ = nullptr; - other.size_ = 0; - other.malloc_host_ = false; - other.stream_ = 0; - } - return *this; - } - - CudaMemWrapper(size_t size, - cudaStream_t stream = 0, - bool malloc_host = true) - { - size_ = size; - malloc_host_ = malloc_host; - stream_ = stream; - - if (malloc_host) - { - checkCuda(cudaMallocHost((void**)&host_ptr_, size_* sizeof(T))); - memset(host_ptr_, 0, size_ * sizeof(T)); - } - else - { host_ptr_ = nullptr; } - - checkCuda(cudaMalloc((void**)&device_ptr_, size_ * sizeof(T))); - checkCuda(cudaMemset(device_ptr_, 0, size_ * sizeof(T))); - } - - ~CudaMemWrapper() - { - free(); - } - - void copy_host_to_device_sync(size_t size) - { - if (host_ptr_ == nullptr) - { ModuleBase::WARNING_QUIT("cuda_mem_wrapper", "Host pointer is null, cannot copy to device."); } - checkCuda(cudaMemcpy(device_ptr_, host_ptr_, size * sizeof(T), cudaMemcpyHostToDevice)); - } - - void copy_host_to_device_sync() - { - copy_host_to_device_sync(size_); - } - - void copy_host_to_device_async(size_t size) - { - if (host_ptr_ == nullptr) - { ModuleBase::WARNING_QUIT("cuda_mem_wrapper", "Host pointer is null, cannot copy to device."); } - checkCuda(cudaMemcpyAsync(device_ptr_, host_ptr_, size * sizeof(T), cudaMemcpyHostToDevice, stream_)); - } - - void copy_host_to_device_async() - { - copy_host_to_device_async(size_); - } - - void copy_device_to_host_sync(size_t size) - { - if (host_ptr_ == nullptr) - { ModuleBase::WARNING_QUIT("cuda_mem_wrapper", "Host pointer is null, cannot copy to host."); } - checkCuda(cudaMemcpy(host_ptr_, device_ptr_, size * sizeof(T), cudaMemcpyDeviceToHost)); - } - - void copy_device_to_host_sync() - { - copy_device_to_host_sync(size_); - } - - void copy_device_to_host_async(size_t size) - { - if (host_ptr_ == nullptr) - { ModuleBase::WARNING_QUIT("cuda_mem_wrapper", "Host pointer is null, cannot copy to host."); } - checkCuda(cudaMemcpyAsync(host_ptr_, device_ptr_, size * sizeof(T), cudaMemcpyDeviceToHost, stream_)); - } - - void copy_device_to_host_async() - { - copy_device_to_host_async(size_); - } - - void memset_device_sync(const size_t size, const int value = 0) - { - checkCuda(cudaMemset(device_ptr_, value, size * sizeof(T))); - } - - void memset_device_sync(const int value = 0) - { - memset_device_sync(size_, value); - } - - void memset_device_async(const size_t size, const int value = 0) - { - checkCuda(cudaMemsetAsync(device_ptr_, value, size * sizeof(T), stream_)); - } - - void memset_device_async(const int value = 0) - { - memset_device_async(size_, value); - } - - void memset_host(const size_t size, const int value = 0) - { - if (host_ptr_ == nullptr) - { ModuleBase::WARNING_QUIT("cuda_mem_wrapper", "Host pointer is null, cannot memset host."); } - checkCuda(cudaMemset(host_ptr_, value, size * sizeof(T))); - } - - void memset_host(const int value = 0) - { - memset_host(size_, value); - } - - void free() - { - checkCuda(cudaFree(device_ptr_)); - checkCuda(cudaFreeHost(host_ptr_)); - } - - T* get_device_ptr() { return device_ptr_; } - T* get_host_ptr() { return host_ptr_; } - const T* get_device_ptr() const { return device_ptr_; } - const T* get_host_ptr() const { return host_ptr_; } - size_t get_size() const { return size_; } - - private: - T* device_ptr_ = nullptr; - T* host_ptr_ = nullptr; - size_t size_ = 0; - bool malloc_host_ = false; - cudaStream_t stream_ = 0; -}; \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.cu b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.cu deleted file mode 100644 index b35e0669b6..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.cu +++ /dev/null @@ -1,38 +0,0 @@ -#include "gemm_tn_vbatch.cuh" -#include "gemm_nn_vbatch.cuh" -#include "dgemm_vbatch.h" - -void dgemm_nn_vbatch( - int max_m, int max_n, int max_k, - const int* m_d, const int* n_d, const int* k_d, - const double* const* A_array_d, const int* lda_d, - const double* const* B_array_d, const int* ldb_d, - double** C_array_d, const int* ldc_d, - int batchCount, cudaStream_t stream, - const double* alpha) -{ - vbatched_gemm_nn_impl - (max_m, max_n, m_d, n_d, k_d, - A_array_d, lda_d, - B_array_d, ldb_d, - C_array_d, ldc_d, - batchCount, stream, alpha); - -} - -void dgemm_tn_vbatch( - int max_m, int max_n, int max_k, - const int* m_d, const int* n_d, const int* k_d, - const double* const* A_array_d, const int* lda_d, - const double* const* B_array_d, const int* ldb_d, - double** C_array_d, const int* ldc_d, - int batchCount, cudaStream_t stream, - const double* alpha) -{ - vbatched_gemm_tn_impl - (max_m, max_n, m_d, n_d, k_d, - A_array_d, lda_d, - B_array_d, ldb_d, - C_array_d, ldc_d, - batchCount, stream, alpha); -} diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.h b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.h deleted file mode 100644 index 8589bcf62e..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/dgemm_vbatch.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include - -// C(batch_id) = alpha * A(batch_id) * B(batch_id) + C(batch_id) -void dgemm_nn_vbatch( - int max_m, int max_n, int max_k, - const int* m_d, const int* n_d, const int* k_d, - const double* const* A_array_d, const int* lda_d, - const double* const* B_array_d, const int* ldb_d, - double** C_array_d, const int* ldc_d, - int batchCount, cudaStream_t stream, - const double* alpha = nullptr); - -// C(batch_id) = alpha * A(batch_id)^T * B(batch_id) + C(batch_id) -void dgemm_tn_vbatch( - int max_m, int max_n, int max_k, - const int* m_d, const int* n_d, const int* k_d, - const double* const* A_array_d, const int* lda_d, - const double* const* B_array_d, const int* ldb_d, - double** C_array_d, const int* ldc_d, - int batchCount, cudaStream_t stream, - const double* alpha = nullptr); \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_nn_vbatch.cuh b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_nn_vbatch.cuh deleted file mode 100644 index 5ad934e305..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_nn_vbatch.cuh +++ /dev/null @@ -1,427 +0,0 @@ -#ifndef GEMM_NN_VBATCH_CUH -#define GEMM_NN_VBATCH_CUH -#include // for assert -#include -#include // for CUDA_VERSION -#include -#include // for fprintf and stderr - -#include "gint_helper.cuh" -#include - - -#define sA(i, j) sA[(j)*slda + (i)] -#define sB(i, j) sB[(j)*sldb + (i)] -#define fetch(A, m, n, bound) offs_d##A[min(n * LD##A + m, bound)] - -template -static __device__ void vbatched_gemm_nn_device(int M, - int N, - int K, - const T* __restrict__ A, - int LDA, - const T* __restrict__ B, - int LDB, - T* __restrict__ C, - int LDC, - T* sA, - int slda, - T* sB, - int sldb, - T alpha) -{ - int idx = threadIdx.x; // thread's m dimension - int idy = threadIdx.y; // thread's n dimension - - int idt = DIM_X * idy + idx; // thread's global number - - int idxA = idt % DIM_XA; // idx within A - int idyA = idt / DIM_XA; // idy within A - - int idxB = idt % DIM_XB; // idx within B - int idyB = idt / DIM_XB; // idy within B - - int blx = blockIdx.x; // block's m dimension - int bly = blockIdx.y; // block's n dimension - - // Registers for the innermost loop - T rC[THR_N][THR_M]; - T rA[THR_M]; - T rB[THR_N]; - - // Registers for the dev->shmem copy - T ra[BLK_K / DIM_YA][BLK_M / DIM_XA]; - T rb[BLK_N / DIM_YB][BLK_K / DIM_XB]; - - // bound is the correction to offs_d in order to not get out of memory bound - // so bound could be negative value since offs_d could be out of bound - const T* offs_dA = A + blx * BLK_M + idyA * LDA + idxA; - int boundA - = (LDA * (K - 1) + M) - (blx * BLK_M + idyA * LDA + idxA) - 1; - - const T* offs_dB = B + bly * BLK_N * LDB + idyB * LDB + idxB; - int boundB - = (LDB * (N - 1) + K) - (bly * BLK_N * LDB + idyB * LDB + idxB) - 1; - - int m, n, k, kk; - -// Zero C -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] = 0.0; - } - } - -// Load A dev->shmem -#pragma unroll - for (n = 0; n < BLK_K; n += DIM_YA) - { -#pragma unroll - for (m = 0; m < BLK_M; m += DIM_XA) - { - sA(m + idxA, n + idyA) = fetch(A, m, n, boundA); - } - } - -#pragma unroll - for (n = 0; n < BLK_N; n += DIM_YB) - { -#pragma unroll - for (m = 0; m < BLK_K; m += DIM_XB) - { - sB(m + idxB, n + idyB) = fetch(B, m, n, boundB); - } - } - - __syncthreads(); - - for (kk = 0; kk < K - BLK_K; kk += BLK_K) - { - offs_dA += BLK_K * LDA; - boundA -= BLK_K * LDA; - - offs_dB += BLK_K; - boundB -= BLK_K; - -// Load A dev->regs -#pragma unroll - for (n = 0; n < BLK_K / DIM_YA; n++) - { -#pragma unroll - for (m = 0; m < BLK_M / DIM_XA; m++) - { - ra[n][m] = fetch(A, m * DIM_XA, n * DIM_YA, boundA); - } - } - -// Load B dev->regs -#pragma unroll - for (n = 0; n < BLK_N / DIM_YB; n++) - { -#pragma unroll - for (m = 0; m < BLK_K / DIM_XB; m++) - { - rb[n][m] = fetch(B, m * DIM_XB, n * DIM_YB, boundB); - } - } - -// Multiply -#pragma unroll - for (k = 0; k < BLK_K; k++) - { -// Load A shmem->regs -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rA[m] = sA(m * DIM_X + idx, k); - } - -// Load B shmem->regs -#pragma unroll - for (n = 0; n < THR_N; n++) - { - rB[n] = sB(k, n * DIM_Y + idy); - } - -// Compute -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] += rA[m] * rB[n]; - } - } - } - - __syncthreads(); - -// Load A regs->shmem -#pragma unroll - for (n = 0; n < BLK_K / DIM_YA; n++) - { -#pragma unroll - for (m = 0; m < BLK_M / DIM_XA; m++) - { - sA(m * DIM_XA + idxA, n * DIM_YA + idyA) = ra[n][m]; - } - } - -// Load B regs->shmem -#pragma unroll - for (n = 0; n < BLK_N / DIM_YB; n++) - { -#pragma unroll - for (m = 0; m < BLK_K / DIM_XB; m++) - { - sB(m * DIM_XB + idxB, n * DIM_YB + idyB) = rb[n][m]; - } - } - __syncthreads(); - } - - // Multiply last full (BLK_K) or partial block of - // columns of op(A) and rows of op(B). - // It's okay that m,n exceed matrix bounds as all work is in registers - // or shared memory, and out-of-bounds rC[n][m] will not be saved later. - kk = K - kk; -#pragma unroll - for (k = 0; k < kk; k++) - { -// Load A shmem->regs -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rA[m] = sA(m * DIM_X + idx, k); - } - -// Load B shmem->regs -#pragma unroll - for (n = 0; n < THR_N; n++) - { - rB[n] = sB(k, n * DIM_Y + idy); - } - -// Compute -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] += rA[m] * rB[n]; - } - } - } - -// Store C regs->dev -#pragma unroll - for (n = 0; n < THR_N; n++) - { - int coord_dCn = bly * BLK_N + n * DIM_Y + idy; -#pragma unroll - for (m = 0; m < THR_M; m++) - { - int coord_dCm = blx * BLK_M + m * DIM_X + idx; - if (coord_dCm < M && coord_dCn < N) - { - int offsC = coord_dCn * LDC + coord_dCm; - - atomicAdd(C + offsC, rC[n][m] * alpha); - } - } - } -} - -/******************************************************************************/ -template -static __global__ void vbatched_gemm_nn_kernel(const int* M, - const int* N, - const int* K, - const T* const* global_A_array, - const int* global_lda, - const T* const* global_B_array, - const int* global_ldb, - T** global_C_array, - const int* global_ldc, - const T* alpha) -{ - extern __shared__ __align__(sizeof(T)) unsigned char smem[]; - T* shared_mem = reinterpret_cast(smem); - - int batchid = blockIdx.z; - int local_M = (int)M[batchid]; - int local_N = (int)N[batchid]; - int local_K = (int)K[batchid]; - - if (blockIdx.x >= (local_M + BLK_M - 1) / BLK_M) - return; - if (blockIdx.y >= (local_N + BLK_N - 1) / BLK_N) - return; - - int shared_lda = BLK_M + 1; - int shared_ldb = BLK_K + 1; - T* shared_A = (T*)shared_mem; - T* shared_B = shared_A + shared_lda * BLK_K; - double alpha_tmp = 1.0; - if (alpha != nullptr) - { - alpha_tmp = alpha[batchid]; - } - vbatched_gemm_nn_device(local_M, - local_N, - local_K, - global_A_array[batchid], - (int)global_lda[batchid], - global_B_array[batchid], - (int)global_ldb[batchid], - global_C_array[batchid], - (int)global_ldc[batchid], - shared_A, - shared_lda, - shared_B, - shared_ldb, - alpha_tmp); -} - -/** - * Performs a batched matrix multiplication using the vbatched_gemm_impl - * function. - * - * C = alpha * A * B + C - * @tparam T The data type of the matrices. - * @tparam DIM_X The number of threads in the x-dimension of each block. - * @tparam DIM_Y The number of threads in the y-dimension of each block. - * @tparam BLK_M The number of rows processed by each thread block. - * @tparam BLK_N The number of columns processed by each thread block. - * @tparam BLK_K The number of elements processed by each thread block along the - * K dimension. - * @tparam DIM_XA The number of threads in the x-dimension used for loading - * matrix A. - * @tparam DIM_YA The number of threads in the y-dimension used for loading - * matrix A. - * @tparam DIM_XB The number of threads in the x-dimension used for loading - * matrix B. - * @tparam DIM_YB The number of threads in the y-dimension used for loading - * matrix B. - * @param max_m The maximum number of rows in the matrices. - * @param max_n The maximum number of columns in the matrices. - * @param m An array of batch sizes for the number of rows in each matrix. - * @param n An array of batch sizes for the number of columns in each matrix. - * @param k An array of batch sizes for the number of elements in each matrix - * along the K dimension. - * @param global_A_array An array of pointers to the input matrices A. - * @param global_lda An array of leading dimensions for the input matrices A. - * @param global_B_array An array of pointers to the input matrices B. - * @param global_ldb An array of leading dimensions for the input matrices B. - * @param global_C_array An array of pointers to the output matrices C. - * @param global_ldc An array of leading dimensions for the output matrices C. - * @param batchCount The number of matrices in the batch. - * @param stream The CUDA stream to use for the computation. - * @param alpha The scalar value to multiply the matrices by (optional, default - * is nullptr). generate by copilot - */ -template -void vbatched_gemm_nn_impl(int max_m, - int max_n, - const int* m, - const int* n, - const int* k, - const T* const* global_A_array, - const int* global_lda, - const T* const* global_B_array, - const int* global_ldb, - T** global_C_array, - const int* global_ldc, - int batchCount, - cudaStream_t stream, - const T* alpha = nullptr) -{ - // The positions of A and B have been swapped here. - // This is because vbatch_gemm_nn_kernel is column major, - // but vatched_gemm_nn_impl is designed to be row major, - - size_t shared_mem_size = 0; - shared_mem_size += (BLK_M + 1) * BLK_K * sizeof(T); - shared_mem_size += (BLK_K + 1) * BLK_N * sizeof(T); - dim3 dimBlock(DIM_X, DIM_Y); - const int max_batch_count = 32768; - - for (int i = 0; i < batchCount; i += max_batch_count) - { - const int ibatch = min(max_batch_count, batchCount - i); - dim3 dimGrid(ceil_div(max_n, BLK_M), - ceil_div(max_m, BLK_N), - ibatch); - const T* alpha_tmp = nullptr; - if (alpha != nullptr) - { - alpha_tmp = alpha + i; - } - - vbatched_gemm_nn_kernel - <<>>( - n + i, m + i, k + i, - global_B_array + i, global_ldb + i, - global_A_array + i, global_lda + i, - global_C_array + i, global_ldc + i, - alpha_tmp); - checkCudaLastError(); - } -} - -#endif // GEMM_VBATCH_CUH \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_tn_vbatch.cuh b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_tn_vbatch.cuh deleted file mode 100644 index 701e93e81f..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gemm_tn_vbatch.cuh +++ /dev/null @@ -1,452 +0,0 @@ -#ifndef GEMM_TN_VBATCH_CUH -#define GEMM_TN_VBATCH_CUH -#include // for assert -#include -#include // for CUDA_VERSION -#include -#include // for fprintf and stderr - -#include "gint_helper.cuh" -#include - - -#define sA(i, j) sA[(j)*slda + (i)] -#define sB(i, j) sB[(j)*sldb + (i)] -#define fetch(A, m, n, bound) offs_d##A[min(n * LD##A + m, bound)] - -template -static __device__ void vbatched_gemm_nt_device(int M, - int N, - int K, - const T* __restrict__ A, - int LDA, - const T* __restrict__ B, - int LDB, - T* __restrict__ C, - int LDC, - T* sA, - int slda, - T* sB, - int sldb, - T alpha) -{ - int idx = threadIdx.x; // thread's m dimension - int idy = threadIdx.y; // thread's n dimension - - int idt = DIM_X * idy + idx; // thread's global number - - int idxA = idt % DIM_XA; // idx within A - int idyA = idt / DIM_XA; // idy within A - - int idxB = idt % DIM_XB; // idx within B - int idyB = idt / DIM_XB; // idy within B - - int blx = blockIdx.x; // block's m dimension - int bly = blockIdx.y; // block's n dimension - - // Registers for the innermost loop - T rC[THR_N][THR_M]; - T rA[THR_M]; - T rB[THR_N]; - - // Registers for the dev->shmem copy - T ra[BLK_K / DIM_YA][BLK_M / DIM_XA]; - T rb[BLK_K / DIM_YB][BLK_N / DIM_XB]; - - // bound is the correction to offs_d in order to not get out of memory bound - // so bound could be negative value since offs_d could be out of bound - const T* offs_dA = A + blx * BLK_M + idyA * LDA + idxA; - int boundA - = (LDA * (K - 1) + M) - (blx * BLK_M + idyA * LDA + idxA) - 1; - - const T* offs_dB = B + bly * BLK_N + idyB * LDB + idxB; - int boundB - = (LDB * (K - 1) + N) - (bly * BLK_N + idyB * LDB + idxB) - 1; - - int m, n, k, kk; - -// Zero C -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] = 0.0; - } - } - -// Load A dev->shmem -#pragma unroll - for (n = 0; n < BLK_K; n += DIM_YA) - { -#pragma unroll - for (m = 0; m < BLK_M; m += DIM_XA) - { - sA(m + idxA, n + idyA) = fetch(A, m, n, boundA); - } - } - -#pragma unroll - for (n = 0; n < BLK_K; n += DIM_YB) - { -#pragma unroll - for (m = 0; m < BLK_N; m += DIM_XB) - { - sB(n + idyB, m + idxB) = fetch(B, m, n, boundB); - } - } - - __syncthreads(); - - for (kk = 0; kk < K - BLK_K; kk += BLK_K) - { - offs_dA += BLK_K * LDA; - boundA -= BLK_K * LDA; - - offs_dB += BLK_K * LDB; - boundB -= BLK_K * LDB; - -// Load A dev->regs -#pragma unroll - for (n = 0; n < BLK_K / DIM_YA; n++) - { -#pragma unroll - for (m = 0; m < BLK_M / DIM_XA; m++) - { - ra[n][m] = fetch(A, m * DIM_XA, n * DIM_YA, boundA); - } - } - -// Load B dev->regs -#pragma unroll - for (n = 0; n < BLK_K / DIM_YB; n++) - { -#pragma unroll - for (m = 0; m < BLK_N / DIM_XB; m++) - { - rb[n][m] = fetch(B, m * DIM_XB, n * DIM_YB, boundB); - } - } - -// Multiply -#pragma unroll - for (k = 0; k < BLK_K; k++) - { -// Load A shmem->regs -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rA[m] = sA(m * DIM_X + idx, k); - } - -// Load B shmem->regs -#pragma unroll - for (n = 0; n < THR_N; n++) - { - rB[n] = sB(k, n * DIM_Y + idy); - } - -// Compute -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] += rA[m] * rB[n]; - } - } - } - - __syncthreads(); - -// Load A regs->shmem -#pragma unroll - for (n = 0; n < BLK_K / DIM_YA; n++) - { -#pragma unroll - for (m = 0; m < BLK_M / DIM_XA; m++) - { - sA(m * DIM_XA + idxA, n * DIM_YA + idyA) = ra[n][m]; - } - } - -// Load B regs->shmem -#pragma unroll - for (n = 0; n < BLK_K / DIM_YB; n++) - { -#pragma unroll - for (m = 0; m < BLK_N / DIM_XB; m++) - { - sB(n * DIM_YB + idyB, m * DIM_XB + idxB) = rb[n][m]; - } - } - __syncthreads(); - } - - // Multiply last full (BLK_K) or partial block of - // columns of op(A) and rows of op(B). - // It's okay that m,n exceed matrix bounds as all work is in registers - // or shared memory, and out-of-bounds rC[n][m] will not be saved later. - kk = K - kk; -#pragma unroll - for (k = 0; k < kk; k++) - { -// Load A shmem->regs -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rA[m] = sA(m * DIM_X + idx, k); - } - -// Load B shmem->regs -#pragma unroll - for (n = 0; n < THR_N; n++) - { - rB[n] = sB(k, n * DIM_Y + idy); - } - -// Compute -#pragma unroll - for (n = 0; n < THR_N; n++) - { -#pragma unroll - for (m = 0; m < THR_M; m++) - { - rC[n][m] += rA[m] * rB[n]; - } - } - } - -// Store C regs->dev -#pragma unroll - for (n = 0; n < THR_N; n++) - { - int coord_dCn = bly * BLK_N + n * DIM_Y + idy; -#pragma unroll - for (m = 0; m < THR_M; m++) - { - int coord_dCm = blx * BLK_M + m * DIM_X + idx; - if (coord_dCm < M && coord_dCn < N) - { - int offsC = coord_dCn * LDC + coord_dCm; - - atomicAdd(C + offsC, rC[n][m] * alpha); - } - } - } -} - -/******************************************************************************/ -template -static __global__ void vbatched_gemm_nt_kernel(const int* M, - const int* N, - const int* K, - const T* const* global_A_array, - const int* global_lda, - const T* const* global_B_array, - const int* global_ldb, - T** global_C_array, - const int* global_ldc, - const T* alpha) -{ - extern __shared__ __align__(sizeof(T)) unsigned char smem[]; - T* shared_mem = reinterpret_cast(smem); - - int batchid = blockIdx.z; - int local_M = (int)M[batchid]; - int local_N = (int)N[batchid]; - int local_K = (int)K[batchid]; - - if (blockIdx.x >= (local_M + BLK_M - 1) / BLK_M) - return; - if (blockIdx.y >= (local_N + BLK_N - 1) / BLK_N) - return; - - int shared_lda = BLK_M + 1; - int shared_ldb = BLK_K + 1; - T* shared_A = (T*)shared_mem; - T* shared_B = shared_A + shared_lda * BLK_K; - double alpha_tmp = 1.0; - if (alpha != nullptr) - { - alpha_tmp = alpha[batchid]; - } - vbatched_gemm_nt_device(local_M, - local_N, - local_K, - global_A_array[batchid], - (int)global_lda[batchid], - global_B_array[batchid], - (int)global_ldb[batchid], - global_C_array[batchid], - (int)global_ldc[batchid], - shared_A, - shared_lda, - shared_B, - shared_ldb, - alpha_tmp); -} - -/** - * Performs a batched matrix multiplication using the vbatched_gemm_impl - * function. - * - * C = alpha * trans(A) * B + C - * @tparam T The data type of the matrices. - * @tparam DIM_X The number of threads in the x-dimension of each block. - * @tparam DIM_Y The number of threads in the y-dimension of each block. - * @tparam BLK_M The number of rows processed by each thread block. - * @tparam BLK_N The number of columns processed by each thread block. - * @tparam BLK_K The number of elements processed by each thread block along the - * K dimension. - * @tparam DIM_XA The number of threads in the x-dimension used for loading - * matrix A. - * @tparam DIM_YA The number of threads in the y-dimension used for loading - * matrix A. - * @tparam DIM_XB The number of threads in the x-dimension used for loading - * matrix B. - * @tparam DIM_YB The number of threads in the y-dimension used for loading - * matrix B. - * @param max_m The maximum number of rows in the matrices. - * @param max_n The maximum number of columns in the matrices. - * @param m An array of batch sizes for the number of rows in each matrix. - * @param n An array of batch sizes for the number of columns in each matrix. - * @param k An array of batch sizes for the number of elements in each matrix - * along the K dimension. - * @param global_A_array An array of pointers to the input matrices A. - * @param global_lda An array of leading dimensions for the input matrices A. - * @param global_B_array An array of pointers to the input matrices B. - * @param global_ldb An array of leading dimensions for the input matrices B. - * @param global_C_array An array of pointers to the output matrices C. - * @param global_ldc An array of leading dimensions for the output matrices C. - * @param batchCount The number of matrices in the batch. - * @param stream The CUDA stream to use for the computation. - * @param alpha The scalar value to multiply the matrices by (optional, default - * is nullptr). generate by copilot - */ - -/* - * Why do we need to implement our own matrix multiplication based on the magma - * code? There are two main reasons. First is when we are doing batch matrix - * multiplication, since we need to accumulate the results of the - * multiplications, it is necessary to pass the same memory address of matrix C - * to different multiplications. This way, the accumulation can be done directly - * through atomic operations during the matrix multiplication, avoiding the - * reduction operations after the multiplication. Secondly, when calculating the - * charge density, where C = alpha * A * B + C, the value of alpha might be - * different for the same batch of matrices. Using the standard matrix - * multiplication interface would require breaking down the batch matrix - * multiplication into smaller batches. In practice, it is difficult to - * accumulate a batch. - * - * Moreover, taking into account the specific requirements of our application, - * especially the fact that we can relatively easily control the arrangement of - * the matrix elements, we have only implemented one type of requirement for - * matrix transposition. That is, we have implemented the operation C = alpha * - * A * trans(B) + C under the constraint of column-major order. - * - * Finally, we would like to thank Magma for its contributions to the field of - * scientific computing. - */ - -template -void vbatched_gemm_tn_impl(int max_m, - int max_n, - const int* m, - const int* n, - const int* k, - const T* const* global_A_array, - const int* global_lda, - const T* const* global_B_array, - const int* global_ldb, - T** global_C_array, - const int* global_ldc, - int batchCount, - cudaStream_t stream, - const T* alpha = nullptr) -{ - // The positions of A and B have been swapped here. - // This is because vbatch_gemm__tn_kernel is column major, - // but vatched_gemm_nt_impl is designed to be row major, - - size_t shared_mem_size = 0; - shared_mem_size += (BLK_M + 1) * BLK_K * sizeof(T); - shared_mem_size += (BLK_K + 1) * BLK_N * sizeof(T); - dim3 dimBlock(DIM_X, DIM_Y); - const int max_batch_count = 32768; - - for (int i = 0; i < batchCount; i += max_batch_count) - { - const int ibatch = min(max_batch_count, batchCount - i); - dim3 dimGrid(ceil_div(max_n, BLK_M), - ceil_div(max_m, BLK_N), - ibatch); - const T* alpha_tmp = nullptr; - if (alpha != nullptr) - { - alpha_tmp = alpha + i; - } - - vbatched_gemm_nt_kernel - <<>>( - n + i, m + i, k + i, - global_B_array + i, global_ldb + i, - global_A_array + i, global_lda + i, - global_C_array + i, global_ldc + i, - alpha_tmp); - checkCudaLastError(); - } -} - -#endif // GEMM_TN_VBATCH_CUH \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.cpp deleted file mode 100644 index f4443762f0..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "gint_gpu_vars.h" -#include "source_base/module_device/device.h" - -namespace ModuleGint -{ - -GintGpuVars::GintGpuVars(std::shared_ptr biggrid_info, - const UnitCell& ucell, - const Numerical_Orbital* Phi) -{ -// set device -#ifdef __MPI - dev_id_ = base_device::information::set_device_by_rank(); -#endif - std::vector ylmcoef_h(100); - for (int i = 0; i < 100; i++) - { - ylmcoef_h[i] = ModuleBase::Ylm::ylmcoef[i]; - } - set_ylmcoe_d(ylmcoef_h.data(), &ylmcoef_d); - - const int ntype = ucell.ntype; - std::vector atom_nw_h(ntype); - std::vector ucell_atom_nwl_h(ntype); - for (int i = 0; i < ntype; i++) - { - atom_nw_h[i] = ucell.atoms[i].nw; - ucell_atom_nwl_h[i] = ucell.atoms[i].nwl; - } - checkCuda(cudaMalloc((void**)&atom_nw_d, sizeof(int) * ntype)); - checkCuda(cudaMemcpy(atom_nw_d, atom_nw_h.data(), sizeof(int) * ntype, cudaMemcpyHostToDevice)); - checkCuda(cudaMalloc((void**)&ucell_atom_nwl_d, sizeof(int) * ntype)); - checkCuda(cudaMemcpy(ucell_atom_nwl_d, ucell_atom_nwl_h.data(), sizeof(int) * ntype, cudaMemcpyHostToDevice)); - - dr_uniform = Phi[0].PhiLN(0, 0).dr_uniform; - double max_rcut = 0; - std::vector rcut_h(ntype); - for (int i = 0; i < ntype; i++) - { - rcut_h[i] = Phi[i].getRcut(); - if (rcut_h[i] > max_rcut) - { - max_rcut = rcut_h[i]; - } - } - checkCuda(cudaMalloc((void**)&rcut_d, sizeof(double) * ntype)); - checkCuda(cudaMemcpy(rcut_d, rcut_h.data(), sizeof(double) * ntype, cudaMemcpyHostToDevice)); - nr_max = static_cast(1 / dr_uniform * max_rcut) + 10; - - nwmax = ucell.nwmax; - std::vector psi_u_h(ntype * nwmax * nr_max); - std::vector dpsi_u_h(ntype * nwmax * nr_max); - std::vector d2psi_u_h(ntype * nwmax * nr_max); - // std::vector cannot use data(), so std::vector is used instead - std::vector atom_iw2_new_h(ntype * nwmax); - std::vector atom_iw2_ylm_h(ntype * nwmax); - std::vector atom_iw2_l_h(ntype * nwmax); - for (int i = 0; i < ntype; i++) - { - Atom* atomx = &ucell.atoms[i]; - for (int j = 0; j < atomx->nw; j++) - { - atom_iw2_new_h[i * nwmax + j] = atomx->iw2_new[j]; - atom_iw2_ylm_h[i * nwmax + j] = atomx->iw2_ylm[j]; - atom_iw2_l_h[i * nwmax + j] = atomx->iw2l[j]; - const auto psi_ptr = &Phi[i].PhiLN(atomx->iw2l[j], atomx->iw2n[j]); - const int psi_size = psi_ptr->psi_uniform.size(); - int idx = i * nwmax * nr_max + j * nr_max; - for (int k = 0; k < psi_size; k++) - { - psi_u_h[idx + k] = psi_ptr->psi_uniform[k]; - dpsi_u_h[idx + k] = psi_ptr->dpsi_uniform[k]; - d2psi_u_h[idx + k] = psi_ptr->ddpsi_uniform[k]; - } - } - } - - checkCuda(cudaMalloc((void**)&atom_iw2_new_d, sizeof(bool) * ntype * nwmax)); - checkCuda(cudaMemcpy(atom_iw2_new_d, atom_iw2_new_h.data(), sizeof(bool) * ntype * nwmax, cudaMemcpyHostToDevice)); - checkCuda(cudaMalloc((void**)&atom_iw2_ylm_d, sizeof(int) * ntype * nwmax)); - checkCuda(cudaMemcpy(atom_iw2_ylm_d, atom_iw2_ylm_h.data(), sizeof(int) * ntype * nwmax, cudaMemcpyHostToDevice)); - checkCuda(cudaMalloc((void**)&atom_iw2_l_d, sizeof(int) * ntype * nwmax)); - checkCuda(cudaMemcpy(atom_iw2_l_d, atom_iw2_l_h.data(), sizeof(int) * ntype * nwmax, cudaMemcpyHostToDevice)); - checkCuda(cudaMalloc((void**)&psi_u_d, sizeof(double) * ntype * nwmax * nr_max)); - checkCuda(cudaMemcpy(psi_u_d, psi_u_h.data(), sizeof(double) * ntype * nwmax * nr_max, cudaMemcpyHostToDevice)); - checkCuda(cudaMalloc((void**)&dpsi_u_d, sizeof(double) * ntype * nwmax * nr_max)); - checkCuda(cudaMemcpy(dpsi_u_d, dpsi_u_h.data(), sizeof(double) * ntype * nwmax * nr_max, cudaMemcpyHostToDevice)); - checkCuda(cudaMalloc((void**)&d2psi_u_d, sizeof(double) * ntype * nwmax * nr_max)); - checkCuda(cudaMemcpy(d2psi_u_d, d2psi_u_h.data(), sizeof(double) * ntype * nwmax * nr_max, cudaMemcpyHostToDevice)); - - const int mgrid_num = biggrid_info->get_mgrids_num(); - std::vector mgrids_pos_h(mgrid_num); - for(int i = 0; i < mgrid_num; i++) - { - mgrids_pos_h[i].x = biggrid_info->get_mgrid_coord(i).x; - mgrids_pos_h[i].y = biggrid_info->get_mgrid_coord(i).y; - mgrids_pos_h[i].z = biggrid_info->get_mgrid_coord(i).z; - } - checkCuda(cudaMalloc((void**)&mgrids_pos_d, sizeof(double3) * mgrid_num)); - checkCuda(cudaMemcpy(mgrids_pos_d, mgrids_pos_h.data(), sizeof(double3) * mgrid_num, cudaMemcpyHostToDevice)); - - checkCuda(cudaMalloc((void**)&iat2it_d, sizeof(int) * ucell.nat)); - checkCuda(cudaMemcpy(iat2it_d, ucell.iat2it, sizeof(int) * ucell.nat, cudaMemcpyHostToDevice)); - - gemm_algo_selector(mgrid_num, fastest_matrix_mul, ucell); -} - -GintGpuVars::~GintGpuVars() -{ -#ifdef __MPI - checkCuda(cudaSetDevice(dev_id_)); -#endif - checkCuda(cudaFree(rcut_d)); - checkCuda(cudaFree(atom_nw_d)); - checkCuda(cudaFree(ucell_atom_nwl_d)); - checkCuda(cudaFree(atom_iw2_new_d)); - checkCuda(cudaFree(atom_iw2_ylm_d)); - checkCuda(cudaFree(atom_iw2_l_d)); - checkCuda(cudaFree(psi_u_d)); - checkCuda(cudaFree(dpsi_u_d)); - checkCuda(cudaFree(d2psi_u_d)); - checkCuda(cudaFree(mgrids_pos_d)); - checkCuda(cudaFree(iat2it_d)); -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.h b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.h deleted file mode 100644 index 7d2515b3b0..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_gpu_vars.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include -#include "set_const_mem.cuh" -#include "source_base/ylm.h" -#include "source_cell/unitcell.h" -#include "source_cell/atom_spec.h" -#include "module_hamilt_lcao/module_gint/temp_gint/biggrid_info.h" -#include "gint_helper.cuh" -#include "module_hamilt_lcao/module_gint/kernels/cuda/gemm_selector.cuh" - -namespace ModuleGint -{ - -class GintGpuVars -{ - public: - GintGpuVars(std::shared_ptr bgrid_info, - const UnitCell& ucell, - const Numerical_Orbital* Phi); - ~GintGpuVars(); - - int nwmax; - double dr_uniform; - double nr_max; - // ylmcoef_d is __constant__ memory, no need to cudaFree - double* ylmcoef_d = nullptr; - double* rcut_d = nullptr; - int* atom_nw_d = nullptr; - int* ucell_atom_nwl_d = nullptr; - bool* atom_iw2_new_d = nullptr; - int* atom_iw2_ylm_d = nullptr; - int* atom_iw2_l_d = nullptr; - double* psi_u_d = nullptr; - double* dpsi_u_d = nullptr; - double* d2psi_u_d = nullptr; - double3* mgrids_pos_d = nullptr; - int* iat2it_d = nullptr; - - // the index of gpu device - int dev_id_ = 0; - matrix_multiple_func_type fastest_matrix_mul; - -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_helper.cuh b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_helper.cuh deleted file mode 100644 index 7a6e925531..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/gint_helper.cuh +++ /dev/null @@ -1,75 +0,0 @@ -#pragma once -#include - -// if exponent is an integer between 0 and 5 (the most common cases in gint) and -// and exp is a variable that cannot be determined at compile time (which means the compiler cannot optimize the code), -// pow_int is much faster than std::pow -template -__forceinline__ __device__ T pow_int(const T base, const int exp) -{ - switch (exp) - { - case 0: - return 1.0; - case 1: - return base; - case 2: - return base * base; - case 3: - return base * base * base; - case 4: - return base * base * base * base; - case 5: - return base * base * base * base * base; - default: - double result = std::pow(base, exp); - return result; - } -} - -template -__forceinline__ __device__ T warpReduceSum(T val) -{ - val += __shfl_xor_sync(0xffffffff, val, 16, 32); - val += __shfl_xor_sync(0xffffffff, val, 8, 32); - val += __shfl_xor_sync(0xffffffff, val, 4, 32); - val += __shfl_xor_sync(0xffffffff, val, 2, 32); - val += __shfl_xor_sync(0xffffffff, val, 1, 32); - return val; -} - -inline int ceil_div(const int a, const int b) -{ - return a / b + (a % b != 0 && (a ^ b) > 0); -} - -inline void check(cudaError_t result, char const *const func, const char *const file, - int const line) { - if (result) { - fprintf(stderr, "CUDA error at %s:%d code=%d(%s) \"%s\" \n", file, line, - static_cast(result), cudaGetErrorString(result), func); - exit(EXIT_FAILURE); - } -} - -inline void __getLastCudaError(const char *file, - const int line) -{ - cudaError_t err = cudaGetLastError(); - - if (cudaSuccess != err) { - fprintf(stderr, - "%s(%i) : getLastCudaError() CUDA error :" - " (%d) %s.\n", - file, line, static_cast(err), - cudaGetErrorString(err)); - exit(EXIT_FAILURE); - } -} - -// This will output the proper CUDA error strings in the event -// that a CUDA host call returns an error -#define checkCuda(val) check((val), #val, __FILE__, __LINE__) - -// This will output the proper error string when calling cudaGetLastError -#define checkCudaLastError() __getLastCudaError(__FILE__, __LINE__) \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.cu b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.cu deleted file mode 100644 index edc07959d4..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.cu +++ /dev/null @@ -1,466 +0,0 @@ -#include "phi_operator_gpu.h" -#include "phi_operator_kernel.cuh" -#include "dgemm_vbatch.h" -#include - -namespace ModuleGint -{ -PhiOperatorGpu::PhiOperatorGpu(std::shared_ptr gint_gpu_vars, cudaStream_t stream) -:gint_gpu_vars_(gint_gpu_vars), stream_(stream), -mgrids_num_(BatchBigGrid::get_bgrid_info()->get_mgrids_num()), -atoms_num_info_(BatchBigGrid::get_max_batch_size(), stream_, true), -bgrids_phi_len_(BatchBigGrid::get_max_batch_size(), stream_, true), -bgrids_phi_start_(BatchBigGrid::get_max_batch_size(), stream_, true), -atoms_iat_(BatchBigGrid::get_max_atoms_num(), stream_, true), -atoms_bgrids_rcoords_(BatchBigGrid::get_max_atoms_num(), stream_, true), -atoms_phi_start_(BatchBigGrid::get_max_atoms_num(), stream_, true), -mgrids_local_idx_batch_(BatchBigGrid::get_max_batch_size() - * BatchBigGrid::get_bgrid_info()->get_mgrids_num(), stream_, true), -gemm_m_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_n_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_k_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_lda_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_ldb_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_ldc_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_A_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_B_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_C_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true), -gemm_alpha_(BatchBigGrid::get_max_atom_pairs_num(), stream_, true) -{ - checkCuda(cudaEventCreateWithFlags(&event_, cudaEventDisableTiming)); -} - -PhiOperatorGpu::~PhiOperatorGpu() -{ - checkCuda(cudaEventDestroy(event_)); -} - -void PhiOperatorGpu::set_bgrid_batch(std::shared_ptr bgrid_batch) -{ - bgrid_batch_ = bgrid_batch; - auto atoms_num_info_h = atoms_num_info_.get_host_ptr(); - auto bgrids_phi_len_h = bgrids_phi_len_.get_host_ptr(); - auto bgrids_phi_start_h = bgrids_phi_start_.get_host_ptr(); - auto atoms_iat_h = atoms_iat_.get_host_ptr(); - auto atoms_bgrids_rcoords_h = atoms_bgrids_rcoords_.get_host_ptr(); - auto atoms_phi_start_h = atoms_phi_start_.get_host_ptr(); - auto mgrids_local_idx_batch_h = mgrids_local_idx_batch_.get_host_ptr(); - int i = 0; - int j = 0; - int atoms_accum = 0; - phi_len_ = 0; - int phi_start = 0; - std::vector mgrids_local_idx; - checkCuda(cudaEventSynchronize(event_)); - for (const auto& bgrid : bgrid_batch->get_bgrids()) - { - atoms_num_info_h[i] = make_int2(bgrid->get_atoms_num(), atoms_accum); - atoms_accum += bgrid->get_atoms_num(); - bgrids_phi_start_h[i] = phi_start; - bgrid->set_mgrids_local_idx(mgrids_local_idx); - std::copy(mgrids_local_idx.begin(), mgrids_local_idx.end(), - mgrids_local_idx_batch_h + i * mgrids_num_); - int phi_len_bgrid = 0; - for (const auto& atom : bgrid->get_atoms()) - { - atoms_iat_h[j] = atom->get_iat(); - Vec3d rcoord = bgrid->get_bgrid_atom_rcoord(atom); - atoms_bgrids_rcoords_h[j] = make_double3(rcoord.x, rcoord.y, rcoord.z); - atoms_phi_start_h[j] = phi_len_ + phi_len_bgrid; - phi_len_bgrid += atom->get_nw(); - j++; - } - bgrids_phi_len_h[i] = phi_len_bgrid; - phi_len_ += phi_len_bgrid * bgrid->get_mgrids_num(); - phi_start += phi_len_bgrid * bgrid->get_mgrids_num(); - i++; - } - - atoms_num_info_.copy_host_to_device_async(bgrid_batch->get_batch_size()); - bgrids_phi_len_.copy_host_to_device_async(bgrid_batch->get_batch_size()); - bgrids_phi_start_.copy_host_to_device_async(bgrid_batch->get_batch_size()); - atoms_iat_.copy_host_to_device_async(bgrid_batch->get_atoms_num()); - atoms_bgrids_rcoords_.copy_host_to_device_async(bgrid_batch->get_atoms_num()); - atoms_phi_start_.copy_host_to_device_async(bgrid_batch->get_atoms_num()); - mgrids_local_idx_batch_.copy_host_to_device_async(bgrid_batch->get_batch_size() * mgrids_num_); - checkCuda(cudaEventRecord(event_, stream_)); -} - -void PhiOperatorGpu::set_phi(double* phi_d) const -{ - // checkCuda(cudaMemsetAsync(phi_d, 0, phi_len_ * sizeof(double), stream_)); - dim3 grid_dim(mgrids_num_, bgrid_batch_->get_batch_size()); - dim3 threads_per_block(64); - set_phi_kernel<<>>( - gint_gpu_vars_->nwmax, - mgrids_num_, - gint_gpu_vars_->nr_max, - gint_gpu_vars_->dr_uniform, - gint_gpu_vars_->ylmcoef_d, - gint_gpu_vars_->ucell_atom_nwl_d, - gint_gpu_vars_->atom_iw2_new_d, - gint_gpu_vars_->atom_iw2_ylm_d, - gint_gpu_vars_->atom_nw_d, - gint_gpu_vars_->iat2it_d, - gint_gpu_vars_->rcut_d, - gint_gpu_vars_->psi_u_d, - gint_gpu_vars_->dpsi_u_d, - gint_gpu_vars_->mgrids_pos_d, - atoms_iat_.get_device_ptr(), - atoms_bgrids_rcoords_.get_device_ptr(), - atoms_num_info_.get_device_ptr(), - atoms_phi_start_.get_device_ptr(), - bgrids_phi_len_.get_device_ptr(), - phi_d); - checkCudaLastError(); -} - -void PhiOperatorGpu::set_phi_dphi(double* phi_d, double* dphi_x_d, double* dphi_y_d, double* dphi_z_d) const -{ - dim3 grid_dim(mgrids_num_, bgrid_batch_->get_batch_size()); - dim3 threads_per_block(64); - set_phi_dphi_kernel<<>>( - gint_gpu_vars_->nwmax, - mgrids_num_, - gint_gpu_vars_->nr_max, - gint_gpu_vars_->dr_uniform, - gint_gpu_vars_->ylmcoef_d, - gint_gpu_vars_->ucell_atom_nwl_d, - gint_gpu_vars_->atom_iw2_new_d, - gint_gpu_vars_->atom_iw2_ylm_d, - gint_gpu_vars_->atom_iw2_l_d, - gint_gpu_vars_->atom_nw_d, - gint_gpu_vars_->iat2it_d, - gint_gpu_vars_->rcut_d, - gint_gpu_vars_->psi_u_d, - gint_gpu_vars_->dpsi_u_d, - gint_gpu_vars_->mgrids_pos_d, - atoms_iat_.get_device_ptr(), - atoms_bgrids_rcoords_.get_device_ptr(), - atoms_num_info_.get_device_ptr(), - atoms_phi_start_.get_device_ptr(), - bgrids_phi_len_.get_device_ptr(), - phi_d, - dphi_x_d, - dphi_y_d, - dphi_z_d); - checkCudaLastError(); -} - -void PhiOperatorGpu::set_ddphi(double* ddphi_xx_d, double* ddphi_xy_d, double* ddphi_xz_d, - double* ddphi_yy_d, double* ddphi_yz_d, double* ddphi_zz_d) const -{ - // Since the underlying implementation of `set_ddphi` uses `ddphi +=` instead of `ddphi =`, - // the ddphi array needs to be zeroed out at the beginning of the function. - checkCuda(cudaMemsetAsync(ddphi_xx_d, 0, phi_len_ * sizeof(double), stream_)); - checkCuda(cudaMemsetAsync(ddphi_xy_d, 0, phi_len_ * sizeof(double), stream_)); - checkCuda(cudaMemsetAsync(ddphi_xz_d, 0, phi_len_ * sizeof(double), stream_)); - checkCuda(cudaMemsetAsync(ddphi_yy_d, 0, phi_len_ * sizeof(double), stream_)); - checkCuda(cudaMemsetAsync(ddphi_yz_d, 0, phi_len_ * sizeof(double), stream_)); - checkCuda(cudaMemsetAsync(ddphi_zz_d, 0, phi_len_ * sizeof(double), stream_)); - dim3 grid_dim(mgrids_num_, bgrid_batch_->get_batch_size()); - dim3 threads_per_block(64); - set_ddphi_kernel<<>>( - gint_gpu_vars_->nwmax, - mgrids_num_, - gint_gpu_vars_->nr_max, - gint_gpu_vars_->dr_uniform, - gint_gpu_vars_->ylmcoef_d, - gint_gpu_vars_->ucell_atom_nwl_d, - gint_gpu_vars_->atom_iw2_new_d, - gint_gpu_vars_->atom_iw2_ylm_d, - gint_gpu_vars_->atom_iw2_l_d, - gint_gpu_vars_->atom_nw_d, - gint_gpu_vars_->iat2it_d, - gint_gpu_vars_->rcut_d, - gint_gpu_vars_->psi_u_d, - gint_gpu_vars_->dpsi_u_d, - gint_gpu_vars_->mgrids_pos_d, - atoms_iat_.get_device_ptr(), - atoms_bgrids_rcoords_.get_device_ptr(), - atoms_num_info_.get_device_ptr(), - atoms_phi_start_.get_device_ptr(), - bgrids_phi_len_.get_device_ptr(), - ddphi_xx_d, - ddphi_xy_d, - ddphi_xz_d, - ddphi_yy_d, - ddphi_yz_d, - ddphi_zz_d); - checkCudaLastError(); -} - -void PhiOperatorGpu::phi_mul_vldr3( - const double* vl_d, - const double dr3, - const double* phi_d, - double* result_d) const -{ - dim3 grid_dim(mgrids_num_, bgrid_batch_->get_batch_size()); - dim3 threads_per_block(64); - phi_mul_vldr3_kernel<<>>( - vl_d, - dr3, - phi_d, - mgrids_num_, - mgrids_local_idx_batch_.get_device_ptr(), - bgrids_phi_len_.get_device_ptr(), - bgrids_phi_start_.get_device_ptr(), - result_d); - checkCudaLastError(); -} - -void PhiOperatorGpu::phi_mul_phi( - const double* phi_d, - const double* phi_vldr3_d, - HContainer& hRGint, - double* hr_d) const -{ - // ap_num means number of atom pairs - int ap_num = 0; - int max_m = 0; - int max_n = 0; - int max_k = mgrids_num_; - checkCuda(cudaEventSynchronize(event_)); - for (int i = 0; i < bgrid_batch_->get_batch_size(); i++) - { - auto bgrid = bgrid_batch_->get_bgrids()[i]; - // the length of phi on a mesh grid - const int phi_len_mgrid = bgrid->get_phi_len(); - const int pre_atoms = atoms_num_info_.get_host_ptr()[i].y; - for (int ia_1 = 0; ia_1 < bgrid->get_atoms_num(); ia_1++) - { - auto atom_1 = bgrid->get_atoms()[ia_1]; - const int iat_1 = atom_1->get_iat(); - const auto& r_1 = atom_1->get_R(); - const int nw1 = atom_1->get_nw(); - const int phi_1_offset = atoms_phi_start_.get_host_ptr()[pre_atoms + ia_1]; - - for (int ia_2 = 0; ia_2 < bgrid->get_atoms_num(); ia_2++) - { - auto atom_2 = bgrid->get_atoms()[ia_2]; - const int iat_2 = atom_2->get_iat(); - const auto& r_2 = atom_2->get_R(); - const int nw2 = atom_2->get_nw(); - - if(iat_1 > iat_2) - { continue; } - - int hr_offset = hRGint.find_matrix_offset(iat_1, iat_2, r_1 - r_2); - if (hr_offset == -1) - { continue; } - - const int phi_2_offset = atoms_phi_start_.get_host_ptr()[pre_atoms + ia_2]; - - gemm_A_.get_host_ptr()[ap_num] = phi_d + phi_1_offset; - gemm_B_.get_host_ptr()[ap_num] = phi_vldr3_d + phi_2_offset; - gemm_C_.get_host_ptr()[ap_num] = hr_d + hr_offset; - gemm_lda_.get_host_ptr()[ap_num] = phi_len_mgrid; - gemm_ldb_.get_host_ptr()[ap_num] = phi_len_mgrid; - gemm_ldc_.get_host_ptr()[ap_num] = nw2; - gemm_m_.get_host_ptr()[ap_num] = nw1; - gemm_n_.get_host_ptr()[ap_num] = nw2; - gemm_k_.get_host_ptr()[ap_num] = bgrid->get_mgrids_num(); - ap_num++; - - max_m = std::max(max_m, nw1); - max_n = std::max(max_n, nw2); - } - } - } - - gemm_A_.copy_host_to_device_async(ap_num); - gemm_B_.copy_host_to_device_async(ap_num); - gemm_C_.copy_host_to_device_async(ap_num); - gemm_lda_.copy_host_to_device_async(ap_num); - gemm_ldb_.copy_host_to_device_async(ap_num); - gemm_ldc_.copy_host_to_device_async(ap_num); - gemm_m_.copy_host_to_device_async(ap_num); - gemm_n_.copy_host_to_device_async(ap_num); - gemm_k_.copy_host_to_device_async(ap_num); - checkCuda(cudaEventRecord(event_, stream_)); - - dgemm_tn_vbatch(max_m, - max_n, - max_k, - gemm_m_.get_device_ptr(), - gemm_n_.get_device_ptr(), - gemm_k_.get_device_ptr(), - gemm_A_.get_device_ptr(), - gemm_lda_.get_device_ptr(), - gemm_B_.get_device_ptr(), - gemm_ldb_.get_device_ptr(), - gemm_C_.get_device_ptr(), - gemm_ldc_.get_device_ptr(), - ap_num, - stream_, - nullptr); -} - -void PhiOperatorGpu::phi_mul_dm( - const double* phi_d, - const double* dm_d, - const HContainer& dm, - const bool is_symm, - double* phi_dm_d) -{ - checkCuda(cudaMemsetAsync(phi_dm_d, 0, phi_len_ * sizeof(double), stream_)); - // ap_num means number of atom pairs - int ap_num = 0; - int max_m = mgrids_num_; - int max_n = 0; - int max_k = 0; - checkCuda(cudaEventSynchronize(event_)); - for (int i = 0; i < bgrid_batch_->get_batch_size(); i++) - { - auto bgrid = bgrid_batch_->get_bgrids()[i]; - // the length of phi on a mesh grid - const int phi_len_mgrid = bgrid->get_phi_len(); - const int pre_atoms = atoms_num_info_.get_host_ptr()[i].y; - for (int ia_1 = 0; ia_1 < bgrid->get_atoms_num(); ia_1++) - { - auto atom_1 = bgrid->get_atoms()[ia_1]; - const int iat_1 = atom_1->get_iat(); - const auto& r_1 = atom_1->get_R(); - const int nw1 = atom_1->get_nw(); - const int phi_1_offset = atoms_phi_start_.get_host_ptr()[pre_atoms + ia_1]; - int ia_2 = is_symm ? ia_1 : 0; - for (; ia_2 < bgrid->get_atoms_num(); ia_2++) - { - auto atom_2 = bgrid->get_atoms()[ia_2]; - const int iat_2 = atom_2->get_iat(); - const auto& r_2 = atom_2->get_R(); - const int nw2 = atom_2->get_nw(); - - int dm_offset = dm.find_matrix_offset(iat_1, iat_2, r_1-r_2); - if (dm_offset == -1) - { continue; } - - const int phi_dm_offset = atoms_phi_start_.get_host_ptr()[pre_atoms + ia_2]; - - gemm_A_.get_host_ptr()[ap_num] = phi_d + phi_1_offset; - gemm_B_.get_host_ptr()[ap_num] = dm_d + dm_offset; - gemm_C_.get_host_ptr()[ap_num] = phi_dm_d + phi_dm_offset; - gemm_lda_.get_host_ptr()[ap_num] = phi_len_mgrid; - gemm_ldb_.get_host_ptr()[ap_num] = nw2; - gemm_ldc_.get_host_ptr()[ap_num] = phi_len_mgrid; - gemm_m_.get_host_ptr()[ap_num] = mgrids_num_; - gemm_n_.get_host_ptr()[ap_num] = nw2; - gemm_k_.get_host_ptr()[ap_num] = nw1; - gemm_alpha_.get_host_ptr()[ap_num] = ia_1 == ia_2 ? 1.0 : 2.0; - ap_num++; - - max_n = std::max(max_n, nw2); - max_k = std::max(max_k, nw1); - } - } - } - - gemm_A_.copy_host_to_device_async(ap_num); - gemm_B_.copy_host_to_device_async(ap_num); - gemm_C_.copy_host_to_device_async(ap_num); - gemm_lda_.copy_host_to_device_async(ap_num); - gemm_ldb_.copy_host_to_device_async(ap_num); - gemm_ldc_.copy_host_to_device_async(ap_num); - gemm_m_.copy_host_to_device_async(ap_num); - gemm_n_.copy_host_to_device_async(ap_num); - gemm_k_.copy_host_to_device_async(ap_num); - if(is_symm) - { - // if is_symm == false, gemm_alpha_ always equals 1.0, - // so we don't need to copy it to device - gemm_alpha_.copy_host_to_device_async(ap_num); - } - checkCuda(cudaEventRecord(event_, stream_)); - - auto alpha_ptr = is_symm ? gemm_alpha_.get_device_ptr() : nullptr; - dgemm_nn_vbatch(max_m, - max_n, - max_k, - gemm_m_.get_device_ptr(), - gemm_n_.get_device_ptr(), - gemm_k_.get_device_ptr(), - gemm_A_.get_device_ptr(), - gemm_lda_.get_device_ptr(), - gemm_B_.get_device_ptr(), - gemm_ldb_.get_device_ptr(), - gemm_C_.get_device_ptr(), - gemm_ldc_.get_device_ptr(), - ap_num, - stream_, - alpha_ptr); -} - -void PhiOperatorGpu::phi_dot_phi( - const double* phi_i_d, - const double* phi_j_d, - double* rho_d) const -{ - dim3 grid_dim(mgrids_num_, bgrid_batch_->get_batch_size()); - dim3 threads_per_block(64); - phi_dot_phi_kernel<<>>( - phi_i_d, - phi_j_d, - mgrids_num_, - mgrids_local_idx_batch_.get_device_ptr(), - bgrids_phi_len_.get_device_ptr(), - bgrids_phi_start_.get_device_ptr(), - rho_d); - checkCudaLastError(); -} - -void PhiOperatorGpu::phi_dot_dphi( - const double* phi_d, - const double* dphi_x_d, - const double* dphi_y_d, - const double* dphi_z_d, - double* fvl_d) const -{ - dim3 grid_dim(bgrid_batch_->get_max_atoms_num_per_bgrid(), - bgrid_batch_->get_batch_size()); - dim3 threads_per_block(32); - phi_dot_dphi_kernel<<>>( - phi_d, - dphi_x_d, - dphi_y_d, - dphi_z_d, - mgrids_num_, - bgrids_phi_len_.get_device_ptr(), - atoms_num_info_.get_device_ptr(), - atoms_phi_start_.get_device_ptr(), - atoms_iat_.get_device_ptr(), - gint_gpu_vars_->iat2it_d, - gint_gpu_vars_->atom_nw_d, - fvl_d); - checkCudaLastError(); -} - -void PhiOperatorGpu::phi_dot_dphi_r( - const double* phi_d, - const double* dphi_x_d, - const double* dphi_y_d, - const double* dphi_z_d, - double* svl_d) const -{ - dim3 grid_dim(mgrids_num_, - bgrid_batch_->get_batch_size()); - dim3 threads_per_block(32); - phi_dot_dphi_r_kernel<<>>( - phi_d, - dphi_x_d, - dphi_y_d, - dphi_z_d, - mgrids_num_, - bgrids_phi_len_.get_device_ptr(), - atoms_num_info_.get_device_ptr(), - atoms_phi_start_.get_device_ptr(), - atoms_iat_.get_device_ptr(), - atoms_bgrids_rcoords_.get_device_ptr(), - gint_gpu_vars_->mgrids_pos_d, - gint_gpu_vars_->iat2it_d, - gint_gpu_vars_->atom_nw_d, - svl_d); - checkCudaLastError(); -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.h b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.h deleted file mode 100644 index 4988e265ce..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_gpu.h +++ /dev/null @@ -1,110 +0,0 @@ -#pragma once -#include -#include - -#include "module_hamilt_lcao/module_gint/temp_gint/batch_biggrid.h" -#include "gint_helper.cuh" -#include "gint_gpu_vars.h" -#include "cuda_mem_wrapper.h" - -namespace ModuleGint -{ - -class PhiOperatorGpu -{ - -public: - PhiOperatorGpu(std::shared_ptr gint_gpu_vars, cudaStream_t stream = 0); - ~PhiOperatorGpu(); - - void set_bgrid_batch(std::shared_ptr bgrid_batch); - - void set_phi(double* phi_d) const; - - void set_phi_dphi(double* phi_d, double* dphi_x_d, double* dphi_y_d, double* dphi_z_d) const; - - void set_ddphi(double* ddphi_xx_d, double* ddphi_xy_d, double* ddphi_xz_d, - double* ddphi_yy_d, double* ddphi_yz_d, double* ddphi_zz_d) const; - - void phi_mul_vldr3( - const double* vl_d, - const double dr3, - const double* phi_d, - double* result_d) const; - - void phi_mul_phi( - const double* phi_d, - const double* phi_vldr3_d, - HContainer& hRGint, - double* hr_d) const; - - void phi_mul_dm( - const double* phi_d, - const double* dm_d, - const HContainer& dm, - const bool is_symm, - double* phi_dm_d); - - void phi_dot_phi( - const double* phi_i_d, - const double* phi_j_d, - double* rho_d) const; - - void phi_dot_dphi( - const double* phi_d, - const double* dphi_x_d, - const double* dphi_y_d, - const double* dphi_z_d, - double* fvl_d) const; - - void phi_dot_dphi_r( - const double* phi_d, - const double* dphi_x_d, - const double* dphi_y_d, - const double* dphi_z_d, - double* svl_d) const; - -private: - std::shared_ptr bgrid_batch_; - std::shared_ptr gint_gpu_vars_; - - // the number of meshgrids on a biggrid - int mgrids_num_; - - int phi_len_; - - cudaStream_t stream_ = 0; - cudaEvent_t event_; - - // The first number in every group of two represents the number of atoms on that bigcell. - // The second number represents the cumulative number of atoms up to that bigcell. - CudaMemWrapper atoms_num_info_; - - // the iat of each atom - CudaMemWrapper atoms_iat_; - - // atoms_bgrids_rcoords_ here represents the relative coordinates from the big grid to the atoms - CudaMemWrapper atoms_bgrids_rcoords_; - - // the start index of the phi array for each atom - CudaMemWrapper atoms_phi_start_; - // The length of phi for a single meshgrid on each big grid. - CudaMemWrapper bgrids_phi_len_; - // The start index of the phi array for each big grid. - CudaMemWrapper bgrids_phi_start_; - // Mapping of the index of meshgrid in the batch of biggrids to the index of meshgrid in the local cell - CudaMemWrapper mgrids_local_idx_batch_; - - mutable CudaMemWrapper gemm_m_; - mutable CudaMemWrapper gemm_n_; - mutable CudaMemWrapper gemm_k_; - mutable CudaMemWrapper gemm_lda_; - mutable CudaMemWrapper gemm_ldb_; - mutable CudaMemWrapper gemm_ldc_; - mutable CudaMemWrapper gemm_A_; - mutable CudaMemWrapper gemm_B_; - mutable CudaMemWrapper gemm_C_; - mutable CudaMemWrapper gemm_alpha_; -}; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cu b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cu deleted file mode 100644 index 5db767f501..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cu +++ /dev/null @@ -1,580 +0,0 @@ -#include "phi_operator_kernel.cuh" -#include "gint_helper.cuh" -#include "sph.cuh" - -namespace ModuleGint -{ - -__global__ void set_phi_kernel( - const int nwmax, - const int mgrids_num, - const int nrmax, - const double dr_uniform, - const double* __restrict__ ylmcoef, - const int* __restrict__ ucell_atom_nwl, - const bool* __restrict__ atom_iw2_new, - const int* __restrict__ atom_iw2_ylm, - const int* __restrict__ atom_nw, - const int* __restrict__ iat2it, - const double* __restrict__ rcut, - const double* __restrict__ psi_u, - const double* __restrict__ dpsi_u, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ bgrids_phi_len, - double* __restrict__ phi) -{ - const int bgrid_id = blockIdx.y; - const int mgrid_id = blockIdx.x; - const int atoms_num = atoms_num_info[bgrid_id].x; - const int pre_atoms_num = atoms_num_info[bgrid_id].y; - const double3 mgrid_pos = mgrids_pos[mgrid_id]; - - for (int atom_id = threadIdx.x; atom_id < atoms_num; atom_id += blockDim.x) - { - const int atom_type = iat2it[atoms_iat[atom_id + pre_atoms_num]]; - const double3 rcoord = atoms_bgrids_rcoords[atom_id + pre_atoms_num]; // rcoord is the ralative coordinate of an atom and a biggrid - const double3 coord = make_double3(mgrid_pos.x-rcoord.x, // coord is the relative coordinate of an atom and a meshgrid - mgrid_pos.y-rcoord.y, - mgrid_pos.z-rcoord.z); - double dist = norm3d(coord.x, coord.y, coord.z); - if (dist < rcut[atom_type]) - { - if (dist < 1.0E-9) - { dist += 1.0E-9; } - // since nwl is less or equal than 5, the size of ylma is (5+1)^2 - double ylma[36]; - const int nwl = ucell_atom_nwl[atom_type]; - sph_harm(nwl, ylmcoef, coord.x/dist, coord.y/dist, coord.z/dist, ylma); - - const double pos = dist / dr_uniform; - const int ip = static_cast(pos); - const double dx = pos - ip; - const double dx2 = dx * dx; - const double dx3 = dx2 * dx; - - const double c3 = 3.0 * dx2 - 2.0 * dx3; - const double c1 = 1.0 - c3; - const double c2 = (dx - 2.0 * dx2 + dx3) * dr_uniform; - const double c4 = (dx3 - dx2) * dr_uniform; - - double psi = 0; - const int it_nw = atom_type * nwmax; - int iw_nr = it_nw * nrmax + ip; - int phi_idx = atoms_phi_start[atom_id + pre_atoms_num] + - bgrids_phi_len[bgrid_id] * mgrid_id; - - for (int iw = 0; iw < atom_nw[atom_type]; iw++, iw_nr += nrmax) - { - if (atom_iw2_new[it_nw + iw]) - { - psi = c1 * psi_u[iw_nr] + c2 * dpsi_u[iw_nr] - + c3 * psi_u[iw_nr + 1] + c4 * dpsi_u[iw_nr + 1]; - } - phi[phi_idx + iw] = psi * ylma[atom_iw2_ylm[it_nw + iw]]; - } - } - else - { - int phi_idx = atoms_phi_start[atom_id + pre_atoms_num] + - bgrids_phi_len[bgrid_id] * mgrid_id; - for (int iw = 0; iw < atom_nw[atom_type]; iw++) - { - phi[phi_idx + iw] = 0.0; - } - } - } -} - -__global__ void set_phi_dphi_kernel( - const int nwmax, - const int mgrids_num, - const int nrmax, - const double dr_uniform, - const double* __restrict__ ylmcoef, - const int* __restrict__ ucell_atom_nwl, - const bool* __restrict__ atom_iw2_new, - const int* __restrict__ atom_iw2_ylm, - const int* __restrict__ atom_iw2_l, - const int* __restrict__ atom_nw, - const int* __restrict__ iat2it, - const double* __restrict__ rcut, - const double* __restrict__ psi_u, - const double* __restrict__ dpsi_u, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ bgrids_phi_len, - double* __restrict__ phi, - double* __restrict__ dphi_x, - double* __restrict__ dphi_y, - double* __restrict__ dphi_z) -{ - const int bgrid_id = blockIdx.y; - const int mgrid_id = blockIdx.x; - const int atoms_num = atoms_num_info[bgrid_id].x; - const int pre_atoms_num = atoms_num_info[bgrid_id].y; - const double3 mgrid_pos = mgrids_pos[mgrid_id]; - - for (int atom_id = threadIdx.x; atom_id < atoms_num; atom_id += blockDim.x) - { - const int atom_type = iat2it[atoms_iat[atom_id + pre_atoms_num]]; - const double3 rcoord = atoms_bgrids_rcoords[atom_id + pre_atoms_num]; - const double3 coord = make_double3(mgrid_pos.x-rcoord.x, - mgrid_pos.y-rcoord.y, - mgrid_pos.z-rcoord.z); - double dist = norm3d(coord.x, coord.y, coord.z); - if (dist < rcut[atom_type]) - { - if (dist < 1.0E-9) - { dist += 1.0E-9; } - // since nwl is less or equal than 5, the size of rly is (5+1)^2 - // size of grly = 36 * 3 - double rly[36]; - double grly[36 * 3]; - const int nwl = ucell_atom_nwl[atom_type]; - grad_rl_sph_harm(nwl, ylmcoef, coord.x, coord.y, coord.z, rly, grly); - - // interpolation - const double pos = dist / dr_uniform; - const int ip = static_cast(pos); - const double x0 = pos - ip; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - double tmp = 0; - double dtmp = 0; - const int it_nw = atom_type * nwmax; - int iw_nr = it_nw * nrmax + ip; - int phi_idx = atoms_phi_start[atom_id + pre_atoms_num] + - bgrids_phi_len[bgrid_id] * mgrid_id; - for (int iw = 0; iw < atom_nw[atom_type]; iw++, iw_nr += nrmax) - { - if (atom_iw2_new[it_nw + iw]) - { - tmp = x12 * (psi_u[iw_nr] * x3 + psi_u[iw_nr + 3] * x0) - + x03 * (psi_u[iw_nr + 1] * x2 - psi_u[iw_nr + 2] * x1); - dtmp = x12 * (dpsi_u[iw_nr] * x3 + dpsi_u[iw_nr + 3] * x0) - + x03 * (dpsi_u[iw_nr + 1] * x2 - dpsi_u[iw_nr + 2] * x1); - } - const int iw_l = atom_iw2_l[it_nw + iw]; - const int idx_ylm = atom_iw2_ylm [it_nw + iw]; - const double rl = pow_int(dist, iw_l); - const double tmprl = tmp / rl; - - // if phi == nullptr, it means that we only need dphi. - if(phi != nullptr) - { - phi[phi_idx + iw] = tmprl * rly[idx_ylm]; - } - // derivative of wave functions with respect to atom positions. - const double tmpdphi_rly = (dtmp - tmp * iw_l / dist) / rl * rly[idx_ylm] / dist; - - dphi_x[phi_idx + iw] = tmpdphi_rly * coord.x + tmprl * grly[idx_ylm * 3 + 0]; - dphi_y[phi_idx + iw] = tmpdphi_rly * coord.y + tmprl * grly[idx_ylm * 3 + 1]; - dphi_z[phi_idx + iw] = tmpdphi_rly * coord.z + tmprl * grly[idx_ylm * 3 + 2]; - } - } - else - { - int phi_idx = atoms_phi_start[atom_id + pre_atoms_num] + - bgrids_phi_len[bgrid_id] * mgrid_id; - for (int iw = 0; iw < atom_nw[atom_type]; iw++) - { - if(phi != nullptr) - { - phi[phi_idx + iw] = 0.0; - } - dphi_x[phi_idx + iw] = 0.0; - dphi_y[phi_idx + iw] = 0.0; - dphi_z[phi_idx + iw] = 0.0; - } - } - } -} - -// The code for `set_ddphi_kernel` is quite difficult to understand. -// To grasp it, you better refer to the CPU function `set_ddphi` -__global__ void set_ddphi_kernel( - const int nwmax, - const int mgrids_num, - const int nrmax, - const double dr_uniform, - const double* __restrict__ ylmcoef, - const int* __restrict__ ucell_atom_nwl, - const bool* __restrict__ atom_iw2_new, - const int* __restrict__ atom_iw2_ylm, - const int* __restrict__ atom_iw2_l, - const int* __restrict__ atom_nw, - const int* __restrict__ iat2it, - const double* __restrict__ rcut, - const double* __restrict__ psi_u, - const double* __restrict__ dpsi_u, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ bgrids_phi_len, - double* __restrict__ ddphi_xx, - double* __restrict__ ddphi_xy, - double* __restrict__ ddphi_xz, - double* __restrict__ ddphi_yy, - double* __restrict__ ddphi_yz, - double* __restrict__ ddphi_zz) -{ - const int bgrid_id = blockIdx.y; - const int mgrid_id = blockIdx.x; - const int atoms_num = atoms_num_info[bgrid_id].x; - const int pre_atoms_num = atoms_num_info[bgrid_id].y; - const double3 mgrid_pos = mgrids_pos[mgrid_id]; - - for (int atom_id = threadIdx.x; atom_id < atoms_num; atom_id += blockDim.x) - { - const int atom_type = iat2it[atoms_iat[atom_id + pre_atoms_num]]; - const double3 rcoord = atoms_bgrids_rcoords[atom_id + pre_atoms_num]; - double coord[3]{mgrid_pos.x-rcoord.x, - mgrid_pos.y-rcoord.y, - mgrid_pos.z-rcoord.z}; - double dist = norm3d(coord[0], coord[1], coord[2]); - if (dist < rcut[atom_type]) - { - int phi_idx = atoms_phi_start[atom_id + pre_atoms_num] + - bgrids_phi_len[bgrid_id] * mgrid_id; - for(int i = 0; i < 6; i++) - { - coord[i/2] += std::pow(-1, i%2) * 0.0001; - double dist = norm3d(coord[0], coord[1], coord[2]); - if (dist < 1.0E-9) - { dist += 1.0E-9; } - // since nwl is less or equal than 5, the size of rly is (5+1)^2 - // size of grly = 36 * 3 - double rly[36]; - double grly[36 * 3]; - const int nwl = ucell_atom_nwl[atom_type]; - grad_rl_sph_harm(nwl, ylmcoef, coord[0], coord[1], coord[2], rly, grly); - - // interpolation - const double pos = dist / dr_uniform; - const int ip = static_cast(pos); - const double x0 = pos - ip; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - double tmp = 0; - double dtmp = 0; - const int it_nw = atom_type * nwmax; - int iw_nr = it_nw * nrmax + ip; - for (int iw = 0; iw < atom_nw[atom_type]; iw++, iw_nr += nrmax) - { - if (atom_iw2_new[it_nw + iw]) - { - tmp = x12 * (psi_u[iw_nr] * x3 + psi_u[iw_nr + 3] * x0) - + x03 * (psi_u[iw_nr + 1] * x2 - psi_u[iw_nr + 2] * x1); - dtmp = x12 * (dpsi_u[iw_nr] * x3 + dpsi_u[iw_nr + 3] * x0) - + x03 * (dpsi_u[iw_nr + 1] * x2 - dpsi_u[iw_nr + 2] * x1); - } - const int iw_l = atom_iw2_l[it_nw + iw]; - const int idx_ylm = atom_iw2_ylm [it_nw + iw]; - const double rl = pow_int(dist, iw_l); - const double tmprl = tmp / rl; - const double tmpdphi_rly = (dtmp - tmp * iw_l / dist) / rl * rly[idx_ylm] / dist; - - double dphi[3]; - dphi[0] = tmpdphi_rly * coord[0] + tmprl * grly[idx_ylm * 3 + 0]; - dphi[1] = tmpdphi_rly * coord[1] + tmprl * grly[idx_ylm * 3 + 1]; - dphi[2] = tmpdphi_rly * coord[2] + tmprl * grly[idx_ylm * 3 + 2]; - - if (i == 0) - { - ddphi_xx[phi_idx + iw] += dphi[0]; - ddphi_xy[phi_idx + iw] += dphi[1]; - ddphi_xz[phi_idx + iw] += dphi[2]; - } else if (i == 1) - { - ddphi_xx[phi_idx + iw] -= dphi[0]; - ddphi_xy[phi_idx + iw] -= dphi[1]; - ddphi_xz[phi_idx + iw] -= dphi[2]; - } else if (i == 2) - { - ddphi_xy[phi_idx + iw] += dphi[0]; - ddphi_yy[phi_idx + iw] += dphi[1]; - ddphi_yz[phi_idx + iw] += dphi[2]; - } else if (i == 3) - { - ddphi_xy[phi_idx + iw] -= dphi[0]; - ddphi_yy[phi_idx + iw] -= dphi[1]; - ddphi_yz[phi_idx + iw] -= dphi[2]; - } else if (i == 4) - { - ddphi_xz[phi_idx + iw] += dphi[0]; - ddphi_yz[phi_idx + iw] += dphi[1]; - ddphi_zz[phi_idx + iw] += dphi[2]; - } else // i == 5 - { - ddphi_xz[phi_idx + iw] -= dphi[0]; - ddphi_yz[phi_idx + iw] -= dphi[1]; - ddphi_zz[phi_idx + iw] -= dphi[2]; - } - } - coord[i/2] -= std::pow(-1, i%2) * 0.0001; // recover coord - } - - for (int iw = 0; iw < atom_nw[atom_type]; iw++) - { - ddphi_xx[phi_idx + iw] /= 0.0002; - ddphi_xy[phi_idx + iw] /= 0.0004; - ddphi_xz[phi_idx + iw] /= 0.0004; - ddphi_yy[phi_idx + iw] /= 0.0002; - ddphi_yz[phi_idx + iw] /= 0.0004; - ddphi_zz[phi_idx + iw] /= 0.0002; - } - } - } -} - -__global__ void phi_mul_vldr3_kernel( - const double* __restrict__ vl, - const double dr3, - const double* __restrict__ phi, - const int mgrids_per_bgrid, - const int* __restrict__ mgrids_local_idx, - const int* __restrict__ bgrids_phi_len, - const int* __restrict__ bgrids_phi_start, - double* __restrict__ result) -{ - const int bgrid_id = blockIdx.y; - const int mgrid_id = blockIdx.x; - const int phi_len = bgrids_phi_len[bgrid_id]; - const int phi_start = bgrids_phi_start[bgrid_id] + mgrid_id * phi_len; - const int mgrid_id_in_batch = bgrid_id * mgrids_per_bgrid + mgrid_id; - const double vldr3 = vl[mgrids_local_idx[mgrid_id_in_batch]] * dr3; - for(int i = threadIdx.x; i < phi_len; i += blockDim.x) - { - result[phi_start + i] = phi[phi_start + i] * vldr3; - } -} - -// rho(ir) = \sum_{iwt} \phi_i(ir,iwt) * \phi_j^*(ir,iwt) -// each block calculate the dot product of phi_i and phi_j of a meshgrid -__global__ void phi_dot_phi_kernel( - const double* __restrict__ phi_i, - const double* __restrict__ phi_j, - const int mgrids_per_bgrid, - const int* __restrict__ mgrids_local_idx, - const int* __restrict__ bgrids_phi_len, - const int* __restrict__ bgrids_phi_start, - double* __restrict__ rho) -{ - __shared__ double s_data[32]; // the length of s_data equals the max warp num of a block - const int bgrid_id = blockIdx.y; - const int mgrid_id = blockIdx.x; - const int phi_len = bgrids_phi_len[bgrid_id]; - const int phi_start = bgrids_phi_start[bgrid_id] + mgrid_id * phi_len; - const double* phi_i_mgrid = phi_i + phi_start; - const double* phi_j_mgrid = phi_j + phi_start; - const int mgrid_id_in_batch = bgrid_id * mgrids_per_bgrid + mgrid_id; - const int mgrid_local_idx = mgrids_local_idx[mgrid_id_in_batch]; - const int tid = threadIdx.x; - const int warp_id = tid / 32; - const int lane_id = tid % 32; - double tmp_sum = 0; - - for (int i = tid; i < phi_len; i += blockDim.x) - { - tmp_sum += phi_i_mgrid[i] * phi_j_mgrid[i]; - } - - tmp_sum = warpReduceSum(tmp_sum); - - if (lane_id == 0) - { - s_data[warp_id] = tmp_sum; - } - __syncthreads(); - - tmp_sum = (tid < blockDim.x / 32) ? s_data[tid] : 0; - if(warp_id == 0) - { - tmp_sum = warpReduceSum(tmp_sum); - } - - if(tid == 0) - { - rho[mgrid_local_idx] += tmp_sum; - } -} - -__global__ void phi_dot_dphi_kernel( - const double* __restrict__ phi, - const double* __restrict__ dphi_x, - const double* __restrict__ dphi_y, - const double* __restrict__ dphi_z, - const int mgrids_per_bgrid, - const int* __restrict__ bgrids_phi_len, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ atoms_iat, - const int* __restrict__ iat2it, - const int* __restrict__ atom_nw, - double* force) -{ - __shared__ double s_data[32 * 3]; // the length of s_data equals the max warp num of a block times 3 - const int bgrid_id = blockIdx.y; - const int atoms_num = atoms_num_info[bgrid_id].x; - const int pre_atoms_num = atoms_num_info[bgrid_id].y; - const int bgrid_phi_len = bgrids_phi_len[bgrid_id]; - const int tid = threadIdx.x; - const int warp_id = tid / 32; - const int lane_id = tid % 32; - - for (int atom_id = blockIdx.x; atom_id < atoms_num; atom_id += gridDim.x) - { - const int atom_phi_start = atoms_phi_start[atom_id + pre_atoms_num]; - const int iat = atoms_iat[atom_id + pre_atoms_num]; - const int nw = atom_nw[iat2it[iat]]; - double f[3] = {0.0, 0.0, 0.0}; - for (int mgrid_id = 0; mgrid_id < mgrids_per_bgrid; mgrid_id++) - { - const int phi_start = atom_phi_start + mgrid_id * bgrid_phi_len; - for (int iw = tid; iw < nw; iw += blockDim.x) - { - int phi_idx = phi_start + iw; - f[0] += phi[phi_idx] * dphi_x[phi_idx]; - f[1] += phi[phi_idx] * dphi_y[phi_idx]; - f[2] += phi[phi_idx] * dphi_z[phi_idx]; - } - } - - // reduce the force in each block - for (int i = 0; i < 3; i++) - { - f[i] = warpReduceSum(f[i]); - } - - if (lane_id == 0) - { - for (int i = 0; i < 3; i++) - { - s_data[warp_id * 3 + i] = f[i]; - } - } - __syncthreads(); - - for (int i = 0; i < 3; i++) - { - f[i] = (tid < blockDim.x / 32) ? s_data[tid * 3 + i] : 0; - } - if (warp_id == 0) - { - for (int i = 0; i < 3; i++) - { - f[i] = warpReduceSum(f[i]); - } - } - if (tid == 0) - { - for (int i = 0; i < 3; i++) - { - atomicAdd(&force[iat * 3 + i], f[i] * 2); - } - } - } -} - -__global__ void phi_dot_dphi_r_kernel( - const double* __restrict__ phi, - const double* __restrict__ dphi_x, - const double* __restrict__ dphi_y, - const double* __restrict__ dphi_z, - const int mgrids_per_bgrid, - const int* __restrict__ bgrids_phi_len, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ iat2it, - const int* __restrict__ atom_nw, - double* __restrict__ svl) -{ - __shared__ double s_data[32 * 6]; // the length of s_data equals the max warp num of a block times 6 - const int tid = threadIdx.x; - const int bgrid_id = blockIdx.y; - const int atoms_num = atoms_num_info[bgrid_id].x; - const int pre_atoms_num = atoms_num_info[bgrid_id].y; - const int bgrid_phi_len = bgrids_phi_len[bgrid_id]; - const int warp_id = tid / 32; - const int lane_id = tid % 32; - - double stress[6]{0.0}; - for (int mgrid_id = blockIdx.x; mgrid_id < mgrids_per_bgrid; mgrid_id += gridDim.x) - { - const double3 mgrid_pos = mgrids_pos[mgrid_id]; - for (int atom_id = 0; atom_id < atoms_num; atom_id++) - { - const int atom_phi_start = atoms_phi_start[atom_id + pre_atoms_num] + mgrid_id * bgrid_phi_len; - const int iat = atoms_iat[atom_id + pre_atoms_num]; - const int nw = atom_nw[iat2it[iat]]; - const double3 rcoord = atoms_bgrids_rcoords[atom_id + pre_atoms_num]; // rcoord is the ralative coordinate of an atom and a biggrid - const double3 coord = make_double3(mgrid_pos.x-rcoord.x, // coord is the relative coordinate of an atom and a meshgrid - mgrid_pos.y-rcoord.y, - mgrid_pos.z-rcoord.z); - for (int iw = tid; iw < nw; iw += blockDim.x) - { - int phi_idx = atom_phi_start + iw; - stress[0] += phi[phi_idx] * dphi_x[phi_idx] * coord.x; - stress[1] += phi[phi_idx] * dphi_x[phi_idx] * coord.y; - stress[2] += phi[phi_idx] * dphi_x[phi_idx] * coord.z; - stress[3] += phi[phi_idx] * dphi_y[phi_idx] * coord.y; - stress[4] += phi[phi_idx] * dphi_y[phi_idx] * coord.z; - stress[5] += phi[phi_idx] * dphi_z[phi_idx] * coord.z; - } - } - } - - // reduce the stress in each block - for (int i = 0; i < 6; i++) - { - stress[i] = warpReduceSum(stress[i]); - } - - if (lane_id == 0) - { - for (int i = 0; i < 6; i++) - { - s_data[warp_id * 6 + i] = stress[i]; - } - } - __syncthreads(); - - for (int i = 0; i < 6; i++) - { - stress[i] = (tid < blockDim.x / 32) ? s_data[tid * 6 + i] : 0; - } - if (warp_id == 0) - { - for (int i = 0; i < 6; i++) - { - stress[i] = warpReduceSum(stress[i]); - } - } - if (tid == 0) - { - for (int i = 0; i < 6; i++) - { - atomicAdd(&svl[i], stress[i] * 2); - } - } -} - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cuh b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cuh deleted file mode 100644 index 4d32475542..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/phi_operator_kernel.cuh +++ /dev/null @@ -1,135 +0,0 @@ -#pragma once - -#include - -namespace ModuleGint -{ - -__global__ void set_phi_kernel( - const int nwmax, - const int mgrids_num, - const int nrmax, - const double dr_uniform, - const double* __restrict__ ylmcoef, - const int* __restrict__ ucell_atom_nwl, - const bool* __restrict__ atom_iw2_new, - const int* __restrict__ atom_iw2_ylm, - const int* __restrict__ atom_nw, - const int* __restrict__ iat2it, - const double* __restrict__ rcut, - const double* __restrict__ psi_u, - const double* __restrict__ dpsi_u, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ bgrids_phi_len, - double* __restrict__ phi); - -__global__ void set_phi_dphi_kernel( - const int nwmax, - const int mgrids_num, - const int nrmax, - const double dr_uniform, - const double* __restrict__ ylmcoef, - const int* __restrict__ ucell_atom_nwl, - const bool* __restrict__ atom_iw2_new, - const int* __restrict__ atom_iw2_ylm, - const int* __restrict__ atom_iw2_l, - const int* __restrict__ atom_nw, - const int* __restrict__ iat2it, - const double* __restrict__ rcut, - const double* __restrict__ psi_u, - const double* __restrict__ dpsi_u, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ bgrids_phi_len, - double* __restrict__ phi, - double* __restrict__ dphi_x, - double* __restrict__ dphi_y, - double* __restrict__ dphi_z); - -__global__ void set_ddphi_kernel( - const int nwmax, - const int mgrids_num, - const int nrmax, - const double dr_uniform, - const double* __restrict__ ylmcoef, - const int* __restrict__ ucell_atom_nwl, - const bool* __restrict__ atom_iw2_new, - const int* __restrict__ atom_iw2_ylm, - const int* __restrict__ atom_iw2_l, - const int* __restrict__ atom_nw, - const int* __restrict__ iat2it, - const double* __restrict__ rcut, - const double* __restrict__ psi_u, - const double* __restrict__ dpsi_u, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ bgrids_phi_len, - double* __restrict__ ddphi_xx, - double* __restrict__ ddphi_xy, - double* __restrict__ ddphi_xz, - double* __restrict__ ddphi_yy, - double* __restrict__ ddphi_yz, - double* __restrict__ ddphi_zz); - -__global__ void phi_mul_vldr3_kernel( - const double* __restrict__ vl, - const double dr3, - const double* __restrict__ phi, - const int mgrids_per_bgrid, - const int* __restrict__ mgrids_local_idx, - const int* __restrict__ bgrids_phi_len, - const int* __restrict__ bgrids_phi_start, - double* __restrict__ result); - -// rho(ir) = \sum_{iwt} \phi_i(ir,iwt) * \phi_j^*(ir,iwt) -// each block calculate the dot product of phi_i and phi_j of a meshgrid -__global__ void phi_dot_phi_kernel( - const double* __restrict__ phi_i, // phi_i(ir,iwt) - const double* __restrict__ phi_j, // phi_j(ir,iwt) - const int mgrids_per_bgrid, // the number of mgrids of each biggrid - const int* __restrict__ mgrids_local_idx, // the idx of mgrid in local cell - const int* __restrict__ bgrids_phi_len, // the length of phi on a mgrid of a biggrid - const int* __restrict__ bgrids_phi_start, // the start idx in phi of each biggrid - double* __restrict__ rho); // rho(ir) - -__global__ void phi_dot_dphi_kernel( - const double* __restrict__ phi, - const double* __restrict__ dphi_x, - const double* __restrict__ dphi_y, - const double* __restrict__ dphi_z, - const int mgrids_per_bgrid, - const int* __restrict__ bgrids_phi_len, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ atoms_iat, - const int* __restrict__ iat2it, - const int* __restrict__ atom_nw, - double* force); - -__global__ void phi_dot_dphi_r_kernel( - const double* __restrict__ phi, - const double* __restrict__ dphi_x, - const double* __restrict__ dphi_y, - const double* __restrict__ dphi_z, - const int mgrids_per_bgrid, - const int* __restrict__ bgrids_phi_len, - const int2* __restrict__ atoms_num_info, - const int* __restrict__ atoms_phi_start, - const int* __restrict__ atoms_iat, - const double3* __restrict__ atoms_bgrids_rcoords, - const double3* __restrict__ mgrids_pos, - const int* __restrict__ iat2it, - const int* __restrict__ atom_nw, - double* __restrict__ svl); - -} diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cu b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cu deleted file mode 100644 index 38fba5de00..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cu +++ /dev/null @@ -1,13 +0,0 @@ -#include "set_const_mem.cuh" -#include "gint_helper.cuh" - -__constant__ double ylmcoe_d[100]; - -namespace ModuleGint -{ - __host__ void set_ylmcoe_d(const double* ylmcoe_h, double** ylmcoe_d_addr) - { - checkCuda(cudaMemcpyToSymbol(ylmcoe_d, ylmcoe_h, sizeof(double) * 100)); - checkCuda(cudaGetSymbolAddress((void**)ylmcoe_d_addr, ylmcoe_d)); - } -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cuh b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cuh deleted file mode 100644 index 715fa98cde..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/set_const_mem.cuh +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include - -namespace ModuleGint -{ -__host__ void set_ylmcoe_d(const double* ylmcoe_h, double** ylmcoe_d_addr); -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/sph.cuh b/source/module_hamilt_lcao/module_gint/temp_gint/kernel/sph.cuh deleted file mode 100644 index b36828222b..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/kernel/sph.cuh +++ /dev/null @@ -1,396 +0,0 @@ -#pragma once - -namespace ModuleGint -{ - -static __device__ void sph_harm( - const int nwl, - const double* __restrict__ ylmcoef, - const double x, - const double y, - const double z, - double* __restrict__ ylma -) -{ - /*************************** - L = 0 - ***************************/ - ylma[0] = ylmcoef[0]; // l=0, m=0 - double tmp0; - if (nwl == 0) - return; - - /*************************** - L = 1 - ***************************/ - ylma[1] = ylmcoef[1] * z; // l=1, m=0 - ylma[2] = -ylmcoef[1] * x; // l=1, m=1 - ylma[3] = -ylmcoef[1] * y; // l=1, m=-1 - if (nwl == 1) - return; - - /*************************** - L = 2 - ***************************/ - tmp0=ylmcoef[3] * ylma[0]; - ylma[4] = ylmcoef[2] * z * ylma[1] - tmp0 ; // l=2, m=0 - tmp0 = ylmcoef[4] * z; - ylma[5] = tmp0 * ylma[2]; // l=2,m=1 - ylma[6] = tmp0 * ylma[3]; // l=2,m=-1 - - tmp0 = ylmcoef[4] * x; - ylma[7] = ylmcoef[5] * ylma[4] - ylmcoef[6] * ylma[0] - - tmp0 * ylma[2]; // l=2,m=2 - ylma[8] = -tmp0 * ylma[3]; - if (nwl == 2) - return; - - /*************************** - L = 3 - ***************************/ - tmp0=ylmcoef[8] * ylma[1]; - ylma[9] = ylmcoef[7] * z * ylma[4] - tmp0; // l=3, m=0 - - tmp0 = ylmcoef[9] * z; - ylma[10] = tmp0 * ylma[5] - ylmcoef[10] * ylma[2]; // l=3,m=1 - ylma[11] = tmp0 * ylma[6] - ylmcoef[10] * ylma[3]; // l=3,m=-1 - - tmp0 = ylmcoef[11] * z; - ylma[12] = tmp0 * ylma[7]; // l=3,m=2 - ylma[13] = tmp0 * ylma[8]; // l=3,m=-2 - - tmp0 = ylmcoef[14] * x; - ylma[14] = ylmcoef[12] * ylma[10] - ylmcoef[13] * ylma[2] - - tmp0 * ylma[7]; // l=3,m=3 - ylma[15] = ylmcoef[12] * ylma[11] - ylmcoef[13] * ylma[3] - - tmp0 * ylma[8]; // l=3,m=-3 - if (nwl == 3) - return; - - /*************************** - L = 4 - ***************************/ - tmp0=ylmcoef[16] * ylma[4]; - ylma[16] = ylmcoef[15] * z * ylma[9] - tmp0; // l=4,m=0 - - tmp0 = ylmcoef[17] * z; - ylma[17] = tmp0 * ylma[10] - ylmcoef[18] * ylma[5]; // l=4,m=1 - ylma[18] = tmp0 * ylma[11] - ylmcoef[18] * ylma[6]; // l=4,m=-1 - - tmp0 = ylmcoef[19] * z; - ylma[19] = tmp0 * ylma[12] - ylmcoef[20] * ylma[7]; // l=4,m=2 - ylma[20] = tmp0 * ylma[13] - ylmcoef[20] * ylma[8]; // l=4,m=-2 - - tmp0 = 3.0 * z; - ylma[21] = tmp0 * ylma[14]; // l=4,m=3 - ylma[22] = tmp0 * ylma[15]; // l=4,m=-3 - - tmp0 = ylmcoef[23] * x; - ylma[23] = ylmcoef[21] * ylma[19] - ylmcoef[22] * ylma[7] - - tmp0 * ylma[14]; // l=4,m=4 - ylma[24] = ylmcoef[21] * ylma[20] - ylmcoef[22] * ylma[8] - - tmp0 * ylma[15]; // l=4,m=-4 - if (nwl == 4) - return; - - /*************************** - L = 5 - ***************************/ - tmp0=ylmcoef[25] * ylma[9]; - ylma[25] - = ylmcoef[24] * z * ylma[16] - tmp0; // l=5,m=0 - - tmp0 = ylmcoef[26] * z; - ylma[26] = tmp0 * ylma[17] - ylmcoef[27] * ylma[10]; // l=5,m=1 - ylma[27] = tmp0 * ylma[18] - ylmcoef[27] * ylma[11]; // l=5,m=-1 - - tmp0 = ylmcoef[28] * z; - ylma[28] = tmp0 * ylma[19] - ylmcoef[29] * ylma[12]; // l=5,m=2 - ylma[29] = tmp0 * ylma[20] - ylmcoef[29] * ylma[13]; // l=5,m=-2 - - tmp0 = ylmcoef[30] * z; - ylma[30] = tmp0 * ylma[21] - ylmcoef[31] * ylma[14]; // l=5,m=3 - ylma[31] = tmp0 * ylma[22] - ylmcoef[31] * ylma[15]; // l=5,m=-3 - - tmp0 = ylmcoef[32] * z; - ylma[32] = tmp0 * ylma[23]; // l=5,m=4 - ylma[33] = tmp0 * ylma[24]; // l=5,m=-4 - - tmp0 = ylmcoef[35] * x; - ylma[34] = ylmcoef[33] * ylma[30] - ylmcoef[34] * ylma[14] - - tmp0 * ylma[23]; // l=5,m=5 - ylma[35] = ylmcoef[33] * ylma[31] - ylmcoef[34] * ylma[15] - - tmp0 * ylma[24]; // l=5,m=-5 - if (nwl == 5) - return; - /* - // if nwl > 5 - for (int il = 6; il <= nwl; il++) - { - int istart = il * il; - int istart1 = (il - 1) * (il - 1); - int istart2 = (il - 2) * (il - 2); - - double fac2 = sqrt(4.0 * istart - 1.0); - double fac4 = sqrt(4.0 * istart1 - 1.0); - - for (int im = 0; im < 2 * il - 1; im++) - { - int imm = (im + 1) / 2; - ylma[istart + im] = fac2 / sqrt((double)istart - imm * imm) * (z - * ylma[istart1 + im] - sqrt((double)istart1 - imm * imm) / fac4 * - ylma[istart2 + im]); - } - - double bl1 = sqrt(2.0 * il / (2.0 * il + 1.0)); - double bl2 = sqrt((2.0 * il - 2.0) / (2.0 * il - 1.0)); - double bl3 = sqrt(2.0) / fac2; - - ylma[istart + 2 * il - 1] = (bl3 * ylma[istart + 2 * il - 5] - bl2 * - ylma[istart2 + 2 * il - 5] - 2.0 * x * ylma[istart1 + 2 * il - 3]) / - bl1; ylma[istart + 2 * il] = (bl3 * ylma[istart + 2 * il - 4] - bl2 * - ylma[istart2 + 2 * il - 4] - 2.0 * x * ylma[istart1 + 2 * il - 2]) / - bl1; - }*/ -} - -static __device__ void grad_rl_sph_harm( - const int nwl, - const double* __restrict__ ylmcoef, - const double x, - const double y, - const double z, - double* __restrict__ rly, - double* __restrict__ grly -) -{ - double r2 = x * x + y * y + z * z; - double tx = x * 2; - double ty = y * 2; - double tz = z * 2; - - //begin calculation - /*************************** - L = 0 - ***************************/ - rly[0] = ylmcoef[0]; //l=0, m=0 - grly[0] = grly[1] = grly[2] = 0.0; - if (nwl == 0) return; - - /*************************** - L = 1 - ***************************/ - rly[1] = ylmcoef[1]*z; //l=1, m=0 - grly[3] = grly[4] = 0.0; - grly[5] = ylmcoef[1]; - - rly[2] = -ylmcoef[1]*x; //l=1, m=1 - grly[7] = grly[8] = 0.0; - grly[6] = -ylmcoef[1]; - - rly[3] = -ylmcoef[1]*y; //l=1, m=-1 - grly[9] = grly[11] = 0.0; - grly[10] = -ylmcoef[1]; - - if (nwl == 1) return; - - /*************************** - L = 2 - ***************************/ - rly[4] = ylmcoef[2]*z*rly[1]-ylmcoef[3]*rly[0]*r2;//l=2, m=0 - grly[12] = ylmcoef[2]*z*grly[3]-ylmcoef[3]*(grly[0]*r2+rly[0]*tx);//l=2, m=0 - grly[13] = ylmcoef[2]*z*grly[4]-ylmcoef[3]*(grly[1]*r2+rly[0]*ty);//l=2, m=0 - grly[14] = ylmcoef[2]*(z*grly[5]+rly[1])-ylmcoef[3]*(grly[2]*r2+rly[0]*tz);//l=2, m=0 - - - double tmp0 = ylmcoef[4]*z; - rly[5] = tmp0*rly[2];//l=2,m=1 - grly[15] = tmp0*grly[6]; - grly[16] = tmp0*grly[7]; - grly[17] = ylmcoef[4]*(rly[2]+z*grly[8]); - - rly[6] = tmp0*rly[3];//l=2,m=-1 - grly[18] = tmp0*grly[9]; - grly[19] = tmp0*grly[10]; - grly[20] = ylmcoef[4]*(rly[3]+z*grly[11]); - - double tmp2 = ylmcoef[4]*x; - rly[7]= ylmcoef[5]*rly[4]-ylmcoef[6]*rly[0]*r2 - tmp2*rly[2];//l=2,m=2 - grly[21] = ylmcoef[5]*grly[12]-ylmcoef[6]*(rly[0]*tx+grly[0]*r2)-ylmcoef[4]*(x*grly[6]+rly[2]); - -// std::cout << "\np1 = "<< ylmcoef[5]*grly[12] << " p2 = " << -ylmcoef[6]*rly[0]*tx -// << " p3 = " << -ylmcoef[4]*x*grly[6] << " p4 = " << -ylmcoef[4]*rly[2] << std::endl; - - grly[22] = ylmcoef[5]*grly[13]-ylmcoef[6]*(rly[0]*ty+grly[1]*r2)-tmp2*grly[7]; - grly[23] = ylmcoef[5]*grly[14]-ylmcoef[6]*(rly[0]*tz+grly[2]*r2)-tmp2*grly[8]; - - rly[8] = -tmp2*rly[3]; - grly[24] = -ylmcoef[4]*(rly[3]+x*grly[9]); - grly[25] = -tmp2*grly[10]; - grly[26] = -tmp2*grly[11]; -// rly[8] = tmp1+tmp2*rly[3];//l=2,m=-2 - if (nwl == 2) return; - - /*************************** - L = 3 - ***************************/ - rly[9] = ylmcoef[7]*z*rly[4]-ylmcoef[8]*rly[1]*r2; //l=3, m=0 - grly[27] = ylmcoef[7]*z*grly[12]-ylmcoef[8]*(rly[1]*tx+grly[3]*r2); - grly[28] = ylmcoef[7]*z*grly[13]-ylmcoef[8]*(rly[1]*ty+grly[4]*r2); - grly[29] = ylmcoef[7]*(rly[4]+z*grly[14])-ylmcoef[8]*(rly[1]*tz+grly[5]*r2); - - double tmp3 = ylmcoef[9]*z; - rly[10] = tmp3*rly[5]-ylmcoef[10]*rly[2]*r2;//l=3,m=1 - grly[30] = tmp3*grly[15]-ylmcoef[10]*(grly[6]*r2+rly[2]*tx); - grly[31] = tmp3*grly[16]-ylmcoef[10]*(grly[7]*r2+rly[2]*ty); - grly[32] = ylmcoef[9]*(z*grly[17]+rly[5])-ylmcoef[10]*(grly[8]*r2+rly[2]*tz); - - rly[11] = tmp3*rly[6]-ylmcoef[10]*rly[3]*r2;//l=3,m=-1 - grly[33] = tmp3*grly[18]-ylmcoef[10]*(grly[9]*r2+rly[3]*tx); - grly[34] = tmp3*grly[19]-ylmcoef[10]*(grly[10]*r2+rly[3]*ty); - grly[35] = ylmcoef[9]*(z*grly[20]+rly[6])-ylmcoef[10]*(grly[11]*r2+rly[3]*tz); - - double tmp4 = ylmcoef[11]*z; - rly[12] = tmp4*rly[7];//l=3,m=2 - grly[36] = tmp4*grly[21]; - grly[37] = tmp4*grly[22]; - grly[38] = ylmcoef[11]*(z*grly[23]+rly[7]); - - rly[13] = tmp4*rly[8];//l=3,m=-2 - grly[39] = tmp4*grly[24]; - grly[40] = tmp4*grly[25]; - grly[41] = ylmcoef[11]*(z*grly[26]+rly[8]); - - double tmp5 = ylmcoef[14]*x; - rly[14] = ylmcoef[12]*rly[10]-ylmcoef[13]*rly[2]*r2-tmp5*rly[7];//l=3,m=3 - grly[42] = ylmcoef[12]*grly[30]-ylmcoef[13]*(rly[2]*tx+grly[6]*r2)-ylmcoef[14]*(rly[7]+x*grly[21]); - grly[43] = ylmcoef[12]*grly[31]-ylmcoef[13]*(rly[2]*ty+grly[7]*r2)-tmp5*grly[22]; - grly[44] = ylmcoef[12]*grly[32]-ylmcoef[13]*(rly[2]*tz+grly[8]*r2)-tmp5*grly[23]; - - rly[15] = ylmcoef[12]*rly[11]-ylmcoef[13]*rly[3]*r2-tmp5*rly[8];//l=3,m=-3 - grly[45] = ylmcoef[12]*grly[33]-ylmcoef[13]*(rly[3]*tx+grly[9]*r2)-ylmcoef[14]*(rly[8]+x*grly[24]); - grly[46] = ylmcoef[12]*grly[34]-ylmcoef[13]*(rly[3]*ty+grly[10]*r2)-tmp5*grly[25]; - grly[47] = ylmcoef[12]*grly[35]-ylmcoef[13]*(rly[3]*tz+grly[11]*r2)-tmp5*grly[26]; - if (nwl == 3) return; - - /*************************** - L = 4 - ***************************/ - rly[16] = ylmcoef[15]*z*rly[9]-ylmcoef[16]*rly[4]*r2;//l=4,m=0 - grly[48] = ylmcoef[15]*z*grly[27]-ylmcoef[16]*(rly[4]*tx+grly[12]*r2); - grly[49] = ylmcoef[15]*z*grly[28]-ylmcoef[16]*(rly[4]*ty+grly[13]*r2); - grly[50] = ylmcoef[15]*(z*grly[29]+rly[9])-ylmcoef[16]*(rly[4]*tz+grly[14]*r2); - - double tmp6 = ylmcoef[17]*z; - rly[17] = tmp6*rly[10]-ylmcoef[18]*rly[5]*r2;//l=4,m=1 - grly[51] = tmp6*grly[30]-ylmcoef[18]*(rly[5]*tx+grly[15]*r2); - grly[52] = tmp6*grly[31]-ylmcoef[18]*(rly[5]*ty+grly[16]*r2); - grly[53] = ylmcoef[17]*(z*grly[32]+rly[10])-ylmcoef[18]*(rly[5]*tz+grly[17]*r2); - - rly[18] = tmp6*rly[11]-ylmcoef[18]*rly[6]*r2;//l=4,m=-1 - grly[54] = tmp6*grly[33]-ylmcoef[18]*(rly[6]*tx+grly[18]*r2); - grly[55] = tmp6*grly[34]-ylmcoef[18]*(rly[6]*ty+grly[19]*r2); - grly[56] = ylmcoef[17]*(z*grly[35]+rly[11])-ylmcoef[18]*(rly[6]*tz+grly[20]*r2); - - double tmp7 = ylmcoef[19]*z; - rly[19] = tmp7*rly[12]-ylmcoef[20]*rly[7]*r2;//l=4,m=2 - grly[57] = tmp7*grly[36]-ylmcoef[20]*(rly[7]*tx+grly[21]*r2); - grly[58] = tmp7*grly[37]-ylmcoef[20]*(rly[7]*ty+grly[22]*r2); - grly[59] = ylmcoef[19]*(z*grly[38]+rly[12])-ylmcoef[20]*(rly[7]*tz+grly[23]*r2); - - rly[20] = tmp7*rly[13]-ylmcoef[20]*rly[8]*r2;//l=4,m=-2 - grly[60] = tmp7*grly[39]-ylmcoef[20]*(rly[8]*tx+grly[24]*r2); - grly[61] = tmp7*grly[40]-ylmcoef[20]*(rly[8]*ty+grly[25]*r2); - grly[62] = ylmcoef[19]*(z*grly[41]+rly[13])-ylmcoef[20]*(rly[8]*tz+grly[26]*r2); - - double tmp8 = 3.0*z; - rly[21] = tmp8*rly[14];//l=4,m=3 - grly[63] = tmp8*grly[42]; - grly[64] = tmp8*grly[43]; - grly[65] = 3.0*(z*grly[44]+rly[14]); - - - rly[22] = tmp8*rly[15];//l=4,m=-3 - grly[66] = tmp8*grly[45]; - grly[67] = tmp8*grly[46]; - grly[68] = 3.0*(z*grly[47]+rly[15]); - - double tmp9 = ylmcoef[23]*x; - rly[23] = ylmcoef[21]*rly[19]-ylmcoef[22]*rly[7]*r2-tmp9*rly[14];//l=4,m=4 - grly[69] = ylmcoef[21]*grly[57]-ylmcoef[22]*(rly[7]*tx+grly[21]*r2)-ylmcoef[23]*(x*grly[42]+rly[14]); - grly[70] = ylmcoef[21]*grly[58]-ylmcoef[22]*(rly[7]*ty+grly[22]*r2)-tmp9*grly[43]; - grly[71] = ylmcoef[21]*grly[59]-ylmcoef[22]*(rly[7]*tz+grly[23]*r2)-tmp9*grly[44]; - - rly[24] = ylmcoef[21]*rly[20]-ylmcoef[22]*rly[8]*r2-tmp9*rly[15];//l=4,m=-4 - grly[72] = ylmcoef[21]*grly[60]-ylmcoef[22]*(rly[8]*tx+grly[24]*r2)-ylmcoef[23]*(x*grly[45]+rly[15]); - grly[73] = ylmcoef[21]*grly[61]-ylmcoef[22]*(rly[8]*ty+grly[25]*r2)-tmp9*grly[46]; - grly[74] = ylmcoef[21]*grly[62]-ylmcoef[22]*(rly[8]*tz+grly[26]*r2)-tmp9*grly[47]; - - if (nwl == 4) return; - - /*************************** - L = 5 - ***************************/ - rly[25] = ylmcoef[24]*z*rly[16]-ylmcoef[25]*rly[9]*r2;//l=5,m=0 - grly[75] = ylmcoef[24]*z*grly[48]-ylmcoef[25]*(rly[9]*tx+grly[27]*r2); - grly[76] = ylmcoef[24]*z*grly[49]-ylmcoef[25]*(rly[9]*ty+grly[28]*r2); - grly[77] = ylmcoef[24]*(z*grly[50]+rly[16])-ylmcoef[25]*(rly[9]*tz+grly[29]*r2); - - double tmp10 = ylmcoef[26]*z; - rly[26] = tmp10*rly[17]-ylmcoef[27]*rly[10]*r2;//l=5,m=1 - grly[78] = tmp10*grly[51]-ylmcoef[27]*(rly[10]*tx+grly[30]*r2); - grly[79] = tmp10*grly[52]-ylmcoef[27]*(rly[10]*ty+grly[31]*r2); - grly[80] = ylmcoef[26]*(z*grly[53]+rly[17])-ylmcoef[27]*(rly[10]*tz+grly[32]*r2); - - rly[27] = tmp10*rly[18]-ylmcoef[27]*rly[11]*r2;//l=5,m=-1 - grly[81] = tmp10*grly[54]-ylmcoef[27]*(rly[11]*tx+grly[33]*r2); - grly[82] = tmp10*grly[55]-ylmcoef[27]*(rly[11]*ty+grly[34]*r2); - grly[83] = ylmcoef[26]*(z*grly[56]+rly[18])-ylmcoef[27]*(rly[11]*tz+grly[35]*r2); - - double tmp11 = ylmcoef[28]*z; - rly[28] = tmp11*rly[19]-ylmcoef[29]*rly[12]*r2;//l=5,m=2 - grly[84] = tmp11*grly[57]-ylmcoef[29]*(rly[12]*tx+grly[36]*r2); - grly[85] = tmp11*grly[58]-ylmcoef[29]*(rly[12]*ty+grly[37]*r2); - grly[86] = ylmcoef[28]*(z*grly[59]+rly[19])-ylmcoef[29]*(rly[12]*tz+grly[38]*r2); - - rly[29] = tmp11*rly[20]-ylmcoef[29]*rly[13]*r2;//l=5,m=-2 - grly[87] = tmp11*grly[60]-ylmcoef[29]*(rly[13]*tx+grly[39]*r2); - grly[88] = tmp11*grly[61]-ylmcoef[29]*(rly[13]*ty+grly[40]*r2); - grly[89] = ylmcoef[28]*(z*grly[62]+rly[20])-ylmcoef[29]*(rly[13]*tz+grly[41]*r2); - - double tmp12 = ylmcoef[30]*z; - rly[30] = tmp12*rly[21]-ylmcoef[31]*rly[14]*r2;//l=5,m=3 - grly[90] = tmp12*grly[63]-ylmcoef[31]*(grly[42]*r2+rly[14]*tx); - grly[91] = tmp12*grly[64]-ylmcoef[31]*(grly[43]*r2+rly[14]*ty); - grly[92] = ylmcoef[30]*(z*grly[65]+rly[21])-ylmcoef[31]*(grly[44]*r2+rly[14]*tz); - - rly[31] = tmp12*rly[22]-ylmcoef[31]*rly[15]*r2;//l=5,m=-3 - grly[93] = tmp12*grly[66]-ylmcoef[31]*(grly[45]*r2+rly[15]*tx); - grly[94] = tmp12*grly[67]-ylmcoef[31]*(grly[46]*r2+rly[15]*ty); - grly[95] = ylmcoef[30]*(z*grly[68]+rly[22])-ylmcoef[31]*(grly[47]*r2+rly[15]*tz); - - double tmp13 = ylmcoef[32]*z; - rly[32] = tmp13*rly[23];//l=5,m=4 - grly[96] = tmp13*grly[69]; - grly[97] = tmp13*grly[70]; - grly[98] = ylmcoef[32]*(rly[23]+z*grly[71]); - - rly[33] = tmp13*rly[24];//l=5,m=-4 - grly[99] = tmp13*grly[72]; - grly[100] = tmp13*grly[73]; - grly[101] = ylmcoef[32]*(rly[24]+z*grly[74]); - - double tmp14 = ylmcoef[35]*x; - rly[34] = ylmcoef[33]*rly[30]-ylmcoef[34]*rly[14]*r2-tmp14*rly[23];//l=5,m=5 - grly[102] = ylmcoef[33]*grly[90]-ylmcoef[34]*(rly[14]*tx+grly[42]*r2)-ylmcoef[35]*(x*grly[69]+rly[23]); - grly[103] = ylmcoef[33]*grly[91]-ylmcoef[34]*(rly[14]*ty+grly[43]*r2)-tmp14*grly[70]; - grly[104] = ylmcoef[33]*grly[92]-ylmcoef[34]*(rly[14]*tz+grly[44]*r2)-tmp14*grly[71]; - - rly[35] = ylmcoef[33]*rly[31]-ylmcoef[34]*rly[15]*r2-tmp14*rly[24];//l=5,m=-5 - grly[105] = ylmcoef[33]*grly[93]-ylmcoef[34]*(rly[15]*tx+grly[45]*r2)-ylmcoef[35]*(x*grly[72]+rly[24]); - grly[106] = ylmcoef[33]*grly[94]-ylmcoef[34]*(rly[15]*ty+grly[46]*r2)-tmp14*grly[73]; - grly[107] = ylmcoef[33]*grly[95]-ylmcoef[34]*(rly[15]*tz+grly[47]*r2)-tmp14*grly[74]; - - if (nwl == 5) return; -} -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.cpp deleted file mode 100644 index da9b5ec3a3..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "localcell_info.h" - -namespace ModuleGint -{ - LocalCellInfo::LocalCellInfo( - int startidx_bx, int startidx_by, int startidx_bz, - int nbx, int nby, int nbz, - std::shared_ptr unitcell_info) - : startidx_bx_(startidx_bx), startidx_by_(startidx_by), startidx_bz_(startidx_bz), - nbx_(nbx), nby_(nby), nbz_(nbz), nbxyz_(nbx*nby*nbz), - unitcell_info_(unitcell_info), biggrid_info_(unitcell_info->get_bgrid_info()) - { - startidx_mx_ = startidx_bx_ * biggrid_info_->get_nmx(); - startidx_my_ = startidx_by_ * biggrid_info_->get_nmy(); - startidx_mz_ = startidx_bz_ * biggrid_info_->get_nmz(); - nmx_ = nbx_ * biggrid_info_->get_nmx(); - nmy_ = nby_ * biggrid_info_->get_nmy(); - nmz_ = nbz_ * biggrid_info_->get_nmz(); - nmxyz_ = nmx_ * nmy_ * nmz_; - } - - //==================================================================== - // functions related to the big grid - //==================================================================== - - int LocalCellInfo::bgrid_idx_3Dto1D(const Vec3i index_3d) const - { - return index3Dto1D(index_3d.x, index_3d.y, index_3d.z, nbx_, nby_, nbz_); - } - - Vec3i LocalCellInfo::bgrid_idx_1Dto3D(const int index_1d) const - { - return index1Dto3D(index_1d, nbx_, nby_, nbz_); - } - - Vec3i LocalCellInfo::get_bgrid_global_idx_3D(const Vec3i index_3d) const - { - return Vec3i( - startidx_bx_ + index_3d.x, - startidx_by_ + index_3d.y, - startidx_bz_ + index_3d.z); - } - - Vec3i LocalCellInfo::get_bgrid_global_idx_3D(const int index_1d) const - { - return get_bgrid_global_idx_3D(bgrid_idx_1Dto3D(index_1d)); - } - - int LocalCellInfo::get_bgrid_global_idx_1D(const int index_1d) const - { - Vec3i ucell_idx_3d = get_bgrid_global_idx_3D(bgrid_idx_1Dto3D(index_1d)); - return unitcell_info_->bgrid_idx_3Dto1D(ucell_idx_3d); - } - - - Vec3i LocalCellInfo::get_bgrid_local_idx_3D(const Vec3i index_3d) const - { - int x = index_3d.x - startidx_bx_; - int y = index_3d.y - startidx_by_; - int z = index_3d.z - startidx_bz_; - assert(x >= 0 && x < nbx_); - assert(y >= 0 && y < nby_); - assert(z >= 0 && z < nbz_); - return Vec3i(x, y, z); - } - - int LocalCellInfo::get_bgrid_local_idx_1D(const Vec3i index_3d) const - { - return bgrid_idx_3Dto1D(get_bgrid_local_idx_3D(index_3d)); - } - - int LocalCellInfo::get_bgrid_local_idx_1D(const int index_1d) const - { - Vec3i idx_3d = unitcell_info_->bgrid_idx_1Dto3D(index_1d); - return bgrid_idx_3Dto1D(get_bgrid_local_idx_3D(idx_3d)); - } - - Vec3d LocalCellInfo::get_bgrid_global_coord_3D(const int index_1d) const - { - Vec3i ucell_idx_3d = get_bgrid_global_idx_3D(index_1d); - return unitcell_info_->get_bgrid_coord(ucell_idx_3d); - } - - bool LocalCellInfo::is_bgrid_in_lcell(const Vec3i index_3d) const - { - return (index_3d.x >= startidx_bx_ && index_3d.x < startidx_bx_ + nbx_ && - index_3d.y >= startidx_by_ && index_3d.y < startidx_by_ + nby_ && - index_3d.z >= startidx_bz_ && index_3d.z < startidx_bz_ + nbz_); - } - - //==================================================================== - // functions related to the meshgrid - //==================================================================== - - int LocalCellInfo::mgrid_idx_3Dto1D(const Vec3i index_3d) const - { - return index3Dto1D(index_3d.x, index_3d.y, index_3d.z, nmx_, nmy_, nmz_); - } - - Vec3i LocalCellInfo::mgrid_idx_1Dto3D(const int index_1d) const - { - return index1Dto3D(index_1d, nmx_, nmy_, nmz_); - } - - Vec3i LocalCellInfo::get_mgrid_global_idx_3D(const Vec3i index_3d) const - { - return Vec3i( - startidx_mx_ + index_3d.x, - startidx_my_ + index_3d.y, - startidx_mz_ + index_3d.z); - } - - int LocalCellInfo::get_mgrid_global_idx_1D(const int index_1d) const - { - Vec3i ucell_idx_3d = get_mgrid_global_idx_3D(mgrid_idx_1Dto3D(index_1d)); - return unitcell_info_->mgrid_idx_3Dto1D(ucell_idx_3d); - } - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.h b/source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.h deleted file mode 100644 index 0c146b86ab..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/localcell_info.h +++ /dev/null @@ -1,126 +0,0 @@ -#pragma once - -#include -#include "gint_type.h" -#include "unitcell_info.h" - -namespace ModuleGint -{ - -class LocalCellInfo -{ - public: - // constructor - LocalCellInfo( - int startidx_x, int startidx_y, int startidx_z, - int nbx, int nby, int nbz, - std::shared_ptr unitcell_info); - - // getter functions - int get_startidx_bx() const { return startidx_bx_; } - int get_startidx_by() const { return startidx_by_; } - int get_startidx_bz() const { return startidx_bz_; } - int get_nbx() const { return nbx_; } - int get_nby() const { return nby_; } - int get_nbz() const { return nbz_; } - int get_bgrids_num() const { return nbxyz_; } - int get_mgrids_num() const { return nmxyz_; } - std::shared_ptr get_unitcell_info() const { return unitcell_info_; } - std::shared_ptr get_bgrid_info() const { return unitcell_info_->get_bgrid_info(); } - - //==================================================================== - // functions related to the big grid - //==================================================================== - - // transform the 3D index of a big grid in the local cell to the 3D index in the local cell - int bgrid_idx_3Dto1D(const Vec3i index_3d) const; - - // transform the 1D index of a big grid in the local cell to the 1D index in the local cell - Vec3i bgrid_idx_1Dto3D(const int index_1d) const; - - // transform the 3D index of a big grid in the local cell to the 3D index in the unit cell - Vec3i get_bgrid_global_idx_3D(const Vec3i index_3d) const; - - // transform the 1D index of a big grid in the local cell to the 3D index in the unit cell - Vec3i get_bgrid_global_idx_3D(const int index_1d) const; - - // transform the 1D index of a big grid in the local cell to the 1D index in the unit cell - int get_bgrid_global_idx_1D(const int index_1d) const; - - // transform the 3D index of a big grid in the unit cell to the 3D index in the local cell - Vec3i get_bgrid_local_idx_3D(const Vec3i index_3d) const; - - // transform the 1D index of a big grid in the unit cell to the 1D index in the local cell - int get_bgrid_local_idx_1D(const int index_1d) const; - - // transform the 3D index of a big grid in the unit cell to the 1D index in the local cell - int get_bgrid_local_idx_1D(const Vec3i index_3d) const; - - // get the cartesian coordinate of a big grid in the unit cell from the 1D index - Vec3d get_bgrid_global_coord_3D(const int index_1d) const; - - // the input is the 3D index of a big grid in the unitcell - // return true if the big grid is in the local cell - bool is_bgrid_in_lcell(const Vec3i index_3d) const; - - - //==================================================================== - // functions related to the meshgrid - //==================================================================== - - // transform the 3D index of a meshgrid in the local cell to the 3D index in the local cell - int mgrid_idx_3Dto1D(const Vec3i index_3d) const; - - // transform the 1D index of a meshgrid in the local cell to the 1D index in the local cell - Vec3i mgrid_idx_1Dto3D(const int index_1d) const; - - // transform the 3D index of a meshgrid in the local cell to the 3D index in the unit cell - Vec3i get_mgrid_global_idx_3D(const Vec3i index_3d) const; - - // transform the 1D index of a meshgrid in the local cell to the 1D index in the unit cell - int get_mgrid_global_idx_1D(const int index_1d) const; - - private: - //==================================================================== - // information about the big grid - //==================================================================== - - // 3D index of the first big grid in the local cell within the unit cell - int startidx_bx_; - int startidx_by_; - int startidx_bz_; - - // Number of big grids in the local cell along the three basis vectors of the local cell - int nbx_; - int nby_; - int nbz_; - - // Total number of big grids in the local cell - int nbxyz_; - - //==================================================================== - // information about the meshgrid - //==================================================================== - - // 3D index of the first meshgrid in the local cell within the unit cell - int startidx_mx_; - int startidx_my_; - int startidx_mz_; - - // Number of meshgrids in the local cell along the three basis vectors of the local cell - int nmx_; - int nmy_; - int nmz_; - - // Total number of meshgrids in the local cell - int nmxyz_; - - // information about the Unitcell - std::shared_ptr unitcell_info_; - - // information about the big grid - std::shared_ptr biggrid_info_; - -}; - -} // namespace ModuleGint diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/meshgrid_info.h b/source/module_hamilt_lcao/module_gint/temp_gint/meshgrid_info.h deleted file mode 100644 index a8307b1048..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/meshgrid_info.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -#include "gint_type.h" -#include "source_cell/unitcell.h" - -namespace ModuleGint -{ - -class MeshGridInfo -{ - public: - // constructor - MeshGridInfo( - Vec3d meshgrid_vec1, - Vec3d meshgrid_vec2, - Vec3d meshgrid_vec3) - : meshgrid_vec1_(meshgrid_vec1), - meshgrid_vec2_(meshgrid_vec2), - meshgrid_vec3_(meshgrid_vec3) - { - // initialize the meshgrid_latvec0_ - meshgrid_latvec0_.e11 = meshgrid_vec1_.x; - meshgrid_latvec0_.e12 = meshgrid_vec1_.y; - meshgrid_latvec0_.e13 = meshgrid_vec1_.z; - - meshgrid_latvec0_.e21 = meshgrid_vec2_.x; - meshgrid_latvec0_.e22 = meshgrid_vec2_.y; - meshgrid_latvec0_.e23 = meshgrid_vec2_.z; - - meshgrid_latvec0_.e31 = meshgrid_vec3_.x; - meshgrid_latvec0_.e32 = meshgrid_vec3_.y; - meshgrid_latvec0_.e33 = meshgrid_vec3_.z; - - // initialize the GT matrix - meshgrid_GT_ = meshgrid_latvec0_.Inverse(); - - meshgrid_volume_ = std::abs(meshgrid_latvec0_.Det()); - } - - double get_volume() const { return meshgrid_volume_; } - Vec3d get_cartesian_coord(const Vec3i& index_3d) const { return index_3d * meshgrid_latvec0_; } - Vec3d get_direct_coord(const Vec3d& cart_coord) const { return cart_coord * meshgrid_GT_; } - - private: - // basis vectors of meshgrid - Vec3d meshgrid_vec1_; - Vec3d meshgrid_vec2_; - Vec3d meshgrid_vec3_; - - // used to convert the (i, j, k) index of the meshgrid to the Cartesian coordinate - // if meshrid_vec1_ is row vector, - // then meshgrid_latvec0_ = [meshgrid_vec1_; meshgrid_vec2_; meshgrid_vec3_], - // (i, j, k) * meshgrid_latvec0_ = (x, y, z) - Matrix3 meshgrid_latvec0_; - - // used to convert the Cartesian coordinate to the (i, j, k) index of the mesh grid - // meshgrid_GT_ = meshgrid_latvec0_.Inverse() - // (x, y, z) * meshgrid_GT_ = (i, j, k) - Matrix3 meshgrid_GT_; - - double meshgrid_volume_; -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.cpp deleted file mode 100644 index 5df52f9453..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.cpp +++ /dev/null @@ -1,253 +0,0 @@ -#include "phi_operator.h" -#include "source_base/global_function.h" -#include "source_base/matrix.h" - -namespace ModuleGint -{ - -void PhiOperator::set_bgrid(std::shared_ptr biggrid) -{ - biggrid_ = biggrid; - rows_ = biggrid_->get_mgrids_num(); - cols_ = biggrid_->get_phi_len(); - - biggrid_->set_atoms_startidx(atoms_startidx_); - biggrid_->set_atoms_phi_len(atoms_phi_len_); - biggrid_->set_mgrids_local_idx(meshgrids_local_idx_); - - // init is_atom_on_mgrid_ and atoms_relative_coords_ - const int atoms_num = biggrid_->get_atoms_num(); - atoms_relative_coords_.resize(atoms_num); - is_atom_on_mgrid_.resize(biggrid_->get_mgrids_num() * atoms_num); - for(int i = 0; i < atoms_num; ++i) - { - biggrid_->set_atom_relative_coords(biggrid_->get_atom(i), atoms_relative_coords_[i]); - for(int j = 0; j < rows_; ++j) - { - is_atom_on_mgrid_[i * rows_ + j] = atoms_relative_coords_[i][j].norm() <= biggrid_->get_atom(i)->get_rcut(); - } - } - - // init atom_pair_start_end_idx_ - init_atom_pair_start_end_idx_(); -} - -void PhiOperator::set_phi_dphi(double* phi, double* dphi_x, double* dphi_y, double* dphi_z) const -{ - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom = biggrid_->get_atom(i); - atom->set_phi_dphi(atoms_relative_coords_[i], cols_, phi, dphi_x, dphi_y, dphi_z); - if(phi != nullptr) - { - phi += atom->get_nw(); - } - dphi_x += atom->get_nw(); - dphi_y += atom->get_nw(); - dphi_z += atom->get_nw(); - } -} - -void PhiOperator::set_ddphi( - double* ddphi_xx, double* ddphi_xy, double* ddphi_xz, - double* ddphi_yy, double* ddphi_yz, double* ddphi_zz) const -{ - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom = biggrid_->get_atom(i); - atom->set_ddphi(atoms_relative_coords_[i], cols_, ddphi_xx, ddphi_xy, ddphi_xz, ddphi_yy, ddphi_yz, ddphi_zz); - ddphi_xx += atom->get_nw(); - ddphi_xy += atom->get_nw(); - ddphi_xz += atom->get_nw(); - ddphi_yy += atom->get_nw(); - ddphi_yz += atom->get_nw(); - ddphi_zz += atom->get_nw(); - } -} - -void PhiOperator::phi_dot_dphi( - const double* phi, - const double* dphi_x, - const double* dphi_y, - const double* dphi_z, - ModuleBase::matrix *fvl) const -{ - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const int iat = biggrid_->get_atom(i)->get_iat(); - const int start_idx = atoms_startidx_[i]; - const int phi_len = atoms_phi_len_[i]; - double rx = 0, ry = 0, rz = 0; - for(int j = 0; j < biggrid_->get_mgrids_num(); ++j) - { - for(int k = 0; k < phi_len; ++k) - { - int idx = j * cols_ + start_idx + k; - const double phi_val = phi[idx]; - rx += phi_val * dphi_x[idx]; - ry += phi_val * dphi_y[idx]; - rz += phi_val * dphi_z[idx]; - } - } - fvl[0](iat, 0) += rx * 2; - fvl[0](iat, 1) += ry * 2; - fvl[0](iat, 2) += rz * 2; - } -} - -void PhiOperator::phi_dot_dphi_r( - const double* phi, - const double* dphi_x, - const double* dphi_y, - const double* dphi_z, - ModuleBase::matrix *svl) const -{ - double sxx = 0, sxy = 0, sxz = 0, syy = 0, syz = 0, szz = 0; - for(int i = 0; i < biggrid_->get_mgrids_num(); ++i) - { - for(int j = 0; j < biggrid_->get_atoms_num(); ++j) - { - const int start_idx = atoms_startidx_[j]; - const Vec3d& r3 = atoms_relative_coords_[j][i]; - for(int k = 0; k < atoms_phi_len_[j]; ++k) - { - const int idx = i * cols_ + start_idx + k; - const double phi_val = phi[idx]; - sxx += phi_val * dphi_x[idx] * r3[0]; - sxy += phi_val * dphi_x[idx] * r3[1]; - sxz += phi_val * dphi_x[idx] * r3[2]; - syy += phi_val * dphi_y[idx] * r3[1]; - syz += phi_val * dphi_y[idx] * r3[2]; - szz += phi_val * dphi_z[idx] * r3[2]; - } - } - } - svl[0](0, 0) += sxx * 2; - svl[0](0, 1) += sxy * 2; - svl[0](0, 2) += sxz * 2; - svl[0](1, 1) += syy * 2; - svl[0](1, 2) += syz * 2; - svl[0](2, 2) += szz * 2; -} - -void PhiOperator::cal_env_gamma( - const double* phi, - const double* wfc, - const vector& trace_lo, - double* rho) const -{ - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom = biggrid_->get_atom(i); - const int iw_start = atom->get_start_iw(); - const int start_idx = atoms_startidx_[i]; - for(int j = 0; j < biggrid_->get_mgrids_num(); ++j) - { - if(is_atom_on_mgrid(i, j)) - { - double tmp = 0.0; - int iw_lo = trace_lo[iw_start]; - for(int iw = 0; iw < atom->get_nw(); ++iw, ++iw_lo) - { - tmp += phi[j * cols_ + start_idx + iw] * wfc[iw_lo]; - } - rho[meshgrids_local_idx_[j]] += tmp; - } - } - } -} - -void PhiOperator::cal_env_k( - const double* phi, - const std::complex* wfc, - const vector& trace_lo, - const int ik, - const int nspin, - const int npol, - const int lgd, - const std::vector& kvec_c, - const std::vector& kvec_d, - double* rho) const -{ - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom = biggrid_->get_atom(i); - const int iw_start = atom->get_start_iw(); - const Vec3d R(atom->get_unitcell_idx()); - const double arg = (kvec_d[ik] * R) * ModuleBase::TWO_PI; - const std::complex kphase = std::complex(cos(arg), sin(arg)); - const int start_idx = atoms_startidx_[i]; - for(int j = 0; j < biggrid_->get_mgrids_num(); ++j) - { - if(is_atom_on_mgrid(i, j)) - { - std::complex tmp{0.0, 0.0}; - int phi_start_idx = j * cols_ + start_idx; - - int iw_lo = 0; - if (nspin == 4) // is it a simple add of 2 spins? - { - for (int is = 0; is < 2; ++is) - { - iw_lo = trace_lo[iw_start] / npol + lgd / npol * is; - for (int iw = 0; iw < atom->get_nw(); ++iw, ++iw_lo) - { - tmp += std::complex(phi[phi_start_idx + iw], 0.0) * wfc[iw_lo] * kphase; - } - } - } - else - { - iw_lo = trace_lo[iw_start]; - for (int iw = 0; iw < atom->get_nw(); ++iw, ++iw_lo) - { - tmp += std::complex(phi[phi_start_idx + iw], 0.0) * wfc[iw_lo] * kphase; - } - } - rho[meshgrids_local_idx_[j]] += tmp.real(); - } - } - } -} - - -//=============================== -// private methods -//=============================== -void PhiOperator::init_atom_pair_start_end_idx_() -{ - int atoms_num = biggrid_->get_atoms_num(); - atom_pair_start_end_idx_.resize(atoms_num * (atoms_num + 1) / 2); - int mgrids_num = biggrid_->get_mgrids_num(); - int atom_pair_idx = 0; - for(int i = 0; i < atoms_num; ++i) - { - // only calculate the upper triangle matrix - for(int j = i; j < atoms_num; ++j) - { - int start_idx = mgrids_num; - int end_idx = -1; - for(int mgrid_idx = 0; mgrid_idx < mgrids_num; ++mgrid_idx) - { - if(is_atom_on_mgrid(i, mgrid_idx) && is_atom_on_mgrid(j, mgrid_idx)) - { - start_idx = mgrid_idx; - break; - } - } - for(int mgrid_idx = mgrids_num - 1; mgrid_idx >= 0; --mgrid_idx) - { - if(is_atom_on_mgrid(i, mgrid_idx) && is_atom_on_mgrid(j, mgrid_idx)) - { - end_idx = mgrid_idx; - break; - } - } - atom_pair_start_end_idx_[atom_pair_idx].first = start_idx; - atom_pair_start_end_idx_[atom_pair_idx].second = end_idx; - atom_pair_idx++; - } - } -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.h b/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.h deleted file mode 100644 index 48044e0014..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.h +++ /dev/null @@ -1,167 +0,0 @@ -#pragma once - -#include -#include -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "big_grid.h" - -namespace ModuleGint -{ - -/** - * @brief The class phiOperator is used to perform operations on the wave function matrix phi, dphi, etc. - * - * In fact, the variables and functions of this class could be placed in the BigGrid class, but the lifecycle of the BigGrid class is relatively long. - * We do not want the BigGrid to contain too many member variables, as this could lead to excessive memory usage. - * Therefore, we separate this class out, so it can be destroyed after use. - */ -class PhiOperator -{ - public: - enum class Triangular_Matrix{Upper, Lower, Full}; - - // constructor - PhiOperator()=default; - - // set the big grid that the phiOperator is associated with - void set_bgrid(std::shared_ptr biggrid); - - // getter - int get_rows() const {return rows_;} - int get_cols() const {return cols_;} - - // get phi of the big grid - // the dimension of phi is num_mgrids * (\sum_{i=0}^{atoms_->size()} atoms_[i]->nw) - template - void set_phi(T* phi) const; - - // get phi and the gradient of phi of the big grid - // the dimension of phi and dphi is num_mgrids * (\sum_{i=0}^{atoms_->size()} atoms_[i]->nw) - // if you do not need phi, you can set phi to nullptr. - void set_phi_dphi(double* phi, double* dphi_x, double* dphi_y, double* dphi_z) const; - - // get the hessian of the wave function values of the big grid - // the dimension of ddphi is num_mgrids * (\sum_{i=0}^{atoms_->size()} atoms_[i]->nw) - void set_ddphi( - double* ddphi_xx, double* ddphi_xy, double* ddphi_xz, - double* ddphi_yy, double* ddphi_yz, double* ddphi_zz) const; - - // phi_dm(ir,iwt_2) = \sum_{iwt_1} phi(ir,iwt_1) * dm(iwt_1,iwt_2) - template - void phi_mul_dm( - const T*const phi, // phi(ir,iwt) - const HContainer& dm, // dm(iwt_1,iwt_2) - const bool is_symm, - T*const phi_dm) const; // phi_dm(ir,iwt) - - // result(ir,iwt) = phi(ir,iwt) * vl(ir) - template - void phi_mul_vldr3( - const T*const vl, // vl(ir) - const T dr3, - const T*const phi, // phi(ir,iwt) - T*const result) const; // result(ir,iwt) - - // hr(iwt_i,iwt_j) = \sum_{ir} phi_i(ir,iwt_i) * phi_i(ir,iwt_j) - // this is a thread-safe function - template - void phi_mul_phi( - const T*const phi_i, // phi_i(ir,iwt) - const T*const phi_j, // phi_j(ir,iwt) - HContainer& hr, // hr(iwt_i,iwt_j) - const Triangular_Matrix triangular_matrix) const; - - // rho(ir) = \sum_{iwt} \phi_i(ir,iwt) * \phi_j(ir,iwt) - template - void phi_dot_phi( - const T*const phi_i, // phi_i(ir,iwt) - const T*const phi_j, // phi_j(ir,iwt) - T*const rho) const; // rho(ir) - - void phi_dot_dphi( - const double* phi, - const double* dphi_x, - const double* dphi_y, - const double* dphi_z, - ModuleBase::matrix *fvl) const; - - void phi_dot_dphi_r( - const double* phi, - const double* dphi_x, - const double* dphi_y, - const double* dphi_z, - ModuleBase::matrix *svl) const; - - void cal_env_gamma( - const double* phi, - const double* wfc, - const vector& trace_lo, - double* rho) const; - - void cal_env_k( - const double* phi, - const std::complex* wfc, - const vector& trace_lo, - const int ik, - const int nspin, - const int npol, - const int lgd, - const std::vector& kvec_c, - const std::vector& kvec_d, - double* rho) const; - - private: - void init_atom_pair_start_end_idx_(); - - // get the index of the first and the last meshgrid that both atom a and atom b affect - // Note that atom_pair_start_end_idx_ only stores the cases where a <= b, so this function is needed to retrieve the value - const std::pair& get_atom_pair_start_end_idx_(int a, int b) const - { - int x = std::min(a, b); - int y = std::abs(a - b); - return atom_pair_start_end_idx_[(2 * biggrid_->get_atoms_num() - x + 1) * x / 2 + y]; - } - - bool is_atom_on_mgrid(int atom_idx, int mgrid_idx) const - { - return is_atom_on_mgrid_[atom_idx * rows_ + mgrid_idx]; - } - - // the row number of the phi matrix - // rows_ = biggrid_->get_mgrids_num() - int rows_; - - // the column number of the phi matrix - // cols_ = biggrid_->get_phi_len() - int cols_; - - // the local index of the meshgrids - std::vector meshgrids_local_idx_; - - // the big grid that the phi matrix is associated with - std::shared_ptr biggrid_; - - // the relative coordinates of the atoms and the meshgrids - // atoms_relative_coords_[i][j] is the relative coordinate of the jth meshgrid and the ith atom - std::vector> atoms_relative_coords_; - - // record whether the atom affects the meshgrid - // is_atom_on_mgrid_[i * rows_ + j] = true if the ith atom affects jhe ith meshgrid, otherwise false - std::vector is_atom_on_mgrid_; - - // the start index of the phi of each atom - std::vector atoms_startidx_; - - // the length of phi of each atom - // atoms_phi_len_[i] = biggrid_->get_atom(i)->get_nw() - // TODO: remove it - std::vector atoms_phi_len_; - - // This data structure is used to store the index of the first and last meshgrid affected by each atom pair - std::vector> atom_pair_start_end_idx_; -}; - -} - -#include "phi_operator.hpp" \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.hpp b/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.hpp deleted file mode 100644 index 79c4b29c23..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/phi_operator.hpp +++ /dev/null @@ -1,188 +0,0 @@ -#pragma once - -#include "phi_operator.h" -#include "source_base/blas_connector.h" -#include "source_base/global_function.h" - -namespace ModuleGint -{ - -template -void PhiOperator::set_phi(T* phi) const -{ - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom = biggrid_->get_atom(i); - atom->set_phi(atoms_relative_coords_[i], cols_, phi); - phi += atom->get_nw(); - } -} - -// phi_dm(ir,iwt_2) = \sum_{iwt_1} phi(ir,iwt_1) * dm(iwt_1,iwt_2) -template -void PhiOperator::phi_mul_dm( - const T*const phi, // phi(ir,iwt) - const HContainer& dm, // dm(iwt_1,iwt_2) - const bool is_symm, - T*const phi_dm) const // phi_dm(ir,iwt) -{ - ModuleBase::GlobalFunc::ZEROS(phi_dm, rows_ * cols_); - - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom_i = biggrid_->get_atom(i); - const auto r_i = atom_i->get_R(); - - if(is_symm) - { - const auto dm_mat = dm.find_matrix(atom_i->get_iat(), atom_i->get_iat(), 0, 0, 0); - constexpr T alpha = 1.0; - constexpr T beta = 1.0; - BlasConnector::symm_cm( - 'L', 'U', - atoms_phi_len_[i], rows_, - alpha, dm_mat->get_pointer(), atoms_phi_len_[i], - &phi[0 * cols_ + atoms_startidx_[i]], cols_, - beta, &phi_dm[0 * cols_ + atoms_startidx_[i]], cols_); - } - - const int start = is_symm ? i + 1 : 0; - - for(int j = start; j < biggrid_->get_atoms_num(); ++j) - { - const auto atom_j = biggrid_->get_atom(j); - const auto r_j = atom_j->get_R(); - // FIXME may be r = r_j - r_i - const auto dm_mat = dm.find_matrix(atom_i->get_iat(), atom_j->get_iat(), r_i-r_j); - - // if dm_mat is nullptr, it means this atom pair does not affect any meshgrid in the unitcell - if(dm_mat == nullptr) - { - continue; - } - - const int start_idx = get_atom_pair_start_end_idx_(i, j).first; - const int end_idx = get_atom_pair_start_end_idx_(i, j).second; - const int len = end_idx - start_idx + 1; - - // if len<=0, it means this atom pair does not affect any meshgrid in this biggrid - if(len <= 0) - { - continue; - } - - const T alpha = is_symm ? 2.0 : 1.0; - constexpr T beta = 1.0; - BlasConnector::gemm( - 'N', 'N', - len, atoms_phi_len_[j], atoms_phi_len_[i], - alpha, &phi[start_idx * cols_ + atoms_startidx_[i]], cols_, - dm_mat->get_pointer(), atoms_phi_len_[j], - beta, &phi_dm[start_idx * cols_ + atoms_startidx_[j]], cols_); - } - } -} - -// result(ir) = phi(ir) * vl(ir) -template -void PhiOperator::phi_mul_vldr3( - const T*const vl, // vl(ir) - const T dr3, - const T*const phi, // phi(ir,iwt) - T*const result) const // result(ir,iwt) -{ - int idx = 0; - for(int i = 0; i < biggrid_->get_mgrids_num(); i++) - { - T vldr3_mgrid = vl[meshgrids_local_idx_[i]] * dr3; - for(int j = 0; j < cols_; j++) - { - result[idx] = phi[idx] * vldr3_mgrid; - idx++; - } - } -} - -// hr(iwt_i,iwt_j) += \sum_{ir} phi_i(ir,iwt_i) * phi_i(ir,iwt_j) -// this is a thread-safe function -template -void PhiOperator::phi_mul_phi( - const T*const phi_i, // phi_i(ir,iwt) - const T*const phi_j, // phi_j(ir,iwt) - HContainer& hr, // hr(iwt_i,iwt_j) - const Triangular_Matrix triangular_matrix) const -{ - std::vector tmp_hr; - for(int i = 0; i < biggrid_->get_atoms_num(); ++i) - { - const auto atom_i = biggrid_->get_atom(i); - const auto& r_i = atom_i->get_R(); - const int iat_i = atom_i->get_iat(); - const int n_i = atoms_phi_len_[i]; - - for(int j = 0; j < biggrid_->get_atoms_num(); ++j) - { - const auto atom_j = biggrid_->get_atom(j); - const auto& r_j = atom_j->get_R(); - const int iat_j = atom_j->get_iat(); - const int n_j = atoms_phi_len_[j]; - - // only calculate the upper triangle matrix - if(triangular_matrix==Triangular_Matrix::Upper && iat_i>iat_j) - { - continue; - } - // only calculate the upper triangle matrix - else if(triangular_matrix==Triangular_Matrix::Lower && iat_iadd_array_ts(tmp_hr.data()); - } - } -} - -// rho(ir) = \sum_{iwt} \phi_i(ir,iwt) * \phi_j^*(ir,iwt) -template -void PhiOperator::phi_dot_phi( - const T*const phi_i, // phi_i(ir,iwt) - const T*const phi_j, // phi_j(ir,iwt) - T*const rho) const // rho(ir) -{ - constexpr int inc = 1; - for(int i = 0; i < biggrid_->get_mgrids_num(); ++i) - { - rho[meshgrids_local_idx_[i]] += BlasConnector::dotc(cols_, phi_j+i*cols_, inc, phi_i+i*cols_, inc); - } -} - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/set_ddphi.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/set_ddphi.cpp deleted file mode 100644 index c84f087487..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/set_ddphi.cpp +++ /dev/null @@ -1,237 +0,0 @@ -#include "source_base/array_pool.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" -#include "gint_atom.h" -#include "gint_helper.h" - -namespace ModuleGint -{ - -template -void GintAtom::set_ddphi( - const std::vector& coords, const int stride, - T* ddphi_xx, T* ddphi_xy, T* ddphi_xz, - T* ddphi_yy, T* ddphi_yz, T* ddphi_zz) const -{ - ModuleBase::timer::tick("GintAtom", "set_ddphi"); - - const int num_mgrids = coords.size(); - - // orb_ does not have the member variable dr_uniform - const double dr_uniform = orb_->PhiLN(0, 0).dr_uniform; - - std::vector rly(std::pow(atom_->nwl + 1, 2)); - ModuleBase::Array_Pool grly(std::pow(atom_->nwl + 1, 2), 3); - // TODO: A better data structure such as a 3D tensor can be used to store dphi - std::vector>> dphi(atom_->nw, std::vector>(6, std::vector(3))); - Vec3d coord1; - ModuleBase::Array_Pool displ(6, 3); - displ[0][0] = 0.0001; // in x direction - displ[1][0] = -0.0001; - displ[2][1] = 0.0001; // in y direction - displ[3][1] = -0.0001; - displ[4][2] = 0.0001; // in z direction - displ[5][2] = -0.0001; - - for(int im = 0; im < num_mgrids; im++) - { - const Vec3d& coord = coords[im]; - // 1e-9 is to avoid division by zero - const double dist = coord.norm() < 1e-9 ? 1e-9 : coord.norm(); - - if(dist > orb_->getRcut()) - { - // if the distance is larger than the cutoff radius, - // the wave function values are all zeros - ModuleBase::GlobalFunc::ZEROS(ddphi_xx + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(ddphi_xy + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(ddphi_xz + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(ddphi_yy + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(ddphi_yz + im * stride, atom_->nw); - ModuleBase::GlobalFunc::ZEROS(ddphi_zz + im * stride, atom_->nw); - continue; - } - - for(int i = 0; i < 6; i++) - { - coord1[0] = coord[0] + displ[i][0]; - coord1[1] = coord[1] + displ[i][1]; - coord1[2] = coord[2] + displ[i][2]; - - // sphereical harmonics - ModuleBase::Ylm::grad_rl_sph_harm(atom_->nwl, coord1[0], coord1[1], coord1[2], rly.data(), grly.get_ptr_2D()); - - const double dist1 = coord1.norm() < 1e-9 ? 1e-9 : coord1.norm(); - - const double position = dist1 / dr_uniform; - const int ip = static_cast(position); - const double x0 = position - ip; - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1 * x2 / 6; - const double x03 = x0 * x3 / 2; - - double tmp, dtmp; - - for(int iw = 0; iw < atom_->nw; ++iw) - { - if(atom_->iw2_new[iw]) - { - auto psi_uniform = p_psi_uniform_[iw]; - auto dpsi_uniform = p_dpsi_uniform_[iw]; - // use Polynomia Interpolation method to get the - // wave functions - tmp = x12 * (psi_uniform[ip] * x3 + psi_uniform[ip + 3] * x0) - + x03 * (psi_uniform[ip + 1] * x2 - psi_uniform[ip + 2] * x1); - - dtmp = x12 * (dpsi_uniform[ip] * x3 + dpsi_uniform[ip + 3] * x0) - + x03 * (dpsi_uniform[ip + 1] * x2 - dpsi_uniform[ip + 2] * x1); - } - - // get the 'l' of this localized wave function - const int ll = atom_->iw2l[iw]; - const int idx_lm = atom_->iw2_ylm[iw]; - - const double rl = pow_int(dist1, ll); - - // derivative of wave functions with respect to atom positions. - const double tmpdphi_rly = (dtmp - tmp * ll / dist1) / rl * rly[idx_lm] / dist1; - const double tmprl = tmp / rl; - - dphi[iw][i][0] = tmpdphi_rly * coord1[0] + tmprl * grly[idx_lm][0]; - dphi[iw][i][1] = tmpdphi_rly * coord1[1] + tmprl * grly[idx_lm][1]; - dphi[iw][i][2] = tmpdphi_rly * coord1[2] + tmprl * grly[idx_lm][2]; - } // end iw - } // end i - - for(int iw = 0; iw < atom_->nw; iw++) - { - int idx = im * stride + iw; - ddphi_xx[idx] = (dphi[iw][0][0] - dphi[iw][1][0]) / 0.0002; - ddphi_xy[idx] - = ((dphi[iw][2][0] - dphi[iw][3][0]) + (dphi[iw][0][1] - dphi[iw][1][1])) / 0.0004; - ddphi_xz[idx] - = ((dphi[iw][4][0] - dphi[iw][5][0]) + (dphi[iw][0][2] - dphi[iw][1][2])) / 0.0004; - ddphi_yy[idx] = (dphi[iw][2][1] - dphi[iw][3][1]) / 0.0002; - ddphi_yz[idx] - = ((dphi[iw][4][1] - dphi[iw][5][1]) + (dphi[iw][2][2] - dphi[iw][3][2])) / 0.0004; - ddphi_zz[idx] = (dphi[iw][4][2] - dphi[iw][5][2]) / 0.0002; - } - - // else - // // the analytical method for evaluating 2nd derivatives - // // it is not used currently - // { - // // Add it here, but do not run it. If there is a need to run this code - // // in the future, include it in the previous initialization process. - // for (int iw=0; iw< atom->nw; ++iw) - // { - // if ( atom->iw2_new[iw] ) - // { - // it_ddpsi_uniform[iw] = gt.d2phi_u[it*gt.nwmax + iw].data(); - // } - // } - // // End of code addition section. - - // std::vector> hrly; - // ModuleBase::Ylm::grad_rl_sph_harm(ucell.atoms[it].nwl, dr[0], dr[1], dr[2], rly, grly.data()); - // ModuleBase::Ylm::hes_rl_sph_harm(ucell.atoms[it].nwl, dr[0], dr[1], dr[2], hrly); - // const double position = distance / delta_r; - - // const double iq = static_cast(position); - // const int ip = static_cast(position); - // const double x0 = position - iq; - // const double x1 = 1.0 - x0; - // const double x2 = 2.0 - x0; - // const double x3 = 3.0 - x0; - // const double x12 = x1 * x2 / 6; - // const double x03 = x0 * x3 / 2; - - // double tmp, dtmp, ddtmp; - - // for (int iw = 0; iw < atom->nw; ++iw) - // { - // // this is a new 'l', we need 1D orbital wave - // // function from interpolation method. - // if (atom->iw2_new[iw]) - // { - // auto psi_uniform = it_psi_uniform[iw]; - // auto dpsi_uniform = it_dpsi_uniform[iw]; - // auto ddpsi_uniform = it_ddpsi_uniform[iw]; - - // // if ( iq[id] >= philn.nr_uniform-4) - // if (iq >= it_phi_nr_uniform[iw]-4) - // { - // tmp = dtmp = ddtmp = 0.0; - // } - // else - // { - // // use Polynomia Interpolation method to get the - // // wave functions - - // tmp = x12 * (psi_uniform[ip] * x3 + psi_uniform[ip + 3] * x0) - // + x03 * (psi_uniform[ip + 1] * x2 - psi_uniform[ip + 2] * x1); - - // dtmp = x12 * (dpsi_uniform[ip] * x3 + dpsi_uniform[ip + 3] * x0) - // + x03 * (dpsi_uniform[ip + 1] * x2 - dpsi_uniform[ip + 2] * x1); - - // ddtmp = x12 * (ddpsi_uniform[ip] * x3 + ddpsi_uniform[ip + 3] * x0) - // + x03 * (ddpsi_uniform[ip + 1] * x2 - ddpsi_uniform[ip + 2] * x1); - // } - // } // new l is used. - - // // get the 'l' of this localized wave function - // const int ll = atom->iw2l[iw]; - // const int idx_lm = atom->iw2_ylm[iw]; - - // const double rl = pow_int(distance, ll); - // const double r_lp2 =rl * distance * distance; - - // // d/dr (R_l / r^l) - // const double tmpdphi = (dtmp - tmp * ll / distance) / rl; - // const double term1 = ddtmp / r_lp2; - // const double term2 = (2 * ll + 1) * dtmp / r_lp2 / distance; - // const double term3 = ll * (ll + 2) * tmp / r_lp2 / distance / distance; - // const double term4 = tmpdphi / distance; - // const double term5 = term1 - term2 + term3; - - // // hessian of (R_l / r^l) - // const double term_xx = term4 + dr[0] * dr[0] * term5; - // const double term_xy = dr[0] * dr[1] * term5; - // const double term_xz = dr[0] * dr[2] * term5; - // const double term_yy = term4 + dr[1] * dr[1] * term5; - // const double term_yz = dr[1] * dr[2] * term5; - // const double term_zz = term4 + dr[2] * dr[2] * term5; - - // // d/dr (R_l / r^l) * alpha / r - // const double term_1x = dr[0] * term4; - // const double term_1y = dr[1] * term4; - // const double term_1z = dr[2] * term4; - - // p_ddphi_xx[iw] - // = term_xx * rly[idx_lm] + 2.0 * term_1x * grly[idx_lm][0] + tmp / rl * hrly[idx_lm][0]; - // p_ddphi_xy[iw] = term_xy * rly[idx_lm] + term_1x * grly[idx_lm][1] + term_1y * grly[idx_lm][0] - // + tmp / rl * hrly[idx_lm][1]; - // p_ddphi_xz[iw] = term_xz * rly[idx_lm] + term_1x * grly[idx_lm][2] + term_1z * grly[idx_lm][0] - // + tmp / rl * hrly[idx_lm][2]; - // p_ddphi_yy[iw] - // = term_yy * rly[idx_lm] + 2.0 * term_1y * grly[idx_lm][1] + tmp / rl * hrly[idx_lm][3]; - // p_ddphi_yz[iw] = term_yz * rly[idx_lm] + term_1y * grly[idx_lm][2] + term_1z * grly[idx_lm][1] - // + tmp / rl * hrly[idx_lm][4]; - // p_ddphi_zz[iw] - // = term_zz * rly[idx_lm] + 2.0 * term_1z * grly[idx_lm][2] + tmp / rl * hrly[idx_lm][5]; - - // } // iw - // } // end if - } - - ModuleBase::timer::tick("GintAtom", "set_ddphi"); -} - -// explicit instantiation -template void GintAtom::set_ddphi(const std::vector& coords, const int stride, - double* ddphi_xx, double* ddphi_xy, double* ddphi_xz, - double* ddphi_yy, double* ddphi_yz, double* ddphi_zz) const; - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.cpp b/source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.cpp deleted file mode 100644 index e95b572a69..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "unitcell_info.h" -#include "gint_helper.h" - -namespace ModuleGint -{ - -UnitCellInfo::UnitCellInfo( - const Vec3d& unitcell_vec1, - const Vec3d& unitcell_vec2, - const Vec3d& unitcell_vec3, - int nbx, int nby, int nbz, - int nmx, int nmy, int nmz) - : unitcell_vec1_(unitcell_vec1), - unitcell_vec2_(unitcell_vec2), - unitcell_vec3_(unitcell_vec3), - nbx_(nbx), nby_(nby), nbz_(nbz), nbxyz_(nbx*nby*nbz), - nmx_(nmx), nmy_(nmy), nmz_(nmz), nmxyz_(nmx*nmy*nmz) - { - // initialize the biggrid_info_ - biggrid_info_ = std::make_shared( - unitcell_vec1_ / static_cast(nbx), - unitcell_vec2_ / static_cast(nby), - unitcell_vec3_ / static_cast(nbz), - nmx/nbx, nmy/nby, nmz/nbz); - - meshgrid_info_ = biggrid_info_->get_mgrid_info(); - } - -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.h b/source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.h deleted file mode 100644 index df1e88b38c..0000000000 --- a/source/module_hamilt_lcao/module_gint/temp_gint/unitcell_info.h +++ /dev/null @@ -1,172 +0,0 @@ -#pragma once - -#include -#include -#include "biggrid_info.h" -#include "gint_helper.h" -#include "gint_type.h" - -namespace ModuleGint -{ - -class UnitCellInfo -{ - public: - // constructor - UnitCellInfo( - const Vec3d& unitcell_vec1, - const Vec3d& unitcell_vec2, - const Vec3d& unitcell_vec3, - int nbx, int nby, int nbz, - int nmx, int nmy, int nmz); - - // getter functions - int get_nbx() const { return nbx_; } - int get_nby() const { return nby_; } - int get_nbz() const { return nbz_; } - int get_bgrids_num() const { return nbxyz_; } - int get_nmx() const { return nmx_; } - int get_nmy() const { return nmy_; } - int get_nmz() const { return nmz_; } - int get_mgrids_num() const { return nmxyz_; } - std::shared_ptr get_bgrid_info() const { return biggrid_info_; } - std::shared_ptr get_mgrid_info() const { return meshgrid_info_; } - - //==================================================================== - // functions related to the big grid - //==================================================================== - - // transform the 1D index of a big grid in the unit cell to the 3D index - Vec3i bgrid_idx_1Dto3D(const int index_1d) const - { - return index1Dto3D(index_1d, nbx_, nby_, nbz_); - } - - // transform the 3D index of a biggrid in the unit cell to the 1D index - int bgrid_idx_3Dto1D(const Vec3i index_3d) const - { - return index3Dto1D(index_3d.x, index_3d.y, index_3d.z, nbx_, nby_, nbz_); - } - - // get the cartesian coordinate of a big grid in the unit cell from the 3D index - Vec3d get_bgrid_coord(Vec3i index_3d) const - { - return biggrid_info_->get_cartesian_coord(index_3d); - } - - // get the cartesian coordinate of a big grid in the unit cell from the 1D index - Vec3d get_bgrid_coord(int index_1d) const - { - return get_bgrid_coord(bgrid_idx_1Dto3D(index_1d)); - } - - // get the 3D index of a big grid in the unit cell from the cartesian coordinate - Vec3i get_bgrid_idx_3d(const Vec3d coord) const - { - Vec3d direct_coord = biggrid_info_->get_direct_coord(coord); - return Vec3i( - static_cast(floor(direct_coord.x)), - static_cast(floor(direct_coord.y)), - static_cast(floor(direct_coord.z))); - } - - // Get the relative Cartesian coordinates of big grid A relative to big grid B - // returned vector = coordinates of point A - coordinates of point B - // this function is more efficient than obtaining two 3D coordinates separately - // through two 3D indices and then subtracting them - Vec3d get_relative_coord(Vec3i index_3d_a, Vec3i index_3d_b) const - { - return get_bgrid_coord(index_3d_a - index_3d_b); - } - - // get the extended unitcell index of a big grid - Vec3i get_unitcell_idx(const Vec3i index_3d) const - { - return Vec3i(floor_div(index_3d.x, nbx_), - floor_div(index_3d.y, nby_), - floor_div(index_3d.z, nbz_)); - } - - // map the extended big grid index to the big grid index in unitcell - Vec3i map_ext_idx_to_ucell(const Vec3i index_3d) const - { - return Vec3i(index_3d.x - floor_div(index_3d.x, nbx_) * nbx_, - index_3d.y - floor_div(index_3d.y, nby_) * nby_, - index_3d.z - floor_div(index_3d.z, nbz_) * nbz_); - } - - - //==================================================================== - // functions related to the meshgrid - //==================================================================== - - // transform the 1D index of a meshgrid in the unit cell to the 3D index - Vec3i mgrid_idx_1Dto3D(const int index_1d) const - { - return index1Dto3D(index_1d, nmx_, nmy_, nmz_); - } - - // transform the 3D index of a meshgrid in the unit cell to the 1D index - int mgrid_idx_3Dto1D(const Vec3i index_3d) const - { - return index3Dto1D(index_3d.x, index_3d.y, index_3d.z, nmx_, nmy_, nmz_); - } - - // get the cartesian coordinate of a meshgrid in the unit cell from the 3D index - Vec3d get_mgrid_coord(Vec3i index_3d) const - { - return meshgrid_info_->get_cartesian_coord(index_3d); - } - - // get the cartesian coordinate of a meshgrid in the unit cell from the 1D index - Vec3d get_mgrid_coord(int index_1d) const - { - return get_mgrid_coord(mgrid_idx_1Dto3D(index_1d)); - } - - private: - // basis vectors of the unit cell - Vec3d unitcell_vec1_; - Vec3d unitcell_vec2_; - Vec3d unitcell_vec3_; - - //==================================================================== - // member variables related to the Big Grid - //==================================================================== - - // the number of big cells along the first lattice vector - int nbx_; - - // the number of big cells along the second lattice vector - int nby_; - - // the number of big cells along the third lattice vector - int nbz_; - - // the total number of big cells - int nbxyz_; - - // basic attributes of the big grid - std::shared_ptr biggrid_info_; - - std::shared_ptr meshgrid_info_; - - //==================================================================== - // member variables related to meshgrid - //==================================================================== - - // the number of meshgrids along the first lattice vector - int nmx_; - - // the number of meshgrids along the second lattice vector - int nmy_; - - // the number of meshgrids along the third lattice vector - int nmz_; - - // the total number of meshgrids in the unitcell - int nmxyz_; - -}; - -} // namespace ModuleGint \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/test/CMakeLists.txt b/source/module_hamilt_lcao/module_gint/test/CMakeLists.txt deleted file mode 100644 index 2030b04a12..0000000000 --- a/source/module_hamilt_lcao/module_gint/test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -if(ENABLE_LCAO AND USE_CUDA) - AddTest( - TARGET gint_gpu_test - LIBS parameter ${math_libs} psi base device - SOURCES test_sph.cu test_sph.cpp -) -endif() \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/test/test_sph.cpp b/source/module_hamilt_lcao/module_gint/test/test_sph.cpp deleted file mode 100644 index e13a4d5675..0000000000 --- a/source/module_hamilt_lcao/module_gint/test/test_sph.cpp +++ /dev/null @@ -1,597 +0,0 @@ -#include "test_sph.h" -using namespace std; - -void sph_harm(const int& Lmax, // max momentum of l - const double& xdr, - const double& ydr, - const double& zdr, - std::vector& rly, - double* ylmcoef) -{ - - // begin calculation - /*************************** - L = 0 - ***************************/ - rly[0] = ylmcoef[0]; // l=0, m=0 - if (Lmax == 0) - return; - - /*************************** - L = 1 - ***************************/ - rly[1] = ylmcoef[1] * zdr; // l=1, m=0 - rly[2] = -ylmcoef[1] * xdr; // l=1, m=1 - rly[3] = -ylmcoef[1] * ydr; // l=1, m=-1 - if (Lmax == 1) - return; - - /*************************** - L = 2 - ***************************/ - double tmp0 = ylmcoef[3] * rly[0]; - rly[4] = ylmcoef[2] * zdr * rly[1] - tmp0; // l=2, m=0 - - tmp0 = ylmcoef[4] * zdr; - rly[5] = tmp0 * rly[2]; // l=2,m=1 - rly[6] = tmp0 * rly[3]; // l=2,m=-1 - - double tmp2 = ylmcoef[4] * xdr; - rly[7] - = ylmcoef[5] * rly[4] - ylmcoef[6] * rly[0] - tmp2 * rly[2]; // l=2,m=2 - rly[8] = -tmp2 * rly[3]; - // rly[8] = tmp1+tmp2*rly[3];//l=2,m=-2 - if (Lmax == 2) - return; - - /*************************** - L = 3 - ***************************/ - tmp0 = ylmcoef[8] * rly[1]; - rly[9] = ylmcoef[7] * zdr * rly[4] - tmp0; // l=3, m=0 - - double tmp3 = ylmcoef[9] * zdr; - rly[10] = tmp3 * rly[5] - ylmcoef[10] * rly[2]; // l=3,m=1 - rly[11] = tmp3 * rly[6] - ylmcoef[10] * rly[3]; // l=3,m=-1 - - double tmp4 = ylmcoef[11] * zdr; - rly[12] = tmp4 * rly[7]; // l=3,m=2 - rly[13] = tmp4 * rly[8]; // l=3,m=-2 - - double tmp5 = ylmcoef[14] * xdr; - rly[14] = ylmcoef[12] * rly[10] - ylmcoef[13] * rly[2] - - tmp5 * rly[7]; // l=3,m=3 - rly[15] = ylmcoef[12] * rly[11] - ylmcoef[13] * rly[3] - - tmp5 * rly[8]; // l=3,m=-3 - if (Lmax == 3) - return; - - /*************************** - L = 4 - ***************************/ - tmp0 = ylmcoef[16] * rly[4]; - rly[16] = ylmcoef[15] * zdr * rly[9] - tmp0; // l=4,m=0 - - double tmp6 = ylmcoef[17] * zdr; - rly[17] = tmp6 * rly[10] - ylmcoef[18] * rly[5]; // l=4,m=1 - rly[18] = tmp6 * rly[11] - ylmcoef[18] * rly[6]; // l=4,m=-1 - - double tmp7 = ylmcoef[19] * zdr; - rly[19] = tmp7 * rly[12] - ylmcoef[20] * rly[7]; // l=4,m=2 - rly[20] = tmp7 * rly[13] - ylmcoef[20] * rly[8]; // l=4,m=-2 - - double tmp8 = 3.0 * zdr; - rly[21] = tmp8 * rly[14]; // l=4,m=3 - rly[22] = tmp8 * rly[15]; // l=4,m=-3 - - double tmp9 = ylmcoef[23] * xdr; - rly[23] = ylmcoef[21] * rly[19] - ylmcoef[22] * rly[7] - - tmp9 * rly[14]; // l=4,m=4 - rly[24] = ylmcoef[21] * rly[20] - ylmcoef[22] * rly[8] - - tmp9 * rly[15]; // l=4,m=-4 - if (Lmax == 4) - return; - - /*************************** - L = 5 - ***************************/ - tmp0 = ylmcoef[25] * rly[9]; - rly[25] = ylmcoef[24] * zdr * rly[16] - tmp0; // l=5,m=0 - - double tmp10 = ylmcoef[26] * zdr; - rly[26] = tmp10 * rly[17] - ylmcoef[27] * rly[10]; // l=5,m=1 - rly[27] = tmp10 * rly[18] - ylmcoef[27] * rly[11]; // l=5,m=-1 - - double tmp11 = ylmcoef[28] * zdr; - rly[28] = tmp11 * rly[19] - ylmcoef[29] * rly[12]; // l=5,m=2 - rly[29] = tmp11 * rly[20] - ylmcoef[29] * rly[13]; // l=5,m=-2 - - double tmp12 = ylmcoef[30] * zdr; - rly[30] = tmp12 * rly[21] - ylmcoef[31] * rly[14]; // l=5,m=3 - rly[31] = tmp12 * rly[22] - ylmcoef[31] * rly[15]; // l=5,m=-3 - - double tmp13 = ylmcoef[32] * zdr; - rly[32] = tmp13 * rly[23]; // l=5,m=4 - rly[33] = tmp13 * rly[24]; // l=5,m=-4 - - double tmp14 = ylmcoef[35] * xdr; - rly[34] = ylmcoef[33] * rly[30] - ylmcoef[34] * rly[14] - - tmp14 * rly[23]; // l=5,m=5 - rly[35] = ylmcoef[33] * rly[31] - ylmcoef[34] * rly[15] - - tmp14 * rly[24]; // l=5,m=-5 - if (Lmax == 5) - return; - - // if Lmax > 5 - for (int il = 6; il <= Lmax; il++) - { - int istart = il * il; - int istart1 = (il - 1) * (il - 1); - int istart2 = (il - 2) * (il - 2); - - double fac2 = sqrt(4.0 * istart - 1.0); - double fac4 = sqrt(4.0 * istart1 - 1.0); - - for (int im = 0; im < 2 * il - 1; im++) - { - int imm = (im + 1) / 2; - // if (im % 2 == 0) imm *= -1; - - rly[istart + im] = fac2 / sqrt((double)istart - imm * imm) - * (zdr * rly[istart1 + im] - - sqrt((double)istart1 - imm * imm) / fac4 - * rly[istart2 + im]); - } - - double bl1 = sqrt(2.0 * il / (2.0 * il + 1.0)); - double bl2 = sqrt((2.0 * il - 2.0) / (2.0 * il - 1.0)); - double bl3 = sqrt(2.0) / fac2; - - rly[istart + 2 * il - 1] - = (bl3 * rly[istart + 2 * il - 5] - bl2 * rly[istart2 + 2 * il - 5] - - 2.0 * xdr * rly[istart1 + 2 * il - 3]) - / bl1; - rly[istart + 2 * il] - = (bl3 * rly[istart + 2 * il - 4] - bl2 * rly[istart2 + 2 * il - 4] - - 2.0 * xdr * rly[istart1 + 2 * il - 2]) - / bl1; - } - - return; -} -void grad_rl_sph_harm(const int& Lmax, // max momentum of L - const double& x, - const double& y, - const double& z, - double* rly, - double** grly, - const double* ylmcoef) -{ - double radius2 = x * x + y * y + z * z; - double tx = 2.0 * x; - double ty = 2.0 * y; - double tz = 2.0 * z; - - // begin calculation - /*************************** - L = 0 - ***************************/ - rly[0] = ylmcoef[0]; // l=0, m=0 - grly[0][0] = grly[0][1] = grly[0][2] = 0.0; - if (Lmax == 0) - return; - - /*************************** - L = 1 - ***************************/ - rly[1] = ylmcoef[1] * z; // l=1, m=0 - grly[1][0] = grly[1][1] = 0.0; - grly[1][2] = ylmcoef[1]; - - rly[2] = -ylmcoef[1] * x; // l=1, m=1 - grly[2][1] = grly[2][2] = 0.0; - grly[2][0] = -ylmcoef[1]; - - rly[3] = -ylmcoef[1] * y; // l=1, m=-1 - grly[3][0] = grly[3][2] = 0.0; - grly[3][1] = -ylmcoef[1]; - - if (Lmax == 1) - return; - - /*************************** - L = 2 - ***************************/ - rly[4] - = ylmcoef[2] * z * rly[1] - ylmcoef[3] * rly[0] * radius2; // l=2, m=0 - grly[4][0] - = ylmcoef[2] * z * grly[1][0] - - ylmcoef[3] * (grly[0][0] * radius2 + rly[0] * tx); // l=2, m=0 - grly[4][1] - = ylmcoef[2] * z * grly[1][1] - - ylmcoef[3] * (grly[0][1] * radius2 + rly[0] * ty); // l=2, m=0 - grly[4][2] - = ylmcoef[2] * (z * grly[1][2] + rly[1]) - - ylmcoef[3] * (grly[0][2] * radius2 + rly[0] * tz); // l=2, m=0 - - double tmp0 = ylmcoef[4] * z; - rly[5] = tmp0 * rly[2]; // l=2,m=1 - grly[5][0] = tmp0 * grly[2][0]; - grly[5][1] = tmp0 * grly[2][1]; - grly[5][2] = ylmcoef[4] * (rly[2] + z * grly[2][2]); - - rly[6] = tmp0 * rly[3]; // l=2,m=-1 - grly[6][0] = tmp0 * grly[3][0]; - grly[6][1] = tmp0 * grly[3][1]; - grly[6][2] = ylmcoef[4] * (rly[3] + z * grly[3][2]); - - double tmp2 = ylmcoef[4] * x; - rly[7] = ylmcoef[5] * rly[4] - ylmcoef[6] * rly[0] * radius2 - - tmp2 * rly[2]; // l=2,m=2 - grly[7][0] = ylmcoef[5] * grly[4][0] - - ylmcoef[6] * (rly[0] * tx + grly[0][0] * radius2) - - ylmcoef[4] * (x * grly[2][0] + rly[2]); - - // std::cout << "\np1 = "<< ylmcoef[5]*grly[4][0] << " p2 = " << - //-ylmcoef[6]*rly[0]*tx - // << " p3 = " << -ylmcoef[4]*x*grly[2][0] << " p4 = " - //<< -ylmcoef[4]*rly[2] << std::endl; - - grly[7][1] = ylmcoef[5] * grly[4][1] - - ylmcoef[6] * (rly[0] * ty + grly[0][1] * radius2) - - tmp2 * grly[2][1]; - grly[7][2] = ylmcoef[5] * grly[4][2] - - ylmcoef[6] * (rly[0] * tz + grly[0][2] * radius2) - - tmp2 * grly[2][2]; - - rly[8] = -tmp2 * rly[3]; - grly[8][0] = -ylmcoef[4] * (rly[3] + x * grly[3][0]); - grly[8][1] = -tmp2 * grly[3][1]; - grly[8][2] = -tmp2 * grly[3][2]; - // rly[8] = tmp1+tmp2*rly[3];//l=2,m=-2 - if (Lmax == 2) - return; - - /*************************** - L = 3 - ***************************/ - rly[9] - = ylmcoef[7] * z * rly[4] - ylmcoef[8] * rly[1] * radius2; // l=3, m=0 - grly[9][0] = ylmcoef[7] * z * grly[4][0] - - ylmcoef[8] * (rly[1] * tx + grly[1][0] * radius2); - grly[9][1] = ylmcoef[7] * z * grly[4][1] - - ylmcoef[8] * (rly[1] * ty + grly[1][1] * radius2); - grly[9][2] = ylmcoef[7] * (rly[4] + z * grly[4][2]) - - ylmcoef[8] * (rly[1] * tz + grly[1][2] * radius2); - - double tmp3 = ylmcoef[9] * z; - rly[10] = tmp3 * rly[5] - ylmcoef[10] * rly[2] * radius2; // l=3,m=1 - grly[10][0] = tmp3 * grly[5][0] - - ylmcoef[10] * (grly[2][0] * radius2 + rly[2] * tx); - grly[10][1] = tmp3 * grly[5][1] - - ylmcoef[10] * (grly[2][1] * radius2 + rly[2] * ty); - grly[10][2] = ylmcoef[9] * (z * grly[5][2] + rly[5]) - - ylmcoef[10] * (grly[2][2] * radius2 + rly[2] * tz); - - rly[11] = tmp3 * rly[6] - ylmcoef[10] * rly[3] * radius2; // l=3,m=-1 - grly[11][0] = tmp3 * grly[6][0] - - ylmcoef[10] * (grly[3][0] * radius2 + rly[3] * tx); - grly[11][1] = tmp3 * grly[6][1] - - ylmcoef[10] * (grly[3][1] * radius2 + rly[3] * ty); - grly[11][2] = ylmcoef[9] * (z * grly[6][2] + rly[6]) - - ylmcoef[10] * (grly[3][2] * radius2 + rly[3] * tz); - - double tmp4 = ylmcoef[11] * z; - rly[12] = tmp4 * rly[7]; // l=3,m=2 - grly[12][0] = tmp4 * grly[7][0]; - grly[12][1] = tmp4 * grly[7][1]; - grly[12][2] = ylmcoef[11] * (z * grly[7][2] + rly[7]); - - rly[13] = tmp4 * rly[8]; // l=3,m=-2 - grly[13][0] = tmp4 * grly[8][0]; - grly[13][1] = tmp4 * grly[8][1]; - grly[13][2] = ylmcoef[11] * (z * grly[8][2] + rly[8]); - - double tmp5 = ylmcoef[14] * x; - rly[14] = ylmcoef[12] * rly[10] - ylmcoef[13] * rly[2] * radius2 - - tmp5 * rly[7]; // l=3,m=3 - grly[14][0] = ylmcoef[12] * grly[10][0] - - ylmcoef[13] * (rly[2] * tx + grly[2][0] * radius2) - - ylmcoef[14] * (rly[7] + x * grly[7][0]); - grly[14][1] = ylmcoef[12] * grly[10][1] - - ylmcoef[13] * (rly[2] * ty + grly[2][1] * radius2) - - tmp5 * grly[7][1]; - grly[14][2] = ylmcoef[12] * grly[10][2] - - ylmcoef[13] * (rly[2] * tz + grly[2][2] * radius2) - - tmp5 * grly[7][2]; - - rly[15] = ylmcoef[12] * rly[11] - ylmcoef[13] * rly[3] * radius2 - - tmp5 * rly[8]; // l=3,m=-3 - grly[15][0] = ylmcoef[12] * grly[11][0] - - ylmcoef[13] * (rly[3] * tx + grly[3][0] * radius2) - - ylmcoef[14] * (rly[8] + x * grly[8][0]); - grly[15][1] = ylmcoef[12] * grly[11][1] - - ylmcoef[13] * (rly[3] * ty + grly[3][1] * radius2) - - tmp5 * grly[8][1]; - grly[15][2] = ylmcoef[12] * grly[11][2] - - ylmcoef[13] * (rly[3] * tz + grly[3][2] * radius2) - - tmp5 * grly[8][2]; - if (Lmax == 3) - return; - - /*************************** - L = 4 - ***************************/ - rly[16] - = ylmcoef[15] * z * rly[9] - ylmcoef[16] * rly[4] * radius2; // l=4,m=0 - grly[16][0] = ylmcoef[15] * z * grly[9][0] - - ylmcoef[16] * (rly[4] * tx + grly[4][0] * radius2); - grly[16][1] = ylmcoef[15] * z * grly[9][1] - - ylmcoef[16] * (rly[4] * ty + grly[4][1] * radius2); - grly[16][2] = ylmcoef[15] * (z * grly[9][2] + rly[9]) - - ylmcoef[16] * (rly[4] * tz + grly[4][2] * radius2); - - double tmp6 = ylmcoef[17] * z; - rly[17] = tmp6 * rly[10] - ylmcoef[18] * rly[5] * radius2; // l=4,m=1 - grly[17][0] = tmp6 * grly[10][0] - - ylmcoef[18] * (rly[5] * tx + grly[5][0] * radius2); - grly[17][1] = tmp6 * grly[10][1] - - ylmcoef[18] * (rly[5] * ty + grly[5][1] * radius2); - grly[17][2] = ylmcoef[17] * (z * grly[10][2] + rly[10]) - - ylmcoef[18] * (rly[5] * tz + grly[5][2] * radius2); - - rly[18] = tmp6 * rly[11] - ylmcoef[18] * rly[6] * radius2; // l=4,m=-1 - grly[18][0] = tmp6 * grly[11][0] - - ylmcoef[18] * (rly[6] * tx + grly[6][0] * radius2); - grly[18][1] = tmp6 * grly[11][1] - - ylmcoef[18] * (rly[6] * ty + grly[6][1] * radius2); - grly[18][2] = ylmcoef[17] * (z * grly[11][2] + rly[11]) - - ylmcoef[18] * (rly[6] * tz + grly[6][2] * radius2); - - double tmp7 = ylmcoef[19] * z; - rly[19] = tmp7 * rly[12] - ylmcoef[20] * rly[7] * radius2; // l=4,m=2 - grly[19][0] = tmp7 * grly[12][0] - - ylmcoef[20] * (rly[7] * tx + grly[7][0] * radius2); - grly[19][1] = tmp7 * grly[12][1] - - ylmcoef[20] * (rly[7] * ty + grly[7][1] * radius2); - grly[19][2] = ylmcoef[19] * (z * grly[12][2] + rly[12]) - - ylmcoef[20] * (rly[7] * tz + grly[7][2] * radius2); - - rly[20] = tmp7 * rly[13] - ylmcoef[20] * rly[8] * radius2; // l=4,m=-2 - grly[20][0] = tmp7 * grly[13][0] - - ylmcoef[20] * (rly[8] * tx + grly[8][0] * radius2); - grly[20][1] = tmp7 * grly[13][1] - - ylmcoef[20] * (rly[8] * ty + grly[8][1] * radius2); - grly[20][2] = ylmcoef[19] * (z * grly[13][2] + rly[13]) - - ylmcoef[20] * (rly[8] * tz + grly[8][2] * radius2); - - double tmp8 = 3.0 * z; - rly[21] = tmp8 * rly[14]; // l=4,m=3 - grly[21][0] = tmp8 * grly[14][0]; - grly[21][1] = tmp8 * grly[14][1]; - grly[21][2] = 3.0 * (z * grly[14][2] + rly[14]); - - rly[22] = tmp8 * rly[15]; // l=4,m=-3 - grly[22][0] = tmp8 * grly[15][0]; - grly[22][1] = tmp8 * grly[15][1]; - grly[22][2] = 3.0 * (z * grly[15][2] + rly[15]); - - double tmp9 = ylmcoef[23] * x; - rly[23] = ylmcoef[21] * rly[19] - ylmcoef[22] * rly[7] * radius2 - - tmp9 * rly[14]; // l=4,m=4 - grly[23][0] = ylmcoef[21] * grly[19][0] - - ylmcoef[22] * (rly[7] * tx + grly[7][0] * radius2) - - ylmcoef[23] * (x * grly[14][0] + rly[14]); - grly[23][1] = ylmcoef[21] * grly[19][1] - - ylmcoef[22] * (rly[7] * ty + grly[7][1] * radius2) - - tmp9 * grly[14][1]; - grly[23][2] = ylmcoef[21] * grly[19][2] - - ylmcoef[22] * (rly[7] * tz + grly[7][2] * radius2) - - tmp9 * grly[14][2]; - - rly[24] = ylmcoef[21] * rly[20] - ylmcoef[22] * rly[8] * radius2 - - tmp9 * rly[15]; // l=4,m=-4 - grly[24][0] = ylmcoef[21] * grly[20][0] - - ylmcoef[22] * (rly[8] * tx + grly[8][0] * radius2) - - ylmcoef[23] * (x * grly[15][0] + rly[15]); - grly[24][1] = ylmcoef[21] * grly[20][1] - - ylmcoef[22] * (rly[8] * ty + grly[8][1] * radius2) - - tmp9 * grly[15][1]; - grly[24][2] = ylmcoef[21] * grly[20][2] - - ylmcoef[22] * (rly[8] * tz + grly[8][2] * radius2) - - tmp9 * grly[15][2]; - - if (Lmax == 4) - return; - - /*************************** - L = 5 - ***************************/ - rly[25] - = ylmcoef[24] * z * rly[16] - ylmcoef[25] * rly[9] * radius2; // l=5,m=0 - grly[25][0] = ylmcoef[24] * z * grly[16][0] - - ylmcoef[25] * (rly[9] * tx + grly[9][0] * radius2); - grly[25][1] = ylmcoef[24] * z * grly[16][1] - - ylmcoef[25] * (rly[9] * ty + grly[9][1] * radius2); - grly[25][2] = ylmcoef[24] * (z * grly[16][2] + rly[16]) - - ylmcoef[25] * (rly[9] * tz + grly[9][2] * radius2); - - double tmp10 = ylmcoef[26] * z; - rly[26] = tmp10 * rly[17] - ylmcoef[27] * rly[10] * radius2; // l=5,m=1 - grly[26][0] = tmp10 * grly[17][0] - - ylmcoef[27] * (rly[10] * tx + grly[10][0] * radius2); - grly[26][1] = tmp10 * grly[17][1] - - ylmcoef[27] * (rly[10] * ty + grly[10][1] * radius2); - grly[26][2] = ylmcoef[26] * (z * grly[17][2] + rly[17]) - - ylmcoef[27] * (rly[10] * tz + grly[10][2] * radius2); - - rly[27] = tmp10 * rly[18] - ylmcoef[27] * rly[11] * radius2; // l=5,m=-1 - grly[27][0] = tmp10 * grly[18][0] - - ylmcoef[27] * (rly[11] * tx + grly[11][0] * radius2); - grly[27][1] = tmp10 * grly[18][1] - - ylmcoef[27] * (rly[11] * ty + grly[11][1] * radius2); - grly[27][2] = ylmcoef[26] * (z * grly[18][2] + rly[18]) - - ylmcoef[27] * (rly[11] * tz + grly[11][2] * radius2); - - double tmp11 = ylmcoef[28] * z; - rly[28] = tmp11 * rly[19] - ylmcoef[29] * rly[12] * radius2; // l=5,m=2 - grly[28][0] = tmp11 * grly[19][0] - - ylmcoef[29] * (rly[12] * tx + grly[12][0] * radius2); - grly[28][1] = tmp11 * grly[19][1] - - ylmcoef[29] * (rly[12] * ty + grly[12][1] * radius2); - grly[28][2] = ylmcoef[28] * (z * grly[19][2] + rly[19]) - - ylmcoef[29] * (rly[12] * tz + grly[12][2] * radius2); - - rly[29] = tmp11 * rly[20] - ylmcoef[29] * rly[13] * radius2; // l=5,m=-2 - grly[29][0] = tmp11 * grly[20][0] - - ylmcoef[29] * (rly[13] * tx + grly[13][0] * radius2); - grly[29][1] = tmp11 * grly[20][1] - - ylmcoef[29] * (rly[13] * ty + grly[13][1] * radius2); - grly[29][2] = ylmcoef[28] * (z * grly[20][2] + rly[20]) - - ylmcoef[29] * (rly[13] * tz + grly[13][2] * radius2); - - double tmp12 = ylmcoef[30] * z; - rly[30] = tmp12 * rly[21] - ylmcoef[31] * rly[14] * radius2; // l=5,m=3 - grly[30][0] = tmp12 * grly[21][0] - - ylmcoef[31] * (grly[14][0] * radius2 + rly[14] * tx); - grly[30][1] = tmp12 * grly[21][1] - - ylmcoef[31] * (grly[14][1] * radius2 + rly[14] * ty); - grly[30][2] = ylmcoef[30] * (z * grly[21][2] + rly[21]) - - ylmcoef[31] * (grly[14][2] * radius2 + rly[14] * tz); - - rly[31] = tmp12 * rly[22] - ylmcoef[31] * rly[15] * radius2; // l=5,m=-3 - grly[31][0] = tmp12 * grly[22][0] - - ylmcoef[31] * (grly[15][0] * radius2 + rly[15] * tx); - grly[31][1] = tmp12 * grly[22][1] - - ylmcoef[31] * (grly[15][1] * radius2 + rly[15] * ty); - grly[31][2] = ylmcoef[30] * (z * grly[22][2] + rly[22]) - - ylmcoef[31] * (grly[15][2] * radius2 + rly[15] * tz); - - double tmp13 = ylmcoef[32] * z; - rly[32] = tmp13 * rly[23]; // l=5,m=4 - grly[32][0] = tmp13 * grly[23][0]; - grly[32][1] = tmp13 * grly[23][1]; - grly[32][2] = ylmcoef[32] * (rly[23] + z * grly[23][2]); - - rly[33] = tmp13 * rly[24]; // l=5,m=-4 - grly[33][0] = tmp13 * grly[24][0]; - grly[33][1] = tmp13 * grly[24][1]; - grly[33][2] = ylmcoef[32] * (rly[24] + z * grly[24][2]); - - double tmp14 = ylmcoef[35] * x; - rly[34] = ylmcoef[33] * rly[30] - ylmcoef[34] * rly[14] * radius2 - - tmp14 * rly[23]; // l=5,m=5 - grly[34][0] = ylmcoef[33] * grly[30][0] - - ylmcoef[34] * (rly[14] * tx + grly[14][0] * radius2) - - ylmcoef[35] * (x * grly[23][0] + rly[23]); - grly[34][1] = ylmcoef[33] * grly[30][1] - - ylmcoef[34] * (rly[14] * ty + grly[14][1] * radius2) - - tmp14 * grly[23][1]; - grly[34][2] = ylmcoef[33] * grly[30][2] - - ylmcoef[34] * (rly[14] * tz + grly[14][2] * radius2) - - tmp14 * grly[23][2]; - - rly[35] = ylmcoef[33] * rly[31] - ylmcoef[34] * rly[15] * radius2 - - tmp14 * rly[24]; // l=5,m=-5 - grly[35][0] = ylmcoef[33] * grly[31][0] - - ylmcoef[34] * (rly[15] * tx + grly[15][0] * radius2) - - ylmcoef[35] * (x * grly[24][0] + rly[24]); - grly[35][1] = ylmcoef[33] * grly[31][1] - - ylmcoef[34] * (rly[15] * ty + grly[15][1] * radius2) - - tmp14 * grly[24][1]; - grly[35][2] = ylmcoef[33] * grly[31][2] - - ylmcoef[34] * (rly[15] * tz + grly[15][2] * radius2) - - tmp14 * grly[24][2]; - - if (Lmax == 5) - return; - - // if Lmax > 5 - for (int il = 6; il <= Lmax; il++) - { - int istart = il * il; - int istart1 = (il - 1) * (il - 1); - int istart2 = (il - 2) * (il - 2); - - double fac2 = sqrt(4.0 * istart - 1.0); - double fac4 = sqrt(4.0 * istart1 - 1.0); - - for (int im = 0; im < 2 * il - 1; im++) - { - int imm = (im + 1) / 2; - // if (im % 2 == 0) imm *= -1; - - double var1 = fac2 / sqrt((double)istart - imm * imm); - double var2 = sqrt((double)istart1 - imm * imm) / fac4; - - rly[istart + im] = var1 - * (z * rly[istart1 + im] - - var2 * rly[istart2 + im] * radius2); - - grly[istart + im][0] - = var1 - * (z * grly[istart1 + im][0] - - var2 - * (rly[istart2 + im] * tx - + grly[istart2 + im][0] * radius2)); - grly[istart + im][1] - = var1 - * (z * grly[istart1 + im][1] - - var2 - * (rly[istart2 + im] * ty - + grly[istart2 + im][1] * radius2)); - grly[istart + im][2] - = var1 - * (z * grly[istart1 + im][2] + rly[istart1 + im] - - var2 - * (rly[istart2 + im] * tz - + grly[istart2 + im][2] * radius2)); - } - - double bl1 = sqrt(2.0 * il / (2.0 * il + 1.0)); - double bl2 = sqrt((2.0 * il - 2.0) / (2.0 * il - 1.0)); - double bl3 = sqrt(2.0) / fac2; - - int id1 = istart + 2 * il - 1; - int id2 = istart + 2 * il - 5; - int id3 = istart2 + 2 * il - 5; - int id4 = istart1 + 2 * il - 3; - - rly[id1] - = (bl3 * rly[id2] - bl2 * rly[id3] * radius2 - 2.0 * x * rly[id4]) - / bl1; - grly[id1][0] = (bl3 * grly[id2][0] - - bl2 * (grly[id3][0] * radius2 + rly[id3] * tx) - - 2.0 * (rly[id4] + x * grly[id4][0])) - / bl1; - grly[id1][1] = (bl3 * grly[id2][1] - - bl2 * (grly[id3][1] * radius2 + rly[id3] * ty) - - 2.0 * x * grly[id4][1]) - / bl1; - grly[id1][2] = (bl3 * grly[id2][2] - - bl2 * (grly[id3][2] * radius2 + rly[id3] * tz) - - 2.0 * x * grly[id4][2]) - / bl1; - - rly[id1 + 1] = (bl3 * rly[id2 + 1] - bl2 * rly[id3 + 1] * radius2 - - 2.0 * x * rly[id4 + 1]) - / bl1; - grly[id1 + 1][0] - = (bl3 * grly[id2 + 1][0] - - bl2 * (grly[id3 + 1][0] * radius2 + rly[id3 + 1] * tx) - - 2.0 * (rly[id4 + 1] + x * grly[id4 + 1][0])) - / bl1; - grly[id1 + 1][1] - = (bl3 * grly[id2 + 1][1] - - bl2 * (grly[id3 + 1][1] * radius2 + rly[id3 + 1] * ty) - - 2.0 * x * grly[id4 + 1][1]) - / bl1; - grly[id1 + 1][2] - = (bl3 * grly[id2 + 1][2] - - bl2 * (grly[id3 + 1][2] * radius2 + rly[id3 + 1] * tz) - - 2.0 * x * grly[id4 + 1][2]) - / bl1; - } - - return; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/test/test_sph.cu b/source/module_hamilt_lcao/module_gint/test/test_sph.cu deleted file mode 100644 index 58b0a6c329..0000000000 --- a/source/module_hamilt_lcao/module_gint/test/test_sph.cu +++ /dev/null @@ -1,139 +0,0 @@ -#include -#include "../kernels/cuda/sph.cuh" - -#include "float.h" -#include "cuda_runtime.h" -#include "device_functions.h" -#include "device_launch_parameters.h" -#include "gtest/gtest.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "test_sph.h" -#include "source_base/array_pool.h" -using namespace std; - -class gintTest : public ::testing::Test -{ - public: -}; - -__global__ void cuda_test(double* dr, int nwl, double* ylma_g, double* ylmcoef) -{ - double ylma[49] = {0.0}; - GintKernel::spherical_harmonics(dr, nwl, ylma, ylmcoef); - for (int i = 0; i < 49; i++) - { - ylma_g[i] = ylma[i]; - } -} -__global__ void cuda_test2(double* dr, double distance, int nwl, double* dylma_g, double* ylmcoef) -{ - double ylma[49] = {0.0}; - double grly[49][3] = {0.0}; - GintKernel::spherical_harmonics_d(dr, distance, grly, nwl, ylma, ylmcoef); - for (int i = 0; i < 49; i++) - { - dylma_g[i] = ylma[i]; - } -} - -void get_random_double(int min, int max, double* result, int length) -{ - std::random_device rd; - std::default_random_engine eng(rd()); - std::uniform_real_distribution distribution(0, 10); - for (int i = 0; i < 3; i++) - { - result[i] = distribution(eng); - } -} -void get_random_int(int min, int max, int& result) -{ - std::random_device rd; - std::default_random_engine eng(rd()); - std::uniform_int_distribution distribution(min, max); - result = distribution(eng); -} -// __global__ void cuda_test -TEST_F(gintTest, test) -{ - int nwl; - double distance; - - double* dr = new double[3]; - double* dr_g; - - double ylma[49]; - double dylma[49]; - double ylma_ans[49]; - - double* ylmcoef_g; - double* ylma_g; - double* dylma_g; - double* ylmcoef = new double[100]; - - std::vector ylma_cpu(49, 0.0); - std::vector ylma_cpu_dpsir(49, 0.0); - ModuleBase::Array_Pool ylma_cpu_ddpsir(49, 3); - - nwl=3; - for (int i=0;i<3;i++){ - dr[i]=i*1.0; - distance += dr[i] * dr[i]; - } - for (int i=0;i<100;i++) - { - ylmcoef[i]=i*0.1; - } - - cudaMalloc((void**)&ylmcoef_g, 100 * sizeof(double)); - cudaMalloc((void**)&dr_g, 3 * sizeof(double)); - cudaMalloc((void**)&ylma_g, 49 * sizeof(double)); - cudaMalloc((void**)&dylma_g, 49 * 3 * sizeof(double)); - - cudaMemcpy(ylmcoef_g, ylmcoef, 100 * sizeof(double), cudaMemcpyHostToDevice); - cudaMemcpy(dr_g, dr, 3 * sizeof(double), cudaMemcpyHostToDevice); - cudaMemset(ylma_g, 0, 49 * sizeof(double)); - cudaMemset(dylma_g, 0, 49 * sizeof(double)); - - cuda_test<<<1, 1>>>(dr_g, nwl, ylma_g, ylmcoef_g); - cuda_test2<<<1, 1>>>(dr_g, distance, nwl, dylma_g, ylmcoef_g); - sph_harm(nwl, dr[0], dr[1], dr[2], ylma_cpu, ylmcoef); - grad_rl_sph_harm(nwl, dr[0], dr[1], dr[2], ylma_cpu_dpsir.data(), ylma_cpu_ddpsir.get_ptr_2D(), ylmcoef); - cudaMemcpy(ylma, ylma_g, 49 * sizeof(double), cudaMemcpyDeviceToHost); - cudaMemcpy(dylma, dylma_g, 49 * sizeof(double), cudaMemcpyDeviceToHost); - cudaDeviceReset(); - - for (int i = 0; i < 49; i++) - { - ylma_ans[i] = ylma_cpu[i]; - if ((abs(ylma[i])!= 0) && (ylma_ans[i]==ylma_ans[i]) && (ylma[i]==ylma[i])) - { - EXPECT_LT(abs(ylma_ans[i] - ylma[i]) / abs(ylma[i]), 1e-15); - } - ylma_ans[i] = ylma_cpu_dpsir[i]; - if ((abs(dylma[i]) != 0) &&(ylma_ans[i]==ylma_ans[i]) && (dylma[i]==dylma[i])) - { - EXPECT_LT(abs(ylma_ans[i] - dylma[i]) / abs(dylma[i]), 1e-15); - } - } - delete[] dr; - delete[] ylmcoef; - -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); -#endif - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_gint/test/test_sph.h b/source/module_hamilt_lcao/module_gint/test/test_sph.h deleted file mode 100644 index 141e917200..0000000000 --- a/source/module_hamilt_lcao/module_gint/test/test_sph.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef TEST_SPH_H -#define TEST_SPH_H -#include -// using namespace std; -void sph_harm(const int& Lmax, - const double& xdr, - const double& ydr, - const double& zdr, - std::vector& rly, - double* ylmcoef); - -void grad_rl_sph_harm(const int& Lmax, // max momentum of L - const double& x, - const double& y, - const double& z, - double* rly, - double** grly, - const double* ylmcoef); -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/CMakeLists.txt b/source/module_hamilt_lcao/module_hcontainer/CMakeLists.txt deleted file mode 100644 index 65db746a84..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -if(ENABLE_LCAO) - -list(APPEND objects - base_matrix.cpp - atom_pair.cpp - hcontainer.cpp - output_hcontainer.cpp - func_folding.cpp - transfer.cpp - func_transfer.cpp -) - -add_library( - hcontainer - OBJECT - ${objects} -) - -if(ENABLE_COVERAGE) - add_coverage(hcontainer) -endif() - -IF (BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() -endif() - -endif() \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/atom_pair.cpp b/source/module_hamilt_lcao/module_hcontainer/atom_pair.cpp deleted file mode 100644 index b66bad470d..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/atom_pair.cpp +++ /dev/null @@ -1,873 +0,0 @@ -#include "atom_pair.h" -#include -#include -#include "source_base/blas_connector.h" - -namespace hamilt -{ - -//---------------------------------------------------- -// atom pair class -//---------------------------------------------------- - -// destructor -template -AtomPair::~AtomPair() -{ - this->values.clear(); -} - -template -AtomPair::AtomPair(const int& atom_i_, const int& atom_j_, const Parallel_Orbitals* paraV_, T* existed_matrix) - : atom_i(atom_i_), atom_j(atom_j_), paraV(paraV_) -{ - assert(this->paraV != nullptr); - this->row_ap = this->paraV->atom_begin_row[atom_i]; - this->col_ap = this->paraV->atom_begin_col[atom_j]; - if (this->row_ap == -1 || this->col_ap == -1) - { - throw std::string("Atom-pair not belong this process"); - } - this->row_size = this->paraV->get_row_size(atom_i); - this->col_size = this->paraV->get_col_size(atom_j); - this->R_index.resize(0); - this->R_index.push_back(ModuleBase::Vector3(0, 0, 0)); - this->current_R = 0; - if (existed_matrix != nullptr) - { - BaseMatrix tmp(row_size, col_size, existed_matrix); - this->values.push_back(tmp); - } - else - { - BaseMatrix tmp(row_size, col_size); - this->values.push_back(tmp); - } -} - -template -AtomPair::AtomPair(const int& atom_i_, - const int& atom_j_, - const int& rx, - const int& ry, - const int& rz, - const Parallel_Orbitals* paraV_, - T* existed_matrix) - : atom_i(atom_i_), atom_j(atom_j_), paraV(paraV_) -{ - assert(this->paraV != nullptr); - this->row_ap = this->paraV->atom_begin_row[atom_i]; - this->col_ap = this->paraV->atom_begin_col[atom_j]; - if (this->row_ap == -1 || this->col_ap == -1) - { - throw std::string("Atom-pair not belong this process"); - } - this->row_size = this->paraV->get_row_size(atom_i); - this->col_size = this->paraV->get_col_size(atom_j); - this->R_index.resize(0); - this->R_index.push_back(ModuleBase::Vector3(rx, ry, rz)); - this->current_R = 0; - if (existed_matrix != nullptr) - { - BaseMatrix tmp(row_size, col_size, existed_matrix); - this->values.push_back(tmp); - } - else - { - BaseMatrix tmp(row_size, col_size); - this->values.push_back(tmp); - } -} - -template -AtomPair::AtomPair(const int& atom_i_, - const int& atom_j_, - const ModuleBase::Vector3 &R_index, - const Parallel_Orbitals* paraV_, - T* existed_matrix) - : atom_i(atom_i_), atom_j(atom_j_), paraV(paraV_) -{ - assert(this->paraV != nullptr); - this->row_ap = this->paraV->atom_begin_row[atom_i]; - this->col_ap = this->paraV->atom_begin_col[atom_j]; - if (this->row_ap == -1 || this->col_ap == -1) - { - throw std::string("Atom-pair not belong this process"); - } - this->row_size = this->paraV->get_row_size(atom_i); - this->col_size = this->paraV->get_col_size(atom_j); - this->R_index.resize(0); - this->R_index.push_back(ModuleBase::Vector3(R_index)); - this->current_R = 0; - if (existed_matrix != nullptr) - { - BaseMatrix tmp(row_size, col_size, existed_matrix); - this->values.push_back(tmp); - } - else - { - BaseMatrix tmp(row_size, col_size); - this->values.push_back(tmp); - } -} - -// direct save whole matrix of atom-pair -template -AtomPair::AtomPair(const int& atom_i_, - const int& atom_j_, - const int* row_atom_begin, - const int* col_atom_begin, - const int& natom, - T* existed_matrix) - : atom_i(atom_i_), atom_j(atom_j_) -{ - assert(row_atom_begin != nullptr && col_atom_begin != nullptr); - this->row_ap = row_atom_begin[atom_i]; - this->col_ap = col_atom_begin[atom_j]; - this->row_size = row_atom_begin[atom_i + 1] - row_atom_begin[atom_i]; - this->col_size = col_atom_begin[atom_j + 1] - col_atom_begin[atom_j]; - this->R_index.resize(0); - this->R_index.push_back(ModuleBase::Vector3(0, 0, 0)); - this->current_R = 0; - if (existed_matrix != nullptr) - { - BaseMatrix tmp(row_size, col_size, existed_matrix); - this->values.push_back(tmp); - } - else - { - BaseMatrix tmp(row_size, col_size); - this->values.push_back(tmp); - } -} -// -template -AtomPair::AtomPair(const int& atom_i_, - const int& atom_j_, - const int& rx, - const int& ry, - const int& rz, - const int* row_atom_begin, - const int* col_atom_begin, - const int& natom, - T* existed_matrix) - : atom_i(atom_i_), atom_j(atom_j_) -{ - assert(row_atom_begin != nullptr && col_atom_begin != nullptr); - this->row_ap = row_atom_begin[atom_i]; - this->col_ap = col_atom_begin[atom_j]; - this->row_size = row_atom_begin[atom_i + 1] - row_atom_begin[atom_i]; - this->col_size = col_atom_begin[atom_j + 1] - col_atom_begin[atom_j]; - this->R_index.resize(0); - this->R_index.push_back(ModuleBase::Vector3(rx, ry, rz)); - this->current_R = 0; - if (existed_matrix != nullptr) - { - BaseMatrix tmp(row_size, col_size, existed_matrix); - this->values.push_back(tmp); - } - else - { - BaseMatrix tmp(row_size, col_size); - this->values.push_back(tmp); - } -} - -template -AtomPair::AtomPair(const int& atom_i_, const int& atom_j_) : atom_i(atom_i_), atom_j(atom_j_) -{ -} - -// copy constructor -template -AtomPair::AtomPair(const AtomPair& other, T* data_pointer) - : R_index(other.R_index), - paraV(other.paraV), - current_R(other.current_R), - atom_i(other.atom_i), - atom_j(other.atom_j), - row_ap(other.row_ap), - col_ap(other.col_ap), - row_size(other.row_size), - col_size(other.col_size) -{ - if(data_pointer == nullptr) - { - this->values = other.values; - } - else - { - this->values.reserve(other.values.size()); - for(int value=0;value tmp(row_size, col_size, data_pointer); - this->values.push_back(tmp); - data_pointer += this->get_size(); - } - } -} - -//allocate -template -void AtomPair::allocate(T* data_array, bool is_zero) -{ - if(data_array == nullptr) - { - for(int value=0;valuevalues.size();++value) - { - this->values[value].allocate(nullptr, is_zero); - } - } - else - { - for(int value=0;valuevalues.size();++value) - { - this->values[value].allocate(data_array, is_zero); - data_array += this->get_size(); - } - } -} - -// set_zero -template -void AtomPair::set_zero() -{ - for(auto& value : values) - { - value.set_zero(); - } -} - -// The copy assignment operator -template -AtomPair& AtomPair::operator=(const AtomPair& other) -{ - if (this != &other) - { - R_index = other.R_index; - values = other.values; - paraV = other.paraV; - current_R = other.current_R; - atom_i = other.atom_i; - atom_j = other.atom_j; - row_ap = other.row_ap; - col_ap = other.col_ap; - row_size = other.row_size; - col_size = other.col_size; - } - return *this; -} - -// move constructor -template -AtomPair::AtomPair(AtomPair&& other) noexcept - : R_index(std::move(other.R_index)), - values(std::move(other.values)), - paraV(other.paraV), - current_R(other.current_R), - atom_i(other.atom_i), - atom_j(other.atom_j), - row_ap(other.row_ap), - col_ap(other.col_ap), - row_size(other.row_size), - col_size(other.col_size) -{ - other.paraV = nullptr; -} - -// move assignment operator -template -AtomPair& AtomPair::operator=(AtomPair&& other) noexcept -{ - if (this != &other) - { - R_index = std::move(other.R_index); - values = std::move(other.values); - paraV = other.paraV; - other.paraV = nullptr; - current_R = other.current_R; - atom_i = other.atom_i; - atom_j = other.atom_j; - row_ap = other.row_ap; - col_ap = other.col_ap; - row_size = other.row_size; - col_size = other.col_size; - } - return *this; -} - -template -bool AtomPair::operator<(const AtomPair& other) const -{ - if (atom_i < other.atom_i) - { - return true; - } - else if (atom_i == other.atom_i) - { - return atom_j < other.atom_j; - } - else - { - return false; - } -} - -// get col_size -template -int AtomPair::get_col_size() const -{ - return this->col_size; -} - -// get row_size -template -int AtomPair::get_row_size() const -{ - return this->row_size; -} - -// get atom_i -template -int AtomPair::get_atom_i() const -{ - return this->atom_i; -} - -// get atom_j -template -int AtomPair::get_atom_j() const -{ - return this->atom_j; -} - -// set size -template -void AtomPair::set_size(const int& col_size_in, const int& row_size_in) -{ - this->col_size = col_size_in; - this->row_size = row_size_in; - for (int i = 0; i < this->values.size(); i++) - { - this->values[i].set_size(row_size_in, col_size_in); - } -} - -// get paraV for check -template -const Parallel_Orbitals* AtomPair::get_paraV() const -{ - return this->paraV; -} - -// identify -template -bool AtomPair::identify(const AtomPair& other) const -{ - if (this->atom_i == other.atom_i && this->atom_j == other.atom_j) - { - return true; - } - else - { - return false; - } -} - -// identify -template -bool AtomPair::identify(const int& atom_i_, const int& atom_j_) const -{ - if (this->atom_i == atom_i_ && this->atom_j == atom_j_) - { - return true; - } - else - { - return false; - } -} - -// get_HR_values for no-const AtomPair -template -BaseMatrix& AtomPair::get_HR_values(int rx_in, int ry_in, int rz_in) -{ - // find existed R index - const int r_index = this->find_R(rx_in, ry_in, rz_in); - if (r_index != -1) - { - // if found, return this->values[current_R] - return this->values[r_index]; - } - // if not found, add a new BaseMatrix for this R index - R_index.push_back(ModuleBase::Vector3(rx_in, ry_in, rz_in)); - values.push_back(BaseMatrix(this->row_size, this->col_size)); - values.back().allocate(nullptr, true); - // return the last BaseMatrix reference in values - return this->values.back(); -} - -// get_HR_values for const AtomPair -template -const BaseMatrix& AtomPair::get_HR_values(int rx_in, int ry_in, int rz_in) const -{ - // if current_R is -1, R index has not been fixed, find existed R index - const int r_index = this->find_R(rx_in, ry_in, rz_in); - if (r_index != -1) - { - // if found, return this->values[current_R] - return this->values[r_index]; - } - // if not found, throw a error message - else - { - throw std::string("AtomPair::get_HR_values: R index not found"); - } -} - -// get_HR_values with index -template -BaseMatrix& AtomPair::get_HR_values(const int& index) const -{ - if (index >= this->values.size()) - { - throw std::string("AtomPair::get_HR_values: index out of range"); - } - return const_cast&>(this->values[index]); -} - -// find_R -template -int AtomPair::find_R(const int& rx_in, const int& ry_in, const int& rz_in) const -{ - for (int i = 0; i < this->R_index.size(); i++) - { - if (R_index[i].x == rx_in && R_index[i].y == ry_in && R_index[i].z == rz_in) - { - this->current_R = i; - return i; - } - } - return (-1); -} - -// find_R -template -int AtomPair::find_R(const ModuleBase::Vector3& R_in) const -{ - for (int i = 0; i < this->R_index.size(); i++) - { - if (R_index[i] == R_in) - { - this->current_R = i; - return i; - } - } - return (-1); -} - -// find_matrix -template -const BaseMatrix* AtomPair::find_matrix(const int& rx_in, const int& ry_in, const int& rz_in) const -{ - const int r_index = this->find_R(rx_in, ry_in, rz_in); - if(r_index == -1) - { - return nullptr; - } - else - { - return &(this->values[r_index]); - } -} - -// find_matrix -template -BaseMatrix* AtomPair::find_matrix(const int& rx_in, const int& ry_in, const int& rz_in) -{ - const int r_index = this->find_R(rx_in, ry_in, rz_in); - if(r_index == -1) - { - return nullptr; - } - else - { - return &(this->values[r_index]); - } -} - -// find_matrix -template -const BaseMatrix* AtomPair::find_matrix(const ModuleBase::Vector3& R_in) const { - const int r_index = this->find_R(R_in); - if(r_index == -1) - { - return nullptr; - } - else - { - return &(this->values[r_index]); - } -} - -template -BaseMatrix* AtomPair::find_matrix(const ModuleBase::Vector3& R_in){ - const int r_index = this->find_R(R_in); - if(r_index == -1) - { - return nullptr; - } - else - { - return &(this->values[r_index]); - } -} - -template -void AtomPair::convert_add(const BaseMatrix& target, int rx_in, int ry_in, int rz_in) -{ - BaseMatrix& matrix = this->get_HR_values(rx_in, ry_in, rz_in); - // memory type is 2d-block - // for 2d-block memory type, the data of input matrix is expected storing in a linear array - // so we can use pointer to access data, and will be separate to 2d-block in this function - matrix.add_array(target.get_pointer()); -} - -// function merge -template -void AtomPair::merge(const AtomPair& other, bool skip_R) -{ - if (other.atom_i != atom_i || other.atom_j != atom_j) - { - throw std::string("AtomPair::merge: atom pair not match"); - } - int rx = 0, ry = 0, rz = 0; - for (int i = 0; i < other.R_index.size(); i ++) - { - if (!skip_R) - { - rx = other.R_index[i].x; - ry = other.R_index[i].y; - rz = other.R_index[i].z; - } - const BaseMatrix& matrix_tmp = other.get_HR_values(i); - //if not found, push_back this BaseMatrix to this->values - if (this->find_R(rx, ry, rz) == -1) - { - this->R_index.push_back(ModuleBase::Vector3(rx, ry, rz)); - this->values.push_back(matrix_tmp); - } - //if found but not allocated, skip this BaseMatrix values - else if (this->values[current_R].get_pointer() == nullptr || matrix_tmp.get_pointer() == nullptr) - { - continue; - } - // if found and allocated, add data - else - { - this->values[current_R].add_array(matrix_tmp.get_pointer()); - } - } -} - -// merge_to_gamma -template -void AtomPair::merge_to_gamma() -{ - // reset R_index to (0, 0, 0) - this->R_index.clear(); - this->R_index.resize(0); - this->R_index.push_back(ModuleBase::Vector3(0, 0, 0)); - // merge all values to first BaseMatrix - BaseMatrix tmp(this->row_size, this->col_size); - bool empty = true; - for (int i = 0; i < this->values.size(); i++) - { - if(this->values[i].get_pointer() != nullptr) - { - if(empty) - { - tmp.allocate(nullptr, true); - empty = false; - } - tmp.add_array(this->values[i].get_pointer()); - } - } - this->values.clear(); - this->values.push_back(tmp); - - this->current_R = 0; -} - -template -void AtomPair::add_to_matrix(std::complex* hk, - const int ld_hk, - const std::complex& kphase, - const int hk_type) const -{ - const BaseMatrix& matrix = values[current_R]; - T* hr_tmp = matrix.get_pointer(); - std::complex* hk_tmp = hk; - T* hk_real_pointer = nullptr; - T* hk_imag_pointer = nullptr; - const int ld_hk_2 = ld_hk * 2; - // row major - if (hk_type == 0) - { - hk_tmp += this->row_ap * ld_hk + this->col_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - hk_real_pointer = (T*)hk_tmp; - hk_imag_pointer = hk_real_pointer+1; - BlasConnector::axpy(this->col_size, kphase.real(), hr_tmp, 1, hk_real_pointer, 2); - BlasConnector::axpy(this->col_size, kphase.imag(), hr_tmp, 1, hk_imag_pointer, 2); - hk_tmp += ld_hk; - hr_tmp += this->col_size; - } - } - // column major - else if (hk_type == 1) - { - hk_tmp += this->col_ap * ld_hk + this->row_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - hk_real_pointer = (T*)hk_tmp; - hk_imag_pointer = hk_real_pointer+1; - BlasConnector::axpy(this->col_size, kphase.real(), hr_tmp, 1, hk_real_pointer, ld_hk_2); - BlasConnector::axpy(this->col_size, kphase.imag(), hr_tmp, 1, hk_imag_pointer, ld_hk_2); - hk_tmp ++; - hr_tmp += this->col_size; - } - } -} - -// add_to_matrix -template -void AtomPair::add_to_matrix(T* hk, const int ld_hk, const T& kphase, const int hk_type) const -{ - const BaseMatrix& matrix = values[current_R]; - T* hr_tmp = matrix.get_pointer(); - T* hk_tmp = hk; - // row major - if (hk_type == 0) - { - hk_tmp += this->row_ap * ld_hk + this->col_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - BlasConnector::axpy(this->col_size, kphase, hr_tmp, 1, hk_tmp, 1); - /*for (int nu = 0; nu < this->col_size; nu++) - { - hk_tmp[nu] += matrix.get_value(mu, nu) * kphase; - }*/ - hk_tmp += ld_hk; - hr_tmp += this->col_size; - } - } - // column major - else if (hk_type == 1) - { - hk_tmp += this->col_ap * ld_hk + this->row_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - BlasConnector::axpy(this->col_size, kphase, hr_tmp, 1, hk_tmp, ld_hk); - /*for (int mu = 0; mu < this->row_size; mu++) - { - hk_tmp[mu] += matrix.get_value(mu, nu) * kphase; - }*/ - ++hk_tmp; - hr_tmp += this->col_size; - } - } -} - -template -void AtomPair::add_from_matrix(const std::complex* hk, - const int ld_hk, - const std::complex& kphase, - const int hk_type) -{ - const BaseMatrix& matrix = values[current_R]; - T* hr_tmp = matrix.get_pointer(); - const std::complex* hk_tmp = hk; - const T* hk_real_pointer = nullptr; - const T* hk_imag_pointer = nullptr; - const int ld_hk_2 = ld_hk * 2; - // row major - if (hk_type == 0) - { - hk_tmp += this->row_ap * ld_hk + this->col_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - hk_real_pointer = (T*)hk_tmp; - hk_imag_pointer = hk_real_pointer+1; - BlasConnector::axpy(this->col_size, kphase.real(), hk_real_pointer, 2, hr_tmp, 1); - BlasConnector::axpy(this->col_size, -kphase.imag(), hk_imag_pointer, 2, hr_tmp, 1); - hk_tmp += ld_hk; - hr_tmp += this->col_size; - } - } - // column major - else if (hk_type == 1) - { - hk_tmp += this->col_ap * ld_hk + this->row_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - hk_real_pointer = (T*)hk_tmp; - hk_imag_pointer = hk_real_pointer+1; - BlasConnector::axpy(this->col_size, kphase.real(), hk_real_pointer, ld_hk_2, hr_tmp, 1); - BlasConnector::axpy(this->col_size, -kphase.imag(), hk_imag_pointer, ld_hk_2, hr_tmp, 1); - hk_tmp ++; - hr_tmp += this->col_size; - } - } -} - -// add_to_matrix -template -void AtomPair::add_from_matrix(const T* hk, const int ld_hk, const T& kphase, const int hk_type) -{ - const BaseMatrix& matrix = values[current_R]; - T* hr_tmp = matrix.get_pointer(); - const T* hk_tmp = hk; - // row major - if (hk_type == 0) - { - hk_tmp += this->row_ap * ld_hk + this->col_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - BlasConnector::axpy(this->col_size, kphase, hk_tmp, 1, hr_tmp, 1); - /*for (int nu = 0; nu < this->col_size; nu++) - { - hk_tmp[nu] += matrix.get_value(mu, nu) * kphase; - }*/ - hk_tmp += ld_hk; - hr_tmp += this->col_size; - } - } - // column major - else if (hk_type == 1) - { - hk_tmp += this->col_ap * ld_hk + this->row_ap; - for (int mu = 0; mu < this->row_size; mu++) - { - BlasConnector::axpy(this->col_size, kphase, hk_tmp, ld_hk, hr_tmp, 1); - /*for (int mu = 0; mu < this->row_size; mu++) - { - hk_tmp[mu] += matrix.get_value(mu, nu) * kphase; - }*/ - ++hk_tmp; - hr_tmp += this->col_size; - } - } -} - -// add_to_array -template -void AtomPair::add_to_array(T* array, const T& kphase) const -{ - const BaseMatrix& matrix = values[current_R]; - for (int i = 0; i < this->row_size * this->col_size; i++) - { - array[i] += matrix.get_pointer()[i] * kphase; - } -} - -// add_to_array -template -void AtomPair::add_to_array(std::complex* array, const std::complex& kphase) const -{ - const BaseMatrix& matrix = values[current_R]; - for (int i = 0; i < this->row_size * this->col_size; i++) - { - array[i] += matrix.get_pointer()[i] * kphase; - } -} - -template -std::tuple, T*> AtomPair::get_matrix_values(int ir) const -{ - if(ir<0) ir = this->current_R; - return std::tuple, T*>({this->row_ap, this->row_size, this->col_ap, this->col_size}, this->values[ir].get_pointer()); -} - -// interface for get (rx, ry, rz) of index-th R-index in this->R_index, the return should be ModuleBase::Vector3 -template -ModuleBase::Vector3 AtomPair::get_R_index(const int& index) const -{ - if (index >= R_index.size() || index < 0) - { - std::cout << "Error: index out of range in s" << std::endl; - return ModuleBase::Vector3(-1, -1, -1); - } - else - { - // return the ModuleBase::Vector3 of R_index[index] - return R_index[index]; - } -} - -template -ModuleBase::Vector3 AtomPair::get_R_index() const -{ - // return the ModuleBase::Vector3 of R_index[index] - return R_index[current_R]; -} - -// get_value -template -T& AtomPair::get_value(const int& i) const -{ -#ifdef __DEBUG - assert(i < this->row_size * this->col_size); - assert(i >= 0); - assert(current_R < this->values.size()); - assert(current_R >= 0); -#endif - return this->values[current_R].get_pointer()[i]; -} - -// get_value -template -T& AtomPair::get_value(const int& row, const int& col) const -{ -#ifdef __DEBUG - assert(row < this->row_size && row >= 0); - assert(col < this->col_size && col >= 0); - assert(current_R < this->values.size()); - assert(current_R >= 0); -#endif - return this->values[current_R].get_value(row, col); -} - -// get_pointer -template -T* AtomPair::get_pointer(int ir) const -{ - if(ir<0) - { - ir = current_R; - } -#ifdef __DEBUG - assert(current_R < this->values.size()); - assert(current_R >= 0); -#endif - return this->values[ir].get_pointer(); -} - -// get_memory_size -template -size_t AtomPair::get_memory_size() const -{ - size_t memory_size = sizeof(*this); - for (int i = 0; i < this->values.size(); i++) - { - memory_size += this->values[i].get_memory_size(); - } - return memory_size; -} - -// T of AtomPair can be double or complex -template class AtomPair; -template class AtomPair>; - -} // namespace hamilt diff --git a/source/module_hamilt_lcao/module_hcontainer/atom_pair.h b/source/module_hamilt_lcao/module_hcontainer/atom_pair.h deleted file mode 100644 index 9e8afa9fce..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/atom_pair.h +++ /dev/null @@ -1,332 +0,0 @@ -#ifndef ATOM_PAIR_H -#define ATOM_PAIR_H - -// #include "source_cell/atom_spec.h" -#include "base_matrix.h" -#include "source_base/vector3.h" -#include "source_basis/module_ao/parallel_orbitals.h" - -#include -#include -#include -#include - -namespace hamilt -{ -/** -Class: AtomPair - - the simplest way to use this class is: - { - AtomPair atom_pair(atom_i, atom_j); - atom_pair.set_size(row_size, col_size); - const int rx = 0, ry = 0, rz = 0; - auto tmp_matrix = atom_pair.get_HR_values(rx, ry, rz); - //1. save array to tmp_matrix - std::vector local_matrix_ij = ...; - tmp_matrix.add_array(local_matrix_ij.data()); - //2. get pointer of tmp_matrix and save array to it - T* tmp_matrix_pointer = tmp_matrix.get_pointer(); - for(int orb_i = 0;orb_i -class AtomPair -{ - public: - // Constructor of class AtomPair - // Only for 2d-block MPI parallel case - // This constructor used for initialize a atom-pair local Hamiltonian with only center cell - // which is used for constructing HK (k space Hamiltonian) objects, (gamma_only case) - AtomPair(const int& atom_i_, // atomic index of atom i, used to identify atom - const int& atom_j_, // atomic index of atom j, used to identify atom - const Parallel_Orbitals* paraV_, // information for 2d-block parallel - T* existed_matrix - = nullptr // if nullptr, new memory will be allocated, otherwise this class is a data wrapper - ); - // Constructor of class AtomPair - // Only for 2d-block MPI parallel case - // This constructor used for initialize a atom-pair local Hamiltonian with non-zero cell indexes, - // which is used for constructing HR (real space Hamiltonian) objects. - AtomPair(const int& atom_i_, // atomic index of atom i, used to identify atom - const int& atom_j_, // atomic index of atom j, used to identify atom - const int& rx, // x coordinate of cell - const int& ry, // y coordinate of cell - const int& rz, // z coordinate of cell - const Parallel_Orbitals* paraV_, // information for 2d-block parallel - T* existed_array - = nullptr // if nullptr, new memory will be allocated, otherwise this class is a data wrapper - ); - // Constructor of class AtomPair - // Only for 2d-block MPI parallel case - // This constructor used for initialize a atom-pair local Hamiltonian with non-zero cell indexes, - // which is used for constructing HR (real space Hamiltonian) objects. - AtomPair(const int& atom_i_, // atomic index of atom i, used to identify atom - const int& atom_j_, // atomic index of atom j, used to identify atom - const ModuleBase::Vector3& R_index, // xyz coordinates of cell - const Parallel_Orbitals* paraV_, // information for 2d-block parallel - T* existed_array - = nullptr // if nullptr, new memory will be allocated, otherwise this class is a data wrapper - ); - // This constructor used for initialize a atom-pair local Hamiltonian with only center cell - // which is used for constructing HK (k space Hamiltonian) objects, (gamma_only case) - AtomPair(const int& atom_i, // atomic index of atom i, used to identify atom - const int& atom_j, // atomic index of atom j, used to identify atom - const int* row_atom_begin, // array, contains starting indexes in Hamiltonian matrix of atom i - const int* col_atom_begin, // array, contains starting indexes in Hamiltonian matrix of atom j - const int& natom, - T* existed_matrix = nullptr); - - // This constructor used for initialize a atom-pair local Hamiltonian with non-zero cell indexes, - // which is used for constructing HR (real space Hamiltonian) objects. - AtomPair(const int& atom_i, // atomic index of atom i, used to identify atom - const int& atom_j, // atomic index of atom j, used to identify atom - const int& rx, // x coordinate of cell - const int& ry, // y coordinate of cell - const int& rz, // z coordinate of cell - const int* row_atom_begin, // array, contains starting indexes in Hamiltonian matrix of atom i - const int* col_atom_begin, // array, contains starting indexes in Hamiltonian matrix of atom j - const int& natom, - T* existed_matrix = nullptr); - - // copy constructor - AtomPair(const AtomPair& other, T* data_pointer = nullptr); - // move constructor - AtomPair(AtomPair&& other) noexcept; - - // simple constructor, only set atom_i and atom_j - AtomPair(const int& atom_i_, // atomic index of atom i, used to identify atom - const int& atom_j_ // atomic index of atom j, used to identify atom - ); - // Destructor of class AtomPair - ~AtomPair(); - - /** - * @brief allocate memory for all the BaseMatrix - */ - void allocate(T* data_array = nullptr, bool if_zero = false); - - /** - * @brief set values in every BaseMatrix to zero - */ - void set_zero(); - - /** - * @brief get begin index of this AtomPair - */ - int get_begin_row() const { return this->row_ap; } - int get_begin_col() const { return this->col_ap; } - - /** - * @brief get col_size for this AtomPair - */ - int get_col_size() const; - /** - * @brief get row_size for this AtomPair - */ - int get_row_size() const; - /** - * @brief get atom_i and atom_j for this AtomPair - */ - int get_atom_i() const; - int get_atom_j() const; - /** - * @brief set col_size and row_size - */ - void set_size(const int& col_size_in, const int& row_size_in); - /** - * @brief get size = col_size * row_size - * @return int - */ - int get_size() const {return this->col_size * this->row_size;} - - /** - * @brief get Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel - * @return const Parallel_Orbitals* - */ - const Parallel_Orbitals* get_paraV() const; - - /** - * @brief set Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel -*/ - void set_paraV(const Parallel_Orbitals* paraV_in) { this->paraV = paraV_in; }; - - /// use atom_i and atom_j to identify the atom-pair - bool identify(const AtomPair& other) const; - bool identify(const int& atom_i_, const int& atom_j_) const; - - /** - * @brief get target BaseMatrix of target cell - * for const AtomPair, it will return a const BaseMatrix object, - * and if not found, it will throw a error message - * for non-const AtomPair, it will return a BaseMatrix object, - * and if not found, it will insert a new one and return it - * - * @param rx_in x coordinate of cell - * @param ry_in y coordinate of cell - * @param rz_in z coordinate of cell - * @return BaseMatrix& - */ - BaseMatrix& get_HR_values(int rx_in, int ry_in, int rz_in); - const BaseMatrix& get_HR_values(int rx_in, int ry_in, int rz_in) const; - - /** - * @brief get target BaseMatrix of index of this->values - * it will return a BaseMatrix object, - * and if not found, it will throw a error message - * - * @param index index of this->values - * @return BaseMatrix& - */ - BaseMatrix& get_HR_values(const int& index) const; - - // interface for get (rx, ry, rz) of index-th R-index in this->R_index, the return should be ModuleBase::Vector3 - ModuleBase::Vector3 get_R_index(const int& index) const; - // interface for get (rx, ry, rz) of current_R, the return should be ModuleBase::Vector3 - ModuleBase::Vector3 get_R_index() const; - // interface for search (rx, ry, rz) in this->R_index, if found, current_R would be set to index - int find_R(const int& rx_in, const int& ry_in, const int& rz_in) const; - int find_R(const ModuleBase::Vector3& R_in) const; - // interface for search (rx, ry, rz) in this->R_index, if found, current_R would be set to index - // and return BaseMatrix* of this->values[index] - const BaseMatrix* find_matrix(const int& rx_in, const int& ry_in, const int& rz_in) const; - BaseMatrix* find_matrix(const int& rx_in, const int& ry_in, const int& rz_in); - const BaseMatrix* find_matrix(const ModuleBase::Vector3& R_in) const; - BaseMatrix* find_matrix(const ModuleBase::Vector3& R_in); - - // this interface will call get_value in this->values - // these four interface can be used only when R-index has been choosed (current_R >= 0) - T& get_value(const int& i) const; - T& get_value(const int& row, const int& col) const; - - /** - * @brief get values of this->values[ir] for a whole matrix - * @param ir index of this->values - * @return std::tuple, T*> - * std::vector(4) contains (row_begin_index, row_size, col_begin_index, col_size) - * T* is pointer of values[ir].value_begin, legal index is [0, row_size*col_size) - */ - std::tuple, T*> get_matrix_values(int ir = -1) const; - - /** - * @brief get pointer of value from a submatrix - */ - T* get_pointer(int ir=-1) const; - - // add another BaseMatrix to this->values with specific R index. - void convert_add(const BaseMatrix& target, int rx_in, int ry_in, int rz_in); - /** - * @brief merge another AtomPair to this AtomPair - * - * @param other Another AtomPair - */ - void merge(const AtomPair& other, bool skip_R = false); - - /** - * @brief merge all values in this AtomPair to one BaseMatrix with R-index (0, 0, 0) - * in this case, H_gamma = sum_{R} H_R will be saved in this->values[0] - */ - void merge_to_gamma(); - - /** - * @brief Add this->value[current_R] * kphase as a block matrix of hk. - * - * For row major dense matrix (hk_type == 0): value[current_R][i*col_size+j] -> hk[(row_ap+i) * ld_hk + col_ap + j] - * For column major dense matrix (hk_type == 1): value[current_R][i*col_size+j] -> hk[row_ap + i + (col_ap+j) * - * ld_hk] For sparse matrix (hk_type == 2): not implemented yet - * - * @param hk Pointer to the target matrix. - * @param ld_hk Leading dimension of the target matrix. - * @param kphase Complex scalar to be multiplied with the block matrix. - * @param hk_type The type of matrix layout (default: 0). - */ - void add_to_matrix(std::complex* hk, - const int ld_hk, - const std::complex& kphase, - const int hk_type = 0) const; - - /** - * @brief Add this->value[current_R] * kphase as a block matrix of hk. - * for non-collinear spin case only - */ - void add_to_matrix(T* hk, const int ld_hk, const T& kphase, const int hk_type = 0) const; - - void add_from_matrix(const std::complex* hk, - const int ld_hk, - const std::complex& kphase, - const int hk_type = 0); - - void add_from_matrix(const T* hk, const int ld_hk, const T& kphase, const int hk_type = 0); - - /** - * @brief Add this->value[current_R] * kphase to an array. - * T = double or float - */ - void add_to_array(std::complex* target_array, const std::complex& kphase) const; - /** - * @brief Add this->value[current_R] * kphase to an array. - * for non-collinear spin case only (T = complex or complex) - */ - void add_to_array(T* target_array, const T& kphase) const; - - // comparation function, used for sorting - bool operator<(const AtomPair& other) const; - - // The copy assignment operator - AtomPair& operator=(const AtomPair& other); - // move assignment operator - AtomPair& operator=(AtomPair&& other) noexcept; - - // interface for getting the size of this->R_index - size_t get_R_size() const - { -#ifdef __DEBUG - assert(this->R_index.size() == this->values.size()); - // assert(this->R_index.size() % 3 == 0); -#endif - return this->R_index.size(); - } - - /** - * @brief get total memory size of AtomPair - */ - size_t get_memory_size() const; - - private: - // it contains 3 index of cell, size of R_index is three times of values. - std::vector> R_index; - - // it contains containers for accessing matrix of this atom-pair - std::vector> values; - - // only for 2d-block - const Parallel_Orbitals* paraV = nullptr; - - // the default R index is (0, 0, 0) - // if current_R > 0, it means R index has been fixed - // if current_R == 0, it means R index refers to the first cell - // if current_R == 0 with gamma_only, it means R index refers to the center cell - // !!!!!!!!!!! BE CAREFUL, current_R IS NOT THREADING-SAFE !!!!!!!!!!!!!!!!!!!!! - mutable int current_R = 0; - - // index for identifying atom I and J for this atom-pair - int atom_i = -1; - int atom_j = -1; - // start index of row for this Atom-Pair - int row_ap = -1; - // start index of col for this Atom-pair - int col_ap = -1; - int row_size = 0; - int col_size = 0; -}; - -} // namespace hamilt - -#endif diff --git a/source/module_hamilt_lcao/module_hcontainer/base_matrix.cpp b/source/module_hamilt_lcao/module_hcontainer/base_matrix.cpp deleted file mode 100644 index d246dd2969..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/base_matrix.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include "base_matrix.h" -#include -#include - -#include "source_base/global_function.h" - -namespace hamilt -{ - -template -BaseMatrix::BaseMatrix(const int& nrow_, const int& ncol_, T* data_existed) -{ - nrow_local = nrow_; - ncol_local = ncol_; - this->allocated = false; - value_begin = data_existed; -} - -// move constructor -template -BaseMatrix::BaseMatrix(BaseMatrix&& matrix) -{ - this->nrow_local = matrix.nrow_local; - this->ncol_local = matrix.ncol_local; - this->value_begin = matrix.value_begin; - this->allocated = matrix.allocated; - if (matrix.allocated) - { - matrix.allocated = false; - } - matrix.value_begin = nullptr; -} - -// copy constructor -template -BaseMatrix::BaseMatrix(const BaseMatrix& matrix) -{ - this->nrow_local = matrix.nrow_local; - this->ncol_local = matrix.ncol_local; - if (matrix.allocated) - { - this->value_begin = new T[nrow_local * ncol_local]; - ModuleBase::GlobalFunc::ZEROS(this->value_begin, nrow_local * ncol_local); - this->allocated = true; - for (int i = 0; i < nrow_local * ncol_local; i++) - { - this->value_begin[i] = matrix.value_begin[i]; - } - } - else - { - this->value_begin = matrix.value_begin; - this->allocated = false; - } -} - -template -BaseMatrix::~BaseMatrix() -{ - if (this->allocated) - { - delete[] value_begin; - } -} - -// allocate -template -void BaseMatrix::allocate(T* data_array, bool if_zero) -{ -#ifdef __DEBUG -assert(nrow_local*ncol_local>0); -#endif - if(data_array != nullptr && !this->allocated) - { - this->value_begin = data_array; - } - else if(data_array != nullptr && this->allocated) - { - delete[] this->value_begin; - this->value_begin = data_array; - this->allocated = false; - } - else if(data_array == nullptr && !this->allocated) - { - this->value_begin = new T[nrow_local * ncol_local]; - this->allocated = true; - } - else - { - // do nothing - } - if(if_zero) - { - this->set_zero(); - } -} - -// zeros -template -void BaseMatrix::set_zero() -{ -#ifdef __DEBUG -assert(this->value_begin != nullptr); -#endif - ModuleBase::GlobalFunc::ZEROS(this->value_begin, nrow_local * ncol_local); -} - -// add_array -template -void BaseMatrix::add_array(T* array) -{ -#ifdef __DEBUG -assert(this->value_begin != nullptr); -#endif - // if allocated, add data from array into matrix - // if whole matrix and 2d-block format, add data from array into matrix either - for (int i = 0; i < nrow_local * ncol_local; ++i) - { - value_begin[i] += array[i]; - } -} - -// operator= for copy assignment -template -BaseMatrix& BaseMatrix::operator=(const BaseMatrix& other) -{ - if (this != &other) - { - this->nrow_local = other.nrow_local; - this->ncol_local = other.ncol_local; - - if (this->allocated) - { - delete[] this->value_begin; - } - - if (other.allocated) - { - this->value_begin = new T[nrow_local * ncol_local]; - ModuleBase::GlobalFunc::ZEROS(this->value_begin, nrow_local * ncol_local); - this->allocated = true; - for (int i = 0; i < nrow_local * ncol_local; ++i) - { - this->value_begin[i] = other.value_begin[i]; - } - } - else - { - this->value_begin = other.value_begin; - this->allocated = false; - } - } - return *this; -} - -// operator= for move assignment -template -BaseMatrix& BaseMatrix::operator=(BaseMatrix&& other) noexcept -{ - if (this != &other) - { - this->nrow_local = other.nrow_local; - this->ncol_local = other.ncol_local; - - if (this->allocated) - { - delete[] this->value_begin; - } - - this->value_begin = other.value_begin; - this->allocated = other.allocated; - if (other.allocated) - { - other.allocated = false; - } - other.value_begin = nullptr; - } - return *this; -} - -// get_memory_size -template -size_t BaseMatrix::get_memory_size() const -{ - size_t memory_size = sizeof(*this); - if(this->allocated) - { - memory_size += nrow_local * ncol_local * sizeof(T); - } - return memory_size; -} - -// set size -template -void BaseMatrix::set_size(const int& nrow, const int& ncol) -{ - this->nrow_local = nrow; - this->ncol_local = ncol; -} - -// T of BaseMatrix can be double or complex -template class BaseMatrix; -template class BaseMatrix>; - -} // namespace hamilt \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/base_matrix.h b/source/module_hamilt_lcao/module_hcontainer/base_matrix.h deleted file mode 100644 index dfa3e4b396..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/base_matrix.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef BASE_MATRIX_H -#define BASE_MATRIX_H - -#include -#include -#include - -namespace hamilt -{ -/** - * class: BaseMatrix - * used to store a matrix for atom-pair local Hamiltonian with specific R-index - * T can be double or complex - * It has two ways to arrange data: - * 1. allocate data itself - * 2. only access data but be arranged by other class - */ -template -class BaseMatrix -{ - public: - // Constructor of class BaseMatrix - BaseMatrix(const int& nrow_, const int& ncol_, T* data_existed = nullptr); - // copy constructor - BaseMatrix(const BaseMatrix& matrix); - // move constructor - BaseMatrix(BaseMatrix&& matrix); - // Destructor of class BaseMatrix - ~BaseMatrix(); - - /** - * @brief allocate memory for the matrix - * if this->value_begin is not nullptr, it will be neglected - * if this->value_begin is nullptr, it will allocate memory with size nrow_local * ncol_local - */ - void allocate(T* data_array = nullptr, bool if_zero = false); - - /** - * @brief set value in the matrix to zero - */ - void set_zero(); - - /** - * @brief add an array to the matrix - * - * @param array array to be added - */ - void add_array(T* array); - - /** - * @brief add a single element to the matrix - * - * @param mu row index - * @param nu column index - * @param value value to be added - */ - void add_element(int mu, int nu, const T& value) - { - #ifdef __DEBUG - assert(this->value_begin != nullptr); - #endif - int index = mu * this->ncol_local + nu; - value_begin[index] += value; - }; - - // for inside matrix - /** - * @brief get value from a whole matrix - * - * @param i_row row index - * @param j_col column index - * @return T& - */ - T& get_value(const size_t& i_row, const size_t& j_col) const - { - #ifdef __DEBUG - assert(this->value_begin != nullptr); - #endif - int index = i_row * this->ncol_local + j_col; - return value_begin[index]; - }; - - /** - * @brief get pointer of value from a submatrix - */ - T* get_pointer() const { return value_begin; }; - - // operator= for copy assignment - BaseMatrix& operator=(const BaseMatrix& other); - - // operator= for move assignment - BaseMatrix& operator=(BaseMatrix&& other) noexcept; - - /** - * @brief get total memory size of BaseMatrix - */ - size_t get_memory_size() const; - - /** - * @brief get col_size for this matrix - */ - int get_col_size() const {return ncol_local;}; - /** - * @brief get row_size for this matrix - */ - int get_row_size() const {return nrow_local;}; - /** - * @brief set col_size and row_size - */ - void set_size(const int& col_size_in, const int& row_size_in); - - void add_array_ts(T* array) - { - std::lock_guard lock(mtx); - const int size = nrow_local * ncol_local; - for (int i = 0; i < size; ++i) - { - value_begin[i] += array[i]; - } - } - - private: - bool allocated = false; - - // pointer for accessing data - // two ways to arrange data: - // 1. allocate data itself - // 2. only access data but be arranged by RealSparseHamiltonian - T* value_begin = nullptr; - - // int current_multiple = 0; - - // for thread safe - mutable std::mutex mtx; - // number of rows and columns - int nrow_local = 0; - int ncol_local = 0; -}; - -} // namespace hamilt - -#endif diff --git a/source/module_hamilt_lcao/module_hcontainer/func_folding.cpp b/source/module_hamilt_lcao/module_hcontainer/func_folding.cpp deleted file mode 100644 index 58ba3d267a..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/func_folding.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include "hcontainer_funcs.h" -#include "source_base/libm/libm.h" - -namespace hamilt -{ -/** - * @brief calculate the Hk matrix with specific k vector - * @param hR the HContainer of atom pairs - * @param hk the data pointer of Hk matrix, the size of hk would be nrow * ncol - * @param kvec_d_in the k vector in Direct coordinate - * @param hk_ld the leading dimension number of hk, ncol for row-major, nrow for column-major - * @param hk_type the data-type of hk, 0 is row-major, 1 is column-major -*/ -template -void folding_HR(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int hk_ld, - const int hk_type) -{ -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < hR.size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = hR.get_atom_pair(i); - const int row_size = tmp.get_row_size(); - const int col_size = tmp.get_col_size(); - // copy hk to hk_type - // hk_tmp is row-major and stored contiguously in memory, - // so copy hr to hk_tmp is faster than copy hr to hk - std::vector> hk_mat_tmp(row_size * col_size, 0); - - // copy hr to hk_tmp - for(int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); - TR* hr_mat = tmp.get_pointer(ir); - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - - for(int i = 0; i < row_size * col_size; ++i) - { - hk_mat_tmp[i] += kphase * hr_mat[i]; - } - } - - // copy hk_tmp to hk - if (hk_type == 0) - { - std::complex* hk_mat = hk + tmp.get_begin_row() * hk_ld + tmp.get_begin_col(); - for(int irow = 0; irow < row_size; ++irow) - { - for(int icol = 0; icol < col_size; ++icol) - { - hk_mat[irow * hk_ld + icol] += hk_mat_tmp[irow * col_size + icol]; - } - } - } - else if(hk_type == 1) - { - std::complex* hk_mat = hk + tmp.get_begin_col() * hk_ld + tmp.get_begin_row(); - for(int icol = 0; icol < col_size; ++icol) - { - for(int irow = 0; irow < row_size; ++irow) - { - hk_mat[icol * hk_ld + irow] += hk_mat_tmp[irow * col_size + icol]; - } - } - } - } - /*for (int i = 0; i < hR.size_R_loop(); ++i) - { - // get R index - int rx, ry, rz; - hR.loop_R(i, rx, ry, rz); - // only deal with current_R for hR - hR.fix_R(rx, ry, rz); - - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(rx, ry, rz); - const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - - // loop_atom_pairs -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int j = 0; j < hR.size_atom_pairs(); ++j) - { - // Hk += HR * e^ikR - hR.get_atom_pair(j).add_to_matrix(hk, ncol, kphase, hk_type); - } - }*/ -} - -// template instantiation -template void folding_HR>(const hamilt::HContainer>& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); -template void folding_HR(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); -// special case for double -void folding_HR(const hamilt::HContainer& hR, - double* hk, - const ModuleBase::Vector3& kvec_d_in, - const int hk_ld, - const int hk_type) -{ -// in ABACUS, this function works with gamma-only case. -// hR should be R=(0,0,0) only. -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < hR.size_atom_pairs(); ++i) - { - // cal k_phase - // if TK==double, kphase is 1.0 - double kphase = 1.0; - - // Hk = HR - hR.get_atom_pair(i).add_to_matrix(hk, hk_ld , kphase, hk_type); - } -} - -} // namespace hamilt \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/func_transfer.cpp b/source/module_hamilt_lcao/module_hcontainer/func_transfer.cpp deleted file mode 100644 index 1da0c524a1..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/func_transfer.cpp +++ /dev/null @@ -1,663 +0,0 @@ -#include "./hcontainer_funcs.h" -#include "./transfer.h" - -#ifdef __MPI -#include - -//#include - -namespace hamilt -{ -// transfer the HContainer from serial object to parallel object -template -void transferSerial2Parallels(const hamilt::HContainer& hR_s, hamilt::HContainer* hR_p, const int serial_rank) -{ - int my_rank, size; - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); - - hamilt::HTransSerial* trans_s = nullptr; - if (my_rank == serial_rank) - { - trans_s = new hamilt::HTransSerial(size, const_cast*>(&hR_s)); - } - hamilt::HTransPara trans_p(size, hR_p); - // plan indexes - //std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - if (my_rank == serial_rank) - { - // send indexes to other ranks - for (int i = 0; i < size; ++i) - { - if (i == serial_rank) - continue; - trans_s->send_ap_indexes(i); - } - - { // transfer serial_rank to serial_rank - std::vector tmp_indexes; - trans_s->cal_ap_indexes(serial_rank, &tmp_indexes); - trans_p.receive_ap_indexes(serial_rank, tmp_indexes.data(), tmp_indexes.size()); - trans_p.cal_orb_indexes(serial_rank, &tmp_indexes); - trans_s->receive_orb_indexes(serial_rank, tmp_indexes.data(), tmp_indexes.size()); - } - - // receive indexes from other ranks - for (int i = 0; i < size; ++i) - { - if (i == serial_rank) - continue; - trans_s->receive_orb_indexes(i); - } - } - else // my_rank != serial_rank - { - // receive ap_indexes from serial_rank and then send orb_indexes to serial_rank - trans_p.receive_ap_indexes(serial_rank); - trans_p.send_orb_indexes(serial_rank); - } - std::vector all_values; - long max_size = 0; - if (my_rank == serial_rank) - { - // calculate max size of values - max_size = trans_s->get_max_size(); - all_values.resize(max_size * size); - } - MPI_Bcast(&max_size, 1, MPI_LONG, serial_rank, MPI_COMM_WORLD); - std::vector receive_values(max_size); - /*std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // send data - if (my_rank == serial_rank) - { - for (int i = 0; i < size; ++i) - { - trans_s->pack_data(i, (all_values.data() + i * max_size)); - } - } - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration pre_scatter_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // MPI_scatter to send values - MPI_Scatter(all_values.data(), - max_size, - MPITraits::datatype(), - receive_values.data(), - max_size, - MPITraits::datatype(), - serial_rank, - MPI_COMM_WORLD); - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration scatter_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // receive data - trans_p.receive_data(serial_rank, receive_values.data()); - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration post_scatter_time - = std::chrono::duration_cast>(end_time - start_time); - std::cout << " S2P: my_rank = " << my_rank << " indexes_time = " << elapsed_time0.count() - << " data_trans_time = " << pre_scatter_time.count()<<" "< -void transferParallels2Serial(const hamilt::HContainer& hR_p, hamilt::HContainer* hR_s, const int serial_rank) -{ - int my_rank, size; - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); - - hamilt::HTransSerial* trans_s = nullptr; - if (my_rank == serial_rank) - { - trans_s = new hamilt::HTransSerial(size, hR_s); - } - hamilt::HTransPara trans_p(size, const_cast*>(&hR_p)); - - // plan indexes - //std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - if (my_rank == serial_rank) - { - { // transfer serial_rank to serial_rank - std::vector tmp_indexes; - trans_s->cal_ap_indexes(serial_rank, &tmp_indexes); - trans_p.receive_ap_indexes(serial_rank, tmp_indexes.data(), tmp_indexes.size()); - trans_p.cal_orb_indexes(serial_rank, &tmp_indexes); - trans_s->receive_orb_indexes(serial_rank, tmp_indexes.data(), tmp_indexes.size()); - } - - // send indexes to other ranks - for (int i = 0; i < size; ++i) - { - if (i == serial_rank) - continue; - trans_s->send_ap_indexes(i); - } - // receive indexes from other ranks - for (int i = 0; i < size; ++i) - { - if (i == serial_rank) - continue; - trans_s->receive_orb_indexes(i); - } - } - else // my_rank != serial_rank - { - trans_p.receive_ap_indexes(serial_rank); - trans_p.send_orb_indexes(serial_rank); - } - /*std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // send data - std::vector receive_values; - long max_size; - if (my_rank == serial_rank) - { - max_size = trans_s->get_max_size(); - receive_values.resize(max_size * size); - } - MPI_Bcast(&max_size, 1, MPI_LONG, serial_rank, MPI_COMM_WORLD); - - // MPI_gather to receive values - std::vector send_values; - send_values.resize(max_size); - trans_p.pack_data(serial_rank, send_values.data()); - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration pre_gather_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - MPI_Gather(send_values.data(), - max_size, - MPITraits::datatype(), - receive_values.data(), - max_size, - MPITraits::datatype(), - serial_rank, - MPI_COMM_WORLD); - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration gather_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - if (my_rank == serial_rank) - { - for (int i = 0; i < size; ++i) - { - trans_s->receive_data(i, &receive_values[i * max_size]); - } - } - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration post_gather_time - = std::chrono::duration_cast>(end_time - start_time); - std::cout << " P2S: my_rank = " << my_rank << " elapsed_time0 = " << elapsed_time0.count() - << " data_trans_time = " << pre_gather_time.count()<<" "< -void transferSerials2Parallels(const hamilt::HContainer& hR_s, hamilt::HContainer* hR_p) -{ - int my_rank, size; - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); - - hamilt::HTransSerial trans_s(size, const_cast*>(&hR_s)); - hamilt::HTransPara trans_p(size, hR_p); - // plan indexes - //std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - // transfer indexes with other ranks - - - { // begin of indexes_transfer - // ----------------------------------- - // int tools for MPI_alltoallv - std::vector sendbuf, receivebuf; - std::vector sendcounts(size), recvcounts(size), sdispls(size), rdispls(size); - // ----------------------------------- - // prepare sendbuf and sendcounts and sdispls and size of receivebuf - for (int i = 0; i < size; ++i) - { // transfer in same process - std::vector tmp_indexes; - trans_s.cal_ap_indexes(i, &tmp_indexes); - sendcounts[i] = tmp_indexes.size(); - sdispls[i] = sendbuf.size(); - sendbuf.insert(sendbuf.end(), tmp_indexes.begin(), tmp_indexes.end()); - } - - MPI_Alltoall(sendcounts.data(), 1, MPI_INT, recvcounts.data(), 1, MPI_INT, MPI_COMM_WORLD); - - // resize the receivebuf - long recvbuf_size = 0; - for (int i = 0; i < size; ++i) - { - recvbuf_size += recvcounts[i]; - } - receivebuf.resize(recvbuf_size); - rdispls[0] = 0; - for (int i = 1; i < size; ++i) - { - rdispls[i] = rdispls[i - 1] + recvcounts[i - 1]; - } - - // MPI_Alltoallv to send indexes - MPI_Alltoallv(sendbuf.data(), - sendcounts.data(), - sdispls.data(), - MPI_INT, - receivebuf.data(), - recvcounts.data(), - rdispls.data(), - MPI_INT, - MPI_COMM_WORLD); - - // receive indexes from other ranks - sendbuf.clear(); - for (int i = 0; i < size; ++i) - { - trans_p.receive_ap_indexes(i, &receivebuf[rdispls[i]], recvcounts[i]); - std::vector tmp_indexes; - trans_p.cal_orb_indexes(i, &tmp_indexes); - sendcounts[i] = tmp_indexes.size(); - sdispls[i] = sendbuf.size(); - sendbuf.insert(sendbuf.end(), tmp_indexes.begin(), tmp_indexes.end()); - } - - MPI_Alltoall(sendcounts.data(), 1, MPI_INT, recvcounts.data(), 1, MPI_INT, MPI_COMM_WORLD); - - // resize the receivebuf - recvbuf_size = 0; - for (int i = 0; i < size; ++i) - { - recvbuf_size += recvcounts[i]; - } - receivebuf.resize(recvbuf_size); - rdispls[0] = 0; - for (int i = 1; i < size; ++i) - { - rdispls[i] = rdispls[i - 1] + recvcounts[i - 1]; - } - - // MPI_Alltoallv to send indexes - MPI_Alltoallv(sendbuf.data(), - sendcounts.data(), - sdispls.data(), - MPI_INT, - receivebuf.data(), - recvcounts.data(), - rdispls.data(), - MPI_INT, - MPI_COMM_WORLD); - - // receive indexes from other ranks - for (int i = 0; i < size; ++i) - { - trans_s.receive_orb_indexes(i, &receivebuf[rdispls[i]], recvcounts[i]); - } - - }//end of indexes_transfer - - { // begin of data_transfer - // ----------------------------------- - // TR tools for MPI_alltoallv - std::vector sendbuf, receivebuf; - std::vector sendcounts(size), recvcounts(size), sdispls(size), rdispls(size); - // ----------------------------------- - // prepare sendbuf and sendcounts and sdispls and size of receivebuf - - trans_s.get_value_size(sendcounts.data()); - sdispls[0] = 0; - long sendbuf_size = sendcounts[0]; - for (int i = 1; i < size; ++i) - { - sdispls[i] = sdispls[i - 1] + sendcounts[i - 1]; - sendbuf_size += sendcounts[i]; - } - sendbuf.resize(sendbuf_size); - trans_p.get_value_size(recvcounts.data()); - - long recvbuf_size = 0; - for (int i = 0; i < size; ++i) - { - rdispls[i] = recvbuf_size; - recvbuf_size += recvcounts[i]; - } - receivebuf.resize(recvbuf_size); - - /*std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // send data - for (int i = 0; i < size; ++i) - { - if(sendcounts[i] > 0) - { - trans_s.pack_data(i, (sendbuf.data() + sdispls[i])); - } - } - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration pre_scatter_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // MPI_Alltoallv to send values - MPI_Alltoallv(sendbuf.data(), - sendcounts.data(), - sdispls.data(), - MPITraits::datatype(), - receivebuf.data(), - recvcounts.data(), - rdispls.data(), - MPITraits::datatype(), - MPI_COMM_WORLD); - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration scatter_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // receive data - for (int i = 0; i < size; ++i) - { - if(recvcounts[i] > 0) - { - trans_p.receive_data(i, (receivebuf.data() + rdispls[i])); - } - } - } // end of data_transfer - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration post_scatter_time - = std::chrono::duration_cast>(end_time - start_time); - std::cout << " S2P: my_rank = " << my_rank << " indexes_time = " << elapsed_time0.count() - << " data_trans_time = " << pre_scatter_time.count()<<" "< -void transferParallels2Serials(const hamilt::HContainer& hR_p, hamilt::HContainer* hR_s) -{ - int my_rank, size; - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); - - hamilt::HTransPara trans_p(size, const_cast*>(&hR_p)); - hamilt::HTransSerial trans_s(size, hR_s); - // plan indexes - //std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - // transfer indexes with other ranks - - - { // begin of indexes_transfer - // ----------------------------------- - // int tools for MPI_alltoallv - std::vector sendbuf, receivebuf; - std::vector sendcounts(size), recvcounts(size), sdispls(size), rdispls(size); - // ----------------------------------- - - for (int i = 0; i < size; ++i) - { // transfer in same process - std::vector tmp_indexes; - trans_s.cal_ap_indexes(i, &tmp_indexes); - sendcounts[i] = tmp_indexes.size(); - sdispls[i] = sendbuf.size(); - sendbuf.insert(sendbuf.end(), tmp_indexes.begin(), tmp_indexes.end()); - } - - MPI_Alltoall(sendcounts.data(), 1, MPI_INT, recvcounts.data(), 1, MPI_INT, MPI_COMM_WORLD); - - // resize the receivebuf - long recvbuf_size = 0; - for (int i = 0; i < size; ++i) - { - recvbuf_size += recvcounts[i]; - } - receivebuf.resize(recvbuf_size); - rdispls[0] = 0; - for (int i = 1; i < size; ++i) - { - rdispls[i] = rdispls[i - 1] + recvcounts[i - 1]; - } - - // MPI_Alltoallv to send indexes - MPI_Alltoallv(sendbuf.data(), - sendcounts.data(), - sdispls.data(), - MPI_INT, - receivebuf.data(), - recvcounts.data(), - rdispls.data(), - MPI_INT, - MPI_COMM_WORLD); - - // receive indexes from other ranks - sendbuf.clear(); - for (int i = 0; i < size; ++i) - { - trans_p.receive_ap_indexes(i, &receivebuf[rdispls[i]], recvcounts[i]); - std::vector tmp_indexes; - trans_p.cal_orb_indexes(i, &tmp_indexes); - sendcounts[i] = tmp_indexes.size(); - sdispls[i] = sendbuf.size(); - sendbuf.insert(sendbuf.end(), tmp_indexes.begin(), tmp_indexes.end()); - } - - MPI_Alltoall(sendcounts.data(), 1, MPI_INT, recvcounts.data(), 1, MPI_INT, MPI_COMM_WORLD); - - // resize the receivebuf - recvbuf_size = 0; - for (int i = 0; i < size; ++i) - { - recvbuf_size += recvcounts[i]; - } - receivebuf.resize(recvbuf_size); - rdispls[0] = 0; - for (int i = 1; i < size; ++i) - { - rdispls[i] = rdispls[i - 1] + recvcounts[i - 1]; - } - - // MPI_Alltoallv to send indexes - MPI_Alltoallv(sendbuf.data(), - sendcounts.data(), - sdispls.data(), - MPI_INT, - receivebuf.data(), - recvcounts.data(), - rdispls.data(), - MPI_INT, - MPI_COMM_WORLD); - - // receive indexes from other ranks - for (int i = 0; i < size; ++i) - { - trans_s.receive_orb_indexes(i, &receivebuf[rdispls[i]], recvcounts[i]); - } - - }//end of indexes_transfer - - { // begin of data_transfer - // ----------------------------------- - // TR tools for MPI_alltoallv - std::vector sendbuf, receivebuf; - std::vector sendcounts(size), recvcounts(size), sdispls(size), rdispls(size); - // ----------------------------------- - // prepare sendbuf and sendcounts and sdispls and size of receivebuf - - trans_p.get_value_size(sendcounts.data()); - sdispls[0] = 0; - long sendbuf_size = sendcounts[0]; - for (int i = 1; i < size; ++i) - { - sdispls[i] = sdispls[i - 1] + sendcounts[i - 1]; - sendbuf_size += sendcounts[i]; - } - sendbuf.resize(sendbuf_size); - trans_s.get_value_size(recvcounts.data()); - - long recvbuf_size = 0; - for (int i = 0; i < size; ++i) - { - rdispls[i] = recvbuf_size; - recvbuf_size += recvcounts[i]; - } - receivebuf.resize(recvbuf_size); - - /*std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // send data - for (int i = 0; i < size; ++i) - { - if(sendcounts[i] > 0) - { - trans_p.pack_data(i, (sendbuf.data() + sdispls[i])); - } - } - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration pre_scatter_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // MPI_Alltoallv to send values - MPI_Alltoallv(sendbuf.data(), - sendcounts.data(), - sdispls.data(), - MPITraits::datatype(), - receivebuf.data(), - recvcounts.data(), - rdispls.data(), - MPITraits::datatype(), - MPI_COMM_WORLD); - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration scatter_time - = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now();*/ - - // receive data - for (int i = 0; i < size; ++i) - { - if(recvcounts[i] > 0) - { - trans_s.receive_data(i, (receivebuf.data() + rdispls[i])); - } - } - } // end of data_transfer - - /*end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration post_scatter_time - = std::chrono::duration_cast>(end_time - start_time); - std::cout << " S2P: my_rank = " << my_rank << " indexes_time = " << elapsed_time0.count() - << " data_trans_time = " << pre_scatter_time.count()<<" "< -void gatherParallels(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s, - const int serial_rank) -{ - // gather s from all ranks to serial_rank - int my_rank, size; - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); - std::vector para_ijrs = hR_p.get_ijr_info(); - if (my_rank == serial_rank) - { - hR_s->insert_ijrs(¶_ijrs); - for (int i = 0; i < size; ++i) - { - if (i == serial_rank) - continue; - std::vector tmp_ijrs; - MPI_Status status; - int tmp_size = 0; - MPI_Recv(&tmp_size, 1, MPI_INT, i, 0, MPI_COMM_WORLD, &status); - tmp_ijrs.resize(tmp_size); - MPI_Recv(tmp_ijrs.data(), - tmp_ijrs.size(), - MPI_INT, - i, - 0, - MPI_COMM_WORLD, - &status); - hR_s->insert_ijrs(&tmp_ijrs); - } - hR_s->allocate(); - } - else - { - int tmp_size = para_ijrs.size(); - MPI_Send(&tmp_size, 1, MPI_INT, serial_rank, 0, MPI_COMM_WORLD); - MPI_Send(para_ijrs.data(), para_ijrs.size(), MPI_INT, serial_rank, 0, MPI_COMM_WORLD); - } - // gather values from Parallels to target serial_rank - transferParallels2Serial(hR_p, hR_s, serial_rank); -} - -// specialize for double and std::complex -template void transferSerial2Parallels(const hamilt::HContainer& hR_s, - hamilt::HContainer* hR_p, - const int serial_rank); -template void transferSerial2Parallels(const hamilt::HContainer>& hR_s, - hamilt::HContainer>* hR_p, - const int serial_rank); -template void transferParallels2Serial(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s, - const int serial_rank); -template void transferParallels2Serial(const hamilt::HContainer>& hR_p, - hamilt::HContainer>* hR_s, - const int serial_rank); -template void transferSerials2Parallels(const hamilt::HContainer& hR_s, - hamilt::HContainer* hR_p); -template void transferSerials2Parallels(const hamilt::HContainer>& hR_s, - hamilt::HContainer>* hR_p); - -template void transferParallels2Serials(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s); -template void transferParallels2Serials(const hamilt::HContainer>& hR_p, - hamilt::HContainer>* hR_s); -template void gatherParallels(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s, - const int serial_rank); -template void gatherParallels(const hamilt::HContainer>& hR_p, - hamilt::HContainer>* hR_s, - const int serial_rank); - -} // namespace hamilt - -#endif // __MPI \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/hcontainer.cpp b/source/module_hamilt_lcao/module_hcontainer/hcontainer.cpp deleted file mode 100644 index 89b71306a1..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/hcontainer.cpp +++ /dev/null @@ -1,862 +0,0 @@ -#include "hcontainer.h" - -namespace hamilt -{ - -// class HContainer - - -// destructor -template -HContainer::~HContainer() -{ - if(this->allocated) - { - delete[] this->wrapper_pointer; - } -} - -template -HContainer::HContainer() {} - -// copy constructor -template -HContainer::HContainer(const HContainer& HR_in, T* data_array) -{ - this->sparse_ap = HR_in.sparse_ap; - this->sparse_ap_index = HR_in.sparse_ap_index; - this->gamma_only = HR_in.gamma_only; - this->paraV = HR_in.paraV; - this->current_R = -1; - this->wrapper_pointer = data_array; - this->allocated = false; - this->atom_pairs = HR_in.atom_pairs; - // data of HR_in will not be copied, please call add() after this constructor to copy data. - this->allocate(this->wrapper_pointer, true); - // tmp terms not copied -} - -// move constructor -template -HContainer::HContainer(HContainer&& HR_in) noexcept -{ - this->atom_pairs = std::move(HR_in.atom_pairs); - this->sparse_ap = std::move(HR_in.sparse_ap); - this->sparse_ap_index = std::move(HR_in.sparse_ap_index); - this->wrapper_pointer = HR_in.wrapper_pointer; - this->gamma_only = HR_in.gamma_only; - this->paraV = HR_in.paraV; - this->current_R = -1; - HR_in.wrapper_pointer = nullptr; - // tmp terms not moved -} - -// move assignment -template -HContainer& HContainer::operator=(HContainer&& HR_in) noexcept -{ - if (this != &HR_in) - { - this->atom_pairs = std::move(HR_in.atom_pairs); - this->sparse_ap = std::move(HR_in.sparse_ap); - this->sparse_ap_index = std::move(HR_in.sparse_ap_index); - this->wrapper_pointer = HR_in.wrapper_pointer; - this->gamma_only = HR_in.gamma_only; - this->paraV = HR_in.paraV; - this->current_R = -1; - - HR_in.wrapper_pointer = nullptr; - } - return *this; -} - -// simple constructor -template -HContainer::HContainer(int natom) -{ - this->gamma_only = false; - this->current_R = -1; - this->sparse_ap.resize(natom); - this->sparse_ap_index.resize(natom); -} - -// use unitcell to initialize atom_pairs -template -HContainer::HContainer(const UnitCell& ucell_, const Parallel_Orbitals* paraV) -{ - this->gamma_only = false; - this->current_R = -1; - std::vector atom_begin_row(ucell_.nat+1, 0); - std::vector atom_begin_col(ucell_.nat+1, 0); - int begin = 0; - for(int i=0;iatom_pairs.resize(ucell_.nat * ucell_.nat, AtomPair(0, 0)); - this->sparse_ap.resize(ucell_.nat); - this->sparse_ap_index.resize(ucell_.nat); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < ucell_.nat; i++) - { - this->sparse_ap[i].resize(ucell_.nat); - this->sparse_ap_index[i].resize(ucell_.nat); - for (int j = 0; j < ucell_.nat; j++) - { - //AtomPair atom_ij(i, j, atom_begin_row.data(), atom_begin_col.data(), ucell_.nat); - this->atom_pairs[i * ucell_.nat + j] = AtomPair(i, j, atom_begin_row.data(), atom_begin_col.data(), ucell_.nat); - this->sparse_ap[i][j] = j; - this->sparse_ap_index[i][j] = i * ucell_.nat + j; - } - } - } - else - { - this->paraV = paraV; - // initialize atom_pairs and sparse_ap - this->sparse_ap.resize(ucell_.nat); - this->sparse_ap_index.resize(ucell_.nat); - for (int i = 0; i < ucell_.nat; i++) - { - for (int j = 0; j < ucell_.nat; j++) - { - //check if atom_pair(i, j) is empty in this process - if(paraV->get_row_size(i) <= 0 || paraV->get_col_size(j) <= 0) - { - continue; - } - AtomPair atom_ij(i, j, paraV); - this->insert_pair(atom_ij); - } - } - } - this->allocate(nullptr, true); -} - -//HContainer(const Parallel_Orbitals* paraV, T* data_pointer = nullptr); -template -HContainer::HContainer(const Parallel_Orbitals* paraV_in, T* data_pointer, const std::vector* ijr_info) -{ - this->current_R = -1; - - // use HContainer as a wrapper(!nullptr) or container(nullptr) - this->wrapper_pointer = data_pointer; - -#ifdef __DEBUG - assert(paraV_in != nullptr); -#endif - - // save Parallel_Orbitals pointer - this->paraV = paraV_in; - // initialize sparse_ap - int natom = paraV->atom_begin_row.size(); - this->sparse_ap.resize(natom); - this->sparse_ap_index.resize(natom); - if(ijr_info != nullptr) - { - this->insert_ijrs(ijr_info); - // allocate memory - this->allocate(data_pointer, false); - } -} - -// allocate -template -void HContainer::allocate(T* data_array, bool is_zero) -{ - size_t nnr = this->get_nnr(); - if(this->allocated) - {// delete existed memory of this->wrapper_pointer - delete[] this->wrapper_pointer; - this->allocated = false; - } - if(data_array == nullptr) - { - // use this->wrapper_pointer as data_array - this->allocated = true; - this->wrapper_pointer = new T[nnr]; - ModuleBase::GlobalFunc::ZEROS(this->wrapper_pointer, nnr); - data_array = this->wrapper_pointer; - } - else - { - // use data_array to replace this->wrapper_pointer - this->wrapper_pointer = data_array; - if(is_zero) - { - ModuleBase::GlobalFunc::ZEROS(this->wrapper_pointer, nnr); - } - } - for(int it=0;itatom_pairs.size();it++) - { - this->atom_pairs[it].allocate(data_array, false); - // move data_array pointer for the next AtomPair - data_array += this->atom_pairs[it].get_R_size() * this->atom_pairs[it].get_size(); - } -} - -// set_zero -template -void HContainer::set_zero() -{ - for(auto& it : this->atom_pairs) - { - it.set_zero(); - } -} - -template -AtomPair* HContainer::find_pair(int atom_i, int atom_j) const -{ - if(atom_i >= this->sparse_ap.size()) - { - ModuleBase::WARNING_QUIT("HContainer::insert_pair", "atom_i out of range"); - } - // search atom_i and atom_j in sparse_ap - auto it = std::lower_bound(this->sparse_ap[atom_i].begin(), this->sparse_ap[atom_i].end(), atom_j); - if (it != this->sparse_ap[atom_i].end() && *it == atom_j) - { - AtomPair* tmp_pointer = const_cast*>(&this->atom_pairs[this->sparse_ap_index[atom_i][it-this->sparse_ap[atom_i].begin()]]); - return tmp_pointer; - } - else - { - return nullptr; - } -} - -// find_matrix -template -const BaseMatrix* HContainer::find_matrix(int atom_i, int atom_j, int rx, int ry, int rz) const -{ - AtomPair* tmp = this->find_pair(atom_i, atom_j); - if(tmp == nullptr) - { - return nullptr; - } - else - { - if(this->gamma_only) - { - return tmp->find_matrix(0, 0, 0); - } - else - { - return tmp->find_matrix(rx, ry, rz); - } - } -} - -template -BaseMatrix* HContainer::find_matrix(int atom_i, int atom_j, int rx, int ry, int rz) -{ - AtomPair* tmp = this->find_pair(atom_i, atom_j); - if(tmp == nullptr) - { - return nullptr; - } - else - { - if(this->gamma_only) - { - return tmp->find_matrix(0, 0, 0); - } - else - { - return tmp->find_matrix(rx, ry, rz); - } - } -} - -template -BaseMatrix* HContainer::find_matrix(int atom_i, int atom_j, const ModuleBase::Vector3& R_index) -{ - AtomPair* tmp = this->find_pair(atom_i, atom_j); - if(tmp == nullptr) - { - return nullptr; - } - else - { - if(this->gamma_only) - { - return tmp->find_matrix(0, 0, 0); - } - else - { - return tmp->find_matrix(R_index); - } - } -} - -template -const BaseMatrix* HContainer::find_matrix(int atom_i, int atom_j,const ModuleBase::Vector3& R_index) const -{ - AtomPair* tmp = this->find_pair(atom_i, atom_j); - if(tmp == nullptr) - { - return nullptr; - } - else - { - if(this->gamma_only) - { - return tmp->find_matrix(0, 0, 0); - } - else - { - return tmp->find_matrix(R_index); - } - } -} - -template -int HContainer::find_matrix_offset(int atom_i, int atom_j, int rx, int ry, int rz) const -{ - const BaseMatrix* tmp = this->find_matrix(atom_i, atom_j, rx, ry, rz); - if(tmp == nullptr) - { - return -1; - } - else - { - return tmp->get_pointer() - this->wrapper_pointer; - } -} - -template -int HContainer::find_matrix_offset(int atom_i, int atom_j, const ModuleBase::Vector3& R_index) const -{ - const BaseMatrix* tmp = this->find_matrix(atom_i, atom_j, R_index); - if(tmp == nullptr) - { - return -1; - } - else - { - return tmp->get_pointer() - this->wrapper_pointer; - } -} - -// get_atom_pair with atom_ij -template -AtomPair& HContainer::get_atom_pair(int atom_i, int atom_j) const -{ - if(atom_i >= this->sparse_ap.size()) - { - ModuleBase::WARNING_QUIT("HContainer::insert_pair", "atom_i out of range"); - } - // search atom_i and atom_j in sparse_ap - auto it = std::lower_bound(this->sparse_ap[atom_i].begin(), this->sparse_ap[atom_i].end(), atom_j); - if (it != this->sparse_ap[atom_i].end() && *it == atom_j) - { - AtomPair* tmp = const_cast*>(&this->atom_pairs[this->sparse_ap_index[atom_i][it-this->sparse_ap[atom_i].begin()]]); - return *tmp; - } - else - { - ModuleBase::WARNING_QUIT("HContainer", "atom pair not found in get_atom_pair"); - return const_cast&>(this->atom_pairs[0]); - } -} - -// get_atom_pair with index -template -AtomPair& HContainer::get_atom_pair(int index) const -{ -#ifdef __DEBUG - if (this->current_R > -1) - { - if (index >= this->tmp_atom_pairs.size() || index < 0) - { - std::cout << "Error: index out of range in get_atom_pair" << std::endl; - exit(1); - } - } - else - { - if (index >= this->atom_pairs.size() || index < 0) - { - std::cout << "Error: index out of range in get_atom_pair" << std::endl; - exit(1); - } - } -#endif - if (this->current_R > -1) - { - return const_cast&>(*this->tmp_atom_pairs[index]); - } - else - { - return const_cast&>(this->atom_pairs[index]); - } -} - -// add function -template -void HContainer::add(const HContainer& other) -{ - for(int iap=0;iapinsert_pair(tmp); - } -} - -template -bool HContainer::fix_R(int rx_in, int ry_in, int rz_in) const -{ - // clear and reallocate the memory of this->tmp_atom_pairs - //this->tmp_atom_pairs.clear(); - //this->tmp_atom_pairs.shrink_to_fit(); - //this->tmp_atom_pairs.reserve(this->atom_pairs.size()); - this->tmp_atom_pairs.resize(this->atom_pairs.size()); - int iter = 0; - // find (rx, ry, rz) in this->atom_pairs[i].R_values - for (auto it = this->atom_pairs.begin(); it != this->atom_pairs.end(); ++it) - { - if (it->find_R(rx_in, ry_in, rz_in) != -1) - { - // push bach the pointer of AtomPair to this->tmp_atom_pairs - const AtomPair* tmp_pointer = &(*it); - this->tmp_atom_pairs[iter++] = tmp_pointer; - //this->tmp_atom_pairs.push_back(tmp_pointer); - } - } - if (iter == 0) - { - std::cout << "Error: no atom pair found in fix_R" << std::endl; - this->current_R = -1; - return false; - } - else - { - //set current_R - this->current_R = this->find_R(rx_in, ry_in, rz_in); - this->tmp_atom_pairs.resize(iter); - return true; - } -} - -// unfix_R -template -void HContainer::unfix_R() const -{ - this->current_R = -1; - this->tmp_atom_pairs.clear(); - this->tmp_atom_pairs.shrink_to_fit(); -} - -// fix_gamma -template -void HContainer::fix_gamma() -{ - // every AtomPair in this->atom_pairs has the (0, 0, 0) cell index - // fix every AtomPair in this->atom_pairs to only center cell - this->gamma_only = true; -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int it =0; it< this->atom_pairs.size(); ++it) - { - this->atom_pairs[it].merge_to_gamma(); - } - // in gamma_only case, R_index is not needed, tmp_R_index should be empty - if (this->current_R != -1) - { - this->current_R = -1; - this->tmp_R_index.clear(); - this->tmp_R_index.shrink_to_fit(); - } -} - -// find_R -template -int HContainer::find_R(const int& rx_in, const int& ry_in, const int& rz_in) const -{ - // search (rx, ry, rz) in this->tmp_R_index - if (this->tmp_R_index.empty()) - { - return -1; - } - for (int i = 0; i < this->tmp_R_index.size(); i++) - { - if (this->tmp_R_index[i].x == rx_in && this->tmp_R_index[i].y == ry_in - && this->tmp_R_index[i].z == rz_in) - { - return i; - } - } - return -1; -} - -template -int HContainer::find_R(const ModuleBase::Vector3& R_in) const -{ - // search R_in in this->tmp_R_index - if (this->tmp_R_index.empty()) - { - return -1; - } - for (int i = 0; i < this->tmp_R_index.size(); i++) - { - if (this->tmp_R_index[i] == R_in) - { - return i; - } - } - return -1; -} - -// size_R_loop, return the number of different cells in this->atom_pairs -template -size_t HContainer::size_R_loop() const -{ - // R index is fixed - if (this->current_R > -1 && this->tmp_R_index.size() > 0) - { - return this->tmp_R_index.size(); - } - /** - * start a new iteration of loop_R - * there is different R-index in this->atom_pairs[i].R_values - * search them one by one and store them in this->tmp_R_index - */ - this->tmp_R_index.clear(); - for (auto it = this->atom_pairs.begin(); it != this->atom_pairs.end(); ++it) - { - /** - * search (rx, ry, rz) with (it->R_values[i].x, it->R_values[i].y, it->R_values[i].z) - * if (rx, ry, rz) not found in this->tmp_R_index, - * insert the (rx, ry, rz) into end of this->tmp_R_index - * no need to sort this->tmp_R_index, using find_R() to find the (rx, ry, rz) -> int in tmp_R_index - */ - for (int iR = 0; iR < it->get_R_size(); iR++) - { - const ModuleBase::Vector3 r_vec = it->get_R_index(iR); - int it_tmp = this->find_R(r_vec); - if (it_tmp == -1) - { - this->tmp_R_index.push_back(ModuleBase::Vector3(r_vec)); - } - } - } - return this->tmp_R_index.size(); -} - -template -void HContainer::loop_R(const size_t& index, int& rx, int& ry, int& rz) const -{ -#ifdef __DEBUG - if (index >= this->tmp_R_index.size()) - { - std::cout << "Error: index out of range in loop_R" << std::endl; - exit(1); - } -#endif - // set rx, ry, rz - rx = this->tmp_R_index[index].x; - ry = this->tmp_R_index[index].y; - rz = this->tmp_R_index[index].z; - return; -} - -// get_AP_size -template -size_t HContainer::size_atom_pairs() const -{ - // R index is fixed - if (this->current_R > -1) - { - return this->tmp_atom_pairs.size(); - } - // R index is not fixed - else - { - return this->atom_pairs.size(); - } -} - -// data() interface with atom_i and atom_j -template -T* HContainer::data(int atom_i, int atom_j) const -{ - AtomPair* atom_ij = this->find_pair(atom_i, atom_j); - if (atom_ij != nullptr) - { - return atom_ij->get_pointer(); - } - else - { - std::cout << "Error: atom pair not found in data()" << std::endl; - return nullptr; - } -} - -// data() interface with atom_i and atom_j ad R_pointer -template -T* HContainer::data(int atom_i, int atom_j, int* R_pointer) const -{ - AtomPair* atom_ij = this->find_pair(atom_i, atom_j); - if (atom_ij != nullptr) - { - return atom_ij->get_HR_values(R_pointer[0], R_pointer[1], R_pointer[2]).get_pointer(); - } - else - { - std::cout << "Error: atom pair not found in data()" << std::endl; - return nullptr; - } -} - -// insert_pair -template -void HContainer::insert_pair(const AtomPair& atom_ij) -{ - int atom_i = atom_ij.get_atom_i(); - if(atom_i >= this->sparse_ap.size()) - { - ModuleBase::WARNING_QUIT("HContainer::insert_pair", "atom_i out of range"); - } - int atom_j = atom_ij.get_atom_j(); - // find atom_ij in this->atom_pairs - // 1. find the index of atom_j in sparse_ap[atom_i] - auto it = std::lower_bound(this->sparse_ap[atom_i].begin(), - this->sparse_ap[atom_i].end(), atom_j); - if (it != this->sparse_ap[atom_i].end() && *it == atom_j) - { - // 2. merge atom_ij - this->atom_pairs[this->sparse_ap_index[atom_i][it-this->sparse_ap[atom_i].begin()]].merge(atom_ij, this->gamma_only); - } - else - { - // 3. insert atom_ij - // check paraV pointer - if (this->paraV != atom_ij.get_paraV()) - { - ModuleBase::WARNING_QUIT("HContainer::insert_pair", "atom_ij has different paraV pointer as HContainer"); - } - else - { //insert atom_ij, and set paraV pointer for HContainer if atom_ij has paraV pointer - this->atom_pairs.push_back(atom_ij); - //if gamma_only case, merge atom_ij to gamma_only - if(this->gamma_only) - { - this->atom_pairs.back().merge_to_gamma(); - } - // update sparse_ap - int index = it - this->sparse_ap[atom_i].begin(); - if(it != this->sparse_ap[atom_i].end()) - { - this->sparse_ap[atom_i].insert(this->sparse_ap[atom_i].begin() + index, atom_j); - this->sparse_ap_index[atom_i].insert(this->sparse_ap_index[atom_i].begin() + index, this->atom_pairs.size() - 1); - } - else - { - this->sparse_ap[atom_i].push_back(atom_j); - this->sparse_ap_index[atom_i].push_back(this->atom_pairs.size() - 1); - } - } - } -} - -//operator() is not implemented now, this interface is too expensive to access data -/*template -T& HContainer::operator()(int atom_i, int atom_j, int rx_in, int ry_in, int rz_in, int mu, int nu) const -{ - return this->get_atom_pair(atom_i, atom_j).get_HR_values(rx_in, ry_in, rz_in).get_value(mu, nu); -}*/ - -//get_current_R -template -int HContainer::get_current_R() const -{ - return this->current_R; -} - -//is_gamma_only -template -bool HContainer::is_gamma_only() const -{ - return this->gamma_only; -} - -//get_memory_size -template -size_t HContainer::get_memory_size() const -{ - size_t memory = sizeof(*this); - memory += this->atom_pairs.capacity() * sizeof(AtomPair); - memory += this->sparse_ap.capacity() * sizeof(std::vector); - memory += this->sparse_ap_index.capacity() * sizeof(std::vector); - for(int i=0;iatom_pairs.size();++i) - { - memory += this->atom_pairs[i].get_memory_size(); - } - for(int i=0;isparse_ap.size();++i) - { - memory += this->sparse_ap[i].capacity() * sizeof(int); - memory += this->sparse_ap_index[i].capacity() * sizeof(int); - } - memory += this->tmp_atom_pairs.capacity() * sizeof(AtomPair*); - memory += this->tmp_R_index.capacity() * sizeof(ModuleBase::Vector3); - if(this->allocated) - { - memory += this->get_nnr() * sizeof(T); - } - return memory; -} - -// synchronize -template -void HContainer::shape_synchron( const HContainer& other) -{ - // check paraV pointer - if (this->paraV != other.paraV) - { - ModuleBase::WARNING_QUIT("HContainer::synchronize", "paraV pointer not match"); - } - // synchronize atom_pairs - for (int i = 0; i < other.atom_pairs.size(); ++i) - { - const int iat1 = other.atom_pairs[i].get_atom_i(); - const int iat2 = other.atom_pairs[i].get_atom_j(); - AtomPair* tmp_pointer = this->find_pair(iat1, iat2); - if (tmp_pointer == nullptr) - { - this->insert_pair(other.atom_pairs[i]); - // the new AtomPair should be zero - this->atom_pairs.back().set_zero(); - } - else - { - for(int ir = 0;ir < other.atom_pairs[i].get_R_size();++ir) - { - const ModuleBase::Vector3 R_vec = other.atom_pairs[i].get_R_index(ir); - if(tmp_pointer->find_R(R_vec) != -1) - { - // do nothing - } - else - { - // insert the new BaseMatrix - tmp_pointer->get_HR_values(R_vec.x, R_vec.y, R_vec.z); - } - } - } - } -} - -// get_IJR_info -template -std::vector HContainer::get_ijr_info() const -{ - // get number of atom pairs - std::vector ijr_info; - ijr_info.push_back(this->atom_pairs.size()); - // loop atom pairs - for (int i = 0; i < this->atom_pairs.size(); ++i) - { - // get atom_i and atom_j - const int atom_i = this->atom_pairs[i].get_atom_i(); - const int atom_j = this->atom_pairs[i].get_atom_j(); - // push back atom_i, atom_j - ijr_info.push_back(atom_i); - ijr_info.push_back(atom_j); - // get number of R - const int number_R = this->atom_pairs[i].get_R_size(); - ijr_info.push_back(number_R); - // loop R - for (int ir = 0; ir < number_R; ++ir) - { - const ModuleBase::Vector3 R_vec = this->atom_pairs[i].get_R_index(ir); - ijr_info.push_back(R_vec.x); - ijr_info.push_back(R_vec.y); - ijr_info.push_back(R_vec.z); - } - } - return ijr_info; -} - -template -void HContainer::insert_ijrs(const std::vector* ijrs) -{ - if (this->paraV == nullptr) - { - ModuleBase::WARNING_QUIT("HContainer::insert_ijrs", "paraV pointer can not be nullptr!"); - } - // get number of atom pairs - const int number_ap = (*ijrs)[0]; - // loop AtomPairs and unpack values - const int* ijr_p = ijrs->data() + 1; - for (int i = 0; i < number_ap; ++i) - { - // get atom_i and atom_j - const int atom_i = *ijr_p++; - const int atom_j = *ijr_p++; - // get number of R - const int number_R = *ijr_p++; - for (int k = 0; k < number_R; ++k) - { - int r_index[3]; - // get R index - r_index[0] = *ijr_p++; - r_index[1] = *ijr_p++; - r_index[2] = *ijr_p++; - //insert this IJ AtomPair - AtomPair tmp_ap(atom_i, atom_j, r_index[0], r_index[1], r_index[2], this->paraV); - this->insert_pair(tmp_ap); - } - } -} - -template -void HContainer::insert_ijrs(const std::vector* ijrs, const UnitCell& ucell, const int npol) -{ - // prepare the row_index and col_index for construct AtomPairs, they are - // same, name as orb_index - std::vector orb_index(ucell.nat + 1); - orb_index[0] = 0; - for (int i = 1; i < orb_index.size(); i++) { - int type = ucell.iat2it[i - 1]; - orb_index[i] = orb_index[i - 1] + ucell.atoms[type].nw * npol; - } - - // get number of atom pairs - const int number_ap = (*ijrs)[0]; - // loop AtomPairs and unpack values - const int* ijr_p = ijrs->data() + 1; - for (int i = 0; i < number_ap; ++i) - { - // get atom_i and atom_j - const int atom_i = *ijr_p++; - const int atom_j = *ijr_p++; - // get number of R - const int number_R = *ijr_p++; - for (int k = 0; k < number_R; ++k) - { - int r_index[3]; - // get R index - r_index[0] = *ijr_p++; - r_index[1] = *ijr_p++; - r_index[2] = *ijr_p++; - //insert this IJ AtomPair - AtomPair tmp_ap(atom_i, atom_j, r_index[0], r_index[1], r_index[2], orb_index.data(), orb_index.data(), ucell.nat); - this->insert_pair(tmp_ap); - } - } -} - -// T of HContainer can be double or complex -template class HContainer; -template class HContainer>; - -} // end namespace hamilt \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/hcontainer.h b/source/module_hamilt_lcao/module_hcontainer/hcontainer.h deleted file mode 100644 index edaca9577e..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/hcontainer.h +++ /dev/null @@ -1,507 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_HCONTAINER_HCONTAINER_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_HCONTAINER_HCONTAINER_H - -#include "atom_pair.h" -#include "source_base/vector3.h" -#include "source_cell/unitcell.h" - -#include -#include - -namespace hamilt -{ - -/** - * class HContainer - * used to store a matrix for atom-pair local Hamiltonian with specific R-index - * ---------------------------------------- - * - * ---------------------------------------- - * template T can be double or complex - * - * examples for using this class: - * 1. initialize a HContainer - * a. use unitcell to initialize atom_pairs - * ``` - * // ucell is a UnitCell object - * // in this method, all empty atom-pairs will be initialized in HR - * // atom-pairs are sorted by matrix of (i, j) - * HContainer HR(ucell, nullptr); // serial case - * HContainer HR(ucell, paraV); // 2d-block-recycle parallel case - * ``` - * b. use insert_pair() to insert atom-pair - * ``` - * HContainer HR; - * AtomPair atom_ij... - * HR.insert_pair(atom_ij); - * // allocate is nessasary if atom-pairs are inserted - * HR.allocate(nullptr, 0); // arrange memory by HContainer - * HR.allocate(data_array, 0); // use data_array as memory pool - * ``` - * c. use Parallel_Orbital to initialize atom_pairs and HContainer - * ``` - * // paraV is a Parallel_Orbital object, 2d-block-recycle parallel case - * HCotainer HR(paraV); - * // initialize a new AtomPair with atom paraV - * AtomPair atom_ij(0, 1, paraV); - * // insert atom_ij into HR - * HR.insert_pair(atom_ij); - * ``` - * 2. get target AtomPair with index of atom I and J, or with index in atom_pairs - * a. use interface find_pair() to get pointer of target AtomPair - * ``` - * // HR is a HContainer object - * AtomPair* atom_ij = HR.find_pair(0, 1); - * // check if atom_ij is found - * if (atom_ij != nullptr) - * { - * // do something - * } - * ``` - * b. use interface get_atom_pair() to get reference of target AtomPair - * ``` - * // HR is a HContainer object - * AtomPair& atom_ij_1 = HR.get_atom_pair(0, 1); - * AtomPair& atom_ij_2 = HR.get_atom_pair(1);//suppose 0,1 is the second atom-pair in atom_pairs - * ``` - * 3. get data pointer of target local matrix - * a. use interface data() with atom_i and atom_j and R index - * ``` - * // HR is a HContainer object - * // suppose atom_i = 0, atom_j = 1, int[3] target_R = {0, 0, 0} - * double* target_data = HR.data(0, 1, target_R); - * ``` - * b. fix_R and use data() with atom_i and atom_j without R index - * ``` - * HR.fix_R(0, 0, 0); - * double* target_data = HR.data(0, 1); - * HR.unfix_R(); - * ``` - * 4. use for-loop to do something with atom-pairs with specific R index - * a. loop R-index first and then loop atom-pairs - * ``` - * // HR is a const HContainer object, which has been initialized - * int rx, ry, rz; - * // call size_R_loop() to get number of different R indexes, - * // be careful, it will cost some time to loop all atom-pairs to gather R indexes - * int size_for_loop_R = HR.size_R_loop(); - * for (int iR = 0; iR < size_for_loop_R ; iR++) - * { - * // call loop_R() to get R coordinates (rx, ry, rz) - * HR.loop_R(iR, rx, ry, rz); - * // call fix_R() to save atom-pairs with R index (rx, ry, rz) into tmp_atom_pairs - * HR.fix_R(rx, ry, rz); - * // loop fixed atom-pairs - * for (int i = 0; i < HR.size_atom_pairs(); i++) - * { - * // get pointer of target atom-pair - * double* data_pointer = HR.data(i); - * // or get reference of target atom-pair - * AtomPair& atom_ijR = HR.get_atom_pair(i); - * // do something with atom_ijR or data_pointer - * ... - * } - * } - * // call unfix_R() to clear tmp_atom_pairs - * HR.unfix_R(); - * ``` - * b. loop atom-pairs first and then loop R-index - * ``` - * // HR is a const HContainer object, which has been initialized - * // loop atom-pairs - * for (int i = 0; i < HR.size_atom_pairs(); i++) - * { - * // get reference of target atom-pair - * AtomPair& atom_ij = HR.get_atom_pair(i); - * // loop R-index - * for (int iR = 0; iR < atom_ij.size_R(); iR++) - * { - * const ModuleBase::Vector3 r_index = atom_ij.get_R_index(iR); - * auto tmp_matrix = atom_ij.get_HR_values(r_index.x, r_index.y, r_index.z); - * // do something with tmp_matrix - * ... - * } - * } - * ``` - * c. loop atom-pairs with gamma_only case - * ``` - * ... - * HR.fix_gamma(); - * // HR is a const HContainer object, which has been initialized and fixed to gamma - * // loop atom-pairs directly without R index - * for (int i = 0; i < HR.size_atom_pairs(); i++) - * { - * // get data pointer of target atom-pair - * double* data_pointer = HR.get_pointer(i); - * // do something with data_pointer - * ... - * } - * ``` - * - */ -template -class HContainer -{ - public: - // Destructor of class HContainer - ~HContainer(); - - HContainer(); - - /** - * @brief copy constructor - * when data_array is not nullptr, new HContainer will be wrapper for data_array - * data of HR_in will not be copied, please call add() after this constructor to copy data. - */ - HContainer(const HContainer& HR_in, T* data_array = nullptr); - - // move constructor - HContainer(HContainer&& HR_in) noexcept; - // move assignment - HContainer& operator=(HContainer&& HR_in) noexcept; - - // simple constructor - HContainer(int natom); - - // use unitcell to initialize atom_pairs - HContainer(const UnitCell& ucell_, const Parallel_Orbitals* paraV = nullptr); - - /** - * @brief use 2d-block-recycle parallel case to initialize atom_pairs, mainly used now. - * pass a data pointer to HContainer, which means HContainer is a wrapper - * it will not allocate memory for atom_pairs - * this case will forbit inserting empty atom_pair - */ - HContainer(const Parallel_Orbitals* paraV, T* data_pointer = nullptr, const std::vector* ijr_info = nullptr); - - /** - * @brief set parallel orbital pointer to check parallel information - */ - void set_paraV(const Parallel_Orbitals* paraV_in) - { - this->paraV = paraV_in; - for (auto& ap : atom_pairs) ap.set_paraV(paraV_in); - }; - /** - * @brief get parallel orbital pointer to check parallel information - * @return const Parallel_Orbitals* , if return is nullptr, it means HContainer is not in parallel mode - */ - const Parallel_Orbitals* get_paraV() const { return this->paraV; }; - - /** - * @brief allocate memory for all matrix - * if data_array is not nullptr, - * use memory after data_array for each BaseMatrix; - * if BaseMatrix has memory allocated before, it will be freed first. - * if data_array is nullptr, allocate memory for each BaseMatrix - * @param data_array pointer of data array - * @param if_zero if true, set all values to zero - */ - void allocate(T* data_array = nullptr, bool if_zero = false); - - /** - * @brief set values of all matrix to zero - */ - void set_zero(); - - /** - * @brief a AtomPair object can be inserted into HContainer, two steps: - * 1, find AtomPair with atom index atom_i and atom_j - * 2.1, if found, add to exist AtomPair, - * 2.2, if not found, insert new one and sort. - * - * @param atom_ij AtomPair object - */ - void insert_pair(const AtomPair& atom_ij); - - /** - * @brief find AtomPair with atom index atom_i and atom_j - * This interface can be used to find AtomPair, - * if found, return pointer will be the exist one, - * if not found, return pointer will be nullptr. - * - * @param i atom index of atom i - * @param j atom index of atom j - * @return AtomPair* - */ - AtomPair* find_pair(int i, int j) const; - - /** - * @brief find BaseMatrix with atom index atom_i and atom_j and R index (rx, ry, rz) - * This interface can be used to find BaseMatrix in AtomPair, - * if found, return pointer will be the exist one, - * if not found, return pointer will be nullptr. - */ - BaseMatrix* find_matrix(int i, int j, int rx, int ry, int rz); - const BaseMatrix* find_matrix(int i, int j, int rx, int ry, int rz) const; - BaseMatrix* find_matrix(int i, int j, const ModuleBase::Vector3& R_index); - const BaseMatrix* find_matrix(int i, int j, const ModuleBase::Vector3& R_index) const; - - /** - * @brief find the offset of BaseMatrix with atom index atom_i and atom_j and R index (rx, ry, rz) - * if found, return this->find_matrix(i, j, rx, ry, rz)->get_pointer() - this->get_wrapper(); - * if not found, return -1 - */ - int find_matrix_offset(int i, int j, int rx, int ry, int rz) const; - int find_matrix_offset(int i, int j, const ModuleBase::Vector3& R_index) const; - - /** - * @brief return a reference of AtomPair with index of atom I and J in atom_pairs - * - * @param i index of atom i - * @param j index of atom j - */ - AtomPair& get_atom_pair(int i, int j) const; - /** - * @brief return a reference of AtomPair with index in - * atom_pairs (R is not fixed) - * tmp_atom_pairs (R is fixed) - * - * @param index index of atom-pair - */ - AtomPair& get_atom_pair(int index) const; - - /** - * @brief operator() for accessing value with indexes - * this interface is not implemented now, because it is too expensive to access data - * - * @param atom_i index of atom i - * @param atom_j index of atom j - * @param rx_in index of R in x direction - * @param ry_in index of R in y direction - * @param rz_in index of R in z direction - * @param mu index of orbital mu - * @param nu index of orbital nu - * @return T& - */ - // T& operator()(int atom_i, int atom_j, int rx_in, int ry_in, int rz_in, int mu, int nu) const; - - /** - * @brief add another HContainer to this HContainer - */ - void add(const HContainer& other); - - // save atom-pair pointers into this->tmp_atom_pairs for selected R index - /** - * @brief save atom-pair pointers into this->tmp_atom_pairs for selected R index - * - * @param rx_in index of R in x direction - * @param ry_in index of R in y direction - * @param rz_in index of R in z direction - * @return true if success - */ - bool fix_R(int rx_in, int ry_in, int rz_in) const; - - /** - * @brief set current_R to -1, which means R is not fixed - * clear this->tmp_atom_pairs - */ - void unfix_R() const; - - /** - * @brief restrict R indexes of all atom-pair to 0, 0, 0 - * add BaseMatrix with non-zero R index to this->atom_pairs[i].values[0] - * set gamma_only = true - * in this mode: - * 1. fix_R() can not be used - * 2. there is no interface to set gamma_only = false, user should create a new HContainer if needed - * 3. get_size_for_loop_R() and loop_R() can not be used - * 4. get_AP_size() can be used - * 5. data(i, j) can be used to get pointer of target atom-pair with R = 0, 0, 0 , data(i,j,R) can not be used - * 6. insert_pair() can be safely used, but the R index will be ignored - * 7. find_matrix() can be safely used, but the R index will be ignored - * 8. operator() can be used, but the R index will be ignored - * 9. get_atom_pair(), find_atom_pair() can be used, be careful that AtomPair::get_HR_values() is dangerous in - * this mode. - */ - void fix_gamma(); - - // interface for call a R loop for HContainer - // it can return a new R-index with (rx,ry,rz) for each loop - // if index==0, a new loop of R will be initialized - /** - * @brief interface for call a R loop for HContainer - * it can return a new R-index with (rx,ry,rz) for each loop - * if index==0, a new loop of R will be initialized - * - * @param index index of R loop - * @param rx index of R in x direction, would be set in the function - * @param ry index of R in y direction, would be set in the function - * @param rz index of R in z direction, would be set in the function - */ - void loop_R(const size_t& index, int& rx, int& ry, int& rz) const; - - /** - * @brief calculate number of R index which has counted AtomPairs - */ - size_t size_R_loop() const; - - - /** - * @brief find index of R in tmp_R_index, used when current_R is fixed - * - * @param rx_in index of R in x direction - * @param ry_in index of R in y direction - * @param rz_in index of R in z direction - * @return int index of R in tmp_R_index - */ - int find_R(const int& rx_in, const int& ry_in, const int& rz_in) const; - int find_R(const ModuleBase::Vector3& R_in) const; - - /** - * @brief calculate number of AtomPairs for current R index - */ - size_t size_atom_pairs() const; - - /** - * @brief get data pointer of AtomPair with index of I, J - * - * @param i index of atom i - * @param j index of atom j - * @return T* pointer of data - */ - T* data(int i, int j) const; - - /** - * @brief get data pointer of AtomPair with index of I, J, Rx, Ry, Rz - * - * @param i index of atom i - * @param j index of atom j - * @param R int[3] of R index - * @return T* pointer of data - */ - T* data(int i, int j, int* R) const; - - /** - * @brief get current_R - */ - int get_current_R() const; - - /** - * @brief judge if gamma_only - */ - bool is_gamma_only() const; - - /** - * @brief get total memory bites of HContainer - */ - size_t get_memory_size() const; - - /** - * @brief calculate total size of data in HContainer, - * named nnr inherited from history - * all AtomPairs and BaseMatrixs are counted - */ - size_t get_nnr() const - { - size_t sum = 0; - for (int iap = 0; iap < this->atom_pairs.size(); ++iap) - { - sum += this->atom_pairs[iap].get_R_size() * this->atom_pairs[iap].get_size(); - } - return sum; - } - - /** - * @brief get infomation of IJR pairs in HContainer - * the return vector format is {size_I, I1, size_J, J1, size_R, R1x, R1y, R1z, ..., J2, ...} - */ - std::vector get_ijr_info() const; - - /** - * @brief use infomation of IJ pairs to expand HContainer - * the input vector format is {size_IJ_pairs, I1, J1, size_R, R1x, R1y, R1z, ..., I2, J2, ...} - * HContainer has not been allocated after this function, - * user should call allocate(...) to allocate memory. - */ - void insert_ijrs(const std::vector* ijrs); - - /** - * @brief use infomation of IJ pairs to expand HContainer - * the number of wavefunctions are stored in UnitCell. - * HContainer has not been allocated after this function, - * user should call allocate(...) to allocate memory. - */ - void insert_ijrs(const std::vector* ijrs, const UnitCell& ucell, const int npol=1); - - /** - * @brief return the wrapper_pointer - */ - T* get_wrapper() const - { - return this->wrapper_pointer; - } - - /** - * @brief synchronization of atom-pairs for read-in HContainer - * new pair from read-in HContainer will be inserted into this->atom-pairs - */ - void shape_synchron(const HContainer& other); - - /** - * @brief get sparse_ap - * @return std::vector>& - */ - const std::vector>& get_sparse_ap() const - { - return sparse_ap; - } - - /** - * @brief get sparse_ap_index - * @return std::vector>& - */ - const std::vector>& get_sparse_ap_index() const - { - return sparse_ap_index; - } - - /** - * @brief get number of basis in each H matrix - * @return int - */ - int get_nbasis() const - { - return paraV->get_global_row_size(); - } - - private: - // i-j atom pairs, sorted by matrix of (atom_i, atom_j) - std::vector> atom_pairs; - - // sparse table for (atom_i, atom_j)->index of atom_pairs - std::vector> sparse_ap; - std::vector> sparse_ap_index; - - /** - * @brief temporary atom-pair lists to loop selected R index - */ - mutable std::vector*> tmp_atom_pairs; - // it contains 3 index of cell, size of R_index is three times of values. - mutable std::vector> tmp_R_index; - // current index of R in tmp_atom_pairs, -1 means not initialized - mutable int current_R = -1; - - bool gamma_only = false; - - /** - * @brief if wrapper_pointer is not nullptr, this HContainer is a wrapper - * there is only one case that "wrapper_pointer == nullptr": - * HContainer is constructed by allocated AtomPairs by insert_pair() - * in other cases, wrapper_pointer is not nullptr and is memory pool of AtomPairs - */ - T* wrapper_pointer = nullptr; - bool allocated = false; - - /** - * @brief pointer of Parallel_Orbitals, which is used to get atom-pair information - */ - const Parallel_Orbitals* paraV = nullptr; - - // int multiple = 1; - // int current_multiple = 0; -}; - -} // namespace hamilt - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h b/source/module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h deleted file mode 100644 index 2243f05ba3..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once - -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -namespace hamilt -{ -/** - * @brief calculate the Hk matrix with specific k vector - * @param hR the HContainer of atom pairs - * @param hk the data pointer of Hk matrix, the size of hk would be nrow * ncol - * @param kvec_d_in the k vector in Direct coordinate - * @param hk_ld the leading dimension number of hk, ncol for row-major, nrow for column-major - * @param hk_type the data-type of hk, 0 is row-major, 1 is column-major -*/ -template -void folding_HR(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int hk_ld, - const int hk_type); - -void folding_HR(const hamilt::HContainer& hR, - double* hk, - const ModuleBase::Vector3& kvec_d_in, - const int hk_ld, - const int hk_type); - -#ifdef __MPI -/** - * @brief transfer the HContainer from serial object to parallel object - * @param hR_s the HContainer of atom pairs in serial object - * @param hR_p the HContainer of atom pairs in parallel object - * @param my_rank the rank of current process -*/ -template -void transferSerial2Parallels(const hamilt::HContainer& hR_s, - hamilt::HContainer* hR_p, - const int serial_rank); -/** - * @brief transfer the HContainer from parallel object to serial object - * @param hR_p the HContainer of atom pairs in parallel object - * @param hR_s the HContainer of atom pairs in serial object - * @param my_rank the rank of current process -*/ -template -void transferParallels2Serial(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s, - const int serial_rank); - -/** - * @brief transfer the HContainer from all serial objects to all parallel objects - * @param hR_s the HContainer of atom pairs in serial object - * @param hR_p the HContainer of atom pairs in parallel object -*/ -template -void transferSerials2Parallels(const hamilt::HContainer& hR_s, - hamilt::HContainer* hR_p); - -/** - * @brief transfer the HContainer from all serial objects to all parallel objects - * @param hR_p the HContainer of atom pairs in parallel object - * @param hR_s the HContainer of atom pairs in serial object -*/ -template -void transferParallels2Serials(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s); - -/** - * @brief gather the HContainer from all parallel objects to target serial object - * the serial object should be empty before gather - * @param hR_p the HContainer of atom pairs in parallel object - * @param hR_s the empty HContainer of atom pairs in serial object - * @param serial_rank the rank of target serial object -*/ -template -void gatherParallels(const hamilt::HContainer& hR_p, - hamilt::HContainer* hR_s, - const int serial_rank); - -#endif // __MPI - -} // namespace hamilt \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/output_hcontainer.cpp b/source/module_hamilt_lcao/module_hcontainer/output_hcontainer.cpp deleted file mode 100644 index 58b939e56f..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/output_hcontainer.cpp +++ /dev/null @@ -1,138 +0,0 @@ -#include "output_hcontainer.h" - -#include "module_io/sparse_matrix.h" - -#include - -namespace hamilt -{ - -/** - * @brief Constructor of Output_HContainer - * @attention ofs should be open outside of this interface - */ -template -Output_HContainer::Output_HContainer(hamilt::HContainer* hcontainer, - std::ostream& ofs, - double sparse_threshold, - int precision) - : _hcontainer(hcontainer), _ofs(ofs), _sparse_threshold(sparse_threshold), _precision(precision) -{ - if (this->_sparse_threshold == -1) - { - this->_sparse_threshold = 1e-10; - } - if (this->_precision == -1) - { - this->_precision = 8; - } -} - -template -void Output_HContainer::write(bool write_empty) -{ - int size_for_loop_R = this->_hcontainer->size_R_loop(); - int rx, ry, rz; - int R_range[2] = {0, 0}; - // find the range of R - for (int iR = 0; iR < size_for_loop_R; iR++) - { - this->_hcontainer->loop_R(iR, rx, ry, rz); - int max_R = std::max({rx, ry, rz}); - int min_R = std::min({rx, ry, rz}); - if (max_R > R_range[1]) - { - R_range[1] = max_R; - } - if (min_R < R_range[0]) - { - R_range[0] = min_R; - } - } - // write in order of R - for (int ix = R_range[0]; ix <= R_range[1]; ix++) - { - for (int iy = R_range[0]; iy <= R_range[1]; iy++) - { - for (int iz = R_range[0]; iz <= R_range[1]; iz++) - { - if (this->_hcontainer->find_R(ix, iy, iz) != -1) - { - this->write_single_R(ix, iy, iz); - } - else if (write_empty) - { - _ofs << ix << " " << iy << " " << iz << " 0" << std::endl; - } - - } - } - } -} - -template -void Output_HContainer::write(int rx_in, int ry_in, int rz_in) -{ - int size_for_loop_R = this->_hcontainer->size_R_loop(); - int rx, ry, rz; - int find_R = 0; - for (int iR = 0; iR < size_for_loop_R; iR++) - { - this->_hcontainer->loop_R(iR, rx, ry, rz); - if (rx == rx_in && ry == ry_in && rz == rz_in) - { - find_R += 1; - this->write_single_R(rx, ry, rz); - break; - } - } - if (find_R == 0) - { - ModuleBase::WARNING_QUIT("Output_HContainer::write", "Cannot find the R vector from the HContainer."); - } -} - -template -void Output_HContainer::write_single_R(int rx, int ry, int rz) -{ - if (this->_hcontainer->get_paraV() == nullptr) - { - ModuleBase::WARNING_QUIT("Output_HContainer::write_single_R", "paraV is nullptr! Unable to write the matrix."); - } - this->_hcontainer->fix_R(rx, ry, rz); - - ModuleIO::SparseMatrix sparse_matrix - = ModuleIO::SparseMatrix(_hcontainer->get_nbasis(), _hcontainer->get_nbasis()); - assert(_hcontainer->get_nbasis()>0); - - sparse_matrix.setSparseThreshold(this->_sparse_threshold); - - for (int iap = 0; iap < this->_hcontainer->size_atom_pairs(); ++iap) - { - auto atom_pair = this->_hcontainer->get_atom_pair(iap); - auto tmp_matrix_info = atom_pair.get_matrix_values(); - int* tmp_index = std::get<0>(tmp_matrix_info).data(); - T* tmp_data = std::get<1>(tmp_matrix_info); - for (int irow = tmp_index[0]; irow < tmp_index[0] + tmp_index[1]; ++irow) - { - for (int icol = tmp_index[2]; icol < tmp_index[2] + tmp_index[3]; ++icol) - { - sparse_matrix.insert(irow, icol, *tmp_data); - tmp_data++; - // to do: consider 2D block-cyclic distribution - } - } - } - - if (sparse_matrix.getNNZ() != 0) - { - _ofs << rx << " " << ry << " " << rz << " " << sparse_matrix.getNNZ() << std::endl; - sparse_matrix.printToCSR(_ofs, _precision); - } - this->_hcontainer->unfix_R(); -} - -template class Output_HContainer; -template class Output_HContainer>; - -} // namespace hamilt \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/output_hcontainer.h b/source/module_hamilt_lcao/module_hcontainer/output_hcontainer.h deleted file mode 100644 index ea2226b313..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/output_hcontainer.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef OUTPUT_HCONTAINER_H -#define OUTPUT_HCONTAINER_H - -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -namespace hamilt -{ - -/** - * @brief A class to output the HContainer - */ -template -class Output_HContainer -{ - public: - Output_HContainer(hamilt::HContainer* hcontainer, std::ostream& ofs, double sparse_threshold = -1, int precision = -1); - // write the matrices of all R vectors to the output stream - void write(bool write_empty = false); - - /** - * write the matrix of a single R vector to the output stream - * rx_in, ry_in, rz_in: the R vector from the input - */ - void write(int rx_in, int ry_in, int rz_in); - - /** - * write the matrix of a single R vector to the output stream - * rx, ry, rz: the R vector from the HContainer - */ - void write_single_R(int rx, int ry, int rz); - - private: - hamilt::HContainer* _hcontainer; - std::ostream& _ofs; - double _sparse_threshold; - int _precision; -}; - -} // namespace hamilt - -#endif // OUTPUT_HCONTAINER_H \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/test/CMakeLists.txt b/source/module_hamilt_lcao/module_hcontainer/test/CMakeLists.txt deleted file mode 100644 index e27e4c41aa..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/CMakeLists.txt +++ /dev/null @@ -1,74 +0,0 @@ - -if(ENABLE_LCAO) -AddTest( - TARGET hcontainer_test - LIBS parameter ${math_libs} psi base device - SOURCES test_hcontainer.cpp ../base_matrix.cpp ../hcontainer.cpp ../atom_pair.cpp - ../../../source_basis/module_ao/parallel_orbitals.cpp tmp_mocks.cpp -) - -AddTest( - TARGET hcontainer_complex_test - LIBS parameter ${math_libs} psi base device - SOURCES test_hcontainer_complex.cpp ../base_matrix.cpp ../hcontainer.cpp ../atom_pair.cpp - ../../../source_basis/module_ao/parallel_orbitals.cpp tmp_mocks.cpp -) - -AddTest( - TARGET hcontainer_cost_test - LIBS parameter ${math_libs} psi base device - SOURCES test_hcontainer_time.cpp ../base_matrix.cpp ../hcontainer.cpp ../atom_pair.cpp - ../../../source_basis/module_ao/parallel_orbitals.cpp tmp_mocks.cpp -) - -AddTest( - TARGET hcontainer_folding_test - LIBS parameter ${math_libs} psi base device - SOURCES test_func_folding.cpp ../base_matrix.cpp ../hcontainer.cpp ../atom_pair.cpp - ../func_folding.cpp ../../../source_basis/module_ao/parallel_orbitals.cpp tmp_mocks.cpp -) - -AddTest( - TARGET hcontainer_transfer_test - LIBS parameter ${math_libs} psi base device - SOURCES test_transfer.cpp ../func_transfer.cpp ../base_matrix.cpp ../hcontainer.cpp ../atom_pair.cpp - ../transfer.cpp ../../../source_basis/module_ao/parallel_orbitals.cpp tmp_mocks.cpp -) - -install(FILES parallel_hcontainer_tests.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -find_program(BASH bash) -add_test(NAME hontainer_para_test - COMMAND ${BASH} parallel_hcontainer_tests.sh - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET hcontainer_output_test - LIBS parameter base ${math_libs} device - SOURCES test_hcontainer_output.cpp - tmp_mocks.cpp - ../output_hcontainer.cpp - ../base_matrix.cpp - ../hcontainer.cpp - ../atom_pair.cpp - ../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../module_io/sparse_matrix.cpp -) - -install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - -AddTest( - TARGET hcontainer_readCSR_test - LIBS parameter base ${math_libs} device cell_info - SOURCES test_hcontainer_readCSR.cpp - ../base_matrix.cpp - ../hcontainer.cpp - ../atom_pair.cpp - ../output_hcontainer.cpp - ../../../source_basis/module_ao/parallel_orbitals.cpp - ../../../module_io/sparse_matrix.cpp - ../../../module_io/csr_reader.cpp - ../../../module_io/file_reader.cpp - ../../../module_io/output.cpp -) -endif() \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/test/parallel_hcontainer_tests.sh b/source/module_hamilt_lcao/module_hcontainer/test/parallel_hcontainer_tests.sh deleted file mode 100644 index fdf3737cac..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/parallel_hcontainer_tests.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -e - -np=`cat /proc/cpuinfo | grep "cpu cores" | uniq| awk '{print $NF}'` -echo "nprocs in this machine is $np" - -for i in 2 3 4; do - if [[ $i -gt $np ]];then - continue - fi - echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./hcontainer_transfer_test - if [[ $? -ne 0 ]]; then - echo -e "\e[1;33m [ FAILED ] \e[0m"\ - "execute UT with $i cores error." - exit 1 - fi -done diff --git a/source/module_hamilt_lcao/module_hcontainer/test/prepare_unitcell.h b/source/module_hamilt_lcao/module_hcontainer/test/prepare_unitcell.h deleted file mode 100644 index 3f0f58cabd..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/prepare_unitcell.h +++ /dev/null @@ -1,384 +0,0 @@ -#ifndef PREPARE_UNITCELL_H -#define PREPARE_UNITCELL_H -#include -#include -#include "source_base/mathzone.h" - -class UcellTestPrepare -{ -public: - UcellTestPrepare()=default; - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in); - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in); - UcellTestPrepare(const UcellTestPrepare &utp); - - std::string latname; - int lmaxmax; - bool init_vel; - bool selective_dynamics; - bool relax_new; - std::string fixed_axes; - double lat0; - std::valarray latvec; - std::vector elements; - std::vector pp_files; - std::vector pp_types; - std::vector orb_files; - std::valarray natom; - std::vector atomic_mass; - std::string coor_type; - std::valarray coordinates; - std::valarray mbl; - std::valarray velocity; - // ntype - int ntype; - int atomic_index; - - UnitCell* SetUcellInfo(const std::vector& nw, int& nlocal) - { - //basic info - this->ntype = this->elements.size(); - static UnitCell ucell; - ucell.setup(this->latname, this->ntype, this->lmaxmax, this->init_vel, this->fixed_axes); - delete[] ucell.magnet.start_mag; // mag set here - ucell.atom_label.resize(ucell.ntype); - ucell.atom_mass.resize(ucell.ntype); - ucell.pseudo_fn.resize(ucell.ntype); - ucell.pseudo_type.resize(ucell.ntype); - - ucell.orbital_fn.resize(ucell.ntype); - ucell.magnet.start_mag = new double[ucell.ntype]; // mag set here - ucell.magnet.ux_[0] = 0.0; // ux_ set here - ucell.magnet.ux_[1] = 0.0; - ucell.magnet.ux_[2] = 0.0; - for (int it = 0; it < ucell.ntype; ++it) - { - ucell.atom_label[it] = this->elements[it]; - ucell.atom_mass[it] = this->atomic_mass[it]; - ucell.pseudo_fn[it] = this->pp_files[it]; - ucell.pseudo_type[it] = this->pp_types[it]; - ucell.orbital_fn[it] = this->orb_files[it]; - ucell.magnet.start_mag[it] = 0.0; // mag set here - } - // lattice info - ucell.lat0 = this->lat0; - ucell.lat0_angstrom = ucell.lat0 * 0.529177; - ucell.tpiba = ModuleBase::TWO_PI / ucell.lat0; - ucell.tpiba2 = ucell.tpiba * ucell.tpiba; - ucell.latvec.e11 = this->latvec[0]; - ucell.latvec.e12 = this->latvec[1]; - ucell.latvec.e13 = this->latvec[2]; - ucell.latvec.e21 = this->latvec[3]; - ucell.latvec.e22 = this->latvec[4]; - ucell.latvec.e23 = this->latvec[5]; - ucell.latvec.e31 = this->latvec[6]; - ucell.latvec.e32 = this->latvec[7]; - ucell.latvec.e33 = this->latvec[8]; - ucell.a1.x = ucell.latvec.e11; - ucell.a1.y = ucell.latvec.e12; - ucell.a1.z = ucell.latvec.e13; - ucell.a2.x = ucell.latvec.e21; - ucell.a2.y = ucell.latvec.e22; - ucell.a2.z = ucell.latvec.e23; - ucell.a3.x = ucell.latvec.e31; - ucell.a3.y = ucell.latvec.e32; - ucell.a3.z = ucell.latvec.e33; - ucell.GT = ucell.latvec.Inverse(); - ucell.G = ucell.GT.Transpose(); - ucell.GGT = ucell.G * ucell.GT; - ucell.invGGT = ucell.GGT.Inverse(); - ucell.omega = std::abs(ucell.latvec.Det()) * (ucell.lat0) * (ucell.lat0) * (ucell.lat0); - // atomic info - ucell.Coordinate = this->coor_type; - ucell.atoms = new Atom[ucell.ntype]; - ucell.set_atom_flag = true; - this->atomic_index = 0; - for (int it = 0; it < ucell.ntype; ++it) - { - ucell.atoms[it].label = this->elements[it]; - /* - ucell.atoms[it].nw = 0; - ucell.atoms[it].nwl = 2; - delete[] ucell.atoms[it].l_nchi; - ucell.atoms[it].l_nchi = new int[ ucell.atoms[it].nwl+1]; - for(int L=0; Lnatom[it]; - // coordinates and related physical quantities - ucell.atoms[it].tau.resize(ucell.atoms[it].na); - ucell.atoms[it].dis.resize(ucell.atoms[it].na); - ucell.atoms[it].taud.resize(ucell.atoms[it].na); - ucell.atoms[it].vel.resize(ucell.atoms[it].na); - ucell.atoms[it].mag.resize(ucell.atoms[it].na); - ucell.atoms[it].angle1.resize(ucell.atoms[it].na); - ucell.atoms[it].angle2.resize(ucell.atoms[it].na); - ucell.atoms[it].m_loc_.resize(ucell.atoms[it].na); - ucell.atoms[it].mbl.resize(ucell.atoms[it].na); - ucell.atoms[it].mass = ucell.atom_mass[it]; // mass set here - for (int ia = 0; ia < ucell.atoms[it].na; ++ia) - { - if (ucell.Coordinate == "Direct") - { - ucell.atoms[it].taud[ia].x = this->coordinates[this->atomic_index * 3 + 0]; - ucell.atoms[it].taud[ia].y = this->coordinates[this->atomic_index * 3 + 1]; - ucell.atoms[it].taud[ia].z = this->coordinates[this->atomic_index * 3 + 2]; - ucell.atoms[it].tau[ia] = ucell.atoms[it].taud[ia] * ucell.latvec; - } - else if (ucell.Coordinate == "Cartesian") - { - ucell.atoms[it].tau[ia].x = this->coordinates[this->atomic_index * 3 + 0]; - ucell.atoms[it].tau[ia].y = this->coordinates[this->atomic_index * 3 + 1]; - ucell.atoms[it].tau[ia].z = this->coordinates[this->atomic_index * 3 + 2]; - ModuleBase::Mathzone::Cartesian_to_Direct(ucell.atoms[it].tau[ia].x, - ucell.atoms[it].tau[ia].y, - ucell.atoms[it].tau[ia].z, - ucell.latvec.e11, - ucell.latvec.e12, - ucell.latvec.e13, - ucell.latvec.e21, - ucell.latvec.e22, - ucell.latvec.e23, - ucell.latvec.e31, - ucell.latvec.e32, - ucell.latvec.e33, - ucell.atoms[it].taud[ia].x, - ucell.atoms[it].taud[ia].y, - ucell.atoms[it].taud[ia].z); - } - ucell.atoms[it].dis[ia].set(0, 0, 0); - if (this->init_vel) - { - ucell.atoms[it].vel[ia].x = this->velocity[this->atomic_index * 3 + 0]; - ucell.atoms[it].vel[ia].y = this->velocity[this->atomic_index * 3 + 1]; - ucell.atoms[it].vel[ia].z = this->velocity[this->atomic_index * 3 + 2]; - } - else - { - ucell.atoms[it].vel[ia].set(0, 0, 0); - } - ucell.atoms[it].m_loc_[ia].set(0, 0, 0); - ucell.atoms[it].angle1[ia] = 0; - ucell.atoms[it].angle2[ia] = 0; - if (this->selective_dynamics) - { - ucell.atoms[it].mbl[ia].x = this->mbl[this->atomic_index * 3 + 0]; - ucell.atoms[it].mbl[ia].y = this->mbl[this->atomic_index * 3 + 1]; - ucell.atoms[it].mbl[ia].z = this->mbl[this->atomic_index * 3 + 2]; - } - else - { - ucell.atoms[it].mbl[ia] = {1, 1, 1}; - } - ++(this->atomic_index); - } - } - ucell.nat = this->natom.sum(); - // set_nw - assert(nw.size() == ucell.ntype); - for (int it = 0; it < ucell.ntype; ++it) - { - ucell.atoms[it].nw = nw[it]; - } - // cal_nloc - nlocal = 0; - for (int it = 0; it < ucell.ntype; ++it) - { - nlocal += ucell.atoms[it].na * ucell.atoms[it].nw; - } - // cal_namax - int namax = 0; - for (int it = 0; it < ucell.ntype; ++it) - { - namax = std::max(namax, ucell.atoms[it].na); - } - ucell.namax = namax; - // cal_index - assert(nlocal > 0); - delete[] ucell.iwt2iat; - delete[] ucell.iwt2iw; - delete[] ucell.iat2it; - delete[] ucell.iat2ia; - ucell.iwt2iat = new int[nlocal]; - ucell.iwt2iw = new int[nlocal]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; // set_iat2itia - ucell.itia2iat.create(ucell.ntype, ucell.namax); - ucell.set_iat2iwt(1); - int iat = 0; - int iwt = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - ucell.iat2it[iat] = it; - ucell.iat2ia[iat] = ia; - ucell.itia2iat(it, ia) = iat; - for (int iw = 0; iw < ucell.atoms[it].nw; iw++) - { - ucell.iwt2iat[iwt] = iat; - ucell.iwt2iw[iwt] = iw; - ++iwt; - } - ++iat; - } - } - return &ucell; - } -}; - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in) -{ - mbl = std::valarray(0.0, coordinates_in.size()); - velocity = std::valarray(0.0, coordinates_in.size()); -} - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in), - mbl(mbl_in), - velocity(velocity_in) // velocity assume the existence of mbl in print_stru_file() -{} - -UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): - latname(utp.latname), - lmaxmax(utp.lmaxmax), - init_vel(utp.init_vel), - selective_dynamics(utp.selective_dynamics), - relax_new(utp.relax_new), - fixed_axes(utp.fixed_axes), - lat0(utp.lat0), - latvec(utp.latvec), - elements(utp.elements), - pp_files(utp.pp_files), - pp_types(utp.pp_types), - orb_files(utp.orb_files), - natom(utp.natom), - atomic_mass(utp.atomic_mass), - coor_type(utp.coor_type), - coordinates(utp.coordinates), - mbl(utp.mbl), - velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() -{} - -std::map UcellTestLib -{ - {"Si", UcellTestPrepare( - "fcc", //latname - 2, //lmaxmax - true, //init_vel - true, //selective_dyanmics - true, //relax_new - "volume", //fixed_axes - 10.2, //lat0 - {-0.5,0.0,0.5, //latvec - 0.0,0.5,0.5, - -0.5,0.5,0.0}, - {"Si"}, //elements - {"Si.upf"}, //upf file - {"upf201"}, //upf types - {"Si.orb"}, //orb file - {2}, //number of each elements - {28.0}, //atomic mass - "Cartesian", //coordination type - {0.0,0.0,0.0, //atomic coordinates - 0.25,0.25,0.25})} -}; -#endif diff --git a/source/module_hamilt_lcao/module_hcontainer/test/support/SR.csr b/source/module_hamilt_lcao/module_hcontainer/test/support/SR.csr deleted file mode 100644 index 874504ea53..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/support/SR.csr +++ /dev/null @@ -1,375 +0,0 @@ -STEP: 0 -Matrix Dimension of S(R): 26 -Matrix number of S(R): 93 --2 -1 0 169 - 1.25466617e-06 1.34349826e-05 1.31792447e-06 -6.58962236e-06 -3.95377341e-06 -4.39772254e-06 2.19886127e-05 1.31931676e-05 -2.43510507e-06 -1.31803928e-06 -7.90823570e-07 2.10886285e-06 3.95411785e-06 1.34349826e-05 1.43209127e-04 1.42696266e-05 -7.13481329e-05 -4.28088798e-05 -4.75690104e-05 2.37845052e-04 1.42707031e-04 -2.56801146e-05 -1.38997698e-05 -8.33986187e-06 2.22396317e-05 4.16993094e-05 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 7.04340302e-06 4.22604181e-06 2.62355898e-06 -2.36453257e-05 -1.41871954e-05 2.82105641e-06 8.15449649e-07 4.89269790e-07 -2.31661906e-06 -4.34366074e-06 6.58962236e-06 7.13481329e-05 7.04340302e-06 -3.45682450e-05 -2.11302091e-05 -2.36453257e-05 1.16121122e-04 7.09359772e-05 -1.30098686e-05 -7.11294712e-06 -4.34366074e-06 1.09506581e-05 2.13388414e-05 3.95377341e-06 4.28088798e-05 4.22604181e-06 -2.11302091e-05 -1.20293553e-05 -1.41871954e-05 7.09359772e-05 4.04560801e-05 -7.80592115e-06 -4.34366074e-06 -2.47970899e-06 7.32931955e-06 1.23985450e-05 4.39772254e-06 4.75690104e-05 2.62355898e-06 -2.36453257e-05 -1.41871954e-05 -9.01114524e-06 7.91031105e-05 4.74618663e-05 -9.57494961e-06 -2.89015053e-06 -1.73409032e-06 7.88460418e-06 1.47836328e-05 -2.19886127e-05 -2.37845052e-04 -2.36453257e-05 1.16121122e-04 7.09359772e-05 7.91031105e-05 -3.88706075e-04 -2.37309331e-04 4.43453012e-05 2.42318426e-05 1.47836328e-05 -3.73852938e-05 -7.26955279e-05 -1.31931676e-05 -1.42707031e-04 -1.41871954e-05 7.09359772e-05 4.04560801e-05 4.74618663e-05 -2.37309331e-04 -1.35576122e-04 2.66071807e-05 1.47836328e-05 8.46263429e-06 -2.48764488e-05 -4.23131714e-05 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 1.30098686e-05 7.80592115e-06 9.57494961e-06 -4.43453012e-05 -2.66071807e-05 3.61548803e-06 1.99797541e-06 1.19878524e-06 -3.12952049e-06 -5.86785091e-06 -1.31803928e-06 -1.38997698e-05 -8.15449649e-07 7.11294712e-06 4.34366074e-06 2.89015053e-06 -2.42318426e-05 -1.47836328e-05 1.99797541e-06 9.59219321e-07 5.71522584e-07 -1.69390265e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 -4.89269790e-07 4.34366074e-06 2.47970899e-06 1.73409032e-06 -1.47836328e-05 -8.46263429e-06 1.19878524e-06 5.71522584e-07 3.49595231e-07 -1.04545744e-06 -1.90867338e-06 2.10886285e-06 2.22396317e-05 2.31661906e-06 -1.09506581e-05 -7.32931955e-06 -7.88460418e-06 3.73852938e-05 2.48764488e-05 -3.12952049e-06 -1.69390265e-06 -1.04545744e-06 2.59560990e-06 5.15449757e-06 3.95411785e-06 4.16993094e-05 4.34366074e-06 -2.13388414e-05 -1.23985450e-05 -1.47836328e-05 7.26955279e-05 4.23131714e-05 -5.86785091e-06 -3.20700306e-06 -1.90867338e-06 5.15449757e-06 9.51122747e-06 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --2 -1 1 169 - 6.09103871e-05 6.14453477e-04 -5.91853803e-05 -2.95926902e-04 -5.91853803e-05 2.01724529e-04 1.00862265e-03 2.01724529e-04 -4.78869050e-05 3.45593969e-05 6.91187938e-06 8.29425526e-05 3.45593969e-05 6.14453477e-04 6.16334179e-03 -5.89280869e-04 -2.94640435e-03 -5.89280869e-04 2.00665301e-03 1.00332651e-02 2.00665301e-03 -4.47447198e-04 3.22917201e-04 6.45834401e-05 7.75001281e-04 3.22917201e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 -2.96993437e-04 -5.93986875e-05 -5.79546830e-05 1.00862453e-03 2.01724907e-04 -5.99184710e-05 -1.92003453e-05 -3.84006907e-06 8.23728840e-05 3.43220350e-05 2.95926902e-04 2.94640435e-03 -2.96993437e-04 -1.40977838e-03 -2.96993437e-04 1.00862453e-03 4.78344308e-03 1.00862453e-03 -2.06888873e-04 1.60905699e-04 3.43220350e-05 3.58342040e-04 1.60905699e-04 5.91853803e-05 5.89280869e-04 -5.93986875e-05 -2.96993437e-04 1.57901181e-05 2.01724907e-04 1.00862453e-03 -5.79546830e-05 -4.13777746e-05 3.43220350e-05 -3.84006907e-06 9.30773600e-05 -1.92003453e-05 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 1.00862453e-03 2.01724907e-04 2.12351688e-04 -3.42697221e-03 -6.85394441e-04 2.00592339e-04 7.04983673e-05 1.40996735e-05 -2.73631522e-04 -1.14013134e-04 -1.00862265e-03 -1.00332651e-02 1.00862453e-03 4.78344308e-03 1.00862453e-03 -3.42697221e-03 -1.62371149e-02 -3.42697221e-03 6.83378401e-04 -5.33163371e-04 -1.14013134e-04 -1.18364611e-03 -5.33163371e-04 -2.01724529e-04 -2.00665301e-03 2.01724907e-04 1.00862453e-03 -5.79546830e-05 -6.85394441e-04 -3.42697221e-03 2.12351688e-04 1.36675680e-04 -1.14013134e-04 1.40996735e-05 -3.10533823e-04 7.04983673e-05 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 2.06888873e-04 4.13777746e-05 -2.00592339e-04 -6.83378401e-04 -1.36675680e-04 1.53794146e-05 -2.33774382e-05 -4.67548763e-06 -2.78902609e-05 -1.16209420e-05 3.45593969e-05 3.22917201e-04 1.92003453e-05 -1.60905699e-04 -3.43220350e-05 -7.04983673e-05 5.33163371e-04 1.14013134e-04 -2.33774382e-05 -1.92605535e-05 -3.97900833e-06 2.69156783e-05 1.26855161e-05 6.91187938e-06 6.45834401e-05 3.84006907e-06 -3.43220350e-05 3.84006907e-06 -1.40996735e-05 1.14013134e-04 -1.40996735e-05 -4.67548763e-06 -3.97900833e-06 -1.61313514e-07 8.09818213e-06 -3.97900833e-06 8.29425526e-05 7.75001281e-04 -8.23728840e-05 -3.58342040e-04 -9.30773600e-05 2.73631522e-04 1.18364611e-03 3.10533823e-04 -2.78902609e-05 2.69156783e-05 8.09818213e-06 4.75843139e-05 3.37032945e-05 3.45593969e-05 3.22917201e-04 -3.43220350e-05 -1.60905699e-04 1.92003453e-05 1.14013134e-04 5.33163371e-04 -7.04983673e-05 -1.16209420e-05 1.26855161e-05 -3.97900833e-06 3.37032945e-05 -1.92605535e-05 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --2 -1 2 169 - 1.25466617e-06 1.34349826e-05 -3.95377341e-06 -6.58962236e-06 1.31792447e-06 1.31931676e-05 2.19886127e-05 -4.39772254e-06 -6.08776268e-07 3.95411785e-06 -7.90823570e-07 3.16329428e-06 -1.31803928e-06 1.34349826e-05 1.43209127e-04 -4.28088798e-05 -7.13481329e-05 1.42696266e-05 1.42707031e-04 2.37845052e-04 -4.75690104e-05 -6.42002866e-06 4.16993094e-05 -8.33986187e-06 3.33594475e-05 -1.38997698e-05 3.95377341e-06 4.28088798e-05 -1.20293553e-05 -2.11302091e-05 4.22604181e-06 4.04560801e-05 7.09359772e-05 -1.41871954e-05 -2.44441635e-06 1.23985450e-05 -2.47970899e-06 1.04247858e-05 -4.34366074e-06 6.58962236e-06 7.13481329e-05 -2.11302091e-05 -3.45682450e-05 7.04340302e-06 7.09359772e-05 1.16121122e-04 -2.36453257e-05 -2.97861377e-06 2.13388414e-05 -4.34366074e-06 1.67422057e-05 -7.11294712e-06 -1.31792447e-06 -1.42696266e-05 4.22604181e-06 7.04340302e-06 -7.59910514e-07 -1.41871954e-05 -2.36453257e-05 2.62355898e-06 5.95722755e-07 -4.34366074e-06 4.89269790e-07 -3.60141605e-06 8.15449649e-07 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 7.09359772e-05 -1.41871954e-05 -1.35576122e-04 -2.37309331e-04 4.74618663e-05 8.24004626e-06 -4.23131714e-05 8.46263429e-06 -3.54807188e-05 1.47836328e-05 -2.19886127e-05 -2.37845052e-04 7.09359772e-05 1.16121122e-04 -2.36453257e-05 -2.37309331e-04 -3.88706075e-04 7.91031105e-05 1.02039636e-05 -7.26955279e-05 1.47836328e-05 -5.70968043e-05 2.42318426e-05 4.39772254e-06 4.75690104e-05 -1.41871954e-05 -2.36453257e-05 2.62355898e-06 4.74618663e-05 7.91031105e-05 -9.01114524e-06 -2.04079272e-06 1.47836328e-05 -1.73409032e-06 1.22344517e-05 -2.89015053e-06 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 2.97861377e-06 -5.95722755e-07 -8.24004626e-06 -1.02039636e-05 2.04079272e-06 1.40335193e-07 -1.53000038e-06 3.06000076e-07 -1.12314006e-06 4.67975025e-07 3.95411785e-06 4.16993094e-05 -1.23985450e-05 -2.13388414e-05 4.34366074e-06 4.23131714e-05 7.26955279e-05 -1.47836328e-05 -1.53000038e-06 9.51122747e-06 -1.90867338e-06 7.65895674e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 2.47970899e-06 4.34366074e-06 -4.89269790e-07 -8.46263429e-06 -1.47836328e-05 1.73409032e-06 3.06000076e-07 -1.90867338e-06 3.49595231e-07 -1.56090719e-06 5.71522584e-07 3.16329428e-06 3.33594475e-05 -1.04247858e-05 -1.67422057e-05 3.60141605e-06 3.54807188e-05 5.70968043e-05 -1.22344517e-05 -1.12314006e-06 7.65895674e-06 -1.56090719e-06 6.07076274e-06 -2.57724878e-06 -1.31803928e-06 -1.38997698e-05 4.34366074e-06 7.11294712e-06 -8.15449649e-07 -1.47836328e-05 -2.42318426e-05 2.89015053e-06 4.67975025e-07 -3.20700306e-06 5.71522584e-07 -2.57724878e-06 9.59219321e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --2 0 -1 169 - 1.25466617e-06 1.34349826e-05 1.31792447e-06 -3.95377341e-06 -6.58962236e-06 -4.39772254e-06 1.31931676e-05 2.19886127e-05 -2.43510507e-06 -7.90823570e-07 -1.31803928e-06 -2.10886285e-06 3.95411785e-06 1.34349826e-05 1.43209127e-04 1.42696266e-05 -4.28088798e-05 -7.13481329e-05 -4.75690104e-05 1.42707031e-04 2.37845052e-04 -2.56801146e-05 -8.33986187e-06 -1.38997698e-05 -2.22396317e-05 4.16993094e-05 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 4.22604181e-06 7.04340302e-06 2.62355898e-06 -1.41871954e-05 -2.36453257e-05 2.82105641e-06 4.89269790e-07 8.15449649e-07 2.31661906e-06 -4.34366074e-06 3.95377341e-06 4.28088798e-05 4.22604181e-06 -1.20293553e-05 -2.11302091e-05 -1.41871954e-05 4.04560801e-05 7.09359772e-05 -7.80592115e-06 -2.47970899e-06 -4.34366074e-06 -7.32931955e-06 1.23985450e-05 6.58962236e-06 7.13481329e-05 7.04340302e-06 -2.11302091e-05 -3.45682450e-05 -2.36453257e-05 7.09359772e-05 1.16121122e-04 -1.30098686e-05 -4.34366074e-06 -7.11294712e-06 -1.09506581e-05 2.13388414e-05 4.39772254e-06 4.75690104e-05 2.62355898e-06 -1.41871954e-05 -2.36453257e-05 -9.01114524e-06 4.74618663e-05 7.91031105e-05 -9.57494961e-06 -1.73409032e-06 -2.89015053e-06 -7.88460418e-06 1.47836328e-05 -1.31931676e-05 -1.42707031e-04 -1.41871954e-05 4.04560801e-05 7.09359772e-05 4.74618663e-05 -1.35576122e-04 -2.37309331e-04 2.66071807e-05 8.46263429e-06 1.47836328e-05 2.48764488e-05 -4.23131714e-05 -2.19886127e-05 -2.37845052e-04 -2.36453257e-05 7.09359772e-05 1.16121122e-04 7.91031105e-05 -2.37309331e-04 -3.88706075e-04 4.43453012e-05 1.47836328e-05 2.42318426e-05 3.73852938e-05 -7.26955279e-05 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 7.80592115e-06 1.30098686e-05 9.57494961e-06 -2.66071807e-05 -4.43453012e-05 3.61548803e-06 1.19878524e-06 1.99797541e-06 3.12952049e-06 -5.86785091e-06 -7.90823570e-07 -8.33986187e-06 -4.89269790e-07 2.47970899e-06 4.34366074e-06 1.73409032e-06 -8.46263429e-06 -1.47836328e-05 1.19878524e-06 3.49595231e-07 5.71522584e-07 1.04545744e-06 -1.90867338e-06 -1.31803928e-06 -1.38997698e-05 -8.15449649e-07 4.34366074e-06 7.11294712e-06 2.89015053e-06 -1.47836328e-05 -2.42318426e-05 1.99797541e-06 5.71522584e-07 9.59219321e-07 1.69390265e-06 -3.20700306e-06 -2.10886285e-06 -2.22396317e-05 -2.31661906e-06 7.32931955e-06 1.09506581e-05 7.88460418e-06 -2.48764488e-05 -3.73852938e-05 3.12952049e-06 1.04545744e-06 1.69390265e-06 2.59560990e-06 -5.15449757e-06 3.95411785e-06 4.16993094e-05 4.34366074e-06 -1.23985450e-05 -2.13388414e-05 -1.47836328e-05 4.23131714e-05 7.26955279e-05 -5.86785091e-06 -1.90867338e-06 -3.20700306e-06 -5.15449757e-06 9.51122747e-06 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --2 0 0 335 - 8.23315696e-06 9.02495943e-05 -3.30136560e-05 -3.30136560e-05 1.15322826e-04 1.15322826e-04 -1.30101956e-05 2.25343198e-05 9.03813139e-04 6.83095219e-03 -8.43309998e-04 -2.52992999e-03 -2.52992999e-03 2.52360170e-03 7.57080511e-03 7.57080511e-03 -1.01044875e-04 6.56305714e-05 6.56305714e-05 1.96891714e-04 9.02495943e-05 9.91070319e-04 -3.61844250e-04 -3.61844250e-04 1.26431932e-03 1.26431932e-03 -1.44682422e-04 2.50597306e-04 6.83095219e-03 4.49022829e-02 -5.72585887e-03 -1.71775766e-02 -1.71775766e-02 1.58598947e-02 4.75796841e-02 4.75796841e-02 1.04130562e-03 -6.76347839e-04 -6.76347839e-04 -2.02904352e-03 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 -5.18708531e-06 8.43309998e-04 5.72585887e-03 4.26061120e-04 -2.38239659e-03 -2.38239659e-03 -1.48235482e-03 6.78418274e-03 6.78418274e-03 -7.13997564e-06 -1.56159564e-04 -1.56159564e-04 -8.25656177e-05 3.30136560e-05 3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 -5.06876205e-05 -5.18708531e-06 8.77935341e-05 2.52992999e-03 1.71775766e-02 -2.38239659e-03 -5.92699644e-03 -7.14718976e-03 6.78418274e-03 1.66087992e-02 2.03525482e-02 2.01387090e-04 -1.25444848e-04 -8.25656177e-05 -1.28637691e-04 -3.76334544e-04 3.30136560e-05 3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 -5.06876205e-05 5.18708531e-06 8.77935341e-05 2.52992999e-03 1.71775766e-02 -2.38239659e-03 -7.14718976e-03 -5.92699644e-03 6.78418274e-03 2.03525482e-02 1.66087992e-02 2.01387090e-04 -8.25656177e-05 -1.25444848e-04 1.28637691e-04 -3.76334544e-04 -2.39796963e-05 8.25086154e-05 1.79871070e-05 1.79871070e-05 -2.52360170e-03 -1.58598947e-02 -1.48235482e-03 6.78418274e-03 6.78418274e-03 5.13458842e-03 -1.85131107e-02 -1.85131107e-02 -4.18310329e-04 5.12122996e-04 5.12122996e-04 9.59355067e-04 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 1.78648211e-04 1.79871070e-05 -3.09427778e-04 -7.57080511e-03 -4.75796841e-02 6.78418274e-03 1.66087992e-02 2.03525482e-02 -1.85131107e-02 -4.42337068e-02 -5.55393321e-02 -1.58807013e-03 1.02346772e-03 9.59355067e-04 1.92337974e-04 3.07040317e-03 -1.15322826e-04 -1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 1.78648211e-04 -1.79871070e-05 -3.09427778e-04 -7.57080511e-03 -4.75796841e-02 6.78418274e-03 2.03525482e-02 1.66087992e-02 -1.85131107e-02 -5.55393321e-02 -4.42337068e-02 -1.58807013e-03 9.59355067e-04 1.02346772e-03 -1.92337974e-04 3.07040317e-03 -1.30101956e-05 -1.44682422e-04 5.06876205e-05 5.06876205e-05 -1.78648211e-04 -1.78648211e-04 2.10894554e-05 -3.62362512e-05 -1.01044875e-04 1.04130562e-03 7.13997564e-06 -2.01387090e-04 -2.01387090e-04 4.18310329e-04 1.58807013e-03 1.58807013e-03 -3.27420436e-04 3.35519138e-04 3.35519138e-04 6.97611067e-04 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 -4.26298824e-06 6.56305714e-05 -6.76347839e-04 1.56159564e-04 1.25444848e-04 8.25656177e-05 -5.12122996e-04 -1.02346772e-03 -9.59355067e-04 3.35519138e-04 -6.48472168e-06 -1.72595341e-05 5.94567521e-05 -5.27432619e-04 5.18708531e-06 -1.79871070e-05 -4.26298824e-06 -4.09454220e-06 6.56305714e-05 -6.76347839e-04 1.56159564e-04 8.25656177e-05 1.25444848e-04 -5.12122996e-04 -9.59355067e-04 -1.02346772e-03 3.35519138e-04 -1.72595341e-05 -6.48472168e-06 -5.94567521e-05 -5.27432619e-04 5.18708531e-06 -5.18708531e-06 -1.79871070e-05 1.79871070e-05 -8.35753044e-06 1.28637691e-04 -1.28637691e-04 -1.92337974e-04 1.92337974e-04 5.94567521e-05 -5.94567521e-05 3.47696408e-04 2.25343198e-05 2.50597306e-04 -8.77935341e-05 -8.77935341e-05 3.09427778e-04 3.09427778e-04 -3.62362512e-05 6.29314743e-05 1.96891714e-04 -2.02904352e-03 8.25656177e-05 3.76334544e-04 3.76334544e-04 -9.59355067e-04 -3.07040317e-03 -3.07040317e-03 6.97611067e-04 -5.27432619e-04 -5.27432619e-04 -1.41297171e-03 8.23315696e-06 9.02495943e-05 -3.30136560e-05 -3.30136560e-05 1.15322826e-04 1.15322826e-04 -1.30101956e-05 2.25343198e-05 9.02495943e-05 9.91070319e-04 -3.61844250e-04 -3.61844250e-04 1.26431932e-03 1.26431932e-03 -1.44682422e-04 2.50597306e-04 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 -5.18708531e-06 3.30136560e-05 3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 -5.06876205e-05 -5.18708531e-06 8.77935341e-05 3.30136560e-05 3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 -5.06876205e-05 5.18708531e-06 8.77935341e-05 -2.39796963e-05 8.25086154e-05 1.79871070e-05 1.79871070e-05 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 1.78648211e-04 1.79871070e-05 -3.09427778e-04 -1.15322826e-04 -1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 1.78648211e-04 -1.79871070e-05 -3.09427778e-04 -1.30101956e-05 -1.44682422e-04 5.06876205e-05 5.06876205e-05 -1.78648211e-04 -1.78648211e-04 2.10894554e-05 -3.62362512e-05 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 -4.26298824e-06 5.18708531e-06 -1.79871070e-05 -4.26298824e-06 -4.09454220e-06 5.18708531e-06 -5.18708531e-06 -1.79871070e-05 1.79871070e-05 -8.35753044e-06 2.25343198e-05 2.50597306e-04 -8.77935341e-05 -8.77935341e-05 3.09427778e-04 3.09427778e-04 -3.62362512e-05 6.29314743e-05 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 16 17 19 20 22 23 24 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 13 14 16 17 19 20 21 25 13 14 16 17 19 20 21 25 15 18 22 23 13 14 16 17 19 20 21 24 25 13 14 16 17 19 20 21 24 25 15 18 22 23 13 14 16 17 19 20 21 24 25 13 14 16 17 19 20 21 24 25 13 14 16 17 19 20 21 25 15 18 22 23 15 18 22 23 16 17 19 20 24 13 14 16 17 19 20 21 25 - 0 20 40 56 78 100 116 138 160 180 197 214 226 246 254 262 266 275 284 288 297 306 314 318 322 327 335 --2 0 1 676 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -6.51378048e-04 -3.25689024e-04 1.06639054e-03 2.13278108e-03 1.06639054e-03 -4.52806801e-05 1.04571251e-04 5.22856257e-05 7.84284385e-05 1.04571251e-04 9.03813139e-04 6.83095219e-03 -2.52992999e-03 -2.52992999e-03 -8.43309998e-04 7.57080511e-03 7.57080511e-03 2.52360170e-03 5.05224374e-05 1.96891714e-04 6.56305714e-05 8.75074285e-05 6.56305714e-05 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -5.79216869e-03 -2.89608434e-03 9.35225951e-03 1.87045190e-02 9.35225951e-03 -2.85376584e-04 6.59048991e-04 3.29524496e-04 4.94286743e-04 6.59048991e-04 6.83095219e-03 4.49022829e-02 -1.71775766e-02 -1.71775766e-02 -5.72585887e-03 4.75796841e-02 4.75796841e-02 1.58598947e-02 -5.20652809e-04 -2.02904352e-03 -6.76347839e-04 -9.01797119e-04 -6.76347839e-04 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -1.28527532e-03 -6.42637659e-04 1.31106178e-03 4.15611128e-03 2.07805564e-03 -1.33367462e-04 8.08681204e-05 4.04340602e-05 1.33657432e-04 1.78209909e-04 2.52992999e-03 1.71775766e-02 -5.92699644e-03 -7.14718976e-03 -2.38239659e-03 1.66087992e-02 2.03525482e-02 6.78418274e-03 -2.12097053e-04 -3.76334544e-04 -1.25444848e-04 -1.10087490e-04 -8.25656177e-05 6.51378048e-04 5.79216869e-03 -1.28527532e-03 -2.34193222e-03 -1.28527532e-03 4.15611128e-03 7.54522870e-03 4.15611128e-03 -9.81340007e-05 3.07748924e-04 1.78209909e-04 1.69973075e-04 3.07748924e-04 2.52992999e-03 1.71775766e-02 -7.14718976e-03 -5.92699644e-03 -2.38239659e-03 2.03525482e-02 1.66087992e-02 6.78418274e-03 1.07099635e-05 -3.76334544e-04 -8.25656177e-05 -2.38725181e-04 -1.25444848e-04 3.25689024e-04 2.89608434e-03 -6.42637659e-04 -1.28527532e-03 -4.14019247e-04 2.07805564e-03 4.15611128e-03 1.31106178e-03 -4.90670003e-05 1.78209909e-04 4.04340602e-05 1.82328327e-04 8.08681204e-05 8.43309998e-04 5.72585887e-03 -2.38239659e-03 -2.38239659e-03 4.26061120e-04 6.78418274e-03 6.78418274e-03 -1.48235482e-03 3.56998782e-06 -8.25656177e-05 -1.56159564e-04 6.18340029e-06 -1.56159564e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 4.15611128e-03 2.07805564e-03 -4.10981523e-03 -1.33621179e-02 -6.68105894e-03 3.95156129e-04 -1.77416518e-04 -8.87082588e-05 -3.69363005e-04 -4.92484006e-04 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 2.03525482e-02 6.78418274e-03 -4.42337068e-02 -5.55393321e-02 -1.85131107e-02 9.60604637e-04 3.07040317e-03 1.02346772e-03 1.27914009e-03 9.59355067e-04 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 7.54522870e-03 4.15611128e-03 -1.33621179e-02 -2.41529920e-02 -1.33621179e-02 2.44599361e-04 -8.27434268e-04 -4.92484006e-04 -4.23658521e-04 -8.27434268e-04 -7.57080511e-03 -4.75796841e-02 2.03525482e-02 1.66087992e-02 6.78418274e-03 -5.55393321e-02 -4.42337068e-02 -1.85131107e-02 6.27465494e-04 3.07040317e-03 9.59355067e-04 1.47147806e-03 1.02346772e-03 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 4.15611128e-03 1.31106178e-03 -6.68105894e-03 -1.33621179e-02 -4.10981523e-03 1.22299680e-04 -4.92484006e-04 -8.87082588e-05 -5.26896749e-04 -1.77416518e-04 -2.52360170e-03 -1.58598947e-02 6.78418274e-03 6.78418274e-03 -1.48235482e-03 -1.85131107e-02 -1.85131107e-02 5.13458842e-03 2.09155165e-04 9.59355067e-04 5.12122996e-04 3.62267372e-04 5.12122996e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 9.81340007e-05 4.90670003e-05 -3.95156129e-04 -2.44599361e-04 -1.22299680e-04 -2.59797738e-05 3.38595206e-05 1.69297603e-05 3.69220468e-05 4.92293958e-05 5.05224374e-05 -5.20652809e-04 2.12097053e-04 -1.07099635e-05 -3.56998782e-06 -9.60604637e-04 -6.27465494e-04 -2.09155165e-04 1.78917197e-04 -3.48805533e-04 -1.16268511e-04 -2.92334169e-04 -2.19250627e-04 1.04571251e-04 6.59048991e-04 -8.08681204e-05 -3.07748924e-04 -1.78209909e-04 1.77416518e-04 8.27434268e-04 4.92484006e-04 3.38595206e-05 -1.08000471e-04 -5.38872760e-05 -7.63940131e-05 -9.44638495e-05 1.96891714e-04 -2.02904352e-03 3.76334544e-04 3.76334544e-04 8.25656177e-05 -3.07040317e-03 -3.07040317e-03 -9.59355067e-04 -3.48805533e-04 -1.41297171e-03 -5.27432619e-04 -6.04148906e-04 -5.27432619e-04 5.22856257e-05 3.29524496e-04 -4.04340602e-05 -1.78209909e-04 -4.04340602e-05 8.87082588e-05 4.92484006e-04 8.87082588e-05 1.69297603e-05 -5.38872760e-05 -2.71695573e-05 -2.93232050e-05 -5.38872760e-05 6.56305714e-05 -6.76347839e-04 1.25444848e-04 8.25656177e-05 1.56159564e-04 -1.02346772e-03 -9.59355067e-04 -5.12122996e-04 -1.16268511e-04 -5.27432619e-04 -6.48472168e-06 -3.20296473e-04 -1.72595341e-05 7.84284385e-05 4.94286743e-04 -1.33657432e-04 -1.69973075e-04 -1.82328327e-04 3.69363005e-04 4.23658521e-04 5.26896749e-04 3.69220468e-05 -7.63940131e-05 -2.93232050e-05 -6.86136812e-05 -6.75202116e-05 8.75074285e-05 -9.01797119e-04 1.10087490e-04 2.38725181e-04 -6.18340029e-06 -1.27914009e-03 -1.47147806e-03 -3.62267372e-04 -2.92334169e-04 -6.04148906e-04 -3.20296473e-04 -1.58641225e-04 -2.60839721e-04 1.04571251e-04 6.59048991e-04 -1.78209909e-04 -3.07748924e-04 -8.08681204e-05 4.92484006e-04 8.27434268e-04 1.77416518e-04 4.92293958e-05 -9.44638495e-05 -5.38872760e-05 -6.75202116e-05 -1.08000471e-04 6.56305714e-05 -6.76347839e-04 8.25656177e-05 1.25444848e-04 1.56159564e-04 -9.59355067e-04 -1.02346772e-03 -5.12122996e-04 -2.19250627e-04 -5.27432619e-04 -1.72595341e-05 -2.60839721e-04 -6.48472168e-06 1.25466617e-06 1.34349826e-05 -1.31792447e-06 -6.58962236e-06 -3.95377341e-06 4.39772254e-06 2.19886127e-05 1.31931676e-05 -2.43510507e-06 1.31803928e-06 7.90823570e-07 2.10886285e-06 3.95411785e-06 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -6.51378048e-04 -3.25689024e-04 1.06639054e-03 2.13278108e-03 1.06639054e-03 -4.52806801e-05 1.04571251e-04 5.22856257e-05 7.84284385e-05 1.04571251e-04 1.34349826e-05 1.43209127e-04 -1.42696266e-05 -7.13481329e-05 -4.28088798e-05 4.75690104e-05 2.37845052e-04 1.42707031e-04 -2.56801146e-05 1.38997698e-05 8.33986187e-06 2.22396317e-05 4.16993094e-05 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -5.79216869e-03 -2.89608434e-03 9.35225951e-03 1.87045190e-02 9.35225951e-03 -2.85376584e-04 6.59048991e-04 3.29524496e-04 4.94286743e-04 6.59048991e-04 1.31792447e-06 1.42696266e-05 -7.59910514e-07 -7.04340302e-06 -4.22604181e-06 2.62355898e-06 2.36453257e-05 1.41871954e-05 -2.82105641e-06 8.15449649e-07 4.89269790e-07 2.31661906e-06 4.34366074e-06 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -1.28527532e-03 -6.42637659e-04 1.31106178e-03 4.15611128e-03 2.07805564e-03 -1.33367462e-04 8.08681204e-05 4.04340602e-05 1.33657432e-04 1.78209909e-04 6.58962236e-06 7.13481329e-05 -7.04340302e-06 -3.45682450e-05 -2.11302091e-05 2.36453257e-05 1.16121122e-04 7.09359772e-05 -1.30098686e-05 7.11294712e-06 4.34366074e-06 1.09506581e-05 2.13388414e-05 6.51378048e-04 5.79216869e-03 -1.28527532e-03 -2.34193222e-03 -1.28527532e-03 4.15611128e-03 7.54522870e-03 4.15611128e-03 -9.81340007e-05 3.07748924e-04 1.78209909e-04 1.69973075e-04 3.07748924e-04 3.95377341e-06 4.28088798e-05 -4.22604181e-06 -2.11302091e-05 -1.20293553e-05 1.41871954e-05 7.09359772e-05 4.04560801e-05 -7.80592115e-06 4.34366074e-06 2.47970899e-06 7.32931955e-06 1.23985450e-05 3.25689024e-04 2.89608434e-03 -6.42637659e-04 -1.28527532e-03 -4.14019247e-04 2.07805564e-03 4.15611128e-03 1.31106178e-03 -4.90670003e-05 1.78209909e-04 4.04340602e-05 1.82328327e-04 8.08681204e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 2.36453257e-05 1.41871954e-05 -9.01114524e-06 -7.91031105e-05 -4.74618663e-05 9.57494961e-06 -2.89015053e-06 -1.73409032e-06 -7.88460418e-06 -1.47836328e-05 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 4.15611128e-03 2.07805564e-03 -4.10981523e-03 -1.33621179e-02 -6.68105894e-03 3.95156129e-04 -1.77416518e-04 -8.87082588e-05 -3.69363005e-04 -4.92484006e-04 -2.19886127e-05 -2.37845052e-04 2.36453257e-05 1.16121122e-04 7.09359772e-05 -7.91031105e-05 -3.88706075e-04 -2.37309331e-04 4.43453012e-05 -2.42318426e-05 -1.47836328e-05 -3.73852938e-05 -7.26955279e-05 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 7.54522870e-03 4.15611128e-03 -1.33621179e-02 -2.41529920e-02 -1.33621179e-02 2.44599361e-04 -8.27434268e-04 -4.92484006e-04 -4.23658521e-04 -8.27434268e-04 -1.31931676e-05 -1.42707031e-04 1.41871954e-05 7.09359772e-05 4.04560801e-05 -4.74618663e-05 -2.37309331e-04 -1.35576122e-04 2.66071807e-05 -1.47836328e-05 -8.46263429e-06 -2.48764488e-05 -4.23131714e-05 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 4.15611128e-03 1.31106178e-03 -6.68105894e-03 -1.33621179e-02 -4.10981523e-03 1.22299680e-04 -4.92484006e-04 -8.87082588e-05 -5.26896749e-04 -1.77416518e-04 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 1.30098686e-05 7.80592115e-06 -9.57494961e-06 -4.43453012e-05 -2.66071807e-05 3.61548803e-06 -1.99797541e-06 -1.19878524e-06 -3.12952049e-06 -5.86785091e-06 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 9.81340007e-05 4.90670003e-05 -3.95156129e-04 -2.44599361e-04 -1.22299680e-04 -2.59797738e-05 3.38595206e-05 1.69297603e-05 3.69220468e-05 4.92293958e-05 1.31803928e-06 1.38997698e-05 -8.15449649e-07 -7.11294712e-06 -4.34366074e-06 2.89015053e-06 2.42318426e-05 1.47836328e-05 -1.99797541e-06 9.59219321e-07 5.71522584e-07 1.69390265e-06 3.20700306e-06 1.04571251e-04 6.59048991e-04 -8.08681204e-05 -3.07748924e-04 -1.78209909e-04 1.77416518e-04 8.27434268e-04 4.92484006e-04 3.38595206e-05 -1.08000471e-04 -5.38872760e-05 -7.63940131e-05 -9.44638495e-05 7.90823570e-07 8.33986187e-06 -4.89269790e-07 -4.34366074e-06 -2.47970899e-06 1.73409032e-06 1.47836328e-05 8.46263429e-06 -1.19878524e-06 5.71522584e-07 3.49595231e-07 1.04545744e-06 1.90867338e-06 5.22856257e-05 3.29524496e-04 -4.04340602e-05 -1.78209909e-04 -4.04340602e-05 8.87082588e-05 4.92484006e-04 8.87082588e-05 1.69297603e-05 -5.38872760e-05 -2.71695573e-05 -2.93232050e-05 -5.38872760e-05 2.10886285e-06 2.22396317e-05 -2.31661906e-06 -1.09506581e-05 -7.32931955e-06 7.88460418e-06 3.73852938e-05 2.48764488e-05 -3.12952049e-06 1.69390265e-06 1.04545744e-06 2.59560990e-06 5.15449757e-06 7.84284385e-05 4.94286743e-04 -1.33657432e-04 -1.69973075e-04 -1.82328327e-04 3.69363005e-04 4.23658521e-04 5.26896749e-04 3.69220468e-05 -7.63940131e-05 -2.93232050e-05 -6.86136812e-05 -6.75202116e-05 3.95411785e-06 4.16993094e-05 -4.34366074e-06 -2.13388414e-05 -1.23985450e-05 1.47836328e-05 7.26955279e-05 4.23131714e-05 -5.86785091e-06 3.20700306e-06 1.90867338e-06 5.15449757e-06 9.51122747e-06 1.04571251e-04 6.59048991e-04 -1.78209909e-04 -3.07748924e-04 -8.08681204e-05 4.92484006e-04 8.27434268e-04 1.77416518e-04 4.92293958e-05 -9.44638495e-05 -5.38872760e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 364 390 416 442 468 494 520 546 572 598 624 650 676 --2 0 2 532 - 8.23315696e-06 9.02495943e-05 -3.30136560e-05 -3.30136560e-05 1.15322826e-04 1.15322826e-04 6.50509780e-06 2.25343198e-05 1.12671599e-05 1.25466617e-06 1.34349826e-05 -6.58962236e-06 -3.95377341e-06 1.31792447e-06 2.19886127e-05 1.31931676e-05 -4.39772254e-06 3.04388134e-06 3.95411785e-06 -1.31803928e-06 1.05443143e-06 -7.90823570e-07 9.02495943e-05 9.91070319e-04 -3.61844250e-04 -3.61844250e-04 1.26431932e-03 1.26431932e-03 7.23412109e-05 2.50597306e-04 1.25298653e-04 1.34349826e-05 1.43209127e-04 -7.13481329e-05 -4.28088798e-05 1.42696266e-05 2.37845052e-04 1.42707031e-04 -4.75690104e-05 3.21001433e-05 4.16993094e-05 -1.38997698e-05 1.11198158e-05 -8.33986187e-06 3.30136560e-05 3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 2.08516626e-05 8.77935341e-05 4.64903097e-05 6.58962236e-06 7.13481329e-05 -3.45682450e-05 -2.11302091e-05 7.04340302e-06 1.16121122e-04 7.09359772e-05 -2.36453257e-05 1.59884824e-05 2.13388414e-05 -7.11294712e-06 5.79154766e-06 -4.34366074e-06 3.30136560e-05 3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 2.98359579e-05 8.77935341e-05 4.13032244e-05 3.95377341e-06 4.28088798e-05 -2.11302091e-05 -1.20293553e-05 4.22604181e-06 7.09359772e-05 4.04560801e-05 -1.41871954e-05 1.02503375e-05 1.23985450e-05 -4.34366074e-06 3.09546624e-06 -2.47970899e-06 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 -5.18708531e-06 -1.31792447e-06 -1.42696266e-05 7.04340302e-06 4.22604181e-06 -7.59910514e-07 -2.36453257e-05 -1.41871954e-05 2.62355898e-06 -3.41677917e-06 -4.34366074e-06 8.15449649e-07 -1.28479698e-06 4.89269790e-07 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 -7.37468140e-05 -3.09427778e-04 -1.63707443e-04 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 7.09359772e-05 -2.36453257e-05 -3.88706075e-04 -2.37309331e-04 7.91031105e-05 -5.45492648e-05 -7.26955279e-05 2.42318426e-05 -1.97115105e-05 1.47836328e-05 -1.15322826e-04 -1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 -1.04901397e-04 -3.09427778e-04 -1.45720336e-04 -1.31931676e-05 -1.42707031e-04 7.09359772e-05 4.04560801e-05 -1.41871954e-05 -2.37309331e-04 -1.35576122e-04 4.74618663e-05 -3.48472270e-05 -4.23131714e-05 1.47836328e-05 -1.06042700e-05 8.46263429e-06 -2.39796963e-05 8.25086154e-05 1.79871070e-05 1.79871070e-05 4.39772254e-06 4.75690104e-05 -2.36453257e-05 -1.41871954e-05 2.62355898e-06 7.91031105e-05 4.74618663e-05 -9.01114524e-06 1.16157423e-05 1.47836328e-05 -2.89015053e-06 4.34984751e-06 -1.73409032e-06 6.50509780e-06 7.23412109e-05 -2.08516626e-05 -2.98359579e-05 7.37468140e-05 1.04901397e-04 -9.95783968e-07 1.81181256e-05 1.27509189e-05 3.04388134e-06 3.21001433e-05 -1.59884824e-05 -1.02503375e-05 3.41677917e-06 5.45492648e-05 3.48472270e-05 -1.16157423e-05 5.56082368e-06 7.39785129e-06 -2.46595043e-06 2.00638043e-06 -1.50478532e-06 2.25343198e-05 2.50597306e-04 -8.77935341e-05 -8.77935341e-05 3.09427778e-04 3.09427778e-04 1.81181256e-05 6.29314743e-05 3.13815141e-05 3.95411785e-06 4.16993094e-05 -2.13388414e-05 -1.23985450e-05 4.34366074e-06 7.26955279e-05 4.23131714e-05 -1.47836328e-05 7.39785129e-06 9.51122747e-06 -3.20700306e-06 2.50445917e-06 -1.90867338e-06 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 -4.26298824e-06 -1.31803928e-06 -1.38997698e-05 7.11294712e-06 4.34366074e-06 -8.15449649e-07 -2.42318426e-05 -1.47836328e-05 2.89015053e-06 -2.46595043e-06 -3.20700306e-06 9.59219321e-07 -8.83346132e-07 5.71522584e-07 1.12671599e-05 1.25298653e-04 -4.64903097e-05 -4.13032244e-05 1.63707443e-04 1.45720336e-04 1.27509189e-05 3.13815141e-05 1.37277090e-05 1.05443143e-06 1.11198158e-05 -5.79154766e-06 -3.09546624e-06 1.28479698e-06 1.97115105e-05 1.06042700e-05 -4.34984751e-06 2.00638043e-06 2.50445917e-06 -8.83346132e-07 6.50274256e-07 -5.15449757e-07 5.18708531e-06 -1.79871070e-05 -4.26298824e-06 -4.09454220e-06 -7.90823570e-07 -8.33986187e-06 4.34366074e-06 2.47970899e-06 -4.89269790e-07 -1.47836328e-05 -8.46263429e-06 1.73409032e-06 -1.50478532e-06 -1.90867338e-06 5.71522584e-07 -5.15449757e-07 3.49595231e-07 1.25466617e-06 1.34349826e-05 -3.95377341e-06 -6.58962236e-06 -1.31792447e-06 1.31931676e-05 2.19886127e-05 4.39772254e-06 -6.08776268e-07 3.95411785e-06 7.90823570e-07 3.16329428e-06 1.31803928e-06 8.23315696e-06 9.02495943e-05 -3.30136560e-05 -3.30136560e-05 1.15322826e-04 1.15322826e-04 6.50509780e-06 2.25343198e-05 1.12671599e-05 1.34349826e-05 1.43209127e-04 -4.28088798e-05 -7.13481329e-05 -1.42696266e-05 1.42707031e-04 2.37845052e-04 4.75690104e-05 -6.42002866e-06 4.16993094e-05 8.33986187e-06 3.33594475e-05 1.38997698e-05 9.02495943e-05 9.91070319e-04 -3.61844250e-04 -3.61844250e-04 1.26431932e-03 1.26431932e-03 7.23412109e-05 2.50597306e-04 1.25298653e-04 3.95377341e-06 4.28088798e-05 -1.20293553e-05 -2.11302091e-05 -4.22604181e-06 4.04560801e-05 7.09359772e-05 1.41871954e-05 -2.44441635e-06 1.23985450e-05 2.47970899e-06 1.04247858e-05 4.34366074e-06 3.30136560e-05 3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 2.08516626e-05 8.77935341e-05 4.64903097e-05 6.58962236e-06 7.13481329e-05 -2.11302091e-05 -3.45682450e-05 -7.04340302e-06 7.09359772e-05 1.16121122e-04 2.36453257e-05 -2.97861377e-06 2.13388414e-05 4.34366074e-06 1.67422057e-05 7.11294712e-06 3.30136560e-05 3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 2.98359579e-05 8.77935341e-05 4.13032244e-05 1.31792447e-06 1.42696266e-05 -4.22604181e-06 -7.04340302e-06 -7.59910514e-07 1.41871954e-05 2.36453257e-05 2.62355898e-06 -5.95722755e-07 4.34366074e-06 4.89269790e-07 3.60141605e-06 8.15449649e-07 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 -5.18708531e-06 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 7.09359772e-05 1.41871954e-05 -1.35576122e-04 -2.37309331e-04 -4.74618663e-05 8.24004626e-06 -4.23131714e-05 -8.46263429e-06 -3.54807188e-05 -1.47836328e-05 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 -7.37468140e-05 -3.09427778e-04 -1.63707443e-04 -2.19886127e-05 -2.37845052e-04 7.09359772e-05 1.16121122e-04 2.36453257e-05 -2.37309331e-04 -3.88706075e-04 -7.91031105e-05 1.02039636e-05 -7.26955279e-05 -1.47836328e-05 -5.70968043e-05 -2.42318426e-05 -1.15322826e-04 -1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 -1.04901397e-04 -3.09427778e-04 -1.45720336e-04 -4.39772254e-06 -4.75690104e-05 1.41871954e-05 2.36453257e-05 2.62355898e-06 -4.74618663e-05 -7.91031105e-05 -9.01114524e-06 2.04079272e-06 -1.47836328e-05 -1.73409032e-06 -1.22344517e-05 -2.89015053e-06 -2.39796963e-05 8.25086154e-05 1.79871070e-05 1.79871070e-05 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 2.97861377e-06 5.95722755e-07 -8.24004626e-06 -1.02039636e-05 -2.04079272e-06 1.40335193e-07 -1.53000038e-06 -3.06000076e-07 -1.12314006e-06 -4.67975025e-07 6.50509780e-06 7.23412109e-05 -2.08516626e-05 -2.98359579e-05 7.37468140e-05 1.04901397e-04 -9.95783968e-07 1.81181256e-05 1.27509189e-05 3.95411785e-06 4.16993094e-05 -1.23985450e-05 -2.13388414e-05 -4.34366074e-06 4.23131714e-05 7.26955279e-05 1.47836328e-05 -1.53000038e-06 9.51122747e-06 1.90867338e-06 7.65895674e-06 3.20700306e-06 2.25343198e-05 2.50597306e-04 -8.77935341e-05 -8.77935341e-05 3.09427778e-04 3.09427778e-04 1.81181256e-05 6.29314743e-05 3.13815141e-05 7.90823570e-07 8.33986187e-06 -2.47970899e-06 -4.34366074e-06 -4.89269790e-07 8.46263429e-06 1.47836328e-05 1.73409032e-06 -3.06000076e-07 1.90867338e-06 3.49595231e-07 1.56090719e-06 5.71522584e-07 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 -4.26298824e-06 3.16329428e-06 3.33594475e-05 -1.04247858e-05 -1.67422057e-05 -3.60141605e-06 3.54807188e-05 5.70968043e-05 1.22344517e-05 -1.12314006e-06 7.65895674e-06 1.56090719e-06 6.07076274e-06 2.57724878e-06 1.12671599e-05 1.25298653e-04 -4.64903097e-05 -4.13032244e-05 1.63707443e-04 1.45720336e-04 1.27509189e-05 3.13815141e-05 1.37277090e-05 1.31803928e-06 1.38997698e-05 -4.34366074e-06 -7.11294712e-06 -8.15449649e-07 1.47836328e-05 2.42318426e-05 2.89015053e-06 -4.67975025e-07 3.20700306e-06 5.71522584e-07 2.57724878e-06 9.59219321e-07 5.18708531e-06 -1.79871070e-05 -4.26298824e-06 -4.09454220e-06 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 - 0 22 44 66 88 105 127 149 166 188 210 227 249 266 288 310 332 354 371 393 415 432 454 476 493 515 532 --2 1 -1 169 - 6.09103871e-05 6.14453477e-04 -5.91853803e-05 -5.91853803e-05 -2.95926902e-04 2.01724529e-04 2.01724529e-04 1.00862265e-03 -4.78869050e-05 6.91187938e-06 3.45593969e-05 -8.29425526e-05 3.45593969e-05 6.14453477e-04 6.16334179e-03 -5.89280869e-04 -5.89280869e-04 -2.94640435e-03 2.00665301e-03 2.00665301e-03 1.00332651e-02 -4.47447198e-04 6.45834401e-05 3.22917201e-04 -7.75001281e-04 3.22917201e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 -5.93986875e-05 -2.96993437e-04 -5.79546830e-05 2.01724907e-04 1.00862453e-03 -5.99184710e-05 -3.84006907e-06 -1.92003453e-05 -8.23728840e-05 3.43220350e-05 5.91853803e-05 5.89280869e-04 -5.93986875e-05 1.57901181e-05 -2.96993437e-04 2.01724907e-04 -5.79546830e-05 1.00862453e-03 -4.13777746e-05 -3.84006907e-06 3.43220350e-05 -9.30773600e-05 -1.92003453e-05 2.95926902e-04 2.94640435e-03 -2.96993437e-04 -2.96993437e-04 -1.40977838e-03 1.00862453e-03 1.00862453e-03 4.78344308e-03 -2.06888873e-04 3.43220350e-05 1.60905699e-04 -3.58342040e-04 1.60905699e-04 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 2.01724907e-04 1.00862453e-03 2.12351688e-04 -6.85394441e-04 -3.42697221e-03 2.00592339e-04 1.40996735e-05 7.04983673e-05 2.73631522e-04 -1.14013134e-04 -2.01724529e-04 -2.00665301e-03 2.01724907e-04 -5.79546830e-05 1.00862453e-03 -6.85394441e-04 2.12351688e-04 -3.42697221e-03 1.36675680e-04 1.40996735e-05 -1.14013134e-04 3.10533823e-04 7.04983673e-05 -1.00862265e-03 -1.00332651e-02 1.00862453e-03 1.00862453e-03 4.78344308e-03 -3.42697221e-03 -3.42697221e-03 -1.62371149e-02 6.83378401e-04 -1.14013134e-04 -5.33163371e-04 1.18364611e-03 -5.33163371e-04 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 4.13777746e-05 2.06888873e-04 -2.00592339e-04 -1.36675680e-04 -6.83378401e-04 1.53794146e-05 -4.67548763e-06 -2.33774382e-05 2.78902609e-05 -1.16209420e-05 6.91187938e-06 6.45834401e-05 3.84006907e-06 3.84006907e-06 -3.43220350e-05 -1.40996735e-05 -1.40996735e-05 1.14013134e-04 -4.67548763e-06 -1.61313514e-07 -3.97900833e-06 -8.09818213e-06 -3.97900833e-06 3.45593969e-05 3.22917201e-04 1.92003453e-05 -3.43220350e-05 -1.60905699e-04 -7.04983673e-05 1.14013134e-04 5.33163371e-04 -2.33774382e-05 -3.97900833e-06 -1.92605535e-05 -2.69156783e-05 1.26855161e-05 -8.29425526e-05 -7.75001281e-04 8.23728840e-05 9.30773600e-05 3.58342040e-04 -2.73631522e-04 -3.10533823e-04 -1.18364611e-03 2.78902609e-05 -8.09818213e-06 -2.69156783e-05 4.75843139e-05 -3.37032945e-05 3.45593969e-05 3.22917201e-04 -3.43220350e-05 1.92003453e-05 -1.60905699e-04 1.14013134e-04 -7.04983673e-05 5.33163371e-04 -1.16209420e-05 -3.97900833e-06 1.26855161e-05 -3.37032945e-05 -1.92605535e-05 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --2 1 0 676 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -3.25689024e-04 -6.51378048e-04 1.06639054e-03 1.06639054e-03 2.13278108e-03 -4.52806801e-05 5.22856257e-05 1.04571251e-04 -7.84284385e-05 1.04571251e-04 9.03813139e-04 6.83095219e-03 -2.52992999e-03 -8.43309998e-04 -2.52992999e-03 7.57080511e-03 2.52360170e-03 7.57080511e-03 5.05224374e-05 6.56305714e-05 1.96891714e-04 -8.75074285e-05 6.56305714e-05 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -2.89608434e-03 -5.79216869e-03 9.35225951e-03 9.35225951e-03 1.87045190e-02 -2.85376584e-04 3.29524496e-04 6.59048991e-04 -4.94286743e-04 6.59048991e-04 6.83095219e-03 4.49022829e-02 -1.71775766e-02 -5.72585887e-03 -1.71775766e-02 4.75796841e-02 1.58598947e-02 4.75796841e-02 -5.20652809e-04 -6.76347839e-04 -2.02904352e-03 9.01797119e-04 -6.76347839e-04 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -6.42637659e-04 -1.28527532e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 -1.33367462e-04 4.04340602e-05 8.08681204e-05 -1.33657432e-04 1.78209909e-04 2.52992999e-03 1.71775766e-02 -5.92699644e-03 -2.38239659e-03 -7.14718976e-03 1.66087992e-02 6.78418274e-03 2.03525482e-02 -2.12097053e-04 -1.25444848e-04 -3.76334544e-04 1.10087490e-04 -8.25656177e-05 3.25689024e-04 2.89608434e-03 -6.42637659e-04 -4.14019247e-04 -1.28527532e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 -4.90670003e-05 4.04340602e-05 1.78209909e-04 -1.82328327e-04 8.08681204e-05 8.43309998e-04 5.72585887e-03 -2.38239659e-03 4.26061120e-04 -2.38239659e-03 6.78418274e-03 -1.48235482e-03 6.78418274e-03 3.56998782e-06 -1.56159564e-04 -8.25656177e-05 -6.18340029e-06 -1.56159564e-04 6.51378048e-04 5.79216869e-03 -1.28527532e-03 -1.28527532e-03 -2.34193222e-03 4.15611128e-03 4.15611128e-03 7.54522870e-03 -9.81340007e-05 1.78209909e-04 3.07748924e-04 -1.69973075e-04 3.07748924e-04 2.52992999e-03 1.71775766e-02 -7.14718976e-03 -2.38239659e-03 -5.92699644e-03 2.03525482e-02 6.78418274e-03 1.66087992e-02 1.07099635e-05 -8.25656177e-05 -3.76334544e-04 2.38725181e-04 -1.25444848e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 -4.10981523e-03 -6.68105894e-03 -1.33621179e-02 3.95156129e-04 -8.87082588e-05 -1.77416518e-04 3.69363005e-04 -4.92484006e-04 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 6.78418274e-03 2.03525482e-02 -4.42337068e-02 -1.85131107e-02 -5.55393321e-02 9.60604637e-04 1.02346772e-03 3.07040317e-03 -1.27914009e-03 9.59355067e-04 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 -6.68105894e-03 -4.10981523e-03 -1.33621179e-02 1.22299680e-04 -8.87082588e-05 -4.92484006e-04 5.26896749e-04 -1.77416518e-04 -2.52360170e-03 -1.58598947e-02 6.78418274e-03 -1.48235482e-03 6.78418274e-03 -1.85131107e-02 5.13458842e-03 -1.85131107e-02 2.09155165e-04 5.12122996e-04 9.59355067e-04 -3.62267372e-04 5.12122996e-04 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 4.15611128e-03 7.54522870e-03 -1.33621179e-02 -1.33621179e-02 -2.41529920e-02 2.44599361e-04 -4.92484006e-04 -8.27434268e-04 4.23658521e-04 -8.27434268e-04 -7.57080511e-03 -4.75796841e-02 2.03525482e-02 6.78418274e-03 1.66087992e-02 -5.55393321e-02 -1.85131107e-02 -4.42337068e-02 6.27465494e-04 9.59355067e-04 3.07040317e-03 -1.47147806e-03 1.02346772e-03 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 4.90670003e-05 9.81340007e-05 -3.95156129e-04 -1.22299680e-04 -2.44599361e-04 -2.59797738e-05 1.69297603e-05 3.38595206e-05 -3.69220468e-05 4.92293958e-05 5.05224374e-05 -5.20652809e-04 2.12097053e-04 -3.56998782e-06 -1.07099635e-05 -9.60604637e-04 -2.09155165e-04 -6.27465494e-04 1.78917197e-04 -1.16268511e-04 -3.48805533e-04 2.92334169e-04 -2.19250627e-04 5.22856257e-05 3.29524496e-04 -4.04340602e-05 -4.04340602e-05 -1.78209909e-04 8.87082588e-05 8.87082588e-05 4.92484006e-04 1.69297603e-05 -2.71695573e-05 -5.38872760e-05 2.93232050e-05 -5.38872760e-05 6.56305714e-05 -6.76347839e-04 1.25444848e-04 1.56159564e-04 8.25656177e-05 -1.02346772e-03 -5.12122996e-04 -9.59355067e-04 -1.16268511e-04 -6.48472168e-06 -5.27432619e-04 3.20296473e-04 -1.72595341e-05 1.04571251e-04 6.59048991e-04 -8.08681204e-05 -1.78209909e-04 -3.07748924e-04 1.77416518e-04 4.92484006e-04 8.27434268e-04 3.38595206e-05 -5.38872760e-05 -1.08000471e-04 7.63940131e-05 -9.44638495e-05 1.96891714e-04 -2.02904352e-03 3.76334544e-04 8.25656177e-05 3.76334544e-04 -3.07040317e-03 -9.59355067e-04 -3.07040317e-03 -3.48805533e-04 -5.27432619e-04 -1.41297171e-03 6.04148906e-04 -5.27432619e-04 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 1.82328327e-04 1.69973075e-04 -3.69363005e-04 -5.26896749e-04 -4.23658521e-04 -3.69220468e-05 2.93232050e-05 7.63940131e-05 -6.86136812e-05 6.75202116e-05 -8.75074285e-05 9.01797119e-04 -1.10087490e-04 6.18340029e-06 -2.38725181e-04 1.27914009e-03 3.62267372e-04 1.47147806e-03 2.92334169e-04 3.20296473e-04 6.04148906e-04 -1.58641225e-04 2.60839721e-04 1.04571251e-04 6.59048991e-04 -1.78209909e-04 -8.08681204e-05 -3.07748924e-04 4.92484006e-04 1.77416518e-04 8.27434268e-04 4.92293958e-05 -5.38872760e-05 -9.44638495e-05 6.75202116e-05 -1.08000471e-04 6.56305714e-05 -6.76347839e-04 8.25656177e-05 1.56159564e-04 1.25444848e-04 -9.59355067e-04 -5.12122996e-04 -1.02346772e-03 -2.19250627e-04 -1.72595341e-05 -5.27432619e-04 2.60839721e-04 -6.48472168e-06 1.25466617e-06 1.34349826e-05 -1.31792447e-06 -3.95377341e-06 -6.58962236e-06 4.39772254e-06 1.31931676e-05 2.19886127e-05 -2.43510507e-06 7.90823570e-07 1.31803928e-06 -2.10886285e-06 3.95411785e-06 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -3.25689024e-04 -6.51378048e-04 1.06639054e-03 1.06639054e-03 2.13278108e-03 -4.52806801e-05 5.22856257e-05 1.04571251e-04 -7.84284385e-05 1.04571251e-04 1.34349826e-05 1.43209127e-04 -1.42696266e-05 -4.28088798e-05 -7.13481329e-05 4.75690104e-05 1.42707031e-04 2.37845052e-04 -2.56801146e-05 8.33986187e-06 1.38997698e-05 -2.22396317e-05 4.16993094e-05 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -2.89608434e-03 -5.79216869e-03 9.35225951e-03 9.35225951e-03 1.87045190e-02 -2.85376584e-04 3.29524496e-04 6.59048991e-04 -4.94286743e-04 6.59048991e-04 1.31792447e-06 1.42696266e-05 -7.59910514e-07 -4.22604181e-06 -7.04340302e-06 2.62355898e-06 1.41871954e-05 2.36453257e-05 -2.82105641e-06 4.89269790e-07 8.15449649e-07 -2.31661906e-06 4.34366074e-06 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -6.42637659e-04 -1.28527532e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 -1.33367462e-04 4.04340602e-05 8.08681204e-05 -1.33657432e-04 1.78209909e-04 3.95377341e-06 4.28088798e-05 -4.22604181e-06 -1.20293553e-05 -2.11302091e-05 1.41871954e-05 4.04560801e-05 7.09359772e-05 -7.80592115e-06 2.47970899e-06 4.34366074e-06 -7.32931955e-06 1.23985450e-05 3.25689024e-04 2.89608434e-03 -6.42637659e-04 -4.14019247e-04 -1.28527532e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 -4.90670003e-05 4.04340602e-05 1.78209909e-04 -1.82328327e-04 8.08681204e-05 6.58962236e-06 7.13481329e-05 -7.04340302e-06 -2.11302091e-05 -3.45682450e-05 2.36453257e-05 7.09359772e-05 1.16121122e-04 -1.30098686e-05 4.34366074e-06 7.11294712e-06 -1.09506581e-05 2.13388414e-05 6.51378048e-04 5.79216869e-03 -1.28527532e-03 -1.28527532e-03 -2.34193222e-03 4.15611128e-03 4.15611128e-03 7.54522870e-03 -9.81340007e-05 1.78209909e-04 3.07748924e-04 -1.69973075e-04 3.07748924e-04 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 1.41871954e-05 2.36453257e-05 -9.01114524e-06 -4.74618663e-05 -7.91031105e-05 9.57494961e-06 -1.73409032e-06 -2.89015053e-06 7.88460418e-06 -1.47836328e-05 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 -4.10981523e-03 -6.68105894e-03 -1.33621179e-02 3.95156129e-04 -8.87082588e-05 -1.77416518e-04 3.69363005e-04 -4.92484006e-04 -1.31931676e-05 -1.42707031e-04 1.41871954e-05 4.04560801e-05 7.09359772e-05 -4.74618663e-05 -1.35576122e-04 -2.37309331e-04 2.66071807e-05 -8.46263429e-06 -1.47836328e-05 2.48764488e-05 -4.23131714e-05 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 -6.68105894e-03 -4.10981523e-03 -1.33621179e-02 1.22299680e-04 -8.87082588e-05 -4.92484006e-04 5.26896749e-04 -1.77416518e-04 -2.19886127e-05 -2.37845052e-04 2.36453257e-05 7.09359772e-05 1.16121122e-04 -7.91031105e-05 -2.37309331e-04 -3.88706075e-04 4.43453012e-05 -1.47836328e-05 -2.42318426e-05 3.73852938e-05 -7.26955279e-05 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 4.15611128e-03 7.54522870e-03 -1.33621179e-02 -1.33621179e-02 -2.41529920e-02 2.44599361e-04 -4.92484006e-04 -8.27434268e-04 4.23658521e-04 -8.27434268e-04 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 7.80592115e-06 1.30098686e-05 -9.57494961e-06 -2.66071807e-05 -4.43453012e-05 3.61548803e-06 -1.19878524e-06 -1.99797541e-06 3.12952049e-06 -5.86785091e-06 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 4.90670003e-05 9.81340007e-05 -3.95156129e-04 -1.22299680e-04 -2.44599361e-04 -2.59797738e-05 1.69297603e-05 3.38595206e-05 -3.69220468e-05 4.92293958e-05 7.90823570e-07 8.33986187e-06 -4.89269790e-07 -2.47970899e-06 -4.34366074e-06 1.73409032e-06 8.46263429e-06 1.47836328e-05 -1.19878524e-06 3.49595231e-07 5.71522584e-07 -1.04545744e-06 1.90867338e-06 5.22856257e-05 3.29524496e-04 -4.04340602e-05 -4.04340602e-05 -1.78209909e-04 8.87082588e-05 8.87082588e-05 4.92484006e-04 1.69297603e-05 -2.71695573e-05 -5.38872760e-05 2.93232050e-05 -5.38872760e-05 1.31803928e-06 1.38997698e-05 -8.15449649e-07 -4.34366074e-06 -7.11294712e-06 2.89015053e-06 1.47836328e-05 2.42318426e-05 -1.99797541e-06 5.71522584e-07 9.59219321e-07 -1.69390265e-06 3.20700306e-06 1.04571251e-04 6.59048991e-04 -8.08681204e-05 -1.78209909e-04 -3.07748924e-04 1.77416518e-04 4.92484006e-04 8.27434268e-04 3.38595206e-05 -5.38872760e-05 -1.08000471e-04 7.63940131e-05 -9.44638495e-05 -2.10886285e-06 -2.22396317e-05 2.31661906e-06 7.32931955e-06 1.09506581e-05 -7.88460418e-06 -2.48764488e-05 -3.73852938e-05 3.12952049e-06 -1.04545744e-06 -1.69390265e-06 2.59560990e-06 -5.15449757e-06 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 1.82328327e-04 1.69973075e-04 -3.69363005e-04 -5.26896749e-04 -4.23658521e-04 -3.69220468e-05 2.93232050e-05 7.63940131e-05 -6.86136812e-05 6.75202116e-05 3.95411785e-06 4.16993094e-05 -4.34366074e-06 -1.23985450e-05 -2.13388414e-05 1.47836328e-05 4.23131714e-05 7.26955279e-05 -5.86785091e-06 1.90867338e-06 3.20700306e-06 -5.15449757e-06 9.51122747e-06 1.04571251e-04 6.59048991e-04 -1.78209909e-04 -8.08681204e-05 -3.07748924e-04 4.92484006e-04 1.77416518e-04 8.27434268e-04 4.92293958e-05 -5.38872760e-05 -9.44638495e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 364 390 416 442 468 494 520 546 572 598 624 650 676 --2 1 1 624 - 1.70328256e-04 1.56710856e-03 -6.51378048e-04 -3.25689024e-04 -3.25689024e-04 2.13278108e-03 1.06639054e-03 1.06639054e-03 9.05613602e-05 1.04571251e-04 1.04571251e-04 5.22856257e-05 6.09103871e-05 6.14453477e-04 -2.95926902e-04 -5.91853803e-05 -5.91853803e-05 1.00862265e-03 2.01724529e-04 2.01724529e-04 9.57738101e-05 3.45593969e-05 3.45593969e-05 6.91187938e-06 1.56710856e-03 1.39613919e-02 -5.79216869e-03 -2.89608434e-03 -2.89608434e-03 1.87045190e-02 9.35225951e-03 9.35225951e-03 5.70753169e-04 6.59048991e-04 6.59048991e-04 3.29524496e-04 6.14453477e-04 6.16334179e-03 -2.94640435e-03 -5.89280869e-04 -5.89280869e-04 1.00332651e-02 2.00665301e-03 2.00665301e-03 8.94894397e-04 3.22917201e-04 3.22917201e-04 6.45834401e-05 6.51378048e-04 5.79216869e-03 -2.34193222e-03 -1.28527532e-03 -1.28527532e-03 7.54522870e-03 4.15611128e-03 4.15611128e-03 1.96268001e-04 3.07748924e-04 3.07748924e-04 1.78209909e-04 2.95926902e-04 2.94640435e-03 -1.40977838e-03 -2.96993437e-04 -2.96993437e-04 4.78344308e-03 1.00862453e-03 1.00862453e-03 4.13777746e-04 1.60905699e-04 1.60905699e-04 3.43220350e-05 3.25689024e-04 2.89608434e-03 -1.28527532e-03 -4.14019247e-04 -6.42637659e-04 4.15611128e-03 1.31106178e-03 2.07805564e-03 1.82434463e-04 8.08681204e-05 1.78209909e-04 -4.86708945e-05 4.04340602e-05 5.91853803e-05 5.89280869e-04 -2.96993437e-04 1.57901181e-05 -5.93986875e-05 1.00862453e-03 -5.79546830e-05 2.01724907e-04 1.01296246e-04 -1.92003453e-05 3.43220350e-05 -1.07044761e-05 -3.84006907e-06 3.25689024e-04 2.89608434e-03 -1.28527532e-03 -6.42637659e-04 -4.14019247e-04 4.15611128e-03 2.07805564e-03 1.31106178e-03 1.82434463e-04 1.78209909e-04 8.08681204e-05 4.86708945e-05 4.04340602e-05 5.91853803e-05 5.89280869e-04 -2.96993437e-04 -5.93986875e-05 1.57901181e-05 1.00862453e-03 2.01724907e-04 -5.79546830e-05 1.01296246e-04 3.43220350e-05 -1.92003453e-05 1.07044761e-05 -3.84006907e-06 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 4.15611128e-03 4.15611128e-03 -2.41529920e-02 -1.33621179e-02 -1.33621179e-02 -4.89198722e-04 -8.27434268e-04 -8.27434268e-04 -4.92484006e-04 -1.00862265e-03 -1.00332651e-02 4.78344308e-03 1.00862453e-03 1.00862453e-03 -1.62371149e-02 -3.42697221e-03 -3.42697221e-03 -1.36675680e-03 -5.33163371e-04 -5.33163371e-04 -1.14013134e-04 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.33621179e-02 -4.10981523e-03 -6.68105894e-03 -5.17455810e-04 -1.77416518e-04 -4.92484006e-04 1.57533744e-04 -8.87082588e-05 -2.01724529e-04 -2.00665301e-03 1.00862453e-03 -5.79546830e-05 2.01724907e-04 -3.42697221e-03 2.12351688e-04 -6.85394441e-04 -3.37268019e-04 7.04983673e-05 -1.14013134e-04 3.69023003e-05 1.40996735e-05 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.33621179e-02 -6.68105894e-03 -4.10981523e-03 -5.17455810e-04 -4.92484006e-04 -1.77416518e-04 -1.57533744e-04 -8.87082588e-05 -2.01724529e-04 -2.00665301e-03 1.00862453e-03 2.01724907e-04 -5.79546830e-05 -3.42697221e-03 -6.85394441e-04 2.12351688e-04 -3.37268019e-04 -1.14013134e-04 7.04983673e-05 -3.69023003e-05 1.40996735e-05 9.05613602e-05 5.70753169e-04 -1.96268001e-04 -1.82434463e-04 -1.82434463e-04 4.89198722e-04 5.17455810e-04 5.17455810e-04 -8.99306349e-05 -8.30889164e-05 -8.30889164e-05 -3.38595206e-05 9.57738101e-05 8.94894397e-04 -4.13777746e-04 -1.01296246e-04 -1.01296246e-04 1.36675680e-03 3.37268019e-04 3.37268019e-04 6.36867635e-05 3.49983802e-05 3.49983802e-05 9.35097527e-06 1.04571251e-04 6.59048991e-04 -3.07748924e-04 -8.08681204e-05 -1.78209909e-04 8.27434268e-04 1.77416518e-04 4.92484006e-04 -8.30889164e-05 -1.08000471e-04 -9.44638495e-05 -8.87380160e-06 -5.38872760e-05 3.45593969e-05 3.22917201e-04 -1.60905699e-04 1.92003453e-05 -3.43220350e-05 5.33163371e-04 -7.04983673e-05 1.14013134e-04 3.49983802e-05 -1.92605535e-05 1.26855161e-05 -6.78761620e-06 -3.97900833e-06 1.04571251e-04 6.59048991e-04 -3.07748924e-04 -1.78209909e-04 -8.08681204e-05 8.27434268e-04 4.92484006e-04 1.77416518e-04 -8.30889164e-05 -9.44638495e-05 -1.08000471e-04 8.87380160e-06 -5.38872760e-05 3.45593969e-05 3.22917201e-04 -1.60905699e-04 -3.43220350e-05 1.92003453e-05 5.33163371e-04 1.14013134e-04 -7.04983673e-05 3.49983802e-05 1.26855161e-05 -1.92605535e-05 6.78761620e-06 -3.97900833e-06 4.86708945e-05 -4.86708945e-05 -1.57533744e-04 1.57533744e-04 -8.87380160e-06 8.87380160e-06 -4.66282012e-06 1.07044761e-05 -1.07044761e-05 -3.69023003e-05 3.69023003e-05 -6.78761620e-06 6.78761620e-06 -7.23035088e-07 5.22856257e-05 3.29524496e-04 -1.78209909e-04 -4.04340602e-05 -4.04340602e-05 4.92484006e-04 8.87082588e-05 8.87082588e-05 -3.38595206e-05 -5.38872760e-05 -5.38872760e-05 -2.71695573e-05 6.91187938e-06 6.45834401e-05 -3.43220350e-05 3.84006907e-06 3.84006907e-06 1.14013134e-04 -1.40996735e-05 -1.40996735e-05 9.35097527e-06 -3.97900833e-06 -3.97900833e-06 -1.61313514e-07 6.09103871e-05 6.14453477e-04 -1.77556141e-04 -1.77556141e-04 -1.77556141e-04 6.05173587e-04 6.05173587e-04 6.05173587e-04 6.22069144e-05 6.22069144e-05 6.22069144e-05 1.70328256e-04 1.56710856e-03 -6.51378048e-04 -3.25689024e-04 -3.25689024e-04 2.13278108e-03 1.06639054e-03 1.06639054e-03 9.05613602e-05 1.04571251e-04 1.04571251e-04 5.22856257e-05 6.14453477e-04 6.16334179e-03 -1.76784261e-03 -1.76784261e-03 -1.76784261e-03 6.01995904e-03 6.01995904e-03 6.01995904e-03 5.81250961e-04 5.81250961e-04 5.81250961e-04 1.56710856e-03 1.39613919e-02 -5.79216869e-03 -2.89608434e-03 -2.89608434e-03 1.87045190e-02 9.35225951e-03 9.35225951e-03 5.70753169e-04 6.59048991e-04 6.59048991e-04 3.29524496e-04 1.77556141e-04 1.76784261e-03 -4.59399382e-04 -5.34588187e-04 -5.34588187e-04 1.55584457e-03 1.81552416e-03 1.81552416e-03 -3.70813928e-05 1.53225561e-04 1.53225561e-04 1.85338989e-04 6.51378048e-04 5.79216869e-03 -2.34193222e-03 -1.28527532e-03 -1.28527532e-03 7.54522870e-03 4.15611128e-03 4.15611128e-03 1.96268001e-04 3.07748924e-04 3.07748924e-04 1.78209909e-04 1.77556141e-04 1.76784261e-03 -5.34588187e-04 -4.59399382e-04 -5.34588187e-04 1.81552416e-03 1.55584457e-03 1.81552416e-03 1.85406964e-05 1.53225561e-04 1.85338989e-04 -3.21134282e-05 1.53225561e-04 3.25689024e-04 2.89608434e-03 -1.28527532e-03 -4.14019247e-04 -6.42637659e-04 4.15611128e-03 1.31106178e-03 2.07805564e-03 1.82434463e-04 8.08681204e-05 1.78209909e-04 -4.86708945e-05 4.04340602e-05 1.77556141e-04 1.76784261e-03 -5.34588187e-04 -5.34588187e-04 -4.59399382e-04 1.81552416e-03 1.81552416e-03 1.55584457e-03 1.85406964e-05 1.85338989e-04 1.53225561e-04 3.21134282e-05 1.53225561e-04 3.25689024e-04 2.89608434e-03 -1.28527532e-03 -6.42637659e-04 -4.14019247e-04 4.15611128e-03 2.07805564e-03 1.31106178e-03 1.82434463e-04 1.78209909e-04 8.08681204e-05 4.86708945e-05 4.04340602e-05 -6.05173587e-04 -6.01995904e-03 1.55584457e-03 1.81552416e-03 1.81552416e-03 -5.27080384e-03 -6.16854997e-03 -6.16854997e-03 1.27833318e-04 -5.04964025e-04 -5.04964025e-04 -6.15670926e-04 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 4.15611128e-03 4.15611128e-03 -2.41529920e-02 -1.33621179e-02 -1.33621179e-02 -4.89198722e-04 -8.27434268e-04 -8.27434268e-04 -4.92484006e-04 -6.05173587e-04 -6.01995904e-03 1.81552416e-03 1.55584457e-03 1.81552416e-03 -6.16854997e-03 -5.27080384e-03 -6.16854997e-03 -6.39166591e-05 -5.04964025e-04 -6.15670926e-04 1.10706901e-04 -5.04964025e-04 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.33621179e-02 -4.10981523e-03 -6.68105894e-03 -5.17455810e-04 -1.77416518e-04 -4.92484006e-04 1.57533744e-04 -8.87082588e-05 -6.05173587e-04 -6.01995904e-03 1.81552416e-03 1.81552416e-03 1.55584457e-03 -6.16854997e-03 -6.16854997e-03 -5.27080384e-03 -6.39166591e-05 -6.15670926e-04 -5.04964025e-04 -1.10706901e-04 -5.04964025e-04 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.33621179e-02 -6.68105894e-03 -4.10981523e-03 -5.17455810e-04 -4.92484006e-04 -1.77416518e-04 -1.57533744e-04 -8.87082588e-05 3.70813928e-05 -1.85406964e-05 -1.85406964e-05 -1.27833318e-04 6.39166591e-05 6.39166591e-05 -2.24434069e-05 -7.05389767e-06 -7.05389767e-06 1.41077953e-05 9.05613602e-05 5.70753169e-04 -1.96268001e-04 -1.82434463e-04 -1.82434463e-04 4.89198722e-04 5.17455810e-04 5.17455810e-04 -8.99306349e-05 -8.30889164e-05 -8.30889164e-05 -3.38595206e-05 6.22069144e-05 5.81250961e-04 -1.53225561e-04 -1.53225561e-04 -1.85338989e-04 5.04964025e-04 5.04964025e-04 6.15670926e-04 -7.05389767e-06 2.30560406e-05 3.32817384e-05 -1.22177092e-05 3.32817384e-05 1.04571251e-04 6.59048991e-04 -3.07748924e-04 -8.08681204e-05 -1.78209909e-04 8.27434268e-04 1.77416518e-04 4.92484006e-04 -8.30889164e-05 -1.08000471e-04 -9.44638495e-05 -8.87380160e-06 -5.38872760e-05 6.22069144e-05 5.81250961e-04 -1.53225561e-04 -1.85338989e-04 -1.53225561e-04 5.04964025e-04 6.15670926e-04 5.04964025e-04 -7.05389767e-06 3.32817384e-05 2.30560406e-05 1.22177092e-05 3.32817384e-05 1.04571251e-04 6.59048991e-04 -3.07748924e-04 -1.78209909e-04 -8.08681204e-05 8.27434268e-04 4.92484006e-04 1.77416518e-04 -8.30889164e-05 -9.44638495e-05 -1.08000471e-04 8.87380160e-06 -5.38872760e-05 3.21134282e-05 -3.21134282e-05 -1.10706901e-04 1.10706901e-04 -1.22177092e-05 1.22177092e-05 -2.24434069e-05 4.86708945e-05 -4.86708945e-05 -1.57533744e-04 1.57533744e-04 -8.87380160e-06 8.87380160e-06 -4.66282012e-06 6.22069144e-05 5.81250961e-04 -1.85338989e-04 -1.53225561e-04 -1.53225561e-04 6.15670926e-04 5.04964025e-04 5.04964025e-04 1.41077953e-05 3.32817384e-05 3.32817384e-05 2.30560406e-05 5.22856257e-05 3.29524496e-04 -1.78209909e-04 -4.04340602e-05 -4.04340602e-05 4.92484006e-04 8.87082588e-05 8.87082588e-05 -3.38595206e-05 -5.38872760e-05 -5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 24 48 72 98 124 148 174 200 224 250 276 290 314 337 360 384 410 436 460 486 512 534 560 586 600 624 --2 1 2 169 - 1.25466617e-06 1.34349826e-05 -6.58962236e-06 -3.95377341e-06 -1.31792447e-06 2.19886127e-05 1.31931676e-05 4.39772254e-06 3.04388134e-06 3.95411785e-06 1.31803928e-06 1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 -7.13481329e-05 -4.28088798e-05 -1.42696266e-05 2.37845052e-04 1.42707031e-04 4.75690104e-05 3.21001433e-05 4.16993094e-05 1.38997698e-05 1.11198158e-05 8.33986187e-06 6.58962236e-06 7.13481329e-05 -3.45682450e-05 -2.11302091e-05 -7.04340302e-06 1.16121122e-04 7.09359772e-05 2.36453257e-05 1.59884824e-05 2.13388414e-05 7.11294712e-06 5.79154766e-06 4.34366074e-06 3.95377341e-06 4.28088798e-05 -2.11302091e-05 -1.20293553e-05 -4.22604181e-06 7.09359772e-05 4.04560801e-05 1.41871954e-05 1.02503375e-05 1.23985450e-05 4.34366074e-06 3.09546624e-06 2.47970899e-06 1.31792447e-06 1.42696266e-05 -7.04340302e-06 -4.22604181e-06 -7.59910514e-07 2.36453257e-05 1.41871954e-05 2.62355898e-06 3.41677917e-06 4.34366074e-06 8.15449649e-07 1.28479698e-06 4.89269790e-07 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 7.09359772e-05 2.36453257e-05 -3.88706075e-04 -2.37309331e-04 -7.91031105e-05 -5.45492648e-05 -7.26955279e-05 -2.42318426e-05 -1.97115105e-05 -1.47836328e-05 -1.31931676e-05 -1.42707031e-04 7.09359772e-05 4.04560801e-05 1.41871954e-05 -2.37309331e-04 -1.35576122e-04 -4.74618663e-05 -3.48472270e-05 -4.23131714e-05 -1.47836328e-05 -1.06042700e-05 -8.46263429e-06 -4.39772254e-06 -4.75690104e-05 2.36453257e-05 1.41871954e-05 2.62355898e-06 -7.91031105e-05 -4.74618663e-05 -9.01114524e-06 -1.16157423e-05 -1.47836328e-05 -2.89015053e-06 -4.34984751e-06 -1.73409032e-06 3.04388134e-06 3.21001433e-05 -1.59884824e-05 -1.02503375e-05 -3.41677917e-06 5.45492648e-05 3.48472270e-05 1.16157423e-05 5.56082368e-06 7.39785129e-06 2.46595043e-06 2.00638043e-06 1.50478532e-06 3.95411785e-06 4.16993094e-05 -2.13388414e-05 -1.23985450e-05 -4.34366074e-06 7.26955279e-05 4.23131714e-05 1.47836328e-05 7.39785129e-06 9.51122747e-06 3.20700306e-06 2.50445917e-06 1.90867338e-06 1.31803928e-06 1.38997698e-05 -7.11294712e-06 -4.34366074e-06 -8.15449649e-07 2.42318426e-05 1.47836328e-05 2.89015053e-06 2.46595043e-06 3.20700306e-06 9.59219321e-07 8.83346132e-07 5.71522584e-07 1.05443143e-06 1.11198158e-05 -5.79154766e-06 -3.09546624e-06 -1.28479698e-06 1.97115105e-05 1.06042700e-05 4.34984751e-06 2.00638043e-06 2.50445917e-06 8.83346132e-07 6.50274256e-07 5.15449757e-07 7.90823570e-07 8.33986187e-06 -4.34366074e-06 -2.47970899e-06 -4.89269790e-07 1.47836328e-05 8.46263429e-06 1.73409032e-06 1.50478532e-06 1.90867338e-06 5.71522584e-07 5.15449757e-07 3.49595231e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 --2 2 -1 169 - 1.25466617e-06 1.34349826e-05 -3.95377341e-06 1.31792447e-06 -6.58962236e-06 1.31931676e-05 -4.39772254e-06 2.19886127e-05 -6.08776268e-07 -7.90823570e-07 3.95411785e-06 -3.16329428e-06 -1.31803928e-06 1.34349826e-05 1.43209127e-04 -4.28088798e-05 1.42696266e-05 -7.13481329e-05 1.42707031e-04 -4.75690104e-05 2.37845052e-04 -6.42002866e-06 -8.33986187e-06 4.16993094e-05 -3.33594475e-05 -1.38997698e-05 3.95377341e-06 4.28088798e-05 -1.20293553e-05 4.22604181e-06 -2.11302091e-05 4.04560801e-05 -1.41871954e-05 7.09359772e-05 -2.44441635e-06 -2.47970899e-06 1.23985450e-05 -1.04247858e-05 -4.34366074e-06 -1.31792447e-06 -1.42696266e-05 4.22604181e-06 -7.59910514e-07 7.04340302e-06 -1.41871954e-05 2.62355898e-06 -2.36453257e-05 5.95722755e-07 4.89269790e-07 -4.34366074e-06 3.60141605e-06 8.15449649e-07 6.58962236e-06 7.13481329e-05 -2.11302091e-05 7.04340302e-06 -3.45682450e-05 7.09359772e-05 -2.36453257e-05 1.16121122e-04 -2.97861377e-06 -4.34366074e-06 2.13388414e-05 -1.67422057e-05 -7.11294712e-06 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 -1.41871954e-05 7.09359772e-05 -1.35576122e-04 4.74618663e-05 -2.37309331e-04 8.24004626e-06 8.46263429e-06 -4.23131714e-05 3.54807188e-05 1.47836328e-05 4.39772254e-06 4.75690104e-05 -1.41871954e-05 2.62355898e-06 -2.36453257e-05 4.74618663e-05 -9.01114524e-06 7.91031105e-05 -2.04079272e-06 -1.73409032e-06 1.47836328e-05 -1.22344517e-05 -2.89015053e-06 -2.19886127e-05 -2.37845052e-04 7.09359772e-05 -2.36453257e-05 1.16121122e-04 -2.37309331e-04 7.91031105e-05 -3.88706075e-04 1.02039636e-05 1.47836328e-05 -7.26955279e-05 5.70968043e-05 2.42318426e-05 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 -5.95722755e-07 2.97861377e-06 -8.24004626e-06 2.04079272e-06 -1.02039636e-05 1.40335193e-07 3.06000076e-07 -1.53000038e-06 1.12314006e-06 4.67975025e-07 -7.90823570e-07 -8.33986187e-06 2.47970899e-06 -4.89269790e-07 4.34366074e-06 -8.46263429e-06 1.73409032e-06 -1.47836328e-05 3.06000076e-07 3.49595231e-07 -1.90867338e-06 1.56090719e-06 5.71522584e-07 3.95411785e-06 4.16993094e-05 -1.23985450e-05 4.34366074e-06 -2.13388414e-05 4.23131714e-05 -1.47836328e-05 7.26955279e-05 -1.53000038e-06 -1.90867338e-06 9.51122747e-06 -7.65895674e-06 -3.20700306e-06 -3.16329428e-06 -3.33594475e-05 1.04247858e-05 -3.60141605e-06 1.67422057e-05 -3.54807188e-05 1.22344517e-05 -5.70968043e-05 1.12314006e-06 1.56090719e-06 -7.65895674e-06 6.07076274e-06 2.57724878e-06 -1.31803928e-06 -1.38997698e-05 4.34366074e-06 -8.15449649e-07 7.11294712e-06 -1.47836328e-05 2.89015053e-06 -2.42318426e-05 4.67975025e-07 5.71522584e-07 -3.20700306e-06 2.57724878e-06 9.59219321e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --2 2 0 532 - 8.23315696e-06 9.02495943e-05 -3.30136560e-05 -3.30136560e-05 1.15322826e-04 1.15322826e-04 6.50509780e-06 2.25343198e-05 -1.12671599e-05 1.25466617e-06 1.34349826e-05 -6.58962236e-06 1.31792447e-06 -3.95377341e-06 2.19886127e-05 -4.39772254e-06 1.31931676e-05 3.04388134e-06 -1.31803928e-06 3.95411785e-06 -1.05443143e-06 -7.90823570e-07 9.02495943e-05 9.91070319e-04 -3.61844250e-04 -3.61844250e-04 1.26431932e-03 1.26431932e-03 7.23412109e-05 2.50597306e-04 -1.25298653e-04 1.34349826e-05 1.43209127e-04 -7.13481329e-05 1.42696266e-05 -4.28088798e-05 2.37845052e-04 -4.75690104e-05 1.42707031e-04 3.21001433e-05 -1.38997698e-05 4.16993094e-05 -1.11198158e-05 -8.33986187e-06 3.30136560e-05 3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 2.08516626e-05 8.77935341e-05 -4.64903097e-05 6.58962236e-06 7.13481329e-05 -3.45682450e-05 7.04340302e-06 -2.11302091e-05 1.16121122e-04 -2.36453257e-05 7.09359772e-05 1.59884824e-05 -7.11294712e-06 2.13388414e-05 -5.79154766e-06 -4.34366074e-06 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 -5.18708531e-06 -1.31792447e-06 -1.42696266e-05 7.04340302e-06 -7.59910514e-07 4.22604181e-06 -2.36453257e-05 2.62355898e-06 -1.41871954e-05 -3.41677917e-06 8.15449649e-07 -4.34366074e-06 1.28479698e-06 4.89269790e-07 3.30136560e-05 3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 2.98359579e-05 8.77935341e-05 -4.13032244e-05 3.95377341e-06 4.28088798e-05 -2.11302091e-05 4.22604181e-06 -1.20293553e-05 7.09359772e-05 -1.41871954e-05 4.04560801e-05 1.02503375e-05 -4.34366074e-06 1.23985450e-05 -3.09546624e-06 -2.47970899e-06 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 -7.37468140e-05 -3.09427778e-04 1.63707443e-04 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 -2.36453257e-05 7.09359772e-05 -3.88706075e-04 7.91031105e-05 -2.37309331e-04 -5.45492648e-05 2.42318426e-05 -7.26955279e-05 1.97115105e-05 1.47836328e-05 -2.39796963e-05 8.25086154e-05 1.79871070e-05 1.79871070e-05 4.39772254e-06 4.75690104e-05 -2.36453257e-05 2.62355898e-06 -1.41871954e-05 7.91031105e-05 -9.01114524e-06 4.74618663e-05 1.16157423e-05 -2.89015053e-06 1.47836328e-05 -4.34984751e-06 -1.73409032e-06 -1.15322826e-04 -1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 -1.04901397e-04 -3.09427778e-04 1.45720336e-04 -1.31931676e-05 -1.42707031e-04 7.09359772e-05 -1.41871954e-05 4.04560801e-05 -2.37309331e-04 4.74618663e-05 -1.35576122e-04 -3.48472270e-05 1.47836328e-05 -4.23131714e-05 1.06042700e-05 8.46263429e-06 6.50509780e-06 7.23412109e-05 -2.08516626e-05 -2.98359579e-05 7.37468140e-05 1.04901397e-04 -9.95783968e-07 1.81181256e-05 -1.27509189e-05 3.04388134e-06 3.21001433e-05 -1.59884824e-05 3.41677917e-06 -1.02503375e-05 5.45492648e-05 -1.16157423e-05 3.48472270e-05 5.56082368e-06 -2.46595043e-06 7.39785129e-06 -2.00638043e-06 -1.50478532e-06 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 -4.26298824e-06 -1.31803928e-06 -1.38997698e-05 7.11294712e-06 -8.15449649e-07 4.34366074e-06 -2.42318426e-05 2.89015053e-06 -1.47836328e-05 -2.46595043e-06 9.59219321e-07 -3.20700306e-06 8.83346132e-07 5.71522584e-07 2.25343198e-05 2.50597306e-04 -8.77935341e-05 -8.77935341e-05 3.09427778e-04 3.09427778e-04 1.81181256e-05 6.29314743e-05 -3.13815141e-05 3.95411785e-06 4.16993094e-05 -2.13388414e-05 4.34366074e-06 -1.23985450e-05 7.26955279e-05 -1.47836328e-05 4.23131714e-05 7.39785129e-06 -3.20700306e-06 9.51122747e-06 -2.50445917e-06 -1.90867338e-06 -1.12671599e-05 -1.25298653e-04 4.64903097e-05 4.13032244e-05 -1.63707443e-04 -1.45720336e-04 -1.27509189e-05 -3.13815141e-05 1.37277090e-05 -1.05443143e-06 -1.11198158e-05 5.79154766e-06 -1.28479698e-06 3.09546624e-06 -1.97115105e-05 4.34984751e-06 -1.06042700e-05 -2.00638043e-06 8.83346132e-07 -2.50445917e-06 6.50274256e-07 5.15449757e-07 5.18708531e-06 -1.79871070e-05 -4.26298824e-06 -4.09454220e-06 -7.90823570e-07 -8.33986187e-06 4.34366074e-06 -4.89269790e-07 2.47970899e-06 -1.47836328e-05 1.73409032e-06 -8.46263429e-06 -1.50478532e-06 5.71522584e-07 -1.90867338e-06 5.15449757e-07 3.49595231e-07 1.25466617e-06 1.34349826e-05 -3.95377341e-06 -1.31792447e-06 -6.58962236e-06 1.31931676e-05 4.39772254e-06 2.19886127e-05 -6.08776268e-07 7.90823570e-07 3.95411785e-06 -3.16329428e-06 1.31803928e-06 8.23315696e-06 9.02495943e-05 -3.30136560e-05 -3.30136560e-05 1.15322826e-04 1.15322826e-04 6.50509780e-06 2.25343198e-05 -1.12671599e-05 1.34349826e-05 1.43209127e-04 -4.28088798e-05 -1.42696266e-05 -7.13481329e-05 1.42707031e-04 4.75690104e-05 2.37845052e-04 -6.42002866e-06 8.33986187e-06 4.16993094e-05 -3.33594475e-05 1.38997698e-05 9.02495943e-05 9.91070319e-04 -3.61844250e-04 -3.61844250e-04 1.26431932e-03 1.26431932e-03 7.23412109e-05 2.50597306e-04 -1.25298653e-04 3.95377341e-06 4.28088798e-05 -1.20293553e-05 -4.22604181e-06 -2.11302091e-05 4.04560801e-05 1.41871954e-05 7.09359772e-05 -2.44441635e-06 2.47970899e-06 1.23985450e-05 -1.04247858e-05 4.34366074e-06 3.30136560e-05 3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 2.08516626e-05 8.77935341e-05 -4.64903097e-05 1.31792447e-06 1.42696266e-05 -4.22604181e-06 -7.59910514e-07 -7.04340302e-06 1.41871954e-05 2.62355898e-06 2.36453257e-05 -5.95722755e-07 4.89269790e-07 4.34366074e-06 -3.60141605e-06 8.15449649e-07 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 -5.18708531e-06 6.58962236e-06 7.13481329e-05 -2.11302091e-05 -7.04340302e-06 -3.45682450e-05 7.09359772e-05 2.36453257e-05 1.16121122e-04 -2.97861377e-06 4.34366074e-06 2.13388414e-05 -1.67422057e-05 7.11294712e-06 3.30136560e-05 3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 2.98359579e-05 8.77935341e-05 -4.13032244e-05 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 1.41871954e-05 7.09359772e-05 -1.35576122e-04 -4.74618663e-05 -2.37309331e-04 8.24004626e-06 -8.46263429e-06 -4.23131714e-05 3.54807188e-05 -1.47836328e-05 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 -7.37468140e-05 -3.09427778e-04 1.63707443e-04 -4.39772254e-06 -4.75690104e-05 1.41871954e-05 2.62355898e-06 2.36453257e-05 -4.74618663e-05 -9.01114524e-06 -7.91031105e-05 2.04079272e-06 -1.73409032e-06 -1.47836328e-05 1.22344517e-05 -2.89015053e-06 -2.39796963e-05 8.25086154e-05 1.79871070e-05 1.79871070e-05 -2.19886127e-05 -2.37845052e-04 7.09359772e-05 2.36453257e-05 1.16121122e-04 -2.37309331e-04 -7.91031105e-05 -3.88706075e-04 1.02039636e-05 -1.47836328e-05 -7.26955279e-05 5.70968043e-05 -2.42318426e-05 -1.15322826e-04 -1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 -1.04901397e-04 -3.09427778e-04 1.45720336e-04 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 5.95722755e-07 2.97861377e-06 -8.24004626e-06 -2.04079272e-06 -1.02039636e-05 1.40335193e-07 -3.06000076e-07 -1.53000038e-06 1.12314006e-06 -4.67975025e-07 6.50509780e-06 7.23412109e-05 -2.08516626e-05 -2.98359579e-05 7.37468140e-05 1.04901397e-04 -9.95783968e-07 1.81181256e-05 -1.27509189e-05 7.90823570e-07 8.33986187e-06 -2.47970899e-06 -4.89269790e-07 -4.34366074e-06 8.46263429e-06 1.73409032e-06 1.47836328e-05 -3.06000076e-07 3.49595231e-07 1.90867338e-06 -1.56090719e-06 5.71522584e-07 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 -4.26298824e-06 3.95411785e-06 4.16993094e-05 -1.23985450e-05 -4.34366074e-06 -2.13388414e-05 4.23131714e-05 1.47836328e-05 7.26955279e-05 -1.53000038e-06 1.90867338e-06 9.51122747e-06 -7.65895674e-06 3.20700306e-06 2.25343198e-05 2.50597306e-04 -8.77935341e-05 -8.77935341e-05 3.09427778e-04 3.09427778e-04 1.81181256e-05 6.29314743e-05 -3.13815141e-05 -3.16329428e-06 -3.33594475e-05 1.04247858e-05 3.60141605e-06 1.67422057e-05 -3.54807188e-05 -1.22344517e-05 -5.70968043e-05 1.12314006e-06 -1.56090719e-06 -7.65895674e-06 6.07076274e-06 -2.57724878e-06 -1.12671599e-05 -1.25298653e-04 4.64903097e-05 4.13032244e-05 -1.63707443e-04 -1.45720336e-04 -1.27509189e-05 -3.13815141e-05 1.37277090e-05 1.31803928e-06 1.38997698e-05 -4.34366074e-06 -8.15449649e-07 -7.11294712e-06 1.47836328e-05 2.89015053e-06 2.42318426e-05 -4.67975025e-07 5.71522584e-07 3.20700306e-06 -2.57724878e-06 9.59219321e-07 5.18708531e-06 -1.79871070e-05 -4.26298824e-06 -4.09454220e-06 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 - 0 22 44 66 83 105 127 144 166 188 205 227 249 266 288 310 332 349 371 393 410 432 454 471 493 515 532 --2 2 1 169 - 1.25466617e-06 1.34349826e-05 -6.58962236e-06 -1.31792447e-06 -3.95377341e-06 2.19886127e-05 4.39772254e-06 1.31931676e-05 3.04388134e-06 1.31803928e-06 3.95411785e-06 -1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 -7.13481329e-05 -1.42696266e-05 -4.28088798e-05 2.37845052e-04 4.75690104e-05 1.42707031e-04 3.21001433e-05 1.38997698e-05 4.16993094e-05 -1.11198158e-05 8.33986187e-06 6.58962236e-06 7.13481329e-05 -3.45682450e-05 -7.04340302e-06 -2.11302091e-05 1.16121122e-04 2.36453257e-05 7.09359772e-05 1.59884824e-05 7.11294712e-06 2.13388414e-05 -5.79154766e-06 4.34366074e-06 1.31792447e-06 1.42696266e-05 -7.04340302e-06 -7.59910514e-07 -4.22604181e-06 2.36453257e-05 2.62355898e-06 1.41871954e-05 3.41677917e-06 8.15449649e-07 4.34366074e-06 -1.28479698e-06 4.89269790e-07 3.95377341e-06 4.28088798e-05 -2.11302091e-05 -4.22604181e-06 -1.20293553e-05 7.09359772e-05 1.41871954e-05 4.04560801e-05 1.02503375e-05 4.34366074e-06 1.23985450e-05 -3.09546624e-06 2.47970899e-06 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 2.36453257e-05 7.09359772e-05 -3.88706075e-04 -7.91031105e-05 -2.37309331e-04 -5.45492648e-05 -2.42318426e-05 -7.26955279e-05 1.97115105e-05 -1.47836328e-05 -4.39772254e-06 -4.75690104e-05 2.36453257e-05 2.62355898e-06 1.41871954e-05 -7.91031105e-05 -9.01114524e-06 -4.74618663e-05 -1.16157423e-05 -2.89015053e-06 -1.47836328e-05 4.34984751e-06 -1.73409032e-06 -1.31931676e-05 -1.42707031e-04 7.09359772e-05 1.41871954e-05 4.04560801e-05 -2.37309331e-04 -4.74618663e-05 -1.35576122e-04 -3.48472270e-05 -1.47836328e-05 -4.23131714e-05 1.06042700e-05 -8.46263429e-06 3.04388134e-06 3.21001433e-05 -1.59884824e-05 -3.41677917e-06 -1.02503375e-05 5.45492648e-05 1.16157423e-05 3.48472270e-05 5.56082368e-06 2.46595043e-06 7.39785129e-06 -2.00638043e-06 1.50478532e-06 1.31803928e-06 1.38997698e-05 -7.11294712e-06 -8.15449649e-07 -4.34366074e-06 2.42318426e-05 2.89015053e-06 1.47836328e-05 2.46595043e-06 9.59219321e-07 3.20700306e-06 -8.83346132e-07 5.71522584e-07 3.95411785e-06 4.16993094e-05 -2.13388414e-05 -4.34366074e-06 -1.23985450e-05 7.26955279e-05 1.47836328e-05 4.23131714e-05 7.39785129e-06 3.20700306e-06 9.51122747e-06 -2.50445917e-06 1.90867338e-06 -1.05443143e-06 -1.11198158e-05 5.79154766e-06 1.28479698e-06 3.09546624e-06 -1.97115105e-05 -4.34984751e-06 -1.06042700e-05 -2.00638043e-06 -8.83346132e-07 -2.50445917e-06 6.50274256e-07 -5.15449757e-07 7.90823570e-07 8.33986187e-06 -4.34366074e-06 -4.89269790e-07 -2.47970899e-06 1.47836328e-05 1.73409032e-06 8.46263429e-06 1.50478532e-06 5.71522584e-07 1.90867338e-06 -5.15449757e-07 3.49595231e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 --1 -2 0 169 - 1.25466617e-06 1.34349826e-05 3.95377341e-06 -6.58962236e-06 -1.31792447e-06 -1.31931676e-05 2.19886127e-05 4.39772254e-06 -6.08776268e-07 -3.95411785e-06 -7.90823570e-07 3.16329428e-06 1.31803928e-06 1.34349826e-05 1.43209127e-04 4.28088798e-05 -7.13481329e-05 -1.42696266e-05 -1.42707031e-04 2.37845052e-04 4.75690104e-05 -6.42002866e-06 -4.16993094e-05 -8.33986187e-06 3.33594475e-05 1.38997698e-05 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 2.11302091e-05 4.22604181e-06 4.04560801e-05 -7.09359772e-05 -1.41871954e-05 2.44441635e-06 1.23985450e-05 2.47970899e-06 -1.04247858e-05 -4.34366074e-06 6.58962236e-06 7.13481329e-05 2.11302091e-05 -3.45682450e-05 -7.04340302e-06 -7.09359772e-05 1.16121122e-04 2.36453257e-05 -2.97861377e-06 -2.13388414e-05 -4.34366074e-06 1.67422057e-05 7.11294712e-06 1.31792447e-06 1.42696266e-05 4.22604181e-06 -7.04340302e-06 -7.59910514e-07 -1.41871954e-05 2.36453257e-05 2.62355898e-06 -5.95722755e-07 -4.34366074e-06 -4.89269790e-07 3.60141605e-06 8.15449649e-07 1.31931676e-05 1.42707031e-04 4.04560801e-05 -7.09359772e-05 -1.41871954e-05 -1.35576122e-04 2.37309331e-04 4.74618663e-05 -8.24004626e-06 -4.23131714e-05 -8.46263429e-06 3.54807188e-05 1.47836328e-05 -2.19886127e-05 -2.37845052e-04 -7.09359772e-05 1.16121122e-04 2.36453257e-05 2.37309331e-04 -3.88706075e-04 -7.91031105e-05 1.02039636e-05 7.26955279e-05 1.47836328e-05 -5.70968043e-05 -2.42318426e-05 -4.39772254e-06 -4.75690104e-05 -1.41871954e-05 2.36453257e-05 2.62355898e-06 4.74618663e-05 -7.91031105e-05 -9.01114524e-06 2.04079272e-06 1.47836328e-05 1.73409032e-06 -1.22344517e-05 -2.89015053e-06 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 2.97861377e-06 5.95722755e-07 8.24004626e-06 -1.02039636e-05 -2.04079272e-06 1.40335193e-07 1.53000038e-06 3.06000076e-07 -1.12314006e-06 -4.67975025e-07 -3.95411785e-06 -4.16993094e-05 -1.23985450e-05 2.13388414e-05 4.34366074e-06 4.23131714e-05 -7.26955279e-05 -1.47836328e-05 1.53000038e-06 9.51122747e-06 1.90867338e-06 -7.65895674e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 -2.47970899e-06 4.34366074e-06 4.89269790e-07 8.46263429e-06 -1.47836328e-05 -1.73409032e-06 3.06000076e-07 1.90867338e-06 3.49595231e-07 -1.56090719e-06 -5.71522584e-07 3.16329428e-06 3.33594475e-05 1.04247858e-05 -1.67422057e-05 -3.60141605e-06 -3.54807188e-05 5.70968043e-05 1.22344517e-05 -1.12314006e-06 -7.65895674e-06 -1.56090719e-06 6.07076274e-06 2.57724878e-06 1.31803928e-06 1.38997698e-05 4.34366074e-06 -7.11294712e-06 -8.15449649e-07 -1.47836328e-05 2.42318426e-05 2.89015053e-06 -4.67975025e-07 -3.20700306e-06 -5.71522584e-07 2.57724878e-06 9.59219321e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --1 -2 1 169 - 6.09103871e-05 6.14453477e-04 5.91853803e-05 -2.95926902e-04 5.91853803e-05 -2.01724529e-04 1.00862265e-03 -2.01724529e-04 -4.78869050e-05 -3.45593969e-05 6.91187938e-06 8.29425526e-05 -3.45593969e-05 6.14453477e-04 6.16334179e-03 5.89280869e-04 -2.94640435e-03 5.89280869e-04 -2.00665301e-03 1.00332651e-02 -2.00665301e-03 -4.47447198e-04 -3.22917201e-04 6.45834401e-05 7.75001281e-04 -3.22917201e-04 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 2.96993437e-04 -5.93986875e-05 -5.79546830e-05 -1.00862453e-03 2.01724907e-04 5.99184710e-05 -1.92003453e-05 3.84006907e-06 -8.23728840e-05 3.43220350e-05 2.95926902e-04 2.94640435e-03 2.96993437e-04 -1.40977838e-03 2.96993437e-04 -1.00862453e-03 4.78344308e-03 -1.00862453e-03 -2.06888873e-04 -1.60905699e-04 3.43220350e-05 3.58342040e-04 -1.60905699e-04 -5.91853803e-05 -5.89280869e-04 -5.93986875e-05 2.96993437e-04 1.57901181e-05 2.01724907e-04 -1.00862453e-03 -5.79546830e-05 4.13777746e-05 3.43220350e-05 3.84006907e-06 -9.30773600e-05 -1.92003453e-05 2.01724529e-04 2.00665301e-03 -5.79546830e-05 -1.00862453e-03 2.01724907e-04 2.12351688e-04 3.42697221e-03 -6.85394441e-04 -2.00592339e-04 7.04983673e-05 -1.40996735e-05 2.73631522e-04 -1.14013134e-04 -1.00862265e-03 -1.00332651e-02 -1.00862453e-03 4.78344308e-03 -1.00862453e-03 3.42697221e-03 -1.62371149e-02 3.42697221e-03 6.83378401e-04 5.33163371e-04 -1.14013134e-04 -1.18364611e-03 5.33163371e-04 2.01724529e-04 2.00665301e-03 2.01724907e-04 -1.00862453e-03 -5.79546830e-05 -6.85394441e-04 3.42697221e-03 2.12351688e-04 -1.36675680e-04 -1.14013134e-04 -1.40996735e-05 3.10533823e-04 7.04983673e-05 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 2.06888873e-04 -4.13777746e-05 2.00592339e-04 -6.83378401e-04 1.36675680e-04 1.53794146e-05 2.33774382e-05 -4.67548763e-06 -2.78902609e-05 1.16209420e-05 -3.45593969e-05 -3.22917201e-04 1.92003453e-05 1.60905699e-04 -3.43220350e-05 -7.04983673e-05 -5.33163371e-04 1.14013134e-04 2.33774382e-05 -1.92605535e-05 3.97900833e-06 -2.69156783e-05 1.26855161e-05 6.91187938e-06 6.45834401e-05 -3.84006907e-06 -3.43220350e-05 -3.84006907e-06 1.40996735e-05 1.14013134e-04 1.40996735e-05 -4.67548763e-06 3.97900833e-06 -1.61313514e-07 8.09818213e-06 3.97900833e-06 8.29425526e-05 7.75001281e-04 8.23728840e-05 -3.58342040e-04 9.30773600e-05 -2.73631522e-04 1.18364611e-03 -3.10533823e-04 -2.78902609e-05 -2.69156783e-05 8.09818213e-06 4.75843139e-05 -3.37032945e-05 -3.45593969e-05 -3.22917201e-04 -3.43220350e-05 1.60905699e-04 1.92003453e-05 1.14013134e-04 -5.33163371e-04 -7.04983673e-05 1.16209420e-05 1.26855161e-05 3.97900833e-06 -3.37032945e-05 -1.92605535e-05 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --1 -2 2 169 - 1.25466617e-06 1.34349826e-05 -1.31792447e-06 -6.58962236e-06 3.95377341e-06 4.39772254e-06 2.19886127e-05 -1.31931676e-05 -2.43510507e-06 1.31803928e-06 -7.90823570e-07 2.10886285e-06 -3.95411785e-06 1.34349826e-05 1.43209127e-04 -1.42696266e-05 -7.13481329e-05 4.28088798e-05 4.75690104e-05 2.37845052e-04 -1.42707031e-04 -2.56801146e-05 1.38997698e-05 -8.33986187e-06 2.22396317e-05 -4.16993094e-05 1.31792447e-06 1.42696266e-05 -7.59910514e-07 -7.04340302e-06 4.22604181e-06 2.62355898e-06 2.36453257e-05 -1.41871954e-05 -2.82105641e-06 8.15449649e-07 -4.89269790e-07 2.31661906e-06 -4.34366074e-06 6.58962236e-06 7.13481329e-05 -7.04340302e-06 -3.45682450e-05 2.11302091e-05 2.36453257e-05 1.16121122e-04 -7.09359772e-05 -1.30098686e-05 7.11294712e-06 -4.34366074e-06 1.09506581e-05 -2.13388414e-05 -3.95377341e-06 -4.28088798e-05 4.22604181e-06 2.11302091e-05 -1.20293553e-05 -1.41871954e-05 -7.09359772e-05 4.04560801e-05 7.80592115e-06 -4.34366074e-06 2.47970899e-06 -7.32931955e-06 1.23985450e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 2.36453257e-05 -1.41871954e-05 -9.01114524e-06 -7.91031105e-05 4.74618663e-05 9.57494961e-06 -2.89015053e-06 1.73409032e-06 -7.88460418e-06 1.47836328e-05 -2.19886127e-05 -2.37845052e-04 2.36453257e-05 1.16121122e-04 -7.09359772e-05 -7.91031105e-05 -3.88706075e-04 2.37309331e-04 4.43453012e-05 -2.42318426e-05 1.47836328e-05 -3.73852938e-05 7.26955279e-05 1.31931676e-05 1.42707031e-04 -1.41871954e-05 -7.09359772e-05 4.04560801e-05 4.74618663e-05 2.37309331e-04 -1.35576122e-04 -2.66071807e-05 1.47836328e-05 -8.46263429e-06 2.48764488e-05 -4.23131714e-05 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 1.30098686e-05 -7.80592115e-06 -9.57494961e-06 -4.43453012e-05 2.66071807e-05 3.61548803e-06 -1.99797541e-06 1.19878524e-06 -3.12952049e-06 5.86785091e-06 1.31803928e-06 1.38997698e-05 -8.15449649e-07 -7.11294712e-06 4.34366074e-06 2.89015053e-06 2.42318426e-05 -1.47836328e-05 -1.99797541e-06 9.59219321e-07 -5.71522584e-07 1.69390265e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 4.89269790e-07 4.34366074e-06 -2.47970899e-06 -1.73409032e-06 -1.47836328e-05 8.46263429e-06 1.19878524e-06 -5.71522584e-07 3.49595231e-07 -1.04545744e-06 1.90867338e-06 2.10886285e-06 2.22396317e-05 -2.31661906e-06 -1.09506581e-05 7.32931955e-06 7.88460418e-06 3.73852938e-05 -2.48764488e-05 -3.12952049e-06 1.69390265e-06 -1.04545744e-06 2.59560990e-06 -5.15449757e-06 -3.95411785e-06 -4.16993094e-05 4.34366074e-06 2.13388414e-05 -1.23985450e-05 -1.47836328e-05 -7.26955279e-05 4.23131714e-05 5.86785091e-06 -3.20700306e-06 1.90867338e-06 -5.15449757e-06 9.51122747e-06 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --1 -1 -1 153 - 6.09103871e-05 6.14453477e-04 1.77556141e-04 -1.77556141e-04 -1.77556141e-04 -6.05173587e-04 6.05173587e-04 6.05173587e-04 -6.22069144e-05 -6.22069144e-05 6.22069144e-05 6.14453477e-04 6.16334179e-03 1.76784261e-03 -1.76784261e-03 -1.76784261e-03 -6.01995904e-03 6.01995904e-03 6.01995904e-03 -5.81250961e-04 -5.81250961e-04 5.81250961e-04 -1.77556141e-04 -1.76784261e-03 -4.59399382e-04 5.34588187e-04 5.34588187e-04 1.55584457e-03 -1.81552416e-03 -1.81552416e-03 3.70813928e-05 1.53225561e-04 1.53225561e-04 -1.85338989e-04 1.77556141e-04 1.76784261e-03 5.34588187e-04 -4.59399382e-04 -5.34588187e-04 -1.81552416e-03 1.55584457e-03 1.81552416e-03 1.85406964e-05 -1.53225561e-04 -1.85338989e-04 -3.21134282e-05 1.53225561e-04 1.77556141e-04 1.76784261e-03 5.34588187e-04 -5.34588187e-04 -4.59399382e-04 -1.81552416e-03 1.81552416e-03 1.55584457e-03 1.85406964e-05 -1.85338989e-04 -1.53225561e-04 3.21134282e-05 1.53225561e-04 6.05173587e-04 6.01995904e-03 1.55584457e-03 -1.81552416e-03 -1.81552416e-03 -5.27080384e-03 6.16854997e-03 6.16854997e-03 -1.27833318e-04 -5.04964025e-04 -5.04964025e-04 6.15670926e-04 -6.05173587e-04 -6.01995904e-03 -1.81552416e-03 1.55584457e-03 1.81552416e-03 6.16854997e-03 -5.27080384e-03 -6.16854997e-03 -6.39166591e-05 5.04964025e-04 6.15670926e-04 1.10706901e-04 -5.04964025e-04 -6.05173587e-04 -6.01995904e-03 -1.81552416e-03 1.81552416e-03 1.55584457e-03 6.16854997e-03 -6.16854997e-03 -5.27080384e-03 -6.39166591e-05 6.15670926e-04 5.04964025e-04 -1.10706901e-04 -5.04964025e-04 -3.70813928e-05 -1.85406964e-05 -1.85406964e-05 1.27833318e-04 6.39166591e-05 6.39166591e-05 -2.24434069e-05 7.05389767e-06 7.05389767e-06 1.41077953e-05 -6.22069144e-05 -5.81250961e-04 -1.53225561e-04 1.53225561e-04 1.85338989e-04 5.04964025e-04 -5.04964025e-04 -6.15670926e-04 7.05389767e-06 2.30560406e-05 3.32817384e-05 1.22177092e-05 -3.32817384e-05 -6.22069144e-05 -5.81250961e-04 -1.53225561e-04 1.85338989e-04 1.53225561e-04 5.04964025e-04 -6.15670926e-04 -5.04964025e-04 7.05389767e-06 3.32817384e-05 2.30560406e-05 -1.22177092e-05 -3.32817384e-05 3.21134282e-05 -3.21134282e-05 -1.10706901e-04 1.10706901e-04 1.22177092e-05 -1.22177092e-05 -2.24434069e-05 6.22069144e-05 5.81250961e-04 1.85338989e-04 -1.53225561e-04 -1.53225561e-04 -6.15670926e-04 5.04964025e-04 5.04964025e-04 1.41077953e-05 -3.32817384e-05 -3.32817384e-05 2.30560406e-05 - 13 14 15 16 17 18 19 20 22 23 25 13 14 15 16 17 18 19 20 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 16 17 19 20 22 23 24 13 14 15 16 17 18 19 20 21 22 23 25 - 0 11 22 34 47 60 72 85 98 108 121 134 141 153 153 153 153 153 153 153 153 153 153 153 153 153 153 --1 -1 0 507 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 -6.51378048e-04 -3.25689024e-04 -1.06639054e-03 2.13278108e-03 1.06639054e-03 -4.52806801e-05 -1.04571251e-04 -5.22856257e-05 7.84284385e-05 1.04571251e-04 1.40271766e-02 6.79314330e-02 1.27999040e-02 -3.83997120e-02 -1.27999040e-02 -3.13231900e-02 9.39695701e-02 3.13231900e-02 1.95007672e-03 2.53322396e-03 8.44407987e-04 -3.37763195e-03 -2.53322396e-03 1.56710856e-03 1.39613919e-02 2.89608434e-03 -5.79216869e-03 -2.89608434e-03 -9.35225951e-03 1.87045190e-02 9.35225951e-03 -2.85376584e-04 -6.59048991e-04 -3.29524496e-04 4.94286743e-04 6.59048991e-04 6.79314330e-02 1.60907873e-01 4.09845600e-02 -1.22953680e-01 -4.09845600e-02 -5.94754012e-02 1.78426204e-01 5.94754012e-02 2.00105569e-02 2.59944760e-02 8.66482532e-03 -3.46593013e-02 -2.59944760e-02 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 1.28527532e-03 6.42637659e-04 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 1.33367462e-04 8.08681204e-05 4.04340602e-05 -1.33657432e-04 -1.78209909e-04 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 3.21974808e-02 1.07324936e-02 -1.69480895e-02 -6.28329901e-02 -2.09443300e-02 -6.06202249e-03 -1.11749199e-04 -3.72497331e-05 7.04948694e-03 5.28711521e-03 6.51378048e-04 5.79216869e-03 1.28527532e-03 -2.34193222e-03 -1.28527532e-03 -4.15611128e-03 7.54522870e-03 4.15611128e-03 -9.81340007e-05 -3.07748924e-04 -1.78209909e-04 1.69973075e-04 3.07748924e-04 3.83997120e-02 1.22953680e-01 3.21974808e-02 -8.01243800e-02 -3.21974808e-02 -6.28329901e-02 1.50606551e-01 6.28329901e-02 9.22207060e-03 1.41362236e-02 5.28711521e-03 -1.59730948e-02 -1.41362236e-02 3.25689024e-04 2.89608434e-03 6.42637659e-04 -1.28527532e-03 -4.14019247e-04 -2.07805564e-03 4.15611128e-03 1.31106178e-03 -4.90670003e-05 -1.78209909e-04 -4.04340602e-05 1.82328327e-04 8.08681204e-05 1.27999040e-02 4.09845600e-02 1.07324936e-02 -3.21974808e-02 5.73556868e-03 -2.09443300e-02 6.28329901e-02 -1.69480895e-02 3.07402353e-03 5.28711521e-03 3.72497331e-05 -8.77460895e-03 -1.11749199e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 -4.10981523e-03 1.33621179e-02 6.68105894e-03 -3.95156129e-04 -1.77416518e-04 -8.87082588e-05 3.69363005e-04 4.92484006e-04 3.13231900e-02 5.94754012e-02 -1.69480895e-02 -6.28329901e-02 -2.09443300e-02 4.58861475e-02 8.26569598e-02 2.75523199e-02 2.03553554e-02 -3.67538539e-03 -1.22512846e-03 -2.18708352e-02 -1.64031264e-02 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 7.54522870e-03 4.15611128e-03 1.33621179e-02 -2.41529920e-02 -1.33621179e-02 2.44599361e-04 8.27434268e-04 4.92484006e-04 -4.23658521e-04 -8.27434268e-04 -9.39695701e-02 -1.78426204e-01 -6.28329901e-02 1.50606551e-01 6.28329901e-02 8.26569598e-02 -1.74532412e-01 -8.26569598e-02 -2.62890636e-02 -4.25165420e-02 -1.64031264e-02 4.55339938e-02 4.25165420e-02 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 4.15611128e-03 1.31106178e-03 6.68105894e-03 -1.33621179e-02 -4.10981523e-03 1.22299680e-04 4.92484006e-04 8.87082588e-05 -5.26896749e-04 -1.77416518e-04 -3.13231900e-02 -5.94754012e-02 -2.09443300e-02 6.28329901e-02 -1.69480895e-02 2.75523199e-02 -8.26569598e-02 4.58861475e-02 -8.76302120e-03 -1.64031264e-02 1.22512846e-03 2.85636725e-02 -3.67538539e-03 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 9.81340007e-05 4.90670003e-05 3.95156129e-04 -2.44599361e-04 -1.22299680e-04 -2.59797738e-05 -3.38595206e-05 -1.69297603e-05 3.69220468e-05 4.92293958e-05 1.95007672e-03 2.00105569e-02 6.06202249e-03 -9.22207060e-03 -3.07402353e-03 -2.03553554e-02 2.62890636e-02 8.76302120e-03 1.46476011e-03 7.20172278e-04 2.40057426e-04 -2.64406855e-03 -1.98305141e-03 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 3.07748924e-04 1.78209909e-04 1.77416518e-04 -8.27434268e-04 -4.92484006e-04 -3.38595206e-05 -1.08000471e-04 -5.38872760e-05 7.63940131e-05 9.44638495e-05 2.53322396e-03 2.59944760e-02 1.11749199e-04 -1.41362236e-02 -5.28711521e-03 3.67538539e-03 4.25165420e-02 1.64031264e-02 7.20172278e-04 3.36490998e-03 1.22324825e-03 -2.70562219e-03 -1.72541514e-03 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 1.78209909e-04 4.04340602e-05 8.87082588e-05 -4.92484006e-04 -8.87082588e-05 -1.69297603e-05 -5.38872760e-05 -2.71695573e-05 2.93232050e-05 5.38872760e-05 8.44407987e-04 8.66482532e-03 3.72497331e-05 -5.28711521e-03 -3.72497331e-05 1.22512846e-03 1.64031264e-02 -1.22512846e-03 2.40057426e-04 1.22324825e-03 1.02914641e-04 -4.15791659e-04 -1.22324825e-03 7.84284385e-05 4.94286743e-04 1.33657432e-04 -1.69973075e-04 -1.82328327e-04 -3.69363005e-04 4.23658521e-04 5.26896749e-04 3.69220468e-05 7.63940131e-05 2.93232050e-05 -6.86136812e-05 -6.75202116e-05 -3.37763195e-03 -3.46593013e-02 -7.04948694e-03 1.59730948e-02 8.77460895e-03 2.18708352e-02 -4.55339938e-02 -2.85636725e-02 -2.64406855e-03 -2.70562219e-03 -4.15791659e-04 4.51786749e-03 1.97649858e-03 1.04571251e-04 6.59048991e-04 1.78209909e-04 -3.07748924e-04 -8.08681204e-05 -4.92484006e-04 8.27434268e-04 1.77416518e-04 4.92293958e-05 9.44638495e-05 5.38872760e-05 -6.75202116e-05 -1.08000471e-04 -2.53322396e-03 -2.59944760e-02 -5.28711521e-03 1.41362236e-02 1.11749199e-04 1.64031264e-02 -4.25165420e-02 3.67538539e-03 -1.98305141e-03 -1.72541514e-03 -1.22324825e-03 1.97649858e-03 3.36490998e-03 1.70328256e-04 1.56710856e-03 3.25689024e-04 -6.51378048e-04 -3.25689024e-04 -1.06639054e-03 2.13278108e-03 1.06639054e-03 -4.52806801e-05 -1.04571251e-04 -5.22856257e-05 7.84284385e-05 1.04571251e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 -5.79216869e-03 -2.89608434e-03 -9.35225951e-03 1.87045190e-02 9.35225951e-03 -2.85376584e-04 -6.59048991e-04 -3.29524496e-04 4.94286743e-04 6.59048991e-04 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 1.28527532e-03 6.42637659e-04 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 1.33367462e-04 8.08681204e-05 4.04340602e-05 -1.33657432e-04 -1.78209909e-04 6.51378048e-04 5.79216869e-03 1.28527532e-03 -2.34193222e-03 -1.28527532e-03 -4.15611128e-03 7.54522870e-03 4.15611128e-03 -9.81340007e-05 -3.07748924e-04 -1.78209909e-04 1.69973075e-04 3.07748924e-04 3.25689024e-04 2.89608434e-03 6.42637659e-04 -1.28527532e-03 -4.14019247e-04 -2.07805564e-03 4.15611128e-03 1.31106178e-03 -4.90670003e-05 -1.78209909e-04 -4.04340602e-05 1.82328327e-04 8.08681204e-05 1.06639054e-03 9.35225951e-03 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 -4.10981523e-03 1.33621179e-02 6.68105894e-03 -3.95156129e-04 -1.77416518e-04 -8.87082588e-05 3.69363005e-04 4.92484006e-04 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 7.54522870e-03 4.15611128e-03 1.33621179e-02 -2.41529920e-02 -1.33621179e-02 2.44599361e-04 8.27434268e-04 4.92484006e-04 -4.23658521e-04 -8.27434268e-04 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 4.15611128e-03 1.31106178e-03 6.68105894e-03 -1.33621179e-02 -4.10981523e-03 1.22299680e-04 4.92484006e-04 8.87082588e-05 -5.26896749e-04 -1.77416518e-04 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 9.81340007e-05 4.90670003e-05 3.95156129e-04 -2.44599361e-04 -1.22299680e-04 -2.59797738e-05 -3.38595206e-05 -1.69297603e-05 3.69220468e-05 4.92293958e-05 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 3.07748924e-04 1.78209909e-04 1.77416518e-04 -8.27434268e-04 -4.92484006e-04 -3.38595206e-05 -1.08000471e-04 -5.38872760e-05 7.63940131e-05 9.44638495e-05 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 1.78209909e-04 4.04340602e-05 8.87082588e-05 -4.92484006e-04 -8.87082588e-05 -1.69297603e-05 -5.38872760e-05 -2.71695573e-05 2.93232050e-05 5.38872760e-05 7.84284385e-05 4.94286743e-04 1.33657432e-04 -1.69973075e-04 -1.82328327e-04 -3.69363005e-04 4.23658521e-04 5.26896749e-04 3.69220468e-05 7.63940131e-05 2.93232050e-05 -6.86136812e-05 -6.75202116e-05 1.04571251e-04 6.59048991e-04 1.78209909e-04 -3.07748924e-04 -8.08681204e-05 -4.92484006e-04 8.27434268e-04 1.77416518e-04 4.92293958e-05 9.44638495e-05 5.38872760e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 351 364 377 390 403 416 429 442 455 468 481 494 507 --1 -1 1 448 - 2.50728998e-03 1.64011405e-02 -9.26310694e-03 2.59488230e-02 3.67034157e-05 -6.35721809e-05 1.40271766e-02 6.79314330e-02 -1.27999040e-02 -3.83997120e-02 1.27999040e-02 3.13231900e-02 9.39695701e-02 -3.13231900e-02 1.95007672e-03 -2.53322396e-03 8.44407987e-04 -3.37763195e-03 2.53322396e-03 1.64011405e-02 8.10100377e-02 -5.00423367e-02 1.17965801e-01 6.27522019e-03 -1.08690002e-02 6.79314330e-02 1.60907873e-01 -4.09845600e-02 -1.22953680e-01 4.09845600e-02 5.94754012e-02 1.78426204e-01 -5.94754012e-02 2.00105569e-02 -2.59944760e-02 8.66482532e-03 -3.46593013e-02 2.59944760e-02 3.22869392e-03 -9.11832090e-03 1.65705842e-04 1.27999040e-02 4.09845600e-02 5.73556868e-03 -3.21974808e-02 1.07324936e-02 -1.69480895e-02 6.28329901e-02 -2.09443300e-02 6.06202249e-03 -1.11749199e-04 3.72497331e-05 -7.04948694e-03 5.28711521e-03 9.26310694e-03 5.00423367e-02 -3.02879243e-02 7.61127847e-02 2.43070715e-03 -4.21010828e-03 3.83997120e-02 1.22953680e-01 -3.21974808e-02 -8.01243800e-02 3.21974808e-02 6.28329901e-02 1.50606551e-01 -6.28329901e-02 9.22207060e-03 -1.41362236e-02 5.28711521e-03 -1.59730948e-02 1.41362236e-02 3.22869392e-03 -9.11832090e-03 1.65705842e-04 -1.27999040e-02 -4.09845600e-02 1.07324936e-02 3.21974808e-02 5.73556868e-03 -2.09443300e-02 -6.28329901e-02 -1.69480895e-02 -3.07402353e-03 5.28711521e-03 -3.72497331e-05 8.77460895e-03 -1.11749199e-04 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 6.28329901e-02 -2.09443300e-02 4.58861475e-02 -8.26569598e-02 2.75523199e-02 -2.03553554e-02 -3.67538539e-03 1.22512846e-03 2.18708352e-02 -1.64031264e-02 -2.59488230e-02 -1.17965801e-01 7.61127847e-02 -1.70036430e-01 -1.16569751e-02 2.01904731e-02 -9.39695701e-02 -1.78426204e-01 6.28329901e-02 1.50606551e-01 -6.28329901e-02 -8.26569598e-02 -1.74532412e-01 8.26569598e-02 -2.62890636e-02 4.25165420e-02 -1.64031264e-02 4.55339938e-02 -4.25165420e-02 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 3.13231900e-02 5.94754012e-02 -2.09443300e-02 -6.28329901e-02 -1.69480895e-02 2.75523199e-02 8.26569598e-02 4.58861475e-02 8.76302120e-03 -1.64031264e-02 -1.22512846e-03 -2.85636725e-02 -3.67538539e-03 3.67034157e-05 6.27522019e-03 -2.43070715e-03 1.16569751e-02 -1.04593642e-03 1.68023178e-03 1.95007672e-03 2.00105569e-02 -6.06202249e-03 -9.22207060e-03 3.07402353e-03 2.03553554e-02 2.62890636e-02 -8.76302120e-03 1.46476011e-03 -7.20172278e-04 2.40057426e-04 -2.64406855e-03 1.98305141e-03 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -2.53322396e-03 -2.59944760e-02 1.11749199e-04 1.41362236e-02 -5.28711521e-03 3.67538539e-03 -4.25165420e-02 1.64031264e-02 -7.20172278e-04 3.36490998e-03 -1.22324825e-03 2.70562219e-03 -1.72541514e-03 -7.58541506e-05 8.44407987e-04 8.66482532e-03 -3.72497331e-05 -5.28711521e-03 3.72497331e-05 -1.22512846e-03 1.64031264e-02 1.22512846e-03 2.40057426e-04 -1.22324825e-03 1.02914641e-04 -4.15791659e-04 1.22324825e-03 -6.35721809e-05 -1.08690002e-02 4.21010828e-03 -2.01904731e-02 1.68023178e-03 -2.98610096e-03 -3.37763195e-03 -3.46593013e-02 7.04948694e-03 1.59730948e-02 -8.77460895e-03 -2.18708352e-02 -4.55339938e-02 2.85636725e-02 -2.64406855e-03 2.70562219e-03 -4.15791659e-04 4.51786749e-03 -1.97649858e-03 -1.65705842e-04 1.71520858e-03 1.20534581e-03 2.53322396e-03 2.59944760e-02 -5.28711521e-03 -1.41362236e-02 1.11749199e-04 1.64031264e-02 4.25165420e-02 3.67538539e-03 1.98305141e-03 -1.72541514e-03 1.22324825e-03 -1.97649858e-03 3.36490998e-03 6.09103871e-05 6.14453477e-04 5.91853803e-05 -2.95926902e-04 -5.91853803e-05 -2.01724529e-04 1.00862265e-03 2.01724529e-04 -4.78869050e-05 -3.45593969e-05 -6.91187938e-06 8.29425526e-05 3.45593969e-05 2.50728998e-03 1.64011405e-02 -9.26310694e-03 2.59488230e-02 3.67034157e-05 -6.35721809e-05 6.14453477e-04 6.16334179e-03 5.89280869e-04 -2.94640435e-03 -5.89280869e-04 -2.00665301e-03 1.00332651e-02 2.00665301e-03 -4.47447198e-04 -3.22917201e-04 -6.45834401e-05 7.75001281e-04 3.22917201e-04 1.64011405e-02 8.10100377e-02 -5.00423367e-02 1.17965801e-01 6.27522019e-03 -1.08690002e-02 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 2.96993437e-04 5.93986875e-05 -5.79546830e-05 -1.00862453e-03 -2.01724907e-04 5.99184710e-05 -1.92003453e-05 -3.84006907e-06 -8.23728840e-05 -3.43220350e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 2.95926902e-04 2.94640435e-03 2.96993437e-04 -1.40977838e-03 -2.96993437e-04 -1.00862453e-03 4.78344308e-03 1.00862453e-03 -2.06888873e-04 -1.60905699e-04 -3.43220350e-05 3.58342040e-04 1.60905699e-04 9.26310694e-03 5.00423367e-02 -3.02879243e-02 7.61127847e-02 2.43070715e-03 -4.21010828e-03 5.91853803e-05 5.89280869e-04 5.93986875e-05 -2.96993437e-04 1.57901181e-05 -2.01724907e-04 1.00862453e-03 -5.79546830e-05 -4.13777746e-05 -3.43220350e-05 3.84006907e-06 9.30773600e-05 -1.92003453e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 2.01724529e-04 2.00665301e-03 -5.79546830e-05 -1.00862453e-03 -2.01724907e-04 2.12351688e-04 3.42697221e-03 6.85394441e-04 -2.00592339e-04 7.04983673e-05 1.40996735e-05 2.73631522e-04 1.14013134e-04 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -1.00862265e-03 -1.00332651e-02 -1.00862453e-03 4.78344308e-03 1.00862453e-03 3.42697221e-03 -1.62371149e-02 -3.42697221e-03 6.83378401e-04 5.33163371e-04 1.14013134e-04 -1.18364611e-03 -5.33163371e-04 -2.59488230e-02 -1.17965801e-01 7.61127847e-02 -1.70036430e-01 -1.16569751e-02 2.01904731e-02 -2.01724529e-04 -2.00665301e-03 -2.01724907e-04 1.00862453e-03 -5.79546830e-05 6.85394441e-04 -3.42697221e-03 2.12351688e-04 1.36675680e-04 1.14013134e-04 -1.40996735e-05 -3.10533823e-04 7.04983673e-05 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 2.06888873e-04 4.13777746e-05 2.00592339e-04 -6.83378401e-04 -1.36675680e-04 1.53794146e-05 2.33774382e-05 4.67548763e-06 -2.78902609e-05 -1.16209420e-05 3.67034157e-05 6.27522019e-03 -2.43070715e-03 1.16569751e-02 -1.04593642e-03 1.68023178e-03 -3.45593969e-05 -3.22917201e-04 1.92003453e-05 1.60905699e-04 3.43220350e-05 -7.04983673e-05 -5.33163371e-04 -1.14013134e-04 2.33774382e-05 -1.92605535e-05 -3.97900833e-06 -2.69156783e-05 -1.26855161e-05 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -6.91187938e-06 -6.45834401e-05 3.84006907e-06 3.43220350e-05 -3.84006907e-06 -1.40996735e-05 -1.14013134e-04 1.40996735e-05 4.67548763e-06 -3.97900833e-06 -1.61313514e-07 -8.09818213e-06 3.97900833e-06 -7.58541506e-05 8.29425526e-05 7.75001281e-04 8.23728840e-05 -3.58342040e-04 -9.30773600e-05 -2.73631522e-04 1.18364611e-03 3.10533823e-04 -2.78902609e-05 -2.69156783e-05 -8.09818213e-06 4.75843139e-05 3.37032945e-05 -6.35721809e-05 -1.08690002e-02 4.21010828e-03 -2.01904731e-02 1.68023178e-03 -2.98610096e-03 3.45593969e-05 3.22917201e-04 3.43220350e-05 -1.60905699e-04 1.92003453e-05 -1.14013134e-04 5.33163371e-04 -7.04983673e-05 -1.16209420e-05 -1.26855161e-05 3.97900833e-06 3.37032945e-05 -1.92605535e-05 -1.65705842e-04 1.71520858e-03 1.20534581e-03 - 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 13 14 15 16 17 18 19 20 21 22 23 24 25 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 0 1 2 3 4 5 6 7 8 9 10 11 12 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 25 - 0 19 38 54 73 89 105 124 140 159 175 189 208 224 243 262 278 297 313 329 348 364 383 399 413 432 448 --1 -1 2 660 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -6.51378048e-04 3.25689024e-04 1.06639054e-03 2.13278108e-03 -1.06639054e-03 -4.52806801e-05 1.04571251e-04 -5.22856257e-05 7.84284385e-05 -1.04571251e-04 6.09103871e-05 6.14453477e-04 -1.77556141e-04 -1.77556141e-04 1.77556141e-04 6.05173587e-04 6.05173587e-04 -6.05173587e-04 6.22069144e-05 -6.22069144e-05 -6.22069144e-05 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -5.79216869e-03 2.89608434e-03 9.35225951e-03 1.87045190e-02 -9.35225951e-03 -2.85376584e-04 6.59048991e-04 -3.29524496e-04 4.94286743e-04 -6.59048991e-04 6.14453477e-04 6.16334179e-03 -1.76784261e-03 -1.76784261e-03 1.76784261e-03 6.01995904e-03 6.01995904e-03 -6.01995904e-03 5.81250961e-04 -5.81250961e-04 -5.81250961e-04 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -1.28527532e-03 6.42637659e-04 1.31106178e-03 4.15611128e-03 -2.07805564e-03 -1.33367462e-04 8.08681204e-05 -4.04340602e-05 1.33657432e-04 -1.78209909e-04 1.77556141e-04 1.76784261e-03 -4.59399382e-04 -5.34588187e-04 5.34588187e-04 1.55584457e-03 1.81552416e-03 -1.81552416e-03 -3.70813928e-05 1.53225561e-04 -1.53225561e-04 -1.85338989e-04 6.51378048e-04 5.79216869e-03 -1.28527532e-03 -2.34193222e-03 1.28527532e-03 4.15611128e-03 7.54522870e-03 -4.15611128e-03 -9.81340007e-05 3.07748924e-04 -1.78209909e-04 1.69973075e-04 -3.07748924e-04 1.77556141e-04 1.76784261e-03 -5.34588187e-04 -4.59399382e-04 5.34588187e-04 1.81552416e-03 1.55584457e-03 -1.81552416e-03 1.85406964e-05 1.53225561e-04 -1.85338989e-04 -3.21134282e-05 -1.53225561e-04 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 1.28527532e-03 -4.14019247e-04 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 4.90670003e-05 -1.78209909e-04 4.04340602e-05 -1.82328327e-04 8.08681204e-05 -1.77556141e-04 -1.76784261e-03 5.34588187e-04 5.34588187e-04 -4.59399382e-04 -1.81552416e-03 -1.81552416e-03 1.55584457e-03 -1.85406964e-05 -1.85338989e-04 1.53225561e-04 -3.21134282e-05 1.53225561e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 4.15611128e-03 -2.07805564e-03 -4.10981523e-03 -1.33621179e-02 6.68105894e-03 3.95156129e-04 -1.77416518e-04 8.87082588e-05 -3.69363005e-04 4.92484006e-04 -6.05173587e-04 -6.01995904e-03 1.55584457e-03 1.81552416e-03 -1.81552416e-03 -5.27080384e-03 -6.16854997e-03 6.16854997e-03 1.27833318e-04 -5.04964025e-04 5.04964025e-04 6.15670926e-04 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 7.54522870e-03 -4.15611128e-03 -1.33621179e-02 -2.41529920e-02 1.33621179e-02 2.44599361e-04 -8.27434268e-04 4.92484006e-04 -4.23658521e-04 8.27434268e-04 -6.05173587e-04 -6.01995904e-03 1.81552416e-03 1.55584457e-03 -1.81552416e-03 -6.16854997e-03 -5.27080384e-03 6.16854997e-03 -6.39166591e-05 -5.04964025e-04 6.15670926e-04 1.10706901e-04 5.04964025e-04 1.06639054e-03 9.35225951e-03 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 6.68105894e-03 1.33621179e-02 -4.10981523e-03 -1.22299680e-04 4.92484006e-04 -8.87082588e-05 5.26896749e-04 -1.77416518e-04 6.05173587e-04 6.01995904e-03 -1.81552416e-03 -1.81552416e-03 1.55584457e-03 6.16854997e-03 6.16854997e-03 -5.27080384e-03 6.39166591e-05 6.15670926e-04 -5.04964025e-04 1.10706901e-04 -5.04964025e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 9.81340007e-05 -4.90670003e-05 -3.95156129e-04 -2.44599361e-04 1.22299680e-04 -2.59797738e-05 3.38595206e-05 -1.69297603e-05 3.69220468e-05 -4.92293958e-05 3.70813928e-05 -1.85406964e-05 1.85406964e-05 -1.27833318e-04 6.39166591e-05 -6.39166591e-05 -2.24434069e-05 -7.05389767e-06 7.05389767e-06 -1.41077953e-05 1.04571251e-04 6.59048991e-04 -8.08681204e-05 -3.07748924e-04 1.78209909e-04 1.77416518e-04 8.27434268e-04 -4.92484006e-04 3.38595206e-05 -1.08000471e-04 5.38872760e-05 -7.63940131e-05 9.44638495e-05 6.22069144e-05 5.81250961e-04 -1.53225561e-04 -1.53225561e-04 1.85338989e-04 5.04964025e-04 5.04964025e-04 -6.15670926e-04 -7.05389767e-06 2.30560406e-05 -3.32817384e-05 -1.22177092e-05 -3.32817384e-05 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 1.78209909e-04 -4.04340602e-05 -8.87082588e-05 -4.92484006e-04 8.87082588e-05 -1.69297603e-05 5.38872760e-05 -2.71695573e-05 2.93232050e-05 -5.38872760e-05 -6.22069144e-05 -5.81250961e-04 1.53225561e-04 1.85338989e-04 -1.53225561e-04 -5.04964025e-04 -6.15670926e-04 5.04964025e-04 7.05389767e-06 -3.32817384e-05 2.30560406e-05 -1.22177092e-05 3.32817384e-05 7.84284385e-05 4.94286743e-04 -1.33657432e-04 -1.69973075e-04 1.82328327e-04 3.69363005e-04 4.23658521e-04 -5.26896749e-04 3.69220468e-05 -7.63940131e-05 2.93232050e-05 -6.86136812e-05 6.75202116e-05 3.21134282e-05 3.21134282e-05 -1.10706901e-04 -1.10706901e-04 -1.22177092e-05 -1.22177092e-05 -2.24434069e-05 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 3.07748924e-04 -8.08681204e-05 -4.92484006e-04 -8.27434268e-04 1.77416518e-04 -4.92293958e-05 9.44638495e-05 -5.38872760e-05 6.75202116e-05 -1.08000471e-04 -6.22069144e-05 -5.81250961e-04 1.85338989e-04 1.53225561e-04 -1.53225561e-04 -6.15670926e-04 -5.04964025e-04 5.04964025e-04 -1.41077953e-05 -3.32817384e-05 3.32817384e-05 2.30560406e-05 6.09103871e-05 6.14453477e-04 -5.91853803e-05 -2.95926902e-04 5.91853803e-05 2.01724529e-04 1.00862265e-03 -2.01724529e-04 -4.78869050e-05 3.45593969e-05 -6.91187938e-06 8.29425526e-05 -3.45593969e-05 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -6.51378048e-04 3.25689024e-04 1.06639054e-03 2.13278108e-03 -1.06639054e-03 -4.52806801e-05 1.04571251e-04 -5.22856257e-05 7.84284385e-05 -1.04571251e-04 6.14453477e-04 6.16334179e-03 -5.89280869e-04 -2.94640435e-03 5.89280869e-04 2.00665301e-03 1.00332651e-02 -2.00665301e-03 -4.47447198e-04 3.22917201e-04 -6.45834401e-05 7.75001281e-04 -3.22917201e-04 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -5.79216869e-03 2.89608434e-03 9.35225951e-03 1.87045190e-02 -9.35225951e-03 -2.85376584e-04 6.59048991e-04 -3.29524496e-04 4.94286743e-04 -6.59048991e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 -2.96993437e-04 5.93986875e-05 -5.79546830e-05 1.00862453e-03 -2.01724907e-04 -5.99184710e-05 -1.92003453e-05 3.84006907e-06 8.23728840e-05 -3.43220350e-05 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -1.28527532e-03 6.42637659e-04 1.31106178e-03 4.15611128e-03 -2.07805564e-03 -1.33367462e-04 8.08681204e-05 -4.04340602e-05 1.33657432e-04 -1.78209909e-04 2.95926902e-04 2.94640435e-03 -2.96993437e-04 -1.40977838e-03 2.96993437e-04 1.00862453e-03 4.78344308e-03 -1.00862453e-03 -2.06888873e-04 1.60905699e-04 -3.43220350e-05 3.58342040e-04 -1.60905699e-04 6.51378048e-04 5.79216869e-03 -1.28527532e-03 -2.34193222e-03 1.28527532e-03 4.15611128e-03 7.54522870e-03 -4.15611128e-03 -9.81340007e-05 3.07748924e-04 -1.78209909e-04 1.69973075e-04 -3.07748924e-04 -5.91853803e-05 -5.89280869e-04 5.93986875e-05 2.96993437e-04 1.57901181e-05 -2.01724907e-04 -1.00862453e-03 -5.79546830e-05 4.13777746e-05 -3.43220350e-05 -3.84006907e-06 -9.30773600e-05 -1.92003453e-05 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 1.28527532e-03 -4.14019247e-04 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 4.90670003e-05 -1.78209909e-04 4.04340602e-05 -1.82328327e-04 8.08681204e-05 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 1.00862453e-03 -2.01724907e-04 2.12351688e-04 -3.42697221e-03 6.85394441e-04 2.00592339e-04 7.04983673e-05 -1.40996735e-05 -2.73631522e-04 1.14013134e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 4.15611128e-03 -2.07805564e-03 -4.10981523e-03 -1.33621179e-02 6.68105894e-03 3.95156129e-04 -1.77416518e-04 8.87082588e-05 -3.69363005e-04 4.92484006e-04 -1.00862265e-03 -1.00332651e-02 1.00862453e-03 4.78344308e-03 -1.00862453e-03 -3.42697221e-03 -1.62371149e-02 3.42697221e-03 6.83378401e-04 -5.33163371e-04 1.14013134e-04 -1.18364611e-03 5.33163371e-04 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 7.54522870e-03 -4.15611128e-03 -1.33621179e-02 -2.41529920e-02 1.33621179e-02 2.44599361e-04 -8.27434268e-04 4.92484006e-04 -4.23658521e-04 8.27434268e-04 2.01724529e-04 2.00665301e-03 -2.01724907e-04 -1.00862453e-03 -5.79546830e-05 6.85394441e-04 3.42697221e-03 2.12351688e-04 -1.36675680e-04 1.14013134e-04 1.40996735e-05 3.10533823e-04 7.04983673e-05 1.06639054e-03 9.35225951e-03 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 6.68105894e-03 1.33621179e-02 -4.10981523e-03 -1.22299680e-04 4.92484006e-04 -8.87082588e-05 5.26896749e-04 -1.77416518e-04 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 2.06888873e-04 -4.13777746e-05 -2.00592339e-04 -6.83378401e-04 1.36675680e-04 1.53794146e-05 -2.33774382e-05 4.67548763e-06 -2.78902609e-05 1.16209420e-05 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 9.81340007e-05 -4.90670003e-05 -3.95156129e-04 -2.44599361e-04 1.22299680e-04 -2.59797738e-05 3.38595206e-05 -1.69297603e-05 3.69220468e-05 -4.92293958e-05 3.45593969e-05 3.22917201e-04 1.92003453e-05 -1.60905699e-04 3.43220350e-05 -7.04983673e-05 5.33163371e-04 -1.14013134e-04 -2.33774382e-05 -1.92605535e-05 3.97900833e-06 2.69156783e-05 -1.26855161e-05 1.04571251e-04 6.59048991e-04 -8.08681204e-05 -3.07748924e-04 1.78209909e-04 1.77416518e-04 8.27434268e-04 -4.92484006e-04 3.38595206e-05 -1.08000471e-04 5.38872760e-05 -7.63940131e-05 9.44638495e-05 -6.91187938e-06 -6.45834401e-05 -3.84006907e-06 3.43220350e-05 3.84006907e-06 1.40996735e-05 -1.14013134e-04 -1.40996735e-05 4.67548763e-06 3.97900833e-06 -1.61313514e-07 -8.09818213e-06 -3.97900833e-06 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 1.78209909e-04 -4.04340602e-05 -8.87082588e-05 -4.92484006e-04 8.87082588e-05 -1.69297603e-05 5.38872760e-05 -2.71695573e-05 2.93232050e-05 -5.38872760e-05 8.29425526e-05 7.75001281e-04 -8.23728840e-05 -3.58342040e-04 9.30773600e-05 2.73631522e-04 1.18364611e-03 -3.10533823e-04 -2.78902609e-05 2.69156783e-05 -8.09818213e-06 4.75843139e-05 -3.37032945e-05 7.84284385e-05 4.94286743e-04 -1.33657432e-04 -1.69973075e-04 1.82328327e-04 3.69363005e-04 4.23658521e-04 -5.26896749e-04 3.69220468e-05 -7.63940131e-05 2.93232050e-05 -6.86136812e-05 6.75202116e-05 -3.45593969e-05 -3.22917201e-04 3.43220350e-05 1.60905699e-04 1.92003453e-05 -1.14013134e-04 -5.33163371e-04 -7.04983673e-05 1.16209420e-05 -1.26855161e-05 -3.97900833e-06 -3.37032945e-05 -1.92605535e-05 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 3.07748924e-04 -8.08681204e-05 -4.92484006e-04 -8.27434268e-04 1.77416518e-04 -4.92293958e-05 9.44638495e-05 -5.38872760e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 24 48 73 99 125 150 176 202 225 251 277 297 322 348 374 400 426 452 478 504 530 556 582 608 634 660 --1 0 -2 169 - 1.25466617e-06 1.34349826e-05 3.95377341e-06 -1.31792447e-06 -6.58962236e-06 -1.31931676e-05 4.39772254e-06 2.19886127e-05 -6.08776268e-07 -7.90823570e-07 -3.95411785e-06 -3.16329428e-06 1.31803928e-06 1.34349826e-05 1.43209127e-04 4.28088798e-05 -1.42696266e-05 -7.13481329e-05 -1.42707031e-04 4.75690104e-05 2.37845052e-04 -6.42002866e-06 -8.33986187e-06 -4.16993094e-05 -3.33594475e-05 1.38997698e-05 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 4.22604181e-06 2.11302091e-05 4.04560801e-05 -1.41871954e-05 -7.09359772e-05 2.44441635e-06 2.47970899e-06 1.23985450e-05 1.04247858e-05 -4.34366074e-06 1.31792447e-06 1.42696266e-05 4.22604181e-06 -7.59910514e-07 -7.04340302e-06 -1.41871954e-05 2.62355898e-06 2.36453257e-05 -5.95722755e-07 -4.89269790e-07 -4.34366074e-06 -3.60141605e-06 8.15449649e-07 6.58962236e-06 7.13481329e-05 2.11302091e-05 -7.04340302e-06 -3.45682450e-05 -7.09359772e-05 2.36453257e-05 1.16121122e-04 -2.97861377e-06 -4.34366074e-06 -2.13388414e-05 -1.67422057e-05 7.11294712e-06 1.31931676e-05 1.42707031e-04 4.04560801e-05 -1.41871954e-05 -7.09359772e-05 -1.35576122e-04 4.74618663e-05 2.37309331e-04 -8.24004626e-06 -8.46263429e-06 -4.23131714e-05 -3.54807188e-05 1.47836328e-05 -4.39772254e-06 -4.75690104e-05 -1.41871954e-05 2.62355898e-06 2.36453257e-05 4.74618663e-05 -9.01114524e-06 -7.91031105e-05 2.04079272e-06 1.73409032e-06 1.47836328e-05 1.22344517e-05 -2.89015053e-06 -2.19886127e-05 -2.37845052e-04 -7.09359772e-05 2.36453257e-05 1.16121122e-04 2.37309331e-04 -7.91031105e-05 -3.88706075e-04 1.02039636e-05 1.47836328e-05 7.26955279e-05 5.70968043e-05 -2.42318426e-05 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 5.95722755e-07 2.97861377e-06 8.24004626e-06 -2.04079272e-06 -1.02039636e-05 1.40335193e-07 3.06000076e-07 1.53000038e-06 1.12314006e-06 -4.67975025e-07 -7.90823570e-07 -8.33986187e-06 -2.47970899e-06 4.89269790e-07 4.34366074e-06 8.46263429e-06 -1.73409032e-06 -1.47836328e-05 3.06000076e-07 3.49595231e-07 1.90867338e-06 1.56090719e-06 -5.71522584e-07 -3.95411785e-06 -4.16993094e-05 -1.23985450e-05 4.34366074e-06 2.13388414e-05 4.23131714e-05 -1.47836328e-05 -7.26955279e-05 1.53000038e-06 1.90867338e-06 9.51122747e-06 7.65895674e-06 -3.20700306e-06 -3.16329428e-06 -3.33594475e-05 -1.04247858e-05 3.60141605e-06 1.67422057e-05 3.54807188e-05 -1.22344517e-05 -5.70968043e-05 1.12314006e-06 1.56090719e-06 7.65895674e-06 6.07076274e-06 -2.57724878e-06 1.31803928e-06 1.38997698e-05 4.34366074e-06 -8.15449649e-07 -7.11294712e-06 -1.47836328e-05 2.89015053e-06 2.42318426e-05 -4.67975025e-07 -5.71522584e-07 -3.20700306e-06 -2.57724878e-06 9.59219321e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --1 0 -1 507 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 -3.25689024e-04 -6.51378048e-04 -1.06639054e-03 1.06639054e-03 2.13278108e-03 -4.52806801e-05 -5.22856257e-05 -1.04571251e-04 -7.84284385e-05 1.04571251e-04 1.40271766e-02 6.79314330e-02 1.27999040e-02 -1.27999040e-02 -3.83997120e-02 -3.13231900e-02 3.13231900e-02 9.39695701e-02 1.95007672e-03 8.44407987e-04 2.53322396e-03 3.37763195e-03 -2.53322396e-03 1.56710856e-03 1.39613919e-02 2.89608434e-03 -2.89608434e-03 -5.79216869e-03 -9.35225951e-03 9.35225951e-03 1.87045190e-02 -2.85376584e-04 -3.29524496e-04 -6.59048991e-04 -4.94286743e-04 6.59048991e-04 6.79314330e-02 1.60907873e-01 4.09845600e-02 -4.09845600e-02 -1.22953680e-01 -5.94754012e-02 5.94754012e-02 1.78426204e-01 2.00105569e-02 8.66482532e-03 2.59944760e-02 3.46593013e-02 -2.59944760e-02 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 6.42637659e-04 1.28527532e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 1.33367462e-04 4.04340602e-05 8.08681204e-05 1.33657432e-04 -1.78209909e-04 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 1.07324936e-02 3.21974808e-02 -1.69480895e-02 -2.09443300e-02 -6.28329901e-02 -6.06202249e-03 -3.72497331e-05 -1.11749199e-04 -7.04948694e-03 5.28711521e-03 3.25689024e-04 2.89608434e-03 6.42637659e-04 -4.14019247e-04 -1.28527532e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 -4.90670003e-05 -4.04340602e-05 -1.78209909e-04 -1.82328327e-04 8.08681204e-05 1.27999040e-02 4.09845600e-02 1.07324936e-02 5.73556868e-03 -3.21974808e-02 -2.09443300e-02 -1.69480895e-02 6.28329901e-02 3.07402353e-03 3.72497331e-05 5.28711521e-03 8.77460895e-03 -1.11749199e-04 6.51378048e-04 5.79216869e-03 1.28527532e-03 -1.28527532e-03 -2.34193222e-03 -4.15611128e-03 4.15611128e-03 7.54522870e-03 -9.81340007e-05 -1.78209909e-04 -3.07748924e-04 -1.69973075e-04 3.07748924e-04 3.83997120e-02 1.22953680e-01 3.21974808e-02 -3.21974808e-02 -8.01243800e-02 -6.28329901e-02 6.28329901e-02 1.50606551e-01 9.22207060e-03 5.28711521e-03 1.41362236e-02 1.59730948e-02 -1.41362236e-02 1.06639054e-03 9.35225951e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 -4.10981523e-03 6.68105894e-03 1.33621179e-02 -3.95156129e-04 -8.87082588e-05 -1.77416518e-04 -3.69363005e-04 4.92484006e-04 3.13231900e-02 5.94754012e-02 -1.69480895e-02 -2.09443300e-02 -6.28329901e-02 4.58861475e-02 2.75523199e-02 8.26569598e-02 2.03553554e-02 -1.22512846e-03 -3.67538539e-03 2.18708352e-02 -1.64031264e-02 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 6.68105894e-03 -4.10981523e-03 -1.33621179e-02 1.22299680e-04 8.87082588e-05 4.92484006e-04 5.26896749e-04 -1.77416518e-04 -3.13231900e-02 -5.94754012e-02 -2.09443300e-02 -1.69480895e-02 6.28329901e-02 2.75523199e-02 4.58861475e-02 -8.26569598e-02 -8.76302120e-03 1.22512846e-03 -1.64031264e-02 -2.85636725e-02 -3.67538539e-03 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 4.15611128e-03 7.54522870e-03 1.33621179e-02 -1.33621179e-02 -2.41529920e-02 2.44599361e-04 4.92484006e-04 8.27434268e-04 4.23658521e-04 -8.27434268e-04 -9.39695701e-02 -1.78426204e-01 -6.28329901e-02 6.28329901e-02 1.50606551e-01 8.26569598e-02 -8.26569598e-02 -1.74532412e-01 -2.62890636e-02 -1.64031264e-02 -4.25165420e-02 -4.55339938e-02 4.25165420e-02 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 4.90670003e-05 9.81340007e-05 3.95156129e-04 -1.22299680e-04 -2.44599361e-04 -2.59797738e-05 -1.69297603e-05 -3.38595206e-05 -3.69220468e-05 4.92293958e-05 1.95007672e-03 2.00105569e-02 6.06202249e-03 -3.07402353e-03 -9.22207060e-03 -2.03553554e-02 8.76302120e-03 2.62890636e-02 1.46476011e-03 2.40057426e-04 7.20172278e-04 2.64406855e-03 -1.98305141e-03 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 4.04340602e-05 1.78209909e-04 8.87082588e-05 -8.87082588e-05 -4.92484006e-04 -1.69297603e-05 -2.71695573e-05 -5.38872760e-05 -2.93232050e-05 5.38872760e-05 8.44407987e-04 8.66482532e-03 3.72497331e-05 -3.72497331e-05 -5.28711521e-03 1.22512846e-03 -1.22512846e-03 1.64031264e-02 2.40057426e-04 1.02914641e-04 1.22324825e-03 4.15791659e-04 -1.22324825e-03 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 1.78209909e-04 3.07748924e-04 1.77416518e-04 -4.92484006e-04 -8.27434268e-04 -3.38595206e-05 -5.38872760e-05 -1.08000471e-04 -7.63940131e-05 9.44638495e-05 2.53322396e-03 2.59944760e-02 1.11749199e-04 -5.28711521e-03 -1.41362236e-02 3.67538539e-03 1.64031264e-02 4.25165420e-02 7.20172278e-04 1.22324825e-03 3.36490998e-03 2.70562219e-03 -1.72541514e-03 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 1.82328327e-04 1.69973075e-04 3.69363005e-04 -5.26896749e-04 -4.23658521e-04 -3.69220468e-05 -2.93232050e-05 -7.63940131e-05 -6.86136812e-05 6.75202116e-05 3.37763195e-03 3.46593013e-02 7.04948694e-03 -8.77460895e-03 -1.59730948e-02 -2.18708352e-02 2.85636725e-02 4.55339938e-02 2.64406855e-03 4.15791659e-04 2.70562219e-03 4.51786749e-03 -1.97649858e-03 1.04571251e-04 6.59048991e-04 1.78209909e-04 -8.08681204e-05 -3.07748924e-04 -4.92484006e-04 1.77416518e-04 8.27434268e-04 4.92293958e-05 5.38872760e-05 9.44638495e-05 6.75202116e-05 -1.08000471e-04 -2.53322396e-03 -2.59944760e-02 -5.28711521e-03 1.11749199e-04 1.41362236e-02 1.64031264e-02 3.67538539e-03 -4.25165420e-02 -1.98305141e-03 -1.22324825e-03 -1.72541514e-03 -1.97649858e-03 3.36490998e-03 1.70328256e-04 1.56710856e-03 3.25689024e-04 -3.25689024e-04 -6.51378048e-04 -1.06639054e-03 1.06639054e-03 2.13278108e-03 -4.52806801e-05 -5.22856257e-05 -1.04571251e-04 -7.84284385e-05 1.04571251e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 -2.89608434e-03 -5.79216869e-03 -9.35225951e-03 9.35225951e-03 1.87045190e-02 -2.85376584e-04 -3.29524496e-04 -6.59048991e-04 -4.94286743e-04 6.59048991e-04 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 6.42637659e-04 1.28527532e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 1.33367462e-04 4.04340602e-05 8.08681204e-05 1.33657432e-04 -1.78209909e-04 3.25689024e-04 2.89608434e-03 6.42637659e-04 -4.14019247e-04 -1.28527532e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 -4.90670003e-05 -4.04340602e-05 -1.78209909e-04 -1.82328327e-04 8.08681204e-05 6.51378048e-04 5.79216869e-03 1.28527532e-03 -1.28527532e-03 -2.34193222e-03 -4.15611128e-03 4.15611128e-03 7.54522870e-03 -9.81340007e-05 -1.78209909e-04 -3.07748924e-04 -1.69973075e-04 3.07748924e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 -4.10981523e-03 6.68105894e-03 1.33621179e-02 -3.95156129e-04 -8.87082588e-05 -1.77416518e-04 -3.69363005e-04 4.92484006e-04 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 6.68105894e-03 -4.10981523e-03 -1.33621179e-02 1.22299680e-04 8.87082588e-05 4.92484006e-04 5.26896749e-04 -1.77416518e-04 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 4.15611128e-03 7.54522870e-03 1.33621179e-02 -1.33621179e-02 -2.41529920e-02 2.44599361e-04 4.92484006e-04 8.27434268e-04 4.23658521e-04 -8.27434268e-04 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 4.90670003e-05 9.81340007e-05 3.95156129e-04 -1.22299680e-04 -2.44599361e-04 -2.59797738e-05 -1.69297603e-05 -3.38595206e-05 -3.69220468e-05 4.92293958e-05 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 4.04340602e-05 1.78209909e-04 8.87082588e-05 -8.87082588e-05 -4.92484006e-04 -1.69297603e-05 -2.71695573e-05 -5.38872760e-05 -2.93232050e-05 5.38872760e-05 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 1.78209909e-04 3.07748924e-04 1.77416518e-04 -4.92484006e-04 -8.27434268e-04 -3.38595206e-05 -5.38872760e-05 -1.08000471e-04 -7.63940131e-05 9.44638495e-05 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 1.82328327e-04 1.69973075e-04 3.69363005e-04 -5.26896749e-04 -4.23658521e-04 -3.69220468e-05 -2.93232050e-05 -7.63940131e-05 -6.86136812e-05 6.75202116e-05 1.04571251e-04 6.59048991e-04 1.78209909e-04 -8.08681204e-05 -3.07748924e-04 -4.92484006e-04 1.77416518e-04 8.27434268e-04 4.92293958e-05 5.38872760e-05 9.44638495e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 351 364 377 390 403 416 429 442 455 468 481 494 507 --1 0 0 488 - 3.91348915e-02 1.43320629e-01 -7.02734648e-02 -7.02734648e-02 1.48982977e-01 1.48982977e-01 1.22154152e-02 -2.11577197e-02 2.64027557e-01 3.35702802e-01 -2.34088114e-01 -2.34088114e-01 -2.34088114e-01 2.32521472e-01 2.32521472e-01 2.32521472e-01 -1.17443083e-01 -1.17443083e-01 -1.17443083e-01 1.43320629e-01 2.06957410e-01 -1.43523909e-01 -1.43523909e-01 1.50473058e-01 1.50473058e-01 2.77360403e-02 -4.80402309e-02 3.35702802e-01 2.76220067e-01 -4.62745275e-02 -4.62745275e-02 -4.62745275e-02 8.52749857e-02 8.52749857e-02 8.52749857e-02 9.22774953e-02 9.22774953e-02 9.22774953e-02 4.35912107e-02 -8.47000309e-02 1.47334830e-02 1.47334830e-02 2.34088114e-01 4.62745275e-02 5.08041420e-02 -1.96806662e-01 -1.96806662e-01 -1.84251812e-01 7.23859503e-02 7.23859503e-02 1.26391054e-01 -2.67331842e-02 -2.67331842e-02 -1.36191048e-01 7.02734648e-02 1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 2.41609623e-02 1.47334830e-02 -4.18480142e-02 2.34088114e-01 4.62745275e-02 -1.96806662e-01 5.08041420e-02 -1.96806662e-01 7.23859503e-02 -1.84251812e-01 7.23859503e-02 -6.31955270e-02 -2.67331842e-02 -1.36191048e-01 1.09457864e-01 -2.67331842e-02 7.02734648e-02 1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 2.41609623e-02 -1.47334830e-02 -4.18480142e-02 2.34088114e-01 4.62745275e-02 -1.96806662e-01 -1.96806662e-01 5.08041420e-02 7.23859503e-02 7.23859503e-02 -1.84251812e-01 -6.31955270e-02 -1.36191048e-01 -2.67331842e-02 -1.09457864e-01 -2.67331842e-02 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 -3.71929353e-02 -2.32521472e-01 -8.52749857e-02 -1.84251812e-01 7.23859503e-02 7.23859503e-02 1.72059579e-01 -9.02854717e-02 -9.02854717e-02 -2.86829339e-02 -8.36706010e-02 -8.36706010e-02 -5.88304515e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 -2.61274075e-02 -3.71929353e-02 4.52539972e-02 -2.32521472e-01 -8.52749857e-02 7.23859503e-02 -1.84251812e-01 7.23859503e-02 -9.02854717e-02 1.72059579e-01 -9.02854717e-02 1.43414670e-02 -8.36706010e-02 -5.88304515e-02 -2.48401494e-02 -8.36706010e-02 -1.48982977e-01 -1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 -2.61274075e-02 3.71929353e-02 4.52539972e-02 -2.32521472e-01 -8.52749857e-02 7.23859503e-02 7.23859503e-02 -1.84251812e-01 -9.02854717e-02 -9.02854717e-02 1.72059579e-01 1.43414670e-02 -5.88304515e-02 -8.36706010e-02 2.48401494e-02 -8.36706010e-02 1.22154152e-02 2.77360403e-02 -2.41609623e-02 -2.41609623e-02 2.61274075e-02 2.61274075e-02 1.64075411e-02 -2.83178480e-02 -1.26391054e-01 6.31955270e-02 6.31955270e-02 2.86829339e-02 -1.43414670e-02 -1.43414670e-02 -1.36861292e-01 -5.81908714e-02 -5.81908714e-02 1.16381743e-01 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -1.17443083e-01 9.22774953e-02 2.67331842e-02 2.67331842e-02 1.36191048e-01 8.36706010e-02 8.36706010e-02 5.88304515e-02 -5.81908714e-02 2.75756579e-02 6.36474041e-02 -1.00789546e-01 6.36474041e-02 -1.47334830e-02 3.71929353e-02 -7.88139292e-03 -7.82316899e-03 -1.17443083e-01 9.22774953e-02 2.67331842e-02 1.36191048e-01 2.67331842e-02 8.36706010e-02 5.88304515e-02 8.36706010e-02 -5.81908714e-02 6.36474041e-02 2.75756579e-02 1.00789546e-01 6.36474041e-02 -1.47334830e-02 1.47334830e-02 3.71929353e-02 -3.71929353e-02 -1.57045619e-02 -1.09457864e-01 1.09457864e-01 2.48401494e-02 -2.48401494e-02 -1.00789546e-01 1.00789546e-01 -1.36861292e-01 -2.11577197e-02 -4.80402309e-02 4.18480142e-02 4.18480142e-02 -4.52539972e-02 -4.52539972e-02 -2.83178480e-02 4.91061754e-02 -1.17443083e-01 9.22774953e-02 1.36191048e-01 2.67331842e-02 2.67331842e-02 5.88304515e-02 8.36706010e-02 8.36706010e-02 1.16381743e-01 6.36474041e-02 6.36474041e-02 2.75756579e-02 9.03813139e-04 6.83095219e-03 8.43309998e-04 -2.52992999e-03 -2.52992999e-03 -2.52360170e-03 7.57080511e-03 7.57080511e-03 -1.01044875e-04 -6.56305714e-05 -6.56305714e-05 1.96891714e-04 3.91348915e-02 1.43320629e-01 -7.02734648e-02 -7.02734648e-02 1.48982977e-01 1.48982977e-01 1.22154152e-02 -2.11577197e-02 6.83095219e-03 4.49022829e-02 5.72585887e-03 -1.71775766e-02 -1.71775766e-02 -1.58598947e-02 4.75796841e-02 4.75796841e-02 1.04130562e-03 6.76347839e-04 6.76347839e-04 -2.02904352e-03 1.43320629e-01 2.06957410e-01 -1.43523909e-01 -1.43523909e-01 1.50473058e-01 1.50473058e-01 2.77360403e-02 -4.80402309e-02 -8.43309998e-04 -5.72585887e-03 4.26061120e-04 2.38239659e-03 2.38239659e-03 -1.48235482e-03 -6.78418274e-03 -6.78418274e-03 7.13997564e-06 -1.56159564e-04 -1.56159564e-04 8.25656177e-05 4.35912107e-02 -8.47000309e-02 1.47334830e-02 1.47334830e-02 2.52992999e-03 1.71775766e-02 2.38239659e-03 -5.92699644e-03 -7.14718976e-03 -6.78418274e-03 1.66087992e-02 2.03525482e-02 2.01387090e-04 1.25444848e-04 8.25656177e-05 -1.28637691e-04 -3.76334544e-04 7.02734648e-02 1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 2.41609623e-02 1.47334830e-02 -4.18480142e-02 2.52992999e-03 1.71775766e-02 2.38239659e-03 -7.14718976e-03 -5.92699644e-03 -6.78418274e-03 2.03525482e-02 1.66087992e-02 2.01387090e-04 8.25656177e-05 1.25444848e-04 1.28637691e-04 -3.76334544e-04 7.02734648e-02 1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 2.41609623e-02 -1.47334830e-02 -4.18480142e-02 2.52360170e-03 1.58598947e-02 -1.48235482e-03 -6.78418274e-03 -6.78418274e-03 5.13458842e-03 1.85131107e-02 1.85131107e-02 4.18310329e-04 5.12122996e-04 5.12122996e-04 -9.59355067e-04 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 -3.71929353e-02 -7.57080511e-03 -4.75796841e-02 -6.78418274e-03 1.66087992e-02 2.03525482e-02 1.85131107e-02 -4.42337068e-02 -5.55393321e-02 -1.58807013e-03 -1.02346772e-03 -9.59355067e-04 1.92337974e-04 3.07040317e-03 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 -2.61274075e-02 -3.71929353e-02 4.52539972e-02 -7.57080511e-03 -4.75796841e-02 -6.78418274e-03 2.03525482e-02 1.66087992e-02 1.85131107e-02 -5.55393321e-02 -4.42337068e-02 -1.58807013e-03 -9.59355067e-04 -1.02346772e-03 -1.92337974e-04 3.07040317e-03 -1.48982977e-01 -1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 -2.61274075e-02 3.71929353e-02 4.52539972e-02 -1.01044875e-04 1.04130562e-03 -7.13997564e-06 -2.01387090e-04 -2.01387090e-04 -4.18310329e-04 1.58807013e-03 1.58807013e-03 -3.27420436e-04 -3.35519138e-04 -3.35519138e-04 6.97611067e-04 1.22154152e-02 2.77360403e-02 -2.41609623e-02 -2.41609623e-02 2.61274075e-02 2.61274075e-02 1.64075411e-02 -2.83178480e-02 -6.56305714e-05 6.76347839e-04 1.56159564e-04 -1.25444848e-04 -8.25656177e-05 -5.12122996e-04 1.02346772e-03 9.59355067e-04 -3.35519138e-04 -6.48472168e-06 -1.72595341e-05 -5.94567521e-05 5.27432619e-04 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -6.56305714e-05 6.76347839e-04 1.56159564e-04 -8.25656177e-05 -1.25444848e-04 -5.12122996e-04 9.59355067e-04 1.02346772e-03 -3.35519138e-04 -1.72595341e-05 -6.48472168e-06 5.94567521e-05 5.27432619e-04 -1.47334830e-02 3.71929353e-02 -7.88139292e-03 -7.82316899e-03 1.28637691e-04 -1.28637691e-04 -1.92337974e-04 1.92337974e-04 -5.94567521e-05 5.94567521e-05 3.47696408e-04 -1.47334830e-02 1.47334830e-02 3.71929353e-02 -3.71929353e-02 -1.57045619e-02 1.96891714e-04 -2.02904352e-03 -8.25656177e-05 3.76334544e-04 3.76334544e-04 9.59355067e-04 -3.07040317e-03 -3.07040317e-03 6.97611067e-04 5.27432619e-04 5.27432619e-04 -1.41297171e-03 -2.11577197e-02 -4.80402309e-02 4.18480142e-02 4.18480142e-02 -4.52539972e-02 -4.52539972e-02 -2.83178480e-02 4.91061754e-02 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 22 23 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 22 23 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 15 16 17 18 19 20 21 22 23 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 16 17 19 20 22 23 24 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 3 4 6 7 9 10 11 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 - 0 19 38 54 76 98 114 136 158 176 193 210 222 242 262 282 298 320 342 358 380 402 422 439 456 468 488 --1 0 1 520 - 3.91348915e-02 1.43320629e-01 -7.02734648e-02 -7.02734648e-02 1.48982977e-01 1.48982977e-01 -6.10770759e-03 -2.11577197e-02 -1.05788599e-02 1.40271766e-02 6.79314330e-02 -3.83997120e-02 -1.27999040e-02 1.27999040e-02 9.39695701e-02 3.13231900e-02 -3.13231900e-02 -3.90015343e-03 -2.53322396e-03 2.53322396e-03 8.44407987e-04 1.43320629e-01 2.06957410e-01 -1.43523909e-01 -1.43523909e-01 1.50473058e-01 1.50473058e-01 -1.38680201e-02 -4.80402309e-02 -2.40201155e-02 6.79314330e-02 1.60907873e-01 -1.22953680e-01 -4.09845600e-02 4.09845600e-02 1.78426204e-01 5.94754012e-02 -5.94754012e-02 -4.00211138e-02 -2.59944760e-02 2.59944760e-02 8.66482532e-03 7.02734648e-02 1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 6.79089450e-04 -4.18480142e-02 -2.82907486e-02 3.83997120e-02 1.22953680e-01 -8.01243800e-02 -3.21974808e-02 3.21974808e-02 1.50606551e-01 6.28329901e-02 -6.28329901e-02 -1.84441412e-02 -1.41362236e-02 1.41362236e-02 5.28711521e-03 7.02734648e-02 1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 -2.48400517e-02 -4.18480142e-02 -1.35572656e-02 1.27999040e-02 4.09845600e-02 -3.21974808e-02 5.73556868e-03 1.07324936e-02 6.28329901e-02 -1.69480895e-02 -2.09443300e-02 -9.13604602e-03 -1.11749199e-04 5.28711521e-03 1.72512200e-03 3.72497331e-05 4.35912107e-02 -8.47000309e-02 1.47334830e-02 1.47334830e-02 -1.27999040e-02 -4.09845600e-02 3.21974808e-02 1.07324936e-02 5.73556868e-03 -6.28329901e-02 -2.09443300e-02 -1.69480895e-02 9.13604602e-03 5.28711521e-03 -1.11749199e-04 1.72512200e-03 -3.72497331e-05 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 -1.91463231e-02 4.52539972e-02 4.12234663e-02 -9.39695701e-02 -1.78426204e-01 1.50606551e-01 6.28329901e-02 -6.28329901e-02 -1.74532412e-01 -8.26569598e-02 8.26569598e-02 5.25781272e-02 4.25165420e-02 -4.25165420e-02 -1.64031264e-02 -1.48982977e-01 -1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 4.52737305e-02 4.52539972e-02 4.03053096e-03 -3.13231900e-02 -5.94754012e-02 6.28329901e-02 -1.69480895e-02 -2.09443300e-02 -8.26569598e-02 4.58861475e-02 2.75523199e-02 2.91183766e-02 -3.67538539e-03 -1.64031264e-02 -6.69283727e-03 1.22512846e-03 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 -3.71929353e-02 3.13231900e-02 5.94754012e-02 -6.28329901e-02 -2.09443300e-02 -1.69480895e-02 8.26569598e-02 2.75523199e-02 4.58861475e-02 -2.91183766e-02 -1.64031264e-02 -3.67538539e-03 -6.69283727e-03 -1.22512846e-03 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 2.48400517e-02 1.91463231e-02 -4.52737305e-02 -7.67653617e-03 1.41589240e-02 1.39049485e-02 -3.90015343e-03 -4.00211138e-02 1.84441412e-02 9.13604602e-03 -9.13604602e-03 -5.25781272e-02 -2.91183766e-02 2.91183766e-02 6.04442117e-03 2.70322369e-03 -2.70322369e-03 -4.80114852e-04 -2.11577197e-02 -4.80402309e-02 4.18480142e-02 4.18480142e-02 -4.52539972e-02 -4.52539972e-02 1.41589240e-02 4.91061754e-02 2.45239757e-02 -2.53322396e-03 -2.59944760e-02 1.41362236e-02 1.11749199e-04 -5.28711521e-03 -4.25165420e-02 3.67538539e-03 1.64031264e-02 2.70322369e-03 3.36490998e-03 -1.72541514e-03 7.29123606e-04 -1.22324825e-03 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 -7.88139292e-03 2.53322396e-03 2.59944760e-02 -1.41362236e-02 -5.28711521e-03 1.11749199e-04 4.25165420e-02 1.64031264e-02 3.67538539e-03 -2.70322369e-03 -1.72541514e-03 3.36490998e-03 7.29123606e-04 1.22324825e-03 -1.05788599e-02 -2.40201155e-02 2.82907486e-02 1.35572656e-02 -4.12234663e-02 -4.03053096e-03 1.39049485e-02 2.45239757e-02 8.37951533e-03 -1.72512200e-03 -1.72512200e-03 6.69283727e-03 6.69283727e-03 7.29123606e-04 7.29123606e-04 -6.17935738e-05 -1.47334830e-02 3.71929353e-02 -7.88139292e-03 -7.82316899e-03 8.44407987e-04 8.66482532e-03 -5.28711521e-03 -3.72497331e-05 3.72497331e-05 1.64031264e-02 -1.22512846e-03 1.22512846e-03 -4.80114852e-04 -1.22324825e-03 1.22324825e-03 1.02914641e-04 1.40271766e-02 6.79314330e-02 -1.27999040e-02 -3.83997120e-02 -1.27999040e-02 3.13231900e-02 9.39695701e-02 3.13231900e-02 1.95007672e-03 -2.53322396e-03 -8.44407987e-04 -3.37763195e-03 -2.53322396e-03 3.91348915e-02 1.43320629e-01 -7.02734648e-02 -7.02734648e-02 1.48982977e-01 1.48982977e-01 -6.10770759e-03 -2.11577197e-02 -1.05788599e-02 6.79314330e-02 1.60907873e-01 -4.09845600e-02 -1.22953680e-01 -4.09845600e-02 5.94754012e-02 1.78426204e-01 5.94754012e-02 2.00105569e-02 -2.59944760e-02 -8.66482532e-03 -3.46593013e-02 -2.59944760e-02 1.43320629e-01 2.06957410e-01 -1.43523909e-01 -1.43523909e-01 1.50473058e-01 1.50473058e-01 -1.38680201e-02 -4.80402309e-02 -2.40201155e-02 1.27999040e-02 4.09845600e-02 5.73556868e-03 -3.21974808e-02 -1.07324936e-02 -1.69480895e-02 6.28329901e-02 2.09443300e-02 6.06202249e-03 -1.11749199e-04 -3.72497331e-05 -7.04948694e-03 -5.28711521e-03 7.02734648e-02 1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 6.79089450e-04 -4.18480142e-02 -2.82907486e-02 3.83997120e-02 1.22953680e-01 -3.21974808e-02 -8.01243800e-02 -3.21974808e-02 6.28329901e-02 1.50606551e-01 6.28329901e-02 9.22207060e-03 -1.41362236e-02 -5.28711521e-03 -1.59730948e-02 -1.41362236e-02 7.02734648e-02 1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 -2.48400517e-02 -4.18480142e-02 -1.35572656e-02 1.27999040e-02 4.09845600e-02 -1.07324936e-02 -3.21974808e-02 5.73556868e-03 2.09443300e-02 6.28329901e-02 -1.69480895e-02 3.07402353e-03 -5.28711521e-03 -3.72497331e-05 -8.77460895e-03 -1.11749199e-04 4.35912107e-02 -8.47000309e-02 1.47334830e-02 1.47334830e-02 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 6.28329901e-02 2.09443300e-02 4.58861475e-02 -8.26569598e-02 -2.75523199e-02 -2.03553554e-02 -3.67538539e-03 -1.22512846e-03 2.18708352e-02 1.64031264e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 -1.91463231e-02 4.52539972e-02 4.12234663e-02 -9.39695701e-02 -1.78426204e-01 6.28329901e-02 1.50606551e-01 6.28329901e-02 -8.26569598e-02 -1.74532412e-01 -8.26569598e-02 -2.62890636e-02 4.25165420e-02 1.64031264e-02 4.55339938e-02 4.25165420e-02 -1.48982977e-01 -1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 4.52737305e-02 4.52539972e-02 4.03053096e-03 -3.13231900e-02 -5.94754012e-02 2.09443300e-02 6.28329901e-02 -1.69480895e-02 -2.75523199e-02 -8.26569598e-02 4.58861475e-02 -8.76302120e-03 1.64031264e-02 -1.22512846e-03 2.85636725e-02 -3.67538539e-03 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 -3.71929353e-02 1.95007672e-03 2.00105569e-02 -6.06202249e-03 -9.22207060e-03 -3.07402353e-03 2.03553554e-02 2.62890636e-02 8.76302120e-03 1.46476011e-03 -7.20172278e-04 -2.40057426e-04 -2.64406855e-03 -1.98305141e-03 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 2.48400517e-02 1.91463231e-02 -4.52737305e-02 -7.67653617e-03 1.41589240e-02 1.39049485e-02 -2.53322396e-03 -2.59944760e-02 1.11749199e-04 1.41362236e-02 5.28711521e-03 3.67538539e-03 -4.25165420e-02 -1.64031264e-02 -7.20172278e-04 3.36490998e-03 1.22324825e-03 2.70562219e-03 1.72541514e-03 -2.11577197e-02 -4.80402309e-02 4.18480142e-02 4.18480142e-02 -4.52539972e-02 -4.52539972e-02 1.41589240e-02 4.91061754e-02 2.45239757e-02 -8.44407987e-04 -8.66482532e-03 3.72497331e-05 5.28711521e-03 3.72497331e-05 1.22512846e-03 -1.64031264e-02 1.22512846e-03 -2.40057426e-04 1.22324825e-03 1.02914641e-04 4.15791659e-04 1.22324825e-03 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -3.37763195e-03 -3.46593013e-02 7.04948694e-03 1.59730948e-02 8.77460895e-03 -2.18708352e-02 -4.55339938e-02 -2.85636725e-02 -2.64406855e-03 2.70562219e-03 4.15791659e-04 4.51786749e-03 1.97649858e-03 -1.05788599e-02 -2.40201155e-02 2.82907486e-02 1.35572656e-02 -4.12234663e-02 -4.03053096e-03 1.39049485e-02 2.45239757e-02 8.37951533e-03 -2.53322396e-03 -2.59944760e-02 5.28711521e-03 1.41362236e-02 1.11749199e-04 -1.64031264e-02 -4.25165420e-02 3.67538539e-03 -1.98305141e-03 1.72541514e-03 1.22324825e-03 1.97649858e-03 3.36490998e-03 -1.47334830e-02 3.71929353e-02 -7.88139292e-03 -7.82316899e-03 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 16 17 19 20 22 23 24 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 - 0 21 42 63 85 102 123 145 162 183 205 222 238 254 276 298 320 342 359 381 403 420 442 464 481 503 520 --1 0 2 652 - 1.70328256e-04 1.56710856e-03 -6.51378048e-04 -3.25689024e-04 3.25689024e-04 2.13278108e-03 1.06639054e-03 -1.06639054e-03 9.05613602e-05 1.04571251e-04 -1.04571251e-04 -5.22856257e-05 1.25466617e-06 1.34349826e-05 -6.58962236e-06 -1.31792447e-06 3.95377341e-06 2.19886127e-05 4.39772254e-06 -1.31931676e-05 3.04388134e-06 1.31803928e-06 -3.95411785e-06 -1.05443143e-06 -7.90823570e-07 1.56710856e-03 1.39613919e-02 -5.79216869e-03 -2.89608434e-03 2.89608434e-03 1.87045190e-02 9.35225951e-03 -9.35225951e-03 5.70753169e-04 6.59048991e-04 -6.59048991e-04 -3.29524496e-04 1.34349826e-05 1.43209127e-04 -7.13481329e-05 -1.42696266e-05 4.28088798e-05 2.37845052e-04 4.75690104e-05 -1.42707031e-04 3.21001433e-05 1.38997698e-05 -4.16993094e-05 -1.11198158e-05 -8.33986187e-06 6.51378048e-04 5.79216869e-03 -2.34193222e-03 -1.28527532e-03 1.28527532e-03 7.54522870e-03 4.15611128e-03 -4.15611128e-03 1.96268001e-04 3.07748924e-04 -3.07748924e-04 -1.78209909e-04 6.58962236e-06 7.13481329e-05 -3.45682450e-05 -7.04340302e-06 2.11302091e-05 1.16121122e-04 2.36453257e-05 -7.09359772e-05 1.59884824e-05 7.11294712e-06 -2.13388414e-05 -5.79154766e-06 -4.34366074e-06 3.25689024e-04 2.89608434e-03 -1.28527532e-03 -4.14019247e-04 6.42637659e-04 4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.82434463e-04 8.08681204e-05 -1.78209909e-04 -4.86708945e-05 -4.04340602e-05 1.31792447e-06 1.42696266e-05 -7.04340302e-06 -7.59910514e-07 4.22604181e-06 2.36453257e-05 2.62355898e-06 -1.41871954e-05 3.41677917e-06 8.15449649e-07 -4.34366074e-06 -1.28479698e-06 -4.89269790e-07 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 6.42637659e-04 -4.14019247e-04 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.82434463e-04 -1.78209909e-04 8.08681204e-05 -4.86708945e-05 4.04340602e-05 -3.95377341e-06 -4.28088798e-05 2.11302091e-05 4.22604181e-06 -1.20293553e-05 -7.09359772e-05 -1.41871954e-05 4.04560801e-05 -1.02503375e-05 -4.34366074e-06 1.23985450e-05 3.09546624e-06 2.47970899e-06 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 4.15611128e-03 -4.15611128e-03 -2.41529920e-02 -1.33621179e-02 1.33621179e-02 -4.89198722e-04 -8.27434268e-04 8.27434268e-04 4.92484006e-04 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 2.36453257e-05 -7.09359772e-05 -3.88706075e-04 -7.91031105e-05 2.37309331e-04 -5.45492648e-05 -2.42318426e-05 7.26955279e-05 1.97115105e-05 1.47836328e-05 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.33621179e-02 -4.10981523e-03 6.68105894e-03 -5.17455810e-04 -1.77416518e-04 4.92484006e-04 1.57533744e-04 8.87082588e-05 -4.39772254e-06 -4.75690104e-05 2.36453257e-05 2.62355898e-06 -1.41871954e-05 -7.91031105e-05 -9.01114524e-06 4.74618663e-05 -1.16157423e-05 -2.89015053e-06 1.47836328e-05 4.34984751e-06 1.73409032e-06 1.06639054e-03 9.35225951e-03 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.33621179e-02 6.68105894e-03 -4.10981523e-03 5.17455810e-04 4.92484006e-04 -1.77416518e-04 1.57533744e-04 -8.87082588e-05 1.31931676e-05 1.42707031e-04 -7.09359772e-05 -1.41871954e-05 4.04560801e-05 2.37309331e-04 4.74618663e-05 -1.35576122e-04 3.48472270e-05 1.47836328e-05 -4.23131714e-05 -1.06042700e-05 -8.46263429e-06 9.05613602e-05 5.70753169e-04 -1.96268001e-04 -1.82434463e-04 1.82434463e-04 4.89198722e-04 5.17455810e-04 -5.17455810e-04 -8.99306349e-05 -8.30889164e-05 8.30889164e-05 3.38595206e-05 3.04388134e-06 3.21001433e-05 -1.59884824e-05 -3.41677917e-06 1.02503375e-05 5.45492648e-05 1.16157423e-05 -3.48472270e-05 5.56082368e-06 2.46595043e-06 -7.39785129e-06 -2.00638043e-06 -1.50478532e-06 1.04571251e-04 6.59048991e-04 -3.07748924e-04 -8.08681204e-05 1.78209909e-04 8.27434268e-04 1.77416518e-04 -4.92484006e-04 -8.30889164e-05 -1.08000471e-04 9.44638495e-05 -8.87380160e-06 5.38872760e-05 1.31803928e-06 1.38997698e-05 -7.11294712e-06 -8.15449649e-07 4.34366074e-06 2.42318426e-05 2.89015053e-06 -1.47836328e-05 2.46595043e-06 9.59219321e-07 -3.20700306e-06 -8.83346132e-07 -5.71522584e-07 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 1.78209909e-04 -8.08681204e-05 -8.27434268e-04 -4.92484006e-04 1.77416518e-04 8.30889164e-05 9.44638495e-05 -1.08000471e-04 -8.87380160e-06 -5.38872760e-05 -3.95411785e-06 -4.16993094e-05 2.13388414e-05 4.34366074e-06 -1.23985450e-05 -7.26955279e-05 -1.47836328e-05 4.23131714e-05 -7.39785129e-06 -3.20700306e-06 9.51122747e-06 2.50445917e-06 1.90867338e-06 4.86708945e-05 4.86708945e-05 -1.57533744e-04 -1.57533744e-04 -8.87380160e-06 -8.87380160e-06 -4.66282012e-06 -1.05443143e-06 -1.11198158e-05 5.79154766e-06 1.28479698e-06 -3.09546624e-06 -1.97115105e-05 -4.34984751e-06 1.06042700e-05 -2.00638043e-06 -8.83346132e-07 2.50445917e-06 6.50274256e-07 5.15449757e-07 -5.22856257e-05 -3.29524496e-04 1.78209909e-04 4.04340602e-05 -4.04340602e-05 -4.92484006e-04 -8.87082588e-05 8.87082588e-05 3.38595206e-05 5.38872760e-05 -5.38872760e-05 -2.71695573e-05 -7.90823570e-07 -8.33986187e-06 4.34366074e-06 4.89269790e-07 -2.47970899e-06 -1.47836328e-05 -1.73409032e-06 8.46263429e-06 -1.50478532e-06 -5.71522584e-07 1.90867338e-06 5.15449757e-07 3.49595231e-07 9.03813139e-04 6.83095219e-03 -2.52992999e-03 -2.52992999e-03 8.43309998e-04 7.57080511e-03 7.57080511e-03 -2.52360170e-03 5.05224374e-05 1.96891714e-04 -6.56305714e-05 8.75074285e-05 -6.56305714e-05 1.70328256e-04 1.56710856e-03 -6.51378048e-04 -3.25689024e-04 3.25689024e-04 2.13278108e-03 1.06639054e-03 -1.06639054e-03 9.05613602e-05 1.04571251e-04 -1.04571251e-04 -5.22856257e-05 6.83095219e-03 4.49022829e-02 -1.71775766e-02 -1.71775766e-02 5.72585887e-03 4.75796841e-02 4.75796841e-02 -1.58598947e-02 -5.20652809e-04 -2.02904352e-03 6.76347839e-04 -9.01797119e-04 6.76347839e-04 1.56710856e-03 1.39613919e-02 -5.79216869e-03 -2.89608434e-03 2.89608434e-03 1.87045190e-02 9.35225951e-03 -9.35225951e-03 5.70753169e-04 6.59048991e-04 -6.59048991e-04 -3.29524496e-04 2.52992999e-03 1.71775766e-02 -5.92699644e-03 -7.14718976e-03 2.38239659e-03 1.66087992e-02 2.03525482e-02 -6.78418274e-03 -2.12097053e-04 -3.76334544e-04 1.25444848e-04 -1.10087490e-04 8.25656177e-05 6.51378048e-04 5.79216869e-03 -2.34193222e-03 -1.28527532e-03 1.28527532e-03 7.54522870e-03 4.15611128e-03 -4.15611128e-03 1.96268001e-04 3.07748924e-04 -3.07748924e-04 -1.78209909e-04 2.52992999e-03 1.71775766e-02 -7.14718976e-03 -5.92699644e-03 2.38239659e-03 2.03525482e-02 1.66087992e-02 -6.78418274e-03 1.07099635e-05 -3.76334544e-04 8.25656177e-05 -2.38725181e-04 1.25444848e-04 3.25689024e-04 2.89608434e-03 -1.28527532e-03 -4.14019247e-04 6.42637659e-04 4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.82434463e-04 8.08681204e-05 -1.78209909e-04 -4.86708945e-05 -4.04340602e-05 -8.43309998e-04 -5.72585887e-03 2.38239659e-03 2.38239659e-03 4.26061120e-04 -6.78418274e-03 -6.78418274e-03 -1.48235482e-03 -3.56998782e-06 8.25656177e-05 -1.56159564e-04 -6.18340029e-06 -1.56159564e-04 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 6.42637659e-04 -4.14019247e-04 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.82434463e-04 -1.78209909e-04 8.08681204e-05 -4.86708945e-05 4.04340602e-05 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 2.03525482e-02 -6.78418274e-03 -4.42337068e-02 -5.55393321e-02 1.85131107e-02 9.60604637e-04 3.07040317e-03 -1.02346772e-03 1.27914009e-03 -9.59355067e-04 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 4.15611128e-03 -4.15611128e-03 -2.41529920e-02 -1.33621179e-02 1.33621179e-02 -4.89198722e-04 -8.27434268e-04 8.27434268e-04 4.92484006e-04 -7.57080511e-03 -4.75796841e-02 2.03525482e-02 1.66087992e-02 -6.78418274e-03 -5.55393321e-02 -4.42337068e-02 1.85131107e-02 6.27465494e-04 3.07040317e-03 -9.59355067e-04 1.47147806e-03 -1.02346772e-03 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.33621179e-02 -4.10981523e-03 6.68105894e-03 -5.17455810e-04 -1.77416518e-04 4.92484006e-04 1.57533744e-04 8.87082588e-05 2.52360170e-03 1.58598947e-02 -6.78418274e-03 -6.78418274e-03 -1.48235482e-03 1.85131107e-02 1.85131107e-02 5.13458842e-03 -2.09155165e-04 -9.59355067e-04 5.12122996e-04 -3.62267372e-04 5.12122996e-04 1.06639054e-03 9.35225951e-03 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.33621179e-02 6.68105894e-03 -4.10981523e-03 5.17455810e-04 4.92484006e-04 -1.77416518e-04 1.57533744e-04 -8.87082588e-05 5.05224374e-05 -5.20652809e-04 2.12097053e-04 -1.07099635e-05 3.56998782e-06 -9.60604637e-04 -6.27465494e-04 2.09155165e-04 1.78917197e-04 -3.48805533e-04 1.16268511e-04 -2.92334169e-04 2.19250627e-04 9.05613602e-05 5.70753169e-04 -1.96268001e-04 -1.82434463e-04 1.82434463e-04 4.89198722e-04 5.17455810e-04 -5.17455810e-04 -8.99306349e-05 -8.30889164e-05 8.30889164e-05 3.38595206e-05 1.96891714e-04 -2.02904352e-03 3.76334544e-04 3.76334544e-04 -8.25656177e-05 -3.07040317e-03 -3.07040317e-03 9.59355067e-04 -3.48805533e-04 -1.41297171e-03 5.27432619e-04 -6.04148906e-04 5.27432619e-04 1.04571251e-04 6.59048991e-04 -3.07748924e-04 -8.08681204e-05 1.78209909e-04 8.27434268e-04 1.77416518e-04 -4.92484006e-04 -8.30889164e-05 -1.08000471e-04 9.44638495e-05 -8.87380160e-06 5.38872760e-05 -6.56305714e-05 6.76347839e-04 -1.25444848e-04 -8.25656177e-05 1.56159564e-04 1.02346772e-03 9.59355067e-04 -5.12122996e-04 1.16268511e-04 5.27432619e-04 -6.48472168e-06 3.20296473e-04 -1.72595341e-05 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 1.78209909e-04 -8.08681204e-05 -8.27434268e-04 -4.92484006e-04 1.77416518e-04 8.30889164e-05 9.44638495e-05 -1.08000471e-04 -8.87380160e-06 -5.38872760e-05 8.75074285e-05 -9.01797119e-04 1.10087490e-04 2.38725181e-04 6.18340029e-06 -1.27914009e-03 -1.47147806e-03 3.62267372e-04 -2.92334169e-04 -6.04148906e-04 3.20296473e-04 -1.58641225e-04 2.60839721e-04 4.86708945e-05 4.86708945e-05 -1.57533744e-04 -1.57533744e-04 -8.87380160e-06 -8.87380160e-06 -4.66282012e-06 -6.56305714e-05 6.76347839e-04 -8.25656177e-05 -1.25444848e-04 1.56159564e-04 9.59355067e-04 1.02346772e-03 -5.12122996e-04 2.19250627e-04 5.27432619e-04 -1.72595341e-05 2.60839721e-04 -6.48472168e-06 -5.22856257e-05 -3.29524496e-04 1.78209909e-04 4.04340602e-05 -4.04340602e-05 -4.92484006e-04 -8.87082588e-05 8.87082588e-05 3.38595206e-05 5.38872760e-05 -5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 25 50 75 101 127 152 178 204 229 255 281 301 326 351 376 401 427 453 478 504 530 555 581 607 627 652 --1 1 -2 169 - 6.09103871e-05 6.14453477e-04 5.91853803e-05 5.91853803e-05 -2.95926902e-04 -2.01724529e-04 -2.01724529e-04 1.00862265e-03 -4.78869050e-05 6.91187938e-06 -3.45593969e-05 -8.29425526e-05 -3.45593969e-05 6.14453477e-04 6.16334179e-03 5.89280869e-04 5.89280869e-04 -2.94640435e-03 -2.00665301e-03 -2.00665301e-03 1.00332651e-02 -4.47447198e-04 6.45834401e-05 -3.22917201e-04 -7.75001281e-04 -3.22917201e-04 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 -5.93986875e-05 2.96993437e-04 -5.79546830e-05 2.01724907e-04 -1.00862453e-03 5.99184710e-05 3.84006907e-06 -1.92003453e-05 8.23728840e-05 3.43220350e-05 -5.91853803e-05 -5.89280869e-04 -5.93986875e-05 1.57901181e-05 2.96993437e-04 2.01724907e-04 -5.79546830e-05 -1.00862453e-03 4.13777746e-05 3.84006907e-06 3.43220350e-05 9.30773600e-05 -1.92003453e-05 2.95926902e-04 2.94640435e-03 2.96993437e-04 2.96993437e-04 -1.40977838e-03 -1.00862453e-03 -1.00862453e-03 4.78344308e-03 -2.06888873e-04 3.43220350e-05 -1.60905699e-04 -3.58342040e-04 -1.60905699e-04 2.01724529e-04 2.00665301e-03 -5.79546830e-05 2.01724907e-04 -1.00862453e-03 2.12351688e-04 -6.85394441e-04 3.42697221e-03 -2.00592339e-04 -1.40996735e-05 7.04983673e-05 -2.73631522e-04 -1.14013134e-04 2.01724529e-04 2.00665301e-03 2.01724907e-04 -5.79546830e-05 -1.00862453e-03 -6.85394441e-04 2.12351688e-04 3.42697221e-03 -1.36675680e-04 -1.40996735e-05 -1.14013134e-04 -3.10533823e-04 7.04983673e-05 -1.00862265e-03 -1.00332651e-02 -1.00862453e-03 -1.00862453e-03 4.78344308e-03 3.42697221e-03 3.42697221e-03 -1.62371149e-02 6.83378401e-04 -1.14013134e-04 5.33163371e-04 1.18364611e-03 5.33163371e-04 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 -4.13777746e-05 2.06888873e-04 2.00592339e-04 1.36675680e-04 -6.83378401e-04 1.53794146e-05 -4.67548763e-06 2.33774382e-05 2.78902609e-05 1.16209420e-05 6.91187938e-06 6.45834401e-05 -3.84006907e-06 -3.84006907e-06 -3.43220350e-05 1.40996735e-05 1.40996735e-05 1.14013134e-04 -4.67548763e-06 -1.61313514e-07 3.97900833e-06 -8.09818213e-06 3.97900833e-06 -3.45593969e-05 -3.22917201e-04 1.92003453e-05 -3.43220350e-05 1.60905699e-04 -7.04983673e-05 1.14013134e-04 -5.33163371e-04 2.33774382e-05 3.97900833e-06 -1.92605535e-05 2.69156783e-05 1.26855161e-05 -8.29425526e-05 -7.75001281e-04 -8.23728840e-05 -9.30773600e-05 3.58342040e-04 2.73631522e-04 3.10533823e-04 -1.18364611e-03 2.78902609e-05 -8.09818213e-06 2.69156783e-05 4.75843139e-05 3.37032945e-05 -3.45593969e-05 -3.22917201e-04 -3.43220350e-05 1.92003453e-05 1.60905699e-04 1.14013134e-04 -7.04983673e-05 -5.33163371e-04 1.16209420e-05 3.97900833e-06 1.26855161e-05 3.37032945e-05 -1.92605535e-05 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --1 1 -1 448 - 2.50728998e-03 1.64011405e-02 -9.26310694e-03 2.59488230e-02 3.67034157e-05 6.35721809e-05 1.40271766e-02 6.79314330e-02 -1.27999040e-02 1.27999040e-02 -3.83997120e-02 3.13231900e-02 -3.13231900e-02 9.39695701e-02 1.95007672e-03 8.44407987e-04 -2.53322396e-03 3.37763195e-03 2.53322396e-03 1.64011405e-02 8.10100377e-02 -5.00423367e-02 1.17965801e-01 6.27522019e-03 1.08690002e-02 6.79314330e-02 1.60907873e-01 -4.09845600e-02 4.09845600e-02 -1.22953680e-01 5.94754012e-02 -5.94754012e-02 1.78426204e-01 2.00105569e-02 8.66482532e-03 -2.59944760e-02 3.46593013e-02 2.59944760e-02 3.22869392e-03 -9.11832090e-03 1.65705842e-04 1.27999040e-02 4.09845600e-02 5.73556868e-03 1.07324936e-02 -3.21974808e-02 -1.69480895e-02 -2.09443300e-02 6.28329901e-02 6.06202249e-03 3.72497331e-05 -1.11749199e-04 7.04948694e-03 5.28711521e-03 3.22869392e-03 -9.11832090e-03 1.65705842e-04 -1.27999040e-02 -4.09845600e-02 1.07324936e-02 5.73556868e-03 3.21974808e-02 -2.09443300e-02 -1.69480895e-02 -6.28329901e-02 -3.07402353e-03 -3.72497331e-05 5.28711521e-03 -8.77460895e-03 -1.11749199e-04 9.26310694e-03 5.00423367e-02 -3.02879243e-02 7.61127847e-02 2.43070715e-03 4.21010828e-03 3.83997120e-02 1.22953680e-01 -3.21974808e-02 3.21974808e-02 -8.01243800e-02 6.28329901e-02 -6.28329901e-02 1.50606551e-01 9.22207060e-03 5.28711521e-03 -1.41362236e-02 1.59730948e-02 1.41362236e-02 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 -2.09443300e-02 6.28329901e-02 4.58861475e-02 2.75523199e-02 -8.26569598e-02 -2.03553554e-02 1.22512846e-03 -3.67538539e-03 -2.18708352e-02 -1.64031264e-02 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 3.13231900e-02 5.94754012e-02 -2.09443300e-02 -1.69480895e-02 -6.28329901e-02 2.75523199e-02 4.58861475e-02 8.26569598e-02 8.76302120e-03 -1.22512846e-03 -1.64031264e-02 2.85636725e-02 -3.67538539e-03 -2.59488230e-02 -1.17965801e-01 7.61127847e-02 -1.70036430e-01 -1.16569751e-02 -2.01904731e-02 -9.39695701e-02 -1.78426204e-01 6.28329901e-02 -6.28329901e-02 1.50606551e-01 -8.26569598e-02 8.26569598e-02 -1.74532412e-01 -2.62890636e-02 -1.64031264e-02 4.25165420e-02 -4.55339938e-02 -4.25165420e-02 3.67034157e-05 6.27522019e-03 -2.43070715e-03 1.16569751e-02 -1.04593642e-03 -1.68023178e-03 1.95007672e-03 2.00105569e-02 -6.06202249e-03 3.07402353e-03 -9.22207060e-03 2.03553554e-02 -8.76302120e-03 2.62890636e-02 1.46476011e-03 2.40057426e-04 -7.20172278e-04 2.64406855e-03 1.98305141e-03 -7.58541506e-05 8.44407987e-04 8.66482532e-03 -3.72497331e-05 3.72497331e-05 -5.28711521e-03 -1.22512846e-03 1.22512846e-03 1.64031264e-02 2.40057426e-04 1.02914641e-04 -1.22324825e-03 4.15791659e-04 1.22324825e-03 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -2.53322396e-03 -2.59944760e-02 1.11749199e-04 -5.28711521e-03 1.41362236e-02 3.67538539e-03 1.64031264e-02 -4.25165420e-02 -7.20172278e-04 -1.22324825e-03 3.36490998e-03 -2.70562219e-03 -1.72541514e-03 6.35721809e-05 1.08690002e-02 -4.21010828e-03 2.01904731e-02 -1.68023178e-03 -2.98610096e-03 3.37763195e-03 3.46593013e-02 -7.04948694e-03 8.77460895e-03 -1.59730948e-02 2.18708352e-02 -2.85636725e-02 4.55339938e-02 2.64406855e-03 4.15791659e-04 -2.70562219e-03 4.51786749e-03 1.97649858e-03 -1.65705842e-04 1.71520858e-03 1.20534581e-03 2.53322396e-03 2.59944760e-02 -5.28711521e-03 1.11749199e-04 -1.41362236e-02 1.64031264e-02 3.67538539e-03 4.25165420e-02 1.98305141e-03 1.22324825e-03 -1.72541514e-03 1.97649858e-03 3.36490998e-03 6.09103871e-05 6.14453477e-04 5.91853803e-05 -5.91853803e-05 -2.95926902e-04 -2.01724529e-04 2.01724529e-04 1.00862265e-03 -4.78869050e-05 -6.91187938e-06 -3.45593969e-05 -8.29425526e-05 3.45593969e-05 2.50728998e-03 1.64011405e-02 -9.26310694e-03 2.59488230e-02 3.67034157e-05 6.35721809e-05 6.14453477e-04 6.16334179e-03 5.89280869e-04 -5.89280869e-04 -2.94640435e-03 -2.00665301e-03 2.00665301e-03 1.00332651e-02 -4.47447198e-04 -6.45834401e-05 -3.22917201e-04 -7.75001281e-04 3.22917201e-04 1.64011405e-02 8.10100377e-02 -5.00423367e-02 1.17965801e-01 6.27522019e-03 1.08690002e-02 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 5.93986875e-05 2.96993437e-04 -5.79546830e-05 -2.01724907e-04 -1.00862453e-03 5.99184710e-05 -3.84006907e-06 -1.92003453e-05 8.23728840e-05 -3.43220350e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 5.91853803e-05 5.89280869e-04 5.93986875e-05 1.57901181e-05 -2.96993437e-04 -2.01724907e-04 -5.79546830e-05 1.00862453e-03 -4.13777746e-05 3.84006907e-06 -3.43220350e-05 -9.30773600e-05 -1.92003453e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 2.95926902e-04 2.94640435e-03 2.96993437e-04 -2.96993437e-04 -1.40977838e-03 -1.00862453e-03 1.00862453e-03 4.78344308e-03 -2.06888873e-04 -3.43220350e-05 -1.60905699e-04 -3.58342040e-04 1.60905699e-04 9.26310694e-03 5.00423367e-02 -3.02879243e-02 7.61127847e-02 2.43070715e-03 4.21010828e-03 2.01724529e-04 2.00665301e-03 -5.79546830e-05 -2.01724907e-04 -1.00862453e-03 2.12351688e-04 6.85394441e-04 3.42697221e-03 -2.00592339e-04 1.40996735e-05 7.04983673e-05 -2.73631522e-04 1.14013134e-04 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -2.01724529e-04 -2.00665301e-03 -2.01724907e-04 -5.79546830e-05 1.00862453e-03 6.85394441e-04 2.12351688e-04 -3.42697221e-03 1.36675680e-04 -1.40996735e-05 1.14013134e-04 3.10533823e-04 7.04983673e-05 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -1.00862265e-03 -1.00332651e-02 -1.00862453e-03 1.00862453e-03 4.78344308e-03 3.42697221e-03 -3.42697221e-03 -1.62371149e-02 6.83378401e-04 1.14013134e-04 5.33163371e-04 1.18364611e-03 -5.33163371e-04 -2.59488230e-02 -1.17965801e-01 7.61127847e-02 -1.70036430e-01 -1.16569751e-02 -2.01904731e-02 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 4.13777746e-05 2.06888873e-04 2.00592339e-04 -1.36675680e-04 -6.83378401e-04 1.53794146e-05 4.67548763e-06 2.33774382e-05 2.78902609e-05 -1.16209420e-05 3.67034157e-05 6.27522019e-03 -2.43070715e-03 1.16569751e-02 -1.04593642e-03 -1.68023178e-03 -6.91187938e-06 -6.45834401e-05 3.84006907e-06 -3.84006907e-06 3.43220350e-05 -1.40996735e-05 1.40996735e-05 -1.14013134e-04 4.67548763e-06 -1.61313514e-07 -3.97900833e-06 8.09818213e-06 3.97900833e-06 -7.58541506e-05 -3.45593969e-05 -3.22917201e-04 1.92003453e-05 3.43220350e-05 1.60905699e-04 -7.04983673e-05 -1.14013134e-04 -5.33163371e-04 2.33774382e-05 -3.97900833e-06 -1.92605535e-05 2.69156783e-05 -1.26855161e-05 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -8.29425526e-05 -7.75001281e-04 -8.23728840e-05 9.30773600e-05 3.58342040e-04 2.73631522e-04 -3.10533823e-04 -1.18364611e-03 2.78902609e-05 8.09818213e-06 2.69156783e-05 4.75843139e-05 -3.37032945e-05 6.35721809e-05 1.08690002e-02 -4.21010828e-03 2.01904731e-02 -1.68023178e-03 -2.98610096e-03 3.45593969e-05 3.22917201e-04 3.43220350e-05 1.92003453e-05 -1.60905699e-04 -1.14013134e-04 -7.04983673e-05 5.33163371e-04 -1.16209420e-05 3.97900833e-06 -1.26855161e-05 -3.37032945e-05 -1.92605535e-05 -1.65705842e-04 1.71520858e-03 1.20534581e-03 - 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 9 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 22 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 25 - 0 19 38 54 70 89 105 121 140 159 173 189 208 224 243 262 278 294 313 329 345 364 383 397 413 432 448 --1 1 0 520 - 3.91348915e-02 1.43320629e-01 -7.02734648e-02 -7.02734648e-02 1.48982977e-01 1.48982977e-01 -6.10770759e-03 -2.11577197e-02 1.05788599e-02 1.40271766e-02 6.79314330e-02 -3.83997120e-02 1.27999040e-02 -1.27999040e-02 9.39695701e-02 -3.13231900e-02 3.13231900e-02 -3.90015343e-03 2.53322396e-03 -2.53322396e-03 8.44407987e-04 1.43320629e-01 2.06957410e-01 -1.43523909e-01 -1.43523909e-01 1.50473058e-01 1.50473058e-01 -1.38680201e-02 -4.80402309e-02 2.40201155e-02 6.79314330e-02 1.60907873e-01 -1.22953680e-01 4.09845600e-02 -4.09845600e-02 1.78426204e-01 -5.94754012e-02 5.94754012e-02 -4.00211138e-02 2.59944760e-02 -2.59944760e-02 8.66482532e-03 7.02734648e-02 1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 6.79089450e-04 -4.18480142e-02 2.82907486e-02 3.83997120e-02 1.22953680e-01 -8.01243800e-02 3.21974808e-02 -3.21974808e-02 1.50606551e-01 -6.28329901e-02 6.28329901e-02 -1.84441412e-02 1.41362236e-02 -1.41362236e-02 5.28711521e-03 4.35912107e-02 -8.47000309e-02 1.47334830e-02 1.47334830e-02 -1.27999040e-02 -4.09845600e-02 3.21974808e-02 5.73556868e-03 1.07324936e-02 -6.28329901e-02 -1.69480895e-02 -2.09443300e-02 9.13604602e-03 -1.11749199e-04 5.28711521e-03 -1.72512200e-03 -3.72497331e-05 7.02734648e-02 1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 -2.48400517e-02 -4.18480142e-02 1.35572656e-02 1.27999040e-02 4.09845600e-02 -3.21974808e-02 1.07324936e-02 5.73556868e-03 6.28329901e-02 -2.09443300e-02 -1.69480895e-02 -9.13604602e-03 5.28711521e-03 -1.11749199e-04 -1.72512200e-03 3.72497331e-05 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 -1.91463231e-02 4.52539972e-02 -4.12234663e-02 -9.39695701e-02 -1.78426204e-01 1.50606551e-01 -6.28329901e-02 6.28329901e-02 -1.74532412e-01 8.26569598e-02 -8.26569598e-02 5.25781272e-02 -4.25165420e-02 4.25165420e-02 -1.64031264e-02 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 -3.71929353e-02 3.13231900e-02 5.94754012e-02 -6.28329901e-02 -1.69480895e-02 -2.09443300e-02 8.26569598e-02 4.58861475e-02 2.75523199e-02 -2.91183766e-02 -3.67538539e-03 -1.64031264e-02 6.69283727e-03 -1.22512846e-03 -1.48982977e-01 -1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 4.52737305e-02 4.52539972e-02 -4.03053096e-03 -3.13231900e-02 -5.94754012e-02 6.28329901e-02 -2.09443300e-02 -1.69480895e-02 -8.26569598e-02 2.75523199e-02 4.58861475e-02 2.91183766e-02 -1.64031264e-02 -3.67538539e-03 6.69283727e-03 1.22512846e-03 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 2.48400517e-02 1.91463231e-02 -4.52737305e-02 -7.67653617e-03 1.41589240e-02 -1.39049485e-02 -3.90015343e-03 -4.00211138e-02 1.84441412e-02 -9.13604602e-03 9.13604602e-03 -5.25781272e-02 2.91183766e-02 -2.91183766e-02 6.04442117e-03 -2.70322369e-03 2.70322369e-03 -4.80114852e-04 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 -7.88139292e-03 2.53322396e-03 2.59944760e-02 -1.41362236e-02 1.11749199e-04 -5.28711521e-03 4.25165420e-02 3.67538539e-03 1.64031264e-02 -2.70322369e-03 3.36490998e-03 -1.72541514e-03 -7.29123606e-04 1.22324825e-03 -2.11577197e-02 -4.80402309e-02 4.18480142e-02 4.18480142e-02 -4.52539972e-02 -4.52539972e-02 1.41589240e-02 4.91061754e-02 -2.45239757e-02 -2.53322396e-03 -2.59944760e-02 1.41362236e-02 -5.28711521e-03 1.11749199e-04 -4.25165420e-02 1.64031264e-02 3.67538539e-03 2.70322369e-03 -1.72541514e-03 3.36490998e-03 -7.29123606e-04 -1.22324825e-03 1.05788599e-02 2.40201155e-02 -2.82907486e-02 -1.35572656e-02 4.12234663e-02 4.03053096e-03 -1.39049485e-02 -2.45239757e-02 8.37951533e-03 1.72512200e-03 1.72512200e-03 -6.69283727e-03 -6.69283727e-03 -7.29123606e-04 -7.29123606e-04 -6.17935738e-05 -1.47334830e-02 3.71929353e-02 -7.88139292e-03 -7.82316899e-03 8.44407987e-04 8.66482532e-03 -5.28711521e-03 3.72497331e-05 -3.72497331e-05 1.64031264e-02 1.22512846e-03 -1.22512846e-03 -4.80114852e-04 1.22324825e-03 -1.22324825e-03 1.02914641e-04 1.40271766e-02 6.79314330e-02 -1.27999040e-02 -1.27999040e-02 -3.83997120e-02 3.13231900e-02 3.13231900e-02 9.39695701e-02 1.95007672e-03 -8.44407987e-04 -2.53322396e-03 3.37763195e-03 -2.53322396e-03 3.91348915e-02 1.43320629e-01 -7.02734648e-02 -7.02734648e-02 1.48982977e-01 1.48982977e-01 -6.10770759e-03 -2.11577197e-02 1.05788599e-02 6.79314330e-02 1.60907873e-01 -4.09845600e-02 -4.09845600e-02 -1.22953680e-01 5.94754012e-02 5.94754012e-02 1.78426204e-01 2.00105569e-02 -8.66482532e-03 -2.59944760e-02 3.46593013e-02 -2.59944760e-02 1.43320629e-01 2.06957410e-01 -1.43523909e-01 -1.43523909e-01 1.50473058e-01 1.50473058e-01 -1.38680201e-02 -4.80402309e-02 2.40201155e-02 1.27999040e-02 4.09845600e-02 5.73556868e-03 -1.07324936e-02 -3.21974808e-02 -1.69480895e-02 2.09443300e-02 6.28329901e-02 6.06202249e-03 -3.72497331e-05 -1.11749199e-04 7.04948694e-03 -5.28711521e-03 7.02734648e-02 1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 6.79089450e-04 -4.18480142e-02 2.82907486e-02 1.27999040e-02 4.09845600e-02 -1.07324936e-02 5.73556868e-03 -3.21974808e-02 2.09443300e-02 -1.69480895e-02 6.28329901e-02 3.07402353e-03 -3.72497331e-05 -5.28711521e-03 8.77460895e-03 -1.11749199e-04 4.35912107e-02 -8.47000309e-02 1.47334830e-02 1.47334830e-02 3.83997120e-02 1.22953680e-01 -3.21974808e-02 -3.21974808e-02 -8.01243800e-02 6.28329901e-02 6.28329901e-02 1.50606551e-01 9.22207060e-03 -5.28711521e-03 -1.41362236e-02 1.59730948e-02 -1.41362236e-02 7.02734648e-02 1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 -2.48400517e-02 -4.18480142e-02 1.35572656e-02 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 2.09443300e-02 6.28329901e-02 4.58861475e-02 -2.75523199e-02 -8.26569598e-02 -2.03553554e-02 -1.22512846e-03 -3.67538539e-03 -2.18708352e-02 1.64031264e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 -1.91463231e-02 4.52539972e-02 -4.12234663e-02 -3.13231900e-02 -5.94754012e-02 2.09443300e-02 -1.69480895e-02 6.28329901e-02 -2.75523199e-02 4.58861475e-02 -8.26569598e-02 -8.76302120e-03 -1.22512846e-03 1.64031264e-02 -2.85636725e-02 -3.67538539e-03 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 -3.71929353e-02 -9.39695701e-02 -1.78426204e-01 6.28329901e-02 6.28329901e-02 1.50606551e-01 -8.26569598e-02 -8.26569598e-02 -1.74532412e-01 -2.62890636e-02 1.64031264e-02 4.25165420e-02 -4.55339938e-02 4.25165420e-02 -1.48982977e-01 -1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 4.52737305e-02 4.52539972e-02 -4.03053096e-03 1.95007672e-03 2.00105569e-02 -6.06202249e-03 -3.07402353e-03 -9.22207060e-03 2.03553554e-02 8.76302120e-03 2.62890636e-02 1.46476011e-03 -2.40057426e-04 -7.20172278e-04 2.64406855e-03 -1.98305141e-03 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 2.48400517e-02 1.91463231e-02 -4.52737305e-02 -7.67653617e-03 1.41589240e-02 -1.39049485e-02 -8.44407987e-04 -8.66482532e-03 3.72497331e-05 3.72497331e-05 5.28711521e-03 1.22512846e-03 1.22512846e-03 -1.64031264e-02 -2.40057426e-04 1.02914641e-04 1.22324825e-03 -4.15791659e-04 1.22324825e-03 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -2.53322396e-03 -2.59944760e-02 1.11749199e-04 5.28711521e-03 1.41362236e-02 3.67538539e-03 -1.64031264e-02 -4.25165420e-02 -7.20172278e-04 1.22324825e-03 3.36490998e-03 -2.70562219e-03 1.72541514e-03 -2.11577197e-02 -4.80402309e-02 4.18480142e-02 4.18480142e-02 -4.52539972e-02 -4.52539972e-02 1.41589240e-02 4.91061754e-02 -2.45239757e-02 3.37763195e-03 3.46593013e-02 -7.04948694e-03 -8.77460895e-03 -1.59730948e-02 2.18708352e-02 2.85636725e-02 4.55339938e-02 2.64406855e-03 -4.15791659e-04 -2.70562219e-03 4.51786749e-03 -1.97649858e-03 1.05788599e-02 2.40201155e-02 -2.82907486e-02 -1.35572656e-02 4.12234663e-02 4.03053096e-03 -1.39049485e-02 -2.45239757e-02 8.37951533e-03 -2.53322396e-03 -2.59944760e-02 5.28711521e-03 1.11749199e-04 1.41362236e-02 -1.64031264e-02 3.67538539e-03 -4.25165420e-02 -1.98305141e-03 1.22324825e-03 1.72541514e-03 -1.97649858e-03 3.36490998e-03 -1.47334830e-02 3.71929353e-02 -7.88139292e-03 -7.82316899e-03 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 16 17 19 20 22 23 24 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 - 0 21 42 63 80 102 123 140 162 183 200 222 238 254 276 298 320 337 359 381 398 420 442 459 481 503 520 --1 1 1 404 - 2.50728998e-03 1.64011405e-02 -9.26310694e-03 2.59488230e-02 -7.34068315e-05 6.09103871e-05 6.14453477e-04 -2.95926902e-04 5.91853803e-05 5.91853803e-05 1.00862265e-03 -2.01724529e-04 -2.01724529e-04 9.57738101e-05 -3.45593969e-05 -3.45593969e-05 6.91187938e-06 1.64011405e-02 8.10100377e-02 -5.00423367e-02 1.17965801e-01 -1.25504404e-02 6.14453477e-04 6.16334179e-03 -2.94640435e-03 5.89280869e-04 5.89280869e-04 1.00332651e-02 -2.00665301e-03 -2.00665301e-03 8.94894397e-04 -3.22917201e-04 -3.22917201e-04 6.45834401e-05 9.26310694e-03 5.00423367e-02 -3.02879243e-02 7.61127847e-02 -4.86141429e-03 2.95926902e-04 2.94640435e-03 -1.40977838e-03 2.96993437e-04 2.96993437e-04 4.78344308e-03 -1.00862453e-03 -1.00862453e-03 4.13777746e-04 -1.60905699e-04 -1.60905699e-04 3.43220350e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 -5.91853803e-05 -5.89280869e-04 2.96993437e-04 1.57901181e-05 -5.93986875e-05 -1.00862453e-03 -5.79546830e-05 2.01724907e-04 -1.01296246e-04 -1.92003453e-05 3.43220350e-05 1.07044761e-05 3.84006907e-06 3.22869392e-03 -9.11832090e-03 1.65705842e-04 -5.91853803e-05 -5.89280869e-04 2.96993437e-04 -5.93986875e-05 1.57901181e-05 -1.00862453e-03 2.01724907e-04 -5.79546830e-05 -1.01296246e-04 3.43220350e-05 -1.92003453e-05 -1.07044761e-05 3.84006907e-06 -2.59488230e-02 -1.17965801e-01 7.61127847e-02 -1.70036430e-01 2.33139502e-02 -1.00862265e-03 -1.00332651e-02 4.78344308e-03 -1.00862453e-03 -1.00862453e-03 -1.62371149e-02 3.42697221e-03 3.42697221e-03 -1.36675680e-03 5.33163371e-04 5.33163371e-04 -1.14013134e-04 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 2.01724529e-04 2.00665301e-03 -1.00862453e-03 -5.79546830e-05 2.01724907e-04 3.42697221e-03 2.12351688e-04 -6.85394441e-04 3.37268019e-04 7.04983673e-05 -1.14013134e-04 -3.69023003e-05 -1.40996735e-05 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 2.01724529e-04 2.00665301e-03 -1.00862453e-03 2.01724907e-04 -5.79546830e-05 3.42697221e-03 -6.85394441e-04 2.12351688e-04 3.37268019e-04 -1.14013134e-04 7.04983673e-05 3.69023003e-05 -1.40996735e-05 -7.34068315e-05 -1.25504404e-02 4.86141429e-03 -2.33139502e-02 -3.95618323e-03 9.57738101e-05 8.94894397e-04 -4.13777746e-04 1.01296246e-04 1.01296246e-04 1.36675680e-03 -3.37268019e-04 -3.37268019e-04 6.36867635e-05 -3.49983802e-05 -3.49983802e-05 9.35097527e-06 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -3.45593969e-05 -3.22917201e-04 1.60905699e-04 1.92003453e-05 -3.43220350e-05 -5.33163371e-04 -7.04983673e-05 1.14013134e-04 -3.49983802e-05 -1.92605535e-05 1.26855161e-05 6.78761620e-06 3.97900833e-06 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -3.45593969e-05 -3.22917201e-04 1.60905699e-04 -3.43220350e-05 1.92003453e-05 -5.33163371e-04 1.14013134e-04 -7.04983673e-05 -3.49983802e-05 1.26855161e-05 -1.92605535e-05 -6.78761620e-06 3.97900833e-06 -7.58541506e-05 -1.07044761e-05 1.07044761e-05 3.69023003e-05 -3.69023003e-05 6.78761620e-06 -6.78761620e-06 -7.23035088e-07 -7.58541506e-05 6.91187938e-06 6.45834401e-05 -3.43220350e-05 -3.84006907e-06 -3.84006907e-06 1.14013134e-04 1.40996735e-05 1.40996735e-05 9.35097527e-06 3.97900833e-06 3.97900833e-06 -1.61313514e-07 1.40271766e-02 6.79314330e-02 -3.83997120e-02 -1.27999040e-02 -1.27999040e-02 9.39695701e-02 3.13231900e-02 3.13231900e-02 -3.90015343e-03 -2.53322396e-03 -2.53322396e-03 -8.44407987e-04 2.50728998e-03 1.64011405e-02 -9.26310694e-03 2.59488230e-02 -7.34068315e-05 6.79314330e-02 1.60907873e-01 -1.22953680e-01 -4.09845600e-02 -4.09845600e-02 1.78426204e-01 5.94754012e-02 5.94754012e-02 -4.00211138e-02 -2.59944760e-02 -2.59944760e-02 -8.66482532e-03 1.64011405e-02 8.10100377e-02 -5.00423367e-02 1.17965801e-01 -1.25504404e-02 3.83997120e-02 1.22953680e-01 -8.01243800e-02 -3.21974808e-02 -3.21974808e-02 1.50606551e-01 6.28329901e-02 6.28329901e-02 -1.84441412e-02 -1.41362236e-02 -1.41362236e-02 -5.28711521e-03 9.26310694e-03 5.00423367e-02 -3.02879243e-02 7.61127847e-02 -4.86141429e-03 1.27999040e-02 4.09845600e-02 -3.21974808e-02 5.73556868e-03 -1.07324936e-02 6.28329901e-02 -1.69480895e-02 2.09443300e-02 -9.13604602e-03 -1.11749199e-04 -5.28711521e-03 1.72512200e-03 -3.72497331e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 1.27999040e-02 4.09845600e-02 -3.21974808e-02 -1.07324936e-02 5.73556868e-03 6.28329901e-02 2.09443300e-02 -1.69480895e-02 -9.13604602e-03 -5.28711521e-03 -1.11749199e-04 -1.72512200e-03 -3.72497331e-05 3.22869392e-03 -9.11832090e-03 1.65705842e-04 -9.39695701e-02 -1.78426204e-01 1.50606551e-01 6.28329901e-02 6.28329901e-02 -1.74532412e-01 -8.26569598e-02 -8.26569598e-02 5.25781272e-02 4.25165420e-02 4.25165420e-02 1.64031264e-02 -2.59488230e-02 -1.17965801e-01 7.61127847e-02 -1.70036430e-01 2.33139502e-02 -3.13231900e-02 -5.94754012e-02 6.28329901e-02 -1.69480895e-02 2.09443300e-02 -8.26569598e-02 4.58861475e-02 -2.75523199e-02 2.91183766e-02 -3.67538539e-03 1.64031264e-02 -6.69283727e-03 -1.22512846e-03 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -3.13231900e-02 -5.94754012e-02 6.28329901e-02 2.09443300e-02 -1.69480895e-02 -8.26569598e-02 -2.75523199e-02 4.58861475e-02 2.91183766e-02 1.64031264e-02 -3.67538539e-03 6.69283727e-03 -1.22512846e-03 -9.11832090e-03 2.46761309e-02 -1.71520858e-03 -3.90015343e-03 -4.00211138e-02 1.84441412e-02 9.13604602e-03 9.13604602e-03 -5.25781272e-02 -2.91183766e-02 -2.91183766e-02 6.04442117e-03 2.70322369e-03 2.70322369e-03 4.80114852e-04 -7.34068315e-05 -1.25504404e-02 4.86141429e-03 -2.33139502e-02 -3.95618323e-03 -2.53322396e-03 -2.59944760e-02 1.41362236e-02 1.11749199e-04 5.28711521e-03 -4.25165420e-02 3.67538539e-03 -1.64031264e-02 2.70322369e-03 3.36490998e-03 1.72541514e-03 7.29123606e-04 1.22324825e-03 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -2.53322396e-03 -2.59944760e-02 1.41362236e-02 5.28711521e-03 1.11749199e-04 -4.25165420e-02 -1.64031264e-02 3.67538539e-03 2.70322369e-03 1.72541514e-03 3.36490998e-03 -7.29123606e-04 1.22324825e-03 -1.65705842e-04 1.71520858e-03 1.20534581e-03 -1.72512200e-03 1.72512200e-03 6.69283727e-03 -6.69283727e-03 7.29123606e-04 -7.29123606e-04 -6.17935738e-05 -7.58541506e-05 -8.44407987e-04 -8.66482532e-03 5.28711521e-03 3.72497331e-05 3.72497331e-05 -1.64031264e-02 1.22512846e-03 1.22512846e-03 4.80114852e-04 1.22324825e-03 1.22324825e-03 1.02914641e-04 -7.58541506e-05 - 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 13 14 15 16 17 18 19 20 21 22 23 24 25 11 16 17 19 20 22 23 24 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 3 4 6 7 9 10 11 24 0 1 2 3 4 5 6 7 8 9 10 12 25 - 0 17 34 51 67 83 100 116 132 149 165 181 189 202 219 236 253 269 285 302 318 334 351 367 383 391 404 --1 1 2 157 - 6.09103871e-05 6.14453477e-04 -2.95926902e-04 -5.91853803e-05 5.91853803e-05 1.00862265e-03 2.01724529e-04 -2.01724529e-04 9.57738101e-05 3.45593969e-05 -3.45593969e-05 -6.91187938e-06 6.14453477e-04 6.16334179e-03 -2.94640435e-03 -5.89280869e-04 5.89280869e-04 1.00332651e-02 2.00665301e-03 -2.00665301e-03 8.94894397e-04 3.22917201e-04 -3.22917201e-04 -6.45834401e-05 2.95926902e-04 2.94640435e-03 -1.40977838e-03 -2.96993437e-04 2.96993437e-04 4.78344308e-03 1.00862453e-03 -1.00862453e-03 4.13777746e-04 1.60905699e-04 -1.60905699e-04 -3.43220350e-05 5.91853803e-05 5.89280869e-04 -2.96993437e-04 1.57901181e-05 5.93986875e-05 1.00862453e-03 -5.79546830e-05 -2.01724907e-04 1.01296246e-04 -1.92003453e-05 -3.43220350e-05 -1.07044761e-05 3.84006907e-06 -5.91853803e-05 -5.89280869e-04 2.96993437e-04 5.93986875e-05 1.57901181e-05 -1.00862453e-03 -2.01724907e-04 -5.79546830e-05 -1.01296246e-04 -3.43220350e-05 -1.92003453e-05 -1.07044761e-05 -3.84006907e-06 -1.00862265e-03 -1.00332651e-02 4.78344308e-03 1.00862453e-03 -1.00862453e-03 -1.62371149e-02 -3.42697221e-03 3.42697221e-03 -1.36675680e-03 -5.33163371e-04 5.33163371e-04 1.14013134e-04 -2.01724529e-04 -2.00665301e-03 1.00862453e-03 -5.79546830e-05 -2.01724907e-04 -3.42697221e-03 2.12351688e-04 6.85394441e-04 -3.37268019e-04 7.04983673e-05 1.14013134e-04 3.69023003e-05 -1.40996735e-05 2.01724529e-04 2.00665301e-03 -1.00862453e-03 -2.01724907e-04 -5.79546830e-05 3.42697221e-03 6.85394441e-04 2.12351688e-04 3.37268019e-04 1.14013134e-04 7.04983673e-05 3.69023003e-05 1.40996735e-05 9.57738101e-05 8.94894397e-04 -4.13777746e-04 -1.01296246e-04 1.01296246e-04 1.36675680e-03 3.37268019e-04 -3.37268019e-04 6.36867635e-05 3.49983802e-05 -3.49983802e-05 -9.35097527e-06 3.45593969e-05 3.22917201e-04 -1.60905699e-04 1.92003453e-05 3.43220350e-05 5.33163371e-04 -7.04983673e-05 -1.14013134e-04 3.49983802e-05 -1.92605535e-05 -1.26855161e-05 -6.78761620e-06 3.97900833e-06 -3.45593969e-05 -3.22917201e-04 1.60905699e-04 3.43220350e-05 1.92003453e-05 -5.33163371e-04 -1.14013134e-04 -7.04983673e-05 -3.49983802e-05 -1.26855161e-05 -1.92605535e-05 -6.78761620e-06 -3.97900833e-06 1.07044761e-05 1.07044761e-05 -3.69023003e-05 -3.69023003e-05 -6.78761620e-06 -6.78761620e-06 -7.23035088e-07 -6.91187938e-06 -6.45834401e-05 3.43220350e-05 -3.84006907e-06 3.84006907e-06 -1.14013134e-04 1.40996735e-05 -1.40996735e-05 -9.35097527e-06 3.97900833e-06 -3.97900833e-06 -1.61313514e-07 - 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 3 4 6 7 9 10 11 0 1 2 3 4 5 6 7 8 9 10 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 24 36 49 62 74 87 100 112 125 138 145 157 --1 2 -2 169 - 1.25466617e-06 1.34349826e-05 -1.31792447e-06 3.95377341e-06 -6.58962236e-06 4.39772254e-06 -1.31931676e-05 2.19886127e-05 -2.43510507e-06 -7.90823570e-07 1.31803928e-06 -2.10886285e-06 -3.95411785e-06 1.34349826e-05 1.43209127e-04 -1.42696266e-05 4.28088798e-05 -7.13481329e-05 4.75690104e-05 -1.42707031e-04 2.37845052e-04 -2.56801146e-05 -8.33986187e-06 1.38997698e-05 -2.22396317e-05 -4.16993094e-05 1.31792447e-06 1.42696266e-05 -7.59910514e-07 4.22604181e-06 -7.04340302e-06 2.62355898e-06 -1.41871954e-05 2.36453257e-05 -2.82105641e-06 -4.89269790e-07 8.15449649e-07 -2.31661906e-06 -4.34366074e-06 -3.95377341e-06 -4.28088798e-05 4.22604181e-06 -1.20293553e-05 2.11302091e-05 -1.41871954e-05 4.04560801e-05 -7.09359772e-05 7.80592115e-06 2.47970899e-06 -4.34366074e-06 7.32931955e-06 1.23985450e-05 6.58962236e-06 7.13481329e-05 -7.04340302e-06 2.11302091e-05 -3.45682450e-05 2.36453257e-05 -7.09359772e-05 1.16121122e-04 -1.30098686e-05 -4.34366074e-06 7.11294712e-06 -1.09506581e-05 -2.13388414e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 -1.41871954e-05 2.36453257e-05 -9.01114524e-06 4.74618663e-05 -7.91031105e-05 9.57494961e-06 1.73409032e-06 -2.89015053e-06 7.88460418e-06 1.47836328e-05 1.31931676e-05 1.42707031e-04 -1.41871954e-05 4.04560801e-05 -7.09359772e-05 4.74618663e-05 -1.35576122e-04 2.37309331e-04 -2.66071807e-05 -8.46263429e-06 1.47836328e-05 -2.48764488e-05 -4.23131714e-05 -2.19886127e-05 -2.37845052e-04 2.36453257e-05 -7.09359772e-05 1.16121122e-04 -7.91031105e-05 2.37309331e-04 -3.88706075e-04 4.43453012e-05 1.47836328e-05 -2.42318426e-05 3.73852938e-05 7.26955279e-05 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 -7.80592115e-06 1.30098686e-05 -9.57494961e-06 2.66071807e-05 -4.43453012e-05 3.61548803e-06 1.19878524e-06 -1.99797541e-06 3.12952049e-06 5.86785091e-06 -7.90823570e-07 -8.33986187e-06 4.89269790e-07 -2.47970899e-06 4.34366074e-06 -1.73409032e-06 8.46263429e-06 -1.47836328e-05 1.19878524e-06 3.49595231e-07 -5.71522584e-07 1.04545744e-06 1.90867338e-06 1.31803928e-06 1.38997698e-05 -8.15449649e-07 4.34366074e-06 -7.11294712e-06 2.89015053e-06 -1.47836328e-05 2.42318426e-05 -1.99797541e-06 -5.71522584e-07 9.59219321e-07 -1.69390265e-06 -3.20700306e-06 -2.10886285e-06 -2.22396317e-05 2.31661906e-06 -7.32931955e-06 1.09506581e-05 -7.88460418e-06 2.48764488e-05 -3.73852938e-05 3.12952049e-06 1.04545744e-06 -1.69390265e-06 2.59560990e-06 5.15449757e-06 -3.95411785e-06 -4.16993094e-05 4.34366074e-06 -1.23985450e-05 2.13388414e-05 -1.47836328e-05 4.23131714e-05 -7.26955279e-05 5.86785091e-06 1.90867338e-06 -3.20700306e-06 5.15449757e-06 9.51122747e-06 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 --1 2 -1 660 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 3.25689024e-04 -6.51378048e-04 1.06639054e-03 -1.06639054e-03 2.13278108e-03 -4.52806801e-05 -5.22856257e-05 1.04571251e-04 -7.84284385e-05 -1.04571251e-04 6.09103871e-05 6.14453477e-04 -1.77556141e-04 1.77556141e-04 -1.77556141e-04 6.05173587e-04 -6.05173587e-04 6.05173587e-04 -6.22069144e-05 6.22069144e-05 -6.22069144e-05 1.56710856e-03 1.39613919e-02 -2.89608434e-03 2.89608434e-03 -5.79216869e-03 9.35225951e-03 -9.35225951e-03 1.87045190e-02 -2.85376584e-04 -3.29524496e-04 6.59048991e-04 -4.94286743e-04 -6.59048991e-04 6.14453477e-04 6.16334179e-03 -1.76784261e-03 1.76784261e-03 -1.76784261e-03 6.01995904e-03 -6.01995904e-03 6.01995904e-03 -5.81250961e-04 5.81250961e-04 -5.81250961e-04 3.25689024e-04 2.89608434e-03 -4.14019247e-04 6.42637659e-04 -1.28527532e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 -1.33367462e-04 -4.04340602e-05 8.08681204e-05 -1.33657432e-04 -1.78209909e-04 1.77556141e-04 1.76784261e-03 -4.59399382e-04 5.34588187e-04 -5.34588187e-04 1.55584457e-03 -1.81552416e-03 1.81552416e-03 -3.70813928e-05 -1.53225561e-04 1.53225561e-04 -1.85338989e-04 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 -4.14019247e-04 1.28527532e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 4.90670003e-05 4.04340602e-05 -1.78209909e-04 1.82328327e-04 8.08681204e-05 -1.77556141e-04 -1.76784261e-03 5.34588187e-04 -4.59399382e-04 5.34588187e-04 -1.81552416e-03 1.55584457e-03 -1.81552416e-03 -1.85406964e-05 1.53225561e-04 -1.85338989e-04 3.21134282e-05 1.53225561e-04 6.51378048e-04 5.79216869e-03 -1.28527532e-03 1.28527532e-03 -2.34193222e-03 4.15611128e-03 -4.15611128e-03 7.54522870e-03 -9.81340007e-05 -1.78209909e-04 3.07748924e-04 -1.69973075e-04 -3.07748924e-04 1.77556141e-04 1.76784261e-03 -5.34588187e-04 5.34588187e-04 -4.59399382e-04 1.81552416e-03 -1.81552416e-03 1.55584457e-03 1.85406964e-05 -1.85338989e-04 1.53225561e-04 3.21134282e-05 -1.53225561e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 -4.10981523e-03 6.68105894e-03 -1.33621179e-02 3.95156129e-04 8.87082588e-05 -1.77416518e-04 3.69363005e-04 4.92484006e-04 -6.05173587e-04 -6.01995904e-03 1.55584457e-03 -1.81552416e-03 1.81552416e-03 -5.27080384e-03 6.16854997e-03 -6.16854997e-03 1.27833318e-04 5.04964025e-04 -5.04964025e-04 6.15670926e-04 1.06639054e-03 9.35225951e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 6.68105894e-03 -4.10981523e-03 1.33621179e-02 -1.22299680e-04 -8.87082588e-05 4.92484006e-04 -5.26896749e-04 -1.77416518e-04 6.05173587e-04 6.01995904e-03 -1.81552416e-03 1.55584457e-03 -1.81552416e-03 6.16854997e-03 -5.27080384e-03 6.16854997e-03 6.39166591e-05 -5.04964025e-04 6.15670926e-04 -1.10706901e-04 -5.04964025e-04 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 -4.15611128e-03 7.54522870e-03 -1.33621179e-02 1.33621179e-02 -2.41529920e-02 2.44599361e-04 4.92484006e-04 -8.27434268e-04 4.23658521e-04 8.27434268e-04 -6.05173587e-04 -6.01995904e-03 1.81552416e-03 -1.81552416e-03 1.55584457e-03 -6.16854997e-03 6.16854997e-03 -5.27080384e-03 -6.39166591e-05 6.15670926e-04 -5.04964025e-04 -1.10706901e-04 5.04964025e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -4.90670003e-05 9.81340007e-05 -3.95156129e-04 1.22299680e-04 -2.44599361e-04 -2.59797738e-05 -1.69297603e-05 3.38595206e-05 -3.69220468e-05 -4.92293958e-05 3.70813928e-05 1.85406964e-05 -1.85406964e-05 -1.27833318e-04 -6.39166591e-05 6.39166591e-05 -2.24434069e-05 7.05389767e-06 -7.05389767e-06 -1.41077953e-05 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 -4.04340602e-05 1.78209909e-04 -8.87082588e-05 8.87082588e-05 -4.92484006e-04 -1.69297603e-05 -2.71695573e-05 5.38872760e-05 -2.93232050e-05 -5.38872760e-05 -6.22069144e-05 -5.81250961e-04 1.53225561e-04 -1.53225561e-04 1.85338989e-04 -5.04964025e-04 5.04964025e-04 -6.15670926e-04 7.05389767e-06 2.30560406e-05 -3.32817384e-05 1.22177092e-05 3.32817384e-05 1.04571251e-04 6.59048991e-04 -8.08681204e-05 1.78209909e-04 -3.07748924e-04 1.77416518e-04 -4.92484006e-04 8.27434268e-04 3.38595206e-05 5.38872760e-05 -1.08000471e-04 7.63940131e-05 9.44638495e-05 6.22069144e-05 5.81250961e-04 -1.53225561e-04 1.85338989e-04 -1.53225561e-04 5.04964025e-04 -6.15670926e-04 5.04964025e-04 -7.05389767e-06 -3.32817384e-05 2.30560406e-05 1.22177092e-05 -3.32817384e-05 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 -1.82328327e-04 1.69973075e-04 -3.69363005e-04 5.26896749e-04 -4.23658521e-04 -3.69220468e-05 -2.93232050e-05 7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -3.21134282e-05 -3.21134282e-05 1.10706901e-04 1.10706901e-04 1.22177092e-05 1.22177092e-05 -2.24434069e-05 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 -8.08681204e-05 3.07748924e-04 -4.92484006e-04 1.77416518e-04 -8.27434268e-04 -4.92293958e-05 -5.38872760e-05 9.44638495e-05 -6.75202116e-05 -1.08000471e-04 -6.22069144e-05 -5.81250961e-04 1.85338989e-04 -1.53225561e-04 1.53225561e-04 -6.15670926e-04 5.04964025e-04 -5.04964025e-04 -1.41077953e-05 3.32817384e-05 -3.32817384e-05 2.30560406e-05 6.09103871e-05 6.14453477e-04 -5.91853803e-05 5.91853803e-05 -2.95926902e-04 2.01724529e-04 -2.01724529e-04 1.00862265e-03 -4.78869050e-05 -6.91187938e-06 3.45593969e-05 -8.29425526e-05 -3.45593969e-05 1.70328256e-04 1.56710856e-03 -3.25689024e-04 3.25689024e-04 -6.51378048e-04 1.06639054e-03 -1.06639054e-03 2.13278108e-03 -4.52806801e-05 -5.22856257e-05 1.04571251e-04 -7.84284385e-05 -1.04571251e-04 6.14453477e-04 6.16334179e-03 -5.89280869e-04 5.89280869e-04 -2.94640435e-03 2.00665301e-03 -2.00665301e-03 1.00332651e-02 -4.47447198e-04 -6.45834401e-05 3.22917201e-04 -7.75001281e-04 -3.22917201e-04 1.56710856e-03 1.39613919e-02 -2.89608434e-03 2.89608434e-03 -5.79216869e-03 9.35225951e-03 -9.35225951e-03 1.87045190e-02 -2.85376584e-04 -3.29524496e-04 6.59048991e-04 -4.94286743e-04 -6.59048991e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 5.93986875e-05 -2.96993437e-04 -5.79546830e-05 -2.01724907e-04 1.00862453e-03 -5.99184710e-05 3.84006907e-06 -1.92003453e-05 -8.23728840e-05 -3.43220350e-05 3.25689024e-04 2.89608434e-03 -4.14019247e-04 6.42637659e-04 -1.28527532e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 -1.33367462e-04 -4.04340602e-05 8.08681204e-05 -1.33657432e-04 -1.78209909e-04 -5.91853803e-05 -5.89280869e-04 5.93986875e-05 1.57901181e-05 2.96993437e-04 -2.01724907e-04 -5.79546830e-05 -1.00862453e-03 4.13777746e-05 -3.84006907e-06 -3.43220350e-05 9.30773600e-05 -1.92003453e-05 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 -4.14019247e-04 1.28527532e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 4.90670003e-05 4.04340602e-05 -1.78209909e-04 1.82328327e-04 8.08681204e-05 2.95926902e-04 2.94640435e-03 -2.96993437e-04 2.96993437e-04 -1.40977838e-03 1.00862453e-03 -1.00862453e-03 4.78344308e-03 -2.06888873e-04 -3.43220350e-05 1.60905699e-04 -3.58342040e-04 -1.60905699e-04 6.51378048e-04 5.79216869e-03 -1.28527532e-03 1.28527532e-03 -2.34193222e-03 4.15611128e-03 -4.15611128e-03 7.54522870e-03 -9.81340007e-05 -1.78209909e-04 3.07748924e-04 -1.69973075e-04 -3.07748924e-04 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 -2.01724907e-04 1.00862453e-03 2.12351688e-04 6.85394441e-04 -3.42697221e-03 2.00592339e-04 -1.40996735e-05 7.04983673e-05 2.73631522e-04 1.14013134e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 -4.10981523e-03 6.68105894e-03 -1.33621179e-02 3.95156129e-04 8.87082588e-05 -1.77416518e-04 3.69363005e-04 4.92484006e-04 2.01724529e-04 2.00665301e-03 -2.01724907e-04 -5.79546830e-05 -1.00862453e-03 6.85394441e-04 2.12351688e-04 3.42697221e-03 -1.36675680e-04 1.40996735e-05 1.14013134e-04 -3.10533823e-04 7.04983673e-05 1.06639054e-03 9.35225951e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 6.68105894e-03 -4.10981523e-03 1.33621179e-02 -1.22299680e-04 -8.87082588e-05 4.92484006e-04 -5.26896749e-04 -1.77416518e-04 -1.00862265e-03 -1.00332651e-02 1.00862453e-03 -1.00862453e-03 4.78344308e-03 -3.42697221e-03 3.42697221e-03 -1.62371149e-02 6.83378401e-04 1.14013134e-04 -5.33163371e-04 1.18364611e-03 5.33163371e-04 -2.13278108e-03 -1.87045190e-02 4.15611128e-03 -4.15611128e-03 7.54522870e-03 -1.33621179e-02 1.33621179e-02 -2.41529920e-02 2.44599361e-04 4.92484006e-04 -8.27434268e-04 4.23658521e-04 8.27434268e-04 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 -4.13777746e-05 2.06888873e-04 -2.00592339e-04 1.36675680e-04 -6.83378401e-04 1.53794146e-05 4.67548763e-06 -2.33774382e-05 2.78902609e-05 1.16209420e-05 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -4.90670003e-05 9.81340007e-05 -3.95156129e-04 1.22299680e-04 -2.44599361e-04 -2.59797738e-05 -1.69297603e-05 3.38595206e-05 -3.69220468e-05 -4.92293958e-05 -6.91187938e-06 -6.45834401e-05 -3.84006907e-06 3.84006907e-06 3.43220350e-05 1.40996735e-05 -1.40996735e-05 -1.14013134e-04 4.67548763e-06 -1.61313514e-07 3.97900833e-06 8.09818213e-06 -3.97900833e-06 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 -4.04340602e-05 1.78209909e-04 -8.87082588e-05 8.87082588e-05 -4.92484006e-04 -1.69297603e-05 -2.71695573e-05 5.38872760e-05 -2.93232050e-05 -5.38872760e-05 3.45593969e-05 3.22917201e-04 1.92003453e-05 3.43220350e-05 -1.60905699e-04 -7.04983673e-05 -1.14013134e-04 5.33163371e-04 -2.33774382e-05 3.97900833e-06 -1.92605535e-05 -2.69156783e-05 -1.26855161e-05 1.04571251e-04 6.59048991e-04 -8.08681204e-05 1.78209909e-04 -3.07748924e-04 1.77416518e-04 -4.92484006e-04 8.27434268e-04 3.38595206e-05 5.38872760e-05 -1.08000471e-04 7.63940131e-05 9.44638495e-05 -8.29425526e-05 -7.75001281e-04 8.23728840e-05 -9.30773600e-05 3.58342040e-04 -2.73631522e-04 3.10533823e-04 -1.18364611e-03 2.78902609e-05 8.09818213e-06 -2.69156783e-05 4.75843139e-05 3.37032945e-05 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 -1.82328327e-04 1.69973075e-04 -3.69363005e-04 5.26896749e-04 -4.23658521e-04 -3.69220468e-05 -2.93232050e-05 7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -3.45593969e-05 -3.22917201e-04 3.43220350e-05 1.92003453e-05 1.60905699e-04 -1.14013134e-04 -7.04983673e-05 -5.33163371e-04 1.16209420e-05 -3.97900833e-06 -1.26855161e-05 3.37032945e-05 -1.92605535e-05 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 -8.08681204e-05 3.07748924e-04 -4.92484006e-04 1.77416518e-04 -8.27434268e-04 -4.92293958e-05 -5.38872760e-05 9.44638495e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 24 48 73 99 125 150 176 202 225 251 277 297 322 348 374 400 426 452 478 504 530 556 582 608 634 660 --1 2 0 652 - 1.70328256e-04 1.56710856e-03 -6.51378048e-04 3.25689024e-04 -3.25689024e-04 2.13278108e-03 -1.06639054e-03 1.06639054e-03 9.05613602e-05 -1.04571251e-04 1.04571251e-04 -5.22856257e-05 1.25466617e-06 1.34349826e-05 -6.58962236e-06 3.95377341e-06 -1.31792447e-06 2.19886127e-05 -1.31931676e-05 4.39772254e-06 3.04388134e-06 -3.95411785e-06 1.31803928e-06 1.05443143e-06 -7.90823570e-07 1.56710856e-03 1.39613919e-02 -5.79216869e-03 2.89608434e-03 -2.89608434e-03 1.87045190e-02 -9.35225951e-03 9.35225951e-03 5.70753169e-04 -6.59048991e-04 6.59048991e-04 -3.29524496e-04 1.34349826e-05 1.43209127e-04 -7.13481329e-05 4.28088798e-05 -1.42696266e-05 2.37845052e-04 -1.42707031e-04 4.75690104e-05 3.21001433e-05 -4.16993094e-05 1.38997698e-05 1.11198158e-05 -8.33986187e-06 6.51378048e-04 5.79216869e-03 -2.34193222e-03 1.28527532e-03 -1.28527532e-03 7.54522870e-03 -4.15611128e-03 4.15611128e-03 1.96268001e-04 -3.07748924e-04 3.07748924e-04 -1.78209909e-04 6.58962236e-06 7.13481329e-05 -3.45682450e-05 2.11302091e-05 -7.04340302e-06 1.16121122e-04 -7.09359772e-05 2.36453257e-05 1.59884824e-05 -2.13388414e-05 7.11294712e-06 5.79154766e-06 -4.34366074e-06 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 -4.14019247e-04 6.42637659e-04 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.82434463e-04 8.08681204e-05 -1.78209909e-04 4.86708945e-05 4.04340602e-05 -3.95377341e-06 -4.28088798e-05 2.11302091e-05 -1.20293553e-05 4.22604181e-06 -7.09359772e-05 4.04560801e-05 -1.41871954e-05 -1.02503375e-05 1.23985450e-05 -4.34366074e-06 -3.09546624e-06 2.47970899e-06 3.25689024e-04 2.89608434e-03 -1.28527532e-03 6.42637659e-04 -4.14019247e-04 4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.82434463e-04 -1.78209909e-04 8.08681204e-05 4.86708945e-05 -4.04340602e-05 1.31792447e-06 1.42696266e-05 -7.04340302e-06 4.22604181e-06 -7.59910514e-07 2.36453257e-05 -1.41871954e-05 2.62355898e-06 3.41677917e-06 -4.34366074e-06 8.15449649e-07 1.28479698e-06 -4.89269790e-07 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 -4.15611128e-03 4.15611128e-03 -2.41529920e-02 1.33621179e-02 -1.33621179e-02 -4.89198722e-04 8.27434268e-04 -8.27434268e-04 4.92484006e-04 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 -7.09359772e-05 2.36453257e-05 -3.88706075e-04 2.37309331e-04 -7.91031105e-05 -5.45492648e-05 7.26955279e-05 -2.42318426e-05 -1.97115105e-05 1.47836328e-05 1.06639054e-03 9.35225951e-03 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.33621179e-02 -4.10981523e-03 6.68105894e-03 5.17455810e-04 -1.77416518e-04 4.92484006e-04 -1.57533744e-04 -8.87082588e-05 1.31931676e-05 1.42707031e-04 -7.09359772e-05 4.04560801e-05 -1.41871954e-05 2.37309331e-04 -1.35576122e-04 4.74618663e-05 3.48472270e-05 -4.23131714e-05 1.47836328e-05 1.06042700e-05 -8.46263429e-06 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.33621179e-02 6.68105894e-03 -4.10981523e-03 -5.17455810e-04 4.92484006e-04 -1.77416518e-04 -1.57533744e-04 8.87082588e-05 -4.39772254e-06 -4.75690104e-05 2.36453257e-05 -1.41871954e-05 2.62355898e-06 -7.91031105e-05 4.74618663e-05 -9.01114524e-06 -1.16157423e-05 1.47836328e-05 -2.89015053e-06 -4.34984751e-06 1.73409032e-06 9.05613602e-05 5.70753169e-04 -1.96268001e-04 1.82434463e-04 -1.82434463e-04 4.89198722e-04 -5.17455810e-04 5.17455810e-04 -8.99306349e-05 8.30889164e-05 -8.30889164e-05 3.38595206e-05 3.04388134e-06 3.21001433e-05 -1.59884824e-05 1.02503375e-05 -3.41677917e-06 5.45492648e-05 -3.48472270e-05 1.16157423e-05 5.56082368e-06 -7.39785129e-06 2.46595043e-06 2.00638043e-06 -1.50478532e-06 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 -8.08681204e-05 1.78209909e-04 -8.27434268e-04 1.77416518e-04 -4.92484006e-04 8.30889164e-05 -1.08000471e-04 9.44638495e-05 8.87380160e-06 -5.38872760e-05 -3.95411785e-06 -4.16993094e-05 2.13388414e-05 -1.23985450e-05 4.34366074e-06 -7.26955279e-05 4.23131714e-05 -1.47836328e-05 -7.39785129e-06 9.51122747e-06 -3.20700306e-06 -2.50445917e-06 1.90867338e-06 1.04571251e-04 6.59048991e-04 -3.07748924e-04 1.78209909e-04 -8.08681204e-05 8.27434268e-04 -4.92484006e-04 1.77416518e-04 -8.30889164e-05 9.44638495e-05 -1.08000471e-04 8.87380160e-06 5.38872760e-05 1.31803928e-06 1.38997698e-05 -7.11294712e-06 4.34366074e-06 -8.15449649e-07 2.42318426e-05 -1.47836328e-05 2.89015053e-06 2.46595043e-06 -3.20700306e-06 9.59219321e-07 8.83346132e-07 -5.71522584e-07 -4.86708945e-05 -4.86708945e-05 1.57533744e-04 1.57533744e-04 8.87380160e-06 8.87380160e-06 -4.66282012e-06 1.05443143e-06 1.11198158e-05 -5.79154766e-06 3.09546624e-06 -1.28479698e-06 1.97115105e-05 -1.06042700e-05 4.34984751e-06 2.00638043e-06 -2.50445917e-06 8.83346132e-07 6.50274256e-07 -5.15449757e-07 -5.22856257e-05 -3.29524496e-04 1.78209909e-04 -4.04340602e-05 4.04340602e-05 -4.92484006e-04 8.87082588e-05 -8.87082588e-05 3.38595206e-05 -5.38872760e-05 5.38872760e-05 -2.71695573e-05 -7.90823570e-07 -8.33986187e-06 4.34366074e-06 -2.47970899e-06 4.89269790e-07 -1.47836328e-05 8.46263429e-06 -1.73409032e-06 -1.50478532e-06 1.90867338e-06 -5.71522584e-07 -5.15449757e-07 3.49595231e-07 9.03813139e-04 6.83095219e-03 -2.52992999e-03 8.43309998e-04 -2.52992999e-03 7.57080511e-03 -2.52360170e-03 7.57080511e-03 5.05224374e-05 -6.56305714e-05 1.96891714e-04 -8.75074285e-05 -6.56305714e-05 1.70328256e-04 1.56710856e-03 -6.51378048e-04 3.25689024e-04 -3.25689024e-04 2.13278108e-03 -1.06639054e-03 1.06639054e-03 9.05613602e-05 -1.04571251e-04 1.04571251e-04 -5.22856257e-05 6.83095219e-03 4.49022829e-02 -1.71775766e-02 5.72585887e-03 -1.71775766e-02 4.75796841e-02 -1.58598947e-02 4.75796841e-02 -5.20652809e-04 6.76347839e-04 -2.02904352e-03 9.01797119e-04 6.76347839e-04 1.56710856e-03 1.39613919e-02 -5.79216869e-03 2.89608434e-03 -2.89608434e-03 1.87045190e-02 -9.35225951e-03 9.35225951e-03 5.70753169e-04 -6.59048991e-04 6.59048991e-04 -3.29524496e-04 2.52992999e-03 1.71775766e-02 -5.92699644e-03 2.38239659e-03 -7.14718976e-03 1.66087992e-02 -6.78418274e-03 2.03525482e-02 -2.12097053e-04 1.25444848e-04 -3.76334544e-04 1.10087490e-04 8.25656177e-05 6.51378048e-04 5.79216869e-03 -2.34193222e-03 1.28527532e-03 -1.28527532e-03 7.54522870e-03 -4.15611128e-03 4.15611128e-03 1.96268001e-04 -3.07748924e-04 3.07748924e-04 -1.78209909e-04 -8.43309998e-04 -5.72585887e-03 2.38239659e-03 4.26061120e-04 2.38239659e-03 -6.78418274e-03 -1.48235482e-03 -6.78418274e-03 -3.56998782e-06 -1.56159564e-04 8.25656177e-05 6.18340029e-06 -1.56159564e-04 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 -4.14019247e-04 6.42637659e-04 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.82434463e-04 8.08681204e-05 -1.78209909e-04 4.86708945e-05 4.04340602e-05 2.52992999e-03 1.71775766e-02 -7.14718976e-03 2.38239659e-03 -5.92699644e-03 2.03525482e-02 -6.78418274e-03 1.66087992e-02 1.07099635e-05 8.25656177e-05 -3.76334544e-04 2.38725181e-04 1.25444848e-04 3.25689024e-04 2.89608434e-03 -1.28527532e-03 6.42637659e-04 -4.14019247e-04 4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.82434463e-04 -1.78209909e-04 8.08681204e-05 4.86708945e-05 -4.04340602e-05 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 -6.78418274e-03 2.03525482e-02 -4.42337068e-02 1.85131107e-02 -5.55393321e-02 9.60604637e-04 -1.02346772e-03 3.07040317e-03 -1.27914009e-03 -9.59355067e-04 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 -4.15611128e-03 4.15611128e-03 -2.41529920e-02 1.33621179e-02 -1.33621179e-02 -4.89198722e-04 8.27434268e-04 -8.27434268e-04 4.92484006e-04 2.52360170e-03 1.58598947e-02 -6.78418274e-03 -1.48235482e-03 -6.78418274e-03 1.85131107e-02 5.13458842e-03 1.85131107e-02 -2.09155165e-04 5.12122996e-04 -9.59355067e-04 3.62267372e-04 5.12122996e-04 1.06639054e-03 9.35225951e-03 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.33621179e-02 -4.10981523e-03 6.68105894e-03 5.17455810e-04 -1.77416518e-04 4.92484006e-04 -1.57533744e-04 -8.87082588e-05 -7.57080511e-03 -4.75796841e-02 2.03525482e-02 -6.78418274e-03 1.66087992e-02 -5.55393321e-02 1.85131107e-02 -4.42337068e-02 6.27465494e-04 -9.59355067e-04 3.07040317e-03 -1.47147806e-03 -1.02346772e-03 -1.06639054e-03 -9.35225951e-03 4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.33621179e-02 6.68105894e-03 -4.10981523e-03 -5.17455810e-04 4.92484006e-04 -1.77416518e-04 -1.57533744e-04 8.87082588e-05 5.05224374e-05 -5.20652809e-04 2.12097053e-04 3.56998782e-06 -1.07099635e-05 -9.60604637e-04 2.09155165e-04 -6.27465494e-04 1.78917197e-04 1.16268511e-04 -3.48805533e-04 2.92334169e-04 2.19250627e-04 9.05613602e-05 5.70753169e-04 -1.96268001e-04 1.82434463e-04 -1.82434463e-04 4.89198722e-04 -5.17455810e-04 5.17455810e-04 -8.99306349e-05 8.30889164e-05 -8.30889164e-05 3.38595206e-05 -6.56305714e-05 6.76347839e-04 -1.25444848e-04 1.56159564e-04 -8.25656177e-05 1.02346772e-03 -5.12122996e-04 9.59355067e-04 1.16268511e-04 -6.48472168e-06 5.27432619e-04 -3.20296473e-04 -1.72595341e-05 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 -8.08681204e-05 1.78209909e-04 -8.27434268e-04 1.77416518e-04 -4.92484006e-04 8.30889164e-05 -1.08000471e-04 9.44638495e-05 8.87380160e-06 -5.38872760e-05 1.96891714e-04 -2.02904352e-03 3.76334544e-04 -8.25656177e-05 3.76334544e-04 -3.07040317e-03 9.59355067e-04 -3.07040317e-03 -3.48805533e-04 5.27432619e-04 -1.41297171e-03 6.04148906e-04 5.27432619e-04 1.04571251e-04 6.59048991e-04 -3.07748924e-04 1.78209909e-04 -8.08681204e-05 8.27434268e-04 -4.92484006e-04 1.77416518e-04 -8.30889164e-05 9.44638495e-05 -1.08000471e-04 8.87380160e-06 5.38872760e-05 -8.75074285e-05 9.01797119e-04 -1.10087490e-04 -6.18340029e-06 -2.38725181e-04 1.27914009e-03 -3.62267372e-04 1.47147806e-03 2.92334169e-04 -3.20296473e-04 6.04148906e-04 -1.58641225e-04 -2.60839721e-04 -4.86708945e-05 -4.86708945e-05 1.57533744e-04 1.57533744e-04 8.87380160e-06 8.87380160e-06 -4.66282012e-06 -6.56305714e-05 6.76347839e-04 -8.25656177e-05 1.56159564e-04 -1.25444848e-04 9.59355067e-04 -5.12122996e-04 1.02346772e-03 2.19250627e-04 -1.72595341e-05 5.27432619e-04 -2.60839721e-04 -6.48472168e-06 -5.22856257e-05 -3.29524496e-04 1.78209909e-04 -4.04340602e-05 4.04340602e-05 -4.92484006e-04 8.87082588e-05 -8.87082588e-05 3.38595206e-05 -5.38872760e-05 5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 25 50 75 101 127 152 178 204 229 255 281 301 326 351 376 401 427 453 478 504 530 555 581 607 627 652 --1 2 1 157 - 6.09103871e-05 6.14453477e-04 -2.95926902e-04 5.91853803e-05 -5.91853803e-05 1.00862265e-03 -2.01724529e-04 2.01724529e-04 9.57738101e-05 -3.45593969e-05 3.45593969e-05 -6.91187938e-06 6.14453477e-04 6.16334179e-03 -2.94640435e-03 5.89280869e-04 -5.89280869e-04 1.00332651e-02 -2.00665301e-03 2.00665301e-03 8.94894397e-04 -3.22917201e-04 3.22917201e-04 -6.45834401e-05 2.95926902e-04 2.94640435e-03 -1.40977838e-03 2.96993437e-04 -2.96993437e-04 4.78344308e-03 -1.00862453e-03 1.00862453e-03 4.13777746e-04 -1.60905699e-04 1.60905699e-04 -3.43220350e-05 -5.91853803e-05 -5.89280869e-04 2.96993437e-04 1.57901181e-05 5.93986875e-05 -1.00862453e-03 -5.79546830e-05 -2.01724907e-04 -1.01296246e-04 -1.92003453e-05 -3.43220350e-05 1.07044761e-05 -3.84006907e-06 5.91853803e-05 5.89280869e-04 -2.96993437e-04 5.93986875e-05 1.57901181e-05 1.00862453e-03 -2.01724907e-04 -5.79546830e-05 1.01296246e-04 -3.43220350e-05 -1.92003453e-05 1.07044761e-05 3.84006907e-06 -1.00862265e-03 -1.00332651e-02 4.78344308e-03 -1.00862453e-03 1.00862453e-03 -1.62371149e-02 3.42697221e-03 -3.42697221e-03 -1.36675680e-03 5.33163371e-04 -5.33163371e-04 1.14013134e-04 2.01724529e-04 2.00665301e-03 -1.00862453e-03 -5.79546830e-05 -2.01724907e-04 3.42697221e-03 2.12351688e-04 6.85394441e-04 3.37268019e-04 7.04983673e-05 1.14013134e-04 -3.69023003e-05 1.40996735e-05 -2.01724529e-04 -2.00665301e-03 1.00862453e-03 -2.01724907e-04 -5.79546830e-05 -3.42697221e-03 6.85394441e-04 2.12351688e-04 -3.37268019e-04 1.14013134e-04 7.04983673e-05 -3.69023003e-05 -1.40996735e-05 9.57738101e-05 8.94894397e-04 -4.13777746e-04 1.01296246e-04 -1.01296246e-04 1.36675680e-03 -3.37268019e-04 3.37268019e-04 6.36867635e-05 -3.49983802e-05 3.49983802e-05 -9.35097527e-06 -3.45593969e-05 -3.22917201e-04 1.60905699e-04 1.92003453e-05 3.43220350e-05 -5.33163371e-04 -7.04983673e-05 -1.14013134e-04 -3.49983802e-05 -1.92605535e-05 -1.26855161e-05 6.78761620e-06 -3.97900833e-06 3.45593969e-05 3.22917201e-04 -1.60905699e-04 3.43220350e-05 1.92003453e-05 5.33163371e-04 -1.14013134e-04 -7.04983673e-05 3.49983802e-05 -1.26855161e-05 -1.92605535e-05 6.78761620e-06 3.97900833e-06 -1.07044761e-05 -1.07044761e-05 3.69023003e-05 3.69023003e-05 6.78761620e-06 6.78761620e-06 -7.23035088e-07 -6.91187938e-06 -6.45834401e-05 3.43220350e-05 3.84006907e-06 -3.84006907e-06 -1.14013134e-04 -1.40996735e-05 1.40996735e-05 -9.35097527e-06 -3.97900833e-06 3.97900833e-06 -1.61313514e-07 - 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 3 4 6 7 9 10 11 0 1 2 3 4 5 6 7 8 9 10 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 24 36 49 62 74 87 100 112 125 138 145 157 -0 -2 -1 169 - 1.25466617e-06 1.34349826e-05 6.58962236e-06 -3.95377341e-06 -1.31792447e-06 -2.19886127e-05 1.31931676e-05 4.39772254e-06 3.04388134e-06 -3.95411785e-06 -1.31803928e-06 1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 7.13481329e-05 -4.28088798e-05 -1.42696266e-05 -2.37845052e-04 1.42707031e-04 4.75690104e-05 3.21001433e-05 -4.16993094e-05 -1.38997698e-05 1.11198158e-05 8.33986187e-06 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 2.11302091e-05 7.04340302e-06 1.16121122e-04 -7.09359772e-05 -2.36453257e-05 -1.59884824e-05 2.13388414e-05 7.11294712e-06 -5.79154766e-06 -4.34366074e-06 3.95377341e-06 4.28088798e-05 2.11302091e-05 -1.20293553e-05 -4.22604181e-06 -7.09359772e-05 4.04560801e-05 1.41871954e-05 1.02503375e-05 -1.23985450e-05 -4.34366074e-06 3.09546624e-06 2.47970899e-06 1.31792447e-06 1.42696266e-05 7.04340302e-06 -4.22604181e-06 -7.59910514e-07 -2.36453257e-05 1.41871954e-05 2.62355898e-06 3.41677917e-06 -4.34366074e-06 -8.15449649e-07 1.28479698e-06 4.89269790e-07 2.19886127e-05 2.37845052e-04 1.16121122e-04 -7.09359772e-05 -2.36453257e-05 -3.88706075e-04 2.37309331e-04 7.91031105e-05 5.45492648e-05 -7.26955279e-05 -2.42318426e-05 1.97115105e-05 1.47836328e-05 -1.31931676e-05 -1.42707031e-04 -7.09359772e-05 4.04560801e-05 1.41871954e-05 2.37309331e-04 -1.35576122e-04 -4.74618663e-05 -3.48472270e-05 4.23131714e-05 1.47836328e-05 -1.06042700e-05 -8.46263429e-06 -4.39772254e-06 -4.75690104e-05 -2.36453257e-05 1.41871954e-05 2.62355898e-06 7.91031105e-05 -4.74618663e-05 -9.01114524e-06 -1.16157423e-05 1.47836328e-05 2.89015053e-06 -4.34984751e-06 -1.73409032e-06 3.04388134e-06 3.21001433e-05 1.59884824e-05 -1.02503375e-05 -3.41677917e-06 -5.45492648e-05 3.48472270e-05 1.16157423e-05 5.56082368e-06 -7.39785129e-06 -2.46595043e-06 2.00638043e-06 1.50478532e-06 -3.95411785e-06 -4.16993094e-05 -2.13388414e-05 1.23985450e-05 4.34366074e-06 7.26955279e-05 -4.23131714e-05 -1.47836328e-05 -7.39785129e-06 9.51122747e-06 3.20700306e-06 -2.50445917e-06 -1.90867338e-06 -1.31803928e-06 -1.38997698e-05 -7.11294712e-06 4.34366074e-06 8.15449649e-07 2.42318426e-05 -1.47836328e-05 -2.89015053e-06 -2.46595043e-06 3.20700306e-06 9.59219321e-07 -8.83346132e-07 -5.71522584e-07 1.05443143e-06 1.11198158e-05 5.79154766e-06 -3.09546624e-06 -1.28479698e-06 -1.97115105e-05 1.06042700e-05 4.34984751e-06 2.00638043e-06 -2.50445917e-06 -8.83346132e-07 6.50274256e-07 5.15449757e-07 7.90823570e-07 8.33986187e-06 4.34366074e-06 -2.47970899e-06 -4.89269790e-07 -1.47836328e-05 8.46263429e-06 1.73409032e-06 1.50478532e-06 -1.90867338e-06 -5.71522584e-07 5.15449757e-07 3.49595231e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 -0 -2 0 363 - 8.23315696e-06 9.02495943e-05 3.30136560e-05 -3.30136560e-05 -1.15322826e-04 1.15322826e-04 6.50509780e-06 -2.25343198e-05 1.12671599e-05 9.03813139e-04 6.83095219e-03 2.52992999e-03 -2.52992999e-03 8.43309998e-04 -7.57080511e-03 7.57080511e-03 -2.52360170e-03 5.05224374e-05 -1.96891714e-04 6.56305714e-05 8.75074285e-05 -6.56305714e-05 9.02495943e-05 9.91070319e-04 3.61844250e-04 -3.61844250e-04 -1.26431932e-03 1.26431932e-03 7.23412109e-05 -2.50597306e-04 1.25298653e-04 6.83095219e-03 4.49022829e-02 1.71775766e-02 -1.71775766e-02 5.72585887e-03 -4.75796841e-02 4.75796841e-02 -1.58598947e-02 -5.20652809e-04 2.02904352e-03 -6.76347839e-04 -9.01797119e-04 6.76347839e-04 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 -2.08516626e-05 8.77935341e-05 -4.64903097e-05 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 7.14718976e-03 -2.38239659e-03 1.66087992e-02 -2.03525482e-02 6.78418274e-03 2.12097053e-04 -3.76334544e-04 1.25444848e-04 1.10087490e-04 -8.25656177e-05 3.30136560e-05 3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 2.98359579e-05 -8.77935341e-05 4.13032244e-05 2.52992999e-03 1.71775766e-02 7.14718976e-03 -5.92699644e-03 2.38239659e-03 -2.03525482e-02 1.66087992e-02 -6.78418274e-03 1.07099635e-05 3.76334544e-04 -8.25656177e-05 -2.38725181e-04 1.25444848e-04 6.96094992e-06 -2.39796963e-05 5.18708531e-06 -5.18708531e-06 -8.43309998e-04 -5.72585887e-03 -2.38239659e-03 2.38239659e-03 4.26061120e-04 6.78418274e-03 -6.78418274e-03 -1.48235482e-03 -3.56998782e-06 -8.25656177e-05 1.56159564e-04 -6.18340029e-06 -1.56159564e-04 1.15322826e-04 1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 7.37468140e-05 -3.09427778e-04 1.63707443e-04 7.57080511e-03 4.75796841e-02 1.66087992e-02 -2.03525482e-02 6.78418274e-03 -4.42337068e-02 5.55393321e-02 -1.85131107e-02 -9.60604637e-04 3.07040317e-03 -1.02346772e-03 -1.27914009e-03 9.59355067e-04 -1.15322826e-04 -1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 -1.04901397e-04 3.09427778e-04 -1.45720336e-04 -7.57080511e-03 -4.75796841e-02 -2.03525482e-02 1.66087992e-02 -6.78418274e-03 5.55393321e-02 -4.42337068e-02 1.85131107e-02 6.27465494e-04 -3.07040317e-03 9.59355067e-04 1.47147806e-03 -1.02346772e-03 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 1.79871070e-05 2.52360170e-03 1.58598947e-02 6.78418274e-03 -6.78418274e-03 -1.48235482e-03 -1.85131107e-02 1.85131107e-02 5.13458842e-03 -2.09155165e-04 9.59355067e-04 -5.12122996e-04 -3.62267372e-04 5.12122996e-04 6.50509780e-06 7.23412109e-05 2.08516626e-05 -2.98359579e-05 -7.37468140e-05 1.04901397e-04 -9.95783968e-07 -1.81181256e-05 1.27509189e-05 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 -1.07099635e-05 3.56998782e-06 9.60604637e-04 -6.27465494e-04 2.09155165e-04 1.78917197e-04 3.48805533e-04 -1.16268511e-04 -2.92334169e-04 2.19250627e-04 -2.25343198e-05 -2.50597306e-04 -8.77935341e-05 8.77935341e-05 3.09427778e-04 -3.09427778e-04 -1.81181256e-05 6.29314743e-05 -3.13815141e-05 -1.96891714e-04 2.02904352e-03 3.76334544e-04 -3.76334544e-04 8.25656177e-05 -3.07040317e-03 3.07040317e-03 -9.59355067e-04 3.48805533e-04 -1.41297171e-03 5.27432619e-04 6.04148906e-04 -5.27432619e-04 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 4.26298824e-06 6.56305714e-05 -6.76347839e-04 -1.25444848e-04 8.25656177e-05 -1.56159564e-04 1.02346772e-03 -9.59355067e-04 5.12122996e-04 -1.16268511e-04 5.27432619e-04 -6.48472168e-06 -3.20296473e-04 1.72595341e-05 1.12671599e-05 1.25298653e-04 4.64903097e-05 -4.13032244e-05 -1.63707443e-04 1.45720336e-04 1.27509189e-05 -3.13815141e-05 1.37277090e-05 8.75074285e-05 -9.01797119e-04 -1.10087490e-04 2.38725181e-04 6.18340029e-06 1.27914009e-03 -1.47147806e-03 3.62267372e-04 -2.92334169e-04 6.04148906e-04 -3.20296473e-04 -1.58641225e-04 2.60839721e-04 5.18708531e-06 -1.79871070e-05 4.26298824e-06 -4.09454220e-06 -6.56305714e-05 6.76347839e-04 8.25656177e-05 -1.25444848e-04 1.56159564e-04 -9.59355067e-04 1.02346772e-03 -5.12122996e-04 2.19250627e-04 -5.27432619e-04 1.72595341e-05 2.60839721e-04 -6.48472168e-06 8.23315696e-06 9.02495943e-05 3.30136560e-05 -3.30136560e-05 -1.15322826e-04 1.15322826e-04 6.50509780e-06 -2.25343198e-05 1.12671599e-05 9.02495943e-05 9.91070319e-04 3.61844250e-04 -3.61844250e-04 -1.26431932e-03 1.26431932e-03 7.23412109e-05 -2.50597306e-04 1.25298653e-04 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 -2.08516626e-05 8.77935341e-05 -4.64903097e-05 3.30136560e-05 3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 2.98359579e-05 -8.77935341e-05 4.13032244e-05 6.96094992e-06 -2.39796963e-05 5.18708531e-06 -5.18708531e-06 1.15322826e-04 1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 7.37468140e-05 -3.09427778e-04 1.63707443e-04 -1.15322826e-04 -1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 -1.04901397e-04 3.09427778e-04 -1.45720336e-04 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 1.79871070e-05 6.50509780e-06 7.23412109e-05 2.08516626e-05 -2.98359579e-05 -7.37468140e-05 1.04901397e-04 -9.95783968e-07 -1.81181256e-05 1.27509189e-05 -2.25343198e-05 -2.50597306e-04 -8.77935341e-05 8.77935341e-05 3.09427778e-04 -3.09427778e-04 -1.81181256e-05 6.29314743e-05 -3.13815141e-05 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 4.26298824e-06 1.12671599e-05 1.25298653e-04 4.64903097e-05 -4.13032244e-05 -1.63707443e-04 1.45720336e-04 1.27509189e-05 -3.13815141e-05 1.37277090e-05 5.18708531e-06 -1.79871070e-05 4.26298824e-06 -4.09454220e-06 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 18 19 21 22 24 13 14 15 16 18 19 21 22 24 13 14 15 16 18 19 21 22 24 13 14 15 16 18 19 21 22 24 17 20 23 25 13 14 15 16 18 19 21 22 24 13 14 15 16 18 19 21 22 24 17 20 23 25 13 14 15 16 18 19 21 22 24 13 14 15 16 18 19 21 22 24 17 20 23 25 13 14 15 16 18 19 21 22 24 17 20 23 25 - 0 22 44 66 88 105 127 149 166 188 210 227 249 266 275 284 293 302 306 315 324 328 337 346 350 359 363 -0 -2 1 664 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 -6.51378048e-04 3.25689024e-04 -1.06639054e-03 2.13278108e-03 -1.06639054e-03 -4.52806801e-05 -1.04571251e-04 5.22856257e-05 7.84284385e-05 -1.04571251e-04 9.03813139e-04 6.83095219e-03 8.43309998e-04 -2.52992999e-03 2.52992999e-03 -2.52360170e-03 7.57080511e-03 -7.57080511e-03 -1.01044875e-04 -6.56305714e-05 6.56305714e-05 -1.96891714e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 -5.79216869e-03 2.89608434e-03 -9.35225951e-03 1.87045190e-02 -9.35225951e-03 -2.85376584e-04 -6.59048991e-04 3.29524496e-04 4.94286743e-04 -6.59048991e-04 6.83095219e-03 4.49022829e-02 5.72585887e-03 -1.71775766e-02 1.71775766e-02 -1.58598947e-02 4.75796841e-02 -4.75796841e-02 1.04130562e-03 6.76347839e-04 -6.76347839e-04 2.02904352e-03 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 1.28527532e-03 -6.42637659e-04 1.31106178e-03 -4.15611128e-03 2.07805564e-03 1.33367462e-04 8.08681204e-05 -4.04340602e-05 -1.33657432e-04 1.78209909e-04 -8.43309998e-04 -5.72585887e-03 4.26061120e-04 2.38239659e-03 -2.38239659e-03 -1.48235482e-03 -6.78418274e-03 6.78418274e-03 7.13997564e-06 -1.56159564e-04 1.56159564e-04 -8.25656177e-05 6.51378048e-04 5.79216869e-03 1.28527532e-03 -2.34193222e-03 1.28527532e-03 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 -9.81340007e-05 -3.07748924e-04 1.78209909e-04 1.69973075e-04 -3.07748924e-04 2.52992999e-03 1.71775766e-02 2.38239659e-03 -5.92699644e-03 7.14718976e-03 -6.78418274e-03 1.66087992e-02 -2.03525482e-02 2.01387090e-04 1.25444848e-04 -8.25656177e-05 -1.28637691e-04 3.76334544e-04 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 1.28527532e-03 -4.14019247e-04 2.07805564e-03 -4.15611128e-03 1.31106178e-03 4.90670003e-05 1.78209909e-04 -4.04340602e-05 -1.82328327e-04 8.08681204e-05 -2.52992999e-03 -1.71775766e-02 -2.38239659e-03 7.14718976e-03 -5.92699644e-03 6.78418274e-03 -2.03525482e-02 1.66087992e-02 -2.01387090e-04 -8.25656177e-05 1.25444848e-04 -1.28637691e-04 -3.76334544e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 -4.15611128e-03 2.07805564e-03 -4.10981523e-03 1.33621179e-02 -6.68105894e-03 -3.95156129e-04 -1.77416518e-04 8.87082588e-05 3.69363005e-04 -4.92484006e-04 2.52360170e-03 1.58598947e-02 -1.48235482e-03 -6.78418274e-03 6.78418274e-03 5.13458842e-03 1.85131107e-02 -1.85131107e-02 4.18310329e-04 5.12122996e-04 -5.12122996e-04 9.59355067e-04 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 1.33621179e-02 -2.41529920e-02 1.33621179e-02 2.44599361e-04 8.27434268e-04 -4.92484006e-04 -4.23658521e-04 8.27434268e-04 -7.57080511e-03 -4.75796841e-02 -6.78418274e-03 1.66087992e-02 -2.03525482e-02 1.85131107e-02 -4.42337068e-02 5.55393321e-02 -1.58807013e-03 -1.02346772e-03 9.59355067e-04 1.92337974e-04 -3.07040317e-03 1.06639054e-03 9.35225951e-03 2.07805564e-03 -4.15611128e-03 1.31106178e-03 -6.68105894e-03 1.33621179e-02 -4.10981523e-03 -1.22299680e-04 -4.92484006e-04 8.87082588e-05 5.26896749e-04 -1.77416518e-04 7.57080511e-03 4.75796841e-02 6.78418274e-03 -2.03525482e-02 1.66087992e-02 -1.85131107e-02 5.55393321e-02 -4.42337068e-02 1.58807013e-03 9.59355067e-04 -1.02346772e-03 1.92337974e-04 3.07040317e-03 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 9.81340007e-05 -4.90670003e-05 3.95156129e-04 -2.44599361e-04 1.22299680e-04 -2.59797738e-05 -3.38595206e-05 1.69297603e-05 3.69220468e-05 -4.92293958e-05 -1.01044875e-04 1.04130562e-03 -7.13997564e-06 -2.01387090e-04 2.01387090e-04 -4.18310329e-04 1.58807013e-03 -1.58807013e-03 -3.27420436e-04 -3.35519138e-04 3.35519138e-04 -6.97611067e-04 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 3.07748924e-04 -1.78209909e-04 1.77416518e-04 -8.27434268e-04 4.92484006e-04 -3.38595206e-05 -1.08000471e-04 5.38872760e-05 7.63940131e-05 -9.44638495e-05 -6.56305714e-05 6.76347839e-04 1.56159564e-04 -1.25444848e-04 8.25656177e-05 -5.12122996e-04 1.02346772e-03 -9.59355067e-04 -3.35519138e-04 -6.48472168e-06 1.72595341e-05 -5.94567521e-05 -5.27432619e-04 5.22856257e-05 3.29524496e-04 4.04340602e-05 -1.78209909e-04 4.04340602e-05 -8.87082588e-05 4.92484006e-04 -8.87082588e-05 1.69297603e-05 5.38872760e-05 -2.71695573e-05 -2.93232050e-05 5.38872760e-05 6.56305714e-05 -6.76347839e-04 -1.56159564e-04 8.25656177e-05 -1.25444848e-04 5.12122996e-04 -9.59355067e-04 1.02346772e-03 3.35519138e-04 1.72595341e-05 -6.48472168e-06 -5.94567521e-05 5.27432619e-04 7.84284385e-05 4.94286743e-04 1.33657432e-04 -1.69973075e-04 1.82328327e-04 -3.69363005e-04 4.23658521e-04 -5.26896749e-04 3.69220468e-05 7.63940131e-05 -2.93232050e-05 -6.86136812e-05 6.75202116e-05 1.28637691e-04 1.28637691e-04 -1.92337974e-04 -1.92337974e-04 -5.94567521e-05 -5.94567521e-05 3.47696408e-04 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 3.07748924e-04 -8.08681204e-05 4.92484006e-04 -8.27434268e-04 1.77416518e-04 -4.92293958e-05 -9.44638495e-05 5.38872760e-05 6.75202116e-05 -1.08000471e-04 -1.96891714e-04 2.02904352e-03 8.25656177e-05 -3.76334544e-04 3.76334544e-04 -9.59355067e-04 3.07040317e-03 -3.07040317e-03 -6.97611067e-04 -5.27432619e-04 5.27432619e-04 -1.41297171e-03 1.25466617e-06 1.34349826e-05 3.95377341e-06 -6.58962236e-06 1.31792447e-06 -1.31931676e-05 2.19886127e-05 -4.39772254e-06 -6.08776268e-07 -3.95411785e-06 7.90823570e-07 3.16329428e-06 -1.31803928e-06 1.70328256e-04 1.56710856e-03 3.25689024e-04 -6.51378048e-04 3.25689024e-04 -1.06639054e-03 2.13278108e-03 -1.06639054e-03 -4.52806801e-05 -1.04571251e-04 5.22856257e-05 7.84284385e-05 -1.04571251e-04 1.34349826e-05 1.43209127e-04 4.28088798e-05 -7.13481329e-05 1.42696266e-05 -1.42707031e-04 2.37845052e-04 -4.75690104e-05 -6.42002866e-06 -4.16993094e-05 8.33986187e-06 3.33594475e-05 -1.38997698e-05 1.56710856e-03 1.39613919e-02 2.89608434e-03 -5.79216869e-03 2.89608434e-03 -9.35225951e-03 1.87045190e-02 -9.35225951e-03 -2.85376584e-04 -6.59048991e-04 3.29524496e-04 4.94286743e-04 -6.59048991e-04 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 2.11302091e-05 -4.22604181e-06 4.04560801e-05 -7.09359772e-05 1.41871954e-05 2.44441635e-06 1.23985450e-05 -2.47970899e-06 -1.04247858e-05 4.34366074e-06 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 1.28527532e-03 -6.42637659e-04 1.31106178e-03 -4.15611128e-03 2.07805564e-03 1.33367462e-04 8.08681204e-05 -4.04340602e-05 -1.33657432e-04 1.78209909e-04 6.58962236e-06 7.13481329e-05 2.11302091e-05 -3.45682450e-05 7.04340302e-06 -7.09359772e-05 1.16121122e-04 -2.36453257e-05 -2.97861377e-06 -2.13388414e-05 4.34366074e-06 1.67422057e-05 -7.11294712e-06 6.51378048e-04 5.79216869e-03 1.28527532e-03 -2.34193222e-03 1.28527532e-03 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 -9.81340007e-05 -3.07748924e-04 1.78209909e-04 1.69973075e-04 -3.07748924e-04 -1.31792447e-06 -1.42696266e-05 -4.22604181e-06 7.04340302e-06 -7.59910514e-07 1.41871954e-05 -2.36453257e-05 2.62355898e-06 5.95722755e-07 4.34366074e-06 -4.89269790e-07 -3.60141605e-06 8.15449649e-07 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 1.28527532e-03 -4.14019247e-04 2.07805564e-03 -4.15611128e-03 1.31106178e-03 4.90670003e-05 1.78209909e-04 -4.04340602e-05 -1.82328327e-04 8.08681204e-05 1.31931676e-05 1.42707031e-04 4.04560801e-05 -7.09359772e-05 1.41871954e-05 -1.35576122e-04 2.37309331e-04 -4.74618663e-05 -8.24004626e-06 -4.23131714e-05 8.46263429e-06 3.54807188e-05 -1.47836328e-05 1.06639054e-03 9.35225951e-03 1.31106178e-03 -4.15611128e-03 2.07805564e-03 -4.10981523e-03 1.33621179e-02 -6.68105894e-03 -3.95156129e-04 -1.77416518e-04 8.87082588e-05 3.69363005e-04 -4.92484006e-04 -2.19886127e-05 -2.37845052e-04 -7.09359772e-05 1.16121122e-04 -2.36453257e-05 2.37309331e-04 -3.88706075e-04 7.91031105e-05 1.02039636e-05 7.26955279e-05 -1.47836328e-05 -5.70968043e-05 2.42318426e-05 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 1.33621179e-02 -2.41529920e-02 1.33621179e-02 2.44599361e-04 8.27434268e-04 -4.92484006e-04 -4.23658521e-04 8.27434268e-04 4.39772254e-06 4.75690104e-05 1.41871954e-05 -2.36453257e-05 2.62355898e-06 -4.74618663e-05 7.91031105e-05 -9.01114524e-06 -2.04079272e-06 -1.47836328e-05 1.73409032e-06 1.22344517e-05 -2.89015053e-06 1.06639054e-03 9.35225951e-03 2.07805564e-03 -4.15611128e-03 1.31106178e-03 -6.68105894e-03 1.33621179e-02 -4.10981523e-03 -1.22299680e-04 -4.92484006e-04 8.87082588e-05 5.26896749e-04 -1.77416518e-04 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 2.97861377e-06 -5.95722755e-07 8.24004626e-06 -1.02039636e-05 2.04079272e-06 1.40335193e-07 1.53000038e-06 -3.06000076e-07 -1.12314006e-06 4.67975025e-07 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 9.81340007e-05 -4.90670003e-05 3.95156129e-04 -2.44599361e-04 1.22299680e-04 -2.59797738e-05 -3.38595206e-05 1.69297603e-05 3.69220468e-05 -4.92293958e-05 -3.95411785e-06 -4.16993094e-05 -1.23985450e-05 2.13388414e-05 -4.34366074e-06 4.23131714e-05 -7.26955279e-05 1.47836328e-05 1.53000038e-06 9.51122747e-06 -1.90867338e-06 -7.65895674e-06 3.20700306e-06 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 3.07748924e-04 -1.78209909e-04 1.77416518e-04 -8.27434268e-04 4.92484006e-04 -3.38595206e-05 -1.08000471e-04 5.38872760e-05 7.63940131e-05 -9.44638495e-05 7.90823570e-07 8.33986187e-06 2.47970899e-06 -4.34366074e-06 4.89269790e-07 -8.46263429e-06 1.47836328e-05 -1.73409032e-06 -3.06000076e-07 -1.90867338e-06 3.49595231e-07 1.56090719e-06 -5.71522584e-07 5.22856257e-05 3.29524496e-04 4.04340602e-05 -1.78209909e-04 4.04340602e-05 -8.87082588e-05 4.92484006e-04 -8.87082588e-05 1.69297603e-05 5.38872760e-05 -2.71695573e-05 -2.93232050e-05 5.38872760e-05 3.16329428e-06 3.33594475e-05 1.04247858e-05 -1.67422057e-05 3.60141605e-06 -3.54807188e-05 5.70968043e-05 -1.22344517e-05 -1.12314006e-06 -7.65895674e-06 1.56090719e-06 6.07076274e-06 -2.57724878e-06 7.84284385e-05 4.94286743e-04 1.33657432e-04 -1.69973075e-04 1.82328327e-04 -3.69363005e-04 4.23658521e-04 -5.26896749e-04 3.69220468e-05 7.63940131e-05 -2.93232050e-05 -6.86136812e-05 6.75202116e-05 -1.31803928e-06 -1.38997698e-05 -4.34366074e-06 7.11294712e-06 -8.15449649e-07 1.47836328e-05 -2.42318426e-05 2.89015053e-06 4.67975025e-07 3.20700306e-06 -5.71522584e-07 -2.57724878e-06 9.59219321e-07 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 3.07748924e-04 -8.08681204e-05 4.92484006e-04 -8.27434268e-04 1.77416518e-04 -4.92293958e-05 -9.44638495e-05 5.38872760e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 25 50 75 101 127 152 178 204 229 255 281 301 326 352 378 404 430 456 482 508 534 560 586 612 638 664 -0 -2 2 516 - 8.23315696e-06 9.02495943e-05 -3.30136560e-05 3.30136560e-05 1.15322826e-04 -1.15322826e-04 -1.30101956e-05 -2.25343198e-05 1.25466617e-06 1.34349826e-05 -1.31792447e-06 -3.95377341e-06 6.58962236e-06 4.39772254e-06 1.31931676e-05 -2.19886127e-05 -2.43510507e-06 7.90823570e-07 -1.31803928e-06 -2.10886285e-06 -3.95411785e-06 9.02495943e-05 9.91070319e-04 -3.61844250e-04 3.61844250e-04 1.26431932e-03 -1.26431932e-03 -1.44682422e-04 -2.50597306e-04 1.34349826e-05 1.43209127e-04 -1.42696266e-05 -4.28088798e-05 7.13481329e-05 4.75690104e-05 1.42707031e-04 -2.37845052e-04 -2.56801146e-05 8.33986187e-06 -1.38997698e-05 -2.22396317e-05 -4.16993094e-05 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 5.18708531e-06 1.31792447e-06 1.42696266e-05 -7.59910514e-07 -4.22604181e-06 7.04340302e-06 2.62355898e-06 1.41871954e-05 -2.36453257e-05 -2.82105641e-06 4.89269790e-07 -8.15449649e-07 -2.31661906e-06 -4.34366074e-06 3.30136560e-05 3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 -5.06876205e-05 -5.18708531e-06 -8.77935341e-05 3.95377341e-06 4.28088798e-05 -4.22604181e-06 -1.20293553e-05 2.11302091e-05 1.41871954e-05 4.04560801e-05 -7.09359772e-05 -7.80592115e-06 2.47970899e-06 -4.34366074e-06 -7.32931955e-06 -1.23985450e-05 -3.30136560e-05 -3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 5.06876205e-05 -5.18708531e-06 8.77935341e-05 -6.58962236e-06 -7.13481329e-05 7.04340302e-06 2.11302091e-05 -3.45682450e-05 -2.36453257e-05 -7.09359772e-05 1.16121122e-04 1.30098686e-05 -4.34366074e-06 7.11294712e-06 1.09506581e-05 2.13388414e-05 -2.39796963e-05 8.25086154e-05 1.79871070e-05 -1.79871070e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 1.41871954e-05 -2.36453257e-05 -9.01114524e-06 -4.74618663e-05 7.91031105e-05 9.57494961e-06 -1.73409032e-06 2.89015053e-06 7.88460418e-06 1.47836328e-05 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 1.78648211e-04 1.79871070e-05 3.09427778e-04 -1.31931676e-05 -1.42707031e-04 1.41871954e-05 4.04560801e-05 -7.09359772e-05 -4.74618663e-05 -1.35576122e-04 2.37309331e-04 2.66071807e-05 -8.46263429e-06 1.47836328e-05 2.48764488e-05 4.23131714e-05 1.15322826e-04 1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 -1.78648211e-04 1.79871070e-05 -3.09427778e-04 2.19886127e-05 2.37845052e-04 -2.36453257e-05 -7.09359772e-05 1.16121122e-04 7.91031105e-05 2.37309331e-04 -3.88706075e-04 -4.43453012e-05 1.47836328e-05 -2.42318426e-05 -3.73852938e-05 -7.26955279e-05 -1.30101956e-05 -1.44682422e-04 5.06876205e-05 -5.06876205e-05 -1.78648211e-04 1.78648211e-04 2.10894554e-05 3.62362512e-05 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 7.80592115e-06 -1.30098686e-05 -9.57494961e-06 -2.66071807e-05 4.43453012e-05 3.61548803e-06 -1.19878524e-06 1.99797541e-06 3.12952049e-06 5.86785091e-06 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 4.26298824e-06 7.90823570e-07 8.33986187e-06 -4.89269790e-07 -2.47970899e-06 4.34366074e-06 1.73409032e-06 8.46263429e-06 -1.47836328e-05 -1.19878524e-06 3.49595231e-07 -5.71522584e-07 -1.04545744e-06 -1.90867338e-06 -5.18708531e-06 1.79871070e-05 4.26298824e-06 -4.09454220e-06 -1.31803928e-06 -1.38997698e-05 8.15449649e-07 4.34366074e-06 -7.11294712e-06 -2.89015053e-06 -1.47836328e-05 2.42318426e-05 1.99797541e-06 -5.71522584e-07 9.59219321e-07 1.69390265e-06 3.20700306e-06 5.18708531e-06 5.18708531e-06 -1.79871070e-05 -1.79871070e-05 -8.35753044e-06 -2.10886285e-06 -2.22396317e-05 2.31661906e-06 7.32931955e-06 -1.09506581e-05 -7.88460418e-06 -2.48764488e-05 3.73852938e-05 3.12952049e-06 -1.04545744e-06 1.69390265e-06 2.59560990e-06 5.15449757e-06 -2.25343198e-05 -2.50597306e-04 8.77935341e-05 -8.77935341e-05 -3.09427778e-04 3.09427778e-04 3.62362512e-05 6.29314743e-05 -3.95411785e-06 -4.16993094e-05 4.34366074e-06 1.23985450e-05 -2.13388414e-05 -1.47836328e-05 -4.23131714e-05 7.26955279e-05 5.86785091e-06 -1.90867338e-06 3.20700306e-06 5.15449757e-06 9.51122747e-06 1.25466617e-06 1.34349826e-05 1.31792447e-06 -6.58962236e-06 3.95377341e-06 -4.39772254e-06 2.19886127e-05 -1.31931676e-05 -2.43510507e-06 -1.31803928e-06 7.90823570e-07 2.10886285e-06 -3.95411785e-06 8.23315696e-06 9.02495943e-05 -3.30136560e-05 3.30136560e-05 1.15322826e-04 -1.15322826e-04 -1.30101956e-05 -2.25343198e-05 1.34349826e-05 1.43209127e-04 1.42696266e-05 -7.13481329e-05 4.28088798e-05 -4.75690104e-05 2.37845052e-04 -1.42707031e-04 -2.56801146e-05 -1.38997698e-05 8.33986187e-06 2.22396317e-05 -4.16993094e-05 9.02495943e-05 9.91070319e-04 -3.61844250e-04 3.61844250e-04 1.26431932e-03 -1.26431932e-03 -1.44682422e-04 -2.50597306e-04 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 7.04340302e-06 -4.22604181e-06 2.62355898e-06 -2.36453257e-05 1.41871954e-05 2.82105641e-06 8.15449649e-07 -4.89269790e-07 -2.31661906e-06 4.34366074e-06 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 5.18708531e-06 6.58962236e-06 7.13481329e-05 7.04340302e-06 -3.45682450e-05 2.11302091e-05 -2.36453257e-05 1.16121122e-04 -7.09359772e-05 -1.30098686e-05 -7.11294712e-06 4.34366074e-06 1.09506581e-05 -2.13388414e-05 3.30136560e-05 3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 -5.06876205e-05 -5.18708531e-06 -8.77935341e-05 -3.95377341e-06 -4.28088798e-05 -4.22604181e-06 2.11302091e-05 -1.20293553e-05 1.41871954e-05 -7.09359772e-05 4.04560801e-05 7.80592115e-06 4.34366074e-06 -2.47970899e-06 -7.32931955e-06 1.23985450e-05 -3.30136560e-05 -3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 5.06876205e-05 -5.18708531e-06 8.77935341e-05 4.39772254e-06 4.75690104e-05 2.62355898e-06 -2.36453257e-05 1.41871954e-05 -9.01114524e-06 7.91031105e-05 -4.74618663e-05 -9.57494961e-06 -2.89015053e-06 1.73409032e-06 7.88460418e-06 -1.47836328e-05 -2.39796963e-05 8.25086154e-05 1.79871070e-05 -1.79871070e-05 -2.19886127e-05 -2.37845052e-04 -2.36453257e-05 1.16121122e-04 -7.09359772e-05 7.91031105e-05 -3.88706075e-04 2.37309331e-04 4.43453012e-05 2.42318426e-05 -1.47836328e-05 -3.73852938e-05 7.26955279e-05 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 1.78648211e-04 1.79871070e-05 3.09427778e-04 1.31931676e-05 1.42707031e-04 1.41871954e-05 -7.09359772e-05 4.04560801e-05 -4.74618663e-05 2.37309331e-04 -1.35576122e-04 -2.66071807e-05 -1.47836328e-05 8.46263429e-06 2.48764488e-05 -4.23131714e-05 1.15322826e-04 1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 -1.78648211e-04 1.79871070e-05 -3.09427778e-04 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 1.30098686e-05 -7.80592115e-06 9.57494961e-06 -4.43453012e-05 2.66071807e-05 3.61548803e-06 1.99797541e-06 -1.19878524e-06 -3.12952049e-06 5.86785091e-06 -1.30101956e-05 -1.44682422e-04 5.06876205e-05 -5.06876205e-05 -1.78648211e-04 1.78648211e-04 2.10894554e-05 3.62362512e-05 -1.31803928e-06 -1.38997698e-05 -8.15449649e-07 7.11294712e-06 -4.34366074e-06 2.89015053e-06 -2.42318426e-05 1.47836328e-05 1.99797541e-06 9.59219321e-07 -5.71522584e-07 -1.69390265e-06 3.20700306e-06 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 4.26298824e-06 7.90823570e-07 8.33986187e-06 4.89269790e-07 -4.34366074e-06 2.47970899e-06 -1.73409032e-06 1.47836328e-05 -8.46263429e-06 -1.19878524e-06 -5.71522584e-07 3.49595231e-07 1.04545744e-06 -1.90867338e-06 -5.18708531e-06 1.79871070e-05 4.26298824e-06 -4.09454220e-06 2.10886285e-06 2.22396317e-05 2.31661906e-06 -1.09506581e-05 7.32931955e-06 -7.88460418e-06 3.73852938e-05 -2.48764488e-05 -3.12952049e-06 -1.69390265e-06 1.04545744e-06 2.59560990e-06 -5.15449757e-06 5.18708531e-06 5.18708531e-06 -1.79871070e-05 -1.79871070e-05 -8.35753044e-06 -3.95411785e-06 -4.16993094e-05 -4.34366074e-06 2.13388414e-05 -1.23985450e-05 1.47836328e-05 -7.26955279e-05 4.23131714e-05 5.86785091e-06 3.20700306e-06 -1.90867338e-06 -5.15449757e-06 9.51122747e-06 -2.25343198e-05 -2.50597306e-04 8.77935341e-05 -8.77935341e-05 -3.09427778e-04 3.09427778e-04 3.62362512e-05 6.29314743e-05 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 - 0 21 42 59 81 103 120 142 164 185 202 219 237 258 279 300 317 339 361 378 400 422 443 460 477 495 516 -0 -1 -2 169 - 1.25466617e-06 1.34349826e-05 6.58962236e-06 -1.31792447e-06 -3.95377341e-06 -2.19886127e-05 4.39772254e-06 1.31931676e-05 3.04388134e-06 -1.31803928e-06 -3.95411785e-06 -1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 7.13481329e-05 -1.42696266e-05 -4.28088798e-05 -2.37845052e-04 4.75690104e-05 1.42707031e-04 3.21001433e-05 -1.38997698e-05 -4.16993094e-05 -1.11198158e-05 8.33986187e-06 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 7.04340302e-06 2.11302091e-05 1.16121122e-04 -2.36453257e-05 -7.09359772e-05 -1.59884824e-05 7.11294712e-06 2.13388414e-05 5.79154766e-06 -4.34366074e-06 1.31792447e-06 1.42696266e-05 7.04340302e-06 -7.59910514e-07 -4.22604181e-06 -2.36453257e-05 2.62355898e-06 1.41871954e-05 3.41677917e-06 -8.15449649e-07 -4.34366074e-06 -1.28479698e-06 4.89269790e-07 3.95377341e-06 4.28088798e-05 2.11302091e-05 -4.22604181e-06 -1.20293553e-05 -7.09359772e-05 1.41871954e-05 4.04560801e-05 1.02503375e-05 -4.34366074e-06 -1.23985450e-05 -3.09546624e-06 2.47970899e-06 2.19886127e-05 2.37845052e-04 1.16121122e-04 -2.36453257e-05 -7.09359772e-05 -3.88706075e-04 7.91031105e-05 2.37309331e-04 5.45492648e-05 -2.42318426e-05 -7.26955279e-05 -1.97115105e-05 1.47836328e-05 -4.39772254e-06 -4.75690104e-05 -2.36453257e-05 2.62355898e-06 1.41871954e-05 7.91031105e-05 -9.01114524e-06 -4.74618663e-05 -1.16157423e-05 2.89015053e-06 1.47836328e-05 4.34984751e-06 -1.73409032e-06 -1.31931676e-05 -1.42707031e-04 -7.09359772e-05 1.41871954e-05 4.04560801e-05 2.37309331e-04 -4.74618663e-05 -1.35576122e-04 -3.48472270e-05 1.47836328e-05 4.23131714e-05 1.06042700e-05 -8.46263429e-06 3.04388134e-06 3.21001433e-05 1.59884824e-05 -3.41677917e-06 -1.02503375e-05 -5.45492648e-05 1.16157423e-05 3.48472270e-05 5.56082368e-06 -2.46595043e-06 -7.39785129e-06 -2.00638043e-06 1.50478532e-06 -1.31803928e-06 -1.38997698e-05 -7.11294712e-06 8.15449649e-07 4.34366074e-06 2.42318426e-05 -2.89015053e-06 -1.47836328e-05 -2.46595043e-06 9.59219321e-07 3.20700306e-06 8.83346132e-07 -5.71522584e-07 -3.95411785e-06 -4.16993094e-05 -2.13388414e-05 4.34366074e-06 1.23985450e-05 7.26955279e-05 -1.47836328e-05 -4.23131714e-05 -7.39785129e-06 3.20700306e-06 9.51122747e-06 2.50445917e-06 -1.90867338e-06 -1.05443143e-06 -1.11198158e-05 -5.79154766e-06 1.28479698e-06 3.09546624e-06 1.97115105e-05 -4.34984751e-06 -1.06042700e-05 -2.00638043e-06 8.83346132e-07 2.50445917e-06 6.50274256e-07 -5.15449757e-07 7.90823570e-07 8.33986187e-06 4.34366074e-06 -4.89269790e-07 -2.47970899e-06 -1.47836328e-05 1.73409032e-06 8.46263429e-06 1.50478532e-06 -5.71522584e-07 -1.90867338e-06 -5.15449757e-07 3.49595231e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 -0 -1 -1 471 - 1.70328256e-04 1.56710856e-03 6.51378048e-04 -3.25689024e-04 -3.25689024e-04 -2.13278108e-03 1.06639054e-03 1.06639054e-03 9.05613602e-05 -1.04571251e-04 -1.04571251e-04 5.22856257e-05 1.40271766e-02 6.79314330e-02 3.83997120e-02 -1.27999040e-02 -1.27999040e-02 -9.39695701e-02 3.13231900e-02 3.13231900e-02 -3.90015343e-03 2.53322396e-03 2.53322396e-03 -8.44407987e-04 1.56710856e-03 1.39613919e-02 5.79216869e-03 -2.89608434e-03 -2.89608434e-03 -1.87045190e-02 9.35225951e-03 9.35225951e-03 5.70753169e-04 -6.59048991e-04 -6.59048991e-04 3.29524496e-04 6.79314330e-02 1.60907873e-01 1.22953680e-01 -4.09845600e-02 -4.09845600e-02 -1.78426204e-01 5.94754012e-02 5.94754012e-02 -4.00211138e-02 2.59944760e-02 2.59944760e-02 -8.66482532e-03 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 1.28527532e-03 1.28527532e-03 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 -1.96268001e-04 3.07748924e-04 3.07748924e-04 -1.78209909e-04 -3.83997120e-02 -1.22953680e-01 -8.01243800e-02 3.21974808e-02 3.21974808e-02 1.50606551e-01 -6.28329901e-02 -6.28329901e-02 1.84441412e-02 -1.41362236e-02 -1.41362236e-02 5.28711521e-03 3.25689024e-04 2.89608434e-03 1.28527532e-03 -4.14019247e-04 -6.42637659e-04 -4.15611128e-03 1.31106178e-03 2.07805564e-03 1.82434463e-04 -8.08681204e-05 -1.78209909e-04 -4.86708945e-05 4.04340602e-05 1.27999040e-02 4.09845600e-02 3.21974808e-02 5.73556868e-03 -1.07324936e-02 -6.28329901e-02 -1.69480895e-02 2.09443300e-02 -9.13604602e-03 1.11749199e-04 5.28711521e-03 1.72512200e-03 -3.72497331e-05 3.25689024e-04 2.89608434e-03 1.28527532e-03 -6.42637659e-04 -4.14019247e-04 -4.15611128e-03 2.07805564e-03 1.31106178e-03 1.82434463e-04 -1.78209909e-04 -8.08681204e-05 4.86708945e-05 4.04340602e-05 1.27999040e-02 4.09845600e-02 3.21974808e-02 -1.07324936e-02 5.73556868e-03 -6.28329901e-02 2.09443300e-02 -1.69480895e-02 -9.13604602e-03 5.28711521e-03 1.11749199e-04 -1.72512200e-03 -3.72497331e-05 2.13278108e-03 1.87045190e-02 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 -2.41529920e-02 1.33621179e-02 1.33621179e-02 4.89198722e-04 -8.27434268e-04 -8.27434268e-04 4.92484006e-04 9.39695701e-02 1.78426204e-01 1.50606551e-01 -6.28329901e-02 -6.28329901e-02 -1.74532412e-01 8.26569598e-02 8.26569598e-02 -5.25781272e-02 4.25165420e-02 4.25165420e-02 -1.64031264e-02 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 1.31106178e-03 2.07805564e-03 1.33621179e-02 -4.10981523e-03 -6.68105894e-03 -5.17455810e-04 1.77416518e-04 4.92484006e-04 1.57533744e-04 -8.87082588e-05 -3.13231900e-02 -5.94754012e-02 -6.28329901e-02 -1.69480895e-02 2.09443300e-02 8.26569598e-02 4.58861475e-02 -2.75523199e-02 2.91183766e-02 3.67538539e-03 -1.64031264e-02 -6.69283727e-03 -1.22512846e-03 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 2.07805564e-03 1.31106178e-03 1.33621179e-02 -6.68105894e-03 -4.10981523e-03 -5.17455810e-04 4.92484006e-04 1.77416518e-04 -1.57533744e-04 -8.87082588e-05 -3.13231900e-02 -5.94754012e-02 -6.28329901e-02 2.09443300e-02 -1.69480895e-02 8.26569598e-02 -2.75523199e-02 4.58861475e-02 2.91183766e-02 -1.64031264e-02 3.67538539e-03 6.69283727e-03 -1.22512846e-03 9.05613602e-05 5.70753169e-04 1.96268001e-04 -1.82434463e-04 -1.82434463e-04 -4.89198722e-04 5.17455810e-04 5.17455810e-04 -8.99306349e-05 8.30889164e-05 8.30889164e-05 -3.38595206e-05 -3.90015343e-03 -4.00211138e-02 -1.84441412e-02 9.13604602e-03 9.13604602e-03 5.25781272e-02 -2.91183766e-02 -2.91183766e-02 6.04442117e-03 -2.70322369e-03 -2.70322369e-03 4.80114852e-04 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 8.08681204e-05 1.78209909e-04 8.27434268e-04 -1.77416518e-04 -4.92484006e-04 8.30889164e-05 -1.08000471e-04 -9.44638495e-05 8.87380160e-06 5.38872760e-05 2.53322396e-03 2.59944760e-02 1.41362236e-02 -1.11749199e-04 -5.28711521e-03 -4.25165420e-02 -3.67538539e-03 1.64031264e-02 -2.70322369e-03 3.36490998e-03 1.72541514e-03 -7.29123606e-04 -1.22324825e-03 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 1.78209909e-04 8.08681204e-05 8.27434268e-04 -4.92484006e-04 -1.77416518e-04 8.30889164e-05 -9.44638495e-05 -1.08000471e-04 -8.87380160e-06 5.38872760e-05 2.53322396e-03 2.59944760e-02 1.41362236e-02 -5.28711521e-03 -1.11749199e-04 -4.25165420e-02 1.64031264e-02 -3.67538539e-03 -2.70322369e-03 1.72541514e-03 3.36490998e-03 7.29123606e-04 -1.22324825e-03 4.86708945e-05 -4.86708945e-05 -1.57533744e-04 1.57533744e-04 8.87380160e-06 -8.87380160e-06 -4.66282012e-06 -1.72512200e-03 1.72512200e-03 6.69283727e-03 -6.69283727e-03 -7.29123606e-04 7.29123606e-04 -6.17935738e-05 5.22856257e-05 3.29524496e-04 1.78209909e-04 -4.04340602e-05 -4.04340602e-05 -4.92484006e-04 8.87082588e-05 8.87082588e-05 -3.38595206e-05 5.38872760e-05 5.38872760e-05 -2.71695573e-05 -8.44407987e-04 -8.66482532e-03 -5.28711521e-03 3.72497331e-05 3.72497331e-05 1.64031264e-02 1.22512846e-03 1.22512846e-03 4.80114852e-04 -1.22324825e-03 -1.22324825e-03 1.02914641e-04 1.70328256e-04 1.56710856e-03 6.51378048e-04 -3.25689024e-04 -3.25689024e-04 -2.13278108e-03 1.06639054e-03 1.06639054e-03 9.05613602e-05 -1.04571251e-04 -1.04571251e-04 5.22856257e-05 1.56710856e-03 1.39613919e-02 5.79216869e-03 -2.89608434e-03 -2.89608434e-03 -1.87045190e-02 9.35225951e-03 9.35225951e-03 5.70753169e-04 -6.59048991e-04 -6.59048991e-04 3.29524496e-04 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 1.28527532e-03 1.28527532e-03 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 -1.96268001e-04 3.07748924e-04 3.07748924e-04 -1.78209909e-04 3.25689024e-04 2.89608434e-03 1.28527532e-03 -4.14019247e-04 -6.42637659e-04 -4.15611128e-03 1.31106178e-03 2.07805564e-03 1.82434463e-04 -8.08681204e-05 -1.78209909e-04 -4.86708945e-05 4.04340602e-05 3.25689024e-04 2.89608434e-03 1.28527532e-03 -6.42637659e-04 -4.14019247e-04 -4.15611128e-03 2.07805564e-03 1.31106178e-03 1.82434463e-04 -1.78209909e-04 -8.08681204e-05 4.86708945e-05 4.04340602e-05 2.13278108e-03 1.87045190e-02 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 -2.41529920e-02 1.33621179e-02 1.33621179e-02 4.89198722e-04 -8.27434268e-04 -8.27434268e-04 4.92484006e-04 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 1.31106178e-03 2.07805564e-03 1.33621179e-02 -4.10981523e-03 -6.68105894e-03 -5.17455810e-04 1.77416518e-04 4.92484006e-04 1.57533744e-04 -8.87082588e-05 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 2.07805564e-03 1.31106178e-03 1.33621179e-02 -6.68105894e-03 -4.10981523e-03 -5.17455810e-04 4.92484006e-04 1.77416518e-04 -1.57533744e-04 -8.87082588e-05 9.05613602e-05 5.70753169e-04 1.96268001e-04 -1.82434463e-04 -1.82434463e-04 -4.89198722e-04 5.17455810e-04 5.17455810e-04 -8.99306349e-05 8.30889164e-05 8.30889164e-05 -3.38595206e-05 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 8.08681204e-05 1.78209909e-04 8.27434268e-04 -1.77416518e-04 -4.92484006e-04 8.30889164e-05 -1.08000471e-04 -9.44638495e-05 8.87380160e-06 5.38872760e-05 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 1.78209909e-04 8.08681204e-05 8.27434268e-04 -4.92484006e-04 -1.77416518e-04 8.30889164e-05 -9.44638495e-05 -1.08000471e-04 -8.87380160e-06 5.38872760e-05 4.86708945e-05 -4.86708945e-05 -1.57533744e-04 1.57533744e-04 8.87380160e-06 -8.87380160e-06 -4.66282012e-06 5.22856257e-05 3.29524496e-04 1.78209909e-04 -4.04340602e-05 -4.04340602e-05 -4.92484006e-04 8.87082588e-05 8.87082588e-05 -3.38595206e-05 5.38872760e-05 5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 16 17 19 20 22 23 24 13 14 15 16 17 18 19 20 21 22 23 25 - 0 24 48 72 98 124 148 174 200 224 250 276 290 314 326 338 350 363 376 388 401 414 426 439 452 459 471 -0 -1 0 516 - 3.91348915e-02 1.43320629e-01 7.02734648e-02 -7.02734648e-02 -1.48982977e-01 1.48982977e-01 -6.10770759e-03 2.11577197e-02 -1.05788599e-02 2.64027557e-01 3.35702802e-01 2.34088114e-01 -2.34088114e-01 2.34088114e-01 -2.32521472e-01 2.32521472e-01 -2.32521472e-01 1.17443083e-01 -1.17443083e-01 1.17443083e-01 1.43320629e-01 2.06957410e-01 1.43523909e-01 -1.43523909e-01 -1.50473058e-01 1.50473058e-01 -1.38680201e-02 4.80402309e-02 -2.40201155e-02 3.35702802e-01 2.76220067e-01 4.62745275e-02 -4.62745275e-02 4.62745275e-02 -8.52749857e-02 8.52749857e-02 -8.52749857e-02 -9.22774953e-02 9.22774953e-02 -9.22774953e-02 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 -6.79089450e-04 -4.18480142e-02 2.82907486e-02 -2.34088114e-01 -4.62745275e-02 5.08041420e-02 1.96806662e-01 -1.96806662e-01 -1.84251812e-01 -7.23859503e-02 7.23859503e-02 -1.26391054e-01 -2.67331842e-02 2.67331842e-02 -1.36191048e-01 7.02734648e-02 1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 -2.48400517e-02 4.18480142e-02 -1.35572656e-02 2.34088114e-01 4.62745275e-02 1.96806662e-01 5.08041420e-02 1.96806662e-01 -7.23859503e-02 -1.84251812e-01 -7.23859503e-02 -6.31955270e-02 2.67331842e-02 -1.36191048e-01 1.09457864e-01 2.67331842e-02 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 1.47334830e-02 -2.34088114e-01 -4.62745275e-02 -1.96806662e-01 1.96806662e-01 5.08041420e-02 7.23859503e-02 -7.23859503e-02 -1.84251812e-01 6.31955270e-02 -1.36191048e-01 2.67331842e-02 1.09457864e-01 -2.67331842e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 1.91463231e-02 4.52539972e-02 -4.12234663e-02 2.32521472e-01 8.52749857e-02 -1.84251812e-01 -7.23859503e-02 7.23859503e-02 1.72059579e-01 9.02854717e-02 -9.02854717e-02 2.86829339e-02 -8.36706010e-02 8.36706010e-02 -5.88304515e-02 -1.48982977e-01 -1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 4.52737305e-02 -4.52539972e-02 4.03053096e-03 -2.32521472e-01 -8.52749857e-02 -7.23859503e-02 -1.84251812e-01 -7.23859503e-02 9.02854717e-02 1.72059579e-01 9.02854717e-02 1.43414670e-02 8.36706010e-02 -5.88304515e-02 -2.48401494e-02 8.36706010e-02 -8.47000309e-02 1.23301560e-01 3.71929353e-02 -3.71929353e-02 2.32521472e-01 8.52749857e-02 7.23859503e-02 -7.23859503e-02 -1.84251812e-01 -9.02854717e-02 9.02854717e-02 1.72059579e-01 -1.43414670e-02 -5.88304515e-02 8.36706010e-02 -2.48401494e-02 -8.36706010e-02 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 2.48400517e-02 -1.91463231e-02 -4.52737305e-02 -7.67653617e-03 -1.41589240e-02 1.39049485e-02 1.26391054e-01 6.31955270e-02 -6.31955270e-02 -2.86829339e-02 -1.43414670e-02 1.43414670e-02 -1.36861292e-01 5.81908714e-02 -5.81908714e-02 -1.16381743e-01 2.11577197e-02 4.80402309e-02 4.18480142e-02 -4.18480142e-02 -4.52539972e-02 4.52539972e-02 -1.41589240e-02 4.91061754e-02 -2.45239757e-02 1.17443083e-01 -9.22774953e-02 2.67331842e-02 -2.67331842e-02 1.36191048e-01 8.36706010e-02 -8.36706010e-02 5.88304515e-02 5.81908714e-02 2.75756579e-02 -6.36474041e-02 1.00789546e-01 6.36474041e-02 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 7.88139292e-03 -1.17443083e-01 9.22774953e-02 -2.67331842e-02 1.36191048e-01 -2.67331842e-02 -8.36706010e-02 5.88304515e-02 -8.36706010e-02 -5.81908714e-02 -6.36474041e-02 2.75756579e-02 1.00789546e-01 -6.36474041e-02 -1.05788599e-02 -2.40201155e-02 -2.82907486e-02 1.35572656e-02 4.12234663e-02 -4.03053096e-03 1.39049485e-02 -2.45239757e-02 8.37951533e-03 -1.09457864e-01 -1.09457864e-01 2.48401494e-02 2.48401494e-02 1.00789546e-01 1.00789546e-01 -1.36861292e-01 -1.47334830e-02 3.71929353e-02 7.88139292e-03 -7.82316899e-03 1.17443083e-01 -9.22774953e-02 1.36191048e-01 -2.67331842e-02 2.67331842e-02 5.88304515e-02 -8.36706010e-02 8.36706010e-02 -1.16381743e-01 6.36474041e-02 -6.36474041e-02 2.75756579e-02 9.03813139e-04 6.83095219e-03 2.52992999e-03 -2.52992999e-03 -8.43309998e-04 -7.57080511e-03 7.57080511e-03 2.52360170e-03 5.05224374e-05 -1.96891714e-04 -6.56305714e-05 8.75074285e-05 6.56305714e-05 3.91348915e-02 1.43320629e-01 7.02734648e-02 -7.02734648e-02 -1.48982977e-01 1.48982977e-01 -6.10770759e-03 2.11577197e-02 -1.05788599e-02 6.83095219e-03 4.49022829e-02 1.71775766e-02 -1.71775766e-02 -5.72585887e-03 -4.75796841e-02 4.75796841e-02 1.58598947e-02 -5.20652809e-04 2.02904352e-03 6.76347839e-04 -9.01797119e-04 -6.76347839e-04 1.43320629e-01 2.06957410e-01 1.43523909e-01 -1.43523909e-01 -1.50473058e-01 1.50473058e-01 -1.38680201e-02 4.80402309e-02 -2.40201155e-02 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 7.14718976e-03 2.38239659e-03 1.66087992e-02 -2.03525482e-02 -6.78418274e-03 2.12097053e-04 -3.76334544e-04 -1.25444848e-04 1.10087490e-04 8.25656177e-05 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 -6.79089450e-04 -4.18480142e-02 2.82907486e-02 2.52992999e-03 1.71775766e-02 7.14718976e-03 -5.92699644e-03 -2.38239659e-03 -2.03525482e-02 1.66087992e-02 6.78418274e-03 1.07099635e-05 3.76334544e-04 8.25656177e-05 -2.38725181e-04 -1.25444848e-04 7.02734648e-02 1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 -2.48400517e-02 4.18480142e-02 -1.35572656e-02 8.43309998e-04 5.72585887e-03 2.38239659e-03 -2.38239659e-03 4.26061120e-04 -6.78418274e-03 6.78418274e-03 -1.48235482e-03 3.56998782e-06 8.25656177e-05 1.56159564e-04 6.18340029e-06 -1.56159564e-04 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 1.47334830e-02 7.57080511e-03 4.75796841e-02 1.66087992e-02 -2.03525482e-02 -6.78418274e-03 -4.42337068e-02 5.55393321e-02 1.85131107e-02 -9.60604637e-04 3.07040317e-03 1.02346772e-03 -1.27914009e-03 -9.59355067e-04 1.48982977e-01 1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 1.91463231e-02 4.52539972e-02 -4.12234663e-02 -7.57080511e-03 -4.75796841e-02 -2.03525482e-02 1.66087992e-02 6.78418274e-03 5.55393321e-02 -4.42337068e-02 -1.85131107e-02 6.27465494e-04 -3.07040317e-03 -9.59355067e-04 1.47147806e-03 1.02346772e-03 -1.48982977e-01 -1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 4.52737305e-02 -4.52539972e-02 4.03053096e-03 -2.52360170e-03 -1.58598947e-02 -6.78418274e-03 6.78418274e-03 -1.48235482e-03 1.85131107e-02 -1.85131107e-02 5.13458842e-03 2.09155165e-04 -9.59355067e-04 -5.12122996e-04 3.62267372e-04 5.12122996e-04 -8.47000309e-02 1.23301560e-01 3.71929353e-02 -3.71929353e-02 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 -1.07099635e-05 -3.56998782e-06 9.60604637e-04 -6.27465494e-04 -2.09155165e-04 1.78917197e-04 3.48805533e-04 1.16268511e-04 -2.92334169e-04 -2.19250627e-04 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 2.48400517e-02 -1.91463231e-02 -4.52737305e-02 -7.67653617e-03 -1.41589240e-02 1.39049485e-02 -1.96891714e-04 2.02904352e-03 3.76334544e-04 -3.76334544e-04 -8.25656177e-05 -3.07040317e-03 3.07040317e-03 9.59355067e-04 3.48805533e-04 -1.41297171e-03 -5.27432619e-04 6.04148906e-04 5.27432619e-04 2.11577197e-02 4.80402309e-02 4.18480142e-02 -4.18480142e-02 -4.52539972e-02 4.52539972e-02 -1.41589240e-02 4.91061754e-02 -2.45239757e-02 -6.56305714e-05 6.76347839e-04 1.25444848e-04 -8.25656177e-05 -1.56159564e-04 -1.02346772e-03 9.59355067e-04 5.12122996e-04 1.16268511e-04 -5.27432619e-04 -6.48472168e-06 3.20296473e-04 1.72595341e-05 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 7.88139292e-03 8.75074285e-05 -9.01797119e-04 -1.10087490e-04 2.38725181e-04 -6.18340029e-06 1.27914009e-03 -1.47147806e-03 -3.62267372e-04 -2.92334169e-04 6.04148906e-04 3.20296473e-04 -1.58641225e-04 -2.60839721e-04 -1.05788599e-02 -2.40201155e-02 -2.82907486e-02 1.35572656e-02 4.12234663e-02 -4.03053096e-03 1.39049485e-02 -2.45239757e-02 8.37951533e-03 6.56305714e-05 -6.76347839e-04 -8.25656177e-05 1.25444848e-04 1.56159564e-04 9.59355067e-04 -1.02346772e-03 -5.12122996e-04 -2.19250627e-04 5.27432619e-04 1.72595341e-05 -2.60839721e-04 -6.48472168e-06 -1.47334830e-02 3.71929353e-02 7.88139292e-03 -7.82316899e-03 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 15 16 17 18 19 20 21 22 23 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 16 17 19 20 22 23 24 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 - 0 20 40 61 83 100 121 143 160 179 201 218 234 250 272 294 316 338 355 377 399 416 438 460 477 499 516 -0 -1 1 516 - 3.91348915e-02 1.43320629e-01 -7.02734648e-02 7.02734648e-02 1.48982977e-01 -1.48982977e-01 1.22154152e-02 2.11577197e-02 1.40271766e-02 6.79314330e-02 -1.27999040e-02 -1.27999040e-02 3.83997120e-02 3.13231900e-02 3.13231900e-02 -9.39695701e-02 1.95007672e-03 -8.44407987e-04 2.53322396e-03 3.37763195e-03 2.53322396e-03 1.43320629e-01 2.06957410e-01 -1.43523909e-01 1.43523909e-01 1.50473058e-01 -1.50473058e-01 2.77360403e-02 4.80402309e-02 6.79314330e-02 1.60907873e-01 -4.09845600e-02 -4.09845600e-02 1.22953680e-01 5.94754012e-02 5.94754012e-02 -1.78426204e-01 2.00105569e-02 -8.66482532e-03 2.59944760e-02 3.46593013e-02 2.59944760e-02 4.35912107e-02 -8.47000309e-02 1.47334830e-02 -1.47334830e-02 1.27999040e-02 4.09845600e-02 5.73556868e-03 -1.07324936e-02 3.21974808e-02 -1.69480895e-02 2.09443300e-02 -6.28329901e-02 6.06202249e-03 -3.72497331e-05 1.11749199e-04 7.04948694e-03 5.28711521e-03 7.02734648e-02 1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 2.41609623e-02 1.47334830e-02 4.18480142e-02 1.27999040e-02 4.09845600e-02 -1.07324936e-02 5.73556868e-03 3.21974808e-02 2.09443300e-02 -1.69480895e-02 -6.28329901e-02 3.07402353e-03 -3.72497331e-05 5.28711521e-03 8.77460895e-03 1.11749199e-04 -7.02734648e-02 -1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 -2.41609623e-02 1.47334830e-02 -4.18480142e-02 -3.83997120e-02 -1.22953680e-01 3.21974808e-02 3.21974808e-02 -8.01243800e-02 -6.28329901e-02 -6.28329901e-02 1.50606551e-01 -9.22207060e-03 5.28711521e-03 -1.41362236e-02 -1.59730948e-02 -1.41362236e-02 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 3.71929353e-02 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 2.09443300e-02 -6.28329901e-02 4.58861475e-02 -2.75523199e-02 8.26569598e-02 -2.03553554e-02 -1.22512846e-03 3.67538539e-03 -2.18708352e-02 -1.64031264e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 -2.61274075e-02 -3.71929353e-02 -4.52539972e-02 -3.13231900e-02 -5.94754012e-02 2.09443300e-02 -1.69480895e-02 -6.28329901e-02 -2.75523199e-02 4.58861475e-02 8.26569598e-02 -8.76302120e-03 -1.22512846e-03 -1.64031264e-02 -2.85636725e-02 3.67538539e-03 1.48982977e-01 1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 2.61274075e-02 -3.71929353e-02 4.52539972e-02 9.39695701e-02 1.78426204e-01 -6.28329901e-02 -6.28329901e-02 1.50606551e-01 8.26569598e-02 8.26569598e-02 -1.74532412e-01 2.62890636e-02 -1.64031264e-02 4.25165420e-02 4.55339938e-02 4.25165420e-02 1.22154152e-02 2.77360403e-02 -2.41609623e-02 2.41609623e-02 2.61274075e-02 -2.61274075e-02 1.64075411e-02 2.83178480e-02 1.95007672e-03 2.00105569e-02 -6.06202249e-03 -3.07402353e-03 9.22207060e-03 2.03553554e-02 8.76302120e-03 -2.62890636e-02 1.46476011e-03 -2.40057426e-04 7.20172278e-04 2.64406855e-03 1.98305141e-03 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 7.88139292e-03 -8.44407987e-04 -8.66482532e-03 3.72497331e-05 3.72497331e-05 -5.28711521e-03 1.22512846e-03 1.22512846e-03 1.64031264e-02 -2.40057426e-04 1.02914641e-04 -1.22324825e-03 -4.15791659e-04 -1.22324825e-03 1.47334830e-02 -3.71929353e-02 7.88139292e-03 -7.82316899e-03 2.53322396e-03 2.59944760e-02 -1.11749199e-04 -5.28711521e-03 1.41362236e-02 -3.67538539e-03 1.64031264e-02 -4.25165420e-02 7.20172278e-04 -1.22324825e-03 3.36490998e-03 2.70562219e-03 1.72541514e-03 -1.47334830e-02 -1.47334830e-02 3.71929353e-02 3.71929353e-02 -1.57045619e-02 3.37763195e-03 3.46593013e-02 -7.04948694e-03 -8.77460895e-03 1.59730948e-02 2.18708352e-02 2.85636725e-02 -4.55339938e-02 2.64406855e-03 -4.15791659e-04 2.70562219e-03 4.51786749e-03 1.97649858e-03 2.11577197e-02 4.80402309e-02 -4.18480142e-02 4.18480142e-02 4.52539972e-02 -4.52539972e-02 2.83178480e-02 4.91061754e-02 2.53322396e-03 2.59944760e-02 -5.28711521e-03 -1.11749199e-04 1.41362236e-02 1.64031264e-02 -3.67538539e-03 -4.25165420e-02 1.98305141e-03 -1.22324825e-03 1.72541514e-03 1.97649858e-03 3.36490998e-03 1.40271766e-02 6.79314330e-02 1.27999040e-02 -3.83997120e-02 1.27999040e-02 -3.13231900e-02 9.39695701e-02 -3.13231900e-02 1.95007672e-03 2.53322396e-03 -8.44407987e-04 -3.37763195e-03 2.53322396e-03 3.91348915e-02 1.43320629e-01 -7.02734648e-02 7.02734648e-02 1.48982977e-01 -1.48982977e-01 1.22154152e-02 2.11577197e-02 6.79314330e-02 1.60907873e-01 4.09845600e-02 -1.22953680e-01 4.09845600e-02 -5.94754012e-02 1.78426204e-01 -5.94754012e-02 2.00105569e-02 2.59944760e-02 -8.66482532e-03 -3.46593013e-02 2.59944760e-02 1.43320629e-01 2.06957410e-01 -1.43523909e-01 1.43523909e-01 1.50473058e-01 -1.50473058e-01 2.77360403e-02 4.80402309e-02 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 3.21974808e-02 -1.07324936e-02 -1.69480895e-02 -6.28329901e-02 2.09443300e-02 -6.06202249e-03 -1.11749199e-04 3.72497331e-05 7.04948694e-03 -5.28711521e-03 4.35912107e-02 -8.47000309e-02 1.47334830e-02 -1.47334830e-02 3.83997120e-02 1.22953680e-01 3.21974808e-02 -8.01243800e-02 3.21974808e-02 -6.28329901e-02 1.50606551e-01 -6.28329901e-02 9.22207060e-03 1.41362236e-02 -5.28711521e-03 -1.59730948e-02 1.41362236e-02 7.02734648e-02 1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 2.41609623e-02 1.47334830e-02 4.18480142e-02 -1.27999040e-02 -4.09845600e-02 -1.07324936e-02 3.21974808e-02 5.73556868e-03 2.09443300e-02 -6.28329901e-02 -1.69480895e-02 -3.07402353e-03 -5.28711521e-03 3.72497331e-05 8.77460895e-03 -1.11749199e-04 -7.02734648e-02 -1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 -2.41609623e-02 1.47334830e-02 -4.18480142e-02 3.13231900e-02 5.94754012e-02 -1.69480895e-02 -6.28329901e-02 2.09443300e-02 4.58861475e-02 8.26569598e-02 -2.75523199e-02 2.03553554e-02 -3.67538539e-03 1.22512846e-03 -2.18708352e-02 1.64031264e-02 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 3.71929353e-02 -9.39695701e-02 -1.78426204e-01 -6.28329901e-02 1.50606551e-01 -6.28329901e-02 8.26569598e-02 -1.74532412e-01 8.26569598e-02 -2.62890636e-02 -4.25165420e-02 1.64031264e-02 4.55339938e-02 -4.25165420e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 -2.61274075e-02 -3.71929353e-02 -4.52539972e-02 3.13231900e-02 5.94754012e-02 2.09443300e-02 -6.28329901e-02 -1.69480895e-02 -2.75523199e-02 8.26569598e-02 4.58861475e-02 8.76302120e-03 1.64031264e-02 1.22512846e-03 -2.85636725e-02 -3.67538539e-03 1.48982977e-01 1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 2.61274075e-02 -3.71929353e-02 4.52539972e-02 1.95007672e-03 2.00105569e-02 6.06202249e-03 -9.22207060e-03 3.07402353e-03 -2.03553554e-02 2.62890636e-02 -8.76302120e-03 1.46476011e-03 7.20172278e-04 -2.40057426e-04 -2.64406855e-03 1.98305141e-03 1.22154152e-02 2.77360403e-02 -2.41609623e-02 2.41609623e-02 2.61274075e-02 -2.61274075e-02 1.64075411e-02 2.83178480e-02 2.53322396e-03 2.59944760e-02 1.11749199e-04 -1.41362236e-02 5.28711521e-03 3.67538539e-03 4.25165420e-02 -1.64031264e-02 7.20172278e-04 3.36490998e-03 -1.22324825e-03 -2.70562219e-03 1.72541514e-03 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 7.88139292e-03 -8.44407987e-04 -8.66482532e-03 -3.72497331e-05 5.28711521e-03 -3.72497331e-05 -1.22512846e-03 -1.64031264e-02 -1.22512846e-03 -2.40057426e-04 -1.22324825e-03 1.02914641e-04 4.15791659e-04 -1.22324825e-03 1.47334830e-02 -3.71929353e-02 7.88139292e-03 -7.82316899e-03 -3.37763195e-03 -3.46593013e-02 -7.04948694e-03 1.59730948e-02 -8.77460895e-03 2.18708352e-02 -4.55339938e-02 2.85636725e-02 -2.64406855e-03 -2.70562219e-03 4.15791659e-04 4.51786749e-03 -1.97649858e-03 -1.47334830e-02 -1.47334830e-02 3.71929353e-02 3.71929353e-02 -1.57045619e-02 2.53322396e-03 2.59944760e-02 5.28711521e-03 -1.41362236e-02 1.11749199e-04 -1.64031264e-02 4.25165420e-02 3.67538539e-03 1.98305141e-03 1.72541514e-03 -1.22324825e-03 -1.97649858e-03 3.36490998e-03 2.11577197e-02 4.80402309e-02 -4.18480142e-02 4.18480142e-02 4.52539972e-02 -4.52539972e-02 2.83178480e-02 4.91061754e-02 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 - 0 21 42 59 81 103 120 142 164 185 202 219 237 258 279 300 317 339 361 378 400 422 443 460 477 495 516 -0 -1 2 664 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -3.25689024e-04 6.51378048e-04 1.06639054e-03 1.06639054e-03 -2.13278108e-03 -4.52806801e-05 5.22856257e-05 -1.04571251e-04 -7.84284385e-05 -1.04571251e-04 1.25466617e-06 1.34349826e-05 -3.95377341e-06 -1.31792447e-06 6.58962236e-06 1.31931676e-05 4.39772254e-06 -2.19886127e-05 -6.08776268e-07 7.90823570e-07 -3.95411785e-06 -3.16329428e-06 -1.31803928e-06 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -2.89608434e-03 5.79216869e-03 9.35225951e-03 9.35225951e-03 -1.87045190e-02 -2.85376584e-04 3.29524496e-04 -6.59048991e-04 -4.94286743e-04 -6.59048991e-04 1.34349826e-05 1.43209127e-04 -4.28088798e-05 -1.42696266e-05 7.13481329e-05 1.42707031e-04 4.75690104e-05 -2.37845052e-04 -6.42002866e-06 8.33986187e-06 -4.16993094e-05 -3.33594475e-05 -1.38997698e-05 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -6.42637659e-04 1.28527532e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 -1.33367462e-04 4.04340602e-05 -8.08681204e-05 -1.33657432e-04 -1.78209909e-04 3.95377341e-06 4.28088798e-05 -1.20293553e-05 -4.22604181e-06 2.11302091e-05 4.04560801e-05 1.41871954e-05 -7.09359772e-05 -2.44441635e-06 2.47970899e-06 -1.23985450e-05 -1.04247858e-05 -4.34366074e-06 3.25689024e-04 2.89608434e-03 -6.42637659e-04 -4.14019247e-04 1.28527532e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 -4.90670003e-05 4.04340602e-05 -1.78209909e-04 -1.82328327e-04 -8.08681204e-05 1.31792447e-06 1.42696266e-05 -4.22604181e-06 -7.59910514e-07 7.04340302e-06 1.41871954e-05 2.62355898e-06 -2.36453257e-05 -5.95722755e-07 4.89269790e-07 -4.34366074e-06 -3.60141605e-06 -8.15449649e-07 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 1.28527532e-03 -2.34193222e-03 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 9.81340007e-05 -1.78209909e-04 3.07748924e-04 1.69973075e-04 3.07748924e-04 -6.58962236e-06 -7.13481329e-05 2.11302091e-05 7.04340302e-06 -3.45682450e-05 -7.09359772e-05 -2.36453257e-05 1.16121122e-04 2.97861377e-06 -4.34366074e-06 2.13388414e-05 1.67422057e-05 7.11294712e-06 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 -4.10981523e-03 -6.68105894e-03 1.33621179e-02 3.95156129e-04 -8.87082588e-05 1.77416518e-04 3.69363005e-04 4.92484006e-04 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 1.41871954e-05 -7.09359772e-05 -1.35576122e-04 -4.74618663e-05 2.37309331e-04 8.24004626e-06 -8.46263429e-06 4.23131714e-05 3.54807188e-05 1.47836328e-05 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 -6.68105894e-03 -4.10981523e-03 1.33621179e-02 1.22299680e-04 -8.87082588e-05 4.92484006e-04 5.26896749e-04 1.77416518e-04 -4.39772254e-06 -4.75690104e-05 1.41871954e-05 2.62355898e-06 -2.36453257e-05 -4.74618663e-05 -9.01114524e-06 7.91031105e-05 2.04079272e-06 -1.73409032e-06 1.47836328e-05 1.22344517e-05 2.89015053e-06 2.13278108e-03 1.87045190e-02 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 1.33621179e-02 1.33621179e-02 -2.41529920e-02 -2.44599361e-04 4.92484006e-04 -8.27434268e-04 -4.23658521e-04 -8.27434268e-04 2.19886127e-05 2.37845052e-04 -7.09359772e-05 -2.36453257e-05 1.16121122e-04 2.37309331e-04 7.91031105e-05 -3.88706075e-04 -1.02039636e-05 1.47836328e-05 -7.26955279e-05 -5.70968043e-05 -2.42318426e-05 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 4.90670003e-05 -9.81340007e-05 -3.95156129e-04 -1.22299680e-04 2.44599361e-04 -2.59797738e-05 1.69297603e-05 -3.38595206e-05 -3.69220468e-05 -4.92293958e-05 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 5.95722755e-07 -2.97861377e-06 -8.24004626e-06 -2.04079272e-06 1.02039636e-05 1.40335193e-07 -3.06000076e-07 1.53000038e-06 1.12314006e-06 4.67975025e-07 5.22856257e-05 3.29524496e-04 -4.04340602e-05 -4.04340602e-05 1.78209909e-04 8.87082588e-05 8.87082588e-05 -4.92484006e-04 1.69297603e-05 -2.71695573e-05 5.38872760e-05 2.93232050e-05 5.38872760e-05 7.90823570e-07 8.33986187e-06 -2.47970899e-06 -4.89269790e-07 4.34366074e-06 8.46263429e-06 1.73409032e-06 -1.47836328e-05 -3.06000076e-07 3.49595231e-07 -1.90867338e-06 -1.56090719e-06 -5.71522584e-07 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 1.78209909e-04 -3.07748924e-04 -1.77416518e-04 -4.92484006e-04 8.27434268e-04 -3.38595206e-05 5.38872760e-05 -1.08000471e-04 -7.63940131e-05 -9.44638495e-05 -3.95411785e-06 -4.16993094e-05 1.23985450e-05 4.34366074e-06 -2.13388414e-05 -4.23131714e-05 -1.47836328e-05 7.26955279e-05 1.53000038e-06 -1.90867338e-06 9.51122747e-06 7.65895674e-06 3.20700306e-06 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 1.82328327e-04 -1.69973075e-04 -3.69363005e-04 -5.26896749e-04 4.23658521e-04 -3.69220468e-05 2.93232050e-05 -7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -3.16329428e-06 -3.33594475e-05 1.04247858e-05 3.60141605e-06 -1.67422057e-05 -3.54807188e-05 -1.22344517e-05 5.70968043e-05 1.12314006e-06 -1.56090719e-06 7.65895674e-06 6.07076274e-06 2.57724878e-06 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 8.08681204e-05 -3.07748924e-04 -4.92484006e-04 -1.77416518e-04 8.27434268e-04 -4.92293958e-05 5.38872760e-05 -9.44638495e-05 -6.75202116e-05 -1.08000471e-04 -1.31803928e-06 -1.38997698e-05 4.34366074e-06 8.15449649e-07 -7.11294712e-06 -1.47836328e-05 -2.89015053e-06 2.42318426e-05 4.67975025e-07 -5.71522584e-07 3.20700306e-06 2.57724878e-06 9.59219321e-07 9.03813139e-04 6.83095219e-03 -8.43309998e-04 -2.52992999e-03 2.52992999e-03 2.52360170e-03 7.57080511e-03 -7.57080511e-03 -1.01044875e-04 6.56305714e-05 -6.56305714e-05 -1.96891714e-04 1.70328256e-04 1.56710856e-03 -3.25689024e-04 -3.25689024e-04 6.51378048e-04 1.06639054e-03 1.06639054e-03 -2.13278108e-03 -4.52806801e-05 5.22856257e-05 -1.04571251e-04 -7.84284385e-05 -1.04571251e-04 6.83095219e-03 4.49022829e-02 -5.72585887e-03 -1.71775766e-02 1.71775766e-02 1.58598947e-02 4.75796841e-02 -4.75796841e-02 1.04130562e-03 -6.76347839e-04 6.76347839e-04 2.02904352e-03 1.56710856e-03 1.39613919e-02 -2.89608434e-03 -2.89608434e-03 5.79216869e-03 9.35225951e-03 9.35225951e-03 -1.87045190e-02 -2.85376584e-04 3.29524496e-04 -6.59048991e-04 -4.94286743e-04 -6.59048991e-04 8.43309998e-04 5.72585887e-03 4.26061120e-04 -2.38239659e-03 2.38239659e-03 -1.48235482e-03 6.78418274e-03 -6.78418274e-03 -7.13997564e-06 -1.56159564e-04 1.56159564e-04 8.25656177e-05 3.25689024e-04 2.89608434e-03 -4.14019247e-04 -6.42637659e-04 1.28527532e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 -1.33367462e-04 4.04340602e-05 -8.08681204e-05 -1.33657432e-04 -1.78209909e-04 2.52992999e-03 1.71775766e-02 -2.38239659e-03 -5.92699644e-03 7.14718976e-03 6.78418274e-03 1.66087992e-02 -2.03525482e-02 2.01387090e-04 -1.25444848e-04 8.25656177e-05 -1.28637691e-04 3.76334544e-04 3.25689024e-04 2.89608434e-03 -6.42637659e-04 -4.14019247e-04 1.28527532e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 -4.90670003e-05 4.04340602e-05 -1.78209909e-04 -1.82328327e-04 -8.08681204e-05 -2.52992999e-03 -1.71775766e-02 2.38239659e-03 7.14718976e-03 -5.92699644e-03 -6.78418274e-03 -2.03525482e-02 1.66087992e-02 -2.01387090e-04 8.25656177e-05 -1.25444848e-04 -1.28637691e-04 -3.76334544e-04 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 1.28527532e-03 -2.34193222e-03 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 9.81340007e-05 -1.78209909e-04 3.07748924e-04 1.69973075e-04 3.07748924e-04 -2.52360170e-03 -1.58598947e-02 -1.48235482e-03 6.78418274e-03 -6.78418274e-03 5.13458842e-03 -1.85131107e-02 1.85131107e-02 -4.18310329e-04 5.12122996e-04 -5.12122996e-04 -9.59355067e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 -4.10981523e-03 -6.68105894e-03 1.33621179e-02 3.95156129e-04 -8.87082588e-05 1.77416518e-04 3.69363005e-04 4.92484006e-04 -7.57080511e-03 -4.75796841e-02 6.78418274e-03 1.66087992e-02 -2.03525482e-02 -1.85131107e-02 -4.42337068e-02 5.55393321e-02 -1.58807013e-03 1.02346772e-03 -9.59355067e-04 1.92337974e-04 -3.07040317e-03 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 -6.68105894e-03 -4.10981523e-03 1.33621179e-02 1.22299680e-04 -8.87082588e-05 4.92484006e-04 5.26896749e-04 1.77416518e-04 7.57080511e-03 4.75796841e-02 -6.78418274e-03 -2.03525482e-02 1.66087992e-02 1.85131107e-02 5.55393321e-02 -4.42337068e-02 1.58807013e-03 -9.59355067e-04 1.02346772e-03 1.92337974e-04 3.07040317e-03 2.13278108e-03 1.87045190e-02 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 1.33621179e-02 1.33621179e-02 -2.41529920e-02 -2.44599361e-04 4.92484006e-04 -8.27434268e-04 -4.23658521e-04 -8.27434268e-04 -1.01044875e-04 1.04130562e-03 7.13997564e-06 -2.01387090e-04 2.01387090e-04 4.18310329e-04 1.58807013e-03 -1.58807013e-03 -3.27420436e-04 3.35519138e-04 -3.35519138e-04 -6.97611067e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 4.90670003e-05 -9.81340007e-05 -3.95156129e-04 -1.22299680e-04 2.44599361e-04 -2.59797738e-05 1.69297603e-05 -3.38595206e-05 -3.69220468e-05 -4.92293958e-05 6.56305714e-05 -6.76347839e-04 1.56159564e-04 1.25444848e-04 -8.25656177e-05 -5.12122996e-04 -1.02346772e-03 9.59355067e-04 3.35519138e-04 -6.48472168e-06 1.72595341e-05 5.94567521e-05 5.27432619e-04 5.22856257e-05 3.29524496e-04 -4.04340602e-05 -4.04340602e-05 1.78209909e-04 8.87082588e-05 8.87082588e-05 -4.92484006e-04 1.69297603e-05 -2.71695573e-05 5.38872760e-05 2.93232050e-05 5.38872760e-05 -6.56305714e-05 6.76347839e-04 -1.56159564e-04 -8.25656177e-05 1.25444848e-04 5.12122996e-04 9.59355067e-04 -1.02346772e-03 -3.35519138e-04 1.72595341e-05 -6.48472168e-06 5.94567521e-05 -5.27432619e-04 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 1.78209909e-04 -3.07748924e-04 -1.77416518e-04 -4.92484006e-04 8.27434268e-04 -3.38595206e-05 5.38872760e-05 -1.08000471e-04 -7.63940131e-05 -9.44638495e-05 1.28637691e-04 1.28637691e-04 -1.92337974e-04 -1.92337974e-04 5.94567521e-05 5.94567521e-05 3.47696408e-04 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 1.82328327e-04 -1.69973075e-04 -3.69363005e-04 -5.26896749e-04 4.23658521e-04 -3.69220468e-05 2.93232050e-05 -7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -1.96891714e-04 2.02904352e-03 -8.25656177e-05 -3.76334544e-04 3.76334544e-04 9.59355067e-04 3.07040317e-03 -3.07040317e-03 -6.97611067e-04 5.27432619e-04 -5.27432619e-04 -1.41297171e-03 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 8.08681204e-05 -3.07748924e-04 -4.92484006e-04 -1.77416518e-04 8.27434268e-04 -4.92293958e-05 5.38872760e-05 -9.44638495e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 363 388 413 439 465 490 516 542 567 593 619 639 664 -0 0 -2 363 - 8.23315696e-06 9.02495943e-05 3.30136560e-05 -3.30136560e-05 -1.15322826e-04 1.15322826e-04 6.50509780e-06 -2.25343198e-05 -1.12671599e-05 9.03813139e-04 6.83095219e-03 2.52992999e-03 8.43309998e-04 -2.52992999e-03 -7.57080511e-03 -2.52360170e-03 7.57080511e-03 5.05224374e-05 6.56305714e-05 -1.96891714e-04 -8.75074285e-05 -6.56305714e-05 9.02495943e-05 9.91070319e-04 3.61844250e-04 -3.61844250e-04 -1.26431932e-03 1.26431932e-03 7.23412109e-05 -2.50597306e-04 -1.25298653e-04 6.83095219e-03 4.49022829e-02 1.71775766e-02 5.72585887e-03 -1.71775766e-02 -4.75796841e-02 -1.58598947e-02 4.75796841e-02 -5.20652809e-04 -6.76347839e-04 2.02904352e-03 9.01797119e-04 6.76347839e-04 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 -2.08516626e-05 8.77935341e-05 4.64903097e-05 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 -2.38239659e-03 7.14718976e-03 1.66087992e-02 6.78418274e-03 -2.03525482e-02 2.12097053e-04 1.25444848e-04 -3.76334544e-04 -1.10087490e-04 -8.25656177e-05 6.96094992e-06 -2.39796963e-05 5.18708531e-06 -5.18708531e-06 -8.43309998e-04 -5.72585887e-03 -2.38239659e-03 4.26061120e-04 2.38239659e-03 6.78418274e-03 -1.48235482e-03 -6.78418274e-03 -3.56998782e-06 1.56159564e-04 -8.25656177e-05 6.18340029e-06 -1.56159564e-04 3.30136560e-05 3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 2.98359579e-05 -8.77935341e-05 -4.13032244e-05 2.52992999e-03 1.71775766e-02 7.14718976e-03 2.38239659e-03 -5.92699644e-03 -2.03525482e-02 -6.78418274e-03 1.66087992e-02 1.07099635e-05 -8.25656177e-05 3.76334544e-04 2.38725181e-04 1.25444848e-04 1.15322826e-04 1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 7.37468140e-05 -3.09427778e-04 -1.63707443e-04 7.57080511e-03 4.75796841e-02 1.66087992e-02 6.78418274e-03 -2.03525482e-02 -4.42337068e-02 -1.85131107e-02 5.55393321e-02 -9.60604637e-04 -1.02346772e-03 3.07040317e-03 1.27914009e-03 9.59355067e-04 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 1.79871070e-05 2.52360170e-03 1.58598947e-02 6.78418274e-03 -1.48235482e-03 -6.78418274e-03 -1.85131107e-02 5.13458842e-03 1.85131107e-02 -2.09155165e-04 -5.12122996e-04 9.59355067e-04 3.62267372e-04 5.12122996e-04 -1.15322826e-04 -1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 -1.04901397e-04 3.09427778e-04 1.45720336e-04 -7.57080511e-03 -4.75796841e-02 -2.03525482e-02 -6.78418274e-03 1.66087992e-02 5.55393321e-02 1.85131107e-02 -4.42337068e-02 6.27465494e-04 9.59355067e-04 -3.07040317e-03 -1.47147806e-03 -1.02346772e-03 6.50509780e-06 7.23412109e-05 2.08516626e-05 -2.98359579e-05 -7.37468140e-05 1.04901397e-04 -9.95783968e-07 -1.81181256e-05 -1.27509189e-05 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 3.56998782e-06 -1.07099635e-05 9.60604637e-04 2.09155165e-04 -6.27465494e-04 1.78917197e-04 -1.16268511e-04 3.48805533e-04 2.92334169e-04 2.19250627e-04 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 4.26298824e-06 6.56305714e-05 -6.76347839e-04 -1.25444848e-04 -1.56159564e-04 8.25656177e-05 1.02346772e-03 5.12122996e-04 -9.59355067e-04 -1.16268511e-04 -6.48472168e-06 5.27432619e-04 3.20296473e-04 1.72595341e-05 -2.25343198e-05 -2.50597306e-04 -8.77935341e-05 8.77935341e-05 3.09427778e-04 -3.09427778e-04 -1.81181256e-05 6.29314743e-05 3.13815141e-05 -1.96891714e-04 2.02904352e-03 3.76334544e-04 8.25656177e-05 -3.76334544e-04 -3.07040317e-03 -9.59355067e-04 3.07040317e-03 3.48805533e-04 5.27432619e-04 -1.41297171e-03 -6.04148906e-04 -5.27432619e-04 -1.12671599e-05 -1.25298653e-04 -4.64903097e-05 4.13032244e-05 1.63707443e-04 -1.45720336e-04 -1.27509189e-05 3.13815141e-05 1.37277090e-05 -8.75074285e-05 9.01797119e-04 1.10087490e-04 -6.18340029e-06 -2.38725181e-04 -1.27914009e-03 -3.62267372e-04 1.47147806e-03 2.92334169e-04 3.20296473e-04 -6.04148906e-04 -1.58641225e-04 -2.60839721e-04 5.18708531e-06 -1.79871070e-05 4.26298824e-06 -4.09454220e-06 -6.56305714e-05 6.76347839e-04 8.25656177e-05 1.56159564e-04 -1.25444848e-04 -9.59355067e-04 -5.12122996e-04 1.02346772e-03 2.19250627e-04 1.72595341e-05 -5.27432619e-04 -2.60839721e-04 -6.48472168e-06 8.23315696e-06 9.02495943e-05 3.30136560e-05 -3.30136560e-05 -1.15322826e-04 1.15322826e-04 6.50509780e-06 -2.25343198e-05 -1.12671599e-05 9.02495943e-05 9.91070319e-04 3.61844250e-04 -3.61844250e-04 -1.26431932e-03 1.26431932e-03 7.23412109e-05 -2.50597306e-04 -1.25298653e-04 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 -2.08516626e-05 8.77935341e-05 4.64903097e-05 6.96094992e-06 -2.39796963e-05 5.18708531e-06 -5.18708531e-06 3.30136560e-05 3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 2.98359579e-05 -8.77935341e-05 -4.13032244e-05 1.15322826e-04 1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 7.37468140e-05 -3.09427778e-04 -1.63707443e-04 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 1.79871070e-05 -1.15322826e-04 -1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 -1.04901397e-04 3.09427778e-04 1.45720336e-04 6.50509780e-06 7.23412109e-05 2.08516626e-05 -2.98359579e-05 -7.37468140e-05 1.04901397e-04 -9.95783968e-07 -1.81181256e-05 -1.27509189e-05 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 4.26298824e-06 -2.25343198e-05 -2.50597306e-04 -8.77935341e-05 8.77935341e-05 3.09427778e-04 -3.09427778e-04 -1.81181256e-05 6.29314743e-05 3.13815141e-05 -1.12671599e-05 -1.25298653e-04 -4.64903097e-05 4.13032244e-05 1.63707443e-04 -1.45720336e-04 -1.27509189e-05 3.13815141e-05 1.37277090e-05 5.18708531e-06 -1.79871070e-05 4.26298824e-06 -4.09454220e-06 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 17 18 20 21 23 24 13 14 15 17 18 20 21 23 24 13 14 15 17 18 20 21 23 24 16 19 22 25 13 14 15 17 18 20 21 23 24 13 14 15 17 18 20 21 23 24 16 19 22 25 13 14 15 17 18 20 21 23 24 13 14 15 17 18 20 21 23 24 16 19 22 25 13 14 15 17 18 20 21 23 24 13 14 15 17 18 20 21 23 24 16 19 22 25 - 0 22 44 66 83 105 127 144 166 188 205 227 249 266 275 284 293 297 306 315 319 328 337 341 350 359 363 -0 0 -1 516 - 3.91348915e-02 1.43320629e-01 7.02734648e-02 -7.02734648e-02 -1.48982977e-01 1.48982977e-01 -6.10770759e-03 2.11577197e-02 1.05788599e-02 2.64027557e-01 3.35702802e-01 2.34088114e-01 2.34088114e-01 -2.34088114e-01 -2.32521472e-01 -2.32521472e-01 2.32521472e-01 -1.17443083e-01 1.17443083e-01 1.17443083e-01 1.43320629e-01 2.06957410e-01 1.43523909e-01 -1.43523909e-01 -1.50473058e-01 1.50473058e-01 -1.38680201e-02 4.80402309e-02 2.40201155e-02 3.35702802e-01 2.76220067e-01 4.62745275e-02 4.62745275e-02 -4.62745275e-02 -8.52749857e-02 -8.52749857e-02 8.52749857e-02 9.22774953e-02 -9.22774953e-02 -9.22774953e-02 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 -6.79089450e-04 -4.18480142e-02 -2.82907486e-02 -2.34088114e-01 -4.62745275e-02 5.08041420e-02 -1.96806662e-01 1.96806662e-01 -1.84251812e-01 7.23859503e-02 -7.23859503e-02 -1.26391054e-01 2.67331842e-02 -2.67331842e-02 -1.36191048e-01 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 1.47334830e-02 -2.34088114e-01 -4.62745275e-02 -1.96806662e-01 5.08041420e-02 1.96806662e-01 7.23859503e-02 -1.84251812e-01 -7.23859503e-02 6.31955270e-02 2.67331842e-02 -1.36191048e-01 -1.09457864e-01 -2.67331842e-02 7.02734648e-02 1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 -2.48400517e-02 4.18480142e-02 1.35572656e-02 2.34088114e-01 4.62745275e-02 1.96806662e-01 1.96806662e-01 5.08041420e-02 -7.23859503e-02 -7.23859503e-02 -1.84251812e-01 -6.31955270e-02 -1.36191048e-01 2.67331842e-02 -1.09457864e-01 2.67331842e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 1.91463231e-02 4.52539972e-02 4.12234663e-02 2.32521472e-01 8.52749857e-02 -1.84251812e-01 7.23859503e-02 -7.23859503e-02 1.72059579e-01 -9.02854717e-02 9.02854717e-02 2.86829339e-02 8.36706010e-02 -8.36706010e-02 -5.88304515e-02 -8.47000309e-02 1.23301560e-01 3.71929353e-02 -3.71929353e-02 2.32521472e-01 8.52749857e-02 7.23859503e-02 -1.84251812e-01 -7.23859503e-02 -9.02854717e-02 1.72059579e-01 9.02854717e-02 -1.43414670e-02 8.36706010e-02 -5.88304515e-02 2.48401494e-02 -8.36706010e-02 -1.48982977e-01 -1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 4.52737305e-02 -4.52539972e-02 -4.03053096e-03 -2.32521472e-01 -8.52749857e-02 -7.23859503e-02 -7.23859503e-02 -1.84251812e-01 9.02854717e-02 9.02854717e-02 1.72059579e-01 1.43414670e-02 -5.88304515e-02 8.36706010e-02 2.48401494e-02 8.36706010e-02 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 2.48400517e-02 -1.91463231e-02 -4.52737305e-02 -7.67653617e-03 -1.41589240e-02 -1.39049485e-02 1.26391054e-01 -6.31955270e-02 6.31955270e-02 -2.86829339e-02 1.43414670e-02 -1.43414670e-02 -1.36861292e-01 -5.81908714e-02 5.81908714e-02 -1.16381743e-01 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 7.88139292e-03 -1.17443083e-01 9.22774953e-02 -2.67331842e-02 -2.67331842e-02 1.36191048e-01 -8.36706010e-02 -8.36706010e-02 5.88304515e-02 -5.81908714e-02 2.75756579e-02 -6.36474041e-02 -1.00789546e-01 -6.36474041e-02 2.11577197e-02 4.80402309e-02 4.18480142e-02 -4.18480142e-02 -4.52539972e-02 4.52539972e-02 -1.41589240e-02 4.91061754e-02 2.45239757e-02 1.17443083e-01 -9.22774953e-02 2.67331842e-02 1.36191048e-01 -2.67331842e-02 8.36706010e-02 5.88304515e-02 -8.36706010e-02 5.81908714e-02 -6.36474041e-02 2.75756579e-02 -1.00789546e-01 6.36474041e-02 1.05788599e-02 2.40201155e-02 2.82907486e-02 -1.35572656e-02 -4.12234663e-02 4.03053096e-03 -1.39049485e-02 2.45239757e-02 8.37951533e-03 1.09457864e-01 1.09457864e-01 -2.48401494e-02 -2.48401494e-02 -1.00789546e-01 -1.00789546e-01 -1.36861292e-01 -1.47334830e-02 3.71929353e-02 7.88139292e-03 -7.82316899e-03 1.17443083e-01 -9.22774953e-02 1.36191048e-01 2.67331842e-02 -2.67331842e-02 5.88304515e-02 8.36706010e-02 -8.36706010e-02 -1.16381743e-01 -6.36474041e-02 6.36474041e-02 2.75756579e-02 9.03813139e-04 6.83095219e-03 2.52992999e-03 -8.43309998e-04 -2.52992999e-03 -7.57080511e-03 2.52360170e-03 7.57080511e-03 5.05224374e-05 -6.56305714e-05 -1.96891714e-04 -8.75074285e-05 6.56305714e-05 3.91348915e-02 1.43320629e-01 7.02734648e-02 -7.02734648e-02 -1.48982977e-01 1.48982977e-01 -6.10770759e-03 2.11577197e-02 1.05788599e-02 6.83095219e-03 4.49022829e-02 1.71775766e-02 -5.72585887e-03 -1.71775766e-02 -4.75796841e-02 1.58598947e-02 4.75796841e-02 -5.20652809e-04 6.76347839e-04 2.02904352e-03 9.01797119e-04 -6.76347839e-04 1.43320629e-01 2.06957410e-01 1.43523909e-01 -1.43523909e-01 -1.50473058e-01 1.50473058e-01 -1.38680201e-02 4.80402309e-02 2.40201155e-02 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 2.38239659e-03 7.14718976e-03 1.66087992e-02 -6.78418274e-03 -2.03525482e-02 2.12097053e-04 -1.25444848e-04 -3.76334544e-04 -1.10087490e-04 8.25656177e-05 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 -6.79089450e-04 -4.18480142e-02 -2.82907486e-02 8.43309998e-04 5.72585887e-03 2.38239659e-03 4.26061120e-04 -2.38239659e-03 -6.78418274e-03 -1.48235482e-03 6.78418274e-03 3.56998782e-06 1.56159564e-04 8.25656177e-05 -6.18340029e-06 -1.56159564e-04 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 1.47334830e-02 2.52992999e-03 1.71775766e-02 7.14718976e-03 -2.38239659e-03 -5.92699644e-03 -2.03525482e-02 6.78418274e-03 1.66087992e-02 1.07099635e-05 8.25656177e-05 3.76334544e-04 2.38725181e-04 -1.25444848e-04 7.02734648e-02 1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 -2.48400517e-02 4.18480142e-02 1.35572656e-02 7.57080511e-03 4.75796841e-02 1.66087992e-02 -6.78418274e-03 -2.03525482e-02 -4.42337068e-02 1.85131107e-02 5.55393321e-02 -9.60604637e-04 1.02346772e-03 3.07040317e-03 1.27914009e-03 -9.59355067e-04 1.48982977e-01 1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 1.91463231e-02 4.52539972e-02 4.12234663e-02 -2.52360170e-03 -1.58598947e-02 -6.78418274e-03 -1.48235482e-03 6.78418274e-03 1.85131107e-02 5.13458842e-03 -1.85131107e-02 2.09155165e-04 -5.12122996e-04 -9.59355067e-04 -3.62267372e-04 5.12122996e-04 -8.47000309e-02 1.23301560e-01 3.71929353e-02 -3.71929353e-02 -7.57080511e-03 -4.75796841e-02 -2.03525482e-02 6.78418274e-03 1.66087992e-02 5.55393321e-02 -1.85131107e-02 -4.42337068e-02 6.27465494e-04 -9.59355067e-04 -3.07040317e-03 -1.47147806e-03 1.02346772e-03 -1.48982977e-01 -1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 4.52737305e-02 -4.52539972e-02 -4.03053096e-03 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 -3.56998782e-06 -1.07099635e-05 9.60604637e-04 -2.09155165e-04 -6.27465494e-04 1.78917197e-04 1.16268511e-04 3.48805533e-04 2.92334169e-04 -2.19250627e-04 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 2.48400517e-02 -1.91463231e-02 -4.52737305e-02 -7.67653617e-03 -1.41589240e-02 -1.39049485e-02 -6.56305714e-05 6.76347839e-04 1.25444848e-04 -1.56159564e-04 -8.25656177e-05 -1.02346772e-03 5.12122996e-04 9.59355067e-04 1.16268511e-04 -6.48472168e-06 -5.27432619e-04 -3.20296473e-04 1.72595341e-05 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 7.88139292e-03 -1.96891714e-04 2.02904352e-03 3.76334544e-04 -8.25656177e-05 -3.76334544e-04 -3.07040317e-03 9.59355067e-04 3.07040317e-03 3.48805533e-04 -5.27432619e-04 -1.41297171e-03 -6.04148906e-04 5.27432619e-04 2.11577197e-02 4.80402309e-02 4.18480142e-02 -4.18480142e-02 -4.52539972e-02 4.52539972e-02 -1.41589240e-02 4.91061754e-02 2.45239757e-02 -8.75074285e-05 9.01797119e-04 1.10087490e-04 6.18340029e-06 -2.38725181e-04 -1.27914009e-03 3.62267372e-04 1.47147806e-03 2.92334169e-04 -3.20296473e-04 -6.04148906e-04 -1.58641225e-04 2.60839721e-04 1.05788599e-02 2.40201155e-02 2.82907486e-02 -1.35572656e-02 -4.12234663e-02 4.03053096e-03 -1.39049485e-02 2.45239757e-02 8.37951533e-03 6.56305714e-05 -6.76347839e-04 -8.25656177e-05 1.56159564e-04 1.25444848e-04 9.59355067e-04 -5.12122996e-04 -1.02346772e-03 -2.19250627e-04 1.72595341e-05 5.27432619e-04 2.60839721e-04 -6.48472168e-06 -1.47334830e-02 3.71929353e-02 7.88139292e-03 -7.82316899e-03 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 22 23 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 22 23 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 15 16 17 18 19 20 21 22 23 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 16 17 19 20 22 23 24 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 - 0 20 40 61 78 100 121 138 160 179 196 218 234 250 272 294 316 333 355 377 394 416 438 455 477 499 516 -0 0 0 348 - 9.99988716e-01 -5.93306838e-05 2.64027557e-01 3.35702802e-01 -2.34088114e-01 2.34088114e-01 2.34088114e-01 2.32521472e-01 -2.32521472e-01 -2.32521472e-01 1.17443083e-01 1.17443083e-01 -1.17443083e-01 -5.93306838e-05 9.99327181e-01 3.35702802e-01 2.76220067e-01 -4.62745275e-02 4.62745275e-02 4.62745275e-02 8.52749857e-02 -8.52749857e-02 -8.52749857e-02 -9.22774953e-02 -9.22774953e-02 9.22774953e-02 9.99876313e-01 3.59587349e-04 2.34088114e-01 4.62745275e-02 5.08041420e-02 1.96806662e-01 1.96806662e-01 -1.84251812e-01 -7.23859503e-02 -7.23859503e-02 1.26391054e-01 2.67331842e-02 2.67331842e-02 -1.36191048e-01 9.99876313e-01 3.59587349e-04 -2.34088114e-01 -4.62745275e-02 1.96806662e-01 5.08041420e-02 -1.96806662e-01 -7.23859503e-02 -1.84251812e-01 7.23859503e-02 6.31955270e-02 -2.67331842e-02 -1.36191048e-01 -1.09457864e-01 2.67331842e-02 9.99876313e-01 3.59587349e-04 -2.34088114e-01 -4.62745275e-02 1.96806662e-01 -1.96806662e-01 5.08041420e-02 -7.23859503e-02 7.23859503e-02 -1.84251812e-01 6.31955270e-02 -1.36191048e-01 -2.67331842e-02 1.09457864e-01 2.67331842e-02 3.59587349e-04 9.98805153e-01 -2.32521472e-01 -8.52749857e-02 -1.84251812e-01 -7.23859503e-02 -7.23859503e-02 1.72059579e-01 9.02854717e-02 9.02854717e-02 -2.86829339e-02 8.36706010e-02 8.36706010e-02 -5.88304515e-02 3.59587349e-04 9.98805153e-01 2.32521472e-01 8.52749857e-02 -7.23859503e-02 -1.84251812e-01 7.23859503e-02 9.02854717e-02 1.72059579e-01 -9.02854717e-02 -1.43414670e-02 -8.36706010e-02 -5.88304515e-02 2.48401494e-02 8.36706010e-02 3.59587349e-04 9.98805153e-01 2.32521472e-01 8.52749857e-02 -7.23859503e-02 7.23859503e-02 -1.84251812e-01 9.02854717e-02 -9.02854717e-02 1.72059579e-01 -1.43414670e-02 -5.88304515e-02 -8.36706010e-02 -2.48401494e-02 8.36706010e-02 9.97918111e-01 -1.26391054e-01 -6.31955270e-02 -6.31955270e-02 2.86829339e-02 1.43414670e-02 1.43414670e-02 -1.36861292e-01 5.81908714e-02 5.81908714e-02 1.16381743e-01 9.97918111e-01 1.17443083e-01 -9.22774953e-02 -2.67331842e-02 2.67331842e-02 1.36191048e-01 -8.36706010e-02 8.36706010e-02 5.88304515e-02 5.81908714e-02 2.75756579e-02 6.36474041e-02 1.00789546e-01 -6.36474041e-02 9.97918111e-01 1.17443083e-01 -9.22774953e-02 -2.67331842e-02 1.36191048e-01 2.67331842e-02 -8.36706010e-02 5.88304515e-02 8.36706010e-02 5.81908714e-02 6.36474041e-02 2.75756579e-02 -1.00789546e-01 -6.36474041e-02 9.97918111e-01 1.09457864e-01 -1.09457864e-01 -2.48401494e-02 2.48401494e-02 1.00789546e-01 -1.00789546e-01 -1.36861292e-01 9.97918111e-01 -1.17443083e-01 9.22774953e-02 1.36191048e-01 -2.67331842e-02 -2.67331842e-02 5.88304515e-02 -8.36706010e-02 -8.36706010e-02 1.16381743e-01 -6.36474041e-02 -6.36474041e-02 2.75756579e-02 2.64027557e-01 3.35702802e-01 2.34088114e-01 -2.34088114e-01 -2.34088114e-01 -2.32521472e-01 2.32521472e-01 2.32521472e-01 1.17443083e-01 1.17443083e-01 -1.17443083e-01 9.99988716e-01 -5.93306838e-05 3.35702802e-01 2.76220067e-01 4.62745275e-02 -4.62745275e-02 -4.62745275e-02 -8.52749857e-02 8.52749857e-02 8.52749857e-02 -9.22774953e-02 -9.22774953e-02 9.22774953e-02 -5.93306838e-05 9.99327181e-01 -2.34088114e-01 -4.62745275e-02 5.08041420e-02 1.96806662e-01 1.96806662e-01 -1.84251812e-01 -7.23859503e-02 -7.23859503e-02 -1.26391054e-01 -2.67331842e-02 -2.67331842e-02 1.36191048e-01 9.99876313e-01 3.59587349e-04 2.34088114e-01 4.62745275e-02 1.96806662e-01 5.08041420e-02 -1.96806662e-01 -7.23859503e-02 -1.84251812e-01 7.23859503e-02 -6.31955270e-02 2.67331842e-02 1.36191048e-01 1.09457864e-01 -2.67331842e-02 9.99876313e-01 3.59587349e-04 2.34088114e-01 4.62745275e-02 1.96806662e-01 -1.96806662e-01 5.08041420e-02 -7.23859503e-02 7.23859503e-02 -1.84251812e-01 -6.31955270e-02 1.36191048e-01 2.67331842e-02 -1.09457864e-01 -2.67331842e-02 9.99876313e-01 3.59587349e-04 2.32521472e-01 8.52749857e-02 -1.84251812e-01 -7.23859503e-02 -7.23859503e-02 1.72059579e-01 9.02854717e-02 9.02854717e-02 2.86829339e-02 -8.36706010e-02 -8.36706010e-02 5.88304515e-02 3.59587349e-04 9.98805153e-01 -2.32521472e-01 -8.52749857e-02 -7.23859503e-02 -1.84251812e-01 7.23859503e-02 9.02854717e-02 1.72059579e-01 -9.02854717e-02 1.43414670e-02 8.36706010e-02 5.88304515e-02 -2.48401494e-02 -8.36706010e-02 3.59587349e-04 9.98805153e-01 -2.32521472e-01 -8.52749857e-02 -7.23859503e-02 7.23859503e-02 -1.84251812e-01 9.02854717e-02 -9.02854717e-02 1.72059579e-01 1.43414670e-02 5.88304515e-02 8.36706010e-02 2.48401494e-02 -8.36706010e-02 3.59587349e-04 9.98805153e-01 1.26391054e-01 6.31955270e-02 6.31955270e-02 -2.86829339e-02 -1.43414670e-02 -1.43414670e-02 -1.36861292e-01 5.81908714e-02 5.81908714e-02 1.16381743e-01 9.97918111e-01 1.17443083e-01 -9.22774953e-02 2.67331842e-02 -2.67331842e-02 -1.36191048e-01 8.36706010e-02 -8.36706010e-02 -5.88304515e-02 5.81908714e-02 2.75756579e-02 6.36474041e-02 1.00789546e-01 -6.36474041e-02 9.97918111e-01 1.17443083e-01 -9.22774953e-02 2.67331842e-02 -1.36191048e-01 -2.67331842e-02 8.36706010e-02 -5.88304515e-02 -8.36706010e-02 5.81908714e-02 6.36474041e-02 2.75756579e-02 -1.00789546e-01 -6.36474041e-02 9.97918111e-01 -1.09457864e-01 1.09457864e-01 2.48401494e-02 -2.48401494e-02 1.00789546e-01 -1.00789546e-01 -1.36861292e-01 9.97918111e-01 -1.17443083e-01 9.22774953e-02 -1.36191048e-01 2.67331842e-02 2.67331842e-02 -5.88304515e-02 8.36706010e-02 8.36706010e-02 1.16381743e-01 -6.36474041e-02 -6.36474041e-02 2.75756579e-02 9.97918111e-01 - 0 1 13 14 15 16 17 18 19 20 22 23 25 0 1 13 14 15 16 17 18 19 20 22 23 25 2 5 13 14 15 16 17 18 19 20 21 22 23 25 3 6 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 13 14 15 16 17 18 19 20 21 22 23 25 3 6 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 13 14 15 16 17 18 19 20 21 22 23 24 25 8 15 16 17 18 19 20 21 22 23 25 9 13 14 15 16 17 18 19 20 21 22 23 24 25 10 13 14 15 16 17 18 19 20 21 22 23 24 25 11 16 17 19 20 22 23 24 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 9 10 12 13 14 0 1 2 3 4 5 6 7 9 10 12 13 14 0 1 2 3 4 5 6 7 8 9 10 12 15 18 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 0 1 2 3 4 5 6 7 8 9 10 12 15 18 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 2 3 4 5 6 7 8 9 10 12 21 0 1 2 3 4 5 6 7 8 9 10 11 12 22 0 1 2 3 4 5 6 7 8 9 10 11 12 23 3 4 6 7 9 10 11 24 0 1 2 3 4 5 6 7 8 9 10 12 25 - 0 13 26 40 55 70 84 99 114 125 139 153 161 174 187 200 214 229 244 258 273 288 299 313 327 335 348 -0 0 1 516 - 3.91348915e-02 1.43320629e-01 -7.02734648e-02 7.02734648e-02 1.48982977e-01 -1.48982977e-01 -6.10770759e-03 2.11577197e-02 1.05788599e-02 9.03813139e-04 6.83095219e-03 -2.52992999e-03 8.43309998e-04 2.52992999e-03 7.57080511e-03 -2.52360170e-03 -7.57080511e-03 5.05224374e-05 -6.56305714e-05 -1.96891714e-04 -8.75074285e-05 6.56305714e-05 1.43320629e-01 2.06957410e-01 -1.43523909e-01 1.43523909e-01 1.50473058e-01 -1.50473058e-01 -1.38680201e-02 4.80402309e-02 2.40201155e-02 6.83095219e-03 4.49022829e-02 -1.71775766e-02 5.72585887e-03 1.71775766e-02 4.75796841e-02 -1.58598947e-02 -4.75796841e-02 -5.20652809e-04 6.76347839e-04 2.02904352e-03 9.01797119e-04 -6.76347839e-04 7.02734648e-02 1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 6.79089450e-04 4.18480142e-02 2.82907486e-02 2.52992999e-03 1.71775766e-02 -5.92699644e-03 2.38239659e-03 7.14718976e-03 1.66087992e-02 -6.78418274e-03 -2.03525482e-02 -2.12097053e-04 1.25444848e-04 3.76334544e-04 1.10087490e-04 -8.25656177e-05 4.35912107e-02 -8.47000309e-02 1.47334830e-02 -1.47334830e-02 -8.43309998e-04 -5.72585887e-03 2.38239659e-03 4.26061120e-04 -2.38239659e-03 -6.78418274e-03 -1.48235482e-03 6.78418274e-03 -3.56998782e-06 -1.56159564e-04 -8.25656177e-05 6.18340029e-06 1.56159564e-04 -7.02734648e-02 -1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 2.48400517e-02 -4.18480142e-02 -1.35572656e-02 -2.52992999e-03 -1.71775766e-02 7.14718976e-03 -2.38239659e-03 -5.92699644e-03 -2.03525482e-02 6.78418274e-03 1.66087992e-02 -1.07099635e-05 -8.25656177e-05 -3.76334544e-04 -2.38725181e-04 1.25444848e-04 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 -1.91463231e-02 -4.52539972e-02 -4.12234663e-02 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 -6.78418274e-03 -2.03525482e-02 -4.42337068e-02 1.85131107e-02 5.55393321e-02 9.60604637e-04 -1.02346772e-03 -3.07040317e-03 -1.27914009e-03 9.59355067e-04 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 3.71929353e-02 2.52360170e-03 1.58598947e-02 -6.78418274e-03 -1.48235482e-03 6.78418274e-03 1.85131107e-02 5.13458842e-03 -1.85131107e-02 -2.09155165e-04 5.12122996e-04 9.59355067e-04 3.62267372e-04 -5.12122996e-04 1.48982977e-01 1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 -4.52737305e-02 4.52539972e-02 4.03053096e-03 7.57080511e-03 4.75796841e-02 -2.03525482e-02 6.78418274e-03 1.66087992e-02 5.55393321e-02 -1.85131107e-02 -4.42337068e-02 -6.27465494e-04 9.59355067e-04 3.07040317e-03 1.47147806e-03 -1.02346772e-03 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 -2.48400517e-02 1.91463231e-02 4.52737305e-02 -7.67653617e-03 -1.41589240e-02 -1.39049485e-02 5.05224374e-05 -5.20652809e-04 2.12097053e-04 3.56998782e-06 1.07099635e-05 -9.60604637e-04 2.09155165e-04 6.27465494e-04 1.78917197e-04 1.16268511e-04 3.48805533e-04 2.92334169e-04 -2.19250627e-04 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 7.88139292e-03 -6.56305714e-05 6.76347839e-04 -1.25444848e-04 1.56159564e-04 8.25656177e-05 1.02346772e-03 -5.12122996e-04 -9.59355067e-04 1.16268511e-04 -6.48472168e-06 -5.27432619e-04 -3.20296473e-04 1.72595341e-05 2.11577197e-02 4.80402309e-02 -4.18480142e-02 4.18480142e-02 4.52539972e-02 -4.52539972e-02 -1.41589240e-02 4.91061754e-02 2.45239757e-02 -1.96891714e-04 2.02904352e-03 -3.76334544e-04 8.25656177e-05 3.76334544e-04 3.07040317e-03 -9.59355067e-04 -3.07040317e-03 3.48805533e-04 -5.27432619e-04 -1.41297171e-03 -6.04148906e-04 5.27432619e-04 1.05788599e-02 2.40201155e-02 -2.82907486e-02 1.35572656e-02 4.12234663e-02 -4.03053096e-03 -1.39049485e-02 2.45239757e-02 8.37951533e-03 -8.75074285e-05 9.01797119e-04 -1.10087490e-04 -6.18340029e-06 2.38725181e-04 1.27914009e-03 -3.62267372e-04 -1.47147806e-03 2.92334169e-04 -3.20296473e-04 -6.04148906e-04 -1.58641225e-04 2.60839721e-04 1.47334830e-02 -3.71929353e-02 7.88139292e-03 -7.82316899e-03 6.56305714e-05 -6.76347839e-04 8.25656177e-05 -1.56159564e-04 -1.25444848e-04 -9.59355067e-04 5.12122996e-04 1.02346772e-03 -2.19250627e-04 1.72595341e-05 5.27432619e-04 2.60839721e-04 -6.48472168e-06 2.64027557e-01 3.35702802e-01 -2.34088114e-01 -2.34088114e-01 2.34088114e-01 2.32521472e-01 2.32521472e-01 -2.32521472e-01 -1.17443083e-01 1.17443083e-01 1.17443083e-01 3.91348915e-02 1.43320629e-01 -7.02734648e-02 7.02734648e-02 1.48982977e-01 -1.48982977e-01 -6.10770759e-03 2.11577197e-02 1.05788599e-02 3.35702802e-01 2.76220067e-01 -4.62745275e-02 -4.62745275e-02 4.62745275e-02 8.52749857e-02 8.52749857e-02 -8.52749857e-02 9.22774953e-02 -9.22774953e-02 -9.22774953e-02 1.43320629e-01 2.06957410e-01 -1.43523909e-01 1.43523909e-01 1.50473058e-01 -1.50473058e-01 -1.38680201e-02 4.80402309e-02 2.40201155e-02 2.34088114e-01 4.62745275e-02 5.08041420e-02 -1.96806662e-01 1.96806662e-01 -1.84251812e-01 7.23859503e-02 -7.23859503e-02 1.26391054e-01 -2.67331842e-02 2.67331842e-02 1.36191048e-01 7.02734648e-02 1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 6.79089450e-04 4.18480142e-02 2.82907486e-02 2.34088114e-01 4.62745275e-02 -1.96806662e-01 5.08041420e-02 1.96806662e-01 7.23859503e-02 -1.84251812e-01 -7.23859503e-02 -6.31955270e-02 -2.67331842e-02 1.36191048e-01 1.09457864e-01 2.67331842e-02 4.35912107e-02 -8.47000309e-02 1.47334830e-02 -1.47334830e-02 -2.34088114e-01 -4.62745275e-02 1.96806662e-01 1.96806662e-01 5.08041420e-02 -7.23859503e-02 -7.23859503e-02 -1.84251812e-01 6.31955270e-02 1.36191048e-01 -2.67331842e-02 1.09457864e-01 -2.67331842e-02 -7.02734648e-02 -1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 2.48400517e-02 -4.18480142e-02 -1.35572656e-02 -2.32521472e-01 -8.52749857e-02 -1.84251812e-01 7.23859503e-02 -7.23859503e-02 1.72059579e-01 -9.02854717e-02 9.02854717e-02 -2.86829339e-02 -8.36706010e-02 8.36706010e-02 5.88304515e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 -1.91463231e-02 -4.52539972e-02 -4.12234663e-02 -2.32521472e-01 -8.52749857e-02 7.23859503e-02 -1.84251812e-01 -7.23859503e-02 -9.02854717e-02 1.72059579e-01 9.02854717e-02 1.43414670e-02 -8.36706010e-02 5.88304515e-02 -2.48401494e-02 8.36706010e-02 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 3.71929353e-02 2.32521472e-01 8.52749857e-02 -7.23859503e-02 -7.23859503e-02 -1.84251812e-01 9.02854717e-02 9.02854717e-02 1.72059579e-01 -1.43414670e-02 5.88304515e-02 -8.36706010e-02 -2.48401494e-02 -8.36706010e-02 1.48982977e-01 1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 -4.52737305e-02 4.52539972e-02 4.03053096e-03 -1.26391054e-01 6.31955270e-02 -6.31955270e-02 2.86829339e-02 -1.43414670e-02 1.43414670e-02 -1.36861292e-01 -5.81908714e-02 5.81908714e-02 -1.16381743e-01 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 -2.48400517e-02 1.91463231e-02 4.52737305e-02 -7.67653617e-03 -1.41589240e-02 -1.39049485e-02 -1.17443083e-01 9.22774953e-02 2.67331842e-02 2.67331842e-02 -1.36191048e-01 8.36706010e-02 8.36706010e-02 -5.88304515e-02 -5.81908714e-02 2.75756579e-02 -6.36474041e-02 -1.00789546e-01 -6.36474041e-02 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 7.88139292e-03 1.17443083e-01 -9.22774953e-02 -2.67331842e-02 -1.36191048e-01 2.67331842e-02 -8.36706010e-02 -5.88304515e-02 8.36706010e-02 5.81908714e-02 -6.36474041e-02 2.75756579e-02 -1.00789546e-01 6.36474041e-02 2.11577197e-02 4.80402309e-02 -4.18480142e-02 4.18480142e-02 4.52539972e-02 -4.52539972e-02 -1.41589240e-02 4.91061754e-02 2.45239757e-02 -1.09457864e-01 -1.09457864e-01 2.48401494e-02 2.48401494e-02 -1.00789546e-01 -1.00789546e-01 -1.36861292e-01 1.05788599e-02 2.40201155e-02 -2.82907486e-02 1.35572656e-02 4.12234663e-02 -4.03053096e-03 -1.39049485e-02 2.45239757e-02 8.37951533e-03 1.17443083e-01 -9.22774953e-02 -1.36191048e-01 -2.67331842e-02 2.67331842e-02 -5.88304515e-02 -8.36706010e-02 8.36706010e-02 -1.16381743e-01 -6.36474041e-02 6.36474041e-02 2.75756579e-02 1.47334830e-02 -3.71929353e-02 7.88139292e-03 -7.82316899e-03 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 3 4 6 7 9 10 11 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 16 19 22 25 - 0 22 44 66 83 105 127 144 166 188 205 227 249 266 286 306 327 344 366 387 404 426 445 462 484 500 516 -0 0 2 363 - 8.23315696e-06 9.02495943e-05 -3.30136560e-05 3.30136560e-05 1.15322826e-04 -1.15322826e-04 6.50509780e-06 -2.25343198e-05 -1.12671599e-05 9.02495943e-05 9.91070319e-04 -3.61844250e-04 3.61844250e-04 1.26431932e-03 -1.26431932e-03 7.23412109e-05 -2.50597306e-04 -1.25298653e-04 3.30136560e-05 3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 2.08516626e-05 -8.77935341e-05 -4.64903097e-05 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 5.18708531e-06 -3.30136560e-05 -3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 -2.98359579e-05 8.77935341e-05 4.13032244e-05 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 -7.37468140e-05 3.09427778e-04 1.63707443e-04 -2.39796963e-05 8.25086154e-05 1.79871070e-05 -1.79871070e-05 1.15322826e-04 1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 1.04901397e-04 -3.09427778e-04 -1.45720336e-04 6.50509780e-06 7.23412109e-05 -2.08516626e-05 2.98359579e-05 7.37468140e-05 -1.04901397e-04 -9.95783968e-07 -1.81181256e-05 -1.27509189e-05 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 4.26298824e-06 -2.25343198e-05 -2.50597306e-04 8.77935341e-05 -8.77935341e-05 -3.09427778e-04 3.09427778e-04 -1.81181256e-05 6.29314743e-05 3.13815141e-05 -1.12671599e-05 -1.25298653e-04 4.64903097e-05 -4.13032244e-05 -1.63707443e-04 1.45720336e-04 -1.27509189e-05 3.13815141e-05 1.37277090e-05 -5.18708531e-06 1.79871070e-05 4.26298824e-06 -4.09454220e-06 9.03813139e-04 6.83095219e-03 -2.52992999e-03 -8.43309998e-04 2.52992999e-03 7.57080511e-03 2.52360170e-03 -7.57080511e-03 5.05224374e-05 6.56305714e-05 -1.96891714e-04 -8.75074285e-05 -6.56305714e-05 8.23315696e-06 9.02495943e-05 -3.30136560e-05 3.30136560e-05 1.15322826e-04 -1.15322826e-04 6.50509780e-06 -2.25343198e-05 -1.12671599e-05 6.83095219e-03 4.49022829e-02 -1.71775766e-02 -5.72585887e-03 1.71775766e-02 4.75796841e-02 1.58598947e-02 -4.75796841e-02 -5.20652809e-04 -6.76347839e-04 2.02904352e-03 9.01797119e-04 6.76347839e-04 9.02495943e-05 9.91070319e-04 -3.61844250e-04 3.61844250e-04 1.26431932e-03 -1.26431932e-03 7.23412109e-05 -2.50597306e-04 -1.25298653e-04 2.52992999e-03 1.71775766e-02 -5.92699644e-03 -2.38239659e-03 7.14718976e-03 1.66087992e-02 6.78418274e-03 -2.03525482e-02 -2.12097053e-04 -1.25444848e-04 3.76334544e-04 1.10087490e-04 8.25656177e-05 3.30136560e-05 3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 2.08516626e-05 -8.77935341e-05 -4.64903097e-05 8.43309998e-04 5.72585887e-03 -2.38239659e-03 4.26061120e-04 2.38239659e-03 6.78418274e-03 -1.48235482e-03 -6.78418274e-03 3.56998782e-06 -1.56159564e-04 8.25656177e-05 -6.18340029e-06 1.56159564e-04 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 5.18708531e-06 -2.52992999e-03 -1.71775766e-02 7.14718976e-03 2.38239659e-03 -5.92699644e-03 -2.03525482e-02 -6.78418274e-03 1.66087992e-02 -1.07099635e-05 8.25656177e-05 -3.76334544e-04 -2.38725181e-04 -1.25444848e-04 -3.30136560e-05 -3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 -2.98359579e-05 8.77935341e-05 4.13032244e-05 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 6.78418274e-03 -2.03525482e-02 -4.42337068e-02 -1.85131107e-02 5.55393321e-02 9.60604637e-04 1.02346772e-03 -3.07040317e-03 -1.27914009e-03 -9.59355067e-04 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 -7.37468140e-05 3.09427778e-04 1.63707443e-04 -2.52360170e-03 -1.58598947e-02 6.78418274e-03 -1.48235482e-03 -6.78418274e-03 -1.85131107e-02 5.13458842e-03 1.85131107e-02 2.09155165e-04 5.12122996e-04 -9.59355067e-04 -3.62267372e-04 -5.12122996e-04 -2.39796963e-05 8.25086154e-05 1.79871070e-05 -1.79871070e-05 7.57080511e-03 4.75796841e-02 -2.03525482e-02 -6.78418274e-03 1.66087992e-02 5.55393321e-02 1.85131107e-02 -4.42337068e-02 -6.27465494e-04 -9.59355067e-04 3.07040317e-03 1.47147806e-03 1.02346772e-03 1.15322826e-04 1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 1.04901397e-04 -3.09427778e-04 -1.45720336e-04 5.05224374e-05 -5.20652809e-04 2.12097053e-04 -3.56998782e-06 1.07099635e-05 -9.60604637e-04 -2.09155165e-04 6.27465494e-04 1.78917197e-04 -1.16268511e-04 3.48805533e-04 2.92334169e-04 2.19250627e-04 6.50509780e-06 7.23412109e-05 -2.08516626e-05 2.98359579e-05 7.37468140e-05 -1.04901397e-04 -9.95783968e-07 -1.81181256e-05 -1.27509189e-05 6.56305714e-05 -6.76347839e-04 1.25444848e-04 1.56159564e-04 -8.25656177e-05 -1.02346772e-03 -5.12122996e-04 9.59355067e-04 -1.16268511e-04 -6.48472168e-06 5.27432619e-04 3.20296473e-04 1.72595341e-05 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 4.26298824e-06 -1.96891714e-04 2.02904352e-03 -3.76334544e-04 -8.25656177e-05 3.76334544e-04 3.07040317e-03 9.59355067e-04 -3.07040317e-03 3.48805533e-04 5.27432619e-04 -1.41297171e-03 -6.04148906e-04 -5.27432619e-04 -2.25343198e-05 -2.50597306e-04 8.77935341e-05 -8.77935341e-05 -3.09427778e-04 3.09427778e-04 -1.81181256e-05 6.29314743e-05 3.13815141e-05 -8.75074285e-05 9.01797119e-04 -1.10087490e-04 6.18340029e-06 2.38725181e-04 1.27914009e-03 3.62267372e-04 -1.47147806e-03 2.92334169e-04 3.20296473e-04 -6.04148906e-04 -1.58641225e-04 -2.60839721e-04 -1.12671599e-05 -1.25298653e-04 4.64903097e-05 -4.13032244e-05 -1.63707443e-04 1.45720336e-04 -1.27509189e-05 3.13815141e-05 1.37277090e-05 -6.56305714e-05 6.76347839e-04 -8.25656177e-05 -1.56159564e-04 1.25444848e-04 9.59355067e-04 5.12122996e-04 -1.02346772e-03 2.19250627e-04 1.72595341e-05 -5.27432619e-04 -2.60839721e-04 -6.48472168e-06 -5.18708531e-06 1.79871070e-05 4.26298824e-06 -4.09454220e-06 - 0 1 2 4 5 7 8 10 11 0 1 2 4 5 7 8 10 11 0 1 2 4 5 7 8 10 11 3 6 9 12 0 1 2 4 5 7 8 10 11 0 1 2 4 5 7 8 10 11 3 6 9 12 0 1 2 4 5 7 8 10 11 0 1 2 4 5 7 8 10 11 3 6 9 12 0 1 2 4 5 7 8 10 11 0 1 2 4 5 7 8 10 11 3 6 9 12 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 - 0 9 18 27 31 40 49 53 62 71 75 84 93 97 119 141 163 180 202 224 241 263 285 302 324 346 363 -0 1 -2 664 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 3.25689024e-04 -6.51378048e-04 -1.06639054e-03 -1.06639054e-03 2.13278108e-03 -4.52806801e-05 5.22856257e-05 -1.04571251e-04 -7.84284385e-05 -1.04571251e-04 9.03813139e-04 6.83095219e-03 8.43309998e-04 2.52992999e-03 -2.52992999e-03 -2.52360170e-03 -7.57080511e-03 7.57080511e-03 -1.01044875e-04 6.56305714e-05 -6.56305714e-05 -1.96891714e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 2.89608434e-03 -5.79216869e-03 -9.35225951e-03 -9.35225951e-03 1.87045190e-02 -2.85376584e-04 3.29524496e-04 -6.59048991e-04 -4.94286743e-04 -6.59048991e-04 6.83095219e-03 4.49022829e-02 5.72585887e-03 1.71775766e-02 -1.71775766e-02 -1.58598947e-02 -4.75796841e-02 4.75796841e-02 1.04130562e-03 -6.76347839e-04 6.76347839e-04 2.02904352e-03 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -6.42637659e-04 1.28527532e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 1.33367462e-04 -4.04340602e-05 8.08681204e-05 1.33657432e-04 1.78209909e-04 -8.43309998e-04 -5.72585887e-03 4.26061120e-04 -2.38239659e-03 2.38239659e-03 -1.48235482e-03 6.78418274e-03 -6.78418274e-03 7.13997564e-06 1.56159564e-04 -1.56159564e-04 -8.25656177e-05 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 -4.14019247e-04 1.28527532e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 4.90670003e-05 -4.04340602e-05 1.78209909e-04 1.82328327e-04 8.08681204e-05 -2.52992999e-03 -1.71775766e-02 -2.38239659e-03 -5.92699644e-03 7.14718976e-03 6.78418274e-03 1.66087992e-02 -2.03525482e-02 -2.01387090e-04 1.25444848e-04 -8.25656177e-05 1.28637691e-04 -3.76334544e-04 6.51378048e-04 5.79216869e-03 1.28527532e-03 1.28527532e-03 -2.34193222e-03 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 -9.81340007e-05 1.78209909e-04 -3.07748924e-04 -1.69973075e-04 -3.07748924e-04 2.52992999e-03 1.71775766e-02 2.38239659e-03 7.14718976e-03 -5.92699644e-03 -6.78418274e-03 -2.03525482e-02 1.66087992e-02 2.01387090e-04 -8.25656177e-05 1.25444848e-04 1.28637691e-04 3.76334544e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 -4.10981523e-03 -6.68105894e-03 1.33621179e-02 -3.95156129e-04 8.87082588e-05 -1.77416518e-04 -3.69363005e-04 -4.92484006e-04 2.52360170e-03 1.58598947e-02 -1.48235482e-03 6.78418274e-03 -6.78418274e-03 5.13458842e-03 -1.85131107e-02 1.85131107e-02 4.18310329e-04 -5.12122996e-04 5.12122996e-04 9.59355067e-04 1.06639054e-03 9.35225951e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 -6.68105894e-03 -4.10981523e-03 1.33621179e-02 -1.22299680e-04 8.87082588e-05 -4.92484006e-04 -5.26896749e-04 -1.77416518e-04 7.57080511e-03 4.75796841e-02 6.78418274e-03 1.66087992e-02 -2.03525482e-02 -1.85131107e-02 -4.42337068e-02 5.55393321e-02 1.58807013e-03 -1.02346772e-03 9.59355067e-04 -1.92337974e-04 3.07040317e-03 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 1.33621179e-02 1.33621179e-02 -2.41529920e-02 2.44599361e-04 -4.92484006e-04 8.27434268e-04 4.23658521e-04 8.27434268e-04 -7.57080511e-03 -4.75796841e-02 -6.78418274e-03 -2.03525482e-02 1.66087992e-02 1.85131107e-02 5.55393321e-02 -4.42337068e-02 -1.58807013e-03 9.59355067e-04 -1.02346772e-03 -1.92337974e-04 -3.07040317e-03 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -4.90670003e-05 9.81340007e-05 3.95156129e-04 1.22299680e-04 -2.44599361e-04 -2.59797738e-05 1.69297603e-05 -3.38595206e-05 -3.69220468e-05 -4.92293958e-05 -1.01044875e-04 1.04130562e-03 -7.13997564e-06 2.01387090e-04 -2.01387090e-04 -4.18310329e-04 -1.58807013e-03 1.58807013e-03 -3.27420436e-04 3.35519138e-04 -3.35519138e-04 -6.97611067e-04 5.22856257e-05 3.29524496e-04 4.04340602e-05 4.04340602e-05 -1.78209909e-04 -8.87082588e-05 -8.87082588e-05 4.92484006e-04 1.69297603e-05 -2.71695573e-05 5.38872760e-05 2.93232050e-05 5.38872760e-05 6.56305714e-05 -6.76347839e-04 -1.56159564e-04 -1.25444848e-04 8.25656177e-05 5.12122996e-04 1.02346772e-03 -9.59355067e-04 3.35519138e-04 -6.48472168e-06 1.72595341e-05 5.94567521e-05 5.27432619e-04 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 -1.78209909e-04 3.07748924e-04 1.77416518e-04 4.92484006e-04 -8.27434268e-04 -3.38595206e-05 5.38872760e-05 -1.08000471e-04 -7.63940131e-05 -9.44638495e-05 -6.56305714e-05 6.76347839e-04 1.56159564e-04 8.25656177e-05 -1.25444848e-04 -5.12122996e-04 -9.59355067e-04 1.02346772e-03 -3.35519138e-04 1.72595341e-05 -6.48472168e-06 5.94567521e-05 -5.27432619e-04 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 -1.82328327e-04 1.69973075e-04 3.69363005e-04 5.26896749e-04 -4.23658521e-04 -3.69220468e-05 2.93232050e-05 -7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -1.28637691e-04 -1.28637691e-04 1.92337974e-04 1.92337974e-04 5.94567521e-05 5.94567521e-05 3.47696408e-04 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 -8.08681204e-05 3.07748924e-04 4.92484006e-04 1.77416518e-04 -8.27434268e-04 -4.92293958e-05 5.38872760e-05 -9.44638495e-05 -6.75202116e-05 -1.08000471e-04 -1.96891714e-04 2.02904352e-03 8.25656177e-05 3.76334544e-04 -3.76334544e-04 -9.59355067e-04 -3.07040317e-03 3.07040317e-03 -6.97611067e-04 5.27432619e-04 -5.27432619e-04 -1.41297171e-03 1.25466617e-06 1.34349826e-05 3.95377341e-06 1.31792447e-06 -6.58962236e-06 -1.31931676e-05 -4.39772254e-06 2.19886127e-05 -6.08776268e-07 7.90823570e-07 -3.95411785e-06 -3.16329428e-06 -1.31803928e-06 1.70328256e-04 1.56710856e-03 3.25689024e-04 3.25689024e-04 -6.51378048e-04 -1.06639054e-03 -1.06639054e-03 2.13278108e-03 -4.52806801e-05 5.22856257e-05 -1.04571251e-04 -7.84284385e-05 -1.04571251e-04 1.34349826e-05 1.43209127e-04 4.28088798e-05 1.42696266e-05 -7.13481329e-05 -1.42707031e-04 -4.75690104e-05 2.37845052e-04 -6.42002866e-06 8.33986187e-06 -4.16993094e-05 -3.33594475e-05 -1.38997698e-05 1.56710856e-03 1.39613919e-02 2.89608434e-03 2.89608434e-03 -5.79216869e-03 -9.35225951e-03 -9.35225951e-03 1.87045190e-02 -2.85376584e-04 3.29524496e-04 -6.59048991e-04 -4.94286743e-04 -6.59048991e-04 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 -4.22604181e-06 2.11302091e-05 4.04560801e-05 1.41871954e-05 -7.09359772e-05 2.44441635e-06 -2.47970899e-06 1.23985450e-05 1.04247858e-05 4.34366074e-06 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -6.42637659e-04 1.28527532e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 1.33367462e-04 -4.04340602e-05 8.08681204e-05 1.33657432e-04 1.78209909e-04 -1.31792447e-06 -1.42696266e-05 -4.22604181e-06 -7.59910514e-07 7.04340302e-06 1.41871954e-05 2.62355898e-06 -2.36453257e-05 5.95722755e-07 -4.89269790e-07 4.34366074e-06 3.60141605e-06 8.15449649e-07 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 -4.14019247e-04 1.28527532e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 4.90670003e-05 -4.04340602e-05 1.78209909e-04 1.82328327e-04 8.08681204e-05 6.58962236e-06 7.13481329e-05 2.11302091e-05 7.04340302e-06 -3.45682450e-05 -7.09359772e-05 -2.36453257e-05 1.16121122e-04 -2.97861377e-06 4.34366074e-06 -2.13388414e-05 -1.67422057e-05 -7.11294712e-06 6.51378048e-04 5.79216869e-03 1.28527532e-03 1.28527532e-03 -2.34193222e-03 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 -9.81340007e-05 1.78209909e-04 -3.07748924e-04 -1.69973075e-04 -3.07748924e-04 1.31931676e-05 1.42707031e-04 4.04560801e-05 1.41871954e-05 -7.09359772e-05 -1.35576122e-04 -4.74618663e-05 2.37309331e-04 -8.24004626e-06 8.46263429e-06 -4.23131714e-05 -3.54807188e-05 -1.47836328e-05 1.06639054e-03 9.35225951e-03 1.31106178e-03 2.07805564e-03 -4.15611128e-03 -4.10981523e-03 -6.68105894e-03 1.33621179e-02 -3.95156129e-04 8.87082588e-05 -1.77416518e-04 -3.69363005e-04 -4.92484006e-04 4.39772254e-06 4.75690104e-05 1.41871954e-05 2.62355898e-06 -2.36453257e-05 -4.74618663e-05 -9.01114524e-06 7.91031105e-05 -2.04079272e-06 1.73409032e-06 -1.47836328e-05 -1.22344517e-05 -2.89015053e-06 1.06639054e-03 9.35225951e-03 2.07805564e-03 1.31106178e-03 -4.15611128e-03 -6.68105894e-03 -4.10981523e-03 1.33621179e-02 -1.22299680e-04 8.87082588e-05 -4.92484006e-04 -5.26896749e-04 -1.77416518e-04 -2.19886127e-05 -2.37845052e-04 -7.09359772e-05 -2.36453257e-05 1.16121122e-04 2.37309331e-04 7.91031105e-05 -3.88706075e-04 1.02039636e-05 -1.47836328e-05 7.26955279e-05 5.70968043e-05 2.42318426e-05 -2.13278108e-03 -1.87045190e-02 -4.15611128e-03 -4.15611128e-03 7.54522870e-03 1.33621179e-02 1.33621179e-02 -2.41529920e-02 2.44599361e-04 -4.92484006e-04 8.27434268e-04 4.23658521e-04 8.27434268e-04 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 -5.95722755e-07 2.97861377e-06 8.24004626e-06 2.04079272e-06 -1.02039636e-05 1.40335193e-07 -3.06000076e-07 1.53000038e-06 1.12314006e-06 4.67975025e-07 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -4.90670003e-05 9.81340007e-05 3.95156129e-04 1.22299680e-04 -2.44599361e-04 -2.59797738e-05 1.69297603e-05 -3.38595206e-05 -3.69220468e-05 -4.92293958e-05 7.90823570e-07 8.33986187e-06 2.47970899e-06 4.89269790e-07 -4.34366074e-06 -8.46263429e-06 -1.73409032e-06 1.47836328e-05 -3.06000076e-07 3.49595231e-07 -1.90867338e-06 -1.56090719e-06 -5.71522584e-07 5.22856257e-05 3.29524496e-04 4.04340602e-05 4.04340602e-05 -1.78209909e-04 -8.87082588e-05 -8.87082588e-05 4.92484006e-04 1.69297603e-05 -2.71695573e-05 5.38872760e-05 2.93232050e-05 5.38872760e-05 -3.95411785e-06 -4.16993094e-05 -1.23985450e-05 -4.34366074e-06 2.13388414e-05 4.23131714e-05 1.47836328e-05 -7.26955279e-05 1.53000038e-06 -1.90867338e-06 9.51122747e-06 7.65895674e-06 3.20700306e-06 -1.04571251e-04 -6.59048991e-04 -8.08681204e-05 -1.78209909e-04 3.07748924e-04 1.77416518e-04 4.92484006e-04 -8.27434268e-04 -3.38595206e-05 5.38872760e-05 -1.08000471e-04 -7.63940131e-05 -9.44638495e-05 -3.16329428e-06 -3.33594475e-05 -1.04247858e-05 -3.60141605e-06 1.67422057e-05 3.54807188e-05 1.22344517e-05 -5.70968043e-05 1.12314006e-06 -1.56090719e-06 7.65895674e-06 6.07076274e-06 2.57724878e-06 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 -1.82328327e-04 1.69973075e-04 3.69363005e-04 5.26896749e-04 -4.23658521e-04 -3.69220468e-05 2.93232050e-05 -7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -1.31803928e-06 -1.38997698e-05 -4.34366074e-06 -8.15449649e-07 7.11294712e-06 1.47836328e-05 2.89015053e-06 -2.42318426e-05 4.67975025e-07 -5.71522584e-07 3.20700306e-06 2.57724878e-06 9.59219321e-07 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 -8.08681204e-05 3.07748924e-04 4.92484006e-04 1.77416518e-04 -8.27434268e-04 -4.92293958e-05 5.38872760e-05 -9.44638495e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 25 50 75 101 127 152 178 204 229 255 281 301 326 352 378 404 430 456 482 508 534 560 586 612 638 664 -0 1 -1 516 - 3.91348915e-02 1.43320629e-01 7.02734648e-02 -7.02734648e-02 -1.48982977e-01 1.48982977e-01 1.22154152e-02 2.11577197e-02 1.40271766e-02 6.79314330e-02 -1.27999040e-02 3.83997120e-02 -1.27999040e-02 3.13231900e-02 -9.39695701e-02 3.13231900e-02 1.95007672e-03 2.53322396e-03 -8.44407987e-04 -3.37763195e-03 2.53322396e-03 1.43320629e-01 2.06957410e-01 1.43523909e-01 -1.43523909e-01 -1.50473058e-01 1.50473058e-01 2.77360403e-02 4.80402309e-02 6.79314330e-02 1.60907873e-01 -4.09845600e-02 1.22953680e-01 -4.09845600e-02 5.94754012e-02 -1.78426204e-01 5.94754012e-02 2.00105569e-02 2.59944760e-02 -8.66482532e-03 -3.46593013e-02 2.59944760e-02 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 1.47334830e-02 1.27999040e-02 4.09845600e-02 5.73556868e-03 3.21974808e-02 -1.07324936e-02 -1.69480895e-02 -6.28329901e-02 2.09443300e-02 6.06202249e-03 1.11749199e-04 -3.72497331e-05 -7.04948694e-03 5.28711521e-03 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 -2.41609623e-02 -1.47334830e-02 -4.18480142e-02 -3.83997120e-02 -1.22953680e-01 3.21974808e-02 -8.01243800e-02 3.21974808e-02 -6.28329901e-02 1.50606551e-01 -6.28329901e-02 -9.22207060e-03 -1.41362236e-02 5.28711521e-03 1.59730948e-02 -1.41362236e-02 7.02734648e-02 1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 2.41609623e-02 -1.47334830e-02 4.18480142e-02 1.27999040e-02 4.09845600e-02 -1.07324936e-02 3.21974808e-02 5.73556868e-03 2.09443300e-02 -6.28329901e-02 -1.69480895e-02 3.07402353e-03 5.28711521e-03 -3.72497331e-05 -8.77460895e-03 1.11749199e-04 -8.47000309e-02 1.23301560e-01 3.71929353e-02 -3.71929353e-02 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 -6.28329901e-02 2.09443300e-02 4.58861475e-02 8.26569598e-02 -2.75523199e-02 -2.03553554e-02 3.67538539e-03 -1.22512846e-03 2.18708352e-02 -1.64031264e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 2.61274075e-02 3.71929353e-02 4.52539972e-02 9.39695701e-02 1.78426204e-01 -6.28329901e-02 1.50606551e-01 -6.28329901e-02 8.26569598e-02 -1.74532412e-01 8.26569598e-02 2.62890636e-02 4.25165420e-02 -1.64031264e-02 -4.55339938e-02 4.25165420e-02 -1.48982977e-01 -1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 -2.61274075e-02 3.71929353e-02 -4.52539972e-02 -3.13231900e-02 -5.94754012e-02 2.09443300e-02 -6.28329901e-02 -1.69480895e-02 -2.75523199e-02 8.26569598e-02 4.58861475e-02 -8.76302120e-03 -1.64031264e-02 -1.22512846e-03 2.85636725e-02 3.67538539e-03 1.22154152e-02 2.77360403e-02 2.41609623e-02 -2.41609623e-02 -2.61274075e-02 2.61274075e-02 1.64075411e-02 2.83178480e-02 1.95007672e-03 2.00105569e-02 -6.06202249e-03 9.22207060e-03 -3.07402353e-03 2.03553554e-02 -2.62890636e-02 8.76302120e-03 1.46476011e-03 7.20172278e-04 -2.40057426e-04 -2.64406855e-03 1.98305141e-03 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 7.88139292e-03 2.53322396e-03 2.59944760e-02 -1.11749199e-04 1.41362236e-02 -5.28711521e-03 -3.67538539e-03 -4.25165420e-02 1.64031264e-02 7.20172278e-04 3.36490998e-03 -1.22324825e-03 -2.70562219e-03 1.72541514e-03 -1.47334830e-02 3.71929353e-02 7.88139292e-03 -7.82316899e-03 -8.44407987e-04 -8.66482532e-03 3.72497331e-05 -5.28711521e-03 3.72497331e-05 1.22512846e-03 1.64031264e-02 1.22512846e-03 -2.40057426e-04 -1.22324825e-03 1.02914641e-04 4.15791659e-04 -1.22324825e-03 1.47334830e-02 1.47334830e-02 -3.71929353e-02 -3.71929353e-02 -1.57045619e-02 -3.37763195e-03 -3.46593013e-02 7.04948694e-03 -1.59730948e-02 8.77460895e-03 -2.18708352e-02 4.55339938e-02 -2.85636725e-02 -2.64406855e-03 -2.70562219e-03 4.15791659e-04 4.51786749e-03 -1.97649858e-03 2.11577197e-02 4.80402309e-02 4.18480142e-02 -4.18480142e-02 -4.52539972e-02 4.52539972e-02 2.83178480e-02 4.91061754e-02 2.53322396e-03 2.59944760e-02 -5.28711521e-03 1.41362236e-02 -1.11749199e-04 1.64031264e-02 -4.25165420e-02 -3.67538539e-03 1.98305141e-03 1.72541514e-03 -1.22324825e-03 -1.97649858e-03 3.36490998e-03 1.40271766e-02 6.79314330e-02 1.27999040e-02 1.27999040e-02 -3.83997120e-02 -3.13231900e-02 -3.13231900e-02 9.39695701e-02 1.95007672e-03 -8.44407987e-04 2.53322396e-03 3.37763195e-03 2.53322396e-03 3.91348915e-02 1.43320629e-01 7.02734648e-02 -7.02734648e-02 -1.48982977e-01 1.48982977e-01 1.22154152e-02 2.11577197e-02 6.79314330e-02 1.60907873e-01 4.09845600e-02 4.09845600e-02 -1.22953680e-01 -5.94754012e-02 -5.94754012e-02 1.78426204e-01 2.00105569e-02 -8.66482532e-03 2.59944760e-02 3.46593013e-02 2.59944760e-02 1.43320629e-01 2.06957410e-01 1.43523909e-01 -1.43523909e-01 -1.50473058e-01 1.50473058e-01 2.77360403e-02 4.80402309e-02 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 -1.07324936e-02 3.21974808e-02 -1.69480895e-02 2.09443300e-02 -6.28329901e-02 -6.06202249e-03 3.72497331e-05 -1.11749199e-04 -7.04948694e-03 -5.28711521e-03 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 1.47334830e-02 -1.27999040e-02 -4.09845600e-02 -1.07324936e-02 5.73556868e-03 3.21974808e-02 2.09443300e-02 -1.69480895e-02 -6.28329901e-02 -3.07402353e-03 3.72497331e-05 -5.28711521e-03 -8.77460895e-03 -1.11749199e-04 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 -2.41609623e-02 -1.47334830e-02 -4.18480142e-02 3.83997120e-02 1.22953680e-01 3.21974808e-02 3.21974808e-02 -8.01243800e-02 -6.28329901e-02 -6.28329901e-02 1.50606551e-01 9.22207060e-03 -5.28711521e-03 1.41362236e-02 1.59730948e-02 1.41362236e-02 7.02734648e-02 1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 2.41609623e-02 -1.47334830e-02 4.18480142e-02 3.13231900e-02 5.94754012e-02 -1.69480895e-02 2.09443300e-02 -6.28329901e-02 4.58861475e-02 -2.75523199e-02 8.26569598e-02 2.03553554e-02 1.22512846e-03 -3.67538539e-03 2.18708352e-02 1.64031264e-02 -8.47000309e-02 1.23301560e-01 3.71929353e-02 -3.71929353e-02 3.13231900e-02 5.94754012e-02 2.09443300e-02 -1.69480895e-02 -6.28329901e-02 -2.75523199e-02 4.58861475e-02 8.26569598e-02 8.76302120e-03 1.22512846e-03 1.64031264e-02 2.85636725e-02 -3.67538539e-03 1.48982977e-01 1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 2.61274075e-02 3.71929353e-02 4.52539972e-02 -9.39695701e-02 -1.78426204e-01 -6.28329901e-02 -6.28329901e-02 1.50606551e-01 8.26569598e-02 8.26569598e-02 -1.74532412e-01 -2.62890636e-02 1.64031264e-02 -4.25165420e-02 -4.55339938e-02 -4.25165420e-02 -1.48982977e-01 -1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 -2.61274075e-02 3.71929353e-02 -4.52539972e-02 1.95007672e-03 2.00105569e-02 6.06202249e-03 3.07402353e-03 -9.22207060e-03 -2.03553554e-02 -8.76302120e-03 2.62890636e-02 1.46476011e-03 -2.40057426e-04 7.20172278e-04 2.64406855e-03 1.98305141e-03 1.22154152e-02 2.77360403e-02 2.41609623e-02 -2.41609623e-02 -2.61274075e-02 2.61274075e-02 1.64075411e-02 2.83178480e-02 -8.44407987e-04 -8.66482532e-03 -3.72497331e-05 -3.72497331e-05 5.28711521e-03 -1.22512846e-03 -1.22512846e-03 -1.64031264e-02 -2.40057426e-04 1.02914641e-04 -1.22324825e-03 -4.15791659e-04 -1.22324825e-03 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 7.88139292e-03 2.53322396e-03 2.59944760e-02 1.11749199e-04 5.28711521e-03 -1.41362236e-02 3.67538539e-03 -1.64031264e-02 4.25165420e-02 7.20172278e-04 -1.22324825e-03 3.36490998e-03 2.70562219e-03 1.72541514e-03 -1.47334830e-02 3.71929353e-02 7.88139292e-03 -7.82316899e-03 3.37763195e-03 3.46593013e-02 7.04948694e-03 8.77460895e-03 -1.59730948e-02 -2.18708352e-02 -2.85636725e-02 4.55339938e-02 2.64406855e-03 -4.15791659e-04 2.70562219e-03 4.51786749e-03 1.97649858e-03 1.47334830e-02 1.47334830e-02 -3.71929353e-02 -3.71929353e-02 -1.57045619e-02 2.53322396e-03 2.59944760e-02 5.28711521e-03 1.11749199e-04 -1.41362236e-02 -1.64031264e-02 3.67538539e-03 4.25165420e-02 1.98305141e-03 -1.22324825e-03 1.72541514e-03 1.97649858e-03 3.36490998e-03 2.11577197e-02 4.80402309e-02 4.18480142e-02 -4.18480142e-02 -4.52539972e-02 4.52539972e-02 2.83178480e-02 4.91061754e-02 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 - 0 21 42 59 81 103 120 142 164 185 202 219 237 258 279 300 317 339 361 378 400 422 443 460 477 495 516 -0 1 0 516 - 3.91348915e-02 1.43320629e-01 -7.02734648e-02 7.02734648e-02 1.48982977e-01 -1.48982977e-01 -6.10770759e-03 2.11577197e-02 -1.05788599e-02 9.03813139e-04 6.83095219e-03 -2.52992999e-03 2.52992999e-03 8.43309998e-04 7.57080511e-03 -7.57080511e-03 -2.52360170e-03 5.05224374e-05 -1.96891714e-04 -6.56305714e-05 8.75074285e-05 6.56305714e-05 1.43320629e-01 2.06957410e-01 -1.43523909e-01 1.43523909e-01 1.50473058e-01 -1.50473058e-01 -1.38680201e-02 4.80402309e-02 -2.40201155e-02 6.83095219e-03 4.49022829e-02 -1.71775766e-02 1.71775766e-02 5.72585887e-03 4.75796841e-02 -4.75796841e-02 -1.58598947e-02 -5.20652809e-04 2.02904352e-03 6.76347839e-04 -9.01797119e-04 -6.76347839e-04 7.02734648e-02 1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 6.79089450e-04 4.18480142e-02 -2.82907486e-02 2.52992999e-03 1.71775766e-02 -5.92699644e-03 7.14718976e-03 2.38239659e-03 1.66087992e-02 -2.03525482e-02 -6.78418274e-03 -2.12097053e-04 3.76334544e-04 1.25444848e-04 -1.10087490e-04 -8.25656177e-05 -7.02734648e-02 -1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 2.48400517e-02 -4.18480142e-02 1.35572656e-02 -2.52992999e-03 -1.71775766e-02 7.14718976e-03 -5.92699644e-03 -2.38239659e-03 -2.03525482e-02 1.66087992e-02 6.78418274e-03 -1.07099635e-05 -3.76334544e-04 -8.25656177e-05 2.38725181e-04 1.25444848e-04 4.35912107e-02 -8.47000309e-02 1.47334830e-02 -1.47334830e-02 -8.43309998e-04 -5.72585887e-03 2.38239659e-03 -2.38239659e-03 4.26061120e-04 -6.78418274e-03 6.78418274e-03 -1.48235482e-03 -3.56998782e-06 -8.25656177e-05 -1.56159564e-04 -6.18340029e-06 1.56159564e-04 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 -1.91463231e-02 -4.52539972e-02 4.12234663e-02 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 -2.03525482e-02 -6.78418274e-03 -4.42337068e-02 5.55393321e-02 1.85131107e-02 9.60604637e-04 -3.07040317e-03 -1.02346772e-03 1.27914009e-03 9.59355067e-04 1.48982977e-01 1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 -4.52737305e-02 4.52539972e-02 -4.03053096e-03 7.57080511e-03 4.75796841e-02 -2.03525482e-02 1.66087992e-02 6.78418274e-03 5.55393321e-02 -4.42337068e-02 -1.85131107e-02 -6.27465494e-04 3.07040317e-03 9.59355067e-04 -1.47147806e-03 -1.02346772e-03 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 3.71929353e-02 2.52360170e-03 1.58598947e-02 -6.78418274e-03 6.78418274e-03 -1.48235482e-03 1.85131107e-02 -1.85131107e-02 5.13458842e-03 -2.09155165e-04 9.59355067e-04 5.12122996e-04 -3.62267372e-04 -5.12122996e-04 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 -2.48400517e-02 1.91463231e-02 4.52737305e-02 -7.67653617e-03 -1.41589240e-02 1.39049485e-02 5.05224374e-05 -5.20652809e-04 2.12097053e-04 1.07099635e-05 3.56998782e-06 -9.60604637e-04 6.27465494e-04 2.09155165e-04 1.78917197e-04 3.48805533e-04 1.16268511e-04 -2.92334169e-04 -2.19250627e-04 2.11577197e-02 4.80402309e-02 -4.18480142e-02 4.18480142e-02 4.52539972e-02 -4.52539972e-02 -1.41589240e-02 4.91061754e-02 -2.45239757e-02 -1.96891714e-04 2.02904352e-03 -3.76334544e-04 3.76334544e-04 8.25656177e-05 3.07040317e-03 -3.07040317e-03 -9.59355067e-04 3.48805533e-04 -1.41297171e-03 -5.27432619e-04 6.04148906e-04 5.27432619e-04 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 7.88139292e-03 -6.56305714e-05 6.76347839e-04 -1.25444848e-04 8.25656177e-05 1.56159564e-04 1.02346772e-03 -9.59355067e-04 -5.12122996e-04 1.16268511e-04 -5.27432619e-04 -6.48472168e-06 3.20296473e-04 1.72595341e-05 -1.05788599e-02 -2.40201155e-02 2.82907486e-02 -1.35572656e-02 -4.12234663e-02 4.03053096e-03 1.39049485e-02 -2.45239757e-02 8.37951533e-03 8.75074285e-05 -9.01797119e-04 1.10087490e-04 -2.38725181e-04 6.18340029e-06 -1.27914009e-03 1.47147806e-03 3.62267372e-04 -2.92334169e-04 6.04148906e-04 3.20296473e-04 -1.58641225e-04 -2.60839721e-04 1.47334830e-02 -3.71929353e-02 7.88139292e-03 -7.82316899e-03 6.56305714e-05 -6.76347839e-04 8.25656177e-05 -1.25444848e-04 -1.56159564e-04 -9.59355067e-04 1.02346772e-03 5.12122996e-04 -2.19250627e-04 5.27432619e-04 1.72595341e-05 -2.60839721e-04 -6.48472168e-06 2.64027557e-01 3.35702802e-01 -2.34088114e-01 2.34088114e-01 -2.34088114e-01 2.32521472e-01 -2.32521472e-01 2.32521472e-01 1.17443083e-01 -1.17443083e-01 1.17443083e-01 3.91348915e-02 1.43320629e-01 -7.02734648e-02 7.02734648e-02 1.48982977e-01 -1.48982977e-01 -6.10770759e-03 2.11577197e-02 -1.05788599e-02 3.35702802e-01 2.76220067e-01 -4.62745275e-02 4.62745275e-02 -4.62745275e-02 8.52749857e-02 -8.52749857e-02 8.52749857e-02 -9.22774953e-02 9.22774953e-02 -9.22774953e-02 1.43320629e-01 2.06957410e-01 -1.43523909e-01 1.43523909e-01 1.50473058e-01 -1.50473058e-01 -1.38680201e-02 4.80402309e-02 -2.40201155e-02 2.34088114e-01 4.62745275e-02 5.08041420e-02 1.96806662e-01 -1.96806662e-01 -1.84251812e-01 -7.23859503e-02 7.23859503e-02 1.26391054e-01 2.67331842e-02 -2.67331842e-02 1.36191048e-01 7.02734648e-02 1.43523909e-01 -6.94770805e-02 1.13068291e-01 9.01742992e-02 -1.74874330e-01 6.79089450e-04 4.18480142e-02 -2.82907486e-02 -2.34088114e-01 -4.62745275e-02 1.96806662e-01 5.08041420e-02 1.96806662e-01 -7.23859503e-02 -1.84251812e-01 -7.23859503e-02 6.31955270e-02 -2.67331842e-02 1.36191048e-01 -1.09457864e-01 -2.67331842e-02 -7.02734648e-02 -1.43523909e-01 1.13068291e-01 -6.94770805e-02 -1.74874330e-01 9.01742992e-02 2.48400517e-02 -4.18480142e-02 1.35572656e-02 2.34088114e-01 4.62745275e-02 -1.96806662e-01 1.96806662e-01 5.08041420e-02 7.23859503e-02 -7.23859503e-02 -1.84251812e-01 -6.31955270e-02 1.36191048e-01 -2.67331842e-02 -1.09457864e-01 2.67331842e-02 4.35912107e-02 -8.47000309e-02 1.47334830e-02 -1.47334830e-02 -2.32521472e-01 -8.52749857e-02 -1.84251812e-01 -7.23859503e-02 7.23859503e-02 1.72059579e-01 9.02854717e-02 -9.02854717e-02 -2.86829339e-02 8.36706010e-02 -8.36706010e-02 5.88304515e-02 -1.48982977e-01 -1.50473058e-01 9.01742992e-02 -1.74874330e-01 -3.55791693e-02 1.58880729e-01 -1.91463231e-02 -4.52539972e-02 4.12234663e-02 2.32521472e-01 8.52749857e-02 -7.23859503e-02 -1.84251812e-01 -7.23859503e-02 9.02854717e-02 1.72059579e-01 9.02854717e-02 -1.43414670e-02 -8.36706010e-02 5.88304515e-02 2.48401494e-02 -8.36706010e-02 1.48982977e-01 1.50473058e-01 -1.74874330e-01 9.01742992e-02 1.58880729e-01 -3.55791693e-02 -4.52737305e-02 4.52539972e-02 -4.03053096e-03 -2.32521472e-01 -8.52749857e-02 7.23859503e-02 -7.23859503e-02 -1.84251812e-01 -9.02854717e-02 9.02854717e-02 1.72059579e-01 1.43414670e-02 5.88304515e-02 -8.36706010e-02 2.48401494e-02 8.36706010e-02 -8.47000309e-02 1.23301560e-01 -3.71929353e-02 3.71929353e-02 -1.26391054e-01 -6.31955270e-02 6.31955270e-02 2.86829339e-02 1.43414670e-02 -1.43414670e-02 -1.36861292e-01 5.81908714e-02 -5.81908714e-02 -1.16381743e-01 -6.10770759e-03 -1.38680201e-02 -6.79089450e-04 -2.48400517e-02 1.91463231e-02 4.52737305e-02 -7.67653617e-03 -1.41589240e-02 1.39049485e-02 1.17443083e-01 -9.22774953e-02 -2.67331842e-02 2.67331842e-02 -1.36191048e-01 -8.36706010e-02 8.36706010e-02 -5.88304515e-02 5.81908714e-02 2.75756579e-02 -6.36474041e-02 1.00789546e-01 6.36474041e-02 2.11577197e-02 4.80402309e-02 -4.18480142e-02 4.18480142e-02 4.52539972e-02 -4.52539972e-02 -1.41589240e-02 4.91061754e-02 -2.45239757e-02 -1.17443083e-01 9.22774953e-02 2.67331842e-02 -1.36191048e-01 2.67331842e-02 8.36706010e-02 -5.88304515e-02 8.36706010e-02 -5.81908714e-02 -6.36474041e-02 2.75756579e-02 1.00789546e-01 -6.36474041e-02 -1.47334830e-02 3.71929353e-02 -7.82316899e-03 7.88139292e-03 1.09457864e-01 1.09457864e-01 -2.48401494e-02 -2.48401494e-02 1.00789546e-01 1.00789546e-01 -1.36861292e-01 -1.05788599e-02 -2.40201155e-02 2.82907486e-02 -1.35572656e-02 -4.12234663e-02 4.03053096e-03 1.39049485e-02 -2.45239757e-02 8.37951533e-03 1.17443083e-01 -9.22774953e-02 -1.36191048e-01 2.67331842e-02 -2.67331842e-02 -5.88304515e-02 8.36706010e-02 -8.36706010e-02 -1.16381743e-01 6.36474041e-02 -6.36474041e-02 2.75756579e-02 1.47334830e-02 -3.71929353e-02 7.88139292e-03 -7.82316899e-03 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 3 4 6 7 9 10 11 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 12 17 20 23 25 - 0 22 44 66 88 105 127 149 166 188 210 227 249 266 286 306 327 349 366 387 409 426 445 467 484 500 516 -0 1 1 471 - 1.70328256e-04 1.56710856e-03 -6.51378048e-04 3.25689024e-04 3.25689024e-04 2.13278108e-03 -1.06639054e-03 -1.06639054e-03 9.05613602e-05 -1.04571251e-04 -1.04571251e-04 5.22856257e-05 1.56710856e-03 1.39613919e-02 -5.79216869e-03 2.89608434e-03 2.89608434e-03 1.87045190e-02 -9.35225951e-03 -9.35225951e-03 5.70753169e-04 -6.59048991e-04 -6.59048991e-04 3.29524496e-04 6.51378048e-04 5.79216869e-03 -2.34193222e-03 1.28527532e-03 1.28527532e-03 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 1.96268001e-04 -3.07748924e-04 -3.07748924e-04 1.78209909e-04 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 -4.14019247e-04 -6.42637659e-04 -4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.82434463e-04 8.08681204e-05 1.78209909e-04 4.86708945e-05 -4.04340602e-05 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 -6.42637659e-04 -4.14019247e-04 -4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.82434463e-04 1.78209909e-04 8.08681204e-05 -4.86708945e-05 -4.04340602e-05 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 -2.41529920e-02 1.33621179e-02 1.33621179e-02 -4.89198722e-04 8.27434268e-04 8.27434268e-04 -4.92484006e-04 1.06639054e-03 9.35225951e-03 -4.15611128e-03 1.31106178e-03 2.07805564e-03 1.33621179e-02 -4.10981523e-03 -6.68105894e-03 5.17455810e-04 -1.77416518e-04 -4.92484006e-04 -1.57533744e-04 8.87082588e-05 1.06639054e-03 9.35225951e-03 -4.15611128e-03 2.07805564e-03 1.31106178e-03 1.33621179e-02 -6.68105894e-03 -4.10981523e-03 5.17455810e-04 -4.92484006e-04 -1.77416518e-04 1.57533744e-04 8.87082588e-05 9.05613602e-05 5.70753169e-04 -1.96268001e-04 1.82434463e-04 1.82434463e-04 4.89198722e-04 -5.17455810e-04 -5.17455810e-04 -8.99306349e-05 8.30889164e-05 8.30889164e-05 -3.38595206e-05 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 -8.08681204e-05 -1.78209909e-04 -8.27434268e-04 1.77416518e-04 4.92484006e-04 8.30889164e-05 -1.08000471e-04 -9.44638495e-05 8.87380160e-06 5.38872760e-05 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 -1.78209909e-04 -8.08681204e-05 -8.27434268e-04 4.92484006e-04 1.77416518e-04 8.30889164e-05 -9.44638495e-05 -1.08000471e-04 -8.87380160e-06 5.38872760e-05 -4.86708945e-05 4.86708945e-05 1.57533744e-04 -1.57533744e-04 8.87380160e-06 -8.87380160e-06 -4.66282012e-06 5.22856257e-05 3.29524496e-04 -1.78209909e-04 4.04340602e-05 4.04340602e-05 4.92484006e-04 -8.87082588e-05 -8.87082588e-05 -3.38595206e-05 5.38872760e-05 5.38872760e-05 -2.71695573e-05 1.40271766e-02 6.79314330e-02 -3.83997120e-02 1.27999040e-02 1.27999040e-02 9.39695701e-02 -3.13231900e-02 -3.13231900e-02 -3.90015343e-03 2.53322396e-03 2.53322396e-03 -8.44407987e-04 1.70328256e-04 1.56710856e-03 -6.51378048e-04 3.25689024e-04 3.25689024e-04 2.13278108e-03 -1.06639054e-03 -1.06639054e-03 9.05613602e-05 -1.04571251e-04 -1.04571251e-04 5.22856257e-05 6.79314330e-02 1.60907873e-01 -1.22953680e-01 4.09845600e-02 4.09845600e-02 1.78426204e-01 -5.94754012e-02 -5.94754012e-02 -4.00211138e-02 2.59944760e-02 2.59944760e-02 -8.66482532e-03 1.56710856e-03 1.39613919e-02 -5.79216869e-03 2.89608434e-03 2.89608434e-03 1.87045190e-02 -9.35225951e-03 -9.35225951e-03 5.70753169e-04 -6.59048991e-04 -6.59048991e-04 3.29524496e-04 3.83997120e-02 1.22953680e-01 -8.01243800e-02 3.21974808e-02 3.21974808e-02 1.50606551e-01 -6.28329901e-02 -6.28329901e-02 -1.84441412e-02 1.41362236e-02 1.41362236e-02 -5.28711521e-03 6.51378048e-04 5.79216869e-03 -2.34193222e-03 1.28527532e-03 1.28527532e-03 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 1.96268001e-04 -3.07748924e-04 -3.07748924e-04 1.78209909e-04 -1.27999040e-02 -4.09845600e-02 3.21974808e-02 5.73556868e-03 -1.07324936e-02 -6.28329901e-02 -1.69480895e-02 2.09443300e-02 9.13604602e-03 -1.11749199e-04 -5.28711521e-03 -1.72512200e-03 3.72497331e-05 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 -4.14019247e-04 -6.42637659e-04 -4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.82434463e-04 8.08681204e-05 1.78209909e-04 4.86708945e-05 -4.04340602e-05 -1.27999040e-02 -4.09845600e-02 3.21974808e-02 -1.07324936e-02 5.73556868e-03 -6.28329901e-02 2.09443300e-02 -1.69480895e-02 9.13604602e-03 -5.28711521e-03 -1.11749199e-04 1.72512200e-03 3.72497331e-05 -3.25689024e-04 -2.89608434e-03 1.28527532e-03 -6.42637659e-04 -4.14019247e-04 -4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.82434463e-04 1.78209909e-04 8.08681204e-05 -4.86708945e-05 -4.04340602e-05 -9.39695701e-02 -1.78426204e-01 1.50606551e-01 -6.28329901e-02 -6.28329901e-02 -1.74532412e-01 8.26569598e-02 8.26569598e-02 5.25781272e-02 -4.25165420e-02 -4.25165420e-02 1.64031264e-02 -2.13278108e-03 -1.87045190e-02 7.54522870e-03 -4.15611128e-03 -4.15611128e-03 -2.41529920e-02 1.33621179e-02 1.33621179e-02 -4.89198722e-04 8.27434268e-04 8.27434268e-04 -4.92484006e-04 3.13231900e-02 5.94754012e-02 -6.28329901e-02 -1.69480895e-02 2.09443300e-02 8.26569598e-02 4.58861475e-02 -2.75523199e-02 -2.91183766e-02 -3.67538539e-03 1.64031264e-02 6.69283727e-03 1.22512846e-03 1.06639054e-03 9.35225951e-03 -4.15611128e-03 1.31106178e-03 2.07805564e-03 1.33621179e-02 -4.10981523e-03 -6.68105894e-03 5.17455810e-04 -1.77416518e-04 -4.92484006e-04 -1.57533744e-04 8.87082588e-05 3.13231900e-02 5.94754012e-02 -6.28329901e-02 2.09443300e-02 -1.69480895e-02 8.26569598e-02 -2.75523199e-02 4.58861475e-02 -2.91183766e-02 1.64031264e-02 -3.67538539e-03 -6.69283727e-03 1.22512846e-03 1.06639054e-03 9.35225951e-03 -4.15611128e-03 2.07805564e-03 1.31106178e-03 1.33621179e-02 -6.68105894e-03 -4.10981523e-03 5.17455810e-04 -4.92484006e-04 -1.77416518e-04 1.57533744e-04 8.87082588e-05 -3.90015343e-03 -4.00211138e-02 1.84441412e-02 -9.13604602e-03 -9.13604602e-03 -5.25781272e-02 2.91183766e-02 2.91183766e-02 6.04442117e-03 -2.70322369e-03 -2.70322369e-03 4.80114852e-04 9.05613602e-05 5.70753169e-04 -1.96268001e-04 1.82434463e-04 1.82434463e-04 4.89198722e-04 -5.17455810e-04 -5.17455810e-04 -8.99306349e-05 8.30889164e-05 8.30889164e-05 -3.38595206e-05 2.53322396e-03 2.59944760e-02 -1.41362236e-02 1.11749199e-04 5.28711521e-03 4.25165420e-02 3.67538539e-03 -1.64031264e-02 -2.70322369e-03 3.36490998e-03 1.72541514e-03 -7.29123606e-04 -1.22324825e-03 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 -8.08681204e-05 -1.78209909e-04 -8.27434268e-04 1.77416518e-04 4.92484006e-04 8.30889164e-05 -1.08000471e-04 -9.44638495e-05 8.87380160e-06 5.38872760e-05 2.53322396e-03 2.59944760e-02 -1.41362236e-02 5.28711521e-03 1.11749199e-04 4.25165420e-02 -1.64031264e-02 3.67538539e-03 -2.70322369e-03 1.72541514e-03 3.36490998e-03 7.29123606e-04 -1.22324825e-03 -1.04571251e-04 -6.59048991e-04 3.07748924e-04 -1.78209909e-04 -8.08681204e-05 -8.27434268e-04 4.92484006e-04 1.77416518e-04 8.30889164e-05 -9.44638495e-05 -1.08000471e-04 -8.87380160e-06 5.38872760e-05 1.72512200e-03 -1.72512200e-03 -6.69283727e-03 6.69283727e-03 -7.29123606e-04 7.29123606e-04 -6.17935738e-05 -4.86708945e-05 4.86708945e-05 1.57533744e-04 -1.57533744e-04 8.87380160e-06 -8.87380160e-06 -4.66282012e-06 -8.44407987e-04 -8.66482532e-03 5.28711521e-03 -3.72497331e-05 -3.72497331e-05 -1.64031264e-02 -1.22512846e-03 -1.22512846e-03 4.80114852e-04 -1.22324825e-03 -1.22324825e-03 1.02914641e-04 5.22856257e-05 3.29524496e-04 -1.78209909e-04 4.04340602e-05 4.04340602e-05 4.92484006e-04 -8.87082588e-05 -8.87082588e-05 -3.38595206e-05 5.38872760e-05 5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 3 4 6 7 9 10 11 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 12 24 36 49 62 74 87 100 112 125 138 145 157 181 205 229 255 281 305 331 357 381 407 433 447 471 -0 1 2 169 - 1.25466617e-06 1.34349826e-05 -6.58962236e-06 1.31792447e-06 3.95377341e-06 2.19886127e-05 -4.39772254e-06 -1.31931676e-05 3.04388134e-06 -1.31803928e-06 -3.95411785e-06 -1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 -7.13481329e-05 1.42696266e-05 4.28088798e-05 2.37845052e-04 -4.75690104e-05 -1.42707031e-04 3.21001433e-05 -1.38997698e-05 -4.16993094e-05 -1.11198158e-05 8.33986187e-06 6.58962236e-06 7.13481329e-05 -3.45682450e-05 7.04340302e-06 2.11302091e-05 1.16121122e-04 -2.36453257e-05 -7.09359772e-05 1.59884824e-05 -7.11294712e-06 -2.13388414e-05 -5.79154766e-06 4.34366074e-06 -1.31792447e-06 -1.42696266e-05 7.04340302e-06 -7.59910514e-07 -4.22604181e-06 -2.36453257e-05 2.62355898e-06 1.41871954e-05 -3.41677917e-06 8.15449649e-07 4.34366074e-06 1.28479698e-06 -4.89269790e-07 -3.95377341e-06 -4.28088798e-05 2.11302091e-05 -4.22604181e-06 -1.20293553e-05 -7.09359772e-05 1.41871954e-05 4.04560801e-05 -1.02503375e-05 4.34366074e-06 1.23985450e-05 3.09546624e-06 -2.47970899e-06 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 -2.36453257e-05 -7.09359772e-05 -3.88706075e-04 7.91031105e-05 2.37309331e-04 -5.45492648e-05 2.42318426e-05 7.26955279e-05 1.97115105e-05 -1.47836328e-05 4.39772254e-06 4.75690104e-05 -2.36453257e-05 2.62355898e-06 1.41871954e-05 7.91031105e-05 -9.01114524e-06 -4.74618663e-05 1.16157423e-05 -2.89015053e-06 -1.47836328e-05 -4.34984751e-06 1.73409032e-06 1.31931676e-05 1.42707031e-04 -7.09359772e-05 1.41871954e-05 4.04560801e-05 2.37309331e-04 -4.74618663e-05 -1.35576122e-04 3.48472270e-05 -1.47836328e-05 -4.23131714e-05 -1.06042700e-05 8.46263429e-06 3.04388134e-06 3.21001433e-05 -1.59884824e-05 3.41677917e-06 1.02503375e-05 5.45492648e-05 -1.16157423e-05 -3.48472270e-05 5.56082368e-06 -2.46595043e-06 -7.39785129e-06 -2.00638043e-06 1.50478532e-06 -1.31803928e-06 -1.38997698e-05 7.11294712e-06 -8.15449649e-07 -4.34366074e-06 -2.42318426e-05 2.89015053e-06 1.47836328e-05 -2.46595043e-06 9.59219321e-07 3.20700306e-06 8.83346132e-07 -5.71522584e-07 -3.95411785e-06 -4.16993094e-05 2.13388414e-05 -4.34366074e-06 -1.23985450e-05 -7.26955279e-05 1.47836328e-05 4.23131714e-05 -7.39785129e-06 3.20700306e-06 9.51122747e-06 2.50445917e-06 -1.90867338e-06 -1.05443143e-06 -1.11198158e-05 5.79154766e-06 -1.28479698e-06 -3.09546624e-06 -1.97115105e-05 4.34984751e-06 1.06042700e-05 -2.00638043e-06 8.83346132e-07 2.50445917e-06 6.50274256e-07 -5.15449757e-07 7.90823570e-07 8.33986187e-06 -4.34366074e-06 4.89269790e-07 2.47970899e-06 1.47836328e-05 -1.73409032e-06 -8.46263429e-06 1.50478532e-06 -5.71522584e-07 -1.90867338e-06 -5.15449757e-07 3.49595231e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -0 2 -2 516 - 8.23315696e-06 9.02495943e-05 3.30136560e-05 -3.30136560e-05 -1.15322826e-04 1.15322826e-04 -1.30101956e-05 -2.25343198e-05 1.25466617e-06 1.34349826e-05 -1.31792447e-06 6.58962236e-06 -3.95377341e-06 4.39772254e-06 -2.19886127e-05 1.31931676e-05 -2.43510507e-06 -1.31803928e-06 7.90823570e-07 2.10886285e-06 -3.95411785e-06 9.02495943e-05 9.91070319e-04 3.61844250e-04 -3.61844250e-04 -1.26431932e-03 1.26431932e-03 -1.44682422e-04 -2.50597306e-04 1.34349826e-05 1.43209127e-04 -1.42696266e-05 7.13481329e-05 -4.28088798e-05 4.75690104e-05 -2.37845052e-04 1.42707031e-04 -2.56801146e-05 -1.38997698e-05 8.33986187e-06 2.22396317e-05 -4.16993094e-05 6.96094992e-06 -2.39796963e-05 5.18708531e-06 -5.18708531e-06 1.31792447e-06 1.42696266e-05 -7.59910514e-07 7.04340302e-06 -4.22604181e-06 2.62355898e-06 -2.36453257e-05 1.41871954e-05 -2.82105641e-06 -8.15449649e-07 4.89269790e-07 2.31661906e-06 -4.34366074e-06 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 5.06876205e-05 5.18708531e-06 8.77935341e-05 -6.58962236e-06 -7.13481329e-05 7.04340302e-06 -3.45682450e-05 2.11302091e-05 -2.36453257e-05 1.16121122e-04 -7.09359772e-05 1.30098686e-05 7.11294712e-06 -4.34366074e-06 -1.09506581e-05 2.13388414e-05 3.30136560e-05 3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 -5.06876205e-05 5.18708531e-06 -8.77935341e-05 3.95377341e-06 4.28088798e-05 -4.22604181e-06 2.11302091e-05 -1.20293553e-05 1.41871954e-05 -7.09359772e-05 4.04560801e-05 -7.80592115e-06 -4.34366074e-06 2.47970899e-06 7.32931955e-06 -1.23985450e-05 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 1.79871070e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 -2.36453257e-05 1.41871954e-05 -9.01114524e-06 7.91031105e-05 -4.74618663e-05 9.57494961e-06 2.89015053e-06 -1.73409032e-06 -7.88460418e-06 1.47836328e-05 1.15322826e-04 1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 -1.78648211e-04 -1.79871070e-05 -3.09427778e-04 2.19886127e-05 2.37845052e-04 -2.36453257e-05 1.16121122e-04 -7.09359772e-05 7.91031105e-05 -3.88706075e-04 2.37309331e-04 -4.43453012e-05 -2.42318426e-05 1.47836328e-05 3.73852938e-05 -7.26955279e-05 -1.15322826e-04 -1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 1.78648211e-04 -1.79871070e-05 3.09427778e-04 -1.31931676e-05 -1.42707031e-04 1.41871954e-05 -7.09359772e-05 4.04560801e-05 -4.74618663e-05 2.37309331e-04 -1.35576122e-04 2.66071807e-05 1.47836328e-05 -8.46263429e-06 -2.48764488e-05 4.23131714e-05 -1.30101956e-05 -1.44682422e-04 -5.06876205e-05 5.06876205e-05 1.78648211e-04 -1.78648211e-04 2.10894554e-05 3.62362512e-05 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 -1.30098686e-05 7.80592115e-06 -9.57494961e-06 4.43453012e-05 -2.66071807e-05 3.61548803e-06 1.99797541e-06 -1.19878524e-06 -3.12952049e-06 5.86785091e-06 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 4.26298824e-06 -1.31803928e-06 -1.38997698e-05 8.15449649e-07 -7.11294712e-06 4.34366074e-06 -2.89015053e-06 2.42318426e-05 -1.47836328e-05 1.99797541e-06 9.59219321e-07 -5.71522584e-07 -1.69390265e-06 3.20700306e-06 5.18708531e-06 -1.79871070e-05 4.26298824e-06 -4.09454220e-06 7.90823570e-07 8.33986187e-06 -4.89269790e-07 4.34366074e-06 -2.47970899e-06 1.73409032e-06 -1.47836328e-05 8.46263429e-06 -1.19878524e-06 -5.71522584e-07 3.49595231e-07 1.04545744e-06 -1.90867338e-06 -5.18708531e-06 -5.18708531e-06 1.79871070e-05 1.79871070e-05 -8.35753044e-06 2.10886285e-06 2.22396317e-05 -2.31661906e-06 1.09506581e-05 -7.32931955e-06 7.88460418e-06 -3.73852938e-05 2.48764488e-05 -3.12952049e-06 -1.69390265e-06 1.04545744e-06 2.59560990e-06 -5.15449757e-06 -2.25343198e-05 -2.50597306e-04 -8.77935341e-05 8.77935341e-05 3.09427778e-04 -3.09427778e-04 3.62362512e-05 6.29314743e-05 -3.95411785e-06 -4.16993094e-05 4.34366074e-06 -2.13388414e-05 1.23985450e-05 -1.47836328e-05 7.26955279e-05 -4.23131714e-05 5.86785091e-06 3.20700306e-06 -1.90867338e-06 -5.15449757e-06 9.51122747e-06 1.25466617e-06 1.34349826e-05 1.31792447e-06 3.95377341e-06 -6.58962236e-06 -4.39772254e-06 -1.31931676e-05 2.19886127e-05 -2.43510507e-06 7.90823570e-07 -1.31803928e-06 -2.10886285e-06 -3.95411785e-06 8.23315696e-06 9.02495943e-05 3.30136560e-05 -3.30136560e-05 -1.15322826e-04 1.15322826e-04 -1.30101956e-05 -2.25343198e-05 1.34349826e-05 1.43209127e-04 1.42696266e-05 4.28088798e-05 -7.13481329e-05 -4.75690104e-05 -1.42707031e-04 2.37845052e-04 -2.56801146e-05 8.33986187e-06 -1.38997698e-05 -2.22396317e-05 -4.16993094e-05 9.02495943e-05 9.91070319e-04 3.61844250e-04 -3.61844250e-04 -1.26431932e-03 1.26431932e-03 -1.44682422e-04 -2.50597306e-04 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 -4.22604181e-06 7.04340302e-06 2.62355898e-06 1.41871954e-05 -2.36453257e-05 2.82105641e-06 -4.89269790e-07 8.15449649e-07 2.31661906e-06 4.34366074e-06 6.96094992e-06 -2.39796963e-05 5.18708531e-06 -5.18708531e-06 -3.95377341e-06 -4.28088798e-05 -4.22604181e-06 -1.20293553e-05 2.11302091e-05 1.41871954e-05 4.04560801e-05 -7.09359772e-05 7.80592115e-06 -2.47970899e-06 4.34366074e-06 7.32931955e-06 1.23985450e-05 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 5.06876205e-05 5.18708531e-06 8.77935341e-05 6.58962236e-06 7.13481329e-05 7.04340302e-06 2.11302091e-05 -3.45682450e-05 -2.36453257e-05 -7.09359772e-05 1.16121122e-04 -1.30098686e-05 4.34366074e-06 -7.11294712e-06 -1.09506581e-05 -2.13388414e-05 3.30136560e-05 3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 -5.06876205e-05 5.18708531e-06 -8.77935341e-05 4.39772254e-06 4.75690104e-05 2.62355898e-06 1.41871954e-05 -2.36453257e-05 -9.01114524e-06 -4.74618663e-05 7.91031105e-05 -9.57494961e-06 1.73409032e-06 -2.89015053e-06 -7.88460418e-06 -1.47836328e-05 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 1.79871070e-05 1.31931676e-05 1.42707031e-04 1.41871954e-05 4.04560801e-05 -7.09359772e-05 -4.74618663e-05 -1.35576122e-04 2.37309331e-04 -2.66071807e-05 8.46263429e-06 -1.47836328e-05 -2.48764488e-05 -4.23131714e-05 1.15322826e-04 1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 -1.78648211e-04 -1.79871070e-05 -3.09427778e-04 -2.19886127e-05 -2.37845052e-04 -2.36453257e-05 -7.09359772e-05 1.16121122e-04 7.91031105e-05 2.37309331e-04 -3.88706075e-04 4.43453012e-05 -1.47836328e-05 2.42318426e-05 3.73852938e-05 7.26955279e-05 -1.15322826e-04 -1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 1.78648211e-04 -1.79871070e-05 3.09427778e-04 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 -7.80592115e-06 1.30098686e-05 9.57494961e-06 2.66071807e-05 -4.43453012e-05 3.61548803e-06 -1.19878524e-06 1.99797541e-06 3.12952049e-06 5.86785091e-06 -1.30101956e-05 -1.44682422e-04 -5.06876205e-05 5.06876205e-05 1.78648211e-04 -1.78648211e-04 2.10894554e-05 3.62362512e-05 7.90823570e-07 8.33986187e-06 4.89269790e-07 2.47970899e-06 -4.34366074e-06 -1.73409032e-06 -8.46263429e-06 1.47836328e-05 -1.19878524e-06 3.49595231e-07 -5.71522584e-07 -1.04545744e-06 -1.90867338e-06 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 4.26298824e-06 -1.31803928e-06 -1.38997698e-05 -8.15449649e-07 -4.34366074e-06 7.11294712e-06 2.89015053e-06 1.47836328e-05 -2.42318426e-05 1.99797541e-06 -5.71522584e-07 9.59219321e-07 1.69390265e-06 3.20700306e-06 5.18708531e-06 -1.79871070e-05 4.26298824e-06 -4.09454220e-06 -2.10886285e-06 -2.22396317e-05 -2.31661906e-06 -7.32931955e-06 1.09506581e-05 7.88460418e-06 2.48764488e-05 -3.73852938e-05 3.12952049e-06 -1.04545744e-06 1.69390265e-06 2.59560990e-06 5.15449757e-06 -5.18708531e-06 -5.18708531e-06 1.79871070e-05 1.79871070e-05 -8.35753044e-06 -3.95411785e-06 -4.16993094e-05 -4.34366074e-06 -1.23985450e-05 2.13388414e-05 1.47836328e-05 4.23131714e-05 -7.26955279e-05 5.86785091e-06 -1.90867338e-06 3.20700306e-06 5.15449757e-06 9.51122747e-06 -2.25343198e-05 -2.50597306e-04 -8.77935341e-05 8.77935341e-05 3.09427778e-04 -3.09427778e-04 3.62362512e-05 6.29314743e-05 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 25 - 0 21 42 59 81 103 120 142 164 185 202 219 237 258 279 300 317 339 361 378 400 422 443 460 477 495 516 -0 2 -1 664 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 6.51378048e-04 -3.25689024e-04 1.06639054e-03 -2.13278108e-03 1.06639054e-03 -4.52806801e-05 -1.04571251e-04 5.22856257e-05 7.84284385e-05 -1.04571251e-04 1.25466617e-06 1.34349826e-05 -3.95377341e-06 6.58962236e-06 -1.31792447e-06 1.31931676e-05 -2.19886127e-05 4.39772254e-06 -6.08776268e-07 -3.95411785e-06 7.90823570e-07 3.16329428e-06 -1.31803928e-06 1.56710856e-03 1.39613919e-02 -2.89608434e-03 5.79216869e-03 -2.89608434e-03 9.35225951e-03 -1.87045190e-02 9.35225951e-03 -2.85376584e-04 -6.59048991e-04 3.29524496e-04 4.94286743e-04 -6.59048991e-04 1.34349826e-05 1.43209127e-04 -4.28088798e-05 7.13481329e-05 -1.42696266e-05 1.42707031e-04 -2.37845052e-04 4.75690104e-05 -6.42002866e-06 -4.16993094e-05 8.33986187e-06 3.33594475e-05 -1.38997698e-05 3.25689024e-04 2.89608434e-03 -4.14019247e-04 1.28527532e-03 -6.42637659e-04 1.31106178e-03 -4.15611128e-03 2.07805564e-03 -1.33367462e-04 -8.08681204e-05 4.04340602e-05 1.33657432e-04 -1.78209909e-04 3.95377341e-06 4.28088798e-05 -1.20293553e-05 2.11302091e-05 -4.22604181e-06 4.04560801e-05 -7.09359772e-05 1.41871954e-05 -2.44441635e-06 -1.23985450e-05 2.47970899e-06 1.04247858e-05 -4.34366074e-06 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 -2.34193222e-03 1.28527532e-03 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 9.81340007e-05 3.07748924e-04 -1.78209909e-04 -1.69973075e-04 3.07748924e-04 -6.58962236e-06 -7.13481329e-05 2.11302091e-05 -3.45682450e-05 7.04340302e-06 -7.09359772e-05 1.16121122e-04 -2.36453257e-05 2.97861377e-06 2.13388414e-05 -4.34366074e-06 -1.67422057e-05 7.11294712e-06 3.25689024e-04 2.89608434e-03 -6.42637659e-04 1.28527532e-03 -4.14019247e-04 2.07805564e-03 -4.15611128e-03 1.31106178e-03 -4.90670003e-05 -1.78209909e-04 4.04340602e-05 1.82328327e-04 -8.08681204e-05 1.31792447e-06 1.42696266e-05 -4.22604181e-06 7.04340302e-06 -7.59910514e-07 1.41871954e-05 -2.36453257e-05 2.62355898e-06 -5.95722755e-07 -4.34366074e-06 4.89269790e-07 3.60141605e-06 -8.15449649e-07 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -4.15611128e-03 2.07805564e-03 -4.10981523e-03 1.33621179e-02 -6.68105894e-03 3.95156129e-04 1.77416518e-04 -8.87082588e-05 -3.69363005e-04 4.92484006e-04 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 -7.09359772e-05 1.41871954e-05 -1.35576122e-04 2.37309331e-04 -4.74618663e-05 8.24004626e-06 4.23131714e-05 -8.46263429e-06 -3.54807188e-05 1.47836328e-05 2.13278108e-03 1.87045190e-02 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 1.33621179e-02 -2.41529920e-02 1.33621179e-02 -2.44599361e-04 -8.27434268e-04 4.92484006e-04 4.23658521e-04 -8.27434268e-04 2.19886127e-05 2.37845052e-04 -7.09359772e-05 1.16121122e-04 -2.36453257e-05 2.37309331e-04 -3.88706075e-04 7.91031105e-05 -1.02039636e-05 -7.26955279e-05 1.47836328e-05 5.70968043e-05 -2.42318426e-05 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 -4.15611128e-03 1.31106178e-03 -6.68105894e-03 1.33621179e-02 -4.10981523e-03 1.22299680e-04 4.92484006e-04 -8.87082588e-05 -5.26896749e-04 1.77416518e-04 -4.39772254e-06 -4.75690104e-05 1.41871954e-05 -2.36453257e-05 2.62355898e-06 -4.74618663e-05 7.91031105e-05 -9.01114524e-06 2.04079272e-06 1.47836328e-05 -1.73409032e-06 -1.22344517e-05 2.89015053e-06 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -9.81340007e-05 4.90670003e-05 -3.95156129e-04 2.44599361e-04 -1.22299680e-04 -2.59797738e-05 -3.38595206e-05 1.69297603e-05 3.69220468e-05 -4.92293958e-05 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 -2.97861377e-06 5.95722755e-07 -8.24004626e-06 1.02039636e-05 -2.04079272e-06 1.40335193e-07 1.53000038e-06 -3.06000076e-07 -1.12314006e-06 4.67975025e-07 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 -3.07748924e-04 1.78209909e-04 -1.77416518e-04 8.27434268e-04 -4.92484006e-04 -3.38595206e-05 -1.08000471e-04 5.38872760e-05 7.63940131e-05 -9.44638495e-05 -3.95411785e-06 -4.16993094e-05 1.23985450e-05 -2.13388414e-05 4.34366074e-06 -4.23131714e-05 7.26955279e-05 -1.47836328e-05 1.53000038e-06 9.51122747e-06 -1.90867338e-06 -7.65895674e-06 3.20700306e-06 5.22856257e-05 3.29524496e-04 -4.04340602e-05 1.78209909e-04 -4.04340602e-05 8.87082588e-05 -4.92484006e-04 8.87082588e-05 1.69297603e-05 5.38872760e-05 -2.71695573e-05 -2.93232050e-05 5.38872760e-05 7.90823570e-07 8.33986187e-06 -2.47970899e-06 4.34366074e-06 -4.89269790e-07 8.46263429e-06 -1.47836328e-05 1.73409032e-06 -3.06000076e-07 -1.90867338e-06 3.49595231e-07 1.56090719e-06 -5.71522584e-07 7.84284385e-05 4.94286743e-04 -1.33657432e-04 1.69973075e-04 -1.82328327e-04 3.69363005e-04 -4.23658521e-04 5.26896749e-04 3.69220468e-05 7.63940131e-05 -2.93232050e-05 -6.86136812e-05 6.75202116e-05 3.16329428e-06 3.33594475e-05 -1.04247858e-05 1.67422057e-05 -3.60141605e-06 3.54807188e-05 -5.70968043e-05 1.22344517e-05 -1.12314006e-06 -7.65895674e-06 1.56090719e-06 6.07076274e-06 -2.57724878e-06 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 -3.07748924e-04 8.08681204e-05 -4.92484006e-04 8.27434268e-04 -1.77416518e-04 -4.92293958e-05 -9.44638495e-05 5.38872760e-05 6.75202116e-05 -1.08000471e-04 -1.31803928e-06 -1.38997698e-05 4.34366074e-06 -7.11294712e-06 8.15449649e-07 -1.47836328e-05 2.42318426e-05 -2.89015053e-06 4.67975025e-07 3.20700306e-06 -5.71522584e-07 -2.57724878e-06 9.59219321e-07 9.03813139e-04 6.83095219e-03 -8.43309998e-04 2.52992999e-03 -2.52992999e-03 2.52360170e-03 -7.57080511e-03 7.57080511e-03 -1.01044875e-04 -6.56305714e-05 6.56305714e-05 -1.96891714e-04 1.70328256e-04 1.56710856e-03 -3.25689024e-04 6.51378048e-04 -3.25689024e-04 1.06639054e-03 -2.13278108e-03 1.06639054e-03 -4.52806801e-05 -1.04571251e-04 5.22856257e-05 7.84284385e-05 -1.04571251e-04 6.83095219e-03 4.49022829e-02 -5.72585887e-03 1.71775766e-02 -1.71775766e-02 1.58598947e-02 -4.75796841e-02 4.75796841e-02 1.04130562e-03 6.76347839e-04 -6.76347839e-04 2.02904352e-03 1.56710856e-03 1.39613919e-02 -2.89608434e-03 5.79216869e-03 -2.89608434e-03 9.35225951e-03 -1.87045190e-02 9.35225951e-03 -2.85376584e-04 -6.59048991e-04 3.29524496e-04 4.94286743e-04 -6.59048991e-04 8.43309998e-04 5.72585887e-03 4.26061120e-04 2.38239659e-03 -2.38239659e-03 -1.48235482e-03 -6.78418274e-03 6.78418274e-03 -7.13997564e-06 1.56159564e-04 -1.56159564e-04 8.25656177e-05 3.25689024e-04 2.89608434e-03 -4.14019247e-04 1.28527532e-03 -6.42637659e-04 1.31106178e-03 -4.15611128e-03 2.07805564e-03 -1.33367462e-04 -8.08681204e-05 4.04340602e-05 1.33657432e-04 -1.78209909e-04 -2.52992999e-03 -1.71775766e-02 2.38239659e-03 -5.92699644e-03 7.14718976e-03 -6.78418274e-03 1.66087992e-02 -2.03525482e-02 -2.01387090e-04 -1.25444848e-04 8.25656177e-05 1.28637691e-04 -3.76334544e-04 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 -2.34193222e-03 1.28527532e-03 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 9.81340007e-05 3.07748924e-04 -1.78209909e-04 -1.69973075e-04 3.07748924e-04 2.52992999e-03 1.71775766e-02 -2.38239659e-03 7.14718976e-03 -5.92699644e-03 6.78418274e-03 -2.03525482e-02 1.66087992e-02 2.01387090e-04 8.25656177e-05 -1.25444848e-04 1.28637691e-04 3.76334544e-04 3.25689024e-04 2.89608434e-03 -6.42637659e-04 1.28527532e-03 -4.14019247e-04 2.07805564e-03 -4.15611128e-03 1.31106178e-03 -4.90670003e-05 -1.78209909e-04 4.04340602e-05 1.82328327e-04 -8.08681204e-05 -2.52360170e-03 -1.58598947e-02 -1.48235482e-03 -6.78418274e-03 6.78418274e-03 5.13458842e-03 1.85131107e-02 -1.85131107e-02 -4.18310329e-04 -5.12122996e-04 5.12122996e-04 -9.59355067e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -4.15611128e-03 2.07805564e-03 -4.10981523e-03 1.33621179e-02 -6.68105894e-03 3.95156129e-04 1.77416518e-04 -8.87082588e-05 -3.69363005e-04 4.92484006e-04 7.57080511e-03 4.75796841e-02 -6.78418274e-03 1.66087992e-02 -2.03525482e-02 1.85131107e-02 -4.42337068e-02 5.55393321e-02 1.58807013e-03 1.02346772e-03 -9.59355067e-04 -1.92337974e-04 3.07040317e-03 2.13278108e-03 1.87045190e-02 -4.15611128e-03 7.54522870e-03 -4.15611128e-03 1.33621179e-02 -2.41529920e-02 1.33621179e-02 -2.44599361e-04 -8.27434268e-04 4.92484006e-04 4.23658521e-04 -8.27434268e-04 -7.57080511e-03 -4.75796841e-02 6.78418274e-03 -2.03525482e-02 1.66087992e-02 -1.85131107e-02 5.55393321e-02 -4.42337068e-02 -1.58807013e-03 -9.59355067e-04 1.02346772e-03 -1.92337974e-04 -3.07040317e-03 -1.06639054e-03 -9.35225951e-03 2.07805564e-03 -4.15611128e-03 1.31106178e-03 -6.68105894e-03 1.33621179e-02 -4.10981523e-03 1.22299680e-04 4.92484006e-04 -8.87082588e-05 -5.26896749e-04 1.77416518e-04 -1.01044875e-04 1.04130562e-03 7.13997564e-06 2.01387090e-04 -2.01387090e-04 4.18310329e-04 -1.58807013e-03 1.58807013e-03 -3.27420436e-04 -3.35519138e-04 3.35519138e-04 -6.97611067e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -9.81340007e-05 4.90670003e-05 -3.95156129e-04 2.44599361e-04 -1.22299680e-04 -2.59797738e-05 -3.38595206e-05 1.69297603e-05 3.69220468e-05 -4.92293958e-05 -6.56305714e-05 6.76347839e-04 -1.56159564e-04 1.25444848e-04 -8.25656177e-05 5.12122996e-04 -1.02346772e-03 9.59355067e-04 -3.35519138e-04 -6.48472168e-06 1.72595341e-05 -5.94567521e-05 -5.27432619e-04 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 -3.07748924e-04 1.78209909e-04 -1.77416518e-04 8.27434268e-04 -4.92484006e-04 -3.38595206e-05 -1.08000471e-04 5.38872760e-05 7.63940131e-05 -9.44638495e-05 6.56305714e-05 -6.76347839e-04 1.56159564e-04 -8.25656177e-05 1.25444848e-04 -5.12122996e-04 9.59355067e-04 -1.02346772e-03 3.35519138e-04 1.72595341e-05 -6.48472168e-06 -5.94567521e-05 5.27432619e-04 5.22856257e-05 3.29524496e-04 -4.04340602e-05 1.78209909e-04 -4.04340602e-05 8.87082588e-05 -4.92484006e-04 8.87082588e-05 1.69297603e-05 5.38872760e-05 -2.71695573e-05 -2.93232050e-05 5.38872760e-05 -1.28637691e-04 -1.28637691e-04 1.92337974e-04 1.92337974e-04 -5.94567521e-05 -5.94567521e-05 3.47696408e-04 7.84284385e-05 4.94286743e-04 -1.33657432e-04 1.69973075e-04 -1.82328327e-04 3.69363005e-04 -4.23658521e-04 5.26896749e-04 3.69220468e-05 7.63940131e-05 -2.93232050e-05 -6.86136812e-05 6.75202116e-05 -1.96891714e-04 2.02904352e-03 -8.25656177e-05 3.76334544e-04 -3.76334544e-04 9.59355067e-04 -3.07040317e-03 3.07040317e-03 -6.97611067e-04 -5.27432619e-04 5.27432619e-04 -1.41297171e-03 -1.04571251e-04 -6.59048991e-04 1.78209909e-04 -3.07748924e-04 8.08681204e-05 -4.92484006e-04 8.27434268e-04 -1.77416518e-04 -4.92293958e-05 -9.44638495e-05 5.38872760e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 363 388 413 439 465 490 516 542 567 593 619 639 664 -0 2 0 363 - 8.23315696e-06 9.02495943e-05 -3.30136560e-05 3.30136560e-05 1.15322826e-04 -1.15322826e-04 6.50509780e-06 -2.25343198e-05 1.12671599e-05 9.02495943e-05 9.91070319e-04 -3.61844250e-04 3.61844250e-04 1.26431932e-03 -1.26431932e-03 7.23412109e-05 -2.50597306e-04 1.25298653e-04 3.30136560e-05 3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 2.08516626e-05 -8.77935341e-05 4.64903097e-05 -3.30136560e-05 -3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 -2.98359579e-05 8.77935341e-05 -4.13032244e-05 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 5.18708531e-06 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 -7.37468140e-05 3.09427778e-04 -1.63707443e-04 1.15322826e-04 1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 1.04901397e-04 -3.09427778e-04 1.45720336e-04 -2.39796963e-05 8.25086154e-05 1.79871070e-05 -1.79871070e-05 6.50509780e-06 7.23412109e-05 -2.08516626e-05 2.98359579e-05 7.37468140e-05 -1.04901397e-04 -9.95783968e-07 -1.81181256e-05 1.27509189e-05 -2.25343198e-05 -2.50597306e-04 8.77935341e-05 -8.77935341e-05 -3.09427778e-04 3.09427778e-04 -1.81181256e-05 6.29314743e-05 -3.13815141e-05 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 4.26298824e-06 1.12671599e-05 1.25298653e-04 -4.64903097e-05 4.13032244e-05 1.63707443e-04 -1.45720336e-04 1.27509189e-05 -3.13815141e-05 1.37277090e-05 -5.18708531e-06 1.79871070e-05 4.26298824e-06 -4.09454220e-06 9.03813139e-04 6.83095219e-03 -2.52992999e-03 2.52992999e-03 -8.43309998e-04 7.57080511e-03 -7.57080511e-03 2.52360170e-03 5.05224374e-05 -1.96891714e-04 6.56305714e-05 8.75074285e-05 -6.56305714e-05 8.23315696e-06 9.02495943e-05 -3.30136560e-05 3.30136560e-05 1.15322826e-04 -1.15322826e-04 6.50509780e-06 -2.25343198e-05 1.12671599e-05 6.83095219e-03 4.49022829e-02 -1.71775766e-02 1.71775766e-02 -5.72585887e-03 4.75796841e-02 -4.75796841e-02 1.58598947e-02 -5.20652809e-04 2.02904352e-03 -6.76347839e-04 -9.01797119e-04 6.76347839e-04 9.02495943e-05 9.91070319e-04 -3.61844250e-04 3.61844250e-04 1.26431932e-03 -1.26431932e-03 7.23412109e-05 -2.50597306e-04 1.25298653e-04 2.52992999e-03 1.71775766e-02 -5.92699644e-03 7.14718976e-03 -2.38239659e-03 1.66087992e-02 -2.03525482e-02 6.78418274e-03 -2.12097053e-04 3.76334544e-04 -1.25444848e-04 -1.10087490e-04 8.25656177e-05 3.30136560e-05 3.61844250e-04 -1.27752976e-04 1.34713926e-04 4.47551295e-04 -4.71530992e-04 2.08516626e-05 -8.77935341e-05 4.64903097e-05 -2.52992999e-03 -1.71775766e-02 7.14718976e-03 -5.92699644e-03 2.38239659e-03 -2.03525482e-02 1.66087992e-02 -6.78418274e-03 -1.07099635e-05 -3.76334544e-04 8.25656177e-05 2.38725181e-04 -1.25444848e-04 -3.30136560e-05 -3.61844250e-04 1.34713926e-04 -1.27752976e-04 -4.71530992e-04 4.47551295e-04 -2.98359579e-05 8.77935341e-05 -4.13032244e-05 8.43309998e-04 5.72585887e-03 -2.38239659e-03 2.38239659e-03 4.26061120e-04 6.78418274e-03 -6.78418274e-03 -1.48235482e-03 3.56998782e-06 8.25656177e-05 -1.56159564e-04 6.18340029e-06 1.56159564e-04 6.96094992e-06 -2.39796963e-05 -5.18708531e-06 5.18708531e-06 -7.57080511e-03 -4.75796841e-02 1.66087992e-02 -2.03525482e-02 6.78418274e-03 -4.42337068e-02 5.55393321e-02 -1.85131107e-02 9.60604637e-04 -3.07040317e-03 1.02346772e-03 1.27914009e-03 -9.59355067e-04 -1.15322826e-04 -1.26431932e-03 4.47551295e-04 -4.71530992e-04 -1.56743151e-03 1.64994012e-03 -7.37468140e-05 3.09427778e-04 -1.63707443e-04 7.57080511e-03 4.75796841e-02 -2.03525482e-02 1.66087992e-02 -6.78418274e-03 5.55393321e-02 -4.42337068e-02 1.85131107e-02 -6.27465494e-04 3.07040317e-03 -9.59355067e-04 -1.47147806e-03 1.02346772e-03 1.15322826e-04 1.26431932e-03 -4.71530992e-04 4.47551295e-04 1.64994012e-03 -1.56743151e-03 1.04901397e-04 -3.09427778e-04 1.45720336e-04 -2.52360170e-03 -1.58598947e-02 6.78418274e-03 -6.78418274e-03 -1.48235482e-03 -1.85131107e-02 1.85131107e-02 5.13458842e-03 2.09155165e-04 -9.59355067e-04 5.12122996e-04 3.62267372e-04 -5.12122996e-04 -2.39796963e-05 8.25086154e-05 1.79871070e-05 -1.79871070e-05 5.05224374e-05 -5.20652809e-04 2.12097053e-04 1.07099635e-05 -3.56998782e-06 -9.60604637e-04 6.27465494e-04 -2.09155165e-04 1.78917197e-04 3.48805533e-04 -1.16268511e-04 -2.92334169e-04 2.19250627e-04 6.50509780e-06 7.23412109e-05 -2.08516626e-05 2.98359579e-05 7.37468140e-05 -1.04901397e-04 -9.95783968e-07 -1.81181256e-05 1.27509189e-05 -1.96891714e-04 2.02904352e-03 -3.76334544e-04 3.76334544e-04 -8.25656177e-05 3.07040317e-03 -3.07040317e-03 9.59355067e-04 3.48805533e-04 -1.41297171e-03 5.27432619e-04 6.04148906e-04 -5.27432619e-04 -2.25343198e-05 -2.50597306e-04 8.77935341e-05 -8.77935341e-05 -3.09427778e-04 3.09427778e-04 -1.81181256e-05 6.29314743e-05 -3.13815141e-05 6.56305714e-05 -6.76347839e-04 1.25444848e-04 -8.25656177e-05 1.56159564e-04 -1.02346772e-03 9.59355067e-04 -5.12122996e-04 -1.16268511e-04 5.27432619e-04 -6.48472168e-06 -3.20296473e-04 1.72595341e-05 5.18708531e-06 -1.79871070e-05 -4.09454220e-06 4.26298824e-06 8.75074285e-05 -9.01797119e-04 1.10087490e-04 -2.38725181e-04 -6.18340029e-06 -1.27914009e-03 1.47147806e-03 -3.62267372e-04 -2.92334169e-04 6.04148906e-04 -3.20296473e-04 -1.58641225e-04 2.60839721e-04 1.12671599e-05 1.25298653e-04 -4.64903097e-05 4.13032244e-05 1.63707443e-04 -1.45720336e-04 1.27509189e-05 -3.13815141e-05 1.37277090e-05 -6.56305714e-05 6.76347839e-04 -8.25656177e-05 1.25444848e-04 -1.56159564e-04 9.59355067e-04 -1.02346772e-03 5.12122996e-04 2.19250627e-04 -5.27432619e-04 1.72595341e-05 2.60839721e-04 -6.48472168e-06 -5.18708531e-06 1.79871070e-05 4.26298824e-06 -4.09454220e-06 - 0 1 2 3 5 6 8 9 11 0 1 2 3 5 6 8 9 11 0 1 2 3 5 6 8 9 11 0 1 2 3 5 6 8 9 11 4 7 10 12 0 1 2 3 5 6 8 9 11 0 1 2 3 5 6 8 9 11 4 7 10 12 0 1 2 3 5 6 8 9 11 0 1 2 3 5 6 8 9 11 4 7 10 12 0 1 2 3 5 6 8 9 11 4 7 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 - 0 9 18 27 36 40 49 58 62 71 80 84 93 97 119 141 163 185 202 224 246 263 285 307 324 346 363 -0 2 1 169 - 1.25466617e-06 1.34349826e-05 -6.58962236e-06 3.95377341e-06 1.31792447e-06 2.19886127e-05 -1.31931676e-05 -4.39772254e-06 3.04388134e-06 -3.95411785e-06 -1.31803928e-06 1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 -7.13481329e-05 4.28088798e-05 1.42696266e-05 2.37845052e-04 -1.42707031e-04 -4.75690104e-05 3.21001433e-05 -4.16993094e-05 -1.38997698e-05 1.11198158e-05 8.33986187e-06 6.58962236e-06 7.13481329e-05 -3.45682450e-05 2.11302091e-05 7.04340302e-06 1.16121122e-04 -7.09359772e-05 -2.36453257e-05 1.59884824e-05 -2.13388414e-05 -7.11294712e-06 5.79154766e-06 4.34366074e-06 -3.95377341e-06 -4.28088798e-05 2.11302091e-05 -1.20293553e-05 -4.22604181e-06 -7.09359772e-05 4.04560801e-05 1.41871954e-05 -1.02503375e-05 1.23985450e-05 4.34366074e-06 -3.09546624e-06 -2.47970899e-06 -1.31792447e-06 -1.42696266e-05 7.04340302e-06 -4.22604181e-06 -7.59910514e-07 -2.36453257e-05 1.41871954e-05 2.62355898e-06 -3.41677917e-06 4.34366074e-06 8.15449649e-07 -1.28479698e-06 -4.89269790e-07 -2.19886127e-05 -2.37845052e-04 1.16121122e-04 -7.09359772e-05 -2.36453257e-05 -3.88706075e-04 2.37309331e-04 7.91031105e-05 -5.45492648e-05 7.26955279e-05 2.42318426e-05 -1.97115105e-05 -1.47836328e-05 1.31931676e-05 1.42707031e-04 -7.09359772e-05 4.04560801e-05 1.41871954e-05 2.37309331e-04 -1.35576122e-04 -4.74618663e-05 3.48472270e-05 -4.23131714e-05 -1.47836328e-05 1.06042700e-05 8.46263429e-06 4.39772254e-06 4.75690104e-05 -2.36453257e-05 1.41871954e-05 2.62355898e-06 7.91031105e-05 -4.74618663e-05 -9.01114524e-06 1.16157423e-05 -1.47836328e-05 -2.89015053e-06 4.34984751e-06 1.73409032e-06 3.04388134e-06 3.21001433e-05 -1.59884824e-05 1.02503375e-05 3.41677917e-06 5.45492648e-05 -3.48472270e-05 -1.16157423e-05 5.56082368e-06 -7.39785129e-06 -2.46595043e-06 2.00638043e-06 1.50478532e-06 -3.95411785e-06 -4.16993094e-05 2.13388414e-05 -1.23985450e-05 -4.34366074e-06 -7.26955279e-05 4.23131714e-05 1.47836328e-05 -7.39785129e-06 9.51122747e-06 3.20700306e-06 -2.50445917e-06 -1.90867338e-06 -1.31803928e-06 -1.38997698e-05 7.11294712e-06 -4.34366074e-06 -8.15449649e-07 -2.42318426e-05 1.47836328e-05 2.89015053e-06 -2.46595043e-06 3.20700306e-06 9.59219321e-07 -8.83346132e-07 -5.71522584e-07 1.05443143e-06 1.11198158e-05 -5.79154766e-06 3.09546624e-06 1.28479698e-06 1.97115105e-05 -1.06042700e-05 -4.34984751e-06 2.00638043e-06 -2.50445917e-06 -8.83346132e-07 6.50274256e-07 5.15449757e-07 7.90823570e-07 8.33986187e-06 -4.34366074e-06 2.47970899e-06 4.89269790e-07 1.47836328e-05 -8.46263429e-06 -1.73409032e-06 1.50478532e-06 -1.90867338e-06 -5.71522584e-07 5.15449757e-07 3.49595231e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -1 -2 -1 157 - 6.09103871e-05 6.14453477e-04 2.95926902e-04 -5.91853803e-05 5.91853803e-05 -1.00862265e-03 2.01724529e-04 -2.01724529e-04 9.57738101e-05 -3.45593969e-05 3.45593969e-05 -6.91187938e-06 6.14453477e-04 6.16334179e-03 2.94640435e-03 -5.89280869e-04 5.89280869e-04 -1.00332651e-02 2.00665301e-03 -2.00665301e-03 8.94894397e-04 -3.22917201e-04 3.22917201e-04 -6.45834401e-05 -2.95926902e-04 -2.94640435e-03 -1.40977838e-03 2.96993437e-04 -2.96993437e-04 4.78344308e-03 -1.00862453e-03 1.00862453e-03 -4.13777746e-04 1.60905699e-04 -1.60905699e-04 3.43220350e-05 5.91853803e-05 5.89280869e-04 2.96993437e-04 1.57901181e-05 5.93986875e-05 -1.00862453e-03 -5.79546830e-05 -2.01724907e-04 1.01296246e-04 1.92003453e-05 3.43220350e-05 -1.07044761e-05 3.84006907e-06 -5.91853803e-05 -5.89280869e-04 -2.96993437e-04 5.93986875e-05 1.57901181e-05 1.00862453e-03 -2.01724907e-04 -5.79546830e-05 -1.01296246e-04 3.43220350e-05 1.92003453e-05 -1.07044761e-05 -3.84006907e-06 1.00862265e-03 1.00332651e-02 4.78344308e-03 -1.00862453e-03 1.00862453e-03 -1.62371149e-02 3.42697221e-03 -3.42697221e-03 1.36675680e-03 -5.33163371e-04 5.33163371e-04 -1.14013134e-04 -2.01724529e-04 -2.00665301e-03 -1.00862453e-03 -5.79546830e-05 -2.01724907e-04 3.42697221e-03 2.12351688e-04 6.85394441e-04 -3.37268019e-04 -7.04983673e-05 -1.14013134e-04 3.69023003e-05 -1.40996735e-05 2.01724529e-04 2.00665301e-03 1.00862453e-03 -2.01724907e-04 -5.79546830e-05 -3.42697221e-03 6.85394441e-04 2.12351688e-04 3.37268019e-04 -1.14013134e-04 -7.04983673e-05 3.69023003e-05 1.40996735e-05 9.57738101e-05 8.94894397e-04 4.13777746e-04 -1.01296246e-04 1.01296246e-04 -1.36675680e-03 3.37268019e-04 -3.37268019e-04 6.36867635e-05 -3.49983802e-05 3.49983802e-05 -9.35097527e-06 -3.45593969e-05 -3.22917201e-04 -1.60905699e-04 -1.92003453e-05 -3.43220350e-05 5.33163371e-04 7.04983673e-05 1.14013134e-04 -3.49983802e-05 -1.92605535e-05 -1.26855161e-05 6.78761620e-06 -3.97900833e-06 3.45593969e-05 3.22917201e-04 1.60905699e-04 -3.43220350e-05 -1.92003453e-05 -5.33163371e-04 1.14013134e-04 7.04983673e-05 3.49983802e-05 -1.26855161e-05 -1.92605535e-05 6.78761620e-06 3.97900833e-06 1.07044761e-05 1.07044761e-05 -3.69023003e-05 -3.69023003e-05 6.78761620e-06 6.78761620e-06 -7.23035088e-07 -6.91187938e-06 -6.45834401e-05 -3.43220350e-05 -3.84006907e-06 3.84006907e-06 1.14013134e-04 1.40996735e-05 -1.40996735e-05 -9.35097527e-06 -3.97900833e-06 3.97900833e-06 -1.61313514e-07 - 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 16 17 19 20 22 23 24 13 14 15 16 17 18 19 20 21 22 23 25 - 0 12 24 36 49 62 74 87 100 112 125 138 145 157 157 157 157 157 157 157 157 157 157 157 157 157 157 -1 -2 0 652 - 1.70328256e-04 1.56710856e-03 6.51378048e-04 -3.25689024e-04 3.25689024e-04 -2.13278108e-03 1.06639054e-03 -1.06639054e-03 9.05613602e-05 -1.04571251e-04 1.04571251e-04 -5.22856257e-05 9.03813139e-04 6.83095219e-03 2.52992999e-03 -8.43309998e-04 2.52992999e-03 -7.57080511e-03 2.52360170e-03 -7.57080511e-03 5.05224374e-05 -6.56305714e-05 1.96891714e-04 -8.75074285e-05 -6.56305714e-05 1.56710856e-03 1.39613919e-02 5.79216869e-03 -2.89608434e-03 2.89608434e-03 -1.87045190e-02 9.35225951e-03 -9.35225951e-03 5.70753169e-04 -6.59048991e-04 6.59048991e-04 -3.29524496e-04 6.83095219e-03 4.49022829e-02 1.71775766e-02 -5.72585887e-03 1.71775766e-02 -4.75796841e-02 1.58598947e-02 -4.75796841e-02 -5.20652809e-04 6.76347839e-04 -2.02904352e-03 9.01797119e-04 6.76347839e-04 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 1.28527532e-03 -1.28527532e-03 7.54522870e-03 -4.15611128e-03 4.15611128e-03 -1.96268001e-04 3.07748924e-04 -3.07748924e-04 1.78209909e-04 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 2.38239659e-03 -7.14718976e-03 1.66087992e-02 -6.78418274e-03 2.03525482e-02 2.12097053e-04 -1.25444848e-04 3.76334544e-04 -1.10087490e-04 -8.25656177e-05 3.25689024e-04 2.89608434e-03 1.28527532e-03 -4.14019247e-04 6.42637659e-04 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.82434463e-04 -8.08681204e-05 1.78209909e-04 -4.86708945e-05 -4.04340602e-05 8.43309998e-04 5.72585887e-03 2.38239659e-03 4.26061120e-04 2.38239659e-03 -6.78418274e-03 -1.48235482e-03 -6.78418274e-03 3.56998782e-06 1.56159564e-04 -8.25656177e-05 -6.18340029e-06 1.56159564e-04 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 6.42637659e-04 -4.14019247e-04 4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.82434463e-04 1.78209909e-04 -8.08681204e-05 -4.86708945e-05 4.04340602e-05 -2.52992999e-03 -1.71775766e-02 -7.14718976e-03 2.38239659e-03 -5.92699644e-03 2.03525482e-02 -6.78418274e-03 1.66087992e-02 -1.07099635e-05 -8.25656177e-05 3.76334544e-04 -2.38725181e-04 -1.25444848e-04 2.13278108e-03 1.87045190e-02 7.54522870e-03 -4.15611128e-03 4.15611128e-03 -2.41529920e-02 1.33621179e-02 -1.33621179e-02 4.89198722e-04 -8.27434268e-04 8.27434268e-04 -4.92484006e-04 7.57080511e-03 4.75796841e-02 1.66087992e-02 -6.78418274e-03 2.03525482e-02 -4.42337068e-02 1.85131107e-02 -5.55393321e-02 -9.60604637e-04 1.02346772e-03 -3.07040317e-03 1.27914009e-03 9.59355067e-04 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.33621179e-02 -4.10981523e-03 6.68105894e-03 -5.17455810e-04 1.77416518e-04 -4.92484006e-04 1.57533744e-04 8.87082588e-05 -2.52360170e-03 -1.58598947e-02 -6.78418274e-03 -1.48235482e-03 -6.78418274e-03 1.85131107e-02 5.13458842e-03 1.85131107e-02 2.09155165e-04 -5.12122996e-04 9.59355067e-04 -3.62267372e-04 -5.12122996e-04 1.06639054e-03 9.35225951e-03 4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.33621179e-02 6.68105894e-03 -4.10981523e-03 5.17455810e-04 -4.92484006e-04 1.77416518e-04 1.57533744e-04 -8.87082588e-05 7.57080511e-03 4.75796841e-02 2.03525482e-02 -6.78418274e-03 1.66087992e-02 -5.55393321e-02 1.85131107e-02 -4.42337068e-02 -6.27465494e-04 9.59355067e-04 -3.07040317e-03 1.47147806e-03 1.02346772e-03 9.05613602e-05 5.70753169e-04 1.96268001e-04 -1.82434463e-04 1.82434463e-04 -4.89198722e-04 5.17455810e-04 -5.17455810e-04 -8.99306349e-05 8.30889164e-05 -8.30889164e-05 3.38595206e-05 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 -3.56998782e-06 1.07099635e-05 9.60604637e-04 -2.09155165e-04 6.27465494e-04 1.78917197e-04 1.16268511e-04 -3.48805533e-04 2.92334169e-04 2.19250627e-04 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 8.08681204e-05 -1.78209909e-04 8.27434268e-04 -1.77416518e-04 4.92484006e-04 8.30889164e-05 -1.08000471e-04 9.44638495e-05 8.87380160e-06 -5.38872760e-05 -6.56305714e-05 6.76347839e-04 1.25444848e-04 -1.56159564e-04 8.25656177e-05 -1.02346772e-03 5.12122996e-04 -9.59355067e-04 1.16268511e-04 -6.48472168e-06 5.27432619e-04 -3.20296473e-04 -1.72595341e-05 1.04571251e-04 6.59048991e-04 3.07748924e-04 -1.78209909e-04 8.08681204e-05 -8.27434268e-04 4.92484006e-04 -1.77416518e-04 -8.30889164e-05 9.44638495e-05 -1.08000471e-04 8.87380160e-06 5.38872760e-05 1.96891714e-04 -2.02904352e-03 -3.76334544e-04 8.25656177e-05 -3.76334544e-04 3.07040317e-03 -9.59355067e-04 3.07040317e-03 -3.48805533e-04 5.27432619e-04 -1.41297171e-03 6.04148906e-04 5.27432619e-04 4.86708945e-05 4.86708945e-05 -1.57533744e-04 -1.57533744e-04 8.87380160e-06 8.87380160e-06 -4.66282012e-06 -8.75074285e-05 9.01797119e-04 1.10087490e-04 6.18340029e-06 2.38725181e-04 -1.27914009e-03 3.62267372e-04 -1.47147806e-03 2.92334169e-04 -3.20296473e-04 6.04148906e-04 -1.58641225e-04 -2.60839721e-04 -5.22856257e-05 -3.29524496e-04 -1.78209909e-04 4.04340602e-05 -4.04340602e-05 4.92484006e-04 -8.87082588e-05 8.87082588e-05 3.38595206e-05 -5.38872760e-05 5.38872760e-05 -2.71695573e-05 -6.56305714e-05 6.76347839e-04 8.25656177e-05 -1.56159564e-04 1.25444848e-04 -9.59355067e-04 5.12122996e-04 -1.02346772e-03 2.19250627e-04 -1.72595341e-05 5.27432619e-04 -2.60839721e-04 -6.48472168e-06 1.25466617e-06 1.34349826e-05 6.58962236e-06 -3.95377341e-06 1.31792447e-06 -2.19886127e-05 1.31931676e-05 -4.39772254e-06 3.04388134e-06 -3.95411785e-06 1.31803928e-06 1.05443143e-06 -7.90823570e-07 1.70328256e-04 1.56710856e-03 6.51378048e-04 -3.25689024e-04 3.25689024e-04 -2.13278108e-03 1.06639054e-03 -1.06639054e-03 9.05613602e-05 -1.04571251e-04 1.04571251e-04 -5.22856257e-05 1.34349826e-05 1.43209127e-04 7.13481329e-05 -4.28088798e-05 1.42696266e-05 -2.37845052e-04 1.42707031e-04 -4.75690104e-05 3.21001433e-05 -4.16993094e-05 1.38997698e-05 1.11198158e-05 -8.33986187e-06 1.56710856e-03 1.39613919e-02 5.79216869e-03 -2.89608434e-03 2.89608434e-03 -1.87045190e-02 9.35225951e-03 -9.35225951e-03 5.70753169e-04 -6.59048991e-04 6.59048991e-04 -3.29524496e-04 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 2.11302091e-05 -7.04340302e-06 1.16121122e-04 -7.09359772e-05 2.36453257e-05 -1.59884824e-05 2.13388414e-05 -7.11294712e-06 -5.79154766e-06 4.34366074e-06 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 1.28527532e-03 -1.28527532e-03 7.54522870e-03 -4.15611128e-03 4.15611128e-03 -1.96268001e-04 3.07748924e-04 -3.07748924e-04 1.78209909e-04 3.95377341e-06 4.28088798e-05 2.11302091e-05 -1.20293553e-05 4.22604181e-06 -7.09359772e-05 4.04560801e-05 -1.41871954e-05 1.02503375e-05 -1.23985450e-05 4.34366074e-06 3.09546624e-06 -2.47970899e-06 3.25689024e-04 2.89608434e-03 1.28527532e-03 -4.14019247e-04 6.42637659e-04 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.82434463e-04 -8.08681204e-05 1.78209909e-04 -4.86708945e-05 -4.04340602e-05 -1.31792447e-06 -1.42696266e-05 -7.04340302e-06 4.22604181e-06 -7.59910514e-07 2.36453257e-05 -1.41871954e-05 2.62355898e-06 -3.41677917e-06 4.34366074e-06 -8.15449649e-07 -1.28479698e-06 4.89269790e-07 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 6.42637659e-04 -4.14019247e-04 4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.82434463e-04 1.78209909e-04 -8.08681204e-05 -4.86708945e-05 4.04340602e-05 2.19886127e-05 2.37845052e-04 1.16121122e-04 -7.09359772e-05 2.36453257e-05 -3.88706075e-04 2.37309331e-04 -7.91031105e-05 5.45492648e-05 -7.26955279e-05 2.42318426e-05 1.97115105e-05 -1.47836328e-05 2.13278108e-03 1.87045190e-02 7.54522870e-03 -4.15611128e-03 4.15611128e-03 -2.41529920e-02 1.33621179e-02 -1.33621179e-02 4.89198722e-04 -8.27434268e-04 8.27434268e-04 -4.92484006e-04 -1.31931676e-05 -1.42707031e-04 -7.09359772e-05 4.04560801e-05 -1.41871954e-05 2.37309331e-04 -1.35576122e-04 4.74618663e-05 -3.48472270e-05 4.23131714e-05 -1.47836328e-05 -1.06042700e-05 8.46263429e-06 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 1.31106178e-03 -2.07805564e-03 1.33621179e-02 -4.10981523e-03 6.68105894e-03 -5.17455810e-04 1.77416518e-04 -4.92484006e-04 1.57533744e-04 8.87082588e-05 4.39772254e-06 4.75690104e-05 2.36453257e-05 -1.41871954e-05 2.62355898e-06 -7.91031105e-05 4.74618663e-05 -9.01114524e-06 1.16157423e-05 -1.47836328e-05 2.89015053e-06 4.34984751e-06 -1.73409032e-06 1.06639054e-03 9.35225951e-03 4.15611128e-03 -2.07805564e-03 1.31106178e-03 -1.33621179e-02 6.68105894e-03 -4.10981523e-03 5.17455810e-04 -4.92484006e-04 1.77416518e-04 1.57533744e-04 -8.87082588e-05 3.04388134e-06 3.21001433e-05 1.59884824e-05 -1.02503375e-05 3.41677917e-06 -5.45492648e-05 3.48472270e-05 -1.16157423e-05 5.56082368e-06 -7.39785129e-06 2.46595043e-06 2.00638043e-06 -1.50478532e-06 9.05613602e-05 5.70753169e-04 1.96268001e-04 -1.82434463e-04 1.82434463e-04 -4.89198722e-04 5.17455810e-04 -5.17455810e-04 -8.99306349e-05 8.30889164e-05 -8.30889164e-05 3.38595206e-05 -3.95411785e-06 -4.16993094e-05 -2.13388414e-05 1.23985450e-05 -4.34366074e-06 7.26955279e-05 -4.23131714e-05 1.47836328e-05 -7.39785129e-06 9.51122747e-06 -3.20700306e-06 -2.50445917e-06 1.90867338e-06 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 8.08681204e-05 -1.78209909e-04 8.27434268e-04 -1.77416518e-04 4.92484006e-04 8.30889164e-05 -1.08000471e-04 9.44638495e-05 8.87380160e-06 -5.38872760e-05 1.31803928e-06 1.38997698e-05 7.11294712e-06 -4.34366074e-06 8.15449649e-07 -2.42318426e-05 1.47836328e-05 -2.89015053e-06 2.46595043e-06 -3.20700306e-06 9.59219321e-07 8.83346132e-07 -5.71522584e-07 1.04571251e-04 6.59048991e-04 3.07748924e-04 -1.78209909e-04 8.08681204e-05 -8.27434268e-04 4.92484006e-04 -1.77416518e-04 -8.30889164e-05 9.44638495e-05 -1.08000471e-04 8.87380160e-06 5.38872760e-05 1.05443143e-06 1.11198158e-05 5.79154766e-06 -3.09546624e-06 1.28479698e-06 -1.97115105e-05 1.06042700e-05 -4.34984751e-06 2.00638043e-06 -2.50445917e-06 8.83346132e-07 6.50274256e-07 -5.15449757e-07 4.86708945e-05 4.86708945e-05 -1.57533744e-04 -1.57533744e-04 8.87380160e-06 8.87380160e-06 -4.66282012e-06 -7.90823570e-07 -8.33986187e-06 -4.34366074e-06 2.47970899e-06 -4.89269790e-07 1.47836328e-05 -8.46263429e-06 1.73409032e-06 -1.50478532e-06 1.90867338e-06 -5.71522584e-07 -5.15449757e-07 3.49595231e-07 -5.22856257e-05 -3.29524496e-04 -1.78209909e-04 4.04340602e-05 -4.04340602e-05 4.92484006e-04 -8.87082588e-05 8.87082588e-05 3.38595206e-05 -5.38872760e-05 5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 25 50 75 101 127 152 178 204 229 255 281 301 326 351 376 401 427 453 478 504 530 555 581 607 627 652 -1 -2 1 660 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 -3.25689024e-04 6.51378048e-04 -1.06639054e-03 1.06639054e-03 -2.13278108e-03 -4.52806801e-05 -5.22856257e-05 1.04571251e-04 -7.84284385e-05 -1.04571251e-04 6.09103871e-05 6.14453477e-04 5.91853803e-05 -5.91853803e-05 2.95926902e-04 -2.01724529e-04 2.01724529e-04 -1.00862265e-03 -4.78869050e-05 -6.91187938e-06 3.45593969e-05 -8.29425526e-05 -3.45593969e-05 1.56710856e-03 1.39613919e-02 2.89608434e-03 -2.89608434e-03 5.79216869e-03 -9.35225951e-03 9.35225951e-03 -1.87045190e-02 -2.85376584e-04 -3.29524496e-04 6.59048991e-04 -4.94286743e-04 -6.59048991e-04 6.14453477e-04 6.16334179e-03 5.89280869e-04 -5.89280869e-04 2.94640435e-03 -2.00665301e-03 2.00665301e-03 -1.00332651e-02 -4.47447198e-04 -6.45834401e-05 3.22917201e-04 -7.75001281e-04 -3.22917201e-04 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 6.42637659e-04 -1.28527532e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 1.33367462e-04 4.04340602e-05 -8.08681204e-05 1.33657432e-04 1.78209909e-04 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 5.93986875e-05 -2.96993437e-04 -5.79546830e-05 -2.01724907e-04 1.00862453e-03 5.99184710e-05 -3.84006907e-06 1.92003453e-05 8.23728840e-05 3.43220350e-05 3.25689024e-04 2.89608434e-03 6.42637659e-04 -4.14019247e-04 1.28527532e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 -4.90670003e-05 -4.04340602e-05 1.78209909e-04 -1.82328327e-04 -8.08681204e-05 5.91853803e-05 5.89280869e-04 5.93986875e-05 1.57901181e-05 2.96993437e-04 -2.01724907e-04 -5.79546830e-05 -1.00862453e-03 -4.13777746e-05 3.84006907e-06 3.43220350e-05 -9.30773600e-05 1.92003453e-05 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 1.28527532e-03 -2.34193222e-03 4.15611128e-03 -4.15611128e-03 7.54522870e-03 9.81340007e-05 1.78209909e-04 -3.07748924e-04 1.69973075e-04 3.07748924e-04 -2.95926902e-04 -2.94640435e-03 -2.96993437e-04 2.96993437e-04 -1.40977838e-03 1.00862453e-03 -1.00862453e-03 4.78344308e-03 2.06888873e-04 3.43220350e-05 -1.60905699e-04 3.58342040e-04 1.60905699e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 -4.10981523e-03 6.68105894e-03 -1.33621179e-02 -3.95156129e-04 -8.87082588e-05 1.77416518e-04 -3.69363005e-04 -4.92484006e-04 2.01724529e-04 2.00665301e-03 -5.79546830e-05 -2.01724907e-04 1.00862453e-03 2.12351688e-04 6.85394441e-04 -3.42697221e-03 -2.00592339e-04 1.40996735e-05 -7.04983673e-05 -2.73631522e-04 -1.14013134e-04 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 6.68105894e-03 -4.10981523e-03 1.33621179e-02 1.22299680e-04 8.87082588e-05 -4.92484006e-04 5.26896749e-04 1.77416518e-04 -2.01724529e-04 -2.00665301e-03 -2.01724907e-04 -5.79546830e-05 -1.00862453e-03 6.85394441e-04 2.12351688e-04 3.42697221e-03 1.36675680e-04 -1.40996735e-05 -1.14013134e-04 3.10533823e-04 -7.04983673e-05 2.13278108e-03 1.87045190e-02 4.15611128e-03 -4.15611128e-03 7.54522870e-03 -1.33621179e-02 1.33621179e-02 -2.41529920e-02 -2.44599361e-04 -4.92484006e-04 8.27434268e-04 -4.23658521e-04 -8.27434268e-04 1.00862265e-03 1.00332651e-02 1.00862453e-03 -1.00862453e-03 4.78344308e-03 -3.42697221e-03 3.42697221e-03 -1.62371149e-02 -6.83378401e-04 -1.14013134e-04 5.33163371e-04 -1.18364611e-03 -5.33163371e-04 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 4.90670003e-05 -9.81340007e-05 3.95156129e-04 -1.22299680e-04 2.44599361e-04 -2.59797738e-05 -1.69297603e-05 3.38595206e-05 -3.69220468e-05 -4.92293958e-05 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 4.13777746e-05 -2.06888873e-04 2.00592339e-04 -1.36675680e-04 6.83378401e-04 1.53794146e-05 4.67548763e-06 -2.33774382e-05 2.78902609e-05 1.16209420e-05 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 4.04340602e-05 -1.78209909e-04 8.87082588e-05 -8.87082588e-05 4.92484006e-04 -1.69297603e-05 -2.71695573e-05 5.38872760e-05 -2.93232050e-05 -5.38872760e-05 -6.91187938e-06 -6.45834401e-05 3.84006907e-06 -3.84006907e-06 -3.43220350e-05 -1.40996735e-05 1.40996735e-05 1.14013134e-04 4.67548763e-06 -1.61313514e-07 3.97900833e-06 8.09818213e-06 -3.97900833e-06 1.04571251e-04 6.59048991e-04 8.08681204e-05 -1.78209909e-04 3.07748924e-04 -1.77416518e-04 4.92484006e-04 -8.27434268e-04 3.38595206e-05 5.38872760e-05 -1.08000471e-04 7.63940131e-05 9.44638495e-05 3.45593969e-05 3.22917201e-04 -1.92003453e-05 -3.43220350e-05 1.60905699e-04 7.04983673e-05 1.14013134e-04 -5.33163371e-04 -2.33774382e-05 3.97900833e-06 -1.92605535e-05 -2.69156783e-05 -1.26855161e-05 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 1.82328327e-04 -1.69973075e-04 3.69363005e-04 -5.26896749e-04 4.23658521e-04 -3.69220468e-05 -2.93232050e-05 7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -8.29425526e-05 -7.75001281e-04 -8.23728840e-05 9.30773600e-05 -3.58342040e-04 2.73631522e-04 -3.10533823e-04 1.18364611e-03 2.78902609e-05 8.09818213e-06 -2.69156783e-05 4.75843139e-05 3.37032945e-05 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 8.08681204e-05 -3.07748924e-04 4.92484006e-04 -1.77416518e-04 8.27434268e-04 -4.92293958e-05 -5.38872760e-05 9.44638495e-05 -6.75202116e-05 -1.08000471e-04 -3.45593969e-05 -3.22917201e-04 -3.43220350e-05 -1.92003453e-05 -1.60905699e-04 1.14013134e-04 7.04983673e-05 5.33163371e-04 1.16209420e-05 -3.97900833e-06 -1.26855161e-05 3.37032945e-05 -1.92605535e-05 6.09103871e-05 6.14453477e-04 1.77556141e-04 -1.77556141e-04 1.77556141e-04 -6.05173587e-04 6.05173587e-04 -6.05173587e-04 -6.22069144e-05 6.22069144e-05 -6.22069144e-05 1.70328256e-04 1.56710856e-03 3.25689024e-04 -3.25689024e-04 6.51378048e-04 -1.06639054e-03 1.06639054e-03 -2.13278108e-03 -4.52806801e-05 -5.22856257e-05 1.04571251e-04 -7.84284385e-05 -1.04571251e-04 6.14453477e-04 6.16334179e-03 1.76784261e-03 -1.76784261e-03 1.76784261e-03 -6.01995904e-03 6.01995904e-03 -6.01995904e-03 -5.81250961e-04 5.81250961e-04 -5.81250961e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 -2.89608434e-03 5.79216869e-03 -9.35225951e-03 9.35225951e-03 -1.87045190e-02 -2.85376584e-04 -3.29524496e-04 6.59048991e-04 -4.94286743e-04 -6.59048991e-04 -1.77556141e-04 -1.76784261e-03 -4.59399382e-04 5.34588187e-04 -5.34588187e-04 1.55584457e-03 -1.81552416e-03 1.81552416e-03 3.70813928e-05 1.53225561e-04 -1.53225561e-04 1.85338989e-04 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 6.42637659e-04 -1.28527532e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 1.33367462e-04 4.04340602e-05 -8.08681204e-05 1.33657432e-04 1.78209909e-04 1.77556141e-04 1.76784261e-03 5.34588187e-04 -4.59399382e-04 5.34588187e-04 -1.81552416e-03 1.55584457e-03 -1.81552416e-03 1.85406964e-05 -1.53225561e-04 1.85338989e-04 -3.21134282e-05 -1.53225561e-04 3.25689024e-04 2.89608434e-03 6.42637659e-04 -4.14019247e-04 1.28527532e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 -4.90670003e-05 -4.04340602e-05 1.78209909e-04 -1.82328327e-04 -8.08681204e-05 -1.77556141e-04 -1.76784261e-03 -5.34588187e-04 5.34588187e-04 -4.59399382e-04 1.81552416e-03 -1.81552416e-03 1.55584457e-03 -1.85406964e-05 1.85338989e-04 -1.53225561e-04 -3.21134282e-05 1.53225561e-04 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 1.28527532e-03 -2.34193222e-03 4.15611128e-03 -4.15611128e-03 7.54522870e-03 9.81340007e-05 1.78209909e-04 -3.07748924e-04 1.69973075e-04 3.07748924e-04 6.05173587e-04 6.01995904e-03 1.55584457e-03 -1.81552416e-03 1.81552416e-03 -5.27080384e-03 6.16854997e-03 -6.16854997e-03 -1.27833318e-04 -5.04964025e-04 5.04964025e-04 -6.15670926e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 -2.07805564e-03 4.15611128e-03 -4.10981523e-03 6.68105894e-03 -1.33621179e-02 -3.95156129e-04 -8.87082588e-05 1.77416518e-04 -3.69363005e-04 -4.92484006e-04 -6.05173587e-04 -6.01995904e-03 -1.81552416e-03 1.55584457e-03 -1.81552416e-03 6.16854997e-03 -5.27080384e-03 6.16854997e-03 -6.39166591e-05 5.04964025e-04 -6.15670926e-04 1.10706901e-04 5.04964025e-04 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 1.31106178e-03 -4.15611128e-03 6.68105894e-03 -4.10981523e-03 1.33621179e-02 1.22299680e-04 8.87082588e-05 -4.92484006e-04 5.26896749e-04 1.77416518e-04 6.05173587e-04 6.01995904e-03 1.81552416e-03 -1.81552416e-03 1.55584457e-03 -6.16854997e-03 6.16854997e-03 -5.27080384e-03 6.39166591e-05 -6.15670926e-04 5.04964025e-04 1.10706901e-04 -5.04964025e-04 2.13278108e-03 1.87045190e-02 4.15611128e-03 -4.15611128e-03 7.54522870e-03 -1.33621179e-02 1.33621179e-02 -2.41529920e-02 -2.44599361e-04 -4.92484006e-04 8.27434268e-04 -4.23658521e-04 -8.27434268e-04 -3.70813928e-05 -1.85406964e-05 1.85406964e-05 1.27833318e-04 6.39166591e-05 -6.39166591e-05 -2.24434069e-05 7.05389767e-06 -7.05389767e-06 -1.41077953e-05 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 4.90670003e-05 -9.81340007e-05 3.95156129e-04 -1.22299680e-04 2.44599361e-04 -2.59797738e-05 -1.69297603e-05 3.38595206e-05 -3.69220468e-05 -4.92293958e-05 -6.22069144e-05 -5.81250961e-04 -1.53225561e-04 1.53225561e-04 -1.85338989e-04 5.04964025e-04 -5.04964025e-04 6.15670926e-04 7.05389767e-06 2.30560406e-05 -3.32817384e-05 1.22177092e-05 3.32817384e-05 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 4.04340602e-05 -1.78209909e-04 8.87082588e-05 -8.87082588e-05 4.92484006e-04 -1.69297603e-05 -2.71695573e-05 5.38872760e-05 -2.93232050e-05 -5.38872760e-05 6.22069144e-05 5.81250961e-04 1.53225561e-04 -1.85338989e-04 1.53225561e-04 -5.04964025e-04 6.15670926e-04 -5.04964025e-04 -7.05389767e-06 -3.32817384e-05 2.30560406e-05 1.22177092e-05 -3.32817384e-05 1.04571251e-04 6.59048991e-04 8.08681204e-05 -1.78209909e-04 3.07748924e-04 -1.77416518e-04 4.92484006e-04 -8.27434268e-04 3.38595206e-05 5.38872760e-05 -1.08000471e-04 7.63940131e-05 9.44638495e-05 3.21134282e-05 3.21134282e-05 -1.10706901e-04 -1.10706901e-04 1.22177092e-05 1.22177092e-05 -2.24434069e-05 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 1.82328327e-04 -1.69973075e-04 3.69363005e-04 -5.26896749e-04 4.23658521e-04 -3.69220468e-05 -2.93232050e-05 7.63940131e-05 -6.86136812e-05 -6.75202116e-05 -6.22069144e-05 -5.81250961e-04 -1.85338989e-04 1.53225561e-04 -1.53225561e-04 6.15670926e-04 -5.04964025e-04 5.04964025e-04 -1.41077953e-05 3.32817384e-05 -3.32817384e-05 2.30560406e-05 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 8.08681204e-05 -3.07748924e-04 4.92484006e-04 -1.77416518e-04 8.27434268e-04 -4.92293958e-05 -5.38872760e-05 9.44638495e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 362 386 411 437 463 488 514 540 563 589 615 635 660 -1 -2 2 169 - 1.25466617e-06 1.34349826e-05 1.31792447e-06 -3.95377341e-06 6.58962236e-06 -4.39772254e-06 1.31931676e-05 -2.19886127e-05 -2.43510507e-06 -7.90823570e-07 1.31803928e-06 -2.10886285e-06 -3.95411785e-06 1.34349826e-05 1.43209127e-04 1.42696266e-05 -4.28088798e-05 7.13481329e-05 -4.75690104e-05 1.42707031e-04 -2.37845052e-04 -2.56801146e-05 -8.33986187e-06 1.38997698e-05 -2.22396317e-05 -4.16993094e-05 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 4.22604181e-06 -7.04340302e-06 2.62355898e-06 -1.41871954e-05 2.36453257e-05 2.82105641e-06 4.89269790e-07 -8.15449649e-07 2.31661906e-06 4.34366074e-06 3.95377341e-06 4.28088798e-05 4.22604181e-06 -1.20293553e-05 2.11302091e-05 -1.41871954e-05 4.04560801e-05 -7.09359772e-05 -7.80592115e-06 -2.47970899e-06 4.34366074e-06 -7.32931955e-06 -1.23985450e-05 -6.58962236e-06 -7.13481329e-05 -7.04340302e-06 2.11302091e-05 -3.45682450e-05 2.36453257e-05 -7.09359772e-05 1.16121122e-04 1.30098686e-05 4.34366074e-06 -7.11294712e-06 1.09506581e-05 2.13388414e-05 4.39772254e-06 4.75690104e-05 2.62355898e-06 -1.41871954e-05 2.36453257e-05 -9.01114524e-06 4.74618663e-05 -7.91031105e-05 -9.57494961e-06 -1.73409032e-06 2.89015053e-06 -7.88460418e-06 -1.47836328e-05 -1.31931676e-05 -1.42707031e-04 -1.41871954e-05 4.04560801e-05 -7.09359772e-05 4.74618663e-05 -1.35576122e-04 2.37309331e-04 2.66071807e-05 8.46263429e-06 -1.47836328e-05 2.48764488e-05 4.23131714e-05 2.19886127e-05 2.37845052e-04 2.36453257e-05 -7.09359772e-05 1.16121122e-04 -7.91031105e-05 2.37309331e-04 -3.88706075e-04 -4.43453012e-05 -1.47836328e-05 2.42318426e-05 -3.73852938e-05 -7.26955279e-05 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 7.80592115e-06 -1.30098686e-05 9.57494961e-06 -2.66071807e-05 4.43453012e-05 3.61548803e-06 1.19878524e-06 -1.99797541e-06 3.12952049e-06 5.86785091e-06 -7.90823570e-07 -8.33986187e-06 -4.89269790e-07 2.47970899e-06 -4.34366074e-06 1.73409032e-06 -8.46263429e-06 1.47836328e-05 1.19878524e-06 3.49595231e-07 -5.71522584e-07 1.04545744e-06 1.90867338e-06 1.31803928e-06 1.38997698e-05 8.15449649e-07 -4.34366074e-06 7.11294712e-06 -2.89015053e-06 1.47836328e-05 -2.42318426e-05 -1.99797541e-06 -5.71522584e-07 9.59219321e-07 -1.69390265e-06 -3.20700306e-06 -2.10886285e-06 -2.22396317e-05 -2.31661906e-06 7.32931955e-06 -1.09506581e-05 7.88460418e-06 -2.48764488e-05 3.73852938e-05 3.12952049e-06 1.04545744e-06 -1.69390265e-06 2.59560990e-06 5.15449757e-06 -3.95411785e-06 -4.16993094e-05 -4.34366074e-06 1.23985450e-05 -2.13388414e-05 1.47836328e-05 -4.23131714e-05 7.26955279e-05 5.86785091e-06 1.90867338e-06 -3.20700306e-06 5.15449757e-06 9.51122747e-06 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -1 -1 -2 157 - 6.09103871e-05 6.14453477e-04 2.95926902e-04 5.91853803e-05 -5.91853803e-05 -1.00862265e-03 -2.01724529e-04 2.01724529e-04 9.57738101e-05 3.45593969e-05 -3.45593969e-05 -6.91187938e-06 6.14453477e-04 6.16334179e-03 2.94640435e-03 5.89280869e-04 -5.89280869e-04 -1.00332651e-02 -2.00665301e-03 2.00665301e-03 8.94894397e-04 3.22917201e-04 -3.22917201e-04 -6.45834401e-05 -2.95926902e-04 -2.94640435e-03 -1.40977838e-03 -2.96993437e-04 2.96993437e-04 4.78344308e-03 1.00862453e-03 -1.00862453e-03 -4.13777746e-04 -1.60905699e-04 1.60905699e-04 3.43220350e-05 -5.91853803e-05 -5.89280869e-04 -2.96993437e-04 1.57901181e-05 5.93986875e-05 1.00862453e-03 -5.79546830e-05 -2.01724907e-04 -1.01296246e-04 1.92003453e-05 3.43220350e-05 1.07044761e-05 -3.84006907e-06 5.91853803e-05 5.89280869e-04 2.96993437e-04 5.93986875e-05 1.57901181e-05 -1.00862453e-03 -2.01724907e-04 -5.79546830e-05 1.01296246e-04 3.43220350e-05 1.92003453e-05 1.07044761e-05 3.84006907e-06 1.00862265e-03 1.00332651e-02 4.78344308e-03 1.00862453e-03 -1.00862453e-03 -1.62371149e-02 -3.42697221e-03 3.42697221e-03 1.36675680e-03 5.33163371e-04 -5.33163371e-04 -1.14013134e-04 2.01724529e-04 2.00665301e-03 1.00862453e-03 -5.79546830e-05 -2.01724907e-04 -3.42697221e-03 2.12351688e-04 6.85394441e-04 3.37268019e-04 -7.04983673e-05 -1.14013134e-04 -3.69023003e-05 1.40996735e-05 -2.01724529e-04 -2.00665301e-03 -1.00862453e-03 -2.01724907e-04 -5.79546830e-05 3.42697221e-03 6.85394441e-04 2.12351688e-04 -3.37268019e-04 -1.14013134e-04 -7.04983673e-05 -3.69023003e-05 -1.40996735e-05 9.57738101e-05 8.94894397e-04 4.13777746e-04 1.01296246e-04 -1.01296246e-04 -1.36675680e-03 -3.37268019e-04 3.37268019e-04 6.36867635e-05 3.49983802e-05 -3.49983802e-05 -9.35097527e-06 3.45593969e-05 3.22917201e-04 1.60905699e-04 -1.92003453e-05 -3.43220350e-05 -5.33163371e-04 7.04983673e-05 1.14013134e-04 3.49983802e-05 -1.92605535e-05 -1.26855161e-05 -6.78761620e-06 3.97900833e-06 -3.45593969e-05 -3.22917201e-04 -1.60905699e-04 -3.43220350e-05 -1.92003453e-05 5.33163371e-04 1.14013134e-04 7.04983673e-05 -3.49983802e-05 -1.26855161e-05 -1.92605535e-05 -6.78761620e-06 -3.97900833e-06 -1.07044761e-05 -1.07044761e-05 3.69023003e-05 3.69023003e-05 -6.78761620e-06 -6.78761620e-06 -7.23035088e-07 -6.91187938e-06 -6.45834401e-05 -3.43220350e-05 3.84006907e-06 -3.84006907e-06 1.14013134e-04 -1.40996735e-05 1.40996735e-05 -9.35097527e-06 3.97900833e-06 -3.97900833e-06 -1.61313514e-07 - 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 16 17 19 20 22 23 24 13 14 15 16 17 18 19 20 21 22 23 25 - 0 12 24 36 49 62 74 87 100 112 125 138 145 157 157 157 157 157 157 157 157 157 157 157 157 157 157 -1 -1 -1 404 - 2.50728998e-03 1.64011405e-02 9.26310694e-03 -2.59488230e-02 -7.34068315e-05 1.40271766e-02 6.79314330e-02 3.83997120e-02 1.27999040e-02 1.27999040e-02 -9.39695701e-02 -3.13231900e-02 -3.13231900e-02 -3.90015343e-03 -2.53322396e-03 -2.53322396e-03 -8.44407987e-04 1.64011405e-02 8.10100377e-02 5.00423367e-02 -1.17965801e-01 -1.25504404e-02 6.79314330e-02 1.60907873e-01 1.22953680e-01 4.09845600e-02 4.09845600e-02 -1.78426204e-01 -5.94754012e-02 -5.94754012e-02 -4.00211138e-02 -2.59944760e-02 -2.59944760e-02 -8.66482532e-03 -9.26310694e-03 -5.00423367e-02 -3.02879243e-02 7.61127847e-02 4.86141429e-03 -3.83997120e-02 -1.22953680e-01 -8.01243800e-02 -3.21974808e-02 -3.21974808e-02 1.50606551e-01 6.28329901e-02 6.28329901e-02 1.84441412e-02 1.41362236e-02 1.41362236e-02 5.28711521e-03 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 -1.27999040e-02 -4.09845600e-02 -3.21974808e-02 5.73556868e-03 -1.07324936e-02 6.28329901e-02 -1.69480895e-02 2.09443300e-02 9.13604602e-03 1.11749199e-04 5.28711521e-03 -1.72512200e-03 3.72497331e-05 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 -1.27999040e-02 -4.09845600e-02 -3.21974808e-02 -1.07324936e-02 5.73556868e-03 6.28329901e-02 2.09443300e-02 -1.69480895e-02 9.13604602e-03 5.28711521e-03 1.11749199e-04 1.72512200e-03 3.72497331e-05 2.59488230e-02 1.17965801e-01 7.61127847e-02 -1.70036430e-01 -2.33139502e-02 9.39695701e-02 1.78426204e-01 1.50606551e-01 6.28329901e-02 6.28329901e-02 -1.74532412e-01 -8.26569598e-02 -8.26569598e-02 -5.25781272e-02 -4.25165420e-02 -4.25165420e-02 -1.64031264e-02 -9.11832090e-03 2.46761309e-02 1.71520858e-03 3.13231900e-02 5.94754012e-02 6.28329901e-02 -1.69480895e-02 2.09443300e-02 -8.26569598e-02 4.58861475e-02 -2.75523199e-02 -2.91183766e-02 3.67538539e-03 -1.64031264e-02 6.69283727e-03 1.22512846e-03 -9.11832090e-03 2.46761309e-02 1.71520858e-03 3.13231900e-02 5.94754012e-02 6.28329901e-02 2.09443300e-02 -1.69480895e-02 -8.26569598e-02 -2.75523199e-02 4.58861475e-02 -2.91183766e-02 -1.64031264e-02 3.67538539e-03 -6.69283727e-03 1.22512846e-03 -7.34068315e-05 -1.25504404e-02 -4.86141429e-03 2.33139502e-02 -3.95618323e-03 -3.90015343e-03 -4.00211138e-02 -1.84441412e-02 -9.13604602e-03 -9.13604602e-03 5.25781272e-02 2.91183766e-02 2.91183766e-02 6.04442117e-03 2.70322369e-03 2.70322369e-03 4.80114852e-04 1.65705842e-04 -1.71520858e-03 1.20534581e-03 -2.53322396e-03 -2.59944760e-02 -1.41362236e-02 -1.11749199e-04 -5.28711521e-03 4.25165420e-02 -3.67538539e-03 1.64031264e-02 2.70322369e-03 3.36490998e-03 1.72541514e-03 7.29123606e-04 1.22324825e-03 1.65705842e-04 -1.71520858e-03 1.20534581e-03 -2.53322396e-03 -2.59944760e-02 -1.41362236e-02 -5.28711521e-03 -1.11749199e-04 4.25165420e-02 1.64031264e-02 -3.67538539e-03 2.70322369e-03 1.72541514e-03 3.36490998e-03 -7.29123606e-04 1.22324825e-03 -7.58541506e-05 1.72512200e-03 -1.72512200e-03 -6.69283727e-03 6.69283727e-03 7.29123606e-04 -7.29123606e-04 -6.17935738e-05 -7.58541506e-05 -8.44407987e-04 -8.66482532e-03 -5.28711521e-03 -3.72497331e-05 -3.72497331e-05 1.64031264e-02 -1.22512846e-03 -1.22512846e-03 4.80114852e-04 1.22324825e-03 1.22324825e-03 1.02914641e-04 6.09103871e-05 6.14453477e-04 2.95926902e-04 -5.91853803e-05 -5.91853803e-05 -1.00862265e-03 2.01724529e-04 2.01724529e-04 9.57738101e-05 -3.45593969e-05 -3.45593969e-05 6.91187938e-06 2.50728998e-03 1.64011405e-02 9.26310694e-03 -2.59488230e-02 -7.34068315e-05 6.14453477e-04 6.16334179e-03 2.94640435e-03 -5.89280869e-04 -5.89280869e-04 -1.00332651e-02 2.00665301e-03 2.00665301e-03 8.94894397e-04 -3.22917201e-04 -3.22917201e-04 6.45834401e-05 1.64011405e-02 8.10100377e-02 5.00423367e-02 -1.17965801e-01 -1.25504404e-02 -2.95926902e-04 -2.94640435e-03 -1.40977838e-03 2.96993437e-04 2.96993437e-04 4.78344308e-03 -1.00862453e-03 -1.00862453e-03 -4.13777746e-04 1.60905699e-04 1.60905699e-04 -3.43220350e-05 -9.26310694e-03 -5.00423367e-02 -3.02879243e-02 7.61127847e-02 4.86141429e-03 5.91853803e-05 5.89280869e-04 2.96993437e-04 1.57901181e-05 -5.93986875e-05 -1.00862453e-03 -5.79546830e-05 2.01724907e-04 1.01296246e-04 1.92003453e-05 -3.43220350e-05 -1.07044761e-05 -3.84006907e-06 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 5.91853803e-05 5.89280869e-04 2.96993437e-04 -5.93986875e-05 1.57901181e-05 -1.00862453e-03 2.01724907e-04 -5.79546830e-05 1.01296246e-04 -3.43220350e-05 1.92003453e-05 1.07044761e-05 -3.84006907e-06 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 1.00862265e-03 1.00332651e-02 4.78344308e-03 -1.00862453e-03 -1.00862453e-03 -1.62371149e-02 3.42697221e-03 3.42697221e-03 1.36675680e-03 -5.33163371e-04 -5.33163371e-04 1.14013134e-04 2.59488230e-02 1.17965801e-01 7.61127847e-02 -1.70036430e-01 -2.33139502e-02 -2.01724529e-04 -2.00665301e-03 -1.00862453e-03 -5.79546830e-05 2.01724907e-04 3.42697221e-03 2.12351688e-04 -6.85394441e-04 -3.37268019e-04 -7.04983673e-05 1.14013134e-04 3.69023003e-05 1.40996735e-05 -9.11832090e-03 2.46761309e-02 1.71520858e-03 -2.01724529e-04 -2.00665301e-03 -1.00862453e-03 2.01724907e-04 -5.79546830e-05 3.42697221e-03 -6.85394441e-04 2.12351688e-04 -3.37268019e-04 1.14013134e-04 -7.04983673e-05 -3.69023003e-05 1.40996735e-05 -9.11832090e-03 2.46761309e-02 1.71520858e-03 9.57738101e-05 8.94894397e-04 4.13777746e-04 -1.01296246e-04 -1.01296246e-04 -1.36675680e-03 3.37268019e-04 3.37268019e-04 6.36867635e-05 -3.49983802e-05 -3.49983802e-05 9.35097527e-06 -7.34068315e-05 -1.25504404e-02 -4.86141429e-03 2.33139502e-02 -3.95618323e-03 -3.45593969e-05 -3.22917201e-04 -1.60905699e-04 -1.92003453e-05 3.43220350e-05 5.33163371e-04 7.04983673e-05 -1.14013134e-04 -3.49983802e-05 -1.92605535e-05 1.26855161e-05 6.78761620e-06 3.97900833e-06 1.65705842e-04 -1.71520858e-03 1.20534581e-03 -3.45593969e-05 -3.22917201e-04 -1.60905699e-04 3.43220350e-05 -1.92003453e-05 5.33163371e-04 -1.14013134e-04 7.04983673e-05 -3.49983802e-05 1.26855161e-05 -1.92605535e-05 -6.78761620e-06 3.97900833e-06 1.65705842e-04 -1.71520858e-03 1.20534581e-03 1.07044761e-05 -1.07044761e-05 -3.69023003e-05 3.69023003e-05 6.78761620e-06 -6.78761620e-06 -7.23035088e-07 -7.58541506e-05 6.91187938e-06 6.45834401e-05 3.43220350e-05 3.84006907e-06 3.84006907e-06 -1.14013134e-04 -1.40996735e-05 -1.40996735e-05 9.35097527e-06 3.97900833e-06 3.97900833e-06 -1.61313514e-07 -7.58541506e-05 - 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 5 8 13 14 15 16 17 18 19 20 21 22 23 25 3 6 9 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 13 14 15 16 17 18 19 20 21 22 23 24 25 11 16 17 19 20 22 23 24 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 18 21 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 3 4 6 7 9 10 11 24 0 1 2 3 4 5 6 7 8 9 10 12 25 - 0 17 34 51 67 83 100 116 132 149 165 181 189 202 219 236 253 269 285 302 318 334 351 367 383 391 404 -1 -1 0 520 - 3.91348915e-02 1.43320629e-01 7.02734648e-02 7.02734648e-02 -1.48982977e-01 -1.48982977e-01 -6.10770759e-03 -2.11577197e-02 1.05788599e-02 1.40271766e-02 6.79314330e-02 1.27999040e-02 1.27999040e-02 3.83997120e-02 -3.13231900e-02 -3.13231900e-02 -9.39695701e-02 1.95007672e-03 -8.44407987e-04 -2.53322396e-03 3.37763195e-03 -2.53322396e-03 1.43320629e-01 2.06957410e-01 1.43523909e-01 1.43523909e-01 -1.50473058e-01 -1.50473058e-01 -1.38680201e-02 -4.80402309e-02 2.40201155e-02 6.79314330e-02 1.60907873e-01 4.09845600e-02 4.09845600e-02 1.22953680e-01 -5.94754012e-02 -5.94754012e-02 -1.78426204e-01 2.00105569e-02 -8.66482532e-03 -2.59944760e-02 3.46593013e-02 -2.59944760e-02 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 -6.79089450e-04 4.18480142e-02 -2.82907486e-02 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 -1.07324936e-02 -3.21974808e-02 -1.69480895e-02 2.09443300e-02 6.28329901e-02 -6.06202249e-03 3.72497331e-05 1.11749199e-04 -7.04948694e-03 5.28711521e-03 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 -1.47334830e-02 -1.27999040e-02 -4.09845600e-02 -1.07324936e-02 5.73556868e-03 -3.21974808e-02 2.09443300e-02 -1.69480895e-02 6.28329901e-02 -3.07402353e-03 3.72497331e-05 5.28711521e-03 -8.77460895e-03 1.11749199e-04 -7.02734648e-02 -1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 2.48400517e-02 4.18480142e-02 -1.35572656e-02 -3.83997120e-02 -1.22953680e-01 -3.21974808e-02 -3.21974808e-02 -8.01243800e-02 6.28329901e-02 6.28329901e-02 1.50606551e-01 -9.22207060e-03 5.28711521e-03 1.41362236e-02 -1.59730948e-02 1.41362236e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 1.91463231e-02 -4.52539972e-02 4.12234663e-02 3.13231900e-02 5.94754012e-02 -1.69480895e-02 2.09443300e-02 6.28329901e-02 4.58861475e-02 -2.75523199e-02 -8.26569598e-02 2.03553554e-02 1.22512846e-03 3.67538539e-03 2.18708352e-02 -1.64031264e-02 -8.47000309e-02 1.23301560e-01 3.71929353e-02 3.71929353e-02 3.13231900e-02 5.94754012e-02 2.09443300e-02 -1.69480895e-02 6.28329901e-02 -2.75523199e-02 4.58861475e-02 -8.26569598e-02 8.76302120e-03 1.22512846e-03 -1.64031264e-02 2.85636725e-02 3.67538539e-03 1.48982977e-01 1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 -4.52737305e-02 -4.52539972e-02 4.03053096e-03 9.39695701e-02 1.78426204e-01 6.28329901e-02 6.28329901e-02 1.50606551e-01 -8.26569598e-02 -8.26569598e-02 -1.74532412e-01 2.62890636e-02 -1.64031264e-02 -4.25165420e-02 4.55339938e-02 -4.25165420e-02 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 -2.48400517e-02 -1.91463231e-02 4.52737305e-02 -7.67653617e-03 1.41589240e-02 -1.39049485e-02 1.95007672e-03 2.00105569e-02 6.06202249e-03 3.07402353e-03 9.22207060e-03 -2.03553554e-02 -8.76302120e-03 -2.62890636e-02 1.46476011e-03 -2.40057426e-04 -7.20172278e-04 2.64406855e-03 -1.98305141e-03 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -8.44407987e-04 -8.66482532e-03 -3.72497331e-05 -3.72497331e-05 -5.28711521e-03 -1.22512846e-03 -1.22512846e-03 1.64031264e-02 -2.40057426e-04 1.02914641e-04 1.22324825e-03 -4.15791659e-04 1.22324825e-03 -2.11577197e-02 -4.80402309e-02 -4.18480142e-02 -4.18480142e-02 4.52539972e-02 4.52539972e-02 1.41589240e-02 4.91061754e-02 -2.45239757e-02 -2.53322396e-03 -2.59944760e-02 -1.11749199e-04 -5.28711521e-03 -1.41362236e-02 -3.67538539e-03 1.64031264e-02 4.25165420e-02 -7.20172278e-04 1.22324825e-03 3.36490998e-03 -2.70562219e-03 1.72541514e-03 1.05788599e-02 2.40201155e-02 2.82907486e-02 1.35572656e-02 -4.12234663e-02 -4.03053096e-03 -1.39049485e-02 -2.45239757e-02 8.37951533e-03 3.37763195e-03 3.46593013e-02 7.04948694e-03 8.77460895e-03 1.59730948e-02 -2.18708352e-02 -2.85636725e-02 -4.55339938e-02 2.64406855e-03 -4.15791659e-04 -2.70562219e-03 4.51786749e-03 -1.97649858e-03 1.47334830e-02 -3.71929353e-02 -7.88139292e-03 -7.82316899e-03 -2.53322396e-03 -2.59944760e-02 -5.28711521e-03 -1.11749199e-04 -1.41362236e-02 1.64031264e-02 -3.67538539e-03 4.25165420e-02 -1.98305141e-03 1.22324825e-03 1.72541514e-03 -1.97649858e-03 3.36490998e-03 1.40271766e-02 6.79314330e-02 3.83997120e-02 -1.27999040e-02 1.27999040e-02 -9.39695701e-02 3.13231900e-02 -3.13231900e-02 -3.90015343e-03 2.53322396e-03 -2.53322396e-03 8.44407987e-04 3.91348915e-02 1.43320629e-01 7.02734648e-02 7.02734648e-02 -1.48982977e-01 -1.48982977e-01 -6.10770759e-03 -2.11577197e-02 1.05788599e-02 6.79314330e-02 1.60907873e-01 1.22953680e-01 -4.09845600e-02 4.09845600e-02 -1.78426204e-01 5.94754012e-02 -5.94754012e-02 -4.00211138e-02 2.59944760e-02 -2.59944760e-02 8.66482532e-03 1.43320629e-01 2.06957410e-01 1.43523909e-01 1.43523909e-01 -1.50473058e-01 -1.50473058e-01 -1.38680201e-02 -4.80402309e-02 2.40201155e-02 -3.83997120e-02 -1.22953680e-01 -8.01243800e-02 3.21974808e-02 -3.21974808e-02 1.50606551e-01 -6.28329901e-02 6.28329901e-02 1.84441412e-02 -1.41362236e-02 1.41362236e-02 -5.28711521e-03 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 -6.79089450e-04 4.18480142e-02 -2.82907486e-02 1.27999040e-02 4.09845600e-02 3.21974808e-02 5.73556868e-03 1.07324936e-02 -6.28329901e-02 -1.69480895e-02 -2.09443300e-02 -9.13604602e-03 1.11749199e-04 -5.28711521e-03 1.72512200e-03 3.72497331e-05 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 -1.47334830e-02 -1.27999040e-02 -4.09845600e-02 -3.21974808e-02 1.07324936e-02 5.73556868e-03 6.28329901e-02 -2.09443300e-02 -1.69480895e-02 9.13604602e-03 -5.28711521e-03 1.11749199e-04 1.72512200e-03 -3.72497331e-05 -7.02734648e-02 -1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 2.48400517e-02 4.18480142e-02 -1.35572656e-02 9.39695701e-02 1.78426204e-01 1.50606551e-01 -6.28329901e-02 6.28329901e-02 -1.74532412e-01 8.26569598e-02 -8.26569598e-02 -5.25781272e-02 4.25165420e-02 -4.25165420e-02 1.64031264e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 1.91463231e-02 -4.52539972e-02 4.12234663e-02 -3.13231900e-02 -5.94754012e-02 -6.28329901e-02 -1.69480895e-02 -2.09443300e-02 8.26569598e-02 4.58861475e-02 2.75523199e-02 2.91183766e-02 3.67538539e-03 1.64031264e-02 -6.69283727e-03 1.22512846e-03 -8.47000309e-02 1.23301560e-01 3.71929353e-02 3.71929353e-02 3.13231900e-02 5.94754012e-02 6.28329901e-02 -2.09443300e-02 -1.69480895e-02 -8.26569598e-02 2.75523199e-02 4.58861475e-02 -2.91183766e-02 1.64031264e-02 3.67538539e-03 -6.69283727e-03 -1.22512846e-03 1.48982977e-01 1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 -4.52737305e-02 -4.52539972e-02 4.03053096e-03 -3.90015343e-03 -4.00211138e-02 -1.84441412e-02 9.13604602e-03 -9.13604602e-03 5.25781272e-02 -2.91183766e-02 2.91183766e-02 6.04442117e-03 -2.70322369e-03 2.70322369e-03 -4.80114852e-04 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 -2.48400517e-02 -1.91463231e-02 4.52737305e-02 -7.67653617e-03 1.41589240e-02 -1.39049485e-02 2.53322396e-03 2.59944760e-02 1.41362236e-02 -1.11749199e-04 5.28711521e-03 -4.25165420e-02 -3.67538539e-03 -1.64031264e-02 -2.70322369e-03 3.36490998e-03 -1.72541514e-03 -7.29123606e-04 1.22324825e-03 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -2.53322396e-03 -2.59944760e-02 -1.41362236e-02 5.28711521e-03 -1.11749199e-04 4.25165420e-02 -1.64031264e-02 -3.67538539e-03 2.70322369e-03 -1.72541514e-03 3.36490998e-03 -7.29123606e-04 -1.22324825e-03 -2.11577197e-02 -4.80402309e-02 -4.18480142e-02 -4.18480142e-02 4.52539972e-02 4.52539972e-02 1.41589240e-02 4.91061754e-02 -2.45239757e-02 -1.72512200e-03 -1.72512200e-03 6.69283727e-03 6.69283727e-03 -7.29123606e-04 -7.29123606e-04 -6.17935738e-05 1.05788599e-02 2.40201155e-02 2.82907486e-02 1.35572656e-02 -4.12234663e-02 -4.03053096e-03 -1.39049485e-02 -2.45239757e-02 8.37951533e-03 8.44407987e-04 8.66482532e-03 5.28711521e-03 -3.72497331e-05 3.72497331e-05 -1.64031264e-02 -1.22512846e-03 1.22512846e-03 -4.80114852e-04 1.22324825e-03 -1.22324825e-03 1.02914641e-04 1.47334830e-02 -3.71929353e-02 -7.88139292e-03 -7.82316899e-03 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 3 4 6 7 9 10 11 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 12 16 19 22 25 - 0 22 44 66 83 105 127 144 166 188 205 227 249 266 287 308 329 346 368 389 406 428 449 466 488 504 520 -1 -1 1 448 - 2.50728998e-03 1.64011405e-02 9.26310694e-03 -2.59488230e-02 3.67034157e-05 6.35721809e-05 6.09103871e-05 6.14453477e-04 -5.91853803e-05 5.91853803e-05 2.95926902e-04 2.01724529e-04 -2.01724529e-04 -1.00862265e-03 -4.78869050e-05 -6.91187938e-06 -3.45593969e-05 -8.29425526e-05 3.45593969e-05 1.64011405e-02 8.10100377e-02 5.00423367e-02 -1.17965801e-01 6.27522019e-03 1.08690002e-02 6.14453477e-04 6.16334179e-03 -5.89280869e-04 5.89280869e-04 2.94640435e-03 2.00665301e-03 -2.00665301e-03 -1.00332651e-02 -4.47447198e-04 -6.45834401e-05 -3.22917201e-04 -7.75001281e-04 3.22917201e-04 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 5.93986875e-05 2.96993437e-04 -5.79546830e-05 -2.01724907e-04 -1.00862453e-03 -5.99184710e-05 3.84006907e-06 1.92003453e-05 -8.23728840e-05 3.43220350e-05 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 -5.91853803e-05 -5.89280869e-04 5.93986875e-05 1.57901181e-05 -2.96993437e-04 -2.01724907e-04 -5.79546830e-05 1.00862453e-03 4.13777746e-05 -3.84006907e-06 3.43220350e-05 9.30773600e-05 1.92003453e-05 -9.26310694e-03 -5.00423367e-02 -3.02879243e-02 7.61127847e-02 -2.43070715e-03 -4.21010828e-03 -2.95926902e-04 -2.94640435e-03 2.96993437e-04 -2.96993437e-04 -1.40977838e-03 -1.00862453e-03 1.00862453e-03 4.78344308e-03 2.06888873e-04 3.43220350e-05 1.60905699e-04 3.58342040e-04 -1.60905699e-04 -9.11832090e-03 2.46761309e-02 1.71520858e-03 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 -2.01724907e-04 -1.00862453e-03 2.12351688e-04 6.85394441e-04 3.42697221e-03 2.00592339e-04 -1.40996735e-05 -7.04983673e-05 2.73631522e-04 -1.14013134e-04 -9.11832090e-03 2.46761309e-02 1.71520858e-03 2.01724529e-04 2.00665301e-03 -2.01724907e-04 -5.79546830e-05 1.00862453e-03 6.85394441e-04 2.12351688e-04 -3.42697221e-03 -1.36675680e-04 1.40996735e-05 -1.14013134e-04 -3.10533823e-04 -7.04983673e-05 2.59488230e-02 1.17965801e-01 7.61127847e-02 -1.70036430e-01 1.16569751e-02 2.01904731e-02 1.00862265e-03 1.00332651e-02 -1.00862453e-03 1.00862453e-03 4.78344308e-03 3.42697221e-03 -3.42697221e-03 -1.62371149e-02 -6.83378401e-04 -1.14013134e-04 -5.33163371e-04 -1.18364611e-03 5.33163371e-04 3.67034157e-05 6.27522019e-03 2.43070715e-03 -1.16569751e-02 -1.04593642e-03 -1.68023178e-03 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 -4.13777746e-05 -2.06888873e-04 -2.00592339e-04 1.36675680e-04 6.83378401e-04 1.53794146e-05 4.67548763e-06 2.33774382e-05 2.78902609e-05 -1.16209420e-05 -7.58541506e-05 -6.91187938e-06 -6.45834401e-05 -3.84006907e-06 3.84006907e-06 -3.43220350e-05 1.40996735e-05 -1.40996735e-05 1.14013134e-04 4.67548763e-06 -1.61313514e-07 -3.97900833e-06 8.09818213e-06 3.97900833e-06 1.65705842e-04 -1.71520858e-03 1.20534581e-03 -3.45593969e-05 -3.22917201e-04 -1.92003453e-05 -3.43220350e-05 -1.60905699e-04 7.04983673e-05 1.14013134e-04 5.33163371e-04 2.33774382e-05 -3.97900833e-06 -1.92605535e-05 2.69156783e-05 -1.26855161e-05 6.35721809e-05 1.08690002e-02 4.21010828e-03 -2.01904731e-02 -1.68023178e-03 -2.98610096e-03 -8.29425526e-05 -7.75001281e-04 8.23728840e-05 -9.30773600e-05 -3.58342040e-04 -2.73631522e-04 3.10533823e-04 1.18364611e-03 2.78902609e-05 8.09818213e-06 2.69156783e-05 4.75843139e-05 -3.37032945e-05 1.65705842e-04 -1.71520858e-03 1.20534581e-03 3.45593969e-05 3.22917201e-04 -3.43220350e-05 -1.92003453e-05 1.60905699e-04 1.14013134e-04 7.04983673e-05 -5.33163371e-04 -1.16209420e-05 3.97900833e-06 -1.26855161e-05 -3.37032945e-05 -1.92605535e-05 1.40271766e-02 6.79314330e-02 1.27999040e-02 -1.27999040e-02 3.83997120e-02 -3.13231900e-02 3.13231900e-02 -9.39695701e-02 1.95007672e-03 8.44407987e-04 -2.53322396e-03 3.37763195e-03 2.53322396e-03 2.50728998e-03 1.64011405e-02 9.26310694e-03 -2.59488230e-02 3.67034157e-05 6.35721809e-05 6.79314330e-02 1.60907873e-01 4.09845600e-02 -4.09845600e-02 1.22953680e-01 -5.94754012e-02 5.94754012e-02 -1.78426204e-01 2.00105569e-02 8.66482532e-03 -2.59944760e-02 3.46593013e-02 2.59944760e-02 1.64011405e-02 8.10100377e-02 5.00423367e-02 -1.17965801e-01 6.27522019e-03 1.08690002e-02 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 1.07324936e-02 -3.21974808e-02 -1.69480895e-02 -2.09443300e-02 6.28329901e-02 -6.06202249e-03 -3.72497331e-05 1.11749199e-04 -7.04948694e-03 -5.28711521e-03 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 1.27999040e-02 4.09845600e-02 1.07324936e-02 5.73556868e-03 3.21974808e-02 -2.09443300e-02 -1.69480895e-02 -6.28329901e-02 3.07402353e-03 3.72497331e-05 -5.28711521e-03 8.77460895e-03 1.11749199e-04 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 -3.83997120e-02 -1.22953680e-01 -3.21974808e-02 3.21974808e-02 -8.01243800e-02 6.28329901e-02 -6.28329901e-02 1.50606551e-01 -9.22207060e-03 -5.28711521e-03 1.41362236e-02 -1.59730948e-02 -1.41362236e-02 -9.26310694e-03 -5.00423367e-02 -3.02879243e-02 7.61127847e-02 -2.43070715e-03 -4.21010828e-03 3.13231900e-02 5.94754012e-02 -1.69480895e-02 -2.09443300e-02 6.28329901e-02 4.58861475e-02 2.75523199e-02 -8.26569598e-02 2.03553554e-02 -1.22512846e-03 3.67538539e-03 2.18708352e-02 1.64031264e-02 -9.11832090e-03 2.46761309e-02 1.71520858e-03 -3.13231900e-02 -5.94754012e-02 -2.09443300e-02 -1.69480895e-02 -6.28329901e-02 2.75523199e-02 4.58861475e-02 8.26569598e-02 -8.76302120e-03 1.22512846e-03 1.64031264e-02 -2.85636725e-02 3.67538539e-03 -9.11832090e-03 2.46761309e-02 1.71520858e-03 9.39695701e-02 1.78426204e-01 6.28329901e-02 -6.28329901e-02 1.50606551e-01 -8.26569598e-02 8.26569598e-02 -1.74532412e-01 2.62890636e-02 1.64031264e-02 -4.25165420e-02 4.55339938e-02 4.25165420e-02 2.59488230e-02 1.17965801e-01 7.61127847e-02 -1.70036430e-01 1.16569751e-02 2.01904731e-02 1.95007672e-03 2.00105569e-02 6.06202249e-03 -3.07402353e-03 9.22207060e-03 -2.03553554e-02 8.76302120e-03 -2.62890636e-02 1.46476011e-03 2.40057426e-04 -7.20172278e-04 2.64406855e-03 1.98305141e-03 3.67034157e-05 6.27522019e-03 2.43070715e-03 -1.16569751e-02 -1.04593642e-03 -1.68023178e-03 8.44407987e-04 8.66482532e-03 3.72497331e-05 -3.72497331e-05 5.28711521e-03 1.22512846e-03 -1.22512846e-03 -1.64031264e-02 2.40057426e-04 1.02914641e-04 -1.22324825e-03 4.15791659e-04 1.22324825e-03 -7.58541506e-05 -2.53322396e-03 -2.59944760e-02 -1.11749199e-04 5.28711521e-03 -1.41362236e-02 -3.67538539e-03 -1.64031264e-02 4.25165420e-02 -7.20172278e-04 -1.22324825e-03 3.36490998e-03 -2.70562219e-03 -1.72541514e-03 1.65705842e-04 -1.71520858e-03 1.20534581e-03 3.37763195e-03 3.46593013e-02 7.04948694e-03 -8.77460895e-03 1.59730948e-02 -2.18708352e-02 2.85636725e-02 -4.55339938e-02 2.64406855e-03 4.15791659e-04 -2.70562219e-03 4.51786749e-03 1.97649858e-03 6.35721809e-05 1.08690002e-02 4.21010828e-03 -2.01904731e-02 -1.68023178e-03 -2.98610096e-03 2.53322396e-03 2.59944760e-02 5.28711521e-03 -1.11749199e-04 1.41362236e-02 -1.64031264e-02 -3.67538539e-03 -4.25165420e-02 1.98305141e-03 1.22324825e-03 -1.72541514e-03 1.97649858e-03 3.36490998e-03 1.65705842e-04 -1.71520858e-03 1.20534581e-03 - 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 9 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 4 7 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 23 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 22 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 20 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 25 - 0 19 38 54 70 89 105 121 140 159 173 189 208 224 243 262 278 294 313 329 345 364 383 397 413 432 448 -1 -1 2 169 - 6.09103871e-05 6.14453477e-04 -5.91853803e-05 -5.91853803e-05 2.95926902e-04 2.01724529e-04 2.01724529e-04 -1.00862265e-03 -4.78869050e-05 6.91187938e-06 -3.45593969e-05 -8.29425526e-05 -3.45593969e-05 6.14453477e-04 6.16334179e-03 -5.89280869e-04 -5.89280869e-04 2.94640435e-03 2.00665301e-03 2.00665301e-03 -1.00332651e-02 -4.47447198e-04 6.45834401e-05 -3.22917201e-04 -7.75001281e-04 -3.22917201e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 -5.93986875e-05 2.96993437e-04 -5.79546830e-05 2.01724907e-04 -1.00862453e-03 -5.99184710e-05 -3.84006907e-06 1.92003453e-05 -8.23728840e-05 -3.43220350e-05 5.91853803e-05 5.89280869e-04 -5.93986875e-05 1.57901181e-05 2.96993437e-04 2.01724907e-04 -5.79546830e-05 -1.00862453e-03 -4.13777746e-05 -3.84006907e-06 -3.43220350e-05 -9.30773600e-05 1.92003453e-05 -2.95926902e-04 -2.94640435e-03 2.96993437e-04 2.96993437e-04 -1.40977838e-03 -1.00862453e-03 -1.00862453e-03 4.78344308e-03 2.06888873e-04 -3.43220350e-05 1.60905699e-04 3.58342040e-04 1.60905699e-04 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 2.01724907e-04 -1.00862453e-03 2.12351688e-04 -6.85394441e-04 3.42697221e-03 2.00592339e-04 1.40996735e-05 -7.04983673e-05 2.73631522e-04 1.14013134e-04 -2.01724529e-04 -2.00665301e-03 2.01724907e-04 -5.79546830e-05 -1.00862453e-03 -6.85394441e-04 2.12351688e-04 3.42697221e-03 1.36675680e-04 1.40996735e-05 1.14013134e-04 3.10533823e-04 -7.04983673e-05 1.00862265e-03 1.00332651e-02 -1.00862453e-03 -1.00862453e-03 4.78344308e-03 3.42697221e-03 3.42697221e-03 -1.62371149e-02 -6.83378401e-04 1.14013134e-04 -5.33163371e-04 -1.18364611e-03 -5.33163371e-04 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 4.13777746e-05 -2.06888873e-04 -2.00592339e-04 -1.36675680e-04 6.83378401e-04 1.53794146e-05 -4.67548763e-06 2.33774382e-05 2.78902609e-05 1.16209420e-05 6.91187938e-06 6.45834401e-05 3.84006907e-06 3.84006907e-06 3.43220350e-05 -1.40996735e-05 -1.40996735e-05 -1.14013134e-04 -4.67548763e-06 -1.61313514e-07 3.97900833e-06 -8.09818213e-06 3.97900833e-06 -3.45593969e-05 -3.22917201e-04 -1.92003453e-05 3.43220350e-05 -1.60905699e-04 7.04983673e-05 -1.14013134e-04 5.33163371e-04 2.33774382e-05 3.97900833e-06 -1.92605535e-05 2.69156783e-05 1.26855161e-05 -8.29425526e-05 -7.75001281e-04 8.23728840e-05 9.30773600e-05 -3.58342040e-04 -2.73631522e-04 -3.10533823e-04 1.18364611e-03 2.78902609e-05 -8.09818213e-06 2.69156783e-05 4.75843139e-05 3.37032945e-05 -3.45593969e-05 -3.22917201e-04 3.43220350e-05 -1.92003453e-05 -1.60905699e-04 -1.14013134e-04 7.04983673e-05 5.33163371e-04 1.16209420e-05 3.97900833e-06 1.26855161e-05 3.37032945e-05 -1.92605535e-05 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -1 0 -2 652 - 1.70328256e-04 1.56710856e-03 6.51378048e-04 3.25689024e-04 -3.25689024e-04 -2.13278108e-03 -1.06639054e-03 1.06639054e-03 9.05613602e-05 1.04571251e-04 -1.04571251e-04 -5.22856257e-05 9.03813139e-04 6.83095219e-03 2.52992999e-03 2.52992999e-03 -8.43309998e-04 -7.57080511e-03 -7.57080511e-03 2.52360170e-03 5.05224374e-05 1.96891714e-04 -6.56305714e-05 8.75074285e-05 -6.56305714e-05 1.56710856e-03 1.39613919e-02 5.79216869e-03 2.89608434e-03 -2.89608434e-03 -1.87045190e-02 -9.35225951e-03 9.35225951e-03 5.70753169e-04 6.59048991e-04 -6.59048991e-04 -3.29524496e-04 6.83095219e-03 4.49022829e-02 1.71775766e-02 1.71775766e-02 -5.72585887e-03 -4.75796841e-02 -4.75796841e-02 1.58598947e-02 -5.20652809e-04 -2.02904352e-03 6.76347839e-04 -9.01797119e-04 6.76347839e-04 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 -1.28527532e-03 1.28527532e-03 7.54522870e-03 4.15611128e-03 -4.15611128e-03 -1.96268001e-04 -3.07748924e-04 3.07748924e-04 1.78209909e-04 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 -7.14718976e-03 2.38239659e-03 1.66087992e-02 2.03525482e-02 -6.78418274e-03 2.12097053e-04 3.76334544e-04 -1.25444848e-04 1.10087490e-04 -8.25656177e-05 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 -4.14019247e-04 6.42637659e-04 4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.82434463e-04 -8.08681204e-05 1.78209909e-04 4.86708945e-05 4.04340602e-05 -2.52992999e-03 -1.71775766e-02 -7.14718976e-03 -5.92699644e-03 2.38239659e-03 2.03525482e-02 1.66087992e-02 -6.78418274e-03 -1.07099635e-05 3.76334544e-04 -8.25656177e-05 2.38725181e-04 -1.25444848e-04 3.25689024e-04 2.89608434e-03 1.28527532e-03 6.42637659e-04 -4.14019247e-04 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.82434463e-04 1.78209909e-04 -8.08681204e-05 4.86708945e-05 -4.04340602e-05 8.43309998e-04 5.72585887e-03 2.38239659e-03 2.38239659e-03 4.26061120e-04 -6.78418274e-03 -6.78418274e-03 -1.48235482e-03 3.56998782e-06 -8.25656177e-05 1.56159564e-04 6.18340029e-06 1.56159564e-04 2.13278108e-03 1.87045190e-02 7.54522870e-03 4.15611128e-03 -4.15611128e-03 -2.41529920e-02 -1.33621179e-02 1.33621179e-02 4.89198722e-04 8.27434268e-04 -8.27434268e-04 -4.92484006e-04 7.57080511e-03 4.75796841e-02 1.66087992e-02 2.03525482e-02 -6.78418274e-03 -4.42337068e-02 -5.55393321e-02 1.85131107e-02 -9.60604637e-04 -3.07040317e-03 1.02346772e-03 -1.27914009e-03 9.59355067e-04 1.06639054e-03 9.35225951e-03 4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.33621179e-02 -4.10981523e-03 6.68105894e-03 5.17455810e-04 1.77416518e-04 -4.92484006e-04 -1.57533744e-04 -8.87082588e-05 7.57080511e-03 4.75796841e-02 2.03525482e-02 1.66087992e-02 -6.78418274e-03 -5.55393321e-02 -4.42337068e-02 1.85131107e-02 -6.27465494e-04 -3.07040317e-03 9.59355067e-04 -1.47147806e-03 1.02346772e-03 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.33621179e-02 6.68105894e-03 -4.10981523e-03 -5.17455810e-04 -4.92484006e-04 1.77416518e-04 -1.57533744e-04 8.87082588e-05 -2.52360170e-03 -1.58598947e-02 -6.78418274e-03 -6.78418274e-03 -1.48235482e-03 1.85131107e-02 1.85131107e-02 5.13458842e-03 2.09155165e-04 9.59355067e-04 -5.12122996e-04 3.62267372e-04 -5.12122996e-04 9.05613602e-05 5.70753169e-04 1.96268001e-04 1.82434463e-04 -1.82434463e-04 -4.89198722e-04 -5.17455810e-04 5.17455810e-04 -8.99306349e-05 -8.30889164e-05 8.30889164e-05 3.38595206e-05 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 1.07099635e-05 -3.56998782e-06 9.60604637e-04 6.27465494e-04 -2.09155165e-04 1.78917197e-04 -3.48805533e-04 1.16268511e-04 -2.92334169e-04 2.19250627e-04 1.04571251e-04 6.59048991e-04 3.07748924e-04 8.08681204e-05 -1.78209909e-04 -8.27434268e-04 -1.77416518e-04 4.92484006e-04 -8.30889164e-05 -1.08000471e-04 9.44638495e-05 -8.87380160e-06 5.38872760e-05 1.96891714e-04 -2.02904352e-03 -3.76334544e-04 -3.76334544e-04 8.25656177e-05 3.07040317e-03 3.07040317e-03 -9.59355067e-04 -3.48805533e-04 -1.41297171e-03 5.27432619e-04 -6.04148906e-04 5.27432619e-04 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 -1.78209909e-04 8.08681204e-05 8.27434268e-04 4.92484006e-04 -1.77416518e-04 8.30889164e-05 9.44638495e-05 -1.08000471e-04 -8.87380160e-06 -5.38872760e-05 -6.56305714e-05 6.76347839e-04 1.25444848e-04 8.25656177e-05 -1.56159564e-04 -1.02346772e-03 -9.59355067e-04 5.12122996e-04 1.16268511e-04 5.27432619e-04 -6.48472168e-06 3.20296473e-04 -1.72595341e-05 -4.86708945e-05 -4.86708945e-05 1.57533744e-04 1.57533744e-04 -8.87380160e-06 -8.87380160e-06 -4.66282012e-06 8.75074285e-05 -9.01797119e-04 -1.10087490e-04 -2.38725181e-04 -6.18340029e-06 1.27914009e-03 1.47147806e-03 -3.62267372e-04 -2.92334169e-04 -6.04148906e-04 3.20296473e-04 -1.58641225e-04 2.60839721e-04 -5.22856257e-05 -3.29524496e-04 -1.78209909e-04 -4.04340602e-05 4.04340602e-05 4.92484006e-04 8.87082588e-05 -8.87082588e-05 3.38595206e-05 5.38872760e-05 -5.38872760e-05 -2.71695573e-05 -6.56305714e-05 6.76347839e-04 8.25656177e-05 1.25444848e-04 -1.56159564e-04 -9.59355067e-04 -1.02346772e-03 5.12122996e-04 2.19250627e-04 5.27432619e-04 -1.72595341e-05 2.60839721e-04 -6.48472168e-06 1.25466617e-06 1.34349826e-05 6.58962236e-06 1.31792447e-06 -3.95377341e-06 -2.19886127e-05 -4.39772254e-06 1.31931676e-05 3.04388134e-06 1.31803928e-06 -3.95411785e-06 -1.05443143e-06 -7.90823570e-07 1.70328256e-04 1.56710856e-03 6.51378048e-04 3.25689024e-04 -3.25689024e-04 -2.13278108e-03 -1.06639054e-03 1.06639054e-03 9.05613602e-05 1.04571251e-04 -1.04571251e-04 -5.22856257e-05 1.34349826e-05 1.43209127e-04 7.13481329e-05 1.42696266e-05 -4.28088798e-05 -2.37845052e-04 -4.75690104e-05 1.42707031e-04 3.21001433e-05 1.38997698e-05 -4.16993094e-05 -1.11198158e-05 -8.33986187e-06 1.56710856e-03 1.39613919e-02 5.79216869e-03 2.89608434e-03 -2.89608434e-03 -1.87045190e-02 -9.35225951e-03 9.35225951e-03 5.70753169e-04 6.59048991e-04 -6.59048991e-04 -3.29524496e-04 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 -7.04340302e-06 2.11302091e-05 1.16121122e-04 2.36453257e-05 -7.09359772e-05 -1.59884824e-05 -7.11294712e-06 2.13388414e-05 5.79154766e-06 4.34366074e-06 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 -1.28527532e-03 1.28527532e-03 7.54522870e-03 4.15611128e-03 -4.15611128e-03 -1.96268001e-04 -3.07748924e-04 3.07748924e-04 1.78209909e-04 -1.31792447e-06 -1.42696266e-05 -7.04340302e-06 -7.59910514e-07 4.22604181e-06 2.36453257e-05 2.62355898e-06 -1.41871954e-05 -3.41677917e-06 -8.15449649e-07 4.34366074e-06 1.28479698e-06 4.89269790e-07 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 -4.14019247e-04 6.42637659e-04 4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.82434463e-04 -8.08681204e-05 1.78209909e-04 4.86708945e-05 4.04340602e-05 3.95377341e-06 4.28088798e-05 2.11302091e-05 4.22604181e-06 -1.20293553e-05 -7.09359772e-05 -1.41871954e-05 4.04560801e-05 1.02503375e-05 4.34366074e-06 -1.23985450e-05 -3.09546624e-06 -2.47970899e-06 3.25689024e-04 2.89608434e-03 1.28527532e-03 6.42637659e-04 -4.14019247e-04 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.82434463e-04 1.78209909e-04 -8.08681204e-05 4.86708945e-05 -4.04340602e-05 2.19886127e-05 2.37845052e-04 1.16121122e-04 2.36453257e-05 -7.09359772e-05 -3.88706075e-04 -7.91031105e-05 2.37309331e-04 5.45492648e-05 2.42318426e-05 -7.26955279e-05 -1.97115105e-05 -1.47836328e-05 2.13278108e-03 1.87045190e-02 7.54522870e-03 4.15611128e-03 -4.15611128e-03 -2.41529920e-02 -1.33621179e-02 1.33621179e-02 4.89198722e-04 8.27434268e-04 -8.27434268e-04 -4.92484006e-04 4.39772254e-06 4.75690104e-05 2.36453257e-05 2.62355898e-06 -1.41871954e-05 -7.91031105e-05 -9.01114524e-06 4.74618663e-05 1.16157423e-05 2.89015053e-06 -1.47836328e-05 -4.34984751e-06 -1.73409032e-06 1.06639054e-03 9.35225951e-03 4.15611128e-03 1.31106178e-03 -2.07805564e-03 -1.33621179e-02 -4.10981523e-03 6.68105894e-03 5.17455810e-04 1.77416518e-04 -4.92484006e-04 -1.57533744e-04 -8.87082588e-05 -1.31931676e-05 -1.42707031e-04 -7.09359772e-05 -1.41871954e-05 4.04560801e-05 2.37309331e-04 4.74618663e-05 -1.35576122e-04 -3.48472270e-05 -1.47836328e-05 4.23131714e-05 1.06042700e-05 8.46263429e-06 -1.06639054e-03 -9.35225951e-03 -4.15611128e-03 -2.07805564e-03 1.31106178e-03 1.33621179e-02 6.68105894e-03 -4.10981523e-03 -5.17455810e-04 -4.92484006e-04 1.77416518e-04 -1.57533744e-04 8.87082588e-05 3.04388134e-06 3.21001433e-05 1.59884824e-05 3.41677917e-06 -1.02503375e-05 -5.45492648e-05 -1.16157423e-05 3.48472270e-05 5.56082368e-06 2.46595043e-06 -7.39785129e-06 -2.00638043e-06 -1.50478532e-06 9.05613602e-05 5.70753169e-04 1.96268001e-04 1.82434463e-04 -1.82434463e-04 -4.89198722e-04 -5.17455810e-04 5.17455810e-04 -8.99306349e-05 -8.30889164e-05 8.30889164e-05 3.38595206e-05 1.31803928e-06 1.38997698e-05 7.11294712e-06 8.15449649e-07 -4.34366074e-06 -2.42318426e-05 -2.89015053e-06 1.47836328e-05 2.46595043e-06 9.59219321e-07 -3.20700306e-06 -8.83346132e-07 -5.71522584e-07 1.04571251e-04 6.59048991e-04 3.07748924e-04 8.08681204e-05 -1.78209909e-04 -8.27434268e-04 -1.77416518e-04 4.92484006e-04 -8.30889164e-05 -1.08000471e-04 9.44638495e-05 -8.87380160e-06 5.38872760e-05 -3.95411785e-06 -4.16993094e-05 -2.13388414e-05 -4.34366074e-06 1.23985450e-05 7.26955279e-05 1.47836328e-05 -4.23131714e-05 -7.39785129e-06 -3.20700306e-06 9.51122747e-06 2.50445917e-06 1.90867338e-06 -1.04571251e-04 -6.59048991e-04 -3.07748924e-04 -1.78209909e-04 8.08681204e-05 8.27434268e-04 4.92484006e-04 -1.77416518e-04 8.30889164e-05 9.44638495e-05 -1.08000471e-04 -8.87380160e-06 -5.38872760e-05 -1.05443143e-06 -1.11198158e-05 -5.79154766e-06 -1.28479698e-06 3.09546624e-06 1.97115105e-05 4.34984751e-06 -1.06042700e-05 -2.00638043e-06 -8.83346132e-07 2.50445917e-06 6.50274256e-07 5.15449757e-07 -4.86708945e-05 -4.86708945e-05 1.57533744e-04 1.57533744e-04 -8.87380160e-06 -8.87380160e-06 -4.66282012e-06 -7.90823570e-07 -8.33986187e-06 -4.34366074e-06 -4.89269790e-07 2.47970899e-06 1.47836328e-05 1.73409032e-06 -8.46263429e-06 -1.50478532e-06 -5.71522584e-07 1.90867338e-06 5.15449757e-07 3.49595231e-07 -5.22856257e-05 -3.29524496e-04 -1.78209909e-04 -4.04340602e-05 4.04340602e-05 4.92484006e-04 8.87082588e-05 -8.87082588e-05 3.38595206e-05 5.38872760e-05 -5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 25 50 75 101 127 152 178 204 229 255 281 301 326 351 376 401 427 453 478 504 530 555 581 607 627 652 -1 0 -1 520 - 3.91348915e-02 1.43320629e-01 7.02734648e-02 7.02734648e-02 -1.48982977e-01 -1.48982977e-01 -6.10770759e-03 -2.11577197e-02 -1.05788599e-02 1.40271766e-02 6.79314330e-02 1.27999040e-02 3.83997120e-02 1.27999040e-02 -3.13231900e-02 -9.39695701e-02 -3.13231900e-02 1.95007672e-03 -2.53322396e-03 -8.44407987e-04 -3.37763195e-03 -2.53322396e-03 1.43320629e-01 2.06957410e-01 1.43523909e-01 1.43523909e-01 -1.50473058e-01 -1.50473058e-01 -1.38680201e-02 -4.80402309e-02 -2.40201155e-02 6.79314330e-02 1.60907873e-01 4.09845600e-02 1.22953680e-01 4.09845600e-02 -5.94754012e-02 -1.78426204e-01 -5.94754012e-02 2.00105569e-02 -2.59944760e-02 -8.66482532e-03 -3.46593013e-02 -2.59944760e-02 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 -6.79089450e-04 4.18480142e-02 2.82907486e-02 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 -3.21974808e-02 -1.07324936e-02 -1.69480895e-02 6.28329901e-02 2.09443300e-02 -6.06202249e-03 1.11749199e-04 3.72497331e-05 7.04948694e-03 5.28711521e-03 -7.02734648e-02 -1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 2.48400517e-02 4.18480142e-02 1.35572656e-02 -3.83997120e-02 -1.22953680e-01 -3.21974808e-02 -8.01243800e-02 -3.21974808e-02 6.28329901e-02 1.50606551e-01 6.28329901e-02 -9.22207060e-03 1.41362236e-02 5.28711521e-03 1.59730948e-02 1.41362236e-02 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 -1.47334830e-02 -1.27999040e-02 -4.09845600e-02 -1.07324936e-02 -3.21974808e-02 5.73556868e-03 2.09443300e-02 6.28329901e-02 -1.69480895e-02 -3.07402353e-03 5.28711521e-03 3.72497331e-05 8.77460895e-03 1.11749199e-04 1.48982977e-01 1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 1.91463231e-02 -4.52539972e-02 -4.12234663e-02 3.13231900e-02 5.94754012e-02 -1.69480895e-02 6.28329901e-02 2.09443300e-02 4.58861475e-02 -8.26569598e-02 -2.75523199e-02 2.03553554e-02 3.67538539e-03 1.22512846e-03 -2.18708352e-02 -1.64031264e-02 1.48982977e-01 1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 -4.52737305e-02 -4.52539972e-02 -4.03053096e-03 9.39695701e-02 1.78426204e-01 6.28329901e-02 1.50606551e-01 6.28329901e-02 -8.26569598e-02 -1.74532412e-01 -8.26569598e-02 2.62890636e-02 -4.25165420e-02 -1.64031264e-02 -4.55339938e-02 -4.25165420e-02 -8.47000309e-02 1.23301560e-01 3.71929353e-02 3.71929353e-02 3.13231900e-02 5.94754012e-02 2.09443300e-02 6.28329901e-02 -1.69480895e-02 -2.75523199e-02 -8.26569598e-02 4.58861475e-02 8.76302120e-03 -1.64031264e-02 1.22512846e-03 -2.85636725e-02 3.67538539e-03 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 -2.48400517e-02 -1.91463231e-02 4.52737305e-02 -7.67653617e-03 1.41589240e-02 1.39049485e-02 1.95007672e-03 2.00105569e-02 6.06202249e-03 9.22207060e-03 3.07402353e-03 -2.03553554e-02 -2.62890636e-02 -8.76302120e-03 1.46476011e-03 -7.20172278e-04 -2.40057426e-04 -2.64406855e-03 -1.98305141e-03 -2.11577197e-02 -4.80402309e-02 -4.18480142e-02 -4.18480142e-02 4.52539972e-02 4.52539972e-02 1.41589240e-02 4.91061754e-02 2.45239757e-02 -2.53322396e-03 -2.59944760e-02 -1.11749199e-04 -1.41362236e-02 -5.28711521e-03 -3.67538539e-03 4.25165420e-02 1.64031264e-02 -7.20172278e-04 3.36490998e-03 1.22324825e-03 2.70562219e-03 1.72541514e-03 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -8.44407987e-04 -8.66482532e-03 -3.72497331e-05 -5.28711521e-03 -3.72497331e-05 -1.22512846e-03 1.64031264e-02 -1.22512846e-03 -2.40057426e-04 1.22324825e-03 1.02914641e-04 4.15791659e-04 1.22324825e-03 -1.05788599e-02 -2.40201155e-02 -2.82907486e-02 -1.35572656e-02 4.12234663e-02 4.03053096e-03 1.39049485e-02 2.45239757e-02 8.37951533e-03 -3.37763195e-03 -3.46593013e-02 -7.04948694e-03 -1.59730948e-02 -8.77460895e-03 2.18708352e-02 4.55339938e-02 2.85636725e-02 -2.64406855e-03 2.70562219e-03 4.15791659e-04 4.51786749e-03 1.97649858e-03 1.47334830e-02 -3.71929353e-02 -7.88139292e-03 -7.82316899e-03 -2.53322396e-03 -2.59944760e-02 -5.28711521e-03 -1.41362236e-02 -1.11749199e-04 1.64031264e-02 4.25165420e-02 -3.67538539e-03 -1.98305141e-03 1.72541514e-03 1.22324825e-03 1.97649858e-03 3.36490998e-03 1.40271766e-02 6.79314330e-02 3.83997120e-02 1.27999040e-02 -1.27999040e-02 -9.39695701e-02 -3.13231900e-02 3.13231900e-02 -3.90015343e-03 -2.53322396e-03 2.53322396e-03 8.44407987e-04 3.91348915e-02 1.43320629e-01 7.02734648e-02 7.02734648e-02 -1.48982977e-01 -1.48982977e-01 -6.10770759e-03 -2.11577197e-02 -1.05788599e-02 6.79314330e-02 1.60907873e-01 1.22953680e-01 4.09845600e-02 -4.09845600e-02 -1.78426204e-01 -5.94754012e-02 5.94754012e-02 -4.00211138e-02 -2.59944760e-02 2.59944760e-02 8.66482532e-03 1.43320629e-01 2.06957410e-01 1.43523909e-01 1.43523909e-01 -1.50473058e-01 -1.50473058e-01 -1.38680201e-02 -4.80402309e-02 -2.40201155e-02 -3.83997120e-02 -1.22953680e-01 -8.01243800e-02 -3.21974808e-02 3.21974808e-02 1.50606551e-01 6.28329901e-02 -6.28329901e-02 1.84441412e-02 1.41362236e-02 -1.41362236e-02 -5.28711521e-03 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 -6.79089450e-04 4.18480142e-02 2.82907486e-02 -1.27999040e-02 -4.09845600e-02 -3.21974808e-02 5.73556868e-03 1.07324936e-02 6.28329901e-02 -1.69480895e-02 -2.09443300e-02 9.13604602e-03 1.11749199e-04 -5.28711521e-03 -1.72512200e-03 -3.72497331e-05 -7.02734648e-02 -1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 2.48400517e-02 4.18480142e-02 1.35572656e-02 1.27999040e-02 4.09845600e-02 3.21974808e-02 1.07324936e-02 5.73556868e-03 -6.28329901e-02 -2.09443300e-02 -1.69480895e-02 -9.13604602e-03 -5.28711521e-03 1.11749199e-04 -1.72512200e-03 3.72497331e-05 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 -1.47334830e-02 9.39695701e-02 1.78426204e-01 1.50606551e-01 6.28329901e-02 -6.28329901e-02 -1.74532412e-01 -8.26569598e-02 8.26569598e-02 -5.25781272e-02 -4.25165420e-02 4.25165420e-02 1.64031264e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 1.91463231e-02 -4.52539972e-02 -4.12234663e-02 3.13231900e-02 5.94754012e-02 6.28329901e-02 -1.69480895e-02 -2.09443300e-02 -8.26569598e-02 4.58861475e-02 2.75523199e-02 -2.91183766e-02 3.67538539e-03 1.64031264e-02 6.69283727e-03 -1.22512846e-03 1.48982977e-01 1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 -4.52737305e-02 -4.52539972e-02 -4.03053096e-03 -3.13231900e-02 -5.94754012e-02 -6.28329901e-02 -2.09443300e-02 -1.69480895e-02 8.26569598e-02 2.75523199e-02 4.58861475e-02 2.91183766e-02 1.64031264e-02 3.67538539e-03 6.69283727e-03 1.22512846e-03 -8.47000309e-02 1.23301560e-01 3.71929353e-02 3.71929353e-02 -3.90015343e-03 -4.00211138e-02 -1.84441412e-02 -9.13604602e-03 9.13604602e-03 5.25781272e-02 2.91183766e-02 -2.91183766e-02 6.04442117e-03 2.70322369e-03 -2.70322369e-03 -4.80114852e-04 -6.10770759e-03 -1.38680201e-02 6.79089450e-04 -2.48400517e-02 -1.91463231e-02 4.52737305e-02 -7.67653617e-03 1.41589240e-02 1.39049485e-02 -2.53322396e-03 -2.59944760e-02 -1.41362236e-02 -1.11749199e-04 5.28711521e-03 4.25165420e-02 -3.67538539e-03 -1.64031264e-02 2.70322369e-03 3.36490998e-03 -1.72541514e-03 7.29123606e-04 -1.22324825e-03 -2.11577197e-02 -4.80402309e-02 -4.18480142e-02 -4.18480142e-02 4.52539972e-02 4.52539972e-02 1.41589240e-02 4.91061754e-02 2.45239757e-02 2.53322396e-03 2.59944760e-02 1.41362236e-02 5.28711521e-03 -1.11749199e-04 -4.25165420e-02 -1.64031264e-02 -3.67538539e-03 -2.70322369e-03 -1.72541514e-03 3.36490998e-03 7.29123606e-04 1.22324825e-03 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 -7.88139292e-03 1.72512200e-03 1.72512200e-03 -6.69283727e-03 -6.69283727e-03 7.29123606e-04 7.29123606e-04 -6.17935738e-05 -1.05788599e-02 -2.40201155e-02 -2.82907486e-02 -1.35572656e-02 4.12234663e-02 4.03053096e-03 1.39049485e-02 2.45239757e-02 8.37951533e-03 8.44407987e-04 8.66482532e-03 5.28711521e-03 3.72497331e-05 -3.72497331e-05 -1.64031264e-02 1.22512846e-03 -1.22512846e-03 -4.80114852e-04 -1.22324825e-03 1.22324825e-03 1.02914641e-04 1.47334830e-02 -3.71929353e-02 -7.88139292e-03 -7.82316899e-03 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 3 4 6 7 9 10 11 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 12 17 20 23 25 - 0 22 44 66 88 105 127 149 166 188 210 227 249 266 287 308 329 351 368 389 411 428 449 471 488 504 520 -1 0 0 488 - 3.91348915e-02 1.43320629e-01 7.02734648e-02 7.02734648e-02 -1.48982977e-01 -1.48982977e-01 1.22154152e-02 -2.11577197e-02 9.03813139e-04 6.83095219e-03 -8.43309998e-04 2.52992999e-03 2.52992999e-03 2.52360170e-03 -7.57080511e-03 -7.57080511e-03 -1.01044875e-04 -6.56305714e-05 -6.56305714e-05 1.96891714e-04 1.43320629e-01 2.06957410e-01 1.43523909e-01 1.43523909e-01 -1.50473058e-01 -1.50473058e-01 2.77360403e-02 -4.80402309e-02 6.83095219e-03 4.49022829e-02 -5.72585887e-03 1.71775766e-02 1.71775766e-02 1.58598947e-02 -4.75796841e-02 -4.75796841e-02 1.04130562e-03 6.76347839e-04 6.76347839e-04 -2.02904352e-03 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 -1.47334830e-02 8.43309998e-04 5.72585887e-03 4.26061120e-04 2.38239659e-03 2.38239659e-03 -1.48235482e-03 -6.78418274e-03 -6.78418274e-03 -7.13997564e-06 1.56159564e-04 1.56159564e-04 -8.25656177e-05 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 -2.41609623e-02 -1.47334830e-02 4.18480142e-02 -2.52992999e-03 -1.71775766e-02 2.38239659e-03 -5.92699644e-03 -7.14718976e-03 -6.78418274e-03 1.66087992e-02 2.03525482e-02 -2.01387090e-04 -1.25444848e-04 -8.25656177e-05 1.28637691e-04 3.76334544e-04 -7.02734648e-02 -1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 -2.41609623e-02 1.47334830e-02 4.18480142e-02 -2.52992999e-03 -1.71775766e-02 2.38239659e-03 -7.14718976e-03 -5.92699644e-03 -6.78418274e-03 2.03525482e-02 1.66087992e-02 -2.01387090e-04 -8.25656177e-05 -1.25444848e-04 -1.28637691e-04 3.76334544e-04 -8.47000309e-02 1.23301560e-01 3.71929353e-02 3.71929353e-02 -2.52360170e-03 -1.58598947e-02 -1.48235482e-03 -6.78418274e-03 -6.78418274e-03 5.13458842e-03 1.85131107e-02 1.85131107e-02 -4.18310329e-04 -5.12122996e-04 -5.12122996e-04 9.59355067e-04 1.48982977e-01 1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 2.61274075e-02 3.71929353e-02 -4.52539972e-02 7.57080511e-03 4.75796841e-02 -6.78418274e-03 1.66087992e-02 2.03525482e-02 1.85131107e-02 -4.42337068e-02 -5.55393321e-02 1.58807013e-03 1.02346772e-03 9.59355067e-04 -1.92337974e-04 -3.07040317e-03 1.48982977e-01 1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 2.61274075e-02 -3.71929353e-02 -4.52539972e-02 7.57080511e-03 4.75796841e-02 -6.78418274e-03 2.03525482e-02 1.66087992e-02 1.85131107e-02 -5.55393321e-02 -4.42337068e-02 1.58807013e-03 9.59355067e-04 1.02346772e-03 1.92337974e-04 -3.07040317e-03 1.22154152e-02 2.77360403e-02 2.41609623e-02 2.41609623e-02 -2.61274075e-02 -2.61274075e-02 1.64075411e-02 -2.83178480e-02 -1.01044875e-04 1.04130562e-03 7.13997564e-06 2.01387090e-04 2.01387090e-04 4.18310329e-04 -1.58807013e-03 -1.58807013e-03 -3.27420436e-04 -3.35519138e-04 -3.35519138e-04 6.97611067e-04 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -6.56305714e-05 6.76347839e-04 -1.56159564e-04 1.25444848e-04 8.25656177e-05 5.12122996e-04 -1.02346772e-03 -9.59355067e-04 -3.35519138e-04 -6.48472168e-06 -1.72595341e-05 -5.94567521e-05 5.27432619e-04 1.47334830e-02 -3.71929353e-02 -7.88139292e-03 -7.82316899e-03 -6.56305714e-05 6.76347839e-04 -1.56159564e-04 8.25656177e-05 1.25444848e-04 5.12122996e-04 -9.59355067e-04 -1.02346772e-03 -3.35519138e-04 -1.72595341e-05 -6.48472168e-06 5.94567521e-05 5.27432619e-04 1.47334830e-02 -1.47334830e-02 -3.71929353e-02 3.71929353e-02 -1.57045619e-02 -1.28637691e-04 1.28637691e-04 1.92337974e-04 -1.92337974e-04 -5.94567521e-05 5.94567521e-05 3.47696408e-04 -2.11577197e-02 -4.80402309e-02 -4.18480142e-02 -4.18480142e-02 4.52539972e-02 4.52539972e-02 -2.83178480e-02 4.91061754e-02 1.96891714e-04 -2.02904352e-03 8.25656177e-05 -3.76334544e-04 -3.76334544e-04 -9.59355067e-04 3.07040317e-03 3.07040317e-03 6.97611067e-04 5.27432619e-04 5.27432619e-04 -1.41297171e-03 2.64027557e-01 3.35702802e-01 2.34088114e-01 2.34088114e-01 2.34088114e-01 -2.32521472e-01 -2.32521472e-01 -2.32521472e-01 -1.17443083e-01 -1.17443083e-01 -1.17443083e-01 3.91348915e-02 1.43320629e-01 7.02734648e-02 7.02734648e-02 -1.48982977e-01 -1.48982977e-01 1.22154152e-02 -2.11577197e-02 3.35702802e-01 2.76220067e-01 4.62745275e-02 4.62745275e-02 4.62745275e-02 -8.52749857e-02 -8.52749857e-02 -8.52749857e-02 9.22774953e-02 9.22774953e-02 9.22774953e-02 1.43320629e-01 2.06957410e-01 1.43523909e-01 1.43523909e-01 -1.50473058e-01 -1.50473058e-01 2.77360403e-02 -4.80402309e-02 -2.34088114e-01 -4.62745275e-02 5.08041420e-02 -1.96806662e-01 -1.96806662e-01 -1.84251812e-01 7.23859503e-02 7.23859503e-02 -1.26391054e-01 2.67331842e-02 2.67331842e-02 1.36191048e-01 4.35912107e-02 -8.47000309e-02 -1.47334830e-02 -1.47334830e-02 -2.34088114e-01 -4.62745275e-02 -1.96806662e-01 5.08041420e-02 -1.96806662e-01 7.23859503e-02 -1.84251812e-01 7.23859503e-02 6.31955270e-02 2.67331842e-02 1.36191048e-01 -1.09457864e-01 2.67331842e-02 -7.02734648e-02 -1.43523909e-01 -6.94770805e-02 -1.13068291e-01 9.01742992e-02 1.74874330e-01 -2.41609623e-02 -1.47334830e-02 4.18480142e-02 -2.34088114e-01 -4.62745275e-02 -1.96806662e-01 -1.96806662e-01 5.08041420e-02 7.23859503e-02 7.23859503e-02 -1.84251812e-01 6.31955270e-02 1.36191048e-01 2.67331842e-02 1.09457864e-01 2.67331842e-02 -7.02734648e-02 -1.43523909e-01 -1.13068291e-01 -6.94770805e-02 1.74874330e-01 9.01742992e-02 -2.41609623e-02 1.47334830e-02 4.18480142e-02 2.32521472e-01 8.52749857e-02 -1.84251812e-01 7.23859503e-02 7.23859503e-02 1.72059579e-01 -9.02854717e-02 -9.02854717e-02 2.86829339e-02 8.36706010e-02 8.36706010e-02 5.88304515e-02 -8.47000309e-02 1.23301560e-01 3.71929353e-02 3.71929353e-02 2.32521472e-01 8.52749857e-02 7.23859503e-02 -1.84251812e-01 7.23859503e-02 -9.02854717e-02 1.72059579e-01 -9.02854717e-02 -1.43414670e-02 8.36706010e-02 5.88304515e-02 2.48401494e-02 8.36706010e-02 1.48982977e-01 1.50473058e-01 9.01742992e-02 1.74874330e-01 -3.55791693e-02 -1.58880729e-01 2.61274075e-02 3.71929353e-02 -4.52539972e-02 2.32521472e-01 8.52749857e-02 7.23859503e-02 7.23859503e-02 -1.84251812e-01 -9.02854717e-02 -9.02854717e-02 1.72059579e-01 -1.43414670e-02 5.88304515e-02 8.36706010e-02 -2.48401494e-02 8.36706010e-02 1.48982977e-01 1.50473058e-01 1.74874330e-01 9.01742992e-02 -1.58880729e-01 -3.55791693e-02 2.61274075e-02 -3.71929353e-02 -4.52539972e-02 1.26391054e-01 -6.31955270e-02 -6.31955270e-02 -2.86829339e-02 1.43414670e-02 1.43414670e-02 -1.36861292e-01 -5.81908714e-02 -5.81908714e-02 1.16381743e-01 1.22154152e-02 2.77360403e-02 2.41609623e-02 2.41609623e-02 -2.61274075e-02 -2.61274075e-02 1.64075411e-02 -2.83178480e-02 -1.17443083e-01 9.22774953e-02 -2.67331842e-02 -2.67331842e-02 -1.36191048e-01 -8.36706010e-02 -8.36706010e-02 -5.88304515e-02 -5.81908714e-02 2.75756579e-02 6.36474041e-02 -1.00789546e-01 6.36474041e-02 1.47334830e-02 -3.71929353e-02 -7.82316899e-03 -7.88139292e-03 -1.17443083e-01 9.22774953e-02 -2.67331842e-02 -1.36191048e-01 -2.67331842e-02 -8.36706010e-02 -5.88304515e-02 -8.36706010e-02 -5.81908714e-02 6.36474041e-02 2.75756579e-02 1.00789546e-01 6.36474041e-02 1.47334830e-02 -3.71929353e-02 -7.88139292e-03 -7.82316899e-03 1.09457864e-01 -1.09457864e-01 -2.48401494e-02 2.48401494e-02 -1.00789546e-01 1.00789546e-01 -1.36861292e-01 1.47334830e-02 -1.47334830e-02 -3.71929353e-02 3.71929353e-02 -1.57045619e-02 -1.17443083e-01 9.22774953e-02 -1.36191048e-01 -2.67331842e-02 -2.67331842e-02 -5.88304515e-02 -8.36706010e-02 -8.36706010e-02 1.16381743e-01 6.36474041e-02 6.36474041e-02 2.75756579e-02 -2.11577197e-02 -4.80402309e-02 -4.18480142e-02 -4.18480142e-02 4.52539972e-02 4.52539972e-02 -2.83178480e-02 4.91061754e-02 - 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 11 16 17 19 20 22 23 24 0 1 3 4 6 7 8 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 3 4 6 7 9 10 11 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 - 0 20 40 56 78 100 116 138 160 180 197 214 226 246 265 284 300 322 344 360 382 404 422 439 456 468 488 -1 0 1 507 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 3.25689024e-04 6.51378048e-04 1.06639054e-03 -1.06639054e-03 -2.13278108e-03 -4.52806801e-05 -5.22856257e-05 -1.04571251e-04 -7.84284385e-05 1.04571251e-04 1.56710856e-03 1.39613919e-02 -2.89608434e-03 2.89608434e-03 5.79216869e-03 9.35225951e-03 -9.35225951e-03 -1.87045190e-02 -2.85376584e-04 -3.29524496e-04 -6.59048991e-04 -4.94286743e-04 6.59048991e-04 3.25689024e-04 2.89608434e-03 -4.14019247e-04 6.42637659e-04 1.28527532e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 -1.33367462e-04 -4.04340602e-05 -8.08681204e-05 -1.33657432e-04 1.78209909e-04 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 -4.14019247e-04 -1.28527532e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 4.90670003e-05 4.04340602e-05 1.78209909e-04 1.82328327e-04 -8.08681204e-05 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 -1.28527532e-03 -2.34193222e-03 -4.15611128e-03 4.15611128e-03 7.54522870e-03 9.81340007e-05 1.78209909e-04 3.07748924e-04 1.69973075e-04 -3.07748924e-04 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 -4.10981523e-03 6.68105894e-03 1.33621179e-02 3.95156129e-04 8.87082588e-05 1.77416518e-04 3.69363005e-04 -4.92484006e-04 1.06639054e-03 9.35225951e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 6.68105894e-03 -4.10981523e-03 -1.33621179e-02 -1.22299680e-04 -8.87082588e-05 -4.92484006e-04 -5.26896749e-04 1.77416518e-04 2.13278108e-03 1.87045190e-02 -4.15611128e-03 4.15611128e-03 7.54522870e-03 1.33621179e-02 -1.33621179e-02 -2.41529920e-02 -2.44599361e-04 -4.92484006e-04 -8.27434268e-04 -4.23658521e-04 8.27434268e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -4.90670003e-05 -9.81340007e-05 -3.95156129e-04 1.22299680e-04 2.44599361e-04 -2.59797738e-05 -1.69297603e-05 -3.38595206e-05 -3.69220468e-05 4.92293958e-05 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 -4.04340602e-05 -1.78209909e-04 -8.87082588e-05 8.87082588e-05 4.92484006e-04 -1.69297603e-05 -2.71695573e-05 -5.38872760e-05 -2.93232050e-05 5.38872760e-05 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 -1.78209909e-04 -3.07748924e-04 -1.77416518e-04 4.92484006e-04 8.27434268e-04 -3.38595206e-05 -5.38872760e-05 -1.08000471e-04 -7.63940131e-05 9.44638495e-05 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 -1.82328327e-04 -1.69973075e-04 -3.69363005e-04 5.26896749e-04 4.23658521e-04 -3.69220468e-05 -2.93232050e-05 -7.63940131e-05 -6.86136812e-05 6.75202116e-05 1.04571251e-04 6.59048991e-04 -1.78209909e-04 8.08681204e-05 3.07748924e-04 4.92484006e-04 -1.77416518e-04 -8.27434268e-04 4.92293958e-05 5.38872760e-05 9.44638495e-05 6.75202116e-05 -1.08000471e-04 1.40271766e-02 6.79314330e-02 -1.27999040e-02 1.27999040e-02 3.83997120e-02 3.13231900e-02 -3.13231900e-02 -9.39695701e-02 1.95007672e-03 8.44407987e-04 2.53322396e-03 3.37763195e-03 -2.53322396e-03 1.70328256e-04 1.56710856e-03 -3.25689024e-04 3.25689024e-04 6.51378048e-04 1.06639054e-03 -1.06639054e-03 -2.13278108e-03 -4.52806801e-05 -5.22856257e-05 -1.04571251e-04 -7.84284385e-05 1.04571251e-04 6.79314330e-02 1.60907873e-01 -4.09845600e-02 4.09845600e-02 1.22953680e-01 5.94754012e-02 -5.94754012e-02 -1.78426204e-01 2.00105569e-02 8.66482532e-03 2.59944760e-02 3.46593013e-02 -2.59944760e-02 1.56710856e-03 1.39613919e-02 -2.89608434e-03 2.89608434e-03 5.79216869e-03 9.35225951e-03 -9.35225951e-03 -1.87045190e-02 -2.85376584e-04 -3.29524496e-04 -6.59048991e-04 -4.94286743e-04 6.59048991e-04 1.27999040e-02 4.09845600e-02 5.73556868e-03 1.07324936e-02 3.21974808e-02 -1.69480895e-02 -2.09443300e-02 -6.28329901e-02 6.06202249e-03 3.72497331e-05 1.11749199e-04 7.04948694e-03 -5.28711521e-03 3.25689024e-04 2.89608434e-03 -4.14019247e-04 6.42637659e-04 1.28527532e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 -1.33367462e-04 -4.04340602e-05 -8.08681204e-05 -1.33657432e-04 1.78209909e-04 -1.27999040e-02 -4.09845600e-02 1.07324936e-02 5.73556868e-03 -3.21974808e-02 -2.09443300e-02 -1.69480895e-02 6.28329901e-02 -3.07402353e-03 -3.72497331e-05 -5.28711521e-03 -8.77460895e-03 1.11749199e-04 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 -4.14019247e-04 -1.28527532e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 4.90670003e-05 4.04340602e-05 1.78209909e-04 1.82328327e-04 -8.08681204e-05 -3.83997120e-02 -1.22953680e-01 3.21974808e-02 -3.21974808e-02 -8.01243800e-02 -6.28329901e-02 6.28329901e-02 1.50606551e-01 -9.22207060e-03 -5.28711521e-03 -1.41362236e-02 -1.59730948e-02 1.41362236e-02 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 -1.28527532e-03 -2.34193222e-03 -4.15611128e-03 4.15611128e-03 7.54522870e-03 9.81340007e-05 1.78209909e-04 3.07748924e-04 1.69973075e-04 -3.07748924e-04 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 -2.09443300e-02 -6.28329901e-02 4.58861475e-02 2.75523199e-02 8.26569598e-02 -2.03553554e-02 1.22512846e-03 3.67538539e-03 -2.18708352e-02 1.64031264e-02 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -2.07805564e-03 -4.15611128e-03 -4.10981523e-03 6.68105894e-03 1.33621179e-02 3.95156129e-04 8.87082588e-05 1.77416518e-04 3.69363005e-04 -4.92484006e-04 3.13231900e-02 5.94754012e-02 -2.09443300e-02 -1.69480895e-02 6.28329901e-02 2.75523199e-02 4.58861475e-02 -8.26569598e-02 8.76302120e-03 -1.22512846e-03 1.64031264e-02 2.85636725e-02 3.67538539e-03 1.06639054e-03 9.35225951e-03 -2.07805564e-03 1.31106178e-03 4.15611128e-03 6.68105894e-03 -4.10981523e-03 -1.33621179e-02 -1.22299680e-04 -8.87082588e-05 -4.92484006e-04 -5.26896749e-04 1.77416518e-04 9.39695701e-02 1.78426204e-01 -6.28329901e-02 6.28329901e-02 1.50606551e-01 8.26569598e-02 -8.26569598e-02 -1.74532412e-01 2.62890636e-02 1.64031264e-02 4.25165420e-02 4.55339938e-02 -4.25165420e-02 2.13278108e-03 1.87045190e-02 -4.15611128e-03 4.15611128e-03 7.54522870e-03 1.33621179e-02 -1.33621179e-02 -2.41529920e-02 -2.44599361e-04 -4.92484006e-04 -8.27434268e-04 -4.23658521e-04 8.27434268e-04 1.95007672e-03 2.00105569e-02 -6.06202249e-03 3.07402353e-03 9.22207060e-03 2.03553554e-02 -8.76302120e-03 -2.62890636e-02 1.46476011e-03 2.40057426e-04 7.20172278e-04 2.64406855e-03 -1.98305141e-03 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -4.90670003e-05 -9.81340007e-05 -3.95156129e-04 1.22299680e-04 2.44599361e-04 -2.59797738e-05 -1.69297603e-05 -3.38595206e-05 -3.69220468e-05 4.92293958e-05 8.44407987e-04 8.66482532e-03 -3.72497331e-05 3.72497331e-05 5.28711521e-03 -1.22512846e-03 1.22512846e-03 -1.64031264e-02 2.40057426e-04 1.02914641e-04 1.22324825e-03 4.15791659e-04 -1.22324825e-03 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 -4.04340602e-05 -1.78209909e-04 -8.87082588e-05 8.87082588e-05 4.92484006e-04 -1.69297603e-05 -2.71695573e-05 -5.38872760e-05 -2.93232050e-05 5.38872760e-05 2.53322396e-03 2.59944760e-02 -1.11749199e-04 5.28711521e-03 1.41362236e-02 -3.67538539e-03 -1.64031264e-02 -4.25165420e-02 7.20172278e-04 1.22324825e-03 3.36490998e-03 2.70562219e-03 -1.72541514e-03 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 -1.78209909e-04 -3.07748924e-04 -1.77416518e-04 4.92484006e-04 8.27434268e-04 -3.38595206e-05 -5.38872760e-05 -1.08000471e-04 -7.63940131e-05 9.44638495e-05 3.37763195e-03 3.46593013e-02 -7.04948694e-03 8.77460895e-03 1.59730948e-02 2.18708352e-02 -2.85636725e-02 -4.55339938e-02 2.64406855e-03 4.15791659e-04 2.70562219e-03 4.51786749e-03 -1.97649858e-03 -7.84284385e-05 -4.94286743e-04 1.33657432e-04 -1.82328327e-04 -1.69973075e-04 -3.69363005e-04 5.26896749e-04 4.23658521e-04 -3.69220468e-05 -2.93232050e-05 -7.63940131e-05 -6.86136812e-05 6.75202116e-05 -2.53322396e-03 -2.59944760e-02 5.28711521e-03 -1.11749199e-04 -1.41362236e-02 -1.64031264e-02 -3.67538539e-03 4.25165420e-02 -1.98305141e-03 -1.22324825e-03 -1.72541514e-03 -1.97649858e-03 3.36490998e-03 1.04571251e-04 6.59048991e-04 -1.78209909e-04 8.08681204e-05 3.07748924e-04 4.92484006e-04 -1.77416518e-04 -8.27434268e-04 4.92293958e-05 5.38872760e-05 9.44638495e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 195 221 247 273 299 325 351 377 403 429 455 481 507 -1 0 2 169 - 1.25466617e-06 1.34349826e-05 -3.95377341e-06 1.31792447e-06 6.58962236e-06 1.31931676e-05 -4.39772254e-06 -2.19886127e-05 -6.08776268e-07 -7.90823570e-07 -3.95411785e-06 -3.16329428e-06 1.31803928e-06 1.34349826e-05 1.43209127e-04 -4.28088798e-05 1.42696266e-05 7.13481329e-05 1.42707031e-04 -4.75690104e-05 -2.37845052e-04 -6.42002866e-06 -8.33986187e-06 -4.16993094e-05 -3.33594475e-05 1.38997698e-05 3.95377341e-06 4.28088798e-05 -1.20293553e-05 4.22604181e-06 2.11302091e-05 4.04560801e-05 -1.41871954e-05 -7.09359772e-05 -2.44441635e-06 -2.47970899e-06 -1.23985450e-05 -1.04247858e-05 4.34366074e-06 -1.31792447e-06 -1.42696266e-05 4.22604181e-06 -7.59910514e-07 -7.04340302e-06 -1.41871954e-05 2.62355898e-06 2.36453257e-05 5.95722755e-07 4.89269790e-07 4.34366074e-06 3.60141605e-06 -8.15449649e-07 -6.58962236e-06 -7.13481329e-05 2.11302091e-05 -7.04340302e-06 -3.45682450e-05 -7.09359772e-05 2.36453257e-05 1.16121122e-04 2.97861377e-06 4.34366074e-06 2.13388414e-05 1.67422057e-05 -7.11294712e-06 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 -1.41871954e-05 -7.09359772e-05 -1.35576122e-04 4.74618663e-05 2.37309331e-04 8.24004626e-06 8.46263429e-06 4.23131714e-05 3.54807188e-05 -1.47836328e-05 4.39772254e-06 4.75690104e-05 -1.41871954e-05 2.62355898e-06 2.36453257e-05 4.74618663e-05 -9.01114524e-06 -7.91031105e-05 -2.04079272e-06 -1.73409032e-06 -1.47836328e-05 -1.22344517e-05 2.89015053e-06 2.19886127e-05 2.37845052e-04 -7.09359772e-05 2.36453257e-05 1.16121122e-04 2.37309331e-04 -7.91031105e-05 -3.88706075e-04 -1.02039636e-05 -1.47836328e-05 -7.26955279e-05 -5.70968043e-05 2.42318426e-05 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 -5.95722755e-07 -2.97861377e-06 -8.24004626e-06 2.04079272e-06 1.02039636e-05 1.40335193e-07 3.06000076e-07 1.53000038e-06 1.12314006e-06 -4.67975025e-07 -7.90823570e-07 -8.33986187e-06 2.47970899e-06 -4.89269790e-07 -4.34366074e-06 -8.46263429e-06 1.73409032e-06 1.47836328e-05 3.06000076e-07 3.49595231e-07 1.90867338e-06 1.56090719e-06 -5.71522584e-07 -3.95411785e-06 -4.16993094e-05 1.23985450e-05 -4.34366074e-06 -2.13388414e-05 -4.23131714e-05 1.47836328e-05 7.26955279e-05 1.53000038e-06 1.90867338e-06 9.51122747e-06 7.65895674e-06 -3.20700306e-06 -3.16329428e-06 -3.33594475e-05 1.04247858e-05 -3.60141605e-06 -1.67422057e-05 -3.54807188e-05 1.22344517e-05 5.70968043e-05 1.12314006e-06 1.56090719e-06 7.65895674e-06 6.07076274e-06 -2.57724878e-06 1.31803928e-06 1.38997698e-05 -4.34366074e-06 8.15449649e-07 7.11294712e-06 1.47836328e-05 -2.89015053e-06 -2.42318426e-05 -4.67975025e-07 -5.71522584e-07 -3.20700306e-06 -2.57724878e-06 9.59219321e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -1 1 -2 660 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 6.51378048e-04 -3.25689024e-04 -1.06639054e-03 -2.13278108e-03 1.06639054e-03 -4.52806801e-05 1.04571251e-04 -5.22856257e-05 7.84284385e-05 -1.04571251e-04 6.09103871e-05 6.14453477e-04 5.91853803e-05 2.95926902e-04 -5.91853803e-05 -2.01724529e-04 -1.00862265e-03 2.01724529e-04 -4.78869050e-05 3.45593969e-05 -6.91187938e-06 8.29425526e-05 -3.45593969e-05 1.56710856e-03 1.39613919e-02 2.89608434e-03 5.79216869e-03 -2.89608434e-03 -9.35225951e-03 -1.87045190e-02 9.35225951e-03 -2.85376584e-04 6.59048991e-04 -3.29524496e-04 4.94286743e-04 -6.59048991e-04 6.14453477e-04 6.16334179e-03 5.89280869e-04 2.94640435e-03 -5.89280869e-04 -2.00665301e-03 -1.00332651e-02 2.00665301e-03 -4.47447198e-04 3.22917201e-04 -6.45834401e-05 7.75001281e-04 -3.22917201e-04 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -1.28527532e-03 6.42637659e-04 1.31106178e-03 4.15611128e-03 -2.07805564e-03 1.33367462e-04 -8.08681204e-05 4.04340602e-05 -1.33657432e-04 1.78209909e-04 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 -2.96993437e-04 5.93986875e-05 -5.79546830e-05 1.00862453e-03 -2.01724907e-04 5.99184710e-05 1.92003453e-05 -3.84006907e-06 -8.23728840e-05 3.43220350e-05 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 -2.34193222e-03 1.28527532e-03 4.15611128e-03 7.54522870e-03 -4.15611128e-03 9.81340007e-05 -3.07748924e-04 1.78209909e-04 -1.69973075e-04 3.07748924e-04 -2.95926902e-04 -2.94640435e-03 -2.96993437e-04 -1.40977838e-03 2.96993437e-04 1.00862453e-03 4.78344308e-03 -1.00862453e-03 2.06888873e-04 -1.60905699e-04 3.43220350e-05 -3.58342040e-04 1.60905699e-04 3.25689024e-04 2.89608434e-03 6.42637659e-04 1.28527532e-03 -4.14019247e-04 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 -4.90670003e-05 1.78209909e-04 -4.04340602e-05 1.82328327e-04 -8.08681204e-05 5.91853803e-05 5.89280869e-04 5.93986875e-05 2.96993437e-04 1.57901181e-05 -2.01724907e-04 -1.00862453e-03 -5.79546830e-05 -4.13777746e-05 3.43220350e-05 3.84006907e-06 9.30773600e-05 1.92003453e-05 1.06639054e-03 9.35225951e-03 1.31106178e-03 4.15611128e-03 -2.07805564e-03 -4.10981523e-03 -1.33621179e-02 6.68105894e-03 -3.95156129e-04 1.77416518e-04 -8.87082588e-05 3.69363005e-04 -4.92484006e-04 2.01724529e-04 2.00665301e-03 -5.79546830e-05 1.00862453e-03 -2.01724907e-04 2.12351688e-04 -3.42697221e-03 6.85394441e-04 -2.00592339e-04 -7.04983673e-05 1.40996735e-05 2.73631522e-04 -1.14013134e-04 2.13278108e-03 1.87045190e-02 4.15611128e-03 7.54522870e-03 -4.15611128e-03 -1.33621179e-02 -2.41529920e-02 1.33621179e-02 -2.44599361e-04 8.27434268e-04 -4.92484006e-04 4.23658521e-04 -8.27434268e-04 1.00862265e-03 1.00332651e-02 1.00862453e-03 4.78344308e-03 -1.00862453e-03 -3.42697221e-03 -1.62371149e-02 3.42697221e-03 -6.83378401e-04 5.33163371e-04 -1.14013134e-04 1.18364611e-03 -5.33163371e-04 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 6.68105894e-03 1.33621179e-02 -4.10981523e-03 1.22299680e-04 -4.92484006e-04 8.87082588e-05 -5.26896749e-04 1.77416518e-04 -2.01724529e-04 -2.00665301e-03 -2.01724907e-04 -1.00862453e-03 -5.79546830e-05 6.85394441e-04 3.42697221e-03 2.12351688e-04 1.36675680e-04 -1.14013134e-04 -1.40996735e-05 -3.10533823e-04 -7.04983673e-05 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -9.81340007e-05 4.90670003e-05 3.95156129e-04 2.44599361e-04 -1.22299680e-04 -2.59797738e-05 3.38595206e-05 -1.69297603e-05 3.69220468e-05 -4.92293958e-05 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 -2.06888873e-04 4.13777746e-05 2.00592339e-04 6.83378401e-04 -1.36675680e-04 1.53794146e-05 -2.33774382e-05 4.67548763e-06 -2.78902609e-05 1.16209420e-05 1.04571251e-04 6.59048991e-04 8.08681204e-05 3.07748924e-04 -1.78209909e-04 -1.77416518e-04 -8.27434268e-04 4.92484006e-04 3.38595206e-05 -1.08000471e-04 5.38872760e-05 -7.63940131e-05 9.44638495e-05 3.45593969e-05 3.22917201e-04 -1.92003453e-05 1.60905699e-04 -3.43220350e-05 7.04983673e-05 -5.33163371e-04 1.14013134e-04 -2.33774382e-05 -1.92605535e-05 3.97900833e-06 2.69156783e-05 -1.26855161e-05 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 -1.78209909e-04 4.04340602e-05 8.87082588e-05 4.92484006e-04 -8.87082588e-05 -1.69297603e-05 5.38872760e-05 -2.71695573e-05 2.93232050e-05 -5.38872760e-05 -6.91187938e-06 -6.45834401e-05 3.84006907e-06 -3.43220350e-05 -3.84006907e-06 -1.40996735e-05 1.14013134e-04 1.40996735e-05 4.67548763e-06 3.97900833e-06 -1.61313514e-07 -8.09818213e-06 -3.97900833e-06 7.84284385e-05 4.94286743e-04 1.33657432e-04 1.69973075e-04 -1.82328327e-04 -3.69363005e-04 -4.23658521e-04 5.26896749e-04 3.69220468e-05 -7.63940131e-05 2.93232050e-05 -6.86136812e-05 6.75202116e-05 8.29425526e-05 7.75001281e-04 8.23728840e-05 3.58342040e-04 -9.30773600e-05 -2.73631522e-04 -1.18364611e-03 3.10533823e-04 -2.78902609e-05 2.69156783e-05 -8.09818213e-06 4.75843139e-05 -3.37032945e-05 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 -3.07748924e-04 8.08681204e-05 4.92484006e-04 8.27434268e-04 -1.77416518e-04 -4.92293958e-05 9.44638495e-05 -5.38872760e-05 6.75202116e-05 -1.08000471e-04 -3.45593969e-05 -3.22917201e-04 -3.43220350e-05 -1.60905699e-04 -1.92003453e-05 1.14013134e-04 5.33163371e-04 7.04983673e-05 1.16209420e-05 -1.26855161e-05 -3.97900833e-06 -3.37032945e-05 -1.92605535e-05 6.09103871e-05 6.14453477e-04 1.77556141e-04 1.77556141e-04 -1.77556141e-04 -6.05173587e-04 -6.05173587e-04 6.05173587e-04 6.22069144e-05 -6.22069144e-05 -6.22069144e-05 1.70328256e-04 1.56710856e-03 3.25689024e-04 6.51378048e-04 -3.25689024e-04 -1.06639054e-03 -2.13278108e-03 1.06639054e-03 -4.52806801e-05 1.04571251e-04 -5.22856257e-05 7.84284385e-05 -1.04571251e-04 6.14453477e-04 6.16334179e-03 1.76784261e-03 1.76784261e-03 -1.76784261e-03 -6.01995904e-03 -6.01995904e-03 6.01995904e-03 5.81250961e-04 -5.81250961e-04 -5.81250961e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 5.79216869e-03 -2.89608434e-03 -9.35225951e-03 -1.87045190e-02 9.35225951e-03 -2.85376584e-04 6.59048991e-04 -3.29524496e-04 4.94286743e-04 -6.59048991e-04 -1.77556141e-04 -1.76784261e-03 -4.59399382e-04 -5.34588187e-04 5.34588187e-04 1.55584457e-03 1.81552416e-03 -1.81552416e-03 3.70813928e-05 -1.53225561e-04 1.53225561e-04 1.85338989e-04 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -1.28527532e-03 6.42637659e-04 1.31106178e-03 4.15611128e-03 -2.07805564e-03 1.33367462e-04 -8.08681204e-05 4.04340602e-05 -1.33657432e-04 1.78209909e-04 -1.77556141e-04 -1.76784261e-03 -5.34588187e-04 -4.59399382e-04 5.34588187e-04 1.81552416e-03 1.55584457e-03 -1.81552416e-03 -1.85406964e-05 -1.53225561e-04 1.85338989e-04 3.21134282e-05 1.53225561e-04 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 -2.34193222e-03 1.28527532e-03 4.15611128e-03 7.54522870e-03 -4.15611128e-03 9.81340007e-05 -3.07748924e-04 1.78209909e-04 -1.69973075e-04 3.07748924e-04 1.77556141e-04 1.76784261e-03 5.34588187e-04 5.34588187e-04 -4.59399382e-04 -1.81552416e-03 -1.81552416e-03 1.55584457e-03 1.85406964e-05 1.85338989e-04 -1.53225561e-04 3.21134282e-05 -1.53225561e-04 3.25689024e-04 2.89608434e-03 6.42637659e-04 1.28527532e-03 -4.14019247e-04 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 -4.90670003e-05 1.78209909e-04 -4.04340602e-05 1.82328327e-04 -8.08681204e-05 6.05173587e-04 6.01995904e-03 1.55584457e-03 1.81552416e-03 -1.81552416e-03 -5.27080384e-03 -6.16854997e-03 6.16854997e-03 -1.27833318e-04 5.04964025e-04 -5.04964025e-04 -6.15670926e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 4.15611128e-03 -2.07805564e-03 -4.10981523e-03 -1.33621179e-02 6.68105894e-03 -3.95156129e-04 1.77416518e-04 -8.87082588e-05 3.69363005e-04 -4.92484006e-04 6.05173587e-04 6.01995904e-03 1.81552416e-03 1.55584457e-03 -1.81552416e-03 -6.16854997e-03 -5.27080384e-03 6.16854997e-03 6.39166591e-05 5.04964025e-04 -6.15670926e-04 -1.10706901e-04 -5.04964025e-04 2.13278108e-03 1.87045190e-02 4.15611128e-03 7.54522870e-03 -4.15611128e-03 -1.33621179e-02 -2.41529920e-02 1.33621179e-02 -2.44599361e-04 8.27434268e-04 -4.92484006e-04 4.23658521e-04 -8.27434268e-04 -6.05173587e-04 -6.01995904e-03 -1.81552416e-03 -1.81552416e-03 1.55584457e-03 6.16854997e-03 6.16854997e-03 -5.27080384e-03 -6.39166591e-05 -6.15670926e-04 5.04964025e-04 -1.10706901e-04 5.04964025e-04 -1.06639054e-03 -9.35225951e-03 -2.07805564e-03 -4.15611128e-03 1.31106178e-03 6.68105894e-03 1.33621179e-02 -4.10981523e-03 1.22299680e-04 -4.92484006e-04 8.87082588e-05 -5.26896749e-04 1.77416518e-04 -3.70813928e-05 1.85406964e-05 -1.85406964e-05 1.27833318e-04 -6.39166591e-05 6.39166591e-05 -2.24434069e-05 -7.05389767e-06 7.05389767e-06 -1.41077953e-05 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -9.81340007e-05 4.90670003e-05 3.95156129e-04 2.44599361e-04 -1.22299680e-04 -2.59797738e-05 3.38595206e-05 -1.69297603e-05 3.69220468e-05 -4.92293958e-05 6.22069144e-05 5.81250961e-04 1.53225561e-04 1.53225561e-04 -1.85338989e-04 -5.04964025e-04 -5.04964025e-04 6.15670926e-04 -7.05389767e-06 2.30560406e-05 -3.32817384e-05 -1.22177092e-05 -3.32817384e-05 1.04571251e-04 6.59048991e-04 8.08681204e-05 3.07748924e-04 -1.78209909e-04 -1.77416518e-04 -8.27434268e-04 4.92484006e-04 3.38595206e-05 -1.08000471e-04 5.38872760e-05 -7.63940131e-05 9.44638495e-05 -6.22069144e-05 -5.81250961e-04 -1.53225561e-04 -1.85338989e-04 1.53225561e-04 5.04964025e-04 6.15670926e-04 -5.04964025e-04 7.05389767e-06 -3.32817384e-05 2.30560406e-05 -1.22177092e-05 3.32817384e-05 -5.22856257e-05 -3.29524496e-04 -4.04340602e-05 -1.78209909e-04 4.04340602e-05 8.87082588e-05 4.92484006e-04 -8.87082588e-05 -1.69297603e-05 5.38872760e-05 -2.71695573e-05 2.93232050e-05 -5.38872760e-05 -3.21134282e-05 -3.21134282e-05 1.10706901e-04 1.10706901e-04 -1.22177092e-05 -1.22177092e-05 -2.24434069e-05 7.84284385e-05 4.94286743e-04 1.33657432e-04 1.69973075e-04 -1.82328327e-04 -3.69363005e-04 -4.23658521e-04 5.26896749e-04 3.69220468e-05 -7.63940131e-05 2.93232050e-05 -6.86136812e-05 6.75202116e-05 -6.22069144e-05 -5.81250961e-04 -1.85338989e-04 -1.53225561e-04 1.53225561e-04 6.15670926e-04 5.04964025e-04 -5.04964025e-04 -1.41077953e-05 -3.32817384e-05 3.32817384e-05 2.30560406e-05 -1.04571251e-04 -6.59048991e-04 -1.78209909e-04 -3.07748924e-04 8.08681204e-05 4.92484006e-04 8.27434268e-04 -1.77416518e-04 -4.92293958e-05 9.44638495e-05 -5.38872760e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 362 386 411 437 463 488 514 540 563 589 615 635 660 -1 1 -1 448 - 2.50728998e-03 1.64011405e-02 9.26310694e-03 -2.59488230e-02 3.67034157e-05 -6.35721809e-05 6.09103871e-05 6.14453477e-04 -5.91853803e-05 2.95926902e-04 5.91853803e-05 2.01724529e-04 -1.00862265e-03 -2.01724529e-04 -4.78869050e-05 -3.45593969e-05 -6.91187938e-06 8.29425526e-05 3.45593969e-05 1.64011405e-02 8.10100377e-02 5.00423367e-02 -1.17965801e-01 6.27522019e-03 -1.08690002e-02 6.14453477e-04 6.16334179e-03 -5.89280869e-04 2.94640435e-03 5.89280869e-04 2.00665301e-03 -1.00332651e-02 -2.00665301e-03 -4.47447198e-04 -3.22917201e-04 -6.45834401e-05 7.75001281e-04 3.22917201e-04 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 2.96993437e-04 5.93986875e-05 -5.79546830e-05 -1.00862453e-03 -2.01724907e-04 -5.99184710e-05 1.92003453e-05 3.84006907e-06 8.23728840e-05 3.43220350e-05 -9.26310694e-03 -5.00423367e-02 -3.02879243e-02 7.61127847e-02 -2.43070715e-03 4.21010828e-03 -2.95926902e-04 -2.94640435e-03 2.96993437e-04 -1.40977838e-03 -2.96993437e-04 -1.00862453e-03 4.78344308e-03 1.00862453e-03 2.06888873e-04 1.60905699e-04 3.43220350e-05 -3.58342040e-04 -1.60905699e-04 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 -5.91853803e-05 -5.89280869e-04 5.93986875e-05 -2.96993437e-04 1.57901181e-05 -2.01724907e-04 1.00862453e-03 -5.79546830e-05 4.13777746e-05 3.43220350e-05 -3.84006907e-06 -9.30773600e-05 1.92003453e-05 -9.11832090e-03 2.46761309e-02 1.71520858e-03 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 -1.00862453e-03 -2.01724907e-04 2.12351688e-04 3.42697221e-03 6.85394441e-04 2.00592339e-04 -7.04983673e-05 -1.40996735e-05 -2.73631522e-04 -1.14013134e-04 2.59488230e-02 1.17965801e-01 7.61127847e-02 -1.70036430e-01 1.16569751e-02 -2.01904731e-02 1.00862265e-03 1.00332651e-02 -1.00862453e-03 4.78344308e-03 1.00862453e-03 3.42697221e-03 -1.62371149e-02 -3.42697221e-03 -6.83378401e-04 -5.33163371e-04 -1.14013134e-04 1.18364611e-03 5.33163371e-04 -9.11832090e-03 2.46761309e-02 1.71520858e-03 2.01724529e-04 2.00665301e-03 -2.01724907e-04 1.00862453e-03 -5.79546830e-05 6.85394441e-04 -3.42697221e-03 2.12351688e-04 -1.36675680e-04 -1.14013134e-04 1.40996735e-05 3.10533823e-04 -7.04983673e-05 3.67034157e-05 6.27522019e-03 2.43070715e-03 -1.16569751e-02 -1.04593642e-03 1.68023178e-03 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 -2.06888873e-04 -4.13777746e-05 -2.00592339e-04 6.83378401e-04 1.36675680e-04 1.53794146e-05 2.33774382e-05 4.67548763e-06 -2.78902609e-05 -1.16209420e-05 1.65705842e-04 -1.71520858e-03 1.20534581e-03 -3.45593969e-05 -3.22917201e-04 -1.92003453e-05 -1.60905699e-04 -3.43220350e-05 7.04983673e-05 5.33163371e-04 1.14013134e-04 2.33774382e-05 -1.92605535e-05 -3.97900833e-06 -2.69156783e-05 -1.26855161e-05 -7.58541506e-05 -6.91187938e-06 -6.45834401e-05 -3.84006907e-06 -3.43220350e-05 3.84006907e-06 1.40996735e-05 1.14013134e-04 -1.40996735e-05 4.67548763e-06 -3.97900833e-06 -1.61313514e-07 -8.09818213e-06 3.97900833e-06 -6.35721809e-05 -1.08690002e-02 -4.21010828e-03 2.01904731e-02 1.68023178e-03 -2.98610096e-03 8.29425526e-05 7.75001281e-04 -8.23728840e-05 3.58342040e-04 9.30773600e-05 2.73631522e-04 -1.18364611e-03 -3.10533823e-04 -2.78902609e-05 -2.69156783e-05 -8.09818213e-06 4.75843139e-05 3.37032945e-05 1.65705842e-04 -1.71520858e-03 1.20534581e-03 3.45593969e-05 3.22917201e-04 -3.43220350e-05 1.60905699e-04 -1.92003453e-05 1.14013134e-04 -5.33163371e-04 7.04983673e-05 -1.16209420e-05 -1.26855161e-05 3.97900833e-06 3.37032945e-05 -1.92605535e-05 1.40271766e-02 6.79314330e-02 1.27999040e-02 3.83997120e-02 -1.27999040e-02 -3.13231900e-02 -9.39695701e-02 3.13231900e-02 1.95007672e-03 -2.53322396e-03 8.44407987e-04 -3.37763195e-03 2.53322396e-03 2.50728998e-03 1.64011405e-02 9.26310694e-03 -2.59488230e-02 3.67034157e-05 -6.35721809e-05 6.79314330e-02 1.60907873e-01 4.09845600e-02 1.22953680e-01 -4.09845600e-02 -5.94754012e-02 -1.78426204e-01 5.94754012e-02 2.00105569e-02 -2.59944760e-02 8.66482532e-03 -3.46593013e-02 2.59944760e-02 1.64011405e-02 8.10100377e-02 5.00423367e-02 -1.17965801e-01 6.27522019e-03 -1.08690002e-02 -1.27999040e-02 -4.09845600e-02 5.73556868e-03 -3.21974808e-02 1.07324936e-02 -1.69480895e-02 6.28329901e-02 -2.09443300e-02 -6.06202249e-03 1.11749199e-04 -3.72497331e-05 7.04948694e-03 -5.28711521e-03 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 -3.83997120e-02 -1.22953680e-01 -3.21974808e-02 -8.01243800e-02 3.21974808e-02 6.28329901e-02 1.50606551e-01 -6.28329901e-02 -9.22207060e-03 1.41362236e-02 -5.28711521e-03 1.59730948e-02 -1.41362236e-02 -9.26310694e-03 -5.00423367e-02 -3.02879243e-02 7.61127847e-02 -2.43070715e-03 4.21010828e-03 1.27999040e-02 4.09845600e-02 1.07324936e-02 3.21974808e-02 5.73556868e-03 -2.09443300e-02 -6.28329901e-02 -1.69480895e-02 3.07402353e-03 -5.28711521e-03 3.72497331e-05 -8.77460895e-03 1.11749199e-04 3.22869392e-03 -9.11832090e-03 -1.65705842e-04 3.13231900e-02 5.94754012e-02 -1.69480895e-02 6.28329901e-02 -2.09443300e-02 4.58861475e-02 -8.26569598e-02 2.75523199e-02 2.03553554e-02 3.67538539e-03 -1.22512846e-03 -2.18708352e-02 1.64031264e-02 -9.11832090e-03 2.46761309e-02 1.71520858e-03 9.39695701e-02 1.78426204e-01 6.28329901e-02 1.50606551e-01 -6.28329901e-02 -8.26569598e-02 -1.74532412e-01 8.26569598e-02 2.62890636e-02 -4.25165420e-02 1.64031264e-02 -4.55339938e-02 4.25165420e-02 2.59488230e-02 1.17965801e-01 7.61127847e-02 -1.70036430e-01 1.16569751e-02 -2.01904731e-02 -3.13231900e-02 -5.94754012e-02 -2.09443300e-02 -6.28329901e-02 -1.69480895e-02 2.75523199e-02 8.26569598e-02 4.58861475e-02 -8.76302120e-03 1.64031264e-02 1.22512846e-03 2.85636725e-02 3.67538539e-03 -9.11832090e-03 2.46761309e-02 1.71520858e-03 1.95007672e-03 2.00105569e-02 6.06202249e-03 9.22207060e-03 -3.07402353e-03 -2.03553554e-02 -2.62890636e-02 8.76302120e-03 1.46476011e-03 -7.20172278e-04 2.40057426e-04 -2.64406855e-03 1.98305141e-03 3.67034157e-05 6.27522019e-03 2.43070715e-03 -1.16569751e-02 -1.04593642e-03 1.68023178e-03 -2.53322396e-03 -2.59944760e-02 -1.11749199e-04 -1.41362236e-02 5.28711521e-03 -3.67538539e-03 4.25165420e-02 -1.64031264e-02 -7.20172278e-04 3.36490998e-03 -1.22324825e-03 2.70562219e-03 -1.72541514e-03 1.65705842e-04 -1.71520858e-03 1.20534581e-03 8.44407987e-04 8.66482532e-03 3.72497331e-05 5.28711521e-03 -3.72497331e-05 1.22512846e-03 -1.64031264e-02 -1.22512846e-03 2.40057426e-04 -1.22324825e-03 1.02914641e-04 -4.15791659e-04 1.22324825e-03 -7.58541506e-05 -3.37763195e-03 -3.46593013e-02 -7.04948694e-03 -1.59730948e-02 8.77460895e-03 2.18708352e-02 4.55339938e-02 -2.85636725e-02 -2.64406855e-03 2.70562219e-03 -4.15791659e-04 4.51786749e-03 -1.97649858e-03 -6.35721809e-05 -1.08690002e-02 -4.21010828e-03 2.01904731e-02 1.68023178e-03 -2.98610096e-03 2.53322396e-03 2.59944760e-02 5.28711521e-03 1.41362236e-02 -1.11749199e-04 -1.64031264e-02 -4.25165420e-02 -3.67538539e-03 1.98305141e-03 -1.72541514e-03 1.22324825e-03 -1.97649858e-03 3.36490998e-03 1.65705842e-04 -1.71520858e-03 1.20534581e-03 - 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 2 5 9 13 14 15 16 17 18 19 20 21 22 23 24 25 10 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 3 6 8 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 0 1 2 3 4 5 6 7 8 9 10 11 12 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 19 21 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 25 - 0 19 38 54 73 89 105 124 140 159 175 189 208 224 243 262 278 297 313 329 348 364 383 399 413 432 448 -1 1 0 507 - 1.70328256e-04 1.56710856e-03 -3.25689024e-04 6.51378048e-04 3.25689024e-04 1.06639054e-03 -2.13278108e-03 -1.06639054e-03 -4.52806801e-05 -1.04571251e-04 -5.22856257e-05 7.84284385e-05 1.04571251e-04 1.56710856e-03 1.39613919e-02 -2.89608434e-03 5.79216869e-03 2.89608434e-03 9.35225951e-03 -1.87045190e-02 -9.35225951e-03 -2.85376584e-04 -6.59048991e-04 -3.29524496e-04 4.94286743e-04 6.59048991e-04 3.25689024e-04 2.89608434e-03 -4.14019247e-04 1.28527532e-03 6.42637659e-04 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 -1.33367462e-04 -8.08681204e-05 -4.04340602e-05 1.33657432e-04 1.78209909e-04 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 -2.34193222e-03 -1.28527532e-03 -4.15611128e-03 7.54522870e-03 4.15611128e-03 9.81340007e-05 3.07748924e-04 1.78209909e-04 -1.69973075e-04 -3.07748924e-04 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 -1.28527532e-03 -4.14019247e-04 -2.07805564e-03 4.15611128e-03 1.31106178e-03 4.90670003e-05 1.78209909e-04 4.04340602e-05 -1.82328327e-04 -8.08681204e-05 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 -4.10981523e-03 1.33621179e-02 6.68105894e-03 3.95156129e-04 1.77416518e-04 8.87082588e-05 -3.69363005e-04 -4.92484006e-04 2.13278108e-03 1.87045190e-02 -4.15611128e-03 7.54522870e-03 4.15611128e-03 1.33621179e-02 -2.41529920e-02 -1.33621179e-02 -2.44599361e-04 -8.27434268e-04 -4.92484006e-04 4.23658521e-04 8.27434268e-04 1.06639054e-03 9.35225951e-03 -2.07805564e-03 4.15611128e-03 1.31106178e-03 6.68105894e-03 -1.33621179e-02 -4.10981523e-03 -1.22299680e-04 -4.92484006e-04 -8.87082588e-05 5.26896749e-04 1.77416518e-04 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -9.81340007e-05 -4.90670003e-05 -3.95156129e-04 2.44599361e-04 1.22299680e-04 -2.59797738e-05 -3.38595206e-05 -1.69297603e-05 3.69220468e-05 4.92293958e-05 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 -3.07748924e-04 -1.78209909e-04 -1.77416518e-04 8.27434268e-04 4.92484006e-04 -3.38595206e-05 -1.08000471e-04 -5.38872760e-05 7.63940131e-05 9.44638495e-05 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 -1.78209909e-04 -4.04340602e-05 -8.87082588e-05 4.92484006e-04 8.87082588e-05 -1.69297603e-05 -5.38872760e-05 -2.71695573e-05 2.93232050e-05 5.38872760e-05 7.84284385e-05 4.94286743e-04 -1.33657432e-04 1.69973075e-04 1.82328327e-04 3.69363005e-04 -4.23658521e-04 -5.26896749e-04 3.69220468e-05 7.63940131e-05 2.93232050e-05 -6.86136812e-05 -6.75202116e-05 1.04571251e-04 6.59048991e-04 -1.78209909e-04 3.07748924e-04 8.08681204e-05 4.92484006e-04 -8.27434268e-04 -1.77416518e-04 4.92293958e-05 9.44638495e-05 5.38872760e-05 -6.75202116e-05 -1.08000471e-04 1.40271766e-02 6.79314330e-02 -1.27999040e-02 3.83997120e-02 1.27999040e-02 3.13231900e-02 -9.39695701e-02 -3.13231900e-02 1.95007672e-03 2.53322396e-03 8.44407987e-04 -3.37763195e-03 -2.53322396e-03 1.70328256e-04 1.56710856e-03 -3.25689024e-04 6.51378048e-04 3.25689024e-04 1.06639054e-03 -2.13278108e-03 -1.06639054e-03 -4.52806801e-05 -1.04571251e-04 -5.22856257e-05 7.84284385e-05 1.04571251e-04 6.79314330e-02 1.60907873e-01 -4.09845600e-02 1.22953680e-01 4.09845600e-02 5.94754012e-02 -1.78426204e-01 -5.94754012e-02 2.00105569e-02 2.59944760e-02 8.66482532e-03 -3.46593013e-02 -2.59944760e-02 1.56710856e-03 1.39613919e-02 -2.89608434e-03 5.79216869e-03 2.89608434e-03 9.35225951e-03 -1.87045190e-02 -9.35225951e-03 -2.85376584e-04 -6.59048991e-04 -3.29524496e-04 4.94286743e-04 6.59048991e-04 1.27999040e-02 4.09845600e-02 5.73556868e-03 3.21974808e-02 1.07324936e-02 -1.69480895e-02 -6.28329901e-02 -2.09443300e-02 6.06202249e-03 1.11749199e-04 3.72497331e-05 -7.04948694e-03 -5.28711521e-03 3.25689024e-04 2.89608434e-03 -4.14019247e-04 1.28527532e-03 6.42637659e-04 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 -1.33367462e-04 -8.08681204e-05 -4.04340602e-05 1.33657432e-04 1.78209909e-04 -3.83997120e-02 -1.22953680e-01 3.21974808e-02 -8.01243800e-02 -3.21974808e-02 -6.28329901e-02 1.50606551e-01 6.28329901e-02 -9.22207060e-03 -1.41362236e-02 -5.28711521e-03 1.59730948e-02 1.41362236e-02 -6.51378048e-04 -5.79216869e-03 1.28527532e-03 -2.34193222e-03 -1.28527532e-03 -4.15611128e-03 7.54522870e-03 4.15611128e-03 9.81340007e-05 3.07748924e-04 1.78209909e-04 -1.69973075e-04 -3.07748924e-04 -1.27999040e-02 -4.09845600e-02 1.07324936e-02 -3.21974808e-02 5.73556868e-03 -2.09443300e-02 6.28329901e-02 -1.69480895e-02 -3.07402353e-03 -5.28711521e-03 -3.72497331e-05 8.77460895e-03 1.11749199e-04 -3.25689024e-04 -2.89608434e-03 6.42637659e-04 -1.28527532e-03 -4.14019247e-04 -2.07805564e-03 4.15611128e-03 1.31106178e-03 4.90670003e-05 1.78209909e-04 4.04340602e-05 -1.82328327e-04 -8.08681204e-05 -3.13231900e-02 -5.94754012e-02 -1.69480895e-02 -6.28329901e-02 -2.09443300e-02 4.58861475e-02 8.26569598e-02 2.75523199e-02 -2.03553554e-02 3.67538539e-03 1.22512846e-03 2.18708352e-02 1.64031264e-02 -1.06639054e-03 -9.35225951e-03 1.31106178e-03 -4.15611128e-03 -2.07805564e-03 -4.10981523e-03 1.33621179e-02 6.68105894e-03 3.95156129e-04 1.77416518e-04 8.87082588e-05 -3.69363005e-04 -4.92484006e-04 9.39695701e-02 1.78426204e-01 -6.28329901e-02 1.50606551e-01 6.28329901e-02 8.26569598e-02 -1.74532412e-01 -8.26569598e-02 2.62890636e-02 4.25165420e-02 1.64031264e-02 -4.55339938e-02 -4.25165420e-02 2.13278108e-03 1.87045190e-02 -4.15611128e-03 7.54522870e-03 4.15611128e-03 1.33621179e-02 -2.41529920e-02 -1.33621179e-02 -2.44599361e-04 -8.27434268e-04 -4.92484006e-04 4.23658521e-04 8.27434268e-04 3.13231900e-02 5.94754012e-02 -2.09443300e-02 6.28329901e-02 -1.69480895e-02 2.75523199e-02 -8.26569598e-02 4.58861475e-02 8.76302120e-03 1.64031264e-02 -1.22512846e-03 -2.85636725e-02 3.67538539e-03 1.06639054e-03 9.35225951e-03 -2.07805564e-03 4.15611128e-03 1.31106178e-03 6.68105894e-03 -1.33621179e-02 -4.10981523e-03 -1.22299680e-04 -4.92484006e-04 -8.87082588e-05 5.26896749e-04 1.77416518e-04 1.95007672e-03 2.00105569e-02 -6.06202249e-03 9.22207060e-03 3.07402353e-03 2.03553554e-02 -2.62890636e-02 -8.76302120e-03 1.46476011e-03 7.20172278e-04 2.40057426e-04 -2.64406855e-03 -1.98305141e-03 -4.52806801e-05 -2.85376584e-04 1.33367462e-04 -9.81340007e-05 -4.90670003e-05 -3.95156129e-04 2.44599361e-04 1.22299680e-04 -2.59797738e-05 -3.38595206e-05 -1.69297603e-05 3.69220468e-05 4.92293958e-05 2.53322396e-03 2.59944760e-02 -1.11749199e-04 1.41362236e-02 5.28711521e-03 -3.67538539e-03 -4.25165420e-02 -1.64031264e-02 7.20172278e-04 3.36490998e-03 1.22324825e-03 -2.70562219e-03 -1.72541514e-03 -1.04571251e-04 -6.59048991e-04 8.08681204e-05 -3.07748924e-04 -1.78209909e-04 -1.77416518e-04 8.27434268e-04 4.92484006e-04 -3.38595206e-05 -1.08000471e-04 -5.38872760e-05 7.63940131e-05 9.44638495e-05 8.44407987e-04 8.66482532e-03 -3.72497331e-05 5.28711521e-03 3.72497331e-05 -1.22512846e-03 -1.64031264e-02 1.22512846e-03 2.40057426e-04 1.22324825e-03 1.02914641e-04 -4.15791659e-04 -1.22324825e-03 -5.22856257e-05 -3.29524496e-04 4.04340602e-05 -1.78209909e-04 -4.04340602e-05 -8.87082588e-05 4.92484006e-04 8.87082588e-05 -1.69297603e-05 -5.38872760e-05 -2.71695573e-05 2.93232050e-05 5.38872760e-05 -3.37763195e-03 -3.46593013e-02 7.04948694e-03 -1.59730948e-02 -8.77460895e-03 -2.18708352e-02 4.55339938e-02 2.85636725e-02 -2.64406855e-03 -2.70562219e-03 -4.15791659e-04 4.51786749e-03 1.97649858e-03 7.84284385e-05 4.94286743e-04 -1.33657432e-04 1.69973075e-04 1.82328327e-04 3.69363005e-04 -4.23658521e-04 -5.26896749e-04 3.69220468e-05 7.63940131e-05 2.93232050e-05 -6.86136812e-05 -6.75202116e-05 -2.53322396e-03 -2.59944760e-02 5.28711521e-03 -1.41362236e-02 -1.11749199e-04 -1.64031264e-02 4.25165420e-02 -3.67538539e-03 -1.98305141e-03 -1.72541514e-03 -1.22324825e-03 1.97649858e-03 3.36490998e-03 1.04571251e-04 6.59048991e-04 -1.78209909e-04 3.07748924e-04 8.08681204e-05 4.92484006e-04 -8.27434268e-04 -1.77416518e-04 4.92293958e-05 9.44638495e-05 5.38872760e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 195 221 247 273 299 325 351 377 403 429 455 481 507 -1 1 1 153 - 6.09103871e-05 6.14453477e-04 -1.77556141e-04 1.77556141e-04 1.77556141e-04 6.05173587e-04 -6.05173587e-04 -6.05173587e-04 -6.22069144e-05 -6.22069144e-05 6.22069144e-05 6.14453477e-04 6.16334179e-03 -1.76784261e-03 1.76784261e-03 1.76784261e-03 6.01995904e-03 -6.01995904e-03 -6.01995904e-03 -5.81250961e-04 -5.81250961e-04 5.81250961e-04 1.77556141e-04 1.76784261e-03 -4.59399382e-04 5.34588187e-04 5.34588187e-04 1.55584457e-03 -1.81552416e-03 -1.81552416e-03 -3.70813928e-05 -1.53225561e-04 -1.53225561e-04 1.85338989e-04 -1.77556141e-04 -1.76784261e-03 5.34588187e-04 -4.59399382e-04 -5.34588187e-04 -1.81552416e-03 1.55584457e-03 1.81552416e-03 -1.85406964e-05 1.53225561e-04 1.85338989e-04 3.21134282e-05 -1.53225561e-04 -1.77556141e-04 -1.76784261e-03 5.34588187e-04 -5.34588187e-04 -4.59399382e-04 -1.81552416e-03 1.81552416e-03 1.55584457e-03 -1.85406964e-05 1.85338989e-04 1.53225561e-04 -3.21134282e-05 -1.53225561e-04 -6.05173587e-04 -6.01995904e-03 1.55584457e-03 -1.81552416e-03 -1.81552416e-03 -5.27080384e-03 6.16854997e-03 6.16854997e-03 1.27833318e-04 5.04964025e-04 5.04964025e-04 -6.15670926e-04 6.05173587e-04 6.01995904e-03 -1.81552416e-03 1.55584457e-03 1.81552416e-03 6.16854997e-03 -5.27080384e-03 -6.16854997e-03 6.39166591e-05 -5.04964025e-04 -6.15670926e-04 -1.10706901e-04 5.04964025e-04 6.05173587e-04 6.01995904e-03 -1.81552416e-03 1.81552416e-03 1.55584457e-03 6.16854997e-03 -6.16854997e-03 -5.27080384e-03 6.39166591e-05 -6.15670926e-04 -5.04964025e-04 1.10706901e-04 5.04964025e-04 3.70813928e-05 1.85406964e-05 1.85406964e-05 -1.27833318e-04 -6.39166591e-05 -6.39166591e-05 -2.24434069e-05 7.05389767e-06 7.05389767e-06 1.41077953e-05 -6.22069144e-05 -5.81250961e-04 1.53225561e-04 -1.53225561e-04 -1.85338989e-04 -5.04964025e-04 5.04964025e-04 6.15670926e-04 7.05389767e-06 2.30560406e-05 3.32817384e-05 1.22177092e-05 -3.32817384e-05 -6.22069144e-05 -5.81250961e-04 1.53225561e-04 -1.85338989e-04 -1.53225561e-04 -5.04964025e-04 6.15670926e-04 5.04964025e-04 7.05389767e-06 3.32817384e-05 2.30560406e-05 -1.22177092e-05 -3.32817384e-05 -3.21134282e-05 3.21134282e-05 1.10706901e-04 -1.10706901e-04 1.22177092e-05 -1.22177092e-05 -2.24434069e-05 6.22069144e-05 5.81250961e-04 -1.85338989e-04 1.53225561e-04 1.53225561e-04 6.15670926e-04 -5.04964025e-04 -5.04964025e-04 1.41077953e-05 -3.32817384e-05 -3.32817384e-05 2.30560406e-05 - 0 1 2 3 4 5 6 7 9 10 12 0 1 2 3 4 5 6 7 9 10 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9 10 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 3 4 6 7 9 10 11 0 1 2 3 4 5 6 7 8 9 10 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 22 34 47 60 72 85 98 108 121 134 141 153 -1 2 -2 169 - 1.25466617e-06 1.34349826e-05 1.31792447e-06 6.58962236e-06 -3.95377341e-06 -4.39772254e-06 -2.19886127e-05 1.31931676e-05 -2.43510507e-06 1.31803928e-06 -7.90823570e-07 2.10886285e-06 -3.95411785e-06 1.34349826e-05 1.43209127e-04 1.42696266e-05 7.13481329e-05 -4.28088798e-05 -4.75690104e-05 -2.37845052e-04 1.42707031e-04 -2.56801146e-05 1.38997698e-05 -8.33986187e-06 2.22396317e-05 -4.16993094e-05 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 -7.04340302e-06 4.22604181e-06 2.62355898e-06 2.36453257e-05 -1.41871954e-05 2.82105641e-06 -8.15449649e-07 4.89269790e-07 -2.31661906e-06 4.34366074e-06 -6.58962236e-06 -7.13481329e-05 -7.04340302e-06 -3.45682450e-05 2.11302091e-05 2.36453257e-05 1.16121122e-04 -7.09359772e-05 1.30098686e-05 -7.11294712e-06 4.34366074e-06 -1.09506581e-05 2.13388414e-05 3.95377341e-06 4.28088798e-05 4.22604181e-06 2.11302091e-05 -1.20293553e-05 -1.41871954e-05 -7.09359772e-05 4.04560801e-05 -7.80592115e-06 4.34366074e-06 -2.47970899e-06 7.32931955e-06 -1.23985450e-05 4.39772254e-06 4.75690104e-05 2.62355898e-06 2.36453257e-05 -1.41871954e-05 -9.01114524e-06 -7.91031105e-05 4.74618663e-05 -9.57494961e-06 2.89015053e-06 -1.73409032e-06 7.88460418e-06 -1.47836328e-05 2.19886127e-05 2.37845052e-04 2.36453257e-05 1.16121122e-04 -7.09359772e-05 -7.91031105e-05 -3.88706075e-04 2.37309331e-04 -4.43453012e-05 2.42318426e-05 -1.47836328e-05 3.73852938e-05 -7.26955279e-05 -1.31931676e-05 -1.42707031e-04 -1.41871954e-05 -7.09359772e-05 4.04560801e-05 4.74618663e-05 2.37309331e-04 -1.35576122e-04 2.66071807e-05 -1.47836328e-05 8.46263429e-06 -2.48764488e-05 4.23131714e-05 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 -1.30098686e-05 7.80592115e-06 9.57494961e-06 4.43453012e-05 -2.66071807e-05 3.61548803e-06 -1.99797541e-06 1.19878524e-06 -3.12952049e-06 5.86785091e-06 1.31803928e-06 1.38997698e-05 8.15449649e-07 7.11294712e-06 -4.34366074e-06 -2.89015053e-06 -2.42318426e-05 1.47836328e-05 -1.99797541e-06 9.59219321e-07 -5.71522584e-07 1.69390265e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 -4.89269790e-07 -4.34366074e-06 2.47970899e-06 1.73409032e-06 1.47836328e-05 -8.46263429e-06 1.19878524e-06 -5.71522584e-07 3.49595231e-07 -1.04545744e-06 1.90867338e-06 2.10886285e-06 2.22396317e-05 2.31661906e-06 1.09506581e-05 -7.32931955e-06 -7.88460418e-06 -3.73852938e-05 2.48764488e-05 -3.12952049e-06 1.69390265e-06 -1.04545744e-06 2.59560990e-06 -5.15449757e-06 -3.95411785e-06 -4.16993094e-05 -4.34366074e-06 -2.13388414e-05 1.23985450e-05 1.47836328e-05 7.26955279e-05 -4.23131714e-05 5.86785091e-06 -3.20700306e-06 1.90867338e-06 -5.15449757e-06 9.51122747e-06 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -1 2 -1 169 - 6.09103871e-05 6.14453477e-04 -5.91853803e-05 2.95926902e-04 -5.91853803e-05 2.01724529e-04 -1.00862265e-03 2.01724529e-04 -4.78869050e-05 -3.45593969e-05 6.91187938e-06 8.29425526e-05 -3.45593969e-05 6.14453477e-04 6.16334179e-03 -5.89280869e-04 2.94640435e-03 -5.89280869e-04 2.00665301e-03 -1.00332651e-02 2.00665301e-03 -4.47447198e-04 -3.22917201e-04 6.45834401e-05 7.75001281e-04 -3.22917201e-04 5.91853803e-05 5.89280869e-04 1.57901181e-05 2.96993437e-04 -5.93986875e-05 -5.79546830e-05 -1.00862453e-03 2.01724907e-04 -5.99184710e-05 1.92003453e-05 -3.84006907e-06 8.23728840e-05 -3.43220350e-05 -2.95926902e-04 -2.94640435e-03 2.96993437e-04 -1.40977838e-03 2.96993437e-04 -1.00862453e-03 4.78344308e-03 -1.00862453e-03 2.06888873e-04 1.60905699e-04 -3.43220350e-05 -3.58342040e-04 1.60905699e-04 5.91853803e-05 5.89280869e-04 -5.93986875e-05 2.96993437e-04 1.57901181e-05 2.01724907e-04 -1.00862453e-03 -5.79546830e-05 -4.13777746e-05 -3.43220350e-05 -3.84006907e-06 9.30773600e-05 1.92003453e-05 -2.01724529e-04 -2.00665301e-03 -5.79546830e-05 -1.00862453e-03 2.01724907e-04 2.12351688e-04 3.42697221e-03 -6.85394441e-04 2.00592339e-04 -7.04983673e-05 1.40996735e-05 -2.73631522e-04 1.14013134e-04 1.00862265e-03 1.00332651e-02 -1.00862453e-03 4.78344308e-03 -1.00862453e-03 3.42697221e-03 -1.62371149e-02 3.42697221e-03 -6.83378401e-04 -5.33163371e-04 1.14013134e-04 1.18364611e-03 -5.33163371e-04 -2.01724529e-04 -2.00665301e-03 2.01724907e-04 -1.00862453e-03 -5.79546830e-05 -6.85394441e-04 3.42697221e-03 2.12351688e-04 1.36675680e-04 1.14013134e-04 1.40996735e-05 -3.10533823e-04 -7.04983673e-05 -4.78869050e-05 -4.47447198e-04 5.99184710e-05 -2.06888873e-04 4.13777746e-05 -2.00592339e-04 6.83378401e-04 -1.36675680e-04 1.53794146e-05 2.33774382e-05 -4.67548763e-06 -2.78902609e-05 1.16209420e-05 -3.45593969e-05 -3.22917201e-04 -1.92003453e-05 -1.60905699e-04 3.43220350e-05 7.04983673e-05 5.33163371e-04 -1.14013134e-04 2.33774382e-05 -1.92605535e-05 3.97900833e-06 -2.69156783e-05 1.26855161e-05 6.91187938e-06 6.45834401e-05 3.84006907e-06 3.43220350e-05 3.84006907e-06 -1.40996735e-05 -1.14013134e-04 -1.40996735e-05 -4.67548763e-06 3.97900833e-06 -1.61313514e-07 8.09818213e-06 3.97900833e-06 8.29425526e-05 7.75001281e-04 -8.23728840e-05 3.58342040e-04 -9.30773600e-05 2.73631522e-04 -1.18364611e-03 3.10533823e-04 -2.78902609e-05 -2.69156783e-05 8.09818213e-06 4.75843139e-05 -3.37032945e-05 -3.45593969e-05 -3.22917201e-04 3.43220350e-05 -1.60905699e-04 -1.92003453e-05 -1.14013134e-04 5.33163371e-04 7.04983673e-05 1.16209420e-05 1.26855161e-05 3.97900833e-06 -3.37032945e-05 -1.92605535e-05 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -1 2 0 169 - 1.25466617e-06 1.34349826e-05 -3.95377341e-06 6.58962236e-06 1.31792447e-06 1.31931676e-05 -2.19886127e-05 -4.39772254e-06 -6.08776268e-07 -3.95411785e-06 -7.90823570e-07 3.16329428e-06 1.31803928e-06 1.34349826e-05 1.43209127e-04 -4.28088798e-05 7.13481329e-05 1.42696266e-05 1.42707031e-04 -2.37845052e-04 -4.75690104e-05 -6.42002866e-06 -4.16993094e-05 -8.33986187e-06 3.33594475e-05 1.38997698e-05 3.95377341e-06 4.28088798e-05 -1.20293553e-05 2.11302091e-05 4.22604181e-06 4.04560801e-05 -7.09359772e-05 -1.41871954e-05 -2.44441635e-06 -1.23985450e-05 -2.47970899e-06 1.04247858e-05 4.34366074e-06 -6.58962236e-06 -7.13481329e-05 2.11302091e-05 -3.45682450e-05 -7.04340302e-06 -7.09359772e-05 1.16121122e-04 2.36453257e-05 2.97861377e-06 2.13388414e-05 4.34366074e-06 -1.67422057e-05 -7.11294712e-06 -1.31792447e-06 -1.42696266e-05 4.22604181e-06 -7.04340302e-06 -7.59910514e-07 -1.41871954e-05 2.36453257e-05 2.62355898e-06 5.95722755e-07 4.34366074e-06 4.89269790e-07 -3.60141605e-06 -8.15449649e-07 -1.31931676e-05 -1.42707031e-04 4.04560801e-05 -7.09359772e-05 -1.41871954e-05 -1.35576122e-04 2.37309331e-04 4.74618663e-05 8.24004626e-06 4.23131714e-05 8.46263429e-06 -3.54807188e-05 -1.47836328e-05 2.19886127e-05 2.37845052e-04 -7.09359772e-05 1.16121122e-04 2.36453257e-05 2.37309331e-04 -3.88706075e-04 -7.91031105e-05 -1.02039636e-05 -7.26955279e-05 -1.47836328e-05 5.70968043e-05 2.42318426e-05 4.39772254e-06 4.75690104e-05 -1.41871954e-05 2.36453257e-05 2.62355898e-06 4.74618663e-05 -7.91031105e-05 -9.01114524e-06 -2.04079272e-06 -1.47836328e-05 -1.73409032e-06 1.22344517e-05 2.89015053e-06 -6.08776268e-07 -6.42002866e-06 2.44441635e-06 -2.97861377e-06 -5.95722755e-07 -8.24004626e-06 1.02039636e-05 2.04079272e-06 1.40335193e-07 1.53000038e-06 3.06000076e-07 -1.12314006e-06 -4.67975025e-07 -3.95411785e-06 -4.16993094e-05 1.23985450e-05 -2.13388414e-05 -4.34366074e-06 -4.23131714e-05 7.26955279e-05 1.47836328e-05 1.53000038e-06 9.51122747e-06 1.90867338e-06 -7.65895674e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 2.47970899e-06 -4.34366074e-06 -4.89269790e-07 -8.46263429e-06 1.47836328e-05 1.73409032e-06 3.06000076e-07 1.90867338e-06 3.49595231e-07 -1.56090719e-06 -5.71522584e-07 3.16329428e-06 3.33594475e-05 -1.04247858e-05 1.67422057e-05 3.60141605e-06 3.54807188e-05 -5.70968043e-05 -1.22344517e-05 -1.12314006e-06 -7.65895674e-06 -1.56090719e-06 6.07076274e-06 2.57724878e-06 1.31803928e-06 1.38997698e-05 -4.34366074e-06 7.11294712e-06 8.15449649e-07 1.47836328e-05 -2.42318426e-05 -2.89015053e-06 -4.67975025e-07 -3.20700306e-06 -5.71522584e-07 2.57724878e-06 9.59219321e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -2 -2 -1 169 - 1.25466617e-06 1.34349826e-05 6.58962236e-06 1.31792447e-06 3.95377341e-06 -2.19886127e-05 -4.39772254e-06 -1.31931676e-05 3.04388134e-06 1.31803928e-06 3.95411785e-06 -1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 7.13481329e-05 1.42696266e-05 4.28088798e-05 -2.37845052e-04 -4.75690104e-05 -1.42707031e-04 3.21001433e-05 1.38997698e-05 4.16993094e-05 -1.11198158e-05 8.33986187e-06 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 -7.04340302e-06 -2.11302091e-05 1.16121122e-04 2.36453257e-05 7.09359772e-05 -1.59884824e-05 -7.11294712e-06 -2.13388414e-05 5.79154766e-06 -4.34366074e-06 -1.31792447e-06 -1.42696266e-05 -7.04340302e-06 -7.59910514e-07 -4.22604181e-06 2.36453257e-05 2.62355898e-06 1.41871954e-05 -3.41677917e-06 -8.15449649e-07 -4.34366074e-06 1.28479698e-06 -4.89269790e-07 -3.95377341e-06 -4.28088798e-05 -2.11302091e-05 -4.22604181e-06 -1.20293553e-05 7.09359772e-05 1.41871954e-05 4.04560801e-05 -1.02503375e-05 -4.34366074e-06 -1.23985450e-05 3.09546624e-06 -2.47970899e-06 2.19886127e-05 2.37845052e-04 1.16121122e-04 2.36453257e-05 7.09359772e-05 -3.88706075e-04 -7.91031105e-05 -2.37309331e-04 5.45492648e-05 2.42318426e-05 7.26955279e-05 -1.97115105e-05 1.47836328e-05 4.39772254e-06 4.75690104e-05 2.36453257e-05 2.62355898e-06 1.41871954e-05 -7.91031105e-05 -9.01114524e-06 -4.74618663e-05 1.16157423e-05 2.89015053e-06 1.47836328e-05 -4.34984751e-06 1.73409032e-06 1.31931676e-05 1.42707031e-04 7.09359772e-05 1.41871954e-05 4.04560801e-05 -2.37309331e-04 -4.74618663e-05 -1.35576122e-04 3.48472270e-05 1.47836328e-05 4.23131714e-05 -1.06042700e-05 8.46263429e-06 3.04388134e-06 3.21001433e-05 1.59884824e-05 3.41677917e-06 1.02503375e-05 -5.45492648e-05 -1.16157423e-05 -3.48472270e-05 5.56082368e-06 2.46595043e-06 7.39785129e-06 -2.00638043e-06 1.50478532e-06 1.31803928e-06 1.38997698e-05 7.11294712e-06 8.15449649e-07 4.34366074e-06 -2.42318426e-05 -2.89015053e-06 -1.47836328e-05 2.46595043e-06 9.59219321e-07 3.20700306e-06 -8.83346132e-07 5.71522584e-07 3.95411785e-06 4.16993094e-05 2.13388414e-05 4.34366074e-06 1.23985450e-05 -7.26955279e-05 -1.47836328e-05 -4.23131714e-05 7.39785129e-06 3.20700306e-06 9.51122747e-06 -2.50445917e-06 1.90867338e-06 -1.05443143e-06 -1.11198158e-05 -5.79154766e-06 -1.28479698e-06 -3.09546624e-06 1.97115105e-05 4.34984751e-06 1.06042700e-05 -2.00638043e-06 -8.83346132e-07 -2.50445917e-06 6.50274256e-07 -5.15449757e-07 7.90823570e-07 8.33986187e-06 4.34366074e-06 4.89269790e-07 2.47970899e-06 -1.47836328e-05 -1.73409032e-06 -8.46263429e-06 1.50478532e-06 5.71522584e-07 1.90867338e-06 -5.15449757e-07 3.49595231e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 -2 -2 0 532 - 8.23315696e-06 9.02495943e-05 3.30136560e-05 3.30136560e-05 -1.15322826e-04 -1.15322826e-04 6.50509780e-06 2.25343198e-05 -1.12671599e-05 1.25466617e-06 1.34349826e-05 3.95377341e-06 1.31792447e-06 6.58962236e-06 -1.31931676e-05 -4.39772254e-06 -2.19886127e-05 -6.08776268e-07 7.90823570e-07 3.95411785e-06 -3.16329428e-06 1.31803928e-06 9.02495943e-05 9.91070319e-04 3.61844250e-04 3.61844250e-04 -1.26431932e-03 -1.26431932e-03 7.23412109e-05 2.50597306e-04 -1.25298653e-04 1.34349826e-05 1.43209127e-04 4.28088798e-05 1.42696266e-05 7.13481329e-05 -1.42707031e-04 -4.75690104e-05 -2.37845052e-04 -6.42002866e-06 8.33986187e-06 4.16993094e-05 -3.33594475e-05 1.38997698e-05 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 -2.08516626e-05 -8.77935341e-05 4.64903097e-05 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 -4.22604181e-06 -2.11302091e-05 4.04560801e-05 1.41871954e-05 7.09359772e-05 2.44441635e-06 -2.47970899e-06 -1.23985450e-05 1.04247858e-05 -4.34366074e-06 6.96094992e-06 -2.39796963e-05 5.18708531e-06 5.18708531e-06 -1.31792447e-06 -1.42696266e-05 -4.22604181e-06 -7.59910514e-07 -7.04340302e-06 1.41871954e-05 2.62355898e-06 2.36453257e-05 5.95722755e-07 -4.89269790e-07 -4.34366074e-06 3.60141605e-06 -8.15449649e-07 -3.30136560e-05 -3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 -2.98359579e-05 -8.77935341e-05 4.13032244e-05 -6.58962236e-06 -7.13481329e-05 -2.11302091e-05 -7.04340302e-06 -3.45682450e-05 7.09359772e-05 2.36453257e-05 1.16121122e-04 2.97861377e-06 -4.34366074e-06 -2.13388414e-05 1.67422057e-05 -7.11294712e-06 1.15322826e-04 1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 7.37468140e-05 3.09427778e-04 -1.63707443e-04 1.31931676e-05 1.42707031e-04 4.04560801e-05 1.41871954e-05 7.09359772e-05 -1.35576122e-04 -4.74618663e-05 -2.37309331e-04 -8.24004626e-06 8.46263429e-06 4.23131714e-05 -3.54807188e-05 1.47836328e-05 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 -1.79871070e-05 4.39772254e-06 4.75690104e-05 1.41871954e-05 2.62355898e-06 2.36453257e-05 -4.74618663e-05 -9.01114524e-06 -7.91031105e-05 -2.04079272e-06 1.73409032e-06 1.47836328e-05 -1.22344517e-05 2.89015053e-06 1.15322826e-04 1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 1.04901397e-04 3.09427778e-04 -1.45720336e-04 2.19886127e-05 2.37845052e-04 7.09359772e-05 2.36453257e-05 1.16121122e-04 -2.37309331e-04 -7.91031105e-05 -3.88706075e-04 -1.02039636e-05 1.47836328e-05 7.26955279e-05 -5.70968043e-05 2.42318426e-05 6.50509780e-06 7.23412109e-05 2.08516626e-05 2.98359579e-05 -7.37468140e-05 -1.04901397e-04 -9.95783968e-07 1.81181256e-05 -1.27509189e-05 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 -5.95722755e-07 -2.97861377e-06 8.24004626e-06 2.04079272e-06 1.02039636e-05 1.40335193e-07 -3.06000076e-07 -1.53000038e-06 1.12314006e-06 -4.67975025e-07 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 -4.26298824e-06 7.90823570e-07 8.33986187e-06 2.47970899e-06 4.89269790e-07 4.34366074e-06 -8.46263429e-06 -1.73409032e-06 -1.47836328e-05 -3.06000076e-07 3.49595231e-07 1.90867338e-06 -1.56090719e-06 5.71522584e-07 2.25343198e-05 2.50597306e-04 8.77935341e-05 8.77935341e-05 -3.09427778e-04 -3.09427778e-04 1.81181256e-05 6.29314743e-05 -3.13815141e-05 3.95411785e-06 4.16993094e-05 1.23985450e-05 4.34366074e-06 2.13388414e-05 -4.23131714e-05 -1.47836328e-05 -7.26955279e-05 -1.53000038e-06 1.90867338e-06 9.51122747e-06 -7.65895674e-06 3.20700306e-06 -1.12671599e-05 -1.25298653e-04 -4.64903097e-05 -4.13032244e-05 1.63707443e-04 1.45720336e-04 -1.27509189e-05 -3.13815141e-05 1.37277090e-05 -3.16329428e-06 -3.33594475e-05 -1.04247858e-05 -3.60141605e-06 -1.67422057e-05 3.54807188e-05 1.22344517e-05 5.70968043e-05 1.12314006e-06 -1.56090719e-06 -7.65895674e-06 6.07076274e-06 -2.57724878e-06 -5.18708531e-06 1.79871070e-05 -4.26298824e-06 -4.09454220e-06 1.31803928e-06 1.38997698e-05 4.34366074e-06 8.15449649e-07 7.11294712e-06 -1.47836328e-05 -2.89015053e-06 -2.42318426e-05 -4.67975025e-07 5.71522584e-07 3.20700306e-06 -2.57724878e-06 9.59219321e-07 1.25466617e-06 1.34349826e-05 6.58962236e-06 -1.31792447e-06 3.95377341e-06 -2.19886127e-05 4.39772254e-06 -1.31931676e-05 3.04388134e-06 -1.31803928e-06 3.95411785e-06 -1.05443143e-06 -7.90823570e-07 8.23315696e-06 9.02495943e-05 3.30136560e-05 3.30136560e-05 -1.15322826e-04 -1.15322826e-04 6.50509780e-06 2.25343198e-05 -1.12671599e-05 1.34349826e-05 1.43209127e-04 7.13481329e-05 -1.42696266e-05 4.28088798e-05 -2.37845052e-04 4.75690104e-05 -1.42707031e-04 3.21001433e-05 -1.38997698e-05 4.16993094e-05 -1.11198158e-05 -8.33986187e-06 9.02495943e-05 9.91070319e-04 3.61844250e-04 3.61844250e-04 -1.26431932e-03 -1.26431932e-03 7.23412109e-05 2.50597306e-04 -1.25298653e-04 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 7.04340302e-06 -2.11302091e-05 1.16121122e-04 -2.36453257e-05 7.09359772e-05 -1.59884824e-05 7.11294712e-06 -2.13388414e-05 5.79154766e-06 4.34366074e-06 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 -2.08516626e-05 -8.77935341e-05 4.64903097e-05 1.31792447e-06 1.42696266e-05 7.04340302e-06 -7.59910514e-07 4.22604181e-06 -2.36453257e-05 2.62355898e-06 -1.41871954e-05 3.41677917e-06 -8.15449649e-07 4.34366074e-06 -1.28479698e-06 -4.89269790e-07 6.96094992e-06 -2.39796963e-05 5.18708531e-06 5.18708531e-06 -3.95377341e-06 -4.28088798e-05 -2.11302091e-05 4.22604181e-06 -1.20293553e-05 7.09359772e-05 -1.41871954e-05 4.04560801e-05 -1.02503375e-05 4.34366074e-06 -1.23985450e-05 3.09546624e-06 2.47970899e-06 -3.30136560e-05 -3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 -2.98359579e-05 -8.77935341e-05 4.13032244e-05 2.19886127e-05 2.37845052e-04 1.16121122e-04 -2.36453257e-05 7.09359772e-05 -3.88706075e-04 7.91031105e-05 -2.37309331e-04 5.45492648e-05 -2.42318426e-05 7.26955279e-05 -1.97115105e-05 -1.47836328e-05 1.15322826e-04 1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 7.37468140e-05 3.09427778e-04 -1.63707443e-04 -4.39772254e-06 -4.75690104e-05 -2.36453257e-05 2.62355898e-06 -1.41871954e-05 7.91031105e-05 -9.01114524e-06 4.74618663e-05 -1.16157423e-05 2.89015053e-06 -1.47836328e-05 4.34984751e-06 1.73409032e-06 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 -1.79871070e-05 1.31931676e-05 1.42707031e-04 7.09359772e-05 -1.41871954e-05 4.04560801e-05 -2.37309331e-04 4.74618663e-05 -1.35576122e-04 3.48472270e-05 -1.47836328e-05 4.23131714e-05 -1.06042700e-05 -8.46263429e-06 1.15322826e-04 1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 1.04901397e-04 3.09427778e-04 -1.45720336e-04 3.04388134e-06 3.21001433e-05 1.59884824e-05 -3.41677917e-06 1.02503375e-05 -5.45492648e-05 1.16157423e-05 -3.48472270e-05 5.56082368e-06 -2.46595043e-06 7.39785129e-06 -2.00638043e-06 -1.50478532e-06 6.50509780e-06 7.23412109e-05 2.08516626e-05 2.98359579e-05 -7.37468140e-05 -1.04901397e-04 -9.95783968e-07 1.81181256e-05 -1.27509189e-05 -1.31803928e-06 -1.38997698e-05 -7.11294712e-06 8.15449649e-07 -4.34366074e-06 2.42318426e-05 -2.89015053e-06 1.47836328e-05 -2.46595043e-06 9.59219321e-07 -3.20700306e-06 8.83346132e-07 5.71522584e-07 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 -4.26298824e-06 3.95411785e-06 4.16993094e-05 2.13388414e-05 -4.34366074e-06 1.23985450e-05 -7.26955279e-05 1.47836328e-05 -4.23131714e-05 7.39785129e-06 -3.20700306e-06 9.51122747e-06 -2.50445917e-06 -1.90867338e-06 2.25343198e-05 2.50597306e-04 8.77935341e-05 8.77935341e-05 -3.09427778e-04 -3.09427778e-04 1.81181256e-05 6.29314743e-05 -3.13815141e-05 -1.05443143e-06 -1.11198158e-05 -5.79154766e-06 1.28479698e-06 -3.09546624e-06 1.97115105e-05 -4.34984751e-06 1.06042700e-05 -2.00638043e-06 8.83346132e-07 -2.50445917e-06 6.50274256e-07 5.15449757e-07 -1.12671599e-05 -1.25298653e-04 -4.64903097e-05 -4.13032244e-05 1.63707443e-04 1.45720336e-04 -1.27509189e-05 -3.13815141e-05 1.37277090e-05 -7.90823570e-07 -8.33986187e-06 -4.34366074e-06 4.89269790e-07 -2.47970899e-06 1.47836328e-05 -1.73409032e-06 8.46263429e-06 -1.50478532e-06 5.71522584e-07 -1.90867338e-06 5.15449757e-07 3.49595231e-07 -5.18708531e-06 1.79871070e-05 -4.26298824e-06 -4.09454220e-06 - 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 4 5 7 8 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 3 6 9 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 18 20 21 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 22 25 - 0 22 44 66 83 105 127 144 166 188 205 227 249 266 288 310 332 349 371 393 410 432 454 471 493 515 532 -2 -2 1 169 - 1.25466617e-06 1.34349826e-05 3.95377341e-06 -1.31792447e-06 6.58962236e-06 -1.31931676e-05 4.39772254e-06 -2.19886127e-05 -6.08776268e-07 -7.90823570e-07 3.95411785e-06 -3.16329428e-06 -1.31803928e-06 1.34349826e-05 1.43209127e-04 4.28088798e-05 -1.42696266e-05 7.13481329e-05 -1.42707031e-04 4.75690104e-05 -2.37845052e-04 -6.42002866e-06 -8.33986187e-06 4.16993094e-05 -3.33594475e-05 -1.38997698e-05 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 4.22604181e-06 -2.11302091e-05 4.04560801e-05 -1.41871954e-05 7.09359772e-05 2.44441635e-06 2.47970899e-06 -1.23985450e-05 1.04247858e-05 4.34366074e-06 1.31792447e-06 1.42696266e-05 4.22604181e-06 -7.59910514e-07 7.04340302e-06 -1.41871954e-05 2.62355898e-06 -2.36453257e-05 -5.95722755e-07 -4.89269790e-07 4.34366074e-06 -3.60141605e-06 -8.15449649e-07 -6.58962236e-06 -7.13481329e-05 -2.11302091e-05 7.04340302e-06 -3.45682450e-05 7.09359772e-05 -2.36453257e-05 1.16121122e-04 2.97861377e-06 4.34366074e-06 -2.13388414e-05 1.67422057e-05 7.11294712e-06 1.31931676e-05 1.42707031e-04 4.04560801e-05 -1.41871954e-05 7.09359772e-05 -1.35576122e-04 4.74618663e-05 -2.37309331e-04 -8.24004626e-06 -8.46263429e-06 4.23131714e-05 -3.54807188e-05 -1.47836328e-05 -4.39772254e-06 -4.75690104e-05 -1.41871954e-05 2.62355898e-06 -2.36453257e-05 4.74618663e-05 -9.01114524e-06 7.91031105e-05 2.04079272e-06 1.73409032e-06 -1.47836328e-05 1.22344517e-05 2.89015053e-06 2.19886127e-05 2.37845052e-04 7.09359772e-05 -2.36453257e-05 1.16121122e-04 -2.37309331e-04 7.91031105e-05 -3.88706075e-04 -1.02039636e-05 -1.47836328e-05 7.26955279e-05 -5.70968043e-05 -2.42318426e-05 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 5.95722755e-07 -2.97861377e-06 8.24004626e-06 -2.04079272e-06 1.02039636e-05 1.40335193e-07 3.06000076e-07 -1.53000038e-06 1.12314006e-06 4.67975025e-07 -7.90823570e-07 -8.33986187e-06 -2.47970899e-06 4.89269790e-07 -4.34366074e-06 8.46263429e-06 -1.73409032e-06 1.47836328e-05 3.06000076e-07 3.49595231e-07 -1.90867338e-06 1.56090719e-06 5.71522584e-07 3.95411785e-06 4.16993094e-05 1.23985450e-05 -4.34366074e-06 2.13388414e-05 -4.23131714e-05 1.47836328e-05 -7.26955279e-05 -1.53000038e-06 -1.90867338e-06 9.51122747e-06 -7.65895674e-06 -3.20700306e-06 -3.16329428e-06 -3.33594475e-05 -1.04247858e-05 3.60141605e-06 -1.67422057e-05 3.54807188e-05 -1.22344517e-05 5.70968043e-05 1.12314006e-06 1.56090719e-06 -7.65895674e-06 6.07076274e-06 2.57724878e-06 -1.31803928e-06 -1.38997698e-05 -4.34366074e-06 8.15449649e-07 -7.11294712e-06 1.47836328e-05 -2.89015053e-06 2.42318426e-05 4.67975025e-07 5.71522584e-07 -3.20700306e-06 2.57724878e-06 9.59219321e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -2 -1 -2 169 - 1.25466617e-06 1.34349826e-05 6.58962236e-06 3.95377341e-06 1.31792447e-06 -2.19886127e-05 -1.31931676e-05 -4.39772254e-06 3.04388134e-06 3.95411785e-06 1.31803928e-06 1.05443143e-06 7.90823570e-07 1.34349826e-05 1.43209127e-04 7.13481329e-05 4.28088798e-05 1.42696266e-05 -2.37845052e-04 -1.42707031e-04 -4.75690104e-05 3.21001433e-05 4.16993094e-05 1.38997698e-05 1.11198158e-05 8.33986187e-06 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 -2.11302091e-05 -7.04340302e-06 1.16121122e-04 7.09359772e-05 2.36453257e-05 -1.59884824e-05 -2.13388414e-05 -7.11294712e-06 -5.79154766e-06 -4.34366074e-06 -3.95377341e-06 -4.28088798e-05 -2.11302091e-05 -1.20293553e-05 -4.22604181e-06 7.09359772e-05 4.04560801e-05 1.41871954e-05 -1.02503375e-05 -1.23985450e-05 -4.34366074e-06 -3.09546624e-06 -2.47970899e-06 -1.31792447e-06 -1.42696266e-05 -7.04340302e-06 -4.22604181e-06 -7.59910514e-07 2.36453257e-05 1.41871954e-05 2.62355898e-06 -3.41677917e-06 -4.34366074e-06 -8.15449649e-07 -1.28479698e-06 -4.89269790e-07 2.19886127e-05 2.37845052e-04 1.16121122e-04 7.09359772e-05 2.36453257e-05 -3.88706075e-04 -2.37309331e-04 -7.91031105e-05 5.45492648e-05 7.26955279e-05 2.42318426e-05 1.97115105e-05 1.47836328e-05 1.31931676e-05 1.42707031e-04 7.09359772e-05 4.04560801e-05 1.41871954e-05 -2.37309331e-04 -1.35576122e-04 -4.74618663e-05 3.48472270e-05 4.23131714e-05 1.47836328e-05 1.06042700e-05 8.46263429e-06 4.39772254e-06 4.75690104e-05 2.36453257e-05 1.41871954e-05 2.62355898e-06 -7.91031105e-05 -4.74618663e-05 -9.01114524e-06 1.16157423e-05 1.47836328e-05 2.89015053e-06 4.34984751e-06 1.73409032e-06 3.04388134e-06 3.21001433e-05 1.59884824e-05 1.02503375e-05 3.41677917e-06 -5.45492648e-05 -3.48472270e-05 -1.16157423e-05 5.56082368e-06 7.39785129e-06 2.46595043e-06 2.00638043e-06 1.50478532e-06 3.95411785e-06 4.16993094e-05 2.13388414e-05 1.23985450e-05 4.34366074e-06 -7.26955279e-05 -4.23131714e-05 -1.47836328e-05 7.39785129e-06 9.51122747e-06 3.20700306e-06 2.50445917e-06 1.90867338e-06 1.31803928e-06 1.38997698e-05 7.11294712e-06 4.34366074e-06 8.15449649e-07 -2.42318426e-05 -1.47836328e-05 -2.89015053e-06 2.46595043e-06 3.20700306e-06 9.59219321e-07 8.83346132e-07 5.71522584e-07 1.05443143e-06 1.11198158e-05 5.79154766e-06 3.09546624e-06 1.28479698e-06 -1.97115105e-05 -1.06042700e-05 -4.34984751e-06 2.00638043e-06 2.50445917e-06 8.83346132e-07 6.50274256e-07 5.15449757e-07 7.90823570e-07 8.33986187e-06 4.34366074e-06 2.47970899e-06 4.89269790e-07 -1.47836328e-05 -8.46263429e-06 -1.73409032e-06 1.50478532e-06 1.90867338e-06 5.71522584e-07 5.15449757e-07 3.49595231e-07 - 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 13 26 39 52 65 78 91 104 117 130 143 156 169 169 169 169 169 169 169 169 169 169 169 169 169 169 -2 -1 -1 624 - 1.70328256e-04 1.56710856e-03 6.51378048e-04 3.25689024e-04 3.25689024e-04 -2.13278108e-03 -1.06639054e-03 -1.06639054e-03 9.05613602e-05 1.04571251e-04 1.04571251e-04 5.22856257e-05 6.09103871e-05 6.14453477e-04 1.77556141e-04 1.77556141e-04 1.77556141e-04 -6.05173587e-04 -6.05173587e-04 -6.05173587e-04 6.22069144e-05 6.22069144e-05 6.22069144e-05 1.56710856e-03 1.39613919e-02 5.79216869e-03 2.89608434e-03 2.89608434e-03 -1.87045190e-02 -9.35225951e-03 -9.35225951e-03 5.70753169e-04 6.59048991e-04 6.59048991e-04 3.29524496e-04 6.14453477e-04 6.16334179e-03 1.76784261e-03 1.76784261e-03 1.76784261e-03 -6.01995904e-03 -6.01995904e-03 -6.01995904e-03 5.81250961e-04 5.81250961e-04 5.81250961e-04 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 -1.28527532e-03 -1.28527532e-03 7.54522870e-03 4.15611128e-03 4.15611128e-03 -1.96268001e-04 -3.07748924e-04 -3.07748924e-04 -1.78209909e-04 -1.77556141e-04 -1.76784261e-03 -4.59399382e-04 -5.34588187e-04 -5.34588187e-04 1.55584457e-03 1.81552416e-03 1.81552416e-03 3.70813928e-05 -1.53225561e-04 -1.53225561e-04 -1.85338989e-04 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 -4.14019247e-04 -6.42637659e-04 4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.82434463e-04 -8.08681204e-05 -1.78209909e-04 4.86708945e-05 -4.04340602e-05 -1.77556141e-04 -1.76784261e-03 -5.34588187e-04 -4.59399382e-04 -5.34588187e-04 1.81552416e-03 1.55584457e-03 1.81552416e-03 -1.85406964e-05 -1.53225561e-04 -1.85338989e-04 3.21134282e-05 -1.53225561e-04 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 -6.42637659e-04 -4.14019247e-04 4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.82434463e-04 -1.78209909e-04 -8.08681204e-05 -4.86708945e-05 -4.04340602e-05 -1.77556141e-04 -1.76784261e-03 -5.34588187e-04 -5.34588187e-04 -4.59399382e-04 1.81552416e-03 1.81552416e-03 1.55584457e-03 -1.85406964e-05 -1.85338989e-04 -1.53225561e-04 -3.21134282e-05 -1.53225561e-04 2.13278108e-03 1.87045190e-02 7.54522870e-03 4.15611128e-03 4.15611128e-03 -2.41529920e-02 -1.33621179e-02 -1.33621179e-02 4.89198722e-04 8.27434268e-04 8.27434268e-04 4.92484006e-04 6.05173587e-04 6.01995904e-03 1.55584457e-03 1.81552416e-03 1.81552416e-03 -5.27080384e-03 -6.16854997e-03 -6.16854997e-03 -1.27833318e-04 5.04964025e-04 5.04964025e-04 6.15670926e-04 1.06639054e-03 9.35225951e-03 4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.33621179e-02 -4.10981523e-03 -6.68105894e-03 5.17455810e-04 1.77416518e-04 4.92484006e-04 -1.57533744e-04 8.87082588e-05 6.05173587e-04 6.01995904e-03 1.81552416e-03 1.55584457e-03 1.81552416e-03 -6.16854997e-03 -5.27080384e-03 -6.16854997e-03 6.39166591e-05 5.04964025e-04 6.15670926e-04 -1.10706901e-04 5.04964025e-04 1.06639054e-03 9.35225951e-03 4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.33621179e-02 -6.68105894e-03 -4.10981523e-03 5.17455810e-04 4.92484006e-04 1.77416518e-04 1.57533744e-04 8.87082588e-05 6.05173587e-04 6.01995904e-03 1.81552416e-03 1.81552416e-03 1.55584457e-03 -6.16854997e-03 -6.16854997e-03 -5.27080384e-03 6.39166591e-05 6.15670926e-04 5.04964025e-04 1.10706901e-04 5.04964025e-04 9.05613602e-05 5.70753169e-04 1.96268001e-04 1.82434463e-04 1.82434463e-04 -4.89198722e-04 -5.17455810e-04 -5.17455810e-04 -8.99306349e-05 -8.30889164e-05 -8.30889164e-05 -3.38595206e-05 -3.70813928e-05 1.85406964e-05 1.85406964e-05 1.27833318e-04 -6.39166591e-05 -6.39166591e-05 -2.24434069e-05 -7.05389767e-06 -7.05389767e-06 1.41077953e-05 1.04571251e-04 6.59048991e-04 3.07748924e-04 8.08681204e-05 1.78209909e-04 -8.27434268e-04 -1.77416518e-04 -4.92484006e-04 -8.30889164e-05 -1.08000471e-04 -9.44638495e-05 -8.87380160e-06 -5.38872760e-05 6.22069144e-05 5.81250961e-04 1.53225561e-04 1.53225561e-04 1.85338989e-04 -5.04964025e-04 -5.04964025e-04 -6.15670926e-04 -7.05389767e-06 2.30560406e-05 3.32817384e-05 -1.22177092e-05 3.32817384e-05 1.04571251e-04 6.59048991e-04 3.07748924e-04 1.78209909e-04 8.08681204e-05 -8.27434268e-04 -4.92484006e-04 -1.77416518e-04 -8.30889164e-05 -9.44638495e-05 -1.08000471e-04 8.87380160e-06 -5.38872760e-05 6.22069144e-05 5.81250961e-04 1.53225561e-04 1.85338989e-04 1.53225561e-04 -5.04964025e-04 -6.15670926e-04 -5.04964025e-04 -7.05389767e-06 3.32817384e-05 2.30560406e-05 1.22177092e-05 3.32817384e-05 -4.86708945e-05 4.86708945e-05 1.57533744e-04 -1.57533744e-04 -8.87380160e-06 8.87380160e-06 -4.66282012e-06 -3.21134282e-05 3.21134282e-05 1.10706901e-04 -1.10706901e-04 -1.22177092e-05 1.22177092e-05 -2.24434069e-05 5.22856257e-05 3.29524496e-04 1.78209909e-04 4.04340602e-05 4.04340602e-05 -4.92484006e-04 -8.87082588e-05 -8.87082588e-05 -3.38595206e-05 -5.38872760e-05 -5.38872760e-05 -2.71695573e-05 6.22069144e-05 5.81250961e-04 1.85338989e-04 1.53225561e-04 1.53225561e-04 -6.15670926e-04 -5.04964025e-04 -5.04964025e-04 1.41077953e-05 3.32817384e-05 3.32817384e-05 2.30560406e-05 6.09103871e-05 6.14453477e-04 2.95926902e-04 5.91853803e-05 5.91853803e-05 -1.00862265e-03 -2.01724529e-04 -2.01724529e-04 9.57738101e-05 3.45593969e-05 3.45593969e-05 6.91187938e-06 1.70328256e-04 1.56710856e-03 6.51378048e-04 3.25689024e-04 3.25689024e-04 -2.13278108e-03 -1.06639054e-03 -1.06639054e-03 9.05613602e-05 1.04571251e-04 1.04571251e-04 5.22856257e-05 6.14453477e-04 6.16334179e-03 2.94640435e-03 5.89280869e-04 5.89280869e-04 -1.00332651e-02 -2.00665301e-03 -2.00665301e-03 8.94894397e-04 3.22917201e-04 3.22917201e-04 6.45834401e-05 1.56710856e-03 1.39613919e-02 5.79216869e-03 2.89608434e-03 2.89608434e-03 -1.87045190e-02 -9.35225951e-03 -9.35225951e-03 5.70753169e-04 6.59048991e-04 6.59048991e-04 3.29524496e-04 -2.95926902e-04 -2.94640435e-03 -1.40977838e-03 -2.96993437e-04 -2.96993437e-04 4.78344308e-03 1.00862453e-03 1.00862453e-03 -4.13777746e-04 -1.60905699e-04 -1.60905699e-04 -3.43220350e-05 -6.51378048e-04 -5.79216869e-03 -2.34193222e-03 -1.28527532e-03 -1.28527532e-03 7.54522870e-03 4.15611128e-03 4.15611128e-03 -1.96268001e-04 -3.07748924e-04 -3.07748924e-04 -1.78209909e-04 -5.91853803e-05 -5.89280869e-04 -2.96993437e-04 1.57901181e-05 -5.93986875e-05 1.00862453e-03 -5.79546830e-05 2.01724907e-04 -1.01296246e-04 1.92003453e-05 -3.43220350e-05 1.07044761e-05 3.84006907e-06 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 -4.14019247e-04 -6.42637659e-04 4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.82434463e-04 -8.08681204e-05 -1.78209909e-04 4.86708945e-05 -4.04340602e-05 -5.91853803e-05 -5.89280869e-04 -2.96993437e-04 -5.93986875e-05 1.57901181e-05 1.00862453e-03 2.01724907e-04 -5.79546830e-05 -1.01296246e-04 -3.43220350e-05 1.92003453e-05 -1.07044761e-05 3.84006907e-06 -3.25689024e-04 -2.89608434e-03 -1.28527532e-03 -6.42637659e-04 -4.14019247e-04 4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.82434463e-04 -1.78209909e-04 -8.08681204e-05 -4.86708945e-05 -4.04340602e-05 1.00862265e-03 1.00332651e-02 4.78344308e-03 1.00862453e-03 1.00862453e-03 -1.62371149e-02 -3.42697221e-03 -3.42697221e-03 1.36675680e-03 5.33163371e-04 5.33163371e-04 1.14013134e-04 2.13278108e-03 1.87045190e-02 7.54522870e-03 4.15611128e-03 4.15611128e-03 -2.41529920e-02 -1.33621179e-02 -1.33621179e-02 4.89198722e-04 8.27434268e-04 8.27434268e-04 4.92484006e-04 2.01724529e-04 2.00665301e-03 1.00862453e-03 -5.79546830e-05 2.01724907e-04 -3.42697221e-03 2.12351688e-04 -6.85394441e-04 3.37268019e-04 -7.04983673e-05 1.14013134e-04 -3.69023003e-05 -1.40996735e-05 1.06639054e-03 9.35225951e-03 4.15611128e-03 1.31106178e-03 2.07805564e-03 -1.33621179e-02 -4.10981523e-03 -6.68105894e-03 5.17455810e-04 1.77416518e-04 4.92484006e-04 -1.57533744e-04 8.87082588e-05 2.01724529e-04 2.00665301e-03 1.00862453e-03 2.01724907e-04 -5.79546830e-05 -3.42697221e-03 -6.85394441e-04 2.12351688e-04 3.37268019e-04 1.14013134e-04 -7.04983673e-05 3.69023003e-05 -1.40996735e-05 1.06639054e-03 9.35225951e-03 4.15611128e-03 2.07805564e-03 1.31106178e-03 -1.33621179e-02 -6.68105894e-03 -4.10981523e-03 5.17455810e-04 4.92484006e-04 1.77416518e-04 1.57533744e-04 8.87082588e-05 9.57738101e-05 8.94894397e-04 4.13777746e-04 1.01296246e-04 1.01296246e-04 -1.36675680e-03 -3.37268019e-04 -3.37268019e-04 6.36867635e-05 3.49983802e-05 3.49983802e-05 9.35097527e-06 9.05613602e-05 5.70753169e-04 1.96268001e-04 1.82434463e-04 1.82434463e-04 -4.89198722e-04 -5.17455810e-04 -5.17455810e-04 -8.99306349e-05 -8.30889164e-05 -8.30889164e-05 -3.38595206e-05 3.45593969e-05 3.22917201e-04 1.60905699e-04 -1.92003453e-05 3.43220350e-05 -5.33163371e-04 7.04983673e-05 -1.14013134e-04 3.49983802e-05 -1.92605535e-05 1.26855161e-05 -6.78761620e-06 -3.97900833e-06 1.04571251e-04 6.59048991e-04 3.07748924e-04 8.08681204e-05 1.78209909e-04 -8.27434268e-04 -1.77416518e-04 -4.92484006e-04 -8.30889164e-05 -1.08000471e-04 -9.44638495e-05 -8.87380160e-06 -5.38872760e-05 3.45593969e-05 3.22917201e-04 1.60905699e-04 3.43220350e-05 -1.92003453e-05 -5.33163371e-04 -1.14013134e-04 7.04983673e-05 3.49983802e-05 1.26855161e-05 -1.92605535e-05 6.78761620e-06 -3.97900833e-06 1.04571251e-04 6.59048991e-04 3.07748924e-04 1.78209909e-04 8.08681204e-05 -8.27434268e-04 -4.92484006e-04 -1.77416518e-04 -8.30889164e-05 -9.44638495e-05 -1.08000471e-04 8.87380160e-06 -5.38872760e-05 -1.07044761e-05 1.07044761e-05 3.69023003e-05 -3.69023003e-05 -6.78761620e-06 6.78761620e-06 -7.23035088e-07 -4.86708945e-05 4.86708945e-05 1.57533744e-04 -1.57533744e-04 -8.87380160e-06 8.87380160e-06 -4.66282012e-06 6.91187938e-06 6.45834401e-05 3.43220350e-05 -3.84006907e-06 -3.84006907e-06 -1.14013134e-04 1.40996735e-05 1.40996735e-05 9.35097527e-06 -3.97900833e-06 -3.97900833e-06 -1.61313514e-07 5.22856257e-05 3.29524496e-04 1.78209909e-04 4.04340602e-05 4.04340602e-05 -4.92484006e-04 -8.87082588e-05 -8.87082588e-05 -3.38595206e-05 -5.38872760e-05 -5.38872760e-05 -2.71695573e-05 - 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 4 6 7 9 10 11 16 17 19 20 22 23 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 25 - 0 23 46 70 96 122 146 172 198 220 246 272 286 310 334 358 382 408 434 458 484 510 534 560 586 600 624 -2 -1 0 676 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 3.25689024e-04 6.51378048e-04 -1.06639054e-03 -1.06639054e-03 -2.13278108e-03 -4.52806801e-05 5.22856257e-05 1.04571251e-04 -7.84284385e-05 1.04571251e-04 1.25466617e-06 1.34349826e-05 1.31792447e-06 3.95377341e-06 6.58962236e-06 -4.39772254e-06 -1.31931676e-05 -2.19886127e-05 -2.43510507e-06 7.90823570e-07 1.31803928e-06 -2.10886285e-06 3.95411785e-06 1.56710856e-03 1.39613919e-02 2.89608434e-03 2.89608434e-03 5.79216869e-03 -9.35225951e-03 -9.35225951e-03 -1.87045190e-02 -2.85376584e-04 3.29524496e-04 6.59048991e-04 -4.94286743e-04 6.59048991e-04 1.34349826e-05 1.43209127e-04 1.42696266e-05 4.28088798e-05 7.13481329e-05 -4.75690104e-05 -1.42707031e-04 -2.37845052e-04 -2.56801146e-05 8.33986187e-06 1.38997698e-05 -2.22396317e-05 4.16993094e-05 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -6.42637659e-04 -1.28527532e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 1.33367462e-04 -4.04340602e-05 -8.08681204e-05 1.33657432e-04 -1.78209909e-04 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 -4.22604181e-06 -7.04340302e-06 2.62355898e-06 1.41871954e-05 2.36453257e-05 2.82105641e-06 -4.89269790e-07 -8.15449649e-07 2.31661906e-06 -4.34366074e-06 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 -4.14019247e-04 -1.28527532e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 4.90670003e-05 -4.04340602e-05 -1.78209909e-04 1.82328327e-04 -8.08681204e-05 -3.95377341e-06 -4.28088798e-05 -4.22604181e-06 -1.20293553e-05 -2.11302091e-05 1.41871954e-05 4.04560801e-05 7.09359772e-05 7.80592115e-06 -2.47970899e-06 -4.34366074e-06 7.32931955e-06 -1.23985450e-05 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 -1.28527532e-03 -2.34193222e-03 4.15611128e-03 4.15611128e-03 7.54522870e-03 9.81340007e-05 -1.78209909e-04 -3.07748924e-04 1.69973075e-04 -3.07748924e-04 -6.58962236e-06 -7.13481329e-05 -7.04340302e-06 -2.11302091e-05 -3.45682450e-05 2.36453257e-05 7.09359772e-05 1.16121122e-04 1.30098686e-05 -4.34366074e-06 -7.11294712e-06 1.09506581e-05 -2.13388414e-05 1.06639054e-03 9.35225951e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 -4.10981523e-03 -6.68105894e-03 -1.33621179e-02 -3.95156129e-04 8.87082588e-05 1.77416518e-04 -3.69363005e-04 4.92484006e-04 4.39772254e-06 4.75690104e-05 2.62355898e-06 1.41871954e-05 2.36453257e-05 -9.01114524e-06 -4.74618663e-05 -7.91031105e-05 -9.57494961e-06 1.73409032e-06 2.89015053e-06 -7.88460418e-06 1.47836328e-05 1.06639054e-03 9.35225951e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 -6.68105894e-03 -4.10981523e-03 -1.33621179e-02 -1.22299680e-04 8.87082588e-05 4.92484006e-04 -5.26896749e-04 1.77416518e-04 1.31931676e-05 1.42707031e-04 1.41871954e-05 4.04560801e-05 7.09359772e-05 -4.74618663e-05 -1.35576122e-04 -2.37309331e-04 -2.66071807e-05 8.46263429e-06 1.47836328e-05 -2.48764488e-05 4.23131714e-05 2.13278108e-03 1.87045190e-02 4.15611128e-03 4.15611128e-03 7.54522870e-03 -1.33621179e-02 -1.33621179e-02 -2.41529920e-02 -2.44599361e-04 4.92484006e-04 8.27434268e-04 -4.23658521e-04 8.27434268e-04 2.19886127e-05 2.37845052e-04 2.36453257e-05 7.09359772e-05 1.16121122e-04 -7.91031105e-05 -2.37309331e-04 -3.88706075e-04 -4.43453012e-05 1.47836328e-05 2.42318426e-05 -3.73852938e-05 7.26955279e-05 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -4.90670003e-05 -9.81340007e-05 3.95156129e-04 1.22299680e-04 2.44599361e-04 -2.59797738e-05 1.69297603e-05 3.38595206e-05 -3.69220468e-05 4.92293958e-05 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 -7.80592115e-06 -1.30098686e-05 9.57494961e-06 2.66071807e-05 4.43453012e-05 3.61548803e-06 -1.19878524e-06 -1.99797541e-06 3.12952049e-06 -5.86785091e-06 5.22856257e-05 3.29524496e-04 4.04340602e-05 4.04340602e-05 1.78209909e-04 -8.87082588e-05 -8.87082588e-05 -4.92484006e-04 1.69297603e-05 -2.71695573e-05 -5.38872760e-05 2.93232050e-05 -5.38872760e-05 7.90823570e-07 8.33986187e-06 4.89269790e-07 2.47970899e-06 4.34366074e-06 -1.73409032e-06 -8.46263429e-06 -1.47836328e-05 -1.19878524e-06 3.49595231e-07 5.71522584e-07 -1.04545744e-06 1.90867338e-06 1.04571251e-04 6.59048991e-04 8.08681204e-05 1.78209909e-04 3.07748924e-04 -1.77416518e-04 -4.92484006e-04 -8.27434268e-04 3.38595206e-05 -5.38872760e-05 -1.08000471e-04 7.63940131e-05 -9.44638495e-05 1.31803928e-06 1.38997698e-05 8.15449649e-07 4.34366074e-06 7.11294712e-06 -2.89015053e-06 -1.47836328e-05 -2.42318426e-05 -1.99797541e-06 5.71522584e-07 9.59219321e-07 -1.69390265e-06 3.20700306e-06 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 -1.82328327e-04 -1.69973075e-04 3.69363005e-04 5.26896749e-04 4.23658521e-04 -3.69220468e-05 2.93232050e-05 7.63940131e-05 -6.86136812e-05 6.75202116e-05 -2.10886285e-06 -2.22396317e-05 -2.31661906e-06 -7.32931955e-06 -1.09506581e-05 7.88460418e-06 2.48764488e-05 3.73852938e-05 3.12952049e-06 -1.04545744e-06 -1.69390265e-06 2.59560990e-06 -5.15449757e-06 1.04571251e-04 6.59048991e-04 1.78209909e-04 8.08681204e-05 3.07748924e-04 -4.92484006e-04 -1.77416518e-04 -8.27434268e-04 4.92293958e-05 -5.38872760e-05 -9.44638495e-05 6.75202116e-05 -1.08000471e-04 3.95411785e-06 4.16993094e-05 4.34366074e-06 1.23985450e-05 2.13388414e-05 -1.47836328e-05 -4.23131714e-05 -7.26955279e-05 -5.86785091e-06 1.90867338e-06 3.20700306e-06 -5.15449757e-06 9.51122747e-06 9.03813139e-04 6.83095219e-03 2.52992999e-03 8.43309998e-04 2.52992999e-03 -7.57080511e-03 -2.52360170e-03 -7.57080511e-03 5.05224374e-05 6.56305714e-05 1.96891714e-04 -8.75074285e-05 6.56305714e-05 1.70328256e-04 1.56710856e-03 3.25689024e-04 3.25689024e-04 6.51378048e-04 -1.06639054e-03 -1.06639054e-03 -2.13278108e-03 -4.52806801e-05 5.22856257e-05 1.04571251e-04 -7.84284385e-05 1.04571251e-04 6.83095219e-03 4.49022829e-02 1.71775766e-02 5.72585887e-03 1.71775766e-02 -4.75796841e-02 -1.58598947e-02 -4.75796841e-02 -5.20652809e-04 -6.76347839e-04 -2.02904352e-03 9.01797119e-04 -6.76347839e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 2.89608434e-03 5.79216869e-03 -9.35225951e-03 -9.35225951e-03 -1.87045190e-02 -2.85376584e-04 3.29524496e-04 6.59048991e-04 -4.94286743e-04 6.59048991e-04 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 -2.38239659e-03 -7.14718976e-03 1.66087992e-02 6.78418274e-03 2.03525482e-02 2.12097053e-04 1.25444848e-04 3.76334544e-04 -1.10087490e-04 8.25656177e-05 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -6.42637659e-04 -1.28527532e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 1.33367462e-04 -4.04340602e-05 -8.08681204e-05 1.33657432e-04 -1.78209909e-04 -8.43309998e-04 -5.72585887e-03 -2.38239659e-03 4.26061120e-04 -2.38239659e-03 6.78418274e-03 -1.48235482e-03 6.78418274e-03 -3.56998782e-06 1.56159564e-04 8.25656177e-05 6.18340029e-06 1.56159564e-04 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 -4.14019247e-04 -1.28527532e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 4.90670003e-05 -4.04340602e-05 -1.78209909e-04 1.82328327e-04 -8.08681204e-05 -2.52992999e-03 -1.71775766e-02 -7.14718976e-03 -2.38239659e-03 -5.92699644e-03 2.03525482e-02 6.78418274e-03 1.66087992e-02 -1.07099635e-05 8.25656177e-05 3.76334544e-04 -2.38725181e-04 1.25444848e-04 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 -1.28527532e-03 -2.34193222e-03 4.15611128e-03 4.15611128e-03 7.54522870e-03 9.81340007e-05 -1.78209909e-04 -3.07748924e-04 1.69973075e-04 -3.07748924e-04 7.57080511e-03 4.75796841e-02 1.66087992e-02 6.78418274e-03 2.03525482e-02 -4.42337068e-02 -1.85131107e-02 -5.55393321e-02 -9.60604637e-04 -1.02346772e-03 -3.07040317e-03 1.27914009e-03 -9.59355067e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 2.07805564e-03 4.15611128e-03 -4.10981523e-03 -6.68105894e-03 -1.33621179e-02 -3.95156129e-04 8.87082588e-05 1.77416518e-04 -3.69363005e-04 4.92484006e-04 2.52360170e-03 1.58598947e-02 6.78418274e-03 -1.48235482e-03 6.78418274e-03 -1.85131107e-02 5.13458842e-03 -1.85131107e-02 -2.09155165e-04 -5.12122996e-04 -9.59355067e-04 3.62267372e-04 -5.12122996e-04 1.06639054e-03 9.35225951e-03 2.07805564e-03 1.31106178e-03 4.15611128e-03 -6.68105894e-03 -4.10981523e-03 -1.33621179e-02 -1.22299680e-04 8.87082588e-05 4.92484006e-04 -5.26896749e-04 1.77416518e-04 7.57080511e-03 4.75796841e-02 2.03525482e-02 6.78418274e-03 1.66087992e-02 -5.55393321e-02 -1.85131107e-02 -4.42337068e-02 -6.27465494e-04 -9.59355067e-04 -3.07040317e-03 1.47147806e-03 -1.02346772e-03 2.13278108e-03 1.87045190e-02 4.15611128e-03 4.15611128e-03 7.54522870e-03 -1.33621179e-02 -1.33621179e-02 -2.41529920e-02 -2.44599361e-04 4.92484006e-04 8.27434268e-04 -4.23658521e-04 8.27434268e-04 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 3.56998782e-06 1.07099635e-05 9.60604637e-04 2.09155165e-04 6.27465494e-04 1.78917197e-04 -1.16268511e-04 -3.48805533e-04 2.92334169e-04 -2.19250627e-04 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -4.90670003e-05 -9.81340007e-05 3.95156129e-04 1.22299680e-04 2.44599361e-04 -2.59797738e-05 1.69297603e-05 3.38595206e-05 -3.69220468e-05 4.92293958e-05 6.56305714e-05 -6.76347839e-04 -1.25444848e-04 -1.56159564e-04 -8.25656177e-05 1.02346772e-03 5.12122996e-04 9.59355067e-04 -1.16268511e-04 -6.48472168e-06 -5.27432619e-04 3.20296473e-04 -1.72595341e-05 5.22856257e-05 3.29524496e-04 4.04340602e-05 4.04340602e-05 1.78209909e-04 -8.87082588e-05 -8.87082588e-05 -4.92484006e-04 1.69297603e-05 -2.71695573e-05 -5.38872760e-05 2.93232050e-05 -5.38872760e-05 1.96891714e-04 -2.02904352e-03 -3.76334544e-04 -8.25656177e-05 -3.76334544e-04 3.07040317e-03 9.59355067e-04 3.07040317e-03 -3.48805533e-04 -5.27432619e-04 -1.41297171e-03 6.04148906e-04 -5.27432619e-04 1.04571251e-04 6.59048991e-04 8.08681204e-05 1.78209909e-04 3.07748924e-04 -1.77416518e-04 -4.92484006e-04 -8.27434268e-04 3.38595206e-05 -5.38872760e-05 -1.08000471e-04 7.63940131e-05 -9.44638495e-05 -8.75074285e-05 9.01797119e-04 1.10087490e-04 -6.18340029e-06 2.38725181e-04 -1.27914009e-03 -3.62267372e-04 -1.47147806e-03 2.92334169e-04 3.20296473e-04 6.04148906e-04 -1.58641225e-04 2.60839721e-04 -7.84284385e-05 -4.94286743e-04 -1.33657432e-04 -1.82328327e-04 -1.69973075e-04 3.69363005e-04 5.26896749e-04 4.23658521e-04 -3.69220468e-05 2.93232050e-05 7.63940131e-05 -6.86136812e-05 6.75202116e-05 6.56305714e-05 -6.76347839e-04 -8.25656177e-05 -1.56159564e-04 -1.25444848e-04 9.59355067e-04 5.12122996e-04 1.02346772e-03 -2.19250627e-04 -1.72595341e-05 -5.27432619e-04 2.60839721e-04 -6.48472168e-06 1.04571251e-04 6.59048991e-04 1.78209909e-04 8.08681204e-05 3.07748924e-04 -4.92484006e-04 -1.77416518e-04 -8.27434268e-04 4.92293958e-05 -5.38872760e-05 -9.44638495e-05 6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 364 390 416 442 468 494 520 546 572 598 624 650 676 -2 -1 1 169 - 6.09103871e-05 6.14453477e-04 5.91853803e-05 5.91853803e-05 2.95926902e-04 -2.01724529e-04 -2.01724529e-04 -1.00862265e-03 -4.78869050e-05 6.91187938e-06 3.45593969e-05 -8.29425526e-05 3.45593969e-05 6.14453477e-04 6.16334179e-03 5.89280869e-04 5.89280869e-04 2.94640435e-03 -2.00665301e-03 -2.00665301e-03 -1.00332651e-02 -4.47447198e-04 6.45834401e-05 3.22917201e-04 -7.75001281e-04 3.22917201e-04 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 -5.93986875e-05 -2.96993437e-04 -5.79546830e-05 2.01724907e-04 1.00862453e-03 5.99184710e-05 3.84006907e-06 1.92003453e-05 8.23728840e-05 -3.43220350e-05 -5.91853803e-05 -5.89280869e-04 -5.93986875e-05 1.57901181e-05 -2.96993437e-04 2.01724907e-04 -5.79546830e-05 1.00862453e-03 4.13777746e-05 3.84006907e-06 -3.43220350e-05 9.30773600e-05 1.92003453e-05 -2.95926902e-04 -2.94640435e-03 -2.96993437e-04 -2.96993437e-04 -1.40977838e-03 1.00862453e-03 1.00862453e-03 4.78344308e-03 2.06888873e-04 -3.43220350e-05 -1.60905699e-04 3.58342040e-04 -1.60905699e-04 2.01724529e-04 2.00665301e-03 -5.79546830e-05 2.01724907e-04 1.00862453e-03 2.12351688e-04 -6.85394441e-04 -3.42697221e-03 -2.00592339e-04 -1.40996735e-05 -7.04983673e-05 -2.73631522e-04 1.14013134e-04 2.01724529e-04 2.00665301e-03 2.01724907e-04 -5.79546830e-05 1.00862453e-03 -6.85394441e-04 2.12351688e-04 -3.42697221e-03 -1.36675680e-04 -1.40996735e-05 1.14013134e-04 -3.10533823e-04 -7.04983673e-05 1.00862265e-03 1.00332651e-02 1.00862453e-03 1.00862453e-03 4.78344308e-03 -3.42697221e-03 -3.42697221e-03 -1.62371149e-02 -6.83378401e-04 1.14013134e-04 5.33163371e-04 -1.18364611e-03 5.33163371e-04 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 -4.13777746e-05 -2.06888873e-04 2.00592339e-04 1.36675680e-04 6.83378401e-04 1.53794146e-05 -4.67548763e-06 -2.33774382e-05 2.78902609e-05 -1.16209420e-05 6.91187938e-06 6.45834401e-05 -3.84006907e-06 -3.84006907e-06 3.43220350e-05 1.40996735e-05 1.40996735e-05 -1.14013134e-04 -4.67548763e-06 -1.61313514e-07 -3.97900833e-06 -8.09818213e-06 -3.97900833e-06 3.45593969e-05 3.22917201e-04 -1.92003453e-05 3.43220350e-05 1.60905699e-04 7.04983673e-05 -1.14013134e-04 -5.33163371e-04 -2.33774382e-05 -3.97900833e-06 -1.92605535e-05 -2.69156783e-05 1.26855161e-05 -8.29425526e-05 -7.75001281e-04 -8.23728840e-05 -9.30773600e-05 -3.58342040e-04 2.73631522e-04 3.10533823e-04 1.18364611e-03 2.78902609e-05 -8.09818213e-06 -2.69156783e-05 4.75843139e-05 -3.37032945e-05 3.45593969e-05 3.22917201e-04 3.43220350e-05 -1.92003453e-05 1.60905699e-04 -1.14013134e-04 7.04983673e-05 -5.33163371e-04 -1.16209420e-05 -3.97900833e-06 1.26855161e-05 -3.37032945e-05 -1.92605535e-05 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -2 0 -2 532 - 8.23315696e-06 9.02495943e-05 3.30136560e-05 3.30136560e-05 -1.15322826e-04 -1.15322826e-04 6.50509780e-06 2.25343198e-05 1.12671599e-05 1.25466617e-06 1.34349826e-05 3.95377341e-06 6.58962236e-06 1.31792447e-06 -1.31931676e-05 -2.19886127e-05 -4.39772254e-06 -6.08776268e-07 3.95411785e-06 7.90823570e-07 3.16329428e-06 1.31803928e-06 9.02495943e-05 9.91070319e-04 3.61844250e-04 3.61844250e-04 -1.26431932e-03 -1.26431932e-03 7.23412109e-05 2.50597306e-04 1.25298653e-04 1.34349826e-05 1.43209127e-04 4.28088798e-05 7.13481329e-05 1.42696266e-05 -1.42707031e-04 -2.37845052e-04 -4.75690104e-05 -6.42002866e-06 4.16993094e-05 8.33986187e-06 3.33594475e-05 1.38997698e-05 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 -2.08516626e-05 -8.77935341e-05 -4.64903097e-05 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 -2.11302091e-05 -4.22604181e-06 4.04560801e-05 7.09359772e-05 1.41871954e-05 2.44441635e-06 -1.23985450e-05 -2.47970899e-06 -1.04247858e-05 -4.34366074e-06 -3.30136560e-05 -3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 -2.98359579e-05 -8.77935341e-05 -4.13032244e-05 -6.58962236e-06 -7.13481329e-05 -2.11302091e-05 -3.45682450e-05 -7.04340302e-06 7.09359772e-05 1.16121122e-04 2.36453257e-05 2.97861377e-06 -2.13388414e-05 -4.34366074e-06 -1.67422057e-05 -7.11294712e-06 6.96094992e-06 -2.39796963e-05 5.18708531e-06 5.18708531e-06 -1.31792447e-06 -1.42696266e-05 -4.22604181e-06 -7.04340302e-06 -7.59910514e-07 1.41871954e-05 2.36453257e-05 2.62355898e-06 5.95722755e-07 -4.34366074e-06 -4.89269790e-07 -3.60141605e-06 -8.15449649e-07 1.15322826e-04 1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 7.37468140e-05 3.09427778e-04 1.63707443e-04 1.31931676e-05 1.42707031e-04 4.04560801e-05 7.09359772e-05 1.41871954e-05 -1.35576122e-04 -2.37309331e-04 -4.74618663e-05 -8.24004626e-06 4.23131714e-05 8.46263429e-06 3.54807188e-05 1.47836328e-05 1.15322826e-04 1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 1.04901397e-04 3.09427778e-04 1.45720336e-04 2.19886127e-05 2.37845052e-04 7.09359772e-05 1.16121122e-04 2.36453257e-05 -2.37309331e-04 -3.88706075e-04 -7.91031105e-05 -1.02039636e-05 7.26955279e-05 1.47836328e-05 5.70968043e-05 2.42318426e-05 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 -1.79871070e-05 4.39772254e-06 4.75690104e-05 1.41871954e-05 2.36453257e-05 2.62355898e-06 -4.74618663e-05 -7.91031105e-05 -9.01114524e-06 -2.04079272e-06 1.47836328e-05 1.73409032e-06 1.22344517e-05 2.89015053e-06 6.50509780e-06 7.23412109e-05 2.08516626e-05 2.98359579e-05 -7.37468140e-05 -1.04901397e-04 -9.95783968e-07 1.81181256e-05 1.27509189e-05 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 -2.97861377e-06 -5.95722755e-07 8.24004626e-06 1.02039636e-05 2.04079272e-06 1.40335193e-07 -1.53000038e-06 -3.06000076e-07 -1.12314006e-06 -4.67975025e-07 2.25343198e-05 2.50597306e-04 8.77935341e-05 8.77935341e-05 -3.09427778e-04 -3.09427778e-04 1.81181256e-05 6.29314743e-05 3.13815141e-05 3.95411785e-06 4.16993094e-05 1.23985450e-05 2.13388414e-05 4.34366074e-06 -4.23131714e-05 -7.26955279e-05 -1.47836328e-05 -1.53000038e-06 9.51122747e-06 1.90867338e-06 7.65895674e-06 3.20700306e-06 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 -4.26298824e-06 7.90823570e-07 8.33986187e-06 2.47970899e-06 4.34366074e-06 4.89269790e-07 -8.46263429e-06 -1.47836328e-05 -1.73409032e-06 -3.06000076e-07 1.90867338e-06 3.49595231e-07 1.56090719e-06 5.71522584e-07 1.12671599e-05 1.25298653e-04 4.64903097e-05 4.13032244e-05 -1.63707443e-04 -1.45720336e-04 1.27509189e-05 3.13815141e-05 1.37277090e-05 3.16329428e-06 3.33594475e-05 1.04247858e-05 1.67422057e-05 3.60141605e-06 -3.54807188e-05 -5.70968043e-05 -1.22344517e-05 -1.12314006e-06 7.65895674e-06 1.56090719e-06 6.07076274e-06 2.57724878e-06 -5.18708531e-06 1.79871070e-05 -4.26298824e-06 -4.09454220e-06 1.31803928e-06 1.38997698e-05 4.34366074e-06 7.11294712e-06 8.15449649e-07 -1.47836328e-05 -2.42318426e-05 -2.89015053e-06 -4.67975025e-07 3.20700306e-06 5.71522584e-07 2.57724878e-06 9.59219321e-07 1.25466617e-06 1.34349826e-05 6.58962236e-06 3.95377341e-06 -1.31792447e-06 -2.19886127e-05 -1.31931676e-05 4.39772254e-06 3.04388134e-06 3.95411785e-06 -1.31803928e-06 1.05443143e-06 -7.90823570e-07 8.23315696e-06 9.02495943e-05 3.30136560e-05 3.30136560e-05 -1.15322826e-04 -1.15322826e-04 6.50509780e-06 2.25343198e-05 1.12671599e-05 1.34349826e-05 1.43209127e-04 7.13481329e-05 4.28088798e-05 -1.42696266e-05 -2.37845052e-04 -1.42707031e-04 4.75690104e-05 3.21001433e-05 4.16993094e-05 -1.38997698e-05 1.11198158e-05 -8.33986187e-06 9.02495943e-05 9.91070319e-04 3.61844250e-04 3.61844250e-04 -1.26431932e-03 -1.26431932e-03 7.23412109e-05 2.50597306e-04 1.25298653e-04 -6.58962236e-06 -7.13481329e-05 -3.45682450e-05 -2.11302091e-05 7.04340302e-06 1.16121122e-04 7.09359772e-05 -2.36453257e-05 -1.59884824e-05 -2.13388414e-05 7.11294712e-06 -5.79154766e-06 4.34366074e-06 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 -2.08516626e-05 -8.77935341e-05 -4.64903097e-05 -3.95377341e-06 -4.28088798e-05 -2.11302091e-05 -1.20293553e-05 4.22604181e-06 7.09359772e-05 4.04560801e-05 -1.41871954e-05 -1.02503375e-05 -1.23985450e-05 4.34366074e-06 -3.09546624e-06 2.47970899e-06 -3.30136560e-05 -3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 -2.98359579e-05 -8.77935341e-05 -4.13032244e-05 1.31792447e-06 1.42696266e-05 7.04340302e-06 4.22604181e-06 -7.59910514e-07 -2.36453257e-05 -1.41871954e-05 2.62355898e-06 3.41677917e-06 4.34366074e-06 -8.15449649e-07 1.28479698e-06 -4.89269790e-07 6.96094992e-06 -2.39796963e-05 5.18708531e-06 5.18708531e-06 2.19886127e-05 2.37845052e-04 1.16121122e-04 7.09359772e-05 -2.36453257e-05 -3.88706075e-04 -2.37309331e-04 7.91031105e-05 5.45492648e-05 7.26955279e-05 -2.42318426e-05 1.97115105e-05 -1.47836328e-05 1.15322826e-04 1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 7.37468140e-05 3.09427778e-04 1.63707443e-04 1.31931676e-05 1.42707031e-04 7.09359772e-05 4.04560801e-05 -1.41871954e-05 -2.37309331e-04 -1.35576122e-04 4.74618663e-05 3.48472270e-05 4.23131714e-05 -1.47836328e-05 1.06042700e-05 -8.46263429e-06 1.15322826e-04 1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 1.04901397e-04 3.09427778e-04 1.45720336e-04 -4.39772254e-06 -4.75690104e-05 -2.36453257e-05 -1.41871954e-05 2.62355898e-06 7.91031105e-05 4.74618663e-05 -9.01114524e-06 -1.16157423e-05 -1.47836328e-05 2.89015053e-06 -4.34984751e-06 1.73409032e-06 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 -1.79871070e-05 3.04388134e-06 3.21001433e-05 1.59884824e-05 1.02503375e-05 -3.41677917e-06 -5.45492648e-05 -3.48472270e-05 1.16157423e-05 5.56082368e-06 7.39785129e-06 -2.46595043e-06 2.00638043e-06 -1.50478532e-06 6.50509780e-06 7.23412109e-05 2.08516626e-05 2.98359579e-05 -7.37468140e-05 -1.04901397e-04 -9.95783968e-07 1.81181256e-05 1.27509189e-05 3.95411785e-06 4.16993094e-05 2.13388414e-05 1.23985450e-05 -4.34366074e-06 -7.26955279e-05 -4.23131714e-05 1.47836328e-05 7.39785129e-06 9.51122747e-06 -3.20700306e-06 2.50445917e-06 -1.90867338e-06 2.25343198e-05 2.50597306e-04 8.77935341e-05 8.77935341e-05 -3.09427778e-04 -3.09427778e-04 1.81181256e-05 6.29314743e-05 3.13815141e-05 -1.31803928e-06 -1.38997698e-05 -7.11294712e-06 -4.34366074e-06 8.15449649e-07 2.42318426e-05 1.47836328e-05 -2.89015053e-06 -2.46595043e-06 -3.20700306e-06 9.59219321e-07 -8.83346132e-07 5.71522584e-07 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 -4.26298824e-06 1.05443143e-06 1.11198158e-05 5.79154766e-06 3.09546624e-06 -1.28479698e-06 -1.97115105e-05 -1.06042700e-05 4.34984751e-06 2.00638043e-06 2.50445917e-06 -8.83346132e-07 6.50274256e-07 -5.15449757e-07 1.12671599e-05 1.25298653e-04 4.64903097e-05 4.13032244e-05 -1.63707443e-04 -1.45720336e-04 1.27509189e-05 3.13815141e-05 1.37277090e-05 -7.90823570e-07 -8.33986187e-06 -4.34366074e-06 -2.47970899e-06 4.89269790e-07 1.47836328e-05 8.46263429e-06 -1.73409032e-06 -1.50478532e-06 -1.90867338e-06 5.71522584e-07 -5.15449757e-07 3.49595231e-07 -5.18708531e-06 1.79871070e-05 -4.26298824e-06 -4.09454220e-06 - 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 5 6 8 9 11 13 14 15 16 17 18 19 20 21 22 23 24 25 4 7 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 22 24 0 1 2 3 4 5 6 7 8 9 10 11 12 17 20 23 25 - 0 22 44 66 88 105 127 149 166 188 210 227 249 266 288 310 332 354 371 393 415 432 454 476 493 515 532 -2 0 -1 676 - 1.70328256e-04 1.56710856e-03 3.25689024e-04 6.51378048e-04 3.25689024e-04 -1.06639054e-03 -2.13278108e-03 -1.06639054e-03 -4.52806801e-05 1.04571251e-04 5.22856257e-05 7.84284385e-05 1.04571251e-04 1.25466617e-06 1.34349826e-05 1.31792447e-06 6.58962236e-06 3.95377341e-06 -4.39772254e-06 -2.19886127e-05 -1.31931676e-05 -2.43510507e-06 1.31803928e-06 7.90823570e-07 2.10886285e-06 3.95411785e-06 1.56710856e-03 1.39613919e-02 2.89608434e-03 5.79216869e-03 2.89608434e-03 -9.35225951e-03 -1.87045190e-02 -9.35225951e-03 -2.85376584e-04 6.59048991e-04 3.29524496e-04 4.94286743e-04 6.59048991e-04 1.34349826e-05 1.43209127e-04 1.42696266e-05 7.13481329e-05 4.28088798e-05 -4.75690104e-05 -2.37845052e-04 -1.42707031e-04 -2.56801146e-05 1.38997698e-05 8.33986187e-06 2.22396317e-05 4.16993094e-05 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -1.28527532e-03 -6.42637659e-04 1.31106178e-03 4.15611128e-03 2.07805564e-03 1.33367462e-04 -8.08681204e-05 -4.04340602e-05 -1.33657432e-04 -1.78209909e-04 -1.31792447e-06 -1.42696266e-05 -7.59910514e-07 -7.04340302e-06 -4.22604181e-06 2.62355898e-06 2.36453257e-05 1.41871954e-05 2.82105641e-06 -8.15449649e-07 -4.89269790e-07 -2.31661906e-06 -4.34366074e-06 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 -2.34193222e-03 -1.28527532e-03 4.15611128e-03 7.54522870e-03 4.15611128e-03 9.81340007e-05 -3.07748924e-04 -1.78209909e-04 -1.69973075e-04 -3.07748924e-04 -6.58962236e-06 -7.13481329e-05 -7.04340302e-06 -3.45682450e-05 -2.11302091e-05 2.36453257e-05 1.16121122e-04 7.09359772e-05 1.30098686e-05 -7.11294712e-06 -4.34366074e-06 -1.09506581e-05 -2.13388414e-05 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 -1.28527532e-03 -4.14019247e-04 2.07805564e-03 4.15611128e-03 1.31106178e-03 4.90670003e-05 -1.78209909e-04 -4.04340602e-05 -1.82328327e-04 -8.08681204e-05 -3.95377341e-06 -4.28088798e-05 -4.22604181e-06 -2.11302091e-05 -1.20293553e-05 1.41871954e-05 7.09359772e-05 4.04560801e-05 7.80592115e-06 -4.34366074e-06 -2.47970899e-06 -7.32931955e-06 -1.23985450e-05 1.06639054e-03 9.35225951e-03 1.31106178e-03 4.15611128e-03 2.07805564e-03 -4.10981523e-03 -1.33621179e-02 -6.68105894e-03 -3.95156129e-04 1.77416518e-04 8.87082588e-05 3.69363005e-04 4.92484006e-04 4.39772254e-06 4.75690104e-05 2.62355898e-06 2.36453257e-05 1.41871954e-05 -9.01114524e-06 -7.91031105e-05 -4.74618663e-05 -9.57494961e-06 2.89015053e-06 1.73409032e-06 7.88460418e-06 1.47836328e-05 2.13278108e-03 1.87045190e-02 4.15611128e-03 7.54522870e-03 4.15611128e-03 -1.33621179e-02 -2.41529920e-02 -1.33621179e-02 -2.44599361e-04 8.27434268e-04 4.92484006e-04 4.23658521e-04 8.27434268e-04 2.19886127e-05 2.37845052e-04 2.36453257e-05 1.16121122e-04 7.09359772e-05 -7.91031105e-05 -3.88706075e-04 -2.37309331e-04 -4.43453012e-05 2.42318426e-05 1.47836328e-05 3.73852938e-05 7.26955279e-05 1.06639054e-03 9.35225951e-03 2.07805564e-03 4.15611128e-03 1.31106178e-03 -6.68105894e-03 -1.33621179e-02 -4.10981523e-03 -1.22299680e-04 4.92484006e-04 8.87082588e-05 5.26896749e-04 1.77416518e-04 1.31931676e-05 1.42707031e-04 1.41871954e-05 7.09359772e-05 4.04560801e-05 -4.74618663e-05 -2.37309331e-04 -1.35576122e-04 -2.66071807e-05 1.47836328e-05 8.46263429e-06 2.48764488e-05 4.23131714e-05 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -9.81340007e-05 -4.90670003e-05 3.95156129e-04 2.44599361e-04 1.22299680e-04 -2.59797738e-05 3.38595206e-05 1.69297603e-05 3.69220468e-05 4.92293958e-05 -2.43510507e-06 -2.56801146e-05 -2.82105641e-06 -1.30098686e-05 -7.80592115e-06 9.57494961e-06 4.43453012e-05 2.66071807e-05 3.61548803e-06 -1.99797541e-06 -1.19878524e-06 -3.12952049e-06 -5.86785091e-06 1.04571251e-04 6.59048991e-04 8.08681204e-05 3.07748924e-04 1.78209909e-04 -1.77416518e-04 -8.27434268e-04 -4.92484006e-04 3.38595206e-05 -1.08000471e-04 -5.38872760e-05 -7.63940131e-05 -9.44638495e-05 1.31803928e-06 1.38997698e-05 8.15449649e-07 7.11294712e-06 4.34366074e-06 -2.89015053e-06 -2.42318426e-05 -1.47836328e-05 -1.99797541e-06 9.59219321e-07 5.71522584e-07 1.69390265e-06 3.20700306e-06 5.22856257e-05 3.29524496e-04 4.04340602e-05 1.78209909e-04 4.04340602e-05 -8.87082588e-05 -4.92484006e-04 -8.87082588e-05 1.69297603e-05 -5.38872760e-05 -2.71695573e-05 -2.93232050e-05 -5.38872760e-05 7.90823570e-07 8.33986187e-06 4.89269790e-07 4.34366074e-06 2.47970899e-06 -1.73409032e-06 -1.47836328e-05 -8.46263429e-06 -1.19878524e-06 5.71522584e-07 3.49595231e-07 1.04545744e-06 1.90867338e-06 7.84284385e-05 4.94286743e-04 1.33657432e-04 1.69973075e-04 1.82328327e-04 -3.69363005e-04 -4.23658521e-04 -5.26896749e-04 3.69220468e-05 -7.63940131e-05 -2.93232050e-05 -6.86136812e-05 -6.75202116e-05 2.10886285e-06 2.22396317e-05 2.31661906e-06 1.09506581e-05 7.32931955e-06 -7.88460418e-06 -3.73852938e-05 -2.48764488e-05 -3.12952049e-06 1.69390265e-06 1.04545744e-06 2.59560990e-06 5.15449757e-06 1.04571251e-04 6.59048991e-04 1.78209909e-04 3.07748924e-04 8.08681204e-05 -4.92484006e-04 -8.27434268e-04 -1.77416518e-04 4.92293958e-05 -9.44638495e-05 -5.38872760e-05 -6.75202116e-05 -1.08000471e-04 3.95411785e-06 4.16993094e-05 4.34366074e-06 2.13388414e-05 1.23985450e-05 -1.47836328e-05 -7.26955279e-05 -4.23131714e-05 -5.86785091e-06 3.20700306e-06 1.90867338e-06 5.15449757e-06 9.51122747e-06 9.03813139e-04 6.83095219e-03 2.52992999e-03 2.52992999e-03 8.43309998e-04 -7.57080511e-03 -7.57080511e-03 -2.52360170e-03 5.05224374e-05 1.96891714e-04 6.56305714e-05 8.75074285e-05 6.56305714e-05 1.70328256e-04 1.56710856e-03 3.25689024e-04 6.51378048e-04 3.25689024e-04 -1.06639054e-03 -2.13278108e-03 -1.06639054e-03 -4.52806801e-05 1.04571251e-04 5.22856257e-05 7.84284385e-05 1.04571251e-04 6.83095219e-03 4.49022829e-02 1.71775766e-02 1.71775766e-02 5.72585887e-03 -4.75796841e-02 -4.75796841e-02 -1.58598947e-02 -5.20652809e-04 -2.02904352e-03 -6.76347839e-04 -9.01797119e-04 -6.76347839e-04 1.56710856e-03 1.39613919e-02 2.89608434e-03 5.79216869e-03 2.89608434e-03 -9.35225951e-03 -1.87045190e-02 -9.35225951e-03 -2.85376584e-04 6.59048991e-04 3.29524496e-04 4.94286743e-04 6.59048991e-04 -2.52992999e-03 -1.71775766e-02 -5.92699644e-03 -7.14718976e-03 -2.38239659e-03 1.66087992e-02 2.03525482e-02 6.78418274e-03 2.12097053e-04 3.76334544e-04 1.25444848e-04 1.10087490e-04 8.25656177e-05 -3.25689024e-04 -2.89608434e-03 -4.14019247e-04 -1.28527532e-03 -6.42637659e-04 1.31106178e-03 4.15611128e-03 2.07805564e-03 1.33367462e-04 -8.08681204e-05 -4.04340602e-05 -1.33657432e-04 -1.78209909e-04 -2.52992999e-03 -1.71775766e-02 -7.14718976e-03 -5.92699644e-03 -2.38239659e-03 2.03525482e-02 1.66087992e-02 6.78418274e-03 -1.07099635e-05 3.76334544e-04 8.25656177e-05 2.38725181e-04 1.25444848e-04 -6.51378048e-04 -5.79216869e-03 -1.28527532e-03 -2.34193222e-03 -1.28527532e-03 4.15611128e-03 7.54522870e-03 4.15611128e-03 9.81340007e-05 -3.07748924e-04 -1.78209909e-04 -1.69973075e-04 -3.07748924e-04 -8.43309998e-04 -5.72585887e-03 -2.38239659e-03 -2.38239659e-03 4.26061120e-04 6.78418274e-03 6.78418274e-03 -1.48235482e-03 -3.56998782e-06 8.25656177e-05 1.56159564e-04 -6.18340029e-06 1.56159564e-04 -3.25689024e-04 -2.89608434e-03 -6.42637659e-04 -1.28527532e-03 -4.14019247e-04 2.07805564e-03 4.15611128e-03 1.31106178e-03 4.90670003e-05 -1.78209909e-04 -4.04340602e-05 -1.82328327e-04 -8.08681204e-05 7.57080511e-03 4.75796841e-02 1.66087992e-02 2.03525482e-02 6.78418274e-03 -4.42337068e-02 -5.55393321e-02 -1.85131107e-02 -9.60604637e-04 -3.07040317e-03 -1.02346772e-03 -1.27914009e-03 -9.59355067e-04 1.06639054e-03 9.35225951e-03 1.31106178e-03 4.15611128e-03 2.07805564e-03 -4.10981523e-03 -1.33621179e-02 -6.68105894e-03 -3.95156129e-04 1.77416518e-04 8.87082588e-05 3.69363005e-04 4.92484006e-04 7.57080511e-03 4.75796841e-02 2.03525482e-02 1.66087992e-02 6.78418274e-03 -5.55393321e-02 -4.42337068e-02 -1.85131107e-02 -6.27465494e-04 -3.07040317e-03 -9.59355067e-04 -1.47147806e-03 -1.02346772e-03 2.13278108e-03 1.87045190e-02 4.15611128e-03 7.54522870e-03 4.15611128e-03 -1.33621179e-02 -2.41529920e-02 -1.33621179e-02 -2.44599361e-04 8.27434268e-04 4.92484006e-04 4.23658521e-04 8.27434268e-04 2.52360170e-03 1.58598947e-02 6.78418274e-03 6.78418274e-03 -1.48235482e-03 -1.85131107e-02 -1.85131107e-02 5.13458842e-03 -2.09155165e-04 -9.59355067e-04 -5.12122996e-04 -3.62267372e-04 -5.12122996e-04 1.06639054e-03 9.35225951e-03 2.07805564e-03 4.15611128e-03 1.31106178e-03 -6.68105894e-03 -1.33621179e-02 -4.10981523e-03 -1.22299680e-04 4.92484006e-04 8.87082588e-05 5.26896749e-04 1.77416518e-04 5.05224374e-05 -5.20652809e-04 -2.12097053e-04 1.07099635e-05 3.56998782e-06 9.60604637e-04 6.27465494e-04 2.09155165e-04 1.78917197e-04 -3.48805533e-04 -1.16268511e-04 -2.92334169e-04 -2.19250627e-04 -4.52806801e-05 -2.85376584e-04 -1.33367462e-04 -9.81340007e-05 -4.90670003e-05 3.95156129e-04 2.44599361e-04 1.22299680e-04 -2.59797738e-05 3.38595206e-05 1.69297603e-05 3.69220468e-05 4.92293958e-05 1.96891714e-04 -2.02904352e-03 -3.76334544e-04 -3.76334544e-04 -8.25656177e-05 3.07040317e-03 3.07040317e-03 9.59355067e-04 -3.48805533e-04 -1.41297171e-03 -5.27432619e-04 -6.04148906e-04 -5.27432619e-04 1.04571251e-04 6.59048991e-04 8.08681204e-05 3.07748924e-04 1.78209909e-04 -1.77416518e-04 -8.27434268e-04 -4.92484006e-04 3.38595206e-05 -1.08000471e-04 -5.38872760e-05 -7.63940131e-05 -9.44638495e-05 6.56305714e-05 -6.76347839e-04 -1.25444848e-04 -8.25656177e-05 -1.56159564e-04 1.02346772e-03 9.59355067e-04 5.12122996e-04 -1.16268511e-04 -5.27432619e-04 -6.48472168e-06 -3.20296473e-04 -1.72595341e-05 5.22856257e-05 3.29524496e-04 4.04340602e-05 1.78209909e-04 4.04340602e-05 -8.87082588e-05 -4.92484006e-04 -8.87082588e-05 1.69297603e-05 -5.38872760e-05 -2.71695573e-05 -2.93232050e-05 -5.38872760e-05 8.75074285e-05 -9.01797119e-04 -1.10087490e-04 -2.38725181e-04 6.18340029e-06 1.27914009e-03 1.47147806e-03 3.62267372e-04 -2.92334169e-04 -6.04148906e-04 -3.20296473e-04 -1.58641225e-04 -2.60839721e-04 7.84284385e-05 4.94286743e-04 1.33657432e-04 1.69973075e-04 1.82328327e-04 -3.69363005e-04 -4.23658521e-04 -5.26896749e-04 3.69220468e-05 -7.63940131e-05 -2.93232050e-05 -6.86136812e-05 -6.75202116e-05 6.56305714e-05 -6.76347839e-04 -8.25656177e-05 -1.25444848e-04 -1.56159564e-04 9.59355067e-04 1.02346772e-03 5.12122996e-04 -2.19250627e-04 -5.27432619e-04 -1.72595341e-05 -2.60839721e-04 -6.48472168e-06 1.04571251e-04 6.59048991e-04 1.78209909e-04 3.07748924e-04 8.08681204e-05 -4.92484006e-04 -8.27434268e-04 -1.77416518e-04 4.92293958e-05 -9.44638495e-05 -5.38872760e-05 -6.75202116e-05 -1.08000471e-04 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 0 26 52 78 104 130 156 182 208 234 260 286 312 338 364 390 416 442 468 494 520 546 572 598 624 650 676 -2 0 0 335 - 8.23315696e-06 9.02495943e-05 3.30136560e-05 3.30136560e-05 -1.15322826e-04 -1.15322826e-04 -1.30101956e-05 2.25343198e-05 9.02495943e-05 9.91070319e-04 3.61844250e-04 3.61844250e-04 -1.26431932e-03 -1.26431932e-03 -1.44682422e-04 2.50597306e-04 6.96094992e-06 -2.39796963e-05 5.18708531e-06 5.18708531e-06 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 5.06876205e-05 5.18708531e-06 -8.77935341e-05 -3.30136560e-05 -3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 5.06876205e-05 -5.18708531e-06 -8.77935341e-05 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 -1.79871070e-05 1.15322826e-04 1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 -1.78648211e-04 -1.79871070e-05 3.09427778e-04 1.15322826e-04 1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 -1.78648211e-04 1.79871070e-05 3.09427778e-04 -1.30101956e-05 -1.44682422e-04 -5.06876205e-05 -5.06876205e-05 1.78648211e-04 1.78648211e-04 2.10894554e-05 -3.62362512e-05 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 -4.26298824e-06 -5.18708531e-06 1.79871070e-05 -4.26298824e-06 -4.09454220e-06 -5.18708531e-06 5.18708531e-06 1.79871070e-05 -1.79871070e-05 -8.35753044e-06 2.25343198e-05 2.50597306e-04 8.77935341e-05 8.77935341e-05 -3.09427778e-04 -3.09427778e-04 -3.62362512e-05 6.29314743e-05 9.03813139e-04 6.83095219e-03 8.43309998e-04 2.52992999e-03 2.52992999e-03 -2.52360170e-03 -7.57080511e-03 -7.57080511e-03 -1.01044875e-04 6.56305714e-05 6.56305714e-05 1.96891714e-04 8.23315696e-06 9.02495943e-05 3.30136560e-05 3.30136560e-05 -1.15322826e-04 -1.15322826e-04 -1.30101956e-05 2.25343198e-05 6.83095219e-03 4.49022829e-02 5.72585887e-03 1.71775766e-02 1.71775766e-02 -1.58598947e-02 -4.75796841e-02 -4.75796841e-02 1.04130562e-03 -6.76347839e-04 -6.76347839e-04 -2.02904352e-03 9.02495943e-05 9.91070319e-04 3.61844250e-04 3.61844250e-04 -1.26431932e-03 -1.26431932e-03 -1.44682422e-04 2.50597306e-04 -8.43309998e-04 -5.72585887e-03 4.26061120e-04 -2.38239659e-03 -2.38239659e-03 -1.48235482e-03 6.78418274e-03 6.78418274e-03 7.13997564e-06 1.56159564e-04 1.56159564e-04 8.25656177e-05 6.96094992e-06 -2.39796963e-05 5.18708531e-06 5.18708531e-06 -2.52992999e-03 -1.71775766e-02 -2.38239659e-03 -5.92699644e-03 -7.14718976e-03 6.78418274e-03 1.66087992e-02 2.03525482e-02 -2.01387090e-04 1.25444848e-04 8.25656177e-05 1.28637691e-04 3.76334544e-04 -3.30136560e-05 -3.61844250e-04 -1.27752976e-04 -1.34713926e-04 4.47551295e-04 4.71530992e-04 5.06876205e-05 5.18708531e-06 -8.77935341e-05 -2.52992999e-03 -1.71775766e-02 -2.38239659e-03 -7.14718976e-03 -5.92699644e-03 6.78418274e-03 2.03525482e-02 1.66087992e-02 -2.01387090e-04 8.25656177e-05 1.25444848e-04 -1.28637691e-04 3.76334544e-04 -3.30136560e-05 -3.61844250e-04 -1.34713926e-04 -1.27752976e-04 4.71530992e-04 4.47551295e-04 5.06876205e-05 -5.18708531e-06 -8.77935341e-05 2.52360170e-03 1.58598947e-02 -1.48235482e-03 6.78418274e-03 6.78418274e-03 5.13458842e-03 -1.85131107e-02 -1.85131107e-02 4.18310329e-04 -5.12122996e-04 -5.12122996e-04 -9.59355067e-04 -2.39796963e-05 8.25086154e-05 -1.79871070e-05 -1.79871070e-05 7.57080511e-03 4.75796841e-02 6.78418274e-03 1.66087992e-02 2.03525482e-02 -1.85131107e-02 -4.42337068e-02 -5.55393321e-02 1.58807013e-03 -1.02346772e-03 -9.59355067e-04 -1.92337974e-04 -3.07040317e-03 1.15322826e-04 1.26431932e-03 4.47551295e-04 4.71530992e-04 -1.56743151e-03 -1.64994012e-03 -1.78648211e-04 -1.79871070e-05 3.09427778e-04 7.57080511e-03 4.75796841e-02 6.78418274e-03 2.03525482e-02 1.66087992e-02 -1.85131107e-02 -5.55393321e-02 -4.42337068e-02 1.58807013e-03 -9.59355067e-04 -1.02346772e-03 1.92337974e-04 -3.07040317e-03 1.15322826e-04 1.26431932e-03 4.71530992e-04 4.47551295e-04 -1.64994012e-03 -1.56743151e-03 -1.78648211e-04 1.79871070e-05 3.09427778e-04 -1.01044875e-04 1.04130562e-03 -7.13997564e-06 2.01387090e-04 2.01387090e-04 -4.18310329e-04 -1.58807013e-03 -1.58807013e-03 -3.27420436e-04 3.35519138e-04 3.35519138e-04 6.97611067e-04 -1.30101956e-05 -1.44682422e-04 -5.06876205e-05 -5.06876205e-05 1.78648211e-04 1.78648211e-04 2.10894554e-05 -3.62362512e-05 6.56305714e-05 -6.76347839e-04 -1.56159564e-04 -1.25444848e-04 -8.25656177e-05 5.12122996e-04 1.02346772e-03 9.59355067e-04 3.35519138e-04 -6.48472168e-06 -1.72595341e-05 5.94567521e-05 -5.27432619e-04 -5.18708531e-06 1.79871070e-05 -4.09454220e-06 -4.26298824e-06 6.56305714e-05 -6.76347839e-04 -1.56159564e-04 -8.25656177e-05 -1.25444848e-04 5.12122996e-04 9.59355067e-04 1.02346772e-03 3.35519138e-04 -1.72595341e-05 -6.48472168e-06 -5.94567521e-05 -5.27432619e-04 -5.18708531e-06 1.79871070e-05 -4.26298824e-06 -4.09454220e-06 -1.28637691e-04 1.28637691e-04 1.92337974e-04 -1.92337974e-04 5.94567521e-05 -5.94567521e-05 3.47696408e-04 -5.18708531e-06 5.18708531e-06 1.79871070e-05 -1.79871070e-05 -8.35753044e-06 1.96891714e-04 -2.02904352e-03 -8.25656177e-05 -3.76334544e-04 -3.76334544e-04 9.59355067e-04 3.07040317e-03 3.07040317e-03 6.97611067e-04 -5.27432619e-04 -5.27432619e-04 -1.41297171e-03 2.25343198e-05 2.50597306e-04 8.77935341e-05 8.77935341e-05 -3.09427778e-04 -3.09427778e-04 -3.62362512e-05 6.29314743e-05 - 0 1 3 4 6 7 8 12 0 1 3 4 6 7 8 12 2 5 9 10 0 1 3 4 6 7 8 11 12 0 1 3 4 6 7 8 11 12 2 5 9 10 0 1 3 4 6 7 8 11 12 0 1 3 4 6 7 8 11 12 0 1 3 4 6 7 8 12 2 5 9 10 2 5 9 10 3 4 6 7 11 0 1 3 4 6 7 8 12 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 20 21 24 25 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 0 1 2 3 4 5 6 7 8 9 10 11 12 15 18 22 23 3 4 6 7 9 10 11 16 17 19 20 24 0 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 19 20 21 25 - 0 8 16 20 29 38 42 51 60 68 72 76 81 89 109 129 145 167 189 205 227 249 269 286 303 315 335 -2 0 1 169 - 1.25466617e-06 1.34349826e-05 -1.31792447e-06 3.95377341e-06 6.58962236e-06 4.39772254e-06 -1.31931676e-05 -2.19886127e-05 -2.43510507e-06 -7.90823570e-07 -1.31803928e-06 -2.10886285e-06 3.95411785e-06 1.34349826e-05 1.43209127e-04 -1.42696266e-05 4.28088798e-05 7.13481329e-05 4.75690104e-05 -1.42707031e-04 -2.37845052e-04 -2.56801146e-05 -8.33986187e-06 -1.38997698e-05 -2.22396317e-05 4.16993094e-05 1.31792447e-06 1.42696266e-05 -7.59910514e-07 4.22604181e-06 7.04340302e-06 2.62355898e-06 -1.41871954e-05 -2.36453257e-05 -2.82105641e-06 -4.89269790e-07 -8.15449649e-07 -2.31661906e-06 4.34366074e-06 -3.95377341e-06 -4.28088798e-05 4.22604181e-06 -1.20293553e-05 -2.11302091e-05 -1.41871954e-05 4.04560801e-05 7.09359772e-05 7.80592115e-06 2.47970899e-06 4.34366074e-06 7.32931955e-06 -1.23985450e-05 -6.58962236e-06 -7.13481329e-05 7.04340302e-06 -2.11302091e-05 -3.45682450e-05 -2.36453257e-05 7.09359772e-05 1.16121122e-04 1.30098686e-05 4.34366074e-06 7.11294712e-06 1.09506581e-05 -2.13388414e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 -1.41871954e-05 -2.36453257e-05 -9.01114524e-06 4.74618663e-05 7.91031105e-05 9.57494961e-06 1.73409032e-06 2.89015053e-06 7.88460418e-06 -1.47836328e-05 1.31931676e-05 1.42707031e-04 -1.41871954e-05 4.04560801e-05 7.09359772e-05 4.74618663e-05 -1.35576122e-04 -2.37309331e-04 -2.66071807e-05 -8.46263429e-06 -1.47836328e-05 -2.48764488e-05 4.23131714e-05 2.19886127e-05 2.37845052e-04 -2.36453257e-05 7.09359772e-05 1.16121122e-04 7.91031105e-05 -2.37309331e-04 -3.88706075e-04 -4.43453012e-05 -1.47836328e-05 -2.42318426e-05 -3.73852938e-05 7.26955279e-05 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 -7.80592115e-06 -1.30098686e-05 -9.57494961e-06 2.66071807e-05 4.43453012e-05 3.61548803e-06 1.19878524e-06 1.99797541e-06 3.12952049e-06 -5.86785091e-06 -7.90823570e-07 -8.33986187e-06 4.89269790e-07 -2.47970899e-06 -4.34366074e-06 -1.73409032e-06 8.46263429e-06 1.47836328e-05 1.19878524e-06 3.49595231e-07 5.71522584e-07 1.04545744e-06 -1.90867338e-06 -1.31803928e-06 -1.38997698e-05 8.15449649e-07 -4.34366074e-06 -7.11294712e-06 -2.89015053e-06 1.47836328e-05 2.42318426e-05 1.99797541e-06 5.71522584e-07 9.59219321e-07 1.69390265e-06 -3.20700306e-06 -2.10886285e-06 -2.22396317e-05 2.31661906e-06 -7.32931955e-06 -1.09506581e-05 -7.88460418e-06 2.48764488e-05 3.73852938e-05 3.12952049e-06 1.04545744e-06 1.69390265e-06 2.59560990e-06 -5.15449757e-06 3.95411785e-06 4.16993094e-05 -4.34366074e-06 1.23985450e-05 2.13388414e-05 1.47836328e-05 -4.23131714e-05 -7.26955279e-05 -5.86785091e-06 -1.90867338e-06 -3.20700306e-06 -5.15449757e-06 9.51122747e-06 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -2 1 -2 169 - 1.25466617e-06 1.34349826e-05 3.95377341e-06 6.58962236e-06 -1.31792447e-06 -1.31931676e-05 -2.19886127e-05 4.39772254e-06 -6.08776268e-07 3.95411785e-06 -7.90823570e-07 3.16329428e-06 -1.31803928e-06 1.34349826e-05 1.43209127e-04 4.28088798e-05 7.13481329e-05 -1.42696266e-05 -1.42707031e-04 -2.37845052e-04 4.75690104e-05 -6.42002866e-06 4.16993094e-05 -8.33986187e-06 3.33594475e-05 -1.38997698e-05 -3.95377341e-06 -4.28088798e-05 -1.20293553e-05 -2.11302091e-05 4.22604181e-06 4.04560801e-05 7.09359772e-05 -1.41871954e-05 2.44441635e-06 -1.23985450e-05 2.47970899e-06 -1.04247858e-05 4.34366074e-06 -6.58962236e-06 -7.13481329e-05 -2.11302091e-05 -3.45682450e-05 7.04340302e-06 7.09359772e-05 1.16121122e-04 -2.36453257e-05 2.97861377e-06 -2.13388414e-05 4.34366074e-06 -1.67422057e-05 7.11294712e-06 1.31792447e-06 1.42696266e-05 4.22604181e-06 7.04340302e-06 -7.59910514e-07 -1.41871954e-05 -2.36453257e-05 2.62355898e-06 -5.95722755e-07 4.34366074e-06 -4.89269790e-07 3.60141605e-06 -8.15449649e-07 1.31931676e-05 1.42707031e-04 4.04560801e-05 7.09359772e-05 -1.41871954e-05 -1.35576122e-04 -2.37309331e-04 4.74618663e-05 -8.24004626e-06 4.23131714e-05 -8.46263429e-06 3.54807188e-05 -1.47836328e-05 2.19886127e-05 2.37845052e-04 7.09359772e-05 1.16121122e-04 -2.36453257e-05 -2.37309331e-04 -3.88706075e-04 7.91031105e-05 -1.02039636e-05 7.26955279e-05 -1.47836328e-05 5.70968043e-05 -2.42318426e-05 -4.39772254e-06 -4.75690104e-05 -1.41871954e-05 -2.36453257e-05 2.62355898e-06 4.74618663e-05 7.91031105e-05 -9.01114524e-06 2.04079272e-06 -1.47836328e-05 1.73409032e-06 -1.22344517e-05 2.89015053e-06 -6.08776268e-07 -6.42002866e-06 -2.44441635e-06 -2.97861377e-06 5.95722755e-07 8.24004626e-06 1.02039636e-05 -2.04079272e-06 1.40335193e-07 -1.53000038e-06 3.06000076e-07 -1.12314006e-06 4.67975025e-07 3.95411785e-06 4.16993094e-05 1.23985450e-05 2.13388414e-05 -4.34366074e-06 -4.23131714e-05 -7.26955279e-05 1.47836328e-05 -1.53000038e-06 9.51122747e-06 -1.90867338e-06 7.65895674e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 -2.47970899e-06 -4.34366074e-06 4.89269790e-07 8.46263429e-06 1.47836328e-05 -1.73409032e-06 3.06000076e-07 -1.90867338e-06 3.49595231e-07 -1.56090719e-06 5.71522584e-07 3.16329428e-06 3.33594475e-05 1.04247858e-05 1.67422057e-05 -3.60141605e-06 -3.54807188e-05 -5.70968043e-05 1.22344517e-05 -1.12314006e-06 7.65895674e-06 -1.56090719e-06 6.07076274e-06 -2.57724878e-06 -1.31803928e-06 -1.38997698e-05 -4.34366074e-06 -7.11294712e-06 8.15449649e-07 1.47836328e-05 2.42318426e-05 -2.89015053e-06 4.67975025e-07 -3.20700306e-06 5.71522584e-07 -2.57724878e-06 9.59219321e-07 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -2 1 -1 169 - 6.09103871e-05 6.14453477e-04 5.91853803e-05 2.95926902e-04 5.91853803e-05 -2.01724529e-04 -1.00862265e-03 -2.01724529e-04 -4.78869050e-05 3.45593969e-05 6.91187938e-06 8.29425526e-05 3.45593969e-05 6.14453477e-04 6.16334179e-03 5.89280869e-04 2.94640435e-03 5.89280869e-04 -2.00665301e-03 -1.00332651e-02 -2.00665301e-03 -4.47447198e-04 3.22917201e-04 6.45834401e-05 7.75001281e-04 3.22917201e-04 -5.91853803e-05 -5.89280869e-04 1.57901181e-05 -2.96993437e-04 -5.93986875e-05 -5.79546830e-05 1.00862453e-03 2.01724907e-04 5.99184710e-05 1.92003453e-05 3.84006907e-06 -8.23728840e-05 -3.43220350e-05 -2.95926902e-04 -2.94640435e-03 -2.96993437e-04 -1.40977838e-03 -2.96993437e-04 1.00862453e-03 4.78344308e-03 1.00862453e-03 2.06888873e-04 -1.60905699e-04 -3.43220350e-05 -3.58342040e-04 -1.60905699e-04 -5.91853803e-05 -5.89280869e-04 -5.93986875e-05 -2.96993437e-04 1.57901181e-05 2.01724907e-04 1.00862453e-03 -5.79546830e-05 4.13777746e-05 -3.43220350e-05 3.84006907e-06 -9.30773600e-05 1.92003453e-05 2.01724529e-04 2.00665301e-03 -5.79546830e-05 1.00862453e-03 2.01724907e-04 2.12351688e-04 -3.42697221e-03 -6.85394441e-04 -2.00592339e-04 -7.04983673e-05 -1.40996735e-05 2.73631522e-04 1.14013134e-04 1.00862265e-03 1.00332651e-02 1.00862453e-03 4.78344308e-03 1.00862453e-03 -3.42697221e-03 -1.62371149e-02 -3.42697221e-03 -6.83378401e-04 5.33163371e-04 1.14013134e-04 1.18364611e-03 5.33163371e-04 2.01724529e-04 2.00665301e-03 2.01724907e-04 1.00862453e-03 -5.79546830e-05 -6.85394441e-04 -3.42697221e-03 2.12351688e-04 -1.36675680e-04 1.14013134e-04 -1.40996735e-05 3.10533823e-04 -7.04983673e-05 -4.78869050e-05 -4.47447198e-04 -5.99184710e-05 -2.06888873e-04 -4.13777746e-05 2.00592339e-04 6.83378401e-04 1.36675680e-04 1.53794146e-05 -2.33774382e-05 -4.67548763e-06 -2.78902609e-05 -1.16209420e-05 3.45593969e-05 3.22917201e-04 -1.92003453e-05 1.60905699e-04 3.43220350e-05 7.04983673e-05 -5.33163371e-04 -1.14013134e-04 -2.33774382e-05 -1.92605535e-05 -3.97900833e-06 2.69156783e-05 1.26855161e-05 6.91187938e-06 6.45834401e-05 -3.84006907e-06 3.43220350e-05 -3.84006907e-06 1.40996735e-05 -1.14013134e-04 1.40996735e-05 -4.67548763e-06 -3.97900833e-06 -1.61313514e-07 8.09818213e-06 -3.97900833e-06 8.29425526e-05 7.75001281e-04 8.23728840e-05 3.58342040e-04 9.30773600e-05 -2.73631522e-04 -1.18364611e-03 -3.10533823e-04 -2.78902609e-05 2.69156783e-05 8.09818213e-06 4.75843139e-05 3.37032945e-05 3.45593969e-05 3.22917201e-04 3.43220350e-05 1.60905699e-04 -1.92003453e-05 -1.14013134e-04 -5.33163371e-04 7.04983673e-05 -1.16209420e-05 1.26855161e-05 -3.97900833e-06 3.37032945e-05 -1.92605535e-05 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 -2 1 0 169 - 1.25466617e-06 1.34349826e-05 -1.31792447e-06 6.58962236e-06 3.95377341e-06 4.39772254e-06 -2.19886127e-05 -1.31931676e-05 -2.43510507e-06 -1.31803928e-06 -7.90823570e-07 2.10886285e-06 3.95411785e-06 1.34349826e-05 1.43209127e-04 -1.42696266e-05 7.13481329e-05 4.28088798e-05 4.75690104e-05 -2.37845052e-04 -1.42707031e-04 -2.56801146e-05 -1.38997698e-05 -8.33986187e-06 2.22396317e-05 4.16993094e-05 1.31792447e-06 1.42696266e-05 -7.59910514e-07 7.04340302e-06 4.22604181e-06 2.62355898e-06 -2.36453257e-05 -1.41871954e-05 -2.82105641e-06 -8.15449649e-07 -4.89269790e-07 2.31661906e-06 4.34366074e-06 -6.58962236e-06 -7.13481329e-05 7.04340302e-06 -3.45682450e-05 -2.11302091e-05 -2.36453257e-05 1.16121122e-04 7.09359772e-05 1.30098686e-05 7.11294712e-06 4.34366074e-06 -1.09506581e-05 -2.13388414e-05 -3.95377341e-06 -4.28088798e-05 4.22604181e-06 -2.11302091e-05 -1.20293553e-05 -1.41871954e-05 7.09359772e-05 4.04560801e-05 7.80592115e-06 4.34366074e-06 2.47970899e-06 -7.32931955e-06 -1.23985450e-05 -4.39772254e-06 -4.75690104e-05 2.62355898e-06 -2.36453257e-05 -1.41871954e-05 -9.01114524e-06 7.91031105e-05 4.74618663e-05 9.57494961e-06 2.89015053e-06 1.73409032e-06 -7.88460418e-06 -1.47836328e-05 2.19886127e-05 2.37845052e-04 -2.36453257e-05 1.16121122e-04 7.09359772e-05 7.91031105e-05 -3.88706075e-04 -2.37309331e-04 -4.43453012e-05 -2.42318426e-05 -1.47836328e-05 3.73852938e-05 7.26955279e-05 1.31931676e-05 1.42707031e-04 -1.41871954e-05 7.09359772e-05 4.04560801e-05 4.74618663e-05 -2.37309331e-04 -1.35576122e-04 -2.66071807e-05 -1.47836328e-05 -8.46263429e-06 2.48764488e-05 4.23131714e-05 -2.43510507e-06 -2.56801146e-05 2.82105641e-06 -1.30098686e-05 -7.80592115e-06 -9.57494961e-06 4.43453012e-05 2.66071807e-05 3.61548803e-06 1.99797541e-06 1.19878524e-06 -3.12952049e-06 -5.86785091e-06 -1.31803928e-06 -1.38997698e-05 8.15449649e-07 -7.11294712e-06 -4.34366074e-06 -2.89015053e-06 2.42318426e-05 1.47836328e-05 1.99797541e-06 9.59219321e-07 5.71522584e-07 -1.69390265e-06 -3.20700306e-06 -7.90823570e-07 -8.33986187e-06 4.89269790e-07 -4.34366074e-06 -2.47970899e-06 -1.73409032e-06 1.47836328e-05 8.46263429e-06 1.19878524e-06 5.71522584e-07 3.49595231e-07 -1.04545744e-06 -1.90867338e-06 2.10886285e-06 2.22396317e-05 -2.31661906e-06 1.09506581e-05 7.32931955e-06 7.88460418e-06 -3.73852938e-05 -2.48764488e-05 -3.12952049e-06 -1.69390265e-06 -1.04545744e-06 2.59560990e-06 5.15449757e-06 3.95411785e-06 4.16993094e-05 -4.34366074e-06 2.13388414e-05 1.23985450e-05 1.47836328e-05 -7.26955279e-05 -4.23131714e-05 -5.86785091e-06 -3.20700306e-06 -1.90867338e-06 5.15449757e-06 9.51122747e-06 - 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 26 39 52 65 78 91 104 117 130 143 156 169 diff --git a/source/module_hamilt_lcao/module_hcontainer/test/test_func_folding.cpp b/source/module_hamilt_lcao/module_hcontainer/test/test_func_folding.cpp deleted file mode 100644 index fa3499775b..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/test_func_folding.cpp +++ /dev/null @@ -1,213 +0,0 @@ -#include "gtest/gtest.h" -#include "../hcontainer_funcs.h" -#include "../hcontainer.h" -#include -#ifdef _OPENMP -#include -#endif - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 10; -int test_nw = 30; - -/** - * Unit test of folding_HR function - * folding_HR is a function to calculate the Hk matrix with specific k vector - * in this test, we test the correctness and time consuming of the function. -*/ -class FoldingTest : public ::testing::Test -{ - protected: - void SetUp() override - { - // set up a unitcell, with one element and three atoms, each atom has 2 orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - } - ucell.atoms[0].nw = test_nw; - } - - void TearDown() override - { - delete[] ucell.atoms; - } - - UnitCell ucell; -}; - -// using TEST_F to test folding_HR with complex HR and complex hk -TEST_F(FoldingTest, folding_HR_cd2cd) -{ - hamilt::HContainer>* HR; - // set up a HContainer with ucell - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - HR = new hamilt::HContainer>(ucell); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - srand((unsigned)time(NULL)); - // fill HR with constant value -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < HR->size_atom_pairs(); i++) - { - std::complex* ptr1 = HR->get_atom_pair(i).get_HR_values(1, 1, 1).get_pointer(); - std::complex* ptr = HR->get_atom_pair(i).get_HR_values(0,0,0).get_pointer(); - for (int j = 0; j < HR->get_atom_pair(i).get_size(); j++) - { - ptr[j] = std::complex(1.0, 1.0); - ptr1[j] = std::complex(2.0, 2.0); - } - } - std::vector> hk(test_size * test_nw * test_size * test_nw, std::complex(0.0, 0.0)); - //std::cout<<"memory of hk: "<)/1024.0/1024.0<<" MB"<get_memory_size() /1024.0/1024.0 <<" MB"<get_memory_size()) /sizeof(std::complex)/ hk.size() / 2< kvec_d_in(0.1, 0.2, 0.3); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::folding_HR(*HR, hk.data(), kvec_d_in, test_size * test_nw, 0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time = std::chrono::duration_cast>(end_time - start_time); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < test_size * test_nw * test_size * test_nw; i++) - { - EXPECT_NEAR(hk[i].real(), 0.55753651583505226, 1e-10); - EXPECT_NEAR(hk[i].imag(), -1.7936044933348412, 1e-10); - //std::cout<<__FILE__<<__LINE__<<" hk["< hk -TEST_F(FoldingTest, folding_HR_d2cd) -{ - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - hamilt::HContainer* HR; - // set up a HContainer with ucell - HR = new hamilt::HContainer(ucell); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - - srand((unsigned)time(NULL)); - // fill HR with constant value -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < HR->size_atom_pairs(); i++) - { - double* ptr1 = HR->get_atom_pair(i).get_HR_values(1, 1, 1).get_pointer(); - double* ptr = HR->get_atom_pair(i).get_HR_values(0,0,0).get_pointer(); - for (int j = 0; j < HR->get_atom_pair(i).get_size(); j++) - { - ptr[j] = double(1.0); - ptr1[j] = double(2.0); - } - } - std::vector> hk(test_size * test_nw * test_size * test_nw, std::complex(0.0, 0.0)); - //std::cout<<"memory of hk: "<)/1024.0/1024.0<<" MB"<get_memory_size() /1024.0/1024.0 <<" MB"<get_memory_size()) /sizeof(std::complex)/ hk.size() / 2< kvec_d_in(0.1, 0.2, 0.3); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::folding_HR(*HR, hk.data(), kvec_d_in, test_size * test_nw, 0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time = std::chrono::duration_cast>(end_time - start_time); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < test_size * test_nw * test_size * test_nw; i++) - { - EXPECT_NEAR(hk[i].real(), -0.61803398874989446, 1e-10); - EXPECT_NEAR(hk[i].imag(), -1.1755705045849467, 1e-10); - //std::cout<<__FILE__<<__LINE__<<" hk["<(0.0, 0.0)); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::folding_HR(*HR, hk.data(), kvec_d_in, test_size * test_nw, 1); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 = std::chrono::duration_cast>(end_time - start_time); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < test_size * test_nw * test_size * test_nw; i++) - { - EXPECT_NEAR(hk[i].real(), -0.61803398874989446, 1e-10); - EXPECT_NEAR(hk[i].imag(), -1.1755705045849467, 1e-10); - //std::cout<<__FILE__<<__LINE__<<" hk["<* HR; - // set up a HContainer with ucell - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - HR = new hamilt::HContainer(ucell); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - - srand((unsigned)time(NULL)); - // fill HR with constant value -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < HR->size_atom_pairs(); i++) - { - double* ptr1 = HR->get_atom_pair(i).get_HR_values(1, 1, 1).get_pointer(); - double* ptr = HR->get_atom_pair(i).get_HR_values(0,0,0).get_pointer(); - for (int j = 0; j < HR->get_atom_pair(i).get_size(); j++) - { - ptr[j] = double(1.0); - ptr1[j] = double(2.0); - } - } - start_time = std::chrono::high_resolution_clock::now(); - HR->fix_gamma(); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration fix_gamma_time = std::chrono::duration_cast>(end_time - start_time); - std::vector hk(test_size * test_nw * test_size * test_nw, double(0.0)); - //std::cout<<"memory of hk: "<get_memory_size() /1024.0/1024.0 <<" MB"<get_memory_size()) /sizeof(double)/ hk.size()< kvec_d_in(0.1, 0.2, 0.3); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::folding_HR(*HR, hk.data(), kvec_d_in, test_size * test_nw, 0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time = std::chrono::duration_cast>(end_time - start_time); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < test_size * test_nw * test_size * test_nw; i++) - { - EXPECT_NEAR(hk[i], 3.0, 1e-10); - //std::cout<<__FILE__<<__LINE__<<" hk["<(0.0, 0.0, 0.0); - // collumn-major hk - start_time = std::chrono::high_resolution_clock::now(); - hamilt::folding_HR(*HR, hk.data(), kvec_d_in, test_size * test_nw, 1); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 = std::chrono::duration_cast>(end_time - start_time); - for (int i = 0; i < test_size * test_nw * test_size * test_nw; i++) - { - EXPECT_NEAR(hk[i], 6.0, 1e-10); - //std::cout<<__FILE__<<__LINE__<<" hk["<(ucell); - } - - void TearDown() override - { - delete HR; - delete[] ucell.atoms; - } - - UnitCell ucell; - hamilt::HContainer* HR; -}; - -// using TEST_F to test HContainer::insert_pair -TEST_F(HContainerTest, insert_pair) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_i(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_j(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_col_size(), 2); - // set up a hamilt::AtomPair - hamilt::AtomPair atom_ij(0, 3); - atom_ij.set_size(2, 2); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - // check if atom_ij is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 10); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_i(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_j(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_col_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_j(), 3); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_col_size(), 2); - // insert atom_ij again - HR->insert_pair(atom_ij); - // check if atom_ij is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 10); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_j(), 3); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_col_size(), 2); - // set up another hamilt::AtomPair - hamilt::AtomPair atom_kl(1, 0); - atom_kl.set_size(2, 2); - double tmp_array[4] = {1, 2, 3, 4}; - atom_kl.get_HR_values(1, 0, 0).add_array(&tmp_array[0]); - // insert atom_kl into HR - HR->insert_pair(atom_kl); - // check if atom_kl is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 10); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_i(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_j(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_col_size(), 2); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_atom_i(), 1); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_col_size(), 2); - // check if data is correct - double* data_ptr = HR->get_atom_pair(1, 0).get_HR_values(1, 0, 0).get_pointer(); - EXPECT_EQ(data_ptr[0], 1); - EXPECT_EQ(data_ptr[1], 2); - EXPECT_EQ(data_ptr[2], 3); - EXPECT_EQ(data_ptr[3], 4); - - // test copy constructor for HContainer - hamilt::HContainer HR_copy(*HR); - // test move constructor for HContainer - hamilt::HContainer HR_move(std::move(HR_copy)); -} - -// using TEST_F to test HContainer::find_pair -TEST_F(HContainerTest, find_pair) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - // find atom_ij in HR - hamilt::AtomPair* atom_ij_ptr = HR->find_pair(0, 1); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ptr->get_atom_i(), 0); - EXPECT_EQ(atom_ij_ptr->get_atom_j(), 1); - EXPECT_EQ(atom_ij_ptr->get_row_size(), 2); - EXPECT_EQ(atom_ij_ptr->get_col_size(), 2); - // find atom_kl in HR - hamilt::AtomPair* atom_kl_ptr = HR->find_pair(1, 0); - // check if atom_kl is found - EXPECT_EQ(atom_kl_ptr->get_atom_i(), 1); - EXPECT_EQ(atom_kl_ptr->get_atom_j(), 0); - EXPECT_EQ(atom_kl_ptr->get_row_size(), 2); - EXPECT_EQ(atom_kl_ptr->get_col_size(), 2); - // find atom_ij not in HR - hamilt::AtomPair* atom_ij_ptr2 = HR->find_pair(0, 3); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ptr2, nullptr); -} - -// using TEST_F to test HContainer::get_atom_pair, both with atom_i, atom_j and with index -TEST_F(HContainerTest, get_atom_pair) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - // get atom_ij in HR - hamilt::AtomPair& atom_ij_ref = HR->get_atom_pair(0, 1); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ref.get_atom_i(), 0); - EXPECT_EQ(atom_ij_ref.get_atom_j(), 1); - EXPECT_EQ(atom_ij_ref.get_row_size(), 2); - EXPECT_EQ(atom_ij_ref.get_col_size(), 2); - // get atom_kl in HR - hamilt::AtomPair& atom_kl_ref = HR->get_atom_pair(1, 0); - // check if atom_kl is found - EXPECT_EQ(atom_kl_ref.get_atom_i(), 1); - EXPECT_EQ(atom_kl_ref.get_atom_j(), 0); - EXPECT_EQ(atom_kl_ref.get_row_size(), 2); - EXPECT_EQ(atom_kl_ref.get_col_size(), 2); - // get atom_ij in HR with index - hamilt::AtomPair& atom_ij_ref2 = HR->get_atom_pair(0); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ref2.get_atom_i(), 0); - EXPECT_EQ(atom_ij_ref2.get_atom_j(), 0); - EXPECT_EQ(atom_ij_ref2.get_row_size(), 2); - EXPECT_EQ(atom_ij_ref2.get_col_size(), 2); - // get atom_kl in HR with index - hamilt::AtomPair& atom_kl_ref2 = HR->get_atom_pair(8); - // check if atom_kl is found - EXPECT_EQ(atom_kl_ref2.get_atom_i(), 2); - EXPECT_EQ(atom_kl_ref2.get_atom_j(), 2); - EXPECT_EQ(atom_kl_ref2.get_row_size(), 2); - EXPECT_EQ(atom_kl_ref2.get_col_size(), 2); -} - -// using TEST_F to test HContainer::fix_R and unfix_R -TEST_F(HContainerTest, fix_R) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - EXPECT_EQ(HR->size_R_loop(), 1); - // fix R - EXPECT_EQ(HR->fix_R(0, 0, 0), true); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), 0); - // fix R again - EXPECT_EQ(HR->fix_R(0, 0, 0), true); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), 0); - // fix another R - EXPECT_EQ(HR->fix_R(1, 0, 0), false); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), -1); - // unfix R - HR->unfix_R(); - // check if R is unfixed - EXPECT_EQ(HR->get_current_R(), -1); -} - -// using TEST_F to test HContainer::fix_gamma -TEST_F(HContainerTest, fix_gamma) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - EXPECT_EQ(HR->size_R_loop(), 1); - hamilt::AtomPair atom_ij(0, 1); - atom_ij.set_size(2, 2); - hamilt::BaseMatrix& tmp = atom_ij.get_HR_values(1, 0, 0); - double tmp_array[4] = {1, 2, 3, 4}; - tmp.add_array(tmp_array); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - EXPECT_EQ(HR->size_R_loop(), 2); - // fix gamma - EXPECT_EQ(HR->is_gamma_only(), false); - HR->fix_gamma(); - // check if gamma is fixed - EXPECT_EQ(HR->is_gamma_only(), true); - EXPECT_EQ(HR->size_R_loop(), 1); - // fix gamma again - HR->fix_gamma(); - // check if gamma is fixed - EXPECT_EQ(HR->is_gamma_only(), true); -} - -/** - * using TEST_F to test HContainer::loop_R, - * step: 1. size_R_loop(), 2. for-loop, loop_R(), 3. fix_R(), 4. do something - */ -TEST_F(HContainerTest, loop_R) -{ - // 1. size_R_loop() - int size_for_loop_R = HR->size_R_loop(); - EXPECT_EQ(size_for_loop_R, 1); - // 2. for-loop, loop_R() - int rx, ry, rz; - for (int i = 0; i < size_for_loop_R; i++) - { - HR->loop_R(i, rx, ry, rz); - EXPECT_EQ(rx, 0); - EXPECT_EQ(ry, 0); - EXPECT_EQ(rz, 0); - HR->fix_R(rx, ry, rz); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), i); - // 4. do something - } - HR->unfix_R(); - // check if R is unfixed - EXPECT_EQ(HR->get_current_R(), -1); -} - -// using TEST_F to test HContainer::size_atom_pairs -// 1. test with R fixed -// 2. test with R unfixed -TEST_F(HContainerTest, size_atom_pairs) -{ - // get size_R_loop - int size_R_loop = HR->size_R_loop(); - EXPECT_EQ(size_R_loop, 1); - // 1. test with R fixed - // fix R - EXPECT_EQ(HR->get_current_R(), -1); - bool ok = HR->fix_R(0, 0, 0); - // check if R is fixed - EXPECT_EQ(ok, true); - EXPECT_EQ(HR->get_current_R(), 0); - // get AP size - int AP_size = HR->size_atom_pairs(); - EXPECT_EQ(AP_size, 9); - // fix to another R - hamilt::AtomPair atom_ij(0, 1); - atom_ij.set_size(2, 2); - hamilt::BaseMatrix& tmp = atom_ij.get_HR_values(1, 0, 0); - double tmp_array[4] = {1, 2, 3, 4}; - tmp.add_array(tmp_array); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - // get size_R_loop again, it should be 2 - size_R_loop = HR->size_R_loop(); - // if R is fixed, size_R_loop will not be reset, so it should be 1 - EXPECT_EQ(size_R_loop, 1); - // unfix R - HR->unfix_R(); - // check size_R_loop after R index unfixed - size_R_loop = HR->size_R_loop(); - EXPECT_EQ(size_R_loop, 2); - ok = HR->fix_R(1, 0, 0); - // check if R is fixed - EXPECT_EQ(ok, true); - EXPECT_EQ(HR->get_current_R(), 1); - EXPECT_EQ(HR->size_atom_pairs(), 1); - // check if tmp_atom_pairs is correct - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 1); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - const ModuleBase::Vector3 R_ptr = HR->get_atom_pair(0).get_R_index(); - EXPECT_EQ(R_ptr.x, 1); - EXPECT_EQ(R_ptr.y, 0); - EXPECT_EQ(R_ptr.z, 0); - EXPECT_EQ(HR->get_atom_pair(0).get_R_index(5), ModuleBase::Vector3(-1, -1, -1)); - // check if data is correct - double* data_ptr = HR->get_atom_pair(0).get_pointer(); - EXPECT_EQ(data_ptr[0], 1); - EXPECT_EQ(data_ptr[1], 2); - EXPECT_EQ(data_ptr[2], 3); - EXPECT_EQ(data_ptr[3], 4); - // 2. test with R unfixed - // unfix R - HR->unfix_R(); - // check if R is unfixed - EXPECT_EQ(HR->get_current_R(), -1); - // get AP size - AP_size = HR->size_atom_pairs(); - EXPECT_EQ(AP_size, 9); - // fix to another R with no AP - ok = HR->fix_R(2, 0, 0); - // check if R is fixed - EXPECT_EQ(ok, false); - EXPECT_EQ(HR->get_current_R(), -1); - EXPECT_EQ(HR->size_atom_pairs(), 9); -} - -// using TEST_F to test HContainer::data() -TEST_F(HContainerTest, data) -{ - // set up a hamilt::AtomPair - hamilt::AtomPair atom_ij(0, 1); - atom_ij.set_size(2, 2); - hamilt::BaseMatrix& tmp = atom_ij.get_HR_values(0, 0, 0); - double tmp_array[4] = {1, 2, 3, 4}; - tmp.add_array(tmp_array); - EXPECT_EQ(HR->size_atom_pairs(), 9); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - // check if atom_ij is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_atom_j(), 1); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_col_size(), 2); - // get data pointer - double* data_ptr = HR->data(0, 1); - // check if data pointer is correct - EXPECT_EQ(data_ptr, HR->get_atom_pair(0, 1).get_pointer()); - EXPECT_EQ(data_ptr, HR->get_atom_pair(0, 1).get_pointer(0)); - int r_index[3] = {0, 0, 0}; - EXPECT_EQ(data_ptr, HR->data(0, 1, r_index)); - EXPECT_EQ(HR->data(0, 10), nullptr); - EXPECT_EQ(HR->data(0, 10, r_index), nullptr); - // check if data is correct - EXPECT_EQ(data_ptr[0], 1); - EXPECT_EQ(data_ptr[1], 2); - EXPECT_EQ(data_ptr[2], 3); - EXPECT_EQ(data_ptr[3], 4); -} - -// using TEST_F to test functions in BaseMatrix -// 1. test constructor with existed data -// 2. test add_array with memory_type = 2 -// 3. test add_element -// 4. test get_value -TEST_F(HContainerTest, basematrix_funcs) -{ - // 1. test constructor with existed data - double data_ptr[4] = {1, 2, 3, 4}; - hamilt::BaseMatrix BM(2, 2, &data_ptr[0]); - // check if data is correct - EXPECT_EQ(BM.get_value(0, 0), 1); - EXPECT_EQ(BM.get_value(0, 1), 2); - EXPECT_EQ(BM.get_value(1, 0), 3); - EXPECT_EQ(BM.get_value(1, 1), 4); - // copy BM to check copy constructor - hamilt::BaseMatrix BM_copy(BM); - BM_copy = BM; - BM_copy = hamilt::BaseMatrix(BM); - // check if data is correct - EXPECT_EQ(BM_copy.get_value(0, 0), 1); - EXPECT_EQ(BM_copy.get_value(0, 1), 2); - EXPECT_EQ(BM_copy.get_value(1, 0), 3); - EXPECT_EQ(BM_copy.get_value(1, 1), 4); - -} - -// using TEST_F to test functions in AtomPair -// 1. constructor -// 2. copy assignment -// 3. move assignment -// 4. identify -// 5. add_to_matrix -// 6. add_to_array -// 7. get_matrix_value -// 8. get_R_index with out of range -// 9. get_value -// 10. get_value_size -TEST_F(HContainerTest, atompair_funcs) -{ - // 1. constructor - Parallel_Orbitals PO; - PO.atom_begin_row.resize(3); // natom = 2, size should be natom + 1 - PO.atom_begin_col.resize(3); - for(int i=0;i<3;i++) - { - PO.atom_begin_row[i] = i*2; // nw = 2, value should be i*nw - PO.atom_begin_col[i] = i*2; - } - PO.nrow = 4; - PO.ncol = 4; - hamilt::AtomPair atom_ij(0, 0, &PO, nullptr); - hamilt::AtomPair atom_ij2(0, 1, 1, 1, 1, &PO, nullptr); - hamilt::AtomPair atom_ij3(1, 0, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, nullptr); - hamilt::AtomPair atom_ij33(1, 1, 1, 1, 1, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, nullptr); - EXPECT_EQ(atom_ij(atom_ij2); - EXPECT_EQ(atom_ij.identify(atom_ij3), true); - EXPECT_EQ(atom_ij.identify(atom_ij2), false); - EXPECT_EQ(atom_ij2.identify(atom_ij33.get_atom_i(), atom_ij33.get_atom_j()), true); - EXPECT_EQ(atom_ij2.identify(atom_ij3.get_atom_i(), atom_ij3.get_atom_j()), false); - // 5. add_to_matrix - double hk_data[16] = {1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16}; - std::complex hk_data2[16] = {1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16}; - // colomn major case - double hk_data1[16] = { 1, 5, 9, 13, - 2, 6, 10, 14, - 3, 7, 11, 15, - 4, 8, 12, 16}; - // colomn major case - std::complex hk_data3[16] = {1, 5, 9, 13, - 2, 6, 10, 14, - 3, 7, 11, 15, - 4, 8, 12, 16}; - hamilt::HContainer HR(2); - for(int atom_i = 0;atom_i<2;++atom_i) - { - for(int atom_j = 0; atom_j<2; ++atom_j) - { - hamilt::AtomPair tmp(atom_i, atom_j, 0, 0, 0, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, nullptr); - tmp.allocate(nullptr, false); - double* tmp_data = tmp.get_HR_values(0, 0, 0).get_pointer(); - for(int i=0;i<4;++i) - { - tmp_data[i] = atom_i*2 + atom_j*4 + i + 1; - } - HR.insert_pair(tmp); - } - } - for(int ir=0;ir& tmp = HR.get_atom_pair(iap); - // row major case - tmp.add_to_matrix(&hk_data[0], 4, 1.0, 0); - tmp.add_to_matrix(&hk_data2[0], 4, std::complex(1.0, 0.5), 0); - // colomn major case - tmp.add_to_matrix(&hk_data1[0], 4, 1.0, 1); - tmp.add_to_matrix(&hk_data3[0], 4, std::complex(1.0, 0.5), 1); - /* output for show the result - std::cout<<"iap = "< hk_data2_correct[16] = {std::complex(2,0.5), std::complex(4,1), std::complex(8,2.5), std::complex(10,3), - std::complex(8,1.5), std::complex(10,2), std::complex(14,3.5), std::complex(16,4), - std::complex(12,1.5), std::complex(14,2), std::complex(18,3.5), std::complex(20,4), - std::complex(18,2.5), std::complex(20,3), std::complex(24,4.5), std::complex(26,5)}; - for(int i=0;i<4;++i) - { - for(int j=0;j<4;++j) - { - // row major case - EXPECT_EQ(hk_data[i*4+j], hk_data_correct[i*4+j]); - EXPECT_EQ(hk_data2[i*4+j], hk_data2_correct[i*4+j]); - // colomn major case - EXPECT_EQ(hk_data1[j*4+i], hk_data_correct[i*4+j]); - EXPECT_EQ(hk_data3[j*4+i], hk_data2_correct[i*4+j]); - } - } - // 6. add_to_array - std::vector> hr_array(16, 0.0); - std::vector hr_array2(16, 0.0); - for(int ir=0;ir* ptr1 = hr_array.data(); - double* ptr2 = hr_array2.data(); - for(int iap = 0;iap& tmp = HR.get_atom_pair(iap); - tmp.add_to_array(ptr1, std::complex(1.0, 0.0)); - tmp.add_to_array(ptr2, 1.0); - ptr1 += tmp.get_size(); - ptr2 += tmp.get_size(); - } - } - HR.unfix_R(); - // check hr_array and hr_array2 are correct - std::complex correct1; - double correct2; - double correct_array[16] = { - 1, 2, 3, 4, - 5, 6, 7, 8, - 3, 4, 5, 6, - 7, 8, 9, 10}; - double test_array[16] = {1, 2, 5, 6, 3, 4, 7, 8, 3, 4, 7, 8, 5, 6, 9, 10}; - for(int i=0;i<4;++i) - { - for(int j=0;j<4;++j) - { - correct1 = std::complex(correct_array[i*4+j], 0.0); - correct2 = correct_array[i*4+j]; - EXPECT_EQ(hr_array[i*4+j], correct1); - EXPECT_EQ(hr_array2[i*4+j], correct2); - } - } - // construct AtomPair from existed matrix - hamilt::AtomPair atom_ij4(0, 0, &PO, test_array); - EXPECT_EQ(atom_ij4.get_value(0, 0), test_array[0]); - EXPECT_EQ(atom_ij4.get_value(1, 1), test_array[3]); - EXPECT_EQ(atom_ij4.get_value(0), test_array[0]); - hamilt::AtomPair atom_ij5(0, 1, 1, 1, 1, &PO, &test_array[4]); - hamilt::AtomPair atom_ij6(1, 0, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, &test_array[8]); - hamilt::AtomPair atom_ij7(1, 1, 1, 1, 1, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, &test_array[12]); - // get_matrix_value will use global2local_row and global2local_col in Parallel_Orbitals - // so we need to set them - std::ofstream ofs("test_hcontainer.log"); - PO.set_serial(4, 4); - // joint 4 2*2 BaseMatrix to whole 4*4 matrix - // lambda function for check data - auto checkdata = [&](hamilt::AtomPair& ap_in) { - auto data_ij4 = ap_in.get_matrix_values(); - int* tmp_index = std::get<0>(data_ij4).data(); - double* tmp_data = std::get<1>(data_ij4); - double sum_error = 0.0; - for(int irow = tmp_index[0]; irow < tmp_index[0] + tmp_index[1]; ++irow) - { - for(int icol = tmp_index[2]; icol < tmp_index[2] + tmp_index[3]; ++icol) - { - sum_error += std::abs(*tmp_data++ - correct_array[irow*4+icol]); - } - } - return sum_error; - }; - EXPECT_EQ(checkdata(atom_ij4), 0.0); - EXPECT_EQ(checkdata(atom_ij5), 0.0); - EXPECT_EQ(checkdata(atom_ij6), 0.0); - EXPECT_EQ(checkdata(atom_ij7), 0.0); - - hamilt::HContainer HR_wrapper(&PO, test_array); - HR_wrapper.insert_pair(atom_ij4); - HR_wrapper.insert_pair(atom_ij5); - hamilt::HContainer HR_no_wrapper(&PO); - HR_no_wrapper.insert_pair(atom_ij4); - HR_no_wrapper.insert_pair(atom_ij5); - EXPECT_EQ(HR_no_wrapper.size_R_loop(), 2); - HR_no_wrapper.fix_R(0, 0, 0); - HR_no_wrapper.fix_gamma(); - EXPECT_EQ(HR_no_wrapper.size_R_loop(), 1); -} - -// Test for Wrapper mode in HContainer -// 1. test constructor of wrapper mode BaseMatrix -// 2. test constructor of wrapper mode AtomPair -// 3. test constructor of wrapper mode HContainer -// 4. test allocate() for wrapper mode -// 5. test get_nnr() for HContainer -// 6. test data_access correctnesss for wrapper mode -TEST_F(HContainerTest, wrapper_mode) -{ - EXPECT_EQ(HR->get_nnr(), 36); - // test HR_wrapper constructed by HR and vector - std::vector hr_data(HR->get_nnr()); - hamilt::HContainer HR_wrapper(*HR, hr_data.data()); - EXPECT_EQ(HR_wrapper.get_nnr(), 36); - EXPECT_EQ(HR_wrapper.size_atom_pairs(), 9); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_col_size(), 2); - EXPECT_EQ(HR_wrapper.get_wrapper(), hr_data.data()); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_pointer(), hr_data.data()); - for (size_t i = 0; i < hr_data.size(); i++) - { - hr_data[i] = i; - } - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_value(0, 0), 0.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_value(0, 1), 1.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_value(1, 0), 2.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(0).get_value(1, 1), 3.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(1).get_value(0, 0), 4.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(1).get_value(0, 1), 5.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(1).get_value(1, 0), 6.0); - EXPECT_EQ(HR_wrapper.get_atom_pair(1).get_value(1, 1), 7.0); - hamilt::AtomPair atom_ij(HR->get_atom_pair(0), hr_data.data()); - hamilt::BaseMatrix matrix_test = hamilt::BaseMatrix(atom_ij.get_row_size(), atom_ij.get_col_size(), hr_data.data()); - EXPECT_EQ(atom_ij.get_value(1, 1), 3.0); - EXPECT_EQ(matrix_test.get_value(1, 1), 3.0); - HR->allocate(hr_data.data(), false); - EXPECT_EQ(HR->get_atom_pair(0).get_value(1, 1), 3.0); - EXPECT_EQ(HR->get_atom_pair(1).get_value(1, 1), 7.0); - EXPECT_EQ(HR->get_atom_pair(2).get_value(1, 1), 11.0); - EXPECT_EQ(HR->get_atom_pair(3).get_value(1, 1), 15.0); - HR->allocate(hr_data.data(), true); - EXPECT_EQ(HR->get_atom_pair(0).get_value(1, 1), 0.0); - EXPECT_EQ(HR->get_atom_pair(1).get_value(1, 1), 0.0); - EXPECT_EQ(HR->get_atom_pair(2).get_value(1, 1), 0.0); - EXPECT_EQ(HR->get_atom_pair(3).get_value(1, 1), 0.0); -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} diff --git a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_complex.cpp b/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_complex.cpp deleted file mode 100644 index 60a87eedec..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_complex.cpp +++ /dev/null @@ -1,576 +0,0 @@ -#include "gtest/gtest.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -/** - * Unit test of HContainer - * HContainer is a container of hamilt::AtomPair, in this test, we test the following functions: - * 1. insert_pair - * 2. find_pair - * 3. get_atom_pair - * 4. fix_R and unfix_R - * 5. fix_gamma - * 6. loop_R - * 7. size_atom_pairs - * 8. data - * - */ - -// Unit test of HContainer with gtest framework -class HContainerTest : public ::testing::Test -{ - protected: - void SetUp() override - { - // set up a unitcell, with one element and three atoms, each atom has 2 orbitals - ucell.ntype = 1; - ucell.nat = 3; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - } - ucell.atoms[0].nw = 2; - - // set up a HContainer with ucell - HR = new hamilt::HContainer>(ucell); - } - - void TearDown() override - { - delete HR; - delete[] ucell.atoms; - } - - UnitCell ucell; - hamilt::HContainer>* HR; -}; - -// using TEST_F to test HContainer::insert_pair -TEST_F(HContainerTest, insert_pair) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_i(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_j(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_col_size(), 2); - // set up a hamilt::AtomPair - hamilt::AtomPair> atom_ij(0, 3); - atom_ij.set_size(2, 2); - atom_ij.allocate(nullptr, true); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - // check if atom_ij is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 10); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_i(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_j(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_col_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_j(), 3); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_col_size(), 2); - // insert atom_ij again - HR->insert_pair(atom_ij); - // check if atom_ij is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 10); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_atom_j(), 3); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 3).get_col_size(), 2); - // set up another hamilt::AtomPair - hamilt::AtomPair> atom_kl(1, 0); - atom_kl.set_size(2, 2); - atom_kl.allocate(nullptr, true); - std::complex tmp_array[4] = {1, 2, 3, 4}; - atom_kl.get_HR_values(1, 0, 0).add_array(&tmp_array[0]); - // insert atom_kl into HR - HR->insert_pair(atom_kl); - // check if atom_kl is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 10); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_i(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_atom_j(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(2, 2).get_col_size(), 2); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_atom_i(), 1); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(1, 0).get_col_size(), 2); - // check if data is correct - std::complex* data_ptr = HR->get_atom_pair(1, 0).get_HR_values(1, 0, 0).get_pointer(); - EXPECT_EQ(data_ptr[0], std::complex(1)); - EXPECT_EQ(data_ptr[1], std::complex(2)); - EXPECT_EQ(data_ptr[2], std::complex(3)); - EXPECT_EQ(data_ptr[3], std::complex(4)); - - // test copy constructor for HContainer - hamilt::HContainer> HR_copy(*HR); - // test move constructor for HContainer - hamilt::HContainer> HR_move(std::move(HR_copy)); -} - -// using TEST_F to test HContainer::find_pair -TEST_F(HContainerTest, find_pair) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - // find atom_ij in HR - hamilt::AtomPair>* atom_ij_ptr = HR->find_pair(0, 1); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ptr->get_atom_i(), 0); - EXPECT_EQ(atom_ij_ptr->get_atom_j(), 1); - EXPECT_EQ(atom_ij_ptr->get_row_size(), 2); - EXPECT_EQ(atom_ij_ptr->get_col_size(), 2); - // find atom_kl in HR - hamilt::AtomPair>* atom_kl_ptr = HR->find_pair(1, 0); - // check if atom_kl is found - EXPECT_EQ(atom_kl_ptr->get_atom_i(), 1); - EXPECT_EQ(atom_kl_ptr->get_atom_j(), 0); - EXPECT_EQ(atom_kl_ptr->get_row_size(), 2); - EXPECT_EQ(atom_kl_ptr->get_col_size(), 2); - // find atom_ij not in HR - hamilt::AtomPair>* atom_ij_ptr2 = HR->find_pair(0, 3); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ptr2, nullptr); -} - -// using TEST_F to test HContainer::get_atom_pair, both with atom_i, atom_j and with index -TEST_F(HContainerTest, get_atom_pair) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - // get atom_ij in HR - hamilt::AtomPair>& atom_ij_ref = HR->get_atom_pair(0, 1); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ref.get_atom_i(), 0); - EXPECT_EQ(atom_ij_ref.get_atom_j(), 1); - EXPECT_EQ(atom_ij_ref.get_row_size(), 2); - EXPECT_EQ(atom_ij_ref.get_col_size(), 2); - // get atom_kl in HR - hamilt::AtomPair>& atom_kl_ref = HR->get_atom_pair(1, 0); - // check if atom_kl is found - EXPECT_EQ(atom_kl_ref.get_atom_i(), 1); - EXPECT_EQ(atom_kl_ref.get_atom_j(), 0); - EXPECT_EQ(atom_kl_ref.get_row_size(), 2); - EXPECT_EQ(atom_kl_ref.get_col_size(), 2); - // get atom_ij in HR with index - hamilt::AtomPair>& atom_ij_ref2 = HR->get_atom_pair(0); - // check if atom_ij is found - EXPECT_EQ(atom_ij_ref2.get_atom_i(), 0); - EXPECT_EQ(atom_ij_ref2.get_atom_j(), 0); - EXPECT_EQ(atom_ij_ref2.get_row_size(), 2); - EXPECT_EQ(atom_ij_ref2.get_col_size(), 2); - // get atom_kl in HR with index - hamilt::AtomPair>& atom_kl_ref2 = HR->get_atom_pair(8); - // check if atom_kl is found - EXPECT_EQ(atom_kl_ref2.get_atom_i(), 2); - EXPECT_EQ(atom_kl_ref2.get_atom_j(), 2); - EXPECT_EQ(atom_kl_ref2.get_row_size(), 2); - EXPECT_EQ(atom_kl_ref2.get_col_size(), 2); -} - -// using TEST_F to test HContainer::fix_R and unfix_R -TEST_F(HContainerTest, fix_R) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - EXPECT_EQ(HR->size_R_loop(), 1); - // fix R - EXPECT_EQ(HR->fix_R(0, 0, 0), true); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), 0); - // fix R again - EXPECT_EQ(HR->fix_R(0, 0, 0), true); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), 0); - // fix another R - EXPECT_EQ(HR->fix_R(1, 0, 0), false); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), -1); - // unfix R - HR->unfix_R(); - // check if R is unfixed - EXPECT_EQ(HR->get_current_R(), -1); -} - -// using TEST_F to test HContainer::fix_gamma -TEST_F(HContainerTest, fix_gamma) -{ - // check HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - EXPECT_EQ(HR->size_R_loop(), 1); - hamilt::AtomPair> atom_ij(0, 1); - atom_ij.set_size(2, 2); - hamilt::BaseMatrix>& tmp = atom_ij.get_HR_values(1, 0, 0); - std::complex tmp_array[4] = {1, 2, 3, 4}; - tmp.add_array(tmp_array); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - EXPECT_EQ(HR->size_R_loop(), 2); - // fix gamma - EXPECT_EQ(HR->is_gamma_only(), false); - HR->fix_gamma(); - // check if gamma is fixed - EXPECT_EQ(HR->is_gamma_only(), true); - EXPECT_EQ(HR->size_R_loop(), 1); - // fix gamma again - HR->fix_gamma(); - // check if gamma is fixed - EXPECT_EQ(HR->is_gamma_only(), true); -} - -/** - * using TEST_F to test HContainer::loop_R, - * step: 1. size_R_loop(), 2. for-loop, loop_R(), 3. fix_R(), 4. do something - */ -TEST_F(HContainerTest, loop_R) -{ - // 1. size_R_loop() - int size_for_loop_R = HR->size_R_loop(); - EXPECT_EQ(size_for_loop_R, 1); - // 2. for-loop, loop_R() - int rx, ry, rz; - for (int i = 0; i < size_for_loop_R; i++) - { - HR->loop_R(i, rx, ry, rz); - EXPECT_EQ(rx, 0); - EXPECT_EQ(ry, 0); - EXPECT_EQ(rz, 0); - HR->fix_R(rx, ry, rz); - // check if R is fixed - EXPECT_EQ(HR->get_current_R(), i); - // 4. do something - } - HR->unfix_R(); - // check if R is unfixed - EXPECT_EQ(HR->get_current_R(), -1); -} - -// using TEST_F to test HContainer::size_atom_pairs -// 1. test with R fixed -// 2. test with R unfixed -TEST_F(HContainerTest, size_atom_pairs) -{ - // get size_R_loop - int size_R_loop = HR->size_R_loop(); - EXPECT_EQ(size_R_loop, 1); - // 1. test with R fixed - // fix R - EXPECT_EQ(HR->get_current_R(), -1); - bool ok = HR->fix_R(0, 0, 0); - // check if R is fixed - EXPECT_EQ(ok, true); - EXPECT_EQ(HR->get_current_R(), 0); - // get AP size - int AP_size = HR->size_atom_pairs(); - EXPECT_EQ(AP_size, 9); - // fix to another R - hamilt::AtomPair> atom_ij(0, 1); - atom_ij.set_size(2, 2); - atom_ij.allocate(nullptr, true); - hamilt::BaseMatrix>& tmp = atom_ij.get_HR_values(1, 0, 0); - std::complex tmp_array[4] = {1, 2, 3, 4}; - tmp.add_array(tmp_array); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - // get size_R_loop again, it should be 2 - size_R_loop = HR->size_R_loop(); - // if R is fixed, size_R_loop will not be reset, so it should be 1 - EXPECT_EQ(size_R_loop, 1); - // unfix R - HR->unfix_R(); - // check size_R_loop after R index unfixed - size_R_loop = HR->size_R_loop(); - EXPECT_EQ(size_R_loop, 2); - ok = HR->fix_R(1, 0, 0); - // check if R is fixed - EXPECT_EQ(ok, true); - EXPECT_EQ(HR->get_current_R(), 1); - EXPECT_EQ(HR->size_atom_pairs(), 1); - // check if tmp_atom_pairs is correct - EXPECT_EQ(HR->get_atom_pair(0).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0).get_atom_j(), 1); - EXPECT_EQ(HR->get_atom_pair(0).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0).get_col_size(), 2); - const ModuleBase::Vector3 R_ptr = HR->get_atom_pair(0).get_R_index(); - EXPECT_EQ(R_ptr.x, 1); - EXPECT_EQ(R_ptr.y, 0); - EXPECT_EQ(R_ptr.z, 0); - EXPECT_EQ(HR->get_atom_pair(0).get_R_index(5), ModuleBase::Vector3(-1, -1, -1)); - // check if data is correct - std::complex* data_ptr = HR->get_atom_pair(0).get_pointer(); - EXPECT_EQ(data_ptr[0], std::complex(1)); - EXPECT_EQ(data_ptr[1], std::complex(2)); - EXPECT_EQ(data_ptr[2], std::complex(3)); - EXPECT_EQ(data_ptr[3], std::complex(4)); - // 2. test with R unfixed - // unfix R - HR->unfix_R(); - // check if R is unfixed - EXPECT_EQ(HR->get_current_R(), -1); - // get AP size - AP_size = HR->size_atom_pairs(); - EXPECT_EQ(AP_size, 9); - // fix to another R with no AP - ok = HR->fix_R(2, 0, 0); - // check if R is fixed - EXPECT_EQ(ok, false); - EXPECT_EQ(HR->get_current_R(), -1); - EXPECT_EQ(HR->size_atom_pairs(), 9); -} - -// using TEST_F to test HContainer::data() -TEST_F(HContainerTest, data) -{ - // set up a hamilt::AtomPair - hamilt::AtomPair> atom_ij(0, 1); - atom_ij.set_size(2, 2); - atom_ij.allocate(nullptr, true); - hamilt::BaseMatrix>& tmp = atom_ij.get_HR_values(0, 0, 0); - std::complex tmp_array[4] = {1, 2, 3, 4}; - tmp.add_array(tmp_array); - EXPECT_EQ(HR->size_atom_pairs(), 9); - // insert atom_ij into HR - HR->insert_pair(atom_ij); - // check if atom_ij is inserted into HR - EXPECT_EQ(HR->size_atom_pairs(), 9); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_atom_i(), 0); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_atom_j(), 1); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_row_size(), 2); - EXPECT_EQ(HR->get_atom_pair(0, 1).get_col_size(), 2); - // get data pointer - std::complex* data_ptr = HR->data(0, 1); - // check if data pointer is correct - EXPECT_EQ(data_ptr, HR->get_atom_pair(0, 1).get_pointer()); - EXPECT_EQ(data_ptr, HR->get_atom_pair(0, 1).get_pointer(0)); - int r_index[3] = {0, 0, 0}; - EXPECT_EQ(data_ptr, HR->data(0, 1, r_index)); - EXPECT_EQ(HR->data(0, 10), nullptr); - EXPECT_EQ(HR->data(0, 10, r_index), nullptr); - // check if data is correct - EXPECT_EQ(data_ptr[0], std::complex(1)); - EXPECT_EQ(data_ptr[1], std::complex(2)); - EXPECT_EQ(data_ptr[2], std::complex(3)); - EXPECT_EQ(data_ptr[3], std::complex(4)); -} - -// using TEST_F to test functions in BaseMatrix -// 1. test constructor with existed data -// 4. test add_element -// 5. test get_value -TEST_F(HContainerTest, basematrix_funcs) -{ - // 1. test constructor with existed data - std::complex data_ptr[4] = {1, 2, 3, 4}; - hamilt::BaseMatrix> BM(2, 2, &data_ptr[0]); - // check if data is correct - EXPECT_EQ(BM.get_value(0, 0), std::complex(1)); - EXPECT_EQ(BM.get_value(0, 1), std::complex(2)); - EXPECT_EQ(BM.get_value(1, 0), std::complex(3)); - EXPECT_EQ(BM.get_value(1, 1), std::complex(4)); - // copy BM to check copy constructor - hamilt::BaseMatrix> BM_copy(BM); - BM_copy = BM; - BM_copy = hamilt::BaseMatrix>(BM); - // check if data is correct - EXPECT_EQ(BM_copy.get_value(0, 0), std::complex(1)); - EXPECT_EQ(BM_copy.get_value(0, 1), std::complex(2)); - EXPECT_EQ(BM_copy.get_value(1, 0), std::complex(3)); - EXPECT_EQ(BM_copy.get_value(1, 1), std::complex(4)); -} - -// using TEST_F to test functions in AtomPair -// 1. constructor -// 2. copy assignment -// 3. move assignment -// 4. identify -// 5. add_to_matrix -// 6. add_to_array -// 7. get_matrix_value -// 8. get_R_index with out of range -// 9. get_value -// 10. get_value_size -TEST_F(HContainerTest, atompair_funcs) -{ - // 1. constructor - Parallel_Orbitals PO; - PO.atom_begin_row.resize(3); // natom = 2, size should be natom + 1 - PO.atom_begin_col.resize(3); - for(int i=0;i<3;i++) - { - PO.atom_begin_row[i] = i*2; // nw = 2, value should be i*nw - PO.atom_begin_col[i] = i*2; - } - PO.nrow = 4; - PO.ncol = 4; - hamilt::AtomPair> atom_ij(0, 0, &PO, nullptr); - hamilt::AtomPair> atom_ij2(0, 1, 1, 1, 1, &PO, nullptr); - hamilt::AtomPair> atom_ij3(1, 0, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, nullptr); - hamilt::AtomPair> atom_ij33(1, 1, 1, 1, 1, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, nullptr); - EXPECT_EQ(atom_ij>(atom_ij2); - EXPECT_EQ(atom_ij.identify(atom_ij3), true); - EXPECT_EQ(atom_ij.identify(atom_ij2), false); - EXPECT_EQ(atom_ij2.identify(atom_ij33.get_atom_i(), atom_ij33.get_atom_j()), true); - EXPECT_EQ(atom_ij2.identify(atom_ij3.get_atom_i(), atom_ij3.get_atom_j()), false); - // 5. add_to_matrix - // row major case - std::complex hk_data2[16] = {1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16}; - // colomn major case - std::complex hk_data3[16] = {1, 5, 9, 13, - 2, 6, 10, 14, - 3, 7, 11, 15, - 4, 8, 12, 16}; - hamilt::HContainer> HR(2); - for(int atom_i = 0;atom_i<2;++atom_i) - { - for(int atom_j = 0; atom_j<2; ++atom_j) - { - hamilt::AtomPair> tmp(atom_i, atom_j, 0, 0, 0, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, nullptr); - tmp.allocate(nullptr, false); - std::complex* tmp_data = tmp.get_HR_values(0, 0, 0).get_pointer(); - for(int i=0;i<4;++i) - { - tmp_data[i] = atom_i*2 + atom_j*4 + i + 1; - } - HR.insert_pair(tmp); - } - } - for(int ir=0;ir>& tmp = HR.get_atom_pair(iap); - // row major case - tmp.add_to_matrix(&hk_data2[0], 4, std::complex(1.0, 0.5), 0); - // colomn major case - tmp.add_to_matrix(&hk_data3[0], 4, std::complex(1.0, 0.5), 1); - } - } - HR.unfix_R(); - // check hk_data and hk_data2 are correct - std::complex hk_data2_correct[16] = {std::complex(2,0.5), std::complex(4,1), std::complex(8,2.5), std::complex(10,3), - std::complex(8,1.5), std::complex(10,2), std::complex(14,3.5), std::complex(16,4), - std::complex(12,1.5), std::complex(14,2), std::complex(18,3.5), std::complex(20,4), - std::complex(18,2.5), std::complex(20,3), std::complex(24,4.5), std::complex(26,5)}; - for(int i=0;i<4;++i) - { - for(int j=0;j<4;++j) - { - EXPECT_EQ(hk_data2[i*4+j], hk_data2_correct[i*4+j]); - EXPECT_EQ(hk_data3[j*4+i], hk_data2_correct[i*4+j]); - } - } - - // 6. add_to_array - std::vector> hr_array(16, 0.0); - for(int ir=0;ir* ptr1 = hr_array.data(); - for(int iap = 0;iap(1.0, 0.0)); - ptr1 += tmp.get_size(); - } - } - HR.unfix_R(); - // check hr_array and hr_array2 are correct - std::complex correct1; - std::complex correct_array[16] = { - 1, 2, 3, 4, - 5, 6, 7, 8, - 3, 4, 5, 6, - 7, 8, 9, 10}; - std::complex test_array[16] = {1, 2, 5, 6, 3, 4, 7, 8, 3, 4, 7, 8, 5, 6, 9, 10}; - - for(int i=0;i<4;++i) - { - for(int j=0;j<4;++j) - { - correct1 = correct_array[i*4+j]; - EXPECT_EQ(hr_array[i*4+j], correct1); - } - } - - // construct AtomPair from existed matrix - hamilt::AtomPair> atom_ij4(0, 0, &PO, test_array); - EXPECT_EQ(atom_ij4.get_value(0, 0), correct_array[0]); - EXPECT_EQ(atom_ij4.get_value(1, 1), correct_array[5]); - EXPECT_EQ(atom_ij4.get_value(0), correct_array[0]); - hamilt::AtomPair> atom_ij5(0, 1, 1, 1, 1, &PO, &test_array[4]); - hamilt::AtomPair> atom_ij6(1, 0, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, &test_array[8]); - hamilt::AtomPair> atom_ij7(1, 1, 1, 1, 1, PO.atom_begin_row.data(), PO.atom_begin_col.data(), 2, &test_array[12]); - // get_matrix_value will use global2local_row and global2local_col in Parallel_Orbitals - // so we need to set them - std::ofstream ofs("test_hcontainer_complex.log"); - PO.set_serial(4, 4); - auto checkdata = [&](hamilt::AtomPair>& ap_in) { - auto data_ij4 = ap_in.get_matrix_values(); - int* tmp_index = std::get<0>(data_ij4).data(); - std::complex* tmp_data = std::get<1>(data_ij4); - double sum_error = 0.0; - for(int irow = tmp_index[0]; irow < tmp_index[0] + tmp_index[1]; ++irow) - { - for(int icol = tmp_index[2]; icol < tmp_index[2] + tmp_index[3]; ++icol) - { - sum_error += std::abs((*tmp_data).real() - correct_array[irow*4+icol].real()); - tmp_data++; - } - } - return sum_error; - }; - EXPECT_EQ(checkdata(atom_ij4), 0.0); - EXPECT_EQ(checkdata(atom_ij5), 0.0); - EXPECT_EQ(checkdata(atom_ij6), 0.0); - EXPECT_EQ(checkdata(atom_ij7), 0.0); -} - - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} diff --git a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_output.cpp b/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_output.cpp deleted file mode 100644 index 70fdcb66af..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_output.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include "../hcontainer.h" -#include "../output_hcontainer.h" -#include "source_cell/unitcell.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -/************************************************ - * unit test of output_hcontainer.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - write() - * - write the matrices of all R vectors to the output stream - * - write(int rx_in, int ry_in, int rz_in) - * - write the matrix of a single R vector to the output stream - * - write_single_R(int rx, int ry, int rz) - * - write the matrix of a single R vector to the output stream - */ - -class OutputHContainerTest : public testing::Test -{ - protected: - UnitCell ucell; - std::string output; - void SetUp() override - { - ucell.ntype = 1; - ucell.nat = 2; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2ia[iat] = iat; - ucell.iat2it[iat] = 0; - } - ucell.atoms[0].na = 2; - ucell.atoms[0].nw = 2; - ucell.iwt2iat = new int[4]; - ucell.iwt2iw = new int[4]; - ucell.itia2iat.create(ucell.ntype, ucell.nat); - ucell.set_iat2iwt(1); - ucell.itia2iat(0, 0) = 0; - ucell.itia2iat(0, 1) = 1; - ucell.iwt2iat[0] = 0; - ucell.iwt2iat[1] = 0; - ucell.iwt2iat[2] = 1; - ucell.iwt2iat[3] = 1; - ucell.iwt2iw[0] = 0; - ucell.iwt2iw[1] = 1; - ucell.iwt2iw[2] = 0; - ucell.iwt2iw[3] = 1; - } - void TearDown() override - { - delete[] ucell.atoms; - } -}; - -TEST_F(OutputHContainerTest, Write) -{ - Parallel_Orbitals ParaV; - ParaV.atom_begin_row.resize(3); - ParaV.atom_begin_col.resize(3); - for (int i = 0; i < 3; i++) - { - ParaV.atom_begin_row[i] = i * 2; - ParaV.atom_begin_col[i] = i * 2; - } - ParaV.nrow = 4; - ParaV.ncol = 4; - std::ofstream ofs("output_hcontainer.log"); - ParaV.set_serial(4, 4); - // std::cout << "ParaV.global2local_row = " << ParaV.global2local_row(0) << " " << ParaV.global2local_row(1) << " " - // << ParaV.global2local_row(2) << " " << ParaV.global2local_row(3) << std::endl; - // std::cout << "ParaV.global2local_col = " << ParaV.global2local_col(0) << " " << ParaV.global2local_col(1) << " " - // << ParaV.global2local_col(2) << " " << ParaV.global2local_col(3) << std::endl; - ofs.close(); - remove("output_hcontainer.log"); - hamilt::HContainer HR(&ParaV); - double correct_array[16] = {1, 2, 0, 4, 5, 0, 7, 0, 3, 0, 5, 6, 7, 8, 0, 10}; - double correct_array1[16] = {1, 2, 0, 4, 5, 0, 7, 0, 3, 0, 5, 6, 7, 8, 0, 10}; - // correct_array represent a matrix of - // 1 2 0 4 - // 5 0 7 0 - // 3 0 5 6 - // 7 8 0 10 - double test_data[8] = {0, 4, 7, 0, 5, 6, 0, 10}; - hamilt::AtomPair ap1(0, 1, 0, 1, 1, &ParaV, &test_data[0]); - hamilt::AtomPair ap2(1, 1, 0, 0, 0, &ParaV, &test_data[4]); - HR.insert_pair(ap1); - HR.insert_pair(ap2); - for (int ir = 0; ir < HR.size_R_loop(); ++ir) - { - int rx, ry, rz; - HR.loop_R(ir, rx, ry, rz); - HR.fix_R(rx, ry, rz); - // std::cout << "rx = " << rx << " ry = " << ry << " rz = " << rz << std::endl; - for (int iap = 0; iap < HR.size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp_ap = HR.get_atom_pair(iap); - if (rx == 0 && ry == 1 && rz == 1) - { - EXPECT_DOUBLE_EQ(tmp_ap.get_value(0, 0), 0); - EXPECT_DOUBLE_EQ(tmp_ap.get_value(0, 1), 4); - EXPECT_DOUBLE_EQ(tmp_ap.get_value(1, 0), 7); - EXPECT_DOUBLE_EQ(tmp_ap.get_value(1, 1), 0); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[0], 0); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[1], 2); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[2], 2); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[3], 2); - } - else if (rx == 0 && ry == 0 && rz == 0) - { - EXPECT_DOUBLE_EQ(tmp_ap.get_value(0, 0), 5); - EXPECT_DOUBLE_EQ(tmp_ap.get_value(0, 1), 6); - EXPECT_DOUBLE_EQ(tmp_ap.get_value(1, 0), 0); - EXPECT_DOUBLE_EQ(tmp_ap.get_value(1, 1), 10); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[0], 2); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[1], 2); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[2], 2); - EXPECT_DOUBLE_EQ(std::get<0>(tmp_ap.get_matrix_values())[3], 2); - } - } - HR.unfix_R(); - } - double sparse_threshold = 0.1; - hamilt::Output_HContainer output_HR(&HR, std::cout, sparse_threshold, 2); - // the first R - testing::internal::CaptureStdout(); - output_HR.write(0, 1, 1); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("0 1 1 2")); - EXPECT_THAT(output, testing::HasSubstr(" 4.00e+00 7.00e+00")); - EXPECT_THAT(output, testing::HasSubstr(" 3 2")); - EXPECT_THAT(output, testing::HasSubstr(" 0 1 2 2 2")); - // the second R - testing::internal::CaptureStdout(); - output_HR.write(0, 0, 0); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("0 0 0 3")); - EXPECT_THAT(output, testing::HasSubstr(" 5.00e+00 6.00e+00 1.00e+01")); - EXPECT_THAT(output, testing::HasSubstr(" 2 3 3")); - EXPECT_THAT(output, testing::HasSubstr(" 0 0 0 2 3")); - // output all R - testing::internal::CaptureStdout(); - output_HR.write(); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("0 1 1 2")); - EXPECT_THAT(output, testing::HasSubstr(" 4.00e+00 7.00e+00")); - EXPECT_THAT(output, testing::HasSubstr(" 3 2")); - EXPECT_THAT(output, testing::HasSubstr(" 0 1 2 2 2")); - EXPECT_THAT(output, testing::HasSubstr("0 0 0 3")); - EXPECT_THAT(output, testing::HasSubstr(" 5.00e+00 6.00e+00 1.00e+01")); - EXPECT_THAT(output, testing::HasSubstr(" 2 3 3")); - EXPECT_THAT(output, testing::HasSubstr(" 0 0 0 2 3")); -} diff --git a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_readCSR.cpp b/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_readCSR.cpp deleted file mode 100644 index 9eb9a533f5..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_readCSR.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include "../hcontainer.h" -#include "../output_hcontainer.h" -#include "module_io/csr_reader.h" -#include "prepare_unitcell.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include - -// mock functions -#ifdef __LCAO -InfoNonlocal::InfoNonlocal() -{ -} -InfoNonlocal::~InfoNonlocal() -{ -} -LCAO_Orbitals::LCAO_Orbitals() -{ -} -LCAO_Orbitals::~LCAO_Orbitals() -{ -} -#endif -Magnetism::Magnetism() -{ - this->tot_mag = 0.0; - this->abs_mag = 0.0; - this->start_mag = nullptr; -} -Magnetism::~Magnetism() -{ - delete[] this->start_mag; -} -// mocke functions - -/************************************************ - * unit test of read and output hcontainer - ***********************************************/ - -/** - * This unit test read sparse matrices of SR - * from a file SR.csr, construct SR using - * hamilt::HContainer and output the - * matrices of SR to a file SR.out. - */ - -class ReadHContainerTest : public testing::Test -{ - protected: - UnitCell* ucell; - UcellTestPrepare utp = UcellTestLib["Si"]; - // nw is the number of orbitals of each atom - // it should container ucell.nat elements - std::vector nw = {13}; - int nlocal; - void SetUp() override - { - ucell = utp.SetUcellInfo(nw, nlocal); - } -}; - -TEST_F(ReadHContainerTest, ReadAndOutputHContainer) -{ - // read SR - std::string filename = "./support/SR.csr"; - ModuleIO::csrFileReader csr(filename); - // std::cout << "csr.getStep " << csr.getStep() << std::endl; - // std::cout << "csr.getMatrixDimension " << csr.getMatrixDimension() << std::endl; - // std::cout << "csr.getNumberOfR " << csr.getNumberOfR() << std::endl; - // std::cout << "nlocal " << nlocal << std::endl; - // - // construct paraV - Parallel_Orbitals paraV; - std::ofstream ofs("test.log"); - paraV.set_serial(nlocal, nlocal); - ofs.close(); - remove("test.log"); - paraV.set_atomic_trace(ucell->get_iat2iwt(), ucell->nat, nlocal); - // std::cout << paraV.atom_begin_col[0] << " " << paraV.atom_begin_col[1] << std::endl; - // std::cout << paraV.atom_begin_row[0] << " " << paraV.atom_begin_row[1] << std::endl; - // - // construct SR - hamilt::HContainer SR(¶V); - int numberofR = csr.getNumberOfR(); - for (int i = 0; i < numberofR; i++) - { - std::vector RCoord = csr.getRCoordinate(i); - ModuleIO::SparseMatrix sparse_matrix = csr.getMatrix(i); - for (int iat = 0; iat < ucell->nat; iat++) - { - int begin_row = paraV.atom_begin_row[iat]; - int end_row = paraV.atom_begin_row[iat + 1]; - int numberofRow = end_row - begin_row; - for (int jat = 0; jat < ucell->nat; jat++) - { - int begin_col = paraV.atom_begin_col[jat]; - int end_col = paraV.atom_begin_col[jat + 1]; - int numberofCol = end_col - begin_col; - hamilt::BaseMatrix tmp_matrix(numberofRow, numberofCol); - tmp_matrix.allocate(nullptr, true); - int nnz = 0; - for (const auto& element: sparse_matrix.getElements()) - { - int row = element.first.first; - int col = element.first.second; - if (row < begin_row || row >= end_row || col < begin_col || col >= end_col) - { - continue; - } - tmp_matrix.add_element(row - begin_row, col - begin_col, element.second); - nnz++; - } - if (nnz != 0) - { - auto tmp_ap = hamilt::AtomPair(iat, jat, RCoord[0], RCoord[1], RCoord[2], ¶V); - tmp_ap.allocate(nullptr, true); - tmp_ap.convert_add(tmp_matrix, RCoord[0], RCoord[1], RCoord[2]); - SR.insert_pair(tmp_ap); - } - } - } - } - // output SR - std::ofstream ofs_out("SR.out"); - double sparse_threshold = 1e-10; - hamilt::Output_HContainer output_SR(&SR, ofs_out, sparse_threshold, 8); - // std::cout << SR.size_R_loop() << std::endl; - // output_SR.write(-2, -1, 0); - ofs_out << "STEP: " << 0 << std::endl; - ofs_out << "Matrix Dimension of S(R): " << paraV.get_col_size() << std::endl; - ofs_out << "Matrix number of S(R): " << SR.size_R_loop() << std::endl; - output_SR.write(); - ofs_out.close(); - // - // read in SR.out again - std::string fileout = "SR.out"; - ModuleIO::csrFileReader csr_out(fileout); - EXPECT_EQ(csr.getStep(), csr_out.getStep()); - EXPECT_EQ(csr.getMatrixDimension(), csr_out.getMatrixDimension()); - EXPECT_EQ(csr.getNumberOfR(), csr_out.getNumberOfR()); - // - // compare csr and csr_out - for (int i = 0; i < numberofR; i++) - { - std::vector RCoord = csr.getRCoordinate(i); - ModuleIO::SparseMatrix sparse_matrix = csr.getMatrix(i); - for (int j = 0; j < numberofR; j++) - { - std::vector RCoord_out = csr_out.getRCoordinate(j); - if (RCoord[0] == RCoord_out[0] && RCoord[1] == RCoord_out[1] && RCoord[2] == RCoord_out[2]) - { - ModuleIO::SparseMatrix sparse_matrix_out = csr_out.getMatrix(j); - EXPECT_EQ(sparse_matrix.getElements().size(), sparse_matrix_out.getElements().size()); - for (const auto& element: sparse_matrix.getElements()) - { - int row = element.first.first; - int col = element.first.second; - double value = element.second; - auto it = sparse_matrix_out.getElements().find(std::make_pair(row, col)); - EXPECT_NE(it, sparse_matrix_out.getElements().end()); - EXPECT_NEAR(value, it->second, 1e-10); - } - } - } - } - remove("SR.out"); -} diff --git a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_time.cpp b/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_time.cpp deleted file mode 100644 index 4f5a5b5fc4..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_time.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "gtest/gtest.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 100; - -/** - * Unit test of HContainer for time consuming - * HContainer is a container of hamilt::AtomPair, in this test, we test the following functions: - * 1. insert_pair - * 2. find_pair - * - */ - -// Unit test of HContainer with gtest framework -class HContainerTest : public ::testing::Test -{ - protected: - void SetUp() override - { - // set up a unitcell, with one element and three atoms, each atom has 2 orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - } - ucell.atoms[0].nw = 10; - - // set up a HContainer with ucell - HR = new hamilt::HContainer(ucell); - } - - void TearDown() override - { - delete HR; - delete[] ucell.atoms; - } - - UnitCell ucell; - hamilt::HContainer* HR; -}; - -// using TEST to test HContainer::insert_pair - -TEST(single_test_hcontainer, insert_pair) -{ - // print current used memory of system - auto memory_start = ModuleBase::GlobalFunc::MemAvailable() / 1024.0; - // get random number between (0, 100000000) by rand() - srand((unsigned)time(nullptr)); - hamilt::HContainer HR_test(test_size); - clock_t start, end; - start = clock(); - for (int i = 0; i < test_size * 100; i++) - { - int iat1 = rand() % test_size; - int iat2 = rand() % test_size; - hamilt::AtomPair tmp(iat1, iat2); - tmp.set_size(10, 10); - auto p = tmp.get_HR_values(0, 0, 0).get_pointer(); - p[0] = i * 1.0; - HR_test.insert_pair(tmp); - } - end = clock(); - std::cout << "total atom pairs: " << HR_test.size_atom_pairs() << std::endl; - int count = 0; - for (int i = 0; i < HR_test.size_atom_pairs(); i++) - { - auto tmp = HR_test.get_atom_pair(i); - count += tmp.get_R_size(); - } - std::cout << "total I-J-R: " << count << std::endl; - std::cout << "pure data size of I-J-R: " << count * 10 * 10 * sizeof(double) / 1024.0 / 1024.0 << " MB" - << std::endl; - auto memory_end = ModuleBase::GlobalFunc::MemAvailable() / 1024.0; - std::cout << "memory: " << double(HR_test.get_memory_size()) / 1024.0 / 1024.0 << " MB" << std::endl; - std::cout << "time: " << (double)(end - start) / CLOCKS_PER_SEC << std::endl; -} - -TEST(single_test_IJR, insert_pair) -{ - // get random number between (0, 100000000) by rand() - srand((unsigned)time(nullptr)); - hamilt::HContainer HR_test(test_size); - clock_t start, end; - start = clock(); - for (int i = 0; i < test_size; i++) - { - int iat1 = rand() % test_size; - int iat2 = rand() % test_size; - hamilt::AtomPair tmp(iat1, iat2); - tmp.set_size(10, 10); - for (int j = 0; j < 100; j++) - { - auto p = tmp.get_HR_values(0, 0, j).get_pointer(); - p[0] = i * 1.0; - } - HR_test.insert_pair(tmp); - } - end = clock(); - std::cout << "total atom pairs: " << HR_test.size_atom_pairs() << std::endl; - int count = 0; - for (int i = 0; i < HR_test.size_atom_pairs(); i++) - { - auto tmp = HR_test.get_atom_pair(i); - count += tmp.get_R_size(); - } - std::cout << "total I-J-R: " << count << std::endl; - std::cout << "pure data size of I-J-R: " << count * 10 * 10 * sizeof(double) / 1024.0 / 1024.0 << " MB" - << std::endl; - std::cout << "memory: " << double(HR_test.get_memory_size()) / 1024.0 / 1024.0 << " MB" << std::endl; - std::cout << "time: " << (double)(end - start) / CLOCKS_PER_SEC << std::endl; -} - -// using TEST_F to test HContainer::find_pair -TEST_F(HContainerTest, find_pair) -{ - // find_pair 1000000 times with random iat1 and iat2 - srand((unsigned)time(nullptr)); - clock_t start, end; - start = clock(); - for (int i = 0; i < test_size * 100; i++) - { - int iat1 = rand() % test_size; - int iat2 = rand() % test_size; - auto tmp = HR->find_pair(iat1, iat2); - if (tmp == nullptr) - { - std::cout << "not found" << std::endl; - } - } - end = clock(); - std::cout << "time: " << (double)(end - start) / CLOCKS_PER_SEC << std::endl; -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/test/test_transfer.cpp b/source/module_hamilt_lcao/module_hcontainer/test/test_transfer.cpp deleted file mode 100644 index b34de091a7..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/test/test_transfer.cpp +++ /dev/null @@ -1,413 +0,0 @@ -#include "gtest/gtest.h" -#include "../transfer.h" -#include "../hcontainer.h" -#include -#ifdef __MPI -#include -#include "../hcontainer_funcs.h" -#endif - -// test_size is the number of atoms in the unitcell -// modify test_size to test different size of unitcell -int test_size = 2; -int test_nw = 10; - -class TransferTest : public ::testing::Test -{ - protected: - void SetUp() override - { -#ifdef __MPI - // MPI parallel settings - MPI_Comm_size(MPI_COMM_WORLD, &dsize); - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); -#endif - - // set up a unitcell, with one element and test_size atoms, each atom has test_nw orbitals - ucell.ntype = 1; - ucell.nat = test_size; - ucell.atoms = new Atom[ucell.ntype]; - ucell.iat2it = new int[ucell.nat]; - ucell.iat2ia = new int[ucell.nat]; - ucell.itia2iat.create(ucell.ntype, ucell.nat); - for (int iat = 0; iat < ucell.nat; iat++) - { - ucell.iat2it[iat] = 0; - ucell.iat2ia[iat] = iat; - ucell.itia2iat(0, iat) = iat; - } - ucell.atoms[0].na = test_size; - ucell.atoms[0].nw = test_nw; - ucell.set_iat2iwt(1); - init_parav(); - // set up a HContainer with ucell - HR_para = new hamilt::HContainer(ucell, paraV); - } - - void TearDown() override - { - delete HR_para; - delete paraV; - delete[] ucell.atoms; - } - -#ifdef __MPI - void init_parav() - { - int nb = 2; - int global_row = test_size * test_nw; - int global_col = test_size * test_nw; - std::ofstream ofs_running; - paraV = new Parallel_Orbitals(); - paraV->init(global_row, global_col, nb, MPI_COMM_WORLD); - paraV->set_atomic_trace(ucell.get_iat2iwt(), test_size, global_row); - } -#else - void init_parav() - {} -#endif - - UnitCell ucell; - hamilt::HContainer* HR_para = nullptr; - Parallel_Orbitals *paraV; - - int dsize; - int my_rank = 0; -}; - -TEST_F(TransferTest, serialToPara) -{ -// get rank of process -#ifdef __MPI - - hamilt::HContainer* HR_serial = nullptr; - -// initialize HR_serial - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - // if the master process, calculate the value of HR_serial and send to other processes - if (my_rank == 0) - { - HR_serial = new hamilt::HContainer(ucell); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_serial->size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_serial->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return ((double(atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - for(int k = 0; k < test_nw; k++) - { - for(int l = 0; l < test_nw; l++) - { - *data = value(k, l); - ++data; - } - } - } - } - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::transferSerial2Parallels(*HR_serial, HR_para, 0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 = std::chrono::duration_cast>(end_time - start_time); - - start_time = std::chrono::high_resolution_clock::now(); - // check data in HR_para -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_para->size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_para->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return ((double(atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - auto row_indexes = paraV->get_indexes_row(atom_i); - auto col_indexes = paraV->get_indexes_col(atom_j); - for(int k = 0; k < row_indexes.size(); k++) - { - for(int l = 0; l < col_indexes.size(); l++) - { - EXPECT_NEAR(*data, value(row_indexes[k], col_indexes[l]), 1e-10); - ++data; - } - } - } - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 = std::chrono::duration_cast>(end_time - start_time); - if(my_rank == 0) - { - delete HR_serial; - } - - std::cout <<"rank: "<* HR_serial = nullptr; - - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - // initialize HR_para -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_para->size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_para->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return (((atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - auto row_indexes = paraV->get_indexes_row(atom_i); - auto col_indexes = paraV->get_indexes_col(atom_j); - for(int k = 0; k < row_indexes.size(); k++) - { - for(int l = 0; l < col_indexes.size(); l++) - { - *data = value(row_indexes[k], col_indexes[l]); - ++data; - } - } - } - - // initialize HR_serial - // if the master process, calculate the value of HR_serial and send to other processes - if (my_rank == 0) - { - HR_serial = new hamilt::HContainer(ucell); - } - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::transferParallels2Serial(*HR_para, HR_serial, 0); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 = std::chrono::duration_cast>(end_time - start_time); - - start_time = std::chrono::high_resolution_clock::now(); - // check data in HR_serial - if(my_rank == 0) - { -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_serial->size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_serial->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return (((atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - for(int k = 0; k < test_nw; k++) - { - for(int l = 0; l < test_nw; l++) - { - EXPECT_NEAR(*data , value(k, l), 1e-10); - ++data; - } - } - } - delete HR_serial; - } - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 = std::chrono::duration_cast>(end_time - start_time); - std::cout <<"rank: "<* HR_serial2; - if(my_rank == 0) - { - HR_serial2 = new hamilt::HContainer(&serialV); - } - hamilt::gatherParallels(*HR_para, HR_serial2, 0); - if(my_rank == 0) - { -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_serial2->size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_serial2->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return (((atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - for(int k = 0; k < test_nw; k++) - { - for(int l = 0; l < test_nw; l++) - { - EXPECT_NEAR(*data , value(k, l), 1e-10); - ++data; - } - } - } - delete HR_serial2; - } -#endif -} - -TEST_F(TransferTest, serialAllToParaAll) -{ -// get rank of process -#ifdef __MPI - -// initialize HR_serial - std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); - // for each process, calculate the value of HR_serial and send to other processes - hamilt::HContainer HR_serial(ucell); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_serial.size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_serial.get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return ((double(atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - for(int k = 0; k < test_nw; k++) - { - for(int l = 0; l < test_nw; l++) - { - *data = value(k, l); - ++data; - } - } - } - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - start_time = std::chrono::high_resolution_clock::now(); - hamilt::transferSerials2Parallels(HR_serial, HR_para); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 = std::chrono::duration_cast>(end_time - start_time); - - start_time = std::chrono::high_resolution_clock::now(); - // check data in HR_para -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_para->size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_para->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return ((double(atom_i*test_nw+k)*test_size+atom_j)*test_nw + l)*dsize;}; - double* data = atom_pair.get_pointer(0); - auto row_indexes = paraV->get_indexes_row(atom_i); - auto col_indexes = paraV->get_indexes_col(atom_j); - for(int k = 0; k < row_indexes.size(); k++) - { - for(int l = 0; l < col_indexes.size(); l++) - { - EXPECT_NEAR(*data, value(row_indexes[k], col_indexes[l]), 1e-10); - ++data; - } - } - } - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 = std::chrono::duration_cast>(end_time - start_time); - - std::cout <<"rank: "<size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_para->get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return ((double(atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - auto row_indexes = paraV->get_indexes_row(atom_i); - auto col_indexes = paraV->get_indexes_col(atom_j); - for(int k = 0; k < row_indexes.size(); k++) - { - for(int l = 0; l < col_indexes.size(); l++) - { - *data = value(row_indexes[k], col_indexes[l]); - ++data; - } - } - } - // prepare memory for HR_serial - hamilt::HContainer HR_serial(ucell); - std::chrono::high_resolution_clock::time_point end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time0 = std::chrono::duration_cast>(end_time - start_time); - - start_time = std::chrono::high_resolution_clock::now(); - hamilt::transferParallels2Serials(*HR_para, &HR_serial); - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time1 = std::chrono::duration_cast>(end_time - start_time); - - start_time = std::chrono::high_resolution_clock::now(); - // check data in HR_serial -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(int i = 0; i < HR_serial.size_atom_pairs(); i++) - { - hamilt::AtomPair& atom_pair = HR_serial.get_atom_pair(i); - int atom_i = atom_pair.get_atom_i(); - int atom_j = atom_pair.get_atom_j(); - //lambda function to calculate value of array: (atom_i*test_size+atom_j+k)*test_nw + l - auto value = [&](int k, int l) -> double {return ((double(atom_i*test_nw+k)*test_size+atom_j)*test_nw + l);}; - double* data = atom_pair.get_pointer(0); - for(int k = 0; k < test_nw; k++) - { - for(int l = 0; l < test_nw; l++) - { - EXPECT_NEAR(*data , value(k, l), 1e-10); - ++data; - } - } - } - end_time = std::chrono::high_resolution_clock::now(); - std::chrono::duration elapsed_time2 = std::chrono::duration_cast>(end_time - start_time); - - std::cout <<"rank: "<iat2iwt.resize(this->nat); - this->npol = npol_in; - int iat=0; - int iwt=0; - for(int it = 0;it < this->ntype; it++) - { - for(int ia=0; iaiat2iwt[iat] = iwt; - iwt += atoms[it].nw * this->npol; - ++iat; - } - } - return; -} \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/transfer.cpp b/source/module_hamilt_lcao/module_hcontainer/transfer.cpp deleted file mode 100644 index 81320cb689..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/transfer.cpp +++ /dev/null @@ -1,672 +0,0 @@ -#include "./transfer.h" - -#include - -#include "source_base/blas_connector.h" -#include "source_base/global_function.h" -#ifdef __MPI -#include - -#include - -namespace hamilt -{ - -// ------------------------------------------------ -// HTransPara -// ------------------------------------------------ - -template -HTransPara::HTransPara(int n_processes, HContainer* hr_in) -{ - this->hr = hr_in; - this->ap_indexes.resize(n_processes); - this->size_values.resize(n_processes); - this->paraV = hr_in->get_atom_pair(0).get_paraV(); - this->atom_i_index.resize(n_processes); -} - -template -HTransPara::~HTransPara() -{ -} - -// cal_orb_indexes -template -void HTransPara::cal_orb_indexes(int irank, std::vector* orb_indexes) -{ - // calculate the size of orb_indexes - int size_orb_indexes = 1; -#ifdef __DEBUG - assert(orb_indexes != nullptr); - assert(this->atom_i_index.size() > 0); -#endif - // loop atoms and cal total size - for (int i = 0; i < this->atom_i_index[irank].size(); ++i) - { - int atom = this->atom_i_index[irank][i]; - size_orb_indexes += 3; - size_orb_indexes += this->paraV->get_row_size(atom); - size_orb_indexes += this->paraV->get_col_size(atom); - } - orb_indexes->resize(size_orb_indexes); - int* data = orb_indexes->data(); - // size of atom - *data++ = this->atom_i_index[irank].size(); - for (int i = 0; i < this->atom_i_index[irank].size(); ++i) - { - int atom = this->atom_i_index[irank][i]; - // atom index - *data++ = atom; - // size of row for this atom - *data = this->paraV->get_row_size(atom); - if (*data++ > 0) - { - // indexes of row for this atom - auto row_indexes = this->paraV->get_indexes_row(atom); - for (int k = 0; k < row_indexes.size(); k++) - { - *data++ = row_indexes[k]; - } - } - // size of col for this atom - *data = this->paraV->get_col_size(atom); - if (*data++ > 0) - { - // indexes of col for this atom - auto col_indexes = this->paraV->get_indexes_col(atom); - for (int k = 0; k < col_indexes.size(); k++) - { - *data++ = col_indexes[k]; - } - } - } -#ifdef __DEBUG - assert(data - orb_indexes->data() == size_orb_indexes); -#endif - return; -} - -// receive_ap_indexes -template -void HTransPara::receive_ap_indexes(int irank, const int* ap_indexes_in, const long& size_ap_indexes_in) -{ - // sender and receiver are not same process - if (ap_indexes_in == nullptr) - { - long size_ap_indexes = 0; - MPI_Recv(&size_ap_indexes, 1, MPI_LONG, irank, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - this->ap_indexes[irank].resize(size_ap_indexes); - MPI_Recv(this->ap_indexes[irank].data(), size_ap_indexes, MPI_INT, irank, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - } - // sender and receiver are same process - else - { - this->ap_indexes[irank].assign(ap_indexes_in, ap_indexes_in + size_ap_indexes_in); - } - // calculate the size of values - this->size_values[irank] = 0; - const int number_atom = this->ap_indexes[irank][0]; - const int* ap_data = this->ap_indexes[irank].data() + 1; - std::set atom_set; - for (int i = 0; i < number_atom; ++i) - { - const int atom_i = *ap_data++; - atom_set.insert(atom_i); - const int number_atom_j = *ap_data++; - const int size_row = this->paraV->get_row_size(atom_i); - for (int j = 0; j < number_atom_j; ++j) - { - const int atom_j = *ap_data++; - atom_set.insert(atom_j); - const int size_col = this->paraV->get_col_size(atom_j); - const int number_R = *ap_data++; - if (size_row > 0 && size_col > 0) - { - this->size_values[irank] += size_row * size_col * number_R; - } - ap_data += number_R * 3; - } - } - // revert atom_set to atom_i_index[irank] - this->atom_i_index[irank].resize(atom_set.size()); - std::copy(atom_set.begin(), atom_set.end(), this->atom_i_index[irank].begin()); -#ifdef __DEBUG - assert(ap_data - this->ap_indexes[irank].data() == this->ap_indexes[irank].size()); -#endif - return; -} - -// send_orb_indexes -template -void HTransPara::send_orb_indexes(int irank, MPI_Request* request) -{ - std::vector orb_indexes; - this->cal_orb_indexes(irank, &orb_indexes); - long size_orb_indexes = orb_indexes.size(); - if (request != nullptr) - { - MPI_Isend(&size_orb_indexes, 1, MPI_LONG, irank, 0, MPI_COMM_WORLD, request); - MPI_Isend(orb_indexes.data(), orb_indexes.size(), MPI_INT, irank, 1, MPI_COMM_WORLD, request); - } - else - { - MPI_Send(&size_orb_indexes, 1, MPI_LONG, irank, 0, MPI_COMM_WORLD); - MPI_Send(orb_indexes.data(), orb_indexes.size(), MPI_INT, irank, 1, MPI_COMM_WORLD); - } -} - -template -void HTransPara::send_data(int irank, MPI_Request* request) -{ - std::vector values(this->size_values[irank]); - this->pack_data(irank, values.data()); - if (request != nullptr) - { - MPI_Isend(values.data(), values.size(), MPITraits::datatype(), irank, 2, MPI_COMM_WORLD, request); - } - else - { - MPI_Send(values.data(), values.size(), MPITraits::datatype(), irank, 2, MPI_COMM_WORLD); - } -} - -template -void HTransPara::receive_data(int irank, const T* values) -{ - // sender and receiver are not same process - if (values == nullptr) - { - std::vector values_tmp(this->size_values[irank]); - MPI_Recv(values_tmp.data(), - values_tmp.size(), - MPITraits::datatype(), - irank, - 0, - MPI_COMM_WORLD, - MPI_STATUS_IGNORE); - this->unpack_data(irank, values_tmp.data()); - } - else - { - this->unpack_data(irank, values); - } -} - -template -void HTransPara::pack_data(int irank, T* values) -{ -#ifdef __DEBUG - assert(values != nullptr); - assert(this->size_values[irank] != 0); -#endif - const int number_atom = this->ap_indexes[irank][0]; - const int* ap_data = this->ap_indexes[irank].data() + 1; - - T* value_data = values; - for (int i = 0; i < number_atom; ++i) - { - const int atom_i = *ap_data++; - const int number_atom_j = *ap_data++; - const int size_row = this->paraV->get_row_size(atom_i); - for (int j = 0; j < number_atom_j; ++j) - { - const int atom_j = *ap_data++; - const int size_col = this->paraV->get_col_size(atom_j); - const int number_R = *ap_data++; - for (int k = 0; k < number_R; ++k) - { - int r_index[3]; - r_index[0] = *ap_data++; - r_index[1] = *ap_data++; - r_index[2] = *ap_data++; - if (size_row > 0 && size_col > 0) - { - const T* matrix_pointer = this->hr->data(atom_i, atom_j, r_index); - ModuleBase::GlobalFunc::COPYARRAY(matrix_pointer, value_data, size_row * size_col); - value_data += size_row * size_col; - } - } - } - } -#ifdef __DEBUG - assert(value_data - values == this->size_values[irank]); -#endif - return; -} - -template -void HTransPara::unpack_data(int irank, const T* values) -{ -#ifdef __DEBUG - assert(values != nullptr); - assert(this->size_values[irank] != 0); -#endif - const T alpha(1.0); - const int number_atom = this->ap_indexes[irank][0]; - // loop AtomPairs and unpack values - int* ap_data = this->ap_indexes[irank].data() + 1; - - const T* value_data = values; - - for (int i = 0; i < number_atom; ++i) - { - const int atom_i = *ap_data++; - const int size_row = this->paraV->get_row_size(atom_i); - const int size_j = *ap_data++; - for (int j = 0; j < size_j; ++j) - { - const int atom_j = *ap_data++; - const int size_col = this->paraV->get_col_size(atom_j); - const int number_R = *ap_data++; - for (int k = 0; k < number_R; ++k) - { - int r_index[3]; - r_index[0] = *ap_data++; - r_index[1] = *ap_data++; - r_index[2] = *ap_data++; - if (size_row > 0 && size_col > 0) - { - T* matrix_pointer = this->hr->data(atom_i, atom_j, r_index); - BlasConnector::axpy(size_row * size_col, alpha, value_data, 1, matrix_pointer, 1); - value_data += size_row * size_col; - } - } - } - } -#ifdef __DEBUG - //assert(value_data - values == this->data_size[irank]); - assert(ap_data - this->ap_indexes[irank].data() == this->ap_indexes[irank].size()); -#endif -} - -template -long HTransPara::get_max_size() const -{ - return *std::max_element(this->size_values.begin(), this->size_values.end()); -} - -template -void HTransPara::get_value_size(int* out) const -{ - for (int i = 0; i < this->size_values.size(); ++i) - { - out[i] = this->size_values[i]; - } - return; -} - -// ------------------------------------------------ -// HTransSerial -// ------------------------------------------------ - -template -HTransSerial::HTransSerial(int n_processes, HContainer* hr_in) -{ - this->hr = hr_in; - this->orb_indexes.resize(n_processes); - this->size_values.resize(n_processes); - this->orb_col_indexes.resize(n_processes); - this->orb_row_indexes.resize(n_processes); -} - -template -HTransSerial::~HTransSerial() -{ -} - -template -void HTransSerial::cal_ap_indexes(int irank, std::vector* ap_indexes) -{ - // calculate the size of ap_indexes - long size_ap_indexes = this->hr->size_atom_pairs() * 2; // count of atom_j and size_r - for (int i = 0; i < this->hr->size_atom_pairs(); i++) - { - size_ap_indexes += this->hr->get_atom_pair(i).get_R_size() * 3; // count of rx, ry, rz - } - auto& sparse_ap = this->hr->get_sparse_ap(); - int size_atom = 0; - for (int i = 0; i < sparse_ap.size(); i++) - { - if (sparse_ap[i].size() > 0) - { - size_atom++; - } - } - size_ap_indexes += size_atom * 2 + 1; // count of atom_i and size_j and size_i - ap_indexes->resize(size_ap_indexes); - int* data = ap_indexes->data(); - // size of atom - *data++ = size_atom; - auto& sparse_ap_index = this->hr->get_sparse_ap_index(); - for (int atom = 0; atom < sparse_ap.size(); ++atom) - { - if (sparse_ap[atom].size() > 0) - { - // atom index - *data++ = atom; - // size of atom_j - *data++ = sparse_ap[atom].size(); - // loop of atom_j - for (int j = 0; j < sparse_ap[atom].size(); j++) - { - // atom_j index - *data++ = sparse_ap[atom][j]; - hamilt::AtomPair& atom_pair = this->hr->get_atom_pair(sparse_ap_index[atom][j]); - // size of R - *data++ = atom_pair.get_R_size(); - // loop of R - for (int k = 0; k < atom_pair.get_R_size(); k++) - { - const ModuleBase::Vector3 r_index = atom_pair.get_R_index(k); - // rx - *data++ = r_index.x; - // ry - *data++ = r_index.y; - // rz - *data++ = r_index.z; - } - } - } - } -#ifdef __DEBUG - assert(data - ap_indexes->data() == size_ap_indexes); -#endif - // size of atom - return; -} - -template -void HTransSerial::send_ap_indexes(int irank, MPI_Request* request) -{ - std::vector ap_indexes; - this->cal_ap_indexes(irank, &ap_indexes); - long size_ap_indexes = ap_indexes.size(); - if (request != nullptr) - { - MPI_Isend(&size_ap_indexes, 1, MPI_LONG, irank, 0, MPI_COMM_WORLD, request); - MPI_Isend(ap_indexes.data(), ap_indexes.size(), MPI_INT, irank, 1, MPI_COMM_WORLD, request); - } - else - { - MPI_Send(&size_ap_indexes, 1, MPI_LONG, irank, 0, MPI_COMM_WORLD); - MPI_Send(ap_indexes.data(), ap_indexes.size(), MPI_INT, irank, 1, MPI_COMM_WORLD); - } -} - -// receive_orb_indexes -template -void HTransSerial::receive_orb_indexes(int irank, const int* orb_indexes_in, const long& size_orb_indexes_in) -{ - // sender and receiver are not same process - if (orb_indexes_in == nullptr) - { - long size_orb_indexes = 0; - MPI_Recv(&size_orb_indexes, 1, MPI_LONG, irank, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - this->orb_indexes[irank].resize(size_orb_indexes); - MPI_Recv(this->orb_indexes[irank].data(), - size_orb_indexes, - MPI_INT, - irank, - 1, - MPI_COMM_WORLD, - MPI_STATUS_IGNORE); - } - // sender and receiver are same process - else - { - this->orb_indexes[irank].assign(orb_indexes_in, orb_indexes_in + size_orb_indexes_in); - } - // calculate the index of row and col for each atom - this->size_values[irank] = 0; - const int number_atom = this->orb_indexes[irank][0]; - const int* orb_data = this->orb_indexes[irank].data() + 1; - for (int i = 0; i < number_atom; ++i) - { - const int atom_i = *orb_data++; - this->orb_row_indexes[irank][atom_i] = orb_data - orb_indexes[irank].data(); - orb_data += *orb_data + 1; - this->orb_col_indexes[irank][atom_i] = orb_data - orb_indexes[irank].data(); - orb_data += *orb_data + 1; - } -#ifdef __DEBUG - assert(orb_data - this->orb_indexes[irank].data() == this->orb_indexes[irank].size()); -#endif - // calculate the size of values - for (int iap = 0; iap < this->hr->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& atom_pair = this->hr->get_atom_pair(iap); - const int atom_i = atom_pair.get_atom_i(); - const int atom_j = atom_pair.get_atom_j(); - const int size_row = this->orb_indexes[irank][this->orb_row_indexes[irank][atom_i]]; - const int size_col = this->orb_indexes[irank][this->orb_col_indexes[irank][atom_j]]; - const int number_R = atom_pair.get_R_size(); - if (size_row > 0 && size_col > 0) - { - this->size_values[irank] += size_row * size_col * number_R; - } - } -} - -template -void HTransSerial::send_data(int irank, MPI_Request* request) -{ - std::vector values(this->size_values[irank]); - this->pack_data(irank, values.data()); - if (request != nullptr) - { - MPI_Isend(values.data(), values.size(), MPITraits::datatype(), irank, 2, MPI_COMM_WORLD, request); - } - else - { - MPI_Send(values.data(), values.size(), MPITraits::datatype(), irank, 2, MPI_COMM_WORLD); - } -} - -template -void HTransSerial::receive_data(int irank, const T* values) -{ - // sender and receiver are not same process - if (values == nullptr) - { - std::vector values_tmp(this->size_values[irank]); - MPI_Recv(values_tmp.data(), - values_tmp.size(), - MPITraits::datatype(), - irank, - 2, - MPI_COMM_WORLD, - MPI_STATUS_IGNORE); - this->unpack_data(irank, values_tmp.data()); - } - else - { - this->unpack_data(irank, values); - } -} - -template -void HTransSerial::pack_data(int irank, T* values) -{ -#ifdef __DEBUG - assert(values != nullptr); - assert(this->size_values[irank] != 0); -#endif - auto& sparse_ap = this->hr->get_sparse_ap(); - auto& sparse_ap_index = this->hr->get_sparse_ap_index(); - -#ifdef _OPENMP - // calculate the index of each atom - std::vector value_atoms(sparse_ap.size(), values); - long size_begin = 0; - for (int i = 0; i < sparse_ap.size(); ++i) - { - value_atoms[i] += size_begin; - const int atom_i = i; - if(sparse_ap[i].size() == 0) continue; - const int size_row = this->orb_indexes[irank][this->orb_row_indexes[irank][atom_i]]; - for (int j = 0; j < sparse_ap[i].size(); ++j) - { - const int atom_j = sparse_ap[i][j]; - const int size_col = this->orb_indexes[irank][this->orb_col_indexes[irank][atom_j]]; - const int number_R = this->hr->get_atom_pair(sparse_ap_index[i][j]).get_R_size(); - size_begin += size_row * size_col * number_R; - } - } - -#pragma omp parallel for -#else - T* value_data = values; -#endif - for (int i = 0; i < sparse_ap.size(); ++i) - { -#ifdef _OPENMP - T* value_data = value_atoms[i]; -#endif - if (sparse_ap[i].size() == 0) - { - continue; - } - const int atom_i = i; - const int size_row = this->orb_indexes[irank][this->orb_row_indexes[irank][atom_i]]; - if (size_row == 0) - { - continue; - } - const int* row_index = this->orb_indexes[irank].data() + this->orb_row_indexes[irank][atom_i] + 1; - for (int j = 0; j < sparse_ap[i].size(); ++j) - { - const int atom_j = sparse_ap[i][j]; - const int size_col = this->orb_indexes[irank][this->orb_col_indexes[irank][atom_j]]; - if (size_col == 0) - { - continue; - } - const int* col_index = this->orb_indexes[irank].data() + this->orb_col_indexes[irank][atom_j] + 1; - const hamilt::AtomPair& tmp_ap = this->hr->get_atom_pair(sparse_ap_index[i][j]); - const int number_R = tmp_ap.get_R_size(); - for (int k = 0; k < number_R; ++k) - { - const hamilt::BaseMatrix& matrix = tmp_ap.get_HR_values(k); - for (int irow = 0; irow < size_row; ++irow) - { - const int mu = row_index[irow]; - for (int icol = 0; icol < size_col; ++icol) - { - const int nu = col_index[icol]; - *value_data++ = matrix.get_value(mu, nu); - } - } - } - } - } -#ifdef __DEBUG - //assert(value_data - values == this->size_values[irank]); -#endif - return; -} - -template -void HTransSerial::unpack_data(int irank, const T* values) -{ -#ifdef __DEBUG - assert(values != nullptr); - assert(this->size_values[irank] != 0); -#endif - auto& sparse_ap = this->hr->get_sparse_ap(); - auto& sparse_ap_index = this->hr->get_sparse_ap_index(); - -#ifdef _OPENMP - // calculate the index of each atom - std::vector value_atoms(sparse_ap.size(), values); - long size_begin = 0; - for (int i = 0; i < sparse_ap.size(); ++i) - { - value_atoms[i] += size_begin; - const int atom_i = i; - if(sparse_ap[i].size() == 0) continue; - const int size_row = this->orb_indexes[irank][this->orb_row_indexes[irank][atom_i]]; - for (int j = 0; j < sparse_ap[i].size(); ++j) - { - const int atom_j = sparse_ap[i][j]; - const int size_col = this->orb_indexes[irank][this->orb_col_indexes[irank][atom_j]]; - const int number_R = this->hr->get_atom_pair(sparse_ap_index[i][j]).get_R_size(); - size_begin += size_row * size_col * number_R; - } - } - -#pragma omp parallel for -#else - const T* value_data = values; -#endif - for (int i = 0; i < sparse_ap.size(); ++i) - { -#ifdef _OPENMP - const T* value_data = value_atoms[i]; -#endif - if (sparse_ap[i].size() == 0) - { - continue; - } - const int atom_i = i; - const int size_row = this->orb_indexes[irank][this->orb_row_indexes[irank][atom_i]]; - if (size_row == 0) - { - continue; - } - const int* row_index = this->orb_indexes[irank].data() + this->orb_row_indexes[irank][atom_i] + 1; - for (int j = 0; j < sparse_ap[i].size(); ++j) - { - const int atom_j = sparse_ap[i][j]; - const int size_col = this->orb_indexes[irank][this->orb_col_indexes[irank][atom_j]]; - if (size_col == 0) - { - continue; - } - const int* col_index = this->orb_indexes[irank].data() + this->orb_col_indexes[irank][atom_j] + 1; - const hamilt::AtomPair& tmp_ap = this->hr->get_atom_pair(sparse_ap_index[i][j]); - const int number_R = tmp_ap.get_R_size(); - for (int k = 0; k < number_R; ++k) - { - const hamilt::BaseMatrix& matrix = tmp_ap.get_HR_values(k); - for (int irow = 0; irow < size_row; ++irow) - { - const int mu = row_index[irow]; - for (int icol = 0; icol < size_col; ++icol) - { - const int nu = col_index[icol]; - matrix.get_value(mu, nu) = *value_data++; - } - } - } - } - } -#ifdef __DEBUG - //assert(value_data - values == this->size_values[irank]); -#endif - return; -} - -template -long HTransSerial::get_max_size() const -{ - return *std::max_element(this->size_values.begin(), this->size_values.end()); -} -template -void HTransSerial::get_value_size(int* out) const -{ - for (int i = 0; i < this->size_values.size(); ++i) - { - out[i] = this->size_values[i]; - } - return; -} - -template class HTransPara; -template class HTransPara>; -template class HTransSerial; -template class HTransSerial>; - -} // end namespace hamilt - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_hcontainer/transfer.h b/source/module_hamilt_lcao/module_hcontainer/transfer.h deleted file mode 100644 index 5b274cbad3..0000000000 --- a/source/module_hamilt_lcao/module_hcontainer/transfer.h +++ /dev/null @@ -1,184 +0,0 @@ -#ifndef HCONTAINERTRANSFER_H -#define HCONTAINERTRANSFER_H - -#include -#include - -#include "source_base/vector3.h" -#include "./hcontainer.h" - -#ifdef __MPI -namespace hamilt -{ - -template -class HTransPara -{ - public: - HTransPara(int n_processes, HContainer* hr_in); - ~HTransPara(); - - /** - * @brief calculate Orbital indexes and will be send to irank - * the format of the return value is: - * [size_i, atom_i, number_orb_row, 0, 1, 2, 3, 8, 9, 10, 11, number_orb_col, ... atom_i, number_orb_row, 4, 5, 6, - * 7, atom_i, ... number_orb_col, ...] i refers to the ith atom in this->ap_indexes[irank] the function is called in - * plan_indexes - * @param irank - * @param orb_indexes - */ - void cal_orb_indexes(int irank, std::vector* orb_indexes = nullptr); - - /** - * @brief receive AtomPair_indexes from the ith rank - * save to this->ap_indexes[irank] - * @param irank - */ - void receive_ap_indexes(int irank, const int* ap_indexes_in = nullptr, const long& size_ap_indexes_in = 0); - - /** - * @brief pack data in this->hr, and send to ith rank - * @param irank - */ - void send_orb_indexes(int irank, MPI_Request* request = nullptr); - - /** - * @brief pack data in this->hr, and send to ith rank - * @param irank - */ - void send_data(int irank, MPI_Request* request = nullptr); - - /** - * @brief receive data from ith rank, save them to this->hr - * @param irank - */ - void receive_data(int irank, const T* values = nullptr); - - /** - * @brief pack BaseMatrix-values for ith rank - * @param irank - */ - void pack_data(int irank, T* values = nullptr); - - long get_max_size() const; - void get_value_size(int* out) const; - - private: - std::vector> ap_indexes; - HContainer* hr = nullptr; - - // temporary variables - std::vector> atom_i_index; - - const Parallel_Orbitals* paraV = nullptr; - - // unpack BaseMatrix-values from ith rank - void unpack_data(int irank, const T* values); - - // size of data of all BaseMatrixes - std::vector size_values; -}; - -template -class HTransSerial -{ - public: - HTransSerial(int n_processes, HContainer* hr_in); - ~HTransSerial(); - - /** - * @brief calculate AtomPair indexes and will be send to irank - * called in plan_indexes - * @param irank - */ - void cal_ap_indexes(int irank, std::vector* ap_indexes = nullptr); - - /** - * @brief calculate AtomPair_indexes of hr_in and send to the ith rank - * @param irank - */ - void send_ap_indexes(int irank, MPI_Request* request = nullptr); - - /** - * @brief receive Orbital_indexes from the ith rank - * save to this->orb_indexes[irank] - */ - void receive_orb_indexes(int irank, const int* orb_indexes_in = nullptr, const long& size_orb_indexes_in = 0); - - /** - * @brief pack data in this->hr, and send to ith rank - * @param irank - */ - void send_data(int irank, MPI_Request* request = nullptr); - - /** - * @brief receive data from ith rank, save them to this->hr - * @param irank - */ - void receive_data(int irank, const T* values = nullptr); - - /** - * @brief pack BaseMatrix-values for ith rank - * @param irank - */ - void pack_data(int irank, T* values = nullptr); - - long get_max_size() const; - void get_value_size(int* out) const; - - private: - std::vector> orb_indexes; - HContainer* hr = nullptr; - - /** - * @brief unpack BaseMatrix-values from ith rank - * @param values - */ - void unpack_data(int irank, const T* values); - - // temporary variables - std::vector> orb_col_indexes; - std::vector> orb_row_indexes; - - // size of data of all BaseMatrixes - std::vector size_values; -}; - -} // namespace hamilt - -/** - * @brief Struct to get MPI_datatype - */ -template -struct MPITraits; - -template <> -struct MPITraits -{ - static MPI_Datatype datatype() - { - return MPI_INT; - } -}; - -template <> -struct MPITraits -{ - static MPI_Datatype datatype() - { - return MPI_DOUBLE; - } -}; - -template <> -struct MPITraits> -{ - static MPI_Datatype datatype() - { - return MPI_DOUBLE_COMPLEX; - } -}; - -#endif // __MPI - -#endif // HCONTAINERTRANSFER_H \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/CMakeLists.txt b/source/module_hamilt_lcao/module_tddft/CMakeLists.txt deleted file mode 100644 index 58bc834a5f..0000000000 --- a/source/module_hamilt_lcao/module_tddft/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -if(ENABLE_LCAO) - list(APPEND objects - evolve_elec.cpp - evolve_psi.cpp - band_energy.cpp - middle_hamilt.cpp - norm_psi.cpp - propagator.cpp - propagator_cn2.cpp - propagator_taylor.cpp - propagator_etrs.cpp - upsi.cpp - td_info.cpp - velocity_op.cpp - snap_psibeta_half_tddft.cpp - td_folding.cpp - solve_propagation.cpp - ) - - add_library( - tddft - OBJECT - ${objects} - ) - - if(ENABLE_COVERAGE) - add_coverage(tddft) - endif() - - IF (BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() - endif() - -endif() diff --git a/source/module_hamilt_lcao/module_tddft/band_energy.cpp b/source/module_hamilt_lcao/module_tddft/band_energy.cpp deleted file mode 100644 index e52678df6c..0000000000 --- a/source/module_hamilt_lcao/module_tddft/band_energy.cpp +++ /dev/null @@ -1,429 +0,0 @@ -#include "band_energy.h" - -#include "evolve_elec.h" -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI - -inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - int iblock, gIndex; - iblock = localindex / nblk; - gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} - -void compute_ekb(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* Htmp, - const std::complex* psi_k, - double* ekb, - std::ofstream& ofs_running) -{ - assert(pv->nloc_wfc > 0 && pv->nloc > 0); - - std::complex* tmp1 = new std::complex[pv->nloc_wfc]; - ModuleBase::GlobalFunc::ZEROS(tmp1, pv->nloc_wfc); - - std::complex* eij = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(eij, pv->nloc); - - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - Htmp, - 1, - 1, - pv->desc, - psi_k, - 1, - 1, - pv->desc_wfc, - 0.0, - tmp1, - 1, - 1, - pv->desc_wfc); - - ScalapackConnector::gemm('C', - 'N', - nband, - nband, - nlocal, - 1.0, - psi_k, - 1, - 1, - pv->desc_wfc, - tmp1, - 1, - 1, - pv->desc_wfc, - 0.0, - eij, - 1, - 1, - pv->desc_Eij); - - if (PARAM.inp.td_print_eij > 0.0) - { - ofs_running - << "------------------------------------------------------------------------------------------------" - << std::endl; - ofs_running << " Eij:" << std::endl; - for (int i = 0; i < pv->nrow_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol_bands; j++) - { - double aa = eij[in + j].real(); - double bb = eij[in + j].imag(); - if (std::abs(aa) < PARAM.inp.td_print_eij) - { - aa = 0.0; - } - if (std::abs(bb) < PARAM.inp.td_print_eij) - { - bb = 0.0; - } - if (aa > 0.0 || bb > 0.0) - { - ofs_running << i << " " << j << " " << aa << "+" << bb << "i " << std::endl; - } - } - } - ofs_running << std::endl; - ofs_running - << "------------------------------------------------------------------------------------------------" - << std::endl; - } - - int info = 0; - int naroc[2] = {0, 0}; - - assert(nband > 0); - double* eii = new double[nband]; - ModuleBase::GlobalFunc::ZEROS(eii, nband); - - for (int iprow = 0; iprow < pv->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) - { - if (iprow == pv->coord[0] && ipcol == pv->coord[1]) - { - naroc[0] = pv->nrow; - naroc[1] = pv->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); - if (igcol >= nband) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); - if (igrow >= nband) - { - continue; - } - if (igcol == igrow) - { - eii[igcol] = eij[j * naroc[0] + i].real(); - } - } - } - } - } // loop ipcol - } // loop iprow - info = MPI_Allreduce(eii, ekb, nband, MPI_DOUBLE, MPI_SUM, pv->comm()); - - delete[] tmp1; - delete[] eij; - delete[] eii; -} - -void compute_ekb_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Htmp, - const ct::Tensor& psi_k, - ct::Tensor& ekb, - std::ofstream& ofs_running) -{ - assert(pv->nloc_wfc > 0 && pv->nloc > 0); - - // Create Tensor objects for temporary data - ct::Tensor tmp1(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc_wfc})); - tmp1.zero(); - - ct::Tensor eij(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc})); - eij.zero(); - - // Perform matrix multiplication: tmp1 = Htmp * psi_k - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - Htmp.data>(), - 1, - 1, - pv->desc, - psi_k.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - tmp1.data>(), - 1, - 1, - pv->desc_wfc); - - // Perform matrix multiplication: eij = psi_k^dagger * tmp1 - ScalapackConnector::gemm('C', - 'N', - nband, - nband, - nlocal, - 1.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc, - tmp1.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - eij.data>(), - 1, - 1, - pv->desc_Eij); - - if (PARAM.inp.td_print_eij >= 0.0) - { - ofs_running - << "------------------------------------------------------------------------------------------------" - << std::endl; - ofs_running << " Eij:" << std::endl; - for (int i = 0; i < pv->nrow_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol_bands; j++) - { - double aa = eij.data>()[in + j].real(); - double bb = eij.data>()[in + j].imag(); - if (std::abs(aa) < PARAM.inp.td_print_eij) - { - aa = 0.0; - } - if (std::abs(bb) < PARAM.inp.td_print_eij) - { - bb = 0.0; - } - if (aa > 0.0 || bb > 0.0) - { - ofs_running << i << " " << j << " " << aa << "+" << bb << "i " << std::endl; - } - } - } - ofs_running << std::endl; - ofs_running - << "------------------------------------------------------------------------------------------------" - << std::endl; - } - - int info = 0; - int naroc[2] = {0, 0}; - - // Create a Tensor for eii - assert(nband > 0); - ct::Tensor eii(ct::DataType::DT_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({nband})); - eii.zero(); - - for (int iprow = 0; iprow < pv->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) - { - if (iprow == pv->coord[0] && ipcol == pv->coord[1]) - { - naroc[0] = pv->nrow; - naroc[1] = pv->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); - if (igcol >= nband) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); - if (igrow >= nband) - { - continue; - } - if (igcol == igrow) - { - eii.data()[igcol] = eij.data>()[j * naroc[0] + i].real(); - } - } - } - } - } // loop ipcol - } // loop iprow - - // Perform MPI reduction to compute ekb - info = MPI_Allreduce(eii.data(), ekb.data(), nband, MPI_DOUBLE, MPI_SUM, pv->comm()); -} - -template -void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Htmp, - const ct::Tensor& psi_k, - ct::Tensor& ekb, - std::ofstream& ofs_running) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Create Tensor objects for temporary data - ct::Tensor tmp1(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({nlocal * nband})); // tmp1 shape: nlocal * nband - tmp1.zero(); - - ct::Tensor eij(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({nlocal * nlocal})); // eij shape: nlocal * nlocal - // Why not use nband * nband ????? - eij.zero(); - - std::complex alpha = {1.0, 0.0}; - std::complex beta = {0.0, 0.0}; - - // Perform matrix multiplication: tmp1 = Htmp * psi_k - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nlocal, - &alpha, - Htmp.data>(), - nlocal, // Leading dimension of Htmp - psi_k.data>(), - nlocal, // Leading dimension of psi_k - &beta, - tmp1.data>(), - nlocal); // Leading dimension of tmp1 - - // Perform matrix multiplication: eij = psi_k^dagger * tmp1 - ct::kernels::blas_gemm, ct_Device>()('C', - 'N', - nband, - nband, - nlocal, - &alpha, - psi_k.data>(), - nlocal, // Leading dimension of psi_k - tmp1.data>(), - nlocal, // Leading dimension of tmp1 - &beta, - eij.data>(), - nlocal); // Leading dimension of eij - - if (PARAM.inp.td_print_eij >= 0.0) - { - ct::Tensor eij_cpu = eij.to_device(); - - ofs_running - << "------------------------------------------------------------------------------------------------" - << std::endl; - ofs_running << " Eij:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nband; j++) - { - double aa = eij_cpu.data>()[in + j].real(); - double bb = eij_cpu.data>()[in + j].imag(); - if (std::abs(aa) < PARAM.inp.td_print_eij) - { - aa = 0.0; - } - if (std::abs(bb) < PARAM.inp.td_print_eij) - { - bb = 0.0; - } - if (aa > 0.0 || bb > 0.0) - { - ofs_running << i << " " << j << " " << aa << "+" << bb << "i " << std::endl; - } - } - } - ofs_running << std::endl; - ofs_running - << "------------------------------------------------------------------------------------------------" - << std::endl; - } - - // Extract diagonal elements of eij into ekb - if (ct_device_type == ct::DeviceType::GpuDevice) - { - // GPU implementation - for (int i = 0; i < nband; ++i) - { - base_device::memory::synchronize_memory_op()( - ekb.data() + i, - reinterpret_cast(eij.data>() + i * nlocal + i), - 1); - } - } - else - { - // CPU implementation - for (int i = 0; i < nband; ++i) - { - ekb.data()[i] = eij.data>()[i * nlocal + i].real(); - } - } -} - -// Explicit instantiation of template functions -template void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Htmp, - const ct::Tensor& psi_k, - ct::Tensor& ekb, - std::ofstream& ofs_running); - -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Htmp, - const ct::Tensor& psi_k, - ct::Tensor& ekb, - std::ofstream& ofs_running); -#endif // __CUDA -#endif // __MPI - -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/band_energy.h b/source/module_hamilt_lcao/module_tddft/band_energy.h deleted file mode 100644 index 749ad692ca..0000000000 --- a/source/module_hamilt_lcao/module_tddft/band_energy.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file bandenegy.h - * @brief compute band energy ekb - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef BANDENERGY_H -#define BANDENERGY_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief compute band energy ekb - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] Htmp Hamiltonian - * @param[in] psi_k psi of this step - * @param[out] ekb band energy - */ -void compute_ekb(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* Htmp, - const std::complex* psi_k, - double* ekb, - std::ofstream& ofs_running); - -void compute_ekb_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Htmp, - const ct::Tensor& psi_k, - ct::Tensor& ekb, - std::ofstream& ofs_running); - -template -void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Htmp, - const ct::Tensor& psi_k, - ct::Tensor& ekb, - std::ofstream& ofs_running); -#endif // __MPI -} // namespace module_tddft -#endif diff --git a/source/module_hamilt_lcao/module_tddft/evolve_elec.cpp b/source/module_hamilt_lcao/module_tddft/evolve_elec.cpp deleted file mode 100644 index f9c31081f3..0000000000 --- a/source/module_hamilt_lcao/module_tddft/evolve_elec.cpp +++ /dev/null @@ -1,226 +0,0 @@ -#include "evolve_elec.h" - -#include "evolve_psi.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace module_tddft -{ -template -Evolve_elec::Evolve_elec(){}; -template -Evolve_elec::~Evolve_elec(){}; - -template -ct::DeviceType Evolve_elec::ct_device_type = ct::DeviceTypeToEnum::value; - -// this routine only serves for TDDFT using LCAO basis set -template -void Evolve_elec::solve_psi(const int& istep, - const int nband, - const int nlocal, - const int& nks, - hamilt::Hamilt>* phm, - Parallel_Orbitals& para_orb, - psi::Psi>* psi, - psi::Psi>* psi_laststep, - std::complex** Hk_laststep, - std::complex** Sk_laststep, - ModuleBase::matrix& ekb, - std::ofstream& ofs_running, - const int htype, - const int propagator, - const bool use_tensor, - const bool use_lapack) -{ - ModuleBase::TITLE("Evolve_elec", "solve_psi"); - ModuleBase::timer::tick("Evolve_elec", "solve_psi"); - - // Control the print of matrix to running_md.log - const int print_matrix = 0; - - for (int ik = 0; ik < nks; ik++) - { - phm->updateHk(ik); - - ModuleBase::timer::tick("Efficiency", "evolve_k"); - psi->fix_k(ik); - psi_laststep->fix_k(ik); - if (htype == 0) - { - evolve_psi(nband, - nlocal, - &(para_orb), - phm, - psi[0].get_pointer(), - psi_laststep[0].get_pointer(), - nullptr, - nullptr, - &(ekb(ik, 0)), - htype, - propagator, - ofs_running, - print_matrix); - } - else if (htype == 1) - { - if (!use_tensor) - { - evolve_psi(nband, - nlocal, - &(para_orb), - phm, - psi[0].get_pointer(), - psi_laststep[0].get_pointer(), - Hk_laststep[ik], - Sk_laststep[ik], - &(ekb(ik, 0)), - htype, - propagator, - ofs_running, - print_matrix); - // std::cout << "Print ekb: " << std::endl; - // ekb.print(std::cout); - } - else - { - const int len_psi_k_1 = use_lapack ? nband : psi->get_nbands(); - const int len_psi_k_2 = use_lapack ? nlocal : psi->get_nbasis(); - const int len_HS_laststep = use_lapack ? nlocal * nlocal : para_orb.nloc; - - // Create Tensor for psi_k, psi_k_laststep, H_laststep, S_laststep, ekb - ct::Tensor psi_k_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_psi_k_1, len_psi_k_2})); - ct::Tensor psi_k_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_psi_k_1, len_psi_k_2})); - ct::Tensor H_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_HS_laststep})); - ct::Tensor S_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_HS_laststep})); - ct::Tensor ekb_tensor(ct::DataType::DT_DOUBLE, ct_device_type, ct::TensorShape({nband})); - - // Global psi - ModuleESolver::Matrix_g> psi_g; - ModuleESolver::Matrix_g> psi_laststep_g; - - if (use_lapack) - { - // Need to gather the psi to the root process on CPU - // H_laststep and S_laststep are already gathered in esolver_ks_lcao_tddft.cpp -#ifdef __MPI - // Access the rank of the calling process in the communicator - int myid = 0; - int root_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - - // Gather psi to the root process - gatherPsi(myid, root_proc, psi[0].get_pointer(), para_orb, psi_g); - gatherPsi(myid, root_proc, psi_laststep[0].get_pointer(), para_orb, psi_laststep_g); - - // Syncronize data from CPU to Device - syncmem_complex_h2d_op()(psi_k_tensor.data>(), - psi_g.p.get(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_h2d_op()(psi_k_laststep_tensor.data>(), - psi_laststep_g.p.get(), - len_psi_k_1 * len_psi_k_2); -#endif - } - else - { - // Syncronize data from CPU to Device - syncmem_complex_h2d_op()(psi_k_tensor.data>(), - psi[0].get_pointer(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_h2d_op()(psi_k_laststep_tensor.data>(), - psi_laststep[0].get_pointer(), - len_psi_k_1 * len_psi_k_2); - } - - syncmem_complex_h2d_op()(H_laststep_tensor.data>(), - Hk_laststep[ik], - len_HS_laststep); - syncmem_complex_h2d_op()(S_laststep_tensor.data>(), - Sk_laststep[ik], - len_HS_laststep); - syncmem_double_h2d_op()(ekb_tensor.data(), &(ekb(ik, 0)), nband); - - evolve_psi_tensor(nband, - nlocal, - &(para_orb), - phm, - psi_k_tensor, - psi_k_laststep_tensor, - H_laststep_tensor, - S_laststep_tensor, - ekb_tensor, - htype, - propagator, - ofs_running, - print_matrix, - use_lapack); - - // Need to distribute global psi back to all processes - if (use_lapack) - { -#ifdef __MPI - // Syncronize data from Device to CPU - syncmem_complex_d2h_op()(psi_g.p.get(), - psi_k_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_d2h_op()(psi_laststep_g.p.get(), - psi_k_laststep_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - - // Distribute psi to all processes - distributePsi(para_orb, psi[0].get_pointer(), psi_g); - distributePsi(para_orb, psi_laststep[0].get_pointer(), psi_laststep_g); -#endif - } - else - { - // Syncronize data from Device to CPU - syncmem_complex_d2h_op()(psi[0].get_pointer(), - psi_k_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_d2h_op()(psi_laststep[0].get_pointer(), - psi_k_laststep_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - } - syncmem_complex_d2h_op()(Hk_laststep[ik], - H_laststep_tensor.data>(), - len_HS_laststep); - syncmem_complex_d2h_op()(Sk_laststep[ik], - S_laststep_tensor.data>(), - len_HS_laststep); - syncmem_double_d2h_op()(&(ekb(ik, 0)), ekb_tensor.data(), nband); - - // std::cout << "Print ekb tensor: " << std::endl; - // ekb.print(std::cout); - } - } - else - { - std::cout << "method of htype is wrong" << std::endl; - } - - ModuleBase::timer::tick("Efficiency", "evolve_k"); - } // end k - - ModuleBase::timer::tick("Evolve_elec", "solve_psi"); - return; -} - -template class Evolve_elec; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template class Evolve_elec; -#endif -} // namespace module_tddft \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/evolve_elec.h b/source/module_hamilt_lcao/module_tddft/evolve_elec.h deleted file mode 100644 index 44972bae3f..0000000000 --- a/source/module_hamilt_lcao/module_tddft/evolve_elec.h +++ /dev/null @@ -1,185 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_TDDFT_EVOLVE_ELEC_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_TDDFT_EVOLVE_ELEC_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap -#include "source_base/module_device/device.h" // base_device -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" // Cpxgemr2d -#include "source_esolver/esolver_ks_lcao.h" -#include "source_esolver/esolver_ks_lcao_tddft.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_psi/psi.h" - -//----------------------------------------------------------- -// mohan add 2021-02-09 -// This class is used to evolve the electronic wave functions -// in TDDFT in terms of the multiple k points -// k is the index for the points in the first Brillouin zone -//----------------------------------------------------------- - -//------------------------ Debugging utility function ------------------------// - -// Print the shape of a Tensor -inline void print_tensor_shape(const ct::Tensor& tensor, const std::string& name) -{ - std::cout << "Shape of " << name << ": ["; - for (int i = 0; i < tensor.shape().ndim(); ++i) - { - std::cout << tensor.shape().dim_size(i); - if (i < tensor.shape().ndim() - 1) - { - std::cout << ", "; - } - } - std::cout << "]" << std::endl; -} - -// Recursive print function -template -inline void print_tensor_data_recursive(const T* data, - const std::vector& shape, - const std::vector& strides, - int dim, - std::vector& indices, - const std::string& name) -{ - if (dim == shape.size()) - { - // Recursion base case: print data when reaching the innermost dimension - std::cout << name; - for (size_t i = 0; i < indices.size(); ++i) - { - std::cout << "[" << indices[i] << "]"; - } - std::cout << " = " << *data << std::endl; - return; - } - // Recursively process the current dimension - for (int64_t i = 0; i < shape[dim]; ++i) - { - indices[dim] = i; - print_tensor_data_recursive(data + i * strides[dim], shape, strides, dim + 1, indices, name); - } -} - -// Generic print function -template -inline void print_tensor_data(const ct::Tensor& tensor, const std::string& name) -{ - const std::vector& shape = tensor.shape().dims(); - const std::vector& strides = tensor.shape().strides(); - const T* data = tensor.data(); - std::vector indices(shape.size(), 0); - print_tensor_data_recursive(data, shape, strides, 0, indices, name); -} - -// Specialization for std::complex -template <> -inline void print_tensor_data>(const ct::Tensor& tensor, const std::string& name) -{ - const std::vector& shape = tensor.shape().dims(); - const std::vector& strides = tensor.shape().strides(); - const std::complex* data = tensor.data>(); - std::vector indices(shape.size(), 0); - print_tensor_data_recursive(data, shape, strides, 0, indices, name); -} - -//------------------------ Debugging utility function ------------------------// - -namespace module_tddft -{ -#ifdef __MPI -//------------------------ MPI gathering and distributing functions ------------------------// -template -void gatherPsi(const int myid, - const int root_proc, - T* psi_l, - const Parallel_Orbitals& para_orb, - ModuleESolver::Matrix_g& psi_g) -{ - const int* desc_psi = para_orb.desc_wfc; // Obtain the descriptor from Parallel_Orbitals - int ctxt = desc_psi[1]; // BLACS context - int nrows = desc_psi[2]; // Global matrix row number - int ncols = desc_psi[3]; // Global matrix column number - - if (myid == root_proc) - { - psi_g.p.reset(new T[nrows * ncols]); // No need to delete[] since it is a shared_ptr - } - else - { - psi_g.p.reset(new T[nrows * ncols]); // Placeholder for non-root processes - } - - // Set the descriptor of the global psi - psi_g.desc.reset(new int[9]{1, ctxt, nrows, ncols, nrows, ncols, 0, 0, nrows}); - psi_g.row = nrows; - psi_g.col = ncols; - - // Call the Cpxgemr2d function in ScaLAPACK to collect the matrix data - Cpxgemr2d(nrows, ncols, psi_l, 1, 1, const_cast(desc_psi), psi_g.p.get(), 1, 1, psi_g.desc.get(), ctxt); -} - -template -void distributePsi(const Parallel_Orbitals& para_orb, T* psi_l, const ModuleESolver::Matrix_g& psi_g) -{ - const int* desc_psi = para_orb.desc_wfc; // Obtain the descriptor from Parallel_Orbitals - int ctxt = desc_psi[1]; // BLACS context - int nrows = desc_psi[2]; // Global matrix row number - int ncols = desc_psi[3]; // Global matrix column number - - // Call the Cpxgemr2d function in ScaLAPACK to distribute the matrix data - Cpxgemr2d(nrows, ncols, psi_g.p.get(), 1, 1, psi_g.desc.get(), psi_l, 1, 1, const_cast(desc_psi), ctxt); -} -//------------------------ MPI gathering and distributing functions ------------------------// -#endif // __MPI - -template -class Evolve_elec -{ - friend class ModuleESolver::ESolver_KS_LCAO, double>; - - // Template parameter is needed for the friend class declaration - friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; - friend class ModuleESolver::ESolver_KS_LCAO_TDDFT, Device>; - - public: - Evolve_elec(); - ~Evolve_elec(); - - private: - static void solve_psi(const int& istep, - const int nband, - const int nlocal, - const int& nks, - hamilt::Hamilt>* phm, - Parallel_Orbitals& para_orb, - psi::Psi>* psi, - psi::Psi>* psi_laststep, - std::complex** Hk_laststep, - std::complex** Sk_laststep, - ModuleBase::matrix& ekb, - std::ofstream& ofs_running, - const int htype, - const int propagator, - const bool use_tensor, - const bool use_lapack); - - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - static ct::DeviceType ct_device_type; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Memory operations - using syncmem_double_h2d_op = base_device::memory::synchronize_memory_op; - using syncmem_double_d2h_op = base_device::memory::synchronize_memory_op; - using syncmem_complex_h2d_op - = base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>; - using syncmem_complex_d2h_op - = base_device::memory::synchronize_memory_op, base_device::DEVICE_CPU, Device>; -}; -} // namespace module_tddft -#endif diff --git a/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp b/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp deleted file mode 100644 index 29c9e88125..0000000000 --- a/source/module_hamilt_lcao/module_tddft/evolve_psi.cpp +++ /dev/null @@ -1,352 +0,0 @@ -#include "evolve_psi.h" - -#include "band_energy.h" -#include "middle_hamilt.h" -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" // cuBLAS handle -#include "source_base/module_container/ATen/kernels/lapack.h" // cuSOLVER handle -#include "source_base/scalapack_connector.h" -#include "source_esolver/esolver_ks_lcao_tddft.h" // use gatherMatrix -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#include "norm_psi.h" -#include "propagator.h" -#include "upsi.h" -#include "solve_propagation.h" - -#include - -namespace module_tddft -{ -void evolve_psi(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - std::complex* psi_k, - std::complex* psi_k_laststep, - std::complex* H_laststep, - std::complex* S_laststep, - double* ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix) -{ - ModuleBase::TITLE("Evolve_psi", "evolve_psi"); - ofs_running << " Evolving electronic wave functions begins" << std::endl; - - time_t time_start = time(nullptr); - ofs_running << " Start Time : " << ctime(&time_start); - -#ifdef __MPI - - hamilt::MatrixBlock> h_mat; - hamilt::MatrixBlock> s_mat; - p_hamilt->matrix(h_mat, s_mat); - - std::complex* Stmp = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Stmp, pv->nloc); - BlasConnector::copy(pv->nloc, s_mat.p, 1, Stmp, 1); - - std::complex* Htmp = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Htmp, pv->nloc); - BlasConnector::copy(pv->nloc, h_mat.p, 1, Htmp, 1); - - std::complex* Hold = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Hold, pv->nloc); - BlasConnector::copy(pv->nloc, h_mat.p, 1, Hold, 1); - - std::complex* U_operator = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(U_operator, pv->nloc); - - // (1)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute H(t+dt/2) - /// @input H_laststep, Htmp, print_matrix - /// @output Htmp - if (htype == 1 && propagator != 2) - { - half_Hmatrix(pv, nband, nlocal, Htmp, Stmp, H_laststep, S_laststep, ofs_running, print_matrix); - } - - // (2)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - if (propagator != 3) - { - /// @brief compute U_operator - /// @input Stmp, Htmp, print_matrix - /// @output U_operator - Propagator prop(propagator, pv, PARAM.inp.td_dt); - prop.compute_propagator(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); - } - - // (3)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - if (propagator != 3) - { - /// @brief apply U_operator to the wave function of the previous step for new wave function - /// @input U_operator, psi_k_laststep, print_matrix - /// @output psi_k - upsi(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); - } - else - { - /// @brief solve the propagation equation - /// @input Stmp, Htmp, psi_k_laststep - /// @output psi_k - solve_propagation(pv, nband, nlocal, PARAM.inp.td_dt, Stmp, Htmp, psi_k_laststep, psi_k); - } - - // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief normalize psi_k - /// @input Stmp, psi_not_norm, psi_k, print_matrix - /// @output psi_k - norm_psi(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); - - // (5)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute ekb - /// @input Htmp, psi_k - /// @output ekb - compute_ekb(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); - - delete[] Stmp; - delete[] Htmp; - delete[] Hold; - delete[] U_operator; - -#endif - - time_t time_end = time(nullptr); - ModuleBase::GlobalFunc::OUT_TIME("evolve(std::complex)", time_start, time_end); - - ofs_running << " Evolving electronic wave functions ends" << std::endl; - - return; -} - -template -void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - // Memory operations - using syncmem_complex_h2d_op - = base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>; - -#if ((defined __CUDA) /* || (defined __ROCM) */) - // Initialize cuBLAS & cuSOLVER handle - ct::kernels::createGpuSolverHandle(); - ct::kernels::createGpuBlasHandle(); -#endif // __CUDA - - ofs_running << " evolve_psi_tensor::start " << std::endl; - - ModuleBase::TITLE("Evolve_psi", "evolve_psi"); - time_t time_start = time(nullptr); - ofs_running << " Start Time : " << ctime(&time_start); - -#ifdef __MPI - - hamilt::MatrixBlock> h_mat, s_mat; - p_hamilt->matrix(h_mat, s_mat); - - // Create Tensor objects for temporary data and sync from host to device - const int len_HS = use_lapack ? nlocal * nlocal : pv->nloc; - ct::Tensor Stmp(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - ct::Tensor Htmp(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - ct::Tensor Hold(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - - if (use_lapack) - { - // Need to gather H and S matrix to root process here - int myid = 0; - int num_procs = 1; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - MPI_Comm_size(MPI_COMM_WORLD, &num_procs); - - ModuleESolver::Matrix_g> h_mat_g, s_mat_g; // Global matrix structure - - // Collect H matrix - ModuleESolver::gatherMatrix(myid, 0, h_mat, h_mat_g); - syncmem_complex_h2d_op()(Htmp.data>(), h_mat_g.p.get(), len_HS); - syncmem_complex_h2d_op()(Hold.data>(), h_mat_g.p.get(), len_HS); - - // Collect S matrix - ModuleESolver::gatherMatrix(myid, 0, s_mat, s_mat_g); - syncmem_complex_h2d_op()(Stmp.data>(), s_mat_g.p.get(), len_HS); - } - else - { - // Original code - syncmem_complex_h2d_op()(Stmp.data>(), s_mat.p, len_HS); - syncmem_complex_h2d_op()(Htmp.data>(), h_mat.p, len_HS); - syncmem_complex_h2d_op()(Hold.data>(), h_mat.p, len_HS); - } - - ct::Tensor U_operator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - U_operator.zero(); - - int myid = 0; - int root_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - - // (1)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute H(t+dt/2) - /// @input H_laststep, Htmp, print_matrix - /// @output Htmp - if (htype == 1 && propagator != 2) - { - if (!use_lapack) - { - half_Hmatrix_tensor(pv, nband, nlocal, Htmp, Stmp, H_laststep, S_laststep, ofs_running, print_matrix); - } - else - { - if (myid == root_proc) - { - half_Hmatrix_tensor_lapack(pv, - nband, - nlocal, - Htmp, - Stmp, - H_laststep, - S_laststep, - ofs_running, - print_matrix); - } - } - } - - // (2)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute U_operator - /// @input Stmp, Htmp, print_matrix - /// @output U_operator - Propagator prop(propagator, pv, PARAM.mdp.md_dt); - prop.compute_propagator_tensor(nlocal, - Stmp, - Htmp, - H_laststep, - U_operator, - ofs_running, - print_matrix, - use_lapack); - - // (3)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief apply U_operator to the wave function of the previous step for new wave function - /// @input U_operator, psi_k_laststep, print_matrix - /// @output psi_k - if (!use_lapack) - { - upsi_tensor(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); - } - else - { - if (myid == root_proc) - { - upsi_tensor_lapack(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); - } - } - - // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief normalize psi_k - /// @input Stmp, psi_not_norm, psi_k, print_matrix - /// @output psi_k - if (!use_lapack) - { - norm_psi_tensor(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); - } - else - { - if (myid == root_proc) - { - norm_psi_tensor_lapack(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); - } - } - - // (5)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute ekb - /// @input Htmp, psi_k - /// @output ekb - if (!use_lapack) - { - compute_ekb_tensor(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); - } - else - { - if (myid == root_proc) - { - compute_ekb_tensor_lapack(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); - } - } - -#endif // __MPI - - time_t time_end = time(nullptr); - ModuleBase::GlobalFunc::OUT_TIME("evolve(std::complex)", time_start, time_end); - - ofs_running << " evolve_psi_tensor::end " << std::endl; - -#if ((defined __CUDA) /* || (defined __ROCM) */) - // Destroy cuBLAS & cuSOLVER handle - ct::kernels::destroyGpuSolverHandle(); - ct::kernels::destroyGpuBlasHandle(); -#endif // __CUDA - - return; -} - -// Explicit instantiation of template functions -template void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack); - -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack); -#endif // __CUDA - -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/evolve_psi.h b/source/module_hamilt_lcao/module_tddft/evolve_psi.h deleted file mode 100644 index e1b64f7c9b..0000000000 --- a/source/module_hamilt_lcao/module_tddft/evolve_psi.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file evolve_psi.h - * @brief evolve the wave function - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef ELEC_PSI_H -#define ELEC_PSI_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -namespace module_tddft -{ -void evolve_psi(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - std::complex* psi_k, - std::complex* psi_k_laststep, - std::complex* H_laststep, - std::complex* S_laststep, - double* ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix); - -template -void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack); -} // namespace module_tddft - -#endif \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/middle_hamilt.cpp b/source/module_hamilt_lcao/module_tddft/middle_hamilt.cpp deleted file mode 100644 index da72911335..0000000000 --- a/source/module_hamilt_lcao/module_tddft/middle_hamilt.cpp +++ /dev/null @@ -1,290 +0,0 @@ -#include "middle_hamilt.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI - -void half_Hmatrix(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - std::complex* Htmp, - std::complex* Stmp, - const std::complex* H_laststep, - const std::complex* S_laststep, - std::ofstream& ofs_running, - const int print_matrix) -{ - if (print_matrix) - { - ofs_running << std::setprecision(10); - ofs_running << std::endl; - ofs_running << " H(t+dt) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H(t):" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << H_laststep[in + j].real() << "+" << H_laststep[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - std::complex alpha = {0.5, 0.0}; - std::complex beta = {0.5, 0.0}; - ScalapackConnector::geadd('N', nlocal, nlocal, alpha, H_laststep, 1, 1, pv->desc, beta, Htmp, 1, 1, pv->desc); - ScalapackConnector::geadd('N', nlocal, nlocal, alpha, S_laststep, 1, 1, pv->desc, beta, Stmp, 1, 1, pv->desc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " H (t+dt/2) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -void half_Hmatrix_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix) -{ - if (print_matrix) - { - ofs_running << std::setprecision(10); - ofs_running << std::endl; - ofs_running << " H(t+dt) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp.data>()[in + j].real() << "+" - << Htmp.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H(t):" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << H_laststep.data>()[in + j].real() << "+" - << H_laststep.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - std::complex alpha = {0.5, 0.0}; - std::complex beta = {0.5, 0.0}; - - // Perform the operation Htmp = alpha * H_laststep + beta * Htmp - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - H_laststep.data>(), - 1, - 1, - pv->desc, - beta, - Htmp.data>(), - 1, - 1, - pv->desc); - - // Perform the operation Stmp = alpha * S_laststep + beta * Stmp - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - S_laststep.data>(), - 1, - 1, - pv->desc, - beta, - Stmp.data>(), - 1, - 1, - pv->desc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " H (t+dt/2) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp.data>()[in + j].real() << "+" - << Htmp.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -template -void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - if (print_matrix) - { - ct::Tensor Htmp_cpu = Htmp.to_device(); - ct::Tensor H_laststep_cpu = H_laststep.to_device(); - - ofs_running << std::setprecision(10); - ofs_running << std::endl; - ofs_running << " H(t+dt) :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Htmp_cpu.data>()[in + j].real() << "+" - << Htmp_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H(t):" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << H_laststep_cpu.data>()[in + j].real() << "+" - << H_laststep_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - std::complex one_half = {0.5, 0.0}; - - // Perform the operation Htmp = one_half * H_laststep + one_half * Htmp - // Scale Htmp by one_half - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &one_half, - Htmp.data>(), - 1); - // Htmp = one_half * H_laststep + Htmp - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one_half, - H_laststep.data>(), - 1, - Htmp.data>(), - 1); - - // Perform the operation Stmp = one_half * S_laststep + one_half * Stmp - // Scale Stmp by one_half - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &one_half, - Stmp.data>(), - 1); - // Stmp = one_half * S_laststep + Stmp - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one_half, - S_laststep.data>(), - 1, - Stmp.data>(), - 1); - - if (print_matrix) - { - ct::Tensor Htmp_cpu = Htmp.to_device(); - - ofs_running << std::endl; - ofs_running << " H (t+dt/2) :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Htmp_cpu.data>()[in + j].real() << "+" - << Htmp_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -// Explicit instantiation of template functions -template void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/middle_hamilt.h b/source/module_hamilt_lcao/module_tddft/middle_hamilt.h deleted file mode 100644 index 6e5cb45d78..0000000000 --- a/source/module_hamilt_lcao/module_tddft/middle_hamilt.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file middle_hamilt.h - * @brief compute H(t+dt/2) - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef MIDDLE_HAMILT_H -#define MIDDLE_HAMILT_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief compute H(t+dt/2) - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] Htmp H(t+dt) - * @param[in] H_laststep H(t) - * @param[in] print_matirx print internal matrix or not - * @param[out] Htmp H(t+dt/2) - */ -void half_Hmatrix(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - std::complex* Htmp, - std::complex* Stmp, - const std::complex* H_laststep, - const std::complex* S_laststep, - std::ofstream& ofs_running, - const int print_matrix); - -void half_Hmatrix_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); - -template -void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); - -#endif // __MPI -} // namespace module_tddft - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/norm_psi.cpp b/source/module_hamilt_lcao/module_tddft/norm_psi.cpp deleted file mode 100644 index 913554c815..0000000000 --- a/source/module_hamilt_lcao/module_tddft/norm_psi.cpp +++ /dev/null @@ -1,671 +0,0 @@ -#include "norm_psi.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI - -inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - int iblock, gIndex; - iblock = localindex / nblk; - gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} - -void norm_psi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* Stmp, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - assert(pv->nloc_wfc > 0 && pv->nloc > 0); - - std::complex* tmp1 = new std::complex[pv->nloc_wfc]; - ModuleBase::GlobalFunc::ZEROS(tmp1, pv->nloc_wfc); - - std::complex* Cij = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Cij, pv->nloc); - - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - Stmp, - 1, - 1, - pv->desc, - psi_k, - 1, - 1, - pv->desc_wfc, - 0.0, - tmp1, - 1, - 1, - pv->desc_wfc); - - ScalapackConnector::gemm('C', - 'N', - nband, - nband, - nlocal, - 1.0, - psi_k, - 1, - 1, - pv->desc_wfc, - tmp1, - 1, - 1, - pv->desc_wfc, - 0.0, - Cij, - 1, - 1, - pv->desc_Eij); - - if (print_matrix) - { - ofs_running << "original Cij :" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - double aa = Cij[in + j].real(); - double bb = Cij[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - int naroc[2] = {0, 0}; // maximum number of row or column - - for (int iprow = 0; iprow < pv->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) - { - if (iprow == pv->coord[0] && ipcol == pv->coord[1]) - { - naroc[0] = pv->nrow; - naroc[1] = pv->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); - if (igcol >= nband) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); - if (igrow >= nband) - { - continue; - } - if (igcol == igrow) - { - Cij[j * naroc[0] + i] = {1.0 / sqrt(Cij[j * naroc[0] + i].real()), 0.0}; - } - else - { - Cij[j * naroc[0] + i] = {0.0, 0.0}; - } - } - } - } - } // loop ipcol - } // loop iprow - - BlasConnector::copy(pv->nloc_wfc, psi_k, 1, tmp1, 1); - - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nband, - 1.0, - tmp1, - 1, - 1, - pv->desc_wfc, - Cij, - 1, - 1, - pv->desc_Eij, - 0.0, - psi_k, - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << " Cij:" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - ofs_running << Cij[in + j].real() << "+" << Cij[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k[in + j].real(); - double bb = psi_k[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k before normalization:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = tmp1[in + j].real(); - double bb = tmp1[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - } - - delete[] tmp1; - delete[] Cij; -} - -void norm_psi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - assert(pv->nloc_wfc > 0 && pv->nloc > 0); - - // Create Tensor objects for temporary data - ct::Tensor tmp1(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc_wfc})); - tmp1.zero(); - - ct::Tensor Cij(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc})); - Cij.zero(); - - // Perform matrix multiplication: tmp1 = Stmp * psi_k - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - Stmp.data>(), - 1, - 1, - pv->desc, - psi_k.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - tmp1.data>(), - 1, - 1, - pv->desc_wfc); - - // Perform matrix multiplication: Cij = psi_k^dagger * tmp1 - ScalapackConnector::gemm('C', - 'N', - nband, - nband, - nlocal, - 1.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc, - tmp1.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - Cij.data>(), - 1, - 1, - pv->desc_Eij); - - if (print_matrix) - { - ofs_running << "original Cij :" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - double aa = Cij.data>()[in + j].real(); - double bb = Cij.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - int naroc[2] = {0, 0}; // maximum number of row or column - - for (int iprow = 0; iprow < pv->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) - { - if (iprow == pv->coord[0] && ipcol == pv->coord[1]) - { - naroc[0] = pv->nrow; - naroc[1] = pv->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); - if (igcol >= nband) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); - if (igrow >= nband) - { - continue; - } - if (igcol == igrow) - { - Cij.data>()[j * naroc[0] + i] - = {1.0 / sqrt(Cij.data>()[j * naroc[0] + i].real()), 0.0}; - } - else - { - Cij.data>()[j * naroc[0] + i] = {0.0, 0.0}; - } - } - } - } - } // loop ipcol - } // loop iprow - - // Copy psi_k to tmp1 (using deep copy) - // tmp1.CopyFrom(psi_k); // Does not work because this will cause tmp1 and psi_k to share the same data - tmp1 = psi_k; // operator= overload for Tensor class - - // Perform matrix multiplication: psi_k = tmp1 * Cij - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nband, - 1.0, - tmp1.data>(), - 1, - 1, - pv->desc_wfc, - Cij.data>(), - 1, - 1, - pv->desc_Eij, - 0.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << " Cij:" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - ofs_running << Cij.data>()[in + j].real() << "+" - << Cij.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k.data>()[in + j].real(); - double bb = psi_k.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k before normalization:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = tmp1.data>()[in + j].real(); - double bb = tmp1.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - } -} - -template -void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Create Tensor objects for temporary data - ct::Tensor tmp1( - ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({nlocal * nband})); // tmp1 shape: nlocal * nband (under 2D block cyclic is pv->nloc_wfc) - tmp1.zero(); - - ct::Tensor Cij(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({nlocal * nlocal})); // Cij shape: nlocal * nlocal - Cij.zero(); - - std::complex alpha = {1.0, 0.0}; - std::complex beta = {0.0, 0.0}; - - // Perform matrix multiplication: tmp1 = Stmp * psi_k - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nlocal, - &alpha, - Stmp.data>(), - nlocal, // Leading dimension of Stmp - psi_k.data>(), - nlocal, // Leading dimension of psi_k - &beta, - tmp1.data>(), - nlocal); // Leading dimension of tmp1 - - // Perform matrix multiplication: Cij = psi_k^dagger * tmp1 - ct::kernels::blas_gemm, ct_Device>()('C', - 'N', - nband, - nband, - nlocal, - &alpha, - psi_k.data>(), - nlocal, // Leading dimension of psi_k - tmp1.data>(), - nlocal, // Leading dimension of tmp1 - &beta, - Cij.data>(), - nlocal); // Leading dimension of Cij - - if (print_matrix) - { - ct::Tensor Cij_print_cpu = Cij.to_device(); - - ofs_running << "original Cij :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = Cij_print_cpu.data>()[in + j].real(); - double bb = Cij_print_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // Normalize Cij: set diagonal elements to 1/sqrt(Cij[i][i]), off-diagonal elements to 0 - if (ct_device_type == ct::DeviceType::GpuDevice) - { - // Step 1: Copy Cij from GPU to CPU - ct::Tensor Cij_cpu = Cij.to_device(); - - // Step 2: Perform normalization on CPU - for (int i = 0; i < nband; ++i) - { - const int in = i * nlocal; - for (int j = 0; j < nband; ++j) - { - if (i == j) - { - Cij_cpu.data>()[in + j] - = {1.0 / sqrt(Cij_cpu.data>()[in + j].real()), 0.0}; - } - else - { - Cij_cpu.data>()[in + j] = {0.0, 0.0}; - } - } - } - - // Step 3: Copy normalized Cij back to GPU - Cij = Cij_cpu.to_device(); - } - else - { - // CPU implementation - for (int i = 0; i < nband; ++i) - { - const int in = i * nlocal; - for (int j = 0; j < nband; ++j) - { - if (i == j) - { - Cij.data>()[in + j] - = {1.0 / sqrt(Cij.data>()[in + j].real()), 0.0}; - } - else - { - Cij.data>()[in + j] = {0.0, 0.0}; - } - } - } - } - - // Copy psi_k to tmp1 (using deep copy) - // tmp1.CopyFrom(psi_k); // Does not work because this will cause tmp1 and psi_k to share the same data - tmp1 = psi_k; // operator= overload for Tensor class - - // Perform matrix multiplication: psi_k = tmp1 * Cij - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nband, - &alpha, - tmp1.data>(), - nlocal, // Leading dimension of tmp1 - Cij.data>(), - nlocal, // Leading dimension of Cij - &beta, - psi_k.data>(), - nlocal); // Leading dimension of psi_k - - if (print_matrix) - { - ct::Tensor Cij_print_cpu = Cij.to_device(); - ct::Tensor psi_k_cpu = psi_k.to_device(); - ct::Tensor tmp1_cpu = tmp1.to_device(); - - ofs_running << " Cij:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Cij_print_cpu.data>()[in + j].real() << "+" - << Cij_print_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = psi_k_cpu.data>()[in + j].real(); - double bb = psi_k_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k before normalization:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = tmp1_cpu.data>()[in + j].real(); - double bb = tmp1_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - } -} - -// Explicit instantiation of template functions -template void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/norm_psi.h b/source/module_hamilt_lcao/module_tddft/norm_psi.h deleted file mode 100644 index 1f3cc8ec2b..0000000000 --- a/source/module_hamilt_lcao/module_tddft/norm_psi.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file norm_psi.h - * @brief normalize the wave function - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef NORM_PSI_H -#define NORM_PSI_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief normalize the wave function - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] psi_k psi of this step - * @param[in] print_matirx print internal matrix or not - * @param[out] psi_k psi of this step after normalization - */ -void norm_psi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* Stmp, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -void norm_psi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -template -void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -#endif // __MPI -} // namespace module_tddft - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/propagator.cpp b/source/module_hamilt_lcao/module_tddft/propagator.cpp deleted file mode 100644 index 74f1c3088f..0000000000 --- a/source/module_hamilt_lcao/module_tddft/propagator.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "propagator.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" - -#include -#include - -namespace module_tddft -{ -Propagator::~Propagator() -{ -} -#ifdef __MPI -void Propagator::compute_propagator(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - int tag; - switch (ptype) - { - case 0: - compute_propagator_cn2(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); - break; - - case 1: - tag = 1; - compute_propagator_taylor(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix, tag); - break; - - case 2: - compute_propagator_etrs(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); - break; - - default: - ModuleBase::WARNING_QUIT("Propagator::compute_propagator", "Method of RT-TDDFT propagator is wrong!"); - break; - } -} - -template -void Propagator::compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const -{ - int tag; - switch (ptype) - { - case 0: - if (!use_lapack) - { - compute_propagator_cn2_tensor(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); - } - else - { - int myid = 0; - int root_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - if (myid == root_proc) - { - compute_propagator_cn2_tensor_lapack(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); - } - } - break; - - default: - ModuleBase::WARNING_QUIT("Propagator::compute_propagator_tensor", - "The Tensor-based RT-TDDFT propagator currently supports Crank–Nicolson method only!"); - break; - } -} - -// Explicit instantiation of template functions -template void Propagator::compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void Propagator::compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const; -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/propagator.h b/source/module_hamilt_lcao/module_tddft/propagator.h deleted file mode 100644 index 0b13f5453f..0000000000 --- a/source/module_hamilt_lcao/module_tddft/propagator.h +++ /dev/null @@ -1,222 +0,0 @@ -/** - * @file propagator.h - * @brief compute propagtor to evolve the wave function - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef PROPAGATOR_H -#define PROPAGATOR_H - -#include "source_base/constants.h" -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -//--------------------------------- Utility function ---------------------------------// -#ifdef __MPI -inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - int iblock, gIndex; - iblock = localindex / nblk; - gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} -#endif // __MPI - -// Auxiliary function: process non-complex types, return value 1.0 -template -inline T init_value(typename std::enable_if>::value - && !std::is_same>::value>::type* = nullptr) -{ - return T(1.0); -} - -// Auxiliary function: process complex types, return value 1.0 + 0.0i -template -inline T init_value(typename std::enable_if>::value - || std::is_same>::value>::type* = nullptr) -{ - return T(1.0, 0.0); -} - -// Create an identity matrix of size nƗn -template -ct::Tensor create_identity_matrix(const int n, ct::DeviceType device = ct::DeviceType::CpuDevice) -{ - // Choose the data type of the Tensor - ct::DataType data_type; - if (std::is_same::value) - { - data_type = ct::DataType::DT_FLOAT; - } - else if (std::is_same::value) - { - data_type = ct::DataType::DT_DOUBLE; - } - else if (std::is_same>::value) - { - data_type = ct::DataType::DT_COMPLEX; - } - else if (std::is_same>::value) - { - data_type = ct::DataType::DT_COMPLEX_DOUBLE; - } - else - { - static_assert(std::is_same::value || std::is_same::value - || std::is_same>::value - || std::is_same>::value, - "Unsupported data type!"); - } - - ct::Tensor tensor(data_type, device, ct::TensorShape({n, n})); - tensor.zero(); - - // Set the diagonal elements to 1 - if (device == ct::DeviceType::CpuDevice) - { - // For CPU, we can directly access the data - T* data_ptr = tensor.data(); - for (int i = 0; i < n; ++i) - { - data_ptr[i * n + i] = init_value(); - } - } -#if ((defined __CUDA)) - else if (device == ct::DeviceType::GpuDevice) - { - // For GPU, we need to use a kernel to set the diagonal elements - T* data_ptr = tensor.data(); - for (int i = 0; i < n; ++i) - { - T value = init_value(); - ct::kernels::set_memory()(data_ptr + i * n + i, value, 1); - } - } -#endif - - return tensor; -} -//--------------------------------- Utility function ---------------------------------// - -class Propagator -{ - public: - Propagator(const int ptype, const Parallel_Orbitals* pv, const double& dt) - { - this->ptype = ptype; - this->ParaV = pv; - this->dt = dt / ModuleBase::AU_to_FS; - } - ~Propagator(); - -#ifdef __MPI - /** - * @brief compute propagator - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] H_laststep H(t) - * @param[in] print_matirx print internal matrix or not - * @param[out] U_operator operator of propagator - */ - void compute_propagator(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - template - void compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const; -#endif // __MPI - - private: - int ptype; // type of propagator - const Parallel_Orbitals* ParaV; - double dt; // time step - -#ifdef __MPI - - /** - * @brief compute propagator of method Crank-Nicolson - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] print_matirx print internal matrix or not - * @param[out] U_operator operator of propagator - */ - void compute_propagator_cn2(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - void compute_propagator_cn2_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - template - void compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - /** - * @brief compute propagator of method 4th Taylor - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] print_matirx print internal matrix or not - * @param[in] tag a parametre different for 4th Taylor and ETRS - * @param[out] U_operator operator of propagator - */ - void compute_propagator_taylor(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const int tag) const; - - /** - * @brief compute propagator of method ETRS - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] H_laststep H(t) - * @param[in] print_matirx print internal matrix or not - * @param[out] U_operator operator of propagator - */ - void compute_propagator_etrs(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; -#endif // __MPI -}; -} // namespace module_tddft - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/propagator_cn2.cpp b/source/module_hamilt_lcao/module_tddft/propagator_cn2.cpp deleted file mode 100644 index 8ccbd2a5a0..0000000000 --- a/source/module_hamilt_lcao/module_tddft/propagator_cn2.cpp +++ /dev/null @@ -1,734 +0,0 @@ -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "propagator.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void Propagator::compute_propagator_cn2(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - assert(this->ParaV->nloc > 0); - - // (1) copy Htmp to Numerator & Denominator - std::complex* Numerator = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(Numerator, this->ParaV->nloc); - BlasConnector::copy(this->ParaV->nloc, Htmp, 1, Numerator, 1); - - std::complex* Denominator = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(Denominator, this->ParaV->nloc); - BlasConnector::copy(this->ParaV->nloc, Htmp, 1, Denominator, 1); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Stmp[in + j].real() << "+" << Stmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator[in + j].real() << "+" << Numerator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute Numerator & Denominator by GEADD - // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt - // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt - std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * this->dt}; - std::complex beta2 = {0.0, 0.25 * this->dt}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - this->ParaV->desc, - beta1, - Numerator, - 1, - 1, - this->ParaV->desc); - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - this->ParaV->desc, - beta2, - Denominator, - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " beta=" << beta1 << std::endl; - ofs_running << " fenmu:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator[in + j].real() << "+" << Denominator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) Next, invert Denominator - // What is the size of ipiv exactly? Need to check ScaLAPACK documentation! - // But anyway, not this->ParaV->nloc - int* ipiv = new int[this->ParaV->nrow + this->ParaV->nb]; - ModuleBase::GlobalFunc::ZEROS(ipiv, this->ParaV->nrow + this->ParaV->nb); - int info = 0; - // (3.1) compute ipiv - ScalapackConnector::getrf(nlocal, nlocal, Denominator, 1, 1, this->ParaV->desc, ipiv, &info); - - // Print ipiv - if (print_matrix) - { - ofs_running << " this->ParaV->nloc = " << this->ParaV->nloc << std::endl; - ofs_running << " this->ParaV->nrow = " << this->ParaV->nrow << std::endl; - ofs_running << " this->ParaV->ncol = " << this->ParaV->ncol << std::endl; - ofs_running << " this->ParaV->nb = " << this->ParaV->nb << std::endl; - ofs_running << " this->ParaV->get_block_size() = " << this->ParaV->get_block_size() << std::endl; - ofs_running << " nlocal = " << nlocal << std::endl; - ofs_running << " ipiv:" << std::endl; - for (int i = 0; i < this->ParaV->nloc; i++) - { - ofs_running << ipiv[i] << " "; - } - ofs_running << std::endl; - } - - int lwork = -1; - int liwotk = -1; - std::vector> work(1, 0); - std::vector iwork(1, 0); - // (3.2) compute work - ScalapackConnector::getri(nlocal, - Denominator, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - lwork = work[0].real(); - work.resize(lwork, 0); - liwotk = iwork[0]; - iwork.resize(liwotk, 0); - // (3.3) compute inverse matrix of Denominator - ScalapackConnector::getri(nlocal, - Denominator, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - assert(0 == info); - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - // (4) U_operator = Denominator * Numerator; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - Denominator, - 1, - 1, - this->ParaV->desc, - Numerator, - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator, - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " fenmu^-1:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator[in + j].real() << "+" << Denominator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " fenzi:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator[in + j].real() << "+" << Numerator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - double aa = U_operator[in + j].real(); - double bb = U_operator[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } - - delete[] Numerator; - delete[] Denominator; - delete[] ipiv; -} - -void Propagator::compute_propagator_cn2_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - // (1) copy Htmp to Numerator & Denominator - ct::Tensor Numerator(ct::DataType::DT_COMPLEX_DOUBLE, - ct::DeviceType::CpuDevice, - ct::TensorShape({this->ParaV->nloc})); - Numerator.zero(); - BlasConnector::copy(this->ParaV->nloc, - Htmp.data>(), - 1, - Numerator.data>(), - 1); - - ct::Tensor Denominator(ct::DataType::DT_COMPLEX_DOUBLE, - ct::DeviceType::CpuDevice, - ct::TensorShape({this->ParaV->nloc})); - Denominator.zero(); - BlasConnector::copy(this->ParaV->nloc, - Htmp.data>(), - 1, - Denominator.data>(), - 1); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Stmp.data>()[in + j].real() << "+" - << Stmp.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator.data>()[in + j].real() << "+" - << Numerator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute Numerator & Denominator by GEADD - // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt - // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt - std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * this->dt}; - std::complex beta2 = {0.0, 0.25 * this->dt}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp.data>(), - 1, - 1, - this->ParaV->desc, - beta1, - Numerator.data>(), - 1, - 1, - this->ParaV->desc); - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp.data>(), - 1, - 1, - this->ParaV->desc, - beta2, - Denominator.data>(), - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " beta=" << beta1 << std::endl; - ofs_running << " fenmu:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator.data>()[in + j].real() << "+" - << Denominator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) Next, invert Denominator - ct::Tensor ipiv(ct::DataType::DT_INT, - ct::DeviceType::CpuDevice, - ct::TensorShape({this->ParaV->nrow + this->ParaV->nb})); - ipiv.zero(); - int info = 0; - // (3.1) compute ipiv - ScalapackConnector::getrf(nlocal, - nlocal, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - ipiv.data(), - &info); - - // Print ipiv - if (print_matrix) - { - ofs_running << " this->ParaV->nloc = " << this->ParaV->nloc << std::endl; - ofs_running << " this->ParaV->nrow = " << this->ParaV->nrow << std::endl; - ofs_running << " this->ParaV->ncol = " << this->ParaV->ncol << std::endl; - ofs_running << " this->ParaV->nb = " << this->ParaV->nb << std::endl; - ofs_running << " this->ParaV->get_block_size() = " << this->ParaV->get_block_size() << std::endl; - ofs_running << " nlocal = " << nlocal << std::endl; - ofs_running << " ipiv:" << std::endl; - for (int i = 0; i < this->ParaV->nloc; i++) - { - ofs_running << ipiv.data()[i] << " "; - } - ofs_running << std::endl; - } - - int lwork = -1; - int liwotk = -1; - ct::Tensor work(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({1})); - ct::Tensor iwork(ct::DataType::DT_INT, ct::DeviceType::CpuDevice, ct::TensorShape({1})); - // (3.2) compute work - ScalapackConnector::getri(nlocal, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - ipiv.data(), - work.data>(), - &lwork, - iwork.data(), - &liwotk, - &info); - lwork = work.data>()[0].real(); - work.resize(ct::TensorShape({lwork})); - liwotk = iwork.data()[0]; - iwork.resize(ct::TensorShape({liwotk})); - // (3.3) compute inverse matrix of Denominator - ScalapackConnector::getri(nlocal, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - ipiv.data(), - work.data>(), - &lwork, - iwork.data(), - &liwotk, - &info); - assert(0 == info); - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - // (4) U_operator = Denominator * Numerator; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - Numerator.data>(), - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator.data>(), - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " fenmu^-1:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator.data>()[in + j].real() << "+" - << Denominator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " fenzi:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator.data>()[in + j].real() << "+" - << Numerator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - double aa = U_operator.data>()[in + j].real(); - double bb = U_operator.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } -} - -template -void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // (1) copy Htmp to Numerator & Denominator - ct::Tensor Numerator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({nlocal * nlocal})); - Numerator.zero(); - base_device::memory::synchronize_memory_op, Device, Device>()( - Numerator.data>(), - Htmp.data>(), - nlocal * nlocal); - - ct::Tensor Denominator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({nlocal * nlocal})); - Denominator.zero(); - base_device::memory::synchronize_memory_op, Device, Device>()( - Denominator.data>(), - Htmp.data>(), - nlocal * nlocal); - - if (print_matrix) - { - ct::Tensor Stmp_cpu = Stmp.to_device(); - ct::Tensor Numerator_cpu = Numerator.to_device(); - - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Stmp_cpu.data>()[in + j].real() << "+" - << Stmp_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Numerator_cpu.data>()[in + j].real() << "+" - << Numerator_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute Numerator & Denominator by GEADD - // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt - // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt - std::complex one = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * this->dt}; - std::complex beta2 = {0.0, 0.25 * this->dt}; - - // Numerator = -i*para * Htmp - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &beta1, - Numerator.data>(), - 1); - // Numerator = Stmp + (-i*para * Htmp) - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one, - Stmp.data>(), - 1, - Numerator.data>(), - 1); - // Denominator = i*para * Htmp - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &beta2, - Denominator.data>(), - 1); - // Denominator = Stmp + (i*para * Htmp) - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one, - Stmp.data>(), - 1, - Denominator.data>(), - 1); - - if (print_matrix) - { - ct::Tensor Denominator_cpu = Denominator.to_device(); - - ofs_running << " beta=" << beta1 << std::endl; - ofs_running << " fenmu:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Denominator_cpu.data>()[in + j].real() << "+" - << Denominator_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) Next, invert Denominator - ct::Tensor ipiv(ct::DataType::DT_INT, ct_device_type, ct::TensorShape({nlocal})); - ipiv.zero(); - // (3.1) compute ipiv - ct::kernels::lapack_getrf, ct_Device>()(nlocal, - nlocal, - Denominator.data>(), - nlocal, - ipiv.data()); - - // Print ipiv - if (print_matrix) - { - ct::Tensor ipiv_cpu = ipiv.to_device(); - - ofs_running << " ipiv:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - ofs_running << ipiv_cpu.data()[i] << " "; - } - ofs_running << std::endl; - } - - // (3.2) compute inverse matrix of Denominator - ct::Tensor Denominator_inv = create_identity_matrix>(nlocal, ct_device_type); - ct::kernels::lapack_getrs, ct_Device>()('N', - nlocal, - nlocal, - Denominator.data>(), - nlocal, - ipiv.data(), - Denominator_inv.data>(), - nlocal); - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - // (4) U_operator = Denominator_inv * Numerator; - std::complex one_gemm = {1.0, 0.0}; - std::complex zero_gemm = {0.0, 0.0}; - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nlocal, - nlocal, - &one_gemm, - Denominator_inv.data>(), - nlocal, - Numerator.data>(), - nlocal, - &zero_gemm, - U_operator.data>(), - nlocal); - - if (print_matrix) - { - ct::Tensor Denominator_inv_cpu = Denominator_inv.to_device(); - ct::Tensor Numerator_cpu = Numerator.to_device(); - ct::Tensor U_operator_cpu = U_operator.to_device(); - - ofs_running << " fenmu^-1:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Denominator_inv_cpu.data>()[in + j].real() << "+" - << Denominator_inv_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " fenzi:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Numerator_cpu.data>()[in + j].real() << "+" - << Numerator_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = U_operator_cpu.data>()[in + j].real(); - double bb = U_operator_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } -} - -// Explicit instantiation of template functions -template void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/propagator_etrs.cpp b/source/module_hamilt_lcao/module_tddft/propagator_etrs.cpp deleted file mode 100644 index e3dcec0b0d..0000000000 --- a/source/module_hamilt_lcao/module_tddft/propagator_etrs.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "propagator.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void Propagator::compute_propagator_etrs(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - std::vector> U1(this->ParaV->nloc); - std::vector> U2(this->ParaV->nloc); - int tag = 2; - compute_propagator_taylor(nlocal, Stmp, Htmp, U1.data(), ofs_running, print_matrix, tag); - compute_propagator_taylor(nlocal, Stmp, H_laststep, U2.data(), ofs_running, print_matrix, tag); - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U1.data(), - 1, - 1, - this->ParaV->desc, - U2.data(), - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator, - 1, - 1, - this->ParaV->desc); -} -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/propagator_taylor.cpp b/source/module_hamilt_lcao/module_tddft/propagator_taylor.cpp deleted file mode 100644 index ae03c18417..0000000000 --- a/source/module_hamilt_lcao/module_tddft/propagator_taylor.cpp +++ /dev/null @@ -1,343 +0,0 @@ -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "propagator.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void Propagator::compute_propagator_taylor(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const int tag) const -{ - assert(this->ParaV->nloc > 0); - - ModuleBase::GlobalFunc::ZEROS(U_operator, this->ParaV->nloc); - std::complex* A_matrix = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(A_matrix, this->ParaV->nloc); - std::complex* rank0 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank0, this->ParaV->nloc); - std::complex* rank2 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank2, this->ParaV->nloc); - std::complex* rank3 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank3, this->ParaV->nloc); - std::complex* rank4 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank4, this->ParaV->nloc); - std::complex* tmp1 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(tmp1, this->ParaV->nloc); - std::complex* tmp2 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(tmp2, this->ParaV->nloc); - std::complex* Sinv = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(Sinv, this->ParaV->nloc); - BlasConnector::copy(this->ParaV->nloc, Stmp, 1, Sinv, 1); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Stmp[in + j].real() << "+" << Stmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // set rank0 - int info = 0; - int naroc[2] = {0, 0}; // maximum number of row or column - - for (int iprow = 0; iprow < this->ParaV->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < this->ParaV->dim1; ++ipcol) - { - if (iprow == ParaV->coord[0] && ipcol == ParaV->coord[1]) - { - naroc[0] = this->ParaV->nrow; - naroc[1] = this->ParaV->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, this->ParaV->nb, this->ParaV->dim1, ipcol); - if (igcol >= nlocal) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, this->ParaV->nb, this->ParaV->dim0, iprow); - if (igrow >= nlocal) - { - continue; - } - if (igcol == igrow) - { - rank0[j * naroc[0] + i] = {1.0, 0.0}; - } - else - { - rank0[j * naroc[0] + i] = {0.0, 0.0}; - } - } - } - } - } // loop ipcol - } // loop iprow - - std::complex beta = {0.0, -0.5 * this->dt / tag}; // for ETRS tag=2 , for taylor tag=1 - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // invert Stmp - int* ipiv = new int[this->ParaV->nloc]; - // (3.1) compute ipiv - ScalapackConnector::getrf(nlocal, nlocal, Sinv, 1, 1, this->ParaV->desc, ipiv, &info); - int lwork = -1; - int liwotk = -1; - std::vector> work(1, 0); - std::vector iwork(1, 0); - // (3.2) compute work - ScalapackConnector::getri(nlocal, - Sinv, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - lwork = work[0].real(); - work.resize(lwork, 0); - liwotk = iwork[0]; - iwork.resize(liwotk, 0); - ScalapackConnector::getri(nlocal, - Sinv, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - assert(0 == info); - - // A_matrix = - idt S^-1 H ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - beta, - Sinv, - 1, - 1, - this->ParaV->desc, - Htmp, - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator, - 1, - 1, - this->ParaV->desc); - - // rank2 = A^2 ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U_operator, - 1, - 1, - this->ParaV->desc, - U_operator, - 1, - 1, - this->ParaV->desc, - 0.0, - rank2, - 1, - 1, - this->ParaV->desc); - - // rank3 = A^3 ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U_operator, - 1, - 1, - this->ParaV->desc, - rank2, - 1, - 1, - this->ParaV->desc, - 0.0, - rank3, - 1, - 1, - this->ParaV->desc); - - // rank4 = A^4 ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U_operator, - 1, - 1, - this->ParaV->desc, - rank3, - 1, - 1, - this->ParaV->desc, - 0.0, - rank4, - 1, - 1, - this->ParaV->desc); - - std::complex p1 = {1.0, 0.0}; - std::complex p2 = {1.0 / 2.0, 0.0}; - std::complex p3 = {1.0 / 6.0, 0.0}; - std::complex p4 = {1.0 / 24.0, 0.0}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p1, - rank0, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p2, - rank2, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p3, - rank3, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p4, - rank4, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " A_matrix:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << A_matrix[in + j].real() << "+" << A_matrix[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - double aa = U_operator[in + j].real(); - double bb = U_operator[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } - delete[] A_matrix; - delete[] rank0; - delete[] rank2; - delete[] rank3; - delete[] rank4; - delete[] tmp1; - delete[] tmp2; - delete[] Sinv; - delete[] ipiv; -} -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp b/source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp deleted file mode 100644 index 97a71345c8..0000000000 --- a/source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp +++ /dev/null @@ -1,247 +0,0 @@ -#include "snap_psibeta_half_tddft.h" - -#include "source_base/constants.h" -#include "source_base/math_integral.h" -#include "source_base/math_polyint.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" - -namespace module_tddft -{ - -// nlm[0] : -// nlm[1, 2, 3,] : , which a = x, y, z. -void snap_psibeta_half_tddft(const LCAO_Orbitals& orb, - const InfoNonlocal& infoNL_, - std::vector>>& nlm, - const ModuleBase::Vector3& R1, - const int& T1, - const int& L1, - const int& m1, - const int& N1, - const ModuleBase::Vector3& R0, // The projector. - const int& T0, - const ModuleBase::Vector3& A, - const bool& calc_r) -{ - ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); - - // find number of projectors on atom R0 - const int nproj = infoNL_.nproj[T0]; - if (nproj == 0) - { - if (calc_r) - { - nlm.resize(4); - } - else - { - nlm.resize(1); - } - return; - } - - std::vector calproj(nproj); - std::vector rmesh1(nproj); - - if (calc_r) - { - nlm.resize(4); - } - else - { - nlm.resize(1); - } - - // Count number of projectors (l,m) - int natomwfc = 0; - for (int ip = 0; ip < nproj; ip++) - { - //============================ - // Use pseudo-atomic orbitals - //============================ - - const int L0 = infoNL_.Beta[T0].Proj[ip].getL(); // mohan add 2021-05-07 - natomwfc += 2 * L0 + 1; - } - - for (int dim = 0; dim < nlm.size(); dim++) - { - nlm[dim].resize(natomwfc); - for (auto& x: nlm[dim]) - { - x = 0.0; - } - } - - // rcut of orbtials and projectors - // in our calculation, we always put orbital phi at the left side of - // because = - const double Rcut1 = orb.Phi[T1].getRcut(); - const ModuleBase::Vector3 dRa = R0 - R1; - - double distance10 = dRa.norm(); - - bool all_out = true; - for (int ip = 0; ip < nproj; ip++) - { - const double Rcut0 = infoNL_.Beta[T0].Proj[ip].getRcut(); - if (distance10 > (Rcut1 + Rcut0)) - { - calproj[ip] = false; - } - else - { - all_out = false; - calproj[ip] = true; - } - } - - if (all_out) - { - ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); - return; - } - - const int mesh_r1 = orb.Phi[T1].PhiLN(L1, N1).getNr(); - const double* psi_1 = orb.Phi[T1].PhiLN(L1, N1).getPsi(); - const double dk_1 = orb.Phi[T1].PhiLN(L1, N1).getDk(); - - const int ridial_grid_num = 140; - const int angular_grid_num = 110; - std::vector r_ridial(ridial_grid_num); - std::vector weights_ridial(ridial_grid_num); - - int index = 0; - for (int nb = 0; nb < nproj; nb++) - { - const int L0 = infoNL_.Beta[T0].Proj[nb].getL(); - if (!calproj[nb]) - { - index += 2 * L0 + 1; - continue; - } - - const int mesh_r0 = infoNL_.Beta[T0].Proj[nb].getNr(); - const double* beta_r = infoNL_.Beta[T0].Proj[nb].getBeta_r(); - const double* radial0 = infoNL_.Beta[T0].Proj[nb].getRadial(); - const double dk_0 = infoNL_.Beta[T0].Proj[nb].getDk(); - - const double Rcut0 = infoNL_.Beta[T0].Proj[nb].getRcut(); - ModuleBase::Integral::Gauss_Legendre_grid_and_weight(radial0[0], - radial0[mesh_r0 - 1], - ridial_grid_num, - r_ridial.data(), - weights_ridial.data()); - - const double A_phase = A * R0; - const std::complex exp_iAR0 = std::exp(ModuleBase::IMAG_UNIT * A_phase); - - std::vector rly0(L0); - std::vector rly1(L1); - for (int ir = 0; ir < ridial_grid_num; ir++) - { - std::vector> result_angular(2 * L0 + 1, 0.0); - std::vector> result_angular_r_commu_x; - std::vector> result_angular_r_commu_y; - std::vector> result_angular_r_commu_z; - if (calc_r) - { - result_angular_r_commu_x.resize(2 * L0 + 1, 0.0); - result_angular_r_commu_y.resize(2 * L0 + 1, 0.0); - result_angular_r_commu_z.resize(2 * L0 + 1, 0.0); - } - - for (int ian = 0; ian < angular_grid_num; ian++) - { - const double x = ModuleBase::Integral::Lebedev_Laikov_grid110_x[ian]; - const double y = ModuleBase::Integral::Lebedev_Laikov_grid110_y[ian]; - const double z = ModuleBase::Integral::Lebedev_Laikov_grid110_z[ian]; - const double weights_angular = ModuleBase::Integral::Lebedev_Laikov_grid110_w[ian]; - const ModuleBase::Vector3 r_angular_tmp(x, y, z); - - const ModuleBase::Vector3 r_coor = r_ridial[ir] * r_angular_tmp; - const ModuleBase::Vector3 tmp_r_coor = r_coor + dRa; - const double tmp_r_coor_norm = tmp_r_coor.norm(); - if (tmp_r_coor_norm > Rcut1) - { - continue; - } - - ModuleBase::Vector3 tmp_r_unit; - if (tmp_r_coor_norm > 1e-10) - { - tmp_r_unit = tmp_r_coor / tmp_r_coor_norm; - } - - ModuleBase::Ylm::rl_sph_harm(L0, x, y, z, rly0); - - ModuleBase::Ylm::rl_sph_harm(L1, tmp_r_unit.x, tmp_r_unit.y, tmp_r_unit.z, rly1); - - const double phase = A * r_coor; - const std::complex exp_iAr = std::exp(ModuleBase::IMAG_UNIT * phase); - - const ModuleBase::Vector3 tmp_r_coor_r_commu = r_coor + R0; - const double interp_v = ModuleBase::PolyInt::Polynomial_Interpolation(psi_1, - mesh_r1, dk_1, tmp_r_coor_norm); - - for (int m0 = 0; m0 < 2 * L0 + 1; m0++) - { - std::complex temp = exp_iAr * rly0[L0 * L0 + m0] * rly1[L1 * L1 + m1] - * interp_v * weights_angular; - result_angular[m0] += temp; - - if (calc_r) - { - result_angular_r_commu_x[m0] += temp * tmp_r_coor_r_commu.x; - result_angular_r_commu_y[m0] += temp * tmp_r_coor_r_commu.y; - result_angular_r_commu_z[m0] += temp * tmp_r_coor_r_commu.z; - } - } - } - - int index_tmp = index; - const double temp = ModuleBase::PolyInt::Polynomial_Interpolation(beta_r, - mesh_r0, dk_0, r_ridial[ir]) * r_ridial[ir] * weights_ridial[ir]; - - if (!calc_r) - { - for (int m0 = 0; m0 < 2 * L0 + 1; m0++) - { - nlm[0][index_tmp] += temp * result_angular[m0] * exp_iAR0; - index_tmp++; - } - } - else - { - for (int m0 = 0; m0 < 2 * L0 + 1; m0++) - { - nlm[0][index_tmp] += temp * result_angular[m0] * exp_iAR0; - nlm[1][index_tmp] += temp * result_angular_r_commu_x[m0] * exp_iAR0; - nlm[2][index_tmp] += temp * result_angular_r_commu_y[m0] * exp_iAR0; - nlm[3][index_tmp] += temp * result_angular_r_commu_z[m0] * exp_iAR0; - index_tmp++; - } - } - } - - index += 2 * L0 + 1; - } - - for(int dim = 0; dim < nlm.size(); dim++) - { - for (auto &x : nlm[dim]) - { - // nlm[0] is - // nlm[1 or 2 or 3] is , a = x, y, z - x = std::conj(x); - } - } - - assert(index == natomwfc); - ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); - - return; -} - -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h b/source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h deleted file mode 100644 index df736d3217..0000000000 --- a/source/module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SNAP_PSIBETA_HALF_TDDFT -#define SNAP_PSIBETA_HALF_TDDFT - -#include -#include - -#include "source_base/vector3.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/setup_nonlocal.h" - -namespace module_tddft -{ - // calculate the tddft nonlocal potential term - void snap_psibeta_half_tddft( - const LCAO_Orbitals &orb, - const InfoNonlocal &infoNL_, - std::vector>> &nlm, - const ModuleBase::Vector3 &R1, - const int &T1, - const int &L1, - const int &m1, - const int &N1, - const ModuleBase::Vector3 &R0, // The projector. - const int &T0, - const ModuleBase::Vector3 &A, - const bool &calc_r - ); - -} // namespace module_tddft - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp b/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp deleted file mode 100644 index 5271f2fec3..0000000000 --- a/source/module_hamilt_lcao/module_tddft/solve_propagation.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "solve_propagation.h" - -#include - -#include "source_base/lapack_connector.h" -#include "source_base/scalapack_connector.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace module_tddft -{ -#ifdef __MPI -void solve_propagation(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const double dt, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* psi_k_laststep, - std::complex* psi_k) -{ - // (1) init A,B and copy Htmp to A & B - std::complex* operator_A = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(operator_A, pv->nloc); - BlasConnector::copy(pv->nloc, Htmp, 1, operator_A, 1); - - std::complex* operator_B = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(operator_B, pv->nloc); - BlasConnector::copy(pv->nloc, Htmp, 1, operator_B, 1); - - const double dt_au = dt / ModuleBase::AU_to_FS; - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute operator_A & operator_B by GEADD - // operator_A = Stmp + i*para * Htmp; beta2 = para = 0.25 * dt - // operator_B = Stmp - i*para * Htmp; beta1 = - para = -0.25 * dt - std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * dt_au}; - std::complex beta2 = {0.0, 0.25 * dt_au}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - pv->desc, - beta2, - operator_A, - 1, - 1, - pv->desc); - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - pv->desc, - beta1, - operator_B, - 1, - 1, - pv->desc); - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) b = operator_B @ psi_k_laststep - std::complex* tmp_b = new std::complex[pv->nloc_wfc]; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - operator_B, - 1, - 1, - pv->desc, - psi_k_laststep, - 1, - 1, - pv->desc_wfc, - 0.0, - tmp_b, - 1, - 1, - pv->desc_wfc); - //get ipiv - int* ipiv = new int[pv->nloc]; - int info = 0; - // (4) solve Ac=b - ScalapackConnector::gesv(nlocal, - nband, - operator_A, - 1, - 1, - pv->desc, - ipiv, - tmp_b, - 1, - 1, - pv->desc_wfc, - &info); - - //copy solution to psi_k - BlasConnector::copy(pv->nloc_wfc, tmp_b, 1, psi_k, 1); - - delete []tmp_b; - delete []ipiv; - delete []operator_A; - delete []operator_B; -} -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/solve_propagation.h b/source/module_hamilt_lcao/module_tddft/solve_propagation.h deleted file mode 100644 index fc707b20d7..0000000000 --- a/source/module_hamilt_lcao/module_tddft/solve_propagation.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef TD_SOLVE_PROPAGATION_H -#define TD_SOLVE_PROPAGATION_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include - -namespace module_tddft -{ -#ifdef __MPI -/** -* @brief solve propagation equation A@c(t+dt) = B@c(t) -* -* @param[in] pv information of parallel -* @param[in] nband number of bands -* @param[in] nlocal number of orbitals -* @param[in] dt time interval -* @param[in] Stmp overlap matrix S(t+dt/2) -* @param[in] Htmp H(t+dt/2) -* @param[in] psi_k_laststep psi of last step -* @param[out] psi_k psi of this step -*/ -void solve_propagation(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const double dt, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* psi_k_laststep, - std::complex* psi_k); - -#endif -} // namespace module_tddft - -#endif // TD_SOLVE_H \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/td_folding.cpp b/source/module_hamilt_lcao/module_tddft/td_folding.cpp deleted file mode 100644 index d7eefd240e..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_folding.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "td_info.h" -#include "source_base/libm/libm.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -template -void TD_info::folding_HR_td(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type) -{ -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < hR.size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = hR.get_atom_pair(i); - for(int ir = 0;ir < tmp.get_R_size(); ++ir ) - { - const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); - - //new - //cal tddft phase for hybrid gague - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - ModuleBase::Vector3 dtau = ucell->cal_dtau(iat1, iat2, r_index); - const double arg_td = cart_At * dtau * ucell->lat0; - //new - - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - - tmp.find_R(r_index); - tmp.add_to_matrix(hk, ncol, kphase, hk_type); - } - } -} -template -void TD_info::folding_HR_td(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); -template -void TD_info::folding_HR_td>(const hamilt::HContainer>& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); \ No newline at end of file diff --git a/source/module_hamilt_lcao/module_tddft/td_info.cpp b/source/module_hamilt_lcao/module_tddft/td_info.cpp deleted file mode 100644 index 26e2bab0a5..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_info.cpp +++ /dev/null @@ -1,227 +0,0 @@ -#include "td_info.h" - -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_parameter/parameter.h" - -bool TD_info::out_mat_R = false; -bool TD_info::out_vecpot = false; -bool TD_info::out_current = false; -bool TD_info::out_current_k = false; -bool TD_info::init_vecpot_file = false; -bool TD_info::evolve_once = false; - -TD_info* TD_info::td_vel_op = nullptr; - -int TD_info::estep_shift = 0; -int TD_info::istep = -1; -int TD_info::max_istep = -1; -std::vector> TD_info::At_from_file; - -TD_info::TD_info(const UnitCell* ucell_in) -{ - this->ucell = ucell_in; - if (init_vecpot_file && istep == -1) - { - this->read_cart_At(); - } - //read in restart step - if(PARAM.inp.mdp.md_restart) - { - std::stringstream ssc; - ssc << PARAM.globalv.global_readin_dir << "Restart_td.dat"; - std::ifstream file(ssc.str().c_str()); - if (!file) - { - ModuleBase::WARNING_QUIT("TD_info::TD_info", "No Restart_td.dat!"); - } - file >> estep_shift; - std::cout<<"estep_shift"<istep += estep_shift; - return; -} -TD_info::~TD_info() -{ - if(elecstate::H_TDDFT_pw::stype == 1) - { - this->destroy_HS_R_td_sparse(); - } - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] != nullptr) - { - delete this->current_term[dir]; - } - } -} - -void TD_info::output_cart_At(const std::string& out_dir) -{ - if (GlobalV::MY_RANK == 0) - { - std::string out_file; - // generate the output file name - out_file = out_dir + "At.dat"; - std::ofstream ofs; - // output title - if (istep == estep_shift) - { - ofs.open(out_file.c_str(), std::ofstream::out); - ofs << std::left << std::setw(8) << "#istep" << std::setw(15) << "A_x" << std::setw(15) << "A_y" - << std::setw(15) << "A_z" << std::endl; - } - else - { - ofs.open(out_file.c_str(), std::ofstream::app); - } - // output the vector potential - ofs << std::left << std::setw(8) << istep; - // divide by 2.0 to get the atomic unit - for (int i = 0; i < 3; i++) - { - ofs << std::scientific << std::setprecision(4) << std::setw(15) << cart_At[i]; - } - ofs << std::endl; - ofs.close(); - } - return; -} - -void TD_info::cal_cart_At(const ModuleBase::Vector3& At) -{ - istep++; - if (init_vecpot_file) - { - this->cart_At = At_from_file[istep > max_istep ? max_istep : istep]; - } - else - { - // transfrom into atomic unit - this->cart_At = At / 2.0; - } - // output the vector potential if needed - if (out_vecpot == true) - { - this->output_cart_At(PARAM.globalv.global_out_dir); - } -} - -void TD_info::read_cart_At(void) -{ - std::string in_file; - // generate the input file name - in_file = "At.dat"; - std::ifstream ifs(in_file.c_str()); - // check if the file is exist - if (!ifs) - { - ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Cannot open Vector potential file!"); - } - std::string line; - std::vector str_vec; - // use tmp to skip the istep number - int tmp = 0; - while (std::getline(ifs, line)) - { - // A tmporary vector3 to store the data of this line - ModuleBase::Vector3 At; - if (line[0] == '#') - { - continue; - } - std::istringstream iss(line); - // skip the istep number - if (!(iss >> tmp)) - { - ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Error reading istep!"); - } - // read the vector potential - double component = 0; - // Read three components - for (int i = 0; i < 3; i++) - { - if (!(iss >> component)) - { - ModuleBase::WARNING_QUIT("TD_info::read_cart_At", - "Error reading component " + std::to_string(i + 1) + " for istep " - + std::to_string(tmp) + "!"); - } - At[i] = component; - } - // add the tmporary vector3 to the vector potential vector - At_from_file.push_back(At); - } - // set the max_istep - max_istep = At_from_file.size() - 1; - ifs.close(); - - return; -} -void TD_info::out_restart_info(const int nstep, - const ModuleBase::Vector3& At_current, - const ModuleBase::Vector3& At_laststep) -{ - if (GlobalV::MY_RANK == 0) - { - // open file - std::string outdir = PARAM.globalv.global_out_dir + "Restart_td.dat"; - std::ofstream outFile(outdir); - if (!outFile) { - ModuleBase::WARNING_QUIT("out_restart_info", "no Restart_td.dat!"); - } - // write data - outFile << nstep << std::endl; - outFile << At_current[0] << " " << At_current[1] << " " << At_current[2] << std::endl; - outFile << At_laststep[0] << " " << At_laststep[1] << " " << At_laststep[2] << std::endl; - outFile.close(); - } - - - return; -} - -void TD_info::initialize_current_term(const hamilt::HContainer>* HR, - const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("TD_info", "initialize_current_term"); - ModuleBase::timer::tick("TD_info", "initialize_current_term"); - - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - - for (int i = 0; i < HR->size_atom_pairs(); ++i) - { - hamilt::AtomPair>& tmp = HR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->insert_pair(tmp1); - } - } - } - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - - ModuleBase::timer::tick("TD_info", "initialize_current_term"); -} - -void TD_info::destroy_HS_R_td_sparse(void) -{ - std::map, std::map>>> - empty_HR_sparse_td_vel_up; - std::map, std::map>>> - empty_HR_sparse_td_vel_down; - HR_sparse_td_vel[0].swap(empty_HR_sparse_td_vel_up); - HR_sparse_td_vel[1].swap(empty_HR_sparse_td_vel_down); -} diff --git a/source/module_hamilt_lcao/module_tddft/td_info.h b/source/module_hamilt_lcao/module_tddft/td_info.h deleted file mode 100644 index 79026c3b64..0000000000 --- a/source/module_hamilt_lcao/module_tddft/td_info.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef TD_INFO_H -#define TD_INFO_H -#include "source_base/abfs-vector3_order.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -// Class to store TDDFT infos, mainly for periodic system. -class TD_info -{ - public: - TD_info(const UnitCell* ucell_in); - ~TD_info(); - - void init(); - - /// @brief switch to control the output of HR - static bool out_mat_R; - - /// @brief pointer to the only TD_info object itself - static TD_info* td_vel_op; - - /// @brief switch to control the output of At - static bool out_vecpot; - - /// @brief switch to control the output of current - static bool out_current; - - /// @brief switch to control the format of the output current, in total or in each k-point - static bool out_current_k; - - /// @brief switch to control the source of At - static bool init_vecpot_file; - - /// @brief if need to calculate more than once - static bool evolve_once; - - /// @brief Restart step - static int estep_shift; - - /// @brief Store the vector potential for tddft calculation - ModuleBase::Vector3 cart_At; - - /// @brief calculate the At in cartesian coordinate - void cal_cart_At(const ModuleBase::Vector3& At); - - /// @brief output RT-TDDFT info for restart - void out_restart_info(const int nstep, - const ModuleBase::Vector3& At_current, - const ModuleBase::Vector3& At_laststep); - - // allocate memory for current term. - void initialize_current_term(const hamilt::HContainer>* HR, const Parallel_Orbitals* paraV); - - hamilt::HContainer>* get_current_term_pointer(const int& i) const - { - return this->current_term[i]; - } - - - // folding HR to hk, for hybrid gague - template - void folding_HR_td(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); - - int get_istep() - { - return istep; - } - - const UnitCell* get_ucell() - { - return this->ucell; - } - - // For TDDFT velocity gauge, to fix the output of HR - std::map, std::map>>> HR_sparse_td_vel[2]; - - private: - /// @brief pointer to the unit cell - const UnitCell* ucell = nullptr; - - /// @brief read At from output file - void read_cart_At(); - - /// @brief output cart_At to output file - void output_cart_At(const std::string& out_dir); - - /// @brief store isteps now - static int istep; - - /// @brief total steps of read in At - static int max_istep; - - /// @brief store the read in At_data - static std::vector> At_from_file; - - /// @brief destory HSR data stored - void destroy_HS_R_td_sparse(); - - /// @brief part of Momentum operator, -iāˆ‡ - i[r,Vnl]. Used to calculate current. - std::vector>*> current_term = {nullptr, nullptr, nullptr}; -}; - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/test/CMakeLists.txt b/source/module_hamilt_lcao/module_tddft/test/CMakeLists.txt deleted file mode 100644 index 96e005a1c4..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -remove_definitions(-D __MPI) - -add_library(tddft_test_lib tddft_test.cpp) -target_link_libraries(tddft_test_lib Threads::Threads GTest::gtest_main GTest::gmock_main) -#target_include_directories(tddft_test_lib PUBLIC $<$:${GTEST_INCLUDE_DIRS}>) - -AddTest( - TARGET tddft_middle_hamilt_test - LIBS parameter ${math_libs} base device tddft_test_lib - SOURCES middle_hamilt_test.cpp ../middle_hamilt.cpp -) - -AddTest( - TARGET tddft_band_energy_test - LIBS parameter ${math_libs} base device tddft_test_lib - SOURCES band_energy_test.cpp ../band_energy.cpp ../../../source_basis/module_ao/parallel_orbitals.cpp -) - -AddTest( - TARGET tddft_norm_psi_test - LIBS parameter ${math_libs} base device tddft_test_lib - SOURCES norm_psi_test.cpp ../norm_psi.cpp -) - -AddTest( - TARGET tddft_upsi_test - LIBS parameter ${math_libs} base device tddft_test_lib - SOURCES upsi_test1.cpp upsi_test2.cpp upsi_test3.cpp ../upsi.cpp -) - -AddTest( - TARGET tddft_propagator_test - LIBS parameter ${math_libs} base device tddft_test_lib - SOURCES propagator_test1.cpp propagator_test2.cpp propagator_test3.cpp ../propagator.cpp ../propagator_cn2.cpp ../propagator_taylor.cpp ../propagator_etrs.cpp -) - diff --git a/source/module_hamilt_lcao/module_tddft/test/band_energy_test.cpp b/source/module_hamilt_lcao/module_tddft/test/band_energy_test.cpp deleted file mode 100644 index e17a684559..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/band_energy_test.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "module_hamilt_lcao/module_tddft/band_energy.h" - -#include -#include -#include - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "tddft_test.h" - -/************************************************ - * unit test of functions in band_energy.h - ***********************************************/ - -/** - * - Tested Function - * - compute_ekb - * - compute band energy ekb . - */ - -#define doublethreshold 1e-8 - -TEST(BandEnergyTest, testBandEnergy) -{ - std::complex* psi_k; - std::complex* Htmp; - double* ekb; - int nband = 3; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nlocal; - pv->nloc_wfc = nlocal * nband; - pv->ncol = nlocal; - pv->nrow = nlocal; - pv->ncol_bands = nband; - pv->dim0 = 1; - pv->dim1 = 1; - pv->nb = 1; - pv->blacs_ctxt = 0; - pv->coord[0] = pv->coord[1] = 0; - - int dim[2]; - dim[0] = nprow; - dim[1] = npcol; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nband, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow), - lld1 = numroc_(&nband, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_wfc, &nlocal, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_Eij, &nband, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - Htmp = new std::complex[nlocal * nlocal]; - psi_k = new std::complex[nlocal * nband]; - ekb = new double[nband]; - - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - Htmp[i * nlocal + j] = std::complex(1.0, 0.0); - } - } - } - Htmp[1] = 0.5; - Htmp[4] = 0.5; - - psi_k[0] = 1.0; - psi_k[1] = 1.0; - psi_k[2] = 0.0; - psi_k[3] = 0.0; - psi_k[4] = 2.0; - psi_k[5] = 1.0; - psi_k[6] = 1.0; - psi_k[7] = 0.0; - psi_k[8] = 3.0; - psi_k[9] = 0.0; - psi_k[10] = 0.0; - psi_k[11] = 1.0; - - // Call the function - module_tddft::compute_ekb(pv, nband, nlocal, Htmp, psi_k, ekb, GlobalV::ofs_running); - - // Check the results - EXPECT_NEAR(ekb[0], 3.0, doublethreshold); - EXPECT_NEAR(ekb[1], 8.0, doublethreshold); - EXPECT_NEAR(ekb[2], 10.0, doublethreshold); - - delete[] psi_k; - delete[] Htmp; - delete[] ekb; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/middle_hamilt_test.cpp b/source/module_hamilt_lcao/module_tddft/test/middle_hamilt_test.cpp deleted file mode 100644 index 3c71dd70d0..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/middle_hamilt_test.cpp +++ /dev/null @@ -1,149 +0,0 @@ -#include "module_hamilt_lcao/module_tddft/middle_hamilt.h" - -#include "source_base/global_variable.h" // GlobalV::ofs_running -#include "source_basis/module_ao/parallel_orbitals.h" -#include "tddft_test.h" - -#include -#include -#include - -/************************************************ - * unit test of functions in middle_hamilt.h - ***********************************************/ - -/** - * - Tested Function - * - half_Hmatrix - * - compute H(t+dt/2). - */ - -#define doublethreshold 1e-8 -Parallel_Orbitals::Parallel_Orbitals() -{ -} -Parallel_Orbitals::~Parallel_Orbitals() -{ -} - -TEST(MiddleHamiltTest, testMiddleHamilt) -{ - std::complex* Htmp; - std::complex* Hlaststep; - std::complex* Stmp; - std::complex* Slaststep; - int nband = 3; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nlocal; - pv->ncol = nlocal; - pv->nrow = nlocal; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nlocal, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - Htmp = new std::complex[nlocal * nlocal]; - Hlaststep = new std::complex[nlocal * nlocal]; - Stmp = new std::complex[nlocal * nlocal]; - Slaststep = new std::complex[nlocal * nlocal]; - - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - Htmp[i * nlocal + j] = std::complex(1.0, 0.0); - Hlaststep[i * nlocal + j] = std::complex(1.0 + 0.2 * (i * nlocal + j), 0.0); - Stmp[i * nlocal + j] = std::complex(1.0, 0.0); - Slaststep[i * nlocal + j] = std::complex(1.0 + 0.2 * (i * nlocal + j), 0.0); - } - else - { - Hlaststep[i * nlocal + j] = std::complex(0.2 * (i * nlocal + j), 0.0); - Slaststep[i * nlocal + j] = std::complex(0.2 * (i * nlocal + j), 0.0); - } - } - } - - // Call the function - module_tddft::half_Hmatrix(pv, nband, nlocal, Htmp, Stmp, Hlaststep, Slaststep, GlobalV::ofs_running, print_matrix); - - // Check the results - EXPECT_NEAR(Htmp[0].real(), 1.0, doublethreshold); - EXPECT_NEAR(Htmp[0].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[1].real(), 0.1, doublethreshold); - EXPECT_NEAR(Htmp[1].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[2].real(), 0.2, doublethreshold); - EXPECT_NEAR(Htmp[2].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[3].real(), 0.3, doublethreshold); - EXPECT_NEAR(Htmp[3].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[4].real(), 0.4, doublethreshold); - EXPECT_NEAR(Htmp[4].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[5].real(), 1.5, doublethreshold); - EXPECT_NEAR(Htmp[5].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[6].real(), 0.6, doublethreshold); - EXPECT_NEAR(Htmp[6].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[7].real(), 0.7, doublethreshold); - EXPECT_NEAR(Htmp[7].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[8].real(), 0.8, doublethreshold); - EXPECT_NEAR(Htmp[8].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[9].real(), 0.9, doublethreshold); - EXPECT_NEAR(Htmp[9].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[10].real(), 2.0, doublethreshold); - EXPECT_NEAR(Htmp[10].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[11].real(), 1.1, doublethreshold); - EXPECT_NEAR(Htmp[11].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[12].real(), 1.2, doublethreshold); - EXPECT_NEAR(Htmp[12].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[13].real(), 1.3, doublethreshold); - EXPECT_NEAR(Htmp[13].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[14].real(), 1.4, doublethreshold); - EXPECT_NEAR(Htmp[14].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Htmp[15].real(), 2.5, doublethreshold); - EXPECT_NEAR(Htmp[15].imag(), 0.0, doublethreshold); - - EXPECT_NEAR(Stmp[0].real(), 1.0, doublethreshold); - EXPECT_NEAR(Stmp[0].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[1].real(), 0.1, doublethreshold); - EXPECT_NEAR(Stmp[1].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[2].real(), 0.2, doublethreshold); - EXPECT_NEAR(Stmp[2].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[3].real(), 0.3, doublethreshold); - EXPECT_NEAR(Stmp[3].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[4].real(), 0.4, doublethreshold); - EXPECT_NEAR(Stmp[4].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[5].real(), 1.5, doublethreshold); - EXPECT_NEAR(Stmp[5].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[6].real(), 0.6, doublethreshold); - EXPECT_NEAR(Stmp[6].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[7].real(), 0.7, doublethreshold); - EXPECT_NEAR(Stmp[7].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[8].real(), 0.8, doublethreshold); - EXPECT_NEAR(Stmp[8].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[9].real(), 0.9, doublethreshold); - EXPECT_NEAR(Stmp[9].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[10].real(), 2.0, doublethreshold); - EXPECT_NEAR(Stmp[10].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[11].real(), 1.1, doublethreshold); - EXPECT_NEAR(Stmp[11].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[12].real(), 1.2, doublethreshold); - EXPECT_NEAR(Stmp[12].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[13].real(), 1.3, doublethreshold); - EXPECT_NEAR(Stmp[13].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[14].real(), 1.4, doublethreshold); - EXPECT_NEAR(Stmp[14].imag(), 0.0, doublethreshold); - EXPECT_NEAR(Stmp[15].real(), 2.5, doublethreshold); - EXPECT_NEAR(Stmp[15].imag(), 0.0, doublethreshold); - - delete[] Htmp; - delete[] Hlaststep; - delete[] Stmp; - delete[] Slaststep; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/norm_psi_test.cpp b/source/module_hamilt_lcao/module_tddft/test/norm_psi_test.cpp deleted file mode 100644 index 0f7b85e837..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/norm_psi_test.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include "module_hamilt_lcao/module_tddft/norm_psi.h" - -#include "source_base/global_variable.h" // GlobalV::ofs_running -#include "source_basis/module_ao/parallel_orbitals.h" -#include "tddft_test.h" - -#include -#include -#include - -/************************************************ - * unit test of functions in norm_psi.h - ***********************************************/ - -/** - * - Tested Function - * - norm_psi - * - normalize the wave function. - */ - -#define doublethreshold 1e-8 -Parallel_Orbitals::Parallel_Orbitals() -{ -} -Parallel_Orbitals::~Parallel_Orbitals() -{ -} - -TEST(NormPsiTest, testNormPsi) -{ - std::complex* psi_k; - std::complex* Stmp; - int nband = 3; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nlocal; - pv->nloc_wfc = nlocal * nband; - pv->ncol = nlocal; - pv->nrow = nlocal; - pv->ncol_bands = nband; - pv->dim0 = 1; - pv->dim1 = 1; - pv->nb = 1; - pv->blacs_ctxt = 0; - pv->coord[0] = pv->coord[1] = 0; - - int dim[2]; - dim[0] = nprow; - dim[1] = npcol; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nband, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow), - lld1 = numroc_(&nband, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_wfc, &nlocal, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_Eij, &nband, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - Stmp = new std::complex[nlocal * nlocal]; - psi_k = new std::complex[nlocal * nband]; - - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - Stmp[i * nlocal + j] = std::complex(1.0, 0.0); - } - } - } - Stmp[1] = 0.5; - Stmp[4] = 0.5; - - psi_k[0] = 1.0; - psi_k[1] = 1.0; - psi_k[2] = 0.0; - psi_k[3] = 0.0; - psi_k[4] = 2.0; - psi_k[5] = 1.0; - psi_k[6] = 1.0; - psi_k[7] = 0.0; - psi_k[8] = 3.0; - psi_k[9] = 0.0; - psi_k[10] = 0.0; - psi_k[11] = 1.0; - - // Call the function - module_tddft::norm_psi(pv, nband, nlocal, Stmp, psi_k, GlobalV::ofs_running, print_matrix); - - // Check the results - EXPECT_NEAR(psi_k[0].real(), 0.577350269189626, doublethreshold); - EXPECT_NEAR(psi_k[0].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[1].real(), 0.577350269189626, doublethreshold); - EXPECT_NEAR(psi_k[1].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[2].real(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[2].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[3].real(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[3].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[4].real(), 0.707106781186547, doublethreshold); - EXPECT_NEAR(psi_k[4].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[5].real(), 0.353553390593274, doublethreshold); - EXPECT_NEAR(psi_k[5].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[6].real(), 0.353553390593274, doublethreshold); - EXPECT_NEAR(psi_k[6].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[7].real(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[7].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[8].real(), 0.948683298050514, doublethreshold); - EXPECT_NEAR(psi_k[8].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[9].real(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[9].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[10].real(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[10].imag(), 0.0, doublethreshold); - EXPECT_NEAR(psi_k[11].real(), 0.316227766016838, doublethreshold); - EXPECT_NEAR(psi_k[11].imag(), 0.0, doublethreshold); - - delete[] psi_k; - delete[] Stmp; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/propagator_test1.cpp b/source/module_hamilt_lcao/module_tddft/test/propagator_test1.cpp deleted file mode 100644 index 82838d5e81..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/propagator_test1.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include -#define private public -#define protected public -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/propagator.h" -#include "module_parameter/parameter.h" -#include "tddft_test.h" - -#include -#include - -/************************************************ - * unit test of functions in propagator.h - ***********************************************/ - -/** - * - Tested Function - * - Propagator::compute_propagator_cn2 - * - compute propagator of method Crank-Nicolson. - */ -#define doublethreshold 1e-8 -Parallel_Orbitals::Parallel_Orbitals() -{ -} -Parallel_Orbitals::~Parallel_Orbitals() -{ -} - -TEST(PropagatorTest, testPropagatorCN) -{ - std::complex* U_operator; - std::complex* Stmp; - std::complex* Htmp; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nlocal; - pv->ncol = nlocal; - pv->coord[0] = pv->coord[1] = 0; - PARAM.input.mdp.md_dt = 4 * ModuleBase::AU_to_FS; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nlocal, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - U_operator = new std::complex[nlocal * nlocal]; - Stmp = new std::complex[nlocal * nlocal]; - Htmp = new std::complex[nlocal * nlocal]; - - for (int i = 0; i < nlocal * nlocal; ++i) - { - U_operator[i] = std::complex(0.0, 0.0); - } - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - Htmp[i * nlocal + j] = std::complex(1.0, 0.0); - Stmp[i * nlocal + j] = std::complex(1.0, 0.0); - } - } - } - Stmp[1] = 0.5; - Stmp[4] = 0.5; - - // Call the function - int propagator = 0; - module_tddft::Propagator prop(propagator, pv, PARAM.mdp.md_dt); - prop.compute_propagator(nlocal, Stmp, Htmp, nullptr, U_operator, GlobalV::ofs_running, print_matrix); - - // Check the results - EXPECT_NEAR(U_operator[0].real(), -0.107692307692308, doublethreshold); - EXPECT_NEAR(U_operator[0].imag(), -0.861538461538462, doublethreshold); - EXPECT_NEAR(U_operator[1].real(), 0.492307692307692, doublethreshold); - EXPECT_NEAR(U_operator[1].imag(), -0.0615384615384615, doublethreshold); - EXPECT_NEAR(U_operator[2].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[2].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[3].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[3].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[4].real(), 0.492307692307692, doublethreshold); - EXPECT_NEAR(U_operator[4].imag(), -0.0615384615384615, doublethreshold); - EXPECT_NEAR(U_operator[5].real(), -0.107692307692308, doublethreshold); - EXPECT_NEAR(U_operator[5].imag(), -0.861538461538462, doublethreshold); - EXPECT_NEAR(U_operator[6].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[6].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[7].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[7].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[8].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[8].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[9].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[9].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[10].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[10].imag(), -1.0, doublethreshold); - EXPECT_NEAR(U_operator[11].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[11].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[12].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[12].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[13].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[13].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[14].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[14].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[15].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[15].imag(), -1.0, doublethreshold); - - delete[] U_operator; - delete[] Htmp; - delete[] Stmp; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/propagator_test2.cpp b/source/module_hamilt_lcao/module_tddft/test/propagator_test2.cpp deleted file mode 100644 index 9fb8ea0a11..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/propagator_test2.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include -#define private public -#define protected public -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/propagator.h" -#include "module_parameter/parameter.h" -#include "tddft_test.h" - -#include -#include - -/************************************************ - * unit test of functions in propagator.h - ***********************************************/ - -/** - * - Tested Function - * - Propagator::compute_propagator_taylor - * - compute propagator of method 4th Taylor expansion. - */ - -#define doublethreshold 1e-8 - -TEST(PropagatorTest, testPropagatorTaylor) -{ - std::complex* U_operator; - std::complex* Stmp; - std::complex* Htmp; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nlocal; - pv->ncol = nlocal; - pv->nrow = nlocal; - pv->dim0 = 1; - pv->dim1 = 1; - pv->nb = 1; - pv->blacs_ctxt = 0; - pv->coord[0] = pv->coord[1] = 0; - - int dim[2]; - dim[0] = nprow; - dim[1] = npcol; - - PARAM.input.mdp.md_dt = 4 * ModuleBase::AU_to_FS; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nlocal, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - U_operator = new std::complex[nlocal * nlocal]; - Stmp = new std::complex[nlocal * nlocal]; - Htmp = new std::complex[nlocal * nlocal]; - - for (int i = 0; i < nlocal * nlocal; ++i) - { - U_operator[i] = std::complex(0.0, 0.0); - } - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - Htmp[i * nlocal + j] = std::complex(1.0, 0.0); - Stmp[i * nlocal + j] = std::complex(1.0, 0.0); - } - } - } - Stmp[1] = 0.5; - Stmp[4] = 0.5; - - // Call the function - int propagator = 1; - module_tddft::Propagator prop(propagator, pv, PARAM.mdp.md_dt); - prop.compute_propagator(nlocal, Stmp, Htmp, nullptr, U_operator, GlobalV::ofs_running, print_matrix); - - // Check the results - EXPECT_NEAR(U_operator[0].real(), 1.95473251028807, doublethreshold); - EXPECT_NEAR(U_operator[0].imag(), 2.8641975308642, doublethreshold); - EXPECT_NEAR(U_operator[1].real(), -1.7119341563786, doublethreshold); - EXPECT_NEAR(U_operator[1].imag(), -3.80246913580247, doublethreshold); - EXPECT_NEAR(U_operator[2].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[2].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[3].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[3].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[4].real(), -1.7119341563786, doublethreshold); - EXPECT_NEAR(U_operator[4].imag(), -3.80246913580247, doublethreshold); - EXPECT_NEAR(U_operator[5].real(), 1.95473251028807, doublethreshold); - EXPECT_NEAR(U_operator[5].imag(), 2.8641975308642, doublethreshold); - EXPECT_NEAR(U_operator[6].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[6].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[7].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[7].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[8].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[8].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[9].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[9].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[10].real(), -0.333333333333333, doublethreshold); - EXPECT_NEAR(U_operator[10].imag(), -0.666666666666667, doublethreshold); - EXPECT_NEAR(U_operator[11].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[11].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[12].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[12].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[13].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[13].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[14].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[14].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[15].real(), -0.333333333333333, doublethreshold); - EXPECT_NEAR(U_operator[15].imag(), -0.666666666666667, doublethreshold); - - delete[] U_operator; - delete[] Htmp; - delete[] Stmp; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/propagator_test3.cpp b/source/module_hamilt_lcao/module_tddft/test/propagator_test3.cpp deleted file mode 100644 index eb19445c02..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/propagator_test3.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include -#define private public -#define protected public -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/propagator.h" -#include "module_parameter/parameter.h" -#include "tddft_test.h" - -#include -#include - -/************************************************ - * unit test of functions in propagator.h - ***********************************************/ - -/** - * - Tested Function - * - Propagator::compute_propagator_etrs - * - compute propagator of method ETRS. - */ - -#define doublethreshold 1e-8 - -TEST(PropagatorTest, testPropagatorETRS) -{ - std::complex* U_operator; - std::complex* Stmp; - std::complex* Htmp; - std::complex* Hlaststep; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nlocal; - pv->ncol = nlocal; - pv->nrow = nlocal; - pv->dim0 = 1; - pv->dim1 = 1; - pv->nb = 1; - pv->blacs_ctxt = 0; - pv->coord[0] = pv->coord[1] = 0; - - int dim[2]; - dim[0] = nprow; - dim[1] = npcol; - - PARAM.input.mdp.md_dt = 4 * ModuleBase::AU_to_FS; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nlocal, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - U_operator = new std::complex[nlocal * nlocal]; - Stmp = new std::complex[nlocal * nlocal]; - Htmp = new std::complex[nlocal * nlocal]; - Hlaststep = new std::complex[nlocal * nlocal]; - - for (int i = 0; i < nlocal * nlocal; ++i) - { - U_operator[i] = std::complex(0.0, 0.0); - } - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - Htmp[i * nlocal + j] = std::complex(1.0, 0.0); - Hlaststep[i * nlocal + j] = std::complex(1.0, 0.0); - Stmp[i * nlocal + j] = std::complex(1.0, 0.0); - } - } - } - Stmp[1] = 0.5; - Stmp[4] = 0.5; - Hlaststep[0] = 1.1; - - // Call the function - int propagator = 2; - module_tddft::Propagator prop(propagator, pv, PARAM.mdp.md_dt); - prop.compute_propagator(nlocal, Stmp, Htmp, Hlaststep, U_operator, GlobalV::ofs_running, print_matrix); - - // Check the results - EXPECT_NEAR(U_operator[0].real(), -0.0105865569272976, doublethreshold); - EXPECT_NEAR(U_operator[0].imag(), -0.228336412132297, doublethreshold); - EXPECT_NEAR(U_operator[1].real(), 0.195527023319616, doublethreshold); - EXPECT_NEAR(U_operator[1].imag(), -0.728701844231062, doublethreshold); - EXPECT_NEAR(U_operator[2].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[2].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[3].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[3].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[4].real(), 0.247662246608749, doublethreshold); - EXPECT_NEAR(U_operator[4].imag(), -0.694263679317177, doublethreshold); - EXPECT_NEAR(U_operator[5].real(), -0.0219180003048316, doublethreshold); - EXPECT_NEAR(U_operator[5].imag(), -0.300090839811004, doublethreshold); - EXPECT_NEAR(U_operator[6].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[6].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[7].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[7].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[8].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[8].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[9].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[9].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[10].real(), -0.401041666666667, doublethreshold); - EXPECT_NEAR(U_operator[10].imag(), -0.902777777777778, doublethreshold); - EXPECT_NEAR(U_operator[11].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[11].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[12].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[12].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[13].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[13].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[14].real(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[14].imag(), 0.0, doublethreshold); - EXPECT_NEAR(U_operator[15].real(), -0.401041666666667, doublethreshold); - EXPECT_NEAR(U_operator[15].imag(), -0.902777777777778, doublethreshold); - - delete[] U_operator; - delete[] Htmp; - delete[] Stmp; - delete[] Hlaststep; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/tddft_test.cpp b/source/module_hamilt_lcao/module_tddft/test/tddft_test.cpp deleted file mode 100644 index 7d416d3cee..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/tddft_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "tddft_test.h" - -#include -#include - -#include "source_base/blacs_connector.h" -#include "source_base/scalapack_connector.h" -#include "source_basis/module_ao/parallel_orbitals.h" - -/************************************************ - * unit test of module_tddft - ***********************************************/ - -int myprow, nprow, ictxt, mypcol, npcol; - -void MPIInit() -{ - int myrank; - int mysize; - - MPI_Init(NULL, NULL); - MPI_Comm_size(MPI_COMM_WORLD, &mysize); - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - - // Set up BLACS context and grid - int nprocs; - nprow = 1; - npcol = 1; - Cblacs_pinfo(&myrank, &mysize); - Cblacs_get(-1, 0, &ictxt); - char order[] = "Row"; - Cblacs_gridinit(&ictxt, order, nprow, npcol); - Cblacs_gridinfo(ictxt, &nprow, &npcol, &myprow, &mypcol); -} - -/************************************************ - * unit test of module_tddft - ***********************************************/ -int main(int argc, char** argv) -{ - MPIInit(); - - int result = 0; - testing::InitGoogleTest(&argc, argv); - result = RUN_ALL_TESTS(); - - Cblacs_exit(ictxt); - - // MPI_Finalize(); - return 0; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/tddft_test.h b/source/module_hamilt_lcao/module_tddft/test/tddft_test.h deleted file mode 100644 index be488206f0..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/tddft_test.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef __TDDFTTEST -#define __TDDFTTEST -#include - -#include "gtest/gtest.h" -#include "source_basis/module_ao/parallel_orbitals.h" - -extern int myprow, nprow, ictxt, mypcol, npcol; - -class TDDFTTEST : public testing::Test -{ - public: - static void SetUpTestCase() - { - std::cout << "\033[32m" - << "============================" - << "\033[0m" << std::endl; - std::cout << "\033[32m" - << "= TDDFT MODULE TEST START =" - << "\033[0m" << std::endl; - std::cout << "\033[32m" - << "============================" - << "\033[0m" << std::endl; - } - static void TearDownTestCase() - { - std::cout << "\033[32m" - << "============================" - << "\033[0m" << std::endl; - std::cout << "\033[32m" - << "= TDDFT MODULE TEST END =" - << "\033[0m" << std::endl; - std::cout << "\033[32m" - << "============================" - << "\033[0m" << std::endl; - } - void SetUp() - { - std::cout << "\033[32m" - << "[ CASE ]" - << "\033[0m" - << " "; - } - void TearDown() - { - } -}; - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/test/upsi_test1.cpp b/source/module_hamilt_lcao/module_tddft/test/upsi_test1.cpp deleted file mode 100644 index 80ca58ba70..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/upsi_test1.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "source_base/global_variable.h" // GlobalV::ofs_running -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/upsi.h" -#include "tddft_test.h" - -#include -#include -#include - -#define doublethreshold 1e-8 - -/************************************************ - * unit test of functions in upsi.h - ***********************************************/ - -/** - * - Tested Function - * - upsi - * - apply U_operator to the wave function of the previous step for new wave function. - */ -Parallel_Orbitals::Parallel_Orbitals() -{ -} -Parallel_Orbitals::~Parallel_Orbitals() -{ -} - -TEST(UpsiTest, testUpsi1) -{ - std::complex* U_operator; - std::complex* psi_k_laststep; - std::complex* psi_k; - int nband = 2; - int nlocal = 2; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nband; - pv->ncol = nlocal; - pv->ncol_bands = nband; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nband, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_wfc, &nlocal, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - U_operator = new std::complex[nlocal * nlocal]; - psi_k_laststep = new std::complex[nlocal * nband]; - psi_k = new std::complex[nlocal * nband]; - - for (int i = 0; i < nlocal * nlocal; ++i) - { - U_operator[i] = std::complex(1.0, 0.0); - } - for (int i = 0; i < nlocal * nband; ++i) - { - psi_k_laststep[i] = std::complex(1.0, 0.0); - psi_k[i] = std::complex(0.0, 0.0); - } - - // Call the function - module_tddft::upsi(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, GlobalV::ofs_running, print_matrix); - - // Check the results - for (int i = 0; i < nlocal * nband; ++i) - { - EXPECT_NEAR(psi_k[i].real(), nlocal, doublethreshold); - EXPECT_NEAR(psi_k[i].imag(), 0.0, doublethreshold); - } - delete[] U_operator; - delete[] psi_k; - delete[] psi_k_laststep; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/upsi_test2.cpp b/source/module_hamilt_lcao/module_tddft/test/upsi_test2.cpp deleted file mode 100644 index 7d2bb68171..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/upsi_test2.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "source_base/global_variable.h" // GlobalV::ofs_running -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/upsi.h" -#include "tddft_test.h" - -#include -#include -#include - -#define doublethreshold 1e-8 - -/************************************************ - * unit test of functions in upsi.h - ***********************************************/ - -/** - * - Tested Function - * - upsi - * - apply U_operator to the wave function of the previous step for new wave function. - */ - -TEST(UpsiTest, testUpsi2) -{ - std::complex* U_operator; - std::complex* psi_k_laststep; - std::complex* psi_k; - int nband = 3; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nband; - pv->ncol = nlocal; - pv->ncol_bands = nband; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nband, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_wfc, &nlocal, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - U_operator = new std::complex[nlocal * nlocal]; - psi_k_laststep = new std::complex[nlocal * nband]; - psi_k = new std::complex[nlocal * nband]; - - for (int i = 0; i < nlocal * nlocal; ++i) - { - U_operator[i] = std::complex(1.0, 0.0); - } - for (int i = 0; i < nlocal * nband; ++i) - { - psi_k_laststep[i] = std::complex(2.0, 0.0); - psi_k[i] = std::complex(0.0, 0.0); - } - - // Call the function - module_tddft::upsi(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, GlobalV::ofs_running, print_matrix); - - // Check the results - for (int i = 0; i < nlocal * nband; ++i) - { - EXPECT_NEAR(psi_k[i].real(), 2.0 * nlocal, doublethreshold); - EXPECT_NEAR(psi_k[i].imag(), 0.0, doublethreshold); - } - delete[] U_operator; - delete[] psi_k; - delete[] psi_k_laststep; -} diff --git a/source/module_hamilt_lcao/module_tddft/test/upsi_test3.cpp b/source/module_hamilt_lcao/module_tddft/test/upsi_test3.cpp deleted file mode 100644 index 4f5d0e5c96..0000000000 --- a/source/module_hamilt_lcao/module_tddft/test/upsi_test3.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "source_base/global_variable.h" // GlobalV::ofs_running -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_tddft/upsi.h" -#include "tddft_test.h" - -#include -#include -#include - -#define doublethreshold 1e-8 - -/************************************************ - * unit test of functions in upsi.h - ***********************************************/ - -/** - * - Tested Function - * - upsi - * - apply U_operator to the wave function of the previous step for new wave function. - */ - -TEST(UpsiTest, testUpsi3) -{ - std::complex* U_operator; - std::complex* psi_k_laststep; - std::complex* psi_k; - int nband = 3; - int nlocal = 4; - bool print_matrix = false; - Parallel_Orbitals* pv; - pv = new Parallel_Orbitals(); - pv->nloc = nlocal * nband; - pv->ncol = nlocal; - pv->ncol_bands = nband; - - // Initialize input matrices - int info; - int mb = 1, nb = 1, lda = nband, ldc = nlocal; - int irsrc = 0, icsrc = 0, lld = numroc_(&nlocal, &mb, &myprow, &irsrc, &nprow); - descinit_(pv->desc, &nlocal, &nlocal, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - descinit_(pv->desc_wfc, &nlocal, &nband, &mb, &nb, &irsrc, &icsrc, &ictxt, &lld, &info); - - // Initialize data - U_operator = new std::complex[nlocal * nlocal]; - psi_k_laststep = new std::complex[nlocal * nband]; - psi_k = new std::complex[nlocal * nband]; - - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (i == j) - { - U_operator[i * nlocal + j] = std::complex(1.0, 0.0); - } - else - { - U_operator[i * nlocal + j] = std::complex(0.0, 0.0); - } - } - } - - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nband; ++j) - { - psi_k_laststep[i * nband + j] = std::complex(i * nband + j, 0.0); - psi_k[i * nband + j] = std::complex(0.0, 0.0); - } - } - - // Call the function - module_tddft::upsi(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, GlobalV::ofs_running, print_matrix); - - // Check the results - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nband; ++j) - { - EXPECT_NEAR(psi_k[i * nband + j].real(), i * nband + j, doublethreshold); - EXPECT_NEAR(psi_k[i].imag(), 0.0, doublethreshold); - } - } - delete[] U_operator; - delete[] psi_k; - delete[] psi_k_laststep; -} diff --git a/source/module_hamilt_lcao/module_tddft/upsi.cpp b/source/module_hamilt_lcao/module_tddft/upsi.cpp deleted file mode 100644 index 15d78f19e2..0000000000 --- a/source/module_hamilt_lcao/module_tddft/upsi.cpp +++ /dev/null @@ -1,271 +0,0 @@ -#include "upsi.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void upsi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* U_operator, - const std::complex* psi_k_laststep, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - U_operator, - 1, - 1, - pv->desc, - psi_k_laststep, - 1, - 1, - pv->desc_wfc, - 0.0, - psi_k, - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k[in + j].real(); - double bb = psi_k[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k_laststep:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k_laststep[in + j].real(); - double bb = psi_k_laststep[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -void upsi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - U_operator.data>(), - 1, - 1, - pv->desc, - psi_k_laststep.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k.data>()[in + j].real(); - double bb = psi_k.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k_laststep:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k_laststep.data>()[in + j].real(); - double bb = psi_k_laststep.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -template -void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Perform the matrix multiplication: psi_k = U_operator * psi_k_laststep - std::complex alpha = {1.0, 0.0}; - std::complex beta = {0.0, 0.0}; - - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nlocal, - &alpha, - U_operator.data>(), - nlocal, - psi_k_laststep.data>(), - nlocal, - &beta, - psi_k.data>(), - nlocal); - - if (print_matrix) - { - ct::Tensor psi_k_cpu = psi_k.to_device(); - ct::Tensor psi_k_laststep_cpu = psi_k_laststep.to_device(); - - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = psi_k_cpu.data>()[in + j].real(); - double bb = psi_k_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k_laststep:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = psi_k_laststep_cpu.data>()[in + j].real(); - double bb = psi_k_laststep_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -// Explicit instantiation of template functions -template void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/module_hamilt_lcao/module_tddft/upsi.h b/source/module_hamilt_lcao/module_tddft/upsi.h deleted file mode 100644 index 459613b74b..0000000000 --- a/source/module_hamilt_lcao/module_tddft/upsi.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file upsi.h - * @brief apply U_operator to the wave function of the previous step for new wave function - * This file originally belonged to file LCAO_evolve.cpp - */ - -#ifndef UPSI_H -#define UPSI_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief apply U_operator to the wave function of the previous step for new wave function - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] U_operator operator of propagator - * @param[in] psi_k_laststep psi of last step - * @param[in] print_matirx print internal matrix or not - * @param[out] psi_k psi of this step - */ -void upsi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* U_operator, - const std::complex* psi_k_laststep, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -void upsi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -template -void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -#endif // __MPI -} // namespace module_tddft - -#endif diff --git a/source/module_hamilt_lcao/module_tddft/velocity_op.cpp b/source/module_hamilt_lcao/module_tddft/velocity_op.cpp deleted file mode 100644 index 7534b705ba..0000000000 --- a/source/module_hamilt_lcao/module_tddft/velocity_op.cpp +++ /dev/null @@ -1,532 +0,0 @@ -#include "velocity_op.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" -#ifdef _OPENMP -#include -#include -#endif -#include "module_parameter/parameter.h" -template -cal_r_overlap_R Velocity_op::r_calculator; -template -bool Velocity_op::init_done = false; -template -Velocity_op::Velocity_op(const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator* intor) - : ucell(ucell_in), paraV(paraV) , orb_(orb), intor_(intor) -{ - // for length gague, the A(t) = 0 for all the time. - this->cart_At = ModuleBase::Vector3(0,0,0); - this->initialize_grad_term(GridD_in, paraV); - this->initialize_vcomm_r(GridD_in, paraV); -} -template -Velocity_op::~Velocity_op() -{ - for (int dir=0;dir<3;dir++) - { - delete this->current_term[dir]; - } -} -//allocate space for current_term -template -void Velocity_op::initialize_vcomm_r(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("Velocity_op", "initialize_vcomm_r"); - ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); - if(!init_done) - { - std::cout << "init_r_overlap_nonlocal" <current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - this->adjs_vcommr.clear(); - this->adjs_vcommr.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_vcommr.push_back(adjs); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) - { - continue; - } - hamilt::AtomPair> tmp(iat1, - iat2, - R_index2.x - R_index1.x, - R_index2.y - R_index1.y, - R_index2.z - R_index1.z, - paraV); - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->insert_pair(tmp); - } - } - } - } - // allocate the memory of BaseMatrix in cal_vcomm_r_IJR, and set the new values to zero - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); -} -template -void Velocity_op::initialize_grad_term(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("Velocity_op", "initialize_grad_term"); - ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); - for (int dir=0;dir<3;dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - this->adjs_grad.clear(); - this->adjs_grad.reserve(this->ucell->nat); - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + orb_.Phi[T2].getRcut()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_grad.push_back(adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index = adjs.box[ad]; - hamilt::AtomPair> tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->insert_pair(tmp); - } - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - - ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); -} -template -void Velocity_op::calculate_vcomm_r() -{ - ModuleBase::TITLE("Velocity_op", "calculate_vcomm_r"); - ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); - - const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - - // 1. calculate for each pair of atoms - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo& adjs = this->adjs_vcommr[iat0]; - std::vector>>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - for (int i = 0; i < adjs.adj_num + 1; i++) - { - nlm_tot[i].resize(4); - } - - #pragma omp parallel - { - #pragma omp for schedule(dynamic) - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - //std::vector>> nlm; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false - // and size of outer vector is 4 when out_current is true (3 for , 1 for - // ) inner loop : all projectors (L0,M0) - - // snap_psibeta_half_tddft() are used to calculate - // and as well if current are needed - ModuleBase::Vector3 dtau = tau0 - tau1; - - r_calculator.get_psi_r_beta(*ucell, - nlm, - tau1 * this->ucell->lat0, - T1, - atom1->iw2l[iw1], - atom1->iw2m[iw1], - atom1->iw2n[iw1], - tau0 * this->ucell->lat0, - T0); - for (int dir = 0; dir < 4; dir++) - { - nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); - } - } - } - - #ifdef _OPENMP - // record the iat number of the adjacent atoms - std::set ad_atom_set; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - ad_atom_set.insert(iat1); - } - - // split the ad_atom_set into num_threads parts - const int num_threads = omp_get_num_threads(); - const int thread_id = omp_get_thread_num(); - std::set ad_atom_set_thread; - int i = 0; - for(const auto iat1 : ad_atom_set) - { - if (i % num_threads == thread_id) - { - ad_atom_set_thread.insert(iat1); - } - i++; - } - #endif - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - #ifdef _OPENMP - if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) - { - continue; - } - #endif - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2])->get_pointer(); - } - // if not found , skip this pair of atoms - if (tmp_c[0] != nullptr) - { - this->cal_vcomm_r_IJR(iat1, - iat2, - T0, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - tmp_c); - } - } - } - } - } - ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); -} - -// cal_HR_IJR() -template -void Velocity_op::cal_vcomm_r_IJR( - const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>& nlm1_all, - const std::vector>>& nlm2_all, - std::complex** current_mat_p) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = col_indexes.size() * is + is2; - } - } - // calculate the local matrix - const TR* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); - //std::vector>*> nlm1; - std::vector*> nlm1; - for (int dir = 0; dir < 4; dir++) - { - nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); - } - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - //std::vector>*> nlm2; - std::vector*> nlm2; - for (int dir = 0; dir < 4; dir++) - { - nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); - } - -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - for (int dir = 0; dir < 3; dir++) - { - std::complex nlm_r_tmp = std::complex{0, 0}; - std::complex imag_unit = std::complex{0, 1}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - //- - // multiply d in the end - TR tmp = (nlm1[dir + 1]->at(p1) * nlm2[0]->at(p2) - - nlm1[0]->at(p1) * nlm2[dir + 1]->at(p2)) - * (*tmp_d); - nlm_r_tmp += tmp; - } - // -i[r,Vnl], 2.0 due to the unit transformation - current_mat_p[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += npol; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } -} -template -void Velocity_op::calculate_grad_term() -{ - ModuleBase::TITLE("Velocity_op", "calculate_grad_term"); - if(this->current_term[0]==nullptr || this->current_term[0]->size_atom_pairs()<=0) - { - ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "grad_term is nullptr or empty"); - } - ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); - - const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_grad[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_index2)->get_pointer(); - } - if (tmp_c[0] != nullptr) - { - this->cal_grad_IJR(iat1, iat2, paraV, dtau, tmp_c); - } - else - { - ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "R_index not found in HR"); - } - } - } - ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); -} -template -void Velocity_op::cal_grad_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex** current_mat_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - // --------------------------------------------- - // get tau1 (in cell <0,0,0>) and tau2 (in cell R) - // in principle, only dtau is needed in this function - // snap_psipsi should be refactored to use dtau directly - // --------------------------------------------- - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double grad[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for(int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - // calculate , which equals to -. - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, nullptr, grad); - ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); - - for (int dir = 0; dir < 3; dir++) - { - for (int ipol = 0; ipol < npol; ipol++) - { - // part of Momentum operator, -iāˆ‡r,used to calculate the current - // here is actually iāˆ‡R - current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); - } - current_mat_p[dir] += npol; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } -} -template class Velocity_op; -template class Velocity_op>; diff --git a/source/module_hamilt_lcao/module_tddft/velocity_op.h b/source/module_hamilt_lcao/module_tddft/velocity_op.h deleted file mode 100644 index cebf99c214..0000000000 --- a/source/module_hamilt_lcao/module_tddft/velocity_op.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef TD_VELOCITY_OP_H -#define TD_VELOCITY_OP_H -#include -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_base/vector3.h" -#include "module_io/cal_r_overlap_R.h" - -//design to calculate velocity operator -template -class Velocity_op -{ - public: - Velocity_op(const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator* intor); - ~Velocity_op(); - - hamilt::HContainer>* get_current_term_pointer(const int& i)const - { - return this->current_term[i]; - } - void calculate_vcomm_r(); - void calculate_grad_term(); - - private: - const UnitCell* ucell = nullptr; - - const Parallel_Orbitals* paraV = nullptr; - - const LCAO_Orbitals& orb_; - - /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only shared between TD operators. - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - - const TwoCenterIntegrator* intor_ = nullptr; - const TwoCenterIntegrator* intorbeta_ = nullptr; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_vcomm_r(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); - void initialize_grad_term(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_vcomm_r_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>& nlm1_all, - const std::vector>>& nlm2_all, - std::complex** current_mat_p); - void cal_grad_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex** current_mat_p); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_vcommr; - std::vector adjs_grad; - - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; - static cal_r_overlap_R r_calculator; - static bool init_done; -}; - - -#endif // TD_CURRENT_H From f8848053c7c5e3bea56c23499751592c7738b430 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:31:17 +0800 Subject: [PATCH 72/81] Delete source/module_io directory --- source/module_io/CMakeLists.txt | 137 - source/module_io/berryphase.cpp | 691 -- source/module_io/berryphase.h | 86 - source/module_io/bessel_basis.cpp | 487 -- source/module_io/bessel_basis.h | 190 - source/module_io/binstream.cpp | 54 - source/module_io/binstream.h | 123 - source/module_io/cal_dos.cpp | 252 - source/module_io/cal_dos.h | 38 - source/module_io/cal_ldos.cpp | 368 - source/module_io/cal_ldos.h | 75 - source/module_io/cal_mlkedf_descriptors.cpp | 520 -- source/module_io/cal_mlkedf_descriptors.h | 109 - source/module_io/cal_pLpR.cpp | 291 - source/module_io/cal_pLpR.h | 224 - source/module_io/cal_pdos_gamma.cpp | 287 - source/module_io/cal_pdos_gamma.h | 44 - source/module_io/cal_pdos_multik.cpp | 318 - source/module_io/cal_pdos_multik.h | 45 - source/module_io/cal_r_overlap_R.cpp | 1090 --- source/module_io/cal_r_overlap_R.h | 103 - source/module_io/cal_test.cpp | 237 - source/module_io/cal_test.h | 66 - source/module_io/cif_io.cpp | 529 -- source/module_io/cif_io.h | 194 - source/module_io/csr_reader.cpp | 140 - source/module_io/csr_reader.h | 71 - source/module_io/ctrl_output_fp.cpp | 133 - source/module_io/ctrl_output_fp.h | 11 - source/module_io/ctrl_output_lcao.cpp | 514 -- source/module_io/ctrl_output_lcao.h | 49 - source/module_io/cube_io.h | 105 - source/module_io/dipole_io.h | 23 - source/module_io/fR_overlap.cpp | 376 - source/module_io/fR_overlap.h | 65 - source/module_io/file_reader.cpp | 50 - source/module_io/file_reader.h | 39 - source/module_io/filename.cpp | 111 - source/module_io/filename.h | 38 - source/module_io/get_pchg_lcao.cpp | 486 - source/module_io/get_pchg_lcao.h | 110 - source/module_io/get_pchg_pw.h | 211 - source/module_io/get_wf_lcao.cpp | 722 -- source/module_io/get_wf_lcao.h | 126 - source/module_io/get_wf_pw.h | 248 - source/module_io/input_conv.cpp | 631 -- source/module_io/input_conv.h | 149 - source/module_io/input_item.h | 65 - source/module_io/io_dmk.cpp | 408 - source/module_io/io_dmk.h | 90 - source/module_io/io_npz.cpp | 474 - source/module_io/io_npz.h | 23 - source/module_io/json_output/CMakeLists.txt | 23 - source/module_io/json_output/abacusjson.cpp | 152 - source/module_io/json_output/abacusjson.h | 132 - source/module_io/json_output/general_info.cpp | 71 - source/module_io/json_output/general_info.h | 14 - source/module_io/json_output/init_info.cpp | 152 - source/module_io/json_output/init_info.h | 31 - source/module_io/json_output/json_node.h | 21 - source/module_io/json_output/output_info.cpp | 165 - source/module_io/json_output/output_info.h | 36 - source/module_io/json_output/readin_info.cpp | 16 - source/module_io/json_output/readin_info.h | 21 - .../module_io/json_output/test/CMakeLists.txt | 11 - .../json_output/test/para_json_test.cpp | 398 - source/module_io/nscf_band.cpp | 119 - source/module_io/nscf_band.h | 29 - source/module_io/nscf_fermi_surf.cpp | 93 - source/module_io/nscf_fermi_surf.h | 19 - source/module_io/numerical_basis.cpp | 863 -- source/module_io/numerical_basis.h | 108 - source/module_io/numerical_basis_jyjy.cpp | 161 - source/module_io/numerical_basis_jyjy.h | 51 - source/module_io/numerical_descriptor.cpp | 387 - source/module_io/numerical_descriptor.h | 46 - source/module_io/orb_io.cpp | 192 - source/module_io/orb_io.h | 37 - source/module_io/output.cpp | 288 - source/module_io/output.h | 133 - source/module_io/output_dmk.cpp | 21 - source/module_io/output_dmk.h | 26 - source/module_io/output_log.cpp | 362 - source/module_io/output_log.h | 90 - source/module_io/output_mat_sparse.cpp | 104 - source/module_io/output_mat_sparse.h | 31 - source/module_io/output_mulliken.cpp | 641 -- source/module_io/output_mulliken.h | 196 - source/module_io/output_sk.cpp | 48 - source/module_io/output_sk.h | 29 - source/module_io/para_json.cpp | 70 - source/module_io/para_json.h | 23 - source/module_io/parse_args.cpp | 39 - source/module_io/parse_args.h | 23 - source/module_io/print_info.cpp | 385 - source/module_io/print_info.h | 30 - source/module_io/read_cube.cpp | 194 - source/module_io/read_exit_file.cpp | 111 - source/module_io/read_exit_file.h | 22 - source/module_io/read_input.cpp | 532 -- source/module_io/read_input.h | 155 - source/module_io/read_input_item_deepks.cpp | 202 - .../module_io/read_input_item_elec_stru.cpp | 897 -- source/module_io/read_input_item_exx_dftu.cpp | 523 -- source/module_io/read_input_item_md.cpp | 413 - source/module_io/read_input_item_model.cpp | 375 - source/module_io/read_input_item_ofdft.cpp | 465 - source/module_io/read_input_item_other.cpp | 550 -- source/module_io/read_input_item_output.cpp | 550 -- .../module_io/read_input_item_postprocess.cpp | 293 - source/module_io/read_input_item_relax.cpp | 213 - source/module_io/read_input_item_sdft.cpp | 111 - source/module_io/read_input_item_system.cpp | 840 -- source/module_io/read_input_item_tddft.cpp | 410 - source/module_io/read_input_tool.h | 215 - source/module_io/read_set_globalv.cpp | 156 - source/module_io/read_wf2rho_pw.cpp | 185 - source/module_io/read_wf2rho_pw.h | 42 - source/module_io/read_wfc_lcao.cpp | 492 -- source/module_io/read_wfc_lcao.h | 87 - source/module_io/read_wfc_nao.cpp | 221 - source/module_io/read_wfc_nao.h | 52 - source/module_io/read_wfc_pw.cpp | 342 - source/module_io/read_wfc_pw.h | 34 - source/module_io/restart.cpp | 65 - source/module_io/restart.h | 58 - source/module_io/restart_exx_csr.h | 38 - source/module_io/restart_exx_csr.hpp | 141 - source/module_io/rhog_io.cpp | 417 - source/module_io/rhog_io.h | 60 - source/module_io/single_R_io.cpp | 143 - source/module_io/single_R_io.h | 18 - source/module_io/sparse_matrix.cpp | 116 - source/module_io/sparse_matrix.h | 104 - source/module_io/td_current_io.cpp | 634 -- source/module_io/td_current_io.h | 53 - source/module_io/test/CMakeLists.txt | 284 - source/module_io/test/INPUTs | 3 - source/module_io/test/bessel_basis_test.cpp | 563 -- source/module_io/test/binstream_test.cpp | 93 - source/module_io/test/cal_dos_test.cpp | 168 - source/module_io/test/cal_pLpR_test.cpp | 168 - source/module_io/test/cif_io_test.cpp | 415 - source/module_io/test/csr_reader_test.cpp | 100 - source/module_io/test/dos_test.h | 109 - source/module_io/test/file_reader_test.cpp | 73 - .../module_io/test/for_testing_input_conv.h | 298 - source/module_io/test/for_testing_klist.h | 48 - source/module_io/test/io_dmk_test.cpp | 336 - .../module_io/test/numerical_basis_test.cpp | 207 - source/module_io/test/orb_io_test.cpp | 162 - .../module_io/test/output_mulliken_mock.cpp | 185 - .../module_io/test/output_mulliken_test.cpp | 126 - source/module_io/test/output_test.cpp | 160 - source/module_io/test/outputlog_test.cpp | 343 - source/module_io/test/parse_args_test.cpp | 63 - source/module_io/test/prepare_unitcell.h | 327 - source/module_io/test/print_info_test.cpp | 213 - source/module_io/test/read_exit_file_test.cpp | 116 - source/module_io/test/read_input_ptest.cpp | 506 -- source/module_io/test/read_rhog_test.cpp | 159 - source/module_io/test/read_wf2rho_pw_test.cpp | 374 - source/module_io/test/read_wfc_lcao_test.cpp | 772 -- source/module_io/test/read_wfc_nao_test.cpp | 172 - source/module_io/test/read_wfc_pw_test.cpp | 347 - source/module_io/test/single_R_io_test.cpp | 86 - source/module_io/test/sparse_matrix_test.cpp | 170 - .../BesselBasis_UnitTest_C4_AtomType0.html | 28 - source/module_io/test/support/DMK_nspin1 | 147 - source/module_io/test/support/DMK_nspin2 | 198 - source/module_io/test/support/INPUT | 389 - source/module_io/test/support/KPT | 4 - source/module_io/test/support/QO_ovlpR_0.dat | 9 - source/module_io/test/support/SK_nspin1 | 24 - source/module_io/test/support/SK_nspin2 | 48 - source/module_io/test/support/SR.csr | 11 - source/module_io/test/support/STRU | 21 - source/module_io/test/support/Si.upf | 1226 --- source/module_io/test/support/WINPUT | 70 - .../module_io/test/support/charge-density.dat | Bin 41304 -> 0 bytes source/module_io/test/support/dms1_nao.txt | 119 - source/module_io/test/support/dms1k1_nao.txt | 119 - source/module_io/test/support/istate.info | 396 - source/module_io/test/support/kpoints | 38 - source/module_io/test/support/sc.json | 22 - source/module_io/test/support/wfs1_nao.txt | 14 - source/module_io/test/support/wfs1k1_nao.txt | 52 - source/module_io/test/support/wfs1k1_pw.dat | Bin 8492 -> 0 bytes source/module_io/test/support/wfs1k2_nao.txt | 52 - source/module_io/test/support/wfs1k3_nao.txt | 52 - source/module_io/test/support/wfs1k4_nao.txt | 52 - source/module_io/test/support/wfs2_nao.txt | 32 - source/module_io/test/tmp_mocks.cpp | 46 - source/module_io/test/to_qo_test.cpp | 1567 ---- source/module_io/test/winput_test.cpp | 102 - source/module_io/test/write_dos_pw_test.cpp | 187 - source/module_io/test/write_eig_occ_test.cpp | 128 - source/module_io/test/write_orb_info_test.cpp | 89 - source/module_io/test/write_wfc_nao_para.sh | 18 - source/module_io/test/write_wfc_nao_test.cpp | 520 -- source/module_io/test_serial/CMakeLists.txt | 62 - .../test_serial/io_system_variable_test.cpp | 84 - .../module_io/test_serial/nscf_band_test.cpp | 79 - .../module_io/test_serial/prepare_unitcell.h | 327 - .../test_serial/read_input_item_test.cpp | 1789 ---- .../module_io/test_serial/read_input_test.cpp | 169 - .../test_serial/read_input_tool_test.cpp | 62 - source/module_io/test_serial/rho_io_test.cpp | 240 - .../module_io/test_serial/support/chgs1.cube | 7784 ----------------- source/module_io/to_qo.h | 249 - source/module_io/to_qo_kernel.cpp | 622 -- source/module_io/to_qo_mpi.cpp | 64 - source/module_io/to_qo_structures.cpp | 298 - source/module_io/to_wannier90.cpp | 517 -- source/module_io/to_wannier90.h | 94 - source/module_io/to_wannier90_lcao.cpp | 1214 --- source/module_io/to_wannier90_lcao.h | 162 - source/module_io/to_wannier90_lcao_in_pw.cpp | 276 - source/module_io/to_wannier90_lcao_in_pw.h | 100 - source/module_io/to_wannier90_pw.cpp | 1057 --- source/module_io/to_wannier90_pw.h | 121 - source/module_io/unk_overlap_lcao.cpp | 657 -- source/module_io/unk_overlap_lcao.h | 76 - source/module_io/unk_overlap_pw.cpp | 242 - source/module_io/unk_overlap_pw.h | 61 - source/module_io/winput.cpp | 770 -- source/module_io/winput.h | 153 - source/module_io/write_HS.h | 54 - source/module_io/write_HS.hpp | 285 - source/module_io/write_HS_R.cpp | 306 - source/module_io/write_HS_R.h | 75 - source/module_io/write_HS_sparse.cpp | 835 -- source/module_io/write_HS_sparse.h | 43 - source/module_io/write_cube.cpp | 255 - source/module_io/write_dipole.cpp | 174 - source/module_io/write_dmr.cpp | 95 - source/module_io/write_dmr.h | 52 - source/module_io/write_dos_lcao.cpp | 143 - source/module_io/write_dos_lcao.h | 35 - source/module_io/write_dos_pw.cpp | 79 - source/module_io/write_dos_pw.h | 24 - source/module_io/write_eband_terms.hpp | 217 - source/module_io/write_eig_occ.cpp | 187 - source/module_io/write_eig_occ.h | 18 - source/module_io/write_elecstat_pot.cpp | 112 - source/module_io/write_elecstat_pot.h | 37 - source/module_io/write_elf.cpp | 151 - source/module_io/write_elf.h | 26 - source/module_io/write_libxc_r.cpp | 448 - source/module_io/write_libxc_r.h | 54 - source/module_io/write_mlkedf_descriptors.cpp | 192 - source/module_io/write_mlkedf_descriptors.h | 63 - source/module_io/write_orb_info.cpp | 43 - source/module_io/write_orb_info.h | 10 - source/module_io/write_pao.cpp | 38 - source/module_io/write_pao.h | 10 - source/module_io/write_proj_band_lcao.cpp | 401 - source/module_io/write_proj_band_lcao.h | 24 - source/module_io/write_vxc.hpp | 344 - source/module_io/write_vxc_lip.hpp | 296 - source/module_io/write_vxc_r.hpp | 203 - source/module_io/write_wfc_nao.cpp | 328 - source/module_io/write_wfc_nao.h | 58 - source/module_io/write_wfc_pw.cpp | 310 - source/module_io/write_wfc_pw.h | 29 - source/module_io/write_wfc_r.cpp | 207 - source/module_io/write_wfc_r.h | 48 - 267 files changed, 65006 deletions(-) delete mode 100644 source/module_io/CMakeLists.txt delete mode 100644 source/module_io/berryphase.cpp delete mode 100644 source/module_io/berryphase.h delete mode 100644 source/module_io/bessel_basis.cpp delete mode 100644 source/module_io/bessel_basis.h delete mode 100644 source/module_io/binstream.cpp delete mode 100644 source/module_io/binstream.h delete mode 100644 source/module_io/cal_dos.cpp delete mode 100644 source/module_io/cal_dos.h delete mode 100644 source/module_io/cal_ldos.cpp delete mode 100644 source/module_io/cal_ldos.h delete mode 100644 source/module_io/cal_mlkedf_descriptors.cpp delete mode 100644 source/module_io/cal_mlkedf_descriptors.h delete mode 100644 source/module_io/cal_pLpR.cpp delete mode 100644 source/module_io/cal_pLpR.h delete mode 100644 source/module_io/cal_pdos_gamma.cpp delete mode 100644 source/module_io/cal_pdos_gamma.h delete mode 100644 source/module_io/cal_pdos_multik.cpp delete mode 100644 source/module_io/cal_pdos_multik.h delete mode 100644 source/module_io/cal_r_overlap_R.cpp delete mode 100644 source/module_io/cal_r_overlap_R.h delete mode 100644 source/module_io/cal_test.cpp delete mode 100644 source/module_io/cal_test.h delete mode 100644 source/module_io/cif_io.cpp delete mode 100644 source/module_io/cif_io.h delete mode 100644 source/module_io/csr_reader.cpp delete mode 100644 source/module_io/csr_reader.h delete mode 100644 source/module_io/ctrl_output_fp.cpp delete mode 100644 source/module_io/ctrl_output_fp.h delete mode 100644 source/module_io/ctrl_output_lcao.cpp delete mode 100644 source/module_io/ctrl_output_lcao.h delete mode 100644 source/module_io/cube_io.h delete mode 100644 source/module_io/dipole_io.h delete mode 100644 source/module_io/fR_overlap.cpp delete mode 100644 source/module_io/fR_overlap.h delete mode 100644 source/module_io/file_reader.cpp delete mode 100644 source/module_io/file_reader.h delete mode 100644 source/module_io/filename.cpp delete mode 100644 source/module_io/filename.h delete mode 100644 source/module_io/get_pchg_lcao.cpp delete mode 100644 source/module_io/get_pchg_lcao.h delete mode 100644 source/module_io/get_pchg_pw.h delete mode 100644 source/module_io/get_wf_lcao.cpp delete mode 100644 source/module_io/get_wf_lcao.h delete mode 100644 source/module_io/get_wf_pw.h delete mode 100644 source/module_io/input_conv.cpp delete mode 100644 source/module_io/input_conv.h delete mode 100644 source/module_io/input_item.h delete mode 100644 source/module_io/io_dmk.cpp delete mode 100644 source/module_io/io_dmk.h delete mode 100644 source/module_io/io_npz.cpp delete mode 100644 source/module_io/io_npz.h delete mode 100644 source/module_io/json_output/CMakeLists.txt delete mode 100644 source/module_io/json_output/abacusjson.cpp delete mode 100644 source/module_io/json_output/abacusjson.h delete mode 100644 source/module_io/json_output/general_info.cpp delete mode 100644 source/module_io/json_output/general_info.h delete mode 100644 source/module_io/json_output/init_info.cpp delete mode 100644 source/module_io/json_output/init_info.h delete mode 100644 source/module_io/json_output/json_node.h delete mode 100644 source/module_io/json_output/output_info.cpp delete mode 100644 source/module_io/json_output/output_info.h delete mode 100644 source/module_io/json_output/readin_info.cpp delete mode 100644 source/module_io/json_output/readin_info.h delete mode 100644 source/module_io/json_output/test/CMakeLists.txt delete mode 100644 source/module_io/json_output/test/para_json_test.cpp delete mode 100644 source/module_io/nscf_band.cpp delete mode 100644 source/module_io/nscf_band.h delete mode 100644 source/module_io/nscf_fermi_surf.cpp delete mode 100644 source/module_io/nscf_fermi_surf.h delete mode 100644 source/module_io/numerical_basis.cpp delete mode 100644 source/module_io/numerical_basis.h delete mode 100644 source/module_io/numerical_basis_jyjy.cpp delete mode 100644 source/module_io/numerical_basis_jyjy.h delete mode 100644 source/module_io/numerical_descriptor.cpp delete mode 100644 source/module_io/numerical_descriptor.h delete mode 100644 source/module_io/orb_io.cpp delete mode 100644 source/module_io/orb_io.h delete mode 100644 source/module_io/output.cpp delete mode 100644 source/module_io/output.h delete mode 100644 source/module_io/output_dmk.cpp delete mode 100644 source/module_io/output_dmk.h delete mode 100644 source/module_io/output_log.cpp delete mode 100644 source/module_io/output_log.h delete mode 100644 source/module_io/output_mat_sparse.cpp delete mode 100644 source/module_io/output_mat_sparse.h delete mode 100644 source/module_io/output_mulliken.cpp delete mode 100644 source/module_io/output_mulliken.h delete mode 100644 source/module_io/output_sk.cpp delete mode 100644 source/module_io/output_sk.h delete mode 100644 source/module_io/para_json.cpp delete mode 100644 source/module_io/para_json.h delete mode 100644 source/module_io/parse_args.cpp delete mode 100644 source/module_io/parse_args.h delete mode 100644 source/module_io/print_info.cpp delete mode 100644 source/module_io/print_info.h delete mode 100644 source/module_io/read_cube.cpp delete mode 100644 source/module_io/read_exit_file.cpp delete mode 100644 source/module_io/read_exit_file.h delete mode 100644 source/module_io/read_input.cpp delete mode 100644 source/module_io/read_input.h delete mode 100644 source/module_io/read_input_item_deepks.cpp delete mode 100644 source/module_io/read_input_item_elec_stru.cpp delete mode 100644 source/module_io/read_input_item_exx_dftu.cpp delete mode 100644 source/module_io/read_input_item_md.cpp delete mode 100644 source/module_io/read_input_item_model.cpp delete mode 100644 source/module_io/read_input_item_ofdft.cpp delete mode 100644 source/module_io/read_input_item_other.cpp delete mode 100644 source/module_io/read_input_item_output.cpp delete mode 100644 source/module_io/read_input_item_postprocess.cpp delete mode 100644 source/module_io/read_input_item_relax.cpp delete mode 100644 source/module_io/read_input_item_sdft.cpp delete mode 100644 source/module_io/read_input_item_system.cpp delete mode 100644 source/module_io/read_input_item_tddft.cpp delete mode 100644 source/module_io/read_input_tool.h delete mode 100644 source/module_io/read_set_globalv.cpp delete mode 100644 source/module_io/read_wf2rho_pw.cpp delete mode 100644 source/module_io/read_wf2rho_pw.h delete mode 100644 source/module_io/read_wfc_lcao.cpp delete mode 100644 source/module_io/read_wfc_lcao.h delete mode 100644 source/module_io/read_wfc_nao.cpp delete mode 100644 source/module_io/read_wfc_nao.h delete mode 100644 source/module_io/read_wfc_pw.cpp delete mode 100644 source/module_io/read_wfc_pw.h delete mode 100644 source/module_io/restart.cpp delete mode 100644 source/module_io/restart.h delete mode 100644 source/module_io/restart_exx_csr.h delete mode 100644 source/module_io/restart_exx_csr.hpp delete mode 100644 source/module_io/rhog_io.cpp delete mode 100644 source/module_io/rhog_io.h delete mode 100644 source/module_io/single_R_io.cpp delete mode 100644 source/module_io/single_R_io.h delete mode 100644 source/module_io/sparse_matrix.cpp delete mode 100644 source/module_io/sparse_matrix.h delete mode 100644 source/module_io/td_current_io.cpp delete mode 100644 source/module_io/td_current_io.h delete mode 100644 source/module_io/test/CMakeLists.txt delete mode 100644 source/module_io/test/INPUTs delete mode 100644 source/module_io/test/bessel_basis_test.cpp delete mode 100644 source/module_io/test/binstream_test.cpp delete mode 100644 source/module_io/test/cal_dos_test.cpp delete mode 100644 source/module_io/test/cal_pLpR_test.cpp delete mode 100644 source/module_io/test/cif_io_test.cpp delete mode 100644 source/module_io/test/csr_reader_test.cpp delete mode 100644 source/module_io/test/dos_test.h delete mode 100644 source/module_io/test/file_reader_test.cpp delete mode 100644 source/module_io/test/for_testing_input_conv.h delete mode 100644 source/module_io/test/for_testing_klist.h delete mode 100644 source/module_io/test/io_dmk_test.cpp delete mode 100644 source/module_io/test/numerical_basis_test.cpp delete mode 100644 source/module_io/test/orb_io_test.cpp delete mode 100644 source/module_io/test/output_mulliken_mock.cpp delete mode 100644 source/module_io/test/output_mulliken_test.cpp delete mode 100644 source/module_io/test/output_test.cpp delete mode 100644 source/module_io/test/outputlog_test.cpp delete mode 100644 source/module_io/test/parse_args_test.cpp delete mode 100644 source/module_io/test/prepare_unitcell.h delete mode 100644 source/module_io/test/print_info_test.cpp delete mode 100644 source/module_io/test/read_exit_file_test.cpp delete mode 100644 source/module_io/test/read_input_ptest.cpp delete mode 100644 source/module_io/test/read_rhog_test.cpp delete mode 100644 source/module_io/test/read_wf2rho_pw_test.cpp delete mode 100644 source/module_io/test/read_wfc_lcao_test.cpp delete mode 100644 source/module_io/test/read_wfc_nao_test.cpp delete mode 100644 source/module_io/test/read_wfc_pw_test.cpp delete mode 100644 source/module_io/test/single_R_io_test.cpp delete mode 100644 source/module_io/test/sparse_matrix_test.cpp delete mode 100644 source/module_io/test/support/BesselBasis_UnitTest_C4_AtomType0.html delete mode 100644 source/module_io/test/support/DMK_nspin1 delete mode 100644 source/module_io/test/support/DMK_nspin2 delete mode 100644 source/module_io/test/support/INPUT delete mode 100644 source/module_io/test/support/KPT delete mode 100644 source/module_io/test/support/QO_ovlpR_0.dat delete mode 100644 source/module_io/test/support/SK_nspin1 delete mode 100644 source/module_io/test/support/SK_nspin2 delete mode 100644 source/module_io/test/support/SR.csr delete mode 100644 source/module_io/test/support/STRU delete mode 100644 source/module_io/test/support/Si.upf delete mode 100644 source/module_io/test/support/WINPUT delete mode 100644 source/module_io/test/support/charge-density.dat delete mode 100644 source/module_io/test/support/dms1_nao.txt delete mode 100644 source/module_io/test/support/dms1k1_nao.txt delete mode 100644 source/module_io/test/support/istate.info delete mode 100644 source/module_io/test/support/kpoints delete mode 100644 source/module_io/test/support/sc.json delete mode 100644 source/module_io/test/support/wfs1_nao.txt delete mode 100644 source/module_io/test/support/wfs1k1_nao.txt delete mode 100644 source/module_io/test/support/wfs1k1_pw.dat delete mode 100644 source/module_io/test/support/wfs1k2_nao.txt delete mode 100644 source/module_io/test/support/wfs1k3_nao.txt delete mode 100644 source/module_io/test/support/wfs1k4_nao.txt delete mode 100644 source/module_io/test/support/wfs2_nao.txt delete mode 100644 source/module_io/test/tmp_mocks.cpp delete mode 100644 source/module_io/test/to_qo_test.cpp delete mode 100644 source/module_io/test/winput_test.cpp delete mode 100644 source/module_io/test/write_dos_pw_test.cpp delete mode 100644 source/module_io/test/write_eig_occ_test.cpp delete mode 100644 source/module_io/test/write_orb_info_test.cpp delete mode 100644 source/module_io/test/write_wfc_nao_para.sh delete mode 100644 source/module_io/test/write_wfc_nao_test.cpp delete mode 100644 source/module_io/test_serial/CMakeLists.txt delete mode 100644 source/module_io/test_serial/io_system_variable_test.cpp delete mode 100644 source/module_io/test_serial/nscf_band_test.cpp delete mode 100644 source/module_io/test_serial/prepare_unitcell.h delete mode 100644 source/module_io/test_serial/read_input_item_test.cpp delete mode 100644 source/module_io/test_serial/read_input_test.cpp delete mode 100644 source/module_io/test_serial/read_input_tool_test.cpp delete mode 100644 source/module_io/test_serial/rho_io_test.cpp delete mode 100644 source/module_io/test_serial/support/chgs1.cube delete mode 100644 source/module_io/to_qo.h delete mode 100644 source/module_io/to_qo_kernel.cpp delete mode 100644 source/module_io/to_qo_mpi.cpp delete mode 100644 source/module_io/to_qo_structures.cpp delete mode 100644 source/module_io/to_wannier90.cpp delete mode 100644 source/module_io/to_wannier90.h delete mode 100644 source/module_io/to_wannier90_lcao.cpp delete mode 100644 source/module_io/to_wannier90_lcao.h delete mode 100644 source/module_io/to_wannier90_lcao_in_pw.cpp delete mode 100644 source/module_io/to_wannier90_lcao_in_pw.h delete mode 100644 source/module_io/to_wannier90_pw.cpp delete mode 100644 source/module_io/to_wannier90_pw.h delete mode 100644 source/module_io/unk_overlap_lcao.cpp delete mode 100644 source/module_io/unk_overlap_lcao.h delete mode 100644 source/module_io/unk_overlap_pw.cpp delete mode 100644 source/module_io/unk_overlap_pw.h delete mode 100644 source/module_io/winput.cpp delete mode 100644 source/module_io/winput.h delete mode 100644 source/module_io/write_HS.h delete mode 100644 source/module_io/write_HS.hpp delete mode 100644 source/module_io/write_HS_R.cpp delete mode 100644 source/module_io/write_HS_R.h delete mode 100644 source/module_io/write_HS_sparse.cpp delete mode 100644 source/module_io/write_HS_sparse.h delete mode 100644 source/module_io/write_cube.cpp delete mode 100644 source/module_io/write_dipole.cpp delete mode 100644 source/module_io/write_dmr.cpp delete mode 100644 source/module_io/write_dmr.h delete mode 100644 source/module_io/write_dos_lcao.cpp delete mode 100644 source/module_io/write_dos_lcao.h delete mode 100644 source/module_io/write_dos_pw.cpp delete mode 100644 source/module_io/write_dos_pw.h delete mode 100644 source/module_io/write_eband_terms.hpp delete mode 100644 source/module_io/write_eig_occ.cpp delete mode 100644 source/module_io/write_eig_occ.h delete mode 100644 source/module_io/write_elecstat_pot.cpp delete mode 100644 source/module_io/write_elecstat_pot.h delete mode 100644 source/module_io/write_elf.cpp delete mode 100644 source/module_io/write_elf.h delete mode 100644 source/module_io/write_libxc_r.cpp delete mode 100644 source/module_io/write_libxc_r.h delete mode 100644 source/module_io/write_mlkedf_descriptors.cpp delete mode 100644 source/module_io/write_mlkedf_descriptors.h delete mode 100644 source/module_io/write_orb_info.cpp delete mode 100644 source/module_io/write_orb_info.h delete mode 100644 source/module_io/write_pao.cpp delete mode 100644 source/module_io/write_pao.h delete mode 100644 source/module_io/write_proj_band_lcao.cpp delete mode 100644 source/module_io/write_proj_band_lcao.h delete mode 100644 source/module_io/write_vxc.hpp delete mode 100644 source/module_io/write_vxc_lip.hpp delete mode 100644 source/module_io/write_vxc_r.hpp delete mode 100644 source/module_io/write_wfc_nao.cpp delete mode 100644 source/module_io/write_wfc_nao.h delete mode 100644 source/module_io/write_wfc_pw.cpp delete mode 100644 source/module_io/write_wfc_pw.h delete mode 100644 source/module_io/write_wfc_r.cpp delete mode 100644 source/module_io/write_wfc_r.h diff --git a/source/module_io/CMakeLists.txt b/source/module_io/CMakeLists.txt deleted file mode 100644 index 33ef23f987..0000000000 --- a/source/module_io/CMakeLists.txt +++ /dev/null @@ -1,137 +0,0 @@ -list(APPEND objects - input_conv.cpp - bessel_basis.cpp - cal_test.cpp - cal_dos.cpp - cal_ldos.cpp - cal_mlkedf_descriptors.cpp - cif_io.cpp - write_dos_pw.cpp - nscf_band.cpp - nscf_fermi_surf.cpp - write_eig_occ.cpp - numerical_basis.cpp - numerical_basis_jyjy.cpp - numerical_descriptor.cpp - output.cpp - print_info.cpp - read_cube.cpp - rhog_io.cpp - read_exit_file.cpp - read_wfc_pw.cpp - read_wf2rho_pw.cpp - restart.cpp - binstream.cpp - write_wfc_pw.cpp - write_pao.cpp - write_cube.cpp - write_elecstat_pot.cpp - write_elf.cpp - write_dipole.cpp - write_mlkedf_descriptors.cpp - td_current_io.cpp - write_wfc_r.cpp - write_libxc_r.cpp - output_log.cpp - para_json.cpp - parse_args.cpp - orb_io.cpp - filename.cpp -) - -list(APPEND objects_advanced - unk_overlap_pw.cpp - berryphase.cpp - to_wannier90.cpp - to_wannier90_pw.cpp - to_wannier90_lcao_in_pw.cpp - to_wannier90_lcao.cpp - fR_overlap.cpp - winput.cpp -) - -if(ENABLE_LCAO) - list(APPEND objects - write_dos_lcao.cpp - cal_pdos_gamma.cpp - cal_pdos_multik.cpp - write_orb_info.cpp - write_proj_band_lcao.cpp - get_pchg_lcao.cpp - get_wf_lcao.cpp - read_wfc_nao.cpp - read_wfc_lcao.cpp - write_wfc_nao.cpp - io_dmk.cpp - write_dmr.cpp - sparse_matrix.cpp - file_reader.cpp - csr_reader.cpp - to_qo_kernel.cpp - to_qo_mpi.cpp - to_qo_structures.cpp - output_sk.cpp - output_dmk.cpp - output_mulliken.cpp - io_npz.cpp - cal_pLpR.cpp - ) - list(APPEND objects_advanced - unk_overlap_lcao.cpp - write_HS_R.cpp - write_HS_sparse.cpp - single_R_io.cpp - cal_r_overlap_R.cpp - output_mat_sparse.cpp - ctrl_output_lcao.cpp - ) -endif() - -add_library( - io_input - OBJECT - read_input_item_system.cpp - read_input_item_elec_stru.cpp - read_input_item_relax.cpp - read_input_item_md.cpp - read_input_item_ofdft.cpp - read_input_item_sdft.cpp - read_input_item_tddft.cpp - read_input_item_deepks.cpp - read_input_item_model.cpp - read_input_item_postprocess.cpp - read_input_item_exx_dftu.cpp - read_input_item_other.cpp - read_input_item_output.cpp - read_input.cpp - read_set_globalv.cpp -) - -add_library( - io_basic - OBJECT - ${objects} -) - -add_library( - io_advanced - OBJECT - ${objects_advanced} -) - -if(ENABLE_COVERAGE) - add_coverage(io_basic) -endif() - -if(BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - add_subdirectory(test_serial) - endif() -endif() - -if(ENABLE_RAPIDJSON) - if(ENABLE_MPI) - add_subdirectory(json_output) - endif() -endif() diff --git a/source/module_io/berryphase.cpp b/source/module_io/berryphase.cpp deleted file mode 100644 index e943143468..0000000000 --- a/source/module_io/berryphase.cpp +++ /dev/null @@ -1,691 +0,0 @@ -#include "berryphase.h" - -#include "module_parameter/parameter.h" -#include "source_cell/klist.h" -#include "source_pw/hamilt_pwdft/global.h" - -bool berryphase::berry_phase_flag = false; - -berryphase::berryphase() -{ - GDIR = PARAM.inp.gdir; -} - -#ifdef __LCAO -berryphase::berryphase(const Parallel_Orbitals* paraV_in) : paraV(paraV_in) -{ - GDIR = PARAM.inp.gdir; -} -#endif - -berryphase::~berryphase() -{ -} - -void berryphase::get_occupation_bands() -{ - double occupied_bands = static_cast(PARAM.inp.nelec / ModuleBase::DEGSPIN); - if ((occupied_bands - std::floor(occupied_bands)) > 0.0) - { - occupied_bands = std::floor(occupied_bands) + 1.0; - } - - occ_nbands = (int)occupied_bands; - if (occ_nbands > PARAM.inp.nbands) - { - ModuleBase::WARNING_QUIT("berryphase::get_occupation_bands", - "not enough bands for berryphase, increase band numbers."); - } -} - -#ifdef __LCAO -void berryphase::lcao_init(const UnitCell& ucell, - const Grid_Driver& gd, - const K_Vectors& kv, - const Grid_Technique& grid_tech, - const LCAO_Orbitals& orb) -{ - ModuleBase::TITLE("berryphase", "lcao_init"); - lcao_method.init(ucell,grid_tech, kv.get_nkstot(), orb); - lcao_method.cal_R_number(ucell, gd); - lcao_method.cal_orb_overlap(ucell); - return; -} -#endif - -// this routine depends on kpoint's mp method -void berryphase::set_kpoints(const K_Vectors& kv, const int direction) -{ - ModuleBase::TITLE("berryphase", "set_kpoints"); - - const int mp_x = kv.nmp[0]; // no. of kpoints along x - const int mp_y = kv.nmp[1]; // no. of kpoints along y - const int mp_z = kv.nmp[2]; // no. of kpoints along z - const int num_k = int(kv.get_nkstot() / 2); - - if (direction == 1) // x direction calculation - { - const int num_string = mp_y * mp_z; - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - total_string = num_string; - k_index.resize(total_string); - } - else if (PARAM.inp.nspin == 2) - { - total_string = 2 * num_string; - k_index.resize(total_string); - } - - for (int istring = 0; istring < total_string; istring++) - { - k_index[istring].resize(mp_x + 1); // adding 1 means every string from k=0 to k=G - } - - int string_index = -1; - for (int iz = 0; iz < mp_z; iz++) - { - for (int iy = 0; iy < mp_y; iy++) - { - string_index++; - for (int ix = 0; ix < mp_x; ix++) - { - k_index[string_index][ix] = ix + iy * mp_x + iz * mp_x * mp_y; - if (ix == (mp_x - 1)) { - k_index[string_index][ix + 1] - = k_index[string_index][0]; - } - } - } - } - - if (PARAM.inp.nspin == 2) - { - for (int istring = num_string; istring < total_string; istring++) - { - for (int count = 0; count < mp_x + 1; count++) - { - k_index[istring][count] = k_index[istring - num_string][count] + num_k; - } - } - } - - nppstr = mp_x + 1; - } - else if (direction == 2) // 讔算y方向 - { - const int num_string = mp_x * mp_z; - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - total_string = num_string; - k_index.resize(total_string); - } - else if (PARAM.inp.nspin == 2) - { - total_string = 2 * num_string; - k_index.resize(total_string); - } - - for (int istring = 0; istring < total_string; istring++) - { - k_index[istring].resize(mp_y + 1); // adding 1 means every string from k=0 to k=G - } - - int string_index = -1; - for (int iz = 0; iz < mp_z; iz++) - { - for (int ix = 0; ix < mp_x; ix++) - { - string_index++; - for (int iy = 0; iy < mp_y; iy++) - { - k_index[string_index][iy] = ix + iy * mp_x + iz * mp_x * mp_y; - if (iy == (mp_y - 1)) { - k_index[string_index][iy + 1] - = k_index[string_index][0]; - } - } - } - } - - if (PARAM.inp.nspin == 2) - { - for (int istring = num_string; istring < total_string; istring++) - { - for (int count = 0; count < mp_y + 1; count++) - { - k_index[istring][count] = k_index[istring - num_string][count] + num_k; - } - } - } - - nppstr = mp_y + 1; - } - else if (direction == 3) // 讔算z方向 - { - const int num_string = mp_x * mp_y; - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - total_string = num_string; - k_index.resize(total_string); - } - else if (PARAM.inp.nspin == 2) - { - total_string = 2 * num_string; - k_index.resize(total_string); - } - - for (int istring = 0; istring < total_string; istring++) - { - k_index[istring].resize(mp_z + 1); // adding 1 means every string from k=0 to k=G - } - - int string_index = -1; - for (int iy = 0; iy < mp_y; iy++) - { - for (int ix = 0; ix < mp_x; ix++) - { - string_index++; - for (int iz = 0; iz < mp_z; iz++) - { - k_index[string_index][iz] = ix + iy * mp_x + iz * mp_x * mp_y; - if (iz == (mp_z - 1)) { - k_index[string_index][iz + 1] - = k_index[string_index][0]; - } - } - } - } - - if (PARAM.inp.nspin == 2) - { - for (int istring = num_string; istring < total_string; istring++) - { - for (int count = 0; count < mp_z + 1; count++) - { - k_index[istring][count] = k_index[istring - num_string][count] + num_k; - } - } - } - - nppstr = mp_z + 1; - } -} - -#include "../source_base/complexmatrix.h" -double berryphase::stringPhase(const UnitCell& ucell, - int index_str, - int nbands, - const int npwx, - const psi::Psi>* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv) -{ - std::complex zeta(1.0, 0.0); - ModuleBase::ComplexMatrix mat(nbands, nbands); - int ik_1 = 0; - int ik_2 = 0; - ModuleBase::Vector3 G(0.0, 0.0, 0.0); - ModuleBase::Vector3 dk = kv.kvec_c[k_index[index_str][1]] - kv.kvec_c[k_index[index_str][0]]; - - for (int k_start = 0; k_start < (nppstr - 1); k_start++) - { - ik_1 = k_index[index_str][k_start]; - ik_2 = k_index[index_str][k_start + 1]; - - if (PARAM.inp.basis_type == "pw") - { - for (int mb = 0; mb < nbands; mb++) - { - - for (int nb = 0; nb < nbands; nb++) - { - - if (PARAM.inp.nspin != 4) - { - if (k_start == (nppstr - 2)) - { - if (direction == 1) - { - ModuleBase::Vector3 tem_G(1.0, 0.0, 0.0); - G = tem_G; - } - if (direction == 2) - { - ModuleBase::Vector3 tem_G(0.0, 1.0, 0.0); - G = tem_G; - } - if (direction == 3) - { - ModuleBase::Vector3 tem_G(0.0, 0.0, 1.0); - G = tem_G; - } - - mat(nb, mb) = pw_method.unkdotp_G0(rhopw, wfcpw, ik_1, ik_2, nb, mb, psi_in, G); - } - else - { - mat(nb, mb) = pw_method.unkdotp_G(wfcpw, ik_1, ik_2, nb, mb, psi_in); - } - } - else - { - if (k_start == (nppstr - 2)) - { - if (direction == 1) - { - ModuleBase::Vector3 tem_G(1.0, 0.0, 0.0); - G = tem_G; - } - if (direction == 2) - { - ModuleBase::Vector3 tem_G(0.0, 1.0, 0.0); - G = tem_G; - } - if (direction == 3) - { - ModuleBase::Vector3 tem_G(0.0, 0.0, 1.0); - G = tem_G; - } - - mat(nb, mb) = pw_method.unkdotp_soc_G0(rhopw, wfcpw, ik_1, ik_2, nb, mb, psi_in, G); - } else { - mat(nb, mb) = pw_method.unkdotp_soc_G(wfcpw, - ik_1, - ik_2, - nb, - mb, - npwx, - psi_in); - } - } - - } // nb - - } // mb - - std::complex det(1.0, 0.0); - int info = 0; - std::vector ipiv(nbands); - LapackConnector::zgetrf(nbands, nbands, mat, nbands, ipiv.data(), &info); - for (int ib = 0; ib < nbands; ib++) - { - if (ipiv[ib] != (ib + 1)) { - det = -det * mat(ib, ib); - } else { - det = det * mat(ib, ib); - } - } - - zeta = zeta * det; - - // delete[] ipiv; - } -#ifdef __LCAO - else if (PARAM.inp.basis_type == "lcao") - { - if (PARAM.inp.nspin != 4) - { - zeta = zeta * lcao_method.det_berryphase(ucell,ik_1, ik_2, dk, nbands, *(this->paraV), psi_in, kv); - } - else - { - } - } -#endif - } - - return log(zeta).imag(); -} - -void berryphase::Berry_Phase(const UnitCell& ucell, - int nbands, - double& pdl_elec_tot, - int& mod_elec_tot, - const int npwx, - const psi::Psi>* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv) -{ - std::complex cave = 0.0; - - std::vector phik(total_string); - double phik_ave = 0.0; - std::vector> cphik(total_string); - std::vector wistring(total_string); - - // electron polarization - - // get weight of every std::string - for (int istring = 0; istring < total_string; istring++) - { - wistring[istring] = 1.0 / total_string; - if (PARAM.inp.nspin == 2) { - wistring[istring] = wistring[istring] * 2; - } - } - - for (int istring = 0; istring < total_string; istring++) - { - phik[istring] = stringPhase(ucell,istring, nbands, npwx, psi_in, rhopw, wfcpw, kv); - // transfer phase to complex number - cphik[istring] = std::complex(cos(phik[istring]), sin(phik[istring])); - cave = cave + std::complex(wistring[istring], 0.0) * cphik[istring]; - } - - double theta0 = atan2(cave.imag(), cave.real()); - double dtheta = 0.0; - for (int istring = 0; istring < total_string; istring++) - { - cphik[istring] = cphik[istring] / cave; - dtheta = atan2(cphik[istring].imag(), cphik[istring].real()); - phik[istring] = (theta0 + dtheta) / (2 * ModuleBase::PI); - phik_ave = phik_ave + wistring[istring] * phik[istring]; - } - - if (PARAM.inp.nspin == 1) - { - pdl_elec_tot = 2 * phik_ave; - } - else if (PARAM.inp.nspin == 2 || PARAM.inp.nspin == 4) - { - pdl_elec_tot = phik_ave; - } - - if (PARAM.inp.nspin == 1) // remap to [-1,1] - { - pdl_elec_tot = pdl_elec_tot - 2.0 * round(pdl_elec_tot / 2.0); - mod_elec_tot = 2; - } - else if (PARAM.inp.nspin == 2 || PARAM.inp.nspin == 4) // remap to [-0.5,0.5] - { - pdl_elec_tot = pdl_elec_tot - 1.0 * round(pdl_elec_tot / 1.0); - mod_elec_tot = 1; - } - -} - -void berryphase::Macroscopic_polarization(const UnitCell& ucell, - const int npwx, - const psi::Psi>* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv) -{ - get_occupation_bands(); - - GlobalV::ofs_running << "\n\n\n\n"; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | POLARIZATION CALCULATION: |" << std::endl; - GlobalV::ofs_running << " | Modern Theory of Polarization |" << std::endl; - GlobalV::ofs_running << " | calculate the Macroscopic polarization of a crystalline insulator |" << std::endl; - GlobalV::ofs_running << " | by using Berry Phase method. |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - GlobalV::ofs_running << "\n\n\n\n"; - - // ion polarization - double polarization_ion[3]; // means three lattice vector directions R1,R2,R3 - ModuleBase::GlobalFunc::ZEROS(polarization_ion, 3); - // reciprocal lattice - ModuleBase::Vector3 rcell_1(ucell.G.e11, ucell.G.e12, ucell.G.e13); - ModuleBase::Vector3 rcell_2(ucell.G.e21, ucell.G.e22, ucell.G.e23); - ModuleBase::Vector3 rcell_3(ucell.G.e31, ucell.G.e32, ucell.G.e33); - // int *mod_ion = new int[ucell.nat]; - std::vector mod_ion(ucell.nat); - // double *pdl_ion_R1 = new double[ucell.nat]; - std::vector pdl_ion_R1(ucell.nat); - // double *pdl_ion_R2 = new double[ucell.nat]; - std::vector pdl_ion_R2(ucell.nat); - // double *pdl_ion_R3 = new double[ucell.nat]; - std::vector pdl_ion_R3(ucell.nat); - ModuleBase::GlobalFunc::ZEROS(mod_ion.data(), ucell.nat); - ModuleBase::GlobalFunc::ZEROS(pdl_ion_R1.data(), ucell.nat); - ModuleBase::GlobalFunc::ZEROS(pdl_ion_R2.data(), ucell.nat); - ModuleBase::GlobalFunc::ZEROS(pdl_ion_R3.data(), ucell.nat); - - bool lodd = false; - int atom_index = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - // should consider fractional electron number - if (int(ucell.atoms[it].ncpp.zv) % 2 == 1) - { - mod_ion[atom_index] = 1; - lodd = true; - atom_index++; - } - else - { - mod_ion[atom_index] = 2; - atom_index++; - } - } - } - - atom_index = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - pdl_ion_R1[atom_index] = ucell.atoms[it].ncpp.zv * (ucell.atoms[it].tau[ia] * rcell_1); - pdl_ion_R2[atom_index] = ucell.atoms[it].ncpp.zv * (ucell.atoms[it].tau[ia] * rcell_2); - pdl_ion_R3[atom_index] = ucell.atoms[it].ncpp.zv * (ucell.atoms[it].tau[ia] * rcell_3); - atom_index++; - } - } - - for (int i = 0; i < ucell.nat; i++) - { - if (mod_ion[i] == 1) - { - pdl_ion_R1[i] = pdl_ion_R1[i] - 1.0 * round(pdl_ion_R1[i] / 1.0); - pdl_ion_R2[i] = pdl_ion_R2[i] - 1.0 * round(pdl_ion_R2[i] / 1.0); - pdl_ion_R3[i] = pdl_ion_R3[i] - 1.0 * round(pdl_ion_R3[i] / 1.0); - } - else if (mod_ion[i] == 2) - { - pdl_ion_R1[i] = pdl_ion_R1[i] - 2.0 * round(pdl_ion_R1[i] / 2.0); - pdl_ion_R2[i] = pdl_ion_R2[i] - 2.0 * round(pdl_ion_R2[i] / 2.0); - pdl_ion_R3[i] = pdl_ion_R3[i] - 2.0 * round(pdl_ion_R3[i] / 2.0); - } - - polarization_ion[0] = polarization_ion[0] + pdl_ion_R1[i]; - polarization_ion[1] = polarization_ion[1] + pdl_ion_R2[i]; - polarization_ion[2] = polarization_ion[2] + pdl_ion_R3[i]; - } - if (lodd) - { - polarization_ion[0] = polarization_ion[0] - 1.0 * round(polarization_ion[0] / 1.0); - polarization_ion[1] = polarization_ion[1] - 1.0 * round(polarization_ion[1] / 1.0); - polarization_ion[2] = polarization_ion[2] - 1.0 * round(polarization_ion[2] / 1.0); - } - else - { - polarization_ion[0] = polarization_ion[0] - 2.0 * round(polarization_ion[0] / 2.0); - polarization_ion[1] = polarization_ion[1] - 2.0 * round(polarization_ion[1] / 2.0); - polarization_ion[2] = polarization_ion[2] - 2.0 * round(polarization_ion[2] / 2.0); - } - - // ion polarization end - - // calculate Macroscopic polarization modulus because berry phase - int modulus = 0; - if ((!lodd) && (PARAM.inp.nspin == 1)) - { - modulus = 2; - } else { - modulus = 1; - } - - // test by jingan - // GlobalV::ofs_running << "ion polarization end" << std::endl; - // test by jingan - - // berry phase calculate begin - switch (GDIR) - { - case 1: { - direction = 1; - set_kpoints(kv, direction); - double pdl_elec_tot = 0.0; - int mod_elec_tot = 0; - Berry_Phase(ucell,occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv); - - const double rmod = ucell.a1.norm() * ucell.lat0; - const double unit1 = rmod; - const double unit2 = rmod / ucell.omega; - const double unit3 = (rmod / ucell.omega) * (1.60097e-19 / pow(5.29177e-11, 2)); - - GlobalV::ofs_running << " VALUES OF POLARIZATION" << std::endl; - GlobalV::ofs_running << std::endl; - GlobalV::ofs_running << " The Ionic Phase: " << std::setw(10) << std::fixed << std::setprecision(5) - << polarization_ion[0] << std::endl; - GlobalV::ofs_running << " Electronic Phase: " << std::setw(10) << std::fixed << std::setprecision(5) - << pdl_elec_tot << std::endl; - // GlobalV::ofs_running << " the electronic part polarization is P(ele) = " << rmod * pdl_elec_tot << " - // (e/Omega).bohr in R1 direction" << std::endl; - - // calculate total polarization,add electron part and ions part - double total_polarization = pdl_elec_tot + polarization_ion[0]; - - ModuleBase::Vector3 polarization_xyz = ucell.a1; - polarization_xyz.normalize(); - polarization_xyz = total_polarization * polarization_xyz; - - GlobalV::ofs_running << "\n" - << "The calculated polarization direction is in R1 direction" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit1 * total_polarization, unit1 * modulus, unit1 * polarization_xyz) - << "(e/Omega).bohr" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit2 * total_polarization, unit2 * modulus, unit2 * polarization_xyz) - << "e/bohr^2" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit3 * total_polarization, unit3 * modulus, unit3 * polarization_xyz) - << "C/m^2" << std::endl; - GlobalV::ofs_running << std::endl; - - break; - } - case 2: { - direction = 2; - set_kpoints(kv, direction); - double pdl_elec_tot = 0.0; - int mod_elec_tot = 0; - Berry_Phase(ucell,occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv); - - const double rmod = ucell.a2.norm() * ucell.lat0; - const double unit1 = rmod; - const double unit2 = rmod / ucell.omega; - const double unit3 = (rmod / ucell.omega) * (1.60097e-19 / pow(5.29177e-11, 2)); - - GlobalV::ofs_running << " VALUES OF POLARIZATION" << std::endl; - GlobalV::ofs_running << std::endl; - GlobalV::ofs_running << " The Ionic Phase: " << std::setw(10) << std::fixed << std::setprecision(5) - << polarization_ion[1] << std::endl; - GlobalV::ofs_running << " Electronic Phase: " << std::setw(10) << std::fixed << std::setprecision(5) - << pdl_elec_tot << std::endl; - // GlobalV::ofs_running << " the electronic part polarization is P(ele) = " << rmod * pdl_elec_tot << " - // (e/Omega).bohr in R2 direction" << std::endl; - - // calculate total polarization,add electron part and ions part - double total_polarization = pdl_elec_tot + polarization_ion[1]; - - ModuleBase::Vector3 polarization_xyz = ucell.a2; - polarization_xyz.normalize(); - polarization_xyz = total_polarization * polarization_xyz; - - GlobalV::ofs_running << "\n" - << "The calculated polarization direction is in R2 direction" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit1 * total_polarization, unit1 * modulus, unit1 * polarization_xyz) - << "(e/Omega).bohr" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit2 * total_polarization, unit2 * modulus, unit2 * polarization_xyz) - << "e/bohr^2" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit3 * total_polarization, unit3 * modulus, unit3 * polarization_xyz) - << "C/m^2" << std::endl; - GlobalV::ofs_running << std::endl; - - break; - } - case 3: { - direction = 3; - set_kpoints(kv, direction); - double pdl_elec_tot = 0.0; - int mod_elec_tot = 0; - Berry_Phase(ucell,occ_nbands, pdl_elec_tot, mod_elec_tot, npwx, psi_in, rhopw, wfcpw, kv); - - const double rmod = ucell.a3.norm() * ucell.lat0; - const double unit1 = rmod; - const double unit2 = rmod / ucell.omega; - const double unit3 = (rmod / ucell.omega) * (1.60097e-19 / pow(5.29177e-11, 2)); - - GlobalV::ofs_running << " VALUES OF POLARIZATION" << std::endl; - GlobalV::ofs_running << std::endl; - GlobalV::ofs_running << " The Ionic Phase: " << std::setw(10) << std::fixed << std::setprecision(5) - << polarization_ion[2] << std::endl; - GlobalV::ofs_running << " Electronic Phase: " << std::setw(10) << std::fixed << std::setprecision(5) - << pdl_elec_tot << std::endl; - // GlobalV::ofs_running << " the electronic part polarization is P(ele) = " << rmod * pdl_elec_tot << " - // (e/Omega).bohr in R3 direction" << std::endl; - - // calculate total polarization,add electron part and ions part - double total_polarization = pdl_elec_tot + polarization_ion[2]; - - ModuleBase::Vector3 polarization_xyz = ucell.a3; - polarization_xyz.normalize(); - polarization_xyz = total_polarization * polarization_xyz; - - GlobalV::ofs_running << "\n" - << "The calculated polarization direction is in R3 direction" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit1 * total_polarization, unit1 * modulus, unit1 * polarization_xyz) - << "(e/Omega).bohr" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit2 * total_polarization, unit2 * modulus, unit2 * polarization_xyz) - << "e/bohr^2" << std::endl; - GlobalV::ofs_running << "\n" - << " P = " - << outFormat(unit3 * total_polarization, unit3 * modulus, unit3 * polarization_xyz) - << "C/m^2" << std::endl; - GlobalV::ofs_running << std::endl; - - break; - } - } - - return; -} - -std::string berryphase::outFormat(const double polarization, - const double modulus, - const ModuleBase::Vector3 project) -{ - std::stringstream outStr; - outStr << std::setw(12) << std::fixed << std::setprecision(7) << polarization << " (mod "; - outStr << std::setw(12) << std::fixed << std::setprecision(7) << modulus << ") ("; - outStr << std::setw(12) << std::fixed << std::setprecision(7) << project.x << ","; - outStr << std::setw(12) << std::fixed << std::setprecision(7) << project.y << ","; - outStr << std::setw(12) << std::fixed << std::setprecision(7) << project.z << ") "; - - return outStr.str(); -} diff --git a/source/module_io/berryphase.h b/source/module_io/berryphase.h deleted file mode 100644 index d4befd298d..0000000000 --- a/source/module_io/berryphase.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef MODULE_IO_BERRYPHASE_H -#define MODULE_IO_BERRYPHASE_H -#include "unk_overlap_pw.h" -#ifdef __LCAO -#include "unk_overlap_lcao.h" -#endif -//#include "source_basis/module_pw/pw_basis.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/klist.h" -#include "source_psi/psi.h" -#include "source_basis/module_ao/parallel_orbitals.h" - -class berryphase -{ - - public: - berryphase(); // for pw-line -#ifdef __LCAO - berryphase(const Parallel_Orbitals* paraV_in); // for lcao-line -#endif - ~berryphase(); - - // mohan add 2021-02-16 - static bool berry_phase_flag; - unkOverlap_pw pw_method; -#ifdef __LCAO - unkOverlap_lcao lcao_method; - const Parallel_Orbitals* paraV; -#endif - - int total_string=0; - std::vector> k_index; - int nppstr=0; - int direction=0; - int occ_nbands=0; - int GDIR; - - void get_occupation_bands(); -#ifdef __LCAO - void lcao_init(const UnitCell& ucell, - const Grid_Driver& gd, - const K_Vectors& kv, - const Grid_Technique& grid_tech, - const LCAO_Orbitals& orb); -#endif - void set_kpoints(const K_Vectors& kv, const int direction); - - double stringPhase(const UnitCell& ucell, - int index_str, - int nbands, - const int npwx, - const psi::Psi>* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv); - - void Berry_Phase(const UnitCell& ucell, - int nbands, - double& pdl_elec_tot, - int& mod_elec_tot, - const int npwx, - const psi::Psi>* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv); - - void Macroscopic_polarization(const UnitCell& ucell, - const int npwx, - const psi::Psi* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv) - { - throw std::logic_error("berry phase supports only multi-k"); - }; - void Macroscopic_polarization(const UnitCell& ucell, - const int npwx, - const psi::Psi>* psi_in, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const K_Vectors& kv); - - std::string outFormat(const double polarization, const double modulus, const ModuleBase::Vector3 project); -}; - -#endif diff --git a/source/module_io/bessel_basis.cpp b/source/module_io/bessel_basis.cpp deleted file mode 100644 index 76bf3c324b..0000000000 --- a/source/module_io/bessel_basis.cpp +++ /dev/null @@ -1,487 +0,0 @@ -#include "bessel_basis.h" - -#include "module_parameter/parameter.h" -#include "source_base/math_integral.h" -#include "source_base/math_sphbes.h" -#include "source_base/parallel_common.h" -#include "source_base/timer.h" -#include "source_pw/hamilt_pwdft/global.h" -#include - -Bessel_Basis::Bessel_Basis() -{ - Ecut_number = 0; - Dk = 0.0; -} - -Bessel_Basis::~Bessel_Basis() -{ -} - - -// the function is called in numerical_basis. -void Bessel_Basis::init( - const bool start_from_file, - const double &ecutwfc, - const int &ntype, - const int &lmax_in, - const bool &smooth, - const double &sigma, - const double &rcut_in, - const double &tol_in, - const UnitCell& ucell, - const double &dk, - const double &dr - ) -{ - ModuleBase::TITLE("Bessel_Basis", "init"); - this->Dk = dk; - this->ecut = ecutwfc; - this->rcut = rcut_in; - this->tolerence = tol_in; - this->smooth = smooth; - this->sigma = sigma; - - //---------------------------------------------- - // setup Ecut_number - // ne * pi / rcut = sqrt(ecut) (Rydberg) - //---------------------------------------------- - // this->Ecut_number = static_cast( sqrt( 2.0 * ecut )* rcut/ModuleBase::PI );// hartree - this->Ecut_number = static_cast(sqrt(ecut) * rcut / ModuleBase::PI); // Rydberg Unit. - assert(this->Ecut_number > 0); - - //------------------ - // Making a table - //------------------ - - this->init_TableOne( smooth, sigma, ecutwfc, rcut, dr, Dk, lmax_in, Ecut_number, tolerence); - -//----------------------------------------------- -// for test. -//----------------------------------------------- -// GlobalV::ofs_running << "\n TableOne:"; -// for(int i=0; iallocate_C4(ntype, lmax_in, ucell.nmax, Ecut_number, ucell); - // check tolerence - this->readin_C4("INPUTs", ntype, ecut, rcut, Ecut_number, tolerence, ucell); -#ifdef __MPI - Parallel_Common::bcast_double( C4.ptr, C4.getSize() ); -#endif - this->init_Faln(ntype, lmax_in, ucell.nmax, Ecut_number, ucell); - } - - return; -} - -double Bessel_Basis::Polynomial_Interpolation2 - (const int &l, const int &ie, const double &gnorm)const -{ - const double position = gnorm / this->Dk; - const int iq = static_cast(position); - /* - if(iq >= kmesh-4) - { - std::cout << "\n iq = " << iq; - std::cout << "\n kmesh = " << kmesh; - ModuleBase::QUIT(); - } - */ - assert(iq < kmesh-4); - const double x0 = position - static_cast(iq); - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double y= - this->TableOne(l, ie, iq) * x1 * x2 * x3 / 6.0 + - this->TableOne(l, ie, iq+1) * x0 * x2 * x3 / 2.0 - - this->TableOne(l, ie, iq+2) * x1 * x0 * x3 / 2.0 + - this->TableOne(l, ie, iq+3) * x1 * x2 * x0 / 6.0 ; - return y; -} - -double Bessel_Basis::Polynomial_Interpolation( - const int &it, const int &l, const int &ic, const double &gnorm)const -{ - const double position = gnorm / this->Dk; - const int iq = static_cast(position); - assert(iq < kmesh-4); - const double x0 = position - static_cast(iq); - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double y= - this->Faln(it, l, ic, iq) * x1 * x2 * x3 / 6.0 + - this->Faln(it, l, ic, iq+1) * x0 * x2 * x3 / 2.0 - - this->Faln(it, l, ic, iq+2) * x1 * x0 * x3 / 2.0 + - this->Faln(it, l, ic, iq+3) * x1 * x2 * x0 / 6.0 ; - return y; -} - -void Bessel_Basis::init_Faln( - const int &ntype, - const int &lmax, - const int &nmax, - const int &ecut_number, - const UnitCell& ucell) -{ - ModuleBase::TITLE("Bessel_Basis","init_Faln"); - ModuleBase::timer::tick("Spillage","init_Faln"); - assert( this->kmesh > 0); - - this->Faln.create(ntype, lmax+1, nmax, this->kmesh); - - this->nwfc = 0; - for(int it=0; itkmesh; ik++) - { - this->Faln(it, il, in, ik) += this->C4(it, il, in, ie) * this->TableOne(il, ie, ik); - } - } - nwfc+=2*il+1; - } - } - } - ModuleBase::GlobalFunc::OUT("nwfc = ",nwfc); - - ModuleBase::timer::tick("Spillage","init_Faln"); - return; -} - -// be called in Bessel_Basis::init() -void Bessel_Basis::init_TableOne( - const bool smooth_in, // mohan add 2009-08-28 - const double &sigma_in, // mohan add 2009-08-28 - const double &ecutwfc, - const double &rcut, - const double &dr, - const double &dk, - const int &lmax, - const int &ecut_number, - const double &tolerence) -{ - ModuleBase::TITLE("Bessel_Basis","init_TableOne"); - ModuleBase::timer::tick("Spillage","TableONe"); - // check - assert(ecutwfc > 0.0); - assert(dr > 0.0); - assert(dk > 0.0); - - // init kmesh - this->kmesh = static_cast(sqrt(ecutwfc) / dk) +1 + 4; - if (kmesh % 2 == 0)++kmesh; - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "kmesh",kmesh); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "dk",dk); - - // init Table One - this->TableOne.create(lmax+1, ecut_number, kmesh); - - // init rmesh - int rmesh = static_cast( rcut / dr ) + 4; - if (rmesh % 2 == 0) ++rmesh; - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "rmesh",rmesh); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "dr",dr); - - // allocate rmesh and Jlk and eigenvalue of Jlq - // double *r = new double[rmesh]; - // double *rab = new double[rmesh]; - // double *jle = new double[rmesh]; - // double *jlk = new double[rmesh]; - // double *g = new double[rmesh]; // smooth function - // double *function = new double[rmesh]; - // double *en = new double[ecut_number]; - std::vector r(rmesh); - std::vector rab(rmesh); - std::vector jle(rmesh); - std::vector jlk(rmesh); - std::vector g(rmesh); - std::vector function(rmesh); - std::vector en(ecut_number); - - for(int ir=0; ir(ir) * dr; - rab[ir] = dr; - if(smooth_in) - { - g[ir] = 1.0 - std::exp(-( (r[ir]-rcut)*(r[ir]-rcut)/2.0/sigma_in/sigma_in ) ); - } - } - - //caoyu add 2021-3-10 - //=========output .orb format============= - std::stringstream ss; - ss << PARAM.globalv.global_out_dir << "jle.orb"; - std::ofstream ofs(ss.str().c_str()); - ofs << "---------------------------------------------------------------------------"<< std::endl; - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Energy Cutoff(Ry)" << ecut << std::endl; - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Radius Cutoff(a.u.)" << rcut << std::endl; - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Lmax" << lmax << std::endl; - for (int l = 0; l < lmax + 1; l++) - { - switch (l) - { - case 0: - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Number of Sorbitals-->" << ecut_number << std::endl; - break; - case 1: - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Number of Porbitals-->" << ecut_number << std::endl; - break; - case 2: - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Number of Dorbitals-->" << ecut_number << std::endl; - break; - case 3: - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Number of Forbitals-->" << ecut_number << std::endl; - break; - default: - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Number of Gorbitals-->" << ecut_number << std::endl; - } - } - ofs << "---------------------------------------------------------------------------"<< std::endl; - ofs << "SUMMARY END" << std::endl << std::endl; - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "Mesh" << rmesh << std::endl; - ofs << std::setiosflags(std::ios::left) << std::setw(28) << "dr" << dr << std::endl ; - //=========output .orb format============= - - // init eigenvalue of Jl - for(int l=0; lTableOne(l, ie, ik) ); - } - - }// end ie - }// end ; - - if (ofs) - { - ofs.close(); //caoyu add 2020-3-10 - } - - // delete[] en; - // delete[] jle; - // delete[] jlk; - // delete[] rab; - // delete[] g; - // delete[] r; - // delete[] function; - ModuleBase::timer::tick("Spillage","TableONe"); - return; -} - -void Bessel_Basis::readin_C4( - const std::string &name, - const int &ntype, - const int &ecut, - const int &rcut, - const int &ecut_number, - const double &tolerence, - const UnitCell& ucell) -{ - ModuleBase::TITLE("Bessel_Basis","readin_C4"); - - if(GlobalV::MY_RANK != 0) return; - - std::ifstream ifs( name.c_str() ); - - if(!ifs) - { - GlobalV::ofs_warning << " File name : " << name << std::endl; - std::string fn = "Cannot find C4 file: " + name; - ModuleBase::WARNING_QUIT("Bessel_Basis::readin_C4",fn); - } - - if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "")) - { - // mohan modify 2009-11-29 - for (int it = 0; it < ntype; it++) - { - std::string filec4; - ifs >> filec4; - for(int il=0; il< ucell.atoms[it].nwl+1; il++) - { - for(int in=0; in< ucell.atoms[it].l_nchi[il]; in++) - { - //for tests - //std::cout << "\n" << std::setw(5) << it << std::setw(5) << il << std::setw(5) << in; - //std::cout << "\n file=" << filec4; - std::ifstream inc4( filec4.c_str() ); - - if(!inc4) - { - GlobalV::ofs_warning << " File name : " << filec4 << std::endl; - ModuleBase::WARNING_QUIT("Bessel_Basis::readin_C4","Can not find file."); - } - - if(ModuleBase::GlobalFunc::SCAN_BEGIN(inc4, "")) - { - double tmp_ecut; - double tmp_rcut; - double tmp_enumber; - double tmp_tolerence; - ModuleBase::GlobalFunc::READ_VALUE( inc4, tmp_ecut); - ModuleBase::GlobalFunc::READ_VALUE( inc4, tmp_rcut); - ModuleBase::GlobalFunc::READ_VALUE( inc4, tmp_enumber); - ModuleBase::GlobalFunc::READ_VALUE( inc4, tmp_tolerence); - assert( tmp_ecut == this->ecut ); - assert( tmp_rcut == this->rcut ); - assert( tmp_enumber == this->Ecut_number); - assert( tmp_tolerence == this->tolerence ); - } - - bool find = false; - if(ModuleBase::GlobalFunc::SCAN_BEGIN(inc4, "")) - { - int total_nchi = 0; - ModuleBase::GlobalFunc::READ_VALUE(inc4, total_nchi); - - for(int ichi=0; ichi> title1 >> title2 >> title3; - - int tmp_type=0, tmp_l=0, tmp_n=0; - inc4 >> tmp_type >> tmp_l >> tmp_n; - //std::cout << "\n Find T=" << tmp_type << " L=" << tmp_l << " N=" << tmp_n; - - if(tmp_l == il && tmp_n == in) - //if(tmp_type == it && tmp_l == il && tmp_n == in) // mohan modify 2009-11-29 - { - find = true; - for(int ie=0; ie> this->C4(it, il, in, ie); - // for tests - //std::cout << "\n" << std::setw(5) << ie << std::setw(25) << this->C4(it, il, in, ie); - } - } - else - { - double no_use_c4 = 0.0; - for(int ie=0; ie> no_use_c4; - } - } - if(find) break; - } - } - if(!find) - { - std::cout << "\n T=" << it << " L=" << il << " N=" << in; - ModuleBase::WARNING_QUIT("Bessel_Basis::readin_C4","Can't find needed c4!"); - } - inc4.close(); - } - } - } - ModuleBase::GlobalFunc::SCAN_END(ifs, ""); - } - ifs.close(); - return; -} - -void Bessel_Basis::allocate_C4( - const int &ntype, - const int &lmax, - const int &nmax, - const int &ecut_number, - const UnitCell& ucell) -{ - ModuleBase::TITLE("Bessel_Basis","allocate_C4"); - - this->C4.create(ntype, lmax+1, nmax, ecut_number); - - for(int it=0; itC4(it, il, in, ie) = 1.0; - } - } - } - } - return; -} diff --git a/source/module_io/bessel_basis.h b/source/module_io/bessel_basis.h deleted file mode 100644 index 41a701d7a8..0000000000 --- a/source/module_io/bessel_basis.h +++ /dev/null @@ -1,190 +0,0 @@ -//========================================================== -// AUTHOR : mohan -// DATE : 2009-3-29 -// Last Modify : 2021-01-04 -//========================================================== -#ifndef BESSEL_BASIS_H -#define BESSEL_BASIS_H -#include "../source_base/global_function.h" -#include "../source_base/global_variable.h" -#include "../source_base/realarray.h" - -#include "../source_cell/unitcell.h" - -//========================================================== -// CLASS : -// NAME : Bessel_Basis -//========================================================== -class Bessel_Basis -{ -public: - Bessel_Basis(); - ~Bessel_Basis(); - - /// @brief Initialization of Bessel function related matrices. - /// @details Used for a specific group of C4 coefficients. 2021-01-04, mohan added a new input parameter lmax_in, if we only generate numerical atomic orbitals based on spherical Bessel functions, lmax_in = ucell.lmax. However, if we want to generate Spherical Bessel functions (SBF) for descriptor, then the lmax_in is controlled by user. - /// @note This function is called in module_io/numerical_basis.cpp and module_io/numerical_descriptor.cpp - /// @param start_from_file whether read C4 coefficients stored in external files - /// @param ecutwfc cutoff for numerical atomic orbitals - /// @param ntype atom types - /// @param lmax_in maximal angular momentum for numerical orbitals - /// @param smooth whether smooth SBFs when perform integration to calculate value of matrix element of TableOne. For details, see J. Phys.: Condens. Matter 22 (2010) 445501 - /// @param sigma stddev of Gaussian function for smoothing SBFs - /// @param rcut_in cutoff radius for SBFs - /// @param tol_in accurancy control for SBFs - /// @param dk kspace grid - /// @param dr realspace grid - /// @param ucell UnitCell class object, ucell.nmax will be used in this function - void init( - const bool start_from_file, - const double &ecutwfc, - const int &ntype, - const int &lmax_in, - const bool &smooth, - const double &sigma, - const double &rcut_in, - const double &tol_in, - const UnitCell& ucell, - const double &dk = 0.01, - const double &dr = 0.01 - ); - /// @brief return number of SBFs used for one `chi` (see details for more information) - /// @details atomic orbital is constructed always with not only one set of SBFs. For different sets, they are marked with different `chi`(s), similar with concept of contracted GTOs. For one `chi`, it is 'q' the summation index, and q is in SBFs like: j_l(q*r), where l is the order of SBF. - /// @return number of SBFs - const int& get_ecut_number() const { return Ecut_number;} - - /// @brief Cubic spline interpolation for matrix Faln - /// @param it atom type index - /// @param l angular momentum - /// @param ic chi index - /// @param gnorm norm of G+k vector - /// @return interpolated value - double Polynomial_Interpolation(const int &it, const int &l, const int &ic, const double &gnorm)const; - /// @brief Cubic spline interpolation for matrix TableOne - /// @param l angular momentum - /// @param ie q index (see explanation in note of function BesselBasis::get_ecut_number()) - /// @param gnorm norm of G+k vector - /// @return interpolated value - double Polynomial_Interpolation2(const int &l, const int &ie, const double &gnorm)const; - - - /// @brief get energy cutoff, which is used to truncate SBF Jlq. - /// @param - /// @return energy cutoff in Ry - const double &get_ecut() const {return ecut;} - /// @brief cutoff radius of radial SBF Jlq. - /// @param - /// @return cutoff radius in a.u. - const double &get_rcut() const {return rcut;} - - const double &get_tolerence() const {return tolerence;} - - - /// @brief check if SBFs are smoothed (mohan add 2009-08-28) - /// @attention in this case, the Jlq are not the true Jlq. - /// @param - /// @return boolean whether SBFs are smoothed - const bool &get_smooth() const {return smooth;} - /// @brief get sigma the stddev (standard deviation) used in smooth function (Gaussian function) - /// @param - /// @return stddev of smooth function - const double &get_sigma() const {return sigma;} - -private: - /// @brief the most important array to calculate spillage, has dimension (ntype, lmax+1, max_n, nk) - ModuleBase::realArray Faln; - - /// @brief Coefficients to be optimized! - ModuleBase::realArray C4; - - /// @brief matrix whose elements are int{dr r^2 j_l(qr)*j_l(kr)}, has dimension (lmax+1, nq, nk) - ModuleBase::realArray TableOne; - - /// @brief mesh of k vector, k is in j_l(k*r) - int kmesh=0; - /// @brief grid of k - double Dk; - /// @brief number of q vector, q is in j_l(q*r) - int Ecut_number; - /// @brief Cutoff radius (in a.u.) of SBFs, for any SBF j_l(qr), r>=rcut, j_l(q*r) = 0 (if not smoothed) - double rcut=0.0; - /// @brief energy cutoff for determining kmesh and number of SBFs - double ecut=0.0; - double tolerence=0.0; - /// @brief whether smooth SBFs around cutoff radius, resulting in non-zero values. For importance of smooth of SBFs, see J. Phys.: Condens. Matter 22 (2010) 445501, eqn 6. (mohan add 2009-01-18) - bool smooth=false; - /// @brief stddev of smooth function (Gaussian function, centered at rcut) - double sigma=0.0; - - /// @brief Allocate memory for C4 matrix and initialize all elements to one. - /// @param ntype number of atom types - /// @param lmax maximal angular momentum of localized orbitals - /// @param nmax maximal principal quantum number of localized orbitals - /// @param ecut_number number of SBFs - void allocate_C4( - const int &ntype, - const int &lmax, - const int &nmax, - const int &ecut_number, - const UnitCell& ucell - ); - - /// @brief Read C4 from external file. Presently an O(N^2) search algorithm is used. A HTML parser is needed in the future to improve performance. - /// @param name name of external file where C4-stored file information is contained - /// @param ntype number of atom types - /// @param ecut energy cutoff - /// @param rcut cutoff radius - /// @param ecut_number number of SBFs - /// @param tolerence accurancy of SBFs, here only used for consistency check - void readin_C4( - const std::string &name, - const int &ntype, - const int &ecut, - const int &rcut, - const int &ecut_number, - const double &tolerence, - const UnitCell& ucell - ); - - void init_TableOne(); - - /// @brief calculate F_{aln}(it, il, in, ik) = sum_{ie}{C4(it, il, in, ie)*TableOne(il, ie, ik)}, where TableOne is overlap integral between two spherical bessel functions (jle(r) and jlk(r)) - /// @param ntype number of atomtype - /// @param lmax maximal angular momentum - /// @param nmax maximal chi - /// @param ecut_number number of SBFs - void init_Faln( - const int &ntype, - const int &lmax, - const int &nmax, - const int &ecut_number, - const UnitCell& ucell - ); - - /// @brief number of localized wave functions - int nwfc=0; - - /// @brief calculate element value of TableOne matrix - /// @details (be called in Bessel_Basis::init(), used for outputing overlap Q matrix) initialize the table whose matrix element is the result of integral int{dr r^2 jle(r)*jlk(r)}, TableOne has three subscript (l, ie, ik), the first runs over orbitals' angular momentum and ie, ik run over ecut_number and kmesh SBFs - /// @param smooth_in whether jle(r) SBF is smoothed by a Gaussian function - /// @param sigma_in stddev for controlling smearing of Gaussian function for smoothing jle(r) - /// @param ecutwfc planewave kinetic energy cutoff for controlling kspace sampling - /// @param rcut cutoff radius of SBFs - /// @param dr realspace grid - /// @param dk kspace grid - /// @param lmax maximal angular momentum for SBFs - /// @param ecut_number number of SBFs - /// @param tolerence accurancy of SBFs - void init_TableOne( - const bool smooth_in, - const double &sigma_in, - const double &ecut, - const double &rcut, - const double &dr, - const double &dk, - const int &lmax, - const int &ecut_number, - const double &tolerence); -}; - -#endif diff --git a/source/module_io/binstream.cpp b/source/module_io/binstream.cpp deleted file mode 100644 index 64a936aa22..0000000000 --- a/source/module_io/binstream.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include "binstream.h" - -/** - * @brief Construct a new Binstream:: Binstream object - * - * @param filename - * @param op "r": read - * "a": add - * "w": write - */ -Binstream::Binstream(const std::string filename,const char *op) -{ - fileptr=fopen(filename.c_str(),op); -} - -Binstream::~Binstream() -{ - if(fileptr != NULL) fclose(fileptr); -} - -// close file -void Binstream:: close() -{ - fclose(fileptr); - fileptr = NULL; - return; -} - -// open a file -void Binstream::open(const std::string filename,const char *op) -{ - fileptr=fopen(filename.c_str(),op); -} - -// ! operator -// we can use if(!Binstream) ... -bool Binstream::operator!() const -{ - if (fileptr==NULL) - return true; - else - return false; -} - -// bool operator -// we can use if(Binstream) ... -Binstream::operator bool() const -{ - if (fileptr==NULL) - return false; - else - return true; -} diff --git a/source/module_io/binstream.h b/source/module_io/binstream.h deleted file mode 100644 index ef5cd62a87..0000000000 --- a/source/module_io/binstream.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef RWSTREAM_H -#define RWSTREAM_H - -#include -#include -#include -#include - - -/** - * @brief A stream to read or write binary data. - * @author qianrui 2020-1-6 - */ -class Binstream -{ - public: - Binstream(){ - fileptr=NULL; //we should use NULL (not nullptr) here because FILE use NULL. - }; - Binstream(const std::string,const char*); - ~Binstream(); - FILE* fileptr; - void close(); - void open(const std::string,const char*); - bool operator!() const; - operator bool() const; - - template - Binstream& operator>>( T& data); - - template - Binstream& operator<<(const T& data); - - template - Binstream& read(T* data,const int n); - - template - Binstream& write(const T* data,const int n); - -}; - -// read a data from file -template -Binstream& Binstream:: operator>>(T& data) -{ - const int size=sizeof(T); - size_t ch = fread(&data,size,1,this->fileptr); - if(ch<1) - { - std::cout<<"Error in Binstream: Some data didn't be read."< -Binstream& Binstream:: operator<<(const T& data) -{ - const int size=sizeof(T); - fwrite(&data,size,1,this->fileptr); - return *this; -} - -//read an array of data -template -Binstream& Binstream::read(T* data, const int n) -{ - const int size=sizeof(T); - size_t ch = fread(data,size,n,this->fileptr); - if(ch -Binstream& Binstream::write(const T* data, const int n) -{ - const int size=sizeof(T); - fwrite(data,size,n,this->fileptr); - return *this; -} - - - -/*//for dynamic memory -//malloc_usable_size has problem! -template -Binstream& operator<<(Binstream& wstream,T* &data) -{ - int size=sizeof(T); - int n=malloc_usable_size(data)/sizeof(T); - fwrite(data,size,n,wstream.fileptr); - return wstream; -} - - -//for dynamic memory -template -Binstream& operator>>(Binstream& rstream,T* &data) -{ - int size=sizeof(T); - int n=malloc_usable_size(data)/sizeof(T); - std::cout<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " | #Calcualte Density of States (DOS)# |" << std::endl; - ofs_running << " | DOS stands for Density of States. It represents the number of |" << std::endl; - ofs_running << " | available electronic states per unit energy range. |" << std::endl; - ofs_running << " | By analyzing the DOS, we can gain insights into how electrons are |" << std::endl; - ofs_running << " | distributed among different energy levels within the material. |" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - ofs_running << std::setprecision(6); - - assert(nbands>0); - - if (PARAM.globalv.two_fermi == false) - { - ModuleBase::GlobalFunc::OUT(ofs_running, "Fermi energy (eV)", - energy_fermi.ef * ModuleBase::Ry_to_eV); - } - else - { - ModuleBase::GlobalFunc::OUT(ofs_running, "Spin up, Fermi energy (Ry)", - energy_fermi.ef_up * ModuleBase::Ry_to_eV); - ModuleBase::GlobalFunc::OUT(ofs_running, "Spin dw, Fermi energy (Ry)", - energy_fermi.ef_dw * ModuleBase::Ry_to_eV); - } - - // find energy range - emax = ekb(0, 0); - emin = ekb(0, 0); - for (int ik = 0; ik < nks; ++ik) - { - for (int ib = 0; ib < nbands; ++ib) - { - emax = std::max(emax, ekb(ik, ib)); - emin = std::min(emin, ekb(ik, ib)); - } - } - -#ifdef __MPI - Parallel_Reduce::gather_max_double_all(GlobalV::NPROC, emax); - Parallel_Reduce::gather_min_double_all(GlobalV::NPROC, emin); -#endif - - emax *= ModuleBase::Ry_to_eV; - emin *= ModuleBase::Ry_to_eV; - - if (PARAM.globalv.dos_setemax) - { - emax = PARAM.inp.dos_emax_ev; - } - if (PARAM.globalv.dos_setemin) - { - emin = PARAM.inp.dos_emin_ev; - } - - if (!PARAM.globalv.dos_setemax && !PARAM.globalv.dos_setemin) - { - // scale up a little bit so the end peaks are displaced better - double delta = (emax - emin) * dos_scale; - emax = emax + delta / 2.0; - emin = emin - delta / 2.0; - } - - assert(dos_edelta_ev>0.0); - - ModuleBase::GlobalFunc::OUT(ofs_running, "Minimal energy (eV)", emin); - ModuleBase::GlobalFunc::OUT(ofs_running, "Maximal energy (eV)", emax); - ModuleBase::GlobalFunc::OUT(ofs_running, "Energy interval (eV)", dos_edelta_ev); - -} - -bool ModuleIO::cal_dos(const int& is, // index for spin - const std::string& fn, // file name for DOS - const double& de_ev, // delta energy in ev - const double& emax_ev, // maximal energy in eV - const double& emin_ev, // minimal energy in ev. - const double& bcoeff, - const int& nks, // number of k points in this pool - const int& nkstot, // number of total kpoints - const std::vector& wk, // weight of k points - const std::vector& isk, // index of spin for each k-point - const int& nbands, // number of bands - const ModuleBase::matrix& ekb, // energy for each k point and each band - const ModuleBase::matrix& wg // weight of k-points and bands - ) -{ - ModuleBase::TITLE("ModuleIO", "cal_dos"); - - std::ofstream ofs_dos; - std::ofstream ofs_smear; - - if (GlobalV::MY_RANK == 0) - { - ofs_dos.open(fn.c_str()); - } - - std::vector dos; - std::vector ene; - std::vector sum_elec; - std::vector dos_smear; // dos_smearing - dos.clear(); - ene.clear(); - sum_elec.clear(); - dos_smear.clear(); - -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - if (de_ev <= 0) - { - ModuleBase::WARNING("ModuleIO::cal_dos", "de <= 0 "); - return false; - } - else if (emax_ev < emin_ev) - { - ModuleBase::WARNING("ModuleIO::cal_dos", "emax_ev < emin_ev"); - return false; - } - - const int npoints = static_cast(std::floor((emax_ev - emin_ev) / de_ev))+1; - - if (npoints <= 0) - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "npoints", npoints); - ModuleBase::WARNING("ModuleIO::cal_dos", "npoints <= 0"); - return false; - } - if (GlobalV::MY_RANK == 0) - { - ofs_dos << npoints << " # number of points" << std::endl; - ofs_dos << "#" << std::setw(14) << "energy" - << std::setw(15) << "elec_states" - << std::setw(15) << "sum_states" - << std::setw(15) << "states_smear" - << std::setw(15) << "sum_states" << std::endl; - } - - std::vector e_mod(npoints, 0.0); - - double sum = 0.0; - double curr_energy = emin_ev; - double e_old = 0.0; - - while (curr_energy < emax_ev) - { - double nstates = 0.0; - e_old = curr_energy; - curr_energy += de_ev; - - // nks is the number of k-points in the 'pool' - for (int ik = 0; ik < nks; ik++) - { - // spin index - if (is == isk[ik]) - { - // band index - for (int ib = 0; ib < nbands; ib++) - { - // compare et and e_old(curr_energy) in ev unit. - if (ekb(ik, ib) * ModuleBase::Ry_to_eV >= e_old - && ekb(ik, ib) * ModuleBase::Ry_to_eV < curr_energy) - { - nstates += wk[ik] * nkstot; - } - } - } - } - -#ifdef __MPI - const int npool = GlobalV::KPAR * PARAM.inp.bndpar; - Parallel_Reduce::reduce_double_allpool(npool, GlobalV::NPROC_IN_POOL, nstates); -#endif - - nstates = nstates / static_cast(nkstot); - sum += nstates; - if (GlobalV::MY_RANK == 0) - { - dos.push_back(nstates); - ene.push_back(curr_energy); - sum_elec.push_back(sum); - } - } - - // Use Gaussian smearing to smooth the DOS - if (GlobalV::MY_RANK == 0) - { - dos_smear.resize(dos.size()); - - double b = sqrt(2.0) * bcoeff; - for (int i = 0; i < dos.size() ; i++) - { - double Gauss = 0.0; - - for (int j = 0; j < dos.size(); j++) - { - double denergy = ene[j] - ene[i]; - double de2 = denergy * denergy; - Gauss = exp(-de2 / b / b) / sqrt(ModuleBase::PI) / b; - dos_smear[j] += dos[i] * Gauss; - } - } - - // mohan add 2025-06-08 - const double dos_thr = 1.0e-12; - double sum2 = 0.0; - - for (int i = 0; i < dos.size(); i++) - { - if(dos_smear[i] -#include "source_base/matrix.h" -#include "source_estate/fp_energy.h" - -namespace ModuleIO -{ - - 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); - - bool cal_dos(const int &is, - const std::string &fn,// file address for DOS. - const double &de_ev, // delta energy in ev. - const double &emax_ev,// maximal energy in ev. - const double &emin_ev,// minimal energy in ev. - const double &bcoeff, - const int &nks,//number of k points - const int &nkstot, - const std::vector &wk,//weight of k points - const std::vector &isk, - const int &nbands,// number of bands - const ModuleBase::matrix &ekb, //store energy for each k point and each band - const ModuleBase::matrix &wg); //weight of (kpoint,bands)) - - -} - -#endif diff --git a/source/module_io/cal_ldos.cpp b/source/module_io/cal_ldos.cpp deleted file mode 100644 index 31133cfa81..0000000000 --- a/source/module_io/cal_ldos.cpp +++ /dev/null @@ -1,368 +0,0 @@ -#include "cal_ldos.h" - -#include "cal_dos.h" -#include "cube_io.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_interface.h" - -#include - -namespace ModuleIO -{ - -#ifdef __LCAO -template -void Cal_ldos::cal_ldos_lcao(const elecstate::ElecStateLCAO* pelec, - const psi::Psi& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell) -{ - for (int ie = 0; ie < PARAM.inp.stm_bias[2]; ie++) - { - // energy range for ldos (efermi as reference) - const double en = PARAM.inp.stm_bias[0] + ie * PARAM.inp.stm_bias[1]; - const double emin = en < 0 ? en : 0; - const double emax = en > 0 ? en : 0; - - // calculate weight (for bands not in the range, weight is zero) - ModuleBase::matrix weight(pelec->ekb.nr, pelec->ekb.nc); - for (int ik = 0; ik < pelec->ekb.nr; ++ik) - { - const double efermi = pelec->eferm.get_efval(pelec->klist->isk[ik]); - - for (int ib = 0; ib < pelec->ekb.nc; ib++) - { - const double eigenval = (pelec->ekb(ik, ib) - efermi) * ModuleBase::Ry_to_eV; - if (eigenval >= emin && eigenval <= emax) - { - weight(ik, ib) = en > 0 ? pelec->klist->wk[ik] - pelec->wg(ik, ib) : pelec->wg(ik, ib); - } - } - } - - // calculate dm-like for ldos - const int nspin_dm = PARAM.inp.nspin == 2 ? 2 : 1; - elecstate::DensityMatrix dm_ldos(pelec->DM->get_paraV_pointer(), - nspin_dm, - pelec->klist->kvec_d, - pelec->klist->get_nks() / nspin_dm); - - elecstate::cal_dm_psi(pelec->DM->get_paraV_pointer(), weight, psi, dm_ldos); - dm_ldos.init_DMR(*(pelec->DM->get_DMR_pointer(1))); - dm_ldos.cal_DMR(); - - // allocate ldos space - std::vector ldos_space(PARAM.inp.nspin * pelec->charge->nrxx); - double** ldos = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) - { - ldos[is] = &ldos_space[is * pelec->charge->nrxx]; - } - - // calculate ldos -#ifdef __OLD_GINT - ModuleBase::WARNING_QUIT("Cal_ldos::dm2ldos", - "do not support old grid integral, please recompile with __NEW_GINT"); -#else - ModuleGint::cal_gint_rho(dm_ldos.get_DMR_vector(), PARAM.inp.nspin, ldos); -#endif - - // I'm not sure whether ldos should be output for each spin or not - // ldos[0] += ldos[1] for nspin_dm == 2 - if (nspin_dm == 2) - { - BlasConnector::axpy(pelec->charge->nrxx, 1.0, ldos[1], 1, ldos[0], 1); - } - - // write ldos to cube file - std::stringstream fn; - fn << PARAM.globalv.global_out_dir << "LDOS_" << en << "eV" - << ".cube"; - - const int precision = PARAM.inp.out_ldos[1]; - ModuleIO::write_vdata_palgrid(pgrid, - ldos_space.data(), - 0, - PARAM.inp.nspin, - 0, - fn.str(), - 0, - &ucell, - precision, - 0); - - // free memory - delete[] ldos; - } -} - -#endif - -template class Cal_ldos; // Gamma_only case -template class Cal_ldos>; // multi-k case - -// pw case -void cal_ldos_pw(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell) -{ - if (PARAM.inp.out_ldos[0] == 1 || PARAM.inp.out_ldos[0] == 3) - { - ModuleIO::stm_mode_pw(pelec, psi, pgrid, ucell); - } - if (PARAM.inp.out_ldos[0] == 2 || PARAM.inp.out_ldos[0] == 3) - { - ModuleIO::ldos_mode_pw(pelec, psi, pgrid, ucell); - } -} - -void stm_mode_pw(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell) -{ - for (int ie = 0; ie < PARAM.inp.stm_bias[2]; ie++) - { - // energy range for ldos (efermi as reference) - const double en = PARAM.inp.stm_bias[0] + ie * PARAM.inp.stm_bias[1]; - const double emin = en < 0 ? en : 0; - const double emax = en > 0 ? en : 0; - - std::vector ldos(pelec->charge->nrxx); - std::vector> wfcr(pelec->basis->nrxx); - - for (int ik = 0; ik < pelec->klist->get_nks(); ++ik) - { - psi.fix_k(ik); - const double efermi = pelec->eferm.get_efval(pelec->klist->isk[ik]); - const int nbands = psi.get_nbands(); - - for (int ib = 0; ib < nbands; ib++) - { - pelec->basis->recip2real(&psi(ib, 0), wfcr.data(), ik); - - const double eigenval = (pelec->ekb(ik, ib) - efermi) * ModuleBase::Ry_to_eV; - double weight = en > 0 ? pelec->klist->wk[ik] - pelec->wg(ik, ib) : pelec->wg(ik, ib); - weight /= ucell.omega; - - if (eigenval >= emin && eigenval <= emax) - { - for (int ir = 0; ir < pelec->basis->nrxx; ir++) - { - ldos[ir] += weight * norm(wfcr[ir]); - } - } - } - } - - std::stringstream fn; - fn << PARAM.globalv.global_out_dir << "LDOS_" << en << "eV" - << ".cube"; - - const int precision = PARAM.inp.out_ldos[1]; - ModuleIO::write_vdata_palgrid(pgrid, ldos.data(), 0, PARAM.inp.nspin, 0, fn.str(), 0, &ucell, precision, 0); - } -} - -void ldos_mode_pw(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell) -{ - double emax = 0.0; - double emin = 0.0; - - prepare_dos(GlobalV::ofs_running, - pelec->eferm, - pelec->ekb, - pelec->klist->get_nks(), - PARAM.inp.nbands, - PARAM.inp.dos_edelta_ev, - PARAM.inp.dos_scale, - emax, - emin); - - const int ndata = static_cast((emax - emin) / PARAM.inp.dos_edelta_ev) + 1; - const double sigma = sqrt(2.0) * PARAM.inp.dos_sigma; - const double sigma2 = sigma * sigma; - const double sigma_PI = sqrt(ModuleBase::PI) * sigma; - - std::vector start = {PARAM.inp.ldos_line[0], PARAM.inp.ldos_line[1], PARAM.inp.ldos_line[2]}; - std::vector end = {PARAM.inp.ldos_line[3], PARAM.inp.ldos_line[4], PARAM.inp.ldos_line[5]}; - const int npoints = PARAM.inp.ldos_line[6]; - - // calculate grid points - std::vector> points(npoints, std::vector(3, 0)); - std::vector> shifts(npoints, std::vector(3, 0)); - get_grid_points(start, end, npoints, pgrid.nx, pgrid.ny, pgrid.nz, points, shifts); - - std::vector> ldos(npoints, std::vector(ndata, 0)); - - // calculate ldos - std::vector tmp(pelec->charge->nrxx); - std::vector> wfcr(pelec->basis->nrxx); - for (int ik = 0; ik < pelec->klist->get_nks(); ++ik) - { - psi.fix_k(ik); - const double efermi = pelec->eferm.get_efval(pelec->klist->isk[ik]); - const int nbands = psi.get_nbands(); - - for (int ib = 0; ib < nbands; ib++) - { - pelec->basis->recip2real(&psi(ib, 0), wfcr.data(), ik); - const double weight = pelec->klist->wk[ik] / ucell.omega; - - for (int ir = 0; ir < pelec->basis->nrxx; ir++) - { - tmp[ir] += weight * norm(wfcr[ir]); - } - - std::vector results(npoints, 0); - trilinear_interpolate(points, shifts, pgrid, tmp, results); - - const double eigenval = pelec->ekb(ik, ib) * ModuleBase::Ry_to_eV; - - for (int ie = 0; ie < ndata; ++ie) - { - const double en = emin + ie * PARAM.inp.dos_edelta_ev; - const double de = en - eigenval; - const double de2 = de * de; - const double gauss = exp(-de2 / sigma2) / sigma_PI; - for (int ip = 0; ip < npoints; ++ip) - { - ldos[ip][ie] += results[ip] * gauss; - } - } - } - } - - std::ofstream ofs_ldos; - std::stringstream fn; - fn << PARAM.globalv.global_out_dir << "LDOS.txt"; - if (GlobalV::MY_RANK == 0) - { - ofs_ldos.open(fn.str().c_str()); - - for (int ip = 0; ip < npoints; ++ip) - { - for (int ie = 0; ie < ndata; ++ie) - { - ofs_ldos << ldos[ip][ie] << " "; - } - ofs_ldos << std::endl; - } - ofs_ldos.close(); - } -} - -void get_grid_points(const std::vector& start, - const std::vector& end, - const int& npoints, - const int& nx, - const int& ny, - const int& nz, - std::vector>& points, - std::vector>& shifts) -{ - std::vector ndim = {nx, ny, nz}; - auto grid_points = [](const std::vector& coor, - const std::vector& ndim, - std::vector& points, - std::vector& shift) { - for (int i = 0; i < 3; i++) - { - shift[i] = coor[i] * ndim[i]; - while (shift[i] >= ndim[i]) - { - shift[i] -= ndim[i]; - } - while (shift[i] < 0) - { - shift[i] += ndim[i]; - } - points[i] = static_cast(shift[i]); - shift[i] -= points[i]; - } - }; - - if (npoints == 1) - { - grid_points(start, ndim, points[0], shifts[0]); - } - else - { - std::vector delta = {end[0] - start[0], end[1] - start[1], end[2] - start[2]}; - for (int i = 0; i < npoints; i++) - { - const double ratio = static_cast(i) / (npoints - 1); - std::vector current = {0, 0, 0}; - for (int j = 0; j < 3; j++) - { - current[j] = start[j] + ratio * delta[j]; - } - grid_points(current, ndim, points[i], shifts[i]); - } - } -} - -void trilinear_interpolate(const std::vector>& points, - const std::vector>& shifts, - const Parallel_Grid& pgrid, - const std::vector& data, - std::vector& results) -{ - const int nx = pgrid.nx; - const int ny = pgrid.ny; - const int nz = pgrid.nz; - const int nyz = ny * nz; - const int nxyz = nx * ny * nz; - - // reduce - std::vector data_full(nxyz); -#ifdef __MPI - if (GlobalV::MY_POOL == 0 && GlobalV::MY_BNDGROUP == 0) - { - pgrid.reduce(data_full.data(), data.data(), false); - } - MPI_Barrier(MPI_COMM_WORLD); -#else - std::memcpy(data_full.data(), data.data(), nxyz * sizeof(double)); -#endif - - auto grid_points = [&data_full, &nyz, &nz](const int& ix, const int& iy, const int& iz) { - return data_full[ix * nyz + iy * nz + iz]; - }; - - // trilinear interpolation - const int npoints = points.size(); - results.resize(npoints, 0.0); - if (GlobalV::MY_RANK == 0) - { - for (int l = 0; l < npoints; ++l) - { - for (int i = 0; i < 2; ++i) - { - double weight = (i * shifts[l][0] + (1 - i) * (1 - shifts[l][0])); - for (int j = 0; j < 2; ++j) - { - weight *= (j * shifts[l][1] + (1 - j) * (1 - shifts[l][1])); - for (int k = 0; k < 2; ++k) - { - weight *= (k * shifts[l][2] + (1 - k) * (1 - shifts[l][2])); - - const int ix = points[l][0] + i; - const int iy = points[l][1] + j; - const int iz = points[l][2] + k; - results[l] += weight * grid_points(ix, iy, iz); - } - } - } - } - } -#ifdef __MPI - MPI_Bcast(results.data(), npoints, MPI_DOUBLE, 0, MPI_COMM_WORLD); -#endif -} - -} // namespace ModuleIO diff --git a/source/module_io/cal_ldos.h b/source/module_io/cal_ldos.h deleted file mode 100644 index a18ac0f1d0..0000000000 --- a/source/module_io/cal_ldos.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef CAL_LDOS_H -#define CAL_LDOS_H - -#include "source_estate/elecstate_lcao.h" -#include "source_estate/elecstate_pw.h" - -namespace ModuleIO -{ -template -class Cal_ldos -{ - public: - Cal_ldos(){}; - ~Cal_ldos(){}; - - static void cal_ldos_lcao(const elecstate::ElecStateLCAO* pelec, - const psi::Psi& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell); -}; // namespace Cal_ldos - -void cal_ldos_pw(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell); - -void stm_mode_pw(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell); - -void ldos_mode_pw(const elecstate::ElecStatePW>* pelec, - const psi::Psi>& psi, - const Parallel_Grid& pgrid, - const UnitCell& ucell); - -/* - * @brief Get grid points and shifts for interpolation. - * - * @param start The starting point of the line. - * @param end The ending point of the line. - * @param npoints The number of points in the line. - * @param nx The dimension of 3D grids in the x direction. - * @param ny The dimension of 3D grids in the y direction. - * @param nz The dimension of 3D grids in the z direction. - * @param points The grid index that the points in the line are placed in. - * @param shifts The shifts along three directions due to the points are not on the grid exactly. - */ -void get_grid_points(const std::vector& start, - const std::vector& end, - const int& npoints, - const int& nx, - const int& ny, - const int& nz, - std::vector>& points, - std::vector>& shifts); - -/* - * @brief Trilinear interpolation of data on a 3D grid. - * - * @param points The grid points for interpolation. - * @param shifts The shifts for interpolation. - * @param pgrid The parallel grid object. - * @param data The data to be interpolated. - * @param results The results of the interpolation. - */ -void trilinear_interpolate(const std::vector>& points, - const std::vector>& shifts, - const Parallel_Grid& pgrid, - const std::vector& data, - std::vector& results); - -} // namespace ModuleIO - -#endif // CAL_LDOS_H \ No newline at end of file diff --git a/source/module_io/cal_mlkedf_descriptors.cpp b/source/module_io/cal_mlkedf_descriptors.cpp deleted file mode 100644 index c85ab651be..0000000000 --- a/source/module_io/cal_mlkedf_descriptors.cpp +++ /dev/null @@ -1,520 +0,0 @@ -#include "cal_mlkedf_descriptors.h" - -namespace ModuleIO -{ - -void Cal_MLKEDF_Descriptors::set_para( - const int &nx, - const double &nelec, - const double &tf_weight, - const double &vw_weight, - const double &chi_p, - const double &chi_q, - const std::vector &chi_xi, - const std::vector &chi_pnl, - const std::vector &chi_qnl, - const int &nkernel, - const std::vector &kernel_type, - const std::vector &kernel_scaling, - const std::vector &yukawa_alpha, - const std::vector &kernel_file, - const double &omega, - ModulePW::PW_Basis *pw_rho -) -{ - this->nx = nx; - this->nkernel = nkernel; - this->chi_p = chi_p; - this->chi_q = chi_q; - this->chi_xi = chi_xi; - this->chi_pnl = chi_pnl; - this->chi_qnl = chi_qnl; - - this->kernel_type = kernel_type; - this->kernel_scaling = kernel_scaling; - this->yukawa_alpha = yukawa_alpha; - this->kernel_file = kernel_file; - std::cout << "nkernel = " << nkernel << std::endl; - - if (PARAM.inp.of_wt_rho0 != 0) - { - this->rho0 = PARAM.inp.of_wt_rho0; - } - else - { - this->rho0 = 1./omega * nelec; - } - - this->kF = std::pow(3. * std::pow(ModuleBase::PI, 2) * this->rho0, 1./3.); - this->tkF = 2. * this->kF; - - this->kernel = std::vector>(this->nkernel); - for (int ik = 0; ik < this->nkernel; ++ik) - { - // delete[] this->kernel[ik]; - this->kernel[ik] = std::vector(pw_rho->npw, 0.0); - if (this->kernel_type[ik] == 3 || this->kernel_type[ik] == 4) // 3 for TKK Al, and 4 for TKK Si - { - this->read_kernel(this->kernel_file[ik], this->kernel_scaling[ik], pw_rho, this->kernel[ik].data()); - } - else - { - double eta = 0.; - for (int ip = 0; ip < pw_rho->npw; ++ip) - { - eta = sqrt(pw_rho->gg[ip]) * pw_rho->tpiba / this->tkF * this->kernel_scaling[ik]; - if (this->kernel_type[ik] == 1) - { - this->kernel[ik][ip] = this->MLkernel(eta, tf_weight, vw_weight); - } - else if (this->kernel_type[ik] == 2) - { - this->kernel[ik][ip] = this->MLkernel_yukawa(eta, this->yukawa_alpha[ik]); - } - } - } - } -} - -double Cal_MLKEDF_Descriptors::MLkernel(double eta, double tf_weight, double vw_weight) -{ - if (eta < 0.) - { - return 0.; - } - // limit for small eta - else if (eta < 1e-10) - { - return 1. - tf_weight + eta * eta * (1./3. - 3. * vw_weight); - } - // around the singularity - else if (std::abs(eta - 1.) < 1e-10) - { - return 2. - tf_weight - 3. * vw_weight + 20. * (eta - 1); - } - // Taylor expansion for high eta - else if (eta > 3.65) - { - double eta2 = eta * eta; - double invEta2 = 1. / eta2; - double LindG = 3. * (1. - vw_weight) * eta2 - -tf_weight-0.6 - + invEta2 * (-0.13714285714285712 - + invEta2 * (-6.39999999999999875E-2 - + invEta2 * (-3.77825602968460128E-2 - + invEta2 * (-2.51824061652633074E-2 - + invEta2 * (-1.80879839616166146E-2 - + invEta2 * (-1.36715733124818332E-2 - + invEta2 * (-1.07236045520990083E-2 - + invEta2 * (-8.65192783339199453E-3 - + invEta2 * (-7.1372762502456763E-3 - + invEta2 * (-5.9945117538835746E-3 - + invEta2 * (-5.10997527675418131E-3 - + invEta2 * (-4.41060829979912465E-3 - + invEta2 * (-3.84763737842981233E-3 - + invEta2 * (-3.38745061493813488E-3 - + invEta2 * (-3.00624946457977689E-3))))))))))))))); - return LindG; - } - else - { - return 1. / (0.5 + 0.25 * (1. - eta * eta) / eta * std::log((1 + eta)/std::abs(1 - eta))) - - 3. * vw_weight * eta * eta - tf_weight; - } -} - -double Cal_MLKEDF_Descriptors::MLkernel_yukawa(double eta, double alpha) -{ - return (eta == 0 && alpha == 0) ? 0. : M_PI / (eta * eta + alpha * alpha / 4.); -} - -// Read kernel from file -void Cal_MLKEDF_Descriptors::read_kernel(const std::string &fileName, const double& scaling, ModulePW::PW_Basis *pw_rho, double* kernel_) -{ - std::ifstream ifs(fileName.c_str(), std::ios::in); - - GlobalV::ofs_running << "Read WT kernel from " << fileName << std::endl; - if (!ifs) ModuleBase::WARNING_QUIT("cal_mlkedf_descriptors.cpp", "The kernel file not found"); - - int kineType = 0; - double kF_in = 0.; - double rho0_in = 0.; - int nq_in = 0; - double maxEta_in = 0.; - - ifs >> kineType; - ifs >> kF_in; - ifs >> rho0_in; - ifs >> nq_in; - - double *eta_in = new double[nq_in]; - double *w0_in = new double[nq_in]; - - for (int iq = 0; iq < nq_in; ++iq) - { - ifs >> eta_in[iq] >> w0_in[iq]; - } - - maxEta_in = eta_in[nq_in-1]; - - double eta = 0.; - double maxEta = 0.; - int ind1 = 0; - int ind2 = 0; - int ind_mid = 0; - double fac1 = 0.; - double fac2 = 0.; - for (int ig = 0; ig < pw_rho->npw; ++ig) - { - eta = sqrt(pw_rho->gg[ig]) * pw_rho->tpiba / this->tkF; - eta = eta * scaling; - maxEta = std::max(eta, maxEta); - - if (eta <= eta_in[0]) - kernel_[ig] = w0_in[0]; - else if (eta > maxEta_in) - kernel_[ig] = w0_in[nq_in-1]; - else - { - ind1 = 1; - ind2 = nq_in; - while (ind1 < ind2 - 1) - { - ind_mid = (ind1 + ind2)/2; - if (eta > eta_in[ind_mid]) - { - ind1 = ind_mid; - } - else - { - ind2 = ind_mid; - } - } - fac1 = (eta_in[ind2] - eta)/(eta_in[ind2] - eta_in[ind1]); - fac2 = (eta - eta_in[ind1])/(eta_in[ind2] - eta_in[ind1]); - kernel_[ig] = fac1 * w0_in[ind1] + fac2 * w0_in[ind2]; - } - } - - if (maxEta > maxEta_in) ModuleBase::WARNING("cal_mlkedf_descriptors.cpp", "Please increase the maximal eta value in KEDF kernel file"); - - delete[] eta_in; - delete[] w0_in; - ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "FILL WT KERNEL"); -} - -void Cal_MLKEDF_Descriptors::multiKernel(const int ikernel, double *pinput, ModulePW::PW_Basis *pw_rho, double *routput) -{ - std::complex *recipOutput = new std::complex[pw_rho->npw]; - - pw_rho->real2recip(pinput, recipOutput); - for (int ip = 0; ip < pw_rho->npw; ++ip) - { - recipOutput[ip] *= this->kernel[ikernel][ip]; - } - pw_rho->recip2real(recipOutput, routput); - - delete[] recipOutput; -} - -void Cal_MLKEDF_Descriptors::Laplacian(double * pinput, ModulePW::PW_Basis *pw_rho, double * routput) -{ - std::complex *recipContainer = new std::complex[pw_rho->npw]; - - pw_rho->real2recip(pinput, recipContainer); - for (int ip = 0; ip < pw_rho->npw; ++ip) - { - recipContainer[ip] *= - pw_rho->gg[ip] * pw_rho->tpiba2; - } - pw_rho->recip2real(recipContainer, routput); - - delete[] recipContainer; -} - -void Cal_MLKEDF_Descriptors::divergence(double ** pinput, ModulePW::PW_Basis *pw_rho, double * routput) -{ - std::complex *recipContainer = new std::complex[pw_rho->npw]; - std::complex img(0.0, 1.0); - ModuleBase::GlobalFunc::ZEROS(routput, this->nx); - for (int i = 0; i < 3; ++i) - { - pw_rho->real2recip(pinput[i], recipContainer); - for (int ip = 0; ip < pw_rho->npw; ++ip) - { - recipContainer[ip] = img * pw_rho->gcar[ip][i] * pw_rho->tpiba * recipContainer[ip]; - } - pw_rho->recip2real(recipContainer, routput, true); - } - - delete[] recipContainer; -} - -void Cal_MLKEDF_Descriptors::tanh(std::vector &pinput, std::vector &routput, double chi) -{ - for (int i = 0; i < this->nx; ++i) - { - routput[i] = std::tanh(pinput[i] * chi); - } -} - -double Cal_MLKEDF_Descriptors::dtanh(double tanhx, double chi) -{ - return (1. - tanhx * tanhx) * chi; -} - -void Cal_MLKEDF_Descriptors::getGamma(const double * const *prho, std::vector &rgamma) -{ - for(int ir = 0; ir < this->nx; ++ir) - { - rgamma[ir] = std::pow(prho[0][ir]/this->rho0, 1./3.); - } -} - -void Cal_MLKEDF_Descriptors::getP(const double * const *prho, ModulePW::PW_Basis *pw_rho, std::vector> &pnablaRho, std::vector &rp) -{ - for(int ir = 0; ir < this->nx; ++ir) - { - rp[ir] = 0.; - for (int j = 0; j < 3; ++j) - { - rp[ir] += std::pow(pnablaRho[j][ir], 2); - } - rp[ir] *= this->pqcoef / std::pow(prho[0][ir], 8.0/3.0); - } -} - -void Cal_MLKEDF_Descriptors::getQ(const double * const *prho, ModulePW::PW_Basis *pw_rho, std::vector &rq) -{ - // get Laplacian rho - std::complex *recipRho = new std::complex[pw_rho->npw]; - pw_rho->real2recip(prho[0], recipRho); - for (int ip = 0; ip < pw_rho->npw; ++ip) - { - recipRho[ip] *= - pw_rho->gg[ip] * pw_rho->tpiba2; - } - pw_rho->recip2real(recipRho, rq.data()); - - for (int ir = 0; ir < this->nx; ++ir) - { - rq[ir] *= this->pqcoef / std::pow(prho[0][ir], 5.0/3.0); - } - - delete[] recipRho; -} - -void Cal_MLKEDF_Descriptors::getGammanl(const int ikernel, std::vector &pgamma, ModulePW::PW_Basis *pw_rho, std::vector &rgammanl) -{ - this->multiKernel(ikernel, pgamma.data(), pw_rho, rgammanl.data()); -} - -void Cal_MLKEDF_Descriptors::getPnl(const int ikernel, std::vector &pp, ModulePW::PW_Basis *pw_rho, std::vector &rpnl) -{ - this->multiKernel(ikernel, pp.data(), pw_rho, rpnl.data()); -} - -void Cal_MLKEDF_Descriptors::getQnl(const int ikernel, std::vector &pq, ModulePW::PW_Basis *pw_rho, std::vector &rqnl) -{ - this->multiKernel(ikernel, pq.data(), pw_rho, rqnl.data()); -} - -// xi = gammanl/gamma -void Cal_MLKEDF_Descriptors::getXi(std::vector &pgamma, std::vector &pgammanl, std::vector &rxi) -{ - for (int ir = 0; ir < this->nx; ++ir) - { - if (pgamma[ir] == 0) - { - std::cout << "WARNING: gamma=0" << std::endl; - rxi[ir] = 0.; - } - else - { - rxi[ir] = pgammanl[ir]/pgamma[ir]; - } - } -} - -// tanhxi = tanh(gammanl/gamma) -void Cal_MLKEDF_Descriptors::getTanhXi(const int ikernel, std::vector &pgamma, std::vector &pgammanl, std::vector &rtanhxi) -{ - for (int ir = 0; ir < this->nx; ++ir) - { - if (pgamma[ir] == 0) - { - std::cout << "WARNING: gamma=0" << std::endl; - rtanhxi[ir] = 0.; - } - else - { - rtanhxi[ir] = std::tanh(pgammanl[ir]/pgamma[ir] * this->chi_xi[ikernel]); - } - } -} - -// tanh(p) -void Cal_MLKEDF_Descriptors::getTanhP(std::vector &pp, std::vector &rtanhp) -{ - this->tanh(pp, rtanhp, this->chi_p); -} - -// tanh(q) -void Cal_MLKEDF_Descriptors::getTanhQ(std::vector &pq, std::vector &rtanhq) -{ - this->tanh(pq, rtanhq, this->chi_q); -} - -// tanh(pnl) -void Cal_MLKEDF_Descriptors::getTanh_Pnl(const int ikernel, std::vector &ppnl, std::vector &rtanh_pnl) -{ - this->tanh(ppnl, rtanh_pnl, this->chi_pnl[ikernel]); -} - -// tanh(qnl) -void Cal_MLKEDF_Descriptors::getTanh_Qnl(const int ikernel, std::vector &pqnl, std::vector &rtanh_qnl) -{ - this->tanh(pqnl, rtanh_qnl, this->chi_qnl[ikernel]); -} - -// tanh(p)_nl -void Cal_MLKEDF_Descriptors::getTanhP_nl(const int ikernel, std::vector &ptanhp, ModulePW::PW_Basis *pw_rho, std::vector &rtanhp_nl) -{ - this->multiKernel(ikernel, ptanhp.data(), pw_rho, rtanhp_nl.data()); -} - -// tanh(q)_nl -void Cal_MLKEDF_Descriptors::getTanhQ_nl(const int ikernel, std::vector &ptanhq, ModulePW::PW_Basis *pw_rho, std::vector &rtanhq_nl) -{ - this->multiKernel(ikernel, ptanhq.data(), pw_rho, rtanhq_nl.data()); -} - -// (tanhxi)_nl -void Cal_MLKEDF_Descriptors::getTanhXi_nl(const int ikernel, std::vector &ptanhxi, ModulePW::PW_Basis *pw_rho, std::vector &rtanhxi_nl) -{ - this->multiKernel(ikernel, ptanhxi.data(), pw_rho, rtanhxi_nl.data()); -} - -void Cal_MLKEDF_Descriptors::getF_KS( - psi::Psi> *psi, - elecstate::ElecState *pelec, - ModulePW::PW_Basis_K *pw_psi, - ModulePW::PW_Basis *pw_rho, - UnitCell& ucell, - const std::vector> &nablaRho, - std::vector &rF, - std::vector &rpauli -) -{ - double *pauliED = new double[this->nx]; // Pauli Energy Density - ModuleBase::GlobalFunc::ZEROS(pauliED, this->nx); - - double *pauliPot = new double[this->nx]; - ModuleBase::GlobalFunc::ZEROS(pauliPot, this->nx); - - std::complex *wfcr = new std::complex[this->nx]; - ModuleBase::GlobalFunc::ZEROS(wfcr, this->nx); - - double epsilonM = pelec->ekb(0,0); - assert(PARAM.inp.nspin == 1); - - base_device::DEVICE_CPU* ctx; - - // calculate positive definite kinetic energy density - for (int ik = 0; ik < psi->get_nk(); ++ik) - { - psi->fix_k(ik); - int ikk = psi->get_current_k(); - assert(ikk == ik); - int npw = psi->get_current_nbas(); - int nbands = psi->get_nbands(); - for (int ibnd = 0; ibnd < nbands; ++ibnd) - { - if (pelec->wg(ik, ibnd) < ModuleBase::threshold_wg) { - continue; - } - - pw_psi->recip_to_real(ctx, &psi->operator()(ibnd,0), wfcr, ik); - const double w1 = pelec->wg(ik, ibnd) / ucell.omega; - - // output one wf, to check KS equation - if (ik == 0 && ibnd == 0) - { - std::vector wf_real = std::vector(this->nx); - std::vector wf_imag = std::vector(this->nx); - for (int ir = 0; ir < this->nx; ++ir) - { - wf_real[ir] = wfcr[ir].real(); - wf_imag[ir] = wfcr[ir].imag(); - } - const long unsigned cshape[] = {(long unsigned) this->nx}; // shape of container and containernl - } - - if (w1 != 0.0) - { - // Find the energy of HOMO - if (pelec->ekb(ik,ibnd) > epsilonM) - { - epsilonM = pelec->ekb(ik,ibnd); - } - // The last term of Pauli potential - for (int ir = 0; ir < pelec->charge->nrxx; ir++) - { - pauliPot[ir] -= w1 * pelec->ekb(ik,ibnd) * norm(wfcr[ir]); - } - } - - for (int j = 0; j < 3; ++j) - { - ModuleBase::GlobalFunc::ZEROS(wfcr, pelec->charge->nrxx); - for (int ig = 0; ig < npw; ig++) - { - double fact - = pw_psi->getgpluskcar(ik, ig)[j] * ucell.tpiba; - wfcr[ig] = psi->operator()(ibnd, ig) * complex(0.0, fact); - } - - pw_psi->recip2real(wfcr, wfcr, ik); - - for (int ir = 0; ir < this->nx; ++ir) - { - pauliED[ir] += w1 * norm(wfcr[ir]); // actually, here should be w1/2 * norm(wfcr[ir]), but we multiply 2 to convert Ha to Ry. - } - } - } - } - - for (int j = 0; j < 3; ++j) - { - for (int ir = 0; ir < this->nx; ++ir) - { - pauliED[ir] -= nablaRho[j][ir] * nablaRho[j][ir] / (8. * pelec->charge->rho[0][ir]) * 2.; // convert Ha to Ry. - } - } - - for (int ir = 0; ir < this->nx; ++ir) - { - rF[ir] = pauliED[ir] / (this->cTF * std::pow(pelec->charge->rho[0][ir], 5./3.)); - rpauli[ir] = (pauliED[ir] + pauliPot[ir])/pelec->charge->rho[0][ir] + epsilonM; - } -} - -void Cal_MLKEDF_Descriptors::getNablaRho(const double * const *prho, ModulePW::PW_Basis *pw_rho, std::vector> &rnablaRho) -{ - std::complex *recipRho = new std::complex[pw_rho->npw]; - std::complex *recipNablaRho = new std::complex[pw_rho->npw]; - pw_rho->real2recip(prho[0], recipRho); - - std::complex img(0.0, 1.0); - for (int j = 0; j < 3; ++j) - { - for (int ip = 0; ip < pw_rho->npw; ++ip) - { - recipNablaRho[ip] = img * pw_rho->gcar[ip][j] * recipRho[ip] * pw_rho->tpiba; - } - pw_rho->recip2real(recipNablaRho, rnablaRho[j].data()); - } - - delete[] recipRho; - delete[] recipNablaRho; -} - -} \ No newline at end of file diff --git a/source/module_io/cal_mlkedf_descriptors.h b/source/module_io/cal_mlkedf_descriptors.h deleted file mode 100644 index 1872953073..0000000000 --- a/source/module_io/cal_mlkedf_descriptors.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef CAL_MLKEDF_DESCRIPTORS_H -#define CAL_MLKEDF_DESCRIPTORS_H - -#include -#include "source_base/global_function.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -namespace ModuleIO -{ - -/** - * @brief 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. - * @author sunliang on 2025-06-12 - */ -class Cal_MLKEDF_Descriptors -{ -public: - ~Cal_MLKEDF_Descriptors() {} - - void set_para( - const int &nx, - const double &nelec, - const double &tf_weight, - const double &vw_weight, - const double &chi_p, - const double &chi_q, - const std::vector &chi_xi, - const std::vector &chi_pnl, - const std::vector &chi_qnl, - const int &nkernel, - const std::vector &kernel_type, - const std::vector &kernel_scaling, - const std::vector &yukawa_alpha, - const std::vector &kernel_file, - const double &omega, - ModulePW::PW_Basis *pw_rho); - // get input parameters - void getGamma(const double * const *prho, std::vector &rgamma); - void getP(const double * const *prho, ModulePW::PW_Basis *pw_rho, std::vector> &pnablaRho, std::vector &rp); - void getQ(const double * const *prho, ModulePW::PW_Basis *pw_rho, std::vector &rq); - void getGammanl(const int ikernel, std::vector &pgamma, ModulePW::PW_Basis *pw_rho, std::vector &rgammanl); - void getPnl(const int ikernel, std::vector &pp, ModulePW::PW_Basis *pw_rho, std::vector &rpnl); - void getQnl(const int ikernel, std::vector &pq, ModulePW::PW_Basis *pw_rho, std::vector &rqnl); - // new parameters 2023-02-03 - void getXi(std::vector &pgamma, std::vector &pgammanl, std::vector &rxi); - void getTanhXi(const int ikernel, std::vector &pgamma, std::vector &pgammanl, std::vector &rtanhxi); - void getTanhP(std::vector &pp, std::vector &rtanhp); - void getTanhQ(std::vector &pq, std::vector &rtanhq); - void getTanh_Pnl(const int ikernel, std::vector &ppnl, std::vector &rtanh_pnl); - void getTanh_Qnl(const int ikernel, std::vector &pqnl, std::vector &rtanh_qnl); - void getTanhP_nl(const int ikernel, std::vector &ptanhp, ModulePW::PW_Basis *pw_rho, std::vector &rtanhp_nl); - void getTanhQ_nl(const int ikernel, std::vector &ptanhq, ModulePW::PW_Basis *pw_rho, std::vector &rtanhq_nl); - // 2023-03-20 - void getTanhXi_nl(const int ikernel, std::vector &ptanhxi, ModulePW::PW_Basis *pw_rho, std::vector &rtanhxi_nl); - - void getF_KS( - psi::Psi> *psi, - elecstate::ElecState *pelec, - ModulePW::PW_Basis_K *pw_psi, - ModulePW::PW_Basis *pw_rho, - UnitCell& ucell, - const std::vector> &nablaRho, - std::vector &rF, - std::vector &rpauli - ); - // get intermediate variables of V_Pauli - void getNablaRho(const double * const *prho, ModulePW::PW_Basis *pw_rho, std::vector> &rnablaRho); - - // tools - double MLkernel(double eta, double tf_weight, double vw_weight); - double MLkernel_yukawa(double eta, double alpha); - void read_kernel(const std::string &fileName, const double& scaling, ModulePW::PW_Basis *pw_rho, double* kernel_); - void multiKernel(const int ikernel, double *pinput, ModulePW::PW_Basis *pw_rho, double *routput); - void Laplacian(double * pinput, ModulePW::PW_Basis *pw_rho, double * routput); - void divergence(double ** pinput, ModulePW::PW_Basis *pw_rho, double * routput); - - void tanh(std::vector &pinput, std::vector &routput, double chi=1.); - double dtanh(double tanhx, double chi=1.); - - // new parameters 2023-02-13 - std::vector chi_xi = {1.0}; - double chi_p = 1.; - double chi_q = 1.; - std::vector chi_pnl = {1.0}; - std::vector chi_qnl = {1.0}; - - int nx = 0; - double dV = 0.; - double rho0 = 0.; // average rho - double kF = 0.; // Fermi vector kF = (3 pi^2 rho0)^(1/3) - double tkF = 0.; // 2 * kF - // double weightml = 1.; - const double cTF = 3.0/10.0 * std::pow(3*std::pow(M_PI, 2.0), 2.0/3.0) * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2) - const double pqcoef = 1.0 / (4.0 * std::pow(3*std::pow(M_PI, 2.0), 2.0/3.0)); // coefficient of p and q - - int nkernel = 1; - std::vector kernel_type = {1}; - std::vector kernel_scaling = {1.0}; - std::vector yukawa_alpha = {1.0}; - std::vector kernel_file = {"none"}; - std::vector> kernel = {}; // kernel[ikernel][ipw] = kernel value for ikernel and ipw -}; - -} // namespace ModuleIO - -#endif \ No newline at end of file diff --git a/source/module_io/cal_pLpR.cpp b/source/module_io/cal_pLpR.cpp deleted file mode 100644 index 5739d2b4b7..0000000000 --- a/source/module_io/cal_pLpR.cpp +++ /dev/null @@ -1,291 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "source_cell/unitcell.h" -#include "source_base/spherical_bessel_transformer.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "module_parameter/parameter.h" -#include "module_io/cal_pLpR.h" -#include "source_base/formatter.h" -#include "source_base/parallel_common.h" -/** - * - * FIXME: the following part will be transfered to TwoCenterIntegrator soon - * - */ - -// L+|l, m> = sqrt((l-m)(l+m+1))|l, m+1>, return the sqrt((l-m)(l+m+1)) -double _lplus_on_ylm(const int l, const int m) -{ - return std::sqrt((l - m) * (l + m + 1)); -} - -// L-|l, m> = sqrt((l+m)(l-m+1))|l, m-1>, return the sqrt((l+m)(l-m+1)) -double _lminus_on_ylm(const int l, const int m) -{ - return std::sqrt((l + m) * (l - m + 1)); -} - -std::complex ModuleIO::cal_LzijR( - const std::unique_ptr& 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& vR) -{ - double val_ = 0; - calculator->calculate(it, il, iz, mi, jt, jl, jz, mj, vR, &val_); - return std::complex(mi) * val_; -} - -std::complex ModuleIO::cal_LyijR( - const std::unique_ptr& 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& vR) -{ - // Ly = -i/2 * (L+ - L-) - const double plus_ = _lplus_on_ylm(jl, jm); - const double minus_ = _lminus_on_ylm(jl, jm); - double val_plus = 0, val_minus = 0; - if (plus_ != 0) - { - calculator->calculate(it, il, iz, im, jt, jl, jz, jm + 1, vR, &val_plus); - val_plus *= plus_; - } - if (minus_ != 0) - { - calculator->calculate(it, il, iz, im, jt, jl, jz, jm - 1, vR, &val_minus); - val_minus *= minus_; - } - return std::complex(0, -0.5) * (val_plus - val_minus); -} - -std::complex ModuleIO::cal_LxijR( - const std::unique_ptr& 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& vR) -{ - // Lx = 1/2 * (L+ + L-) - const double plus_ = _lplus_on_ylm(jl, jm); - const double minus_ = _lminus_on_ylm(jl, jm); - double val_plus = 0, val_minus = 0; - if (plus_ != 0) - { - calculator->calculate(it, il, iz, im, jt, jl, jz, jm + 1, vR, &val_plus); - val_plus *= plus_; - } - if (minus_ != 0) - { - calculator->calculate(it, il, iz, im, jt, jl, jz, jm - 1, vR, &val_minus); - val_minus *= minus_; - } - return std::complex(0.5) * (val_plus + val_minus); -} - -ModuleIO::AngularMomentumCalculator::AngularMomentumCalculator( - const std::string& orbital_dir, - const UnitCell& ucell, - const double& search_radius, - const int tdestructor, - const int tgrid, - const int tatom, - const bool searchpbc, - std::ofstream* ptr_log, - const int rank) -{ - - // ofs_running - this->ofs_ = ptr_log; - *ofs_ << "\n\n\n\n"; - *ofs_ << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - *ofs_ << " | |" << std::endl; - *ofs_ << " | Angular momentum expectation value calculation: |" << std::endl; - *ofs_ << " | This is a post-processing step. The expectation value of operator |" << std::endl; - *ofs_ << " | Lx, Ly, Lz (, in which a and b are ABACUS numerical atomic |" << std::endl; - *ofs_ << " | orbitals) will be calculated. |" << std::endl; - *ofs_ << " | The result will be printed to file with name ${suffix}_Lx/y/z.dat |" << std::endl; - *ofs_ << " | |" << std::endl; - *ofs_ << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - *ofs_ << "\n\n\n\n"; - - int ntype_ = ucell.ntype; -#ifdef __MPI - Parallel_Common::bcast_int(ntype_); -#endif - std::vector forb(ntype_); - if (rank == 0) - { - for (int i = 0; i < ucell.ntype; ++i) - { - forb[i] = orbital_dir + ucell.orbital_fn[i]; - } - } -#ifdef __MPI - Parallel_Common::bcast_string(forb.data(), ntype_); -#endif - - this->orb_ = std::unique_ptr(new RadialCollection); - this->orb_->build(ucell.ntype, forb.data(), 'o'); - - ModuleBase::SphericalBesselTransformer sbt(true); - this->orb_->set_transformer(sbt); - - const double rcut_max = orb_->rcut_max(); - const int ngrid = int(rcut_max / 0.01) + 1; - const double cutoff = 2.0 * rcut_max; - this->orb_->set_uniform_grid(true, ngrid, cutoff, 'i', true); - - this->calculator_ = std::unique_ptr(new TwoCenterIntegrator); - this->calculator_->tabulate(*orb_, *orb_, 'S', ngrid, cutoff); - - // Initialize Ylm coefficients - ModuleBase::Ylm::set_coefficients(); - - // for neighbor list search - double temp = -1.0; - temp = atom_arrange::set_sr_NL(*ofs_, - PARAM.inp.out_level, - search_radius, - ucell.infoNL.get_rcutmax_Beta(), - PARAM.globalv.gamma_only_local); - temp = std::max(temp, search_radius); - this->neighbor_searcher_ = std::unique_ptr(new Grid_Driver(tdestructor, tgrid)); - atom_arrange::search(searchpbc, - *ofs_, - *neighbor_searcher_, - ucell, - temp, - tatom); -} - -void ModuleIO::AngularMomentumCalculator::kernel( - std::ofstream* ofs, - const UnitCell& ucell, - const char dir, - const int precision) -{ - if (!ofs->is_open()) - { - return; - } - // an easy sanity check - assert(dir == 'x' || dir == 'y' || dir == 'z'); - - // it, ia, il, iz, im, iRx, iRy, iRz, jt, ja, jl, jz, jm - // the iRx, iRy, iRz are the indices of the supercell in which the two-center-integral - // it and jt are indexes of atomtypes, - // ia and ja are indexes of atoms within the atomtypes, - // il and jl are indexes of the angular momentum, - // iz and jz are indexes of the zeta functions - // im and jm are indexes of the magnetic quantum numbers. - std::string fmtstr = "%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d"; - fmtstr += "%" + std::to_string(precision*2) + "." + std::to_string(precision) + "e"; - fmtstr += "%" + std::to_string(precision*2) + "." + std::to_string(precision) + "e\n"; - FmtCore fmt(fmtstr); - - ModuleBase::Vector3 ri, rj, dr; - for (int it = 0; it < ucell.ntype; it++) - { - const Atom& atyp_i = ucell.atoms[it]; - for (int ia = 0; ia < atyp_i.na; ia++) - { - ri = atyp_i.tau[ia]; - neighbor_searcher_->Find_atom(ucell, ri, it, ia); - for (int ia_adj = 0; ia_adj < neighbor_searcher_->getAdjacentNum(); ia_adj++) - { - rj = neighbor_searcher_->getAdjacentTau(ia_adj); - int jt = neighbor_searcher_->getType(ia_adj); - const Atom& atyp_j = ucell.atoms[jt]; - int ja = neighbor_searcher_->getNatom(ia_adj); - dr = (ri - rj) * ucell.lat0; - const ModuleBase::Vector3 iR = neighbor_searcher_->getBox(ia_adj); - // the two-center-integral - - for (int li = 0; li < atyp_i.nwl + 1; li++) - { - for (int iz = 0; iz < atyp_i.l_nchi[li]; iz++) - { - for (int mi = -li; mi <= li; mi++) - { - for (int lj = 0; lj < atyp_j.nwl + 1; lj++) - { - for (int jz = 0; jz < atyp_j.l_nchi[lj]; jz++) - { - for (int mj = -lj; mj <= lj; mj++) - { - std::complex val = 0; - if (dir == 'x') - { - val = cal_LxijR(calculator_, - it, ia, li, iz, mi, jt, ja, lj, jz, mj, dr); - } - else if (dir == 'y') - { - val = cal_LyijR(calculator_, - it, ia, li, iz, mi, jt, ja, lj, jz, mj, dr); - } - else if (dir == 'z') - { - val = cal_LzijR(calculator_, - it, ia, li, iz, mi, jt, ja, lj, jz, mj, dr); - } - - *ofs << fmt.format( - it, ia, li, iz, mi, - iR.x, iR.y, iR.z, - jt, ja, lj, jz, mj, - val.real(), val.imag()); - } - } - } - } - } - } - } - } - } -} - -void ModuleIO::AngularMomentumCalculator::calculate( - const std::string& prefix, - const std::string& outdir, - const UnitCell& ucell, - const int precision, - const int rank) -{ - if (rank != 0) - { - return; - } - std::ofstream ofout; - const std::string dir = "xyz"; - const std::string title = "# it ia il iz im iRx iRy iRz jt ja jl jz jm \n" - "# it: atomtype index of the first atom\n" - "# ia: atomic index of the first atom within the atomtype\n" - "# il: angular momentum index of the first atom\n" - "# iz: zeta function index of the first atom\n" - "# im: magnetic quantum number of the first atom\n" - "# iRx, iRy, iRz: the indices of the supercell\n" - "# jt: atomtype index of the second atom\n" - "# ja: atomic index of the second atom within the atomtype\n" - "# jl: angular momentum index of the second atom\n" - "# jz: zeta function index of the second atom\n" - "# jm: magnetic quantum number of the second atom\n" - "# : the value of the matrix element\n"; - - for (char d : dir) - { - std::string fn = outdir + prefix + "_L" + d + ".dat"; - ofout.open(fn, std::ios::out); - ofout << title; - this->kernel(&ofout, ucell, d, precision); - ofout.close(); - } -} \ No newline at end of file diff --git a/source/module_io/cal_pLpR.h b/source/module_io/cal_pLpR.h deleted file mode 100644 index 978a89f466..0000000000 --- a/source/module_io/cal_pLpR.h +++ /dev/null @@ -1,224 +0,0 @@ -/** - * calculate the matrix elements, in which the Lx/Ly/Lz - * are the angular momentum operators, |phi_i> and |phi_j> are the numerical - * atomic orbitals (NAOs). - * - * Formulation - * ----------- - * - * Calculate the with ladder operator L+ and L-. - * - * The relation between Lx, Ly and L+, L- are: - * - * Lx = (L+ + L-) / 2 - * Ly = (L+ - L-) / 2i - * - * With L+, the spherical harmonic function Ylm (denoted as |l, m> in the following) - * can be raised: - * - * L+|l, m> = sqrt((l-m)(l+m+1))|l, m+1> - * - * Likely, with L-, the spherical harmonic function Ylm can be lowered: - * - * L-|l, m> = sqrt((l+m)(l-m+1))|l, m-1> - * - * Therefore the Lx matrix element can be calculated as: - * - * = sqrt((l-m)(l+m+1)) * delta(m, m'+1) / 2 - * + sqrt((l+m)(l-m+1)) * delta(m, m'-1) / 2 - * - * The Ly matrix element can be calculated as: - * - * = sqrt((l-m)(l+m+1)) * delta(m, m'+1) / 2i - * - sqrt((l+m)(l-m+1)) * delta(m, m'-1) / 2i - * - * The Lz matrix element can be calculated as: - * - * = m * delta(m, m') - * - * However, things will change when there are more than one centers. - * - * Technical Details - * ----------------- - * - * 0. The calculation of matrix elements involves the two-center-integral calculation, - * this is supported by ABACUS built-in class TwoCenterIntegrator. - * see: source/source_basis/module_nao/two_center_integrator.h. - * - * 1. The interface of it is RadialCollection, which is a collection of radial functions. - * see: source/source_basis/module_nao/radial_collection.h - * - * 2. The radial functions are stored in AtomicRadials class, - * see: source/source_basis/module_nao/atomic_radials.h - * - * 3. The construction of AtomicRadials involves the filename of orbital, it is stored - * in the UnitCell instance - * - * 4. The calculation will run over all supercells in which the two-center-integral - * is not zero. This is done by the class SltkGridDriver, which is a driver for - * searching the neighboring cells. - */ -#include -#include -#include -#include -#include -#include -#include "source_cell/unitcell.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/module_neighbor/sltk_atom_arrange.h" - -namespace ModuleIO -{ - /** - * @brief calculate the matrix elements, in which the Lz - * are the angular momentum operators, |phi_i> and |phi_j> are the numerical - * atomic orbitals (NAOs). - * - * @param calculator the std::unique_ptr instance - * @param it atomtype index of the first atom - * @param ia atomic index of the first atom within the atomtype - * @param il angular momentum index of the first atom - * @param iz zeta function index of the first atom - * @param mi magnetic quantum number of the first atom - * @param jt atomtype index of the second atom - * @param ja atomic index of the second atom within the atomtype - * @param jl angular momentum index of the second atom - * @param jz zeta function index of the second atom - * @param mj magnetic quantum number of the second atom - * @param vR the vector from the first atom to the second atom - * @return std::complex - */ - std::complex cal_LzijR( - const std::unique_ptr& 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& vR); - - /** - * @brief calculate the matrix elements, in which the Lz - * are the angular momentum operators, |phi_i> and |phi_j> are the numerical - * atomic orbitals (NAOs). - * - * @param calculator the std::unique_ptr instance - * @param it atomtype index of the first atom - * @param ia atomic index of the first atom within the atomtype - * @param il angular momentum index of the first atom - * @param iz zeta function index of the first atom - * @param mi magnetic quantum number of the first atom - * @param jt atomtype index of the second atom - * @param ja atomic index of the second atom within the atomtype - * @param jl angular momentum index of the second atom - * @param jz zeta function index of the second atom - * @param mj magnetic quantum number of the second atom - * @param vR the vector from the first atom to the second atom - * @return std::complex - */ - std::complex cal_LyijR( - const std::unique_ptr& 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& vR); - - /** - * @brief calculate the matrix elements, in which the Lz - * are the angular momentum operators, |phi_i> and |phi_j> are the numerical - * atomic orbitals (NAOs). - * - * @param calculator the std::unique_ptr instance - * @param it atomtype index of the first atom - * @param ia atomic index of the first atom within the atomtype - * @param il angular momentum index of the first atom - * @param iz zeta function index of the first atom - * @param mi magnetic quantum number of the first atom - * @param jt atomtype index of the second atom - * @param ja atomic index of the second atom within the atomtype - * @param jl angular momentum index of the second atom - * @param jz zeta function index of the second atom - * @param mj magnetic quantum number of the second atom - * @param vR the vector from the first atom to the second atom - * @return std::complex - */ - std::complex cal_LxijR( - const std::unique_ptr& 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& vR); - - // the calculation of matrix elements will be outputted - // in the way that indexed by: - // it, ia, il, iz, im, iRx, iRy, iRz, jt, ja, jl, jz, jm, in which the - // iRx, iRy, iRz are the indices of the supercell in which the two-center-integral - // it and jt are indexes of atomtypes, - // ia and ja are indexes of atoms within the atomtypes, - // il and jl are indexes of the angular momentum, - // iz and jz are indexes of the zeta functions - // im and jm are indexes of the magnetic quantum numbers. - // The output is a complex number, which is the value of the matrix element. - // Always the matrix is quite large, so direct print to file. - class AngularMomentumCalculator - { - public: - // the default constructor is meaningless - AngularMomentumCalculator() = delete; - /** - * @brief Construct a new Angular Momentum Expectation Calculator object - * - * @param orbital_dir the directory of the orbital file - * @param ucell the unit cell object - * @param search_radius the search radius for the neighboring atoms - * @param tdestructor test flag, for destructor - * @param tgrid test flag, for grid - * @param tatom test flag, for atom input - * @param searchpbc - * @param ptr_log pointer to the ofstream object for logging - */ - AngularMomentumCalculator( - const std::string& orbital_dir, - const UnitCell& ucell, - const double& search_radius, - const int tdestructor, - const int tgrid, - const int tatom, - const bool searchpbc, - std::ofstream* ptr_log = nullptr, - const int rank = 0); - ~AngularMomentumCalculator() = default; - - void calculate(const std::string& prefix, - const std::string& outdir, - const UnitCell& ucell, - const int precision = 10, - const int rank = 0); - - private: - // ofsrunning - std::ofstream* ofs_; - // the two-center-integrator - std::unique_ptr calculator_; - // the spherical bessel transformer - ModuleBase::SphericalBesselTransformer sbt_; - // the radial collection - std::unique_ptr orb_; - - // neighboring searcher - std::unique_ptr neighbor_searcher_; - - /** - * @brief calculate the matrix elements. Due to - * the large size of the matrix, the result will be printed to file - * directly. - * - * @param ofs pointer to the ofstream object for printing, if nullptr, - * the result will not be printed - * @param ucell the unit cell object - * @param dir the direction of the angular momentum operator, 'x', 'y' or 'z' - * @param precision the precision of the output, default is 10 - */ - void kernel(std::ofstream* ofs, - const UnitCell& ucell, - const char dir = 'x', - const int precision = 10); - }; -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/cal_pdos_gamma.cpp b/source/module_io/cal_pdos_gamma.cpp deleted file mode 100644 index 8741f79a46..0000000000 --- a/source/module_io/cal_pdos_gamma.cpp +++ /dev/null @@ -1,287 +0,0 @@ -#include "cal_pdos_gamma.h" - -#include "source_base/parallel_reduce.h" -#include "source_base/blas_connector.h" -#include "source_base/scalapack_connector.h" -#include "write_orb_info.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -void ModuleIO::cal_pdos( - const psi::Psi* psi, - hamilt::Hamilt* p_ham, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - 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) -{ - ModuleBase::TITLE("ModuleIO", "cal_pdos_gamma"); - - assert(nspin0>0); - assert(emax>=emin); - assert(dos_edelta_ev>0.0); - - const int npoints = static_cast(std::floor((emax - emin) / dos_edelta_ev)); - const int nlocal = PARAM.globalv.nlocal; - - // PDOS calculated from each processor - ModuleBase::matrix* pdosk = new ModuleBase::matrix[nspin0]; - - for (int is = 0; is < nspin0; ++is) - { - pdosk[is].create(nlocal, npoints, true); - } - - // PDOS after MPI_reduce - ModuleBase::matrix* pdos = new ModuleBase::matrix[nspin0]; - for (int is = 0; is < nspin0; ++is) - { - pdos[is].create(nlocal, npoints, true); - } - - const double a = bcoeff; - const double b = sqrt(ModuleBase::TWO_PI) * a; - - std::complex* waveg = new std::complex[nlocal]; - - double* gauss = new double[npoints]; - - for (int is = 0; is < nspin0; ++is) - { - std::vector mulk; - mulk.resize(1); - mulk[0].create(pv.ncol, pv.nrow); - - psi->fix_k(is); - const double* ppsi = psi->get_pointer(); - for (int i = 0; i < nbands; ++i) - { - ModuleBase::GlobalFunc::ZEROS(waveg, nlocal); - - // Gauss smearing for each point - ModuleBase::GlobalFunc::ZEROS(gauss, npoints); - for (int n = 0; n < npoints; ++n) - { - double en = emin + n * dos_edelta_ev; - double en0 = ekb(0, i) * ModuleBase::Ry_to_eV; - double de = en - en0; - double de2 = 0.5 * de * de; - gauss[n] = kv.wk[0] * exp(-de2 / a / a) / b; - } - - const int nb = i + 1; - - const double one_float = 1.0; - const double zero_float = 0.0; - const int one_int = 1; - - const double* sk = dynamic_cast*>(p_ham)->getSk(); - //const double* sk = nullptr; - -#ifdef __MPI - const char T_char = 'T'; - const int nlocal = PARAM.globalv.nlocal; - pdgemv_(&T_char, - &nlocal, - &nlocal, - &one_float, - sk, - &one_int, - &one_int, - pv.desc, - ppsi, - &one_int, - &nb, - pv.desc, - &one_int, - &zero_float, - mulk[0].c, - &one_int, - &nb, - pv.desc, - &one_int); -#endif - - for (int j = 0; j < nlocal; ++j) - { - // computation performed on this processor - if (pv.in_this_processor(j, i)) - { - const int ir = pv.global2local_row(j); - const int ic = pv.global2local_col(i); - waveg[j] = mulk[0](ic, ir) * psi[0](ic, ir); - const double x = waveg[j].real(); - BlasConnector::axpy(npoints, x, gauss, 1, pdosk[is].c + j * pdosk[is].nc, 1); - } - } - } // ib - -#ifdef __MPI - // reduce the results into pdos[is].c - const int num = PARAM.globalv.nlocal * npoints; - MPI_Reduce(pdosk[is].c, pdos[is].c, num, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); -#endif - } // is - - delete[] pdosk; - delete[] waveg; - delete[] gauss; - - if (GlobalV::MY_RANK == 0) - { - print_tdos_gamma(pdos, nlocal, npoints, emin, dos_edelta_ev); - print_pdos_gamma(ucell, pdos, nlocal, npoints, emin, dos_edelta_ev); - ModuleIO::write_orb_info(&ucell); - } - - delete[] pdos; -} - - -void ModuleIO::print_tdos_gamma( - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev) -{ - ModuleBase::TITLE("ModuleIO", "print_tdos_gamma"); - - // file name - std::stringstream ps; - ps << PARAM.globalv.global_out_dir << "TDOS.dat"; - std::ofstream ofs(ps.str().c_str()); - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - for (int in = 0; in < npoints; ++in) - { - double dos1 = 0.0; - double en = emin + in * dos_edelta_ev; - for (int iw = 0; iw < nlocal; iw++) - { - dos1 += pdos[0](iw, in); - } - - ofs << std::setw(20) << en - << std::setw(20) << dos1 << std::endl; - } - } - else if (PARAM.inp.nspin == 2) - { - for (int in = 0; in < npoints; ++in) - { - double dos1 = 0.0; - double dos2 = 0.0; - double en = emin + in * dos_edelta_ev; - for (int iw = 0; iw < nlocal; iw++) - { - dos1 += pdos[0](iw, in); - dos2 += pdos[1](iw, in); - } - - ofs << std::setw(20) << en - << std::setw(20) << dos1 - << std::setw(20) << dos2 << std::endl; - } - } - ofs.close(); -} - -void ModuleIO::print_pdos_gamma( - const UnitCell& ucell, - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev) -{ - ModuleBase::TITLE("ModuleIO", "print_pdos_gamma"); - - std::stringstream as; - as << PARAM.globalv.global_out_dir << "PDOS.dat"; - std::ofstream ofs(as.str().c_str()); - - ofs << "" << std::endl; - ofs << "" << PARAM.inp.nspin << "" << std::endl; - - if (PARAM.inp.nspin == 4) - { - ofs << "" << std::setw(2) << nlocal / 2 << "" << std::endl; - } - else - { - ofs << "" << std::setw(2) << nlocal << "" << std::endl; - } - ofs << "" << std::endl; - - for (int n = 0; n < npoints; ++n) - { - double y = 0.0; - double en = emin + n * dos_edelta_ev; - ofs << std::setw(20) << en << std::endl; - } - - ofs << "" << std::endl; - for (int i = 0; i < ucell.nat; i++) - { - int a = ucell.iat2ia[i]; - int t = ucell.iat2it[i]; - Atom* atom1 = &ucell.atoms[t]; - const int s0 = ucell.itiaiw2iwt(t, a, 0); - for (int j = 0; j < atom1->nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - const int w = ucell.itiaiw2iwt(t, a, j); - - ofs << "" << std::endl; - ofs << "" << std::endl; - if (PARAM.inp.nspin == 1) - { - for (int n = 0; n < npoints; ++n) - { - - ofs << std::setw(13) << pdos[0](w, n) << std::endl; - } - } - else if (PARAM.inp.nspin == 2) - { - for (int n = 0; n < npoints; ++n) - { - ofs << std::setw(20) << pdos[0](w, n) << std::setw(30) << pdos[1](w, n) << std::endl; - } - } - else if (PARAM.inp.nspin == 4) - { - int w0 = w - s0; - for (int n = 0; n < npoints; ++n) - { - ofs << std::setw(20) << pdos[0](s0 + 2 * w0, n) + pdos[0](s0 + 2 * w0 + 1, n) << std::endl; - } - } - - ofs << "" << std::endl; - ofs << "" << std::endl; - } - } - - ofs << "" << std::endl; - ofs.close(); -} diff --git a/source/module_io/cal_pdos_gamma.h b/source/module_io/cal_pdos_gamma.h deleted file mode 100644 index bde8702e1b..0000000000 --- a/source/module_io/cal_pdos_gamma.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CAL_PDOS_GAMMA_H -#define CAL_PDOS_GAMMA_H - -#include "source_base/matrix.h" -#include "source_cell/klist.h" // use K_Vectors -#include "source_psi/psi.h" // use psi::Psi -#include "source_hamilt/hamilt.h" // use hamilt::Hamilt -#include "source_basis/module_ao/parallel_orbitals.h" // use Parallel_Orbitals - -namespace ModuleIO -{ - - void cal_pdos( - const psi::Psi* psi, - hamilt::Hamilt* p_ham, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - 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); - - void print_tdos_gamma( - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev); - - void print_pdos_gamma( - const UnitCell& ucell, - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev); - -} - -#endif diff --git a/source/module_io/cal_pdos_multik.cpp b/source/module_io/cal_pdos_multik.cpp deleted file mode 100644 index 52bedb7b02..0000000000 --- a/source/module_io/cal_pdos_multik.cpp +++ /dev/null @@ -1,318 +0,0 @@ -#include "cal_pdos_multik.h" - -#include "source_base/parallel_reduce.h" -#include "source_base/blas_connector.h" -#include "source_base/scalapack_connector.h" -#include "write_orb_info.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -void ModuleIO::cal_pdos( - const psi::Psi>* psi, - hamilt::Hamilt>* p_ham, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - 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) -{ - ModuleBase::TITLE("ModuleIO", "cal_pdos_multik"); - - assert(nspin0>0); - assert(emax>=emin); - assert(dos_edelta_ev>0.0); - - const int npoints = static_cast(std::floor((emax - emin) / dos_edelta_ev)); - const int nlocal = PARAM.globalv.nlocal; - - ModuleBase::matrix* pdosk = new ModuleBase::matrix[nspin0]; - - for (int is = 0; is < nspin0; ++is) - { - pdosk[is].create(nlocal, npoints, true); - } - - ModuleBase::matrix* pdos = new ModuleBase::matrix[nspin0]; - - for (int is = 0; is < nspin0; ++is) - { - pdos[is].create(nlocal, npoints, true); - } - - const double a = bcoeff; - const double b = sqrt(ModuleBase::TWO_PI) * a; - - std::complex* waveg = new std::complex[nlocal]; - - double* Gauss = new double[npoints](); - - for (int is = 0; is < nspin0; ++is) - { - std::vector mulk; - mulk.resize(1); - mulk[0].create(pv.ncol, pv.nrow); - - for (int ik = 0; ik < kv.get_nks(); ik++) - { - - if (is == kv.isk[ik]) - { - // calculate SK for current k point - const std::complex* sk = nullptr; - - // collumn-major matrix - const int hk_type = 1; - - if (PARAM.inp.nspin == 4) - { - dynamic_cast, std::complex>*>(p_ham) - ->updateSk(ik, hk_type); - sk = dynamic_cast, std::complex>*>(p_ham) - ->getSk(); - } - else - { - dynamic_cast, double>*>(p_ham) - ->updateSk(ik, hk_type); - sk = dynamic_cast, double>*>(p_ham) - ->getSk(); - } - - psi->fix_k(ik); - - psi::Psi> Dwfc(1, - psi->get_nbands(), - psi->get_nbasis(), - psi->get_nbasis(), - true); - - std::complex* p_dwfc = Dwfc.get_pointer(); - for (int index = 0; index < Dwfc.size(); ++index) - { - p_dwfc[index] = conj(psi->get_pointer()[index]); - } - - for (int i = 0; i < nbands; ++i) - { - - ModuleBase::GlobalFunc::ZEROS(waveg, nlocal); - - ModuleBase::GlobalFunc::ZEROS(Gauss, npoints); - for (int n = 0; n < npoints; ++n) - { - double en = emin + n * dos_edelta_ev; - double en0 = ekb(ik, i) * ModuleBase::Ry_to_eV; - double de = en - en0; - double de2 = 0.5 * de * de; - Gauss[n] = kv.wk[ik] * exp(-de2 / a / a) / b; - } - - const int nb = i + 1; - -#ifdef __MPI - const double one_float[2] = {1.0, 0.0}; - const double zero_float[2] = {0.0, 0.0}; - const int one_int = 1; - const char T_char = 'T'; - pzgemv_(&T_char, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one_float[0], - sk, - &one_int, - &one_int, - pv.desc, - p_dwfc, - &one_int, - &nb, - pv.desc, - &one_int, - &zero_float[0], - mulk[0].c, - &one_int, - &nb, - pv.desc, - &one_int); -#endif - - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - - if (pv.in_this_processor(j, i)) - { - const int ir = pv.global2local_row(j); - const int ic = pv.global2local_col(i); - - waveg[j] = mulk[0](ic, ir) * psi[0](ic, ir); - const double x = waveg[j].real(); - BlasConnector::axpy(npoints, x, Gauss, 1, pdosk[is].c + j * pdosk[is].nc, 1); - } - } - - } // ib - - } // if - } // ik - -#ifdef __MPI - // reduce the results into pdos[is].c - const int num = PARAM.globalv.nlocal * npoints; - MPI_Reduce(pdosk[is].c, pdos[is].c, num, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); -#endif - } // is - delete[] pdosk; - delete[] waveg; - delete[] Gauss; - - if (GlobalV::MY_RANK == 0) - { - print_tdos_multik(pdos, nlocal, npoints, emin, dos_edelta_ev); - print_pdos_multik(ucell, pdos, nlocal, npoints, emin, dos_edelta_ev); - - ModuleIO::write_orb_info(&ucell); - } - - delete[] pdos; -} - - -void ModuleIO::print_tdos_multik( - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev) -{ - - std::stringstream ps; - ps << PARAM.globalv.global_out_dir << "TDOS.dat"; - std::ofstream ofs1(ps.str().c_str()); - - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - - for (int n = 0; n < npoints; ++n) - { - double y = 0.0; - double en = emin + n * dos_edelta_ev; - for (int i = 0; i < nlocal; i++) - { - y += pdos[0](i, n); - } - - ofs1 << std::setw(20) << en << std::setw(30) << y << std::endl; - } - } - else if (PARAM.inp.nspin == 2) - { - for (int n = 0; n < npoints; ++n) - { - double y = 0.0; - double z = 0.0; - double en = emin + n * dos_edelta_ev; - for (int i = 0; i < nlocal; i++) - { - y += pdos[0](i, n); - z += pdos[1](i, n); - } - - ofs1 << std::setw(20) << en << std::setw(30) << y << std::setw(30) << z << std::endl; - } - } - ofs1.close(); -} - - -void ModuleIO::print_pdos_multik( - const UnitCell& ucell, - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev) -{ - ModuleBase::TITLE("ModuleIO", "print_pdos_multik"); - - std::stringstream as; - as << PARAM.globalv.global_out_dir << "PDOS.dat"; - std::ofstream ofs2(as.str().c_str()); - - ofs2 << "" << std::endl; - ofs2 << "" << PARAM.inp.nspin << "" << std::endl; - if (PARAM.inp.nspin == 4) - { - ofs2 << "" << std::setw(2) << nlocal / 2 << "" << std::endl; - } - else - { - ofs2 << "" << std::setw(2) << nlocal << "" << std::endl; - } - ofs2 << "" << std::endl; - - for (int n = 0; n < npoints; ++n) - { - double y = 0.0; - double en = emin + n * dos_edelta_ev; - ofs2 << std::setw(20) << en << std::endl; - } - ofs2 << "" << std::endl; - for (int i = 0; i < ucell.nat; i++) - { - int a = ucell.iat2ia[i]; - int t = ucell.iat2it[i]; - Atom* atom1 = &ucell.atoms[t]; - const int s0 = ucell.itiaiw2iwt(t, a, 0); - for (int j = 0; j < atom1->nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - const int w = ucell.itiaiw2iwt(t, a, j); - - ofs2 << "" << std::endl; - ofs2 << "" << std::endl; - if (PARAM.inp.nspin == 1) - { - for (int n = 0; n < npoints; ++n) - { - ofs2 << std::setw(13) << pdos[0](w, n) << std::endl; - } - } - else if (PARAM.inp.nspin == 2) - { - for (int n = 0; n < npoints; ++n) - { - ofs2 << std::setw(20) << pdos[0](w, n) << std::setw(30) << pdos[1](w, n) << std::endl; - } - } - else if (PARAM.inp.nspin == 4) - { - int w0 = w - s0; - for (int n = 0; n < npoints; ++n) - { - ofs2 << std::setw(20) << pdos[0](s0 + 2 * w0, n) + pdos[0](s0 + 2 * w0 + 1, n) << std::endl; - } - } - - ofs2 << "" << std::endl; - ofs2 << "" << std::endl; - }// end j - }// end i - - ofs2 << "" << std::endl; - ofs2.close(); -} diff --git a/source/module_io/cal_pdos_multik.h b/source/module_io/cal_pdos_multik.h deleted file mode 100644 index 2b59365c1a..0000000000 --- a/source/module_io/cal_pdos_multik.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef CAL_PDOS_MULTIK_H -#define CAL_PDOS_MULTIK_H - -#include "source_base/matrix.h" -#include "source_cell/klist.h" // use K_Vectors -#include "source_psi/psi.h" // use psi::Psi -#include "source_hamilt/hamilt.h" // use hamilt::Hamilt -#include "source_basis/module_ao/parallel_orbitals.h" // use Parallel_Orbitals - -namespace ModuleIO -{ - - // pdos for multi-k point - void cal_pdos( - const psi::Psi>* psi, - hamilt::Hamilt>* p_ham, - const Parallel_Orbitals& pv, - const UnitCell& ucell, - 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); - - void print_tdos_multik( - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev); - - void print_pdos_multik( - const UnitCell& ucell, - const ModuleBase::matrix* pdos, - const int nlocal, - const int npoints, - const double& emin, - const double& dos_edelta_ev); - -} - -#endif diff --git a/source/module_io/cal_r_overlap_R.cpp b/source/module_io/cal_r_overlap_R.cpp deleted file mode 100644 index 3c9a156a8a..0000000000 --- a/source/module_io/cal_r_overlap_R.cpp +++ /dev/null @@ -1,1090 +0,0 @@ -#include "cal_r_overlap_R.h" - -#include "module_parameter/parameter.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/mathzone_add1.h" - -cal_r_overlap_R::cal_r_overlap_R() -{ -} - -cal_r_overlap_R::~cal_r_overlap_R() -{ -} - -void cal_r_overlap_R::initialize_orb_table(const UnitCell& ucell, - const LCAO_Orbitals& orb) -{ - int Lmax_used = 0; - int Lmax = 0; - int exx_lmax = 0; -#ifdef __EXX - exx_lmax = GlobalC::exx_info.info_ri.abfs_Lmax; -#endif - - const int ntype = orb.get_ntype(); - int lmax_orb = -1, lmax_beta = -1; - for (int it = 0; it < ntype; it++) - { - lmax_orb = std::max(lmax_orb, orb.Phi[it].getLmax()); - lmax_beta = std::max(lmax_beta, ucell.infoNL.Beta[it].getLmax()); - } - const double dr = orb.get_dR(); - const double dk = orb.get_dk(); - const int kmesh = orb.get_kmesh() * 4 + 1; - int Rmesh = static_cast(orb.get_Rmax() / dr) + 4; - Rmesh += 1 - Rmesh % 2; - - Center2_Orb::init_Table_Spherical_Bessel(2, - 3, - Lmax_used, - Lmax, - exx_lmax, - lmax_orb, - lmax_beta, - dr, - dk, - kmesh, - Rmesh, - psb_); - ModuleBase::Ylm::set_coefficients(); - MGT.init_Gaunt_CH(Lmax); - MGT.init_Gaunt(Lmax); -} - -void cal_r_overlap_R::construct_orbs_and_orb_r(const UnitCell& ucell, - const LCAO_Orbitals& orb) -{ - int orb_r_ntype = 0; - int mat_Nr = orb.Phi[0].PhiLN(0, 0).getNr(); - int count_Nr = 0; - - orbs.resize(orb.get_ntype()); - for (int T = 0; T < orb.get_ntype(); ++T) - { - count_Nr = orb.Phi[T].PhiLN(0, 0).getNr(); - if (count_Nr > mat_Nr) - { - mat_Nr = count_Nr; - orb_r_ntype = T; - } - - orbs[T].resize(orb.Phi[T].getLmax() + 1); - for (int L = 0; L <= orb.Phi[T].getLmax(); ++L) - { - orbs[T][L].resize(orb.Phi[T].getNchi(L)); - for (int N = 0; N < orb.Phi[T].getNchi(L); ++N) - { - const auto& orb_origin = orb.Phi[T].PhiLN(L, N); - orbs[T][L][N].set_orbital_info(orb_origin.getLabel(), - orb_origin.getType(), - orb_origin.getL(), - orb_origin.getChi(), - orb_origin.getNr(), - orb_origin.getRab(), - orb_origin.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - orb_origin.getPsi(), - static_cast(orb_origin.getNk() * kmesh_times) | 1, - orb_origin.getDk(), - orb_origin.getDruniform(), - false, - true, - PARAM.inp.cal_force); - } - } - } - - orb_r.set_orbital_info(orbs[orb_r_ntype][0][0].getLabel(), // atom label - orb_r_ntype, // atom type - 1, // angular momentum L - 1, // number of orbitals of this L , just N - orbs[orb_r_ntype][0][0].getNr(), // number of radial mesh - orbs[orb_r_ntype][0][0].getRab(), // the mesh interval in radial mesh - orbs[orb_r_ntype][0][0].getRadial(), // radial mesh value(a.u.) - Numerical_Orbital_Lm::Psi_Type::Psi, - orbs[orb_r_ntype][0][0].getRadial(), // radial wave function - orbs[orb_r_ntype][0][0].getNk(), - orbs[orb_r_ntype][0][0].getDk(), - orbs[orb_r_ntype][0][0].getDruniform(), - false, - true, - PARAM.inp.cal_force); - - for (int TA = 0; TA < orb.get_ntype(); ++TA) - { - for (int TB = 0; TB < orb.get_ntype(); ++TB) - { - for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) - { - for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) - { - for (int LB = 0; LB <= orb.Phi[TB].getLmax(); ++LB) - { - for (int NB = 0; NB < orb.Phi[TB].getNchi(LB); ++NB) - { - center2_orb11[TA][TB][LA][NA][LB].insert( - std::make_pair(NB, Center2_Orb::Orb11(orbs[TA][LA][NA], orbs[TB][LB][NB], psb_, MGT))); - } - } - } - } - } - } - - for (int TA = 0; TA < orb.get_ntype(); ++TA) - { - for (int TB = 0; TB < orb.get_ntype(); ++TB) - { - for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) - { - for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) - { - for (int LB = 0; LB <= orb.Phi[TB].getLmax(); ++LB) - { - for (int NB = 0; NB < orb.Phi[TB].getNchi(LB); ++NB) - { - center2_orb21_r[TA][TB][LA][NA][LB].insert(std::make_pair( - NB, - Center2_Orb::Orb21(orbs[TA][LA][NA], orb_r, orbs[TB][LB][NB], psb_, MGT))); - } - } - } - } - } - } - - for (auto& co1: center2_orb11) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - for (auto& co4: co3.second) - { - for (auto& co5: co4.second) - { - for (auto& co6: co5.second) - { - co6.second.init_radial_table(); - } - } - } - } - } - } - - for (auto& co1: center2_orb21_r) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - for (auto& co4: co3.second) - { - for (auto& co5: co4.second) - { - for (auto& co6: co5.second) - { - co6.second.init_radial_table(); - } - } - } - } - } - } - - iw2it.resize(PARAM.globalv.nlocal); - iw2ia.resize(PARAM.globalv.nlocal); - iw2iL.resize(PARAM.globalv.nlocal); - iw2iN.resize(PARAM.globalv.nlocal); - iw2im.resize(PARAM.globalv.nlocal); - - int iw = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int iL = 0; iL < ucell.atoms[it].nwl + 1; iL++) - { - for (int iN = 0; iN < ucell.atoms[it].l_nchi[iL]; iN++) - { - for (int im = 0; im < (2 * iL + 1); im++) - { - iw2it[iw] = it; - iw2ia[iw] = ia; - iw2iL[iw] = iL; - iw2iN[iw] = iN; - iw2im[iw] = im; - iw++; - } - } - } - } - } -} - -void cal_r_overlap_R::construct_orbs_and_nonlocal_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb) -{ - const InfoNonlocal& infoNL_ = ucell.infoNL; - - int orb_r_ntype = 0; - int mat_Nr = orb.Phi[0].PhiLN(0, 0).getNr(); - int count_Nr = 0; - - orbs.resize(orb.get_ntype()); - for (int T = 0; T < orb.get_ntype(); ++T) - { - count_Nr = orb.Phi[T].PhiLN(0, 0).getNr(); - if (count_Nr > mat_Nr) - { - mat_Nr = count_Nr; - orb_r_ntype = T; - } - - orbs[T].resize(orb.Phi[T].getLmax() + 1); - for (int L = 0; L <= orb.Phi[T].getLmax(); ++L) - { - orbs[T][L].resize(orb.Phi[T].getNchi(L)); - for (int N = 0; N < orb.Phi[T].getNchi(L); ++N) - { - const auto& orb_origin = orb.Phi[T].PhiLN(L, N); - orbs[T][L][N].set_orbital_info(orb_origin.getLabel(), - orb_origin.getType(), - orb_origin.getL(), - orb_origin.getChi(), - orb_origin.getNr(), - orb_origin.getRab(), - orb_origin.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - orb_origin.getPsi(), - static_cast(orb_origin.getNk() * kmesh_times) | 1, - orb_origin.getDk(), - orb_origin.getDruniform(), - false, - true, - PARAM.inp.cal_force); - } - } - } - - orb_r.set_orbital_info(orbs[orb_r_ntype][0][0].getLabel(), // atom label - orb_r_ntype, // atom type - 1, // angular momentum L - 1, // number of orbitals of this L , just N - orbs[orb_r_ntype][0][0].getNr(), // number of radial mesh - orbs[orb_r_ntype][0][0].getRab(), // the mesh interval in radial mesh - orbs[orb_r_ntype][0][0].getRadial(), // radial mesh value(a.u.) - Numerical_Orbital_Lm::Psi_Type::Psi, - orbs[orb_r_ntype][0][0].getRadial(), // radial wave function - orbs[orb_r_ntype][0][0].getNk(), - orbs[orb_r_ntype][0][0].getDk(), - orbs[orb_r_ntype][0][0].getDruniform(), - false, - true, - PARAM.inp.cal_force); - - orbs_nonlocal.resize(orb.get_ntype()); - for (int T = 0; T < orb.get_ntype(); ++T) - { - const int nproj = infoNL_.nproj[T]; - orbs_nonlocal[T].resize(nproj); - for (int ip = 0; ip < nproj; ip++) - { - int nr = infoNL_.Beta[T].Proj[ip].getNr(); - double dr_uniform = 0.01; - int nr_uniform = static_cast((infoNL_.Beta[T].Proj[ip].getRadial(nr-1) - infoNL_.Beta[T].Proj[ip].getRadial(0))/dr_uniform) + 1; - double* rad = new double[nr_uniform]; - double* rab = new double[nr_uniform]; - for (int ir = 0; ir < nr_uniform; ir++) - { - rad[ir] = ir*dr_uniform; - rab[ir] = dr_uniform; - } - double* y2 = new double[nr]; - double* Beta_r_uniform = new double[nr_uniform]; - double* dbeta_uniform = new double[nr_uniform]; - ModuleBase::Mathzone_Add1::SplineD2(infoNL_.Beta[T].Proj[ip].getRadial(), infoNL_.Beta[T].Proj[ip].getBeta_r(), nr, 0.0, 0.0, y2); - ModuleBase::Mathzone_Add1::Cubic_Spline_Interpolation( - infoNL_.Beta[T].Proj[ip].getRadial(), - infoNL_.Beta[T].Proj[ip].getBeta_r(), - y2, - nr, - rad, - nr_uniform, - Beta_r_uniform, - dbeta_uniform - ); - - // linear extrapolation at the zero point - if (infoNL_.Beta[T].Proj[ip].getRadial(0) > 1e-10) - { - double slope = (infoNL_.Beta[T].Proj[ip].getBeta_r(1) - infoNL_.Beta[T].Proj[ip].getBeta_r(0)) / (infoNL_.Beta[T].Proj[ip].getRadial(1) - infoNL_.Beta[T].Proj[ip].getRadial(0)); - Beta_r_uniform[0] = infoNL_.Beta[T].Proj[ip].getBeta_r(0) - slope * infoNL_.Beta[T].Proj[ip].getRadial(0); - } - - // Here, the operation beta_r / r is performed. To avoid divergence at r=0, beta_r(0) is set to beta_r(1). - // However, this may introduce issues, so caution is needed. - for (int ir = 1; ir < nr_uniform; ir++) - { - Beta_r_uniform[ir] = Beta_r_uniform[ir] / rad[ir]; - } - Beta_r_uniform[0] = Beta_r_uniform[1]; - - orbs_nonlocal[T][ip].set_orbital_info(infoNL_.Beta[T].getLabel(), - infoNL_.Beta[T].getType(), - infoNL_.Beta[T].Proj[ip].getL(), - 1, - nr_uniform, - rab, - rad, - Numerical_Orbital_Lm::Psi_Type::Psi, - Beta_r_uniform, - static_cast(infoNL_.Beta[T].Proj[ip].getNk() * kmesh_times) | 1, - infoNL_.Beta[T].Proj[ip].getDk(), - infoNL_.Beta[T].Proj[ip].getDruniform(), - false, - true, - PARAM.inp.cal_force); - - delete [] rad; - delete [] rab; - delete [] y2; - delete [] Beta_r_uniform; - delete [] dbeta_uniform; - } - } - - for (int TA = 0; TA < orb.get_ntype(); ++TA) - { - for (int TB = 0; TB < orb.get_ntype(); ++TB) - { - for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) - { - for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) - { - for (int ip = 0; ip < infoNL_.nproj[TB]; ip++) - { - center2_orb11_nonlocal[TA][TB][LA][NA].insert( - std::make_pair(ip, Center2_Orb::Orb11(orbs[TA][LA][NA], orbs_nonlocal[TB][ip], psb_, MGT))); - } - } - } - } - } - - for (int TA = 0; TA < orb.get_ntype(); ++TA) - { - for (int TB = 0; TB < orb.get_ntype(); ++TB) - { - for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) - { - for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) - { - for (int ip = 0; ip < infoNL_.nproj[TB]; ip++) - { - center2_orb21_r_nonlocal[TA][TB][LA][NA].insert(std::make_pair( - ip, - Center2_Orb::Orb21(orbs[TA][LA][NA], orb_r, orbs_nonlocal[TB][ip], psb_, MGT))); - } - } - } - } - } - - for (auto& co1: center2_orb11_nonlocal) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - for (auto& co4: co3.second) - { - for (auto& co5: co4.second) - { - co5.second.init_radial_table(); - } - } - } - } - } - - for (auto& co1: center2_orb21_r_nonlocal) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - for (auto& co4: co3.second) - { - for (auto& co5: co4.second) - { - co5.second.init_radial_table(); - } - } - } - } - } - - iw2it.resize(PARAM.globalv.nlocal); - iw2ia.resize(PARAM.globalv.nlocal); - iw2iL.resize(PARAM.globalv.nlocal); - iw2iN.resize(PARAM.globalv.nlocal); - iw2im.resize(PARAM.globalv.nlocal); - - int iw = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int iL = 0; iL < ucell.atoms[it].nwl + 1; iL++) - { - for (int iN = 0; iN < ucell.atoms[it].l_nchi[iL]; iN++) - { - for (int im = 0; im < (2 * iL + 1); im++) - { - iw2it[iw] = it; - iw2ia[iw] = ia; - iw2iL[iw] = iL; - iw2iN[iw] = iN; - iw2im[iw] = im; - iw++; - } - } - } - } - } -} - -void cal_r_overlap_R::init(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb) -{ - ModuleBase::TITLE("cal_r_overlap_R", "init"); - ModuleBase::timer::tick("cal_r_overlap_R", "init"); - this->ParaV = &pv; - - initialize_orb_table(ucell,orb); - construct_orbs_and_orb_r(ucell,orb); - - ModuleBase::timer::tick("cal_r_overlap_R", "init"); - return; -} - -void cal_r_overlap_R::init_nonlocal(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb) -{ - ModuleBase::TITLE("cal_r_overlap_R", "init_nonlocal"); - ModuleBase::timer::tick("cal_r_overlap_R", "init_nonlocal"); - this->ParaV = &pv; - - initialize_orb_table(ucell,orb); - construct_orbs_and_nonlocal_and_orb_r(ucell,orb); - - ModuleBase::timer::tick("cal_r_overlap_R", "init_nonlocal"); - return; -} - -ModuleBase::Vector3 cal_r_overlap_R::get_psi_r_psi(const ModuleBase::Vector3& R1, - const int& T1, - const int& L1, - const int& m1, - const int& N1, - const ModuleBase::Vector3& R2, - const int& T2, - const int& L2, - const int& m2, - const int& N2) -{ - ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); - double factor = sqrt(ModuleBase::FOUR_PI / 3.0); - const ModuleBase::Vector3& distance = R2 - R1; - - double overlap_o = center2_orb11[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, distance, m1, m2); - - double overlap_x = -1 * factor - * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, - distance, - m1, - 1, - m2); // m = 1 - - double overlap_y = -1 * factor - * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, - distance, - m1, - 2, - m2); // m = -1 - - double overlap_z = factor - * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, - distance, - m1, - 0, - m2); // m = 0 - - ModuleBase::Vector3 temp_prp - = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) + R1 * overlap_o; - - return temp_prp; -} - -void cal_r_overlap_R::get_psi_r_beta(const UnitCell& ucell, - std::vector>& nlm, - const ModuleBase::Vector3& R1, - const int& T1, - const int& L1, - const int& m1, - const int& N1, - const ModuleBase::Vector3& R2, - const int& T2) -{ - ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); - double factor = sqrt(ModuleBase::FOUR_PI / 3.0); - const ModuleBase::Vector3& distance = R2 - R1; - const InfoNonlocal& infoNL_ = ucell.infoNL; - const int nproj = infoNL_.nproj[T2]; - nlm.resize(4); - if (nproj == 0) - { - for(int i = 0;i < 4;i++) - { - nlm[i].resize(1); - } - return; - } - - int natomwfc = 0; - for (int ip = 0; ip < nproj; ip++) - { - const int L2 = infoNL_.Beta[T2].Proj[ip].getL(); // mohan add 2021-05-07 - natomwfc += 2 * L2 + 1; - } - for(int i = 0;i < 4;i++) - { - nlm[i].resize(natomwfc); - } - int index = 0; - for (int ip = 0; ip < nproj; ip++) - { - const int L2 = infoNL_.Beta[T2].Proj[ip].getL(); - for (int m2 = 0; m2 < 2 * L2 + 1; m2++) - { - double overlap_o - = center2_orb11_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, distance, m1, m2); - - double overlap_x = -1 * factor - * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, - distance, - m1, - 1, - m2); // m = 1 - - double overlap_y = -1 * factor - * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, - distance, - m1, - 2, - m2); // m = -1 - - double overlap_z = factor - * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, - distance, - m1, - 0, - m2); // m = 0 - - //nlm[index] = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) + R1 * overlap_o; - - //nlm[index] = ModuleBase::Vector3(overlap_o, overlap_y, overlap_z);// + R1 * overlap_o; - nlm[0][index] = overlap_o; - nlm[1][index] = overlap_x + (R1 * overlap_o).x; - nlm[2][index] = overlap_y + (R1 * overlap_o).y; - nlm[3][index] = overlap_z + (R1 * overlap_o).z; - index++; - } - } -} - - -void cal_r_overlap_R::out_rR(const UnitCell& ucell, const Grid_Driver& gd, const int& istep) -{ - ModuleBase::TITLE("cal_r_overlap_R", "out_rR"); - ModuleBase::timer::tick("cal_r_overlap_R", "out_rR"); - - int step = istep; - // set R coor range - int R_minX = int(-gd.getGlayerX_minus()); - int R_minY = int(-gd.getGlayerY_minus()); - int R_minZ = int(-gd.getGlayerZ_minus()); - - int R_x = gd.getGlayerX() + gd.getGlayerX_minus(); - int R_y = gd.getGlayerY() + gd.getGlayerY_minus(); - int R_z = gd.getGlayerZ() + gd.getGlayerZ_minus(); - - std::set> all_R_coor; - for (int ix = 0; ix < R_x; ix++) - { - for (int iy = 0; iy < R_y; iy++) - { - for (int iz = 0; iz < R_z; iz++) - { - Abfs::Vector3_Order temp_R(ix + R_minX, iy + R_minY, iz + R_minZ); - all_R_coor.insert(temp_R); - } - } - } - - // calculate rR matrix - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); - double factor = sqrt(ModuleBase::FOUR_PI / 3.0); - int output_R_number = 0; - - std::stringstream tem1; - tem1 << PARAM.globalv.global_out_dir << "tmp-rr.csr"; - std::ofstream ofs_tem1; - std::ifstream ifs_tem1; - - if (GlobalV::DRANK == 0) - { - if (binary) - { - ofs_tem1.open(tem1.str().c_str(), std::ios::binary); - } - else - { - ofs_tem1.open(tem1.str().c_str()); - } - } - - for (auto& R_coor: all_R_coor) - { - std::map> psi_r_psi_sparse[3]; - - int dRx = R_coor.x; - int dRy = R_coor.y; - int dRz = R_coor.z; - - ModuleBase::Vector3 R_car = ModuleBase::Vector3(dRx, dRy, dRz) * ucell.latvec; - - int ir, ic; - for (int iw1 = 0; iw1 < PARAM.globalv.nlocal; iw1++) - { - ir = this->ParaV->global2local_row(iw1); - if (ir >= 0) - { - for (int iw2 = 0; iw2 < PARAM.globalv.nlocal; iw2++) - { - ic = this->ParaV->global2local_col(iw2); - if (ic >= 0) - { - int orb_index_row = iw1 / PARAM.globalv.npol; - int orb_index_col = iw2 / PARAM.globalv.npol; - - // The off-diagonal term in SOC calculaiton is zero, and the two diagonal terms are the same - int new_index = iw1 - PARAM.globalv.npol * orb_index_row - + (iw2 - PARAM.globalv.npol * orb_index_col) * PARAM.globalv.npol; - - if (new_index == 0 || new_index == 3) - { - int it1 = iw2it[orb_index_row]; - int ia1 = iw2ia[orb_index_row]; - int iN1 = iw2iN[orb_index_row]; - int iL1 = iw2iL[orb_index_row]; - int im1 = iw2im[orb_index_row]; - - int it2 = iw2it[orb_index_col]; - int ia2 = iw2ia[orb_index_col]; - int iN2 = iw2iN[orb_index_col]; - int iL2 = iw2iL[orb_index_col]; - int im2 = iw2im[orb_index_col]; - - ModuleBase::Vector3 r_distance - = (ucell.atoms[it2].tau[ia2] - ucell.atoms[it1].tau[ia1] + R_car) - * ucell.lat0; - - double overlap_o = center2_orb11[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - im2); - - double overlap_x - = -1 * factor - * center2_orb21_r[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - 1, - im2); // m = 1 - - double overlap_y - = -1 * factor - * center2_orb21_r[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - 2, - im2); // m = -1 - - double overlap_z - = factor - * center2_orb21_r[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - 0, - im2); // m = 0 - - ModuleBase::Vector3 temp_prp - = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) - + ucell.atoms[it1].tau[ia1] * ucell.lat0 * overlap_o; - - if (std::abs(temp_prp.x) > sparse_threshold) - { - psi_r_psi_sparse[0][iw1][iw2] = temp_prp.x; - } - - if (std::abs(temp_prp.y) > sparse_threshold) - { - psi_r_psi_sparse[1][iw1][iw2] = temp_prp.y; - } - - if (std::abs(temp_prp.z) > sparse_threshold) - { - psi_r_psi_sparse[2][iw1][iw2] = temp_prp.z; - } - } - } - } - } - } - - int rR_nonzero_num[3] = {0, 0, 0}; - for (int direction = 0; direction < 3; ++direction) - { - for (auto& row_loop: psi_r_psi_sparse[direction]) - { - rR_nonzero_num[direction] += row_loop.second.size(); - } - } - - Parallel_Reduce::reduce_all(rR_nonzero_num, 3); - - if (rR_nonzero_num[0] || rR_nonzero_num[1] || rR_nonzero_num[2]) - { - output_R_number++; - - if (binary) - { - ofs_tem1.write(reinterpret_cast(&dRx), sizeof(int)); - ofs_tem1.write(reinterpret_cast(&dRy), sizeof(int)); - ofs_tem1.write(reinterpret_cast(&dRz), sizeof(int)); - } - else - { - ofs_tem1 << dRx << " " << dRy << " " << dRz << std::endl; - } - - for (int direction = 0; direction < 3; ++direction) - { - if (GlobalV::DRANK == 0) - { - if (binary) - { - ofs_tem1.write(reinterpret_cast(&rR_nonzero_num[direction]), sizeof(int)); - } - else - { - ofs_tem1 << rR_nonzero_num[direction] << std::endl; - } - } - - if (rR_nonzero_num[direction]) - { - ModuleIO::output_single_R(ofs_tem1, - psi_r_psi_sparse[direction], - sparse_threshold, - binary, - *(this->ParaV)); - } - else - { - // do nothing - } - } - } - } - - if (GlobalV::DRANK == 0) - { - std::ofstream out_r; - std::stringstream ssr; - if (PARAM.inp.calculation == "md" && !PARAM.inp.out_app_flag) - { - ssr << PARAM.globalv.global_matrix_dir - << "rrg" << step << ".csr"; - } - else - { - ssr << PARAM.globalv.global_out_dir << "rr.csr"; - } - - if (binary) // .dat - { - ofs_tem1.close(); - int nlocal = PARAM.globalv.nlocal; - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) - { - out_r.open(ssr.str().c_str(), std::ios::binary | std::ios::app); - } - else - { - out_r.open(ssr.str().c_str(), std::ios::binary); - } - out_r.write(reinterpret_cast(&step), sizeof(int)); - out_r.write(reinterpret_cast(&nlocal), sizeof(int)); - out_r.write(reinterpret_cast(&output_R_number), sizeof(int)); - - ifs_tem1.open(tem1.str().c_str(), std::ios::binary); - out_r << ifs_tem1.rdbuf(); - ifs_tem1.close(); - out_r.close(); - } - else // .txt - { - ofs_tem1.close(); - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) - { - out_r.open(ssr.str().c_str(), std::ios::app); - } - else - { - out_r.open(ssr.str().c_str()); - } - out_r << "STEP: " << step << std::endl; - out_r << "Matrix Dimension of r(R): " << PARAM.globalv.nlocal << std::endl; - out_r << "Matrix number of r(R): " << output_R_number << std::endl; - - ifs_tem1.open(tem1.str().c_str()); - out_r << ifs_tem1.rdbuf(); - ifs_tem1.close(); - out_r.close(); - } - - std::remove(tem1.str().c_str()); - } - - ModuleBase::timer::tick("cal_r_overlap_R", "out_rR"); - return; -} - -void cal_r_overlap_R::out_rR_other(const UnitCell& ucell, const int& istep, const std::set>& output_R_coor) -{ - ModuleBase::TITLE("cal_r_overlap_R", "out_rR_other"); - ModuleBase::timer::tick("cal_r_overlap_R", "out_rR_other"); - - // calculate rR matrix - ModuleBase::Vector3 tau1, tau2, dtau; - ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); - double factor = sqrt(ModuleBase::FOUR_PI / 3.0); - int output_R_number = output_R_coor.size(); - int step = istep; - - std::ofstream out_r; - std::stringstream ssr; - if (PARAM.inp.calculation == "md" && !PARAM.inp.out_app_flag) - { - ssr << PARAM.globalv.global_matrix_dir - << "rrg" << step << ".csr"; - } - else - { - ssr << PARAM.globalv.global_out_dir << "rr.csr"; - } - - if (GlobalV::DRANK == 0) - { - if (binary) - { - int nlocal = PARAM.globalv.nlocal; - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) - { - out_r.open(ssr.str().c_str(), std::ios::binary | std::ios::app); - } - else - { - out_r.open(ssr.str().c_str(), std::ios::binary); - } - out_r.write(reinterpret_cast(&step), sizeof(int)); - out_r.write(reinterpret_cast(&nlocal), sizeof(int)); - out_r.write(reinterpret_cast(&output_R_number), sizeof(int)); - } - else - { - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) - { - out_r.open(ssr.str().c_str(), std::ios::app); - } - else - { - out_r.open(ssr.str().c_str()); - } - out_r << "STEP: " << step << std::endl; - out_r << "Matrix Dimension of r(R): " << PARAM.globalv.nlocal << std::endl; - out_r << "Matrix number of r(R): " << output_R_number << std::endl; - } - } - - for (auto& R_coor: output_R_coor) - { - std::map> psi_r_psi_sparse[3]; - - int dRx = R_coor.x; - int dRy = R_coor.y; - int dRz = R_coor.z; - - ModuleBase::Vector3 R_car = ModuleBase::Vector3(dRx, dRy, dRz) * ucell.latvec; - - int ir = 0; - int ic = 0; - for (int iw1 = 0; iw1 < PARAM.globalv.nlocal; iw1++) - { - ir = this->ParaV->global2local_row(iw1); - if (ir >= 0) - { - for (int iw2 = 0; iw2 < PARAM.globalv.nlocal; iw2++) - { - ic = this->ParaV->global2local_col(iw2); - if (ic >= 0) - { - int orb_index_row = iw1 / PARAM.globalv.npol; - int orb_index_col = iw2 / PARAM.globalv.npol; - - // The off-diagonal term in SOC calculaiton is zero, and the two diagonal terms are the same - int new_index = iw1 - PARAM.globalv.npol * orb_index_row - + (iw2 - PARAM.globalv.npol * orb_index_col) * PARAM.globalv.npol; - - if (new_index == 0 || new_index == 3) - { - int it1 = iw2it[orb_index_row]; - int ia1 = iw2ia[orb_index_row]; - int iN1 = iw2iN[orb_index_row]; - int iL1 = iw2iL[orb_index_row]; - int im1 = iw2im[orb_index_row]; - - int it2 = iw2it[orb_index_col]; - int ia2 = iw2ia[orb_index_col]; - int iN2 = iw2iN[orb_index_col]; - int iL2 = iw2iL[orb_index_col]; - int im2 = iw2im[orb_index_col]; - - ModuleBase::Vector3 r_distance - = (ucell.atoms[it2].tau[ia2] - ucell.atoms[it1].tau[ia1] + R_car) - * ucell.lat0; - - double overlap_o = center2_orb11[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - im2); - - double overlap_x - = -1 * factor - * center2_orb21_r[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - 1, - im2); // m = 1 - - double overlap_y - = -1 * factor - * center2_orb21_r[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - 2, - im2); // m = -1 - - double overlap_z - = factor - * center2_orb21_r[it1][it2][iL1][iN1][iL2].at(iN2).cal_overlap(origin_point, - r_distance, - im1, - 0, - im2); // m = 0 - - ModuleBase::Vector3 temp_prp - = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) - + ucell.atoms[it1].tau[ia1] * ucell.lat0 * overlap_o; - - if (std::abs(temp_prp.x) > sparse_threshold) - { - psi_r_psi_sparse[0][iw1][iw2] = temp_prp.x; - } - - if (std::abs(temp_prp.y) > sparse_threshold) - { - psi_r_psi_sparse[1][iw1][iw2] = temp_prp.y; - } - - if (std::abs(temp_prp.z) > sparse_threshold) - { - psi_r_psi_sparse[2][iw1][iw2] = temp_prp.z; - } - } - } - } - } - } - - int rR_nonzero_num[3] = {0, 0, 0}; - for (int direction = 0; direction < 3; ++direction) - { - for (auto& row_loop: psi_r_psi_sparse[direction]) - { - rR_nonzero_num[direction] += row_loop.second.size(); - } - } - - Parallel_Reduce::reduce_all(rR_nonzero_num, 3); - - if (binary) // .dat - { - out_r.write(reinterpret_cast(&dRx), sizeof(int)); - out_r.write(reinterpret_cast(&dRy), sizeof(int)); - out_r.write(reinterpret_cast(&dRz), sizeof(int)); - } - else // .txt - { - out_r << dRx << " " << dRy << " " << dRz << std::endl; - } - - for (int direction = 0; direction < 3; ++direction) - { - if (GlobalV::DRANK == 0) - { - if (binary) - { - out_r.write(reinterpret_cast(&rR_nonzero_num[direction]), sizeof(int)); - } - else - { - out_r << rR_nonzero_num[direction] << std::endl; - } - } - - if (rR_nonzero_num[direction]) - { - ModuleIO::output_single_R(out_r, psi_r_psi_sparse[direction], sparse_threshold, binary, *(this->ParaV)); - } - else - { - // do nothing - } - } - } - - if (GlobalV::DRANK == 0) - { - out_r.close(); - } - - ModuleBase::timer::tick("cal_r_overlap_R", "out_rR_other"); - return; -} diff --git a/source/module_io/cal_r_overlap_R.h b/source/module_io/cal_r_overlap_R.h deleted file mode 100644 index 07f044f6b0..0000000000 --- a/source/module_io/cal_r_overlap_R.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef CAL_R_OVERLAP_R_H -#define CAL_R_OVERLAP_R_H - -#include "source_base/abfs-vector3_order.h" -#include "source_base/sph_bessel_recursive.h" -#include "source_base/vector3.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb.h" -#include "single_R_io.h" - -#include -#include -#include - -// output r_R matrix, added by Jingan -class cal_r_overlap_R -{ - - public: - cal_r_overlap_R(); - ~cal_r_overlap_R(); - - double kmesh_times = 4; - double sparse_threshold = 1e-10; - bool binary = false; - - void init(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb); - void init_nonlocal(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb); - ModuleBase::Vector3 get_psi_r_psi( - const ModuleBase::Vector3& R1, - const int& T1, - const int& L1, - const int& m1, - const int& N1, - const ModuleBase::Vector3& R2, - const int& T2, - const int& L2, - const int& m2, - const int& N2 - ); - void get_psi_r_beta( - const UnitCell& ucell, - std::vector>& nlm, - const ModuleBase::Vector3& R1, - const int& T1, - const int& L1, - const int& m1, - const int& N1, - const ModuleBase::Vector3& R2, - const int& T2 - ); - void out_rR(const UnitCell& ucell, const Grid_Driver& gd, const int& istep); - void out_rR_other(const UnitCell& ucell, const int& istep, const std::set>& output_R_coor); - - private: - void initialize_orb_table(const UnitCell& ucell, const LCAO_Orbitals& orb); - void construct_orbs_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb); - void construct_orbs_and_nonlocal_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb); - - std::vector iw2ia; - std::vector iw2iL; - std::vector iw2im; - std::vector iw2iN; - std::vector iw2it; - - ModuleBase::Sph_Bessel_Recursive::D2* psb_ = nullptr; - ORB_gaunt_table MGT; - - Numerical_Orbital_Lm orb_r; - std::vector>> orbs; - std::vector> orbs_nonlocal; - - std::map< - size_t, - std::map>>>>> - center2_orb11; - - std::map< - size_t, - std::map>>>>> - center2_orb21_r; - - std::map< - size_t, - std::map>>>> - center2_orb11_nonlocal; - - std::map< - size_t, - std::map>>>> - center2_orb21_r_nonlocal; - - const Parallel_Orbitals* ParaV; -}; -#endif diff --git a/source/module_io/cal_test.cpp b/source/module_io/cal_test.cpp deleted file mode 100644 index d1da065e9d..0000000000 --- a/source/module_io/cal_test.cpp +++ /dev/null @@ -1,237 +0,0 @@ -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/global_function.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "source_base/global_variable.h" -#include "source_base/memory.h" -#include "cal_test.h" - -double Cal_Test::mporter=0.0; - -// about charge density -double Cal_Test::mrho=0.0; -double Cal_Test::mrho_save=0.0; -double Cal_Test::mrho_core=0.0; - -// about pulay mixing. -double Cal_Test::mRrho=0.0; -double Cal_Test::mdRrho=0.0; -double Cal_Test::mdrho=0.0; -double Cal_Test::mrho_save2=0.0; - -// about potential on FFT grid. -double Cal_Test::mvltot=0.0; -double Cal_Test::mvr=0.0; -double Cal_Test::mvrs=0.0; -double Cal_Test::mvrs1=0.0; -double Cal_Test::mvnew=0.0; - -// about charge in g space. -double Cal_Test::mrhog=0.0; -double Cal_Test::mrhog_save=0.0; -double Cal_Test::mrhog_core=0.0; - -// others -double Cal_Test::mhs=0.0; -double Cal_Test::mwf=0.0; -double Cal_Test::mnonzero=0.0; -double Cal_Test::mspar_hsrho=0.0; -// plane waves -double Cal_Test::mgvec=0.0; -double Cal_Test::mig2fftw=0.0; -double Cal_Test::mig2fftc=0.0; -double Cal_Test::mgg=0.0; -double Cal_Test::mig123=0.0; -double Cal_Test::mstrucFac=0.0; -double Cal_Test::meigts123=0.0; - -double Cal_Test::mtot=0.0; - -void Cal_Test::test_memory(const int nat, - const int ntype, - const ModuleBase::Matrix3& GGT, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const std::string chr_mixing_mode, - const int chr_mixing_ndim) -{ - ModuleBase::TITLE("Cal_Test","test_memory"); - - const int ngmw = Cal_Test::cal_np(GGT,wfcpw->ggecut, rhopw->nx, rhopw->ny, rhopw->nz); - const int ngmc = Cal_Test::cal_np(GGT,rhopw->ggecut, rhopw->nx, rhopw->ny, rhopw->nz); - -// const int ecut_wfc = INPUT.ecutwfc; -// const int ecut_chg = INPUT.ecutrho; - -// const int ngmw = Cal_Test::cal_np(ecut_wfc, rhopw->nx, rhopw->ny, rhopw->nz); -// const int ngmc = Cal_Test::cal_np(ecut_chg, rhopw->nx, rhopw->ny, rhopw->nz); - - std::cout << " number of atoms = " << nat << std::endl; - std::cout << " plane wave number for wave functions = " << ngmw << std::endl; - std::cout << " plane wave number for chage density = " << ngmc << std::endl; - - mporter = ModuleBase::Memory::calculate_mem ( rhopw->nxyz, "double"); - - mrho = mporter; - mrho_save = mrho; - mrho_core = mrho; - - // (2) memory for charge mixing - std::cout << " Mixing mode = " << chr_mixing_mode << std::endl; - if(chr_mixing_mode == "pulay") - { - std::cout << " Mixing dimension = " << chr_mixing_ndim << std::endl; - mRrho = chr_mixing_ndim * mrho; - mdRrho = (chr_mixing_ndim-1) * mrho; - mdrho = (chr_mixing_ndim-1) * mrho; - mrho_save2 = mrho; -// std::cout << " Memory for pulay mixing: " << mrho << " MB" << std::endl; - } - - mvltot = mrho; - mvr = mrho; - mvrs = mrho; - mvrs1 = mrho; - mvnew = mrho; - - mrhog = ModuleBase::Memory::calculate_mem( ngmc, "cdouble"); - mrhog_save = ModuleBase::Memory::calculate_mem( ngmc, "cdouble"); - mrhog_core = ModuleBase::Memory::calculate_mem( ngmc, "cdouble"); - - mhs = ModuleBase::Memory::calculate_mem( PARAM.globalv.nlocal*PARAM.globalv.nlocal, "double" ); - mwf = ModuleBase::Memory::calculate_mem( PARAM.globalv.nlocal*PARAM.inp.nbands, "double" ); - mnonzero = ModuleBase::Memory::calculate_mem( PARAM.globalv.nlocal*(PARAM.globalv.nlocal+1)/2, "bool"); -// mohan comment out 2021-02-11 -// mspar_hsrho = Memory::calculate_mem( Hnnz*3, "double"); - - mgvec = ModuleBase::Memory::calculate_mem( ngmc * 3 * 2, "double" ); - mig2fftw = ModuleBase::Memory::calculate_mem( ngmw , "int"); - mig2fftc = ModuleBase::Memory::calculate_mem( ngmc , "int"); - mgg = ModuleBase::Memory::calculate_mem( ngmc, "double"); - mig123 = ModuleBase::Memory::calculate_mem( ngmc*3, "int"); - mstrucFac = ModuleBase::Memory::calculate_mem( ntype*ngmc, "cdouble"); - meigts123 = ModuleBase::Memory::calculate_mem( nat * (2*rhopw->nx+1+2*rhopw->ny+1+2*rhopw->nz+1), "cdouble"); - - //(3) Memory for H,S matrix. - std::cout << " NLOCAL = " << PARAM.globalv.nlocal << std::endl; - std::cout << " NBANDS = " << PARAM.inp.nbands << std::endl; - - std::cout << " Memory for H,S matrix ( " - << PARAM.globalv.nlocal << ", " - << PARAM.globalv.nlocal << ") = " - << mhs << " MB" << std::endl; - - //(4) Memory for wave functions. - std::cout << " Memory for wave functions ( " - << PARAM.globalv.nlocal << ", " - << PARAM.inp.nbands << ") = " - << mwf << " MB" << std::endl; - - print_mem(1); -// print_mem(8); -// print_mem(16); - -// if(nat > 200) -// { -// print_mem(32); -// print_mem(64); -// } - - return; -} - -//! compute the number of plane waves -int Cal_Test::cal_np(const ModuleBase::Matrix3& GGT, - const double &ggcut, - const int &n1, - const int &n2, - const int &n3) -{ - -/* - std::cout << "ggcut=" << ggcut << std::endl; - std::cout << "n1=" << n1 << std::endl; - std::cout << "n2=" << n2 << std::endl; - std::cout << "n3=" << n3 << std::endl; -*/ - - assert(n1>=0); - assert(n2>=0); - assert(n3>=0); - - int ibox[3]={0}; - - // set the center at origin point. - ibox[0] = int(n1 / 2.0) + 1; - ibox[1] = int(n2 / 2.0) + 1; - ibox[2] = int(n3 / 2.0) + 1; - // get the number of plane wave within 'gcut' - int ng = 0; - for (int i = -ibox[0]; i <= ibox[0]; i++) - { - for (int j = -ibox[1]; j <= ibox[1]; j++) - { - for (int k = -ibox[2]; k <= ibox[2]; k++) - { - ModuleBase::Vector3 f(i,j,k); - // g2= |f|^2 in the unit of (2Pi/lat0)^2 - double g2 = f * (GGT * f); - - // gcut is from input. - if (g2 <= ggcut) - { - ng++; - } - } - } - } - return ng; -} - -void Cal_Test::print_mem(const int &nproc) -{ - std::cout << " ========================: " << std::endl; - mtot = 0.0; - - mtot += mporter + mrho + mrho_save + mrho_core + mRrho + - mdRrho + mdrho + mrho_save2 + mvltot + mvr + - mvrs + mvrs1 + mvnew + mrhog + mrhog_save + mrhog_core + - mgvec + mgg + mig2fftw + mig2fftc + mig123 + - mstrucFac + meigts123; - mtot += mwf + mhs; - - std::cout << " If you use " << nproc << " processors: " << std::endl; - std::cout << " MEMORY FOR porter : " << std::setw(15) << mporter/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rho : " << std::setw(15) << mrho/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rho_save : " << std::setw(15) << mrho_save/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rho_core : " << std::setw(15) << mrho_core/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR Rrho : " << std::setw(15) << mRrho/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR dRrho : " << std::setw(15) << mdRrho/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR drho : " << std::setw(15) << mdrho/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rho_save2 : " << std::setw(15) << mrho_save2/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR vltot : " << std::setw(15) << mvltot/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR vr : " << std::setw(15) << mvr/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR vrs : " << std::setw(15) << mvrs/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR vrs1 : " << std::setw(15) << mvrs1/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR vrnew : " << std::setw(15) << mvnew/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rhog : " << std::setw(15) << mrhog/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rhog_save : " << std::setw(15) << mrhog_save/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR rhog_core : " << std::setw(15) << mrhog_core/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR H, S matrix : " << std::setw(15) << mhs/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR wave function: " << std::setw(15) << mwf/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR spar H,S,rho : " << std::setw(15) << mspar_hsrho << " MB" << std::endl; - std::cout << " MEMORY FOR nonzero : " << std::setw(15) << mnonzero << " MB" << std::endl; - std::cout << " MEMORY FOR g vectors : " << std::setw(15) << mgvec/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR gg : " << std::setw(15) << mgg/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR fftw index : " << std::setw(15) << mig2fftw/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR fftc index : " << std::setw(15) << mig2fftc/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR ig123 : " << std::setw(15) << mig123/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR strucFac : " << std::setw(15) << mstrucFac/nproc << " MB" << std::endl; - std::cout << " MEMORY FOR eigts1,2,3 : " << std::setw(15) << meigts123/nproc << " MB" << std::endl; - std::cout << " TOTAL MEMORY : " << std::setw(15) << mtot/nproc << " MB" << std::endl; - - std::cout << " MEMORY FOR nonzero : " << std::setw(15) - << (double)PARAM.globalv.nlocal*(PARAM.globalv.nlocal+1)/1028/1028/2.0/nproc - << " MB" << std::endl; -} diff --git a/source/module_io/cal_test.h b/source/module_io/cal_test.h deleted file mode 100644 index 665d3f95c1..0000000000 --- a/source/module_io/cal_test.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef CAL_TEST_H -#define CAL_TEST_H -#include "source_basis/module_pw/pw_basis.h" -#include "source_basis/module_pw/pw_basis_k.h" - -namespace Cal_Test -{ - void test_memory(const int nat, - const int ntype, - const ModuleBase::Matrix3& GGT, - const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const std::string chr_mixing_mode, - const int chr_mixing_ndim); - - int cal_np(const ModuleBase::Matrix3& GGT, - const double &ggcut, - const int &n1, - const int &n2, - const int &n3); - - void print_mem(const int &nproc); - - extern double mporter; - - // about charge density. - extern double mrho; - extern double mrho_save; - extern double mrho_core; - - // about pulay mixing. - extern double mRrho; - extern double mdRrho; - extern double mdrho; - extern double mrho_save2; - - // about potential on FFT grid. - extern double mvltot; - extern double mvr; - extern double mvrs; - extern double mvrs1; - extern double mvnew; - - // about charge in g space. - extern double mrhog; - extern double mrhog_save; - extern double mrhog_core; - - // about others. - extern double mhs; - extern double mwf; - extern double mnonzero; - extern double mspar_hsrho; - - extern double mgvec; - extern double mig2fftw; - extern double mig2fftc; - extern double mgg; - extern double mig123; - extern double mstrucFac; - extern double meigts123; - - extern double mtot; - -} -#endif diff --git a/source/module_io/cif_io.cpp b/source/module_io/cif_io.cpp deleted file mode 100644 index 8b69a04ac3..0000000000 --- a/source/module_io/cif_io.cpp +++ /dev/null @@ -1,529 +0,0 @@ -#include -#include -#include -#include -#include "source_base/formatter.h" -#include "module_io/cif_io.h" -#include -#include -#include "source_base/tool_quit.h" -#ifdef __MPI -#include "source_base/parallel_common.h" -#endif - -double deg2rad(double deg) { return deg * M_PI / 180.0; } -double rad2deg(double rad) { return rad * 180.0 / M_PI; } - -void _build_chem_formula(const int natom, - const std::string* atom_site_labels, - std::string& sum, - std::string& structural) -{ - sum.clear(); - structural.clear(); - std::vector kinds; - std::vector labels(natom); - std::copy(atom_site_labels, atom_site_labels + natom, labels.begin()); - for (int i = 0; i < natom; ++i) - { - if (std::find(kinds.begin(), kinds.end(), labels[i]) == kinds.end()) - { - kinds.push_back(labels[i]); - } - } - std::vector counts(kinds.size()); - std::transform(kinds.begin(), kinds.end(), counts.begin(), [&labels](const std::string& kind) { - return std::count(labels.begin(), labels.end(), kind); - }); - for (size_t i = 0; i < kinds.size(); ++i) - { - sum += kinds[i]; - structural += kinds[i]; - if (counts[i] > 1) - { - sum += std::to_string(counts[i]); - } - } -} - -void vec_to_abc_angles(const double* vec, double* abc_angles) -{ - const std::vector a = {vec[0], vec[1], vec[2]}; - const std::vector b = {vec[3], vec[4], vec[5]}; - const std::vector c = {vec[6], vec[7], vec[8]}; - const double anorm = std::sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); - const double bnorm = std::sqrt(b[0] * b[0] + b[1] * b[1] + b[2] * b[2]); - const double cnorm = std::sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]); - const double alpha = std::acos((b[0] * c[0] + b[1] * c[1] + b[2] * c[2]) / (bnorm * cnorm)); - const double beta = std::acos((a[0] * c[0] + a[1] * c[1] + a[2] * c[2]) / (anorm * cnorm)); - const double gamma = std::acos((a[0] * b[0] + a[1] * b[1] + a[2] * b[2]) / (anorm * bnorm)); - abc_angles[0] = anorm; - abc_angles[1] = bnorm; - abc_angles[2] = cnorm; - abc_angles[3] = rad2deg(alpha); - abc_angles[4] = rad2deg(beta); - abc_angles[5] = rad2deg(gamma); -} -void abc_angles_to_vec(const double* abc_angles, double* vec) -{ - const double a = abc_angles[0]; - const double b = abc_angles[1]; - const double c = abc_angles[2]; - const double alpha = abc_angles[3]; - const double beta = abc_angles[4]; - const double gamma = abc_angles[5]; - vec[0] = a; - vec[1] = 0.0; - vec[2] = 0.0; - vec[3] = b * std::cos(deg2rad(gamma)); - vec[4] = b * std::sin(deg2rad(gamma)); - vec[5] = 0.0; - vec[6] = c * std::cos(deg2rad(beta)); - vec[7] = c * (std::cos(deg2rad(alpha)) - std::cos(deg2rad(beta)) * std::cos(deg2rad(gamma))) / std::sin(deg2rad(gamma)); - vec[8] = std::sqrt(c * c - vec[6] * vec[6] - vec[7] * vec[7]); -} -double vec_to_volume(const double* vec) -{ - // vector's mixed product - return vec[0] * (vec[4] * vec[8] - vec[5] * vec[7]) - vec[1] * (vec[3] * vec[8] - vec[5] * vec[6]) + vec[2] * (vec[3] * vec[7] - vec[4] * vec[6]); -} -double abc_angles_to_volume(const double* abc_angles) -{ - std::vector vec(9); - abc_angles_to_vec(abc_angles, vec.data()); - return vec_to_volume(vec.data()); -} -std::vector _split_outside_enclose(const std::string& in, - const std::string& delim, - const std::vector& enclose) -{ - // a very naive impl. for only CIF possible cases - assert(enclose.size() == 2); // other complicated case not implemented yet - // first split with delim. then scan all fragments, if there are enclose symbol, then will first meet - // a fragment startswith the opening, then after fragments, there will be a one ends with closing. - // between them, fragments will be concatenated with delim. - std::vector out; - std::string cache; - std::vector words = FmtCore::split(in, delim); - bool in_enclose = false; - for (auto& word: words) - { - if (FmtCore::startswith(word, enclose[0])) - { - in_enclose = true; - cache += word + delim; - } - else if (FmtCore::endswith(word, enclose[1])) - { - in_enclose = false; - cache += word; - out.push_back(cache); - cache.clear(); - } - else - { - if (in_enclose) - { - cache += word + delim; - } - else - { - out.push_back(word); - } - } - } - return out; -} - -// the second step, for each block, split with words starting with "_" -std::vector _split_loop_block(const std::string& block) -{ - std::vector out; - std::string word, cache; - std::stringstream ss(FmtCore::strip(FmtCore::strip(block, "\n"))); - while (ss.good()) - { - ss >> word; - if (FmtCore::startswith(word, "_")) - { - if (!cache.empty()) - { - out.push_back(FmtCore::strip(cache)); - cache.clear(); - } - out.push_back(FmtCore::strip(word)); - } - else - { - cache += word + " "; - } - } - // the last word - if (!cache.empty()) - { - out.push_back(FmtCore::strip(cache)); - } - return out; -} - -std::map> _build_table(const std::vector& keys, - const std::vector& values) -{ - std::map> out; - const size_t ncols = keys.size(); - assert(values.size() % ncols == 0); - const size_t nrows = values.size() / ncols; - for (size_t i = 0; i < ncols; i++) - { - std::vector col(nrows); - for (size_t j = 0; j < nrows; j++) - { - col[j] = values[j * ncols + i]; - } - out[keys[i]] = col; - } - return out; -} - -std::map> _build_block_data(const std::vector& block) -{ - // after calling the _split_loop_block, the data now composed of elements that either startswith "_" - // or not. Between elements startswith "_", there is at most one element that does not startswith "_". - // a scan can be performed to group those keys. - std::vector> keys; - std::vector kcache; - std::vector values; - // first drop all elements that does not startswith "_" before the first element that startswith "_" - std::vector block_ = block; - auto it = std::find_if(block.begin(), block.end(), [](const std::string& s) { return FmtCore::startswith(s, "_"); }); - if (it != block.begin()) - { - block_.erase(block_.begin(), it); - } - for (auto& elem: block_) - { - if (FmtCore::startswith(elem, "_")) - { - kcache.push_back(elem); - } - else - { - keys.push_back(kcache); - values.push_back(elem); - kcache.clear(); - } - } - assert(keys.size() == values.size()); // ensure the number of keys and values are the same - // then for each elem in keys, if there are more than one element, then it is a table. Make it a table - // , otherwise it is a simple key-value pair, directly add it to the output. - std::map> out; - for (size_t i = 0; i < keys.size(); i++) - { - if (keys[i].size() > 1) - { - const std::vector words = _split_outside_enclose(values[i], " ", {"'", "'"}); - std::map> table = _build_table(keys[i], words); - out.insert(table.begin(), table.end()); - } - else - { - out[keys[i][0]] = {values[i]}; - } - } - - return out; -} - -void bcast_cifmap(std::map>& map, // the map to be broadcasted - const int rank = 0) // source rank: from which rank to broadcast -{ -#ifdef __MPI - int myrank; - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - // use Parallel_Common namespace bcast_int and bcast_string to broadcast the size of map and key, value pairs - int size = map.size(); - Parallel_Common::bcast_int(size); // seems it can only broadcast from rank 0, so presently no need to specify - // the rank to broadcast - std::vector keys(size); - std::vector> values(size); - int i = 0; - if (myrank == rank) // if the rank is the source rank, then pack the map to keys and values - { - for (auto& elem: map) - { - keys[i] = elem.first; - values[i] = elem.second; - i++; - } - } - for (int i = 0; i < size; i++) - { - Parallel_Common::bcast_string(keys[i]); - int valsize = values[i].size(); - Parallel_Common::bcast_int(valsize); - values[i].resize(valsize); - Parallel_Common::bcast_string(values[i].data(), valsize); - } - if (myrank != rank) // if the rank is not the source rank, then unpack the keys and values to map - { - map.clear(); - for (int i = 0; i < size; i++) - { - map[keys[i]] = values[i]; - } - } -#endif -} - -void ModuleIO::CifParser::_unpack_ucell(const UnitCell& ucell, - std::vector& veca, - std::vector& vecb, - std::vector& vecc, - int& natom, - std::vector& atom_site_labels, - std::vector& atom_site_fract_coords) -{ - const double bohr2angstrom = 0.52917721067; - const double lat0 = ucell.lat.lat0; - veca.resize(3); - vecb.resize(3); - vecc.resize(3); - veca[0] = ucell.a1.x; - veca[1] = ucell.a1.y; - veca[2] = ucell.a1.z; - vecb[0] = ucell.a2.x; - vecb[1] = ucell.a2.y; - vecb[2] = ucell.a2.z; - vecc[0] = ucell.a3.x; - vecc[1] = ucell.a3.y; - vecc[2] = ucell.a3.z; - std::for_each(veca.begin(), veca.end(), [lat0, bohr2angstrom](double& x) { x *= lat0 * bohr2angstrom; }); - std::for_each(vecb.begin(), vecb.end(), [lat0, bohr2angstrom](double& x) { x *= lat0 * bohr2angstrom; }); - std::for_each(vecc.begin(), vecc.end(), [lat0, bohr2angstrom](double& x) { x *= lat0 * bohr2angstrom; }); - natom = ucell.nat; - assert(natom > 0); // ensure the number of atoms is positive - atom_site_labels.resize(natom); - atom_site_fract_coords.resize(3 * natom); - for (int i = 0; i < natom; ++i) - { - atom_site_labels[i] = ucell.atoms[ucell.iat2it[i]].ncpp.psd; // the most standard label - atom_site_labels[i] = atom_site_labels[i].empty() ? ucell.atom_label[ucell.iat2it[i]]: atom_site_labels[i]; - atom_site_labels[i] = atom_site_labels[i].empty() ? ucell.atoms[ucell.iat2it[i]].label: atom_site_labels[i]; - assert(!atom_site_labels[i].empty()); // ensure the label is not empty - atom_site_fract_coords[3 * i] = ucell.atoms[ucell.iat2it[i]].taud[ucell.iat2ia[i]].x; - atom_site_fract_coords[3 * i + 1] = ucell.atoms[ucell.iat2it[i]].taud[ucell.iat2ia[i]].y; - atom_site_fract_coords[3 * i + 2] = ucell.atoms[ucell.iat2it[i]].taud[ucell.iat2ia[i]].z; - } -} - -void ModuleIO::CifParser::write(const std::string& fcif, - const double* abc_angles, - const int natom, - const std::string* atom_site_labels, - const double* atom_site_fract_coords, - const std::string& title, - const std::string& data_tag, - const int rank, - const double* atom_site_occups, - const std::string& cell_formula_units_z) -{ -#ifdef __MPI // well...very simple... - int myrank; - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - if (myrank != rank) // if present rank is not the rank assigned to write the cif file, then return - { - return; - } -#endif - std::ofstream ofs(fcif); - if (!ofs) - { - ModuleBase::WARNING_QUIT("ModuleIO::CifParser::write", "Cannot open file " + fcif); - } - ofs << title << std::endl; - ofs << data_tag << std::endl; - ofs << "_symmetry_space_group_name_H-M 'P 1'" << std::endl; - ofs << "_cell_length_a " << FmtCore::format("%12.8f", abc_angles[0]) << std::endl; - ofs << "_cell_length_b " << FmtCore::format("%12.8f", abc_angles[1]) << std::endl; - ofs << "_cell_length_c " << FmtCore::format("%12.8f", abc_angles[2]) << std::endl; - ofs << "_cell_angle_alpha " << FmtCore::format("%12.8f", abc_angles[3]) << std::endl; - ofs << "_cell_angle_beta " << FmtCore::format("%12.8f", abc_angles[4]) << std::endl; - ofs << "_cell_angle_gamma " << FmtCore::format("%12.8f", abc_angles[5]) << std::endl; - ofs << "_symmetry_Int_Tables_number 1" << std::endl; - std::string chem_sum, chem_structural; - _build_chem_formula(natom, atom_site_labels, chem_sum, chem_structural); - ofs << "_chemical_formula_structural " << chem_structural << std::endl; - ofs << "_chemical_formula_sum " << chem_sum << std::endl; - ofs << "_cell_volume " << FmtCore::format("%14.8f", abc_angles_to_volume(abc_angles)) << std::endl; - ofs << "_cell_formula_units_Z " << cell_formula_units_z << std::endl; - ofs << "loop_" << std::endl; - ofs << " _symmetry_equiv_pos_site_id" << std::endl; - ofs << " _symmetry_equiv_pos_as_xyz" << std::endl; - ofs << " 1 'x, y, z'" << std::endl; - ofs << "loop_" << std::endl; - ofs << " _atom_site_type_symbol" << std::endl; - ofs << " _atom_site_label" << std::endl; - ofs << " _atom_site_symmetry_multiplicity" << std::endl; - ofs << " _atom_site_fract_x" << std::endl; - ofs << " _atom_site_fract_y" << std::endl; - ofs << " _atom_site_fract_z" << std::endl; - ofs << " _atom_site_occupancy" << std::endl; - std::vector occups(natom, 1.0); - if (atom_site_occups != nullptr) - {// overwrite the default occupancies - std::copy(atom_site_occups, atom_site_occups + natom, occups.begin()); - } - // then output atomic information with format: %3s%4s%3d%12.8f%12.8f%12.8f%3d - FmtCore fmt("%3s %4s %3d %12.8f %12.8f %12.8f %2.1f"); - int j = 0; - std::string numbered_label; - std::string cache; - for (int i = 0; i < natom; ++i) - { - const std::string label = atom_site_labels[i]; - numbered_label = label + std::to_string(i); - cache = fmt.format(label, numbered_label, 1, - atom_site_fract_coords[j], atom_site_fract_coords[j + 1], atom_site_fract_coords[j + 2], occups[i]); - ofs << cache << std::endl; - j += 3; - } - ofs << std::endl; - ofs.close(); -} - -void ModuleIO::CifParser::write(const std::string& fcif, - const std::vector& abc_angles, - const std::vector& atom_site_labels, - const std::vector& atom_site_fract_coords, - const std::string& title, - const std::string& data_tag, - const int rank, - const std::vector& atom_site_occups, - const std::string& cell_formula_units_z) -{ -#ifdef __MPI - int myrank; - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - if (myrank != rank) // if present rank is not the rank assigned to write the cif file, then return - { - return; - } -#endif - const double* occups = atom_site_occups.empty() ? nullptr : atom_site_occups.data(); - write(fcif.c_str(), - abc_angles.data(), - atom_site_labels.size(), - atom_site_labels.data(), - atom_site_fract_coords.data(), - title, - data_tag, - rank, - occups, - cell_formula_units_z); -} - -void ModuleIO::CifParser::write(const std::string& fcif, - const UnitCell& ucell, - const std::string& title, - const std::string& data_tag, - const int rank) -{ -#ifdef __MPI - int myrank; - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - if (myrank != rank) // if present rank is not the rank assigned to write the cif file, then return - { - return; - } -#endif - std::vector veca, vecb, vecc; - int natom; - std::vector atom_site_labels; - std::vector atom_site_fract_coords; - _unpack_ucell(ucell, veca, vecb, vecc, natom, atom_site_labels, atom_site_fract_coords); - std::vector vec(9); - std::copy(veca.begin(), veca.end(), vec.begin()); - std::copy(vecb.begin(), vecb.end(), vec.begin() + 3); - std::copy(vecc.begin(), vecc.end(), vec.begin() + 6); - std::vector abc_angles(6); - vec_to_abc_angles(vec.data(), abc_angles.data()); - write(fcif.c_str(), abc_angles.data(), natom, atom_site_labels.data(), atom_site_fract_coords.data(), title, data_tag); -} - -// reading cif is another hard (physically) and laborious work. The cif sometimes can be easily read line by line, -// sometimes word by word. The structure of cif file is, except the line startswith "#", all other lines can be split -// by blocks leading by "loop_", then in each "loop_", there are contents can be split by those keywords that -// startswith "_". There is also another exception that, if there is no space between keywords, then their values will -// appear after all keywords are listed. In this case, all values actually form a table, which is needed to be -// furtherly formatted (rows are memory-contiguous). -// Thus the reading strategy are, -// 1. first split the file into blocks by "loop_" -// 2. in each block, split with words starting with "_" -// 3. scan the splited words - -void ModuleIO::CifParser::read(const std::string& fcif, - std::map>& out, - const int rank) -{ - // okey for read, cannot just use if rank != 0 then return, because need to broadcast the map - out.clear(); -#ifdef __MPI - int myrank; - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - if (myrank == rank) // only the rank assigned to read the cif file will read the file - { -#endif - std::ifstream ifs(fcif); - if (!ifs) - { - ModuleBase::WARNING_QUIT("ModuleIO::CifParser::read", "Cannot open file " + fcif); - } - std::string cache; // first read all lines into cache - while (ifs.good()) - { - std::string line; - std::getline(ifs, line); - if (FmtCore::startswith(FmtCore::strip(line), "#")) - { - out["comment"].push_back(line); - } - else if (FmtCore::startswith(FmtCore::strip(line), "data_")) - { - out["data_tag"].push_back(line); - } - else - { - cache += line + " "; - } - } - std::vector blocks = FmtCore::split(FmtCore::strip(cache), "loop_"); - blocks.erase(std::remove_if(blocks.begin(), blocks.end(), [](const std::string& s) { return s.empty(); }), blocks.end()); - - for (auto& block: blocks) - { - std::vector words = _split_loop_block(block); - std::map> data = _build_block_data(words); - out.insert(data.begin(), data.end()); - } -#ifdef __MPI - } - bcast_cifmap(out, rank); -#endif -} - -ModuleIO::CifParser::CifParser(const std::string& fcif) -{ - read(fcif, raw_); -} - -std::vector ModuleIO::CifParser::get(const std::string& key) -{ - if (raw_.find(key) != raw_.end()) - { - return raw_[key]; - } - else - { - return std::vector(); - } -} diff --git a/source/module_io/cif_io.h b/source/module_io/cif_io.h deleted file mode 100644 index 0e70aa99be..0000000000 --- a/source/module_io/cif_io.h +++ /dev/null @@ -1,194 +0,0 @@ -#ifndef MODULE_IO_CIF_IO_H -#define MODULE_IO_CIF_IO_H -#include "source_cell/unitcell.h" -#include -#include -#include - -namespace ModuleIO -{ -/** - * # CifParser - * ## INTRODUCTION - * ### In short - * Tools for CIF file I/O. - * - * ### Supported structure of CIF - * A example (official template of CIF) is shown here (https://www.iucr.org/__data/iucr/ftp/pub/form.cif), - * but present impl. is ONLY capable to parse a CIF with ONE structure. If there are multiple structures - * in the CIF file, unexpected behavior may occur. - * - * A CIF file always contain two kinds of data structure, the first is simply the key-value pair, the second - * is table which is lead by a keyword "loop_". - * - * #### Key-value pair - * key-value pair can have two types: - * - * Type 1: the most general - * _KEY1 VALUE1 - * _KEY2 VALUE2 - * ... - * Type 2: text box - * _KEY1 - * ; - * very long text - * VeRy LoNg TeXt - * ... - * ; - * - * #### Table - * The table in CIF must be lead by a keyword "loop_", and all titles of the columns will be list first, - * then all the rest are the values of the table. For example: - * loop_ - * _KEY1 - * _KEY2 - * _KEY3 - * ... - * VALUE11 VALUE21 VALUE31 - * VALUE12 VALUE22 VALUE32 - * ... - * Once the number of values cannot be divided by the number of keys, will cause an assertion error. - * - * - * ## Usage of this "class" - * ### Read CIF file and store the information in a map - * type the following line: - * std::map> cif_info; - * ModuleIO::CifParser::read("test.cif", cif_info); - * - * Information of the cif file will stored in key-value pair manner, like - * cif_info["_cell_length_a"] = {"2.46772428"}; - * cif_info["_cell_length_b"] = {"2.46772428"}; - * ... - * cif_info["_atom_site_label"] = {"C1", "C2", ...}; - * cif_info["_atom_site_fract_x"] = {"0.00000000", "0.33333300", ...}; - * ... - * NOTE1: only keys in table will have value with length larger than 1, otherwise all words will be - * saved in the only element in std::vector. For example please see unittest of this - * class at source/module_io/test/cif_io_test.cpp. - * NOTE2: One should note that for some cif files, the number will be in the format like - * "0.00000000(1)", which means the uncertainty of the number is 1 in the last digit. - * In this case, user should be careful to convert the string to double by its own. - * - * ### Write CIF file with the given information. - * ModuleIO::CifParser::write("test.cif", ...); - * For detailed usage, see the static methods in the class. A to-be-deprecated usage is - * simple as: - * ModuleIO::CifParser cif("test.cif", ucell); - * , where ucell is an instance of UnitCell. This usage is not encouraged. - * - * ## Pythonization information - * 1. function write - * it is recommended to pythonize the 2nd overload of this function, the 3rd one will be - * deprecated in the future. - * 2. function read - * this function can be directly pythonized. - */ - class CifParser - { - public: - CifParser() = delete; // I cannot see any necessity to have a default constructor - CifParser(const std::string& fcif); // read the cif file and store the information - ~CifParser() {} // actually do not need to do anything explicitly - - /** - * @brief Print the CIF file from the given information. - * - * @param fcif the output cif file name - * @param abc_angles cell A B C angles in the form of [a, b, c, alpha, beta, gamma] - * @param natom the number of atoms - * @param atom_site_labels the atom site labels in the form of [atom1, atom2, ...] - * @param atom_site_fract_coords the fractional coordinates of the atoms in the form of [x1, y1, z1, x2, y2, z2, ...] - * @param title the title of the CIF file - * @param data_tag the data tag of the CIF file - * @param rank the rank which writes the CIF file - * @param atom_site_occups the occupancies of the atoms in the form of [occup1, occup2, ...] - * @param cell_formula_units_z the cell formula units Z - */ - static void write(const std::string& fcif, - const double* abc_angles, - const int natom, - const std::string* atom_site_labels, // the one without numbers - const double* atom_site_fract_coords, - const std::string& title = "# generated by ABACUS", - const std::string& data_tag = "data_?", - const int rank = 0, - const double* atom_site_occups = nullptr, // may be this will be useful after impementation of VCA? - const std::string& cell_formula_units_z = "1"); - /** - * @brief A Pybind wrapper for the static method write. - * - * @param fcif the output cif file name - * @param abc_angles cell A B C angles in the form of [a, b, c, alpha, beta, gamma] - * @param atom_site_labels the atom site labels in the form of [atom1, atom2, ...] - * @param atom_site_fract_coords the fractional coordinates of the atoms in the form of [x1, y1, z1, x2, y2, z2, ...] - * @param title the title of the CIF file - * @param data_tag the data tag of the CIF file - * @param rank the rank which writes the CIF file - * @param atom_site_occups the occupancies of the atoms in the form of [occup1, occup2, ...] - * @param cell_formula_units_z the cell formula units Z - */ - static void write(const std::string& fcif, - const std::vector& abc_angles, - const std::vector& atom_site_labels, // the one without numbers - const std::vector& atom_site_fract_coords, - const std::string& title = "# generated by ABACUS", - const std::string& data_tag = "data_?", - const int rank = 0, - const std::vector& atom_site_occups = {}, // may be this will be useful after impementation of VCA? - const std::string& cell_formula_units_z = "1"); - // the version with both spacegroup symmetry and point group symmetry ready - // not for now, because it is too complicated. However it is a walk-around - // way to fix issue #4998 - // static void write(); - - /** - * @brief Write CIF file with the whole UnitCell instance - * - * @param fcif the output cif file name - * @param ucell the input UnitCell instance - * @param title the title of the CIF file - * @param data_tag the data tag of the CIF file - * @param rank the rank which writes the CIF file - */ - static void write(const std::string& fcif, - const UnitCell& ucell, - const std::string& title = "# generated by ABACUS", - const std::string& data_tag = "data_?", - const int rank = 0); - /** - * @brief Read the CIF file and store the information in the map. - * - * @param fcif the input cif file name - * @param out the output map containing the information - * @param rank the rank which reads the CIF file - */ - static void read(const std::string& fcif, - std::map>& out, - const int rank = 0); - - /** - * @brief get information by key from the stored information of cif file, if the key is not found, - * an empty vector will be returned. - * - * @param key the key to search - * @return std::vector. Only columns in table will have more than one element, otherwise - * all the information will be stored in the only element (the first). - */ - std::vector get(const std::string& key); - - private: - // interface to ABACUS UnitCell impl. - static void _unpack_ucell(const UnitCell& ucell, // because ucell is too heavy... - std::vector& veca, - std::vector& vecb, - std::vector& vecc, - int& natom, - std::vector& atom_site_labels, - std::vector& atom_site_fract_coords); - - // stores the information of the cif file - std::map> raw_; - }; -} // namespace ModuleIO -#endif // MODULE_IO_CIF_IO_H \ No newline at end of file diff --git a/source/module_io/csr_reader.cpp b/source/module_io/csr_reader.cpp deleted file mode 100644 index 160cb78a61..0000000000 --- a/source/module_io/csr_reader.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "csr_reader.h" - -#include "source_base/tool_quit.h" - -namespace ModuleIO -{ - -// constructor -template -csrFileReader::csrFileReader(const std::string& filename) : FileReader(filename) -{ - parseFile(); -} - -// function to parse file -template -void csrFileReader::parseFile() -{ - // Check if file is open - if (!isOpen()) - { - ModuleBase::WARNING_QUIT("csrFileReader::parseFile", "File is not open"); - } - - std::string tmp_string; - - // Read the step - readLine(); - ss >> tmp_string >> step; - - // Read the matrix dimension - readLine(); - ss >> tmp_string >> tmp_string >> tmp_string >> tmp_string >> matrixDimension; - - // Read the number of R - readLine(); - ss >> tmp_string >> tmp_string >> tmp_string >> tmp_string >> numberOfR; - - // Read the matrices - for (int i = 0; i < numberOfR; i++) - { - std::vector RCoord(3); - int nonZero; - - readLine(); - ss >> RCoord[0] >> RCoord[1] >> RCoord[2] >> nonZero; - RCoordinates.push_back(RCoord); - - std::vector csr_values(nonZero); - std::vector csr_col_ind(nonZero); - std::vector csr_row_ptr(matrixDimension + 1); - - // read CSR values - readLine(); - for (int i = 0; i < nonZero; i++) - { - ss >> csr_values[i]; - } - // read column indices - readLine(); - for (int i = 0; i < nonZero; i++) - { - ss >> csr_col_ind[i]; - } - // read row pointers - readLine(); - for (int i = 0; i < matrixDimension + 1; i++) - { - ss >> csr_row_ptr[i]; - } - - SparseMatrix matrix(matrixDimension, matrixDimension); - matrix.readCSR(csr_values, csr_col_ind, csr_row_ptr); - sparse_matrices.push_back(matrix); - } -} - -// function to get R coordinate -template -std::vector csrFileReader::getRCoordinate(int index) const -{ - if (index < 0 || index >= RCoordinates.size()) - { - ModuleBase::WARNING_QUIT("csrFileReader::getRCoordinate", "Index out of range"); - } - return RCoordinates[index]; -} - -// function to get matrix -template -SparseMatrix csrFileReader::getMatrix(int index) const -{ - if (index < 0 || index >= sparse_matrices.size()) - { - ModuleBase::WARNING_QUIT("csrFileReader::getMatrix", "Index out of range"); - } - return sparse_matrices[index]; -} - -// function to get matrix using R coordinate -template -SparseMatrix csrFileReader::getMatrix(int Rx, int Ry, int Rz) -{ - for (int i = 0; i < RCoordinates.size(); i++) - { - if (RCoordinates[i][0] == Rx && RCoordinates[i][1] == Ry && RCoordinates[i][2] == Rz) - { - return sparse_matrices[i]; - } - } - ModuleBase::WARNING_QUIT("csrFileReader::getMatrix", "R coordinate not found"); -} - -// function to get matrix -template -int csrFileReader::getNumberOfR() const -{ - return numberOfR; -} - -// function to get matrixDimension -template -int csrFileReader::getMatrixDimension() const -{ - return matrixDimension; -} - -// function to get step -template -int csrFileReader::getStep() const -{ - return step; -} - -// T of AtomPair can be double -template class csrFileReader; -// ToDo: T of AtomPair can be std::complex -template class csrFileReader>; - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/csr_reader.h b/source/module_io/csr_reader.h deleted file mode 100644 index 15adf75427..0000000000 --- a/source/module_io/csr_reader.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef CSR_READER_H -#define CSR_READER_H - -#include - -#include "file_reader.h" -#include "sparse_matrix.h" - -namespace ModuleIO -{ - -/** - * @brief Class to read CSR file - * @details This class is used to read CSR file - * the default format is like: - * ``` - * STEP: 0 - * Matrix Dimension of S(R): 4 - * Matrix number of S(R): 2 - * 0 1 1 2 # (0,1,1) is the R coordinate, 2 is the number of non-zero elements - * 4.00e+00 7.00e+00 # non-zero elements - * 3 2 # column indices - * 0 1 2 2 2 # row pointer - * 0 0 0 3 # the second R coordinate and number of non-zero elements - * 5.00e+00 6.00e+00 1.00e+01 - * 2 3 3 - * 0 0 0 2 3 - * ``` - * It will store the R coordinates and sparse matrices as two vectors. - * One can use getter functions to get the R coordinates and sparse matrices, - * and related info including step, matrix dimension, number of R. - */ -template -class csrFileReader : public FileReader -{ - public: - // Constructor - csrFileReader(const std::string& filename); - - // read all matrices of all R coordinates - void parseFile(); - - // get number of R - int getNumberOfR() const; - - // get sparse matrix of a specific R coordinate - SparseMatrix getMatrix(int Rx, int Ry, int Rz); - - // get matrix by using index - SparseMatrix getMatrix(int index) const; - - // get R coordinate using index - std::vector getRCoordinate(int index) const; - - // get step - int getStep() const; - - // get matrix dimension - int getMatrixDimension() const; - - private: - std::vector> RCoordinates; - std::vector> sparse_matrices; - int step; - int matrixDimension; - int numberOfR; -}; - -} // namespace ModuleIO - -#endif // READ_CSR_H \ No newline at end of file diff --git a/source/module_io/ctrl_output_fp.cpp b/source/module_io/ctrl_output_fp.cpp deleted file mode 100644 index 9bae1f7888..0000000000 --- a/source/module_io/ctrl_output_fp.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include "module_io/ctrl_output_fp.h" // use ctrl_output_fp() - -namespace ModuleIO -{ - -template -void ctrl_output_fp(UnitCell& ucell, - elecstate::ElecStateLCAO* pelec, - const int istep) -{ - ModuleBase::TITLE("ModuleIO", "ctrl_output_fp"); - ModuleBase::timer::tick("ModuleIO", "ctrl_output_fp"); - - const bool out_app_flag = PARAM.inp.out_app_flag; - const bool gamma_only = PARAM.globalv.gamma_only_local; - const int nspin = PARAM.inp.nspin; - const std::string global_out_dir = PARAM.globalv.global_out_dir; - - // 1) write charge density - if (PARAM.inp.out_chg[0] > 0) - { - for (int is = 0; is < PARAM.inp.nspin; is++) - { - this->pw_rhod->real2recip(this->chr.rho_save[is], this->chr.rhog_save[is]); - std::string fn =PARAM.globalv.global_out_dir + "/chgs" + std::to_string(is + 1) + ".cube"; - ModuleIO::write_vdata_palgrid(Pgrid, - this->chr.rho_save[is], - is, - PARAM.inp.nspin, - istep, - fn, - this->pelec->eferm.get_efval(is), - &(ucell), - PARAM.inp.out_chg[1], - 1); - - if (XC_Functional::get_ked_flag()) - { - fn =PARAM.globalv.global_out_dir + "/taus" + std::to_string(is + 1) + ".cube"; - ModuleIO::write_vdata_palgrid(Pgrid, - this->chr.kin_r_save[is], - is, - PARAM.inp.nspin, - istep, - fn, - this->pelec->eferm.get_efval(is), - &(ucell)); - } - } - } - - - // 2) write potential - if (PARAM.inp.out_pot == 1 || PARAM.inp.out_pot == 3) - { - for (int is = 0; is < PARAM.inp.nspin; is++) - { - std::string fn =PARAM.globalv.global_out_dir + "/pots" + std::to_string(is + 1) + ".cube"; - - ModuleIO::write_vdata_palgrid(Pgrid, - this->pelec->pot->get_effective_v(is), - is, - PARAM.inp.nspin, - istep, - fn, - 0.0, // efermi - &(ucell), - 3, // precision - 0); // out_fermi - } - } - else if (PARAM.inp.out_pot == 2) - { - std::string fn =PARAM.globalv.global_out_dir + "/pot_es.cube"; - ModuleIO::write_elecstat_pot( -#ifdef __MPI - this->pw_big->bz, - this->pw_big->nbz, -#endif - fn, - istep, - this->pw_rhod, - &this->chr, - &(ucell), - this->pelec->pot->get_fixed_v(), - this->solvent); - } - - - // 3) write ELF - if (PARAM.inp.out_elf[0] > 0) - { - this->chr.cal_elf = true; - Symmetry_rho srho; - for (int is = 0; is < PARAM.inp.nspin; is++) - { - srho.begin(is, this->chr, this->pw_rhod, ucell.symm); - } - - std::string out_dir =PARAM.globalv.global_out_dir; - ModuleIO::write_elf( -#ifdef __MPI - this->pw_big->bz, - this->pw_big->nbz, -#endif - out_dir, - istep, - PARAM.inp.nspin, - this->chr.rho, - this->chr.kin_r, - this->pw_rhod, - this->Pgrid, - &(ucell), - PARAM.inp.out_elf[1]); - } - - ModuleBase::timer::tick("ModuleIO", "ctrl_output_fp"); -} - -} // End ModuleIO - - -// For gamma only -template void ModuleIO::ctrl_output_lcao(UnitCell& ucell, - const int istep); - -// For multiple k-points -template void ModuleIO::ctrl_output_lcao, double>(UnitCell& ucell, - const int istep); - -template void ModuleIO::ctrl_output_lcao, std::complex>(UnitCell& ucell, - const int istep); - diff --git a/source/module_io/ctrl_output_fp.h b/source/module_io/ctrl_output_fp.h deleted file mode 100644 index 98a4ad1f6d..0000000000 --- a/source/module_io/ctrl_output_fp.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef CTRL_OUTPUT_FP_H -#define CTRL_OUTPUT_FP_H - -namespace ModuleIO -{ - template - void ctrl_output_fp(UnitCell& ucell, - elecstate::ElecStateLCAO* pelec, - const int istep); -} -#endif diff --git a/source/module_io/ctrl_output_lcao.cpp b/source/module_io/ctrl_output_lcao.cpp deleted file mode 100644 index f7bff57de7..0000000000 --- a/source/module_io/ctrl_output_lcao.cpp +++ /dev/null @@ -1,514 +0,0 @@ -#include - -#include "source_estate/elecstate_lcao.h" // use elecstate::ElecState -#include "module_io/ctrl_output_lcao.h" // use ctrl_output_lcao() -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" // use hamilt::HamiltLCAO -#include "source_hamilt/hamilt.h" // use Hamilt - -// functions -#include "module_io/write_dos_lcao.h" // use ModuleIO::write_dos_lcao() -#include "module_io/write_dmr.h" // use ModuleIO::write_dmr() -#include "module_io/io_dmk.h" // use ModuleIO::write_dmk() -#include "module_io/write_HS.h" // use ModuleIO::write_hsk() -#include "module_io/write_wfc_nao.h" // use ModuleIO::write_wfc_nao() -#include "module_io/output_mat_sparse.h" // use ModuleIO::output_mat_sparse() -#include "module_io/output_mulliken.h" // use cal_mag() -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h" // use hamilt::EkineticNew -#include "module_io/cal_pLpR.h" // use AngularMomentumCalculator() -#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" // use spinconstrain::SpinConstrain -#include "module_io/berryphase.h" // use berryphase -#include "module_io/to_wannier90_lcao.h" // use toWannier90_LCAO -#include "module_io/to_wannier90_lcao_in_pw.h" // use toWannier90_LCAO_IN_PW -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "module_hamilt_lcao/module_deepks/LCAO_deepks_interface.h" -#endif -#ifdef __EXX -#include "module_ri/Exx_LRI_interface.h" // use EXX codes -#include "module_ri/RPA_LRI.h" // use RPA code -#endif -#include "module_rdmft/rdmft.h" // use RDMFT codes -#include "module_io/to_qo.h" // use toQO - -namespace ModuleIO -{ - -template -void ctrl_output_lcao(UnitCell& ucell, - K_Vectors& kv, - elecstate::ElecStateLCAO* pelec, - Parallel_Orbitals& pv, - Grid_Driver& gd, - psi::Psi* psi, - hamilt::HamiltLCAO* p_hamilt, - TwoCenterBundle &two_center_bundle, - Gint_k &gk, - LCAO_Orbitals &orb, - const ModulePW::PW_Basis_K* pw_wfc, // for berryphase - const ModulePW::PW_Basis* pw_rho, // for berryphase - Grid_Technique >, // for berryphase - const ModulePW::PW_Basis_Big* pw_big, // for Wannier90 - const Structure_Factor& sf, // for Wannier90 - rdmft::RDMFT &rdmft_solver, // for RDMFT -#ifdef __MLALGO - LCAO_Deepks& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface& exd, - Exx_LRI_Interface>& exc, -#endif - const int istep) -{ - ModuleBase::TITLE("ModuleIO", "ctrl_output_lcao"); - ModuleBase::timer::tick("ModuleIO", "ctrl_output_lcao"); - - const bool out_app_flag = PARAM.inp.out_app_flag; - const bool gamma_only = PARAM.globalv.gamma_only_local; - const int nspin = PARAM.inp.nspin; - const std::string global_out_dir = PARAM.globalv.global_out_dir; - - //------------------------------------------------------------------ - // print out density of states (DOS) - //------------------------------------------------------------------ - if (PARAM.inp.out_dos) - { - ModuleIO::write_dos_lcao(psi, - p_hamilt, - pv, - ucell, - kv, - PARAM.inp.nbands, - pelec->eferm, - pelec->ekb, - pelec->wg, - PARAM.inp.dos_edelta_ev, - PARAM.inp.dos_scale, - PARAM.inp.dos_sigma, - out_app_flag, - istep, - GlobalV::ofs_running); - } - - //------------------------------------------------------------------ - //! 1) Output density matrix DM(R) - //------------------------------------------------------------------ - if(PARAM.inp.out_dmr) - { - const auto& dmr_vector = pelec->get_DM()->get_DMR_vector(); - ModuleIO::write_dmr(dmr_vector, pv, out_app_flag, - ucell.get_iat2iwt(), ucell.nat, istep); - } - - //------------------------------------------------------------------ - //! 2) Output density matrix DM(k) - //------------------------------------------------------------------ - if (PARAM.inp.out_dmk) - { - std::vector efermis(nspin == 2 ? 2 : 1); - for (int ispin = 0; ispin < efermis.size(); ispin++) - { - efermis[ispin] = pelec->eferm.get_efval(ispin); - } - const int precision = 3; - ModuleIO::write_dmk(pelec->get_DM()->get_DMK_vector(), - precision, efermis, &(ucell), pv); - } - - //------------------------------------------------------------------ - // 3) Output H(k) and S(k) matrices for each k-point - //------------------------------------------------------------------ - if (PARAM.inp.out_mat_hs[0]) - { - ModuleIO::write_hsk(global_out_dir, - nspin, - kv.get_nks(), - kv.get_nkstot(), - kv.ik2iktot, - kv.isk, - p_hamilt, - pv, - gamma_only, - out_app_flag, - istep, - GlobalV::ofs_running); - } - - //------------------------------------------------------------------ - // 4) Output electronic wavefunctions Psi(k) - //------------------------------------------------------------------ - if (elecstate::ElecStateLCAO::out_wfc_lcao) - { - ModuleIO::write_wfc_nao(elecstate::ElecStateLCAO::out_wfc_lcao, - out_app_flag, - psi[0], - pelec->ekb, - pelec->wg, - kv.kvec_c, - kv.ik2iktot, - kv.get_nkstot(), - pv, - nspin, - istep); - } - - //------------------------------------------------------------------ - //! 5) Output DeePKS information - //------------------------------------------------------------------ -#ifdef __MLALGO - // need control parameter - hamilt::HamiltLCAO* p_ham_deepks = p_hamilt; - std::shared_ptr> ld_shared_ptr(&ld, [](LCAO_Deepks*) {}); - LCAO_Deepks_Interface deepks_interface(ld_shared_ptr); - - deepks_interface.out_deepks_labels(pelec->f_en.etot, - kv.get_nks(), - ucell.nat, - PARAM.globalv.nlocal, - pelec->ekb, - kv.kvec_d, - ucell, - orb, - gd, - &pv, - *psi, - pelec->get_DM(), - p_ham_deepks, - -1, // -1 when called in after scf - true, // no used when after scf - GlobalV::MY_RANK, - GlobalV::ofs_running); -#endif - - //------------------------------------------------------------------ - //! 6) Output matrices, where O can be chosen as - //! H, S, dH, dS, T, r. The format is CSR format. - //------------------------------------------------------------------ - hamilt::Hamilt* p_ham_tk = static_cast*>(p_hamilt); - - ModuleIO::output_mat_sparse(PARAM.inp.out_mat_hs2, - PARAM.inp.out_mat_dh, - PARAM.inp.out_mat_ds, - PARAM.inp.out_mat_t, - PARAM.inp.out_mat_r, - istep, - pelec->pot->get_effective_v(), - pv, - gk, - two_center_bundle, - orb, - ucell, - gd, - kv, - p_ham_tk); - - //------------------------------------------------------------------ - //! 7) Output kinetic matrix - //------------------------------------------------------------------ - if (PARAM.inp.out_mat_tk[0]) - { - hamilt::HS_Matrix_K hsk(&pv, true); - hamilt::HContainer hR(&pv); - hamilt::Operator* ekinetic - = new hamilt::EkineticNew>(&hsk, - kv.kvec_d, - &hR, - &ucell, - orb.cutoffs(), - &gd, - two_center_bundle.kinetic_orb.get()); - - const int nspin_k = (nspin == 2 ? 2 : 1); - for (int ik = 0; ik < kv.get_nks() / nspin_k; ++ik) - { - ekinetic->init(ik); - - const int out_label = 1; // 1: .txt, 2: .dat - - std::string t_fn = ModuleIO::filename_output(global_out_dir, - "tk","nao",ik,kv.ik2iktot, - PARAM.inp.nspin,kv.get_nkstot(), - out_label,out_app_flag, - gamma_only,istep); - - ModuleIO::save_mat(istep, - hsk.get_hk(), - PARAM.globalv.nlocal, - false, // bit - PARAM.inp.out_mat_tk[1], - 1, // true for upper triangle matrix - PARAM.inp.out_app_flag, - t_fn, - pv, - GlobalV::DRANK); - } - - delete ekinetic; - } - - //------------------------------------------------------------------ - //! 8) Output expectation of angular momentum operator - //------------------------------------------------------------------ - if (PARAM.inp.out_mat_l[0]) - { - ModuleIO::AngularMomentumCalculator mylcalculator( - PARAM.inp.orbital_dir, - ucell, - PARAM.inp.search_radius, - PARAM.inp.test_deconstructor, - PARAM.inp.test_grid, - PARAM.inp.test_atom_input, - PARAM.globalv.search_pbc, - &GlobalV::ofs_running, - GlobalV::MY_RANK - ); - mylcalculator.calculate(PARAM.inp.suffix, - global_out_dir, - ucell, - PARAM.inp.out_mat_l[1], - GlobalV::MY_RANK); - } - - //------------------------------------------------------------------ - //! 9) Output Mulliken charge - //------------------------------------------------------------------ - if (PARAM.inp.out_mul) - { - ModuleIO::cal_mag(&pv, - p_hamilt, - kv, - pelec, - two_center_bundle, - orb, - ucell, - gd, - istep, - true); - } - - //------------------------------------------------------------------ - //! 10) Output atomic magnetization by using 'spin_constraint' - //------------------------------------------------------------------ - if (PARAM.inp.sc_mag_switch) - { - spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); - sc.cal_mi_lcao(istep); - sc.print_Mi(GlobalV::ofs_running); - sc.print_Mag_Force(GlobalV::ofs_running); - } - - //------------------------------------------------------------------ - //! 11) Output Berry phase - //------------------------------------------------------------------ - if (PARAM.inp.calculation == "nscf" && berryphase::berry_phase_flag && ModuleSymmetry::Symmetry::symm_flag != 1) - { - std::cout << FmtCore::format("\n * * * * * *\n << Start %s.\n", "Berry phase calculation"); - berryphase bp(&pv); - bp.lcao_init(ucell, gd, kv, gt, orb); - // additional step before calling macroscopic_polarization - bp.Macroscopic_polarization(ucell, pw_wfc->npwk_max, psi, pw_rho, pw_wfc, kv); - std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Berry phase calculation"); - } - - //------------------------------------------------------------------ - //! 12) Wannier90 interface in LCAO basis - // added by jingan in 2018.11.7 - //------------------------------------------------------------------ - if (PARAM.inp.calculation == "nscf" && PARAM.inp.towannier90) - { - std::cout << FmtCore::format("\n * * * * * *\n << Start %s.\n", "Wave function to Wannier90"); - if (PARAM.inp.wannier_method == 1) - { - toWannier90_LCAO_IN_PW wan(PARAM.inp.out_wannier_mmn, - PARAM.inp.out_wannier_amn, - PARAM.inp.out_wannier_unk, - PARAM.inp.out_wannier_eig, - PARAM.inp.out_wannier_wvfn_formatted, - PARAM.inp.nnkpfile, - PARAM.inp.wannier_spin); - wan.set_tpiba_omega(ucell.tpiba, ucell.omega); - wan.calculate(ucell,pelec->ekb,pw_wfc,pw_big, - sf,kv,psi,&pv); - } - else if (PARAM.inp.wannier_method == 2) - { - toWannier90_LCAO wan(PARAM.inp.out_wannier_mmn, - PARAM.inp.out_wannier_amn, - PARAM.inp.out_wannier_unk, - PARAM.inp.out_wannier_eig, - PARAM.inp.out_wannier_wvfn_formatted, - PARAM.inp.nnkpfile, - PARAM.inp.wannier_spin, - orb); - - wan.calculate(ucell, gd, pelec->ekb, kv, *psi, &pv); - } - std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Wave function to Wannier90"); - } - - -#ifdef __EXX - //------------------------------------------------------------------ - //! 13) Output Hexx matrix in LCAO basis - // (see `out_chg` in docs/advanced/input_files/input-main.md) - //------------------------------------------------------------------ - if (PARAM.inp.out_chg[0]) - { - if (GlobalC::exx_info.info_global.cal_exx && PARAM.inp.calculation != "nscf") // Peize Lin add if 2022.11.14 - { - const std::string file_name_exx = global_out_dir - + "HexxR" + std::to_string(GlobalV::MY_RANK); - if (GlobalC::exx_info.info_ri.real_number) - { - ModuleIO::write_Hexxs_csr(file_name_exx, ucell, exd.get_Hexxs()); - } - else - { - ModuleIO::write_Hexxs_csr(file_name_exx, ucell, exc.get_Hexxs()); - } - } - } - - //------------------------------------------------------------------ - //! 14) Write RPA information in LCAO basis - //------------------------------------------------------------------ - if (PARAM.inp.rpa) - { - RPA_LRI rpa_lri_double(GlobalC::exx_info.info_ri); - rpa_lri_double.cal_postSCF_exx(*dynamic_cast*>(pelec)->get_DM(), - MPI_COMM_WORLD, - ucell, - kv, - orb); - rpa_lri_double.init(MPI_COMM_WORLD, kv, orb.cutoffs()); - rpa_lri_double.out_for_RPA(ucell, pv, *psi, pelec); - } -#endif - - //------------------------------------------------------------------ - //! 18) Perform RDMFT calculations, added by jghan, 2024-10-17 - //------------------------------------------------------------------ - if (PARAM.inp.rdmft == true) - { - ModuleBase::matrix occ_num(pelec->wg); - for (int ik = 0; ik < occ_num.nr; ++ik) - { - for (int inb = 0; inb < occ_num.nc; ++inb) - { - occ_num(ik, inb) /= kv.wk[ik]; - } - } - rdmft_solver.update_elec(ucell, occ_num, *psi); - - //! initialize the gradients of Etotal with respect to occupation numbers and wfc, - //! and set all elements to 0. - //! dedocc = d E/d Occ_Num - ModuleBase::matrix dedocc(pelec->wg.nr, pelec->wg.nc, true); - - //! dedwfc = d E/d wfc - psi::Psi dedwfc(psi->get_nk(), psi->get_nbands(), psi->get_nbasis(), kv.ngk, true); - dedwfc.zero_out(); - - double etot_rdmft = rdmft_solver.run(dedocc, dedwfc); - } - - //------------------------------------------------------------------ - //! Output quasi orbitals - //------------------------------------------------------------------ - if (PARAM.inp.qo_switch) - { - toQO tqo(PARAM.inp.qo_basis, PARAM.inp.qo_strategy, PARAM.inp.qo_thr, PARAM.inp.qo_screening_coeff); - tqo.initialize(global_out_dir, - PARAM.inp.pseudo_dir, - PARAM.inp.orbital_dir, - &ucell, - kv.kvec_d, - GlobalV::ofs_running, - GlobalV::MY_RANK, - GlobalV::NPROC); - tqo.calculate(); - } - - - ModuleBase::timer::tick("ModuleIO", "ctrl_output_lcao"); -} - -} // End ModuleIO - - -// For gamma only -template void ModuleIO::ctrl_output_lcao(UnitCell& ucell, - K_Vectors& kv, - elecstate::ElecStateLCAO* pelec, - Parallel_Orbitals& pv, - Grid_Driver& gd, - psi::Psi* psi, - hamilt::HamiltLCAO* p_hamilt, - TwoCenterBundle &two_center_bundle, - Gint_k &gk, - LCAO_Orbitals &orb, - const ModulePW::PW_Basis_K* pw_wfc, // for berryphase - const ModulePW::PW_Basis* pw_rho, // for berryphase - Grid_Technique >, // for berryphase - const ModulePW::PW_Basis_Big* pw_big, // for Wannier90 - const Structure_Factor& sf, // for Wannier90 - rdmft::RDMFT &rdmft_solver, // for RDMFT -#ifdef __MLALGO - LCAO_Deepks& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface& exd, - Exx_LRI_Interface>& exc, -#endif - const int istep); - -// For multiple k-points -template void ModuleIO::ctrl_output_lcao, double>(UnitCell& ucell, - K_Vectors& kv, - elecstate::ElecStateLCAO>* pelec, - Parallel_Orbitals& pv, - Grid_Driver& gd, - psi::Psi>* psi, - hamilt::HamiltLCAO, double>* p_hamilt, - TwoCenterBundle &two_center_bundle, - Gint_k &gk, - LCAO_Orbitals &orb, - const ModulePW::PW_Basis_K* pw_wfc, // for berryphase - const ModulePW::PW_Basis* pw_rho, // for berryphase - Grid_Technique >, // for berryphase - const ModulePW::PW_Basis_Big* pw_big, // for Wannier90 - const Structure_Factor& sf, // for Wannier90 - rdmft::RDMFT, double> &rdmft_solver, // for RDMFT -#ifdef __MLALGO - LCAO_Deepks>& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface, double>& exd, - Exx_LRI_Interface, std::complex>& exc, -#endif - const int istep); - -template void ModuleIO::ctrl_output_lcao, std::complex>(UnitCell& ucell, - K_Vectors& kv, - elecstate::ElecStateLCAO>* pelec, - Parallel_Orbitals& pv, - Grid_Driver& gd, - psi::Psi>* psi, - hamilt::HamiltLCAO, std::complex>* p_hamilt, - TwoCenterBundle &two_center_bundle, - Gint_k &gk, - LCAO_Orbitals &orb, - const ModulePW::PW_Basis_K* pw_wfc, // for berryphase - const ModulePW::PW_Basis* pw_rho, // for berryphase - Grid_Technique >, // for berryphase - const ModulePW::PW_Basis_Big* pw_big, // for Wannier90 - const Structure_Factor& sf, // for Wannier90 - rdmft::RDMFT, std::complex> &rdmft_solver, // for RDMFT -#ifdef __MLALGO - LCAO_Deepks>& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface, double>& exd, - Exx_LRI_Interface, std::complex>& exc, -#endif - const int istep); - diff --git a/source/module_io/ctrl_output_lcao.h b/source/module_io/ctrl_output_lcao.h deleted file mode 100644 index 75a565225a..0000000000 --- a/source/module_io/ctrl_output_lcao.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef CTRL_OUTPUT_LCAO_H -#define CTRL_OUTPUT_LCAO_H - -#include - -#include "source_cell/unitcell.h" // use UnitCell -#include "source_cell/klist.h" // use K_Vectors -#include "source_estate/elecstate_lcao.h" // use elecstate::ElecStateLCAO -#include "source_psi/psi.h" // use Psi -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" // use hamilt::HamiltLCAO -#include "source_basis/module_nao/two_center_bundle.h" // use TwoCenterBundle -#include "module_hamilt_lcao/module_gint/gint_k.h" // use Gint_k -#include "source_basis/module_pw/pw_basis_k.h" // use ModulePW::PW_Basis_K and ModulePW::PW_Basis -#include "source_pw/hamilt_pwdft/structure_factor.h" // use Structure_Factor -#include "module_rdmft/rdmft.h" // use RDMFT codes -#ifdef __EXX -#include "module_ri/Exx_LRI_interface.h" // use EXX codes -#endif - -namespace ModuleIO -{ - // in principle, we need to add const for all of the variables, mohan note 2025-06-05 - template - void ctrl_output_lcao(UnitCell& ucell, - K_Vectors& kv, - elecstate::ElecStateLCAO* pelec, - Parallel_Orbitals& pv, - Grid_Driver& gd, - psi::Psi* psi, - hamilt::HamiltLCAO* p_hamilt, - TwoCenterBundle &two_center_bundle, - Gint_k &gk, - LCAO_Orbitals &orb, - const ModulePW::PW_Basis_K* pw_wfc, // for berryphase - const ModulePW::PW_Basis* pw_rho, // for berryphase - Grid_Technique >, // for berryphase - const ModulePW::PW_Basis_Big* pw_big, // for Wannier90 - const Structure_Factor& sf, // for Wannier90 - rdmft::RDMFT &rdmft_solver, // for RDMFT -#ifdef __MLALGO - LCAO_Deepks& ld, -#endif -#ifdef __EXX - Exx_LRI_Interface& exd, - Exx_LRI_Interface>& exc, -#endif - const int istep); -} -#endif diff --git a/source/module_io/cube_io.h b/source/module_io/cube_io.h deleted file mode 100644 index ce4fc69f82..0000000000 --- a/source/module_io/cube_io.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef CUBE_IO_H -#define CUBE_IO_H -#include "source_cell/unitcell.h" - -#include -class Parallel_Grid; - -namespace ModuleIO -{ -/// read volumetric data from .cube file into the parallel distributed grid. -bool read_vdata_palgrid(const Parallel_Grid& pgrid, - const int my_rank, - std::ofstream& ofs_running, - const std::string& fn, - double* const data, - const int nat); - -/// write volumetric data on the parallized grid into a .cube file -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 = 11, - const int out_fermi = 1, - const bool reduce_all_pool = false); // only reduce in the main pool as default - -/// read the full data from a cube file -bool read_cube(const std::string& file, - std::vector& comment, - int& natom, - std::vector& origin, - int& nx, - int& ny, - int& nz, - std::vector& dx, - std::vector& dy, - std::vector& dz, - std::vector& atom_type, - std::vector& atom_charge, - std::vector>& atom_pos, - std::vector& data); - -/// write a cube file -void write_cube(const std::string& file, - const std::vector& comment, - const int& natom, - const std::vector& origin, - const int& nx, - const int& ny, - const int& nz, - const std::vector& dx, - const std::vector& dy, - const std::vector& dz, - const std::vector& atom_type, - const std::vector& atom_charge, - const std::vector>& atom_pos, - const std::vector& data, - const int precision, - const int ndata_line = 6); - -/** - * @brief 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. - * - * @param data_in the input data of size nxyz_read - * @param nx_read nx read from file - * @param ny_read ny read from file - * @param nz_read nz read from file - * @param nx the dimension of grids along x - * @param ny the dimension of grids along y - * @param nz the dimension of grids along z - * @param data_out the interpolated results of size nxyz - */ -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); -} // namespace ModuleIO - -#endif diff --git a/source/module_io/dipole_io.h b/source/module_io/dipole_io.h deleted file mode 100644 index fc3c775a24..0000000000 --- a/source/module_io/dipole_io.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef DIPOLE_IO_H -#define DIPOLE_IO_H - -#include - -#include "source_basis/module_pw/pw_basis.h" - -namespace ModuleIO -{ -void write_dipole(const UnitCell& ucell, - const double* rho_save, - const ModulePW::PW_Basis* rhopw, - const int& is, - const int& istep, - const std::string& fn, - const int& precision = 11, - const bool for_plot = false); - -double prepare(const UnitCell &cell, int &dir); - -} // namespace ModuleIO - -#endif diff --git a/source/module_io/fR_overlap.cpp b/source/module_io/fR_overlap.cpp deleted file mode 100644 index b868412b6d..0000000000 --- a/source/module_io/fR_overlap.cpp +++ /dev/null @@ -1,376 +0,0 @@ -#ifdef __LCAO -#include "fR_overlap.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_base/math_integral.h" -#include "source_base/blas_connector.h" - -template -FR_overlap::FR_overlap() -{ - -} - -template -void FR_overlap::set_parameters(fr_ptr fr_in, - const UnitCell* ucell_in, - const LCAO_Orbitals* ptr_orb, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - int radial_grid_num, - int degree) -{ - this->fr = fr_in; - this->ucell = ucell_in; - this->ptr_orb_ = ptr_orb; - this->FR_container = new hamilt::HContainer(paraV); - this->radial_grid_num = radial_grid_num; - this->Leb_grid = new ModuleBase::Lebedev_laikov_grid(degree); - this->Leb_grid->generate_grid_points(); - this->initialize_FR(GridD_in, paraV); -} - -template -FR_overlap::FR_overlap(const FR_overlap& FR_in) -{ - this->fr = FR_in.fr; - this->ucell = FR_in.ucell; - this->FR_container = new hamilt::HContainer(*(FR_in.FR_container)); - this->radial_grid_num = FR_in.radial_grid_num; - this->Leb_grid = new ModuleBase::Lebedev_laikov_grid(FR_in.Leb_grid->degree); - this->Leb_grid->generate_grid_points(); -} - -template -FR_overlap::FR_overlap(FR_overlap&& FR_in) -{ - this->fr = std::move(FR_in.fr); - this->ucell = FR_in.ucell; - this->FR_container = std::move(FR_in.FR_container); - this->radial_grid_num = FR_in.radial_grid_num; - this->Leb_grid = new ModuleBase::Lebedev_laikov_grid(FR_in.Leb_grid->degree); - this->Leb_grid->generate_grid_points(); -} - -template -FR_overlap::~FR_overlap() -{ - if (this->Leb_grid) - { - delete this->Leb_grid; - } - - if (this->FR_container) - { - delete this->FR_container; - } -} - -template -void FR_overlap::initialize_FR(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("FR_overlap", "initialize_FR"); - ModuleBase::timer::tick("FR_overlap", "initialize_FR"); - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index = adjs.box[ad]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index).norm() * this->ucell->lat0 - >= ptr_orb_->Phi[T1].getRcut() + ptr_orb_->Phi[T2].getRcut()) - { - continue; - } - hamilt::AtomPair tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); - FR_container->insert_pair(tmp); - } - } - // allocate the memory of BaseMatrix in FR_container, and set the new values to zero - FR_container->allocate(nullptr, true); - ModuleBase::timer::tick("FR_overlap", "initialize_FR"); -} - -template -void FR_overlap::calculate_FR() -{ - ModuleBase::TITLE("FR_overlap", "calculate_FR"); - ModuleBase::timer::tick("FR_overlap", "calculate_FR"); - -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iap = 0; iap < this->FR_container->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = this->FR_container->get_atom_pair(iap); - int iat1 = tmp.get_atom_i(); - int iat2 = tmp.get_atom_j(); - const Parallel_Orbitals* paraV = tmp.get_paraV(); - - for (int iR = 0; iR < tmp.get_R_size(); ++iR) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(iR); - ModuleBase::Vector3 R_vector(R_index); - auto dtau = ucell->cal_dtau(iat1, iat2, R_vector) * ucell->lat0; - T* data_pointer = tmp.get_pointer(iR); - this->cal_FR_IJR(iat1, iat2, paraV, dtau, data_pointer); - } - } - - ModuleBase::timer::tick("FR_overlap", "calculate_FR"); -} - -template -void FR_overlap::cal_FR_IJR(const int& iat1, const int& iat2, const Parallel_Orbitals* paraV, const ModuleBase::Vector3& dtau, T* data_pointer) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - ModuleBase::Vector3 tau_1 = this->ucell->get_tau(iat1) * this->ucell->lat0; - - double Rcut1 = ptr_orb_->Phi[T1].getRcut(); - double Rcut2 = ptr_orb_->Phi[T2].getRcut(); - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - - const int maxL1 = atom1.nwl; - const int maxL2 = atom2.nwl; - - // --------------------------------------------- - // calculate the overlap matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - - std::set> LN_pair1; - std::set> LN_pair2; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - - LN_pair1.insert(std::make_pair(L1, N1)); - } - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - - LN_pair2.insert(std::make_pair(L2, N2)); - } - - int angular_grid_num = Leb_grid->degree; - int grid_num = radial_grid_num * angular_grid_num; - int row_num = static_cast(row_indexes.size() / npol); - int col_num = static_cast(col_indexes.size() / npol); - - T *grid_1 = new T[row_num*grid_num]; // matrix [row_num, grid_num] - T *grid_2 = new T[grid_num*col_num]; // matrix [grid_num, col_num] - ModuleBase::GlobalFunc::ZEROS(grid_1, row_num*grid_num); - ModuleBase::GlobalFunc::ZEROS(grid_2, grid_num*col_num); - - double xmin = 0.0; - double xmax = Rcut1; - double *r_radial = new double[radial_grid_num]; - double *weights_radial = new double[radial_grid_num]; - ModuleBase::Integral::Gauss_Legendre_grid_and_weight(xmin, xmax, radial_grid_num, r_radial, weights_radial); - - int count = -1; - for (int ir = 0; ir < radial_grid_num; ir++) - { - std::map, double> psi_value1 = psi_inter(T1, LN_pair1, r_radial[ir]); - - for (int ian = 0; ian < angular_grid_num; ian++) - { - count++; - - ModuleBase::Vector3 r_angular_tmp = Leb_grid->get_grid_coor()[ian]; - ModuleBase::Vector3 r_coor = r_radial[ir] * r_angular_tmp; - ModuleBase::Vector3 tmp_r_coor = r_coor - dtau; - double tmp_r_coor_norm = tmp_r_coor.norm(); - ModuleBase::Vector3 tmp_r_unit; - if (tmp_r_coor_norm > 1e-10) - { - tmp_r_unit = tmp_r_coor / tmp_r_coor_norm; - } - - if (tmp_r_coor_norm > Rcut2) { continue; -} - - std::map, double> psi_value2 = psi_inter(T2, LN_pair2, tmp_r_coor_norm); - - std::vector rly1; - ModuleBase::Ylm::rl_sph_harm (maxL1, r_angular_tmp.x, r_angular_tmp.y, r_angular_tmp.z, rly1); - - std::vector rly2; - ModuleBase::Ylm::rl_sph_harm (maxL2, tmp_r_unit.x, tmp_r_unit.y, tmp_r_unit.z, rly2); - - double weights_angular = Leb_grid->get_weight()[ian]; - - int irow1 = -1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - irow1++; - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - grid_1[irow1*grid_num+count] = psi_value1[std::make_pair(L1, N1)] * rly1[L1*L1+m1] * r_radial[ir] * r_radial[ir] * weights_radial[ir]; - - int icol2 = -1; - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - icol2++; - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - grid_2[count*col_num+icol2] = psi_value2[std::make_pair(L2, N2)] * rly2[L2*L2+m2] * weights_angular * fr(r_coor+tau_1); - } - - } - - } - } - - T *matrix_mul = new T[row_num*col_num]; // matrix [row_num, col_num] - ModuleBase::GlobalFunc::ZEROS(matrix_mul, row_num*col_num); - - BlasConnector::gemm('N', 'N', row_num, col_num, grid_num, - 1, grid_1, grid_num, grid_2, col_num, - 0, matrix_mul, col_num); - - for(int ir = 0; ir < row_num; ir++) - { - for(int ic = 0; ic < col_num; ic++) - { - for (int ipol = 0; ipol < npol; ipol++) - { - int index = (npol*ir+ipol)*col_num*npol + npol*ic + ipol; - data_pointer[index] = matrix_mul[ir*col_num+ic]; - } - } - } - - delete[] r_radial; - delete[] weights_radial; - delete[] grid_1; - delete[] grid_2; - delete[] matrix_mul; -} - -template -std::map, double> FR_overlap::psi_inter(const int &T1, const std::set> &LN_pair1, const double &r_norm) -{ - std::map, double> psi_value; - - for (auto i : LN_pair1) - { - int L1 = i.first; - int N1 = i.second; - - const double *psi_r1 = ptr_orb_->Phi[T1].PhiLN(L1, N1).getPsi(); - int mesh_r1 = ptr_orb_->Phi[T1].PhiLN(L1, N1).getNr(); - double dr1 = ptr_orb_->Phi[T1].PhiLN(L1, N1).getRab(0); - - psi_value[i] = Polynomial_Interpolation(psi_r1, mesh_r1, dr1, r_norm); - } - - return psi_value; -} - -template -double FR_overlap::Polynomial_Interpolation( - const double *psi_r, - const int &mesh_r, - const double &dr, - const double &x -) -{ - const double position = x / dr; - const int iq = static_cast(position); - - double t1 = 0.0; - double t2 = 0.0; - double t3 = 0.0; - double t4 = 0.0; - - if (iq <= mesh_r - 4) - { - t1 = psi_r[iq]; - t2 = psi_r[iq+1]; - t3 = psi_r[iq+2]; - t4 = psi_r[iq+3]; - } - else if (iq == mesh_r - 3) - { - t1 = psi_r[iq]; - t2 = psi_r[iq+1]; - t3 = psi_r[iq+2]; - } - else if (iq == mesh_r - 2) - { - t1 = psi_r[iq]; - t2 = psi_r[iq+1]; - } - else if (iq == mesh_r - 1) - { - t1 = psi_r[iq]; - } - - const double x0 = position - static_cast(iq); - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double y = - t1 * x1 * x2 * x3 / 6.0 + - t2 * x0 * x2 * x3 / 2.0 - - t3 * x1 * x0 * x3 / 2.0 + - t4 * x1 * x2 * x0 / 6.0 ; - - return y; -} - -// T of FR_overlap can be double or complex -template class FR_overlap; -template class FR_overlap>; - -#endif diff --git a/source/module_io/fR_overlap.h b/source/module_io/fR_overlap.h deleted file mode 100644 index 1f400724f4..0000000000 --- a/source/module_io/fR_overlap.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef FR_OVERLAP_H -#define FR_OVERLAP_H -#ifdef __LCAO -#include -#include -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_base/math_lebedev_laikov.h" - - -template -class FR_overlap -{ -public: - using fr_ptr = std::function)>; - - FR_overlap(); - - void set_parameters(fr_ptr fr_in, - const UnitCell* ucell_in, - const LCAO_Orbitals* ptr_orb, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - int radial_grid_num = 140, - int degree = 110); - - FR_overlap(const FR_overlap& FR_in); - - FR_overlap(FR_overlap&& FR_in); - - ~FR_overlap(); - - void calculate_FR(); - - hamilt::HContainer* get_FR_pointer() const - { - return this->FR_container; - } - -protected: - void initialize_FR(const Grid_Driver* GridD, const Parallel_Orbitals* paraV); - - void cal_FR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - T* data_pointer); - - std::map, double> psi_inter(const int& T1, - const std::set>& LN_pair1, - const double& r_norm); - - double Polynomial_Interpolation(const double* psi_r, const int& mesh_r, const double& dr, const double& x); - - fr_ptr fr = nullptr; - const UnitCell* ucell = nullptr; - const LCAO_Orbitals* ptr_orb_ = nullptr; - int radial_grid_num = 140; - ModuleBase::Lebedev_laikov_grid* Leb_grid = nullptr; - hamilt::HContainer* FR_container = nullptr; -}; -#endif -#endif diff --git a/source/module_io/file_reader.cpp b/source/module_io/file_reader.cpp deleted file mode 100644 index 5f24150518..0000000000 --- a/source/module_io/file_reader.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "file_reader.h" - -#include "source_base/tool_quit.h" - -namespace ModuleIO -{ - -// Constructor -FileReader::FileReader(std::string filename) -{ - ifs.open(filename.c_str()); - if (!ifs.is_open()) - { - ModuleBase::WARNING_QUIT("FileReader::FileReader", "Error opening file"); - } -} - -// Destructor -FileReader::~FileReader() -{ - if (ifs.is_open()) - { - ifs.close(); - } -} - -// Function to check if file is open -bool FileReader::isOpen() const -{ - return ifs.is_open(); -} - -// Function to read a line and return string stream -void FileReader::readLine() -{ - // add warning if file is not open - if (!ifs.eof()) - { - std::string line; - std::getline(ifs, line); - ss.clear(); - ss.str(line); - } - else - { - ModuleBase::WARNING_QUIT("FileReader::readLine", "End of file"); - } -} - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/file_reader.h b/source/module_io/file_reader.h deleted file mode 100644 index bd2c7481d7..0000000000 --- a/source/module_io/file_reader.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef FILE_READER_H -#define FILE_READER_H - -#include -#include -#include - -namespace ModuleIO -{ - -/** - * @brief A base class of file reader - * @details This class is supposed to be a base class to read a text file. - * it will open a file with a given filename. The function readLine() - * will read a line to a string stream. The function isOpen() check if the file - * is open. The destructor will close the file automatically. - */ -class FileReader -{ - public: - // Default constructor - FileReader(std::string filename); - ~FileReader(); - - // Check if file is open - bool isOpen() const; - - // read a line to string stream - void readLine(); - - std::stringstream ss; - - private: - std::ifstream ifs; -}; - -} // namespace ModuleIO - -#endif \ No newline at end of file diff --git a/source/module_io/filename.cpp b/source/module_io/filename.cpp deleted file mode 100644 index 39c5da6315..0000000000 --- a/source/module_io/filename.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include -#include "filename.h" -#include "source_base/tool_quit.h" - -namespace ModuleIO -{ - -std::string filename_output( - const std::string &directory, - const std::string &property, - const std::string &basis, - const int ik_local, // the ik index within each pool - const std::vector &ik2iktot, - const int nspin, - const int nkstot, - const int out_type, - const bool out_app_flag, - const bool gamma_only, - const int istep) -{ - // output filename = "{PARAM.globalv.global_out_dir}/property{s}{spin index} - // {k(optinal)}{k-point index}{g(optional)}{geometry index1}{_basis(nao|pw)} - // + {".txt"/".dat"}" - - std::set valid_properties = {"wf", "chg", "hk", "sk", "tk", "vxc"}; - if (valid_properties.find(property) == valid_properties.end()) - { - ModuleBase::WARNING_QUIT("ModuleIO::filename_output", "unknown property in filename function"); - } - - std::set valid_basis = {"pw", "nao"}; - if (valid_basis.find(basis) == valid_basis.end()) - { - ModuleBase::WARNING_QUIT("ModuleIO::filename_output", "unknown basis in filename function"); - } - - assert(ik_local>=0); - // mohan update 2025.05.07, if KPAR>1, "<" works - assert(ik2iktot.size() <= nkstot); - assert(nspin>0); - - // spin index - int is0 = -1; - // ik0 is the k-point index, starting from 0 - int ik0 = ik2iktot[ik_local]; - - if(nspin == 1) - { - is0 = 1; - } - else if(nspin == 2) - { - const int half_k = nkstot/2; - if(ik0 >= half_k) - { - is0 = 2; - ik0 -= half_k; - } - else - { - is0 = 1; - } - } - else if(nspin==4) - { - is0 = 12; - } - - // spin part - std::string spin_block; - spin_block = "s" + std::to_string(is0); - - // k-point part - std::string kpoint_block; - if(gamma_only) - { - // do nothing; - } - else - { - kpoint_block = "k" + std::to_string(ik0+1); - } - - std::string istep_block - = (istep >= 0 && (!out_app_flag)) - ? "g" + std::to_string(istep + 1) - : ""; // only when istep >= 0 and out_app_flag is false will write each wfc to a separate file - - std::string suffix_block; - if (out_type == 1) - { - suffix_block = ".txt"; - } - else if (out_type == 2) - { - suffix_block = ".dat"; - } - else - { - std::cout << "WARNING: the type of output wave function is not 1 or 2, so 1 is chosen." << std::endl; - suffix_block = ".txt"; - } - - std::string fn_out - = directory + property + spin_block + kpoint_block - + istep_block + "_" + basis + suffix_block; - - return fn_out; -} - -} diff --git a/source/module_io/filename.h b/source/module_io/filename.h deleted file mode 100644 index 8eba4af71a..0000000000 --- a/source/module_io/filename.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef FILENAME_H -#define FILENAME_H -#include -#include - -namespace ModuleIO -{ - -/** - * Generates the filename for the output files - * @param directory: directory of the file - * @param property: wave function (wf), charge density (chg) or matrix (mat) - * @param basis: nao or pw - * @param ik_local: index of the k-points within each pool, and starting from 0. - * @param ik2iktot: map from ik to iktot - * @param nspin: number of spin channels, 1,2 or 4 - * @param nkstot: number of total k-points - * @param out_type: two types of output file format, 1 for .txt and 2 for .dat (binary) - * @param out_app_flag: whether to append to existing file. - * @param gamma_only: gamma_only algorithm or not. - * @param istep: index of the ion step starting from 0. If < 0, the step number is not included in the file name. - * @return The generated filename. - */ -std::string filename_output( - const std::string &directory, - const std::string &property, - const std::string &basis, - const int ik_local, - const std::vector &ik2iktot, - const int nspin, - const int nkstot, - const int out_type, - const bool out_app_flag, - const bool gamma_only, - const int istep=-1); - -} -#endif diff --git a/source/module_io/get_pchg_lcao.cpp b/source/module_io/get_pchg_lcao.cpp deleted file mode 100644 index 316ffdb3f6..0000000000 --- a/source/module_io/get_pchg_lcao.cpp +++ /dev/null @@ -1,486 +0,0 @@ -#include "get_pchg_lcao.h" - -#include "module_io/cube_io.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_interface.h" - -Get_pchg_lcao::Get_pchg_lcao(psi::Psi* psi_gamma_in, const Parallel_Orbitals* ParaV_in) - : psi_gamma(psi_gamma_in), ParaV(ParaV_in) -{ -} - -Get_pchg_lcao::Get_pchg_lcao(psi::Psi>* psi_k_in, const Parallel_Orbitals* ParaV_in) - : psi_k(psi_k_in), ParaV(ParaV_in) -{ -} - -Get_pchg_lcao::~Get_pchg_lcao() -{ -} - -// For gamma_only -void Get_pchg_lcao::begin(Gint_Gamma& gg, - double** rho, - const ModuleBase::matrix& wg, - const std::vector& ef_all_spin, - const int rhopw_nrxx, - const std::vector& out_pchg, - const int nbands, - const double nelec, - const int nspin, - const UnitCell* ucell_in, - const Parallel_Grid& pgrid, - const Grid_Driver* GridD_in, - const K_Vectors& kv, - const std::string& global_out_dir, - std::ofstream& ofs_running) -{ - ModuleBase::TITLE("Get_pchg_lcao", "begin"); - - std::cout << " Calculate |psi(i)|^2 for selected electronic states (gamma only)." << std::endl; - - // if ucell is odd, it's correct, - // if ucell is even, it's also correct. - // +1.0e-8 in case like (2.999999999+1)/2 - const int fermi_band = static_cast((nelec + 1) / 2 + 1.0e-8); - - prepare_get_pchg(ofs_running); - - // Set this->bands_picked_ - select_bands(out_pchg, nbands, fermi_band); - - for (int ib = 0; ib < nbands; ++ib) - { - if (bands_picked_[ib]) - { - // Using new density matrix inplementation (gamma only) - elecstate::DensityMatrix DM(this->ParaV, nspin); - -#ifdef __MPI - this->idmatrix(ib, nspin, nelec, wg, DM, kv); -#else - ModuleBase::WARNING_QUIT("Get_pchg_lcao::begin", "The `pchg` calculation is only available for MPI now!"); -#endif - - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::ZEROS(rho[is], rhopw_nrxx); - } - - DM.init_DMR(GridD_in, ucell_in); - DM.cal_DMR(); -#ifdef __OLD_GINT - gg.initialize_pvpR(*ucell_in, GridD_in, nspin); - gg.transfer_DM2DtoGrid(DM.get_DMR_vector()); - Gint_inout inout(rho, Gint_Tools::job_type::rho, nspin); - gg.cal_gint(&inout); -#else - ModuleGint::cal_gint_rho(DM.get_DMR_vector(), nspin, rho); -#endif - - // A solution to replace the original implementation of the following code: - // pelec->charge->save_rho_before_sum_band(); - // Using std::vector to replace the original double** rho_save - std::vector> rho_save(nspin, std::vector(rhopw_nrxx)); - - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::DCOPY(rho[is], rho_save[is].data(), rhopw_nrxx); // Copy data - } - - for (int is = 0; is < nspin; ++is) - { - // ssc should be inside the inner loop to reset the string stream each time - std::stringstream ssc; - ssc << global_out_dir << "pchgi" << ib + 1 << "s" << is + 1 << ".cube"; - - ofs_running << " Writing cube file " << ssc.str() << std::endl; - - // Use a const vector to store efermi for all spins, replace the original implementation: - // const double ef_tmp = pelec->eferm.get_efval(is); - double ef_spin = ef_all_spin[is]; - ModuleIO::write_vdata_palgrid(pgrid, rho_save[is].data(), is, nspin, 0, ssc.str(), ef_spin, ucell_in); - } - } - } - - return; -} - -// For multi-k -void Get_pchg_lcao::begin(Gint_k& gk, - double** rho, - std::complex** rhog, - const ModuleBase::matrix& wg, - const std::vector& ef_all_spin, - const ModulePW::PW_Basis* rho_pw, - const int rhopw_nrxx, - const std::vector& out_pchg, - const int nbands, - const double nelec, - const int nspin, - UnitCell* ucell_in, - const Parallel_Grid& pgrid, - const Grid_Driver* GridD_in, - const K_Vectors& kv, - const std::string& global_out_dir, - std::ofstream& ofs_running, - const bool if_separate_k, - const int chr_ngmc) -{ - ModuleBase::TITLE("Get_pchg_lcao", "begin"); - - std::cout << " Calculate |psi(i)|^2 for selected electronic states (multi-k)." << std::endl; - - const int fermi_band = static_cast((nelec + 1) / 2 + 1.0e-8); - - prepare_get_pchg(ofs_running); - - // Set this->bands_picked_ - select_bands(out_pchg, nbands, fermi_band); - - for (int ib = 0; ib < nbands; ++ib) - { - if (bands_picked_[ib]) - { - // Using new density matrix inplementation (multi-k) - const int nspin_dm = std::map({{1, 1}, {2, 2}, {4, 1}})[nspin]; - elecstate::DensityMatrix, double> DM(this->ParaV, - nspin_dm, - kv.kvec_d, - kv.get_nks() / nspin_dm); - -#ifdef __MPI - this->idmatrix(ib, nspin, nelec, wg, DM, kv, if_separate_k); -#else - ModuleBase::WARNING_QUIT("Get_pchg_lcao::begin", "The `pchg` calculation is only available for MPI now!"); -#endif - // If contribution from different k-points need to be output separately - if (if_separate_k) - { - // For multi-k, loop over all real k-points - for (int ik = 0; ik < kv.get_nks() / nspin; ++ik) - { - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::ZEROS(rho[is], rhopw_nrxx); - } - - DM.init_DMR(GridD_in, ucell_in); - DM.cal_DMR(ik); -#ifdef __OLD_GINT - gk.initialize_pvpR(*ucell_in, GridD_in, nspin); - gk.transfer_DM2DtoGrid(DM.get_DMR_vector()); - Gint_inout inout(rho, Gint_Tools::job_type::rho, nspin); - gk.cal_gint(&inout); -#else - ModuleGint::cal_gint_rho(DM.get_DMR_vector(), nspin, rho); -#endif - - - // Using std::vector to replace the original double** rho_save - std::vector> rho_save(nspin, std::vector(rhopw_nrxx)); - - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::DCOPY(rho[is], rho_save[is].data(), rhopw_nrxx); // Copy data - } - - for (int is = 0; is < nspin; ++is) - { - // ssc should be inside the inner loop to reset the string stream each time - std::stringstream ssc; - ssc << global_out_dir << "pchgi" << ib + 1 << "s" << is + 1 << "k" << ik + 1 << ".cube"; - - ofs_running << " Writing cube file " << ssc.str() << std::endl; - - double ef_spin = ef_all_spin[is]; - ModuleIO::write_vdata_palgrid(pgrid, - rho_save[is].data(), - is, - nspin, - 0, - ssc.str(), - ef_spin, - ucell_in); - } - } - } - else - { - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::ZEROS(rho[is], rhopw_nrxx); - } - - DM.init_DMR(GridD_in, ucell_in); - DM.cal_DMR(); -#ifdef __OLD_GINT - gk.initialize_pvpR(*ucell_in, GridD_in, nspin); - gk.transfer_DM2DtoGrid(DM.get_DMR_vector()); - Gint_inout inout(rho, Gint_Tools::job_type::rho, nspin); - gk.cal_gint(&inout); -#else - ModuleGint::cal_gint_rho(DM.get_DMR_vector(), nspin, rho); -#endif - // Using std::vector to replace the original double** rho_save - std::vector> rho_save(nspin, std::vector(rhopw_nrxx)); - - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::DCOPY(rho[is], rho_save[is].data(), rhopw_nrxx); // Copy data - } - - // Symmetrize the charge density, otherwise the results are incorrect if the symmetry is on - Symmetry_rho srho; - for (int is = 0; is < nspin; ++is) - { - std::vector rho_save_pointers(nspin); - for (int i = 0; i < nspin; ++i) - { - rho_save_pointers[i] = rho_save[i].data(); - } - srho.begin(is, rho_save_pointers.data(), rhog, chr_ngmc, nullptr, rho_pw, ucell_in->symm); - } - - for (int is = 0; is < nspin; ++is) - { - // ssc should be inside the inner loop to reset the string stream each time - std::stringstream ssc; - ssc << global_out_dir << "pchgi" << ib + 1 << "s" << is + 1 << ".cube"; - - ofs_running << " Writing cube file " << ssc.str() << std::endl; - - double ef_spin = ef_all_spin[is]; - ModuleIO::write_vdata_palgrid(pgrid, - rho_save[is].data(), - is, - nspin, - 0, - ssc.str(), - ef_spin, - ucell_in); - } - } - } - } - - return; -} - -void Get_pchg_lcao::select_bands(const std::vector& out_pchg, const int nbands, const int fermi_band) -{ - ModuleBase::TITLE("Get_pchg_lcao", "select_bands"); - - int bands_below = 0; - int bands_above = 0; - - this->bands_picked_.resize(nbands); - ModuleBase::GlobalFunc::ZEROS(bands_picked_.data(), nbands); - - // Select bands directly using parameter `out_pchg` - // Check if length of out_pchg is valid - if (static_cast(out_pchg.size()) > nbands) - { - ModuleBase::WARNING_QUIT("Get_pchg_lcao::select_bands", - "The number of bands specified by `out_pchg` in the INPUT file exceeds `nbands`!"); - } - // Check if all elements in out_pchg are 0 or 1 - for (int value: out_pchg) - { - if (value != 0 && value != 1) - { - ModuleBase::WARNING_QUIT("Get_pchg_lcao::select_bands", - "The elements of `out_pchg` must be either 0 or 1. Invalid values found!"); - } - } - // Fill bands_picked_ with values from out_pchg - // Remaining bands are already set to 0 - const int length = std::min(static_cast(out_pchg.size()), nbands); - std::copy(out_pchg.begin(), out_pchg.begin() + length, bands_picked_.begin()); - - // Check if there are selected bands below the Fermi surface - bool has_below = false; - for (int i = 0; i + 1 <= fermi_band; ++i) - { - if (bands_picked_[i] == 1) - { - has_below = true; - break; - } - } - if (has_below) - { - std::cout << " Plot band-decomposed charge densities below the Fermi surface: band "; - for (int i = 0; i + 1 <= fermi_band; ++i) - { - if (bands_picked_[i] == 1) - { - std::cout << i + 1 << " "; - } - } - std::cout << std::endl; - } - - // Check if there are selected bands above the Fermi surface - bool has_above = false; - for (int i = fermi_band; i < nbands; ++i) - { - if (bands_picked_[i] == 1) - { - has_above = true; - break; - } - } - if (has_above) - { - std::cout << " Plot band-decomposed charge densities above the Fermi surface: band "; - for (int i = fermi_band; i < nbands; ++i) - { - if (bands_picked_[i] == 1) - { - std::cout << i + 1 << " "; - } - } - std::cout << std::endl; - } -} - -#ifdef __MPI -// For gamma_only -void Get_pchg_lcao::idmatrix(const int& ib, - const int nspin, - const double& nelec, - const ModuleBase::matrix& wg, - elecstate::DensityMatrix& DM, - const K_Vectors& kv) -{ - ModuleBase::TITLE("Get_pchg_lcao", "idmatrix"); - assert(wg.nr == nspin); - - const int fermi_band = static_cast((nelec + 1) / 2 + 1.0e-8); - - for (int is = 0; is < nspin; ++is) - { - std::cout << " Calculating density matrix for band " << ib + 1 << ", spin " << is + 1 << std::endl; - - std::vector wg_local(this->ParaV->ncol, 0.0); - const int ib_local = this->ParaV->global2local_col(ib); - - if (ib_local >= 0) - { - // For unoccupied bands, use occupation of HOMO - wg_local[ib_local] = (ib < fermi_band) ? wg(is, ib) : wg(is, fermi_band - 1); - } - - // wg_wfc(ib,iw) = wg[ib] * wfc(ib,iw); - this->psi_gamma->fix_k(is); - - // psi::Psi wg_wfc(*this->psi_gamma, 1, this->psi_gamma->get_nbands()); - psi::Psi wg_wfc(1, - this->psi_gamma->get_nbands(), - this->psi_gamma->get_nbasis(), - this->psi_gamma->get_nbasis(), - true); - wg_wfc.set_all_psi(this->psi_gamma->get_pointer(), wg_wfc.size()); - - for (int ir = 0; ir < wg_wfc.get_nbands(); ++ir) - { - BlasConnector::scal(wg_wfc.get_nbasis(), wg_local[ir], wg_wfc.get_pointer() + ir * wg_wfc.get_nbasis(), 1); - } - - elecstate::psiMulPsiMpi(wg_wfc, - *(this->psi_gamma), - DM.get_DMK_pointer(is), - this->ParaV->desc_wfc, - this->ParaV->desc); - } -} - -// For multi-k -void Get_pchg_lcao::idmatrix(const int& ib, - const int nspin, - const double& nelec, - const ModuleBase::matrix& wg, - elecstate::DensityMatrix, double>& DM, - const K_Vectors& kv, - const bool if_separate_k) -{ - ModuleBase::TITLE("Get_pchg_lcao", "idmatrix"); - assert(wg.nr == kv.get_nks()); - - const int fermi_band = static_cast((nelec + 1) / 2 + 1.0e-8); - - // To ensure the normalization of charge density in multi-k calculation (if if_separate_k is true) - double wg_sum_k = 0; - double wg_sum_k_homo = 0; - for (int ik = 0; ik < kv.get_nks() / nspin; ++ik) - { - wg_sum_k += wg(ik, ib); - wg_sum_k_homo += wg(ik, fermi_band - 1); - } - - for (int ik = 0; ik < kv.get_nks(); ++ik) - { - std::cout << " Calculating density matrix for band " << ib + 1 << ", k-point " - << ik % (kv.get_nks() / nspin) + 1 << ", spin " << kv.isk[ik] + 1 << std::endl; - - std::vector wg_local(this->ParaV->ncol, 0.0); - const int ib_local = this->ParaV->global2local_col(ib); - - if (ib_local >= 0) - { - double wg_value; - if (if_separate_k) - { - wg_value = (ib < fermi_band) ? wg_sum_k : wg_sum_k_homo; - } - else - { - wg_value = (ib < fermi_band) ? wg(ik, ib) : wg(ik, fermi_band - 1); - } - wg_local[ib_local] = wg_value; - } - - this->psi_k->fix_k(ik); - - psi::Psi> wg_wfc(1, - this->psi_k->get_nbands(), - this->psi_k->get_nbasis(), - this->psi_k->get_nbasis(), - true); - wg_wfc.set_all_psi(this->psi_k->get_pointer(), wg_wfc.size()); - - for (int ir = 0; ir < wg_wfc.get_nbands(); ++ir) - { - BlasConnector::scal(wg_wfc.get_nbasis(), wg_local[ir], wg_wfc.get_pointer() + ir * wg_wfc.get_nbasis(), 1); - } - - elecstate::psiMulPsiMpi(wg_wfc, - *(this->psi_k), - DM.get_DMK_pointer(ik), - this->ParaV->desc_wfc, - this->ParaV->desc); - } -} -#endif // __MPI - -void Get_pchg_lcao::prepare_get_pchg(std::ofstream& ofs_running) -{ - ofs_running << "\n\n"; - ofs_running << " GET_PCHG CALCULATION BEGINS" << std::endl; - - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " | Here we use real-space (r) grid integral technique to calculate |" << std::endl; - ofs_running << " | the decomposed charge density |psi(i,r)|^2 for each electronic |" << std::endl; - ofs_running << " | state i. The |psi(i,r)|^2 is printed out using numerical atomic |" << std::endl; - ofs_running << " | orbitals as basis set. |" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - ofs_running << "\n\n"; - - ofs_running << std::setprecision(6); -} \ No newline at end of file diff --git a/source/module_io/get_pchg_lcao.h b/source/module_io/get_pchg_lcao.h deleted file mode 100644 index 6819fc3470..0000000000 --- a/source/module_io/get_pchg_lcao.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef GET_PCHG_LCAO_H -#define GET_PCHG_LCAO_H - -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "source_cell/klist.h" -#include "source_estate/module_dm/density_matrix.h" - -/** - * @brief Manages the computation of the charge densities for different bands (band-decomposed charge densities). - * - * This class is responsible for initializing and managing the - * charge state computation process, offering functionality to - * calculate and plot the decomposed charge density for specified bands. - */ -class Get_pchg_lcao -{ - public: - Get_pchg_lcao(psi::Psi* psi_gamma_in, const Parallel_Orbitals* ParaV_in); - Get_pchg_lcao(psi::Psi>* psi_k_in, const Parallel_Orbitals* ParaV_in); - - ~Get_pchg_lcao(); - - // For gamma_only - void begin(Gint_Gamma& gg, - double** rho, - const ModuleBase::matrix& wg, - const std::vector& ef_all_spin, - const int rhopw_nrxx, - const std::vector& out_pchg, - const int nbands, - const double nelec, - const int nspin, - const UnitCell* ucell_in, - const Parallel_Grid& pgrid, - const Grid_Driver* GridD_in, - const K_Vectors& kv, - const std::string& global_out_dir, - std::ofstream& ofs_running); - - // For multi-k - void begin(Gint_k& gk, - double** rho, - std::complex** rhog, - const ModuleBase::matrix& wg, - const std::vector& ef_all_spin, - const ModulePW::PW_Basis* rho_pw, - const int rhopw_nrxx, - const std::vector& out_pchg, - const int nbands, - const double nelec, - const int nspin, - UnitCell* ucell_in, - const Parallel_Grid& pgrid, - const Grid_Driver* GridD_in, - const K_Vectors& kv, - const std::string& global_out_dir, - std::ofstream& ofs_running, - const bool if_separate_k, - const int chr_ngmc); - - private: - void prepare_get_pchg(std::ofstream& ofs_running); - - /** - * @brief Set this->bands_picked_ according to the mode, and process an error if the mode is not recognized. - * - * @param out_pchg INPUT parameter out_pchg, vector. - * @param nbands INPUT parameter nbands. - * @param fermi_band Calculated Fermi band. - */ - void select_bands(const std::vector& out_pchg, const int nbands, const int fermi_band); - -#ifdef __MPI - /** - * @brief Calculates the density matrix for a given band. - * - * This method calculates the density matrix for a given band using the wave function coefficients. - * It performs a matrix multiplication to produce the density matrix. - * - * @param ib Band index. - * @param nspin Number of spin channels. - * @param nelec Total number of electrons. - * @param wg Weight matrix for bands and spins (k-points). - * @param DM Density matrix to be calculated. - * @param kv K-vectors. - */ - void idmatrix(const int& ib, - const int nspin, - const double& nelec, - const ModuleBase::matrix& wg, - elecstate::DensityMatrix& DM, - const K_Vectors& kv); - - // For multi-k - void idmatrix(const int& ib, - const int nspin, - const double& nelec, - const ModuleBase::matrix& wg, - elecstate::DensityMatrix, double>& DM, - const K_Vectors& kv, - const bool if_separate_k); - -#endif - std::vector bands_picked_; - psi::Psi* psi_gamma = nullptr; - psi::Psi>* psi_k = nullptr; - const Parallel_Orbitals* ParaV; -}; -#endif // GET_PCHG_LCAO_H diff --git a/source/module_io/get_pchg_pw.h b/source/module_io/get_pchg_pw.h deleted file mode 100644 index 845a32b0bd..0000000000 --- a/source/module_io/get_pchg_pw.h +++ /dev/null @@ -1,211 +0,0 @@ -#ifndef GET_PCHG_PW_H -#define GET_PCHG_PW_H - -#include "cube_io.h" - -namespace ModuleIO -{ -template -void get_pchg_pw(const std::vector& out_pchg, - const int nbands, - const int nspin, - const int nxyz, - const int chr_ngmc, - UnitCell* ucell, - const psi::Psi>* psi, - const ModulePW::PW_Basis* pw_rhod, - const ModulePW::PW_Basis_K* pw_wfc, - const Device* ctx, - const Parallel_Grid& pgrid, - const std::string& global_out_dir, - const bool if_separate_k, - const K_Vectors& kv, - const int kpar, - const int my_pool, - const Charge* chr) // Charge class is needed for the charge density reduce -{ - // Get necessary parameters from kv - const int nks = kv.get_nks(); // current process pool k-point count - const int nkstot = kv.get_nkstot(); // total k-point count - - // Loop over k-parallelism - for (int ip = 0; ip < kpar; ++ip) - { - if (my_pool != ip) - { - continue; - } - - // bands_picked is a vector of 0s and 1s, where 1 means the band is picked to output - std::vector bands_picked(nbands, 0); - - // Check if length of out_pchg is valid - if (static_cast(out_pchg.size()) > nbands) - { - ModuleBase::WARNING_QUIT("ModuleIO::get_pchg_pw", - "The number of bands specified by `out_pchg` in the " - "INPUT file exceeds `nbands`!"); - } - - // Check if all elements in bands_picked are 0 or 1 - for (int value: out_pchg) - { - if (value != 0 && value != 1) - { - ModuleBase::WARNING_QUIT("ModuleIO::get_pchg_pw", - "The elements of `out_pchg` must be either 0 or 1. " - "Invalid values found!"); - } - } - - // Fill bands_picked with values from out_pchg - // Remaining bands are already set to 0 - int length = std::min(static_cast(out_pchg.size()), nbands); - for (int i = 0; i < length; ++i) - { - // out_pchg rely on function parse_expression - bands_picked[i] = static_cast(out_pchg[i]); - } - - std::vector> wfcr(nxyz); - std::vector> rho_band(nspin, std::vector(nxyz)); - - for (int ib = 0; ib < nbands; ++ib) - { - // Skip the loop iteration if bands_picked[ib] is 0 - if (!bands_picked[ib]) - { - continue; - } - - for (int is = 0; is < nspin; ++is) - { - std::fill(rho_band[is].begin(), rho_band[is].end(), 0.0); - } - - if (if_separate_k) - { - for (int ik = 0; ik < nks; ++ik) - { - const int ikstot = kv.ik2iktot[ik]; // global k-point index - const int spin_index = kv.isk[ik]; // spin index - const int k_number = ikstot % (nkstot / nspin) + 1; // k-point number, starting from 1 - - psi->fix_k(ik); - pw_wfc->recip_to_real(ctx, &psi[0](ib, 0), wfcr.data(), ik); - - // To ensure the normalization of charge density in multi-k calculation (if if_separate_k is true) - double wg_sum_k = 0.0; - if (nspin == 1) - { - wg_sum_k = 2.0; - } - else if (nspin == 2) - { - wg_sum_k = 1.0; - } - else - { - ModuleBase::WARNING_QUIT("ModuleIO::get_pchg_pw", - "Real space partial charge output currently do not support " - "noncollinear polarized calculation (nspin = 4)!"); - } - - double w1 = static_cast(wg_sum_k / ucell->omega); - - for (int i = 0; i < nxyz; ++i) - { - rho_band[spin_index][i] = std::norm(wfcr[i]) * w1; - } - - std::stringstream ssc; - ssc << global_out_dir << "pchgi" << ib + 1 << "s" << spin_index + 1 << "k" << k_number << ".cube"; - - ModuleIO::write_vdata_palgrid(pgrid, - rho_band[spin_index].data(), - spin_index, - nspin, - 0, - ssc.str(), - 0.0, - ucell, - 11, - 1, - true); // reduce_all_pool is true - } - } - else - { - for (int ik = 0; ik < nks; ++ik) - { - const int ikstot = kv.ik2iktot[ik]; // global k-point index - const int spin_index = kv.isk[ik]; // spin index - const int k_number = ikstot % (nkstot / nspin) + 1; // k-point number, starting from 1 - - psi->fix_k(ik); - pw_wfc->recip_to_real(ctx, &psi[0](ib, 0), wfcr.data(), ik); - - double w1 = static_cast(kv.wk[ik] / ucell->omega); - - for (int i = 0; i < nxyz; ++i) - { - rho_band[spin_index][i] += std::norm(wfcr[i]) * w1; - } - } - -#ifdef __MPI - // Reduce the charge density across all pools if kpar > 1 - if (kpar > 1 && chr != nullptr) - { - for (int is = 0; is < nspin; ++is) - { - chr->reduce_diff_pools(rho_band[is].data()); - } - } -#endif - - // Symmetrize the charge density, otherwise the results are incorrect if the symmetry is on - // std::cout << " Symmetrizing band-decomposed charge density..." << std::endl; - Symmetry_rho srho; - for (int is = 0; is < nspin; ++is) - { - // Use vector instead of raw pointers - std::vector rho_save_pointers(nspin); - for (int s = 0; s < nspin; ++s) - { - rho_save_pointers[s] = rho_band[s].data(); - } - - std::vector>> rhog(nspin, - std::vector>(chr_ngmc)); - - // Convert vector of vectors to vector of pointers - std::vector*> rhog_pointers(nspin); - for (int s = 0; s < nspin; ++s) - { - rhog_pointers[s] = rhog[s].data(); - } - - srho.begin(is, - rho_save_pointers.data(), - rhog_pointers.data(), - chr_ngmc, - nullptr, - pw_rhod, - ucell->symm); - } - - for (int is = 0; is < nspin; ++is) - { - std::stringstream ssc; - ssc << global_out_dir << "pchgi" << ib + 1 << "s" << is + 1 << ".cube"; - - ModuleIO::write_vdata_palgrid(pgrid, rho_band[is].data(), is, nspin, 0, ssc.str(), 0.0, ucell); - } - } // else if_separate_k is false - } // end of ib loop over nbands - } // end of ip loop over kpar -} // get_pchg_pw -} // namespace ModuleIO - -#endif // GET_PCHG_PW_H diff --git a/source/module_io/get_wf_lcao.cpp b/source/module_io/get_wf_lcao.cpp deleted file mode 100644 index 197068ed7b..0000000000 --- a/source/module_io/get_wf_lcao.cpp +++ /dev/null @@ -1,722 +0,0 @@ -#include "get_wf_lcao.h" - -#include "module_io/cube_io.h" -#include "module_io/write_wfc_pw.h" -#include "source_base/memory.h" - -#ifndef __OLD_GINT -#include "module_hamilt_lcao/module_gint/temp_gint/gint_env_gamma.h" -#include "module_hamilt_lcao/module_gint/temp_gint/gint_env_k.h" -#endif - -Get_wf_lcao::Get_wf_lcao(const elecstate::ElecState* pes) -{ - pes_ = pes; -} - -Get_wf_lcao::~Get_wf_lcao() -{ -} - -// For gamma_only -void Get_wf_lcao::begin(const UnitCell& ucell, - const psi::Psi* psid, - const ModulePW::PW_Basis_K* pw_wfc, - const Parallel_Grid& pgrid, - const Parallel_Orbitals& para_orb, - Gint_Gamma& gg, - const int& out_wfc_pw, - const K_Vectors& kv, - const double nelec, - const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nlocal, - const std::string& global_out_dir, - std::ofstream& ofs_running) -{ - ModuleBase::TITLE("Get_wf_lcao", "begin"); - - // if ucell is odd, it's correct, - // if ucell is even, it's also correct. - // +1.0e-8 in case like (2.999999999+1)/2 - const int fermi_band = static_cast((nelec + 1) / 2 + 1.0e-8); - - prepare_get_wf(ofs_running); - -#ifdef __OLD_GINT - // allocate grid wave functions for gamma_only - std::vector wfc_gamma_grid(nspin); - for (int is = 0; is < nspin; ++is) - { - wfc_gamma_grid[is] = new double*[nbands]; - for (int ib = 0; ib < nbands; ++ib) - { - wfc_gamma_grid[is][ib] = new double[gg.gridt->lgd]; - } - } -#endif - - // for pw_wfc in G space - psi::Psi> psi_g; - - // if (out_wfc_pw || out_wfc_r) - psi_g.resize(nspin, nbands, kv.ngk[0]); - -#ifdef __OLD_GINT - const double mem_size = sizeof(double) * double(gg.gridt->lgd) * double(nbands) * double(nspin) / 1024.0 / 1024.0; - ModuleBase::Memory::record("Get_wf_lcao::begin", mem_size); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "On-the-fly memory consumption (MB)", mem_size); -#endif - - // Set this->bands_picked_ - this->select_bands(out_wfc_norm, nbands, fermi_band); - - // Calculate out_wfc_norm - for (int is = 0; is < nspin; ++is) - { - psid->fix_k(is); -#ifdef __OLD_GINT - #ifdef __MPI - wfc_2d_to_grid(psid->get_pointer(), para_orb, wfc_gamma_grid[is], gg.gridt->trace_lo); - #else - // if not MPI enabled, it is the case psid holds a global matrix. - // use fix_k to switch between different spin channels (actually kpoints, - // because now the same kpoint in different spin channels are treated - // as distinct kpoints) - for (int i = 0; i < nbands; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - wfc_gamma_grid[is][i][j] = psid[0](i, j); - } - } - #endif -#else - ModuleGint::Gint_env_gamma gint_env(psid->get_pointer(), ¶_orb, nbands, nlocal, pes_->charge->rho[is]); -#endif - for (int ib = 0; ib < nbands; ++ib) - { - if (bands_picked_[ib]) - { - #ifdef __OLD_GINT - ModuleBase::GlobalFunc::ZEROS(pes_->charge->rho[is], pw_wfc->nrxx); - gg.cal_env(wfc_gamma_grid[is][ib], pes_->charge->rho[is], ucell); - #else - gint_env.cal_env_band(ib); - #endif - pes_->charge->save_rho_before_sum_band(); - - // pint out information - std::stringstream ss_file; - ss_file << "wfi" << ib + 1 << "s" << is + 1 << ".cube"; - - std::stringstream ss_out; - ss_out << global_out_dir << ss_file.str(); - - std::stringstream ss_info; - ss_info << "Wave func. " << ib + 1 << " spin " << is + 1 << " saved in"; - - ModuleBase::GlobalFunc::OUT(ofs_running, ss_info.str(), ss_file.str()); - - const double ef_tmp = this->pes_->eferm.get_efval(is); - ModuleIO::write_vdata_palgrid(pgrid, - pes_->charge->rho_save[is], - is, - nspin, - 0, - ss_out.str(), - ef_tmp, - &(ucell)); - } - } - } - - // Set this->bands_picked_ - this->select_bands(out_wfc_re_im, nbands, fermi_band); - - // Calculate out_wfc_re_im - for (int is = 0; is < nspin; ++is) - { - psid->fix_k(is); -#ifdef __OLD_GINT - #ifdef __MPI - wfc_2d_to_grid(psid->get_pointer(), para_orb, wfc_gamma_grid[is], gg.gridt->trace_lo); - #else - // if not MPI enabled, it is the case psid holds a global matrix. use fix_k to switch between - // different spin channels (actually kpoints, because now the same kpoint in different spin channels - // are treated as distinct kpoints) - for (int i = 0; i < nbands; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - wfc_gamma_grid[is][i][j] = psid[0](i, j); - } - } - #endif -#else - ModuleGint::Gint_env_gamma gint_env(psid->get_pointer(), ¶_orb, nbands, nlocal, pes_->charge->rho[is]); -#endif - for (int ib = 0; ib < nbands; ++ib) - { - if (bands_picked_[ib]) - { -#ifdef __OLD_GINT - ModuleBase::GlobalFunc::ZEROS(pes_->charge->rho[is], pw_wfc->nrxx); - gg.cal_env(wfc_gamma_grid[is][ib], pes_->charge->rho[is], ucell); -#else - gint_env.cal_env_band(ib); -#endif - pes_->charge->save_rho_before_sum_band(); - - const double ef_tmp = this->pes_->eferm.get_efval(is); - - // only for gamma_only now - psi_g.fix_k(is); - this->set_pw_wfc(pw_wfc, is, ib, nspin, pes_->charge->rho, psi_g); - - // Calculate real-space wave functions - psi_g.fix_k(is); - std::vector> wfc_r(pw_wfc->nrxx); - pw_wfc->recip2real(&psi_g(ib, 0), wfc_r.data(), is); - - // Extract real and imaginary parts - std::vector wfc_real(pw_wfc->nrxx); - std::vector wfc_imag(pw_wfc->nrxx); - for (int ir = 0; ir < pw_wfc->nrxx; ++ir) - { - wfc_real[ir] = wfc_r[ir].real(); - wfc_imag[ir] = wfc_r[ir].imag(); - } - - // Output real part - std::stringstream ss_real; - ss_real << global_out_dir << "wfi" << ib + 1 << "s" << is + 1 << "re.cube"; - ModuleIO::write_vdata_palgrid(pgrid, wfc_real.data(), is, nspin, 0, ss_real.str(), ef_tmp, &(ucell)); - - // Output imaginary part - std::stringstream ss_imag; - ss_imag << global_out_dir << "wfi" << ib + 1 << "s" << is + 1 << "im.cube"; - ModuleIO::write_vdata_palgrid(pgrid, wfc_imag.data(), is, nspin, 0, ss_imag.str(), ef_tmp, &(ucell)); - } - } - } - - ModuleIO::write_wfc_pw(GlobalV::KPAR, - GlobalV::MY_POOL, - GlobalV::MY_RANK, - nbands, - nspin, - PARAM.globalv.npol, - GlobalV::RANK_IN_POOL, - GlobalV::NPROC_IN_POOL, - out_wfc_pw, - PARAM.inp.ecutwfc, - global_out_dir, - psi_g, - kv, - pw_wfc, - ofs_running); - -#ifdef __OLD_GINT - for (int is = 0; is < nspin; ++is) - { - for (int ib = 0; ib < nbands; ++ib) - { - delete[] wfc_gamma_grid[is][ib]; - } - delete[] wfc_gamma_grid[is]; - } -#endif - return; -} - -// For multi-k -void Get_wf_lcao::begin(const UnitCell& ucell, - const psi::Psi>* psi, - const ModulePW::PW_Basis_K* pw_wfc, - const Parallel_Grid& pgrid, - const Parallel_Orbitals& para_orb, - Gint_k& gk, - const int& out_wfc_pw, - const K_Vectors& kv, - const double nelec, - const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nlocal, - const std::string& global_out_dir, - std::ofstream& ofs_running) -{ - ModuleBase::TITLE("Get_wf_lcao", "begin"); - - const int fermi_band = static_cast((nelec + 1) / 2 + 1.0e-8); - - prepare_get_wf(ofs_running); - - // allocate grid wave functions for multi-k - const int nks = kv.get_nks(); - std::vector**> wfc_k_grid(nks); -#ifdef __OLD_GINT - for (int ik = 0; ik < nks; ++ik) - { - wfc_k_grid[ik] = new std::complex*[nbands]; - for (int ib = 0; ib < nbands; ++ib) - { - wfc_k_grid[ik][ib] = new std::complex[gk.gridt->lgd]; - } - } - - const double mem_size - = sizeof(std::complex) * double(gk.gridt->lgd) * double(nbands) * double(nks) / 1024.0 / 1024.0; - ModuleBase::Memory::record("Get_wf_lcao::begin", mem_size); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "On-the-fly memory consumption (MB)", mem_size); -#endif - - // for pw_wfc in G space - psi::Psi> psi_g; - - // if (out_wfc_pw || out_wf_r) - psi_g.resize(nks, nbands, pw_wfc->npwk_max); - - // Set this->bands_picked_ - this->select_bands(out_wfc_norm, nbands, fermi_band); - - // Calculate out_wfc_norm - const int nspin0 = (nspin == 2) ? 2 : 1; - for (int ik = 0; ik < nks; ++ik) // the loop of nspin0 is included - { - const int ispin = kv.isk[ik]; - // 2d-to-grid conversion is unified into `wfc_2d_to_grid`. - psi->fix_k(ik); - -#ifdef __OLD_GINT - #ifdef __MPI // need to deal with NSPIN=4 !!!! - wfc_2d_to_grid(psi->get_pointer(), para_orb, wfc_k_grid[ik], gk.gridt->trace_lo); - #else - for (int i = 0; i < nbands; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - wfc_k_grid[ik][i][j] = psi[0](i, j); - } - } - #endif -#else - ModuleGint::Gint_env_k gint_env(psi->get_pointer(), ¶_orb, kv.kvec_c, kv.kvec_d, - nbands, nlocal, ik, PARAM.inp.nspin, PARAM.globalv.npol, pes_->charge->rho[ispin]); -#endif - - for (int ib = 0; ib < nbands; ++ib) - { - if (bands_picked_[ib]) - { -#ifdef __OLD_GINT - ModuleBase::GlobalFunc::ZEROS(pes_->charge->rho[ispin], - pw_wfc->nrxx); // terrible, you make changes on another instance's data??? - - // deal with NSPIN=4 - gk.cal_env_k(ik, wfc_k_grid[ik][ib], pes_->charge->rho[ispin], kv.kvec_c, kv.kvec_d, ucell); -#else - gint_env.cal_env_band(ib); -#endif - - // ik0 is the real k-point index, starting from 0 - int ik0 = kv.ik2iktot[ik]; - if (nspin == 2) - { - const int half_k = kv.get_nkstot() / 2; - if (ik0 >= half_k) - { - ik0 -= half_k; - } - } - - // pint out information - std::stringstream ss_file; - ss_file << "wfi" << ib + 1 << "s" << ispin + 1 << "k" << ik0 + 1 << ".cube"; - - std::stringstream ss_out; - ss_out << global_out_dir << ss_file.str(); - - std::stringstream ss_info; - ss_info << "Wave func. " << ib + 1 << " spin " << ispin + 1 << " k-point " << ik0 + 1 << " saved in"; - - ModuleBase::GlobalFunc::OUT(ofs_running, ss_info.str(), ss_file.str()); - - const double ef_tmp = this->pes_->eferm.get_efval(ispin); - - ModuleIO::write_vdata_palgrid(pgrid, - pes_->charge->rho[ispin], - ispin, - nspin, - 0, - ss_out.str(), - ef_tmp, - &(ucell), - 3, - 1); - - // if (out_wfc_pw || out_wf_r) - psi_g.fix_k(ik); - this->set_pw_wfc(pw_wfc, ik, ib, nspin, pes_->charge->rho, psi_g); - } - } - } - - ModuleIO::write_wfc_pw(GlobalV::KPAR, - GlobalV::MY_POOL, - GlobalV::MY_RANK, - nbands, - nspin, - PARAM.globalv.npol, - GlobalV::RANK_IN_POOL, - GlobalV::NPROC_IN_POOL, - out_wfc_pw, - PARAM.inp.ecutwfc, - global_out_dir, - psi_g, - kv, - pw_wfc, - ofs_running); - - // Set this->bands_picked_ - this->select_bands(out_wfc_re_im, nbands, fermi_band); - - // Calculate out_wfc_re_im - for (int ib = 0; ib < nbands; ++ib) - { - if (bands_picked_[ib]) - { - const int nspin0 = (nspin == 2) ? 2 : 1; - for (int ik = 0; ik < nks; ++ik) - { - const int ispin = kv.isk[ik]; - - psi_g.fix_k(ik); - - // Calculate real-space wave functions - std::vector> wfc_r(pw_wfc->nrxx); - pw_wfc->recip2real(&psi_g(ib, 0), wfc_r.data(), ik); - - // Extract real and imaginary parts - std::vector wfc_real(pw_wfc->nrxx); - std::vector wfc_imag(pw_wfc->nrxx); - for (int ir = 0; ir < pw_wfc->nrxx; ++ir) - { - wfc_real[ir] = wfc_r[ir].real(); - wfc_imag[ir] = wfc_r[ir].imag(); - } - - // ik0 is the real k-point index, starting from 0 - int ik0 = kv.ik2iktot[ik]; - if (nspin == 2) - { - const int half_k = kv.get_nkstot() / 2; - if (ik0 >= half_k) - { - ik0 -= half_k; - } - } - - // Output real part - std::stringstream ss_real; - ss_real << global_out_dir << "wfi" << ib + 1 << "s" << ispin + 1 << "k" << ik0 + 1 << "re.cube"; - - const double ef_tmp = this->pes_->eferm.get_efval(ispin); - ModuleIO::write_vdata_palgrid(pgrid, wfc_real.data(), ispin, nspin, 0, ss_real.str(), ef_tmp, &(ucell)); - - // Output imaginary part - std::stringstream ss_imag; - ss_imag << global_out_dir << "wfi" << ib + 1 << "s" << ispin + 1 << "k" << ik0 + 1 << "im.cube"; - ModuleIO::write_vdata_palgrid(pgrid, wfc_imag.data(), ispin, nspin, 0, ss_imag.str(), ef_tmp, &(ucell)); - } - } - } -#ifdef __OLD_GINT - for (int ik = 0; ik < nks; ++ik) - { - for (int ib = 0; ib < nbands; ++ib) - { - delete[] wfc_k_grid[ik][ib]; - } - delete[] wfc_k_grid[ik]; - } -#endif - return; -} - -void Get_wf_lcao::select_bands(const std::vector& out_wfc_kb, const int nbands, const int fermi_band) -{ - ModuleBase::TITLE("Get_wf_lcao", "select_bands"); - - this->bands_picked_.resize(nbands); - ModuleBase::GlobalFunc::ZEROS(bands_picked_.data(), nbands); - - // Select bands directly using parameter `out_wfc_norm` or `out_wfc_re_im` - // Check if length of out_wfc_kb is valid - if (static_cast(out_wfc_kb.size()) > nbands) - { - ModuleBase::WARNING_QUIT("Get_wf_lcao::select_bands", - "The number of bands specified by `out_wfc_norm` or `out_wfc_re_im` in the INPUT " - "file exceeds `nbands`!"); - } - // Check if all elements in out_wfc_kb are 0 or 1 - for (int value: out_wfc_kb) - { - if (value != 0 && value != 1) - { - ModuleBase::WARNING_QUIT( - "Get_wf_lcao::select_bands", - "The elements of `out_wfc_norm` or `out_wfc_re_im` must be either 0 or 1. Invalid values found!"); - } - } - // Fill bands_picked_ with values from out_wfc_kb - // Remaining bands are already set to 0 - const int length = std::min(static_cast(out_wfc_kb.size()), nbands); - std::copy(out_wfc_kb.begin(), out_wfc_kb.begin() + length, bands_picked_.begin()); - - // Check if there are selected bands below the Fermi surface - bool has_below = false; - for (int i = 0; i + 1 <= fermi_band; ++i) - { - if (bands_picked_[i] == 1) - { - has_below = true; - break; - } - } - if (has_below) - { - std::cout << " Plot wave functions below the Fermi surface: band "; - for (int i = 0; i + 1 <= fermi_band; ++i) - { - if (bands_picked_[i] == 1) - { - std::cout << i + 1 << " "; - } - } - std::cout << std::endl; - } - - // Check if there are selected bands above the Fermi surface - bool has_above = false; - for (int i = fermi_band; i < nbands; ++i) - { - if (bands_picked_[i] == 1) - { - has_above = true; - break; - } - } - if (has_above) - { - std::cout << " Plot wave functions above the Fermi surface: band "; - for (int i = fermi_band; i < nbands; ++i) - { - if (bands_picked_[i] == 1) - { - std::cout << i + 1 << " "; - } - } - std::cout << std::endl; - } -} - -// for each band -void Get_wf_lcao::set_pw_wfc(const ModulePW::PW_Basis_K* pw_wfc, - const int& ik, - const int& ib, - const int& nspin, - const double* const* const rho, - psi::Psi>& wfc_g) -{ - if (ib == 0) - { - // once is enough - ModuleBase::TITLE("Get_wf_lcao", "set_pw_wfc"); - } - - std::vector> Porter(pw_wfc->nrxx); - // here I refer to v_hartree, but I don't know how to deal with NSPIN=4 - const int nspin0 = (nspin == 2) ? 2 : 1; - for (int is = 0; is < nspin0; ++is) - { - for (int ir = 0; ir < pw_wfc->nrxx; ++ir) - { - Porter[ir] += std::complex(rho[is][ir], 0.0); - } - } - - // call FFT - pw_wfc->real2recip(Porter.data(), &wfc_g(ib, 0), ik); -} - -#ifdef __MPI -template -int Get_wf_lcao::set_wfc_grid(const int naroc[2], - const int nb, - const int dim0, - const int dim1, - const int iprow, - const int ipcol, - const T* in, - T** out, - const std::vector& trace_lo) -{ - ModuleBase::TITLE("Get_wf_lcao", "set_wfc_grid"); - if (!out) - { - return 0; - } - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, nb, dim1, ipcol); - if (igcol >= PARAM.inp.nbands) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, nb, dim0, iprow); - int mu_local = trace_lo[igrow]; - if (out && mu_local >= 0) - { - out[igcol][mu_local] = in[j * naroc[0] + i]; - } - } - } - return 0; -} - -template int Get_wf_lcao::set_wfc_grid(const int naroc[2], - const int nb, - const int dim0, - const int dim1, - const int iprow, - const int ipcol, - const double* in, - double** out, - const std::vector& trace_lo); -template int Get_wf_lcao::set_wfc_grid(const int naroc[2], - const int nb, - const int dim0, - const int dim1, - const int iprow, - const int ipcol, - const std::complex* in, - std::complex** out, - const std::vector& trace_lo); - -template -void Get_wf_lcao::wfc_2d_to_grid(const T* lowf_2d, - const Parallel_Orbitals& pv, - T** lowf_grid, - const std::vector& trace_lo) -{ - ModuleBase::TITLE("Get_wf_lcao", "wfc_2d_to_grid"); - ModuleBase::timer::tick("Get_wf_lcao", "wfc_2d_to_grid"); - - // dimension related - const int nlocal = pv.desc_wfc[2]; - const int nbands = pv.desc_wfc[3]; - - // MPI and memory related - const int mem_stride = 1; - int mpi_info = 0; - - // get the rank of the current process - int rank = 0; - MPI_Comm_rank(pv.comm(), &rank); - - // calculate the maximum number of nlocal over all processes in pv.comm() range - long buf_size; - mpi_info = MPI_Reduce(&pv.nloc_wfc, &buf_size, 1, MPI_LONG, MPI_MAX, 0, pv.comm()); - mpi_info = MPI_Bcast(&buf_size, 1, MPI_LONG, 0, pv.comm()); // get and then broadcast - std::vector lowf_block(buf_size); - - // this quantity seems to have the value returned by function numroc_ in ScaLAPACK? - int naroc[2]; - - // for BLACS broadcast - char scope = 'A'; - char top = ' '; - - // loop over all processors - for (int iprow = 0; iprow < pv.dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv.dim1; ++ipcol) - { - if (iprow == pv.coord[0] && ipcol == pv.coord[1]) - { - BlasConnector::copy(pv.nloc_wfc, lowf_2d, mem_stride, lowf_block.data(), mem_stride); - naroc[0] = pv.nrow; - naroc[1] = pv.ncol_bands; - Cxgebs2d(pv.blacs_ctxt, &scope, &top, 2, 1, naroc, 2); - Cxgebs2d(pv.blacs_ctxt, &scope, &top, buf_size, 1, lowf_block.data(), buf_size); - } - else - { - Cxgebr2d(pv.blacs_ctxt, &scope, &top, 2, 1, naroc, 2, iprow, ipcol); - Cxgebr2d(pv.blacs_ctxt, &scope, &top, buf_size, 1, lowf_block.data(), buf_size, iprow, ipcol); - } - - // then use it to set the wfc_grid. - mpi_info = this->set_wfc_grid(naroc, - pv.nb, - pv.dim0, - pv.dim1, - iprow, - ipcol, - lowf_block.data(), - lowf_grid, - trace_lo); - // this operation will let all processors have the same wfc_grid - } - } - ModuleBase::timer::tick("Get_wf_lcao", "wfc_2d_to_grid"); -} - -template void Get_wf_lcao::wfc_2d_to_grid(const double* lowf_2d, - const Parallel_Orbitals& pv, - double** lowf_grid, - const std::vector& trace_lo); -template void Get_wf_lcao::wfc_2d_to_grid(const std::complex* lowf_2d, - const Parallel_Orbitals& pv, - std::complex** lowf_grid, - const std::vector& trace_lo); -#endif - -void Get_wf_lcao::prepare_get_wf(std::ofstream& ofs_running) -{ - ofs_running << "\n\n"; - ofs_running << " GET_WF CALCULATION BEGINS" << std::endl; - - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " | Here we use real-space (r) grid integral technique to calculate |" << std::endl; - ofs_running << " | the electronic wave function psi(i,r) for each electronic state i. |" << std::endl; - ofs_running << " | The |psi(i,r)|, Re[psi(i,r)], Im[psi(i,r)] are printed out using |" << std::endl; - ofs_running << " | numerical atomic orbitals as basis set. |" << std::endl; - ofs_running << " | |" << std::endl; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - ofs_running << "\n\n"; - - ofs_running << std::setprecision(6); -} - -int Get_wf_lcao::globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - const int iblock = localindex / nblk; - const int gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} - -int Get_wf_lcao::localIndex(int globalindex, int nblk, int nprocs, int& myproc) -{ - myproc = int((globalindex % (nblk * nprocs)) / nblk); - return int(globalindex / (nblk * nprocs)) * nblk + globalindex % nblk; -} diff --git a/source/module_io/get_wf_lcao.h b/source/module_io/get_wf_lcao.h deleted file mode 100644 index 2e2e7ab4c2..0000000000 --- a/source/module_io/get_wf_lcao.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef GET_WF_LCAO_H -#define GET_WF_LCAO_H - -#include "module_hamilt_lcao/module_gint/gint_gamma.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "source_estate/elecstate.h" - -class Get_wf_lcao -{ - public: - Get_wf_lcao(const elecstate::ElecState* pes); - ~Get_wf_lcao(); - - /// For gamma_only - void begin(const UnitCell& ucell, - const psi::Psi* psid, - const ModulePW::PW_Basis_K* pw_wfc, - const Parallel_Grid& pgrid, - const Parallel_Orbitals& para_orb, - Gint_Gamma& gg, - const int& out_wfc_pw, - const K_Vectors& kv, - const double nelec, - const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nlocal, - const std::string& global_out_dir, - std::ofstream& ofs_running); - - /// tmp, delete after Gint is refactored. - void begin(const UnitCell& ucell, - const psi::Psi* psid, - const ModulePW::PW_Basis_K* pw_wfc, - const Parallel_Grid& pgrid, - const Parallel_Orbitals& para_orb, - Gint_k& gg, - const int& out_wfc_pw, - const K_Vectors& kv, - const double nelec, - const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nlocal, - const std::string& global_out_dir, - std::ofstream& ofs_running) - { - throw std::logic_error("gint_k should use with complex psi."); - }; - - /// For multi-k - void begin(const UnitCell& ucell, - const psi::Psi>* psi, - const ModulePW::PW_Basis_K* pw_wfc, - const Parallel_Grid& pgrid, - const Parallel_Orbitals& para_orb, - Gint_k& gk, - const int& out_wfc_pw, - const K_Vectors& kv, - const double nelec, - const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nlocal, - const std::string& global_out_dir, - std::ofstream& ofs_running); - - /// tmp, delete after Gint is refactored. - void begin(const UnitCell& ucell, - const psi::Psi>* psi, - const ModulePW::PW_Basis_K* pw_wfc, - const Parallel_Grid& pgrid, - const Parallel_Orbitals& para_orb, - Gint_Gamma& gk, - const int& out_wfc_pw, - const K_Vectors& kv, - const double nelec, - const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nlocal, - const std::string& global_out_dir, - std::ofstream& ofs_running) - { - throw std::logic_error("gint_gamma should use with real psi."); - }; - - private: - void prepare_get_wf(std::ofstream& ofs_running); - - void select_bands(const std::vector& out_wfc_kb, const int nbands, const int fermi_band); - - void set_pw_wfc(const ModulePW::PW_Basis_K* pw_wfc, - const int& ik, - const int& ib, - const int& nspin, - const double* const* const rho, - psi::Psi>& wfc_g); - - int globalIndex(int localindex, int nblk, int nprocs, int myproc); - - int localIndex(int globalindex, int nblk, int nprocs, int& myproc); - -#ifdef __MPI - template - int set_wfc_grid(const int naroc[2], - const int nb, - const int dim0, - const int dim1, - const int iprow, - const int ipcol, - const T* in, - T** out, - const std::vector& trace_lo); - template - void wfc_2d_to_grid(const T* wfc_2d, const Parallel_Orbitals& pv, T** wfc_grid, const std::vector& trace_lo); -#endif // __MPI - - std::vector bands_picked_; - const elecstate::ElecState* pes_ = nullptr; -}; -#endif // GET_WF_LCAO_H diff --git a/source/module_io/get_wf_pw.h b/source/module_io/get_wf_pw.h deleted file mode 100644 index b46cffdd40..0000000000 --- a/source/module_io/get_wf_pw.h +++ /dev/null @@ -1,248 +0,0 @@ -#ifndef GET_WF_PW_H -#define GET_WF_PW_H - -#include "cube_io.h" -#include "source_base/module_device/device.h" -#include "source_base/tool_quit.h" -#include "source_basis/module_pw/pw_basis.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/unitcell.h" -#include "source_estate/elecstate.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "source_pw/hamilt_pwdft/parallel_grid.h" -#include "source_psi/psi.h" - -#include -#include - -namespace ModuleIO -{ -template -void get_wf_pw(const std::vector& out_wfc_norm, - const std::vector& out_wfc_re_im, - const int nbands, - const int nspin, - const int nx, - const int ny, - const int nz, - const int nxyz, - UnitCell* ucell, - const psi::Psi>* psi, - const ModulePW::PW_Basis_K* pw_wfc, - const Device* ctx, - const Parallel_Grid& pgrid, - const std::string& global_out_dir, - const K_Vectors& kv, - const int kpar, - const int my_pool) -{ - // Get necessary parameters from kv - const int nks = kv.get_nks(); // current process pool k-point count - const int nkstot = kv.get_nkstot(); // total k-point count - - // Loop over k-parallelism - for (int ip = 0; ip < kpar; ++ip) - { - if (my_pool != ip) - { - continue; - } - - // bands_picked is a vector of 0s and 1s, where 1 means the band is picked to output - std::vector bands_picked_norm(nbands, 0); - std::vector bands_picked_re_im(nbands, 0); - - // Check if length of out_wfc_norm and out_wfc_re_im is valid - if (static_cast(out_wfc_norm.size()) > nbands || static_cast(out_wfc_re_im.size()) > nbands) - { - ModuleBase::WARNING_QUIT("ModuleIO::get_wf_pw", - "The number of bands specified by `out_wfc_norm` or `out_wfc_re_im` in the " - "INPUT file exceeds `nbands`!"); - } - - // Check if all elements in bands_picked are 0 or 1 - for (int value: out_wfc_norm) - { - if (value != 0 && value != 1) - { - ModuleBase::WARNING_QUIT("ModuleIO::get_wf_pw", - "The elements of `out_wfc_norm` must be either 0 or 1. " - "Invalid values found!"); - } - } - for (int value: out_wfc_re_im) - { - if (value != 0 && value != 1) - { - ModuleBase::WARNING_QUIT("ModuleIO::get_wf_pw", - "The elements of `out_wfc_re_im` must be either 0 or 1. " - "Invalid values found!"); - } - } - - // Fill bands_picked with values from out_wfc_norm - // Remaining bands are already set to 0 - int length = std::min(static_cast(out_wfc_norm.size()), nbands); - for (int i = 0; i < length; ++i) - { - // out_wfc_norm rely on function parse_expression - bands_picked_norm[i] = static_cast(out_wfc_norm[i]); - } - length = std::min(static_cast(out_wfc_re_im.size()), nbands); - for (int i = 0; i < length; ++i) - { - bands_picked_re_im[i] = static_cast(out_wfc_re_im[i]); - } - - std::vector> wfcr_norm(nxyz); - std::vector> rho_band_norm(nspin, std::vector(nxyz)); - - for (int ib = 0; ib < nbands; ++ib) - { - // Skip the loop iteration if bands_picked[ib] is 0 - if (!bands_picked_norm[ib]) - { - continue; - } - - for (int is = 0; is < nspin; ++is) - { - std::fill(rho_band_norm[is].begin(), rho_band_norm[is].end(), 0.0); - } - for (int ik = 0; ik < nks; ++ik) - { - const int ikstot = kv.ik2iktot[ik]; // global k-point index - const int spin_index = kv.isk[ik]; // spin index - const int k_number = ikstot % (nkstot / nspin) + 1; // k-point number, starting from 1 - - psi->fix_k(ik); - pw_wfc->recip_to_real(ctx, &psi[0](ib, 0), wfcr_norm.data(), ik); - - // To ensure the normalization of charge density in multi-k calculation - double wg_sum_k = 0.0; - if (nspin == 1) - { - wg_sum_k = 2.0; - } - else if (nspin == 2) - { - wg_sum_k = 1.0; - } - else - { - ModuleBase::WARNING_QUIT("ModuleIO::get_wf_pw", - "Real space wavefunction output currently do not support noncollinear " - "polarized calculation (nspin = 4)!"); - } - - double w1 = static_cast(wg_sum_k / ucell->omega); - - for (int i = 0; i < nxyz; ++i) - { - rho_band_norm[spin_index][i] = std::abs(wfcr_norm[i]) * std::sqrt(w1); - } - - std::stringstream ss_file; - ss_file << global_out_dir << "wfi" << ib + 1 << "s" << spin_index + 1 << "k" << k_number << ".cube"; - - ModuleIO::write_vdata_palgrid(pgrid, - rho_band_norm[spin_index].data(), - spin_index, - nspin, - 0, - ss_file.str(), - 0.0, - ucell, - 11, - 1, - true); // reduce_all_pool is true - } - } - - std::vector> wfc_re_im(nxyz); - std::vector> rho_band_re(nspin, std::vector(nxyz)); - std::vector> rho_band_im(nspin, std::vector(nxyz)); - - for (int ib = 0; ib < nbands; ++ib) - { - // Skip the loop iteration if bands_picked[ib] is 0 - if (!bands_picked_re_im[ib]) - { - continue; - } - - for (int is = 0; is < nspin; ++is) - { - std::fill(rho_band_re[is].begin(), rho_band_re[is].end(), 0.0); - std::fill(rho_band_im[is].begin(), rho_band_im[is].end(), 0.0); - } - for (int ik = 0; ik < nks; ++ik) - { - const int ikstot = kv.ik2iktot[ik]; // global k-point index - const int spin_index = kv.isk[ik]; // spin index - const int k_number = ikstot % (nkstot / nspin) + 1; // k-point number, starting from 1 - - psi->fix_k(ik); - pw_wfc->recip_to_real(ctx, &psi[0](ib, 0), wfc_re_im.data(), ik); - - // To ensure the normalization of charge density in multi-k calculation - double wg_sum_k = 0.0; - if (nspin == 1) - { - wg_sum_k = 2.0; - } - else if (nspin == 2) - { - wg_sum_k = 1.0; - } - else - { - ModuleBase::WARNING_QUIT("ModuleIO::get_wf_pw", - "Real space wavefunction output currently do not support noncollinear " - "polarized calculation (nspin = 4)!"); - } - - double w1 = static_cast(wg_sum_k / ucell->omega); - - for (int i = 0; i < nxyz; ++i) - { - rho_band_re[spin_index][i] = std::real(wfc_re_im[i]) * std::sqrt(w1); - rho_band_im[spin_index][i] = std::imag(wfc_re_im[i]) * std::sqrt(w1); - } - - std::stringstream ss_real; - ss_real << global_out_dir << "wfi" << ib + 1 << "s" << spin_index + 1 << "k" << k_number << "re.cube"; - - ModuleIO::write_vdata_palgrid(pgrid, - rho_band_re[spin_index].data(), - spin_index, - nspin, - 0, - ss_real.str(), - 0.0, - ucell, - 11, - 1, - true); // reduce_all_pool is true - - std::stringstream ss_imag; - ss_imag << global_out_dir << "wfi" << ib + 1 << "s" << spin_index + 1 << "k" << k_number << "im.cube"; - - ModuleIO::write_vdata_palgrid(pgrid, - rho_band_im[spin_index].data(), - spin_index, - nspin, - 0, - ss_imag.str(), - 0.0, - ucell, - 11, - 1, - true); // reduce_all_pool is true - } - } - } -} -} // namespace ModuleIO - -#endif // GET_WF_PW_H \ No newline at end of file diff --git a/source/module_io/input_conv.cpp b/source/module_io/input_conv.cpp deleted file mode 100644 index 5a451844e3..0000000000 --- a/source/module_io/input_conv.cpp +++ /dev/null @@ -1,631 +0,0 @@ -#include "module_io/input_conv.h" - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_cell/module_symmetry/symmetry.h" -#include "source_cell/unitcell.h" -#include "source_estate/occupy.h" -#include "source_hamilt/module_surchem/surchem.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_io/berryphase.h" -#include "module_parameter/parameter.h" -#include "module_relax/ions_move_basic.h" -#include "module_relax/lattice_change_basic.h" - -#include - -#ifdef __EXX -#include "module_ri/exx_abfs-jle.h" -#endif - -#include "module_hamilt_lcao/module_dftu/dftu.h" -#ifdef __LCAO -#include "source_basis/module_ao/ORB_read.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#endif -#ifdef __PEXSI -#include "source_hsolver/module_pexsi/pexsi_solver.h" -#endif -#ifdef __MPI -#include "source_hsolver/diago_elpa.h" -#include "source_hsolver/diago_elpa_native.h" -#endif - -#include "source_base/module_device/device.h" -#include "source_base/timer.h" -#include "source_estate/elecstate_lcao.h" -#include "source_estate/module_pot/efield.h" -#include "source_estate/module_pot/gatefield.h" -#include "source_hsolver/hsolver_lcao.h" -#include "source_hsolver/hsolver_pw.h" -#include "module_md/md_func.h" - -#ifdef __LCAO -std::vector Input_Conv::convert_units(std::string params, double c) { - std::vector params_ori; - std::vector params_out; - parse_expression(params, params_ori); - for (auto param: params_ori) - params_out.emplace_back(param * c); - - return params_out; -} - -void Input_Conv::read_td_efield() -{ - elecstate::H_TDDFT_pw::stype = PARAM.inp.td_stype; - if (PARAM.inp.out_mat_hs2 == 1) - { - TD_info::out_mat_R = true; - } else { - TD_info::out_mat_R = false; - } - parse_expression(PARAM.inp.td_ttype, elecstate::H_TDDFT_pw::ttype); - - elecstate::H_TDDFT_pw::tstart = PARAM.inp.td_tstart; - elecstate::H_TDDFT_pw::tend = PARAM.inp.td_tend; - if(PARAM.inp.td_dt!=-1.0) - { - elecstate::H_TDDFT_pw::dt = PARAM.inp.td_dt / ModuleBase::AU_to_FS; - } - else - { - elecstate::H_TDDFT_pw::dt = PARAM.mdp.md_dt / PARAM.inp.estep_per_md / ModuleBase::AU_to_FS; - } - - elecstate::H_TDDFT_pw::dt_int = elecstate::H_TDDFT_pw::dt; - - // space domain parameters - - // length gauge - elecstate::H_TDDFT_pw::lcut1 = PARAM.inp.td_lcut1; - elecstate::H_TDDFT_pw::lcut2 = PARAM.inp.td_lcut2; - - // time domain parameters - - // Gauss - elecstate::H_TDDFT_pw::gauss_omega = convert_units(PARAM.inp.td_gauss_freq, - 2 * ModuleBase::PI * ModuleBase::AU_to_FS); // time(a.u.)^-1 - elecstate::H_TDDFT_pw::gauss_phase = convert_units(PARAM.inp.td_gauss_phase, 1.0); - elecstate::H_TDDFT_pw::gauss_sigma = convert_units(PARAM.inp.td_gauss_sigma, 1 / ModuleBase::AU_to_FS); - elecstate::H_TDDFT_pw::gauss_t0 = convert_units(PARAM.inp.td_gauss_t0, 1.0); - elecstate::H_TDDFT_pw::gauss_amp = convert_units(PARAM.inp.td_gauss_amp, - ModuleBase::BOHR_TO_A / ModuleBase::Ry_to_eV); // Ry/bohr - // init ncut for velocity gauge integral - for (auto omega: elecstate::H_TDDFT_pw::gauss_omega) { - int ncut - = int(100.0 * omega * elecstate::H_TDDFT_pw::dt / ModuleBase::PI); - if (ncut % 2 == 0) { - ncut += 2; - } else { - ncut += 1; - } - if (elecstate::H_TDDFT_pw::stype == 0) - ncut = 1; - elecstate::H_TDDFT_pw::gauss_ncut.push_back(ncut); - } - // trapezoid - elecstate::H_TDDFT_pw::trape_omega = convert_units(PARAM.inp.td_trape_freq, - 2 * ModuleBase::PI * ModuleBase::AU_to_FS); // time(a.u.)^-1 - elecstate::H_TDDFT_pw::trape_phase = convert_units(PARAM.inp.td_trape_phase, 1.0); - elecstate::H_TDDFT_pw::trape_t1 = convert_units(PARAM.inp.td_trape_t1, 1.0); - elecstate::H_TDDFT_pw::trape_t2 = convert_units(PARAM.inp.td_trape_t2, 1.0); - elecstate::H_TDDFT_pw::trape_t3 = convert_units(PARAM.inp.td_trape_t3, 1.0); - elecstate::H_TDDFT_pw::trape_amp = convert_units(PARAM.inp.td_trape_amp, - ModuleBase::BOHR_TO_A / ModuleBase::Ry_to_eV); // Ry/bohr - // init ncut for velocity gauge integral - for (auto omega: elecstate::H_TDDFT_pw::trape_omega) { - int ncut - = int(100.0 * omega * elecstate::H_TDDFT_pw::dt / ModuleBase::PI); - if (ncut % 2 == 0) { - ncut += 2; - } else { - ncut += 1; - } - if (elecstate::H_TDDFT_pw::stype == 0) - ncut = 1; - elecstate::H_TDDFT_pw::trape_ncut.push_back(ncut); - } - // Trigonometric - elecstate::H_TDDFT_pw::trigo_omega1 = convert_units(PARAM.inp.td_trigo_freq1, - 2 * ModuleBase::PI * ModuleBase::AU_to_FS); // time(a.u.)^-1 - elecstate::H_TDDFT_pw::trigo_omega2 = convert_units(PARAM.inp.td_trigo_freq2, - 2 * ModuleBase::PI * ModuleBase::AU_to_FS); // time(a.u.)^-1 - elecstate::H_TDDFT_pw::trigo_phase1 = convert_units(PARAM.inp.td_trigo_phase1, 1.0); - elecstate::H_TDDFT_pw::trigo_phase2 = convert_units(PARAM.inp.td_trigo_phase2, 1.0); - elecstate::H_TDDFT_pw::trigo_amp = convert_units(PARAM.inp.td_trigo_amp, - ModuleBase::BOHR_TO_A / ModuleBase::Ry_to_eV); // Ry/bohr - // init ncut for velocity gauge integral - for (auto omega: elecstate::H_TDDFT_pw::trigo_omega1) { - int ncut - = int(100.0 * omega * elecstate::H_TDDFT_pw::dt / ModuleBase::PI); - if (ncut % 2 == 0) { - ncut += 2; - } else { - ncut += 1; - } - if (elecstate::H_TDDFT_pw::stype == 0) - ncut = 1; - elecstate::H_TDDFT_pw::trigo_ncut.push_back(ncut); - } - // Heaviside - elecstate::H_TDDFT_pw::heavi_t0 = convert_units(PARAM.inp.td_heavi_t0, 1.0); - elecstate::H_TDDFT_pw::heavi_amp = convert_units(PARAM.inp.td_heavi_amp, - ModuleBase::BOHR_TO_A / ModuleBase::Ry_to_eV); // Ry/bohr - - return; -} -#endif - -void Input_Conv::Convert() -{ - ModuleBase::TITLE("Input_Conv", "Convert"); - ModuleBase::timer::tick("Input_Conv", "Convert"); - //---------------------------------------------------------- - // main parameters / electrons / spin ( 10/16 ) - //---------------------------------------------------------- - - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "pseudo_dir", PARAM.inp.pseudo_dir); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "orbital_dir", PARAM.inp.orbital_dir); - // GlobalV::global_pseudo_type = PARAM.inp.pseudo_type; - - - GlobalV::KPAR = PARAM.inp.kpar; - - - -#ifdef __LCAO - Force_Stress_LCAO::force_invalid_threshold_ev = PARAM.inp.force_zero_out; - Force_Stress_LCAO>::force_invalid_threshold_ev = PARAM.inp.force_zero_out; -#endif - - BFGS_Basic::relax_bfgs_w1 = PARAM.inp.relax_bfgs_w1; - BFGS_Basic::relax_bfgs_w2 = PARAM.inp.relax_bfgs_w2; - - Ions_Move_Basic::relax_bfgs_rmax = PARAM.inp.relax_bfgs_rmax; - Ions_Move_Basic::relax_bfgs_rmin = PARAM.inp.relax_bfgs_rmin; - Ions_Move_Basic::relax_bfgs_init = PARAM.inp.relax_bfgs_init; - Ions_Move_Basic::out_stru = PARAM.inp.out_stru; // mohan add 2012-03-23 - Ions_Move_Basic::relax_method = PARAM.inp.relax_method; - Lattice_Change_Basic::fixed_axes = PARAM.inp.fixed_axes; - - - Ions_Move_CG::RELAX_CG_THR = PARAM.inp.relax_cg_thr; // pengfei add 2013-09-09 - - ModuleSymmetry::Symmetry::symm_flag = std::stoi(PARAM.inp.symmetry); - ModuleSymmetry::Symmetry::symm_autoclose = PARAM.inp.symmetry_autoclose; - - //---------------------------------------------------------- - // planewave (8/8) - //---------------------------------------------------------- - - //---------------------------------------------------------- - // diagonalization (5/5) - //---------------------------------------------------------- - - - //---------------------------------------------------------- - // iteration (1/3) - //---------------------------------------------------------- - - if (PARAM.inp.dft_plus_u) - { - GlobalC::dftu.Yukawa = PARAM.inp.yukawa_potential; - GlobalC::dftu.omc = PARAM.inp.omc; - GlobalC::dftu.orbital_corr = PARAM.inp.orbital_corr; - GlobalC::dftu.uramping = PARAM.globalv.uramping; - GlobalC::dftu.mixing_dftu = PARAM.inp.mixing_dftu; - GlobalC::dftu.U = PARAM.globalv.hubbard_u; - GlobalC::dftu.U0 = PARAM.globalv.hubbard_u; - if (PARAM.globalv.uramping > 0.01) - { - ModuleBase::GlobalFunc::ZEROS(GlobalC::dftu.U.data(), PARAM.inp.ntype); - } - } - - //---------------------------------------------------------- - // Yu Liu add 2022-05-18 - //---------------------------------------------------------- - elecstate::Efield::efield_dir = PARAM.inp.efield_dir; - elecstate::Efield::efield_pos_max = PARAM.inp.efield_pos_max; - elecstate::Efield::efield_pos_dec = PARAM.inp.efield_pos_dec; - elecstate::Efield::efield_amp = PARAM.inp.efield_amp; - - //---------------------------------------------------------- - // Yu Liu add 2022-09-13 - //---------------------------------------------------------- - elecstate::Gatefield::zgate = PARAM.inp.zgate; - elecstate::Gatefield::relax = PARAM.inp.relax; - elecstate::Gatefield::block = PARAM.inp.block; - elecstate::Gatefield::block_down = PARAM.inp.block_down; - elecstate::Gatefield::block_up = PARAM.inp.block_up; - elecstate::Gatefield::block_height = PARAM.inp.block_height; - -//---------------------------------------------------------- -// Fuxiang He add 2016-10-26 -//---------------------------------------------------------- -#ifdef __LCAO - TD_info::out_current = PARAM.inp.out_current; - TD_info::out_current_k = PARAM.inp.out_current_k; - TD_info::out_vecpot = PARAM.inp.out_vecpot; - TD_info::init_vecpot_file = PARAM.inp.init_vecpot_file; - read_td_efield(); -#endif // __LCAO - - - - //---------------------------------------------------------- - // about restart, // Peize Lin add 2020-04-04 - //---------------------------------------------------------- - if (PARAM.inp.restart_save) - { - std::string dft_functional_lower = PARAM.inp.dft_functional; - std::transform(PARAM.inp.dft_functional.begin(), - PARAM.inp.dft_functional.end(), - dft_functional_lower.begin(), - tolower); - GlobalC::restart.folder = PARAM.globalv.global_readin_dir + "restart/"; - ModuleBase::GlobalFunc::MAKE_DIR(GlobalC::restart.folder); - if (dft_functional_lower == "hf" || dft_functional_lower == "pbe0" - || dft_functional_lower == "hse" - || dft_functional_lower == "opt_orb" - || dft_functional_lower == "scan0") { - GlobalC::restart.info_save.save_charge = true; - GlobalC::restart.info_save.save_H = true; - } - else if ( dft_functional_lower == "muller" || dft_functional_lower == "power" - || dft_functional_lower == "wp22" - || dft_functional_lower == "cwp22" ) // added by jghan, 2024-07-07 - { - GlobalC::restart.info_save.save_charge = true; - GlobalC::restart.info_save.save_H = true; - } - else { - GlobalC::restart.info_save.save_charge = true; - } - } - if (PARAM.inp.restart_load) - { - std::string dft_functional_lower = PARAM.inp.dft_functional; - std::transform(PARAM.inp.dft_functional.begin(), - PARAM.inp.dft_functional.end(), - dft_functional_lower.begin(), - tolower); - GlobalC::restart.folder = PARAM.globalv.global_readin_dir + "restart/"; - if (dft_functional_lower == "hf" || dft_functional_lower == "pbe0" - || dft_functional_lower == "hse" - || dft_functional_lower == "opt_orb" - || dft_functional_lower == "scan0") { - GlobalC::restart.info_load.load_charge = true; - GlobalC::restart.info_load.load_H = true; - } - else if ( dft_functional_lower == "muller" || dft_functional_lower == "power" - || dft_functional_lower == "wp22" - || dft_functional_lower == "cwp22" ) // added by jghan, 2024-07-07 - { - GlobalC::restart.info_load.load_charge = true; - GlobalC::restart.info_load.load_H = true; - } - else { - GlobalC::restart.info_load.load_charge = true; - } - } - -//---------------------------------------------------------- -// about exx, Peize Lin add 2018-06-20 -//---------------------------------------------------------- - std::string dft_functional_lower = PARAM.inp.dft_functional; - std::transform(PARAM.inp.dft_functional.begin(), - PARAM.inp.dft_functional.end(), - dft_functional_lower.begin(), - tolower); - if (dft_functional_lower == "hf" - || dft_functional_lower == "pbe0" || dft_functional_lower == "b3lyp" || dft_functional_lower == "hse" - || dft_functional_lower == "scan0" - || dft_functional_lower == "muller" || dft_functional_lower == "power" - || dft_functional_lower == "cwp22" || dft_functional_lower == "wp22") - { - GlobalC::exx_info.info_global.cal_exx = true; - - GlobalC::exx_info.info_global.hybrid_alpha = 0; - std::vector fock_alpha(PARAM.inp.exx_fock_alpha.size()); - for(std::size_t i=0; i erfc_alpha(PARAM.inp.exx_erfc_alpha.size()); - for(std::size_t i=0; i0); - for(std::size_t i=0; i::out_wfc_lcao = PARAM.inp.out_wfc_lcao; - } - else if (!PARAM.globalv.gamma_only_local) - { - elecstate::ElecStateLCAO>::out_wfc_lcao = PARAM.inp.out_wfc_lcao; - } - if (PARAM.inp.calculation == "nscf" && !PARAM.inp.towannier90 && !PARAM.inp.berry_phase) - { - if (PARAM.globalv.gamma_only_local) - { - elecstate::ElecStateLCAO::need_psi_grid = false; - } else if (!PARAM.globalv.gamma_only_local) { - elecstate::ElecStateLCAO>::need_psi_grid - = false; - } - } - if (PARAM.inp.calculation == "test_neighbour" && GlobalV::NPROC > 1) - { - ModuleBase::WARNING_QUIT("Input_conv", "test_neighbour must be done with 1 processor"); - } -#endif - - //---------------------------------------------------------- - // About LCAO - //---------------------------------------------------------- - // mohan add 2021-04-16 - // ORB.ecutwfc = PARAM.inp.lcao_ecut; - // ORB.dk = PARAM.inp.lcao_dk; - // ORB.dR = PARAM.inp.lcao_dr; - // ORB.Rmax = PARAM.inp.lcao_rmax; - - // mohan add 2021-02-16 - berryphase::berry_phase_flag = PARAM.inp.berry_phase; - -//----------------------------------------------- -// caoyu add for DeePKS -//----------------------------------------------- - //----------------------------------------------- - // sunml add for implicit solvation model - //----------------------------------------------- - - //----------------------------------------------- - // Deltaspin related parameters - //----------------------------------------------- - - // mixing parameters - - //----------------------------------------------- - // Quasiatomic Orbital analysis - //----------------------------------------------- - - //----------------------------------------------- - // PEXSI related parameters - //----------------------------------------------- -#ifdef __PEXSI - pexsi::PEXSI_Solver::pexsi_npole = PARAM.inp.pexsi_npole; - pexsi::PEXSI_Solver::pexsi_inertia = PARAM.inp.pexsi_inertia; - pexsi::PEXSI_Solver::pexsi_nmax = PARAM.inp.pexsi_nmax; - // pexsi::PEXSI_Solver::pexsi_symbolic = PARAM.inp.pexsi_symbolic; - pexsi::PEXSI_Solver::pexsi_comm = PARAM.inp.pexsi_comm; - pexsi::PEXSI_Solver::pexsi_storage = PARAM.inp.pexsi_storage; - pexsi::PEXSI_Solver::pexsi_ordering = PARAM.inp.pexsi_ordering; - pexsi::PEXSI_Solver::pexsi_row_ordering = PARAM.inp.pexsi_row_ordering; - pexsi::PEXSI_Solver::pexsi_nproc = PARAM.inp.pexsi_nproc; - pexsi::PEXSI_Solver::pexsi_symm = PARAM.inp.pexsi_symm; - pexsi::PEXSI_Solver::pexsi_trans = PARAM.inp.pexsi_trans; - pexsi::PEXSI_Solver::pexsi_method = PARAM.inp.pexsi_method; - pexsi::PEXSI_Solver::pexsi_nproc_pole = PARAM.inp.pexsi_nproc_pole; - // pexsi::PEXSI_Solver::pexsi_spin = PARAM.inp.pexsi_spin; - pexsi::PEXSI_Solver::pexsi_temp = PARAM.inp.pexsi_temp; - pexsi::PEXSI_Solver::pexsi_gap = PARAM.inp.pexsi_gap; - pexsi::PEXSI_Solver::pexsi_delta_e = PARAM.inp.pexsi_delta_e; - pexsi::PEXSI_Solver::pexsi_mu_lower = PARAM.inp.pexsi_mu_lower; - pexsi::PEXSI_Solver::pexsi_mu_upper = PARAM.inp.pexsi_mu_upper; - pexsi::PEXSI_Solver::pexsi_mu = PARAM.inp.pexsi_mu; - pexsi::PEXSI_Solver::pexsi_mu_thr = PARAM.inp.pexsi_mu_thr; - pexsi::PEXSI_Solver::pexsi_mu_expand = PARAM.inp.pexsi_mu_expand; - pexsi::PEXSI_Solver::pexsi_mu_guard = PARAM.inp.pexsi_mu_guard; - pexsi::PEXSI_Solver::pexsi_elec_thr = PARAM.inp.pexsi_elec_thr; - pexsi::PEXSI_Solver::pexsi_zero_thr = PARAM.inp.pexsi_zero_thr; -#endif - - // elpa related -#ifdef __MPI - hsolver::DiagoElpa>::elpa_num_thread = PARAM.inp.elpa_num_thread; - ; - hsolver::DiagoElpa::elpa_num_thread = PARAM.inp.elpa_num_thread; - ; - hsolver::DiagoElpaNative>::elpa_num_thread = PARAM.inp.elpa_num_thread; - ; - hsolver::DiagoElpaNative::elpa_num_thread = PARAM.inp.elpa_num_thread; - ; -#endif - ModuleBase::timer::tick("Input_Conv", "Convert"); - return; -} diff --git a/source/module_io/input_conv.h b/source/module_io/input_conv.h deleted file mode 100644 index d60cc59780..0000000000 --- a/source/module_io/input_conv.h +++ /dev/null @@ -1,149 +0,0 @@ -//========================================================== -// Author: Lixin He,mohan -// DATE : 2008-12-24 -//========================================================== -#ifndef INPUT_CONVERT_H -#define INPUT_CONVERT_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Input_Conv -{ - -/** - * @brief template bridge codes for converting string to other types - * - */ -void tmp_convert(); - -/** - * @brief Pass the data members from the INPUT instance(defined in - * module_io/input.cpp) to GlobalV and GlobalC. - */ -void Convert(); - -/** - * @brief To parse input parameters as expressions into vectors - * - * @tparam T - * @param fn (string): expressions such as "3*1 0 2*0.5 3*0" - * @param vec (vector): stores parsing results, - * for example, "3*1 0 2*0.5 1*1.5" can be parsed as - * [1, 1, 1, 0, 0.5, 0.5, 1.5] - */ -template -void parse_expression(const std::string& fn, std::vector& vec) -{ - ModuleBase::TITLE("Input_Conv", "parse_expression"); - int count = 0; - - // Update the regex pattern to handle scientific notation - std::string pattern("([-+]?[0-9]+\\*[-+]?[0-9.eE+-]+|[-+]?[0-9,.eE+-]+)"); - - std::vector str; - std::stringstream ss(fn); - std::string section; - - // Split the input string into substrings by spaces - while (ss >> section) - { - int index = 0; - if (str.empty()) - { - while (index < section.size() && std::isspace(section[index])) - { - index++; - } - } - section.erase(0, index); - str.push_back(section); - } - - // Compile the regular expression - regex_t reg; - regcomp(®, pattern.c_str(), REG_EXTENDED); - regmatch_t pmatch[1]; - const size_t nmatch = 1; - - // Loop over each section and apply regex to extract numbers - for (size_t i = 0; i < str.size(); ++i) - { - if (str[i] == "") - { - continue; - } - int status = regexec(®, str[i].c_str(), nmatch, pmatch, 0); - std::string sub_str = ""; - - // Extract the matched substring - for (size_t j = pmatch[0].rm_so; j != pmatch[0].rm_eo; ++j) - { - sub_str += str[i][j]; - } - - // Check if the substring contains multiplication (e.g., "2*3.14") - std::string sub_pattern("\\*"); - regex_t sub_reg; - regcomp(&sub_reg, sub_pattern.c_str(), REG_EXTENDED); - regmatch_t sub_pmatch[1]; - const size_t sub_nmatch = 1; - - if (regexec(&sub_reg, sub_str.c_str(), sub_nmatch, sub_pmatch, 0) == 0) - { - size_t pos = sub_str.find("*"); - int num = stoi(sub_str.substr(0, pos)); - assert(num >= 0); - T occ = stof(sub_str.substr(pos + 1, sub_str.size())); - - // Add the value to the vector `num` times - for (size_t k = 0; k != num; k++) - { - vec.emplace_back(occ); - } - } - else - { - // Handle scientific notation and convert to T - std::stringstream convert; - convert << sub_str; - T occ; - convert >> occ; - vec.emplace_back(occ); - } - - regfree(&sub_reg); - } - - regfree(®); -} - -#ifdef __LCAO -/** - * @brief convert units of different parameters - * - * @param params input parameter - * @param c coefficients of unit conversion - * @return parame*c : parameter after unit vonversion - */ -std::vector convert_units(std::string params, double c); - -/** - * @brief read paramers of electric field for tddft and convert units - */ -void read_td_efield(); -#endif - -} // namespace Input_Conv - -#endif // Input_Convert diff --git a/source/module_io/input_item.h b/source/module_io/input_item.h deleted file mode 100644 index e1053c8d9a..0000000000 --- a/source/module_io/input_item.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef INPUT_ITEM_H -#define INPUT_ITEM_H -#include -#include -#include -#include -#include - -#include "module_parameter/parameter.h" -namespace ModuleIO -{ -class Input_Item -{ - public: - Input_Item(){}; - - Input_Item(const std::string& label_in) - { - label = label_in; - } - - Input_Item(const Input_Item& item) - { - label = item.label; - str_values = item.str_values; - final_value.str(item.final_value.str()); - annotation = item.annotation; - read_value = item.read_value; - check_value = item.check_value; - reset_value = item.reset_value; - get_final_value = item.get_final_value; - } - - std::string label; ///< label of the input item - std::vector str_values; ///< string values of the input item - std::stringstream final_value; ///< final value for writing to output INPUT file - - bool is_read() const ///< check if the input item is read - { - return !str_values.empty(); - } - - size_t get_size() const ///< get size of the input item - { - return str_values.size(); - } - - std::string annotation; ///< annotation of the input item - - // ====== !!! These functions are complete. ====== - // ====== !!! Do not add any more functions here. ====== - /// read value function - std::function read_value = [](const Input_Item& item, Parameter& param) {}; - /// check value function - std::function check_value = nullptr; - /// reset this value when some conditions are met - /// e.g. should only reset the value of this item - std::function reset_value = nullptr; - /// get final_value function for output INPUT file - std::function get_final_value = nullptr; - // ====== !!! Do not add any more functions here. ====== -}; - -} // namespace ModuleIO -#endif // INPUT_ITEM_H \ No newline at end of file diff --git a/source/module_io/io_dmk.cpp b/source/module_io/io_dmk.cpp deleted file mode 100644 index a52971e1a2..0000000000 --- a/source/module_io/io_dmk.cpp +++ /dev/null @@ -1,408 +0,0 @@ -#include "module_io/io_dmk.h" - -#include "source_base/parallel_common.h" -#include "source_base/scalapack_connector.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" - -/* -The format of the DMK file is as follows: -''' - - - - - - ... - ... -Direct - - -... - - -... - - - (fermi energy) - - - -... -''' - - -Example: -''' -sc - 5.29177 - 1 0 0 - 0 1 0 - 0 0 1 - H - 2 -Direct - 0 0 0.933859999999186 - 0 0 0.0661400000008143 - - 1 - -0.0883978533958687 (fermi energy) - 10 10 - - 5.773e-01 3.902e-02 1.661e-02 4.797e-17 -2.255e-17 5.773e-01 3.902e-02 --1.661e-02 -1.461e-17 -4.414e-17 - ... - ''' - */ - -std::string ModuleIO::dmk_gen_fname(const bool gamma_only, const int ispin, const int ik) -{ - if (gamma_only) - { - return std::string("dm") + "s" + std::to_string(ispin + 1) + "_nao.txt"; - } - else - { - // mohan update 2025-05-25, the index of 'ik' should be the correct 'ik' without spin - return std::string("dm") + "s" + std::to_string(ispin + 1) - + "k" + std::to_string(ik + 1) + "_nao.txt"; - } -} - -void ModuleIO::dmk_write_ucell(std::ofstream& ofs, const UnitCell* ucell) -{ - // write the UnitCell information - ofs << ucell->latName << std::endl; - ofs << " " << ucell->lat0 * ModuleBase::BOHR_TO_A << std::endl; - ofs << " " << ucell->latvec.e11 << " " << ucell->latvec.e12 << " " << ucell->latvec.e13 << std::endl; - ofs << " " << ucell->latvec.e21 << " " << ucell->latvec.e22 << " " << ucell->latvec.e23 << std::endl; - ofs << " " << ucell->latvec.e31 << " " << ucell->latvec.e32 << " " << ucell->latvec.e33 << std::endl; - for (int it = 0; it < ucell->ntype; it++) - { - ofs << " " << ucell->atoms[it].label; - } - ofs << std::endl; - for (int it = 0; it < ucell->ntype; it++) - { - ofs << " " << ucell->atoms[it].na; - } - ofs << std::endl; - ofs << "Direct" << std::endl; - for (int it = 0; it < ucell->ntype; it++) - { - Atom* atom = &ucell->atoms[it]; - ofs << std::setprecision(15); - for (int ia = 0; ia < ucell->atoms[it].na; ia++) - { - ofs << " " << atom->taud[ia].x << " " << atom->taud[ia].y << " " << atom->taud[ia].z << std::endl; - } - } -} - -void ModuleIO::dmk_read_ucell(std::ifstream& ifs) -{ - std::string tmp; - for (int i = 0; i < 6; i++) - { - std::getline(ifs, tmp); // latName + lat0 + latvec + atom label - } - std::getline(ifs, tmp); // atom number of each type - - std::istringstream iss(tmp); - int natom = 0; - int total_natom = 0; - while (iss >> natom) - { - total_natom += natom; - } - for (int i = 0; i < total_natom + 1; i++) - { - std::getline(ifs, tmp); // Direct + atom coordinates - } -} - -void ModuleIO::dmk_readData(std::ifstream& ifs, double& data) -{ - ifs >> data; -} - -void ModuleIO::dmk_readData(std::ifstream& ifs, std::complex& data) -{ - std::string complex_str; - ifs >> complex_str; - - size_t comma_pos = complex_str.find(','); - if (complex_str.front() == '(' && complex_str.back() == ')' && comma_pos != std::string::npos) - { - double real = std::stod(complex_str.substr(1, comma_pos - 1)); - double imag = std::stod(complex_str.substr(comma_pos + 1, complex_str.size() - comma_pos - 2)); - data = std::complex(real, imag); - } - else - { - ModuleBase::WARNING_QUIT("ModuleIO::dmk_readData", - "Invalid complex number format: " + complex_str); - } -} - -template -bool ModuleIO::read_dmk(const int nspin, - const int nk, - const Parallel_2D& pv, - const std::string& dmk_dir, - std::vector>& dmk, - std::ofstream &ofs_running) -{ - ModuleBase::TITLE("ModuleIO", "read_dmk"); - ModuleBase::timer::tick("ModuleIO", "read_dmk"); - - int my_rank = 0; -#ifdef __MPI - MPI_Comm_rank(pv.comm(), &my_rank); -#endif - - int nlocal = pv.get_global_row_size(); - bool gamma_only = std::is_same::value; - std::vector> dmk_global(nspin * nk, std::vector(nlocal * nlocal, 0)); - - // write a lambda function to check the consistency of the data - auto check_consistency - = [&](const std::string& fn, const std::string& name, const std::string& value, const int& target) { - if (std::stoi(value) != target) - { - ModuleBase::WARNING("ModuleIO::read_dmk", name + " is not consistent in file < " + fn + " >."); - std::cout << name << " = " << target << ", " << name << " in file = " << value << std::endl; - return false; - } - return true; - }; - - bool read_success = true; - std::string tmp; - if (my_rank == 0) - { - for (int ispin = 0; ispin < nspin; ispin++) - { - for (int ik = 0; ik < nk; ik++) - { - std::string fn = dmk_dir + dmk_gen_fname(gamma_only, ispin, ik); - std::ifstream ifs(fn.c_str()); - - if (!ifs) - { - ofs_running << " Cannot find density matrix file " << fn << " for k-point " << ik+1 << std::endl; - ModuleBase::WARNING("ModuleIO::read_dmk", "Can't open density matrix (k) file < " + fn + " >."); - read_success = false; - break; - } - else - { - ofs_running << " Read density matrix file " << fn << " for k-point " << ik+1 << std::endl; - } - - // read the UnitCell - dmk_read_ucell(ifs); - - ifs >> tmp; // nspin - if (!check_consistency(fn, "nspin", tmp, nspin)) - { - read_success = false; - ifs.close(); - break; - } - ifs >> tmp; - ifs >> tmp; - ifs >> tmp; // fermi energy - ifs >> tmp; // nlocal - if (!check_consistency(fn, "nlocal", tmp, nlocal)) - { - read_success = false; - ifs.close(); - break; - } - ifs >> tmp; // nlocal - if (!check_consistency(fn, "nlocal", tmp, nlocal)) - { - read_success = false; - ifs.close(); - break; - } - - // read the DMK data - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - dmk_readData(ifs, dmk_global[ik + nk * ispin][i * nlocal + j]); - } - } - ifs.close(); - } // ik - if (!read_success) - { - break; - } - } // ispin - } // rank0 - -#ifdef __MPI - MPI_Bcast(&read_success, 1, MPI_C_BOOL, 0, pv.comm()); -#endif - - if (read_success) - { -#ifdef __MPI - // seperate dmk data to each processor with 2D block distribution - dmk.resize(nspin * nk, std::vector(pv.get_row_size() * pv.get_col_size())); - Parallel_2D pv_glb; - pv_glb.set(nlocal, nlocal, nlocal, pv.blacs_ctxt); - for (int ik = 0; ik < nspin * nk; ik++) - { - Cpxgemr2d(nlocal, - nlocal, - dmk_global[ik].data(), - 1, - 1, - pv_glb.desc, - dmk[ik].data(), - 1, - 1, - const_cast(pv.desc), - pv_glb.blacs_ctxt); - } -#else - dmk = dmk_global; -#endif - } - ModuleBase::timer::tick("ModuleIO", "read_dmk"); - return read_success; -} - -template -void ModuleIO::write_dmk(const std::vector>& dmk, - const int precision, - const std::vector& efs, - const UnitCell* ucell, - const Parallel_2D& pv) -{ - ModuleBase::TITLE("ModuleIO", "write_dmk"); - ModuleBase::timer::tick("ModuleIO", "write_dmk"); - - int my_rank = 0; -#ifdef __MPI - MPI_Comm_rank(pv.comm(), &my_rank); -#endif - - bool gamma_only = std::is_same::value; - int nlocal = pv.get_global_row_size(); - int nspin = efs.size(); - int nk = dmk.size() / nspin; - if (nk * nspin != dmk.size()) - { - ModuleBase::WARNING_QUIT("write_dmk", "The size of dmk is not consistent with nspin and nk."); - } - Parallel_2D pv_glb; - - // when nspin == 2, assume the order of K in dmk is K1_up, K2_up, ..., - // K1_down, K2_down, ... - for (int ispin = 0; ispin < nspin; ispin++) - { - for (int ik = 0; ik < nk; ik++) - { - // gather dmk[ik] to dmk_global - std::vector dmk_global(my_rank == 0 ? nlocal * nlocal : 0); -#ifdef __MPI - pv_glb.set(nlocal, nlocal, nlocal, pv.blacs_ctxt); - Cpxgemr2d(nlocal, - nlocal, - const_cast(dmk[ik + nk * ispin].data()), - 1, - 1, - const_cast(pv.desc), - dmk_global.data(), - 1, - 1, - pv_glb.desc, - pv_glb.blacs_ctxt); -#else - dmk_global = dmk[ik + nk * ispin]; -#endif - - if (my_rank == 0) - { - std::string fn = PARAM.globalv.global_out_dir + dmk_gen_fname(gamma_only, ispin, ik); - std::ofstream ofs(fn.c_str()); - - if (!ofs) - { - ModuleBase::WARNING("ModuleIO::write_dmk", "Can't create DENSITY MATRIX File < " + fn + " >."); - continue; - } - else - { -// std::cout << " Write the density matrix to file " << fn << std::endl; - } - - // write the UnitCell information - dmk_write_ucell(ofs, ucell); - - - ofs << "\n " << nspin; // nspin - ofs << "\n " << std::fixed << std::setprecision(5) << efs[ispin] - << " (fermi energy)"; - ofs << "\n " << nlocal << " " << nlocal << std::endl; - - ofs << std::setprecision(precision); - ofs << std::scientific; - for (int i = 0; i < nlocal; ++i) - { - for (int j = 0; j < nlocal; ++j) - { - if (j % 8 == 0) - { - ofs << "\n"; - } - if (std::is_same::value) - { - ofs << " " << dmk_global[i * nlocal + j]; - } - else if (std::is_same, T>::value) - { - ofs << " (" << std::real(dmk_global[i * nlocal + j]) << "," - << std::imag(dmk_global[i * nlocal + j]) << ")"; - } - } - } - ofs.close(); - } // rank0 - } // ik - } // ispin - - ModuleBase::timer::tick("ModuleIO", "write_dmk"); -} - -template bool ModuleIO::read_dmk(const int nspin, - const int nk, - const Parallel_2D& pv, - const std::string& dmk_dir, - std::vector>& dmk, - std::ofstream &ofs); - -template bool ModuleIO::read_dmk>(const int nspin, - const int nk, - const Parallel_2D& pv, - const std::string& dmk_dir, - std::vector>>& dmk, - std::ofstream &ofs); - -template void ModuleIO::write_dmk(const std::vector>& dmk, - const int precision, - const std::vector& efs, - const UnitCell* ucell, - const Parallel_2D& pv); - -template void ModuleIO::write_dmk>(const std::vector>>& dmk, - const int precision, - const std::vector& efs, - const UnitCell* ucell, - const Parallel_2D& pv); diff --git a/source/module_io/io_dmk.h b/source/module_io/io_dmk.h deleted file mode 100644 index 19a0c66323..0000000000 --- a/source/module_io/io_dmk.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef DM_IO_H -#define DM_IO_H - -#include "source_base/parallel_2d.h" -#include "source_cell/unitcell.h" - -#include -#include - -namespace ModuleIO { - -/** - * @brief Generates the filename for the DMK file based on the given parameters. - * - * @param gamma_only Whether the calculation is gamma_only. - * @param ispin The index of the spin component. - * @param ik The index of the k-point. - * @return The generated filename. - */ -std::string dmk_gen_fname(const bool gamma_only, const int ispin, const int ik); - -/** - * @brief Writes the unit cell information to a DMK file. - * - * @param ofs The output file stream. - * @param ucell A pointer to the UnitCell object. - */ -void dmk_write_ucell(std::ofstream& ofs, const UnitCell* ucell); - -/** - * @brief Reads the unit cell information lines in a DMK file. - * - * @param ifs The input file stream. - */ -void dmk_read_ucell(std::ifstream& ifs); - -/** - * @brief Read one double from a file. - */ -void dmk_readData(std::ifstream& ifs, double& data); - -/** - * @brief Read one complex double from a file. - */ -void dmk_readData(std::ifstream& ifs, std::complex& data); - -/** - * @brief Reads the DMK data from a file. - * - * @tparam T The type of the DMK data. - * @param nspin The number of spin components. - * @param nk The number of k-points. - * @param pv The Parallel_2D object. Will get the global size and local size - * from it, and seperate the data into different processors accordingly. - * @param dmk_dir The directory path of the DMK file. - * @param dmk A vector to store the DMK data. If use MPI parallel, the data will - * be seperated into different processors based on the Parallel_2D object. - * @return True if the DMK data is successfully read, false otherwise. - */ -template -bool read_dmk(const int nspin, - const int nk, - const Parallel_2D& pv, - const std::string& dmk_dir, - std::vector>& dmk, - std::ofstream &ofs_running); - -/** - * @brief Writes the DMK data to a file. - * - * @tparam T The type of the DMK data. - * @param 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. - * @param precision The precision of the output of DMK. - * @param efs A vector containing the Fermi energies, and should have the same - * size as the number of SPIN. - * @param ucell A pointer to the UnitCell object. - * @param pv The Parallel_2D object. The 2d-block parallel information of DMK. - */ -template -void write_dmk(const std::vector>& dmk, - const int precision, - const std::vector& efs, - const UnitCell* ucell, - const Parallel_2D& pv); - -} // namespace ModuleIO - -#endif // IO_DMK_H diff --git a/source/module_io/io_npz.cpp b/source/module_io/io_npz.cpp deleted file mode 100644 index 3d3f80dff4..0000000000 --- a/source/module_io/io_npz.cpp +++ /dev/null @@ -1,474 +0,0 @@ -//Deals with io of dm(r)/h(r) in npz format - -#include "io_npz.h" - -#include "source_base/element_name.h" -#include "module_parameter/parameter.h" - -#ifdef __MPI -#include -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#endif - -#ifdef __USECNPY -#include "cnpy.h" -#endif - -namespace ModuleIO -{ - -void read_mat_npz(const Parallel_Orbitals* paraV, - const UnitCell& ucell, - std::string& zipname, - hamilt::HContainer& hR) -{ - ModuleBase::TITLE("ModuleIO", "read_mat_npz"); - -#ifdef __USECNPY - -#ifdef __MPI - - if(GlobalV::NPROC!=1) - { - std::cout << "read_mat_npz is not supported in NPI mode yet" << std::endl; - return; - } - - if(GlobalV::MY_RANK == 0) - { - //HR_serial = new hamilt::HContainer(&serialV); - - cnpy::npz_t my_npz = cnpy::npz_load(zipname); - std::vector fnames; - - //check consistency - // 1. lattice vectors - double* lattice_vector = my_npz["lattice_vectors"].data(); - assert(std::abs(lattice_vector[0] - ucell.lat0 * ucell.a1.x) < 1e-6); - assert(std::abs(lattice_vector[1] - ucell.lat0 * ucell.a1.y) < 1e-6); - assert(std::abs(lattice_vector[2] - ucell.lat0 * ucell.a1.z) < 1e-6); - assert(std::abs(lattice_vector[3] - ucell.lat0 * ucell.a2.x) < 1e-6); - assert(std::abs(lattice_vector[4] - ucell.lat0 * ucell.a2.y) < 1e-6); - assert(std::abs(lattice_vector[5] - ucell.lat0 * ucell.a2.z) < 1e-6); - assert(std::abs(lattice_vector[6] - ucell.lat0 * ucell.a3.x) < 1e-6); - assert(std::abs(lattice_vector[7] - ucell.lat0 * ucell.a3.y) < 1e-6); - assert(std::abs(lattice_vector[8] - ucell.lat0 * ucell.a3.z) < 1e-6); - - // 2. atoms - double* atom_info = my_npz["atom_info"].data(); - for (int iat = 0; iat < ucell.nat; ++iat) - { - const int it = ucell.iat2it[iat]; - const int ia = ucell.iat2ia[iat]; - - //get atomic number (copied from write_vdata_palgrid.cpp) - std::string element = ""; - element = ucell.atoms[it].label; - std::string::iterator temp = element.begin(); - while (temp != element.end()) - { - if ((*temp >= '1') && (*temp <= '9')) - { - temp = element.erase(temp); - } - else - { - temp++; - } - } - int z = 0; - for(int j=0; j!=ModuleBase::element_name.size(); j++) - { - if (element == ModuleBase::element_name[j]) - { - z=j+1; - break; - } - } - - assert(atom_info[iat*5] == it); - assert(atom_info[iat*5+1] == z); - // I will not be checking the coordinates for now in case the direct coordinates provided in the - // npz file do not fall in the range [0,1); if a protocol is to be set in the future such that - // this could be guaranteed, then the following lines could be uncommented - // assert(std::abs(atom_info[iat*5+2] - ucell.atoms[it].taud[ia].x) < 1e-6); - // assert(std::abs(atom_info[iat*5+3] - ucell.atoms[it].taud[ia].y) < 1e-6); - // assert(std::abs(atom_info[iat*5+4] - ucell.atoms[it].taud[ia].z) < 1e-6); - } - - // 3. orbitals - for (int it = 0; it < ucell.ntype; ++it) - { - std::string filename="orbital_info_"+std::to_string(it); - double* orbital_info = my_npz[filename].data(); - for (int iw = 0; iw < ucell.atoms[it].nw; ++iw) - { - assert(orbital_info[iw * 3] == ucell.atoms[it].iw2n[iw]); - assert(orbital_info[iw * 3 + 1] == ucell.atoms[it].iw2l[iw]); - const int im = ucell.atoms[it].iw2m[iw]; - const int m = (im % 2 == 0) ? -im/2 : (im+1)/2; - assert(orbital_info[iw*3+2] == m); - } - } - - //starts reading the matrix - for(auto const& imap: my_npz) - fnames.push_back(imap.first); - - for(int i = 0; i < fnames.size(); i ++) - { - if(fnames[i].find("mat_") == std::string::npos) continue; - - std::vector tokens; - std::string token; - std::stringstream fname_tmp(fnames[i]); - char delimiter = '_'; - - while (std::getline(fname_tmp, token, delimiter)) { - tokens.push_back(token); - } - - cnpy::NpyArray arr = my_npz[fnames[i]]; - - int iat1 = std::stoi(tokens[1]); - int iat2 = std::stoi(tokens[2]); - int Rx = std::stoi(tokens[3]); - int Ry = std::stoi(tokens[4]); - int Rz = std::stoi(tokens[5]); - - int it1 = ucell.iat2it[iat1]; - int it2 = ucell.iat2it[iat2]; - - assert(arr.shape[0] == ucell.atoms[it1].nw); - assert(arr.shape[1] == ucell.atoms[it2].nw); - - //hamilt::AtomPair tmp(iat1,iat2,Rx,Ry,Rz,&serialV); - //HR_serial->insert_pair(tmp); - hamilt::AtomPair tmp(iat1,iat2,Rx,Ry,Rz,paraV); - hR.insert_pair(tmp); - - // use symmetry : H_{mu,nu,R} = H_{nu,mu,-R} - if(Rx!=0 || Ry!=0 || Rz!=0) - { - //hamilt::AtomPair tmp(iat2,iat1,-Rx,-Ry,-Rz,&serialV); - //HR_serial->insert_pair(tmp); - hamilt::AtomPair tmp(iat2,iat1,-Rx,-Ry,-Rz,paraV); - hR.insert_pair(tmp); - } - } - - //HR_serial->allocate(); - hR.allocate(); - - for(int i = 0; i < fnames.size(); i ++) - { - if(fnames[i].find("mat_") == std::string::npos) continue; - - std::vector tokens; - std::string token; - std::stringstream fname_tmp(fnames[i]); - char delimiter = '_'; - - while (std::getline(fname_tmp, token, delimiter)) { - tokens.push_back(token); - } - - cnpy::NpyArray arr = my_npz[fnames[i]]; - - int iat1 = std::stoi(tokens[1]); - int iat2 = std::stoi(tokens[2]); - int Rx = std::stoi(tokens[3]); - int Ry = std::stoi(tokens[4]); - int Rz = std::stoi(tokens[5]); - - int it1 = ucell.iat2it[iat1]; - int it2 = ucell.iat2it[iat2]; - - assert(arr.shape[0] == ucell.atoms[it1].nw); - assert(arr.shape[1] == ucell.atoms[it2].nw); - - double* submat_read = arr.data(); - - //hamilt::BaseMatrix* submat = HR_serial->find_matrix(iat1,iat2,Rx,Ry,Rz); - hamilt::BaseMatrix* submat = hR.find_matrix(iat1,iat2,Rx,Ry,Rz); - - for(int i = 0; i < arr.shape[0]; i ++) - { - for(int j = 0; j < arr.shape[1]; j ++) - { - submat->add_element(i,j,submat_read[i*arr.shape[1]+j]); - } - } - - // use symmetry : H_{mu,nu,R} = H_{nu,mu,-R} - if(Rx!=0 || Ry!=0 || Rz!=0) - { - //hamilt::BaseMatrix* submat = HR_serial->find_matrix(iat2,iat1,-Rx,-Ry,-Rz); - hamilt::BaseMatrix* submat = hR.find_matrix(iat2,iat1,-Rx,-Ry,-Rz); - for(int i = 0; i < arr.shape[0]; i ++) - { - for(int j = 0; j < arr.shape[1]; j ++) - { - submat->add_element(j,i,submat_read[i*arr.shape[1]+j]); - } - } - } - } - - } -#else - - cnpy::npz_t my_npz = cnpy::npz_load(zipname); - std::vector fnames; - - for(auto const& imap: my_npz) - fnames.push_back(imap.first); - - for(int i = 0; i < fnames.size(); i ++) - { - if(fnames[i].find("mat_") == std::string::npos) continue; - - std::vector tokens; - std::string token; - std::stringstream fname_tmp(fnames[i]); - char delimiter = '_'; - - while (std::getline(fname_tmp, token, delimiter)) { - tokens.push_back(token); - } - - cnpy::NpyArray arr = my_npz[fnames[i]]; - - int iat1 = std::stoi(tokens[1]); - int iat2 = std::stoi(tokens[2]); - int Rx = std::stoi(tokens[3]); - int Ry = std::stoi(tokens[4]); - int Rz = std::stoi(tokens[5]); - - int it1 = ucell.iat2it[iat1]; - int it2 = ucell.iat2it[iat2]; - - assert(arr.shape[0] == ucell.atoms[it1].nw); - assert(arr.shape[1] == ucell.atoms[it2].nw); - - hamilt::AtomPair tmp(iat1,iat2,Rx,Ry,Rz,paraV); - hR->insert_pair(tmp); - // use symmetry : H_{mu,nu,R} = H_{nu,mu,-R} - if(Rx!=0 || Ry!=0 || Rz!=0) - { - hamilt::AtomPair tmp(iat2,iat1,-Rx,-Ry,-Rz,paraV); - hR->insert_pair(tmp); - } - } - - hR->allocate(); - - for(int i = 0; i < fnames.size(); i ++) - { - if(fnames[i].find("mat_") == std::string::npos) continue; - - std::vector tokens; - std::string token; - std::stringstream fname_tmp(fnames[i]); - char delimiter = '_'; - - while (std::getline(fname_tmp, token, delimiter)) { - tokens.push_back(token); - } - - cnpy::NpyArray arr = my_npz[fnames[i]]; - - int iat1 = std::stoi(tokens[1]); - int iat2 = std::stoi(tokens[2]); - int Rx = std::stoi(tokens[3]); - int Ry = std::stoi(tokens[4]); - int Rz = std::stoi(tokens[5]); - - int it1 = ucell.iat2it[iat1]; - int it2 = ucell.iat2it[iat2]; - - assert(arr.shape[0] == ucell.atoms[it1].nw); - assert(arr.shape[1] == ucell.atoms[it2].nw); - - double* submat_read = arr.data(); - - hamilt::BaseMatrix* submat = hR->find_matrix(iat1,iat2,Rx,Ry,Rz); - - for(int i = 0; i < arr.shape[0]; i ++) - { - for(int j = 0; j < arr.shape[1]; j ++) - { - submat->add_element(i,j,submat_read[i*arr.shape[1]+j]); - } - } - - // use symmetry : H_{mu,nu,R} = H_{nu,mu,-R} - if(Rx!=0 || Ry!=0 || Rz!=0) - { - hamilt::BaseMatrix* submat = hR->find_matrix(iat2,iat1,-Rx,-Ry,-Rz); - for(int i = 0; i < arr.shape[0]; i ++) - { - for(int j = 0; j < arr.shape[1]; j ++) - { - submat->add_element(j,i,submat_read[i*arr.shape[1]+j]); - } - } - } - } - -#endif - -#endif -} - -void output_mat_npz(const UnitCell& ucell, std::string& zipname, const hamilt::HContainer& hR) -{ - ModuleBase::TITLE("ModuleIO", "output_mat_npz"); - -#ifdef __USECNPY - std::string filename = ""; - - if(GlobalV::MY_RANK == 0) - { - -// first block: lattice vectors - filename = "lattice_vectors"; - std::vector lattice_vectors; - lattice_vectors.resize(9); - lattice_vectors[0] = ucell.lat0 * ucell.a1.x; - lattice_vectors[1] = ucell.lat0 * ucell.a1.y; - lattice_vectors[2] = ucell.lat0 * ucell.a1.z; - lattice_vectors[3] = ucell.lat0 * ucell.a2.x; - lattice_vectors[4] = ucell.lat0 * ucell.a2.y; - lattice_vectors[5] = ucell.lat0 * ucell.a2.z; - lattice_vectors[6] = ucell.lat0 * ucell.a3.x; - lattice_vectors[7] = ucell.lat0 * ucell.a3.y; - lattice_vectors[8] = ucell.lat0 * ucell.a3.z; - - cnpy::npz_save(zipname,filename,lattice_vectors); - -// second block: atom info - filename = "atom_info"; - double* atom_info = new double[ucell.nat * 5]; - for (int iat = 0; iat < ucell.nat; ++iat) - { - const int it = ucell.iat2it[iat]; - const int ia = ucell.iat2ia[iat]; - - //get atomic number (copied from write_vdata_palgrid.cpp) - std::string element = ""; - element = ucell.atoms[it].label; - std::string::iterator temp = element.begin(); - while (temp != element.end()) - { - if ((*temp >= '1') && (*temp <= '9')) - { - temp = element.erase(temp); - } - else - { - temp++; - } - } - int z = 0; - for(int j=0; j!=ModuleBase::element_name.size(); j++) - { - if (element == ModuleBase::element_name[j]) - { - z=j+1; - break; - } - } - - atom_info[iat*5] = it; - atom_info[iat*5+1] = z; - atom_info[iat * 5 + 2] = ucell.atoms[it].taud[ia].x; - atom_info[iat * 5 + 3] = ucell.atoms[it].taud[ia].y; - atom_info[iat * 5 + 4] = ucell.atoms[it].taud[ia].z; - } - std::vector shape = {(size_t)ucell.nat, 5}; - - cnpy::npz_save(zipname,filename,atom_info,shape,"a"); - delete[] atom_info; - -//third block: orbital info - for (int it = 0; it < ucell.ntype; ++it) - { - filename="orbital_info_"+std::to_string(it); - double* orbital_info = new double[ucell.atoms[it].nw * 3]; - for (int iw = 0; iw < ucell.atoms[it].nw; ++iw) - { - orbital_info[iw * 3] = ucell.atoms[it].iw2n[iw]; - orbital_info[iw * 3 + 1] = ucell.atoms[it].iw2l[iw]; - const int im = ucell.atoms[it].iw2m[iw]; - const int m = (im % 2 == 0) ? -im/2 : (im+1)/2; - orbital_info[iw*3+2] = m; - } - shape = {(size_t)ucell.atoms[it].nw, 3}; - - cnpy::npz_save(zipname,filename,orbital_info,shape,"a"); - } - } - -//fourth block: hr(i0,jR) -#ifdef __MPI - hamilt::HContainer* HR_serial; - Parallel_Orbitals serialV; - serialV.set_serial(PARAM.globalv.nlocal, PARAM.globalv.nlocal); - serialV.set_atomic_trace(ucell.get_iat2iwt(), ucell.nat, PARAM.globalv.nlocal); - if(GlobalV::MY_RANK == 0) - { - HR_serial = new hamilt::HContainer(&serialV); - } - hamilt::gatherParallels(hR, HR_serial, 0); - - if(GlobalV::MY_RANK==0) - { - for(int iap=0;iap atom_j) continue; - int start_i = serialV.atom_begin_row[atom_i]; - int start_j = serialV.atom_begin_col[atom_j]; - int row_size = serialV.get_row_size(atom_i); - int col_size = serialV.get_col_size(atom_j); - for(int iR=0;iR r_index = HR_serial[0].get_atom_pair(iap).get_R_index(iR); - filename = "mat_"+std::to_string(atom_i)+"_"+std::to_string(atom_j)+"_" - +std::to_string(r_index.x)+"_"+std::to_string(r_index.y)+"_"+std::to_string(r_index.z); - std::vector shape = {(size_t)row_size,(size_t)col_size}; - cnpy::npz_save(zipname,filename,matrix.get_pointer(),shape,"a"); - } - } - - } -#else - auto row_indexes = paraV.get_indexes_row(); - auto col_indexes = paraV.get_indexes_col(); - for(int iap=0;iap r_index = hR.get_atom_pair(iap).get_R_index(iR); - - filename = "mat_"+std::to_string(atom_i)+"_"+std::to_string(atom_j)+"_" - +std::to_string(r_index.x)+"_"+std::to_string(r_index.y)+"_"+std::to_string(r_index.z); - std::vector shape = {(size_t)row_size,(size_t)col_size}; - cnpy::npz_save(zipname,filename,matrix.get_pointer(),shape,"a"); - } - } -#endif -#endif -} - -} // namespace ModuleIO diff --git a/source/module_io/io_npz.h b/source/module_io/io_npz.h deleted file mode 100644 index 98567f789c..0000000000 --- a/source/module_io/io_npz.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef NPZ_IO_H -#define NPZ_IO_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -#include - -namespace ModuleIO -{ - -void read_mat_npz(const Parallel_Orbitals* paraV, - const UnitCell& ucell, - std::string& zipname, - hamilt::HContainer& hR); - -void output_mat_npz(const UnitCell& ucell, std::string& zipname, const hamilt::HContainer& hR); - -} // namespace ModuleIO - -#endif // NPZ_IO_H diff --git a/source/module_io/json_output/CMakeLists.txt b/source/module_io/json_output/CMakeLists.txt deleted file mode 100644 index 9a94822f57..0000000000 --- a/source/module_io/json_output/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -list(APPEND objects_json - abacusjson.cpp - general_info.cpp - init_info.cpp - readin_info.cpp - output_info.cpp -) - -add_library( - json_output - OBJECT - ${objects_json} -) - -if(ENABLE_COVERAGE) - add_coverage(json_output) -endif() - -if(BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() -endif() diff --git a/source/module_io/json_output/abacusjson.cpp b/source/module_io/json_output/abacusjson.cpp deleted file mode 100644 index ea6a59992e..0000000000 --- a/source/module_io/json_output/abacusjson.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include "abacusjson.h" - -#include -#include -#include -#include -#include -namespace Json -{ - -#ifdef __RAPIDJSON -rapidjson::Document AbacusJson::doc; - -bool isNum(std::string str) -{ - std::stringstream sin; - sin<> d)) - return false; - - if (sin >> c) - return false; - return true; -} - - -void AbacusJson::add_nested_member(std::vector::iterator begin, - std::vector::iterator end, - rapidjson::Value& val, - rapidjson::Value& parent, - rapidjson::Document::AllocatorType& allocator, - bool IsArray - ) -{ - if (begin != end) - { - jsonKeyNode keyNode = *begin; - rapidjson::Value key((*begin).key.c_str(), allocator); - - - if (begin + 1 == end) - { - - if( keyNode.key.empty() && parent.IsArray()){ - int index = keyNode.i; - if(index>=0){ - parent[index] = val; - } - else { - int arr_size = parent.Size(); - parent[arr_size+index] = val; - } - } - // if key exists, then overwrite it - else if (parent.HasMember(key)) - { - if(parent[key].IsArray()){ - parent[key].PushBack(val, allocator); - }else{ - // if key is an object, then warn the user - if (parent[key].IsObject()) - { - std::cout << "Warning: write to json, key " << (*begin).key - << " exist and is an object, and abacus will overwrite it with a value." << std::endl; - } - parent[key] = val; - } - } - else{ - if(IsArray==true){ - rapidjson::Value arr(rapidjson::kArrayType); - arr.PushBack(val, allocator); - parent.AddMember(key, arr, allocator); - } else{ - parent.AddMember(key, val, allocator); - } - - } - } - else - { - if( keyNode.key.empty()&&parent.IsArray()){ - int index = keyNode.i; - - if(index>=0){ - add_nested_member(begin + 1, end, val, parent[index], allocator,IsArray); - } - else { - int arr_size = parent.Size(); - add_nested_member(begin + 1, end, val, parent[arr_size+index], allocator,IsArray); - } - } - // need to check if the key exists - else if (parent.HasMember(key)) - { - // this key should be an object - if (!parent[key].IsObject()&&!parent[key].IsArray()) - { - std::cout << "Warning: write to json, key " << (*begin).key - << " exist and is not an object or array, and abacus will add it as a middle node." << std::endl; - } - add_nested_member(begin + 1, end, val, parent[key], allocator,IsArray); - } - else - { - rapidjson::Value paraent_val(rapidjson::kObjectType); - add_nested_member(begin + 1, end, val, paraent_val, allocator,IsArray); - parent.AddMember(key, paraent_val, allocator); - } - } - } -} -// Output the json to a file -void AbacusJson::write_to_json(std::string filename) -{ - rapidjson::StringBuffer buffer; - rapidjson::PrettyWriter writer(buffer); - doc.Accept(writer); - - std::ofstream ofs(filename); - ofs << buffer.GetString(); - ofs.close(); -}; - template <> - void AbacusJson::add_json(std::vector keys, const std::string& value,bool IsArray) - { - if (!doc.IsObject()) - { - doc.SetObject(); - } - rapidjson::Value val(value.c_str(), doc.GetAllocator()); - add_nested_member(keys.begin(), keys.end(), val, doc, doc.GetAllocator(),IsArray); - } - - -// Overloaded template functions for json class objects - template <> - void AbacusJson::add_json(std::vector keys, const rapidjson::Value& value,bool IsArray) - { - - if (!doc.IsObject()) - { - doc.SetObject(); - } - - rapidjson::Value val(value,doc.GetAllocator()); - add_nested_member(keys.begin(), keys.end(), val, doc, doc.GetAllocator(),IsArray); - } -#endif -} // namespace Json diff --git a/source/module_io/json_output/abacusjson.h b/source/module_io/json_output/abacusjson.h deleted file mode 100644 index 7bc003bbc9..0000000000 --- a/source/module_io/json_output/abacusjson.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef ABACUS_JSON_H -#define ABACUS_JSON_H - -#include -#include -#include -#include -#include "json_node.h" - - -#ifdef __RAPIDJSON -#include "rapidjson/document.h" -#include "rapidjson/prettywriter.h" -#include "rapidjson/stringbuffer.h" - -/** -* @brief Define of AbacusJson:These macro definitions simplify the complex parameters -* required to add objects in rapidjson, making it easy to use. -* @usage: 1. create the json value by Type: eg. -* Json::jsonValue object(JobjectType); -* Json::jsonValue array(JarrayType); -* 2 - object. add the parameter by using correct function. If the constructed object contains -* type std::string, select the correct macro definition function in the key -* or value position based on std::string. -* eg. key is std::string, using: object.JaddStringK(str,val) -* eg. val is std::string, using: object.JaddStringV (str,val) -* eg. both key,val is std::string, using: object.JaddStringKV(str,val) -* eg. none of key,val is std::string, using: object.JaddNormal(str,val) -* -* 2 - array. using: array.JPushBack(val) -* or : JPushBackString(val) -*/ - -#define JobjectType rapidjson::kObjectType -#define JarrayType rapidjson::kArrayType -#define Get_Jallocator Json::AbacusJson::allocator() -#define Set_JString(str) Json::jsonValue().SetString(str.c_str(),str.length(),Get_Jallocator) - - -#define JaddStringV(str,val) AddMember(str, Set_JString(val), Get_Jallocator) -#define JaddStringK(str,val) AddMember(Set_JString(str), val, Get_Jallocator) -#define JaddStringKV(str,val) AddMember(Set_JString(str), Set_JString(val), Get_Jallocator) -#define JaddNormal(str,val) AddMember(str, val, Get_Jallocator) -#define JPushBack(val) PushBack(val, Get_Jallocator) -#define JPushBackString(val) PushBack(Set_JString(val), Get_Jallocator) -/** -* @brief The json processing module in abacus contains basic meta-operations such as -* adding, modifying, and checking json. -*/ - -namespace Json -{ - -using jsonValue = rapidjson::Value; -// This class is used to construct a json value, and output some key values to a json file. -class AbacusJson -{ - public: - - - - // Output the json to a file - static void write_to_json(std::string filename); - - static rapidjson::Document::AllocatorType& allocator(){ - return doc.GetAllocator(); - } - - /** - * @brief: The template specialization method adds value to the doc tree - * - * @param: 'keys' is a vector string, represents the path to be added to the json tree. - * - * 'value' is the value that needs to be added to the json tree, which type can be - * Json::jsonValue or other common value type(such as int, double ,bool ,std::string). - * - * 'IsArray' is a bool value, means the whether the root node to which 'value' is added is an array. - * - * @usage: 1. Add/Modify a double val to object json node (key2 is a object node): - * Json::AbacusJson::add_json({"key1","key2"}, 3.1415,false); - * - * 2. Pushback a double val to array json node (key2 is a array node): - * Json::AbacusJson::add_json({"key1","key2"}, 3.1415,true); - * - * 3. Modify a doble val to array json node (key2 is a array node), when use this method, - * The index number of the array starts at 0, if it's negative, it's going from back to front. - * eg. If the index is -1, it means that the last element of the array is modified: - * If we have a json array: {"key":[1,2,3]} - * i). Json::AbacusJson::add_json({"key",0}, 4,true); => {"key":[4,2,3]} - * ii). Json::AbacusJson::add_json({"key",-1}, 4,true); => {"key":[1,2,4]} - * iii). Json::AbacusJson::add_json({"key",1}, 4,true); => {"key":[1,4,3]} - * iv). Json::AbacusJson::add_json({"key",2}, 4,true); => {"key":[1,2,4]} - * iv). Json::AbacusJson::add_json({"key",3}, 4,true); => error!, The array element corresponding - * to the index has no value. - */ - template - static void add_json(std::vector keys, const T& value,bool IsArray) - { - if (!doc.IsObject()) - { - doc.SetObject(); - } - rapidjson::Value val(value); - add_nested_member(keys.begin(), keys.end(), val, doc, doc.GetAllocator(),IsArray); - } - - - - - private: - static rapidjson::Document doc; - - static void add_nested_member(std::vector::iterator begin, - std::vector::iterator end, - rapidjson::Value& val, - rapidjson::Value& parent, - rapidjson::Document::AllocatorType& allocator, - bool IsArray - ); - }; - -template <> -void AbacusJson::add_json(std::vector keys, const std::string& value,bool IsArray); - -template <> -void AbacusJson::add_json(std::vector keys, const rapidjson::Value& value,bool IsArray); - - -} // namespace Json -#endif - -#endif \ No newline at end of file diff --git a/source/module_io/json_output/general_info.cpp b/source/module_io/json_output/general_info.cpp deleted file mode 100644 index c57a9c5746..0000000000 --- a/source/module_io/json_output/general_info.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "general_info.h" - -#include "../para_json.h" -#include "abacusjson.h" -#include "source_base/parallel_global.h" -#include "source_main/version.h" - -// Add json objects to gener_info -namespace Json -{ - -#ifdef __RAPIDJSON -void gen_general_info(const Parameter& param) -{ - -#ifdef VERSION - const std::string version = VERSION; -#else - const std::string version = "unknown"; -#endif -#ifdef COMMIT_INFO -#include "commit.h" - const std::string commit = COMMIT; -#else - const std::string commit = "unknown"; -#endif - - // start_time - std::time_t start_time = param.globalv.start_time; - std::string start_time_str; - convert_time(start_time, start_time_str); - - // end_time - std::time_t time_now = std::time(nullptr); - std::string end_time_str; - convert_time(time_now, end_time_str); - -#ifdef __MPI - int mpi_num = Parallel_Global::mpi_number; - int omp_num = Parallel_Global::omp_number; -#else - int mpi_num = 1; - int omp_num = 1; -#endif - - AbacusJson::add_json({"general_info", "version"}, version, false); - AbacusJson::add_json({"general_info", "commit"}, commit, false); - AbacusJson::add_json({"general_info", "device"}, param.inp.device, false); - AbacusJson::add_json({"general_info", "mpi_num"}, mpi_num, false); - AbacusJson::add_json({"general_info", "omp_num"}, omp_num, false); - AbacusJson::add_json({"general_info", "pseudo_dir"}, param.inp.pseudo_dir, false); - AbacusJson::add_json({"general_info", "orbital_dir"}, param.inp.orbital_dir, false); - AbacusJson::add_json({"general_info", "stru_file"}, param.globalv.global_in_stru, false); - AbacusJson::add_json({"general_info", "kpt_file"}, param.inp.kpoint_file, false); - AbacusJson::add_json({"general_info", "start_time"}, start_time_str, false); - AbacusJson::add_json({"general_info", "end_time"}, end_time_str, false); - - // AbacusJson::add_Json(version,false,"general_info", "version"); - // AbacusJson::add_Json(commit,false,"general_info", "commit"); - // AbacusJson::add_Json(param.inp.device,false,"general_info", "device"); - // AbacusJson::add_Json(mpi_num,false,"general_info", "mpi_num"); - // AbacusJson::add_Json(omp_num,false,"general_info", "omp_num"); - // AbacusJson::add_Json(param.inp.pseudo_dir,false,"general_info", "pseudo_dir"); - // AbacusJson::add_Json(param.inp.orbital_dir,false,"general_info", "orbital_dir"); - // AbacusJson::add_Json(param.inp.stru_file,false,"general_info", "stru_file"); - // AbacusJson::add_Json(param.inp.kpoint_file,false,"general_info", "kpt_file"); - // AbacusJson::add_Json(start_time_str,false,"general_info", "start_time"); - // AbacusJson::add_Json(end_time_str,false,"general_info", "end_time"); -} -#endif -} // namespace Json \ No newline at end of file diff --git a/source/module_io/json_output/general_info.h b/source/module_io/json_output/general_info.h deleted file mode 100644 index c94c59cd64..0000000000 --- a/source/module_io/json_output/general_info.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GENERAL_INFO_H -#define GENERAL_INFO_H -#include "module_parameter/parameter.h" - -/** -* @brief In this part of the code to complete the general_info part of the json tree. -*/ -namespace Json -{ -#ifdef __RAPIDJSON -void gen_general_info(const Parameter& param); -#endif -} -#endif \ No newline at end of file diff --git a/source/module_io/json_output/init_info.cpp b/source/module_io/json_output/init_info.cpp deleted file mode 100644 index 0b35642248..0000000000 --- a/source/module_io/json_output/init_info.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include "init_info.h" - -#include "module_parameter/parameter.h" -#include "../para_json.h" -#include "abacusjson.h" - -// Add json objects to init -namespace Json -{ - -#ifdef __RAPIDJSON - -void gen_init(UnitCell* ucell) -{ - std::string pgname = ucell->symm.pgname; - std::string spgname = ucell->symm.spgname; - AbacusJson::add_json({"init", "point_group"}, pgname, false); - AbacusJson::add_json({"init", "point_group_in_space"}, spgname, false); - - // Json::AbacusJson::add_Json(pgname,false,"init", "point_group"); - // Json::AbacusJson::add_Json(spgname,false,"init","point_group_in_space"); - - int numAtoms = ucell->nat; - AbacusJson::add_json({"init", "natom"}, numAtoms, false); - AbacusJson::add_json({"init", "nband"}, PARAM.inp.nbands, false); - - // Json::AbacusJson::add_Json(numAtoms,false,"init", "natom"); - // Json::AbacusJson::add_Json(PARAM.inp.nbands,false,"init", "nband"); - - int ntype = ucell->ntype, nelec_total = 0; - for (int it = 0; it < ntype; it++) - { - std::string label = ucell->atoms[it].label; - int atom_number = ucell->atoms[it].na; - double number = ucell->atoms[it].ncpp.zv; - - nelec_total += ucell->atoms[it].ncpp.zv * ucell->atoms[it].na; - AbacusJson::add_json({"init", "natom_each_type", label}, atom_number, false); - AbacusJson::add_json({"init", "nelectron_each_type", label}, number, false); - - // Json::AbacusJson::add_Json(number,false,"init", "nelectron_each_type",label); - } - - AbacusJson::add_json({"init", "nelectron"}, nelec_total, false); - - // Json::AbacusJson::add_Json(nelec_total,false,"init", "nelectron"); -} - -void add_nkstot(int nkstot) -{ - Json::AbacusJson::add_json({"init", "nkstot"}, nkstot, false); - - // Json::AbacusJson::add_Json(nkstot,false,"init", "nkstot"); - // Json::AbacusJson::add_Json(nkstot_ibz,false,"init", "nkstot_ibz"); -} - -void gen_stru(UnitCell* ucell) -{ - AbacusJson::add_json({"comment"}, - "Unless otherwise specified, the unit of energy is eV and the unit of length is Angstrom", - false); - - int ntype = ucell->ntype; - - // array of pseudopotential file - std::string* pseudo_fn = ucell->pseudo_fn.data(); - - // array of orbital file - std::string* orbital_fn = ucell->orbital_fn.data(); - - // add atom element,orbital file and pseudopotential file - for (int i = 0; i < ntype; i++) - { - std::string atom_label = ucell->atoms[i].label; - - std::string atom_element = ucell->atoms[i].ncpp.psd; - - Json::AbacusJson::add_json({"init", "element", atom_label}, atom_element, false); - - std::string orbital_str = PARAM.inp.orbital_dir + orbital_fn[i]; - if (!orbital_str.compare("")) - { - Json::jsonValue nullValue; - nullValue.SetNull(); - Json::AbacusJson::add_json({"init", "orb", atom_label}, nullValue, false); - - // Json::AbacusJson::add_Json(nullValue,false,"init","orb",atom_label); - } - else - { - Json::AbacusJson::add_json({"init", "orb", atom_label}, orbital_str, false); - // Json::AbacusJson::add_Json(orbital_str,false,"init","orb",atom_label); - } - std::string pseudo_str = pseudo_fn[i]; - Json::AbacusJson::add_json({"init", "pp", atom_label}, pseudo_str, false); - - // Json::AbacusJson::add_Json(pseudo_str,false,"init","pp",atom_label); - } - - // atom coordinate, mag and label - double lat0 = ucell->lat0; - std::string* label = ucell->atom_label.data(); - for (int i = 0; i < ntype; i++) - { - ModuleBase::Vector3* tau = ucell->atoms[i].tau.data(); - int na = ucell->atoms[i].na; - for (int j = 0; j < na; j++) - { - Json::jsonValue coordinateArray(JarrayType); - coordinateArray.JPushBack(tau[j][0] * lat0); - coordinateArray.JPushBack(tau[j][1] * lat0); - coordinateArray.JPushBack(tau[j][2] * lat0); - Json::AbacusJson::add_json({"init", "coordinate"}, coordinateArray, true); - // Json::AbacusJson::add_Json(coordinateArray,true,"init","coordinate"); - - Json::AbacusJson::add_json({"init", "mag"}, ucell->atoms[i].mag[j], true); - - // Json::AbacusJson::add_Json(ucell->atoms[i].mag[j],true,"init","mag"); - - std::string str = label[i]; - Json::AbacusJson::add_json({"init", "label"}, str, true); - // Json::AbacusJson::add_Json(str,true,"init","label"); - } - } - - // cell - { - Json::jsonValue cellArray1(JarrayType); - Json::jsonValue cellArray2(JarrayType); - Json::jsonValue cellArray3(JarrayType); - cellArray1.JPushBack(ucell->latvec.e11); - cellArray1.JPushBack(ucell->latvec.e12); - cellArray1.JPushBack(ucell->latvec.e13); - cellArray2.JPushBack(ucell->latvec.e21); - cellArray2.JPushBack(ucell->latvec.e22); - cellArray2.JPushBack(ucell->latvec.e23); - cellArray3.JPushBack(ucell->latvec.e31); - cellArray3.JPushBack(ucell->latvec.e32); - cellArray3.JPushBack(ucell->latvec.e33); - Json::AbacusJson::add_json({"init", "cell"}, cellArray1, true); - Json::AbacusJson::add_json({"init", "cell"}, cellArray2, true); - Json::AbacusJson::add_json({"init", "cell"}, cellArray3, true); - - // Json::AbacusJson::add_Json(cellArray1,true,"init","cell"); - // Json::AbacusJson::add_Json(cellArray2,true,"init","cell"); - // Json::AbacusJson::add_Json(cellArray3,true,"init","cell"); - } - return; -} - -#endif -} // namespace Json \ No newline at end of file diff --git a/source/module_io/json_output/init_info.h b/source/module_io/json_output/init_info.h deleted file mode 100644 index 2bec54d39d..0000000000 --- a/source/module_io/json_output/init_info.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef INIT_INFO_H -#define INIT_INFO_H -#include "source_cell/atom_spec.h" -#include "source_cell/module_symmetry/symmetry.h" -#include "source_cell/unitcell.h" - -/** - * @brief In this part of the code to complete the init part of the json tree. - */ -namespace Json -{ -#ifdef __RAPIDJSON -// void gen_init(ModuleSymmetry::Symmetry *symm,Atom *atoms); - -/** - * @param ucell: ucell for reading json parameters. - */ -void gen_init(UnitCell* ucell); - -/** - * @param nkstot,nkstot_ibz: two param in json tree - */ -void add_nkstot(int nkstot); - -/** - * @param ucell: ucell for reading structure init in abacus. - */ -void gen_stru(UnitCell* ucell); -#endif -} // namespace Json -#endif \ No newline at end of file diff --git a/source/module_io/json_output/json_node.h b/source/module_io/json_output/json_node.h deleted file mode 100644 index f19bddcf78..0000000000 --- a/source/module_io/json_output/json_node.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef JSON_NODE_H -#define JSON_NODE_H - -namespace Json -{ - - class jsonKeyNode{ - public: - jsonKeyNode(int i): i(i) {}; - jsonKeyNode(const std::string& s): key(s) {}; - - template - jsonKeyNode(const char (&s)[N]): key(s) {}; - - int i=0; - std::string key; - }; - -} - -#endif \ No newline at end of file diff --git a/source/module_io/json_output/output_info.cpp b/source/module_io/json_output/output_info.cpp deleted file mode 100644 index 8e45ec9282..0000000000 --- a/source/module_io/json_output/output_info.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include "output_info.h" -#include "../para_json.h" -#include "module_parameter/parameter.h" -#include "abacusjson.h" - - -//Add json objects to init -namespace Json -{ - -#ifdef __RAPIDJSON - - - // Adjust the position of the json object and set the initial value - void init_output_array_obj(){ - - - - jsonValue scf_obj(JobjectType); - - Json::jsonValue nullValue; - nullValue.SetNull(); - scf_obj.JaddNormal("e_fermi",nullValue); - scf_obj.JaddNormal("energy",nullValue); - scf_obj.JaddNormal("scf_converge",nullValue); - - jsonValue force(JobjectType); - jsonValue stress(JobjectType); - jsonValue coordinate(JarrayType); - jsonValue mag(JarrayType); - jsonValue cell(JarrayType); - - scf_obj.JaddNormal("force",nullValue); - scf_obj.JaddNormal("stress",nullValue); - scf_obj.JaddNormal("coordinate",coordinate); - scf_obj.JaddNormal("mag",mag); - scf_obj.JaddNormal("cell",cell); - - - AbacusJson::add_json({"output"},scf_obj,true); - } - - void add_output_cell_coo_stress_force( - const UnitCell *ucell, - const ModuleBase::matrix force, const double fac, - const ModuleBase::matrix stress, const double unit_transform - ) { - int iat = 0; - const double output_acc = 1.0e-8; - - if (PARAM.inp.cal_force){ - //add force - Json::jsonValue force_array(JarrayType); - for (int it = 0; it < ucell->ntype; it++) - { - for (int ia = 0; ia < ucell->atoms[it].na; ia++) - { - Json::jsonValue force_subarray(JarrayType); - double fx = std::abs(force(iat, 0)) > output_acc ? force(iat, 0) * fac : 0.0; - double fy = std::abs(force(iat, 1)) > output_acc ? force(iat, 1) * fac : 0.0; - double fz = std::abs(force(iat, 2)) > output_acc ? force(iat, 2) * fac : 0.0; - - force_subarray.JPushBack(fx); - force_subarray.JPushBack(fy); - force_subarray.JPushBack(fz); - force_array.JPushBack(force_subarray); - iat++; - } - } - Json::AbacusJson::add_json({"output",-1,"force"}, force_array,false); - - // AbacusJson::add_Json(force_array,false,"output",-1,"force"); - } - - if (PARAM.inp.cal_stress){ - //add stress - Json::jsonValue stress_array(JarrayType); - for (int i = 0; i < 3; i++) - { - Json::jsonValue stress_subarray(JarrayType); - double sx = stress(i, 0) * unit_transform; - double sy = stress(i, 1) * unit_transform; - double sz = stress(i, 2) * unit_transform; - stress_subarray.JPushBack(sx); - stress_subarray.JPushBack(sy); - stress_subarray.JPushBack(sz); - stress_array.JPushBack(stress_subarray); - } - Json::AbacusJson::add_json({"output",-1,"stress"}, stress_array,false); - - // AbacusJson::add_Json(stress_array,false,"output",-1,"stress"); - } - //add coordinate - int ntype = ucell->ntype; - double lat0 = ucell->lat0; - for(int i=0;i* tau = ucell->atoms[i].tau.data(); - int na = ucell->atoms[i].na; - for(int j=0;jatoms[i].mag[j],true); - } - } - - //add cell - { - Json::jsonValue cellArray1(JarrayType); - Json::jsonValue cellArray2(JarrayType); - Json::jsonValue cellArray3(JarrayType); - cellArray1.JPushBack(ucell->latvec.e11); - cellArray1.JPushBack(ucell->latvec.e12); - cellArray1.JPushBack(ucell->latvec.e13); - cellArray2.JPushBack(ucell->latvec.e21); - cellArray2.JPushBack(ucell->latvec.e22); - cellArray2.JPushBack(ucell->latvec.e23); - cellArray3.JPushBack(ucell->latvec.e31); - cellArray3.JPushBack(ucell->latvec.e32); - cellArray3.JPushBack(ucell->latvec.e33); - Json::AbacusJson::add_json({"output",-1,"cell"}, cellArray1,true); - Json::AbacusJson::add_json({"output",-1,"cell"}, cellArray2,true); - Json::AbacusJson::add_json({"output",-1,"cell"}, cellArray3,true); - - // Json::AbacusJson::add_Json(cellArray1,true,"output",-1,"cell"); - // Json::AbacusJson::add_Json(cellArray2,true,"output",-1,"cell"); - // Json::AbacusJson::add_Json(cellArray2,true,"output",-1,"cell"); - } - - } - - void add_output_efermi_converge(const double efermi, const bool scf_converge ){ - Json::AbacusJson::add_json({"output",-1,"e_fermi"}, efermi,false); - Json::AbacusJson::add_json({"output",-1,"scf_converge"}, scf_converge,false); - } - - void add_output_energy(const double energy) - { - Json::AbacusJson::add_json({"output",-1,"energy"}, energy,false); - } - - void add_output_scf_mag( - double total_mag, double absolute_mag, - double energy, double ediff, double drho,double time - ){ - Json::AbacusJson::add_json({"output",-1,"total_mag"}, total_mag,false); - Json::AbacusJson::add_json({"output",-1,"absolute_mag"}, absolute_mag,false); - - // Json::AbacusJson::add_Json(total_mag,false,"output",-1,"total_mag"); - // Json::AbacusJson::add_Json(absolute_mag,false,"output",-1,"absolute_mag"); - - Json::jsonValue scf_obj(JobjectType); - scf_obj.JaddNormal("energy",energy); - scf_obj.JaddNormal("ediff",ediff); - scf_obj.JaddNormal("drho",drho); - scf_obj.JaddNormal("time",time); - Json::AbacusJson::add_json({"output",-1,"scf"}, scf_obj,true); - - // Json::AbacusJson::add_Json(scf_obj,true,"output",-1,"scf"); - } - -#endif -} // namespace Json \ No newline at end of file diff --git a/source/module_io/json_output/output_info.h b/source/module_io/json_output/output_info.h deleted file mode 100644 index 8ab42f73b4..0000000000 --- a/source/module_io/json_output/output_info.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef OUTPUT_INFO_H -#define OUTPUT_INFO_H - -#include "source_cell/module_symmetry/symmetry.h" -#include "source_cell/atom_spec.h" -#include "source_cell/unitcell.h" -#include "source_base/matrix.h" - - -/** -* @brief In this part of the code to complete the output part of the json tree. -* @param ucell: ucell for reading json parameters -*/ -namespace Json -{ -#ifdef __RAPIDJSON - - void init_output_array_obj(); - - void add_output_cell_coo_stress_force( - const UnitCell *ucell, - const ModuleBase::matrix force, const double fac, - const ModuleBase::matrix stress, const double unit_transform - ); - - void add_output_efermi_converge(const double efermi, const bool scf_converge ); - void add_output_energy(const double energy ); - - void add_output_scf_mag( - const double total_mag, const double absolute_mag, - const double energy, const double ediff, const double drho,const double time - ); - -#endif -} -#endif \ No newline at end of file diff --git a/source/module_io/json_output/readin_info.cpp b/source/module_io/json_output/readin_info.cpp deleted file mode 100644 index 88e400026d..0000000000 --- a/source/module_io/json_output/readin_info.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "readin_info.h" -#include "../para_json.h" -#include "abacusjson.h" - - -//Add json objects to init -namespace Json -{ - -#ifdef __RAPIDJSON - - - - -#endif -} // namespace Json \ No newline at end of file diff --git a/source/module_io/json_output/readin_info.h b/source/module_io/json_output/readin_info.h deleted file mode 100644 index 35a7205487..0000000000 --- a/source/module_io/json_output/readin_info.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef READIN_INFO_H -#define READIN_INFO_H -#include "source_cell/module_symmetry/symmetry.h" -#include "source_cell/atom_spec.h" -#include "source_cell/unitcell.h" - - - -/** -* @brief In this part of the code to complete the readin part of the json tree. -* @param ucell: ucell for reading json parameters -*/ -namespace Json -{ -#ifdef __RAPIDJSON - - - -#endif -} -#endif \ No newline at end of file diff --git a/source/module_io/json_output/test/CMakeLists.txt b/source/module_io/json_output/test/CMakeLists.txt deleted file mode 100644 index 51bf466cc5..0000000000 --- a/source/module_io/json_output/test/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -remove_definitions(-D__MLALGO) -remove_definitions(-D__CUDA) -remove_definitions(-D__ROCM) -remove_definitions(-D__EXX) - -AddTest( - TARGET MODULE_IO_JSON_OUTPUT_TEST - LIBS parameter ${math_libs} base device cell_info - SOURCES para_json_test.cpp ../general_info.cpp ../init_info.cpp ../readin_info.cpp - ../../para_json.cpp ../abacusjson.cpp ../../output.cpp -) \ No newline at end of file diff --git a/source/module_io/json_output/test/para_json_test.cpp b/source/module_io/json_output/test/para_json_test.cpp deleted file mode 100644 index 26d04e2b0a..0000000000 --- a/source/module_io/json_output/test/para_json_test.cpp +++ /dev/null @@ -1,398 +0,0 @@ -#include "gtest/gtest.h" -#define private public -#define __RAPIDJSON 1 -#include "../abacusjson.h" -#include "../general_info.h" -#include "../init_info.h" -#include "../readin_info.h" -#include "module_parameter/parameter.h" -#include "module_io/para_json.h" -#include "source_main/version.h" -#undef private -/************************************************ - * unit test of json output module - ************************************************ -/** - * - Tested Functions: - * - AddJson() - * - Verify the normal addition of json structure parameters in the json function. - * - OutputJson() - * - Verify the correctness of the json output. - * - GeneralInfo() - * - Test the correctness of the json output of the General Info module. - * - InitInfo() - * - Test the correctness of the json output of the Init info module. - */ - -TEST(AbacusJsonTest, AddJson) -{ - Json::AbacusJson::doc.SetObject(); - - // add a string - Json::AbacusJson::add_json({"key1"}, "value1", false); - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("key1")); - ASSERT_TRUE(Json::AbacusJson::doc["key1"].IsString()); - ASSERT_STREQ(Json::AbacusJson::doc["key1"].GetString(), "value1"); - - // add a string to a nested object - Json::AbacusJson::add_json({"key2", "key3"}, "value2", false); - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("key2")); - ASSERT_TRUE(Json::AbacusJson::doc["key2"].IsObject()); - ASSERT_TRUE(Json::AbacusJson::doc["key2"].HasMember("key3")); - ASSERT_TRUE(Json::AbacusJson::doc["key2"]["key3"].IsString()); - ASSERT_STREQ(Json::AbacusJson::doc["key2"]["key3"].GetString(), "value2"); - - // add an int - Json::AbacusJson::add_json({"key2"}, 123, false); - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("key2")); - ASSERT_TRUE(Json::AbacusJson::doc["key2"].IsInt()); - ASSERT_EQ(Json::AbacusJson::doc["key2"].GetInt(), 123); - - // add a bool - Json::AbacusJson::add_json({"key3"}, true, false); - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("key3")); - ASSERT_TRUE(Json::AbacusJson::doc["key3"].IsBool()); - ASSERT_EQ(Json::AbacusJson::doc["key3"].GetBool(), true); - - // add a double - Json::AbacusJson::add_json({"key4"}, 1.23, false); - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("key4")); - ASSERT_TRUE(Json::AbacusJson::doc["key4"].IsDouble()); - ASSERT_EQ(Json::AbacusJson::doc["key4"].GetDouble(), 1.23); - - // modify a value - Json::AbacusJson::add_json({"key4"}, 4.56, false); - ASSERT_EQ(Json::AbacusJson::doc["key4"].GetDouble(), 4.56); - - // array test - Json::AbacusJson::add_json({"key6", "key7"}, true, true); - Json::AbacusJson::add_json({"key6", "key7"}, false, true); - - // add key-val to a object array - for (int i = 0; i < 3; i++) - { - Json::jsonValue object(JobjectType); - object.JaddNormal("int", i); - - std::string str = std::to_string(i * 100); - std::string str2 = "Kstring"; - - object.JaddStringV("string", str); - object.JaddStringK(str, "string"); - object.JaddStringKV(str2, str); - object.JaddNormal("double", 0.01 * i); - Json::AbacusJson::add_json({"array"}, object, true); - } - Json::AbacusJson::add_json({"array", 1, "new_add_notLast"}, "correct1", false); - Json::AbacusJson::add_json({"array", -1, "new_add_Last"}, "correct2", false); - - // Validate json parameters in doc objects - - ASSERT_EQ(Json::AbacusJson::doc["array"][0]["int"].GetInt(), 0); - ASSERT_STREQ(Json::AbacusJson::doc["array"][0]["string"].GetString(), "0"); - ASSERT_STREQ(Json::AbacusJson::doc["array"][0]["0"].GetString(), "string"); - ASSERT_STREQ(Json::AbacusJson::doc["array"][0]["Kstring"].GetString(), "0"); - ASSERT_STREQ(Json::AbacusJson::doc["array"][1]["new_add_notLast"].GetString(), "correct1"); - - ASSERT_EQ(Json::AbacusJson::doc["array"][0]["double"].GetDouble(), 0.0); - - ASSERT_EQ(Json::AbacusJson::doc["array"][1]["int"].GetInt(), 1); - ASSERT_STREQ(Json::AbacusJson::doc["array"][1]["string"].GetString(), "100"); - - ASSERT_STREQ(Json::AbacusJson::doc["array"][1]["100"].GetString(), "string"); - ASSERT_STREQ(Json::AbacusJson::doc["array"][1]["Kstring"].GetString(), "100"); - - ASSERT_EQ(Json::AbacusJson::doc["array"][1]["double"].GetDouble(), 0.01); - - ASSERT_EQ(Json::AbacusJson::doc["array"][2]["int"].GetInt(), 2); - ASSERT_STREQ(Json::AbacusJson::doc["array"][2]["string"].GetString(), "200"); - - ASSERT_STREQ(Json::AbacusJson::doc["array"][2]["200"].GetString(), "string"); - ASSERT_STREQ(Json::AbacusJson::doc["array"][2]["Kstring"].GetString(), "200"); - ASSERT_EQ(Json::AbacusJson::doc["array"][2]["double"].GetDouble(), 0.02); - - ASSERT_STREQ(Json::AbacusJson::doc["array"][2]["new_add_Last"].GetString(), "correct2"); - - // add array in array - Json::jsonValue object0(JarrayType); - - object0.JPushBack(1); - object0.JPushBack(2); - object0.JPushBack(3); - - Json::jsonValue object1(JarrayType); - - object1.JPushBack(2.1); - object1.JPushBack(3.1); - object1.JPushBack(4.1); - - Json::jsonValue object2(JarrayType); - - object2.JPushBack("str1"); - object2.JPushBack("str2"); - object2.JPushBack("str3"); - - Json::jsonValue object3(JarrayType); - - std::string astr1 = "string1"; - std::string astr2 = "string2"; - std::string astr3 = "string3"; - object3.JPushBackString(astr1); - object3.JPushBackString(astr2); - object3.JPushBackString(astr3); - - Json::AbacusJson::add_json({"Darray"}, object0, true); - Json::AbacusJson::add_json({"Darray"}, object1, true); - Json::AbacusJson::add_json({"Darray"}, object2, true); - Json::AbacusJson::add_json({"Darray"}, object3, true); - - Json::AbacusJson::add_json({"Darray", 1, 0}, "new_add_method", false); - Json::AbacusJson::add_json({"Darray", 1, -2}, 40, false); - - ASSERT_EQ(Json::AbacusJson::doc["Darray"][1][0].GetString(), "new_add_method"); - - ASSERT_EQ(Json::AbacusJson::doc["Darray"][0][0].GetInt(), 1); - ASSERT_EQ(Json::AbacusJson::doc["Darray"][0][1].GetInt(), 2); - ASSERT_EQ(Json::AbacusJson::doc["Darray"][0][2].GetInt(), 3); - - ASSERT_EQ(Json::AbacusJson::doc["Darray"][1][1].GetDouble(), 40); - ASSERT_EQ(Json::AbacusJson::doc["Darray"][1][2].GetDouble(), 4.1); - - ASSERT_STREQ(Json::AbacusJson::doc["Darray"][2][0].GetString(), "str1"); - ASSERT_STREQ(Json::AbacusJson::doc["Darray"][2][1].GetString(), "str2"); - ASSERT_STREQ(Json::AbacusJson::doc["Darray"][2][2].GetString(), "str3"); - - ASSERT_STREQ(Json::AbacusJson::doc["Darray"][3][0].GetString(), "string1"); - ASSERT_STREQ(Json::AbacusJson::doc["Darray"][3][1].GetString(), "string2"); - ASSERT_STREQ(Json::AbacusJson::doc["Darray"][3][2].GetString(), "string3"); -} - -TEST(AbacusJsonTest, OutputJson) -{ - Json::AbacusJson::doc.SetObject(); - - Json::AbacusJson::add_json({"key1"}, "value1", false); - Json::AbacusJson::add_json({"key2", "key3"}, 1, false); - Json::AbacusJson::add_json({"key4"}, 0.1, false); - Json::AbacusJson::add_json({"key5"}, true, false); - - Json::jsonValue object(JobjectType); - object.JaddNormal("int", 1); - Json::jsonValue object2(JarrayType); - - object.JaddNormal("arr", object2); - - // array test - Json::AbacusJson::add_json({"key6", "key7"}, object, true); - Json::AbacusJson::add_json({"key6", "key7", 0, "arr"}, 13, true); - Json::AbacusJson::add_json({"key6", "key7", 0, "arr"}, 14, true); - Json::AbacusJson::add_json({"key6", "key7", 0, "arr", 0}, 1, true); - - std::string filename = "test.json"; - Json::AbacusJson::write_to_json(filename); - - std::ifstream file(filename); - ASSERT_TRUE(file.is_open()); - - std::string content((std::istreambuf_iterator(file)), std::istreambuf_iterator()); - ASSERT_NE(content.find("\"key1\": \"value1\","), std::string::npos); - ASSERT_NE(content.find("\"key2\": {"), std::string::npos); - ASSERT_NE(content.find("\"key3\": 1"), std::string::npos); - ASSERT_NE(content.find("\"key4\": 0.1"), std::string::npos); - ASSERT_NE(content.find("\"key5\": true"), std::string::npos); - - file.close(); -} - -TEST(AbacusJsonTest, GeneralInfo) -{ - std::time_t time_now = std::time(nullptr); - std::string start_time_str; - Json::convert_time(time_now, start_time_str); - PARAM.sys.start_time = time_now; - - PARAM.input.device = "cpu"; - PARAM.input.pseudo_dir = "./abacus/test/pseudo_dir"; - PARAM.input.orbital_dir = "./abacus/test/orbital_dir"; - PARAM.sys.global_in_stru = "./abacus/test/stru_file"; - PARAM.input.kpoint_file = "./abacus/test/kpoint_file"; - // output the json file - Json::AbacusJson::doc.Parse("{}"); - Json::gen_general_info(PARAM); - Json::json_output(); - - std::string filename = "abacus.json"; - std::ifstream file(filename); - ASSERT_TRUE(file.is_open()); - - std::string content((std::istreambuf_iterator(file)), std::istreambuf_iterator()); - - ASSERT_NE(content.find(VERSION), std::string::npos); - ASSERT_NE(content.find("\"device\": \"cpu\","), std::string::npos); - ASSERT_NE(content.find("\"omp_num\": 0,"), std::string::npos); - ASSERT_NE(content.find("\"mpi_num\": 0,"), std::string::npos); - ASSERT_NE(content.find("\"orbital_dir\": \"./abacus/test/orbital_dir\","), std::string::npos); - ASSERT_NE(content.find("\"pseudo_dir\": \"./abacus/test/pseudo_dir\","), std::string::npos); - ASSERT_NE(content.find("\"stru_file\": \"./abacus/test/stru_file\","), std::string::npos); - ASSERT_NE(content.find("\"kpt_file\": \"./abacus/test/kpoint_file\","), std::string::npos); - ASSERT_NE(content.find(start_time_str), std::string::npos); -} - -#ifdef __LCAO -#include "source_basis/module_ao/ORB_read.h" -InfoNonlocal::InfoNonlocal() -{ -} -InfoNonlocal::~InfoNonlocal() -{ -} -LCAO_Orbitals::LCAO_Orbitals() -{ -} -LCAO_Orbitals::~LCAO_Orbitals() -{ -} -#endif -Magnetism::Magnetism() -{ - this->tot_mag = 0.0; - this->abs_mag = 0.0; - this->start_mag = nullptr; -} -Magnetism::~Magnetism() -{ - delete[] this->start_mag; -} -TEST(AbacusJsonTest, InitInfo) -{ - UnitCell ucell; - Atom atomlist[3]; - - ucell.symm.pgname = "T_d"; - ucell.symm.spgname = "O_h"; - ucell.atoms = atomlist; - ucell.ntype = 3; - PARAM.input.nbands = 10; - - ucell.atoms[0].label = "Si"; - ucell.atoms[0].ncpp.zv = 3; - ucell.atoms[0].na = 1; - ucell.atoms[1].label = "C"; - ucell.atoms[1].ncpp.zv = 4; - ucell.atoms[1].na = 2; - ucell.atoms[2].label = "O"; - ucell.atoms[2].ncpp.zv = 5; - ucell.atoms[2].na = 3; - ucell.nat = 0; - for (int i = 0; i < ucell.ntype; i++) - { - ucell.nat += ucell.atoms[i].na; - } - // init the doc allocator - Json::AbacusJson::doc.Parse("{}"); - int Jnkstot = 1; - - Json::add_nkstot(Jnkstot); - Json::gen_init(&ucell); - - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("init")); - ASSERT_EQ(Json::AbacusJson::doc["init"]["nkstot"].GetInt(), 1); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["natom"].GetInt(), 6); - ASSERT_EQ(Json::AbacusJson::doc["init"]["nband"].GetInt(), 10); - - ASSERT_STREQ(Json::AbacusJson::doc["init"]["point_group"].GetString(), "T_d"); - ASSERT_STREQ(Json::AbacusJson::doc["init"]["point_group_in_space"].GetString(), "O_h"); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["nelectron_each_type"]["Si"].GetDouble(), 3); - ASSERT_EQ(Json::AbacusJson::doc["init"]["nelectron_each_type"]["C"].GetDouble(), 4); - ASSERT_EQ(Json::AbacusJson::doc["init"]["nelectron_each_type"]["O"].GetDouble(), 5); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["natom_each_type"]["Si"].GetInt(), 1); - ASSERT_EQ(Json::AbacusJson::doc["init"]["natom_each_type"]["C"].GetInt(), 2); - ASSERT_EQ(Json::AbacusJson::doc["init"]["natom_each_type"]["O"].GetInt(), 3); -} - -TEST(AbacusJsonTest, Init_stru_test) -{ - // init ucell - UnitCell ucell; - - Atom atomlist[1]; - std::string label[1]; - - ModuleBase::Matrix3 latvec; - latvec.e11 = 0.1; - latvec.e12 = 0.1; - latvec.e13 = 0.1; - - latvec.e21 = 0.2; - latvec.e22 = 0.2; - latvec.e23 = 0.2; - - latvec.e31 = 0.3; - latvec.e32 = 0.3; - latvec.e33 = 0.3; - ucell.latvec = latvec; - - double lat0 = 10.0; - ucell.ntype = 1; - ucell.pseudo_fn.resize(1); - ucell.orbital_fn.resize(1); - ucell.atoms = atomlist; - ucell.atom_label.resize(1); - ucell.lat0 = lat0; - - ModuleBase::Vector3 tau[2]; - - Json::AbacusJson::doc.Parse("{}"); - - double mag[2]; - // fill ucell - for (int i = 0; i < 1; i++) - { - ucell.atom_label[i] = "Si"; - atomlist[i].na = 2; - atomlist[i].label = "Fe"; - ucell.pseudo_fn[i] = "si.ufp"; - ucell.atoms[i].tau.resize(2); - atomlist[i].mag.resize(2); - for (int j = 0; j < atomlist[i].na; j++) - { - atomlist[i].mag[j] = j * 131; - ucell.atoms[i].tau[j] = 0.1 * j; - } - } - Json::gen_stru(&ucell); - - std::string filename = "readin.json"; - Json::AbacusJson::write_to_json(filename); - // compare result - ASSERT_TRUE(Json::AbacusJson::doc.HasMember("init")); - ASSERT_EQ(Json::AbacusJson::doc["init"]["mag"][0].GetDouble(), 0); - ASSERT_EQ(Json::AbacusJson::doc["init"]["mag"][1].GetDouble(), 131.0); - - ASSERT_STREQ(Json::AbacusJson::doc["init"]["pp"]["Fe"].GetString(), "si.ufp"); - ASSERT_STREQ(Json::AbacusJson::doc["init"]["label"][0].GetString(), "Si"); - ASSERT_STREQ(Json::AbacusJson::doc["init"]["element"]["Fe"].GetString(), ""); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["coordinate"][0][0].GetDouble(), 0); - ASSERT_EQ(Json::AbacusJson::doc["init"]["coordinate"][0][1].GetDouble(), 0); - ASSERT_EQ(Json::AbacusJson::doc["init"]["coordinate"][0][2].GetDouble(), 0); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["coordinate"][1][0].GetDouble(), 1.0); - ASSERT_EQ(Json::AbacusJson::doc["init"]["coordinate"][1][1].GetDouble(), 1.0); - ASSERT_EQ(Json::AbacusJson::doc["init"]["coordinate"][1][2].GetDouble(), 1.0); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][0][0].GetDouble(), 0.1); - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][0][1].GetDouble(), 0.1); - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][0][2].GetDouble(), 0.1); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][1][0].GetDouble(), 0.2); - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][1][1].GetDouble(), 0.2); - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][1][2].GetDouble(), 0.2); - - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][2][0].GetDouble(), 0.3); - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][2][1].GetDouble(), 0.3); - ASSERT_EQ(Json::AbacusJson::doc["init"]["cell"][2][2].GetDouble(), 0.3); -} diff --git a/source/module_io/nscf_band.cpp b/source/module_io/nscf_band.cpp deleted file mode 100644 index b93b09937b..0000000000 --- a/source/module_io/nscf_band.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "nscf_band.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_base/formatter.h" - -#ifdef __MPI -#include -#endif - -void ModuleIO::nscf_band( - 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) -{ - ModuleBase::TITLE("ModuleIO","nscf_band"); - ModuleBase::timer::tick("ModuleIO", "nscf_band"); - - GlobalV::ofs_running << "\n"; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out the eigenvalues for each spin# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - GlobalV::ofs_running << "\n"; - - GlobalV::ofs_running << " Eigenvalues for plot are in file: " << eig_file << std::endl; - - // number of k points without spin; - // nspin = 1,2, nkstot = nkstot_np * nspin; - // nspin = 4, nkstot = nkstot_np - const int nkstot_np = kv.para_k.nkstot_np; - const int nks_np = kv.para_k.nks_np; - -#ifdef __MPI - if(GlobalV::MY_RANK==0) - { - std::ofstream ofs(eig_file.c_str());//make the file clear!! - ofs.close(); - } - - MPI_Barrier(MPI_COMM_WORLD); - std::vector klength; - klength.resize(nkstot_np); - klength[0] = 0.0; - std::vector> kvec_c_global; - kv.para_k.gatherkvec(kv.kvec_c, kvec_c_global); - - for(int ik=0; ik0) - { - auto delta=kvec_c_global[ik]-kvec_c_global[ik-1]; - klength[ik] = klength[ik-1]; - klength[ik] += (kv.kl_segids[ik] == kv.kl_segids[ik-1]) ? delta.norm() : 0.0; - } - //! first find if present kpoint in present pool - if ( GlobalV::MY_POOL == kv.para_k.whichpool[ik] ) - { - //! then get the local kpoint index, which starts definitly from 0 - const int ik_now = ik - kv.para_k.startk_pool[GlobalV::MY_POOL]; - //! if present kpoint corresponds the spin of the present one - assert( kv.isk[ik_now+is*nks_np] == is ); - if ( GlobalV::RANK_IN_POOL == 0) - { - std::ofstream ofs(eig_file.c_str(), std::ios::app); - ofs << FmtCore::format("%4d", ik+1); - int width = precision + 4; - std::string fmtstr = " %." + std::to_string(precision) + "f"; - ofs << FmtCore::format(fmtstr.c_str(), klength[ik]); - for(int ib = 0; ib < nband; ib++) - { - ofs << FmtCore::format(fmtstr.c_str(), (ekb(ik_now+is*nks_np, ib)-fermie) * ModuleBase::Ry_to_eV); - } - ofs << std::endl; - ofs.close(); - } - } - MPI_Barrier(MPI_COMM_WORLD); - } - -#else - std::vector klength; - klength.resize(nkstot_np); - klength[0] = 0.0; - std::ofstream ofs(eig_file.c_str()); - - for(int ik=0;ik0) - { - auto delta=kv.kvec_c[ik]-kv.kvec_c[ik-1]; - klength[ik] = klength[ik-1]; - klength[ik] += (kv.kl_segids[ik] == kv.kl_segids[ik-1]) ? delta.norm() : 0.0; - } - if( kv.isk[ik] == is) - { - ofs << FmtCore::format("%4d", ik+1); - int width = precision + 4; - std::string fmtstr = " %." + std::to_string(precision) + "f"; - ofs << FmtCore::format(fmtstr.c_str(), klength[ik]); - for(int ibnd = 0; ibnd < nband; ibnd++) - { - ofs << FmtCore::format(fmtstr.c_str(), (ekb(ik, ibnd)-fermie) * ModuleBase::Ry_to_eV); - } - ofs << std::endl; - } - } - ofs.close(); -#endif - - ModuleBase::timer::tick("ModuleIO", "nscf_band"); - return; -} diff --git a/source/module_io/nscf_band.h b/source/module_io/nscf_band.h deleted file mode 100644 index e458a0aba6..0000000000 --- a/source/module_io/nscf_band.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef NSCF_BAND_H -#define NSCF_BAND_H -#include "source_base/matrix.h" -#include "source_cell/klist.h" -#include "source_cell/parallel_kpoints.h" - -namespace ModuleIO -{ -/** - * @brief calculate the band structure - * - * @param is spin index is = 0 or 1 - * @param out_band_dir directory to save the band structure - * @param nband number of bands - * @param fermie fermi energy - * @param precision precision of the output - * @param ekb eigenvalues of k points and bands - * @param kv klist - */ -void nscf_band(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); -} - -#endif diff --git a/source/module_io/nscf_fermi_surf.cpp b/source/module_io/nscf_fermi_surf.cpp deleted file mode 100644 index 7c8b0ad337..0000000000 --- a/source/module_io/nscf_fermi_surf.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "nscf_fermi_surf.h" -#include "source_base/global_function.h" -#include "module_parameter/parameter.h" -#include "source_base/global_variable.h" -#include "source_base/timer.h" - -#ifdef __MPI -#include -#endif - -void ModuleIO::nscf_fermi_surface(const std::string &out_band_dir, - const int &nband, - const double &ef, - const K_Vectors& kv, - const UnitCell& ucell, - const ModuleBase::matrix &ekb) -{ - ModuleBase::TITLE("ModuleIO","nscf_fermi_surface"); - ModuleBase::timer::tick("ModuleIO", "nscf_fermi_surface"); -#ifdef __MPI - - const int start = 1; - const int end = PARAM.inp.nbands; - - std::ofstream ofs; - if(GlobalV::MY_RANK==0) - { - ofs.open(out_band_dir.c_str()); - ofs << std::setprecision(6); - ofs.close(); - } - - for(int ik=0; ik -#include -#include -#include -Numerical_Basis::Numerical_Basis() -{ -} -Numerical_Basis::~Numerical_Basis() -{ -} - -//============================================================ -// MEMBER FUNCTION : -// NAME : init -// DESCRIPTION : Two main functions: -// (1) start_from_file = true; -// Firstly, use check(1) to call bessel_basis.init -// to generate TableOne. -// Secondly readin C4 from file. -// Thirdly generate 3D atomic wfc in G space, put the -// results in psi. -// -// (2) If output overlap Q, start_from_file = false; -// Firstly, use check(0) to call bessel_basis,init -// to generate TableOne -// Secondly output overlap, use psi(evc) and jlq3d. -//============================================================ -// void Numerical_Basis::start_from_file_k(const int& ik, ModuleBase::ComplexMatrix& psi, const Structure_Factor& sf, -// const ModulePW::PW_Basis_K* wfcpw, const UnitCell& ucell) -// { -// ModuleBase::TITLE("Numerical_Basis", "start_from_file_k"); - -// if (!this->init_label) -// { -// // true stands for : start_from_file -// this->bessel_basis.init(true, std::stod(PARAM.inp.bessel_nao_ecut), ucell.ntype, ucell.lmax, -// PARAM.inp.bessel_nao_smooth, PARAM.inp.bessel_nao_sigma, PARAM.globalv.bessel_nao_rcut, -// PARAM.inp.bessel_nao_tolerence, ucell); -// this->mu_index = this->init_mu_index(ucell); -// this->init_label = true; -// } -// this->numerical_atomic_wfc(ik, wfcpw, psi, sf, ucell); -// } - -// The function is called in run_fp.cpp. -void Numerical_Basis::output_overlap(const psi::Psi>& psi, - const Structure_Factor& sf, - const K_Vectors& kv, - const ModulePW::PW_Basis_K* wfcpw, - const UnitCell& ucell, - const int& index) -{ - ModuleBase::TITLE("Numerical_Basis", "output_overlap"); - ModuleBase::GlobalFunc::NEW_PART("Overlap Data For Spillage Minimization"); - const double bessel_nao_rcut = PARAM.inp.bessel_nao_rcuts[index]; - - //--------------------------------------------------------- - // if the numerical_basis hasn't been initialized yet, - // then we initial here. - //--------------------------------------------------------- - if (!this->init_label) - { - // false stands for : 'Faln' is not used. - this->bessel_basis.init(false, std::stod(PARAM.inp.bessel_nao_ecut), ucell.ntype, ucell.lmax, - PARAM.inp.bessel_nao_smooth, PARAM.inp.bessel_nao_sigma, bessel_nao_rcut, - PARAM.inp.bessel_nao_tolerence, ucell); - this->mu_index = this->init_mu_index(ucell); - this->init_label = true; - } - ModuleBase::GlobalFunc::MAKE_DIR(winput::spillage_outdir); - for (int derivative_order = 0; derivative_order <= 1; ++derivative_order) // Peize Lin add 2020.04.23 - { - std::ofstream ofs; - std::stringstream ss; - // the parameter 'winput::spillage_outdir' is read from INPUTw. - ss << winput::spillage_outdir << "/"; - - if (PARAM.inp.bessel_nao_rcuts.size() > 1) - { - ss << "orb_matrix_rcut" << bessel_nao_rcut << "deriv"; - } - else - { - ss << "orb_matrix."; - } // to make it compatible with old version of orbital generation - ss << derivative_order << ".dat"; - - if (GlobalV::MY_RANK == 0) - { - ofs.open(ss.str().c_str()); - } - - // ALLOCATE MEMORY FOR THE OVERLAP MATRIX - // OVERLAP : < J_mu | Psi > - std::vector overlap_Q(kv.get_nks()); - // OVERLAP : < J_mu | J_nu > - std::vector overlap_Sq(kv.get_nks()); - - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "number of k points", kv.get_nks()); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "number of bands", PARAM.inp.nbands); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "number of local orbitals", PARAM.globalv.nlocal); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "number of eigenvalues of Jl(x)", - this->bessel_basis.get_ecut_number()); - - // CALCULATE THE OVERLAP MATRIX - // nks now is the reduced k-points. - for (int ik = 0; ik < kv.get_nks(); ik++) - { - const int npw = kv.ngk[ik]; - GlobalV::ofs_running << " --------------------------------------------------------" << std::endl; - GlobalV::ofs_running << " Print the overlap matrixs Q and S for this kpoint" << std::endl; - GlobalV::ofs_running << std::setw(8) << "ik" << std::setw(8) << "npw" << std::endl; - GlobalV::ofs_running << std::setw(8) << ik + 1 << std::setw(8) << npw << std::endl; - GlobalV::ofs_running << " --------------------------------------------------------" << std::endl; - - // search for all k-points. - psi.fix_k(ik); - overlap_Q[ik] = this->cal_overlap_Q(ik, npw, wfcpw, psi, static_cast(derivative_order), sf, ucell); - ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "cal_overlap_Q"); - - // (2) generate Sq matrix if necessary. - if (winput::out_spillage == 2) - { -#ifndef __LCAO - // compute in plane-wave basis - overlap_Sq[ik] = this->cal_overlap_Sq(ik, npw, static_cast(derivative_order), sf, wfcpw, ucell); -#else - // compute with two-center integration - assert(derivative_order == 0 || derivative_order == 1); - char type = (derivative_order == 0) ? 'S' : 'T'; - std::vector natom; - std::vector lmax; - std::vector>> tau_cart; - for (int it = 0; it < ucell.ntype; ++it) - { - natom.push_back(ucell.atoms[it].na); - lmax.push_back(ucell.atoms[it].nwl); - tau_cart.emplace_back(); - - for (int ia = 0; ia < ucell.atoms[it].na; ++ia) - { - tau_cart[it].push_back(ucell.atoms[it].tau[ia] * ucell.lat0); - } - } - - overlap_Sq[ik] = NumericalBasis::cal_overlap_Sq( - type, ucell.lmaxmax, this->bessel_basis.get_ecut_number(), bessel_nao_rcut, tau_cart, - ucell.lat0 * ucell.latvec, NumericalBasis::indexgen(natom, lmax)); -#endif - ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "cal_overlap_Sq"); - } - } - - const ModuleBase::matrix overlap_V - = this->cal_overlap_V(wfcpw, psi, static_cast(derivative_order), kv, ucell.tpiba); - - // ALTHOUGH THIS FUNCTION NAMES output_overlap, IT ACTUALLY OUTPUTS THE OVERLAP MATRIX HERE -#ifdef __MPI - for (int ik = 0; ik < kv.get_nks(); ik++) - { - Parallel_Reduce::reduce_pool(overlap_Q[ik].ptr, overlap_Q[ik].getSize()); - // Parallel_Reduce::reduce_pool(overlap_Sq[ik].ptr, overlap_Sq[ik].getSize()); - } - Parallel_Reduce::reduce_pool(overlap_V.c, overlap_V.nr * overlap_V.nc); // Peize Lin add 2020.04.23 -#endif - // exception handling following, for FileNotOpenFailure - if (ofs.good()) { - this->output_info(ofs, bessel_basis, kv, ucell); // header of orb_matrix* file - } else { - ModuleBase::WARNING_QUIT("Numerical_Basis", "Failed to open file for writing the overlap matrix."); -} - // because one stage of file io complete, re-check the file status. - if (ofs.good()) { - this->output_k(ofs, kv); // ... - } else { - ModuleBase::WARNING_QUIT("Numerical_Basis", "Failed to write k-points to file."); -} - // because one stage of file io complete, re-check the file status. - if (ofs.good()) { - this->output_overlap_Q(ofs, overlap_Q, kv); // ... - } else { - ModuleBase::WARNING_QUIT("Numerical_Basis", "Failed to write overlap Q to file."); -} - // because one stage of file io complete, re-check the file status. - if (winput::out_spillage == 2) - { - // caution: this is the largest matrix to be output, always flush - if (ofs.good()) { - this->output_overlap_Sq(ss.str(), ofs, overlap_Sq, kv); // ... - } else { - ModuleBase::WARNING_QUIT("Numerical_Basis", "Failed to write overlap S to file."); -} - } - // because one stage of file io complete, re-check the file status. - if (ofs.good()) { - this->output_overlap_V(ofs, overlap_V); // ... - // Peize Lin add 2020.04.23 - } else { - ModuleBase::WARNING_QUIT("Numerical_Basis", "Failed to write overlap V to file."); -} - if (GlobalV::MY_RANK == 0) { - ofs.close(); -} - } - return; -} - -ModuleBase::ComplexArray Numerical_Basis::cal_overlap_Q(const int& ik, const int& np, const ModulePW::PW_Basis_K* wfcpw, - const psi::Psi>& psi, - const double derivative_order, const Structure_Factor& sf, - const UnitCell& ucell) const -{ - ModuleBase::TITLE("Numerical_Basis", "cal_overlap_Q"); - ModuleBase::timer::tick("Numerical_Basis", "cal_overlap_Q"); - - GlobalV::ofs_running << " OUTPUT THE OVERLAP BETWEEN SPHERICAL BESSEL FUNCTIONS AND BLOCH WAVE FUNCTIONS" - << std::endl; - GlobalV::ofs_running << " Q = < J_mu, q | Psi_n, k > " << std::endl; - - ModuleBase::ComplexArray overlap_Q(PARAM.inp.nbands, PARAM.globalv.nlocal, this->bessel_basis.get_ecut_number()); - overlap_Q.zero_out(); - - const double normalization = (4 * ModuleBase::PI) / sqrt(ucell.omega); // Peize Lin add normalization 2015-12-29 - - std::vector> gk(np); - for (int ig = 0; ig < np; ig++) - { - gk[ig] = wfcpw->getgpluskcar(ik, ig) * ucell.tpiba; - } - - const std::vector gpow = Numerical_Basis::cal_gpow(gk, derivative_order); - - const ModuleBase::realArray flq = this->cal_flq(gk, ucell.lmax); - - const ModuleBase::matrix ylm = Numerical_Basis::cal_ylm(gk, ucell.lmax); - - GlobalV::ofs_running << "\n " << std::setw(5) << "ik" << std::setw(8) << "Type1" << std::setw(8) << "Atom1" - << std::setw(8) << "L" << std::endl; - - for (int T = 0; T < ucell.ntype; T++) - { - // OUT("T",T); - for (int I = 0; I < ucell.atoms[T].na; I++) - { - // OUT("I",I); - std::complex* sk = sf.get_sk(ik, T, I, wfcpw); - for (int L = 0; L < ucell.atoms[T].nwl + 1; L++) - { - GlobalV::ofs_running << " " << std::setw(5) << ik + 1 << std::setw(8) << ucell.atoms[T].label - << std::setw(8) << I + 1 << std::setw(8) << L << std::endl; - // OUT("l",l); - std::complex lphase - = normalization * pow(ModuleBase::IMAG_UNIT, -L); // Peize Lin add normalization 2015-12-29 - for (int ie = 0; ie < this->bessel_basis.get_ecut_number(); ie++) - { - const int N = 0; - assert(ucell.nmax == 1); - for (int m = 0; m < 2 * L + 1; m++) - { - const int lm = L * L + m; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - std::complex overlap_tmp = ModuleBase::ZERO; - for (int ig = 0; ig < np; ig++) - { - // const std::complex local_tmp = lphase * sk[ig] * - // ylm(lm, ig) * flq[ig]; - const std::complex local_tmp = lphase * sk[ig] * ylm(lm, ig) * flq(L, ie, ig) - * gpow[ig]; // Peize Lin add for dpsi 2020.04.23 - overlap_tmp += conj(local_tmp) * psi(ib, ig); // psi is bloch orbitals - } - overlap_Q(ib, this->mu_index[T](I, L, N, m), ie) = overlap_tmp; - } - } - } // end ie - } // end l - delete[] sk; - sk = nullptr; - } - } - - ModuleBase::timer::tick("Numerical_Basis", "cal_overlap_Q"); - return overlap_Q; -} - -ModuleBase::ComplexArray Numerical_Basis::cal_overlap_Sq(const int& ik, const int& np, const double derivative_order, - const Structure_Factor& sf, const ModulePW::PW_Basis_K* wfcpw, - const UnitCell& ucell) const -{ - ModuleBase::TITLE("Numerical_Basis", "cal_overlap_Sq"); - ModuleBase::timer::tick("Numerical_Basis", "cal_overlap_Sq"); - - GlobalV::ofs_running << " OUTPUT THE OVERLAP BETWEEN SPHERICAL BESSEL FUNCTIONS" << std::endl; - GlobalV::ofs_running << " S = < J_mu,q1 | J_nu,q2 >" << std::endl; - - const int enumber = this->bessel_basis.get_ecut_number(); - ModuleBase::ComplexArray overlap_Sq(PARAM.globalv.nlocal, PARAM.globalv.nlocal, enumber, enumber); - overlap_Sq.zero_out(); - - const double normalization - = (4 * ModuleBase::PI) * (4 * ModuleBase::PI) / ucell.omega; // Peize Lin add normalization 2015-12-29 - - std::vector> gk(np); - for (int ig = 0; ig < np; ig++) { - gk[ig] = wfcpw->getgpluskcar(ik, ig) * ucell.tpiba; -} - - const std::vector gpow = Numerical_Basis::cal_gpow(gk, derivative_order); - - const ModuleBase::realArray flq = this->cal_flq(gk, ucell.lmax); - - const ModuleBase::matrix ylm = Numerical_Basis::cal_ylm(gk, ucell.lmax); - - GlobalV::ofs_running << "\n " << std::setw(5) << "ik" << std::setw(8) << "Type1" << std::setw(8) << "Atom1" - << std::setw(8) << "L1" << std::setw(8) << "Type2" << std::setw(8) << "Atom2" << std::setw(8) - << "L2" << std::endl; - - for (int T1 = 0; T1 < ucell.ntype; T1++) // 1.1 - { - for (int I1 = 0; I1 < ucell.atoms[T1].na; I1++) // 1.2 - { - std::complex* sk1 = sf.get_sk(ik, T1, I1, wfcpw); - for (int T2 = 0; T2 < ucell.ntype; T2++) // 2.1 - { - for (int I2 = 0; I2 < ucell.atoms[T2].na; I2++) // 2.2 - { - std::complex* sk2 = sf.get_sk(ik, T2, I2, wfcpw); - for (int l1 = 0; l1 < ucell.atoms[T1].nwl + 1; l1++) // 1.3 - { - const std::complex lphase1 - = normalization * pow(ModuleBase::IMAG_UNIT, l1); // Peize Lin add normalization 2015-12-29 - for (int l2 = 0; l2 < ucell.atoms[T2].nwl + 1; l2++) // 2.3 - { - GlobalV::ofs_running << " " << std::setw(5) << ik + 1 << std::setw(8) - << ucell.atoms[T1].label << std::setw(8) << I1 + 1 << std::setw(8) - << l1 << std::setw(8) << ucell.atoms[T2].label << std::setw(8) - << I2 + 1 << std::setw(8) << l2 << std::setw(8) << std::endl; - - const std::complex lphase2 = pow(ModuleBase::IMAG_UNIT, l2); - for (int ic1 = 0; ic1 < ucell.nmax; ic1++) // 1.5 - { - for (int ic2 = 0; ic2 < ucell.nmax; ic2++) // 2.5 - { - for (int m1 = 0; m1 < 2 * l1 + 1; m1++) // 1.6 - { - const int lm1 = l1 * l1 + m1; - const int iwt1 = this->mu_index[T1](I1, l1, ic1, m1); - - std::vector> about_ig1(np, std::complex(0.0, 0.0)); - for (int ig = 0; ig < np; ig++) { - about_ig1[ig] = conj(lphase1 * sk1[ig] * ylm(lm1, ig)) - * gpow[ig]; // Peize Lin add for dpsi 2020.04.23 -} - - for (int m2 = 0; m2 < 2 * l2 + 1; m2++) // 2.6 - { - const int lm2 = l2 * l2 + m2; - const int iwt2 = this->mu_index[T2](I2, l2, ic2, m2); - - std::vector> about_ig2(np, - std::complex(0.0, 0.0)); - for (int ig = 0; ig < np; ++ig) { - about_ig2[ig] = lphase2 * sk2[ig] * ylm(lm2, ig) * about_ig1[ig]; -} - - /* same as: - for (int ig=0; ig>()); -} - - BlasConnector::gemm('N', 'T', enumber, enumber, np, 1.0, about_ig3_1.c, np, - about_ig3_2.c, np, 1.0, &overlap_Sq(iwt1, iwt2, 0, 0), - enumber); - } - } - } - } - } - } - delete[] sk2; - sk2 = nullptr; - } - } - delete[] sk1; - sk1 = nullptr; - } - } - - ModuleBase::timer::tick("Numerical_Basis", "cal_overlap_Sq"); - return overlap_Sq; -} - -// Peize Lin add for dpsi 2020.04.23 -ModuleBase::matrix Numerical_Basis::cal_overlap_V(const ModulePW::PW_Basis_K* wfcpw, - const psi::Psi>& psi, - const double derivative_order, const K_Vectors& kv, - const double tpiba) -{ - ModuleBase::matrix overlap_V(kv.get_nks(), PARAM.inp.nbands); - for (int ik = 0; ik < kv.get_nks(); ++ik) - { - std::vector> gk(kv.ngk[ik]); - for (int ig = 0; ig < gk.size(); ig++) { - gk[ig] = wfcpw->getgpluskcar(ik, ig) * tpiba; -} - - const std::vector gpow = Numerical_Basis::cal_gpow(gk, derivative_order); - - for (int ib = 0; ib < PARAM.inp.nbands; ++ib) { - for (int ig = 0; ig < kv.ngk[ik]; ++ig) { - overlap_V(ik, ib) += norm(psi(ik, ib, ig)) * gpow[ig]; -} -} - } - return overlap_V; -} - -ModuleBase::realArray Numerical_Basis::cal_flq(const std::vector>& gk, - const int ucell_lmax) const -{ - const int np = gk.size(); - const int enumber = this->bessel_basis.get_ecut_number(); - - // get flq(G) = \int f(r)jl(G*r) from interpolation table. - ModuleBase::realArray flq(ucell_lmax + 1, enumber, np); - for (int il = 0; il < ucell_lmax + 1; il++) - { - for (int ie = 0; ie < enumber; ie++) - { - for (int ig = 0; ig < np; ig++) - { - flq(il, ie, ig) = this->bessel_basis.Polynomial_Interpolation2(il, ie, gk[ig].norm()); - } - } - } - return flq; -} - -ModuleBase::matrix Numerical_Basis::cal_ylm(const std::vector>& gk, const int ucell_lmax) -{ - const int total_lm = (ucell_lmax + 1) * (ucell_lmax + 1); - ModuleBase::matrix ylm(total_lm, gk.size()); - ModuleBase::YlmReal::Ylm_Real(total_lm, gk.size(), gk.data(), ylm); - return ylm; -} - -std::vector Numerical_Basis::cal_gpow(const std::vector>& gk, - const double derivative_order) -{ - constexpr double thr = 1E-12; - std::vector gpow(gk.size(), 0.0); - for (int ig = 0; ig < gpow.size(); ++ig) - { - if (derivative_order >= 0) - { - gpow[ig] = std::pow(gk[ig].norm2(), derivative_order); - } - else - { - if (gk[ig].norm2() >= thr) { - gpow[ig] = std::pow(gk[ig].norm2(), derivative_order); -} - } - } - return gpow; -} - -std::vector Numerical_Basis::init_mu_index(const UnitCell& ucell) -{ - GlobalV::ofs_running << " Initialize the mu index" << std::endl; - std::vector mu_index_(ucell.ntype); - - int mu = 0; - for (int it = 0; it < ucell.ntype; it++) - { - mu_index_[it].create(ucell.atoms[it].na, ucell.atoms[it].nwl + 1, ucell.nmax, - 2 * (ucell.atoms[it].nwl + 1) + 1); // m ==> 2*l+1 - - mu_index_[it].zero_out(); - - // mohan added 2021-01-03 - GlobalV::ofs_running << "Type " << it + 1 << " number_of_atoms " << ucell.atoms[it].na << " number_of_L " - << ucell.atoms[it].nwl + 1 << " number_of_n " << ucell.nmax << " number_of_m " - << 2 * (ucell.atoms[it].nwl + 1) + 1 << std::endl; - - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int l = 0; l < ucell.atoms[it].nwl + 1; l++) - { - for (int n = 0; n < ucell.atoms[it].l_nchi[l]; n++) - { - for (int m = 0; m < 2 * l + 1; m++) - { - mu_index_[it](ia, l, n, m) = mu; - mu++; - } - } - } - } - } - return mu_index_; -} - -void Numerical_Basis::numerical_atomic_wfc(const int& ik, const ModulePW::PW_Basis_K* wfcpw, - ModuleBase::ComplexMatrix& psi, const Structure_Factor& sf, - const UnitCell& ucell) -{ - ModuleBase::TITLE("Numerical_Basis", "numerical_atomic_wfc"); - const int np = wfcpw->npwk[ik]; - std::vector> gk(np); - for (int ig = 0; ig < np; ig++) { - gk[ig] = wfcpw->getgpluskcar(ik, ig); -} - - const int total_lm = (ucell.lmax + 1) * (ucell.lmax + 1); - ModuleBase::matrix ylm(total_lm, np); - ModuleBase::YlmReal::Ylm_Real(total_lm, np, gk.data(), ylm); - - std::vector flq(np); - for (int it = 0; it < ucell.ntype; it++) - { - // OUT("it",it); - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - // OUT("ia",ia); - std::complex* sk = sf.get_sk(ik, it, ia, wfcpw); - for (int l = 0; l < ucell.atoms[it].nwl + 1; l++) - { - // OUT("l",l); - std::complex lphase = pow(ModuleBase::IMAG_UNIT, l); - for (int ic = 0; ic < ucell.atoms[it].l_nchi[l]; ic++) - { - // OUT("ic",ic); - for (int ig = 0; ig < np; ig++) - { - flq[ig] = this->bessel_basis.Polynomial_Interpolation(it, l, ic, gk[ig].norm() * ucell.tpiba); - } - - for (int m = 0; m < 2 * l + 1; m++) - { - // OUT("m",m); - const int lm = l * l + m; - for (int ig = 0; ig < np; ig++) - { - psi(this->mu_index[it](ia, l, ic, m), ig) = lphase * sk[ig] * ylm(lm, ig) * flq[ig]; - } - } - } - } - delete[] sk; - sk = nullptr; - } - } -} - -void Numerical_Basis::output_info(std::ofstream& ofs, const Bessel_Basis& bessel_basis, const K_Vectors& kv, - const UnitCell& ucell) -{ - // only print out to the information by the first processor - if (GlobalV::MY_RANK == 0) - { - ofs.precision(10); - ofs << ucell.lat0 << std::endl; - - ofs << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << std::endl; - ofs << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << std::endl; - ofs << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << std::endl; - - ofs << ucell.ntype << " ntype" << std::endl; - for (int it = 0; it < ucell.ntype; it++) - { - ofs << ucell.atoms[it].label << " label" << std::endl; // mohan add 2009-07-23 - ofs << ucell.atoms[it].na << " na" << std::endl; - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - ofs << ucell.atoms[it].tau[ia].x << " " << ucell.atoms[it].tau[ia].y << " " << ucell.atoms[it].tau[ia].z - << std::endl; - } - } - // ecutwfc_jlq determine the jlq corresponding to plane wave calculation. - ofs << PARAM.inp.ecutwfc << " ecutwfc" << std::endl; // mohan add 2009-09-08 - - // this parameter determine the total number of jlq. - ofs << bessel_basis.get_ecut() << " ecutwfc_jlq" << std::endl; // mohan modify 2009-09-08 - ofs << bessel_basis.get_rcut() << " rcut_Jlq" << std::endl; - - // mohan add 'smooth' and 'sigma' 2009-08-28 - ofs << bessel_basis.get_smooth() << " smooth" << std::endl; - ofs << bessel_basis.get_sigma() << " sigma" << std::endl; - - ofs << bessel_basis.get_tolerence() << " tolerence" << std::endl; - - ofs << ucell.lmax << " lmax" << std::endl; - } - - ofs << std::scientific; - - ofs << std::setprecision(8); - // NOTICE: ofs_warning << "\n The precison may affect the optimize result."; - - if (GlobalV::MY_RANK == 0) - { - ofs << kv.get_nkstot() << " nks" << std::endl; - ofs << PARAM.inp.nbands << " nbands" << std::endl; - ofs << PARAM.globalv.nlocal << " nwfc" << std::endl; - ofs << bessel_basis.get_ecut_number() << " ne " << std::endl; - } -} - -void Numerical_Basis::output_k(std::ofstream& ofs, const K_Vectors& kv) -{ - // (1) - if (GlobalV::MY_RANK == 0) - { - ofs << ""; - } - - // only half of nkstot should be output in "NSPIN == 2" case, k_up and k_down has same k infomation - int nkstot = kv.get_nkstot(); - - // (2) - for (int ik = 0; ik < nkstot; ik++) - { - double kx, ky, kz, wknow; -#ifdef __MPI - // temprary restrict kpar=1 for NSPIN=2 case for generating_orbitals - int pool = 0; - if (PARAM.inp.nspin != 2) { - pool = kv.para_k.whichpool[ik]; -} - const int iknow = ik - kv.para_k.startk_pool[GlobalV::MY_POOL]; - if (GlobalV::RANK_IN_POOL == 0) - { - if (GlobalV::MY_POOL == 0) - { - if (pool == 0) - { - kx = kv.kvec_c[ik].x; - ky = kv.kvec_c[ik].y; - kz = kv.kvec_c[ik].z; - wknow = kv.wk[ik]; - } - else - { - - int startpro_pool = kv.para_k.get_startpro_pool(pool); - MPI_Status ierror; - MPI_Recv(&kx, 1, MPI_DOUBLE, startpro_pool, ik * 4, MPI_COMM_WORLD, &ierror); - MPI_Recv(&ky, 1, MPI_DOUBLE, startpro_pool, ik * 4 + 1, MPI_COMM_WORLD, &ierror); - MPI_Recv(&kz, 1, MPI_DOUBLE, startpro_pool, ik * 4 + 2, MPI_COMM_WORLD, &ierror); - MPI_Recv(&wknow, 1, MPI_DOUBLE, startpro_pool, ik * 4 + 3, MPI_COMM_WORLD, &ierror); - } - } - else - { - if (GlobalV::MY_POOL == pool) - { - MPI_Send(&kv.kvec_c[iknow].x, 1, MPI_DOUBLE, 0, ik * 4, MPI_COMM_WORLD); - MPI_Send(&kv.kvec_c[iknow].y, 1, MPI_DOUBLE, 0, ik * 4 + 1, MPI_COMM_WORLD); - MPI_Send(&kv.kvec_c[iknow].z, 1, MPI_DOUBLE, 0, ik * 4 + 2, MPI_COMM_WORLD); - MPI_Send(&kv.wk[iknow], 1, MPI_DOUBLE, 0, ik * 4 + 3, MPI_COMM_WORLD); - } - } - } - // this barrier is very important - MPI_Barrier(MPI_COMM_WORLD); -#else - if (GlobalV::MY_RANK == 0) - { - kx = kv.kvec_c[ik].x; - ky = kv.kvec_c[ik].y; - kz = kv.kvec_c[ik].z; - wknow = kv.wk[ik]; - } -#endif - - if (GlobalV::MY_RANK == 0) - { - ofs << "\n" << kx << " " << ky << " " << kz; - ofs << " " << wknow * 0.5; - } - } - - if (GlobalV::MY_RANK == 0) - { - ofs << "\n" << std::endl; - } -} - -void Numerical_Basis::output_overlap_Q(std::ofstream& ofs, const std::vector& overlap_Q, - const K_Vectors& kv) -{ - // (3) - if (GlobalV::MY_RANK == 0) - { - ofs << "\n"; - } - - // (4) - /* - if(GlobalV::MY_RANK==0) - { - // for( int i=0; i 0); - ModuleBase::ComplexArray overlap_Q_k(kv.get_nks(), overlap_Q[0].getBound1(), overlap_Q[0].getBound2(), - overlap_Q[0].getBound3()); - for (int ik = 0; ik < kv.get_nks(); ++ik) - { - std::memcpy(overlap_Q_k.ptr + ik * overlap_Q[ik].getSize(), overlap_Q[ik].ptr, - overlap_Q[ik].getSize() * sizeof(std::complex)); - } - - // only half of nkstot should be output in "NSPIN == 2" case, k_up and k_down has same k infomation - int nkstot = kv.get_nkstot(); - int count = 0; - for (int ik = 0; ik < nkstot; ik++) - { - ModuleBase::ComplexArray Qtmp(overlap_Q[ik].getBound1(), overlap_Q[ik].getBound2(), overlap_Q[ik].getBound3()); - Qtmp.zero_out(); - kv.para_k.pool_collection(Qtmp.ptr, overlap_Q_k, ik); - if (GlobalV::MY_RANK == 0) - { - // ofs << "\n ik=" << ik; - // begin data writing. - const int dim = Qtmp.getSize(); - for (int i = 0; i < dim; i++) - { - if (count % 4 == 0) { - ofs << std::endl; -} - ofs << " " << Qtmp.ptr[i].real() << " " << Qtmp.ptr[i].imag(); - ++count; - } - // end data writing. - } -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - } - - // (5) - if (GlobalV::MY_RANK == 0) - { - ofs << "\n" << std::endl; - } -} - -void Numerical_Basis::output_overlap_Sq(const std::string& name, std::ofstream& ofs, - const std::vector& overlap_Sq, const K_Vectors& kv) -{ - if (GlobalV::MY_RANK == 0) - { - ofs << "\n"; - ofs.close(); - } - - // only half of nkstot should be output in "NSPIN == 2" case, k_up and k_down has same k infomation - int ispin = 1; - if (PARAM.inp.nspin == 2) { - ispin = 2; -} - int nkstot = kv.get_nkstot() / ispin; - int count = 0; - for (int is = 0; is < ispin; is++) - { - for (int ik = 0; ik < nkstot; ik++) - { - if (GlobalV::MY_POOL == kv.para_k.whichpool[ik]) - { - if (GlobalV::RANK_IN_POOL == 0) - { - ofs.open(name.c_str(), std::ios::app); - const int ik_now = ik - kv.para_k.startk_pool[GlobalV::MY_POOL] + is * nkstot; - - const int size = overlap_Sq[ik_now].getSize(); - for (int i = 0; i < size; i++) - { - if (count % 2 == 0) { - ofs << std::endl; -} - ofs << " " << overlap_Sq[ik_now].ptr[i].real() << " " << overlap_Sq[ik_now].ptr[i].imag(); - ++count; - } - ofs.flush(); - ofs.close(); - } -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - } - else - { -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - } - - /* - if(MY_RANK==0) - for(int i=0; i< Sq_real[ik].getSize(); i++) - { - if(i%2==0) ofs << "\n"; - ofs << " " << Sq_real[ik].ptr[i] << " " << Sq_imag[ik].ptr[i]; - } - */ - } - } - if (GlobalV::MY_RANK == 0) - { - ofs.open(name.c_str(), std::ios::app); - ofs << "\n" << std::endl; - } -} - -// Peize Lin add 2020.04.23 -void Numerical_Basis::output_overlap_V(std::ofstream& ofs, const ModuleBase::matrix& overlap_V) -{ - if (GlobalV::MY_RANK == 0) - { - ofs << "\n" << std::endl; - ; - overlap_V.print(ofs); - ofs << "" << std::endl; - } -} diff --git a/source/module_io/numerical_basis.h b/source/module_io/numerical_basis.h deleted file mode 100644 index 68b4152c84..0000000000 --- a/source/module_io/numerical_basis.h +++ /dev/null @@ -1,108 +0,0 @@ -//========================================================== -// AUTHOR : mohan -// DATE : 2009-4-2 -// Last Modify: 2009-08-28 -//========================================================== -#ifndef NUMERICAL_BASIS_H -#define NUMERICAL_BASIS_H -#include - -#include "bessel_basis.h" -#include "source_base/complexarray.h" -#include "source_base/complexmatrix.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/intarray.h" -#include "source_base/matrix.h" -#include "source_base/vector3.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/klist.h" -#include "source_pw/hamilt_pwdft/structure_factor.h" -#include "source_psi/psi.h" -//========================================================== -// CLASS : -// NAME : Numerical_Basis -//========================================================== -class Numerical_Basis -{ - public: - // this is not a good idea to construct the instance. Instead, there are many variables that CAN DEFINE the identity of this instance, - // these parameters should be provided in the constructor. For future refactor, I list them here: - // bessel_nao_*: including ecut, rcut, smearing, sigma, etc. - // a file name: for the function start_from_file_k, if starts from file, can construct a different instance, instead of using the same instance. - Numerical_Basis(); - ~Numerical_Basis(); - - // void start_from_file_k(const int& ik, ModuleBase::ComplexMatrix& psi, const Structure_Factor& sf, const ModulePW::PW_Basis_K* wfcpw, const UnitCell& ucell); - void output_overlap(const psi::Psi>& psi, - const Structure_Factor& sf, - const K_Vectors& kv, - const ModulePW::PW_Basis_K* wfcpw, - const UnitCell& ucell, - const int& index); - - private: - bool init_label = false; - - Bessel_Basis bessel_basis; - - std::vector mu_index; - static std::vector init_mu_index(const UnitCell& ucell); - - void numerical_atomic_wfc(const int& ik, - const ModulePW::PW_Basis_K* wfcpw, - ModuleBase::ComplexMatrix& psi, - const Structure_Factor& sf, - const UnitCell& ucell); - - ModuleBase::ComplexArray cal_overlap_Q(const int& ik, - const int& np, - const ModulePW::PW_Basis_K* wfcpw, - const psi::Psi>& psi, - const double derivative_order, - const Structure_Factor& sf, - const UnitCell& ucell) const; - - // computed in the plane-wave basis - ModuleBase::ComplexArray cal_overlap_Sq(const int& ik, - const int& np, - const double derivative_order, - const Structure_Factor& sf, - const ModulePW::PW_Basis_K* wfcpw, - const UnitCell& ucell) const; - - static ModuleBase::matrix cal_overlap_V(const ModulePW::PW_Basis_K* wfcpw, - const psi::Psi>& psi, - const double derivative_order, - const K_Vectors& kv, - const double tpiba); - - // gk should be in the atomic unit (Bohr) - ModuleBase::realArray cal_flq(const std::vector> &gk, - const int ucell_lmax) const; - - // Ylm does not depend on the magnitude so unit is not important - static ModuleBase::matrix cal_ylm(const std::vector> &gk, - const int ucell_lmax); - - // gk and the returned gpow are both in the atomic unit (Bohr) - static std::vector cal_gpow(const std::vector> &gk, - const double derivative_order); - - static void output_info(std::ofstream& ofs, const Bessel_Basis& bessel_basis, const K_Vectors& kv, const UnitCell& ucell); - - static void output_k(std::ofstream& ofs, const K_Vectors& kv); - - static void output_overlap_Q(std::ofstream& ofs, - const std::vector& overlap_Q, - const K_Vectors& kv); - - static void output_overlap_Sq(const std::string& name, - std::ofstream& ofs, - const std::vector& overlap_Sq, - const K_Vectors& kv); - - static void output_overlap_V(std::ofstream &ofs, const ModuleBase::matrix &overlap_V); -}; - -#endif diff --git a/source/module_io/numerical_basis_jyjy.cpp b/source/module_io/numerical_basis_jyjy.cpp deleted file mode 100644 index 86ad20582d..0000000000 --- a/source/module_io/numerical_basis_jyjy.cpp +++ /dev/null @@ -1,161 +0,0 @@ -#include "module_io/numerical_basis_jyjy.h" - -#include "source_base/matrix3.h" -#include "source_base/vector3.h" -#include "source_basis/module_nao/two_center_integrator.h" - -namespace NumericalBasis -{ -#ifdef __LCAO -using index_t = std::tuple; -using Vec3 = ModuleBase::Vector3; -using ModuleBase::cross; -using ModuleBase::dot; - -std::vector indexgen(const std::vector& natom, const std::vector& lmax) -{ -#ifdef __DEBUG - assert(natom.size() == lmax.size()); -#endif - std::vector index; - for (size_t itype = 0; itype < natom.size(); ++itype) - { - for (int iatom = 0; iatom < natom[itype]; ++iatom) - { - for (int l = 0; l <= lmax[itype]; ++l) - { - for (int M = 0; M < 2 * l + 1; ++M) - { - // convert the "abacus M" to the conventional m - const int m = (M % 2 == 0) ? -M / 2 : (M + 1) / 2; - index.emplace_back(itype, iatom, l, m); - } - } - } - } - return index; -} - -ModuleBase::ComplexArray cal_overlap_Sq(const char type, const int lmax, const int nbes, const double rcut, - const std::vector>& R, const ModuleBase::Matrix3& latvec, - const std::vector& mu_index) -{ - // allocate output array - const int nlocal = mu_index.size(); - ModuleBase::ComplexArray overlap_Sq(nlocal, nlocal, nbes, nbes); - overlap_Sq.zero_out(); - - // build a RadialCollection of spherical Bessel functions - const double dr = 0.005; // grid spacing for SphbesRadials; smaller for higher precision - RadialCollection orb; - orb.build(lmax, nbes, rcut, 0.0, dr); - - ModuleBase::SphericalBesselTransformer sbt; - orb.set_transformer(sbt); - - const double rmax = orb.rcut_max() * 2.0; - const int nr = static_cast(rmax / dr) + 1; - - orb.set_uniform_grid(true, nr, rmax, 'i', true); - - // build the two-center integrator - TwoCenterIntegrator intor; - intor.tabulate(orb, orb, type, nr, rmax); - - // traverse the vector of composite index (itype, iatom, l, m) - int t1 = 0, a1 = 0, l1 = 0, m1 = 0; - int t2 = 0, a2 = 0, l2 = 0, m2 = 0; - - for (auto it1 = mu_index.cbegin(); it1 != mu_index.cend(); ++it1) - { - std::tie(t1, a1, l1, m1) = *it1; - for (auto it2 = mu_index.cbegin(); it2 != mu_index.cend(); ++it2) - { - std::tie(t2, a2, l2, m2) = *it2; - std::vector dR_all = neighbor_vec(R[t2][a2] - R[t1][a1], latvec, 2 * rcut); - for (auto& dR: dR_all) - { - for (int zeta1 = 0; zeta1 < nbes; ++zeta1) - { - for (int zeta2 = 0; zeta2 < nbes; ++zeta2) - { - double elem = 0.0; - intor.calculate(t1, l1, zeta1, m1, t2, l2, zeta2, m2, dR, &elem); - overlap_Sq(it1 - mu_index.cbegin(), it2 - mu_index.cbegin(), zeta1, zeta2) += elem; - } - } - } - } - } - - return overlap_Sq; -} - -std::vector neighbor_vec(const Vec3& d0, const ModuleBase::Matrix3& latvec, const double r) -{ - // convert the format of lattice vectors from Matrix3 to a vector of - // Vector3 before searching for neighboring periodic images - std::vector a{{latvec.e11, latvec.e12, latvec.e13}, - {latvec.e21, latvec.e22, latvec.e23}, - {latvec.e31, latvec.e32, latvec.e33}}; - - // unit vectors normal to the three faces of the parallelepiped - std::vector u(3); - for (int i = 0; i < 3; ++i) - { - u[i] = cross(a[(i + 1) % 3], a[(i + 2) % 3]); - u[i] = u[i] / u[i].norm(); - } - - // range of supercell coordinates - // - // Suppose n0, n1, n2 can take any real numbers (rather than just integers), - // given any n0, one can always find n1 & n2 such that - // - // d0 + n0*a0 + n1*a1 + n2*a2 - // - // is perpendicular to the plane spanned by a1 and a2. Therefore, the - // min/max values of n0 should satisfy - // - // dot(d0 + n0*a0, u0) = r - // - std::vector n_min(3), n_max(3); - for (int i = 0; i < 3; ++i) - { - double n_min_tmp = (-r - dot(d0, u[i])) / dot(a[i], u[i]); - double n_max_tmp = (r - dot(d0, u[i])) / dot(a[i], u[i]); - if (n_min_tmp > n_max_tmp) // in case dot(a[i], u[i]) < 0 - { - std::swap(n_min_tmp, n_max_tmp); - } - // cast to int truncates towards 0 - // slightly widens the range for floating point precision error - n_min[i] = static_cast(n_min_tmp - 1e-6); - n_max[i] = static_cast(n_max_tmp + 1e-6); - } - - // loop over the neighboring supercells - std::vector d; - for (int n0 = n_min[0]; n0 <= n_max[0]; ++n0) - { - for (int n1 = n_min[1]; n1 <= n_max[1]; ++n1) - { - for (int n2 = n_min[2]; n2 <= n_max[2]; ++n2) - { - Vec3 d_tmp = d0 + static_cast(n0) * a[0] + static_cast(n1) * a[1] - + static_cast(n2) * a[2]; - - if (d_tmp.norm() < r) - { - d.push_back(d_tmp); - } - } - } - } - - return d; -} - -#endif - -} // end of namespace NumericalBasis diff --git a/source/module_io/numerical_basis_jyjy.h b/source/module_io/numerical_basis_jyjy.h deleted file mode 100644 index 84296c57af..0000000000 --- a/source/module_io/numerical_basis_jyjy.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef NUMERICAL_BASIS_JYJY_H -#define NUMERICAL_BASIS_JYJY_H - -#include "source_base/complexarray.h" -#include "source_base/matrix3.h" -#include "source_base/vector3.h" - -#include -#include - -namespace NumericalBasis -{ -std::vector> indexgen(const std::vector& natom, const std::vector& lmax); - -/** - * @brief overlap matrix (two-center integration) - * - * - * @param[in] type 'S' (op = 1) or 'T' (kinetic, op = -\nabla^2) - * @param[in] lmax maximum angular momentum - * @param[in] nbes number of Bessel functions - * @param[in] rcut cutoff radius - * @param[in] tau_cart atomic positions (in Bohr) - * @param[in] latvec lattice vectors (in Bohr) - * @param[in] mu_index composite index - * - */ -ModuleBase::ComplexArray cal_overlap_Sq(const char type, // 'S' or 'T' - const int lmax, const int nbes, const double rcut, - const std::vector>>& tau_cart, - const ModuleBase::Matrix3& latvec, - const std::vector>& mu_index); - -/** - * @brief Searching for all relative position vectors for periodic images - * within a cutoff radius. - * - * Given an initial relative position vector d0 and a searching radius r, - * this function returns all d such that - * - * d = d0 + n0*a0 + n1*a1 + n2*a2 and |d| < r - * - * where n0, n1, n2 are integers and a0, a1, a2 are the lattice vectors. - * - */ -std::vector> neighbor_vec(const ModuleBase::Vector3& d0, - const ModuleBase::Matrix3& latvec, const double r); - -} // namespace NumericalBasis - -#endif diff --git a/source/module_io/numerical_descriptor.cpp b/source/module_io/numerical_descriptor.cpp deleted file mode 100644 index 1f5e9a7f85..0000000000 --- a/source/module_io/numerical_descriptor.cpp +++ /dev/null @@ -1,387 +0,0 @@ -#include "numerical_descriptor.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#include "source_cell/module_symmetry/symmetry.h" -#include "winput.h" -#include "source_base/math_ylmreal.h" -#include "source_base/lapack_connector.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" - -Numerical_Descriptor::Numerical_Descriptor() -{ - this->init_label = false; - this->lmax = -1; - this->nmax = -1; - this->nlocal = 0; - this->mu_index = nullptr; -} - -Numerical_Descriptor::~Numerical_Descriptor() -{ - if(init_label==true) - { - delete[] mu_index; - } - return; -} - - -void Numerical_Descriptor::output_descriptor(const UnitCell& ucell, const psi::Psi> &psi, const int &lmax_in, const double &rcut_in, const double &tol_in, const int nks_in) -{ - ModuleBase::TITLE("Numerical_Descriptor","output_descriptor"); - ModuleBase::GlobalFunc::NEW_PART("DeepKS descriptor: D_{Inl}"); - - //----------------------------------- - // 1. Initialize parameters - //----------------------------------- - - //GlobalV::ofs_running << "D_{Inl}_m_m'=sum_{i}" << std::endl; - GlobalV::ofs_running << "input lmax = " << lmax_in << std::endl; - GlobalV::ofs_running << "input rcut = " << rcut_in << std::endl; - GlobalV::ofs_running << "input tolerence = " << tol_in << std::endl; - this->lmax = lmax_in; - assert(lmax>=0); - - const int nks = nks_in; - int ne = 0; - - // Peize Lin change 2022.12.15 - // 0 stands for : 'Faln' is not used. - this->bessel_basis.init( - false, - std::stod(PARAM.inp.bessel_descriptor_ecut), - ucell.ntype, - this->lmax, - PARAM.inp.bessel_descriptor_smooth, - PARAM.inp.bessel_descriptor_sigma, - rcut_in, - tol_in, - ucell - ); - this->nmax = Numerical_Descriptor::bessel_basis.get_ecut_number(); - this->init_mu_index(ucell); - this->init_label = true; - - assert(nmax>0); - - // Currently we are not considering doing DeePKS in PW basis - // hence this subroutine is used only for generating projectors and save to jle.orb - // As a result, I will return here and the rest of the code is saved for future use - return; - -/* - //----------------------------------- - // 2. Open the file - //----------------------------------- - std::ofstream ofs; - std::stringstream ss; - // the parameter 'winput::spillage_outdir' is read from INPUTw. - ss << winput::spillage_outdir << "/" << "descriptor.dat"; - if (GlobalV::MY_RANK==0) - { - ofs.open(ss.str().c_str()); - } - - - //------------------------------------- - // 3. Initialize overlap_Q1 and Q2 - //------------------------------------- - // OVERLAP : < J_mu | Psi > - ModuleBase::realArray overlap_Q1(nks, PARAM.inp.nbands, this->nlocal ); - ModuleBase::realArray overlap_Q2(nks, PARAM.inp.nbands, this->nlocal ); - - ModuleBase::GlobalFunc::ZEROS(overlap_Q1.ptr, overlap_Q1.getSize() ); - ModuleBase::GlobalFunc::ZEROS(overlap_Q2.ptr, overlap_Q2.getSize() ); - - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"number of k points",overlap_Q1.getBound1()); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"number of bands",overlap_Q1.getBound2()); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"number of local orbitals",overlap_Q1.getBound3()); - - - //------------------------------------- - // 4. Compute overlap_Q1 and Q2 - //------------------------------------- - // nks now is the reduced k-points. - for (int ik=0; ikngk[ik]; - GlobalV::ofs_running << " --------------------------------------------------------" << std::endl; - GlobalV::ofs_running << " Print the overlap matrixs Q and S for this kpoint"; - GlobalV::ofs_running << "\n " << std::setw(8) << "ik" << std::setw(8) << "npw"; - GlobalV::ofs_running << "\n " << std::setw(8) << ik+1 << std::setw(8) << npw << std::endl; - GlobalV::ofs_running << " --------------------------------------------------------" << std::endl; - // search for all k-points. - psi.fix_k(ik); - this->jlq3d_overlap(overlap_Q1, overlap_Q2, ik, ik, npw, psi); - ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running,"jlq3d_overlap"); - } - -#ifdef __MPI - Parallel_Reduce::reduce_double_pool( overlap_Q1.ptr, overlap_Q1.getSize() ); - Parallel_Reduce::reduce_double_pool( overlap_Q2.ptr, overlap_Q2.getSize() ); -#endif - - // do not need to output here - //this->output_overlap_Q( ofs, overlap_Q1, overlap_Q2 ); - - - - //------------------------------------- - // 5. Generate descriptors for each atom - //------------------------------------- - - for (int it=0; itgenerate_descriptor(overlap_Q1, overlap_Q2, it ,ia, d, nd); - - ofs << ucell.atoms[it].label << " atom_index " << ia+1 << " n_descriptor " << nd << std::endl; - for(int id=0; id0 && id%8==0) ofs << std::endl; - // if(std::abs(d[id]>1.0e-9)) ofs << d[id] << " "; - // else ofs << "0 "; - ofs << d[id] << " "; - } - ofs << std::endl; - - delete[] d; - } - } - - - - if (GlobalV::MY_RANK==0) ofs.close(); - return; -*/ -} - -/* -void Numerical_Descriptor::generate_descriptor(ModuleBase::realArray &overlap_Q1, ModuleBase::realArray &overlap_Q2, -const int &it, const int &ia, double *d, const int &nd) -{ - int nbands = overlap_Q1.getBound2(); - // nwfc = nd * ne - int nwfc = overlap_Q1.getBound3(); - int start0 = mu_index[it](ia, 0, 0, 0); //min mu_index for each atom - - - // for 1 k-point only now - int ik=0; - - - GlobalV::ofs_running << " print out each descriptor" << std::endl; - int id=0; - for (int l=0; l c1(overlap_Q1(ik, ib, ii), overlap_Q2(ik, ib, ii)); - std::complex c2(overlap_Q1(ik, ib, jj), -overlap_Q2(ik, ib, jj)); - des(m,m2) += c1*c2; - } - // GlobalV::ofs_running << std::setw(15) << des(m,m2); - } - // GlobalV::ofs_running << std::endl; - } - GlobalV::ofs_running << "dimension of des is " << 2*l+1 << std::endl; - - if(l==0) - { - d[id]=des(0,0).real(); - ++id; - } - else - { - // diagonalizae - // assume des matrix is Hermitian - char jobz = 'N'; // eigenvalues only - char uplo = 'U'; // upper matrix is stored - int ndim = des.nr; - double* tmpd = new double[ndim](); - const int lwork = 2*ndim; - std::complex* work = new std::complex[lwork](); - double* rwork = new double[3 * ndim - 2](); - int infor = 0; - // diag by calling zheev - LapackConnector::zheev(jobz, uplo, ndim, des, ndim, tmpd, work, lwork, rwork, &infor); - // put the eigenvalues into d (descriptor) - for(int idim=0; idim> &psi) -{ - ModuleBase::TITLE("Numerical_Descriptor","jlq3d_overlap"); - ModuleBase::timer::tick("Numerical_Descriptor","jlq3d_overlap"); - - GlobalV::ofs_running << " OUTPUT THE OVERLAP BETWEEN SPHERICAL BESSEL FUNCTIONS AND BLOCH WAVE FUNCTIONS" << -std::endl; GlobalV::ofs_running << " Q = < J_it_ia_il_in_im | Psi_n, k > " << std::endl; - - const double normalization = (4 * ModuleBase::PI) / sqrt(ucell.omega);// Peize Lin add normalization -2015-12-29 - - const int total_lm = ( this->lmax + 1) * ( this->lmax + 1); - ModuleBase::matrix ylm(total_lm, np); - - ModuleBase::Vector3 *gk = new ModuleBase::Vector3 [np]; - for (int ig=0; iggetgpluskcar(ik,ig); - } - - ModuleBase::YlmReal::Ylm_Real(total_lm, np, gk, ylm); - - GlobalV::ofs_running << "\n " << std::setw(5) << "ik" - << std::setw(8) << "Type1" - << std::setw(8) << "Atom1" - << std::setw(8) << "L" - << std::endl; - - double *flq = new double[np]; - std::complex overlapQ = ModuleBase::ZERO; - for (int T1 = 0; T1 < ucell.ntype; T1++) - { - for (int I1 = 0; I1 < ucell.atoms[T1].na; I1++) - { - std::complex *sk = sf.get_sk(ik, T1, I1,wfcpw); - for (int L=0; L< lmax+1; L++) - { - GlobalV::ofs_running << " " << std::setw(5) << ik+1 - << std::setw(8) << ucell.atoms[T1].label - << std::setw(8) << I1+1 - << std::setw(8) << L - << std::endl; - //OUT("l",l); - std::complex lphase = normalization * pow(ModuleBase::IMAG_UNIT, L); // Peize Lin add -normalization 2015-12-29 for (int ie=0; ie < nmax; ie++) - { - for (int ig=0; ig overlap_tmp = ModuleBase::ZERO; - for (int ig=0; ig local_tmp = lphase * sk[ig] * ylm(lm, ig) * flq[ig]; - overlap_tmp += conj( local_tmp ) * psi(ib, ig); // psi is bloch orbitals - } - overlap_Q1(ik_ibz, ib, mu_index[T1](I1, L, ie, m)) = overlap_tmp.real(); - overlap_Q2(ik_ibz, ib, mu_index[T1](I1, L, ie, m)) = overlap_tmp.imag(); - } - } - }//end ie - }//end l - delete[] sk; - } - } - - delete[] flq; - delete[] gk; - ModuleBase::timer::tick("Numerical_Descriptor","jlq3d_overlap"); - return; -} -*/ - -void Numerical_Descriptor::init_mu_index(const UnitCell& ucell) -{ - GlobalV::ofs_running << " Initialize the mu index for deepks" << std::endl; - GlobalV::ofs_running << " lmax = " << this->lmax << std::endl; - GlobalV::ofs_running << " nmax = " << this->nmax << std::endl; - Numerical_Descriptor::mu_index = new ModuleBase::IntArray[ucell.ntype]; - - assert(lmax>=0); - assert(nmax>0); - - int mu=0; - for (int it=0; itmu_index[it].create( - ucell.atoms[it].na, - lmax+1, // l starts from 0 - nmax, - 2*lmax+1); // m ==> 2*l+1 - - GlobalV::ofs_running << "Type " << it+1 - << " number_of_atoms " << ucell.atoms[it].na - << " number_of_L " << lmax+1 - << " number_of_n " << nmax - << " number_of_m " << 2*lmax+1 << std::endl; - - for (int ia=0; iamu_index[it](ia,l,n,m) = mu; - mu++; - } - } - } - } - - } - - this->nlocal = mu; - GlobalV::ofs_running << " total number of atomic orbitals " << nlocal << std::endl; - - return; -} diff --git a/source/module_io/numerical_descriptor.h b/source/module_io/numerical_descriptor.h deleted file mode 100644 index 7c50c616a1..0000000000 --- a/source/module_io/numerical_descriptor.h +++ /dev/null @@ -1,46 +0,0 @@ -//========================================================== -// AUTHOR : mohan -// DATE : 2021-01-04 -//========================================================== -#ifndef NUMERICAL_DESCRIPTOR_H -#define NUMERICAL_DESCRIPTOR_H -#include "../source_base/global_function.h" -#include "../source_base/global_variable.h" -#include "../source_base/intarray.h" -#include "../source_base/complexmatrix.h" -#include "bessel_basis.h" -#include "source_psi/psi.h" -//========================================================== -// CLASS : -// NAME : Numerical_Descriptor -//========================================================== -class Numerical_Descriptor -{ - public: - Numerical_Descriptor(); - ~Numerical_Descriptor(); - - void output_descriptor(const UnitCell& ucell, const psi::Psi> &psi, const int &lmax_in, const double &rcut_in, const double &tol_in, const int nks); // mohan added 2021-01-03 - - private: - - bool init_label; - - int lmax; // lmax for descriptor - int nmax; // nmax for descriptor - int nlocal; // total number of atomic orbitals - - Bessel_Basis bessel_basis; - - ModuleBase::IntArray *mu_index; - void init_mu_index(const UnitCell& ucell);//mohan added 2021-01-03 - - // void jlq3d_overlap(ModuleBase::realArray &overlap_Q1, ModuleBase::realArray &overlap_Q2, - // const int &ik_ibz, const int &ik, const int &np, const psi::Psi> &psi); - - // void generate_descriptor(ModuleBase::realArray &overlap_Q1, ModuleBase::realArray &overlap_Q2, - // const int &it, const int &ia, double *d, const int &nd); - -}; - -#endif diff --git a/source/module_io/orb_io.cpp b/source/module_io/orb_io.cpp deleted file mode 100644 index 14f58db5d1..0000000000 --- a/source/module_io/orb_io.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include "module_io/orb_io.h" -#include "source_base/tool_quit.h" -#ifdef __MPI -#include "source_base/parallel_common.h" -#endif - -void ModuleIO::read_abacus_orb(std::ifstream& ifs, - std::string& elem, - double& ecut, - int& nr, - double& dr, - std::vector& nzeta, - std::vector>& radials, - const int rank) -{ - nr = 0; // number of grid points - dr = 0; // grid spacing - int lmax = 0, nchi = 0; // number of radial functions - std::vector> radial_map_; // build a map from [l][izeta] to 1-d array index - std::string tmp; - // first read the header - if (rank == 0) - { - if (!ifs.is_open()) - { - ModuleBase::WARNING_QUIT("AtomicRadials::read_abacus_orb", "Couldn't open orbital file."); - } - while (ifs >> tmp) - { - if (tmp == "Element") - { - ifs >> elem; - } - else if (tmp == "Cutoff(Ry)") - { - ifs >> ecut; - } - else if (tmp == "Lmax") - { - ifs >> lmax; - nzeta.resize(lmax + 1); - for (int l = 0; l <= lmax; ++l) - { - ifs >> tmp >> tmp >> tmp >> nzeta[l]; - } - } - else if (tmp == "Mesh") - { - ifs >> nr; - continue; - } - else if (tmp == "dr") - { - ifs >> dr; - break; - } - } - radial_map_.resize(lmax + 1); - for (int l = 0; l <= lmax; ++l) - { - radial_map_[l].resize(nzeta[l]); - } - int ichi = 0; - for (int l = 0; l <= lmax; ++l) - { - for (int iz = 0; iz < nzeta[l]; ++iz) - { - radial_map_[l][iz] = ichi++; // return the value of ichi, then increment - } - } - nchi = ichi; // total number of radial functions - radials.resize(nchi); - std::for_each(radials.begin(), radials.end(), [nr](std::vector& v) { v.resize(nr); }); - } - - // broadcast the header information -#ifdef __MPI - Parallel_Common::bcast_string(elem); - Parallel_Common::bcast_double(ecut); - Parallel_Common::bcast_int(lmax); - Parallel_Common::bcast_int(nchi); - Parallel_Common::bcast_int(nr); - Parallel_Common::bcast_double(dr); -#endif - - // then adjust the size of the vectors - if (rank != 0) - { - nzeta.resize(lmax + 1); - radials.resize(nchi); - std::for_each(radials.begin(), radials.end(), [nr](std::vector& v) { v.resize(nr); }); - } - // broadcast the number of zeta functions for each angular momentum -#ifdef __MPI - Parallel_Common::bcast_int(nzeta.data(), lmax + 1); -#endif - - // read the radial functions by rank0 - int ichi = 0; - for (int i = 0; i != nchi; ++i) - { - if (rank == 0) - { - int l, izeta; - ifs >> tmp >> tmp >> tmp; - ifs >> tmp >> l >> izeta; - ichi = radial_map_[l][izeta]; - for (int ir = 0; ir != nr; ++ir) - { - ifs >> radials[ichi][ir]; - } - } - // broadcast the radial functions -#ifdef __MPI - Parallel_Common::bcast_int(ichi); // let other ranks know where to store the radial function - Parallel_Common::bcast_double(radials[ichi].data(), nr); -#endif - } -} - -void ModuleIO::write_abacus_orb(std::ofstream& ofs, - const std::string& elem, - const double& ecut, - const int nr, - const double dr, - const std::vector& nzeta, - const std::vector>& radials, - const int rank) -{ - const std::vector spec = {"S", "P", "D", "F", "G", "H", "I", "J", "K"}; - - if (rank == 0) - { - if (!ofs.is_open()) - { - ModuleBase::WARNING_QUIT("AtomicRadials::write_abacus_orb", "Couldn't open orbital file."); - } - const int lmax = nzeta.size() - 1; - - for (int i = 0; i < 75; ++i) - { - ofs << "-"; - } - ofs << std::endl; - // left aligned - ofs << std::left << std::setw(28) << "Element" << elem << std::endl; - ofs << std::left << std::setw(28) << "Energy Cutoff(Ry)" << ecut << std::endl; - // rcut .1f, not scientific - ofs << std::left << std::setw(28) << "Radius Cutoff(a.u.)" - << std::fixed << std::setprecision(1) << dr * (nr - 1) << std::endl; - ofs << std::left << std::setw(28) << "Lmax" << lmax << std::endl; - for (int l = 0; l != nzeta.size(); ++l) - { - std::string title = "Number of " + spec[l] + "orbital-->"; - ofs << std::left << std::setw(28) << title << nzeta[l] << std::endl; - } - for (int i = 0; i < 75; ++i) - { - ofs << "-"; - } - ofs << std::endl; - ofs << "SUMMARY END\n\n"; - ofs << std::left << std::setw(28) << "Mesh" << nr << std::endl; - ofs << std::left << std::setw(28) << "dr" << std::fixed << std::setprecision(2) << dr << std::endl; - - int ichi = 0; - for (int l = 0; l <= lmax; l++) - { - for (int izeta = 0; izeta < nzeta[l]; izeta++) - { - ofs << std::right << std::setw(20) << "Type" - << std::right << std::setw(20) << "L" - << std::right << std::setw(20) << "N" << std::endl; - ofs << std::right << std::setw(20) << 0 - << std::right << std::setw(20) << l - << std::right << std::setw(20) << izeta; - for (int i = 0; i < nr; i++) - { - if (i % 4 == 0) - { - ofs << std::endl; - } - ofs << std::left << std::setw(22) << std::setprecision(14) - << std::scientific << radials[ichi][i]; - } - ofs << std::endl; - ichi++; - } - } - } - // ofs.close(); // like read_abacus_orb, who opens it, who closes it -} diff --git a/source/module_io/orb_io.h b/source/module_io/orb_io.h deleted file mode 100644 index bdd0043fc2..0000000000 --- a/source/module_io/orb_io.h +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -namespace ModuleIO -{ - /** - * @brief 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. - * - * @param ifs [in] ifstream from the orbital file, via `std::ifstream ifs(forb);` - * @param elem [out] element symbol - * @param ecut [out] planewave energy cutoff - * @param nr [out] number of radial grid points - * @param dr [out] radial grid spacing - * @param nzeta [out] number of zeta functions for each angular momentum - * @param radials [out] radial orbitals - * @param rank [in] MPI rank - */ - void read_abacus_orb(std::ifstream& ifs, - std::string& elem, - double& ecut, - int& nr, - double& dr, - std::vector& nzeta, - std::vector>& radials, - const int rank = 0); - - void write_abacus_orb(std::ofstream& ofs, - const std::string& elem, - const double& ecut, - const int nr, - const double dr, - const std::vector& nzeta, - const std::vector>& radials, - const int rank = 0); -} \ No newline at end of file diff --git a/source/module_io/output.cpp b/source/module_io/output.cpp deleted file mode 100644 index cf6d5eb86f..0000000000 --- a/source/module_io/output.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* output.cpp */ - -#include "output.h" - -void output::printrm(std::ofstream &ofs,const std::string &s, const ModuleBase::matrix &m, const double &limit) -{ - const int b1 = m.nr; - const int b2 = m.nc; - ofs << "\n " << s << " nr=" << b1 << " nc=" << b2 ; - if (b1*b2 == 0) return; - for (int i = 0;i < b1;i++) - { -// ofs<<"\n row = "< limit) - { - ofs << std::setprecision(6) << std::setw(12) << m(i,j); - } - else - { - ofs << std::setw(12) << "0"; - } - } - } - ofs << std::endl; - return; -} - -void output::printrm(const std::string &s, const ModuleBase::matrix &m, const double &limit) -{ - const int b1 = m.nr; - const int b2 = m.nc; - std::cout << "\n " << s << " nr=" << b1 << " nc=" << b2 ; - if (b1*b2 == 0) return; - - for (int i = 0;i < b1;i++) - { - //std::cout << "\n row=" << i; - for (int j = 0;j < b2;j++) - { -// if (j % 4 == 0) std::cout << "\n "; - if (j % 8 == 0) std::cout << "\n "; -// if (std::abs(m(i,j)) > limit) std::cout << std::setprecision(15) << std::setw(20) << m(i,j); - if (std::abs(m(i,j)) > limit) std::cout << std::setprecision(6) << std::setw(12) << m(i,j); -// else std::cout< limit) ofs<< std::setw(12) << sqrt(norm); - else ofs< limit) std::cout<< std::setw(12) << sqrt(norm); - else std::cout< - static void printr1_d(std::ofstream &ofs, const std::string &s,T *u, int n1) - { - ofs<<"\n\n "< - static void printr1_d(const std::string &s, T *u,const int n1) - { - std::cout << "\n " << s << " Dimension = " << n1; - if (n1 <= 0)return; - if (u == 0) return; - //std::cout.setf(ios::scientific, ios::floatfield); - for (int i = 0;i < n1;i++) - { - if (i % 8 == 0) std::cout << "\n"; - std::cout << std::setw(12) << u[i]; - } - std::cout< - static void printV3(std::ofstream &ofs, const ModuleBase::Vector3 v) - { - ofs << " "; - ofs << std::setw(18) << v.x << std::setw(18) << v.y << std::setw(18) << v.z << std::endl; - } - - template - static void printV3(const ModuleBase::Vector3 v) - { - std::cout << " "; - std::cout << std::setw(18) << v.x << std::setw(18) << v.y << std::setw(18) << v.z << std::endl; - } - - template - static void printv31_d(std::ofstream &ofs, const std::string &s, ModuleBase::Vector3 *u, int n1) - { - ofs << " " << s << " Dimension = " << n1 << std::endl; - if (n1 <= 0)return; - if (u == 0) return; - for (int i = 0;i < n1;i++) - { - printV3(ofs, u[i]); - } - } - - template - static void printv31_d(const std::string &s, ModuleBase::Vector3 *u, int n1) - { - std::cout << "\n " << s << " dimension = " << n1; - if (n1 <= 0)return; - if (u == 0) return; - for (int i = 0;i < n1;i++) - { - printV3(u[i]); - } - } - -}; - -#endif // OUTPUT_H diff --git a/source/module_io/output_dmk.cpp b/source/module_io/output_dmk.cpp deleted file mode 100644 index 087f82a615..0000000000 --- a/source/module_io/output_dmk.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "module_io/output_dmk.h" - -namespace ModuleIO -{ - -template -Output_DMK::Output_DMK(elecstate::DensityMatrix* p_DM, Parallel_Orbitals* ParaV, int nspin, int nks) - : p_DM_(p_DM), ParaV_(ParaV), nspin_(nspin), nks_(nks) -{ -} - -template -TK* Output_DMK::get_DMK(int ik) -{ - return p_DM_->get_DMK_vector()[ik].data(); -} - -template class Output_DMK; -template class Output_DMK>; - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/output_dmk.h b/source/module_io/output_dmk.h deleted file mode 100644 index e49c1140a8..0000000000 --- a/source/module_io/output_dmk.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MODULE_IO_OUTPUT_DMK_H -#define MODULE_IO_OUTPUT_DMK_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_estate/module_dm/density_matrix.h" - -namespace ModuleIO -{ - -template -class Output_DMK -{ - public: - Output_DMK(elecstate::DensityMatrix* p_DM, Parallel_Orbitals* ParaV, int nspin, int nks); - TK* get_DMK(int ik); - - private: - elecstate::DensityMatrix* p_DM_ = nullptr; - Parallel_Orbitals* ParaV_ = nullptr; - int nks_; - int nspin_; - std::vector DMK; -}; - -} // namespace ModuleIO - -#endif // MODULE_IO_OUTPUT_DMK_H \ No newline at end of file diff --git a/source/module_io/output_log.cpp b/source/module_io/output_log.cpp deleted file mode 100644 index bc202aec03..0000000000 --- a/source/module_io/output_log.cpp +++ /dev/null @@ -1,362 +0,0 @@ -#include "output_log.h" - -#include "module_parameter/parameter.h" -#include "source_base/constants.h" -#include "source_base/formatter.h" -#include "source_base/global_variable.h" - -#include "source_base/parallel_comm.h" - -#ifdef __MPI -#include -#endif - -namespace ModuleIO -{ -void output_convergence_after_scf(const bool &convergence, double& energy, std::ofstream& ofs_running) -{ - if (convergence) - { - ofs_running << " #SCF IS CONVERGED#" << std::endl; -// ofs_running << " final etot is " << std::setprecision(11) << energy * ModuleBase::Ry_to_eV << " eV" << std::endl; - } - else - { - ofs_running << " !!SCF IS NOT CONVERGED!!" << std::endl; - std::cout << " !!SCF IS NOT CONVERGED!!" << std::endl; - } -} - -void output_after_relax(bool conv_ion, bool conv_esolver, std::ofstream& ofs_running) -{ - if (conv_ion && !conv_esolver) - { - std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - std::cout << " Relaxation is converged, but the SCF is unconverged! The results are unreliable. " << std::endl; - std::cout << " It is suggested to increase the maximum SCF step and/or perform the relaxation again." - << std::endl; - std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - ofs_running << "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - ofs_running << "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - ofs_running << "\n Relaxation is converged, but the SCF is unconverged! The results are unreliable.. " - << std::endl; - ofs_running << "\n It is suggested to increase the maximum SCF step and/or perform the relaxation again. " - << std::endl; - ofs_running << "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - ofs_running << "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl; - } -} - -void output_efermi(const bool &convergence, double& efermi, std::ofstream& ofs_running) -{ - if (convergence && PARAM.inp.out_level != "m") - { -// mohan comment out 2025-06-22 -// ofs_running << std::setprecision(16); -// ofs_running << " EFERMI = " << std::setprecision(11) << efermi * ModuleBase::Ry_to_eV << " eV" << std::endl; - } -} - -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) -{ - // determine the vacuum direction - double vacuum[3] = {0.0}; - for (int dir = 0; dir < 3; dir++) - { - std::vector pos; - for (int it = 0; it < ucell->ntype; ++it) - { - for (int ia = 0; ia < ucell->atoms[it].na; ++ia) - { - pos.push_back(ucell->atoms[it].taud[ia][dir]); - } - } - - std::sort(pos.begin(), pos.end()); - for (int i = 1; i < pos.size(); i++) - { - vacuum[dir] = std::max(vacuum[dir], pos[i] - pos[i - 1]); - } - - // consider the periodic boundary condition - vacuum[dir] = std::max(vacuum[dir], pos[0] + 1 - pos[pos.size() - 1]); - } - - // we assume that the cell is a cuboid - // get the direction with the largest vacuum - int direction = 2; - vacuum[0] *= ucell->latvec.e11; - vacuum[1] *= ucell->latvec.e22; - vacuum[2] *= ucell->latvec.e33; - if (vacuum[0] > vacuum[2]) - { - direction = 0; - } - if (vacuum[1] > vacuum[direction]) - { - direction = 1; - } - - int length = nz; - if (direction == 0) - { - length = nx; - } - else if (direction == 1) - { - length = ny; - } - - // get the average along the direction in real space - auto average = [](const int& ny, - const int& nxyz, - const int& nrxx, - const int& nplane, - const int& startz_current, - const int& direction, - const int& length, - const double* v, - double* ave, - bool abs) { - for (int ir = 0; ir < nrxx; ++ir) - { - int index = 0; - if (direction == 0) - { - index = ir / (ny * nplane); - } - else if (direction == 1) - { - int i = ir / (ny * nplane); - index = ir / nplane - i * ny; - } - else if (direction == 2) - { - index = ir % nplane + startz_current; - } - - double value = abs ? std::fabs(v[ir]) : v[ir]; - - ave[index] += value; - } - -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, ave, length, MPI_DOUBLE, MPI_SUM, POOL_WORLD); -#endif - - int surface = nxyz / length; - for (int i = 0; i < length; ++i) - { - ave[i] /= surface; - } - }; - - // average charge density along direction - std::vector totchg(nrxx, 0.0); - for (int ir = 0; ir < nrxx; ++ir) - { - totchg[ir] = rho[0][ir]; - } - if (PARAM.inp.nspin == 2) - { - for (int ir = 0; ir < nrxx; ++ir) - { - totchg[ir] += rho[1][ir]; - } - } - - std::vector ave(length, 0.0); - average(ny, nxyz, nrxx, nplane, startz_current, direction, length, totchg.data(), ave.data(), true); - - // set vacuum to be the point in space where the electronic charge density is the minimum - // get the index corresponding to the minimum charge density - int min_index = 0; - double min_value = 1e9; - double windows[7] = {0.1, 0.2, 0.3, 0.4, 0.3, 0.2, 0.1}; - for (int i = 0; i < length; i++) - { - double sum = 0; - int temp = i - 3 + length; - // use a sliding average to smoothen in charge density - for (int win = 0; win < 7; win++) - { - int index = (temp + win) % length; - sum += ave[index] * windows[win]; - } - - if (sum < min_value) - { - min_value = sum; - min_index = i; - } - } - - // average electrostatic potential along direction - ave.assign(ave.size(), 0.0); - average(ny, nxyz, nrxx, nplane, startz_current, direction, length, v_elecstat, ave.data(), false); - - // get the vacuum level - double vacuum_level = ave[min_index] * ModuleBase::Ry_to_eV; - ofs_running << "The vacuum level is " << vacuum_level << " eV" << std::endl; -} - -void print_force(std::ofstream& ofs_running, - const UnitCell& cell, - const std::string& name, - const ModuleBase::matrix& force, - bool ry) -{ - // this is a magic number, mohan note 2025-06-22 - const double output_acc = 1.0e-8; - double fac = 1.0; - if (!ry) - { - fac = ModuleBase::Ry_to_eV / 0.529177; - } - - std::vector atom_label; - std::vector force_x; - std::vector force_y; - std::vector force_z; - std::string table; - - ofs_running << "\n #" << name << "#" << std::endl; - - std::vector titles({"Atoms", "Force_x", "Force_y", "Force_z"}); - int iat = 0; - for (int it = 0; it < cell.ntype; it++) - { - for (int ia = 0; ia < cell.atoms[it].na; ia++) - { - std::string atom_labels = cell.atoms[it].label + std::to_string(ia + 1); - double fx = std::abs(force(iat, 0)) > output_acc ? force(iat, 0) * fac : 0.0; - double fy = std::abs(force(iat, 1)) > output_acc ? force(iat, 1) * fac : 0.0; - double fz = std::abs(force(iat, 2)) > output_acc ? force(iat, 2) * fac : 0.0; - atom_label.push_back(atom_labels); - force_x.push_back(fx); - force_y.push_back(fy); - force_z.push_back(fz); - - iat++; - } - } - - - FmtTable fmt(/*titles=*/titles, - /*nrows=*/atom_label.size(), - /*formats=*/{"%8s", "%20.10f", "%20.10f", "%20.10f"}, - 0, - {FmtTable::Align::RIGHT,FmtTable::Align::RIGHT}); - - fmt << atom_label << force_x << force_y << force_z; - table = fmt.str(); - ofs_running << table << std::endl; - - if (PARAM.inp.test_force) - { - std::cout << table << std::endl; - } -} - -void print_stress(const std::string& name, const ModuleBase::matrix& scs, - const bool screen, const bool ry, std::ofstream &ofs) -{ - const double output_acc = 1.0e-8; - double unit_transform = 1; - std::string title = name; - std::string unit = ""; - if (ry) - { - title += " (a.u.)"; - unit = " a.u."; - } - else - { - title += " (KBAR)"; - unit = " KBAR"; - unit_transform = ModuleBase::RYDBERG_SI / pow(ModuleBase::BOHR_RADIUS_SI, 3) * 1.0e-8; - } - std::vector stress_x; - std::vector stress_y; - std::vector stress_z; - std::string table; - - ofs << "\n #" << title << "#" << std::endl; - - std::vector titles({"Stress_x", "Stress_y", "Stress_z"}); - for (int i = 0; i < 3; i++) - { - double sx = scs(i, 0) * unit_transform; - double sy = scs(i, 1) * unit_transform; - double sz = scs(i, 2) * unit_transform; - stress_x.push_back(sx); - stress_y.push_back(sy); - stress_z.push_back(sz); - } - - double pressure = (scs(0, 0) + scs(1, 1) + scs(2, 2)) / 3.0 * unit_transform; - - FmtTable fmt(/*titles=*/titles, - /*nrows=*/3, - /*formats=*/{"%20.10f", "%20.10f", "%20.10f"}, 0, - {FmtTable::Align::RIGHT,FmtTable::Align::RIGHT}); - - fmt << stress_x << stress_y << stress_z; - table = fmt.str(); - ofs << table; - if (name == "TOTAL-STRESS") - { - ofs << " #TOTAL-PRESSURE# (EXCLUDE KINETIC PART OF IONS): " << std::fixed - << std::setprecision(6) << pressure << unit - << std::endl; - } - if (screen) - { - std::cout << table; - if (name == "TOTAL-STRESS") - { - std::cout << " TOTAL-PRESSURE (EXCLUDE KINETIC PART OF IONS): " << std::fixed - << std::setprecision(6) << pressure << unit - << std::endl; - } - } - return; -} - -void write_head(std::ofstream& ofs, const int& istep, const int& iter, const std::string& basisname) -{ - ofs << "\n"; - ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; - ofs << " --> IONIC RELAXATION STEP=" << std::setw(6) << istep+1 - << " ELECTRONIC ITERATION STEP=" << std::setw(6) << iter << "\n"; - ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; - -// ofs << "\n " << basisname << " ALGORITHM --------------- ION=" << std::setw(4) << istep + 1 -// << " ELEC=" << std::setw(4) << iter << "--------------------------------\n"; -} -void write_head_td(std::ofstream& ofs, const int& istep, const int& estep, const int& iter, const std::string& basisname) -{ - ofs << "\n"; - ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; - ofs << " --> IONIC RELAXATION STEP=" << std::setw(6) << istep+1 - << " ELECTRON PROPAGATION STEP=" << std::setw(6) << estep - << " ELECTRONIC ITERATION STEP=" << std::setw(6) << iter << "\n"; - ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; - -// ofs << "\n " << basisname << " ALGORITHM --------------- ION=" << std::setw(4) << istep + 1 -// << " ELEC=" << std::setw(4) << estep << " iter=" << std::setw(4) << iter << "--------------------------------\n"; -} - -}// namespace ModuleIO diff --git a/source/module_io/output_log.h b/source/module_io/output_log.h deleted file mode 100644 index 7eba64b0c4..0000000000 --- a/source/module_io/output_log.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef OUTPUT_LOG -#define OUTPUT_LOG - -#include - -#include "source_base/global_variable.h" -#include "source_base/matrix.h" -#include "source_cell/unitcell.h" - -namespace ModuleIO -{ - -/// @brief output if is convergence and energy after scf -/// @param convergence if is convergence -/// @param energy the total energy in Ry -/// @param ofs_running the output stream -void output_convergence_after_scf(const bool&convergence, double& energy, std::ofstream& ofs_running = GlobalV::ofs_running); - -/// @brief output after relaxation -/// @param conv_ion if is convergence for ions -/// @param conv_esolver if is convergence for electrons -/// @param ofs_running the output stream -void output_after_relax(bool conv_ion, bool conv_esolver, std::ofstream& ofs_running = GlobalV::ofs_running); - -/// @brief output the fermi energy -/// @param convergence if is convergence -/// @param efermi -/// @param ofs_running the output stream -void output_efermi(const bool &convergence, double& efermi, std::ofstream& ofs_running = GlobalV::ofs_running); - -/// @brief 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. -/// -/// @param ucell the unitcell -/// @param rho charge density -/// @param v_elecstat electrostatic potential -/// @param ofs_running the output stream -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 = GlobalV::ofs_running); - -/// @brief output atomic forces -/// @param ofs the output stream -/// @param cell the unitcell -/// @param name force term name -/// @param force atomic forces -/// @param ry true if the unit of force is a.u. -void print_force(std::ofstream& ofs, - const UnitCell& cell, - const std::string& name, - const ModuleBase::matrix& force, - bool ry = true); - -/// @brief output stress components -/// @param name stress term name -/// @param f stress components -/// @param ry true if the unit of force is a.u. -void print_stress(const std::string& name, - const ModuleBase::matrix& scs, - const bool screen, - const bool ry, - std::ofstream &ofs); - -/// @brief write head for scf iteration -/// @param ofs_running output stream -/// @param istep the ion step -/// @param iter the scf iteration step -/// @param basisname basis set name -void write_head(std::ofstream& ofs_running, const int& istep, const int& iter, const std::string& basisname); - -/// @brief write head for scf iteration -/// @param ofs_running output stream -/// @param istep the ion step -/// @param estep the electron step -/// @param iter the scf iteration step -/// @param basisname basis set name -void write_head_td(std::ofstream& ofs_running, const int& istep, const int& estep, const int& iter, const std::string& basisname); - -} // namespace ModuleIO - -#endif diff --git a/source/module_io/output_mat_sparse.cpp b/source/module_io/output_mat_sparse.cpp deleted file mode 100644 index 5fac60103d..0000000000 --- a/source/module_io/output_mat_sparse.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "output_mat_sparse.h" - -#include "module_io/cal_r_overlap_R.h" -#include "module_io/write_HS_R.h" - -namespace ModuleIO -{ - -template <> -void output_mat_sparse(const bool& out_mat_hsR, - const bool& out_mat_dh, - const bool& out_mat_ds, - const bool& out_mat_t, - const bool& out_mat_r, - const int& istep, - const ModuleBase::matrix& v_eff, - const Parallel_Orbitals& pv, - Gint_k& gint_k, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - UnitCell& ucell, - const Grid_Driver& grid, - const K_Vectors& kv, - hamilt::Hamilt* p_ham) -{ -} - -template <> -void output_mat_sparse(const bool& out_mat_hsR, - const bool& out_mat_dh, - const bool& out_mat_ds, - const bool& out_mat_t, - const bool& out_mat_r, - const int& istep, - const ModuleBase::matrix& v_eff, - const Parallel_Orbitals& pv, - Gint_k& gint_k, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - UnitCell& ucell, - const Grid_Driver& grid, - const K_Vectors& kv, - hamilt::Hamilt>* p_ham) -{ - LCAO_HS_Arrays HS_Arrays; // store sparse arrays - - //! generate a file containing the Hamiltonian and S(overlap) matrices - if (out_mat_hsR) - { - output_HSR(ucell,istep, v_eff, pv, HS_Arrays, grid, kv, p_ham); - } - - //! generate a file containing the kinetic energy matrix - if (out_mat_t) - { - output_TR(istep, ucell, pv, HS_Arrays, grid, two_center_bundle, orb); - } - - //! generate a file containing the derivatives of the Hamiltonian matrix (in Ry/Bohr) - if (out_mat_dh) - { - output_dHR(istep, - v_eff, - gint_k, // mohan add 2024-04-01 - ucell, - pv, - HS_Arrays, - grid, // mohan add 2024-04-06 - two_center_bundle, - orb, - kv); // LiuXh add 2019-07-15 - } - //! generate a file containing the derivatives of the overlap matrix (in Ry/Bohr) - if (out_mat_ds) - { - output_dSR(istep, - ucell, - pv, - HS_Arrays, - grid, // mohan add 2024-04-06 - two_center_bundle, - orb, - kv); - } - - // add by jingan for out r_R matrix 2019.8.14 - if (out_mat_r) - { - cal_r_overlap_R r_matrix; - r_matrix.init(ucell, pv, orb); - if (out_mat_hsR) - { - r_matrix.out_rR_other(ucell,istep, HS_Arrays.output_R_coor); - } - else - { - r_matrix.out_rR(ucell, grid, istep); - } - } - - return; -} - -} // namespace ModuleIO diff --git a/source/module_io/output_mat_sparse.h b/source/module_io/output_mat_sparse.h deleted file mode 100644 index e16f6f1927..0000000000 --- a/source/module_io/output_mat_sparse.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef OUTPUT_MAT_SPARSE_H -#define OUTPUT_MAT_SPARSE_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_cell/klist.h" -#include "source_hamilt/hamilt.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" - -namespace ModuleIO -{ -/// @brief the output interface to write the sparse matrix of H, S, T, and r -template -void output_mat_sparse(const bool& out_mat_hsR, - const bool& out_mat_dh, - const bool& out_mat_ds, - const bool& out_mat_t, - const bool& out_mat_r, - const int& istep, - const ModuleBase::matrix& v_eff, - const Parallel_Orbitals& pv, - Gint_k& gint_k, // mohan add 2024-04-01 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - UnitCell& ucell, - const Grid_Driver& grid, // mohan add 2024-04-06 - const K_Vectors& kv, - hamilt::Hamilt* p_ham); -} // namespace ModuleIO - -#endif // OUTPUT_MAT_SPARSE_H diff --git a/source/module_io/output_mulliken.cpp b/source/module_io/output_mulliken.cpp deleted file mode 100644 index 59d5d226a8..0000000000 --- a/source/module_io/output_mulliken.cpp +++ /dev/null @@ -1,641 +0,0 @@ -#include "module_io/output_mulliken.h" - -#include "module_parameter/parameter.h" -#include "source_base/formatter.h" -#include "source_base/name_angular.h" -#include "source_base/scalapack_connector.h" -#include "source_base/tool_quit.h" - -#include - -namespace ModuleIO -{ - -template -Output_Mulliken::Output_Mulliken(Output_Sk* output_sk, - Output_DMK* output_dmk, - Parallel_Orbitals* ParaV, - CellIndex* cell_index, - const std::vector& isk, - int nspin) - : output_sk_(output_sk), output_dmk_(output_dmk), ParaV_(ParaV), cell_index_(cell_index), isk_(isk), nspin_(nspin) -{ - this->set_nspin(nspin); - this->set_ParaV(ParaV); - this->cal_orbMulP(); -} - -template -void Output_Mulliken::write(int istep, std::string out_dir) -{ - std::vector tot_chg = this->get_tot_chg(); - std::vector> atom_chg = this->get_atom_chg(); - std::map, double> orb_chg = this->get_orb_chg(); - std::stringstream as; - as << out_dir << "mulliken.txt"; - std::ofstream os; - if (istep == 0) - { - os.open(as.str(), std::ios::out); - } - else - { - os.open(as.str(), std::ios::app); - } - if (this->nspin_ == 1) - { - this->write_mulliken_nspin1(istep, tot_chg, atom_chg, orb_chg, os); - } - else if (this->nspin_ == 2) - { - this->write_mulliken_nspin2(istep, tot_chg, atom_chg, orb_chg, os); - } - else if (this->nspin_ == 4) - { - this->write_mulliken_nspin4(istep, tot_chg, atom_chg, orb_chg, os); - } - else - { - ModuleBase::WARNING_QUIT("Output_Mulliken::write", "nspin must be 1, 2 or 4"); - } - os.close(); -} - -template -void Output_Mulliken::write_mulliken_nspin1(int istep, - const std::vector& tot_chg, - const std::vector>& atom_chg, - std::map, double> orb_chg, - std::ofstream& os) -{ - os << std::setprecision(4); - /// step info - os << "STEP: " << istep << std::endl; - os << "CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << std::endl; - os << " Total charge:\t" << tot_chg[0] << std::endl; - /// orbital decomposed mulliken populations - FmtCore fmt_of_chg("%20.4f"); - FmtCore fmt_of_label("%-20s"); - FmtCore fmt_of_Z("%20d"); - os << "Decomposed Mulliken populations" << std::endl; - for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat) - { - /// header of the table - std::string atom_label = this->cell_index_->get_atom_label(iat); - os << FmtCore::format("%-20d", iat) << FmtCore::format("%20s", std::string("Zeta of ") + atom_label) - << FmtCore::format("%20s", std::string("Spin 1")) << std::endl; - /// loop of L - for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++) - { - std::vector sum_over_m_and_z(this->nspin_, 0.0); - for (int Z = 0; Z < this->cell_index_->get_nchi(iat, L); Z++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - os << fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z) - << fmt_of_chg.format(orb_chg[std::vector{iat, 0, L, Z, M}]) << std::endl; - } - // sum over m - std::vector sum_over_m(this->nspin_, 0.0); - for (int is = 0; is < this->nspin_; is++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - sum_over_m[is] += orb_chg[std::vector{iat, is, L, Z, M}]; - } - sum_over_m_and_z[is] += sum_over_m[is]; - } - if (L > 0) - { - os << fmt_of_label.format(std::string("SUM OVER M")) << std::setw(20) << "" - << fmt_of_chg.format(sum_over_m[0]) << std::endl; - } - } - os << fmt_of_label.format(std::string("SUM OVER M+Zeta")) << std::setw(20) << "" - << fmt_of_chg.format(sum_over_m_and_z[0]) << std::endl; - os << std::endl; - } - os << fmt_of_label.format(std::string("SUM OVER M+Zeta+L")) << std::setw(20) << "" - << fmt_of_chg.format(atom_chg[iat][0]) << std::endl; - os << std::endl; - os << std::left << std::setw(30) << "Total Charge on atom:" << std::right << std::setw(10) << atom_label - << fmt_of_chg.format(atom_chg[iat][0]) << std::endl; - os << std::endl << std::endl; - } -} - -template -void Output_Mulliken::write_mulliken_nspin2(int istep, - const std::vector& tot_chg, - const std::vector>& atom_chg, - std::map, double> orb_chg, - std::ofstream& os) -{ - os << std::setprecision(4); - /// step info - os << "STEP: " << istep << std::endl; - os << "CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << std::endl; - os << " Total charge of spin " << 1 << ":\t" << tot_chg[0] << std::endl; - os << " Total charge of spin " << 2 << ":\t" << tot_chg[1] << std::endl; - os << " Total charge:\t" << tot_chg[0] + tot_chg[1] << std::endl; - /// orbital decomposed mulliken populations - FmtCore fmt_of_chg("%20.4f"); - FmtCore fmt_of_label("%-20s"); - FmtCore fmt_of_Z("%20d"); - os << "Decomposed Mulliken populations" << std::endl; - for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat) - { - /// header of the table - std::string atom_label = this->cell_index_->get_atom_label(iat); - os << FmtCore::format("%-20d", iat) << FmtCore::format("%20s", std::string("Zeta of ") + atom_label) - << FmtCore::format("%20s", std::string("Spin 1")) << FmtCore::format("%20s", std::string("Spin 2")) - << FmtCore::format("%20s", std::string("Sum")) << FmtCore::format("%20s", std::string("Diff")) << std::endl; - /// loop of L - for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++) - { - std::vector sum_over_m_and_z(this->nspin_, 0.0); - for (int Z = 0; Z < this->cell_index_->get_nchi(iat, L); Z++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - os << fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z) - << fmt_of_chg.format(orb_chg[std::vector{iat, 0, L, Z, M}]) - << fmt_of_chg.format(orb_chg[std::vector{iat, 1, L, Z, M}]) - << fmt_of_chg.format(orb_chg[std::vector{iat, 0, L, Z, M}] - + orb_chg[std::vector{iat, 1, L, Z, M}]) - << fmt_of_chg.format(orb_chg[std::vector{iat, 0, L, Z, M}] - - orb_chg[std::vector{iat, 1, L, Z, M}]) - << std::endl; - } - // sum over m - std::vector sum_over_m(this->nspin_, 0.0); - for (int is = 0; is < this->nspin_; is++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - sum_over_m[is] += orb_chg[std::vector{iat, is, L, Z, M}]; - } - sum_over_m_and_z[is] += sum_over_m[is]; - } - if (L > 0) - { - os << fmt_of_label.format(std::string("SUM OVER M")) << std::setw(20) << "" - << fmt_of_chg.format(sum_over_m[0]) << fmt_of_chg.format(sum_over_m[1]) - << fmt_of_chg.format(sum_over_m[0] + sum_over_m[1]) - << fmt_of_chg.format(sum_over_m[0] - sum_over_m[1]) << std::endl; - } - } - os << fmt_of_label.format(std::string("SUM OVER M+Zeta")) << std::setw(20) << "" - << fmt_of_chg.format(sum_over_m_and_z[0]) << fmt_of_chg.format(sum_over_m_and_z[1]) - << fmt_of_chg.format(sum_over_m_and_z[0] + sum_over_m_and_z[1]) - << fmt_of_chg.format(sum_over_m_and_z[0] - sum_over_m_and_z[1]) << std::endl; - os << std::endl; - } - os << fmt_of_label.format(std::string("SUM OVER M+Zeta+L")) << std::setw(20) << "" - << fmt_of_chg.format(atom_chg[iat][0]) << fmt_of_chg.format(atom_chg[iat][1]) - << fmt_of_chg.format(atom_chg[iat][0] + atom_chg[iat][1]) - << fmt_of_chg.format(atom_chg[iat][0] - atom_chg[iat][1]) << std::endl; - os << std::endl; - os << std::left << std::setw(30) << "Total Charge on atom:" << std::right << std::setw(10) << atom_label - << fmt_of_chg.format(atom_chg[iat][0] + atom_chg[iat][1]) << std::endl; - os << std::left << std::setw(30) << "Total Magnetism on atom: " << std::right << std::setw(10) << atom_label - << fmt_of_chg.format(atom_chg[iat][0] - atom_chg[iat][1]) << std::endl; - os << std::endl << std::endl; - } -} - -template -void Output_Mulliken::write_mulliken_nspin4(int istep, - const std::vector& tot_chg, - const std::vector>& atom_chg, - std::map, double> orb_chg, - std::ofstream& os) -{ - os << std::setprecision(4); - /// step info - os << "STEP: " << istep << std::endl; - os << "CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << std::endl; - os << " Total charge:\t" << tot_chg[0] << std::endl; - /// orbital decomposed mulliken populations - FmtCore fmt_of_chg("%20.4f"); - FmtCore fmt_of_label("%-20s"); - FmtCore fmt_of_Z("%20d"); - os << "Decomposed Mulliken populations" << std::endl; - for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat) - { - /// header of the table - std::string atom_label = this->cell_index_->get_atom_label(iat); - os << FmtCore::format("%-20d", iat) << FmtCore::format("%20s", std::string("Zeta of ") + atom_label) - << FmtCore::format("%20s", std::string("Spin 1")) << FmtCore::format("%20s", std::string("Spin 2")) - << FmtCore::format("%20s", std::string("Spin 3")) << FmtCore::format("%20s", std::string("Spin 4")) - << std::endl; - /// loop of L - for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++) - { - std::vector sum_over_m_and_z(this->nspin_, 0.0); - for (int Z = 0; Z < this->cell_index_->get_nchi(iat, L); Z++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - os << fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z) - << fmt_of_chg.format(orb_chg[std::vector{iat, 0, L, Z, M}]) - << fmt_of_chg.format(orb_chg[std::vector{iat, 1, L, Z, M}]) - << fmt_of_chg.format(orb_chg[std::vector{iat, 2, L, Z, M}]) - << fmt_of_chg.format(orb_chg[std::vector{iat, 3, L, Z, M}]) << std::endl; - } - // sum over m - std::vector sum_over_m(this->nspin_, 0.0); - for (int is = 0; is < this->nspin_; is++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - sum_over_m[is] += orb_chg[std::vector{iat, is, L, Z, M}]; - } - sum_over_m_and_z[is] += sum_over_m[is]; - } - if (L > 0) - { - os << fmt_of_label.format(std::string("SUM OVER M")) << std::setw(20) << "" - << fmt_of_chg.format(sum_over_m[0]) << fmt_of_chg.format(sum_over_m[1]) - << fmt_of_chg.format(sum_over_m[2]) << fmt_of_chg.format(sum_over_m[3]) << std::endl; - } - } - os << fmt_of_label.format(std::string("SUM OVER M+Zeta")) << std::setw(20) << "" - << fmt_of_chg.format(sum_over_m_and_z[0]) << fmt_of_chg.format(sum_over_m_and_z[1]) - << fmt_of_chg.format(sum_over_m_and_z[2]) << fmt_of_chg.format(sum_over_m_and_z[3]) << std::endl; - os << std::endl; - } - os << fmt_of_label.format(std::string("SUM OVER M+Zeta+L")) << std::setw(20) << "" - << fmt_of_chg.format(atom_chg[iat][0]) << fmt_of_chg.format(atom_chg[iat][1]) - << fmt_of_chg.format(atom_chg[iat][2]) << fmt_of_chg.format(atom_chg[iat][3]) << std::endl; - os << std::endl; - os << std::left << std::setw(30) << "Total Charge on atom:" << std::right << std::setw(10) << atom_label - << fmt_of_chg.format(atom_chg[iat][0]) << std::endl; - os << std::left << std::setw(30) << "Total Magnetism on atom: " << std::right << std::setw(10) << atom_label - << fmt_of_chg.format(atom_chg[iat][1]) << fmt_of_chg.format(atom_chg[iat][2]) - << fmt_of_chg.format(atom_chg[iat][3]) << std::endl; - os << std::endl << std::endl; - } -} - -/// set nspin -template -void Output_Mulliken::set_nspin(int nspin_in) -{ - if (nspin_in != 1 && nspin_in != 2 && nspin_in != 4) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_nspin", "nspin must be 1, 2 or 4"); - } - this->nspin_ = nspin_in; -} - -/// @brief set ParaV -template -void Output_Mulliken::set_ParaV(Parallel_Orbitals* ParaV_in) -{ - this->ParaV_ = ParaV_in; - int nloc = this->ParaV_->nloc; - if (nloc <= 0) - { - ModuleBase::WARNING_QUIT("SpinConstrain::set_ParaV", "nloc <= 0"); - } -} - -template -std::vector Output_Mulliken::get_tot_chg() -{ - std::vector tot_chg(this->nspin_, 0.0); - int nw = this->cell_index_->get_nw(); - const int nlocal = (this->nspin_ == 4) ? nw / 2 : nw; - for (int is = 0; is != this->nspin_; ++is) - { - for (size_t iw = 0; iw != nlocal; ++iw) - { - tot_chg[is] += this->orbMulP_(is, iw); - } - } - return tot_chg; -} - -template -std::vector> Output_Mulliken::get_atom_chg() -{ - int nat = this->cell_index_->get_nat(); - std::vector> atom_chg(nat, std::vector(this->nspin_, 0.0)); - int num = 0; - for (int iat = 0; iat < nat; iat++) - { - int nw_it = this->cell_index_->get_nw(iat); - for (int iw = 0; iw < nw_it; iw++) - { - for (int is = 0; is < this->nspin_; is++) - { - atom_chg[iat][is] += std::abs(this->orbMulP_(is, num)) < 1e-10 ? 0.0 : this->orbMulP_(is, num); - } - num++; - } - } - return atom_chg; -} - -template -std::map, double> Output_Mulliken::get_orb_chg() -{ - int nat = this->cell_index_->get_nat(); - std::map, double> orb_chg; - for (int is = 0; is < this->nspin_; is++) - { - int num = 0; - for (int iat = 0; iat < nat; iat++) - { - int maxL = this->cell_index_->get_maxL(iat); - for (int L = 0; L <= maxL; L++) - { - int nchi = this->cell_index_->get_nchi(iat, L); - for (int Z = 0; Z < this->cell_index_->get_nchi(iat, L); Z++) - { - for (int M = 0; M < (2 * L + 1); M++) - { - orb_chg[std::vector{iat, is, L, Z, M}] - = std::abs(this->orbMulP_(is, num)) < 1e-10 ? 0.0 : this->orbMulP_(is, num); - num++; - } - } - } - } - } - return orb_chg; -} - -template -void Output_Mulliken::collect_MW(ModuleBase::matrix& MecMulP, const ModuleBase::ComplexMatrix& mud, int nw, int isk) -{ - if (this->nspin_ == 1 || this->nspin_ == 2) - { - for (size_t i = 0; i < nw; ++i) - { - if (this->ParaV_->in_this_processor(i, i)) - { - const int ir = this->ParaV_->global2local_row(i); - const int ic = this->ParaV_->global2local_col(i); - MecMulP(isk, i) += mud(ic, ir).real(); - } - } - } - else if (this->nspin_ == 4) - { - for (size_t i = 0; i < nw; ++i) - { - const int index = i % 2; - if (!index) - { - const int j = i / 2; - const int k1 = 2 * j; - const int k2 = 2 * j + 1; - if (this->ParaV_->in_this_processor(k1, k1)) - { - const int ir = this->ParaV_->global2local_row(k1); - const int ic = this->ParaV_->global2local_col(k1); - MecMulP(0, j) += mud(ic, ir).real(); - MecMulP(3, j) += mud(ic, ir).real(); - } - if (this->ParaV_->in_this_processor(k1, k2)) - { - const int ir = this->ParaV_->global2local_row(k1); - const int ic = this->ParaV_->global2local_col(k2); - // note that mud is column major - MecMulP(1, j) += mud(ic, ir).real(); - // M_y = i(M_{up,down} - M_{down,up}) = -(M_{up,down} - M_{down,up}).imag() - MecMulP(2, j) -= mud(ic, ir).imag(); - } - if (this->ParaV_->in_this_processor(k2, k1)) - { - const int ir = this->ParaV_->global2local_row(k2); - const int ic = this->ParaV_->global2local_col(k1); - MecMulP(1, j) += mud(ic, ir).real(); - // M_y = i(M_{up,down} - M_{down,up}) = -(M_{up,down} - M_{down,up}).imag() - MecMulP(2, j) += mud(ic, ir).imag(); - } - if (this->ParaV_->in_this_processor(k2, k2)) - { - const int ir = this->ParaV_->global2local_row(k2); - const int ic = this->ParaV_->global2local_col(k2); - MecMulP(0, j) += mud(ic, ir).real(); - MecMulP(3, j) -= mud(ic, ir).real(); - } - } - } - } -} - -template -void Output_Mulliken::print_atom_mag(const std::vector>& atom_chg, std::ostream& os) -{ - int nat = this->cell_index_->get_nat(); - std::vector atom_label; - std::vector mag_x(nat, 0.0); - std::vector mag_y(nat, 0.0); - std::vector mag_z(nat, 0.0); - if (this->nspin_ == 2) - { - const std::vector title = {"Total Magnetism (uB)", ""}; - const std::vector fmts = {"%-26s", "%20.10f"}; - FmtTable table(/*titles=*/title, - /*nrows=*/nat, - /*formats=*/fmts, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::LEFT}); - for (int iat = 0; iat < nat; ++iat) - { - atom_label.push_back(this->cell_index_->get_atom_label(iat, true)); - mag_z[iat] = atom_chg[iat][0] - atom_chg[iat][1]; - } - table << atom_label << mag_z; - os << table.str() << std::endl; - } - else if (this->nspin_ == 4) - { - std::vector magnitude(nat, 0.0); - std::vector polar(nat, 0.0); - std::vector azimuth(nat, 0.0); - const std::vector title = {"Total Magnetism (uB)", "x", "y", "z"}; - const std::vector fmts = {"%26s", "%20.10f", "%20.10f", "%20.10f"}; - FmtTable table(/*titles=*/title, - /*nrows=*/nat, - /*formats=*/fmts, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::RIGHT}); - for (int iat = 0; iat < nat; ++iat) - { - atom_label.push_back(this->cell_index_->get_atom_label(iat, true)); - mag_x[iat] = atom_chg[iat][1]; - mag_y[iat] = atom_chg[iat][2]; - mag_z[iat] = atom_chg[iat][3]; - magnitude[iat] = std::sqrt(mag_x[iat] * mag_x[iat] + mag_y[iat] * mag_y[iat] + mag_z[iat] * mag_z[iat]); - polar[iat] = std::acos(mag_z[iat] / magnitude[iat]) * 180.0 / ModuleBase::PI; - azimuth[iat] = std::atan2(mag_y[iat], mag_x[iat]) * 180.0 / ModuleBase::PI; - } - table << atom_label << mag_x << mag_y << mag_z; - os << table.str() << std::endl; - /// output mag in polar coordinates - const std::vector title_polar = {"Total Magnetism (uB)", "Magnitude (uB)", "Polar (degree)", "Azimuth (degree)"}; - const std::vector fmts_polar = {"%26s", "%20.10f", "%20.10f", "%20.10f"}; - FmtTable table_polar(/*titles=*/title_polar, - /*nrows=*/nat, - /*formats=*/fmts_polar, - /*indent=*/0, - /*align=*/{/*value*/FmtTable::Align::RIGHT, /*title*/FmtTable::Align::RIGHT}); - table_polar << atom_label << magnitude << polar << azimuth; - os << table_polar.str() << std::endl; - } - else if (this->nspin_ == 1) - { - /// do nothing due to no mag info available - } - else - { - ModuleBase::WARNING_QUIT("Output_Mulliken::print_atom_mag", "nspin must be 1, 2 or 4"); - } -} - -template -std::vector> Output_Mulliken::get_atom_mulliken(std::vector>& atom_chg) -{ - int nat = this->cell_index_->get_nat(); - std::vector> atom_mulliken(nat, std::vector(this->nspin_, 0.0)); - for (int iat = 0; iat < nat; iat++) - { - if (this->nspin_ == 1) - { - atom_mulliken[iat][0] = atom_chg[iat][0]; - } - else if (this->nspin_ == 2) - { - atom_mulliken[iat][0] = atom_chg[iat][0] + atom_chg[iat][1]; - atom_mulliken[iat][1] = atom_chg[iat][0] - atom_chg[iat][1]; - } - else if (this->nspin_ == 4) - { - atom_mulliken[iat][0] = atom_chg[iat][0]; - atom_mulliken[iat][1] = atom_chg[iat][1]; - atom_mulliken[iat][2] = atom_chg[iat][2]; - atom_mulliken[iat][3] = atom_chg[iat][3]; - } - else - { - ModuleBase::WARNING_QUIT("Output_Mulliken::get_atom_mulliken", "nspin must be 1, 2 or 4"); - } - } - return atom_mulliken; -} - -template <> -void Output_Mulliken>::cal_orbMulP() -{ - ModuleBase::TITLE("module_deltaspin", "cal_MW_k"); - int nw = this->cell_index_->get_nw(); - const int nlocal = (this->nspin_ == 4) ? nw / 2 : nw; - ModuleBase::matrix MecMulP(this->nspin_, nlocal, true); - this->orbMulP_.create(this->nspin_, nlocal, true); - for (size_t ik = 0; ik != this->isk_.size(); ++ik) - { - auto p_Sk = this->output_sk_->get_Sk(ik); - auto p_DMk = this->output_dmk_->get_DMK(ik); - ModuleBase::ComplexMatrix mud(this->ParaV_->ncol, this->ParaV_->nrow, true); -#ifdef __MPI - const char T_char = 'T'; - const char N_char = 'N'; - const int one_int = 1; - const std::complex one_float = {1.0, 0.0}, zero_float = {0.0, 0.0}; - pzgemm_(&N_char, - &T_char, - &nw, - &nw, - &nw, - &one_float, - p_DMk, - &one_int, - &one_int, - this->ParaV_->desc, - p_Sk, - &one_int, - &one_int, - this->ParaV_->desc, - &zero_float, - mud.c, - &one_int, - &one_int, - this->ParaV_->desc); - this->collect_MW(MecMulP, mud, nw, this->isk_[ik]); -#endif - } -#ifdef __MPI - MPI_Allreduce(MecMulP.c, this->orbMulP_.c, this->nspin_ * nlocal, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); -#endif -} - -template <> -void Output_Mulliken::cal_orbMulP() -{ - ModuleBase::TITLE("Mulliken_Charge", "cal_mulliken"); - int nw = this->cell_index_->get_nw(); - const int nspin = (this->nspin_ == 2) ? 2 : 1; - const int nlocal = (this->nspin_ == 4) ? nw / 2 : nw; - // std::vector> MecMulP(PARAM.inp.nspin, std::vector(nlocal, 0)); - // std::vector> orbMulP(PARAM.inp.nspin, std::vector(nlocal, 0)); - ModuleBase::matrix MecMulP(this->nspin_, nlocal, true); - this->orbMulP_.create(this->nspin_, nlocal, true); - - for (size_t is = 0; is != nspin; ++is) - { - ModuleBase::matrix mud; - auto p_Sk = this->output_sk_->get_Sk(is); - auto p_DMk = this->output_dmk_->get_DMK(is); - mud.create(this->ParaV_->ncol, this->ParaV_->nrow); -#ifdef __MPI - const char T_char = 'T'; - const char N_char = 'N'; - const int one_int = 1; - const double one_float = 1.0, zero_float = 0.0; - pdgemm_(&N_char, - &T_char, - &nw, - &nw, - &nw, - &one_float, - p_DMk, - &one_int, - &one_int, - this->ParaV_->desc, - p_Sk, - &one_int, - &one_int, - this->ParaV_->desc, - &zero_float, - mud.c, - &one_int, - &one_int, - this->ParaV_->desc); - if (this->nspin_ == 1 || this->nspin_ == 2) - { - for (size_t i = 0; i != nw; ++i) - if (this->ParaV_->in_this_processor(i, i)) - { - const int ir = this->ParaV_->global2local_row(i); - const int ic = this->ParaV_->global2local_col(i); - MecMulP(is, i) += mud(ic, ir); - } - } -#endif - } -#ifdef __MPI - MPI_Reduce(MecMulP.c, this->orbMulP_.c, this->nspin_ * nlocal, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); -#endif -} - -// case for nspin<4, gamma-only k-point -template class Output_Mulliken; -// case for nspin<4, multi-k-points -template class Output_Mulliken>; - -} // namespace ModuleIO diff --git a/source/module_io/output_mulliken.h b/source/module_io/output_mulliken.h deleted file mode 100644 index a33bb26e97..0000000000 --- a/source/module_io/output_mulliken.h +++ /dev/null @@ -1,196 +0,0 @@ -#ifndef OUTPUT_MULLIKEN_H -#define OUTPUT_MULLIKEN_H -#include "source_base/complexmatrix.h" -#include "source_base/matrix.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/cell_index.h" -#include "source_estate/elecstate_lcao.h" -#include "module_io/output_dmk.h" -#include "module_io/output_sk.h" -#include "source_base/formatter.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_lcao.h" - -#include -#include - -namespace ModuleIO -{ - -/// @brief the output interface to write the Mulliken population charges -template -class Output_Mulliken -{ - public: - /// constructor of Output_Mulliken - Output_Mulliken(Output_Sk* output_sk, - Output_DMK* output_dmk, - Parallel_Orbitals* ParaV, - CellIndex* cell_index, - const std::vector& isk, - int nspin); - /// the outer interface to write the Mulliken population charges - void write(int istep, std::string out_dir); - /// print atom mag to running log file - void print_atom_mag(const std::vector>& atom_chg, std::ostream& os); - /// get total charge - std::vector get_tot_chg(); - /// get atom charge - std::vector> get_atom_chg(); - /// get orbital charge - std::map, double> get_orb_chg(); - /// returun atom_mulliken for updateing STRU file - std::vector> get_atom_mulliken(std::vector>& atom_chg); - - private: - /****************************************************************** - * private functions - *******************************************************************/ - /// write mulliken.txt for the case of nspin=1 - void write_mulliken_nspin1(int istep, - const std::vector& tot_chg, - const std::vector>& atom_chg, - std::map, double> orb_chg, - std::ofstream& os); - /// write mulliken.txt for the case of nspin=2 - void write_mulliken_nspin2(int istep, - const std::vector& tot_chg, - const std::vector>& atom_chg, - std::map, double> orb_chg, - std::ofstream& os); - /// write mulliken.txt for the case of nspin=4 - void write_mulliken_nspin4(int istep, - const std::vector& tot_chg, - const std::vector>& atom_chg, - std::map, double> orb_chg, - std::ofstream& os); - /// set nspin - void set_nspin(int nspin_in); - /// set orbital parallel info - void set_ParaV(Parallel_Orbitals* ParaV_in); - /// collect_mw from matrix multiplication result - void collect_MW(ModuleBase::matrix& MecMulP, const ModuleBase::ComplexMatrix& mud, int nw, int isk); - /// mulliken population = trace(dm*overlap) - void cal_orbMulP(); - - private: - /****************************************************************** - * private variables - *******************************************************************/ - Output_Sk* output_sk_ = nullptr; - Output_DMK* output_dmk_ = nullptr; - Parallel_Orbitals* ParaV_ = nullptr; - CellIndex* cell_index_ = nullptr; - const std::vector& isk_; - int nspin_; - ModuleBase::matrix orbMulP_; -}; - -template -void cal_mag(Parallel_Orbitals* pv, - hamilt::Hamilt* p_ham, - K_Vectors& kv, - elecstate::ElecState* pelec, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - UnitCell& ucell, - const Grid_Driver& gd, - const int istep, - const bool print) -{ - // 1) calculate and output Mulliken population charges and magnetic moments - if (PARAM.inp.out_mul) - { - auto cell_index - = CellIndex(ucell.get_atomLabels(), ucell.get_atomCounts(), ucell.get_lnchiCounts(), PARAM.inp.nspin); - auto out_sk = ModuleIO::Output_Sk(p_ham, pv, PARAM.inp.nspin, kv.get_nks()); - auto out_dmk = ModuleIO::Output_DMK(dynamic_cast*>(pelec)->get_DM(), - pv, - PARAM.inp.nspin, - kv.get_nks()); - auto mulp = ModuleIO::Output_Mulliken(&(out_sk), &(out_dmk), pv, &cell_index, kv.isk, PARAM.inp.nspin); - auto atom_chg = mulp.get_atom_chg(); - /// used in updating mag info in STRU file - ucell.atom_mulliken = mulp.get_atom_mulliken(atom_chg); - if (print && GlobalV::MY_RANK == 0) - { - /// write the Orbital file - cell_index.write_orb_info(PARAM.globalv.global_out_dir); - /// write mulliken.txt - mulp.write(istep, PARAM.globalv.global_out_dir); - /// write atomic mag info in running log file - mulp.print_atom_mag(atom_chg, GlobalV::ofs_running); - } - } - // 2) calculate and output the magnetizations of each atom with projection method - if (PARAM.inp.onsite_radius > 0) - { - std::vector> atom_mag(ucell.nat, std::vector(PARAM.inp.nspin, 0.0)); - std::vector> constrain(ucell.nat, ModuleBase::Vector3(1, 1, 1)); - const hamilt::HContainer* dmr - = dynamic_cast*>(pelec)->get_DM()->get_DMR_pointer(1); - std::vector moments; - std::vector mag_x(ucell.nat, 0.0); - std::vector mag_y(ucell.nat, 0.0); - std::vector mag_z(ucell.nat, 0.0); - auto atomLabels = ucell.get_atomLabels(); - if(PARAM.inp.nspin == 2) - { - auto sc_lambda - = new hamilt::DeltaSpin>(nullptr, - kv.kvec_d, - dynamic_cast*>(p_ham)->getHR(), - ucell, - &gd, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs()); - dynamic_cast*>(pelec)->get_DM()->switch_dmr(2); - moments = sc_lambda->cal_moment(dmr, constrain); - dynamic_cast*>(pelec)->get_DM()->switch_dmr(0); - delete sc_lambda; - //const std::vector title = {"Total Magnetism (uB)", ""}; - //const std::vector fmts = {"%-26s", "%20.10f"}; - //FmtTable table(title, ucell.nat, fmts, {FmtTable::Align::RIGHT, FmtTable::Align::LEFT}); - for(int iat=0;iat, std::complex>>( - nullptr, - kv.kvec_d, - dynamic_cast, std::complex>*>(p_ham)->getHR(), - ucell, - &gd, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs()); - moments = sc_lambda->cal_moment(dmr, constrain); - delete sc_lambda; - //const std::vector title = {"Total Magnetism (uB)", "", "", ""}; - //const std::vector fmts = {"%-26s", "%20.10f", "%20.10f", "%20.10f"}; - //FmtTable table(title, ucell.nat, fmts, {FmtTable::Align::RIGHT, FmtTable::Align::LEFT}); - for(int iat=0;iat -Output_Sk::Output_Sk(hamilt::Hamilt* p_hamilt, Parallel_Orbitals* ParaV, int nspin, int nks) - : p_hamilt_(p_hamilt), ParaV_(ParaV), nspin_(nspin), nks_(nks) -{ -} - -template <> -double* Output_Sk::get_Sk(int ik) -{ - if (ik < 0 || ik >= this->nks_) - { - ModuleBase::WARNING_QUIT("Output_Sk::get_sk", "ik out of range"); - } - return dynamic_cast*>(this->p_hamilt_)->getSk(); -} - -template <> -std::complex* Output_Sk>::get_Sk(int ik) -{ - if (ik < 0 || ik >= this->nks_) - { - ModuleBase::WARNING_QUIT("Output_Sk::get_sk", "ik out of range"); - } - if (this->nspin_ == 4) - { - dynamic_cast, std::complex>*>(this->p_hamilt_) - ->updateSk(ik, 1); - return dynamic_cast, std::complex>*>(this->p_hamilt_)->getSk(); - } - else - { - dynamic_cast, double>*>(this->p_hamilt_)->updateSk(ik, 1); - return dynamic_cast, double>*>(this->p_hamilt_)->getSk(); - } - return nullptr; -} - -template class Output_Sk; -template class Output_Sk>; - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/output_sk.h b/source/module_io/output_sk.h deleted file mode 100644 index 8cdbfa827b..0000000000 --- a/source/module_io/output_sk.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef OUTPUT_SK_H -#define OUTPUT_SK_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -namespace ModuleIO -{ - -template -class Output_Sk -{ - public: - /// constructur of Output_Sk - Output_Sk(hamilt::Hamilt* p_hamilt, Parallel_Orbitals* ParaV, int nspin, int nks); - /// @brief the function to get Sk for a given k-point - TK* get_Sk(int ik); - - private: - hamilt::Hamilt* p_hamilt_ = nullptr; - Parallel_Orbitals* ParaV_ = nullptr; - int nks_; - int nspin_; - std::vector SK; -}; - -} // namespace ModuleIO - -#endif // OUTPUT_SK_H \ No newline at end of file diff --git a/source/module_io/para_json.cpp b/source/module_io/para_json.cpp deleted file mode 100644 index 526567429e..0000000000 --- a/source/module_io/para_json.cpp +++ /dev/null @@ -1,70 +0,0 @@ - -#include "para_json.h" - -#include "source_base/global_variable.h" - -#include -#include -#include -#include -#ifdef __RAPIDJSON -#include "json_output/abacusjson.h" -#include "json_output/general_info.h" -#include "json_output/init_info.h" -#include "json_output/readin_info.h" - -#endif // __RAPIDJSON - -namespace Json -{ - -// void create_Json(ModuleSymmetry::Symmetry *symm,Atom *atoms,Input *input){ -// #ifdef __RAPIDJSON -// gen_general_info(input); -// gen_init(symm,atoms); -// #endif -// } - -void json_output() -{ -#ifdef __RAPIDJSON -#ifdef __MPI - if (GlobalV::MY_RANK == 0) - AbacusJson::write_to_json("abacus.json"); -#else - AbacusJson::write_to_json("abacus.json"); -#endif -#endif // __RAPIDJSON -} - -void create_Json(UnitCell* ucell, const Parameter& param) -{ -#ifdef __RAPIDJSON - gen_general_info(param); - gen_init(ucell); - // gen_stru(ucell); -#endif - json_output(); -} - -void gen_stru_wrapper(UnitCell* ucell) -{ -#ifdef __RAPIDJSON -#ifdef __MPI - if (GlobalV::MY_RANK == 0) - gen_stru(ucell); -#else - gen_stru(ucell); -#endif -#endif -} - -void convert_time(std::time_t time_now, std::string& time_str) -{ - std::tm* tm = std::localtime(&time_now); - std::ostringstream oss; - oss << std::put_time(tm, "%Y-%m-%d %H:%M:%S"); - time_str = oss.str(); -} - -} // namespace Json diff --git a/source/module_io/para_json.h b/source/module_io/para_json.h deleted file mode 100644 index 1516d994c8..0000000000 --- a/source/module_io/para_json.h +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -#include "source_cell/module_symmetry/symmetry.h" -#include "source_cell/atom_spec.h" -#include "module_parameter/parameter.h" -#include "source_cell/unitcell.h" -namespace Json -{ - -// void create_Json(ModuleSymmetry::Symmetry *symm,Atom *atoms,Input *input); - -void create_Json(UnitCell *ucell, const Parameter& input); - -// Output the json to abacus.json file -void json_output(); - -// Convert time_t to string -void convert_time(std::time_t time_now, std::string& time_str); - -// generate struture wrapper function -void gen_stru_wrapper(UnitCell *ucell); -} // namespace Json diff --git a/source/module_io/parse_args.cpp b/source/module_io/parse_args.cpp deleted file mode 100644 index b279512e86..0000000000 --- a/source/module_io/parse_args.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "parse_args.h" - -#include -#include - -#include "module_io/read_input.h" -#include "source_main/version.h" - -namespace ModuleIO -{ - -void parse_args(int argc, char** argv) -{ - for (int i = 1; i < argc; ++i) // Start from 1 to skip the program name - { - std::string arg = argv[i]; - if (arg == "--version" || arg == "-v" || arg == "-V") - { -#ifdef VERSION - const char* version = VERSION; -#else - const char* version = "unknown"; -#endif - std::cout << "ABACUS version " << version << std::endl; - std::exit(0); - } - else if (arg == "--check-input") - { - ModuleIO::ReadInput::check_mode = true; - } - else - { - std::cerr << "Unknown argument: " << arg << std::endl; - std::exit(1); - } - } -} - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/parse_args.h b/source/module_io/parse_args.h deleted file mode 100644 index c2a246946e..0000000000 --- a/source/module_io/parse_args.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef ModuleIO_PARSE_ARGS_H -#define ModuleIO_PARSE_ARGS_H - -namespace ModuleIO -{ -/** - * @brief This function reture the version information when using command - * "abacus --version", "abacus -v" or "abacus -V". Otherwise, it does nothing. - * - * @param [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) - * @param [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. - */ -void parse_args(int argc, char** argv); -} // namespace ModuleIO - -#endif \ No newline at end of file diff --git a/source/module_io/print_info.cpp b/source/module_io/print_info.cpp deleted file mode 100644 index b5b3dfb101..0000000000 --- a/source/module_io/print_info.cpp +++ /dev/null @@ -1,385 +0,0 @@ -#include "print_info.h" - -#include "source_base/global_variable.h" -#include "module_parameter/parameter.h" - - -namespace ModuleIO -{ - -void setup_parameters(UnitCell& ucell, K_Vectors& kv) -{ - ModuleBase::TITLE("ModuleIO", "setup_parameters"); - - if(PARAM.inp.calculation=="scf" - || PARAM.inp.calculation=="relax" - || PARAM.inp.calculation=="cell-relax" - || PARAM.inp.calculation=="nscf" - || PARAM.inp.calculation=="get_pchg" - || PARAM.inp.calculation=="get_wf" - || PARAM.inp.calculation=="md") - { - std::cout << " ---------------------------------------------------------" << std::endl; - if(PARAM.inp.calculation=="scf") - { - std::cout << " Self-consistent calculations for electrons" << std::endl; - } - else if(PARAM.inp.calculation=="test") - { - std::cout << " Test run" << std::endl; - } - if(PARAM.inp.calculation=="relax") - { - std::cout << " Ion relaxation calculations" << std::endl; - } - if(PARAM.inp.calculation=="cell-relax") - { - std::cout << " Cell relaxation calculations" << std::endl; - } - if(PARAM.inp.calculation=="md") - { - std::cout << " Molecular Dynamics simulations" << std::endl; - - std::cout << " ---------------------------------------------------------" << std::endl; - - if (PARAM.mdp.md_type == "fire") - { - std::cout << " ENSEMBLE : " << "FIRE" << std::endl; - } - else if (PARAM.mdp.md_type == "nve") - { - std::cout << " ENSEMBLE : " << "NVE" << std::endl; - } - else if (PARAM.mdp.md_type == "nvt") - { - std::cout << " ENSEMBLE : " - << "NVT mode: " << PARAM.mdp.md_thermostat << std::endl; - } - else if (PARAM.mdp.md_type == "npt") - { - std::cout << " ENSEMBLE : " - << "NPT mode: " << PARAM.mdp.md_pmode << std::endl; - } - else if (PARAM.mdp.md_type == "langevin") - { - std::cout << " ENSEMBLE : " << "Langevin" << std::endl; - } - else if (PARAM.mdp.md_type == "msst") - { - std::cout << " ENSEMBLE : " << "MSST" << std::endl; - } - - std::cout << " Time interval(fs) : " << PARAM.mdp.md_dt << std::endl; - } - std::cout << " ---------------------------------------------------------" << std::endl; - - - std::cout << " " << std::setw(8) << "SPIN" - << std::setw(16) << "KPOINTS" - << std::setw(12) << "PROCESSORS" - << std::setw(12) << "THREADS"; - - const bool orbinfo = (PARAM.inp.basis_type=="lcao" || PARAM.inp.basis_type=="lcao_in_pw" - || (PARAM.inp.basis_type=="pw" && PARAM.inp.init_wfc.substr(0, 3) == "nao")); - if (orbinfo) { std::cout << std::setw(12) << "NBASE"; } - - std::cout << std::endl; - std::cout << " " << std::setw(8) << PARAM.inp.nspin; - - if(PARAM.globalv.gamma_only_local) - { - std::cout << std::setw(16) << "Gamma"; - } - else - { - std::cout << std::setw(16) << kv.get_nkstot(); - } - - std::cout << std::setw(12) << GlobalV::NPROC - << std::setw(12) << PARAM.globalv.nthread_per_proc * GlobalV::NPROC; - if (orbinfo) { std::cout << std::setw(12) << PARAM.globalv.nlocal; } - - std::cout << std::endl; - - - - - std::cout << " ---------------------------------------------------------" << std::endl; - if(PARAM.inp.basis_type == "lcao") - { - std::cout << " Use Systematically Improvable Atomic bases" << std::endl; - } - else if(PARAM.inp.basis_type == "lcao_in_pw") - { - std::cout << " Expand Atomic bases into plane waves" << std::endl; - } - else if(PARAM.inp.basis_type == "pw") - { - std::cout << " Use plane wave basis" << std::endl; - } - std::cout << " ---------------------------------------------------------" << std::endl; - - - - //---------------------------------- - // second part - //---------------------------------- - - std::cout << " " << std::setw(8) << "ELEMENT"; - - if (orbinfo) - { - std::cout << std::setw(16) << "ORBITALS"; - std::cout << std::setw(12) << "NBASE"; - } - std::cout << std::setw(12) << "NATOM"; - - std::cout << std::setw(12) << "XC"; - std::cout << std::endl; - - - const std::string spectrum = "spdfghi"; - for(int it=0; itnx << " * " << pw_rho->ny << " * " << pw_rho->nz << std::endl; - std::cout << " UNIFORM GRID DIM(BIG): " << pw_big->nbx << " * " << pw_big->nby << " * " << pw_big->nbz - << std::endl; - if (PARAM.globalv.double_grid) - { - std::cout << " UNIFORM GRID (DENSE) : " << pw_rhod->nx << " * " << pw_rhod->ny << " * " << pw_rhod->nz - << std::endl; - } - - ofs << "\n\n"; - ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs << " | |" << std::endl; - ofs << " | #Setup Plane Waves of Charge/Potential# |" << std::endl; - ofs << " | Use the kinetic energy cutoff and the lattice vectors to generate |" << std::endl; - ofs << " | the dimensions of FFT grid, which is used to represent the charge |" << std::endl; - ofs << " | density or potential. If USPP is used, a double grid technique |" << std::endl; - ofs << " | is applied. |" << std::endl; - ofs << " | |" << std::endl; - ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - ofs << "\n"; - ofs << " SETUP PLANE WAVES FOR CHARGE/POTENTIAL" << std::endl; - - - double ecut = 4 * PARAM.inp.ecutwfc; - if (PARAM.inp.nx * PARAM.inp.ny * PARAM.inp.nz > 0) - { - ecut = pw_rho->gridecut_lat * pw_rho->tpiba2; - ofs << " FFT DIMENSIONS ARE FROM INPUT" << std::endl; - ofs << " KINETIC ENEGY CUTOFF IS DETERMINED FROM nx, ny, nz" << std::endl; - } - - ModuleBase::GlobalFunc::OUT(ofs, "Energy cutoff for charge/potential (Ry)", ecut); - - ModuleBase::GlobalFunc::OUT(ofs, "FFT grid for charge/potential", pw_rho->nx, pw_rho->ny, pw_rho->nz); - ModuleBase::GlobalFunc::OUT(ofs, "Number of FFT grids this proc.", pw_rho->nrxx); - ModuleBase::GlobalFunc::OUT(ofs, "Division for big FFT grid", pw_big->bx, pw_big->by, pw_big->bz); - ModuleBase::GlobalFunc::OUT(ofs, "FFT (big) grid for charge/potential", pw_big->nbx, pw_big->nby, pw_big->nbz); - ModuleBase::GlobalFunc::OUT(ofs, "Number of FFT (big) grids this proc.", pw_big->nbxx); - - ModuleBase::GlobalFunc::OUT(ofs, "Number of plane waves", pw_rho->npwtot); - ModuleBase::GlobalFunc::OUT(ofs, "Number of sticks on FFT x-y plane", pw_rho->nstot); - - ofs << "\n PARALLEL PW FOR CHARGE/POTENTIAL" << std::endl; - ofs << " " << std::setw(8) << "PROC" << std::setw(15) << "COLUMNS(POT)" << std::setw(15) << "PW" << std::endl; - - for (int i = 0; i < GlobalV::NPROC_IN_POOL; ++i) - { - ofs << " " << std::setw(8) << i + 1 << std::setw(15) << pw_rho->nst_per[i] << std::setw(15) - << pw_rho->npw_per[i] << std::endl; - } - ofs << " --------------- SUM -------------------" << std::endl; - ofs << " " << std::setw(8) << GlobalV::NPROC_IN_POOL << std::setw(15) << pw_rho->nstot << std::setw(15) - << pw_rho->npwtot << std::endl; - - ofs << std::endl; - ModuleBase::GlobalFunc::OUT(ofs, "Number of |g|", pw_rho->ngg); - ModuleBase::GlobalFunc::OUT(ofs, "Max |g|", pw_rho->gg_uniq[pw_rho->ngg - 1]); - ModuleBase::GlobalFunc::OUT(ofs, "Min |g|", pw_rho->gg_uniq[0]); - - if (PARAM.globalv.double_grid) - { - ofs << std::endl; - ofs << std::endl; - ofs << std::endl; - double ecut = PARAM.inp.ecutrho; - if (PARAM.inp.ndx * PARAM.inp.ndy * PARAM.inp.ndz > 0) - { - ecut = pw_rhod->gridecut_lat * pw_rhod->tpiba2; - ofs << "use input fft dimensions for the dense part of charge " - "density." - << std::endl; - ofs << "calculate energy cutoff from ndx, ndy, ndz:" << std::endl; - } - ModuleBase::GlobalFunc::OUT(ofs, "energy cutoff for dense charge/potential (unit:Ry)", ecut); - - ModuleBase::GlobalFunc::OUT(ofs, "fft grid for dense charge/potential", pw_rhod->nx, pw_rhod->ny, pw_rhod->nz); - - ModuleBase::GlobalFunc::OUT(ofs, "nrxx", pw_rhod->nrxx); - - ofs << "\n SETUP PLANE WAVES FOR DENSE CHARGE/POTENTIAL" << std::endl; - ModuleBase::GlobalFunc::OUT(ofs, "Number of plane waves", pw_rhod->npwtot); - ModuleBase::GlobalFunc::OUT(ofs, "Number of sticks", pw_rhod->nstot); - - ofs << "\n PARALLEL PW FOR dense CHARGE/POTENTIAL" << std::endl; - ofs << " " << std::setw(8) << "PROC" << std::setw(15) << "COLUMNS(POT)" << std::setw(15) << "PW" << std::endl; - - for (int i = 0; i < GlobalV::NPROC_IN_POOL; ++i) - { - ofs << " " << std::setw(8) << i + 1 << std::setw(15) << pw_rhod->nst_per[i] << std::setw(15) - << pw_rhod->npw_per[i] << std::endl; - } - ofs << " --------------- sum -------------------" << std::endl; - ofs << " " << std::setw(8) << GlobalV::NPROC_IN_POOL << std::setw(15) << pw_rhod->nstot << std::setw(15) - << pw_rhod->npwtot << std::endl; - - ModuleBase::GlobalFunc::OUT(ofs, "number of |g|", pw_rhod->ngg); - ModuleBase::GlobalFunc::OUT(ofs, "max |g|", pw_rhod->gg_uniq[pw_rhod->ngg - 1]); - ModuleBase::GlobalFunc::OUT(ofs, "min |g|", pw_rhod->gg_uniq[0]); - } -} - -void print_wfcfft(const Input_para& inp, ModulePW::PW_Basis_K& pw_wfc, std::ofstream& ofs) -{ - ofs << "\n\n"; - ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs << " | |" << std::endl; - ofs << " | #Setup Plane Waves of Wave Functions# |" << std::endl; - ofs << " | Use the kinetic energy cutoff and the lattice vectors to generate |" << std::endl; - ofs << " | the dimensions of FFT grid, which is used to represent the wave |" << std::endl; - ofs << " | functions of electrons. |" << std::endl; - ofs << " | |" << std::endl; - ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - ofs << "\n"; - ofs << " SETUP PLANE WAVES FOR WAVE FUNCTIONS" << std::endl; - - double ecut = inp.ecutwfc; - if (std::abs(ecut - pw_wfc.gk_ecut * pw_wfc.tpiba2) > 1e-6) - { - ecut = pw_wfc.gk_ecut * pw_wfc.tpiba2; - ofs << "Energy cutoff for wavefunc is incompatible with nx, ny, nz and " - "it will be reduced!" - << std::endl; - } - ModuleBase::GlobalFunc::OUT(ofs, "Energy cutoff for wavefunc (unit:Ry)", ecut); - ModuleBase::GlobalFunc::OUT(ofs, "FFT grid for wave functions", pw_wfc.nx, pw_wfc.ny, pw_wfc.nz); - ModuleBase::GlobalFunc::OUT(ofs, "Number of total plane waves", pw_wfc.npwtot); - ModuleBase::GlobalFunc::OUT(ofs, "Number of sticks on FFT x-y plane", pw_wfc.nstot); - - ofs << "\n PARALLEL PW FOR WAVE FUNCTIONS" << std::endl; - ofs << " " << std::setw(8) << "PROC" << std::setw(15) << "COLUMNS(POT)" << std::setw(15) << "PW" << std::endl; - - for (int i = 0; i < GlobalV::NPROC_IN_POOL; ++i) - { - ofs << " " << std::setw(8) << i + 1 << std::setw(15) << pw_wfc.nst_per[i] << std::setw(15) << pw_wfc.npw_per[i] - << std::endl; - } - - ofs << " --------------- sum -------------------" << std::endl; - ofs << " " << std::setw(8) << GlobalV::NPROC_IN_POOL << std::setw(15) << pw_wfc.nstot << std::setw(15) - << pw_wfc.npwtot << std::endl; - ModuleBase::GlobalFunc::DONE(ofs, "INIT PLANEWAVE"); -} - -void print_screen(const int& stress_step, const int& force_step, const int& istep) -{ - std::cout << " ======================================================================" << std::endl; - GlobalV::ofs_running << " ======================================================================" << std::endl; - - if(PARAM.inp.calculation=="scf") - { - std::cout << " SELF-CONSISTENT: " << std::endl; - GlobalV::ofs_running << " SELF-CONSISTENT" << std::endl; - } - else if(PARAM.inp.calculation=="nscf") - { - std::cout << " NONSELF-CONSISTENT: " << std::endl; - GlobalV::ofs_running << " NONSELF-CONSISTENT" << std::endl; - } - else if(PARAM.inp.calculation=="md") - { - std::cout << " STEP OF MOLECULAR DYNAMICS: " << unsigned(istep) << std::endl; - GlobalV::ofs_running << " STEP OF MOLECULAR DYNAMICS: " << unsigned(istep) << std::endl; - } - else - { - if(PARAM.inp.calculation=="relax") - { - std::cout << " STEP OF ION RELAXATION: " << unsigned(istep) << std::endl; - GlobalV::ofs_running << " STEP OF ION RELAXATION : " << unsigned(istep) << std::endl; - } - else if(PARAM.inp.calculation=="cell-relax") - { - std::cout << " RELAX CELL : " << unsigned(stress_step) << std::endl; - std::cout << " RELAX IONS : " << unsigned(force_step) << " (in total: " << unsigned(istep) << ")" << std::endl; - GlobalV::ofs_running << " RELAX CELL : " << unsigned(stress_step) << std::endl; - GlobalV::ofs_running << " RELAX IONS : " << unsigned(force_step) << " (in total: " << unsigned(istep) << ")" << std::endl; - } - } - - std::cout << " ======================================================================" << std::endl; - GlobalV::ofs_running << " ======================================================================" << std::endl; -} - -} // namespace ModuleIO diff --git a/source/module_io/print_info.h b/source/module_io/print_info.h deleted file mode 100644 index 567438bf63..0000000000 --- a/source/module_io/print_info.h +++ /dev/null @@ -1,30 +0,0 @@ -//========================================================== -// AUTHOR : mohan -// DATE : 2021-01-30 -//========================================================== -#ifndef PRINT_INFO -#define PRINT_INFO - -#include "source_base/timer.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/klist.h" -#include "source_cell/unitcell.h" -#include "module_parameter/input_parameter.h" - -namespace ModuleIO -{ - -// print out to screen about the readin parameters -void setup_parameters(UnitCell& ucell, K_Vectors& kv); -void print_time(time_t& time_start, time_t& time_finish); -void print_screen(const int& stress_step, const int& force_step, const int& istep); -//! Print charge density using FFT -void print_rhofft(ModulePW::PW_Basis* pw_rhod, - ModulePW::PW_Basis* pw_rho, - ModulePW::PW_Basis_Big* pw_big, - std::ofstream& ofs); -void print_wfcfft(const Input_para& inp, ModulePW::PW_Basis_K& pw_wfc, std::ofstream& ofs); - -} // namespace ModuleIO - -#endif diff --git a/source/module_io/read_cube.cpp b/source/module_io/read_cube.cpp deleted file mode 100644 index d38bf592bb..0000000000 --- a/source/module_io/read_cube.cpp +++ /dev/null @@ -1,194 +0,0 @@ -#include "module_io/cube_io.h" -#include -#include "source_pw/hamilt_pwdft/parallel_grid.h" -#include // use std::memcpy - -bool ModuleIO::read_vdata_palgrid( - const Parallel_Grid& pgrid, - const int my_rank, - std::ofstream& ofs_running, - const std::string& fn, - double* const data, - const int natom) -{ - ModuleBase::TITLE("ModuleIO", "read_vdata_palgrid"); - - // check if the file exists - std::ifstream ifs(fn.c_str()); - if (!ifs) - { - std::string tmp_warning_info = "!!! Couldn't find the file: " + fn; - ofs_running << tmp_warning_info << std::endl; - return false; - } - else - { - ofs_running << " Find the file " << fn << " , try to read it." << std::endl; - } - - // read the full grid data - const int& nx = pgrid.nx; - const int& ny = pgrid.ny; - const int& nz = pgrid.nz; - const int& nxyz = nx * ny * nz; - std::vector data_xyz_full(nxyz, 0.0); - if (my_rank == 0) - { - std::vector comment; - int natom = 0; - std::vector origin; - std::vector nvoxel; - int nx_read = 0; - int ny_read = 0; - int nz_read = 0; - std::vector dx(3); - std::vector dy(3); - std::vector dz(3); - std::vector> axis_vecs; - std::vector atom_type; - std::vector atom_charge; - std::vector> atom_pos; - std::vector data_read; - - // we've already checked the file existence, so we don't need the returned value here - ModuleIO::read_cube(fn, comment, natom, origin, nx_read, ny_read, nz_read, dx, dy, dz, atom_type, atom_charge, atom_pos, data_read); - - // if mismatch, trilinear interpolate - if (nx == nx_read && ny == ny_read && nz == nz_read) - { - std::memcpy(data_xyz_full.data(), data_read.data(), nxyz * sizeof(double)); - } - else - { - trilinear_interpolate(data_read.data(), nx_read, ny_read, nz_read, nx, ny, nz, data_xyz_full.data()); - } - } - - // distribute -#ifdef __MPI - pgrid.bcast(data_xyz_full.data(), data, my_rank); -#else - std::memcpy(data, data_xyz_full.data(), nxyz * sizeof(double)); -#endif - return true; -} - -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) -{ - ModuleBase::TITLE("ModuleIO", "trilinear_interpolate"); - - double** read_rho = new double*[nz_read]; - for (int iz = 0; iz < nz_read; iz++) - { - read_rho[iz] = new double[nx_read * ny_read]; - } - for (int ix = 0; ix < nx_read; ix++) - { - for (int iy = 0; iy < ny_read; iy++) - { - for (int iz = 0; iz < nz_read; iz++) - { - read_rho[iz][ix * ny_read + iy] = data_in[(ix * ny_read + iy) * nz_read + iz]; - } - } - } - - for (int ix = 0; ix < nx; ix++) - { - double fracx = 0.5 * (static_cast(nx_read) / nx * (1.0 + 2.0 * ix) - 1.0); - fracx = std::fmod(fracx, nx_read); - int lowx = static_cast(fracx); - double dx = fracx - lowx; - int highx = (lowx == nx_read - 1) ? 0 : lowx + 1; // the point nz_read is the same as 0 - for (int iy = 0; iy < ny; iy++) - { - double fracy = 0.5 * (static_cast(ny_read) / ny * (1.0 + 2.0 * iy) - 1.0); - fracy = std::fmod(fracy, ny_read); - int lowy = static_cast(fracy); - double dy = fracy - lowy; - int highy = (lowy == ny_read - 1) ? 0 : lowy + 1; - for (int iz = 0; iz < nz; iz++) - { - double fracz = 0.5 * (static_cast(nz_read) / nz * (1.0 + 2.0 * iz) - 1.0); - fracz = std::fmod(fracz, nz_read); - int lowz = static_cast(fracz); - double dz = fracz - lowz; - int highz = (lowz == nz_read - 1) ? 0 : lowz + 1; - - double result = read_rho[lowz][lowx * ny_read + lowy] * (1 - dx) * (1 - dy) * (1 - dz) - + read_rho[lowz][highx * ny_read + lowy] * dx * (1 - dy) * (1 - dz) - + read_rho[lowz][lowx * ny_read + highy] * (1 - dx) * dy * (1 - dz) - + read_rho[highz][lowx * ny_read + lowy] * (1 - dx) * (1 - dy) * dz - + read_rho[lowz][highx * ny_read + highy] * dx * dy * (1 - dz) - + read_rho[highz][highx * ny_read + lowy] * dx * (1 - dy) * dz - + read_rho[highz][lowx * ny_read + highy] * (1 - dx) * dy * dz - + read_rho[highz][highx * ny_read + highy] * dx * dy * dz; - - data_out[(ix * ny + iy) * nz + iz] = result; // x > y > z order, consistent with the cube file - } - } - } - - for (int iz = 0; iz < nz_read; iz++) - { - delete[] read_rho[iz]; - } - delete[] read_rho; -} - -bool ModuleIO::read_cube(const std::string& file, - std::vector& comment, - int& natom, - std::vector& origin, - int& nx, - int& ny, - int& nz, - std::vector& dx, - std::vector& dy, - std::vector& dz, - std::vector& atom_type, - std::vector& atom_charge, - std::vector>& atom_pos, - std::vector& data) -{ - std::ifstream ifs(file); - - if (!ifs) { return false; } - - comment.resize(2); - for (auto& c : comment) { std::getline(ifs, c); } - - ifs >> natom; - origin.resize(3); - for (auto& cp : origin) { ifs >> cp; } - - dx.resize(3); - dy.resize(3); - dz.resize(3); - ifs >> nx >> dx[0] >> dx[1] >> dx[2]; - ifs >> ny >> dy[0] >> dy[1] >> dy[2]; - ifs >> nz >> dz[0] >> dz[1] >> dz[2]; - - atom_type.resize(natom); - atom_charge.resize(natom); - atom_pos.resize(natom, std::vector(3)); - for (int i = 0;i < natom;++i) - { - ifs >> atom_type[i] >> atom_charge[i] >> atom_pos[i][0] >> atom_pos[i][1] >> atom_pos[i][2]; - } - - const int nxyz = nx * ny * nz; - data.resize(nxyz); - for (int i = 0;i < nxyz;++i) { ifs >> data[i]; } - - ifs.close(); - return true; -} diff --git a/source/module_io/read_exit_file.cpp b/source/module_io/read_exit_file.cpp deleted file mode 100644 index 0c7cd256c6..0000000000 --- a/source/module_io/read_exit_file.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "read_exit_file.h" - -#include -#include -#include - -#ifdef __MPI -#include -#endif - -namespace ModuleIO -{ - -int read_exit_file(const int& my_rank, const std::string& filename, std::ofstream& ofs_running) -{ - auto str2bool = [](std::string str) { - for (auto& i: str) - { - i = tolower(i); - } - if (str == "true" || str == "t" || str == "1") - { - return true; - } - else - { - return false; - } - }; - int stop = 0; - if (my_rank == 0) - { - std::ifstream ifs(filename.c_str(), std::ios::in); - - if (ifs) - { - ifs.clear(); - ifs.seekg(0); - ifs.rdstate(); - - while (ifs.good()) - { - std::string line; - std::getline(ifs, line); - if (line.empty()) - { - continue; - } - std::istringstream iss(line); - std::string word, result; - iss >> word; - if (iss.eof()) - { - continue; - } - else - { - iss >> result; - } - - if (word == "stop_ion" && str2bool(result) && stop < 1) - { - stop = 1; - } - else if (word == "stop_elec" && str2bool(result) && stop < 2) - { - stop = 2; - } - } - } - } - -#ifdef __MPI - MPI_Bcast(&stop, 1, MPI_INT, 0, MPI_COMM_WORLD); -#endif - - if (stop == 1) - { - std::cout << "\n\n--------------------------------------------------------------------" << std::endl; - std::cout << "--------------------------------------------------------------------" << std::endl; - std::cout << " Read in stop_ion = true from " << filename << std::endl; - std::cout << " The current execution stops at the ionic step " << std::endl; - std::cout << "--------------------------------------------------------------------" << std::endl; - std::cout << "--------------------------------------------------------------------\n" << std::endl; - ofs_running << "\n\n--------------------------------------------------------------------" << std::endl; - ofs_running << "--------------------------------------------------------------------" << std::endl; - ofs_running << " Read in stop_ion = true from " << filename << std::endl; - ofs_running << " The current execution stops at the ionic step " << std::endl; - ofs_running << "--------------------------------------------------------------------" << std::endl; - ofs_running << "--------------------------------------------------------------------\n" << std::endl; - } - else if (stop == 2) - { - std::cout << "\n\n--------------------------------------------------------------------" << std::endl; - std::cout << "--------------------------------------------------------------------" << std::endl; - std::cout << " Read in stop_elec = true from " << filename << std::endl; - std::cout << " The current execution stops at the electronic step " << std::endl; - std::cout << "--------------------------------------------------------------------" << std::endl; - std::cout << "--------------------------------------------------------------------\n" << std::endl; - ofs_running << "\n\n--------------------------------------------------------------------" << std::endl; - ofs_running << "--------------------------------------------------------------------" << std::endl; - ofs_running << " Read in stop_elec = true from " << filename << std::endl; - ofs_running << " The current execution stops at the electronic step " << std::endl; - ofs_running << "--------------------------------------------------------------------" << std::endl; - ofs_running << "--------------------------------------------------------------------\n" << std::endl; - } - - return stop; -} - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/read_exit_file.h b/source/module_io/read_exit_file.h deleted file mode 100644 index 2280df9c8e..0000000000 --- a/source/module_io/read_exit_file.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef READ_EXIT_FILE_H -#define READ_EXIT_FILE_H - -#include - -namespace ModuleIO -{ -/** - * @brief read file to determine whether to stop the current execution - * - * @param my_rank the rank of the current process - * @param filename the name of the file to read - * @param ofs_running the output stream - * - * @return 0 if the file is not found or does not contain correct keywords, do not stop the current execution - * @return 1 if the file is found and contains "stop_ion", the current execution stops at the next ionic step - * @return 2 if the file is found and contains "stop_elec", the current execution stops at the next electronic step - */ -int read_exit_file(const int& my_rank, const std::string& filename, std::ofstream& ofs_running); -} // namespace ModuleIO - -#endif \ No newline at end of file diff --git a/source/module_io/read_input.cpp b/source/module_io/read_input.cpp deleted file mode 100644 index 1bd8520519..0000000000 --- a/source/module_io/read_input.cpp +++ /dev/null @@ -1,532 +0,0 @@ -#include "read_input.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "source_base/formatter.h" -#include "source_base/global_file.h" -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "source_base/tool_title.h" -#include "source_base/module_device/device.h" - -namespace ModuleIO -{ - -std::string longstring(const std::vector& words) -{ - return FmtCore::join(" ", words); -} - -bool assume_as_boolean(const std::string& val) -{ - const std::string val_ = FmtCore::lower(val); - - const std::array t_ = {"true", "1", "t", "yes", "y", "on", ".true."}; - const std::array f_ = {"false", "0", "f", "no", "n", "off", ".false."}; - // This will work because std::array::size() is a constexpr function - // Ouch it is of C++17 standard... - // static_assert(t_.size() == f_.size(), "t_ and f_ must have the same lengths"); -#ifdef __DEBUG // C++11 can do this - assert(t_.size() == f_.size()); -#endif - - if (std::find(t_.begin(), t_.end(), val_) != t_.end()) - { - return true; - } - else if (std::find(f_.begin(), f_.end(), val_) != f_.end()) - { - return false; - } - else - { - std::string warnmsg = "Bad boolean parameter "; - warnmsg.append(val); - warnmsg.append(", please check the input parameters in file INPUT"); - ModuleBase::WARNING_QUIT("Input", warnmsg); - } -} - -std::string to_dir(const std::string& str) -{ - std::string str_dir = str; - if (str_dir.empty()) - { - return "./"; - } - else if (str_dir.back() != '/') - { - str_dir += "/"; - } - - return str_dir; -} - -void read_information(std::ifstream& ifs, std::vector& output, const std::string& delimiters) -{ - std::string line; - getline(ifs, line); - - std::istringstream iss(line); - std::string word; - while (iss >> word) - { - if (delimiters.find(word[0]) != std::string::npos) - { - break; - } - output.push_back(word); - } -} - -bool ReadInput::check_mode = false; - -ReadInput::ReadInput(const int& rank) -{ - this->rank = rank; - - // add items - this->item_system(); - this->item_elec_stru(); - this->item_relax(); - this->item_md(); - this->item_ofdft(); - this->item_sdft(); - this->item_deepks(); - this->item_rt_tddft(); - this->item_lr_tddft(); - this->item_output(); - this->item_postprocess(); - this->item_model(); - this->item_exx(); - this->item_dftu(); - this->item_others(); -} - -void ReadInput::read_parameters(Parameter& param, const std::string& filename_in) -{ - ModuleBase::TITLE("ReadInput", "read_parameters"); - // 1. only rank 0 read the input file - if (this->rank == 0) - { - // We can also easily add other input file formats here - this->read_txt_input(param, filename_in); - } - - // 2. check the number of atom types from STRU file - // set the global directories - this->set_global_dir(param.inp, param.sys); - if (this->check_ntype_flag && this->rank == 0) - { - check_ntype(param.globalv.global_in_stru, param.input.ntype); - } - - // 3. broadcast input parameters - // It must be after the check_ntype, because some parameters need to be filled due to ntype - for (auto& bcastfunc: this->bcastfuncs) - { - bcastfunc(param); - } - - // 4. set the globalv parameters, some parameters in different processes are different. e.g. rank, log_file - this->set_globalv(param.inp, param.sys); - - // 5. check the value of the parameters - // It must be after the check_ntype, because some parameters need to be checked according to ntype - // It must be after the set_globalv, because some parameters need to be checked according to param.sys - if (this->rank == 0) - { - for (auto& input_item: this->input_lists) - { - Input_Item* checkvalue_item = &(input_item.second); - if (checkvalue_item->check_value != nullptr) - { - checkvalue_item->check_value(*checkvalue_item, param); - } - } - } - - // 6. check and reset kpar. - // It must be after bcastfunc, and kpar and bndpar are synchronized - // It must be before wirte_txt_input, because kpar is used in write_txt_input - if (param.inp.device == "gpu" && param.inp.basis_type == "pw") - { - param.input.kpar = base_device::information::get_device_kpar(param.inp.kpar, param.inp.bndpar); - } - - - - - if (this->check_mode) - { - std::cout << "----------------------------------------------------------" << std::endl; - std::cout << " INPUT parameters have been successfully checked!" << std::endl; - std::cout << "----------------------------------------------------------" << std::endl; - exit(0); - return; - } -} - -void ReadInput::create_directory(const Parameter& param) -{ - ModuleBase::TITLE("ReadInput", "create_directory"); - - // mohan move forward 2011-02-26 - //---------------------------------------------------------- - // OTHRE CLASS MEMBER FUNCTION : - // NAME : Run::make_dir( dir name : OUT.suffix) - //---------------------------------------------------------- - bool out_dir = false; - if (!param.input.out_app_flag - && (param.input.out_mat_hs2 || param.input.out_mat_r || param.input.out_mat_t || param.input.out_mat_dh || param.input.out_mat_ds)) - { - out_dir = true; - } - // NOTE: "make_dir_out" must be called by all processes!!! - // Maybe it is not good, because only rank 0 can create the directory. - ModuleBase::Global_File::make_dir_out(param.input.suffix, - param.input.calculation, - out_dir, - param.input.out_wfc_lcao, - this->rank, - param.input.mdp.md_restart, - param.input.out_alllog); // xiaohui add 2013-09-01 - - const std::string ss = "test -d " + PARAM.inp.read_file_dir; - if (system(ss.c_str())) - { - ModuleBase::WARNING_QUIT("ReadInput", "please set right files directory for reading in."); - } - - return; -} - -void ReadInput::write_parameters(const Parameter& param, const std::string& filename_out) -{ - if (this->rank == 0) - { - this->write_txt_input(param, filename_out); - } -} - -void ReadInput::read_txt_input(Parameter& param, const std::string& filename) -{ - ModuleBase::TITLE("ReadInput", "read_txt_input"); - - std::ifstream ifs(filename.c_str(), std::ios::in); - - if (!ifs) - { - std::cout << " Can't find the INPUT file." << std::endl; - ModuleBase::WARNING_QUIT("Input::Init", "Error during readin parameters.", 1); - } - - ifs.clear(); - ifs.seekg(0); - - std::string word; - int ierr = 0; - - // ifs >> std::setiosflags(ios::uppercase); - ifs.rdstate(); - while (ifs.good()) - { - ifs >> word; - ifs.ignore(150, '\n'); - if (word == "INPUT_PARAMETERS") - { - ierr = 1; - break; - } - ifs.rdstate(); - } - - if (ierr == 0) - { - std::cout << " Error parameter list. " - << " The parameter list always starts with key word " - "'INPUT_PARAMETERS'. " - << std::endl; - ModuleBase::WARNING_QUIT("Input", - "Bad parameter, please check the input parameters in file INPUT", 1); - } - - ifs.rdstate(); - // the `word1` is moved here and is renamed to improve the code-readability - std::string word_; // temporary variable to store the keyword read-in - while (ifs.good()) - { - ifs >> word_; - if (ifs.eof()) { break; } - word = FmtCore::lower(word_); // the lowercase of the keyword - auto it = std::find_if(input_lists.begin(), input_lists.end(), - [&word](const std::pair& item) { return item.first == word; }); - if (it != this->input_lists.end()) // find the keyword - { - Input_Item* p_item = &(it->second); - this->readvalue_items.push_back(p_item); - if(p_item->is_read()) - { - std::string warningstr = "The parameter " + p_item->label + " has been read twice."; - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - // qianrui delete '/' 2024-07-10, because path has '/' head. - read_information(ifs, p_item->str_values, "#!"); - } - else // otherwise, it should be a comment or an unrecognized parameter - { - if (word[0] != '#' && word[0] != '/' && word[0] != '!') // if not recognized - { - std::cout << " THE PARAMETER NAME '" << word << "' IS INCORRECT!" << std::endl; - ModuleBase::WARNING_QUIT("Input", - "Bad parameter, please check the input parameters in file INPUT", 1); - } - // otherwise, it is a comment. However, ... - // but it is not always to be shorter than 150 characters - // we can use ignore to skip the rest of the line - ifs.ignore(std::numeric_limits::max(), '\n'); - } - - ifs.rdstate(); - if (ifs.eof()) - { - break; - } - else if (ifs.bad()) - { - std::cout << " Bad input parameters. " << std::endl; - exit(1); - } - else if (ifs.fail()) - { - std::cout << " word = " << word << std::endl; - std::cout << " Fail to read parameters. " << std::endl; - ifs.clear(); - exit(1); - } - } - - // 1) read the value of the parameters - for (auto& readvalue_item: this->readvalue_items) - { - readvalue_item->read_value(*readvalue_item, param); - } - - // 2) reset this value when some conditions are met - // e.g. if (calulation_type == "nscf") then set "init_chg" to "file". - for (auto& input_item: this->input_lists) - { - Input_Item* resetvalue_item = &(input_item.second); - if (resetvalue_item->reset_value != nullptr) { - resetvalue_item->reset_value(*resetvalue_item, param); - } - } -} - -void ReadInput::write_txt_input(const Parameter& param, const std::string& filename) -{ - ModuleBase::TITLE("ReadInput", "write_txt_input"); - std::ofstream ofs(filename.c_str(), std::ios::out); - ofs << "INPUT_PARAMETERS" << std::endl; - ofs << std::setiosflags(std::ios::left); - - ofs << "#Parameters (1.System)" << std::endl; - for (auto& item: this->input_lists) - { - Input_Item* p_item = &(item.second); - if (p_item->get_final_value == nullptr) { - continue; -} - p_item->get_final_value(*p_item, param); - if (p_item->label == "ks_solver") - { - ofs << "\n#Parameters (2.Electronic structure)" << std::endl; - } - else if (p_item->label == "nb2d") - { - ofs << "\n#Parameters (3.LCAO)" << std::endl; - } - else if (p_item->label == "relax_method") - { - ofs << "\n#Parameters (4.Relaxation)" << std::endl; - } - else if (p_item->label == "md_type") - { - ofs << "\n#Parameters (5.Molecular dynamics)" << std::endl; - } - else if (p_item->label == "of_kinetic") - { - ofs << "\n#Parameters (6.orbital free density functional theory)" << std::endl; - } - else if (p_item->label == "method_sto") - { - ofs << "\n#Parameters (7.Stochastic DFT)" << std::endl; - } - else if (p_item->label == "deepks_out_labels") - { - ofs << "\n#Parameters (8.DeepKS)" << std::endl; - } - else if (p_item->label == "td_dt") - { - ofs << "\n#Parameters (9.rt-tddft)" << std::endl; - } - else if (p_item->label == "lr_nstates") - { - ofs << "\n#Parameters (10.lr-tddft)" << std::endl; - } - else if (p_item->label == "out_stru") - { - ofs << "\n#Parameters (11.Output)" << std::endl; - } - else if (p_item->label == "dos_emin_ev") - { - ofs << "\n#Parameters (12.Postprocess)" << std::endl; - } - else if (p_item->label == "efield_flag") - { - ofs << "\n#Parameters (13.Model)" << std::endl; - } - else if (p_item->label == "vdw_method") - { - ofs << "\n#Parameters (14.vdW Correction)" << std::endl; - } - else if (p_item->label == "exx_fock_alpha") - { - ofs << "\n#Parameters (15.exx)" << std::endl; - } - else if (p_item->label == "dft_plus_u") - { - ofs << "\n#Parameters (16.dft+u)" << std::endl; - } - else if (p_item->label == "sc_mag_switch") - { - ofs << "\n#Parameters (17.non-collinear spin-constrained DFT)" << std::endl; - } - else if (p_item->label == "qo_switch") - { - ofs << "\n#Parameters (18.Quasiatomic Orbital analysis)" << std::endl; - } - else if (p_item->label == "pexsi_npole") - { - ofs << "\n#Parameters (19.PEXSI)" << std::endl; - } - else if (p_item->label == "out_alllog") - { - ofs << "\n#Parameters (20.Test)" << std::endl; - } - - ModuleBase::GlobalFunc::OUTP(ofs, p_item->label, p_item->final_value.str(), p_item->annotation); - } -} - -void ReadInput::check_ntype(const std::string& fn, int& param_ntype) -{ - std::ifstream ifa(fn.c_str(), std::ios::in); - if (!ifa) - { - GlobalV::ofs_warning << fn; - ModuleBase::WARNING_QUIT("ReadInput::check_ntype", "Can not find the file: " + fn); - } - - int ntype_stru = 0; - std::string temp; - if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifa, "ATOMIC_SPECIES")) - { - while (true) - { - ModuleBase::GlobalFunc::READ_VALUE(ifa, temp); - if (temp == "LATTICE_CONSTANT" || temp == "NUMERICAL_ORBITAL" || temp == "NUMERICAL_DESCRIPTOR" - || temp == "PAW_FILES" || ifa.eof()) - { - break; - } - else if (isalpha(temp[0])) - { - ntype_stru += 1; - } - } - } - - if (param_ntype == 0) - { - param_ntype = ntype_stru; - GlobalV::ofs_running << " 'ntype' is no longer required in INPUT, and " - "it will be ignored. " - << std::endl; - } - else if (param_ntype != ntype_stru) - { - ModuleBase::WARNING_QUIT("ReadInput", - "The ntype in INPUT is not equal to the ntype " - "counted in STRU, check it."); - } - if (param_ntype <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "ntype should be greater than 0."); - } - else - { - GlobalV::ofs_running << " 'ntype' is automatically set to " << param_ntype << std::endl; - } -} - -int ReadInput::current_md_step(const std::string& file_dir) -{ - std::stringstream ssc; - ssc << file_dir << "Restart_md.dat"; - std::ifstream file(ssc.str().c_str()); - - if (!file) - { - ModuleBase::WARNING_QUIT("current_md_step", "no Restart_md.dat"); - } - - int md_step; - file >> md_step; - file.close(); - - return md_step; -} - -void ReadInput::add_item(const Input_Item& item) -{ - // only rank 0 read the input file - // So only rank 0 add the item to the input list - if (this->rank == 0) - { - this->input_lists.push_back(make_pair(item.label, item)); - } -} - -std::string nofound_str(std::vector init_chgs, const std::string& str) -{ - std::string warningstr = "The parameter "; - warningstr.append(str); - warningstr.append(" must be "); - for(int i = 0; i < init_chgs.size(); i++) - { - warningstr.append("'"); - warningstr.append(init_chgs[i]); - warningstr.append("'"); - if(i < init_chgs.size() - 2) - { - warningstr.append(", "); - } - else if(i == init_chgs.size() - 2) - { - warningstr.append(" or "); - } - } - warningstr.append("!"); - - return warningstr; -} - -} // namespace ModuleIO diff --git a/source/module_io/read_input.h b/source/module_io/read_input.h deleted file mode 100644 index 09f397e474..0000000000 --- a/source/module_io/read_input.h +++ /dev/null @@ -1,155 +0,0 @@ -#ifndef READ_INPUT_H -#define READ_INPUT_H - -#include "input_item.h" -#include "module_parameter/parameter.h" - -#include - -namespace ModuleIO -{ -class ReadInput -{ - public: - ReadInput(const int& rank); - ~ReadInput(){}; - /** - * @brief clear all input items - */ - void clear() - { - for (auto& item: input_lists) - { - item.second.final_value.str(""); - item.second.str_values.clear(); - } - readvalue_items.clear(); - } - /** - * @brief read in parameters from input file - * - * @param param parameters of ABACUS - * @param filename_in read INPUT file name - */ - void read_parameters(Parameter& param, const std::string& filename_in); - - /** - * @brief Create a directory for output files - * - * @param param parameters of ABACUS - */ - void create_directory(const Parameter& param); - - /** - * @brief write out parameters to output file - * - * @param param parameters of ABACUS - * @param filename_out write output file name - */ - void write_parameters(const Parameter& param, const std::string& filename_out); - static bool check_mode; - bool check_ntype_flag = true; ///< check ntype from STRU file - - private: - /** - * @brief read INPUT file of txt format - * - * @param param parameters of ABACUS - * @param filename INPUT - */ - void read_txt_input(Parameter& param, const std::string& filename); - /** - * @brief write INPUT file of txt format - * - * @param param parameters of ABACUS - * @param filename output file name - */ - void write_txt_input(const Parameter& param, const std::string& filename); - /** - * @brief determine the md step in restart case - * - * @param file_dir directory of Restart_md.dat - * @return md step - */ - int current_md_step(const std::string& file_dir); - /** - * @brief count_nype from STRU file - * - */ - void check_ntype(const std::string& fn, int& param_ntype); - /** - * @brief add item to input list - * - * @param item input_item - */ - void add_item(const Input_Item& item); - /// @brief set System_para according to input parameters - /// INPUT and STRU need to refer to each other in ABACUS, - /// so it is necessary to obtain the file paths related to all inputs - void set_global_dir(const Input_para& inp, System_para& sys); - // set System_para according to input parameters - void set_globalv(const Input_para& inp, System_para& sys); - // system items - void item_system(); - // items for electronic structure - void item_elec_stru(); - // items for lcao - void item_lcao(); - // items for relax - void item_relax(); - // items for md - void item_md(); - // items for ofdft - void item_ofdft(); - // items for sdft - void item_sdft(); - // items for deepks - void item_deepks(); - // items for real time tddft - void item_rt_tddft(); - // items for linear response tddft - void item_lr_tddft(); - // items for output - void item_output(); - // items for postprocess - void item_postprocess(); - // items for some models - void item_model(); - // items for exx - void item_exx(); - // items for dft+u - void item_dftu(); - // items for other - void item_others(); - - private: - int rank = 0; ///< rank of MPI - - // All input items - // std::map input_lists; - // use vector instead of map to keep the order of input items - std::vector> input_lists; - - // read value if INPUT file has this item - // This function will be done only when INPUT file has them. - std::vector readvalue_items; - //----------------------------------------------------------------- - - // bcast all values function - // if no MPI, this function will resize the vector - // This function must be done, no matter INPUT file has them or not. - std::vector> bcastfuncs; -}; - -// convert string vector to a long string -std::string longstring(const std::vector& str_values); -// convert string to bool -bool assume_as_boolean(const std::string& val); -// convert to directory format -std::string to_dir(const std::string& str); -// return a warning string if the string is not found in the vector -std::string nofound_str(std::vector init_chgs, const std::string& str); - -} // namespace ModuleIO - -#endif \ No newline at end of file diff --git a/source/module_io/read_input_item_deepks.cpp b/source/module_io/read_input_item_deepks.cpp deleted file mode 100644 index 47198eac98..0000000000 --- a/source/module_io/read_input_item_deepks.cpp +++ /dev/null @@ -1,202 +0,0 @@ -#include "source_base/constants.h" -#include "source_base/tool_quit.h" -#include "module_parameter/parameter.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -void ReadInput::item_deepks() -{ - { - Input_Item item("deepks_out_labels"); - item.annotation = ">0 compute descriptor for deepks. 1 used during training, 2 used for label production"; - read_sync_int(input.deepks_out_labels); - this->add_item(item); - } - { - Input_Item item("deepks_out_freq_elec"); - item.annotation = ">0 frequency of electronic iteration to output descriptors and labels for deepks."; - read_sync_int(input.deepks_out_freq_elec); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.deepks_out_freq_elec < 0) - { - para.input.deepks_out_freq_elec = 0; - } - }; - this->add_item(item); - } - { - Input_Item item("deepks_scf"); - item.annotation = ">0 add V_delta to Hamiltonian"; - read_sync_bool(input.deepks_scf); - item.check_value = [](const Input_Item& item, const Parameter& para) { -#ifndef __MLALGO - if (para.input.deepks_scf || para.input.deepks_out_labels || para.input.deepks_bandgap - || para.input.deepks_v_delta) - { - ModuleBase::WARNING_QUIT("Input_conv", "please compile with DeePKS"); - } -#endif - // if (!para.input.deepks_scf && para.input.deepks_out_labels == 1) - // { - // ModuleBase::WARNING_QUIT("Input_conv", "deepks_out_labels = 1 requires deepks_scf = 1"); - // } - }; - this->add_item(item); - } - { - Input_Item item("deepks_equiv"); - item.annotation = "whether to use equivariant version of DeePKS"; - read_sync_bool(input.deepks_equiv); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.deepks_equiv && para.input.deepks_bandgap) - { - ModuleBase::WARNING_QUIT("ReadInput", "equivariant version of DeePKS is not implemented yet"); - } - }; - this->add_item(item); - } - { - Input_Item item("deepks_bandgap"); - item.annotation = ">0 for bandgap label"; - read_sync_int(input.deepks_bandgap); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.deepks_bandgap < 0 || para.input.deepks_bandgap > 3) - { - ModuleBase::WARNING_QUIT("ReadInput", "deepks_bandgap must be integer in [0, 3]"); - } - }; - this->add_item(item); - } - { - Input_Item item("deepks_band_range"); - item.annotation = "(int, int) range of bands for bandgap label"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.deepks_band_range[0] = std::stod(item.str_values[0]); - para.input.deepks_band_range[1] = std::stod(item.str_values[1]); - }; - sync_intvec(input.deepks_band_range, 2, 0); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.deepks_bandgap == 1) - { - if (para.input.deepks_band_range[0] >= para.input.deepks_band_range[1]) - { - ModuleBase::WARNING_QUIT("ReadInput", "deepks_band_range[0] must be smaller than deepks_band_range[1] for deepks_bandgap = 1."); - } - } - else if (para.input.deepks_bandgap == 2) - { - if (para.input.deepks_band_range[0] > para.input.deepks_band_range[1]) - { - ModuleBase::WARNING_QUIT("ReadInput", "deepks_band_range[0] must be no more than deepks_band_range[1] for deepks_bandgap = 2."); - } - } - else - { - if (para.input.deepks_band_range[0] != -1 || para.input.deepks_band_range[1] != 0) - { - ModuleBase::WARNING("ReadInput", "deepks_band_range is used for deepks_bandgap = 1/2. Ignore its setting for other cases."); - } - } - }; - this->add_item(item); - } - { - Input_Item item("deepks_v_delta"); - item.annotation = "!=0 for v_delta/v_delta_R label. when output, 1 for vdpre, 2 for phialpha and grad_evdm (can save memory )" - " -1 for vdrpre, -2 for phialpha_r and gevdm (can save memory)"; - read_sync_int(input.deepks_v_delta); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.deepks_v_delta < -2 || para.input.deepks_v_delta > 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "deepks_v_delta must be integer in [-2, 2]"); - } - }; - this->add_item(item); - } - { - Input_Item item("deepks_out_unittest"); - item.annotation = "if set 1, prints intermediate quantities that shall " - "be used for making unit test"; - read_sync_bool(input.deepks_out_unittest); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.deepks_out_unittest) - { - para.input.deepks_out_labels = 1; - para.input.deepks_scf = true; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.deepks_out_unittest) - { - if (para.input.cal_force != 1 || para.input.cal_stress != 1) - { - ModuleBase::WARNING_QUIT("ReadInput", - "force and stress are required in generating deepks unittest"); - } - } - }; - this->add_item(item); - } - { - Input_Item item("deepks_model"); - item.annotation = "file dir of traced pytorch model: 'model.ptg"; - read_sync_string(input.deepks_model); - this->add_item(item); - } - { - Input_Item item("bessel_descriptor_lmax"); - item.annotation = "lmax used in generating spherical bessel functions"; - read_sync_int(input.bessel_descriptor_lmax); - this->add_item(item); - } - { - Input_Item item("bessel_descriptor_ecut"); - item.annotation = "energy cutoff for spherical bessel functions(Ry)"; - read_sync_string(input.bessel_descriptor_ecut); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.bessel_descriptor_ecut == "default") - { - para.input.bessel_descriptor_ecut = std::to_string(para.input.ecutwfc); - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (std::stod(para.input.bessel_descriptor_ecut) < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "bessel_descriptor_ecut must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("bessel_descriptor_tolerence"); - item.annotation = "tolerence for spherical bessel root"; - read_sync_double(input.bessel_descriptor_tolerence); - this->add_item(item); - } - { - Input_Item item("bessel_descriptor_rcut"); - item.annotation = "radial cutoff for spherical bessel functions(a.u.)"; - read_sync_double(input.bessel_descriptor_rcut); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.bessel_descriptor_rcut < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "bessel_descriptor_rcut must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("bessel_descriptor_smooth"); - item.annotation = "spherical bessel smooth or not"; - read_sync_bool(input.bessel_descriptor_smooth); - this->add_item(item); - } - { - Input_Item item("bessel_descriptor_sigma"); - item.annotation = "sphereical bessel smearing_sigma"; - read_sync_double(input.bessel_descriptor_sigma); - this->add_item(item); - } -} -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_elec_stru.cpp b/source/module_io/read_input_item_elec_stru.cpp deleted file mode 100644 index 8daabfdc0e..0000000000 --- a/source/module_io/read_input_item_elec_stru.cpp +++ /dev/null @@ -1,897 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" - -namespace ModuleIO -{ -void ReadInput::item_elec_stru() -{ - // Electronic Structure - { - Input_Item item("ks_solver"); - item.annotation = "cg; dav; lapack; genelpa; elpa; scalapack_gvx; cusolver"; - read_sync_string(input.ks_solver); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.ks_solver == "default") - { - if (para.input.basis_type == "pw") - { - para.input.ks_solver = "cg"; - ModuleBase::GlobalFunc::AUTO_SET("ks_solver", "cg"); - } - else if (para.input.basis_type == "lcao") - { - if (para.input.device == "gpu") - { - para.input.ks_solver = "cusolver"; - ModuleBase::GlobalFunc::AUTO_SET("ks_solver", "cusolver"); - } - else - { -#ifdef __ELPA - para.input.ks_solver = "genelpa"; - ModuleBase::GlobalFunc::AUTO_SET("ks_solver", "genelpa"); -#else -#ifdef __MPI - para.input.ks_solver = "scalapack_gvx"; - ModuleBase::GlobalFunc::AUTO_SET("ks_solver", "scalapack_gvx"); -#else - para.input.ks_solver = "lapack"; - ModuleBase::GlobalFunc::AUTO_SET("ks_solver", "lapack"); -#endif -#endif - } - } - } - if (para.input.towannier90) - { - if (para.input.basis_type == "lcao_in_pw") - { -#ifdef __ELPA - para.input.ks_solver = "genelpa"; -#else -#ifdef __MPI - para.input.ks_solver = "scalapack_gvx"; -#else - para.input.ks_solver = "lapack"; -#endif -#endif - } - }; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::string& ks_solver = para.input.ks_solver; - const std::vector pw_solvers = {"cg", "dav", "bpcg", "dav_subspace"}; - const std::vector lcao_solvers = { - "genelpa", - "elpa", - "lapack", - "scalapack_gvx", - "cusolver", - "cusolvermp", - "pexsi", - "cg_in_lcao", - }; - - if (para.input.basis_type == "pw") - { - if (std::find(pw_solvers.begin(), pw_solvers.end(), ks_solver) == pw_solvers.end()) - { - const std::string warningstr = "For PW basis: " + nofound_str(pw_solvers, "ks_solver"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - } - else if (para.input.basis_type == "lcao") - { - if (std::find(lcao_solvers.begin(), lcao_solvers.end(), ks_solver) == lcao_solvers.end()) - { - const std::string warningstr = "For LCAO basis: " + nofound_str(lcao_solvers, "ks_solver"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - if (ks_solver == "cg_in_lcao") - { - GlobalV::ofs_warning << "cg_in_lcao is under testing" << std::endl; - } - else if (ks_solver == "genelpa") - { -#ifndef __ELPA - ModuleBase::WARNING_QUIT("Input", - "Can not use genelpa if abacus is not compiled with " - "ELPA. Please change " - "ks_solver to scalapack_gvx."); -#endif - } - else if (ks_solver == "elpa") - { -#ifndef __ELPA - ModuleBase::WARNING_QUIT("Input", - "Can not use elpa if abacus is not compiled with " - "ELPA. Please change " - "ks_solver to scalapack_gvx."); -#endif - } - - else if (ks_solver == "scalapack_gvx") - { -#ifdef __MPI - GlobalV::ofs_warning << "scalapack_gvx is under testing" << std::endl; -#else - ModuleBase::WARNING_QUIT("ReadInput", "scalapack_gvx can not be used for series version."); -#endif - } - else if (ks_solver == "cusolver" || ks_solver == "cusolvermp") - { - std::string warningstr; -#ifndef __MPI - ModuleBase::WARNING_QUIT("ReadInput", "Cusolver can not be used for series version."); -#endif -#ifndef __CUDA - warningstr = "ks_solver is set to " + ks_solver + " but ABACUS is built with CPU only!\n" - + " Please rebuild ABACUS with GPU support or change the ks_solver."; - ModuleBase::WARNING_QUIT("ReadInput", warningstr); -#endif - if( ks_solver == "cusolvermp") - { -#ifndef __CUSOLVERMP - warningstr = "ks_solver is set to cusolvermp, but ABACUS is not built with cusolvermp support\n" - " Please rebuild ABACUS with cusolvermp support or change the ks_solver."; - ModuleBase::WARNING_QUIT("ReadInput", warningstr); -#endif - } - } - else if (ks_solver == "pexsi") - { -#ifdef __PEXSI - GlobalV::ofs_warning << " It's ok to use pexsi." << std::endl; -#else - ModuleBase::WARNING_QUIT("ReadInput", - "Can not use PEXSI if abacus is not compiled with " - "PEXSI. Please change " - "ks_solver to scalapack_gvx."); -#endif - } - } - else if (para.input.basis_type == "lcao_in_pw") - { - if (ks_solver != "lapack") - { - ModuleBase::WARNING_QUIT("ReadInput", "LCAO in plane wave can only done with lapack."); - } - } - }; - this->add_item(item); - } - { - Input_Item item("basis_type"); - item.annotation = "PW; LCAO in pw; LCAO"; - read_sync_string(input.basis_type); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.towannier90) - { - if (para.input.basis_type == "lcao_in_pw") - { - para.input.basis_type = "lcao"; - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::vector basis_types = {"pw", "lcao_in_pw", "lcao"}; - if (std::find(basis_types.begin(), basis_types.end(), para.input.basis_type) == basis_types.end()) - { - const std::string warningstr = nofound_str(basis_types, "basis_type"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - }; - this->add_item(item); - } - { - Input_Item item("nbands"); - item.annotation = "number of bands"; - read_sync_int(input.nbands); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nbands < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nbands should be greater than 0."); - } - }; - this->add_item(item); - } - { - Input_Item item("nelec"); - item.annotation = "input number of electrons"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nelec < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nelec should be greater than 0."); - } - if (para.input.nelec > 0 && para.input.nbands > 0 && para.input.nelec > 2 * para.input.nbands) - { - ModuleBase::WARNING_QUIT("ReadInput", "nelec > 2*nbnd , bands not enough!"); - } - }; - read_sync_double(input.nelec); - this->add_item(item); - } - { - Input_Item item("nelec_delta"); - item.annotation = "change in the number of total electrons"; - read_sync_double(input.nelec_delta); - this->add_item(item); - } - { - Input_Item item("nupdown"); - item.annotation = "the difference number of electrons between spin-up " - "and spin-down"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.nupdown = doublevalue; - para.sys.two_fermi = true; - }; - item.reset_value = [](const Input_Item&, Parameter& para) { - if (para.input.nspin == 1) - { - para.sys.two_fermi = false; - } - }; - item.check_value = [](const Input_Item&, const Parameter& para) { - if (para.input.nspin == 1 && para.input.nupdown != 0.0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nupdown mustn't have a non-zero value for spin-unpolarized calculations."); - } - }; - sync_double(input.nupdown); - add_bool_bcast(sys.two_fermi); - this->add_item(item); - } - { - Input_Item item("dft_functional"); - item.annotation = "exchange correlation functional"; - read_sync_string(input.dft_functional); - this->add_item(item); - } - { - Input_Item item("xc_temperature"); - item.annotation = "temperature for finite temperature functionals"; - read_sync_double(input.xc_temperature); - this->add_item(item); - } - { - Input_Item item("xc_exch_ext"); - item.annotation = "placeholder for xcpnet exchange functional"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.xc_exch_ext.resize(item.get_size()); - std::transform(item.str_values.begin(), item.str_values.end(), - para.input.xc_exch_ext.begin(), - [](const std::string& str) { return std::stod(str); }); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - // at least one value should be set - if (para.input.xc_exch_ext.empty()) - { - ModuleBase::WARNING_QUIT("ReadInput", "xc_exch_ext should not be empty."); - } - // the first value is actually an integer, not a double - const double libxc_id_dbl = para.input.xc_exch_ext[0]; - if (std::abs(libxc_id_dbl - std::round(libxc_id_dbl)) > 1.0e-6) - { - ModuleBase::WARNING_QUIT("ReadInput", - "The first parameter (libxc id) can never be a float number"); - } - // the first value is a positive integer - if (libxc_id_dbl < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", - "The first parameter (libxc id) should be a positive integer"); - } - }; - sync_doublevec(input.xc_exch_ext, - para.input.xc_exch_ext.size(), - 0.0); - this->add_item(item); - } - { - Input_Item item("xc_corr_ext"); - item.annotation = "placeholder for xcpnet exchange functional"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.xc_corr_ext.resize(item.get_size()); - std::transform(item.str_values.begin(), item.str_values.end(), - para.input.xc_corr_ext.begin(), - [](const std::string& str) { return std::stod(str); }); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - // at least one value should be set - if (para.input.xc_corr_ext.empty()) - { - ModuleBase::WARNING_QUIT("ReadInput", "xc_corr_ext should not be empty."); - } - // the first value is actually an integer, not a double - const double libxc_id_dbl = para.input.xc_corr_ext[0]; - if (std::abs(libxc_id_dbl - std::round(libxc_id_dbl)) > 1.0e-6) - { - ModuleBase::WARNING_QUIT("ReadInput", - "The first parameter (libxc id) can never be a float number"); - } - // the first value is a positive integer - if (libxc_id_dbl < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", - "The first parameter (libxc id) should be a positive integer"); - } - }; - sync_doublevec(input.xc_corr_ext, - para.input.xc_corr_ext.size(), - 0.0); - this->add_item(item); - } - { - Input_Item item("pseudo_rcut"); - item.annotation = "default #exchange correlation functional"; - read_sync_double(input.pseudo_rcut); - this->add_item(item); - } - { - Input_Item item("pseudo_mesh"); - item.annotation = "0: use our own mesh to do radial renormalization; " - "1: use mesh as in QE"; - read_sync_bool(input.pseudo_mesh); - this->add_item(item); - } - { - Input_Item item("nspin"); - item.annotation = "1: single spin; 2: up and down spin; 4: noncollinear spin"; - read_sync_int(input.nspin); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.noncolin || para.input.lspinorb) - { - para.input.nspin = 4; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nspin != 1 && para.input.nspin != 2 && para.input.nspin != 4) - { - ModuleBase::WARNING_QUIT("ReadInput", "nspin should be 1, 2 or 4."); - } - }; - this->add_item(item); - } - { - Input_Item item("pw_diag_nmax"); - item.annotation = "max iteration number for cg"; - read_sync_int(input.pw_diag_nmax); - this->add_item(item); - } - { - Input_Item item("pw_diag_thr"); - item.annotation = "threshold for eigenvalues is cg electron iterations"; - read_sync_double(input.pw_diag_thr); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_s" && para.input.basis_type == "pw") - { - if (para.input.pw_diag_thr > 1.0e-3) - { - para.input.pw_diag_thr = 1.0e-5; - } - } - }; - this->add_item(item); - } - { - Input_Item item("diago_smooth_ethr"); - item.annotation = "smooth ethr for iter methods"; - read_sync_bool(input.diago_smooth_ethr); - this->add_item(item); - } - { - Input_Item item("use_k_continuity"); - item.annotation = "whether to use k-point continuity for initializing wave functions"; - read_sync_bool(input.use_k_continuity); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.use_k_continuity && para.input.basis_type != "pw") { - ModuleBase::WARNING_QUIT("ReadInput", "use_k_continuity only works for PW basis"); - } - if (para.input.use_k_continuity && para.input.calculation == "nscf") { - ModuleBase::WARNING_QUIT("ReadInput", "use_k_continuity cannot work for NSCF calculation"); - } - if (para.input.use_k_continuity && para.input.nspin == 2) { - ModuleBase::WARNING_QUIT("ReadInput", "use_k_continuity cannot work for spin-polarized calculation"); - } - if (para.input.use_k_continuity && para.input.esolver_type == "sdft") { - ModuleBase::WARNING_QUIT("ReadInput", "use_k_continuity cannot work for SDFT calculation"); - } - }; - this->add_item(item); - } - { - Input_Item item("pw_diag_ndim"); - item.annotation = "dimension of workspace for Davidson diagonalization"; - read_sync_int(input.pw_diag_ndim); - this->add_item(item); - } - { - Input_Item item("diago_cg_prec"); - item.annotation = "diago_cg_prec"; - read_sync_int(input.diago_cg_prec); - this->add_item(item); - } - { - Input_Item item("smearing_method"); - item.annotation = "type of smearing_method: gauss; fd; fixed; mp; mp2; mv"; - read_sync_string(input.smearing_method); - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::vector methods = {"gauss", "gaussian", - "fd", "fermi-dirac", - "fixed", - "mp", "mp2", "mp3" - "marzari-vanderbilt", "cold", "mv"}; - if (std::find(methods.begin(), methods.end(), para.input.smearing_method) == methods.end()) - { - const std::string warningstr = nofound_str(methods, "smearing_method"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - }; - this->add_item(item); - } - { - Input_Item item("smearing_sigma"); - item.annotation = "energy range for smearing"; - read_sync_double(input.smearing_sigma); - this->add_item(item); - } - { - // Energy range for smearing, - //`smearing_sigma` = 1/2 *kB* `smearing_sigma_temp`. - Input_Item tmp_item("smearing_sigma_temp"); - tmp_item.read_value - = [](const Input_Item& item, Parameter& para) { para.input.smearing_sigma = 3.166815e-6 * doublevalue; }; - // only to set smearing_sigma, so no need to write to output INPUT file - // or bcast. - this->add_item(tmp_item); - } - { - Input_Item item("mixing_type"); - item.annotation = "plain; pulay; broyden"; - read_sync_string(input.mixing_mode); - this->add_item(item); - } - { - Input_Item item("mixing_beta"); - item.annotation = "mixing parameter: 0 means no new charge"; - read_sync_double(input.mixing_beta); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mixing_beta < 0.0) - { - if (para.input.nspin == 1) - { - para.input.mixing_beta = 0.8; - } - else if (para.input.nspin == 2) - { - para.input.mixing_beta = 0.4; - para.input.mixing_beta_mag = 1.6; - para.input.mixing_gg0_mag = 0.0; - } - else if (para.input.nspin == 4) // I will add this - { - para.input.mixing_beta = 0.4; - para.input.mixing_beta_mag = 1.6; - para.input.mixing_gg0_mag = 0.0; - } - } - }; - this->add_item(item); - } - { - Input_Item item("mixing_ndim"); - item.annotation = "mixing dimension in pulay or broyden"; - read_sync_int(input.mixing_ndim); - this->add_item(item); - } - { - Input_Item item("mixing_restart"); - item.annotation = "threshold to restart mixing during SCF"; - read_sync_double(input.mixing_restart); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.sc_mag_switch == 1) - {// for DeltaSpin calculation, the mixing_restart should be same as sc_scf_thr - if(para.input.sc_scf_thr != 10.0) - { - para.input.mixing_restart = para.input.sc_scf_thr; - } - else - {// no mixing_restart until oscillation happen in PW base - para.input.mixing_restart = para.input.scf_thr / 10.0; - } - } - }; - this->add_item(item); - } - { - Input_Item item("mixing_gg0"); - item.annotation = "mixing parameter in kerker"; - read_sync_double(input.mixing_gg0); - this->add_item(item); - } - { - Input_Item item("mixing_beta_mag"); - item.annotation = "mixing parameter for magnetic density"; - read_sync_double(input.mixing_beta_mag); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mixing_beta_mag < 0.0) - { - if (para.input.nspin == 2 || para.input.nspin == 4) - { - if (para.input.mixing_beta <= 0.4) - { - para.input.mixing_beta_mag = 4 * para.input.mixing_beta; - } - else - { - para.input.mixing_beta_mag = 1.6; // 1.6 can be discussed - } - } - } - }; - this->add_item(item); - } - { - Input_Item item("mixing_gg0_mag"); - item.annotation = "mixing parameter in kerker"; - read_sync_double(input.mixing_gg0_mag); - this->add_item(item); - } - { - Input_Item item("mixing_gg0_min"); - item.annotation = "the minimum kerker coefficient"; - read_sync_double(input.mixing_gg0_min); - this->add_item(item); - } - { - Input_Item item("mixing_angle"); - item.annotation = "angle mixing parameter for non-colinear calculations"; - read_sync_double(input.mixing_angle); - this->add_item(item); - } - { - Input_Item item("mixing_tau"); - item.annotation = "whether to mix tau in mGGA calculation"; - read_sync_bool(input.mixing_tau); - this->add_item(item); - } - { - Input_Item item("mixing_dftu"); - item.annotation = "whether to mix locale in DFT+U calculation"; - read_sync_bool(input.mixing_dftu); - this->add_item(item); - } - { - Input_Item item("mixing_dmr"); - item.annotation = "whether to mix real-space density matrix"; - read_sync_bool(input.mixing_dmr); - this->add_item(item); - } - { - Input_Item item("gamma_only"); - item.annotation = "Only for localized orbitals set and gamma point. If " - "set to 1, a fast algorithm is used"; - read_sync_bool(input.gamma_only); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.basis_type == "pw" && para.input.gamma_only) - { - para.input.gamma_only = false; - GlobalV::ofs_warning << " WARNING : gamma_only has not been implemented for pw yet" << std::endl; - GlobalV::ofs_warning << "gamma_only is not supported in the pw model" << std::endl; - GlobalV::ofs_warning << " the INPUT parameter gamma_only has been reset to 0" << std::endl; - GlobalV::ofs_warning << " and a new KPT is generated with gamma point as the only k point"<< std::endl; - GlobalV::ofs_warning << " Auto generating k-points file: " << para.input.kpoint_file << std::endl; - std::ofstream ofs(para.input.kpoint_file.c_str()); - ofs << "K_POINTS" << std::endl; - ofs << "0" << std::endl; - ofs << "Gamma" << std::endl; - ofs << "1 1 1 0 0 0" << std::endl; - ofs.close(); - } - if (para.input.basis_type == "lcao" && para.input.gamma_only) - { - if (para.input.nspin == 4) - { - ModuleBase::WARNING_QUIT("NOTICE", "nspin=4 (soc or noncollinear-spin) does not support gamma\n only calculation"); - } - } - }; - this->add_item(item); - } - { - Input_Item item("scf_nmax"); - item.annotation = "number of electron iterations"; - read_sync_int(input.scf_nmax); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "nscf") - { - para.input.scf_nmax = 1; - } - }; - this->add_item(item); - } - { - Input_Item item("scf_thr"); - item.annotation = "charge density error"; - read_sync_double(input.scf_thr); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.scf_thr == -1.0) - { - if (para.input.basis_type == "lcao" || para.input.basis_type == "lcao_in_pw") - { - para.input.scf_thr = 1.0e-7; - } - else if (para.input.basis_type == "pw" && para.input.calculation != "nscf") - { - para.input.scf_thr = 1.0e-9; - } - else if (para.input.basis_type == "pw" && para.input.calculation == "nscf") - { - para.input.scf_thr = 1.0e-6; - // In NSCF calculation, the diagonalization threshold is set - // to 0.1*scf/nelec. In other words, the scf_thr is used to - // control diagonalization convergence threthod in NSCF. In - // this case, the default 1.0e-9 is too strict. renxi - // 20230908 - } - } - }; - this->add_item(item); - } - { - Input_Item item("scf_ene_thr"); - item.annotation = "total energy error threshold"; - read_sync_double(input.scf_ene_thr); - this->add_item(item); - } - { - Input_Item item("scf_os_stop"); - item.annotation = "whether to stop scf when oscillation is detected"; - read_sync_bool(input.scf_os_stop); - this->add_item(item); - } - { - Input_Item item("scf_os_thr"); - item.annotation = "charge density threshold for oscillation"; - read_sync_double(input.scf_os_thr); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.scf_os_thr >= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "scf_os_thr should be negative"); - } - }; - this->add_item(item); - } - { - Input_Item item("scf_os_ndim"); - item.annotation = "number of old iterations used for oscillation detection"; - read_sync_int(input.scf_os_ndim); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.scf_os_ndim <= 0) // default value - { - para.input.scf_os_ndim = para.input.mixing_ndim; - } - }; - this->add_item(item); - } - { - Input_Item item("sc_os_ndim"); - item.annotation = "number of old iterations used for oscillation detection, for Spin-Constrained DFT"; - read_sync_int(input.sc_os_ndim); - this->add_item(item); - } - { - Input_Item item("scf_thr_type"); - item.annotation = "type of the criterion of scf_thr, 1: reci drho for " - "pw, 2: real drho for lcao"; - read_sync_int(input.scf_thr_type); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.scf_thr_type == -1) - { - if (para.input.basis_type == "lcao" || para.input.basis_type == "lcao_in_pw") - { - para.input.scf_thr_type = 2; - } - else if (para.input.basis_type == "pw") - { - para.input.scf_thr_type = 1; - } - } - }; - this->add_item(item); - } - { - Input_Item item("lspinorb"); - item.annotation = "consider the spin-orbit interaction"; - read_sync_bool(input.lspinorb); - this->add_item(item); - } - { - Input_Item item("noncolin"); - item.annotation = "using non-collinear-spin"; - read_sync_bool(input.noncolin); - this->add_item(item); - } - { - Input_Item item("soc_lambda"); - item.annotation = "The fraction of averaged SOC pseudopotential is " - "given by (1-soc_lambda)"; - read_sync_double(input.soc_lambda); - this->add_item(item); - } - - // LCAO - { - Input_Item item("nb2d"); - item.annotation = "matrix 2d division"; - read_sync_int(input.nb2d); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nb2d < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nb2d should be greater than 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("lmaxmax"); - item.annotation = "maximum of l channels used"; - read_sync_int(input.lmaxmax); - this->add_item(item); - } - { - Input_Item item("lcao_ecut"); - item.annotation = "energy cutoff for LCAO"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.lcao_ecut == 0 && para.input.basis_type == "lcao") - { - para.input.lcao_ecut = para.input.ecutwfc; - ModuleBase::GlobalFunc::AUTO_SET("lcao_ecut", para.input.ecutwfc); - } - }; - read_sync_double(input.lcao_ecut); - this->add_item(item); - } - { - Input_Item item("lcao_dk"); - item.annotation = "delta k for 1D integration in LCAO"; - read_sync_double(input.lcao_dk); - this->add_item(item); - } - { - Input_Item item("lcao_dr"); - item.annotation = "delta r for 1D integration in LCAO"; - read_sync_double(input.lcao_dr); - this->add_item(item); - } - { - Input_Item item("lcao_rmax"); - item.annotation = "max R for 1D two-center integration table"; - read_sync_double(input.lcao_rmax); - this->add_item(item); - } - { - Input_Item item("search_radius"); - item.annotation = "input search radius (Bohr)"; - read_sync_double(input.search_radius); - this->add_item(item); - } - { - Input_Item item("bx"); - item.annotation = "division of an element grid in FFT grid along x"; - read_sync_int(input.bx); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.bx > 10) - { - ModuleBase::WARNING_QUIT("ReadInput", "bx should be no more than 10"); - } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.basis_type == "pw" || para.input.basis_type == "lcao_in_pw" - || para.input.calculation == "get_wf") - { - para.input.bx = 1; - para.input.by = 1; - para.input.bz = 1; - } - }; - this->add_item(item); - } - { - Input_Item item("by"); - item.annotation = "division of an element grid in FFT grid along y"; - read_sync_int(input.by); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.by > 10) - { - ModuleBase::WARNING_QUIT("ReadInput", "by should be no more than 10"); - } - }; - this->add_item(item); - } - { - Input_Item item("bz"); - item.annotation = "division of an element grid in FFT grid along z"; - read_sync_int(input.bz); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.bz > 10) - { - ModuleBase::WARNING_QUIT("ReadInput", "bz should be no more than 10"); - } - }; - this->add_item(item); - } - { - Input_Item item("elpa_num_thread"); - item.annotation = "Number of threads need to use in elpa"; - read_sync_int(input.elpa_num_thread); - this->add_item(item); - } - { - Input_Item item("num_stream"); - item.annotation = "the nstream in compute the LCAO with CUDA"; - read_sync_int(input.nstream); - this->add_item(item); - } - { - Input_Item item("bessel_nao_ecut"); - item.annotation = "energy cutoff for spherical bessel functions(Ry)"; - read_sync_string(input.bessel_nao_ecut); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.bessel_nao_ecut == "default") - { - para.input.bessel_nao_ecut = std::to_string(para.input.ecutwfc); - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (std::stod(para.input.bessel_nao_ecut) < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "bessel_nao_ecut must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("bessel_nao_tolerence"); - item.annotation = "tolerence for spherical bessel root"; - read_sync_double(input.bessel_nao_tolerence); - this->add_item(item); - } - { - Input_Item item("bessel_nao_rcut"); - item.annotation = "radial cutoff for spherical bessel functions(a.u.)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.bessel_nao_rcuts.push_back(std::stod(item.str_values[i])); - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - for(auto rcut: para.input.bessel_nao_rcuts) - { - if (rcut < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "bessel_nao_rcut must >= 0"); - } - } - }; - sync_doublevec(input.bessel_nao_rcuts, para.input.bessel_nao_rcuts.size(), 0.0); - this->add_item(item); - } - { - Input_Item item("bessel_nao_smooth"); - item.annotation = "spherical bessel smooth or not"; - read_sync_bool(input.bessel_nao_smooth); - this->add_item(item); - } - { - Input_Item item("bessel_nao_sigma"); - item.annotation = "spherical bessel smearing_sigma"; - read_sync_double(input.bessel_nao_sigma); - this->add_item(item); - } -} -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_exx_dftu.cpp b/source/module_io/read_input_item_exx_dftu.cpp deleted file mode 100644 index 3a34d81d6b..0000000000 --- a/source/module_io/read_input_item_exx_dftu.cpp +++ /dev/null @@ -1,523 +0,0 @@ -#include "source_base/constants.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -void ReadInput::item_exx() -{ - // EXX - { - Input_Item item("exx_fock_alpha"); - item.annotation = "fraction of Fock exchange 1/r in hybrid functionals"; - item.read_value = [](const Input_Item& item, Parameter& para) - { - para.input.exx_fock_alpha = item.str_values; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) - { - if (para.input.exx_fock_alpha.size()==1 && para.input.exx_fock_alpha[0]=="default") - { - std::string& dft_functional = para.input.dft_functional; - std::string dft_functional_lower = dft_functional; - std::transform(dft_functional.begin(), dft_functional.end(), dft_functional_lower.begin(), tolower); - if (dft_functional_lower == "hf") - { - para.input.exx_fock_alpha = {"1"}; - } - else if (dft_functional_lower == "pbe0" || dft_functional_lower == "scan0") - { - para.input.exx_fock_alpha = {"0.25"}; - } - else if (dft_functional_lower == "b3lyp") - { - para.input.exx_fock_alpha = {"0.2"}; - } - else if (dft_functional_lower == "muller" || dft_functional_lower == "power" ) - { - para.input.exx_fock_alpha = {"1"}; - } - else if (dft_functional_lower == "wp22") - { - para.input.exx_fock_alpha = {"1"}; - } - else - { // no exx in scf, but will change to non-zero in postprocess like rpa - para.input.exx_fock_alpha = {}; - } - } - }; - sync_stringvec(input.exx_fock_alpha, para.input.exx_fock_alpha.size(), ""); - this->add_item(item); - } - { - Input_Item item("exx_erfc_alpha"); - item.annotation = "fraction of exchange erfc(wr)/r in hybrid functionals"; - item.read_value = [](const Input_Item& item, Parameter& para) - { - para.input.exx_erfc_alpha = item.str_values; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) - { - if (para.input.exx_erfc_alpha.size()==1 && para.input.exx_erfc_alpha[0]=="default") - { - std::string& dft_functional = para.input.dft_functional; - std::string dft_functional_lower = dft_functional; - std::transform(dft_functional.begin(), dft_functional.end(), dft_functional_lower.begin(), tolower); - if (dft_functional_lower == "hse") - { - para.input.exx_erfc_alpha = {"0.25"}; - } - else if (dft_functional_lower == "cwp22") - { - para.input.exx_erfc_alpha = {"1"}; - } - else if (dft_functional_lower == "wp22") - { - para.input.exx_erfc_alpha = {"-1"}; - } - else - { // no exx in scf, but will change to non-zero in postprocess like rpa - para.input.exx_erfc_alpha = {}; - } - } - }; - sync_stringvec(input.exx_erfc_alpha, para.input.exx_erfc_alpha.size(), ""); - this->add_item(item); - } - { - Input_Item item("exx_erfc_omega"); - item.annotation = "range-separation parameter erfc(wr)/r in hybrid functionals"; - item.read_value = [](const Input_Item& item, Parameter& para) - { - para.input.exx_erfc_omega = item.str_values; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) - { - if (para.input.exx_erfc_omega.size()==1 && para.input.exx_erfc_omega[0]=="default") - { - std::string& dft_functional = para.input.dft_functional; - std::string dft_functional_lower = dft_functional; - std::transform(dft_functional.begin(), dft_functional.end(), dft_functional_lower.begin(), tolower); - if (dft_functional_lower == "hse" || dft_functional_lower == "cwp22" || dft_functional_lower == "wp22") - { - para.input.exx_erfc_omega = {"0.11"}; - } - else - { - para.input.exx_erfc_omega = {}; - } - } - }; - sync_stringvec(input.exx_erfc_omega, para.input.exx_erfc_omega.size(), ""); - this->add_item(item); - } - { - Input_Item item("exx_fock_lambda"); - item.annotation = "used to compensate for divergence points at G=0 in " - "the evaluation of Fock exchange using " - "lcao_in_pw method"; - item.read_value = [](const Input_Item& item, Parameter& para) - { - para.input.exx_fock_lambda = item.str_values; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) - { - if (para.input.exx_fock_lambda.size()==1 && para.input.exx_fock_lambda[0]=="default") - { - para.input.exx_fock_lambda = std::vector(para.input.exx_fock_alpha.size(), "0.3"); - } - }; - sync_stringvec(input.exx_fock_lambda, para.input.exx_fock_lambda.size(), ""); - this->add_item(item); - } - { - Input_Item item("exx_separate_loop"); - item.annotation = "if 1, a two-step method is employed, else it will " - "start with a GGA-Loop, and then Hybrid-Loop"; - read_sync_bool(input.exx_separate_loop); - this->add_item(item); - } - { - Input_Item item("exx_hybrid_step"); - item.annotation = "the maximal electronic iteration number in the " - "evaluation of Fock exchange"; - read_sync_int(input.exx_hybrid_step); - item.check_value = [](const Input_Item& item, const Parameter& para) - { - if (para.input.exx_hybrid_step <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "exx_hybrid_step must > 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("exx_mixing_beta"); - item.annotation = "mixing_beta for outer-loop when exx_separate_loop=1"; - read_sync_double(input.exx_mixing_beta); - this->add_item(item); - } - { - Input_Item item("exx_real_number"); - item.annotation = "exx calculated in real or complex"; - read_sync_string(input.exx_real_number); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.exx_real_number == "default") - { // to run through here, the default value of para.input.exx_real_number should be "default" - if (para.input.gamma_only) - { - para.input.exx_real_number = "1"; - } - else - { - para.input.exx_real_number = "0"; - } - } - }; - this->add_item(item); - } - { - Input_Item item("exx_pca_threshold"); - item.annotation = "threshold to screen on-site ABFs in exx"; - read_sync_double(input.exx_pca_threshold); - this->add_item(item); - } - { - Input_Item item("exx_c_threshold"); - item.annotation = "threshold to screen C matrix in exx"; - read_sync_double(input.exx_c_threshold); - this->add_item(item); - } - { - Input_Item item("exx_v_threshold"); - item.annotation = "threshold to screen C matrix in exx"; - read_sync_double(input.exx_v_threshold); - this->add_item(item); - } - { - Input_Item item("exx_dm_threshold"); - item.annotation = "threshold to screen density matrix in exx"; - read_sync_double(input.exx_dm_threshold); - this->add_item(item); - } - { - Input_Item item("exx_c_grad_threshold"); - item.annotation = "threshold to screen nabla C matrix in exx"; - read_sync_double(input.exx_c_grad_threshold); - this->add_item(item); - } - { - Input_Item item("exx_v_grad_threshold"); - item.annotation = "threshold to screen nabla V matrix in exx"; - read_sync_double(input.exx_v_grad_threshold); - this->add_item(item); - } - { - Input_Item item("exx_c_grad_r_threshold"); - item.annotation = "threshold to screen nabla C * R matrix in exx"; - read_sync_double(input.exx_c_grad_r_threshold); - this->add_item(item); - } - { - Input_Item item("exx_v_grad_r_threshold"); - item.annotation = "threshold to screen nabla V * R matrix in exx"; - read_sync_double(input.exx_v_grad_r_threshold); - this->add_item(item); - } - { - Input_Item item("exx_ccp_rmesh_times"); - item.annotation = "how many times larger the radial mesh required for " - "calculating Columb potential is to that " - "of atomic orbitals"; - read_sync_string(input.exx_ccp_rmesh_times); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.exx_ccp_rmesh_times == "default") - { // to run through here, the default value of para.input.exx_ccp_rmesh_times should be "default" - std::string& dft_functional = para.input.dft_functional; - std::string dft_functional_lower = dft_functional; - std::transform(dft_functional.begin(), dft_functional.end(), dft_functional_lower.begin(), tolower); - if (dft_functional_lower == "hf" || dft_functional_lower == "pbe0" || dft_functional_lower == "scan0") - { - para.input.exx_ccp_rmesh_times = "5"; - } - else if (dft_functional_lower == "hse") - { - para.input.exx_ccp_rmesh_times = "1.5"; - } - // added by jghan 2024-07-06 - else if (dft_functional_lower == "muller" || dft_functional_lower == "power") - { - para.input.exx_ccp_rmesh_times = "5"; - } - else if (dft_functional_lower == "wp22") - { - para.input.exx_ccp_rmesh_times = "5"; - // exx_ccp_rmesh_times = "1.5"; - } - else if (dft_functional_lower == "cwp22") - { - para.input.exx_ccp_rmesh_times = "1.5"; - } - else - { // no exx in scf - para.input.exx_ccp_rmesh_times = "1"; - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (std::stod(para.input.exx_ccp_rmesh_times) < 1) - { - ModuleBase::WARNING_QUIT("ReadInput", "exx_ccp_rmesh_times must >= 1"); - } - }; - this->add_item(item); - } - { - Input_Item item("exx_opt_orb_lmax"); - item.annotation = "the maximum l of the spherical Bessel functions for opt ABFs"; - read_sync_int(input.exx_opt_orb_lmax); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.exx_opt_orb_lmax < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "exx_opt_orb_lmax must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("exx_opt_orb_ecut"); - item.annotation = "the cut-off of plane wave expansion for opt ABFs"; - read_sync_double(input.exx_opt_orb_ecut); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.exx_opt_orb_ecut < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "exx_opt_orb_ecut must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("exx_opt_orb_tolerence"); - item.annotation = "the threshold when solving for the zeros of " - "spherical Bessel functions for opt ABFs"; - read_sync_double(input.exx_opt_orb_tolerence); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.exx_opt_orb_tolerence < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "exx_opt_orb_tolerence must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("exx_symmetry_realspace"); - item.annotation = "whether to reduce real-space sector in Hexx calculation"; - read_sync_bool(input.exx_symmetry_realspace); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.symmetry != "1") { para.input.exx_symmetry_realspace = false; } - }; - this->add_item(item); - } - { - Input_Item item("rpa_ccp_rmesh_times"); - item.annotation = "how many times larger the radial mesh required for " - "calculating Columb potential is to that " - "of atomic orbitals"; - read_sync_double(input.rpa_ccp_rmesh_times); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.rpa_ccp_rmesh_times < 1) - { - ModuleBase::WARNING_QUIT("ReadInput", "rpa_ccp_rmesh_times must >= 1"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_ri_cv"); - item.annotation = "Whether to output the coefficient tensor C and ABFs-representation Coulomb matrix V"; - read_sync_bool(input.out_ri_cv); - this->add_item(item); - } -} -void ReadInput::item_dftu() -{ - // dft+u - { - Input_Item item("dft_plus_u"); - item.annotation = "DFT+U correction method"; - read_sync_int(input.dft_plus_u); - item.reset_value = [](const Input_Item& item, Parameter& para) { - bool all_minus1 = true; - for (auto& val: para.input.orbital_corr) - { - if (val != -1) - { - all_minus1 = false; - break; - } - } - if (all_minus1) - { - if (para.input.dft_plus_u != 0) - { - para.input.dft_plus_u = 0; - ModuleBase::WARNING("ReadInput", "No atoms are correlated, DFT+U is closed!!!"); - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - const Input_para& input = para.input; - if (input.dft_plus_u != 0) - { - if (input.basis_type == "pw" && input.nspin != 4) - { - ModuleBase::WARNING_QUIT("ReadInput", "WRONG ARGUMENTS, only nspin2 with PW base is not supported now"); - } - } - }; - this->add_item(item); - } - { - Input_Item item("dft_plus_dmft"); - item.annotation = "true:DFT+DMFT; false: standard DFT calcullation(default)"; - read_sync_bool(input.dft_plus_dmft); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.basis_type != "lcao" && para.input.dft_plus_dmft) - { - ModuleBase::WARNING_QUIT("ReadInput", "DFT+DMFT is only supported for lcao calculation."); - } - }; - this->add_item(item); - } - { - Input_Item item("yukawa_lambda"); - item.annotation = "default:0.0"; - read_sync_double(input.yukawa_lambda); - this->add_item(item); - } - { - Input_Item item("yukawa_potential"); - item.annotation = "default: false"; - read_sync_bool(input.yukawa_potential); - this->add_item(item); - } - { - Input_Item item("uramping"); - item.annotation = "increasing U values during SCF"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.uramping_eV = doublevalue; - para.sys.uramping = para.input.uramping_eV / ModuleBase::Ry_to_eV; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - bool all_minus1 = true; - for (auto& val: para.input.orbital_corr) - { - if (val != -1) - { - all_minus1 = false; - break; - } - } - if (all_minus1) - { - if (para.sys.uramping != 0.0) - { - para.sys.uramping = 0.0; - ModuleBase::WARNING("ReadInput", "No atoms are correlated, U-ramping is closed!!!"); - } - } - }; - sync_double(input.uramping_eV); - add_double_bcast(sys.uramping); - this->add_item(item); - } - { - Input_Item item("omc"); - item.annotation = "the mode of occupation matrix control"; - read_sync_int(input.omc); - this->add_item(item); - } - { - Input_Item item("onsite_radius"); - item.annotation = "radius of the sphere for onsite projection (Bohr)"; - read_sync_double(input.onsite_radius); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if ((para.input.dft_plus_u == 1 || para.input.sc_mag_switch) && para.input.onsite_radius == 0.0) - { - // autoset onsite_radius to 3.0 as default, this default value comes from the systematic atomic magnetism test - para.input.onsite_radius = 3.0; - } - }; - this->add_item(item); - } - { - Input_Item item("hubbard_u"); - item.annotation = "Hubbard Coulomb interaction parameter U(ev)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.hubbard_u_eV.push_back(std::stod(item.str_values[i])); - para.sys.hubbard_u.push_back(para.input.hubbard_u_eV[i] / ModuleBase::Ry_to_eV); - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) - { - return; - } - if (para.sys.hubbard_u.size() != para.input.ntype) - { - ModuleBase::WARNING_QUIT("ReadInput", - "hubbard_u should have the same " - "number of elements as ntype"); - } - for (auto& value: para.sys.hubbard_u) - { - if (value < -1.0e-3) - { - ModuleBase::WARNING_QUIT("ReadInput", "WRONG ARGUMENTS OF hubbard_u"); - } - } - }; - sync_doublevec(input.hubbard_u_eV, para.input.ntype, 0.0); - add_doublevec_bcast(sys.hubbard_u, para.input.ntype, 0.0); - this->add_item(item); - } - { - Input_Item item("orbital_corr"); - item.annotation = "which correlated orbitals need corrected ; d:2 " - ",f:3, do not need correction:-1"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.orbital_corr.push_back(std::stoi(item.str_values[i])); - } - }; - - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) - { - return; - } - if (para.input.orbital_corr.size() != para.input.ntype) - { - ModuleBase::WARNING_QUIT("ReadInput", - "orbital_corr should have the same " - "number of elements as ntype"); - } - for (auto& val: para.input.orbital_corr) - { - if (val < -1 || val > 3) - { - ModuleBase::WARNING_QUIT("ReadInput", "WRONG ARGUMENTS OF orbital_corr"); - } - } - }; - sync_intvec(input.orbital_corr, para.input.ntype, -1); - this->add_item(item); - } -} -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_md.cpp b/source/module_io/read_input_item_md.cpp deleted file mode 100644 index 4ba795d63a..0000000000 --- a/source/module_io/read_input_item_md.cpp +++ /dev/null @@ -1,413 +0,0 @@ -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" - -namespace ModuleIO -{ -void ReadInput::item_md() -{ - // 9. Molecular dynamics - { - Input_Item item("md_type"); - item.annotation = "choose ensemble"; - read_sync_string(input.mdp.md_type); - this->add_item(item); - } - { - Input_Item item("md_thermostat"); - item.annotation = "choose thermostat"; - read_sync_string(input.mdp.md_thermostat); - this->add_item(item); - } - { - Input_Item item("md_nstep"); - item.annotation = "md steps"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mdp.md_nstep == 0 && para.input.esolver_type != "tddft") - { - GlobalV::ofs_running << "md_nstep should be set. Autoset md_nstep to 50!" << std::endl; - para.input.mdp.md_nstep = 50; - } - }; - read_sync_int(input.mdp.md_nstep); - this->add_item(item); - } - { - Input_Item item("md_dt"); - item.annotation = "time step"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.mdp.md_dt < 0) { - ModuleBase::WARNING_QUIT("ReadInput", "time interval of MD calculation should be positive"); -} - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.td_dt != -1.0) - { - GlobalV::ofs_running << "td_dt exist, set md_dt with td_dt" << std::endl; - para.input.mdp.md_dt = para.input.td_dt * para.input.estep_per_md; - } - }; - read_sync_double(input.mdp.md_dt); - this->add_item(item); - } - { - Input_Item item("md_tchain"); - item.annotation = "number of Nose-Hoover chains"; - read_sync_int(input.mdp.md_tchain); - this->add_item(item); - } - { - Input_Item item("md_tfirst"); - item.annotation = "temperature first"; - read_sync_double(input.mdp.md_tfirst); - this->add_item(item); - } - { - Input_Item item("md_tlast"); - item.annotation = "temperature last"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.mdp.md_tlast < 0) - { - para.input.mdp.md_tlast = para.mdp.md_tfirst; - } - }; - read_sync_double(input.mdp.md_tlast); - this->add_item(item); - } - { - Input_Item item("md_dumpfreq"); - item.annotation = "The period to dump MD information"; - read_sync_int(input.mdp.md_dumpfreq); - this->add_item(item); - } - { - Input_Item item("md_restartfreq"); - item.annotation = "The period to output MD restart information"; - read_sync_int(input.mdp.md_restartfreq); - this->add_item(item); - } - { - Input_Item item("md_seed"); - item.annotation = "random seed for MD"; - read_sync_int(input.mdp.md_seed); - this->add_item(item); - } - { - Input_Item item("md_prec_level"); - item.annotation = "precision level for vc-md"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation != "md") - { - para.input.mdp.md_prec_level = 0; - } - // md_prec_level only used in vc-md liuyu 2023-03-27 - else if (para.input.mdp.md_type != "msst" && para.input.mdp.md_type != "npt") - { - para.input.mdp.md_prec_level = 0; - } - }; - read_sync_int(input.mdp.md_prec_level); - this->add_item(item); - } - { - Input_Item item("ref_cell_factor"); - item.annotation = "construct a reference cell bigger than the initial cell"; - read_sync_double(input.ref_cell_factor); - this->add_item(item); - } - { - Input_Item item("md_restart"); - item.annotation = "whether restart"; - read_sync_bool(input.mdp.md_restart); - this->add_item(item); - } - { - Input_Item item("lj_rule"); - item.annotation = "combination rules used to construct the parameter matrix for LJ potential"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.esolver_type == "lj" && para.input.mdp.lj_rule != 1 && para.input.mdp.lj_rule != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "lj_rule must be 1 or 2"); - } - }; - read_sync_int(input.mdp.lj_rule); - this->add_item(item); - } - { - Input_Item item("lj_eshift"); - item.annotation = "whether to use energy shift for LJ potential"; - read_sync_bool(input.mdp.lj_eshift); - this->add_item(item); - } - { - Input_Item item("lj_rcut"); - item.annotation = "cutoff radius of LJ potential"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - para.input.mdp.lj_rcut.resize(count); - std::transform(begin(item.str_values), - end(item.str_values), - begin(para.input.mdp.lj_rcut), - [](std::string str) { return std::stod(str); }); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) { - return; -} - size_t n_ljrcut = para.input.mdp.lj_rcut.size(); - if (n_ljrcut != 1 && n_ljrcut != para.input.ntype * (para.input.ntype + 1) / 2) - { - ModuleBase::WARNING_QUIT("ReadInput", " the number of lj_rcut should be 1 or ntype(ntype+1)/2 "); - } - for (auto rcut: para.input.mdp.lj_rcut) - { - if (rcut <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "lj_rcut must > 0"); - } - } - }; - sync_doublevec(input.mdp.lj_rcut, para.input.mdp.lj_rcut.size(), 0.0); - this->add_item(item); - } - { - Input_Item item("lj_epsilon"); - item.annotation = "the value of epsilon for LJ potential"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - para.input.mdp.lj_epsilon.resize(count); - std::transform(begin(item.str_values), - end(item.str_values), - begin(para.input.mdp.lj_epsilon), - [](std::string str) { return std::stod(str); }); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) { - return; -} - size_t n_ljepsilon = para.input.mdp.lj_epsilon.size(); - if (n_ljepsilon != para.input.ntype && n_ljepsilon != para.input.ntype * (para.input.ntype + 1) / 2) - { - ModuleBase::WARNING_QUIT("ReadInput", " the number of lj_epsilon should be ntype or ntype(ntype+1)/2 "); - } - }; - sync_doublevec(input.mdp.lj_epsilon, para.input.mdp.lj_epsilon.size(), 0.0); - this->add_item(item); - } - { - Input_Item item("lj_sigma"); - item.annotation = "the value of sigma for LJ potential"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - para.input.mdp.lj_sigma.resize(count); - std::transform(begin(item.str_values), - end(item.str_values), - begin(para.input.mdp.lj_sigma), - [](std::string str) { return std::stod(str); }); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) { - return; -} - size_t n_ljsigma = para.input.mdp.lj_sigma.size(); - if (n_ljsigma != para.input.ntype && n_ljsigma != para.input.ntype * (para.input.ntype + 1) / 2) - { - ModuleBase::WARNING_QUIT("ReadInput", " the number of lj_sigma should be ntype or ntype(ntype+1)/2 "); - } - }; - sync_doublevec(input.mdp.lj_sigma, para.input.mdp.lj_sigma.size(), 0.0); - this->add_item(item); - } - { - Input_Item item("pot_file"); - item.annotation = "the filename of potential files for CMD such as DP"; - read_sync_string(input.mdp.pot_file); - this->add_item(item); - } - { - Input_Item item("dp_rescaling"); - item.annotation = "rescaling factor for dp potential"; - read_sync_double(input.mdp.dp_rescaling); - this->add_item(item); - } - { - Input_Item item("dp_fparam"); - item.annotation = "the frame parameter for dp potential"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - para.input.mdp.dp_fparam.resize(count); - std::transform(begin(item.str_values), - end(item.str_values), - begin(para.input.mdp.dp_fparam), - [](std::string str) { return std::stod(str); }); - }; - sync_doublevec(input.mdp.dp_fparam, para.input.mdp.dp_fparam.size(), 0.0); - this->add_item(item); - } - { - Input_Item item("dp_aparam"); - item.annotation = "the atomic parameter for dp potential"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - para.input.mdp.dp_aparam.resize(count); - std::transform(begin(item.str_values), - end(item.str_values), - begin(para.input.mdp.dp_aparam), - [](std::string str) { return std::stod(str); }); - }; - sync_doublevec(input.mdp.dp_aparam, para.input.mdp.dp_aparam.size(), 0.0); - this->add_item(item); - } - { - Input_Item item("msst_direction"); - item.annotation = "the direction of shock wave"; - read_sync_int(input.mdp.msst_direction); - this->add_item(item); - } - { - Input_Item item("msst_vel"); - item.annotation = "the velocity of shock wave"; - read_sync_double(input.mdp.msst_vel); - this->add_item(item); - } - { - Input_Item item("msst_vis"); - item.annotation = "artificial viscosity"; - read_sync_double(input.mdp.msst_vis); - this->add_item(item); - } - { - Input_Item item("msst_tscale"); - item.annotation = "reduction in initial temperature"; - read_sync_double(input.mdp.msst_tscale); - this->add_item(item); - } - { - Input_Item item("msst_qmass"); - item.annotation = "mass of thermostat"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.mdp.msst_qmass <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "msst_qmass must be greater than 0!"); - } - }; - read_sync_double(input.mdp.msst_qmass); - this->add_item(item); - } - { - Input_Item item("md_tfreq"); - item.annotation = "oscillation frequency, used to determine qmass of NHC"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mdp.md_tfreq == 0 && para.input.calculation == "md") - { - para.input.mdp.md_tfreq = 1.0 / 40 / para.input.mdp.md_dt; - } - }; - read_sync_double(input.mdp.md_tfreq); - this->add_item(item); - } - { - Input_Item item("md_damp"); - item.annotation = "damping parameter (time units) used to add force in " - "Langevin method"; - read_sync_double(input.mdp.md_damp); - this->add_item(item); - } - { - Input_Item item("md_nraise"); - item.annotation = "parameters used when md_type=nvt"; - read_sync_int(input.mdp.md_nraise); - this->add_item(item); - } - { - Input_Item item("cal_syns"); - item.annotation = "calculate asynchronous overlap matrix to output for Hefei-NAMD"; - read_sync_bool(input.cal_syns); - this->add_item(item); - } - { - Input_Item item("dmax"); - item.annotation = "maximum displacement of all atoms in one step (bohr)"; - read_sync_double(input.dmax); - this->add_item(item); - } - { - Input_Item item("md_tolerance"); - item.annotation = "tolerance for velocity rescaling (K)"; - read_sync_double(input.mdp.md_tolerance); - this->add_item(item); - } - { - Input_Item item("md_pmode"); - item.annotation = "NPT ensemble mode: iso, aniso, tri"; - read_sync_string(input.mdp.md_pmode); - this->add_item(item); - } - { - Input_Item item("md_pcouple"); - item.annotation = "whether couple different components: xyz, xy, yz, xz, none"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.mdp.md_pmode == "iso") - { - para.input.mdp.md_pcouple = "xyz"; - } - }; - read_sync_string(input.mdp.md_pcouple); - this->add_item(item); - } - { - Input_Item item("md_pchain"); - item.annotation = "num of thermostats coupled with barostat"; - read_sync_int(input.mdp.md_pchain); - this->add_item(item); - } - { - Input_Item item("md_pfirst"); - item.annotation = "initial target pressure"; - read_sync_double(input.mdp.md_pfirst); - this->add_item(item); - } - { - Input_Item item("md_plast"); - item.annotation = "final target pressure"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (!item.is_read()) { // no md_plast in INPUT - para.input.mdp.md_plast = para.input.mdp.md_pfirst; -} - }; - read_sync_double(input.mdp.md_plast); - this->add_item(item); - } - { - Input_Item item("md_pfreq"); - item.annotation = "oscillation frequency, used to determine qmass of " - "thermostats coupled with barostat"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mdp.md_pfreq == 0 && para.input.calculation == "md") - { - para.input.mdp.md_pfreq = 1.0 / 400 / para.input.mdp.md_dt; - } - }; - read_sync_double(input.mdp.md_pfreq); - this->add_item(item); - } - { - Input_Item item("dump_force"); - item.annotation = "output atomic forces into the file MD_dump or not"; - read_sync_bool(input.mdp.dump_force); - this->add_item(item); - } - { - Input_Item item("dump_vel"); - item.annotation = "output atomic velocities into the file MD_dump or not"; - read_sync_bool(input.mdp.dump_vel); - this->add_item(item); - } - { - Input_Item item("dump_virial"); - item.annotation = "output lattice virial into the file MD_dump or not"; - read_sync_bool(input.mdp.dump_virial); - this->add_item(item); - } -} -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_model.cpp b/source/module_io/read_input_item_model.cpp deleted file mode 100644 index aa78e84400..0000000000 --- a/source/module_io/read_input_item_model.cpp +++ /dev/null @@ -1,375 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -void ReadInput::item_model() -{ - // Electric field and dipole correction - { - Input_Item item("efield_flag"); - item.annotation = "add electric field"; - read_sync_bool(input.efield_flag); - this->add_item(item); - } - { - Input_Item item("dip_cor_flag"); - item.annotation = "dipole correction"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.dip_cor_flag && !para.input.efield_flag) - { - ModuleBase::WARNING_QUIT("ReadInput", "dipole correction is not active if efield_flag=false !"); - } - }; - read_sync_bool(input.dip_cor_flag); - this->add_item(item); - } - { - Input_Item item("efield_dir"); - item.annotation = "the direction of the electric field or dipole correction"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.gate_flag && para.input.efield_flag && !para.input.dip_cor_flag) - { - ModuleBase::WARNING_QUIT("ReadInput", - "gate field cannot be used with " - "efield if dip_cor_flag=false !"); - } - }; - read_sync_int(input.efield_dir); - this->add_item(item); - } - { - Input_Item item("efield_pos_max"); - item.annotation = "position of the maximum of the saw-like potential " - "along crystal axis efield_dir"; - read_sync_double(input.efield_pos_max); - this->add_item(item); - } - { - Input_Item item("efield_pos_dec"); - item.annotation = "zone in the unit cell where the saw-like potential decreases"; - read_sync_double(input.efield_pos_dec); - this->add_item(item); - } - { - Input_Item item("efield_amp"); - item.annotation = "amplitude of the electric field"; - read_sync_double(input.efield_amp); - this->add_item(item); - } - - // Gate field - { - Input_Item item("gate_flag"); - item.annotation = "compensating charge or not"; - read_sync_bool(input.gate_flag); - this->add_item(item); - } - { - Input_Item item("zgate"); - item.annotation = "position of charged plate"; - read_sync_double(input.zgate); - this->add_item(item); - } - - { - Input_Item item("block"); - item.annotation = "add a block potential or not"; - read_sync_bool(input.block); - this->add_item(item); - } - { - Input_Item item("block_down"); - item.annotation = "low bound of the block"; - read_sync_double(input.block_down); - this->add_item(item); - } - { - Input_Item item("block_up"); - item.annotation = "high bound of the block"; - read_sync_double(input.block_up); - this->add_item(item); - } - { - Input_Item item("block_height"); - item.annotation = "height of the block"; - read_sync_double(input.block_height); - this->add_item(item); - } - - // imlicit_solvation - { - Input_Item item("imp_sol"); - item.annotation = "calculate implicit solvation correction or not"; - read_sync_bool(input.imp_sol); - this->add_item(item); - } - { - Input_Item item("eb_k"); - item.annotation = "the relative permittivity of the bulk solvent"; - read_sync_double(input.eb_k); - this->add_item(item); - } - { - Input_Item item("tau"); - item.annotation = "the effective surface tension parameter"; - read_sync_double(input.tau); - this->add_item(item); - } - { - Input_Item item("sigma_k"); - item.annotation = "the width of the diffuse cavity"; - read_sync_double(input.sigma_k); - this->add_item(item); - } - { - Input_Item item("nc_k"); - item.annotation = "the cut-off charge density"; - read_sync_double(input.nc_k); - this->add_item(item); - } - - // vdW Correction - { - Input_Item item("vdw_method"); - item.annotation = "the method of calculating vdw (none ; d2 ; d3_0 ; d3_bj"; - read_sync_string(input.vdw_method); - this->add_item(item); - } - { - Input_Item item("vdw_s6"); - item.annotation = "scale parameter of d2/d3_0/d3_bj"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.vdw_s6 == "default") - { - if (para.input.vdw_method == "d2") - { - para.input.vdw_s6 = "0.75"; - } - // else if (para.input.vdw_method == "d3_0" || para.input.vdw_method == "d3_bj") - // { - // para.input.vdw_s6 = "1.0"; - // } - } - }; - read_sync_string(input.vdw_s6); - this->add_item(item); - } - { - Input_Item item("vdw_s8"); - item.annotation = "scale parameter of d3_0/d3_bj"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - // if (para.input.vdw_s8 == "default") - // { - // if (para.input.vdw_method == "d3_0") - // { - // para.input.vdw_s8 = "0.722"; - // } - // else if (para.input.vdw_method == "d3_bj") - // { - // para.input.vdw_s8 = "0.7875"; - // } - // } - }; - read_sync_string(input.vdw_s8); - this->add_item(item); - } - { - Input_Item item("vdw_a1"); - item.annotation = "damping parameter of d3_0/d3_bj"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - // if (para.input.vdw_a1 == "default") - // { - // if (para.input.vdw_method == "d3_0") - // { - // para.input.vdw_a1 = "1.217"; - // } - // else if (para.input.vdw_method == "d3_bj") - // { - // para.input.vdw_a1 = "0.4289"; - // } - // } - }; - read_sync_string(input.vdw_a1); - this->add_item(item); - } - { - Input_Item item("vdw_a2"); - item.annotation = "damping parameter of d3_bj"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - // if (para.input.vdw_a2 == "default") - // { - // if (para.input.vdw_method == "d3_0") - // { - // para.input.vdw_a2 = "1.0"; - // } - // else if (para.input.vdw_method == "d3_bj") - // { - // para.input.vdw_a2 = "4.4407"; - // } - // } - }; - read_sync_string(input.vdw_a2); - this->add_item(item); - } - { - Input_Item item("vdw_d"); - item.annotation = "damping parameter of d2"; - read_sync_double(input.vdw_d); - this->add_item(item); - } - { - Input_Item item("vdw_abc"); - item.annotation = "third-order term?"; - read_sync_bool(input.vdw_abc); - this->add_item(item); - } - { - Input_Item item("vdw_c6_file"); - item.annotation = "filename of C6"; - read_sync_string(input.vdw_C6_file); - this->add_item(item); - } - { - Input_Item item("vdw_c6_unit"); - item.annotation = "unit of C6, Jnm6/mol or eVA6"; - read_sync_string(input.vdw_C6_unit); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if ((para.input.vdw_C6_unit != "Jnm6/mol") && (para.input.vdw_C6_unit != "eVA6")) - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_C6_unit must be Jnm6/mol or eVA6"); - } - }; - this->add_item(item); - } - { - Input_Item item("vdw_r0_file"); - item.annotation = "filename of R0"; - read_sync_string(input.vdw_R0_file); - this->add_item(item); - } - { - Input_Item item("vdw_r0_unit"); - item.annotation = "unit of R0, A or Bohr"; - read_sync_string(input.vdw_R0_unit); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if ((para.input.vdw_R0_unit != "A") && (para.input.vdw_R0_unit != "Bohr")) - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_R0_unit must be A or Bohr"); - } - }; - this->add_item(item); - } - { - Input_Item item("vdw_cutoff_type"); - item.annotation = "expression model of periodic structure, radius or period"; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.vdw_cutoff_type != "radius" && para.input.vdw_cutoff_type != "period") - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_type must be radius or period"); - } - }; - read_sync_string(input.vdw_cutoff_type); - this->add_item(item); - } - { - Input_Item item("vdw_cutoff_radius"); - item.annotation = "radius cutoff for periodic structure"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.vdw_cutoff_radius == "default") - { - if (para.input.vdw_method == "d2") - { - para.input.vdw_cutoff_radius = "56.6918"; - } - else if (para.input.vdw_method == "d3_0" || para.input.vdw_method == "d3_bj") - { - para.input.vdw_cutoff_radius = "95"; - } - else - { - para.input.vdw_cutoff_radius = "0"; - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (std::stod(para.input.vdw_cutoff_radius) <= 0 && para.input.vdw_method != "none") - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_radius <= 0 is not allowd"); - } - }; - read_sync_string(input.vdw_cutoff_radius); - this->add_item(item); - } - { - Input_Item item("vdw_radius_unit"); - item.annotation = "unit of radius cutoff for periodic structure"; - read_sync_string(input.vdw_radius_unit); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if ((para.input.vdw_radius_unit != "A") && (para.input.vdw_radius_unit != "Bohr")) - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_radius_unit must be A or Bohr"); - } - }; - this->add_item(item); - } - { - Input_Item item("vdw_cn_thr"); - item.annotation = "radius cutoff for cn"; - read_sync_double(input.vdw_cn_thr); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.vdw_cn_thr <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_cn_thr <= 0 is not allowd"); - } - }; - this->add_item(item); - } - { - Input_Item item("vdw_cn_thr_unit"); - item.annotation = "unit of cn_thr, Bohr or Angstrom"; - read_sync_string(input.vdw_cn_thr_unit); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if ((para.input.vdw_cn_thr_unit != "A") && (para.input.vdw_cn_thr_unit != "Bohr")) - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_cn_thr_unit must be A or Bohr"); - } - }; - this->add_item(item); - } - { - Input_Item item("vdw_cutoff_period"); - item.annotation = "periods of periodic structure"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - if (count == 3) - { - para.input.vdw_cutoff_period[0] = std::stoi(item.str_values[0]); - para.input.vdw_cutoff_period[1] = std::stoi(item.str_values[1]); - para.input.vdw_cutoff_period[2] = std::stoi(item.str_values[2]); - } - else - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_period should have 3 values"); - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.vdw_cutoff_period[0] <= 0 || para.input.vdw_cutoff_period[1] <= 0 - || para.input.vdw_cutoff_period[2] <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "vdw_cutoff_period should be positive"); - } - }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - item.final_value << para.input.vdw_cutoff_period[0] << " " << para.input.vdw_cutoff_period[1] << " " - << para.input.vdw_cutoff_period[2]; - }; -#ifdef __MPI - bcastfuncs.push_back( - [](Parameter& para) { Parallel_Common::bcast_int((int*)¶.input.vdw_cutoff_period, 3); }); -#endif - this->add_item(item); - } -} -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/read_input_item_ofdft.cpp b/source/module_io/read_input_item_ofdft.cpp deleted file mode 100644 index 9f729d2793..0000000000 --- a/source/module_io/read_input_item_ofdft.cpp +++ /dev/null @@ -1,465 +0,0 @@ - -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -void ReadInput::item_ofdft() -{ - { - Input_Item item("of_kinetic"); - item.annotation = "kinetic energy functional, such as tf, vw, wt"; - item.check_value = [](const Input_Item& item, const Parameter& para) { -#ifndef __MLALGO - if (para.input.of_kinetic == "ml" || para.input.of_kinetic == "mpn" || para.input.of_kinetic == "cpn5") - { - ModuleBase::WARNING_QUIT("ReadInput", "ML KEDF is not supported."); - } -#endif - if (para.input.of_kinetic != "tf" && para.input.of_kinetic != "vw" && para.input.of_kinetic != "wt" - && para.input.of_kinetic != "lkt" && para.input.of_kinetic != "tf+" - && para.input.of_kinetic != "ml" && para.input.of_kinetic != "mpn" && para.input.of_kinetic != "cpn5") - { - ModuleBase::WARNING_QUIT("ReadInput", "of_kinetic must be tf, vw, tf+, wt, lkt, ml, mpn, or cpn5"); - } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - // Set the default parameters for MPN or CPN5 KEDF - if (para.input.of_kinetic == "mpn") - { - para.input.of_kinetic = "ml"; - - para.input.of_ml_feg = 3; - para.input.of_ml_nkernel = 1; - para.input.of_ml_kernel = {1}; - para.input.of_ml_kernel_scaling = {1.0}; - para.input.of_ml_yukawa_alpha = {1.0}; - para.input.of_ml_gamma = false; - para.input.of_ml_p = false; - para.input.of_ml_q = false; - para.input.of_ml_tanhp = true; - para.input.of_ml_tanhq = false; - para.input.of_ml_chi_p = 0.2; - para.input.of_ml_chi_q = 0.1; - para.input.of_ml_gammanl = {0}; - para.input.of_ml_pnl = {0}; - para.input.of_ml_qnl = {0}; - para.input.of_ml_xi = {0}; - para.input.of_ml_tanhxi = {1}; - para.input.of_ml_tanhxi_nl = {1}; - para.input.of_ml_tanh_pnl = {0}; - para.input.of_ml_tanh_qnl = {0}; - para.input.of_ml_tanhp_nl = {1}; - para.input.of_ml_tanhq_nl = {0}; - para.input.of_ml_chi_xi = {1.0}; - para.input.of_ml_chi_pnl = {0.2}; - para.input.of_ml_chi_qnl = {0.1}; - } - - if (para.input.of_kinetic == "cpn5") - { - para.input.of_kinetic = "ml"; - - para.input.of_ml_feg = 3; - para.input.of_ml_nkernel = 5; - para.input.of_ml_kernel = {1, 1, 1, 1, 1}; - para.input.of_ml_kernel_scaling = {2.0, 1.5, 1.0, 0.75, 0.5}; - para.input.of_ml_yukawa_alpha = {1.0, 1.0, 1.0, 1.0, 1.0}; - para.input.of_ml_gamma = false; - para.input.of_ml_p = false; - para.input.of_ml_q = false; - para.input.of_ml_tanhp = true; - para.input.of_ml_tanhq = false; - para.input.of_ml_chi_p = 0.2; - para.input.of_ml_chi_q = 0.1; - para.input.of_ml_gammanl = {0, 0, 0, 0, 0}; - para.input.of_ml_pnl = {0, 0, 0, 0, 0}; - para.input.of_ml_qnl = {0, 0, 0, 0, 0}; - para.input.of_ml_xi = {0, 0, 0, 0, 0}; - para.input.of_ml_tanhxi = {1, 1, 1, 1, 1}; - para.input.of_ml_tanhxi_nl = {1, 1, 1, 1, 1}; - para.input.of_ml_tanh_pnl = {0, 0, 0, 0, 0}; - para.input.of_ml_tanh_qnl = {0, 0, 0, 0, 0}; - para.input.of_ml_tanhp_nl = {1, 1, 1, 1, 1}; - para.input.of_ml_tanhq_nl = {0, 0, 0, 0, 0}; - para.input.of_ml_chi_xi = {0.6, 0.8, 1.0, 1.5, 3.0}; - para.input.of_ml_chi_pnl = {0.2, 0.2, 0.2, 0.2, 0.2}; - para.input.of_ml_chi_qnl = {0.1, 0.1, 0.1, 0.1, 0.1}; - } - }; - read_sync_string(input.of_kinetic); - this->add_item(item); - } - { - Input_Item item("of_method"); - item.annotation = "optimization method used in OFDFT, including cg1, " - "cg2, tn (default)"; - read_sync_string(input.of_method); - this->add_item(item); - } - { - Input_Item item("of_conv"); - item.annotation = "the convergence criterion, potential, energy (default), or both"; - read_sync_string(input.of_conv); - this->add_item(item); - } - { - Input_Item item("of_tole"); - item.annotation = "tolerance of the energy change (in Ry) for " - "determining the convergence, default=2e-6 Ry"; - read_sync_double(input.of_tole); - this->add_item(item); - } - { - Input_Item item("of_tolp"); - item.annotation = "tolerance of potential for determining the " - "convergence, default=1e-5 in a.u."; - read_sync_double(input.of_tolp); - this->add_item(item); - } - { - Input_Item item("of_tf_weight"); - item.annotation = "weight of TF KEDF"; - read_sync_double(input.of_tf_weight); - this->add_item(item); - } - { - Input_Item item("of_vw_weight"); - item.annotation = "weight of vW KEDF"; - read_sync_double(input.of_vw_weight); - this->add_item(item); - } - { - Input_Item item("of_wt_alpha"); - item.annotation = "parameter alpha of WT KEDF"; - read_sync_double(input.of_wt_alpha); - this->add_item(item); - } - { - Input_Item item("of_wt_beta"); - item.annotation = "parameter beta of WT KEDF"; - read_sync_double(input.of_wt_beta); - this->add_item(item); - } - { - Input_Item item("of_wt_rho0"); - item.annotation = "the average density of system, used in WT KEDF, in Bohr^-3"; - read_sync_double(input.of_wt_rho0); - this->add_item(item); - } - { - Input_Item item("of_hold_rho0"); - item.annotation = "If set to 1, the rho0 will be fixed even if the " - "volume of system has changed, it will be " - "set to 1 automaticly if of_wt_rho0 is not zero"; - read_sync_bool(input.of_hold_rho0); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.of_wt_rho0 != 0) - { - para.input.of_hold_rho0 = true; // sunliang add 2022-06-17 - } - }; - this->add_item(item); - } - { - Input_Item item("of_lkt_a"); - item.annotation = "parameter a of LKT KEDF"; - read_sync_double(input.of_lkt_a); - this->add_item(item); - } - { - Input_Item item("of_full_pw"); - item.annotation = "If set to 1, ecut will be ignored when collect " - "planewaves, so that all planewaves will be used"; - read_sync_bool(input.of_full_pw); - this->add_item(item); - } - { - Input_Item item("of_full_pw_dim"); - item.annotation = "If of_full_pw = true, dimention of FFT is " - "testricted to be (0) either odd or even; (1) odd " - "only; (2) even only"; - read_sync_int(input.of_full_pw_dim); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (!para.input.of_full_pw) - { - para.input.of_full_pw_dim = 0; // sunliang add 2022-08-31 - } - }; - this->add_item(item); - } - { - Input_Item item("of_read_kernel"); - item.annotation = "If set to 1, the kernel of WT KEDF will be filled " - "from file of_kernel_file, not from " - "formula. Only usable for WT KEDF"; - read_sync_bool(input.of_read_kernel); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.of_kinetic != "wt") - { - para.input.of_read_kernel = false; // sunliang add 2022-09-12 - } - }; - this->add_item(item); - } - { - Input_Item item("of_kernel_file"); - item.annotation = "The name of WT kernel file."; - read_sync_string(input.of_kernel_file); - this->add_item(item); - } - { - Input_Item item("of_ml_gene_data"); - item.annotation = "Generate training data or not"; - read_sync_bool(input.of_ml_gene_data); - this->add_item(item); - } - { - Input_Item item("of_ml_device"); - item.annotation = "Run NN on GPU or CPU"; - read_sync_string(input.of_ml_device); - this->add_item(item); - } - { - Input_Item item("of_ml_feg"); - item.annotation = "The Free Electron Gas limit: 0: no, 3: yes"; - read_sync_int(input.of_ml_feg); - this->add_item(item); - } - { - Input_Item item("of_ml_nkernel"); - item.annotation = "Number of kernels"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.of_ml_nkernel > 0) - { - reset_vector(para.input.of_ml_gammanl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_pnl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_qnl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_xi, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_tanhxi, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_tanhxi_nl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_tanh_pnl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_tanh_qnl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_tanhp_nl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_tanhq_nl, para.input.of_ml_nkernel, 0); - reset_vector(para.input.of_ml_chi_xi, para.input.of_ml_nkernel, 1.0); - reset_vector(para.input.of_ml_chi_pnl, para.input.of_ml_nkernel, 1.0); - reset_vector(para.input.of_ml_chi_qnl, para.input.of_ml_nkernel, 1.0); - reset_vector(para.input.of_ml_kernel, para.input.of_ml_nkernel, 1); - reset_vector(para.input.of_ml_kernel_scaling, para.input.of_ml_nkernel, 1.0); - reset_vector(para.input.of_ml_yukawa_alpha, para.input.of_ml_nkernel, 1.0); - std::string none = "none"; - reset_vector(para.input.of_ml_kernel_file, para.input.of_ml_nkernel, none); - } - }; - read_sync_int(input.of_ml_nkernel); - this->add_item(item); - } - { - Input_Item item("of_ml_kernel"); - item.annotation = "Type of kernel, 1 for wt, 2 for yukawa, and 3 for TKK"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_kernel); - }; - sync_intvec(input.of_ml_kernel, para.input.of_ml_kernel.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_kernel_scaling"); - item.annotation = "Scaling parameter of kernel, w(r-r') = scaling^3 * w(scaling (r-r'))"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_kernel_scaling); - }; - sync_doublevec(input.of_ml_kernel_scaling, para.input.of_ml_kernel_scaling.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_yukawa_alpha"); - item.annotation = "Parameter alpha of yukawa kernel"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_yukawa_alpha); - }; - sync_doublevec(input.of_ml_yukawa_alpha, para.input.of_ml_yukawa_alpha.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_kernel_file"); - item.annotation = "The file of TKK"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.of_ml_kernel_file.push_back(item.str_values[i]); - } - }; - sync_stringvec(input.of_ml_kernel_file, para.input.of_ml_kernel_file.size(), ""); - this->add_item(item); - } - { - Input_Item item("of_ml_gamma"); - item.annotation = "Descriptor: gamma = (rho / rho0)^(1/3)"; - read_sync_bool(input.of_ml_gamma); - this->add_item(item); - } - { - Input_Item item("of_ml_p"); - item.annotation = "Descriptor: p = |nabla rho|^2 / [2 (3 pi^2)^(1/3) rho^(4/3)]^2"; - read_sync_bool(input.of_ml_p); - this->add_item(item); - } - { - Input_Item item("of_ml_q"); - item.annotation = "Descriptor: q = nabla^2 rho / [4 (3 pi^2)^(2/3) rho^(5/3)]"; - read_sync_bool(input.of_ml_q); - this->add_item(item); - } - { - Input_Item item("of_ml_tanhp"); - item.annotation = "Descriptor: tanhp = tanh(chi_p * p)"; - read_sync_bool(input.of_ml_tanhp); - this->add_item(item); - } - { - Input_Item item("of_ml_tanhq"); - item.annotation = "Descriptor: tanhq = tanh(chi_q * q)"; - read_sync_bool(input.of_ml_tanhq); - this->add_item(item); - } - { - Input_Item item("of_ml_chi_p"); - item.annotation = "Hyperparameter: tanhp = tanh(chi_p * p)"; - read_sync_double(input.of_ml_chi_p); - this->add_item(item); - } - { - Input_Item item("of_ml_chi_q"); - item.annotation = "Hyperparameter: tanhq = tanh(chi_q * q)"; - read_sync_double(input.of_ml_chi_q); - this->add_item(item); - } - { - Input_Item item("of_ml_gammanl"); - item.annotation = "Descriptor: gammanl = int{gamma(r') * w(r-r') dr'}"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_gammanl); - }; - sync_intvec(input.of_ml_gammanl, para.input.of_ml_gammanl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_pnl"); - item.annotation = "Descriptor: pnl = int{p(r') * w(r-r') dr'}"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_pnl); - }; - sync_intvec(input.of_ml_pnl, para.input.of_ml_pnl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_qnl"); - item.annotation = "Descriptor: qnl = int{q(r') * w(r-r') dr'}"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_qnl); - }; - sync_intvec(input.of_ml_qnl, para.input.of_ml_qnl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_xi"); - item.annotation = "Descriptor: xi = int{rho(r')^(1/3) * w(r-r') dr'} / rho^(1/3)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_xi); - }; - sync_intvec(input.of_ml_xi, para.input.of_ml_xi.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_tanhxi"); - item.annotation = "Descriptor: tanhxi = tanh(chi_xi * xi)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_tanhxi); - }; - sync_intvec(input.of_ml_tanhxi, para.input.of_ml_tanhxi.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_tanhxi_nl"); - item.annotation = "Descriptor: tanhxi_nl = int{tanhxi(r') * w(r-r') dr'}"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_tanhxi_nl); - }; - sync_intvec(input.of_ml_tanhxi_nl, para.input.of_ml_tanhxi_nl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_tanh_pnl"); - item.annotation = "Descriptor: tanh_pnl = tanh(chi_pnl * pnl)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_tanh_pnl); - }; - sync_intvec(input.of_ml_tanh_pnl, para.input.of_ml_tanh_pnl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_tanh_qnl"); - item.annotation = "Descriptor: tanh_qnl = tanh(chi_qnl * qnl)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_tanh_qnl); - }; - sync_intvec(input.of_ml_tanh_qnl, para.input.of_ml_tanh_qnl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_tanhp_nl"); - item.annotation = "Descriptor: tanhp_nl = int{tanhp(r') * w(r-r') dr'}"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_tanhp_nl); - }; - sync_intvec(input.of_ml_tanhp_nl, para.input.of_ml_tanhp_nl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_tanhq_nl"); - item.annotation = "Descriptor: tanhq_nl = int{tanhq(r') * w(r-r') dr'}"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_tanhq_nl); - }; - sync_intvec(input.of_ml_tanhq_nl, para.input.of_ml_tanhq_nl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_chi_xi"); - item.annotation = "Hyperparameter: tanhpxi = tanh(chi_xi * xi)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_chi_xi); - }; - sync_doublevec(input.of_ml_chi_xi, para.input.of_ml_chi_xi.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_chi_pnl"); - item.annotation = "Hyperparameter: tanh_pnl = tanh(chi_pnl * pnl)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_chi_pnl); - }; - sync_doublevec(input.of_ml_chi_pnl, para.input.of_ml_chi_pnl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_chi_qnl"); - item.annotation = "Hyperparameter: tanh_qnl = tanh(chi_qnl * qnl)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.of_ml_chi_qnl); - }; - sync_doublevec(input.of_ml_chi_qnl, para.input.of_ml_chi_qnl.size(), 0); - this->add_item(item); - } - { - Input_Item item("of_ml_local_test"); - item.annotation = "Test: read in the density, and output the F and Pauli potential"; - read_sync_bool(input.of_ml_local_test); - this->add_item(item); - } -} -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/read_input_item_other.cpp b/source/module_io/read_input_item_other.cpp deleted file mode 100644 index 5694c7b33b..0000000000 --- a/source/module_io/read_input_item_other.cpp +++ /dev/null @@ -1,550 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" - -#include -#include -#include - -namespace ModuleIO -{ -void ReadInput::item_others() -{ - // non-collinear spin-constrained - { - Input_Item item("sc_mag_switch"); - item.annotation = "switch to control spin-constrained DFT"; - read_sync_bool(input.sc_mag_switch); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.sc_mag_switch) - { - ModuleBase::WARNING_QUIT("ReadInput", - "This feature is not stable yet and might lead to " - "erroneous results.\n" - " Please wait for the official release version."); - // if (para.input.nspin != 4 && para.input.nspin != 2) - // { - // ModuleBase::WARNING_QUIT("ReadInput", "nspin must be 2 or - // 4 when sc_mag_switch > 0"); - // } - // if (para.input.calculation != "scf") - // { - // ModuleBase::WARNING_QUIT("ReadInput", "calculation must - // be scf when sc_mag_switch > 0"); - // } - // if (para.input.nupdown > 0.0) - // { - // ModuleBase::WARNING_QUIT("ReadInput", "nupdown should not - // be set when sc_mag_switch > 0"); - // } - } - }; - this->add_item(item); - } - { - Input_Item item("decay_grad_switch"); - item.annotation = "switch to control gradient break condition"; - read_sync_bool(input.decay_grad_switch); - this->add_item(item); - } - { - Input_Item item("sc_thr"); - item.annotation = "Convergence criterion of spin-constrained iteration (RMS) in uB"; - read_sync_double(input.sc_thr); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.sc_thr < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "sc_thr must >= 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("nsc"); - item.annotation = "Maximal number of spin-constrained iteration"; - read_sync_int(input.nsc); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nsc <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nsc must > 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("nsc_min"); - item.annotation = "Minimum number of spin-constrained iteration"; - read_sync_int(input.nsc_min); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nsc_min <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nsc_min must > 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("sc_scf_nmin"); - item.annotation = "Minimum number of outer scf loop before " - "initializing lambda loop"; - read_sync_int(input.sc_scf_nmin); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.sc_scf_nmin < 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "sc_scf_nmin must >= 2"); - } - }; - this->add_item(item); - } - { - Input_Item item("alpha_trial"); - item.annotation = "Initial trial step size for lambda in eV/uB^2"; - read_sync_double(input.alpha_trial); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.alpha_trial <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "alpha_trial must > 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("sccut"); - item.annotation = "Maximal step size for lambda in eV/uB"; - read_sync_double(input.sccut); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.sccut <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "sccut must > 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("sc_drop_thr"); - item.annotation = "Convergence criterion ratio of lambda iteration in Spin-constrained DFT"; - read_sync_double(input.sc_drop_thr); - this->add_item(item); - } - { - Input_Item item("sc_scf_thr"); - item.annotation = "Density error threshold for inner loop of spin-constrained SCF"; - read_sync_double(input.sc_scf_thr); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.sc_scf_thr <= 0.0) - { - ModuleBase::WARNING_QUIT("ReadInput", "sc_scf_thr must > 0.0"); - } - }; - this->add_item(item); - } - - // Quasiatomic Orbital analysis - { - Input_Item item("qo_switch"); - item.annotation = "switch to control quasiatomic orbital analysis"; - read_sync_bool(input.qo_switch); - this->add_item(item); - } - { - Input_Item item("qo_basis"); - item.annotation = "type of QO basis function: hydrogen: hydrogen-like " - "basis, pswfc: read basis from pseudopotential"; - read_sync_string(input.qo_basis); - this->add_item(item); - } - { - Input_Item item("qo_thr"); - item.annotation = "accuracy for evaluating cutoff radius of QO basis function"; - read_sync_double(input.qo_thr); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.qo_thr > 1e-6) - { - ModuleBase::WARNING("ReadInput", - "too high the convergence threshold might " - "yield unacceptable result"); - } - }; - this->add_item(item); - } - { - Input_Item item("qo_strategy"); - item.annotation = "strategy to generate generate radial orbitals"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.qo_strategy.push_back(item.str_values[i]); - } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.qo_strategy.size() != para.input.ntype) - { - if (para.input.qo_strategy.size() == 1) - { - para.input.qo_strategy.resize(para.input.ntype, para.input.qo_strategy[0]); - } - else - { - std::string default_strategy; - if (para.input.qo_basis == "hydrogen") - { - default_strategy = "energy-valence"; - } - else if ((para.input.qo_basis == "pswfc") || (para.input.qo_basis == "szv")) - { - default_strategy = "all"; - } - else - { - ModuleBase::WARNING_QUIT("ReadInput", - "When setting default values for qo_strategy, " - "unexpected/unknown " - "qo_basis is found. Please check it."); - } - para.input.qo_strategy.resize(para.input.ntype, default_strategy); - } - } - }; - sync_stringvec(input.qo_strategy, para.input.ntype, "all"); - this->add_item(item); - } - { - Input_Item item("qo_screening_coeff"); - item.annotation = "rescale the shape of radial orbitals"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.qo_screening_coeff.push_back(std::stod(item.str_values[i])); - } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (!item.is_read()) - { - return; - } - if (para.input.qo_screening_coeff.size() != para.input.ntype) - { - if (para.input.qo_basis == "pswfc") - { - double default_screening_coeff - = (para.input.qo_screening_coeff.size() == 1) ? para.input.qo_screening_coeff[0] : 0.1; - para.input.qo_screening_coeff.resize(para.input.ntype, default_screening_coeff); - } - else - { - ModuleBase::WARNING_QUIT("ReadInput", - "qo_screening_coeff should have the same number of " - "elements as ntype"); - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - for (auto screen_coeff: para.input.qo_screening_coeff) - { - if (screen_coeff < 0) - { - ModuleBase::WARNING_QUIT("ReadInput", - "screening coefficient must >= 0 " - "to tune the pswfc decay"); - } - if (std::fabs(screen_coeff) < 1e-6) - { - ModuleBase::WARNING_QUIT("ReadInput", - "every low screening coefficient might yield very high " - "computational cost"); - } - } - }; - sync_doublevec(input.qo_screening_coeff, para.input.ntype, 0.1); - this->add_item(item); - } - - // PEXSI - { - Input_Item item("pexsi_npole"); - item.annotation = "Number of poles in expansion"; - read_sync_int(input.pexsi_npole); - this->add_item(item); - } - { - Input_Item item("pexsi_inertia"); - item.annotation = "Whether inertia counting is used at the very " - "beginning of PEXSI process"; - read_sync_bool(input.pexsi_inertia); - this->add_item(item); - } - { - Input_Item item("pexsi_nmax"); - item.annotation = "Maximum number of PEXSI iterations after each " - "inertia counting procedure"; - read_sync_int(input.pexsi_nmax); - this->add_item(item); - } - { - Input_Item item("pexsi_comm"); - item.annotation = "Whether to construct PSelInv communication pattern"; - read_sync_bool(input.pexsi_comm); - this->add_item(item); - } - { - Input_Item item("pexsi_storage"); - item.annotation = "Storage space used by the Selected Inversion " - "algorithm for symmetric matrices"; - read_sync_bool(input.pexsi_storage); - this->add_item(item); - } - { - Input_Item item("pexsi_ordering"); - item.annotation = "Ordering strategy for factorization and selected inversion"; - read_sync_int(input.pexsi_ordering); - this->add_item(item); - } - { - Input_Item item("pexsi_row_ordering"); - item.annotation = "Row permutation strategy for factorization and " - "selected inversion, 0: NoRowPerm, 1: LargeDiag"; - read_sync_int(input.pexsi_row_ordering); - this->add_item(item); - } - { - Input_Item item("pexsi_nproc"); - item.annotation = "Number of processors for parmetis"; - read_sync_int(input.pexsi_nproc); - this->add_item(item); - } - { - Input_Item item("pexsi_symm"); - item.annotation = "Matrix symmetry"; - read_sync_bool(input.pexsi_symm); - this->add_item(item); - } - { - Input_Item item("pexsi_trans"); - item.annotation = "Whether to transpose"; - read_sync_bool(input.pexsi_trans); - this->add_item(item); - } - { - Input_Item item("pexsi_method"); - item.annotation = "pole expansion method, 1: Cauchy Contour Integral, " - "2: Moussa optimized method"; - read_sync_int(input.pexsi_method); - this->add_item(item); - } - { - Input_Item item("pexsi_nproc_pole"); - item.annotation = "Number of processes used by each pole"; - read_sync_int(input.pexsi_nproc_pole); - this->add_item(item); - } - { - Input_Item item("pexsi_temp"); - item.annotation = "Temperature, in the same unit as H"; - read_sync_double(input.pexsi_temp); - this->add_item(item); - } - { - Input_Item item("pexsi_gap"); - item.annotation = "Spectral gap"; - read_sync_double(input.pexsi_gap); - this->add_item(item); - } - { - Input_Item item("pexsi_delta_e"); - item.annotation = "An upper bound for the spectral radius of S^{-1} H"; - read_sync_double(input.pexsi_delta_e); - this->add_item(item); - } - { - Input_Item item("pexsi_mu_lower"); - item.annotation = "Initial guess of lower bound for mu"; - read_sync_double(input.pexsi_mu_lower); - this->add_item(item); - } - { - Input_Item item("pexsi_mu_upper"); - item.annotation = "Initial guess of upper bound for mu"; - read_sync_double(input.pexsi_mu_upper); - this->add_item(item); - } - { - Input_Item item("pexsi_mu"); - item.annotation = "Initial guess for mu (for the solver)"; - read_sync_double(input.pexsi_mu); - this->add_item(item); - } - { - Input_Item item("pexsi_mu_thr"); - item.annotation = "Stopping criterion in terms of the chemical " - "potential for the inertia counting procedure"; - read_sync_double(input.pexsi_mu_thr); - this->add_item(item); - } - { - Input_Item item("pexsi_mu_expand"); - item.annotation = "If the chemical potential is not in the initial " - "interval, the interval is expanded by " - "muInertiaExpansion"; - read_sync_double(input.pexsi_mu_expand); - this->add_item(item); - } - { - Input_Item item("pexsi_mu_guard"); - item.annotation = "Safe guard criterion in terms of the chemical potential to " - "reinvoke the inertia counting procedure"; - read_sync_double(input.pexsi_mu_guard); - this->add_item(item); - } - { - Input_Item item("pexsi_elec_thr"); - item.annotation = "Stopping criterion of the PEXSI iteration in terms " - "of the number of electrons compared to " - "numElectronExact"; - read_sync_double(input.pexsi_elec_thr); - this->add_item(item); - } - { - Input_Item item("pexsi_zero_thr"); - item.annotation = "if the absolute value of matrix element is less " - "than ZERO_Limit, it will be considered as 0"; - read_sync_double(input.pexsi_zero_thr); - this->add_item(item); - } - - // Only for Test - { - Input_Item item("out_alllog"); - item.annotation = "output information for each processor, when parallel"; - read_sync_bool(input.out_alllog); - this->add_item(item); - } - { - Input_Item item("nurse"); - item.annotation = "for coders"; - read_sync_int(input.nurse); - this->add_item(item); - } - { - Input_Item item("t_in_h"); - item.annotation = "calculate the kinetic energy or not"; - read_sync_bool(input.t_in_h); - this->add_item(item); - } - { - Input_Item item("vl_in_h"); - item.annotation = "calculate the local potential or not"; - read_sync_bool(input.vl_in_h); - this->add_item(item); - } - { - Input_Item item("vnl_in_h"); - item.annotation = "calculate the nonlocal potential or not"; - read_sync_bool(input.vnl_in_h); - this->add_item(item); - } - { - Input_Item item("vh_in_h"); - item.annotation = "calculate the hartree potential or not"; - read_sync_bool(input.vh_in_h); - this->add_item(item); - } - { - Input_Item item("vion_in_h"); - item.annotation = "calculate the local ionic potential or not"; - read_sync_bool(input.vion_in_h); - this->add_item(item); - } - { - Input_Item item("test_force"); - item.annotation = "test the force"; - read_sync_bool(input.test_force); - this->add_item(item); - } - { - Input_Item item("test_stress"); - item.annotation = "test the stress"; - read_sync_bool(input.test_stress); - this->add_item(item); - } - { - Input_Item item("test_skip_ewald"); - item.annotation = "whether to skip ewald"; - read_sync_bool(input.test_skip_ewald); - this->add_item(item); - } - { - Input_Item item("ri_hartree_benchmark"); - item.annotation = "whether to use the RI approximation for the Hartree term in LR-TDDFT for benchmark (with FHI-aims/ABACUS read-in style)"; - read_sync_string(input.ri_hartree_benchmark); - this->add_item(item); - } - { - Input_Item item("aims_nbasis"); - item.annotation = "the number of basis functions for each atom type used in FHI-aims (for benchmark)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.aims_nbasis.push_back(std::stod(item.str_values[i])); - } - }; - sync_intvec(input.aims_nbasis, para.input.aims_nbasis.size(), 0); - this->add_item(item); - } - - // RDMFT, added by jghan, 2024-10-16 - { - Input_Item item("rdmft"); - item.annotation = "whether to perform rdmft calculation, default is false"; - read_sync_bool(input.rdmft); - this->add_item(item); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.rdmft && para.input.nspin == 4) - { - ModuleBase::WARNING_QUIT("ReadInput", "rdmft is not available for nspin = 4"); - } - }; - } - { - Input_Item item("rdmft_power_alpha"); - item.annotation = "the alpha parameter of power-functional, g(occ_number) = occ_number^alpha" - " used in exx-type functionals such as muller and power"; - read_sync_double(input.rdmft_power_alpha); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if( para.input.dft_functional == "hf" || para.input.dft_functional == "pbe0" ) - { - para.input.rdmft_power_alpha = 1.0; - } - else if( para.input.dft_functional == "muller" ) - { - para.input.rdmft_power_alpha = 0.5; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if( (para.input.rdmft_power_alpha < 0) || (para.input.rdmft_power_alpha > 1) ) - { - ModuleBase::WARNING_QUIT("ReadInput", "rdmft_power_alpha should be greater than 0.0 and less than 1.0"); - } - }; - this->add_item(item); - } - - // EXX PW by rhx0820, 2025-03-10 - { - Input_Item item("exxace"); - item.annotation = "whether to perform ace calculation in exxpw"; - read_sync_bool(input.exxace); - this->add_item(item); - } - { - Input_Item item("exx_gamma_extrapolation"); - item.annotation = "whether to perform gamma extrapolation in exxpw"; - read_sync_bool(input.exx_gamma_extrapolation); - this->add_item(item); - } - -} -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/read_input_item_output.cpp b/source/module_io/read_input_item_output.cpp deleted file mode 100644 index cc817c5354..0000000000 --- a/source/module_io/read_input_item_output.cpp +++ /dev/null @@ -1,550 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -void ReadInput::item_output() -{ - { - Input_Item item("out_stru"); - item.annotation = "output the structure files after each ion step"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - const std::vector offlist = {"nscf", "get_s", "get_pchg", "get_wf"}; - if (std::find(offlist.begin(), offlist.end(), para.input.calculation) != offlist.end()) - { - para.input.out_stru = false; - } - }; - read_sync_bool(input.out_stru); - this->add_item(item); - } - { - Input_Item item("out_freq_elec"); - item.annotation = "the frequency of electronic iter to output charge density and wavefunction "; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.out_freq_elec <= 0) - { - para.input.out_freq_elec = para.input.scf_nmax; - } - }; - read_sync_int(input.out_freq_elec); - this->add_item(item); - } - { - Input_Item item("out_freq_ion"); - item.annotation = "the frequency ( >= 0 ) of ionic step to output " - "charge density and wavefunction. 0: output " - "only when ion steps are finished"; - read_sync_int(input.out_freq_ion); - this->add_item(item); - } - { - Input_Item item("out_chg"); - item.annotation = "> 0 output charge density for selected electron steps" - ", second parameter controls the precision, default is 3."; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_chg should have 1 or 2 values"); - } - para.input.out_chg[0] = (item.str_values[0] == "-1") ? -1 : std::stoi(item.str_values[0]); - para.input.out_chg[1] = (count == 2) ? std::stoi(item.str_values[1]) : 3; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - para.input.out_chg[0] = (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") - ? 1 - : para.input.out_chg[0]; - }; - sync_intvec(input.out_chg, 2, 0); - this->add_item(item); - } - { - Input_Item item("out_pot"); - item.annotation = "output realspace potential"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") - { - para.input.out_pot = 0; - } - }; - read_sync_int(input.out_pot); - this->add_item(item); - } - { - Input_Item item("out_wfc_pw"); - item.annotation = "output wave functions"; - read_sync_int(input.out_wfc_pw); - this->add_item(item); - } - { - Input_Item item("out_band"); - item.annotation = "output energy and band structure (with precision 8)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_band should have 1 or 2 values"); - } - para.input.out_band[0] = assume_as_boolean(item.str_values[0]); - para.input.out_band[1] = (count == 2) ? std::stoi(item.str_values[1]) : 8; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") - { - para.input.out_band[0] = 0; - } - }; - sync_intvec(input.out_band, 2, 0); - this->add_item(item); - } - { - Input_Item item("out_dos"); - item.annotation = "output energy and dos"; - read_sync_int(input.out_dos); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") - { - para.input.out_dos = 0; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_dos == 3 && para.input.symmetry == "1") - { - ModuleBase::WARNING_QUIT("ReadInput", - "symmetry can't be used for out_dos==3(Fermi Surface " - "Plotting) by now."); - } - if (para.input.basis_type == "pw" && para.input.out_dos == 3) - { - ModuleBase::WARNING_QUIT("ReadInput", - "Fermi Surface Plotting not " - "implemented for plane wave now."); - } - }; - this->add_item(item); - } - { - Input_Item item("out_ldos"); - item.annotation = "output mode of local density of states, second parameter controls the precision"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_ldos should have 1 or 2 values"); - } - para.input.out_ldos[0] = std::stoi(item.str_values[0]); - para.input.out_ldos[1] = (count == 2) ? std::stoi(item.str_values[1]) : 3; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_ldos[0] < 0 || para.input.out_ldos[0] > 3) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_ldos should be 0, 1, 2 or 3"); - } - }; - sync_intvec(input.out_ldos, 2, 0); - this->add_item(item); - } - { - Input_Item item("out_mul"); - item.annotation = "mulliken charge or not"; - read_sync_bool(input.out_mul); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.basis_type == "pw" && para.input.out_mul) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mul is only for lcao"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_proj_band"); - item.annotation = "output projected band structure"; - read_sync_bool(input.out_proj_band); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") - { - para.input.out_proj_band = false; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.basis_type == "pw" && para.input.out_proj_band) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_proj_band is only for lcao"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_level"); - item.annotation = "ie(for electrons); i(for ions);"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.out_level = strvalue; - para.sys.out_md_control = true; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (!para.sys.out_md_control && para.input.calculation == "md") - { - para.input.out_level = "m"; // zhengdy add 2019-04-07 - } - }; - sync_string(input.out_level); - add_bool_bcast(sys.out_md_control); - this->add_item(item); - } - { - Input_Item item("out_dmk"); - item.annotation = ">0 output density matrix DM(k) for each k-point"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_pchg" || para.input.calculation == "get_wf") - { - para.input.out_dmk = false; - } - }; - read_sync_bool(input.out_dmk); - this->add_item(item); - } - { - Input_Item item("out_dmr"); - item.annotation = ">0 output density matrix DM(R) with respect to lattice vector R"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_pchg" || para.input.calculation == "get_wf") - { - para.input.out_dmr = false; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.sys.gamma_only_local == true && para.input.out_dmr) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_dmr is only valid for multi-k calculation"); - } - }; - read_sync_bool(input.out_dmr); - this->add_item(item); - } - { - Input_Item item("out_bandgap"); - item.annotation = "if true, print out bandgap"; - read_sync_bool(input.out_bandgap); - this->add_item(item); - } - { - Input_Item item("out_mat_hs"); - item.annotation = "output H and S matrix (with precision 8)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mat_hs should have 1 or 2 values"); - } - para.input.out_mat_hs[0] = assume_as_boolean(item.str_values[0]); - para.input.out_mat_hs[1] = (count == 2) ? std::stoi(item.str_values[1]) : 8; - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.qo_switch) - { - para.input.out_mat_hs[0] = 1; // print H(k) and S(k) - } - }; - sync_intvec(input.out_mat_hs, 2, 0); - this->add_item(item); - } - { - Input_Item item("out_mat_tk"); - item.annotation = "output T(k)"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mat_tk should have 1 or 2 values"); - } - para.input.out_mat_tk[0] = assume_as_boolean(item.str_values[0]); - para.input.out_mat_tk[1] = (count == 2) ? std::stoi(item.str_values[1]) : 8; - }; - sync_intvec(input.out_mat_tk, 2, 0); - this->add_item(item); - } - { - Input_Item item("out_mat_hs2"); - item.annotation = "output H(R) and S(R) matrix"; - read_sync_bool(input.out_mat_hs2); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_mat_r && para.sys.gamma_only_local) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mat_r is not available for gamma only calculations"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_mat_l"); - item.annotation = "output the expectation values of angular momentum operators"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mat_l should have 1 or 2 values"); - } - para.input.out_mat_l[0] = assume_as_boolean(item.str_values[0]); - para.input.out_mat_l[1] = (count == 2) ? std::stoi(item.str_values[1]) : 8; - }; - sync_intvec(input.out_mat_l, 2, 0); - this->add_item(item); - } - { - Input_Item item("out_mat_dh"); - item.annotation = "output of derivative of H(R) matrix"; - read_sync_bool(input.out_mat_dh); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_mat_dh && para.input.nspin == 4) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mat_dh is not available for nspin = 4"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_mat_ds"); - item.annotation = "output of derivative of S(R) matrix"; - read_sync_bool(input.out_mat_ds); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_mat_ds && para.input.nspin == 4) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_mat_ds is not available for nspin = 4"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_mat_xc"); - item.annotation = "output exchange-correlation matrix in KS-orbital representation"; - read_sync_bool(input.out_mat_xc); - this->add_item(item); - } - { - Input_Item item("out_mat_xc2"); - item.annotation = "output exchange-correlation matrix in NAO representation"; - read_sync_bool(input.out_mat_xc2); - this->add_item(item); - } - { - Input_Item item("out_eband_terms"); - item.annotation = "output the band energy terms separately"; - read_sync_bool(input.out_eband_terms); - this->add_item(item); - } - { - Input_Item item("out_interval"); - item.annotation = "interval for printing H(R) and S(R) matrix during MD"; - read_sync_int(input.out_interval); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_interval <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_interval should be larger than 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_app_flag"); - item.annotation = "whether output r(R), H(R), S(R), T(R), and dH(R) " - "matrices in an append manner during MD"; - read_sync_bool(input.out_app_flag); - this->add_item(item); - } - { - Input_Item item("out_ndigits"); - item.annotation = "the length of decimal part of output data"; - read_sync_int(input.out_ndigits); - this->add_item(item); - } - { - Input_Item item("out_mat_t"); - item.annotation = "output T(R) matrix"; - read_sync_bool(input.out_mat_t); - this->add_item(item); - } - { - Input_Item item("out_element_info"); - item.annotation = "output (projected) wavefunction of each element"; - read_sync_bool(input.out_element_info); - this->add_item(item); - } - { - Input_Item item("out_mat_r"); - item.annotation = "output r(R) matrix"; - read_sync_bool(input.out_mat_r); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if ((para.inp.out_mat_r || para.inp.out_mat_hs2 || para.inp.out_mat_t || para.inp.out_mat_dh - || para.inp.dm_to_rho) - && para.sys.gamma_only_local) - { - ModuleBase::WARNING_QUIT("ReadInput", - "output of r(R)/H(R)/S(R)/T(R)/dH(R)/DM(R) is not " - "available for gamma only calculations"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_wfc_lcao"); - item.annotation = "ouput LCAO wave functions, 0, no output 1: text, 2: binary"; - read_sync_int(input.out_wfc_lcao); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.qo_switch) - { - para.input.out_wfc_lcao = 1; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_wfc_lcao < 0 || para.input.out_wfc_lcao > 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_wfc_lcao should be 0, 1, or 2"); - } - if (para.input.basis_type != "lcao" && para.input.out_wfc_lcao != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "out_wfc_lcao is only available for basis_type = lcao"); - } - }; - this->add_item(item); - } - { - Input_Item item("out_dipole"); - item.annotation = "output dipole or not"; - read_sync_bool(input.out_dipole); - this->add_item(item); - } - { - Input_Item item("out_efield"); - item.annotation = "output dipole or not"; - read_sync_bool(input.out_efield); - this->add_item(item); - } - { - Input_Item item("out_current"); - item.annotation = "output current or not"; - read_sync_bool(input.out_current); - this->add_item(item); - } - { - Input_Item item("out_current_k"); - item.annotation = "output current for each k"; - read_sync_bool(input.out_current_k); - this->add_item(item); - } - { - Input_Item item("out_vecpot"); - item.annotation = "output TDDFT vector potential or not"; - read_sync_bool(input.out_vecpot); - this->add_item(item); - } - { - Input_Item item("restart_save"); - item.annotation = "print to disk every step for restart"; - read_sync_bool(input.restart_save); - this->add_item(item); - } - { - Input_Item item("rpa"); - item.annotation = "true:generate output files used in rpa calculation; " - "false:(default)"; - read_sync_bool(input.rpa); - this->add_item(item); - } - { - Input_Item item("out_pchg"); - item.annotation = "specify the bands to be calculated for the partial (band-decomposed) charge densities"; - item.read_value - = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.out_pchg); }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - if (item.is_read()) - { - item.final_value.str(longstring(item.str_values)); - } - }; - add_intvec_bcast(input.out_pchg, para.input.out_pchg.size(), 0); - this->add_item(item); - } - { - Input_Item item("out_wfc_norm"); - item.annotation = "specify the bands to be calculated for the norm of wavefunctions"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.out_wfc_norm); - }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - if (item.is_read()) - { - item.final_value.str(longstring(item.str_values)); - } - }; - add_intvec_bcast(input.out_wfc_norm, para.input.out_wfc_norm.size(), 0); - this->add_item(item); - } - { - Input_Item item("out_wfc_re_im"); - item.annotation = "specify the bands to be calculated for the real and imaginary parts of wavefunctions"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.out_wfc_re_im); - }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - if (item.is_read()) - { - item.final_value.str(longstring(item.str_values)); - } - }; - add_intvec_bcast(input.out_wfc_re_im, para.input.out_wfc_re_im.size(), 0); - this->add_item(item); - } - { - Input_Item item("out_xc_r"); - item.annotation = "if >=0, output the derivatives of exchange correlation in realspace, second parameter controls the precision"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - std::vector out_xc_r(count); // create a placeholder vector - std::transform(item.str_values.begin(), item.str_values.end(), out_xc_r.begin(), [](std::string s) { return std::stoi(s); }); - // assign non-negative values to para.input.out_xc_r - std::copy(out_xc_r.begin(), out_xc_r.end(), para.input.out_xc_r.begin()); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_xc_r[0] >= 0) - { -#ifndef USE_LIBXC - ModuleBase::WARNING_QUIT("ReadInput", "INPUT out_xc_r is only aviailable with Libxc"); -#endif - } - }; - sync_intvec(input.out_xc_r, 2, -1); - this->add_item(item); - } - { - Input_Item item("if_separate_k"); - item.annotation = "specify whether to write the partial charge densities for all k-points to individual files " - "or merge them"; - read_sync_bool(input.if_separate_k); - this->add_item(item); - } - { - Input_Item item("out_elf"); - item.annotation = "> 0 output electron localization function (ELF) for selected electron steps" - ", second parameter controls the precision, default is 3."; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - std::vector out_elf(count); // create a placeholder vector - std::transform(item.str_values.begin(), item.str_values.end(), out_elf.begin(), [](std::string s) { - return std::stoi(s); - }); - // assign non-negative values to para.input.out_elf - std::copy(out_elf.begin(), out_elf.end(), para.input.out_elf.begin()); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_elf[0] > 0 && para.input.esolver_type != "ksdft" && para.input.esolver_type != "ofdft") - { - ModuleBase::WARNING_QUIT("ReadInput", "ELF is only aviailable for ksdft and ofdft"); - } - }; - sync_intvec(input.out_elf, 2, 0); - this->add_item(item); - } -} -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_postprocess.cpp b/source/module_io/read_input_item_postprocess.cpp deleted file mode 100644 index f2ef9bd73b..0000000000 --- a/source/module_io/read_input_item_postprocess.cpp +++ /dev/null @@ -1,293 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -void ReadInput::item_postprocess() -{ - // DOS - { - Input_Item item("dos_emin_ev"); - item.annotation = "minimal range for dos"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.dos_emin_ev = doublevalue; - para.sys.dos_setemin = true; - }; - sync_double(input.dos_emin_ev); - add_bool_bcast(sys.dos_setemin); - this->add_item(item); - } - { - Input_Item item("dos_emax_ev"); - item.annotation = "maximal range for dos"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.dos_emax_ev = doublevalue; - para.sys.dos_setemax = true; - }; - sync_double(input.dos_emax_ev); - add_bool_bcast(sys.dos_setemax); - this->add_item(item); - } - { - Input_Item item("dos_edelta_ev"); - item.annotation = "delta energy for dos"; - read_sync_double(input.dos_edelta_ev); - this->add_item(item); - } - { - Input_Item item("dos_scale"); - item.annotation = "scale dos range by"; - read_sync_double(input.dos_scale); - this->add_item(item); - } - { - Input_Item item("dos_sigma"); - item.annotation = "gauss b coefficeinet(default=0.07)"; - read_sync_double(input.dos_sigma); - this->add_item(item); - } - { - Input_Item item("dos_nche"); - item.annotation = "orders of Chebyshev expansions for dos"; - read_sync_int(input.dos_nche); - this->add_item(item); - } - { - Input_Item item("stm_bias"); - item.annotation = "bias voltage used to calculate ldos"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 1 && count != 3) - { - ModuleBase::WARNING_QUIT("ReadInput", "stm_bias should have 1 or 3 values"); - } - para.input.stm_bias[0] = std::stod(item.str_values[0]); - para.input.stm_bias[1] = (count == 3) ? std::stod(item.str_values[1]) : 0.1; - para.input.stm_bias[2] = (count == 3) ? std::stod(item.str_values[2]) : 1; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.stm_bias[2] <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "stm_bias[2] should be greater than 0"); - } - if (para.input.stm_bias[1] == 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "stm_bias[1] should be nonzero"); - } - }; - sync_doublevec(input.stm_bias, 3, 0); - this->add_item(item); - } - { - Input_Item item("ldos_line"); - item.annotation = "start and end point of the line (direct coordinates) and number of points"; - item.read_value = [](const Input_Item& item, Parameter& para) { - const size_t count = item.get_size(); - if (count != 6 && count != 7) - { - ModuleBase::WARNING_QUIT("ReadInput", "ldos_line should have 6 or 7 values"); - } - for (int i = 0; i < 6; ++i) - { - para.input.ldos_line[i] = std::stod(item.str_values[i]); - } - para.input.ldos_line[6] = (count == 7) ? std::stoi(item.str_values[6]) : 100; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.ldos_line[6] <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "ldos_line[6] should be greater than 0"); - } - }; - sync_doublevec(input.ldos_line, 7, 0); - this->add_item(item); - } - - // Electronic Conductivity - { - Input_Item item("cal_cond"); - item.annotation = "calculate electronic conductivities"; - read_sync_bool(input.cal_cond); - this->add_item(item); - } - { - Input_Item item("cond_che_thr"); - item.annotation = "control the error of Chebyshev expansions for conductivities"; - read_sync_double(input.cond_che_thr); - this->add_item(item); - } - { - Input_Item item("cond_dw"); - item.annotation = "frequency interval for conductivities"; - read_sync_double(input.cond_dw); - this->add_item(item); - } - { - Input_Item item("cond_wcut"); - item.annotation = "cutoff frequency (omega) for conductivities"; - read_sync_double(input.cond_wcut); - this->add_item(item); - } - { - Input_Item item("cond_dt"); - item.annotation = "t interval to integrate Onsager coefficiencies"; - read_sync_double(input.cond_dt); - this->add_item(item); - } - { - Input_Item item("cond_dtbatch"); - item.annotation = "exp(iH*dt*cond_dtbatch) is expanded with Chebyshev expansion"; - read_sync_int(input.cond_dtbatch); - this->add_item(item); - } - { - Input_Item item("cond_smear"); - item.annotation = "Smearing method for conductivities"; - read_sync_int(input.cond_smear); - this->add_item(item); - } - { - Input_Item item("cond_fwhm"); - item.annotation = "FWHM for conductivities"; - read_sync_double(input.cond_fwhm); - this->add_item(item); - } - { - Input_Item item("cond_nonlocal"); - item.annotation = "Nonlocal effects for conductivities"; - read_sync_bool(input.cond_nonlocal); - this->add_item(item); - } - - // berry_wannier - { - Input_Item item("berry_phase"); - item.annotation = "calculate berry phase or not"; - read_sync_bool(input.berry_phase); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.berry_phase) - { - if (para.input.basis_type != "pw" && para.input.basis_type != "lcao") - { - ModuleBase::WARNING_QUIT("ReadInput", - "calculate berry phase, please " - "set basis_type = pw or lcao"); - } - if (para.input.calculation != "nscf") - { - ModuleBase::WARNING_QUIT("ReadInput", "calculate berry phase, please set calculation = nscf"); - } - if (!(para.input.gdir == 1 || para.input.gdir == 2 || para.input.gdir == 3)) - { - ModuleBase::WARNING_QUIT("ReadInput", "calculate berry phase, please set gdir = 1 or 2 or 3"); - } - if (para.input.symmetry != "-1") - { - ModuleBase::WARNING_QUIT("ReadInput", "calculate berry phase, please set symmetry = -1"); - } - } - }; - this->add_item(item); - } - { - Input_Item item("gdir"); - item.annotation = "calculate the polarization in the direction of the " - "lattice vector"; - read_sync_int(input.gdir); - this->add_item(item); - } - { - Input_Item item("towannier90"); - item.annotation = "use wannier90 code interface or not"; - read_sync_bool(input.towannier90); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.towannier90) - { - if (para.input.calculation != "nscf") - { - ModuleBase::WARNING_QUIT("ReadInput", "to use towannier90, please set calculation = nscf"); - } - if (para.input.nspin == 2) - { - if (para.input.wannier_spin != "up" && para.input.wannier_spin != "down") - { - ModuleBase::WARNING_QUIT("ReadInput", - "to use towannier90, please set wannier_spin = up " - "or down"); - } - } - } - }; - this->add_item(item); - } - { - Input_Item item("nnkpfile"); - item.annotation = "the wannier90 code nnkp file name"; - read_sync_string(input.nnkpfile); - this->add_item(item); - } - { - Input_Item item("wannier_spin"); - item.annotation = "calculate spin in wannier90 code interface"; - read_sync_string(input.wannier_spin); - this->add_item(item); - } - { - Input_Item item("wannier_method"); - item.annotation = "different implementation methods under Lcao basis set"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - /* - Developer's notes: on the repair of lcao_in_pw - - lcao_in_pw is a special basis_type, for scf calculation, - it follows workflow of pw, but for nscf the toWannier90 - calculation, the interface is in ESolver_KS_LCAO_elec, - therefore lcao_in_pw for towannier90 calculation follows - lcao. - - In the future lcao_in_pw will have its own ESolver. - - 2023/12/22 use new psi_initializer to expand numerical - atomic orbitals, ykhuang - */ - if (para.input.towannier90 && para.input.basis_type == "lcao_in_pw") - { - para.input.wannier_method = 1; - } - }; - read_sync_int(input.wannier_method); - this->add_item(item); - } - { - Input_Item item("out_wannier_mmn"); - item.annotation = "output .mmn file or not"; - read_sync_bool(input.out_wannier_mmn); - this->add_item(item); - } - { - Input_Item item("out_wannier_amn"); - item.annotation = "output .amn file or not"; - read_sync_bool(input.out_wannier_amn); - this->add_item(item); - } - { - Input_Item item("out_wannier_unk"); - item.annotation = "output UNK. file or not"; - read_sync_bool(input.out_wannier_unk); - this->add_item(item); - } - { - Input_Item item("out_wannier_eig"); - item.annotation = "output .eig file or not"; - read_sync_bool(input.out_wannier_eig); - this->add_item(item); - } - { - Input_Item item("out_wannier_wvfn_formatted"); - item.annotation = "output UNK. file in text format or in binary format"; - read_sync_bool(input.out_wannier_wvfn_formatted); - this->add_item(item); - } -} -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/read_input_item_relax.cpp b/source/module_io/read_input_item_relax.cpp deleted file mode 100644 index 036252f23b..0000000000 --- a/source/module_io/read_input_item_relax.cpp +++ /dev/null @@ -1,213 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" - -namespace ModuleIO -{ -void ReadInput::item_relax() -{ - { - Input_Item item("relax_method"); - item.annotation = "cg; bfgs; sd; cg; cg_bfgs;"; - read_sync_string(input.relax_method); - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::vector relax_methods = {"cg", "bfgs", "sd", "cg_bfgs","bfgs_trad","lbfgs"}; - if (std::find(relax_methods.begin(),relax_methods.end(), para.input.relax_method)==relax_methods.end()) - { - const std::string warningstr = nofound_str(relax_methods, "relax_method"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - }; - this->add_item(item); - } - { - Input_Item item("relax_new"); - item.annotation = "whether to use the new relaxation method"; - read_sync_bool(input.relax_new); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.relax_new && para.input.relax_method != "cg") - { - para.input.relax_new = false; - } - }; - this->add_item(item); - } - { - Input_Item item("relax"); - item.annotation = "allow relaxation along the specific direction"; - read_sync_bool(input.relax); - this->add_item(item); - } - { - Input_Item item("relax_scale_force"); - item.annotation = "controls the size of the first CG step if relax_new is true"; - read_sync_double(input.relax_scale_force); - this->add_item(item); - } - { - Input_Item item("relax_nmax"); - item.annotation = "number of ion iteration steps"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - const std::string& calculation = para.input.calculation; - const std::vector singlelist - = {"scf", "nscf", "get_s", "get_pchg", "get_wf", "test_memory", "test_neighbour", "gen_bessel"}; - if (std::find(singlelist.begin(), singlelist.end(), calculation) != singlelist.end()) - { - if (para.input.relax_nmax != 0) - { - para.input.relax_nmax = 1; - } - } - else if (calculation == "relax" || calculation == "cell-relax") - { - if (para.input.relax_nmax < 0) - { - para.input.relax_nmax = 50; - } - } - }; - read_sync_int(input.relax_nmax); - this->add_item(item); - } - { - Input_Item item("relax_cg_thr"); - item.annotation = "threshold for switching from cg to bfgs, unit: eV/Angstrom"; - read_sync_double(input.relax_cg_thr); - this->add_item(item); - } - { - Input_Item item("force_thr"); - item.annotation = "force threshold, unit: Ry/Bohr"; - // read_sync_double(input.force_thr); - item.read_value = [](const Input_Item& item, Parameter& para) { para.input.force_thr = doublevalue; }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.force_thr == -1 && para.input.force_thr_ev == -1) - { - para.input.force_thr = 1.0e-3; // default value - para.input.force_thr_ev = para.input.force_thr * 13.6058 / 0.529177; - } - else if (para.input.force_thr == -1 && para.input.force_thr_ev != -1) - { - para.input.force_thr = para.input.force_thr_ev / 13.6058 * 0.529177; - } - else - { - // if both force_thr and force_thr_ev are set, use force_thr - ModuleBase::WARNING("ReadInput", "both force_thr and force_thr_ev are set, use force_thr"); - para.input.force_thr_ev = para.input.force_thr * 13.6058 / 0.529177; - } - }; - sync_double(input.force_thr); - this->add_item(item); - } - { - Input_Item item("force_thr_ev"); - item.annotation = "force threshold, unit: eV/Angstrom"; - item.read_value = [](const Input_Item& item, Parameter& para) { para.input.force_thr_ev = doublevalue; }; - sync_double(input.force_thr_ev); - this->add_item(item); - } - { - Input_Item item("force_zero_out"); - item.annotation = "force invalid threshold, unit: eV/Angstrom"; - read_sync_double(input.force_zero_out); - this->add_item(item); - } - { - Input_Item item("stress_thr"); - item.annotation = "stress threshold"; - read_sync_double(input.stress_thr); - this->add_item(item); - } - { - Input_Item item("press1"); - item.annotation = "target pressure, unit: KBar"; - read_sync_double(input.press1); - this->add_item(item); - } - { - Input_Item item("press2"); - item.annotation = "target pressure, unit: KBar"; - read_sync_double(input.press2); - this->add_item(item); - } - { - Input_Item item("press3"); - item.annotation = "target pressure, unit: KBar"; - read_sync_double(input.press3); - this->add_item(item); - } - { - Input_Item item("relax_bfgs_w1"); - item.annotation = "wolfe condition 1 for bfgs"; - read_sync_double(input.relax_bfgs_w1); - this->add_item(item); - } - { - Input_Item item("relax_bfgs_w2"); - item.annotation = "wolfe condition 2 for bfgs"; - read_sync_double(input.relax_bfgs_w2); - this->add_item(item); - } - { - Input_Item item("relax_bfgs_rmax"); - item.annotation = "maximal trust radius, unit: Bohr"; - read_sync_double(input.relax_bfgs_rmax); - this->add_item(item); - } - { - Input_Item item("relax_bfgs_rmin"); - item.annotation = "minimal trust radius, unit: Bohr"; - read_sync_double(input.relax_bfgs_rmin); - this->add_item(item); - } - { - Input_Item item("relax_bfgs_init"); - item.annotation = "initial trust radius, unit: Bohr"; - read_sync_double(input.relax_bfgs_init); - this->add_item(item); - } - { - Input_Item item("fixed_axes"); - item.annotation = "which axes are fixed"; - read_sync_string(input.fixed_axes); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if ((para.input.fixed_axes == "shape" || para.input.fixed_axes == "volume") && !para.input.relax_new) - { - ModuleBase::WARNING_QUIT("ReadInput", "fixed shape and fixed volume only supported for relax_new = 1"); - } - }; - this->add_item(item); - } - { - Input_Item item("fixed_ibrav"); - item.annotation = "whether to preseve lattice type during relaxation"; - read_sync_bool(input.fixed_ibrav); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.fixed_ibrav && !para.input.relax_new) - { - ModuleBase::WARNING_QUIT("ReadInput", "fixed_ibrav only available for relax_new = 1"); - } - if (para.input.latname == "none" && para.input.fixed_ibrav) - { - ModuleBase::WARNING_QUIT("ReadInput", "to use fixed_ibrav, latname must be provided"); - } - }; - this->add_item(item); - } - { - Input_Item item("fixed_atoms"); - item.annotation = "whether to preseve direct coordinates of atoms " - "during relaxation"; - read_sync_bool(input.fixed_atoms); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.fixed_atoms && para.input.calculation == "relax") - { - ModuleBase::WARNING_QUIT("ReadInput", "fixed_atoms is not meant to be used for calculation = relax"); - } - }; - this->add_item(item); - } -} -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_sdft.cpp b/source/module_io/read_input_item_sdft.cpp deleted file mode 100644 index d073084a2e..0000000000 --- a/source/module_io/read_input_item_sdft.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" - -namespace ModuleIO -{ -void ReadInput::item_sdft() -{ - { - Input_Item item("method_sto"); - item.annotation = "1: slow and save memory, 2: fast and waste memory"; - read_sync_int(input.method_sto); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.method_sto != 1 && para.input.method_sto != 2) - { - ModuleBase::WARNING_QUIT("ReadInput", "method_sto should be 1 or 2"); - } - }; - this->add_item(item); - } - { - Input_Item item("npart_sto"); - item.annotation = "Reduce memory when calculating Stochastic DOS"; - read_sync_int(input.npart_sto); - this->add_item(item); - } - { - Input_Item item("nbands_sto"); - item.annotation = "number of stochstic orbitals"; - item.read_value = [](const Input_Item& item, Parameter& para) { - std::string nbandsto_str = strvalue; - if (nbandsto_str != "all") - { - para.input.nbands_sto = std::stoi(nbandsto_str); - } - else - { - para.input.nbands_sto = 0; - } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - // only do it when nbands_sto is set in INPUT - if (item.is_read()) - { - if (strvalue == "0" && para.input.esolver_type == "sdft") - { - para.input.esolver_type = "ksdft"; - ModuleBase::GlobalFunc::AUTO_SET("esolver_type", para.input.esolver_type); - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nbands_sto < 0 || para.input.nbands_sto > 100000) - { - ModuleBase::WARNING_QUIT("ReadInput", "nbands_sto should be in the range of 0 to 100000"); - } - }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - if (item.str_values.size() == 0) // no nbands_sto in INPUT - { - item.final_value << para.input.nbands_sto; - } - else - { - item.final_value << item.str_values[0]; - } - }; - add_int_bcast(input.nbands_sto); - this->add_item(item); - } - { - Input_Item item("nche_sto"); - item.annotation = "Chebyshev expansion orders"; - read_sync_int(input.nche_sto); - this->add_item(item); - } - { - Input_Item item("emin_sto"); - item.annotation = "trial energy to guess the lower bound of eigen " - "energies of the Hamitonian operator"; - read_sync_double(input.emin_sto); - this->add_item(item); - } - { - Input_Item item("emax_sto"); - item.annotation = "trial energy to guess the upper bound of eigen " - "energies of the Hamitonian operator"; - read_sync_double(input.emax_sto); - this->add_item(item); - } - { - Input_Item item("seed_sto"); - item.annotation = "the random seed to generate stochastic orbitals"; - read_sync_int(input.seed_sto); - this->add_item(item); - } - { - Input_Item item("initsto_ecut"); - item.annotation = "maximum ecut to init stochastic bands"; - read_sync_double(input.initsto_ecut); - this->add_item(item); - } - { - Input_Item item("initsto_freq"); - item.annotation = "frequency to generate new stochastic orbitals when running md"; - read_sync_int(input.initsto_freq); - this->add_item(item); - } -} -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/read_input_item_system.cpp b/source/module_io/read_input_item_system.cpp deleted file mode 100644 index ed8cd2f778..0000000000 --- a/source/module_io/read_input_item_system.cpp +++ /dev/null @@ -1,840 +0,0 @@ -#include "source_base/global_function.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" -#include "source_base/module_device/device.h" - -#include -#include - -namespace ModuleIO -{ -// There are some examples: -// Generallly: -// { -// Input_Item item("suffix"); -// item.annotation = "the name of main output directory"; -// read_sync_string(input.suffix); -// this->add_item(item); -// } -// -// Specially: -// { -// Input_Item item("kspacing"); -// item.annotation = "unit in 1/bohr, should be > 0, default is 0 which -// means read KPT file"; -// -// item.read_value = [](const Input_Item& item, Parameter& para) { -// para.input.kspacing[0] = std::stod(item.str_values[0]); -// para.input.kspacing[1] = std::stod(item.str_values[1]); -// para.input.kspacing[2] = std::stod(item.str_values[2]); -// }; -// -// item.reset_value = [](const Input_Item& item, Parameter& para) { -// if(para.input.kspacing[0] <= 0) para.input.kspacing[0] = 1; -// }; -// -// item.check_value = [](const Input_Item& item, const Parameter& para) -// {assert(para.input.kspacing[0]>0);}; -// -// item.get_final_value = [](Input_Item& item, const Parameter& para) { -// item.final_value << para.input.kspacing[0] << " " << -// para.input.kspacing[1] << " " << para.input.kspacing[2]; -// }; -// -// add_doublevec_bcast(&Parameter::PARAMETER, N); -// this->add_item(item); -// } -void ReadInput::item_system() -{ - { - Input_Item item("suffix"); - item.annotation = "the name of main output directory"; - read_sync_string(input.suffix); - this->add_item(item); - } - { - Input_Item item("ntype"); - item.annotation = "atom species number"; - // check of ntype is done in check_ntype - read_sync_int(input.ntype); - this->add_item(item); - } - { - Input_Item item("calculation"); - item.annotation = "test; scf; relax; nscf; get_wf; get_pchg"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.calculation = strvalue; - std::string& calculation = para.input.calculation; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::string& calculation = para.input.calculation; - std::vector callist = {"scf", - "relax", - "md", - "cell-relax", - "test_memory", - "test_neighbour", - "nscf", - "get_s", - "get_wf", - "get_pchg", - "gen_bessel"}; - if (std::find(callist.begin(), callist.end(), calculation) == callist.end()) - { - const std::string warningstr = nofound_str(callist, "calculation"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - if (calculation == "get_pchg" || calculation == "get_wf") - { - if (para.input.basis_type == "pw") // xiaohui add 2013-09-01 - { - ModuleBase::WARNING_QUIT("ReadInput", - "calculate = get_pchg or get_wf " - "is only availble for LCAO."); - } - } - else if (calculation == "gen_bessel") - { - if (para.input.basis_type != "pw") - { - ModuleBase::WARNING_QUIT("ReadInput", "to generate descriptors, please use pw basis"); - } - } - }; - sync_string(input.calculation); - this->add_item(item); - } - { - Input_Item item("esolver_type"); - item.annotation = "the energy solver: ksdft, sdft, ofdft, tddft, lj, dp, ks-lr, lr"; - read_sync_string(input.esolver_type); - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::vector esolver_types = { "ksdft", "sdft", "ofdft", "tddft", "lj", "dp", "lr", "ks-lr" }; - if (std::find(esolver_types.begin(), esolver_types.end(), para.input.esolver_type) == esolver_types.end()) - { - const std::string warningstr = nofound_str(esolver_types, "esolver_type"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - if (para.input.esolver_type == "dp") - { - if (access(para.input.mdp.pot_file.c_str(), 0) == -1) - { - ModuleBase::WARNING_QUIT("ReadInput", "Can not find DP model !"); - } - } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.esolver_type == "lr" && para.input.calculation == "scf") - { // for LR-only calculation based on the ground-state, set calculation to "nscf" - para.input.calculation = "nscf"; - } - }; - this->add_item(item); - } - { - Input_Item item("symmetry"); - item.annotation = "the control of symmetry"; - read_sync_string(input.symmetry); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.symmetry == "default") - { - if (para.input.gamma_only || para.input.calculation == "nscf" || para.input.calculation == "get_s" - || para.input.calculation == "get_pchg" || para.input.calculation == "get_wf") - { - para.input.symmetry = "0"; // if md or exx, symmetry will be - // force-set to 0 or -1 later - } - else - { - para.input.symmetry = "1"; - } - } - if (para.input.calculation == "md") - { - para.input.symmetry = "0"; - } - if (para.input.efield_flag) - { - para.input.symmetry = "0"; - } - if (para.input.esolver_type == "tddft") - { - para.input.symmetry = "-1"; - } - if (para.input.qo_switch) - { - para.input.symmetry = "-1"; // disable kpoint reduce - } - if (para.input.berry_phase) - { - para.input.symmetry = "-1"; // disable kpoint reduce - } - }; - this->add_item(item); - } - { - Input_Item item("symmetry_prec"); - item.annotation = "accuracy for symmetry"; - read_sync_double(input.symmetry_prec); - this->add_item(item); - } - { - Input_Item item("symmetry_autoclose"); - item.annotation = "whether to close symmetry automatically when error " - "occurs in symmetry analysis"; - read_sync_bool(input.symmetry_autoclose); - this->add_item(item); - } - { - Input_Item item("cal_stress"); - item.annotation = "calculate the stress or not"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "md") - { - if (para.input.esolver_type == "lj" || para.input.esolver_type == "dp" - || para.input.mdp.md_type == "msst" || para.input.mdp.md_type == "npt") - { - para.input.cal_stress = true; - } - } - else if (para.input.calculation == "cell-relax") - { - para.input.cal_stress = true; - } - }; - read_sync_bool(input.cal_stress); - this->add_item(item); - } - { - Input_Item item("cal_force"); - item.annotation = "if calculate the force at the end of the electronic iteration"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - std::vector use_force = {"cell-relax", "relax", "md"}; - std::vector not_use_force = {"get_wf", "get_pchg", "get_s"}; - if (std::find(use_force.begin(), use_force.end(), para.input.calculation) != use_force.end()) - { - if (!para.input.cal_force) - { - ModuleBase::GlobalFunc::AUTO_SET("cal_force", "true"); - } - para.input.cal_force = true; - } - else if (std::find(not_use_force.begin(), not_use_force.end(), para.input.calculation) != not_use_force.end()) - { - if (para.input.cal_force) - { - ModuleBase::GlobalFunc::AUTO_SET("cal_force", "false"); - } - para.input.cal_force = false; - } - }; - read_sync_bool(input.cal_force); - this->add_item(item); - } - { - Input_Item item("kpar"); - item.annotation = "devide all processors into kpar groups and k points " - "will be distributed among"; - read_sync_int(input.kpar); - item.reset_value = [](const Input_Item& item, Parameter& para) { -#ifdef __LCAO - if (para.inp.basis_type == "lcao") - { - para.sys.kpar_lcao = para.inp.kpar; - para.input.kpar = 1; - } -#endif - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.basis_type == "lcao" && para.input.kpar > 1) - { - ModuleBase::WARNING("ReadInput", "kpar > 1 has not been supported for lcao calculation."); - } - }; - this->add_item(item); - add_int_bcast(sys.kpar_lcao); - } - { - Input_Item item("bndpar"); - item.annotation = "devide all processors into bndpar groups and bands " - "will be distributed among each group"; - read_sync_int(input.bndpar); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.esolver_type != "sdft" && para.input.ks_solver != "bpcg") - { - para.input.bndpar = 1; - } - if (para.input.bndpar > GlobalV::NPROC) - { - para.input.bndpar = GlobalV::NPROC; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (GlobalV::NPROC % para.input.bndpar != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "The number of processors can not be divided by bndpar"); - } - }; - this->add_item(item); - } - { - Input_Item item("latname"); - item.annotation = "the name of lattice name"; - read_sync_string(input.latname); - this->add_item(item); - } - { - Input_Item item("ecutwfc"); - item.annotation = "energy cutoff for wave functions"; - read_sync_double(input.ecutwfc); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.ecutwfc == 0) - { // 0 means no input value - if (para.input.ecutrho > 0) - { - para.input.ecutwfc = para.input.ecutrho / 4.0; - } - else if (para.input.basis_type == "lcao") - { - para.input.ecutwfc = 100; - } - else - { - para.input.ecutwfc = 50; - } - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.ecutwfc <= 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "ecutwfc should be positive"); - } - }; - this->add_item(item); - } - { - Input_Item item("ecutrho"); - item.annotation = "energy cutoff for charge density and potential"; - read_sync_double(input.ecutrho); - item.reset_value = [](const Input_Item& item, Parameter& para) { - Input_para& input = para.input; - if (input.ecutrho <= 0.0) - { - input.ecutrho = 4.0 * input.ecutwfc; - } - if (input.nx * input.ny * input.nz == 0 && input.ecutrho / input.ecutwfc > 4 + 1e-8) - { - para.sys.double_grid = true; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.ecutrho / para.input.ecutwfc < 4 - 1e-8) - { - ModuleBase::WARNING_QUIT("ReadInput", "ecutrho/ecutwfc must >= 4"); - } - if (para.sys.double_grid == true && para.input.basis_type == "lcao") - { - ModuleBase::WARNING_QUIT("ReadInput", "ecutrho/ecutwfc must = 4 for lcao calculation"); - } - }; - this->add_item(item); - } - { - Input_Item item("nx"); - item.annotation = "number of points along x axis for FFT grid"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.nx = intvalue; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nx * para.input.ny * para.input.nz == 0 && para.input.nx != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nx, ny, nz should be all set to non-zero"); - } - }; - sync_int(input.nx); - this->add_item(item); - } - { - Input_Item item("ny"); - item.annotation = "number of points along y axis for FFT grid"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.ny = intvalue; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nx * para.input.ny * para.input.nz == 0 && para.input.ny != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nx, ny, nz should be all set to non-zero"); - } - }; - sync_int(input.ny); - this->add_item(item); - } - { - Input_Item item("nz"); - item.annotation = "number of points along z axis for FFT grid"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.nz = intvalue; - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nx * para.input.ny * para.input.nz == 0 && para.input.nz != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "nx, ny, nz should be all set to non-zero"); - } - }; - sync_int(input.nz); - this->add_item(item); - } - { - Input_Item item("ndx"); - item.annotation = "number of points along x axis for FFT smooth grid"; - read_sync_int(input.ndx); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.ndx > para.input.nx) - { - para.sys.double_grid = true; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) - { - return; - } - if (para.input.ndx * para.input.ndy * para.input.ndz == 0 && para.input.ndx != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "ndx, ndy, ndz should be all set to non-zero"); - } - if (para.input.ndx < para.input.nx) - { - ModuleBase::WARNING_QUIT("ReadInput", "ndx should be greater than or equal to nx"); - } - }; - this->add_item(item); - } - { - Input_Item item("ndy"); - item.annotation = "number of points along y axis for FFT smooth grid"; - read_sync_int(input.ndy); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.ndy > para.input.ny) - { - para.sys.double_grid = true; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) { - return; -} - if (para.input.ndx * para.input.ndy * para.input.ndz == 0 && para.input.ndy != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "ndx, ndy, ndz should be all set to non-zero"); - } - if (para.input.ndy < para.input.ny) - { - ModuleBase::WARNING_QUIT("ReadInput", "ndy should be greater than or equal to ny"); - } - }; - this->add_item(item); - } - { - Input_Item item("ndz"); - item.annotation = "number of points along z axis for FFT smooth grid"; - read_sync_int(input.ndz); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.ndy > para.input.ny) - { - para.sys.double_grid = true; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (!item.is_read()) { - return; -} - if (para.input.ndx * para.input.ndy * para.input.ndz == 0 && para.input.ndz != 0) - { - ModuleBase::WARNING_QUIT("ReadInput", "ndx, ndy, ndz should be all set to non-zero"); - } - if (para.input.ndz < para.input.nz) - { - ModuleBase::WARNING_QUIT("ReadInput", "ndz should be greater than or equal to nz"); - } - }; - this->add_item(item); - } - { - Input_Item item("cell_factor"); - item.annotation = "used in the construction of the pseudopotential tables"; - read_sync_double(input.cell_factor); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "cell-relax" && para.input.cell_factor < 2.0) - { - para.input.cell_factor = 2.0; // follows QE - } - }; - this->add_item(item); - } - { - Input_Item item("erf_ecut"); - item.annotation = "the value of the constant energy cutoff"; - read_sync_double(input.erf_ecut); - this->add_item(item); - } - { - Input_Item item("erf_height"); - item.annotation = "the height of the energy step for reciprocal vectors"; - read_sync_double(input.erf_height); - this->add_item(item); - } - { - Input_Item item("erf_sigma"); - item.annotation = "the width of the energy step for reciprocal vectors"; - read_sync_double(input.erf_sigma); - this->add_item(item); - } - { - Input_Item item("fft_mode"); - item.annotation = "mode of FFTW"; - read_sync_int(input.fft_mode); - this->add_item(item); - } - { - Input_Item item("diag_subspace"); - item.annotation = "method of subspace diagonalization in dav_subspace. 0:LaPack; 1:genelpa, 2:scalapack"; - read_sync_int(input.diag_subspace); - this->add_item(item); - } - { - Input_Item item("init_wfc"); - item.annotation = "start wave functions are from 'atomic', " - "'atomic+random', 'random' or"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_pchg" || para.input.calculation == "get_wf") - { - para.input.init_wfc = "file"; - } - if (para.input.basis_type == "lcao_in_pw") - { - if (para.input.init_wfc != "nao") - { - para.input.init_wfc = "nao"; - GlobalV::ofs_warning << "init_wfc is set to nao when " - "basis_type is lcao_in_pw" - << std::endl; - } - } - }; - read_sync_string(input.init_wfc); - this->add_item(item); - } - { - Input_Item item("pw_seed"); - item.annotation = "random seed for initializing wave functions"; - read_sync_int(input.pw_seed); - this->add_item(item); - } - { - Input_Item item("init_chg"); - item.annotation = "start charge is from 'atomic' or file"; - read_sync_string(input.init_chg); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "get_pchg" || para.input.calculation == "get_wf") - { - para.input.init_chg = "atomic"; - } - if (para.input.calculation == "nscf" || para.input.calculation == "get_s") - { - if (para.input.init_chg != "file") - { - ModuleBase::GlobalFunc::AUTO_SET("init_chg", para.input.init_chg); - } - para.input.init_chg = "file"; - } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - const std::vector init_chgs = {"atomic", "file", "wfc", "auto"}; - if (std::find(init_chgs.begin(), init_chgs.end(), para.input.init_chg) == init_chgs.end()) - { - const std::string warningstr = nofound_str(init_chgs, "init_chg"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - }; - this->add_item(item); - } - { - Input_Item item("dm_to_rho"); - item.annotation = "reads dmr in npz format and calculates electron density"; - read_sync_bool(input.dm_to_rho); - item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.dm_to_rho && GlobalV::NPROC > 1) - { - ModuleBase::WARNING_QUIT("ReadInput", "dm_to_rho is not available for parallel calculations"); - } - if (para.input.dm_to_rho && para.inp.gamma_only) - { - ModuleBase::WARNING_QUIT("ReadInput", "dm_to_rho is not available for gamma_only calculations"); - } - if (para.input.dm_to_rho) - { -#ifndef __USECNPY - ModuleBase::WARNING_QUIT("ReadInput", - "to write in npz format, please " - "recompile with -DENABLE_CNPY=1"); -#endif - } - }; - this->add_item(item); - } - { - Input_Item item("chg_extrap"); - item.annotation = "atomic; first-order; second-order; dm:coefficients of SIA"; - read_sync_string(input.chg_extrap); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.chg_extrap == "default" && para.input.calculation == "md") - { - para.input.chg_extrap = "second-order"; - } - else if (para.input.chg_extrap == "default" - && (para.input.calculation == "relax" || para.input.calculation == "cell-relax")) - { - para.input.chg_extrap = "first-order"; - } - else if (para.input.chg_extrap == "default") - { - para.input.chg_extrap = "atomic"; - } - if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") - { - para.input.chg_extrap = "atomic"; - } - }; - this->add_item(item); - } - { - Input_Item item("init_vel"); - item.annotation = "read velocity from STRU or not"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.calculation == "md") - { - if (para.input.mdp.md_tfirst < 0 || para.input.mdp.md_restart) - { - para.input.init_vel = true; - } - } - }; - read_sync_bool(input.init_vel); - this->add_item(item); - } - { - Input_Item item("stru_file"); - item.annotation = "the filename of file containing atom positions"; - read_sync_string(input.stru_file); - this->add_item(item); - } - { - Input_Item item("kpoint_file"); - item.annotation = "the name of file containing k points"; - read_sync_string(input.kpoint_file); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.stru_file == "") - { - GlobalV::ofs_warning << "kpoint_file is set to KPT when stru_file is not set" << std::endl; - para.input.stru_file = "KPT"; - } - }; - this->add_item(item); - } - { - Input_Item item("pseudo_dir"); - item.annotation = "the directory containing pseudo files"; - item.read_value = [](const Input_Item& item, Parameter& para) { - if(item.get_size() == 0) - { - para.input.pseudo_dir = ""; - } - else - { - para.input.pseudo_dir = to_dir(strvalue); - } - }; - sync_string(input.pseudo_dir); - this->add_item(item); - } - { - Input_Item item("orbital_dir"); - item.annotation = "the directory containing orbital files"; - item.read_value = [](const Input_Item& item, Parameter& para) { - if(item.get_size() == 0) - { - para.input.orbital_dir = ""; - } - else - { - para.input.orbital_dir = to_dir(strvalue); - } - }; - sync_string(input.orbital_dir); - this->add_item(item); - } - { - Input_Item item("read_file_dir"); - item.annotation = "directory of files for reading"; - read_sync_string(input.read_file_dir); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.read_file_dir == "auto") - { - para.input.read_file_dir = "OUT." + para.input.suffix; - } - para.input.read_file_dir = to_dir(para.input.read_file_dir); - }; - this->add_item(item); - } - { - Input_Item item("restart_load"); - item.annotation = "restart from disk"; - read_sync_bool(input.restart_load); - this->add_item(item); - } - { - Input_Item item("wannier_card"); - item.annotation = "input card for wannier functions"; - read_sync_string(input.wannier_card); - this->add_item(item); - } - { - Input_Item item("mem_saver"); - item.annotation = "Only for nscf calculations. if set to 1, then a " - "memory saving technique will be used for " - "many k point calculations."; - read_sync_int(input.mem_saver); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mem_saver == 1) - { - if (para.input.calculation == "scf" || para.input.calculation == "relax") - { - para.input.mem_saver = 0; - ModuleBase::GlobalFunc::AUTO_SET("mem_saver", "0"); - } - } - }; - this->add_item(item); - } - { - Input_Item item("diago_proc"); - item.annotation = "the number of procs used to do diagonalization"; - read_sync_int(input.diago_proc); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.diago_proc > GlobalV::NPROC || para.input.diago_proc <= 0) - { - para.input.diago_proc = GlobalV::NPROC; - } - }; - this->add_item(item); - } - { - Input_Item item("nbspline"); - item.annotation = "the order of B-spline basis"; - read_sync_int(input.nbspline); - this->add_item(item); - } - { - Input_Item item("kspacing"); - item.annotation = "unit in 1/bohr, should be > 0, default is 0 which " - "means read KPT file"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - if (count == 1) - { - para.input.kspacing[0] = para.input.kspacing[1] = para.input.kspacing[2] = doublevalue; - } - else if (count == 3) - { - para.input.kspacing[0] = std::stod(item.str_values[0]); - para.input.kspacing[1] = std::stod(item.str_values[1]); - para.input.kspacing[2] = std::stod(item.str_values[2]); - } - else - { - ModuleBase::WARNING_QUIT("ReadInput", "kspacing can only accept one or three values."); - } - }; - sync_doublevec(input.kspacing, 3, 0.0); - item.check_value = [](const Input_Item& item, const Parameter& para) { - int kspacing_zero_num = 0; - const std::vector& kspacing = para.input.kspacing; - for (int i = 0; i < 3; i++) - { - if (kspacing[i] < 0.0) - { - ModuleBase::WARNING_QUIT("ReadInput", "kspacing must > 0"); - } - else if (kspacing[i] == 0.0) - { - kspacing_zero_num++; - } - } - if (kspacing_zero_num > 0 && kspacing_zero_num < 3) - { - std::cout << "kspacing: " << kspacing[0] << " " << kspacing[1] << " " << kspacing[2] << std::endl; - ModuleBase::WARNING_QUIT("ReadInput", "kspacing must > 0"); - } - }; - this->add_item(item); - } - { - Input_Item item("min_dist_coef"); - item.annotation = "factor related to the allowed minimum distance " - "between two atoms"; - read_sync_double(input.min_dist_coef); - this->add_item(item); - } - { - Input_Item item("device"); - item.annotation = "the computing device for ABACUS"; - read_sync_string(input.device); - item.reset_value = [](const Input_Item& item, Parameter& para) { - para.input.device=base_device::information::get_device_flag( - para.inp.device, para.inp.basis_type); - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - std::vector avail_list = {"cpu", "gpu"}; - if (std::find(avail_list.begin(), avail_list.end(), para.input.device) == avail_list.end()) - { - const std::string warningstr = nofound_str(avail_list, "device"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - }; - this->add_item(item); - } - { - Input_Item item("precision"); - item.annotation = "the computing precision for ABACUS"; - read_sync_string(input.precision); - item.check_value = [](const Input_Item& item, const Parameter& para) { - std::vector avail_list = {"single", "double"}; - if (std::find(avail_list.begin(), avail_list.end(), para.input.precision) == avail_list.end()) - { - const std::string warningstr = nofound_str(avail_list, "precision"); - ModuleBase::WARNING_QUIT("ReadInput", warningstr); - } - if (para.inp.precision == "single" && para.inp.basis_type == "lcao") - { - ModuleBase::WARNING_QUIT( - "ReadInput", - "Single precision is not supported for NAO basis,\nPlease use double precision for NAO basis.\n"); - } - // cpu single precision is not supported while float_fftw lib is not available - if (para.inp.device == "cpu" && para.inp.precision == "single") - { -#ifndef __ENABLE_FLOAT_FFTW - ModuleBase::WARNING_QUIT( - "ReadInput", - "Single precision with cpu is not supported while float_fftw lib is not available; \ - \n Please recompile with cmake flag \"-DENABLE_FLOAT_FFTW=ON\".\n"); -#endif - } - }; - this->add_item(item); - } -} - -} // namespace ModuleIO diff --git a/source/module_io/read_input_item_tddft.cpp b/source/module_io/read_input_item_tddft.cpp deleted file mode 100644 index 0e44754db1..0000000000 --- a/source/module_io/read_input_item_tddft.cpp +++ /dev/null @@ -1,410 +0,0 @@ -#include "source_base/constants.h" -#include "source_base/tool_quit.h" -#include "read_input.h" -#include "read_input_tool.h" - -namespace ModuleIO -{ -void ReadInput::item_rt_tddft() -{ - // real time TDDFT - { - Input_Item item("td_dt"); - item.annotation = "time step for evolving wavefunction"; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.td_dt == -1.0) - { - GlobalV::ofs_running << "td_dt don't exist, set td_dt with md_dt" << std::endl; - para.input.td_dt = para.input.mdp.md_dt / para.input.estep_per_md; - } - }; - read_sync_double(input.td_dt); - this->add_item(item); - } - { - Input_Item item("estep_per_md"); - item.annotation = "steps of force change"; - read_sync_int(input.estep_per_md); - this->add_item(item); - } - { - Input_Item item("td_dt"); - item.annotation = "time step of propagation"; - read_sync_double(input.td_dt); - this->add_item(item); - } - { - Input_Item item("td_vext"); - item.annotation = "add extern potential or not"; - read_sync_bool(input.td_vext); - this->add_item(item); - } - // { - // Input_Item item("td_vext_dire"); - // item.annotation = "extern potential direction"; - // item.read_value = [](const Input_Item& item, Parameter& para) { - // para.input.td_vext_dire = longstring(item.str_values); - // }; - // sync_string(input.td_vext_dire); - // this->add_item(item); - // } - { - Input_Item item("td_vext_dire"); - item.annotation = "extern potential direction"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.td_vext_dire); - }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - if (item.is_read()) - { - item.final_value.str(longstring(item.str_values)); - } - }; - add_intvec_bcast(input.td_vext_dire, para.input.td_vext_dire.size(), 0); - this->add_item(item); - } - { - Input_Item item("init_vecpot_file"); - item.annotation = "init vector potential through file or not"; - read_sync_bool(input.init_vecpot_file); - this->add_item(item); - } - { - Input_Item item("td_print_eij"); - item.annotation = "print eij or not"; - read_sync_double(input.td_print_eij); - this->add_item(item); - } - { - Input_Item item("td_edm"); - item.annotation = "the method to calculate the energy density matrix"; - read_sync_int(input.td_edm); - this->add_item(item); - } - { - Input_Item item("td_propagator"); - item.annotation = "method of propagator"; - read_sync_int(input.propagator); - this->add_item(item); - } - { - Input_Item item("td_stype"); - item.annotation = "type of electric field in space domain"; - read_sync_int(input.td_stype); - this->add_item(item); - } - { - Input_Item item("td_ttype"); - item.annotation = "type of electric field in time domain"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_ttype = longstring(item.str_values); - }; - sync_string(input.td_ttype); - this->add_item(item); - } - { - Input_Item item("td_tstart"); - item.annotation = " number of steps where electric field starts"; - read_sync_int(input.td_tstart); - this->add_item(item); - } - { - Input_Item item("td_tend"); - item.annotation = "number of steps where electric field ends"; - read_sync_int(input.td_tend); - this->add_item(item); - } - { - Input_Item item("td_lcut1"); - item.annotation = "cut1 of interval in length gauge"; - read_sync_double(input.td_lcut1); - this->add_item(item); - } - { - Input_Item item("td_lcut2"); - item.annotation = "cut2 of interval in length gauge"; - read_sync_double(input.td_lcut2); - this->add_item(item); - } - { - Input_Item item("td_gauss_freq"); - item.annotation = "frequency (freq) of Gauss type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_gauss_freq = longstring(item.str_values); - }; - sync_string(input.td_gauss_freq); - this->add_item(item); - } - { - Input_Item item("td_gauss_phase"); - item.annotation = "phase of Gauss type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_gauss_phase = longstring(item.str_values); - }; - sync_string(input.td_gauss_phase); - this->add_item(item); - } - { - Input_Item item("td_gauss_sigma"); - item.annotation = "sigma of Gauss type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_gauss_sigma = longstring(item.str_values); - }; - sync_string(input.td_gauss_sigma); - this->add_item(item); - } - { - Input_Item item("td_gauss_t0"); - item.annotation = "step number of time center (t0) of Gauss type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_gauss_t0 = longstring(item.str_values); - }; - sync_string(input.td_gauss_t0); - this->add_item(item); - } - { - Input_Item item("td_gauss_amp"); - item.annotation = "amplitude of Gauss type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_gauss_amp = longstring(item.str_values); - }; - sync_string(input.td_gauss_amp); - this->add_item(item); - } - { - Input_Item item("td_trape_freq"); - item.annotation = "frequency of Trapezoid type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trape_freq = longstring(item.str_values); - }; - sync_string(input.td_trape_freq); - this->add_item(item); - } - { - Input_Item item("td_trape_phase"); - item.annotation = "phase of Trapezoid type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trape_phase = longstring(item.str_values); - }; - sync_string(input.td_trape_phase); - this->add_item(item); - } - { - Input_Item item("td_trape_t1"); - item.annotation = "t1 of Trapezoid type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trape_t1 = longstring(item.str_values); - }; - sync_string(input.td_trape_t1); - this->add_item(item); - } - { - Input_Item item("td_trape_t2"); - item.annotation = "t2 of Trapezoid type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trape_t2 = longstring(item.str_values); - }; - sync_string(input.td_trape_t2); - this->add_item(item); - } - { - Input_Item item("td_trape_t3"); - item.annotation = "t3 of Trapezoid type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trape_t3 = longstring(item.str_values); - }; - sync_string(input.td_trape_t3); - this->add_item(item); - } - { - Input_Item item("td_trape_amp"); - item.annotation = "amplitude of Trapezoid type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trape_amp = longstring(item.str_values); - }; - sync_string(input.td_trape_amp); - this->add_item(item); - } - { - Input_Item item("td_trigo_freq1"); - item.annotation = "frequency 1 of Trigonometric type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trigo_freq1 = longstring(item.str_values); - }; - sync_string(input.td_trigo_freq1); - this->add_item(item); - } - { - Input_Item item("td_trigo_freq2"); - item.annotation = "frequency 2 of Trigonometric type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trigo_freq2 = longstring(item.str_values); - }; - sync_string(input.td_trigo_freq2); - this->add_item(item); - } - { - Input_Item item("td_trigo_phase1"); - item.annotation = "phase 1 of Trigonometric type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trigo_phase1 = longstring(item.str_values); - }; - sync_string(input.td_trigo_phase1); - this->add_item(item); - } - { - Input_Item item("td_trigo_phase2"); - item.annotation = "phase 2 of Trigonometric type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trigo_phase2 = longstring(item.str_values); - }; - sync_string(input.td_trigo_phase2); - this->add_item(item); - } - { - Input_Item item("td_trigo_amp"); - item.annotation = "amplitude of Trigonometric type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_trigo_amp = longstring(item.str_values); - }; - sync_string(input.td_trigo_amp); - this->add_item(item); - } - { - Input_Item item("td_heavi_t0"); - item.annotation = "t0 of Heaviside type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_heavi_t0 = longstring(item.str_values); - }; - sync_string(input.td_heavi_t0); - this->add_item(item); - } - { - Input_Item item("td_heavi_amp"); - item.annotation = "amplitude of Heaviside type electric field"; - item.read_value = [](const Input_Item& item, Parameter& para) { - para.input.td_heavi_amp = longstring(item.str_values); - }; - sync_string(input.td_heavi_amp); - this->add_item(item); - } - { - Input_Item item("ocp"); - item.annotation = "change occupation or not"; - read_sync_bool(input.ocp); - this->add_item(item); - } - { - Input_Item item("ocp_set"); - item.annotation = "set occupation"; - item.read_value = [](const Input_Item& item, Parameter& para) { - parse_expression(item.str_values, para.input.ocp_kb); - }; - item.get_final_value = [](Input_Item& item, const Parameter& para) { - if(item.is_read()) - { - item.final_value.str(longstring(item.str_values)); - } - }; - add_doublevec_bcast(input.ocp_kb, para.input.ocp_kb.size(), 0.0); - this->add_item(item); - } - - -} -void ReadInput::item_lr_tddft() -{ - // Linear Responce TDDFT - { - Input_Item item("lr_nstates"); - item.annotation = "the number of 2-particle states to be solved"; - read_sync_int(input.lr_nstates); - this->add_item(item); - } - { - Input_Item item("nocc"); - item.annotation = "the number of occupied orbitals to form the 2-particle basis ( <= nelec/2)"; - read_sync_int(input.nocc); - item.reset_value = [](const Input_Item& item, Parameter& para) { - const int nocc_default = std::max(static_cast(para.input.nelec + 1) / 2, para.input.nbands); - if (para.input.nocc <= 0 || para.input.nocc > nocc_default) { para.input.nocc = nocc_default; } - }; - this->add_item(item); - } - { - Input_Item item("nvirt"); - item.annotation = "the number of virtual orbitals to form the 2-particle basis (nocc + nvirt <= nbands)"; - read_sync_int(input.nvirt); - this->add_item(item); - } - { - Input_Item item("xc_kernel"); - item.annotation = "exchange correlation (XC) kernel for LR-TDDFT"; - read_sync_string(input.xc_kernel); - this->add_item(item); - } - { - Input_Item item("lr_init_xc_kernel"); - item.annotation = "The method to initalize the xc kernel"; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - auto& ifxc = para.input.lr_init_xc_kernel; - for (int i = 0; i < count; i++) { ifxc.push_back(item.str_values[i]); } - }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.lr_init_xc_kernel.empty()) { para.input.lr_init_xc_kernel.push_back("default"); } - }; - sync_stringvec(input.lr_init_xc_kernel, para.input.lr_init_xc_kernel.size(), "default"); - this->add_item(item); - } - { - Input_Item item("lr_solver"); - item.annotation = "the eigensolver for LR-TDDFT"; - read_sync_string(input.lr_solver); - this->add_item(item); - } - { - Input_Item item("lr_thr"); - item.annotation = "convergence threshold of the LR-TDDFT eigensolver"; - read_sync_double(input.lr_thr); - this->add_item(item); - } - { - Input_Item item("out_wfc_lr"); - item.annotation = "whether to output the eigenvectors (excitation amplitudes) in the particle-hole basis"; - read_sync_bool(input.out_wfc_lr); - this->add_item(item); - } - { - Input_Item item("lr_unrestricted"); - item.annotation = "Whether to use unrestricted construction for LR-TDDFT"; - read_sync_bool(input.lr_unrestricted); - this->add_item(item); - } - { - Input_Item item("abs_wavelen_range"); - item.annotation = "the range of wavelength(nm) to output the absorption spectrum "; - item.read_value = [](const Input_Item& item, Parameter& para) { - size_t count = item.get_size(); - for (int i = 0; i < count; i++) - { - para.input.abs_wavelen_range.push_back(std::stod(item.str_values[i])); - } - }; - sync_doublevec(input.abs_wavelen_range, 2, 0.0); - this->add_item(item); - } - { - Input_Item item("abs_gauge"); - item.annotation = "whether to use length or velocity gauge to calculate the absorption spectrum in LR-TDDFT"; - read_sync_string(input.abs_gauge); - this->add_item(item); - } - { - Input_Item item("abs_broadening"); - item.annotation = "the broadening (eta) for LR-TDDFT absorption spectrum"; - read_sync_double(input.abs_broadening); - this->add_item(item); - } -} -} diff --git a/source/module_io/read_input_tool.h b/source/module_io/read_input_tool.h deleted file mode 100644 index d37967742f..0000000000 --- a/source/module_io/read_input_tool.h +++ /dev/null @@ -1,215 +0,0 @@ -#include -#include -#include -#ifdef __MPI -#include "source_base/parallel_common.h" -#endif - -#define strvalue item.str_values[0] -#define intvalue std::stoi(item.str_values[0]) -#define doublevalue std::stod(item.str_values[0]) -#define boolvalue assume_as_boolean(item.str_values[0]) - -#ifdef __MPI -#define add_double_bcast(PARAMETER) \ - { \ - bcastfuncs.push_back([](Parameter& para) { Parallel_Common::bcast_double(para.PARAMETER); }); \ - } -#define add_int_bcast(PARAMETER) \ - { \ - bcastfuncs.push_back([](Parameter& para) { Parallel_Common::bcast_int(para.PARAMETER); }); \ - } -#define add_bool_bcast(PARAMETER) \ - { \ - bcastfuncs.push_back([](Parameter& para) { Parallel_Common::bcast_bool(para.PARAMETER); }); \ - } -#define add_string_bcast(PARAMETER) \ - { \ - bcastfuncs.push_back([](Parameter& para) { Parallel_Common::bcast_string(para.PARAMETER); }); \ - } -#define add_doublevec_bcast(PARAMETER, N, FILL) \ - { \ - bcastfuncs.push_back([](Parameter& para) { \ - int _vec_size = N; \ - Parallel_Common::bcast_int(_vec_size); \ - if (para.PARAMETER.size() != _vec_size) \ - para.PARAMETER.resize(_vec_size, FILL); \ - Parallel_Common::bcast_double(para.PARAMETER.data(), _vec_size); \ - }); \ - } -#define add_intvec_bcast(PARAMETER, N, FILL) \ - { \ - bcastfuncs.push_back([](Parameter& para) { \ - int _vec_size = N; \ - Parallel_Common::bcast_int(_vec_size); \ - if (para.PARAMETER.size() != _vec_size) \ - para.PARAMETER.resize(_vec_size, FILL); \ - Parallel_Common::bcast_int(para.PARAMETER.data(), _vec_size); \ - }); \ - } -#define add_stringvec_bcast(PARAMETER, N, FILL) \ - { \ - bcastfuncs.push_back([](Parameter& para) { \ - int _vec_size = N; \ - Parallel_Common::bcast_int(_vec_size); \ - if (para.PARAMETER.size() != _vec_size) \ - para.PARAMETER.resize(_vec_size, FILL); \ - Parallel_Common::bcast_string(para.PARAMETER.data(), _vec_size); \ - }); \ - } - -#else -#define add_double_bcast(PARAMETER) -#define add_int_bcast(PARAMETER) -#define add_bool_bcast(PARAMETER) -#define add_string_bcast(PARAMETER) -#define add_doublevec_bcast(PARAMETER, N, FILL) \ - { \ - bcastfuncs.push_back([](Parameter& para) { \ - if (para.PARAMETER.size() != N) \ - para.PARAMETER.resize(N, FILL); \ - }); \ - } - -#define add_intvec_bcast(PARAMETER, N, FILL) add_doublevec_bcast(PARAMETER, N, FILL) -#define add_stringvec_bcast(PARAMETER, N, FILL) add_doublevec_bcast(PARAMETER, N, FILL) - -#endif - -#define sync_string(PARAMETER) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { item.final_value << para.PARAMETER; }; \ - add_string_bcast(PARAMETER); \ - } -#define sync_int(PARAMETER) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { item.final_value << para.PARAMETER; }; \ - add_int_bcast(PARAMETER); \ - } -#define sync_double(PARAMETER) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { item.final_value << para.PARAMETER; }; \ - add_double_bcast(PARAMETER); \ - } -#define sync_bool(PARAMETER) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { item.final_value << para.PARAMETER; }; \ - add_bool_bcast(PARAMETER); \ - } -#define sync_doublevec(PARAMETER, N, FILL) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { \ - for (int i = 0; i < N; i++) \ - { \ - item.final_value << para.PARAMETER[i] << " "; \ - } \ - }; \ - add_doublevec_bcast(PARAMETER, N, FILL); \ - } -#define sync_intvec(PARAMETER, N, FILL) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { \ - for (int i = 0; i < N; i++) \ - { \ - item.final_value << para.PARAMETER[i] << " "; \ - } \ - }; \ - add_intvec_bcast(PARAMETER, N, FILL); \ - } -#define sync_stringvec(PARAMETER, N, FILL) \ - { \ - item.get_final_value = [](Input_Item& item, const Parameter& para) { \ - for (int i = 0; i < N; i++) \ - { \ - item.final_value << para.PARAMETER[i] << " "; \ - } \ - }; \ - add_stringvec_bcast(PARAMETER, N, FILL); \ - } - -#define read_sync_string(PARAMETER) \ - { \ - item.read_value = [](const Input_Item& item, Parameter& para) { para.PARAMETER = strvalue; }; \ - sync_string(PARAMETER); \ - } -#define read_sync_int(PARAMETER) \ - { \ - item.read_value = [](const Input_Item& item, Parameter& para) { para.PARAMETER = intvalue; }; \ - sync_int(PARAMETER); \ - } -#define read_sync_double(PARAMETER) \ - { \ - item.read_value = [](const Input_Item& item, Parameter& para) { para.PARAMETER = doublevalue; }; \ - sync_double(PARAMETER); \ - } -#define read_sync_bool(PARAMETER) \ - { \ - item.read_value = [](const Input_Item& item, Parameter& para) { para.PARAMETER = boolvalue; }; \ - sync_bool(PARAMETER); \ - } - -/** - * @brief To parse input parameters as expressions into vectors - * - * @tparam T - * @param expressions (vector): expressions such as "3*1 0 2*0.5 3*0" - * @param result (vector): stores parsing results, - * for example, "3*1 0 2*0.5 1*1.5" can be parsed as - * [1, 1, 1, 0, 0.5, 0.5, 1.5] - */ -template -void parse_expression(const std::vector& expressions, std::vector& result) -{ - result.clear(); // Clear the output vector to prepare for new entries - if (expressions.empty()) - { - return; - } - else if (expressions[0].empty()) - { - return; - } - - for (const auto& expr: expressions) - { - size_t first_star_pos = expr.find('*'); - size_t second_star_pos = expr.rfind('*'); // rfind finds the rightmost '*' - - // e.g. "3", "3.5" - // If no '*' found, convert the whole expression to double/int and add to result - if (first_star_pos == std::string::npos) - { - T T_value = static_cast(std::stof(expr)); - result.push_back(T_value); - } - // e.g. "2*3", "2*3.5" - // If only one '*' found, split the expression into two parts and convert them to double/int - else if (first_star_pos == second_star_pos) - { - std::string int_part = expr.substr(0, first_star_pos); - std::string T_part = expr.substr(first_star_pos + 1); - - int num = std::stoi(int_part); - T T_value = static_cast(std::stof(T_part)); - for(int i = 0 ; i < num; ++i) - { - result.push_back(T_value); - } - } - // e.g. "2*3*3" - // If more than one '*' found, output an error message - else - { - throw std::runtime_error("Invalid expression: " + expr + " - More than one '*' found."); - } - } -} - -template -void reset_vector(std::vector& vec, int size, T default_value) -{ - if (vec.size() != size) - { - vec.resize(size, default_value); - } -} \ No newline at end of file diff --git a/source/module_io/read_set_globalv.cpp b/source/module_io/read_set_globalv.cpp deleted file mode 100644 index 02fb9c8fa0..0000000000 --- a/source/module_io/read_set_globalv.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "source_base/global_variable.h" -#include "source_base/tool_quit.h" -#include "module_parameter/parameter.h" -#include "read_input.h" -#include "read_input_tool.h" -namespace ModuleIO -{ -/// @note Here para.inp has been synchronized of all ranks. -/// All para.inp have the same value. -void ReadInput::set_globalv(const Input_para& inp, System_para& sys) -{ - /// caculate the gamma_only_pw and gamma_only_local - if (inp.gamma_only) - { - sys.gamma_only_local = true; - } - if (sys.gamma_only_local) - { - if (inp.esolver_type == "tddft") - { - GlobalV::ofs_running << " WARNING : gamma_only is not applicable for tddft" << std::endl; - sys.gamma_only_local = false; - } - } - /// set deepks_setorb - if (inp.deepks_scf || inp.deepks_out_labels == 1) - { - sys.deepks_setorb = true; - } - /// set the noncolin and lspinorb from nspin - switch (inp.nspin) - { - case 4: - if (inp.noncolin) - { - sys.domag = true; - sys.domag_z = false; - } - else - { - sys.domag = false; - sys.domag_z = true; - } - sys.npol = 2; - break; - case 2: - case 1: - sys.domag = false; - sys.domag_z = false; - sys.npol = 1; - default: - break; - } - sys.nqx = static_cast((sqrt(inp.ecutwfc) / sys.dq + 4.0) * inp.cell_factor); - sys.nqxq = static_cast((sqrt(inp.ecutrho) / sys.dq + 4.0) * inp.cell_factor); - /// set ncx,ncy,ncz - sys.ncx = inp.nx; - sys.ncy = inp.ny; - sys.ncz = inp.nz; -#ifdef __MPI - Parallel_Common::bcast_bool(sys.double_grid); -#endif - /// set ks_run - if (inp.ks_solver != "bpcg" && inp.bndpar > 1) - { - sys.all_ks_run = false; - } - // set the has_double_data and has_float_data -#ifdef __ENABLE_FLOAT_FFTW - bool float_cond = inp.cal_cond && inp.esolver_type == "sdft"; -#else - bool float_cond = false; -#endif - sys.has_double_data = (inp.precision == "double") || (inp.precision == "mixing") || float_cond; - sys.has_float_data = (inp.precision == "single") || (inp.precision == "mixing") || float_cond; -} - -/// @note Here para.inp has not been synchronized of all ranks. -/// Only para.inp in rank 0 is right. -/// So we need to broadcast the results to all ranks. -void ReadInput::set_global_dir(const Input_para& inp, System_para& sys) -{ - /// caculate the global output directory - const std::string prefix = "OUT."; - sys.global_out_dir = prefix + inp.suffix + "/"; - sys.global_out_dir = to_dir(sys.global_out_dir); - - /// get the global output directory - sys.global_stru_dir = sys.global_out_dir + "STRU/"; - sys.global_stru_dir = to_dir(sys.global_stru_dir); - - /// get the global output directory - sys.global_matrix_dir = sys.global_out_dir + "matrix/"; - sys.global_matrix_dir = to_dir(sys.global_matrix_dir); - - /// get the global output directory - sys.global_wfc_dir = sys.global_out_dir + "WFC/"; - sys.global_wfc_dir = to_dir(sys.global_wfc_dir); - - - /// get the global ML KEDF descriptor directory - sys.global_mlkedf_descriptor_dir = sys.global_out_dir + "MLKEDF_Descriptors/"; - sys.global_mlkedf_descriptor_dir = to_dir(sys.global_mlkedf_descriptor_dir); - - /// get the global directory for DeePKS labels during electronic steps - sys.global_deepks_label_elec_dir = sys.global_out_dir + "DeePKS_Labels_Elec/"; - sys.global_deepks_label_elec_dir = to_dir(sys.global_deepks_label_elec_dir); - - /// get the global readin directory - sys.global_readin_dir = inp.read_file_dir; - sys.global_readin_dir = to_dir(sys.global_readin_dir); - - /// get the stru file for md restart case - if (inp.calculation == "md" && inp.mdp.md_restart) - { - int istep = current_md_step(sys.global_readin_dir); - - if (inp.read_file_dir == to_dir("OUT." + inp.suffix)) - { - sys.global_in_stru = sys.global_stru_dir + "STRU_MD_" + std::to_string(istep); - } - else - { - sys.global_in_stru = inp.read_file_dir + "STRU_MD_" + std::to_string(istep); - } - } - else - { - sys.global_in_stru = inp.stru_file; - } - - // set the global log file - bool out_alllog = inp.out_alllog; -#ifdef __MPI - // because log_file is different for each rank, so we need to bcast the out_alllog - Parallel_Common::bcast_bool(out_alllog); -#endif - if (out_alllog) - { - PARAM.sys.log_file = "running_" + PARAM.inp.calculation + "_" + std::to_string(PARAM.sys.myrank + 1) + ".log"; - } - else - { - PARAM.sys.log_file = "running_" + PARAM.inp.calculation + ".log"; - } -#ifdef __MPI - Parallel_Common::bcast_string(sys.global_in_card); - Parallel_Common::bcast_string(sys.global_out_dir); - Parallel_Common::bcast_string(sys.global_readin_dir); - Parallel_Common::bcast_string(sys.global_stru_dir); - Parallel_Common::bcast_string(sys.global_matrix_dir); - Parallel_Common::bcast_string(sys.global_wfc_dir); - Parallel_Common::bcast_string(sys.global_in_stru); -#endif -} -} // namespace ModuleIO diff --git a/source/module_io/read_wf2rho_pw.cpp b/source/module_io/read_wf2rho_pw.cpp deleted file mode 100644 index 9d2a69e7bc..0000000000 --- a/source/module_io/read_wf2rho_pw.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include "read_wf2rho_pw.h" - -#include "read_wfc_pw.h" -#include "source_base/timer.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "module_parameter/parameter.h" -#include "source_estate/kernels/elecstate_op.h" -#include "module_io/filename.h" - -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 &ik2iktot, - const std::vector &isk, - std::ofstream &ofs_running) -{ - ModuleBase::TITLE("ModuleIO", "read_wf2rho_pw"); - ModuleBase::timer::tick("ModuleIO", "read_wf2rho_pw"); - - ofs_running << " READING WAVE FUNCTIONS" << std::endl; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - ">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << " | " - " |" << std::endl; - ofs_running << " | Reading electronic wave functions in plane wave basis set and |" << std::endl; - ofs_running << " | evaluate charge density based on these wave functions |" << std::endl; - ofs_running << " | " - " |" << std::endl; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - ">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - assert(kpar>=1); - assert(my_pool>=0); - assert(my_rank>=0); - assert(nbands>0); - assert(nspin>0); - assert(npol==1 || npol==2); - - const int nrxx = pw_wfc->nrxx; - assert(nrxx>=0); - - for (int is = 0; is < nspin; ++is) - { - ModuleBase::GlobalFunc::ZEROS(chg.rho[is], nrxx); - } - - const int ng_npol = pw_wfc->npwk_max * npol; - - ModuleBase::ComplexMatrix wfc_tmp(nbands, ng_npol); - std::vector> rho_tmp(nrxx); - - // read occupation numbers - ModuleBase::matrix wg_tmp(nkstot, nbands); - if (my_rank == 0) - { - std::string filename = readin_dir + "eig.txt"; - std::ifstream ifs(filename); - - if(!ifs) - { - std::stringstream sss; - sss << "Cannot find file " << filename; - ModuleBase::WARNING_QUIT("ModuleIO::read_wf2rho_pw", sss.str()); - } - else - { - ofs_running << " Find file containing weights of wave function: " << filename << std::endl; - } - - std::string useless; - getline(ifs, useless); - getline(ifs, useless); - for (int ik_tot = 0; ik_tot < nkstot; ++ik_tot) - { - ifs >> useless; - getline(ifs, useless); - for (int ib = 0; ib < nbands; ++ib) - { - ifs >> useless >> useless >> wg_tmp(ik_tot, ib); - } - } - } - -#ifdef __MPI - MPI_Bcast(wg_tmp.c, nkstot * nbands, MPI_DOUBLE, 0, MPI_COMM_WORLD); -#endif - - for (int ik = 0; ik < pw_wfc->nks; ++ik) - { - int is = 0; - if (nspin == 2) - { - is = isk[ik]; - } - const int ikstot = ik2iktot[ik]; - - // mohan add 2025-05-17 - // .dat file - const int out_type = 2; - const bool out_app_flag = false; - const bool gamma_only = false; - const int istep = -1; - - std::string fn = filename_output(readin_dir,"wf","pw",ik,ik2iktot,nspin,nkstot, - out_type,out_app_flag,gamma_only,istep); - - ofs_running << " Reading wave function from file: " << fn << std::endl; - - ModuleIO::read_wfc_pw(fn, pw_wfc, - rank_in_pool, nproc_in_pool, nbands, npol, - ik, ikstot, nkstot, wfc_tmp); - - if (nspin == 4) - { - std::vector> rho_tmp2(nrxx); - for (int ib = 0; ib < nbands; ++ib) - { - const std::complex* wfc_ib = wfc_tmp.c + ib * ng_npol; - const std::complex* wfc_ib2 = wfc_tmp.c + ib * ng_npol + ng_npol / 2; - pw_wfc->recip2real(wfc_ib, rho_tmp.data(), ik); - pw_wfc->recip2real(wfc_ib2, rho_tmp2.data(), ik); - const double w1 = wg_tmp(ikstot, ib) / pw_wfc->omega; - - if (w1 != 0.0) - { - base_device::DEVICE_CPU* ctx = nullptr; - elecstate::elecstate_pw_op()(ctx, - PARAM.globalv.domag, - PARAM.globalv.domag_z, - nrxx, - w1, - chg.rho, - rho_tmp.data(), - rho_tmp2.data()); - } - } - } - else - { - for (int ib = 0; ib < nbands; ++ib) - { - const std::complex* wfc_ib = wfc_tmp.c + ib * ng_npol; - pw_wfc->recip2real(wfc_ib, rho_tmp.data(), ik); - - const double w1 = wg_tmp(ikstot, ib) / pw_wfc->omega; - - if (w1 != 0.0) - { - base_device::DEVICE_CPU* ctx = nullptr; - elecstate::elecstate_pw_op()(ctx, is, nrxx, - w1, chg.rho, rho_tmp.data()); - } - } - } - } - -#ifdef __MPI - chg.init_chgmpi(); - for (int is = 0; is < nspin; ++is) - { - chg.reduce_diff_pools(chg.rho[is]); - } -#endif - - // Since rho is calculated by psi^2, it is not symmetric. We need to rearrange it. - Symmetry_rho srho; - for (int is = 0; is < nspin; is++) - { - srho.begin(is, chg, chg.rhopw, symm); - } - - ModuleBase::timer::tick("ModuleIO", "read_wf2rho_pw"); -} diff --git a/source/module_io/read_wf2rho_pw.h b/source/module_io/read_wf2rho_pw.h deleted file mode 100644 index dd3fb72ca1..0000000000 --- a/source/module_io/read_wf2rho_pw.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef READ_WF2RHO_PW_H -#define READ_WF2RHO_PW_H - -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_estate/module_charge/charge.h" - -#include -#include - -namespace ModuleIO -{ -/** - * @brief read wave functions and occupation numbers to charge density - * - * @param pw_wfc pw basis for wave functions - * @param symm symmetry - * @param nkstot total number of k points - * @param isk k index to spin index - * @param chg charge density - */ - -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 &ik2iktot, - const std::vector &isk, - std::ofstream &ofs_running); - -} // namespace ModuleIO - -#endif diff --git a/source/module_io/read_wfc_lcao.cpp b/source/module_io/read_wfc_lcao.cpp deleted file mode 100644 index 3cb255574f..0000000000 --- a/source/module_io/read_wfc_lcao.cpp +++ /dev/null @@ -1,492 +0,0 @@ -#include "module_io/read_wfc_lcao.h" - -#include "source_base/formatter.h" -#include "source_base/tool_quit.h" - -#include -#include -#include -#include - -#ifdef __MPI -#include "source_base/parallel_common.h" -#endif - -/* -template -void ModuleIO::read_wfc_lcao(const std::string& file, - int& ik, - ModuleBase::Vector3& kvec_c, - int& nbands, - int& nbasis, - std::vector>& lowf, - std::vector& ekb, - std::vector& occ, - double& wk) //<[out] wavefunction coefficients -{ - // assert the T must be double or float - std::ifstream ifs(file.c_str()); - if (!ifs) - { - ModuleBase::WARNING_QUIT("ModuleIO::read_wfc_lcao", "open file failed: " + file); - } - // will use line-by-line parse - std::string line; - bool read_kvec = false; - int iband = 0; - int ilocal = 0; - - wk = 1.0; - while (std::getline(ifs, line)) - { - // remove leading and trailing whitespaces - line = std::regex_replace(line, std::regex("^ +| +$|( ) +"), "$1"); - if (FmtCore::endswith(line, "(index of k points)")) - { - std::vector result = FmtCore::split(line); - ik = std::stoi(result[0]); - read_kvec = true; - continue; - } - if (read_kvec) - { - const std::vector result = FmtCore::split(line); - kvec_c.x = std::stod(result[0]); - kvec_c.y = std::stod(result[1]); - kvec_c.z = std::stod(result[2]); - read_kvec = false; - continue; - } - if (FmtCore::endswith(line, "(number of bands)")) - { - std::vector result = FmtCore::split(line); - nbands = std::stoi(result[0]); - ekb.resize(nbands, 0.0); // initialize ekb - occ.resize(nbands, 0.0); // initialize occ - } - else if (FmtCore::endswith(line, "(number of orbitals)")) - { - std::vector result = FmtCore::split(line); - nbasis = std::stoi(result[0]); - lowf.resize(nbands * nbasis, std::complex(0.0, 0.0)); // initialize lowf - } - else if (FmtCore::endswith(line, "(band)")) - { - std::vector result = FmtCore::split(line); - assert((ilocal == 0) || (ilocal == nbasis)); - iband = std::stoi(result[0]) - 1; - ilocal = 0; // reset ilocal - } - else if (FmtCore::endswith(line, "(Ry)")) - { - std::vector result = FmtCore::split(line); - ekb[iband] = std::stod(result[0]); - } - else if (FmtCore::endswith(line, "(Occupations)")) - { - std::vector result = FmtCore::split(line); - occ[iband] = std::stod(result[0]); - assert(ilocal == 0); - } - else // read wavefunction coefficients - { - const std::vector result = FmtCore::split(line); - // for the case the complex number is written as a b - for (int i = 0; i < result.size(); i += 2) - { - lowf[iband * nbasis + ilocal] = std::complex(std::stod(result[i]), std::stod(result[i + 1])); - ilocal += 1; - } - } - } - assert(lowf.size() == nbands * nbasis); - assert(iband == nbands - 1); - assert(ilocal == nbasis); -} - -// instantiate the template function -template void ModuleIO::read_wfc_lcao(const std::string& file, - int& ik, - ModuleBase::Vector3& kvec_c, - int& nbands, - int& nbasis, - std::vector>& lowf, - std::vector& ekb, - std::vector& occ, - double& wk); - -template void ModuleIO::read_wfc_lcao(const std::string& file, - int& ik, - ModuleBase::Vector3& kvec_c, - int& nbands, - int& nbasis, - std::vector>& lowf, - std::vector& ekb, - std::vector& occ, - double& wk); - -template -void ModuleIO::read_wfc_lcao(const std::string& file, - int& ik, - ModuleBase::Vector3& kvec_c, - int& nbands, - int& nbasis, - std::vector& lowf, - std::vector& ekb, - std::vector& occ, - double& wk) -{ - std::ifstream ifs(file.c_str()); - if (!ifs) - { - ModuleBase::WARNING_QUIT("ModuleIO::read_wfc_lcao", "open file failed: " + file); - } - // will use line-by-line parse - std::string line; - bool read_kvec = false; - int iband = 0; - int ilocal = 0; - - ik = 0; - kvec_c = ModuleBase::Vector3(0.0, 0.0, 0.0); - wk = 1.0; - while (std::getline(ifs, line)) - { - // remove leading and trailing whitespaces - line = std::regex_replace(line, std::regex("^ +| +$|( ) +"), "$1"); - if (read_kvec) - { - const std::vector result = FmtCore::split(line); - kvec_c.x = std::stod(result[0]); - kvec_c.y = std::stod(result[1]); - kvec_c.z = std::stod(result[2]); - read_kvec = false; - continue; - } - if (FmtCore::endswith(line, "(number of bands)")) - { - std::vector result = FmtCore::split(line); - nbands = std::stoi(result[0]); - ekb.resize(nbands, 0.0); // initialize ekb - occ.resize(nbands, 0.0); // initialize occ - } - else if (FmtCore::endswith(line, "(number of orbitals)")) - { - std::vector result = FmtCore::split(line); - nbasis = std::stoi(result[0]); - lowf.resize(nbands * nbasis, 0.0); // initialize lowf - } - else if (FmtCore::endswith(line, "(band)")) - { - std::vector result = FmtCore::split(line); - assert((ilocal == 0) || (ilocal == nbasis)); - iband = std::stoi(result[0]) - 1; - ilocal = 0; // reset ilocal - } - else if (FmtCore::endswith(line, "(Ry)")) - { - std::vector result = FmtCore::split(line); - ekb[iband] = std::stod(result[0]); - } - else if (FmtCore::endswith(line, "(Occupations)")) - { - std::vector result = FmtCore::split(line); - occ[iband] = std::stod(result[0]); - assert(ilocal == 0); - } - else // read wavefunction coefficients - { - const std::vector result = FmtCore::split(line); - for (const auto& token: result) - { - lowf[iband * nbasis + ilocal] = static_cast(std::stod(token)); - ilocal += 1; - } - } - } - assert(lowf.size() == nbands * nbasis); - assert(iband == nbands - 1); - assert(ilocal == nbasis); -} - -// instantiate the template function -template void ModuleIO::read_wfc_lcao(const std::string& file, - int& ik, - ModuleBase::Vector3& kvec_c, - int& nbands, - int& nbasis, - std::vector& lowf, - std::vector& ekb, - std::vector& occ, - double& wk); - -template void ModuleIO::read_wfc_lcao(const std::string& file, - int& ik, - ModuleBase::Vector3& kvec_c, - int& nbands, - int& nbasis, - std::vector& lowf, - std::vector& ekb, - std::vector& occ, - double& wk); - -#ifdef __MPI -template -void ModuleIO::restart_from_file(const std::string& out_dir, // hard-code the file name to be WFC_NAO_K*.txt? - const Parallel_2D& p2d, - const int& nks, - int& nbands, - int& nbasis, - std::vector& lowf_loc, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk) -{ - // reset vectors - lowf_loc.clear(); - ekb.clear(); - occ.clear(); - kvec_c.clear(); - wk.clear(); - const bool gamma_only = std::is_same::value || std::is_same::value; - const bool multi_k = std::is_same>::value || std::is_same>::value; - assert(gamma_only || multi_k); - const std::string file_prefix = gamma_only ? "WFC_GAMMA" : "WFC_NAO_K"; - // MPI-related variables init - int iproc=0; - - MPI_Comm_rank(p2d.comm(), &iproc); - // then start - int nbands_ = -1, nbasis_ = -1; - - // in LCAO, nks == nkstot - for (int ik = 0; ik < nks; ik++) - { - // check existence of file - const std::string file = out_dir + "/" + file_prefix + std::to_string(ik + 1) + ".txt"; - std::ifstream ifs(file); - if (!ifs) - { - ModuleBase::WARNING_QUIT("Module_IO::restart_from_file", "open file failed: " + file); - } - - std::vector lowf_glb; - std::vector lowf_loc_k; - std::vector ekb_; - std::vector occ_; - ModuleBase::Vector3 kvec; - double wk_ = 0.0; - - if (iproc == 0) // only one rank is needed to read the global lowf, ekb, ... - { - int ik_ = 0; - read_wfc_lcao(file, ik_, kvec, nbands, nbasis, lowf_glb, ekb_, occ_, wk_); - - assert(ik_ == ik + 1); // check the consistency of ik - assert(nbands == nbands_ || nbands_ == -1); // check the consistency of nbands - assert(nbasis == nbasis_ || nbasis_ == -1); // check the consistency of nbasis - - nbands_ = (nbands_ == -1) ? nbands : nbands_; - nbasis_ = (nbasis_ == -1) ? nbasis : nbasis_; - - ekb.insert(ekb.end(), ekb_.begin(), ekb_.end()); - occ.insert(occ.end(), occ_.begin(), occ_.end()); - wk.push_back(wk_); - kvec_c.push_back(kvec); - } - - MPI_Barrier(p2d.comm()); // wait for finishing the reading task - - // scatter the lowf_glb to lowf_loc - Parallel_2D p2d_glb; - Parallel_Common::bcast_int(nbands); - Parallel_Common::bcast_int(nbasis); - - p2d_glb.init(nbasis, nbands, std::max(nbasis, nbands), p2d.comm()); // in the same comm world - lowf_loc_k.resize(p2d.nrow * p2d.ncol); - - Cpxgemr2d(nbasis, - nbands, - lowf_glb.data(), - 1, - 1, - const_cast(p2d_glb.desc), - lowf_loc_k.data(), - 1, - 1, - const_cast(p2d.desc), - p2d_glb.blacs_ctxt); - // append to the global lowf_loc - lowf_loc.insert(lowf_loc.end(), lowf_loc_k.begin(), lowf_loc_k.end()); - } - assert(lowf_loc.size() == nks * p2d.nrow * p2d.ncol); - // still something to broadcast: ekb, occ, wk and kvec. - if (iproc != 0) - { - ekb.resize(nks * nbands, 0.0); - occ.resize(nks * nbands, 0.0); - wk.resize(nks, 0.0); - kvec_c.resize(nks); - } - Parallel_Common::bcast_double(ekb.data(), nks * nbands); - Parallel_Common::bcast_double(occ.data(), nks * nbands); - Parallel_Common::bcast_double(wk.data(), nks); - // Vector3 is not a trivial datatype, need to be broadcasted element by element - for (int ik = 0; ik < nks; ik++) - { - Parallel_Common::bcast_double(kvec_c[ik].x); - Parallel_Common::bcast_double(kvec_c[ik].y); - Parallel_Common::bcast_double(kvec_c[ik].z); - } -} - - -// instantiate the template function -template void ModuleIO::restart_from_file(const std::string& out_dir, - const Parallel_2D& p2d, - const int& nks, - int& nbands, - int& nbasis, - std::vector& lowf_loc, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); - -template void ModuleIO::restart_from_file(const std::string& out_dir, - const Parallel_2D& p2d, - const int& nks, - int& nbands, - int& nbasis, - std::vector& lowf_loc, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); - -template void ModuleIO::restart_from_file(const std::string& out_dir, - const Parallel_2D& p2d, - const int& nks, - int& nbands, - int& nbasis, - std::vector>& lowf_loc, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); - -template void ModuleIO::restart_from_file(const std::string& out_dir, - const Parallel_2D& p2d, - const int& nks, - int& nbands, - int& nbasis, - std::vector>& lowf_loc, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); -#endif - -template -void ModuleIO::restart_from_file(const std::string& out_dir, // hard-code the file name to be WFC_NAO_K*.txt? - const int& nks, - int& nbands, - int& nbasis, - std::vector& lowf, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk) -{ - // reset vectors - lowf.clear(); - ekb.clear(); - occ.clear(); - kvec_c.clear(); - wk.clear(); - const bool gamma_only = std::is_same::value || std::is_same::value; - const bool multi_k = std::is_same>::value || std::is_same>::value; - assert(gamma_only || multi_k); - const std::string file_prefix = gamma_only ? "WFC_GAMMA" : "WFC_NAO_K"; - int nbands_ = -1, nbasis_ = -1; - for (int ik = 0; ik < nks; ik++) - { - // check existence of file - const std::string file = out_dir + "/" + file_prefix + std::to_string(ik + 1) + ".txt"; - const std::ifstream ifs(file); - if (!ifs) - { - ModuleBase::WARNING_QUIT("restart_from_file", "open file failed: " + file); - } - - std::vector lowf_; - std::vector ekb_; - std::vector occ_; - ModuleBase::Vector3 kvec_; - double wk_=0.0; - int ik_=0; - - read_wfc_lcao(file, ik_, kvec_, nbands, nbasis, lowf_, ekb_, occ_, wk_); - - assert(nbands == nbands_ || nbands_ == -1); // check the consistency of nbands - assert(nbasis == nbasis_ || nbasis_ == -1); // check the consistency of nbasis - - nbands_ = (nbands_ == -1) ? nbands : nbands_; - nbasis_ = (nbasis_ == -1) ? nbasis : nbasis_; - - assert(ik_ == ik + 1); // check the consistency of ik - - // append to the global lowf_loc - lowf.insert(lowf.end(), lowf_.begin(), lowf_.end()); - ekb.insert(ekb.end(), ekb_.begin(), ekb_.end()); - occ.insert(occ.end(), occ_.begin(), occ_.end()); - wk.push_back(wk_); - kvec_c.push_back(kvec_); - } - assert(ekb.size() == nks * nbands); - assert(occ.size() == nks * nbands); - assert(lowf.size() == nks * nbands * nbasis); -} - -// instantiate the template function -template void ModuleIO::restart_from_file(const std::string& out_dir, - const int& nks, - int& nbands, - int& nbasis, - std::vector& lowf, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); - -template void ModuleIO::restart_from_file(const std::string& out_dir, - const int& nks, - int& nbands, - int& nbasis, - std::vector& lowf, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); - -template void ModuleIO::restart_from_file(const std::string& out_dir, - const int& nks, - int& nbands, - int& nbasis, - std::vector>& lowf, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); - -template void ModuleIO::restart_from_file(const std::string& out_dir, - const int& nks, - int& nbands, - int& nbasis, - std::vector>& lowf, - std::vector& ekb, - std::vector& occ, - std::vector>& kvec_c, - std::vector& wk); -*/ diff --git a/source/module_io/read_wfc_lcao.h b/source/module_io/read_wfc_lcao.h deleted file mode 100644 index 47301f3624..0000000000 --- a/source/module_io/read_wfc_lcao.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef READ_WFC_LCAO_H -#define READ_WFC_LCAO_H - -#include "source_base/vector3.h" -#include -#include -#include - -#ifdef __MPI -#include "source_base/scalapack_connector.h" -#include "source_base/parallel_2d.h" -#endif - -/** - * @brief This class has two functions: restart psi from the previous calculation, and write psi to the disk. - */ - -namespace ModuleIO -{ -// only when you know why you need the T, you can write function with template parameter, -// otherwise, you should overload the function for different types -// For example in this case, ONLY wfc support to be std::complex and std::complex, -// not ekb, occ, wk and kvec_c. -/** - * @brief Read the wavefunction coefficients from the file (for complex wavefunction coefficients) - * - * @tparam T - * @param file [in] file name - * @param ik [out] the index of k points - * @param kvec_c [out] the k vector in Cartesian coordinates - * @param nbands [out] the number of bands - * @param nbasis [out] the number of orbitals - * @param lowf [out] wavefunction coefficients - * @param ekb [out] eigenvalues - * @param occ [out] occupations - * @param wk [out] weight of k points - */ -/* -template -void read_wfc_lcao(const std::string& file, int& ik, ModuleBase::Vector3& kvec_c, int& nbands, int& nbasis, - std::vector>& lowf, std::vector& ekb, std::vector& occ, - double& wk); - -template -void read_wfc_lcao(const std::string& file, int& ik, ModuleBase::Vector3& kvec_c, int& nbands, int& nbasis, - std::vector& lowf, std::vector& ekb, std::vector& occ, double& wk); -*/ -// the two functions above will return nbands, nbasis, lowf, ekb, occ and wk. -// the lowf is actually lowf_glb, which means the global matrix (ScaLAPACK convention), need to distribute -// to the local matrix (2D-block-cyclic parallel distribution) in the following function. - -//#ifdef __MPI -/** - * @brief Restart the wavefunction coefficients from the file (MPI 2D-BCD version) - * - * @tparam T: datatype of the wavefunction coefficients, can be double, float, std::complex or - * std::complex - * @param out_dir [in] the directory where the wavefunction coefficients are stored - * @param p2d [in] the 2D parallel distribution - * @param nks [in] the number of k points - * @param nbands [out] the number of bands - * @param nbasis [out] the number of orbitals - * @param lowf_loc [out] the local wavefunction coefficients, can be used to construct psi, see constructor No.8 - * @param ekb [out] the eigenvalues - * @param occ [out] the occupations - * @param kvec_c [out] the k vectors in Cartesian coordinates - * @param wk [out] the weight of k points - * - * @warning Cpxgemr2d not implemented yet - */ -/* -template -void restart_from_file(const std::string& out_dir, // hard-code the file name to be LOWF_K_*.txt? - const Parallel_2D& p2d, const int& nks, int& nbands, int& nbasis, std::vector& lowf_loc, - std::vector& ekb, std::vector& occ, - std::vector>& kvec_c, std::vector& wk); -#endif - -// serial version, can always present -template -void restart_from_file(const std::string& out_dir, // hard-code the file name to be LOWF_K_*.txt? - const int& nks, int& nbands, int& nbasis, std::vector& lowf, std::vector& ekb, - std::vector& occ, std::vector>& kvec_c, - std::vector& wk); -*/ -} -#endif diff --git a/source/module_io/read_wfc_nao.cpp b/source/module_io/read_wfc_nao.cpp deleted file mode 100644 index b6f6262ef9..0000000000 --- a/source/module_io/read_wfc_nao.cpp +++ /dev/null @@ -1,221 +0,0 @@ -#include "read_wfc_nao.h" - -#include "source_base/parallel_common.h" -#include "source_base/timer.h" -#include "module_io/write_wfc_nao.h" - -#include "write_wfc_nao.h" -#include "source_base/scalapack_connector.h" -#include "module_io/filename.h" - -void ModuleIO::read_wfc_nao_one_data(std::ifstream& ifs, double& data) -{ - ifs >> data; -} - -void ModuleIO::read_wfc_nao_one_data(std::ifstream& ifs, std::complex& data) -{ - double a = 0.0; - double b = 0.0; - ifs >> a >> b; - data = std::complex(a, b); -} - -template -bool ModuleIO::read_wfc_nao( - const std::string& global_readin_dir, - const Parallel_Orbitals& ParaV, - psi::Psi& psid, - elecstate::ElecState* const pelec, - const std::vector &ik2iktot, - const int nkstot, - const int nspin, - const int nstep, - const int skip_band) -{ - ModuleBase::TITLE("ModuleIO", "read_wfc_nao"); - ModuleBase::timer::tick("ModuleIO", "read_wfc_nao"); - - const int nk = pelec->ekb.nr; - - const bool gamma_only = std::is_same::value; - const int out_type = 1; // only support .txt file now - bool read_success = true; - int myrank = 0; - int nbands = ParaV.get_wfc_global_nbands(); // the global number of bands - int nlocal = ParaV.get_wfc_global_nbasis(); // the global number of basis functions - int nbands_local = ParaV.ncol_bands; // the number of bands in the local process - int nlocal_local = ParaV.nrow_bands; // the number of basis functions in the local process - - if (gamma_only) - { - // I don't know why, but in orther places, the init of psi is using ParaV.ncol for gamma_only case - // It seems that the diagonalization of double case need a full matrix of psi. - nbands_local = ParaV.ncol; - } - psid.resize(nk, nbands_local, nlocal_local); - -#ifdef __MPI - MPI_Comm_rank(ParaV.comm(), &myrank); -#endif - - // lambda function to read one file - auto read_one_file = [&](const std::string& ss, - std::stringstream& error_message, - const int ik, - std::vector& ctot) - { - std::ifstream ifs; - ifs.open(ss.c_str()); - if (!ifs) - { - error_message << " Can't open file:" << ss << std::endl; - return false; - } - else - { - std::cout << " Read NAO wave functions from " << ss << std::endl; - } - - if (!gamma_only) - { - int ik_file = 0; - double kx = 0.0; - double ky = 0.0; - double kz = 0.0; - ModuleBase::GlobalFunc::READ_VALUE(ifs, ik_file); - ifs >> kx >> ky >> kz; - if (ik_file != ik + 1) - { - error_message << "The k index read in from file do not match the k index generated by ABACUS!\n"; - error_message << " read in k index=" << ik_file; - error_message << " ABACUS k index =" << ik+1 << std::endl; - ifs.close(); - return false; - } - } - int nbands_file = 0, nlocal_file = 0; - ModuleBase::GlobalFunc::READ_VALUE(ifs, nbands_file); - ModuleBase::GlobalFunc::READ_VALUE(ifs, nlocal_file); - if (nbands > nbands_file) - { - error_message << "The number of bands to be read exceeds the number of bands in the file generated by ABACUS!\n"; - error_message << " nbands in the existing file=" << nbands_file; - error_message << " nbands to be read into ABACUS=" << nbands << std::endl; - ifs.close(); - return false; - } - if (nlocal != nlocal_file) - { - error_message << "The nlocal read in from file do not match the nlocal generated by ABACUS!\n"; - error_message << " read in nlocal=" << nlocal_file; - error_message << " ABACUS nlocal =" << nlocal << std::endl; - ifs.close(); - return false; - } - for (int i = 0; i < skip_band + nbands; i++) - { - // the first skip_bands useless bands are read into 0th band to be overwritten - const int ib_read = std::max(i - skip_band, 0); - int ib = 0; - ModuleBase::GlobalFunc::READ_VALUE(ifs, ib); - ModuleBase::GlobalFunc::READ_VALUE(ifs, pelec->ekb(ik, ib_read)); - ModuleBase::GlobalFunc::READ_VALUE(ifs, pelec->wg(ik, ib_read)); - if (i+1 != ib) - { - error_message << "The band index read in from file do not match the global parameter band index!\n"; - error_message << " read in band index=" << ib; - error_message << " band index=" << i+1 << std::endl; - ifs.close(); - return false; - } - for (int j = 0; j < nlocal; j++) - { - read_wfc_nao_one_data(ifs, ctot[ib_read * nlocal + j]); - } - } - ifs.close(); - return true; - }; // end read one file - - - std::string errors; - - std::vector ctot; - if (myrank == 0) - { - ctot.resize(nbands * nlocal); - } - else - { - ctot.resize(0); - } - - for(int ik=0;ik(ParaV.desc_wfc), - pv_glb.blacs_ctxt); - Parallel_Common::bcast_double(&(pelec->ekb(ik, 0)), nbands); - Parallel_Common::bcast_double(&(pelec->wg(ik, 0)), nbands); -#else - BlasConnector::copy(nbands*nlocal, ctot.data(), 1, psid.get_pointer(), 1); -#endif - }// end of loop over k-points - - return true; -}; - -template bool ModuleIO::read_wfc_nao(const std::string& global_readin_dir, - const Parallel_Orbitals& ParaV, - psi::Psi& psid, - elecstate::ElecState* const pelec, - const std::vector &ik2iktot, - const int nkstot, - const int nspin, - const int nstep, - const int skip_band); - -template bool ModuleIO::read_wfc_nao>(const std::string& global_readin_dir, - const Parallel_Orbitals& ParaV, - psi::Psi>& psid, - elecstate::ElecState* const pelec, - const std::vector &ik2iktot, - const int nkstot, - const int nspin, - const int nstep, - const int skip_band); diff --git a/source/module_io/read_wfc_nao.h b/source/module_io/read_wfc_nao.h deleted file mode 100644 index e0993d2482..0000000000 --- a/source/module_io/read_wfc_nao.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_READ_WFC_NAO_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_READ_WFC_NAO_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_psi/psi.h" -#include "source_estate/elecstate.h" - -// mohan add 2010-09-09 -namespace ModuleIO -{ -/** - * @brief Reads a single data value from an input file stream. - * - * @param ifs The input file stream to read from. - * @param data The variable to store the read data value. - */ -void read_wfc_nao_one_data(std::ifstream& ifs, double& data); - -/** - * @brief Reads a single complex data value from an input file stream. - * - * @param ifs The input file stream to read from. - * @param data The variable to store the read complex data value. - */ -void read_wfc_nao_one_data(std::ifstream& ifs, std::complex& data); - -/** - * @brief Reads the wavefunction coefficients from an input file. - * - * @tparam T The type of the wavefunction coefficients. - * @param global_readin_dir The global directory for reading input files. - * @param ParaV The parallel orbitals object. - * @param psid The Psi object to store the wavefunction coefficients. - * @param pelec Pointer to the ElecState object. - * @param skip_band From which band to start reading. - * @return True if the wavefunction coefficients are successfully read, false otherwise. - */ -template -bool read_wfc_nao( - const std::string& global_readin_dir, - const Parallel_Orbitals& ParaV, - psi::Psi& psid, - elecstate::ElecState* const pelec, - const std::vector &ik2iktot, - const int nkstot, - const int nspin, - const int nstep = -1, - const int skip_band = 0); - -} // namespace ModuleIO - -#endif diff --git a/source/module_io/read_wfc_pw.cpp b/source/module_io/read_wfc_pw.cpp deleted file mode 100644 index 02419f0cad..0000000000 --- a/source/module_io/read_wfc_pw.cpp +++ /dev/null @@ -1,342 +0,0 @@ -#include "read_wfc_pw.h" - -#include "module_parameter/parameter.h" -#include "binstream.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/parallel_common.h" -#include "source_base/parallel_global.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" - -void ModuleIO::read_wfc_pw(const std::string& filename, - 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) -{ - ModuleBase::TITLE("ModuleIO", "read_wfc_pw"); - ModuleBase::timer::tick("ModuleIO", "read_wfc_pw"); - - Binstream rfs; - std::ifstream ifs; - bool error = false; - int size = 0; - std::string msg = ""; - std::string filetype = filename.substr(filename.length() - 3, 3); - - // whether can open the file - if (filetype == "txt") - { - ifs.open(filename); - if (!ifs) - { - error = true; - msg = "Can't open file " + filename; - } - } - else if (filetype == "dat") - { - rfs.open(filename, "r"); - if (!rfs) - { - error = true; - msg = "Can't open file " + filename; - } - } - else - { - error = true; - msg = "Unknown file type " + filetype; - } - - if (error) - { - ModuleBase::WARNING_QUIT("ModuleIO::read_wfc_pw", msg); - } - - const int nx = pw_wfc->nx; - const int ny = pw_wfc->ny; - const int nz = pw_wfc->nz; - const int npwk_max = pw_wfc->npwk_max; - - int npwtot = 0; - int max_dim = 0; - - // get npwtot -#ifdef __MPI - MPI_Allreduce(&pw_wfc->npwk[ik], &npwtot, 1, MPI_INT, MPI_SUM, POOL_WORLD); - MPI_Allreduce(&npwk_max, &max_dim, 1, MPI_INT, MPI_MAX, POOL_WORLD); -#else - max_dim = npwk_max; - npwtot = pw_wfc->npwk[ik]; -#endif - int npwtot_npol = npwtot * npol; - - - // read in some information - int ikstot_in = -1; - int nkstot_in = -1; - int npwtot_in = -1; - int nbands_in = -1; - double kvec[3] = {0.0, 0.0, 0.0}; - double weight = -1.0; - double ecutwfc_in = -1.0; - double lat0_in = -1.0; - double tpiba_in = -1.0; - - if (rank_in_pool == 0) - { - if (filetype == "txt") - { - } - else if (filetype == "dat") - { - rfs >> size >> ikstot_in >> nkstot_in >> kvec[0] >> kvec[1] >> kvec[2] >> weight >> npwtot_in >> nbands_in - >> ecutwfc_in >> lat0_in >> tpiba_in >> size; - } - } - -#ifdef __MPI - MPI_Bcast(&ikstot_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(&nkstot_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(kvec, 3, MPI_DOUBLE, 0, POOL_WORLD); - MPI_Bcast(&weight, 1, MPI_DOUBLE, 0, POOL_WORLD); - MPI_Bcast(&npwtot_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(&nbands_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(&ecutwfc_in, 1, MPI_DOUBLE, 0, POOL_WORLD); - MPI_Bcast(&lat0_in, 1, MPI_DOUBLE, 0, POOL_WORLD); - MPI_Bcast(&tpiba_in, 1, MPI_DOUBLE, 0, POOL_WORLD); -#endif - - if (ikstot_in != ikstot + 1 || nkstot_in != nkstot || npwtot_in != npwtot || nbands_in != nbands) - { - std::cout << "ikstot_in = " << ikstot_in << std::endl; - std::cout << "ikstot = " << ikstot + 1 << std::endl; - std::cout << "nkstot_in = " << nkstot_in << std::endl; - std::cout << "nkstot = " << nkstot << std::endl; - std::cout << "npwtot_in = " << npwtot_in << std::endl; - std::cout << "npwtot = " << npwtot << std::endl; - std::cout << "nbands_in = " << nbands_in << std::endl; - std::cout << "nbands = " << nbands << std::endl; - ModuleBase::WARNING_QUIT( - "ModuleIO::read_wfc_pw", - "ikstot_in != ikstot || nkstot_in != nkstot || npwtot_in != npwtot || nbands_in != nbands"); - } - - if (kvec[0] != pw_wfc->kvec_c[ik].x || kvec[1] != pw_wfc->kvec_c[ik].y || kvec[2] != pw_wfc->kvec_c[ik].z) - { - std::cout << "kvec_in[" << ikstot << "] = " << kvec[0] << " " << kvec[1] << " " << kvec[2] << std::endl; - std::cout << "kvec[" << ikstot << "] = " << pw_wfc->kvec_c[ik].x << " " << pw_wfc->kvec_c[ik].y << " " - << pw_wfc->kvec_c[ik].z << std::endl; - ModuleBase::WARNING_QUIT("ModuleIO::read_wfc_pw", "k vector in file is not the same as the one in memory"); - } - - if (lat0_in != pw_wfc->lat0 || tpiba_in != pw_wfc->tpiba) - { - std::cout << "lat0_in = " << lat0_in << std::endl; - std::cout << "lat0 = " << pw_wfc->lat0 << std::endl; - std::cout << "tpiba_in = " << tpiba_in << std::endl; - std::cout << "tpiba = " << pw_wfc->tpiba << std::endl; - ModuleBase::WARNING_QUIT("ModuleIO::read_wfc_pw", "lat0_in != pw_wfc->lat0 || tpiba_in != pw_wfc->tpiba"); - } - - // read in G - ModuleBase::Vector3 G_in[3]; - if (rank_in_pool == 0) - { - if (filetype == "txt") - { - } - else if (filetype == "dat") - { - rfs >> size >> G_in[0].x >> G_in[0].y >> G_in[0].z >> G_in[1].x >> G_in[1].y >> G_in[1].z >> G_in[2].x - >> G_in[2].y >> G_in[2].z >> size; - } - } - -#ifdef __MPI - MPI_Bcast(G_in, 3 * 3, MPI_DOUBLE, 0, POOL_WORLD); -#endif - - if (G_in[0].x != pw_wfc->G.e11 || G_in[0].y != pw_wfc->G.e12 || G_in[0].z != pw_wfc->G.e13 - || G_in[1].x != pw_wfc->G.e21 || G_in[1].y != pw_wfc->G.e22 || G_in[1].z != pw_wfc->G.e23 - || G_in[2].x != pw_wfc->G.e31 || G_in[2].y != pw_wfc->G.e32 || G_in[2].z != pw_wfc->G.e33) - { - std::cout << "G_in[0] = " << G_in[0].x << " " << G_in[0].y << " " << G_in[0].z << std::endl; - std::cout << "G_in[1] = " << G_in[1].x << " " << G_in[1].y << " " << G_in[1].z << std::endl; - std::cout << "G_in[2] = " << G_in[2].x << " " << G_in[2].y << " " << G_in[2].z << std::endl; - std::cout << "G[0] = " << pw_wfc->G.e11 << " " << pw_wfc->G.e12 << " " << pw_wfc->G.e13 << std::endl; - std::cout << "G[1] = " << pw_wfc->G.e21 << " " << pw_wfc->G.e22 << " " << pw_wfc->G.e23 << std::endl; - std::cout << "G[2] = " << pw_wfc->G.e31 << " " << pw_wfc->G.e32 << " " << pw_wfc->G.e33 << std::endl; - ModuleBase::WARNING_QUIT("ModuleIO::read_wfc_pw", "G_in != G"); - } - - // read in miller index - ModuleBase::Vector3* miller = new ModuleBase::Vector3[npwtot]; - int* glo_order = nullptr; - if (rank_in_pool == 0) - { - if (filetype == "txt") - { - } - else if (filetype == "dat") - { - rfs >> size; - for (int i = 0; i < npwtot; ++i) - { - rfs >> miller[i].x >> miller[i].y >> miller[i].z; - } - rfs >> size; - } - - // map global index to read ordering for plane waves - glo_order = new int[nx * ny * nz]; - for (int i = 0; i < nx * ny * nz; i++) - { - glo_order[i] = -1; - } - for (int i = 0; i < npwtot; ++i) - { - int index = (miller[i].x * ny + miller[i].y) * nz + miller[i].z; - glo_order[index] = i; - } - } - - // map local to global index for plane waves - int* l2g_pw = new int[pw_wfc->npwk[ik]]; - for (int i = 0; i < pw_wfc->npwk[ik]; ++i) - { - int isz = pw_wfc->igl2isz_k[ik * npwk_max + i]; - int iz = isz % nz; - int is = isz / nz; - int ixy = pw_wfc->is2fftixy[is]; - int index = ixy * nz + iz; - l2g_pw[i] = index; - } - - // read in wfc - std::complex* wfc_in = new std::complex[npwtot_npol]; - for (int ib = 0; ib < nbands_in; ib++) - { - if (rank_in_pool == 0) - { - if (filetype == "txt") - { - } - else if (filetype == "dat") - { - rfs >> size; - for (int i = 0; i < npwtot_npol; ++i) - { - rfs >> wfc_in[i]; - } - rfs >> size; - } - } - - // distribute wave functions to processers -#ifdef __MPI - for (int ip = 0; ip < nproc_in_pool; ++ip) - { - if (ip != 0) - { - if (rank_in_pool == ip) - { - MPI_Send(l2g_pw, pw_wfc->npwk[ik], MPI_INT, 0, ip, POOL_WORLD); - MPI_Recv(&wfc(ib, 0), - pw_wfc->npwk[ik], - MPI_DOUBLE_COMPLEX, - 0, - ip + nproc_in_pool, - POOL_WORLD, - MPI_STATUS_IGNORE); - if (npol == 2) - { - MPI_Recv(&wfc(ib, npwk_max), - pw_wfc->npwk[ik], - MPI_DOUBLE_COMPLEX, - 0, - ip + 2 * nproc_in_pool, - POOL_WORLD, - MPI_STATUS_IGNORE); - } - } - if (rank_in_pool == 0) - { - int* ig_ip = new int[max_dim]; - std::complex* wfc_ip = new std::complex[max_dim]; - - MPI_Status wfc_status; - MPI_Recv(ig_ip, max_dim, MPI_INT, ip, ip, POOL_WORLD, &wfc_status); - MPI_Get_count(&wfc_status, MPI_INT, &size); - - for (int i = 0; i < size; i++) - { - wfc_ip[i] = wfc_in[glo_order[ig_ip[i]]]; - } - MPI_Send(wfc_ip, size, MPI_DOUBLE_COMPLEX, ip, ip + nproc_in_pool, POOL_WORLD); - if (npol == 2) - { - for (int i = 0; i < size; i++) - { - wfc_ip[i] = wfc_in[glo_order[ig_ip[i]] + npwtot]; - } - MPI_Send(wfc_ip, size, MPI_DOUBLE_COMPLEX, ip, ip + 2 * nproc_in_pool, POOL_WORLD); - } - delete[] ig_ip; - delete[] wfc_ip; - } - } - else - { - if (rank_in_pool == 0) - { - for (int i = 0; i < pw_wfc->npwk[ik]; ++i) - { - wfc(ib, i) = wfc_in[glo_order[l2g_pw[i]]]; - } - if (npol == 2) - { - for (int i = 0; i < pw_wfc->npwk[ik]; ++i) - { - wfc(ib, i + npwk_max) = wfc_in[glo_order[l2g_pw[i]] + npwtot]; - } - } - } - } - MPI_Barrier(POOL_WORLD); - } -#else - for (int i = 0; i < pw_wfc->npwk[ik]; ++i) - { - wfc(ib, i) = wfc_in[glo_order[l2g_pw[i]]]; - } - if (npol == 2) - { - for (int i = 0; i < pw_wfc->npwk[ik]; ++i) - { - wfc(ib, i + npwk_max) = wfc_in[glo_order[l2g_pw[i]] + npwtot]; - } - } -#endif - } - - delete[] l2g_pw; - delete[] miller; - delete[] wfc_in; - - if (rank_in_pool == 0) - { - delete[] glo_order; - ifs.close(); - } - - ModuleBase::timer::tick("ModuleIO", "read_wfc_pw"); - return; -} diff --git a/source/module_io/read_wfc_pw.h b/source/module_io/read_wfc_pw.h deleted file mode 100644 index 7e70b28eae..0000000000 --- a/source/module_io/read_wfc_pw.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef READ_WFC_PW_H -#define READ_WFC_PW_H - -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_estate/module_charge/charge.h" - -#include - -namespace ModuleIO -{ - -/** - * @brief read wave functions from binary file - * - * @param filename filename containing wave functions - * @param pw_wfc wave function FFT grids - * @param ik k index - * @param ikstot total index of k points - * @param nkstot total number of k points - * @param wfc wave functions - */ -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); -} // namespace ModuleIO - -#endif diff --git a/source/module_io/restart.cpp b/source/module_io/restart.cpp deleted file mode 100644 index 1841f3bb37..0000000000 --- a/source/module_io/restart.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "restart.h" - -#include -#include - -#include -#include - -#include "source_base/global_function.h" - -void Restart::write_file1(const std::string &file_name, const void*const ptr, const size_t size) const -{ - std::ofstream ofs(file_name, std::ofstream::binary|std::ofstream::trunc); - ofs.write(static_cast(ptr),size); -} - -void Restart::read_file1(const std::string &file_name, void*const ptr, const size_t size) const -{ - std::ifstream ifs(file_name, std::ifstream::binary); - ifs.read(static_cast(ptr),size); -} - -bool Restart::write_file2(const std::string& file_name, const void* const ptr, const size_t size, const bool error_quit) const -{ - const int file = open(file_name.c_str(), O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); - if (-1 == file){ - if (error_quit){ - throw std::runtime_error("can't open restart save file. \nerrno=" + ModuleBase::GlobalFunc::TO_STRING(errno) + ".\n" + std::string(__FILE__) + " line " + std::to_string(__LINE__)); - } else { - return false; - } - } - auto error = write(file, ptr, size); - if (-1 == error) { - if (error_quit) { - throw std::runtime_error("can't write restart save file. \nerrno=" + ModuleBase::GlobalFunc::TO_STRING(errno) + ".\n" + std::string(__FILE__) + " line " + std::to_string(__LINE__)); - } else { - return false; - } - } - close(file); - return true; -} - -bool Restart::read_file2(const std::string& file_name, void* const ptr, const size_t size, const bool error_quit) const -{ - const int file = open(file_name.c_str(), O_RDONLY); - if (-1 == file) { - if (error_quit) { - throw std::runtime_error("can't open restart load file. \nerrno=" + ModuleBase::GlobalFunc::TO_STRING(errno) + ".\n" + std::string(__FILE__) + " line " + std::to_string(__LINE__)); - } else { - return false; - } - } - auto error = read(file, ptr, size); - if (-1 == error) { - if (error_quit) { - throw std::runtime_error("can't read restart load file. \nerrno=" + ModuleBase::GlobalFunc::TO_STRING(errno) + ".\n" + std::string(__FILE__) + " line " + std::to_string(__LINE__)); - } else { - return false; - } - } - close(file); - return true; -} \ No newline at end of file diff --git a/source/module_io/restart.h b/source/module_io/restart.h deleted file mode 100644 index d3cf0cf2df..0000000000 --- a/source/module_io/restart.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef RESTART_H -#define RESTART_H - -#include -#include "source_base/global_function.h" -#include "source_base/abfs-vector3_order.h" -#ifdef __EXX -#include -#endif - -class Restart -{ -public: - struct Info_Save - { - bool save_charge = false; - bool save_H = false; // save H means save Hexx now, will be changed in the future. - }; - Info_Save info_save; - - struct Info_Load - { - bool load_charge = false; - bool load_charge_finish = false; - bool load_H = false; - bool load_H_finish = false; - bool restart_exx = false; // to avoid the repeated load in MD/Relax - }; - Info_Load info_load; - - std::string folder; - - template - bool save_disk(const std::string label, const int index, const int size, T* data, const bool error_quit = true) const - { - return write_file2(folder + label + "_" + ModuleBase::GlobalFunc::TO_STRING(GlobalV::MY_RANK) + "_" - + ModuleBase::GlobalFunc::TO_STRING(index), - data, - size * sizeof(T), - error_quit); - } - template - bool load_disk(const std::string label, const int index, const int size, T* data, const bool error_quit = true) const - { - return read_file2(folder + label + "_" + ModuleBase::GlobalFunc::TO_STRING(GlobalV::MY_RANK) + "_" - + ModuleBase::GlobalFunc::TO_STRING(index), - data, - size * sizeof(T), - error_quit); - } -private: - void write_file1(const std::string &file_name, const void*const ptr, const size_t size) const; - void read_file1(const std::string &file_name, void*const ptr, const size_t size) const; - bool write_file2(const std::string& file_name, const void* const ptr, const size_t size, const bool error_quit = true) const; - bool read_file2(const std::string& file_name, void* const ptr, const size_t size, const bool error_quit = true) const; -}; - -#endif diff --git a/source/module_io/restart_exx_csr.h b/source/module_io/restart_exx_csr.h deleted file mode 100644 index cac38cf654..0000000000 --- a/source/module_io/restart_exx_csr.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once -#include "source_base/abfs-vector3_order.h" -#include "source_cell/unitcell.h" -#include "module_ri/serialization_cereal.h" -#include -#include - -namespace ModuleIO -{ - using TC = std::array; - using TAC = std::pair; - - /// read Hexxs in CSR format - template - void read_Hexxs_csr(const std::string& file_name, const UnitCell& ucell, - const int nspin, const int nbasis, - std::vector>>>& Hexxs); - - /// read Hexxs in cereal format - template - void read_Hexxs_cereal(const std::string& file_name, - std::vector>>>& Hexxs); - - /// write Hexxs in CSR format - template - void write_Hexxs_csr(const std::string& file_name, const UnitCell& ucell, - const std::map>>& Hexxs); - - /// 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, std::map>> - calculate_RI_Tensor_sparse(const double& sparse_threshold, - const std::vector>>>& Hexxs, - const UnitCell& ucell); -} - -#include "module_io/restart_exx_csr.hpp" \ No newline at end of file diff --git a/source/module_io/restart_exx_csr.hpp b/source/module_io/restart_exx_csr.hpp deleted file mode 100644 index fa7c81297a..0000000000 --- a/source/module_io/restart_exx_csr.hpp +++ /dev/null @@ -1,141 +0,0 @@ -#pragma once -#include "module_io/restart_exx_csr.h" -#include "source_cell/unitcell.h" -#include "module_io/csr_reader.h" -#include "module_io/write_HS_sparse.h" -#include "module_ri/serialization_cereal.h" -#include -#include - -namespace ModuleIO -{ - template - void read_Hexxs_csr(const std::string& file_name, const UnitCell& ucell, - const int nspin, const int nbasis, - std::vector>>>& Hexxs) - { - ModuleBase::TITLE("ModuleIO", "read_Hexxs_csr"); - Hexxs.resize(nspin); - for (int is = 0;is < nspin;++is) - { - ModuleIO::csrFileReader csr(file_name + "_" + std::to_string(is) + ".csr"); - int nR = csr.getNumberOfR(); - int nbasis = csr.getMatrixDimension(); - // allocate Hexxs[is] - for (int iat1 = 0; iat1 < ucell.nat; ++iat1) { - for (int iat2 = 0;iat2 < ucell.nat;++iat2) { - for (int iR = 0;iR < nR;++iR) - { - const std::vector& R = csr.getRCoordinate(iR); - TC dR({ R[0], R[1], R[2] }); - Hexxs[is][iat1][{iat2, dR}] = RI::Tensor( - { - static_cast(ucell.atoms[ucell.iat2it[iat1]].nw), - static_cast(ucell.atoms[ucell.iat2it[iat2]].nw) - } - ); - } - } - } -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iR = 0;iR < nR;++iR) - { - const std::vector& R = csr.getRCoordinate(iR); - const SparseMatrix& matrix = csr.getMatrix(iR); - for (auto& ijv : matrix.getElements()) - { - const int& npol = ucell.get_npol(); - const int& i = ijv.first.first * npol; - const int& j = ijv.first.second * npol; - Hexxs.at(is).at(ucell.iwt2iat[i]).at( - { - ucell.iwt2iat[j], - { R[0], R[1], R[2] } - } - )(ucell.iwt2iw[i] / npol, ucell.iwt2iw[j] / npol) = ijv.second; - } - } - } - } - - template - void read_Hexxs_cereal(const std::string& file_name, - std::vector>>>& Hexxs) - { - ModuleBase::TITLE("ModuleIO", "read_Hexxs_cereal"); - ModuleBase::timer::tick("Exx_LRI", "read_Hexxs_cereal"); - std::ifstream ifs(file_name, std::ios::binary); - if(!ifs.is_open()) - { ModuleBase::WARNING_QUIT("read_Hexxs_cereal", file_name+" not found."); } - cereal::BinaryInputArchive iar(ifs); - iar(Hexxs); - ModuleBase::timer::tick("Exx_LRI", "read_Hexxs_cereal"); - } - - template - std::map, std::map>> - calculate_RI_Tensor_sparse(const double& sparse_threshold, - const std::map>>& Hexxs, - const UnitCell& ucell) - { - ModuleBase::TITLE("ModuleIO", "calculate_HContainer_sparse_d"); - std::map, std::map>> target; - for (auto& a1_a2R_data : Hexxs) - { - int iat1 = a1_a2R_data.first; - for (auto& a2R_data : a1_a2R_data.second) - { - int iat2 = a2R_data.first.first; - int nw1 = ucell.atoms[ucell.iat2it[iat1]].nw; - int nw2 = ucell.atoms[ucell.iat2it[iat2]].nw; - int start1 = ucell.atoms[ucell.iat2it[iat1]].stapos_wf / ucell.get_npol() + ucell.iat2ia[iat1] * nw1; - int start2 = ucell.atoms[ucell.iat2it[iat2]].stapos_wf / ucell.get_npol() + ucell.iat2ia[iat2] * nw2; - - const TC& R = a2R_data.first.second; - auto& matrix = a2R_data.second; - Abfs::Vector3_Order dR(R[0], R[1], R[2]); - for (int i = 0;i < nw1;++i) { - for (int j = 0;j < nw2;++j) { - target[dR][start1 + i][start2 + j] = - ((std::abs(matrix(i, j)) > sparse_threshold) ? matrix(i, j) : static_cast(0)); - } - } - } - } - return target; - } - - template - void write_Hexxs_csr(const std::string& file_name, const UnitCell& ucell, - const std::vector>>>& Hexxs) - { - ModuleBase::TITLE("ModuleIO", "write_Hexxs_csr"); - std::set> all_R_coor; - double sparse_threshold = 1e-10; - for (int is = 0;is < Hexxs.size();++is) - { - for (const auto& HexxA : Hexxs[is]) - { - const int iat0 = HexxA.first; - for (const auto& HexxB : HexxA.second) - { - const int iat1 = HexxB.first.first; - const Abfs::Vector3_Order R = RI_Util::array3_to_Vector3(HexxB.first.second); - all_R_coor.insert(R); - } - } - ModuleIO::save_sparse( - calculate_RI_Tensor_sparse(sparse_threshold, Hexxs[is], ucell), - all_R_coor, - sparse_threshold, - false, //binary - file_name + "_" + std::to_string(is) + ".csr", - Parallel_Orbitals(), - "Hexxs_" + std::to_string(is), - -1, - false); //no reduce, one file for each process - } - } -} diff --git a/source/module_io/rhog_io.cpp b/source/module_io/rhog_io.cpp deleted file mode 100644 index a98a6af088..0000000000 --- a/source/module_io/rhog_io.cpp +++ /dev/null @@ -1,417 +0,0 @@ -#include "binstream.h" -#include "source_base/global_function.h" -#include "module_parameter/parameter.h" -#include "source_base/global_variable.h" -#include "source_base/parallel_global.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "rhog_io.h" -#include -#include - -bool ModuleIO::read_rhog(const std::string& filename, const ModulePW::PW_Basis* pw_rhod, std::complex** rhog) -{ - ModuleBase::TITLE("ModuleIO", "read_rhog"); - ModuleBase::timer::tick("ModuleIO", "read_rhog"); - - const int nx = pw_rhod->nx; - const int ny = pw_rhod->ny; - const int nz = pw_rhod->nz; - - Binstream ifs; - bool error = false; - int gamma_only_in = 0; - int npwtot_in = 0; - int nspin_in = 0; - int size = 0; - double b1[3], b2[3], b3[3]; - - if (GlobalV::RANK_IN_POOL == 0) - { - ifs.open(filename, "r"); - if (!ifs) - { - error = true; - } - } - -#ifdef __MPI - MPI_Bcast(&error, 1, MPI_C_BOOL, 0, POOL_WORLD); -#endif - - if (error) - { - ModuleBase::WARNING("ModuleIO::read_rhog", "Can't open file " + filename); - return false; - } - - if (GlobalV::RANK_IN_POOL == 0) - { - ifs >> size >> gamma_only_in >> npwtot_in >> nspin_in >> size; - ifs >> size >> b1[0] >> b1[1] >> b1[2] >> b2[0] >> b2[1] >> b2[2] >> b3[0] >> b3[1] >> b3[2] >> size; - if (gamma_only_in != pw_rhod->gamma_only) - { - // there is a treatment that can transform between gamma_only and non-gamma_only - // however, it is not implemented here - error = true; - ifs.close(); - } - if (npwtot_in > pw_rhod->npwtot) - { - ModuleBase::WARNING("ModuleIO::read_rhog", "some planewaves in file are not used"); - } - else if (npwtot_in < pw_rhod->npwtot) - { - ModuleBase::WARNING("ModuleIO::read_rhog", "some planewaves in file are missing"); - } - if (nspin_in < PARAM.inp.nspin) - { - ModuleBase::WARNING("ModuleIO::read_rhog", "some spin channels in file are missing"); - } - } - -#ifdef __MPI - MPI_Bcast(&error, 1, MPI_C_BOOL, 0, POOL_WORLD); -#endif - - if (error) - { - ModuleBase::WARNING("ModuleIO::read_rhog", "gamma_only read from file is inconsistent with INPUT"); - return false; - } - -#ifdef __MPI - MPI_Bcast(&gamma_only_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(&npwtot_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(&nspin_in, 1, MPI_INT, 0, POOL_WORLD); - MPI_Bcast(b1, 3, MPI_DOUBLE, 0, POOL_WORLD); - MPI_Bcast(b2, 3, MPI_DOUBLE, 0, POOL_WORLD); - MPI_Bcast(b3, 3, MPI_DOUBLE, 0, POOL_WORLD); -#endif - std::vector miller(npwtot_in * 3); - // once use ModuleBase::Vector3, it is highly bug-prone to assume the memory layout of the class. - // The x, y and z of Vector3 will not always to be contiguous. - // Instead, a relatively safe choice is to use std::vector, the memory layout is assumed - // to be npwtot_in rows and 3 columns. - if (GlobalV::RANK_IN_POOL == 0) - { - ifs >> size; - for (int i = 0; i < npwtot_in; ++i) // loop over rows... - { - ifs >> miller[i*3] >> miller[i*3+1] >> miller[i*3+2]; - } - ifs >> size; - } -#ifdef __MPI - MPI_Bcast(miller.data(), miller.size(), MPI_INT, 0, POOL_WORLD); -#endif - // set to zero - for (int is = 0; is < PARAM.inp.nspin; ++is) - { - ModuleBase::GlobalFunc::ZEROS(rhog[is], pw_rhod->npw); - } - // maps ixyz tp ig - std::vector fftixyz2ig(pw_rhod->nxyz, -1); // map isz to ig. - for (int ig = 0; ig < pw_rhod->npw; ++ig) - { - int isz = pw_rhod->ig2isz[ig]; - int iz = isz % nz; - int is = isz / nz; - int ixy = pw_rhod->is2fftixy[is]; - int ixyz = iz + nz * ixy; - fftixyz2ig[ixyz] = ig; - } - std::vector> rhog_in(npwtot_in); - for (int is = 0; is < nspin_in; ++is) - { - if (GlobalV::RANK_IN_POOL == 0) - { - ifs >> size; - for (int i = 0; i < npwtot_in; ++i) - { - ifs >> rhog_in[i]; - } - ifs >> size; - } -#ifdef __MPI - MPI_Bcast(rhog_in.data(), rhog_in.size(), MPI_DOUBLE_COMPLEX, 0, POOL_WORLD); -#endif - - for (int i = 0; i < npwtot_in; ++i) - { - int ix = miller[i * 3]; - int iy = miller[i * 3 + 1]; - int iz = miller[i * 3 + 2]; - - if (ix <= -int((nx + 1) / 2) || ix >= int(nx / 2) + 1 || iy <= -int((ny + 1) / 2) || iy >= int(ny / 2) + 1 - || iz <= -int((nz + 1) / 2) || iz >= int(nz / 2) + 1) - { - // these planewaves are not used - continue; - } - - if (ix < 0) - ix += nx; - if (iy < 0) - iy += ny; - if (iz < 0) - iz += nz; - int fftixy = iy + pw_rhod->fftny * ix; - if (GlobalV::RANK_IN_POOL == pw_rhod->fftixy2ip[fftixy]) - { - int fftixyz = iz + nz * fftixy; - int ig = fftixyz2ig[fftixyz]; - rhog[is][ig] = rhog_in[i]; - } - } - - if (nspin_in == 2 && PARAM.inp.nspin == 4 && is == 1) - { - for (int ig = 0; ig < pw_rhod->npw; ++ig) - { - rhog[3][ig] = rhog[1][ig]; - } - ModuleBase::GlobalFunc::ZEROS(rhog[1], pw_rhod->npw); - ModuleBase::GlobalFunc::ZEROS(rhog[2], pw_rhod->npw); - } - } - - if (GlobalV::RANK_IN_POOL == 0) - { - ifs.close(); - } - // for debug, write the rhog to a file (not binary) - // if (GlobalV::RANK_IN_POOL == 0) - // { - // std::ofstream ofs("rhog_read.txt"); - // for (int i = 0; i < nspin_in; ++i) - // { - // for (int ig = 0; ig < pw_rhod->npw; ++ig) - // { - // ofs << rhog[i][ig] << " "; - // } - // ofs << std::endl; - // } - // ofs.close(); - // } - ModuleBase::timer::tick("ModuleIO", "read_rhog"); - return true; -} - -bool ModuleIO::write_rhog(const std::string& fchg, - const bool gamma_only, // from INPUT - const ModulePW::PW_Basis* pw_rho, // pw_rho in runtime - const int nspin, // GlobalV - const ModuleBase::Matrix3& GT, // from UnitCell, useful for calculating the miller - std::complex** rhog, - const int ipool, - const int irank, - const int nrank) -{ - ModuleBase::TITLE("ModuleIO", "write_rhog"); - ModuleBase::timer::tick("ModuleIO", "write_rhog"); - if (ipool != 0) { return true; } - // only one pool writes the rhog, because rhog in all pools are identical. - - // for large-scale data, it is not wise to collect all distributed components to the - // master process and then write the data to the file. Instead, we can write the data - // processer by processer. - - // Quantum ESPRESSO requires the G-vectors collected should be in the order like as if - // there is only 1 process, this order is recorded in - - // fftixy2ip will be useful for the order of the G-vectors - // each time we iterate on ig, then find the rho_g over all the processes - // for ig in npwtot, then find the local index of ig on processor, ig -> fftixy2ip -> igl - - - // write the header (by rank 0): gamma_only, ngm_g, nspin - int size = 3; - // because "reinterpret_cast" cannot drop the "const", so use intermediate variable - int ngm_g = pw_rho->npwtot; - int gam = gamma_only; // IMPLICIT DATA TYPE CONVERSION! - int nsp = nspin; - - std::ofstream ofs; -#ifdef __MPI - MPI_Barrier(POOL_WORLD); - // this is still a global variable... should be moved into param - // list as `const MPI_Comm& comm` - if (irank == 0) - { - // printf(" CHGDEN >>> Writing header by rank %d...\n", irank); -#endif - ofs.open(fchg, std::ios::binary); // open the file by all processors - if (!ofs) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_rhog", "File I/O failure: cannot open file " + fchg); - return false; - } - ofs.write(reinterpret_cast(&size), sizeof(size)); - ofs.write(reinterpret_cast(&gam), sizeof(gam)); - ofs.write(reinterpret_cast(&ngm_g), sizeof(ngm_g)); - ofs.write(reinterpret_cast(&nsp), sizeof(nsp)); - ofs.write(reinterpret_cast(&size), sizeof(size)); - // write the lattice vectors, GT is the reciprocal lattice vectors, need 2pi? - std::vector b = {GT.e11, GT.e12, GT.e13, GT.e21, GT.e22, GT.e23, GT.e31, GT.e32, GT.e33}; - size = 9; - ofs.write(reinterpret_cast(&size), sizeof(size)); - for (int i = 0; i < 9; ++i) - { - ofs.write(reinterpret_cast(&b[i]), sizeof(b[i])); - } - ofs.write(reinterpret_cast(&size), sizeof(size)); - ofs.close(); -#ifdef __MPI - // printf(" CHGDEN >>> Complete header writing by rank %d\n", irank); - } - MPI_Barrier(POOL_WORLD); // wait for rank 0 to finish writing the header - // printf(" CHGDEN >>> rank %d ready for continue writing...\n", irank); - MPI_Barrier(POOL_WORLD); -#endif - - // write the G-vectors in Miller indices, the Miller indices can be calculated by - // the dot product of the G-vectors and the reciprocal lattice vectors - // parallelization needed considered here. Because the sequence of the G-vectors - // is not important, we can write the G-vectors processer by processer - size = 3*ngm_g; -#ifdef __MPI - if(irank == 0) - { - // printf(" CHGDEN >>> Writing header of Miller indices by rank %d...\n", irank); -#endif - ofs.open(fchg, std::ios::binary | std::ios::app); // open the file by rank 0 - ofs.write(reinterpret_cast(&size), sizeof(size)); - ofs.close(); -#ifdef __MPI - // printf(" CHGDEN >>> Complete header of Miller indices writing by rank %d\n", irank); - } - MPI_Barrier(POOL_WORLD); // wait for rank 0 to finish writing the header of miller indices -#endif -#ifdef __MPI - for(int i = 0; i < nrank; ++i) // write the miller indices processer by processer - { - if(i == irank) - { - // printf(" CHGDEN >>> Writing Miller indices by rank %d...\n", irank); -#endif - ofs.open(fchg, std::ios::binary | std::ios::app); // open the file by processer i - for(int ig = 0; ig < pw_rho->npw; ++ig) - { - const ModuleBase::Vector3 g = pw_rho->gdirect[ig]; // g direct is (ix, iy, iz), miller index (integer), centered at (0, 0, 0) - std::vector miller = {int(g.x), int(g.y), int(g.z)}; - ofs.write(reinterpret_cast(&miller[0]), sizeof(miller[0])); - ofs.write(reinterpret_cast(&miller[1]), sizeof(miller[1])); - ofs.write(reinterpret_cast(&miller[2]), sizeof(miller[2])); - } - ofs.close(); -#ifdef __MPI - // printf(" CHGDEN >>> Complete Miller indices writing by rank %d\n", irank); - } - MPI_Barrier(POOL_WORLD); // wait for the current rank to finish writing the miller indices - } -#endif -#ifdef __MPI - if(irank == 0) - { -#endif - ofs.open(fchg, std::ios::binary | std::ios::app); // open the file by rank 0 - ofs.write(reinterpret_cast(&size), sizeof(size)); - ofs.close(); -#ifdef __MPI - } - MPI_Barrier(POOL_WORLD); // wait for rank 0 to finish writing the miller indices -#endif - - // write the rho(G) values - std::complex sum_check; - size = ngm_g; - for(int ispin = 0; ispin < nspin; ++ispin) - { -#ifdef __MPI - if(irank == 0) - { - // printf(" CHGDEN >>> Writing header of rho(G) values by rank %d...\n", irank); -#endif - ofs.open(fchg, std::ios::binary | std::ios::app); // open the file by rank 0 - ofs.write(reinterpret_cast(&size), sizeof(size)); - ofs.close(); -#ifdef __MPI - // printf(" CHGDEN >>> Complete header of rho(G) values writing by rank %d\n", irank); - } - MPI_Barrier(POOL_WORLD); // wait for rank 0 to finish writing the header of rho(G) -#endif -#ifdef __MPI - for(int i = 0; i < nrank; ++i) // write the rho(G) values processer by processer - { - if(i == irank) - { - // printf(" CHGDEN >>> Writing rho(G) values by rank %d...\n", irank); -#endif - ofs.open(fchg, std::ios::binary | std::ios::app); // open the file by processer i - sum_check = 0.0; - for(int ig = 0; ig < pw_rho->npw; ++ig) - { - sum_check += rhog[ispin][ig]; - ofs.write(reinterpret_cast(&rhog[ispin][ig]), sizeof(rhog[ispin][ig])); - } - // assert(std::abs(sum_check) > 1.0e-10); // check if the sum of rho(G) is valid - ofs.close(); -#ifdef __MPI - // printf(" CHGDEN >>> Complete rho(G) values writing by rank %d\n", irank); - } - MPI_Barrier(POOL_WORLD); // wait for the current rank to finish writing the rho(G) values - } -#endif - -#ifdef __MPI - if(irank == 0) - { -#endif - ofs.open(fchg, std::ios::binary | std::ios::app); // open the file by rank 0 - ofs.write(reinterpret_cast(&size), sizeof(size)); - ofs.close(); -#ifdef __MPI - } - MPI_Barrier(POOL_WORLD); // wait for rank 0 to finish writing the rho(G) values -#endif - } - // for debug, write the rhog to a file (not binary) - // if (irank == 0) - // { - // std::ofstream ofs("rhog_write.txt"); - // for (int i = 0; i < nspin; ++i) - // { - // for (int ig = 0; ig < pw_rho->npw; ++ig) - // { - // ofs << rhog[i][ig] << " "; - // } - // ofs << std::endl; - // } - // ofs.close(); - // } - ModuleBase::timer::tick("ModuleIO", "write_rhog"); - return true; -} - -// self-consistency test with the following python code -// import numpy as np - -// with open("rhog_read.txt") as f: -// read = f.readlines() - -// with open("rhog_write.txt") as f: -// write = f.readlines() - -// # convert c++ stype complex number (a,b) to python complex -// def to_complex(s): -// a, b = s.replace("(", "").replace(")", "").split(",") -// return complex(float(a), float(b)) - -// read = [[to_complex(rhog) for rhog in spin.strip().split()] for spin in read] -// write = [[to_complex(rhog) for rhog in spin.strip().split()] for spin in write] - -// diff = np.array(read) - np.array(write) -// print(np.max(np.abs(diff))) -// test system: integrated test 118_PW_CHG_BINARY -// yielding error 5.290000000000175e-11 \ No newline at end of file diff --git a/source/module_io/rhog_io.h b/source/module_io/rhog_io.h deleted file mode 100644 index 9f470b9637..0000000000 --- a/source/module_io/rhog_io.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef RHOG_IO_H -#define RHOG_IO_H - -#include -#include -#include "source_basis/module_pw/pw_basis.h" -/** - * I/O free function of rho(G) in binary format - * Author: YuLiu98, Kirk0830 - * - * The designed foramt of the binary file is kept similar to the one in QuantumESPRESSO - * Modules/io_base.f90, function write_rhog (non-HDF5): - * - * /3/ /gammaonly/ /ngm_g/ /nspin/ /3/ ! bool, int, int. ngm_g is the global, total number of G-vectors - * /9/ /b11/ /b12/ /b13/ /b21/ /b22/ /b23/ /b31/ /b32/ /b33/ /9/ ! 9 real numbers, the three lattice vectors - * /ngm_g*3/ - * /miller(1,1)/ /miller(1,2)/ /miller(1,3)/ - * /miller(2,1)/ /miller(2,2)/ /miller(2,3)/ - * ... - * /miller(ngm_g,1)/ /miller(ngm_g,2)/ /miller(ngm_g,3)/ - * /ngm_g*3/ ! ngm_g*3 integers, the G-vectors in Miller indices - * /ngm_g/ - * /rhog(1)/ /rhog(2)/ /rhog(3)/ ... - * /ngm_g/ ! ngm_g complex numbers, the rho(G) values - * !/ngm_g/ ! ngm_g complex numbers, the rho(G) values for the second spin component - * !/rhog(1)/ /rhog(2)/ /rhog(3)/ ... - * !/ngm_g/ ! ngm_g complex numbers, the rho(G) values for the second spin component - * - * There are some aspects needed to ensure: - * 1. the correspondence between ABACUS PW and QuantumESPRESSO - * ABACUS PW QuantumESPRESSO - * bij UnitCell::GT b1, b2, b3 - * miller index ibox[*] mill - * rho Charge::rhog rho - * - * 2. the unit of each quantity - * ABACUS PW QuantumESPRESSO - * bij a.u. - * miller index - * rho - */ - -namespace ModuleIO -{ - -bool read_rhog(const std::string& filename, const ModulePW::PW_Basis* pw_rhod, std::complex** rhog); - -bool write_rhog(const std::string& fchg, - const bool gamma_only, // from INPUT - const ModulePW::PW_Basis* pw_rho, // pw_rho in runtime - const int nspin, // GlobalV - const ModuleBase::Matrix3& GT, // from UnitCell, useful for calculating the miller - std::complex** rhog, - const int ipool, - const int irank, - const int nrank); - -} // namespace ModuleIO - -#endif diff --git a/source/module_io/single_R_io.cpp b/source/module_io/single_R_io.cpp deleted file mode 100644 index cf096dcc01..0000000000 --- a/source/module_io/single_R_io.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "single_R_io.h" -#include "source_base/parallel_reduce.h" -#include "module_parameter/parameter.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" - -inline void write_data(std::ofstream& ofs, const double& data) -{ - ofs << " " << std::fixed << std::scientific << std::setprecision(8) << data; -} -inline void write_data(std::ofstream& ofs, const std::complex& data) -{ - ofs << " (" << std::fixed << std::scientific << std::setprecision(8) << data.real() << "," - << std::fixed << std::scientific << std::setprecision(8) << data.imag() << ")"; -} - -template -void ModuleIO::output_single_R(std::ofstream& ofs, - const std::map>& XR, - const double& sparse_threshold, - const bool& binary, - const Parallel_Orbitals& pv, - const bool& reduce) -{ - T* line = nullptr; - std::vector indptr; - indptr.reserve(PARAM.globalv.nlocal + 1); - indptr.push_back(0); - - std::stringstream tem1; - tem1 << PARAM.globalv.global_out_dir << std::to_string(GlobalV::DRANK) + "temp_sparse_indices.dat"; - std::ofstream ofs_tem1; - std::ifstream ifs_tem1; - - if (!reduce || GlobalV::DRANK == 0) - { - if (binary) - { - ofs_tem1.open(tem1.str().c_str(), std::ios::binary); - } - else - { - ofs_tem1.open(tem1.str().c_str()); - } - } - - line = new T[PARAM.globalv.nlocal]; - for(int row = 0; row < PARAM.globalv.nlocal; ++row) - { - ModuleBase::GlobalFunc::ZEROS(line, PARAM.globalv.nlocal); - - if (!reduce || pv.global2local_row(row) >= 0) - { - auto iter = XR.find(row); - if (iter != XR.end()) - { - for (auto &value : iter->second) - { - line[value.first] = value.second; - } - } - } - - if (reduce) - { - Parallel_Reduce::reduce_all(line, PARAM.globalv.nlocal); - } - - if (!reduce || GlobalV::DRANK == 0) - { - int nonzeros_count = 0; - for (int col = 0; col < PARAM.globalv.nlocal; ++col) - { - if (std::abs(line[col]) > sparse_threshold) - { - if (binary) - { - ofs.write(reinterpret_cast(&line[col]), sizeof(T)); - ofs_tem1.write(reinterpret_cast(&col), sizeof(int)); - } - else - { - write_data(ofs, line[col]); - ofs_tem1 << " " << col; - } - - nonzeros_count++; - - } - - } - nonzeros_count += indptr.back(); - indptr.push_back(nonzeros_count); - } - } - - delete[] line; - - if (!reduce || GlobalV::DRANK == 0) - { - if (binary) - { - ofs_tem1.close(); - ifs_tem1.open(tem1.str().c_str(), std::ios::binary); - ofs << ifs_tem1.rdbuf(); - ifs_tem1.close(); - for (auto &i : indptr) - { - ofs.write(reinterpret_cast(&i), sizeof(int)); - } - } - else - { - ofs << std::endl; - ofs_tem1 << std::endl; - ofs_tem1.close(); - ifs_tem1.open(tem1.str().c_str()); - ofs << ifs_tem1.rdbuf(); - ifs_tem1.close(); - for (auto &i : indptr) - { - ofs << " " << i; - } - ofs << std::endl; - } - - std::remove(tem1.str().c_str()); - } -} - -template void ModuleIO::output_single_R(std::ofstream& ofs, - const std::map>& XR, - const double& sparse_threshold, - const bool& binary, - const Parallel_Orbitals& pv, - const bool& reduce); - -template void ModuleIO::output_single_R>(std::ofstream& ofs, - const std::map>>& XR, - const double& sparse_threshold, - const bool& binary, - const Parallel_Orbitals& pv, - const bool& reduce); diff --git a/source/module_io/single_R_io.h b/source/module_io/single_R_io.h deleted file mode 100644 index df6e0900a1..0000000000 --- a/source/module_io/single_R_io.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef SINGLE_R_IO_H -#define SINGLE_R_IO_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include - -namespace ModuleIO -{ - template - void output_single_R(std::ofstream& ofs, - const std::map>& XR, - const double& sparse_threshold, - const bool& binary, - const Parallel_Orbitals& pv, - const bool& reduce = true); -} - -#endif diff --git a/source/module_io/sparse_matrix.cpp b/source/module_io/sparse_matrix.cpp deleted file mode 100644 index 779760430a..0000000000 --- a/source/module_io/sparse_matrix.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "sparse_matrix.h" - -#include -#include - -#include "source_base/tool_quit.h" - -namespace ModuleIO -{ - -/** - * @brief Add value to the matrix with row and column indices - */ -template -void SparseMatrix::insert(int row, int col, T value) -{ - if (row < 0 || row >= _rows || col < 0 || col >= _cols) - { - ModuleBase::WARNING_QUIT("SparseMatrix::addValue", "row or col index out of range"); - } - if (std::abs(value) > _sparse_threshold) - { - elements[std::make_pair(row, col)] = value; - } -} - -/** - * @brief Print to CSR format - */ -template -void SparseMatrix::printToCSR(std::ostream& ofs, int precision) -{ - // Initialize the CSR arrays - std::vector csr_row_ptr; - csr_row_ptr.assign(_rows + 1, 0); - - // print the CSR values - for (const auto &element : elements) - { - ofs << " " << std::fixed << std::scientific << std::setprecision(precision) << element.second; - } - ofs << std::endl; - // print the CSR column indices - for (const auto &element : elements) - { - ofs << " " << element.first.second; - int row = element.first.first; - csr_row_ptr[row + 1]++; - } - ofs << std::endl; - - // Compute the row pointers - for (int i = 1; i <= _rows; i++) - { - csr_row_ptr[i] += csr_row_ptr[i - 1]; - } - - // print the CSR row pointers - for (int i = 0; i < csr_row_ptr.size(); i++) - { - ofs << " " << csr_row_ptr[i]; - } - ofs << std::endl; -} - -/** - * @brief Read CSR data from arrays - */ -template -void SparseMatrix::readCSR(const std::vector& values, - const std::vector& col_ind, - const std::vector& row_ptr) -{ - if (row_ptr.size() != static_cast(_rows) + 1) - { - ModuleBase::WARNING_QUIT("SparseMatrix::readCSR", "Invalid row_ptr size"); - } - if (col_ind.size() != values.size()) - { - ModuleBase::WARNING_QUIT("SparseMatrix::readCSR", "Column indices and values size mismatch"); - } - - elements.clear(); - for (int row = 0; row < _rows; row++) - { - for (int idx = row_ptr[row]; idx < row_ptr[row + 1]; idx++) - { - elements[std::make_pair(row, col_ind[idx])] = values[idx]; - } - } -} - -// define the operator to index a matrix element -template -T SparseMatrix::operator()(int row, int col) const -{ - if (row < 0 || row >= _rows || col < 0 || col >= _cols) - { - ModuleBase::WARNING_QUIT("SparseMatrix::operator()", "row or col index out of range"); - } - auto it = elements.find(std::make_pair(row, col)); - if (it != elements.end()) - { - return it->second; - } - else - { - return static_cast(0); - } -} - -// Explicit instantiation of template classes -template class SparseMatrix; -template class SparseMatrix>; - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/sparse_matrix.h b/source/module_io/sparse_matrix.h deleted file mode 100644 index 79e427a394..0000000000 --- a/source/module_io/sparse_matrix.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef SPARSE_MATRIX_H -#define SPARSE_MATRIX_H - -#include -#include -#include -#include - -namespace ModuleIO -{ - -/** - * @brief Sparse matrix class designed mainly for csr format input and output. - * @details - * The sparse matrix is stored in a map. - * The map key is a pair of row and column indices. - * The map value is the matrix element. - * The matrix element is stored only if its absolute value is greater than the threshold. - * The threshold is set to 1.0e-10 by default. - * @tparam T data type, it can be double or std::complex - */ -template -class SparseMatrix -{ - public: - // Default constructor - SparseMatrix() : _rows(0), _cols(0) - { - } - - SparseMatrix(int rows, int cols) : _rows(rows), _cols(cols) - { - } - - // add value to the matrix with row and column indices - void insert(int row, int col, T value); - - // print data in CSR (Compressed Sparse Row) format - void printToCSR(std::ostream& ofs, int precision = 8); - - // read CSR data from arrays - void readCSR(const std::vector& values, const std::vector& col_ind, const std::vector& row_ptr); - - // set number of rows - void setRows(int rows) - { - _rows = rows; - } - - // set number of columns - void setCols(int cols) - { - _cols = cols; - } - - // get number of rows - int getRows() const - { - return _rows; - } - - // get number of columns - int getCols() const - { - return _cols; - } - - // define the operator to index a matrix element - T operator()(int row, int col)const; - - // set the threshold - void setSparseThreshold(double sparse_threshold) - { - _sparse_threshold = sparse_threshold; - } - - // get the threshold - double getSparseThreshold() const - { - return _sparse_threshold; - } - - // get the number of non-zero elements - int getNNZ() const - { - return elements.size(); - } - - // get elements - const std::map, T>& getElements() const - { - return elements; - } - - private: - int _rows; - int _cols; - std::map, T> elements; - double _sparse_threshold = 1.0e-10; -}; // class SparseMatrix - -} // namespace ModuleIO - -#endif // SPARSE_MATRIX_H \ No newline at end of file diff --git a/source/module_io/td_current_io.cpp b/source/module_io/td_current_io.cpp deleted file mode 100644 index c0a76a4612..0000000000 --- a/source/module_io/td_current_io.cpp +++ /dev/null @@ -1,634 +0,0 @@ -#include "td_current_io.h" - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/libm/libm.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/tool_threading.h" -#include "source_base/vector3.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -#ifdef __LCAO -void ModuleIO::cal_tmp_DM(const UnitCell& ucell, - elecstate::DensityMatrix, double>& DM_real, - elecstate::DensityMatrix, double>& DM_imag, - int nspin_dm) -{ - ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); - for (int is = 1; is <= nspin_dm; ++is) - { - for (int ik = 0; ik < DM_real.get_DMK_nks() / nspin_dm; ++ik) - { - cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is, false); - } - } - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); -} -template -void ModuleIO::write_current(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra) -{ - - ModuleBase::TITLE("ModuleIO", "write_current"); - ModuleBase::timer::tick("ModuleIO", "write_current"); - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - if (PARAM.inp.td_stype!=1) - { - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = cal_current->get_current_term_pointer(dir); - } - } - else - { - if (TD_info::td_vel_op == nullptr) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); - } - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); - } - } - double omega=ucell.omega; - // construct a DensityMatrix object - // Since the function cal_dm_psi do not suport DMR in complex type, I replace it with two DMR in double type. Should - // be refactored in the future. - const int nspin0 = PARAM.inp.nspin; - const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; - elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - // calculate DMK - elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); - - // init DMR - DM_real.init_DMR(ra, &ucell); - DM_imag.init_DMR(ra, &ucell); - cal_tmp_DM(ucell, DM_real, DM_imag, nspin_dm); - //DM_real.sum_DMR_spin(); - //DM_imag.sum_DMR_spin(); - - double current_total[3] = {0.0, 0.0, 0.0}; -#ifdef _OPENMP -#pragma omp parallel - { - double local_current[3] = {0.0, 0.0, 0.0}; -#else - // ModuleBase::matrix& local_soverlap = soverlap; - double* local_current = current_total; -#endif - ModuleBase::Vector3 tau1, dtau, tau2; - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - // get iat1 - int iat1 = ucell.itia2iat(T1, I1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int cb = 0; cb < ra.na_each[iat]; ++cb) - { - const int T2 = ra.info[iat][cb][3]; - const int I2 = ra.info[iat][cb][4]; - - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - Atom* atom2 = &ucell.atoms[T2]; - - // get iat2 - int iat2 = ucell.itia2iat(T2, I2); - double Rx = ra.info[iat][cb][0]; - double Ry = ra.info[iat][cb][1]; - double Rz = ra.info[iat][cb][2]; - //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; - // get BaseMatrix - hamilt::BaseMatrix* tmp_matrix_real - = DM_real.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix* tmp_matrix_imag - = DM_imag.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); - // refactor - hamilt::BaseMatrix>* tmp_m_rvx - = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvy - = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvz - = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); - if (tmp_matrix_real == nullptr) - { - continue; - } - int row_ap = pv->atom_begin_row[iat1]; - int col_ap = pv->atom_begin_col[iat2]; - // get DMR - for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) - { - for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) - { - double dm2d1_real = tmp_matrix_real->get_value(mu, nu); - double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); - - std::complex rvx = {0, 0}; - std::complex rvy = {0, 0}; - std::complex rvz = {0, 0}; - - if (tmp_m_rvx != nullptr) - { - rvx = tmp_m_rvx->get_value(mu, nu); - rvy = tmp_m_rvy->get_value(mu, nu); - rvz = tmp_m_rvz->get_value(mu, nu); - } - //std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; - // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; - //std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; - local_current[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); - local_current[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); - local_current[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); - } // end kk - } // end jj - } // end cb - } // end iat -#ifdef _OPENMP -#pragma omp critical(cal_current_k_reduce) - { - for (int i = 0; i < 3; ++i) - { - current_total[i] += local_current[i]; - } - } - } -#endif - Parallel_Reduce::reduce_all(current_total, 3); - // write end - if (GlobalV::MY_RANK == 0) - { - std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; - std::ofstream fout; - fout.open(filename, std::ios::app); - fout << std::setprecision(16); - fout << std::scientific; - fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; - fout.close(); - } - - ModuleBase::timer::tick("ModuleIO", "write_current"); - return; -} -void ModuleIO::cal_tmp_DM_k(const UnitCell& ucell, - elecstate::DensityMatrix, double>& DM_real, - elecstate::DensityMatrix, double>& DM_imag, - const int ik, - const int nspin, - const int is, - const bool reset) -{ - ModuleBase::TITLE("ModuleIO", "cal_tmp_DM_k"); - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); - int ld_hk = DM_real.get_paraV_pointer()->nrow; - int ld_hk2 = 2 * ld_hk; - // tmp for is - int ik_begin = DM_real.get_DMK_nks() / nspin * (is - 1); // jump nk for spin_down if nspin==2 - //sum spin up and down into up - hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[0]; - hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[0]; - if(reset) - { - tmp_DMR_real->set_zero(); - tmp_DMR_imag->set_zero(); - } -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < tmp_DMR_real->size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp_ap_real = tmp_DMR_real->get_atom_pair(i); - hamilt::AtomPair& tmp_ap_imag = tmp_DMR_imag->get_atom_pair(i); - int iat1 = tmp_ap_real.get_atom_i(); - int iat2 = tmp_ap_real.get_atom_j(); - // get global indexes of whole matrix for each atom in this process - int row_ap = DM_real.get_paraV_pointer()->atom_begin_row[iat1]; - int col_ap = DM_real.get_paraV_pointer()->atom_begin_col[iat2]; - // SOC - std::vector> tmp_DMR; - if (PARAM.inp.nspin == 4) - { - tmp_DMR.resize(tmp_ap_real.get_size()); - } - for (int ir = 0; ir < tmp_ap_real.get_R_size(); ++ir) - { - const ModuleBase::Vector3 r_index = tmp_ap_real.get_R_index(ir); - hamilt::BaseMatrix* tmp_matrix_real = tmp_ap_real.find_matrix(r_index); - hamilt::BaseMatrix* tmp_matrix_imag = tmp_ap_imag.find_matrix(r_index); -#ifdef __DEBUG - if (tmp_matrix_real == nullptr) - { - std::cout << "tmp_matrix is nullptr" << std::endl; - continue; - } -#endif - // only ik - if (PARAM.inp.nspin != 4) - { - double arg_td = 0.0; - if(elecstate::H_TDDFT_pw::stype == 2) - { - //cal tddft phase for hybrid gague - const int iat1 = tmp_ap_real.get_atom_i(); - const int iat2 = tmp_ap_real.get_atom_j(); - ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); - double& tmp_lat0 = ucell.lat0; - arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; - } - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - // set DMR element - double* tmp_DMR_real_pointer = tmp_matrix_real->get_pointer(); - double* tmp_DMR_imag_pointer = tmp_matrix_imag->get_pointer(); - std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin); - double* DMK_real_pointer = nullptr; - double* DMK_imag_pointer = nullptr; - // jump DMK to fill DMR - // DMR is row-major, DMK is column-major - tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; - for (int mu = 0; mu < DM_real.get_paraV_pointer()->get_row_size(iat1); ++mu) - { - DMK_real_pointer = (double*)tmp_DMK_pointer; - DMK_imag_pointer = DMK_real_pointer + 1; - // calculate real part - BlasConnector::axpy(DM_real.get_paraV_pointer()->get_col_size(iat2), - -kphase.imag(), - DMK_imag_pointer, - ld_hk2, - tmp_DMR_real_pointer, - 1); - BlasConnector::axpy(DM_real.get_paraV_pointer()->get_col_size(iat2), - kphase.real(), - DMK_real_pointer, - ld_hk2, - tmp_DMR_real_pointer, - 1); - // calculate imag part - BlasConnector::axpy(DM_imag.get_paraV_pointer()->get_col_size(iat2), - kphase.imag(), - DMK_real_pointer, - ld_hk2, - tmp_DMR_imag_pointer, - 1); - BlasConnector::axpy(DM_imag.get_paraV_pointer()->get_col_size(iat2), - kphase.real(), - DMK_imag_pointer, - ld_hk2, - tmp_DMR_imag_pointer, - 1); - tmp_DMK_pointer += 1; - tmp_DMR_real_pointer += DM_real.get_paraV_pointer()->get_col_size(iat2); - tmp_DMR_imag_pointer += DM_imag.get_paraV_pointer()->get_col_size(iat2); - } - } - // treat DMR as pauli matrix when NSPIN=4 - if (PARAM.inp.nspin == 4) - { - tmp_DMR.assign(tmp_ap_real.get_size(), std::complex(0.0, 0.0)); - { - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - double arg_td = 0.0; - if(elecstate::H_TDDFT_pw::stype == 2) - { - //new - //cal tddft phase for mixing gague - const int iat1 = tmp_ap_real.get_atom_i(); - const int iat2 = tmp_ap_real.get_atom_j(); - ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); - double& tmp_lat0 = ucell.lat0; - arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; - } - const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - // set DMR element - std::complex* tmp_DMR_pointer = tmp_DMR.data(); - std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin);; - double* DMK_real_pointer = nullptr; - double* DMK_imag_pointer = nullptr; - // jump DMK to fill DMR - // DMR is row-major, DMK is column-major - tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; - for (int mu = 0; mu < tmp_ap_real.get_row_size(); ++mu) - { - BlasConnector::axpy(tmp_ap_real.get_col_size(), - kphase, - tmp_DMK_pointer, - ld_hk, - tmp_DMR_pointer, - 1); - tmp_DMK_pointer += 1; - tmp_DMR_pointer += tmp_ap_real.get_col_size(); - } - } - int npol = 2; - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - int step_trace[4]; - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = tmp_ap_real.get_col_size() * is + is2; - } - } - std::complex tmp[4]; - double* target_DMR_real = tmp_matrix_real->get_pointer(); - double* target_DMR_imag = tmp_matrix_imag->get_pointer(); - std::complex* tmp_DMR_pointer = tmp_DMR.data(); - for (int irow = 0; irow < tmp_ap_real.get_row_size(); irow += 2) - { - for (int icol = 0; icol < tmp_ap_real.get_col_size(); icol += 2) - { - // catch the 4 spin component value of one orbital pair - tmp[0] = tmp_DMR_pointer[icol + step_trace[0]]; - tmp[1] = tmp_DMR_pointer[icol + step_trace[1]]; - tmp[2] = tmp_DMR_pointer[icol + step_trace[2]]; - tmp[3] = tmp_DMR_pointer[icol + step_trace[3]]; - // transfer to Pauli matrix and save the real part - // save them back to the tmp_matrix - target_DMR_real[icol + step_trace[0]] += tmp[0].real() + tmp[3].real(); - target_DMR_real[icol + step_trace[1]] += tmp[1].real() + tmp[2].real(); - target_DMR_real[icol + step_trace[2]] - += -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() - target_DMR_real[icol + step_trace[3]] += tmp[0].real() - tmp[3].real(); - //imag part - target_DMR_imag[icol + step_trace[0]] += tmp[0].imag() + tmp[3].imag(); - target_DMR_imag[icol + step_trace[1]] += tmp[1].imag() + tmp[2].imag(); - target_DMR_imag[icol + step_trace[2]] - += tmp[1].real() - tmp[2].real(); // (i * (rho_updown - rho_downup)).real() - target_DMR_imag[icol + step_trace[3]] += tmp[0].imag() - tmp[3].imag(); - } - tmp_DMR_pointer += tmp_ap_real.get_col_size() * 2; - target_DMR_real += tmp_ap_real.get_col_size() * 2; - target_DMR_imag += tmp_ap_real.get_col_size() * 2; - } - } - } - } - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); -} -template -void ModuleIO::write_current_eachk(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra) -{ - - ModuleBase::TITLE("ModuleIO", "write_current"); - ModuleBase::timer::tick("ModuleIO", "write_current"); - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - if (PARAM.inp.td_stype != 1) - { - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = cal_current->get_current_term_pointer(dir); - } - } - else - { - if (TD_info::td_vel_op == nullptr) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); - } - for (int dir = 0; dir < 3; dir++) - { - current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); - } - } - double omega=ucell.omega; - // construct a DensityMatrix object - // Since the function cal_dm_psi do not suport DMR in complex type, - // I replace it with two DMR in double type. - // Should be refactored in the future. - - const int nspin0 = PARAM.inp.nspin; - const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; - elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - // calculate DMK - elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); - - // init DMR - DM_real.init_DMR(ra, &ucell); - DM_imag.init_DMR(ra, &ucell); - - int nks = DM_real.get_DMK_nks() / nspin_dm; - double current_total[3] = {0.0, 0.0, 0.0}; - for (int is = 1; is <= nspin_dm; ++is) - { - for (int ik = 0; ik < nks; ++ik) - { - cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is); - // check later - double current_ik[3] = {0.0, 0.0, 0.0}; -#ifdef _OPENMP -#pragma omp parallel - { - int num_threads = omp_get_num_threads(); - double local_current_ik[3] = {0.0, 0.0, 0.0}; -#else - // ModuleBase::matrix& local_soverlap = soverlap; - double* local_current_ik = current_ik; -#endif - - ModuleBase::Vector3 tau1, dtau, tau2; - -#ifdef _OPENMP -#pragma omp for schedule(dynamic) -#endif - for (int iat = 0; iat < ucell.nat; iat++) - { - const int T1 = ucell.iat2it[iat]; - Atom* atom1 = &ucell.atoms[T1]; - const int I1 = ucell.iat2ia[iat]; - // get iat1 - int iat1 = ucell.itia2iat(T1, I1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - for (int cb = 0; cb < ra.na_each[iat]; ++cb) - { - const int T2 = ra.info[iat][cb][3]; - const int I2 = ra.info[iat][cb][4]; - - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - Atom* atom2 = &ucell.atoms[T2]; - - // get iat2 - int iat2 = ucell.itia2iat(T2, I2); - double Rx = ra.info[iat][cb][0]; - double Ry = ra.info[iat][cb][1]; - double Rz = ra.info[iat][cb][2]; - //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; - // get BaseMatrix - hamilt::BaseMatrix* tmp_matrix_real - = DM_real.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix* tmp_matrix_imag - = DM_imag.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); - // refactor - hamilt::BaseMatrix>* tmp_m_rvx - = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvy - = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); - hamilt::BaseMatrix>* tmp_m_rvz - = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); - if (tmp_matrix_real == nullptr) - { - continue; - } - int row_ap = pv->atom_begin_row[iat1]; - int col_ap = pv->atom_begin_col[iat2]; - // get DMR - for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) - { - for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) - { - double dm2d1_real = tmp_matrix_real->get_value(mu, nu); - double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); - - std::complex rvx = {0, 0}; - std::complex rvy = {0, 0}; - std::complex rvz = {0, 0}; - - if (tmp_m_rvx != nullptr) - { - rvx = tmp_m_rvx->get_value(mu, nu); - rvy = tmp_m_rvy->get_value(mu, nu); - rvz = tmp_m_rvz->get_value(mu, nu); - } - // std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; - // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; - // std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; - local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); - local_current_ik[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); - local_current_ik[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); - } // end kk - } // end jj - } // end cb - } // end iat -#ifdef _OPENMP -#pragma omp critical(cal_current_k_reduce) - { - for (int i = 0; i < 3; ++i) - { - current_ik[i] += local_current_ik[i]; - } - } - } -#endif - Parallel_Reduce::reduce_all(current_ik, 3); - for (int i = 0; i < 3; ++i) - { - current_total[i] += current_ik[i]; - } - // MPI_Reduce(local_current_ik, current_ik, 3, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); - if (GlobalV::MY_RANK == 0 && TD_info::out_current_k) - { - std::string filename = PARAM.globalv.global_out_dir + "current_spin" + std::to_string(is) + "_ik" - + std::to_string(ik) + ".dat"; - std::ofstream fout; - fout.open(filename, std::ios::app); - fout << std::setprecision(16); - fout << std::scientific; - fout << istep << " " << current_ik[0]/omega << " " << current_ik[1]/omega << " " << current_ik[2]/omega << std::endl; - fout.close(); - } - // write end - } // end nks - } // end is - if (GlobalV::MY_RANK == 0) - { - std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; - std::ofstream fout; - fout.open(filename, std::ios::app); - fout << std::setprecision(16); - fout << std::scientific; - fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; - fout.close(); - } - - ModuleBase::timer::tick("ModuleIO", "write_current"); - return; -} -template -void ModuleIO::write_current_eachk( - const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra); -template -void ModuleIO::write_current_eachk>(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op>* cal_current, - Record_adj& ra); -template -void ModuleIO::write_current(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra); -template -void ModuleIO::write_current>(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op>* cal_current, - Record_adj& ra); -#endif //__LCAO - diff --git a/source/module_io/td_current_io.h b/source/module_io/td_current_io.h deleted file mode 100644 index c5642fcefa..0000000000 --- a/source/module_io/td_current_io.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef TD_CURRENT_IO_H -#define TD_CURRENT_IO_H - -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_estate/elecstate_lcao.h" -#include "source_estate/module_dm/density_matrix.h" -#include "source_psi/psi.h" -#include "module_hamilt_lcao/module_tddft/velocity_op.h" - -namespace ModuleIO -{ -#ifdef __LCAO -/// @brief func to output current, only used in tddft -template -void write_current_eachk(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra); -template -void write_current(const UnitCell& ucell, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - const Velocity_op* cal_current, - Record_adj& ra); - -/// @brief calculate sum_n[šœŒ_(š‘›š‘˜,šœ‡šœˆ)] for current calculation -void cal_tmp_DM_k(const UnitCell& ucell, - elecstate::DensityMatrix, double>& DM_real, - elecstate::DensityMatrix, double>& DM_imag, - const int ik, - const int nspin, - const int is, - const bool reset = true); - -void cal_tmp_DM(const UnitCell& ucell, - elecstate::DensityMatrix, double>& DM_real, - elecstate::DensityMatrix, double>& DM_imag, - const int nspin); - -#endif // __LCAO -} // namespace ModuleIO -#endif // W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_TD_CURRENT_IO_H diff --git a/source/module_io/test/CMakeLists.txt b/source/module_io/test/CMakeLists.txt deleted file mode 100644 index d8b9f5f933..0000000000 --- a/source/module_io/test/CMakeLists.txt +++ /dev/null @@ -1,284 +0,0 @@ -remove_definitions(-D__MLALGO) -remove_definitions(-D__CUDA) -remove_definitions(-D__ROCM) -remove_definitions(-D__EXX) - -install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -install(FILES INPUTs DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - -AddTest( - TARGET MODULE_IO_input_test_para - LIBS parameter ${math_libs} base device io_input - SOURCES read_input_ptest.cpp -) - -add_test(NAME MODULE_IO_input_test_para_4 - COMMAND mpirun -np 4 ./MODULE_IO_input_test_para - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_read_exit_file_test - LIBS parameter ${math_libs} base device - SOURCES read_exit_file_test.cpp ../read_exit_file.cpp -) - -add_test(NAME MODULE_IO_read_exit_file_test_para_4 - COMMAND mpirun -np 4 ./MODULE_IO_read_exit_file_test - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_winput_test - LIBS parameter ${math_libs} base device - SOURCES winput_test.cpp ../winput.cpp -) - -AddTest( - TARGET MODULE_IO_output_test - LIBS parameter ${math_libs} base device - SOURCES output_test.cpp ../output.cpp -) - -AddTest( - TARGET MODULE_IO_binstream_test - SOURCES binstream_test.cpp ../binstream.cpp -) - -AddTest( - TARGET MODULE_IO_write_eig_occ_test - LIBS parameter ${math_libs} base device symmetry - SOURCES write_eig_occ_test.cpp ../write_eig_occ.cpp ../output.cpp ../../source_cell/parallel_kpoints.cpp ../../source_cell/klist.cpp ../../source_cell/k_vector_utils.cpp - ../cif_io.cpp -) - -AddTest( - TARGET MODULE_IO_cal_dos - LIBS parameter ${math_libs} base device - SOURCES cal_dos_test.cpp ../cal_dos.cpp -) - -AddTest( - TARGET MODULE_IO_write_dos_pw - LIBS parameter ${math_libs} base device symmetry - SOURCES write_dos_pw_test.cpp ../cal_dos.cpp ../write_dos_pw.cpp ../output.cpp ../../source_cell/parallel_kpoints.cpp ../../source_cell/klist.cpp ../nscf_fermi_surf.cpp ../../source_cell/k_vector_utils.cpp -) - -AddTest( - TARGET MODULE_IO_print_info - LIBS parameter ${math_libs} base device symmetry cell_info - SOURCES print_info_test.cpp ../print_info.cpp ../output.cpp ../../source_cell/klist.cpp ../../source_cell/parallel_kpoints.cpp ../../source_cell/k_vector_utils.cpp -) - -AddTest( - TARGET MODULE_IO_single_R_test - LIBS parameter ${math_libs} - SOURCES single_R_io_test.cpp ../single_R_io.cpp - ../../source_base/global_variable.cpp - ../../source_base/parallel_reduce.cpp - ../../source_base/parallel_common.cpp - ../../source_base/parallel_global.cpp - ../../source_base/parallel_comm.cpp -) - -AddTest( - TARGET MODULE_IO_write_wfc_nao - LIBS parameter ${math_libs} base psi device - SOURCES write_wfc_nao_test.cpp ../filename.cpp ../write_wfc_nao.cpp ../../source_basis/module_ao/parallel_orbitals.cpp ../binstream.cpp -) - -install(FILES write_wfc_nao_para.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -find_program(BASH bash) -add_test(NAME MODULE_IO_write_wfc_nao_para - COMMAND ${BASH} write_wfc_nao_para.sh - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_write_orb_info - LIBS parameter ${math_libs} base device cell_info - SOURCES write_orb_info_test.cpp ../write_orb_info.cpp ../output.cpp -) - -AddTest( - TARGET MODULE_IO_parse_args - SOURCES parse_args_test.cpp ../parse_args.cpp -) - -AddTest( - TARGET MODULE_IO_bessel_basis_test - LIBS parameter ${math_libs} base device - SOURCES bessel_basis_test.cpp ../bessel_basis.cpp -) - -AddTest( - TARGET MODULE_IO_output_log_test - LIBS parameter base ${math_libs} device - SOURCES ../output_log.cpp outputlog_test.cpp ../../source_basis/module_pw/test/test_tool.cpp -) - -AddTest( - TARGET MODULE_IO_sparse_matrix_test - LIBS parameter base ${math_libs} device - SOURCES sparse_matrix_test.cpp ../sparse_matrix.cpp -) - -AddTest( - TARGET MODULE_IO_file_reader_test - LIBS parameter base ${math_libs} device - SOURCES file_reader_test.cpp ../file_reader.cpp -) - -AddTest( - TARGET MODULE_IO_csr_reader_test - LIBS parameter base ${math_libs} device - SOURCES csr_reader_test.cpp ../csr_reader.cpp ../file_reader.cpp ../sparse_matrix.cpp -) - -AddTest( - TARGET MODULE_IO_read_rhog_test - LIBS parameter ${math_libs} base device planewave - SOURCES read_rhog_test.cpp ../rhog_io.cpp ../binstream.cpp ../../source_basis/module_pw/test/test_tool.cpp -) - -if(ENABLE_LCAO) -AddTest( - TARGET MODULE_IO_to_qo_test - LIBS parameter base ${math_libs} device numerical_atomic_orbitals container orb - SOURCES - to_qo_test.cpp - ../to_qo_kernel.cpp - ../to_qo_mpi.cpp - ../to_qo_structures.cpp - ../../source_cell/atom_spec.cpp - ../../source_cell/parallel_kpoints.cpp - ../../source_cell/test/support/mock_unitcell.cpp - ../../module_hamilt_lcao/hamilt_lcaodft/center2_orb.cpp - ../orb_io.cpp -) -endif() - -AddTest( - TARGET MODULE_IO_read_wfc_pw_test - LIBS parameter base ${math_libs} device planewave - SOURCES read_wfc_pw_test.cpp ../read_wfc_pw.cpp ../binstream.cpp ../../source_basis/module_pw/test/test_tool.cpp -) - -add_test(NAME MODULE_IO_read_wfc_pw_test_parallel - COMMAND mpirun -np 4 ./MODULE_IO_read_wfc_pw_test - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_read_wf2rho_pw_test - LIBS parameter base ${math_libs} device planewave psi - SOURCES read_wf2rho_pw_test.cpp ../read_wfc_pw.cpp ../read_wf2rho_pw.cpp ../binstream.cpp ../../source_basis/module_pw/test/test_tool.cpp ../../source_estate/module_charge/charge_mpi.cpp ../filename.cpp ../write_wfc_pw.cpp -) - -add_test(NAME MODULE_IO_read_wf2rho_pw_parallel - COMMAND mpirun -np 4 ./MODULE_IO_read_wf2rho_pw_test - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - - -AddTest( - TARGET MODULE_IO_numerical_basis_test - LIBS parameter base ${math_libs} device numerical_atomic_orbitals container orb - SOURCES numerical_basis_test.cpp - ../numerical_basis_jyjy.cpp - ../../module_hamilt_lcao/hamilt_lcaodft/center2_orb.cpp - ../orb_io.cpp -) - - -AddTest( - TARGET MODULE_IO_mulliken_test - LIBS parameter base ${math_libs} device - SOURCES output_mulliken_test.cpp output_mulliken_mock.cpp ../output_mulliken.cpp - ../../source_cell/cell_index.cpp - ../../source_basis/module_ao/parallel_orbitals.cpp - ../orb_io.cpp -) - -#if(ENABLE_LCAO) -#AddTest( -# TARGET MODULE_IO_read_wfc_lcao_test -# LIBS parameter base ${math_libs} device -# SOURCES read_wfc_lcao_test.cpp ../read_wfc_lcao.cpp -#) - -#add_test(NAME MODULE_IO_read_wfc_lcao_test_parallel -# COMMAND mpirun -np 4 ./MODULE_IO_read_wfc_lcao_test -# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -#) - -#endif() - -AddTest( - TARGET MODULE_IO_cif_io_test - LIBS parameter base ${math_libs} device - SOURCES cif_io_test.cpp ../cif_io.cpp -) - -add_test(NAME MODULE_IO_cif_io_test_parallel - COMMAND mpirun -np 4 ./MODULE_IO_cif_io_test - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_orb_io_test - LIBS parameter base ${math_libs} device - SOURCES orb_io_test.cpp ../orb_io.cpp -) - -add_test(NAME MODULE_IO_orb_io_test_parallel - COMMAND mpirun -np 4 ./MODULE_IO_orb_io_test - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_dmk_io - LIBS parameter ${math_libs} base device cell_info - SOURCES io_dmk_test.cpp ../io_dmk.cpp ../output.cpp -) - -add_test( - NAME MODULE_IO_dmk_io_parallel - COMMAND mpirun -np 2 ./MODULE_IO_dmk_io - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -AddTest( - TARGET MODULE_IO_read_wfc_nao_test - LIBS parameter ${math_libs} base device - SOURCES read_wfc_nao_test.cpp ../read_wfc_nao.cpp ../../source_psi/psi.cpp ../../source_basis/module_ao/parallel_orbitals.cpp -) - -add_test( - NAME MODULE_IO_read_wfc_nao_test_parallel - COMMAND mpirun -np 2 ./MODULE_IO_read_wfc_nao_test - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -if(ENABLE_LCAO) -AddTest( - TARGET MODULE_IO_cal_pLpR_test - LIBS parameter base ${math_libs} device neighbor - SOURCES - cal_pLpR_test.cpp - ../cal_pLpR.cpp - ../../source_basis/module_ao/ORB_atomic_lm.cpp - ../../source_basis/module_ao/ORB_atomic.cpp - ../../source_basis/module_nao/radial_set.cpp - ../../source_basis/module_nao/numerical_radial.cpp - ../../source_basis/module_nao/beta_radials.cpp - ../../source_basis/module_nao/hydrogen_radials.cpp - ../../source_basis/module_nao/pswfc_radials.cpp - ../../source_basis/module_nao/atomic_radials.cpp - ../../source_basis/module_nao/sphbes_radials.cpp - ../../source_basis/module_nao/two_center_integrator.cpp - ../../source_basis/module_nao/two_center_table.cpp - ../../source_basis/module_nao/real_gaunt_table.cpp - ../../source_basis/module_nao/radial_collection.cpp -) -endif() diff --git a/source/module_io/test/INPUTs b/source/module_io/test/INPUTs deleted file mode 100644 index 618420b3b5..0000000000 --- a/source/module_io/test/INPUTs +++ /dev/null @@ -1,3 +0,0 @@ - -./support/BesselBasis_UnitTest_C4_AtomType0.html - diff --git a/source/module_io/test/bessel_basis_test.cpp b/source/module_io/test/bessel_basis_test.cpp deleted file mode 100644 index 105d26d74a..0000000000 --- a/source/module_io/test/bessel_basis_test.cpp +++ /dev/null @@ -1,563 +0,0 @@ -/// @details unit test for module_io/bessel_basis, not tested functions: readin_C4, allocate_C4 - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -#include "../bessel_basis.h" -#include "../../source_cell/unitcell.h" -#include "../../source_estate/magnetism.h" - -#ifdef __LCAO -#include "../../source_cell/setup_nonlocal.h" -#endif -#include "gtest/gtest.h" - - -#ifdef __MPI -#include -#endif - -/// @brief Simpson integral -/// @attention this function is a COMPLETE version, but there is no improvement in performance. -/// @param x variable stored in a vector -/// @param y function value stored in a vector -/// @return integral value -double SimpsonIntegral(const std::vector &x, const std::vector &y) -{ - double result = 0.0; - result += (y[0] + y[y.size() - 1]); - /* x and y must have the same size and their length must be a same odd number */ - assert(x.size() == y.size()); - assert(x.size() % 2 == 1); - double h = x[1] - x[0]; - for (int i = 1; i < x.size() - 1; i+=2) - { - result += (2*y[i] + 4*y[i+1]); - } - result *= h/3; - return result; -} -/// @brief recursive definition of 1st-kind Spherical Bessel function of the first kind -/// @attention this function is a COMPLETE version, can replace the one in basic mathematical library -/// @param l order of 1st-kind spherical Bessel function -/// @param x variable -/// @return value of 1st-kind spherical Bessel function -double SphericalBessel(int l, double x) { - /* c++ cannot handle limits well */ - if (x == 0) { - if (l == 0) { - return 1; - } - else { - return 0; - } - } - else { - if (l == 0) { - return std::sin(x) / x; - } - else if (l == 1) { - return (std::sin(x) / (x * x)) - std::cos(x) / x; - } - else { - return ((2 * l - 1) / x) * SphericalBessel(l - 1, x) - SphericalBessel(l - 2, x); - } - } -} -/// @brief 1st-kind Spherical Bessel function of the first kind mapped on realspace grid -/// @attention this function is a COMPLETE version, can replace the one in basic mathematical library -/// @param l order of 1st-kind spherical Bessel function -/// @param q wave vector -/// @param r realspace grid -/// @return function value on realspace grid -std::vector CalculateSphericalBessel(int l, double q, const std::vector& r) { - std::vector bessel; - for (const auto& radius : r) { - double x = q * radius; - double besselValue = SphericalBessel(l, x); - bessel.push_back(besselValue); - } - return bessel; -} -/// @brief Get the first p zeros of 1st-kind, l-ordered Spherical Bessel function from a constant table -/// @attention this function is a INCOMPLETE version, due to limited support of numerical table. -/// @param order l, angular momentum -/// @param number p, number of zeros needed -/// @return a vector of q, the q is from j_l(qr) -std::vector GetSphericalBesselZeros(int order, int number) { - std::map, double> zeros; - - zeros[{0, 1}] = 3.14159; zeros[{0, 2}] = 6.28318; zeros[{0, 3}] = 9.42477; - zeros[{0, 4}] = 12.5664; zeros[{0, 5}] = 15.708; zeros[{0, 6}] = 18.8495; - zeros[{0, 7}] = 21.9911; zeros[{0, 8}] = 25.1327; zeros[{0, 9}] = 28.2743; - zeros[{0, 10}] = 31.4159; - - zeros[{1, 1}] = 4.49341; zeros[{1, 2}] = 7.72525; zeros[{1, 3}] = 10.9041; - zeros[{1, 4}] = 14.0662; zeros[{1, 5}] = 17.2208; zeros[{1, 6}] = 20.3713; - zeros[{1, 7}] = 23.5181; zeros[{1, 8}] = 26.6617; zeros[{1, 9}] = 29.8029; - zeros[{1, 10}] = 32.9425; - - zeros[{2, 1}] = 5.76346; zeros[{2, 2}] = 9.09501; zeros[{2, 3}] = 12.3229; - zeros[{2, 4}] = 15.5146; zeros[{2, 5}] = 18.6861; zeros[{2, 6}] = 21.8457; - zeros[{2, 7}] = 24.9989; zeros[{2, 8}] = 28.1498; zeros[{2, 9}] = 31.2997; - zeros[{2, 10}] = 34.4491; - - zeros[{3, 1}] = 7.01559; zeros[{3, 2}] = 10.4013; zeros[{3, 3}] = 13.5821; - zeros[{3, 4}] = 16.7496; zeros[{3, 5}] = 19.9023; zeros[{3, 6}] = 23.0446; - zeros[{3, 7}] = 26.1799; zeros[{3, 8}] = 29.3105; zeros[{3, 9}] = 32.4377; - zeros[{3, 10}] = 35.5629; - - zeros[{4, 1}] = 8.26356; zeros[{4, 2}] = 11.6209; zeros[{4, 3}] = 14.7965; - zeros[{4, 4}] = 17.9598; zeros[{4, 5}] = 21.113; zeros[{4, 6}] = 24.2583; - zeros[{4, 7}] = 27.3979; zeros[{4, 8}] = 30.5325; zeros[{4, 9}] = 33.6635; - zeros[{4, 10}] = 36.7914; - - zeros[{5, 1}] = 9.51045; zeros[{5, 2}] = 12.8377; zeros[{5, 3}] = 16.0106; - zeros[{5, 4}] = 19.1714; zeros[{5, 5}] = 22.3224; zeros[{5, 6}] = 25.4666; - zeros[{5, 7}] = 28.6055; zeros[{5, 8}] = 31.7408; zeros[{5, 9}] = 34.873; - zeros[{5, 10}] = 38.0025; - - std::vector result; - for (int i = 1; i <= number; ++i) { - result.push_back(zeros[{order, i}]); - } - return result; -} -/// @brief Get mod of q vector of Spherical Bessel functions, all q satisfy when r=`rcut`, j_l(qr)=0. -/// @details first solve the equation j_l(x) = 0, therefore get the table (l, k) -> x, where l is the order of SBF and k is the k-th zero of j_l(x). Then let x = q*rcut, therefore q = x/rcut, return it. -/// @attention this function itself is a COMPLETE version, while the function it called GetSphericalBesselZeros may be INCOMPLETE, due to limited support of numerical table. -/// @param order the angular momentum of Spherical Bessel functions -/// @param number number of q to be returned -/// @param rcut 'cutoff radius' of Spherical Bessel functions. When r=rcut, Spherical Bessel functions are zero, and for r>rcut, they are zero as required by concept of constructing localized atomic orbital. -/// @return a vector of q, the q is from j_l(qr) -std::vector GetqList(int order, int number, double rcut) { - std::vector qList; - std::vector zerosList = GetSphericalBesselZeros(order, number); - for (const auto& zero : zerosList) { - qList.push_back(zero / rcut); - } - return qList; -} -/// @brief overload operator * for vectors, elements will be multiplied one by one -/// @param x one vector -/// @param y another vector -/// @return vector after multiplication -std::vector operator*(const std::vector& x, const std::vector& y) { - std::vector result; - for (int i = 0; i < x.size(); ++i) { - result.push_back(x[i] * y[i]); - } - return result; -} -/// @brief init_TableOne for unit test -/// @attention this is a COMPLETE version of init_TableOne, can replace the one in module_io/bessel_basis.cpp -/// @param smooth whether to smooth the function (gaussian function) -/// @param sigma stddev of gaussian function for smoothing -/// @param ecutwfc control the number of Spheical Bessel functions -/// @param rcut cutoff radius of Spherical Bessel functions, r>rcut, Spherical Bessel functions are zero -/// @param lmax maximal angular momentum of Spherical Bessel functions -/// @param dr grid spacing of r -/// @param dk grid spacing of k -/// @return `std::vector>>` TableOne[angular momentum][index of Spherical Bessel function][Arbitrary wave vector k] -std::vector>> GenerateTableOne(const bool smooth, const double sigma, const double ecutwfc, const double rcut, const int lmax, const double dr, const double dk){ - std::vector rGrid; - std::vector SmoothFactor_rGrid; - int rGridNum = static_cast(rcut/dr) + 4; - if (rGridNum % 2 == 0) - { - rGridNum += 1; - } - for (int indexr=0; indexr kGrid; - int kGridNum = static_cast(sqrt(ecutwfc)/dk) + 4 + 1; - if (kGridNum % 2 == 0) - { - kGridNum += 1; - } - for (double indexk=0; indexk(sqrt(ecutwfc)*rcut/M_PI); - - std::vector>> TableOne; - - for (int l=0; l qList = GetqList(l, NumBesselFunction, rcut); - /* should initialize TableOne first */ - if (l == 0) - { - for (int l=0; l> Zeros2d; - for (int indexq=0; indexq Zeros1d; - for (int indexk=0; indexk jle_rGrid = CalculateSphericalBessel(l, qList[indexq], rGrid); - if (smooth) - { - jle_rGrid = jle_rGrid*SmoothFactor_rGrid; - } - for (int indexk=0; indexk jlk_rGrid = CalculateSphericalBessel(l, kGrid[indexk], rGrid); - std::vector function_rGrid = jlk_rGrid*jle_rGrid*rGrid*rGrid; - TableOne[l][indexq][indexk] = SimpsonIntegral(rGrid, function_rGrid); - } - } - } - return TableOne; -} -/// @brief Improved version of module_io/bessel_basis::readin_C4 and allocate_C4 functions, for generating C4 matrix but now with a higher speed on accessing elements -/// @attention function will read in total number of chi-s both from file and from input, and assert that they are the same. It is also just a INCOMPLETE version, for a complete version, HTML parser library will be included and the other parameter, NumAtomType, will also be used for calibrating data. -/// @param FileName name of external file where C4-stored file information is contained -/// @param NumAtomType number of atom types -/// @param l maximal angular momentum of localized orbitals -/// @param NumChi number of contracted spherical bessel functions to fit one atomic orbital -/// @param NumBesselFunction number of spherical bessel functions in one contracted spherical bessel function -/// @return a map whose key is a string of "atomtype l chi q", and value is the corresponding C4 value -std::unordered_map ReadinC4(const std::string &FileName, const int &NumAtomType, const int &l, const int &NumChi, const int &NumBesselFunction){ - std::unordered_map C4Map; - std::ifstream C4File(FileName); - /* plan to add an HTML parser library in the future... */ - std::string word; - bool b_ReadC4Line = false; - int TotalNumChi = 0; - - assert(!C4File.fail()); - while (C4File.good()) - { - if (!b_ReadC4Line){ - C4File >> word; - if (word == "") - { - b_ReadC4Line = true; - C4File >> word; /* n_chi value read */ - TotalNumChi = std::stoi(word); - assert(TotalNumChi == NumChi); - continue; - } - } - else{ - for (int indexchi = 0; indexchi < TotalNumChi; indexchi++){ - - C4File >> word; - C4File >> word; - C4File >> word; /* skip title1, 2 and 3 */ - - C4File >> word; std::string key = word; key += " "; - C4File >> word; key += word; key += " "; - C4File >> word; key += word; key += " "; - - for (int indexNumBesselFunction = 0; indexNumBesselFunction < NumBesselFunction; indexNumBesselFunction++) - { - std::string keyForMap = key + std::to_string(indexNumBesselFunction); - C4File >> word; - C4Map[keyForMap] = std::stod(word); - } - } - break; - } - } - C4File.close(); - return C4Map; -} -/// @brief Generate F_{alpha, l, chi, k} matrix -/// @param FileName name of external file where C4-stored file information is contained -/// @param NumAtomType number of atom types -/// @param l maximal angular momentum of localized orbitals -/// @param NumChi number of contracted spherical bessel functions to fit one atomic orbital -/// @param NumBesselFunction number of spherical bessel functions in one contracted spherical bessel function -/// @param vvv_d_TableOne Integral table, has subscripts (l, q, k), whose element is the result of integral int{dr r^2 jle(r)*jlk(r)}. l runs over angular momentum, q runs over all spherical bessel functions, k runs over k points sampled controlled by ecutwfc and dk by sqrt(ecutwfc)/dk + 1 + 4. -/// @return F_{alpha, l, chi, k} matrix, whose element is the result of sum_{q}{C4(alpha, l, chi, q)*TableOne(l, q, k)} -std::vector>>> GenerateFaln(const std::string &FileName, const int &NumAtomType, const int &lmax, const int &NumChi, const int &NumBesselFunction, std::vector>> vvv_d_TableOne){ - std::unordered_map umap_str_d_C4Map = ReadinC4(FileName, NumAtomType, lmax, NumChi, NumBesselFunction); - std::vector>>> vvvv_d_Faln; - for (int indexAtomType = 0; indexAtomType < NumAtomType; indexAtomType++) - { - std::vector>> vvv_d_Faln; - for (int indexl = 0; indexl < lmax+1; indexl++) - { - std::vector> vv_d_Faln; - for (int indexChi = 0; indexChi < NumChi; indexChi++) - { - std::vector v_d_Faln; - for (int indexk = 0; indexk < vvv_d_TableOne[0][0].size(); indexk++) - { - double Faln = 0.0; - for (int indexBesselFunction = 0; indexBesselFunction < NumBesselFunction; indexBesselFunction++) - { - std::string key = std::to_string(indexAtomType) + " " + std::to_string(indexl) + " " + std::to_string(indexChi) + " " + std::to_string(indexBesselFunction); - Faln += umap_str_d_C4Map[key]*vvv_d_TableOne[indexl][indexBesselFunction][indexk]; - } - v_d_Faln.push_back(Faln); - } - vv_d_Faln.push_back(v_d_Faln); - } - vvv_d_Faln.push_back(vv_d_Faln); - } - vvvv_d_Faln.push_back(vvv_d_Faln); - } - return vvvv_d_Faln; -} - -/* OVERLOAD (de)constructors... */ -pseudo::pseudo() -{ -} -pseudo::~pseudo() -{ -} -Atom::Atom() -{ -} -Atom::~Atom() -{ -} -Atom_pseudo::Atom_pseudo() -{ -} -Atom_pseudo::~Atom_pseudo() -{ -} -UnitCell::UnitCell() -{ -} -UnitCell::~UnitCell() -{ -} -Magnetism::Magnetism() -{ -} -Magnetism::~Magnetism() -{ -} - -#ifdef __LCAO -InfoNonlocal::InfoNonlocal() -{ -} -InfoNonlocal::~InfoNonlocal() -{ -} -#endif -/* OVERLOAD printM3 function? */ -/* -void output::printM3(std::ofstream &ofs, const std::string &description, const ModuleBase::Matrix3 &m) -{ -} -*/ - -/************************************************ - * unit test of bessel_basis.cpp - ***********************************************/ - -/* - * - Tested Functions: - * - InitTest: Bessel_Basis::init(start_from_file, ecutwfc, ntype, lmax_in, smooth, sigma, rcut_in, tol_in, ucell, dk, dr) - * - initialize Bessel_Basis class object with following steps: - * - call init_TableOne(...): calculate TableOne (l, ie, ik) = int{dr r^2 jle(r)*jlk(r)} (jle(r) and jlk(r) are Spherical Bessel functions) - * - return, unless set start_from_file = true, will also do the following: - * - call allocate_C4(...): allocate memory for C4 4d-matrix (it, il, in, ie) and set all elements to 1.0 - * - call readin_C4(...): read C4 value from external file and store in C4 4d-matrix - * - call init_Faln(...): calculate F_{aln}(it, il, in, ik) = sum_{ie}{C4(it, il, in, ie)*TableOne(il, ie, ik)} - * - PolynomialInterpolation2Test: Bessel_Basis::Polynomial_Interpolation2(const int &l, const int &ie, const double &gnorm) - * - return (cubic spline) interpolated element value of TableOne 3d-matrix - * - PolynomialInterpolationTest: Bessel_Basis::Polynomial_Interpolation(const int &it, const int &l, const int &ic, const double &gnorm) - * - return (cubic spline) interpolated element value of Faln 4d-matrix - */ - - -class TestBesselBasis : public ::testing::Test { -protected: - UnitCell ucell; - Bessel_Basis besselBasis; - - void SetUp() override { - ucell.ntype = 1; - ucell.lmax = 0; - ucell.nmax = 1; - - ucell.atoms = new Atom[1]; - ucell.atoms[0].l_nchi.resize(1, 1); - - ucell.atoms[0].nwl = 0; - /* setup_cell manually */ - } - void TearDown() override { - delete[] ucell.atoms; - } -}; - - TEST_F(TestBesselBasis, InitTest) { - /* parameters required by Bessel_Basis::init() */ - bool b_TestFaln = false; - double d_EnergyCutoff = 4; - int i_Ntype = 1; - int i_Lmax = 0; - bool b_Smooth = false; - double d_SmoothSigma = 0.1; - double d_CutoffRadius = 2; - double d_Tolerance = 0.01; - double d_dk = 0.01; - double d_dr = 2; - /* number of Spherical Bessel functions with given order l, - used to fit one chi */ - int i_Nq = static_cast(sqrt(d_EnergyCutoff)*d_CutoffRadius/M_PI); - /* number of SBF is expected to be 1 */ - besselBasis.init( - b_TestFaln, d_EnergyCutoff, i_Ntype, i_Lmax, b_Smooth, - d_SmoothSigma, d_CutoffRadius, d_Tolerance, - ucell, d_dk, d_dr - ); - EXPECT_EQ(besselBasis.get_ecut_number(), i_Nq); - EXPECT_EQ(besselBasis.get_ecut(), d_EnergyCutoff); - EXPECT_EQ(besselBasis.get_rcut(), d_CutoffRadius); - EXPECT_EQ(besselBasis.get_tolerence(), d_Tolerance); - EXPECT_EQ(besselBasis.get_smooth(), b_Smooth); - EXPECT_EQ(besselBasis.get_sigma(), d_SmoothSigma); -} - -TEST_F(TestBesselBasis, PolynomialInterpolation2Test) { - /* function Bessel_Basis::Polynomial_Interpolation2 is to do - cubic interpolation on TableOne, this matrix has, dimension l*nq*nk */ - /* parameters required by Bessel_Basis::init() */ - bool b_TestFaln = false; - double d_EnergyCutoff = 4; - int i_Ntype = 1; - int i_Lmax = 0; - bool b_Smooth = false; - double d_SmoothSigma = 0.1; - double d_CutoffRadius = 2.0; - double d_Tolerance = 0.01; - double d_dk = 2.0; - double d_dr = 0.01; /* for d_dr will largely impact accurancy of numerical integration, will not give a toy-value */ - - /* number of angular momentum considered should be 1 (lmax = 0)->The first dimension */ - int i_Nq = static_cast(sqrt(d_EnergyCutoff)*d_CutoffRadius/M_PI); - /* number of SBF is expected to be 1->The second dimension */ - int i_kMesh = static_cast(sqrt(d_EnergyCutoff)/d_dk) + 4 + 1; - /* the third dimension is at least to be 6 */ - /* therefore the expected dimension of TableOne is 1*1*6 */ - - besselBasis.init( - b_TestFaln, d_EnergyCutoff, i_Ntype, i_Lmax, b_Smooth, - d_SmoothSigma, d_CutoffRadius, d_Tolerance, - ucell, d_dk, d_dr - ); - /* gnorm for interpolation */ - double d_Gnorm = 1.0; - double d_position = d_Gnorm/d_dk; - int i_position = static_cast(d_position); - assert(i_position < i_kMesh-4); - double d_x0 = d_position - static_cast(i_position); - double d_x1 = 1.0 - d_x0; - double d_x2 = 2.0 - d_x0; - double d_x3 = 3.0 - d_x0; - - std::vector>> vvv_d_TableOne = GenerateTableOne( - b_Smooth, d_SmoothSigma, d_EnergyCutoff, d_CutoffRadius, - i_Lmax, d_dr, d_dk - ); - double d_yExpected = vvv_d_TableOne[0][0][i_position]*d_x1*d_x2*d_x3/6.0+ - vvv_d_TableOne[0][0][i_position+1]*d_x0*d_x2*d_x3/2.0- - vvv_d_TableOne[0][0][i_position+2]*d_x1*d_x0*d_x3/2.0+ - vvv_d_TableOne[0][0][i_position+3]*d_x1*d_x2*d_x0/6.0; - double d_yTested = besselBasis.Polynomial_Interpolation2(0, 0, d_Gnorm); - EXPECT_NEAR(d_yExpected, d_yTested, 0.01); -} -TEST_F(TestBesselBasis, PolynomialInterpolationTest) { - /* function Bessel_Basis::Polynomial_Interpolation is to do - cubic interpolation on Faln, this matrix has, dimension atomtype*l*nchi*nk. - To obtain Faln matrix, it is needed to first get C4 from external file. - The C4 is coefficent of SBF, has dimension atomtype*l*nchi*nq. - Therefore the Faln, equals the contraction of nq between C4 and TableOne. - C4: atomtype*l*nchi*nq - TableOne: l*nq*nk -> Faln: atomtype*l*nchi*nk */ - - /* parameters required by Bessel_Basis::init() */ - bool b_TestFaln = true; - double d_EnergyCutoff = 4; - int i_Ntype = 1; - int i_Lmax = 0; - bool b_Smooth = false; - double d_SmoothSigma = 0.1; - double d_CutoffRadius = 2.0; - double d_Tolerance = 0.01; - double d_dk = 2.0; - double d_dr = 0.01; /* for d_dr will largely impact accurancy of numerical integration, will not give a toy-value */ - - int i_Nq = static_cast(sqrt(d_EnergyCutoff)*d_CutoffRadius/M_PI); - int i_kMesh = static_cast(sqrt(d_EnergyCutoff)/d_dk) + 4 + 1; - /* - manipulate Bessel_Basis::init_Faln function - because for(int it=0; it(d_position); - assert(i_position < i_kMesh-4); - double d_x0 = d_position - static_cast(i_position); - double d_x1 = 1.0 - d_x0; - double d_x2 = 2.0 - d_x0; - double d_x3 = 3.0 - d_x0; - - std::vector>> vvv_d_TableOne = GenerateTableOne( - b_Smooth, d_SmoothSigma, d_EnergyCutoff, d_CutoffRadius, - i_Lmax, d_dr, d_dk - ); - std::vector>>> vvvv_d_Faln = GenerateFaln( - "./support/BesselBasis_UnitTest_C4_AtomType0.html", i_Ntype, i_Lmax, 1, i_Nq, vvv_d_TableOne - ); - double d_yExpected = vvvv_d_Faln[0][0][0][i_position]*d_x1*d_x2*d_x3/6.0+ - vvvv_d_Faln[0][0][0][i_position+1]*d_x0*d_x2*d_x3/2.0- - vvvv_d_Faln[0][0][0][i_position+2]*d_x1*d_x0*d_x3/2.0+ - vvvv_d_Faln[0][0][0][i_position+3]*d_x1*d_x2*d_x0/6.0; - double d_yTested = besselBasis.Polynomial_Interpolation(0, 0, 0, d_Gnorm); - EXPECT_NEAR(d_yExpected, d_yTested, 0.01); -} diff --git a/source/module_io/test/binstream_test.cpp b/source/module_io/test/binstream_test.cpp deleted file mode 100644 index c83ea07114..0000000000 --- a/source/module_io/test/binstream_test.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -/************************************************ - * unit test of binstream.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - Binstream() - * - Open a binary file - * - close() - * - Close a binary file - */ - -#include "../binstream.h" - -class BinstreamTest : public testing::Test -{ -protected: -}; - -TEST_F(BinstreamTest, variable) -{ - int a1,a2,a3; - Binstream wfc("wfc","w"); - EXPECT_EQ(!wfc, false); - wfc << 10 ; - wfc.close(); - EXPECT_EQ(bool(wfc), false); - wfc.open("wfc","a"); - EXPECT_EQ(bool(wfc), true); - wfc << 100; - wfc.close(); - EXPECT_EQ(!wfc, true); - - wfc.open("wfc","r"); - EXPECT_EQ(bool(wfc), true); - wfc >> a1; - wfc >> a2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(wfc >> a3, ::testing::ExitedWithCode(0), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("Binstream")); - EXPECT_EQ(bool(wfc), true); - wfc.close(); - EXPECT_EQ(bool(wfc), false); - - EXPECT_EQ(a1,10); - EXPECT_EQ(a2,100); - - wfc.open("wfc","w"); - testing::internal::CaptureStdout(); - EXPECT_EXIT(wfc >> a3, ::testing::ExitedWithCode(0), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("Binstream")); - remove("wfc"); - - wfc.open("wfc", "r"); - EXPECT_EQ(bool(wfc), false); //If file is not open, return false. - - Binstream *p = new Binstream("wfc" , "r"); - delete p; - - remove("wfc"); // mohan add 2025-06-22 -} - -TEST_F(BinstreamTest, array) -{ - - int a[10], b[11]; - for(int i = 0 ; i < 10 ; ++i) a[i] = i; - Binstream wwfc("wfc","w"); - wwfc.write(a, 10); - wwfc.close(); - - Binstream rwfc("wfc","r"); - testing::internal::CaptureStdout(); - EXPECT_EXIT(rwfc.read(b,11);, ::testing::ExitedWithCode(0), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("Binstream")); - rwfc.close(); - rwfc.open("wfc","r"); - rwfc.read(b, 10); - rwfc.close(); - remove("wfc"); - - for(int i = 0 ; i < 10 ; ++i) - { - EXPECT_EQ(a[i], b[i]); - } - - wwfc.open("wfc", "w"); -} diff --git a/source/module_io/test/cal_dos_test.cpp b/source/module_io/test/cal_dos_test.cpp deleted file mode 100644 index ba73be40ec..0000000000 --- a/source/module_io/test/cal_dos_test.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#include "module_io/cal_dos.h" -#include "source_base/global_variable.h" -#include -#ifdef __MPI -#include "mpi.h" -#endif -#include "dos_test.h" - -/************************************************ - * unit test of ca_dos - ***********************************************/ - -/** - * - Tested Functions: - * - cal_dos() - * - the function to calculate and print out - * - density of states - */ - - -class DosTest : public ::testing::Test -{ -protected: - std::string output; -}; - -TEST_F(DosTest,Dos) -{ - //is,fa,de_ev,emax_ev,emin_ev,bcoeff,nks,nkstot,nbands - DosPrepare dosp = DosPrepare(0,"doss1_pw.txt",0.005,18,-6,0.07,36,36,8); - dosp.set_isk(); - dosp.read_wk(); - dosp.read_istate_info(); - EXPECT_EQ(dosp.is,0); - ModuleIO::cal_dos(dosp.is, - dosp.fa, - dosp.de_ev, - dosp.emax_ev, - dosp.emin_ev, - dosp.bcoeff, - dosp.nks, - dosp.nkstot, - dosp.wk, - dosp.isk, - dosp.nbands, - dosp.ekb, - dosp.wg); - -#ifdef __MPI - if(GlobalV::MY_RANK==0) - { -#endif - std::ifstream ifs; - ifs.open(dosp.fa.c_str()); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("4801 # number of points")); - EXPECT_THAT(str, testing::HasSubstr(" -5.39 0.03125 0.03125 0.178099 0.0160702")); - EXPECT_THAT(str, testing::HasSubstr(" 3.07 0.1875 5.46875 1.07003 5.37765")); - ifs.close(); - remove("doss1_pw.txt"); -#ifdef __MPI - } -#endif -} - - - -TEST_F(DosTest,DosW1) -{ - //is,fa,de_ev,emax_ev,emin_ev,bcoeff,nks,nkstot,nbands - DosPrepare dosp = DosPrepare(0,"doss1_pw.txt",-0.005,18,-6,0.07,36,36,8); - dosp.set_isk(); - dosp.read_wk(); - dosp.read_istate_info(); - EXPECT_EQ(dosp.is,0); - EXPECT_LE(dosp.de_ev,0); - GlobalV::ofs_warning.open("warning1.log"); - EXPECT_NO_THROW(ModuleIO::cal_dos(dosp.is, - dosp.fa, - dosp.de_ev, - dosp.emax_ev, - dosp.emin_ev, - dosp.bcoeff, - dosp.nks, - dosp.nkstot, - dosp.wk, - dosp.isk, - dosp.nbands, - dosp.ekb, - dosp.wg)); - GlobalV::ofs_warning.close(); -#ifdef __MPI - if(GlobalV::MY_RANK==0) - { -#endif - std::ifstream ifs; - ifs.open("warning1.log"); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("ModuleIO::cal_dos warning : de <= 0")); - ifs.close(); - remove("warning1.log"); - remove("doss1_pw.txt"); -#ifdef __MPI - } -#endif -} - - -TEST_F(DosTest,DosW2) -{ - //is,fa,de_ev,emax_ev,emin_ev,bcoeff,nks,nkstot,nbands - DosPrepare dosp = DosPrepare(0,"doss1_pw.txt",0.005,-6,18,0.07,36,36,8); - dosp.set_isk(); - dosp.read_wk(); - dosp.read_istate_info(); - EXPECT_EQ(dosp.is,0); - GlobalV::ofs_warning.open("warning2.log"); - EXPECT_NO_THROW(ModuleIO::cal_dos(dosp.is, - dosp.fa, - dosp.de_ev, - dosp.emax_ev, - dosp.emin_ev, - dosp.bcoeff, - dosp.nks, - dosp.nkstot, - dosp.wk, - dosp.isk, - dosp.nbands, - dosp.ekb, - dosp.wg)); - GlobalV::ofs_warning.close(); -#ifdef __MPI - if(GlobalV::MY_RANK==0) - { -#endif - std::ifstream ifs; - ifs.open("warning2.log"); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("ModuleIO::cal_dos warning : emax_ev < emin_ev")); - ifs.close(); - remove("warning2.log"); - remove("doss1_pw.txt"); -#ifdef __MPI - } -#endif -} - -#ifdef __MPI -int main(int argc, char **argv) -{ - MPI_Init(&argc,&argv); - - testing::InitGoogleTest(&argc,argv); - MPI_Comm_size(MPI_COMM_WORLD,&GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD,&GlobalV::MY_RANK); - - // only test a certain one - //::testing::GTEST_FLAG(filter) = "DosTest.DosW1"; - - int result = RUN_ALL_TESTS(); - - MPI_Finalize(); - - return result; -} -#endif diff --git a/source/module_io/test/cal_pLpR_test.cpp b/source/module_io/test/cal_pLpR_test.cpp deleted file mode 100644 index b2d6de281d..0000000000 --- a/source/module_io/test/cal_pLpR_test.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include - -#include "module_io/cal_pLpR.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_basis/module_nao/radial_collection.h" -#include "source_base/spherical_bessel_transformer.h" -#include "source_base/ylm.h" - -#define DOUBLETHRESHOLD 1e-12 - -class CalpLpRTest : public ::testing::Test -{ -protected: - void SetUp() override - { - ModuleBase::SphericalBesselTransformer sbt(true); - - this->orb_ = std::unique_ptr(new RadialCollection); - this->orb_->build(1, &forb_, 'o'); - this->orb_->set_transformer(sbt); - - const double rcut = 8.0; - const int ngrid = int(rcut / 0.01) + 1; - const double cutoff = 2.0 * rcut; - this->orb_->set_uniform_grid(true, ngrid, cutoff, 'i', true); - - this->calculator_ = std::unique_ptr(new TwoCenterIntegrator); - this->calculator_->tabulate(*orb_, *orb_, 'S', ngrid, cutoff); - - // Initialize Ylm coefficients - ModuleBase::Ylm::set_coefficients(); - } - - void TearDown() override - { - // Cleanup code here, if needed - } - - const std::string forb_ = "../../../../tests/PP_ORB/Si_gga_8au_100Ry_2s2p1d.orb"; - - std::unique_ptr calculator_; - std::unique_ptr orb_; -}; - -TEST_F(CalpLpRTest, CalLzijRTest) -{ - std::complex out; - - ModuleBase::Vector3 vR(0., 0., 0.); // home-cell - int it = 0, ia = 0, il = 0, iz = 0, mi = 0; - int jt = 0, ja = 0, jl = 0, jz = 0, mj = 0; // self, the first s - - // = 0: no magnetic moment - out = ModuleIO::cal_LzijR(calculator_, it, ia, il, iz, mi, jt, ja, jl, jz, mj, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0: orthogonal - jl = 1; - out = ModuleIO::cal_LzijR(calculator_, it, ia, il, iz, mi, jt, ja, jl, jz, mj, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0: orthogonal - il = 1; mi = -1; jl = 1; mj = 0; - out = ModuleIO::cal_LzijR(calculator_, it, ia, il, iz, mi, jt, ja, jl, jz, mj, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 1: same - il = 1; mi = 1; jl = 1; mj = 1; - out = ModuleIO::cal_LzijR(calculator_, it, ia, il, iz, mi, jt, ja, jl, jz, mj, vR); - EXPECT_NEAR(out.real(), 1.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0: orthogonal - il = 2; mi = -1; jl = 2; mj = 0; - out = ModuleIO::cal_LzijR(calculator_, it, ia, il, iz, mi, jt, ja, jl, jz, mj, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 1: same - il = 2; mi = 1; jl = 2; mj = 1; - out = ModuleIO::cal_LzijR(calculator_, it, ia, il, iz, mi, jt, ja, jl, jz, mj, vR); - EXPECT_NEAR(out.real(), 1.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); -} - -TEST_F(CalpLpRTest, CalLxijRTest) -{ - std::complex out; - - ModuleBase::Vector3 vR(0., 0., 0.); // home-cell - int it = 0, ia = 0, il = 0, iz = 0, im = 0; - int jt = 0, ja = 0, jl = 0, jz = 0, jm = 0; // self, the first s - - // = 0: no anisotropy - out = ModuleIO::cal_LxijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0: orthogonal - jl = 1; - out = ModuleIO::cal_LxijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0.5: Lx|p(m=0)> = 1/2 (|p(m=-1)> + |p(m=1)>) - il = 1; im = -1; jl = 1; jm = 0; - out = ModuleIO::cal_LxijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.5*sqrt(2.0), DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0: expectation value is 0 - il = 1; im = 1; jl = 1; jm = 1; - out = ModuleIO::cal_LxijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0.5: Lx|d(m=0)> = 1/2 (|d(m=-1)> + |d(m=1)>) - il = 2; im = -1; jl = 2; jm = 0; - out = ModuleIO::cal_LxijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.5*sqrt(6.0), DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); -} - -TEST_F(CalpLpRTest, CalLyijRTest) -{ - std::complex out; - - ModuleBase::Vector3 vR(0., 0., 0.); // home-cell - int it = 0, ia = 0, il = 0, iz = 0, im = 0; - int jt = 0, ja = 0, jl = 0, jz = 0, jm = 0; // self, the first s - - // = 0: no anisotropy - out = ModuleIO::cal_LyijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = 0: orthogonal - jl = 1; - out = ModuleIO::cal_LyijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = -i/2: Ly|p(m=0)> = -i/2 (|p(m=1)> - |p(m=-1)>) - il = 1; im = -1; jl = 1; jm = 0; - out = ModuleIO::cal_LyijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.5*sqrt(2.0), DOUBLETHRESHOLD); - // = 0: expectation value is 0 - il = 1; im = 1; jl = 1; jm = 1; - out = ModuleIO::cal_LyijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.0, DOUBLETHRESHOLD); - // = -i/2: Ly|d(m=0)> = -i/2 (|d(m=1)> - |d(m=-1)>) - il = 2; im = -1; jl = 2; jm = 0; - out = ModuleIO::cal_LyijR(calculator_, it, ia, il, iz, im, jt, ja, jl, jz, jm, vR); - EXPECT_NEAR(out.real(), 0.0, DOUBLETHRESHOLD); - EXPECT_NEAR(out.imag(), 0.5*sqrt(6.0), DOUBLETHRESHOLD); -} - -int main(int argc, char **argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - return 0; -} \ No newline at end of file diff --git a/source/module_io/test/cif_io_test.cpp b/source/module_io/test/cif_io_test.cpp deleted file mode 100644 index 7e6c3b7fae..0000000000 --- a/source/module_io/test/cif_io_test.cpp +++ /dev/null @@ -1,415 +0,0 @@ -#include -#include "module_io/cif_io.h" -#include -#include -#include "source_base/formatter.h" -#include - -#ifdef __MPI -#include -#endif - -/** - * this is the unittest for ABACUS i/o interface with Crystal Information File (CIF) format. - * - * Intergrately, there are two examples, one easier, one more complicated. - */ -const std::string mp2516584 = "" -"# generated using pymatgen\n" -"data_C\n" -"_symmetry_space_group_name_H-M 'P 1'\n" -"_cell_length_a 2.46772428\n" -"_cell_length_b 2.46772428\n" -"_cell_length_c 8.68503800\n" -"_cell_angle_alpha 90.00000000\n" -"_cell_angle_beta 90.00000000\n" -"_cell_angle_gamma 120.00000758\n" -"_symmetry_Int_Tables_number 1\n" -"_chemical_formula_structural C\n" -"_chemical_formula_sum C4\n" -"_cell_volume 45.80317575\n" -"_cell_formula_units_Z 4\n" -"loop_\n" -" _symmetry_equiv_pos_site_id\n" -" _symmetry_equiv_pos_as_xyz\n" -" 1 'x, y, z'\n" -"loop_\n" -" _atom_site_type_symbol\n" -" _atom_site_label\n" -" _atom_site_symmetry_multiplicity\n" -" _atom_site_fract_x\n" -" _atom_site_fract_y\n" -" _atom_site_fract_z\n" -" _atom_site_occupancy\n" -" C C0 1 0.00000000 0.00000000 0.75000000 1\n" -" C C1 1 0.00000000 0.00000000 0.25000000 1\n" -" C C2 1 0.33333300 0.66666700 0.75000000 1\n" -" C C3 1 0.66666700 0.33333300 0.25000000 1\n"; - -const std::string cod1000065 = "" -"#------------------------------------------------------------------------------\n" -"#$Date: 2016-02-18 17:37:37 +0200 (Thu, 18 Feb 2016) $\n" -"#$Revision: 176729 $\n" -"#$URL: svn://www.crystallography.net/cod/cif/1/00/00/1000065.cif $\n" -"#------------------------------------------------------------------------------\n" -"#\n" -"# This file is available in the Crystallography Open Database (COD),\n" -"# http://www.crystallography.net/\n" -"#\n" -"# All data on this site have been placed in the public domain by the\n" -"# contributors.\n" -"#\n" -"data_1000065\n" -"loop_\n" -"_publ_author_name\n" -"'Nixon, D E'\n" -"'Parry, G S'\n" -"'Ubbelohde, A R'\n" -"_publ_section_title\n" -";\n" -"Order-disorder transformations in graphite nitrates\n" -";\n" -"_journal_coden_ASTM PRLAAZ\n" -"_journal_name_full\n" -";\n" -"Proceedings of the Royal Society of London, Series A: Mathematical and\n" -"Physical Sciences (76,1906-)\n" -";\n" -"_journal_page_first 324\n" -"_journal_page_last 339\n" -"_journal_paper_doi 10.1098/rspa.1966.0098\n" -"_journal_volume 291\n" -"_journal_year 1966\n" -"_chemical_formula_analytical 'C (H N O3)'\n" -"_chemical_formula_structural C\n" -"_chemical_formula_sum C\n" -"_chemical_name_common 'Graphite nitrate'\n" -"_chemical_name_systematic Carbon\n" -"_space_group_IT_number 166\n" -"_symmetry_cell_setting trigonal\n" -"_symmetry_space_group_name_Hall '-R 3 2\"'\n" -"_symmetry_space_group_name_H-M 'R -3 m :H'\n" -"_cell_angle_alpha 90\n" -"_cell_angle_beta 90\n" -"_cell_angle_gamma 120\n" -"_cell_formula_units_Z 12\n" -"_cell_length_a 2.46\n" -"_cell_length_b 2.46\n" -"_cell_length_c 33.45\n" -"_cell_volume 175.3\n" -"_cod_original_sg_symbol_H-M 'R -3 m H'\n" -"_cod_database_code 1000065\n" -"loop_\n" -"_symmetry_equiv_pos_as_xyz\n" -"x,y,z\n" -"-y,x-y,z\n" -"y-x,-x,z\n" -"-y,-x,z\n" -"x,x-y,z\n" -"y-x,y,z\n" -"-x,-y,-z\n" -"y,y-x,-z\n" -"x-y,x,-z\n" -"y,x,-z\n" -"-x,y-x,-z\n" -"x-y,-y,-z\n" -"1/3+x,2/3+y,2/3+z\n" -"2/3+x,1/3+y,1/3+z\n" -"1/3-y,2/3+x-y,2/3+z\n" -"2/3-y,1/3+x-y,1/3+z\n" -"1/3-x+y,2/3-x,2/3+z\n" -"2/3-x+y,1/3-x,1/3+z\n" -"1/3-y,2/3-x,2/3+z\n" -"2/3-y,1/3-x,1/3+z\n" -"1/3+x,2/3+x-y,2/3+z\n" -"2/3+x,1/3+x-y,1/3+z\n" -"1/3-x+y,2/3+y,2/3+z\n" -"2/3-x+y,1/3+y,1/3+z\n" -"1/3-x,2/3-y,2/3-z\n" -"2/3-x,1/3-y,1/3-z\n" -"1/3+y,2/3-x+y,2/3-z\n" -"2/3+y,1/3-x+y,1/3-z\n" -"1/3+x-y,2/3+x,2/3-z\n" -"2/3+x-y,1/3+x,1/3-z\n" -"1/3+y,2/3+x,2/3-z\n" -"2/3+y,1/3+x,1/3-z\n" -"1/3-x,2/3-x+y,2/3-z\n" -"2/3-x,1/3-x+y,1/3-z\n" -"1/3+x-y,2/3-y,2/3-z\n" -"2/3+x-y,1/3-y,1/3-z\n" -"loop_\n" -"_atom_site_label\n" -"_atom_site_type_symbol\n" -"_atom_site_symmetry_multiplicity\n" -"_atom_site_Wyckoff_symbol\n" -"_atom_site_fract_x\n" -"_atom_site_fract_y\n" -"_atom_site_fract_z\n" -"_atom_site_occupancy\n" -"_atom_site_attached_hydrogens\n" -"_atom_site_calc_flag\n" -"C1 C0 6 c 0. 0. 0.05 1. 0 d\n" -"C2 C0 6 c 0. 0. 0.283 1. 0 d\n" -"loop_\n" -"_atom_type_symbol\n" -"_atom_type_oxidation_number\n" -"C0 0.000\n"; - -TEST(CifParserTest, ReadSimpleTest) -{ - int rank = 0; -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); -#endif - -#ifdef __MPI - if (rank == 0) - { -#endif - std::ofstream ofs("mp-2516584.cif"); - ofs << mp2516584; - ofs.close(); -#ifdef __MPI - } - MPI_Barrier(MPI_COMM_WORLD); // make sure the file is written -#endif - std::map> data; - ModuleIO::CifParser::read("mp-2516584.cif", data); - // delete the file -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); // make sure the file is already read - if (rank == 0) - { -#endif - std::remove("mp-2516584.cif"); -#ifdef __MPI - } -#endif - - EXPECT_EQ(data.size(), 23); - EXPECT_EQ(data["_symmetry_space_group_name_H-M"][0], "'P 1'"); - EXPECT_EQ(data["_cell_length_a"][0], "2.46772428"); - EXPECT_EQ(data["_cell_length_b"][0], "2.46772428"); - EXPECT_EQ(data["_cell_length_c"][0], "8.68503800"); - EXPECT_EQ(data["_cell_angle_alpha"][0], "90.00000000"); - EXPECT_EQ(data["_cell_angle_beta"][0], "90.00000000"); - EXPECT_EQ(data["_cell_angle_gamma"][0], "120.00000758"); - EXPECT_EQ(data["_symmetry_Int_Tables_number"][0], "1"); - EXPECT_EQ(data["_chemical_formula_structural"][0], "C"); - EXPECT_EQ(data["_chemical_formula_sum"][0], "C4"); - EXPECT_EQ(data["_cell_volume"][0], "45.80317575"); - EXPECT_EQ(data["_cell_formula_units_Z"][0], "4"); - EXPECT_EQ(data["_symmetry_equiv_pos_site_id"][0], "1"); - EXPECT_EQ(data["_symmetry_equiv_pos_as_xyz"][0], "'x, y, z'"); - EXPECT_EQ(data["_atom_site_type_symbol"][0], "C"); - EXPECT_EQ(data["_atom_site_label"][0], "C0"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][0], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][0], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_y"][0], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_z"][0], "0.75000000"); - EXPECT_EQ(data["_atom_site_occupancy"][0], "1"); - EXPECT_EQ(data["_atom_site_type_symbol"][1], "C"); - EXPECT_EQ(data["_atom_site_label"][1], "C1"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][1], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][1], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_y"][1], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_z"][1], "0.25000000"); - EXPECT_EQ(data["_atom_site_occupancy"][1], "1"); - EXPECT_EQ(data["_atom_site_type_symbol"][2], "C"); - EXPECT_EQ(data["_atom_site_label"][2], "C2"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][2], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][2], "0.33333300"); - EXPECT_EQ(data["_atom_site_fract_y"][2], "0.66666700"); - EXPECT_EQ(data["_atom_site_fract_z"][2], "0.75000000"); - EXPECT_EQ(data["_atom_site_occupancy"][2], "1"); - EXPECT_EQ(data["_atom_site_type_symbol"][3], "C"); - EXPECT_EQ(data["_atom_site_label"][3], "C3"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][3], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][3], "0.66666700"); - EXPECT_EQ(data["_atom_site_fract_y"][3], "0.33333300"); - EXPECT_EQ(data["_atom_site_fract_z"][3], "0.25000000"); - EXPECT_EQ(data["_atom_site_occupancy"][3], "1"); -} - -TEST(CifParserTest, ReadMediumTest) -{ - int rank = 0; -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); -#endif - -#ifdef __MPI - if (rank == 0) - { -#endif - std::ofstream ofs("cod-1000065.cif"); - ofs << cod1000065; - ofs.close(); -#ifdef __MPI - } - MPI_Barrier(MPI_COMM_WORLD); // make sure the file is written -#endif - std::map> data; - ModuleIO::CifParser::read("cod-1000065.cif", data); - // delete the file -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); // make sure the file is already read - if (rank == 0) - { -#endif - std::remove("cod-1000065.cif"); -#ifdef __MPI - } -#endif - - EXPECT_EQ(data.size(), 43); - EXPECT_EQ(data["_publ_author_name"][0], "'Nixon, D E' 'Parry, G S' 'Ubbelohde, A R'"); - EXPECT_EQ(data["_publ_section_title"][0], "; Order-disorder transformations in graphite nitrates ;"); - EXPECT_EQ(data["_journal_coden_ASTM"][0], "PRLAAZ"); - EXPECT_EQ(data["_journal_name_full"][0], "; Proceedings of the Royal Society of London, Series A: Mathematical and Physical Sciences (76,1906-) ;"); - EXPECT_EQ(data["_journal_page_first"][0], "324"); - EXPECT_EQ(data["_journal_page_last"][0], "339"); - EXPECT_EQ(data["_journal_paper_doi"][0], "10.1098/rspa.1966.0098"); - EXPECT_EQ(data["_journal_volume"][0], "291"); - EXPECT_EQ(data["_journal_year"][0], "1966"); - EXPECT_EQ(data["_chemical_formula_analytical"][0], "'C (H N O3)'"); - EXPECT_EQ(data["_chemical_formula_structural"][0], "C"); - EXPECT_EQ(data["_chemical_formula_sum"][0], "C"); - EXPECT_EQ(data["_chemical_name_common"][0], "'Graphite nitrate'"); - EXPECT_EQ(data["_chemical_name_systematic"][0], "Carbon"); - EXPECT_EQ(data["_space_group_IT_number"][0], "166"); - EXPECT_EQ(data["_symmetry_cell_setting"][0], "trigonal"); - EXPECT_EQ(data["_symmetry_space_group_name_Hall"][0], "'-R 3 2\"'"); - EXPECT_EQ(data["_symmetry_space_group_name_H-M"][0], "'R -3 m :H'"); - EXPECT_EQ(data["_cell_angle_alpha"][0], "90"); - EXPECT_EQ(data["_cell_angle_beta"][0], "90"); - EXPECT_EQ(data["_cell_angle_gamma"][0], "120"); - EXPECT_EQ(data["_cell_formula_units_Z"][0], "12"); - EXPECT_EQ(data["_cell_length_a"][0], "2.46"); - EXPECT_EQ(data["_cell_length_b"][0], "2.46"); - EXPECT_EQ(data["_cell_length_c"][0], "33.45"); - EXPECT_EQ(data["_cell_volume"][0], "175.3"); - EXPECT_EQ(data["_cod_original_sg_symbol_H-M"][0], "'R -3 m H'"); - EXPECT_EQ(data["_cod_database_code"][0], "1000065"); - EXPECT_EQ(data["_symmetry_equiv_pos_as_xyz"][0], "x,y,z -y,x-y,z y-x,-x,z -y,-x,z x,x-y,z y-x,y,z -x,-y,-z y,y-x,-z x-y,x,-z y,x,-z -x,y-x,-z x-y,-y,-z 1/3+x,2/3+y,2/3+z 2/3+x,1/3+y,1/3+z 1/3-y,2/3+x-y,2/3+z 2/3-y,1/3+x-y,1/3+z 1/3-x+y,2/3-x,2/3+z 2/3-x+y,1/3-x,1/3+z 1/3-y,2/3-x,2/3+z 2/3-y,1/3-x,1/3+z 1/3+x,2/3+x-y,2/3+z 2/3+x,1/3+x-y,1/3+z 1/3-x+y,2/3+y,2/3+z 2/3-x+y,1/3+y,1/3+z 1/3-x,2/3-y,2/3-z 2/3-x,1/3-y,1/3-z 1/3+y,2/3-x+y,2/3-z 2/3+y,1/3-x+y,1/3-z 1/3+x-y,2/3+x,2/3-z 2/3+x-y,1/3+x,1/3-z 1/3+y,2/3+x,2/3-z 2/3+y,1/3+x,1/3-z 1/3-x,2/3-x+y,2/3-z 2/3-x,1/3-x+y,1/3-z 1/3+x-y,2/3-y,2/3-z 2/3+x-y,1/3-y,1/3-z"); - EXPECT_EQ(data["_atom_site_label"][0], "C1"); - EXPECT_EQ(data["_atom_site_type_symbol"][0], "C0"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][0], "6"); - EXPECT_EQ(data["_atom_site_Wyckoff_symbol"][0], "c"); - EXPECT_EQ(data["_atom_site_fract_x"][0], "0."); - EXPECT_EQ(data["_atom_site_fract_y"][0], "0."); - EXPECT_EQ(data["_atom_site_fract_z"][0], "0.05"); - EXPECT_EQ(data["_atom_site_occupancy"][0], "1."); - EXPECT_EQ(data["_atom_site_attached_hydrogens"][0], "0"); - EXPECT_EQ(data["_atom_site_calc_flag"][0], "d"); - EXPECT_EQ(data["_atom_site_label"][1], "C2"); - EXPECT_EQ(data["_atom_site_type_symbol"][1], "C0"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][1], "6"); - EXPECT_EQ(data["_atom_site_Wyckoff_symbol"][1], "c"); - EXPECT_EQ(data["_atom_site_fract_x"][1], "0."); - EXPECT_EQ(data["_atom_site_fract_y"][1], "0."); - EXPECT_EQ(data["_atom_site_fract_z"][1], "0.283"); - EXPECT_EQ(data["_atom_site_occupancy"][1], "1."); - EXPECT_EQ(data["_atom_site_attached_hydrogens"][1], "0"); - EXPECT_EQ(data["_atom_site_calc_flag"][1], "d"); - EXPECT_EQ(data["_atom_type_symbol"][0], "C0"); - EXPECT_EQ(data["_atom_type_oxidation_number"][0], "0.000"); -} -// because it is relatively hard to define loop_ by ABACUS itself, here the cooperative test -// will be performed by write-read manner. -TEST(CifParserTest, WriteTest) -{ - int rank = 0; -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &rank); -#endif - const std::string fcif = "test.cif"; - const std::vector abc_angles = {2.46637620, 2.46637620, 24.84784531, 90.0, 90.0, 120.0}; - const int natom = 4; - const std::vector atom_site_labels = {"C", "C", "C", "C"}; - const std::vector atom_site_fract = {0.0, 0.0, 0.75, - 0.0, 0.0, 0.25, - 0.333333, 0.666667, 0.75, - 0.666667, 0.333333, 0.25}; - ModuleIO::CifParser::write(fcif, - abc_angles.data(), - natom, - atom_site_labels.data(), - atom_site_fract.data(), - "# Generated during unittest of function ModuleIO::CifParser::write", - "data_test", - rank); -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); // make sure the file is written -#endif - std::map> data; - ModuleIO::CifParser::read(fcif, data, rank); - // delete the file -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); // make sure the file is already read - if (rank == 0) - { -#endif - std::remove(fcif.c_str()); -#ifdef __MPI - } -#endif - - EXPECT_EQ(data.size(), 23); - EXPECT_EQ(data["_symmetry_space_group_name_H-M"][0], "'P 1'"); - EXPECT_EQ(data["_cell_length_a"][0], "2.46637620"); - EXPECT_EQ(data["_cell_length_b"][0], "2.46637620"); - EXPECT_EQ(data["_cell_length_c"][0], "24.84784531"); - EXPECT_EQ(data["_cell_angle_alpha"][0], "90.00000000"); - EXPECT_EQ(data["_cell_angle_beta"][0], "90.00000000"); - EXPECT_EQ(data["_cell_angle_gamma"][0], "120.00000000"); - EXPECT_EQ(data["_symmetry_Int_Tables_number"][0], "1"); - EXPECT_EQ(data["_chemical_formula_structural"][0], "C"); - EXPECT_EQ(data["_chemical_formula_sum"][0], "C4"); - EXPECT_EQ(data["_cell_volume"][0], "130.89950618"); - EXPECT_EQ(data["_cell_formula_units_Z"][0], "1"); - EXPECT_EQ(data["_symmetry_equiv_pos_site_id"][0], "1"); - EXPECT_EQ(data["_symmetry_equiv_pos_as_xyz"][0], "'x, y, z'"); - EXPECT_EQ(data["_atom_site_type_symbol"][0], "C"); - EXPECT_EQ(data["_atom_site_label"][0], "C0"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][0], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][0], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_y"][0], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_z"][0], "0.75000000"); - EXPECT_EQ(data["_atom_site_occupancy"][0], "1.0"); - EXPECT_EQ(data["_atom_site_type_symbol"][1], "C"); - EXPECT_EQ(data["_atom_site_label"][1], "C1"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][1], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][1], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_y"][1], "0.00000000"); - EXPECT_EQ(data["_atom_site_fract_z"][1], "0.25000000"); - EXPECT_EQ(data["_atom_site_occupancy"][1], "1.0"); - EXPECT_EQ(data["_atom_site_type_symbol"][2], "C"); - EXPECT_EQ(data["_atom_site_label"][2], "C2"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][2], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][2], "0.33333300"); - EXPECT_EQ(data["_atom_site_fract_y"][2], "0.66666700"); - EXPECT_EQ(data["_atom_site_fract_z"][2], "0.75000000"); - EXPECT_EQ(data["_atom_site_occupancy"][2], "1.0"); - EXPECT_EQ(data["_atom_site_type_symbol"][3], "C"); - EXPECT_EQ(data["_atom_site_label"][3], "C3"); - EXPECT_EQ(data["_atom_site_symmetry_multiplicity"][3], "1"); - EXPECT_EQ(data["_atom_site_fract_x"][3], "0.66666700"); - EXPECT_EQ(data["_atom_site_fract_y"][3], "0.33333300"); - EXPECT_EQ(data["_atom_site_fract_z"][3], "0.25000000"); - EXPECT_EQ(data["_atom_site_occupancy"][3], "1.0"); -} - - -int main(int argc, char** argv) -{ -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - ::testing::InitGoogleTest(&argc, argv); - int ret = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return ret; -} diff --git a/source/module_io/test/csr_reader_test.cpp b/source/module_io/test/csr_reader_test.cpp deleted file mode 100644 index ee2dcbd4f8..0000000000 --- a/source/module_io/test/csr_reader_test.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "module_io/csr_reader.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -/************************************************ - * unit test of csr_reader.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - csrFileReader() - * - Constructor - * - parseFile() - * - Read the file and parse it - * - getNumberOfR() - * - Get number of R - * - getMatrix(rx, ry, rz) - * - Get sparse matrix of a specific R coordinate - * - getMatrix(index) - * - Get matrix by using index - * - getRCoordinate() - * - Get R coordinate using index - * - getStep() - * - Get step - * - getMatrixDimension() - * - Get matrix dimension - */ - -class csrFileReaderTest : public testing::Test -{ - protected: - std::string filename = "./support/SR.csr"; -}; - -TEST_F(csrFileReaderTest, CsrReader) -{ - ModuleIO::csrFileReader csr(filename); - // Check if file is open - EXPECT_TRUE(csr.isOpen()); - // get step - EXPECT_EQ(csr.getStep(), 0); - // get matrix dimension - EXPECT_EQ(csr.getMatrixDimension(), 4); - // get number of R - EXPECT_EQ(csr.getNumberOfR(), 2); - // get R coordinate using index - std::vector RCoord; - // get R coordinate using index - RCoord = csr.getRCoordinate(0); - EXPECT_EQ(RCoord[0], 0); - EXPECT_EQ(RCoord[1], 1); - EXPECT_EQ(RCoord[2], 1); - RCoord = csr.getRCoordinate(1); - EXPECT_EQ(RCoord[0], 0); - EXPECT_EQ(RCoord[1], 0); - EXPECT_EQ(RCoord[2], 0); - - // get matrix by using index - ModuleIO::SparseMatrix sparse_matrix; - ModuleIO::SparseMatrix sparse_matrix1; - // the first matrix should be - // 0 0 0 4 - // 0 0 7 0 - // 0 0 0 0 - // 0 0 0 0 - // the second matrix should be - // 0 0 0 0 - // 0 0 0 0 - // 0 0 5 6 - // 0 0 0 10 - sparse_matrix = csr.getMatrix(0); - sparse_matrix1 = csr.getMatrix(0, 1, 1); - for (const auto& element : sparse_matrix.getElements()) - { - auto it = sparse_matrix1.getElements().find(element.first); - EXPECT_EQ(it->first.first, element.first.first); - EXPECT_EQ(it->first.second, element.first.second); - EXPECT_DOUBLE_EQ(it->second, element.second); - //std::cout << "element( " << element.first.first << ", " << element.first.second << " ) = " << element.second << std::endl; - } - EXPECT_DOUBLE_EQ(sparse_matrix(0, 3), 4.0); - EXPECT_DOUBLE_EQ(sparse_matrix(1, 2), 7.0); - EXPECT_DOUBLE_EQ(sparse_matrix(0, 0), 0.0); - // the second R - sparse_matrix = csr.getMatrix(1); - sparse_matrix1 = csr.getMatrix(0, 0, 0); - for (const auto& element : sparse_matrix.getElements()) - { - auto it = sparse_matrix1.getElements().find(element.first); - EXPECT_EQ(it->first.first, element.first.first); - EXPECT_EQ(it->first.second, element.first.second); - EXPECT_DOUBLE_EQ(it->second, element.second); - //std::cout << "element( " << element.first.first << ", " << element.first.second << " ) = " << element.second << std::endl; - } - EXPECT_DOUBLE_EQ(sparse_matrix(2, 2), 5.0); - EXPECT_DOUBLE_EQ(sparse_matrix(2, 3), 6.0); - EXPECT_DOUBLE_EQ(sparse_matrix(3, 3), 10.0); - EXPECT_DOUBLE_EQ(sparse_matrix(0, 0), 0.0); -} \ No newline at end of file diff --git a/source/module_io/test/dos_test.h b/source/module_io/test/dos_test.h deleted file mode 100644 index 2f72303ea4..0000000000 --- a/source/module_io/test/dos_test.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef DOS_TEST_H -#define DOS_TEST_H - -#include -#include -#include"source_base/constants.h" - -class DosPrepare -{ -public: - DosPrepare(int is_in, - std::string fa_in, - double de_ev_in, - double emax_ev_in, - double emin_ev_in, - double bcoeff_in, - int nks_in, - int nkstot_in, - int nbands_in): - is(is_in),fa(fa_in), - de_ev(de_ev_in),emax_ev(emax_ev_in), - emin_ev(emin_ev_in),bcoeff(bcoeff_in), - nks(nks_in),nkstot(nkstot_in),nbands(nbands_in){} - - int is; - std::string fa; - double de_ev; - double emax_ev; - double emin_ev; - double bcoeff; - int nks; - int nkstot; - int nbands; - std::vector isk; - std::vector wk; - ModuleBase::matrix ekb; - ModuleBase::matrix wg; - - void set_isk() - { - this->isk.reserve(nks); - for(int i=0;iwk.reserve(nks); - std::ifstream ifs; - std::string tmpstring; - int dummy; - double kx,ky,kz; - ifs.open("./support/kpoints"); - while(ifs.good()) - { - getline(ifs,tmpstring); - getline(ifs,tmpstring); - for(int ik=0; ik>dummy >>kx >>ky >>kz >>this->wk[ik]; - ifs.ignore(150,'\n'); - ifs.rdstate(); - } - } - ifs.close(); - for(int ik=0; ikekb.create(nks,nbands); - this->wg.create(nks,nbands); - std::ifstream ifs; - std::string tmpstring; - ifs.open("./support/istate.info"); - int dummy; - while(ifs.good()) - { - for(int ik=0; ik> dummy >> this->ekb(ik,ib) >> this->wg(ik,ib); - ifs.ignore(150,'\n'); - } - ifs.rdstate(); - } - } - ifs.close(); - this->ekb *= 1.0/ModuleBase::Ry_to_eV; - } -}; - -#endif diff --git a/source/module_io/test/file_reader_test.cpp b/source/module_io/test/file_reader_test.cpp deleted file mode 100644 index 0824e76e98..0000000000 --- a/source/module_io/test/file_reader_test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "module_io/file_reader.h" - -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -/************************************************ - * unit test of file_reader.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - FileReader() - * - Constructor - * - isOpen() - * - Check if file is open - * - readLine() - * - Read a line to string stream - */ - -class FileReaderTest : public testing::Test -{ - protected: - std::ofstream ofs; - std::string filename = "test.txt"; - void SetUp() override - { - ofs.open(filename.c_str()); - // write some info to the file - ofs << "step 0" << std::endl; - ofs << "matrix dimension: 4" << std::endl; - ofs << "number of R: 2" << std::endl; - ofs << "R: 0 0 0 2" << std::endl; - ofs << "1 2" << std::endl; - ofs.close(); - } - void TearDown() override - { - remove("test.txt"); - } - std::string output; -}; - -TEST_F(FileReaderTest, Constructor) -{ - ModuleIO::FileReader fr(filename); - // Check if file is open - EXPECT_TRUE(fr.isOpen()); -} - -TEST_F(FileReaderTest, ReadLine) -{ - ModuleIO::FileReader fr(filename); - // Check if file is open - EXPECT_TRUE(fr.isOpen()); - // read a line to string stream - fr.readLine(); - EXPECT_EQ(fr.ss.str(), "step 0"); - fr.readLine(); - EXPECT_EQ(fr.ss.str(), "matrix dimension: 4"); - fr.readLine(); - EXPECT_EQ(fr.ss.str(), "number of R: 2"); - fr.readLine(); - EXPECT_EQ(fr.ss.str(), "R: 0 0 0 2"); - fr.readLine(); - EXPECT_EQ(fr.ss.str(), "1 2"); - fr.readLine(); - testing::internal::CaptureStdout(); - EXPECT_EXIT(fr.readLine(), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("End of file")); -} \ No newline at end of file diff --git a/source/module_io/test/for_testing_input_conv.h b/source/module_io/test/for_testing_input_conv.h deleted file mode 100644 index b1c3372b2f..0000000000 --- a/source/module_io/test/for_testing_input_conv.h +++ /dev/null @@ -1,298 +0,0 @@ -#ifndef INPUT_CONV_TEST_H -#define INPUT_CONV_TEST_H -#define private public -#include "module_parameter/parameter.h" -#include "source_cell/module_symmetry/symmetry.h" -#include "source_cell/unitcell.h" -#include "source_estate/elecstate_lcao.h" -#include "source_estate/module_charge/charge_mixing.h" -#include "source_estate/occupy.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "source_estate/module_pot/efield.h" -#include "source_estate/module_pot/gatefield.h" -#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "module_hamilt_lcao/module_tddft/td_velocity.h" -#include "source_pw/hamilt_pwdft/VNL_in_pw.h" -#include "source_pw/hamilt_pwdft/structure_factor.h" -#include "source_hsolver/hsolver_lcao.h" -#include "module_io/berryphase.h" -#include "module_io/restart.h" -#include "module_md/md_func.h" -#include "module_relax/bfgs_basic.h" -#include "module_relax/ions_move_basic.h" -#include "module_relax/ions_move_cg.h" -#include "module_relax/lattice_change_basic.h" -#ifdef __PEXSI -#include "source_hsolver/module_pexsi/pexsi_solver.h" -#endif -#undef private -bool berryphase::berry_phase_flag = false; - -bool TD_Velocity::out_current; -bool TD_Velocity::out_current_k; -bool TD_Velocity::out_vecpot; -bool TD_Velocity::init_vecpot_file; -double elecstate::Gatefield::zgate = 0.5; -bool elecstate::Gatefield::relax = false; -bool elecstate::Gatefield::block = false; -double elecstate::Gatefield::block_down = 0.45; -double elecstate::Gatefield::block_up = 0.55; -double elecstate::Gatefield::block_height = 0.1; -int elecstate::Efield::efield_dir; -double elecstate::Efield::efield_pos_max; -double elecstate::Efield::efield_pos_dec; -double elecstate::Efield::efield_amp; - -// parameters of electric field for tddft - -int elecstate::H_TDDFT_pw::stype; // 0 : length gauge 1: velocity gauge - -std::vector elecstate::H_TDDFT_pw::ttype; -// 0 Gauss type function. -// 1 trapezoid type function. -// 2 Trigonometric functions, sin^2. -// 3 heaviside function. -// 4 HHG function. - -int elecstate::H_TDDFT_pw::tstart; -int elecstate::H_TDDFT_pw::tend; -double elecstate::H_TDDFT_pw::dt; -double elecstate::H_TDDFT_pw::dt_int; - -// space domain parameters - -// length gauge -double elecstate::H_TDDFT_pw::lcut1; -double elecstate::H_TDDFT_pw::lcut2; - -// time domain parameters - -bool TD_Velocity::tddft_velocity; -bool TD_Velocity::out_mat_R; - -// Gauss -int elecstate::H_TDDFT_pw::gauss_count; -std::vector elecstate::H_TDDFT_pw::gauss_omega; // time(a.u.)^-1 -std::vector elecstate::H_TDDFT_pw::gauss_phase; -std::vector elecstate::H_TDDFT_pw::gauss_sigma; // time(a.u.) -std::vector elecstate::H_TDDFT_pw::gauss_t0; -std::vector elecstate::H_TDDFT_pw::gauss_amp; // Ry/bohr -std::vector elecstate::H_TDDFT_pw::gauss_ncut; - -// trapezoid -int elecstate::H_TDDFT_pw::trape_count; -std::vector elecstate::H_TDDFT_pw::trape_omega; // time(a.u.)^-1 -std::vector elecstate::H_TDDFT_pw::trape_phase; -std::vector elecstate::H_TDDFT_pw::trape_t1; -std::vector elecstate::H_TDDFT_pw::trape_t2; -std::vector elecstate::H_TDDFT_pw::trape_t3; -std::vector elecstate::H_TDDFT_pw::trape_amp; // Ry/bohr -std::vector elecstate::H_TDDFT_pw::trape_ncut; - -// Trigonometric -int elecstate::H_TDDFT_pw::trigo_count; -std::vector elecstate::H_TDDFT_pw::trigo_omega1; // time(a.u.)^-1 -std::vector elecstate::H_TDDFT_pw::trigo_omega2; // time(a.u.)^-1 -std::vector elecstate::H_TDDFT_pw::trigo_phase1; -std::vector elecstate::H_TDDFT_pw::trigo_phase2; -std::vector elecstate::H_TDDFT_pw::trigo_amp; // Ry/bohr -std::vector elecstate::H_TDDFT_pw::trigo_ncut; - -// Heaviside -int elecstate::H_TDDFT_pw::heavi_count; -std::vector elecstate::H_TDDFT_pw::heavi_t0; -std::vector elecstate::H_TDDFT_pw::heavi_amp; // Ry/bohr - -double BFGS_Basic::relax_bfgs_w1 = -1.0; -double BFGS_Basic::relax_bfgs_w2 = -1.0; -double Ions_Move_Basic::relax_bfgs_rmax = -1.0; -double Ions_Move_Basic::relax_bfgs_rmin = -1.0; -double Ions_Move_Basic::relax_bfgs_init = -1.0; -int Ions_Move_Basic::out_stru = 0; -double Ions_Move_CG::RELAX_CG_THR = -1.0; -std::string Lattice_Change_Basic::fixed_axes = "None"; -int ModuleSymmetry::Symmetry::symm_flag = 0; -bool ModuleSymmetry::Symmetry::symm_autoclose = false; - -Charge_Mixing::Charge_Mixing() -{ -} -Charge_Mixing::~Charge_Mixing() -{ -} -pseudopot_cell_vnl::pseudopot_cell_vnl() -{ -} -pseudopot_cell_vnl::~pseudopot_cell_vnl() -{ -} -Soc::~Soc() -{ -} -Fcoef::~Fcoef() -{ -} -pseudopot_cell_vl::pseudopot_cell_vl() -{ -} -pseudopot_cell_vl::~pseudopot_cell_vl() -{ -} -ORB_gaunt_table::ORB_gaunt_table() -{ -} -ORB_gaunt_table::~ORB_gaunt_table() -{ -} -ModuleDFTU::DFTU::DFTU() -{ -} -ModuleDFTU::DFTU::~DFTU() -{ -} -Structure_Factor::Structure_Factor() -{ -} -Structure_Factor::~Structure_Factor() -{ -} -UnitCell::UnitCell() -{ - itia2iat.create(1, 1); -} -UnitCell::~UnitCell() {} -#ifdef __LCAO -InfoNonlocal::InfoNonlocal() {} -InfoNonlocal::~InfoNonlocal() {} -LCAO_Orbitals::LCAO_Orbitals() {} -LCAO_Orbitals::~LCAO_Orbitals() {} -#endif -Magnetism::Magnetism() {} -Magnetism::~Magnetism() {} -void Occupy::decision(const std::string& name, - const std::string& smearing_method, - const double& smearing_sigma) { - return; -} -// void UnitCell::setup(const std::string&,const int&,const int&,const -// bool&,const std::string&){return;} -void UnitCell::setup(const std::string& latname_in, - const int& ntype_in, - const int& lmaxmax_in, - const bool& init_vel_in, - const std::string& fixed_axes_in) { - this->latName = latname_in; - this->ntype = ntype_in; - this->lmaxmax = lmaxmax_in; - this->init_vel = init_vel_in; - // pengfei Li add 2018-11-11 - if (fixed_axes_in == "None") { - this->lc[0] = 1; - this->lc[1] = 1; - this->lc[2] = 1; - } else if (fixed_axes_in == "volume") { - this->lc[0] = 1; - this->lc[1] = 1; - this->lc[2] = 1; - if (!PARAM.input.relax_new) { - ModuleBase::WARNING_QUIT( - "Input", - "there are bugs in the old implementation; set relax_new to be " - "1 for fixed_volume relaxation"); - } - } else if (fixed_axes_in == "shape") { - if (!PARAM.input.relax_new) { - ModuleBase::WARNING_QUIT( - "Input", - "set relax_new to be 1 for fixed_shape relaxation"); - } - this->lc[0] = 1; - this->lc[1] = 1; - this->lc[2] = 1; - } else if (fixed_axes_in == "a") { - this->lc[0] = 0; - this->lc[1] = 1; - this->lc[2] = 1; - } else if (fixed_axes_in == "b") { - this->lc[0] = 1; - this->lc[1] = 0; - this->lc[2] = 1; - } else if (fixed_axes_in == "c") { - this->lc[0] = 1; - this->lc[1] = 1; - this->lc[2] = 0; - } else if (fixed_axes_in == "ab") { - this->lc[0] = 0; - this->lc[1] = 0; - this->lc[2] = 1; - } else if (fixed_axes_in == "ac") { - this->lc[0] = 0; - this->lc[1] = 1; - this->lc[2] = 0; - } else if (fixed_axes_in == "bc") { - this->lc[0] = 1; - this->lc[1] = 0; - this->lc[2] = 0; - } else if (fixed_axes_in == "abc") { - this->lc[0] = 0; - this->lc[1] = 0; - this->lc[2] = 0; - } else { - ModuleBase::WARNING_QUIT( - "Input", - "fixed_axes should be None,volume,shape,a,b,c,ab,ac,bc or abc!"); - } - return; -} -// void Structure_Factor::set(const int&) -// { -// return; -// } - -namespace MD_func { -void current_md_info(const int& my_rank, - const std::string& file_dir, - int& md_step, - double& temperature) { - return; -} -} // namespace MD_func - -namespace GlobalC { -ModuleDFTU::DFTU dftu; -Restart restart; -} // namespace GlobalC - -#ifdef __PEXSI -namespace pexsi { -int PEXSI_Solver::pexsi_npole = 0; -bool PEXSI_Solver::pexsi_inertia = 0; -int PEXSI_Solver::pexsi_nmax = 0; -// int PEXSI_Solver::pexsi_symbolic = 0; -bool PEXSI_Solver::pexsi_comm = 0; -bool PEXSI_Solver::pexsi_storage = 0; -int PEXSI_Solver::pexsi_ordering = 0; -int PEXSI_Solver::pexsi_row_ordering = 0; -int PEXSI_Solver::pexsi_nproc = 0; -bool PEXSI_Solver::pexsi_symm = 0; -bool PEXSI_Solver::pexsi_trans = 0; -int PEXSI_Solver::pexsi_method = 0; -int PEXSI_Solver::pexsi_nproc_pole = 0; -// double PEXSI_Solver::pexsi_spin = 2; -double PEXSI_Solver::pexsi_temp = 0.0; -double PEXSI_Solver::pexsi_gap = 0.0; -double PEXSI_Solver::pexsi_delta_e = 0.0; -double PEXSI_Solver::pexsi_mu_lower = 0.0; -double PEXSI_Solver::pexsi_mu_upper = 0.0; -double PEXSI_Solver::pexsi_mu = 0.0; -double PEXSI_Solver::pexsi_mu_thr = 0.0; -double PEXSI_Solver::pexsi_mu_expand = 0.0; -double PEXSI_Solver::pexsi_mu_guard = 0.0; -double PEXSI_Solver::pexsi_elec_thr = 0.0; -double PEXSI_Solver::pexsi_zero_thr = 0.0; -} // namespace pexsi -#endif - -#endif diff --git a/source/module_io/test/for_testing_klist.h b/source/module_io/test/for_testing_klist.h deleted file mode 100644 index d0eabf1d12..0000000000 --- a/source/module_io/test/for_testing_klist.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef FOR_TESTING_KLIST_H -#define FOR_TESTING_KLIST_H - -#include "source_base/parallel_global.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" -#include "source_cell/atom_pseudo.h" -#include "source_cell/atom_spec.h" -#include "source_cell/klist.h" -#include "source_cell/parallel_kpoints.h" -#include "source_cell/pseudo.h" -#include "source_cell/setup_nonlocal.h" -#include "source_cell/unitcell.h" -#include "source_estate/magnetism.h" -#include "source_pw/hamilt_pwdft/VL_in_pw.h" -#include "source_pw/hamilt_pwdft/VNL_in_pw.h" -#include "source_pw/hamilt_pwdft/parallel_grid.h" -#include "module_io/berryphase.h" - -bool berryphase::berry_phase_flag=0; - -pseudo::pseudo(){} -pseudo::~pseudo(){} -Atom::Atom(){} -Atom::~Atom(){} -Atom_pseudo::Atom_pseudo(){} -Atom_pseudo::~Atom_pseudo(){} -InfoNonlocal::InfoNonlocal(){} -InfoNonlocal::~InfoNonlocal(){} -UnitCell::UnitCell(){} -UnitCell::~UnitCell(){} -Magnetism::Magnetism(){} -Magnetism::~Magnetism(){} -ORB_gaunt_table::ORB_gaunt_table(){} -ORB_gaunt_table::~ORB_gaunt_table(){} -pseudopot_cell_vl::pseudopot_cell_vl(){} -pseudopot_cell_vl::~pseudopot_cell_vl(){} -pseudopot_cell_vnl::pseudopot_cell_vnl(){} -pseudopot_cell_vnl::~pseudopot_cell_vnl(){} -Soc::~Soc() -{ -} -Fcoef::~Fcoef() -{ -} - - - -#endif diff --git a/source/module_io/test/io_dmk_test.cpp b/source/module_io/test/io_dmk_test.cpp deleted file mode 100644 index 15b7323bd7..0000000000 --- a/source/module_io/test/io_dmk_test.cpp +++ /dev/null @@ -1,336 +0,0 @@ -#include "module_io/io_dmk.h" - -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "source_base/global_variable.h" -#include "prepare_unitcell.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "source_base/scalapack_connector.h" - -#ifdef __MPI -#include "mpi.h" -#endif - -#ifdef __LCAO -InfoNonlocal::InfoNonlocal() {} -InfoNonlocal::~InfoNonlocal() {} -LCAO_Orbitals::LCAO_Orbitals() {} -LCAO_Orbitals::~LCAO_Orbitals() {} -#endif -Magnetism::Magnetism() { - this->tot_mag = 0.0; - this->abs_mag = 0.0; - this->start_mag = nullptr; -} -Magnetism::~Magnetism() { delete[] this->start_mag; } - -/************************************************ - * unit test of read_dmk and write_dmk - ***********************************************/ - -/** - * - Tested Functions: - * - read_dmk() - * - the function to read density matrix K from file - * - the serial version without MPI - * - write_dmk() - * - the function to write density matrix K to file - * - the serial version without MPI - */ - -void init_pv(int nlocal, Parallel_2D& pv) -{ -#ifdef __MPI - pv.init(nlocal, nlocal, 1, MPI_COMM_WORLD); -#else - pv.nrow = nlocal; - pv.ncol = nlocal; -#endif -} - -template -void gen_dmk(std::vector>& dmk, std::vector& efs, int nspin, int nk, int nlocal, Parallel_2D& pv) -{ - int myrank = 0; -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); -#endif - std::vector> dmk_global(nspin * nk, std::vector(nlocal * nlocal, T(0.0))); - if (myrank == 0) - { - for (int i = 0; i < nspin * nk; i++) - { - for (int j = 0; j < nlocal * nlocal; j++) - { - std::complex value = std::complex(1.0 * i + 0.1 * j, 0.1 * i + 1.0 * j); - dmk_global[i][j] = reinterpret_cast(&value)[0]; - } - } - } -#ifdef __MPI - Parallel_2D pv_global; - pv_global.init(nlocal, nlocal, nlocal, MPI_COMM_WORLD); - dmk.resize(nspin * nk, std::vector(pv.get_local_size(), 0.0)); - for (int i = 0; i < nspin * nk; i++) - { - Cpxgemr2d(nlocal, - nlocal, - dmk_global[i].data(), - 1, - 1, - pv_global.desc, - dmk[i].data(), - 1, - 1, - pv.desc, - pv.blacs_ctxt); - } -#else - dmk = dmk_global; -#endif - - efs.resize(nspin, 0.0); - for (int i = 0; i < nspin; i++) - { - efs[i] = 0.1 * i; - } -} - - -TEST(DMKTest, GenFileName) { - std::string fname = ModuleIO::dmk_gen_fname(true, 0, 0); - EXPECT_EQ(fname, "dms1_nao.txt"); - fname = ModuleIO::dmk_gen_fname(true, 1, 1); - EXPECT_EQ(fname, "dms2_nao.txt"); - - fname = ModuleIO::dmk_gen_fname(false, 0, 0); - EXPECT_EQ(fname, "dms1k1_nao.txt"); - fname = ModuleIO::dmk_gen_fname(false, 1, 1); - EXPECT_EQ(fname, "dms2k2_nao.txt"); -}; - - -TEST(DMKTest,WriteDMK) { - UnitCell* ucell; - UcellTestPrepare utp = UcellTestLib["Si"]; - ucell = utp.SetUcellInfo(); - - int nspin = 2; - int nk = 1; - int nk_multik = 2; - int nlocal = 20; - std::vector> dmk; - std::vector>> dmk_multik; - Parallel_2D pv; - std::vector efs; - init_pv(nlocal, pv); - - gen_dmk(dmk, efs, nspin, nk, nlocal, pv); - gen_dmk(dmk_multik, efs, nspin, nk_multik, nlocal, pv); - PARAM.sys.global_out_dir = "./"; - - ModuleIO::write_dmk(dmk, 3, efs, ucell, pv); - ModuleIO::write_dmk(dmk_multik, 3, efs, ucell, pv); - std::ifstream ifs; - - int pass = 0; - if (GlobalV::MY_RANK == 0) - { - std::string fn = "dms1_nao.txt"; - ifs.open(fn); - std::string str((std::istreambuf_iterator(ifs)), - std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("0.00000 (fermi energy)")); - EXPECT_THAT(str, testing::HasSubstr("20 20")); - EXPECT_THAT( - str, - testing::HasSubstr("0.000e+00 1.000e-01 2.000e-01 3.000e-01 4.000e-01 " - "5.000e-01 6.000e-01 7.000e-01\n")); - EXPECT_THAT( - str, - testing::HasSubstr("8.000e-01 9.000e-01 1.000e+00 1.100e+00 1.200e+00 " - "1.300e+00 1.400e+00 1.500e+00\n")); - EXPECT_THAT( - str, - testing::HasSubstr("1.600e+00 1.700e+00 1.800e+00 1.900e+00\n")); - ifs.close(); - - fn = "dms2_nao.txt"; - ifs.open(fn); - str = std::string((std::istreambuf_iterator(ifs)), - std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("0.10000 (fermi energy)")); - EXPECT_THAT(str, testing::HasSubstr("20 20")); - EXPECT_THAT( - str, - testing::HasSubstr("1.000e+00 1.100e+00 1.200e+00 1.300e+00 1.400e+00 " - "1.500e+00 1.600e+00 1.700e+00\n")); - EXPECT_THAT( - str, - testing::HasSubstr("1.800e+00 1.900e+00 2.000e+00 2.100e+00 2.200e+00 " - "2.300e+00 2.400e+00 2.500e+00\n")); - EXPECT_THAT( - str, - testing::HasSubstr("2.600e+00 2.700e+00 2.800e+00 2.900e+00\n")); - ifs.close(); - - fn = "dms1k1_nao.txt"; - ifs.open(fn); - str = std::string((std::istreambuf_iterator(ifs)), - std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("0.00000 (fermi energy)")); - EXPECT_THAT(str, testing::HasSubstr("20 20")); - EXPECT_THAT( - str, - testing::HasSubstr("(0.000e+00,0.000e+00) (1.000e-01,1.000e+00) (2.000e-01,2.000e+00) " - "(3.000e-01,3.000e+00) (4.000e-01,4.000e+00) (5.000e-01,5.000e+00) " - "(6.000e-01,6.000e+00) (7.000e-01,7.000e+00)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(8.000e-01,8.000e+00) (9.000e-01,9.000e+00) (1.000e+00,1.000e+01) " - "(1.100e+00,1.100e+01) (1.200e+00,1.200e+01) (1.300e+00,1.300e+01) " - "(1.400e+00,1.400e+01) (1.500e+00,1.500e+01)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(1.600e+00,1.600e+01) (1.700e+00,1.700e+01) (1.800e+00,1.800e+01) (1.900e+00,1.900e+01)\n")); - ifs.close(); - - fn = "dms1k2_nao.txt"; - ifs.open(fn); - str = std::string((std::istreambuf_iterator(ifs)), - std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("0.00000 (fermi energy)")); - EXPECT_THAT(str, testing::HasSubstr("20 20")); - EXPECT_THAT( - str, - testing::HasSubstr("(1.000e+00,1.000e-01) (1.100e+00,1.100e+00) (1.200e+00,2.100e+00) " - "(1.300e+00,3.100e+00) (1.400e+00,4.100e+00) (1.500e+00,5.100e+00) " - "(1.600e+00,6.100e+00) (1.700e+00,7.100e+00)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(1.800e+00,8.100e+00) (1.900e+00,9.100e+00) (2.000e+00,1.010e+01) " - "(2.100e+00,1.110e+01) (2.200e+00,1.210e+01) (2.300e+00,1.310e+01) " - "(2.400e+00,1.410e+01) (2.500e+00,1.510e+01)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(2.600e+00,1.610e+01) (2.700e+00,1.710e+01) (2.800e+00,1.810e+01) (2.900e+00,1.910e+01)\n")); - ifs.close(); - - fn = "dms2k1_nao.txt"; - ifs.open(fn); - str = std::string((std::istreambuf_iterator(ifs)), - std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("0.10000 (fermi energy)")); - EXPECT_THAT(str, testing::HasSubstr("20 20")); - EXPECT_THAT( - str, - testing::HasSubstr("(2.000e+00,2.000e-01) (2.100e+00,1.200e+00) (2.200e+00,2.200e+00) " - "(2.300e+00,3.200e+00) (2.400e+00,4.200e+00) (2.500e+00,5.200e+00) " - "(2.600e+00,6.200e+00) (2.700e+00,7.200e+00)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(2.800e+00,8.200e+00) (2.900e+00,9.200e+00) (3.000e+00,1.020e+01) " - "(3.100e+00,1.120e+01) (3.200e+00,1.220e+01) (3.300e+00,1.320e+01) " - "(3.400e+00,1.420e+01) (3.500e+00,1.520e+01)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(3.600e+00,1.620e+01) (3.700e+00,1.720e+01) (3.800e+00,1.820e+01) (3.900e+00,1.920e+01)\n")); - ifs.close(); - - fn = "dms2k2_nao.txt"; - ifs.open(fn); - str = std::string((std::istreambuf_iterator(ifs)), - std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("0.10000 (fermi energy)")); - EXPECT_THAT(str, testing::HasSubstr("20 20")); - EXPECT_THAT( - str, - testing::HasSubstr("(3.000e+00,3.000e-01) (3.100e+00,1.300e+00) (3.200e+00,2.300e+00) " - "(3.300e+00,3.300e+00) (3.400e+00,4.300e+00) (3.500e+00,5.300e+00) " - "(3.600e+00,6.300e+00) (3.700e+00,7.300e+00)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(3.800e+00,8.300e+00) (3.900e+00,9.300e+00) (4.000e+00,1.030e+01) " - "(4.100e+00,1.130e+01) (4.200e+00,1.230e+01) (4.300e+00,1.330e+01) " - "(4.400e+00,1.430e+01) (4.500e+00,1.530e+01)\n")); - EXPECT_THAT( - str, - testing::HasSubstr("(4.600e+00,1.630e+01) (4.700e+00,1.730e+01) (4.800e+00,1.830e+01) (4.900e+00,1.930e+01)\n")); - ifs.close(); - remove("dms1_nao.txt"); - remove("dms2_nao.txt"); - remove("dms1k1_nao.txt"); - remove("dms1k2_nao.txt"); - remove("dms2k1_nao.txt"); - remove("dms2k2_nao.txt"); - } - - delete ucell; - // remove the generated files - -}; - - -// no function in the main code calls read_dmk??? mohan note 2025-05-25 -TEST(DMKTest, ReadDMK) { - int nlocal = 26; - std::vector> dmk; - std::vector>> dmk_multik; - Parallel_2D pv; - std::vector efs; - PARAM.sys.global_out_dir = "./"; - - init_pv(nlocal, pv); - - std::ofstream ofs_running("running_log.txt"); - - EXPECT_TRUE(ModuleIO::read_dmk(1, 1, pv, "./support/", dmk, ofs_running)); - ModuleIO::read_dmk(1, 1, pv, "./support/", dmk_multik, ofs_running); - EXPECT_TRUE(ModuleIO::read_dmk(1, 1, pv, "./support/", dmk_multik, ofs_running)); - EXPECT_EQ(dmk.size(), 1); - EXPECT_EQ(dmk_multik.size(), 1); - EXPECT_EQ(dmk[0].size(), pv.get_local_size()); - EXPECT_EQ(dmk_multik[0].size(), pv.get_local_size()); - if (GlobalV::MY_RANK == 0) - { - EXPECT_NEAR(dmk[0][0], 3.904e-01, 1e-6); - EXPECT_NEAR(dmk_multik[0][1].real(), -4.479e-03, 1e-6); - EXPECT_NEAR(dmk_multik[0][1].imag(), 3.208e-04, 1e-6); - } - - ofs_running.close(); - remove("running_log.txt"); -} - - -#ifdef __MPI -int main(int argc, char** argv) -{ - GlobalV::MY_RANK = 0; - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); - - testing::InitGoogleTest(&argc, argv); - ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners(); - - if (GlobalV::MY_RANK != 0) { - delete listeners.Release(listeners.default_result_printer()); - } - - int result = RUN_ALL_TESTS(); - MPI_Bcast(&result, 1, MPI_INT, 0, MPI_COMM_WORLD); - - if (GlobalV::MY_RANK == 0 && result != 0) - { - std::cout << "ERROR:some tests are not passed" << std::endl; - } - - MPI_Finalize(); - return result; -} -#endif diff --git a/source/module_io/test/numerical_basis_test.cpp b/source/module_io/test/numerical_basis_test.cpp deleted file mode 100644 index acbac630aa..0000000000 --- a/source/module_io/test/numerical_basis_test.cpp +++ /dev/null @@ -1,207 +0,0 @@ -#include "source_base/math_sphbes.h" -#include "source_base/matrix3.h" -#include "source_base/vector3.h" -#include "module_io/numerical_basis_jyjy.h" - -#include "gtest/gtest.h" - -using namespace NumericalBasis; -using ModuleBase::Sphbes; - -/*********************************************************** - * Unit test of class "TwoCenterIntegrator" - ***********************************************************/ -/** - * Tested functions: - * - * - indexgen - * generates a vector of composite index (itype, iatom, l, m) - * from given number of atoms and maximum angular momentum - * - * - cal_overlap_Sq (static function) - * computes and with two-center integration - * - */ -class NumericalBasisTest : public ::testing::Test -{ - protected: - void SetUp(); - void TearDown(); -}; - -void NumericalBasisTest::SetUp() -{ -} - -void NumericalBasisTest::TearDown() -{ -} - -TEST_F(NumericalBasisTest, indexgen) -{ - const std::vector natom = {1, 2, 3}; - const std::vector lmax = {2, 1, 2}; - - const auto index = indexgen(natom, lmax); - size_t idx = 0; - - for (size_t it = 0; it < natom.size(); ++it) - { - for (int ia = 0; ia != natom[it]; ++ia) - { - for (int l = 0; l <= lmax[it]; ++l) - { - for (int M = 0; M < 2 * l + 1; ++M) - { - // convert the "abacus M" to the conventional m - const int m = (M % 2 == 0) ? -M / 2 : (M + 1) / 2; - EXPECT_EQ(index[idx], std::make_tuple(int(it), ia, l, m)); - ++idx; - } - } - } - } -} - -TEST_F(NumericalBasisTest, cal_overlap_Sq) -{ - const int lmax = 3; - const int nbes = 7; - const double rcut = 7.0; - - const ModuleBase::Matrix3 latvec(30.0, 0.0, 0.0, 0.0, 30.0, 0.0, 0.0, 0.0, 30.0); - - // atom-0 and 1 have overlap with each other, but neither of them - // has overlap with atom-2 - std::vector>> tau_cart; - tau_cart.emplace_back(); - tau_cart[0].emplace_back(0.0, 0.0, 0.0); - tau_cart[0].emplace_back(1.0, 1.0, 1.0); - tau_cart[0].emplace_back(0.0, 0.0, 15.0); - - const std::vector natom = {int(tau_cart[0].size())}; - const std::vector lmax_v = {lmax}; - const auto index = indexgen(natom, lmax_v); - const int nao = index.size(); - - // zeros of sperical Bessel functions - std::vector zeros(nbes * (lmax + 1)); - ModuleBase::Sphbes::sphbes_zeros(lmax, nbes, zeros.data(), true); - - // and - const double S_thr = 1e-5; - const double T_thr = 1e-3; - const auto S = cal_overlap_Sq('S', lmax, nbes, rcut, tau_cart, latvec, index); - const auto T = cal_overlap_Sq('T', lmax, nbes, rcut, tau_cart, latvec, index); - int t1, a1, l1, m1, t2, a2, l2, m2; // values will be updated in the loop - for (int i = 0; i < nao; ++i) - { - std::tie(t1, a1, l1, m1) = index[i]; - for (int j = 0; j < nao; ++j) - { - std::tie(t2, a2, l2, m2) = index[j]; - for (int q1 = 0; q1 < nbes; ++q1) - { - for (int q2 = 0; q2 < nbes; ++q2) - { - if (i == j) - { - if (q1 == q2) - { - // diagonal elements have analytical results - double S_ref - = std::pow(rcut, 3) * 0.5 * std::pow(Sphbes::sphbesj(l1 + 1, zeros[l1 * nbes + q1]), 2); - EXPECT_NEAR(S(i, i, q1, q1).real(), S_ref, S_thr); - EXPECT_EQ(S(i, i, q1, q1).imag(), 0); - - double T_ref - = 0.5 * rcut - * std::pow(zeros[l1 * nbes + q1] * Sphbes::sphbesj(l1 + 1, zeros[l1 * nbes + q1]), 2); - EXPECT_NEAR(T(i, i, q1, q1).real(), T_ref, T_thr); - EXPECT_EQ(T(i, i, q1, q1).imag(), 0); - } - else - { - // off-diagonal elements should be zero due to orthogonality - EXPECT_NEAR(S(i, i, q1, q2).real(), 0, S_thr); - EXPECT_EQ(S(i, i, q1, q2).imag(), 0); - - EXPECT_NEAR(T(i, i, q1, q2).real(), 0, T_thr); - EXPECT_EQ(T(i, i, q1, q2).imag(), 0); - } - } - - if ((a1 == 2) != (a2 == 2)) - { - // atom-2 has no overlap with atom-0/1 - EXPECT_EQ(S(i, j, q1, q2).real(), 0); - EXPECT_EQ(S(i, j, q1, q2).imag(), 0); - - EXPECT_EQ(T(i, j, q1, q2).real(), 0); - EXPECT_EQ(T(i, j, q1, q2).imag(), 0); - } - - if (a1 != a2 && a1 != 2 && a2 != 2) - { - // overlap between atom-0 and atom-1 orbitals should be non-zero - EXPECT_NE(S(i, j, q1, q2).real(), 0); - EXPECT_EQ(S(i, j, q1, q2).imag(), 0); - - EXPECT_NE(T(i, j, q1, q2).real(), 0); - EXPECT_EQ(T(i, j, q1, q2).imag(), 0); - } - } - } - } - } - - // verifies that the calculated matrix is invariant w.r.t. translation - // across the cell boundary - tau_cart[0][0].x -= 0.5; - tau_cart[0][1].x -= 0.5; - tau_cart[0][2].x -= 0.5; - const auto S_wrap = cal_overlap_Sq('S', lmax, nbes, rcut, tau_cart, latvec, index); - - for (int i = 0; i < nao; ++i) - { - std::tie(t1, a1, l1, m1) = index[i]; - for (int j = 0; j < nao; ++j) - { - std::tie(t2, a2, l2, m2) = index[j]; - for (int q1 = 0; q1 < nbes; ++q1) - { - for (int q2 = 0; q2 < nbes; ++q2) - { - EXPECT_EQ(S(i, j, q1, q2), S_wrap(i, j, q1, q2)); - } - } - } - } -} - -TEST_F(NumericalBasisTest, neighbor_vec) -{ - const ModuleBase::Vector3 d0(2.5, 0.0, 0.0); - const ModuleBase::Matrix3 latvec(3.0, 0.0, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0, 5.0); - - const double r1 = 2.0; - auto d1 = neighbor_vec(d0, latvec, r1); - EXPECT_EQ(d1.size(), 1); - EXPECT_EQ(d1[0], ModuleBase::Vector3(-0.5, 0.0, 0.0)); - - const double r2 = 3.6; - auto d2 = neighbor_vec(d0, latvec, r2); - EXPECT_EQ(d2.size(), 3); - EXPECT_EQ(d2[0], ModuleBase::Vector3(-3.5, 0.0, 0.0)); - EXPECT_EQ(d2[1], ModuleBase::Vector3(-0.5, 0.0, 0.0)); - EXPECT_EQ(d2[2], ModuleBase::Vector3(2.5, 0.0, 0.0)); - - const double r3 = 4.1; - auto d3 = neighbor_vec(d0, latvec, r3); - EXPECT_EQ(d3.size(), 5); - EXPECT_EQ(d3[0], ModuleBase::Vector3(-3.5, 0.0, 0.0)); - EXPECT_EQ(d3[1], ModuleBase::Vector3(-0.5, -4.0, 0.0)); - EXPECT_EQ(d3[2], ModuleBase::Vector3(-0.5, 0.0, 0.0)); - EXPECT_EQ(d3[3], ModuleBase::Vector3(-0.5, 4.0, 0.0)); - EXPECT_EQ(d3[4], ModuleBase::Vector3(2.5, 0.0, 0.0)); -} diff --git a/source/module_io/test/orb_io_test.cpp b/source/module_io/test/orb_io_test.cpp deleted file mode 100644 index a9621f6a81..0000000000 --- a/source/module_io/test/orb_io_test.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include "module_io/orb_io.h" - -#ifdef __MPI -#include -#endif - -#include "source_base/constants.h" -#include "source_base/global_variable.h" - -class OrbIOTest : public testing::Test -{ - protected: - void SetUp(); - void TearDown(){}; - - const std::string file = "../../../../tests/PP_ORB/Ti_gga_10au_100Ry_4s2p2d1f.orb"; - const double tol = 1e-12; -}; - -void OrbIOTest::SetUp() -{ -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); -#endif -} - -TEST_F(OrbIOTest, ReadAbacusOrb) -{ - std::ifstream ifs; - std::string elem; - double ecut, dr; - int nr; - std::vector nzeta; - std::vector> radials; - if (GlobalV::MY_RANK == 0) - { - ifs.open(file); - } - ModuleIO::read_abacus_orb(ifs, elem, ecut, nr, dr, nzeta, radials, GlobalV::MY_RANK); - if (GlobalV::MY_RANK == 0) - { - ifs.close(); - } - EXPECT_EQ(elem, "Ti"); - EXPECT_DOUBLE_EQ(ecut, 100.0); - EXPECT_EQ(nr, 1001); - EXPECT_DOUBLE_EQ(dr, 0.01); - EXPECT_EQ(nzeta.size(), 4); // l from 0 to 3 - EXPECT_EQ(nzeta[0], 4); - EXPECT_EQ(nzeta[1], 2); - EXPECT_EQ(nzeta[2], 2); - EXPECT_EQ(nzeta[3], 1); - EXPECT_EQ(radials.size(), 9); // 4 + 2 + 2 + 1 - for(auto& radial: radials) - { - EXPECT_EQ(radial.size(), 1001); - } - EXPECT_EQ(radials[0][0], -1.581711853170e-01); - EXPECT_EQ(radials[0][4], -1.583907030513e-01); - EXPECT_EQ(radials[0][996], -4.183526380009e-05); - EXPECT_EQ(radials[0][1000], 0); - EXPECT_EQ(radials[3][0], -1.166292682541e+00); - EXPECT_EQ(radials[3][4], -1.164223359672e+00); - EXPECT_EQ(radials[3][996], -3.183325576529e-04); - EXPECT_EQ(radials[3][1000], 0); - EXPECT_EQ(radials[8][0], 0); - EXPECT_EQ(radials[8][4], 3.744878535962e-05); - EXPECT_EQ(radials[8][996], 7.495357740660e-05); - EXPECT_EQ(radials[8][1000], 0); -} - -TEST_F(OrbIOTest, WriteAbacusOrb) -{ - std::ifstream ifs; - std::string elem; - double ecut, dr; - int nr; - std::vector nzeta; - std::vector> radials; - if (GlobalV::MY_RANK == 0) - { - ifs.open(file); - } - ModuleIO::read_abacus_orb(ifs, elem, ecut, nr, dr, nzeta, radials, GlobalV::MY_RANK); - if (GlobalV::MY_RANK == 0) - { - ifs.close(); - } - - const std::string ftmp = "tmp.orb"; - std::ofstream ofs; - if (GlobalV::MY_RANK == 0) - { - ofs.open(ftmp); - } - ModuleIO::write_abacus_orb(ofs, elem, ecut, nr, dr, nzeta, radials, GlobalV::MY_RANK); - if (GlobalV::MY_RANK == 0) - { - ofs.close(); - } -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - std::ifstream ifs1; - - std::string elem1; - double ecut1, dr1; - int nr1; - std::vector nzeta1; - std::vector> radials1; - if (GlobalV::MY_RANK == 0) - { - ifs1.open(ftmp); - } - ModuleIO::read_abacus_orb(ifs1, elem1, ecut1, nr1, dr1, nzeta1, radials1, GlobalV::MY_RANK); - if (GlobalV::MY_RANK == 0) - { - ifs1.close(); - } - - EXPECT_EQ(elem, elem1); - EXPECT_DOUBLE_EQ(ecut, ecut1); - EXPECT_EQ(nr, nr1); - EXPECT_DOUBLE_EQ(dr, dr1); - EXPECT_EQ(nzeta.size(), nzeta1.size()); - for (int i = 0; i < nzeta.size(); ++i) - { - EXPECT_EQ(nzeta[i], nzeta1[i]); - } - EXPECT_EQ(radials.size(), radials1.size()); - for (int i = 0; i < radials.size(); ++i) - { - EXPECT_EQ(radials[i].size(), radials1[i].size()); - for (int j = 0; j < radials[i].size(); ++j) - { - EXPECT_NEAR(radials[i][j], radials1[i][j], tol); - } - } - if (GlobalV::MY_RANK == 0) - { - remove(ftmp.c_str()); - } -} - -int main(int argc, char** argv) -{ - -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} diff --git a/source/module_io/test/output_mulliken_mock.cpp b/source/module_io/test/output_mulliken_mock.cpp deleted file mode 100644 index e03db49db9..0000000000 --- a/source/module_io/test/output_mulliken_mock.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include -#include -#include -#include -#include - -namespace ModuleIO -{ - -std::vector read_k(std::string filename, int ik) -{ - std::ifstream skFile(filename); - // Initialize variables for file parsing - std::string line; - int nrow = 0; - int ncol = 0; - - // find ik before read the following - while (std::getline(skFile, line)) - { - if (line.rfind("# k-point", 0) == 0) - { - std::istringstream ss(line.substr(9)); // 9 to skip "# k-point" - int ik_read; - ss >> ik_read; - if (ik_read == ik) - { - break; - } - } - } - - // Read the file comments, begin parsing when nrow and ncol are found - while (std::getline(skFile, line)) - { - if (line.rfind("# nrow", 0) == 0) - { - std::istringstream ss(line.substr(7)); // 7 to skip "# nrow " - ss >> nrow; - } - else if (line.rfind("# ncol", 0) == 0) - { - std::istringstream ss(line.substr(7)); // 7 to skip "# ncol " - ss >> ncol; - break; - } - } - - // Initialize a vector of size nrow * ncol with default values of 0.0 - std::vector matrix(nrow * ncol, 0.0); - - // Read the rest of the file and populate the vector - int index; - double value; - while (skFile >> index >> value) - { - if (index >= 0 && index < nrow * ncol) - { - matrix[index] = value; - } - } - - skFile.close(); - return matrix; -} - -} // namespace ModuleIO - -#include "module_io/output_dmk.h" -#include "module_io/output_sk.h" - -namespace ModuleIO -{ - -template -Output_DMK::Output_DMK(elecstate::DensityMatrix* p_DM, Parallel_Orbitals* ParaV, int nspin, int nks) - : p_DM_(p_DM), ParaV_(ParaV), nspin_(nspin), nks_(nks) -{ -} - -template -TK* Output_DMK::get_DMK(int ik) -{ - if (this->nspin_ == 1) - { - std::vector dmk = read_k("./support/DMK_nspin1", ik); - /// convert sk to TK - this->DMK.resize(dmk.size()); - for (size_t i = 0; i < dmk.size(); i++) - { - this->DMK[i] = dmk[i]; - // std::cout << "DMK[" << i << "] = " << DMK[i] << std::endl; - } - } - else if (this->nspin_ == 2) - { - std::vector dmk = read_k("./support/DMK_nspin2", ik); - /// convert sk to TK - this->DMK.resize(dmk.size()); - for (size_t i = 0; i < dmk.size(); i++) - { - this->DMK[i] = dmk[i]; - // std::cout << "DMK[" << i << "] = " << DMK[i] << std::endl; - } - } - else if (this->nspin_ == 4) - { - std::vector dmk1 = read_k("./support/DMK_nspin2", 0); - std::vector dmk2 = read_k("./support/DMK_nspin2", 1); - this->DMK.resize(dmk1.size() * 4, 0.0); - for (size_t i = 0; i < dmk1.size(); i++) - { - /// sk1 is column-major, find ir and irc - int ir_nspin2 = i % (ParaV_->nrow / 2); - int ic_nspin2 = i / (ParaV_->nrow / 2); - int ir_nspin4 = ir_nspin2 * 2; - int ic_nspin4 = ic_nspin2 * 2; - int index_nspin4_up = ir_nspin4 + ic_nspin4 * ParaV_->nrow; - int index_nspin4_dn = ir_nspin4 + 1 + (ic_nspin4 + 1) * ParaV_->nrow; - this->DMK[index_nspin4_up] = dmk1[i]; - this->DMK[index_nspin4_dn] = dmk2[i]; - } - } - return this->DMK.data(); -} - -template class Output_DMK; -template class Output_DMK>; - -template -Output_Sk::Output_Sk(hamilt::Hamilt* p_hamilt, Parallel_Orbitals* ParaV, int nspin, int nks) - : p_hamilt_(p_hamilt), ParaV_(ParaV), nspin_(nspin), nks_(nks) -{ -} - -template -TK* Output_Sk::get_Sk(int ik) -{ - if (this->nspin_ == 1) - { - std::vector sk = read_k("./support/SK_nspin1", ik); - /// convert sk to TK - this->SK.resize(sk.size()); - for (size_t i = 0; i < sk.size(); i++) - { - this->SK[i] = sk[i]; - // std::cout << "SK[" << i << "] = " << SK[i] << std::endl; - } - } - else if (this->nspin_ == 2) - { - std::vector sk = read_k("./support/SK_nspin2", ik); - /// convert sk to TK - this->SK.resize(sk.size()); - for (size_t i = 0; i < sk.size(); i++) - { - this->SK[i] = sk[i]; - // std::cout << "SK[" << i << "] = " << SK[i] << std::endl; - } - } - else if (this->nspin_ == 4) - { - std::vector sk1 = read_k("./support/SK_nspin2", 0); - std::vector sk2 = read_k("./support/SK_nspin2", 1); - this->SK.resize(sk1.size() * 4, 0.0); - for (size_t i = 0; i < sk1.size(); i++) - { - /// sk1 is column-major, find ir and irc - int ir_nspin2 = i % (ParaV_->nrow / 2); - int ic_nspin2 = i / (ParaV_->nrow / 2); - int ir_nspin4 = ir_nspin2 * 2; - int ic_nspin4 = ic_nspin2 * 2; - int index_nspin4_up = ir_nspin4 + ic_nspin4 * ParaV_->nrow; - int index_nspin4_dn = ir_nspin4 + 1 + (ic_nspin4 + 1) * ParaV_->nrow; - this->SK[index_nspin4_up] = sk1[i]; - this->SK[index_nspin4_dn] = sk2[i]; - } - } - return this->SK.data(); -} - -template class Output_Sk; -template class Output_Sk>; - -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/test/output_mulliken_test.cpp b/source/module_io/test/output_mulliken_test.cpp deleted file mode 100644 index 5522d80191..0000000000 --- a/source/module_io/test/output_mulliken_test.cpp +++ /dev/null @@ -1,126 +0,0 @@ - -#include "../output_mulliken.h" - -#include "source_cell/cell_index.h" -#include "module_io/output_dmk.h" -#include "module_io/output_sk.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -template -class OutputMullikenTest : public testing::Test -{ - protected: - std::vector atomLabels = {"Si"}; - std::vector atomCounts = {1}; - std::vector> lnchiCounts = {{2, 2, 1}}; - Parallel_Orbitals paraV; - int nrow; - int ncol; -}; - -using MyTypes = ::testing::Types>; -TYPED_TEST_SUITE(OutputMullikenTest, MyTypes); - -TYPED_TEST(OutputMullikenTest, OrbInfo) -{ - CellIndex cell_index = CellIndex(this->atomLabels, this->atomCounts, this->lnchiCounts, 1); - cell_index.write_orb_info("./"); - std::ifstream ifs("./Orbital"); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("#io spec l m z sym")); - EXPECT_THAT(str, testing::HasSubstr("0 Si 2 3 1 dx^2-y^2")); - remove("./Orbital"); -} - -#ifdef __MPI -TYPED_TEST(OutputMullikenTest, nspin1) -{ - this->nrow = 13; - this->ncol = 13; - this->paraV.init(this->nrow, this->ncol, 1, MPI_COMM_WORLD, 0); - auto cell_index = CellIndex(this->atomLabels, this->atomCounts, this->lnchiCounts, 1); - auto out_sk = ModuleIO::Output_Sk(nullptr, &this->paraV, 1, 1); - auto out_dmk = ModuleIO::Output_DMK(nullptr, &this->paraV, 1, 1); - auto mulp = ModuleIO::Output_Mulliken(&(out_sk), &(out_dmk), &(this->paraV), &(cell_index), {0}, 1); - mulp.write(0, "./"); - std::vector tot_chg = mulp.get_tot_chg(); - EXPECT_NEAR(tot_chg[0], 4.0, 1e-5); - std::ifstream ifs("./mulliken.txt"); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("Total charge:\t4")); - EXPECT_THAT(str, testing::HasSubstr("Total Charge on atom: Si 4.0000")); - remove("./mulliken.txt"); -} - -TYPED_TEST(OutputMullikenTest, nspin2) -{ - this->nrow = 13; - this->ncol = 13; - this->paraV.init(this->nrow, this->ncol, 1, MPI_COMM_WORLD, 0); - auto cell_index = CellIndex(this->atomLabels, this->atomCounts, this->lnchiCounts, 2); - auto out_sk = ModuleIO::Output_Sk(nullptr, &this->paraV, 2, 1); - auto out_dmk = ModuleIO::Output_DMK(nullptr, &this->paraV, 2, 1); - auto mulp = ModuleIO::Output_Mulliken(&(out_sk), &(out_dmk), &(this->paraV), &(cell_index), {0, 1}, 2); - mulp.write(0, "./"); - std::vector tot_chg = mulp.get_tot_chg(); - EXPECT_NEAR(tot_chg[0], 3.0, 1e-5); - EXPECT_NEAR(tot_chg[1], 1.0, 1e-5); - std::ifstream ifs("./mulliken.txt"); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("Total charge:\t4")); - EXPECT_THAT(str, testing::HasSubstr("Total charge of spin 1:\t3")); - EXPECT_THAT(str, testing::HasSubstr("Total charge of spin 2:\t1")); - EXPECT_THAT(str, testing::HasSubstr("Total Charge on atom: Si 4.0000")); - EXPECT_THAT(str, testing::HasSubstr("Total Magnetism on atom: Si 2.0000")); - remove("./mulliken.txt"); -} - -TYPED_TEST(OutputMullikenTest, nspin4) -{ - this->nrow = 26; - this->ncol = 26; - this->paraV.init(this->nrow, this->ncol, 1, MPI_COMM_WORLD, 0); - auto cell_index = CellIndex(this->atomLabels, this->atomCounts, this->lnchiCounts, 4); - auto out_sk = ModuleIO::Output_Sk>(nullptr, &this->paraV, 4, 1); - auto out_dmk = ModuleIO::Output_DMK>(nullptr, &this->paraV, 4, 1); - auto mulp - = ModuleIO::Output_Mulliken>(&(out_sk), &(out_dmk), &(this->paraV), &(cell_index), {0}, 4); - mulp.write(0, "./"); - std::vector tot_chg = mulp.get_tot_chg(); - EXPECT_NEAR(tot_chg[0], 4.0, 1e-5); - EXPECT_NEAR(tot_chg[1], 0.0, 1e-5); - EXPECT_NEAR(tot_chg[2], 0.0, 1e-5); - EXPECT_NEAR(tot_chg[3], 2.0, 1e-5); - std::ifstream ifs("./mulliken.txt"); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("Total charge:\t4")); - EXPECT_THAT(str, testing::HasSubstr("Total Charge on atom: Si 4.0000")); - EXPECT_THAT( - str, - testing::HasSubstr( - "Total Magnetism on atom: Si 0.0000 0.0000 2.0000")); - remove("./mulliken.txt"); -} - -#include "mpi.h" -int main(int argc, char** argv) -{ - - MPI_Init(&argc, &argv); - testing::InitGoogleTest(&argc, argv); - - int nprocs; - int myrank; - - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - - int result = RUN_ALL_TESTS(); - - MPI_Finalize(); - - return result; -} -#endif \ No newline at end of file diff --git a/source/module_io/test/output_test.cpp b/source/module_io/test/output_test.cpp deleted file mode 100644 index 8ef69c0f68..0000000000 --- a/source/module_io/test/output_test.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#include -/************************************************ - * unit test of output.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - printr1_d() - * - Print out one dimensional array - * - printV3() - * - Print out ModuleBase::Vector3 - * - printv31_d() - * - Print out one dimensional array of ModuleBase::Vector3 - * - printM3() - * - Print out ModuleBase::Matrix3 - * - printr3_d() - * - Print out three dimensional ModuleBase::realArray - * - printrm() - * - Print out ModuleBase::matrix - */ - -template -T* get_simple_array(int num) -{ - T* rand_array = new T[num](); - assert(num>0); - for (int i=0;i(i); - } - return rand_array; -} - -#include "../output.h" - -class OutputTest : public testing::Test -{ -protected: - std::ofstream ofs; - std::ifstream ifs; - std::string output_str; - int num = 5; -}; - -TEST_F(OutputTest, Printr1_d) -{ - ofs.open("running.log"); - int *simple_array = NULL; - simple_array = get_simple_array(num); - output::printr1_d(ofs,"simple",simple_array,num); - ofs.close(); - ifs.open("running.log"); - getline(ifs,output_str); - getline(ifs,output_str); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("simple n1 = 5")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("0 1 2 3 4")); - ifs.close(); - remove("running.log"); -} - -TEST_F(OutputTest, PrintV3) -{ - ofs.open("running.log"); - ModuleBase::Vector3 u (3.0,4.0,5.0); - output::printV3(ofs,u); - ofs.close(); - ifs.open("running.log"); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("3 4 5")); - ifs.close(); - remove("running.log"); -} - -TEST_F(OutputTest, Printv31_d) -{ - ofs.open("running.log"); - ModuleBase::Vector3* V = new ModuleBase::Vector3[3]; - V[0].set(0.0,1.0,2.0); - V[1].set(3.0,4.0,5.0); - V[2].set(6.6,7.0,8.0); - output::printv31_d(ofs,"vector3 array",V,3); - ofs.close(); - ifs.open("running.log"); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("vector3 array Dimension = 3")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("0 1 2")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("3 4 5")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("6.6 7 8")); - ifs.close(); - remove("running.log"); -} - -TEST_F(OutputTest, PrintM3) -{ - ModuleBase::Matrix3 mb(1,2,3,4,5,6,7,8,9); - testing::internal::CaptureStdout(); - output::printM3("Matrix3",mb); - output_str = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output_str,testing::HasSubstr("Matrix3")); - EXPECT_THAT(output_str,testing::HasSubstr("1 2 3")); - EXPECT_THAT(output_str,testing::HasSubstr("4 5 6")); - EXPECT_THAT(output_str,testing::HasSubstr("7 8 9")); -} - -TEST_F(OutputTest, Printr3_d) -{ - ofs.open("running.log"); - ModuleBase::realArray a3; - a3.create(1,1,4); - a3.zero_out(); - a3(0,0,0) = 0.0; - a3(0,0,1) = 1.0; - a3(0,0,2) = 2.0; - a3(0,0,3) = 3.0; - output::printr3_d(ofs,"realArray3",a3); - ofs.close(); - ifs.open("running.log"); - getline(ifs,output_str); - getline(ifs,output_str); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("realArray3 b1 = 1 b2 = 1 b3 = 4")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("0 1 2 3")); - ifs.close(); - remove("running.log"); -} - -TEST_F(OutputTest, Printrm) -{ - ofs.open("running.log"); - ModuleBase::matrix m23a; - m23a.create(2,3); - for (int i=1;i<=6;++i) {m23a.c[i-1] = i*1.0;} - output::printrm(ofs,"Matrix",m23a); - ofs.close(); - ifs.open("running.log"); - getline(ifs,output_str); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("Matrix nr=2 nc=3")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("1 2 3")); - getline(ifs,output_str); - EXPECT_THAT(output_str,testing::HasSubstr("4 5 6")); - ifs.close(); - remove("running.log"); - // on screen - testing::internal::CaptureStdout(); - output::printrm("Matrix",m23a); - output_str = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output_str,testing::HasSubstr("Matrix nr=2 nc=3")); - EXPECT_THAT(output_str,testing::HasSubstr("1 2 3")); - EXPECT_THAT(output_str,testing::HasSubstr("4 5 6")); -} diff --git a/source/module_io/test/outputlog_test.cpp b/source/module_io/test/outputlog_test.cpp deleted file mode 100644 index d6ebc9fafc..0000000000 --- a/source/module_io/test/outputlog_test.cpp +++ /dev/null @@ -1,343 +0,0 @@ -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include -#include -#include -#include - -#include "source_base/constants.h" -#include "source_base/global_variable.h" -#include "module_io/output_log.h" - -#ifdef __MPI -#include "source_basis/module_pw/test/test_tool.h" -#include "mpi.h" -#endif -/** - * - Tested Functions: - * - output_convergence_after_scf() - * - output_efermi() -*/ - -// Test the output_convergence_after_scf function -TEST(OutputConvergenceAfterSCFTest, TestConvergence) { - bool convergence = true; - double energy = 2.0; - std::ofstream ofs_running("test_output_convergence.txt"); - ModuleIO::output_convergence_after_scf(convergence, energy, ofs_running); - ofs_running.close(); - - std::ifstream ifs_running("test_output_convergence.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = " #SCF IS CONVERGED#\n"; - - EXPECT_EQ(file_content, expected_content); - std::remove("test_output_convergence.txt"); -} - -TEST(OutputConvergenceAfterSCFTest, TestNotConvergence) { - bool convergence = false; - double energy = 2.0; - std::ofstream ofs_running("test_output_convergence_noconvergence.txt"); - testing::internal::CaptureStdout(); - ModuleIO::output_convergence_after_scf(convergence, energy, ofs_running); - std::string screen_output = testing::internal::GetCapturedStdout(); - ofs_running.close(); - - std::ifstream ifs_running("test_output_convergence_noconvergence.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = " !!SCF IS NOT CONVERGED!!\n"; - std::string expected_content_screen = " !!SCF IS NOT CONVERGED!!\n"; - - EXPECT_EQ(file_content, expected_content); - EXPECT_EQ(screen_output, expected_content_screen); - std::remove("test_output_convergence_noconvergence.txt"); -} - -// Test the output_efermi function -TEST(OutputAfterRelaxTest, TestConvergence) -{ - bool conv_ion = true; - bool conv_esolver = false; - std::ofstream ofs_running("test_output_after_relax.txt"); - ModuleIO::output_after_relax(conv_ion, conv_esolver, ofs_running); - ofs_running.close(); - - std::ifstream ifs_running("test_output_after_relax.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content - = "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%" - "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n Relaxation is converged, but the SCF is unconverged! The " - "results are unreliable.. \n\n It is suggested to increase the maximum SCF step and/or perform the " - "relaxation again. " - "\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%" - "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; - - EXPECT_EQ(file_content, expected_content); - std::remove("test_output_after_relax.txt"); -} - -TEST(OutputEfermiTest, TestNotConvergence) { - bool convergence = false; - double efermi = 1.0; - std::ofstream ofs_running("test_output_efermi_noconvergence.txt"); - ModuleIO::output_efermi(convergence, efermi, ofs_running); - ofs_running.close(); - - std::ifstream ifs_running("test_output_efermi_noconvergence.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = ""; // No output expected if convergence is false - - EXPECT_EQ(file_content, expected_content); - std::remove("test_output_efermi_noconvergence.txt"); -} - -TEST(OutputEfermiTest, TestMOutputLevel) { - bool convergence = true; - double efermi = 1.0; - PARAM.input.out_level = "m"; // Setting output level to "m" - std::ofstream ofs_running("test_output_efermi_m_outputlevel.txt"); - ModuleIO::output_efermi(convergence, efermi, ofs_running); - ofs_running.close(); - - std::ifstream ifs_running("test_output_efermi_m_outputlevel.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = ""; // No output expected if OUT_LEVEL is "m" - - EXPECT_EQ(file_content, expected_content); - std::remove("test_output_efermi_m_outputlevel.txt"); -} - -UnitCell::UnitCell() -{ - ntype = 1; - nat = 2; - atoms = new Atom[ntype]; - - latvec.e11 = latvec.e22 = latvec.e33 = 10; - latvec.e12 = latvec.e13 = latvec.e23 = 0; - latvec.e21 = latvec.e31 = latvec.e32 = 0; - - atoms[0].taud.resize(2); - atoms[0].taud[0].set(0.5456, 0, 0.54275); - atoms[0].taud[1].set(0.54, 0.8495, 0.34175); -} -UnitCell::~UnitCell() -{ - if (atoms != nullptr) - delete[] atoms; -} -InfoNonlocal::InfoNonlocal() -{ -} -InfoNonlocal::~InfoNonlocal() -{ -} -Magnetism::Magnetism() -{ -} -Magnetism::~Magnetism() -{ -} -Atom::Atom() -{ - na = 2; - label = "Al"; -} -Atom::~Atom() -{ -} -Atom_pseudo::Atom_pseudo() -{ -} -Atom_pseudo::~Atom_pseudo() -{ -} -pseudo::pseudo() -{ -} -pseudo::~pseudo() -{ -} - -TEST(OutputVacuumLevelTest, OutputVacuumLevel) -{ - PARAM.input.nspin = 1; - UnitCell ucell; - const int nx = 50, ny = 50, nz = 50, nxyz = 125000, nrxx = 125000, nplane = 50, startz_current = 0; - - double** rho = new double*[1]; - rho[0] = new double[nrxx]; - double* v_elecstat = new double[nrxx]; - for (int ir = 0; ir < nrxx; ++ir) - { - rho[0][ir] = 0.01 * ir; - v_elecstat[ir] = 0.02 * ir; - } - - std::ofstream ofs_running("test_output_vacuum_level.txt"); - ModuleIO::output_vacuum_level(&ucell, rho, v_elecstat, nx, ny, nz, nxyz, nrxx, nplane, startz_current, ofs_running); - ofs_running.close(); - - std::ifstream ifs_running("test_output_vacuum_level.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = "The vacuum level is 2380.86 eV\n"; - - EXPECT_EQ(file_content, expected_content); - std::remove("test_output_vacuum_level.txt"); - - delete[] rho[0]; - delete[] rho; - delete[] v_elecstat; -} - -TEST(PrintForce, PrintForce) -{ - UnitCell ucell; - PARAM.input.test_force = 1; - std::string name = "TOTAL-FORCE"; - ModuleBase::matrix force(2, 3); - force(0, 0) = 1.0; - force(0, 1) = 2.0; - force(0, 2) = 3.0; - force(1, 0) = 0.0; - force(1, 1) = 0.0; - force(1, 2) = 0.0; - - std::ofstream ofs("running_force.txt"); - ModuleIO::print_force(ofs, ucell, name, force, false); - ofs.close(); - - std::ifstream ifs("running_force.txt"); - std::string output_str; - - getline(ifs, output_str); - getline(ifs, output_str); // mohan add 2025-06-22 - EXPECT_THAT(output_str, testing::HasSubstr("#TOTAL-FORCE#")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, - testing::HasSubstr("-------------------------------------------------------------------------")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, - testing::HasSubstr(" Atoms Force_x Force_y Force_z")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, - testing::HasSubstr("-------------------------------------------------------------------------")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, - testing::HasSubstr("Al1 25.7110532015 51.4221064030 77.1331596044")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, - testing::HasSubstr("Al2 0.0000000000 0.0000000000 0.0000000000")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, - testing::HasSubstr("-------------------------------------------------------------------------")); - - ifs.close(); - std::remove("running_force.txt"); -} - -TEST(PrintStress, PrintStress) -{ - ModuleBase::matrix stress(3, 3); - stress(0, 0) = 1.0; - stress(0, 1) = 2.0; - stress(0, 2) = 3.0; - stress(1, 0) = 0.0; - stress(1, 1) = 0.0; - stress(1, 2) = 0.0; - stress(2, 0) = 0.0; - stress(2, 1) = 0.0; - stress(2, 2) = 0.0; - - std::ofstream ofs("running_stress.txt"); - bool screen = false; - ModuleIO::print_stress("TOTAL-STRESS", stress, screen, false, ofs); - ofs.close(); - - std::ifstream ifs("running_stress.txt"); - std::string output_str; - getline(ifs, output_str); - getline(ifs, output_str); // mohan add 2025-06-22 - EXPECT_THAT(output_str, testing::HasSubstr(" #TOTAL-STRESS (KBAR)#")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr("----------------------------------------------------------------")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr(" Stress_x Stress_y Stress_z")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr("----------------------------------------------------------------")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr(" 147105.2279754489 294210.4559508978 441315.6839263467")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr(" 0.0000000000 0.0000000000 0.0000000000")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr(" 0.0000000000 0.0000000000 0.0000000000")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr("----------------------------------------------------------------")); - - getline(ifs, output_str); - EXPECT_THAT(output_str, testing::HasSubstr(" #TOTAL-PRESSURE# (EXCLUDE KINETIC PART OF IONS): 49035.075992 KBAR")); - ifs.close(); - std::remove("running_stress.txt"); -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - setupmpi(argc, argv, GlobalV::NPROC, GlobalV::MY_RANK); - divide_pools(GlobalV::NPROC, - GlobalV::MY_RANK, - GlobalV::NPROC_IN_POOL, - GlobalV::KPAR, - GlobalV::MY_POOL, - GlobalV::RANK_IN_POOL); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - finishmpi(); -#endif - return result; -} diff --git a/source/module_io/test/parse_args_test.cpp b/source/module_io/test/parse_args_test.cpp deleted file mode 100644 index 3033b43dbc..0000000000 --- a/source/module_io/test/parse_args_test.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "module_io/parse_args.h" - -#include "gtest/gtest.h" -#include "module_io/read_input.h" -#include "source_main/version.h" - -bool ModuleIO::ReadInput::check_mode = false; - -TEST(ParseArgsTest, OutVersionTest) -{ - // Test case 1: no arguments - char arg0[] = "test"; - char* argv[] = {arg0}; - int argc = 1; - testing::internal::CaptureStdout(); - ModuleIO::parse_args(argc, argv); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_EQ("", output); - // No output expected - -#ifdef VERSION - std::string output_ref = "ABACUS version " + std::string(VERSION) + "\n"; -#else - std::string output_ref = "ABACUS version unknown\n"; -#endif - - // Test case 2: --version argument - char arg1[] = "--version"; - char* argv1[] = {arg0, arg1}; - argc = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(ModuleIO::parse_args(argc, argv1), ::testing::ExitedWithCode(0), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_EQ(output_ref, output); - - // Test case 3: -v argument - char arg2[] = "-v"; - char* argv2[] = {arg0, arg2}; - argc = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(ModuleIO::parse_args(argc, argv2), ::testing::ExitedWithCode(0), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_EQ(output_ref, output); - - // Test case 4: -V argument - char arg3[] = "-V"; - char* argv3[] = {arg0, arg3}; - argc = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(ModuleIO::parse_args(argc, argv3), ::testing::ExitedWithCode(0), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_EQ(output_ref, output); -} - -TEST(ParseArgsTest, CheckInput) -{ - char arg0[] = "test"; - char arg1[] = "--check-input"; - char* argv[] = {arg0, arg1}; - int argc = 2; - ModuleIO::parse_args(argc, argv); - EXPECT_TRUE(ModuleIO::ReadInput::check_mode); -} \ No newline at end of file diff --git a/source/module_io/test/prepare_unitcell.h b/source/module_io/test/prepare_unitcell.h deleted file mode 100644 index e05792a96d..0000000000 --- a/source/module_io/test/prepare_unitcell.h +++ /dev/null @@ -1,327 +0,0 @@ -#ifndef PREPARE_UNITCELL_H -#define PREPARE_UNITCELL_H -#include -#include -#include "source_base/mathzone.h" - -class UcellTestPrepare -{ -public: - UcellTestPrepare()=default; - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in); - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in); - UcellTestPrepare(const UcellTestPrepare &utp); - - std::string latname; - int lmaxmax; - bool init_vel; - bool selective_dynamics; - bool relax_new; - std::string fixed_axes; - double lat0; - std::valarray latvec; - std::vector elements; - std::vector pp_files; - std::vector pp_types; - std::vector orb_files; - std::valarray natom; - std::vector atomic_mass; - std::string coor_type; - std::valarray coordinates; - std::valarray mbl; - std::valarray velocity; - // ntype - int ntype; - int atomic_index; - - UnitCell* SetUcellInfo() - { - //basic info - this->ntype = this->elements.size(); - UnitCell* ucell = new UnitCell; - ucell->setup(this->latname, - this->ntype, - this->lmaxmax, - this->init_vel, - this->fixed_axes); - delete[] ucell->magnet.start_mag; //mag set here - ucell->atom_label.resize(ucell->ntype); - ucell->atom_mass.resize(ucell->ntype); - ucell->pseudo_fn.resize(ucell->ntype); - ucell->pseudo_type.resize(ucell->ntype); - - ucell->orbital_fn.resize(ucell->ntype); - ucell->magnet.start_mag = new double[ucell->ntype]; //mag set here - ucell->magnet.ux_[0] = 0.0; // ux_ set here - ucell->magnet.ux_[1] = 0.0; - ucell->magnet.ux_[2] = 0.0; - for(int it=0;itntype;++it) - { - ucell->atom_label[it] = this->elements[it]; - ucell->atom_mass[it] = this->atomic_mass[it]; - ucell->pseudo_fn[it] = this->pp_files[it]; - ucell->pseudo_type[it] = this->pp_types[it]; - ucell->orbital_fn[it] = this->orb_files[it]; - ucell->magnet.start_mag[it] = 0.0; //mag set here - } - //lattice info - ucell->lat0 = this->lat0; - ucell->lat0_angstrom = ucell->lat0 * 0.529177; - ucell->tpiba = ModuleBase::TWO_PI/ucell->lat0; - ucell->tpiba2 = ucell->tpiba * ucell->tpiba; - ucell->latvec.e11 = this->latvec[0]; - ucell->latvec.e12 = this->latvec[1]; - ucell->latvec.e13 = this->latvec[2]; - ucell->latvec.e21 = this->latvec[3]; - ucell->latvec.e22 = this->latvec[4]; - ucell->latvec.e23 = this->latvec[5]; - ucell->latvec.e31 = this->latvec[6]; - ucell->latvec.e32 = this->latvec[7]; - ucell->latvec.e33 = this->latvec[8]; - ucell->a1.x = ucell->latvec.e11; - ucell->a1.y = ucell->latvec.e12; - ucell->a1.z = ucell->latvec.e13; - ucell->a2.x = ucell->latvec.e21; - ucell->a2.y = ucell->latvec.e22; - ucell->a2.z = ucell->latvec.e23; - ucell->a3.x = ucell->latvec.e31; - ucell->a3.y = ucell->latvec.e32; - ucell->a3.z = ucell->latvec.e33; - ucell->GT = ucell->latvec.Inverse(); - ucell->G = ucell->GT.Transpose(); - ucell->GGT = ucell->G*ucell->GT; - ucell->invGGT = ucell->GGT.Inverse(); - ucell->omega = std::abs(ucell->latvec.Det())*(ucell->lat0)*(ucell->lat0)*(ucell->lat0); - //atomic info - ucell->Coordinate = this->coor_type; - ucell->atoms = new Atom[ucell->ntype]; - ucell->set_atom_flag = true; - this->atomic_index = 0; - for(int it=0;itntype;++it) - { - ucell->atoms[it].label = this->elements[it]; - ucell->atoms[it].nw = 0; - ucell->atoms[it].nwl = 2; - ucell->atoms[it].l_nchi.resize(ucell->atoms[it].nwl+1); - for(int L=0; Latoms[it].nwl+1; L++) - { - ucell->atoms[it].l_nchi[L] = 1; - ucell->atoms[it].nw += (2*L + 1) * ucell->atoms[it].l_nchi[L]; - } - ucell->atoms[it].na = this->natom[it]; - //coordinates and related physical quantities - ucell->atoms[it].tau.resize(ucell->atoms[it].na); - ucell->atoms[it].dis.resize(ucell->atoms[it].na); - ucell->atoms[it].taud.resize(ucell->atoms[it].na); - ucell->atoms[it].vel.resize(ucell->atoms[it].na); - ucell->atoms[it].mag.resize(ucell->atoms[it].na); - ucell->atoms[it].angle1.resize(ucell->atoms[it].na); - ucell->atoms[it].angle2.resize(ucell->atoms[it].na); - ucell->atoms[it].m_loc_.resize(ucell->atoms[it].na); - ucell->atoms[it].mbl.resize(ucell->atoms[it].na); - ucell->atoms[it].mass = ucell->atom_mass[it]; // mass set here - for(int ia=0; iaatoms[it].na; ++ia) - { - if (ucell->Coordinate == "Direct") - { - ucell->atoms[it].taud[ia].x = this->coordinates[this->atomic_index*3+0]; - ucell->atoms[it].taud[ia].y = this->coordinates[this->atomic_index*3+1]; - ucell->atoms[it].taud[ia].z = this->coordinates[this->atomic_index*3+2]; - ucell->atoms[it].tau[ia] = ucell->atoms[it].taud[ia]*ucell->latvec; - } - else if (ucell->Coordinate == "Cartesian") - { - ucell->atoms[it].tau[ia].x = this->coordinates[this->atomic_index*3+0]; - ucell->atoms[it].tau[ia].y = this->coordinates[this->atomic_index*3+1]; - ucell->atoms[it].tau[ia].z = this->coordinates[this->atomic_index*3+2]; - ModuleBase::Mathzone::Cartesian_to_Direct( - ucell->atoms[it].tau[ia].x, ucell->atoms[it].tau[ia].y, ucell->atoms[it].tau[ia].z, - ucell->latvec.e11, ucell->latvec.e12, ucell->latvec.e13, - ucell->latvec.e21, ucell->latvec.e22, ucell->latvec.e23, - ucell->latvec.e31, ucell->latvec.e32, ucell->latvec.e33, - ucell->atoms[it].taud[ia].x, ucell->atoms[it].taud[ia].y, ucell->atoms[it].taud[ia].z); - } - ucell->atoms[it].dis[ia].set(0, 0, 0); - if(this->init_vel) - { - ucell->atoms[it].vel[ia].x = this->velocity[this->atomic_index*3+0]; - ucell->atoms[it].vel[ia].y = this->velocity[this->atomic_index*3+1]; - ucell->atoms[it].vel[ia].z = this->velocity[this->atomic_index*3+2]; - } - else - { - ucell->atoms[it].vel[ia].set(0,0,0); - } - ucell->atoms[it].m_loc_[ia].set(0,0,0); - ucell->atoms[it].angle1[ia] = 0; - ucell->atoms[it].angle2[ia] = 0; - if(this->selective_dynamics) - { - ucell->atoms[it].mbl[ia].x = this->mbl[this->atomic_index*3+0]; - ucell->atoms[it].mbl[ia].y = this->mbl[this->atomic_index*3+1]; - ucell->atoms[it].mbl[ia].z = this->mbl[this->atomic_index*3+2]; - } - else - { - ucell->atoms[it].mbl[ia] = {1,1,1}; - } - ++(this->atomic_index); - } - } - ucell->nat = this->natom.sum(); - return ucell; - } -}; - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in) -{ - mbl = std::valarray(0.0, coordinates_in.size()); - velocity = std::valarray(0.0, coordinates_in.size()); -} - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in), - mbl(mbl_in), - velocity(velocity_in) // velocity assume the existence of mbl in print_stru_file() -{} - -UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): - latname(utp.latname), - lmaxmax(utp.lmaxmax), - init_vel(utp.init_vel), - selective_dynamics(utp.selective_dynamics), - relax_new(utp.relax_new), - fixed_axes(utp.fixed_axes), - lat0(utp.lat0), - latvec(utp.latvec), - elements(utp.elements), - pp_files(utp.pp_files), - pp_types(utp.pp_types), - orb_files(utp.orb_files), - natom(utp.natom), - atomic_mass(utp.atomic_mass), - coor_type(utp.coor_type), - coordinates(utp.coordinates), - mbl(utp.mbl), - velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() -{} - -std::map UcellTestLib -{ - {"Si", UcellTestPrepare( - "fcc", //latname - 2, //lmaxmax - true, //init_vel - true, //selective_dyanmics - true, //relax_new - "volume", //fixed_axes - 10.2, //lat0 - {-0.5,0.0,0.5, //latvec - 0.0,0.5,0.5, - -0.5,0.5,0.0}, - {"Si"}, //elements - {"Si.upf"}, //upf file - {"upf201"}, //upf types - {"Si.orb"}, //orb file - {2}, //number of each elements - {28.0}, //atomic mass - "Cartesian", //coordination type - {0.0,0.0,0.0, //atomic coordinates - 0.25,0.25,0.25})} -}; -#endif diff --git a/source/module_io/test/print_info_test.cpp b/source/module_io/test/print_info_test.cpp deleted file mode 100644 index f26045000e..0000000000 --- a/source/module_io/test/print_info_test.cpp +++ /dev/null @@ -1,213 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#define private public -#include "module_parameter/parameter.h" -#include "source_cell/klist.h" -#include "source_cell/parallel_kpoints.h" -#include "source_cell/unitcell.h" -#include "module_io/berryphase.h" -#include "module_io/print_info.h" -#include "prepare_unitcell.h" -#undef private -#ifdef __LCAO -InfoNonlocal::InfoNonlocal(){} -InfoNonlocal::~InfoNonlocal(){} -LCAO_Orbitals::LCAO_Orbitals(){} -LCAO_Orbitals::~LCAO_Orbitals(){} -void LCAO_Orbitals::bcast_files( - const int &ntype_in, - const int &my_rank) -{ - return; -} -#endif -Magnetism::Magnetism(){} -Magnetism::~Magnetism(){} - -bool berryphase::berry_phase_flag=false; - - -/************************************************ - * unit test of print_info.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - setup_parameters() - * - setup calculation parameters - */ - -class PrintInfoTest : public testing::Test -{ -protected: - std::string output; - UnitCell* ucell; - K_Vectors* kv; - void SetUp() - { - ucell = new UnitCell; - kv = new K_Vectors; - } - void TearDown() - { - delete ucell; - delete kv; - } -}; - -TEST_F(PrintInfoTest, SetupParameters) -{ - UcellTestPrepare utp = UcellTestLib["Si"]; - ucell = utp.SetUcellInfo(); - std::string k_file = "./support/KPT"; - kv->nspin = 1; - kv->read_kpoints(*ucell,k_file); - EXPECT_EQ(kv->get_nkstot(),512); - std::vector cal_type = {"scf","relax","cell-relax","md"}; - std::vector md_types = {"fire","nve","nvt","npt","langevin","msst"}; - GlobalV::MY_RANK = 0; - for(int i=0; i basis_type = {"lcao","pw","lcao_in_pw"}; - for(int i=0; i cal_type = {"scf","nscf","md","relax","cell-relax"}; - for(int i=0; i - -/************************************************ - * unit test of read_exit_file.cpp - ***********************************************/ - -class ReadStopFileTest : public testing::Test -{ - protected: - virtual void SetUp() - { - } - virtual void TearDown() - { - } -}; - -TEST_F(ReadStopFileTest, read_exit_file) -{ - std::string filename = "EXIT"; - std::string output = "running.txt"; - std::ofstream ofs_running(output.c_str(), std::ios::out); - - // case 1: no such file - int stop = ModuleIO::read_exit_file(GlobalV::MY_RANK, filename, ofs_running); - EXPECT_EQ(stop, 0); - MPI_Barrier(MPI_COMM_WORLD); - - // case 2: no keywords in the file - std::ofstream ofs; - if (GlobalV::MY_RANK == 0) - { - ofs.open(filename.c_str(), std::ios::out); - ofs << "no keywords\n\ntest" << std::endl; - ofs.close(); - } - MPI_Barrier(MPI_COMM_WORLD); - stop = ModuleIO::read_exit_file(GlobalV::MY_RANK, filename, ofs_running); - EXPECT_EQ(stop, 0); - MPI_Barrier(MPI_COMM_WORLD); - - // case 3: stop_ion = false stop_elec = false - if (GlobalV::MY_RANK == 0) - { - std::remove(filename.c_str()); - ofs.open(filename.c_str(), std::ios::out); - ofs << "stop_ion false\nstop_elec 0" << std::endl; - ofs.close(); - } - MPI_Barrier(MPI_COMM_WORLD); - stop = ModuleIO::read_exit_file(GlobalV::MY_RANK, filename, ofs_running); - EXPECT_EQ(stop, 0); - MPI_Barrier(MPI_COMM_WORLD); - - // case 4: stop_ion = true stop_elec = false - if (GlobalV::MY_RANK == 0) - { - std::remove(filename.c_str()); - ofs.open(filename.c_str(), std::ios::out); - ofs << "stop_ion true\nstop_elec f" << std::endl; - ofs.close(); - } - MPI_Barrier(MPI_COMM_WORLD); - stop = ModuleIO::read_exit_file(GlobalV::MY_RANK, filename, ofs_running); - EXPECT_EQ(stop, 1); - MPI_Barrier(MPI_COMM_WORLD); - - // case 5: stop_ion = false stop_elec = true - if (GlobalV::MY_RANK == 0) - { - std::remove(filename.c_str()); - ofs.open(filename.c_str(), std::ios::out); - ofs << "stop_ion F\nstop_elec 1" << std::endl; - ofs.close(); - } - MPI_Barrier(MPI_COMM_WORLD); - stop = ModuleIO::read_exit_file(GlobalV::MY_RANK, filename, ofs_running); - EXPECT_EQ(stop, 2); - MPI_Barrier(MPI_COMM_WORLD); - - // case 6: stop_ion = true stop_elec = true - if (GlobalV::MY_RANK == 0) - { - std::remove(filename.c_str()); - ofs.open(filename.c_str(), std::ios::out); - ofs << "stop_ion T\nstop_elec t" << std::endl; - ofs.close(); - } - MPI_Barrier(MPI_COMM_WORLD); - stop = ModuleIO::read_exit_file(GlobalV::MY_RANK, filename, ofs_running); - EXPECT_EQ(stop, 2); - MPI_Barrier(MPI_COMM_WORLD); - - ofs_running.close(); - std::remove(output.c_str()); - std::remove(filename.c_str()); -} - -int main(int argc, char** argv) -{ - MPI_Init(&argc, &argv); - testing::InitGoogleTest(&argc, argv); - - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); - - int result = RUN_ALL_TESTS(); - MPI_Finalize(); - return result; -} \ No newline at end of file diff --git a/source/module_io/test/read_input_ptest.cpp b/source/module_io/test/read_input_ptest.cpp deleted file mode 100644 index 43010d3e02..0000000000 --- a/source/module_io/test/read_input_ptest.cpp +++ /dev/null @@ -1,506 +0,0 @@ -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "source_base/tool_quit.h" -#include "module_io/read_input.h" -#include "module_parameter/parameter.h" - -// #ifdef __MPI -#include "source_base/parallel_global.h" -#include "source_basis/module_pw/test/test_tool.h" -#include "mpi.h" -// #endif -/************************************************ - * unit test of read_input_test.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - ParaRead: - * - read INPUT file and STRU file - * - Check: - * - check_mode = true - */ - -class InputParaTest : public testing::Test -{ - protected: -}; - -// #ifdef __MPI -TEST_F(InputParaTest, ParaRead) -{ - ModuleIO::ReadInput readinput(GlobalV::MY_RANK); - Parameter param; - readinput.read_parameters(param, "./support/INPUT"); - EXPECT_EQ(param.inp.suffix, "autotest"); - EXPECT_EQ(param.inp.stru_file, "./support/STRU"); - EXPECT_EQ(param.inp.kpoint_file, "KPT"); - EXPECT_EQ(param.inp.pseudo_dir, "../../PP_ORB/"); - EXPECT_EQ(param.inp.orbital_dir, "../../PP_ORB/"); - EXPECT_EQ(param.inp.read_file_dir, "OUT.autotest/"); - EXPECT_EQ(param.inp.wannier_card, "none"); - EXPECT_EQ(param.inp.latname, "none"); - EXPECT_EQ(param.inp.calculation, "scf"); - EXPECT_EQ(param.inp.esolver_type, "ksdft"); - EXPECT_DOUBLE_EQ(param.inp.pseudo_rcut, 15.0); - EXPECT_FALSE(param.inp.pseudo_mesh); - EXPECT_EQ(param.inp.ntype, 1); - EXPECT_EQ(param.inp.nbands, 8); - EXPECT_EQ(param.inp.nbands_sto, 256); - EXPECT_EQ(param.inp.out_pchg.size(), 0); - EXPECT_EQ(param.inp.out_wfc_norm.size(), 0); - EXPECT_EQ(param.inp.out_wfc_re_im.size(), 0); - EXPECT_FALSE(param.inp.if_separate_k); - EXPECT_EQ(param.inp.pw_seed, 1); - EXPECT_EQ(param.inp.emin_sto, 0.0); - EXPECT_EQ(param.inp.emax_sto, 0.0); - EXPECT_EQ(param.inp.nche_sto, 100); - EXPECT_EQ(param.inp.seed_sto, 0); - EXPECT_EQ(param.inp.initsto_ecut, 0.0); - EXPECT_EQ(param.inp.bndpar, 1); - EXPECT_EQ(param.inp.kpar, 1); - EXPECT_EQ(param.inp.initsto_freq, 0); - EXPECT_EQ(param.inp.method_sto, 2); - EXPECT_EQ(param.inp.npart_sto, 1); - EXPECT_FALSE(param.inp.cal_cond); - EXPECT_EQ(param.inp.dos_nche, 100); - EXPECT_DOUBLE_EQ(param.inp.cond_che_thr, 1e-8); - EXPECT_DOUBLE_EQ(param.inp.cond_dw, 0.1); - EXPECT_DOUBLE_EQ(param.inp.cond_wcut, 10); - EXPECT_EQ(param.inp.cond_dt, 0.07); - EXPECT_EQ(param.inp.cond_dtbatch, 2); - EXPECT_DOUBLE_EQ(param.inp.cond_fwhm, 0.3); - EXPECT_TRUE(param.inp.cond_nonlocal); - EXPECT_FALSE(param.inp.berry_phase); - EXPECT_EQ(param.inp.ocp_kb.size(), 2); - EXPECT_EQ(param.inp.ocp_kb[0], 1); - EXPECT_EQ(param.inp.ocp_kb[1], 1); - EXPECT_EQ(param.inp.gdir, 3); - EXPECT_FALSE(param.inp.towannier90); - EXPECT_EQ(param.inp.nnkpfile, "seedname.nnkp"); - EXPECT_EQ(param.inp.wannier_spin, "up"); - EXPECT_EQ(param.inp.wannier_method, 1); - EXPECT_TRUE(param.inp.out_wannier_amn); - EXPECT_TRUE(param.inp.out_wannier_mmn); - EXPECT_TRUE(param.inp.out_wannier_unk); - EXPECT_TRUE(param.inp.out_wannier_eig); - EXPECT_TRUE(param.inp.out_wannier_wvfn_formatted); - EXPECT_DOUBLE_EQ(param.inp.kspacing[0], 0.0); - EXPECT_DOUBLE_EQ(param.inp.kspacing[1], 0.0); - EXPECT_DOUBLE_EQ(param.inp.kspacing[2], 0.0); - EXPECT_DOUBLE_EQ(param.inp.min_dist_coef, 0.2); - EXPECT_EQ(param.inp.dft_functional, "hse"); - EXPECT_DOUBLE_EQ(param.inp.xc_temperature, 0.0); - EXPECT_EQ(param.inp.nspin, 1); - EXPECT_DOUBLE_EQ(param.inp.nelec, 0.0); - EXPECT_EQ(param.inp.lmaxmax, 2); - EXPECT_EQ(param.inp.basis_type, "lcao"); - EXPECT_EQ(param.inp.ks_solver, "genelpa"); - EXPECT_DOUBLE_EQ(param.inp.search_radius, -1.0); - EXPECT_EQ(param.inp.symmetry, "1"); - EXPECT_FALSE(param.inp.init_vel); - EXPECT_DOUBLE_EQ(param.inp.symmetry_prec, 1.0e-6); - EXPECT_TRUE(param.inp.symmetry_autoclose); - EXPECT_EQ(param.inp.cal_force, 0); - EXPECT_NEAR(param.inp.force_thr, 1.0e-3, 1.0e-7); - EXPECT_DOUBLE_EQ(param.inp.force_zero_out, 0); - EXPECT_DOUBLE_EQ(param.inp.stress_thr, 1.0e-2); - EXPECT_DOUBLE_EQ(param.inp.press1, 0.0); - EXPECT_DOUBLE_EQ(param.inp.press2, 0.0); - EXPECT_DOUBLE_EQ(param.inp.press3, 0.0); - EXPECT_FALSE(param.inp.cal_stress); - EXPECT_EQ(param.inp.fixed_axes, "None"); - EXPECT_FALSE(param.inp.fixed_ibrav); - EXPECT_FALSE(param.inp.fixed_atoms); - EXPECT_EQ(param.inp.relax_method, "cg"); - EXPECT_DOUBLE_EQ(param.inp.relax_cg_thr, 0.5); - EXPECT_EQ(param.inp.out_level, "ie"); - EXPECT_TRUE(param.globalv.out_md_control); - EXPECT_TRUE(param.inp.relax_new); - EXPECT_DOUBLE_EQ(param.inp.relax_bfgs_w1, 0.01); - EXPECT_DOUBLE_EQ(param.inp.relax_bfgs_w2, 0.5); - EXPECT_DOUBLE_EQ(param.inp.relax_bfgs_rmax, 0.8); - EXPECT_DOUBLE_EQ(param.inp.relax_bfgs_rmin, 1e-5); - EXPECT_DOUBLE_EQ(param.inp.relax_bfgs_init, 0.5); - EXPECT_DOUBLE_EQ(param.inp.relax_scale_force, 0.5); - EXPECT_EQ(param.inp.nbspline, -1); - EXPECT_FALSE(param.globalv.gamma_only_pw); - EXPECT_TRUE(param.globalv.gamma_only_local); - EXPECT_DOUBLE_EQ(param.inp.ecutwfc, 20.0); - EXPECT_DOUBLE_EQ(param.inp.erf_ecut, 20.0); - EXPECT_DOUBLE_EQ(param.inp.erf_height, 20.0); - EXPECT_DOUBLE_EQ(param.inp.erf_sigma, 4.0); - EXPECT_DOUBLE_EQ(param.inp.ecutrho, 80); - EXPECT_EQ(param.inp.fft_mode, 0); - EXPECT_EQ(param.globalv.ncx, 0); - EXPECT_EQ(param.globalv.ncy, 0); - EXPECT_EQ(param.globalv.ncz, 0); - EXPECT_EQ(param.inp.nx, 0); - EXPECT_EQ(param.inp.ny, 0); - EXPECT_EQ(param.inp.nz, 0); - EXPECT_EQ(param.inp.bx, 2); - EXPECT_EQ(param.inp.by, 2); - EXPECT_EQ(param.inp.bz, 2); - EXPECT_EQ(param.inp.ndx, 0); - EXPECT_EQ(param.inp.ndy, 0); - EXPECT_EQ(param.inp.ndz, 0); - EXPECT_EQ(param.inp.diago_proc, std::min(GlobalV::NPROC, 4)); - EXPECT_EQ(param.inp.pw_diag_nmax, 50); - EXPECT_EQ(param.inp.diago_cg_prec, 1); - EXPECT_EQ(param.inp.pw_diag_ndim, 4); - EXPECT_DOUBLE_EQ(param.inp.pw_diag_thr, 1.0e-2); - EXPECT_FALSE(param.inp.diago_smooth_ethr); - EXPECT_EQ(param.inp.nb2d, 0); - EXPECT_EQ(param.inp.nurse, 0); - EXPECT_EQ(param.inp.t_in_h, 1); - EXPECT_EQ(param.inp.vl_in_h, 1); - EXPECT_EQ(param.inp.vnl_in_h, 1); - EXPECT_EQ(param.inp.vh_in_h, 1); - EXPECT_EQ(param.inp.vion_in_h, 1); - EXPECT_EQ(PARAM.inp.test_force, 0); - EXPECT_EQ(param.inp.test_stress, 0); - EXPECT_NEAR(param.inp.scf_thr, 1.0e-8, 1.0e-15); - EXPECT_EQ(param.inp.scf_os_stop, 1); - EXPECT_NEAR(param.inp.scf_os_thr, -0.02, 1.0e-15); - EXPECT_EQ(param.inp.scf_os_ndim, 10); - EXPECT_EQ(param.inp.sc_os_ndim, 5); - EXPECT_NEAR(param.inp.scf_ene_thr, 1.0e-6, 1.0e-15); - EXPECT_EQ(param.inp.scf_nmax, 50); - EXPECT_EQ(param.inp.relax_nmax, 1); - EXPECT_EQ(param.inp.out_stru, 0); - EXPECT_EQ(param.inp.smearing_method, "gauss"); - EXPECT_DOUBLE_EQ(param.inp.smearing_sigma, 0.002); - EXPECT_EQ(param.inp.mixing_mode, "broyden"); - EXPECT_DOUBLE_EQ(param.inp.mixing_beta, 0.7); - EXPECT_EQ(param.inp.mixing_ndim, 8); - EXPECT_DOUBLE_EQ(param.inp.mixing_gg0, 0.00); - EXPECT_EQ(param.inp.init_wfc, "atomic"); - EXPECT_EQ(param.inp.mem_saver, 0); - EXPECT_EQ(param.inp.init_chg, "atomic"); - EXPECT_EQ(param.inp.chg_extrap, "atomic"); - EXPECT_EQ(param.inp.out_freq_elec, 50); - EXPECT_EQ(param.inp.out_freq_ion, 0); - EXPECT_EQ(param.inp.out_chg[0], 0); - EXPECT_EQ(param.inp.out_chg[1], 3); - EXPECT_EQ(param.inp.out_elf[0], 0); - EXPECT_EQ(param.inp.out_elf[1], 3); - EXPECT_EQ(param.inp.out_dmk, 0); - EXPECT_EQ(param.inp.out_dmr, 0); - EXPECT_EQ(param.inp.deepks_out_labels, 0); - EXPECT_EQ(param.inp.deepks_scf, 0); - EXPECT_EQ(param.inp.deepks_equiv, 0); - EXPECT_EQ(param.inp.deepks_bandgap, 0); - EXPECT_EQ(param.inp.deepks_out_unittest, 0); - EXPECT_EQ(param.inp.out_pot, 2); - EXPECT_EQ(param.inp.out_wfc_pw, 0); - EXPECT_EQ(param.inp.out_dos, 0); - EXPECT_EQ(param.inp.out_ldos[0], 1); - EXPECT_EQ(param.inp.out_ldos[1], 3); - EXPECT_EQ(param.inp.out_band[0], 0); - EXPECT_EQ(param.inp.out_band[1], 8); - EXPECT_EQ(param.inp.out_proj_band, 0); - EXPECT_EQ(param.inp.out_mat_hs[0], 0); - EXPECT_EQ(param.inp.out_mat_hs[1], 8); - EXPECT_EQ(param.inp.out_mat_hs2, 0); - EXPECT_FALSE(param.inp.out_mat_xc); - EXPECT_FALSE(param.inp.out_mat_xc2); - EXPECT_FALSE(param.inp.out_eband_terms); - EXPECT_EQ(param.inp.out_interval, 1); - EXPECT_EQ(param.inp.out_app_flag, 0); - EXPECT_EQ(param.inp.out_mat_r, 0); - EXPECT_FALSE(param.inp.out_wfc_lcao); - EXPECT_FALSE(param.inp.out_alllog); - EXPECT_DOUBLE_EQ(param.inp.dos_emin_ev, -15); - EXPECT_DOUBLE_EQ(param.inp.dos_emax_ev, 15); - EXPECT_DOUBLE_EQ(param.inp.dos_edelta_ev, 0.01); - EXPECT_DOUBLE_EQ(param.inp.dos_scale, 0.01); - EXPECT_DOUBLE_EQ(param.inp.dos_sigma, 0.07); - EXPECT_DOUBLE_EQ(param.inp.stm_bias[0], 2.0); - EXPECT_DOUBLE_EQ(param.inp.stm_bias[1], 0.1); - EXPECT_EQ(param.inp.stm_bias[2], 5); - EXPECT_DOUBLE_EQ(param.inp.ldos_line[0], 0.1); - EXPECT_DOUBLE_EQ(param.inp.ldos_line[1], 0.2); - EXPECT_DOUBLE_EQ(param.inp.ldos_line[2], 0.3); - EXPECT_DOUBLE_EQ(param.inp.ldos_line[3], 0.4); - EXPECT_DOUBLE_EQ(param.inp.ldos_line[4], 0.5); - EXPECT_DOUBLE_EQ(param.inp.ldos_line[5], 0.6); - EXPECT_EQ(param.inp.ldos_line[6], 200); - EXPECT_FALSE(param.inp.out_element_info); - EXPECT_DOUBLE_EQ(param.inp.lcao_ecut, 20); - EXPECT_DOUBLE_EQ(param.inp.lcao_dk, 0.01); - EXPECT_DOUBLE_EQ(param.inp.lcao_dr, 0.01); - EXPECT_DOUBLE_EQ(param.inp.lcao_rmax, 30); - EXPECT_TRUE(param.inp.bessel_nao_smooth); - EXPECT_DOUBLE_EQ(param.inp.bessel_nao_sigma, 0.1); - EXPECT_EQ(std::stod(param.inp.bessel_nao_ecut), 20); - EXPECT_DOUBLE_EQ(param.inp.bessel_nao_rcuts[0], 6.0); - EXPECT_DOUBLE_EQ(param.inp.bessel_nao_tolerence, 1E-12); - EXPECT_EQ(param.inp.bessel_descriptor_lmax, 2); - EXPECT_TRUE(param.inp.bessel_descriptor_smooth); - EXPECT_DOUBLE_EQ(param.inp.bessel_descriptor_sigma, 0.1); - EXPECT_EQ(std::stod(param.inp.bessel_descriptor_ecut), 20); - EXPECT_DOUBLE_EQ(param.inp.bessel_descriptor_rcut, 6.0); - EXPECT_DOUBLE_EQ(param.inp.bessel_descriptor_tolerence, 1E-12); - EXPECT_FALSE(param.inp.efield_flag); - EXPECT_FALSE(param.inp.dip_cor_flag); - EXPECT_EQ(param.inp.efield_dir, 2); - EXPECT_DOUBLE_EQ(param.inp.efield_pos_max, 0.5); - EXPECT_DOUBLE_EQ(param.inp.efield_pos_dec, 0.1); - EXPECT_DOUBLE_EQ(param.inp.efield_amp, 0.0); - EXPECT_FALSE(param.inp.gate_flag); - EXPECT_DOUBLE_EQ(param.inp.zgate, 0.5); - EXPECT_FALSE(param.inp.relax); - EXPECT_FALSE(param.inp.block); - EXPECT_DOUBLE_EQ(param.inp.block_down, 0.45); - EXPECT_DOUBLE_EQ(param.inp.block_up, 0.55); - EXPECT_DOUBLE_EQ(param.inp.block_height, 0.1); - EXPECT_EQ(param.inp.vdw_method, "d2"); - EXPECT_EQ(std::stod(param.inp.vdw_s6), 0.75); - EXPECT_EQ(param.inp.vdw_s8, "default"); - EXPECT_EQ(param.inp.vdw_a1, "default"); - EXPECT_EQ(param.inp.vdw_a2, "default"); - EXPECT_DOUBLE_EQ(param.inp.vdw_d, 20); - EXPECT_FALSE(param.inp.vdw_abc); - EXPECT_EQ(std::stod(param.inp.vdw_cutoff_radius), 56.6918); - EXPECT_EQ(param.inp.vdw_radius_unit, "Bohr"); - EXPECT_DOUBLE_EQ(param.inp.vdw_cn_thr, 40.0); - EXPECT_EQ(param.inp.vdw_cn_thr_unit, "Bohr"); - EXPECT_EQ(param.inp.vdw_C6_file, "default"); - EXPECT_EQ(param.inp.vdw_C6_unit, "Jnm6/mol"); - EXPECT_EQ(param.inp.vdw_R0_file, "default"); - EXPECT_EQ(param.inp.vdw_R0_unit, "A"); - EXPECT_EQ(param.inp.vdw_cutoff_type, "radius"); - EXPECT_EQ(param.inp.vdw_cutoff_period[0], 3); - EXPECT_EQ(param.inp.vdw_cutoff_period[1], 3); - EXPECT_EQ(param.inp.vdw_cutoff_period[2], 3); - EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_fock_alpha[0]), 1); - EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_erfc_alpha[0]), 0.25); - EXPECT_EQ(param.inp.exx_real_number, "1"); - EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_erfc_omega[0]), 0.11); - EXPECT_TRUE(param.inp.exx_separate_loop); - EXPECT_EQ(param.inp.exx_hybrid_step, 100); - EXPECT_DOUBLE_EQ(std::stod(param.inp.exx_fock_lambda[0]), 0.3); - EXPECT_DOUBLE_EQ(param.inp.exx_mixing_beta, 1.0); - EXPECT_DOUBLE_EQ(param.inp.exx_pca_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_c_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_v_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_dm_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_c_grad_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_v_grad_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_c_grad_r_threshold, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_v_grad_r_threshold, 0); - EXPECT_EQ(param.inp.exx_ccp_rmesh_times, "1.5"); - EXPECT_DOUBLE_EQ(param.inp.rpa_ccp_rmesh_times, 10.0); - EXPECT_EQ(param.inp.exx_opt_orb_lmax, 0); - EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_ecut, 0.0); - EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_tolerence, 0.0); - EXPECT_FALSE(param.inp.noncolin); - EXPECT_FALSE(param.inp.lspinorb); - EXPECT_DOUBLE_EQ(param.inp.soc_lambda, 1.0); - EXPECT_DOUBLE_EQ(param.inp.td_force_dt, 0.02); - EXPECT_EQ(param.inp.td_vext, 0); - EXPECT_EQ(param.inp.propagator, 0); - EXPECT_EQ(param.inp.td_stype, 0); - EXPECT_EQ(param.inp.td_ttype, "0"); - EXPECT_EQ(param.inp.td_tstart, 1); - EXPECT_EQ(param.inp.td_tend, 1000); - EXPECT_EQ(param.inp.td_lcut1, 0.05); - EXPECT_EQ(param.inp.td_lcut2, 0.95); - EXPECT_EQ(param.inp.td_gauss_amp, "0.25"); - EXPECT_EQ(param.inp.td_gauss_freq, "22.13"); - EXPECT_EQ(param.inp.td_gauss_phase, "0.0"); - EXPECT_EQ(param.inp.td_gauss_t0, "100.0"); - EXPECT_EQ(param.inp.td_gauss_sigma, "30.0"); - EXPECT_EQ(param.inp.td_trape_amp, "2.74"); - EXPECT_EQ(param.inp.td_trape_freq, "1.60"); - EXPECT_EQ(param.inp.td_trape_phase, "0.0"); - EXPECT_EQ(param.inp.td_trape_t1, "1875"); - EXPECT_EQ(param.inp.td_trape_t2, "5625"); - EXPECT_EQ(param.inp.td_trape_t3, "7500"); - EXPECT_EQ(param.inp.td_trigo_freq1, "1.164656"); - EXPECT_EQ(param.inp.td_trigo_freq2, "0.029116"); - EXPECT_EQ(param.inp.td_trigo_phase1, "0.0"); - EXPECT_EQ(param.inp.td_trigo_phase2, "0.0"); - EXPECT_EQ(param.inp.td_trigo_amp, "2.74"); - EXPECT_EQ(param.inp.td_heavi_t0, "100"); - EXPECT_EQ(param.inp.td_heavi_amp, "1.0"); - - EXPECT_EQ(param.inp.out_dipole, 0); - EXPECT_EQ(param.inp.out_efield, 0); - EXPECT_EQ(param.inp.td_print_eij, -1.0); - EXPECT_EQ(param.inp.td_edm, 0); - EXPECT_DOUBLE_EQ(param.inp.cell_factor, 1.2); - EXPECT_EQ(param.inp.out_mul, 0); - EXPECT_FALSE(param.inp.restart_save); - EXPECT_FALSE(param.inp.restart_load); - EXPECT_FALSE(param.inp.test_skip_ewald); - EXPECT_EQ(param.inp.dft_plus_u, 0); - EXPECT_FALSE(param.inp.yukawa_potential); - EXPECT_DOUBLE_EQ(param.inp.yukawa_lambda, -1.0); - EXPECT_EQ(param.inp.onsite_radius, 0.0); - EXPECT_EQ(param.inp.omc, 0); - EXPECT_FALSE(param.inp.dft_plus_dmft); - EXPECT_FALSE(param.inp.rpa); - EXPECT_EQ(param.inp.imp_sol, 0); - EXPECT_DOUBLE_EQ(param.inp.eb_k, 80.0); - EXPECT_DOUBLE_EQ(param.inp.tau, 1.0798 * 1e-5); - EXPECT_DOUBLE_EQ(param.inp.sigma_k, 0.6); - EXPECT_DOUBLE_EQ(param.inp.nc_k, 0.00037); - EXPECT_EQ(param.inp.of_kinetic, "vw"); - EXPECT_EQ(param.inp.of_method, "tn"); - EXPECT_EQ(param.inp.of_conv, "energy"); - EXPECT_DOUBLE_EQ(param.inp.of_tole, 1e-6); - EXPECT_DOUBLE_EQ(param.inp.of_tolp, 1e-5); - EXPECT_DOUBLE_EQ(param.inp.of_tf_weight, 1.); - EXPECT_DOUBLE_EQ(param.inp.of_vw_weight, 1.); - EXPECT_DOUBLE_EQ(param.inp.of_wt_alpha, 0.833333); - EXPECT_DOUBLE_EQ(param.inp.of_wt_beta, 0.833333); - EXPECT_DOUBLE_EQ(param.inp.of_wt_rho0, 1.); - EXPECT_TRUE(param.inp.of_hold_rho0); - EXPECT_DOUBLE_EQ(param.inp.of_lkt_a, 1.3); - EXPECT_FALSE(param.inp.of_full_pw); - EXPECT_EQ(param.inp.of_full_pw_dim, 0); - EXPECT_FALSE(param.inp.of_read_kernel); - EXPECT_EQ(param.inp.of_kernel_file, "WTkernel.txt"); - EXPECT_EQ(param.inp.device, "cpu"); - EXPECT_NEAR(param.inp.force_thr_ev, 0.025711245953622324, 1e-8); - EXPECT_DOUBLE_EQ(param.globalv.hubbard_u[0], 0); - EXPECT_EQ(param.inp.orbital_corr[0], -1); - EXPECT_EQ(param.inp.mdp.lj_rule, 2); - EXPECT_FALSE(param.inp.mdp.lj_eshift); - EXPECT_NEAR(param.inp.mdp.lj_epsilon[0], 0.01032, 1e-7); - EXPECT_NEAR(param.inp.mdp.lj_rcut[0], 8.5, 1e-7); - EXPECT_NEAR(param.inp.mdp.lj_sigma[0], 3.405, 1e-7); - EXPECT_EQ(param.inp.mdp.md_damp, 1); - EXPECT_EQ(param.inp.mdp.md_dt, 1); - EXPECT_EQ(param.inp.mdp.md_dumpfreq, 1); - EXPECT_EQ(param.inp.mdp.md_nraise, 1); - EXPECT_EQ(param.inp.cal_syns, 0); - EXPECT_EQ(param.inp.dmax, 0.01); - EXPECT_EQ(param.inp.mdp.md_nstep, 10); - EXPECT_EQ(param.inp.mdp.md_pchain, 1); - EXPECT_EQ(param.inp.mdp.md_pcouple, "xyz"); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_pfirst, -1); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_pfreq, 0); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_plast, -1); - EXPECT_EQ(param.inp.mdp.md_pmode, "iso"); - EXPECT_EQ(param.inp.mdp.md_restart, 0); - EXPECT_EQ(param.inp.mdp.md_restartfreq, 5); - EXPECT_EQ(param.inp.mdp.md_seed, -1); - EXPECT_EQ(param.inp.mdp.md_prec_level, 0); - EXPECT_DOUBLE_EQ(param.inp.ref_cell_factor, 1.2); - EXPECT_EQ(param.inp.mdp.md_tchain, 1); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_tfirst, -1); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_tfreq, 0); - EXPECT_EQ(param.inp.mdp.md_thermostat, "nhc"); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_tlast, -1); - EXPECT_DOUBLE_EQ(param.inp.mdp.md_tolerance, 100); - EXPECT_EQ(param.inp.mdp.md_type, "nvt"); - EXPECT_EQ(param.inp.mdp.msst_direction, 2); - EXPECT_DOUBLE_EQ(param.inp.mdp.msst_qmass, 1); - EXPECT_DOUBLE_EQ(param.inp.mdp.msst_tscale, 0.01); - EXPECT_DOUBLE_EQ(param.inp.mdp.msst_vel, 0); - EXPECT_DOUBLE_EQ(param.inp.mdp.msst_vis, 0); - EXPECT_EQ(param.inp.mdp.pot_file, "graph.pb"); - EXPECT_DOUBLE_EQ(param.inp.mdp.dp_rescaling, 1.0); - EXPECT_EQ(param.inp.mdp.dp_fparam.size(), 2); - EXPECT_EQ(param.inp.mdp.dp_aparam.size(), 2); - EXPECT_DOUBLE_EQ(param.inp.mdp.dp_fparam[0], 1.0); - EXPECT_DOUBLE_EQ(param.inp.mdp.dp_fparam[1], 1.1); - EXPECT_DOUBLE_EQ(param.inp.mdp.dp_aparam[0], 1.0); - EXPECT_DOUBLE_EQ(param.inp.mdp.dp_aparam[1], 1.2); - EXPECT_FALSE(param.inp.mdp.dump_force); - EXPECT_FALSE(param.inp.mdp.dump_vel); - EXPECT_FALSE(param.inp.mdp.dump_virial); - EXPECT_EQ(param.inp.sc_mag_switch, 0); - EXPECT_TRUE(param.inp.decay_grad_switch); - EXPECT_DOUBLE_EQ(param.inp.sc_thr, 1e-4); - EXPECT_EQ(param.inp.nsc, 50); - EXPECT_EQ(param.inp.nsc_min, 4); - EXPECT_EQ(param.inp.sc_scf_nmin, 4); - EXPECT_DOUBLE_EQ(param.inp.alpha_trial, 0.02); - EXPECT_DOUBLE_EQ(param.inp.sccut, 4.0); - EXPECT_EQ(param.inp.sc_scf_thr, 1e-3); - EXPECT_EQ(param.inp.sc_drop_thr, 1e-3); - EXPECT_EQ(param.inp.lr_nstates, 1); - EXPECT_EQ(param.inp.nocc, param.inp.nbands); - EXPECT_EQ(param.inp.nvirt, 1); - EXPECT_EQ(param.inp.xc_kernel, "LDA"); - EXPECT_EQ(param.inp.lr_init_xc_kernel[0], "default"); - EXPECT_EQ(param.inp.lr_solver, "dav"); - EXPECT_DOUBLE_EQ(param.inp.lr_thr, 1e-2); - EXPECT_FALSE(param.inp.lr_unrestricted); - EXPECT_FALSE(param.inp.out_wfc_lr); - EXPECT_EQ(param.inp.abs_wavelen_range.size(), 2); - EXPECT_DOUBLE_EQ(param.inp.abs_wavelen_range[0], 0.0); - EXPECT_DOUBLE_EQ(param.inp.abs_broadening, 0.01); - EXPECT_EQ(param.inp.abs_gauge, "length"); - EXPECT_EQ(param.inp.rdmft, 0); - EXPECT_DOUBLE_EQ(param.inp.rdmft_power_alpha, 0.656); -} - -// comment out this part of tests, since Parameter is in another directory now, mohan 2025-05-18 -// besides, the following tests will cause strange error in MPI_Finalize() -// I tried the following modification, it worked well in my own environment, but not in the Github test, Xinyuan 2025-05-25 -/* -TEST_F(InputParaTest, Check) -{ - if (GlobalV::MY_RANK == 0) - { - std::ofstream emptyfile("./empty_INPUT"); - emptyfile << "INPUT_PARAMETERS \n"; - emptyfile << "stru_file ./support/STRU \n"; - emptyfile.close(); - } - MPI_Barrier(MPI_COMM_WORLD); - - bool original_check_mode = ModuleIO::ReadInput::check_mode; - ModuleIO::ReadInput::check_mode = true; - ModuleIO::ReadInput readinput(GlobalV::MY_RANK); - - Parameter param; - testing::internal::CaptureStdout(); - try { - readinput.read_parameters(param, "./empty_INPUT"); - - // if exit normally with exit(0) - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("INPUT parameters have been successfully checked!")); - - } catch (const std::exception& e) { - // if exit with error, then the test is failed - std::cerr << "Rank " << GlobalV::MY_RANK << " error: " << e.what() << std::endl; - MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE); - } catch (...) { - // if exit with unknown error, then the test is failed - std::cerr << "Rank " << GlobalV::MY_RANK << " unknown error." << std::endl; - MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE); - } - // Note : the EXPECT_EXIT is not working with MPI, so we use try-catch to test the exit - // EXPECT_EXIT(readinput.read_parameters(param, "./empty_INPUT"), ::testing::ExitedWithCode(0), ""); - // std::string output = testing::internal::GetCapturedStdout(); - // EXPECT_THAT(output, testing::HasSubstr("INPUT parameters have been successfully checked!")); - MPI_Barrier(MPI_COMM_WORLD); - if (GlobalV::MY_RANK == 0) - { - EXPECT_TRUE(std::remove("./empty_INPUT") == 0); - } - ModuleIO::ReadInput::check_mode = original_check_mode; -} -*/ - -int main(int argc, char** argv) -{ - MPI_Init(&argc, &argv); - testing::InitGoogleTest(&argc, argv); - - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); - - int result = RUN_ALL_TESTS(); - MPI_Finalize(); - return result; -} diff --git a/source/module_io/test/read_rhog_test.cpp b/source/module_io/test/read_rhog_test.cpp deleted file mode 100644 index d8743f81d7..0000000000 --- a/source/module_io/test/read_rhog_test.cpp +++ /dev/null @@ -1,159 +0,0 @@ -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "module_io/rhog_io.h" -#ifdef __MPI -#include "source_basis/module_pw/test/test_tool.h" -#include "mpi.h" -#endif - -/** - * - Tested Functions: - * - read_rhog() - */ - -class ReadRhogTest : public ::testing::Test -{ - protected: - ModulePW::PW_Basis* rhopw = nullptr; - std::complex** rhog = nullptr; - - virtual void SetUp() - { - rhopw = new ModulePW::PW_Basis; - rhog = new std::complex*[1]; - rhog[0] = new std::complex[1471]; - } - virtual void TearDown() - { - if (rhopw != nullptr) { - delete rhopw; -} - if (rhog[0] != nullptr) { - delete[] rhog[0]; -} - if (rhog != nullptr) { - delete[] rhog; -} - } -}; - -// Test the read_rhog function -TEST_F(ReadRhogTest, ReadRhog) -{ - std::string filename = "./support/charge-density.dat"; - PARAM.input.nspin = 1; -#ifdef __MPI - rhopw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, MPI_COMM_WORLD); -#endif - rhopw->initgrids(6.5, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 120); - rhopw->initparameters(false, 120); - rhopw->setuptransform(); - rhopw->collect_local_pw(); - - bool result = ModuleIO::read_rhog(filename, rhopw, rhog); - - EXPECT_TRUE(result); - EXPECT_DOUBLE_EQ(rhog[0][0].real(), -1.0304462993299456e-05); - EXPECT_DOUBLE_EQ(rhog[0][0].imag(), -1.2701788626185278e-13); - EXPECT_DOUBLE_EQ(rhog[0][1].real(), -0.0003875762482855959); - EXPECT_DOUBLE_EQ(rhog[0][1].imag(), -4.2556814316812048e-12); - EXPECT_DOUBLE_EQ(rhog[0][1470].real(), -3.5683133614445107e-05); - EXPECT_DOUBLE_EQ(rhog[0][1470].imag(), 1.6176615686863767e-12); -} - -// Test the read_rhog function when the file is not found -TEST_F(ReadRhogTest, NotFoundFile) -{ - std::string filename = "notfound.txt"; - - GlobalV::ofs_warning.open("test_read_rhog.txt"); - bool result = ModuleIO::read_rhog(filename, rhopw, rhog); - GlobalV::ofs_warning.close(); - - std::ifstream ifs_running("test_read_rhog.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = " ModuleIO::read_rhog warning : Can't open file notfound.txt\n"; - - EXPECT_FALSE(result); - EXPECT_EQ(file_content, expected_content); - std::remove("test_read_rhog.txt"); -} - -// Test the read_rhog function when tgamma_only is inconsistent -TEST_F(ReadRhogTest, InconsistentGammaOnly) -{ - std::string filename = "./support/charge-density.dat"; - PARAM.input.nspin = 2; - rhopw->gamma_only = true; - - GlobalV::ofs_warning.open("test_read_rhog.txt"); - bool result = ModuleIO::read_rhog(filename, rhopw, rhog); - GlobalV::ofs_warning.close(); - - std::ifstream ifs_running("test_read_rhog.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content - = " ModuleIO::read_rhog warning : some planewaves in file are not used\n ModuleIO::read_rhog warning : some " - "spin channels in file are missing\n ModuleIO::read_rhog warning : gamma_only read from file is " - "inconsistent with INPUT\n"; - - EXPECT_FALSE(result); - EXPECT_EQ(file_content, expected_content); - std::remove("test_read_rhog.txt"); -} - -// Test the read_rhog function when some planewaves in file are missing -TEST_F(ReadRhogTest, SomePWMissing) -{ - std::string filename = "./support/charge-density.dat"; - PARAM.input.nspin = 1; - rhopw->npwtot = 2000; - - GlobalV::ofs_warning.open("test_read_rhog.txt"); - bool result = ModuleIO::read_rhog(filename, rhopw, rhog); - GlobalV::ofs_warning.close(); - - std::ifstream ifs_running("test_read_rhog.txt"); - std::stringstream ss; - ss << ifs_running.rdbuf(); - std::string file_content = ss.str(); - ifs_running.close(); - - std::string expected_content = " ModuleIO::read_rhog warning : some planewaves in file are missing\n"; - - EXPECT_TRUE(result); - EXPECT_EQ(file_content, expected_content); - std::remove("test_read_rhog.txt"); -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - setupmpi(argc, argv, GlobalV::NPROC, GlobalV::MY_RANK); - divide_pools(GlobalV::NPROC, - GlobalV::MY_RANK, - GlobalV::NPROC_IN_POOL, - GlobalV::KPAR, - GlobalV::MY_POOL, - GlobalV::RANK_IN_POOL); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - finishmpi(); -#endif - return result; -} \ No newline at end of file diff --git a/source/module_io/test/read_wf2rho_pw_test.cpp b/source/module_io/test/read_wf2rho_pw_test.cpp deleted file mode 100644 index 5dfe219a49..0000000000 --- a/source/module_io/test/read_wf2rho_pw_test.cpp +++ /dev/null @@ -1,374 +0,0 @@ -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#undef __LCAO - -#define private public -#include "source_cell/klist.h" -#include "source_cell/unitcell.h" -#include "source_estate/module_charge/charge.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "source_pw/hamilt_pwdft/parallel_grid.h" -#include "module_io/read_wf2rho_pw.h" -#include "module_io/write_wfc_pw.h" -#include "module_io/filename.h" // mohan add 2025-05-17 -#include "module_parameter/parameter.h" -#include "source_psi/psi.h" - -#ifdef __MPI -#include "source_base/parallel_global.h" -#include "source_basis/module_pw/test/test_tool.h" -#include "mpi.h" -#endif - -Parallel_Grid::Parallel_Grid() -{ -} -Parallel_Grid::~Parallel_Grid() -{ -} -Charge::Charge() -{ -} -Charge::~Charge() -{ -} -UnitCell::UnitCell() -{ -} -UnitCell::~UnitCell() -{ -} -Magnetism::Magnetism() -{ -} -Magnetism::~Magnetism() -{ -} -int XC_Functional::func_type = 0; -bool XC_Functional::ked_flag = false; - -Symmetry_rho::Symmetry_rho() -{ -} -Symmetry_rho::~Symmetry_rho() -{ -} -void Symmetry_rho::begin(const int& spin_now, - const Charge& CHR, - const ModulePW::PW_Basis* rho_basis, - ModuleSymmetry::Symmetry& symm) const -{ - return; -} - -void cal_ik2iktot(std::vector& ik2iktot, const int& nks, const int& nkstot) -{ - if(PARAM.inp.kpar==1) - { - for(int ik = 0; ik < nks; ++ik) - { - ik2iktot[ik] = ik; - } - } - else if(PARAM.inp.kpar==2) - { - if(GlobalV::MY_POOL==0) - { - for(int ik = 0; ik < nks; ++ik) - { - ik2iktot[ik] = ik; - } - } - else if(GlobalV::MY_POOL==1) - { - for(int ik = 0; ik < nks; ++ik) - { - ik2iktot[ik] = ik+2; // only works for this test - } - } - } -} - -namespace GlobalC -{ - Parallel_Grid Pgrid; -} // namespace GlobalC - -/** - * - Tested Functions: - * - write_wfc_pw() - * - read_wf2rho_pw() - */ - -class ReadWfcRhoTest : public ::testing::Test -{ - protected: - ModulePW::PW_Basis_K* wfcpw = nullptr; - ModulePW::PW_Basis* rhopw = nullptr; - K_Vectors* kv = nullptr; - psi::Psi>* psi = nullptr; - Charge chg; - ModuleSymmetry::Symmetry symm; - virtual void SetUp() - { - wfcpw = new ModulePW::PW_Basis_K; - rhopw = new ModulePW::PW_Basis; - kv = new K_Vectors; - // output .dat file - PARAM.input.out_wfc_pw = 2; - } - virtual void TearDown() - { - delete wfcpw; - delete rhopw; - delete kv; - } -}; - -TEST_F(ReadWfcRhoTest, ReadWfcRho) -{ - // kpar=1, if nproc=1 - // kpar=2, if nproc>1 - const int kpar = GlobalV::KPAR; - const int nspin = 1; - const int nbands = 4; - const int my_pool = GlobalV::MY_POOL; - const int my_rank = GlobalV::MY_RANK; - const int nks = 2; - const int nkstot = GlobalV::KPAR * nks; - - //------------------------- - // Initialize the k-points - //------------------------- - kv->set_nkstot(nkstot); - kv->set_nks(nks); - kv->isk = {0, 0}; - const double shift = my_pool * 0.1; - kv->kvec_d = {ModuleBase::Vector3(shift, shift, shift), - ModuleBase::Vector3(0.5 + shift, 0.5 + shift, 0.5 + shift)}; - kv->ik2iktot.resize(nks); - cal_ik2iktot(kv->ik2iktot, nks, nkstot); - - //------------------------- - // Initialize the pw basis - //------------------------- -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); - rhopw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - rhopw->initgrids(5.3233, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 80); - rhopw->initparameters(false, 80); - rhopw->setuptransform(); - rhopw->collect_local_pw(); - - wfcpw->initgrids(5.3233, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 80); - wfcpw->initparameters(false, 20, nks, kv->kvec_d.data()); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - //------------------------- - // Initialize k points - //------------------------- - kv->kvec_c.clear(); - for (int ik = 0; ik < nks; ++ik) - { - kv->kvec_c.push_back(wfcpw->kvec_c[ik]); - } - kv->ngk = {wfcpw->npwk[0], wfcpw->npwk[1]}; - kv->wk = {1.0, 1.0}; - - //---------------------------------------- - // Initialize weights for wave functions - //---------------------------------------- - ModuleBase::matrix wg(nkstot, nbands); - wg.fill_out(1.0); - if (GlobalV::MY_RANK == 0) - { - // mohan update 2025-06-02 - std::ofstream ofs("eig.txt"); - ofs << " Electronic state energy (eV) and occupations" << std::endl; - ofs << " Spin number " << nspin << std::endl; - ofs << std::setprecision(8); - ofs << std::setiosflags(std::ios::showpoint); - - const int is = 0; // nspin is 1 - for (int ik = 0; ik < nkstot; ++ik) - { - ofs << " spin=" << is+1 << " k-point=" - << ik + 1 << "/" << nkstot - << " Cartesian=" << kv->kvec_c[ik].x << " " << kv->kvec_c[ik].y - << " " << kv->kvec_c[ik].z << " (" << kv->ngk[ik] << " plane wave)" << std::endl; - - ofs << std::setprecision(16); - ofs << std::setiosflags(std::ios::showpoint); - - double ekb = -1.23456; // energy - for (int ib = 0; ib < nbands; ib++) - { - ofs << " " << ib + 1 << " " << ekb << " " << wg(ik,ib) << std::endl; - } - - ofs << std::endl; - } - ofs.close(); - } - - //---------------------------------------- - // Initialize wave functions Psi - //---------------------------------------- - psi = new psi::Psi>(nks, nbands, wfcpw->npwk_max, kv->ngk, true); - std::complex* ptr = psi->get_pointer(); - for (int i = 0; i < nks * nbands * wfcpw->npwk_max; i++) - { - ptr[i] = std::complex((i + my_pool * 100) / 100.0, (i + my_pool) / 100.0); - } - - //---------------------------------------- - // Initialize charge density - //---------------------------------------- - chg.rho = new double*[nspin]; - chg._space_rho = new double[rhopw->nrxx]; - chg.rho[0] = chg._space_rho; - ModuleBase::GlobalFunc::ZEROS(chg.rho[0], rhopw->nrxx); - chg.rhopw = rhopw; - chg.nrxx = rhopw->nrxx; - - //---------------------------------------- - // set charge_ref - //---------------------------------------- - Charge chg_ref; - chg_ref.rho = new double*[nspin]; - chg_ref._space_rho = new double[rhopw->nrxx]; - chg_ref.rho[0] = chg_ref._space_rho; - ModuleBase::GlobalFunc::ZEROS(chg_ref.rho[0], rhopw->nrxx); - std::vector> rho_tmp(rhopw->nrxx); - chg_ref.nrxx = rhopw->nrxx; - - for (int ik = 0; ik < nks; ++ik) - { - for (int ib = 0; ib < nbands; ++ib) - { - const std::complex* wfc_ib = ptr + ik * nbands * wfcpw->npwk_max + ib * wfcpw->npwk_max; - wfcpw->recip2real(wfc_ib, rho_tmp.data(), ik); - - const double w1 = wg(ik, ib) / wfcpw->omega; - - for (int ir = 0; ir < rhopw->nrxx; ir++) - { - chg_ref.rho[0][ir] += w1 * std::norm(rho_tmp[ir]); - } - } - } - -#ifdef __MPI - chg_ref.init_chgmpi(); - chg_ref.reduce_diff_pools(chg_ref.rho[0]); -#endif - - // for spin=1 or 2, npol=1 - const int npol=1; - - // Write the wave functions to file - const std::string out_dir = "./"; - - // Read the wave functions to charge density - std::stringstream ss; - ss << "running_log" << GlobalV::MY_RANK << ".txt"; - std::ofstream running_log(ss.str().c_str()); - - running_log << " rank=" << GlobalV::MY_RANK << std::endl; - - - const double ecutwfc = 20; // this is a fake number - - ModuleIO::write_wfc_pw( - kpar, my_pool, my_rank, nbands, nspin, npol, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.input.out_wfc_pw, ecutwfc, out_dir, *psi, *kv, wfcpw, - running_log); - - ModuleIO::read_wf2rho_pw(wfcpw, symm, chg, - out_dir, kpar, my_pool, my_rank, - GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, - nbands, nspin, npol, - nkstot, kv->ik2iktot, kv->isk, running_log); - - // compare the charge density - for (int ir = 0; ir < rhopw->nrxx; ++ir) - { - EXPECT_NEAR(chg.rho[0][ir], chg_ref.rho[0][ir], 1e-8); - } - - if (GlobalV::NPROC == 1) - { - EXPECT_NEAR(chg.rho[0][0], 8617.076357957576, 1e-8); - } - else if (GlobalV::NPROC == 4) - { - const std::vector ref = {8207.849135313403, 35.34776105132742, 8207.849135313403, 35.34776105132742}; - EXPECT_NEAR(chg.rho[0][0], ref[GlobalV::MY_RANK], 1e-8); - // for (int ip = 0; ip < GlobalV::NPROC; ++ip) - // { - // if (GlobalV::MY_RANK == ip) - // { - // std::cout.precision(16); - // std::cout << GlobalV::MY_RANK << " " << chg.rho[0][0] << std::endl; - // } - // MPI_Barrier(MPI_COMM_WORLD); - // } - } - - delete[] chg.rho; - delete[] chg._space_rho; - delete[] chg_ref.rho; - delete[] chg_ref._space_rho; - delete psi; - - if (GlobalV::MY_RANK == 0) - { - remove("running_log0.txt"); - remove("eig.txt"); - remove("wfs1k1_pw.dat"); - remove("wfs1k2_pw.dat"); - if (GlobalV::KPAR == 2) - { - remove("wfs1k3_pw.dat"); - remove("wfs1k4_pw.dat"); - remove("running_log1.txt"); - remove("running_log2.txt"); - remove("running_log3.txt"); - } - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - setupmpi(argc, argv, GlobalV::NPROC, GlobalV::MY_RANK); - - // when kpar == 2, nspin == 2 - PARAM.input.kpar = (GlobalV::NPROC > 1) ? 2 : 1; - GlobalV::KPAR = PARAM.input.kpar; - PARAM.input.bndpar = 1; - Parallel_Global::divide_pools(GlobalV::NPROC, - GlobalV::MY_RANK, - PARAM.inp.bndpar, - GlobalV::KPAR, - GlobalV::NPROC_IN_BNDGROUP, - GlobalV::RANK_IN_BPGROUP, - GlobalV::MY_BNDGROUP, - GlobalV::NPROC_IN_POOL, - GlobalV::RANK_IN_POOL, - GlobalV::MY_POOL); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - finishmpi(); -#endif - return result; -} diff --git a/source/module_io/test/read_wfc_lcao_test.cpp b/source/module_io/test/read_wfc_lcao_test.cpp deleted file mode 100644 index 63bdaa7cd1..0000000000 --- a/source/module_io/test/read_wfc_lcao_test.cpp +++ /dev/null @@ -1,772 +0,0 @@ -#include "module_io/read_wfc_lcao.h" - -#include "gtest/gtest.h" - -TEST(ReadWfcLcaoTest, ReadAbacusLowfComplex) -{ - - // this test should only be executed on rank 0 -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); - // printf("MPI environment detected, will use only rank 0\n"); - int iproc = 0; - int nprocs = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &iproc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - if (iproc != 0) - { - GTEST_SKIP(); - } -#endif - int ik = 0; - ModuleBase::Vector3 kvec_c; - int nbands = 0; - int nbasis = 0; - std::vector> lowf; - std::vector ekb; - std::vector occ; - double wk = -1.0; - - // first test - std::string flowf = "./support/wfs1k1_nao.txt"; - ModuleIO::read_wfc_lcao(flowf, ik, kvec_c, nbands, nbasis, lowf, ekb, occ, wk); - EXPECT_EQ(1, ik); - EXPECT_EQ(3, nbands); - EXPECT_EQ(63, nbasis); - EXPECT_EQ(1.0, wk); // this is overwritten with 1.0 - // kvec_c - EXPECT_NEAR(-0.10540388, kvec_c.x, 1e-7); - EXPECT_NEAR(-0.060854959, kvec_c.y, 1e-7); - EXPECT_NEAR(-0.043030954, kvec_c.z, 1e-7); - // ekb - EXPECT_EQ(ekb.size(), nbands); - EXPECT_NEAR(-6.03571945e-01, ekb[0], 1e-7); - EXPECT_NEAR(-5.98035141e-01, ekb[1], 1e-7); - EXPECT_NEAR(-5.98035141e-01, ekb[2], 1e-7); - // occ - EXPECT_EQ(occ.size(), nbands); - EXPECT_NEAR(5.83090379e-03, occ[0], 1e-7); - EXPECT_NEAR(5.83090379e-03, occ[1], 1e-7); - EXPECT_NEAR(5.83090379e-03, occ[2], 1e-7); - // lowf - EXPECT_EQ(lowf.size(), nbands * nbasis); - EXPECT_NEAR(lowf[0].real(), -6.71651157e-03, 1e-7); - EXPECT_NEAR(lowf[0].imag(), 2.25946383e-02, 1e-7); - EXPECT_NEAR(lowf[1].real(), 1.43180123e-03, 1e-7); - EXPECT_NEAR(lowf[1].imag(), 1.46451488e-03, 1e-7); - EXPECT_NEAR(lowf[2].real(), 2.31452033e-03, 1e-7); - EXPECT_NEAR(lowf[2].imag(), -1.18949691e-03, 1e-7); - EXPECT_NEAR(lowf[62].real(), 1.82648757e-03, 1e-7); - EXPECT_NEAR(lowf[62].imag(), -2.11799886e-03, 1e-7); - // test reuse, expect to overwrite the previous values - flowf = "./support/wfs1k2_nao.txt"; - ModuleIO::read_wfc_lcao(flowf, ik, kvec_c, nbands, nbasis, lowf, ekb, occ, wk); - EXPECT_EQ(2, ik); - EXPECT_EQ(3, nbands); - EXPECT_EQ(63, nbasis); - EXPECT_EQ(1.0, wk); // this is overwritten with 1.0 - // kvec_c - EXPECT_NEAR(-0.070269254, kvec_c.x, 1e-7); - EXPECT_NEAR(-0.081139946, kvec_c.y, 1e-7); - EXPECT_NEAR(-0.057374606, kvec_c.z, 1e-7); - // ekb - EXPECT_EQ(ekb.size(), nbands); - EXPECT_NEAR(-6.03667277e-01, ekb[0], 1e-7); - EXPECT_NEAR(-5.97868276e-01, ekb[1], 1e-7); - EXPECT_NEAR(-5.97662421e-01, ekb[2], 1e-7); - // occ - EXPECT_EQ(occ.size(), nbands); - EXPECT_NEAR(5.83090379e-03, occ[0], 1e-7); - EXPECT_NEAR(5.83090379e-03, occ[1], 1e-7); - EXPECT_NEAR(5.83090379e-03, occ[2], 1e-7); - // lowf - EXPECT_EQ(lowf.size(), nbands * nbasis); - EXPECT_NEAR(2.09933705e-02, lowf[0].real(), 1e-7); - EXPECT_NEAR(2.20619371e-03, lowf[0].imag(), 1e-7); - EXPECT_NEAR(1.52454416e-03, lowf[1].real(), 1e-7); - EXPECT_NEAR(-3.54139105e-04, lowf[1].imag(), 1e-7); - EXPECT_NEAR(1.31198443e-03, lowf[2].real(), 1e-7); - EXPECT_NEAR(-2.44872538e-03, lowf[2].imag(), 1e-7); - EXPECT_NEAR(lowf[62].real(), -1.15158489e-03, 1e-7); - EXPECT_NEAR(lowf[62].imag(), -1.79940038e-03, 1e-7); - // test reuse, the second time - flowf = "./support/wfs1k3_nao.txt"; - ModuleIO::read_wfc_lcao(flowf, ik, kvec_c, nbands, nbasis, lowf, ekb, occ, wk); - EXPECT_EQ(3, ik); - EXPECT_EQ(3, nbands); - EXPECT_EQ(63, nbasis); - EXPECT_EQ(1.0, wk); // this is overwritten with 1.0 - // kvec_c - EXPECT_NEAR(-0.035134627, kvec_c.x, 1e-7); - EXPECT_NEAR(-0.10142493, kvec_c.y, 1e-7); - EXPECT_NEAR(-0.07171825, kvec_c.z, 1e-7); - // ekb - EXPECT_NEAR(-6.04664544e-01, ekb[0], 1e-7); - EXPECT_NEAR(-5.97025474e-01, ekb[1], 1e-7); - EXPECT_NEAR(-5.96870018e-01, ekb[2], 1e-7); - // occ - EXPECT_NEAR(5.83090379e-03, occ[0], 1e-7); - EXPECT_NEAR(5.83090379e-03, occ[1], 1e-7); - EXPECT_NEAR(5.83090379e-03, occ[2], 1e-7); - // lowf - EXPECT_NEAR(-6.44410072e-03, lowf[0].real(), 1e-7); - EXPECT_NEAR(2.86108252e-03, lowf[0].imag(), 1e-7); - EXPECT_NEAR(-5.81398415e-03, lowf[1].real(), 1e-7); - EXPECT_NEAR(4.01495705e-03, lowf[1].imag(), 1e-7); - EXPECT_NEAR(-2.32158666e-03, lowf[2].real(), 1e-7); - EXPECT_NEAR(2.62541166e-03, lowf[2].imag(), 1e-7); - EXPECT_NEAR(lowf[62].real(), 5.58964902e-04, 1e-7); - EXPECT_NEAR(lowf[62].imag(), 5.21866389e-04, 1e-7); -} - -TEST(ReadWfcLcaoTest, Cpzgemr2dUseTest) -{ -/* -(0,0) (0,1) (0,2) (0,3) (0,4) (0,5) (0,6) (0,7) (0,8) (0,9) (0,10) (0,11) -(1,0) (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (1,7) (1,8) (1,9) (1,10) (1,11) -(2,0) (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) (2,7) (2,8) (2,9) (2,10) (2,11) -(3,0) (3,1) (3,2) (3,3) (3,4) (3,5) (3,6) (3,7) (3,8) (3,9) (3,10) (3,11) -... -(9,0) (9,1) (9,2) (9,3) (9,4) (9,5) (9,6) (9,7) (9,8) (9,9) (9,10) (9,11) -*/ -#ifdef __MPI - // this test should be run on all ranks - int iproc = 0; - int nprocs = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &iproc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - if (nprocs != 4) - { - if (iproc == 0) - { - printf("Please run this unittest with nprocs = 4.\n"); - } - GTEST_SKIP(); - } - // one get data on rank 0 - std::vector> lowf_glb; - const int nbands = 10; // nrow_glb - const int nbasis = 12; // ncol_glb - if (iproc == 0) - { - printf("Run unittest ScatterLowfTest::ScatterLowfComplex with MPI env:\n"); - printf("Total number of processes: %d\n\n", nprocs); - printf("Row-major processor grid is used.\n\n"); - printf("First test the \"column-major\" matrix, which means for columns their memory\n"); - printf("are consecutive. The matrix in form of (i, j), where i runs over [0, 9] and \n"); - printf("j runs over [0, 11]: (0,0), (1,0), (2,0), ..., (9,0), (0,1), ...\n"); - lowf_glb.resize(nbands * nbasis); - for (int i = 0; i < nbands * nbasis; i++) - { - const int j = i / nbands, k = i % nbands; - lowf_glb[i] = std::complex(k, j); - } - } - // the other ranks get data - MPI_Barrier(MPI_COMM_WORLD); - std::vector> lowf_loc; - Parallel_2D para2d_test; // an alternative to ParaV. But to use paraV, the desc would be desc_wfc instead of desc in - // Parallel_2D - // initialize a para2d, as if it is paraV. - // BE CAREFUL! One must be careful about defining the dimension properly. Now the original - // matrix is made column-memory-consecutive, thus the vectorized data must be cut by "the - // number of rows", then by "the number of columns". - // nbands is "the number of rows", nbasis is "the number of columns" - para2d_test.init(nbands, nbasis, 4, MPI_COMM_WORLD); - Parallel_2D para2d_glb; - para2d_glb.init(nbands, nbasis, std::max(nbands, nbasis), MPI_COMM_WORLD); - lowf_loc.resize(para2d_test.nrow * para2d_test.ncol); // the nrow and ncol are automatically - // calculated by Parallel_2D - // wait, what is the meaning of nrow here? The "nrow" again is just the number to cut - // the vectorized data into a matrix. The "nrow" is the number of rows in the matrix but - // remember the matrix is column-memory-consecutive. - - // the following function can do the scattering-gathering automatically. - // a double counterpart is pdgemr2d_, int counterpart is pigemr2d_ - // Those in C style are Cpzgemr2d, Cdgemr2d, Cigemr2d... - Cpxgemr2d(nbands, nbasis, lowf_glb.data(), 1, 1, const_cast(para2d_glb.desc), lowf_loc.data(), 1, 1, - const_cast(para2d_test.desc), para2d_glb.blacs_ctxt); - // what will happen if impose a row-major processor grid onto a column-major matrix? - // you can get correct results, expect each block is column-major. - // Have a look: - MPI_Barrier(MPI_COMM_WORLD); - std::vector sizes_loc = {4 * 4 * 3, 4 * 4 + 4 * 2, 4 * 4 * 2, 4 * 4}; - std::vector> reals = {{0, 1, 2, 3, 8, 9}, {0, 1, 2, 3, 8, 9}, {4, 5, 6, 7}, {4, 5, 6, 7}}; - std::vector> imags - = {{0, 1, 2, 3, 8, 9, 10, 11}, {4, 5, 6, 7}, {0, 1, 2, 3, 8, 9, 10, 11}, {4, 5, 6, 7}}; - for (int i = 0; i < nprocs; i++) - { - if (iproc == i) - { - EXPECT_EQ(lowf_loc.size(), sizes_loc[i]); - printf(">>> rank %d: \n", iproc); - printf("First print scattered matrix in the way that ELEMENTS WITH CONSECUTIVE\n"); - printf("MEMORIES ARE SHOWN (only shown) IN THE SAME LINE:\n"); - for (int j = 0; j < lowf_loc.size(); j++) - { - printf("(%2.0f,%2.0f)", lowf_loc[j].real(), lowf_loc[j].imag()); - if ((j + 1) % para2d_test.nrow == 0) - { - printf("\n"); - } - const int k = j % para2d_test.nrow; - EXPECT_NEAR(lowf_loc[j].real(), reals[i][k], 1e-7); - const int l = j / para2d_test.nrow; - EXPECT_NEAR(lowf_loc[j].imag(), imags[i][l], 1e-7); - } - printf("Or INDEX IT to show like \"row-major\":\n"); - // (i, j) -> (i', j') with i = j' and j = i' - // x = i*ncol + j, x' = i'*ncol' + j' with ncol' = nrow and nrow' = ncol - // i = x/ncol, j = x%ncol, x' = j*nrow + i = x%ncol*nrow + x/ncol - for (int j = 0; j < lowf_loc.size(); j++) - { - const int x = j % para2d_test.ncol * para2d_test.nrow + j / para2d_test.ncol; - printf("(%2.0f,%2.0f)", lowf_loc[x].real(), lowf_loc[x].imag()); - if ((j + 1) % para2d_test.ncol == 0) - { - printf("\n"); - } - } - printf("\n"); - usleep(10000); - } - MPI_Barrier(MPI_COMM_WORLD); - } - MPI_Barrier(MPI_COMM_WORLD); - - // test the other way around, the row-major matrix - if (iproc == 0) - { - printf("Now test the \"row-major\" matrix, which means for rows their memory\n"); - printf("are consecutive. The matrix in form of (i, j), where i runs over [0, 9] and \n"); - printf("j runs over [0, 11]: (0,0), (0,1), (0,2), ..., (0,11), (1,0), ...\n"); - for (int i = 0; i < nbands * nbasis; i++) - { - const int irow = i / nbasis, icol = i % nbasis; - lowf_glb[i] = std::complex(irow, icol); - } - } - // the other ranks get data - MPI_Barrier(MPI_COMM_WORLD); - // initialize a para2d, as if it is paraV. - Parallel_2D para2d_test_prime; - // note! this time the memory is first cut by "the number of columns", - // then by "the number of rows". Therefore the "nbasis" is put the first. - // This is how ScaLAPCK defines a matrix: the first number defines the leading dimension. - para2d_test_prime.init(nbasis, nbands, 4, MPI_COMM_WORLD); - Parallel_2D para2d_glb_prime; - para2d_glb_prime.init(nbasis, nbands, std::max(nbands, nbasis), MPI_COMM_WORLD); - lowf_loc.resize(para2d_test_prime.nrow * para2d_test_prime.ncol); - Cpxgemr2d(nbasis, nbands, lowf_glb.data(), 1, 1, const_cast(para2d_glb_prime.desc), lowf_loc.data(), 1, 1, - const_cast(para2d_test_prime.desc), para2d_glb_prime.blacs_ctxt); - MPI_Barrier(MPI_COMM_WORLD); - sizes_loc = {4 * 4 * 3, 4 * 4 * 2, 4 * 4 + 4 * 2, 4 * 4}; - reals = {{0, 1, 2, 3, 8, 9}, {4, 5, 6, 7}, {0, 1, 2, 3, 8, 9}, {4, 5, 6, 7}}; - imags = {{0, 1, 2, 3, 8, 9, 10, 11}, {0, 1, 2, 3, 8, 9, 10, 11}, {4, 5, 6, 7}, {4, 5, 6, 7}}; - for (int i = 0; i < nprocs; i++) - { - if (iproc == i) - { - EXPECT_EQ(lowf_loc.size(), sizes_loc[i]); - printf(">>> rank %d: \n", iproc); - for (int j = 0; j < lowf_loc.size(); j++) - { - printf("(%2.0f,%2.0f)", lowf_loc[j].real(), lowf_loc[j].imag()); - if ((j + 1) % para2d_test_prime.nrow == 0) - { - printf("\n"); - } - const int k = j / para2d_test_prime.nrow; - EXPECT_NEAR(lowf_loc[j].real(), reals[i][k], 1e-7); - const int l = j % para2d_test_prime.nrow; - EXPECT_NEAR(lowf_loc[j].imag(), imags[i][l], 1e-7); - } - printf("\n"); - usleep(10000); - } - MPI_Barrier(MPI_COMM_WORLD); - } - MPI_Barrier(MPI_COMM_WORLD); - if (iproc == 0) - { - printf("BE CAREFUL!\n"); - printf("You note that the PROCESSOR GRID seems to be transposed. It is because\n"); - printf("in C/C++ it is always assumed memory in the same row is consecutive, while\n"); - printf("in FORTRAN or \"what ScaLAPACK supposes\" it is column-memory-consecutive.\n"); - usleep(10000); - } - MPI_Barrier(MPI_COMM_WORLD); -#else - printf("Run unittest ScatterLowfTest::ScatterLowfComplex without MPI env:\n"); - printf("This test is not executed because MPI is not enabled.\n"); - GTEST_SKIP(); -#endif -} - -TEST(ReadWfcLcaoTest, ReadAbacusLowfReal) -{ - // this test should only be executed on rank 0 -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); - // printf("MPI environment detected, will use only rank 0\n"); - int iproc = 0; - int nprocs = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &iproc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - if (iproc != 0) - { - GTEST_SKIP(); - } -#endif - int ik = 1; // should be overwritten to 0 - ModuleBase::Vector3 kvec_c; - int nbands = 0; - int nbasis = 0; - std::vector lowf; - std::vector ekb; - std::vector occ; - double wk = -1.0; // should be overwritten to 1.0 - - // first test - const std::string flowf = "./support/wfs2_nao.txt"; - ModuleIO::read_wfc_lcao(flowf, ik, kvec_c, nbands, nbasis, lowf, ekb, occ, wk); - EXPECT_EQ(0, ik); - EXPECT_EQ(3, nbands); - EXPECT_EQ(31, nbasis); - EXPECT_EQ(1.0, wk); - // kvec_c, gamma point, 0, 0, 0 - EXPECT_NEAR(0.0, kvec_c.x, 1e-7); - EXPECT_NEAR(0.0, kvec_c.y, 1e-7); - EXPECT_NEAR(0.0, kvec_c.z, 1e-7); - // ekb - EXPECT_EQ(ekb.size(), nbands); - EXPECT_NEAR(-1.22787155e+00, ekb[0], 1e-7); - EXPECT_NEAR(-3.10595658e-01, ekb[1], 1e-7); - EXPECT_NEAR(-3.00546690e-01, ekb[2], 1e-7); - // occ - EXPECT_EQ(occ.size(), nbands); - EXPECT_NEAR(2.00000000e+00, occ[0], 1e-7); - EXPECT_NEAR(2.00000000e+00, occ[1], 1e-7); - EXPECT_NEAR(2.00000000e+00, occ[2], 1e-7); - // lowf - EXPECT_EQ(lowf.size(), nbands * nbasis); - EXPECT_NEAR(-1.51728369e-02, lowf[0], 1e-7); - EXPECT_NEAR(-2.07808444e-03, lowf[1], 1e-7); - EXPECT_NEAR(1.21298954e-17, lowf[2], 1e-7); - EXPECT_NEAR(-5.44883791e-09, lowf[30], 1e-7); -} - -TEST(ReadWfcLcaoTest, Cpdgemr2dUseTest) -{ - // you can find more information in unittest Pzgemr2dUseTest, present test - // works identically to the previous one, but with real numbers. -#ifdef __MPI - // this test should be run on all ranks - int iproc = 0; - int nprocs = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &iproc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - if (nprocs != 4) - { - if (iproc == 0) - { - printf("Please run this unittest with nprocs = 4.\n"); - } - GTEST_SKIP(); - } - std::vector lowf_glb; - const int nbands = 10; - const int nbasis = 12; - // still, the expected matrix is organized as row-memory-consecutive but here - // just make the matrix column-memory-consecutive. - // x = i*ncol + j, x' = j*nrow + i - // i = x/ncol, j = x%ncol, x' = j*nrow + i = x%ncol*nrow + x/ncol - if (iproc == 0) - { - lowf_glb.resize(nbands * nbasis); - for (int i = 0; i < nbands * nbasis; i++) - { - lowf_glb[i] = i % nbasis * nbands + i / nbasis; - } - } - MPI_Barrier(MPI_COMM_WORLD); - std::vector lowf_loc; - Parallel_2D para2d_test; - para2d_test.init(nbasis, nbands, 4, MPI_COMM_WORLD); - Parallel_2D para2d_glb; - para2d_glb.init(nbasis, nbands, std::max(nbands, nbasis), MPI_COMM_WORLD); - lowf_loc.resize(para2d_test.nrow * para2d_test.ncol); - Cpxgemr2d(nbasis, nbands, lowf_glb.data(), 1, 1, const_cast(para2d_glb.desc), lowf_loc.data(), 1, 1, - const_cast(para2d_test.desc), para2d_glb.blacs_ctxt); - MPI_Barrier(MPI_COMM_WORLD); - std::vector sizes_loc = {4 * 4 * 3, 4 * 4 * 2, 4 * 4 + 4 * 2, 4 * 4}; - for (int i = 0; i < nprocs; i++) - { - if (iproc == i) - { - EXPECT_EQ(lowf_loc.size(), sizes_loc[i]); - } - } - MPI_Barrier(MPI_COMM_WORLD); - // test the other way around, the row-major matrix - if (iproc == 0) - { - for (int i = 0; i < nbands * nbasis; i++) - { - lowf_glb[i] = i; - } - } - MPI_Barrier(MPI_COMM_WORLD); - Parallel_2D para2d_test_prime; - para2d_test_prime.init(nbands, nbasis, 4, MPI_COMM_WORLD); - Parallel_2D para2d_glb_prime; - para2d_glb_prime.init(nbands, nbasis, std::max(nbands, nbasis), MPI_COMM_WORLD); - lowf_loc.resize(para2d_test_prime.nrow * para2d_test_prime.ncol); - Cpxgemr2d(nbands, nbasis, lowf_glb.data(), 1, 1, const_cast(para2d_glb_prime.desc), lowf_loc.data(), 1, 1, - const_cast(para2d_test_prime.desc), para2d_glb_prime.blacs_ctxt); - MPI_Barrier(MPI_COMM_WORLD); - sizes_loc = {4 * 4 * 3, 4 * 4 + 4 * 2, 4 * 4 * 2, 4 * 4}; - for (int i = 0; i < nprocs; i++) - { - if (iproc == i) - { - EXPECT_EQ(lowf_loc.size(), sizes_loc[i]); - } - } - MPI_Barrier(MPI_COMM_WORLD); -#endif -} - -TEST(ReadWfcLcaoTest, RestartFromFileParallel) -{ -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); - // printf("MPI environment detected, will use only rank 0\n"); - int iproc = 0; - int nprocs = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &iproc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - if (nprocs != 4) - { - if (iproc == 0) - { - printf("Please run this unittest with nprocs = 4.\n"); - } - GTEST_SKIP(); - } - Parallel_2D para2d_test; - // this time the nbands and nbasis are given as priori, from reading of INPUT and of orb files. - para2d_test.init(63, 3, 2, MPI_COMM_WORLD); - // therefore it is a nrows x ncols matrix, where nr = 3, nc = 63 - // scatter it with block size 2 x 2, on 4-processors grid. From testcase ReadWfcLcaoTest::Cpzgemr2dTest - // it is known the processor grid will be transposed to column-major, thus - // the global matrix will be split to 2 x 2 blocks, one 2 x 1 block, 1 x 2 blocks and 1 x 1 block - // number of elements: - // rank0: ceil(63/2)*2 = 64 - // rank1: ceil(63/2)*1 = 32 - // rank2: floor(63/2)*2 = 62 - // rank3: floor(63/2)*1 = 31 - // total size check - if (iproc == 0) - { - EXPECT_EQ(64, para2d_test.nrow * para2d_test.ncol); - } - if (iproc == 1) - { - EXPECT_EQ(32, para2d_test.nrow * para2d_test.ncol); - } - if (iproc == 2) - { - EXPECT_EQ(62, para2d_test.nrow * para2d_test.ncol); - } - if (iproc == 3) - { - EXPECT_EQ(31, para2d_test.nrow * para2d_test.ncol); - } - // nrows check - if (iproc == 0) - { - EXPECT_EQ(2, para2d_test.ncol); - } - if (iproc == 1) - { - EXPECT_EQ(1, para2d_test.ncol); - } - if (iproc == 2) - { - EXPECT_EQ(2, para2d_test.ncol); - } - if (iproc == 3) - { - EXPECT_EQ(1, para2d_test.ncol); - } - - const std::string out_dir = "./support"; - const int nks = 4; - int nbands = -1; - int nbasis = -1; - std::vector> lowf; - std::vector ekb; - std::vector occ; - std::vector> kvec_c; - std::vector wk; - ModuleIO::restart_from_file(out_dir, para2d_test, nks, nbands, nbasis, lowf, ekb, occ, kvec_c, wk); - EXPECT_EQ(3, nbands); - EXPECT_EQ(63, nbasis); - // ekb, occ, kvec_c, wk will have size irrelevant to scatter - EXPECT_EQ(nks * nbands, ekb.size()); - EXPECT_EQ(nks * nbands, occ.size()); - EXPECT_EQ(nks, kvec_c.size()); - EXPECT_EQ(nks, wk.size()); - // value test - const std::vector ekb_ref - = {-6.03571945e-01, -5.98035141e-01, -5.98035141e-01, -6.03667277e-01, -5.97868276e-01, -5.97662421e-01, - -6.04664544e-01, -5.97025474e-01, -5.96870018e-01, -6.05615293e-01, -5.96302906e-01, -5.96302906e-01}; - const std::vector occ_ref - = {5.83090379e-03, 5.83090379e-03, 5.83090379e-03, 5.83090379e-03, 5.83090379e-03, 5.83090379e-03, - 5.83090379e-03, 5.83090379e-03, 5.83090379e-03, 5.83090379e-03, 5.83090379e-03, 5.83090379e-03}; - const std::vector> kvec_c_ref - = {ModuleBase::Vector3(-0.10540388, -0.060854959, -0.043030954), - ModuleBase::Vector3(-0.070269254, -0.081139946, -0.057374606), - ModuleBase::Vector3(-0.035134627, -0.10142493, -0.07171825), - ModuleBase::Vector3(0.00000000, -0.12170991, -0.086061909)}; - const std::vector wk_ref = {1.0, 1.0, 1.0, 1.0}; - for (int i = 0; i < nprocs; i++) - { - if (iproc == i) - { - // ekb - for (int j = 0; j < nks * nbands; j++) - { - EXPECT_NEAR(ekb_ref[j], ekb[j], 1e-7); - } - // occ - for (int j = 0; j < nks * nbands; j++) - { - EXPECT_NEAR(occ_ref[j], occ[j], 1e-7); - } - // kvec_c - for (int j = 0; j < nks; j++) - { - EXPECT_NEAR(kvec_c_ref[j].x, kvec_c[j].x, 1e-7); - EXPECT_NEAR(kvec_c_ref[j].y, kvec_c[j].y, 1e-7); - EXPECT_NEAR(kvec_c_ref[j].z, kvec_c[j].z, 1e-7); - } - // wk - for (int j = 0; j < nks; j++) - { - EXPECT_NEAR(wk_ref[j], wk[j], 1e-7); - } - } - MPI_Barrier(MPI_COMM_WORLD); - } - // lowf will be the result of scattering - // rank0: 64, rank1: 32, rank2: 62, rank3: 31, each should multiply the number of k-points - if (iproc == 0) - { - EXPECT_EQ(nks * 64, lowf.size()); - } - if (iproc == 1) - { - EXPECT_EQ(nks * 32, lowf.size()); - } - if (iproc == 2) - { - EXPECT_EQ(nks * 62, lowf.size()); - } - if (iproc == 3) - { - EXPECT_EQ(nks * 31, lowf.size()); - } - // value test on lowf - // rank0 - if (iproc == 0) - { - EXPECT_NEAR(lowf[0].real(), -6.71651157e-03, 1e-7); - EXPECT_NEAR(lowf[0].imag(), 2.25946383e-02, 1e-7); - EXPECT_NEAR(lowf[1].real(), 1.43180123e-03, 1e-7); - EXPECT_NEAR(lowf[1].imag(), 1.46451488e-03, 1e-7); - EXPECT_NEAR(lowf[2].real(), -9.45760546e-03, 1e-7); - EXPECT_NEAR(lowf[2].imag(), 1.29911511e-02, 1e-7); - EXPECT_NEAR(lowf[3].real(), -5.46035106e-03, 1e-7); - EXPECT_NEAR(lowf[3].imag(), 7.50044462e-03, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].real(), -1.39799597e-03, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].imag(), -1.68192980e-03, 1e-7); - } - else if (iproc == 1) - { - EXPECT_NEAR(lowf[0].real(), 9.86470874e-13, 1e-7); - EXPECT_NEAR(lowf[0].imag(), -5.95387122e-12, 1e-7); - EXPECT_NEAR(lowf[1].real(), 4.82573453e-13, 1e-7); - EXPECT_NEAR(lowf[1].imag(), 5.54264959e-12, 1e-7); - EXPECT_NEAR(lowf[2].real(), 5.20920946e-04, 1e-7); - EXPECT_NEAR(lowf[2].imag(), -2.33076310e-03, 1e-7); - EXPECT_NEAR(lowf[3].real(), -8.35155442e-04, 1e-7); - EXPECT_NEAR(lowf[3].imag(), 3.75083842e-03, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].real(), -6.18118243e-05, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].imag(), -7.43658388e-05, 1e-7); - } - else if (iproc == 2) - { - EXPECT_NEAR(lowf[0].real(), 2.31452033e-03, 1e-7); - EXPECT_NEAR(lowf[0].imag(), -1.18949691e-03, 1e-7); - EXPECT_NEAR(lowf[1].real(), 3.86105126e-03, 1e-7); - EXPECT_NEAR(lowf[1].imag(), -5.30361525e-03, 1e-7); - EXPECT_NEAR(lowf[2].real(), 1.07440727e-03, 1e-7); - EXPECT_NEAR(lowf[2].imag(), -1.52230629e-03, 1e-7); - EXPECT_NEAR(lowf[3].real(), -2.63174959e-03, 1e-7); - EXPECT_NEAR(lowf[3].imag(), 3.72887365e-03, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].real(), 1.19038759e-04, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].imag(), 1.17824924e-04, 1e-7); - } - else if (iproc == 3) - { - EXPECT_NEAR(lowf[0].real(), 3.66087151e-13, 1e-7); - EXPECT_NEAR(lowf[0].imag(), 1.96386245e-13, 1e-7); - EXPECT_NEAR(lowf[1].real(), 9.49023673e-05, 1e-7); - EXPECT_NEAR(lowf[1].imag(), -4.04693771e-04, 1e-7); - EXPECT_NEAR(lowf[2].real(), 1.33229060e-04, 1e-7); - EXPECT_NEAR(lowf[2].imag(), 9.69176971e-04, 1e-7); - EXPECT_NEAR(lowf[3].real(), 8.23664081e-04, 1e-7); - EXPECT_NEAR(lowf[3].imag(), 5.56014508e-03, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].real(), -2.69229582e-03, 1e-7); - EXPECT_NEAR(lowf[lowf.size() - 1].imag(), -2.66484241e-03, 1e-7); - } -#else - printf("Run unittest ReadWfcLcaoTest::RestartFromFileParallel without MPI env:\n"); - printf("This test is not executed because MPI is not enabled.\n"); - GTEST_SKIP(); -#endif -} - -TEST(ReadWfcLcaoTest, RestartFromFileSerial) -{ -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); - // printf("MPI environment detected, will use only rank 0\n"); - int iproc = 0; - int nprocs = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &iproc); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - if (iproc != 0) - { - GTEST_SKIP(); - } -#endif - const int nks = 4; - int nbands = -1; - int nbasis = -1; - std::vector> lowf; - std::vector ekb; - std::vector occ; - std::vector> kvec_c; - std::vector wk; - const std::string out_dir = "./support"; - ModuleIO::restart_from_file(out_dir, nks, nbands, nbasis, lowf, ekb, occ, kvec_c, wk); - EXPECT_EQ(3, nbands); - EXPECT_EQ(63, nbasis); - EXPECT_EQ(nks * nbands * nbasis, lowf.size()); - EXPECT_EQ(nks * nbands, ekb.size()); - EXPECT_EQ(nks * nbands, occ.size()); - EXPECT_EQ(nks, kvec_c.size()); - EXPECT_EQ(nks, wk.size()); - - // test the first k-point - int nbands_k0 = -1; - int nbasis_k0 = -1; - int ik_k0; - std::vector> lowf_k0; - std::vector ekb_k0; - std::vector occ_k0; - ModuleBase::Vector3 kvec_c_k0; - double wk_k0 = -1.0; - ModuleIO::read_wfc_lcao("./support/wfs1k1_nao.txt", ik_k0, kvec_c_k0, nbands_k0, nbasis_k0, lowf_k0, ekb_k0, - occ_k0, wk_k0); - - EXPECT_EQ(1, ik_k0); - EXPECT_EQ(3, nbands_k0); - EXPECT_EQ(63, nbasis_k0); - EXPECT_EQ(1.0, wk_k0); // this is overwritten with 1.0 - // kvec_c - EXPECT_NEAR(kvec_c_k0.x, kvec_c[0].x, 1e-7); - EXPECT_NEAR(kvec_c_k0.y, kvec_c[0].y, 1e-7); - EXPECT_NEAR(kvec_c_k0.z, kvec_c[0].z, 1e-7); - // ekb - for (int i = 0; i < nbands_k0; i++) - { - EXPECT_NEAR(ekb_k0[i], ekb[i], 1e-7); - } - // occ - for (int i = 0; i < nbands_k0; i++) - { - EXPECT_NEAR(occ_k0[i], occ[i], 1e-7); - } - // lowf - for (int i = 0; i < nbands_k0 * nbasis_k0; i++) - { - EXPECT_NEAR(lowf_k0[i].real(), lowf[i].real(), 1e-7); - EXPECT_NEAR(lowf_k0[i].imag(), lowf[i].imag(), 1e-7); - } - - // test the second k-point - int nbands_k1 = -1; - int nbasis_k1 = -1; - int ik_k1; - std::vector> lowf_k1; - std::vector ekb_k1; - std::vector occ_k1; - ModuleBase::Vector3 kvec_c_k1; - double wk_k1 = -1.0; - ModuleIO::read_wfc_lcao("./support/wfs1k2_nao.txt", ik_k1, kvec_c_k1, nbands_k1, nbasis_k1, lowf_k1, ekb_k1, - occ_k1, wk_k1); - - EXPECT_EQ(2, ik_k1); - EXPECT_EQ(3, nbands_k1); - EXPECT_EQ(63, nbasis_k1); - EXPECT_EQ(1.0, wk_k1); // this is overwritten with 1.0 - // kvec_c - EXPECT_NEAR(kvec_c_k1.x, kvec_c[1].x, 1e-7); - EXPECT_NEAR(kvec_c_k1.y, kvec_c[1].y, 1e-7); - EXPECT_NEAR(kvec_c_k1.z, kvec_c[1].z, 1e-7); - // ekb - for (int i = 0; i < nbands_k1; i++) - { - EXPECT_NEAR(ekb_k1[i], ekb[i + nbands_k0], 1e-7); - } - // occ - for (int i = 0; i < nbands_k1; i++) - { - EXPECT_NEAR(occ_k1[i], occ[i + nbands_k0], 1e-7); - } - // lowf - for (int i = 0; i < nbands_k1 * nbasis_k1; i++) - { - EXPECT_NEAR(lowf_k1[i].real(), lowf[i + nbands_k0 * nbasis_k0].real(), 1e-7); - EXPECT_NEAR(lowf_k1[i].imag(), lowf[i + nbands_k0 * nbasis_k0].imag(), 1e-7); - } -} - -int main(int argc, char** argv) -{ - ::testing::InitGoogleTest(&argc, argv); - // print cwd - char cwd[1024]; - if (getcwd(cwd, sizeof(cwd)) != nullptr) - { - printf("Current working dir: %s\n", cwd); - } - else - { - perror("getcwd() error"); - return 1; - } -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - const int status = RUN_ALL_TESTS(); - printf("Unittest read_wfc_lcao_test exits with status %d\n", status); -#ifdef __MPI - MPI_Finalize(); -#endif - return status; -} diff --git a/source/module_io/test/read_wfc_nao_test.cpp b/source/module_io/test/read_wfc_nao_test.cpp deleted file mode 100644 index 5cbe41dd6e..0000000000 --- a/source/module_io/test/read_wfc_nao_test.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "module_io/read_wfc_nao.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_io/write_wfc_nao.h" - -//define a mock derived class of class ElecState - -namespace elecstate -{ - const double* ElecState::getRho(int spin) const{return &(this->eferm.ef);}//just for mock -} - - -namespace ModuleIO -{ -// mock filename_output -std::string filename_output( - const std::string &directory, - const std::string &property, - const std::string &basis, - const int ik, - const std::vector &ik2iktot, - const int nspin, - const int nkstot, - const int out_type, - const bool out_app_flag, - const bool gamma_only, - const int istep) -{ - return "./support/wfs1_nao.txt"; -} -} - -/************************************************ - * unit test of functions in read_wfc_nao.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - distri_wfc_nao() - * - calculate memory required. - * - read_wfc_nao() - * - read wave functions from file. - */ - -class ReadWfcNaoTest : public ::testing::Test -{ -protected: -}; - - -TEST_F(ReadWfcNaoTest,ReadWfcNao) -{ - //Global variables - const int nbands = 3; - const int nlocal = 3; - PARAM.sys.global_readin_dir = "./support/"; - const int nks = 1; - const int nspin = 1; - int my_rank = 0; - - Parallel_Orbitals ParaV; -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - std::ofstream ofs_running, ofs_warning; - ParaV.init(nlocal, nlocal, 1, MPI_COMM_WORLD); - ParaV.set_nloc_wfc_Eij(nbands, ofs_running, ofs_warning); - ParaV.set_desc_wfc_Eij(nlocal, nbands, ParaV.nrow); -#else - ParaV.set_serial(nlocal, nlocal); - ParaV.nrow_bands = nlocal; - ParaV.ncol_bands = nbands; -#endif - - psi::Psi psid; - elecstate::ElecState pelec; - pelec.ekb.create(nks,nbands); - pelec.wg.create(nks,nbands); - - std::vector ik2iktot = {0}; - const int nkstot = 1; - - // Act - ModuleIO::read_wfc_nao(PARAM.sys.global_readin_dir, ParaV, psid, - &(pelec), ik2iktot, nkstot, nspin); - // Assert - EXPECT_NEAR(pelec.ekb(0,1),0.31482195194888534794941393,1e-5); - EXPECT_NEAR(pelec.wg(0,1),0.0,1e-5); - if (my_rank == 0) - { - EXPECT_NEAR(psid(0,0,0),5.3759239842e-01,1e-5); - } -} - -TEST_F(ReadWfcNaoTest, ReadWfcNaoPart) -{ - //Global variables - const int nbands = 2; - const int skip_band = 1; - const int nlocal = 3; - PARAM.sys.global_readin_dir = "./support/"; - const int nks = 1; - const int nspin = 1; - int my_rank = 0; - - Parallel_Orbitals ParaV; -#ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); - std::ofstream ofs_running, ofs_warning; - ParaV.init(nlocal, nlocal, 1, MPI_COMM_WORLD); - ParaV.set_nloc_wfc_Eij(nbands, ofs_running, ofs_warning); - ParaV.set_desc_wfc_Eij(nlocal, nbands, ParaV.nrow); -#else - ParaV.set_serial(nlocal, nlocal); - ParaV.nrow_bands = nlocal; - ParaV.ncol_bands = nbands; -#endif - - psi::Psi psid; - elecstate::ElecState pelec; - pelec.ekb.create(nks, nbands); - pelec.wg.create(nks, nbands); - - std::vector ik2iktot = {0}; - const int nkstot = 1; - - // Act - ModuleIO::read_wfc_nao(PARAM.sys.global_readin_dir, ParaV, psid, - &(pelec), ik2iktot, nkstot, nspin, skip_band); - - // Assert - EXPECT_NEAR(pelec.ekb(0, 1), 7.4141254894954844445464914e-01, 1e-5); - if (my_rank == 0) - { - EXPECT_NEAR(psid(0, 0, 0), 1.8587183851, 1e-5); - } -} - - - -#ifdef __MPI -int main(int argc, char** argv) -{ - GlobalV::MY_RANK = 0; - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); - - testing::InitGoogleTest(&argc, argv); - ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners(); - - if (GlobalV::MY_RANK != 0) { - delete listeners.Release(listeners.default_result_printer()); - } - - int result = RUN_ALL_TESTS(); - MPI_Bcast(&result, 1, MPI_INT, 0, MPI_COMM_WORLD); - - if (GlobalV::MY_RANK == 0 && result != 0) - { - std::cout << "ERROR:some tests are not passed" << std::endl; - } - - MPI_Finalize(); - return result; -} -#endif diff --git a/source/module_io/test/read_wfc_pw_test.cpp b/source/module_io/test/read_wfc_pw_test.cpp deleted file mode 100644 index e545d04692..0000000000 --- a/source/module_io/test/read_wfc_pw_test.cpp +++ /dev/null @@ -1,347 +0,0 @@ -#include "module_io/read_wfc_pw.h" - -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#ifdef __MPI -#include "source_base/parallel_global.h" -#include "source_basis/module_pw/test/test_tool.h" -#include "mpi.h" -#endif - -/** - * - Tested Functions: - * - read_wfc_pw() - */ - -class ReadWfcPwTest : public ::testing::Test -{ - protected: - ModulePW::PW_Basis_K* wfcpw = nullptr; - ModuleBase::Vector3* kvec_d = nullptr; - int nkstot = 8; - - virtual void SetUp() - { - wfcpw = new ModulePW::PW_Basis_K; - kvec_d = new ModuleBase::Vector3[nkstot]; - } - virtual void TearDown() - { - if (wfcpw != nullptr) { - delete wfcpw; -} - if (kvec_d != nullptr) { - delete[] kvec_d; -} - } -}; - -// Test the read_wfc_pw function -TEST_F(ReadWfcPwTest, ReadWfcPw) -{ - std::string filename = "./support/wfs1k1_pw.dat"; - -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - wfcpw->initgrids(5.3233, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 12, 12, 12); - wfcpw->initparameters(false, 20, 8, kvec_d); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - PARAM.input.nbands = 8; - const int nbasis = wfcpw->npwk[0]; - ModuleBase::ComplexMatrix wfcatom(PARAM.input.nbands, nbasis); - - const int ik = 0; - const int ik_tot = 0; - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom); - - if (GlobalV::NPROC_IN_POOL == 1) - { - EXPECT_DOUBLE_EQ(wfcatom(0, 0).real(), -0.017953720885562179); - EXPECT_DOUBLE_EQ(wfcatom(0, 0).imag(), 0.035959236666204548); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).real(), -0.021041484787624309); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).imag(), 0.042143574695220835); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).real(), -0.011075023130363163); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).imag(), 0.017342817352703006); - } - else if (GlobalV::NPROC_IN_POOL == 4) - { - if (GlobalV::RANK_IN_POOL == 0) - { - EXPECT_DOUBLE_EQ(wfcatom(0, 0).real(), -0.017953720885562179); - EXPECT_DOUBLE_EQ(wfcatom(0, 0).imag(), 0.035959236666204548); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).real(), -0.021041489893031052); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).imag(), 0.04214358371778136); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).real(), -0.0048838415065336213); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).imag(), 0.0078610803827715778); - } - else if (GlobalV::RANK_IN_POOL == 1) - { - EXPECT_DOUBLE_EQ(wfcatom(0, 0).real(), -0.021041442735212794); - EXPECT_DOUBLE_EQ(wfcatom(0, 0).imag(), 0.042143594413604955); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).real(), -0.021041483700533322); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).imag(), 0.042143578780482846); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).real(), -0.0052306421970293327); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).imag(), 0.008388410016516171); - } - else if (GlobalV::RANK_IN_POOL == 2) - { - EXPECT_DOUBLE_EQ(wfcatom(0, 0).real(), -0.021041446966127354); - EXPECT_DOUBLE_EQ(wfcatom(0, 0).imag(), 0.042143576374759073); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).real(), -0.021041484787624309); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).imag(), 0.042143574695220835); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).real(), -0.011075023130363163); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).imag(), 0.017342817352703006); - } - else if (GlobalV::RANK_IN_POOL == 3) - { - EXPECT_DOUBLE_EQ(wfcatom(0, 0).real(), -0.035800521528771376); - EXPECT_DOUBLE_EQ(wfcatom(0, 0).imag(), 0.071704302066073339); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).real(), -0.035800589849852141); - EXPECT_DOUBLE_EQ(wfcatom(0, wfcpw->npwk[0] - 1).imag(), 0.071704271988304383); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).real(), -0.02862895801312244); - EXPECT_DOUBLE_EQ(wfcatom(7, wfcpw->npwk[0] - 1).imag(), 0.045177780166697649); - } - } -} - -// Test the read_wfc_pw function when the file is not found or wrong type -TEST_F(ReadWfcPwTest, NotFoundFile) -{ - -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - wfcpw->initgrids(5.3233, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 12, 12, 12); - wfcpw->initparameters(false, 20, 8, kvec_d); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - ModuleBase::ComplexMatrix wfcatom(PARAM.input.nbands, wfcpw->npwk[0]); - - if(GlobalV::RANK_IN_POOL == 0) - { - const int ik=0; - const int ik_tot=0; - - // dat file - std::string filename = "notfound.dat"; - testing::internal::CaptureStdout(); - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("Can't open file notfound.dat")); - - // txt file - filename = "notfound.txt"; - testing::internal::CaptureStdout(); - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("Can't open file notfound.txt")); - - // other file - filename = "notfound"; - testing::internal::CaptureStdout(); - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output,testing::HasSubstr("Unknown file type")); - } -} - -// Test the read_wfc_pw function when nbands is inconsistent -TEST_F(ReadWfcPwTest, InconsistentBands) -{ - if (GlobalV::NPROC_IN_POOL == 1) - { - std::string filename = "./support/wfs1k1_pw.dat"; - -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - wfcpw->initgrids(5.3233, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 12, 12, 12); - wfcpw->initparameters(false, 20, 8, kvec_d); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - PARAM.input.nbands = 4; - const int nbasis = wfcpw->npwk[0]; - ModuleBase::ComplexMatrix wfcatom(PARAM.input.nbands, nbasis); - testing::internal::CaptureStdout(); - - const int ik = 0; - const int ik_tot = 0; - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("nbands_in = 8")); - EXPECT_THAT(output, testing::HasSubstr("nbands = 4")); - EXPECT_THAT( - output, - testing::HasSubstr( - "ikstot_in != ikstot || nkstot_in != nkstot || npwtot_in != npwtot || nbands_in != nbands")); - } -} - -// Test the read_wfc_pw function when kevc is inconsistent -TEST_F(ReadWfcPwTest, InconsistentKvec) -{ - if (GlobalV::NPROC_IN_POOL == 1) - { - std::string filename = "./support/wfs1k1_pw.dat"; - - kvec_d[0] = ModuleBase::Vector3(0.0, 0.0, 1.0); - -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - wfcpw->initgrids(5.3233, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 12, 12, 12); - wfcpw->initparameters(false, 20, 8, kvec_d); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - PARAM.input.nbands = 8; - const int nbasis = wfcpw->npwk[0]; - ModuleBase::ComplexMatrix wfcatom(PARAM.input.nbands, nbasis); - testing::internal::CaptureStdout(); - - const int ik=0; - const int ik_tot=0; - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("kvec_in[0] = 0 0 0")); - EXPECT_THAT(output, testing::HasSubstr("kvec[0] = -1 1 -1")); - EXPECT_THAT(output, testing::HasSubstr("k vector in file is not the same as the one in memory")); - } -} - -// Test the read_wfc_pw function when lat0 is inconsistent -TEST_F(ReadWfcPwTest, InconsistentLat0) -{ - if (GlobalV::NPROC_IN_POOL == 1) - { - std::string filename = "./support/wfs1k1_pw.dat"; - - kvec_d[0] = ModuleBase::Vector3(0.0, 0.0, 0.0); - -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - wfcpw->initgrids(5, ModuleBase::Matrix3(-0.5, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 12, 12, 12); - wfcpw->initparameters(false, 20, 8, kvec_d); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - PARAM.input.nbands = 8; - const int nbasis = wfcpw->npwk[0]; - ModuleBase::ComplexMatrix wfcatom(PARAM.input.nbands, nbasis); - testing::internal::CaptureStdout(); - - const int ik=0; - const int ik_tot=0; - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("lat0_in = 5.3233")); - EXPECT_THAT(output, testing::HasSubstr("lat0 = 5")); - EXPECT_THAT(output, testing::HasSubstr("lat0_in != pw_wfc->lat0 || tpiba_in != pw_wfc->tpiba")); - } -} - -// Test the read_wfc_pw function when G is inconsistent -TEST_F(ReadWfcPwTest, InconsistentG) -{ - if (GlobalV::NPROC_IN_POOL == 1) - { - std::string filename = "./support/wfs1k1_pw.dat"; - kvec_d[0] = ModuleBase::Vector3(0.0, 0.0, 0.0); - -#ifdef __MPI - wfcpw->initmpi(GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, POOL_WORLD); -#endif - wfcpw->initgrids(5.3233, ModuleBase::Matrix3(-0.49, 0.0, 0.5, 0.0, 0.5, 0.5, -0.5, 0.5, 0.0), 12, 12, 12); - wfcpw->initparameters(false, 20, 8, kvec_d); - wfcpw->setuptransform(); - wfcpw->collect_local_pw(); - - PARAM.input.nbands = 8; - const int nbasis = wfcpw->npwk[0]; - ModuleBase::ComplexMatrix wfcatom(PARAM.input.nbands, nbasis); - testing::internal::CaptureStdout(); - - const int ik=0; - const int ik_tot=0; - EXPECT_EXIT( - ModuleIO::read_wfc_pw(filename, wfcpw, - GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, - PARAM.inp.nbands, PARAM.globalv.npol, - ik, ik_tot, nkstot, wfcatom), - ::testing::ExitedWithCode(1), ""); - - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("G_in[0] = -1 -1 1\nG_in[1] = 1 1 1\nG_in[2] = -1 1 -1\n")); - EXPECT_THAT( - output, - testing::HasSubstr( - "G[0] = -1.0101 -1.0101 1.0101\nG[1] = 1.0101 1.0101 0.989899\nG[2] = -1.0101 0.989899 -0.989899\n")); - EXPECT_THAT(output, testing::HasSubstr("G_in != G")); - } -} - -int main(int argc, char** argv) -{ -#ifdef __MPI - setupmpi(argc, argv, GlobalV::NPROC, GlobalV::MY_RANK); - divide_pools(GlobalV::NPROC, - GlobalV::MY_RANK, - GlobalV::NPROC_IN_POOL, - GlobalV::KPAR, - GlobalV::MY_POOL, - GlobalV::RANK_IN_POOL); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - finishmpi(); -#endif - return result; -} diff --git a/source/module_io/test/single_R_io_test.cpp b/source/module_io/test/single_R_io_test.cpp deleted file mode 100644 index 0e08f9a783..0000000000 --- a/source/module_io/test/single_R_io_test.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "module_io/single_R_io.h" -#include "source_base/global_variable.h" -#include "source_basis/module_ao/parallel_orbitals.h" -/************************************************ - * unit test of output_single_R - ***********************************************/ -/** - * - Tested Functions: - * - ModuleIO::output_single_R - * - output single R data - */ -Parallel_Orbitals::Parallel_Orbitals() -{ -} - -Parallel_Orbitals::~Parallel_Orbitals() -{ -} - -void Parallel_2D::set_serial(const int M_A, const int N_A) -{ - this->global2local_row_.resize(M_A); - this->global2local_row_[0] = 0; - this->global2local_row_[1] = 1; - this->global2local_row_[2] = -1; - this->global2local_row_[3] = 2; - this->global2local_row_[4] = -1; //Some rows have global2local_row_ < 0 -} - -TEST(ModuleIOTest, OutputSingleR) -{ - // Create temporary output file - std::stringstream ofs_filename; - GlobalV::DRANK=0; - ofs_filename << "test_output_single_R_" << GlobalV::DRANK << ".dat"; - std::ofstream ofs(ofs_filename.str()); - - // Define input parameters - const double sparse_threshold = 1e-8; - const bool binary = false; - Parallel_Orbitals pv; - PARAM.sys.nlocal = 5; - pv.set_serial(PARAM.sys.nlocal, PARAM.sys.nlocal); - std::map> XR = { - {0, {{1, 0.5}, {3, 0.3}}}, - {1, {{0, 0.2}, {2, 0.4}}}, - {3, {{1, 0.1}, {4, 0.7}}} - }; - - // Call function under test - ModuleIO::output_single_R(ofs, XR, sparse_threshold, binary, pv); - - // Close output file and open it for reading - ofs.close(); - std::ifstream ifs; - ifs.open("test_output_single_R_0.dat"); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("5.00000000e-01 3.00000000e-01 2.00000000e-01 4.00000000e-01 1.00000000e-01 7.00000000e-01")); - EXPECT_THAT(str, testing::HasSubstr("1 3 0 2 1 4")); - EXPECT_THAT(str, testing::HasSubstr("0 2 4 4 6 6")); - std::remove("test_output_single_R_0.dat"); -} - -int main(int argc, char **argv) -{ - -#ifdef __MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD,&GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD,&GlobalV::MY_RANK); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} diff --git a/source/module_io/test/sparse_matrix_test.cpp b/source/module_io/test/sparse_matrix_test.cpp deleted file mode 100644 index 4048e115fb..0000000000 --- a/source/module_io/test/sparse_matrix_test.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include "module_io/sparse_matrix.h" - -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -template -T get_value(const T& val) -{ - return val; -} - -template -T get_value(const std::complex& val) -{ - return val.real(); -} - -/************************************************ - * unit test of sparse_matrix.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - insert() - * - Add value to the matrix with row and column indices - * - printToCSR() - * - Print data in CSR format - * - readCSR() - * - Read CSR data from arrays - */ - -template -class SparseMatrixTest : public ::testing::Test -{ - protected: - ModuleIO::SparseMatrix sm = ModuleIO::SparseMatrix(4, 4); -}; - -using MyTypes = ::testing::Types>; -TYPED_TEST_SUITE(SparseMatrixTest, MyTypes); - -TYPED_TEST(SparseMatrixTest, Insert) -{ - // Add a value to the matrix with row and column indices - this->sm.insert(2, 2, static_cast(3.0)); - this->sm.insert(3, 3, static_cast(4.0)); - - EXPECT_EQ(this->sm.getNNZ(), 2); - EXPECT_EQ(this->sm.getCols(), 4); - EXPECT_EQ(this->sm.getRows(), 4); - - // Check if the value was added correctly - EXPECT_DOUBLE_EQ(get_value(this->sm(2, 2)), 3.0); - EXPECT_DOUBLE_EQ(get_value(this->sm(3, 3)), 4.0); -} - -TYPED_TEST(SparseMatrixTest, InsertWarning) -{ - // case 1 - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sm.insert(2, -1, static_cast(3.0)), ::testing::ExitedWithCode(1), ""); - std::string output = testing::internal::GetCapturedStdout(); - // test output on screen - EXPECT_THAT(output, testing::HasSubstr("row or col index out of range")); - // case 2 - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sm.insert(-1, 0, static_cast(3.0)), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - // test output on screen - EXPECT_THAT(output, testing::HasSubstr("row or col index out of range")); - // case 3 - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sm.insert(2, 4, static_cast(3.0)), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - // test output on screen - EXPECT_THAT(output, testing::HasSubstr("row or col index out of range")); - // case 4 - testing::internal::CaptureStdout(); - EXPECT_EXIT(this->sm.insert(4, 2, static_cast(3.0)), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - // test output on screen - EXPECT_THAT(output, testing::HasSubstr("row or col index out of range")); -} - -TYPED_TEST(SparseMatrixTest, CSR) -{ - // test the printCSR function for the following matrix - // 1.0 2.0 0.5 0.4 0.0 0.0 - // 0.0 3.0 0.0 4.0 0.0 0.0 - // 0.0 0.0 5.0 6.0 7.0 0.0 - // 0.0 0.0 0.0 0.0 0.0 8.0 - // the expect output is - // csr_values = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] - // csr_col_ind = [0, 1, 1, 3, 2, 3, 4, 5] - // csr_row_ptr = [0, 2, 4, 7, 8] - // set the sparse threshold to 0.6 and the precision to 2 - ModuleIO::SparseMatrix sm0; - ModuleIO::SparseMatrix sm1; - sm0.setRows(4); - sm0.setCols(6); - sm0.setSparseThreshold(0.6); - sm0.insert(0, 0, static_cast(1.0)); - sm0.insert(0, 1, static_cast(2.0)); - sm0.insert(0, 2, static_cast(0.5)); - sm0.insert(0, 3, static_cast(0.4)); - sm0.insert(1, 1, static_cast(3.0)); - sm0.insert(1, 3, static_cast(4.0)); - sm0.insert(2, 2, static_cast(5.0)); - sm0.insert(2, 3, static_cast(6.0)); - sm0.insert(2, 4, static_cast(7.0)); - sm0.insert(3, 5, static_cast(8.0)); - EXPECT_DOUBLE_EQ(sm0.getSparseThreshold(), 0.6); - testing::internal::CaptureStdout(); - // 2 is the precision - sm0.printToCSR(std::cout, 2); - std::string output = testing::internal::GetCapturedStdout(); - if (std::is_same::value) - { - EXPECT_THAT(output, - testing::HasSubstr("1.00e+00 2.00e+00 3.00e+00 4.00e+00 5.00e+00 6.00e+00 7.00e+00 8.00e+00")); - EXPECT_THAT(output, testing::HasSubstr("0 1 1 3 2 3 4 5")); - EXPECT_THAT(output, testing::HasSubstr("0 2 4 7 8")); - - std::vector expected_csr_values = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}; - std::vector expected_csr_col_ind = {0, 1, 1, 3, 2, 3, 4, 5}; - std::vector expected_csr_row_ptr = {0, 2, 4, 7, 8}; - - sm1.setRows(4); - sm1.setCols(6); - sm1.readCSR(expected_csr_values, expected_csr_col_ind, expected_csr_row_ptr); - - EXPECT_EQ(sm0.getNNZ(), 8); - EXPECT_EQ(sm1.getNNZ(), 8); - - for (const auto& element: sm0.getElements()) - { - auto it = sm1.getElements().find(element.first); - EXPECT_DOUBLE_EQ(get_value(it->second), get_value(element.second)); - } - } - else if (std::is_same>::value) - { - EXPECT_THAT( - output, - testing::HasSubstr("(1.00e+00,0.00e+00) (2.00e+00,0.00e+00) (3.00e+00,0.00e+00) (4.00e+00,0.00e+00) " - "(5.00e+00,0.00e+00) (6.00e+00,0.00e+00) (7.00e+00,0.00e+00) (8.00e+00,0.00e+00)")); - EXPECT_THAT(output, testing::HasSubstr("0 1 1 3 2 3 4 5")); - EXPECT_THAT(output, testing::HasSubstr("0 2 4 7 8")); - - std::vector expected_csr_values = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}; - std::vector expected_csr_col_ind = {0, 1, 1, 3, 2, 3, 4, 5}; - std::vector expected_csr_row_ptr = {0, 2, 4, 7, 8}; - - sm1.setRows(4); - sm1.setCols(6); - sm1.readCSR(expected_csr_values, expected_csr_col_ind, expected_csr_row_ptr); - - for (const auto& element: sm0.getElements()) - { - auto it = sm1.getElements().find(element.first); - EXPECT_DOUBLE_EQ(get_value(it->second), get_value(element.second)); - } - // index matrix elements - EXPECT_DOUBLE_EQ(get_value(sm1(0, 1)), 2.0); - EXPECT_DOUBLE_EQ(get_value(sm1(1, 1)), 3.0); - EXPECT_DOUBLE_EQ(get_value(sm1(1, 2)), 0.0); - } -} diff --git a/source/module_io/test/support/BesselBasis_UnitTest_C4_AtomType0.html b/source/module_io/test/support/BesselBasis_UnitTest_C4_AtomType0.html deleted file mode 100644 index 2d9c173e34..0000000000 --- a/source/module_io/test/support/BesselBasis_UnitTest_C4_AtomType0.html +++ /dev/null @@ -1,28 +0,0 @@ - -Bessel Basis Unit Test. Present file will be read as C4 coefficients stored file of atom type 0. -INPUTS tag: -In INPUTS tag what enclosed are EnergyCutoff, CutoffRadius, Nq, Tolerance, respectively. -They should be totally identical with function Bessel_Basis::init_Faln(), or assert() will fail. -C4 tag: -The first line of this tag will be the total chi. The chi acts similarly with contracted Gaussian type -orbitals, which means for one chi, there will be Nq spherical Bessel functions, and for each angular -momentum l, there will be numbers of chi-s to form it. C4 file contains all information of chi-s, -i.e., all over l(s). For example the H, whose numerical orbitals file is named as H_gga_6au_100Ry_2s1p.orb, -which means there are 3 kinds of orbitals, 1s, 2s and 2p. The cutoff radius is 6 au, and the energy cutoff -is 100 Ry. For orbital "1s", there will be a chi_1s, then for "2s" the chi_2s, for "2p" the chi_2p, the -first line is thus the number chi_1s + chi_2s + chi_2p. -The following line has contents in sequence of: -title1 title2 title3 AtomType AngularMomentum ChiIndex C4Vaule1 C4Value2 ... C4ValueNq -Final description: -In unit test case, only one chi, one l is used, and EnergyCutoff, CutoffRadius are selected to have Nq=1. - - -4 -2 -1 -0.01 - - -1 -TEST TEST TEST 0 0 0 1.0 - diff --git a/source/module_io/test/support/DMK_nspin1 b/source/module_io/test/support/DMK_nspin1 deleted file mode 100644 index 89f76acdec..0000000000 --- a/source/module_io/test/support/DMK_nspin1 +++ /dev/null @@ -1,147 +0,0 @@ -# k-point 0 -# nrow 13 -# ncol 13 -0 1.99952 -1 -0.0308876 -2 -7.47827e-16 -3 1.62435e-15 -4 1.30847e-15 -5 3.62842e-16 -6 -4.97675e-16 -7 -4.11108e-16 -8 5.23442e-15 -9 4.434e-15 -10 -1.72995e-15 -11 -4.1392e-15 -12 4.41256e-15 -13 -0.0308876 -14 0.000477136 -15 1.5419e-17 -16 -3.55677e-17 -17 1.48097e-17 -18 -5.46563e-18 -19 7.31027e-18 -20 7.61284e-18 -21 -8.08586e-17 -22 -6.84942e-17 -23 2.67233e-17 -24 6.39402e-17 -25 -6.81629e-17 -26 -7.47827e-16 -27 1.5419e-17 -28 0.665802 -29 -2.3148e-13 -30 1.02924e-13 -31 0.0239965 -32 -7.82712e-15 -33 3.46183e-15 -34 1.28543e-16 -35 -9.84326e-17 -36 7.68715e-17 -37 2.10698e-17 -38 -1.72701e-16 -39 1.62435e-15 -40 -3.55677e-17 -41 -2.31469e-13 -42 0.665802 -43 -2.37914e-13 -44 -7.62126e-15 -45 0.0239965 -46 -8.13438e-15 -47 2.25429e-16 -48 2.3262e-16 -49 -1.36657e-16 -50 -1.82491e-16 -51 -1.69461e-16 -52 1.30847e-15 -53 1.48097e-17 -54 1.02919e-13 -55 -2.37844e-13 -56 0.665802 -57 3.3626e-15 -58 -8.0771e-15 -59 0.0239965 -60 3.3462e-16 -61 -7.09676e-17 -62 1.19927e-16 -63 3.21956e-16 -64 7.51079e-17 -65 3.62842e-16 -66 -5.46563e-18 -67 0.0239965 -68 -7.62139e-15 -69 3.36311e-15 -70 0.000864867 -71 -2.56136e-16 -72 1.12295e-16 -73 4.63287e-18 -74 -3.54765e-18 -75 2.77056e-18 -76 7.59386e-19 -77 -6.22439e-18 -78 -4.97675e-16 -79 7.31027e-18 -80 -7.82814e-15 -81 0.0239965 -82 -8.07769e-15 -83 -2.5615e-16 -84 0.000864867 -85 -2.75318e-16 -86 8.12478e-18 -87 8.38396e-18 -88 -4.92531e-18 -89 -6.57725e-18 -90 -6.10762e-18 -91 -4.11108e-16 -92 7.61284e-18 -93 3.46231e-15 -94 -8.13367e-15 -95 0.0239965 -96 1.12301e-16 -97 -2.75328e-16 -98 0.000864867 -99 1.20602e-17 -100 -2.55777e-18 -101 4.32235e-18 -102 1.16037e-17 -103 2.707e-18 -104 5.23442e-15 -105 -8.08586e-17 -106 1.28543e-16 -107 2.25429e-16 -108 3.3462e-16 -109 4.63287e-18 -110 8.12478e-18 -111 1.20602e-17 -117 4.434e-15 -118 -6.84942e-17 -119 -9.84326e-17 -120 2.3262e-16 -121 -7.09676e-17 -122 -3.54765e-18 -123 8.38396e-18 -124 -2.55777e-18 -130 -1.72995e-15 -131 2.67233e-17 -132 7.68715e-17 -133 -1.36657e-16 -134 1.19927e-16 -135 2.77056e-18 -136 -4.92531e-18 -137 4.32235e-18 -143 -4.1392e-15 -144 6.39402e-17 -145 2.10698e-17 -146 -1.82491e-16 -147 3.21956e-16 -148 7.59386e-19 -149 -6.57725e-18 -150 1.16037e-17 -156 4.41256e-15 -157 -6.81629e-17 -158 -1.72701e-16 -159 -1.69461e-16 -160 7.51079e-17 -161 -6.22439e-18 -162 -6.10762e-18 -163 2.707e-18 diff --git a/source/module_io/test/support/DMK_nspin2 b/source/module_io/test/support/DMK_nspin2 deleted file mode 100644 index 62fb380b56..0000000000 --- a/source/module_io/test/support/DMK_nspin2 +++ /dev/null @@ -1,198 +0,0 @@ -# k-point 0 -# nrow 13 -# ncol 13 -0 0.999849 -1 -0.012293 -2 -2.91266e-17 -3 -6.64294e-16 -4 -5.31028e-18 -5 1.54037e-16 -6 -1.78573e-17 -7 -2.43189e-16 -8 3.76458e-15 -9 7.74097e-16 -10 6.64504e-17 -11 -4.58657e-15 -12 1.88616e-15 -13 -0.012293 -14 0.000151142 -15 -3.42221e-17 -16 1.93353e-17 -17 2.87282e-17 -18 -2.82029e-18 -19 5.18742e-19 -20 3.75787e-18 -21 -4.62852e-17 -22 -9.51746e-18 -23 -8.17002e-19 -24 5.63914e-17 -25 -2.31902e-17 -26 -2.91266e-17 -27 -3.42221e-17 -28 0.666189 -29 -3.26811e-14 -30 9.38735e-15 -31 0.0178473 -32 -7.119e-16 -33 2.32284e-16 -34 -1.36271e-16 -35 6.55343e-16 -36 2.04442e-16 -37 2.41246e-16 -38 -1.67447e-16 -39 -6.64294e-16 -40 1.93353e-17 -41 -3.26813e-14 -42 0.666189 -43 -9.55559e-14 -44 -6.31612e-16 -45 0.0178473 -46 -2.06114e-15 -47 2.15537e-16 -48 1.13686e-16 -49 -1.36651e-16 -50 -9.33761e-17 -51 9.18169e-17 -52 -5.31028e-18 -53 2.87282e-17 -54 9.38877e-15 -55 -9.55569e-14 -56 0.666189 -57 3.2772e-16 -58 -2.16706e-15 -59 0.0178473 -60 2.23629e-16 -61 -6.62591e-17 -62 1.38723e-16 -63 1.55007e-16 -64 4.45112e-16 -65 1.54037e-16 -66 -2.82029e-18 -67 0.0178473 -68 -6.31484e-16 -69 3.27692e-16 -70 0.000478133 -71 -1.25331e-17 -72 8.26211e-18 -73 -3.65072e-18 -74 1.75568e-17 -75 5.47705e-18 -76 6.46302e-18 -77 -4.48593e-18 -78 -1.78573e-17 -79 5.18742e-19 -80 -7.1177e-16 -81 0.0178473 -82 -2.16691e-15 -83 -1.25261e-17 -84 0.000478133 -85 -4.46822e-17 -86 5.77428e-18 -87 3.04568e-18 -88 -3.66091e-18 -89 -2.50156e-18 -90 2.45979e-18 -91 -2.43189e-16 -92 3.75787e-18 -93 2.32334e-16 -94 -2.06157e-15 -95 0.0178473 -96 8.26299e-18 -97 -4.46972e-17 -98 0.000478133 -99 5.99107e-18 -100 -1.77509e-18 -101 3.71641e-18 -102 4.15266e-18 -103 1.19246e-17 -104 3.76458e-15 -105 -4.62852e-17 -106 -1.36271e-16 -107 2.15537e-16 -108 2.23629e-16 -109 -3.65072e-18 -110 5.77428e-18 -111 5.99107e-18 -117 7.74097e-16 -118 -9.51746e-18 -119 6.55343e-16 -120 1.13686e-16 -121 -6.62591e-17 -122 1.75568e-17 -123 3.04568e-18 -124 -1.77509e-18 -130 6.64504e-17 -131 -8.17002e-19 -132 2.04442e-16 -133 -1.36651e-16 -134 1.38723e-16 -135 5.47705e-18 -136 -3.66091e-18 -137 3.71641e-18 -143 -4.58657e-15 -144 5.63914e-17 -145 2.41246e-16 -146 -9.33761e-17 -147 1.55007e-16 -148 6.46302e-18 -149 -2.50156e-18 -150 4.15266e-18 -156 1.88616e-15 -157 -2.31902e-17 -158 -1.67447e-16 -159 9.18169e-17 -160 4.45112e-16 -161 -4.48593e-18 -162 2.45979e-18 -163 1.19246e-17 -# k-point 1 -# nrow 13 -# ncol 13 -0 0.999633 -1 -0.0191481 -2 -2.9249e-17 -3 1.08275e-15 -4 3.46061e-16 -5 3.59991e-16 -6 -1.30906e-16 -7 -3.08677e-16 -8 -1.2221e-14 -9 -2.73239e-15 -10 -6.45836e-16 -11 1.14878e-14 -12 -5.38182e-15 -13 -0.0191481 -14 0.000366786 -15 5.6027e-19 -16 -2.07403e-17 -17 -6.62885e-18 -18 -6.89568e-18 -19 2.50752e-18 -20 5.91277e-18 -21 2.34095e-16 -22 5.23393e-17 -23 1.23711e-17 -24 -2.20052e-16 -25 1.0309e-16 -26 -2.9249e-17 -27 5.6027e-19 -39 1.08275e-15 -40 -2.07403e-17 -52 3.46061e-16 -53 -6.62885e-18 -65 3.59991e-16 -66 -6.89568e-18 -78 -1.30906e-16 -79 2.50752e-18 -91 -3.08677e-16 -92 5.91277e-18 -104 -1.2221e-14 -105 2.34095e-16 -117 -2.73239e-15 -118 5.23393e-17 -130 -6.45836e-16 -131 1.23711e-17 -143 1.14878e-14 -144 -2.20052e-16 -156 -5.38182e-15 -157 1.0309e-16 diff --git a/source/module_io/test/support/INPUT b/source/module_io/test/support/INPUT deleted file mode 100644 index f4814d34c2..0000000000 --- a/source/module_io/test/support/INPUT +++ /dev/null @@ -1,389 +0,0 @@ -INPUT_PARAMETERS -#Parameters (1.General) -suffix autotest #the name of main output directory -latname none #the name of lattice name -stru_file ./support/STRU #the filename of file containing atom positions -kpoint_file KPT #the name of file containing k points -pseudo_dir ../../PP_ORB/ #the directory containing pseudo files -orbital_dir ../../PP_ORB/ #the directory containing orbital files -pseudo_rcut 15 #cut-off radius for radial integration -pseudo_mesh 0 #0: use our own mesh to do radial renormalization; 1: use mesh as in QE -lmaxmax 2 #maximum of l channels used -dft_functional hse #exchange correlation functional -xc_temperature 0 #temperature for finite temperature functionals -calculation scf #test; scf; relax; nscf; get_wf; get_pchg -esolver_type ksdft #the energy solver: ksdft, sdft, ofdft, tddft, lj, dp -ntype 1 #atom species number -nspin 1 #1: single spin; 2: up and down spin; 4: noncollinear spin -kspacing 0 #unit in 1/bohr, should be > 0, default is 0 which means read KPT file -min_dist_coef 0.2 #factor related to the allowed minimum distance between two atoms -nbands 8 #number of bands -out_pchg # specify the bands to be calculated in get_pchg calculation -if_separate_k false #specify whether to write the partial charge densities for all k-points to individual files or merge them -symmetry 1 #the control of symmetry -init_vel False #read velocity from STRU or not -symmetry_prec 1e-06 #accuracy for symmetry -nelec 0 #input number of electrons -out_mul 0 # mulliken charge or not -noncolin 0 #using non-collinear-spin -lspinorb 0 #consider the spin-orbit interaction -kpar 1 #devide all processors into kpar groups and k points will be distributed among each group -bndpar 1 #devide all processors into bndpar groups and bands will be distributed among each group -out_freq_elec 0 #the frequency ( >= 0) of electronic iter to output charge density and wavefunction. 0: output only when converged -dft_plus_dmft 0 #true:DFT+DMFT; false: standard DFT calcullation(default) -rpa 0 #true:generate output files used in rpa calculation; false:(default) -mem_saver 0 #Only for nscf calculations. if set to 1, then a memory saving technique will be used for many k point calculations. -diago_proc 4 #the number of procs used to do diagonalization -nbspline -1 #the order of B-spline basis -wannier_card none #input card for wannier functions -soc_lambda 1 #The fraction of averaged SOC pseudopotential is given by (1-soc_lambda) -cal_force 0 #if calculate the force at the end of the electronic iteration -out_freq_ion 0 #the frequency ( >= 0 ) of ionic step to output charge density and wavefunction. 0: output only when ion steps are finished -device cpu #the computing device for ABACUS - -#Parameters (2.PW) -ecutwfc 20 ##energy cutoff for wave functions -erf_ecut 20 #the value of the constant energy cutoff -erf_height 20 #the height of the energy step for reciprocal vectors -erf_sigma 4 #the width of the energy step for reciprocal vectors -fft_mode 0 #mode of FFTW -pw_diag_thr 0.01 #threshold for eigenvalues is cg electron iterations -diago_smooth_ethr false #smooth ethr for iter methods -scf_thr 1e-08 #charge density error -scf_ene_thr 1e-06 #total energy error threshold -scf_os_stop 1 #whether to stop scf when oscillation is detected -scf_os_thr -0.02 #charge density threshold for oscillation -scf_os_ndim 10 #number of old iterations used for oscillation detection -scf_thr_type 2 #type of the criterion of scf_thr, 1: reci drho for pw, 2: real drho for lcao -init_wfc atomic #start wave functions are from 'atomic', 'atomic+random', 'random' or 'file' -init_chg atomic #start charge is from 'atomic' or file -chg_extrap atomic #atomic; first-order; second-order; dm:coefficients of SIA -out_chg 0 #>0 output charge density for selected electron steps -out_pot 2 #output realspace potential -out_wfc_pw 0 #output wave functions -out_dos 0 #output energy and dos -out_ldos 1 #output local density of states, second parameter controls the precision -out_band 0 #output energy and band structure -out_proj_band FaLse #output projected band structure -restart_save f #print to disk every step for restart -restart_load F #restart from disk -read_file_dir auto #directory of files for reading -nx 0 #number of points along x axis for FFT grid -ny 0 #number of points along y axis for FFT grid -nz 0 #number of points along z axis for FFT grid -cell_factor 1.2 #used in the construction of the pseudopotential tables -pw_seed 1 #random seed for initializing wave functions - -#Parameters (3.Stochastic DFT) -method_sto 2 #1: slow and save memory, 2: fast and waste memory -npart_sto 1 #Reduce memory when calculating Stochastic DOS -nbands_sto 256 #number of stochstic orbitals -nche_sto 100 #Chebyshev expansion orders -emin_sto 0 #trial energy to guess the lower bound of eigen energies of the Hamitonian operator -emax_sto 0 #trial energy to guess the upper bound of eigen energies of the Hamitonian operator -seed_sto 0 #the random seed to generate stochastic orbitals -initsto_ecut 0 #maximum ecut to init stochastic bands -initsto_freq 0 #frequency to generate new stochastic orbitals when running md -cal_cond 0 #calculate electronic conductivities -cond_che_thr 1e-08 #control the error of Chebyshev expansions for conductivities -cond_dw 0.1 #frequency interval for conductivities -cond_wcut 10 #cutoff frequency (omega) for conductivities -cond_dt 0.07 #control the t interval -cond_dtbatch 2 #control dt batch -cond_fwhm 0.3 #FWHM for conductivities -cond_nonlocal 1 #Nonlocal effects for conductivities - -#Parameters (4.Relaxation) -ks_solver genelpa #cg; dav; lapack; genelpa; scalapack_gvx; cusolver -scf_nmax 50 ##number of electron iterations -relax_nmax 1 #number of ion iteration steps -out_stru 0 #output the structure files after each ion step -force_thr 0.001 #force threshold, unit: Ry/Bohr -force_thr_ev 0.0257112 #force threshold, unit: eV/Angstrom -force_zero_out 0 #force invalid threshold, unit: eV/Angstrom -relax_cg_thr 0.5 #threshold for switching from cg to bfgs, unit: eV/Angstrom -stress_thr 0.01 #stress threshold -press1 0 #target pressure, unit: KBar -press2 0 #target pressure, unit: KBar -press3 0 #target pressure, unit: KBar -relax_bfgs_w1 0.01 #wolfe condition 1 for bfgs -relax_bfgs_w2 0.5 #wolfe condition 2 for bfgs -relax_bfgs_rmax 0.8 #maximal trust radius, unit: Bohr -relax_bfgs_rmin 1e-05 #minimal trust radius, unit: Bohr -relax_bfgs_init 0.5 #initial trust radius, unit: Bohr -cal_stress 0 #calculate the stress or not -fixed_axes None #which axes are fixed -fixed_ibrav 0 #whether to preseve lattice type during relaxation -fixed_atoms 0 #whether to preseve direct coordinates of atoms during relaxation -relax_method cg #bfgs; sd; cg; cg_bfgs; -relax_new TRUE #whether to use the new relaxation method -relax_scale_force 0.5 #controls the size of the first CG step if relax_new is true -out_level ie #ie(for electrons); i(for ions); -out_dmk 0 #>0 output density matrix DM(k) -deepks_out_labels 0 #>0 compute descriptor for deepks -deepks_scf 0 #>0 add V_delta to Hamiltonian -deepks_bandgap 0 #>0 for bandgap label -deepks_out_unittest 0 #if set 1, prints intermediate quantities that shall be used for making unit test -deepks_model None #file dir of traced pytorch model: 'model.ptg - -#Parameters (5.LCAO) -basis_type lcao #PW; LCAO in pw; LCAO -nb2d 0 #2d distribution of atoms -gamma_only T #Only for localized orbitals set and gamma point. If set to 1, a fast algorithm is used -search_radius -1 #input search radius (Bohr) -lcao_ecut 20 #energy cutoff for LCAO -lcao_dk 0.01 #delta k for 1D integration in LCAO -lcao_dr 0.01 #delta r for 1D integration in LCAO -lcao_rmax 30 #max R for 1D two-center integration table -out_mat_hs 0 #output H and S matrix -out_mat_hs2 0 #output H(R) and S(R) matrix -out_interval 1 #interval for printing H(R) and S(R) matrix during MD -out_app_flag 0 #whether output r(R), H(R), S(R), T(R), and dH(R) matrices in an append manner during MD -out_element_info 0 #output (projected) wavefunction of each element -out_mat_r 0 #output r(R) matrix -out_wfc_lcao 0 #ouput LCAO wave functions -bx 2 #division of an element grid in FFT grid along x -by 2 #division of an element grid in FFT grid along y -bz 2 #division of an element grid in FFT grid along z - -bessel_nao_smooth 1 -bessel_nao_sigma 0.1 -bessel_nao_ecut default -bessel_nao_rcut 6.0 #-1.0 for forcing manual setting -bessel_nao_tolerence 1E-12 - -bessel_descriptor_lmax 2 # -1 for forcing manual setting -bessel_descriptor_smooth 1 -bessel_descriptor_sigma 0.1 -bessel_descriptor_ecut default -bessel_descriptor_rcut 6.0 #-1.0 for forcing manual setting -bessel_descriptor_tolerence 1E-12 - -#Parameters (6.Smearing) -smearing_method gauss #type of smearing_method: gauss; fd; fixed; mp; mp2; mv -smearing_sigma 0.002 #energy range for smearing - -#Parameters (7.Charge Mixing) -mixing_type broyden #plain; pulay; broyden -mixing_beta 0.7 #mixing parameter: 0 means no new charge -mixing_ndim 8 #mixing dimension in pulay or broyden -mixing_gg0 0 #mixing parameter in kerker - -#Parameters (8.DOS) -dos_emin_ev -15 #minimal range for dos -dos_emax_ev 15 #maximal range for dos -dos_edelta_ev 0.01 #delta energy for dos -dos_scale 0.01 #scale dos range by -dos_sigma 0.07 #gauss b coefficeinet(default=0.07) -dos_nche 100 #orders of Chebyshev expansions for dos -stm_bias 2.0 0.1 5 #bias voltage used to calculate ldos -ldos_line 0.1 0.2 0.3 0.4 0.5 0.6 200 #start and end point of the line (direct coordinates) and number of points - -#Parameters (9.Molecular dynamics) -md_type nvt #choose ensemble -md_thermostat nhc #choose thermostat -md_nstep 10 #md steps -md_dt 1 #time step -md_tchain 1 #number of Nose-Hoover chains -md_tfirst -1 #temperature first -md_tlast -1 #temperature last -md_dumpfreq 1 #The period to dump MD information -md_restartfreq 5 #The period to output MD restart information -md_seed -1 #random seed for MD -md_prec_level 2 #precision level for vc-md -ref_cell_factor 1.2 #construct a reference cell bigger than the initial cell -md_restart 0 #whether restart -lj_rule 2 #combination rules used to construct the parameter matrix for LJ potential -lj_eshift 0 #whether to use energy shift for LJ potential -lj_rcut 8.5 #cutoff radius of LJ potential -lj_epsilon 0.01032 #the value of epsilon for LJ potential -lj_sigma 3.405 #the value of sigma for LJ potential -pot_file graph.pb #the filename of potential files for CMD such as DP -dp_rescaling 1.0 #rescaling factor for dp potential -dp_fparam 1.0 1.1 #the frame parameter for dp potential -dp_aparam 1.0 1.2 #the atomic parameter for dp potential -msst_direction 2 #the direction of shock wave -msst_vel 0 #the velocity of shock wave -msst_vis 0 #artificial viscosity -msst_tscale 0.01 #reduction in initial temperature -msst_qmass 1 #mass of thermostat -md_tfreq 0 #oscillation frequency, used to determine qmass of NHC -md_damp 1 #damping parameter (time units) used to add force in Langevin method -md_nraise 1 #parameters used when md_type=nvt -cal_syns 0 #calculate asynchronous overlap matrix to output for Hefei-NAMD -dmax 0.01 #maximum displacement of all atoms in one step (bohr) -md_tolerance 100 #tolerance for velocity rescaling (K) -md_pmode iso #NPT ensemble mode: iso, aniso, tri -md_pcouple none #whether couple different components: xyz, xy, yz, xz, none -md_pchain 1 #num of thermostats coupled with barostat -md_pfirst -1 #initial target pressure -md_plast -1 #final target pressure -md_pfreq 0 #oscillation frequency, used to determine qmass of thermostats coupled with barostat -dump_force 0 #output atomic forces into the file MD_dump or not. -dump_vel 0 #output atomic velocities into the file MD_dump or not -dump_virial 0 #output lattice virial into the file MD_dump or not - -#Parameters (10.Electric field and dipole correction) -efield_flag 0 #add electric field -dip_cor_flag 0 #dipole correction -efield_dir 2 #the direction of the electric field or dipole correction -efield_pos_max 0.5 #position of the maximum of the saw-like potential along crystal axis efield_dir -efield_pos_dec 0.1 #zone in the unit cell where the saw-like potential decreases -efield_amp 0 #amplitude of the electric field - -#Parameters (11.Gate field) -gate_flag 0 #compensating charge or not -zgate 0.5 #position of charged plate -relax 0 #allow relaxation along the specific direction -block 0 #add a block potential or not -block_down 0.45 #low bound of the block -block_up 0.55 #high bound of the block -block_height 0.1 #height of the block - -#Parameters (12.Test) -out_alllog F #output information for each processor, when parallel -nurse 0 #for coders -t_in_h 1 #calculate the kinetic energy or not -vl_in_h 1 #calculate the local potential or not -vnl_in_h 1 #calculate the nonlocal potential or not -vh_in_h 1 #calculate the hartree potential or not -vion_in_h 1 #calculate the local ionic potential or not -test_force 0 #test the force -test_stress 0 #test the force -test_skip_ewald 0 #skip ewald energy - -#Parameters (13.vdW Correction) -vdw_method d2 #the method of calculating vdw (none ; d2 ; d3_0 ; d3_bj -vdw_s6 default #scale parameter of d2/d3_0/d3_bj -vdw_s8 default #scale parameter of d3_0/d3_bj -vdw_a1 default #damping parameter of d3_0/d3_bj -vdw_a2 default #damping parameter of d3_bj -vdw_d 20 #damping parameter of d2 -vdw_abc 0 #third-order term? -vdw_C6_file default #filename of C6 -vdw_C6_unit Jnm6/mol #unit of C6, Jnm6/mol or eVA6 -vdw_R0_file default #filename of R0 -vdw_R0_unit A #unit of R0, A or Bohr -vdw_cutoff_type radius #expression model of periodic structure, radius or period -vdw_cutoff_radius default #radius cutoff for periodic structure -vdw_radius_unit Bohr #unit of radius cutoff for periodic structure -vdw_cn_thr 40 #radius cutoff for cn -vdw_cn_thr_unit Bohr #unit of cn_thr, Bohr or Angstrom -vdw_cutoff_period 3 3 3 #periods of periodic structure - -#Parameters (14.exx) -exx_fock_alpha 1 # -exx_erfc_alpha 0.25 # -exx_erfc_omega 0.11 # -exx_separate_loop 1 #0 or 1 -exx_hybrid_step 100 # -exx_mixing_beta 1.0 # -exx_fock_lambda 0.3 # -exx_real_number default #0 or 1 -exx_pca_threshold 0 # -exx_c_threshold 0 # -exx_v_threshold 0 # -exx_dm_threshold 0 # -exx_c_grad_threshold 0 # -exx_v_grad_threshold 0 # -exx_c_grad_r_threshold 0 # -exx_v_grad_r_threshold 0 # -exx_ccp_rmesh_times default # -exx_opt_orb_lmax 0 # -exx_opt_orb_ecut 0 # -exx_opt_orb_tolerence 0 # - -#Parameters (16.tddft) -td_force_dt 0.02 #time of force change -td_vext 0 #add extern potential or not -td_vext_dire 1 #extern potential direction -td_propagator 0 # method of propagator -td_stype 0 #space domain type -td_ttype 0 #time domain type -td_tstart 1 #the start step of electric field -td_tend 1000 #the start step of electric field -td_lcut1 0.05 # separator in length gauge -td_lcut2 0.95 # separator in length gauge -# parameters of Gauss electric field -td_gauss_freq 22.13 # fs^-1 -td_gauss_phase 0.0 -td_gauss_sigma 30.0 # fs -td_gauss_t0 100.0 -td_gauss_amp 0.25 # V/A -# parameters of Trapezoid electric field -td_trape_freq 1.60 # fs^-1 -td_trape_phase 0.0 -td_trape_t1 1875 -td_trape_t2 5625 -td_trape_t3 7500 -td_trape_amp 2.74 # V/A -#parameters of Trigonometric electric field -td_trigo_freq1 1.164656 # fs^-1 -td_trigo_freq2 0.029116 # fs^-1 -td_trigo_phase1 0.0 -td_trigo_phase2 0.0 -td_trigo_amp 2.74 # V/A -#parameters of Heaviside electric field -td_heavi_t0 100 -td_heavi_amp 1.0 # V/A -td_print_eij -1.0 # threshold to output Eij elements -td_edm 0 # 0: new edm method 1: old edm method -out_dipole 0 #output dipole or not -out_efield 0 #output efield or not -ocp 0 #change occupation or not -ocp_set 2*1 #set occupation - -#Parameters (17.berry_wannier) -berry_phase 0 #calculate berry phase or not -gdir 3 #calculate the polarization in the direction of the lattice vector -towannier90 0 #use wannier90 code interface or not -nnkpfile seedname.nnkp #the wannier90 code nnkp file name -wannier_spin up #calculate spin in wannier90 code interface -wannier_method 1 #different implementation methods under Lcao basis set -out_wannier_mmn 1 #output .mmn file or not -out_wannier_amn 1 #output .amn file or not -out_wannier_unk 1 #output UNK. file or not -out_wannier_eig 1 #output .eig file or not -out_wannier_wvfn_formatted 1 #output UNK. file in text format or in binary format - -#Parameters (18.implicit_solvation) -imp_sol 0 #calculate implicit solvation correction or not -eb_k 80 #the relative permittivity of the bulk solvent -tau 1.0798e-05 #the effective surface tension parameter -sigma_k 0.6 # the width of the diffuse cavity -nc_k 0.00037 # the cut-off charge density - -#Parameters (19.orbital free density functional theory) -of_kinetic vw #kinetic energy functional, such as tf, vw, wt -of_method tn #optimization method used in OFDFT, including cg1, cg2, tn (default) -of_conv energy #the convergence criterion, potential, energy (default), or both -of_tole 1e-06 #tolerance of the energy change (in Ry) for determining the convergence, default=2e-6 Ry -of_tolp 1e-05 #tolerance of potential for determining the convergence, default=1e-5 in a.u. -of_tf_weight 1 #weight of TF KEDF -of_vw_weight 1 #weight of vW KEDF -of_wt_alpha 0.833333 #parameter alpha of WT KEDF -of_wt_beta 0.833333 #parameter beta of WT KEDF -of_wt_rho0 1 #the average density of system, used in WT KEDF, in Bohr^-3 -of_hold_rho0 0 #If set to 1, the rho0 will be fixed even if the volume of system has changed, it will be set to 1 automaticly if of_wt_rho0 is not zero -of_full_pw 0 #If set to 1, ecut will be ignored when collect planewaves, so that all planewaves will be used -of_full_pw_dim 0 #If of_full_pw = true, dimention of FFT is testricted to be (0) either odd or even; (1) odd only; (2) even only -of_read_kernel 0 #If set to 1, the kernel of WT KEDF will be filled from file of_kernel_file, not from formula. Only usable for WT KEDF -of_kernel_file WTkernel.txt #The name of WT kernel file. - -#Parameters (20.dft+u) -dft_plus_u 0 #true:DFT+U correction; false: standard DFT calcullation(default) -yukawa_lambda -1 #default:0.0 -yukawa_potential 0 #default: false -omc 0 #the mode of occupation matrix control -hubbard_u 0 #Hubbard Coulomb interaction parameter U(ev) -orbital_corr -1 #which correlated orbitals need corrected ; d:2 ,f:3, do not need correction:-1 - -#Parameters (22.non-collinear spin-constrained DFT) -sc_mag_switch 0 #0: no spin-constrained DFT; 1: constrain atomic magnetization via values at xyz; 3: via spin value and angles -decay_grad_switch 1 # -sc_thr 1e-04 #Convergence criterion of spin-constrained iteration (RMS) in uB -nsc 50 #Maximal number of spin-constrained iteration -nsc_min 4 #Minimum number of spin-constrained iteration -sc_scf_nmin 4 #Minimum number of outer scf loop before initializing lambda loop -alpha_trial 0.02 #Initial trial step size for lambda in eV/uB^2 -sccut 4 #Maximal step size for lambda in eV/uB diff --git a/source/module_io/test/support/KPT b/source/module_io/test/support/KPT deleted file mode 100644 index cc2549138e..0000000000 --- a/source/module_io/test/support/KPT +++ /dev/null @@ -1,4 +0,0 @@ -K_POINTS -0 -MP -8 8 8 1 1 1 diff --git a/source/module_io/test/support/QO_ovlpR_0.dat b/source/module_io/test/support/QO_ovlpR_0.dat deleted file mode 100644 index 0265bf0a82..0000000000 --- a/source/module_io/test/support/QO_ovlpR_0.dat +++ /dev/null @@ -1,9 +0,0 @@ -SUPERCELL_COORDINATE: 0 0 0 - 9.95330157042009e-01 -7.71640245637438e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 - 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 2.32940220946083e-01 3.12427888919456e-01 - 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 2.32940220946083e-01 3.12427888919456e-01 2.26670648341119e-01 -2.26670648341119e-01 -2.26670648341119e-01 2.24394059582262e-01 -2.24394059582262e-01 -2.24394059582262e-01 -2.07892037913866e-01 -3.77149318383241e-02 - 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 2.32940220946083e-01 3.12427888919456e-01 2.26670648341119e-01 -2.26670648341119e-01 -2.26670648341119e-01 2.24394059582262e-01 -2.24394059582262e-01 -2.24394059582262e-01 -2.07892037913866e-01 -3.77149318383241e-02 2.49657219237144e-02 1.92152864865442e-01 1.92152864865442e-01 1.63696083551827e-01 6.24455824684642e-02 6.24455824684642e-02 2.07892037913866e-01 3.77149318383241e-02 - 2.32940220946083e-01 3.12427888919456e-01 2.26670648341119e-01 -2.26670648341119e-01 -2.26670648341119e-01 2.24394059582262e-01 -2.24394059582262e-01 -2.24394059582262e-01 -2.07892037913866e-01 -3.77149318383241e-02 2.49657219237144e-02 1.92152864865442e-01 1.92152864865442e-01 1.63696083551827e-01 6.24455824684642e-02 6.24455824684642e-02 2.07892037913866e-01 3.77149318383241e-02 1.92152864865442e-01 2.49657219237144e-02 -1.92152864865442e-01 6.24455824684642e-02 1.63696083551827e-01 -6.24455824684642e-02 2.07892037913866e-01 3.77149318383241e-02 - -2.07892037913866e-01 -3.77149318383241e-02 2.49657219237144e-02 1.92152864865442e-01 1.92152864865442e-01 1.63696083551827e-01 6.24455824684642e-02 6.24455824684642e-02 2.07892037913866e-01 3.77149318383241e-02 1.92152864865442e-01 2.49657219237144e-02 -1.92152864865442e-01 6.24455824684642e-02 1.63696083551827e-01 -6.24455824684642e-02 2.07892037913866e-01 3.77149318383241e-02 1.92152864865442e-01 -1.92152864865442e-01 2.49657219237143e-02 6.24455824684642e-02 -6.24455824684642e-02 1.63696083551827e-01 6.25659449773200e-02 -1.44907194227481e-01 - 2.07892037913866e-01 3.77149318383241e-02 1.92152864865442e-01 2.49657219237144e-02 -1.92152864865442e-01 6.24455824684642e-02 1.63696083551827e-01 -6.24455824684642e-02 2.07892037913866e-01 3.77149318383241e-02 1.92152864865442e-01 -1.92152864865442e-01 2.49657219237143e-02 6.24455824684642e-02 -6.24455824684642e-02 1.63696083551827e-01 6.25659449773200e-02 -1.44907194227481e-01 -3.65397987032044e-02 1.08367395524277e-01 3.65397987032044e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 - 2.07892037913866e-01 3.77149318383241e-02 1.92152864865442e-01 -1.92152864865442e-01 2.49657219237143e-02 6.24455824684642e-02 -6.24455824684642e-02 1.63696083551827e-01 6.25659449773200e-02 -1.44907194227481e-01 -3.65397987032044e-02 1.08367395524277e-01 3.65397987032044e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 9.93363417688277e-01 0.00000000000000e+00 0.00000000000000e+00 -7.55891200149997e-02 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00 diff --git a/source/module_io/test/support/SK_nspin1 b/source/module_io/test/support/SK_nspin1 deleted file mode 100644 index 31ffde8df2..0000000000 --- a/source/module_io/test/support/SK_nspin1 +++ /dev/null @@ -1,24 +0,0 @@ -# k-point 0 -# nrow 13 -# ncol 13 -0 1 -1 -1.53553e-16 -13 -1.53553e-16 -14 1 -28 1 -31 9.59565e-16 -42 1 -45 9.59565e-16 -56 1 -59 9.59565e-16 -67 9.59565e-16 -70 1 -81 9.59565e-16 -84 1 -95 9.59565e-16 -98 1 -112 1 -126 1 -140 1 -154 1 -168 1 diff --git a/source/module_io/test/support/SK_nspin2 b/source/module_io/test/support/SK_nspin2 deleted file mode 100644 index 17e446a76f..0000000000 --- a/source/module_io/test/support/SK_nspin2 +++ /dev/null @@ -1,48 +0,0 @@ -# k-point 0 -# nrow 13 -# ncol 13 -0 1 -1 -1.53553e-16 -13 -1.53553e-16 -14 1 -28 1 -31 9.59565e-16 -42 1 -45 9.59565e-16 -56 1 -59 9.59565e-16 -67 9.59565e-16 -70 1 -81 9.59565e-16 -84 1 -95 9.59565e-16 -98 1 -112 1 -126 1 -140 1 -154 1 -168 1 -# k-point 1 -# nrow 13 -# ncol 13 -0 1 -1 -1.53553e-16 -13 -1.53553e-16 -14 1 -28 1 -31 9.59565e-16 -42 1 -45 9.59565e-16 -56 1 -59 9.59565e-16 -67 9.59565e-16 -70 1 -81 9.59565e-16 -84 1 -95 9.59565e-16 -98 1 -112 1 -126 1 -140 1 -154 1 -168 1 diff --git a/source/module_io/test/support/SR.csr b/source/module_io/test/support/SR.csr deleted file mode 100644 index e86b151277..0000000000 --- a/source/module_io/test/support/SR.csr +++ /dev/null @@ -1,11 +0,0 @@ -STEP: 0 -Matrix Dimension of S(R): 4 -Matrix number of S(R): 2 -0 1 1 2 - 4.00e+00 7.00e+00 - 3 2 - 0 1 2 2 2 -0 0 0 3 - 5.00e+00 6.00e+00 1.00e+01 - 2 3 3 - 0 0 0 2 3 diff --git a/source/module_io/test/support/STRU b/source/module_io/test/support/STRU deleted file mode 100644 index c736ad2c52..0000000000 --- a/source/module_io/test/support/STRU +++ /dev/null @@ -1,21 +0,0 @@ -ATOMIC_SPECIES -Ce 140.115 58_Ce.UPF upf201 - -NUMERICAL_ORBITAL -Ce_gga_8au_80Ry_4s2p2d2f.Orb - -LATTICE_CONSTANT -8.92 - -LATTICE_VECTORS -0.0 0.5 0.5 -0.5 0.0 0.5 -0.5 0.5 0.0 - -ATOMIC_POSITIONS -Direct - -Ce -0.0 -1 -0.00 0.00 0.00 1 1 1 diff --git a/source/module_io/test/support/Si.upf b/source/module_io/test/support/Si.upf deleted file mode 100644 index ad493e5e7d..0000000000 --- a/source/module_io/test/support/Si.upf +++ /dev/null @@ -1,1226 +0,0 @@ - - - - This pseudopotential file has been produced using the code - ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) - scalar-relativistic version 2.1.1, 03/26/2014 by D. R. Hamann - The code is available through a link at URL www.mat-simresearch.com. - Documentation with the package provides a full discription of the - input data below. - - - While it is not required under the terms of the GNU GPL, it is - suggested that you cite D. R. Hamann, Phys. Rev. B 88, 085117 (2013) - in any publication using these pseudopotentials. - - - Copyright 2015 The Regents of the University of California - - This work is licensed under the Creative Commons Attribution-ShareAlike - 4.0 International License. To view a copy of this license, visit - http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to - Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. - - This pseudopotential is part of the Schlipf-Gygi norm-conserving - pseudopotential library. Its construction parameters were tuned to - reproduce materials of a training set with very high accuracy and - should be suitable as a general purpose pseudopotential to treat a - variety of different compounds. For details of the construction and - testing of the pseudopotential please refer to: - - [insert reference to paper here] - - We kindly ask that you include this reference in all publications - associated to this pseudopotential. - - - -# ATOM AND REFERENCE CONFIGURATION -# atsym z nc nv iexc psfile - Si 14.00 3 2 4 upf -# -# n l f energy (Ha) - 1 0 2.00 - 2 0 2.00 - 2 1 6.00 - 3 0 2.00 - 3 1 2.00 -# -# PSEUDOPOTENTIAL AND OPTIMIZATION -# lmax - 1 -# -# l, rc, ep, ncon, nbas, qcut - 0 2.26557 -0.39736 5 8 4.77946 - 1 3.56481 -0.14998 5 8 3.13498 -# -# LOCAL POTENTIAL -# lloc, lpopt, rc(5), dvloc0 - 4 5 1.32451 0.00000 -# -# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs -# l, nproj, debl - 0 2 0.46066 - 1 2 0.90802 -# -# MODEL CORE CHARGE -# icmod, fcfact - 0 0.00000 -# -# LOG DERIVATIVE ANALYSIS -# epsh1, epsh2, depsh - -5.00 3.00 0.02 -# -# OUTPUT GRID -# rlmax, drl - 6.00 0.01 -# -# TEST CONFIGURATIONS -# ncnf - 0 -# nvcnf -# n l f - - - - - - - - - 0.0000 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 - 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 - 0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 - 0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100 - 0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900 - 0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700 - 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500 - 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300 - 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100 - 0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 - 0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 - 0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 - 0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300 - 1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100 - 1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900 - 1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700 - 1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500 - 1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300 - 1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100 - 1.5200 1.5300 1.5400 1.5500 1.5600 1.5700 1.5800 1.5900 - 1.6000 1.6100 1.6200 1.6300 1.6400 1.6500 1.6600 1.6700 - 1.6800 1.6900 1.7000 1.7100 1.7200 1.7300 1.7400 1.7500 - 1.7600 1.7700 1.7800 1.7900 1.8000 1.8100 1.8200 1.8300 - 1.8400 1.8500 1.8600 1.8700 1.8800 1.8900 1.9000 1.9100 - 1.9200 1.9300 1.9400 1.9500 1.9600 1.9700 1.9800 1.9900 - 2.0000 2.0100 2.0200 2.0300 2.0400 2.0500 2.0600 2.0700 - 2.0800 2.0900 2.1000 2.1100 2.1200 2.1300 2.1400 2.1500 - 2.1600 2.1700 2.1800 2.1900 2.2000 2.2100 2.2200 2.2300 - 2.2400 2.2500 2.2600 2.2700 2.2800 2.2900 2.3000 2.3100 - 2.3200 2.3300 2.3400 2.3500 2.3600 2.3700 2.3800 2.3900 - 2.4000 2.4100 2.4200 2.4300 2.4400 2.4500 2.4600 2.4700 - 2.4800 2.4900 2.5000 2.5100 2.5200 2.5300 2.5400 2.5500 - 2.5600 2.5700 2.5800 2.5900 2.6000 2.6100 2.6200 2.6300 - 2.6400 2.6500 2.6600 2.6700 2.6800 2.6900 2.7000 2.7100 - 2.7200 2.7300 2.7400 2.7500 2.7600 2.7700 2.7800 2.7900 - 2.8000 2.8100 2.8200 2.8300 2.8400 2.8500 2.8600 2.8700 - 2.8800 2.8900 2.9000 2.9100 2.9200 2.9300 2.9400 2.9500 - 2.9600 2.9700 2.9800 2.9900 3.0000 3.0100 3.0200 3.0300 - 3.0400 3.0500 3.0600 3.0700 3.0800 3.0900 3.1000 3.1100 - 3.1200 3.1300 3.1400 3.1500 3.1600 3.1700 3.1800 3.1900 - 3.2000 3.2100 3.2200 3.2300 3.2400 3.2500 3.2600 3.2700 - 3.2800 3.2900 3.3000 3.3100 3.3200 3.3300 3.3400 3.3500 - 3.3600 3.3700 3.3800 3.3900 3.4000 3.4100 3.4200 3.4300 - 3.4400 3.4500 3.4600 3.4700 3.4800 3.4900 3.5000 3.5100 - 3.5200 3.5300 3.5400 3.5500 3.5600 3.5700 3.5800 3.5900 - 3.6000 3.6100 3.6200 3.6300 3.6400 3.6500 3.6600 3.6700 - 3.6800 3.6900 3.7000 3.7100 3.7200 3.7300 3.7400 3.7500 - 3.7600 3.7700 3.7800 3.7900 3.8000 3.8100 3.8200 3.8300 - 3.8400 3.8500 3.8600 3.8700 3.8800 3.8900 3.9000 3.9100 - 3.9200 3.9300 3.9400 3.9500 3.9600 3.9700 3.9800 3.9900 - 4.0000 4.0100 4.0200 4.0300 4.0400 4.0500 4.0600 4.0700 - 4.0800 4.0900 4.1000 4.1100 4.1200 4.1300 4.1400 4.1500 - 4.1600 4.1700 4.1800 4.1900 4.2000 4.2100 4.2200 4.2300 - 4.2400 4.2500 4.2600 4.2700 4.2800 4.2900 4.3000 4.3100 - 4.3200 4.3300 4.3400 4.3500 4.3600 4.3700 4.3800 4.3900 - 4.4000 4.4100 4.4200 4.4300 4.4400 4.4500 4.4600 4.4700 - 4.4800 4.4900 4.5000 4.5100 4.5200 4.5300 4.5400 4.5500 - 4.5600 4.5700 4.5800 4.5900 4.6000 4.6100 4.6200 4.6300 - 4.6400 4.6500 4.6600 4.6700 4.6800 4.6900 4.7000 4.7100 - 4.7200 4.7300 4.7400 4.7500 4.7600 4.7700 4.7800 4.7900 - 4.8000 4.8100 4.8200 4.8300 4.8400 4.8500 4.8600 4.8700 - 4.8800 4.8900 4.9000 4.9100 4.9200 4.9300 4.9400 4.9500 - 4.9600 4.9700 4.9800 4.9900 5.0000 5.0100 5.0200 5.0300 - 5.0400 5.0500 5.0600 5.0700 5.0800 5.0900 5.1000 5.1100 - 5.1200 5.1300 5.1400 5.1500 5.1600 5.1700 5.1800 5.1900 - 5.2000 5.2100 5.2200 5.2300 5.2400 5.2500 5.2600 5.2700 - 5.2800 5.2900 5.3000 5.3100 5.3200 5.3300 5.3400 5.3500 - 5.3600 5.3700 5.3800 5.3900 5.4000 5.4100 5.4200 5.4300 - 5.4400 5.4500 5.4600 5.4700 5.4800 5.4900 5.5000 5.5100 - 5.5200 5.5300 5.5400 5.5500 5.5600 5.5700 5.5800 5.5900 - 5.6000 5.6100 5.6200 5.6300 5.6400 5.6500 5.6600 5.6700 - 5.6800 5.6900 5.7000 5.7100 5.7200 5.7300 5.7400 5.7500 - 5.7600 5.7700 5.7800 5.7900 5.8000 5.8100 5.8200 5.8300 - 5.8400 5.8500 5.8600 5.8700 5.8800 5.8900 5.9000 5.9100 - 5.9200 5.9300 5.9400 5.9500 5.9600 5.9700 5.9800 5.9900 - 6.0000 6.0100 - - - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 - 0.0100 0.0100 - - - - -1.5477468977E+01 -2.7324392973E+01 -2.9782345566E+01 -2.7767388805E+01 - -2.6195584738E+01 -2.5542861880E+01 -2.5276294367E+01 -2.5144829399E+01 - -2.5059579659E+01 -2.4989528517E+01 -2.4923311832E+01 -2.4856476245E+01 - -2.4787146143E+01 -2.4714474972E+01 -2.4638058414E+01 -2.4557697869E+01 - -2.4473298719E+01 -2.4384823413E+01 -2.4292268116E+01 -2.4195650120E+01 - -2.4095000446E+01 -2.3990359167E+01 -2.3881772210E+01 -2.3769289057E+01 - -2.3652961011E+01 -2.3532839844E+01 -2.3408976724E+01 -2.3281421360E+01 - -2.3150221310E+01 -2.3015421452E+01 -2.2877063569E+01 -2.2735186076E+01 - -2.2589823854E+01 -2.2441008210E+01 -2.2288766939E+01 -2.2133124532E+01 - -2.1974102457E+01 -2.1811719599E+01 -2.1645992791E+01 -2.1476937450E+01 - -2.1304568340E+01 -2.1128900413E+01 -2.0949949739E+01 -2.0767734522E+01 - -2.0582276162E+01 -2.0393600368E+01 -2.0201738292E+01 -2.0006727663E+01 - -1.9808613876E+01 -1.9607451068E+01 -1.9403303174E+01 -1.9196244743E+01 - -1.8986361617E+01 -1.8773751894E+01 -1.8558525992E+01 -1.8340807162E+01 - -1.8120731547E+01 -1.7898447890E+01 -1.7674117421E+01 -1.7447913057E+01 - -1.7220018739E+01 -1.6990628533E+01 -1.6759945130E+01 -1.6528179076E+01 - -1.6295546870E+01 -1.6062269594E+01 -1.5828571461E+01 -1.5594678052E+01 - -1.5360814860E+01 -1.5127205772E+01 -1.4894071606E+01 -1.4661628903E+01 - -1.4430088792E+01 -1.4199656058E+01 -1.3970528303E+01 -1.3742895224E+01 - -1.3516938355E+01 -1.3292830722E+01 -1.3070736720E+01 -1.2850812115E+01 - -1.2633204161E+01 -1.2418051812E+01 -1.2205485995E+01 -1.1995629942E+01 - -1.1788599541E+01 -1.1584503703E+01 -1.1383444728E+01 -1.1185518645E+01 - -1.0990815535E+01 -1.0799419817E+01 -1.0611410493E+01 -1.0426861352E+01 - -1.0245841141E+01 -1.0068413676E+01 -9.8946379323E+00 -9.7245680859E+00 - -9.5582535264E+00 -9.3957390062E+00 -9.2370641453E+00 -9.0822637260E+00 - -8.9313675523E+00 -8.7844003324E+00 -8.6413815779E+00 -8.5023256728E+00 - -8.3672414787E+00 -8.2361319944E+00 -8.1089947620E+00 -7.9858215764E+00 - -7.8665987003E+00 -7.7513061799E+00 -7.6399175688E+00 -7.5324006017E+00 - -7.4287170592E+00 -7.3288227456E+00 -7.2326658677E+00 -7.1401888582E+00 - -7.0513282531E+00 -6.9660137762E+00 -6.8841675317E+00 -6.8057056592E+00 - -6.7305390121E+00 -6.6585689368E+00 -6.5896908110E+00 -6.5237944650E+00 - -6.4607608247E+00 -6.4004630980E+00 -6.3427691680E+00 -6.2875378105E+00 - -6.2346187529E+00 -6.1838567238E+00 -6.1350858423E+00 -6.0881305667E+00 - -6.0428108557E+00 -5.9989315760E+00 -5.9563018739E+00 -5.9147249878E+00 - -5.8740370536E+00 -5.8340831668E+00 -5.7947320866E+00 -5.7558838066E+00 - -5.7174427527E+00 -5.6793530761E+00 -5.6415637619E+00 -5.6040426965E+00 - -5.5667749928E+00 -5.5297469228E+00 -5.4929637112E+00 -5.4564282638E+00 - -5.4201521955E+00 -5.3841477741E+00 -5.3484295396E+00 -5.3130120785E+00 - -5.2779105659E+00 -5.2431380847E+00 -5.2087081915E+00 -5.1746314481E+00 - -5.1409182521E+00 -5.1075764790E+00 -5.0746128917E+00 -5.0420327126E+00 - -5.0098392753E+00 -4.9780353204E+00 -4.9466212706E+00 -4.9155976412E+00 - -4.8849625533E+00 -4.8547146028E+00 -4.8248501916E+00 -4.7953663228E+00 - -4.7662581823E+00 -4.7375215062E+00 -4.7091506720E+00 -4.6811404592E+00 - -4.6534847522E+00 -4.6261776585E+00 -4.5992128032E+00 -4.5725838773E+00 - -4.5462844112E+00 -4.5203079036E+00 -4.4946478992E+00 -4.4692978981E+00 - -4.4442515244E+00 -4.4195024428E+00 -4.3950443916E+00 -4.3708713315E+00 - -4.3469771307E+00 -4.3233561448E+00 -4.3000023802E+00 -4.2769105927E+00 - -4.2540751126E+00 -4.2314909275E+00 -4.2091528328E+00 -4.1870559746E+00 - -4.1651956747E+00 -4.1435672010E+00 -4.1221664144E+00 -4.1009887053E+00 - -4.0800303394E+00 -4.0592871449E+00 -4.0387554470E+00 -4.0184316203E+00 - -3.9983120170E+00 -3.9783935042E+00 -3.9586725412E+00 -3.9391462647E+00 - -3.9198115421E+00 -3.9006654703E+00 -3.8817053769E+00 -3.8629283341E+00 - -3.8443319617E+00 -3.8259135965E+00 -3.8076708201E+00 -3.7896013199E+00 - -3.7717026269E+00 -3.7539726370E+00 -3.7364090596E+00 -3.7190097434E+00 - -3.7017726254E+00 -3.6846955167E+00 -3.6677764559E+00 -3.6510133854E+00 - -3.6344042806E+00 -3.6179471887E+00 -3.6016401035E+00 -3.5854810749E+00 - -3.5694681444E+00 -3.5535993312E+00 -3.5378727398E+00 -3.5222863844E+00 - -3.5068383741E+00 -3.4915269703E+00 -3.4763502626E+00 -3.4613065798E+00 - -3.4463942648E+00 -3.4316115920E+00 -3.4169569188E+00 -3.4024285517E+00 - -3.3880247672E+00 -3.3737440896E+00 -3.3595849224E+00 -3.3455456969E+00 - -3.3316249364E+00 -3.3178210774E+00 -3.3041326374E+00 -3.2905582043E+00 - -3.2770962736E+00 -3.2637454490E+00 -3.2505043664E+00 -3.2373715747E+00 - -3.2243457535E+00 -3.2114255903E+00 -3.1986096896E+00 -3.1858967973E+00 - -3.1732856542E+00 -3.1607749207E+00 -3.1483634008E+00 -3.1360498903E+00 - -3.1238331067E+00 -3.1117119036E+00 -3.0996851338E+00 -3.0877515736E+00 - -3.0759101174E+00 -3.0641596773E+00 -3.0524990903E+00 -3.0409272833E+00 - -3.0294432293E+00 -3.0180458288E+00 -3.0067340322E+00 -2.9955068756E+00 - -2.9843633257E+00 -2.9733023477E+00 -2.9623230421E+00 -2.9514244449E+00 - -2.9406055280E+00 -2.9298654572E+00 -2.9192033229E+00 -2.9086181497E+00 - -2.8981091154E+00 -2.8876753764E+00 -2.8773160286E+00 -2.8670302370E+00 - -2.8568172300E+00 -2.8466761789E+00 -2.8366062277E+00 -2.8266066756E+00 - -2.8166767555E+00 -2.8068156351E+00 -2.7970226322E+00 -2.7872970399E+00 - -2.7776381027E+00 -2.7680450991E+00 -2.7585173970E+00 -2.7490543163E+00 - -2.7396551053E+00 -2.7303191888E+00 -2.7210459310E+00 -2.7118346568E+00 - -2.7026847368E+00 -2.6935956102E+00 -2.6845666748E+00 -2.6755972644E+00 - -2.6666868674E+00 -2.6578349224E+00 -2.6490408387E+00 -2.6403040399E+00 - -2.6316240357E+00 -2.6230002915E+00 -2.6144322274E+00 -2.6059193575E+00 - -2.5974611946E+00 -2.5890572296E+00 -2.5807069106E+00 -2.5724098107E+00 - -2.5641654513E+00 -2.5559733347E+00 -2.5478329753E+00 -2.5397439514E+00 - -2.5317058077E+00 -2.5237180602E+00 -2.5157802749E+00 -2.5078920358E+00 - -2.5000529075E+00 -2.4922624221E+00 -2.4845201831E+00 -2.4768257811E+00 - -2.4691787986E+00 -2.4615787838E+00 -2.4540253663E+00 -2.4465181449E+00 - -2.4390567145E+00 -2.4316406471E+00 -2.4242695821E+00 -2.4169431302E+00 - -2.4096608977E+00 -2.4024224760E+00 -2.3952275121E+00 -2.3880756283E+00 - -2.3809664422E+00 -2.3738995587E+00 -2.3668746343E+00 -2.3598913020E+00 - -2.3529491911E+00 -2.3460479148E+00 -2.3391871420E+00 -2.3323665165E+00 - -2.3255856806E+00 -2.3188442508E+00 -2.3121419122E+00 -2.3054783204E+00 - -2.2988531312E+00 -2.2922659659E+00 -2.2857165237E+00 -2.2792044767E+00 - -2.2727294942E+00 -2.2662912082E+00 -2.2598893247E+00 -2.2535235433E+00 - -2.2471935506E+00 -2.2408990002E+00 -2.2346395919E+00 -2.2284150639E+00 - -2.2222251242E+00 -2.2160694683E+00 -2.2099477827E+00 -2.2038598291E+00 - -2.1978053318E+00 -2.1917840153E+00 -2.1857955713E+00 -2.1798397640E+00 - -2.1739163327E+00 -2.1680250136E+00 -2.1621655213E+00 -2.1563376011E+00 - -2.1505410203E+00 -2.1447755279E+00 -2.1390408686E+00 -2.1333367626E+00 - -2.1276630036E+00 -2.1220193519E+00 -2.1164055679E+00 -2.1108213893E+00 - -2.1052665912E+00 -2.0997409596E+00 -2.0942442661E+00 -2.0887762796E+00 - -2.0833367418E+00 -2.0779254678E+00 -2.0725422396E+00 -2.0671868395E+00 - -2.0618590326E+00 -2.0565586038E+00 -2.0512853643E+00 -2.0460391061E+00 - -2.0408196217E+00 -2.0356266749E+00 -2.0304600880E+00 -2.0253196691E+00 - -2.0202052199E+00 -2.0151165385E+00 -2.0100534025E+00 -2.0050156523E+00 - -2.0000030990E+00 -1.9950155537E+00 -1.9900528158E+00 -1.9851146899E+00 - -1.9802010173E+00 -1.9753116178E+00 -1.9704463115E+00 -1.9656049008E+00 - -1.9607872123E+00 -1.9559930895E+00 -1.9512223606E+00 -1.9464748539E+00 - -1.9417503771E+00 -1.9370487734E+00 -1.9323698900E+00 -1.9277135633E+00 - -1.9230796294E+00 -1.9184679026E+00 -1.9138782381E+00 -1.9093104884E+00 - -1.9047644975E+00 -1.9002401093E+00 -1.8957371459E+00 -1.8912554699E+00 - -1.8867949408E+00 -1.8823554098E+00 -1.8779367281E+00 -1.8735387272E+00 - -1.8691612728E+00 -1.8648042327E+00 -1.8604674651E+00 -1.8561508281E+00 - -1.8518541638E+00 -1.8475773371E+00 -1.8433202255E+00 -1.8390826938E+00 - -1.8348646068E+00 -1.8306658183E+00 -1.8264861889E+00 -1.8223256068E+00 - -1.8181839431E+00 -1.8140610690E+00 -1.8099568515E+00 -1.8058711430E+00 - -1.8018038438E+00 -1.7977548310E+00 -1.7937239816E+00 -1.7897111726E+00 - -1.7857162590E+00 -1.7817391401E+00 -1.7777797032E+00 -1.7738378311E+00 - -1.7699134066E+00 -1.7660062999E+00 -1.7621163950E+00 -1.7582435938E+00 - -1.7543877846E+00 -1.7505488557E+00 -1.7467266942E+00 -1.7429211656E+00 - -1.7391321872E+00 -1.7353596525E+00 -1.7316034550E+00 -1.7278634881E+00 - -1.7241396316E+00 -1.7204317838E+00 -1.7167398544E+00 -1.7130637420E+00 - -1.7094033448E+00 -1.7057585614E+00 -1.7021292665E+00 -1.6985153863E+00 - -1.6949168243E+00 -1.6913334837E+00 -1.6877652676E+00 -1.6842120706E+00 - -1.6806737906E+00 -1.6771503506E+00 -1.6736416581E+00 -1.6701476209E+00 - -1.6666681466E+00 -1.6632031275E+00 -1.6597524814E+00 -1.6563161283E+00 - -1.6528939800E+00 -1.6494859485E+00 -1.6460919458E+00 -1.6427118637E+00 - -1.6393456356E+00 -1.6359931797E+00 -1.6326544123E+00 -1.6293292493E+00 - -1.6260176054E+00 -1.6227193778E+00 -1.6194345069E+00 -1.6161629127E+00 - -1.6129045151E+00 -1.6096592341E+00 -1.6064269863E+00 -1.6032076774E+00 - -1.6000012493E+00 -1.5968076257E+00 -1.5936267302E+00 -1.5904584866E+00 - -1.5873028146E+00 -1.5841596253E+00 -1.5810288631E+00 -1.5779104552E+00 - -1.5748043290E+00 -1.5717104115E+00 -1.5686286273E+00 -1.5655588892E+00 - -1.5625011455E+00 -1.5594553268E+00 -1.5564213638E+00 -1.5533991872E+00 - -1.5503887270E+00 -1.5473898951E+00 -1.5444026446E+00 -1.5414269094E+00 - -1.5384626235E+00 -1.5355097207E+00 -1.5325681348E+00 -1.5296377836E+00 - -1.5267186161E+00 -1.5238105728E+00 -1.5209135906E+00 -1.5180276066E+00 - -1.5151525575E+00 -1.5122883695E+00 -1.5094349837E+00 -1.5065923482E+00 - -1.5037604031E+00 -1.5009390881E+00 -1.4981283433E+00 -1.4953281043E+00 - -1.4925383011E+00 -1.4897588911E+00 -1.4869898169E+00 -1.4842310213E+00 - -1.4814824468E+00 -1.4787440363E+00 -1.4760157177E+00 -1.4732974468E+00 - -1.4705891727E+00 -1.4678908407E+00 -1.4652023962E+00 -1.4625237845E+00 - -1.4598549454E+00 -1.4571958183E+00 -1.4545463634E+00 -1.4519065286E+00 - -1.4492762619E+00 -1.4466555110E+00 -1.4440442241E+00 -1.4414423359E+00 - -1.4388498046E+00 -1.4362665850E+00 -1.4336926274E+00 -1.4311278823E+00 - -1.4285722999E+00 -1.4260258291E+00 -1.4234884065E+00 -1.4209600000E+00 - -1.4184405624E+00 -1.4159300463E+00 -1.4134284044E+00 -1.4109355893E+00 - -1.4084515477E+00 -1.4059762282E+00 -1.4035095964E+00 -1.4010516072E+00 - -1.3986022154E+00 -1.3961613759E+00 -1.3937290435E+00 -1.3913051642E+00 - -1.3888896954E+00 -1.3864826015E+00 -1.3840838394E+00 -1.3816933662E+00 - -1.3793111388E+00 -1.3769371141E+00 -1.3745712387E+00 -1.3722134757E+00 - -1.3698637895E+00 -1.3675221392E+00 -1.3651884837E+00 -1.3628627820E+00 - -1.3605449931E+00 -1.3582350654E+00 -1.3559329645E+00 -1.3536386564E+00 - -1.3513521020E+00 -1.3490732621E+00 -1.3468020977E+00 -1.3445385696E+00 - -1.3422826293E+00 -1.3400342423E+00 -1.3377933771E+00 -1.3355599965E+00 - -1.3333340631E+00 -1.3311155397E+00 - - - - 0.0000000000E+00 -2.8841736740E-02 -5.7679700157E-02 -8.6510048419E-02 - -1.1532880303E-01 -1.4413178139E-01 -1.7291453039E-01 -2.0167226144E-01 - -2.3039978723E-01 -2.5909146053E-01 -2.8774111545E-01 -3.1634201134E-01 - -3.4488677974E-01 -3.7336737464E-01 -4.0177502622E-01 -4.3010019855E-01 - -4.5833255122E-01 -4.8646090534E-01 -5.1447321404E-01 -5.4235653759E-01 - -5.7009702342E-01 -5.9767989113E-01 -6.2508942258E-01 -6.5230895724E-01 - -6.7932089284E-01 -7.0610669141E-01 -7.3264689061E-01 -7.5892112067E-01 - -7.8490812659E-01 -8.1058579577E-01 -8.3593119106E-01 -8.6092058898E-01 - -8.8552952315E-01 -9.0973283265E-01 -9.3350471611E-01 -9.5681878859E-01 - -9.7964814634E-01 -1.0019654323E+00 -1.0237429081E+00 -1.0449525307E+00 - -1.0655660300E+00 -1.0855549925E+00 -1.1048909467E+00 -1.1235454528E+00 - -1.1414901936E+00 -1.1586970687E+00 -1.1751382906E+00 -1.1907864820E+00 - -1.2056147736E+00 -1.2195969045E+00 -1.2327073278E+00 -1.2449213050E+00 - -1.2562149999E+00 -1.2665656036E+00 -1.2759514043E+00 -1.2843519027E+00 - -1.2917479077E+00 -1.2981216179E+00 -1.3034567334E+00 -1.3077385247E+00 - -1.3109539290E+00 -1.3130916419E+00 -1.3141421523E+00 -1.3140978881E+00 - -1.3129532218E+00 -1.3107045400E+00 -1.3073503532E+00 -1.3028912932E+00 - -1.2973301675E+00 -1.2906720157E+00 -1.2829241456E+00 -1.2740961357E+00 - -1.2641998629E+00 -1.2532495073E+00 -1.2412615620E+00 -1.2282548327E+00 - -1.2142504052E+00 -1.1992716289E+00 -1.1833440842E+00 -1.1664955415E+00 - -1.1487559102E+00 -1.1301571793E+00 -1.1107333490E+00 -1.0905203527E+00 - -1.0695559710E+00 -1.0478797354E+00 -1.0255328250E+00 -1.0025579532E+00 - -9.7899924704E-01 -9.5490211799E-01 -9.3031312559E-01 -9.0527983331E-01 - -8.7985065792E-01 -8.5407471242E-01 -8.2800164342E-01 -8.0168146341E-01 - -7.7516437895E-01 -7.4850067036E-01 -7.2174037077E-01 -6.9493318906E-01 - -6.6812831402E-01 -6.4137422471E-01 -6.1471851007E-01 -5.8820776129E-01 - -5.6188728413E-01 -5.3580082473E-01 -5.0999061020E-01 -4.8449711394E-01 - -4.5935903385E-01 -4.3461289437E-01 -4.1029282854E-01 -3.8643077334E-01 - -3.6305632845E-01 -3.4019666040E-01 -3.1787578979E-01 -2.9611530750E-01 - -2.7493426793E-01 -2.5434879517E-01 -2.3437186083E-01 -2.1501393233E-01 - -1.9628312291E-01 -1.7818400288E-01 -1.6071890003E-01 -1.4388794209E-01 - -1.2768840921E-01 -1.1211543946E-01 -9.7162452476E-02 -8.2820764671E-02 - -6.9080267705E-02 -5.5929689780E-02 -4.3356685252E-02 -3.1348689619E-02 - -1.9892453765E-02 -8.9755400134E-03 1.4132949100E-03 1.1285244724E-02 - 2.0647249979E-02 2.9506164420E-02 3.7866552512E-02 4.5731336842E-02 - 5.3103421637E-02 5.9984217384E-02 6.6375758237E-02 7.2279934730E-02 - 7.7699630296E-02 8.2637946624E-02 8.7099818936E-02 9.1090647717E-02 - 9.4617493782E-02 9.7688622888E-02 1.0031329865E-01 1.0250261932E-01 - 1.0426803941E-01 1.0562305440E-01 1.0658140112E-01 1.0715832691E-01 - 1.0736954932E-01 1.0723177394E-01 1.0676219438E-01 1.0597870952E-01 - 1.0489948361E-01 1.0354333092E-01 1.0192892530E-01 1.0007570434E-01 - 9.8002447271E-02 9.5728910965E-02 9.3273634771E-02 9.0656382360E-02 - 8.7895165189E-02 8.5009436085E-02 8.2016446203E-02 7.8935016989E-02 - 7.5781461937E-02 7.2573649515E-02 6.9326833237E-02 6.6057608575E-02 - 6.2780100681E-02 5.9509318826E-02 5.6258240942E-02 5.3039993600E-02 - 4.9866428133E-02 4.6748524948E-02 4.3697051508E-02 4.0720635210E-02 - 3.7828999347E-02 3.5028298091E-02 3.2327216093E-02 2.9729756158E-02 - 2.7242535996E-02 2.4868549730E-02 2.2611791776E-02 2.0474556066E-02 - 1.8458191433E-02 1.6564349954E-02 1.4791967083E-02 1.3141917674E-02 - 1.1611519754E-02 1.0199648749E-02 8.9033992507E-03 7.7195320342E-03 - 6.6448388461E-03 5.6745688076E-03 4.8048020119E-03 4.0301691924E-03 - 3.3455682929E-03 2.7455765903E-03 2.2244016523E-03 1.7761668655E-03 - 1.3950914183E-03 1.0749457295E-03 8.0991718345E-04 5.9427096241E-04 - 4.2157571283E-04 2.8706150887E-04 1.8468089406E-04 1.0950377224E-04 - 5.7290159029E-05 2.2098943961E-05 1.4043713425E-06 -9.1475939153E-06 - -1.3065809747E-05 -1.1927614655E-05 -9.4909833879E-06 -6.2689914936E-06 - -3.1648973687E-06 -2.1668137544E-06 -1.6967307725E-06 -1.2459024843E-06 - -6.1448207011E-07 -1.0876324063E-07 9.0543951786E-08 8.6861537626E-08 - 2.6499782029E-09 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 - - - 0.0000000000E+00 -2.5499846128E-02 -5.0963631551E-02 -7.6355278930E-02 - -1.0163867803E-01 -1.2677767022E-01 -1.5173603410E-01 -1.7647747261E-01 - -2.0096560203E-01 -2.2516394317E-01 -2.4903591511E-01 -2.7254483189E-01 - -2.9565390231E-01 -3.1832623334E-01 -3.4052483735E-01 -3.6221264334E-01 - -3.8335251258E-01 -4.0390725883E-01 -4.2383967332E-01 -4.4311255476E-01 - -4.6168874444E-01 -4.7953116669E-01 -4.9660287473E-01 -5.1286710199E-01 - -5.2828731901E-01 -5.4282729593E-01 -5.5645117060E-01 -5.6912352219E-01 - -5.8080945024E-01 -5.9147465915E-01 -6.0108554800E-01 -6.0960930534E-01 - -6.1701400875E-01 -6.2326872873E-01 -6.2834363913E-01 -6.3221012613E-01 - -6.3484090962E-01 -6.3621015814E-01 -6.3629361305E-01 -6.3506871510E-01 - -6.3251472853E-01 -6.2861287012E-01 -6.2334643796E-01 -6.1670094052E-01 - -6.0866422512E-01 -5.9922660535E-01 -5.8838098663E-01 -5.7612298909E-01 - -5.6245106515E-01 -5.4736661636E-01 -5.3087411047E-01 -5.1298117723E-01 - -4.9369869916E-01 -4.7304093336E-01 -4.5102555728E-01 -4.2767376444E-01 - -4.0301032570E-01 -3.7706362942E-01 -3.4986574285E-01 -3.2145242097E-01 - -2.9186313188E-01 -2.6114106556E-01 -2.2933308765E-01 -1.9648976164E-01 - -1.6266525856E-01 -1.2791730544E-01 -9.2307124587E-02 -5.5899311402E-02 - -1.8761727170E-02 1.9034634393E-02 5.7415808473E-02 9.6305030940E-02 - 1.3562293197E-01 1.7528774423E-01 2.1521554118E-01 2.5532050734E-01 - 2.9551518735E-01 3.3571078458E-01 3.7581747060E-01 4.1574471215E-01 - 4.5540161494E-01 4.9469728327E-01 5.3354119431E-01 5.7184358574E-01 - 6.0951585551E-01 6.4647097188E-01 6.8262389228E-01 7.1789198884E-01 - 7.5219547875E-01 7.8545785698E-01 8.1760632906E-01 8.4857224113E-01 - 8.7829150456E-01 9.0670501185E-01 9.3375904074E-01 9.5940564292E-01 - 9.8360301384E-01 1.0063156411E+00 1.0275151786E+00 1.0471803022E+00 - 1.0652970378E+00 1.0818590107E+00 1.0968676219E+00 1.1103320100E+00 - 1.1222694618E+00 1.1327056016E+00 1.1416738466E+00 1.1492155073E+00 - 1.1553794409E+00 1.1602223039E+00 1.1638081688E+00 1.1662076632E+00 - 1.1674976628E+00 1.1677609339E+00 1.1670855043E+00 1.1655634179E+00 - 1.1632903010E+00 1.1603644915E+00 1.1568850242E+00 1.1529510633E+00 - 1.1486621370E+00 1.1441127675E+00 1.1393934173E+00 1.1345907714E+00 - 1.1297814738E+00 1.1250306703E+00 1.1203954935E+00 1.1159162834E+00 - 1.1116127680E+00 1.1074927451E+00 1.1035362725E+00 1.0996938818E+00 - 1.0959012846E+00 1.0920455902E+00 1.0879988385E+00 1.0836105505E+00 - 1.0787357826E+00 1.0732335554E+00 1.0669727659E+00 1.0598494096E+00 - 1.0517600455E+00 1.0426432692E+00 1.0324442831E+00 1.0211309106E+00 - 1.0086974564E+00 9.9513941686E-01 9.8048565811E-01 9.6476298028E-01 - 9.4801679818E-01 9.3029765691E-01 9.1166312028E-01 8.9217700415E-01 - 8.7190551339E-01 8.5091810388E-01 8.2928600217E-01 8.0708019407E-01 - 7.8437291255E-01 7.6123503195E-01 7.3773682848E-01 7.1394785394E-01 - 6.8993469226E-01 6.6576460714E-01 6.4149956841E-01 6.1720376331E-01 - 5.9293411021E-01 5.6875106784E-01 5.4470633307E-01 5.2085608675E-01 - 4.9724677659E-01 4.7392982827E-01 4.5094649337E-01 4.2834301168E-01 - 4.0615554838E-01 3.8442475541E-01 3.6318187258E-01 3.4246158365E-01 - 3.2229041408E-01 3.0269672724E-01 2.8370258812E-01 2.6532973765E-01 - 2.4759605771E-01 2.3051645396E-01 2.1410489041E-01 1.9836936853E-01 - 1.8332013731E-01 1.6895843397E-01 1.5529087448E-01 1.4231303001E-01 - 1.3002573509E-01 1.1842164378E-01 1.0749494628E-01 9.7236030275E-02 - 8.7632867669E-02 7.8673622274E-02 7.0341038628E-02 6.2620696294E-02 - 5.5491976604E-02 4.8936078440E-02 4.2931388291E-02 3.7455225566E-02 - 3.2484559702E-02 2.7994596392E-02 2.3960159627E-02 2.0355841281E-02 - 1.7154989586E-02 1.4331325306E-02 1.1858828622E-02 9.7091684407E-03 - 7.8581651254E-03 6.2779355258E-03 4.9436416616E-03 3.8313730451E-03 - 2.9136122090E-03 2.1710092204E-03 1.5784495142E-03 1.1155195012E-03 - 7.6470967044E-04 5.0175154346E-04 3.1554414334E-04 1.8801461325E-04 - 1.0414480240E-04 5.5955438871E-05 2.7570255813E-05 1.4588279462E-05 - 1.1186579074E-05 7.6842075616E-06 6.7823719599E-06 5.5465121341E-06 - 2.8487720314E-06 5.2111264156E-07 -3.9464775839E-07 -3.7859747049E-07 - -1.1550279582E-08 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 - - - 0.0000000000E+00 7.8689664316E-04 3.1454849895E-03 7.0694669237E-03 - 1.2548367677E-02 1.9567568879E-02 2.8108354660E-02 3.8147970645E-02 - 4.9659695613E-02 6.2612925578E-02 7.6973269978E-02 9.2702659630E-02 - 1.0975946606E-01 1.2809863177E-01 1.4767181101E-01 1.6842752051E-01 - 1.9031129964E-01 2.1326587945E-01 2.3723135997E-01 2.6214539514E-01 - 2.8794338475E-01 3.1455867261E-01 3.4192275042E-01 3.6996546645E-01 - 3.9861523844E-01 4.2779926988E-01 4.5744376898E-01 4.8747416961E-01 - 5.1781535324E-01 5.4839187151E-01 5.7912816823E-01 6.0994880048E-01 - 6.4077865766E-01 6.7154317807E-01 7.0216856249E-01 7.3258198299E-01 - 7.6271178818E-01 7.9248770211E-01 8.2184101791E-01 8.5070478462E-01 - 8.7901398683E-01 9.0670571683E-01 9.3371933847E-01 9.5999664233E-01 - 9.8548199181E-01 1.0101224597E+00 1.0338679546E+00 1.0566713378E+00 - 1.0784885294E+00 1.0992786034E+00 1.1190038697E+00 1.1376299494E+00 - 1.1551258416E+00 1.1714639587E+00 1.1866201832E+00 1.2005738845E+00 - 1.2133079353E+00 1.2248087257E+00 1.2350661417E+00 1.2440735637E+00 - 1.2518278296E+00 1.2583291864E+00 1.2635812831E+00 1.2675910394E+00 - 1.2703686393E+00 1.2719274506E+00 1.2722838762E+00 1.2714573200E+00 - 1.2694700760E+00 1.2663471931E+00 1.2621163473E+00 1.2568077467E+00 - 1.2504539862E+00 1.2430899169E+00 1.2347524899E+00 1.2254805888E+00 - 1.2153149129E+00 1.2042978062E+00 1.1924730970E+00 1.1798859351E+00 - 1.1665826263E+00 1.1526104660E+00 1.1380175710E+00 1.1228527110E+00 - 1.1071651403E+00 1.0910044287E+00 1.0744202947E+00 1.0574624389E+00 - 1.0401803793E+00 1.0226232893E+00 1.0048398376E+00 9.8687803142E-01 - 9.6878506336E-01 9.5060716146E-01 9.3238944395E-01 9.1417577821E-01 - 8.9600864463E-01 8.7792905115E-01 8.5997627535E-01 8.4218785507E-01 - 8.2459945446E-01 8.0724474863E-01 7.9015532164E-01 7.7336060159E-01 - 7.5688770713E-01 7.4076134353E-01 7.2500381942E-01 7.0963493956E-01 - 6.9467197272E-01 6.8012951658E-01 6.6601946395E-01 6.5235103708E-01 - 6.3913072735E-01 6.2636224631E-01 6.1404647327E-01 6.0218153886E-01 - 5.9076277341E-01 5.7978268777E-01 5.6923105865E-01 5.5909492331E-01 - 5.4935849547E-01 5.4000346162E-01 5.3100887326E-01 5.2235106392E-01 - 5.1400401562E-01 5.0593939456E-01 4.9812626716E-01 4.9053163402E-01 - 4.8312060787E-01 4.7585581537E-01 4.6869837210E-01 4.6160789286E-01 - 4.5454157451E-01 4.4745597594E-01 4.4030887064E-01 4.3305602914E-01 - 4.2566460975E-01 4.1810242870E-01 4.1034448118E-01 4.0237407184E-01 - 3.9417513629E-01 3.8574261721E-01 3.7707221321E-01 3.6816483782E-01 - 3.5902563915E-01 3.4966050609E-01 3.4007990559E-01 3.3029423687E-01 - 3.2031613648E-01 3.1015868738E-01 2.9983597276E-01 2.8936208558E-01 - 2.7875202936E-01 2.6802009448E-01 2.5718149261E-01 2.4625064086E-01 - 2.3524250402E-01 2.2417155048E-01 2.1305234144E-01 2.0189931952E-01 - 1.9072662047E-01 1.7954859797E-01 1.6837898447E-01 1.5723198741E-01 - 1.4612095857E-01 1.3505990101E-01 1.2406179107E-01 1.1314036280E-01 - 1.0230820196E-01 9.1578698050E-02 8.0964015123E-02 7.0477109117E-02 - 6.0129682155E-02 4.9934153222E-02 3.9901720205E-02 3.0044148296E-02 - 2.0372092226E-02 1.0896535872E-02 1.6275583313E-03 -7.4247710965E-03 - -1.6250975081E-02 -2.4842030413E-02 -3.3189085010E-02 -4.1284281300E-02 - -4.9119420596E-02 -5.6687905791E-02 -6.3982234773E-02 -7.0996992492E-02 - -7.7725846191E-02 -8.4164147947E-02 -9.0307021902E-02 -9.6150511095E-02 - -1.0169127425E-01 -1.0692606621E-01 -1.1185306063E-01 -1.1646982177E-01 - -1.2077576795E-01 -1.2476987675E-01 -1.2845224096E-01 -1.3182339508E-01 - -1.3488416376E-01 -1.3763646539E-01 -1.4008207629E-01 -1.4222393722E-01 - -1.4406512629E-01 -1.4560930382E-01 -1.4686074397E-01 -1.4782401128E-01 - -1.4850427703E-01 -1.4890714395E-01 -1.4903856659E-01 -1.4890492508E-01 - -1.4851321313E-01 -1.4787033758E-01 -1.4698406464E-01 -1.4586217040E-01 - -1.4451259796E-01 -1.4294442162E-01 -1.4116568778E-01 -1.3918568305E-01 - -1.3701372423E-01 -1.3465862889E-01 -1.3213076264E-01 -1.2943918116E-01 - -1.2659359926E-01 -1.2360484373E-01 -1.2048175512E-01 -1.1723500505E-01 - -1.1387480839E-01 -1.1041034939E-01 -1.0685287514E-01 -1.0321162700E-01 - -9.9496051548E-02 -9.5717741016E-02 -9.1884720206E-02 -8.8006899164E-02 - -8.4094973959E-02 -8.0156599487E-02 -7.6201678966E-02 -7.2239679929E-02 - -6.8277905197E-02 -6.4325987090E-02 -6.0392061807E-02 -5.6482945729E-02 - -5.2607776635E-02 -4.8773342055E-02 -4.4985824952E-02 -4.1253654652E-02 - -3.7582321167E-02 -3.3977226624E-02 -3.0445897204E-02 -2.6992628159E-02 - -2.3621905154E-02 -2.0340182893E-02 -1.7150699592E-02 -1.4056912238E-02 - -1.1064068087E-02 -8.1745036098E-03 -5.3905691228E-03 -2.7162071242E-03 - -1.5300574375E-04 2.2978251543E-03 4.6336987090E-03 6.8536457700E-03 - 8.9575776284E-03 1.0944258005E-02 1.2813255266E-02 1.4565522669E-02 - 1.6201103373E-02 1.7720091913E-02 1.9124341510E-02 2.0415029515E-02 - 2.1592850071E-02 2.2660355075E-02 2.3619538415E-02 2.4472139642E-02 - 2.5220873974E-02 2.5868469868E-02 2.6417599773E-02 2.6871204813E-02 - 2.7232489610E-02 2.7504736033E-02 2.7691408444E-02 2.7795853393E-02 - 2.7821662379E-02 2.7772915036E-02 2.7653031836E-02 2.7465693716E-02 - 2.7215100029E-02 2.6905285129E-02 2.6539602582E-02 2.6121967073E-02 - 2.5657327251E-02 2.5148538347E-02 2.4599330573E-02 2.4014169150E-02 - 2.3396913842E-02 2.2750425333E-02 2.2078328798E-02 2.1385602467E-02 - 2.0674341995E-02 1.9947678250E-02 1.9209481011E-02 1.8463397283E-02 - 1.7711221562E-02 1.6955804200E-02 1.6201213181E-02 1.5449238255E-02 - 1.4701752242E-02 1.3961229026E-02 1.3231393287E-02 1.2512590200E-02 - 1.1806616800E-02 1.1115859670E-02 1.0442401139E-02 9.7865046746E-03 - 9.1494239439E-03 8.5332760049E-03 7.9387373364E-03 7.3659625001E-03 - 6.8156689090E-03 6.2895328596E-03 5.7871851830E-03 5.3086138841E-03 - 4.8540379184E-03 4.4245632121E-03 4.0191780084E-03 3.6376474493E-03 - 3.2798096638E-03 2.9459728619E-03 2.6350196381E-03 2.3464098185E-03 - 2.0796363904E-03 1.8343618101E-03 1.6095149398E-03 1.4043138594E-03 - 1.2179638690E-03 1.0496804426E-03 8.9850551883E-04 7.6351988791E-04 - 6.4375088891E-04 5.3809002421E-04 4.4577524737E-04 3.6585211833E-04 - 2.9731727687E-04 2.3879084297E-04 1.8979225833E-04 1.4942270281E-04 - 1.1675960049E-04 9.0307189055E-05 6.9787452965E-05 5.4476506959E-05 - 4.3583168954E-05 3.6476658981E-05 3.2149854062E-05 2.9603414592E-05 - 2.7878590677E-05 2.3699218774E-05 1.6944121547E-05 1.0219571001E-05 - 4.0280730137E-06 -4.8429645228E-07 -1.6699852801E-06 -1.7757868061E-06 - -1.1375782949E-06 -9.8926485858E-08 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 - - - 0.0000000000E+00 1.0819359206E-03 4.3213968368E-03 9.6993737685E-03 - 1.7184290121E-02 2.6732158724E-02 3.8286800643E-02 5.1780124740E-02 - 6.7132466654E-02 8.4252985604E-02 1.0304011714E-01 1.2338207973E-01 - 1.4515743270E-01 1.6823568304E-01 1.9247793806E-01 2.1773760090E-01 - 2.4386110561E-01 2.7068868820E-01 2.9805519018E-01 3.2579089076E-01 - 3.5372236353E-01 3.8167335396E-01 4.0946567319E-01 4.3692010412E-01 - 4.6385731528E-01 4.9009877838E-01 5.1546768498E-01 5.3978985805E-01 - 5.6289465375E-01 5.8461584970E-01 6.0479251498E-01 6.2326985788E-01 - 6.3990004724E-01 6.5454300371E-01 6.6706715647E-01 6.7735016327E-01 - 6.8527958662E-01 6.9075352903E-01 6.9368121818E-01 6.9398354001E-01 - 6.9159352255E-01 6.8645676125E-01 6.7853178687E-01 6.6779037366E-01 - 6.5421778592E-01 6.3781296170E-01 6.1858863247E-01 5.9657137806E-01 - 5.7180162208E-01 5.4433355421E-01 5.1423496910E-01 4.8158708445E-01 - 4.4648430238E-01 4.0903376687E-01 3.6935509660E-01 3.2757985241E-01 - 2.8385102185E-01 2.3832251237E-01 1.9115841909E-01 1.4253245422E-01 - 9.2627162495E-02 4.1633085624E-02 -1.0251790878E-02 -6.2823336834E-02 - -1.1587178320E-01 -1.6918266866E-01 -2.2253814257E-01 -2.7571757857E-01 - -3.2849861507E-01 -3.8065829197E-01 -4.3197411535E-01 -4.8222491420E-01 - -5.3119194130E-01 -5.7865986305E-01 -6.2441784604E-01 -6.6826065185E-01 - -7.0998945596E-01 -7.4941289319E-01 -7.8634800943E-01 -8.2062118418E-01 - -8.5206902001E-01 -8.8053919470E-01 -9.0589127236E-01 -9.2799746951E-01 - -9.4674337264E-01 -9.6202860373E-01 -9.7376743021E-01 -9.8188931632E-01 - -9.8633941271E-01 -9.8707898141E-01 -9.8408575345E-01 -9.7735421673E-01 - -9.6689583184E-01 -9.5273917380E-01 -9.3492999829E-01 -9.1353123085E-01 - -8.8862287835E-01 -8.6030193315E-01 -8.2868199446E-01 -7.9389297780E-01 - -7.5608071324E-01 -7.1540644359E-01 -6.7204625099E-01 -6.2619061876E-01 - -5.7804343671E-01 -5.2782076140E-01 -4.7575053184E-01 -4.2207139301E-01 - -3.6703221026E-01 -3.1088999895E-01 -2.5390812020E-01 -1.9635635064E-01 - -1.3850955034E-01 -8.0646487963E-02 -2.3044542245E-02 3.4017714934E-02 - 9.0261996456E-02 1.4541413457E-01 1.9920831009E-01 2.5138425644E-01 - 3.0168655497E-01 3.4987916939E-01 3.9573691954E-01 4.3904553823E-01 - 4.7961427227E-01 5.1727419219E-01 5.5187202935E-01 5.8328462909E-01 - 6.1142066997E-01 6.3620895529E-01 6.5761931988E-01 6.7566088493E-01 - 6.9036700920E-01 7.0183094593E-01 7.1016929319E-01 7.1553181715E-01 - 7.1807015343E-01 7.1794179320E-01 7.1530231392E-01 7.1028763988E-01 - 7.0304223439E-01 6.9367458816E-01 6.8229508316E-01 6.6899824944E-01 - 6.5385916840E-01 6.3695886974E-01 6.1835124797E-01 5.9809900519E-01 - 5.7625224766E-01 5.5286168663E-01 5.2797714783E-01 5.0164627897E-01 - 4.7392125748E-01 4.4485281725E-01 4.1449700824E-01 3.8291115436E-01 - 3.5015689988E-01 3.1629875773E-01 2.8140479300E-01 2.4554664940E-01 - 2.0879850712E-01 1.7123868072E-01 1.3294648394E-01 9.4006109867E-02 - 5.4500719404E-02 1.4519321051E-02 -2.5852429674E-02 -6.6521981192E-02 - -1.0740246310E-01 -1.4839920512E-01 -1.8942525395E-01 -2.3038534935E-01 - -2.7119340185E-01 -3.1175515658E-01 -3.5198613429E-01 -3.9179471585E-01 - -4.3109858039E-01 -4.6981037671E-01 -5.0785031236E-01 -5.4513689518E-01 - -5.8159309491E-01 -6.1714476801E-01 -6.5171781084E-01 -6.8524673378E-01 - -7.1766054837E-01 -7.4890343463E-01 -7.7890784764E-01 -8.0762677081E-01 - -8.3500111127E-01 -8.6098809257E-01 -8.8554019013E-01 -9.0861788311E-01 - -9.3018616071E-01 -9.5020877843E-01 -9.6866322827E-01 -9.8551737033E-01 - -1.0007583031E+00 -1.0143650417E+00 -1.0263275266E+00 -1.0366380773E+00 - -1.0452897067E+00 -1.0522866929E+00 -1.0576274300E+00 -1.0613239199E+00 - -1.0633854793E+00 -1.0638268824E+00 -1.0626686745E+00 -1.0599296910E+00 - -1.0556384234E+00 -1.0498221200E+00 -1.0425128258E+00 -1.0337461541E+00 - -1.0235589473E+00 -1.0119923612E+00 -9.9908969762E-01 -9.8489627707E-01 - -9.6945964427E-01 -9.5283164494E-01 -9.3506215486E-01 -9.1620635286E-01 - -8.9632025854E-01 -8.7545856553E-01 -8.5368350296E-01 -8.3105150494E-01 - -8.0762265517E-01 -7.8346299282E-01 -7.5862848445E-01 -7.3318506111E-01 - -7.0719626807E-01 -6.8072010094E-01 -6.5382629676E-01 -6.2657311189E-01 - -5.9902002658E-01 -5.7123913698E-01 -5.4328139913E-01 -5.1520895376E-01 - -4.8708862873E-01 -4.5896877673E-01 -4.3091136124E-01 -4.0297556530E-01 - -3.7520714821E-01 -3.4766617984E-01 -3.2040328376E-01 -2.9346073420E-01 - -2.6689521180E-01 -2.4074847999E-01 -2.1505835866E-01 -1.8987669769E-01 - -1.6523660432E-01 -1.4117047538E-01 -1.1772401308E-01 -9.4922260567E-02 - -7.2791306047E-02 -5.1369567408E-02 -3.0674883768E-02 -1.0726313654E-02 - 8.4459182774E-03 2.6830176780E-02 4.4414912749E-02 6.1178726707E-02 - 7.7115190271E-02 9.2220430874E-02 1.0648217092E-01 1.1989835623E-01 - 1.3247258272E-01 1.4420158738E-01 1.5508719254E-01 1.6513983297E-01 - 1.7436467814E-01 1.8276741874E-01 1.9036426093E-01 1.9716769779E-01 - 2.0318786574E-01 2.0844526804E-01 2.1295765034E-01 2.1674201622E-01 - 2.1982011290E-01 2.2221414601E-01 2.2394687775E-01 2.2504204140E-01 - 2.2552435189E-01 2.2541994389E-01 2.2475669296E-01 2.2355944422E-01 - 2.2185575066E-01 2.1967757514E-01 2.1705012946E-01 2.1400081446E-01 - 2.1056139169E-01 2.0676200599E-01 2.0262674581E-01 1.9818432655E-01 - 1.9347172309E-01 1.8850876157E-01 1.8332223328E-01 1.7794460011E-01 - 1.7240346002E-01 1.6671845698E-01 1.6091511955E-01 1.5502924089E-01 - 1.4907444646E-01 1.4307219091E-01 1.3704940698E-01 1.3103127027E-01 - 1.2502896654E-01 1.1906151939E-01 1.1315684793E-01 1.0732600449E-01 - 1.0158057467E-01 9.5936479894E-02 9.0418614113E-02 8.5027359818E-02 - 7.9773524791E-02 7.4672020229E-02 6.9735535696E-02 6.4963821259E-02 - 6.0363563601E-02 5.5947324659E-02 5.1717686638E-02 4.7673573081E-02 - 4.3817712959E-02 4.0159108076E-02 3.6693171723E-02 3.3417611204E-02 - 3.0331592851E-02 2.7439699166E-02 2.4733343280E-02 2.2208672490E-02 - 1.9862171831E-02 1.7692777030E-02 1.5691652648E-02 1.3852990287E-02 - 1.2170962695E-02 1.0640179456E-02 9.2526598582E-03 8.0012591530E-03 - 6.8784359580E-03 5.8759418251E-03 4.9872643035E-03 4.2047925780E-03 - 3.5202708014E-03 2.9234428052E-03 2.4099988923E-03 1.9727011227E-03 - 1.6038559756E-03 1.2914976270E-03 1.0342565986E-03 8.2600646278E-04 - 6.6046203043E-04 5.2544829096E-04 4.2158434729E-04 3.4492901606E-04 - 2.9093082723E-04 2.5592791361E-04 2.3416159170E-04 2.1991358634E-04 - 2.0768854321E-04 1.7693021525E-04 1.2762902492E-04 7.7540325051E-05 - 3.0749107451E-05 -3.5959949057E-06 -1.2399963972E-05 -1.3185560783E-05 - -8.4467390465E-06 -7.3454830717E-07 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 - - - 1.3407893002E+01 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 8.2017334117E-01 0.0000000000E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 5.4916098536E+00 0.0000000000E+00 - 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 5.9649632002E-01 - - - - - - 0.0000000000E+00 2.5419674474E-06 1.0239117766E-05 2.3305314630E-05 - 4.2097395025E-05 6.7115759737E-05 9.9005188437E-05 1.3855586792E-04 - 1.8670461894E-04 2.4453630403E-04 3.1328539613E-04 3.9433768476E-04 - 4.8923209454E-04 5.9966258825E-04 7.2748012474E-04 8.7469464048E-04 - 1.0434770217E-03 1.2361610330E-03 1.4552451679E-03 1.7033943852E-03 - 1.9834416956E-03 2.2983895623E-03 2.6514110803E-03 3.0458508989E-03 - 3.4852258532E-03 3.9732252714E-03 4.5137109246E-03 5.1107165905E-03 - 5.7684472025E-03 6.4912775550E-03 7.2837505409E-03 8.1505749004E-03 - 9.0966224631E-03 1.0126924871E-02 1.1246669709E-02 1.2461196207E-02 - 1.3775990182E-02 1.5196678628E-02 1.6729023593E-02 1.8378915477E-02 - 2.0152365858E-02 2.2055499672E-02 2.4094546852E-02 2.6275833413E-02 - 2.8605772000E-02 3.1090851913E-02 3.3737628615E-02 3.6552712759E-02 - 3.9542758814E-02 4.2714453133E-02 4.6074501405E-02 4.9629616250E-02 - 5.3386504438E-02 5.7351852299E-02 6.1532313366E-02 6.5934493520E-02 - 7.0564936756E-02 7.5430111266E-02 8.0536393800E-02 8.5890055767E-02 - 9.1497247769E-02 9.7363984045E-02 1.0349612943E-01 1.0989938077E-01 - 1.1657925479E-01 1.2354107271E-01 1.3078994280E-01 1.3833074809E-01 - 1.4616813119E-01 1.5430647894E-01 1.6274990792E-01 1.7150225136E-01 - 1.8056704495E-01 1.8994751351E-01 1.9964655756E-01 2.0966674031E-01 - 2.2001027610E-01 2.3067901833E-01 2.4167444803E-01 2.5299766310E-01 - 2.6464936803E-01 2.7662986427E-01 2.8893904119E-01 3.0157636773E-01 - 3.1454088472E-01 3.2783119795E-01 3.4144547200E-01 3.5538142481E-01 - 3.6963632313E-01 3.8420697881E-01 3.9908974591E-01 4.1428051878E-01 - 4.2977473104E-01 4.4556735548E-01 4.6165290501E-01 4.7802543446E-01 - 4.9467854349E-01 5.1160537712E-01 5.2879863905E-01 5.4625059162E-01 - 5.6395306353E-01 5.8189745835E-01 6.0007476350E-01 6.1847555543E-01 - 6.3709001774E-01 6.5590796096E-01 6.7491882146E-01 6.9411168042E-01 - 7.1347526836E-01 7.3299799955E-01 7.5266799746E-01 7.7247308731E-01 - 7.9240081527E-01 8.1243846459E-01 8.3257313677E-01 8.5279170184E-01 - 8.7308081911E-01 8.9342699339E-01 9.1381663144E-01 9.3423599263E-01 - 9.5467117730E-01 9.7510833180E-01 9.9553351413E-01 1.0159326940E+00 - 1.0362919213E+00 1.0565972888E+00 1.0768348472E+00 1.0969907892E+00 - 1.1170514532E+00 1.1370031748E+00 1.1568325360E+00 1.1765263198E+00 - 1.1960713391E+00 1.2154548101E+00 1.2346641303E+00 1.2536867995E+00 - 1.2725108686E+00 1.2911244698E+00 1.3095160984E+00 1.3276746963E+00 - 1.3455893033E+00 1.3632496056E+00 1.3806454769E+00 1.3977671986E+00 - 1.4146055850E+00 1.4311515877E+00 1.4473969084E+00 1.4633334020E+00 - 1.4789535055E+00 1.4942500540E+00 1.5092162591E+00 1.5238459259E+00 - 1.5381330827E+00 1.5520724561E+00 1.5656589889E+00 1.5788882391E+00 - 1.5917560813E+00 1.6042589027E+00 1.6163934742E+00 1.6281570149E+00 - 1.6395471445E+00 1.6505619077E+00 1.6611997214E+00 1.6714594392E+00 - 1.6813402211E+00 1.6908417031E+00 1.6999637345E+00 1.7087066956E+00 - 1.7170710738E+00 1.7250579458E+00 1.7326683887E+00 1.7399041178E+00 - 1.7467667578E+00 1.7532585947E+00 1.7593817655E+00 1.7651390496E+00 - 1.7705330700E+00 1.7755670135E+00 1.7802439720E+00 1.7845674460E+00 - 1.7885409886E+00 1.7921683156E+00 1.7954534405E+00 1.7984001956E+00 - 1.8010130561E+00 1.8032958796E+00 1.8052535989E+00 1.8068901248E+00 - 1.8082105198E+00 1.8092190408E+00 1.8099206382E+00 1.8103200034E+00 - 1.8104218535E+00 1.8102313454E+00 1.8097528950E+00 1.8089920997E+00 - 1.8079532572E+00 1.8066417875E+00 1.8050624593E+00 1.8032202360E+00 - 1.8011204053E+00 1.7987674731E+00 1.7961670773E+00 1.7933236344E+00 - 1.7902424184E+00 1.7869284021E+00 1.7833862367E+00 1.7796214581E+00 - 1.7756383569E+00 1.7714422334E+00 1.7670378524E+00 1.7624298518E+00 - 1.7576236021E+00 1.7526233195E+00 1.7474341449E+00 1.7420607613E+00 - 1.7365076062E+00 1.7307799865E+00 1.7248819575E+00 1.7188183898E+00 - 1.7125940001E+00 1.7062129768E+00 1.6996803139E+00 1.6930001663E+00 - 1.6861769223E+00 1.6792154193E+00 1.6721195159E+00 1.6648937853E+00 - 1.6575425742E+00 1.6500697812E+00 1.6424799935E+00 1.6347770993E+00 - 1.6269650210E+00 1.6190483015E+00 1.6110304263E+00 1.6029153974E+00 - 1.5947074105E+00 1.5864098616E+00 1.5780266990E+00 1.5695617637E+00 - 1.5610183858E+00 1.5524004121E+00 1.5437113690E+00 1.5349544997E+00 - 1.5261335186E+00 1.5172516787E+00 1.5083121141E+00 1.4993183815E+00 - 1.4902735001E+00 1.4811804737E+00 1.4720426810E+00 1.4628629433E+00 - 1.4536441158E+00 1.4443893832E+00 1.4351014005E+00 1.4257828593E+00 - 1.4164367389E+00 1.4070655546E+00 1.3976718233E+00 1.3882583110E+00 - 1.3788274147E+00 1.3693814702E+00 1.3599230261E+00 1.3504543760E+00 - 1.3409776734E+00 1.3314952490E+00 1.3220093016E+00 1.3125218054E+00 - 1.3030348777E+00 1.2935506227E+00 1.2840708442E+00 1.2745974555E+00 - 1.2651324575E+00 1.2556774970E+00 1.2462343219E+00 1.2368047427E+00 - 1.2273903367E+00 1.2179926786E+00 1.2086133794E+00 1.1992539510E+00 - 1.1899158094E+00 1.1806003873E+00 1.1713091011E+00 1.1620432336E+00 - 1.1528040728E+00 1.1435928870E+00 1.1344108671E+00 1.1252591714E+00 - 1.1161389197E+00 1.1070511954E+00 1.0979970512E+00 1.0889774933E+00 - 1.0799934504E+00 1.0710458968E+00 1.0621357345E+00 1.0532637879E+00 - 1.0444308788E+00 1.0356378487E+00 1.0268854572E+00 1.0181743308E+00 - 1.0095052623E+00 1.0008789329E+00 9.9229592528E-01 9.8375680248E-01 - 9.7526224410E-01 9.6681280159E-01 9.5840886795E-01 9.5005102008E-01 - 9.4173978657E-01 9.3347559466E-01 9.2525868745E-01 9.1708965586E-01 - 9.0896888248E-01 9.0089662812E-01 8.9287315362E-01 8.8489892670E-01 - 8.7697423681E-01 8.6909918643E-01 8.6127407599E-01 8.5349924965E-01 - 8.4577491323E-01 8.3810102415E-01 8.3047793044E-01 8.2290585874E-01 - 8.1538494061E-01 8.0791500503E-01 8.0049644445E-01 7.9312937940E-01 - 7.8581385326E-01 7.7854965407E-01 7.7133713787E-01 7.6417635765E-01 - 7.5706727817E-01 7.5000966357E-01 7.4300381728E-01 7.3604974264E-01 - 7.2914734777E-01 7.2229635206E-01 7.1549702307E-01 7.0874932178E-01 - 7.0205312346E-01 6.9540807583E-01 6.8881442916E-01 6.8227210864E-01 - 6.7578098175E-01 6.6934059354E-01 6.6295119600E-01 6.5661268454E-01 - 6.5032491613E-01 6.4408738499E-01 6.3790027838E-01 6.3176349531E-01 - 6.2567686953E-01 6.1963992609E-01 6.1365268971E-01 6.0771510530E-01 - 6.0182698789E-01 5.9598792208E-01 5.9019772528E-01 5.8445641120E-01 - 5.7876378019E-01 5.7311950540E-01 5.6752315326E-01 5.6197482752E-01 - 5.5647431798E-01 5.5102138141E-01 5.4561539761E-01 5.4025647334E-01 - 5.3494442631E-01 5.2967900833E-01 5.2445973140E-01 5.1928636757E-01 - 5.1415888005E-01 5.0907701922E-01 5.0404046623E-01 4.9904861172E-01 - 4.9410157954E-01 4.8919912174E-01 4.8434096157E-01 4.7952655114E-01 - 4.7475570907E-01 4.7002834677E-01 4.6534419342E-01 4.6070292249E-01 - 4.5610388085E-01 4.5154718889E-01 4.4703258403E-01 4.4255977762E-01 - 4.3812826431E-01 4.3373773250E-01 4.2938813847E-01 4.2507920521E-01 - 4.2081063093E-01 4.1658176439E-01 4.1239259327E-01 4.0824292445E-01 - 4.0413247076E-01 4.0006087390E-01 3.9602751376E-01 3.9203248096E-01 - 3.8807550411E-01 3.8415628971E-01 3.8027438007E-01 3.7642935839E-01 - 3.7262122176E-01 3.6884969468E-01 3.6511448074E-01 3.6141505150E-01 - 3.5775114608E-01 3.5412268939E-01 3.5052940491E-01 3.4697099635E-01 - 3.4344689227E-01 3.3995693768E-01 3.3650100942E-01 3.3307883263E-01 - 3.2969011384E-01 3.2633426489E-01 3.2301118654E-01 3.1972073255E-01 - 3.1646263208E-01 3.1323659677E-01 3.1004204670E-01 3.0687888928E-01 - 3.0374697998E-01 3.0064605396E-01 2.9757582994E-01 2.9453576024E-01 - 2.9152571124E-01 2.8854556401E-01 2.8559506139E-01 2.8267393087E-01 - 2.7978168026E-01 2.7691808918E-01 2.7408308660E-01 2.7127642447E-01 - 2.6849784036E-01 2.6574692033E-01 2.6302331400E-01 2.6032701841E-01 - 2.5765779571E-01 2.5501539464E-01 2.5239950107E-01 2.4980959577E-01 - 2.4724576061E-01 2.4470776882E-01 2.4219538115E-01 2.3970834578E-01 - 2.3724611307E-01 2.3480869149E-01 2.3239592265E-01 2.3000757992E-01 - 2.2764342496E-01 2.2530304881E-01 2.2298619982E-01 2.2069285226E-01 - 2.1842279247E-01 2.1617579596E-01 2.1395161399E-01 2.1174970662E-01 - 2.0957018865E-01 2.0741285965E-01 2.0527750910E-01 2.0316391640E-01 - 2.0107167680E-01 1.9900060876E-01 1.9695066995E-01 1.9492166386E-01 - 1.9291338464E-01 1.9092561701E-01 1.8895783701E-01 1.8701015968E-01 - 1.8508240762E-01 1.8317438957E-01 1.8128590557E-01 1.7941663962E-01 - 1.7756630605E-01 1.7573492767E-01 1.7392232749E-01 1.7212832053E-01 - 1.7035271371E-01 1.6859511444E-01 1.6685543737E-01 1.6513361867E-01 - 1.6342948789E-01 1.6174286711E-01 1.6007357096E-01 1.5842115760E-01 - 1.5678568794E-01 1.5516703519E-01 1.5356503607E-01 1.5197952041E-01 - 1.5041029418E-01 1.4885694140E-01 1.4731956763E-01 1.4579802359E-01 - 1.4429215368E-01 1.4280179595E-01 1.4132674017E-01 1.3986664113E-01 - 1.3842157919E-01 1.3699141261E-01 1.3557599384E-01 1.3417516943E-01 - 1.3278873315E-01 1.3141636920E-01 1.3005815123E-01 1.2871394529E-01 - 1.2738361207E-01 1.2606700683E-01 1.2476394550E-01 1.2347410398E-01 - 1.2219756623E-01 1.2093420620E-01 1.1968389293E-01 1.1844649046E-01 - 1.1722185305E-01 1.1600961490E-01 1.1480988514E-01 1.1362254567E-01 - 1.1244747386E-01 1.1128454252E-01 1.1013361985E-01 1.0899438532E-01 - 1.0786687001E-01 1.0675100218E-01 1.0564666745E-01 1.0455374727E-01 - 1.0347211885E-01 1.0240153438E-01 1.0134190575E-01 1.0029322413E-01 - 9.9255383231E-02 9.8228272939E-02 9.7211779280E-02 9.6205738671E-02 - 9.5209921903E-02 9.4224391716E-02 9.3249049703E-02 9.2283793952E-02 - 9.1328519020E-02 9.0383115919E-02 8.9447315106E-02 8.8521139658E-02 - 8.7604537370E-02 8.6697414241E-02 8.5799673049E-02 8.4911213329E-02 - 8.4031872982E-02 8.3161481377E-02 8.2300083224E-02 8.1447592112E-02 - 8.0603918686E-02 7.9768970636E-02 7.8942652678E-02 7.8124734992E-02 - 7.7315217146E-02 7.6514067040E-02 7.5721202817E-02 7.4936539921E-02 - 7.4159991092E-02 7.3391451531E-02 7.2630690521E-02 7.1877788724E-02 - 7.1132671382E-02 7.0395261286E-02 6.9665478760E-02 6.8943241650E-02 - 6.8228407339E-02 6.7520848622E-02 6.6820601369E-02 6.6127595294E-02 - 6.5441757866E-02 6.4763014302E-02 6.4091287554E-02 6.3426414155E-02 - 6.2768335464E-02 6.2117058079E-02 6.1472516171E-02 6.0834641868E-02 - 6.0203365237E-02 5.9578614280E-02 5.8960219478E-02 5.8348159215E-02 - 5.7742425333E-02 5.7142956410E-02 5.6549689157E-02 5.5962558410E-02 - 5.5381497121E-02 5.4806342437E-02 5.4237082048E-02 5.3673706048E-02 - 5.3116157327E-02 5.2564377073E-02 5.2018304769E-02 5.1477878181E-02 - 5.0942952065E-02 5.0413499378E-02 4.9889519793E-02 4.9370960385E-02 - 4.8857766686E-02 4.8349882671E-02 - - diff --git a/source/module_io/test/support/WINPUT b/source/module_io/test/support/WINPUT deleted file mode 100644 index e0b1b89f57..0000000000 --- a/source/module_io/test/support/WINPUT +++ /dev/null @@ -1,70 +0,0 @@ -WANNIER_PARAMETERS -#Parameters (General) -target test # -wlmr_dir ./ # -rcut 10 # -before_iter 0 # -after_iter 0 # -begin_stop_flag 0 # -end_flag 0 # -#Parameters (Build Wannier Functions) -wf_type V # -build_wf 0 # -imp_pao 0 # -b_out_wf 0 # -b_fftwan 0 # -b_plot_build 0 # -b_plot_atomic 0 # -#Parameters (Select trial wave functions) -trial atomic # -bs 2.5 # -bp 2 # -px 2 # -g1 3 # -g2 3 # -#Parameters (Select bands) -bloch_begin 0 # -bloch_end 0 # -#Parameters (Spheri & recon) -no_center 0 # -sph_proj 0 # -sph_type 0 # -b_recon 0 # -speed_mode 1 # -recon_wanq 0 # -b_mix_wf 0 # -mix_wf 0 # -#Parameters (Multi-center spheri) -b_near_atom 0 # -range0 0 # -range1 0 # -#Parameters (Select L, atom) -L_start 0 # -L_end 2 # -atom_start 0 # -atom_end 1 # -#Parameters (Truncation) -trunc_ao 6 # -trunc_wlmr 14 # -trunc_wan 6 # -fermi_t 1 # -clm2_lowest 1e-07 # -#Parameters (Plot wave functions) -plot_wanq 0 # -plot_option (110) # -n_unitcell 2 # -#Parameters (out_all || out_chg) -out_all 0 # -out_chg 0 # -compare_atomic 0 # -#Parameters (Other functions: bands & dos) -cal_bands 0 # -cal_bands2 0 # -charge_type planewave # -cal_dos 0 # -out_spillage 0 # -spillage_outdir ./ # -#Parameters (Uniform mesh) -mesh 999 # -dr 0.01 # -sum_lm 0 # diff --git a/source/module_io/test/support/charge-density.dat b/source/module_io/test/support/charge-density.dat deleted file mode 100644 index ee3b025801173159237f8ef9879a5f33c98e134e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41304 zcmZ@=30P0t*N*6tnGh~Ag^b~bw9A-~B1%%J%tT3<3YChY%raC$h?FF=T}c@#N#;+N>t46En(CxhS5vDZ*xKST6VHM8JzZ1ZzfVG<% zwv?A*K?XO%ay{haBe#Q1Rq^~Ag$((r200}jvA}~O2M#dll{%`4{9sQq;(_IQ@X%2# z=utBc)vk=8jHR@b#~>ay6qjV6IOI<@gsE4eDr?oRR4>WonDQtoY~?xRamim!iI@8* zV*vk@<_CN5bO?jeL$>fk|B%xh;3xN&W7wk($fz&Kl>Vfn*svi#xr}m>Kd`!Zm4W9HMd_ zc90_nC?4vGuv`b(4-uH=1^QoDm{!Ju4aI~^jv*%u3O(799Jrb!S5oMZpXN`s0243R zN*)w3b%SlpeXQ2vNBwL}3FSxxjqZfyY4{9OzL8cu+c&4_FzC z>?jXxCfCf9g|?u_N$>4u||8 zgANb%@n5#^gAK*S4xkRmL1`yoLowuWVMBAFzThMGm&b#ga>)CZ`^e+LhH`)cqgLuw zPN@fBQfUKhA7&YO+J;^EY!sO3A_Q6@X(_^98mI6 z<{YRrH|bED+z&hs z>HrT4OmiYzP|5=v)Ifbw5AuA7A+Lq{289ksu9xRVz4BP(Lp8z|JoX4Y#RgA1r?i#V z3Oji|@}ZvK3m$hM&jX(BMQID2JO|lP40(;z5A753!wzy#U_7Xk@`D0HF1M5W!G`Jv z1tvY^Ab-pkGoX6~rMaUI9J(K}febpj8(`9b5>NX^7?ffYkJ`WsQduW>$jBEwjyxZD z=xO$Xt*ixd$e>f^L0owsltb=Awa8-=Pxl6j93tGGoWz6T$ZG|rISIEv_lX#Ex1cz% z1rHq#%>q2>z*C*zDF(?$f;h6Cq#c{K(Qf{*CFRAAN+|2C11G=HBcR(lwWQuuN5)nJpp6Z zcm(@r&*hkS*wO=A;z4n+LwIPnh|*4z4Jh4>+y`~xfev!Aqq%}YM)A;>Qbs=HPrX7; zGlY!x0zA&Y=^(?QJX8nd^gvHJaByoaQN3^}MDVA7EvC=TT4 z3wr<_hio8&4s!5H{9k?)L%3A#E9Hh92X_w&J=K9;Nluh(p~E3t@X!H+M_n{`P^wkg z8_DH8!C&bEJJdjOicNW-LrwDfsAi(11Et>n%b)U4PGDtD_~IyS;UkYrzM#-mi2Udm z59WmjI|&MzFsYm?$!MnJqx6UUzv<}xpm-D;y@Mw`c)Cw{PI^yBC$A4a^18@|Vk0Mb zni(jtJSTXXjnYq!Y|-J8USYaR2kY1CK*H1D@`QC~_+6qudlzUY9&4&5Y`UJ?;>4`Cb0kj8L~cH}P_R z)IzZ+Hsyg159UQRg3|otb`*p97G{5T4>DzJ`2JfR$Oj$m2<-%N;vo!557`R0%9xNN zHV%B~{wW4w=&3(YI!b@iAtrRNBR{!}a*{tV^-YxgCPcsSs3uS)guoc98juT8JGN_CwuUC$KgwPh$nmKVTS`h z>JJnca@f-M0~A=92lg}rQ0iZ>|5G>Rqd6fCcvA>`2XdBEq=d%Jr3nZ{UisanBbuUR^}r+ zs^!08BM;RF9`WdYKxuaJ-sJg^2eYL4QcZ|SJmOL;$e@$wA(^~J=pl!UV*OVRx=+|s zEyP2I2Q^SmP+-XAcJL*PT*QOQb5lO@r~ScG@N{ToXi|nXp+$DH?dvL(hE>Yjmp(eQw z_m7y6Qw*vbI{3)_X}{!oz~kPb!=v;k9p#b7kmr=w3m&_HZwPo$V8Q-RpYr;k$6R0o zO1p)6kQ4dk^&uwR2PiOVMNFy@l=`FlfDPRbawzMg+*G@~F1ZXm-6wc?EUJt8p%}{C zqP)spVNW{5L_CsF-ST{p!5(*uhvrC>c0`y|+JK@@xt`{NIMBg|>}V#SkWoC;pp=mh z`BNW|QxA~I^Zl0&_BfP>>VTXc=qU#%4s zdjy{HD`x{8)j__9OZ>m-s9waRnot+*E^4Md#e6V(Ji_G9@3p|t$?eDwava2``2x%J z;N|}43pGFv3Jf2)KgAQO$~vef^os{Ra({|PeuxKN9v3z=5BV$*hia0?g+JMmA9CYR z9fV0wIY8l$naSse9)W3=_)dZcMICs@pvR$i6_|X;U#_Fs!UjBgkjEe%-(2v}Qyj>I z=+FI73{ccXcH~2`DG$vX6gu=E?}z$>9Ea`+6j-jO8IV8XVZM-q0>ei>Bh)FM1@(h` zl!N+)FXbm5alwN^r|eJJKlLfEiDn?Lmw3FB;6af?UJKQV9>60G_6R)flRP%%Mor-5 zcI2n*5537}L48u+um=x+@SwnW&?EJMIAjZ%ynpHqdf35N9*brm&m)(SKjKm!Gz)p3 zl%Hw@#;#y~w6CDFgP0TQgbie50~vI*XTYQbC7yf;gHmkp@WUN|7v#^~LPjycmnX~f(M1KJP*}DeIO=!ha8mhK~M3Ny^#&{q?6}EPLhj|f9@ZC@?L2#s9yL%hC@7j zaNtKg=^&?=;3*!-U`IUJD*L3k6q9n09GLcq<^&mdlFRdwjQn6H?~m?;<^^B)Kn@D5 z%!63+x?%Tk`Gxp@W`I~Y^4^G-=c5{kLPtDN)IdFfQhvEDWMl(BWe$8>l@IEH4D%2! zfBqSR>>z^<7(9*~gU5rspwLr1l2H!G!J|$*IAlwFrBM7L&!N=e8-s%w#1n-aJk3I0 zALOJ{);cqetk;pKO5TI$*q$)Gv7I5j^$_2RsfiY~^;a2c|jV8w;Mk z;c~q^Hh9#6eE<&%j2!ZO)VI7A@H7+X<@w|~s^!082-iQ~LGUyi@H8uV4C;yU(Jn(y z?<-=+`;o_@Ugde@GVuQu3-O^t-{_Hg0;Qf&v-~>%j0ZJPPEcUT5exQ8Kjfj_8Lxt%-)^-b}Bi6ek4rw3Qy!am`ksNpUZnV+KIQd6 zkGa4G6j&aca#MeZiCIDpN;%|xq7Hd~WFyZ38P!YqsTRZqPj@D_1+UDFIFM6a%6Nz+ z&rNaVc@UFg$m@{jqxsPO&^;kG4q;GwO=9x~{NM@`^CapXGic%TD? z9=39sfPeN7JoI?z(2l~FW`=hM4{RW#L$QIu|65IRAF3Vph)1y~59HvXliN~1)CcS+ zA9V6NhQC}!b%Wx;p&W7@WH_LxnRrln5AdNJpm^kQl{)!eK}WSxjTEC?B*FVZ&wpVN zqH-r;hdrbt$B+{Sg$>z~9Jq!gS5oNk|2-+0q^72=XnO05Wn#y$OL=_!(qHkw z27U>5tEPQbVx}(HCyah+DD3~lvzhqSTEsI>FftY?dh=F>d=vGu zUQ$0hM*d|W`uWqZ!@-0>qF?q%nn%jHE}mi@{IN8zu#*WB#Jo7o)Ag5;qnIbJE6uyw z%Ea~GPtWA#qiTA1={d> zcU0Pc+_U4x~wCpXUfweQX==6-SMb>OUiKaSt~T-8`( z)ub=LejOJc-DOzL<64GQog}c~c+J*79e#34+fzTFpW&gyUVQw>Gu!OF3>^BwIo5OY zBUWh9;y!S*;USNoR-9$6TC}bJF7>%Rplo3^#SiYEJG(M}$*yTT z$Nc?7iJ8LwPrQ`|+K89(K+5Npxo)?}$1|jQCM6u(FY5VIZ}tA+MxtJJSnB6c&~zQq z533>d+fa8*lIZu(Jg#c=KOyFkLi3s(SOxRqig|Lyym{S-Ckws9mzqqsA3h{Yi!+@; znGV2Zn`&IiTKbJY7}wYdxTZUXDsH_{P!i(T)M=9ho6 zK2?@40ycH4Zn-d7&G=kc)#boLrfhDTJ2R6Vh#fu;xc|rPL+8}~%-f9{I2?GiefiNP z_dc_D|LOk#9}9Ri7XS3AU?t`}RH;|f0(F;QN4F7c4>=xxq;Nr zx(A6CqMwu=Qoqk*{`w^P<-XE94hKByAm+gfrFjkPJmN1gFRqv;Q_P!dK6CpT5bSJX z6g>34{&uyLVPDd206V_7*!6K*1ve<&Q$J8(#PL6t@dfiWRo2B z@xlIS!1^uJn#X*)!{2?`6A2u2Z(97E&mVYhm97ntzkc~|$0M`8vU$0`oT2Z2Lg&q<(8`OhLa)F%PDg7gNlWDdugQ=&|d(@fRJFX9NrLke z{}E{=%&L1%bX9?$t}?j=hfN2QG-rPK+^IKg?NYWGdhO8xWe2|G@>8+ug{IIq>FdJWsYVh$R`$16m<$um36 z?^o|JyWacq>z@MmoqXRR(DFDhO`hWZOJI+L7VkrRO4tb7O(T(S^2{x2*46X5ZLM;5 zV4a(XcEuSc@#mI(yBmr8JKZ}LrzfA_(|#WL3IC!s0}|#|zsY+4+EHO3^rLd->}!>M zmn$$+*el~PMLuRB)sy`DcG>vq`K&~$x9R%!??k=)l+@4U-GNg@KWwqoZ&!;Uyb98+%58h9jS4P>7+hSf!F;A|TH&fgPSKOEKKDpw)`7*oa@%5@tO8qce{a3Z- z_gUPz!x_MhwCXHzeRYGMTsS(SzQCXQ_xtH=c8k9Wou>=jt!zc@h}(H=y!V?}*iU=W zWv>62V#c4=T>yPuheg^$Z5}HzA0yeDjY^&)?DLMObmhx%&xU0LE-D0s) zJt>+?mWq1VVyWKtmqInFH^0wqkFB`=EzvnOsXU<9x&x2c<@wjY0&jL0wasTkE_3Yv zvk+K2<>anWAB$Oyq!tyx5AQd;n{@mE%gAq*4!pW|wn0wUw`~7vuYMH*Yx*`X^j>tH zC5>467W(9s^#*R)@qzhUBtHRuyEN)_*BeFbd#ZXiaR0(|r}wq;*w&uD&wzciSIo0b zc*_j_zT5%v7Qc*}*1+pLe;;zq5x8EqiSh8U2l>!GlbQqjd)a(6b`4?+1~mT$|9`Fp zv~cu#!+tNYt_A&ql7;FcdOzVEYi+&>eYGd9Iyok%*zD=&Ujy%-6L9b2UY{Kkw~2cBDXE`M52u-le%L&z zU(@6ExuRd*L7K;otd2FrJoqnZUa!4JVqVNcn&-H` zOQyH3-5B70ryC4*K2XFCv-)#wthpKJHT0QWA0n_InT~ST(vs8%q7)* z9=mia;uBlitSkWdl3J}*MK|`dPg6H6hW*rqCj##*xyZ~8-t_=}e`T!m#G-uGH+ao_ z;FyR{^*RhZ#9ABLe*tb|-oU79`gYc(e#@J{-m^6hH0X4lbqcGp9QbL0?+A~oaco!% zGiT&;sj$3xSnVmln|LQ0`Z-bF-*;FPu(f9KAAt=fCiU2*o5~fKDeSo-9@CZb*~c0+ z7WufYRL_oS*72eqUSF!W@1r`OM7_M9)Q?uL9)_YHuIQI5=D`*7;);24#k{%VK6qQ{ zzG9Envl92kM@aYCtBu7`ai2V8%iYlOms3)kFUlL%r|NTN9X&7wILj<v{+fRCryU#i;Zy66<7O;Q+`XP7N+n(1efcsRnoM^c{lWDIVnFf5f@yRiRre0%- z(_dWxUUx^|soAnC%pv(*3Gf-;uDxsaPG|irSM33|p4)G8@{2^a^U#uF;PD3=x_WqL zu)4=~R@QTN=b0IkJ_qy98}q}UcQ4O8_E*7SRx05UBSUWr%*np2eg0g#&%tb)6z{cL z_GA%{8%p^MtQ)Nr`S@h1p1Y@#dx?5@l2q^8k@3?+y3Enr8YC*yYZe4WGjc*xgMn>%iVNG{L9-UwJHL&*Vyd{pU66A8l}(ebTp9gMNeF zhlaUpt}~a!#SHl7=fbTaAF`QGV4e+d&mIrsFLm3^Z(TW18E@0(3Wv5c4|3av`md2M zYF}jWLZ@@=*Y`TZV6Rc=wI=q!F|NQ&Vb5<$@rL%lzCpxeo>IQs)oL6S`Pfvco`+L& zB1ApBM5;F{@t3x!mn-_=ihlV;X&z3kt3`=<@b5cS^BVuWovWA^|1-}JeoV}hUz6tj zdTx(SV&1&T?JLddcbt-HzM)mdf=PvJ>yzz{z=el%hyPRK7TeIbRZHNYw!7CmMHI7X zwb%6k&L|FRbYS&8)-T%39Qd)V+xzWfGuRxXR4O znI?M?0=zRx%g&%6jv1ZnXA5k2`sIeitg~#<+lC#0@4AKeIbxa3QkETP3;c6|-t$Hi zBH47W@pFJ{pI)KfZQ)R^z)E}WCB-|{VMkXHk5j$^lb9VMAFmuSiJoq|kUaO|NZx-|7G|xwSCz*+P z^2XAn77Y@iGx$VP-N{V5L1*lj1G?Zfhyx@o`eVnf>Eii+nsa(__lWM2FPKrm1O# z!8cf`!D36`+!;1u^^9*Y+op2IRccI}4#RP>@$zA%ry`t6wq z{ipm$uZ#zrr8j?b6#6T6=O%3Id7W8Qf2uh~;4>ySHrduc%}zL*dcpo)`zV8k&91Ve z_K%*!K6c-yFPc&5tXhZQiO{EK&u~olxx~(R<~jg-Y^;&eyfB-&p3Qs-Jf*kywB~gZ zS@uEKIN-oe88(e-U1ZPN#moW@Iv?6nuhT*16(RnNN5ns2S*1b5u3VW`I#})ZF)icq3UbLu(FP7>xYt;Eu-8XUkiPTR@Q9(P=55Fw+yP*FL zd(kgY<`{auI=8Apbihbc1qk53SWsA!etFE*5X2;5)&(lb3SY&*S870450{y%* z$M63PImt}VjB5w1;dY>YjW@Y0x1nPL;0lM?RxY>Bv+ycif5Cr4{==Og{4-d;-yw6L z&mCeq@$j}&Y})vVJ%DSwW&dq-FO@l;S@#w8v-b=h+BEnSi|HF_4Sjyg7GGEPy2!E? zZt(zKJ1V~AnTmbsPFPw*mD;t-r)B`j72=|BIPp)>)uY};|5Ya zvsXGeiF)`}sotTcmb*l~T+t6#^vf0V;EH*1nrDQLNv4=5UoFi$WavoDn>W09(IceJ zgw*!wp@TlUqwfQx6?)z)ZA$!qPV9zYg!om8P?D%=_N_*35+II``@>t*N1C~PHcByM^uW?x{ zt$ko9u=?#=vriRevVcwrX~0$)2O2IplgdJydiwzH*m1<9(;g6p?SXDuH*-T}O@qmxFM zX)JS|@Yx&qd8aELfrC%8AHIf%fb|~a|2$Z9o~=sn@*Mciy#~2Ed+cB}cT6t;j$L1B z5@?df4u5p0%%`5}rF$$QmUqbPe;s-Q<8j^#wkI>In(fX3XAkVQW4dKDKb>s30@yrM zU-SIoV0KEvTOSyBrX3FEV#okn6FJVBb5ZHc$P zm>0K{=DB`c(PlAE{zaO1tHL%t#k{%VKDgq(xZ*y!;=Z}Qv=5sj-I|Df;76o=Dcakr zNbC!@m-fl9nJe~*)4s(!XIhDUb%>Q{J_K_cv_O)c)?ohF>{Did6XI?s5iGAi; z(!S5Dqd!pWJ6}A`Hs^!axYV^bY<1OJ=CGcDhB0rQ$E7alQ1@L^1J=~0DViZ)f067%3w(YcUF5R^u|VJ^XnR(X6-F> z&%oYuR7}p_cH;ZyJvbirF~M17{5Bhq?H+Y3w zo@OR?nU{c{cX+r%eadmxt|6Hfiq8pe40@|femWcE(v(( z<65`+c_y*mtp}U}*1Aw(o`3i#+t%Zs^XP9xSl_azZfDtwi$0a{{2SkV``mFCyS4I- zPKnT`FM7Q8n?Vpue_mb>_?vef8;8hbmRRS=E5zI8_;vp${aEI+u+JsLE8Tv!*(9fh zywmeb$Dm(eX?ZuYcLa0XJ+Bb@{d^V)KBu*kcSlpL42vyZ}exM zJkc-TD$T=V#{34)+|F`CX+{cS{nzdra z266}KzM>2c&NIF4_~$;KwvI~>_sL&N_q{UsA`|z`yGi?SD7agy*avPb?Te{N%6_pg zT(M7Fv2R?lk6f{@+)mo(o*gG`5&O*3q3tuXo7qyl@0`8|&lfG6Aif8jz87yz)*6fN1=p9pCj-1T4iVpzKi``^Bb-`@ z?+w=r4eR;L%{=u)=bLTnN1tZ}{w86-2~!(3Yue{Ho7?8B1+ZscylEGsa3$tNlD%K8 z#oEH2ca!2Bc8Y5$;&H>ecQb3$9G?0*YSil04r%Pr``J1*1s*@Qq08}2oDGb;ln(uc ztfe`r!^NL}HE4Jn*nQcHsgD+1U|o78SA)I3^^dfVBNAB9LiH=qhxE^BH}LXtR;%^& zkHC{!y#1%V<#Co!_`DRf&T+uHdDb3^iqb<|LJh-7WuQ~m1U|u{{n&*wt9mk1z zawBQpZP&T374znQzr34W5jHH<>Bm2I2{~!3>*T(_fepgvPU+DujqM0ivzxYfSn4m+ zTA>FWFR+}n4bi|FBX4i-mCo7U)88M3eboCCqwC!i-|w)16Tt3^bZqoaUtnz)4f_DB zrv7TAqt_`msfzPl_&@S)IQZDP6D)Vm&_%#=54&b>Xp+V{+Fr>8_VLRad$4I7d)~@B z0yrvD_tB%}Cz(f|AxVh$>o0>N=Zn*r_KMgr=*?Pm4l*oFX3_nVuK>G`Ew7QcaxY81 zXt4zN^QL({Oj<^=Z!-@(g8%e?J~U!xM_KM2zk|>>yA_wSCM=qD{HD?CyUtJ1 zWo4bRiEaDha25Iv{l4s-_;edHU_pHmuQ2>p&XRY*T!EGLJVuH)>*IT85s%N5@}&=b zWpsVsIKEV>=iG}BHRn+y*j}k#?QNHyjjJ8V>qz}H)mwJ^cELV=Me0|h{^|{)U;a{> zN2_+l-NiikDQRAP=D6)PZW+lH^W=(ob9?DNn%rKLDei;6lY z9V70O(|s?kR_~&?Z*DK`L)p4p1H?XX9cf>Z$CX%$ec_SPJ~^&Rv=sZqYfJm~tBRJH z*f*Xl?c=~!sj*@oIqhrBhgRWYU%8&N&xs{{Cy0IKI?}$6U$WCi>^r|(<>*`e8z!mk zLyxsy5SGmBzuwFIe%BNETT6Qh{h(=s z-gWdk#F8Hwc7*=ItLZlBCyugDZ;q`6PPx3(D>8N?E7v*P1@?zN_1vrV+C@2 zeWy4%`1!^$Q{J!w`QEJCe)@K;157XBaVzNElGDBNR_|k(7D*4$&%kZ&X_kO$gKBUB4Vb2xuc!rek-jb<_ z>76(5o>D#PdY$}4JzP;QSMSN;CENz9M^yzeo+zxel+Ls}jYKfn4l z>azhj<&9~b@F6Ez=8QK+u)jQNm0scG!>n#(<2c}-4d(8hs~N{8hJ}m=&K+C5)-ZeV z{Ywlq2fpRKZ)ev|N10SG@@4`~*~)*Tc7xGeCp zMsDpLW=F7LRZ~oWHL9Joa9z2bT~5Bd1^8YylU_dk53{LRZw>$(8*d))YRo}aw&_I* zaHiLtu}SXh`S@7>{lI7JK1EMl63W}%8Fmfxe3o_WLG|t{*q*GtmJ0;F{q=S1;*%S> z0yBj@w~^wl-`Q!Oh{tMdR^@wm!O=zJW3Ey?RmZy;hUZ<+0nVadzDJtJB=t8H!Of!h2Wehhn0}a*B}X)a z-eUIl#G6l!vc ztMZLoaQc$S$Df~5)sy~r#3oS>50L7uI{1{UsF%N_eu|!+5&iJhQor9zy-Y;E++Ui< ztF{X+h)am759^X8g*8_XB1?3wCo?lK_ic>=rW4 zEZef;TBW~n%e2oEE=ID*xG7Q4C)`aQme4+ed24;!49v^wMGb7UhpFp2CIBB<Y5>})vb-zz}{z_N-ey%v$hiMo?!M;VE$OLA2MydrLgCz9al+)v7v_~`Ubk&nkq_0(SbLr2uZw@UT)UA*O+sFzQc`gyzD$WrvfKS=$KtWthM z^vj1x^Y91?w-xi?R?@t3f8|XV^WutmD(B5LCQk|ZGNW_qg(@>Ql=<#s=|dXk0e32C zoZuyU}at5Br=uIQ^f4?5%g>w$L9>+Lj#SwU;GE`a}UA3Nm&XI$||@ ze{Jj%*q6+;(Wo~lj@@0Su?+f7k&{~=*&V@d8pkb!K5BDr_`vS*ETCQNZea6jPG>b{ zhBL<{T6ch5k_(=$`x(t16dxK5f2&u)Q=8V>#Hu~+GYpUpIcD>7L&cC@|b#B1Sler7nnn(NR0Q>Cv z>sj{}R$PIV_B>aLXXl{3T*TvrQoecS*0n@F_IQn|9yRp?cMruc;FqO(heU5YDeC3@ zq<-8r)8C)G?Z@liRP}4~{#(~szqj+l(mb~HE}32R@k-uHn%4kk@KMZ*+e-8FnD#T@ zBqo%HN%OAH=4=%6=C!5!NLf<7<;j*+&kX+}Z*iZzc1_iN z{~D%|CGMN2OZ#wW_z0b0b}@Xsv@gfbRcNIbZRXL^J~<`Nzc2QQ*OvCJ+Ai}QPYTB} z4QU_uCrubD_K`o8_Er0{?Le`w+*aD>Z%GC(#Xj@p(!T$)PC702ou8N9ha0AK1I7Em zA4u;@fc*n|@xJgJ>3z~!(xbfYpg4Y1df%elE3S(7jX#y%$96*^3&i`#HKq48OZRD* zcwf1v^gid*`BG=knvMLc^u8AkUlT0ecdqyzaK-n6E50Yn?+ss5TGub*hi>YQ7em6H z_m5(iTDTMgx4$vSr|pA%ETp1nDe&l|vJQ=A9ASqB-PsAe!6UPcZTmPj`^EfV;P5Oh zoxELJ+1lIr6~KRIe4A7BXg|9-BP;|sCE->5@bgDlj%jifaE)3uQafKb$b1(~O$0W2 zQ+Ipnqj1*0*VqHV1?okY9;U5juP?rO0-ToF^=ib_Xx6hlxe{lk*6Y!4&rUX&N3_ip z`sTX#7B3$Y&K_6a76$uT_ug&2zQd2*&fb;*JXkwAatYhZa juf#pO8KiyO!nV{2 z$pfC}IX-6ghV86$W=;ukfyaQiH%~`0%V%vW5!AHG%UcdKKlgXotl=D`*7;);24#k{%VKDgq(xZ*y! z;=XyFv=4^uM`ek9;Q7+N^sM%+sn{33T-qnYg}0o=KJhuyzIhjZcNF`^75m5)`^pvj ztlW2=lyC5{c}DBhmiOm&emW$IrA7wq1Wt(_en!t?J1e@NmId5qWbu@^ZaZ0Y$>63f z1dg-6nt9r27qjxW-UPkN(LIm%?AgNh?|2akeE9JEy=_)RvcA@Gxg12CrvJEClKQ!E%HC1*!(;ta{krW+JRd?%!Aj>P|d5xqBsjN zFRqxUa^C!qM)1BG6-`nD8&9A2rluR)>^*-o@L@;YXLr_ZXS~&Gt(pQ)wGGJDF!W(% zt|Q(;f7jM~=9W*J#DBlN>MF2qp6~Uu``7bu+de0OI}b^@Jtrreby{+b!N1|zHBC-_ zb7uSZx_yRzX6($Bxwm$(_OTNl1N%;{ZngEOCx7h`_8$23@!hRr%QvxKze^{=-z;YP z)+OQg?EU*=b%3}1ZqcS-V>D~N^S3(i$Xu6?R~&2{s=Y2w%|CMpth+nJzs1?a`?OFE+ zM>T-2>Q?Q)SKWrK+jXSUe~?>5*06?CxlyzVFMi%*%+Q8YS>b(^{gm6kTg9l`a7!s( z?tyu)kIuE{JEeS&LasWBe0-=>Pt57vrLW=!g4C z{pO_`n23Ir^WchkDd))*^XAn)sO}@`kzG4+AH0p)m&*G(bLCXx;&6NM_gz%?IWg1V z!-4WmytQ=S*$=(mu2|ZgNcQ18*Yji*27OXT-kn0BN7h46{nbKJlZ{zWM9f zt`_^I+()k1SFYG+<-YTcy)J1qcG64@DSsHGStpns>RUSk*fw?g>bJu-vBgJssR3*5 zd(Vf8pHE+QIsRQs;PnrdxQEORWn1r@n*{y2zqc%TQFSewxxusu`tBWgy*Uj%+3>U) zHqbxSa11vcF^wHr`S2oe{nJ0Zex-%83qf^00dHUY;=--d-fX_%4o~3y>Wj{}&Dg@m z`;}=|`afU0>$R5n{U>qmRp8Q~Ij`H)^;Ke}J)0`Un^4~6zKF+5R;ltibsxUz_GxcE zP^za-mor~QJ$$oN@4heYc|%7`99LeVc*%!4cD#TD~Z z&YN2u8uz@er+VrM>(k?$Tg+jn`aQn~TsHUFRLh(dEOy-wCyV1%Q`237#x~jS#kwyq zP|MD%lG<=Z{DrFFo;vRtn|)ctmuVw`4_RAiXQs|)Cz|{|k9yx9sG8O9nLDdL+CLLGXp82@mwPv|D}N>4 z1zwR~|3Kr@Q+ShMd1=7L(M89$?G=Cds5I>gu=$V}o8HN*ne~J!W~j%td+n7IXRl!W zypr^Q(^Kahaxn;GV_0$l>=X7^Qy-}w%8Hj9w}Re3%im^YqYdnD=UIDz$8TA6{o$%b zELy#}ZarataQA=#*>?lkv3(XQyhoXrsPf0p`~ygt)V9 z6Gm6|^Hgt}{j!>Yd}!diU+C9xa%i*pUu?MA!^VclH*new-OE>pGX+-KE8{8iaYa2` zQ7@n0Ow~`L&fW4wKfJhH)$hQoNwY=2yqK%zk?d1{%Lp$Y?p8xJueaTegF0I4E9c1- z^X7{C;EMa=iu>e>`{s&$;EH|WihbgWedE=neGD4YWsKNIUM}tH^9-+4v9Ij0xoV%w z!}acpeddwUzK0m?A0YOf_bgSt4>xjFkIhJ(&x54*r9sZ6bn(7$#rwn+?;BUVk6iJ- za>e_seBZg^d!YPY@MP(GqSq~`n)se@W9fU7dP3{#*QTfns13_YH0QYF=8a$wxHx}H4M{eI^hft%EO7}4m-OjgHmpe^j{ zcJJ?Yy@!|h`%xEMfFlzM)@bxz%f>F!atCfWYrn(y(1om5!TC!4gRb`s8cp_RGXgJ+ zg}(Wk!0;#j>se6rmx;g|mUU}u84}9MXrx%AHT>3n(HNBwFDoTk71NE7*VuFd^!@sdbMn^qVsYBli=fvmKXPpE32UAnKlnay z?s2u_*Ni;bkCwST6TY5(cvQbKe$|N{4$BAnv(Q!!mG|*Btk_=b z@*p1A{&4{84dzxqH?x^L(<{g@wfHOfMc?q)+|_I&u-nhJP>%y z5RFcJmK*=MJboeKwTxRn{%d<5UgP-k%6v11*!i40d`;hE) zCS~n?*d!_5qk}DSy*-gJ*{|m+=s(-(ecRmwzz`;Y+1?v}u1YSj>Z~>8j?{)8wDNvzxhdwbrV6`l`Ll zX>xfGYyVg^Z`U)?^~Ain;y$?IzLfXL75B|@q1UGI2OcZ!%lLqpv|h#Y*a~T% zHqM;CZ@>dXHbUCBCsrjjU+NFym!y3h+NVXJ*hd~B?d!RJBJIV#@)BvE-R650?K@%3 zLZyAblM$XS_MMwb@597*_JJMRbY|t!`_gK|^e_D!2JyDi`;^vam+69wV|ZKXeXDS7 zSK8dnkMEb>$8m?(y;-X5#|owQb!E?X-UT0LF~$3=eBYU#^gUP}-Z9?Ba1w90RrS4C z-_>KL_+D^R>3ib1a*cq&r^u4L--Shsv>C@T!UMstsmA_2+5x?)OPLE0a#Htp% zEOx$3`Lu7+kDT3$xWTSC3*aBy_AUF`+?@As+`65m!0v4mmX-B#=g~Un6QFOqZGUyG zb?$ud$D>^kFF$>*ak#lRyW7{vb-2Jj3pCp%4szzD6|5NcuYXU`u*vu5bvysu1HE0E z|K}HWeyr$f|cN_1jo*OK#~ zUuav}>ZGDvwyEK|@toK44^$ziAI&f5wHha_SV>93-O%6Uhra6~&@EfJN zzt!!{Lp}ZZ)aDx15wC6ExG~#;=Cg;}cWptwxmBXfj$CtOFTadh2>pYEmMh;poX&lH zsx$-k^jb6b#K>7pfw{t-1@2JA8##HFhls})O8GQ2ERKtOyq8qZjkIo0)_VH0fxT7r zCXBk_C+g*6>Z|%u+Y(>3O^`PCoviA&SkGs}lS`wy?^M-1eC;}G+wZdHm!)}WYkxaG zJE zpA18>uPj~K=kkw{YL90aun1}2XCzij6#LG@o~qu5V_i=6JDKRj&q?n~e(HK#{gk0R z$x8J;?P~I^K)g@fsFUh_o8Im2E%CnbXz6`yKY0PS&i7}X`m5g8Th{08#QVyIl&Ie4 zAC0FNZ8P`g-&(8QcimxqzcyOu&IU{011s~unfJT7IrEXeC-tZ9 z>6^QI5i8JFeQ(akP77<>V-oYNeSK8th-WD)7GId>RX&Y>7z%#WTcI;kv4qI;*-Zn+xx9<6Ghv`n>iyx=ngTBwJI_=ss|Exs3U&E@6 z)9$^5-8I;EANpRCi!B|Sd$Etr#b0_uygm2oRdk=k^j)VvM7*k#3g0}dI)?Q#d)5Qk zquJsU!#cXKH^)-jRN}1IXH7F_u@Wt->+r8tcd*6`mzr$r+bS1`{k1O(V$407p zX8E_&d+uD5&pxiI_pSY)z1o?xc&XIS)u@6+rX5}QPO0BM3$=cWe)&pi9*I%iJ<7XJ z;E`MFmc%?=9u zUaQfH+|I-J`$L~PLhlq>l<68aj1R8!`_Tb``@C-!_dsVP*W@!@p`S4JjoHA^Ioy7X z`+&-L^K1Rna_@NlBV%G%0qlMKT%X3&vt-MwH+lkG^@RV4QhP_1lU0}tJpX*T z$#owWRxQri54ht2`;jNS$FZI#1}q0|6i_pu_Rg`a`;AMPz+G0faNpW$9&h`&@E7LM zb?e2+w|$)0*tl0}T}( zmT~9C^%fJDT78v$Ny*Up#s=10?Y1hOnuYVC!No?*{+TMDR=u)&cYU0=QLd_k~`x!Q46Khf=nUO47Gj+UTOY99~H`n2)B&PX;dQMIpywh?W_zOo_GJ_qSHyd(CRW%O0;`?}M^ ztDh_%&(^xEuo~o+n&RX!IBiVb3B2Bo{pSY@ocDQh;{^{#^UaO+Tu7Ogp0c%JzUEx} z8GKFG!n?q(_xn!P9_Gx;O|N!@|4p??Bf9k+#SFZ1KLU^cI(X0Uk-d4rW;Y`ffjhZ$ zE^Vad$_+c~rvY~uIllep+P%cTe?MS5P~eJDKh(TCyRaGoe_aP&?)A;4M>`v4bj5Hl z?DKpVWJDizVjDBgJVXBUQTY?Xn%VGH3pPbUKkDj6r=XQi%(kqFTB^_|El-$mV!>!O z)U@P2?7Q~28$6`Kiap3uS3`Y$n!HLVvYEh|mmaza{i&Wq*Cc%$!wgRAPe6Xt=Sz)# zi+sBGle7`BinKVq`rE9y#WUTATBTqJag?KfuwwvPU$auYoX{}&iudlt^b0fxguUFv)PpvIp z8!?uCTxI{PL7OS!^TO0@Rq@o!>uPmf-<7F7Rpm?ju&c^~&X!CqQB_ackvhM90`0ik zVpY9rPU`o4XY^!?zKyQz=fTYwJ+C@=4o+1`P{_Q4qR=mYTmw=z3=Cq)8lGARrgWyz-HKFuOYm2rRu&0 z4u5$rwq_e&62(sv6dy1-0WwtVOLe(6T@b2MvLzW z+dfhCy|L<&G}o%`1ZMVY{(^yJ(J5P>H)q#3>9AAgpEd$lJ>q&ap!F!8^rX%);HmTN zoVGSGU|(Bxa5542b!btw_&`+;II>j*X7(-kE16hia#%SZw7s|$)0XT_s24| zizb1V#%!WU;0@gP8c}**5B(uJf(QlBz$rn~#jn41M+ZM)bfZps4n|Ju= zKvt(`mmJ{LLmqu?JXpLBS%Y$ceZ_weeZQy^Q|nP&3hZ=mmFuN81KEjBPCJ3^x^?o7 z>Nk$34Cz^c`hH}WpPsmNG!G4UwiNpBd%l$P`Y?obao5)X?zSjx+&?Y*vl^+s&4EA7 za6e$1+<|SZF)<8y#-5G!%5uzDr>fbDf!BwQX*cVv9&g@Xg)FQe{#c&-e=~=~_XXD~A7FgjqNNA) z^n#wA(9_%Av!amnxcgCcT5zVC?Y5_o^xEXHH4m6x_by3yCoAkN-ZuZ?s+j5fHgH63=-iZVmOlP_cc zi!w_g+cq{xc+0x#^S|F@ytgt05+66>@62pZ)3xnb3yH5alir4H(Z-0+y=d{h7cD)Y zrx*0}gr45e)8k&W^t#tI9+I999F7)Q;cK$@*8)g-kI~q%d&+L3y=(5x9>pwBS-m-lFESP(Lc|eqd-2xfk!rWe^~Z1FwE!%$=_(~T;KIw&^Cgp zh6N;lW$m78m$TLOGR)Yo58}%kTRpsRz|agNhf#KDM`Ag@0IVIi^C~Q`MI6#IsCmZ~JzLdk>^~PkzVEvKMsbHvsxKO|bv~ diff --git a/source/module_io/test/support/dms1_nao.txt b/source/module_io/test/support/dms1_nao.txt deleted file mode 100644 index 8f03975f1e..0000000000 --- a/source/module_io/test/support/dms1_nao.txt +++ /dev/null @@ -1,119 +0,0 @@ -none - 5.39761 - -0.5 0 0.5 - 0 0.5 0.5 - -0.5 0.5 0 - Si - 2 -Direct - 0 0 0 - 0.75 0.75 0.75 - - 1 - 0.570336288802337 (fermi energy) - 26 26 - - 3.904e-01 1.114e-02 5.918e-14 -1.032e-14 -5.650e-14 -2.278e-15 1.049e-14 7.875e-15 - -1.022e-15 -9.243e-15 -4.239e-15 -4.177e-16 1.138e-14 3.904e-01 1.114e-02 -5.087e-14 - 1.542e-14 6.071e-14 7.203e-15 -6.739e-15 -1.848e-15 1.376e-15 -1.259e-14 -5.116e-15 - 4.104e-16 9.615e-15 - 1.114e-02 3.177e-04 -1.789e-14 7.148e-15 1.530e-14 1.672e-15 -3.610e-16 -1.275e-15 - -2.914e-17 2.955e-15 1.296e-15 -1.192e-17 -3.403e-15 1.114e-02 3.177e-04 1.813e-14 - -7.002e-15 -1.518e-14 -1.532e-15 4.680e-16 1.447e-15 3.926e-17 2.860e-15 1.271e-15 - 1.171e-17 -3.453e-15 - 5.918e-14 -1.789e-14 9.507e-01 2.156e-14 7.801e-15 -8.434e-02 -7.786e-15 9.889e-16 - 4.982e-16 2.026e-16 1.354e-15 -3.683e-16 1.810e-01 -4.515e-14 2.281e-14 -9.507e-01 - 4.041e-15 1.074e-14 8.434e-02 1.213e-14 3.510e-15 -3.700e-17 -1.211e-17 6.764e-15 - -1.410e-16 1.810e-01 - -1.032e-14 7.148e-15 2.156e-14 9.507e-01 -1.857e-14 -1.168e-15 -8.434e-02 -6.126e-15 - -3.720e-16 -3.894e-15 1.810e-01 2.484e-16 -3.178e-15 3.136e-14 -4.989e-15 2.147e-14 - -9.507e-01 2.334e-14 9.054e-15 8.434e-02 -4.928e-16 1.386e-15 -2.383e-16 1.810e-01 - -2.432e-15 5.280e-15 - -5.650e-14 1.530e-14 7.801e-15 -1.857e-14 9.507e-01 -1.018e-15 -1.144e-14 -8.434e-02 - 2.907e-15 1.810e-01 -1.369e-15 2.925e-15 1.715e-15 5.904e-14 -1.585e-14 -2.623e-15 - 2.790e-15 -9.507e-01 5.354e-15 3.626e-15 8.434e-02 -2.228e-15 1.810e-01 3.122e-15 - -3.904e-15 2.578e-15 - -2.278e-15 1.672e-15 -8.434e-02 -1.168e-15 -1.018e-15 7.481e-03 6.248e-16 -5.890e-17 - -4.419e-17 -7.980e-17 2.189e-17 3.267e-17 -1.606e-02 6.977e-15 -1.938e-15 8.434e-02 - -1.101e-15 -6.264e-16 -7.481e-03 -1.010e-15 -3.403e-16 3.282e-18 -6.083e-17 -4.581e-16 - 1.251e-17 -1.606e-02 - 1.049e-14 -3.610e-16 -7.786e-15 -8.434e-02 -1.144e-14 6.248e-16 7.481e-03 1.705e-15 - 3.300e-17 -2.147e-15 -1.606e-02 -2.203e-17 -8.368e-16 6.793e-15 7.157e-16 3.970e-15 - 8.434e-02 1.102e-14 -1.324e-15 -7.481e-03 -1.118e-15 -1.230e-16 -2.472e-15 -1.606e-02 - 2.157e-16 -1.587e-15 - 7.875e-15 -1.275e-15 9.889e-16 -6.126e-15 -8.434e-02 -5.890e-17 1.705e-15 7.481e-03 - -2.579e-16 -1.606e-02 -1.359e-15 -2.595e-16 1.679e-16 -2.374e-15 1.487e-15 -1.448e-15 - 7.528e-15 8.434e-02 -3.258e-16 -1.011e-15 -7.481e-03 1.976e-16 -1.606e-02 -1.757e-15 - 3.463e-16 9.162e-17 - -1.022e-15 -2.914e-17 4.982e-16 -3.720e-16 2.907e-15 -4.419e-17 3.300e-17 -2.579e-16 - 1.197e-29 5.534e-16 -7.083e-17 9.747e-30 9.484e-17 -1.022e-15 -2.914e-17 -4.982e-16 - 3.720e-16 -2.907e-15 4.419e-17 -3.300e-17 2.579e-16 -1.098e-29 5.534e-16 -7.083e-17 - -1.213e-29 9.484e-17 - -9.243e-15 2.955e-15 2.026e-16 -3.894e-15 1.810e-01 -7.980e-17 -2.147e-15 -1.606e-02 - 5.534e-16 3.445e-02 -3.283e-16 5.569e-16 8.263e-17 1.275e-14 -2.974e-15 7.852e-16 - 8.854e-16 -1.810e-01 9.054e-16 6.580e-16 1.606e-02 -4.242e-16 3.445e-02 5.254e-16 - -7.433e-16 2.460e-16 - -4.239e-15 1.296e-15 1.354e-15 1.810e-01 -1.369e-15 2.189e-17 -1.606e-02 -1.359e-15 - -7.083e-17 -3.283e-16 3.445e-02 4.728e-17 -1.129e-15 3.696e-15 -1.015e-15 6.837e-15 - -1.810e-01 2.274e-15 1.479e-15 1.606e-02 9.938e-17 2.639e-16 3.691e-16 3.445e-02 - -4.630e-16 4.817e-16 - -4.177e-16 -1.192e-17 -3.683e-16 2.484e-16 2.925e-15 3.267e-17 -2.203e-17 -2.595e-16 - 9.747e-30 5.569e-16 4.728e-17 9.656e-30 -7.012e-17 -4.177e-16 -1.192e-17 3.683e-16 - -2.484e-16 -2.925e-15 -3.267e-17 2.203e-17 2.595e-16 -7.952e-30 5.569e-16 4.728e-17 - -1.303e-29 -7.012e-17 - 1.138e-14 -3.403e-15 1.810e-01 -3.178e-15 1.715e-15 -1.606e-02 -8.368e-16 1.679e-16 - 9.484e-17 8.263e-17 -1.129e-15 -7.012e-17 3.445e-02 -8.483e-15 4.345e-15 -1.810e-01 - 8.052e-15 1.812e-15 1.606e-02 1.663e-15 6.889e-16 -7.043e-18 4.155e-17 -9.801e-17 - -2.685e-17 3.445e-02 - 3.904e-01 1.114e-02 -4.515e-14 3.136e-14 5.904e-14 6.977e-15 6.793e-15 -2.374e-15 - -1.022e-15 1.275e-14 3.696e-15 -4.177e-16 -8.483e-15 3.904e-01 1.114e-02 5.346e-14 - -2.626e-14 -5.482e-14 -2.052e-15 -3.042e-15 8.401e-15 1.376e-15 9.408e-15 2.819e-15 - 4.104e-16 -1.025e-14 - 1.114e-02 3.177e-04 2.281e-14 -4.989e-15 -1.585e-14 -1.938e-15 7.157e-16 1.487e-15 - -2.914e-17 -2.974e-15 -1.015e-15 -1.192e-17 4.345e-15 1.114e-02 3.177e-04 -2.257e-14 - 5.134e-15 1.597e-14 2.079e-15 -6.087e-16 -1.316e-15 3.926e-17 -3.069e-15 -1.040e-15 - 1.171e-17 4.295e-15 - -5.087e-14 1.813e-14 -9.507e-01 2.147e-14 -2.623e-15 8.434e-02 3.970e-15 -1.448e-15 - -4.982e-16 7.852e-16 6.837e-15 3.683e-16 -1.810e-01 5.346e-14 -2.257e-14 9.507e-01 - -4.707e-14 -1.592e-14 -8.434e-02 -8.313e-15 -3.052e-15 3.700e-17 9.999e-16 1.420e-15 - 1.410e-16 -1.810e-01 - 1.542e-14 -7.002e-15 4.041e-15 -9.507e-01 2.790e-15 -1.101e-15 8.434e-02 7.528e-15 - 3.720e-16 8.854e-16 -1.810e-01 -2.484e-16 8.052e-15 -2.626e-14 5.134e-15 -4.707e-14 - 9.507e-01 -7.559e-15 -6.785e-15 -8.434e-02 -9.083e-16 -1.386e-15 -2.770e-15 -1.810e-01 - 2.432e-15 -4.065e-16 - 6.071e-14 -1.518e-14 1.074e-14 2.334e-14 -9.507e-01 -6.264e-16 1.102e-14 8.434e-02 - -2.907e-15 -1.810e-01 2.274e-15 -2.925e-15 1.812e-15 -5.482e-14 1.597e-14 -1.592e-14 - -7.559e-15 9.507e-01 -3.710e-15 -3.203e-15 -8.434e-02 2.228e-15 -1.810e-01 -2.218e-15 - 3.904e-15 9.526e-16 - 7.203e-15 -1.532e-15 8.434e-02 9.054e-15 5.354e-15 -7.481e-03 -1.324e-15 -3.258e-16 - 4.419e-17 9.054e-16 1.479e-15 -3.267e-17 1.606e-02 -2.052e-15 2.079e-15 -8.434e-02 - -6.785e-15 -3.710e-15 7.481e-03 1.710e-15 7.249e-16 -3.282e-18 8.864e-16 1.960e-15 - -1.251e-17 1.606e-02 - -6.739e-15 4.680e-16 1.213e-14 8.434e-02 3.626e-15 -1.010e-15 -7.481e-03 -1.011e-15 - -3.300e-17 6.580e-16 1.606e-02 2.203e-17 1.663e-15 -3.042e-15 -6.087e-16 -8.313e-15 - -8.434e-02 -3.203e-15 1.710e-15 7.481e-03 4.239e-16 1.230e-16 9.834e-16 1.606e-02 - -2.157e-16 2.413e-15 - -1.848e-15 1.447e-15 3.510e-15 -4.928e-16 8.434e-02 -3.403e-16 -1.118e-15 -7.481e-03 - 2.579e-16 1.606e-02 9.938e-17 2.595e-16 6.889e-16 8.401e-15 -1.316e-15 -3.052e-15 - -9.083e-16 -8.434e-02 7.249e-16 4.239e-16 7.481e-03 -1.976e-16 1.606e-02 4.962e-16 - -3.463e-16 7.651e-16 - 1.376e-15 3.926e-17 -3.700e-17 1.386e-15 -2.228e-15 3.282e-18 -1.230e-16 1.976e-16 - -1.098e-29 -4.242e-16 2.639e-16 -7.952e-30 -7.043e-18 1.376e-15 3.926e-17 3.700e-17 - -1.386e-15 2.228e-15 -3.282e-18 1.230e-16 -1.976e-16 1.210e-29 -4.242e-16 2.639e-16 - 7.056e-30 -7.043e-18 - -1.259e-14 2.860e-15 -1.211e-17 -2.383e-16 1.810e-01 -6.083e-17 -2.472e-15 -1.606e-02 - 5.534e-16 3.445e-02 3.691e-16 5.569e-16 4.155e-17 9.408e-15 -3.069e-15 9.999e-16 - -2.770e-15 -1.810e-01 8.864e-16 9.834e-16 1.606e-02 -4.242e-16 3.445e-02 1.223e-15 - -7.433e-16 2.049e-16 - -5.116e-15 1.271e-15 6.764e-15 1.810e-01 3.122e-15 -4.581e-16 -1.606e-02 -1.757e-15 - -7.083e-17 5.254e-16 3.445e-02 4.728e-17 -9.801e-17 2.819e-15 -1.040e-15 1.420e-15 - -1.810e-01 -2.218e-15 1.960e-15 1.606e-02 4.962e-16 2.639e-16 1.223e-15 3.445e-02 - -4.630e-16 1.512e-15 - 4.104e-16 1.171e-17 -1.410e-16 -2.432e-15 -3.904e-15 1.251e-17 2.157e-16 3.463e-16 - -1.213e-29 -7.433e-16 -4.630e-16 -1.303e-29 -2.685e-17 4.104e-16 1.171e-17 1.410e-16 - 2.432e-15 3.904e-15 -1.251e-17 -2.157e-16 -3.463e-16 7.056e-30 -7.433e-16 -4.630e-16 - 2.271e-29 -2.685e-17 - 9.615e-15 -3.453e-15 1.810e-01 5.280e-15 2.578e-15 -1.606e-02 -1.587e-15 9.162e-17 - 9.484e-17 2.460e-16 4.817e-16 -7.012e-17 3.445e-02 -1.025e-14 4.295e-15 -1.810e-01 - -4.065e-16 9.526e-16 1.606e-02 2.413e-15 7.651e-16 -7.043e-18 2.049e-16 1.512e-15 - -2.685e-17 3.445e-02 \ No newline at end of file diff --git a/source/module_io/test/support/dms1k1_nao.txt b/source/module_io/test/support/dms1k1_nao.txt deleted file mode 100644 index 9cacc456e0..0000000000 --- a/source/module_io/test/support/dms1k1_nao.txt +++ /dev/null @@ -1,119 +0,0 @@ -none - 1 - 2.74242 2.74242 0 - 2.74242 0 2.74242 - 0 2.74242 2.74242 - Si - 2 -Direct - 0 0 0 - 0.25 0.25 0.25 - - 1 - 0.47370 (fermi energy) - 26 26 - - (1.411e-01,0.000e+00) (-4.479e-03,3.208e-04) (-1.892e-02,3.039e-02) (-1.892e-02,3.039e-02) (1.892e-02,-3.039e-02) (-2.049e-03,-5.032e-03) (-2.049e-03,-5.032e-03) (2.049e-03,5.032e-03) - (-6.505e-17,-4.647e-18) (2.931e-03,6.477e-03) (-2.931e-03,-6.477e-03) (-2.100e-16,6.607e-17) (-2.931e-03,-6.477e-03) (-1.319e-02,3.501e-02) (9.561e-03,-5.528e-03) (-3.910e-02,-2.210e-02) - (-3.910e-02,-2.210e-02) (3.910e-02,2.210e-02) (8.654e-04,5.306e-03) (8.654e-04,5.306e-03) (-8.654e-04,-5.306e-03) (-4.228e-18,-5.908e-17) (2.387e-03,7.959e-03) (-2.387e-03,-7.959e-03) - (2.414e-17,-1.120e-16) (-2.387e-03,-7.959e-03) - (-4.479e-03,-3.208e-04) (9.195e-04,0.000e+00) (1.916e-03,-3.586e-03) (1.916e-03,-3.586e-03) (-1.916e-03,3.586e-03) (2.135e-04,4.567e-04) (2.135e-04,4.567e-04) (-2.135e-04,-4.567e-04) - (8.745e-18,3.795e-18) (-2.300e-04,-7.056e-04) (2.300e-04,7.056e-04) (4.757e-17,-2.079e-17) (2.300e-04,7.056e-04) (9.561e-03,-5.528e-03) (-4.169e-04,3.347e-04) (3.255e-03,1.374e-03) - (3.255e-03,1.374e-03) (-3.255e-03,-1.374e-03) (-1.056e-04,-4.964e-04) (-1.056e-04,-4.964e-04) (1.056e-04,4.964e-04) (-3.458e-18,9.195e-18) (-1.504e-04,-6.531e-04) (1.504e-04,6.531e-04) - (9.041e-18,4.286e-17) (1.504e-04,6.531e-04) - (-1.892e-02,-3.039e-02) (1.916e-03,3.586e-03) (9.698e-02,-4.337e-19) (-1.816e-02,0.000e+00) (1.816e-02,-7.954e-16) (-6.302e-03,-3.018e-03) (8.177e-04,4.709e-03) (-8.177e-04,-4.709e-03) - (2.109e-03,-1.254e-03) (-3.513e-03,-6.260e-03) (3.513e-03,6.260e-03) (1.259e-16,-4.158e-17) (-1.438e-02,-4.085e-03) (3.910e-02,2.210e-02) (-3.255e-03,-1.374e-03) (-6.310e-02,-2.161e-02) - (3.424e-02,3.990e-02) (-3.424e-02,-3.990e-02) (8.765e-03,-3.550e-03) (-1.382e-03,-8.205e-04) (1.382e-03,8.205e-04) (1.113e-03,2.186e-03) (-4.284e-03,-2.804e-03) (4.284e-03,2.804e-03) - (-4.082e-17,3.216e-17) (-1.637e-02,1.991e-03) - (-1.892e-02,-3.039e-02) (1.916e-03,3.586e-03) (-1.816e-02,3.469e-18) (9.698e-02,0.000e+00) (1.816e-02,-8.500e-16) (8.177e-04,4.709e-03) (-6.302e-03,-3.018e-03) (-8.177e-04,-4.709e-03) - (-1.055e-03,6.268e-04) (-3.513e-03,-6.260e-03) (-1.438e-02,-4.085e-03) (1.826e-03,-1.086e-03) (3.513e-03,6.260e-03) (3.910e-02,2.210e-02) (-3.255e-03,-1.374e-03) (3.424e-02,3.990e-02) - (-6.310e-02,-2.161e-02) (-3.424e-02,-3.990e-02) (-1.382e-03,-8.205e-04) (8.765e-03,-3.550e-03) (1.382e-03,8.205e-04) (-5.566e-04,-1.093e-03) (-4.284e-03,-2.804e-03) (-1.637e-02,1.991e-03) - (9.641e-04,1.893e-03) (4.284e-03,2.804e-03) - (1.892e-02,3.039e-02) (-1.916e-03,-3.586e-03) (1.816e-02,7.954e-16) (1.816e-02,8.431e-16) (9.698e-02,-8.674e-19) (-8.177e-04,-4.709e-03) (-8.177e-04,-4.709e-03) (-6.302e-03,-3.018e-03) - (1.055e-03,-6.268e-04) (-1.438e-02,-4.085e-03) (-3.513e-03,-6.260e-03) (1.826e-03,-1.086e-03) (-3.513e-03,-6.260e-03) (-3.910e-02,-2.210e-02) (3.255e-03,1.374e-03) (-3.424e-02,-3.990e-02) - (-3.424e-02,-3.990e-02) (-6.310e-02,-2.161e-02) (1.382e-03,8.205e-04) (1.382e-03,8.205e-04) (8.765e-03,-3.550e-03) (5.566e-04,1.093e-03) (-1.637e-02,1.991e-03) (-4.284e-03,-2.804e-03) - (9.641e-04,1.893e-03) (-4.284e-03,-2.804e-03) - (-2.049e-03,5.032e-03) (2.135e-04,-4.567e-04) (-6.302e-03,3.018e-03) (8.177e-04,-4.709e-03) (-8.177e-04,4.709e-03) (9.914e-04,-5.421e-20) (3.256e-05,-4.476e-17) (-3.256e-05,-3.980e-17) - (-4.627e-05,2.191e-04) (1.097e-04,-2.210e-04) (-1.097e-04,2.210e-04) (3.974e-18,-1.249e-17) (1.691e-03,-3.401e-04) (-8.654e-04,-5.306e-03) (1.056e-04,4.964e-04) (8.765e-03,-3.550e-03) - (-1.382e-03,-8.205e-04) (1.382e-03,8.205e-04) (-6.392e-04,4.871e-04) (-1.950e-04,-3.626e-04) (1.950e-04,3.626e-04) (-2.156e-04,-6.047e-05) (-4.245e-05,-5.221e-04) (4.245e-05,5.221e-04) - (1.307e-17,4.747e-18) (1.374e-03,-8.137e-04) - (-2.049e-03,5.032e-03) (2.135e-04,-4.567e-04) (8.177e-04,-4.709e-03) (-6.302e-03,3.018e-03) (-8.177e-04,4.709e-03) (3.256e-05,4.476e-17) (9.914e-04,0.000e+00) (-3.256e-05,-2.742e-17) - (2.313e-05,-1.095e-04) (1.097e-04,-2.210e-04) (1.691e-03,-3.401e-04) (-4.007e-05,1.897e-04) (-1.097e-04,2.210e-04) (-8.654e-04,-5.306e-03) (1.056e-04,4.964e-04) (-1.382e-03,-8.205e-04) - (8.765e-03,-3.550e-03) (1.382e-03,8.205e-04) (-1.950e-04,-3.626e-04) (-6.392e-04,4.871e-04) (1.950e-04,3.626e-04) (1.078e-04,3.023e-05) (-4.245e-05,-5.221e-04) (1.374e-03,-8.137e-04) - (-1.867e-04,-5.237e-05) (4.245e-05,5.221e-04) - (2.049e-03,-5.032e-03) (-2.135e-04,4.567e-04) (-8.177e-04,4.709e-03) (-8.177e-04,4.709e-03) (-6.302e-03,3.018e-03) (-3.256e-05,3.976e-17) (-3.256e-05,2.742e-17) (9.914e-04,-5.421e-20) - (-2.313e-05,1.095e-04) (1.691e-03,-3.401e-04) (1.097e-04,-2.210e-04) (-4.007e-05,1.897e-04) (1.097e-04,-2.210e-04) (8.654e-04,5.306e-03) (-1.056e-04,-4.964e-04) (1.382e-03,8.205e-04) - (1.382e-03,8.205e-04) (8.765e-03,-3.550e-03) (1.950e-04,3.626e-04) (1.950e-04,3.626e-04) (-6.392e-04,4.871e-04) (-1.078e-04,-3.023e-05) (1.374e-03,-8.137e-04) (-4.245e-05,-5.221e-04) - (-1.867e-04,-5.237e-05) (-4.245e-05,-5.221e-04) - (-6.505e-17,4.647e-18) (8.745e-18,-3.795e-18) (2.109e-03,1.254e-03) (-1.055e-03,-6.268e-04) (1.055e-03,6.268e-04) (-4.627e-05,-2.191e-04) (2.313e-05,1.095e-04) (-2.313e-05,-1.095e-04) - (7.842e-05,0.000e+00) (-1.075e-04,-1.921e-04) (1.075e-04,1.921e-04) (2.092e-19,-9.571e-20) (-2.151e-04,-3.843e-04) (4.814e-17,-3.873e-17) (-1.086e-17,6.162e-18) (-1.113e-03,-2.186e-03) - (5.566e-04,1.093e-03) (-5.566e-04,-1.093e-03) (2.156e-04,6.047e-05) (-1.078e-04,-3.023e-05) (1.078e-04,3.023e-05) (-5.119e-06,7.825e-05) (-1.847e-04,-1.199e-04) (1.847e-04,1.199e-04) - (-1.577e-18,-2.256e-18) (-3.694e-04,-2.397e-04) - (2.931e-03,-6.477e-03) (-2.300e-04,7.056e-04) (-3.513e-03,6.260e-03) (-3.513e-03,6.260e-03) (-1.438e-02,4.085e-03) (1.097e-04,2.210e-04) (1.097e-04,2.210e-04) (1.691e-03,3.401e-04) - (-1.075e-04,1.921e-04) (3.174e-03,0.000e+00) (5.354e-04,-9.107e-18) (-1.863e-04,3.328e-04) (5.354e-04,2.602e-18) (2.387e-03,7.959e-03) (-1.504e-04,-6.531e-04) (4.284e-03,2.804e-03) - (4.284e-03,2.804e-03) (1.637e-02,-1.991e-03) (4.245e-05,5.221e-04) (4.245e-05,5.221e-04) (-1.374e-03,8.137e-04) (-1.847e-04,-1.199e-04) (2.872e-03,-1.079e-03) (4.101e-04,-6.505e-04) - (-3.199e-04,-2.076e-04) (4.101e-04,-6.505e-04) - (-2.931e-03,6.477e-03) (2.300e-04,-7.056e-04) (3.513e-03,-6.260e-03) (-1.438e-02,4.085e-03) (-3.513e-03,6.260e-03) (-1.097e-04,-2.210e-04) (1.691e-03,3.401e-04) (1.097e-04,2.210e-04) - (1.075e-04,-1.921e-04) (5.354e-04,9.053e-18) (3.174e-03,0.000e+00) (-1.863e-04,3.328e-04) (-5.354e-04,-4.120e-18) (-2.387e-03,-7.959e-03) (1.504e-04,6.531e-04) (-4.284e-03,-2.804e-03) - (1.637e-02,-1.991e-03) (4.284e-03,2.804e-03) (-4.245e-05,-5.221e-04) (-1.374e-03,8.137e-04) (4.245e-05,5.221e-04) (1.847e-04,1.199e-04) (4.101e-04,-6.505e-04) (2.872e-03,-1.079e-03) - (-3.199e-04,-2.076e-04) (-4.101e-04,6.505e-04) - (-2.100e-16,-6.607e-17) (4.757e-17,2.079e-17) (1.259e-16,4.158e-17) (1.826e-03,1.086e-03) (1.826e-03,1.086e-03) (3.968e-18,1.248e-17) (-4.007e-05,-1.897e-04) (-4.007e-05,-1.897e-04) - (2.126e-19,9.656e-20) (-1.863e-04,-3.328e-04) (-1.863e-04,-3.328e-04) (7.842e-05,0.000e+00) (-8.243e-18,-8.362e-18) (1.701e-16,-3.250e-17) (-5.318e-17,-5.205e-20) (5.719e-18,-5.061e-17) - (-9.641e-04,-1.893e-03) (-9.641e-04,-1.893e-03) (1.792e-17,-6.380e-18) (1.867e-04,5.237e-05) (1.867e-04,5.237e-05) (3.528e-18,1.890e-18) (-3.199e-04,-2.076e-04) (-3.199e-04,-2.076e-04) - (-5.119e-06,7.825e-05) (-1.148e-17,1.884e-18) - (-2.931e-03,6.477e-03) (2.300e-04,-7.056e-04) (-1.438e-02,4.085e-03) (3.513e-03,-6.260e-03) (-3.513e-03,6.260e-03) (1.691e-03,3.401e-04) (-1.097e-04,-2.210e-04) (1.097e-04,2.210e-04) - (-2.151e-04,3.843e-04) (5.354e-04,-2.602e-18) (-5.354e-04,4.228e-18) (-8.243e-18,8.328e-18) (3.174e-03,2.168e-19) (-2.387e-03,-7.959e-03) (1.504e-04,6.531e-04) (1.637e-02,-1.991e-03) - (-4.284e-03,-2.804e-03) (4.284e-03,2.804e-03) (-1.374e-03,8.137e-04) (-4.245e-05,-5.221e-04) (4.245e-05,5.221e-04) (-3.694e-04,-2.397e-04) (4.101e-04,-6.505e-04) (-4.101e-04,6.505e-04) - (-2.439e-19,-5.153e-18) (2.872e-03,-1.079e-03) - (-1.319e-02,-3.501e-02) (9.561e-03,5.528e-03) (3.910e-02,-2.210e-02) (3.910e-02,-2.210e-02) (-3.910e-02,2.210e-02) (-8.654e-04,5.306e-03) (-8.654e-04,5.306e-03) (8.654e-04,-5.306e-03) - (4.814e-17,3.873e-17) (2.387e-03,-7.959e-03) (-2.387e-03,7.959e-03) (1.701e-16,3.250e-17) (-2.387e-03,7.959e-03) (1.411e-01,0.000e+00) (-4.479e-03,-3.208e-04) (1.892e-02,3.039e-02) - (1.892e-02,3.039e-02) (-1.892e-02,-3.039e-02) (2.049e-03,-5.032e-03) (2.049e-03,-5.032e-03) (-2.049e-03,5.032e-03) (-3.863e-17,6.101e-17) (2.931e-03,-6.477e-03) (-2.931e-03,6.477e-03) - (-8.559e-17,7.268e-17) (-2.931e-03,6.477e-03) - (9.561e-03,5.528e-03) (-4.169e-04,-3.347e-04) (-3.255e-03,1.374e-03) (-3.255e-03,1.374e-03) (3.255e-03,-1.374e-03) (1.056e-04,-4.964e-04) (1.056e-04,-4.964e-04) (-1.056e-04,4.964e-04) - (-1.086e-17,-6.162e-18) (-1.504e-04,6.531e-04) (1.504e-04,-6.531e-04) (-5.318e-17,5.205e-20) (1.504e-04,-6.531e-04) (-4.479e-03,3.208e-04) (9.195e-04,0.000e+00) (-1.916e-03,-3.586e-03) - (-1.916e-03,-3.586e-03) (1.916e-03,3.586e-03) (-2.135e-04,4.567e-04) (-2.135e-04,4.567e-04) (2.135e-04,-4.567e-04) (5.893e-18,-1.079e-17) (-2.300e-04,7.056e-04) (2.300e-04,-7.056e-04) - (4.840e-18,-4.135e-17) (2.300e-04,-7.056e-04) - (-3.910e-02,2.210e-02) (3.255e-03,-1.374e-03) (-6.310e-02,2.161e-02) (3.424e-02,-3.990e-02) (-3.424e-02,3.990e-02) (8.765e-03,3.550e-03) (-1.382e-03,8.205e-04) (1.382e-03,-8.205e-04) - (-1.113e-03,2.186e-03) (4.284e-03,-2.804e-03) (-4.284e-03,2.804e-03) (5.719e-18,5.042e-17) (1.637e-02,1.991e-03) (1.892e-02,-3.039e-02) (-1.916e-03,3.586e-03) (9.698e-02,0.000e+00) - (-1.816e-02,-2.741e-16) (1.816e-02,-1.110e-15) (-6.302e-03,3.018e-03) (8.177e-04,-4.709e-03) (-8.177e-04,4.709e-03) (-2.109e-03,-1.254e-03) (3.513e-03,-6.260e-03) (-3.513e-03,6.260e-03) - (-1.428e-17,-2.683e-17) (1.438e-02,-4.085e-03) - (-3.910e-02,2.210e-02) (3.255e-03,-1.374e-03) (3.424e-02,-3.990e-02) (-6.310e-02,2.161e-02) (-3.424e-02,3.990e-02) (-1.382e-03,8.205e-04) (8.765e-03,3.550e-03) (1.382e-03,-8.205e-04) - (5.566e-04,-1.093e-03) (4.284e-03,-2.804e-03) (1.637e-02,1.991e-03) (-9.641e-04,1.893e-03) (-4.284e-03,2.804e-03) (1.892e-02,-3.039e-02) (-1.916e-03,3.586e-03) (-1.816e-02,2.706e-16) - (9.698e-02,0.000e+00) (1.816e-02,-1.428e-15) (8.177e-04,-4.709e-03) (-6.302e-03,3.018e-03) (-8.177e-04,4.709e-03) (1.055e-03,6.268e-04) (3.513e-03,-6.260e-03) (1.438e-02,-4.085e-03) - (-1.826e-03,-1.086e-03) (-3.513e-03,6.260e-03) - (3.910e-02,-2.210e-02) (-3.255e-03,1.374e-03) (-3.424e-02,3.990e-02) (-3.424e-02,3.990e-02) (-6.310e-02,2.161e-02) (1.382e-03,-8.205e-04) (1.382e-03,-8.205e-04) (8.765e-03,3.550e-03) - (-5.566e-04,1.093e-03) (1.637e-02,1.991e-03) (4.284e-03,-2.804e-03) (-9.641e-04,1.893e-03) (4.284e-03,-2.804e-03) (-1.892e-02,3.039e-02) (1.916e-03,-3.586e-03) (1.816e-02,1.105e-15) - (1.816e-02,1.429e-15) (9.698e-02,0.000e+00) (-8.177e-04,4.709e-03) (-8.177e-04,4.709e-03) (-6.302e-03,3.018e-03) (-1.055e-03,-6.268e-04) (1.438e-02,-4.085e-03) (3.513e-03,-6.260e-03) - (-1.826e-03,-1.086e-03) (3.513e-03,-6.260e-03) - (8.654e-04,-5.306e-03) (-1.056e-04,4.964e-04) (8.765e-03,3.550e-03) (-1.382e-03,8.205e-04) (1.382e-03,-8.205e-04) (-6.392e-04,-4.871e-04) (-1.950e-04,3.626e-04) (1.950e-04,-3.626e-04) - (2.156e-04,-6.047e-05) (4.245e-05,-5.221e-04) (-4.245e-05,5.221e-04) (1.792e-17,6.383e-18) (-1.374e-03,-8.137e-04) (2.049e-03,5.032e-03) (-2.135e-04,-4.567e-04) (-6.302e-03,-3.018e-03) - (8.177e-04,4.709e-03) (-8.177e-04,-4.709e-03) (9.914e-04,0.000e+00) (3.256e-05,2.959e-17) (-3.256e-05,3.816e-17) (4.627e-05,2.191e-04) (-1.097e-04,-2.210e-04) (1.097e-04,2.210e-04) - (-7.891e-18,7.295e-18) (-1.691e-03,-3.401e-04) - (8.654e-04,-5.306e-03) (-1.056e-04,4.964e-04) (-1.382e-03,8.205e-04) (8.765e-03,3.550e-03) (1.382e-03,-8.205e-04) (-1.950e-04,3.626e-04) (-6.392e-04,-4.871e-04) (1.950e-04,-3.626e-04) - (-1.078e-04,3.023e-05) (4.245e-05,-5.221e-04) (-1.374e-03,-8.137e-04) (1.867e-04,-5.237e-05) (-4.245e-05,5.221e-04) (2.049e-03,5.032e-03) (-2.135e-04,-4.567e-04) (8.177e-04,4.709e-03) - (-6.302e-03,-3.018e-03) (-8.177e-04,-4.709e-03) (3.256e-05,-2.959e-17) (9.914e-04,0.000e+00) (-3.256e-05,1.271e-16) (-2.313e-05,-1.095e-04) (-1.097e-04,-2.210e-04) (-1.691e-03,-3.401e-04) - (4.007e-05,1.897e-04) (1.097e-04,2.210e-04) - (-8.654e-04,5.306e-03) (1.056e-04,-4.964e-04) (1.382e-03,-8.205e-04) (1.382e-03,-8.205e-04) (8.765e-03,3.550e-03) (1.950e-04,-3.626e-04) (1.950e-04,-3.626e-04) (-6.392e-04,-4.871e-04) - (1.078e-04,-3.023e-05) (-1.374e-03,-8.137e-04) (4.245e-05,-5.221e-04) (1.867e-04,-5.237e-05) (4.245e-05,-5.221e-04) (-2.049e-03,-5.032e-03) (2.135e-04,4.567e-04) (-8.177e-04,-4.709e-03) - (-8.177e-04,-4.709e-03) (-6.302e-03,-3.018e-03) (-3.256e-05,-3.816e-17) (-3.256e-05,-1.271e-16) (9.914e-04,-5.082e-21) (2.313e-05,1.095e-04) (-1.691e-03,-3.401e-04) (-1.097e-04,-2.210e-04) - (4.007e-05,1.897e-04) (-1.097e-04,-2.210e-04) - (-4.228e-18,5.908e-17) (-3.458e-18,-9.195e-18) (1.113e-03,-2.186e-03) (-5.566e-04,1.093e-03) (5.566e-04,-1.093e-03) (-2.156e-04,6.047e-05) (1.078e-04,-3.023e-05) (-1.078e-04,3.023e-05) - (-5.119e-06,-7.825e-05) (-1.847e-04,1.199e-04) (1.847e-04,-1.199e-04) (3.526e-18,-1.895e-18) (-3.694e-04,2.397e-04) (-3.863e-17,-6.101e-17) (5.893e-18,1.079e-17) (-2.109e-03,1.254e-03) - (1.055e-03,-6.268e-04) (-1.055e-03,6.268e-04) (4.627e-05,-2.191e-04) (-2.313e-05,1.095e-04) (2.313e-05,-1.095e-04) (7.842e-05,0.000e+00) (-1.075e-04,1.921e-04) (1.075e-04,-1.921e-04) - (-7.035e-19,5.459e-18) (-2.151e-04,3.843e-04) - (2.387e-03,-7.959e-03) (-1.504e-04,6.531e-04) (-4.284e-03,2.804e-03) (-4.284e-03,2.804e-03) (-1.637e-02,-1.991e-03) (-4.245e-05,5.221e-04) (-4.245e-05,5.221e-04) (1.374e-03,8.137e-04) - (-1.847e-04,1.199e-04) (2.872e-03,1.079e-03) (4.101e-04,6.505e-04) (-3.199e-04,2.076e-04) (4.101e-04,6.505e-04) (2.931e-03,6.477e-03) (-2.300e-04,-7.056e-04) (3.513e-03,6.260e-03) - (3.513e-03,6.260e-03) (1.438e-02,4.085e-03) (-1.097e-04,2.210e-04) (-1.097e-04,2.210e-04) (-1.691e-03,3.401e-04) (-1.075e-04,-1.921e-04) (3.174e-03,0.000e+00) (5.354e-04,1.594e-17) - (-1.863e-04,-3.328e-04) (5.354e-04,3.984e-18) - (-2.387e-03,7.959e-03) (1.504e-04,-6.531e-04) (4.284e-03,-2.804e-03) (-1.637e-02,-1.991e-03) (-4.284e-03,2.804e-03) (4.245e-05,-5.221e-04) (1.374e-03,8.137e-04) (-4.245e-05,5.221e-04) - (1.847e-04,-1.199e-04) (4.101e-04,6.505e-04) (2.872e-03,1.079e-03) (-3.199e-04,2.076e-04) (-4.101e-04,-6.505e-04) (-2.931e-03,-6.477e-03) (2.300e-04,7.056e-04) (-3.513e-03,-6.260e-03) - (1.438e-02,4.085e-03) (3.513e-03,6.260e-03) (1.097e-04,-2.210e-04) (-1.691e-03,3.401e-04) (-1.097e-04,2.210e-04) (1.075e-04,1.921e-04) (5.354e-04,-1.594e-17) (3.174e-03,0.000e+00) - (-1.863e-04,-3.328e-04) (-5.354e-04,1.428e-17) - (2.414e-17,1.120e-16) (9.041e-18,-4.286e-17) (-4.077e-17,-3.203e-17) (9.641e-04,-1.893e-03) (9.641e-04,-1.893e-03) (1.308e-17,-4.740e-18) (-1.867e-04,5.237e-05) (-1.867e-04,5.237e-05) - (-1.572e-18,2.264e-18) (-3.199e-04,2.076e-04) (-3.199e-04,2.076e-04) (-5.119e-06,-7.825e-05) (-2.372e-19,5.130e-18) (-8.559e-17,-7.268e-17) (4.840e-18,4.135e-17) (-1.423e-17,2.686e-17) - (-1.826e-03,1.086e-03) (-1.826e-03,1.086e-03) (-7.891e-18,-7.295e-18) (4.007e-05,-1.897e-04) (4.007e-05,-1.897e-04) (-7.128e-19,-5.457e-18) (-1.863e-04,3.328e-04) (-1.863e-04,3.328e-04) - (7.842e-05,8.470e-22) (8.911e-18,-8.301e-19) - (-2.387e-03,7.959e-03) (1.504e-04,-6.531e-04) (-1.637e-02,-1.991e-03) (4.284e-03,-2.804e-03) (-4.284e-03,2.804e-03) (1.374e-03,8.137e-04) (4.245e-05,-5.221e-04) (-4.245e-05,5.221e-04) - (-3.694e-04,2.397e-04) (4.101e-04,6.505e-04) (-4.101e-04,-6.505e-04) (-1.148e-17,-1.884e-18) (2.872e-03,1.079e-03) (-2.931e-03,-6.477e-03) (2.300e-04,7.056e-04) (1.438e-02,4.085e-03) - (-3.513e-03,-6.260e-03) (3.513e-03,6.260e-03) (-1.691e-03,3.401e-04) (1.097e-04,-2.210e-04) (-1.097e-04,2.210e-04) (-2.151e-04,-3.843e-04) (5.354e-04,-4.093e-18) (-5.354e-04,-1.423e-17) - (8.904e-18,7.971e-19) (3.174e-03,0.000e+00) \ No newline at end of file diff --git a/source/module_io/test/support/istate.info b/source/module_io/test/support/istate.info deleted file mode 100644 index 4e264ce662..0000000000 --- a/source/module_io/test/support/istate.info +++ /dev/null @@ -1,396 +0,0 @@ -BAND Energy(ev) Occupation Kpoint = 1 (0 0 0) - 1 -5.39094 0.03125 - 2 6.58565 0.03125 - 3 6.58565 0.03125 - 4 6.58565 0.03125 - 5 9.25834 0 - 6 9.25834 0 - 7 9.25834 0 - 8 10.1982 0 - - -BAND Energy(ev) Occupation Kpoint = 2 (-0.25 0 0) - 1 -4.60359 0.0625 - 2 2.52518 0.0625 - 3 5.73823 0.0625 - 4 5.73823 0.0625 - 5 8.74658 0 - 6 10.3609 0 - 7 10.3609 0 - 8 13.8368 0 - - -BAND Energy(ev) Occupation Kpoint = 3 (0.5 0 0) - 1 -3.01547 0.03125 - 2 -0.627449 0.03125 - 3 5.24336 0.03125 - 4 5.24336 0.03125 - 5 8.25279 0 - 6 10.3493 0 - 7 10.3493 0 - 8 17.043 0 - - -BAND Energy(ev) Occupation Kpoint = 4 (0 -0.25 0) - 1 -4.60359 0.0625 - 2 2.52518 0.0625 - 3 5.73823 0.0625 - 4 5.73823 0.0625 - 5 8.74658 0 - 6 10.3609 0 - 7 10.3609 0 - 8 13.8368 0 - - -BAND Energy(ev) Occupation Kpoint = 5 (-0.25 -0.25 0) - 1 -4.32308 0.0625 - 2 3.06875 0.0625 - 3 4.518 0.0625 - 4 4.518 0.0625 - 5 7.70984 0 - 6 10.5801 0 - 7 12.7164 0 - 8 12.7164 0 - - -BAND Energy(ev) Occupation Kpoint = 6 (0.5 -0.25 0) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 7 (0.25 -0.25 0) - 1 -3.34825 0.0625 - 2 1.05885 0.0625 - 3 2.52698 0.0625 - 4 5.11615 0.0625 - 5 9.27794 0 - 6 11.684 0 - 7 12.0993 0 - 8 13.4996 0 - - -BAND Energy(ev) Occupation Kpoint = 8 (0 0.5 0) - 1 -3.01547 0.03125 - 2 -0.627449 0.03125 - 3 5.24336 0.03125 - 4 5.24336 0.03125 - 5 8.25279 0 - 6 10.3493 0 - 7 10.3493 0 - 8 17.043 0 - - -BAND Energy(ev) Occupation Kpoint = 9 (-0.25 0.5 0) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 10 (0.5 0.5 0) - 1 -1.25202 0.03125 - 2 -1.25202 0.03125 - 3 3.4817 0.03125 - 4 3.4817 0.03125 - 5 7.41106 0 - 6 7.41106 0 - 7 16.9786 0 - 8 16.9786 0 - - -BAND Energy(ev) Occupation Kpoint = 11 (0 0 -0.25) - 1 -4.60359 0.0625 - 2 2.52518 0.0625 - 3 5.73823 0.0625 - 4 5.73823 0.0625 - 5 8.74658 0 - 6 10.3609 0 - 7 10.3609 0 - 8 13.8368 0 - - -BAND Energy(ev) Occupation Kpoint = 12 (-0.25 0 -0.25) - 1 -4.32308 0.0625 - 2 3.06875 0.0625 - 3 4.518 0.0625 - 4 4.518 0.0625 - 5 7.70984 0 - 6 10.5801 0 - 7 12.7164 0 - 8 12.7164 0 - - -BAND Energy(ev) Occupation Kpoint = 13 (0.5 0 -0.25) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 14 (0.25 0 -0.25) - 1 -3.34825 0.0625 - 2 1.05885 0.0625 - 3 2.52698 0.0625 - 4 5.11615 0.0625 - 5 9.27794 0 - 6 11.684 0 - 7 12.0993 0 - 8 13.4996 0 - - -BAND Energy(ev) Occupation Kpoint = 15 (0 -0.25 -0.25) - 1 -4.32308 0.0625 - 2 3.06875 0.0625 - 3 4.518 0.0625 - 4 4.518 0.0625 - 5 7.70984 0 - 6 10.5801 0 - 7 12.7164 0 - 8 12.7164 0 - - -BAND Energy(ev) Occupation Kpoint = 16 (-0.25 -0.25 -0.25) - 1 -4.60359 0.0625 - 2 2.52518 0.0625 - 3 5.73823 0.0625 - 4 5.73823 0.0625 - 5 8.74658 0 - 6 10.3609 0 - 7 10.3609 0 - 8 13.8368 0 - - -BAND Energy(ev) Occupation Kpoint = 17 (0.5 -0.25 -0.25) - 1 -3.34825 0.0625 - 2 1.05885 0.0625 - 3 2.52698 0.0625 - 4 5.11615 0.0625 - 5 9.27794 0 - 6 11.684 0 - 7 12.0993 0 - 8 13.4996 0 - - -BAND Energy(ev) Occupation Kpoint = 18 (0.25 -0.25 -0.25) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 19 (0 0.5 -0.25) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 20 (-0.25 0.5 -0.25) - 1 -3.34825 0.0625 - 2 1.05885 0.0625 - 3 2.52698 0.0625 - 4 5.11615 0.0625 - 5 9.27794 0 - 6 11.684 0 - 7 12.0993 0 - 8 13.4996 0 - - -BAND Energy(ev) Occupation Kpoint = 21 (0.5 0.5 -0.25) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 22 (0.25 0.5 -0.25) - 1 -1.0398 0.0625 - 2 -1.0398 0.0625 - 3 2.39103 0.0625 - 4 2.39103 0.0625 - 5 11.3786 0 - 6 11.3786 0 - 7 11.9831 0 - 8 11.9831 0 - - -BAND Energy(ev) Occupation Kpoint = 23 (0 0.25 -0.25) - 1 -3.34825 0.0625 - 2 1.05885 0.0625 - 3 2.52698 0.0625 - 4 5.11615 0.0625 - 5 9.27794 0 - 6 11.684 0 - 7 12.0993 0 - 8 13.4996 0 - - -BAND Energy(ev) Occupation Kpoint = 24 (-0.25 0.25 -0.25) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 25 (0.5 0.25 -0.25) - 1 -1.0398 0.0625 - 2 -1.0398 0.0625 - 3 2.39103 0.0625 - 4 2.39103 0.0625 - 5 11.3786 0 - 6 11.3786 0 - 7 11.9831 0 - 8 11.9831 0 - - -BAND Energy(ev) Occupation Kpoint = 26 (0.25 0.25 -0.25) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 27 (0 0 0.5) - 1 -3.01547 0.03125 - 2 -0.627449 0.03125 - 3 5.24336 0.03125 - 4 5.24336 0.03125 - 5 8.25279 0 - 6 10.3493 0 - 7 10.3493 0 - 8 17.043 0 - - -BAND Energy(ev) Occupation Kpoint = 28 (-0.25 0 0.5) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 29 (0.5 0 0.5) - 1 -1.25202 0.03125 - 2 -1.25202 0.03125 - 3 3.4817 0.03125 - 4 3.4817 0.03125 - 5 7.41106 0 - 6 7.41106 0 - 7 16.9786 0 - 8 16.9786 0 - - -BAND Energy(ev) Occupation Kpoint = 30 (0 -0.25 0.5) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 31 (-0.25 -0.25 0.5) - 1 -3.34825 0.0625 - 2 1.05885 0.0625 - 3 2.52698 0.0625 - 4 5.11615 0.0625 - 5 9.27794 0 - 6 11.684 0 - 7 12.0993 0 - 8 13.4996 0 - - -BAND Energy(ev) Occupation Kpoint = 32 (0.5 -0.25 0.5) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 33 (0.25 -0.25 0.5) - 1 -1.0398 0.0625 - 2 -1.0398 0.0625 - 3 2.39103 0.0625 - 4 2.39103 0.0625 - 5 11.3786 0 - 6 11.3786 0 - 7 11.9831 0 - 8 11.9831 0 - - -BAND Energy(ev) Occupation Kpoint = 34 (0 0.5 0.5) - 1 -1.25202 0.03125 - 2 -1.25202 0.03125 - 3 3.4817 0.03125 - 4 3.4817 0.03125 - 5 7.41106 0 - 6 7.41106 0 - 7 16.9786 0 - 8 16.9786 0 - - -BAND Energy(ev) Occupation Kpoint = 35 (-0.25 0.5 0.5) - 1 -2.65582 0.0625 - 2 0.121686 0.0625 - 3 2.78846 0.0625 - 4 4.17361 0.0625 - 5 8.28496 0 - 6 11.6477 0 - 7 12.7239 0 - 8 13.1187 0 - - -BAND Energy(ev) Occupation Kpoint = 36 (0.5 0.5 0.5) - 1 -3.01547 0.03125 - 2 -0.627449 0.03125 - 3 5.24336 0.03125 - 4 5.24336 0.03125 - 5 8.25279 0 - 6 10.3493 0 - 7 10.3493 0 - 8 17.043 0 - - diff --git a/source/module_io/test/support/kpoints b/source/module_io/test/support/kpoints deleted file mode 100644 index 9c7db0701b..0000000000 --- a/source/module_io/test/support/kpoints +++ /dev/null @@ -1,38 +0,0 @@ - nkstot now = 36 - KPT DirectX DirectY DirectZ Weight - 1 0 0 0 0.015625 - 2 -0.25 0 0 0.03125 - 3 0.5 0 0 0.015625 - 4 0 -0.25 0 0.03125 - 5 -0.25 -0.25 0 0.03125 - 6 0.5 -0.25 0 0.03125 - 7 0.25 -0.25 0 0.03125 - 8 0 0.5 0 0.015625 - 9 -0.25 0.5 0 0.03125 - 10 0.5 0.5 0 0.015625 - 11 0 0 -0.25 0.03125 - 12 -0.25 0 -0.25 0.03125 - 13 0.5 0 -0.25 0.03125 - 14 0.25 0 -0.25 0.03125 - 15 0 -0.25 -0.25 0.03125 - 16 -0.25 -0.25 -0.25 0.03125 - 17 0.5 -0.25 -0.25 0.03125 - 18 0.25 -0.25 -0.25 0.03125 - 19 0 0.5 -0.25 0.03125 - 20 -0.25 0.5 -0.25 0.03125 - 21 0.5 0.5 -0.25 0.03125 - 22 0.25 0.5 -0.25 0.03125 - 23 0 0.25 -0.25 0.03125 - 24 -0.25 0.25 -0.25 0.03125 - 25 0.5 0.25 -0.25 0.03125 - 26 0.25 0.25 -0.25 0.03125 - 27 0 0 0.5 0.015625 - 28 -0.25 0 0.5 0.03125 - 29 0.5 0 0.5 0.015625 - 30 0 -0.25 0.5 0.03125 - 31 -0.25 -0.25 0.5 0.03125 - 32 0.5 -0.25 0.5 0.03125 - 33 0.25 -0.25 0.5 0.03125 - 34 0 0.5 0.5 0.015625 - 35 -0.25 0.5 0.5 0.03125 - 36 0.5 0.5 0.5 0.015625 diff --git a/source/module_io/test/support/sc.json b/source/module_io/test/support/sc.json deleted file mode 100644 index b470125be9..0000000000 --- a/source/module_io/test/support/sc.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "element": "Si", - "itype": 1, - "ScAtomData": [ - { - "index": 0, - "lambda": [0.1, 0.1, 0.2], - "sc_spin_val": 1.0, - "sc_spin_angle1": 30.0, - "sc_spin_angle2": 45.0 - }, - { - "index": 4, - "lambda": [0.2, 0.4, 0.5], - "sc_spin_val": 1.5, - "sc_spin_angle1": 60.0, - "sc_spin_angle2": 90.0 - } - ] - } -] diff --git a/source/module_io/test/support/wfs1_nao.txt b/source/module_io/test/support/wfs1_nao.txt deleted file mode 100644 index 013c28170a..0000000000 --- a/source/module_io/test/support/wfs1_nao.txt +++ /dev/null @@ -1,14 +0,0 @@ -3 (number of bands) -3 (number of orbitals) -1 (band) --7.5199188050468579458396334e-01 (Ry) -2.5000000000000000000000000e-01 (Occupations) -5.3759239842e-01 3.7570058235e-02 1.5292654624e-02 -2 (band) -3.1482195194888534794941393e-01 (Ry) -0.0000000000000000000000000e+00 (Occupations) -1.8587183851e+00 5.9595655928e-01 5.3528900615e-02 -3 (band) -7.4141254894954844445464914e-01 (Ry) -0.0000000000000000000000000e+00 (Occupations) -3.5389238463e-02 5.6401881891e-01 2.3262992046e-02 diff --git a/source/module_io/test/support/wfs1k1_nao.txt b/source/module_io/test/support/wfs1k1_nao.txt deleted file mode 100644 index b98f72154a..0000000000 --- a/source/module_io/test/support/wfs1k1_nao.txt +++ /dev/null @@ -1,52 +0,0 @@ -1 (index of k points) --0.10540388 -0.06085495 -0.04303095 -3 (number of bands) -63 (number of orbitals) -1 (band) --6.03571945e-01 (Ry) -5.83090379e-03 (Occupations) --6.71651157e-03 2.25946383e-02 1.43180123e-03 1.46451488e-03 2.31452033e-03 -1.18949691e-03 3.86105126e-03 -5.30361525e-03 -9.45760546e-03 1.29911511e-02 --5.46035106e-03 7.50044462e-03 1.07440727e-03 -1.52230629e-03 -2.63174959e-03 3.72887365e-03 -1.51944133e-03 2.15286620e-03 -1.22115353e-04 -3.37537766e-04 -2.99120310e-04 8.26795292e-04 1.72697191e-04 4.77350484e-04 1.62647420e-01 -2.84198177e-01 2.30018187e-01 -4.01916916e-01 1.32801062e-01 -2.32046840e-01 --1.87809063e-01 3.28163787e-01 -3.25294839e-01 5.68396353e-01 -2.52010188e-03 4.07977110e-03 -3.56396226e-03 5.76966762e-03 -2.05765457e-03 3.33111915e-03 -2.90996300e-03 -4.71091388e-03 5.04020376e-03 -8.15954220e-03 -1.29707431e-03 2.57674619e-03 -1.83434009e-03 3.64406943e-03 -1.05905675e-03 2.10390446e-03 -1.49773241e-03 -2.97537023e-03 2.59414864e-03 -5.15349241e-03 -3.97550843e-04 1.44683940e-03 -6.06854639e-04 1.01883141e-03 -3.50367689e-04 5.88222591e-04 --7.83445970e-04 1.31530570e-03 -1.35696822e-03 2.27817630e-03 -3.03660261e-14 6.17920665e-14 4.58600653e-04 -7.28132783e-05 -5.77273744e-04 -1.85618417e-04 -8.37425341e-04 -1.20858286e-03 4.83487746e-04 -6.97775642e-04 1.08111146e-03 -1.56027376e-03 1.87253999e-03 -2.70247344e-03 5.43592135e-14 1.09205667e-13 --1.63985332e-03 1.45546190e-03 -6.90799158e-02 7.52891979e-02 -1.23303889e-02 1.18105312e-02 2.35076693e-03 -2.40917316e-03 1.73947004e-03 7.26573136e-04 --4.26081388e-03 -1.77973354e-03 -2.45998205e-03 -1.02752963e-03 1.00801595e-03 6.43220132e-04 -2.46912478e-03 -1.57556109e-03 -1.42554985e-03 -9.09650620e-04 -8.31609942e-04 -7.66286321e-04 -2.03702004e-03 1.87701049e-03 -1.17607407e-03 1.08369251e-03 4.20973368e-04 3.56330622e-04 5.95346235e-04 5.03927605e-04 -3.43723309e-04 2.90942739e-04 -4.86098172e-04 -4.11455162e-04 -8.41946729e-04 -7.12661247e-04 -9.13243785e-04 1.05899942e-03 -1.29152174e-03 1.49765135e-03 --7.45660429e-04 8.64669414e-04 1.05452309e-03 -1.22282721e-03 1.82648757e-03 -2.11799886e-03 -2 (band) --5.98035141e-01 (Ry) -5.83090379e-03 (Occupations) -8.76573314e-12 -1.93189785e-11 -2.88265028e-12 2.17773729e-11 1.30377913e-12 1.08304110e-12 1.86874275e-03 -3.83200170e-03 4.77752128e-04 -9.74112406e-04 -4.93909685e-04 -1.02242215e-03 -8.69663301e-04 9.99617996e-03 -2.27023949e-04 2.54336238e-03 -2.21727797e-04 2.66313376e-03 -1.00166656e-03 -6.52953581e-04 --2.54534300e-04 -1.66737767e-04 -2.67418877e-04 -1.72909618e-04 -2.09966472e-01 8.66452869e-01 -4.38318350e-02 8.33279277e-02 -2.53687609e-03 -3.77906886e-02 --6.92320060e-02 2.56156425e-01 -9.70415824e-02 3.28828213e-01 7.80900421e-05 -7.50681575e-03 6.25495844e-04 1.58763114e-03 2.82147356e-04 1.37535219e-03 -2.15884927e-04 -1.47618579e-03 4.71882337e-04 -1.21702170e-03 -2.36044268e-03 -3.70876954e-03 7.57854259e-04 4.35580000e-03 5.47455951e-04 2.30034290e-03 --3.87325116e-04 4.19702299e-04 -1.97217235e-04 1.92242675e-03 3.07908989e-04 -1.63705170e-03 -3.15643160e-04 6.71944470e-04 -2.15015255e-04 5.26439964e-04 --3.59293523e-05 4.81481439e-04 1.08688035e-05 3.83755318e-04 -3.10906988e-05 4.97587622e-05 -3.44252715e-04 1.83027944e-03 1.26978712e-04 -1.21953671e-04 --7.97470891e-04 -7.26654020e-05 -5.03990942e-04 -3.65931298e-05 1.70020992e-04 6.99411230e-05 3.03428152e-04 8.33737407e-05 -9.22641794e-05 -9.81936674e-06 --1.41966518e-04 1.36348352e-04 -5.23158411e-11 9.36178642e-11 -7.61140957e-12 1.33921232e-11 1.60351645e-12 -2.80310950e-12 -3.68099832e-02 3.39093687e-02 --9.38688683e-03 8.60833803e-03 -9.77002385e-03 9.06746575e-03 1.26048501e-02 -9.38568640e-03 3.21308226e-03 -2.38129953e-03 3.34775327e-03 -2.51215074e-03 -7.23632039e-03 -7.58482248e-03 1.84585348e-03 -1.92607628e-03 1.91973920e-03 -2.02721742e-03 -3.17187254e-03 2.40033423e-03 2.76651822e-03 -4.17266025e-03 -1.53599165e-03 -2.10378487e-03 5.44005293e-05 -7.00804085e-04 9.65945330e-04 -2.20460639e-03 -1.19968502e-03 2.33511242e-03 2.54847151e-04 4.35625490e-05 -2.17988065e-04 -1.84173316e-04 -2.34349428e-04 6.32902387e-04 -1.95343398e-04 7.57764774e-04 -3 (band) --5.98035141e-01 (Ry) -5.83090379e-03 (Occupations) -9.86470874e-13 -5.95387122e-12 4.82573453e-13 5.54264959e-12 3.66087151e-13 1.96386245e-13 9.49023673e-05 -4.04693771e-04 5.20920946e-04 -2.33076310e-03 --8.35155442e-04 3.75083842e-03 1.33229060e-04 9.69176971e-04 8.23664081e-04 5.56014508e-03 -1.33242086e-03 -8.94514217e-03 -1.09337525e-04 -4.04444133e-05 --6.30599887e-04 -2.25793277e-04 1.01491773e-03 3.62486910e-04 -1.24770866e-03 8.69136907e-02 1.18610223e-02 -3.89305996e-01 -2.57019678e-02 6.86121492e-01 --1.51258921e-02 -4.98987709e-01 6.00330846e-03 3.36374550e-01 -1.54719250e-04 -7.15401601e-04 2.04082973e-04 2.22148712e-03 -1.34550154e-04 -3.48501679e-03 -1.74768920e-03 5.61539133e-03 -9.97009876e-04 -3.45167204e-03 -3.04528154e-04 -3.01628967e-04 4.33629845e-04 -6.49120521e-04 -3.61575730e-04 2.02013352e-03 -3.23047521e-03 4.80451613e-03 -1.85836988e-03 -2.55898463e-03 -6.08492343e-06 -1.62294338e-04 -2.12474945e-05 7.08757263e-04 8.89565597e-07 -1.05044613e-03 --1.20576279e-04 -1.99432825e-03 8.29691217e-05 1.21455445e-03 1.97898051e-04 -5.68319065e-04 6.80315141e-06 1.81450586e-04 9.43843306e-06 -1.43374981e-05 --2.62559569e-04 7.70285858e-05 2.72016255e-04 -1.08142226e-04 1.92623971e-05 -1.71028330e-04 2.97332706e-05 1.01835109e-04 9.45113900e-04 -1.11433987e-04 --1.05524891e-05 1.60298109e-05 -7.10509754e-12 2.44531935e-11 -1.03733385e-12 3.40512767e-12 2.18792113e-13 -7.24424287e-13 -2.76730418e-03 4.01903148e-03 --1.56573360e-02 2.32565523e-02 2.51625219e-02 -3.74396459e-02 9.95687062e-04 -1.16460848e-03 5.65048270e-03 -6.75077464e-03 -9.08286605e-03 1.08691821e-02 -5.24168776e-04 -8.77432567e-04 2.95875368e-03 -5.07255076e-03 -4.75406840e-03 8.16547713e-03 -2.49721541e-04 2.96724144e-04 2.08318252e-04 9.39165110e-04 -3.92497623e-05 -2.65051245e-03 2.81714661e-03 -5.26537445e-03 -1.58801422e-03 2.77035026e-03 -6.36234192e-05 2.47924813e-04 1.27026963e-04 -9.86912246e-04 --1.59672985e-04 1.68480281e-03 5.75804420e-04 -1.62364450e-03 -3.39617142e-04 1.05133952e-03 diff --git a/source/module_io/test/support/wfs1k1_pw.dat b/source/module_io/test/support/wfs1k1_pw.dat deleted file mode 100644 index cb145271ab279e8833787177771de14773f4c0bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8492 zcmaKQ2{hH;yFMaPG87pqijpEB8t819Glfi%B2y^yl*&BML*^m#JRS4Y*%B#~Aw$TR zBs5Bi;=lLz{?EPN^;_%Sv({>QH53dM9#~>hqK>-63XNEf4#oK|5(BQkN>xoj3?(I=4z+%eE^mAog%c*QUBO3std$mir3uUHR0C$Ho^&XM=z99a)OCv%hc zWIQ>>>wmugjlrCFjw`oOP<-Bdvd`saEPOHZwGCKhgI1Yy=1R?tP_0t_`t$Y|Ko0EJ zoD+Eo?P8zqD3+Q4dnPL$Dx>_@*cUH5QGUnfi4He(|JdNfNqj%BQ2Dr{b~YRqH;k4r ztO6{h;rf>lerV#;I>ygPP2HHbsDa)O94}eewgW~FDU12AcqkpVcYGu+59}~zf9;C+ zC}!y8F<(V-dck{?cMr08hVw6fXr{bFG0*wnb{xy}#HeBXjyac)1cdh#&DO;EIOh8| z-k^Mx=^?F2RIf>)tQgmux@uyL^~650`iS*3=$NNEA-z@aUT|Z*gPQ(P4k*65_P!Cv zH3~-za6c*<*VJ%7X1l(7O(8zV_^{iUuj$0YNUX0xeUKg3%lAH7itEz^%{b$@TFAQ$ z*EhT?l!x)fCV6jg{YBHSqqsgz)a6gOzOA##0bK85M2z4Zy1%(3xQss^Z@xMU&i`ov zY&b9bwW}M~yWXl)hVz#WkDK6ni)Kt3xSq_u<0ou;Qj`x~(~D}wWpQ*4GfZ$f*z9`niXs#L>qj9RY~=A$fPx50d{ZGslpA7|`1 ziSx3y;}`M$lyR>?tY;U)!)5HpAImHIF~8yS+vXS_P)qnnpL8u$N?|DyyvzbE&S266w})Q-D2BfbCwK}O6s zKM*;9?+2fM^G`qavE=07dZX-)GB{s$x91+Ncd{mR8|JUIaIwMtqEt|9!}X0|wKMLQ zkEtOS#%CSt=E9$UVB(+^&c96j@fy#UsFOh?&bv`XP2u@kDUaL2dR%(ODe&_ls~)O= z^;Q?M@!@*>vz&GKK7MBL+wX>WT2n$ed^g;$CAjVft3t=cN;}G-^wYzv?cRBiXKdHf zpYP6u5H~t#7$HrPZ!Rz>=qLx(7q5MK>YWG9dvc33Cxio*5iuWhAFx_`28!tBz(Qx^ zdWr3+u!%aj;I17J%1=uF{A*MQ0i&#w=;^yKV!1_lE6o88ICr0tQ1Aj^576`*a{)$A zF2z3+jfMd%pL48o0-;crBC+ySAdJ71_l0)a3(`(%bfXyTC|-8hKJ5htd;)|!MWca( zYo`vvgM<;r6>$YGc%h)I74gC4(F0`-NlKDWp#`Fx`)qbF88gG+Fcn+>T_^2PQ+y`p8 zc7IK4e+E<<4TxSR%0Ql~r1i0zxgdS-hW)j(@gQZ}BYTd*2;k>%#cAZ%Q@{|g%lPm@ zGq~y}kUllk2RuAwerW}D0&nAtpK;e4fVh3bBTHH$5T9>=95fF>%AVIeMeAW;-(Nby zPm40}`ub7*>abie>EC!OjT`Abpm$-pF$Kgi?6vb<%mpLKw3RB7>A-obFQhoG5okO5 zFk4O$!Mh=g8J>zj!91<*u4 zO$6rtm2;VTg5o30)n}13sZn!iXPkrtNn@{4mD0o`C8@(^D}9a)J4< z`CcLk;o)Px)5Zu7PxHDoAwEba5p_OGuMiGStoEULP|enr71e|E&lC-i9$4uk@($^N zw1Z&;q!;?ymDK-jD};<(%9aO@)h|F=QkXBP`}_@_TPi3U(nyhak40`5i-!wQ=@*uriSqE zK8v}qENhBJO)?!4mDUT8A20>{En8|#fjw1c53X92LCHyuR^%7lkcDZ;PpBw&BOmz* zHOCA5k>BvdZv_M7HQXnS+_C8iv$*By04iCC|(&j7R6X8y^8vO#O{JAA{*x(jn_#DUO z!E|%NW7Flgsq+<}AALa+^$WnT==lnCAMgfAeb2270G`!W?{n8%plOcxA20D*Xn#j) zMkaL-%Jf!g5(Qqtt!|@roA4KK^Hb!dp{h2><@QT4UN;@SFX!L3?j8^4j(#ot#a9jE z7>@+@(Uihx9XfZnJ+6fbQ*1BBP=9aA&_Wc0XxSSbqv-ka*qKs?@ZdZZdkVsXN$w}g z3A*XvOO37mntMDb^=9$A9sUA{=Pe`-SG57fz=u6Z4;W;}tT*ckNeHK9&KoW7XaHzna0c9G~W@TMbxu z-Lg69mjU*Dx~bKyodD_`)rlQ7`H)rWw5wo7CiHgs7A5<-6V^V;uAH%Z0%`LcGnHvN z;hBStFNH^2;q<;nTBD{c_>gxYNO~n11}cLy^lY^-ZMD|kWTG6Z=JytTTxx^%9Dgrp zR5imMUn^NDt4hes%6c)2rV##oMH4%!RRrRa&8lmI(eI56w}a1ANx(W-ik42O4g`FR zpmw@O1l5X;jQ0LBVs(&_}=fYKj@dhwt3fOxZ#O+qjO^iC>14dc*M=5lZ(KnxcNeZ4VM)hbjqu|7NJ7e!>LO zi;Xv0MX>Ej+2gw4Y^Z&HE(G}j*j+SKGHD7yx?1~Fq*9@R}0l7{sN@$+I zsfiXnp^VJ`{=R*6VLxlt+iJLI#aC)#Tm+eGC6=g7h9FhHS+B1~Hg|*J*=qWuQoS@H@v{ zKX`_5`_bZQcUWU69k|?vem{{+h{0=#faQw728yBeF!iaRwM3}hd0iRdL6}RFQt7li zC|TY`LVR%aplY=Kw=yWqZs3wX+yi~f$B&=6-3FH8b+r?+)p~Kyr;^|ai_Y4eA6fuQ(P(I* zYZbWRpYtU4FA*?38SXsyCm*<7HJksqtrkWmWsZlA7Qt*T5e)96%h{gT3b^=B2%iwG1=-E&<}Y{W!kRqyqDz^{@HzS?Ms8{x zm~87AXkZ8dzCeMO(lqTE39ak)T zm}x5DjLUcLcYQgKkM`IPf_D-WI=V=ir4|L{oyDwEXR^T`)~|~R+({scj^hOzdo0vj zy!UzaKoHc`+FfTXnhaK?qe0E3y(GjBWQZD`mC1JC;vwGis6L1X+XR;F(tr)M z8MldOGL*E@)I@mbN$b+X${q_Y#VQ8>IuHbS@-0+QJs4Meo*mVLvF4K2z&i=V&#*XW zt3`pw2Qwcs(Nuug@PiI>eL0{k*?koG0biO&t)Bgp53LkqFYo%$0$72@nVrW2Ocz+*~&|egXu??cGNM1z}LpN zhkADBg67BR0m_-lU{9pr6XZ8k9q%taE?Ns)!afL7aW_M)aN#uLD@3U1Ztil!;TbUG z^4o{z1rVzuw9z~PsWWHA!$*t%`?=MRX>)na8v-0D9v?`Mh=q!Wgj%FbtAQxf%%uQh=xQ zku;)c4y=qlQF{U5L;DK%xFfvTiM+0(VwGShhwH~*_j*{hFsIB)iU4D!R}@9Ul!+c@_w>WUV-%GIv=fBiPHSa<3oyF&-q9_h4a8JQ_K~t&5QHr9*c zmyNf6<9P66XFA3+hv{Czc-viq?O4CpCBCgq#23eKpl2_tm#gd%i1o?nY0zSQ2ET1j z;`*v|B|*5p`q?^0T;IRr`g6=@sA4IP`_X&kdLpiG(JsRJPrr^cZO42Hz1q_F{;i9J zTm2|s189SBKJm}SQQQyX9m|cl9$V%HHLkaCSLf>x>hcoCy9ct%V?Ny{ zw}&xaa$%z%`|Z$pPaXG*V`~o;&h!7N-jDB3F)q1czWYo}mN<57sBp#guZv}lU_Re3 ze3=+OyHN2O^G$mTc;VRTj-D~b>uLU>#PcwBMsFA9XFEKlgY#*b_y5tGD#2}!^9TC7 zO0d6uA+*8RzwepihcRA@`osvvyAJgUVZMBB&NQrNkCN_ZT+bGcS71H-_Q|)gp0EPX z^SB>|R4*!UzIcxk1;!h_^Iybqi1>X^+<)qx)A`sh+V4rjcpjTGU6pbFV|glzaQ{=U z#0*vRlVYue0aYD_rjvy~S66Rum`gYyU3<<+pB%~R|hSdU&MXCj`j zLyA~DrhnQ5faEel$;%BXi>Ky*z2McJ zRZe^8dzy44^g$G~9`Ur><&p?Yvzug3tocCxF`ChHt)XBr!=%;>#d_(v<^&W2N^jL} zg#X?3gShUT2(I~TvJ|zM14{YO3LY+dSb2EC-H^A56KX#Sh7cYm(7zqo=IuI@U{F&kp+D)Tf_I;qQ@U-X|V?NnnuB3n2efrTQf-++ik6v->5<@fgNuwe&~R;xJ$qGlsZ87@Td$|7Y|Sqr9hz5<`_ ze!H<2o=?iSl{?M%w;wQ{e4`&XGzJYy3=)T<<3WI^S2O$WOz3Maues9e3)9yO**NLK zf!>m$YmJl!xR5g`wemq9`f_qbZgBg7uT*iaoPpu+&eOcwuAA0yeeWTHFB1oJVn*t-Xk@|My_fTiwW?6OW>oRx=5p)hlfe12Uu#|VqyL|(oXWa$Jrq1{K))G^ z;^5555AJin{J=e#&{>XG5iljbZ1ILmG>|ZNE257`f-%#~TqfY>5PYliq01!=td zsbm4GxUkM@vnuSo8+q9Y;n`YE!oPo(S_Cfu1HToW-mdg!4@!euRg3mdIbz;>MoC|!Z_{n=H~A@z@V4FXLmn` zAYaOwc5;6`Y3$a82WB1qK$IpmBE~WbJ~UDc8AN{1X(xY?M}7}-@~#@9etBgxeHTUj zvbGHFLHFZ*q)-bxY$wd_Pn~6H3oQ=m1e7=5Qo(B0*Ecaq__uNer|j8C+t}*0-=3ug6hleXz*yYyW8yE zbND!Kva{N70Qk;t22foyBosssCz3|ZNnID?j~k-AiU*f;1tyQ5!%yzXMbPAxW zg?4GnN)`4NaZ3au`~~#4*?WZdFSxDMiuknLc0Zy;e3{g0AAcm+l6=j@Jtx-cNkVTN zSiO)Q!{8s8f=JKCzI``?k=~~(+>RSaudR?}*ggLMFg8V(^r0&n-lzHVpw4>`6i8A3 z8b`l7DBf~=o!*m7XbCDbpLtwDXkq~qn!W+>w(aBcGm_CDMD1O1%1u{znaI~uQt1u+ zvrZT=3Wtz5uQZ-0VSnJ8?^O2daNV^Uo=3ga-nAF{coID6EL{0^+my#kukp@%7S|i_Lv^*GPXhVDpRTcIA;F(; zE0EsYMmv|VoA%b(D&(i2(%HKs$j|9VD)bMK-*xON67$IK+SjU#BdA|t)5nGcQNOr} zvB%X>KQsB<-p8VT{>%$_B!~JPI>C5p7wWfbY|;H!$d5jY&`>MnN8TaJOmE~@r>@Pr z3FMcU%9uwI^7Dw|QN0r6r+&wnlrr-B*RE}OQONJQsKY~7&^(kosM5QldAL7X@#5l7 zKT^BvdvAS@JVJbe4Q)1>Cm;UuLuF{5$j>du!JWpU*PcZAd+nngTi~ujJ*_t%C9#z8=T-q5GMqDJsR${roMt zRHMBfkTT`jiJVP8@YI=3&q($;*iS#Hzq#)atl7 z+*^{(AEp`$*x%@{&WHwrMap}S%RL5eZnx3y+3pXDyNHUP?4sa1;<<~BDE_5Az4;x* z?Wu#Ey$H|GX48)GB`S1H#)waWLo*`?@r@{3%IS@ylfq92@~Qs}A$fXV$dW~R1{)$@ zY#=?N&2L}HBE1UcA>KtuZ_{AM-zAN7NSWj$6nv-vykV4RDD$j^7jH=ZWbl0gj!I?1 zq+M}@)~A=14h#B{qLsP)nv}hv@bNjiEVU5OWL(k{ULFWtX>!+<+hTy$a3a>Bd=9y|#j0uN~Ns=Rxo4#P8num6gDH2+at(~0>l>rJ>ae-gj6yS{G^Zi+< z{<-r%avM;6j*TxL(-3~;6XE7E!ViTA7i1$ov73LlOCmnb6gf>^RL}6ih1`p%UU|F8 z2Ti2MJ5{{&5z5Z>?pz{ssML%MbyO1AyxM_CgB0sJf$-7YOjv}3X6tTla z!kHj;QfA~m^7CrXn}uD-&lUdA(FNpp{qx+`P~^9s)9eNX>K9e{SXngcSD}%*M+NF< zHO(EtjZdM_#H8!&UexcNj~A}Gqkfx6FXf3LKe{|8Y!i?l2PYF~5g&M6$~J-K2Ogr` z{1uM;oSnJMu=BF b6l`FVOo;Cka_~m;wAyabp@HTJKezu66a5|t diff --git a/source/module_io/test/support/wfs1k2_nao.txt b/source/module_io/test/support/wfs1k2_nao.txt deleted file mode 100644 index c71b24b3ce..0000000000 --- a/source/module_io/test/support/wfs1k2_nao.txt +++ /dev/null @@ -1,52 +0,0 @@ -2 (index of k points) --0.07026925 -0.08113994 -0.05737460 -3 (number of bands) -63 (number of orbitals) -1 (band) --6.03667277e-01 (Ry) -5.83090379e-03 (Occupations) -2.09933705e-02 2.20619371e-03 1.52454416e-03 -3.54139105e-04 1.31198443e-03 -2.44872538e-03 -9.20116330e-03 -5.45151213e-03 3.71290025e-03 1.45501785e-02 -1.30124099e-02 7.70960240e-03 3.82663106e-03 -3.84610111e-03 7.78517834e-03 -4.33511889e-03 -5.41167355e-03 5.43920833e-03 -9.15112399e-04 7.19827990e-05 -7.31599725e-04 1.31901719e-04 1.29416436e-03 -1.01799053e-04 -2.02504709e-01 -3.96665125e-01 -3.27601131e-01 -1.26268707e-01 -1.53433434e-01 -3.42508212e-01 -2.42254622e-01 4.44854270e-01 4.63297961e-01 1.78570918e-01 3.22837653e-03 5.12766840e-03 5.09299111e-03 3.04099283e-03 1.43817942e-03 4.66552064e-03 --4.57476575e-03 -5.58236091e-03 -7.20257710e-03 -4.30061330e-03 2.71096277e-03 2.84147597e-03 4.81279492e-03 2.93105118e-03 -1.35607565e-04 2.77763433e-03 --4.79141429e-03 -2.95749668e-03 -6.80631985e-03 -4.14513233e-03 1.38144609e-03 7.67113833e-04 8.08627314e-04 2.65802677e-04 4.36096803e-04 8.21540265e-04 -9.75142095e-04 1.83701988e-03 1.96060297e-03 6.69766736e-04 8.80212792e-05 4.35402244e-05 2.22205557e-04 -1.22295959e-03 -8.06493830e-04 3.86102824e-04 --1.02999787e-03 -1.08410238e-03 -3.78284202e-04 -2.78671813e-04 -8.45869195e-04 -6.23129113e-04 -1.34763393e-03 -2.51513148e-03 5.51664715e-04 -5.25416787e-05 -1.57703040e-04 9.92915635e-04 5.05190321e-02 8.77355665e-02 7.71248769e-03 1.53180277e-02 -1.60787823e-03 -2.90751405e-03 4.74616908e-03 -6.51680651e-03 --2.35857817e-03 1.35310810e-03 -6.71209668e-03 9.21615608e-03 2.60480706e-03 1.36700642e-03 -9.24054509e-04 2.36186797e-03 -3.68375348e-03 -1.93323900e-03 --1.21442969e-04 5.99547489e-04 8.46027889e-04 2.72325634e-03 1.71746294e-04 -8.47888176e-04 1.43198828e-03 -9.83925767e-04 3.37441520e-04 -1.33906274e-04 -2.38988110e-03 7.11859012e-04 -7.90375335e-04 2.20756974e-03 -4.77214374e-04 1.89372078e-04 4.69988377e-04 7.54715897e-04 8.14293490e-04 1.27236821e-03 --2.89004839e-05 6.29744824e-04 -8.34479479e-04 -8.61909448e-04 -1.15158489e-03 -1.79940038e-03 -2 (band) --5.97868276e-01 (Ry) -5.83090379e-03 (Occupations) -1.44618640e-03 6.69577279e-04 1.89050182e-05 -1.73461277e-03 -1.04700276e-03 1.76062866e-03 1.85086491e-04 2.15202728e-03 2.80834863e-03 6.33731532e-03 --2.61751869e-04 -3.04342630e-03 8.80620073e-04 -1.71701914e-04 6.96444765e-03 -6.74454643e-03 -1.24538462e-03 2.42823264e-04 5.06462111e-04 -2.72179689e-05 --1.25714000e-03 8.17226157e-05 -7.16245627e-04 3.84920674e-05 3.14474976e-01 1.37786756e-01 -4.15349196e-01 1.42172891e-01 4.39591320e-01 2.05260088e-01 --2.33848614e-01 -9.35128501e-02 5.87392468e-01 -2.01062827e-01 -2.47976289e-03 -3.86608243e-04 5.27243491e-03 -1.53432746e-03 -1.29394265e-03 -1.12999726e-03 -3.38011947e-03 -1.29403657e-04 -7.45634891e-03 2.16986668e-03 -1.08862164e-03 1.25888021e-03 5.36965277e-03 -1.30232731e-03 2.81236999e-03 6.22446254e-04 -3.87419368e-03 -1.74030849e-03 -7.59383564e-03 1.84176891e-03 -6.06063290e-04 -7.57571331e-05 1.04374285e-03 1.48830832e-04 -4.48554991e-04 -1.57060775e-04 --1.00299945e-03 -3.51198586e-04 1.67129220e-03 -7.42852690e-04 -3.82545213e-04 -6.21025977e-04 5.00268162e-04 2.97217060e-04 2.96132294e-04 -2.42303693e-05 --4.05391638e-04 1.77808661e-03 -2.33664140e-04 1.15135290e-04 -5.22488875e-04 2.57450274e-04 -1.16848478e-03 2.86716355e-04 -1.51266629e-04 -2.12996420e-03 -8.07855122e-04 -2.89222470e-04 2.09149008e-03 -3.72294710e-03 2.56202982e-03 1.96574791e-03 -1.44710850e-04 -1.20620388e-05 9.08302740e-03 1.33060713e-02 -7.53227638e-03 2.52461589e-02 -1.28453403e-02 -1.88176257e-02 -2.06589575e-03 -2.02602033e-03 6.70741575e-04 -1.53334762e-03 2.92161774e-03 2.86522525e-03 --2.46868527e-03 -1.96217413e-03 9.59807079e-04 -4.45737658e-03 3.49124811e-03 2.77493313e-03 3.88693406e-04 1.48421465e-03 -4.06278910e-04 -1.83236707e-03 --3.43680473e-03 -1.63094051e-03 -3.10342464e-03 -3.72398417e-03 5.74565117e-04 2.59135828e-03 1.09271660e-03 5.02722659e-04 6.08670622e-04 -1.52792331e-03 -1.32844181e-03 7.68909532e-04 -9.53290392e-04 -3.27039998e-04 -8.60790236e-04 2.16080987e-03 -3 (band) --5.97662421e-01 (Ry) -5.83090379e-03 (Occupations) -4.19321636e-11 -2.80709607e-11 -3.33477115e-11 1.39914678e-11 1.32422571e-11 1.82935858e-11 6.72914392e-03 5.77236082e-04 5.84332768e-11 5.77396615e-12 -4.75822323e-03 4.08167546e-04 -7.62944534e-03 6.55351180e-03 -3.84311324e-11 -8.91586160e-11 -5.39483254e-03 4.63403264e-03 -1.16146065e-03 -1.99779399e-03 --2.79410197e-12 1.19321317e-11 -8.21276705e-04 -1.41265366e-03 -6.53297129e-01 4.40450901e-01 -1.66380291e-01 1.20651972e-01 2.66707442e-01 -1.79813333e-01 --3.77181276e-01 2.54294450e-01 -1.17648632e-01 8.53138186e-02 4.59501266e-03 -5.51617982e-03 6.77903797e-04 1.18165414e-03 -1.87590609e-03 2.25197100e-03 -2.65293181e-03 -3.18476795e-03 4.79350374e-04 8.35555768e-04 1.72516240e-03 -4.94313228e-03 -2.69530229e-04 4.32736357e-03 -7.04294587e-04 2.01802528e-03 -9.96022961e-04 -2.85391880e-03 -1.90586644e-04 3.05990822e-03 1.19138761e-03 -8.57963623e-04 -2.13194731e-04 3.98012968e-04 -1.03818250e-03 6.32572483e-05 --9.19978000e-04 9.68574164e-04 9.53435833e-05 -1.77996832e-04 -1.65139940e-04 3.08299528e-04 -1.33201184e-03 9.59232495e-04 1.10635572e-04 6.23553988e-04 -5.15358333e-04 9.93316890e-04 -1.68295594e-03 -1.91171950e-03 6.24093859e-04 1.30442693e-04 -2.30475243e-04 -4.44224803e-04 3.99194817e-04 7.69419945e-04 --1.23694333e-04 -6.97154565e-04 -1.07412252e-10 1.17874694e-11 1.65693418e-11 -1.29863251e-11 1.76852567e-12 -1.05920114e-14 -3.72472858e-02 -4.31938728e-03 -2.76422976e-10 1.96825832e-11 -2.63378088e-02 -3.05426793e-03 8.19050673e-03 8.13360389e-04 -5.55872600e-12 -8.50002533e-12 5.79156291e-03 5.75132596e-04 -6.68158686e-03 -1.05490337e-03 -3.93492393e-11 -2.37407840e-11 4.72459544e-03 -7.45929370e-04 -3.96307599e-03 -7.50818021e-04 3.98908133e-03 2.41422790e-05 -1.61791897e-03 3.06520202e-04 -2.28808305e-03 -4.33484978e-04 2.82070650e-03 1.70711749e-05 -2.22472624e-03 1.43644798e-03 -2.36774687e-04 4.74979602e-04 -9.08240698e-04 -5.86427447e-04 -1.28444630e-03 8.29333643e-04 -1.67424958e-04 3.35861321e-04 diff --git a/source/module_io/test/support/wfs1k3_nao.txt b/source/module_io/test/support/wfs1k3_nao.txt deleted file mode 100644 index e0d3852ac9..0000000000 --- a/source/module_io/test/support/wfs1k3_nao.txt +++ /dev/null @@ -1,52 +0,0 @@ -3 (index of k points) --0.03513462 -0.10142493 -0.07171825 -3 (number of bands) -63 (number of orbitals) -1 (band) --6.04664544e-01 (Ry) -5.83090379e-03 (Occupations) --6.44410072e-03 2.86108252e-03 -5.81398415e-03 4.01495705e-03 -2.32158666e-03 2.62541166e-03 9.49269256e-03 6.65452048e-03 -5.02852726e-03 -6.72710070e-03 --1.34246945e-02 -9.41091312e-03 -3.62201275e-04 3.84255737e-03 -6.19560155e-03 4.61326069e-03 5.12229964e-04 -5.43419674e-03 4.49469845e-04 -1.76093834e-04 -1.29087581e-03 4.47455297e-04 -6.35646353e-04 2.49034291e-04 3.47317658e-01 4.16938730e-01 1.57045858e-01 -3.77513068e-02 2.76511095e-01 3.55744139e-01 --4.06048959e-01 -4.70609970e-01 -2.22096383e-01 5.33884100e-02 -4.07089162e-03 -4.74527573e-03 -3.87146974e-03 -4.12994707e-04 -2.13913520e-03 -4.44234580e-03 -5.53839409e-03 5.07784581e-03 5.47508501e-03 5.84062717e-04 -1.29777024e-03 -1.32253013e-03 -5.21386357e-03 -1.21016710e-03 1.26707763e-03 -1.53986249e-03 -3.14376317e-03 1.20184216e-03 7.37351657e-03 1.71143473e-03 -1.58981110e-03 -3.90987170e-04 -4.67410930e-04 2.49611504e-04 -7.05992818e-04 -8.28533010e-04 --1.57864793e-03 -1.85265613e-03 -1.14424880e-03 3.84458305e-04 -5.72074381e-05 -1.00279960e-04 2.18608779e-04 1.57562717e-03 7.24875131e-04 -1.03557005e-03 -4.18740850e-04 1.00903940e-03 -1.55414326e-04 -2.16241633e-04 -3.47516996e-04 -4.83530997e-04 1.26652299e-03 1.29383203e-03 1.90635277e-04 -5.55669996e-04 -1.00949827e-03 -4.23741865e-04 -7.12585524e-02 -8.94935779e-02 -8.44214443e-03 -1.10407378e-02 2.24710652e-03 2.83840975e-03 -3.49397206e-03 5.14409284e-03 --4.12778069e-03 -1.48295352e-03 4.94122267e-03 -7.27484581e-03 -4.40157673e-03 1.95700899e-03 3.04579120e-03 1.67939388e-03 6.22476951e-03 -2.76762867e-03 --1.23118445e-03 5.67268289e-04 2.96994744e-04 3.21722084e-04 1.74115774e-03 -8.02238517e-04 -1.75403842e-03 1.64296557e-03 3.11170633e-04 -2.34997893e-04 --4.42119459e-03 -2.19088074e-03 -8.81730111e-05 -4.39488646e-03 -4.40061729e-04 3.32337204e-04 2.98828807e-05 -3.88931555e-04 -3.95247872e-04 -3.69015263e-04 -4.07002218e-04 -8.70073639e-05 2.36035364e-04 6.12125722e-04 5.58964902e-04 5.21866389e-04 -2 (band) --5.97025474e-01 (Ry) -5.83090379e-03 (Occupations) -5.69317183e-03 -3.71257283e-03 -2.47903685e-03 1.40811142e-03 -8.71555913e-04 1.11914525e-03 -1.44082193e-03 2.34277805e-03 5.05364032e-03 7.86613185e-03 -2.03762998e-03 -3.31318853e-03 2.24244925e-04 -1.03355655e-04 8.56159882e-03 -2.66562862e-03 -3.17130156e-04 1.46167038e-04 4.64810550e-04 -3.15981689e-04 --1.45927477e-03 -2.05483986e-03 -6.57341419e-04 4.46865603e-04 8.37339722e-02 1.36725440e-01 -5.39366321e-01 5.71646184e-02 1.53973046e-01 2.50930312e-01 --3.61561036e-02 -5.93808734e-02 7.62779164e-01 -8.08429774e-02 -4.68269214e-04 -1.03002855e-03 8.56052156e-03 1.14218437e-03 6.06313504e-04 -8.49988917e-04 -1.23979433e-03 1.18302875e-03 -1.21064056e-02 -1.61529263e-03 8.00832909e-05 -1.28365698e-04 1.15750503e-02 2.60192587e-03 2.98815079e-03 1.36987051e-03 -1.97423316e-03 1.19098051e-03 -1.63695930e-02 -3.67967885e-03 -1.74837948e-04 -1.93194996e-04 8.50833039e-04 2.46720545e-04 -6.67450729e-05 -1.24534531e-04 --1.49246516e-04 -2.78467686e-04 2.27866920e-03 -4.65834100e-04 2.17169552e-04 -5.87464296e-04 -1.27827510e-06 1.16593270e-04 -1.15639780e-04 -1.36250437e-04 --1.96189386e-03 9.38965027e-04 -1.49110958e-04 1.34145635e-04 -3.33422216e-04 2.99958731e-04 -3.03223768e-03 -1.46694894e-03 7.82130863e-04 -2.05914199e-03 -2.43071134e-04 -4.33592369e-04 1.71608557e-03 -1.44786774e-03 1.96406150e-03 3.69270159e-03 -1.08625036e-04 -9.16967732e-05 2.79808997e-03 6.60113769e-03 --1.26577656e-02 1.69126755e-02 -3.95709690e-03 -9.33541820e-03 -1.74615421e-03 4.90985551e-04 8.19050687e-04 4.32530159e-03 2.46943495e-03 -6.94358459e-04 --7.26786504e-04 -7.05484097e-04 5.87943435e-03 -4.88996984e-04 1.02783130e-03 9.97705112e-04 -3.56069910e-04 2.37424423e-04 9.58906987e-04 -1.81008349e-03 --6.94938255e-04 -2.94861238e-03 1.25335599e-04 -2.49621492e-03 -1.35609925e-03 2.55984462e-03 3.78815412e-04 6.92269008e-04 2.44737426e-03 -6.92942400e-04 -2.13451107e-04 1.21545878e-03 -5.05194795e-04 -3.39585899e-04 -3.46110988e-03 9.79968541e-04 -3 (band) --5.96870018e-01 (Ry) -5.83090379e-03 (Occupations) -3.61187971e-11 -3.71005110e-11 -2.89860645e-11 2.49236772e-11 1.50409985e-12 8.03323726e-12 3.32264869e-04 5.49443083e-03 2.96634123e-11 -1.14208816e-12 -2.34946713e-04 3.88514926e-03 -8.41271250e-03 5.91345914e-04 1.57108809e-11 -4.35316082e-11 -5.94868607e-03 4.18144692e-04 4.13568202e-04 -2.68426321e-03 --1.25562752e-11 2.24235533e-12 2.92436882e-04 -1.89806070e-03 -8.08810252e-01 -2.79166381e-02 -1.05939414e-01 1.84003766e-02 3.30195407e-01 1.13969198e-02 --4.66966817e-01 -1.61176784e-02 -7.49104766e-02 1.30110262e-02 1.09154414e-02 -2.86161677e-03 4.08886067e-05 1.49490442e-04 -4.45621032e-03 1.16825014e-03 -6.30203305e-03 -1.65215521e-03 2.89125706e-05 1.05705774e-04 1.36865755e-02 -5.28654025e-03 -8.96895600e-04 7.71771720e-04 -5.58752104e-03 2.15822100e-03 -7.90194806e-03 -3.05218544e-03 -6.34201018e-04 5.45725106e-04 1.42665481e-03 1.22665434e-04 -1.76230409e-04 1.97166175e-04 -1.07604605e-03 -6.14653363e-04 --1.17640068e-03 1.32356987e-04 7.88126388e-05 -8.81754051e-05 -1.36507492e-04 1.52724263e-04 -1.59504857e-03 -1.37144122e-04 -1.55400391e-03 1.23842988e-03 --1.18363694e-04 1.22314552e-03 -5.78094164e-04 -2.95838331e-03 2.06412095e-03 -1.15896247e-04 5.29338428e-05 -5.47007290e-04 -9.16841310e-05 9.47444435e-04 -1.73742918e-03 -1.38460670e-03 -9.48817639e-11 -3.30089486e-11 1.20651987e-11 7.29812260e-14 2.09180714e-12 7.72588637e-13 -1.70859295e-02 -1.77897014e-02 -4.10379087e-11 9.07776228e-11 -1.20815768e-02 -1.25792185e-02 2.43021327e-03 -4.14436032e-04 2.30488701e-11 1.29297651e-11 1.71842030e-03 -2.93050566e-04 -5.52117876e-03 9.33825523e-04 1.11334233e-11 -2.44447961e-11 3.90406296e-03 6.60314350e-04 -2.58931955e-03 -3.06573021e-03 7.63384051e-04 1.77859126e-03 -1.05708525e-03 1.25157910e-03 -1.49494434e-03 -1.77000018e-03 5.39794050e-04 1.25765395e-03 -3.23067805e-03 -4.32275378e-04 -4.95840759e-05 -7.44719598e-06 -1.31891879e-03 1.76475687e-04 -1.86523284e-03 -2.49574303e-04 -3.50612416e-05 -5.26593642e-06 diff --git a/source/module_io/test/support/wfs1k4_nao.txt b/source/module_io/test/support/wfs1k4_nao.txt deleted file mode 100644 index 851512e24e..0000000000 --- a/source/module_io/test/support/wfs1k4_nao.txt +++ /dev/null @@ -1,52 +0,0 @@ -4 (index of k points) -0.00000000 -0.12170991 -0.08606190 -3 (number of bands) -63 (number of orbitals) -1 (band) --6.05615293e-01 (Ry) -5.83090379e-03 (Occupations) -2.63852585e-03 -1.25137325e-03 4.00871038e-03 -1.90121057e-03 1.94915250e-03 -9.24424306e-04 -5.35609014e-03 -1.12933384e-02 -2.85841773e-14 -9.28435922e-13 -7.57465531e-03 1.59711923e-02 -2.39088484e-03 -5.04119068e-03 -1.09595833e-13 -7.14903643e-13 3.38122176e-03 7.12932023e-03 4.02811230e-04 8.49329163e-04 --4.08784780e-13 -2.32999263e-13 -5.69661103e-04 -1.20113282e-03 -2.42221221e-01 -5.10724456e-01 3.02860823e-11 6.92011964e-11 -1.91360244e-01 -4.20046054e-01 -2.84227334e-01 5.87583293e-01 -5.50191308e-11 -1.23608424e-10 2.69961427e-03 5.69214797e-03 -2.92361513e-13 -1.05855006e-12 1.16722140e-03 5.13943930e-03 --3.85051890e-03 -6.22495709e-03 5.05196363e-13 1.67670739e-12 2.47574018e-05 5.22010776e-05 -2.44317009e-13 -1.26359525e-12 -2.20134516e-03 1.09624071e-03 --1.59946715e-03 6.84744353e-04 4.01861793e-13 1.83366739e-12 1.02117550e-03 1.11860189e-03 -8.98144970e-14 -2.34461562e-13 5.37470485e-04 1.13325876e-03 -1.20182054e-03 2.53404362e-03 -2.19801713e-13 -3.82428306e-13 -1.02794979e-14 8.88345626e-14 -3.35601409e-04 -1.63294744e-03 -2.90360994e-04 9.75795130e-04 -1.21310342e-13 2.93409165e-13 2.81017023e-04 5.92525565e-04 6.28373167e-04 1.32492744e-03 -5.23358291e-14 5.24867534e-13 -2.84058091e-13 -8.05649475e-14 --9.12731316e-04 -5.04127291e-04 2.77342842e-02 1.24931688e-01 2.31774737e-03 1.04405107e-02 -8.37419724e-04 -3.77223580e-03 1.44815776e-03 -3.21484659e-04 -2.59846558e-12 4.20304407e-12 -2.04800434e-03 4.54647940e-04 3.88337687e-03 -8.62092558e-04 -7.75367687e-14 -4.47249360e-13 -5.49192423e-03 1.21918299e-03 -1.07568245e-03 -2.38796764e-04 -2.67659823e-13 -8.90101405e-13 -1.52124472e-03 3.37709630e-04 1.20812666e-03 -2.68198794e-04 -3.35596973e-13 -4.60749731e-13 -2.26383042e-03 5.53518100e-03 -4.91766914e-04 4.37849795e-03 3.81998995e-13 6.66053184e-13 -8.47845044e-05 1.88217835e-05 -6.23295910e-14 -2.97589100e-13 --1.64066226e-04 -4.11847625e-04 3.08387267e-05 -3.23820540e-04 1.14421867e-13 4.61245127e-13 -2 (band) --5.96302906e-01 (Ry) -5.83090379e-03 (Occupations) --2.78749601e-11 -2.03123039e-11 -4.15879440e-12 2.82749691e-12 -2.52364188e-12 1.85593727e-13 -6.86038342e-03 9.67263043e-05 -1.26665013e-04 -3.49279523e-04 --4.85102364e-03 6.83958012e-05 -5.40427757e-03 -3.32378489e-03 -2.71962921e-04 -2.09943115e-04 -3.82140130e-03 -2.35027086e-03 1.82137797e-03 -8.76009467e-04 --9.43394234e-06 1.09037970e-04 1.28790870e-03 -6.19432215e-04 -6.72897886e-01 -4.63959847e-01 2.10157059e-02 1.45373980e-02 2.74709415e-01 1.89410817e-01 --3.88497773e-01 -2.67867341e-01 -2.97206969e-02 -2.05589858e-02 1.30407965e-02 6.21963679e-03 -3.26239096e-04 -3.12426357e-04 -5.32388293e-03 -2.53915610e-03 -7.52910741e-03 3.59090896e-03 4.61371761e-04 4.41837595e-04 2.00763204e-02 8.67557720e-03 -4.75943861e-04 -4.90940649e-04 -8.19612352e-03 -3.54178956e-03 -1.15910690e-02 5.00884682e-03 6.73086276e-04 6.94294933e-04 1.07782595e-03 8.55439316e-04 -2.24842293e-05 -2.08550707e-05 -7.90900486e-04 -9.47277722e-04 --8.98619146e-04 -5.70295191e-04 -9.50927705e-05 -5.34068951e-05 -2.58748217e-05 -3.91070478e-06 -1.20504605e-03 -9.56410231e-04 -2.37008719e-03 -5.46387035e-04 -9.88056776e-05 6.07591597e-05 5.08469415e-04 -1.83046120e-03 2.52639803e-03 1.45345150e-03 7.59645012e-05 1.52833576e-04 -8.36994573e-05 9.79877086e-06 -2.64983803e-03 6.10879274e-04 -3.32930237e-11 -8.84534600e-11 -9.42799451e-12 -2.20257893e-12 1.24388548e-12 2.43183256e-12 -5.46265889e-03 -1.71890142e-02 -9.01662490e-04 3.75394865e-04 -3.86268324e-03 -1.21544686e-02 1.96040087e-03 4.69284855e-04 -1.61133855e-05 -1.07962277e-04 1.38621274e-03 3.31834481e-04 -3.96807153e-03 4.55075702e-03 -2.26874084e-04 -2.35432717e-04 2.80585028e-03 3.21787114e-03 -5.59009041e-04 -3.01411830e-03 -9.23647312e-05 -2.55809919e-05 -2.28214476e-04 1.23050861e-03 -3.22743991e-04 -1.74020200e-03 1.30623454e-04 3.61769873e-05 -2.42140006e-03 -2.91318788e-03 -8.41731141e-05 -8.33148030e-05 -9.88532434e-04 1.18930397e-03 -1.39799597e-03 -1.68192980e-03 1.19038759e-04 1.17824924e-04 -3 (band) --5.96302906e-01 (Ry) -5.83090379e-03 (Occupations) --6.10460263e-12 -3.29582970e-12 8.41831460e-13 -8.77218518e-13 -1.86944338e-13 -4.76566973e-13 -3.03329059e-04 4.27672185e-06 2.86477869e-03 7.89964354e-03 --2.14486030e-04 3.02409799e-06 -2.38947936e-04 -1.46959786e-04 6.15097666e-03 4.74827645e-03 -1.68961700e-04 -1.03916266e-04 8.05314849e-05 -3.87324048e-05 -2.13367106e-04 -2.46610824e-03 5.69443559e-05 -2.73879427e-05 -2.97519063e-02 -2.05137948e-02 -4.75311553e-01 -3.28791852e-01 1.21461656e-02 8.37472217e-03 --1.71772705e-02 -1.18436445e-02 6.72192042e-01 4.64981894e-01 5.76593513e-04 2.74998692e-04 7.37853930e-03 7.06613663e-03 -2.35393320e-04 -1.12267747e-04 -3.32896416e-04 1.58770566e-04 -1.04348303e-02 -9.99302624e-03 8.87666337e-04 3.83587088e-04 1.07644072e-02 1.11035885e-02 -3.62388267e-04 -1.56598773e-04 -5.12494397e-04 2.21464107e-04 -1.52231707e-02 -1.57028454e-02 4.76556364e-05 3.78228996e-05 5.08525091e-04 4.71678443e-04 -3.49693436e-05 -4.18834974e-05 --3.97320797e-05 -2.52153681e-05 2.15071013e-03 1.20790195e-03 5.85210002e-04 8.84482681e-05 -5.32806212e-05 -4.22872874e-05 -1.04792440e-04 -2.41582772e-05 --2.23468484e-03 -1.37418786e-03 2.24817659e-05 -8.09330964e-05 1.11703660e-04 6.42637636e-05 -1.71808673e-03 -3.45663200e-03 1.89302788e-03 -2.21618511e-04 -1.17161509e-04 2.70097748e-05 1.62379559e-11 6.72817010e-12 -2.24410740e-14 1.75649499e-12 -4.40615166e-13 -2.53963354e-13 -2.41529248e-04 -7.60005243e-04 --2.03928714e-02 -8.49029295e-03 -1.70786990e-04 -5.37404884e-04 8.66783288e-05 2.07492375e-05 3.64435982e-04 2.44177930e-03 6.12908288e-05 1.46719237e-05 -1.75446671e-04 2.01209863e-04 5.13120392e-03 5.32477398e-03 1.24059528e-04 1.42276857e-04 -2.47163623e-05 -1.33268014e-04 2.08901012e-03 5.78564431e-04 -1.00904124e-05 5.44064339e-05 -1.42699917e-05 -7.69423198e-05 -2.95430645e-03 -8.18213658e-04 -1.07061220e-04 -1.28805412e-04 1.90374063e-03 1.88432814e-03 -4.37075593e-05 5.25845893e-05 -6.18118243e-05 -7.43658388e-05 -2.69229582e-03 -2.66484241e-03 diff --git a/source/module_io/test/support/wfs2_nao.txt b/source/module_io/test/support/wfs2_nao.txt deleted file mode 100644 index e05181effc..0000000000 --- a/source/module_io/test/support/wfs2_nao.txt +++ /dev/null @@ -1,32 +0,0 @@ -3 (number of bands) -31 (number of orbitals) -1 (band) --1.22787155e+00 (Ry) -2.00000000e+00 (Occupations) --1.51728369e-02 -2.07808444e-03 1.21298954e-17 -7.13941907e-08 2.16402589e-07 --2.33154682e-16 1.57981033e-07 1.37815571e-07 -4.73101688e-03 -9.50509066e-18 --2.78717856e-18 3.97439579e-08 3.10940207e-08 5.39213060e-03 1.01734983e-18 --6.58833740e-18 1.27090046e-07 -7.03036426e-08 -9.77585956e-01 -6.13880745e-03 -2.20316871e-15 -2.33416845e-07 -9.14787918e-07 1.07434159e-16 5.16552542e-08 -1.13539917e-07 7.73272236e-03 4.69976670e-17 1.03418318e-17 4.83739928e-07 --5.44883791e-09 -2 (band) --3.10595658e-01 (Ry) -2.00000000e+00 (Occupations) -8.86226706e-02 2.27254080e-02 -4.89898875e-16 4.28239622e-09 5.83161806e-08 --4.60626214e-16 6.71493689e-09 -1.97997448e-08 -9.80282026e-01 6.43055481e-15 -2.29135711e-14 -5.33364904e-05 1.20925412e-06 -5.32138426e-03 1.33240077e-16 -5.71272071e-16 -5.49131603e-07 9.23311047e-09 1.24546190e-02 -2.68408770e-03 --3.01869415e-16 -7.75919179e-07 -8.35043239e-07 -1.38124495e-16 -8.88948486e-08 --3.56018509e-07 1.39706604e-03 1.17174237e-17 4.96617345e-17 -5.76417426e-09 -2.64285801e-08 -3 (band) --3.00546690e-01 (Ry) -2.00000000e+00 (Occupations) --8.24520852e-10 -3.26589260e-08 -1.69663394e-16 3.99552530e-04 1.58759611e-07 -2.58344137e-18 -8.99733979e-04 -3.58445734e-07 1.21571018e-06 2.25456884e-13 --1.04214879e-13 4.17125230e-04 1.00074306e+00 -3.22028333e-09 4.79757646e-15 --2.17277014e-15 4.39402756e-06 1.05359309e-02 1.35243111e-07 2.55990474e-09 -7.62457489e-16 -2.35220550e-02 -1.00062779e-05 6.59539788e-17 -2.44422254e-03 --1.05746282e-06 -3.16636112e-08 2.78843989e-16 -1.97537671e-16 -8.29982457e-08 --2.02338162e-04 diff --git a/source/module_io/test/tmp_mocks.cpp b/source/module_io/test/tmp_mocks.cpp deleted file mode 100644 index dc5834ad63..0000000000 --- a/source/module_io/test/tmp_mocks.cpp +++ /dev/null @@ -1,46 +0,0 @@ - -#include "source_cell/unitcell.h" - -// constructor of Atom -Atom::Atom() -{ -} -Atom::~Atom() -{ -} - -Atom_pseudo::Atom_pseudo() -{ -} -Atom_pseudo::~Atom_pseudo() -{ -} - -Magnetism::Magnetism() -{ -} -Magnetism::~Magnetism() -{ -} - -InfoNonlocal::InfoNonlocal() -{ -} -InfoNonlocal::~InfoNonlocal() -{ -} - -pseudo::pseudo() -{ -} -pseudo::~pseudo() -{ -} - -// constructor of UnitCell -UnitCell::UnitCell() -{ -} -UnitCell::~UnitCell() -{ -} diff --git a/source/module_io/test/to_qo_test.cpp b/source/module_io/test/to_qo_test.cpp deleted file mode 100644 index 21b7187b39..0000000000 --- a/source/module_io/test/to_qo_test.cpp +++ /dev/null @@ -1,1567 +0,0 @@ -#include -#include "module_io/to_qo.h" -#define private public -#include "module_parameter/parameter.h" -#undef private - -#ifdef __MPI -#include -#endif - -Atom_pseudo::Atom_pseudo() {} -Atom_pseudo::~Atom_pseudo() {} -#ifdef __MPI -void Atom_pseudo::bcast_atom_pseudo() {} -#endif -pseudo::pseudo() {} -pseudo::~pseudo() {} - -Magnetism::Magnetism() {} -Magnetism::~Magnetism() {} -#ifdef __LCAO -InfoNonlocal::InfoNonlocal() {} -InfoNonlocal::~InfoNonlocal() {} -#endif -void output::printM3(std::ofstream &ofs, const std::string &description, const ModuleBase::Matrix3 &m) {} - -void define_fcc_cell(UnitCell& ucell) -{ - ucell.atoms = new Atom[2]; - ucell.set_atom_flag = true; - ucell.ntype = 2; - ucell.lat0 = 1.889726124565062; - ucell.atoms[0].tau.resize(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - ucell.atoms[1].tau.resize(1, ModuleBase::Vector3(2.0, 2.0, 2.0)); - ucell.atoms[0].taud.resize(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - ucell.atoms[1].taud.resize(1, ModuleBase::Vector3(0.25, 0.25, 0.25)); - ucell.atoms[0].na = 1; - ucell.atoms[1].na = 1; - ucell.atoms[0].nwl = 2; - ucell.atoms[1].nwl = 2; - ucell.a1 = ModuleBase::Vector3(8.0, 8.0, 0.0); - ucell.a2 = ModuleBase::Vector3(8.0, 0.0, 8.0); - ucell.a3 = ModuleBase::Vector3(0.0, 8.0, 8.0); - ucell.atoms[0].ncpp.zv = 4.0; - ucell.atoms[1].ncpp.zv = 4.0; - ucell.atoms[0].ncpp.psd = "Si"; - ucell.atoms[1].ncpp.psd = "C"; - ucell.atoms[0].label = "Si"; - ucell.atoms[1].label = "C"; - ucell.latvec.e11 = 8.0; ucell.latvec.e12 = 8.0; ucell.latvec.e13 = 0.0; - ucell.latvec.e21 = 8.0; ucell.latvec.e22 = 0.0; ucell.latvec.e23 = 8.0; - ucell.latvec.e31 = 0.0; ucell.latvec.e32 = 8.0; ucell.latvec.e33 = 8.0; - ucell.GT = ucell.latvec.Inverse(); - ucell.G = ucell.GT.Transpose(); - ucell.GGT = ucell.G * ucell.GT; - ucell.orbital_fn.resize(2); - ucell.orbital_fn[0] = "../../../../tests/PP_ORB/Si_gga_8au_100Ry_2s2p1d.orb"; - ucell.orbital_fn[1] = "../../../../tests/PP_ORB/C_gga_8au_100Ry_2s2p1d.orb"; - ucell.pseudo_fn.resize(2); - ucell.pseudo_fn[0] = "../../../../tests/PP_ORB/Si_dojo_soc.upf"; - ucell.pseudo_fn[1] = "../../../../tests/PP_ORB/C.LDA.UPF"; - - PARAM.sys.global_out_dir = "./"; - PARAM.input.qo_screening_coeff = {0.1, 0.1}; - PARAM.input.qo_thr = 1e-6; - // GlobalV::ofs_running = std::ofstream("unittest.log"); - GlobalV::MY_RANK = 0; - GlobalV::NPROC = 1; -} - -void define_sc_cell(UnitCell& ucell) -{ - ucell.atoms = new Atom[1]; - ucell.set_atom_flag = true; - ucell.ntype = 1; - ucell.lat0 = 1.889726124565062; - ucell.atoms[0].tau.resize(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - ucell.atoms[0].taud.resize(1, ModuleBase::Vector3(0.0, 0.0, 0.0)); - ucell.atoms[0].na = 1; - ucell.atoms[0].nwl = 2; - ucell.a1 = ModuleBase::Vector3(8.0, 0.0, 0.0); - ucell.a2 = ModuleBase::Vector3(0.0, 8.0, 0.0); - ucell.a3 = ModuleBase::Vector3(0.0, 0.0, 8.0); - ucell.atoms[0].ncpp.zv = 4.0; - ucell.atoms[0].ncpp.psd = "Si"; - ucell.atoms[0].label = "Si"; - ucell.latvec.e11 = 8.0; ucell.latvec.e12 = 0.0; ucell.latvec.e13 = 0.0; - ucell.latvec.e21 = 0.0; ucell.latvec.e22 = 8.0; ucell.latvec.e23 = 0.0; - ucell.latvec.e31 = 0.0; ucell.latvec.e32 = 0.0; ucell.latvec.e33 = 8.0; - ucell.GT = ucell.latvec.Inverse(); - ucell.G = ucell.GT.Transpose(); - ucell.GGT = ucell.G * ucell.GT; - ucell.orbital_fn.resize(1); - ucell.orbital_fn[0] = "../../../../tests/PP_ORB/Si_gga_8au_100Ry_2s2p1d.orb"; - ucell.pseudo_fn.resize(1); - ucell.pseudo_fn[0] = "../../../../tests/PP_ORB/Si_dojo_soc.upf"; - - PARAM.sys.global_out_dir = "./"; - PARAM.input.qo_screening_coeff = {0.1}; - PARAM.input.qo_thr = 1e-6; - // GlobalV::ofs_running = std::ofstream("unittest.log"); - GlobalV::MY_RANK = 0; - GlobalV::NPROC = 1; -} - -class toQOTest : public testing::Test -{ - protected: - void SetUp() override - { - #ifdef __MPI - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - #endif - } - - void TearDown() override - { - } - UnitCell ucell; - int myrank = 0; -}; - -TEST_F(toQOTest, Constructor) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - EXPECT_EQ(tqo.qo_basis(), "hydrogen"); - EXPECT_EQ(tqo.strategy(0), "minimal-nodeless"); - EXPECT_EQ(tqo.strategy(1), "minimal-nodeless"); - EXPECT_EQ(tqo.nks(), 0); - EXPECT_EQ(tqo.p_ucell(), nullptr); -} - -TEST_F(toQOTest, ReadStructures) -{ - define_fcc_cell(ucell); - - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(-0.25, -0.25, -0.25)); // pair 1 - kvecs_d.push_back(ModuleBase::Vector3(0.25, 0.25, 0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, 0.25, 0.25)); // pair 2 - kvecs_d.push_back(ModuleBase::Vector3(0.25, -0.25, -0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, -0.25, 0.25)); // pair 3 - kvecs_d.push_back(ModuleBase::Vector3(0.25, 0.25, -0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, 0.25, -0.25)); // pair 4 - kvecs_d.push_back(ModuleBase::Vector3(0.25, -0.25, 0.25)); - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma - - tqo.read_structures(&ucell, kvecs_d, 0, 1); - EXPECT_EQ(tqo.ntype(), ucell.ntype); - EXPECT_EQ(tqo.symbols().size(), ucell.ntype); - EXPECT_EQ(tqo.charges().size(), ucell.ntype); - EXPECT_EQ(tqo.symbols()[0], "Si"); - EXPECT_EQ(tqo.symbols()[1], "C"); - EXPECT_EQ(tqo.charges()[0], 14.0); - EXPECT_EQ(tqo.charges()[1], 6.0); - EXPECT_EQ(tqo.nks(), tqo.kvecs_d().size()); - EXPECT_EQ(tqo.kvecs_d().size(), kvecs_d.size()); - EXPECT_EQ(tqo.kvecs_d()[0], ModuleBase::Vector3(-0.25, -0.25, -0.25)); - EXPECT_EQ(tqo.kvecs_d()[1], ModuleBase::Vector3(0.25, 0.25, 0.25)); - EXPECT_EQ(tqo.kvecs_d()[2], ModuleBase::Vector3(-0.25, 0.25, 0.25)); - EXPECT_EQ(tqo.kvecs_d()[3], ModuleBase::Vector3(0.25, -0.25, -0.25)); - EXPECT_EQ(tqo.kvecs_d()[4], ModuleBase::Vector3(-0.25, -0.25, 0.25)); - EXPECT_EQ(tqo.kvecs_d()[5], ModuleBase::Vector3(0.25, 0.25, -0.25)); - EXPECT_EQ(tqo.kvecs_d()[6], ModuleBase::Vector3(-0.25, 0.25, -0.25)); - EXPECT_EQ(tqo.kvecs_d()[7], ModuleBase::Vector3(0.25, -0.25, 0.25)); - EXPECT_EQ(tqo.kvecs_d()[8], ModuleBase::Vector3(0.0, 0.0, 0.0)); -} - -TEST_F(toQOTest, BuildNao) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, "./", ucell.orbital_fn.data(), 0); - EXPECT_EQ(tqo.p_nao()->nchi(), 10); // not (l, m)-resoluted - EXPECT_EQ(tqo.nphi(), 26); // (l, m)-resoluted -} - -TEST_F(toQOTest, RadialCollectionIndexing) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, "./", ucell.orbital_fn.data(), 0); - // ucell.orbital_fn.data()[0] = "../../../../tests/PP_ORB/Si_gga_8au_100Ry_2s2p1d.orb"; - // ucell.orbital_fn.data()[1] = "../../../../tests/PP_ORB/C_gga_8au_100Ry_2s2p1d.orb"; - // test1 1Si, 1C - std::vector natoms = {1, 1}; - std::map,int> index; - std::map> index_reverse; - tqo.radialcollection_indexing(*(tqo.p_nao()), natoms, false, index, index_reverse); - EXPECT_EQ(index.size(), 26); // 2*1 + 2*3 + 1*5 + 2*1 + 2*3 + 1*5 = 26 - EXPECT_EQ(index_reverse.size(), 26); - // it, ia, l, izeta, m - // it = 0 - // ia = 0 - // l = 0 - // izeta = 0 - EXPECT_EQ(index[std::make_tuple(0,0,0,0,0)], 0); // Si, 1st atom, 1s - // izeta = 1 - EXPECT_EQ(index[std::make_tuple(0,0,0,1,0)], 1); // Si, 1st atom, 2s - // l = 1 - // izeta = 0 - EXPECT_EQ(index[std::make_tuple(0,0,1,0,0)], 2); // Si, 1st atom, 1p, m = 0 - EXPECT_EQ(index[std::make_tuple(0,0,1,0,1)], 3); // Si, 1st atom, 1p, m = 1 - EXPECT_EQ(index[std::make_tuple(0,0,1,0,-1)], 4); // Si, 1st atom, 1p, m = -1 - // izeta = 1 - EXPECT_EQ(index[std::make_tuple(0,0,1,1,0)], 5); // Si, 1st atom, 2p, m = 0 - EXPECT_EQ(index[std::make_tuple(0,0,1,1,1)], 6); // Si, 1st atom, 2p, m = 1 - EXPECT_EQ(index[std::make_tuple(0,0,1,1,-1)], 7); // Si, 1st atom, 2p, m = -1 - // l = 2 - // izeta = 0 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,0)], 8); // Si, 1st atom, 1d, m = 0 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,1)], 9); // Si, 1st atom, 1d, m = 1 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,-1)], 10); // Si, 1st atom, 1d, m = -1 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,2)], 11); // Si, 1st atom, 1d, m = 2 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,-2)], 12); // Si, 1st atom, 1d, m = -2 - // it = 1 - // ia = 0 - // l = 0 - // izeta = 0 - EXPECT_EQ(index[std::make_tuple(1,0,0,0,0)], 13); // C, 1st atom, 1s - // izeta = 1 - EXPECT_EQ(index[std::make_tuple(1,0,0,1,0)], 14); // C, 1st atom, 2s - // l = 1 - // izeta = 0 - EXPECT_EQ(index[std::make_tuple(1,0,1,0,0)], 15); // C, 1st atom, 1p, m = 0 - EXPECT_EQ(index[std::make_tuple(1,0,1,0,1)], 16); // C, 1st atom, 1p, m = 1 - EXPECT_EQ(index[std::make_tuple(1,0,1,0,-1)], 17); // C, 1st atom, 1p, m = -1 - // izeta = 1 - EXPECT_EQ(index[std::make_tuple(1,0,1,1,0)], 18); // C, 1st atom, 2p, m = 0 - EXPECT_EQ(index[std::make_tuple(1,0,1,1,1)], 19); // C, 1st atom, 2p, m = 1 - EXPECT_EQ(index[std::make_tuple(1,0,1,1,-1)], 20); // C, 1st atom, 2p, m = -1 - // l = 2 - // izeta = 0 - EXPECT_EQ(index[std::make_tuple(1,0,2,0,0)], 21); // C, 1st atom, 1d, m = 0 - EXPECT_EQ(index[std::make_tuple(1,0,2,0,1)], 22); // C, 1st atom, 1d, m = 1 - EXPECT_EQ(index[std::make_tuple(1,0,2,0,-1)], 23); // C, 1st atom, 1d, m = -1 - EXPECT_EQ(index[std::make_tuple(1,0,2,0,2)], 24); // C, 1st atom, 1d, m = 2 - EXPECT_EQ(index[std::make_tuple(1,0,2,0,-2)], 25); // C, 1st atom, 1d, m = -2 - // reverse - EXPECT_EQ(index_reverse[0], std::make_tuple(0,0,0,0,0)); // Si, 1st atom, 1s - EXPECT_EQ(index_reverse[1], std::make_tuple(0,0,0,1,0)); // Si, 1st atom, 2s - EXPECT_EQ(index_reverse[2], std::make_tuple(0,0,1,0,0)); // Si, 1st atom, 1p, m = 0 - EXPECT_EQ(index_reverse[3], std::make_tuple(0,0,1,0,1)); // Si, 1st atom, 1p, m = 1 - EXPECT_EQ(index_reverse[4], std::make_tuple(0,0,1,0,-1)); // Si, 1st atom, 1p, m = -1 - EXPECT_EQ(index_reverse[5], std::make_tuple(0,0,1,1,0)); // Si, 1st atom, 2p, m = 0 - EXPECT_EQ(index_reverse[6], std::make_tuple(0,0,1,1,1)); // Si, 1st atom, 2p, m = 1 - EXPECT_EQ(index_reverse[7], std::make_tuple(0,0,1,1,-1)); // Si, 1st atom, 2p, m = -1 - EXPECT_EQ(index_reverse[8], std::make_tuple(0,0,2,0,0)); // Si, 1st atom, 1d, m = 0 - EXPECT_EQ(index_reverse[9], std::make_tuple(0,0,2,0,1)); // Si, 1st atom, 1d, m = 1 - EXPECT_EQ(index_reverse[10], std::make_tuple(0,0,2,0,-1)); // Si, 1st atom, 1d, m = -1 - EXPECT_EQ(index_reverse[11], std::make_tuple(0,0,2,0,2)); // Si, 1st atom, 1d, m = 2 - EXPECT_EQ(index_reverse[12], std::make_tuple(0,0,2,0,-2)); // Si, 1st atom, 1d, m = -2 - EXPECT_EQ(index_reverse[13], std::make_tuple(1,0,0,0,0)); // C, 1st atom, 1s - EXPECT_EQ(index_reverse[14], std::make_tuple(1,0,0,1,0)); // C, 1st atom, 2s - EXPECT_EQ(index_reverse[15], std::make_tuple(1,0,1,0,0)); // C, 1st atom, 1p, m = 0 - EXPECT_EQ(index_reverse[16], std::make_tuple(1,0,1,0,1)); // C, 1st atom, 1p, m = 1 - EXPECT_EQ(index_reverse[17], std::make_tuple(1,0,1,0,-1)); // C, 1st atom, 1p, m = -1 - EXPECT_EQ(index_reverse[18], std::make_tuple(1,0,1,1,0)); // C, 1st atom, 2p, m = 0 - EXPECT_EQ(index_reverse[19], std::make_tuple(1,0,1,1,1)); // C, 1st atom, 2p, m = 1 - EXPECT_EQ(index_reverse[20], std::make_tuple(1,0,1,1,-1)); // C, 1st atom, 2p, m = -1 - EXPECT_EQ(index_reverse[21], std::make_tuple(1,0,2,0,0)); // C, 1st atom, 1d, m = 0 - EXPECT_EQ(index_reverse[22], std::make_tuple(1,0,2,0,1)); // C, 1st atom, 1d, m = 1 - EXPECT_EQ(index_reverse[23], std::make_tuple(1,0,2,0,-1)); // C, 1st atom, 1d, m = -1 - EXPECT_EQ(index_reverse[24], std::make_tuple(1,0,2,0,2)); // C, 1st atom, 1d, m = 2 - EXPECT_EQ(index_reverse[25], std::make_tuple(1,0,2,0,-2)); // C, 1st atom, 1d, m = -2 - // test2 2Si, 3C - natoms = {2, 3}; - tqo.radialcollection_indexing(*(tqo.p_nao()), natoms, false, index, index_reverse); - EXPECT_EQ(index.size(), 65); // (2*1 + 2*3 + 1*5)*2 + (2*1 + 2*3 + 1*5)*3 = 65 - EXPECT_EQ(index_reverse.size(), 65); - // it, ia, l, izeta, m - EXPECT_EQ(index[std::make_tuple(0,0,0,0,0)], 0); // Si, 1st atom, 1s - EXPECT_EQ(index[std::make_tuple(0,0,2,0,-2)], 12); // Si, 1st atom, 1d, m = -2 - EXPECT_EQ(index[std::make_tuple(0,1,0,0,0)], 13); // Si, 2nd atom, 1s - EXPECT_EQ(index[std::make_tuple(0,1,2,0,-2)], 25); // Si, 2nd atom, 1d, m = -2 - EXPECT_EQ(index[std::make_tuple(1,0,0,0,0)], 26); // C, 1st atom, 1s - EXPECT_EQ(index[std::make_tuple(1,0,2,0,-2)], 38); // C, 1st atom, 1d, m = -2 - EXPECT_EQ(index[std::make_tuple(1,1,0,0,0)], 39); // C, 2nd atom, 1s - EXPECT_EQ(index[std::make_tuple(1,1,2,0,-2)], 51); // C, 2nd atom, 1d, m = -2 - EXPECT_EQ(index[std::make_tuple(1,2,0,0,0)], 52); // C, 3rd atom, 1s - EXPECT_EQ(index[std::make_tuple(1,2,2,0,-2)], 64); // C, 3rd atom, 1d, m = -2 - // reverse - EXPECT_EQ(index_reverse[0], std::make_tuple(0,0,0,0,0)); // Si, 1st atom, 1s - EXPECT_EQ(index_reverse[12], std::make_tuple(0,0,2,0,-2)); // Si, 1st atom, 1d, m = -2 - EXPECT_EQ(index_reverse[13], std::make_tuple(0,1,0,0,0)); // Si, 2nd atom, 1s - EXPECT_EQ(index_reverse[25], std::make_tuple(0,1,2,0,-2)); // Si, 2nd atom, 1d, m = -2 - EXPECT_EQ(index_reverse[26], std::make_tuple(1,0,0,0,0)); // C, 1st atom, 1s - EXPECT_EQ(index_reverse[38], std::make_tuple(1,0,2,0,-2)); // C, 1st atom, 1d, m = -2 - EXPECT_EQ(index_reverse[39], std::make_tuple(1,1,0,0,0)); // C, 2nd atom, 1s - EXPECT_EQ(index_reverse[51], std::make_tuple(1,1,2,0,-2)); // C, 2nd atom, 1d, m = -2 - EXPECT_EQ(index_reverse[52], std::make_tuple(1,2,0,0,0)); // C, 3rd atom, 1s - EXPECT_EQ(index_reverse[64], std::make_tuple(1,2,2,0,-2)); // C, 3rd atom, 1d, m = -2 - - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 5); // Si: 1s, 2p, 3d, C: 1s, 2p - EXPECT_EQ(tqo.nchi(), 13); // Si: 1s, 2px, 2py, 2pz, 3dz2, 3dxz, 3dyz, 3dx2-y2, 3dxy, C: 1s, 2px, 2py, 2pz - index.clear(); - index_reverse.clear(); - tqo.radialcollection_indexing(*(tqo.p_ao()), natoms, true, index, index_reverse); - EXPECT_EQ(index.size(), 30); // minimal-nodeless, Si: 1s, 2p, 3d, C: 1s, 2p, Si2C3 - // (1 + 3)*3 + (1 + 3 + 5)*2 = 12 + 18 = 30 - EXPECT_EQ(index_reverse.size(), 30); - // it, ia, l, izeta, m - EXPECT_EQ(index[std::make_tuple(0,0,0,0,0)], 0); // Si, 1st atom, 1s - EXPECT_EQ(index[std::make_tuple(0,0,1,0,0)], 1); // Si, 1st atom, 2px - EXPECT_EQ(index[std::make_tuple(0,0,1,0,1)], 2); // Si, 1st atom, 2py - EXPECT_EQ(index[std::make_tuple(0,0,1,0,-1)], 3); // Si, 1st atom, 2pz - EXPECT_EQ(index[std::make_tuple(0,0,2,0,0)], 4); // Si, 1st atom, 3dz2 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,1)], 5); // Si, 1st atom, 3dxz - EXPECT_EQ(index[std::make_tuple(0,0,2,0,-1)], 6); // Si, 1st atom, 3dyz - EXPECT_EQ(index[std::make_tuple(0,0,2,0,2)], 7); // Si, 1st atom, 3dx2-y2 - EXPECT_EQ(index[std::make_tuple(0,0,2,0,-2)], 8); // Si, 1st atom, 3dxy - EXPECT_EQ(index[std::make_tuple(0,1,0,0,0)], 9); // Si, 2nd atom, 1s - EXPECT_EQ(index[std::make_tuple(0,1,1,0,0)], 10); // Si, 2nd atom, 2px - EXPECT_EQ(index[std::make_tuple(0,1,1,0,1)], 11); // Si, 2nd atom, 2py - EXPECT_EQ(index[std::make_tuple(0,1,1,0,-1)], 12); // Si, 2nd atom, 2pz - EXPECT_EQ(index[std::make_tuple(0,1,2,0,0)], 13); // Si, 2nd atom, 3dz2 - EXPECT_EQ(index[std::make_tuple(0,1,2,0,1)], 14); // Si, 2nd atom - EXPECT_EQ(index[std::make_tuple(0,1,2,0,-1)], 15); - EXPECT_EQ(index[std::make_tuple(0,1,2,0,2)], 16); - EXPECT_EQ(index[std::make_tuple(0,1,2,0,-2)], 17); - EXPECT_EQ(index[std::make_tuple(1,0,0,0,0)], 18); - EXPECT_EQ(index[std::make_tuple(1,0,1,0,0)], 19); - EXPECT_EQ(index[std::make_tuple(1,0,1,0,1)], 20); - EXPECT_EQ(index[std::make_tuple(1,0,1,0,-1)], 21); - EXPECT_EQ(index[std::make_tuple(1,1,0,0,0)], 22); - EXPECT_EQ(index[std::make_tuple(1,1,1,0,0)], 23); - EXPECT_EQ(index[std::make_tuple(1,1,1,0,1)], 24); - EXPECT_EQ(index[std::make_tuple(1,1,1,0,-1)], 25); -} - -TEST_F(toQOTest, BuildHydrogenMinimal) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 5); // Si: 1s, 2p, 3d, C: 1s, 2p - EXPECT_EQ(tqo.nchi(), 13); // Si: 1s, 2px, 2py, 2pz, 3dz2, 3dxz, 3dyz, 3dx2-y2, 3dxy, C: 1s, 2px, 2py, 2pz - tqo.p_ao()->to_file("special_use_unittest"); -} - -// the scan_supercell_for_atom() calls -TEST_F(toQOTest, Norm2RijSupercell) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - ModuleBase::Vector3 rij(1.0, 0.0, 0.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 0, 0, 0), 1.0); // R = 0, 0, 0 - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 1, 0, 0), 145.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 0, 1, 0), 145.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 0, 0, 1), 129.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 1, 1, 0), 417.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 1, 0, 1), 401.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 0, 1, 1), 401.0); - EXPECT_EQ(tqo.norm2_rij_supercell(rij, 1, 1, 1), 801.0); -} -// the scan_supercell() calls -TEST_F(toQOTest, ScanSupercellForAtom) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, // ntype - "./", // orbital_dir - ucell.orbital_fn.data(),// orbital_fn - 0); // rank - std::vector nmax = std::vector(ucell.ntype); - for(int itype = 0; itype < ucell.ntype; itype++) - { - nmax[itype] = tqo.atom_database().principle_quantum_number[tqo.symbols()[itype]]; - } - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - std::vector> n1n2n3 = tqo.scan_supercell_for_atom(0, 0); - EXPECT_EQ(n1n2n3.size(), 13); // 13 = 3*3*3 - 2 - 3*4 -} -// the scan_supercell() calls -TEST_F(toQOTest, EliminateDuplicateVector3) -{ - define_fcc_cell(ucell); - std::vector> v; - v.push_back(ModuleBase::Vector3(0, 0, 0)); - v.push_back(ModuleBase::Vector3(0, 0, 0)); - v.push_back(ModuleBase::Vector3(0, 0, 0)); - v.push_back(ModuleBase::Vector3(1, 0, 0)); - v.push_back(ModuleBase::Vector3(1, 0, 0)); - v.push_back(ModuleBase::Vector3(1, 0, 0)); - v.push_back(ModuleBase::Vector3(1, 1, 0)); - v.push_back(ModuleBase::Vector3(1, 1, 0)); - v.push_back(ModuleBase::Vector3(1, 1, 0)); - v.push_back(ModuleBase::Vector3(1, 1, 1)); - v.push_back(ModuleBase::Vector3(1, 1, 1)); - v.push_back(ModuleBase::Vector3(1, 1, 1)); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - tqo.eliminate_duplicate_vector3(v); - EXPECT_EQ(v.size(), 4); -} - -TEST_F(toQOTest, ScanSupercellFCC) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, - "./", - ucell.orbital_fn.data(), - 0); - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - tqo.scan_supercell(0, 1); - EXPECT_EQ(tqo.nR(), 13); -} - -TEST_F(toQOTest, ScanSupercellSC1) -{ - define_sc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, - "./", - ucell.orbital_fn.data(), - 0); - PARAM.input.qo_thr = 1e-6; - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - tqo.scan_supercell(0, 1); - EXPECT_EQ(tqo.nR(), 19); // 3*3*3 - 8 (corner 111, -1-1-1, etc) -} - -TEST_F(toQOTest, AllocateOvlpMinimal) -{ - define_fcc_cell(ucell); - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, - "./", - ucell.orbital_fn.data(), - 0); - std::vector nmax = std::vector(ucell.ntype); - for(int itype = 0; itype < ucell.ntype; itype++) - { - nmax[itype] = tqo.atom_database().principle_quantum_number[tqo.symbols()[itype]]; - } - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - tqo.scan_supercell(0, 1); - tqo.allocate_ovlp(true); - tqo.allocate_ovlp(false); - EXPECT_EQ(tqo.ovlpk().size(), tqo.nchi()*tqo.nphi()); // for single kpoint, ao*nao matrix - EXPECT_EQ(tqo.ovlpR().size(), tqo.nchi()*tqo.nphi()); // for single cell, ao*nao matrix - // all values in them should be zero or complex zero - for(int i = 0; i < tqo.nchi(); i++) - { - for(int j = 0; j < tqo.nphi(); j++) - { - EXPECT_EQ(tqo.ovlpR(i, j), 0.0); - EXPECT_EQ(tqo.ovlpk(i, j), std::complex(0.0, 0.0)); - } - } -} - -TEST_F(toQOTest, Initialize) -{ - define_fcc_cell(ucell); - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); -} - -TEST_F(toQOTest, ReadOvlp) -{ - define_fcc_cell(ucell); - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - tqo.read_ovlp("./support/", nrows, ncols, true, 0); - std::vector ovlpR = tqo.ovlpR(); - EXPECT_EQ(ovlpR.size(), nrows*ncols); - EXPECT_EQ(ovlpR[0], 9.95330157042009e-01); - EXPECT_EQ(ovlpR[1], -7.71640245637438e-02); - EXPECT_EQ(ovlpR[2], 0.00000000000000e+00); - EXPECT_EQ(ovlpR[28], 9.93363417688277e-01); - EXPECT_EQ(ovlpR[55], 9.93363417688277e-01); - EXPECT_EQ(ovlpR[82], 9.93363417688277e-01); - EXPECT_EQ(ovlpR[104], 2.32940220946083e-01); - EXPECT_EQ(ovlpR[105], 3.12427888919456e-01); - EXPECT_EQ(ovlpR[106], 2.26670648341119e-01); -} - -TEST_F(toQOTest, CalculateOvlpR) -{ - define_fcc_cell(ucell); - PARAM.input.qo_screening_coeff = {}; - PARAM.input.qo_thr = 1e-10; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - // find the R = 0,0,0 - for(int iR = 0; iR < tqo.nR(); iR++) - { - if(tqo.supercells()[iR].x == 0 - && tqo.supercells()[iR].y == 0 - && tqo.supercells()[iR].z == 0) - { - tqo.calculate_ovlpR(iR); - break; - } - } - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - // not all elements are zero - bool all_zero = true; - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - if(tqo.ovlpR(i, j) != 0.0) { all_zero = false; -} - } - } - EXPECT_EQ(all_zero, false); -} - -TEST_F(toQOTest, CalculateSelfOvlpRMinimal) -{ - define_fcc_cell(ucell); - PARAM.input.qo_screening_coeff = {}; - PARAM.input.qo_thr = 1e-10; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - ucell.orbital_fn[0] = "Si_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.orbital_fn[1] = "C_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.atoms[1].nwl = 1; // only s and p for C - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - // find the R = 0,0,0 - for(int iR = 0; iR < tqo.nR(); iR++) - { - if(tqo.supercells()[iR].x == 0 && tqo.supercells()[iR].y == 0 && tqo.supercells()[iR].z == 0) - { - tqo.calculate_ovlpR(iR); - break; - } - } - // check if diagonal elements are 1 - for(int i = 0; i < tqo.nphi(); i++) - { - EXPECT_NEAR(tqo.ovlpR(i, i), 1.0, 1e-3); // this is too tight for 1s orbital, which fluctuates a lot in narrow region - } - //std::remove("Si_special_use_unittest.orb"); - //std::remove("C_special_use_unittest.orb"); - //tqo.write_ovlp(tqo.ovlpR()[0], "QO_self_ovlp.dat"); -} - -TEST_F(toQOTest, AppendOvlpReiRk) -{ - define_fcc_cell(ucell); - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - tqo.read_ovlp("./support/", nrows, ncols, true, 0); - std::vector ovlpR = tqo.ovlpR(); - tqo.zero_out_ovlps(false); - tqo.append_ovlpR_eiRk(0, 0); - std::vector> ovlpk = tqo.ovlpk(); - for(int i = 0; i < nrows*ncols; i++) - { - EXPECT_NEAR(ovlpk[i].real(), ovlpR[i], 1e-10); - EXPECT_NEAR(ovlpk[i].imag(), 0.0, 1e-10); - } -} - -TEST_F(toQOTest, CalculateSelfOvlpKSymmetrical) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - ucell.orbital_fn[0] = "Si_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.orbital_fn[1] = "C_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.atoms[1].nwl = 1; // only s and p for C - - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(-0.25, -0.25, -0.25)); // pair 1 - kvecs_d.push_back(ModuleBase::Vector3(0.25, 0.25, 0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, 0.25, 0.25)); // pair 2 - kvecs_d.push_back(ModuleBase::Vector3(0.25, -0.25, -0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, -0.25, 0.25)); // pair 3 - kvecs_d.push_back(ModuleBase::Vector3(0.25, 0.25, -0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, 0.25, -0.25)); // pair 4 - kvecs_d.push_back(ModuleBase::Vector3(0.25, -0.25, 0.25)); - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma - - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - // test symmetry cancellation on pair1s - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - - tqo.calculate_ovlpk(0); - std::vector> ovlpk_1 = tqo.ovlpk(); - tqo.calculate_ovlpk(1); - std::vector> ovlpk_2 = tqo.ovlpk(); - - bool all_zero = true; - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_1[i*ncols+j] + ovlpk_2[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-10); - if(ovlpR_ij.real() > 1e-10) - { - all_zero = false; - } - } - } - EXPECT_FALSE(all_zero); - // test symmetry cancellation on pair2 - tqo.calculate_ovlpk(2); - std::vector> ovlpk_3 = tqo.ovlpk(); - tqo.calculate_ovlpk(3); - std::vector> ovlpk_4 = tqo.ovlpk(); - all_zero = true; - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_3[i*ncols+j] + ovlpk_4[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-10); - if(ovlpR_ij.real() > 1e-10) - { - all_zero = false; - } - } - } - EXPECT_FALSE(all_zero); - // test symmetry cancellation on pair3 - tqo.calculate_ovlpk(4); - std::vector> ovlpk_5 = tqo.ovlpk(); - tqo.calculate_ovlpk(5); - std::vector> ovlpk_6 = tqo.ovlpk(); - all_zero = true; - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_5[i*ncols+j] + ovlpk_6[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-10); - if(ovlpR_ij.real() > 1e-10) - { - all_zero = false; - } - } - } - EXPECT_FALSE(all_zero); - // test symmetry cancellation on pair4 - tqo.calculate_ovlpk(6); - std::vector> ovlpk_7 = tqo.ovlpk(); - tqo.calculate_ovlpk(7); - std::vector> ovlpk_8 = tqo.ovlpk(); - all_zero = true; - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_7[i*ncols+j] + ovlpk_8[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-10); - if(ovlpR_ij.real() > 1e-10) - { - all_zero = false; - } - } - } - EXPECT_FALSE(all_zero); - // test symmetry cancellation on pair5 - tqo.calculate_ovlpk(8); - std::vector> ovlpk_9 = tqo.ovlpk(); - all_zero = true; - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - EXPECT_NEAR(ovlpk_9[i*ncols+j].imag(), 0.0, 1e-10); - if(ovlpk_9[i*ncols+j].real() > 1e-10) - { - all_zero = false; - } - } - } - EXPECT_FALSE(all_zero); - std::remove("Si_special_use_unittest.orb"); - std::remove("C_special_use_unittest.orb"); - for(int iR = 0; iR < tqo.nR(); iR++) - { - std::string fovlpR = "QO_ovlpR_" + std::to_string(iR) + ".dat"; - std::remove(fovlpR.c_str()); - } - //tqo.write_ovlp(tqo.ovlpR()[0], "QO_self_ovlp.dat"); -} - -TEST_F(toQOTest, BuildHydrogenFull) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - toQO tqo("hydrogen", {"full", "full"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - PARAM.input.qo_thr = 1e-10; - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - {}, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 9); // Si: 1s, 2s, 2p, 3s, 3p, 3d, C: 1s, 2s, 2p - EXPECT_EQ(tqo.nchi(), 19); - tqo.p_ao()->to_file("special_use_unittest"); -} - -TEST_F(toQOTest, CalculateSelfOvlpRFull) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", {"full", "full"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - ucell.orbital_fn[0] = "Si_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.orbital_fn[1] = "C_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.atoms[1].nwl = 1; // only s and p for C - PARAM.input.qo_thr = 1e-10; - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - // find the R = 0,0,0 - for(int iR = 0; iR < tqo.nR(); iR++) - { - if(tqo.supercells()[iR].x == 0 && tqo.supercells()[iR].y == 0 && tqo.supercells()[iR].z == 0) - { - tqo.calculate_ovlpR(iR); - break; - } - } - // check if diagonal elements are 1 - for(int i = 0; i < tqo.nphi(); i++) - { - EXPECT_NEAR(tqo.ovlpR(i, i), 1.0, 5e-4); // this is too tight for 1s orbital, which fluctuates a lot in narrow region - } - // check if symmetrical - for(int i = 0; i < tqo.nchi(); i++) - { - for(int j = 0; j < tqo.nphi(); j++) - { - EXPECT_NEAR(tqo.ovlpR(i, j), tqo.ovlpR(j, i), 1e-8); - } - } - std::remove("Si_special_use_unittest.orb"); - std::remove("C_special_use_unittest.orb"); - //tqo.write_ovlp(tqo.ovlpR()[0], "QO_self_ovlp.dat"); -} - -/* Si_dojo_soc.upf is special: two p orbitals, one s orbital */ - -/* Prerequisite: orbital filter, filters out not needed orbitals */ -TEST_F(toQOTest, OrbitalFilterOut) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {}; - // because qo_basis hydrogen doesnot have needs to filter out any orbitals, it should be always true - toQO tqo("hydrogen", {"full", "full"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - EXPECT_FALSE(tqo.orbital_filter_out(0, 0, 0)); // Si 1s - EXPECT_FALSE(tqo.orbital_filter_out(0, 0, 1)); // Si 2s - EXPECT_FALSE(tqo.orbital_filter_out(0, 1, 0)); // Si 2p -> 3 - EXPECT_FALSE(tqo.orbital_filter_out(0, 0, 2)); // Si 3s - EXPECT_FALSE(tqo.orbital_filter_out(0, 1, 1)); // Si 3p -> 3 - EXPECT_FALSE(tqo.orbital_filter_out(0, 2, 0)); // Si 3d -> 5 - EXPECT_FALSE(tqo.orbital_filter_out(1, 0, 0)); // C 1s - EXPECT_FALSE(tqo.orbital_filter_out(1, 0, 1)); // C 2s - EXPECT_FALSE(tqo.orbital_filter_out(1, 1, 0)); // C 2p -> 3 - // therefore in total we should have 1 + 1 + 3 + 1 + 3 + 5 + 1 + 1 + 3 = 19 orbitals - // distinguished by (it, ia, l, zeta, m) - - // if change to pswfc, then it should filter out some orbitals according to qo_strategy - PARAM.input.qo_screening_coeff = {0.5, 0.5}; - toQO tqo2("pswfc", {"s", "s"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - // for pswfc specifying l, filter does not care about number of zeta - for(int it = 0; it < 2; it++) - { - for(int l = 0; l < 100; l++) // any number of l are okay, because filter just want l = 0 - { - for(int z = 0; z < 100; z++) - { - if(l == 0) { EXPECT_FALSE(tqo2.orbital_filter_out(it, l, z)); - } else { EXPECT_TRUE(tqo2.orbital_filter_out(it, l, z)); -} - } - } - } - // next test with random ordered arranged names of subshell - toQO tqo3("pswfc", {"sfdp", "pdf"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - for(int l = 0; l < 100; l++) - { - for(int z = 0; z < 100; z++) - { - if(l == 0) - { - EXPECT_FALSE(tqo3.orbital_filter_out(0, l, z)); - EXPECT_TRUE(tqo3.orbital_filter_out(1, l, z)); - } - else if(l < 4) - { - EXPECT_FALSE(tqo3.orbital_filter_out(0, l, z)); - EXPECT_FALSE(tqo3.orbital_filter_out(1, l, z)); - } - else - { - EXPECT_TRUE(tqo3.orbital_filter_out(0, l, z)); - EXPECT_TRUE(tqo3.orbital_filter_out(1, l, z)); - } - } - } - // test combination `all` with `s` - toQO tqo4("pswfc", {"all", "p"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - for(int l = 0; l < 100; l++) - { - for(int z = 0; z < 100; z++) - { - if(l == 1) { EXPECT_FALSE(tqo4.orbital_filter_out(1, l, z)); - } else { EXPECT_TRUE(tqo4.orbital_filter_out(1, l, z)); -} - EXPECT_FALSE(tqo4.orbital_filter_out(0, l, z)); // do not filter out anything - } - } - // test szv, which controls both l and zeta - toQO tqo5("szv", {"sdp", "spdfg"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - // for 2 is given as lmax, l can only be 0, 1 and 2, izeta can only be 0 - for(int l = 0; l < 100; l++) - { - for(int z = 0; z < 100; z++) - { - // any not single zeta orbitals are not valid - if(z != 0) - { - EXPECT_TRUE(tqo5.orbital_filter_out(0, l, z)); - EXPECT_TRUE(tqo5.orbital_filter_out(1, l, z)); - } - else - { - if(l <= 2) - { - EXPECT_FALSE(tqo5.orbital_filter_out(0, l, z)); - EXPECT_FALSE(tqo5.orbital_filter_out(1, l, z)); - } - else if(l <= 4) - { - EXPECT_TRUE(tqo5.orbital_filter_out(0, l, z)); - EXPECT_FALSE(tqo5.orbital_filter_out(1, l, z)); - } - else - { - EXPECT_TRUE(tqo5.orbital_filter_out(0, l, z)); - EXPECT_TRUE(tqo5.orbital_filter_out(1, l, z)); - } - } - } - } -} - -TEST_F(toQOTest, BuildPswfcPartial1) -{ - define_fcc_cell(ucell); - toQO tqo("pswfc", {"s", "s"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 5); // AO will always read and import all orbitals - EXPECT_EQ(tqo.nchi(), 2); -} - -TEST_F(toQOTest, BuildPswfcPartial2) -{ - define_fcc_cell(ucell); - toQO tqo("pswfc", {"ps", "s"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 5); // AO will always read and import all orbitals - EXPECT_EQ(tqo.nchi(), 8); // the first element is Si, it has two p orbitals, so 3+3+1+1 -} - -TEST_F(toQOTest, BuildPswfcPartial3) -{ - define_fcc_cell(ucell); - toQO tqo("pswfc", {"all", "p"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 5); // AO will always read and import all orbitals - EXPECT_EQ(tqo.nchi(), 10); // (3+3+1)+(3) = 10 -} - -TEST_F(toQOTest, BuildPswfcAll) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - toQO tqo("pswfc", {"all", "all"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); - EXPECT_EQ(tqo.p_ao()->nchi(), 5); - EXPECT_EQ(tqo.nchi(), 11); - tqo.p_ao()->to_file("special_use_unittest"); -} - -TEST_F(toQOTest, ScanSupercellSC2) -{ - define_sc_cell(ucell); - toQO tqo("pswfc", {"all"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, - "./", - ucell.orbital_fn.data(), - 0); - PARAM.input.qo_screening_coeff[0] = 0.1; // use this to control the tailing of radial function - PARAM.input.qo_thr = 1e-6; - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); // radius = 13.6 Bohr - tqo.scan_supercell(0, 1); - EXPECT_EQ(tqo.nR(), 81); // 5*5*5 - 12(edge center) - 8*4(corner) -} - -TEST_F(toQOTest, ScanSupercellSC3) -{ - define_sc_cell(ucell); - toQO tqo("pswfc", {"all"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, - "./", - ucell.orbital_fn.data(), - 0); - PARAM.input.qo_screening_coeff[0] = 0.25; // use this to control the tailing of radial function - PARAM.input.qo_thr = 1e-6; - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); // radius = 13.6 Bohr - tqo.scan_supercell(0, 1); - EXPECT_EQ(tqo.nR(), 57); // 5*5*5 - 12(edge center) - 8*(8-1)(corner) = 5*5*5 - 12(edge center) - 8*(2*2*2-1)(corner) - PARAM.input.qo_screening_coeff[0] = 0.1; -} - -TEST_F(toQOTest, ScanSupercellSC4) -{ - define_sc_cell(ucell); - toQO tqo("pswfc", {"all"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.read_structures(&ucell, kvecs_d, 0, 1); - tqo.build_nao(ucell.ntype, - "./", - ucell.orbital_fn.data(), - 0); - PARAM.input.qo_screening_coeff[0] = 0.5; // use this to control the tailing of radial function - PARAM.input.qo_thr = 1e-6; - tqo.build_ao(ucell.ntype, - "./", - ucell.pseudo_fn.data(), - PARAM.input.qo_screening_coeff, - PARAM.input.qo_thr, - GlobalV::ofs_running, - 0); // radius = 13.6 Bohr - tqo.scan_supercell(0, 1); - EXPECT_EQ(tqo.nR(), 33); // 3*3*3 + 6(face) - PARAM.input.qo_screening_coeff[0] = 0.1; -} - -TEST_F(toQOTest, CalculateSelfOvlpRPswfc) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - toQO tqo("pswfc", {"all", "all"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - ucell.orbital_fn.data()[0] = "Si_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.orbital_fn.data()[1] = "C_special_use_unittest.orb"; // generated in unittest BuildAo - ucell.atoms[1].nwl = 1; // only s and p for C - //PARAM.input.qo_thr = 1e-10; - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - // find the R = 0,0,0 - for(int iR = 0; iR < tqo.nR(); iR++) - { - if(tqo.supercells()[iR].x == 0 && tqo.supercells()[iR].y == 0 && tqo.supercells()[iR].z == 0) - { - tqo.calculate_ovlpR(iR); - break; - } - } - // check if diagonal elements are 1 - for(int i = 0; i < tqo.nphi(); i++) - { - EXPECT_NEAR(tqo.ovlpR(i, i), 1.0, 1e-4); - } - // check if symmetrical - for(int i = 0; i < tqo.nchi(); i++) - { - for(int j = 0; j < tqo.nphi(); j++) - { - EXPECT_NEAR(tqo.ovlpR(i, j), tqo.ovlpR(j, i), 1e-4); - } - } - std::remove("Si_special_use_unittest.orb"); - std::remove("C_special_use_unittest.orb"); -} - -TEST_F(toQOTest, CalculateOvlpKGamma) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - tqo.calculate_ovlpk(0); - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - // all should be real numbers at Gamma point - bool all_real = true; - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - if(tqo.ovlpk()[i*ncols+j].imag() != 0.0) - { - all_real = false; - } - } - } - EXPECT_TRUE(all_real); - for(int iR = 0; iR < tqo.nR(); iR++) - { - std::string fovlpk = "QO_ovlpR_" + std::to_string(iR) + ".dat"; - std::remove(fovlpk.c_str()); - } -} - -TEST_F(toQOTest, CalculateOvlpKSlaterGamma) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {0.1}; - toQO tqo("hydrogen", {"energy-full", "energy-full"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - tqo.calculate_ovlpk(0); - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - // all should be real numbers at Gamma point - bool all_real = true; - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - if(tqo.ovlpk()[i*ncols+j].imag() != 0.0) - { - all_real = false; - } - } - } - EXPECT_TRUE(all_real); - for(int iR = 0; iR < tqo.nR(); iR++) - { - std::string fovlpk = "QO_ovlpR_" + std::to_string(iR) + ".dat"; - std::remove(fovlpk.c_str()); - } -} - -TEST_F(toQOTest, CalculateSelfOvlpKPswfcSymmetrical) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {2.0, 2.0}; - toQO tqo("pswfc", {"all", "all"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(-0.25, -0.25, -0.25)); // pair 1 - kvecs_d.push_back(ModuleBase::Vector3(0.25, 0.25, 0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, 0.25, 0.25)); // pair 2 - kvecs_d.push_back(ModuleBase::Vector3(0.25, -0.25, -0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, -0.25, 0.25)); // pair 3 - kvecs_d.push_back(ModuleBase::Vector3(0.25, 0.25, -0.25)); - kvecs_d.push_back(ModuleBase::Vector3(-0.25, 0.25, -0.25)); // pair 4 - kvecs_d.push_back(ModuleBase::Vector3(0.25, -0.25, 0.25)); - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma - - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - EXPECT_EQ(nrows, 11); - EXPECT_EQ(ncols, 26); - std::cout << "Number of supercells: " << tqo.nR() << ", number of kpoints: " << tqo.nks() << std::endl; - tqo.calculate_ovlpk(0); - std::vector> ovlpk_1 = tqo.ovlpk(); - tqo.calculate_ovlpk(1); - std::vector> ovlpk_2 = tqo.ovlpk(); - // check if all imaginary parts are cancelled - bool all_real = true; - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_1[i*ncols+j] + ovlpk_2[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-8); - } - } - tqo.calculate_ovlpk(2); - std::vector> ovlpk_3 = tqo.ovlpk(); - tqo.calculate_ovlpk(3); - std::vector> ovlpk_4 = tqo.ovlpk(); - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_3[i*ncols+j] + ovlpk_4[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-8); - } - } - tqo.calculate_ovlpk(4); - std::vector> ovlpk_5 = tqo.ovlpk(); - tqo.calculate_ovlpk(5); - std::vector> ovlpk_6 = tqo.ovlpk(); - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_5[i*ncols+j] + ovlpk_6[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-8); - } - } - tqo.calculate_ovlpk(6); - std::vector> ovlpk_7 = tqo.ovlpk(); - tqo.calculate_ovlpk(7); - std::vector> ovlpk_8 = tqo.ovlpk(); - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - std::complex ovlpR_ij = ovlpk_7[i*ncols+j] + ovlpk_8[i*ncols+j]; - EXPECT_NEAR(ovlpR_ij.imag(), 0.0, 1e-8); - } - } - tqo.calculate_ovlpk(8); - std::vector> ovlpk_9 = tqo.ovlpk(); - // check if all imaginary parts are cancelled - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - // R = 0, 0, 0, then unfolding kphase would be e-ikR = 1, - // becomes direct summation over kpoints - EXPECT_NEAR(ovlpk_9[i*ncols+j].imag(), 0.0, 1e-8); - } - } - //tqo.write_ovlp(tqo.ovlpR()[0], "QO_self_ovlp.dat"); - for(int iR = 0; iR < tqo.nR(); iR++) - { - std::string fovlpR = "QO_ovlpR_" + std::to_string(iR) + ".dat"; - std::remove(fovlpR.c_str()); - } -} - -TEST_F(toQOTest, CalculateHydrogenlike) -{ - define_fcc_cell(ucell); - PARAM.input.qo_thr = 1e-10; - PARAM.input.qo_screening_coeff = {}; - toQO tqo("hydrogen", - {"minimal-nodeless", "minimal-nodeless"}, - PARAM.input.qo_thr, - PARAM.input.qo_screening_coeff); - std::vector> kvecs_d; - kvecs_d.push_back(ModuleBase::Vector3(0.0, 0.0, 0.0)); // Gamma point - kvecs_d.push_back(ModuleBase::Vector3(0.5, 0.0, 0.0)); - tqo.initialize(PARAM.sys.global_out_dir, - "", - "", - &ucell, - kvecs_d, - GlobalV::ofs_running, - 0, 1); - tqo.calculate(); - int nrows = tqo.nchi(); - int ncols = tqo.nphi(); - // for the latest kpoint, not all numbers are complex zero - bool all_zero = true; - for(int i = 0; i < nrows; i++) - { - for(int j = 0; j < ncols; j++) - { - if(tqo.ovlpk()[i*ncols+j] != std::complex(0.0, 0.0)) - { - all_zero = false; - } - } - } - EXPECT_EQ(all_zero, false); - // delete files generated namely QO_ovlp_0.dat and QO_ovlp_1.dat - std::remove("QO_ovlp_0.dat"); - std::remove("QO_ovlp_1.dat"); - std::remove("QO_supercells.dat"); - for(int iR = 0; iR < tqo.nR(); iR++) - { - std::string fovlpR = "QO_ovlpR_" + std::to_string(iR) + ".dat"; - std::remove(fovlpR.c_str()); - } -} - -TEST_F(toQOTest, BcastStdvectorOfVector3Int) -{ - #ifdef __MPI - std::vector> vec; - if (this->myrank == 0) - { - vec.push_back(ModuleBase::Vector3(1, 2, 3)); - vec.push_back(ModuleBase::Vector3(4, 5, 6)); - vec.push_back(ModuleBase::Vector3(7, 8, 9)); - } - toQO::bcast_stdvector_ofvector3int(vec, myrank); - if (this->myrank != 0) - { - EXPECT_EQ(vec[0], ModuleBase::Vector3(1, 2, 3)); - EXPECT_EQ(vec[1], ModuleBase::Vector3(4, 5, 6)); - EXPECT_EQ(vec[2], ModuleBase::Vector3(7, 8, 9)); - } - #else - GTEST_SKIP(); - #endif -} - -TEST_F(toQOTest, BcastStdvectorOfVector3Double) -{ - #ifdef __MPI - std::vector> vec; - if (this->myrank == 0) - { - vec.push_back(ModuleBase::Vector3(1.0, 2.0, 3.0)); - vec.push_back(ModuleBase::Vector3(4.0, 5.0, 6.0)); - vec.push_back(ModuleBase::Vector3(7.0, 8.0, 9.0)); - } - toQO::bcast_stdvector_ofvector3double(vec, myrank); - if (this->myrank != 0) - { - EXPECT_EQ(vec[0], ModuleBase::Vector3(1.0, 2.0, 3.0)); - EXPECT_EQ(vec[1], ModuleBase::Vector3(4.0, 5.0, 6.0)); - EXPECT_EQ(vec[2], ModuleBase::Vector3(7.0, 8.0, 9.0)); - } - #else - GTEST_SKIP(); - #endif -} - -/**/ -int main(int argc, char** argv) -{ - // current getcwd() - std::cout << "Current getcwd: " << getcwd(nullptr, 0) << std::endl; - -#ifdef __MPI - MPI_Init(&argc, &argv); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - -#ifdef __MPI - MPI_Finalize(); -#endif - - return result; -} diff --git a/source/module_io/test/winput_test.cpp b/source/module_io/test/winput_test.cpp deleted file mode 100644 index 7a3d301e40..0000000000 --- a/source/module_io/test/winput_test.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -/************************************************ - * unit test of winput.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - Read() - * - Read in parameters about Wannier functions - * - Print() - * - Print out parameters about Wannier functions - */ - -#define private public -#include "../winput.h" -#undef private -class WInputTest : public testing::Test -{ -protected: - std::ifstream ifs; - std::string output; -}; - -TEST_F(WInputTest, Read) -{ - winput::Default(); - std::stringstream ss1; - ss1 << "./support/WINPUT"; - winput::Read(ss1.str()); - EXPECT_EQ(winput::target,"test"); - EXPECT_EQ(winput::wlmr_dir ,"./"); - EXPECT_EQ(winput::rcut ,10); - EXPECT_EQ(winput::before_iter ,0); - EXPECT_EQ(winput::after_iter ,0); - EXPECT_EQ(winput::begin_stop_flag ,0); - EXPECT_EQ(winput::end_flag ,0); - EXPECT_EQ(winput::wf_type ,"V"); - EXPECT_EQ(winput::build_wf ,0); - EXPECT_EQ(winput::imp_pao ,0); - EXPECT_EQ(winput::b_out_wf ,0); - EXPECT_EQ(winput::b_fftwan ,0); - EXPECT_EQ(winput::b_plot_build ,0); - EXPECT_EQ(winput::b_plot_atomic ,0); - EXPECT_EQ(winput::trial ,"atomic"); - EXPECT_DOUBLE_EQ(winput::bs ,2.5); - EXPECT_EQ(winput::bp ,2); - EXPECT_EQ(winput::px ,2); - EXPECT_EQ(winput::g1 ,3); - EXPECT_EQ(winput::g2 ,3); - EXPECT_EQ(winput::bloch_begin ,0); - EXPECT_EQ(winput::bloch_end ,0); - EXPECT_EQ(winput::no_center ,0); - EXPECT_EQ(winput::sph_proj ,0); - EXPECT_EQ(winput::sph_type ,0); - EXPECT_EQ(winput::b_recon ,0); - EXPECT_EQ(winput::speed_mode ,1); - EXPECT_EQ(winput::recon_wanq ,0); - EXPECT_EQ(winput::b_mix_wf ,0); - EXPECT_EQ(winput::mix_wf ,0); - EXPECT_EQ(winput::b_near_atom ,0); - EXPECT_EQ(winput::range0 ,0); - EXPECT_EQ(winput::range1 ,0); - EXPECT_EQ(winput::L_start ,0); - EXPECT_EQ(winput::L_end ,2); - EXPECT_EQ(winput::atom_start ,0); - EXPECT_EQ(winput::atom_end ,1); - EXPECT_EQ(winput::trunc_ao ,6); - EXPECT_EQ(winput::trunc_wlmr ,14); - EXPECT_EQ(winput::trunc_wan ,6); - EXPECT_EQ(winput::fermi_t ,1); - EXPECT_DOUBLE_EQ(winput::clm2_lowest,1e-07); - EXPECT_EQ(winput::plot_wanq ,0); - EXPECT_EQ(winput::plot_option ,"(110)"); - EXPECT_EQ(winput::n_unitcell ,2); - EXPECT_EQ(winput::out_all ,0); - EXPECT_EQ(winput::out_chg ,0); - EXPECT_EQ(winput::compare_atomic ,0); - EXPECT_EQ(winput::cal_bands ,0); - EXPECT_EQ(winput::cal_bands2 ,0); - EXPECT_EQ(winput::charge_type ,"planewave"); - EXPECT_EQ(winput::cal_dos ,0); - EXPECT_EQ(winput::out_spillage ,0); - EXPECT_EQ(winput::spillage_outdir ,"./"); - EXPECT_EQ(winput::mesh ,999); - EXPECT_DOUBLE_EQ(winput::dr ,0.01); - EXPECT_EQ(winput::sum_lm ,0); -} - -TEST_F(WInputTest, Print) -{ - winput::Default(); - std::stringstream ss1; - ss1 << "WINPUT_out"; - winput::Print(ss1.str()); - ifs.open("WINPUT_out"); - getline(ifs,output); - // test output in warning.log file - EXPECT_THAT(output,testing::HasSubstr("WANNIER_PARAMETERS")); - ifs.close(); - remove("WINPUT_out"); -} diff --git a/source/module_io/test/write_dos_pw_test.cpp b/source/module_io/test/write_dos_pw_test.cpp deleted file mode 100644 index 91b87a2427..0000000000 --- a/source/module_io/test/write_dos_pw_test.cpp +++ /dev/null @@ -1,187 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#include "module_io/write_dos_pw.h" -#ifdef __MPI -#include "mpi.h" -#endif -#include "for_testing_klist.h" -#include "dos_test.h" - -#define private public -#include "module_parameter/parameter.h" -#undef private - -/************************************************ - * unit test of write_dos_pw - ***********************************************/ - -/** - * - Tested Functions: - * - write_dos_pw() - * - the function to calculate and print out - * - density of states in pw basis calculation - */ - - -class DosPWTest : public ::testing::Test -{ -protected: - K_Vectors* kv = nullptr; - ModuleBase::matrix ekb; - ModuleBase::matrix wg; - void SetUp() - { - kv = new K_Vectors; - } - void TearDown() - { - delete kv; - } -}; - -TEST_F(DosPWTest,Dos1) -{ - //is,fa,fa1,de_ev,emax_ev,emin_ev,bcoeff,nks,nkstot,nbands - DosPrepare dosp = DosPrepare(0,"doss1_pw.txt",0.005,18,-6,0.07,36,36,8); - dosp.set_isk(); - dosp.read_wk(); - dosp.read_istate_info(); - EXPECT_EQ(dosp.is,0); - double dos_scale = 0.01; - PARAM.input.nspin = 1; - PARAM.input.dos_emax_ev = dosp.emax_ev; - PARAM.sys.dos_setemax = true; - PARAM.input.dos_emin_ev = dosp.emin_ev; - PARAM.sys.dos_setemin = true; - kv->set_nks(dosp.nks); - kv->set_nkstot(dosp.nkstot); - kv->isk.reserve(kv->get_nks()); - kv->wk.reserve(kv->get_nks()); - for(int ik=0; ikget_nks(); ++ik) - { - kv->isk[ik] = dosp.isk[ik]; - kv->wk[ik] = dosp.wk[ik]; - } - PARAM.input.nbands = dosp.nbands; - - // initialize the Fermi energy - elecstate::efermi fermi_energy; - - std::ofstream ofs("write_dos_pw.log"); - - UnitCell ucell; - - ModuleIO::write_dos_pw( - ucell, // this should be unitcell, 2025-04-12 - dosp.ekb, - dosp.wg, - *kv, - PARAM.inp.nbands, - fermi_energy, - dosp.de_ev, - dos_scale, - dosp.bcoeff, - ofs); - ofs.close(); - remove("write_dos_pw.log"); - -#ifdef __MPI - if(GlobalV::MY_RANK==0) - { -#endif - std::ifstream ifs; - ifs.open("doss1_pw.txt"); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("4801 # number of points")); - EXPECT_THAT(str, testing::HasSubstr(" -4.6 0.25 0.28125 1.42515 0.159819")); - EXPECT_THAT(str, testing::HasSubstr(" 18 0 16 0 16")); - ifs.close(); - remove("doss1_pw.txt"); -#ifdef __MPI - } -#endif -} - - -TEST_F(DosPWTest,Dos2) -{ - //is,fa,fa1,de_ev,emax_ev,emin_ev,bcoeff,nks,nkstot,nbands - DosPrepare dosp = DosPrepare(0,"doss1_pw.txt",0.005,18,-6,0.07,36,36,8); - dosp.set_isk(); - dosp.read_wk(); - dosp.read_istate_info(); - EXPECT_EQ(dosp.is,0); - double dos_scale = 0.01; - PARAM.input.nspin = 1; - PARAM.input.dos_emax_ev = dosp.emax_ev; - PARAM.sys.dos_setemax = false; - PARAM.input.dos_emin_ev = dosp.emin_ev; - PARAM.sys.dos_setemin = false; - kv->set_nks(dosp.nks); - kv->set_nkstot(dosp.nkstot); - kv->isk.reserve(kv->get_nks()); - kv->wk.reserve(kv->get_nks()); - for(int ik=0; ikget_nks(); ++ik) - { - kv->isk[ik] = dosp.isk[ik]; - kv->wk[ik] = dosp.wk[ik]; - } - PARAM.input.nbands = dosp.nbands; - - // initialize the Fermi energy - elecstate::efermi fermi_energy; - - std::ofstream ofs("write_dos_pw.log"); - - UnitCell ucell; - - ModuleIO::write_dos_pw( - ucell, - dosp.ekb, - dosp.wg, - *kv, - PARAM.inp.nbands, - fermi_energy, - dosp.de_ev, - dos_scale, - dosp.bcoeff, - ofs); - ofs.close(); - remove("write_dos_pw.log"); - -#ifdef __MPI - if(GlobalV::MY_RANK==0) - { -#endif - std::ifstream ifs; - ifs.open("doss1_pw.txt"); - std::string str1((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str1, testing::HasSubstr("4532 # number of points")); - EXPECT_THAT(str1, testing::HasSubstr(" -5.38811 0.03125 0.03125")); - EXPECT_THAT(str1, testing::HasSubstr(" 3.07189 0.1875 5.46875")); - ifs.close(); - remove("doss1_pw.txt"); -#ifdef __MPI - } -#endif -} - -#ifdef __MPI -int main(int argc, char **argv) -{ - MPI_Init(&argc,&argv); - - testing::InitGoogleTest(&argc,argv); - MPI_Comm_size(MPI_COMM_WORLD,&GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD,&GlobalV::MY_RANK); - - // only test the second one - // ::testing::GTEST_FLAG(filter) = "DosPWTest.Dos2"; - - int result = RUN_ALL_TESTS(); - - MPI_Finalize(); - - return result; -} -#endif diff --git a/source/module_io/test/write_eig_occ_test.cpp b/source/module_io/test/write_eig_occ_test.cpp deleted file mode 100644 index ca67acd9ec..0000000000 --- a/source/module_io/test/write_eig_occ_test.cpp +++ /dev/null @@ -1,128 +0,0 @@ -#include "source_base/global_variable.h" - -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include -#ifdef __MPI -#include "source_base/parallel_global.h" -#include "source_cell/parallel_kpoints.h" -#include "mpi.h" -#endif -#include "../write_eig_occ.h" -#include "for_testing_klist.h" - -/************************************************ - * unit test of write_eig_occ - ***********************************************/ - -/** - * - Tested Functions: - * - write_eig_occ() - * - print out electronic eigen energies and - * - occupation - */ - -class IstateInfoTest : public ::testing::Test -{ - protected: - K_Vectors* kv = nullptr; - ModuleBase::matrix ekb; - ModuleBase::matrix wg; - void SetUp() - { - kv = new K_Vectors; - } - void TearDown() - { - delete kv; - } -}; - -TEST_F(IstateInfoTest, OutIstateInfoS1) -{ - // Global variables - GlobalV::KPAR = 1; - PARAM.input.nbands = 4; - PARAM.sys.nbands_l = 4; - PARAM.input.nspin = 1; - PARAM.sys.global_out_dir = "./"; - - // MPI setting - Parallel_Global::init_pools(GlobalV::NPROC, - GlobalV::MY_RANK, - PARAM.input.bndpar, - GlobalV::KPAR, - GlobalV::NPROC_IN_BNDGROUP, - GlobalV::RANK_IN_BPGROUP, - GlobalV::MY_BNDGROUP, - GlobalV::NPROC_IN_POOL, - GlobalV::RANK_IN_POOL, - GlobalV::MY_POOL); - - const int nkstot_init = 10; - kv->set_nkstot(nkstot_init); - int nkstot = kv->get_nkstot(); - kv->para_k.kinfo(nkstot, GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::RANK_IN_POOL, - GlobalV::NPROC_IN_POOL, PARAM.input.nspin); - kv->set_nks(kv->para_k.nks_pool[GlobalV::MY_POOL]); - - // The number of plane waves for each k point - kv->ngk.resize(nkstot); - kv->ik2iktot.resize(nkstot); - for(int i=0; ingk[i]=299; - kv->ik2iktot[i]=i; - } - - // Initialize the number of bands - ekb.create(kv->get_nks(), PARAM.input.nbands); - wg.create(kv->get_nks(), PARAM.input.nbands); - - // fill the eigenvalues - ekb.fill_out(0.15); - - // fill the weights - wg.fill_out(0.0); - - // setup coordinates of k-points - kv->kvec_c.resize(kv->get_nkstot()); - int i = 0; - for (auto& kd: kv->kvec_c) - { - kd.set(0.01 * i, 0.01 * i, 0.01 * i); - ++i; - } - - // write eigenvalues and occupations - ModuleIO::write_eig_file(ekb, wg, *kv); - - // check the output files - std::ifstream ifs; - ifs.open("eig.txt"); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("Electronic state energy (eV) and occupations")); - EXPECT_THAT(str, testing::HasSubstr("spin=1 k-point=1/10 Cartesian=0.0000000 0.0000000 0.0000000 (299 plane wave)")); - EXPECT_THAT(str, testing::HasSubstr("1 2.040854700000000 0.000000000000000")); - ifs.close(); - remove("eig.txt"); -} - -#ifdef __MPI -int main(int argc, char** argv) -{ - MPI_Init(&argc, &argv); - - testing::InitGoogleTest(&argc, argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); - int result = RUN_ALL_TESTS(); - - MPI_Finalize(); - - return result; -} -#endif diff --git a/source/module_io/test/write_orb_info_test.cpp b/source/module_io/test/write_orb_info_test.cpp deleted file mode 100644 index dbf0d6449e..0000000000 --- a/source/module_io/test/write_orb_info_test.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "module_io/write_orb_info.h" -#include "source_cell/unitcell.h" -#include "prepare_unitcell.h" -#include "source_estate/read_pseudo.h" - -#ifdef __LCAO -InfoNonlocal::InfoNonlocal(){} -InfoNonlocal::~InfoNonlocal(){} -LCAO_Orbitals::LCAO_Orbitals(){} -LCAO_Orbitals::~LCAO_Orbitals(){} -#endif -Magnetism::Magnetism() -{ - this->tot_mag = 0.0; - this->abs_mag = 0.0; - this->start_mag = nullptr; -} -Magnetism::~Magnetism() -{ - delete[] this->start_mag; -} - -/************************************************ - * unit test of write_orb_info - ***********************************************/ - -/** - * - Tested Functions: - * - write_orb_info() - */ - - -TEST(OrbInfo,WriteOrbInfo) -{ - UnitCell* ucell = new UnitCell; - UcellTestPrepare utp = UcellTestLib["Si"]; - ucell = utp.SetUcellInfo(); - ucell->set_iat2itia(); - std::string pp_dir = "./support/"; - std::ofstream ofs; - ofs.open("running.log"); - PARAM.sys.global_out_dir = "./"; - PARAM.input.pseudo_rcut = 15.0; - PARAM.input.lspinorb = false; - PARAM.input.nspin = 1; - PARAM.input.basis_type = "pw"; - PARAM.input.dft_functional = "default"; - PARAM.sys.nlocal = 18; - elecstate::read_cell_pseudopots(pp_dir,ofs,*ucell); - elecstate::cal_nwfc(ofs,*ucell,ucell->atoms); - ModuleIO::write_orb_info(ucell); - ofs.close(); - std::ifstream ifs("Orbital"); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("#io spec l m z sym")); - EXPECT_THAT(str, testing::HasSubstr("0 Si 0 0 1 s")); - EXPECT_THAT(str, testing::HasSubstr("0 Si 2 4 1 dxy")); - EXPECT_THAT(str, testing::HasSubstr("#sym =Symmetry name of real orbital")); - ifs.close(); - delete ucell; - std::remove("Orbital"); - std::remove("running.log"); -} - -#ifdef __MPI -#include "mpi.h" -int main(int argc, char **argv) -{ - - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD,&GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD,&GlobalV::MY_RANK); - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); - - MPI_Finalize(); - - return result; -} -#endif - - diff --git a/source/module_io/test/write_wfc_nao_para.sh b/source/module_io/test/write_wfc_nao_para.sh deleted file mode 100644 index 752fcd9b5e..0000000000 --- a/source/module_io/test/write_wfc_nao_para.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -e - -np=`cat /proc/cpuinfo | grep "cpu cores" | uniq| awk '{print $NF}'` -echo "nprocs in this machine is $np" - -for i in 4;do - if [[ $i -gt $np ]];then - continue - fi - echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./MODULE_IO_write_wfc_nao - if [[ $? -ne 0 ]]; then - echo -e "\e[1;33m [ FAILED ] \e[0m"\ - "execute UT with $i cores error." - exit 1 - fi - break -done \ No newline at end of file diff --git a/source/module_io/test/write_wfc_nao_test.cpp b/source/module_io/test/write_wfc_nao_test.cpp deleted file mode 100644 index a564169e05..0000000000 --- a/source/module_io/test/write_wfc_nao_test.cpp +++ /dev/null @@ -1,520 +0,0 @@ -#include "../write_wfc_nao.h" -#include "../filename.h" - -#define private public -#include "module_parameter/parameter.h" -#undef private -#include "../binstream.h" -#include "source_base/global_variable.h" -#include "source_base/scalapack_connector.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -#ifdef __MPI -#include "mpi.h" -#endif - -TEST(GenWfcLcaoFnameTest, OutType1GammaOnlyOutAppFlagTrue) -{ - const std::string directory = ""; - const std::string property = "wf"; - const std::string basis = "nao"; - const int ik = 0; - const std::vector ik2iktot = {0}; - const int nspin = 1; - const int nkstot = 1; - const int out_type = 1; - const bool out_app_flag = true; - const bool gamma_only = true; - // if out_app_flag = true, then the 'g' label will not show up - const int istep = 0; - - std::string result = ModuleIO::filename_output( - directory, property, basis, ik, ik2iktot, nspin, - nkstot, out_type, out_app_flag, gamma_only, istep); - - // output .txt file when out_type=1 - std::string expected_output = "wfs1_nao.txt"; - - EXPECT_EQ(result, expected_output); -} - -TEST(GenWfcLcaoFnameTest, OutType2GammaOnlyOutAppFlagFalse) -{ - const std::string directory = ""; - const std::string property = "wf"; - const std::string basis = "nao"; - const int ik = 1; - const std::vector ik2iktot = {0,1}; - const int nspin = 2; - const int nkstot = 2; - const int out_type = 2; - const bool out_app_flag = false; - const bool gamma_only = true; - // if out_app_flag = false, then the 'g' label appears - const int istep = 2; - - std::string result = ModuleIO::filename_output( - directory, property, basis, ik, ik2iktot, nspin, - nkstot, out_type, out_app_flag, gamma_only, istep); - - // output .dat file when out_type=2 - std::string expected_output = "wfs2g3_nao.dat"; - EXPECT_EQ(result, expected_output); -} - -TEST(GenWfcLcaoFnameTest, OutTypeInvalid) -{ - const std::string directory = ""; - const std::string property = "wf"; - const std::string basis = "nao"; - const int ik = 2; - const std::vector ik2iktot = {0,1,2}; - const int nspin = 1; - const int nkstot = 3; - const int out_type = 3; - const bool out_app_flag = true; - const bool gamma_only = false; - const int istep = 3; - - // catch the screen output - testing::internal::CaptureStdout(); - - std::string result = ModuleIO::filename_output( - directory, property, basis, ik, ik2iktot, nspin, - nkstot, out_type, out_app_flag, gamma_only, istep); - - std::string output = testing::internal::GetCapturedStdout(); - - // a .txt is chosen if out_type is not 1 or 2 - std::string expected_output = "wfs1k3_nao.txt"; - EXPECT_EQ(result, expected_output); -} - -template -void read_bin(const std::string& name, std::vector& data) -{ - std::ifstream ifs(name, std::ios::binary); - ifs.seekg(0, std::ios::beg); - int nbands=0; - int nbasis=0; - if (std::is_same>::value) - { - ifs.ignore(sizeof(int)); - ifs.ignore(sizeof(double) * 3); - } - ifs.read(reinterpret_cast(&nbands), sizeof(int)); - ifs.read(reinterpret_cast(&nbasis), sizeof(int)); - data.resize(nbands * nbasis); - - for (int i = 0; i < nbands; i++) - { - ifs.ignore(sizeof(int)); - ifs.ignore(sizeof(double) * 2); - for (int j = 0; j < nbasis; j++) - { - ifs.read(reinterpret_cast(&data[i * nbasis + j]), sizeof(T)); - } - } - ifs.close(); -} - -class WriteWfcLcaoTest : public testing::Test -{ - protected: - ModuleBase::matrix ekb; - ModuleBase::matrix wg; - std::vector> kvec_c; - - std::vector psi_init_double; - std::vector> psi_init_complex; - std::vector psi_local_double; - std::vector> psi_local_complex; - Parallel_Orbitals pv; - int nk = 2; - int nbands = 3; - int nbasis = 4; - int nbands_local = 0; - int nbasis_local = 0; - - // mohan add 2025-05-11 - std::vector ik2iktot = {0,1}; - int nkstot = 2; - bool out_app_flag = true; - - void SetUp() override - { - ekb.create(nk, nbands); // in this test the value of ekb and wg is not important and not used. - wg.create(nk, nbands); - kvec_c.resize(nk, ModuleBase::Vector3(0.0, 0.0, 0.0)); - psi_init_double.resize(nk * nbands * nbasis); - psi_init_complex.resize(nk * nbands * nbasis); - for (int i = 0; i < nk * nbands * nbasis; i++) - { - psi_init_double[i] = i * 0.1; - psi_init_complex[i] = std::complex(i * 0.2, i * 0.3); - } -#ifdef __MPI - pv.init(nbasis, nbands, 1, MPI_COMM_WORLD); - for (int i = 0; i < 9; i++) - { - pv.desc_wfc[i] = pv.desc[i]; - } - - // create a global PV, and distribute the psi_init to local - Parallel_2D pv_glb; - pv_glb.init(nbasis, nbands, std::max(nbasis, nbands), MPI_COMM_WORLD); - psi_local_double.resize(nk * pv.get_row_size() * pv.get_col_size()); - psi_local_complex.resize(nk * pv.get_row_size() * pv.get_col_size()); - for (int ik = 0; ik < nk; ik++) - { - Cpxgemr2d(nbasis, - nbands, - psi_init_double.data() + ik * nbands * nbasis, - 1, - 1, - pv_glb.desc, - psi_local_double.data() + ik * pv.get_row_size() * pv.get_col_size(), - 1, - 1, - pv.desc, - pv.blacs_ctxt); - Cpxgemr2d(nbasis, - nbands, - psi_init_complex.data() + ik * nbands * nbasis, - 1, - 1, - pv_glb.desc, - psi_local_complex.data() + ik * pv.get_row_size() * pv.get_col_size(), - 1, - 1, - pv.desc, - pv.blacs_ctxt); - } - nbands_local = pv.get_col_size(); - nbasis_local = pv.get_row_size(); -#else - psi_local_double = psi_init_double; - psi_local_complex = psi_init_complex; - nbands_local = nbands; - nbasis_local = nbasis; -#endif - } -}; - -TEST_F(WriteWfcLcaoTest, WriteWfcLcao) -{ - PARAM.sys.global_out_dir = "./"; - - const std::string directory = ""; - const std::string property = "wf"; - const std::string basis = "nao"; - const int nspin = 2; - const int out_type = 2; - const bool gamma_only = true; - const int istep = -1; - - psi::Psi my_psi(psi_local_double.data(), nk, nbands_local, nbasis_local, nbasis_local, true); - - ModuleIO::write_wfc_nao(out_type, out_app_flag, my_psi, ekb, wg, kvec_c, - ik2iktot, nkstot, pv, nspin, istep); - - // check the output file - if (GlobalV::MY_RANK == 0) - { - for (int ik = 0; ik < nk; ik++) - { - std::string fname = ModuleIO::filename_output( - directory, property, basis, ik, ik2iktot, nspin, - nkstot, out_type, out_app_flag, gamma_only, istep); - - std::ifstream file1(fname); - EXPECT_TRUE(file1.good()); - std::vector data; - read_bin(fname, data); - - EXPECT_EQ(data.size(), nbands * nbasis); - - for (int i = 0; i < nbands * nbasis; i++) - { - EXPECT_DOUBLE_EQ(data[i], psi_init_double[nbands * nbasis * ik + i]); - } - // remove the output files - std::remove(fname.c_str()); - } - } -} - -TEST_F(WriteWfcLcaoTest, WriteWfcLcaoComplex) -{ - PARAM.sys.global_out_dir = "./"; - - const std::string directory = ""; - const std::string property = "wf"; - const std::string basis = "nao"; - const int nspin = 1; - const int out_type = 2; - const bool gamma_only = false; - const int istep = -1; - - psi::Psi> my_psi(psi_local_complex.data(), nk, nbands_local, nbasis_local, true); - - ModuleIO::write_wfc_nao(out_type, out_app_flag, my_psi, ekb, wg, kvec_c, - ik2iktot, nkstot, pv, nspin, istep); - - // check the output file - if (GlobalV::MY_RANK == 0) - { - for (int ik = 0; ik < nk; ik++) - { - std::string fname = ModuleIO::filename_output( - directory, property, basis, ik, ik2iktot, nspin, - nkstot, out_type, out_app_flag, gamma_only, istep); - - std::ifstream file1(fname); - EXPECT_TRUE(file1.good()); - std::vector> data; - read_bin(fname, data); - - EXPECT_EQ(data.size(), nbands * nbasis); - for (int i = 0; i < nbands * nbasis; i++) - { - EXPECT_DOUBLE_EQ(data[i].real(), psi_init_complex[nbands * nbasis * ik + i].real()); - EXPECT_DOUBLE_EQ(data[i].imag(), psi_init_complex[nbands * nbasis * ik + i].imag()); - } - // remove the output files - std::remove(fname.c_str()); - } - } -} - -TEST(ModuleIOTest, WriteWfcNao) -{ - if (GlobalV::MY_RANK == 0) - { - // Set up GlobalV - GlobalV::DRANK = 0; - PARAM.input.nbands = 2; - PARAM.sys.nlocal = 2; - - // Set up test data - std::string filename = "test_wfc_nao.txt"; - std::vector ctot = {0.1, 0.2, 0.3, 0.4}; - ModuleBase::matrix ekb(2, 2); - ekb(0, 0) = 0.5; - ekb(1, 0) = 0.6; - ekb(0, 1) = 0.7; - ekb(1, 1) = 0.8; - ModuleBase::matrix wg(2, 2); - wg(0, 0) = 0.9; - wg(1, 0) = 1.0; - wg(0, 1) = 1.1; - wg(1, 1) = 1.2; - - // Call the function to be tested - ModuleIO::wfc_nao_write2file(filename, ctot.data(), PARAM.sys.nlocal, 0, ekb, wg, false); - - // Check the output file - std::ifstream ifs(filename); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("2 (number of bands)")); - EXPECT_THAT(str, testing::HasSubstr("2 (number of orbitals)")); - EXPECT_THAT(str, testing::HasSubstr("1 (band)")); - EXPECT_THAT(str, testing::HasSubstr("5.00000000e-01 (Ry)")); - EXPECT_THAT(str, testing::HasSubstr("9.00000000e-01 (Occupations)")); - EXPECT_THAT(str, testing::HasSubstr("1.00000000e-01 2.00000000e-01")); - EXPECT_THAT(str, testing::HasSubstr("2 (band)")); - EXPECT_THAT(str, testing::HasSubstr("7.00000000e-01 (Ry)")); - EXPECT_THAT(str, testing::HasSubstr("1.10000000e+00 (Occupations)")); - EXPECT_THAT(str, testing::HasSubstr("3.00000000e-01 4.00000000e-01")); - ifs.close(); - - // clean up - std::remove(filename.c_str()); // remove the test file - } -} - -TEST(ModuleIOTest, WriteWfcNaoBinary) -{ - if (GlobalV::MY_RANK == 0) - { - // Set up GlobalV - GlobalV::DRANK = 0; - PARAM.input.nbands = 2; - PARAM.sys.nlocal = 2; - - // Set up test data - std::string filename = "test_wfc_nao.dat"; - std::vector ctot = {0.1, 0.2, 0.3, 0.4}; - ModuleBase::matrix ekb(2, 2); - ekb(0, 0) = 0.5; - ekb(1, 0) = 0.6; - ekb(0, 1) = 0.7; - ekb(1, 1) = 0.8; - ModuleBase::matrix wg(2, 2); - wg(0, 0) = 0.9; - wg(1, 0) = 1.0; - wg(0, 1) = 1.1; - wg(1, 1) = 1.2; - - // Call the function to be tested - ModuleIO::wfc_nao_write2file(filename, ctot.data(), PARAM.sys.nlocal, 0, ekb, wg, true); - - // Check the output file - Binstream wfc(filename, "r"); - int nbands, nlocal; - wfc >> nbands; - wfc >> nlocal; - EXPECT_EQ(nbands, 2); - EXPECT_EQ(nlocal, 2); - for (int i = 0; i < nbands; i++) - { - int band_index; - double ekb, wg; - wfc >> band_index; - wfc >> ekb; - wfc >> wg; - EXPECT_EQ(band_index, i + 1); - EXPECT_DOUBLE_EQ(ekb, 0.5 + i * 0.2); - EXPECT_DOUBLE_EQ(wg, 0.9 + i * 0.2); - for (int j = 0; j < nlocal; j++) - { - double ctot; - wfc >> ctot; - EXPECT_DOUBLE_EQ(ctot, 0.1 + i * 0.2 + j * 0.1); - } - } - wfc.close(); - - // clean up - std::remove(filename.c_str()); // remove the test file - } -} - -TEST(ModuleIOTest, WriteWfcNaoComplex) -{ - if (GlobalV::MY_RANK == 0) - { - // Set up GlobalV - PARAM.input.nbands = 2; - PARAM.sys.nlocal = 3; - // set up test data - std::string name = "test_wfc_nao_complex.txt"; - int ik = 0; - ModuleBase::Vector3 kvec_c{0.0, 0.0, 0.0}; - ModuleBase::matrix ekb(1, 2); - ekb(0, 0) = 0.9; - ekb(0, 1) = 1.1; - ModuleBase::matrix wg(1, 2); - wg(0, 0) = 0.11; - wg(0, 1) = 0.22; - std::vector> ctot = {std::complex(1.0, 0.0), - std::complex(2.0, 0.0), - std::complex(3.0, 0.0), - std::complex(0.0, 1.0), - std::complex(0.0, 2.0), - std::complex(0.0, 3.0)}; - - // Call the function - ModuleIO::wfc_nao_write2file_complex(name, ctot.data(), PARAM.sys.nlocal, ik, kvec_c, ekb, wg); - // Check the output file - std::ifstream ifs(name); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("1 (index of k points)")); - EXPECT_THAT(str, testing::HasSubstr("0 0 0")); - EXPECT_THAT(str, testing::HasSubstr("2 (number of bands)")); - EXPECT_THAT(str, testing::HasSubstr("3 (number of orbitals)")); - EXPECT_THAT(str, testing::HasSubstr("1 (band)")); - EXPECT_THAT(str, testing::HasSubstr("(Ry)")); - EXPECT_THAT(str, testing::HasSubstr("(Occupations)")); - EXPECT_THAT(str, testing::HasSubstr("2 (band)")); - // ifs.close(); - // Clean up - std::remove(name.c_str()); - } -} - -TEST(ModuleIOTest, WriteWfcNaoComplexBinary) -{ - if (GlobalV::MY_RANK == 0) - { - // Set up GlobalV - PARAM.input.nbands = 2; - PARAM.sys.nlocal = 3; - // set up test data - std::string name = "test_wfc_nao_complex.dat"; - int ik = 0; - ModuleBase::Vector3 kvec_c{0.0, 0.0, 0.0}; - ModuleBase::matrix ekb(1, 2); - ekb(0, 0) = 0.9; - ekb(0, 1) = 1.1; - ModuleBase::matrix wg(1, 2); - wg(0, 0) = 0.11; - wg(0, 1) = 0.22; - std::vector> ctot = {std::complex(1.0, 0.0), - std::complex(2.0, 2.0), - std::complex(3.0, 4.0), - std::complex(4.0, 4.0), - std::complex(5.0, 6.0), - std::complex(6.0, 8.0)}; - - // Call the function - ModuleIO::wfc_nao_write2file_complex(name, ctot.data(), PARAM.sys.nlocal, ik, kvec_c, ekb, wg, true); - // Check the output file - - Binstream wfc(name, "r"); - int ik1, nbands, nlocal; - double kx, ky, kz; - wfc >> ik1; - wfc >> kx; - wfc >> ky; - wfc >> kz; - wfc >> nbands; - wfc >> nlocal; - EXPECT_EQ(ik1, 1); - EXPECT_DOUBLE_EQ(kx, 0.0); - EXPECT_DOUBLE_EQ(ky, 0.0); - EXPECT_DOUBLE_EQ(kz, 0.0); - EXPECT_EQ(nbands, 2); - EXPECT_EQ(nlocal, 3); - for (int i = 0; i < nbands; i++) - { - int band_index; - double ekb, wg; - wfc >> band_index; - wfc >> ekb; - wfc >> wg; - EXPECT_EQ(band_index, i + 1); - EXPECT_DOUBLE_EQ(ekb, 0.9 + i * 0.2); - EXPECT_DOUBLE_EQ(wg, 0.11 + i * 0.11); - for (int j = 0; j < nlocal; j++) - { - std::complex ctot; - wfc >> ctot; - EXPECT_DOUBLE_EQ(ctot.real(), 1.0 + i * 3.0 + j * 1.0); - EXPECT_DOUBLE_EQ(ctot.imag(), 0.0 + i * 4.0 + j * 2.0); - } - } - wfc.close(); - // Clean up - std::remove(name.c_str()); - } -} - -int main(int argc, char** argv) -{ - GlobalV::MY_RANK = 0; -#ifdef __MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &GlobalV::NPROC); - MPI_Comm_rank(MPI_COMM_WORLD, &GlobalV::MY_RANK); -#endif - - testing::InitGoogleTest(&argc, argv); - int result = RUN_ALL_TESTS(); -#ifdef __MPI - MPI_Finalize(); -#endif - return result; -} diff --git a/source/module_io/test_serial/CMakeLists.txt b/source/module_io/test_serial/CMakeLists.txt deleted file mode 100644 index be54c7bf82..0000000000 --- a/source/module_io/test_serial/CMakeLists.txt +++ /dev/null @@ -1,62 +0,0 @@ -remove_definitions(-D__MLALGO) -remove_definitions(-D__CUDA) -remove_definitions(-D__ROCM) -remove_definitions(-D__MPI) - -add_library( - io_input_serial - OBJECT - ../read_input_item_system.cpp - ../read_input_item_elec_stru.cpp - ../read_input_item_relax.cpp - ../read_input_item_md.cpp - ../read_input_item_ofdft.cpp - ../read_input_item_sdft.cpp - ../read_input_item_tddft.cpp - ../read_input_item_deepks.cpp - ../read_input_item_model.cpp - ../read_input_item_postprocess.cpp - ../read_input_item_exx_dftu.cpp - ../read_input_item_other.cpp - ../read_input_item_output.cpp - ../read_input.cpp - ../read_set_globalv.cpp -) - -install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -AddTest( - TARGET MODULE_IO_read_input_serial - LIBS parameter ${math_libs} io_input_serial - SOURCES read_input_test.cpp - ../../source_base/test/tool_quit_no_exit.cpp - ../../source_base/module_device/device.cpp -) - -AddTest( - TARGET MODULE_IO_read_item_serial - LIBS parameter ${math_libs} base device io_input_serial - SOURCES read_input_item_test.cpp -) - -AddTest( - TARGET MODULE_IO_read_input_tool - SOURCES read_input_tool_test.cpp -) - -AddTest( - TARGET MODULE_IO_rho_io - LIBS parameter ${math_libs} base device cell_info - SOURCES rho_io_test.cpp ../read_cube.cpp ../write_cube.cpp ../output.cpp -) - -AddTest( - TARGET MODULE_IO_nscf_band - LIBS parameter ${math_libs} base device - SOURCES nscf_band_test.cpp ../nscf_band.cpp -) - -AddTest( - TARGET MODULE_IO_system_variable_test - LIBS parameter ${math_libs} base device io_input_serial - SOURCES io_system_variable_test.cpp -) \ No newline at end of file diff --git a/source/module_io/test_serial/io_system_variable_test.cpp b/source/module_io/test_serial/io_system_variable_test.cpp deleted file mode 100644 index 05de7baec1..0000000000 --- a/source/module_io/test_serial/io_system_variable_test.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "source_base/tool_quit.h" -/************************************************ - * unit test of read_input_test_item.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - Item_test: - * - read in specific values for some items - */ -#define private public -#include "module_io/input_item.h" -#include "module_io/read_input.h" -#undef private - -class InputTest : public testing::Test -{ - protected: - std::vector>::iterator find_label( - const std::string& label, - std::vector>& bcastfuncs) - { - auto it = std::find_if( - bcastfuncs.begin(), - bcastfuncs.end(), - [&label](const std::pair& item) { return item.first == label; }); - return it; - } -}; -ModuleIO::ReadInput readinput(0); -Parameter param; -std::string output = ""; - -TEST_F(InputTest, Item_test) -{ - readinput.check_ntype_flag = false; - - { - param.input.suffix = "test"; - readinput.set_global_dir(param.inp, param.sys); - - EXPECT_EQ(param.sys.global_out_dir, "OUT.test/"); - EXPECT_EQ(param.sys.global_stru_dir, "OUT.test/STRU/"); - EXPECT_EQ(param.sys.global_matrix_dir, "OUT.test/matrix/"); - - readinput.set_globalv(param.inp, param.sys); - - param.input.basis_type = "lcao"; - param.input.gamma_only = true; - param.input.esolver_type = "tddft"; - param.input.nspin = 2; - readinput.set_globalv(param.inp, param.sys); - EXPECT_EQ(param.sys.gamma_only_local, 0); - - param.input.deepks_scf = true; - param.input.deepks_out_labels = true; - readinput.set_globalv(param.inp, param.sys); - EXPECT_EQ(param.sys.deepks_setorb, 1); - - param.input.nspin = 4; - param.input.noncolin = true; - readinput.set_globalv(param.inp, param.sys); - EXPECT_EQ(param.sys.domag, 1); - EXPECT_EQ(param.sys.domag_z, 0); - EXPECT_EQ(param.sys.npol, 2); - - param.input.nspin = 1; - param.input.lspinorb = true; - param.input.noncolin = false; - readinput.set_globalv(param.inp, param.sys); - EXPECT_EQ(param.sys.domag, 0); - EXPECT_EQ(param.sys.domag_z, 0); - EXPECT_EQ(param.sys.npol, 1); - - - } -} \ No newline at end of file diff --git a/source/module_io/test_serial/nscf_band_test.cpp b/source/module_io/test_serial/nscf_band_test.cpp deleted file mode 100644 index 71adc5b2a6..0000000000 --- a/source/module_io/test_serial/nscf_band_test.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include "gtest/gtest.h" -#include "gmock/gmock.h" -#include "module_io/nscf_band.h" -#include "source_cell/parallel_kpoints.h" -#include "source_cell/klist.h" - - -/************************************************ - * unit test of nscf_band - ***********************************************/ - -/** - * - Tested Functions: - * - nscf_band() - * - output band structure in nscf calculation - */ - -class BandTest : public ::testing::Test -{ -protected: - void SetUp() override { - // Set up test data - is = 0; - out_band_dir = "test_band.dat"; - nks = 2; - nband = 3; - fermie = 0.0; - ekb.create(nks, nband); - ekb(0,0) = -2.0; - ekb(0,1) = -1.0; - ekb(0,2) = 0.0; - ekb(1,0) = 1.0; - ekb(1,1) = 2.0; - ekb(1,2) = 3.0; - kv = new K_Vectors; - // specify the kpoints - kv->kvec_c.resize(nks); - kv->kvec_c[0] = ModuleBase::Vector3(0.0, 0.0, 0.0); - kv->kvec_c[1] = ModuleBase::Vector3(1.0, 0.0, 0.0); - kv->isk.resize(nks); - kv->isk[0] = 0; - kv->isk[1] = 1; - kv->kl_segids.resize(nks); - kv->kl_segids[0] = 0; - kv->kl_segids[1] = 0; - } - - void TearDown() override { - // Clean up test data - delete kv; - std::remove(out_band_dir.c_str()); - } - - // Test data - int is; - std::string out_band_dir; - int nks; - int nband; - double fermie; - ModuleBase::matrix ekb; - K_Vectors* kv; -}; - -TEST_F(BandTest, nscf_band) -{ - kv->para_k.nks_pool.resize(1); - kv->para_k.nks_pool[0] = nks; - kv->para_k.nkstot_np = nks; - kv->para_k.nks_np = nks; - // Call the function to be tested - ModuleIO::nscf_band(is, out_band_dir, nband, fermie, 8, ekb, *kv); - - // Check the output file - std::ifstream ifs(out_band_dir); - std::string str((std::istreambuf_iterator(ifs)),std::istreambuf_iterator()); - ASSERT_TRUE(ifs.is_open()); - EXPECT_THAT(str, testing::HasSubstr(" 1 0.00000000 -27.21139600 -13.60569800 0.00000000")); - ifs.close(); -} diff --git a/source/module_io/test_serial/prepare_unitcell.h b/source/module_io/test_serial/prepare_unitcell.h deleted file mode 100644 index 0ae5df18d3..0000000000 --- a/source/module_io/test_serial/prepare_unitcell.h +++ /dev/null @@ -1,327 +0,0 @@ -#ifndef PREPARE_UNITCELL_H -#define PREPARE_UNITCELL_H -#include -#include -#include "source_base/mathzone.h" - -class UcellTestPrepare -{ -public: - UcellTestPrepare()=default; - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in); - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in); - UcellTestPrepare(const UcellTestPrepare &utp); - - std::string latname; - int lmaxmax; - bool init_vel; - bool selective_dynamics; - bool relax_new; - std::string fixed_axes; - double lat0; - std::valarray latvec; - std::vector elements; - std::vector pp_files; - std::vector pp_types; - std::vector orb_files; - std::valarray natom; - std::vector atomic_mass; - std::string coor_type; - std::valarray coordinates; - std::valarray mbl; - std::valarray velocity; - // ntype - int ntype; - int atomic_index; - - UnitCell* SetUcellInfo() - { - //basic info - this->ntype = this->elements.size(); - UnitCell* ucell = new UnitCell; - ucell->setup(this->latname, - this->ntype, - this->lmaxmax, - this->init_vel, - this->fixed_axes); - delete[] ucell->magnet.start_mag; //mag set here - ucell->atom_label.resize(ucell->ntype); - ucell->atom_mass.resize(ucell->ntype); - ucell->pseudo_fn.resize(ucell->ntype); - ucell->pseudo_type.resize(ucell->ntype); - - ucell->orbital_fn.resize(ucell->ntype); - ucell->magnet.start_mag = new double[ucell->ntype]; //mag set here - ucell->magnet.ux_[0] = 0.0; // ux_ set here - ucell->magnet.ux_[1] = 0.0; - ucell->magnet.ux_[2] = 0.0; - for(int it=0;itntype;++it) - { - ucell->atom_label[it] = this->elements[it]; - ucell->atom_mass[it] = this->atomic_mass[it]; - ucell->pseudo_fn[it] = this->pp_files[it]; - ucell->pseudo_type[it] = this->pp_types[it]; - ucell->orbital_fn[it] = this->orb_files[it]; - ucell->magnet.start_mag[it] = 0.0; //mag set here - } - //lattice info - ucell->lat0 = this->lat0; - ucell->lat0_angstrom = ucell->lat0 * 0.529177; - ucell->tpiba = ModuleBase::TWO_PI/ucell->lat0; - ucell->tpiba2 = ucell->tpiba * ucell->tpiba; - ucell->latvec.e11 = this->latvec[0]; - ucell->latvec.e12 = this->latvec[1]; - ucell->latvec.e13 = this->latvec[2]; - ucell->latvec.e21 = this->latvec[3]; - ucell->latvec.e22 = this->latvec[4]; - ucell->latvec.e23 = this->latvec[5]; - ucell->latvec.e31 = this->latvec[6]; - ucell->latvec.e32 = this->latvec[7]; - ucell->latvec.e33 = this->latvec[8]; - ucell->a1.x = ucell->latvec.e11; - ucell->a1.y = ucell->latvec.e12; - ucell->a1.z = ucell->latvec.e13; - ucell->a2.x = ucell->latvec.e21; - ucell->a2.y = ucell->latvec.e22; - ucell->a2.z = ucell->latvec.e23; - ucell->a3.x = ucell->latvec.e31; - ucell->a3.y = ucell->latvec.e32; - ucell->a3.z = ucell->latvec.e33; - ucell->GT = ucell->latvec.Inverse(); - ucell->G = ucell->GT.Transpose(); - ucell->GGT = ucell->G*ucell->GT; - ucell->invGGT = ucell->GGT.Inverse(); - ucell->omega = std::abs(ucell->latvec.Det())*(ucell->lat0)*(ucell->lat0)*(ucell->lat0); - //atomic info - ucell->Coordinate = this->coor_type; - ucell->atoms = new Atom[ucell->ntype]; - ucell->set_atom_flag = true; - this->atomic_index = 0; - for(int it=0;itntype;++it) - { - ucell->atoms[it].label = this->elements[it]; - ucell->atoms[it].nw = 0; - ucell->atoms[it].nwl = 2; - ucell->atoms[it].l_nchi.resize(ucell->atoms[it].nwl+1); - for(int L=0; Latoms[it].nwl+1; L++) - { - ucell->atoms[it].l_nchi[L] = 1; - ucell->atoms[it].nw += (2*L + 1) * ucell->atoms[it].l_nchi[L]; - } - ucell->atoms[it].na = this->natom[it]; - //coordinates and related physical quantities - ucell->atoms[it].tau.resize(ucell->atoms[it].na); - ucell->atoms[it].dis.resize(ucell->atoms[it].na); - ucell->atoms[it].taud.resize(ucell->atoms[it].na); - ucell->atoms[it].vel.resize(ucell->atoms[it].na); - ucell->atoms[it].mag.resize(ucell->atoms[it].na); - ucell->atoms[it].angle1.resize(ucell->atoms[it].na); - ucell->atoms[it].angle2.resize(ucell->atoms[it].na); - ucell->atoms[it].m_loc_.resize(ucell->atoms[it].na); - ucell->atoms[it].mbl.resize(ucell->atoms[it].na); - ucell->atoms[it].mass = ucell->atom_mass[it]; // mass set here - for(int ia=0; iaatoms[it].na; ++ia) - { - if (ucell->Coordinate == "Direct") - { - ucell->atoms[it].taud[ia].x = this->coordinates[this->atomic_index*3+0]; - ucell->atoms[it].taud[ia].y = this->coordinates[this->atomic_index*3+1]; - ucell->atoms[it].taud[ia].z = this->coordinates[this->atomic_index*3+2]; - ucell->atoms[it].tau[ia] = ucell->atoms[it].taud[ia]*ucell->latvec; - } - else if (ucell->Coordinate == "Cartesian") - { - ucell->atoms[it].tau[ia].x = this->coordinates[this->atomic_index*3+0]; - ucell->atoms[it].tau[ia].y = this->coordinates[this->atomic_index*3+1]; - ucell->atoms[it].tau[ia].z = this->coordinates[this->atomic_index*3+2]; - ModuleBase::Mathzone::Cartesian_to_Direct( - ucell->atoms[it].tau[ia].x, ucell->atoms[it].tau[ia].y, ucell->atoms[it].tau[ia].z, - ucell->latvec.e11, ucell->latvec.e12, ucell->latvec.e13, - ucell->latvec.e21, ucell->latvec.e22, ucell->latvec.e23, - ucell->latvec.e31, ucell->latvec.e32, ucell->latvec.e33, - ucell->atoms[it].taud[ia].x, ucell->atoms[it].taud[ia].y, ucell->atoms[it].taud[ia].z); - } - ucell->atoms[it].dis[ia].set(0, 0, 0); - if(this->init_vel) - { - ucell->atoms[it].vel[ia].x = this->velocity[this->atomic_index*3+0]; - ucell->atoms[it].vel[ia].y = this->velocity[this->atomic_index*3+1]; - ucell->atoms[it].vel[ia].z = this->velocity[this->atomic_index*3+2]; - } - else - { - ucell->atoms[it].vel[ia].set(0,0,0); - } - ucell->atoms[it].m_loc_[ia].set(0,0,0); - ucell->atoms[it].angle1[ia] = 0; - ucell->atoms[it].angle2[ia] = 0; - if(this->selective_dynamics) - { - ucell->atoms[it].mbl[ia].x = this->mbl[this->atomic_index*3+0]; - ucell->atoms[it].mbl[ia].y = this->mbl[this->atomic_index*3+1]; - ucell->atoms[it].mbl[ia].z = this->mbl[this->atomic_index*3+2]; - } - else - { - ucell->atoms[it].mbl[ia] = {1,1,1}; - } - ++(this->atomic_index); - } - } - ucell->nat = this->natom.sum(); - return ucell; - } -}; - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in) -{ - mbl = std::valarray(0.0, coordinates_in.size()); - velocity = std::valarray(0.0, coordinates_in.size()); -} - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in), - mbl(mbl_in), - velocity(velocity_in) // velocity assume the existence of mbl in print_stru_file() -{} - -UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): - latname(utp.latname), - lmaxmax(utp.lmaxmax), - init_vel(utp.init_vel), - selective_dynamics(utp.selective_dynamics), - relax_new(utp.relax_new), - fixed_axes(utp.fixed_axes), - lat0(utp.lat0), - latvec(utp.latvec), - elements(utp.elements), - pp_files(utp.pp_files), - pp_types(utp.pp_types), - orb_files(utp.orb_files), - natom(utp.natom), - atomic_mass(utp.atomic_mass), - coor_type(utp.coor_type), - coordinates(utp.coordinates), - mbl(utp.mbl), - velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() -{} - -std::map UcellTestLib -{ - {"Si", UcellTestPrepare( - "fcc", //latname - 2, //lmaxmax - true, //init_vel - true, //selective_dyanmics - true, //relax_new - "volume", //fixed_axes - 10.2, //lat0 - {-0.5,0.0,0.5, //latvec - 0.0,0.5,0.5, - -0.5,0.5,0.0}, - {"Si"}, //elements - {"Si.upf"}, //upf file - {"upf201"}, //upf types - {"Si.orb"}, //orb file - {2}, //number of each elements - {28.0}, //atomic mass - "Cartesian", //coordination type - {0.0,0.0,0.0, //atomic coordinates - 0.25,0.25,0.25})} -}; -#endif diff --git a/source/module_io/test_serial/read_input_item_test.cpp b/source/module_io/test_serial/read_input_item_test.cpp deleted file mode 100644 index b54b1d9602..0000000000 --- a/source/module_io/test_serial/read_input_item_test.cpp +++ /dev/null @@ -1,1789 +0,0 @@ -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "source_base/tool_quit.h" -/************************************************ - * unit test of read_input_test_item.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - Item_test: - * - read in specific values for some items - */ -#define private public -#include "module_io/input_item.h" -#include "module_io/read_input.h" -#undef private - -class InputTest : public testing::Test -{ - protected: - std::vector>::iterator find_label( - const std::string& label, - std::vector>& input_lists) - { - auto it = std::find_if( - input_lists.begin(), - input_lists.end(), - [&label](const std::pair& item) { return item.first == label; }); - return it; - } -}; - -TEST_F(InputTest, Item_test) -{ - ModuleIO::ReadInput readinput(0); - readinput.check_ntype_flag = false; - Parameter param; - - std::string output = ""; - - { // calculation - auto it = find_label("calculation", readinput.input_lists); - param.input.calculation = "get_pchg"; - param.input.basis_type = "pw"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.calculation = "gen_bessel"; - param.input.basis_type = "lcao"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.calculation = "none"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - - { // esolver_type - auto it = find_label("esolver_type", readinput.input_lists); - param.input.esolver_type = "none"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.esolver_type = "dp"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.esolver_type = "lr"; - param.input.calculation = "scf"; - it = find_label("esolver_type", readinput.input_lists); - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.calculation, "nscf"); - } - { // nspin - auto it = find_label("nspin", readinput.input_lists); - param.input.nspin = 0; - param.input.noncolin = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nspin, 4); - - param.input.nspin = 3; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // smearing_method - auto it = find_label("smearing_method", readinput.input_lists); - param.input.smearing_method = "fix"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // kspacing - auto it = find_label("kspacing", readinput.input_lists); - it->second.str_values = {"1"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.kspacing[0], 1); - EXPECT_EQ(param.input.kspacing[1], 1); - EXPECT_EQ(param.input.kspacing[2], 1); - it->second.str_values = {"1", "2"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.kspacing = {0, -1, 1}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.kspacing = {0, 1, 2}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // nbands - auto it = find_label("nbands", readinput.input_lists); - param.input.nbands = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // symmetry - auto it = find_label("symmetry", readinput.input_lists); - param.input.symmetry = "default"; - param.input.gamma_only = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.symmetry, "0"); - - param.input.symmetry = "default"; - param.input.gamma_only = false; - param.input.calculation = "none"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.symmetry, "1"); - - param.input.calculation = "md"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.symmetry, "0"); - - param.input.symmetry = "default"; - param.input.efield_flag = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.symmetry, "0"); - - param.input.qo_switch = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.symmetry, "-1"); - - param.input.symmetry = "default"; - param.input.berry_phase = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.symmetry, "-1"); - } - { // nelec - auto it = find_label("nelec", readinput.input_lists); - param.input.nelec = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.nelec = 100; - param.input.nbands = 5; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bndpar - auto it = find_label("bndpar", readinput.input_lists); - param.input.esolver_type = "ksdft"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.bndpar, 1); - - param.input.esolver_type = "sdft"; - param.input.bndpar = 2; - GlobalV::NPROC = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.bndpar, 1); - } - { // dft_plus_dmft - auto it = find_label("dft_plus_dmft", readinput.input_lists); - param.input.basis_type = "pw"; - param.input.dft_plus_dmft = true; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // mem_saver - auto it = find_label("mem_saver", readinput.input_lists); - param.input.mem_saver = 1; - param.input.calculation = "scf"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mem_saver, 0); - - param.input.mem_saver = 1; - param.input.calculation = "relax"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mem_saver, 0); - } - { // diag_proc - auto it = find_label("diago_proc", readinput.input_lists); - param.input.diago_proc = 0; - GlobalV::NPROC = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.diago_proc, 1); - } - { // cal_force - auto it = find_label("cal_force", readinput.input_lists); - param.input.calculation = "cell-relax"; - param.input.cal_force = false; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.cal_force, true); - - param.input.calculation = "get_wf"; - param.input.cal_force = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.cal_force, false); - } - { // ecutrho - auto it = find_label("ecutrho", readinput.input_lists); - param.input.ecutwfc = 1; - param.input.ecutrho = 0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.ecutrho, 4); - param.input.nx = 0; - param.input.ecutrho = 5; - param.input.ecutwfc = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.sys.double_grid, true); - - param.input.ecutwfc = 1; - param.input.ecutrho = 1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // pw_diag_thr - auto it = find_label("pw_diag_thr", readinput.input_lists); - param.input.pw_diag_thr = 1.0e-2; - param.input.calculation = "get_s"; - param.input.basis_type = "pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.pw_diag_thr, 1.0e-5); - } - { // nb2d - auto it = find_label("nb2d", readinput.input_lists); - param.input.nb2d = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // scf_thr - auto it = find_label("scf_thr", readinput.input_lists); - param.input.scf_thr = -1; - param.input.basis_type = "lcao"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.scf_thr, 1.0e-7); - - param.input.scf_thr = -1; - param.input.basis_type = "pw"; - param.input.calculation = "nscf"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.scf_thr, 1.0e-6); - - param.input.scf_thr = -1; - param.input.basis_type = "pw"; - param.input.calculation = "scf"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.scf_thr, 1.0e-9); - } - { // scf_thr_type - auto it = find_label("scf_thr_type", readinput.input_lists); - param.input.scf_thr_type = -1; - param.input.basis_type = "lcao"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.scf_thr_type, 2); - - param.input.scf_thr_type = -1; - param.input.basis_type = "pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.scf_thr_type, 1); - } - { // init_wfc - auto it = find_label("init_wfc", readinput.input_lists); - param.input.init_wfc = "atomic"; - param.input.calculation = "get_pchg"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.init_wfc, "file"); - - param.input.init_wfc = "atomic"; - param.input.basis_type = "lcao_in_pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.init_wfc, "nao"); - } - { // init_chg - auto it = find_label("init_chg", readinput.input_lists); - param.input.init_chg = "get_pchg"; - param.input.init_chg = ""; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.init_chg, "atomic"); - - param.input.init_chg = ""; - param.input.calculation = "nscf"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.init_chg, "file"); - - param.input.init_chg = "none"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // chg_extrap - auto it = find_label("chg_extrap", readinput.input_lists); - param.input.chg_extrap = "default"; - param.input.calculation = "md"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.chg_extrap, "second-order"); - - param.input.chg_extrap = "default"; - param.input.calculation = "relax"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.chg_extrap, "first-order"); - - param.input.chg_extrap = "default"; - param.input.calculation = "none"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.chg_extrap, "atomic"); - - param.input.chg_extrap = "none"; - param.input.calculation = "get_wf"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.chg_extrap, "atomic"); - } - { // out_chg - auto it = find_label("out_chg", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_chg = {0}; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_chg[0], 1); - } - { // out_pot - auto it = find_label("out_pot", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_pot = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_pot, 0); - } - { // out_dos - auto it = find_label("out_dos", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_dos = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_dos, 0); - - param.input.out_dos = 3; - param.input.symmetry = "1"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.basis_type = "pw"; - param.input.out_dos = 3; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // out_ldos - auto it = find_label("out_ldos", readinput.input_lists); - it->second.str_values = {"1"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.out_ldos[0], 1); - EXPECT_EQ(param.input.out_ldos[1], 3); - - it->second.str_values = {"2", "2"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.out_ldos[0], 2); - EXPECT_EQ(param.input.out_ldos[1], 2); - - it->second.str_values = {"1", "2", "3"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.out_ldos = {5, 5}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // stm_bias - auto it = find_label("stm_bias", readinput.input_lists); - it->second.str_values = {"2"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.stm_bias[0], 2); - EXPECT_EQ(param.input.stm_bias[1], 0.1); - EXPECT_EQ(param.input.stm_bias[2], 1); - - it->second.str_values = {"3", "0.2", "5"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.stm_bias[0], 3); - EXPECT_EQ(param.input.stm_bias[1], 0.2); - EXPECT_EQ(param.input.stm_bias[2], 5); - - it->second.str_values = {"1", "2"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.stm_bias = {1.0, 0.1, 0.0}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.stm_bias = {1.0, 0.0, 2.0}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // ldos_line - auto it = find_label("ldos_line", readinput.input_lists); - it->second.str_values = {"1", "2", "3", "4", "5", "6"}; - it->second.read_value(it->second, param); - for (int i = 0; i < 6; ++i) - { - EXPECT_EQ(param.input.ldos_line[i], i + 1); - } - EXPECT_EQ(param.input.ldos_line[6], 100); - - it->second.str_values = {"2", "3", "4", "5", "6", "7", "200"}; - it->second.read_value(it->second, param); - for (int i = 0; i < 6; ++i) - { - EXPECT_EQ(param.input.ldos_line[i], i + 2); - } - EXPECT_EQ(param.input.ldos_line[6], 200); - - it->second.str_values = {"1", "2", "3", "4", "5", "6", "7", "8"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ldos_line = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 0}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // out_band - auto it = find_label("out_band", readinput.input_lists); - it->second.str_values = {"1"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.out_band[0], 1); - EXPECT_EQ(param.input.out_band[1], 8); - - it->second.str_values = {"1", "2"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.out_band[0], 1); - EXPECT_EQ(param.input.out_band[1], 2); - - it->second.str_values = {"1", "2", "3"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.calculation = "get_wf"; - param.input.out_band = {1, 2}; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_band[0], 0); - } - { // out_proj_band - auto it = find_label("out_proj_band", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_proj_band = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_proj_band, false); - - param.input.basis_type = "pw"; - param.input.out_proj_band = true; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // read_file_dir - auto it = find_label("read_file_dir", readinput.input_lists); - param.input.read_file_dir = "auto"; - param.input.suffix = "test"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.read_file_dir, "OUT.test/"); - - param.input.read_file_dir = "test"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.read_file_dir, "test/"); - } - { // nx - auto it = find_label("nx", readinput.input_lists); - param.input.nx = 1; - param.input.ny = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // ny - auto it = find_label("ny", readinput.input_lists); - param.input.ny = 1; - param.input.nz = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // nz - auto it = find_label("nz", readinput.input_lists); - param.input.nz = 1; - param.input.nx = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // ndx - auto it = find_label("ndx", readinput.input_lists); - param.input.ndx = 2; - param.input.nx = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.sys.double_grid, true); - - param.input.ndx = 1; - param.input.ndy = 0; - it->second.str_values = {"1"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ndx = 1; - param.input.nx = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // ndy - auto it = find_label("ndy", readinput.input_lists); - param.input.ndy = 2; - param.input.ny = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.sys.double_grid, true); - - param.input.ndy = 1; - param.input.ndz = 0; - it->second.str_values = {"1"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ndy = 1; - param.input.ny = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // ndz - auto it = find_label("ndz", readinput.input_lists); - param.input.ndz = 2; - param.input.nz = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.sys.double_grid, true); - - param.input.ndz = 1; - param.input.nz = 2; - it->second.str_values = {"1"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ndz = 1; - param.input.nz = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // cell_factor - auto it = find_label("cell_factor", readinput.input_lists); - param.input.calculation = "cell-relax"; - param.input.cell_factor = 1.0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.cell_factor, 2.0); - } - { // ks_sovler - auto it = find_label("ks_solver", readinput.input_lists); - param.input.ks_solver = "default"; - param.input.basis_type = "pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.ks_solver, "cg"); - - param.input.ks_solver = "default"; - param.input.basis_type = "lcao"; - param.input.device = "gpu"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.ks_solver, "cusolver"); -#ifdef __ELPA - param.input.towannier90 = true; - param.input.basis_type = "lcao_in_pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.ks_solver, "genelpa"); -#else -#ifdef __MPI - param.input.towannier90 = true; - param.input.basis_type = "lcao_in_pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.ks_solver, "scalapack_gvx"); -#else - param.input.towannier90 = true; - param.input.basis_type = "lcao_in_pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.ks_solver, "lapack"); -#endif -#endif - param.input.ks_solver = "default"; - param.input.basis_type = "lcao"; - param.input.device = "cpu"; - param.input.ks_solver = "lapack"; - - param.input.ks_solver = "genelpa"; - param.input.basis_type = "pw"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ks_solver = "cg"; - param.input.basis_type = "lcao"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ks_solver = "scalapack_gvx"; - param.input.basis_type = "lcao"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ks_solver = "cg"; - param.input.basis_type = "lcao_in_pw"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // relax_nmax - auto it = find_label("relax_nmax", readinput.input_lists); - param.input.calculation = "scf"; - param.input.relax_nmax = 5; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.relax_nmax, 1); - - param.input.relax_nmax = 0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.relax_nmax, 0); - - param.input.calculation = "relax"; - param.input.relax_nmax = 0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.relax_nmax, 0); - - param.input.relax_nmax = -1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.relax_nmax, 50); - } - { // out_stru - auto it = find_label("out_stru", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_stru = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_stru, false); - } - { // cal_stress - auto it = find_label("cal_stress", readinput.input_lists); - param.input.calculation = "md"; - param.input.cal_stress = false; - param.input.esolver_type = "lj"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.cal_stress, true); - } - { // fixed_axes - auto it = find_label("fixed_axes", readinput.input_lists); - param.input.fixed_axes = "shape"; - param.input.relax_new = false; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.fixed_axes = "volume"; - param.input.relax_new = false; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // fixed_ibrav - auto it = find_label("fixed_ibrav", readinput.input_lists); - param.input.fixed_ibrav = true; - param.input.relax_new = false; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.fixed_ibrav = true; - param.input.latname = "none"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // fixed_atoms - auto it = find_label("fixed_atoms", readinput.input_lists); - param.input.fixed_atoms = true; - param.input.calculation = "relax"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // relax_method - auto it = find_label("relax_method", readinput.input_lists); - param.input.relax_method = "none"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { //relax_new - auto it = find_label("relax_new", readinput.input_lists); - param.input.relax_new = true; - param.input.relax_method = "cg"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.relax_new, true); - - param.input.relax_new = true; - param.input.relax_method = "none"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.relax_new, false); - } - { // force_thr - auto it = find_label("force_thr", readinput.input_lists); - param.input.force_thr = -1; - param.input.force_thr_ev = -1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.force_thr, 1.0e-3); - EXPECT_EQ(param.input.force_thr_ev, 1.0e-3 * 13.6058 / 0.529177); - - param.input.force_thr = -1; - param.input.force_thr_ev = 1.0e-3 * 13.6058 / 0.529177; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.force_thr, 1.0e-3); - - param.input.force_thr = 1.0e-3; - param.input.force_thr_ev = 1.0e-3 * 13.6058 / 0.529177; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.force_thr, 1.0e-3); - EXPECT_EQ(param.input.force_thr_ev, 1.0e-3 * 13.6058 / 0.529177); - } - { // out_level - auto it = find_label("out_level", readinput.input_lists); - param.input.out_level = "0"; - param.input.calculation = "md"; - param.sys.out_md_control = false; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_level, "m"); - } - { // out_dmk - auto it = find_label("out_dmk", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_dmk = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_dmk, false); - } - { // out_dmr - auto it = find_label("out_dmr", readinput.input_lists); - param.input.calculation = "get_wf"; - param.input.out_dmr = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_dmr, false); - - param.sys.gamma_only_local = true; - param.input.out_dmr = true; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // method_sto - auto it = find_label("method_sto", readinput.input_lists); - param.input.method_sto = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // nbands_sto - auto it = find_label("nbands_sto", readinput.input_lists); - param.input.esolver_type = "sdft"; - - it->second.str_values = {"all"}; - it->second.read_value(it->second, param); - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nbands_sto, 0); - EXPECT_EQ(param.input.esolver_type, "sdft"); - - it->second.str_values = {"8"}; - it->second.read_value(it->second, param); - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nbands_sto, 8); - EXPECT_EQ(param.input.esolver_type, "sdft"); - - it->second.str_values = {"0"}; - it->second.read_value(it->second, param); - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nbands_sto, 0); - EXPECT_EQ(param.input.esolver_type, "ksdft"); - - param.input.nbands_sto = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - it->second.str_values = {"all"}; - it->second.get_final_value(it->second, param); - EXPECT_EQ(it->second.final_value.str(), "all"); - it->second.final_value.str(""); - - it->second.str_values = {}; - param.input.nbands_sto = 256; - it->second.get_final_value(it->second, param); - EXPECT_EQ(it->second.final_value.str(), "256"); - } - { // basis_type - auto it = find_label("basis_type", readinput.input_lists); - param.input.basis_type = "lcao_in_pw"; - param.input.towannier90 = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.basis_type, "lcao"); - - param.input.basis_type = "gauss"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // gamma_only - auto it = find_label("gamma_only", readinput.input_lists); - param.input.basis_type = "pw"; - param.input.gamma_only = true; - std::string filename = param.input.kpoint_file; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.gamma_only, false); - std::ifstream ifs(filename); - std::string line; - std::getline(ifs, line); - ifs.close(); - EXPECT_EQ(line, "K_POINTS"); - - param.input.basis_type = "lcao"; - param.input.gamma_only = true; - param.input.nspin = 4; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.reset_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - } - { // out_mat_r - auto it = find_label("out_mat_r", readinput.input_lists); - param.input.esolver_type = "lcao"; - param.input.out_mat_r = true; - param.sys.gamma_only_local = true; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("available")); - } - { // lcao_ecut - auto it = find_label("lcao_ecut", readinput.input_lists); - param.input.lcao_ecut = 0; - param.input.ecutwfc = 1; - param.input.basis_type = "lcao"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.lcao_ecut, 1); - } - { // out_mat_hs - auto it = find_label("out_mat_hs", readinput.input_lists); - it->second.str_values = {"1"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.out_mat_hs[0], 1); - EXPECT_EQ(param.input.out_mat_hs[1], 8); - - it->second.str_values = {"1", "2"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.out_mat_hs[0], 1); - EXPECT_EQ(param.input.out_mat_hs[1], 2); - - it->second.str_values = {"1", "2", "3"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.out_mat_hs = {0}; - param.input.qo_switch = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_mat_hs[0], 1); - } -} -TEST_F(InputTest, Item_test2) -{ - ModuleIO::ReadInput readinput(0); - readinput.check_ntype_flag = false; - Parameter param; - - std::string output = ""; - { // out_mat_dh - auto it = find_label("out_mat_dh", readinput.input_lists); - param.input.out_mat_dh = true; - param.input.nspin = 4; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // out_interval - auto it = find_label("out_interval", readinput.input_lists); - param.input.out_interval = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // dm_to_rho - auto it = find_label("dm_to_rho", readinput.input_lists); - param.input.dm_to_rho = true; - GlobalV::NPROC = 2; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.dm_to_rho = true; - param.input.gamma_only = true; - GlobalV::NPROC = 1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - -#ifndef __USECNPY - param.input.dm_to_rho = true; - GlobalV::NPROC = 1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); -#endif - } - { // out_wfc_lcao - auto it = find_label("out_wfc_lcao", readinput.input_lists); - param.input.out_wfc_lcao = false; - param.input.qo_switch = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.out_wfc_lcao, true); - - param.input.out_wfc_lcao = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.out_wfc_lcao = 1; - param.input.basis_type = "pw"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bx - auto it = find_label("bx", readinput.input_lists); - param.input.bx = 11; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.bx = 2; - param.input.basis_type = "pw"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.bx, 1); - EXPECT_EQ(param.input.by, 1); - EXPECT_EQ(param.input.bz, 1); - } - { // by - auto it = find_label("by", readinput.input_lists); - param.input.by = 11; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bz - auto it = find_label("bz", readinput.input_lists); - param.input.bz = 11; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // mixing_beta - auto it = find_label("mixing_beta", readinput.input_lists); - param.input.mixing_beta = -1; - param.input.nspin = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mixing_beta, 0.8); - - param.input.mixing_beta = -1; - param.input.nspin = 2; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mixing_beta, 0.4); - EXPECT_EQ(param.input.mixing_beta_mag, 1.6); - EXPECT_EQ(param.input.mixing_gg0_mag, 0.0); - - param.input.mixing_beta = -1; - param.input.nspin = 4; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mixing_beta, 0.4); - EXPECT_EQ(param.input.mixing_beta_mag, 1.6); - EXPECT_EQ(param.input.mixing_gg0_mag, 0.0); - } - { // mixing_beta_mag - auto it = find_label("mixing_beta_mag", readinput.input_lists); - param.input.mixing_beta = 0.3; - param.input.mixing_beta_mag = -1; - param.input.nspin = 2; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mixing_beta_mag, 1.2); - - param.input.mixing_beta = 0.5; - param.input.mixing_beta_mag = -1; - param.input.nspin = 2; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mixing_beta_mag, 1.6); - } - { // dip_cor_flag - auto it = find_label("dip_cor_flag", readinput.input_lists); - param.input.dip_cor_flag = true; - param.input.efield_flag = false; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // efield_dir - auto it = find_label("efield_dir", readinput.input_lists); - param.input.gate_flag = true; - param.input.efield_flag = true; - param.input.dip_cor_flag = false; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_s6 - auto it = find_label("vdw_s6", readinput.input_lists); - param.input.vdw_s6 = "default"; - param.input.vdw_method = "d2"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.vdw_s6, "0.75"); - - // dftd3 parameter will not get its value here - param.input.vdw_s6 = "default"; - param.input.vdw_method = "d3_0"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_s6, "1.0"); - EXPECT_EQ(param.input.vdw_s6, "default"); - } - { // vdw_s8 - auto it = find_label("vdw_s8", readinput.input_lists); - param.input.vdw_s8 = "default"; - param.input.vdw_method = "d3_0"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_s8, "0.722"); - EXPECT_EQ(param.input.vdw_s8, "default"); - - param.input.vdw_s8 = "default"; - param.input.vdw_method = "d3_bj"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_s8, "0.7875"); - EXPECT_EQ(param.input.vdw_s8, "default"); - } - { // vdw_a1 - auto it = find_label("vdw_a1", readinput.input_lists); - param.input.vdw_a1 = "default"; - param.input.vdw_method = "d3_0"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_a1, "1.217"); - EXPECT_EQ(param.input.vdw_a1, "default"); - - param.input.vdw_a1 = "default"; - param.input.vdw_method = "d3_bj"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_a1, "0.4289"); - EXPECT_EQ(param.input.vdw_a1, "default"); - } - { // vdw_a2 - auto it = find_label("vdw_a2", readinput.input_lists); - param.input.vdw_a2 = "default"; - param.input.vdw_method = "d3_0"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_a2, "1.0"); - EXPECT_EQ(param.input.vdw_a2, "default"); - - param.input.vdw_a2 = "default"; - param.input.vdw_method = "d3_bj"; - it->second.reset_value(it->second, param); - // EXPECT_EQ(param.input.vdw_a2, "4.4407"); - EXPECT_EQ(param.input.vdw_a2, "default"); - } - { // vdw_c6_unit - auto it = find_label("vdw_c6_unit", readinput.input_lists); - param.input.vdw_C6_unit = "test"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_r0_unit - auto it = find_label("vdw_r0_unit", readinput.input_lists); - param.input.vdw_R0_unit = "test"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_cutoff_type - auto it = find_label("vdw_cutoff_type", readinput.input_lists); - param.input.vdw_cutoff_type = "test"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_cutoff_radius - auto it = find_label("vdw_cutoff_radius", readinput.input_lists); - param.input.vdw_cutoff_radius = "default"; - param.input.vdw_method = "d2"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.vdw_cutoff_radius, "56.6918"); - - param.input.vdw_cutoff_radius = "default"; - param.input.vdw_method = "d3_0"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.vdw_cutoff_radius, "95"); - - param.input.vdw_cutoff_radius = "default"; - param.input.vdw_method = "d3_bj"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.vdw_cutoff_radius, "95"); - - param.input.vdw_cutoff_radius = "default"; - param.input.vdw_method = "none"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.vdw_cutoff_radius, "0"); - - param.input.vdw_cutoff_radius = "-1"; - param.input.vdw_method = "d2"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_radius_unit - auto it = find_label("vdw_radius_unit", readinput.input_lists); - param.input.vdw_radius_unit = "test"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_cn_thr - auto it = find_label("vdw_cn_thr", readinput.input_lists); - param.input.vdw_cn_thr = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_cn_thr_unit - auto it = find_label("vdw_cn_thr_unit", readinput.input_lists); - param.input.vdw_cn_thr_unit = "test"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // vdw_cutoff_period - auto it = find_label("vdw_cutoff_period", readinput.input_lists); - it->second.str_values = {"1", "1", "1"}; - it->second.read_value(it->second, param); - EXPECT_EQ(param.input.vdw_cutoff_period[0], 1); - EXPECT_EQ(param.input.vdw_cutoff_period[1], 1); - EXPECT_EQ(param.input.vdw_cutoff_period[2], 1); - - it->second.str_values = {"1", "1"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.read_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.vdw_cutoff_period = {-1, 1, 1}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // exx_fock_alpha - auto it = find_label("exx_fock_alpha", readinput.input_lists); - param.input.exx_fock_alpha[0] = "default"; - param.input.dft_functional = "HF"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_fock_alpha[0], "1"); - - param.input.exx_fock_alpha[0] = "default"; - param.input.dft_functional = "PBE0"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_fock_alpha[0], "0.25"); - - param.input.exx_fock_alpha[0] = "default"; - param.input.dft_functional = "SCAN0"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_fock_alpha[0], "0.25"); - } - { // exx_erfc_alpha - auto it = find_label("exx_erfc_alpha", readinput.input_lists); - param.input.exx_erfc_alpha[0] = "default"; - param.input.dft_functional = "HSE"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_erfc_alpha[0], "0.25"); - } - { // exx_hybrid_step - auto it = find_label("exx_hybrid_step", readinput.input_lists); - param.input.exx_hybrid_step = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // exx_real_number - auto it = find_label("exx_real_number", readinput.input_lists); - param.input.exx_real_number = "default"; - param.input.gamma_only = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_real_number, "1"); - - param.input.exx_real_number = "default"; - param.input.gamma_only = false; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_real_number, "0"); - } - { // exx_ccp_rmesh_times - auto it = find_label("exx_ccp_rmesh_times", readinput.input_lists); - param.input.exx_ccp_rmesh_times = "default"; - param.input.dft_functional = "HF"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_ccp_rmesh_times, "5"); - - param.input.exx_ccp_rmesh_times = "default"; - param.input.dft_functional = "PBE0"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_ccp_rmesh_times, "5"); - - param.input.exx_ccp_rmesh_times = "default"; - param.input.dft_functional = "SCAN0"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_ccp_rmesh_times, "5"); - - param.input.exx_ccp_rmesh_times = "default"; - param.input.dft_functional = "HSE"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_ccp_rmesh_times, "1.5"); - - param.input.exx_ccp_rmesh_times = "default"; - param.input.dft_functional = "none"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_ccp_rmesh_times, "1"); - - param.input.exx_ccp_rmesh_times = "0"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // exx_opt_orb_lmax - auto it = find_label("exx_opt_orb_lmax", readinput.input_lists); - param.input.exx_opt_orb_lmax = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // exx_opt_orb_ecut - auto it = find_label("exx_opt_orb_ecut", readinput.input_lists); - param.input.exx_opt_orb_ecut = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // exx_opt_orb_tolerence - auto it = find_label("exx_opt_orb_tolerence", readinput.input_lists); - param.input.exx_opt_orb_tolerence = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // exx_symmetry_realspace - auto it = find_label("exx_symmetry_realspace", readinput.input_lists); - param.input.exx_symmetry_realspace = true; - param.input.symmetry="0"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.exx_symmetry_realspace, false); - } - { // rpa_ccp_rmesh_times - auto it = find_label("rpa_ccp_rmesh_times", readinput.input_lists); - param.input.rpa_ccp_rmesh_times = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // berry_phase - auto it = find_label("berry_phase", readinput.input_lists); - param.input.berry_phase = true; - param.input.basis_type = "pw"; - param.input.calculation = "nscf"; - param.input.gdir = 1; - - param.input.gdir = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.calculation = "scf"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.basis_type = "lcao_in_pw"; - param.input.calculation = "nscf"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - } - { // towannier90 - auto it = find_label("towannier90", readinput.input_lists); - param.input.towannier90 = true; - param.input.calculation = "nscf"; - param.input.nspin = 2; - param.input.wannier_spin = "none"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("towannier90")); - - param.input.towannier90 = true; - param.input.calculation = "scf"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("towannier90")); - } - { // wannier_method - auto it = find_label("wannier_method", readinput.input_lists); - param.input.towannier90 = true; - param.input.basis_type = "lcao_in_pw"; - param.input.wannier_method = 0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.wannier_method, 1); - } - { // of_hold_rho0 - auto it = find_label("of_hold_rho0", readinput.input_lists); - param.input.of_wt_rho0 = 1; - param.input.of_hold_rho0 = false; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.of_hold_rho0, true); - } - { // of_full_pw_dim - auto it = find_label("of_full_pw_dim", readinput.input_lists); - param.input.of_full_pw = false; - param.input.of_full_pw_dim = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.of_full_pw_dim, 0); - } - { // of_read_kernel - auto it = find_label("of_read_kernel", readinput.input_lists); - param.input.of_read_kernel = true; - param.input.of_kinetic = "none"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.of_read_kernel, false); - } - { // dft_plus_u - auto it = find_label("dft_plus_u", readinput.input_lists); - param.input.dft_plus_u = 1; - param.input.orbital_corr = {-1, -1}; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.dft_plus_u, 0); - } - { // uramping - auto it = find_label("uramping", readinput.input_lists); - param.sys.uramping = 1; - param.input.orbital_corr = {-1, -1}; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.sys.uramping, 0); - } - { // onsite_radius - auto it = find_label("onsite_radius", readinput.input_lists); - param.input.onsite_radius = 0.0; - param.input.dft_plus_u = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.onsite_radius, 3.0); - } - { // hubbard_u - auto it = find_label("hubbard_u", readinput.input_lists); - param.input.ntype = 2; - it->second.str_values = {"1.0", "2.0"}; - param.sys.hubbard_u = {1.0, 2.0}; - it->second.check_value(it->second, param); - param.input.ntype = 3; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ntype = 2; - param.sys.hubbard_u = {1.0, -1.0}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // orbital_corr - auto it = find_label("orbital_corr", readinput.input_lists); - param.input.ntype = 2; - it->second.str_values = {"1", "2"}; - param.input.orbital_corr = {1, 2}; - it->second.check_value(it->second, param); - param.input.ntype = 3; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.ntype = 2; - param.input.orbital_corr = {1, 4}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bessel_nao_ecut - auto it = find_label("bessel_nao_ecut", readinput.input_lists); - param.input.bessel_nao_ecut = "default"; - param.input.ecutwfc = 1.0; - it->second.reset_value(it->second, param); - EXPECT_EQ(std::stod(param.input.bessel_nao_ecut), 1.0); - - param.input.bessel_nao_ecut = "-1"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bessel_nao_rcut - auto it = find_label("bessel_nao_rcut", readinput.input_lists); - param.input.bessel_nao_rcuts = {-1}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bessel_descriptor_ecut - auto it = find_label("bessel_descriptor_ecut", readinput.input_lists); - param.input.bessel_descriptor_ecut = "default"; - param.input.ecutwfc = 1.0; - it->second.reset_value(it->second, param); - EXPECT_EQ(std::stod(param.input.bessel_descriptor_ecut), 1.0); - - param.input.bessel_descriptor_ecut = "-1"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // bessel_descriptor_rcut - auto it = find_label("bessel_descriptor_rcut", readinput.input_lists); - param.input.bessel_descriptor_rcut = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // sc_mag_switch - auto it = find_label("sc_mag_switch", readinput.input_lists); - param.input.sc_mag_switch = true; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // sc_thr - auto it = find_label("sc_thr", readinput.input_lists); - param.input.sc_thr = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // nsc - auto it = find_label("nsc", readinput.input_lists); - param.input.nsc = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // nsc_min - auto it = find_label("nsc_min", readinput.input_lists); - param.input.nsc_min = 0; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // sc_scf_nmin - auto it = find_label("sc_scf_nmin", readinput.input_lists); - param.input.sc_scf_nmin = 1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // alpha_trial - auto it = find_label("alpha_trial", readinput.input_lists); - param.input.alpha_trial = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // sccut - auto it = find_label("sccut", readinput.input_lists); - param.input.sccut = -1; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // sc_scf_thr - auto it = find_label("sc_scf_thr", readinput.input_lists); - param.input.sc_scf_thr = -1e-3; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // qo_thr - auto it = find_label("qo_thr", readinput.input_lists); - param.input.qo_thr = 1e-5; - it->second.check_value(it->second, param); - } - { // qo_strategy - auto it = find_label("qo_strategy", readinput.input_lists); - param.input.ntype = 2; - - param.input.qo_basis = "hydrogen"; - param.input.qo_strategy = {"all"}; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.qo_strategy.size(), 2); - EXPECT_EQ(param.input.qo_strategy[0], "all"); - EXPECT_EQ(param.input.qo_strategy[1], "all"); - - param.input.qo_strategy = {}; - param.input.qo_basis = "hydrogen"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.qo_strategy.size(), 2); - EXPECT_EQ(param.input.qo_strategy[0], "energy-valence"); - EXPECT_EQ(param.input.qo_strategy[1], "energy-valence"); - - param.input.qo_strategy = {}; - param.input.qo_basis = "pswfc"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.qo_strategy.size(), 2); - EXPECT_EQ(param.input.qo_strategy[0], "all"); - EXPECT_EQ(param.input.qo_strategy[1], "all"); - - param.input.qo_basis = "test"; - param.input.qo_strategy = {}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.reset_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // qo_screening_coeff - auto it = find_label("qo_screening_coeff", readinput.input_lists); - param.input.ntype = 2; - - it->second.str_values = {"0.2"}; - param.input.qo_screening_coeff = {0.2}; - param.input.qo_basis = "pswfc"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.qo_screening_coeff.size(), 2); - EXPECT_EQ(param.input.qo_screening_coeff[0], 0.2); - EXPECT_EQ(param.input.qo_screening_coeff[1], 0.2); - - param.input.qo_screening_coeff = {}; - param.input.qo_basis = "pswfc"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.qo_screening_coeff.size(), 2); - EXPECT_EQ(param.input.qo_screening_coeff[0], 0.1); - EXPECT_EQ(param.input.qo_screening_coeff[1], 0.1); - - param.input.qo_screening_coeff = {}; - param.input.qo_basis = "test"; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.reset_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.qo_screening_coeff = {0.2, -0.1}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.qo_screening_coeff = {0.2, 1e-8}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // md_nstep - auto it = find_label("md_nstep", readinput.input_lists); - param.input.mdp.md_nstep = 0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mdp.md_nstep, 50); - } - { // md_prec_level - auto it = find_label("md_prec_level", readinput.input_lists); - param.input.mdp.md_prec_level = 1; - param.input.calculation = "vc-relax"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mdp.md_prec_level, 0); - - param.input.calculation = "md"; - param.input.mdp.md_prec_level = 1; - param.input.mdp.md_type = "vc-md"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mdp.md_prec_level, 0); - } - { // md_tfreq - auto it = find_label("md_tfreq", readinput.input_lists); - param.input.mdp.md_tfreq = 0; - param.input.calculation = "md"; - param.input.mdp.md_dt = 1.0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mdp.md_tfreq, 1.0 / 40 / 1.0); - } - { // md_pfreq - auto it = find_label("md_pfreq", readinput.input_lists); - param.input.mdp.md_pfreq = 0; - param.input.calculation = "md"; - param.input.mdp.md_dt = 1.0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.mdp.md_pfreq, 1.0 / 400 / 1.0); - } - { // lj_rule - auto it = find_label("lj_rule", readinput.input_lists); - param.input.esolver_type = "lj"; - param.input.mdp.lj_rule = 3; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // lj_rcut - auto it = find_label("lj_rcut", readinput.input_lists); - param.input.ntype = 2; - param.input.esolver_type = "lj"; - it->second.str_values = {"1.0", "2.0"}; - param.input.mdp.lj_rcut = {1.0, 2.0}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - - param.input.mdp.lj_rcut = {1.0, 2.0, -1.0}; - it->second.str_values = {"1.0", "2.0", "-1.0"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // lj_epsilon - auto it = find_label("lj_epsilon", readinput.input_lists); - param.input.ntype = 2; - param.input.esolver_type = "lj"; - param.input.mdp.lj_epsilon = {1.0}; - it->second.str_values = {"1.0"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // lj_sigma - auto it = find_label("lj_sigma", readinput.input_lists); - param.input.ntype = 2; - param.input.esolver_type = "lj"; - param.input.mdp.lj_sigma = {1.0}; - it->second.str_values = {"1.0"}; - testing::internal::CaptureStdout(); - EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("NOTICE")); - } - { // nocc - auto it = find_label("nocc", readinput.input_lists); - param.input.nocc = 5; - param.input.nbands = 4; - param.input.nelec = 0.0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nocc, 4); - param.input.nocc = 0; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nocc, 4); - } -} diff --git a/source/module_io/test_serial/read_input_test.cpp b/source/module_io/test_serial/read_input_test.cpp deleted file mode 100644 index ec72402c29..0000000000 --- a/source/module_io/test_serial/read_input_test.cpp +++ /dev/null @@ -1,169 +0,0 @@ -#include "module_io/read_input.h" - -#include "source_base/tool_quit.h" -#include "module_parameter/parameter.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include -#include - -// mock -namespace GlobalV -{ -int NPROC = 1; -int MY_RANK = 0; -std::ofstream ofs_running; -std::ofstream ofs_warning; -} // namespace GlobalV -namespace ModuleBase -{ -void TITLE(const std::string& class_name, const std::string& function_name, const bool disable) -{ -} -namespace GlobalFunc -{ -bool SCAN_BEGIN(std::ifstream& ifs, const std::string& TargetName, const bool restart, const bool ifwarn) -{ - return false; -} -} // namespace GlobalFunc -namespace Global_File -{ -void make_dir_out(const std::string& suffix, - const std::string& calculation, - const bool& out_dir, - const bool& out_wfc_lcao, - const int rank, - const bool& restart, - const bool out_alllog) -{ -} -} // namespace Global_File -} // namespace ModuleBase - -/************************************************ - * unit test of read_input_test.cpp - ***********************************************/ - -/** - * - Tested Functions: - * - Selfconsistent_Read: - * - read empty INPUT file and write INPUT.ref back - * - read INPUT.ref file again and write INPUT - * - Check: - * - check_mode = true - */ - -class InputTest : public testing::Test -{ - protected: - bool compare_two_files(const std::string& filename1, const std::string& filename2) - { - std::ifstream file1(filename1.c_str()); - std::ifstream file2(filename2.c_str()); - EXPECT_TRUE(file1.is_open()); - EXPECT_TRUE(file2.is_open()); - - std::string line1, line2; - int lineNumber = 1; - bool allpass = true; - while (std::getline(file1, line1) && std::getline(file2, line2)) - { - std::istringstream iss1(line1); - std::istringstream iss2(line2); - - std::string col1_file1, col2_file1; - std::string col1_file2, col2_file2; - - // read two columns from each file - iss1 >> col1_file1 >> col2_file1; - iss2 >> col1_file2 >> col2_file2; - - // compare two columns - // compare two columns - if (col1_file1 != col1_file2 || col2_file1 != col2_file2) - { - std::cout << "Mismatch found at line " << lineNumber << " in files " << filename1 << " and " - << filename2 << std::endl; - std::cout << "File1: " << col1_file1 << " " << col2_file1 << std::endl; - std::cout << "File2: " << col1_file2 << " " << col2_file2 << std::endl; - allpass = false; - } - - lineNumber++; - } - - file1.close(); - file2.close(); - return allpass; - } -}; - -TEST_F(InputTest, Selfconsistent_Read) -{ - ModuleIO::ReadInput readinput(0); - readinput.check_ntype_flag = false; - { // PW - std::ofstream emptyfile("empty_INPUT"); - emptyfile << "INPUT_PARAMETERS"; - emptyfile.close(); - Parameter param; - // readinput.read_parameters(param, "./empty_INPUT"); - EXPECT_NO_THROW(readinput.read_parameters(param, "./empty_INPUT")); - readinput.write_parameters(param, "./my_INPUT1"); - readinput.clear(); - // readinput.read_parameters(param, "./my_INPUT1"); - EXPECT_NO_THROW(readinput.read_parameters(param, "./my_INPUT1")); - readinput.write_parameters(param, "./my_INPUT2"); - EXPECT_TRUE(compare_two_files("./my_INPUT1", "./my_INPUT2")); - EXPECT_TRUE(std::remove("./empty_INPUT") == 0); - EXPECT_TRUE(std::remove("./my_INPUT1") == 0); - EXPECT_TRUE(std::remove("./my_INPUT2") == 0); - readinput.clear(); - } - { // LCAO - std::ofstream emptyfile("empty_INPUT"); - emptyfile << "INPUT_PARAMETERS\n"; - emptyfile << "basis_type lcao"; - emptyfile.close(); - Parameter param; - // readinput.read_parameters(param, "./empty_INPUT"); - EXPECT_NO_THROW(readinput.read_parameters(param, "./empty_INPUT")); - readinput.write_parameters(param, "./my_INPUT1"); - readinput.clear(); - // readinput.read_parameters(param, "./my_INPUT1"); - EXPECT_NO_THROW(readinput.read_parameters(param, "./my_INPUT1")); - readinput.write_parameters(param, "./my_INPUT2"); - EXPECT_TRUE(compare_two_files("./my_INPUT1", "./my_INPUT2")); - EXPECT_TRUE(std::remove("./empty_INPUT") == 0); - EXPECT_TRUE(std::remove("./my_INPUT1") == 0); - EXPECT_TRUE(std::remove("./my_INPUT2") == 0); - readinput.clear(); - } -} - -TEST_F(InputTest, Check) -{ - ModuleIO::ReadInput readinput(0); - readinput.check_ntype_flag = false; - { - std::ofstream emptyfile("empty_INPUT"); - emptyfile << "INPUT_PARAMETERS"; - emptyfile.close(); - - Parameter param; - readinput.read_parameters(param, "./empty_INPUT"); - readinput.write_parameters(param, "./INPUT.ref"); - EXPECT_TRUE(std::remove("./empty_INPUT") == 0); - readinput.clear(); - } - - ModuleIO::ReadInput::check_mode = true; - Parameter param; - testing::internal::CaptureStdout(); - EXPECT_EXIT(readinput.read_parameters(param, "./INPUT.ref"), ::testing::ExitedWithCode(0), ""); - std::string output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("INPUT parameters have been successfully checked!")); - EXPECT_TRUE(std::remove("./INPUT.ref") == 0); -} diff --git a/source/module_io/test_serial/read_input_tool_test.cpp b/source/module_io/test_serial/read_input_tool_test.cpp deleted file mode 100644 index 399e6387ec..0000000000 --- a/source/module_io/test_serial/read_input_tool_test.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "../read_input_tool.h" -#include - -// Test fixture for parse_expression tests -class ReadInputTool : public ::testing::Test -{ - protected: -}; - -TEST_F(ReadInputTool, parse_expression) -{ - // Test case for empty expressions - { - std::vector expressions = {}; - std::vector result; - - parse_expression(expressions, result); - EXPECT_TRUE(result.empty()); - } - // Test case for "" - { - std::vector expressions = {""}; - std::vector result; - - parse_expression(expressions, result); - EXPECT_TRUE(result.empty()); - } - // Test case for expressions without '*' - { - std::vector expressions = {"3", "4", "10"}; - std::vector expected = {3, 4, 10}; - std::vector result; - - parse_expression(expressions, result); - EXPECT_EQ(expected.size(), result.size()); - for (size_t i = 0; i < expected.size(); i++) - { - EXPECT_EQ(expected[i], result[i]); - } - } - // Test case for expressions with one '*' - { - std::vector expressions = {"3", "2*4.2", "1*7"}; - std::vector expected = {3.0, 4.2, 4.2, 7.0}; - std::vector result; - - - parse_expression(expressions, result); - EXPECT_EQ(expected.size(), result.size()); - for (size_t i = 0; i < expected.size(); i++) - { - EXPECT_NEAR(expected[i], result[i], 1e-5); - } - } - // Test case for expressions with more than one '*' - { - std::vector expressions = {"2*3*4", "1*2*3*4"}; - std::vector result; - - ASSERT_THROW(parse_expression(expressions, result), std::runtime_error); - } -} diff --git a/source/module_io/test_serial/rho_io_test.cpp b/source/module_io/test_serial/rho_io_test.cpp deleted file mode 100644 index 8729f148c5..0000000000 --- a/source/module_io/test_serial/rho_io_test.cpp +++ /dev/null @@ -1,240 +0,0 @@ -#include "module_io/cube_io.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "source_base/global_variable.h" -#include "module_io/cube_io.h" -#include "prepare_unitcell.h" -#include "source_pw/hamilt_pwdft/parallel_grid.h" - -#ifdef __LCAO -InfoNonlocal::InfoNonlocal() -{ -} -InfoNonlocal::~InfoNonlocal() -{ -} -LCAO_Orbitals::LCAO_Orbitals() -{ -} -LCAO_Orbitals::~LCAO_Orbitals() -{ -} -#endif - - -Magnetism::Magnetism() -{ - this->tot_mag = 0.0; - this->abs_mag = 0.0; - this->start_mag = nullptr; -} - - -Magnetism::~Magnetism() -{ - delete[] this->start_mag; -} -Parallel_Grid::~Parallel_Grid() {} - - -#define private public -#include "module_parameter/parameter.h" -#undef private - -/*************************************************************** - * unit test of read_rho, write_rho and trilinear_interpolate - ***************************************************************/ - -/** - * - Tested Functions: - * - read_rho() - * - the function to read_rho from file - * - the serial version without MPI - * - trilinear_interpolate() - * - the trilinear interpolation method - * - the serial version without MPI - */ - -class RhoIOTest : public ::testing::Test -{ - protected: - int nspin = 1; - int nrxx = 36 * 36 * 36; - int prenspin = 1; - double** rho; - UnitCell* ucell; - - int my_rank = 0; - std::ofstream ofs_running = std::ofstream("unittest.log"); - - void SetUp() - { - rho = new double*[nspin]; - ucell = new UnitCell; - for (int is = 0; is < nspin; ++is) - { - rho[is] = new double[nrxx]; - } - } - void TearDown() - { - for (int is = 0; is < nspin; ++is) - { - delete[] rho[is]; - } - delete[] rho; - delete ucell; - } -}; - -TEST_F(RhoIOTest, Read) -{ - int is = 0; - std::string fn = "./support/chgs1.cube"; - int nx = 36; - int ny = 36; - int nz = 36; - double ef; - UcellTestPrepare utp = UcellTestLib["Si"]; - ucell = utp.SetUcellInfo(); - Parallel_Grid pgrid(nx, ny, nz, nz, nrxx, nz, 1); - ModuleIO::read_vdata_palgrid(pgrid, my_rank, ofs_running, fn, rho[is], ucell->nat); - EXPECT_DOUBLE_EQ(rho[0][0], 1.27020863940e-03); - EXPECT_DOUBLE_EQ(rho[0][46655], 1.33581335706e-02); -} - -TEST_F(RhoIOTest, Write) -{ - int nx = 36; - int ny = 36; - int nz = 36; - UcellTestPrepare utp = UcellTestLib["Si"]; - ucell = utp.SetUcellInfo(); - ucell->lat0 = 10.2; - ucell->latvec = { -0.5,0,0.5,0,0.5,0.5,-0.5,0.5,0 }; - ucell->atoms[0].tau[0] = ModuleBase::Vector3(0.0, 0.0, 0.0); - ucell->atoms[0].tau[1] = ModuleBase::Vector3(-0.75, 0.75, 0.75); - ucell->atoms[0].ncpp.zv = 4; - Parallel_Grid pgrid(nx, ny, nz, nz, nrxx, nz, 1); - ModuleIO::read_vdata_palgrid(pgrid, my_rank, ofs_running, "support/chgs1.cube", rho[0], ucell->nat); - ModuleIO::write_vdata_palgrid(pgrid, rho[0], 0, nspin, 0, "test_write_vdata_palgrid.cube", 0.461002, ucell, 11, 1); - EXPECT_EQ(system("diff -q test_write_vdata_palgrid.cube support/chgs1.cube"), 0); -} - -TEST_F(RhoIOTest, TrilinearInterpolate) -{ - int nx = 36; - int ny = 40; - int nz = 44; - int nx_read = 36; - int ny_read = 36; - int nz_read = 36; - std::ifstream ifs("./support/chgs1.cube"); - for (int i = 0; i < 8; ++i) - { - ifs.ignore(300, '\n'); - } - std::vector data_read(nx_read * ny_read * nz_read); - for (int ix = 0; ix < nx_read; ix++) - { - for (int iy = 0; iy < ny_read; iy++) - { - for (int iz = 0; iz < nz_read; iz++) - { - ifs >> data_read[(ix * ny_read + iy) * nz_read + iz]; - } - } - } - - // The old implementation is inconsistent: ifdef MPI, [x][y][z]; else, [z][x][y]. - // Now we use [x][y][z] for both MPI and non-MPI, so here we need to chage the index order. - auto permute_xyz2zxy = [&](const double* const xyz, double* const zxy) -> void - { - for (int ix = 0; ix < nx; ix++) - { - for (int iy = 0; iy < ny; iy++) - { - for (int iz = 0; iz < nz; iz++) - { - zxy[(iz * nx + ix) * ny + iy] = xyz[(ix * ny + iy) * nz + iz]; - } - } - } - }; - const int nxyz = nx * ny * nz; - std::vector data_xyz(nxyz); - std::vector data(nxyz); // z > x > y - ModuleIO::trilinear_interpolate(data_read.data(), nx_read, ny_read, nz_read, nx, ny, nz, data_xyz.data()); - permute_xyz2zxy(data_xyz.data(), data.data()); - EXPECT_DOUBLE_EQ(data[0], 0.0010824725010374092); - EXPECT_DOUBLE_EQ(data[10], 0.058649850374240906); - EXPECT_DOUBLE_EQ(data[100], 0.018931708073604996); -} - - -struct CubeIOTest : public ::testing::Test -{ - std::vector comment; - int natom = 0; - std::vector origin; - std::vector nvoxel; - int nx_read = 0; - int ny_read = 0; - int nz_read = 0; - std::vector dx; - std::vector dy; - std::vector dz; - std::vector> axis_vecs; - std::vector atom_type; - std::vector atom_charge; - std::vector> atom_pos; - std::vector data_read; - const std::string fn = "./support/chgs1.cube"; -}; - - -TEST_F(CubeIOTest, ReadCube) -{ - ModuleIO::read_cube(fn, comment, natom, origin, - nx_read, ny_read, nz_read, - dx, dy, dz, - atom_type, atom_charge, atom_pos, data_read); - EXPECT_EQ(comment[0], "STEP: 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x"); - EXPECT_EQ(comment[1], "1 (nspin) 0.461002 (fermi energy, in Ry)"); - EXPECT_EQ(natom, 2); - for (auto& o : origin) { EXPECT_EQ(o, 0.0); } - EXPECT_EQ(nx_read, 36); - EXPECT_EQ(ny_read, 36); - EXPECT_EQ(nz_read, 36); - EXPECT_DOUBLE_EQ(dx[0], -0.141667); - EXPECT_DOUBLE_EQ(dy[2], 0.141667); - EXPECT_DOUBLE_EQ(dz[1], 0.141667); - EXPECT_EQ(atom_type.size(), natom); - EXPECT_EQ(atom_charge.size(), natom); - EXPECT_EQ(atom_pos.size(), natom); - for (auto& t : atom_type) { EXPECT_EQ(t, 14); } - for (auto& c : atom_charge) { EXPECT_DOUBLE_EQ(c, 4.0); } - EXPECT_DOUBLE_EQ(atom_pos[1][1], 7.65); - const int nxyz = nx_read * ny_read * nz_read; - EXPECT_EQ(data_read.size(), nxyz); - EXPECT_EQ(data_read[1], 2.64004483879e-03); - EXPECT_EQ(data_read[nxyz - 1], 1.33581335706e-02); -} - - -TEST_F(CubeIOTest, WriteCube) -{ - ModuleIO::read_cube(fn, comment, natom, origin, - nx_read, ny_read, nz_read, - dx, dy, dz, - atom_type, atom_charge, atom_pos, data_read); - - ModuleIO::write_cube("test_write.cube", - comment, natom, origin, - nx_read, ny_read, nz_read, - dx, dy, dz, atom_type, - atom_charge, atom_pos, data_read, 11); - - EXPECT_EQ(system("diff -q test_write.cube ./support/chgs1.cube"), 0); -} diff --git a/source/module_io/test_serial/support/chgs1.cube b/source/module_io/test_serial/support/chgs1.cube deleted file mode 100644 index 6aa8d9205c..0000000000 --- a/source/module_io/test_serial/support/chgs1.cube +++ /dev/null @@ -1,7784 +0,0 @@ -STEP: 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x -1 (nspin) 0.461002 (fermi energy, in Ry) -2 0.0 0.0 0.0 -36 -0.141667 0.000000 0.141667 -36 0.000000 0.141667 0.141667 -36 -0.141667 0.141667 0.000000 - 14 4.000000 0.000000 0.000000 0.000000 - 14 4.000000 -7.650000 7.650000 7.650000 - 1.27020863940e-03 2.64004483879e-03 7.45857574908e-03 1.69819929531e-02 3.09103717113e-02 4.60013609401e-02 - 5.75824043038e-02 6.28259810566e-02 6.21334821617e-02 5.77319585491e-02 5.18034033720e-02 4.57409612273e-02 - 4.02453701311e-02 3.55932306397e-02 3.18414068716e-02 2.89647599965e-02 2.69304328597e-02 2.57176061925e-02 - 2.53146898274e-02 2.57176061925e-02 2.69304328597e-02 2.89647599965e-02 3.18414068716e-02 3.55932306397e-02 - 4.02453701311e-02 4.57409612273e-02 5.18034033720e-02 5.77319585491e-02 6.21334821617e-02 6.28259810566e-02 - 5.75824043038e-02 4.60013609401e-02 3.09103717113e-02 1.69819929531e-02 7.45857574908e-03 2.64004483879e-03 - 2.64004483879e-03 5.17285277950e-03 1.14596764125e-02 2.23413746600e-02 3.62214481565e-02 4.89850720157e-02 - 5.67236888968e-02 5.83399236929e-02 5.53499973529e-02 5.00090134447e-02 4.40291518527e-02 3.83718132369e-02 - 3.34710625414e-02 2.94586793037e-02 2.63252408289e-02 2.40237109616e-02 2.25132701769e-02 2.17657781241e-02 - 2.17657781241e-02 2.25132701769e-02 2.40237109616e-02 2.63252408289e-02 2.94586793037e-02 3.34710625414e-02 - 3.83718132369e-02 4.40291518527e-02 5.00090134447e-02 5.53499973529e-02 5.83399236929e-02 5.67236888968e-02 - 4.89850720157e-02 3.62214481565e-02 2.23413746600e-02 1.14596764125e-02 5.17285277950e-03 2.64004483879e-03 - 7.45857574908e-03 1.14596764125e-02 1.93490286376e-02 3.07039905741e-02 4.26203265537e-02 5.12221625406e-02 - 5.43925934286e-02 5.26931433274e-02 4.80677366203e-02 4.23378898536e-02 3.66568505349e-02 3.16041856284e-02 - 2.73972646659e-02 2.40594329852e-02 2.15413174517e-02 1.97871783123e-02 1.87538902948e-02 1.84129279741e-02 - 1.87538902948e-02 1.97871783123e-02 2.15413174517e-02 2.40594329852e-02 2.73972646659e-02 3.16041856284e-02 - 3.66568505349e-02 4.23378898536e-02 4.80677366203e-02 5.26931433274e-02 5.43925934286e-02 5.12221625406e-02 - 4.26203265537e-02 3.07039905741e-02 1.93490286376e-02 1.14596764125e-02 7.45857574908e-03 6.32692063078e-03 - 1.69819929531e-02 2.23413746600e-02 3.07039905741e-02 4.02808330656e-02 4.79609401864e-02 5.13869204668e-02 - 5.03535465114e-02 4.62623331670e-02 4.07924714489e-02 3.51532871168e-02 3.00149219248e-02 2.56657154446e-02 - 2.21666114252e-02 1.94746684497e-02 1.75241772421e-02 1.62588522549e-02 1.56375665721e-02 1.56375665721e-02 - 1.62588522549e-02 1.75241772421e-02 1.94746684497e-02 2.21666114252e-02 2.56657154446e-02 3.00149219248e-02 - 3.51532871168e-02 4.07924714489e-02 4.62623331670e-02 5.03535465114e-02 5.13869204668e-02 4.79609401864e-02 - 4.02808330656e-02 3.07039905741e-02 2.23413746600e-02 1.69819929531e-02 1.46090879135e-02 1.46090879135e-02 - 3.09103717113e-02 3.62214481565e-02 4.26203265537e-02 4.79609401864e-02 5.02620593726e-02 4.89738024005e-02 - 4.49623774036e-02 3.95849180057e-02 3.39533984936e-02 2.87439673059e-02 2.42781130820e-02 2.06439962171e-02 - 1.78072941675e-02 1.56960478729e-02 1.42425749040e-02 1.33939588194e-02 1.31152359900e-02 1.33939588194e-02 - 1.42425749040e-02 1.56960478729e-02 1.78072941675e-02 2.06439962171e-02 2.42781130820e-02 2.87439673059e-02 - 3.39533984936e-02 3.95849180057e-02 4.49623774036e-02 4.89738024005e-02 5.02620593726e-02 4.79609401864e-02 - 4.26203265537e-02 3.62214481565e-02 3.09103717113e-02 2.77489957459e-02 2.67478820537e-02 2.77489957459e-02 - 4.60013609401e-02 4.89850720157e-02 5.12221625406e-02 5.13869204668e-02 4.89738024005e-02 4.44868574481e-02 - 3.89160663350e-02 3.31691643222e-02 2.78466298707e-02 2.32562353108e-02 1.94921954522e-02 1.65234811342e-02 - 1.42727054437e-02 1.26620800682e-02 1.16276251073e-02 1.11228159589e-02 1.11228159589e-02 1.16276251073e-02 - 1.26620800682e-02 1.42727054437e-02 1.65234811342e-02 1.94921954522e-02 2.32562353108e-02 2.78466298707e-02 - 3.31691643222e-02 3.89160663350e-02 4.44868574481e-02 4.89738024005e-02 5.13869204668e-02 5.12221625406e-02 - 4.89850720157e-02 4.60013609401e-02 4.35588929466e-02 4.22847991283e-02 4.22847991283e-02 4.35588929466e-02 - 5.75824043038e-02 5.67236888968e-02 5.43925934286e-02 5.03535465114e-02 4.49623774036e-02 3.89160663350e-02 - 3.28952522339e-02 2.73794467347e-02 2.26267522861e-02 1.87162119832e-02 1.56112881223e-02 1.32272933414e-02 - 1.14766013692e-02 1.02846446979e-02 9.59384043225e-03 9.36769905218e-03 9.59384043225e-03 1.02846446979e-02 - 1.14766013692e-02 1.32272933414e-02 1.56112881223e-02 1.87162119832e-02 2.26267522861e-02 2.73794467347e-02 - 3.28952522339e-02 3.89160663350e-02 4.49623774036e-02 5.03535465114e-02 5.43925934286e-02 5.67236888968e-02 - 5.75824043038e-02 5.76200322747e-02 5.74463352203e-02 5.73653289979e-02 5.74463352203e-02 5.76200322747e-02 - 6.28259810566e-02 5.83399236929e-02 5.26931433274e-02 4.62623331670e-02 3.95849180057e-02 3.31691643222e-02 - 2.73794467347e-02 2.24136125305e-02 1.83246021902e-02 1.50645020089e-02 1.25396406703e-02 1.06524671204e-02 - 9.31810768724e-03 8.46823559623e-03 8.05519399644e-03 8.05519399644e-03 8.46823559623e-03 9.31810768724e-03 - 1.06524671204e-02 1.25396406703e-02 1.50645020089e-02 1.83246021902e-02 2.24136125305e-02 2.73794467347e-02 - 3.31691643222e-02 3.95849180057e-02 4.62623331670e-02 5.26931433274e-02 5.83399236929e-02 6.28259810566e-02 - 6.60504635380e-02 6.81077724909e-02 6.91119067669e-02 6.91119067669e-02 6.81077724909e-02 6.60504635380e-02 - 6.21334821617e-02 5.53499973529e-02 4.80677366203e-02 4.07924714489e-02 3.39533984936e-02 2.78466298707e-02 - 2.26267522861e-02 1.83246021902e-02 1.48820928374e-02 1.21980827392e-02 1.01663421573e-02 8.69246386814e-03 - 7.69793885145e-03 7.12420828954e-03 6.93665223838e-03 7.12420828954e-03 7.69793885145e-03 8.69246386814e-03 - 1.01663421573e-02 1.21980827392e-02 1.48820928374e-02 1.83246021902e-02 2.26267522861e-02 2.78466298707e-02 - 3.39533984936e-02 4.07924714489e-02 4.80677366203e-02 5.53499973529e-02 6.21334821617e-02 6.79320857310e-02 - 7.23556493700e-02 7.51264696898e-02 7.60705845667e-02 7.51264696898e-02 7.23556493700e-02 6.79320857310e-02 - 5.77319585491e-02 5.00090134447e-02 4.23378898536e-02 3.51532871168e-02 2.87439673059e-02 2.32562353108e-02 - 1.87162119832e-02 1.50645020089e-02 1.21980827392e-02 1.00055755901e-02 8.38500711079e-03 7.24904282964e-03 - 6.52902358143e-03 6.17967298585e-03 6.17967298585e-03 6.52902358143e-03 7.24904282964e-03 8.38500711079e-03 - 1.00055755901e-02 1.21980827392e-02 1.50645020089e-02 1.87162119832e-02 2.32562353108e-02 2.87439673059e-02 - 3.51532871168e-02 4.23378898536e-02 5.00090134447e-02 5.77319585491e-02 6.49555724266e-02 7.10787520021e-02 - 7.55368812409e-02 7.78881394404e-02 7.78881394404e-02 7.55368812409e-02 7.10787520021e-02 6.49555724266e-02 - 5.18034033720e-02 4.40291518527e-02 3.66568505349e-02 3.00149219248e-02 2.42781130820e-02 1.94921954522e-02 - 1.56112881223e-02 1.25396406703e-02 1.01663421573e-02 8.38500711079e-03 7.10160482063e-03 6.23916674188e-03 - 5.74257125314e-03 5.58034633768e-03 5.74257125314e-03 6.23916674188e-03 7.10160482063e-03 8.38500711079e-03 - 1.01663421573e-02 1.25396406703e-02 1.56112881223e-02 1.94921954522e-02 2.42781130820e-02 3.00149219248e-02 - 3.66568505349e-02 4.40291518527e-02 5.18034033720e-02 5.94941697642e-02 6.64898780493e-02 7.21264918488e-02 - 7.57970302390e-02 7.70723261920e-02 7.57970302390e-02 7.21264918488e-02 6.64898780493e-02 5.94941697642e-02 - 4.57409612273e-02 3.83718132369e-02 3.16041856284e-02 2.56657154446e-02 2.06439962171e-02 1.65234811342e-02 - 1.32272933414e-02 1.06524671204e-02 8.69246386814e-03 7.24904282964e-03 6.23916674188e-03 5.59978938003e-03 - 5.28994524639e-03 5.28994524639e-03 5.59978938003e-03 6.23916674188e-03 7.24904282964e-03 8.69246386814e-03 - 1.06524671204e-02 1.32272933414e-02 1.65234811342e-02 2.06439962171e-02 2.56657154446e-02 3.16041856284e-02 - 3.83718132369e-02 4.57409612273e-02 5.33236907840e-02 6.05796981280e-02 6.68641206041e-02 7.15201290633e-02 - 7.40032629540e-02 7.40032629540e-02 7.15201290633e-02 6.68641206041e-02 6.05796981280e-02 5.33236907840e-02 - 4.02453701311e-02 3.34710625414e-02 2.73972646659e-02 2.21666114252e-02 1.78072941675e-02 1.42727054437e-02 - 1.14766013692e-02 9.31810768724e-03 7.69793885145e-03 6.52902358143e-03 5.74257125314e-03 5.28994524639e-03 - 5.14226972170e-03 5.28994524639e-03 5.74257125314e-03 6.52902358143e-03 7.69793885145e-03 9.31810768724e-03 - 1.14766013692e-02 1.42727054437e-02 1.78072941675e-02 2.21666114252e-02 2.73972646659e-02 3.34710625414e-02 - 4.02453701311e-02 4.74313143781e-02 5.45841783826e-02 6.11288569567e-02 6.64284767715e-02 6.98920688762e-02 - 7.10977313661e-02 6.98920688762e-02 6.64284767715e-02 6.11288569567e-02 5.45841783826e-02 4.74313143781e-02 - 3.55932306397e-02 2.94586793037e-02 2.40594329852e-02 1.94746684497e-02 1.56960478729e-02 1.26620800682e-02 - 1.02846446979e-02 8.46823559623e-03 7.12420828954e-03 6.17967298585e-03 5.58034633768e-03 5.28994524639e-03 - 5.28994524639e-03 5.58034633768e-03 6.17967298585e-03 7.12420828954e-03 8.46823559623e-03 1.02846446979e-02 - 1.26620800682e-02 1.56960478729e-02 1.94746684497e-02 2.40594329852e-02 2.94586793037e-02 3.55932306397e-02 - 4.22610610741e-02 4.91148354625e-02 5.56676247698e-02 6.13379141192e-02 6.55352798807e-02 6.77723654588e-02 - 6.77723654588e-02 6.55352798807e-02 6.13379141192e-02 5.56676247698e-02 4.91148354625e-02 4.22610610741e-02 - 3.18414068716e-02 2.63252408289e-02 2.15413174517e-02 1.75241772421e-02 1.42425749040e-02 1.16276251073e-02 - 9.59384043225e-03 8.05519399644e-03 6.93665223838e-03 6.17967298585e-03 5.74257125314e-03 5.59978938003e-03 - 5.74257125314e-03 6.17967298585e-03 6.93665223838e-03 8.05519399644e-03 9.59384043225e-03 1.16276251073e-02 - 1.42425749040e-02 1.75241772421e-02 2.15413174517e-02 2.63252408289e-02 3.18414068716e-02 3.79563421300e-02 - 4.44094609233e-02 5.08044555558e-02 5.66331890923e-02 6.13379141192e-02 6.44054743742e-02 6.54719417706e-02 - 6.44054743742e-02 6.13379141192e-02 5.66331890923e-02 5.08044555558e-02 4.44094609233e-02 3.79563421300e-02 - 2.89647599965e-02 2.40237109616e-02 1.97871783123e-02 1.62588522549e-02 1.33939588194e-02 1.11228159589e-02 - 9.36769905218e-03 8.05519399644e-03 7.12420828954e-03 6.52902358143e-03 6.23916674188e-03 6.23916674188e-03 - 6.52902358143e-03 7.12420828954e-03 8.05519399644e-03 9.36769905218e-03 1.11228159589e-02 1.33939588194e-02 - 1.62588522549e-02 1.97871783123e-02 2.40237109616e-02 2.89647599965e-02 3.45282284639e-02 4.05244812822e-02 - 4.66403070569e-02 5.24477482650e-02 5.74449785733e-02 6.11288569567e-02 6.30873277659e-02 6.30873277659e-02 - 6.11288569567e-02 5.74449785733e-02 5.24477482650e-02 4.66403070569e-02 4.05244812822e-02 3.45282284639e-02 - 2.69304328597e-02 2.25132701769e-02 1.87538902948e-02 1.56375665721e-02 1.31152359900e-02 1.11228159589e-02 - 9.59384043225e-03 8.46823559623e-03 7.69793885145e-03 7.24904282964e-03 7.10160482063e-03 7.24904282964e-03 - 7.69793885145e-03 8.46823559623e-03 9.59384043225e-03 1.11228159589e-02 1.31152359900e-02 1.56375665721e-02 - 1.87538902948e-02 2.25132701769e-02 2.69304328597e-02 3.19590319446e-02 3.74634706166e-02 4.32002938784e-02 - 4.88190878681e-02 5.38883507401e-02 5.79474348197e-02 6.05796981280e-02 6.14923433640e-02 6.05796981280e-02 - 5.79474348197e-02 5.38883507401e-02 4.88190878681e-02 4.32002938784e-02 3.74634706166e-02 3.19590319446e-02 - 2.57176061925e-02 2.17657781241e-02 1.84129279741e-02 1.56375665721e-02 1.33939588194e-02 1.16276251073e-02 - 1.02846446979e-02 9.31810768724e-03 8.69246386814e-03 8.38500711079e-03 8.38500711079e-03 8.69246386814e-03 - 9.31810768724e-03 1.02846446979e-02 1.16276251073e-02 1.33939588194e-02 1.56375665721e-02 1.84129279741e-02 - 2.17657781241e-02 2.57176061925e-02 3.02423286704e-02 3.52402742752e-02 4.05199675384e-02 4.57968161948e-02 - 5.07121410456e-02 5.48714786192e-02 5.78981879671e-02 5.94941697642e-02 5.94941697642e-02 5.78981879671e-02 - 5.48714786192e-02 5.07121410456e-02 4.57968161948e-02 4.05199675384e-02 3.52402742752e-02 3.02423286704e-02 - 2.53146898274e-02 2.17657781241e-02 1.87538902948e-02 1.62588522549e-02 1.42425749040e-02 1.26620800682e-02 - 1.14766013692e-02 1.06524671204e-02 1.01663421573e-02 1.00055755901e-02 1.01663421573e-02 1.06524671204e-02 - 1.14766013692e-02 1.26620800682e-02 1.42425749040e-02 1.62588522549e-02 1.87538902948e-02 2.17657781241e-02 - 2.53146898274e-02 2.93819034216e-02 3.38859304601e-02 3.86662855632e-02 4.34838779539e-02 4.80406383964e-02 - 5.20147259753e-02 5.51031089527e-02 5.70612480291e-02 5.77319585491e-02 5.70612480291e-02 5.51031089527e-02 - 5.20147259753e-02 4.80406383964e-02 4.34838779539e-02 3.86662855632e-02 3.38859304601e-02 2.93819034216e-02 - 2.57176061925e-02 2.25132701769e-02 1.97871783123e-02 1.75241772421e-02 1.56960478729e-02 1.42727054437e-02 - 1.32272933414e-02 1.25396406703e-02 1.21980827392e-02 1.21980827392e-02 1.25396406703e-02 1.32272933414e-02 - 1.42727054437e-02 1.56960478729e-02 1.75241772421e-02 1.97871783123e-02 2.25132701769e-02 2.57176061925e-02 - 2.93819034216e-02 3.34304675050e-02 3.77147526395e-02 4.20165784801e-02 4.60731359718e-02 4.96193341715e-02 - 5.24339557043e-02 5.43692149489e-02 5.53499973529e-02 5.53499973529e-02 5.43692149489e-02 5.24339557043e-02 - 4.96193341715e-02 4.60731359718e-02 4.20165784801e-02 3.77147526395e-02 3.34304675050e-02 2.93819034216e-02 - 2.69304328597e-02 2.40237109616e-02 2.15413174517e-02 1.94746684497e-02 1.78072941675e-02 1.65234811342e-02 - 1.56112881223e-02 1.50645020089e-02 1.48820928374e-02 1.50645020089e-02 1.56112881223e-02 1.65234811342e-02 - 1.78072941675e-02 1.94746684497e-02 2.15413174517e-02 2.40237109616e-02 2.69304328597e-02 3.02423286704e-02 - 3.38859304601e-02 3.77147526395e-02 4.15120643887e-02 4.50208900473e-02 4.79989400749e-02 5.02828320119e-02 - 5.18281863755e-02 5.26931433274e-02 5.29676178633e-02 5.26931433274e-02 5.18281863755e-02 5.02828320119e-02 - 4.79989400749e-02 4.50208900473e-02 4.15120643887e-02 3.77147526395e-02 3.38859304601e-02 3.02423286704e-02 - 2.89647599965e-02 2.63252408289e-02 2.40594329852e-02 2.21666114252e-02 2.06439962171e-02 1.94921954522e-02 - 1.87162119832e-02 1.83246021902e-02 1.83246021902e-02 1.87162119832e-02 1.94921954522e-02 2.06439962171e-02 - 2.21666114252e-02 2.40594329852e-02 2.63252408289e-02 2.89647599965e-02 3.19590319446e-02 3.52402742752e-02 - 3.86662855632e-02 4.20165784801e-02 4.50208900473e-02 4.74231711778e-02 4.90700187394e-02 4.99825941802e-02 - 5.03535465114e-02 5.04463447592e-02 5.04463447592e-02 5.03535465114e-02 4.99825941802e-02 4.90700187394e-02 - 4.74231711778e-02 4.50208900473e-02 4.20165784801e-02 3.86662855632e-02 3.52402742752e-02 3.19590319446e-02 - 3.18414068716e-02 2.94586793037e-02 2.73972646659e-02 2.56657154446e-02 2.42781130820e-02 2.32562353108e-02 - 2.26267522861e-02 2.24136125305e-02 2.26267522861e-02 2.32562353108e-02 2.42781130820e-02 2.56657154446e-02 - 2.73972646659e-02 2.94586793037e-02 3.18414068716e-02 3.45282284639e-02 3.74634706166e-02 4.05199675384e-02 - 4.34838779539e-02 4.60731359718e-02 4.79989400749e-02 4.90700187394e-02 4.93048229800e-02 4.89738024005e-02 - 4.85080722970e-02 4.83002627794e-02 4.85080722970e-02 4.89738024005e-02 4.93048229800e-02 4.90700187394e-02 - 4.79989400749e-02 4.60731359718e-02 4.34838779539e-02 4.05199675384e-02 3.74634706166e-02 3.45282284639e-02 - 3.55932306397e-02 3.34710625414e-02 3.16041856284e-02 3.00149219248e-02 2.87439673059e-02 2.78466298707e-02 - 2.73794467347e-02 2.73794467347e-02 2.78466298707e-02 2.87439673059e-02 3.00149219248e-02 3.16041856284e-02 - 3.34710625414e-02 3.55932306397e-02 3.79563421300e-02 4.05244812822e-02 4.32002938784e-02 4.57968161948e-02 - 4.80406383964e-02 4.96193341715e-02 5.02828320119e-02 4.99825941802e-02 4.89738024005e-02 4.77793166757e-02 - 4.69885184966e-02 4.69885184966e-02 4.77793166757e-02 4.89738024005e-02 4.99825941802e-02 5.02828320119e-02 - 4.96193341715e-02 4.80406383964e-02 4.57968161948e-02 4.32002938784e-02 4.05244812822e-02 3.79563421300e-02 - 4.02453701311e-02 3.83718132369e-02 3.66568505349e-02 3.51532871168e-02 3.39533984936e-02 3.31691643222e-02 - 3.28952522339e-02 3.31691643222e-02 3.39533984936e-02 3.51532871168e-02 3.66568505349e-02 3.83718132369e-02 - 4.02453701311e-02 4.22610610741e-02 4.44094609233e-02 4.66403070569e-02 4.88190878681e-02 5.07121410456e-02 - 5.20147259753e-02 5.24339557043e-02 5.18281863755e-02 5.03535465114e-02 4.85080722970e-02 4.69885184966e-02 - 4.64020316983e-02 4.69885184966e-02 4.85080722970e-02 5.03535465114e-02 5.18281863755e-02 5.24339557043e-02 - 5.20147259753e-02 5.07121410456e-02 4.88190878681e-02 4.66403070569e-02 4.44094609233e-02 4.22610610741e-02 - 4.57409612273e-02 4.40291518527e-02 4.23378898536e-02 4.07924714489e-02 3.95849180057e-02 3.89160663350e-02 - 3.89160663350e-02 3.95849180057e-02 4.07924714489e-02 4.23378898536e-02 4.40291518527e-02 4.57409612273e-02 - 4.74313143781e-02 4.91148354625e-02 5.08044555558e-02 5.24477482650e-02 5.38883507401e-02 5.48714786192e-02 - 5.51031089527e-02 5.43692149489e-02 5.26931433274e-02 5.04463447592e-02 4.83002627794e-02 4.69885184966e-02 - 4.69885184966e-02 4.83002627794e-02 5.04463447592e-02 5.26931433274e-02 5.43692149489e-02 5.51031089527e-02 - 5.48714786192e-02 5.38883507401e-02 5.24477482650e-02 5.08044555558e-02 4.91148354625e-02 4.74313143781e-02 - 5.18034033720e-02 5.00090134447e-02 4.80677366203e-02 4.62623331670e-02 4.49623774036e-02 4.44868574481e-02 - 4.49623774036e-02 4.62623331670e-02 4.80677366203e-02 5.00090134447e-02 5.18034033720e-02 5.33236907840e-02 - 5.45841783826e-02 5.56676247698e-02 5.66331890923e-02 5.74449785733e-02 5.79474348197e-02 5.78981879671e-02 - 5.70612480291e-02 5.53499973529e-02 5.29676178633e-02 5.04463447592e-02 4.85080722970e-02 4.77793166757e-02 - 4.85080722970e-02 5.04463447592e-02 5.29676178633e-02 5.53499973529e-02 5.70612480291e-02 5.78981879671e-02 - 5.79474348197e-02 5.74449785733e-02 5.66331890923e-02 5.56676247698e-02 5.45841783826e-02 5.33236907840e-02 - 5.77319585491e-02 5.53499973529e-02 5.26931433274e-02 5.03535465114e-02 4.89738024005e-02 4.89738024005e-02 - 5.03535465114e-02 5.26931433274e-02 5.53499973529e-02 5.77319585491e-02 5.94941697642e-02 6.05796981280e-02 - 6.11288569567e-02 6.13379141192e-02 6.13379141192e-02 6.11288569567e-02 6.05796981280e-02 5.94941697642e-02 - 5.77319585491e-02 5.53499973529e-02 5.26931433274e-02 5.03535465114e-02 4.89738024005e-02 4.89738024005e-02 - 5.03535465114e-02 5.26931433274e-02 5.53499973529e-02 5.77319585491e-02 5.94941697642e-02 6.05796981280e-02 - 6.11288569567e-02 6.13379141192e-02 6.13379141192e-02 6.11288569567e-02 6.05796981280e-02 5.94941697642e-02 - 6.21334821617e-02 5.83399236929e-02 5.43925934286e-02 5.13869204668e-02 5.02620593726e-02 5.13869204668e-02 - 5.43925934286e-02 5.83399236929e-02 6.21334821617e-02 6.49555724266e-02 6.64898780493e-02 6.68641206041e-02 - 6.64284767715e-02 6.55352798807e-02 6.44054743742e-02 6.30873277659e-02 6.14923433640e-02 5.94941697642e-02 - 5.70612480291e-02 5.43692149489e-02 5.18281863755e-02 4.99825941802e-02 4.93048229800e-02 4.99825941802e-02 - 5.18281863755e-02 5.43692149489e-02 5.70612480291e-02 5.94941697642e-02 6.14923433640e-02 6.30873277659e-02 - 6.44054743742e-02 6.55352798807e-02 6.64284767715e-02 6.68641206041e-02 6.64898780493e-02 6.49555724266e-02 - 6.28259810566e-02 5.67236888968e-02 5.12221625406e-02 4.79609401864e-02 4.79609401864e-02 5.12221625406e-02 - 5.67236888968e-02 6.28259810566e-02 6.79320857310e-02 7.10787520021e-02 7.21264918488e-02 7.15201290633e-02 - 6.98920688762e-02 6.77723654588e-02 6.54719417706e-02 6.30873277659e-02 6.05796981280e-02 5.78981879671e-02 - 5.51031089527e-02 5.24339557043e-02 5.02828320119e-02 4.90700187394e-02 4.90700187394e-02 5.02828320119e-02 - 5.24339557043e-02 5.51031089527e-02 5.78981879671e-02 6.05796981280e-02 6.30873277659e-02 6.54719417706e-02 - 6.77723654588e-02 6.98920688762e-02 7.15201290633e-02 7.21264918488e-02 7.10787520021e-02 6.79320857310e-02 - 5.75824043038e-02 4.89850720157e-02 4.26203265537e-02 4.02808330656e-02 4.26203265537e-02 4.89850720157e-02 - 5.75824043038e-02 6.60504635380e-02 7.23556493700e-02 7.55368812409e-02 7.57970302390e-02 7.40032629540e-02 - 7.10977313661e-02 6.77723654588e-02 6.44054743742e-02 6.11288569567e-02 5.79474348197e-02 5.48714786192e-02 - 5.20147259753e-02 4.96193341715e-02 4.79989400749e-02 4.74231711778e-02 4.79989400749e-02 4.96193341715e-02 - 5.20147259753e-02 5.48714786192e-02 5.79474348197e-02 6.11288569567e-02 6.44054743742e-02 6.77723654588e-02 - 7.10977313661e-02 7.40032629540e-02 7.57970302390e-02 7.55368812409e-02 7.23556493700e-02 6.60504635380e-02 - 4.60013609401e-02 3.62214481565e-02 3.07039905741e-02 3.07039905741e-02 3.62214481565e-02 4.60013609401e-02 - 5.76200322747e-02 6.81077724909e-02 7.51264696898e-02 7.78881394404e-02 7.70723261920e-02 7.40032629540e-02 - 6.98920688762e-02 6.55352798807e-02 6.13379141192e-02 5.74449785733e-02 5.38883507401e-02 5.07121410456e-02 - 4.80406383964e-02 4.60731359718e-02 4.50208900473e-02 4.50208900473e-02 4.60731359718e-02 4.80406383964e-02 - 5.07121410456e-02 5.38883507401e-02 5.74449785733e-02 6.13379141192e-02 6.55352798807e-02 6.98920688762e-02 - 7.40032629540e-02 7.70723261920e-02 7.78881394404e-02 7.51264696898e-02 6.81077724909e-02 5.76200322747e-02 - 3.09103717113e-02 2.23413746600e-02 1.93490286376e-02 2.23413746600e-02 3.09103717113e-02 4.35588929466e-02 - 5.74463352203e-02 6.91119067669e-02 7.60705845667e-02 7.78881394404e-02 7.57970302390e-02 7.15201290633e-02 - 6.64284767715e-02 6.13379141192e-02 5.66331890923e-02 5.24477482650e-02 4.88190878681e-02 4.57968161948e-02 - 4.34838779539e-02 4.20165784801e-02 4.15120643887e-02 4.20165784801e-02 4.34838779539e-02 4.57968161948e-02 - 4.88190878681e-02 5.24477482650e-02 5.66331890923e-02 6.13379141192e-02 6.64284767715e-02 7.15201290633e-02 - 7.57970302390e-02 7.78881394404e-02 7.60705845667e-02 6.91119067669e-02 5.74463352203e-02 4.35588929466e-02 - 1.69819929531e-02 1.14596764125e-02 1.14596764125e-02 1.69819929531e-02 2.77489957459e-02 4.22847991283e-02 - 5.73653289979e-02 6.91119067669e-02 7.51264696898e-02 7.55368812409e-02 7.21264918488e-02 6.68641206041e-02 - 6.11288569567e-02 5.56676247698e-02 5.08044555558e-02 4.66403070569e-02 4.32002938784e-02 4.05199675384e-02 - 3.86662855632e-02 3.77147526395e-02 3.77147526395e-02 3.86662855632e-02 4.05199675384e-02 4.32002938784e-02 - 4.66403070569e-02 5.08044555558e-02 5.56676247698e-02 6.11288569567e-02 6.68641206041e-02 7.21264918488e-02 - 7.55368812409e-02 7.51264696898e-02 6.91119067669e-02 5.73653289979e-02 4.22847991283e-02 2.77489957459e-02 - 7.45857574908e-03 5.17285277950e-03 7.45857574908e-03 1.46090879135e-02 2.67478820537e-02 4.22847991283e-02 - 5.74463352203e-02 6.81077724909e-02 7.23556493700e-02 7.10787520021e-02 6.64898780493e-02 6.05796981280e-02 - 5.45841783826e-02 4.91148354625e-02 4.44094609233e-02 4.05244812822e-02 3.74634706166e-02 3.52402742752e-02 - 3.38859304601e-02 3.34304675050e-02 3.38859304601e-02 3.52402742752e-02 3.74634706166e-02 4.05244812822e-02 - 4.44094609233e-02 4.91148354625e-02 5.45841783826e-02 6.05796981280e-02 6.64898780493e-02 7.10787520021e-02 - 7.23556493700e-02 6.81077724909e-02 5.74463352203e-02 4.22847991283e-02 2.67478820537e-02 1.46090879135e-02 - 2.64004483879e-03 2.64004483879e-03 6.32692063078e-03 1.46090879135e-02 2.77489957459e-02 4.35588929466e-02 - 5.76200322747e-02 6.60504635380e-02 6.79320857310e-02 6.49555724266e-02 5.94941697642e-02 5.33236907840e-02 - 4.74313143781e-02 4.22610610741e-02 3.79563421300e-02 3.45282284639e-02 3.19590319446e-02 3.02423286704e-02 - 2.93819034216e-02 2.93819034216e-02 3.02423286704e-02 3.19590319446e-02 3.45282284639e-02 3.79563421300e-02 - 4.22610610741e-02 4.74313143781e-02 5.33236907840e-02 5.94941697642e-02 6.49555724266e-02 6.79320857310e-02 - 6.60504635380e-02 5.76200322747e-02 4.35588929466e-02 2.77489957459e-02 1.46090879135e-02 6.32692063078e-03 - 2.64004483879e-03 5.17285277950e-03 1.14596764125e-02 2.23413746600e-02 3.62214481565e-02 4.89850720157e-02 - 5.67236888968e-02 5.83399236929e-02 5.53499973529e-02 5.00090134447e-02 4.40291518527e-02 3.83718132369e-02 - 3.34710625414e-02 2.94586793037e-02 2.63252408289e-02 2.40237109616e-02 2.25132701769e-02 2.17657781241e-02 - 2.17657781241e-02 2.25132701769e-02 2.40237109616e-02 2.63252408289e-02 2.94586793037e-02 3.34710625414e-02 - 3.83718132369e-02 4.40291518527e-02 5.00090134447e-02 5.53499973529e-02 5.83399236929e-02 5.67236888968e-02 - 4.89850720157e-02 3.62214481565e-02 2.23413746600e-02 1.14596764125e-02 5.17285277950e-03 2.64004483879e-03 - 5.17285277950e-03 9.05419851032e-03 1.69491736420e-02 2.86292518106e-02 4.11986868029e-02 5.05555186569e-02 - 5.43239294918e-02 5.29676178633e-02 4.84815544672e-02 4.27763236460e-02 3.70689589239e-02 3.19731919657e-02 - 2.77227537368e-02 2.43476957086e-02 2.18005508565e-02 2.00258575799e-02 1.89804120902e-02 1.86354478304e-02 - 1.89804120902e-02 2.00258575799e-02 2.18005508565e-02 2.43476957086e-02 2.77227537368e-02 3.19731919657e-02 - 3.70689589239e-02 4.27763236460e-02 4.84815544672e-02 5.29676178633e-02 5.43239294918e-02 5.05555186569e-02 - 4.11986868029e-02 2.86292518106e-02 1.69491736420e-02 9.05419851032e-03 5.17285277950e-03 4.10298626852e-03 - 1.14596764125e-02 1.69491736420e-02 2.59250062413e-02 3.67025276917e-02 4.58777097769e-02 5.06194135765e-02 - 5.04463447592e-02 4.67810667612e-02 4.14579289512e-02 3.58243136049e-02 3.06330408871e-02 2.62153172241e-02 - 2.26519365039e-02 1.99070659239e-02 1.79167348748e-02 1.66250325509e-02 1.59907282434e-02 1.59907282434e-02 - 1.66250325509e-02 1.79167348748e-02 1.99070659239e-02 2.26519365039e-02 2.62153172241e-02 3.06330408871e-02 - 3.58243136049e-02 4.14579289512e-02 4.67810667612e-02 5.04463447592e-02 5.06194135765e-02 4.58777097769e-02 - 3.67025276917e-02 2.59250062413e-02 1.69491736420e-02 1.14596764125e-02 9.13060134292e-03 9.13060134292e-03 - 2.23413746600e-02 2.86292518106e-02 3.67025276917e-02 4.41366450522e-02 4.83941231678e-02 4.85080722970e-02 - 4.52857661696e-02 4.02540981079e-02 3.47182328687e-02 2.94854041377e-02 2.49511167951e-02 2.12413612776e-02 - 1.83376793613e-02 1.61729889157e-02 1.46810426016e-02 1.38094745262e-02 1.35231772103e-02 1.38094745262e-02 - 1.46810426016e-02 1.61729889157e-02 1.83376793613e-02 2.12413612776e-02 2.49511167951e-02 2.94854041377e-02 - 3.47182328687e-02 4.02540981079e-02 4.52857661696e-02 4.85080722970e-02 4.83941231678e-02 4.41366450522e-02 - 3.67025276917e-02 2.86292518106e-02 2.23413746600e-02 1.87771308641e-02 1.76819501362e-02 1.87771308641e-02 - 3.62214481565e-02 4.11986868029e-02 4.58777097769e-02 4.83941231678e-02 4.77793166757e-02 4.44045560444e-02 - 3.93968315223e-02 3.38709874542e-02 2.85879356046e-02 2.39549635512e-02 2.01220876747e-02 1.70848695603e-02 - 1.47756456624e-02 1.31198380533e-02 1.20550163598e-02 1.15351431719e-02 1.15351431719e-02 1.20550163598e-02 - 1.31198380533e-02 1.47756456624e-02 1.70848695603e-02 2.01220876747e-02 2.39549635512e-02 2.85879356046e-02 - 3.38709874542e-02 3.93968315223e-02 4.44045560444e-02 4.77793166757e-02 4.83941231678e-02 4.58777097769e-02 - 4.11986868029e-02 3.62214481565e-02 3.25101129901e-02 3.06594619284e-02 3.06594619284e-02 3.25101129901e-02 - 4.89850720157e-02 5.05555186569e-02 5.06194135765e-02 4.85080722970e-02 4.44045560444e-02 3.90848689472e-02 - 3.34071767353e-02 2.80098127199e-02 2.32603028496e-02 1.93050944183e-02 1.61434902729e-02 1.37059602390e-02 - 1.19105819676e-02 1.06856809758e-02 9.97511028176e-03 9.74245511371e-03 9.97511028176e-03 1.06856809758e-02 - 1.19105819676e-02 1.37059602390e-02 1.61434902729e-02 1.93050944183e-02 2.32603028496e-02 2.80098127199e-02 - 3.34071767353e-02 3.90848689472e-02 4.44045560444e-02 4.85080722970e-02 5.06194135765e-02 5.05555186569e-02 - 4.89850720157e-02 4.70389926376e-02 4.56222411881e-02 4.51254329663e-02 4.56222411881e-02 4.70389926376e-02 - 5.67236888968e-02 5.43239294918e-02 5.04463447592e-02 4.52857661696e-02 3.93968315223e-02 3.34071767353e-02 - 2.78094015925e-02 2.29016184223e-02 1.88053010662e-02 1.55127511572e-02 1.29494247541e-02 1.10259974674e-02 - 9.66211927865e-03 8.79214216133e-03 8.36917339040e-03 8.36917339040e-03 8.79214216133e-03 9.66211927865e-03 - 1.10259974674e-02 1.29494247541e-02 1.55127511572e-02 1.88053010662e-02 2.29016184223e-02 2.78094015925e-02 - 3.34071767353e-02 3.93968315223e-02 4.52857661696e-02 5.04463447592e-02 5.43239294918e-02 5.67236888968e-02 - 5.79103146750e-02 5.83777841365e-02 5.85232784436e-02 5.85232784436e-02 5.83777841365e-02 5.79103146750e-02 - 5.83399236929e-02 5.29676178633e-02 4.67810667612e-02 4.02540981079e-02 3.38709874542e-02 2.80098127199e-02 - 2.29016184223e-02 1.86367379277e-02 1.51956958667e-02 1.24976141314e-02 1.04460621935e-02 8.95261635749e-03 - 7.94279014126e-03 7.35981258047e-03 7.16922584820e-03 7.35981258047e-03 7.94279014126e-03 8.95261635749e-03 - 1.04460621935e-02 1.24976141314e-02 1.51956958667e-02 1.86367379277e-02 2.29016184223e-02 2.80098127199e-02 - 3.38709874542e-02 4.02540981079e-02 4.67810667612e-02 5.29676178633e-02 5.83399236929e-02 6.25800698666e-02 - 6.55787911247e-02 6.73541476702e-02 6.79419572879e-02 6.73541476702e-02 6.55787911247e-02 6.25800698666e-02 - 5.53499973529e-02 4.84815544672e-02 4.14579289512e-02 3.47182328687e-02 2.85879356046e-02 2.32603028496e-02 - 1.88053010662e-02 1.51956958667e-02 1.23472319177e-02 1.01587603229e-02 8.53524112695e-03 7.39443450458e-03 - 6.67049181789e-03 6.31909087196e-03 6.31909087196e-03 6.67049181789e-03 7.39443450458e-03 8.53524112695e-03 - 1.01587603229e-02 1.23472319177e-02 1.51956958667e-02 1.88053010662e-02 2.32603028496e-02 2.85879356046e-02 - 3.47182328687e-02 4.14579289512e-02 4.84815544672e-02 5.53499973529e-02 6.15702941626e-02 6.66786802062e-02 - 7.03019494995e-02 7.21810172465e-02 7.21810172465e-02 7.03019494995e-02 6.66786802062e-02 6.15702941626e-02 - 5.00090134447e-02 4.27763236460e-02 3.58243136049e-02 2.94854041377e-02 2.39549635512e-02 1.93050944183e-02 - 1.55127511572e-02 1.24976141314e-02 1.01587603229e-02 8.39746782805e-03 7.12561826537e-03 6.26978037715e-03 - 5.77651892440e-03 5.61528193683e-03 5.77651892440e-03 6.26978037715e-03 7.12561826537e-03 8.39746782805e-03 - 1.01587603229e-02 1.24976141314e-02 1.55127511572e-02 1.93050944183e-02 2.39549635512e-02 2.94854041377e-02 - 3.58243136049e-02 4.27763236460e-02 5.00090134447e-02 5.70612480291e-02 6.33842515281e-02 6.84139609392e-02 - 7.16581855164e-02 7.27796836797e-02 7.16581855164e-02 6.84139609392e-02 6.33842515281e-02 5.70612480291e-02 - 4.40291518527e-02 3.70689589239e-02 3.06330408871e-02 2.49511167951e-02 2.01220876747e-02 1.61434902729e-02 - 1.29494247541e-02 1.04460621935e-02 8.53524112695e-03 7.12561826537e-03 6.13840739734e-03 5.51272438194e-03 - 5.20914423543e-03 5.20914423543e-03 5.51272438194e-03 6.13840739734e-03 7.12561826537e-03 8.53524112695e-03 - 1.04460621935e-02 1.29494247541e-02 1.61434902729e-02 2.01220876747e-02 2.49511167951e-02 3.06330408871e-02 - 3.70689589239e-02 4.40291518527e-02 5.11403130173e-02 5.78981879671e-02 6.37149803432e-02 6.80033074139e-02 - 7.02831021338e-02 7.02831021338e-02 6.80033074139e-02 6.37149803432e-02 5.78981879671e-02 5.11403130173e-02 - 3.83718132369e-02 3.19731919657e-02 2.62153172241e-02 2.12413612776e-02 1.70848695603e-02 1.37059602390e-02 - 1.10259974674e-02 8.95261635749e-03 7.39443450458e-03 6.26978037715e-03 5.51272438194e-03 5.07652462266e-03 - 4.93405372394e-03 5.07652462266e-03 5.51272438194e-03 6.26978037715e-03 7.39443450458e-03 8.95261635749e-03 - 1.10259974674e-02 1.37059602390e-02 1.70848695603e-02 2.12413612776e-02 2.62153172241e-02 3.19731919657e-02 - 3.83718132369e-02 4.51323632879e-02 5.18355302331e-02 5.79474348197e-02 6.28828729732e-02 6.61022866145e-02 - 6.72218662363e-02 6.61022866145e-02 6.28828729732e-02 5.79474348197e-02 5.18355302331e-02 4.51323632879e-02 - 3.34710625414e-02 2.77227537368e-02 2.26519365039e-02 1.83376793613e-02 1.47756456624e-02 1.19105819676e-02 - 9.66211927865e-03 7.94279014126e-03 6.67049181789e-03 5.77651892440e-03 5.20914423543e-03 4.93405372394e-03 - 4.93405372394e-03 5.20914423543e-03 5.77651892440e-03 6.67049181789e-03 7.94279014126e-03 9.66211927865e-03 - 1.19105819676e-02 1.47756456624e-02 1.83376793613e-02 2.26519365039e-02 2.77227537368e-02 3.34710625414e-02 - 3.97029159910e-02 4.60913389830e-02 5.21839135623e-02 5.74449785733e-02 6.13334872428e-02 6.34040688222e-02 - 6.34040688222e-02 6.13334872428e-02 5.74449785733e-02 5.21839135623e-02 4.60913389830e-02 3.97029159910e-02 - 2.94586793037e-02 2.43476957086e-02 1.99070659239e-02 1.61729889157e-02 1.31198380533e-02 1.06856809758e-02 - 8.79214216133e-03 7.35981258047e-03 6.31909087196e-03 5.61528193683e-03 5.20914423543e-03 5.07652462266e-03 - 5.20914423543e-03 5.61528193683e-03 6.31909087196e-03 7.35981258047e-03 8.79214216133e-03 1.06856809758e-02 - 1.31198380533e-02 1.61729889157e-02 1.99070659239e-02 2.43476957086e-02 2.94586793037e-02 3.51127517762e-02 - 4.10670403681e-02 4.69561004766e-02 5.23143637463e-02 5.66331890923e-02 5.94462807362e-02 6.04237632524e-02 - 5.94462807362e-02 5.66331890923e-02 5.23143637463e-02 4.69561004766e-02 4.10670403681e-02 3.51127517762e-02 - 2.63252408289e-02 2.18005508565e-02 1.79167348748e-02 1.46810426016e-02 1.20550163598e-02 9.97511028176e-03 - 8.36917339040e-03 7.16922584820e-03 6.31909087196e-03 5.77651892440e-03 5.51272438194e-03 5.51272438194e-03 - 5.77651892440e-03 6.31909087196e-03 7.16922584820e-03 8.36917339040e-03 9.97511028176e-03 1.20550163598e-02 - 1.46810426016e-02 1.79167348748e-02 2.18005508565e-02 2.63252408289e-02 3.14127386696e-02 3.68889471691e-02 - 4.24686468881e-02 4.77625301985e-02 5.23143637463e-02 5.56676247698e-02 5.74494623672e-02 5.74494623672e-02 - 5.56676247698e-02 5.23143637463e-02 4.77625301985e-02 4.24686468881e-02 3.68889471691e-02 3.14127386696e-02 - 2.40237109616e-02 2.00258575799e-02 1.66250325509e-02 1.38094745262e-02 1.15351431719e-02 9.74245511371e-03 - 8.36917339040e-03 7.35981258047e-03 6.67049181789e-03 6.26978037715e-03 6.13840739734e-03 6.26978037715e-03 - 6.67049181789e-03 7.35981258047e-03 8.36917339040e-03 9.74245511371e-03 1.15351431719e-02 1.38094745262e-02 - 1.66250325509e-02 2.00258575799e-02 2.40237109616e-02 2.85763383726e-02 3.35632692529e-02 3.87673596218e-02 - 4.38725463784e-02 4.84855850881e-02 5.21839135623e-02 5.45841783826e-02 5.54167137150e-02 5.45841783826e-02 - 5.21839135623e-02 4.84855850881e-02 4.38725463784e-02 3.87673596218e-02 3.35632692529e-02 2.85763383726e-02 - 2.25132701769e-02 1.89804120902e-02 1.59907282434e-02 1.35231772103e-02 1.15351431719e-02 9.97511028176e-03 - 8.79214216133e-03 7.94279014126e-03 7.39443450458e-03 7.12561826537e-03 7.12561826537e-03 7.39443450458e-03 - 7.94279014126e-03 8.79214216133e-03 9.97511028176e-03 1.15351431719e-02 1.35231772103e-02 1.59907282434e-02 - 1.89804120902e-02 2.25132701769e-02 2.65706573512e-02 3.10717223250e-02 3.58537824974e-02 4.06654278454e-02 - 4.51788789706e-02 4.90231496620e-02 5.18355302331e-02 5.33236907840e-02 5.33236907840e-02 5.18355302331e-02 - 4.90231496620e-02 4.51788789706e-02 4.06654278454e-02 3.58537824974e-02 3.10717223250e-02 2.65706573512e-02 - 2.17657781241e-02 1.86354478304e-02 1.59907282434e-02 1.38094745262e-02 1.20550163598e-02 1.06856809758e-02 - 9.66211927865e-03 8.95261635749e-03 8.53524112695e-03 8.39746782805e-03 8.53524112695e-03 8.95261635749e-03 - 9.66211927865e-03 1.06856809758e-02 1.20550163598e-02 1.38094745262e-02 1.59907282434e-02 1.86354478304e-02 - 2.17657781241e-02 2.53749373622e-02 2.94074293899e-02 3.37399765679e-02 3.81729635435e-02 4.24386109393e-02 - 4.62258246981e-02 4.92182336225e-02 5.11403130173e-02 5.18034033720e-02 5.11403130173e-02 4.92182336225e-02 - 4.62258246981e-02 4.24386109393e-02 3.81729635435e-02 3.37399765679e-02 2.94074293899e-02 2.53749373622e-02 - 2.17657781241e-02 1.89804120902e-02 1.66250325509e-02 1.46810426016e-02 1.31198380533e-02 1.19105819676e-02 - 1.10259974674e-02 1.04460621935e-02 1.01587603229e-02 1.01587603229e-02 1.04460621935e-02 1.10259974674e-02 - 1.19105819676e-02 1.31198380533e-02 1.46810426016e-02 1.66250325509e-02 1.89804120902e-02 2.17657781241e-02 - 2.49776956914e-02 2.85734174953e-02 3.24534608631e-02 3.64535808156e-02 4.03527020822e-02 4.38959177953e-02 - 4.68264624901e-02 4.89192305177e-02 5.00090134447e-02 5.00090134447e-02 4.89192305177e-02 4.68264624901e-02 - 4.38959177953e-02 4.03527020822e-02 3.64535808156e-02 3.24534608631e-02 2.85734174953e-02 2.49776956914e-02 - 2.25132701769e-02 2.00258575799e-02 1.79167348748e-02 1.61729889157e-02 1.47756456624e-02 1.37059602390e-02 - 1.29494247541e-02 1.24976141314e-02 1.23472319177e-02 1.24976141314e-02 1.29494247541e-02 1.37059602390e-02 - 1.47756456624e-02 1.61729889157e-02 1.79167348748e-02 2.00258575799e-02 2.25132701769e-02 2.53749373622e-02 - 2.85734174953e-02 3.20210145144e-02 3.55725175924e-02 3.90350130516e-02 4.21941579647e-02 4.48486167771e-02 - 4.68401774785e-02 4.80677366203e-02 4.84815544672e-02 4.80677366203e-02 4.68401774785e-02 4.48486167771e-02 - 4.21941579647e-02 3.90350130516e-02 3.55725175924e-02 3.20210145144e-02 2.85734174953e-02 2.53749373622e-02 - 2.40237109616e-02 2.18005508565e-02 1.99070659239e-02 1.83376793613e-02 1.70848695603e-02 1.61434902729e-02 - 1.55127511572e-02 1.51956958667e-02 1.51956958667e-02 1.55127511572e-02 1.61434902729e-02 1.70848695603e-02 - 1.83376793613e-02 1.99070659239e-02 2.18005508565e-02 2.40237109616e-02 2.65706573512e-02 2.94074293899e-02 - 3.24534608631e-02 3.55725175924e-02 3.85829474965e-02 4.12888114430e-02 4.35234290368e-02 4.51877782102e-02 - 4.62623331670e-02 4.67810667612e-02 4.67810667612e-02 4.62623331670e-02 4.51877782102e-02 4.35234290368e-02 - 4.12888114430e-02 3.85829474965e-02 3.55725175924e-02 3.24534608631e-02 2.94074293899e-02 2.65706573512e-02 - 2.63252408289e-02 2.43476957086e-02 2.26519365039e-02 2.12413612776e-02 2.01220876747e-02 1.93050944183e-02 - 1.88053010662e-02 1.86367379277e-02 1.88053010662e-02 1.93050944183e-02 2.01220876747e-02 2.12413612776e-02 - 2.26519365039e-02 2.43476957086e-02 2.63252408289e-02 2.85763383726e-02 3.10717223250e-02 3.37399765679e-02 - 3.64535808156e-02 3.90350130516e-02 4.12888114430e-02 4.30547772101e-02 4.42634768270e-02 4.49623774036e-02 - 4.52857661696e-02 4.53738413591e-02 4.52857661696e-02 4.49623774036e-02 4.42634768270e-02 4.30547772101e-02 - 4.12888114430e-02 3.90350130516e-02 3.64535808156e-02 3.37399765679e-02 3.10717223250e-02 2.85763383726e-02 - 2.94586793037e-02 2.77227537368e-02 2.62153172241e-02 2.49511167951e-02 2.39549635512e-02 2.32603028496e-02 - 2.29016184223e-02 2.29016184223e-02 2.32603028496e-02 2.39549635512e-02 2.49511167951e-02 2.62153172241e-02 - 2.77227537368e-02 2.94586793037e-02 3.14127386696e-02 3.35632692529e-02 3.58537824974e-02 3.81729635435e-02 - 4.03527020822e-02 4.21941579647e-02 4.35234290368e-02 4.42634768270e-02 4.44868574481e-02 4.44045560444e-02 - 4.42752514752e-02 4.42752514752e-02 4.44045560444e-02 4.44868574481e-02 4.42634768270e-02 4.35234290368e-02 - 4.21941579647e-02 4.03527020822e-02 3.81729635435e-02 3.58537824974e-02 3.35632692529e-02 3.14127386696e-02 - 3.34710625414e-02 3.19731919657e-02 3.06330408871e-02 2.94854041377e-02 2.85879356046e-02 2.80098127199e-02 - 2.78094015925e-02 2.80098127199e-02 2.85879356046e-02 2.94854041377e-02 3.06330408871e-02 3.19731919657e-02 - 3.34710625414e-02 3.51127517762e-02 3.68889471691e-02 3.87673596218e-02 4.06654278454e-02 4.24386109393e-02 - 4.38959177953e-02 4.48486167771e-02 4.51877782102e-02 4.49623774036e-02 4.44045560444e-02 4.38595264834e-02 - 4.36365698621e-02 4.38595264834e-02 4.44045560444e-02 4.49623774036e-02 4.51877782102e-02 4.48486167771e-02 - 4.38959177953e-02 4.24386109393e-02 4.06654278454e-02 3.87673596218e-02 3.68889471691e-02 3.51127517762e-02 - 3.83718132369e-02 3.70689589239e-02 3.58243136049e-02 3.47182328687e-02 3.38709874542e-02 3.34071767353e-02 - 3.34071767353e-02 3.38709874542e-02 3.47182328687e-02 3.58243136049e-02 3.70689589239e-02 3.83718132369e-02 - 3.97029159910e-02 4.10670403681e-02 4.24686468881e-02 4.38725463784e-02 4.51788789706e-02 4.62258246981e-02 - 4.68264624901e-02 4.68401774785e-02 4.62623331670e-02 4.52857661696e-02 4.42752514752e-02 4.36365698621e-02 - 4.36365698621e-02 4.42752514752e-02 4.52857661696e-02 4.62623331670e-02 4.68401774785e-02 4.68264624901e-02 - 4.62258246981e-02 4.51788789706e-02 4.38725463784e-02 4.24686468881e-02 4.10670403681e-02 3.97029159910e-02 - 4.40291518527e-02 4.27763236460e-02 4.14579289512e-02 4.02540981079e-02 3.93968315223e-02 3.90848689472e-02 - 3.93968315223e-02 4.02540981079e-02 4.14579289512e-02 4.27763236460e-02 4.40291518527e-02 4.51323632879e-02 - 4.60913389830e-02 4.69561004766e-02 4.77625301985e-02 4.84855850881e-02 4.90231496620e-02 4.92182336225e-02 - 4.89192305177e-02 4.80677366203e-02 4.67810667612e-02 4.53738413591e-02 4.42752514752e-02 4.38595264834e-02 - 4.42752514752e-02 4.53738413591e-02 4.67810667612e-02 4.80677366203e-02 4.89192305177e-02 4.92182336225e-02 - 4.90231496620e-02 4.84855850881e-02 4.77625301985e-02 4.69561004766e-02 4.60913389830e-02 4.51323632879e-02 - 5.00090134447e-02 4.84815544672e-02 4.67810667612e-02 4.52857661696e-02 4.44045560444e-02 4.44045560444e-02 - 4.52857661696e-02 4.67810667612e-02 4.84815544672e-02 5.00090134447e-02 5.11403130173e-02 5.18355302331e-02 - 5.21839135623e-02 5.23143637463e-02 5.23143637463e-02 5.21839135623e-02 5.18355302331e-02 5.11403130173e-02 - 5.00090134447e-02 4.84815544672e-02 4.67810667612e-02 4.52857661696e-02 4.44045560444e-02 4.44045560444e-02 - 4.52857661696e-02 4.67810667612e-02 4.84815544672e-02 5.00090134447e-02 5.11403130173e-02 5.18355302331e-02 - 5.21839135623e-02 5.23143637463e-02 5.23143637463e-02 5.21839135623e-02 5.18355302331e-02 5.11403130173e-02 - 5.53499973529e-02 5.29676178633e-02 5.04463447592e-02 4.85080722970e-02 4.77793166757e-02 4.85080722970e-02 - 5.04463447592e-02 5.29676178633e-02 5.53499973529e-02 5.70612480291e-02 5.78981879671e-02 5.79474348197e-02 - 5.74449785733e-02 5.66331890923e-02 5.56676247698e-02 5.45841783826e-02 5.33236907840e-02 5.18034033720e-02 - 5.00090134447e-02 4.80677366203e-02 4.62623331670e-02 4.49623774036e-02 4.44868574481e-02 4.49623774036e-02 - 4.62623331670e-02 4.80677366203e-02 5.00090134447e-02 5.18034033720e-02 5.33236907840e-02 5.45841783826e-02 - 5.56676247698e-02 5.66331890923e-02 5.74449785733e-02 5.79474348197e-02 5.78981879671e-02 5.70612480291e-02 - 5.83399236929e-02 5.43239294918e-02 5.06194135765e-02 4.83941231678e-02 4.83941231678e-02 5.06194135765e-02 - 5.43239294918e-02 5.83399236929e-02 6.15702941626e-02 6.33842515281e-02 6.37149803432e-02 6.28828729732e-02 - 6.13334872428e-02 5.94462807362e-02 5.74494623672e-02 5.54167137150e-02 5.33236907840e-02 5.11403130173e-02 - 4.89192305177e-02 4.68401774785e-02 4.51877782102e-02 4.42634768270e-02 4.42634768270e-02 4.51877782102e-02 - 4.68401774785e-02 4.89192305177e-02 5.11403130173e-02 5.33236907840e-02 5.54167137150e-02 5.74494623672e-02 - 5.94462807362e-02 6.13334872428e-02 6.28828729732e-02 6.37149803432e-02 6.33842515281e-02 6.15702941626e-02 - 5.67236888968e-02 5.05555186569e-02 4.58777097769e-02 4.41366450522e-02 4.58777097769e-02 5.05555186569e-02 - 5.67236888968e-02 6.25800698666e-02 6.66786802062e-02 6.84139609392e-02 6.80033074139e-02 6.61022866145e-02 - 6.34040688222e-02 6.04237632524e-02 5.74494623672e-02 5.45841783826e-02 5.18355302331e-02 4.92182336225e-02 - 4.68264624901e-02 4.48486167771e-02 4.35234290368e-02 4.30547772101e-02 4.35234290368e-02 4.48486167771e-02 - 4.68264624901e-02 4.92182336225e-02 5.18355302331e-02 5.45841783826e-02 5.74494623672e-02 6.04237632524e-02 - 6.34040688222e-02 6.61022866145e-02 6.80033074139e-02 6.84139609392e-02 6.66786802062e-02 6.25800698666e-02 - 4.89850720157e-02 4.11986868029e-02 3.67025276917e-02 3.67025276917e-02 4.11986868029e-02 4.89850720157e-02 - 5.79103146750e-02 6.55787911247e-02 7.03019494995e-02 7.16581855164e-02 7.02831021338e-02 6.72218662363e-02 - 6.34040688222e-02 5.94462807362e-02 5.56676247698e-02 5.21839135623e-02 4.90231496620e-02 4.62258246981e-02 - 4.38959177953e-02 4.21941579647e-02 4.12888114430e-02 4.12888114430e-02 4.21941579647e-02 4.38959177953e-02 - 4.62258246981e-02 4.90231496620e-02 5.21839135623e-02 5.56676247698e-02 5.94462807362e-02 6.34040688222e-02 - 6.72218662363e-02 7.02831021338e-02 7.16581855164e-02 7.03019494995e-02 6.55787911247e-02 5.79103146750e-02 - 3.62214481565e-02 2.86292518106e-02 2.59250062413e-02 2.86292518106e-02 3.62214481565e-02 4.70389926376e-02 - 5.83777841365e-02 6.73541476702e-02 7.21810172465e-02 7.27796836797e-02 7.02831021338e-02 6.61022866145e-02 - 6.13334872428e-02 5.66331890923e-02 5.23143637463e-02 4.84855850881e-02 4.51788789706e-02 4.24386109393e-02 - 4.03527020822e-02 3.90350130516e-02 3.85829474965e-02 3.90350130516e-02 4.03527020822e-02 4.24386109393e-02 - 4.51788789706e-02 4.84855850881e-02 5.23143637463e-02 5.66331890923e-02 6.13334872428e-02 6.61022866145e-02 - 7.02831021338e-02 7.27796836797e-02 7.21810172465e-02 6.73541476702e-02 5.83777841365e-02 4.70389926376e-02 - 2.23413746600e-02 1.69491736420e-02 1.69491736420e-02 2.23413746600e-02 3.25101129901e-02 4.56222411881e-02 - 5.85232784436e-02 6.79419572879e-02 7.21810172465e-02 7.16581855164e-02 6.80033074139e-02 6.28828729732e-02 - 5.74449785733e-02 5.23143637463e-02 4.77625301985e-02 4.38725463784e-02 4.06654278454e-02 3.81729635435e-02 - 3.64535808156e-02 3.55725175924e-02 3.55725175924e-02 3.64535808156e-02 3.81729635435e-02 4.06654278454e-02 - 4.38725463784e-02 4.77625301985e-02 5.23143637463e-02 5.74449785733e-02 6.28828729732e-02 6.80033074139e-02 - 7.16581855164e-02 7.21810172465e-02 6.79419572879e-02 5.85232784436e-02 4.56222411881e-02 3.25101129901e-02 - 1.14596764125e-02 9.05419851032e-03 1.14596764125e-02 1.87771308641e-02 3.06594619284e-02 4.51254329663e-02 - 5.85232784436e-02 6.73541476702e-02 7.03019494995e-02 6.84139609392e-02 6.37149803432e-02 5.79474348197e-02 - 5.21839135623e-02 4.69561004766e-02 4.24686468881e-02 3.87673596218e-02 3.58537824974e-02 3.37399765679e-02 - 3.24534608631e-02 3.20210145144e-02 3.24534608631e-02 3.37399765679e-02 3.58537824974e-02 3.87673596218e-02 - 4.24686468881e-02 4.69561004766e-02 5.21839135623e-02 5.79474348197e-02 6.37149803432e-02 6.84139609392e-02 - 7.03019494995e-02 6.73541476702e-02 5.85232784436e-02 4.51254329663e-02 3.06594619284e-02 1.87771308641e-02 - 5.17285277950e-03 5.17285277950e-03 9.13060134292e-03 1.76819501362e-02 3.06594619284e-02 4.56222411881e-02 - 5.83777841365e-02 6.55787911247e-02 6.66786802062e-02 6.33842515281e-02 5.78981879671e-02 5.18355302331e-02 - 4.60913389830e-02 4.10670403681e-02 3.68889471691e-02 3.35632692529e-02 3.10717223250e-02 2.94074293899e-02 - 2.85734174953e-02 2.85734174953e-02 2.94074293899e-02 3.10717223250e-02 3.35632692529e-02 3.68889471691e-02 - 4.10670403681e-02 4.60913389830e-02 5.18355302331e-02 5.78981879671e-02 6.33842515281e-02 6.66786802062e-02 - 6.55787911247e-02 5.83777841365e-02 4.56222411881e-02 3.06594619284e-02 1.76819501362e-02 9.13060134292e-03 - 2.64004483879e-03 4.10298626852e-03 9.13060134292e-03 1.87771308641e-02 3.25101129901e-02 4.70389926376e-02 - 5.79103146750e-02 6.25800698666e-02 6.15702941626e-02 5.70612480291e-02 5.11403130173e-02 4.51323632879e-02 - 3.97029159910e-02 3.51127517762e-02 3.14127386696e-02 2.85763383726e-02 2.65706573512e-02 2.53749373622e-02 - 2.49776956914e-02 2.53749373622e-02 2.65706573512e-02 2.85763383726e-02 3.14127386696e-02 3.51127517762e-02 - 3.97029159910e-02 4.51323632879e-02 5.11403130173e-02 5.70612480291e-02 6.15702941626e-02 6.25800698666e-02 - 5.79103146750e-02 4.70389926376e-02 3.25101129901e-02 1.87771308641e-02 9.13060134292e-03 4.10298626852e-03 - 7.45857574908e-03 1.14596764125e-02 1.93490286376e-02 3.07039905741e-02 4.26203265537e-02 5.12221625406e-02 - 5.43925934286e-02 5.26931433274e-02 4.80677366203e-02 4.23378898536e-02 3.66568505349e-02 3.16041856284e-02 - 2.73972646659e-02 2.40594329852e-02 2.15413174517e-02 1.97871783123e-02 1.87538902948e-02 1.84129279741e-02 - 1.87538902948e-02 1.97871783123e-02 2.15413174517e-02 2.40594329852e-02 2.73972646659e-02 3.16041856284e-02 - 3.66568505349e-02 4.23378898536e-02 4.80677366203e-02 5.26931433274e-02 5.43925934286e-02 5.12221625406e-02 - 4.26203265537e-02 3.07039905741e-02 1.93490286376e-02 1.14596764125e-02 7.45857574908e-03 6.32692063078e-03 - 1.14596764125e-02 1.69491736420e-02 2.59250062413e-02 3.67025276917e-02 4.58777097769e-02 5.06194135765e-02 - 5.04463447592e-02 4.67810667612e-02 4.14579289512e-02 3.58243136049e-02 3.06330408871e-02 2.62153172241e-02 - 2.26519365039e-02 1.99070659239e-02 1.79167348748e-02 1.66250325509e-02 1.59907282434e-02 1.59907282434e-02 - 1.66250325509e-02 1.79167348748e-02 1.99070659239e-02 2.26519365039e-02 2.62153172241e-02 3.06330408871e-02 - 3.58243136049e-02 4.14579289512e-02 4.67810667612e-02 5.04463447592e-02 5.06194135765e-02 4.58777097769e-02 - 3.67025276917e-02 2.59250062413e-02 1.69491736420e-02 1.14596764125e-02 9.13060134292e-03 9.13060134292e-03 - 1.93490286376e-02 2.59250062413e-02 3.45455630665e-02 4.27064575993e-02 4.76689314688e-02 4.83002627794e-02 - 4.53738413591e-02 4.04742233092e-02 3.49773595797e-02 2.97391273192e-02 2.51823253991e-02 2.14468462049e-02 - 1.85201445811e-02 1.63370205752e-02 1.48317912783e-02 1.39522993746e-02 1.36633879542e-02 1.39522993746e-02 - 1.48317912783e-02 1.63370205752e-02 1.85201445811e-02 2.14468462049e-02 2.51823253991e-02 2.97391273192e-02 - 3.49773595797e-02 4.04742233092e-02 4.53738413591e-02 4.83002627794e-02 4.76689314688e-02 4.27064575993e-02 - 3.45455630665e-02 2.59250062413e-02 1.93490286376e-02 1.56860392578e-02 1.45732066269e-02 1.56860392578e-02 - 3.07039905741e-02 3.67025276917e-02 4.27064575993e-02 4.65545163206e-02 4.69885184966e-02 4.42752514752e-02 - 3.96081166256e-02 3.42208946471e-02 2.89691250092e-02 2.43184216158e-02 2.04512222766e-02 1.73786828448e-02 - 1.50389831834e-02 1.33594815778e-02 1.22786655737e-02 1.17508350709e-02 1.17508350709e-02 1.22786655737e-02 - 1.33594815778e-02 1.50389831834e-02 1.73786828448e-02 2.04512222766e-02 2.43184216158e-02 2.89691250092e-02 - 3.42208946471e-02 3.96081166256e-02 4.42752514752e-02 4.69885184966e-02 4.65545163206e-02 4.27064575993e-02 - 3.67025276917e-02 3.07039905741e-02 2.63856510811e-02 2.42761411551e-02 2.42761411551e-02 2.63856510811e-02 - 4.26203265537e-02 4.58777097769e-02 4.76689314688e-02 4.69885184966e-02 4.38595264834e-02 3.90976289629e-02 - 3.36893635306e-02 2.83925891295e-02 2.36566460915e-02 1.96777557044e-02 1.64818809732e-02 1.40109856905e-02 - 1.21873907787e-02 1.09414577715e-02 1.02181471415e-02 9.98127039361e-03 1.02181471415e-02 1.09414577715e-02 - 1.21873907787e-02 1.40109856905e-02 1.64818809732e-02 1.96777557044e-02 2.36566460915e-02 2.83925891295e-02 - 3.36893635306e-02 3.90976289629e-02 4.38595264834e-02 4.69885184966e-02 4.76689314688e-02 4.58777097769e-02 - 4.26203265537e-02 3.93541671489e-02 3.71417160544e-02 3.63849623957e-02 3.71417160544e-02 3.93541671489e-02 - 5.12221625406e-02 5.06194135765e-02 4.83002627794e-02 4.42752514752e-02 3.90976289629e-02 3.34971688966e-02 - 2.80812943983e-02 2.32368358951e-02 1.91448778653e-02 1.58329883187e-02 1.32437842255e-02 1.12951380995e-02 - 9.91029781221e-03 9.02578945364e-03 8.59555582378e-03 8.59555582378e-03 9.02578945364e-03 9.91029781221e-03 - 1.12951380995e-02 1.32437842255e-02 1.58329883187e-02 1.91448778653e-02 2.32368358951e-02 2.80812943983e-02 - 3.34971688966e-02 3.90976289629e-02 4.42752514752e-02 4.83002627794e-02 5.06194135765e-02 5.12221625406e-02 - 5.07010770424e-02 4.98718618187e-02 4.93308963719e-02 4.93308963719e-02 4.98718618187e-02 5.07010770424e-02 - 5.43925934286e-02 5.04463447592e-02 4.53738413591e-02 3.96081166256e-02 3.36893635306e-02 2.80812943983e-02 - 2.30924993956e-02 1.88720574247e-02 1.54388806266e-02 1.27327884289e-02 1.06671499136e-02 9.15892896774e-03 - 8.13716815266e-03 7.54684340873e-03 7.35383003280e-03 7.54684340873e-03 8.13716815266e-03 9.15892896774e-03 - 1.06671499136e-02 1.27327884289e-02 1.54388806266e-02 1.88720574247e-02 2.30924993956e-02 2.80812943983e-02 - 3.36893635306e-02 3.96081166256e-02 4.53738413591e-02 5.04463447592e-02 5.43925934286e-02 5.70772559013e-02 - 5.86758842735e-02 5.94868177545e-02 5.97323039443e-02 5.94868177545e-02 5.86758842735e-02 5.70772559013e-02 - 5.26931433274e-02 4.67810667612e-02 4.04742233092e-02 3.42208946471e-02 2.83925891295e-02 2.32368358951e-02 - 1.88720574247e-02 1.53065353883e-02 1.24770996440e-02 1.02937156151e-02 8.66817035987e-03 7.52314503521e-03 - 6.79567554150e-03 6.44245195186e-03 6.44245195186e-03 6.79567554150e-03 7.52314503521e-03 8.66817035987e-03 - 1.02937156151e-02 1.24770996440e-02 1.53065353883e-02 1.88720574247e-02 2.32368358951e-02 2.83925891295e-02 - 3.42208946471e-02 4.04742233092e-02 4.67810667612e-02 5.26931433274e-02 5.77843769256e-02 6.17513938278e-02 - 6.44394828494e-02 6.57918464265e-02 6.57918464265e-02 6.44394828494e-02 6.17513938278e-02 5.77843769256e-02 - 4.80677366203e-02 4.14579289512e-02 3.49773595797e-02 2.89691250092e-02 2.36566460915e-02 1.91448778653e-02 - 1.54388806266e-02 1.24770996440e-02 1.01697655067e-02 8.42580807925e-03 7.16308508658e-03 6.31209415558e-03 - 5.82127807001e-03 5.66079261571e-03 5.82127807001e-03 6.31209415558e-03 7.16308508658e-03 8.42580807925e-03 - 1.01697655067e-02 1.24770996440e-02 1.54388806266e-02 1.91448778653e-02 2.36566460915e-02 2.89691250092e-02 - 3.49773595797e-02 4.14579289512e-02 4.80677366203e-02 5.43692149489e-02 5.98878714669e-02 6.41840706496e-02 - 6.69101294891e-02 6.78442738531e-02 6.69101294891e-02 6.41840706496e-02 5.98878714669e-02 5.43692149489e-02 - 4.23378898536e-02 3.58243136049e-02 2.97391273192e-02 2.43184216158e-02 1.96777557044e-02 1.58329883187e-02 - 1.27327884289e-02 1.02937156151e-02 8.42580807925e-03 7.04448483440e-03 6.07562992209e-03 5.46093720174e-03 - 5.16243150929e-03 5.16243150929e-03 5.46093720174e-03 6.07562992209e-03 7.04448483440e-03 8.42580807925e-03 - 1.02937156151e-02 1.27327884289e-02 1.58329883187e-02 1.96777557044e-02 2.43184216158e-02 2.97391273192e-02 - 3.58243136049e-02 4.23378898536e-02 4.89192305177e-02 5.51031089527e-02 6.03694423859e-02 6.42180018992e-02 - 6.62522137956e-02 6.62522137956e-02 6.42180018992e-02 6.03694423859e-02 5.51031089527e-02 4.89192305177e-02 - 3.66568505349e-02 3.06330408871e-02 2.51823253991e-02 2.04512222766e-02 1.64818809732e-02 1.32437842255e-02 - 1.06671499136e-02 8.66817035987e-03 7.16308508658e-03 6.07562992209e-03 5.34296096392e-03 4.92029966810e-03 - 4.78210810048e-03 4.92029966810e-03 5.34296096392e-03 6.07562992209e-03 7.16308508658e-03 8.66817035987e-03 - 1.06671499136e-02 1.32437842255e-02 1.64818809732e-02 2.04512222766e-02 2.51823253991e-02 3.06330408871e-02 - 3.66568505349e-02 4.29832635915e-02 4.92182336225e-02 5.48714786192e-02 5.94150808572e-02 6.23688231248e-02 - 6.33941825467e-02 6.23688231248e-02 5.94150808572e-02 5.48714786192e-02 4.92182336225e-02 4.29832635915e-02 - 3.16041856284e-02 2.62153172241e-02 2.14468462049e-02 1.73786828448e-02 1.40109856905e-02 1.12951380995e-02 - 9.15892896774e-03 7.52314503521e-03 6.31209415558e-03 5.46093720174e-03 4.92029966810e-03 4.65785937656e-03 - 4.65785937656e-03 4.92029966810e-03 5.46093720174e-03 6.31209415558e-03 7.52314503521e-03 9.15892896774e-03 - 1.12951380995e-02 1.40109856905e-02 1.73786828448e-02 2.14468462049e-02 2.62153172241e-02 3.16041856284e-02 - 3.74259862301e-02 4.33721592307e-02 4.90231496620e-02 5.38883507401e-02 5.74762428735e-02 5.93841418824e-02 - 5.93841418824e-02 5.74762428735e-02 5.38883507401e-02 4.90231496620e-02 4.33721592307e-02 3.74259862301e-02 - 2.73972646659e-02 2.26519365039e-02 1.85201445811e-02 1.50389831834e-02 1.21873907787e-02 9.91029781221e-03 - 8.13716815266e-03 6.79567554150e-03 5.82127807001e-03 5.16243150929e-03 4.78210810048e-03 4.65785937656e-03 - 4.78210810048e-03 5.16243150929e-03 5.82127807001e-03 6.79567554150e-03 8.13716815266e-03 9.91029781221e-03 - 1.21873907787e-02 1.50389831834e-02 1.85201445811e-02 2.26519365039e-02 2.73972646659e-02 3.26341221073e-02 - 3.81345549630e-02 4.35604474537e-02 4.84855850881e-02 5.24477482650e-02 5.50251512552e-02 5.59201471811e-02 - 5.50251512552e-02 5.24477482650e-02 4.84855850881e-02 4.35604474537e-02 3.81345549630e-02 3.26341221073e-02 - 2.40594329852e-02 1.99070659239e-02 1.63370205752e-02 1.33594815778e-02 1.09414577715e-02 9.02578945364e-03 - 7.54684340873e-03 6.44245195186e-03 5.66079261571e-03 5.16243150929e-03 4.92029966810e-03 4.92029966810e-03 - 5.16243150929e-03 5.66079261571e-03 6.44245195186e-03 7.54684340873e-03 9.02578945364e-03 1.09414577715e-02 - 1.33594815778e-02 1.63370205752e-02 1.99070659239e-02 2.40594329852e-02 2.87187367840e-02 3.37228748044e-02 - 3.88104397494e-02 4.36277000850e-02 4.77625301985e-02 5.08044555558e-02 5.24194501424e-02 5.24194501424e-02 - 5.08044555558e-02 4.77625301985e-02 4.36277000850e-02 3.88104397494e-02 3.37228748044e-02 2.87187367840e-02 - 2.15413174517e-02 1.79167348748e-02 1.48317912783e-02 1.22786655737e-02 1.02181471415e-02 8.59555582378e-03 - 7.35383003280e-03 6.44245195186e-03 5.82127807001e-03 5.46093720174e-03 5.34296096392e-03 5.46093720174e-03 - 5.82127807001e-03 6.44245195186e-03 7.35383003280e-03 8.59555582378e-03 1.02181471415e-02 1.22786655737e-02 - 1.48317912783e-02 1.79167348748e-02 2.15413174517e-02 2.56635113913e-02 3.01717861136e-02 3.48695445110e-02 - 3.94725484932e-02 4.36277000850e-02 4.69561004766e-02 4.91148354625e-02 4.98633146719e-02 4.91148354625e-02 - 4.69561004766e-02 4.36277000850e-02 3.94725484932e-02 3.48695445110e-02 3.01717861136e-02 2.56635113913e-02 - 1.97871783123e-02 1.66250325509e-02 1.39522993746e-02 1.17508350709e-02 9.98127039361e-03 8.59555582378e-03 - 7.54684340873e-03 6.79567554150e-03 6.31209415558e-03 6.07562992209e-03 6.07562992209e-03 6.31209415558e-03 - 6.79567554150e-03 7.54684340873e-03 8.59555582378e-03 9.98127039361e-03 1.17508350709e-02 1.39522993746e-02 - 1.66250325509e-02 1.97871783123e-02 2.34202555044e-02 2.74512061786e-02 3.17358390207e-02 3.60511821341e-02 - 4.01041807768e-02 4.35604474537e-02 4.60913389830e-02 4.74313143781e-02 4.74313143781e-02 4.60913389830e-02 - 4.35604474537e-02 4.01041807768e-02 3.60511821341e-02 3.17358390207e-02 2.74512061786e-02 2.34202555044e-02 - 1.87538902948e-02 1.59907282434e-02 1.36633879542e-02 1.17508350709e-02 1.02181471415e-02 9.02578945364e-03 - 8.13716815266e-03 7.52314503521e-03 7.16308508658e-03 7.04448483440e-03 7.16308508658e-03 7.52314503521e-03 - 8.13716815266e-03 9.02578945364e-03 1.02181471415e-02 1.17508350709e-02 1.36633879542e-02 1.59907282434e-02 - 1.87538902948e-02 2.19482820950e-02 2.55281844546e-02 2.93901320501e-02 3.33624200108e-02 3.72078996967e-02 - 4.06430475235e-02 4.33721592307e-02 4.51323632879e-02 4.57409612273e-02 4.51323632879e-02 4.33721592307e-02 - 4.06430475235e-02 3.72078996967e-02 3.33624200108e-02 2.93901320501e-02 2.55281844546e-02 2.19482820950e-02 - 1.84129279741e-02 1.59907282434e-02 1.39522993746e-02 1.22786655737e-02 1.09414577715e-02 9.91029781221e-03 - 9.15892896774e-03 8.66817035987e-03 8.42580807925e-03 8.42580807925e-03 8.66817035987e-03 9.15892896774e-03 - 9.91029781221e-03 1.09414577715e-02 1.22786655737e-02 1.39522993746e-02 1.59907282434e-02 1.84129279741e-02 - 2.12198093897e-02 2.43819637041e-02 2.78244998346e-02 3.14154606035e-02 3.49654910486e-02 3.82415861113e-02 - 4.09927131873e-02 4.29832635915e-02 4.40291518527e-02 4.40291518527e-02 4.29832635915e-02 4.09927131873e-02 - 3.82415861113e-02 3.49654910486e-02 3.14154606035e-02 2.78244998346e-02 2.43819637041e-02 2.12198093897e-02 - 1.87538902948e-02 1.66250325509e-02 1.48317912783e-02 1.33594815778e-02 1.21873907787e-02 1.12951380995e-02 - 1.06671499136e-02 1.02937156151e-02 1.01697655067e-02 1.02937156151e-02 1.06671499136e-02 1.12951380995e-02 - 1.21873907787e-02 1.33594815778e-02 1.48317912783e-02 1.66250325509e-02 1.87538902948e-02 2.12198093897e-02 - 2.40011711299e-02 2.70402901784e-02 3.02323588099e-02 3.34242157073e-02 3.64263171972e-02 3.90347179512e-02 - 4.10571769449e-02 4.23378898536e-02 4.27763236460e-02 4.23378898536e-02 4.10571769449e-02 3.90347179512e-02 - 3.64263171972e-02 3.34242157073e-02 3.02323588099e-02 2.70402901784e-02 2.40011711299e-02 2.12198093897e-02 - 1.97871783123e-02 1.79167348748e-02 1.63370205752e-02 1.50389831834e-02 1.40109856905e-02 1.32437842255e-02 - 1.27327884289e-02 1.24770996440e-02 1.24770996440e-02 1.27327884289e-02 1.32437842255e-02 1.40109856905e-02 - 1.50389831834e-02 1.63370205752e-02 1.79167348748e-02 1.97871783123e-02 2.19482820950e-02 2.43819637041e-02 - 2.70402901784e-02 2.98349904445e-02 3.26363277502e-02 3.52857897121e-02 3.76190713504e-02 3.94908104948e-02 - 4.07924714489e-02 4.14579289512e-02 4.14579289512e-02 4.07924714489e-02 3.94908104948e-02 3.76190713504e-02 - 3.52857897121e-02 3.26363277502e-02 2.98349904445e-02 2.70402901784e-02 2.43819637041e-02 2.19482820950e-02 - 2.15413174517e-02 1.99070659239e-02 1.85201445811e-02 1.73786828448e-02 1.64818809732e-02 1.58329883187e-02 - 1.54388806266e-02 1.53065353883e-02 1.54388806266e-02 1.58329883187e-02 1.64818809732e-02 1.73786828448e-02 - 1.85201445811e-02 1.99070659239e-02 2.15413174517e-02 2.34202555044e-02 2.55281844546e-02 2.78244998346e-02 - 3.02323588099e-02 3.26363277502e-02 3.48956024912e-02 3.68707660171e-02 3.84534160516e-02 3.95849180057e-02 - 4.02540981079e-02 4.04742233092e-02 4.02540981079e-02 3.95849180057e-02 3.84534160516e-02 3.68707660171e-02 - 3.48956024912e-02 3.26363277502e-02 3.02323588099e-02 2.78244998346e-02 2.55281844546e-02 2.34202555044e-02 - 2.40594329852e-02 2.26519365039e-02 2.14468462049e-02 2.04512222766e-02 1.96777557044e-02 1.91448778653e-02 - 1.88720574247e-02 1.88720574247e-02 1.91448778653e-02 1.96777557044e-02 2.04512222766e-02 2.14468462049e-02 - 2.26519365039e-02 2.40594329852e-02 2.56635113913e-02 2.74512061786e-02 2.93901320501e-02 3.14154606035e-02 - 3.34242157073e-02 3.52857897121e-02 3.68707660171e-02 3.80886538087e-02 3.89160663350e-02 3.93968315223e-02 - 3.96081166256e-02 3.96081166256e-02 3.93968315223e-02 3.89160663350e-02 3.80886538087e-02 3.68707660171e-02 - 3.52857897121e-02 3.34242157073e-02 3.14154606035e-02 2.93901320501e-02 2.74512061786e-02 2.56635113913e-02 - 2.73972646659e-02 2.62153172241e-02 2.51823253991e-02 2.43184216158e-02 2.36566460915e-02 2.32368358951e-02 - 2.30924993956e-02 2.32368358951e-02 2.36566460915e-02 2.43184216158e-02 2.51823253991e-02 2.62153172241e-02 - 2.73972646659e-02 2.87187367840e-02 3.01717861136e-02 3.17358390207e-02 3.33624200108e-02 3.49654910486e-02 - 3.64263171972e-02 3.76190713504e-02 3.84534160516e-02 3.89160663350e-02 3.90848689472e-02 3.90976289629e-02 - 3.90842281235e-02 3.90976289629e-02 3.90848689472e-02 3.89160663350e-02 3.84534160516e-02 3.76190713504e-02 - 3.64263171972e-02 3.49654910486e-02 3.33624200108e-02 3.17358390207e-02 3.01717861136e-02 2.87187367840e-02 - 3.16041856284e-02 3.06330408871e-02 2.97391273192e-02 2.89691250092e-02 2.83925891295e-02 2.80812943983e-02 - 2.80812943983e-02 2.83925891295e-02 2.89691250092e-02 2.97391273192e-02 3.06330408871e-02 3.16041856284e-02 - 3.26341221073e-02 3.37228748044e-02 3.48695445110e-02 3.60511821341e-02 3.72078996967e-02 3.82415861113e-02 - 3.90347179512e-02 3.94908104948e-02 3.95849180057e-02 3.93968315223e-02 3.90976289629e-02 3.88830541657e-02 - 3.88830541657e-02 3.90976289629e-02 3.93968315223e-02 3.95849180057e-02 3.94908104948e-02 3.90347179512e-02 - 3.82415861113e-02 3.72078996967e-02 3.60511821341e-02 3.48695445110e-02 3.37228748044e-02 3.26341221073e-02 - 3.66568505349e-02 3.58243136049e-02 3.49773595797e-02 3.42208946471e-02 3.36893635306e-02 3.34971688966e-02 - 3.36893635306e-02 3.42208946471e-02 3.49773595797e-02 3.58243136049e-02 3.66568505349e-02 3.74259862301e-02 - 3.81345549630e-02 3.88104397494e-02 3.94725484932e-02 4.01041807768e-02 4.06430475235e-02 4.09927131873e-02 - 4.10571769449e-02 4.07924714489e-02 4.02540981079e-02 3.96081166256e-02 3.90842281235e-02 3.88830541657e-02 - 3.90842281235e-02 3.96081166256e-02 4.02540981079e-02 4.07924714489e-02 4.10571769449e-02 4.09927131873e-02 - 4.06430475235e-02 4.01041807768e-02 3.94725484932e-02 3.88104397494e-02 3.81345549630e-02 3.74259862301e-02 - 4.23378898536e-02 4.14579289512e-02 4.04742233092e-02 3.96081166256e-02 3.90976289629e-02 3.90976289629e-02 - 3.96081166256e-02 4.04742233092e-02 4.14579289512e-02 4.23378898536e-02 4.29832635915e-02 4.33721592307e-02 - 4.35604474537e-02 4.36277000850e-02 4.36277000850e-02 4.35604474537e-02 4.33721592307e-02 4.29832635915e-02 - 4.23378898536e-02 4.14579289512e-02 4.04742233092e-02 3.96081166256e-02 3.90976289629e-02 3.90976289629e-02 - 3.96081166256e-02 4.04742233092e-02 4.14579289512e-02 4.23378898536e-02 4.29832635915e-02 4.33721592307e-02 - 4.35604474537e-02 4.36277000850e-02 4.36277000850e-02 4.35604474537e-02 4.33721592307e-02 4.29832635915e-02 - 4.80677366203e-02 4.67810667612e-02 4.53738413591e-02 4.42752514752e-02 4.38595264834e-02 4.42752514752e-02 - 4.53738413591e-02 4.67810667612e-02 4.80677366203e-02 4.89192305177e-02 4.92182336225e-02 4.90231496620e-02 - 4.84855850881e-02 4.77625301985e-02 4.69561004766e-02 4.60913389830e-02 4.51323632879e-02 4.40291518527e-02 - 4.27763236460e-02 4.14579289512e-02 4.02540981079e-02 3.93968315223e-02 3.90848689472e-02 3.93968315223e-02 - 4.02540981079e-02 4.14579289512e-02 4.27763236460e-02 4.40291518527e-02 4.51323632879e-02 4.60913389830e-02 - 4.69561004766e-02 4.77625301985e-02 4.84855850881e-02 4.90231496620e-02 4.92182336225e-02 4.89192305177e-02 - 5.26931433274e-02 5.04463447592e-02 4.83002627794e-02 4.69885184966e-02 4.69885184966e-02 4.83002627794e-02 - 5.04463447592e-02 5.26931433274e-02 5.43692149489e-02 5.51031089527e-02 5.48714786192e-02 5.38883507401e-02 - 5.24477482650e-02 5.08044555558e-02 4.91148354625e-02 4.74313143781e-02 4.57409612273e-02 4.40291518527e-02 - 4.23378898536e-02 4.07924714489e-02 3.95849180057e-02 3.89160663350e-02 3.89160663350e-02 3.95849180057e-02 - 4.07924714489e-02 4.23378898536e-02 4.40291518527e-02 4.57409612273e-02 4.74313143781e-02 4.91148354625e-02 - 5.08044555558e-02 5.24477482650e-02 5.38883507401e-02 5.48714786192e-02 5.51031089527e-02 5.43692149489e-02 - 5.43925934286e-02 5.06194135765e-02 4.76689314688e-02 4.65545163206e-02 4.76689314688e-02 5.06194135765e-02 - 5.43925934286e-02 5.77843769256e-02 5.98878714669e-02 6.03694423859e-02 5.94150808572e-02 5.74762428735e-02 - 5.50251512552e-02 5.24194501424e-02 4.98633146719e-02 4.74313143781e-02 4.51323632879e-02 4.29832635915e-02 - 4.10571769449e-02 3.94908104948e-02 3.84534160516e-02 3.80886538087e-02 3.84534160516e-02 3.94908104948e-02 - 4.10571769449e-02 4.29832635915e-02 4.51323632879e-02 4.74313143781e-02 4.98633146719e-02 5.24194501424e-02 - 5.50251512552e-02 5.74762428735e-02 5.94150808572e-02 6.03694423859e-02 5.98878714669e-02 5.77843769256e-02 - 5.12221625406e-02 4.58777097769e-02 4.27064575993e-02 4.27064575993e-02 4.58777097769e-02 5.12221625406e-02 - 5.70772559013e-02 6.17513938278e-02 6.41840706496e-02 6.42180018992e-02 6.23688231248e-02 5.93841418824e-02 - 5.59201471811e-02 5.24194501424e-02 4.91148354625e-02 4.60913389830e-02 4.33721592307e-02 4.09927131873e-02 - 3.90347179512e-02 3.76190713504e-02 3.68707660171e-02 3.68707660171e-02 3.76190713504e-02 3.90347179512e-02 - 4.09927131873e-02 4.33721592307e-02 4.60913389830e-02 4.91148354625e-02 5.24194501424e-02 5.59201471811e-02 - 5.93841418824e-02 6.23688231248e-02 6.42180018992e-02 6.41840706496e-02 6.17513938278e-02 5.70772559013e-02 - 4.26203265537e-02 3.67025276917e-02 3.45455630665e-02 3.67025276917e-02 4.26203265537e-02 5.07010770424e-02 - 5.86758842735e-02 6.44394828494e-02 6.69101294891e-02 6.62522137956e-02 6.33941825467e-02 5.93841418824e-02 - 5.50251512552e-02 5.08044555558e-02 4.69561004766e-02 4.35604474537e-02 4.06430475235e-02 3.82415861113e-02 - 3.64263171972e-02 3.52857897121e-02 3.48956024912e-02 3.52857897121e-02 3.64263171972e-02 3.82415861113e-02 - 4.06430475235e-02 4.35604474537e-02 4.69561004766e-02 5.08044555558e-02 5.50251512552e-02 5.93841418824e-02 - 6.33941825467e-02 6.62522137956e-02 6.69101294891e-02 6.44394828494e-02 5.86758842735e-02 5.07010770424e-02 - 3.07039905741e-02 2.59250062413e-02 2.59250062413e-02 3.07039905741e-02 3.93541671489e-02 4.98718618187e-02 - 5.94868177545e-02 6.57918464265e-02 6.78442738531e-02 6.62522137956e-02 6.23688231248e-02 5.74762428735e-02 - 5.24477482650e-02 4.77625301985e-02 4.36277000850e-02 4.01041807768e-02 3.72078996967e-02 3.49654910486e-02 - 3.34242157073e-02 3.26363277502e-02 3.26363277502e-02 3.34242157073e-02 3.49654910486e-02 3.72078996967e-02 - 4.01041807768e-02 4.36277000850e-02 4.77625301985e-02 5.24477482650e-02 5.74762428735e-02 6.23688231248e-02 - 6.62522137956e-02 6.78442738531e-02 6.57918464265e-02 5.94868177545e-02 4.98718618187e-02 3.93541671489e-02 - 1.93490286376e-02 1.69491736420e-02 1.93490286376e-02 2.63856510811e-02 3.71417160544e-02 4.93308963719e-02 - 5.97323039443e-02 6.57918464265e-02 6.69101294891e-02 6.42180018992e-02 5.94150808572e-02 5.38883507401e-02 - 4.84855850881e-02 4.36277000850e-02 3.94725484932e-02 3.60511821341e-02 3.33624200108e-02 3.14154606035e-02 - 3.02323588099e-02 2.98349904445e-02 3.02323588099e-02 3.14154606035e-02 3.33624200108e-02 3.60511821341e-02 - 3.94725484932e-02 4.36277000850e-02 4.84855850881e-02 5.38883507401e-02 5.94150808572e-02 6.42180018992e-02 - 6.69101294891e-02 6.57918464265e-02 5.97323039443e-02 4.93308963719e-02 3.71417160544e-02 2.63856510811e-02 - 1.14596764125e-02 1.14596764125e-02 1.56860392578e-02 2.42761411551e-02 3.63849623957e-02 4.93308963719e-02 - 5.94868177545e-02 6.44394828494e-02 6.41840706496e-02 6.03694423859e-02 5.48714786192e-02 4.90231496620e-02 - 4.35604474537e-02 3.88104397494e-02 3.48695445110e-02 3.17358390207e-02 2.93901320501e-02 2.78244998346e-02 - 2.70402901784e-02 2.70402901784e-02 2.78244998346e-02 2.93901320501e-02 3.17358390207e-02 3.48695445110e-02 - 3.88104397494e-02 4.35604474537e-02 4.90231496620e-02 5.48714786192e-02 6.03694423859e-02 6.41840706496e-02 - 6.44394828494e-02 5.94868177545e-02 4.93308963719e-02 3.63849623957e-02 2.42761411551e-02 1.56860392578e-02 - 7.45857574908e-03 9.13060134292e-03 1.45732066269e-02 2.42761411551e-02 3.71417160544e-02 4.98718618187e-02 - 5.86758842735e-02 6.17513938278e-02 5.98878714669e-02 5.51031089527e-02 4.92182336225e-02 4.33721592307e-02 - 3.81345549630e-02 3.37228748044e-02 3.01717861136e-02 2.74512061786e-02 2.55281844546e-02 2.43819637041e-02 - 2.40011711299e-02 2.43819637041e-02 2.55281844546e-02 2.74512061786e-02 3.01717861136e-02 3.37228748044e-02 - 3.81345549630e-02 4.33721592307e-02 4.92182336225e-02 5.51031089527e-02 5.98878714669e-02 6.17513938278e-02 - 5.86758842735e-02 4.98718618187e-02 3.71417160544e-02 2.42761411551e-02 1.45732066269e-02 9.13060134292e-03 - 6.32692063078e-03 9.13060134292e-03 1.56860392578e-02 2.63856510811e-02 3.93541671489e-02 5.07010770424e-02 - 5.70772559013e-02 5.77843769256e-02 5.43692149489e-02 4.89192305177e-02 4.29832635915e-02 3.74259862301e-02 - 3.26341221073e-02 2.87187367840e-02 2.56635113913e-02 2.34202555044e-02 2.19482820950e-02 2.12198093897e-02 - 2.12198093897e-02 2.19482820950e-02 2.34202555044e-02 2.56635113913e-02 2.87187367840e-02 3.26341221073e-02 - 3.74259862301e-02 4.29832635915e-02 4.89192305177e-02 5.43692149489e-02 5.77843769256e-02 5.70772559013e-02 - 5.07010770424e-02 3.93541671489e-02 2.63856510811e-02 1.56860392578e-02 9.13060134292e-03 6.32692063078e-03 - 1.69819929531e-02 2.23413746600e-02 3.07039905741e-02 4.02808330656e-02 4.79609401864e-02 5.13869204668e-02 - 5.03535465114e-02 4.62623331670e-02 4.07924714489e-02 3.51532871168e-02 3.00149219248e-02 2.56657154446e-02 - 2.21666114252e-02 1.94746684497e-02 1.75241772421e-02 1.62588522549e-02 1.56375665721e-02 1.56375665721e-02 - 1.62588522549e-02 1.75241772421e-02 1.94746684497e-02 2.21666114252e-02 2.56657154446e-02 3.00149219248e-02 - 3.51532871168e-02 4.07924714489e-02 4.62623331670e-02 5.03535465114e-02 5.13869204668e-02 4.79609401864e-02 - 4.02808330656e-02 3.07039905741e-02 2.23413746600e-02 1.69819929531e-02 1.46090879135e-02 1.46090879135e-02 - 2.23413746600e-02 2.86292518106e-02 3.67025276917e-02 4.41366450522e-02 4.83941231678e-02 4.85080722970e-02 - 4.52857661696e-02 4.02540981079e-02 3.47182328687e-02 2.94854041377e-02 2.49511167951e-02 2.12413612776e-02 - 1.83376793613e-02 1.61729889157e-02 1.46810426016e-02 1.38094745262e-02 1.35231772103e-02 1.38094745262e-02 - 1.46810426016e-02 1.61729889157e-02 1.83376793613e-02 2.12413612776e-02 2.49511167951e-02 2.94854041377e-02 - 3.47182328687e-02 4.02540981079e-02 4.52857661696e-02 4.85080722970e-02 4.83941231678e-02 4.41366450522e-02 - 3.67025276917e-02 2.86292518106e-02 2.23413746600e-02 1.87771308641e-02 1.76819501362e-02 1.87771308641e-02 - 3.07039905741e-02 3.67025276917e-02 4.27064575993e-02 4.65545163206e-02 4.69885184966e-02 4.42752514752e-02 - 3.96081166256e-02 3.42208946471e-02 2.89691250092e-02 2.43184216158e-02 2.04512222766e-02 1.73786828448e-02 - 1.50389831834e-02 1.33594815778e-02 1.22786655737e-02 1.17508350709e-02 1.17508350709e-02 1.22786655737e-02 - 1.33594815778e-02 1.50389831834e-02 1.73786828448e-02 2.04512222766e-02 2.43184216158e-02 2.89691250092e-02 - 3.42208946471e-02 3.96081166256e-02 4.42752514752e-02 4.69885184966e-02 4.65545163206e-02 4.27064575993e-02 - 3.67025276917e-02 3.07039905741e-02 2.63856510811e-02 2.42761411551e-02 2.42761411551e-02 2.63856510811e-02 - 4.02808330656e-02 4.41366450522e-02 4.65545163206e-02 4.64020316983e-02 4.36365698621e-02 3.90842281235e-02 - 3.37780927799e-02 2.85205562719e-02 2.37914166767e-02 1.98052910067e-02 1.65980023724e-02 1.41157952825e-02 - 1.22825573408e-02 1.10293847869e-02 1.03016601350e-02 1.00633149755e-02 1.03016601350e-02 1.10293847869e-02 - 1.22825573408e-02 1.41157952825e-02 1.65980023724e-02 1.98052910067e-02 2.37914166767e-02 2.85205562719e-02 - 3.37780927799e-02 3.90842281235e-02 4.36365698621e-02 4.64020316983e-02 4.65545163206e-02 4.41366450522e-02 - 4.02808330656e-02 3.65582592974e-02 3.40771392673e-02 3.32338776264e-02 3.40771392673e-02 3.65582592974e-02 - 4.79609401864e-02 4.83941231678e-02 4.69885184966e-02 4.36365698621e-02 3.88830541657e-02 3.35158471123e-02 - 2.82105864296e-02 2.34067395586e-02 1.93203741197e-02 1.59997599900e-02 1.33976732300e-02 1.14361707830e-02 - 1.00404664762e-02 9.14830218340e-03 8.71419097250e-03 8.71419097250e-03 9.14830218340e-03 1.00404664762e-02 - 1.14361707830e-02 1.33976732300e-02 1.59997599900e-02 1.93203741197e-02 2.34067395586e-02 2.82105864296e-02 - 3.35158471123e-02 3.88830541657e-02 4.36365698621e-02 4.69885184966e-02 4.83941231678e-02 4.79609401864e-02 - 4.64751950426e-02 4.49279278957e-02 4.40123223759e-02 4.40123223759e-02 4.49279278957e-02 4.64751950426e-02 - 5.13869204668e-02 4.85080722970e-02 4.42752514752e-02 3.90842281235e-02 3.35158471123e-02 2.80994006567e-02 - 2.32023283361e-02 1.90175139009e-02 1.55924938344e-02 1.28827341282e-02 1.08088949298e-02 9.29162040305e-03 - 8.26229038338e-03 7.66717366082e-03 7.47255069610e-03 7.66717366082e-03 8.26229038338e-03 9.29162040305e-03 - 1.08088949298e-02 1.28827341282e-02 1.55924938344e-02 1.90175139009e-02 2.32023283361e-02 2.80994006567e-02 - 3.35158471123e-02 3.90842281235e-02 4.42752514752e-02 4.85080722970e-02 5.13869204668e-02 5.29210396854e-02 - 5.34983990182e-02 5.36143814352e-02 5.36149267734e-02 5.36143814352e-02 5.34983990182e-02 5.29210396854e-02 - 5.03535465114e-02 4.52857661696e-02 3.96081166256e-02 3.37780927799e-02 2.82105864296e-02 2.32023283361e-02 - 1.89142861556e-02 1.53857855201e-02 1.25723726562e-02 1.03937663652e-02 8.76725594498e-03 7.61927184895e-03 - 6.88914005847e-03 6.53448601861e-03 6.53448601861e-03 6.88914005847e-03 7.61927184895e-03 8.76725594498e-03 - 1.03937663652e-02 1.25723726562e-02 1.53857855201e-02 1.89142861556e-02 2.32023283361e-02 2.82105864296e-02 - 3.37780927799e-02 3.96081166256e-02 4.52857661696e-02 5.03535465114e-02 5.44475263977e-02 5.74105494947e-02 - 5.92810318582e-02 6.01752681104e-02 6.01752681104e-02 5.92810318582e-02 5.74105494947e-02 5.44475263977e-02 - 4.62623331670e-02 4.02540981079e-02 3.42208946471e-02 2.85205562719e-02 2.34067395586e-02 1.90175139009e-02 - 1.53857855201e-02 1.24686371753e-02 1.01870819285e-02 8.45686847188e-03 7.20097316500e-03 6.35335851926e-03 - 5.86418256271e-03 5.70420021497e-03 5.86418256271e-03 6.35335851926e-03 7.20097316500e-03 8.45686847188e-03 - 1.01870819285e-02 1.24686371753e-02 1.53857855201e-02 1.90175139009e-02 2.34067395586e-02 2.85205562719e-02 - 3.42208946471e-02 4.02540981079e-02 4.62623331670e-02 5.18281863755e-02 5.65511919643e-02 6.01184381094e-02 - 6.23288110708e-02 6.30764730892e-02 6.23288110708e-02 6.01184381094e-02 5.65511919643e-02 5.18281863755e-02 - 4.07924714489e-02 3.47182328687e-02 2.89691250092e-02 2.37914166767e-02 1.93203741197e-02 1.55924938344e-02 - 1.25723726562e-02 1.01870819285e-02 8.35413904759e-03 6.99504538611e-03 6.04016501968e-03 5.43377044817e-03 - 5.13913617973e-03 5.13913617973e-03 5.43377044817e-03 6.04016501968e-03 6.99504538611e-03 8.35413904759e-03 - 1.01870819285e-02 1.25723726562e-02 1.55924938344e-02 1.93203741197e-02 2.37914166767e-02 2.89691250092e-02 - 3.47182328687e-02 4.07924714489e-02 4.68401774785e-02 5.24339557043e-02 5.71251588417e-02 6.05090723285e-02 - 6.22821499923e-02 6.22821499923e-02 6.05090723285e-02 5.71251588417e-02 5.24339557043e-02 4.68401774785e-02 - 3.51532871168e-02 2.94854041377e-02 2.43184216158e-02 1.98052910067e-02 1.59997599900e-02 1.28827341282e-02 - 1.03937663652e-02 8.45686847188e-03 6.99504538611e-03 5.93719631865e-03 5.22371135458e-03 4.81172327806e-03 - 4.67692793169e-03 4.81172327806e-03 5.22371135458e-03 5.93719631865e-03 6.99504538611e-03 8.45686847188e-03 - 1.03937663652e-02 1.28827341282e-02 1.59997599900e-02 1.98052910067e-02 2.43184216158e-02 2.94854041377e-02 - 3.51532871168e-02 4.10571769449e-02 4.68264624901e-02 5.20147259753e-02 5.61547897924e-02 5.88318176265e-02 - 5.97584596222e-02 5.88318176265e-02 5.61547897924e-02 5.20147259753e-02 4.68264624901e-02 4.10571769449e-02 - 3.00149219248e-02 2.49511167951e-02 2.04512222766e-02 1.65980023724e-02 1.33976732300e-02 1.08088949298e-02 - 8.76725594498e-03 7.20097316500e-03 6.04016501968e-03 5.22371135458e-03 4.70458873539e-03 4.45230019628e-03 - 4.45230019628e-03 4.70458873539e-03 5.22371135458e-03 6.04016501968e-03 7.20097316500e-03 8.76725594498e-03 - 1.08088949298e-02 1.33976732300e-02 1.65980023724e-02 2.04512222766e-02 2.49511167951e-02 3.00149219248e-02 - 3.54595415232e-02 4.09927131873e-02 4.62258246981e-02 5.07121410456e-02 5.40097122002e-02 5.57595749637e-02 - 5.57595749637e-02 5.40097122002e-02 5.07121410456e-02 4.62258246981e-02 4.09927131873e-02 3.54595415232e-02 - 2.56657154446e-02 2.12413612776e-02 1.73786828448e-02 1.41157952825e-02 1.14361707830e-02 9.29162040305e-03 - 7.61927184895e-03 6.35335851926e-03 5.43377044817e-03 4.81172327806e-03 4.45230019628e-03 4.33477840900e-03 - 4.45230019628e-03 4.81172327806e-03 5.43377044817e-03 6.35335851926e-03 7.61927184895e-03 9.29162040305e-03 - 1.14361707830e-02 1.41157952825e-02 1.73786828448e-02 2.12413612776e-02 2.56657154446e-02 3.05340710560e-02 - 3.56312088557e-02 4.06430475235e-02 4.51788789706e-02 4.88190878681e-02 5.11831265828e-02 5.20033431247e-02 - 5.11831265828e-02 4.88190878681e-02 4.51788789706e-02 4.06430475235e-02 3.56312088557e-02 3.05340710560e-02 - 2.21666114252e-02 1.83376793613e-02 1.50389831834e-02 1.22825573408e-02 1.00404664762e-02 8.26229038338e-03 - 6.88914005847e-03 5.86418256271e-03 5.13913617973e-03 4.67692793169e-03 4.45230019628e-03 4.45230019628e-03 - 4.67692793169e-03 5.13913617973e-03 5.86418256271e-03 6.88914005847e-03 8.26229038338e-03 1.00404664762e-02 - 1.22825573408e-02 1.50389831834e-02 1.83376793613e-02 2.21666114252e-02 2.64534808200e-02 3.10465495213e-02 - 3.57044700685e-02 4.01041807768e-02 4.38725463784e-02 4.66403070569e-02 4.81082332430e-02 4.81082332430e-02 - 4.66403070569e-02 4.38725463784e-02 4.01041807768e-02 3.57044700685e-02 3.10465495213e-02 2.64534808200e-02 - 1.94746684497e-02 1.61729889157e-02 1.33594815778e-02 1.10293847869e-02 9.14830218340e-03 7.66717366082e-03 - 6.53448601861e-03 5.70420021497e-03 5.13913617973e-03 4.81172327806e-03 4.70458873539e-03 4.81172327806e-03 - 5.13913617973e-03 5.70420021497e-03 6.53448601861e-03 7.66717366082e-03 9.14830218340e-03 1.10293847869e-02 - 1.33594815778e-02 1.61729889157e-02 1.94746684497e-02 2.32231030162e-02 2.73140021666e-02 3.15673758761e-02 - 3.57259716101e-02 3.94725484932e-02 4.24686468881e-02 4.44094609233e-02 4.50819394473e-02 4.44094609233e-02 - 4.24686468881e-02 3.94725484932e-02 3.57259716101e-02 3.15673758761e-02 2.73140021666e-02 2.32231030162e-02 - 1.75241772421e-02 1.46810426016e-02 1.22786655737e-02 1.03016601350e-02 8.71419097250e-03 7.47255069610e-03 - 6.53448601861e-03 5.86418256271e-03 5.43377044817e-03 5.22371135458e-03 5.22371135458e-03 5.43377044817e-03 - 5.86418256271e-03 6.53448601861e-03 7.47255069610e-03 8.71419097250e-03 1.03016601350e-02 1.22786655737e-02 - 1.46810426016e-02 1.75241772421e-02 2.07887392229e-02 2.44059448105e-02 2.82446089484e-02 3.21049723875e-02 - 3.57259716101e-02 3.88104397494e-02 4.10670403681e-02 4.22610610741e-02 4.22610610741e-02 4.10670403681e-02 - 3.88104397494e-02 3.57259716101e-02 3.21049723875e-02 2.82446089484e-02 2.44059448105e-02 2.07887392229e-02 - 1.62588522549e-02 1.38094745262e-02 1.17508350709e-02 1.00633149755e-02 8.71419097250e-03 7.66717366082e-03 - 6.88914005847e-03 6.35335851926e-03 6.04016501968e-03 5.93719631865e-03 6.04016501968e-03 6.35335851926e-03 - 6.88914005847e-03 7.66717366082e-03 8.71419097250e-03 1.00633149755e-02 1.17508350709e-02 1.38094745262e-02 - 1.62588522549e-02 1.90940368490e-02 2.22726314479e-02 2.57019293917e-02 2.92302840650e-02 3.26483588385e-02 - 3.57044700685e-02 3.81345549630e-02 3.97029159910e-02 4.02453701311e-02 3.97029159910e-02 3.81345549630e-02 - 3.57044700685e-02 3.26483588385e-02 2.92302840650e-02 2.57019293917e-02 2.22726314479e-02 1.90940368490e-02 - 1.56375665721e-02 1.35231772103e-02 1.17508350709e-02 1.03016601350e-02 9.14830218340e-03 8.26229038338e-03 - 7.61927184895e-03 7.20097316500e-03 6.99504538611e-03 6.99504538611e-03 7.20097316500e-03 7.61927184895e-03 - 8.26229038338e-03 9.14830218340e-03 1.03016601350e-02 1.17508350709e-02 1.35231772103e-02 1.56375665721e-02 - 1.80960146721e-02 2.08735527936e-02 2.39063871143e-02 2.70818268649e-02 3.02357338101e-02 3.31615306069e-02 - 3.56312088557e-02 3.74259862301e-02 3.83718132369e-02 3.83718132369e-02 3.74259862301e-02 3.56312088557e-02 - 3.31615306069e-02 3.02357338101e-02 2.70818268649e-02 2.39063871143e-02 2.08735527936e-02 1.80960146721e-02 - 1.56375665721e-02 1.38094745262e-02 1.22786655737e-02 1.10293847869e-02 1.00404664762e-02 9.29162040305e-03 - 8.76725594498e-03 8.45686847188e-03 8.35413904759e-03 8.45686847188e-03 8.76725594498e-03 9.29162040305e-03 - 1.00404664762e-02 1.10293847869e-02 1.22786655737e-02 1.38094745262e-02 1.56375665721e-02 1.77666865554e-02 - 2.01812628043e-02 2.28368095394e-02 2.56499234494e-02 2.84935612207e-02 3.12022017908e-02 3.35871770820e-02 - 3.54595415232e-02 3.66568505349e-02 3.70689589239e-02 3.66568505349e-02 3.54595415232e-02 3.35871770820e-02 - 3.12022017908e-02 2.84935612207e-02 2.56499234494e-02 2.28368095394e-02 2.01812628043e-02 1.77666865554e-02 - 1.62588522549e-02 1.46810426016e-02 1.33594815778e-02 1.22825573408e-02 1.14361707830e-02 1.08088949298e-02 - 1.03937663652e-02 1.01870819285e-02 1.01870819285e-02 1.03937663652e-02 1.08088949298e-02 1.14361707830e-02 - 1.22825573408e-02 1.33594815778e-02 1.46810426016e-02 1.62588522549e-02 1.80960146721e-02 2.01812628043e-02 - 2.24815496090e-02 2.49333108373e-02 2.74372089612e-02 2.98615217076e-02 3.20546920774e-02 3.38635928392e-02 - 3.51532871168e-02 3.58243136049e-02 3.58243136049e-02 3.51532871168e-02 3.38635928392e-02 3.20546920774e-02 - 2.98615217076e-02 2.74372089612e-02 2.49333108373e-02 2.24815496090e-02 2.01812628043e-02 1.80960146721e-02 - 1.75241772421e-02 1.61729889157e-02 1.50389831834e-02 1.41157952825e-02 1.33976732300e-02 1.28827341282e-02 - 1.25723726562e-02 1.24686371753e-02 1.25723726562e-02 1.28827341282e-02 1.33976732300e-02 1.41157952825e-02 - 1.50389831834e-02 1.61729889157e-02 1.75241772421e-02 1.90940368490e-02 2.08735527936e-02 2.28368095394e-02 - 2.49333108373e-02 2.70827915169e-02 2.91781605866e-02 3.10978190541e-02 3.27229087590e-02 3.39533984936e-02 - 3.47182328687e-02 3.49773595797e-02 3.47182328687e-02 3.39533984936e-02 3.27229087590e-02 3.10978190541e-02 - 2.91781605866e-02 2.70827915169e-02 2.49333108373e-02 2.28368095394e-02 2.08735527936e-02 1.90940368490e-02 - 1.94746684497e-02 1.83376793613e-02 1.73786828448e-02 1.65980023724e-02 1.59997599900e-02 1.55924938344e-02 - 1.53857855201e-02 1.53857855201e-02 1.55924938344e-02 1.59997599900e-02 1.65980023724e-02 1.73786828448e-02 - 1.83376793613e-02 1.94746684497e-02 2.07887392229e-02 2.22726314479e-02 2.39063871143e-02 2.56499234494e-02 - 2.74372089612e-02 2.91781605866e-02 3.07715106065e-02 3.21243272248e-02 3.31691643222e-02 3.38709874542e-02 - 3.42208946471e-02 3.42208946471e-02 3.38709874542e-02 3.31691643222e-02 3.21243272248e-02 3.07715106065e-02 - 2.91781605866e-02 2.74372089612e-02 2.56499234494e-02 2.39063871143e-02 2.22726314479e-02 2.07887392229e-02 - 2.21666114252e-02 2.12413612776e-02 2.04512222766e-02 1.98052910067e-02 1.93203741197e-02 1.90175139009e-02 - 1.89142861556e-02 1.90175139009e-02 1.93203741197e-02 1.98052910067e-02 2.04512222766e-02 2.12413612776e-02 - 2.21666114252e-02 2.32231030162e-02 2.44059448105e-02 2.57019293917e-02 2.70818268649e-02 2.84935612207e-02 - 2.98615217076e-02 3.10978190541e-02 3.21243272248e-02 3.28952522339e-02 3.34071767353e-02 3.36893635306e-02 - 3.37780927799e-02 3.36893635306e-02 3.34071767353e-02 3.28952522339e-02 3.21243272248e-02 3.10978190541e-02 - 2.98615217076e-02 2.84935612207e-02 2.70818268649e-02 2.57019293917e-02 2.44059448105e-02 2.32231030162e-02 - 2.56657154446e-02 2.49511167951e-02 2.43184216158e-02 2.37914166767e-02 2.34067395586e-02 2.32023283361e-02 - 2.32023283361e-02 2.34067395586e-02 2.37914166767e-02 2.43184216158e-02 2.49511167951e-02 2.56657154446e-02 - 2.64534808200e-02 2.73140021666e-02 2.82446089484e-02 2.92302840650e-02 3.02357338101e-02 3.12022017908e-02 - 3.20546920774e-02 3.27229087590e-02 3.31691643222e-02 3.34071767353e-02 3.34971688966e-02 3.35158471123e-02 - 3.35158471123e-02 3.34971688966e-02 3.34071767353e-02 3.31691643222e-02 3.27229087590e-02 3.20546920774e-02 - 3.12022017908e-02 3.02357338101e-02 2.92302840650e-02 2.82446089484e-02 2.73140021666e-02 2.64534808200e-02 - 3.00149219248e-02 2.94854041377e-02 2.89691250092e-02 2.85205562719e-02 2.82105864296e-02 2.80994006567e-02 - 2.82105864296e-02 2.85205562719e-02 2.89691250092e-02 2.94854041377e-02 3.00149219248e-02 3.05340710560e-02 - 3.10465495213e-02 3.15673758761e-02 3.21049723875e-02 3.26483588385e-02 3.31615306069e-02 3.35871770820e-02 - 3.38635928392e-02 3.39533984936e-02 3.38709874542e-02 3.36893635306e-02 3.35158471123e-02 3.34454153402e-02 - 3.35158471123e-02 3.36893635306e-02 3.38709874542e-02 3.39533984936e-02 3.38635928392e-02 3.35871770820e-02 - 3.31615306069e-02 3.26483588385e-02 3.21049723875e-02 3.15673758761e-02 3.10465495213e-02 3.05340710560e-02 - 3.51532871168e-02 3.47182328687e-02 3.42208946471e-02 3.37780927799e-02 3.35158471123e-02 3.35158471123e-02 - 3.37780927799e-02 3.42208946471e-02 3.47182328687e-02 3.51532871168e-02 3.54595415232e-02 3.56312088557e-02 - 3.57044700685e-02 3.57259716101e-02 3.57259716101e-02 3.57044700685e-02 3.56312088557e-02 3.54595415232e-02 - 3.51532871168e-02 3.47182328687e-02 3.42208946471e-02 3.37780927799e-02 3.35158471123e-02 3.35158471123e-02 - 3.37780927799e-02 3.42208946471e-02 3.47182328687e-02 3.51532871168e-02 3.54595415232e-02 3.56312088557e-02 - 3.57044700685e-02 3.57259716101e-02 3.57259716101e-02 3.57044700685e-02 3.56312088557e-02 3.54595415232e-02 - 4.07924714489e-02 4.02540981079e-02 3.96081166256e-02 3.90842281235e-02 3.88830541657e-02 3.90842281235e-02 - 3.96081166256e-02 4.02540981079e-02 4.07924714489e-02 4.10571769449e-02 4.09927131873e-02 4.06430475235e-02 - 4.01041807768e-02 3.94725484932e-02 3.88104397494e-02 3.81345549630e-02 3.74259862301e-02 3.66568505349e-02 - 3.58243136049e-02 3.49773595797e-02 3.42208946471e-02 3.36893635306e-02 3.34971688966e-02 3.36893635306e-02 - 3.42208946471e-02 3.49773595797e-02 3.58243136049e-02 3.66568505349e-02 3.74259862301e-02 3.81345549630e-02 - 3.88104397494e-02 3.94725484932e-02 4.01041807768e-02 4.06430475235e-02 4.09927131873e-02 4.10571769449e-02 - 4.62623331670e-02 4.52857661696e-02 4.42752514752e-02 4.36365698621e-02 4.36365698621e-02 4.42752514752e-02 - 4.52857661696e-02 4.62623331670e-02 4.68401774785e-02 4.68264624901e-02 4.62258246981e-02 4.51788789706e-02 - 4.38725463784e-02 4.24686468881e-02 4.10670403681e-02 3.97029159910e-02 3.83718132369e-02 3.70689589239e-02 - 3.58243136049e-02 3.47182328687e-02 3.38709874542e-02 3.34071767353e-02 3.34071767353e-02 3.38709874542e-02 - 3.47182328687e-02 3.58243136049e-02 3.70689589239e-02 3.83718132369e-02 3.97029159910e-02 4.10670403681e-02 - 4.24686468881e-02 4.38725463784e-02 4.51788789706e-02 4.62258246981e-02 4.68264624901e-02 4.68401774785e-02 - 5.03535465114e-02 4.85080722970e-02 4.69885184966e-02 4.64020316983e-02 4.69885184966e-02 4.85080722970e-02 - 5.03535465114e-02 5.18281863755e-02 5.24339557043e-02 5.20147259753e-02 5.07121410456e-02 4.88190878681e-02 - 4.66403070569e-02 4.44094609233e-02 4.22610610741e-02 4.02453701311e-02 3.83718132369e-02 3.66568505349e-02 - 3.51532871168e-02 3.39533984936e-02 3.31691643222e-02 3.28952522339e-02 3.31691643222e-02 3.39533984936e-02 - 3.51532871168e-02 3.66568505349e-02 3.83718132369e-02 4.02453701311e-02 4.22610610741e-02 4.44094609233e-02 - 4.66403070569e-02 4.88190878681e-02 5.07121410456e-02 5.20147259753e-02 5.24339557043e-02 5.18281863755e-02 - 5.13869204668e-02 4.83941231678e-02 4.65545163206e-02 4.65545163206e-02 4.83941231678e-02 5.13869204668e-02 - 5.44475263977e-02 5.65511919643e-02 5.71251588417e-02 5.61547897924e-02 5.40097122002e-02 5.11831265828e-02 - 4.81082332430e-02 4.50819394473e-02 4.22610610741e-02 3.97029159910e-02 3.74259862301e-02 3.54595415232e-02 - 3.38635928392e-02 3.27229087590e-02 3.21243272248e-02 3.21243272248e-02 3.27229087590e-02 3.38635928392e-02 - 3.54595415232e-02 3.74259862301e-02 3.97029159910e-02 4.22610610741e-02 4.50819394473e-02 4.81082332430e-02 - 5.11831265828e-02 5.40097122002e-02 5.61547897924e-02 5.71251588417e-02 5.65511919643e-02 5.44475263977e-02 - 4.79609401864e-02 4.41366450522e-02 4.27064575993e-02 4.41366450522e-02 4.79609401864e-02 5.29210396854e-02 - 5.74105494947e-02 6.01184381094e-02 6.05090723285e-02 5.88318176265e-02 5.57595749637e-02 5.20033431247e-02 - 4.81082332430e-02 4.44094609233e-02 4.10670403681e-02 3.81345549630e-02 3.56312088557e-02 3.35871770820e-02 - 3.20546920774e-02 3.10978190541e-02 3.07715106065e-02 3.10978190541e-02 3.20546920774e-02 3.35871770820e-02 - 3.56312088557e-02 3.81345549630e-02 4.10670403681e-02 4.44094609233e-02 4.81082332430e-02 5.20033431247e-02 - 5.57595749637e-02 5.88318176265e-02 6.05090723285e-02 6.01184381094e-02 5.74105494947e-02 5.29210396854e-02 - 4.02808330656e-02 3.67025276917e-02 3.67025276917e-02 4.02808330656e-02 4.64751950426e-02 5.34983990182e-02 - 5.92810318582e-02 6.23288110708e-02 6.22821499923e-02 5.97584596222e-02 5.57595749637e-02 5.11831265828e-02 - 4.66403070569e-02 4.24686468881e-02 3.88104397494e-02 3.57044700685e-02 3.31615306069e-02 3.12022017908e-02 - 2.98615217076e-02 2.91781605866e-02 2.91781605866e-02 2.98615217076e-02 3.12022017908e-02 3.31615306069e-02 - 3.57044700685e-02 3.88104397494e-02 4.24686468881e-02 4.66403070569e-02 5.11831265828e-02 5.57595749637e-02 - 5.97584596222e-02 6.22821499923e-02 6.23288110708e-02 5.92810318582e-02 5.34983990182e-02 4.64751950426e-02 - 3.07039905741e-02 2.86292518106e-02 3.07039905741e-02 3.65582592974e-02 4.49279278957e-02 5.36143814352e-02 - 6.01752681104e-02 6.30764730892e-02 6.22821499923e-02 5.88318176265e-02 5.40097122002e-02 4.88190878681e-02 - 4.38725463784e-02 3.94725484932e-02 3.57259716101e-02 3.26483588385e-02 3.02357338101e-02 2.84935612207e-02 - 2.74372089612e-02 2.70827915169e-02 2.74372089612e-02 2.84935612207e-02 3.02357338101e-02 3.26483588385e-02 - 3.57259716101e-02 3.94725484932e-02 4.38725463784e-02 4.88190878681e-02 5.40097122002e-02 5.88318176265e-02 - 6.22821499923e-02 6.30764730892e-02 6.01752681104e-02 5.36143814352e-02 4.49279278957e-02 3.65582592974e-02 - 2.23413746600e-02 2.23413746600e-02 2.63856510811e-02 3.40771392673e-02 4.40123223759e-02 5.36149267734e-02 - 6.01752681104e-02 6.23288110708e-02 6.05090723285e-02 5.61547897924e-02 5.07121410456e-02 4.51788789706e-02 - 4.01041807768e-02 3.57259716101e-02 3.21049723875e-02 2.92302840650e-02 2.70818268649e-02 2.56499234494e-02 - 2.49333108373e-02 2.49333108373e-02 2.56499234494e-02 2.70818268649e-02 2.92302840650e-02 3.21049723875e-02 - 3.57259716101e-02 4.01041807768e-02 4.51788789706e-02 5.07121410456e-02 5.61547897924e-02 6.05090723285e-02 - 6.23288110708e-02 6.01752681104e-02 5.36149267734e-02 4.40123223759e-02 3.40771392673e-02 2.63856510811e-02 - 1.69819929531e-02 1.87771308641e-02 2.42761411551e-02 3.32338776264e-02 4.40123223759e-02 5.36143814352e-02 - 5.92810318582e-02 6.01184381094e-02 5.71251588417e-02 5.20147259753e-02 4.62258246981e-02 4.06430475235e-02 - 3.57044700685e-02 3.15673758761e-02 2.82446089484e-02 2.57019293917e-02 2.39063871143e-02 2.28368095394e-02 - 2.24815496090e-02 2.28368095394e-02 2.39063871143e-02 2.57019293917e-02 2.82446089484e-02 3.15673758761e-02 - 3.57044700685e-02 4.06430475235e-02 4.62258246981e-02 5.20147259753e-02 5.71251588417e-02 6.01184381094e-02 - 5.92810318582e-02 5.36143814352e-02 4.40123223759e-02 3.32338776264e-02 2.42761411551e-02 1.87771308641e-02 - 1.46090879135e-02 1.76819501362e-02 2.42761411551e-02 3.40771392673e-02 4.49279278957e-02 5.34983990182e-02 - 5.74105494947e-02 5.65511919643e-02 5.24339557043e-02 4.68264624901e-02 4.09927131873e-02 3.56312088557e-02 - 3.10465495213e-02 2.73140021666e-02 2.44059448105e-02 2.22726314479e-02 2.08735527936e-02 2.01812628043e-02 - 2.01812628043e-02 2.08735527936e-02 2.22726314479e-02 2.44059448105e-02 2.73140021666e-02 3.10465495213e-02 - 3.56312088557e-02 4.09927131873e-02 4.68264624901e-02 5.24339557043e-02 5.65511919643e-02 5.74105494947e-02 - 5.34983990182e-02 4.49279278957e-02 3.40771392673e-02 2.42761411551e-02 1.76819501362e-02 1.46090879135e-02 - 1.46090879135e-02 1.87771308641e-02 2.63856510811e-02 3.65582592974e-02 4.64751950426e-02 5.29210396854e-02 - 5.44475263977e-02 5.18281863755e-02 4.68401774785e-02 4.10571769449e-02 3.54595415232e-02 3.05340710560e-02 - 2.64534808200e-02 2.32231030162e-02 2.07887392229e-02 1.90940368490e-02 1.80960146721e-02 1.77666865554e-02 - 1.80960146721e-02 1.90940368490e-02 2.07887392229e-02 2.32231030162e-02 2.64534808200e-02 3.05340710560e-02 - 3.54595415232e-02 4.10571769449e-02 4.68401774785e-02 5.18281863755e-02 5.44475263977e-02 5.29210396854e-02 - 4.64751950426e-02 3.65582592974e-02 2.63856510811e-02 1.87771308641e-02 1.46090879135e-02 1.33581335706e-02 - 3.09103717113e-02 3.62214481565e-02 4.26203265537e-02 4.79609401864e-02 5.02620593726e-02 4.89738024005e-02 - 4.49623774036e-02 3.95849180057e-02 3.39533984936e-02 2.87439673059e-02 2.42781130820e-02 2.06439962171e-02 - 1.78072941675e-02 1.56960478729e-02 1.42425749040e-02 1.33939588194e-02 1.31152359900e-02 1.33939588194e-02 - 1.42425749040e-02 1.56960478729e-02 1.78072941675e-02 2.06439962171e-02 2.42781130820e-02 2.87439673059e-02 - 3.39533984936e-02 3.95849180057e-02 4.49623774036e-02 4.89738024005e-02 5.02620593726e-02 4.79609401864e-02 - 4.26203265537e-02 3.62214481565e-02 3.09103717113e-02 2.77489957459e-02 2.67478820537e-02 2.77489957459e-02 - 3.62214481565e-02 4.11986868029e-02 4.58777097769e-02 4.83941231678e-02 4.77793166757e-02 4.44045560444e-02 - 3.93968315223e-02 3.38709874542e-02 2.85879356046e-02 2.39549635512e-02 2.01220876747e-02 1.70848695603e-02 - 1.47756456624e-02 1.31198380533e-02 1.20550163598e-02 1.15351431719e-02 1.15351431719e-02 1.20550163598e-02 - 1.31198380533e-02 1.47756456624e-02 1.70848695603e-02 2.01220876747e-02 2.39549635512e-02 2.85879356046e-02 - 3.38709874542e-02 3.93968315223e-02 4.44045560444e-02 4.77793166757e-02 4.83941231678e-02 4.58777097769e-02 - 4.11986868029e-02 3.62214481565e-02 3.25101129901e-02 3.06594619284e-02 3.06594619284e-02 3.25101129901e-02 - 4.26203265537e-02 4.58777097769e-02 4.76689314688e-02 4.69885184966e-02 4.38595264834e-02 3.90976289629e-02 - 3.36893635306e-02 2.83925891295e-02 2.36566460915e-02 1.96777557044e-02 1.64818809732e-02 1.40109856905e-02 - 1.21873907787e-02 1.09414577715e-02 1.02181471415e-02 9.98127039361e-03 1.02181471415e-02 1.09414577715e-02 - 1.21873907787e-02 1.40109856905e-02 1.64818809732e-02 1.96777557044e-02 2.36566460915e-02 2.83925891295e-02 - 3.36893635306e-02 3.90976289629e-02 4.38595264834e-02 4.69885184966e-02 4.76689314688e-02 4.58777097769e-02 - 4.26203265537e-02 3.93541671489e-02 3.71417160544e-02 3.63849623957e-02 3.71417160544e-02 3.93541671489e-02 - 4.79609401864e-02 4.83941231678e-02 4.69885184966e-02 4.36365698621e-02 3.88830541657e-02 3.35158471123e-02 - 2.82105864296e-02 2.34067395586e-02 1.93203741197e-02 1.59997599900e-02 1.33976732300e-02 1.14361707830e-02 - 1.00404664762e-02 9.14830218340e-03 8.71419097250e-03 8.71419097250e-03 9.14830218340e-03 1.00404664762e-02 - 1.14361707830e-02 1.33976732300e-02 1.59997599900e-02 1.93203741197e-02 2.34067395586e-02 2.82105864296e-02 - 3.35158471123e-02 3.88830541657e-02 4.36365698621e-02 4.69885184966e-02 4.83941231678e-02 4.79609401864e-02 - 4.64751950426e-02 4.49279278957e-02 4.40123223759e-02 4.40123223759e-02 4.49279278957e-02 4.64751950426e-02 - 5.02620593726e-02 4.77793166757e-02 4.38595264834e-02 3.88830541657e-02 3.34454153402e-02 2.81005086407e-02 - 2.32378434698e-02 1.90666010177e-02 1.56449525655e-02 1.29342051284e-02 1.08577130860e-02 9.33741418467e-03 - 8.30549434438e-03 7.70870330534e-03 7.51351058269e-03 7.70870330534e-03 8.30549434438e-03 9.33741418467e-03 - 1.08577130860e-02 1.29342051284e-02 1.56449525655e-02 1.90666010177e-02 2.32378434698e-02 2.81005086407e-02 - 3.34454153402e-02 3.88830541657e-02 4.38595264834e-02 4.77793166757e-02 5.02620593726e-02 5.13723037105e-02 - 5.15765048907e-02 5.14403532045e-02 5.13523903781e-02 5.14403532045e-02 5.15765048907e-02 5.13723037105e-02 - 4.89738024005e-02 4.44045560444e-02 3.90976289629e-02 3.35158471123e-02 2.81005086407e-02 2.31779027969e-02 - 1.89341271390e-02 1.54267827082e-02 1.26225341258e-02 1.04468583553e-02 8.82009872524e-03 7.67065297497e-03 - 6.93908976898e-03 6.58362639444e-03 6.58362639444e-03 6.93908976898e-03 7.67065297497e-03 8.82009872524e-03 - 1.04468583553e-02 1.26225341258e-02 1.54267827082e-02 1.89341271390e-02 2.31779027969e-02 2.81005086407e-02 - 3.35158471123e-02 3.90976289629e-02 4.44045560444e-02 4.89738024005e-02 5.24797871309e-02 5.48533676650e-02 - 5.62463189889e-02 5.68740665481e-02 5.68740665481e-02 5.62463189889e-02 5.48533676650e-02 5.24797871309e-02 - 4.49623774036e-02 3.93968315223e-02 3.36893635306e-02 2.82105864296e-02 2.32378434698e-02 1.89341271390e-02 - 1.53530693596e-02 1.24657333634e-02 1.02011860999e-02 8.47998103933e-03 7.22847713667e-03 6.38291972351e-03 - 5.89466652251e-03 5.73495116497e-03 5.89466652251e-03 6.38291972351e-03 7.22847713667e-03 8.47998103933e-03 - 1.02011860999e-02 1.24657333634e-02 1.53530693596e-02 1.89341271390e-02 2.32378434698e-02 2.82105864296e-02 - 3.36893635306e-02 3.93968315223e-02 4.49623774036e-02 4.99825941802e-02 5.41129564364e-02 5.71366804742e-02 - 5.89627863020e-02 5.95715936141e-02 5.89627863020e-02 5.71366804742e-02 5.41129564364e-02 4.99825941802e-02 - 3.95849180057e-02 3.38709874542e-02 2.83925891295e-02 2.34067395586e-02 1.90666010177e-02 1.54267827082e-02 - 1.24657333634e-02 1.01194532806e-02 8.31144312544e-03 6.96786738821e-03 6.02253909249e-03 5.42174879265e-03 - 5.12972310883e-03 5.12972310883e-03 5.42174879265e-03 6.02253909249e-03 6.96786738821e-03 8.31144312544e-03 - 1.01194532806e-02 1.24657333634e-02 1.54267827082e-02 1.90666010177e-02 2.34067395586e-02 2.83925891295e-02 - 3.38709874542e-02 3.95849180057e-02 4.51877782102e-02 5.02828320119e-02 5.44829894560e-02 5.74676014035e-02 - 5.90154969276e-02 5.90154969276e-02 5.74676014035e-02 5.44829894560e-02 5.02828320119e-02 4.51877782102e-02 - 3.39533984936e-02 2.85879356046e-02 2.36566460915e-02 1.93203741197e-02 1.56449525655e-02 1.26225341258e-02 - 1.02011860999e-02 8.31144312544e-03 6.88181758770e-03 5.84558656512e-03 5.14599535674e-03 4.74176747355e-03 - 4.60945880297e-03 4.74176747355e-03 5.14599535674e-03 5.84558656512e-03 6.88181758770e-03 8.31144312544e-03 - 1.02011860999e-02 1.26225341258e-02 1.56449525655e-02 1.93203741197e-02 2.36566460915e-02 2.85879356046e-02 - 3.39533984936e-02 3.94908104948e-02 4.48486167771e-02 4.96193341715e-02 5.33923081840e-02 5.58153453540e-02 - 5.66509609539e-02 5.58153453540e-02 5.33923081840e-02 4.96193341715e-02 4.48486167771e-02 3.94908104948e-02 - 2.87439673059e-02 2.39549635512e-02 1.96777557044e-02 1.59997599900e-02 1.29342051284e-02 1.04468583553e-02 - 8.47998103933e-03 6.96786738821e-03 5.84558656512e-03 5.05545032098e-03 4.55262020357e-03 4.30805835198e-03 - 4.30805835198e-03 4.55262020357e-03 5.05545032098e-03 5.84558656512e-03 6.96786738821e-03 8.47998103933e-03 - 1.04468583553e-02 1.29342051284e-02 1.59997599900e-02 1.96777557044e-02 2.39549635512e-02 2.87439673059e-02 - 3.38635928392e-02 3.90347179512e-02 4.38959177953e-02 4.80406383964e-02 5.10737783335e-02 5.26787408684e-02 - 5.26787408684e-02 5.10737783335e-02 4.80406383964e-02 4.38959177953e-02 3.90347179512e-02 3.38635928392e-02 - 2.42781130820e-02 2.01220876747e-02 1.64818809732e-02 1.33976732300e-02 1.08577130860e-02 8.82009872524e-03 - 7.22847713667e-03 6.02253909249e-03 5.14599535674e-03 4.55262020357e-03 4.20942844716e-03 4.09713024865e-03 - 4.20942844716e-03 4.55262020357e-03 5.14599535674e-03 6.02253909249e-03 7.22847713667e-03 8.82009872524e-03 - 1.08577130860e-02 1.33976732300e-02 1.64818809732e-02 2.01220876747e-02 2.42781130820e-02 2.88348357920e-02 - 3.35871770820e-02 3.82415861113e-02 4.24386109393e-02 4.57968161948e-02 4.79731106469e-02 4.87273692032e-02 - 4.79731106469e-02 4.57968161948e-02 4.24386109393e-02 3.82415861113e-02 3.35871770820e-02 2.88348357920e-02 - 2.06439962171e-02 1.70848695603e-02 1.40109856905e-02 1.14361707830e-02 9.33741418467e-03 7.67065297497e-03 - 6.38291972351e-03 5.42174879265e-03 4.74176747355e-03 4.30805835198e-03 4.09713024865e-03 4.09713024865e-03 - 4.30805835198e-03 4.74176747355e-03 5.42174879265e-03 6.38291972351e-03 7.67065297497e-03 9.33741418467e-03 - 1.14361707830e-02 1.40109856905e-02 1.70848695603e-02 2.06439962171e-02 2.46187421852e-02 2.88661050079e-02 - 3.31615306069e-02 3.72078996967e-02 4.06654278454e-02 4.32002938784e-02 4.45431970579e-02 4.45431970579e-02 - 4.32002938784e-02 4.06654278454e-02 3.72078996967e-02 3.31615306069e-02 2.88661050079e-02 2.46187421852e-02 - 1.78072941675e-02 1.47756456624e-02 1.21873907787e-02 1.00404664762e-02 8.30549434438e-03 6.93908976898e-03 - 5.89466652251e-03 5.12972310883e-03 4.60945880297e-03 4.30805835198e-03 4.20942844716e-03 4.30805835198e-03 - 4.60945880297e-03 5.12972310883e-03 5.89466652251e-03 6.93908976898e-03 8.30549434438e-03 1.00404664762e-02 - 1.21873907787e-02 1.47756456624e-02 1.78072941675e-02 2.12421582644e-02 2.49827563157e-02 2.88631293974e-02 - 3.26483588385e-02 3.60511821341e-02 3.87673596218e-02 4.05244812822e-02 4.11328816616e-02 4.05244812822e-02 - 3.87673596218e-02 3.60511821341e-02 3.26483588385e-02 2.88631293974e-02 2.49827563157e-02 2.12421582644e-02 - 1.56960478729e-02 1.31198380533e-02 1.09414577715e-02 9.14830218340e-03 7.70870330534e-03 6.58362639444e-03 - 5.73495116497e-03 5.12972310883e-03 4.74176747355e-03 4.55262020357e-03 4.55262020357e-03 4.74176747355e-03 - 5.12972310883e-03 5.73495116497e-03 6.58362639444e-03 7.70870330534e-03 9.14830218340e-03 1.09414577715e-02 - 1.31198380533e-02 1.56960478729e-02 1.86504890434e-02 2.19185274002e-02 2.53797852965e-02 2.88533907006e-02 - 3.21049723875e-02 3.48695445110e-02 3.68889471691e-02 3.79563421300e-02 3.79563421300e-02 3.68889471691e-02 - 3.48695445110e-02 3.21049723875e-02 2.88533907006e-02 2.53797852965e-02 2.19185274002e-02 1.86504890434e-02 - 1.42425749040e-02 1.20550163598e-02 1.02181471415e-02 8.71419097250e-03 7.51351058269e-03 6.58362639444e-03 - 5.89466652251e-03 5.42174879265e-03 5.14599535674e-03 5.05545032098e-03 5.14599535674e-03 5.42174879265e-03 - 5.89466652251e-03 6.58362639444e-03 7.51351058269e-03 8.71419097250e-03 1.02181471415e-02 1.20550163598e-02 - 1.42425749040e-02 1.67754563001e-02 1.96135589165e-02 2.26718438342e-02 2.58139075627e-02 2.88533907006e-02 - 3.15673758761e-02 3.37228748044e-02 3.51127517762e-02 3.55932306397e-02 3.51127517762e-02 3.37228748044e-02 - 3.15673758761e-02 2.88533907006e-02 2.58139075627e-02 2.26718438342e-02 1.96135589165e-02 1.67754563001e-02 - 1.33939588194e-02 1.15351431719e-02 9.98127039361e-03 8.71419097250e-03 7.70870330534e-03 6.93908976898e-03 - 6.38291972351e-03 6.02253909249e-03 5.84558656512e-03 5.84558656512e-03 6.02253909249e-03 6.38291972351e-03 - 6.93908976898e-03 7.70870330534e-03 8.71419097250e-03 9.98127039361e-03 1.15351431719e-02 1.33939588194e-02 - 1.55601992220e-02 1.80109897723e-02 2.06884779452e-02 2.34923498457e-02 2.62778950395e-02 2.88631293974e-02 - 3.10465495213e-02 3.26341221073e-02 3.34710625414e-02 3.34710625414e-02 3.26341221073e-02 3.10465495213e-02 - 2.88631293974e-02 2.62778950395e-02 2.34923498457e-02 2.06884779452e-02 1.80109897723e-02 1.55601992220e-02 - 1.31152359900e-02 1.15351431719e-02 1.02181471415e-02 9.14830218340e-03 8.30549434438e-03 7.67065297497e-03 - 7.22847713667e-03 6.96786738821e-03 6.88181758770e-03 6.96786738821e-03 7.22847713667e-03 7.67065297497e-03 - 8.30549434438e-03 9.14830218340e-03 1.02181471415e-02 1.15351431719e-02 1.31152359900e-02 1.49636867906e-02 - 1.70678712692e-02 1.93892705934e-02 2.18557815330e-02 2.43576039836e-02 2.67502344749e-02 2.88661050079e-02 - 3.05340710560e-02 3.16041856284e-02 3.19731919657e-02 3.16041856284e-02 3.05340710560e-02 2.88661050079e-02 - 2.67502344749e-02 2.43576039836e-02 2.18557815330e-02 1.93892705934e-02 1.70678712692e-02 1.49636867906e-02 - 1.33939588194e-02 1.20550163598e-02 1.09414577715e-02 1.00404664762e-02 9.33741418467e-03 8.82009872524e-03 - 8.47998103933e-03 8.31144312544e-03 8.31144312544e-03 8.47998103933e-03 8.82009872524e-03 9.33741418467e-03 - 1.00404664762e-02 1.09414577715e-02 1.20550163598e-02 1.33939588194e-02 1.49636867906e-02 1.67567114426e-02 - 1.87467470027e-02 2.08820531014e-02 2.30804654510e-02 2.52298202509e-02 2.71955666447e-02 2.88348357920e-02 - 3.00149219248e-02 3.06330408871e-02 3.06330408871e-02 3.00149219248e-02 2.88348357920e-02 2.71955666447e-02 - 2.52298202509e-02 2.30804654510e-02 2.08820531014e-02 1.87467470027e-02 1.67567114426e-02 1.49636867906e-02 - 1.42425749040e-02 1.31198380533e-02 1.21873907787e-02 1.14361707830e-02 1.08577130860e-02 1.04468583553e-02 - 1.02011860999e-02 1.01194532806e-02 1.02011860999e-02 1.04468583553e-02 1.08577130860e-02 1.14361707830e-02 - 1.21873907787e-02 1.31198380533e-02 1.42425749040e-02 1.55601992220e-02 1.70678712692e-02 1.87467470027e-02 - 2.05587788214e-02 2.24420850452e-02 2.43103322252e-02 2.60582031450e-02 2.75721078901e-02 2.87439673059e-02 - 2.94854041377e-02 2.97391273192e-02 2.94854041377e-02 2.87439673059e-02 2.75721078901e-02 2.60582031450e-02 - 2.43103322252e-02 2.24420850452e-02 2.05587788214e-02 1.87467470027e-02 1.70678712692e-02 1.55601992220e-02 - 1.56960478729e-02 1.47756456624e-02 1.40109856905e-02 1.33976732300e-02 1.29342051284e-02 1.26225341258e-02 - 1.24657333634e-02 1.24657333634e-02 1.26225341258e-02 1.29342051284e-02 1.33976732300e-02 1.40109856905e-02 - 1.47756456624e-02 1.56960478729e-02 1.67754563001e-02 1.80109897723e-02 1.93892705934e-02 2.08820531014e-02 - 2.24420850452e-02 2.40022165572e-02 2.54803066383e-02 2.67889182249e-02 2.78466298707e-02 2.85879356046e-02 - 2.89691250092e-02 2.89691250092e-02 2.85879356046e-02 2.78466298707e-02 2.67889182249e-02 2.54803066383e-02 - 2.40022165572e-02 2.24420850452e-02 2.08820531014e-02 1.93892705934e-02 1.80109897723e-02 1.67754563001e-02 - 1.78072941675e-02 1.70848695603e-02 1.64818809732e-02 1.59997599900e-02 1.56449525655e-02 1.54267827082e-02 - 1.53530693596e-02 1.54267827082e-02 1.56449525655e-02 1.59997599900e-02 1.64818809732e-02 1.70848695603e-02 - 1.78072941675e-02 1.86504890434e-02 1.96135589165e-02 2.06884779452e-02 2.18557815330e-02 2.30804654510e-02 - 2.43103322252e-02 2.54803066383e-02 2.65227612839e-02 2.73794467347e-02 2.80098127199e-02 2.83925891295e-02 - 2.85205562719e-02 2.83925891295e-02 2.80098127199e-02 2.73794467347e-02 2.65227612839e-02 2.54803066383e-02 - 2.43103322252e-02 2.30804654510e-02 2.18557815330e-02 2.06884779452e-02 1.96135589165e-02 1.86504890434e-02 - 2.06439962171e-02 2.01220876747e-02 1.96777557044e-02 1.93203741197e-02 1.90666010177e-02 1.89341271390e-02 - 1.89341271390e-02 1.90666010177e-02 1.93203741197e-02 1.96777557044e-02 2.01220876747e-02 2.06439962171e-02 - 2.12421582644e-02 2.19185274002e-02 2.26718438342e-02 2.34923498457e-02 2.43576039836e-02 2.52298202509e-02 - 2.60582031450e-02 2.67889182249e-02 2.73794467347e-02 2.78094015925e-02 2.80812943983e-02 2.82105864296e-02 - 2.82105864296e-02 2.80812943983e-02 2.78094015925e-02 2.73794467347e-02 2.67889182249e-02 2.60582031450e-02 - 2.52298202509e-02 2.43576039836e-02 2.34923498457e-02 2.26718438342e-02 2.19185274002e-02 2.12421582644e-02 - 2.42781130820e-02 2.39549635512e-02 2.36566460915e-02 2.34067395586e-02 2.32378434698e-02 2.31779027969e-02 - 2.32378434698e-02 2.34067395586e-02 2.36566460915e-02 2.39549635512e-02 2.42781130820e-02 2.46187421852e-02 - 2.49827563157e-02 2.53797852965e-02 2.58139075627e-02 2.62778950395e-02 2.67502344749e-02 2.71955666447e-02 - 2.75721078901e-02 2.78466298707e-02 2.80098127199e-02 2.80812943983e-02 2.80994006567e-02 2.81005086407e-02 - 2.80994006567e-02 2.80812943983e-02 2.80098127199e-02 2.78466298707e-02 2.75721078901e-02 2.71955666447e-02 - 2.67502344749e-02 2.62778950395e-02 2.58139075627e-02 2.53797852965e-02 2.49827563157e-02 2.46187421852e-02 - 2.87439673059e-02 2.85879356046e-02 2.83925891295e-02 2.82105864296e-02 2.81005086407e-02 2.81005086407e-02 - 2.82105864296e-02 2.83925891295e-02 2.85879356046e-02 2.87439673059e-02 2.88348357920e-02 2.88661050079e-02 - 2.88631293974e-02 2.88533907006e-02 2.88533907006e-02 2.88631293974e-02 2.88661050079e-02 2.88348357920e-02 - 2.87439673059e-02 2.85879356046e-02 2.83925891295e-02 2.82105864296e-02 2.81005086407e-02 2.81005086407e-02 - 2.82105864296e-02 2.83925891295e-02 2.85879356046e-02 2.87439673059e-02 2.88348357920e-02 2.88661050079e-02 - 2.88631293974e-02 2.88533907006e-02 2.88533907006e-02 2.88631293974e-02 2.88661050079e-02 2.88348357920e-02 - 3.39533984936e-02 3.38709874542e-02 3.36893635306e-02 3.35158471123e-02 3.34454153402e-02 3.35158471123e-02 - 3.36893635306e-02 3.38709874542e-02 3.39533984936e-02 3.38635928392e-02 3.35871770820e-02 3.31615306069e-02 - 3.26483588385e-02 3.21049723875e-02 3.15673758761e-02 3.10465495213e-02 3.05340710560e-02 3.00149219248e-02 - 2.94854041377e-02 2.89691250092e-02 2.85205562719e-02 2.82105864296e-02 2.80994006567e-02 2.82105864296e-02 - 2.85205562719e-02 2.89691250092e-02 2.94854041377e-02 3.00149219248e-02 3.05340710560e-02 3.10465495213e-02 - 3.15673758761e-02 3.21049723875e-02 3.26483588385e-02 3.31615306069e-02 3.35871770820e-02 3.38635928392e-02 - 3.95849180057e-02 3.93968315223e-02 3.90976289629e-02 3.88830541657e-02 3.88830541657e-02 3.90976289629e-02 - 3.93968315223e-02 3.95849180057e-02 3.94908104948e-02 3.90347179512e-02 3.82415861113e-02 3.72078996967e-02 - 3.60511821341e-02 3.48695445110e-02 3.37228748044e-02 3.26341221073e-02 3.16041856284e-02 3.06330408871e-02 - 2.97391273192e-02 2.89691250092e-02 2.83925891295e-02 2.80812943983e-02 2.80812943983e-02 2.83925891295e-02 - 2.89691250092e-02 2.97391273192e-02 3.06330408871e-02 3.16041856284e-02 3.26341221073e-02 3.37228748044e-02 - 3.48695445110e-02 3.60511821341e-02 3.72078996967e-02 3.82415861113e-02 3.90347179512e-02 3.94908104948e-02 - 4.49623774036e-02 4.44045560444e-02 4.38595264834e-02 4.36365698621e-02 4.38595264834e-02 4.44045560444e-02 - 4.49623774036e-02 4.51877782102e-02 4.48486167771e-02 4.38959177953e-02 4.24386109393e-02 4.06654278454e-02 - 3.87673596218e-02 3.68889471691e-02 3.51127517762e-02 3.34710625414e-02 3.19731919657e-02 3.06330408871e-02 - 2.94854041377e-02 2.85879356046e-02 2.80098127199e-02 2.78094015925e-02 2.80098127199e-02 2.85879356046e-02 - 2.94854041377e-02 3.06330408871e-02 3.19731919657e-02 3.34710625414e-02 3.51127517762e-02 3.68889471691e-02 - 3.87673596218e-02 4.06654278454e-02 4.24386109393e-02 4.38959177953e-02 4.48486167771e-02 4.51877782102e-02 - 4.89738024005e-02 4.77793166757e-02 4.69885184966e-02 4.69885184966e-02 4.77793166757e-02 4.89738024005e-02 - 4.99825941802e-02 5.02828320119e-02 4.96193341715e-02 4.80406383964e-02 4.57968161948e-02 4.32002938784e-02 - 4.05244812822e-02 3.79563421300e-02 3.55932306397e-02 3.34710625414e-02 3.16041856284e-02 3.00149219248e-02 - 2.87439673059e-02 2.78466298707e-02 2.73794467347e-02 2.73794467347e-02 2.78466298707e-02 2.87439673059e-02 - 3.00149219248e-02 3.16041856284e-02 3.34710625414e-02 3.55932306397e-02 3.79563421300e-02 4.05244812822e-02 - 4.32002938784e-02 4.57968161948e-02 4.80406383964e-02 4.96193341715e-02 5.02828320119e-02 4.99825941802e-02 - 5.02620593726e-02 4.83941231678e-02 4.76689314688e-02 4.83941231678e-02 5.02620593726e-02 5.24797871309e-02 - 5.41129564364e-02 5.44829894560e-02 5.33923081840e-02 5.10737783335e-02 4.79731106469e-02 4.45431970579e-02 - 4.11328816616e-02 3.79563421300e-02 3.51127517762e-02 3.26341221073e-02 3.05340710560e-02 2.88348357920e-02 - 2.75721078901e-02 2.67889182249e-02 2.65227612839e-02 2.67889182249e-02 2.75721078901e-02 2.88348357920e-02 - 3.05340710560e-02 3.26341221073e-02 3.51127517762e-02 3.79563421300e-02 4.11328816616e-02 4.45431970579e-02 - 4.79731106469e-02 5.10737783335e-02 5.33923081840e-02 5.44829894560e-02 5.41129564364e-02 5.24797871309e-02 - 4.79609401864e-02 4.58777097769e-02 4.58777097769e-02 4.79609401864e-02 5.13723037105e-02 5.48533676650e-02 - 5.71366804742e-02 5.74676014035e-02 5.58153453540e-02 5.26787408684e-02 4.87273692032e-02 4.45431970579e-02 - 4.05244812822e-02 3.68889471691e-02 3.37228748044e-02 3.10465495213e-02 2.88661050079e-02 2.71955666447e-02 - 2.60582031450e-02 2.54803066383e-02 2.54803066383e-02 2.60582031450e-02 2.71955666447e-02 2.88661050079e-02 - 3.10465495213e-02 3.37228748044e-02 3.68889471691e-02 4.05244812822e-02 4.45431970579e-02 4.87273692032e-02 - 5.26787408684e-02 5.58153453540e-02 5.74676014035e-02 5.71366804742e-02 5.48533676650e-02 5.13723037105e-02 - 4.26203265537e-02 4.11986868029e-02 4.26203265537e-02 4.64751950426e-02 5.15765048907e-02 5.62463189889e-02 - 5.89627863020e-02 5.90154969276e-02 5.66509609539e-02 5.26787408684e-02 4.79731106469e-02 4.32002938784e-02 - 3.87673596218e-02 3.48695445110e-02 3.15673758761e-02 2.88631293974e-02 2.67502344749e-02 2.52298202509e-02 - 2.43103322252e-02 2.40022165572e-02 2.43103322252e-02 2.52298202509e-02 2.67502344749e-02 2.88631293974e-02 - 3.15673758761e-02 3.48695445110e-02 3.87673596218e-02 4.32002938784e-02 4.79731106469e-02 5.26787408684e-02 - 5.66509609539e-02 5.90154969276e-02 5.89627863020e-02 5.62463189889e-02 5.15765048907e-02 4.64751950426e-02 - 3.62214481565e-02 3.62214481565e-02 3.93541671489e-02 4.49279278957e-02 5.14403532045e-02 5.68740665481e-02 - 5.95715936141e-02 5.90154969276e-02 5.58153453540e-02 5.10737783335e-02 4.57968161948e-02 4.06654278454e-02 - 3.60511821341e-02 3.21049723875e-02 2.88533907006e-02 2.62778950395e-02 2.43576039836e-02 2.30804654510e-02 - 2.24420850452e-02 2.24420850452e-02 2.30804654510e-02 2.43576039836e-02 2.62778950395e-02 2.88533907006e-02 - 3.21049723875e-02 3.60511821341e-02 4.06654278454e-02 4.57968161948e-02 5.10737783335e-02 5.58153453540e-02 - 5.90154969276e-02 5.95715936141e-02 5.68740665481e-02 5.14403532045e-02 4.49279278957e-02 3.93541671489e-02 - 3.09103717113e-02 3.25101129901e-02 3.71417160544e-02 4.40123223759e-02 5.13523903781e-02 5.68740665481e-02 - 5.89627863020e-02 5.74676014035e-02 5.33923081840e-02 4.80406383964e-02 4.24386109393e-02 3.72078996967e-02 - 3.26483588385e-02 2.88533907006e-02 2.58139075627e-02 2.34923498457e-02 2.18557815330e-02 2.08820531014e-02 - 2.05587788214e-02 2.08820531014e-02 2.18557815330e-02 2.34923498457e-02 2.58139075627e-02 2.88533907006e-02 - 3.26483588385e-02 3.72078996967e-02 4.24386109393e-02 4.80406383964e-02 5.33923081840e-02 5.74676014035e-02 - 5.89627863020e-02 5.68740665481e-02 5.13523903781e-02 4.40123223759e-02 3.71417160544e-02 3.25101129901e-02 - 2.77489957459e-02 3.06594619284e-02 3.63849623957e-02 4.40123223759e-02 5.14403532045e-02 5.62463189889e-02 - 5.71366804742e-02 5.44829894560e-02 4.96193341715e-02 4.38959177953e-02 3.82415861113e-02 3.31615306069e-02 - 2.88631293974e-02 2.53797852965e-02 2.26718438342e-02 2.06884779452e-02 1.93892705934e-02 1.87467470027e-02 - 1.87467470027e-02 1.93892705934e-02 2.06884779452e-02 2.26718438342e-02 2.53797852965e-02 2.88631293974e-02 - 3.31615306069e-02 3.82415861113e-02 4.38959177953e-02 4.96193341715e-02 5.44829894560e-02 5.71366804742e-02 - 5.62463189889e-02 5.14403532045e-02 4.40123223759e-02 3.63849623957e-02 3.06594619284e-02 2.77489957459e-02 - 2.67478820537e-02 3.06594619284e-02 3.71417160544e-02 4.49279278957e-02 5.15765048907e-02 5.48533676650e-02 - 5.41129564364e-02 5.02828320119e-02 4.48486167771e-02 3.90347179512e-02 3.35871770820e-02 2.88661050079e-02 - 2.49827563157e-02 2.19185274002e-02 1.96135589165e-02 1.80109897723e-02 1.70678712692e-02 1.67567114426e-02 - 1.70678712692e-02 1.80109897723e-02 1.96135589165e-02 2.19185274002e-02 2.49827563157e-02 2.88661050079e-02 - 3.35871770820e-02 3.90347179512e-02 4.48486167771e-02 5.02828320119e-02 5.41129564364e-02 5.48533676650e-02 - 5.15765048907e-02 4.49279278957e-02 3.71417160544e-02 3.06594619284e-02 2.67478820537e-02 2.54935088837e-02 - 2.77489957459e-02 3.25101129901e-02 3.93541671489e-02 4.64751950426e-02 5.13723037105e-02 5.24797871309e-02 - 4.99825941802e-02 4.51877782102e-02 3.94908104948e-02 3.38635928392e-02 2.88348357920e-02 2.46187421852e-02 - 2.12421582644e-02 1.86504890434e-02 1.67754563001e-02 1.55601992220e-02 1.49636867906e-02 1.49636867906e-02 - 1.55601992220e-02 1.67754563001e-02 1.86504890434e-02 2.12421582644e-02 2.46187421852e-02 2.88348357920e-02 - 3.38635928392e-02 3.94908104948e-02 4.51877782102e-02 4.99825941802e-02 5.24797871309e-02 5.13723037105e-02 - 4.64751950426e-02 3.93541671489e-02 3.25101129901e-02 2.77489957459e-02 2.54935088837e-02 2.54935088837e-02 - 4.60013609401e-02 4.89850720157e-02 5.12221625406e-02 5.13869204668e-02 4.89738024005e-02 4.44868574481e-02 - 3.89160663350e-02 3.31691643222e-02 2.78466298707e-02 2.32562353108e-02 1.94921954522e-02 1.65234811342e-02 - 1.42727054437e-02 1.26620800682e-02 1.16276251073e-02 1.11228159589e-02 1.11228159589e-02 1.16276251073e-02 - 1.26620800682e-02 1.42727054437e-02 1.65234811342e-02 1.94921954522e-02 2.32562353108e-02 2.78466298707e-02 - 3.31691643222e-02 3.89160663350e-02 4.44868574481e-02 4.89738024005e-02 5.13869204668e-02 5.12221625406e-02 - 4.89850720157e-02 4.60013609401e-02 4.35588929466e-02 4.22847991283e-02 4.22847991283e-02 4.35588929466e-02 - 4.89850720157e-02 5.05555186569e-02 5.06194135765e-02 4.85080722970e-02 4.44045560444e-02 3.90848689472e-02 - 3.34071767353e-02 2.80098127199e-02 2.32603028496e-02 1.93050944183e-02 1.61434902729e-02 1.37059602390e-02 - 1.19105819676e-02 1.06856809758e-02 9.97511028176e-03 9.74245511371e-03 9.97511028176e-03 1.06856809758e-02 - 1.19105819676e-02 1.37059602390e-02 1.61434902729e-02 1.93050944183e-02 2.32603028496e-02 2.80098127199e-02 - 3.34071767353e-02 3.90848689472e-02 4.44045560444e-02 4.85080722970e-02 5.06194135765e-02 5.05555186569e-02 - 4.89850720157e-02 4.70389926376e-02 4.56222411881e-02 4.51254329663e-02 4.56222411881e-02 4.70389926376e-02 - 5.12221625406e-02 5.06194135765e-02 4.83002627794e-02 4.42752514752e-02 3.90976289629e-02 3.34971688966e-02 - 2.80812943983e-02 2.32368358951e-02 1.91448778653e-02 1.58329883187e-02 1.32437842255e-02 1.12951380995e-02 - 9.91029781221e-03 9.02578945364e-03 8.59555582378e-03 8.59555582378e-03 9.02578945364e-03 9.91029781221e-03 - 1.12951380995e-02 1.32437842255e-02 1.58329883187e-02 1.91448778653e-02 2.32368358951e-02 2.80812943983e-02 - 3.34971688966e-02 3.90976289629e-02 4.42752514752e-02 4.83002627794e-02 5.06194135765e-02 5.12221625406e-02 - 5.07010770424e-02 4.98718618187e-02 4.93308963719e-02 4.93308963719e-02 4.98718618187e-02 5.07010770424e-02 - 5.13869204668e-02 4.85080722970e-02 4.42752514752e-02 3.90842281235e-02 3.35158471123e-02 2.80994006567e-02 - 2.32023283361e-02 1.90175139009e-02 1.55924938344e-02 1.28827341282e-02 1.08088949298e-02 9.29162040305e-03 - 8.26229038338e-03 7.66717366082e-03 7.47255069610e-03 7.66717366082e-03 8.26229038338e-03 9.29162040305e-03 - 1.08088949298e-02 1.28827341282e-02 1.55924938344e-02 1.90175139009e-02 2.32023283361e-02 2.80994006567e-02 - 3.35158471123e-02 3.90842281235e-02 4.42752514752e-02 4.85080722970e-02 5.13869204668e-02 5.29210396854e-02 - 5.34983990182e-02 5.36143814352e-02 5.36149267734e-02 5.36143814352e-02 5.34983990182e-02 5.29210396854e-02 - 4.89738024005e-02 4.44045560444e-02 3.90976289629e-02 3.35158471123e-02 2.81005086407e-02 2.31779027969e-02 - 1.89341271390e-02 1.54267827082e-02 1.26225341258e-02 1.04468583553e-02 8.82009872524e-03 7.67065297497e-03 - 6.93908976898e-03 6.58362639444e-03 6.58362639444e-03 6.93908976898e-03 7.67065297497e-03 8.82009872524e-03 - 1.04468583553e-02 1.26225341258e-02 1.54267827082e-02 1.89341271390e-02 2.31779027969e-02 2.81005086407e-02 - 3.35158471123e-02 3.90976289629e-02 4.44045560444e-02 4.89738024005e-02 5.24797871309e-02 5.48533676650e-02 - 5.62463189889e-02 5.68740665481e-02 5.68740665481e-02 5.62463189889e-02 5.48533676650e-02 5.24797871309e-02 - 4.44868574481e-02 3.90848689472e-02 3.34971688966e-02 2.80994006567e-02 2.31779027969e-02 1.89049688962e-02 - 1.53419303249e-02 1.24650738064e-02 1.02064774226e-02 8.48843476768e-03 7.23847314555e-03 6.39361872594e-03 - 5.90565973456e-03 5.74602373426e-03 5.90565973456e-03 6.39361872594e-03 7.23847314555e-03 8.48843476768e-03 - 1.02064774226e-02 1.24650738064e-02 1.53419303249e-02 1.89049688962e-02 2.31779027969e-02 2.80994006567e-02 - 3.34971688966e-02 3.90848689472e-02 4.44868574481e-02 4.93048229800e-02 5.32152215954e-02 5.60372557288e-02 - 5.77208882781e-02 5.82782465337e-02 5.77208882781e-02 5.60372557288e-02 5.32152215954e-02 4.93048229800e-02 - 3.89160663350e-02 3.34071767353e-02 2.80812943983e-02 2.32023283361e-02 1.89341271390e-02 1.53419303249e-02 - 1.24123312979e-02 1.00865795572e-02 8.29158854156e-03 6.95605972443e-03 6.01563766373e-03 5.41768978229e-03 - 5.12697112440e-03 5.12697112440e-03 5.41768978229e-03 6.01563766373e-03 6.95605972443e-03 8.29158854156e-03 - 1.00865795572e-02 1.24123312979e-02 1.53419303249e-02 1.89341271390e-02 2.32023283361e-02 2.80812943983e-02 - 3.34071767353e-02 3.89160663350e-02 4.42634768270e-02 4.90700187394e-02 5.29846351657e-02 5.57363453523e-02 - 5.71527035674e-02 5.71527035674e-02 5.57363453523e-02 5.29846351657e-02 4.90700187394e-02 4.42634768270e-02 - 3.31691643222e-02 2.80098127199e-02 2.32368358951e-02 1.90175139009e-02 1.54267827082e-02 1.24650738064e-02 - 1.00865795572e-02 8.22635918544e-03 6.81664387654e-03 5.79365065764e-03 5.10253249618e-03 4.70304044562e-03 - 4.57225197605e-03 4.70304044562e-03 5.10253249618e-03 5.79365065764e-03 6.81664387654e-03 8.22635918544e-03 - 1.00865795572e-02 1.24650738064e-02 1.54267827082e-02 1.90175139009e-02 2.32368358951e-02 2.80098127199e-02 - 3.31691643222e-02 3.84534160516e-02 4.35234290368e-02 4.79989400749e-02 5.15101646150e-02 5.37510492057e-02 - 5.45211951056e-02 5.37510492057e-02 5.15101646150e-02 4.79989400749e-02 4.35234290368e-02 3.84534160516e-02 - 2.78466298707e-02 2.32603028496e-02 1.91448778653e-02 1.55924938344e-02 1.26225341258e-02 1.02064774226e-02 - 8.29158854156e-03 6.81664387654e-03 5.72047031573e-03 4.94806264494e-03 4.45623663297e-03 4.21692866215e-03 - 4.21692866215e-03 4.45623663297e-03 4.94806264494e-03 5.72047031573e-03 6.81664387654e-03 8.29158854156e-03 - 1.02064774226e-02 1.26225341258e-02 1.55924938344e-02 1.91448778653e-02 2.32603028496e-02 2.78466298707e-02 - 3.27229087590e-02 3.76190713504e-02 4.21941579647e-02 4.60731359718e-02 4.88987422193e-02 5.03893328752e-02 - 5.03893328752e-02 4.88987422193e-02 4.60731359718e-02 4.21941579647e-02 3.76190713504e-02 3.27229087590e-02 - 2.32562353108e-02 1.93050944183e-02 1.58329883187e-02 1.28827341282e-02 1.04468583553e-02 8.48843476768e-03 - 6.95605972443e-03 5.79365065764e-03 4.94806264494e-03 4.37525079151e-03 4.04374575730e-03 3.93522801758e-03 - 4.04374575730e-03 4.37525079151e-03 4.94806264494e-03 5.79365065764e-03 6.95605972443e-03 8.48843476768e-03 - 1.04468583553e-02 1.28827341282e-02 1.58329883187e-02 1.93050944183e-02 2.32562353108e-02 2.75721078901e-02 - 3.20546920774e-02 3.64263171972e-02 4.03527020822e-02 4.34838779539e-02 4.55081727847e-02 4.62088704848e-02 - 4.55081727847e-02 4.34838779539e-02 4.03527020822e-02 3.64263171972e-02 3.20546920774e-02 2.75721078901e-02 - 1.94921954522e-02 1.61434902729e-02 1.32437842255e-02 1.08088949298e-02 8.82009872524e-03 7.23847314555e-03 - 6.01563766373e-03 5.10253249618e-03 4.45623663297e-03 4.04374575730e-03 3.84302280796e-03 3.84302280796e-03 - 4.04374575730e-03 4.45623663297e-03 5.10253249618e-03 6.01563766373e-03 7.23847314555e-03 8.82009872524e-03 - 1.08088949298e-02 1.32437842255e-02 1.61434902729e-02 1.94921954522e-02 2.32217587400e-02 2.71955666447e-02 - 3.12022017908e-02 3.49654910486e-02 3.81729635435e-02 4.05199675384e-02 4.17618689283e-02 4.17618689283e-02 - 4.05199675384e-02 3.81729635435e-02 3.49654910486e-02 3.12022017908e-02 2.71955666447e-02 2.32217587400e-02 - 1.65234811342e-02 1.37059602390e-02 1.12951380995e-02 9.29162040305e-03 7.67065297497e-03 6.39361872594e-03 - 5.41768978229e-03 4.70304044562e-03 4.21692866215e-03 3.93522801758e-03 3.84302280796e-03 3.93522801758e-03 - 4.21692866215e-03 4.70304044562e-03 5.41768978229e-03 6.39361872594e-03 7.67065297497e-03 9.29162040305e-03 - 1.12951380995e-02 1.37059602390e-02 1.65234811342e-02 1.97084075068e-02 2.31688478126e-02 2.67502344749e-02 - 3.02357338101e-02 3.33624200108e-02 3.58537824974e-02 3.74634706166e-02 3.80204685260e-02 3.74634706166e-02 - 3.58537824974e-02 3.33624200108e-02 3.02357338101e-02 2.67502344749e-02 2.31688478126e-02 1.97084075068e-02 - 1.42727054437e-02 1.19105819676e-02 9.91029781221e-03 8.26229038338e-03 6.93908976898e-03 5.90565973456e-03 - 5.12697112440e-03 4.57225197605e-03 4.21692866215e-03 4.04374575730e-03 4.04374575730e-03 4.21692866215e-03 - 4.57225197605e-03 5.12697112440e-03 5.90565973456e-03 6.93908976898e-03 8.26229038338e-03 9.91029781221e-03 - 1.19105819676e-02 1.42727054437e-02 1.69767793036e-02 1.99620901041e-02 2.31175818882e-02 2.62778950395e-02 - 2.92302840650e-02 3.17358390207e-02 3.35632692529e-02 3.45282284639e-02 3.45282284639e-02 3.35632692529e-02 - 3.17358390207e-02 2.92302840650e-02 2.62778950395e-02 2.31175818882e-02 1.99620901041e-02 1.69767793036e-02 - 1.26620800682e-02 1.06856809758e-02 9.02578945364e-03 7.66717366082e-03 6.58362639444e-03 5.74602373426e-03 - 5.12697112440e-03 4.70304044562e-03 4.45623663297e-03 4.37525079151e-03 4.45623663297e-03 4.70304044562e-03 - 5.12697112440e-03 5.74602373426e-03 6.58362639444e-03 7.66717366082e-03 9.02578945364e-03 1.06856809758e-02 - 1.26620800682e-02 1.49488960464e-02 1.75083321070e-02 2.02621880335e-02 2.30866420056e-02 2.58139075627e-02 - 2.82446089484e-02 3.01717861136e-02 3.14127386696e-02 3.18414068716e-02 3.14127386696e-02 3.01717861136e-02 - 2.82446089484e-02 2.58139075627e-02 2.30866420056e-02 2.02621880335e-02 1.75083321070e-02 1.49488960464e-02 - 1.16276251073e-02 9.97511028176e-03 8.59555582378e-03 7.47255069610e-03 6.58362639444e-03 5.90565973456e-03 - 5.41768978229e-03 5.10253249618e-03 4.94806264494e-03 4.94806264494e-03 5.10253249618e-03 5.41768978229e-03 - 5.90565973456e-03 6.58362639444e-03 7.47255069610e-03 8.59555582378e-03 9.97511028176e-03 1.16276251073e-02 - 1.35553259639e-02 1.57370100687e-02 1.81196807915e-02 2.06126999880e-02 2.30866420056e-02 2.53797852965e-02 - 2.73140021666e-02 2.87187367840e-02 2.94586793037e-02 2.94586793037e-02 2.87187367840e-02 2.73140021666e-02 - 2.53797852965e-02 2.30866420056e-02 2.06126999880e-02 1.81196807915e-02 1.57370100687e-02 1.35553259639e-02 - 1.11228159589e-02 9.74245511371e-03 8.59555582378e-03 7.66717366082e-03 6.93908976898e-03 6.39361872594e-03 - 6.01563766373e-03 5.79365065764e-03 5.72047031573e-03 5.79365065764e-03 6.01563766373e-03 6.39361872594e-03 - 6.93908976898e-03 7.66717366082e-03 8.59555582378e-03 9.74245511371e-03 1.11228159589e-02 1.27424344623e-02 - 1.45906790875e-02 1.66330383744e-02 1.88049742175e-02 2.10090352784e-02 2.31175818882e-02 2.49827563157e-02 - 2.64534808200e-02 2.73972646659e-02 2.77227537368e-02 2.73972646659e-02 2.64534808200e-02 2.49827563157e-02 - 2.31175818882e-02 2.10090352784e-02 1.88049742175e-02 1.66330383744e-02 1.45906790875e-02 1.27424344623e-02 - 1.11228159589e-02 9.97511028176e-03 9.02578945364e-03 8.26229038338e-03 7.67065297497e-03 7.23847314555e-03 - 6.95605972443e-03 6.81664387654e-03 6.81664387654e-03 6.95605972443e-03 7.23847314555e-03 7.67065297497e-03 - 8.26229038338e-03 9.02578945364e-03 9.97511028176e-03 1.11228159589e-02 1.24755048074e-02 1.40283418589e-02 - 1.57591868798e-02 1.76229803621e-02 1.95479913088e-02 2.14361295219e-02 2.31688478126e-02 2.46187421852e-02 - 2.56657154446e-02 2.62153172241e-02 2.62153172241e-02 2.56657154446e-02 2.46187421852e-02 2.31688478126e-02 - 2.14361295219e-02 1.95479913088e-02 1.76229803621e-02 1.57591868798e-02 1.40283418589e-02 1.24755048074e-02 - 1.16276251073e-02 1.06856809758e-02 9.91029781221e-03 9.29162040305e-03 8.82009872524e-03 8.48843476768e-03 - 8.29158854156e-03 8.22635918544e-03 8.29158854156e-03 8.48843476768e-03 8.82009872524e-03 9.29162040305e-03 - 9.91029781221e-03 1.06856809758e-02 1.16276251073e-02 1.27424344623e-02 1.40283418589e-02 1.54709928045e-02 - 1.70389543521e-02 1.86800926235e-02 2.03206914317e-02 2.18687619531e-02 2.32217587400e-02 2.42781130820e-02 - 2.49511167951e-02 2.51823253991e-02 2.49511167951e-02 2.42781130820e-02 2.32217587400e-02 2.18687619531e-02 - 2.03206914317e-02 1.86800926235e-02 1.70389543521e-02 1.54709928045e-02 1.40283418589e-02 1.27424344623e-02 - 1.26620800682e-02 1.19105819676e-02 1.12951380995e-02 1.08088949298e-02 1.04468583553e-02 1.02064774226e-02 - 1.00865795572e-02 1.00865795572e-02 1.02064774226e-02 1.04468583553e-02 1.08088949298e-02 1.12951380995e-02 - 1.19105819676e-02 1.26620800682e-02 1.35553259639e-02 1.45906790875e-02 1.57591868798e-02 1.70389543521e-02 - 1.83921353899e-02 1.97639178277e-02 2.10847229658e-02 2.22755921268e-02 2.32562353108e-02 2.39549635512e-02 - 2.43184216158e-02 2.43184216158e-02 2.39549635512e-02 2.32562353108e-02 2.22755921268e-02 2.10847229658e-02 - 1.97639178277e-02 1.83921353899e-02 1.70389543521e-02 1.57591868798e-02 1.45906790875e-02 1.35553259639e-02 - 1.42727054437e-02 1.37059602390e-02 1.32437842255e-02 1.28827341282e-02 1.26225341258e-02 1.24650738064e-02 - 1.24123312979e-02 1.24650738064e-02 1.26225341258e-02 1.28827341282e-02 1.32437842255e-02 1.37059602390e-02 - 1.42727054437e-02 1.49488960464e-02 1.57370100687e-02 1.66330383744e-02 1.76229803621e-02 1.86800926235e-02 - 1.97639178277e-02 2.08223402545e-02 2.17964249596e-02 2.26267522861e-02 2.32603028496e-02 2.36566460915e-02 - 2.37914166767e-02 2.36566460915e-02 2.32603028496e-02 2.26267522861e-02 2.17964249596e-02 2.08223402545e-02 - 1.97639178277e-02 1.86800926235e-02 1.76229803621e-02 1.66330383744e-02 1.57370100687e-02 1.49488960464e-02 - 1.65234811342e-02 1.61434902729e-02 1.58329883187e-02 1.55924938344e-02 1.54267827082e-02 1.53419303249e-02 - 1.53419303249e-02 1.54267827082e-02 1.55924938344e-02 1.58329883187e-02 1.61434902729e-02 1.65234811342e-02 - 1.69767793036e-02 1.75083321070e-02 1.81196807915e-02 1.88049742175e-02 1.95479913088e-02 2.03206914317e-02 - 2.10847229658e-02 2.17964249596e-02 2.24136125305e-02 2.29016184223e-02 2.32368358951e-02 2.34067395586e-02 - 2.34067395586e-02 2.32368358951e-02 2.29016184223e-02 2.24136125305e-02 2.17964249596e-02 2.10847229658e-02 - 2.03206914317e-02 1.95479913088e-02 1.88049742175e-02 1.81196807915e-02 1.75083321070e-02 1.69767793036e-02 - 1.94921954522e-02 1.93050944183e-02 1.91448778653e-02 1.90175139009e-02 1.89341271390e-02 1.89049688962e-02 - 1.89341271390e-02 1.90175139009e-02 1.91448778653e-02 1.93050944183e-02 1.94921954522e-02 1.97084075068e-02 - 1.99620901041e-02 2.02621880335e-02 2.06126999880e-02 2.10090352784e-02 2.14361295219e-02 2.18687619531e-02 - 2.22755921268e-02 2.26267522861e-02 2.29016184223e-02 2.30924993956e-02 2.32023283361e-02 2.32378434698e-02 - 2.32023283361e-02 2.30924993956e-02 2.29016184223e-02 2.26267522861e-02 2.22755921268e-02 2.18687619531e-02 - 2.14361295219e-02 2.10090352784e-02 2.06126999880e-02 2.02621880335e-02 1.99620901041e-02 1.97084075068e-02 - 2.32562353108e-02 2.32603028496e-02 2.32368358951e-02 2.32023283361e-02 2.31779027969e-02 2.31779027969e-02 - 2.32023283361e-02 2.32368358951e-02 2.32603028496e-02 2.32562353108e-02 2.32217587400e-02 2.31688478126e-02 - 2.31175818882e-02 2.30866420056e-02 2.30866420056e-02 2.31175818882e-02 2.31688478126e-02 2.32217587400e-02 - 2.32562353108e-02 2.32603028496e-02 2.32368358951e-02 2.32023283361e-02 2.31779027969e-02 2.31779027969e-02 - 2.32023283361e-02 2.32368358951e-02 2.32603028496e-02 2.32562353108e-02 2.32217587400e-02 2.31688478126e-02 - 2.31175818882e-02 2.30866420056e-02 2.30866420056e-02 2.31175818882e-02 2.31688478126e-02 2.32217587400e-02 - 2.78466298707e-02 2.80098127199e-02 2.80812943983e-02 2.80994006567e-02 2.81005086407e-02 2.80994006567e-02 - 2.80812943983e-02 2.80098127199e-02 2.78466298707e-02 2.75721078901e-02 2.71955666447e-02 2.67502344749e-02 - 2.62778950395e-02 2.58139075627e-02 2.53797852965e-02 2.49827563157e-02 2.46187421852e-02 2.42781130820e-02 - 2.39549635512e-02 2.36566460915e-02 2.34067395586e-02 2.32378434698e-02 2.31779027969e-02 2.32378434698e-02 - 2.34067395586e-02 2.36566460915e-02 2.39549635512e-02 2.42781130820e-02 2.46187421852e-02 2.49827563157e-02 - 2.53797852965e-02 2.58139075627e-02 2.62778950395e-02 2.67502344749e-02 2.71955666447e-02 2.75721078901e-02 - 3.31691643222e-02 3.34071767353e-02 3.34971688966e-02 3.35158471123e-02 3.35158471123e-02 3.34971688966e-02 - 3.34071767353e-02 3.31691643222e-02 3.27229087590e-02 3.20546920774e-02 3.12022017908e-02 3.02357338101e-02 - 2.92302840650e-02 2.82446089484e-02 2.73140021666e-02 2.64534808200e-02 2.56657154446e-02 2.49511167951e-02 - 2.43184216158e-02 2.37914166767e-02 2.34067395586e-02 2.32023283361e-02 2.32023283361e-02 2.34067395586e-02 - 2.37914166767e-02 2.43184216158e-02 2.49511167951e-02 2.56657154446e-02 2.64534808200e-02 2.73140021666e-02 - 2.82446089484e-02 2.92302840650e-02 3.02357338101e-02 3.12022017908e-02 3.20546920774e-02 3.27229087590e-02 - 3.89160663350e-02 3.90848689472e-02 3.90976289629e-02 3.90842281235e-02 3.90976289629e-02 3.90848689472e-02 - 3.89160663350e-02 3.84534160516e-02 3.76190713504e-02 3.64263171972e-02 3.49654910486e-02 3.33624200108e-02 - 3.17358390207e-02 3.01717861136e-02 2.87187367840e-02 2.73972646659e-02 2.62153172241e-02 2.51823253991e-02 - 2.43184216158e-02 2.36566460915e-02 2.32368358951e-02 2.30924993956e-02 2.32368358951e-02 2.36566460915e-02 - 2.43184216158e-02 2.51823253991e-02 2.62153172241e-02 2.73972646659e-02 2.87187367840e-02 3.01717861136e-02 - 3.17358390207e-02 3.33624200108e-02 3.49654910486e-02 3.64263171972e-02 3.76190713504e-02 3.84534160516e-02 - 4.44868574481e-02 4.44045560444e-02 4.42752514752e-02 4.42752514752e-02 4.44045560444e-02 4.44868574481e-02 - 4.42634768270e-02 4.35234290368e-02 4.21941579647e-02 4.03527020822e-02 3.81729635435e-02 3.58537824974e-02 - 3.35632692529e-02 3.14127386696e-02 2.94586793037e-02 2.77227537368e-02 2.62153172241e-02 2.49511167951e-02 - 2.39549635512e-02 2.32603028496e-02 2.29016184223e-02 2.29016184223e-02 2.32603028496e-02 2.39549635512e-02 - 2.49511167951e-02 2.62153172241e-02 2.77227537368e-02 2.94586793037e-02 3.14127386696e-02 3.35632692529e-02 - 3.58537824974e-02 3.81729635435e-02 4.03527020822e-02 4.21941579647e-02 4.35234290368e-02 4.42634768270e-02 - 4.89738024005e-02 4.85080722970e-02 4.83002627794e-02 4.85080722970e-02 4.89738024005e-02 4.93048229800e-02 - 4.90700187394e-02 4.79989400749e-02 4.60731359718e-02 4.34838779539e-02 4.05199675384e-02 3.74634706166e-02 - 3.45282284639e-02 3.18414068716e-02 2.94586793037e-02 2.73972646659e-02 2.56657154446e-02 2.42781130820e-02 - 2.32562353108e-02 2.26267522861e-02 2.24136125305e-02 2.26267522861e-02 2.32562353108e-02 2.42781130820e-02 - 2.56657154446e-02 2.73972646659e-02 2.94586793037e-02 3.18414068716e-02 3.45282284639e-02 3.74634706166e-02 - 4.05199675384e-02 4.34838779539e-02 4.60731359718e-02 4.79989400749e-02 4.90700187394e-02 4.93048229800e-02 - 5.13869204668e-02 5.06194135765e-02 5.06194135765e-02 5.13869204668e-02 5.24797871309e-02 5.32152215954e-02 - 5.29846351657e-02 5.15101646150e-02 4.88987422193e-02 4.55081727847e-02 4.17618689283e-02 3.80204685260e-02 - 3.45282284639e-02 3.14127386696e-02 2.87187367840e-02 2.64534808200e-02 2.46187421852e-02 2.32217587400e-02 - 2.22755921268e-02 2.17964249596e-02 2.17964249596e-02 2.22755921268e-02 2.32217587400e-02 2.46187421852e-02 - 2.64534808200e-02 2.87187367840e-02 3.14127386696e-02 3.45282284639e-02 3.80204685260e-02 4.17618689283e-02 - 4.55081727847e-02 4.88987422193e-02 5.15101646150e-02 5.29846351657e-02 5.32152215954e-02 5.24797871309e-02 - 5.12221625406e-02 5.05555186569e-02 5.12221625406e-02 5.29210396854e-02 5.48533676650e-02 5.60372557288e-02 - 5.57363453523e-02 5.37510492057e-02 5.03893328752e-02 4.62088704848e-02 4.17618689283e-02 3.74634706166e-02 - 3.35632692529e-02 3.01717861136e-02 2.73140021666e-02 2.49827563157e-02 2.31688478126e-02 2.18687619531e-02 - 2.10847229658e-02 2.08223402545e-02 2.10847229658e-02 2.18687619531e-02 2.31688478126e-02 2.49827563157e-02 - 2.73140021666e-02 3.01717861136e-02 3.35632692529e-02 3.74634706166e-02 4.17618689283e-02 4.62088704848e-02 - 5.03893328752e-02 5.37510492057e-02 5.57363453523e-02 5.60372557288e-02 5.48533676650e-02 5.29210396854e-02 - 4.89850720157e-02 4.89850720157e-02 5.07010770424e-02 5.34983990182e-02 5.62463189889e-02 5.77208882781e-02 - 5.71527035674e-02 5.45211951056e-02 5.03893328752e-02 4.55081727847e-02 4.05199675384e-02 3.58537824974e-02 - 3.17358390207e-02 2.82446089484e-02 2.53797852965e-02 2.31175818882e-02 2.14361295219e-02 2.03206914317e-02 - 1.97639178277e-02 1.97639178277e-02 2.03206914317e-02 2.14361295219e-02 2.31175818882e-02 2.53797852965e-02 - 2.82446089484e-02 3.17358390207e-02 3.58537824974e-02 4.05199675384e-02 4.55081727847e-02 5.03893328752e-02 - 5.45211951056e-02 5.71527035674e-02 5.77208882781e-02 5.62463189889e-02 5.34983990182e-02 5.07010770424e-02 - 4.60013609401e-02 4.70389926376e-02 4.98718618187e-02 5.36143814352e-02 5.68740665481e-02 5.82782465337e-02 - 5.71527035674e-02 5.37510492057e-02 4.88987422193e-02 4.34838779539e-02 3.81729635435e-02 3.33624200108e-02 - 2.92302840650e-02 2.58139075627e-02 2.30866420056e-02 2.10090352784e-02 1.95479913088e-02 1.86800926235e-02 - 1.83921353899e-02 1.86800926235e-02 1.95479913088e-02 2.10090352784e-02 2.30866420056e-02 2.58139075627e-02 - 2.92302840650e-02 3.33624200108e-02 3.81729635435e-02 4.34838779539e-02 4.88987422193e-02 5.37510492057e-02 - 5.71527035674e-02 5.82782465337e-02 5.68740665481e-02 5.36143814352e-02 4.98718618187e-02 4.70389926376e-02 - 4.35588929466e-02 4.56222411881e-02 4.93308963719e-02 5.36149267734e-02 5.68740665481e-02 5.77208882781e-02 - 5.57363453523e-02 5.15101646150e-02 4.60731359718e-02 4.03527020822e-02 3.49654910486e-02 3.02357338101e-02 - 2.62778950395e-02 2.30866420056e-02 2.06126999880e-02 1.88049742175e-02 1.76229803621e-02 1.70389543521e-02 - 1.70389543521e-02 1.76229803621e-02 1.88049742175e-02 2.06126999880e-02 2.30866420056e-02 2.62778950395e-02 - 3.02357338101e-02 3.49654910486e-02 4.03527020822e-02 4.60731359718e-02 5.15101646150e-02 5.57363453523e-02 - 5.77208882781e-02 5.68740665481e-02 5.36149267734e-02 4.93308963719e-02 4.56222411881e-02 4.35588929466e-02 - 4.22847991283e-02 4.51254329663e-02 4.93308963719e-02 5.36143814352e-02 5.62463189889e-02 5.60372557288e-02 - 5.29846351657e-02 4.79989400749e-02 4.21941579647e-02 3.64263171972e-02 3.12022017908e-02 2.67502344749e-02 - 2.31175818882e-02 2.02621880335e-02 1.81196807915e-02 1.66330383744e-02 1.57591868798e-02 1.54709928045e-02 - 1.57591868798e-02 1.66330383744e-02 1.81196807915e-02 2.02621880335e-02 2.31175818882e-02 2.67502344749e-02 - 3.12022017908e-02 3.64263171972e-02 4.21941579647e-02 4.79989400749e-02 5.29846351657e-02 5.60372557288e-02 - 5.62463189889e-02 5.36143814352e-02 4.93308963719e-02 4.51254329663e-02 4.22847991283e-02 4.13123485649e-02 - 4.22847991283e-02 4.56222411881e-02 4.98718618187e-02 5.34983990182e-02 5.48533676650e-02 5.32152215954e-02 - 4.90700187394e-02 4.35234290368e-02 3.76190713504e-02 3.20546920774e-02 2.71955666447e-02 2.31688478126e-02 - 1.99620901041e-02 1.75083321070e-02 1.57370100687e-02 1.45906790875e-02 1.40283418589e-02 1.40283418589e-02 - 1.45906790875e-02 1.57370100687e-02 1.75083321070e-02 1.99620901041e-02 2.31688478126e-02 2.71955666447e-02 - 3.20546920774e-02 3.76190713504e-02 4.35234290368e-02 4.90700187394e-02 5.32152215954e-02 5.48533676650e-02 - 5.34983990182e-02 4.98718618187e-02 4.56222411881e-02 4.22847991283e-02 4.05694134160e-02 4.05694134160e-02 - 4.35588929466e-02 4.70389926376e-02 5.07010770424e-02 5.29210396854e-02 5.24797871309e-02 4.93048229800e-02 - 4.42634768270e-02 3.84534160516e-02 3.27229087590e-02 2.75721078901e-02 2.32217587400e-02 1.97084075068e-02 - 1.69767793036e-02 1.49488960464e-02 1.35553259639e-02 1.27424344623e-02 1.24755048074e-02 1.27424344623e-02 - 1.35553259639e-02 1.49488960464e-02 1.69767793036e-02 1.97084075068e-02 2.32217587400e-02 2.75721078901e-02 - 3.27229087590e-02 3.84534160516e-02 4.42634768270e-02 4.93048229800e-02 5.24797871309e-02 5.29210396854e-02 - 5.07010770424e-02 4.70389926376e-02 4.35588929466e-02 4.13123485649e-02 4.05694134160e-02 4.13123485649e-02 - 5.75824043038e-02 5.67236888968e-02 5.43925934286e-02 5.03535465114e-02 4.49623774036e-02 3.89160663350e-02 - 3.28952522339e-02 2.73794467347e-02 2.26267522861e-02 1.87162119832e-02 1.56112881223e-02 1.32272933414e-02 - 1.14766013692e-02 1.02846446979e-02 9.59384043225e-03 9.36769905218e-03 9.59384043225e-03 1.02846446979e-02 - 1.14766013692e-02 1.32272933414e-02 1.56112881223e-02 1.87162119832e-02 2.26267522861e-02 2.73794467347e-02 - 3.28952522339e-02 3.89160663350e-02 4.49623774036e-02 5.03535465114e-02 5.43925934286e-02 5.67236888968e-02 - 5.75824043038e-02 5.76200322747e-02 5.74463352203e-02 5.73653289979e-02 5.74463352203e-02 5.76200322747e-02 - 5.67236888968e-02 5.43239294918e-02 5.04463447592e-02 4.52857661696e-02 3.93968315223e-02 3.34071767353e-02 - 2.78094015925e-02 2.29016184223e-02 1.88053010662e-02 1.55127511572e-02 1.29494247541e-02 1.10259974674e-02 - 9.66211927865e-03 8.79214216133e-03 8.36917339040e-03 8.36917339040e-03 8.79214216133e-03 9.66211927865e-03 - 1.10259974674e-02 1.29494247541e-02 1.55127511572e-02 1.88053010662e-02 2.29016184223e-02 2.78094015925e-02 - 3.34071767353e-02 3.93968315223e-02 4.52857661696e-02 5.04463447592e-02 5.43239294918e-02 5.67236888968e-02 - 5.79103146750e-02 5.83777841365e-02 5.85232784436e-02 5.85232784436e-02 5.83777841365e-02 5.79103146750e-02 - 5.43925934286e-02 5.04463447592e-02 4.53738413591e-02 3.96081166256e-02 3.36893635306e-02 2.80812943983e-02 - 2.30924993956e-02 1.88720574247e-02 1.54388806266e-02 1.27327884289e-02 1.06671499136e-02 9.15892896774e-03 - 8.13716815266e-03 7.54684340873e-03 7.35383003280e-03 7.54684340873e-03 8.13716815266e-03 9.15892896774e-03 - 1.06671499136e-02 1.27327884289e-02 1.54388806266e-02 1.88720574247e-02 2.30924993956e-02 2.80812943983e-02 - 3.36893635306e-02 3.96081166256e-02 4.53738413591e-02 5.04463447592e-02 5.43925934286e-02 5.70772559013e-02 - 5.86758842735e-02 5.94868177545e-02 5.97323039443e-02 5.94868177545e-02 5.86758842735e-02 5.70772559013e-02 - 5.03535465114e-02 4.52857661696e-02 3.96081166256e-02 3.37780927799e-02 2.82105864296e-02 2.32023283361e-02 - 1.89142861556e-02 1.53857855201e-02 1.25723726562e-02 1.03937663652e-02 8.76725594498e-03 7.61927184895e-03 - 6.88914005847e-03 6.53448601861e-03 6.53448601861e-03 6.88914005847e-03 7.61927184895e-03 8.76725594498e-03 - 1.03937663652e-02 1.25723726562e-02 1.53857855201e-02 1.89142861556e-02 2.32023283361e-02 2.82105864296e-02 - 3.37780927799e-02 3.96081166256e-02 4.52857661696e-02 5.03535465114e-02 5.44475263977e-02 5.74105494947e-02 - 5.92810318582e-02 6.01752681104e-02 6.01752681104e-02 5.92810318582e-02 5.74105494947e-02 5.44475263977e-02 - 4.49623774036e-02 3.93968315223e-02 3.36893635306e-02 2.82105864296e-02 2.32378434698e-02 1.89341271390e-02 - 1.53530693596e-02 1.24657333634e-02 1.02011860999e-02 8.47998103933e-03 7.22847713667e-03 6.38291972351e-03 - 5.89466652251e-03 5.73495116497e-03 5.89466652251e-03 6.38291972351e-03 7.22847713667e-03 8.47998103933e-03 - 1.02011860999e-02 1.24657333634e-02 1.53530693596e-02 1.89341271390e-02 2.32378434698e-02 2.82105864296e-02 - 3.36893635306e-02 3.93968315223e-02 4.49623774036e-02 4.99825941802e-02 5.41129564364e-02 5.71366804742e-02 - 5.89627863020e-02 5.95715936141e-02 5.89627863020e-02 5.71366804742e-02 5.41129564364e-02 4.99825941802e-02 - 3.89160663350e-02 3.34071767353e-02 2.80812943983e-02 2.32023283361e-02 1.89341271390e-02 1.53419303249e-02 - 1.24123312979e-02 1.00865795572e-02 8.29158854156e-03 6.95605972443e-03 6.01563766373e-03 5.41768978229e-03 - 5.12697112440e-03 5.12697112440e-03 5.41768978229e-03 6.01563766373e-03 6.95605972443e-03 8.29158854156e-03 - 1.00865795572e-02 1.24123312979e-02 1.53419303249e-02 1.89341271390e-02 2.32023283361e-02 2.80812943983e-02 - 3.34071767353e-02 3.89160663350e-02 4.42634768270e-02 4.90700187394e-02 5.29846351657e-02 5.57363453523e-02 - 5.71527035674e-02 5.71527035674e-02 5.57363453523e-02 5.29846351657e-02 4.90700187394e-02 4.42634768270e-02 - 3.28952522339e-02 2.78094015925e-02 2.30924993956e-02 1.89142861556e-02 1.53530693596e-02 1.24123312979e-02 - 1.00485204973e-02 8.19834740781e-03 6.79537428806e-03 5.77685140016e-03 5.08859106656e-03 4.69069423954e-03 - 4.56041706509e-03 4.69069423954e-03 5.08859106656e-03 5.77685140016e-03 6.79537428806e-03 8.19834740781e-03 - 1.00485204973e-02 1.24123312979e-02 1.53530693596e-02 1.89142861556e-02 2.30924993956e-02 2.78094015925e-02 - 3.28952522339e-02 3.80886538087e-02 4.30547772101e-02 4.74231711778e-02 5.08390344517e-02 5.30133769166e-02 - 5.37595739225e-02 5.30133769166e-02 5.08390344517e-02 4.74231711778e-02 4.30547772101e-02 3.80886538087e-02 - 2.73794467347e-02 2.29016184223e-02 1.88720574247e-02 1.53857855201e-02 1.24657333634e-02 1.00865795572e-02 - 8.19834740781e-03 6.74228118806e-03 5.65928321674e-03 4.89581524939e-03 4.40955813989e-03 4.17292027232e-03 - 4.17292027232e-03 4.40955813989e-03 4.89581524939e-03 5.65928321674e-03 6.74228118806e-03 8.19834740781e-03 - 1.00865795572e-02 1.24657333634e-02 1.53857855201e-02 1.88720574247e-02 2.29016184223e-02 2.73794467347e-02 - 3.21243272248e-02 3.68707660171e-02 4.12888114430e-02 4.50208900473e-02 4.77311231410e-02 4.91578982971e-02 - 4.91578982971e-02 4.77311231410e-02 4.50208900473e-02 4.12888114430e-02 3.68707660171e-02 3.21243272248e-02 - 2.26267522861e-02 1.88053010662e-02 1.54388806266e-02 1.25723726562e-02 1.02011860999e-02 8.29158854156e-03 - 6.79537428806e-03 5.65928321674e-03 4.83232712929e-03 4.27192322596e-03 3.94752033538e-03 3.84131375804e-03 - 3.94752033538e-03 4.27192322596e-03 4.83232712929e-03 5.65928321674e-03 6.79537428806e-03 8.29158854156e-03 - 1.02011860999e-02 1.25723726562e-02 1.54388806266e-02 1.88053010662e-02 2.26267522861e-02 2.67889182249e-02 - 3.10978190541e-02 3.52857897121e-02 3.90350130516e-02 4.20165784801e-02 4.39402098517e-02 4.46053414397e-02 - 4.39402098517e-02 4.20165784801e-02 3.90350130516e-02 3.52857897121e-02 3.10978190541e-02 2.67889182249e-02 - 1.87162119832e-02 1.55127511572e-02 1.27327884289e-02 1.03937663652e-02 8.47998103933e-03 6.95605972443e-03 - 5.77685140016e-03 4.89581524939e-03 4.27192322596e-03 3.87358926493e-03 3.67971968314e-03 3.67971968314e-03 - 3.87358926493e-03 4.27192322596e-03 4.89581524939e-03 5.77685140016e-03 6.95605972443e-03 8.47998103933e-03 - 1.03937663652e-02 1.27327884289e-02 1.55127511572e-02 1.87162119832e-02 2.22755921268e-02 2.60582031450e-02 - 2.98615217076e-02 3.34242157073e-02 3.64535808156e-02 3.86662855632e-02 3.98358227133e-02 3.98358227133e-02 - 3.86662855632e-02 3.64535808156e-02 3.34242157073e-02 2.98615217076e-02 2.60582031450e-02 2.22755921268e-02 - 1.56112881223e-02 1.29494247541e-02 1.06671499136e-02 8.76725594498e-03 7.22847713667e-03 6.01563766373e-03 - 5.08859106656e-03 4.40955813989e-03 3.94752033538e-03 3.67971968314e-03 3.59206217435e-03 3.67971968314e-03 - 3.94752033538e-03 4.40955813989e-03 5.08859106656e-03 6.01563766373e-03 7.22847713667e-03 8.76725594498e-03 - 1.06671499136e-02 1.29494247541e-02 1.56112881223e-02 1.86137801375e-02 2.18687619531e-02 2.52298202509e-02 - 2.84935612207e-02 3.14154606035e-02 3.37399765679e-02 3.52402742752e-02 3.57591480990e-02 3.52402742752e-02 - 3.37399765679e-02 3.14154606035e-02 2.84935612207e-02 2.52298202509e-02 2.18687619531e-02 1.86137801375e-02 - 1.32272933414e-02 1.10259974674e-02 9.15892896774e-03 7.61927184895e-03 6.38291972351e-03 5.41768978229e-03 - 4.69069423954e-03 4.17292027232e-03 3.84131375804e-03 3.67971968314e-03 3.67971968314e-03 3.84131375804e-03 - 4.17292027232e-03 4.69069423954e-03 5.41768978229e-03 6.38291972351e-03 7.61927184895e-03 9.15892896774e-03 - 1.10259974674e-02 1.32272933414e-02 1.57423428102e-02 1.85132658939e-02 2.14361295219e-02 2.43576039836e-02 - 2.70818268649e-02 2.93901320501e-02 3.10717223250e-02 3.19590319446e-02 3.19590319446e-02 3.10717223250e-02 - 2.93901320501e-02 2.70818268649e-02 2.43576039836e-02 2.14361295219e-02 1.85132658939e-02 1.57423428102e-02 - 1.14766013692e-02 9.66211927865e-03 8.13716815266e-03 6.88914005847e-03 5.89466652251e-03 5.12697112440e-03 - 4.56041706509e-03 4.17292027232e-03 3.94752033538e-03 3.87358926493e-03 3.94752033538e-03 4.17292027232e-03 - 4.56041706509e-03 5.12697112440e-03 5.89466652251e-03 6.88914005847e-03 8.13716815266e-03 9.66211927865e-03 - 1.14766013692e-02 1.35733603577e-02 1.59162612755e-02 1.84326960165e-02 2.10090352784e-02 2.34923498457e-02 - 2.57019293917e-02 2.74512061786e-02 2.85763383726e-02 2.89647599965e-02 2.85763383726e-02 2.74512061786e-02 - 2.57019293917e-02 2.34923498457e-02 2.10090352784e-02 1.84326960165e-02 1.59162612755e-02 1.35733603577e-02 - 1.02846446979e-02 8.79214216133e-03 7.54684340873e-03 6.53448601861e-03 5.73495116497e-03 5.12697112440e-03 - 4.69069423954e-03 4.40955813989e-03 4.27192322596e-03 4.27192322596e-03 4.40955813989e-03 4.69069423954e-03 - 5.12697112440e-03 5.73495116497e-03 6.53448601861e-03 7.54684340873e-03 8.79214216133e-03 1.02846446979e-02 - 1.20255038743e-02 1.39945083398e-02 1.61427916872e-02 1.83878553878e-02 2.06126999880e-02 2.26718438342e-02 - 2.44059448105e-02 2.56635113913e-02 2.63252408289e-02 2.63252408289e-02 2.56635113913e-02 2.44059448105e-02 - 2.26718438342e-02 2.06126999880e-02 1.83878553878e-02 1.61427916872e-02 1.39945083398e-02 1.20255038743e-02 - 9.59384043225e-03 8.36917339040e-03 7.35383003280e-03 6.53448601861e-03 5.89466652251e-03 5.41768978229e-03 - 5.08859106656e-03 4.89581524939e-03 4.83232712929e-03 4.89581524939e-03 5.08859106656e-03 5.41768978229e-03 - 5.89466652251e-03 6.53448601861e-03 7.35383003280e-03 8.36917339040e-03 9.59384043225e-03 1.10330000246e-02 - 1.26769712537e-02 1.44944499034e-02 1.64272283654e-02 1.83878553878e-02 2.02621880335e-02 2.19185274002e-02 - 2.32231030162e-02 2.40594329852e-02 2.43476957086e-02 2.40594329852e-02 2.32231030162e-02 2.19185274002e-02 - 2.02621880335e-02 1.83878553878e-02 1.64272283654e-02 1.44944499034e-02 1.26769712537e-02 1.10330000246e-02 - 9.36769905218e-03 8.36917339040e-03 7.54684340873e-03 6.88914005847e-03 6.38291972351e-03 6.01563766373e-03 - 5.77685140016e-03 5.65928321674e-03 5.65928321674e-03 5.77685140016e-03 6.01563766373e-03 6.38291972351e-03 - 6.88914005847e-03 7.54684340873e-03 8.36917339040e-03 9.36769905218e-03 1.05489279259e-02 1.19093466628e-02 - 1.34297677852e-02 1.50702461704e-02 1.67669692380e-02 1.84326960165e-02 1.99620901041e-02 2.12421582644e-02 - 2.21666114252e-02 2.26519365039e-02 2.26519365039e-02 2.21666114252e-02 2.12421582644e-02 1.99620901041e-02 - 1.84326960165e-02 1.67669692380e-02 1.50702461704e-02 1.34297677852e-02 1.19093466628e-02 1.05489279259e-02 - 9.59384043225e-03 8.79214216133e-03 8.13716815266e-03 7.61927184895e-03 7.22847713667e-03 6.95605972443e-03 - 6.79537428806e-03 6.74228118806e-03 6.79537428806e-03 6.95605972443e-03 7.22847713667e-03 7.61927184895e-03 - 8.13716815266e-03 8.79214216133e-03 9.59384043225e-03 1.05489279259e-02 1.16573532374e-02 1.29079014387e-02 - 1.42737851127e-02 1.57094271493e-02 1.71497889118e-02 1.85132658939e-02 1.97084075068e-02 2.06439962171e-02 - 2.12413612776e-02 2.14468462049e-02 2.12413612776e-02 2.06439962171e-02 1.97084075068e-02 1.85132658939e-02 - 1.71497889118e-02 1.57094271493e-02 1.42737851127e-02 1.29079014387e-02 1.16573532374e-02 1.05489279259e-02 - 1.02846446979e-02 9.66211927865e-03 9.15892896774e-03 8.76725594498e-03 8.47998103933e-03 8.29158854156e-03 - 8.19834740781e-03 8.19834740781e-03 8.29158854156e-03 8.47998103933e-03 8.76725594498e-03 9.15892896774e-03 - 9.66211927865e-03 1.02846446979e-02 1.10330000246e-02 1.19093466628e-02 1.29079014387e-02 1.40112393540e-02 - 1.51874137660e-02 1.63890080671e-02 1.75547637226e-02 1.86137801375e-02 1.94921954522e-02 2.01220876747e-02 - 2.04512222766e-02 2.04512222766e-02 2.01220876747e-02 1.94921954522e-02 1.86137801375e-02 1.75547637226e-02 - 1.63890080671e-02 1.51874137660e-02 1.40112393540e-02 1.29079014387e-02 1.19093466628e-02 1.10330000246e-02 - 1.14766013692e-02 1.10259974674e-02 1.06671499136e-02 1.03937663652e-02 1.02011860999e-02 1.00865795572e-02 - 1.00485204973e-02 1.00865795572e-02 1.02011860999e-02 1.03937663652e-02 1.06671499136e-02 1.10259974674e-02 - 1.14766013692e-02 1.20255038743e-02 1.26769712537e-02 1.34297677852e-02 1.42737851127e-02 1.51874137660e-02 - 1.61367490443e-02 1.70770073925e-02 1.79555609317e-02 1.87162119832e-02 1.93050944183e-02 1.96777557044e-02 - 1.98052910067e-02 1.96777557044e-02 1.93050944183e-02 1.87162119832e-02 1.79555609317e-02 1.70770073925e-02 - 1.61367490443e-02 1.51874137660e-02 1.42737851127e-02 1.34297677852e-02 1.26769712537e-02 1.20255038743e-02 - 1.32272933414e-02 1.29494247541e-02 1.27327884289e-02 1.25723726562e-02 1.24657333634e-02 1.24123312979e-02 - 1.24123312979e-02 1.24657333634e-02 1.25723726562e-02 1.27327884289e-02 1.29494247541e-02 1.32272933414e-02 - 1.35733603577e-02 1.39945083398e-02 1.44944499034e-02 1.50702461704e-02 1.57094271493e-02 1.63890080671e-02 - 1.70770073925e-02 1.77355963866e-02 1.83246021902e-02 1.88053010662e-02 1.91448778653e-02 1.93203741197e-02 - 1.93203741197e-02 1.91448778653e-02 1.88053010662e-02 1.83246021902e-02 1.77355963866e-02 1.70770073925e-02 - 1.63890080671e-02 1.57094271493e-02 1.50702461704e-02 1.44944499034e-02 1.39945083398e-02 1.35733603577e-02 - 1.56112881223e-02 1.55127511572e-02 1.54388806266e-02 1.53857855201e-02 1.53530693596e-02 1.53419303249e-02 - 1.53530693596e-02 1.53857855201e-02 1.54388806266e-02 1.55127511572e-02 1.56112881223e-02 1.57423428102e-02 - 1.59162612755e-02 1.61427916872e-02 1.64272283654e-02 1.67669692380e-02 1.71497889118e-02 1.75547637226e-02 - 1.79555609317e-02 1.83246021902e-02 1.86367379277e-02 1.88720574247e-02 1.90175139009e-02 1.90666010177e-02 - 1.90175139009e-02 1.88720574247e-02 1.86367379277e-02 1.83246021902e-02 1.79555609317e-02 1.75547637226e-02 - 1.71497889118e-02 1.67669692380e-02 1.64272283654e-02 1.61427916872e-02 1.59162612755e-02 1.57423428102e-02 - 1.87162119832e-02 1.88053010662e-02 1.88720574247e-02 1.89142861556e-02 1.89341271390e-02 1.89341271390e-02 - 1.89142861556e-02 1.88720574247e-02 1.88053010662e-02 1.87162119832e-02 1.86137801375e-02 1.85132658939e-02 - 1.84326960165e-02 1.83878553878e-02 1.83878553878e-02 1.84326960165e-02 1.85132658939e-02 1.86137801375e-02 - 1.87162119832e-02 1.88053010662e-02 1.88720574247e-02 1.89142861556e-02 1.89341271390e-02 1.89341271390e-02 - 1.89142861556e-02 1.88720574247e-02 1.88053010662e-02 1.87162119832e-02 1.86137801375e-02 1.85132658939e-02 - 1.84326960165e-02 1.83878553878e-02 1.83878553878e-02 1.84326960165e-02 1.85132658939e-02 1.86137801375e-02 - 2.26267522861e-02 2.29016184223e-02 2.30924993956e-02 2.32023283361e-02 2.32378434698e-02 2.32023283361e-02 - 2.30924993956e-02 2.29016184223e-02 2.26267522861e-02 2.22755921268e-02 2.18687619531e-02 2.14361295219e-02 - 2.10090352784e-02 2.06126999880e-02 2.02621880335e-02 1.99620901041e-02 1.97084075068e-02 1.94921954522e-02 - 1.93050944183e-02 1.91448778653e-02 1.90175139009e-02 1.89341271390e-02 1.89049688962e-02 1.89341271390e-02 - 1.90175139009e-02 1.91448778653e-02 1.93050944183e-02 1.94921954522e-02 1.97084075068e-02 1.99620901041e-02 - 2.02621880335e-02 2.06126999880e-02 2.10090352784e-02 2.14361295219e-02 2.18687619531e-02 2.22755921268e-02 - 2.73794467347e-02 2.78094015925e-02 2.80812943983e-02 2.82105864296e-02 2.82105864296e-02 2.80812943983e-02 - 2.78094015925e-02 2.73794467347e-02 2.67889182249e-02 2.60582031450e-02 2.52298202509e-02 2.43576039836e-02 - 2.34923498457e-02 2.26718438342e-02 2.19185274002e-02 2.12421582644e-02 2.06439962171e-02 2.01220876747e-02 - 1.96777557044e-02 1.93203741197e-02 1.90666010177e-02 1.89341271390e-02 1.89341271390e-02 1.90666010177e-02 - 1.93203741197e-02 1.96777557044e-02 2.01220876747e-02 2.06439962171e-02 2.12421582644e-02 2.19185274002e-02 - 2.26718438342e-02 2.34923498457e-02 2.43576039836e-02 2.52298202509e-02 2.60582031450e-02 2.67889182249e-02 - 3.28952522339e-02 3.34071767353e-02 3.36893635306e-02 3.37780927799e-02 3.36893635306e-02 3.34071767353e-02 - 3.28952522339e-02 3.21243272248e-02 3.10978190541e-02 2.98615217076e-02 2.84935612207e-02 2.70818268649e-02 - 2.57019293917e-02 2.44059448105e-02 2.32231030162e-02 2.21666114252e-02 2.12413612776e-02 2.04512222766e-02 - 1.98052910067e-02 1.93203741197e-02 1.90175139009e-02 1.89142861556e-02 1.90175139009e-02 1.93203741197e-02 - 1.98052910067e-02 2.04512222766e-02 2.12413612776e-02 2.21666114252e-02 2.32231030162e-02 2.44059448105e-02 - 2.57019293917e-02 2.70818268649e-02 2.84935612207e-02 2.98615217076e-02 3.10978190541e-02 3.21243272248e-02 - 3.89160663350e-02 3.93968315223e-02 3.96081166256e-02 3.96081166256e-02 3.93968315223e-02 3.89160663350e-02 - 3.80886538087e-02 3.68707660171e-02 3.52857897121e-02 3.34242157073e-02 3.14154606035e-02 2.93901320501e-02 - 2.74512061786e-02 2.56635113913e-02 2.40594329852e-02 2.26519365039e-02 2.14468462049e-02 2.04512222766e-02 - 1.96777557044e-02 1.91448778653e-02 1.88720574247e-02 1.88720574247e-02 1.91448778653e-02 1.96777557044e-02 - 2.04512222766e-02 2.14468462049e-02 2.26519365039e-02 2.40594329852e-02 2.56635113913e-02 2.74512061786e-02 - 2.93901320501e-02 3.14154606035e-02 3.34242157073e-02 3.52857897121e-02 3.68707660171e-02 3.80886538087e-02 - 4.49623774036e-02 4.52857661696e-02 4.53738413591e-02 4.52857661696e-02 4.49623774036e-02 4.42634768270e-02 - 4.30547772101e-02 4.12888114430e-02 3.90350130516e-02 3.64535808156e-02 3.37399765679e-02 3.10717223250e-02 - 2.85763383726e-02 2.63252408289e-02 2.43476957086e-02 2.26519365039e-02 2.12413612776e-02 2.01220876747e-02 - 1.93050944183e-02 1.88053010662e-02 1.86367379277e-02 1.88053010662e-02 1.93050944183e-02 2.01220876747e-02 - 2.12413612776e-02 2.26519365039e-02 2.43476957086e-02 2.63252408289e-02 2.85763383726e-02 3.10717223250e-02 - 3.37399765679e-02 3.64535808156e-02 3.90350130516e-02 4.12888114430e-02 4.30547772101e-02 4.42634768270e-02 - 5.03535465114e-02 5.04463447592e-02 5.04463447592e-02 5.03535465114e-02 4.99825941802e-02 4.90700187394e-02 - 4.74231711778e-02 4.50208900473e-02 4.20165784801e-02 3.86662855632e-02 3.52402742752e-02 3.19590319446e-02 - 2.89647599965e-02 2.63252408289e-02 2.40594329852e-02 2.21666114252e-02 2.06439962171e-02 1.94921954522e-02 - 1.87162119832e-02 1.83246021902e-02 1.83246021902e-02 1.87162119832e-02 1.94921954522e-02 2.06439962171e-02 - 2.21666114252e-02 2.40594329852e-02 2.63252408289e-02 2.89647599965e-02 3.19590319446e-02 3.52402742752e-02 - 3.86662855632e-02 4.20165784801e-02 4.50208900473e-02 4.74231711778e-02 4.90700187394e-02 4.99825941802e-02 - 5.43925934286e-02 5.43239294918e-02 5.43925934286e-02 5.44475263977e-02 5.41129564364e-02 5.29846351657e-02 - 5.08390344517e-02 4.77311231410e-02 4.39402098517e-02 3.98358227133e-02 3.57591480990e-02 3.19590319446e-02 - 2.85763383726e-02 2.56635113913e-02 2.32231030162e-02 2.12421582644e-02 1.97084075068e-02 1.86137801375e-02 - 1.79555609317e-02 1.77355963866e-02 1.79555609317e-02 1.86137801375e-02 1.97084075068e-02 2.12421582644e-02 - 2.32231030162e-02 2.56635113913e-02 2.85763383726e-02 3.19590319446e-02 3.57591480990e-02 3.98358227133e-02 - 4.39402098517e-02 4.77311231410e-02 5.08390344517e-02 5.29846351657e-02 5.41129564364e-02 5.44475263977e-02 - 5.67236888968e-02 5.67236888968e-02 5.70772559013e-02 5.74105494947e-02 5.71366804742e-02 5.57363453523e-02 - 5.30133769166e-02 4.91578982971e-02 4.46053414397e-02 3.98358227133e-02 3.52402742752e-02 3.10717223250e-02 - 2.74512061786e-02 2.44059448105e-02 2.19185274002e-02 1.99620901041e-02 1.85132658939e-02 1.75547637226e-02 - 1.70770073925e-02 1.70770073925e-02 1.75547637226e-02 1.85132658939e-02 1.99620901041e-02 2.19185274002e-02 - 2.44059448105e-02 2.74512061786e-02 3.10717223250e-02 3.52402742752e-02 3.98358227133e-02 4.46053414397e-02 - 4.91578982971e-02 5.30133769166e-02 5.57363453523e-02 5.71366804742e-02 5.74105494947e-02 5.70772559013e-02 - 5.75824043038e-02 5.79103146750e-02 5.86758842735e-02 5.92810318582e-02 5.89627863020e-02 5.71527035674e-02 - 5.37595739225e-02 4.91578982971e-02 4.39402098517e-02 3.86662855632e-02 3.37399765679e-02 2.93901320501e-02 - 2.57019293917e-02 2.26718438342e-02 2.02621880335e-02 1.84326960165e-02 1.71497889118e-02 1.63890080671e-02 - 1.61367490443e-02 1.63890080671e-02 1.71497889118e-02 1.84326960165e-02 2.02621880335e-02 2.26718438342e-02 - 2.57019293917e-02 2.93901320501e-02 3.37399765679e-02 3.86662855632e-02 4.39402098517e-02 4.91578982971e-02 - 5.37595739225e-02 5.71527035674e-02 5.89627863020e-02 5.92810318582e-02 5.86758842735e-02 5.79103146750e-02 - 5.76200322747e-02 5.83777841365e-02 5.94868177545e-02 6.01752681104e-02 5.95715936141e-02 5.71527035674e-02 - 5.30133769166e-02 4.77311231410e-02 4.20165784801e-02 3.64535808156e-02 3.14154606035e-02 2.70818268649e-02 - 2.34923498457e-02 2.06126999880e-02 1.83878553878e-02 1.67669692380e-02 1.57094271493e-02 1.51874137660e-02 - 1.51874137660e-02 1.57094271493e-02 1.67669692380e-02 1.83878553878e-02 2.06126999880e-02 2.34923498457e-02 - 2.70818268649e-02 3.14154606035e-02 3.64535808156e-02 4.20165784801e-02 4.77311231410e-02 5.30133769166e-02 - 5.71527035674e-02 5.95715936141e-02 6.01752681104e-02 5.94868177545e-02 5.83777841365e-02 5.76200322747e-02 - 5.74463352203e-02 5.85232784436e-02 5.97323039443e-02 6.01752681104e-02 5.89627863020e-02 5.57363453523e-02 - 5.08390344517e-02 4.50208900473e-02 3.90350130516e-02 3.34242157073e-02 2.84935612207e-02 2.43576039836e-02 - 2.10090352784e-02 1.83878553878e-02 1.64272283654e-02 1.50702461704e-02 1.42737851127e-02 1.40112393540e-02 - 1.42737851127e-02 1.50702461704e-02 1.64272283654e-02 1.83878553878e-02 2.10090352784e-02 2.43576039836e-02 - 2.84935612207e-02 3.34242157073e-02 3.90350130516e-02 4.50208900473e-02 5.08390344517e-02 5.57363453523e-02 - 5.89627863020e-02 6.01752681104e-02 5.97323039443e-02 5.85232784436e-02 5.74463352203e-02 5.70355201353e-02 - 5.73653289979e-02 5.85232784436e-02 5.94868177545e-02 5.92810318582e-02 5.71366804742e-02 5.29846351657e-02 - 4.74231711778e-02 4.12888114430e-02 3.52857897121e-02 2.98615217076e-02 2.52298202509e-02 2.14361295219e-02 - 1.84326960165e-02 1.61427916872e-02 1.44944499034e-02 1.34297677852e-02 1.29079014387e-02 1.29079014387e-02 - 1.34297677852e-02 1.44944499034e-02 1.61427916872e-02 1.84326960165e-02 2.14361295219e-02 2.52298202509e-02 - 2.98615217076e-02 3.52857897121e-02 4.12888114430e-02 4.74231711778e-02 5.29846351657e-02 5.71366804742e-02 - 5.92810318582e-02 5.94868177545e-02 5.85232784436e-02 5.73653289979e-02 5.66663226477e-02 5.66663226477e-02 - 5.74463352203e-02 5.83777841365e-02 5.86758842735e-02 5.74105494947e-02 5.41129564364e-02 4.90700187394e-02 - 4.30547772101e-02 3.68707660171e-02 3.10978190541e-02 2.60582031450e-02 2.18687619531e-02 1.85132658939e-02 - 1.59162612755e-02 1.39945083398e-02 1.26769712537e-02 1.19093466628e-02 1.16573532374e-02 1.19093466628e-02 - 1.26769712537e-02 1.39945083398e-02 1.59162612755e-02 1.85132658939e-02 2.18687619531e-02 2.60582031450e-02 - 3.10978190541e-02 3.68707660171e-02 4.30547772101e-02 4.90700187394e-02 5.41129564364e-02 5.74105494947e-02 - 5.86758842735e-02 5.83777841365e-02 5.74463352203e-02 5.66663226477e-02 5.63846435627e-02 5.66663226477e-02 - 5.76200322747e-02 5.79103146750e-02 5.70772559013e-02 5.44475263977e-02 4.99825941802e-02 4.42634768270e-02 - 3.80886538087e-02 3.21243272248e-02 2.67889182249e-02 2.22755921268e-02 1.86137801375e-02 1.57423428102e-02 - 1.35733603577e-02 1.20255038743e-02 1.10330000246e-02 1.05489279259e-02 1.05489279259e-02 1.10330000246e-02 - 1.20255038743e-02 1.35733603577e-02 1.57423428102e-02 1.86137801375e-02 2.22755921268e-02 2.67889182249e-02 - 3.21243272248e-02 3.80886538087e-02 4.42634768270e-02 4.99825941802e-02 5.44475263977e-02 5.70772559013e-02 - 5.79103146750e-02 5.76200322747e-02 5.70355201353e-02 5.66663226477e-02 5.66663226477e-02 5.70355201353e-02 - 6.28259810566e-02 5.83399236929e-02 5.26931433274e-02 4.62623331670e-02 3.95849180057e-02 3.31691643222e-02 - 2.73794467347e-02 2.24136125305e-02 1.83246021902e-02 1.50645020089e-02 1.25396406703e-02 1.06524671204e-02 - 9.31810768724e-03 8.46823559623e-03 8.05519399644e-03 8.05519399644e-03 8.46823559623e-03 9.31810768724e-03 - 1.06524671204e-02 1.25396406703e-02 1.50645020089e-02 1.83246021902e-02 2.24136125305e-02 2.73794467347e-02 - 3.31691643222e-02 3.95849180057e-02 4.62623331670e-02 5.26931433274e-02 5.83399236929e-02 6.28259810566e-02 - 6.60504635380e-02 6.81077724909e-02 6.91119067669e-02 6.91119067669e-02 6.81077724909e-02 6.60504635380e-02 - 5.83399236929e-02 5.29676178633e-02 4.67810667612e-02 4.02540981079e-02 3.38709874542e-02 2.80098127199e-02 - 2.29016184223e-02 1.86367379277e-02 1.51956958667e-02 1.24976141314e-02 1.04460621935e-02 8.95261635749e-03 - 7.94279014126e-03 7.35981258047e-03 7.16922584820e-03 7.35981258047e-03 7.94279014126e-03 8.95261635749e-03 - 1.04460621935e-02 1.24976141314e-02 1.51956958667e-02 1.86367379277e-02 2.29016184223e-02 2.80098127199e-02 - 3.38709874542e-02 4.02540981079e-02 4.67810667612e-02 5.29676178633e-02 5.83399236929e-02 6.25800698666e-02 - 6.55787911247e-02 6.73541476702e-02 6.79419572879e-02 6.73541476702e-02 6.55787911247e-02 6.25800698666e-02 - 5.26931433274e-02 4.67810667612e-02 4.04742233092e-02 3.42208946471e-02 2.83925891295e-02 2.32368358951e-02 - 1.88720574247e-02 1.53065353883e-02 1.24770996440e-02 1.02937156151e-02 8.66817035987e-03 7.52314503521e-03 - 6.79567554150e-03 6.44245195186e-03 6.44245195186e-03 6.79567554150e-03 7.52314503521e-03 8.66817035987e-03 - 1.02937156151e-02 1.24770996440e-02 1.53065353883e-02 1.88720574247e-02 2.32368358951e-02 2.83925891295e-02 - 3.42208946471e-02 4.04742233092e-02 4.67810667612e-02 5.26931433274e-02 5.77843769256e-02 6.17513938278e-02 - 6.44394828494e-02 6.57918464265e-02 6.57918464265e-02 6.44394828494e-02 6.17513938278e-02 5.77843769256e-02 - 4.62623331670e-02 4.02540981079e-02 3.42208946471e-02 2.85205562719e-02 2.34067395586e-02 1.90175139009e-02 - 1.53857855201e-02 1.24686371753e-02 1.01870819285e-02 8.45686847188e-03 7.20097316500e-03 6.35335851926e-03 - 5.86418256271e-03 5.70420021497e-03 5.86418256271e-03 6.35335851926e-03 7.20097316500e-03 8.45686847188e-03 - 1.01870819285e-02 1.24686371753e-02 1.53857855201e-02 1.90175139009e-02 2.34067395586e-02 2.85205562719e-02 - 3.42208946471e-02 4.02540981079e-02 4.62623331670e-02 5.18281863755e-02 5.65511919643e-02 6.01184381094e-02 - 6.23288110708e-02 6.30764730892e-02 6.23288110708e-02 6.01184381094e-02 5.65511919643e-02 5.18281863755e-02 - 3.95849180057e-02 3.38709874542e-02 2.83925891295e-02 2.34067395586e-02 1.90666010177e-02 1.54267827082e-02 - 1.24657333634e-02 1.01194532806e-02 8.31144312544e-03 6.96786738821e-03 6.02253909249e-03 5.42174879265e-03 - 5.12972310883e-03 5.12972310883e-03 5.42174879265e-03 6.02253909249e-03 6.96786738821e-03 8.31144312544e-03 - 1.01194532806e-02 1.24657333634e-02 1.54267827082e-02 1.90666010177e-02 2.34067395586e-02 2.83925891295e-02 - 3.38709874542e-02 3.95849180057e-02 4.51877782102e-02 5.02828320119e-02 5.44829894560e-02 5.74676014035e-02 - 5.90154969276e-02 5.90154969276e-02 5.74676014035e-02 5.44829894560e-02 5.02828320119e-02 4.51877782102e-02 - 3.31691643222e-02 2.80098127199e-02 2.32368358951e-02 1.90175139009e-02 1.54267827082e-02 1.24650738064e-02 - 1.00865795572e-02 8.22635918544e-03 6.81664387654e-03 5.79365065764e-03 5.10253249618e-03 4.70304044562e-03 - 4.57225197605e-03 4.70304044562e-03 5.10253249618e-03 5.79365065764e-03 6.81664387654e-03 8.22635918544e-03 - 1.00865795572e-02 1.24650738064e-02 1.54267827082e-02 1.90175139009e-02 2.32368358951e-02 2.80098127199e-02 - 3.31691643222e-02 3.84534160516e-02 4.35234290368e-02 4.79989400749e-02 5.15101646150e-02 5.37510492057e-02 - 5.45211951056e-02 5.37510492057e-02 5.15101646150e-02 4.79989400749e-02 4.35234290368e-02 3.84534160516e-02 - 2.73794467347e-02 2.29016184223e-02 1.88720574247e-02 1.53857855201e-02 1.24657333634e-02 1.00865795572e-02 - 8.19834740781e-03 6.74228118806e-03 5.65928321674e-03 4.89581524939e-03 4.40955813989e-03 4.17292027232e-03 - 4.17292027232e-03 4.40955813989e-03 4.89581524939e-03 5.65928321674e-03 6.74228118806e-03 8.19834740781e-03 - 1.00865795572e-02 1.24657333634e-02 1.53857855201e-02 1.88720574247e-02 2.29016184223e-02 2.73794467347e-02 - 3.21243272248e-02 3.68707660171e-02 4.12888114430e-02 4.50208900473e-02 4.77311231410e-02 4.91578982971e-02 - 4.91578982971e-02 4.77311231410e-02 4.50208900473e-02 4.12888114430e-02 3.68707660171e-02 3.21243272248e-02 - 2.24136125305e-02 1.86367379277e-02 1.53065353883e-02 1.24686371753e-02 1.01194532806e-02 8.22635918544e-03 - 6.74228118806e-03 5.61497680711e-03 4.79423577304e-03 4.23798561825e-03 3.91597292758e-03 3.81054695208e-03 - 3.91597292758e-03 4.23798561825e-03 4.79423577304e-03 5.61497680711e-03 6.74228118806e-03 8.22635918544e-03 - 1.01194532806e-02 1.24686371753e-02 1.53065353883e-02 1.86367379277e-02 2.24136125305e-02 2.65227612839e-02 - 3.07715106065e-02 3.48956024912e-02 3.85829474965e-02 4.15120643887e-02 4.34003076052e-02 4.40529168852e-02 - 4.34003076052e-02 4.15120643887e-02 3.85829474965e-02 3.48956024912e-02 3.07715106065e-02 2.65227612839e-02 - 1.83246021902e-02 1.51956958667e-02 1.24770996440e-02 1.01870819285e-02 8.31144312544e-03 6.81664387654e-03 - 5.65928321674e-03 4.79423577304e-03 4.18152878343e-03 3.79030883078e-03 3.59990872378e-03 3.59990872378e-03 - 3.79030883078e-03 4.18152878343e-03 4.79423577304e-03 5.65928321674e-03 6.81664387654e-03 8.31144312544e-03 - 1.01870819285e-02 1.24770996440e-02 1.51956958667e-02 1.83246021902e-02 2.17964249596e-02 2.54803066383e-02 - 2.91781605866e-02 3.26363277502e-02 3.55725175924e-02 3.77147526395e-02 3.88462459817e-02 3.88462459817e-02 - 3.77147526395e-02 3.55725175924e-02 3.26363277502e-02 2.91781605866e-02 2.54803066383e-02 2.17964249596e-02 - 1.50645020089e-02 1.24976141314e-02 1.02937156151e-02 8.45686847188e-03 6.96786738821e-03 5.79365065764e-03 - 4.89581524939e-03 4.23798561825e-03 3.79030883078e-03 3.53085792774e-03 3.44594928533e-03 3.53085792774e-03 - 3.79030883078e-03 4.23798561825e-03 4.89581524939e-03 5.79365065764e-03 6.96786738821e-03 8.45686847188e-03 - 1.02937156151e-02 1.24976141314e-02 1.50645020089e-02 1.79555609317e-02 2.10847229658e-02 2.43103322252e-02 - 2.74372089612e-02 3.02323588099e-02 3.24534608631e-02 3.38859304601e-02 3.43811654173e-02 3.38859304601e-02 - 3.24534608631e-02 3.02323588099e-02 2.74372089612e-02 2.43103322252e-02 2.10847229658e-02 1.79555609317e-02 - 1.25396406703e-02 1.04460621935e-02 8.66817035987e-03 7.20097316500e-03 6.02253909249e-03 5.10253249618e-03 - 4.40955813989e-03 3.91597292758e-03 3.59990872378e-03 3.44594928533e-03 3.44594928533e-03 3.59990872378e-03 - 3.91597292758e-03 4.40955813989e-03 5.10253249618e-03 6.02253909249e-03 7.20097316500e-03 8.66817035987e-03 - 1.04460621935e-02 1.25396406703e-02 1.49279448733e-02 1.75547637226e-02 2.03206914317e-02 2.30804654510e-02 - 2.56499234494e-02 2.78244998346e-02 2.94074293899e-02 3.02423286704e-02 3.02423286704e-02 2.94074293899e-02 - 2.78244998346e-02 2.56499234494e-02 2.30804654510e-02 2.03206914317e-02 1.75547637226e-02 1.49279448733e-02 - 1.06524671204e-02 8.95261635749e-03 7.52314503521e-03 6.35335851926e-03 5.42174879265e-03 4.70304044562e-03 - 4.17292027232e-03 3.81054695208e-03 3.59990872378e-03 3.53085792774e-03 3.59990872378e-03 3.81054695208e-03 - 4.17292027232e-03 4.70304044562e-03 5.42174879265e-03 6.35335851926e-03 7.52314503521e-03 8.95261635749e-03 - 1.06524671204e-02 1.26143883181e-02 1.48031251671e-02 1.71497889118e-02 1.95479913088e-02 2.18557815330e-02 - 2.39063871143e-02 2.55281844546e-02 2.65706573512e-02 2.69304328597e-02 2.65706573512e-02 2.55281844546e-02 - 2.39063871143e-02 2.18557815330e-02 1.95479913088e-02 1.71497889118e-02 1.48031251671e-02 1.26143883181e-02 - 9.31810768724e-03 7.94279014126e-03 6.79567554150e-03 5.86418256271e-03 5.12972310883e-03 4.57225197605e-03 - 4.17292027232e-03 3.91597292758e-03 3.79030883078e-03 3.79030883078e-03 3.91597292758e-03 4.17292027232e-03 - 4.57225197605e-03 5.12972310883e-03 5.86418256271e-03 6.79567554150e-03 7.94279014126e-03 9.31810768724e-03 - 1.09215936737e-02 1.27333396536e-02 1.47072813037e-02 1.67669692380e-02 1.88049742175e-02 2.06884779452e-02 - 2.22726314479e-02 2.34202555044e-02 2.40237109616e-02 2.40237109616e-02 2.34202555044e-02 2.22726314479e-02 - 2.06884779452e-02 1.88049742175e-02 1.67669692380e-02 1.47072813037e-02 1.27333396536e-02 1.09215936737e-02 - 8.46823559623e-03 7.35981258047e-03 6.44245195186e-03 5.70420021497e-03 5.12972310883e-03 4.70304044562e-03 - 4.40955813989e-03 4.23798561825e-03 4.18152878343e-03 4.23798561825e-03 4.40955813989e-03 4.70304044562e-03 - 5.12972310883e-03 5.70420021497e-03 6.44245195186e-03 7.35981258047e-03 8.46823559623e-03 9.77183223433e-03 - 1.12609832188e-02 1.29064893850e-02 1.46550533623e-02 1.64272283654e-02 1.81196807915e-02 1.96135589165e-02 - 2.07887392229e-02 2.15413174517e-02 2.18005508565e-02 2.15413174517e-02 2.07887392229e-02 1.96135589165e-02 - 1.81196807915e-02 1.64272283654e-02 1.46550533623e-02 1.29064893850e-02 1.12609832188e-02 9.77183223433e-03 - 8.05519399644e-03 7.16922584820e-03 6.44245195186e-03 5.86418256271e-03 5.42174879265e-03 5.10253249618e-03 - 4.89581524939e-03 4.79423577304e-03 4.79423577304e-03 4.89581524939e-03 5.10253249618e-03 5.42174879265e-03 - 5.86418256271e-03 6.44245195186e-03 7.16922584820e-03 8.05519399644e-03 9.10613117226e-03 1.03186231402e-02 - 1.16751572683e-02 1.31397287366e-02 1.46550533623e-02 1.61427916872e-02 1.75083321070e-02 1.86504890434e-02 - 1.94746684497e-02 1.99070659239e-02 1.99070659239e-02 1.94746684497e-02 1.86504890434e-02 1.75083321070e-02 - 1.61427916872e-02 1.46550533623e-02 1.31397287366e-02 1.16751572683e-02 1.03186231402e-02 9.10613117226e-03 - 8.05519399644e-03 7.35981258047e-03 6.79567554150e-03 6.35335851926e-03 6.02253909249e-03 5.79365065764e-03 - 5.65928321674e-03 5.61497680711e-03 5.65928321674e-03 5.79365065764e-03 6.02253909249e-03 6.35335851926e-03 - 6.79567554150e-03 7.35981258047e-03 8.05519399644e-03 8.88822832040e-03 9.85925299562e-03 1.09586567104e-02 - 1.21629507848e-02 1.34318126710e-02 1.47072813037e-02 1.59162612755e-02 1.69767793036e-02 1.78072941675e-02 - 1.83376793613e-02 1.85201445811e-02 1.83376793613e-02 1.78072941675e-02 1.69767793036e-02 1.59162612755e-02 - 1.47072813037e-02 1.34318126710e-02 1.21629507848e-02 1.09586567104e-02 9.85925299562e-03 8.88822832040e-03 - 8.46823559623e-03 7.94279014126e-03 7.52314503521e-03 7.20097316500e-03 6.96786738821e-03 6.81664387654e-03 - 6.74228118806e-03 6.74228118806e-03 6.81664387654e-03 6.96786738821e-03 7.20097316500e-03 7.52314503521e-03 - 7.94279014126e-03 8.46823559623e-03 9.10613117226e-03 9.85925299562e-03 1.07235056315e-02 1.16845233837e-02 - 1.27148275869e-02 1.37726366090e-02 1.48031251671e-02 1.57423428102e-02 1.65234811342e-02 1.70848695603e-02 - 1.73786828448e-02 1.73786828448e-02 1.70848695603e-02 1.65234811342e-02 1.57423428102e-02 1.48031251671e-02 - 1.37726366090e-02 1.27148275869e-02 1.16845233837e-02 1.07235056315e-02 9.85925299562e-03 9.10613117226e-03 - 9.31810768724e-03 8.95261635749e-03 8.66817035987e-03 8.45686847188e-03 8.31144312544e-03 8.22635918544e-03 - 8.19834740781e-03 8.22635918544e-03 8.31144312544e-03 8.45686847188e-03 8.66817035987e-03 8.95261635749e-03 - 9.31810768724e-03 9.77183223433e-03 1.03186231402e-02 1.09586567104e-02 1.16845233837e-02 1.24785638223e-02 - 1.33116675302e-02 1.41440793855e-02 1.49279448733e-02 1.56112881223e-02 1.61434902729e-02 1.64818809732e-02 - 1.65980023724e-02 1.64818809732e-02 1.61434902729e-02 1.56112881223e-02 1.49279448733e-02 1.41440793855e-02 - 1.33116675302e-02 1.24785638223e-02 1.16845233837e-02 1.09586567104e-02 1.03186231402e-02 9.77183223433e-03 - 1.06524671204e-02 1.04460621935e-02 1.02937156151e-02 1.01870819285e-02 1.01194532806e-02 1.00865795572e-02 - 1.00865795572e-02 1.01194532806e-02 1.01870819285e-02 1.02937156151e-02 1.04460621935e-02 1.06524671204e-02 - 1.09215936737e-02 1.12609832188e-02 1.16751572683e-02 1.21629507848e-02 1.27148275869e-02 1.33116675302e-02 - 1.39256808178e-02 1.45226393383e-02 1.50645020089e-02 1.55127511572e-02 1.58329883187e-02 1.59997599900e-02 - 1.59997599900e-02 1.58329883187e-02 1.55127511572e-02 1.50645020089e-02 1.45226393383e-02 1.39256808178e-02 - 1.33116675302e-02 1.27148275869e-02 1.21629507848e-02 1.16751572683e-02 1.12609832188e-02 1.09215936737e-02 - 1.25396406703e-02 1.24976141314e-02 1.24770996440e-02 1.24686371753e-02 1.24657333634e-02 1.24650738064e-02 - 1.24657333634e-02 1.24686371753e-02 1.24770996440e-02 1.24976141314e-02 1.25396406703e-02 1.26143883181e-02 - 1.27333396536e-02 1.29064893850e-02 1.31397287366e-02 1.34318126710e-02 1.37726366090e-02 1.41440793855e-02 - 1.45226393383e-02 1.48820928374e-02 1.51956958667e-02 1.54388806266e-02 1.55924938344e-02 1.56449525655e-02 - 1.55924938344e-02 1.54388806266e-02 1.51956958667e-02 1.48820928374e-02 1.45226393383e-02 1.41440793855e-02 - 1.37726366090e-02 1.34318126710e-02 1.31397287366e-02 1.29064893850e-02 1.27333396536e-02 1.26143883181e-02 - 1.50645020089e-02 1.51956958667e-02 1.53065353883e-02 1.53857855201e-02 1.54267827082e-02 1.54267827082e-02 - 1.53857855201e-02 1.53065353883e-02 1.51956958667e-02 1.50645020089e-02 1.49279448733e-02 1.48031251671e-02 - 1.47072813037e-02 1.46550533623e-02 1.46550533623e-02 1.47072813037e-02 1.48031251671e-02 1.49279448733e-02 - 1.50645020089e-02 1.51956958667e-02 1.53065353883e-02 1.53857855201e-02 1.54267827082e-02 1.54267827082e-02 - 1.53857855201e-02 1.53065353883e-02 1.51956958667e-02 1.50645020089e-02 1.49279448733e-02 1.48031251671e-02 - 1.47072813037e-02 1.46550533623e-02 1.46550533623e-02 1.47072813037e-02 1.48031251671e-02 1.49279448733e-02 - 1.83246021902e-02 1.86367379277e-02 1.88720574247e-02 1.90175139009e-02 1.90666010177e-02 1.90175139009e-02 - 1.88720574247e-02 1.86367379277e-02 1.83246021902e-02 1.79555609317e-02 1.75547637226e-02 1.71497889118e-02 - 1.67669692380e-02 1.64272283654e-02 1.61427916872e-02 1.59162612755e-02 1.57423428102e-02 1.56112881223e-02 - 1.55127511572e-02 1.54388806266e-02 1.53857855201e-02 1.53530693596e-02 1.53419303249e-02 1.53530693596e-02 - 1.53857855201e-02 1.54388806266e-02 1.55127511572e-02 1.56112881223e-02 1.57423428102e-02 1.59162612755e-02 - 1.61427916872e-02 1.64272283654e-02 1.67669692380e-02 1.71497889118e-02 1.75547637226e-02 1.79555609317e-02 - 2.24136125305e-02 2.29016184223e-02 2.32368358951e-02 2.34067395586e-02 2.34067395586e-02 2.32368358951e-02 - 2.29016184223e-02 2.24136125305e-02 2.17964249596e-02 2.10847229658e-02 2.03206914317e-02 1.95479913088e-02 - 1.88049742175e-02 1.81196807915e-02 1.75083321070e-02 1.69767793036e-02 1.65234811342e-02 1.61434902729e-02 - 1.58329883187e-02 1.55924938344e-02 1.54267827082e-02 1.53419303249e-02 1.53419303249e-02 1.54267827082e-02 - 1.55924938344e-02 1.58329883187e-02 1.61434902729e-02 1.65234811342e-02 1.69767793036e-02 1.75083321070e-02 - 1.81196807915e-02 1.88049742175e-02 1.95479913088e-02 2.03206914317e-02 2.10847229658e-02 2.17964249596e-02 - 2.73794467347e-02 2.80098127199e-02 2.83925891295e-02 2.85205562719e-02 2.83925891295e-02 2.80098127199e-02 - 2.73794467347e-02 2.65227612839e-02 2.54803066383e-02 2.43103322252e-02 2.30804654510e-02 2.18557815330e-02 - 2.06884779452e-02 1.96135589165e-02 1.86504890434e-02 1.78072941675e-02 1.70848695603e-02 1.64818809732e-02 - 1.59997599900e-02 1.56449525655e-02 1.54267827082e-02 1.53530693596e-02 1.54267827082e-02 1.56449525655e-02 - 1.59997599900e-02 1.64818809732e-02 1.70848695603e-02 1.78072941675e-02 1.86504890434e-02 1.96135589165e-02 - 2.06884779452e-02 2.18557815330e-02 2.30804654510e-02 2.43103322252e-02 2.54803066383e-02 2.65227612839e-02 - 3.31691643222e-02 3.38709874542e-02 3.42208946471e-02 3.42208946471e-02 3.38709874542e-02 3.31691643222e-02 - 3.21243272248e-02 3.07715106065e-02 2.91781605866e-02 2.74372089612e-02 2.56499234494e-02 2.39063871143e-02 - 2.22726314479e-02 2.07887392229e-02 1.94746684497e-02 1.83376793613e-02 1.73786828448e-02 1.65980023724e-02 - 1.59997599900e-02 1.55924938344e-02 1.53857855201e-02 1.53857855201e-02 1.55924938344e-02 1.59997599900e-02 - 1.65980023724e-02 1.73786828448e-02 1.83376793613e-02 1.94746684497e-02 2.07887392229e-02 2.22726314479e-02 - 2.39063871143e-02 2.56499234494e-02 2.74372089612e-02 2.91781605866e-02 3.07715106065e-02 3.21243272248e-02 - 3.95849180057e-02 4.02540981079e-02 4.04742233092e-02 4.02540981079e-02 3.95849180057e-02 3.84534160516e-02 - 3.68707660171e-02 3.48956024912e-02 3.26363277502e-02 3.02323588099e-02 2.78244998346e-02 2.55281844546e-02 - 2.34202555044e-02 2.15413174517e-02 1.99070659239e-02 1.85201445811e-02 1.73786828448e-02 1.64818809732e-02 - 1.58329883187e-02 1.54388806266e-02 1.53065353883e-02 1.54388806266e-02 1.58329883187e-02 1.64818809732e-02 - 1.73786828448e-02 1.85201445811e-02 1.99070659239e-02 2.15413174517e-02 2.34202555044e-02 2.55281844546e-02 - 2.78244998346e-02 3.02323588099e-02 3.26363277502e-02 3.48956024912e-02 3.68707660171e-02 3.84534160516e-02 - 4.62623331670e-02 4.67810667612e-02 4.67810667612e-02 4.62623331670e-02 4.51877782102e-02 4.35234290368e-02 - 4.12888114430e-02 3.85829474965e-02 3.55725175924e-02 3.24534608631e-02 2.94074293899e-02 2.65706573512e-02 - 2.40237109616e-02 2.18005508565e-02 1.99070659239e-02 1.83376793613e-02 1.70848695603e-02 1.61434902729e-02 - 1.55127511572e-02 1.51956958667e-02 1.51956958667e-02 1.55127511572e-02 1.61434902729e-02 1.70848695603e-02 - 1.83376793613e-02 1.99070659239e-02 2.18005508565e-02 2.40237109616e-02 2.65706573512e-02 2.94074293899e-02 - 3.24534608631e-02 3.55725175924e-02 3.85829474965e-02 4.12888114430e-02 4.35234290368e-02 4.51877782102e-02 - 5.26931433274e-02 5.29676178633e-02 5.26931433274e-02 5.18281863755e-02 5.02828320119e-02 4.79989400749e-02 - 4.50208900473e-02 4.15120643887e-02 3.77147526395e-02 3.38859304601e-02 3.02423286704e-02 2.69304328597e-02 - 2.40237109616e-02 2.15413174517e-02 1.94746684497e-02 1.78072941675e-02 1.65234811342e-02 1.56112881223e-02 - 1.50645020089e-02 1.48820928374e-02 1.50645020089e-02 1.56112881223e-02 1.65234811342e-02 1.78072941675e-02 - 1.94746684497e-02 2.15413174517e-02 2.40237109616e-02 2.69304328597e-02 3.02423286704e-02 3.38859304601e-02 - 3.77147526395e-02 4.15120643887e-02 4.50208900473e-02 4.79989400749e-02 5.02828320119e-02 5.18281863755e-02 - 5.83399236929e-02 5.83399236929e-02 5.77843769256e-02 5.65511919643e-02 5.44829894560e-02 5.15101646150e-02 - 4.77311231410e-02 4.34003076052e-02 3.88462459817e-02 3.43811654173e-02 3.02423286704e-02 2.65706573512e-02 - 2.34202555044e-02 2.07887392229e-02 1.86504890434e-02 1.69767793036e-02 1.57423428102e-02 1.49279448733e-02 - 1.45226393383e-02 1.45226393383e-02 1.49279448733e-02 1.57423428102e-02 1.69767793036e-02 1.86504890434e-02 - 2.07887392229e-02 2.34202555044e-02 2.65706573512e-02 3.02423286704e-02 3.43811654173e-02 3.88462459817e-02 - 4.34003076052e-02 4.77311231410e-02 5.15101646150e-02 5.44829894560e-02 5.65511919643e-02 5.77843769256e-02 - 6.28259810566e-02 6.25800698666e-02 6.17513938278e-02 6.01184381094e-02 5.74676014035e-02 5.37510492057e-02 - 4.91578982971e-02 4.40529168852e-02 3.88462459817e-02 3.38859304601e-02 2.94074293899e-02 2.55281844546e-02 - 2.22726314479e-02 1.96135589165e-02 1.75083321070e-02 1.59162612755e-02 1.48031251671e-02 1.41440793855e-02 - 1.39256808178e-02 1.41440793855e-02 1.48031251671e-02 1.59162612755e-02 1.75083321070e-02 1.96135589165e-02 - 2.22726314479e-02 2.55281844546e-02 2.94074293899e-02 3.38859304601e-02 3.88462459817e-02 4.40529168852e-02 - 4.91578982971e-02 5.37510492057e-02 5.74676014035e-02 6.01184381094e-02 6.17513938278e-02 6.25800698666e-02 - 6.60504635380e-02 6.55787911247e-02 6.44394828494e-02 6.23288110708e-02 5.90154969276e-02 5.45211951056e-02 - 4.91578982971e-02 4.34003076052e-02 3.77147526395e-02 3.24534608631e-02 2.78244998346e-02 2.39063871143e-02 - 2.06884779452e-02 1.81196807915e-02 1.61427916872e-02 1.47072813037e-02 1.37726366090e-02 1.33116675302e-02 - 1.33116675302e-02 1.37726366090e-02 1.47072813037e-02 1.61427916872e-02 1.81196807915e-02 2.06884779452e-02 - 2.39063871143e-02 2.78244998346e-02 3.24534608631e-02 3.77147526395e-02 4.34003076052e-02 4.91578982971e-02 - 5.45211951056e-02 5.90154969276e-02 6.23288110708e-02 6.44394828494e-02 6.55787911247e-02 6.60504635380e-02 - 6.81077724909e-02 6.73541476702e-02 6.57918464265e-02 6.30764730892e-02 5.90154969276e-02 5.37510492057e-02 - 4.77311231410e-02 4.15120643887e-02 3.55725175924e-02 3.02323588099e-02 2.56499234494e-02 2.18557815330e-02 - 1.88049742175e-02 1.64272283654e-02 1.46550533623e-02 1.34318126710e-02 1.27148275869e-02 1.24785638223e-02 - 1.27148275869e-02 1.34318126710e-02 1.46550533623e-02 1.64272283654e-02 1.88049742175e-02 2.18557815330e-02 - 2.56499234494e-02 3.02323588099e-02 3.55725175924e-02 4.15120643887e-02 4.77311231410e-02 5.37510492057e-02 - 5.90154969276e-02 6.30764730892e-02 6.57918464265e-02 6.73541476702e-02 6.81077724909e-02 6.83266751007e-02 - 6.91119067669e-02 6.79419572879e-02 6.57918464265e-02 6.23288110708e-02 5.74676014035e-02 5.15101646150e-02 - 4.50208900473e-02 3.85829474965e-02 3.26363277502e-02 2.74372089612e-02 2.30804654510e-02 1.95479913088e-02 - 1.67669692380e-02 1.46550533623e-02 1.31397287366e-02 1.21629507848e-02 1.16845233837e-02 1.16845233837e-02 - 1.21629507848e-02 1.31397287366e-02 1.46550533623e-02 1.67669692380e-02 1.95479913088e-02 2.30804654510e-02 - 2.74372089612e-02 3.26363277502e-02 3.85829474965e-02 4.50208900473e-02 5.15101646150e-02 5.74676014035e-02 - 6.23288110708e-02 6.57918464265e-02 6.79419572879e-02 6.91119067669e-02 6.96179820017e-02 6.96179820017e-02 - 6.91119067669e-02 6.73541476702e-02 6.44394828494e-02 6.01184381094e-02 5.44829894560e-02 4.79989400749e-02 - 4.12888114430e-02 3.48956024912e-02 2.91781605866e-02 2.43103322252e-02 2.03206914317e-02 1.71497889118e-02 - 1.47072813037e-02 1.29064893850e-02 1.16751572683e-02 1.09586567104e-02 1.07235056315e-02 1.09586567104e-02 - 1.16751572683e-02 1.29064893850e-02 1.47072813037e-02 1.71497889118e-02 2.03206914317e-02 2.43103322252e-02 - 2.91781605866e-02 3.48956024912e-02 4.12888114430e-02 4.79989400749e-02 5.44829894560e-02 6.01184381094e-02 - 6.44394828494e-02 6.73541476702e-02 6.91119067669e-02 7.00400365127e-02 7.03323963389e-02 7.00400365127e-02 - 6.81077724909e-02 6.55787911247e-02 6.17513938278e-02 5.65511919643e-02 5.02828320119e-02 4.35234290368e-02 - 3.68707660171e-02 3.07715106065e-02 2.54803066383e-02 2.10847229658e-02 1.75547637226e-02 1.48031251671e-02 - 1.27333396536e-02 1.12609832188e-02 1.03186231402e-02 9.85925299562e-03 9.85925299562e-03 1.03186231402e-02 - 1.12609832188e-02 1.27333396536e-02 1.48031251671e-02 1.75547637226e-02 2.10847229658e-02 2.54803066383e-02 - 3.07715106065e-02 3.68707660171e-02 4.35234290368e-02 5.02828320119e-02 5.65511919643e-02 6.17513938278e-02 - 6.55787911247e-02 6.81077724909e-02 6.96179820017e-02 7.03323963389e-02 7.03323963389e-02 6.96179820017e-02 - 6.60504635380e-02 6.25800698666e-02 5.77843769256e-02 5.18281863755e-02 4.51877782102e-02 3.84534160516e-02 - 3.21243272248e-02 2.65227612839e-02 2.17964249596e-02 1.79555609317e-02 1.49279448733e-02 1.26143883181e-02 - 1.09215936737e-02 9.77183223433e-03 9.10613117226e-03 8.88822832040e-03 9.10613117226e-03 9.77183223433e-03 - 1.09215936737e-02 1.26143883181e-02 1.49279448733e-02 1.79555609317e-02 2.17964249596e-02 2.65227612839e-02 - 3.21243272248e-02 3.84534160516e-02 4.51877782102e-02 5.18281863755e-02 5.77843769256e-02 6.25800698666e-02 - 6.60504635380e-02 6.83266751007e-02 6.96179820017e-02 7.00400365127e-02 6.96179820017e-02 6.83266751007e-02 - 6.21334821617e-02 5.53499973529e-02 4.80677366203e-02 4.07924714489e-02 3.39533984936e-02 2.78466298707e-02 - 2.26267522861e-02 1.83246021902e-02 1.48820928374e-02 1.21980827392e-02 1.01663421573e-02 8.69246386814e-03 - 7.69793885145e-03 7.12420828954e-03 6.93665223838e-03 7.12420828954e-03 7.69793885145e-03 8.69246386814e-03 - 1.01663421573e-02 1.21980827392e-02 1.48820928374e-02 1.83246021902e-02 2.26267522861e-02 2.78466298707e-02 - 3.39533984936e-02 4.07924714489e-02 4.80677366203e-02 5.53499973529e-02 6.21334821617e-02 6.79320857310e-02 - 7.23556493700e-02 7.51264696898e-02 7.60705845667e-02 7.51264696898e-02 7.23556493700e-02 6.79320857310e-02 - 5.53499973529e-02 4.84815544672e-02 4.14579289512e-02 3.47182328687e-02 2.85879356046e-02 2.32603028496e-02 - 1.88053010662e-02 1.51956958667e-02 1.23472319177e-02 1.01587603229e-02 8.53524112695e-03 7.39443450458e-03 - 6.67049181789e-03 6.31909087196e-03 6.31909087196e-03 6.67049181789e-03 7.39443450458e-03 8.53524112695e-03 - 1.01587603229e-02 1.23472319177e-02 1.51956958667e-02 1.88053010662e-02 2.32603028496e-02 2.85879356046e-02 - 3.47182328687e-02 4.14579289512e-02 4.84815544672e-02 5.53499973529e-02 6.15702941626e-02 6.66786802062e-02 - 7.03019494995e-02 7.21810172465e-02 7.21810172465e-02 7.03019494995e-02 6.66786802062e-02 6.15702941626e-02 - 4.80677366203e-02 4.14579289512e-02 3.49773595797e-02 2.89691250092e-02 2.36566460915e-02 1.91448778653e-02 - 1.54388806266e-02 1.24770996440e-02 1.01697655067e-02 8.42580807925e-03 7.16308508658e-03 6.31209415558e-03 - 5.82127807001e-03 5.66079261571e-03 5.82127807001e-03 6.31209415558e-03 7.16308508658e-03 8.42580807925e-03 - 1.01697655067e-02 1.24770996440e-02 1.54388806266e-02 1.91448778653e-02 2.36566460915e-02 2.89691250092e-02 - 3.49773595797e-02 4.14579289512e-02 4.80677366203e-02 5.43692149489e-02 5.98878714669e-02 6.41840706496e-02 - 6.69101294891e-02 6.78442738531e-02 6.69101294891e-02 6.41840706496e-02 5.98878714669e-02 5.43692149489e-02 - 4.07924714489e-02 3.47182328687e-02 2.89691250092e-02 2.37914166767e-02 1.93203741197e-02 1.55924938344e-02 - 1.25723726562e-02 1.01870819285e-02 8.35413904759e-03 6.99504538611e-03 6.04016501968e-03 5.43377044817e-03 - 5.13913617973e-03 5.13913617973e-03 5.43377044817e-03 6.04016501968e-03 6.99504538611e-03 8.35413904759e-03 - 1.01870819285e-02 1.25723726562e-02 1.55924938344e-02 1.93203741197e-02 2.37914166767e-02 2.89691250092e-02 - 3.47182328687e-02 4.07924714489e-02 4.68401774785e-02 5.24339557043e-02 5.71251588417e-02 6.05090723285e-02 - 6.22821499923e-02 6.22821499923e-02 6.05090723285e-02 5.71251588417e-02 5.24339557043e-02 4.68401774785e-02 - 3.39533984936e-02 2.85879356046e-02 2.36566460915e-02 1.93203741197e-02 1.56449525655e-02 1.26225341258e-02 - 1.02011860999e-02 8.31144312544e-03 6.88181758770e-03 5.84558656512e-03 5.14599535674e-03 4.74176747355e-03 - 4.60945880297e-03 4.74176747355e-03 5.14599535674e-03 5.84558656512e-03 6.88181758770e-03 8.31144312544e-03 - 1.02011860999e-02 1.26225341258e-02 1.56449525655e-02 1.93203741197e-02 2.36566460915e-02 2.85879356046e-02 - 3.39533984936e-02 3.94908104948e-02 4.48486167771e-02 4.96193341715e-02 5.33923081840e-02 5.58153453540e-02 - 5.66509609539e-02 5.58153453540e-02 5.33923081840e-02 4.96193341715e-02 4.48486167771e-02 3.94908104948e-02 - 2.78466298707e-02 2.32603028496e-02 1.91448778653e-02 1.55924938344e-02 1.26225341258e-02 1.02064774226e-02 - 8.29158854156e-03 6.81664387654e-03 5.72047031573e-03 4.94806264494e-03 4.45623663297e-03 4.21692866215e-03 - 4.21692866215e-03 4.45623663297e-03 4.94806264494e-03 5.72047031573e-03 6.81664387654e-03 8.29158854156e-03 - 1.02064774226e-02 1.26225341258e-02 1.55924938344e-02 1.91448778653e-02 2.32603028496e-02 2.78466298707e-02 - 3.27229087590e-02 3.76190713504e-02 4.21941579647e-02 4.60731359718e-02 4.88987422193e-02 5.03893328752e-02 - 5.03893328752e-02 4.88987422193e-02 4.60731359718e-02 4.21941579647e-02 3.76190713504e-02 3.27229087590e-02 - 2.26267522861e-02 1.88053010662e-02 1.54388806266e-02 1.25723726562e-02 1.02011860999e-02 8.29158854156e-03 - 6.79537428806e-03 5.65928321674e-03 4.83232712929e-03 4.27192322596e-03 3.94752033538e-03 3.84131375804e-03 - 3.94752033538e-03 4.27192322596e-03 4.83232712929e-03 5.65928321674e-03 6.79537428806e-03 8.29158854156e-03 - 1.02011860999e-02 1.25723726562e-02 1.54388806266e-02 1.88053010662e-02 2.26267522861e-02 2.67889182249e-02 - 3.10978190541e-02 3.52857897121e-02 3.90350130516e-02 4.20165784801e-02 4.39402098517e-02 4.46053414397e-02 - 4.39402098517e-02 4.20165784801e-02 3.90350130516e-02 3.52857897121e-02 3.10978190541e-02 2.67889182249e-02 - 1.83246021902e-02 1.51956958667e-02 1.24770996440e-02 1.01870819285e-02 8.31144312544e-03 6.81664387654e-03 - 5.65928321674e-03 4.79423577304e-03 4.18152878343e-03 3.79030883078e-03 3.59990872378e-03 3.59990872378e-03 - 3.79030883078e-03 4.18152878343e-03 4.79423577304e-03 5.65928321674e-03 6.81664387654e-03 8.31144312544e-03 - 1.01870819285e-02 1.24770996440e-02 1.51956958667e-02 1.83246021902e-02 2.17964249596e-02 2.54803066383e-02 - 2.91781605866e-02 3.26363277502e-02 3.55725175924e-02 3.77147526395e-02 3.88462459817e-02 3.88462459817e-02 - 3.77147526395e-02 3.55725175924e-02 3.26363277502e-02 2.91781605866e-02 2.54803066383e-02 2.17964249596e-02 - 1.48820928374e-02 1.23472319177e-02 1.01697655067e-02 8.35413904759e-03 6.88181758770e-03 5.72047031573e-03 - 4.83232712929e-03 4.18152878343e-03 3.73863341678e-03 3.48198055848e-03 3.39799742507e-03 3.48198055848e-03 - 3.73863341678e-03 4.18152878343e-03 4.83232712929e-03 5.72047031573e-03 6.88181758770e-03 8.35413904759e-03 - 1.01697655067e-02 1.23472319177e-02 1.48820928374e-02 1.77355963866e-02 2.08223402545e-02 2.40022165572e-02 - 2.70827915169e-02 2.98349904445e-02 3.20210145144e-02 3.34304675050e-02 3.39176800802e-02 3.34304675050e-02 - 3.20210145144e-02 2.98349904445e-02 2.70827915169e-02 2.40022165572e-02 2.08223402545e-02 1.77355963866e-02 - 1.21980827392e-02 1.01587603229e-02 8.42580807925e-03 6.99504538611e-03 5.84558656512e-03 4.94806264494e-03 - 4.27192322596e-03 3.79030883078e-03 3.48198055848e-03 3.33184951460e-03 3.33184951460e-03 3.48198055848e-03 - 3.79030883078e-03 4.27192322596e-03 4.94806264494e-03 5.84558656512e-03 6.99504538611e-03 8.42580807925e-03 - 1.01587603229e-02 1.21980827392e-02 1.45226393383e-02 1.70770073925e-02 1.97639178277e-02 2.24420850452e-02 - 2.49333108373e-02 2.70402901784e-02 2.85734174953e-02 2.93819034216e-02 2.93819034216e-02 2.85734174953e-02 - 2.70402901784e-02 2.49333108373e-02 2.24420850452e-02 1.97639178277e-02 1.70770073925e-02 1.45226393383e-02 - 1.01663421573e-02 8.53524112695e-03 7.16308508658e-03 6.04016501968e-03 5.14599535674e-03 4.45623663297e-03 - 3.94752033538e-03 3.59990872378e-03 3.39799742507e-03 3.33184951460e-03 3.39799742507e-03 3.59990872378e-03 - 3.94752033538e-03 4.45623663297e-03 5.14599535674e-03 6.04016501968e-03 7.16308508658e-03 8.53524112695e-03 - 1.01663421573e-02 1.20475550421e-02 1.41440793855e-02 1.63890080671e-02 1.86800926235e-02 2.08820531014e-02 - 2.28368095394e-02 2.43819637041e-02 2.53749373622e-02 2.57176061925e-02 2.53749373622e-02 2.43819637041e-02 - 2.28368095394e-02 2.08820531014e-02 1.86800926235e-02 1.63890080671e-02 1.41440793855e-02 1.20475550421e-02 - 8.69246386814e-03 7.39443450458e-03 6.31209415558e-03 5.43377044817e-03 4.74176747355e-03 4.21692866215e-03 - 3.84131375804e-03 3.59990872378e-03 3.48198055848e-03 3.48198055848e-03 3.59990872378e-03 3.84131375804e-03 - 4.21692866215e-03 4.74176747355e-03 5.43377044817e-03 6.31209415558e-03 7.39443450458e-03 8.69246386814e-03 - 1.02054916185e-02 1.19137265332e-02 1.37726366090e-02 1.57094271493e-02 1.76229803621e-02 1.93892705934e-02 - 2.08735527936e-02 2.19482820950e-02 2.25132701769e-02 2.25132701769e-02 2.19482820950e-02 2.08735527936e-02 - 1.93892705934e-02 1.76229803621e-02 1.57094271493e-02 1.37726366090e-02 1.19137265332e-02 1.02054916185e-02 - 7.69793885145e-03 6.67049181789e-03 5.82127807001e-03 5.13913617973e-03 4.60945880297e-03 4.21692866215e-03 - 3.94752033538e-03 3.79030883078e-03 3.73863341678e-03 3.79030883078e-03 3.94752033538e-03 4.21692866215e-03 - 4.60945880297e-03 5.13913617973e-03 5.82127807001e-03 6.67049181789e-03 7.69793885145e-03 8.90705726329e-03 - 1.02881382638e-02 1.18131307076e-02 1.34318126710e-02 1.50702461704e-02 1.66330383744e-02 1.80109897723e-02 - 1.90940368490e-02 1.97871783123e-02 2.00258575799e-02 1.97871783123e-02 1.90940368490e-02 1.80109897723e-02 - 1.66330383744e-02 1.50702461704e-02 1.34318126710e-02 1.18131307076e-02 1.02881382638e-02 8.90705726329e-03 - 7.12420828954e-03 6.31909087196e-03 5.66079261571e-03 5.13913617973e-03 4.74176747355e-03 4.45623663297e-03 - 4.27192322596e-03 4.18152878343e-03 4.18152878343e-03 4.27192322596e-03 4.45623663297e-03 4.74176747355e-03 - 5.13913617973e-03 5.66079261571e-03 6.31909087196e-03 7.12420828954e-03 8.08133005705e-03 9.18679124184e-03 - 1.04238516982e-02 1.17590249893e-02 1.31397287366e-02 1.44944499034e-02 1.57370100687e-02 1.67754563001e-02 - 1.75241772421e-02 1.79167348748e-02 1.79167348748e-02 1.75241772421e-02 1.67754563001e-02 1.57370100687e-02 - 1.44944499034e-02 1.31397287366e-02 1.17590249893e-02 1.04238516982e-02 9.18679124184e-03 8.08133005705e-03 - 6.93665223838e-03 6.31909087196e-03 5.82127807001e-03 5.43377044817e-03 5.14599535674e-03 4.94806264494e-03 - 4.83232712929e-03 4.79423577304e-03 4.83232712929e-03 4.94806264494e-03 5.14599535674e-03 5.43377044817e-03 - 5.82127807001e-03 6.31909087196e-03 6.93665223838e-03 7.68014935330e-03 8.54973346172e-03 9.53627070961e-03 - 1.06181928008e-02 1.17590249893e-02 1.29064893850e-02 1.39945083398e-02 1.49488960464e-02 1.56960478729e-02 - 1.61729889157e-02 1.63370205752e-02 1.61729889157e-02 1.56960478729e-02 1.49488960464e-02 1.39945083398e-02 - 1.29064893850e-02 1.17590249893e-02 1.06181928008e-02 9.53627070961e-03 8.54973346172e-03 7.68014935330e-03 - 7.12420828954e-03 6.67049181789e-03 6.31209415558e-03 6.04016501968e-03 5.84558656512e-03 5.72047031573e-03 - 5.65928321674e-03 5.65928321674e-03 5.72047031573e-03 5.84558656512e-03 6.04016501968e-03 6.31209415558e-03 - 6.67049181789e-03 7.12420828954e-03 7.68014935330e-03 8.34122341388e-03 9.10381322670e-03 9.95507847617e-03 - 1.08706042529e-02 1.18131307076e-02 1.27333396536e-02 1.35733603577e-02 1.42727054437e-02 1.47756456624e-02 - 1.50389831834e-02 1.50389831834e-02 1.47756456624e-02 1.42727054437e-02 1.35733603577e-02 1.27333396536e-02 - 1.18131307076e-02 1.08706042529e-02 9.95507847617e-03 9.10381322670e-03 8.34122341388e-03 7.68014935330e-03 - 7.69793885145e-03 7.39443450458e-03 7.16308508658e-03 6.99504538611e-03 6.88181758770e-03 6.81664387654e-03 - 6.79537428806e-03 6.81664387654e-03 6.88181758770e-03 6.99504538611e-03 7.16308508658e-03 7.39443450458e-03 - 7.69793885145e-03 8.08133005705e-03 8.54973346172e-03 9.10381322670e-03 9.73748464183e-03 1.04356792319e-02 - 1.11729588764e-02 1.19137265332e-02 1.26143883181e-02 1.32272933414e-02 1.37059602390e-02 1.40109856905e-02 - 1.41157952825e-02 1.40109856905e-02 1.37059602390e-02 1.32272933414e-02 1.26143883181e-02 1.19137265332e-02 - 1.11729588764e-02 1.04356792319e-02 9.73748464183e-03 9.10381322670e-03 8.54973346172e-03 8.08133005705e-03 - 8.69246386814e-03 8.53524112695e-03 8.42580807925e-03 8.35413904759e-03 8.31144312544e-03 8.29158854156e-03 - 8.29158854156e-03 8.31144312544e-03 8.35413904759e-03 8.42580807925e-03 8.53524112695e-03 8.69246386814e-03 - 8.90705726329e-03 9.18679124184e-03 9.53627070961e-03 9.95507847617e-03 1.04356792319e-02 1.09620544703e-02 - 1.15097880648e-02 1.20475550421e-02 1.25396406703e-02 1.29494247541e-02 1.32437842255e-02 1.33976732300e-02 - 1.33976732300e-02 1.32437842255e-02 1.29494247541e-02 1.25396406703e-02 1.20475550421e-02 1.15097880648e-02 - 1.09620544703e-02 1.04356792319e-02 9.95507847617e-03 9.53627070961e-03 9.18679124184e-03 8.90705726329e-03 - 1.01663421573e-02 1.01587603229e-02 1.01697655067e-02 1.01870819285e-02 1.02011860999e-02 1.02064774226e-02 - 1.02011860999e-02 1.01870819285e-02 1.01697655067e-02 1.01587603229e-02 1.01663421573e-02 1.02054916185e-02 - 1.02881382638e-02 1.04238516982e-02 1.06181928008e-02 1.08706042529e-02 1.11729588764e-02 1.15097880648e-02 - 1.18598583649e-02 1.21980827392e-02 1.24976141314e-02 1.27327884289e-02 1.28827341282e-02 1.29342051284e-02 - 1.28827341282e-02 1.27327884289e-02 1.24976141314e-02 1.21980827392e-02 1.18598583649e-02 1.15097880648e-02 - 1.11729588764e-02 1.08706042529e-02 1.06181928008e-02 1.04238516982e-02 1.02881382638e-02 1.02054916185e-02 - 1.21980827392e-02 1.23472319177e-02 1.24770996440e-02 1.25723726562e-02 1.26225341258e-02 1.26225341258e-02 - 1.25723726562e-02 1.24770996440e-02 1.23472319177e-02 1.21980827392e-02 1.20475550421e-02 1.19137265332e-02 - 1.18131307076e-02 1.17590249893e-02 1.17590249893e-02 1.18131307076e-02 1.19137265332e-02 1.20475550421e-02 - 1.21980827392e-02 1.23472319177e-02 1.24770996440e-02 1.25723726562e-02 1.26225341258e-02 1.26225341258e-02 - 1.25723726562e-02 1.24770996440e-02 1.23472319177e-02 1.21980827392e-02 1.20475550421e-02 1.19137265332e-02 - 1.18131307076e-02 1.17590249893e-02 1.17590249893e-02 1.18131307076e-02 1.19137265332e-02 1.20475550421e-02 - 1.48820928374e-02 1.51956958667e-02 1.54388806266e-02 1.55924938344e-02 1.56449525655e-02 1.55924938344e-02 - 1.54388806266e-02 1.51956958667e-02 1.48820928374e-02 1.45226393383e-02 1.41440793855e-02 1.37726366090e-02 - 1.34318126710e-02 1.31397287366e-02 1.29064893850e-02 1.27333396536e-02 1.26143883181e-02 1.25396406703e-02 - 1.24976141314e-02 1.24770996440e-02 1.24686371753e-02 1.24657333634e-02 1.24650738064e-02 1.24657333634e-02 - 1.24686371753e-02 1.24770996440e-02 1.24976141314e-02 1.25396406703e-02 1.26143883181e-02 1.27333396536e-02 - 1.29064893850e-02 1.31397287366e-02 1.34318126710e-02 1.37726366090e-02 1.41440793855e-02 1.45226393383e-02 - 1.83246021902e-02 1.88053010662e-02 1.91448778653e-02 1.93203741197e-02 1.93203741197e-02 1.91448778653e-02 - 1.88053010662e-02 1.83246021902e-02 1.77355963866e-02 1.70770073925e-02 1.63890080671e-02 1.57094271493e-02 - 1.50702461704e-02 1.44944499034e-02 1.39945083398e-02 1.35733603577e-02 1.32272933414e-02 1.29494247541e-02 - 1.27327884289e-02 1.25723726562e-02 1.24657333634e-02 1.24123312979e-02 1.24123312979e-02 1.24657333634e-02 - 1.25723726562e-02 1.27327884289e-02 1.29494247541e-02 1.32272933414e-02 1.35733603577e-02 1.39945083398e-02 - 1.44944499034e-02 1.50702461704e-02 1.57094271493e-02 1.63890080671e-02 1.70770073925e-02 1.77355963866e-02 - 2.26267522861e-02 2.32603028496e-02 2.36566460915e-02 2.37914166767e-02 2.36566460915e-02 2.32603028496e-02 - 2.26267522861e-02 2.17964249596e-02 2.08223402545e-02 1.97639178277e-02 1.86800926235e-02 1.76229803621e-02 - 1.66330383744e-02 1.57370100687e-02 1.49488960464e-02 1.42727054437e-02 1.37059602390e-02 1.32437842255e-02 - 1.28827341282e-02 1.26225341258e-02 1.24650738064e-02 1.24123312979e-02 1.24650738064e-02 1.26225341258e-02 - 1.28827341282e-02 1.32437842255e-02 1.37059602390e-02 1.42727054437e-02 1.49488960464e-02 1.57370100687e-02 - 1.66330383744e-02 1.76229803621e-02 1.86800926235e-02 1.97639178277e-02 2.08223402545e-02 2.17964249596e-02 - 2.78466298707e-02 2.85879356046e-02 2.89691250092e-02 2.89691250092e-02 2.85879356046e-02 2.78466298707e-02 - 2.67889182249e-02 2.54803066383e-02 2.40022165572e-02 2.24420850452e-02 2.08820531014e-02 1.93892705934e-02 - 1.80109897723e-02 1.67754563001e-02 1.56960478729e-02 1.47756456624e-02 1.40109856905e-02 1.33976732300e-02 - 1.29342051284e-02 1.26225341258e-02 1.24657333634e-02 1.24657333634e-02 1.26225341258e-02 1.29342051284e-02 - 1.33976732300e-02 1.40109856905e-02 1.47756456624e-02 1.56960478729e-02 1.67754563001e-02 1.80109897723e-02 - 1.93892705934e-02 2.08820531014e-02 2.24420850452e-02 2.40022165572e-02 2.54803066383e-02 2.67889182249e-02 - 3.39533984936e-02 3.47182328687e-02 3.49773595797e-02 3.47182328687e-02 3.39533984936e-02 3.27229087590e-02 - 3.10978190541e-02 2.91781605866e-02 2.70827915169e-02 2.49333108373e-02 2.28368095394e-02 2.08735527936e-02 - 1.90940368490e-02 1.75241772421e-02 1.61729889157e-02 1.50389831834e-02 1.41157952825e-02 1.33976732300e-02 - 1.28827341282e-02 1.25723726562e-02 1.24686371753e-02 1.25723726562e-02 1.28827341282e-02 1.33976732300e-02 - 1.41157952825e-02 1.50389831834e-02 1.61729889157e-02 1.75241772421e-02 1.90940368490e-02 2.08735527936e-02 - 2.28368095394e-02 2.49333108373e-02 2.70827915169e-02 2.91781605866e-02 3.10978190541e-02 3.27229087590e-02 - 4.07924714489e-02 4.14579289512e-02 4.14579289512e-02 4.07924714489e-02 3.94908104948e-02 3.76190713504e-02 - 3.52857897121e-02 3.26363277502e-02 2.98349904445e-02 2.70402901784e-02 2.43819637041e-02 2.19482820950e-02 - 1.97871783123e-02 1.79167348748e-02 1.63370205752e-02 1.50389831834e-02 1.40109856905e-02 1.32437842255e-02 - 1.27327884289e-02 1.24770996440e-02 1.24770996440e-02 1.27327884289e-02 1.32437842255e-02 1.40109856905e-02 - 1.50389831834e-02 1.63370205752e-02 1.79167348748e-02 1.97871783123e-02 2.19482820950e-02 2.43819637041e-02 - 2.70402901784e-02 2.98349904445e-02 3.26363277502e-02 3.52857897121e-02 3.76190713504e-02 3.94908104948e-02 - 4.80677366203e-02 4.84815544672e-02 4.80677366203e-02 4.68401774785e-02 4.48486167771e-02 4.21941579647e-02 - 3.90350130516e-02 3.55725175924e-02 3.20210145144e-02 2.85734174953e-02 2.53749373622e-02 2.25132701769e-02 - 2.00258575799e-02 1.79167348748e-02 1.61729889157e-02 1.47756456624e-02 1.37059602390e-02 1.29494247541e-02 - 1.24976141314e-02 1.23472319177e-02 1.24976141314e-02 1.29494247541e-02 1.37059602390e-02 1.47756456624e-02 - 1.61729889157e-02 1.79167348748e-02 2.00258575799e-02 2.25132701769e-02 2.53749373622e-02 2.85734174953e-02 - 3.20210145144e-02 3.55725175924e-02 3.90350130516e-02 4.21941579647e-02 4.48486167771e-02 4.68401774785e-02 - 5.53499973529e-02 5.53499973529e-02 5.43692149489e-02 5.24339557043e-02 4.96193341715e-02 4.60731359718e-02 - 4.20165784801e-02 3.77147526395e-02 3.34304675050e-02 2.93819034216e-02 2.57176061925e-02 2.25132701769e-02 - 1.97871783123e-02 1.75241772421e-02 1.56960478729e-02 1.42727054437e-02 1.32272933414e-02 1.25396406703e-02 - 1.21980827392e-02 1.21980827392e-02 1.25396406703e-02 1.32272933414e-02 1.42727054437e-02 1.56960478729e-02 - 1.75241772421e-02 1.97871783123e-02 2.25132701769e-02 2.57176061925e-02 2.93819034216e-02 3.34304675050e-02 - 3.77147526395e-02 4.20165784801e-02 4.60731359718e-02 4.96193341715e-02 5.24339557043e-02 5.43692149489e-02 - 6.21334821617e-02 6.15702941626e-02 5.98878714669e-02 5.71251588417e-02 5.33923081840e-02 4.88987422193e-02 - 4.39402098517e-02 3.88462459817e-02 3.39176800802e-02 2.93819034216e-02 2.53749373622e-02 2.19482820950e-02 - 1.90940368490e-02 1.67754563001e-02 1.49488960464e-02 1.35733603577e-02 1.26143883181e-02 1.20475550421e-02 - 1.18598583649e-02 1.20475550421e-02 1.26143883181e-02 1.35733603577e-02 1.49488960464e-02 1.67754563001e-02 - 1.90940368490e-02 2.19482820950e-02 2.53749373622e-02 2.93819034216e-02 3.39176800802e-02 3.88462459817e-02 - 4.39402098517e-02 4.88987422193e-02 5.33923081840e-02 5.71251588417e-02 5.98878714669e-02 6.15702941626e-02 - 6.79320857310e-02 6.66786802062e-02 6.41840706496e-02 6.05090723285e-02 5.58153453540e-02 5.03893328752e-02 - 4.46053414397e-02 3.88462459817e-02 3.34304675050e-02 2.85734174953e-02 2.43819637041e-02 2.08735527936e-02 - 1.80109897723e-02 1.57370100687e-02 1.39945083398e-02 1.27333396536e-02 1.19137265332e-02 1.15097880648e-02 - 1.15097880648e-02 1.19137265332e-02 1.27333396536e-02 1.39945083398e-02 1.57370100687e-02 1.80109897723e-02 - 2.08735527936e-02 2.43819637041e-02 2.85734174953e-02 3.34304675050e-02 3.88462459817e-02 4.46053414397e-02 - 5.03893328752e-02 5.58153453540e-02 6.05090723285e-02 6.41840706496e-02 6.66786802062e-02 6.79320857310e-02 - 7.23556493700e-02 7.03019494995e-02 6.69101294891e-02 6.22821499923e-02 5.66509609539e-02 5.03893328752e-02 - 4.39402098517e-02 3.77147526395e-02 3.20210145144e-02 2.70402901784e-02 2.28368095394e-02 1.93892705934e-02 - 1.66330383744e-02 1.44944499034e-02 1.29064893850e-02 1.18131307076e-02 1.11729588764e-02 1.09620544703e-02 - 1.11729588764e-02 1.18131307076e-02 1.29064893850e-02 1.44944499034e-02 1.66330383744e-02 1.93892705934e-02 - 2.28368095394e-02 2.70402901784e-02 3.20210145144e-02 3.77147526395e-02 4.39402098517e-02 5.03893328752e-02 - 5.66509609539e-02 6.22821499923e-02 6.69101294891e-02 7.03019494995e-02 7.23556493700e-02 7.30418134594e-02 - 7.51264696898e-02 7.21810172465e-02 6.78442738531e-02 6.22821499923e-02 5.58153453540e-02 4.88987422193e-02 - 4.20165784801e-02 3.55725175924e-02 2.98349904445e-02 2.49333108373e-02 2.08820531014e-02 1.76229803621e-02 - 1.50702461704e-02 1.31397287366e-02 1.17590249893e-02 1.08706042529e-02 1.04356792319e-02 1.04356792319e-02 - 1.08706042529e-02 1.17590249893e-02 1.31397287366e-02 1.50702461704e-02 1.76229803621e-02 2.08820531014e-02 - 2.49333108373e-02 2.98349904445e-02 3.55725175924e-02 4.20165784801e-02 4.88987422193e-02 5.58153453540e-02 - 6.22821499923e-02 6.78442738531e-02 7.21810172465e-02 7.51264696898e-02 7.66122811094e-02 7.66122811094e-02 - 7.60705845667e-02 7.21810172465e-02 6.69101294891e-02 6.05090723285e-02 5.33923081840e-02 4.60731359718e-02 - 3.90350130516e-02 3.26363277502e-02 2.70827915169e-02 2.24420850452e-02 1.86800926235e-02 1.57094271493e-02 - 1.34318126710e-02 1.17590249893e-02 1.06181928008e-02 9.95507847617e-03 9.73748464183e-03 9.95507847617e-03 - 1.06181928008e-02 1.17590249893e-02 1.34318126710e-02 1.57094271493e-02 1.86800926235e-02 2.24420850452e-02 - 2.70827915169e-02 3.26363277502e-02 3.90350130516e-02 4.60731359718e-02 5.33923081840e-02 6.05090723285e-02 - 6.69101294891e-02 7.21810172465e-02 7.60705845667e-02 7.84511058955e-02 7.92532152557e-02 7.84511058955e-02 - 7.51264696898e-02 7.03019494995e-02 6.41840706496e-02 5.71251588417e-02 4.96193341715e-02 4.21941579647e-02 - 3.52857897121e-02 2.91781605866e-02 2.40022165572e-02 1.97639178277e-02 1.63890080671e-02 1.37726366090e-02 - 1.18131307076e-02 1.04238516982e-02 9.53627070961e-03 9.10381322670e-03 9.10381322670e-03 9.53627070961e-03 - 1.04238516982e-02 1.18131307076e-02 1.37726366090e-02 1.63890080671e-02 1.97639178277e-02 2.40022165572e-02 - 2.91781605866e-02 3.52857897121e-02 4.21941579647e-02 4.96193341715e-02 5.71251588417e-02 6.41840706496e-02 - 7.03019494995e-02 7.51264696898e-02 7.84511058955e-02 8.01500628124e-02 8.01500628124e-02 7.84511058955e-02 - 7.23556493700e-02 6.66786802062e-02 5.98878714669e-02 5.24339557043e-02 4.48486167771e-02 3.76190713504e-02 - 3.10978190541e-02 2.54803066383e-02 2.08223402545e-02 1.70770073925e-02 1.41440793855e-02 1.19137265332e-02 - 1.02881382638e-02 9.18679124184e-03 8.54973346172e-03 8.34122341388e-03 8.54973346172e-03 9.18679124184e-03 - 1.02881382638e-02 1.19137265332e-02 1.41440793855e-02 1.70770073925e-02 2.08223402545e-02 2.54803066383e-02 - 3.10978190541e-02 3.76190713504e-02 4.48486167771e-02 5.24339557043e-02 5.98878714669e-02 6.66786802062e-02 - 7.23556493700e-02 7.66122811094e-02 7.92532152557e-02 8.01500628124e-02 7.92532152557e-02 7.66122811094e-02 - 6.79320857310e-02 6.15702941626e-02 5.43692149489e-02 4.68401774785e-02 3.94908104948e-02 3.27229087590e-02 - 2.67889182249e-02 2.17964249596e-02 1.77355963866e-02 1.45226393383e-02 1.20475550421e-02 1.02054916185e-02 - 8.90705726329e-03 8.08133005705e-03 7.68014935330e-03 7.68014935330e-03 8.08133005705e-03 8.90705726329e-03 - 1.02054916185e-02 1.20475550421e-02 1.45226393383e-02 1.77355963866e-02 2.17964249596e-02 2.67889182249e-02 - 3.27229087590e-02 3.94908104948e-02 4.68401774785e-02 5.43692149489e-02 6.15702941626e-02 6.79320857310e-02 - 7.30418134594e-02 7.66122811094e-02 7.84511058955e-02 7.84511058955e-02 7.66122811094e-02 7.30418134594e-02 - 5.77319585491e-02 5.00090134447e-02 4.23378898536e-02 3.51532871168e-02 2.87439673059e-02 2.32562353108e-02 - 1.87162119832e-02 1.50645020089e-02 1.21980827392e-02 1.00055755901e-02 8.38500711079e-03 7.24904282964e-03 - 6.52902358143e-03 6.17967298585e-03 6.17967298585e-03 6.52902358143e-03 7.24904282964e-03 8.38500711079e-03 - 1.00055755901e-02 1.21980827392e-02 1.50645020089e-02 1.87162119832e-02 2.32562353108e-02 2.87439673059e-02 - 3.51532871168e-02 4.23378898536e-02 5.00090134447e-02 5.77319585491e-02 6.49555724266e-02 7.10787520021e-02 - 7.55368812409e-02 7.78881394404e-02 7.78881394404e-02 7.55368812409e-02 7.10787520021e-02 6.49555724266e-02 - 5.00090134447e-02 4.27763236460e-02 3.58243136049e-02 2.94854041377e-02 2.39549635512e-02 1.93050944183e-02 - 1.55127511572e-02 1.24976141314e-02 1.01587603229e-02 8.39746782805e-03 7.12561826537e-03 6.26978037715e-03 - 5.77651892440e-03 5.61528193683e-03 5.77651892440e-03 6.26978037715e-03 7.12561826537e-03 8.39746782805e-03 - 1.01587603229e-02 1.24976141314e-02 1.55127511572e-02 1.93050944183e-02 2.39549635512e-02 2.94854041377e-02 - 3.58243136049e-02 4.27763236460e-02 5.00090134447e-02 5.70612480291e-02 6.33842515281e-02 6.84139609392e-02 - 7.16581855164e-02 7.27796836797e-02 7.16581855164e-02 6.84139609392e-02 6.33842515281e-02 5.70612480291e-02 - 4.23378898536e-02 3.58243136049e-02 2.97391273192e-02 2.43184216158e-02 1.96777557044e-02 1.58329883187e-02 - 1.27327884289e-02 1.02937156151e-02 8.42580807925e-03 7.04448483440e-03 6.07562992209e-03 5.46093720174e-03 - 5.16243150929e-03 5.16243150929e-03 5.46093720174e-03 6.07562992209e-03 7.04448483440e-03 8.42580807925e-03 - 1.02937156151e-02 1.27327884289e-02 1.58329883187e-02 1.96777557044e-02 2.43184216158e-02 2.97391273192e-02 - 3.58243136049e-02 4.23378898536e-02 4.89192305177e-02 5.51031089527e-02 6.03694423859e-02 6.42180018992e-02 - 6.62522137956e-02 6.62522137956e-02 6.42180018992e-02 6.03694423859e-02 5.51031089527e-02 4.89192305177e-02 - 3.51532871168e-02 2.94854041377e-02 2.43184216158e-02 1.98052910067e-02 1.59997599900e-02 1.28827341282e-02 - 1.03937663652e-02 8.45686847188e-03 6.99504538611e-03 5.93719631865e-03 5.22371135458e-03 4.81172327806e-03 - 4.67692793169e-03 4.81172327806e-03 5.22371135458e-03 5.93719631865e-03 6.99504538611e-03 8.45686847188e-03 - 1.03937663652e-02 1.28827341282e-02 1.59997599900e-02 1.98052910067e-02 2.43184216158e-02 2.94854041377e-02 - 3.51532871168e-02 4.10571769449e-02 4.68264624901e-02 5.20147259753e-02 5.61547897924e-02 5.88318176265e-02 - 5.97584596222e-02 5.88318176265e-02 5.61547897924e-02 5.20147259753e-02 4.68264624901e-02 4.10571769449e-02 - 2.87439673059e-02 2.39549635512e-02 1.96777557044e-02 1.59997599900e-02 1.29342051284e-02 1.04468583553e-02 - 8.47998103933e-03 6.96786738821e-03 5.84558656512e-03 5.05545032098e-03 4.55262020357e-03 4.30805835198e-03 - 4.30805835198e-03 4.55262020357e-03 5.05545032098e-03 5.84558656512e-03 6.96786738821e-03 8.47998103933e-03 - 1.04468583553e-02 1.29342051284e-02 1.59997599900e-02 1.96777557044e-02 2.39549635512e-02 2.87439673059e-02 - 3.38635928392e-02 3.90347179512e-02 4.38959177953e-02 4.80406383964e-02 5.10737783335e-02 5.26787408684e-02 - 5.26787408684e-02 5.10737783335e-02 4.80406383964e-02 4.38959177953e-02 3.90347179512e-02 3.38635928392e-02 - 2.32562353108e-02 1.93050944183e-02 1.58329883187e-02 1.28827341282e-02 1.04468583553e-02 8.48843476768e-03 - 6.95605972443e-03 5.79365065764e-03 4.94806264494e-03 4.37525079151e-03 4.04374575730e-03 3.93522801758e-03 - 4.04374575730e-03 4.37525079151e-03 4.94806264494e-03 5.79365065764e-03 6.95605972443e-03 8.48843476768e-03 - 1.04468583553e-02 1.28827341282e-02 1.58329883187e-02 1.93050944183e-02 2.32562353108e-02 2.75721078901e-02 - 3.20546920774e-02 3.64263171972e-02 4.03527020822e-02 4.34838779539e-02 4.55081727847e-02 4.62088704848e-02 - 4.55081727847e-02 4.34838779539e-02 4.03527020822e-02 3.64263171972e-02 3.20546920774e-02 2.75721078901e-02 - 1.87162119832e-02 1.55127511572e-02 1.27327884289e-02 1.03937663652e-02 8.47998103933e-03 6.95605972443e-03 - 5.77685140016e-03 4.89581524939e-03 4.27192322596e-03 3.87358926493e-03 3.67971968314e-03 3.67971968314e-03 - 3.87358926493e-03 4.27192322596e-03 4.89581524939e-03 5.77685140016e-03 6.95605972443e-03 8.47998103933e-03 - 1.03937663652e-02 1.27327884289e-02 1.55127511572e-02 1.87162119832e-02 2.22755921268e-02 2.60582031450e-02 - 2.98615217076e-02 3.34242157073e-02 3.64535808156e-02 3.86662855632e-02 3.98358227133e-02 3.98358227133e-02 - 3.86662855632e-02 3.64535808156e-02 3.34242157073e-02 2.98615217076e-02 2.60582031450e-02 2.22755921268e-02 - 1.50645020089e-02 1.24976141314e-02 1.02937156151e-02 8.45686847188e-03 6.96786738821e-03 5.79365065764e-03 - 4.89581524939e-03 4.23798561825e-03 3.79030883078e-03 3.53085792774e-03 3.44594928533e-03 3.53085792774e-03 - 3.79030883078e-03 4.23798561825e-03 4.89581524939e-03 5.79365065764e-03 6.96786738821e-03 8.45686847188e-03 - 1.02937156151e-02 1.24976141314e-02 1.50645020089e-02 1.79555609317e-02 2.10847229658e-02 2.43103322252e-02 - 2.74372089612e-02 3.02323588099e-02 3.24534608631e-02 3.38859304601e-02 3.43811654173e-02 3.38859304601e-02 - 3.24534608631e-02 3.02323588099e-02 2.74372089612e-02 2.43103322252e-02 2.10847229658e-02 1.79555609317e-02 - 1.21980827392e-02 1.01587603229e-02 8.42580807925e-03 6.99504538611e-03 5.84558656512e-03 4.94806264494e-03 - 4.27192322596e-03 3.79030883078e-03 3.48198055848e-03 3.33184951460e-03 3.33184951460e-03 3.48198055848e-03 - 3.79030883078e-03 4.27192322596e-03 4.94806264494e-03 5.84558656512e-03 6.99504538611e-03 8.42580807925e-03 - 1.01587603229e-02 1.21980827392e-02 1.45226393383e-02 1.70770073925e-02 1.97639178277e-02 2.24420850452e-02 - 2.49333108373e-02 2.70402901784e-02 2.85734174953e-02 2.93819034216e-02 2.93819034216e-02 2.85734174953e-02 - 2.70402901784e-02 2.49333108373e-02 2.24420850452e-02 1.97639178277e-02 1.70770073925e-02 1.45226393383e-02 - 1.00055755901e-02 8.39746782805e-03 7.04448483440e-03 5.93719631865e-03 5.05545032098e-03 4.37525079151e-03 - 3.87358926493e-03 3.53085792774e-03 3.33184951460e-03 3.26667178574e-03 3.33184951460e-03 3.53085792774e-03 - 3.87358926493e-03 4.37525079151e-03 5.05545032098e-03 5.93719631865e-03 7.04448483440e-03 8.39746782805e-03 - 1.00055755901e-02 1.18598583649e-02 1.39256808178e-02 1.61367490443e-02 1.83921353899e-02 2.05587788214e-02 - 2.24815496090e-02 2.40011711299e-02 2.49776956914e-02 2.53146898274e-02 2.49776956914e-02 2.40011711299e-02 - 2.24815496090e-02 2.05587788214e-02 1.83921353899e-02 1.61367490443e-02 1.39256808178e-02 1.18598583649e-02 - 8.38500711079e-03 7.12561826537e-03 6.07562992209e-03 5.22371135458e-03 4.55262020357e-03 4.04374575730e-03 - 3.67971968314e-03 3.44594928533e-03 3.33184951460e-03 3.33184951460e-03 3.44594928533e-03 3.67971968314e-03 - 4.04374575730e-03 4.55262020357e-03 5.22371135458e-03 6.07562992209e-03 7.12561826537e-03 8.38500711079e-03 - 9.85294674885e-03 1.15097880648e-02 1.33116675302e-02 1.51874137660e-02 1.70389543521e-02 1.87467470027e-02 - 2.01812628043e-02 2.12198093897e-02 2.17657781241e-02 2.17657781241e-02 2.12198093897e-02 2.01812628043e-02 - 1.87467470027e-02 1.70389543521e-02 1.51874137660e-02 1.33116675302e-02 1.15097880648e-02 9.85294674885e-03 - 7.24904282964e-03 6.26978037715e-03 5.46093720174e-03 4.81172327806e-03 4.30805835198e-03 3.93522801758e-03 - 3.67971968314e-03 3.53085792774e-03 3.48198055848e-03 3.53085792774e-03 3.67971968314e-03 3.93522801758e-03 - 4.30805835198e-03 4.81172327806e-03 5.46093720174e-03 6.26978037715e-03 7.24904282964e-03 8.40200942373e-03 - 9.71912104775e-03 1.11729588764e-02 1.27148275869e-02 1.42737851127e-02 1.57591868798e-02 1.70678712692e-02 - 1.80960146721e-02 1.87538902948e-02 1.89804120902e-02 1.87538902948e-02 1.80960146721e-02 1.70678712692e-02 - 1.57591868798e-02 1.42737851127e-02 1.27148275869e-02 1.11729588764e-02 9.71912104775e-03 8.40200942373e-03 - 6.52902358143e-03 5.77651892440e-03 5.16243150929e-03 4.67692793169e-03 4.30805835198e-03 4.04374575730e-03 - 3.87358926493e-03 3.79030883078e-03 3.79030883078e-03 3.87358926493e-03 4.04374575730e-03 4.30805835198e-03 - 4.67692793169e-03 5.16243150929e-03 5.77651892440e-03 6.52902358143e-03 7.42492384580e-03 8.46060891145e-03 - 9.61987006090e-03 1.08706042529e-02 1.21629507848e-02 1.34297677852e-02 1.45906790875e-02 1.55601992220e-02 - 1.62588522549e-02 1.66250325509e-02 1.66250325509e-02 1.62588522549e-02 1.55601992220e-02 1.45906790875e-02 - 1.34297677852e-02 1.21629507848e-02 1.08706042529e-02 9.61987006090e-03 8.46060891145e-03 7.42492384580e-03 - 6.17967298585e-03 5.61528193683e-03 5.16243150929e-03 4.81172327806e-03 4.55262020357e-03 4.37525079151e-03 - 4.27192322596e-03 4.23798561825e-03 4.27192322596e-03 4.37525079151e-03 4.55262020357e-03 4.81172327806e-03 - 5.16243150929e-03 5.61528193683e-03 6.17967298585e-03 6.86170422323e-03 7.66146344666e-03 8.57007132232e-03 - 9.56702175361e-03 1.06181928008e-02 1.16751572683e-02 1.26769712537e-02 1.35553259639e-02 1.42425749040e-02 - 1.46810426016e-02 1.48317912783e-02 1.46810426016e-02 1.42425749040e-02 1.35553259639e-02 1.26769712537e-02 - 1.16751572683e-02 1.06181928008e-02 9.56702175361e-03 8.57007132232e-03 7.66146344666e-03 6.86170422323e-03 - 6.17967298585e-03 5.77651892440e-03 5.46093720174e-03 5.22371135458e-03 5.05545032098e-03 4.94806264494e-03 - 4.89581524939e-03 4.89581524939e-03 4.94806264494e-03 5.05545032098e-03 5.22371135458e-03 5.46093720174e-03 - 5.77651892440e-03 6.17967298585e-03 6.67761981445e-03 7.27338017313e-03 7.96341795569e-03 8.73551184506e-03 - 9.56702175361e-03 1.04238516982e-02 1.12609832188e-02 1.20255038743e-02 1.26620800682e-02 1.31198380533e-02 - 1.33594815778e-02 1.33594815778e-02 1.31198380533e-02 1.26620800682e-02 1.20255038743e-02 1.12609832188e-02 - 1.04238516982e-02 9.56702175361e-03 8.73551184506e-03 7.96341795569e-03 7.27338017313e-03 6.67761981445e-03 - 6.52902358143e-03 6.26978037715e-03 6.07562992209e-03 5.93719631865e-03 5.84558656512e-03 5.79365065764e-03 - 5.77685140016e-03 5.79365065764e-03 5.84558656512e-03 5.93719631865e-03 6.07562992209e-03 6.26978037715e-03 - 6.52902358143e-03 6.86170422323e-03 7.27338017313e-03 7.76490388909e-03 8.33057919998e-03 8.95658363692e-03 - 9.61987006090e-03 1.02881382638e-02 1.09215936737e-02 1.14766013692e-02 1.19105819676e-02 1.21873907787e-02 - 1.22825573408e-02 1.21873907787e-02 1.19105819676e-02 1.14766013692e-02 1.09215936737e-02 1.02881382638e-02 - 9.61987006090e-03 8.95658363692e-03 8.33057919998e-03 7.76490388909e-03 7.27338017313e-03 6.86170422323e-03 - 7.24904282964e-03 7.12561826537e-03 7.04448483440e-03 6.99504538611e-03 6.96786738821e-03 6.95605972443e-03 - 6.95605972443e-03 6.96786738821e-03 6.99504538611e-03 7.04448483440e-03 7.12561826537e-03 7.24904282964e-03 - 7.42492384580e-03 7.66146344666e-03 7.96341795569e-03 8.33057919998e-03 8.75631776595e-03 9.22648243576e-03 - 9.71912104775e-03 1.02054916185e-02 1.06524671204e-02 1.10259974674e-02 1.12951380995e-02 1.14361707830e-02 - 1.14361707830e-02 1.12951380995e-02 1.10259974674e-02 1.06524671204e-02 1.02054916185e-02 9.71912104775e-03 - 9.22648243576e-03 8.75631776595e-03 8.33057919998e-03 7.96341795569e-03 7.66146344666e-03 7.42492384580e-03 - 8.38500711079e-03 8.39746782805e-03 8.42580807925e-03 8.45686847188e-03 8.47998103933e-03 8.48843476768e-03 - 8.47998103933e-03 8.45686847188e-03 8.42580807925e-03 8.39746782805e-03 8.38500711079e-03 8.40200942373e-03 - 8.46060891145e-03 8.57007132232e-03 8.73551184506e-03 8.95658363692e-03 9.22648243576e-03 9.53173661310e-03 - 9.85294674885e-03 1.01663421573e-02 1.04460621935e-02 1.06671499136e-02 1.08088949298e-02 1.08577130860e-02 - 1.08088949298e-02 1.06671499136e-02 1.04460621935e-02 1.01663421573e-02 9.85294674885e-03 9.53173661310e-03 - 9.22648243576e-03 8.95658363692e-03 8.73551184506e-03 8.57007132232e-03 8.46060891145e-03 8.40200942373e-03 - 1.00055755901e-02 1.01587603229e-02 1.02937156151e-02 1.03937663652e-02 1.04468583553e-02 1.04468583553e-02 - 1.03937663652e-02 1.02937156151e-02 1.01587603229e-02 1.00055755901e-02 9.85294674885e-03 9.71912104775e-03 - 9.61987006090e-03 9.56702175361e-03 9.56702175361e-03 9.61987006090e-03 9.71912104775e-03 9.85294674885e-03 - 1.00055755901e-02 1.01587603229e-02 1.02937156151e-02 1.03937663652e-02 1.04468583553e-02 1.04468583553e-02 - 1.03937663652e-02 1.02937156151e-02 1.01587603229e-02 1.00055755901e-02 9.85294674885e-03 9.71912104775e-03 - 9.61987006090e-03 9.56702175361e-03 9.56702175361e-03 9.61987006090e-03 9.71912104775e-03 9.85294674885e-03 - 1.21980827392e-02 1.24976141314e-02 1.27327884289e-02 1.28827341282e-02 1.29342051284e-02 1.28827341282e-02 - 1.27327884289e-02 1.24976141314e-02 1.21980827392e-02 1.18598583649e-02 1.15097880648e-02 1.11729588764e-02 - 1.08706042529e-02 1.06181928008e-02 1.04238516982e-02 1.02881382638e-02 1.02054916185e-02 1.01663421573e-02 - 1.01587603229e-02 1.01697655067e-02 1.01870819285e-02 1.02011860999e-02 1.02064774226e-02 1.02011860999e-02 - 1.01870819285e-02 1.01697655067e-02 1.01587603229e-02 1.01663421573e-02 1.02054916185e-02 1.02881382638e-02 - 1.04238516982e-02 1.06181928008e-02 1.08706042529e-02 1.11729588764e-02 1.15097880648e-02 1.18598583649e-02 - 1.50645020089e-02 1.55127511572e-02 1.58329883187e-02 1.59997599900e-02 1.59997599900e-02 1.58329883187e-02 - 1.55127511572e-02 1.50645020089e-02 1.45226393383e-02 1.39256808178e-02 1.33116675302e-02 1.27148275869e-02 - 1.21629507848e-02 1.16751572683e-02 1.12609832188e-02 1.09215936737e-02 1.06524671204e-02 1.04460621935e-02 - 1.02937156151e-02 1.01870819285e-02 1.01194532806e-02 1.00865795572e-02 1.00865795572e-02 1.01194532806e-02 - 1.01870819285e-02 1.02937156151e-02 1.04460621935e-02 1.06524671204e-02 1.09215936737e-02 1.12609832188e-02 - 1.16751572683e-02 1.21629507848e-02 1.27148275869e-02 1.33116675302e-02 1.39256808178e-02 1.45226393383e-02 - 1.87162119832e-02 1.93050944183e-02 1.96777557044e-02 1.98052910067e-02 1.96777557044e-02 1.93050944183e-02 - 1.87162119832e-02 1.79555609317e-02 1.70770073925e-02 1.61367490443e-02 1.51874137660e-02 1.42737851127e-02 - 1.34297677852e-02 1.26769712537e-02 1.20255038743e-02 1.14766013692e-02 1.10259974674e-02 1.06671499136e-02 - 1.03937663652e-02 1.02011860999e-02 1.00865795572e-02 1.00485204973e-02 1.00865795572e-02 1.02011860999e-02 - 1.03937663652e-02 1.06671499136e-02 1.10259974674e-02 1.14766013692e-02 1.20255038743e-02 1.26769712537e-02 - 1.34297677852e-02 1.42737851127e-02 1.51874137660e-02 1.61367490443e-02 1.70770073925e-02 1.79555609317e-02 - 2.32562353108e-02 2.39549635512e-02 2.43184216158e-02 2.43184216158e-02 2.39549635512e-02 2.32562353108e-02 - 2.22755921268e-02 2.10847229658e-02 1.97639178277e-02 1.83921353899e-02 1.70389543521e-02 1.57591868798e-02 - 1.45906790875e-02 1.35553259639e-02 1.26620800682e-02 1.19105819676e-02 1.12951380995e-02 1.08088949298e-02 - 1.04468583553e-02 1.02064774226e-02 1.00865795572e-02 1.00865795572e-02 1.02064774226e-02 1.04468583553e-02 - 1.08088949298e-02 1.12951380995e-02 1.19105819676e-02 1.26620800682e-02 1.35553259639e-02 1.45906790875e-02 - 1.57591868798e-02 1.70389543521e-02 1.83921353899e-02 1.97639178277e-02 2.10847229658e-02 2.22755921268e-02 - 2.87439673059e-02 2.94854041377e-02 2.97391273192e-02 2.94854041377e-02 2.87439673059e-02 2.75721078901e-02 - 2.60582031450e-02 2.43103322252e-02 2.24420850452e-02 2.05587788214e-02 1.87467470027e-02 1.70678712692e-02 - 1.55601992220e-02 1.42425749040e-02 1.31198380533e-02 1.21873907787e-02 1.14361707830e-02 1.08577130860e-02 - 1.04468583553e-02 1.02011860999e-02 1.01194532806e-02 1.02011860999e-02 1.04468583553e-02 1.08577130860e-02 - 1.14361707830e-02 1.21873907787e-02 1.31198380533e-02 1.42425749040e-02 1.55601992220e-02 1.70678712692e-02 - 1.87467470027e-02 2.05587788214e-02 2.24420850452e-02 2.43103322252e-02 2.60582031450e-02 2.75721078901e-02 - 3.51532871168e-02 3.58243136049e-02 3.58243136049e-02 3.51532871168e-02 3.38635928392e-02 3.20546920774e-02 - 2.98615217076e-02 2.74372089612e-02 2.49333108373e-02 2.24815496090e-02 2.01812628043e-02 1.80960146721e-02 - 1.62588522549e-02 1.46810426016e-02 1.33594815778e-02 1.22825573408e-02 1.14361707830e-02 1.08088949298e-02 - 1.03937663652e-02 1.01870819285e-02 1.01870819285e-02 1.03937663652e-02 1.08088949298e-02 1.14361707830e-02 - 1.22825573408e-02 1.33594815778e-02 1.46810426016e-02 1.62588522549e-02 1.80960146721e-02 2.01812628043e-02 - 2.24815496090e-02 2.49333108373e-02 2.74372089612e-02 2.98615217076e-02 3.20546920774e-02 3.38635928392e-02 - 4.23378898536e-02 4.27763236460e-02 4.23378898536e-02 4.10571769449e-02 3.90347179512e-02 3.64263171972e-02 - 3.34242157073e-02 3.02323588099e-02 2.70402901784e-02 2.40011711299e-02 2.12198093897e-02 1.87538902948e-02 - 1.66250325509e-02 1.48317912783e-02 1.33594815778e-02 1.21873907787e-02 1.12951380995e-02 1.06671499136e-02 - 1.02937156151e-02 1.01697655067e-02 1.02937156151e-02 1.06671499136e-02 1.12951380995e-02 1.21873907787e-02 - 1.33594815778e-02 1.48317912783e-02 1.66250325509e-02 1.87538902948e-02 2.12198093897e-02 2.40011711299e-02 - 2.70402901784e-02 3.02323588099e-02 3.34242157073e-02 3.64263171972e-02 3.90347179512e-02 4.10571769449e-02 - 5.00090134447e-02 5.00090134447e-02 4.89192305177e-02 4.68264624901e-02 4.38959177953e-02 4.03527020822e-02 - 3.64535808156e-02 3.24534608631e-02 2.85734174953e-02 2.49776956914e-02 2.17657781241e-02 1.89804120902e-02 - 1.66250325509e-02 1.46810426016e-02 1.31198380533e-02 1.19105819676e-02 1.10259974674e-02 1.04460621935e-02 - 1.01587603229e-02 1.01587603229e-02 1.04460621935e-02 1.10259974674e-02 1.19105819676e-02 1.31198380533e-02 - 1.46810426016e-02 1.66250325509e-02 1.89804120902e-02 2.17657781241e-02 2.49776956914e-02 2.85734174953e-02 - 3.24534608631e-02 3.64535808156e-02 4.03527020822e-02 4.38959177953e-02 4.68264624901e-02 4.89192305177e-02 - 5.77319585491e-02 5.70612480291e-02 5.51031089527e-02 5.20147259753e-02 4.80406383964e-02 4.34838779539e-02 - 3.86662855632e-02 3.38859304601e-02 2.93819034216e-02 2.53146898274e-02 2.17657781241e-02 1.87538902948e-02 - 1.62588522549e-02 1.42425749040e-02 1.26620800682e-02 1.14766013692e-02 1.06524671204e-02 1.01663421573e-02 - 1.00055755901e-02 1.01663421573e-02 1.06524671204e-02 1.14766013692e-02 1.26620800682e-02 1.42425749040e-02 - 1.62588522549e-02 1.87538902948e-02 2.17657781241e-02 2.53146898274e-02 2.93819034216e-02 3.38859304601e-02 - 3.86662855632e-02 4.34838779539e-02 4.80406383964e-02 5.20147259753e-02 5.51031089527e-02 5.70612480291e-02 - 6.49555724266e-02 6.33842515281e-02 6.03694423859e-02 5.61547897924e-02 5.10737783335e-02 4.55081727847e-02 - 3.98358227133e-02 3.43811654173e-02 2.93819034216e-02 2.49776956914e-02 2.12198093897e-02 1.80960146721e-02 - 1.55601992220e-02 1.35553259639e-02 1.20255038743e-02 1.09215936737e-02 1.02054916185e-02 9.85294674885e-03 - 9.85294674885e-03 1.02054916185e-02 1.09215936737e-02 1.20255038743e-02 1.35553259639e-02 1.55601992220e-02 - 1.80960146721e-02 2.12198093897e-02 2.49776956914e-02 2.93819034216e-02 3.43811654173e-02 3.98358227133e-02 - 4.55081727847e-02 5.10737783335e-02 5.61547897924e-02 6.03694423859e-02 6.33842515281e-02 6.49555724266e-02 - 7.10787520021e-02 6.84139609392e-02 6.42180018992e-02 5.88318176265e-02 5.26787408684e-02 4.62088704848e-02 - 3.98358227133e-02 3.38859304601e-02 2.85734174953e-02 2.40011711299e-02 2.01812628043e-02 1.70678712692e-02 - 1.45906790875e-02 1.26769712537e-02 1.12609832188e-02 1.02881382638e-02 9.71912104775e-03 9.53173661310e-03 - 9.71912104775e-03 1.02881382638e-02 1.12609832188e-02 1.26769712537e-02 1.45906790875e-02 1.70678712692e-02 - 2.01812628043e-02 2.40011711299e-02 2.85734174953e-02 3.38859304601e-02 3.98358227133e-02 4.62088704848e-02 - 5.26787408684e-02 5.88318176265e-02 6.42180018992e-02 6.84139609392e-02 7.10787520021e-02 7.19923628057e-02 - 7.55368812409e-02 7.16581855164e-02 6.62522137956e-02 5.97584596222e-02 5.26787408684e-02 4.55081727847e-02 - 3.86662855632e-02 3.24534608631e-02 2.70402901784e-02 2.24815496090e-02 1.87467470027e-02 1.57591868798e-02 - 1.34297677852e-02 1.16751572683e-02 1.04238516982e-02 9.61987006090e-03 9.22648243576e-03 9.22648243576e-03 - 9.61987006090e-03 1.04238516982e-02 1.16751572683e-02 1.34297677852e-02 1.57591868798e-02 1.87467470027e-02 - 2.24815496090e-02 2.70402901784e-02 3.24534608631e-02 3.86662855632e-02 4.55081727847e-02 5.26787408684e-02 - 5.97584596222e-02 6.62522137956e-02 7.16581855164e-02 7.55368812409e-02 7.75631573239e-02 7.75631573239e-02 - 7.78881394404e-02 7.27796836797e-02 6.62522137956e-02 5.88318176265e-02 5.10737783335e-02 4.34838779539e-02 - 3.64535808156e-02 3.02323588099e-02 2.49333108373e-02 2.05587788214e-02 1.70389543521e-02 1.42737851127e-02 - 1.21629507848e-02 1.06181928008e-02 9.56702175361e-03 8.95658363692e-03 8.75631776595e-03 8.95658363692e-03 - 9.56702175361e-03 1.06181928008e-02 1.21629507848e-02 1.42737851127e-02 1.70389543521e-02 2.05587788214e-02 - 2.49333108373e-02 3.02323588099e-02 3.64535808156e-02 4.34838779539e-02 5.10737783335e-02 5.88318176265e-02 - 6.62522137956e-02 7.27796836797e-02 7.78881394404e-02 8.11458755837e-02 8.22656900591e-02 8.11458755837e-02 - 7.78881394404e-02 7.16581855164e-02 6.42180018992e-02 5.61547897924e-02 4.80406383964e-02 4.03527020822e-02 - 3.34242157073e-02 2.74372089612e-02 2.24420850452e-02 1.83921353899e-02 1.51874137660e-02 1.27148275869e-02 - 1.08706042529e-02 9.56702175361e-03 8.73551184506e-03 8.33057919998e-03 8.33057919998e-03 8.73551184506e-03 - 9.56702175361e-03 1.08706042529e-02 1.27148275869e-02 1.51874137660e-02 1.83921353899e-02 2.24420850452e-02 - 2.74372089612e-02 3.34242157073e-02 4.03527020822e-02 4.80406383964e-02 5.61547897924e-02 6.42180018992e-02 - 7.16581855164e-02 7.78881394404e-02 8.23828782457e-02 8.47410728024e-02 8.47410728024e-02 8.23828782457e-02 - 7.55368812409e-02 6.84139609392e-02 6.03694423859e-02 5.20147259753e-02 4.38959177953e-02 3.64263171972e-02 - 2.98615217076e-02 2.43103322252e-02 1.97639178277e-02 1.61367490443e-02 1.33116675302e-02 1.11729588764e-02 - 9.61987006090e-03 8.57007132232e-03 7.96341795569e-03 7.76490388909e-03 7.96341795569e-03 8.57007132232e-03 - 9.61987006090e-03 1.11729588764e-02 1.33116675302e-02 1.61367490443e-02 1.97639178277e-02 2.43103322252e-02 - 2.98615217076e-02 3.64263171972e-02 4.38959177953e-02 5.20147259753e-02 6.03694423859e-02 6.84139609392e-02 - 7.55368812409e-02 8.11458755837e-02 8.47410728024e-02 8.59805323971e-02 8.47410728024e-02 8.11458755837e-02 - 7.10787520021e-02 6.33842515281e-02 5.51031089527e-02 4.68264624901e-02 3.90347179512e-02 3.20546920774e-02 - 2.60582031450e-02 2.10847229658e-02 1.70770073925e-02 1.39256808178e-02 1.15097880648e-02 9.71912104775e-03 - 8.46060891145e-03 7.66146344666e-03 7.27338017313e-03 7.27338017313e-03 7.66146344666e-03 8.46060891145e-03 - 9.71912104775e-03 1.15097880648e-02 1.39256808178e-02 1.70770073925e-02 2.10847229658e-02 2.60582031450e-02 - 3.20546920774e-02 3.90347179512e-02 4.68264624901e-02 5.51031089527e-02 6.33842515281e-02 7.10787520021e-02 - 7.75631573239e-02 8.22656900591e-02 8.47410728024e-02 8.47410728024e-02 8.22656900591e-02 7.75631573239e-02 - 6.49555724266e-02 5.70612480291e-02 4.89192305177e-02 4.10571769449e-02 3.38635928392e-02 2.75721078901e-02 - 2.22755921268e-02 1.79555609317e-02 1.45226393383e-02 1.18598583649e-02 9.85294674885e-03 8.40200942373e-03 - 7.42492384580e-03 6.86170422323e-03 6.67761981445e-03 6.86170422323e-03 7.42492384580e-03 8.40200942373e-03 - 9.85294674885e-03 1.18598583649e-02 1.45226393383e-02 1.79555609317e-02 2.22755921268e-02 2.75721078901e-02 - 3.38635928392e-02 4.10571769449e-02 4.89192305177e-02 5.70612480291e-02 6.49555724266e-02 7.19923628057e-02 - 7.75631573239e-02 8.11458755837e-02 8.23828782457e-02 8.11458755837e-02 7.75631573239e-02 7.19923628057e-02 - 5.18034033720e-02 4.40291518527e-02 3.66568505349e-02 3.00149219248e-02 2.42781130820e-02 1.94921954522e-02 - 1.56112881223e-02 1.25396406703e-02 1.01663421573e-02 8.38500711079e-03 7.10160482063e-03 6.23916674188e-03 - 5.74257125314e-03 5.58034633768e-03 5.74257125314e-03 6.23916674188e-03 7.10160482063e-03 8.38500711079e-03 - 1.01663421573e-02 1.25396406703e-02 1.56112881223e-02 1.94921954522e-02 2.42781130820e-02 3.00149219248e-02 - 3.66568505349e-02 4.40291518527e-02 5.18034033720e-02 5.94941697642e-02 6.64898780493e-02 7.21264918488e-02 - 7.57970302390e-02 7.70723261920e-02 7.57970302390e-02 7.21264918488e-02 6.64898780493e-02 5.94941697642e-02 - 4.40291518527e-02 3.70689589239e-02 3.06330408871e-02 2.49511167951e-02 2.01220876747e-02 1.61434902729e-02 - 1.29494247541e-02 1.04460621935e-02 8.53524112695e-03 7.12561826537e-03 6.13840739734e-03 5.51272438194e-03 - 5.20914423543e-03 5.20914423543e-03 5.51272438194e-03 6.13840739734e-03 7.12561826537e-03 8.53524112695e-03 - 1.04460621935e-02 1.29494247541e-02 1.61434902729e-02 2.01220876747e-02 2.49511167951e-02 3.06330408871e-02 - 3.70689589239e-02 4.40291518527e-02 5.11403130173e-02 5.78981879671e-02 6.37149803432e-02 6.80033074139e-02 - 7.02831021338e-02 7.02831021338e-02 6.80033074139e-02 6.37149803432e-02 5.78981879671e-02 5.11403130173e-02 - 3.66568505349e-02 3.06330408871e-02 2.51823253991e-02 2.04512222766e-02 1.64818809732e-02 1.32437842255e-02 - 1.06671499136e-02 8.66817035987e-03 7.16308508658e-03 6.07562992209e-03 5.34296096392e-03 4.92029966810e-03 - 4.78210810048e-03 4.92029966810e-03 5.34296096392e-03 6.07562992209e-03 7.16308508658e-03 8.66817035987e-03 - 1.06671499136e-02 1.32437842255e-02 1.64818809732e-02 2.04512222766e-02 2.51823253991e-02 3.06330408871e-02 - 3.66568505349e-02 4.29832635915e-02 4.92182336225e-02 5.48714786192e-02 5.94150808572e-02 6.23688231248e-02 - 6.33941825467e-02 6.23688231248e-02 5.94150808572e-02 5.48714786192e-02 4.92182336225e-02 4.29832635915e-02 - 3.00149219248e-02 2.49511167951e-02 2.04512222766e-02 1.65980023724e-02 1.33976732300e-02 1.08088949298e-02 - 8.76725594498e-03 7.20097316500e-03 6.04016501968e-03 5.22371135458e-03 4.70458873539e-03 4.45230019628e-03 - 4.45230019628e-03 4.70458873539e-03 5.22371135458e-03 6.04016501968e-03 7.20097316500e-03 8.76725594498e-03 - 1.08088949298e-02 1.33976732300e-02 1.65980023724e-02 2.04512222766e-02 2.49511167951e-02 3.00149219248e-02 - 3.54595415232e-02 4.09927131873e-02 4.62258246981e-02 5.07121410456e-02 5.40097122002e-02 5.57595749637e-02 - 5.57595749637e-02 5.40097122002e-02 5.07121410456e-02 4.62258246981e-02 4.09927131873e-02 3.54595415232e-02 - 2.42781130820e-02 2.01220876747e-02 1.64818809732e-02 1.33976732300e-02 1.08577130860e-02 8.82009872524e-03 - 7.22847713667e-03 6.02253909249e-03 5.14599535674e-03 4.55262020357e-03 4.20942844716e-03 4.09713024865e-03 - 4.20942844716e-03 4.55262020357e-03 5.14599535674e-03 6.02253909249e-03 7.22847713667e-03 8.82009872524e-03 - 1.08577130860e-02 1.33976732300e-02 1.64818809732e-02 2.01220876747e-02 2.42781130820e-02 2.88348357920e-02 - 3.35871770820e-02 3.82415861113e-02 4.24386109393e-02 4.57968161948e-02 4.79731106469e-02 4.87273692032e-02 - 4.79731106469e-02 4.57968161948e-02 4.24386109393e-02 3.82415861113e-02 3.35871770820e-02 2.88348357920e-02 - 1.94921954522e-02 1.61434902729e-02 1.32437842255e-02 1.08088949298e-02 8.82009872524e-03 7.23847314555e-03 - 6.01563766373e-03 5.10253249618e-03 4.45623663297e-03 4.04374575730e-03 3.84302280796e-03 3.84302280796e-03 - 4.04374575730e-03 4.45623663297e-03 5.10253249618e-03 6.01563766373e-03 7.23847314555e-03 8.82009872524e-03 - 1.08088949298e-02 1.32437842255e-02 1.61434902729e-02 1.94921954522e-02 2.32217587400e-02 2.71955666447e-02 - 3.12022017908e-02 3.49654910486e-02 3.81729635435e-02 4.05199675384e-02 4.17618689283e-02 4.17618689283e-02 - 4.05199675384e-02 3.81729635435e-02 3.49654910486e-02 3.12022017908e-02 2.71955666447e-02 2.32217587400e-02 - 1.56112881223e-02 1.29494247541e-02 1.06671499136e-02 8.76725594498e-03 7.22847713667e-03 6.01563766373e-03 - 5.08859106656e-03 4.40955813989e-03 3.94752033538e-03 3.67971968314e-03 3.59206217435e-03 3.67971968314e-03 - 3.94752033538e-03 4.40955813989e-03 5.08859106656e-03 6.01563766373e-03 7.22847713667e-03 8.76725594498e-03 - 1.06671499136e-02 1.29494247541e-02 1.56112881223e-02 1.86137801375e-02 2.18687619531e-02 2.52298202509e-02 - 2.84935612207e-02 3.14154606035e-02 3.37399765679e-02 3.52402742752e-02 3.57591480990e-02 3.52402742752e-02 - 3.37399765679e-02 3.14154606035e-02 2.84935612207e-02 2.52298202509e-02 2.18687619531e-02 1.86137801375e-02 - 1.25396406703e-02 1.04460621935e-02 8.66817035987e-03 7.20097316500e-03 6.02253909249e-03 5.10253249618e-03 - 4.40955813989e-03 3.91597292758e-03 3.59990872378e-03 3.44594928533e-03 3.44594928533e-03 3.59990872378e-03 - 3.91597292758e-03 4.40955813989e-03 5.10253249618e-03 6.02253909249e-03 7.20097316500e-03 8.66817035987e-03 - 1.04460621935e-02 1.25396406703e-02 1.49279448733e-02 1.75547637226e-02 2.03206914317e-02 2.30804654510e-02 - 2.56499234494e-02 2.78244998346e-02 2.94074293899e-02 3.02423286704e-02 3.02423286704e-02 2.94074293899e-02 - 2.78244998346e-02 2.56499234494e-02 2.30804654510e-02 2.03206914317e-02 1.75547637226e-02 1.49279448733e-02 - 1.01663421573e-02 8.53524112695e-03 7.16308508658e-03 6.04016501968e-03 5.14599535674e-03 4.45623663297e-03 - 3.94752033538e-03 3.59990872378e-03 3.39799742507e-03 3.33184951460e-03 3.39799742507e-03 3.59990872378e-03 - 3.94752033538e-03 4.45623663297e-03 5.14599535674e-03 6.04016501968e-03 7.16308508658e-03 8.53524112695e-03 - 1.01663421573e-02 1.20475550421e-02 1.41440793855e-02 1.63890080671e-02 1.86800926235e-02 2.08820531014e-02 - 2.28368095394e-02 2.43819637041e-02 2.53749373622e-02 2.57176061925e-02 2.53749373622e-02 2.43819637041e-02 - 2.28368095394e-02 2.08820531014e-02 1.86800926235e-02 1.63890080671e-02 1.41440793855e-02 1.20475550421e-02 - 8.38500711079e-03 7.12561826537e-03 6.07562992209e-03 5.22371135458e-03 4.55262020357e-03 4.04374575730e-03 - 3.67971968314e-03 3.44594928533e-03 3.33184951460e-03 3.33184951460e-03 3.44594928533e-03 3.67971968314e-03 - 4.04374575730e-03 4.55262020357e-03 5.22371135458e-03 6.07562992209e-03 7.12561826537e-03 8.38500711079e-03 - 9.85294674885e-03 1.15097880648e-02 1.33116675302e-02 1.51874137660e-02 1.70389543521e-02 1.87467470027e-02 - 2.01812628043e-02 2.12198093897e-02 2.17657781241e-02 2.17657781241e-02 2.12198093897e-02 2.01812628043e-02 - 1.87467470027e-02 1.70389543521e-02 1.51874137660e-02 1.33116675302e-02 1.15097880648e-02 9.85294674885e-03 - 7.10160482063e-03 6.13840739734e-03 5.34296096392e-03 4.70458873539e-03 4.20942844716e-03 3.84302280796e-03 - 3.59206217435e-03 3.44594928533e-03 3.39799742507e-03 3.44594928533e-03 3.59206217435e-03 3.84302280796e-03 - 4.20942844716e-03 4.70458873539e-03 5.34296096392e-03 6.13840739734e-03 7.10160482063e-03 8.23585736203e-03 - 9.53173661310e-03 1.09620544703e-02 1.24785638223e-02 1.40112393540e-02 1.54709928045e-02 1.67567114426e-02 - 1.77666865554e-02 1.84129279741e-02 1.86354478304e-02 1.84129279741e-02 1.77666865554e-02 1.67567114426e-02 - 1.54709928045e-02 1.40112393540e-02 1.24785638223e-02 1.09620544703e-02 9.53173661310e-03 8.23585736203e-03 - 6.23916674188e-03 5.51272438194e-03 4.92029966810e-03 4.45230019628e-03 4.09713024865e-03 3.84302280796e-03 - 3.67971968314e-03 3.59990872378e-03 3.59990872378e-03 3.67971968314e-03 3.84302280796e-03 4.09713024865e-03 - 4.45230019628e-03 4.92029966810e-03 5.51272438194e-03 6.23916674188e-03 7.10459522193e-03 8.10563303358e-03 - 9.22648243576e-03 1.04356792319e-02 1.16845233837e-02 1.29079014387e-02 1.40283418589e-02 1.49636867906e-02 - 1.56375665721e-02 1.59907282434e-02 1.59907282434e-02 1.56375665721e-02 1.49636867906e-02 1.40283418589e-02 - 1.29079014387e-02 1.16845233837e-02 1.04356792319e-02 9.22648243576e-03 8.10563303358e-03 7.10459522193e-03 - 5.74257125314e-03 5.20914423543e-03 4.78210810048e-03 4.45230019628e-03 4.20942844716e-03 4.04374575730e-03 - 3.94752033538e-03 3.91597292758e-03 3.94752033538e-03 4.04374575730e-03 4.20942844716e-03 4.45230019628e-03 - 4.78210810048e-03 5.20914423543e-03 5.74257125314e-03 6.38840491477e-03 7.14689010595e-03 8.00955236461e-03 - 8.95658363692e-03 9.95507847617e-03 1.09586567104e-02 1.19093466628e-02 1.27424344623e-02 1.33939588194e-02 - 1.38094745262e-02 1.39522993746e-02 1.38094745262e-02 1.33939588194e-02 1.27424344623e-02 1.19093466628e-02 - 1.09586567104e-02 9.95507847617e-03 8.95658363692e-03 8.00955236461e-03 7.14689010595e-03 6.38840491477e-03 - 5.58034633768e-03 5.20914423543e-03 4.92029966810e-03 4.70458873539e-03 4.55262020357e-03 4.45623663297e-03 - 4.40955813989e-03 4.40955813989e-03 4.45623663297e-03 4.55262020357e-03 4.70458873539e-03 4.92029966810e-03 - 5.20914423543e-03 5.58034633768e-03 6.04118457084e-03 6.59479473082e-03 7.23785699764e-03 7.95863052826e-03 - 8.73551184506e-03 9.53627070961e-03 1.03186231402e-02 1.10330000246e-02 1.16276251073e-02 1.20550163598e-02 - 1.22786655737e-02 1.22786655737e-02 1.20550163598e-02 1.16276251073e-02 1.10330000246e-02 1.03186231402e-02 - 9.53627070961e-03 8.73551184506e-03 7.95863052826e-03 7.23785699764e-03 6.59479473082e-03 6.04118457084e-03 - 5.74257125314e-03 5.51272438194e-03 5.34296096392e-03 5.22371135458e-03 5.14599535674e-03 5.10253249618e-03 - 5.08859106656e-03 5.10253249618e-03 5.14599535674e-03 5.22371135458e-03 5.34296096392e-03 5.51272438194e-03 - 5.74257125314e-03 6.04118457084e-03 6.41444748147e-03 6.86339437793e-03 7.38252390656e-03 7.95863052826e-03 - 8.57007132232e-03 9.18679124184e-03 9.77183223433e-03 1.02846446979e-02 1.06856809758e-02 1.09414577715e-02 - 1.10293847869e-02 1.09414577715e-02 1.06856809758e-02 1.02846446979e-02 9.77183223433e-03 9.18679124184e-03 - 8.57007132232e-03 7.95863052826e-03 7.38252390656e-03 6.86339437793e-03 6.41444748147e-03 6.04118457084e-03 - 6.23916674188e-03 6.13840739734e-03 6.07562992209e-03 6.04016501968e-03 6.02253909249e-03 6.01563766373e-03 - 6.01563766373e-03 6.02253909249e-03 6.04016501968e-03 6.07562992209e-03 6.13840739734e-03 6.23916674188e-03 - 6.38840491477e-03 6.59479473082e-03 6.86339437793e-03 7.19410390186e-03 7.58058258839e-03 8.00955236461e-03 - 8.46060891145e-03 8.90705726329e-03 9.31810768724e-03 9.66211927865e-03 9.91029781221e-03 1.00404664762e-02 - 1.00404664762e-02 9.91029781221e-03 9.66211927865e-03 9.31810768724e-03 8.90705726329e-03 8.46060891145e-03 - 8.00955236461e-03 7.58058258839e-03 7.19410390186e-03 6.86339437793e-03 6.59479473082e-03 6.38840491477e-03 - 7.10160482063e-03 7.12561826537e-03 7.16308508658e-03 7.20097316500e-03 7.22847713667e-03 7.23847314555e-03 - 7.22847713667e-03 7.20097316500e-03 7.16308508658e-03 7.12561826537e-03 7.10160482063e-03 7.10459522193e-03 - 7.14689010595e-03 7.23785699764e-03 7.38252390656e-03 7.58058258839e-03 7.82576853226e-03 8.10563303358e-03 - 8.40200942373e-03 8.69246386814e-03 8.95261635749e-03 9.15892896774e-03 9.29162040305e-03 9.33741418467e-03 - 9.29162040305e-03 9.15892896774e-03 8.95261635749e-03 8.69246386814e-03 8.40200942373e-03 8.10563303358e-03 - 7.82576853226e-03 7.58058258839e-03 7.38252390656e-03 7.23785699764e-03 7.14689010595e-03 7.10459522193e-03 - 8.38500711079e-03 8.53524112695e-03 8.66817035987e-03 8.76725594498e-03 8.82009872524e-03 8.82009872524e-03 - 8.76725594498e-03 8.66817035987e-03 8.53524112695e-03 8.38500711079e-03 8.23585736203e-03 8.10563303358e-03 - 8.00955236461e-03 7.95863052826e-03 7.95863052826e-03 8.00955236461e-03 8.10563303358e-03 8.23585736203e-03 - 8.38500711079e-03 8.53524112695e-03 8.66817035987e-03 8.76725594498e-03 8.82009872524e-03 8.82009872524e-03 - 8.76725594498e-03 8.66817035987e-03 8.53524112695e-03 8.38500711079e-03 8.23585736203e-03 8.10563303358e-03 - 8.00955236461e-03 7.95863052826e-03 7.95863052827e-03 8.00955236461e-03 8.10563303358e-03 8.23585736203e-03 - 1.01663421573e-02 1.04460621935e-02 1.06671499136e-02 1.08088949298e-02 1.08577130860e-02 1.08088949298e-02 - 1.06671499136e-02 1.04460621935e-02 1.01663421573e-02 9.85294674885e-03 9.53173661310e-03 9.22648243576e-03 - 8.95658363692e-03 8.73551184506e-03 8.57007132232e-03 8.46060891145e-03 8.40200942373e-03 8.38500711079e-03 - 8.39746782805e-03 8.42580807925e-03 8.45686847188e-03 8.47998103933e-03 8.48843476768e-03 8.47998103933e-03 - 8.45686847188e-03 8.42580807925e-03 8.39746782805e-03 8.38500711079e-03 8.40200942373e-03 8.46060891145e-03 - 8.57007132232e-03 8.73551184506e-03 8.95658363692e-03 9.22648243576e-03 9.53173661310e-03 9.85294674885e-03 - 1.25396406703e-02 1.29494247541e-02 1.32437842255e-02 1.33976732300e-02 1.33976732300e-02 1.32437842255e-02 - 1.29494247541e-02 1.25396406703e-02 1.20475550421e-02 1.15097880648e-02 1.09620544703e-02 1.04356792319e-02 - 9.95507847617e-03 9.53627070961e-03 9.18679124184e-03 8.90705726329e-03 8.69246386814e-03 8.53524112695e-03 - 8.42580807925e-03 8.35413904759e-03 8.31144312544e-03 8.29158854156e-03 8.29158854156e-03 8.31144312544e-03 - 8.35413904759e-03 8.42580807925e-03 8.53524112695e-03 8.69246386814e-03 8.90705726329e-03 9.18679124184e-03 - 9.53627070961e-03 9.95507847617e-03 1.04356792319e-02 1.09620544703e-02 1.15097880648e-02 1.20475550421e-02 - 1.56112881223e-02 1.61434902729e-02 1.64818809732e-02 1.65980023724e-02 1.64818809732e-02 1.61434902729e-02 - 1.56112881223e-02 1.49279448733e-02 1.41440793855e-02 1.33116675302e-02 1.24785638223e-02 1.16845233837e-02 - 1.09586567104e-02 1.03186231402e-02 9.77183223433e-03 9.31810768724e-03 8.95261635749e-03 8.66817035987e-03 - 8.45686847188e-03 8.31144312544e-03 8.22635918544e-03 8.19834740781e-03 8.22635918544e-03 8.31144312544e-03 - 8.45686847188e-03 8.66817035987e-03 8.95261635749e-03 9.31810768724e-03 9.77183223433e-03 1.03186231402e-02 - 1.09586567104e-02 1.16845233837e-02 1.24785638223e-02 1.33116675302e-02 1.41440793855e-02 1.49279448733e-02 - 1.94921954522e-02 2.01220876747e-02 2.04512222766e-02 2.04512222766e-02 2.01220876747e-02 1.94921954522e-02 - 1.86137801375e-02 1.75547637226e-02 1.63890080671e-02 1.51874137660e-02 1.40112393540e-02 1.29079014387e-02 - 1.19093466628e-02 1.10330000246e-02 1.02846446979e-02 9.66211927865e-03 9.15892896774e-03 8.76725594498e-03 - 8.47998103933e-03 8.29158854156e-03 8.19834740781e-03 8.19834740781e-03 8.29158854156e-03 8.47998103933e-03 - 8.76725594498e-03 9.15892896774e-03 9.66211927865e-03 1.02846446979e-02 1.10330000246e-02 1.19093466628e-02 - 1.29079014387e-02 1.40112393540e-02 1.51874137660e-02 1.63890080671e-02 1.75547637226e-02 1.86137801375e-02 - 2.42781130820e-02 2.49511167951e-02 2.51823253991e-02 2.49511167951e-02 2.42781130820e-02 2.32217587400e-02 - 2.18687619531e-02 2.03206914317e-02 1.86800926235e-02 1.70389543521e-02 1.54709928045e-02 1.40283418589e-02 - 1.27424344623e-02 1.16276251073e-02 1.06856809758e-02 9.91029781221e-03 9.29162040305e-03 8.82009872524e-03 - 8.48843476768e-03 8.29158854156e-03 8.22635918544e-03 8.29158854156e-03 8.48843476768e-03 8.82009872524e-03 - 9.29162040305e-03 9.91029781221e-03 1.06856809758e-02 1.16276251073e-02 1.27424344623e-02 1.40283418589e-02 - 1.54709928045e-02 1.70389543521e-02 1.86800926235e-02 2.03206914317e-02 2.18687619531e-02 2.32217587400e-02 - 3.00149219248e-02 3.06330408871e-02 3.06330408871e-02 3.00149219248e-02 2.88348357920e-02 2.71955666447e-02 - 2.52298202509e-02 2.30804654510e-02 2.08820531014e-02 1.87467470027e-02 1.67567114426e-02 1.49636867906e-02 - 1.33939588194e-02 1.20550163598e-02 1.09414577715e-02 1.00404664762e-02 9.33741418467e-03 8.82009872524e-03 - 8.47998103933e-03 8.31144312544e-03 8.31144312544e-03 8.47998103933e-03 8.82009872524e-03 9.33741418467e-03 - 1.00404664762e-02 1.09414577715e-02 1.20550163598e-02 1.33939588194e-02 1.49636867906e-02 1.67567114426e-02 - 1.87467470027e-02 2.08820531014e-02 2.30804654510e-02 2.52298202509e-02 2.71955666447e-02 2.88348357920e-02 - 3.66568505349e-02 3.70689589239e-02 3.66568505349e-02 3.54595415232e-02 3.35871770820e-02 3.12022017908e-02 - 2.84935612207e-02 2.56499234494e-02 2.28368095394e-02 2.01812628043e-02 1.77666865554e-02 1.56375665721e-02 - 1.38094745262e-02 1.22786655737e-02 1.10293847869e-02 1.00404664762e-02 9.29162040305e-03 8.76725594498e-03 - 8.45686847188e-03 8.35413904759e-03 8.45686847188e-03 8.76725594498e-03 9.29162040305e-03 1.00404664762e-02 - 1.10293847869e-02 1.22786655737e-02 1.38094745262e-02 1.56375665721e-02 1.77666865554e-02 2.01812628043e-02 - 2.28368095394e-02 2.56499234494e-02 2.84935612207e-02 3.12022017908e-02 3.35871770820e-02 3.54595415232e-02 - 4.40291518527e-02 4.40291518527e-02 4.29832635915e-02 4.09927131873e-02 3.82415861113e-02 3.49654910486e-02 - 3.14154606035e-02 2.78244998346e-02 2.43819637041e-02 2.12198093897e-02 1.84129279741e-02 1.59907282434e-02 - 1.39522993746e-02 1.22786655737e-02 1.09414577715e-02 9.91029781221e-03 9.15892896774e-03 8.66817035987e-03 - 8.42580807925e-03 8.42580807925e-03 8.66817035987e-03 9.15892896774e-03 9.91029781221e-03 1.09414577715e-02 - 1.22786655737e-02 1.39522993746e-02 1.59907282434e-02 1.84129279741e-02 2.12198093897e-02 2.43819637041e-02 - 2.78244998346e-02 3.14154606035e-02 3.49654910486e-02 3.82415861113e-02 4.09927131873e-02 4.29832635915e-02 - 5.18034033720e-02 5.11403130173e-02 4.92182336225e-02 4.62258246981e-02 4.24386109393e-02 3.81729635435e-02 - 3.37399765679e-02 2.94074293899e-02 2.53749373622e-02 2.17657781241e-02 1.86354478304e-02 1.59907282434e-02 - 1.38094745262e-02 1.20550163598e-02 1.06856809758e-02 9.66211927865e-03 8.95261635749e-03 8.53524112695e-03 - 8.39746782805e-03 8.53524112695e-03 8.95261635749e-03 9.66211927865e-03 1.06856809758e-02 1.20550163598e-02 - 1.38094745262e-02 1.59907282434e-02 1.86354478304e-02 2.17657781241e-02 2.53749373622e-02 2.94074293899e-02 - 3.37399765679e-02 3.81729635435e-02 4.24386109393e-02 4.62258246981e-02 4.92182336225e-02 5.11403130173e-02 - 5.94941697642e-02 5.78981879671e-02 5.48714786192e-02 5.07121410456e-02 4.57968161948e-02 4.05199675384e-02 - 3.52402742752e-02 3.02423286704e-02 2.57176061925e-02 2.17657781241e-02 1.84129279741e-02 1.56375665721e-02 - 1.33939588194e-02 1.16276251073e-02 1.02846446979e-02 9.31810768724e-03 8.69246386814e-03 8.38500711079e-03 - 8.38500711079e-03 8.69246386814e-03 9.31810768724e-03 1.02846446979e-02 1.16276251073e-02 1.33939588194e-02 - 1.56375665721e-02 1.84129279741e-02 2.17657781241e-02 2.57176061925e-02 3.02423286704e-02 3.52402742752e-02 - 4.05199675384e-02 4.57968161948e-02 5.07121410456e-02 5.48714786192e-02 5.78981879671e-02 5.94941697642e-02 - 6.64898780493e-02 6.37149803432e-02 5.94150808572e-02 5.40097122002e-02 4.79731106469e-02 4.17618689283e-02 - 3.57591480990e-02 3.02423286704e-02 2.53749373622e-02 2.12198093897e-02 1.77666865554e-02 1.49636867906e-02 - 1.27424344623e-02 1.10330000246e-02 9.77183223433e-03 8.90705726329e-03 8.40200942373e-03 8.23585736203e-03 - 8.40200942373e-03 8.90705726329e-03 9.77183223433e-03 1.10330000246e-02 1.27424344623e-02 1.49636867906e-02 - 1.77666865554e-02 2.12198093897e-02 2.53749373622e-02 3.02423286704e-02 3.57591480990e-02 4.17618689283e-02 - 4.79731106469e-02 5.40097122002e-02 5.94150808572e-02 6.37149803432e-02 6.64898780493e-02 6.74494907981e-02 - 7.21264918488e-02 6.80033074139e-02 6.23688231248e-02 5.57595749637e-02 4.87273692032e-02 4.17618689283e-02 - 3.52402742752e-02 2.94074293899e-02 2.43819637041e-02 2.01812628043e-02 1.67567114426e-02 1.40283418589e-02 - 1.19093466628e-02 1.03186231402e-02 9.18679124184e-03 8.46060891145e-03 8.10563303358e-03 8.10563303358e-03 - 8.46060891145e-03 9.18679124184e-03 1.03186231402e-02 1.19093466628e-02 1.40283418589e-02 1.67567114426e-02 - 2.01812628043e-02 2.43819637041e-02 2.94074293899e-02 3.52402742752e-02 4.17618689283e-02 4.87273692032e-02 - 5.57595749637e-02 6.23688231248e-02 6.80033074139e-02 7.21264918488e-02 7.43082663472e-02 7.43082663472e-02 - 7.57970302390e-02 7.02831021338e-02 6.33941825467e-02 5.57595749637e-02 4.79731106469e-02 4.05199675384e-02 - 3.37399765679e-02 2.78244998346e-02 2.28368095394e-02 1.87467470027e-02 1.54709928045e-02 1.29079014387e-02 - 1.09586567104e-02 9.53627070961e-03 8.57007132232e-03 8.00955236461e-03 7.82576853226e-03 8.00955236461e-03 - 8.57007132232e-03 9.53627070961e-03 1.09586567104e-02 1.29079014387e-02 1.54709928045e-02 1.87467470027e-02 - 2.28368095394e-02 2.78244998346e-02 3.37399765679e-02 4.05199675384e-02 4.79731106469e-02 5.57595749637e-02 - 6.33941825467e-02 7.02831021338e-02 7.57970302390e-02 7.93709590427e-02 8.06097207709e-02 7.93709590427e-02 - 7.70723261920e-02 7.02831021338e-02 6.23688231248e-02 5.40097122002e-02 4.57968161948e-02 3.81729635435e-02 - 3.14154606035e-02 2.56499234494e-02 2.08820531014e-02 1.70389543521e-02 1.40112393540e-02 1.16845233837e-02 - 9.95507847617e-03 8.73551184506e-03 7.95863052826e-03 7.58058258839e-03 7.58058258839e-03 7.95863052826e-03 - 8.73551184506e-03 9.95507847617e-03 1.16845233837e-02 1.40112393540e-02 1.70389543521e-02 2.08820531014e-02 - 2.56499234494e-02 3.14154606035e-02 3.81729635435e-02 4.57968161948e-02 5.40097122002e-02 6.23688231248e-02 - 7.02831021338e-02 7.70723261920e-02 8.20645507484e-02 8.47143937707e-02 8.47143937707e-02 8.20645507484e-02 - 7.57970302390e-02 6.80033074139e-02 5.94150808572e-02 5.07121410456e-02 4.24386109393e-02 3.49654910486e-02 - 2.84935612207e-02 2.30804654510e-02 1.86800926235e-02 1.51874137660e-02 1.24785638223e-02 1.04356792319e-02 - 8.95658363692e-03 7.95863052826e-03 7.38252390656e-03 7.19410390186e-03 7.38252390656e-03 7.95863052826e-03 - 8.95658363692e-03 1.04356792319e-02 1.24785638223e-02 1.51874137660e-02 1.86800926235e-02 2.30804654510e-02 - 2.84935612207e-02 3.49654910486e-02 4.24386109393e-02 5.07121410456e-02 5.94150808572e-02 6.80033074139e-02 - 7.57970302390e-02 8.20645507484e-02 8.61408122915e-02 8.75562567048e-02 8.61408122915e-02 8.20645507484e-02 - 7.21264918488e-02 6.37149803432e-02 5.48714786192e-02 4.62258246981e-02 3.82415861113e-02 3.12022017908e-02 - 2.52298202509e-02 2.03206914317e-02 1.63890080671e-02 1.33116675302e-02 1.09620544703e-02 9.22648243576e-03 - 8.00955236461e-03 7.23785699764e-03 6.86339437793e-03 6.86339437793e-03 7.23785699764e-03 8.00955236461e-03 - 9.22648243576e-03 1.09620544703e-02 1.33116675302e-02 1.63890080671e-02 2.03206914317e-02 2.52298202509e-02 - 3.12022017908e-02 3.82415861113e-02 4.62258246981e-02 5.48714786192e-02 6.37149803432e-02 7.21264918488e-02 - 7.93709590427e-02 8.47143937707e-02 8.75562567048e-02 8.75562567048e-02 8.47143937707e-02 7.93709590427e-02 - 6.64898780493e-02 5.78981879671e-02 4.92182336225e-02 4.09927131873e-02 3.35871770820e-02 2.71955666447e-02 - 2.18687619531e-02 1.75547637226e-02 1.41440793855e-02 1.15097880648e-02 9.53173661310e-03 8.10563303358e-03 - 7.14689010595e-03 6.59479473082e-03 6.41444748147e-03 6.59479473082e-03 7.14689010595e-03 8.10563303358e-03 - 9.53173661310e-03 1.15097880648e-02 1.41440793855e-02 1.75547637226e-02 2.18687619531e-02 2.71955666447e-02 - 3.35871770820e-02 4.09927131873e-02 4.92182336225e-02 5.78981879671e-02 6.64898780493e-02 7.43082663472e-02 - 8.06097207709e-02 8.47143937707e-02 8.61408122915e-02 8.47143937707e-02 8.06097207709e-02 7.43082663472e-02 - 5.94941697642e-02 5.11403130173e-02 4.29832635915e-02 3.54595415232e-02 2.88348357920e-02 2.32217587400e-02 - 1.86137801375e-02 1.49279448733e-02 1.20475550421e-02 9.85294674885e-03 8.23585736203e-03 7.10459522193e-03 - 6.38840491477e-03 6.04118457084e-03 6.04118457084e-03 6.38840491477e-03 7.10459522193e-03 8.23585736203e-03 - 9.85294674885e-03 1.20475550421e-02 1.49279448733e-02 1.86137801375e-02 2.32217587400e-02 2.88348357920e-02 - 3.54595415232e-02 4.29832635915e-02 5.11403130173e-02 5.94941697642e-02 6.74494907981e-02 7.43082663472e-02 - 7.93709590427e-02 8.20645507484e-02 8.20645507484e-02 7.93709590427e-02 7.43082663472e-02 6.74494907981e-02 - 4.57409612273e-02 3.83718132369e-02 3.16041856284e-02 2.56657154446e-02 2.06439962171e-02 1.65234811342e-02 - 1.32272933414e-02 1.06524671204e-02 8.69246386814e-03 7.24904282964e-03 6.23916674188e-03 5.59978938003e-03 - 5.28994524639e-03 5.28994524639e-03 5.59978938003e-03 6.23916674188e-03 7.24904282964e-03 8.69246386814e-03 - 1.06524671204e-02 1.32272933414e-02 1.65234811342e-02 2.06439962171e-02 2.56657154446e-02 3.16041856284e-02 - 3.83718132369e-02 4.57409612273e-02 5.33236907840e-02 6.05796981280e-02 6.68641206041e-02 7.15201290633e-02 - 7.40032629540e-02 7.40032629540e-02 7.15201290633e-02 6.68641206041e-02 6.05796981280e-02 5.33236907840e-02 - 3.83718132369e-02 3.19731919657e-02 2.62153172241e-02 2.12413612776e-02 1.70848695603e-02 1.37059602390e-02 - 1.10259974674e-02 8.95261635749e-03 7.39443450458e-03 6.26978037715e-03 5.51272438194e-03 5.07652462266e-03 - 4.93405372394e-03 5.07652462266e-03 5.51272438194e-03 6.26978037715e-03 7.39443450458e-03 8.95261635749e-03 - 1.10259974674e-02 1.37059602390e-02 1.70848695603e-02 2.12413612776e-02 2.62153172241e-02 3.19731919657e-02 - 3.83718132369e-02 4.51323632879e-02 5.18355302331e-02 5.79474348197e-02 6.28828729732e-02 6.61022866145e-02 - 6.72218662363e-02 6.61022866145e-02 6.28828729732e-02 5.79474348197e-02 5.18355302331e-02 4.51323632879e-02 - 3.16041856284e-02 2.62153172241e-02 2.14468462049e-02 1.73786828448e-02 1.40109856905e-02 1.12951380995e-02 - 9.15892896774e-03 7.52314503521e-03 6.31209415558e-03 5.46093720174e-03 4.92029966810e-03 4.65785937656e-03 - 4.65785937656e-03 4.92029966810e-03 5.46093720174e-03 6.31209415558e-03 7.52314503521e-03 9.15892896774e-03 - 1.12951380995e-02 1.40109856905e-02 1.73786828448e-02 2.14468462049e-02 2.62153172241e-02 3.16041856284e-02 - 3.74259862301e-02 4.33721592307e-02 4.90231496620e-02 5.38883507401e-02 5.74762428735e-02 5.93841418824e-02 - 5.93841418824e-02 5.74762428735e-02 5.38883507401e-02 4.90231496620e-02 4.33721592307e-02 3.74259862301e-02 - 2.56657154446e-02 2.12413612776e-02 1.73786828448e-02 1.41157952825e-02 1.14361707830e-02 9.29162040305e-03 - 7.61927184895e-03 6.35335851926e-03 5.43377044817e-03 4.81172327806e-03 4.45230019628e-03 4.33477840900e-03 - 4.45230019628e-03 4.81172327806e-03 5.43377044817e-03 6.35335851926e-03 7.61927184895e-03 9.29162040305e-03 - 1.14361707830e-02 1.41157952825e-02 1.73786828448e-02 2.12413612776e-02 2.56657154446e-02 3.05340710560e-02 - 3.56312088557e-02 4.06430475235e-02 4.51788789706e-02 4.88190878681e-02 5.11831265828e-02 5.20033431247e-02 - 5.11831265828e-02 4.88190878681e-02 4.51788789706e-02 4.06430475235e-02 3.56312088557e-02 3.05340710560e-02 - 2.06439962171e-02 1.70848695603e-02 1.40109856905e-02 1.14361707830e-02 9.33741418467e-03 7.67065297497e-03 - 6.38291972351e-03 5.42174879265e-03 4.74176747355e-03 4.30805835198e-03 4.09713024865e-03 4.09713024865e-03 - 4.30805835198e-03 4.74176747355e-03 5.42174879265e-03 6.38291972351e-03 7.67065297497e-03 9.33741418467e-03 - 1.14361707830e-02 1.40109856905e-02 1.70848695603e-02 2.06439962171e-02 2.46187421852e-02 2.88661050079e-02 - 3.31615306069e-02 3.72078996967e-02 4.06654278454e-02 4.32002938784e-02 4.45431970579e-02 4.45431970579e-02 - 4.32002938784e-02 4.06654278454e-02 3.72078996967e-02 3.31615306069e-02 2.88661050079e-02 2.46187421852e-02 - 1.65234811342e-02 1.37059602390e-02 1.12951380995e-02 9.29162040305e-03 7.67065297497e-03 6.39361872594e-03 - 5.41768978229e-03 4.70304044562e-03 4.21692866215e-03 3.93522801758e-03 3.84302280796e-03 3.93522801758e-03 - 4.21692866215e-03 4.70304044562e-03 5.41768978229e-03 6.39361872594e-03 7.67065297497e-03 9.29162040305e-03 - 1.12951380995e-02 1.37059602390e-02 1.65234811342e-02 1.97084075068e-02 2.31688478126e-02 2.67502344749e-02 - 3.02357338101e-02 3.33624200108e-02 3.58537824974e-02 3.74634706166e-02 3.80204685260e-02 3.74634706166e-02 - 3.58537824974e-02 3.33624200108e-02 3.02357338101e-02 2.67502344749e-02 2.31688478126e-02 1.97084075068e-02 - 1.32272933414e-02 1.10259974674e-02 9.15892896774e-03 7.61927184895e-03 6.38291972351e-03 5.41768978229e-03 - 4.69069423954e-03 4.17292027232e-03 3.84131375804e-03 3.67971968314e-03 3.67971968314e-03 3.84131375804e-03 - 4.17292027232e-03 4.69069423954e-03 5.41768978229e-03 6.38291972351e-03 7.61927184895e-03 9.15892896774e-03 - 1.10259974674e-02 1.32272933414e-02 1.57423428102e-02 1.85132658939e-02 2.14361295219e-02 2.43576039836e-02 - 2.70818268649e-02 2.93901320501e-02 3.10717223250e-02 3.19590319446e-02 3.19590319446e-02 3.10717223250e-02 - 2.93901320501e-02 2.70818268649e-02 2.43576039836e-02 2.14361295219e-02 1.85132658939e-02 1.57423428102e-02 - 1.06524671204e-02 8.95261635749e-03 7.52314503521e-03 6.35335851926e-03 5.42174879265e-03 4.70304044562e-03 - 4.17292027232e-03 3.81054695208e-03 3.59990872378e-03 3.53085792774e-03 3.59990872378e-03 3.81054695208e-03 - 4.17292027232e-03 4.70304044562e-03 5.42174879265e-03 6.35335851926e-03 7.52314503521e-03 8.95261635749e-03 - 1.06524671204e-02 1.26143883181e-02 1.48031251671e-02 1.71497889118e-02 1.95479913088e-02 2.18557815330e-02 - 2.39063871143e-02 2.55281844546e-02 2.65706573512e-02 2.69304328597e-02 2.65706573512e-02 2.55281844546e-02 - 2.39063871143e-02 2.18557815330e-02 1.95479913088e-02 1.71497889118e-02 1.48031251671e-02 1.26143883181e-02 - 8.69246386814e-03 7.39443450458e-03 6.31209415558e-03 5.43377044817e-03 4.74176747355e-03 4.21692866215e-03 - 3.84131375804e-03 3.59990872378e-03 3.48198055848e-03 3.48198055848e-03 3.59990872378e-03 3.84131375804e-03 - 4.21692866215e-03 4.74176747355e-03 5.43377044817e-03 6.31209415558e-03 7.39443450458e-03 8.69246386814e-03 - 1.02054916185e-02 1.19137265332e-02 1.37726366090e-02 1.57094271493e-02 1.76229803621e-02 1.93892705934e-02 - 2.08735527936e-02 2.19482820950e-02 2.25132701769e-02 2.25132701769e-02 2.19482820950e-02 2.08735527936e-02 - 1.93892705934e-02 1.76229803621e-02 1.57094271493e-02 1.37726366090e-02 1.19137265332e-02 1.02054916185e-02 - 7.24904282964e-03 6.26978037715e-03 5.46093720174e-03 4.81172327806e-03 4.30805835198e-03 3.93522801758e-03 - 3.67971968314e-03 3.53085792774e-03 3.48198055848e-03 3.53085792774e-03 3.67971968314e-03 3.93522801758e-03 - 4.30805835198e-03 4.81172327806e-03 5.46093720174e-03 6.26978037715e-03 7.24904282964e-03 8.40200942373e-03 - 9.71912104775e-03 1.11729588764e-02 1.27148275869e-02 1.42737851127e-02 1.57591868798e-02 1.70678712692e-02 - 1.80960146721e-02 1.87538902948e-02 1.89804120902e-02 1.87538902948e-02 1.80960146721e-02 1.70678712692e-02 - 1.57591868798e-02 1.42737851127e-02 1.27148275869e-02 1.11729588764e-02 9.71912104775e-03 8.40200942373e-03 - 6.23916674188e-03 5.51272438194e-03 4.92029966810e-03 4.45230019628e-03 4.09713024865e-03 3.84302280796e-03 - 3.67971968314e-03 3.59990872378e-03 3.59990872378e-03 3.67971968314e-03 3.84302280796e-03 4.09713024865e-03 - 4.45230019628e-03 4.92029966810e-03 5.51272438194e-03 6.23916674188e-03 7.10459522193e-03 8.10563303358e-03 - 9.22648243576e-03 1.04356792319e-02 1.16845233837e-02 1.29079014387e-02 1.40283418589e-02 1.49636867906e-02 - 1.56375665721e-02 1.59907282434e-02 1.59907282434e-02 1.56375665721e-02 1.49636867906e-02 1.40283418589e-02 - 1.29079014387e-02 1.16845233837e-02 1.04356792319e-02 9.22648243576e-03 8.10563303358e-03 7.10459522193e-03 - 5.59978938003e-03 5.07652462266e-03 4.65785937656e-03 4.33477840900e-03 4.09713024865e-03 3.93522801758e-03 - 3.84131375804e-03 3.81054695208e-03 3.84131375804e-03 3.93522801758e-03 4.09713024865e-03 4.33477840900e-03 - 4.65785937656e-03 5.07652462266e-03 5.59978938003e-03 6.23361812745e-03 6.97836085285e-03 7.82576853226e-03 - 8.75631776595e-03 9.73748464183e-03 1.07235056315e-02 1.16573532374e-02 1.24755048074e-02 1.31152359900e-02 - 1.35231772103e-02 1.36633879542e-02 1.35231772103e-02 1.31152359900e-02 1.24755048074e-02 1.16573532374e-02 - 1.07235056315e-02 9.73748464183e-03 8.75631776595e-03 7.82576853226e-03 6.97836085285e-03 6.23361812745e-03 - 5.28994524639e-03 4.93405372394e-03 4.65785937656e-03 4.45230019628e-03 4.30805835198e-03 4.21692866215e-03 - 4.17292027232e-03 4.17292027232e-03 4.21692866215e-03 4.30805835198e-03 4.45230019628e-03 4.65785937656e-03 - 4.93405372394e-03 5.28994524639e-03 5.73268604942e-03 6.26545793635e-03 6.88519888788e-03 7.58058258839e-03 - 8.33057919998e-03 9.10381322670e-03 9.85925299562e-03 1.05489279259e-02 1.11228159589e-02 1.15351431719e-02 - 1.17508350709e-02 1.17508350709e-02 1.15351431719e-02 1.11228159589e-02 1.05489279259e-02 9.85925299562e-03 - 9.10381322670e-03 8.33057919998e-03 7.58058258839e-03 6.88519888788e-03 6.26545793635e-03 5.73268604942e-03 - 5.28994524639e-03 5.07652462266e-03 4.92029966810e-03 4.81172327806e-03 4.74176747355e-03 4.70304044562e-03 - 4.69069423954e-03 4.70304044562e-03 4.74176747355e-03 4.81172327806e-03 4.92029966810e-03 5.07652462266e-03 - 5.28994524639e-03 5.56920678348e-03 5.92021996667e-03 6.34416762186e-03 6.83583874198e-03 7.38252390656e-03 - 7.96341795569e-03 8.54973346172e-03 9.10613117226e-03 9.59384043225e-03 9.97511028176e-03 1.02181471415e-02 - 1.03016601350e-02 1.02181471415e-02 9.97511028176e-03 9.59384043225e-03 9.10613117226e-03 8.54973346172e-03 - 7.96341795569e-03 7.38252390656e-03 6.83583874198e-03 6.34416762186e-03 5.92021996667e-03 5.56920678348e-03 - 5.59978938003e-03 5.51272438194e-03 5.46093720174e-03 5.43377044817e-03 5.42174879265e-03 5.41768978229e-03 - 5.41768978229e-03 5.42174879265e-03 5.43377044817e-03 5.46093720174e-03 5.51272438194e-03 5.59978938003e-03 - 5.73268604942e-03 5.92021996667e-03 6.16759269815e-03 6.47483593539e-03 6.83583874198e-03 7.23785699764e-03 - 7.66146344666e-03 8.08133005705e-03 8.46823559623e-03 8.79214216133e-03 9.02578945364e-03 9.14830218340e-03 - 9.14830218340e-03 9.02578945364e-03 8.79214216133e-03 8.46823559623e-03 8.08133005705e-03 7.66146344666e-03 - 7.23785699764e-03 6.83583874198e-03 6.47483593539e-03 6.16759269815e-03 5.92021996667e-03 5.73268604942e-03 - 6.23916674188e-03 6.26978037715e-03 6.31209415558e-03 6.35335851926e-03 6.38291972351e-03 6.39361872594e-03 - 6.38291972351e-03 6.35335851926e-03 6.31209415558e-03 6.26978037715e-03 6.23916674188e-03 6.23361812745e-03 - 6.26545793635e-03 6.34416762186e-03 6.47483593539e-03 6.65719946009e-03 6.88519888788e-03 7.14689010595e-03 - 7.42492384580e-03 7.69793885145e-03 7.94279014126e-03 8.13716815266e-03 8.26229038338e-03 8.30549434438e-03 - 8.26229038338e-03 8.13716815266e-03 7.94279014126e-03 7.69793885145e-03 7.42492384580e-03 7.14689010595e-03 - 6.88519888788e-03 6.65719946009e-03 6.47483593539e-03 6.34416762186e-03 6.26545793635e-03 6.23361812745e-03 - 7.24904282964e-03 7.39443450458e-03 7.52314503521e-03 7.61927184895e-03 7.67065297497e-03 7.67065297497e-03 - 7.61927184895e-03 7.52314503521e-03 7.39443450458e-03 7.24904282964e-03 7.10459522193e-03 6.97836085285e-03 - 6.88519888788e-03 6.83583874198e-03 6.83583874198e-03 6.88519888788e-03 6.97836085285e-03 7.10459522193e-03 - 7.24904282964e-03 7.39443450458e-03 7.52314503521e-03 7.61927184895e-03 7.67065297497e-03 7.67065297497e-03 - 7.61927184895e-03 7.52314503521e-03 7.39443450458e-03 7.24904282964e-03 7.10459522193e-03 6.97836085285e-03 - 6.88519888788e-03 6.83583874198e-03 6.83583874198e-03 6.88519888788e-03 6.97836085285e-03 7.10459522193e-03 - 8.69246386814e-03 8.95261635749e-03 9.15892896774e-03 9.29162040305e-03 9.33741418467e-03 9.29162040305e-03 - 9.15892896774e-03 8.95261635749e-03 8.69246386814e-03 8.40200942373e-03 8.10563303358e-03 7.82576853226e-03 - 7.58058258839e-03 7.38252390656e-03 7.23785699764e-03 7.14689010595e-03 7.10459522193e-03 7.10160482063e-03 - 7.12561826537e-03 7.16308508658e-03 7.20097316500e-03 7.22847713667e-03 7.23847314555e-03 7.22847713667e-03 - 7.20097316500e-03 7.16308508658e-03 7.12561826537e-03 7.10160482063e-03 7.10459522193e-03 7.14689010595e-03 - 7.23785699764e-03 7.38252390656e-03 7.58058258839e-03 7.82576853226e-03 8.10563303358e-03 8.40200942373e-03 - 1.06524671204e-02 1.10259974674e-02 1.12951380995e-02 1.14361707830e-02 1.14361707830e-02 1.12951380995e-02 - 1.10259974674e-02 1.06524671204e-02 1.02054916185e-02 9.71912104775e-03 9.22648243576e-03 8.75631776595e-03 - 8.33057919998e-03 7.96341795569e-03 7.66146344666e-03 7.42492384580e-03 7.24904282964e-03 7.12561826537e-03 - 7.04448483440e-03 6.99504538611e-03 6.96786738821e-03 6.95605972443e-03 6.95605972443e-03 6.96786738821e-03 - 6.99504538611e-03 7.04448483440e-03 7.12561826537e-03 7.24904282964e-03 7.42492384580e-03 7.66146344666e-03 - 7.96341795569e-03 8.33057919998e-03 8.75631776595e-03 9.22648243576e-03 9.71912104775e-03 1.02054916185e-02 - 1.32272933414e-02 1.37059602390e-02 1.40109856905e-02 1.41157952825e-02 1.40109856905e-02 1.37059602390e-02 - 1.32272933414e-02 1.26143883181e-02 1.19137265332e-02 1.11729588764e-02 1.04356792319e-02 9.73748464183e-03 - 9.10381322670e-03 8.54973346172e-03 8.08133005705e-03 7.69793885145e-03 7.39443450458e-03 7.16308508658e-03 - 6.99504538611e-03 6.88181758770e-03 6.81664387654e-03 6.79537428806e-03 6.81664387654e-03 6.88181758770e-03 - 6.99504538611e-03 7.16308508658e-03 7.39443450458e-03 7.69793885145e-03 8.08133005705e-03 8.54973346172e-03 - 9.10381322670e-03 9.73748464183e-03 1.04356792319e-02 1.11729588764e-02 1.19137265332e-02 1.26143883181e-02 - 1.65234811342e-02 1.70848695603e-02 1.73786828448e-02 1.73786828448e-02 1.70848695603e-02 1.65234811342e-02 - 1.57423428102e-02 1.48031251671e-02 1.37726366090e-02 1.27148275869e-02 1.16845233837e-02 1.07235056315e-02 - 9.85925299562e-03 9.10613117226e-03 8.46823559623e-03 7.94279014126e-03 7.52314503521e-03 7.20097316500e-03 - 6.96786738821e-03 6.81664387654e-03 6.74228118806e-03 6.74228118806e-03 6.81664387654e-03 6.96786738821e-03 - 7.20097316500e-03 7.52314503521e-03 7.94279014126e-03 8.46823559623e-03 9.10613117226e-03 9.85925299562e-03 - 1.07235056315e-02 1.16845233837e-02 1.27148275869e-02 1.37726366090e-02 1.48031251671e-02 1.57423428102e-02 - 2.06439962171e-02 2.12413612776e-02 2.14468462049e-02 2.12413612776e-02 2.06439962171e-02 1.97084075068e-02 - 1.85132658939e-02 1.71497889118e-02 1.57094271493e-02 1.42737851127e-02 1.29079014387e-02 1.16573532374e-02 - 1.05489279259e-02 9.59384043225e-03 8.79214216133e-03 8.13716815266e-03 7.61927184895e-03 7.22847713667e-03 - 6.95605972443e-03 6.79537428806e-03 6.74228118806e-03 6.79537428806e-03 6.95605972443e-03 7.22847713667e-03 - 7.61927184895e-03 8.13716815266e-03 8.79214216133e-03 9.59384043225e-03 1.05489279259e-02 1.16573532374e-02 - 1.29079014387e-02 1.42737851127e-02 1.57094271493e-02 1.71497889118e-02 1.85132658939e-02 1.97084075068e-02 - 2.56657154446e-02 2.62153172241e-02 2.62153172241e-02 2.56657154446e-02 2.46187421852e-02 2.31688478126e-02 - 2.14361295219e-02 1.95479913088e-02 1.76229803621e-02 1.57591868798e-02 1.40283418589e-02 1.24755048074e-02 - 1.11228159589e-02 9.97511028176e-03 9.02578945364e-03 8.26229038338e-03 7.67065297497e-03 7.23847314555e-03 - 6.95605972443e-03 6.81664387654e-03 6.81664387654e-03 6.95605972443e-03 7.23847314555e-03 7.67065297497e-03 - 8.26229038338e-03 9.02578945364e-03 9.97511028176e-03 1.11228159589e-02 1.24755048074e-02 1.40283418589e-02 - 1.57591868798e-02 1.76229803621e-02 1.95479913088e-02 2.14361295219e-02 2.31688478126e-02 2.46187421852e-02 - 3.16041856284e-02 3.19731919657e-02 3.16041856284e-02 3.05340710560e-02 2.88661050079e-02 2.67502344749e-02 - 2.43576039836e-02 2.18557815330e-02 1.93892705934e-02 1.70678712692e-02 1.49636867906e-02 1.31152359900e-02 - 1.15351431719e-02 1.02181471415e-02 9.14830218340e-03 8.30549434438e-03 7.67065297497e-03 7.22847713667e-03 - 6.96786738821e-03 6.88181758770e-03 6.96786738821e-03 7.22847713667e-03 7.67065297497e-03 8.30549434438e-03 - 9.14830218340e-03 1.02181471415e-02 1.15351431719e-02 1.31152359900e-02 1.49636867906e-02 1.70678712692e-02 - 1.93892705934e-02 2.18557815330e-02 2.43576039836e-02 2.67502344749e-02 2.88661050079e-02 3.05340710560e-02 - 3.83718132369e-02 3.83718132369e-02 3.74259862301e-02 3.56312088557e-02 3.31615306069e-02 3.02357338101e-02 - 2.70818268649e-02 2.39063871143e-02 2.08735527936e-02 1.80960146721e-02 1.56375665721e-02 1.35231772103e-02 - 1.17508350709e-02 1.03016601350e-02 9.14830218340e-03 8.26229038338e-03 7.61927184895e-03 7.20097316500e-03 - 6.99504538611e-03 6.99504538611e-03 7.20097316500e-03 7.61927184895e-03 8.26229038338e-03 9.14830218340e-03 - 1.03016601350e-02 1.17508350709e-02 1.35231772103e-02 1.56375665721e-02 1.80960146721e-02 2.08735527936e-02 - 2.39063871143e-02 2.70818268649e-02 3.02357338101e-02 3.31615306069e-02 3.56312088557e-02 3.74259862301e-02 - 4.57409612273e-02 4.51323632879e-02 4.33721592307e-02 4.06430475235e-02 3.72078996967e-02 3.33624200108e-02 - 2.93901320501e-02 2.55281844546e-02 2.19482820950e-02 1.87538902948e-02 1.59907282434e-02 1.36633879542e-02 - 1.17508350709e-02 1.02181471415e-02 9.02578945364e-03 8.13716815266e-03 7.52314503521e-03 7.16308508658e-03 - 7.04448483440e-03 7.16308508658e-03 7.52314503521e-03 8.13716815266e-03 9.02578945364e-03 1.02181471415e-02 - 1.17508350709e-02 1.36633879542e-02 1.59907282434e-02 1.87538902948e-02 2.19482820950e-02 2.55281844546e-02 - 2.93901320501e-02 3.33624200108e-02 3.72078996967e-02 4.06430475235e-02 4.33721592307e-02 4.51323632879e-02 - 5.33236907840e-02 5.18355302331e-02 4.90231496620e-02 4.51788789706e-02 4.06654278454e-02 3.58537824974e-02 - 3.10717223250e-02 2.65706573512e-02 2.25132701769e-02 1.89804120902e-02 1.59907282434e-02 1.35231772103e-02 - 1.15351431719e-02 9.97511028176e-03 8.79214216133e-03 7.94279014126e-03 7.39443450458e-03 7.12561826537e-03 - 7.12561826537e-03 7.39443450458e-03 7.94279014126e-03 8.79214216133e-03 9.97511028176e-03 1.15351431719e-02 - 1.35231772103e-02 1.59907282434e-02 1.89804120902e-02 2.25132701769e-02 2.65706573512e-02 3.10717223250e-02 - 3.58537824974e-02 4.06654278454e-02 4.51788789706e-02 4.90231496620e-02 5.18355302331e-02 5.33236907840e-02 - 6.05796981280e-02 5.79474348197e-02 5.38883507401e-02 4.88190878681e-02 4.32002938784e-02 3.74634706166e-02 - 3.19590319446e-02 2.69304328597e-02 2.25132701769e-02 1.87538902948e-02 1.56375665721e-02 1.31152359900e-02 - 1.11228159589e-02 9.59384043225e-03 8.46823559623e-03 7.69793885145e-03 7.24904282964e-03 7.10160482063e-03 - 7.24904282964e-03 7.69793885145e-03 8.46823559623e-03 9.59384043225e-03 1.11228159589e-02 1.31152359900e-02 - 1.56375665721e-02 1.87538902948e-02 2.25132701769e-02 2.69304328597e-02 3.19590319446e-02 3.74634706166e-02 - 4.32002938784e-02 4.88190878681e-02 5.38883507401e-02 5.79474348197e-02 6.05796981280e-02 6.14923433640e-02 - 6.68641206041e-02 6.28828729732e-02 5.74762428735e-02 5.11831265828e-02 4.45431970579e-02 3.80204685260e-02 - 3.19590319446e-02 2.65706573512e-02 2.19482820950e-02 1.80960146721e-02 1.49636867906e-02 1.24755048074e-02 - 1.05489279259e-02 9.10613117226e-03 8.08133005705e-03 7.42492384580e-03 7.10459522193e-03 7.10459522193e-03 - 7.42492384580e-03 8.08133005705e-03 9.10613117226e-03 1.05489279259e-02 1.24755048074e-02 1.49636867906e-02 - 1.80960146721e-02 2.19482820950e-02 2.65706573512e-02 3.19590319446e-02 3.80204685260e-02 4.45431970579e-02 - 5.11831265828e-02 5.74762428735e-02 6.28828729732e-02 6.68641206041e-02 6.89793219251e-02 6.89793219251e-02 - 7.15201290633e-02 6.61022866145e-02 5.93841418824e-02 5.20033431247e-02 4.45431970579e-02 3.74634706166e-02 - 3.10717223250e-02 2.55281844546e-02 2.08735527936e-02 1.70678712692e-02 1.40283418589e-02 1.16573532374e-02 - 9.85925299562e-03 8.54973346172e-03 7.66146344666e-03 7.14689010595e-03 6.97836085285e-03 7.14689010595e-03 - 7.66146344666e-03 8.54973346172e-03 9.85925299562e-03 1.16573532374e-02 1.40283418589e-02 1.70678712692e-02 - 2.08735527936e-02 2.55281844546e-02 3.10717223250e-02 3.74634706166e-02 4.45431970579e-02 5.20033431247e-02 - 5.93841418824e-02 6.61022866145e-02 7.15201290633e-02 7.50510418428e-02 7.62783857555e-02 7.50510418428e-02 - 7.40032629540e-02 6.72218662363e-02 5.93841418824e-02 5.11831265828e-02 4.32002938784e-02 3.58537824974e-02 - 2.93901320501e-02 2.39063871143e-02 1.93892705934e-02 1.57591868798e-02 1.29079014387e-02 1.07235056315e-02 - 9.10381322670e-03 7.96341795569e-03 7.23785699764e-03 6.88519888788e-03 6.88519888788e-03 7.23785699764e-03 - 7.96341795569e-03 9.10381322670e-03 1.07235056315e-02 1.29079014387e-02 1.57591868798e-02 1.93892705934e-02 - 2.39063871143e-02 2.93901320501e-02 3.58537824974e-02 4.32002938784e-02 5.11831265828e-02 5.93841418824e-02 - 6.72218662363e-02 7.40032629540e-02 7.90236437036e-02 8.16998180862e-02 8.16998180862e-02 7.90236437036e-02 - 7.40032629540e-02 6.61022866145e-02 5.74762428735e-02 4.88190878681e-02 4.06654278454e-02 3.33624200108e-02 - 2.70818268649e-02 2.18557815330e-02 1.76229803621e-02 1.42737851127e-02 1.16845233837e-02 9.73748464183e-03 - 8.33057919998e-03 7.38252390656e-03 6.83583874198e-03 6.65719946009e-03 6.83583874198e-03 7.38252390656e-03 - 8.33057919998e-03 9.73748464183e-03 1.16845233837e-02 1.42737851127e-02 1.76229803621e-02 2.18557815330e-02 - 2.70818268649e-02 3.33624200108e-02 4.06654278454e-02 4.88190878681e-02 5.74762428735e-02 6.61022866145e-02 - 7.40032629540e-02 8.04073084192e-02 8.45957298814e-02 8.60542685404e-02 8.45957298814e-02 8.04073084192e-02 - 7.15201290633e-02 6.28828729732e-02 5.38883507401e-02 4.51788789706e-02 3.72078996967e-02 3.02357338101e-02 - 2.43576039836e-02 1.95479913088e-02 1.57094271493e-02 1.27148275869e-02 1.04356792319e-02 8.75631776595e-03 - 7.58058258839e-03 6.83583874198e-03 6.47483593539e-03 6.47483593539e-03 6.83583874198e-03 7.58058258839e-03 - 8.75631776595e-03 1.04356792319e-02 1.27148275869e-02 1.57094271493e-02 1.95479913088e-02 2.43576039836e-02 - 3.02357338101e-02 3.72078996967e-02 4.51788789706e-02 5.38883507401e-02 6.28828729732e-02 7.15201290633e-02 - 7.90236437036e-02 8.45957298814e-02 8.75716967614e-02 8.75716967614e-02 8.45957298814e-02 7.90236437036e-02 - 6.68641206041e-02 5.79474348197e-02 4.90231496620e-02 4.06430475235e-02 3.31615306069e-02 2.67502344749e-02 - 2.14361295219e-02 1.71497889118e-02 1.37726366090e-02 1.11729588764e-02 9.22648243576e-03 7.82576853226e-03 - 6.88519888788e-03 6.34416762186e-03 6.16759269815e-03 6.34416762186e-03 6.88519888788e-03 7.82576853226e-03 - 9.22648243576e-03 1.11729588764e-02 1.37726366090e-02 1.71497889118e-02 2.14361295219e-02 2.67502344749e-02 - 3.31615306069e-02 4.06430475235e-02 4.90231496620e-02 5.79474348197e-02 6.68641206041e-02 7.50510418428e-02 - 8.16998180862e-02 8.60542685404e-02 8.75716967614e-02 8.60542685404e-02 8.16998180862e-02 7.50510418428e-02 - 6.05796981280e-02 5.18355302331e-02 4.33721592307e-02 3.56312088557e-02 2.88661050079e-02 2.31688478126e-02 - 1.85132658939e-02 1.48031251671e-02 1.19137265332e-02 9.71912104775e-03 8.10563303358e-03 6.97836085285e-03 - 6.26545793635e-03 5.92021996667e-03 5.92021996667e-03 6.26545793635e-03 6.97836085285e-03 8.10563303358e-03 - 9.71912104775e-03 1.19137265332e-02 1.48031251671e-02 1.85132658939e-02 2.31688478126e-02 2.88661050079e-02 - 3.56312088557e-02 4.33721592307e-02 5.18355302331e-02 6.05796981280e-02 6.89793219251e-02 7.62783857555e-02 - 8.16998180862e-02 8.45957298814e-02 8.45957298814e-02 8.16998180862e-02 7.62783857555e-02 6.89793219251e-02 - 5.33236907840e-02 4.51323632879e-02 3.74259862301e-02 3.05340710560e-02 2.46187421852e-02 1.97084075068e-02 - 1.57423428102e-02 1.26143883181e-02 1.02054916185e-02 8.40200942373e-03 7.10459522193e-03 6.23361812745e-03 - 5.73268604942e-03 5.56920678348e-03 5.73268604942e-03 6.23361812745e-03 7.10459522193e-03 8.40200942373e-03 - 1.02054916185e-02 1.26143883181e-02 1.57423428102e-02 1.97084075068e-02 2.46187421852e-02 3.05340710560e-02 - 3.74259862301e-02 4.51323632879e-02 5.33236907840e-02 6.14923433640e-02 6.89793219251e-02 7.50510418428e-02 - 7.90236437036e-02 8.04073084192e-02 7.90236437036e-02 7.50510418428e-02 6.89793219251e-02 6.14923433640e-02 - 4.02453701311e-02 3.34710625414e-02 2.73972646659e-02 2.21666114252e-02 1.78072941675e-02 1.42727054437e-02 - 1.14766013692e-02 9.31810768724e-03 7.69793885145e-03 6.52902358143e-03 5.74257125314e-03 5.28994524639e-03 - 5.14226972170e-03 5.28994524639e-03 5.74257125314e-03 6.52902358143e-03 7.69793885145e-03 9.31810768724e-03 - 1.14766013692e-02 1.42727054437e-02 1.78072941675e-02 2.21666114252e-02 2.73972646659e-02 3.34710625414e-02 - 4.02453701311e-02 4.74313143781e-02 5.45841783826e-02 6.11288569567e-02 6.64284767715e-02 6.98920688762e-02 - 7.10977313661e-02 6.98920688762e-02 6.64284767715e-02 6.11288569567e-02 5.45841783826e-02 4.74313143781e-02 - 3.34710625414e-02 2.77227537368e-02 2.26519365039e-02 1.83376793613e-02 1.47756456624e-02 1.19105819676e-02 - 9.66211927865e-03 7.94279014126e-03 6.67049181789e-03 5.77651892440e-03 5.20914423543e-03 4.93405372394e-03 - 4.93405372394e-03 5.20914423543e-03 5.77651892440e-03 6.67049181789e-03 7.94279014126e-03 9.66211927865e-03 - 1.19105819676e-02 1.47756456624e-02 1.83376793613e-02 2.26519365039e-02 2.77227537368e-02 3.34710625414e-02 - 3.97029159910e-02 4.60913389830e-02 5.21839135623e-02 5.74449785733e-02 6.13334872428e-02 6.34040688222e-02 - 6.34040688222e-02 6.13334872428e-02 5.74449785733e-02 5.21839135623e-02 4.60913389830e-02 3.97029159910e-02 - 2.73972646659e-02 2.26519365039e-02 1.85201445811e-02 1.50389831834e-02 1.21873907787e-02 9.91029781221e-03 - 8.13716815266e-03 6.79567554150e-03 5.82127807001e-03 5.16243150929e-03 4.78210810048e-03 4.65785937656e-03 - 4.78210810048e-03 5.16243150929e-03 5.82127807001e-03 6.79567554150e-03 8.13716815266e-03 9.91029781221e-03 - 1.21873907787e-02 1.50389831834e-02 1.85201445811e-02 2.26519365039e-02 2.73972646659e-02 3.26341221073e-02 - 3.81345549630e-02 4.35604474537e-02 4.84855850881e-02 5.24477482650e-02 5.50251512552e-02 5.59201471811e-02 - 5.50251512552e-02 5.24477482650e-02 4.84855850881e-02 4.35604474537e-02 3.81345549630e-02 3.26341221073e-02 - 2.21666114252e-02 1.83376793613e-02 1.50389831834e-02 1.22825573408e-02 1.00404664762e-02 8.26229038338e-03 - 6.88914005847e-03 5.86418256271e-03 5.13913617973e-03 4.67692793169e-03 4.45230019628e-03 4.45230019628e-03 - 4.67692793169e-03 5.13913617973e-03 5.86418256271e-03 6.88914005847e-03 8.26229038338e-03 1.00404664762e-02 - 1.22825573408e-02 1.50389831834e-02 1.83376793613e-02 2.21666114252e-02 2.64534808200e-02 3.10465495213e-02 - 3.57044700685e-02 4.01041807768e-02 4.38725463784e-02 4.66403070569e-02 4.81082332430e-02 4.81082332430e-02 - 4.66403070569e-02 4.38725463784e-02 4.01041807768e-02 3.57044700685e-02 3.10465495213e-02 2.64534808200e-02 - 1.78072941675e-02 1.47756456624e-02 1.21873907787e-02 1.00404664762e-02 8.30549434438e-03 6.93908976898e-03 - 5.89466652251e-03 5.12972310883e-03 4.60945880297e-03 4.30805835198e-03 4.20942844716e-03 4.30805835198e-03 - 4.60945880297e-03 5.12972310883e-03 5.89466652251e-03 6.93908976898e-03 8.30549434438e-03 1.00404664762e-02 - 1.21873907787e-02 1.47756456624e-02 1.78072941675e-02 2.12421582644e-02 2.49827563157e-02 2.88631293974e-02 - 3.26483588385e-02 3.60511821341e-02 3.87673596218e-02 4.05244812822e-02 4.11328816616e-02 4.05244812822e-02 - 3.87673596218e-02 3.60511821341e-02 3.26483588385e-02 2.88631293974e-02 2.49827563157e-02 2.12421582644e-02 - 1.42727054437e-02 1.19105819676e-02 9.91029781221e-03 8.26229038338e-03 6.93908976898e-03 5.90565973456e-03 - 5.12697112440e-03 4.57225197605e-03 4.21692866215e-03 4.04374575730e-03 4.04374575730e-03 4.21692866215e-03 - 4.57225197605e-03 5.12697112440e-03 5.90565973456e-03 6.93908976898e-03 8.26229038338e-03 9.91029781221e-03 - 1.19105819676e-02 1.42727054437e-02 1.69767793036e-02 1.99620901041e-02 2.31175818882e-02 2.62778950395e-02 - 2.92302840650e-02 3.17358390207e-02 3.35632692529e-02 3.45282284639e-02 3.45282284639e-02 3.35632692529e-02 - 3.17358390207e-02 2.92302840650e-02 2.62778950395e-02 2.31175818882e-02 1.99620901041e-02 1.69767793036e-02 - 1.14766013692e-02 9.66211927865e-03 8.13716815266e-03 6.88914005847e-03 5.89466652251e-03 5.12697112440e-03 - 4.56041706509e-03 4.17292027232e-03 3.94752033538e-03 3.87358926493e-03 3.94752033538e-03 4.17292027232e-03 - 4.56041706509e-03 5.12697112440e-03 5.89466652251e-03 6.88914005847e-03 8.13716815266e-03 9.66211927865e-03 - 1.14766013692e-02 1.35733603577e-02 1.59162612755e-02 1.84326960165e-02 2.10090352784e-02 2.34923498457e-02 - 2.57019293917e-02 2.74512061786e-02 2.85763383726e-02 2.89647599965e-02 2.85763383726e-02 2.74512061786e-02 - 2.57019293917e-02 2.34923498457e-02 2.10090352784e-02 1.84326960165e-02 1.59162612755e-02 1.35733603577e-02 - 9.31810768724e-03 7.94279014126e-03 6.79567554150e-03 5.86418256271e-03 5.12972310883e-03 4.57225197605e-03 - 4.17292027232e-03 3.91597292758e-03 3.79030883078e-03 3.79030883078e-03 3.91597292758e-03 4.17292027232e-03 - 4.57225197605e-03 5.12972310883e-03 5.86418256271e-03 6.79567554150e-03 7.94279014126e-03 9.31810768724e-03 - 1.09215936737e-02 1.27333396536e-02 1.47072813037e-02 1.67669692380e-02 1.88049742175e-02 2.06884779452e-02 - 2.22726314479e-02 2.34202555044e-02 2.40237109616e-02 2.40237109616e-02 2.34202555044e-02 2.22726314479e-02 - 2.06884779452e-02 1.88049742175e-02 1.67669692380e-02 1.47072813037e-02 1.27333396536e-02 1.09215936737e-02 - 7.69793885145e-03 6.67049181789e-03 5.82127807001e-03 5.13913617973e-03 4.60945880297e-03 4.21692866215e-03 - 3.94752033538e-03 3.79030883078e-03 3.73863341678e-03 3.79030883078e-03 3.94752033538e-03 4.21692866215e-03 - 4.60945880297e-03 5.13913617973e-03 5.82127807001e-03 6.67049181789e-03 7.69793885145e-03 8.90705726329e-03 - 1.02881382638e-02 1.18131307076e-02 1.34318126710e-02 1.50702461704e-02 1.66330383744e-02 1.80109897723e-02 - 1.90940368490e-02 1.97871783123e-02 2.00258575799e-02 1.97871783123e-02 1.90940368490e-02 1.80109897723e-02 - 1.66330383744e-02 1.50702461704e-02 1.34318126710e-02 1.18131307076e-02 1.02881382638e-02 8.90705726329e-03 - 6.52902358143e-03 5.77651892440e-03 5.16243150929e-03 4.67692793169e-03 4.30805835198e-03 4.04374575730e-03 - 3.87358926493e-03 3.79030883078e-03 3.79030883078e-03 3.87358926493e-03 4.04374575730e-03 4.30805835198e-03 - 4.67692793169e-03 5.16243150929e-03 5.77651892440e-03 6.52902358143e-03 7.42492384580e-03 8.46060891145e-03 - 9.61987006090e-03 1.08706042529e-02 1.21629507848e-02 1.34297677852e-02 1.45906790875e-02 1.55601992220e-02 - 1.62588522549e-02 1.66250325509e-02 1.66250325509e-02 1.62588522549e-02 1.55601992220e-02 1.45906790875e-02 - 1.34297677852e-02 1.21629507848e-02 1.08706042529e-02 9.61987006090e-03 8.46060891145e-03 7.42492384580e-03 - 5.74257125314e-03 5.20914423543e-03 4.78210810048e-03 4.45230019628e-03 4.20942844716e-03 4.04374575730e-03 - 3.94752033538e-03 3.91597292758e-03 3.94752033538e-03 4.04374575730e-03 4.20942844716e-03 4.45230019628e-03 - 4.78210810048e-03 5.20914423543e-03 5.74257125314e-03 6.38840491477e-03 7.14689010595e-03 8.00955236461e-03 - 8.95658363692e-03 9.95507847617e-03 1.09586567104e-02 1.19093466628e-02 1.27424344623e-02 1.33939588194e-02 - 1.38094745262e-02 1.39522993746e-02 1.38094745262e-02 1.33939588194e-02 1.27424344623e-02 1.19093466628e-02 - 1.09586567104e-02 9.95507847617e-03 8.95658363692e-03 8.00955236461e-03 7.14689010595e-03 6.38840491477e-03 - 5.28994524639e-03 4.93405372394e-03 4.65785937656e-03 4.45230019628e-03 4.30805835198e-03 4.21692866215e-03 - 4.17292027232e-03 4.17292027232e-03 4.21692866215e-03 4.30805835198e-03 4.45230019628e-03 4.65785937656e-03 - 4.93405372394e-03 5.28994524639e-03 5.73268604942e-03 6.26545793635e-03 6.88519888788e-03 7.58058258839e-03 - 8.33057919998e-03 9.10381322670e-03 9.85925299562e-03 1.05489279259e-02 1.11228159589e-02 1.15351431719e-02 - 1.17508350709e-02 1.17508350709e-02 1.15351431719e-02 1.11228159589e-02 1.05489279259e-02 9.85925299562e-03 - 9.10381322670e-03 8.33057919998e-03 7.58058258839e-03 6.88519888788e-03 6.26545793635e-03 5.73268604942e-03 - 5.14226972170e-03 4.93405372394e-03 4.78210810048e-03 4.67692793169e-03 4.60945880297e-03 4.57225197605e-03 - 4.56041706509e-03 4.57225197605e-03 4.60945880297e-03 4.67692793169e-03 4.78210810048e-03 4.93405372394e-03 - 5.14226972170e-03 5.41531278039e-03 5.75903981319e-03 6.17468606834e-03 6.65719946009e-03 7.19410390186e-03 - 7.76490388909e-03 8.34122341388e-03 8.88822832040e-03 9.36769905218e-03 9.74245511371e-03 9.98127039361e-03 - 1.00633149755e-02 9.98127039361e-03 9.74245511371e-03 9.36769905218e-03 8.88822832040e-03 8.34122341388e-03 - 7.76490388909e-03 7.19410390186e-03 6.65719946009e-03 6.17468606834e-03 5.75903981319e-03 5.41531278039e-03 - 5.28994524639e-03 5.20914423543e-03 5.16243150929e-03 5.13913617973e-03 5.12972310883e-03 5.12697112440e-03 - 5.12697112440e-03 5.12972310883e-03 5.13913617973e-03 5.16243150929e-03 5.20914423543e-03 5.28994524639e-03 - 5.41531278039e-03 5.59394004869e-03 5.83098728503e-03 6.12657930585e-03 6.47483593539e-03 6.86339437793e-03 - 7.27338017313e-03 7.68014935330e-03 8.05519399644e-03 8.36917339040e-03 8.59555582378e-03 8.71419097250e-03 - 8.71419097250e-03 8.59555582378e-03 8.36917339040e-03 8.05519399644e-03 7.68014935330e-03 7.27338017313e-03 - 6.86339437793e-03 6.47483593539e-03 6.12657930585e-03 5.83098728503e-03 5.59394004869e-03 5.41531278039e-03 - 5.74257125314e-03 5.77651892440e-03 5.82127807001e-03 5.86418256271e-03 5.89466652251e-03 5.90565973456e-03 - 5.89466652251e-03 5.86418256271e-03 5.82127807001e-03 5.77651892440e-03 5.74257125314e-03 5.73268604942e-03 - 5.75903981319e-03 5.83098728503e-03 5.95356833121e-03 6.12657930585e-03 6.34416762186e-03 6.59479473082e-03 - 6.86170422323e-03 7.12420828954e-03 7.35981258047e-03 7.54684340873e-03 7.66717366082e-03 7.70870330534e-03 - 7.66717366082e-03 7.54684340873e-03 7.35981258047e-03 7.12420828954e-03 6.86170422323e-03 6.59479473082e-03 - 6.34416762186e-03 6.12657930585e-03 5.95356833121e-03 5.83098728503e-03 5.75903981319e-03 5.73268604942e-03 - 6.52902358143e-03 6.67049181789e-03 6.79567554150e-03 6.88914005847e-03 6.93908976898e-03 6.93908976898e-03 - 6.88914005847e-03 6.79567554150e-03 6.67049181789e-03 6.52902358143e-03 6.38840491477e-03 6.26545793635e-03 - 6.17468606834e-03 6.12657930585e-03 6.12657930585e-03 6.17468606834e-03 6.26545793635e-03 6.38840491477e-03 - 6.52902358143e-03 6.67049181789e-03 6.79567554150e-03 6.88914005847e-03 6.93908976898e-03 6.93908976898e-03 - 6.88914005847e-03 6.79567554150e-03 6.67049181789e-03 6.52902358143e-03 6.38840491477e-03 6.26545793635e-03 - 6.17468606834e-03 6.12657930585e-03 6.12657930585e-03 6.17468606834e-03 6.26545793635e-03 6.38840491477e-03 - 7.69793885145e-03 7.94279014126e-03 8.13716815266e-03 8.26229038338e-03 8.30549434438e-03 8.26229038338e-03 - 8.13716815266e-03 7.94279014126e-03 7.69793885145e-03 7.42492384580e-03 7.14689010595e-03 6.88519888788e-03 - 6.65719946009e-03 6.47483593539e-03 6.34416762186e-03 6.26545793635e-03 6.23361812745e-03 6.23916674188e-03 - 6.26978037715e-03 6.31209415558e-03 6.35335851926e-03 6.38291972351e-03 6.39361872594e-03 6.38291972351e-03 - 6.35335851926e-03 6.31209415558e-03 6.26978037715e-03 6.23916674188e-03 6.23361812745e-03 6.26545793635e-03 - 6.34416762186e-03 6.47483593539e-03 6.65719946009e-03 6.88519888788e-03 7.14689010595e-03 7.42492384580e-03 - 9.31810768724e-03 9.66211927865e-03 9.91029781221e-03 1.00404664762e-02 1.00404664762e-02 9.91029781221e-03 - 9.66211927865e-03 9.31810768724e-03 8.90705726329e-03 8.46060891145e-03 8.00955236461e-03 7.58058258839e-03 - 7.19410390186e-03 6.86339437793e-03 6.59479473082e-03 6.38840491477e-03 6.23916674188e-03 6.13840739734e-03 - 6.07562992209e-03 6.04016501968e-03 6.02253909249e-03 6.01563766373e-03 6.01563766373e-03 6.02253909249e-03 - 6.04016501968e-03 6.07562992209e-03 6.13840739734e-03 6.23916674188e-03 6.38840491477e-03 6.59479473082e-03 - 6.86339437793e-03 7.19410390186e-03 7.58058258839e-03 8.00955236461e-03 8.46060891145e-03 8.90705726329e-03 - 1.14766013692e-02 1.19105819676e-02 1.21873907787e-02 1.22825573408e-02 1.21873907787e-02 1.19105819676e-02 - 1.14766013692e-02 1.09215936737e-02 1.02881382638e-02 9.61987006090e-03 8.95658363692e-03 8.33057919998e-03 - 7.76490388909e-03 7.27338017313e-03 6.86170422323e-03 6.52902358143e-03 6.26978037715e-03 6.07562992209e-03 - 5.93719631865e-03 5.84558656512e-03 5.79365065764e-03 5.77685140016e-03 5.79365065764e-03 5.84558656512e-03 - 5.93719631865e-03 6.07562992209e-03 6.26978037715e-03 6.52902358143e-03 6.86170422323e-03 7.27338017313e-03 - 7.76490388909e-03 8.33057919998e-03 8.95658363692e-03 9.61987006090e-03 1.02881382638e-02 1.09215936737e-02 - 1.42727054437e-02 1.47756456624e-02 1.50389831834e-02 1.50389831834e-02 1.47756456624e-02 1.42727054437e-02 - 1.35733603577e-02 1.27333396536e-02 1.18131307076e-02 1.08706042529e-02 9.95507847617e-03 9.10381322670e-03 - 8.34122341388e-03 7.68014935330e-03 7.12420828954e-03 6.67049181789e-03 6.31209415558e-03 6.04016501968e-03 - 5.84558656512e-03 5.72047031573e-03 5.65928321674e-03 5.65928321674e-03 5.72047031573e-03 5.84558656512e-03 - 6.04016501968e-03 6.31209415558e-03 6.67049181789e-03 7.12420828954e-03 7.68014935330e-03 8.34122341388e-03 - 9.10381322670e-03 9.95507847617e-03 1.08706042529e-02 1.18131307076e-02 1.27333396536e-02 1.35733603577e-02 - 1.78072941675e-02 1.83376793613e-02 1.85201445811e-02 1.83376793613e-02 1.78072941675e-02 1.69767793036e-02 - 1.59162612755e-02 1.47072813037e-02 1.34318126710e-02 1.21629507848e-02 1.09586567104e-02 9.85925299562e-03 - 8.88822832040e-03 8.05519399644e-03 7.35981258047e-03 6.79567554150e-03 6.35335851926e-03 6.02253909249e-03 - 5.79365065764e-03 5.65928321674e-03 5.61497680711e-03 5.65928321674e-03 5.79365065764e-03 6.02253909249e-03 - 6.35335851926e-03 6.79567554150e-03 7.35981258047e-03 8.05519399644e-03 8.88822832040e-03 9.85925299562e-03 - 1.09586567104e-02 1.21629507848e-02 1.34318126710e-02 1.47072813037e-02 1.59162612755e-02 1.69767793036e-02 - 2.21666114252e-02 2.26519365039e-02 2.26519365039e-02 2.21666114252e-02 2.12421582644e-02 1.99620901041e-02 - 1.84326960165e-02 1.67669692380e-02 1.50702461704e-02 1.34297677852e-02 1.19093466628e-02 1.05489279259e-02 - 9.36769905218e-03 8.36917339040e-03 7.54684340873e-03 6.88914005847e-03 6.38291972351e-03 6.01563766373e-03 - 5.77685140016e-03 5.65928321674e-03 5.65928321674e-03 5.77685140016e-03 6.01563766373e-03 6.38291972351e-03 - 6.88914005847e-03 7.54684340873e-03 8.36917339040e-03 9.36769905218e-03 1.05489279259e-02 1.19093466628e-02 - 1.34297677852e-02 1.50702461704e-02 1.67669692380e-02 1.84326960165e-02 1.99620901041e-02 2.12421582644e-02 - 2.73972646659e-02 2.77227537368e-02 2.73972646659e-02 2.64534808200e-02 2.49827563157e-02 2.31175818882e-02 - 2.10090352784e-02 1.88049742175e-02 1.66330383744e-02 1.45906790875e-02 1.27424344623e-02 1.11228159589e-02 - 9.74245511371e-03 8.59555582378e-03 7.66717366082e-03 6.93908976898e-03 6.39361872594e-03 6.01563766373e-03 - 5.79365065764e-03 5.72047031573e-03 5.79365065764e-03 6.01563766373e-03 6.39361872594e-03 6.93908976898e-03 - 7.66717366082e-03 8.59555582378e-03 9.74245511371e-03 1.11228159589e-02 1.27424344623e-02 1.45906790875e-02 - 1.66330383744e-02 1.88049742175e-02 2.10090352784e-02 2.31175818882e-02 2.49827563157e-02 2.64534808200e-02 - 3.34710625414e-02 3.34710625414e-02 3.26341221073e-02 3.10465495213e-02 2.88631293974e-02 2.62778950395e-02 - 2.34923498457e-02 2.06884779452e-02 1.80109897723e-02 1.55601992220e-02 1.33939588194e-02 1.15351431719e-02 - 9.98127039361e-03 8.71419097250e-03 7.70870330534e-03 6.93908976898e-03 6.38291972351e-03 6.02253909249e-03 - 5.84558656512e-03 5.84558656512e-03 6.02253909249e-03 6.38291972351e-03 6.93908976898e-03 7.70870330534e-03 - 8.71419097250e-03 9.98127039361e-03 1.15351431719e-02 1.33939588194e-02 1.55601992220e-02 1.80109897723e-02 - 2.06884779452e-02 2.34923498457e-02 2.62778950395e-02 2.88631293974e-02 3.10465495213e-02 3.26341221073e-02 - 4.02453701311e-02 3.97029159910e-02 3.81345549630e-02 3.57044700685e-02 3.26483588385e-02 2.92302840650e-02 - 2.57019293917e-02 2.22726314479e-02 1.90940368490e-02 1.62588522549e-02 1.38094745262e-02 1.17508350709e-02 - 1.00633149755e-02 8.71419097250e-03 7.66717366082e-03 6.88914005847e-03 6.35335851926e-03 6.04016501968e-03 - 5.93719631865e-03 6.04016501968e-03 6.35335851926e-03 6.88914005847e-03 7.66717366082e-03 8.71419097250e-03 - 1.00633149755e-02 1.17508350709e-02 1.38094745262e-02 1.62588522549e-02 1.90940368490e-02 2.22726314479e-02 - 2.57019293917e-02 2.92302840650e-02 3.26483588385e-02 3.57044700685e-02 3.81345549630e-02 3.97029159910e-02 - 4.74313143781e-02 4.60913389830e-02 4.35604474537e-02 4.01041807768e-02 3.60511821341e-02 3.17358390207e-02 - 2.74512061786e-02 2.34202555044e-02 1.97871783123e-02 1.66250325509e-02 1.39522993746e-02 1.17508350709e-02 - 9.98127039361e-03 8.59555582378e-03 7.54684340873e-03 6.79567554150e-03 6.31209415558e-03 6.07562992209e-03 - 6.07562992209e-03 6.31209415558e-03 6.79567554150e-03 7.54684340873e-03 8.59555582378e-03 9.98127039361e-03 - 1.17508350709e-02 1.39522993746e-02 1.66250325509e-02 1.97871783123e-02 2.34202555044e-02 2.74512061786e-02 - 3.17358390207e-02 3.60511821341e-02 4.01041807768e-02 4.35604474537e-02 4.60913389830e-02 4.74313143781e-02 - 5.45841783826e-02 5.21839135623e-02 4.84855850881e-02 4.38725463784e-02 3.87673596218e-02 3.35632692529e-02 - 2.85763383726e-02 2.40237109616e-02 2.00258575799e-02 1.66250325509e-02 1.38094745262e-02 1.15351431719e-02 - 9.74245511371e-03 8.36917339040e-03 7.35981258047e-03 6.67049181789e-03 6.26978037715e-03 6.13840739734e-03 - 6.26978037715e-03 6.67049181789e-03 7.35981258047e-03 8.36917339040e-03 9.74245511371e-03 1.15351431719e-02 - 1.38094745262e-02 1.66250325509e-02 2.00258575799e-02 2.40237109616e-02 2.85763383726e-02 3.35632692529e-02 - 3.87673596218e-02 4.38725463784e-02 4.84855850881e-02 5.21839135623e-02 5.45841783826e-02 5.54167137150e-02 - 6.11288569567e-02 5.74449785733e-02 5.24477482650e-02 4.66403070569e-02 4.05244812822e-02 3.45282284639e-02 - 2.89647599965e-02 2.40237109616e-02 1.97871783123e-02 1.62588522549e-02 1.33939588194e-02 1.11228159589e-02 - 9.36769905218e-03 8.05519399644e-03 7.12420828954e-03 6.52902358143e-03 6.23916674188e-03 6.23916674188e-03 - 6.52902358143e-03 7.12420828954e-03 8.05519399644e-03 9.36769905218e-03 1.11228159589e-02 1.33939588194e-02 - 1.62588522549e-02 1.97871783123e-02 2.40237109616e-02 2.89647599965e-02 3.45282284639e-02 4.05244812822e-02 - 4.66403070569e-02 5.24477482650e-02 5.74449785733e-02 6.11288569567e-02 6.30873277659e-02 6.30873277659e-02 - 6.64284767715e-02 6.13334872428e-02 5.50251512552e-02 4.81082332430e-02 4.11328816616e-02 3.45282284639e-02 - 2.85763383726e-02 2.34202555044e-02 1.90940368490e-02 1.55601992220e-02 1.27424344623e-02 1.05489279259e-02 - 8.88822832040e-03 7.68014935330e-03 6.86170422323e-03 6.38840491477e-03 6.23361812745e-03 6.38840491477e-03 - 6.86170422323e-03 7.68014935330e-03 8.88822832040e-03 1.05489279259e-02 1.27424344623e-02 1.55601992220e-02 - 1.90940368490e-02 2.34202555044e-02 2.85763383726e-02 3.45282284639e-02 4.11328816616e-02 4.81082332430e-02 - 5.50251512552e-02 6.13334872428e-02 6.64284767715e-02 6.97522426294e-02 7.09081350393e-02 6.97522426294e-02 - 6.98920688762e-02 6.34040688222e-02 5.59201471811e-02 4.81082332430e-02 4.05244812822e-02 3.35632692529e-02 - 2.74512061786e-02 2.22726314479e-02 1.80109897723e-02 1.45906790875e-02 1.19093466628e-02 9.85925299562e-03 - 8.34122341388e-03 7.27338017313e-03 6.59479473082e-03 6.26545793635e-03 6.26545793635e-03 6.59479473082e-03 - 7.27338017313e-03 8.34122341388e-03 9.85925299562e-03 1.19093466628e-02 1.45906790875e-02 1.80109897723e-02 - 2.22726314479e-02 2.74512061786e-02 3.35632692529e-02 4.05244812822e-02 4.81082332430e-02 5.59201471811e-02 - 6.34040688222e-02 6.98920688762e-02 7.47020608958e-02 7.72682499914e-02 7.72682499914e-02 7.47020608958e-02 - 7.10977313661e-02 6.34040688222e-02 5.50251512552e-02 4.66403070569e-02 3.87673596218e-02 3.17358390207e-02 - 2.57019293917e-02 2.06884779452e-02 1.66330383744e-02 1.34297677852e-02 1.09586567104e-02 9.10381322670e-03 - 7.76490388909e-03 6.86339437793e-03 6.34416762186e-03 6.17468606834e-03 6.34416762186e-03 6.86339437793e-03 - 7.76490388909e-03 9.10381322670e-03 1.09586567104e-02 1.34297677852e-02 1.66330383744e-02 2.06884779452e-02 - 2.57019293917e-02 3.17358390207e-02 3.87673596218e-02 4.66403070569e-02 5.50251512552e-02 6.34040688222e-02 - 7.10977313661e-02 7.73458021392e-02 8.14375530661e-02 8.28633557769e-02 8.14375530661e-02 7.73458021392e-02 - 6.98920688762e-02 6.13334872428e-02 5.24477482650e-02 4.38725463784e-02 3.60511821341e-02 2.92302840650e-02 - 2.34923498457e-02 1.88049742175e-02 1.50702461704e-02 1.21629507848e-02 9.95507847617e-03 8.33057919998e-03 - 7.19410390186e-03 6.47483593539e-03 6.12657930585e-03 6.12657930585e-03 6.47483593539e-03 7.19410390186e-03 - 8.33057919998e-03 9.95507847617e-03 1.21629507848e-02 1.50702461704e-02 1.88049742175e-02 2.34923498457e-02 - 2.92302840650e-02 3.60511821341e-02 4.38725463784e-02 5.24477482650e-02 6.13334872428e-02 6.98920688762e-02 - 7.73458021392e-02 8.28911486673e-02 8.58561529560e-02 8.58561529560e-02 8.28911486673e-02 7.73458021392e-02 - 6.64284767715e-02 5.74449785733e-02 4.84855850881e-02 4.01041807768e-02 3.26483588385e-02 2.62778950395e-02 - 2.10090352784e-02 1.67669692380e-02 1.34318126710e-02 1.08706042529e-02 8.95658363692e-03 7.58058258839e-03 - 6.65719946009e-03 6.12657930585e-03 5.95356833121e-03 6.12657930585e-03 6.65719946009e-03 7.58058258839e-03 - 8.95658363692e-03 1.08706042529e-02 1.34318126710e-02 1.67669692380e-02 2.10090352784e-02 2.62778950395e-02 - 3.26483588385e-02 4.01041807768e-02 4.84855850881e-02 5.74449785733e-02 6.64284767715e-02 7.47020608958e-02 - 8.14375530661e-02 8.58561529560e-02 8.73972293003e-02 8.58561529560e-02 8.14375530661e-02 7.47020608958e-02 - 6.11288569567e-02 5.21839135623e-02 4.35604474537e-02 3.57044700685e-02 2.88631293974e-02 2.31175818882e-02 - 1.84326960165e-02 1.47072813037e-02 1.18131307076e-02 9.61987006090e-03 8.00955236461e-03 6.88519888788e-03 - 6.17468606834e-03 5.83098728503e-03 5.83098728503e-03 6.17468606834e-03 6.88519888788e-03 8.00955236461e-03 - 9.61987006090e-03 1.18131307076e-02 1.47072813037e-02 1.84326960165e-02 2.31175818882e-02 2.88631293974e-02 - 3.57044700685e-02 4.35604474537e-02 5.21839135623e-02 6.11288569567e-02 6.97522426294e-02 7.72682499914e-02 - 8.28633557769e-02 8.58561529560e-02 8.58561529560e-02 8.28633557769e-02 7.72682499914e-02 6.97522426294e-02 - 5.45841783826e-02 4.60913389830e-02 3.81345549630e-02 3.10465495213e-02 2.49827563157e-02 1.99620901041e-02 - 1.59162612755e-02 1.27333396536e-02 1.02881382638e-02 8.46060891145e-03 7.14689010595e-03 6.26545793635e-03 - 5.75903981319e-03 5.59394004869e-03 5.75903981319e-03 6.26545793635e-03 7.14689010595e-03 8.46060891145e-03 - 1.02881382638e-02 1.27333396536e-02 1.59162612755e-02 1.99620901041e-02 2.49827563157e-02 3.10465495213e-02 - 3.81345549630e-02 4.60913389830e-02 5.45841783826e-02 6.30873277659e-02 7.09081350393e-02 7.72682499914e-02 - 8.14375530661e-02 8.28911486673e-02 8.14375530661e-02 7.72682499914e-02 7.09081350393e-02 6.30873277659e-02 - 4.74313143781e-02 3.97029159910e-02 3.26341221073e-02 2.64534808200e-02 2.12421582644e-02 1.69767793036e-02 - 1.35733603577e-02 1.09215936737e-02 8.90705726329e-03 7.42492384580e-03 6.38840491477e-03 5.73268604942e-03 - 5.41531278039e-03 5.41531278039e-03 5.73268604942e-03 6.38840491477e-03 7.42492384580e-03 8.90705726329e-03 - 1.09215936737e-02 1.35733603577e-02 1.69767793036e-02 2.12421582644e-02 2.64534808200e-02 3.26341221073e-02 - 3.97029159910e-02 4.74313143781e-02 5.54167137150e-02 6.30873277659e-02 6.97522426294e-02 7.47020608958e-02 - 7.73458021392e-02 7.73458021392e-02 7.47020608958e-02 6.97522426294e-02 6.30873277659e-02 5.54167137150e-02 - 3.55932306397e-02 2.94586793037e-02 2.40594329852e-02 1.94746684497e-02 1.56960478729e-02 1.26620800682e-02 - 1.02846446979e-02 8.46823559623e-03 7.12420828954e-03 6.17967298585e-03 5.58034633768e-03 5.28994524639e-03 - 5.28994524639e-03 5.58034633768e-03 6.17967298585e-03 7.12420828954e-03 8.46823559623e-03 1.02846446979e-02 - 1.26620800682e-02 1.56960478729e-02 1.94746684497e-02 2.40594329852e-02 2.94586793037e-02 3.55932306397e-02 - 4.22610610741e-02 4.91148354625e-02 5.56676247698e-02 6.13379141192e-02 6.55352798807e-02 6.77723654588e-02 - 6.77723654588e-02 6.55352798807e-02 6.13379141192e-02 5.56676247698e-02 4.91148354625e-02 4.22610610741e-02 - 2.94586793037e-02 2.43476957086e-02 1.99070659239e-02 1.61729889157e-02 1.31198380533e-02 1.06856809758e-02 - 8.79214216133e-03 7.35981258047e-03 6.31909087196e-03 5.61528193683e-03 5.20914423543e-03 5.07652462266e-03 - 5.20914423543e-03 5.61528193683e-03 6.31909087196e-03 7.35981258047e-03 8.79214216133e-03 1.06856809758e-02 - 1.31198380533e-02 1.61729889157e-02 1.99070659239e-02 2.43476957086e-02 2.94586793037e-02 3.51127517762e-02 - 4.10670403681e-02 4.69561004766e-02 5.23143637463e-02 5.66331890923e-02 5.94462807362e-02 6.04237632524e-02 - 5.94462807362e-02 5.66331890923e-02 5.23143637463e-02 4.69561004766e-02 4.10670403681e-02 3.51127517762e-02 - 2.40594329852e-02 1.99070659239e-02 1.63370205752e-02 1.33594815778e-02 1.09414577715e-02 9.02578945364e-03 - 7.54684340873e-03 6.44245195186e-03 5.66079261571e-03 5.16243150929e-03 4.92029966810e-03 4.92029966810e-03 - 5.16243150929e-03 5.66079261571e-03 6.44245195186e-03 7.54684340873e-03 9.02578945364e-03 1.09414577715e-02 - 1.33594815778e-02 1.63370205752e-02 1.99070659239e-02 2.40594329852e-02 2.87187367840e-02 3.37228748044e-02 - 3.88104397494e-02 4.36277000850e-02 4.77625301985e-02 5.08044555558e-02 5.24194501424e-02 5.24194501424e-02 - 5.08044555558e-02 4.77625301985e-02 4.36277000850e-02 3.88104397494e-02 3.37228748044e-02 2.87187367840e-02 - 1.94746684497e-02 1.61729889157e-02 1.33594815778e-02 1.10293847869e-02 9.14830218340e-03 7.66717366082e-03 - 6.53448601861e-03 5.70420021497e-03 5.13913617973e-03 4.81172327806e-03 4.70458873539e-03 4.81172327806e-03 - 5.13913617973e-03 5.70420021497e-03 6.53448601861e-03 7.66717366082e-03 9.14830218340e-03 1.10293847869e-02 - 1.33594815778e-02 1.61729889157e-02 1.94746684497e-02 2.32231030162e-02 2.73140021666e-02 3.15673758761e-02 - 3.57259716101e-02 3.94725484932e-02 4.24686468881e-02 4.44094609233e-02 4.50819394473e-02 4.44094609233e-02 - 4.24686468881e-02 3.94725484932e-02 3.57259716101e-02 3.15673758761e-02 2.73140021666e-02 2.32231030162e-02 - 1.56960478729e-02 1.31198380533e-02 1.09414577715e-02 9.14830218340e-03 7.70870330534e-03 6.58362639444e-03 - 5.73495116497e-03 5.12972310883e-03 4.74176747355e-03 4.55262020357e-03 4.55262020357e-03 4.74176747355e-03 - 5.12972310883e-03 5.73495116497e-03 6.58362639444e-03 7.70870330534e-03 9.14830218340e-03 1.09414577715e-02 - 1.31198380533e-02 1.56960478729e-02 1.86504890434e-02 2.19185274002e-02 2.53797852965e-02 2.88533907006e-02 - 3.21049723875e-02 3.48695445110e-02 3.68889471691e-02 3.79563421300e-02 3.79563421300e-02 3.68889471691e-02 - 3.48695445110e-02 3.21049723875e-02 2.88533907006e-02 2.53797852965e-02 2.19185274002e-02 1.86504890434e-02 - 1.26620800682e-02 1.06856809758e-02 9.02578945364e-03 7.66717366082e-03 6.58362639444e-03 5.74602373426e-03 - 5.12697112440e-03 4.70304044562e-03 4.45623663297e-03 4.37525079151e-03 4.45623663297e-03 4.70304044562e-03 - 5.12697112440e-03 5.74602373426e-03 6.58362639444e-03 7.66717366082e-03 9.02578945364e-03 1.06856809758e-02 - 1.26620800682e-02 1.49488960464e-02 1.75083321070e-02 2.02621880335e-02 2.30866420056e-02 2.58139075627e-02 - 2.82446089484e-02 3.01717861136e-02 3.14127386696e-02 3.18414068716e-02 3.14127386696e-02 3.01717861136e-02 - 2.82446089484e-02 2.58139075627e-02 2.30866420056e-02 2.02621880335e-02 1.75083321070e-02 1.49488960464e-02 - 1.02846446979e-02 8.79214216133e-03 7.54684340873e-03 6.53448601861e-03 5.73495116497e-03 5.12697112440e-03 - 4.69069423954e-03 4.40955813989e-03 4.27192322596e-03 4.27192322596e-03 4.40955813989e-03 4.69069423954e-03 - 5.12697112440e-03 5.73495116497e-03 6.53448601861e-03 7.54684340873e-03 8.79214216133e-03 1.02846446979e-02 - 1.20255038743e-02 1.39945083398e-02 1.61427916872e-02 1.83878553878e-02 2.06126999880e-02 2.26718438342e-02 - 2.44059448105e-02 2.56635113913e-02 2.63252408289e-02 2.63252408289e-02 2.56635113913e-02 2.44059448105e-02 - 2.26718438342e-02 2.06126999880e-02 1.83878553878e-02 1.61427916872e-02 1.39945083398e-02 1.20255038743e-02 - 8.46823559623e-03 7.35981258047e-03 6.44245195186e-03 5.70420021497e-03 5.12972310883e-03 4.70304044562e-03 - 4.40955813989e-03 4.23798561825e-03 4.18152878343e-03 4.23798561825e-03 4.40955813989e-03 4.70304044562e-03 - 5.12972310883e-03 5.70420021497e-03 6.44245195186e-03 7.35981258047e-03 8.46823559623e-03 9.77183223433e-03 - 1.12609832188e-02 1.29064893850e-02 1.46550533623e-02 1.64272283654e-02 1.81196807915e-02 1.96135589165e-02 - 2.07887392229e-02 2.15413174517e-02 2.18005508565e-02 2.15413174517e-02 2.07887392229e-02 1.96135589165e-02 - 1.81196807915e-02 1.64272283654e-02 1.46550533623e-02 1.29064893850e-02 1.12609832188e-02 9.77183223433e-03 - 7.12420828954e-03 6.31909087196e-03 5.66079261571e-03 5.13913617973e-03 4.74176747355e-03 4.45623663297e-03 - 4.27192322596e-03 4.18152878343e-03 4.18152878343e-03 4.27192322596e-03 4.45623663297e-03 4.74176747355e-03 - 5.13913617973e-03 5.66079261571e-03 6.31909087196e-03 7.12420828954e-03 8.08133005705e-03 9.18679124184e-03 - 1.04238516982e-02 1.17590249893e-02 1.31397287366e-02 1.44944499034e-02 1.57370100687e-02 1.67754563001e-02 - 1.75241772421e-02 1.79167348748e-02 1.79167348748e-02 1.75241772421e-02 1.67754563001e-02 1.57370100687e-02 - 1.44944499034e-02 1.31397287366e-02 1.17590249893e-02 1.04238516982e-02 9.18679124184e-03 8.08133005705e-03 - 6.17967298585e-03 5.61528193683e-03 5.16243150929e-03 4.81172327806e-03 4.55262020357e-03 4.37525079151e-03 - 4.27192322596e-03 4.23798561825e-03 4.27192322596e-03 4.37525079151e-03 4.55262020357e-03 4.81172327806e-03 - 5.16243150929e-03 5.61528193683e-03 6.17967298585e-03 6.86170422323e-03 7.66146344666e-03 8.57007132232e-03 - 9.56702175361e-03 1.06181928008e-02 1.16751572683e-02 1.26769712537e-02 1.35553259639e-02 1.42425749040e-02 - 1.46810426016e-02 1.48317912783e-02 1.46810426016e-02 1.42425749040e-02 1.35553259639e-02 1.26769712537e-02 - 1.16751572683e-02 1.06181928008e-02 9.56702175361e-03 8.57007132232e-03 7.66146344666e-03 6.86170422323e-03 - 5.58034633768e-03 5.20914423543e-03 4.92029966810e-03 4.70458873539e-03 4.55262020357e-03 4.45623663297e-03 - 4.40955813989e-03 4.40955813989e-03 4.45623663297e-03 4.55262020357e-03 4.70458873539e-03 4.92029966810e-03 - 5.20914423543e-03 5.58034633768e-03 6.04118457084e-03 6.59479473082e-03 7.23785699764e-03 7.95863052826e-03 - 8.73551184506e-03 9.53627070961e-03 1.03186231402e-02 1.10330000246e-02 1.16276251073e-02 1.20550163598e-02 - 1.22786655737e-02 1.22786655737e-02 1.20550163598e-02 1.16276251073e-02 1.10330000246e-02 1.03186231402e-02 - 9.53627070961e-03 8.73551184506e-03 7.95863052826e-03 7.23785699764e-03 6.59479473082e-03 6.04118457084e-03 - 5.28994524639e-03 5.07652462266e-03 4.92029966810e-03 4.81172327806e-03 4.74176747355e-03 4.70304044562e-03 - 4.69069423954e-03 4.70304044562e-03 4.74176747355e-03 4.81172327806e-03 4.92029966810e-03 5.07652462266e-03 - 5.28994524639e-03 5.56920678348e-03 5.92021996667e-03 6.34416762186e-03 6.83583874198e-03 7.38252390656e-03 - 7.96341795569e-03 8.54973346172e-03 9.10613117226e-03 9.59384043225e-03 9.97511028176e-03 1.02181471415e-02 - 1.03016601350e-02 1.02181471415e-02 9.97511028176e-03 9.59384043225e-03 9.10613117226e-03 8.54973346172e-03 - 7.96341795569e-03 7.38252390656e-03 6.83583874198e-03 6.34416762186e-03 5.92021996667e-03 5.56920678348e-03 - 5.28994524639e-03 5.20914423543e-03 5.16243150929e-03 5.13913617973e-03 5.12972310883e-03 5.12697112440e-03 - 5.12697112440e-03 5.12972310883e-03 5.13913617973e-03 5.16243150929e-03 5.20914423543e-03 5.28994524639e-03 - 5.41531278039e-03 5.59394004869e-03 5.83098728503e-03 6.12657930585e-03 6.47483593539e-03 6.86339437793e-03 - 7.27338017313e-03 7.68014935330e-03 8.05519399644e-03 8.36917339040e-03 8.59555582378e-03 8.71419097250e-03 - 8.71419097250e-03 8.59555582378e-03 8.36917339040e-03 8.05519399644e-03 7.68014935330e-03 7.27338017313e-03 - 6.86339437793e-03 6.47483593539e-03 6.12657930585e-03 5.83098728503e-03 5.59394004869e-03 5.41531278039e-03 - 5.58034633768e-03 5.61528193683e-03 5.66079261571e-03 5.70420021497e-03 5.73495116497e-03 5.74602373426e-03 - 5.73495116497e-03 5.70420021497e-03 5.66079261571e-03 5.61528193683e-03 5.58034633768e-03 5.56920678348e-03 - 5.59394004869e-03 5.66378434823e-03 5.78371930190e-03 5.95356833121e-03 6.16759269815e-03 6.41444748147e-03 - 6.67761981445e-03 6.93665223838e-03 7.16922584820e-03 7.35383003280e-03 7.47255069610e-03 7.51351058269e-03 - 7.47255069610e-03 7.35383003280e-03 7.16922584820e-03 6.93665223838e-03 6.67761981445e-03 6.41444748147e-03 - 6.16759269815e-03 5.95356833121e-03 5.78371930190e-03 5.66378434823e-03 5.59394004869e-03 5.56920678348e-03 - 6.17967298585e-03 6.31909087196e-03 6.44245195186e-03 6.53448601861e-03 6.58362639444e-03 6.58362639444e-03 - 6.53448601861e-03 6.44245195186e-03 6.31909087196e-03 6.17967298585e-03 6.04118457084e-03 5.92021996667e-03 - 5.83098728503e-03 5.78371930190e-03 5.78371930190e-03 5.83098728503e-03 5.92021996667e-03 6.04118457084e-03 - 6.17967298585e-03 6.31909087196e-03 6.44245195186e-03 6.53448601861e-03 6.58362639444e-03 6.58362639444e-03 - 6.53448601861e-03 6.44245195186e-03 6.31909087196e-03 6.17967298585e-03 6.04118457084e-03 5.92021996667e-03 - 5.83098728503e-03 5.78371930190e-03 5.78371930190e-03 5.83098728503e-03 5.92021996667e-03 6.04118457084e-03 - 7.12420828954e-03 7.35981258047e-03 7.54684340873e-03 7.66717366082e-03 7.70870330534e-03 7.66717366082e-03 - 7.54684340873e-03 7.35981258047e-03 7.12420828954e-03 6.86170422323e-03 6.59479473082e-03 6.34416762186e-03 - 6.12657930585e-03 5.95356833121e-03 5.83098728503e-03 5.75903981319e-03 5.73268604942e-03 5.74257125314e-03 - 5.77651892440e-03 5.82127807001e-03 5.86418256271e-03 5.89466652251e-03 5.90565973456e-03 5.89466652251e-03 - 5.86418256271e-03 5.82127807001e-03 5.77651892440e-03 5.74257125314e-03 5.73268604942e-03 5.75903981319e-03 - 5.83098728503e-03 5.95356833121e-03 6.12657930585e-03 6.34416762186e-03 6.59479473082e-03 6.86170422323e-03 - 8.46823559623e-03 8.79214216133e-03 9.02578945364e-03 9.14830218340e-03 9.14830218340e-03 9.02578945364e-03 - 8.79214216133e-03 8.46823559623e-03 8.08133005705e-03 7.66146344666e-03 7.23785699764e-03 6.83583874198e-03 - 6.47483593539e-03 6.16759269815e-03 5.92021996667e-03 5.73268604942e-03 5.59978938003e-03 5.51272438194e-03 - 5.46093720174e-03 5.43377044817e-03 5.42174879265e-03 5.41768978229e-03 5.41768978229e-03 5.42174879265e-03 - 5.43377044817e-03 5.46093720174e-03 5.51272438194e-03 5.59978938003e-03 5.73268604942e-03 5.92021996667e-03 - 6.16759269815e-03 6.47483593539e-03 6.83583874198e-03 7.23785699764e-03 7.66146344666e-03 8.08133005705e-03 - 1.02846446979e-02 1.06856809758e-02 1.09414577715e-02 1.10293847869e-02 1.09414577715e-02 1.06856809758e-02 - 1.02846446979e-02 9.77183223433e-03 9.18679124184e-03 8.57007132232e-03 7.95863052826e-03 7.38252390656e-03 - 6.86339437793e-03 6.41444748147e-03 6.04118457084e-03 5.74257125314e-03 5.51272438194e-03 5.34296096392e-03 - 5.22371135458e-03 5.14599535674e-03 5.10253249618e-03 5.08859106656e-03 5.10253249618e-03 5.14599535674e-03 - 5.22371135458e-03 5.34296096392e-03 5.51272438194e-03 5.74257125314e-03 6.04118457084e-03 6.41444748147e-03 - 6.86339437793e-03 7.38252390656e-03 7.95863052826e-03 8.57007132232e-03 9.18679124184e-03 9.77183223433e-03 - 1.26620800682e-02 1.31198380533e-02 1.33594815778e-02 1.33594815778e-02 1.31198380533e-02 1.26620800682e-02 - 1.20255038743e-02 1.12609832188e-02 1.04238516982e-02 9.56702175361e-03 8.73551184506e-03 7.96341795569e-03 - 7.27338017313e-03 6.67761981445e-03 6.17967298585e-03 5.77651892440e-03 5.46093720174e-03 5.22371135458e-03 - 5.05545032098e-03 4.94806264494e-03 4.89581524939e-03 4.89581524939e-03 4.94806264494e-03 5.05545032098e-03 - 5.22371135458e-03 5.46093720174e-03 5.77651892440e-03 6.17967298585e-03 6.67761981445e-03 7.27338017313e-03 - 7.96341795569e-03 8.73551184506e-03 9.56702175361e-03 1.04238516982e-02 1.12609832188e-02 1.20255038743e-02 - 1.56960478729e-02 1.61729889157e-02 1.63370205752e-02 1.61729889157e-02 1.56960478729e-02 1.49488960464e-02 - 1.39945083398e-02 1.29064893850e-02 1.17590249893e-02 1.06181928008e-02 9.53627070961e-03 8.54973346172e-03 - 7.68014935330e-03 6.93665223838e-03 6.31909087196e-03 5.82127807001e-03 5.43377044817e-03 5.14599535674e-03 - 4.94806264494e-03 4.83232712929e-03 4.79423577304e-03 4.83232712929e-03 4.94806264494e-03 5.14599535674e-03 - 5.43377044817e-03 5.82127807001e-03 6.31909087196e-03 6.93665223838e-03 7.68014935330e-03 8.54973346172e-03 - 9.53627070961e-03 1.06181928008e-02 1.17590249893e-02 1.29064893850e-02 1.39945083398e-02 1.49488960464e-02 - 1.94746684497e-02 1.99070659239e-02 1.99070659239e-02 1.94746684497e-02 1.86504890434e-02 1.75083321070e-02 - 1.61427916872e-02 1.46550533623e-02 1.31397287366e-02 1.16751572683e-02 1.03186231402e-02 9.10613117226e-03 - 8.05519399644e-03 7.16922584820e-03 6.44245195186e-03 5.86418256271e-03 5.42174879265e-03 5.10253249618e-03 - 4.89581524939e-03 4.79423577304e-03 4.79423577304e-03 4.89581524939e-03 5.10253249618e-03 5.42174879265e-03 - 5.86418256271e-03 6.44245195186e-03 7.16922584820e-03 8.05519399644e-03 9.10613117226e-03 1.03186231402e-02 - 1.16751572683e-02 1.31397287366e-02 1.46550533623e-02 1.61427916872e-02 1.75083321070e-02 1.86504890434e-02 - 2.40594329852e-02 2.43476957086e-02 2.40594329852e-02 2.32231030162e-02 2.19185274002e-02 2.02621880335e-02 - 1.83878553878e-02 1.64272283654e-02 1.44944499034e-02 1.26769712537e-02 1.10330000246e-02 9.59384043225e-03 - 8.36917339040e-03 7.35383003280e-03 6.53448601861e-03 5.89466652251e-03 5.41768978229e-03 5.08859106656e-03 - 4.89581524939e-03 4.83232712929e-03 4.89581524939e-03 5.08859106656e-03 5.41768978229e-03 5.89466652251e-03 - 6.53448601861e-03 7.35383003280e-03 8.36917339040e-03 9.59384043225e-03 1.10330000246e-02 1.26769712537e-02 - 1.44944499034e-02 1.64272283654e-02 1.83878553878e-02 2.02621880335e-02 2.19185274002e-02 2.32231030162e-02 - 2.94586793037e-02 2.94586793037e-02 2.87187367840e-02 2.73140021666e-02 2.53797852965e-02 2.30866420056e-02 - 2.06126999880e-02 1.81196807915e-02 1.57370100687e-02 1.35553259639e-02 1.16276251073e-02 9.97511028176e-03 - 8.59555582378e-03 7.47255069610e-03 6.58362639444e-03 5.90565973456e-03 5.41768978229e-03 5.10253249618e-03 - 4.94806264494e-03 4.94806264494e-03 5.10253249618e-03 5.41768978229e-03 5.90565973456e-03 6.58362639444e-03 - 7.47255069610e-03 8.59555582378e-03 9.97511028176e-03 1.16276251073e-02 1.35553259639e-02 1.57370100687e-02 - 1.81196807915e-02 2.06126999880e-02 2.30866420056e-02 2.53797852965e-02 2.73140021666e-02 2.87187367840e-02 - 3.55932306397e-02 3.51127517762e-02 3.37228748044e-02 3.15673758761e-02 2.88533907006e-02 2.58139075627e-02 - 2.26718438342e-02 1.96135589165e-02 1.67754563001e-02 1.42425749040e-02 1.20550163598e-02 1.02181471415e-02 - 8.71419097250e-03 7.51351058269e-03 6.58362639444e-03 5.89466652251e-03 5.42174879265e-03 5.14599535674e-03 - 5.05545032098e-03 5.14599535674e-03 5.42174879265e-03 5.89466652251e-03 6.58362639444e-03 7.51351058269e-03 - 8.71419097250e-03 1.02181471415e-02 1.20550163598e-02 1.42425749040e-02 1.67754563001e-02 1.96135589165e-02 - 2.26718438342e-02 2.58139075627e-02 2.88533907006e-02 3.15673758761e-02 3.37228748044e-02 3.51127517762e-02 - 4.22610610741e-02 4.10670403681e-02 3.88104397494e-02 3.57259716101e-02 3.21049723875e-02 2.82446089484e-02 - 2.44059448105e-02 2.07887392229e-02 1.75241772421e-02 1.46810426016e-02 1.22786655737e-02 1.03016601350e-02 - 8.71419097250e-03 7.47255069610e-03 6.53448601861e-03 5.86418256271e-03 5.43377044817e-03 5.22371135458e-03 - 5.22371135458e-03 5.43377044817e-03 5.86418256271e-03 6.53448601861e-03 7.47255069610e-03 8.71419097250e-03 - 1.03016601350e-02 1.22786655737e-02 1.46810426016e-02 1.75241772421e-02 2.07887392229e-02 2.44059448105e-02 - 2.82446089484e-02 3.21049723875e-02 3.57259716101e-02 3.88104397494e-02 4.10670403681e-02 4.22610610741e-02 - 4.91148354625e-02 4.69561004766e-02 4.36277000850e-02 3.94725484932e-02 3.48695445110e-02 3.01717861136e-02 - 2.56635113913e-02 2.15413174517e-02 1.79167348748e-02 1.48317912783e-02 1.22786655737e-02 1.02181471415e-02 - 8.59555582378e-03 7.35383003280e-03 6.44245195186e-03 5.82127807001e-03 5.46093720174e-03 5.34296096392e-03 - 5.46093720174e-03 5.82127807001e-03 6.44245195186e-03 7.35383003280e-03 8.59555582378e-03 1.02181471415e-02 - 1.22786655737e-02 1.48317912783e-02 1.79167348748e-02 2.15413174517e-02 2.56635113913e-02 3.01717861136e-02 - 3.48695445110e-02 3.94725484932e-02 4.36277000850e-02 4.69561004766e-02 4.91148354625e-02 4.98633146719e-02 - 5.56676247698e-02 5.23143637463e-02 4.77625301985e-02 4.24686468881e-02 3.68889471691e-02 3.14127386696e-02 - 2.63252408289e-02 2.18005508565e-02 1.79167348748e-02 1.46810426016e-02 1.20550163598e-02 9.97511028176e-03 - 8.36917339040e-03 7.16922584820e-03 6.31909087196e-03 5.77651892440e-03 5.51272438194e-03 5.51272438194e-03 - 5.77651892440e-03 6.31909087196e-03 7.16922584820e-03 8.36917339040e-03 9.97511028176e-03 1.20550163598e-02 - 1.46810426016e-02 1.79167348748e-02 2.18005508565e-02 2.63252408289e-02 3.14127386696e-02 3.68889471691e-02 - 4.24686468881e-02 4.77625301985e-02 5.23143637463e-02 5.56676247698e-02 5.74494623672e-02 5.74494623672e-02 - 6.13379141192e-02 5.66331890923e-02 5.08044555558e-02 4.44094609233e-02 3.79563421300e-02 3.18414068716e-02 - 2.63252408289e-02 2.15413174517e-02 1.75241772421e-02 1.42425749040e-02 1.16276251073e-02 9.59384043225e-03 - 8.05519399644e-03 6.93665223838e-03 6.17967298585e-03 5.74257125314e-03 5.59978938003e-03 5.74257125314e-03 - 6.17967298585e-03 6.93665223838e-03 8.05519399644e-03 9.59384043225e-03 1.16276251073e-02 1.42425749040e-02 - 1.75241772421e-02 2.15413174517e-02 2.63252408289e-02 3.18414068716e-02 3.79563421300e-02 4.44094609233e-02 - 5.08044555558e-02 5.66331890923e-02 6.13379141192e-02 6.44054743742e-02 6.54719417706e-02 6.44054743742e-02 - 6.55352798807e-02 5.94462807362e-02 5.24194501424e-02 4.50819394473e-02 3.79563421300e-02 3.14127386696e-02 - 2.56635113913e-02 2.07887392229e-02 1.67754563001e-02 1.35553259639e-02 1.10330000246e-02 9.10613117226e-03 - 7.68014935330e-03 6.67761981445e-03 6.04118457084e-03 5.73268604942e-03 5.73268604942e-03 6.04118457084e-03 - 6.67761981445e-03 7.68014935330e-03 9.10613117226e-03 1.10330000246e-02 1.35553259639e-02 1.67754563001e-02 - 2.07887392229e-02 2.56635113913e-02 3.14127386696e-02 3.79563421300e-02 4.50819394473e-02 5.24194501424e-02 - 5.94462807362e-02 6.55352798807e-02 7.00474085615e-02 7.24538631804e-02 7.24538631804e-02 7.00474085615e-02 - 6.77723654588e-02 6.04237632524e-02 5.24194501424e-02 4.44094609233e-02 3.68889471691e-02 3.01717861136e-02 - 2.44059448105e-02 1.96135589165e-02 1.57370100687e-02 1.26769712537e-02 1.03186231402e-02 8.54973346172e-03 - 7.27338017313e-03 6.41444748147e-03 5.92021996667e-03 5.75903981319e-03 5.92021996667e-03 6.41444748147e-03 - 7.27338017313e-03 8.54973346172e-03 1.03186231402e-02 1.26769712537e-02 1.57370100687e-02 1.96135589165e-02 - 2.44059448105e-02 3.01717861136e-02 3.68889471691e-02 4.44094609233e-02 5.24194501424e-02 6.04237632524e-02 - 6.77723654588e-02 7.37387049341e-02 7.76449689484e-02 7.90059272690e-02 7.76449689484e-02 7.37387049341e-02 - 6.77723654588e-02 5.94462807362e-02 5.08044555558e-02 4.24686468881e-02 3.48695445110e-02 2.82446089484e-02 - 2.26718438342e-02 1.81196807915e-02 1.44944499034e-02 1.16751572683e-02 9.53627070961e-03 7.96341795569e-03 - 6.86339437793e-03 6.16759269815e-03 5.83098728503e-03 5.83098728503e-03 6.16759269815e-03 6.86339437793e-03 - 7.96341795569e-03 9.53627070961e-03 1.16751572683e-02 1.44944499034e-02 1.81196807915e-02 2.26718438342e-02 - 2.82446089484e-02 3.48695445110e-02 4.24686468881e-02 5.08044555558e-02 5.94462807362e-02 6.77723654588e-02 - 7.50243106749e-02 8.04193974336e-02 8.33038946145e-02 8.33038946145e-02 8.04193974336e-02 7.50243106749e-02 - 6.55352798807e-02 5.66331890923e-02 4.77625301985e-02 3.94725484932e-02 3.21049723875e-02 2.58139075627e-02 - 2.06126999880e-02 1.64272283654e-02 1.31397287366e-02 1.06181928008e-02 8.73551184506e-03 7.38252390656e-03 - 6.47483593539e-03 5.95356833121e-03 5.78371930190e-03 5.95356833121e-03 6.47483593539e-03 7.38252390656e-03 - 8.73551184506e-03 1.06181928008e-02 1.31397287366e-02 1.64272283654e-02 2.06126999880e-02 2.58139075627e-02 - 3.21049723875e-02 3.94725484932e-02 4.77625301985e-02 5.66331890923e-02 6.55352798807e-02 7.37387049341e-02 - 8.04193974336e-02 8.48028174918e-02 8.63317298438e-02 8.48028174918e-02 8.04193974336e-02 7.37387049341e-02 - 6.13379141192e-02 5.23143637463e-02 4.36277000850e-02 3.57259716101e-02 2.88533907006e-02 2.30866420056e-02 - 1.83878553878e-02 1.46550533623e-02 1.17590249893e-02 9.56702175361e-03 7.95863052826e-03 6.83583874198e-03 - 6.12657930585e-03 5.78371930190e-03 5.78371930190e-03 6.12657930585e-03 6.83583874198e-03 7.95863052826e-03 - 9.56702175361e-03 1.17590249893e-02 1.46550533623e-02 1.83878553878e-02 2.30866420056e-02 2.88533907006e-02 - 3.57259716101e-02 4.36277000850e-02 5.23143637463e-02 6.13379141192e-02 7.00474085615e-02 7.76449689484e-02 - 8.33038946145e-02 8.63317298438e-02 8.63317298438e-02 8.33038946145e-02 7.76449689484e-02 7.00474085615e-02 - 5.56676247698e-02 4.69561004766e-02 3.88104397494e-02 3.15673758761e-02 2.53797852965e-02 2.02621880335e-02 - 1.61427916872e-02 1.29064893850e-02 1.04238516982e-02 8.57007132232e-03 7.23785699764e-03 6.34416762186e-03 - 5.83098728503e-03 5.66378434823e-03 5.83098728503e-03 6.34416762186e-03 7.23785699764e-03 8.57007132232e-03 - 1.04238516982e-02 1.29064893850e-02 1.61427916872e-02 2.02621880335e-02 2.53797852965e-02 3.15673758761e-02 - 3.88104397494e-02 4.69561004766e-02 5.56676247698e-02 6.44054743742e-02 7.24538631804e-02 7.90059272690e-02 - 8.33038946145e-02 8.48028174918e-02 8.33038946145e-02 7.90059272690e-02 7.24538631804e-02 6.44054743742e-02 - 4.91148354625e-02 4.10670403681e-02 3.37228748044e-02 2.73140021666e-02 2.19185274002e-02 1.75083321070e-02 - 1.39945083398e-02 1.12609832188e-02 9.18679124184e-03 7.66146344666e-03 6.59479473082e-03 5.92021996667e-03 - 5.59394004869e-03 5.59394004869e-03 5.92021996667e-03 6.59479473082e-03 7.66146344666e-03 9.18679124184e-03 - 1.12609832188e-02 1.39945083398e-02 1.75083321070e-02 2.19185274002e-02 2.73140021666e-02 3.37228748044e-02 - 4.10670403681e-02 4.91148354625e-02 5.74494623672e-02 6.54719417706e-02 7.24538631804e-02 7.76449689484e-02 - 8.04193974336e-02 8.04193974336e-02 7.76449689484e-02 7.24538631804e-02 6.54719417706e-02 5.74494623672e-02 - 4.22610610741e-02 3.51127517762e-02 2.87187367840e-02 2.32231030162e-02 1.86504890434e-02 1.49488960464e-02 - 1.20255038743e-02 9.77183223433e-03 8.08133005705e-03 6.86170422323e-03 6.04118457084e-03 5.56920678348e-03 - 5.41531278039e-03 5.56920678348e-03 6.04118457084e-03 6.86170422323e-03 8.08133005705e-03 9.77183223433e-03 - 1.20255038743e-02 1.49488960464e-02 1.86504890434e-02 2.32231030162e-02 2.87187367840e-02 3.51127517762e-02 - 4.22610610741e-02 4.98633146719e-02 5.74494623672e-02 6.44054743742e-02 7.00474085615e-02 7.37387049341e-02 - 7.50243106749e-02 7.37387049341e-02 7.00474085615e-02 6.44054743742e-02 5.74494623672e-02 4.98633146719e-02 - 3.18414068716e-02 2.63252408289e-02 2.15413174517e-02 1.75241772421e-02 1.42425749040e-02 1.16276251073e-02 - 9.59384043225e-03 8.05519399644e-03 6.93665223838e-03 6.17967298585e-03 5.74257125314e-03 5.59978938003e-03 - 5.74257125314e-03 6.17967298585e-03 6.93665223838e-03 8.05519399644e-03 9.59384043225e-03 1.16276251073e-02 - 1.42425749040e-02 1.75241772421e-02 2.15413174517e-02 2.63252408289e-02 3.18414068716e-02 3.79563421300e-02 - 4.44094609233e-02 5.08044555558e-02 5.66331890923e-02 6.13379141192e-02 6.44054743742e-02 6.54719417706e-02 - 6.44054743742e-02 6.13379141192e-02 5.66331890923e-02 5.08044555558e-02 4.44094609233e-02 3.79563421300e-02 - 2.63252408289e-02 2.18005508565e-02 1.79167348748e-02 1.46810426016e-02 1.20550163598e-02 9.97511028176e-03 - 8.36917339040e-03 7.16922584820e-03 6.31909087196e-03 5.77651892440e-03 5.51272438194e-03 5.51272438194e-03 - 5.77651892440e-03 6.31909087196e-03 7.16922584820e-03 8.36917339040e-03 9.97511028176e-03 1.20550163598e-02 - 1.46810426016e-02 1.79167348748e-02 2.18005508565e-02 2.63252408289e-02 3.14127386696e-02 3.68889471691e-02 - 4.24686468881e-02 4.77625301985e-02 5.23143637463e-02 5.56676247698e-02 5.74494623672e-02 5.74494623672e-02 - 5.56676247698e-02 5.23143637463e-02 4.77625301985e-02 4.24686468881e-02 3.68889471691e-02 3.14127386696e-02 - 2.15413174517e-02 1.79167348748e-02 1.48317912783e-02 1.22786655737e-02 1.02181471415e-02 8.59555582378e-03 - 7.35383003280e-03 6.44245195186e-03 5.82127807001e-03 5.46093720174e-03 5.34296096392e-03 5.46093720174e-03 - 5.82127807001e-03 6.44245195186e-03 7.35383003280e-03 8.59555582378e-03 1.02181471415e-02 1.22786655737e-02 - 1.48317912783e-02 1.79167348748e-02 2.15413174517e-02 2.56635113913e-02 3.01717861136e-02 3.48695445110e-02 - 3.94725484932e-02 4.36277000850e-02 4.69561004766e-02 4.91148354625e-02 4.98633146719e-02 4.91148354625e-02 - 4.69561004766e-02 4.36277000850e-02 3.94725484932e-02 3.48695445110e-02 3.01717861136e-02 2.56635113913e-02 - 1.75241772421e-02 1.46810426016e-02 1.22786655737e-02 1.03016601350e-02 8.71419097250e-03 7.47255069610e-03 - 6.53448601861e-03 5.86418256271e-03 5.43377044817e-03 5.22371135458e-03 5.22371135458e-03 5.43377044817e-03 - 5.86418256271e-03 6.53448601861e-03 7.47255069610e-03 8.71419097250e-03 1.03016601350e-02 1.22786655737e-02 - 1.46810426016e-02 1.75241772421e-02 2.07887392229e-02 2.44059448105e-02 2.82446089484e-02 3.21049723875e-02 - 3.57259716101e-02 3.88104397494e-02 4.10670403681e-02 4.22610610741e-02 4.22610610741e-02 4.10670403681e-02 - 3.88104397494e-02 3.57259716101e-02 3.21049723875e-02 2.82446089484e-02 2.44059448105e-02 2.07887392229e-02 - 1.42425749040e-02 1.20550163598e-02 1.02181471415e-02 8.71419097250e-03 7.51351058269e-03 6.58362639444e-03 - 5.89466652251e-03 5.42174879265e-03 5.14599535674e-03 5.05545032098e-03 5.14599535674e-03 5.42174879265e-03 - 5.89466652251e-03 6.58362639444e-03 7.51351058269e-03 8.71419097250e-03 1.02181471415e-02 1.20550163598e-02 - 1.42425749040e-02 1.67754563001e-02 1.96135589165e-02 2.26718438342e-02 2.58139075627e-02 2.88533907006e-02 - 3.15673758761e-02 3.37228748044e-02 3.51127517762e-02 3.55932306397e-02 3.51127517762e-02 3.37228748044e-02 - 3.15673758761e-02 2.88533907006e-02 2.58139075627e-02 2.26718438342e-02 1.96135589165e-02 1.67754563001e-02 - 1.16276251073e-02 9.97511028176e-03 8.59555582378e-03 7.47255069610e-03 6.58362639444e-03 5.90565973456e-03 - 5.41768978229e-03 5.10253249618e-03 4.94806264494e-03 4.94806264494e-03 5.10253249618e-03 5.41768978229e-03 - 5.90565973456e-03 6.58362639444e-03 7.47255069610e-03 8.59555582378e-03 9.97511028176e-03 1.16276251073e-02 - 1.35553259639e-02 1.57370100687e-02 1.81196807915e-02 2.06126999880e-02 2.30866420056e-02 2.53797852965e-02 - 2.73140021666e-02 2.87187367840e-02 2.94586793037e-02 2.94586793037e-02 2.87187367840e-02 2.73140021666e-02 - 2.53797852965e-02 2.30866420056e-02 2.06126999880e-02 1.81196807915e-02 1.57370100687e-02 1.35553259639e-02 - 9.59384043225e-03 8.36917339040e-03 7.35383003280e-03 6.53448601861e-03 5.89466652251e-03 5.41768978229e-03 - 5.08859106656e-03 4.89581524939e-03 4.83232712929e-03 4.89581524939e-03 5.08859106656e-03 5.41768978229e-03 - 5.89466652251e-03 6.53448601861e-03 7.35383003280e-03 8.36917339040e-03 9.59384043225e-03 1.10330000246e-02 - 1.26769712537e-02 1.44944499034e-02 1.64272283654e-02 1.83878553878e-02 2.02621880335e-02 2.19185274002e-02 - 2.32231030162e-02 2.40594329852e-02 2.43476957086e-02 2.40594329852e-02 2.32231030162e-02 2.19185274002e-02 - 2.02621880335e-02 1.83878553878e-02 1.64272283654e-02 1.44944499034e-02 1.26769712537e-02 1.10330000246e-02 - 8.05519399644e-03 7.16922584820e-03 6.44245195186e-03 5.86418256271e-03 5.42174879265e-03 5.10253249618e-03 - 4.89581524939e-03 4.79423577304e-03 4.79423577304e-03 4.89581524939e-03 5.10253249618e-03 5.42174879265e-03 - 5.86418256271e-03 6.44245195186e-03 7.16922584820e-03 8.05519399644e-03 9.10613117226e-03 1.03186231402e-02 - 1.16751572683e-02 1.31397287366e-02 1.46550533623e-02 1.61427916872e-02 1.75083321070e-02 1.86504890434e-02 - 1.94746684497e-02 1.99070659239e-02 1.99070659239e-02 1.94746684497e-02 1.86504890434e-02 1.75083321070e-02 - 1.61427916872e-02 1.46550533623e-02 1.31397287366e-02 1.16751572683e-02 1.03186231402e-02 9.10613117226e-03 - 6.93665223838e-03 6.31909087196e-03 5.82127807001e-03 5.43377044817e-03 5.14599535674e-03 4.94806264494e-03 - 4.83232712929e-03 4.79423577304e-03 4.83232712929e-03 4.94806264494e-03 5.14599535674e-03 5.43377044817e-03 - 5.82127807001e-03 6.31909087196e-03 6.93665223838e-03 7.68014935330e-03 8.54973346172e-03 9.53627070961e-03 - 1.06181928008e-02 1.17590249893e-02 1.29064893850e-02 1.39945083398e-02 1.49488960464e-02 1.56960478729e-02 - 1.61729889157e-02 1.63370205752e-02 1.61729889157e-02 1.56960478729e-02 1.49488960464e-02 1.39945083398e-02 - 1.29064893850e-02 1.17590249893e-02 1.06181928008e-02 9.53627070961e-03 8.54973346172e-03 7.68014935330e-03 - 6.17967298585e-03 5.77651892440e-03 5.46093720174e-03 5.22371135458e-03 5.05545032098e-03 4.94806264494e-03 - 4.89581524939e-03 4.89581524939e-03 4.94806264494e-03 5.05545032098e-03 5.22371135458e-03 5.46093720174e-03 - 5.77651892440e-03 6.17967298585e-03 6.67761981445e-03 7.27338017313e-03 7.96341795569e-03 8.73551184506e-03 - 9.56702175361e-03 1.04238516982e-02 1.12609832188e-02 1.20255038743e-02 1.26620800682e-02 1.31198380533e-02 - 1.33594815778e-02 1.33594815778e-02 1.31198380533e-02 1.26620800682e-02 1.20255038743e-02 1.12609832188e-02 - 1.04238516982e-02 9.56702175361e-03 8.73551184506e-03 7.96341795569e-03 7.27338017313e-03 6.67761981445e-03 - 5.74257125314e-03 5.51272438194e-03 5.34296096392e-03 5.22371135458e-03 5.14599535674e-03 5.10253249618e-03 - 5.08859106656e-03 5.10253249618e-03 5.14599535674e-03 5.22371135458e-03 5.34296096392e-03 5.51272438194e-03 - 5.74257125314e-03 6.04118457084e-03 6.41444748147e-03 6.86339437793e-03 7.38252390656e-03 7.95863052826e-03 - 8.57007132232e-03 9.18679124184e-03 9.77183223433e-03 1.02846446979e-02 1.06856809758e-02 1.09414577715e-02 - 1.10293847869e-02 1.09414577715e-02 1.06856809758e-02 1.02846446979e-02 9.77183223433e-03 9.18679124184e-03 - 8.57007132232e-03 7.95863052826e-03 7.38252390656e-03 6.86339437793e-03 6.41444748147e-03 6.04118457084e-03 - 5.59978938003e-03 5.51272438194e-03 5.46093720174e-03 5.43377044817e-03 5.42174879265e-03 5.41768978229e-03 - 5.41768978229e-03 5.42174879265e-03 5.43377044817e-03 5.46093720174e-03 5.51272438194e-03 5.59978938003e-03 - 5.73268604942e-03 5.92021996667e-03 6.16759269815e-03 6.47483593539e-03 6.83583874198e-03 7.23785699764e-03 - 7.66146344666e-03 8.08133005705e-03 8.46823559623e-03 8.79214216133e-03 9.02578945364e-03 9.14830218340e-03 - 9.14830218340e-03 9.02578945364e-03 8.79214216133e-03 8.46823559623e-03 8.08133005705e-03 7.66146344666e-03 - 7.23785699764e-03 6.83583874198e-03 6.47483593539e-03 6.16759269815e-03 5.92021996667e-03 5.73268604942e-03 - 5.74257125314e-03 5.77651892440e-03 5.82127807001e-03 5.86418256271e-03 5.89466652251e-03 5.90565973456e-03 - 5.89466652251e-03 5.86418256271e-03 5.82127807001e-03 5.77651892440e-03 5.74257125314e-03 5.73268604942e-03 - 5.75903981319e-03 5.83098728503e-03 5.95356833121e-03 6.12657930585e-03 6.34416762186e-03 6.59479473082e-03 - 6.86170422323e-03 7.12420828954e-03 7.35981258047e-03 7.54684340873e-03 7.66717366082e-03 7.70870330534e-03 - 7.66717366082e-03 7.54684340873e-03 7.35981258047e-03 7.12420828954e-03 6.86170422323e-03 6.59479473082e-03 - 6.34416762186e-03 6.12657930585e-03 5.95356833121e-03 5.83098728503e-03 5.75903981319e-03 5.73268604942e-03 - 6.17967298585e-03 6.31909087196e-03 6.44245195186e-03 6.53448601861e-03 6.58362639444e-03 6.58362639444e-03 - 6.53448601861e-03 6.44245195186e-03 6.31909087196e-03 6.17967298585e-03 6.04118457084e-03 5.92021996667e-03 - 5.83098728503e-03 5.78371930190e-03 5.78371930190e-03 5.83098728503e-03 5.92021996667e-03 6.04118457084e-03 - 6.17967298585e-03 6.31909087196e-03 6.44245195186e-03 6.53448601861e-03 6.58362639444e-03 6.58362639444e-03 - 6.53448601861e-03 6.44245195186e-03 6.31909087196e-03 6.17967298585e-03 6.04118457084e-03 5.92021996667e-03 - 5.83098728503e-03 5.78371930190e-03 5.78371930190e-03 5.83098728503e-03 5.92021996667e-03 6.04118457084e-03 - 6.93665223838e-03 7.16922584820e-03 7.35383003280e-03 7.47255069610e-03 7.51351058269e-03 7.47255069610e-03 - 7.35383003280e-03 7.16922584820e-03 6.93665223838e-03 6.67761981445e-03 6.41444748147e-03 6.16759269815e-03 - 5.95356833121e-03 5.78371930190e-03 5.66378434823e-03 5.59394004869e-03 5.56920678348e-03 5.58034633768e-03 - 5.61528193683e-03 5.66079261571e-03 5.70420021497e-03 5.73495116497e-03 5.74602373426e-03 5.73495116497e-03 - 5.70420021497e-03 5.66079261571e-03 5.61528193683e-03 5.58034633768e-03 5.56920678348e-03 5.59394004869e-03 - 5.66378434823e-03 5.78371930190e-03 5.95356833121e-03 6.16759269815e-03 6.41444748147e-03 6.67761981445e-03 - 8.05519399644e-03 8.36917339040e-03 8.59555582378e-03 8.71419097250e-03 8.71419097250e-03 8.59555582378e-03 - 8.36917339040e-03 8.05519399644e-03 7.68014935330e-03 7.27338017313e-03 6.86339437793e-03 6.47483593539e-03 - 6.12657930585e-03 5.83098728503e-03 5.59394004869e-03 5.41531278039e-03 5.28994524639e-03 5.20914423543e-03 - 5.16243150929e-03 5.13913617973e-03 5.12972310883e-03 5.12697112440e-03 5.12697112440e-03 5.12972310883e-03 - 5.13913617973e-03 5.16243150929e-03 5.20914423543e-03 5.28994524639e-03 5.41531278039e-03 5.59394004869e-03 - 5.83098728503e-03 6.12657930585e-03 6.47483593539e-03 6.86339437793e-03 7.27338017313e-03 7.68014935330e-03 - 9.59384043225e-03 9.97511028176e-03 1.02181471415e-02 1.03016601350e-02 1.02181471415e-02 9.97511028176e-03 - 9.59384043225e-03 9.10613117226e-03 8.54973346172e-03 7.96341795569e-03 7.38252390656e-03 6.83583874198e-03 - 6.34416762186e-03 5.92021996667e-03 5.56920678348e-03 5.28994524639e-03 5.07652462266e-03 4.92029966810e-03 - 4.81172327806e-03 4.74176747355e-03 4.70304044562e-03 4.69069423954e-03 4.70304044562e-03 4.74176747355e-03 - 4.81172327806e-03 4.92029966810e-03 5.07652462266e-03 5.28994524639e-03 5.56920678348e-03 5.92021996667e-03 - 6.34416762186e-03 6.83583874198e-03 7.38252390656e-03 7.96341795569e-03 8.54973346172e-03 9.10613117226e-03 - 1.16276251073e-02 1.20550163598e-02 1.22786655737e-02 1.22786655737e-02 1.20550163598e-02 1.16276251073e-02 - 1.10330000246e-02 1.03186231402e-02 9.53627070961e-03 8.73551184506e-03 7.95863052826e-03 7.23785699764e-03 - 6.59479473082e-03 6.04118457084e-03 5.58034633768e-03 5.20914423543e-03 4.92029966810e-03 4.70458873539e-03 - 4.55262020357e-03 4.45623663297e-03 4.40955813989e-03 4.40955813989e-03 4.45623663297e-03 4.55262020357e-03 - 4.70458873539e-03 4.92029966810e-03 5.20914423543e-03 5.58034633768e-03 6.04118457084e-03 6.59479473082e-03 - 7.23785699764e-03 7.95863052826e-03 8.73551184506e-03 9.53627070961e-03 1.03186231402e-02 1.10330000246e-02 - 1.42425749040e-02 1.46810426016e-02 1.48317912783e-02 1.46810426016e-02 1.42425749040e-02 1.35553259639e-02 - 1.26769712537e-02 1.16751572683e-02 1.06181928008e-02 9.56702175361e-03 8.57007132232e-03 7.66146344666e-03 - 6.86170422323e-03 6.17967298585e-03 5.61528193683e-03 5.16243150929e-03 4.81172327806e-03 4.55262020357e-03 - 4.37525079151e-03 4.27192322596e-03 4.23798561825e-03 4.27192322596e-03 4.37525079151e-03 4.55262020357e-03 - 4.81172327806e-03 5.16243150929e-03 5.61528193683e-03 6.17967298585e-03 6.86170422323e-03 7.66146344666e-03 - 8.57007132232e-03 9.56702175361e-03 1.06181928008e-02 1.16751572683e-02 1.26769712537e-02 1.35553259639e-02 - 1.75241772421e-02 1.79167348748e-02 1.79167348748e-02 1.75241772421e-02 1.67754563001e-02 1.57370100687e-02 - 1.44944499034e-02 1.31397287366e-02 1.17590249893e-02 1.04238516982e-02 9.18679124184e-03 8.08133005705e-03 - 7.12420828954e-03 6.31909087196e-03 5.66079261571e-03 5.13913617973e-03 4.74176747355e-03 4.45623663297e-03 - 4.27192322596e-03 4.18152878343e-03 4.18152878343e-03 4.27192322596e-03 4.45623663297e-03 4.74176747355e-03 - 5.13913617973e-03 5.66079261571e-03 6.31909087196e-03 7.12420828954e-03 8.08133005705e-03 9.18679124184e-03 - 1.04238516982e-02 1.17590249893e-02 1.31397287366e-02 1.44944499034e-02 1.57370100687e-02 1.67754563001e-02 - 2.15413174517e-02 2.18005508565e-02 2.15413174517e-02 2.07887392229e-02 1.96135589165e-02 1.81196807915e-02 - 1.64272283654e-02 1.46550533623e-02 1.29064893850e-02 1.12609832188e-02 9.77183223433e-03 8.46823559623e-03 - 7.35981258047e-03 6.44245195186e-03 5.70420021497e-03 5.12972310883e-03 4.70304044562e-03 4.40955813989e-03 - 4.23798561825e-03 4.18152878343e-03 4.23798561825e-03 4.40955813989e-03 4.70304044562e-03 5.12972310883e-03 - 5.70420021497e-03 6.44245195186e-03 7.35981258047e-03 8.46823559623e-03 9.77183223433e-03 1.12609832188e-02 - 1.29064893850e-02 1.46550533623e-02 1.64272283654e-02 1.81196807915e-02 1.96135589165e-02 2.07887392229e-02 - 2.63252408289e-02 2.63252408289e-02 2.56635113913e-02 2.44059448105e-02 2.26718438342e-02 2.06126999880e-02 - 1.83878553878e-02 1.61427916872e-02 1.39945083398e-02 1.20255038743e-02 1.02846446979e-02 8.79214216133e-03 - 7.54684340873e-03 6.53448601861e-03 5.73495116497e-03 5.12697112440e-03 4.69069423954e-03 4.40955813989e-03 - 4.27192322596e-03 4.27192322596e-03 4.40955813989e-03 4.69069423954e-03 5.12697112440e-03 5.73495116497e-03 - 6.53448601861e-03 7.54684340873e-03 8.79214216133e-03 1.02846446979e-02 1.20255038743e-02 1.39945083398e-02 - 1.61427916872e-02 1.83878553878e-02 2.06126999880e-02 2.26718438342e-02 2.44059448105e-02 2.56635113913e-02 - 3.18414068716e-02 3.14127386696e-02 3.01717861136e-02 2.82446089484e-02 2.58139075627e-02 2.30866420056e-02 - 2.02621880335e-02 1.75083321070e-02 1.49488960464e-02 1.26620800682e-02 1.06856809758e-02 9.02578945364e-03 - 7.66717366082e-03 6.58362639444e-03 5.74602373426e-03 5.12697112440e-03 4.70304044562e-03 4.45623663297e-03 - 4.37525079151e-03 4.45623663297e-03 4.70304044562e-03 5.12697112440e-03 5.74602373426e-03 6.58362639444e-03 - 7.66717366082e-03 9.02578945364e-03 1.06856809758e-02 1.26620800682e-02 1.49488960464e-02 1.75083321070e-02 - 2.02621880335e-02 2.30866420056e-02 2.58139075627e-02 2.82446089484e-02 3.01717861136e-02 3.14127386696e-02 - 3.79563421300e-02 3.68889471691e-02 3.48695445110e-02 3.21049723875e-02 2.88533907006e-02 2.53797852965e-02 - 2.19185274002e-02 1.86504890434e-02 1.56960478729e-02 1.31198380533e-02 1.09414577715e-02 9.14830218340e-03 - 7.70870330534e-03 6.58362639444e-03 5.73495116497e-03 5.12972310883e-03 4.74176747355e-03 4.55262020357e-03 - 4.55262020357e-03 4.74176747355e-03 5.12972310883e-03 5.73495116497e-03 6.58362639444e-03 7.70870330534e-03 - 9.14830218340e-03 1.09414577715e-02 1.31198380533e-02 1.56960478729e-02 1.86504890434e-02 2.19185274002e-02 - 2.53797852965e-02 2.88533907006e-02 3.21049723875e-02 3.48695445110e-02 3.68889471691e-02 3.79563421300e-02 - 4.44094609233e-02 4.24686468881e-02 3.94725484932e-02 3.57259716101e-02 3.15673758761e-02 2.73140021666e-02 - 2.32231030162e-02 1.94746684497e-02 1.61729889157e-02 1.33594815778e-02 1.10293847869e-02 9.14830218340e-03 - 7.66717366082e-03 6.53448601861e-03 5.70420021497e-03 5.13913617973e-03 4.81172327806e-03 4.70458873539e-03 - 4.81172327806e-03 5.13913617973e-03 5.70420021497e-03 6.53448601861e-03 7.66717366082e-03 9.14830218340e-03 - 1.10293847869e-02 1.33594815778e-02 1.61729889157e-02 1.94746684497e-02 2.32231030162e-02 2.73140021666e-02 - 3.15673758761e-02 3.57259716101e-02 3.94725484932e-02 4.24686468881e-02 4.44094609233e-02 4.50819394473e-02 - 5.08044555558e-02 4.77625301985e-02 4.36277000850e-02 3.88104397494e-02 3.37228748044e-02 2.87187367840e-02 - 2.40594329852e-02 1.99070659239e-02 1.63370205752e-02 1.33594815778e-02 1.09414577715e-02 9.02578945364e-03 - 7.54684340873e-03 6.44245195186e-03 5.66079261571e-03 5.16243150929e-03 4.92029966810e-03 4.92029966810e-03 - 5.16243150929e-03 5.66079261571e-03 6.44245195186e-03 7.54684340873e-03 9.02578945364e-03 1.09414577715e-02 - 1.33594815778e-02 1.63370205752e-02 1.99070659239e-02 2.40594329852e-02 2.87187367840e-02 3.37228748044e-02 - 3.88104397494e-02 4.36277000850e-02 4.77625301985e-02 5.08044555558e-02 5.24194501424e-02 5.24194501424e-02 - 5.66331890923e-02 5.23143637463e-02 4.69561004766e-02 4.10670403681e-02 3.51127517762e-02 2.94586793037e-02 - 2.43476957086e-02 1.99070659239e-02 1.61729889157e-02 1.31198380533e-02 1.06856809758e-02 8.79214216133e-03 - 7.35981258047e-03 6.31909087196e-03 5.61528193683e-03 5.20914423543e-03 5.07652462266e-03 5.20914423543e-03 - 5.61528193683e-03 6.31909087196e-03 7.35981258047e-03 8.79214216133e-03 1.06856809758e-02 1.31198380533e-02 - 1.61729889157e-02 1.99070659239e-02 2.43476957086e-02 2.94586793037e-02 3.51127517762e-02 4.10670403681e-02 - 4.69561004766e-02 5.23143637463e-02 5.66331890923e-02 5.94462807362e-02 6.04237632524e-02 5.94462807362e-02 - 6.13379141192e-02 5.56676247698e-02 4.91148354625e-02 4.22610610741e-02 3.55932306397e-02 2.94586793037e-02 - 2.40594329852e-02 1.94746684497e-02 1.56960478729e-02 1.26620800682e-02 1.02846446979e-02 8.46823559623e-03 - 7.12420828954e-03 6.17967298585e-03 5.58034633768e-03 5.28994524639e-03 5.28994524639e-03 5.58034633768e-03 - 6.17967298585e-03 7.12420828954e-03 8.46823559623e-03 1.02846446979e-02 1.26620800682e-02 1.56960478729e-02 - 1.94746684497e-02 2.40594329852e-02 2.94586793037e-02 3.55932306397e-02 4.22610610741e-02 4.91148354625e-02 - 5.56676247698e-02 6.13379141192e-02 6.55352798807e-02 6.77723654588e-02 6.77723654588e-02 6.55352798807e-02 - 6.44054743742e-02 5.74494623672e-02 4.98633146719e-02 4.22610610741e-02 3.51127517762e-02 2.87187367840e-02 - 2.32231030162e-02 1.86504890434e-02 1.49488960464e-02 1.20255038743e-02 9.77183223433e-03 8.08133005705e-03 - 6.86170422323e-03 6.04118457084e-03 5.56920678348e-03 5.41531278039e-03 5.56920678348e-03 6.04118457084e-03 - 6.86170422323e-03 8.08133005705e-03 9.77183223433e-03 1.20255038743e-02 1.49488960464e-02 1.86504890434e-02 - 2.32231030162e-02 2.87187367840e-02 3.51127517762e-02 4.22610610741e-02 4.98633146719e-02 5.74494623672e-02 - 6.44054743742e-02 7.00474085615e-02 7.37387049341e-02 7.50243106749e-02 7.37387049341e-02 7.00474085615e-02 - 6.54719417706e-02 5.74494623672e-02 4.91148354625e-02 4.10670403681e-02 3.37228748044e-02 2.73140021666e-02 - 2.19185274002e-02 1.75083321070e-02 1.39945083398e-02 1.12609832188e-02 9.18679124184e-03 7.66146344666e-03 - 6.59479473082e-03 5.92021996667e-03 5.59394004869e-03 5.59394004869e-03 5.92021996667e-03 6.59479473082e-03 - 7.66146344666e-03 9.18679124184e-03 1.12609832188e-02 1.39945083398e-02 1.75083321070e-02 2.19185274002e-02 - 2.73140021666e-02 3.37228748044e-02 4.10670403681e-02 4.91148354625e-02 5.74494623672e-02 6.54719417706e-02 - 7.24538631804e-02 7.76449689484e-02 8.04193974336e-02 8.04193974336e-02 7.76449689484e-02 7.24538631804e-02 - 6.44054743742e-02 5.56676247698e-02 4.69561004766e-02 3.88104397494e-02 3.15673758761e-02 2.53797852965e-02 - 2.02621880335e-02 1.61427916872e-02 1.29064893850e-02 1.04238516982e-02 8.57007132232e-03 7.23785699764e-03 - 6.34416762186e-03 5.83098728503e-03 5.66378434823e-03 5.83098728503e-03 6.34416762186e-03 7.23785699764e-03 - 8.57007132232e-03 1.04238516982e-02 1.29064893850e-02 1.61427916872e-02 2.02621880335e-02 2.53797852965e-02 - 3.15673758761e-02 3.88104397494e-02 4.69561004766e-02 5.56676247698e-02 6.44054743742e-02 7.24538631804e-02 - 7.90059272690e-02 8.33038946145e-02 8.48028174918e-02 8.33038946145e-02 7.90059272690e-02 7.24538631804e-02 - 6.13379141192e-02 5.23143637463e-02 4.36277000850e-02 3.57259716101e-02 2.88533907006e-02 2.30866420056e-02 - 1.83878553878e-02 1.46550533623e-02 1.17590249893e-02 9.56702175361e-03 7.95863052826e-03 6.83583874198e-03 - 6.12657930585e-03 5.78371930190e-03 5.78371930190e-03 6.12657930585e-03 6.83583874198e-03 7.95863052826e-03 - 9.56702175361e-03 1.17590249893e-02 1.46550533623e-02 1.83878553878e-02 2.30866420056e-02 2.88533907006e-02 - 3.57259716101e-02 4.36277000850e-02 5.23143637463e-02 6.13379141192e-02 7.00474085615e-02 7.76449689484e-02 - 8.33038946145e-02 8.63317298438e-02 8.63317298438e-02 8.33038946145e-02 7.76449689484e-02 7.00474085615e-02 - 5.66331890923e-02 4.77625301985e-02 3.94725484932e-02 3.21049723875e-02 2.58139075627e-02 2.06126999880e-02 - 1.64272283654e-02 1.31397287366e-02 1.06181928008e-02 8.73551184506e-03 7.38252390656e-03 6.47483593539e-03 - 5.95356833121e-03 5.78371930190e-03 5.95356833121e-03 6.47483593539e-03 7.38252390656e-03 8.73551184506e-03 - 1.06181928008e-02 1.31397287366e-02 1.64272283654e-02 2.06126999880e-02 2.58139075627e-02 3.21049723875e-02 - 3.94725484932e-02 4.77625301985e-02 5.66331890923e-02 6.55352798807e-02 7.37387049341e-02 8.04193974336e-02 - 8.48028174918e-02 8.63317298438e-02 8.48028174918e-02 8.04193974336e-02 7.37387049341e-02 6.55352798807e-02 - 5.08044555558e-02 4.24686468881e-02 3.48695445110e-02 2.82446089484e-02 2.26718438342e-02 1.81196807915e-02 - 1.44944499034e-02 1.16751572683e-02 9.53627070961e-03 7.96341795569e-03 6.86339437793e-03 6.16759269815e-03 - 5.83098728503e-03 5.83098728503e-03 6.16759269815e-03 6.86339437793e-03 7.96341795569e-03 9.53627070961e-03 - 1.16751572683e-02 1.44944499034e-02 1.81196807915e-02 2.26718438342e-02 2.82446089484e-02 3.48695445110e-02 - 4.24686468881e-02 5.08044555558e-02 5.94462807362e-02 6.77723654588e-02 7.50243106749e-02 8.04193974336e-02 - 8.33038946145e-02 8.33038946145e-02 8.04193974336e-02 7.50243106749e-02 6.77723654588e-02 5.94462807362e-02 - 4.44094609233e-02 3.68889471691e-02 3.01717861136e-02 2.44059448105e-02 1.96135589165e-02 1.57370100687e-02 - 1.26769712537e-02 1.03186231402e-02 8.54973346172e-03 7.27338017313e-03 6.41444748147e-03 5.92021996667e-03 - 5.75903981319e-03 5.92021996667e-03 6.41444748147e-03 7.27338017313e-03 8.54973346172e-03 1.03186231402e-02 - 1.26769712537e-02 1.57370100687e-02 1.96135589165e-02 2.44059448105e-02 3.01717861136e-02 3.68889471691e-02 - 4.44094609233e-02 5.24194501424e-02 6.04237632524e-02 6.77723654588e-02 7.37387049341e-02 7.76449689484e-02 - 7.90059272690e-02 7.76449689484e-02 7.37387049341e-02 6.77723654588e-02 6.04237632524e-02 5.24194501424e-02 - 3.79563421300e-02 3.14127386696e-02 2.56635113913e-02 2.07887392229e-02 1.67754563001e-02 1.35553259639e-02 - 1.10330000246e-02 9.10613117226e-03 7.68014935330e-03 6.67761981445e-03 6.04118457084e-03 5.73268604942e-03 - 5.73268604942e-03 6.04118457084e-03 6.67761981445e-03 7.68014935330e-03 9.10613117226e-03 1.10330000246e-02 - 1.35553259639e-02 1.67754563001e-02 2.07887392229e-02 2.56635113913e-02 3.14127386696e-02 3.79563421300e-02 - 4.50819394473e-02 5.24194501424e-02 5.94462807362e-02 6.55352798807e-02 7.00474085615e-02 7.24538631804e-02 - 7.24538631804e-02 7.00474085615e-02 6.55352798807e-02 5.94462807362e-02 5.24194501424e-02 4.50819394473e-02 - 2.89647599965e-02 2.40237109616e-02 1.97871783123e-02 1.62588522549e-02 1.33939588194e-02 1.11228159589e-02 - 9.36769905218e-03 8.05519399644e-03 7.12420828954e-03 6.52902358143e-03 6.23916674188e-03 6.23916674188e-03 - 6.52902358143e-03 7.12420828954e-03 8.05519399644e-03 9.36769905218e-03 1.11228159589e-02 1.33939588194e-02 - 1.62588522549e-02 1.97871783123e-02 2.40237109616e-02 2.89647599965e-02 3.45282284639e-02 4.05244812822e-02 - 4.66403070569e-02 5.24477482650e-02 5.74449785733e-02 6.11288569567e-02 6.30873277659e-02 6.30873277659e-02 - 6.11288569567e-02 5.74449785733e-02 5.24477482650e-02 4.66403070569e-02 4.05244812822e-02 3.45282284639e-02 - 2.40237109616e-02 2.00258575799e-02 1.66250325509e-02 1.38094745262e-02 1.15351431719e-02 9.74245511371e-03 - 8.36917339040e-03 7.35981258047e-03 6.67049181789e-03 6.26978037715e-03 6.13840739734e-03 6.26978037715e-03 - 6.67049181789e-03 7.35981258047e-03 8.36917339040e-03 9.74245511371e-03 1.15351431719e-02 1.38094745262e-02 - 1.66250325509e-02 2.00258575799e-02 2.40237109616e-02 2.85763383726e-02 3.35632692529e-02 3.87673596218e-02 - 4.38725463784e-02 4.84855850881e-02 5.21839135623e-02 5.45841783826e-02 5.54167137150e-02 5.45841783826e-02 - 5.21839135623e-02 4.84855850881e-02 4.38725463784e-02 3.87673596218e-02 3.35632692529e-02 2.85763383726e-02 - 1.97871783123e-02 1.66250325509e-02 1.39522993746e-02 1.17508350709e-02 9.98127039361e-03 8.59555582378e-03 - 7.54684340873e-03 6.79567554150e-03 6.31209415558e-03 6.07562992209e-03 6.07562992209e-03 6.31209415558e-03 - 6.79567554150e-03 7.54684340873e-03 8.59555582378e-03 9.98127039361e-03 1.17508350709e-02 1.39522993746e-02 - 1.66250325509e-02 1.97871783123e-02 2.34202555044e-02 2.74512061786e-02 3.17358390207e-02 3.60511821341e-02 - 4.01041807768e-02 4.35604474537e-02 4.60913389830e-02 4.74313143781e-02 4.74313143781e-02 4.60913389830e-02 - 4.35604474537e-02 4.01041807768e-02 3.60511821341e-02 3.17358390207e-02 2.74512061786e-02 2.34202555044e-02 - 1.62588522549e-02 1.38094745262e-02 1.17508350709e-02 1.00633149755e-02 8.71419097250e-03 7.66717366082e-03 - 6.88914005847e-03 6.35335851926e-03 6.04016501968e-03 5.93719631865e-03 6.04016501968e-03 6.35335851926e-03 - 6.88914005847e-03 7.66717366082e-03 8.71419097250e-03 1.00633149755e-02 1.17508350709e-02 1.38094745262e-02 - 1.62588522549e-02 1.90940368490e-02 2.22726314479e-02 2.57019293917e-02 2.92302840650e-02 3.26483588385e-02 - 3.57044700685e-02 3.81345549630e-02 3.97029159910e-02 4.02453701311e-02 3.97029159910e-02 3.81345549630e-02 - 3.57044700685e-02 3.26483588385e-02 2.92302840650e-02 2.57019293917e-02 2.22726314479e-02 1.90940368490e-02 - 1.33939588194e-02 1.15351431719e-02 9.98127039361e-03 8.71419097250e-03 7.70870330534e-03 6.93908976898e-03 - 6.38291972351e-03 6.02253909249e-03 5.84558656512e-03 5.84558656512e-03 6.02253909249e-03 6.38291972351e-03 - 6.93908976898e-03 7.70870330534e-03 8.71419097250e-03 9.98127039361e-03 1.15351431719e-02 1.33939588194e-02 - 1.55601992220e-02 1.80109897723e-02 2.06884779452e-02 2.34923498457e-02 2.62778950395e-02 2.88631293974e-02 - 3.10465495213e-02 3.26341221073e-02 3.34710625414e-02 3.34710625414e-02 3.26341221073e-02 3.10465495213e-02 - 2.88631293974e-02 2.62778950395e-02 2.34923498457e-02 2.06884779452e-02 1.80109897723e-02 1.55601992220e-02 - 1.11228159589e-02 9.74245511371e-03 8.59555582378e-03 7.66717366082e-03 6.93908976898e-03 6.39361872594e-03 - 6.01563766373e-03 5.79365065764e-03 5.72047031573e-03 5.79365065764e-03 6.01563766373e-03 6.39361872594e-03 - 6.93908976898e-03 7.66717366082e-03 8.59555582378e-03 9.74245511371e-03 1.11228159589e-02 1.27424344623e-02 - 1.45906790875e-02 1.66330383744e-02 1.88049742175e-02 2.10090352784e-02 2.31175818882e-02 2.49827563157e-02 - 2.64534808200e-02 2.73972646659e-02 2.77227537368e-02 2.73972646659e-02 2.64534808200e-02 2.49827563157e-02 - 2.31175818882e-02 2.10090352784e-02 1.88049742175e-02 1.66330383744e-02 1.45906790875e-02 1.27424344623e-02 - 9.36769905218e-03 8.36917339040e-03 7.54684340873e-03 6.88914005847e-03 6.38291972351e-03 6.01563766373e-03 - 5.77685140016e-03 5.65928321674e-03 5.65928321674e-03 5.77685140016e-03 6.01563766373e-03 6.38291972351e-03 - 6.88914005847e-03 7.54684340873e-03 8.36917339040e-03 9.36769905218e-03 1.05489279259e-02 1.19093466628e-02 - 1.34297677852e-02 1.50702461704e-02 1.67669692380e-02 1.84326960165e-02 1.99620901041e-02 2.12421582644e-02 - 2.21666114252e-02 2.26519365039e-02 2.26519365039e-02 2.21666114252e-02 2.12421582644e-02 1.99620901041e-02 - 1.84326960165e-02 1.67669692380e-02 1.50702461704e-02 1.34297677852e-02 1.19093466628e-02 1.05489279259e-02 - 8.05519399644e-03 7.35981258047e-03 6.79567554150e-03 6.35335851926e-03 6.02253909249e-03 5.79365065764e-03 - 5.65928321674e-03 5.61497680711e-03 5.65928321674e-03 5.79365065764e-03 6.02253909249e-03 6.35335851926e-03 - 6.79567554150e-03 7.35981258047e-03 8.05519399644e-03 8.88822832040e-03 9.85925299562e-03 1.09586567104e-02 - 1.21629507848e-02 1.34318126710e-02 1.47072813037e-02 1.59162612755e-02 1.69767793036e-02 1.78072941675e-02 - 1.83376793613e-02 1.85201445811e-02 1.83376793613e-02 1.78072941675e-02 1.69767793036e-02 1.59162612755e-02 - 1.47072813037e-02 1.34318126710e-02 1.21629507848e-02 1.09586567104e-02 9.85925299562e-03 8.88822832040e-03 - 7.12420828954e-03 6.67049181789e-03 6.31209415558e-03 6.04016501968e-03 5.84558656512e-03 5.72047031573e-03 - 5.65928321674e-03 5.65928321674e-03 5.72047031573e-03 5.84558656512e-03 6.04016501968e-03 6.31209415558e-03 - 6.67049181789e-03 7.12420828954e-03 7.68014935330e-03 8.34122341388e-03 9.10381322670e-03 9.95507847617e-03 - 1.08706042529e-02 1.18131307076e-02 1.27333396536e-02 1.35733603577e-02 1.42727054437e-02 1.47756456624e-02 - 1.50389831834e-02 1.50389831834e-02 1.47756456624e-02 1.42727054437e-02 1.35733603577e-02 1.27333396536e-02 - 1.18131307076e-02 1.08706042529e-02 9.95507847617e-03 9.10381322670e-03 8.34122341388e-03 7.68014935330e-03 - 6.52902358143e-03 6.26978037715e-03 6.07562992209e-03 5.93719631865e-03 5.84558656512e-03 5.79365065764e-03 - 5.77685140016e-03 5.79365065764e-03 5.84558656512e-03 5.93719631865e-03 6.07562992209e-03 6.26978037715e-03 - 6.52902358143e-03 6.86170422323e-03 7.27338017313e-03 7.76490388909e-03 8.33057919998e-03 8.95658363692e-03 - 9.61987006090e-03 1.02881382638e-02 1.09215936737e-02 1.14766013692e-02 1.19105819676e-02 1.21873907787e-02 - 1.22825573408e-02 1.21873907787e-02 1.19105819676e-02 1.14766013692e-02 1.09215936737e-02 1.02881382638e-02 - 9.61987006090e-03 8.95658363692e-03 8.33057919998e-03 7.76490388909e-03 7.27338017313e-03 6.86170422323e-03 - 6.23916674188e-03 6.13840739734e-03 6.07562992209e-03 6.04016501968e-03 6.02253909249e-03 6.01563766373e-03 - 6.01563766373e-03 6.02253909249e-03 6.04016501968e-03 6.07562992209e-03 6.13840739734e-03 6.23916674188e-03 - 6.38840491477e-03 6.59479473082e-03 6.86339437793e-03 7.19410390186e-03 7.58058258839e-03 8.00955236461e-03 - 8.46060891145e-03 8.90705726329e-03 9.31810768724e-03 9.66211927865e-03 9.91029781221e-03 1.00404664762e-02 - 1.00404664762e-02 9.91029781221e-03 9.66211927865e-03 9.31810768724e-03 8.90705726329e-03 8.46060891145e-03 - 8.00955236461e-03 7.58058258839e-03 7.19410390186e-03 6.86339437793e-03 6.59479473082e-03 6.38840491477e-03 - 6.23916674188e-03 6.26978037715e-03 6.31209415558e-03 6.35335851926e-03 6.38291972351e-03 6.39361872594e-03 - 6.38291972351e-03 6.35335851926e-03 6.31209415558e-03 6.26978037715e-03 6.23916674188e-03 6.23361812745e-03 - 6.26545793635e-03 6.34416762186e-03 6.47483593539e-03 6.65719946009e-03 6.88519888788e-03 7.14689010595e-03 - 7.42492384580e-03 7.69793885145e-03 7.94279014126e-03 8.13716815266e-03 8.26229038338e-03 8.30549434438e-03 - 8.26229038338e-03 8.13716815266e-03 7.94279014126e-03 7.69793885145e-03 7.42492384580e-03 7.14689010595e-03 - 6.88519888788e-03 6.65719946009e-03 6.47483593539e-03 6.34416762186e-03 6.26545793635e-03 6.23361812745e-03 - 6.52902358143e-03 6.67049181789e-03 6.79567554150e-03 6.88914005847e-03 6.93908976898e-03 6.93908976898e-03 - 6.88914005847e-03 6.79567554150e-03 6.67049181789e-03 6.52902358143e-03 6.38840491477e-03 6.26545793635e-03 - 6.17468606834e-03 6.12657930585e-03 6.12657930585e-03 6.17468606834e-03 6.26545793635e-03 6.38840491477e-03 - 6.52902358143e-03 6.67049181789e-03 6.79567554150e-03 6.88914005847e-03 6.93908976898e-03 6.93908976898e-03 - 6.88914005847e-03 6.79567554150e-03 6.67049181789e-03 6.52902358143e-03 6.38840491477e-03 6.26545793635e-03 - 6.17468606834e-03 6.12657930585e-03 6.12657930585e-03 6.17468606834e-03 6.26545793635e-03 6.38840491477e-03 - 7.12420828954e-03 7.35981258047e-03 7.54684340873e-03 7.66717366082e-03 7.70870330534e-03 7.66717366082e-03 - 7.54684340873e-03 7.35981258047e-03 7.12420828954e-03 6.86170422323e-03 6.59479473082e-03 6.34416762186e-03 - 6.12657930585e-03 5.95356833121e-03 5.83098728503e-03 5.75903981319e-03 5.73268604942e-03 5.74257125314e-03 - 5.77651892440e-03 5.82127807001e-03 5.86418256271e-03 5.89466652251e-03 5.90565973456e-03 5.89466652251e-03 - 5.86418256271e-03 5.82127807001e-03 5.77651892440e-03 5.74257125314e-03 5.73268604942e-03 5.75903981319e-03 - 5.83098728503e-03 5.95356833121e-03 6.12657930585e-03 6.34416762186e-03 6.59479473082e-03 6.86170422323e-03 - 8.05519399644e-03 8.36917339040e-03 8.59555582378e-03 8.71419097250e-03 8.71419097250e-03 8.59555582378e-03 - 8.36917339040e-03 8.05519399644e-03 7.68014935330e-03 7.27338017313e-03 6.86339437793e-03 6.47483593539e-03 - 6.12657930585e-03 5.83098728503e-03 5.59394004869e-03 5.41531278039e-03 5.28994524639e-03 5.20914423543e-03 - 5.16243150929e-03 5.13913617973e-03 5.12972310883e-03 5.12697112440e-03 5.12697112440e-03 5.12972310883e-03 - 5.13913617973e-03 5.16243150929e-03 5.20914423543e-03 5.28994524639e-03 5.41531278039e-03 5.59394004869e-03 - 5.83098728503e-03 6.12657930585e-03 6.47483593539e-03 6.86339437793e-03 7.27338017313e-03 7.68014935330e-03 - 9.36769905218e-03 9.74245511371e-03 9.98127039361e-03 1.00633149755e-02 9.98127039361e-03 9.74245511371e-03 - 9.36769905218e-03 8.88822832040e-03 8.34122341388e-03 7.76490388909e-03 7.19410390186e-03 6.65719946009e-03 - 6.17468606834e-03 5.75903981319e-03 5.41531278039e-03 5.14226972170e-03 4.93405372394e-03 4.78210810048e-03 - 4.67692793169e-03 4.60945880297e-03 4.57225197605e-03 4.56041706509e-03 4.57225197605e-03 4.60945880297e-03 - 4.67692793169e-03 4.78210810048e-03 4.93405372394e-03 5.14226972170e-03 5.41531278039e-03 5.75903981319e-03 - 6.17468606834e-03 6.65719946009e-03 7.19410390186e-03 7.76490388909e-03 8.34122341388e-03 8.88822832040e-03 - 1.11228159589e-02 1.15351431719e-02 1.17508350709e-02 1.17508350709e-02 1.15351431719e-02 1.11228159589e-02 - 1.05489279259e-02 9.85925299562e-03 9.10381322670e-03 8.33057919998e-03 7.58058258839e-03 6.88519888788e-03 - 6.26545793635e-03 5.73268604942e-03 5.28994524639e-03 4.93405372394e-03 4.65785937656e-03 4.45230019628e-03 - 4.30805835198e-03 4.21692866215e-03 4.17292027232e-03 4.17292027232e-03 4.21692866215e-03 4.30805835198e-03 - 4.45230019628e-03 4.65785937656e-03 4.93405372394e-03 5.28994524639e-03 5.73268604942e-03 6.26545793635e-03 - 6.88519888788e-03 7.58058258839e-03 8.33057919998e-03 9.10381322670e-03 9.85925299562e-03 1.05489279259e-02 - 1.33939588194e-02 1.38094745262e-02 1.39522993746e-02 1.38094745262e-02 1.33939588194e-02 1.27424344623e-02 - 1.19093466628e-02 1.09586567104e-02 9.95507847617e-03 8.95658363692e-03 8.00955236461e-03 7.14689010595e-03 - 6.38840491477e-03 5.74257125314e-03 5.20914423543e-03 4.78210810048e-03 4.45230019628e-03 4.20942844716e-03 - 4.04374575730e-03 3.94752033538e-03 3.91597292758e-03 3.94752033538e-03 4.04374575730e-03 4.20942844716e-03 - 4.45230019628e-03 4.78210810048e-03 5.20914423543e-03 5.74257125314e-03 6.38840491477e-03 7.14689010595e-03 - 8.00955236461e-03 8.95658363692e-03 9.95507847617e-03 1.09586567104e-02 1.19093466628e-02 1.27424344623e-02 - 1.62588522549e-02 1.66250325509e-02 1.66250325509e-02 1.62588522549e-02 1.55601992220e-02 1.45906790875e-02 - 1.34297677852e-02 1.21629507848e-02 1.08706042529e-02 9.61987006090e-03 8.46060891145e-03 7.42492384580e-03 - 6.52902358143e-03 5.77651892440e-03 5.16243150929e-03 4.67692793169e-03 4.30805835198e-03 4.04374575730e-03 - 3.87358926493e-03 3.79030883078e-03 3.79030883078e-03 3.87358926493e-03 4.04374575730e-03 4.30805835198e-03 - 4.67692793169e-03 5.16243150929e-03 5.77651892440e-03 6.52902358143e-03 7.42492384580e-03 8.46060891145e-03 - 9.61987006090e-03 1.08706042529e-02 1.21629507848e-02 1.34297677852e-02 1.45906790875e-02 1.55601992220e-02 - 1.97871783123e-02 2.00258575799e-02 1.97871783123e-02 1.90940368490e-02 1.80109897723e-02 1.66330383744e-02 - 1.50702461704e-02 1.34318126710e-02 1.18131307076e-02 1.02881382638e-02 8.90705726329e-03 7.69793885145e-03 - 6.67049181789e-03 5.82127807001e-03 5.13913617973e-03 4.60945880297e-03 4.21692866215e-03 3.94752033538e-03 - 3.79030883078e-03 3.73863341678e-03 3.79030883078e-03 3.94752033538e-03 4.21692866215e-03 4.60945880297e-03 - 5.13913617973e-03 5.82127807001e-03 6.67049181789e-03 7.69793885145e-03 8.90705726329e-03 1.02881382638e-02 - 1.18131307076e-02 1.34318126710e-02 1.50702461704e-02 1.66330383744e-02 1.80109897723e-02 1.90940368490e-02 - 2.40237109616e-02 2.40237109616e-02 2.34202555044e-02 2.22726314479e-02 2.06884779452e-02 1.88049742175e-02 - 1.67669692380e-02 1.47072813037e-02 1.27333396536e-02 1.09215936737e-02 9.31810768724e-03 7.94279014126e-03 - 6.79567554150e-03 5.86418256271e-03 5.12972310883e-03 4.57225197605e-03 4.17292027232e-03 3.91597292758e-03 - 3.79030883078e-03 3.79030883078e-03 3.91597292758e-03 4.17292027232e-03 4.57225197605e-03 5.12972310883e-03 - 5.86418256271e-03 6.79567554150e-03 7.94279014126e-03 9.31810768724e-03 1.09215936737e-02 1.27333396536e-02 - 1.47072813037e-02 1.67669692380e-02 1.88049742175e-02 2.06884779452e-02 2.22726314479e-02 2.34202555044e-02 - 2.89647599965e-02 2.85763383726e-02 2.74512061786e-02 2.57019293917e-02 2.34923498457e-02 2.10090352784e-02 - 1.84326960165e-02 1.59162612755e-02 1.35733603577e-02 1.14766013692e-02 9.66211927865e-03 8.13716815266e-03 - 6.88914005847e-03 5.89466652251e-03 5.12697112440e-03 4.56041706509e-03 4.17292027232e-03 3.94752033538e-03 - 3.87358926493e-03 3.94752033538e-03 4.17292027232e-03 4.56041706509e-03 5.12697112440e-03 5.89466652251e-03 - 6.88914005847e-03 8.13716815266e-03 9.66211927865e-03 1.14766013692e-02 1.35733603577e-02 1.59162612755e-02 - 1.84326960165e-02 2.10090352784e-02 2.34923498457e-02 2.57019293917e-02 2.74512061786e-02 2.85763383726e-02 - 3.45282284639e-02 3.35632692529e-02 3.17358390207e-02 2.92302840650e-02 2.62778950395e-02 2.31175818882e-02 - 1.99620901041e-02 1.69767793036e-02 1.42727054437e-02 1.19105819676e-02 9.91029781221e-03 8.26229038338e-03 - 6.93908976898e-03 5.90565973456e-03 5.12697112440e-03 4.57225197605e-03 4.21692866215e-03 4.04374575730e-03 - 4.04374575730e-03 4.21692866215e-03 4.57225197605e-03 5.12697112440e-03 5.90565973456e-03 6.93908976898e-03 - 8.26229038338e-03 9.91029781221e-03 1.19105819676e-02 1.42727054437e-02 1.69767793036e-02 1.99620901041e-02 - 2.31175818882e-02 2.62778950395e-02 2.92302840650e-02 3.17358390207e-02 3.35632692529e-02 3.45282284639e-02 - 4.05244812822e-02 3.87673596218e-02 3.60511821341e-02 3.26483588385e-02 2.88631293974e-02 2.49827563157e-02 - 2.12421582644e-02 1.78072941675e-02 1.47756456624e-02 1.21873907787e-02 1.00404664762e-02 8.30549434438e-03 - 6.93908976898e-03 5.89466652251e-03 5.12972310883e-03 4.60945880297e-03 4.30805835198e-03 4.20942844716e-03 - 4.30805835198e-03 4.60945880297e-03 5.12972310883e-03 5.89466652251e-03 6.93908976898e-03 8.30549434438e-03 - 1.00404664762e-02 1.21873907787e-02 1.47756456624e-02 1.78072941675e-02 2.12421582644e-02 2.49827563157e-02 - 2.88631293974e-02 3.26483588385e-02 3.60511821341e-02 3.87673596218e-02 4.05244812822e-02 4.11328816616e-02 - 4.66403070569e-02 4.38725463784e-02 4.01041807768e-02 3.57044700685e-02 3.10465495213e-02 2.64534808200e-02 - 2.21666114252e-02 1.83376793613e-02 1.50389831834e-02 1.22825573408e-02 1.00404664762e-02 8.26229038338e-03 - 6.88914005847e-03 5.86418256271e-03 5.13913617973e-03 4.67692793169e-03 4.45230019628e-03 4.45230019628e-03 - 4.67692793169e-03 5.13913617973e-03 5.86418256271e-03 6.88914005847e-03 8.26229038338e-03 1.00404664762e-02 - 1.22825573408e-02 1.50389831834e-02 1.83376793613e-02 2.21666114252e-02 2.64534808200e-02 3.10465495213e-02 - 3.57044700685e-02 4.01041807768e-02 4.38725463784e-02 4.66403070569e-02 4.81082332430e-02 4.81082332430e-02 - 5.24477482650e-02 4.84855850881e-02 4.35604474537e-02 3.81345549630e-02 3.26341221073e-02 2.73972646659e-02 - 2.26519365039e-02 1.85201445811e-02 1.50389831834e-02 1.21873907787e-02 9.91029781221e-03 8.13716815266e-03 - 6.79567554150e-03 5.82127807001e-03 5.16243150929e-03 4.78210810048e-03 4.65785937656e-03 4.78210810048e-03 - 5.16243150929e-03 5.82127807001e-03 6.79567554150e-03 8.13716815266e-03 9.91029781221e-03 1.21873907787e-02 - 1.50389831834e-02 1.85201445811e-02 2.26519365039e-02 2.73972646659e-02 3.26341221073e-02 3.81345549630e-02 - 4.35604474537e-02 4.84855850881e-02 5.24477482650e-02 5.50251512552e-02 5.59201471811e-02 5.50251512552e-02 - 5.74449785733e-02 5.21839135623e-02 4.60913389830e-02 3.97029159910e-02 3.34710625414e-02 2.77227537368e-02 - 2.26519365039e-02 1.83376793613e-02 1.47756456624e-02 1.19105819676e-02 9.66211927865e-03 7.94279014126e-03 - 6.67049181789e-03 5.77651892440e-03 5.20914423543e-03 4.93405372394e-03 4.93405372394e-03 5.20914423543e-03 - 5.77651892440e-03 6.67049181789e-03 7.94279014126e-03 9.66211927865e-03 1.19105819676e-02 1.47756456624e-02 - 1.83376793613e-02 2.26519365039e-02 2.77227537368e-02 3.34710625414e-02 3.97029159910e-02 4.60913389830e-02 - 5.21839135623e-02 5.74449785733e-02 6.13334872428e-02 6.34040688222e-02 6.34040688222e-02 6.13334872428e-02 - 6.11288569567e-02 5.45841783826e-02 4.74313143781e-02 4.02453701311e-02 3.34710625414e-02 2.73972646659e-02 - 2.21666114252e-02 1.78072941675e-02 1.42727054437e-02 1.14766013692e-02 9.31810768724e-03 7.69793885145e-03 - 6.52902358143e-03 5.74257125314e-03 5.28994524639e-03 5.14226972170e-03 5.28994524639e-03 5.74257125314e-03 - 6.52902358143e-03 7.69793885145e-03 9.31810768724e-03 1.14766013692e-02 1.42727054437e-02 1.78072941675e-02 - 2.21666114252e-02 2.73972646659e-02 3.34710625414e-02 4.02453701311e-02 4.74313143781e-02 5.45841783826e-02 - 6.11288569567e-02 6.64284767715e-02 6.98920688762e-02 7.10977313661e-02 6.98920688762e-02 6.64284767715e-02 - 6.30873277659e-02 5.54167137150e-02 4.74313143781e-02 3.97029159910e-02 3.26341221073e-02 2.64534808200e-02 - 2.12421582644e-02 1.69767793036e-02 1.35733603577e-02 1.09215936737e-02 8.90705726329e-03 7.42492384580e-03 - 6.38840491477e-03 5.73268604942e-03 5.41531278039e-03 5.41531278039e-03 5.73268604942e-03 6.38840491477e-03 - 7.42492384580e-03 8.90705726329e-03 1.09215936737e-02 1.35733603577e-02 1.69767793036e-02 2.12421582644e-02 - 2.64534808200e-02 3.26341221073e-02 3.97029159910e-02 4.74313143781e-02 5.54167137150e-02 6.30873277659e-02 - 6.97522426294e-02 7.47020608958e-02 7.73458021392e-02 7.73458021392e-02 7.47020608958e-02 6.97522426294e-02 - 6.30873277659e-02 5.45841783826e-02 4.60913389830e-02 3.81345549630e-02 3.10465495213e-02 2.49827563157e-02 - 1.99620901041e-02 1.59162612755e-02 1.27333396536e-02 1.02881382638e-02 8.46060891145e-03 7.14689010595e-03 - 6.26545793635e-03 5.75903981319e-03 5.59394004869e-03 5.75903981319e-03 6.26545793635e-03 7.14689010595e-03 - 8.46060891145e-03 1.02881382638e-02 1.27333396536e-02 1.59162612755e-02 1.99620901041e-02 2.49827563157e-02 - 3.10465495213e-02 3.81345549630e-02 4.60913389830e-02 5.45841783826e-02 6.30873277659e-02 7.09081350393e-02 - 7.72682499914e-02 8.14375530661e-02 8.28911486673e-02 8.14375530661e-02 7.72682499914e-02 7.09081350393e-02 - 6.11288569567e-02 5.21839135623e-02 4.35604474537e-02 3.57044700685e-02 2.88631293974e-02 2.31175818882e-02 - 1.84326960165e-02 1.47072813037e-02 1.18131307076e-02 9.61987006090e-03 8.00955236461e-03 6.88519888788e-03 - 6.17468606834e-03 5.83098728503e-03 5.83098728503e-03 6.17468606834e-03 6.88519888788e-03 8.00955236461e-03 - 9.61987006090e-03 1.18131307076e-02 1.47072813037e-02 1.84326960165e-02 2.31175818882e-02 2.88631293974e-02 - 3.57044700685e-02 4.35604474537e-02 5.21839135623e-02 6.11288569567e-02 6.97522426294e-02 7.72682499914e-02 - 8.28633557769e-02 8.58561529560e-02 8.58561529560e-02 8.28633557769e-02 7.72682499914e-02 6.97522426294e-02 - 5.74449785733e-02 4.84855850881e-02 4.01041807768e-02 3.26483588385e-02 2.62778950395e-02 2.10090352784e-02 - 1.67669692380e-02 1.34318126710e-02 1.08706042529e-02 8.95658363692e-03 7.58058258839e-03 6.65719946009e-03 - 6.12657930585e-03 5.95356833121e-03 6.12657930585e-03 6.65719946009e-03 7.58058258839e-03 8.95658363692e-03 - 1.08706042529e-02 1.34318126710e-02 1.67669692380e-02 2.10090352784e-02 2.62778950395e-02 3.26483588385e-02 - 4.01041807768e-02 4.84855850881e-02 5.74449785733e-02 6.64284767715e-02 7.47020608958e-02 8.14375530661e-02 - 8.58561529560e-02 8.73972293003e-02 8.58561529560e-02 8.14375530661e-02 7.47020608958e-02 6.64284767715e-02 - 5.24477482650e-02 4.38725463784e-02 3.60511821341e-02 2.92302840650e-02 2.34923498457e-02 1.88049742175e-02 - 1.50702461704e-02 1.21629507848e-02 9.95507847617e-03 8.33057919998e-03 7.19410390186e-03 6.47483593539e-03 - 6.12657930585e-03 6.12657930585e-03 6.47483593539e-03 7.19410390186e-03 8.33057919998e-03 9.95507847617e-03 - 1.21629507848e-02 1.50702461704e-02 1.88049742175e-02 2.34923498457e-02 2.92302840650e-02 3.60511821341e-02 - 4.38725463784e-02 5.24477482650e-02 6.13334872428e-02 6.98920688762e-02 7.73458021392e-02 8.28911486673e-02 - 8.58561529560e-02 8.58561529560e-02 8.28911486673e-02 7.73458021392e-02 6.98920688762e-02 6.13334872428e-02 - 4.66403070569e-02 3.87673596218e-02 3.17358390207e-02 2.57019293917e-02 2.06884779452e-02 1.66330383744e-02 - 1.34297677852e-02 1.09586567104e-02 9.10381322670e-03 7.76490388909e-03 6.86339437793e-03 6.34416762186e-03 - 6.17468606834e-03 6.34416762186e-03 6.86339437793e-03 7.76490388909e-03 9.10381322670e-03 1.09586567104e-02 - 1.34297677852e-02 1.66330383744e-02 2.06884779452e-02 2.57019293917e-02 3.17358390207e-02 3.87673596218e-02 - 4.66403070569e-02 5.50251512552e-02 6.34040688222e-02 7.10977313661e-02 7.73458021392e-02 8.14375530661e-02 - 8.28633557769e-02 8.14375530661e-02 7.73458021392e-02 7.10977313661e-02 6.34040688222e-02 5.50251512552e-02 - 4.05244812822e-02 3.35632692529e-02 2.74512061786e-02 2.22726314479e-02 1.80109897723e-02 1.45906790875e-02 - 1.19093466628e-02 9.85925299562e-03 8.34122341388e-03 7.27338017313e-03 6.59479473082e-03 6.26545793635e-03 - 6.26545793635e-03 6.59479473082e-03 7.27338017313e-03 8.34122341388e-03 9.85925299562e-03 1.19093466628e-02 - 1.45906790875e-02 1.80109897723e-02 2.22726314479e-02 2.74512061786e-02 3.35632692529e-02 4.05244812822e-02 - 4.81082332430e-02 5.59201471811e-02 6.34040688222e-02 6.98920688762e-02 7.47020608958e-02 7.72682499914e-02 - 7.72682499914e-02 7.47020608958e-02 6.98920688762e-02 6.34040688222e-02 5.59201471811e-02 4.81082332430e-02 - 3.45282284639e-02 2.85763383726e-02 2.34202555044e-02 1.90940368490e-02 1.55601992220e-02 1.27424344623e-02 - 1.05489279259e-02 8.88822832040e-03 7.68014935330e-03 6.86170422323e-03 6.38840491477e-03 6.23361812745e-03 - 6.38840491477e-03 6.86170422323e-03 7.68014935330e-03 8.88822832040e-03 1.05489279259e-02 1.27424344623e-02 - 1.55601992220e-02 1.90940368490e-02 2.34202555044e-02 2.85763383726e-02 3.45282284639e-02 4.11328816616e-02 - 4.81082332430e-02 5.50251512552e-02 6.13334872428e-02 6.64284767715e-02 6.97522426294e-02 7.09081350393e-02 - 6.97522426294e-02 6.64284767715e-02 6.13334872428e-02 5.50251512552e-02 4.81082332430e-02 4.11328816616e-02 - 2.69304328597e-02 2.25132701769e-02 1.87538902948e-02 1.56375665721e-02 1.31152359900e-02 1.11228159589e-02 - 9.59384043225e-03 8.46823559623e-03 7.69793885145e-03 7.24904282964e-03 7.10160482063e-03 7.24904282964e-03 - 7.69793885145e-03 8.46823559623e-03 9.59384043225e-03 1.11228159589e-02 1.31152359900e-02 1.56375665721e-02 - 1.87538902948e-02 2.25132701769e-02 2.69304328597e-02 3.19590319446e-02 3.74634706166e-02 4.32002938784e-02 - 4.88190878681e-02 5.38883507401e-02 5.79474348197e-02 6.05796981280e-02 6.14923433640e-02 6.05796981280e-02 - 5.79474348197e-02 5.38883507401e-02 4.88190878681e-02 4.32002938784e-02 3.74634706166e-02 3.19590319446e-02 - 2.25132701769e-02 1.89804120902e-02 1.59907282434e-02 1.35231772103e-02 1.15351431719e-02 9.97511028176e-03 - 8.79214216133e-03 7.94279014126e-03 7.39443450458e-03 7.12561826537e-03 7.12561826537e-03 7.39443450458e-03 - 7.94279014126e-03 8.79214216133e-03 9.97511028176e-03 1.15351431719e-02 1.35231772103e-02 1.59907282434e-02 - 1.89804120902e-02 2.25132701769e-02 2.65706573512e-02 3.10717223250e-02 3.58537824974e-02 4.06654278454e-02 - 4.51788789706e-02 4.90231496620e-02 5.18355302331e-02 5.33236907840e-02 5.33236907840e-02 5.18355302331e-02 - 4.90231496620e-02 4.51788789706e-02 4.06654278454e-02 3.58537824974e-02 3.10717223250e-02 2.65706573512e-02 - 1.87538902948e-02 1.59907282434e-02 1.36633879542e-02 1.17508350709e-02 1.02181471415e-02 9.02578945364e-03 - 8.13716815266e-03 7.52314503521e-03 7.16308508658e-03 7.04448483440e-03 7.16308508658e-03 7.52314503521e-03 - 8.13716815266e-03 9.02578945364e-03 1.02181471415e-02 1.17508350709e-02 1.36633879542e-02 1.59907282434e-02 - 1.87538902948e-02 2.19482820950e-02 2.55281844546e-02 2.93901320501e-02 3.33624200108e-02 3.72078996967e-02 - 4.06430475235e-02 4.33721592307e-02 4.51323632879e-02 4.57409612273e-02 4.51323632879e-02 4.33721592307e-02 - 4.06430475235e-02 3.72078996967e-02 3.33624200108e-02 2.93901320501e-02 2.55281844546e-02 2.19482820950e-02 - 1.56375665721e-02 1.35231772103e-02 1.17508350709e-02 1.03016601350e-02 9.14830218340e-03 8.26229038338e-03 - 7.61927184895e-03 7.20097316500e-03 6.99504538611e-03 6.99504538611e-03 7.20097316500e-03 7.61927184895e-03 - 8.26229038338e-03 9.14830218340e-03 1.03016601350e-02 1.17508350709e-02 1.35231772103e-02 1.56375665721e-02 - 1.80960146721e-02 2.08735527936e-02 2.39063871143e-02 2.70818268649e-02 3.02357338101e-02 3.31615306069e-02 - 3.56312088557e-02 3.74259862301e-02 3.83718132369e-02 3.83718132369e-02 3.74259862301e-02 3.56312088557e-02 - 3.31615306069e-02 3.02357338101e-02 2.70818268649e-02 2.39063871143e-02 2.08735527936e-02 1.80960146721e-02 - 1.31152359900e-02 1.15351431719e-02 1.02181471415e-02 9.14830218340e-03 8.30549434438e-03 7.67065297497e-03 - 7.22847713667e-03 6.96786738821e-03 6.88181758770e-03 6.96786738821e-03 7.22847713667e-03 7.67065297497e-03 - 8.30549434438e-03 9.14830218340e-03 1.02181471415e-02 1.15351431719e-02 1.31152359900e-02 1.49636867906e-02 - 1.70678712692e-02 1.93892705934e-02 2.18557815330e-02 2.43576039836e-02 2.67502344749e-02 2.88661050079e-02 - 3.05340710560e-02 3.16041856284e-02 3.19731919657e-02 3.16041856284e-02 3.05340710560e-02 2.88661050079e-02 - 2.67502344749e-02 2.43576039836e-02 2.18557815330e-02 1.93892705934e-02 1.70678712692e-02 1.49636867906e-02 - 1.11228159589e-02 9.97511028176e-03 9.02578945364e-03 8.26229038338e-03 7.67065297497e-03 7.23847314555e-03 - 6.95605972443e-03 6.81664387654e-03 6.81664387654e-03 6.95605972443e-03 7.23847314555e-03 7.67065297497e-03 - 8.26229038338e-03 9.02578945364e-03 9.97511028176e-03 1.11228159589e-02 1.24755048074e-02 1.40283418589e-02 - 1.57591868798e-02 1.76229803621e-02 1.95479913088e-02 2.14361295219e-02 2.31688478126e-02 2.46187421852e-02 - 2.56657154446e-02 2.62153172241e-02 2.62153172241e-02 2.56657154446e-02 2.46187421852e-02 2.31688478126e-02 - 2.14361295219e-02 1.95479913088e-02 1.76229803621e-02 1.57591868798e-02 1.40283418589e-02 1.24755048074e-02 - 9.59384043225e-03 8.79214216133e-03 8.13716815266e-03 7.61927184895e-03 7.22847713667e-03 6.95605972443e-03 - 6.79537428806e-03 6.74228118806e-03 6.79537428806e-03 6.95605972443e-03 7.22847713667e-03 7.61927184895e-03 - 8.13716815266e-03 8.79214216133e-03 9.59384043225e-03 1.05489279259e-02 1.16573532374e-02 1.29079014387e-02 - 1.42737851127e-02 1.57094271493e-02 1.71497889118e-02 1.85132658939e-02 1.97084075068e-02 2.06439962171e-02 - 2.12413612776e-02 2.14468462049e-02 2.12413612776e-02 2.06439962171e-02 1.97084075068e-02 1.85132658939e-02 - 1.71497889118e-02 1.57094271493e-02 1.42737851127e-02 1.29079014387e-02 1.16573532374e-02 1.05489279259e-02 - 8.46823559623e-03 7.94279014126e-03 7.52314503521e-03 7.20097316500e-03 6.96786738821e-03 6.81664387654e-03 - 6.74228118806e-03 6.74228118806e-03 6.81664387654e-03 6.96786738821e-03 7.20097316500e-03 7.52314503521e-03 - 7.94279014126e-03 8.46823559623e-03 9.10613117226e-03 9.85925299562e-03 1.07235056315e-02 1.16845233837e-02 - 1.27148275869e-02 1.37726366090e-02 1.48031251671e-02 1.57423428102e-02 1.65234811342e-02 1.70848695603e-02 - 1.73786828448e-02 1.73786828448e-02 1.70848695603e-02 1.65234811342e-02 1.57423428102e-02 1.48031251671e-02 - 1.37726366090e-02 1.27148275869e-02 1.16845233837e-02 1.07235056315e-02 9.85925299562e-03 9.10613117226e-03 - 7.69793885145e-03 7.39443450458e-03 7.16308508658e-03 6.99504538611e-03 6.88181758770e-03 6.81664387654e-03 - 6.79537428806e-03 6.81664387654e-03 6.88181758770e-03 6.99504538611e-03 7.16308508658e-03 7.39443450458e-03 - 7.69793885145e-03 8.08133005705e-03 8.54973346172e-03 9.10381322670e-03 9.73748464183e-03 1.04356792319e-02 - 1.11729588764e-02 1.19137265332e-02 1.26143883181e-02 1.32272933414e-02 1.37059602390e-02 1.40109856905e-02 - 1.41157952825e-02 1.40109856905e-02 1.37059602390e-02 1.32272933414e-02 1.26143883181e-02 1.19137265332e-02 - 1.11729588764e-02 1.04356792319e-02 9.73748464183e-03 9.10381322670e-03 8.54973346172e-03 8.08133005705e-03 - 7.24904282964e-03 7.12561826537e-03 7.04448483440e-03 6.99504538611e-03 6.96786738821e-03 6.95605972443e-03 - 6.95605972443e-03 6.96786738821e-03 6.99504538611e-03 7.04448483440e-03 7.12561826537e-03 7.24904282964e-03 - 7.42492384580e-03 7.66146344666e-03 7.96341795569e-03 8.33057919998e-03 8.75631776595e-03 9.22648243576e-03 - 9.71912104775e-03 1.02054916185e-02 1.06524671204e-02 1.10259974674e-02 1.12951380995e-02 1.14361707830e-02 - 1.14361707830e-02 1.12951380995e-02 1.10259974674e-02 1.06524671204e-02 1.02054916185e-02 9.71912104775e-03 - 9.22648243576e-03 8.75631776595e-03 8.33057919998e-03 7.96341795569e-03 7.66146344666e-03 7.42492384580e-03 - 7.10160482063e-03 7.12561826537e-03 7.16308508658e-03 7.20097316500e-03 7.22847713667e-03 7.23847314555e-03 - 7.22847713667e-03 7.20097316500e-03 7.16308508658e-03 7.12561826537e-03 7.10160482063e-03 7.10459522193e-03 - 7.14689010595e-03 7.23785699764e-03 7.38252390656e-03 7.58058258839e-03 7.82576853226e-03 8.10563303358e-03 - 8.40200942373e-03 8.69246386814e-03 8.95261635749e-03 9.15892896774e-03 9.29162040305e-03 9.33741418467e-03 - 9.29162040305e-03 9.15892896774e-03 8.95261635749e-03 8.69246386814e-03 8.40200942373e-03 8.10563303358e-03 - 7.82576853226e-03 7.58058258839e-03 7.38252390656e-03 7.23785699764e-03 7.14689010595e-03 7.10459522193e-03 - 7.24904282964e-03 7.39443450458e-03 7.52314503521e-03 7.61927184895e-03 7.67065297497e-03 7.67065297497e-03 - 7.61927184895e-03 7.52314503521e-03 7.39443450458e-03 7.24904282964e-03 7.10459522193e-03 6.97836085285e-03 - 6.88519888788e-03 6.83583874198e-03 6.83583874198e-03 6.88519888788e-03 6.97836085285e-03 7.10459522193e-03 - 7.24904282964e-03 7.39443450458e-03 7.52314503521e-03 7.61927184895e-03 7.67065297497e-03 7.67065297497e-03 - 7.61927184895e-03 7.52314503521e-03 7.39443450458e-03 7.24904282964e-03 7.10459522193e-03 6.97836085285e-03 - 6.88519888788e-03 6.83583874198e-03 6.83583874198e-03 6.88519888788e-03 6.97836085285e-03 7.10459522193e-03 - 7.69793885145e-03 7.94279014126e-03 8.13716815266e-03 8.26229038338e-03 8.30549434438e-03 8.26229038338e-03 - 8.13716815266e-03 7.94279014126e-03 7.69793885145e-03 7.42492384580e-03 7.14689010595e-03 6.88519888788e-03 - 6.65719946009e-03 6.47483593539e-03 6.34416762186e-03 6.26545793635e-03 6.23361812745e-03 6.23916674188e-03 - 6.26978037715e-03 6.31209415558e-03 6.35335851926e-03 6.38291972351e-03 6.39361872594e-03 6.38291972351e-03 - 6.35335851926e-03 6.31209415558e-03 6.26978037715e-03 6.23916674188e-03 6.23361812745e-03 6.26545793635e-03 - 6.34416762186e-03 6.47483593539e-03 6.65719946009e-03 6.88519888788e-03 7.14689010595e-03 7.42492384580e-03 - 8.46823559623e-03 8.79214216133e-03 9.02578945364e-03 9.14830218340e-03 9.14830218340e-03 9.02578945364e-03 - 8.79214216133e-03 8.46823559623e-03 8.08133005705e-03 7.66146344666e-03 7.23785699764e-03 6.83583874198e-03 - 6.47483593539e-03 6.16759269815e-03 5.92021996667e-03 5.73268604942e-03 5.59978938003e-03 5.51272438194e-03 - 5.46093720174e-03 5.43377044817e-03 5.42174879265e-03 5.41768978229e-03 5.41768978229e-03 5.42174879265e-03 - 5.43377044817e-03 5.46093720174e-03 5.51272438194e-03 5.59978938003e-03 5.73268604942e-03 5.92021996667e-03 - 6.16759269815e-03 6.47483593539e-03 6.83583874198e-03 7.23785699764e-03 7.66146344666e-03 8.08133005705e-03 - 9.59384043225e-03 9.97511028176e-03 1.02181471415e-02 1.03016601350e-02 1.02181471415e-02 9.97511028176e-03 - 9.59384043225e-03 9.10613117226e-03 8.54973346172e-03 7.96341795569e-03 7.38252390656e-03 6.83583874198e-03 - 6.34416762186e-03 5.92021996667e-03 5.56920678348e-03 5.28994524639e-03 5.07652462266e-03 4.92029966810e-03 - 4.81172327806e-03 4.74176747355e-03 4.70304044562e-03 4.69069423954e-03 4.70304044562e-03 4.74176747355e-03 - 4.81172327806e-03 4.92029966810e-03 5.07652462266e-03 5.28994524639e-03 5.56920678348e-03 5.92021996667e-03 - 6.34416762186e-03 6.83583874198e-03 7.38252390656e-03 7.96341795569e-03 8.54973346172e-03 9.10613117226e-03 - 1.11228159589e-02 1.15351431719e-02 1.17508350709e-02 1.17508350709e-02 1.15351431719e-02 1.11228159589e-02 - 1.05489279259e-02 9.85925299562e-03 9.10381322670e-03 8.33057919998e-03 7.58058258839e-03 6.88519888788e-03 - 6.26545793635e-03 5.73268604942e-03 5.28994524639e-03 4.93405372394e-03 4.65785937656e-03 4.45230019628e-03 - 4.30805835198e-03 4.21692866215e-03 4.17292027232e-03 4.17292027232e-03 4.21692866215e-03 4.30805835198e-03 - 4.45230019628e-03 4.65785937656e-03 4.93405372394e-03 5.28994524639e-03 5.73268604942e-03 6.26545793635e-03 - 6.88519888788e-03 7.58058258839e-03 8.33057919998e-03 9.10381322670e-03 9.85925299562e-03 1.05489279259e-02 - 1.31152359900e-02 1.35231772103e-02 1.36633879542e-02 1.35231772103e-02 1.31152359900e-02 1.24755048074e-02 - 1.16573532374e-02 1.07235056315e-02 9.73748464183e-03 8.75631776595e-03 7.82576853226e-03 6.97836085285e-03 - 6.23361812745e-03 5.59978938003e-03 5.07652462266e-03 4.65785937656e-03 4.33477840900e-03 4.09713024865e-03 - 3.93522801758e-03 3.84131375804e-03 3.81054695208e-03 3.84131375804e-03 3.93522801758e-03 4.09713024865e-03 - 4.33477840900e-03 4.65785937656e-03 5.07652462266e-03 5.59978938003e-03 6.23361812745e-03 6.97836085285e-03 - 7.82576853226e-03 8.75631776595e-03 9.73748464183e-03 1.07235056315e-02 1.16573532374e-02 1.24755048074e-02 - 1.56375665721e-02 1.59907282434e-02 1.59907282434e-02 1.56375665721e-02 1.49636867906e-02 1.40283418589e-02 - 1.29079014387e-02 1.16845233837e-02 1.04356792319e-02 9.22648243576e-03 8.10563303358e-03 7.10459522193e-03 - 6.23916674188e-03 5.51272438194e-03 4.92029966810e-03 4.45230019628e-03 4.09713024865e-03 3.84302280796e-03 - 3.67971968314e-03 3.59990872378e-03 3.59990872378e-03 3.67971968314e-03 3.84302280796e-03 4.09713024865e-03 - 4.45230019628e-03 4.92029966810e-03 5.51272438194e-03 6.23916674188e-03 7.10459522193e-03 8.10563303358e-03 - 9.22648243576e-03 1.04356792319e-02 1.16845233837e-02 1.29079014387e-02 1.40283418589e-02 1.49636867906e-02 - 1.87538902948e-02 1.89804120902e-02 1.87538902948e-02 1.80960146721e-02 1.70678712692e-02 1.57591868798e-02 - 1.42737851127e-02 1.27148275869e-02 1.11729588764e-02 9.71912104775e-03 8.40200942373e-03 7.24904282964e-03 - 6.26978037715e-03 5.46093720174e-03 4.81172327806e-03 4.30805835198e-03 3.93522801758e-03 3.67971968314e-03 - 3.53085792774e-03 3.48198055848e-03 3.53085792774e-03 3.67971968314e-03 3.93522801758e-03 4.30805835198e-03 - 4.81172327806e-03 5.46093720174e-03 6.26978037715e-03 7.24904282964e-03 8.40200942373e-03 9.71912104775e-03 - 1.11729588764e-02 1.27148275869e-02 1.42737851127e-02 1.57591868798e-02 1.70678712692e-02 1.80960146721e-02 - 2.25132701769e-02 2.25132701769e-02 2.19482820950e-02 2.08735527936e-02 1.93892705934e-02 1.76229803621e-02 - 1.57094271493e-02 1.37726366090e-02 1.19137265332e-02 1.02054916185e-02 8.69246386814e-03 7.39443450458e-03 - 6.31209415558e-03 5.43377044817e-03 4.74176747355e-03 4.21692866215e-03 3.84131375804e-03 3.59990872378e-03 - 3.48198055848e-03 3.48198055848e-03 3.59990872378e-03 3.84131375804e-03 4.21692866215e-03 4.74176747355e-03 - 5.43377044817e-03 6.31209415558e-03 7.39443450458e-03 8.69246386814e-03 1.02054916185e-02 1.19137265332e-02 - 1.37726366090e-02 1.57094271493e-02 1.76229803621e-02 1.93892705934e-02 2.08735527936e-02 2.19482820950e-02 - 2.69304328597e-02 2.65706573512e-02 2.55281844546e-02 2.39063871143e-02 2.18557815330e-02 1.95479913088e-02 - 1.71497889118e-02 1.48031251671e-02 1.26143883181e-02 1.06524671204e-02 8.95261635749e-03 7.52314503521e-03 - 6.35335851926e-03 5.42174879265e-03 4.70304044562e-03 4.17292027232e-03 3.81054695208e-03 3.59990872378e-03 - 3.53085792774e-03 3.59990872378e-03 3.81054695208e-03 4.17292027232e-03 4.70304044562e-03 5.42174879265e-03 - 6.35335851926e-03 7.52314503521e-03 8.95261635749e-03 1.06524671204e-02 1.26143883181e-02 1.48031251671e-02 - 1.71497889118e-02 1.95479913088e-02 2.18557815330e-02 2.39063871143e-02 2.55281844546e-02 2.65706573512e-02 - 3.19590319446e-02 3.10717223250e-02 2.93901320501e-02 2.70818268649e-02 2.43576039836e-02 2.14361295219e-02 - 1.85132658939e-02 1.57423428102e-02 1.32272933414e-02 1.10259974674e-02 9.15892896774e-03 7.61927184895e-03 - 6.38291972351e-03 5.41768978229e-03 4.69069423954e-03 4.17292027232e-03 3.84131375804e-03 3.67971968314e-03 - 3.67971968314e-03 3.84131375804e-03 4.17292027232e-03 4.69069423954e-03 5.41768978229e-03 6.38291972351e-03 - 7.61927184895e-03 9.15892896774e-03 1.10259974674e-02 1.32272933414e-02 1.57423428102e-02 1.85132658939e-02 - 2.14361295219e-02 2.43576039836e-02 2.70818268649e-02 2.93901320501e-02 3.10717223250e-02 3.19590319446e-02 - 3.74634706166e-02 3.58537824974e-02 3.33624200108e-02 3.02357338101e-02 2.67502344749e-02 2.31688478126e-02 - 1.97084075068e-02 1.65234811342e-02 1.37059602390e-02 1.12951380995e-02 9.29162040305e-03 7.67065297497e-03 - 6.39361872594e-03 5.41768978229e-03 4.70304044562e-03 4.21692866215e-03 3.93522801758e-03 3.84302280796e-03 - 3.93522801758e-03 4.21692866215e-03 4.70304044562e-03 5.41768978229e-03 6.39361872594e-03 7.67065297497e-03 - 9.29162040305e-03 1.12951380995e-02 1.37059602390e-02 1.65234811342e-02 1.97084075068e-02 2.31688478126e-02 - 2.67502344749e-02 3.02357338101e-02 3.33624200108e-02 3.58537824974e-02 3.74634706166e-02 3.80204685260e-02 - 4.32002938784e-02 4.06654278454e-02 3.72078996967e-02 3.31615306069e-02 2.88661050079e-02 2.46187421852e-02 - 2.06439962171e-02 1.70848695603e-02 1.40109856905e-02 1.14361707830e-02 9.33741418467e-03 7.67065297497e-03 - 6.38291972351e-03 5.42174879265e-03 4.74176747355e-03 4.30805835198e-03 4.09713024865e-03 4.09713024865e-03 - 4.30805835198e-03 4.74176747355e-03 5.42174879265e-03 6.38291972351e-03 7.67065297497e-03 9.33741418467e-03 - 1.14361707830e-02 1.40109856905e-02 1.70848695603e-02 2.06439962171e-02 2.46187421852e-02 2.88661050079e-02 - 3.31615306069e-02 3.72078996967e-02 4.06654278454e-02 4.32002938784e-02 4.45431970579e-02 4.45431970579e-02 - 4.88190878681e-02 4.51788789706e-02 4.06430475235e-02 3.56312088557e-02 3.05340710560e-02 2.56657154446e-02 - 2.12413612776e-02 1.73786828448e-02 1.41157952825e-02 1.14361707830e-02 9.29162040305e-03 7.61927184895e-03 - 6.35335851926e-03 5.43377044817e-03 4.81172327806e-03 4.45230019628e-03 4.33477840900e-03 4.45230019628e-03 - 4.81172327806e-03 5.43377044817e-03 6.35335851926e-03 7.61927184895e-03 9.29162040305e-03 1.14361707830e-02 - 1.41157952825e-02 1.73786828448e-02 2.12413612776e-02 2.56657154446e-02 3.05340710560e-02 3.56312088557e-02 - 4.06430475235e-02 4.51788789706e-02 4.88190878681e-02 5.11831265828e-02 5.20033431247e-02 5.11831265828e-02 - 5.38883507401e-02 4.90231496620e-02 4.33721592307e-02 3.74259862301e-02 3.16041856284e-02 2.62153172241e-02 - 2.14468462049e-02 1.73786828448e-02 1.40109856905e-02 1.12951380995e-02 9.15892896774e-03 7.52314503521e-03 - 6.31209415558e-03 5.46093720174e-03 4.92029966810e-03 4.65785937656e-03 4.65785937656e-03 4.92029966810e-03 - 5.46093720174e-03 6.31209415558e-03 7.52314503521e-03 9.15892896774e-03 1.12951380995e-02 1.40109856905e-02 - 1.73786828448e-02 2.14468462049e-02 2.62153172241e-02 3.16041856284e-02 3.74259862301e-02 4.33721592307e-02 - 4.90231496620e-02 5.38883507401e-02 5.74762428735e-02 5.93841418824e-02 5.93841418824e-02 5.74762428735e-02 - 5.79474348197e-02 5.18355302331e-02 4.51323632879e-02 3.83718132369e-02 3.19731919657e-02 2.62153172241e-02 - 2.12413612776e-02 1.70848695603e-02 1.37059602390e-02 1.10259974674e-02 8.95261635749e-03 7.39443450458e-03 - 6.26978037715e-03 5.51272438194e-03 5.07652462266e-03 4.93405372394e-03 5.07652462266e-03 5.51272438194e-03 - 6.26978037715e-03 7.39443450458e-03 8.95261635749e-03 1.10259974674e-02 1.37059602390e-02 1.70848695603e-02 - 2.12413612776e-02 2.62153172241e-02 3.19731919657e-02 3.83718132369e-02 4.51323632879e-02 5.18355302331e-02 - 5.79474348197e-02 6.28828729732e-02 6.61022866145e-02 6.72218662363e-02 6.61022866145e-02 6.28828729732e-02 - 6.05796981280e-02 5.33236907840e-02 4.57409612273e-02 3.83718132369e-02 3.16041856284e-02 2.56657154446e-02 - 2.06439962171e-02 1.65234811342e-02 1.32272933414e-02 1.06524671204e-02 8.69246386814e-03 7.24904282964e-03 - 6.23916674188e-03 5.59978938003e-03 5.28994524639e-03 5.28994524639e-03 5.59978938003e-03 6.23916674188e-03 - 7.24904282964e-03 8.69246386814e-03 1.06524671204e-02 1.32272933414e-02 1.65234811342e-02 2.06439962171e-02 - 2.56657154446e-02 3.16041856284e-02 3.83718132369e-02 4.57409612273e-02 5.33236907840e-02 6.05796981280e-02 - 6.68641206041e-02 7.15201290633e-02 7.40032629540e-02 7.40032629540e-02 7.15201290633e-02 6.68641206041e-02 - 6.14923433640e-02 5.33236907840e-02 4.51323632879e-02 3.74259862301e-02 3.05340710560e-02 2.46187421852e-02 - 1.97084075068e-02 1.57423428102e-02 1.26143883181e-02 1.02054916185e-02 8.40200942373e-03 7.10459522193e-03 - 6.23361812745e-03 5.73268604942e-03 5.56920678348e-03 5.73268604942e-03 6.23361812745e-03 7.10459522193e-03 - 8.40200942373e-03 1.02054916185e-02 1.26143883181e-02 1.57423428102e-02 1.97084075068e-02 2.46187421852e-02 - 3.05340710560e-02 3.74259862301e-02 4.51323632879e-02 5.33236907840e-02 6.14923433640e-02 6.89793219251e-02 - 7.50510418428e-02 7.90236437036e-02 8.04073084192e-02 7.90236437036e-02 7.50510418428e-02 6.89793219251e-02 - 6.05796981280e-02 5.18355302331e-02 4.33721592307e-02 3.56312088557e-02 2.88661050079e-02 2.31688478126e-02 - 1.85132658939e-02 1.48031251671e-02 1.19137265332e-02 9.71912104775e-03 8.10563303358e-03 6.97836085285e-03 - 6.26545793635e-03 5.92021996667e-03 5.92021996667e-03 6.26545793635e-03 6.97836085285e-03 8.10563303358e-03 - 9.71912104775e-03 1.19137265332e-02 1.48031251671e-02 1.85132658939e-02 2.31688478126e-02 2.88661050079e-02 - 3.56312088557e-02 4.33721592307e-02 5.18355302331e-02 6.05796981280e-02 6.89793219251e-02 7.62783857555e-02 - 8.16998180862e-02 8.45957298814e-02 8.45957298814e-02 8.16998180862e-02 7.62783857555e-02 6.89793219251e-02 - 5.79474348197e-02 4.90231496620e-02 4.06430475235e-02 3.31615306069e-02 2.67502344749e-02 2.14361295219e-02 - 1.71497889118e-02 1.37726366090e-02 1.11729588764e-02 9.22648243576e-03 7.82576853226e-03 6.88519888788e-03 - 6.34416762186e-03 6.16759269815e-03 6.34416762186e-03 6.88519888788e-03 7.82576853226e-03 9.22648243576e-03 - 1.11729588764e-02 1.37726366090e-02 1.71497889118e-02 2.14361295219e-02 2.67502344749e-02 3.31615306069e-02 - 4.06430475235e-02 4.90231496620e-02 5.79474348197e-02 6.68641206041e-02 7.50510418428e-02 8.16998180862e-02 - 8.60542685404e-02 8.75716967614e-02 8.60542685404e-02 8.16998180862e-02 7.50510418428e-02 6.68641206041e-02 - 5.38883507401e-02 4.51788789706e-02 3.72078996967e-02 3.02357338101e-02 2.43576039836e-02 1.95479913088e-02 - 1.57094271493e-02 1.27148275869e-02 1.04356792319e-02 8.75631776595e-03 7.58058258839e-03 6.83583874198e-03 - 6.47483593539e-03 6.47483593539e-03 6.83583874198e-03 7.58058258839e-03 8.75631776595e-03 1.04356792319e-02 - 1.27148275869e-02 1.57094271493e-02 1.95479913088e-02 2.43576039836e-02 3.02357338101e-02 3.72078996967e-02 - 4.51788789706e-02 5.38883507401e-02 6.28828729732e-02 7.15201290633e-02 7.90236437036e-02 8.45957298814e-02 - 8.75716967614e-02 8.75716967614e-02 8.45957298814e-02 7.90236437036e-02 7.15201290633e-02 6.28828729732e-02 - 4.88190878681e-02 4.06654278454e-02 3.33624200108e-02 2.70818268649e-02 2.18557815330e-02 1.76229803621e-02 - 1.42737851127e-02 1.16845233837e-02 9.73748464183e-03 8.33057919998e-03 7.38252390656e-03 6.83583874198e-03 - 6.65719946009e-03 6.83583874198e-03 7.38252390656e-03 8.33057919998e-03 9.73748464183e-03 1.16845233837e-02 - 1.42737851127e-02 1.76229803621e-02 2.18557815330e-02 2.70818268649e-02 3.33624200108e-02 4.06654278454e-02 - 4.88190878681e-02 5.74762428735e-02 6.61022866145e-02 7.40032629540e-02 8.04073084192e-02 8.45957298814e-02 - 8.60542685404e-02 8.45957298814e-02 8.04073084192e-02 7.40032629540e-02 6.61022866145e-02 5.74762428735e-02 - 4.32002938784e-02 3.58537824974e-02 2.93901320501e-02 2.39063871143e-02 1.93892705934e-02 1.57591868798e-02 - 1.29079014387e-02 1.07235056315e-02 9.10381322670e-03 7.96341795569e-03 7.23785699764e-03 6.88519888788e-03 - 6.88519888788e-03 7.23785699764e-03 7.96341795569e-03 9.10381322670e-03 1.07235056315e-02 1.29079014387e-02 - 1.57591868798e-02 1.93892705934e-02 2.39063871143e-02 2.93901320501e-02 3.58537824974e-02 4.32002938784e-02 - 5.11831265828e-02 5.93841418824e-02 6.72218662363e-02 7.40032629540e-02 7.90236437036e-02 8.16998180862e-02 - 8.16998180862e-02 7.90236437036e-02 7.40032629540e-02 6.72218662363e-02 5.93841418824e-02 5.11831265828e-02 - 3.74634706166e-02 3.10717223250e-02 2.55281844546e-02 2.08735527936e-02 1.70678712692e-02 1.40283418589e-02 - 1.16573532374e-02 9.85925299562e-03 8.54973346172e-03 7.66146344666e-03 7.14689010595e-03 6.97836085285e-03 - 7.14689010595e-03 7.66146344666e-03 8.54973346172e-03 9.85925299562e-03 1.16573532374e-02 1.40283418589e-02 - 1.70678712692e-02 2.08735527936e-02 2.55281844546e-02 3.10717223250e-02 3.74634706166e-02 4.45431970579e-02 - 5.20033431247e-02 5.93841418824e-02 6.61022866145e-02 7.15201290633e-02 7.50510418428e-02 7.62783857555e-02 - 7.50510418428e-02 7.15201290633e-02 6.61022866145e-02 5.93841418824e-02 5.20033431247e-02 4.45431970579e-02 - 3.19590319446e-02 2.65706573512e-02 2.19482820950e-02 1.80960146721e-02 1.49636867906e-02 1.24755048074e-02 - 1.05489279259e-02 9.10613117226e-03 8.08133005705e-03 7.42492384580e-03 7.10459522193e-03 7.10459522193e-03 - 7.42492384580e-03 8.08133005705e-03 9.10613117226e-03 1.05489279259e-02 1.24755048074e-02 1.49636867906e-02 - 1.80960146721e-02 2.19482820950e-02 2.65706573512e-02 3.19590319446e-02 3.80204685260e-02 4.45431970579e-02 - 5.11831265828e-02 5.74762428735e-02 6.28828729732e-02 6.68641206041e-02 6.89793219251e-02 6.89793219251e-02 - 6.68641206041e-02 6.28828729732e-02 5.74762428735e-02 5.11831265828e-02 4.45431970579e-02 3.80204685260e-02 - 2.57176061925e-02 2.17657781241e-02 1.84129279741e-02 1.56375665721e-02 1.33939588194e-02 1.16276251073e-02 - 1.02846446979e-02 9.31810768724e-03 8.69246386814e-03 8.38500711079e-03 8.38500711079e-03 8.69246386814e-03 - 9.31810768724e-03 1.02846446979e-02 1.16276251073e-02 1.33939588194e-02 1.56375665721e-02 1.84129279741e-02 - 2.17657781241e-02 2.57176061925e-02 3.02423286704e-02 3.52402742752e-02 4.05199675384e-02 4.57968161948e-02 - 5.07121410456e-02 5.48714786192e-02 5.78981879671e-02 5.94941697642e-02 5.94941697642e-02 5.78981879671e-02 - 5.48714786192e-02 5.07121410456e-02 4.57968161948e-02 4.05199675384e-02 3.52402742752e-02 3.02423286704e-02 - 2.17657781241e-02 1.86354478304e-02 1.59907282434e-02 1.38094745262e-02 1.20550163598e-02 1.06856809758e-02 - 9.66211927865e-03 8.95261635749e-03 8.53524112695e-03 8.39746782805e-03 8.53524112695e-03 8.95261635749e-03 - 9.66211927865e-03 1.06856809758e-02 1.20550163598e-02 1.38094745262e-02 1.59907282434e-02 1.86354478304e-02 - 2.17657781241e-02 2.53749373622e-02 2.94074293899e-02 3.37399765679e-02 3.81729635435e-02 4.24386109393e-02 - 4.62258246981e-02 4.92182336225e-02 5.11403130173e-02 5.18034033720e-02 5.11403130173e-02 4.92182336225e-02 - 4.62258246981e-02 4.24386109393e-02 3.81729635435e-02 3.37399765679e-02 2.94074293899e-02 2.53749373622e-02 - 1.84129279741e-02 1.59907282434e-02 1.39522993746e-02 1.22786655737e-02 1.09414577715e-02 9.91029781221e-03 - 9.15892896774e-03 8.66817035987e-03 8.42580807925e-03 8.42580807925e-03 8.66817035987e-03 9.15892896774e-03 - 9.91029781221e-03 1.09414577715e-02 1.22786655737e-02 1.39522993746e-02 1.59907282434e-02 1.84129279741e-02 - 2.12198093897e-02 2.43819637041e-02 2.78244998346e-02 3.14154606035e-02 3.49654910486e-02 3.82415861113e-02 - 4.09927131873e-02 4.29832635915e-02 4.40291518527e-02 4.40291518527e-02 4.29832635915e-02 4.09927131873e-02 - 3.82415861113e-02 3.49654910486e-02 3.14154606035e-02 2.78244998346e-02 2.43819637041e-02 2.12198093897e-02 - 1.56375665721e-02 1.38094745262e-02 1.22786655737e-02 1.10293847869e-02 1.00404664762e-02 9.29162040305e-03 - 8.76725594498e-03 8.45686847188e-03 8.35413904759e-03 8.45686847188e-03 8.76725594498e-03 9.29162040305e-03 - 1.00404664762e-02 1.10293847869e-02 1.22786655737e-02 1.38094745262e-02 1.56375665721e-02 1.77666865554e-02 - 2.01812628043e-02 2.28368095394e-02 2.56499234494e-02 2.84935612207e-02 3.12022017908e-02 3.35871770820e-02 - 3.54595415232e-02 3.66568505349e-02 3.70689589239e-02 3.66568505349e-02 3.54595415232e-02 3.35871770820e-02 - 3.12022017908e-02 2.84935612207e-02 2.56499234494e-02 2.28368095394e-02 2.01812628043e-02 1.77666865554e-02 - 1.33939588194e-02 1.20550163598e-02 1.09414577715e-02 1.00404664762e-02 9.33741418467e-03 8.82009872524e-03 - 8.47998103933e-03 8.31144312544e-03 8.31144312544e-03 8.47998103933e-03 8.82009872524e-03 9.33741418467e-03 - 1.00404664762e-02 1.09414577715e-02 1.20550163598e-02 1.33939588194e-02 1.49636867906e-02 1.67567114426e-02 - 1.87467470027e-02 2.08820531014e-02 2.30804654510e-02 2.52298202509e-02 2.71955666447e-02 2.88348357920e-02 - 3.00149219248e-02 3.06330408871e-02 3.06330408871e-02 3.00149219248e-02 2.88348357920e-02 2.71955666447e-02 - 2.52298202509e-02 2.30804654510e-02 2.08820531014e-02 1.87467470027e-02 1.67567114426e-02 1.49636867906e-02 - 1.16276251073e-02 1.06856809758e-02 9.91029781221e-03 9.29162040305e-03 8.82009872524e-03 8.48843476768e-03 - 8.29158854156e-03 8.22635918544e-03 8.29158854156e-03 8.48843476768e-03 8.82009872524e-03 9.29162040305e-03 - 9.91029781221e-03 1.06856809758e-02 1.16276251073e-02 1.27424344623e-02 1.40283418589e-02 1.54709928045e-02 - 1.70389543521e-02 1.86800926235e-02 2.03206914317e-02 2.18687619531e-02 2.32217587400e-02 2.42781130820e-02 - 2.49511167951e-02 2.51823253991e-02 2.49511167951e-02 2.42781130820e-02 2.32217587400e-02 2.18687619531e-02 - 2.03206914317e-02 1.86800926235e-02 1.70389543521e-02 1.54709928045e-02 1.40283418589e-02 1.27424344623e-02 - 1.02846446979e-02 9.66211927865e-03 9.15892896774e-03 8.76725594498e-03 8.47998103933e-03 8.29158854156e-03 - 8.19834740781e-03 8.19834740781e-03 8.29158854156e-03 8.47998103933e-03 8.76725594498e-03 9.15892896774e-03 - 9.66211927865e-03 1.02846446979e-02 1.10330000246e-02 1.19093466628e-02 1.29079014387e-02 1.40112393540e-02 - 1.51874137660e-02 1.63890080671e-02 1.75547637226e-02 1.86137801375e-02 1.94921954522e-02 2.01220876747e-02 - 2.04512222766e-02 2.04512222766e-02 2.01220876747e-02 1.94921954522e-02 1.86137801375e-02 1.75547637226e-02 - 1.63890080671e-02 1.51874137660e-02 1.40112393540e-02 1.29079014387e-02 1.19093466628e-02 1.10330000246e-02 - 9.31810768724e-03 8.95261635749e-03 8.66817035987e-03 8.45686847188e-03 8.31144312544e-03 8.22635918544e-03 - 8.19834740781e-03 8.22635918544e-03 8.31144312544e-03 8.45686847188e-03 8.66817035987e-03 8.95261635749e-03 - 9.31810768724e-03 9.77183223433e-03 1.03186231402e-02 1.09586567104e-02 1.16845233837e-02 1.24785638223e-02 - 1.33116675302e-02 1.41440793855e-02 1.49279448733e-02 1.56112881223e-02 1.61434902729e-02 1.64818809732e-02 - 1.65980023724e-02 1.64818809732e-02 1.61434902729e-02 1.56112881223e-02 1.49279448733e-02 1.41440793855e-02 - 1.33116675302e-02 1.24785638223e-02 1.16845233837e-02 1.09586567104e-02 1.03186231402e-02 9.77183223433e-03 - 8.69246386814e-03 8.53524112695e-03 8.42580807925e-03 8.35413904759e-03 8.31144312544e-03 8.29158854156e-03 - 8.29158854156e-03 8.31144312544e-03 8.35413904759e-03 8.42580807925e-03 8.53524112695e-03 8.69246386814e-03 - 8.90705726329e-03 9.18679124184e-03 9.53627070961e-03 9.95507847617e-03 1.04356792319e-02 1.09620544703e-02 - 1.15097880648e-02 1.20475550421e-02 1.25396406703e-02 1.29494247541e-02 1.32437842255e-02 1.33976732300e-02 - 1.33976732300e-02 1.32437842255e-02 1.29494247541e-02 1.25396406703e-02 1.20475550421e-02 1.15097880648e-02 - 1.09620544703e-02 1.04356792319e-02 9.95507847617e-03 9.53627070961e-03 9.18679124184e-03 8.90705726329e-03 - 8.38500711079e-03 8.39746782805e-03 8.42580807925e-03 8.45686847188e-03 8.47998103933e-03 8.48843476768e-03 - 8.47998103933e-03 8.45686847188e-03 8.42580807925e-03 8.39746782805e-03 8.38500711079e-03 8.40200942373e-03 - 8.46060891145e-03 8.57007132232e-03 8.73551184506e-03 8.95658363692e-03 9.22648243576e-03 9.53173661310e-03 - 9.85294674885e-03 1.01663421573e-02 1.04460621935e-02 1.06671499136e-02 1.08088949298e-02 1.08577130860e-02 - 1.08088949298e-02 1.06671499136e-02 1.04460621935e-02 1.01663421573e-02 9.85294674885e-03 9.53173661310e-03 - 9.22648243576e-03 8.95658363692e-03 8.73551184506e-03 8.57007132232e-03 8.46060891145e-03 8.40200942373e-03 - 8.38500711079e-03 8.53524112695e-03 8.66817035987e-03 8.76725594498e-03 8.82009872524e-03 8.82009872524e-03 - 8.76725594498e-03 8.66817035987e-03 8.53524112695e-03 8.38500711079e-03 8.23585736203e-03 8.10563303358e-03 - 8.00955236461e-03 7.95863052826e-03 7.95863052826e-03 8.00955236461e-03 8.10563303358e-03 8.23585736203e-03 - 8.38500711079e-03 8.53524112695e-03 8.66817035987e-03 8.76725594498e-03 8.82009872524e-03 8.82009872524e-03 - 8.76725594498e-03 8.66817035987e-03 8.53524112695e-03 8.38500711079e-03 8.23585736203e-03 8.10563303358e-03 - 8.00955236461e-03 7.95863052826e-03 7.95863052826e-03 8.00955236461e-03 8.10563303358e-03 8.23585736203e-03 - 8.69246386814e-03 8.95261635749e-03 9.15892896774e-03 9.29162040305e-03 9.33741418467e-03 9.29162040305e-03 - 9.15892896774e-03 8.95261635749e-03 8.69246386814e-03 8.40200942373e-03 8.10563303358e-03 7.82576853226e-03 - 7.58058258839e-03 7.38252390656e-03 7.23785699764e-03 7.14689010595e-03 7.10459522193e-03 7.10160482063e-03 - 7.12561826537e-03 7.16308508658e-03 7.20097316500e-03 7.22847713667e-03 7.23847314555e-03 7.22847713667e-03 - 7.20097316500e-03 7.16308508658e-03 7.12561826537e-03 7.10160482063e-03 7.10459522193e-03 7.14689010595e-03 - 7.23785699764e-03 7.38252390656e-03 7.58058258839e-03 7.82576853226e-03 8.10563303358e-03 8.40200942373e-03 - 9.31810768724e-03 9.66211927865e-03 9.91029781221e-03 1.00404664762e-02 1.00404664762e-02 9.91029781221e-03 - 9.66211927865e-03 9.31810768724e-03 8.90705726329e-03 8.46060891145e-03 8.00955236461e-03 7.58058258839e-03 - 7.19410390186e-03 6.86339437793e-03 6.59479473082e-03 6.38840491477e-03 6.23916674188e-03 6.13840739734e-03 - 6.07562992209e-03 6.04016501968e-03 6.02253909249e-03 6.01563766373e-03 6.01563766373e-03 6.02253909249e-03 - 6.04016501968e-03 6.07562992209e-03 6.13840739734e-03 6.23916674188e-03 6.38840491477e-03 6.59479473082e-03 - 6.86339437793e-03 7.19410390186e-03 7.58058258839e-03 8.00955236461e-03 8.46060891145e-03 8.90705726329e-03 - 1.02846446979e-02 1.06856809758e-02 1.09414577715e-02 1.10293847869e-02 1.09414577715e-02 1.06856809758e-02 - 1.02846446979e-02 9.77183223433e-03 9.18679124184e-03 8.57007132232e-03 7.95863052826e-03 7.38252390656e-03 - 6.86339437793e-03 6.41444748147e-03 6.04118457084e-03 5.74257125314e-03 5.51272438194e-03 5.34296096392e-03 - 5.22371135458e-03 5.14599535674e-03 5.10253249618e-03 5.08859106656e-03 5.10253249618e-03 5.14599535674e-03 - 5.22371135458e-03 5.34296096392e-03 5.51272438194e-03 5.74257125314e-03 6.04118457084e-03 6.41444748147e-03 - 6.86339437793e-03 7.38252390656e-03 7.95863052826e-03 8.57007132232e-03 9.18679124184e-03 9.77183223433e-03 - 1.16276251073e-02 1.20550163598e-02 1.22786655737e-02 1.22786655737e-02 1.20550163598e-02 1.16276251073e-02 - 1.10330000246e-02 1.03186231402e-02 9.53627070961e-03 8.73551184506e-03 7.95863052826e-03 7.23785699764e-03 - 6.59479473082e-03 6.04118457084e-03 5.58034633768e-03 5.20914423543e-03 4.92029966810e-03 4.70458873539e-03 - 4.55262020357e-03 4.45623663297e-03 4.40955813989e-03 4.40955813989e-03 4.45623663297e-03 4.55262020357e-03 - 4.70458873539e-03 4.92029966810e-03 5.20914423543e-03 5.58034633768e-03 6.04118457084e-03 6.59479473082e-03 - 7.23785699764e-03 7.95863052826e-03 8.73551184506e-03 9.53627070961e-03 1.03186231402e-02 1.10330000246e-02 - 1.33939588194e-02 1.38094745262e-02 1.39522993746e-02 1.38094745262e-02 1.33939588194e-02 1.27424344623e-02 - 1.19093466628e-02 1.09586567104e-02 9.95507847617e-03 8.95658363692e-03 8.00955236461e-03 7.14689010595e-03 - 6.38840491477e-03 5.74257125314e-03 5.20914423543e-03 4.78210810048e-03 4.45230019628e-03 4.20942844716e-03 - 4.04374575730e-03 3.94752033538e-03 3.91597292758e-03 3.94752033538e-03 4.04374575730e-03 4.20942844716e-03 - 4.45230019628e-03 4.78210810048e-03 5.20914423543e-03 5.74257125314e-03 6.38840491477e-03 7.14689010595e-03 - 8.00955236461e-03 8.95658363692e-03 9.95507847617e-03 1.09586567104e-02 1.19093466628e-02 1.27424344623e-02 - 1.56375665721e-02 1.59907282434e-02 1.59907282434e-02 1.56375665721e-02 1.49636867906e-02 1.40283418589e-02 - 1.29079014387e-02 1.16845233837e-02 1.04356792319e-02 9.22648243576e-03 8.10563303358e-03 7.10459522193e-03 - 6.23916674188e-03 5.51272438194e-03 4.92029966810e-03 4.45230019628e-03 4.09713024865e-03 3.84302280796e-03 - 3.67971968314e-03 3.59990872378e-03 3.59990872378e-03 3.67971968314e-03 3.84302280796e-03 4.09713024865e-03 - 4.45230019628e-03 4.92029966810e-03 5.51272438194e-03 6.23916674188e-03 7.10459522193e-03 8.10563303358e-03 - 9.22648243576e-03 1.04356792319e-02 1.16845233837e-02 1.29079014387e-02 1.40283418589e-02 1.49636867906e-02 - 1.84129279741e-02 1.86354478304e-02 1.84129279741e-02 1.77666865554e-02 1.67567114426e-02 1.54709928045e-02 - 1.40112393540e-02 1.24785638223e-02 1.09620544703e-02 9.53173661310e-03 8.23585736203e-03 7.10160482063e-03 - 6.13840739734e-03 5.34296096392e-03 4.70458873539e-03 4.20942844716e-03 3.84302280796e-03 3.59206217435e-03 - 3.44594928533e-03 3.39799742507e-03 3.44594928533e-03 3.59206217435e-03 3.84302280796e-03 4.20942844716e-03 - 4.70458873539e-03 5.34296096392e-03 6.13840739734e-03 7.10160482063e-03 8.23585736203e-03 9.53173661310e-03 - 1.09620544703e-02 1.24785638223e-02 1.40112393540e-02 1.54709928045e-02 1.67567114426e-02 1.77666865554e-02 - 2.17657781241e-02 2.17657781241e-02 2.12198093897e-02 2.01812628043e-02 1.87467470027e-02 1.70389543521e-02 - 1.51874137660e-02 1.33116675302e-02 1.15097880648e-02 9.85294674885e-03 8.38500711079e-03 7.12561826537e-03 - 6.07562992209e-03 5.22371135458e-03 4.55262020357e-03 4.04374575730e-03 3.67971968314e-03 3.44594928533e-03 - 3.33184951460e-03 3.33184951460e-03 3.44594928533e-03 3.67971968314e-03 4.04374575730e-03 4.55262020357e-03 - 5.22371135458e-03 6.07562992209e-03 7.12561826537e-03 8.38500711079e-03 9.85294674885e-03 1.15097880648e-02 - 1.33116675302e-02 1.51874137660e-02 1.70389543521e-02 1.87467470027e-02 2.01812628043e-02 2.12198093897e-02 - 2.57176061925e-02 2.53749373622e-02 2.43819637041e-02 2.28368095394e-02 2.08820531014e-02 1.86800926235e-02 - 1.63890080671e-02 1.41440793855e-02 1.20475550421e-02 1.01663421573e-02 8.53524112695e-03 7.16308508658e-03 - 6.04016501968e-03 5.14599535674e-03 4.45623663297e-03 3.94752033538e-03 3.59990872378e-03 3.39799742507e-03 - 3.33184951460e-03 3.39799742507e-03 3.59990872378e-03 3.94752033538e-03 4.45623663297e-03 5.14599535674e-03 - 6.04016501968e-03 7.16308508658e-03 8.53524112695e-03 1.01663421573e-02 1.20475550421e-02 1.41440793855e-02 - 1.63890080671e-02 1.86800926235e-02 2.08820531014e-02 2.28368095394e-02 2.43819637041e-02 2.53749373622e-02 - 3.02423286704e-02 2.94074293899e-02 2.78244998346e-02 2.56499234494e-02 2.30804654510e-02 2.03206914317e-02 - 1.75547637226e-02 1.49279448733e-02 1.25396406703e-02 1.04460621935e-02 8.66817035987e-03 7.20097316500e-03 - 6.02253909249e-03 5.10253249618e-03 4.40955813989e-03 3.91597292758e-03 3.59990872378e-03 3.44594928533e-03 - 3.44594928533e-03 3.59990872378e-03 3.91597292758e-03 4.40955813989e-03 5.10253249618e-03 6.02253909249e-03 - 7.20097316500e-03 8.66817035987e-03 1.04460621935e-02 1.25396406703e-02 1.49279448733e-02 1.75547637226e-02 - 2.03206914317e-02 2.30804654510e-02 2.56499234494e-02 2.78244998346e-02 2.94074293899e-02 3.02423286704e-02 - 3.52402742752e-02 3.37399765679e-02 3.14154606035e-02 2.84935612207e-02 2.52298202509e-02 2.18687619531e-02 - 1.86137801375e-02 1.56112881223e-02 1.29494247541e-02 1.06671499136e-02 8.76725594498e-03 7.22847713667e-03 - 6.01563766373e-03 5.08859106656e-03 4.40955813989e-03 3.94752033538e-03 3.67971968314e-03 3.59206217435e-03 - 3.67971968314e-03 3.94752033538e-03 4.40955813989e-03 5.08859106656e-03 6.01563766373e-03 7.22847713667e-03 - 8.76725594498e-03 1.06671499136e-02 1.29494247541e-02 1.56112881223e-02 1.86137801375e-02 2.18687619531e-02 - 2.52298202509e-02 2.84935612207e-02 3.14154606035e-02 3.37399765679e-02 3.52402742752e-02 3.57591480990e-02 - 4.05199675384e-02 3.81729635435e-02 3.49654910486e-02 3.12022017908e-02 2.71955666447e-02 2.32217587400e-02 - 1.94921954522e-02 1.61434902729e-02 1.32437842255e-02 1.08088949298e-02 8.82009872524e-03 7.23847314555e-03 - 6.01563766373e-03 5.10253249618e-03 4.45623663297e-03 4.04374575730e-03 3.84302280796e-03 3.84302280796e-03 - 4.04374575730e-03 4.45623663297e-03 5.10253249618e-03 6.01563766373e-03 7.23847314555e-03 8.82009872524e-03 - 1.08088949298e-02 1.32437842255e-02 1.61434902729e-02 1.94921954522e-02 2.32217587400e-02 2.71955666447e-02 - 3.12022017908e-02 3.49654910486e-02 3.81729635435e-02 4.05199675384e-02 4.17618689283e-02 4.17618689283e-02 - 4.57968161948e-02 4.24386109393e-02 3.82415861113e-02 3.35871770820e-02 2.88348357920e-02 2.42781130820e-02 - 2.01220876747e-02 1.64818809732e-02 1.33976732300e-02 1.08577130860e-02 8.82009872524e-03 7.22847713667e-03 - 6.02253909249e-03 5.14599535674e-03 4.55262020357e-03 4.20942844716e-03 4.09713024865e-03 4.20942844716e-03 - 4.55262020357e-03 5.14599535674e-03 6.02253909249e-03 7.22847713667e-03 8.82009872524e-03 1.08577130860e-02 - 1.33976732300e-02 1.64818809732e-02 2.01220876747e-02 2.42781130820e-02 2.88348357920e-02 3.35871770820e-02 - 3.82415861113e-02 4.24386109393e-02 4.57968161948e-02 4.79731106469e-02 4.87273692032e-02 4.79731106469e-02 - 5.07121410456e-02 4.62258246981e-02 4.09927131873e-02 3.54595415232e-02 3.00149219248e-02 2.49511167951e-02 - 2.04512222766e-02 1.65980023724e-02 1.33976732300e-02 1.08088949298e-02 8.76725594498e-03 7.20097316500e-03 - 6.04016501968e-03 5.22371135458e-03 4.70458873539e-03 4.45230019628e-03 4.45230019628e-03 4.70458873539e-03 - 5.22371135458e-03 6.04016501968e-03 7.20097316500e-03 8.76725594498e-03 1.08088949298e-02 1.33976732300e-02 - 1.65980023724e-02 2.04512222766e-02 2.49511167951e-02 3.00149219248e-02 3.54595415232e-02 4.09927131873e-02 - 4.62258246981e-02 5.07121410456e-02 5.40097122002e-02 5.57595749637e-02 5.57595749637e-02 5.40097122002e-02 - 5.48714786192e-02 4.92182336225e-02 4.29832635915e-02 3.66568505349e-02 3.06330408871e-02 2.51823253991e-02 - 2.04512222766e-02 1.64818809732e-02 1.32437842255e-02 1.06671499136e-02 8.66817035987e-03 7.16308508658e-03 - 6.07562992209e-03 5.34296096392e-03 4.92029966810e-03 4.78210810048e-03 4.92029966810e-03 5.34296096392e-03 - 6.07562992209e-03 7.16308508658e-03 8.66817035987e-03 1.06671499136e-02 1.32437842255e-02 1.64818809732e-02 - 2.04512222766e-02 2.51823253991e-02 3.06330408871e-02 3.66568505349e-02 4.29832635915e-02 4.92182336225e-02 - 5.48714786192e-02 5.94150808572e-02 6.23688231248e-02 6.33941825467e-02 6.23688231248e-02 5.94150808572e-02 - 5.78981879671e-02 5.11403130173e-02 4.40291518527e-02 3.70689589239e-02 3.06330408871e-02 2.49511167951e-02 - 2.01220876747e-02 1.61434902729e-02 1.29494247541e-02 1.04460621935e-02 8.53524112695e-03 7.12561826537e-03 - 6.13840739734e-03 5.51272438194e-03 5.20914423543e-03 5.20914423543e-03 5.51272438194e-03 6.13840739734e-03 - 7.12561826537e-03 8.53524112695e-03 1.04460621935e-02 1.29494247541e-02 1.61434902729e-02 2.01220876747e-02 - 2.49511167951e-02 3.06330408871e-02 3.70689589239e-02 4.40291518527e-02 5.11403130173e-02 5.78981879671e-02 - 6.37149803432e-02 6.80033074139e-02 7.02831021338e-02 7.02831021338e-02 6.80033074139e-02 6.37149803432e-02 - 5.94941697642e-02 5.18034033720e-02 4.40291518527e-02 3.66568505349e-02 3.00149219248e-02 2.42781130820e-02 - 1.94921954522e-02 1.56112881223e-02 1.25396406703e-02 1.01663421573e-02 8.38500711079e-03 7.10160482063e-03 - 6.23916674188e-03 5.74257125314e-03 5.58034633768e-03 5.74257125314e-03 6.23916674188e-03 7.10160482063e-03 - 8.38500711079e-03 1.01663421573e-02 1.25396406703e-02 1.56112881223e-02 1.94921954522e-02 2.42781130820e-02 - 3.00149219248e-02 3.66568505349e-02 4.40291518527e-02 5.18034033720e-02 5.94941697642e-02 6.64898780493e-02 - 7.21264918488e-02 7.57970302390e-02 7.70723261920e-02 7.57970302390e-02 7.21264918488e-02 6.64898780493e-02 - 5.94941697642e-02 5.11403130173e-02 4.29832635915e-02 3.54595415232e-02 2.88348357920e-02 2.32217587400e-02 - 1.86137801375e-02 1.49279448733e-02 1.20475550421e-02 9.85294674885e-03 8.23585736203e-03 7.10459522193e-03 - 6.38840491477e-03 6.04118457084e-03 6.04118457084e-03 6.38840491477e-03 7.10459522193e-03 8.23585736203e-03 - 9.85294674885e-03 1.20475550421e-02 1.49279448733e-02 1.86137801375e-02 2.32217587400e-02 2.88348357920e-02 - 3.54595415232e-02 4.29832635915e-02 5.11403130173e-02 5.94941697642e-02 6.74494907981e-02 7.43082663472e-02 - 7.93709590427e-02 8.20645507484e-02 8.20645507484e-02 7.93709590427e-02 7.43082663472e-02 6.74494907981e-02 - 5.78981879671e-02 4.92182336225e-02 4.09927131873e-02 3.35871770820e-02 2.71955666447e-02 2.18687619531e-02 - 1.75547637226e-02 1.41440793855e-02 1.15097880648e-02 9.53173661310e-03 8.10563303358e-03 7.14689010595e-03 - 6.59479473082e-03 6.41444748147e-03 6.59479473082e-03 7.14689010595e-03 8.10563303358e-03 9.53173661310e-03 - 1.15097880648e-02 1.41440793855e-02 1.75547637226e-02 2.18687619531e-02 2.71955666447e-02 3.35871770820e-02 - 4.09927131873e-02 4.92182336225e-02 5.78981879671e-02 6.64898780493e-02 7.43082663472e-02 8.06097207709e-02 - 8.47143937707e-02 8.61408122915e-02 8.47143937707e-02 8.06097207709e-02 7.43082663472e-02 6.64898780493e-02 - 5.48714786192e-02 4.62258246981e-02 3.82415861113e-02 3.12022017908e-02 2.52298202509e-02 2.03206914317e-02 - 1.63890080671e-02 1.33116675302e-02 1.09620544703e-02 9.22648243576e-03 8.00955236461e-03 7.23785699764e-03 - 6.86339437793e-03 6.86339437793e-03 7.23785699764e-03 8.00955236461e-03 9.22648243576e-03 1.09620544703e-02 - 1.33116675302e-02 1.63890080671e-02 2.03206914317e-02 2.52298202509e-02 3.12022017908e-02 3.82415861113e-02 - 4.62258246981e-02 5.48714786192e-02 6.37149803432e-02 7.21264918488e-02 7.93709590427e-02 8.47143937707e-02 - 8.75562567048e-02 8.75562567048e-02 8.47143937707e-02 7.93709590427e-02 7.21264918488e-02 6.37149803432e-02 - 5.07121410456e-02 4.24386109393e-02 3.49654910486e-02 2.84935612207e-02 2.30804654510e-02 1.86800926235e-02 - 1.51874137660e-02 1.24785638223e-02 1.04356792319e-02 8.95658363692e-03 7.95863052826e-03 7.38252390656e-03 - 7.19410390186e-03 7.38252390656e-03 7.95863052826e-03 8.95658363692e-03 1.04356792319e-02 1.24785638223e-02 - 1.51874137660e-02 1.86800926235e-02 2.30804654510e-02 2.84935612207e-02 3.49654910486e-02 4.24386109393e-02 - 5.07121410456e-02 5.94150808572e-02 6.80033074139e-02 7.57970302390e-02 8.20645507484e-02 8.61408122915e-02 - 8.75562567048e-02 8.61408122915e-02 8.20645507484e-02 7.57970302390e-02 6.80033074139e-02 5.94150808572e-02 - 4.57968161948e-02 3.81729635435e-02 3.14154606035e-02 2.56499234494e-02 2.08820531014e-02 1.70389543521e-02 - 1.40112393540e-02 1.16845233837e-02 9.95507847617e-03 8.73551184506e-03 7.95863052826e-03 7.58058258839e-03 - 7.58058258839e-03 7.95863052826e-03 8.73551184506e-03 9.95507847617e-03 1.16845233837e-02 1.40112393540e-02 - 1.70389543521e-02 2.08820531014e-02 2.56499234494e-02 3.14154606035e-02 3.81729635435e-02 4.57968161948e-02 - 5.40097122002e-02 6.23688231248e-02 7.02831021338e-02 7.70723261920e-02 8.20645507484e-02 8.47143937707e-02 - 8.47143937707e-02 8.20645507484e-02 7.70723261920e-02 7.02831021338e-02 6.23688231248e-02 5.40097122002e-02 - 4.05199675384e-02 3.37399765679e-02 2.78244998346e-02 2.28368095394e-02 1.87467470027e-02 1.54709928045e-02 - 1.29079014387e-02 1.09586567104e-02 9.53627070961e-03 8.57007132232e-03 8.00955236461e-03 7.82576853226e-03 - 8.00955236461e-03 8.57007132232e-03 9.53627070961e-03 1.09586567104e-02 1.29079014387e-02 1.54709928045e-02 - 1.87467470027e-02 2.28368095394e-02 2.78244998346e-02 3.37399765679e-02 4.05199675384e-02 4.79731106469e-02 - 5.57595749637e-02 6.33941825467e-02 7.02831021338e-02 7.57970302390e-02 7.93709590427e-02 8.06097207709e-02 - 7.93709590427e-02 7.57970302390e-02 7.02831021338e-02 6.33941825467e-02 5.57595749637e-02 4.79731106469e-02 - 3.52402742752e-02 2.94074293899e-02 2.43819637041e-02 2.01812628043e-02 1.67567114426e-02 1.40283418589e-02 - 1.19093466628e-02 1.03186231402e-02 9.18679124184e-03 8.46060891145e-03 8.10563303358e-03 8.10563303358e-03 - 8.46060891145e-03 9.18679124184e-03 1.03186231402e-02 1.19093466628e-02 1.40283418589e-02 1.67567114426e-02 - 2.01812628043e-02 2.43819637041e-02 2.94074293899e-02 3.52402742752e-02 4.17618689283e-02 4.87273692032e-02 - 5.57595749637e-02 6.23688231248e-02 6.80033074139e-02 7.21264918488e-02 7.43082663472e-02 7.43082663472e-02 - 7.21264918488e-02 6.80033074139e-02 6.23688231248e-02 5.57595749637e-02 4.87273692032e-02 4.17618689283e-02 - 3.02423286704e-02 2.53749373622e-02 2.12198093897e-02 1.77666865554e-02 1.49636867906e-02 1.27424344623e-02 - 1.10330000246e-02 9.77183223433e-03 8.90705726329e-03 8.40200942373e-03 8.23585736203e-03 8.40200942373e-03 - 8.90705726329e-03 9.77183223433e-03 1.10330000246e-02 1.27424344623e-02 1.49636867906e-02 1.77666865554e-02 - 2.12198093897e-02 2.53749373622e-02 3.02423286704e-02 3.57591480990e-02 4.17618689283e-02 4.79731106469e-02 - 5.40097122002e-02 5.94150808572e-02 6.37149803432e-02 6.64898780493e-02 6.74494907981e-02 6.64898780493e-02 - 6.37149803432e-02 5.94150808572e-02 5.40097122002e-02 4.79731106469e-02 4.17618689283e-02 3.57591480990e-02 - 2.53146898274e-02 2.17657781241e-02 1.87538902948e-02 1.62588522549e-02 1.42425749040e-02 1.26620800682e-02 - 1.14766013692e-02 1.06524671204e-02 1.01663421573e-02 1.00055755901e-02 1.01663421573e-02 1.06524671204e-02 - 1.14766013692e-02 1.26620800682e-02 1.42425749040e-02 1.62588522549e-02 1.87538902948e-02 2.17657781241e-02 - 2.53146898274e-02 2.93819034216e-02 3.38859304601e-02 3.86662855632e-02 4.34838779539e-02 4.80406383964e-02 - 5.20147259753e-02 5.51031089527e-02 5.70612480291e-02 5.77319585491e-02 5.70612480291e-02 5.51031089527e-02 - 5.20147259753e-02 4.80406383964e-02 4.34838779539e-02 3.86662855632e-02 3.38859304601e-02 2.93819034216e-02 - 2.17657781241e-02 1.89804120902e-02 1.66250325509e-02 1.46810426016e-02 1.31198380533e-02 1.19105819676e-02 - 1.10259974674e-02 1.04460621935e-02 1.01587603229e-02 1.01587603229e-02 1.04460621935e-02 1.10259974674e-02 - 1.19105819676e-02 1.31198380533e-02 1.46810426016e-02 1.66250325509e-02 1.89804120902e-02 2.17657781241e-02 - 2.49776956914e-02 2.85734174953e-02 3.24534608631e-02 3.64535808156e-02 4.03527020822e-02 4.38959177953e-02 - 4.68264624901e-02 4.89192305177e-02 5.00090134447e-02 5.00090134447e-02 4.89192305177e-02 4.68264624901e-02 - 4.38959177953e-02 4.03527020822e-02 3.64535808156e-02 3.24534608631e-02 2.85734174953e-02 2.49776956914e-02 - 1.87538902948e-02 1.66250325509e-02 1.48317912783e-02 1.33594815778e-02 1.21873907787e-02 1.12951380995e-02 - 1.06671499136e-02 1.02937156151e-02 1.01697655067e-02 1.02937156151e-02 1.06671499136e-02 1.12951380995e-02 - 1.21873907787e-02 1.33594815778e-02 1.48317912783e-02 1.66250325509e-02 1.87538902948e-02 2.12198093897e-02 - 2.40011711299e-02 2.70402901784e-02 3.02323588099e-02 3.34242157073e-02 3.64263171972e-02 3.90347179512e-02 - 4.10571769449e-02 4.23378898536e-02 4.27763236460e-02 4.23378898536e-02 4.10571769449e-02 3.90347179512e-02 - 3.64263171972e-02 3.34242157073e-02 3.02323588099e-02 2.70402901784e-02 2.40011711299e-02 2.12198093897e-02 - 1.62588522549e-02 1.46810426016e-02 1.33594815778e-02 1.22825573408e-02 1.14361707830e-02 1.08088949298e-02 - 1.03937663652e-02 1.01870819285e-02 1.01870819285e-02 1.03937663652e-02 1.08088949298e-02 1.14361707830e-02 - 1.22825573408e-02 1.33594815778e-02 1.46810426016e-02 1.62588522549e-02 1.80960146721e-02 2.01812628043e-02 - 2.24815496090e-02 2.49333108373e-02 2.74372089612e-02 2.98615217076e-02 3.20546920774e-02 3.38635928392e-02 - 3.51532871168e-02 3.58243136049e-02 3.58243136049e-02 3.51532871168e-02 3.38635928392e-02 3.20546920774e-02 - 2.98615217076e-02 2.74372089612e-02 2.49333108373e-02 2.24815496090e-02 2.01812628043e-02 1.80960146721e-02 - 1.42425749040e-02 1.31198380533e-02 1.21873907787e-02 1.14361707830e-02 1.08577130860e-02 1.04468583553e-02 - 1.02011860999e-02 1.01194532806e-02 1.02011860999e-02 1.04468583553e-02 1.08577130860e-02 1.14361707830e-02 - 1.21873907787e-02 1.31198380533e-02 1.42425749040e-02 1.55601992220e-02 1.70678712692e-02 1.87467470027e-02 - 2.05587788214e-02 2.24420850452e-02 2.43103322252e-02 2.60582031450e-02 2.75721078901e-02 2.87439673059e-02 - 2.94854041377e-02 2.97391273192e-02 2.94854041377e-02 2.87439673059e-02 2.75721078901e-02 2.60582031450e-02 - 2.43103322252e-02 2.24420850452e-02 2.05587788214e-02 1.87467470027e-02 1.70678712692e-02 1.55601992220e-02 - 1.26620800682e-02 1.19105819676e-02 1.12951380995e-02 1.08088949298e-02 1.04468583553e-02 1.02064774226e-02 - 1.00865795572e-02 1.00865795572e-02 1.02064774226e-02 1.04468583553e-02 1.08088949298e-02 1.12951380995e-02 - 1.19105819676e-02 1.26620800682e-02 1.35553259639e-02 1.45906790875e-02 1.57591868798e-02 1.70389543521e-02 - 1.83921353899e-02 1.97639178277e-02 2.10847229658e-02 2.22755921268e-02 2.32562353108e-02 2.39549635512e-02 - 2.43184216158e-02 2.43184216158e-02 2.39549635512e-02 2.32562353108e-02 2.22755921268e-02 2.10847229658e-02 - 1.97639178277e-02 1.83921353899e-02 1.70389543521e-02 1.57591868798e-02 1.45906790875e-02 1.35553259639e-02 - 1.14766013692e-02 1.10259974674e-02 1.06671499136e-02 1.03937663652e-02 1.02011860999e-02 1.00865795572e-02 - 1.00485204973e-02 1.00865795572e-02 1.02011860999e-02 1.03937663652e-02 1.06671499136e-02 1.10259974674e-02 - 1.14766013692e-02 1.20255038743e-02 1.26769712537e-02 1.34297677852e-02 1.42737851127e-02 1.51874137660e-02 - 1.61367490443e-02 1.70770073925e-02 1.79555609317e-02 1.87162119832e-02 1.93050944183e-02 1.96777557044e-02 - 1.98052910067e-02 1.96777557044e-02 1.93050944183e-02 1.87162119832e-02 1.79555609317e-02 1.70770073925e-02 - 1.61367490443e-02 1.51874137660e-02 1.42737851127e-02 1.34297677852e-02 1.26769712537e-02 1.20255038743e-02 - 1.06524671204e-02 1.04460621935e-02 1.02937156151e-02 1.01870819285e-02 1.01194532806e-02 1.00865795572e-02 - 1.00865795572e-02 1.01194532806e-02 1.01870819285e-02 1.02937156151e-02 1.04460621935e-02 1.06524671204e-02 - 1.09215936737e-02 1.12609832188e-02 1.16751572683e-02 1.21629507848e-02 1.27148275869e-02 1.33116675302e-02 - 1.39256808178e-02 1.45226393383e-02 1.50645020089e-02 1.55127511572e-02 1.58329883187e-02 1.59997599900e-02 - 1.59997599900e-02 1.58329883187e-02 1.55127511572e-02 1.50645020089e-02 1.45226393383e-02 1.39256808178e-02 - 1.33116675302e-02 1.27148275869e-02 1.21629507848e-02 1.16751572683e-02 1.12609832188e-02 1.09215936737e-02 - 1.01663421573e-02 1.01587603229e-02 1.01697655067e-02 1.01870819285e-02 1.02011860999e-02 1.02064774226e-02 - 1.02011860999e-02 1.01870819285e-02 1.01697655067e-02 1.01587603229e-02 1.01663421573e-02 1.02054916185e-02 - 1.02881382638e-02 1.04238516982e-02 1.06181928008e-02 1.08706042529e-02 1.11729588764e-02 1.15097880648e-02 - 1.18598583649e-02 1.21980827392e-02 1.24976141314e-02 1.27327884289e-02 1.28827341282e-02 1.29342051284e-02 - 1.28827341282e-02 1.27327884289e-02 1.24976141314e-02 1.21980827392e-02 1.18598583649e-02 1.15097880648e-02 - 1.11729588764e-02 1.08706042529e-02 1.06181928008e-02 1.04238516982e-02 1.02881382638e-02 1.02054916185e-02 - 1.00055755901e-02 1.01587603229e-02 1.02937156151e-02 1.03937663652e-02 1.04468583553e-02 1.04468583553e-02 - 1.03937663652e-02 1.02937156151e-02 1.01587603229e-02 1.00055755901e-02 9.85294674885e-03 9.71912104775e-03 - 9.61987006090e-03 9.56702175361e-03 9.56702175361e-03 9.61987006090e-03 9.71912104775e-03 9.85294674885e-03 - 1.00055755901e-02 1.01587603229e-02 1.02937156151e-02 1.03937663652e-02 1.04468583553e-02 1.04468583553e-02 - 1.03937663652e-02 1.02937156151e-02 1.01587603229e-02 1.00055755901e-02 9.85294674885e-03 9.71912104775e-03 - 9.61987006090e-03 9.56702175361e-03 9.56702175361e-03 9.61987006090e-03 9.71912104775e-03 9.85294674885e-03 - 1.01663421573e-02 1.04460621935e-02 1.06671499136e-02 1.08088949298e-02 1.08577130860e-02 1.08088949298e-02 - 1.06671499136e-02 1.04460621935e-02 1.01663421573e-02 9.85294674885e-03 9.53173661310e-03 9.22648243576e-03 - 8.95658363692e-03 8.73551184506e-03 8.57007132232e-03 8.46060891145e-03 8.40200942373e-03 8.38500711079e-03 - 8.39746782805e-03 8.42580807925e-03 8.45686847188e-03 8.47998103933e-03 8.48843476768e-03 8.47998103933e-03 - 8.45686847188e-03 8.42580807925e-03 8.39746782805e-03 8.38500711079e-03 8.40200942373e-03 8.46060891145e-03 - 8.57007132232e-03 8.73551184506e-03 8.95658363692e-03 9.22648243576e-03 9.53173661310e-03 9.85294674885e-03 - 1.06524671204e-02 1.10259974674e-02 1.12951380995e-02 1.14361707830e-02 1.14361707830e-02 1.12951380995e-02 - 1.10259974674e-02 1.06524671204e-02 1.02054916185e-02 9.71912104775e-03 9.22648243576e-03 8.75631776595e-03 - 8.33057919998e-03 7.96341795569e-03 7.66146344666e-03 7.42492384580e-03 7.24904282964e-03 7.12561826537e-03 - 7.04448483440e-03 6.99504538611e-03 6.96786738821e-03 6.95605972443e-03 6.95605972443e-03 6.96786738821e-03 - 6.99504538611e-03 7.04448483440e-03 7.12561826537e-03 7.24904282964e-03 7.42492384580e-03 7.66146344666e-03 - 7.96341795569e-03 8.33057919998e-03 8.75631776595e-03 9.22648243576e-03 9.71912104775e-03 1.02054916185e-02 - 1.14766013692e-02 1.19105819676e-02 1.21873907787e-02 1.22825573408e-02 1.21873907787e-02 1.19105819676e-02 - 1.14766013692e-02 1.09215936737e-02 1.02881382638e-02 9.61987006090e-03 8.95658363692e-03 8.33057919998e-03 - 7.76490388909e-03 7.27338017313e-03 6.86170422323e-03 6.52902358143e-03 6.26978037715e-03 6.07562992209e-03 - 5.93719631865e-03 5.84558656512e-03 5.79365065764e-03 5.77685140016e-03 5.79365065764e-03 5.84558656512e-03 - 5.93719631865e-03 6.07562992209e-03 6.26978037715e-03 6.52902358143e-03 6.86170422323e-03 7.27338017313e-03 - 7.76490388909e-03 8.33057919998e-03 8.95658363692e-03 9.61987006090e-03 1.02881382638e-02 1.09215936737e-02 - 1.26620800682e-02 1.31198380533e-02 1.33594815778e-02 1.33594815778e-02 1.31198380533e-02 1.26620800682e-02 - 1.20255038743e-02 1.12609832188e-02 1.04238516982e-02 9.56702175361e-03 8.73551184506e-03 7.96341795569e-03 - 7.27338017313e-03 6.67761981445e-03 6.17967298585e-03 5.77651892440e-03 5.46093720174e-03 5.22371135458e-03 - 5.05545032098e-03 4.94806264494e-03 4.89581524939e-03 4.89581524939e-03 4.94806264494e-03 5.05545032098e-03 - 5.22371135458e-03 5.46093720174e-03 5.77651892440e-03 6.17967298585e-03 6.67761981445e-03 7.27338017313e-03 - 7.96341795569e-03 8.73551184506e-03 9.56702175361e-03 1.04238516982e-02 1.12609832188e-02 1.20255038743e-02 - 1.42425749040e-02 1.46810426016e-02 1.48317912783e-02 1.46810426016e-02 1.42425749040e-02 1.35553259639e-02 - 1.26769712537e-02 1.16751572683e-02 1.06181928008e-02 9.56702175361e-03 8.57007132232e-03 7.66146344666e-03 - 6.86170422323e-03 6.17967298585e-03 5.61528193683e-03 5.16243150929e-03 4.81172327806e-03 4.55262020357e-03 - 4.37525079151e-03 4.27192322596e-03 4.23798561825e-03 4.27192322596e-03 4.37525079151e-03 4.55262020357e-03 - 4.81172327806e-03 5.16243150929e-03 5.61528193683e-03 6.17967298585e-03 6.86170422323e-03 7.66146344666e-03 - 8.57007132232e-03 9.56702175361e-03 1.06181928008e-02 1.16751572683e-02 1.26769712537e-02 1.35553259639e-02 - 1.62588522549e-02 1.66250325509e-02 1.66250325509e-02 1.62588522549e-02 1.55601992220e-02 1.45906790875e-02 - 1.34297677852e-02 1.21629507848e-02 1.08706042529e-02 9.61987006090e-03 8.46060891145e-03 7.42492384580e-03 - 6.52902358143e-03 5.77651892440e-03 5.16243150929e-03 4.67692793169e-03 4.30805835198e-03 4.04374575730e-03 - 3.87358926493e-03 3.79030883078e-03 3.79030883078e-03 3.87358926493e-03 4.04374575730e-03 4.30805835198e-03 - 4.67692793169e-03 5.16243150929e-03 5.77651892440e-03 6.52902358143e-03 7.42492384580e-03 8.46060891145e-03 - 9.61987006090e-03 1.08706042529e-02 1.21629507848e-02 1.34297677852e-02 1.45906790875e-02 1.55601992220e-02 - 1.87538902948e-02 1.89804120902e-02 1.87538902948e-02 1.80960146721e-02 1.70678712692e-02 1.57591868798e-02 - 1.42737851127e-02 1.27148275869e-02 1.11729588764e-02 9.71912104775e-03 8.40200942373e-03 7.24904282964e-03 - 6.26978037715e-03 5.46093720174e-03 4.81172327806e-03 4.30805835198e-03 3.93522801758e-03 3.67971968314e-03 - 3.53085792774e-03 3.48198055848e-03 3.53085792774e-03 3.67971968314e-03 3.93522801758e-03 4.30805835198e-03 - 4.81172327806e-03 5.46093720174e-03 6.26978037715e-03 7.24904282964e-03 8.40200942373e-03 9.71912104775e-03 - 1.11729588764e-02 1.27148275869e-02 1.42737851127e-02 1.57591868798e-02 1.70678712692e-02 1.80960146721e-02 - 2.17657781241e-02 2.17657781241e-02 2.12198093897e-02 2.01812628043e-02 1.87467470027e-02 1.70389543521e-02 - 1.51874137660e-02 1.33116675302e-02 1.15097880648e-02 9.85294674885e-03 8.38500711079e-03 7.12561826537e-03 - 6.07562992209e-03 5.22371135458e-03 4.55262020357e-03 4.04374575730e-03 3.67971968314e-03 3.44594928533e-03 - 3.33184951460e-03 3.33184951460e-03 3.44594928533e-03 3.67971968314e-03 4.04374575730e-03 4.55262020357e-03 - 5.22371135458e-03 6.07562992209e-03 7.12561826537e-03 8.38500711079e-03 9.85294674885e-03 1.15097880648e-02 - 1.33116675302e-02 1.51874137660e-02 1.70389543521e-02 1.87467470027e-02 2.01812628043e-02 2.12198093897e-02 - 2.53146898274e-02 2.49776956914e-02 2.40011711299e-02 2.24815496090e-02 2.05587788214e-02 1.83921353899e-02 - 1.61367490443e-02 1.39256808178e-02 1.18598583649e-02 1.00055755901e-02 8.39746782805e-03 7.04448483440e-03 - 5.93719631865e-03 5.05545032098e-03 4.37525079151e-03 3.87358926493e-03 3.53085792774e-03 3.33184951460e-03 - 3.26667178574e-03 3.33184951460e-03 3.53085792774e-03 3.87358926493e-03 4.37525079151e-03 5.05545032098e-03 - 5.93719631865e-03 7.04448483440e-03 8.39746782805e-03 1.00055755901e-02 1.18598583649e-02 1.39256808178e-02 - 1.61367490443e-02 1.83921353899e-02 2.05587788214e-02 2.24815496090e-02 2.40011711299e-02 2.49776956914e-02 - 2.93819034216e-02 2.85734174953e-02 2.70402901784e-02 2.49333108373e-02 2.24420850452e-02 1.97639178277e-02 - 1.70770073925e-02 1.45226393383e-02 1.21980827392e-02 1.01587603229e-02 8.42580807925e-03 6.99504538611e-03 - 5.84558656512e-03 4.94806264494e-03 4.27192322596e-03 3.79030883078e-03 3.48198055848e-03 3.33184951460e-03 - 3.33184951460e-03 3.48198055848e-03 3.79030883078e-03 4.27192322596e-03 4.94806264494e-03 5.84558656512e-03 - 6.99504538611e-03 8.42580807925e-03 1.01587603229e-02 1.21980827392e-02 1.45226393383e-02 1.70770073925e-02 - 1.97639178277e-02 2.24420850452e-02 2.49333108373e-02 2.70402901784e-02 2.85734174953e-02 2.93819034216e-02 - 3.38859304601e-02 3.24534608631e-02 3.02323588099e-02 2.74372089612e-02 2.43103322252e-02 2.10847229658e-02 - 1.79555609317e-02 1.50645020089e-02 1.24976141314e-02 1.02937156151e-02 8.45686847188e-03 6.96786738821e-03 - 5.79365065764e-03 4.89581524939e-03 4.23798561825e-03 3.79030883078e-03 3.53085792774e-03 3.44594928533e-03 - 3.53085792774e-03 3.79030883078e-03 4.23798561825e-03 4.89581524939e-03 5.79365065764e-03 6.96786738821e-03 - 8.45686847188e-03 1.02937156151e-02 1.24976141314e-02 1.50645020089e-02 1.79555609317e-02 2.10847229658e-02 - 2.43103322252e-02 2.74372089612e-02 3.02323588099e-02 3.24534608631e-02 3.38859304601e-02 3.43811654173e-02 - 3.86662855632e-02 3.64535808156e-02 3.34242157073e-02 2.98615217076e-02 2.60582031450e-02 2.22755921268e-02 - 1.87162119832e-02 1.55127511572e-02 1.27327884289e-02 1.03937663652e-02 8.47998103933e-03 6.95605972443e-03 - 5.77685140016e-03 4.89581524939e-03 4.27192322596e-03 3.87358926493e-03 3.67971968314e-03 3.67971968314e-03 - 3.87358926493e-03 4.27192322596e-03 4.89581524939e-03 5.77685140016e-03 6.95605972443e-03 8.47998103933e-03 - 1.03937663652e-02 1.27327884289e-02 1.55127511572e-02 1.87162119832e-02 2.22755921268e-02 2.60582031450e-02 - 2.98615217076e-02 3.34242157073e-02 3.64535808156e-02 3.86662855632e-02 3.98358227133e-02 3.98358227133e-02 - 4.34838779539e-02 4.03527020822e-02 3.64263171972e-02 3.20546920774e-02 2.75721078901e-02 2.32562353108e-02 - 1.93050944183e-02 1.58329883187e-02 1.28827341282e-02 1.04468583553e-02 8.48843476768e-03 6.95605972443e-03 - 5.79365065764e-03 4.94806264494e-03 4.37525079151e-03 4.04374575730e-03 3.93522801758e-03 4.04374575730e-03 - 4.37525079151e-03 4.94806264494e-03 5.79365065764e-03 6.95605972443e-03 8.48843476768e-03 1.04468583553e-02 - 1.28827341282e-02 1.58329883187e-02 1.93050944183e-02 2.32562353108e-02 2.75721078901e-02 3.20546920774e-02 - 3.64263171972e-02 4.03527020822e-02 4.34838779539e-02 4.55081727847e-02 4.62088704848e-02 4.55081727847e-02 - 4.80406383964e-02 4.38959177953e-02 3.90347179512e-02 3.38635928392e-02 2.87439673059e-02 2.39549635512e-02 - 1.96777557044e-02 1.59997599900e-02 1.29342051284e-02 1.04468583553e-02 8.47998103933e-03 6.96786738821e-03 - 5.84558656512e-03 5.05545032098e-03 4.55262020357e-03 4.30805835198e-03 4.30805835198e-03 4.55262020357e-03 - 5.05545032098e-03 5.84558656512e-03 6.96786738821e-03 8.47998103933e-03 1.04468583553e-02 1.29342051284e-02 - 1.59997599900e-02 1.96777557044e-02 2.39549635512e-02 2.87439673059e-02 3.38635928392e-02 3.90347179512e-02 - 4.38959177953e-02 4.80406383964e-02 5.10737783335e-02 5.26787408684e-02 5.26787408684e-02 5.10737783335e-02 - 5.20147259753e-02 4.68264624901e-02 4.10571769449e-02 3.51532871168e-02 2.94854041377e-02 2.43184216158e-02 - 1.98052910067e-02 1.59997599900e-02 1.28827341282e-02 1.03937663652e-02 8.45686847188e-03 6.99504538611e-03 - 5.93719631865e-03 5.22371135458e-03 4.81172327806e-03 4.67692793169e-03 4.81172327806e-03 5.22371135458e-03 - 5.93719631865e-03 6.99504538611e-03 8.45686847188e-03 1.03937663652e-02 1.28827341282e-02 1.59997599900e-02 - 1.98052910067e-02 2.43184216158e-02 2.94854041377e-02 3.51532871168e-02 4.10571769449e-02 4.68264624901e-02 - 5.20147259753e-02 5.61547897924e-02 5.88318176265e-02 5.97584596222e-02 5.88318176265e-02 5.61547897924e-02 - 5.51031089527e-02 4.89192305177e-02 4.23378898536e-02 3.58243136049e-02 2.97391273192e-02 2.43184216158e-02 - 1.96777557044e-02 1.58329883187e-02 1.27327884289e-02 1.02937156151e-02 8.42580807925e-03 7.04448483440e-03 - 6.07562992209e-03 5.46093720174e-03 5.16243150929e-03 5.16243150929e-03 5.46093720174e-03 6.07562992209e-03 - 7.04448483440e-03 8.42580807925e-03 1.02937156151e-02 1.27327884289e-02 1.58329883187e-02 1.96777557044e-02 - 2.43184216158e-02 2.97391273192e-02 3.58243136049e-02 4.23378898536e-02 4.89192305177e-02 5.51031089527e-02 - 6.03694423859e-02 6.42180018992e-02 6.62522137956e-02 6.62522137956e-02 6.42180018992e-02 6.03694423859e-02 - 5.70612480291e-02 5.00090134447e-02 4.27763236460e-02 3.58243136049e-02 2.94854041377e-02 2.39549635512e-02 - 1.93050944183e-02 1.55127511572e-02 1.24976141314e-02 1.01587603229e-02 8.39746782805e-03 7.12561826537e-03 - 6.26978037715e-03 5.77651892440e-03 5.61528193683e-03 5.77651892440e-03 6.26978037715e-03 7.12561826537e-03 - 8.39746782805e-03 1.01587603229e-02 1.24976141314e-02 1.55127511572e-02 1.93050944183e-02 2.39549635512e-02 - 2.94854041377e-02 3.58243136049e-02 4.27763236460e-02 5.00090134447e-02 5.70612480291e-02 6.33842515281e-02 - 6.84139609392e-02 7.16581855164e-02 7.27796836797e-02 7.16581855164e-02 6.84139609392e-02 6.33842515281e-02 - 5.77319585491e-02 5.00090134447e-02 4.23378898536e-02 3.51532871168e-02 2.87439673059e-02 2.32562353108e-02 - 1.87162119832e-02 1.50645020089e-02 1.21980827392e-02 1.00055755901e-02 8.38500711079e-03 7.24904282964e-03 - 6.52902358143e-03 6.17967298585e-03 6.17967298585e-03 6.52902358143e-03 7.24904282964e-03 8.38500711079e-03 - 1.00055755901e-02 1.21980827392e-02 1.50645020089e-02 1.87162119832e-02 2.32562353108e-02 2.87439673059e-02 - 3.51532871168e-02 4.23378898536e-02 5.00090134447e-02 5.77319585491e-02 6.49555724266e-02 7.10787520021e-02 - 7.55368812409e-02 7.78881394404e-02 7.78881394404e-02 7.55368812409e-02 7.10787520021e-02 6.49555724266e-02 - 5.70612480291e-02 4.89192305177e-02 4.10571769449e-02 3.38635928392e-02 2.75721078901e-02 2.22755921268e-02 - 1.79555609317e-02 1.45226393383e-02 1.18598583649e-02 9.85294674885e-03 8.40200942373e-03 7.42492384580e-03 - 6.86170422323e-03 6.67761981445e-03 6.86170422323e-03 7.42492384580e-03 8.40200942373e-03 9.85294674885e-03 - 1.18598583649e-02 1.45226393383e-02 1.79555609317e-02 2.22755921268e-02 2.75721078901e-02 3.38635928392e-02 - 4.10571769449e-02 4.89192305177e-02 5.70612480291e-02 6.49555724266e-02 7.19923628057e-02 7.75631573239e-02 - 8.11458755837e-02 8.23828782457e-02 8.11458755837e-02 7.75631573239e-02 7.19923628057e-02 6.49555724266e-02 - 5.51031089527e-02 4.68264624901e-02 3.90347179512e-02 3.20546920774e-02 2.60582031450e-02 2.10847229658e-02 - 1.70770073925e-02 1.39256808178e-02 1.15097880648e-02 9.71912104775e-03 8.46060891145e-03 7.66146344666e-03 - 7.27338017313e-03 7.27338017313e-03 7.66146344666e-03 8.46060891145e-03 9.71912104775e-03 1.15097880648e-02 - 1.39256808178e-02 1.70770073925e-02 2.10847229658e-02 2.60582031450e-02 3.20546920774e-02 3.90347179512e-02 - 4.68264624901e-02 5.51031089527e-02 6.33842515281e-02 7.10787520021e-02 7.75631573239e-02 8.22656900591e-02 - 8.47410728024e-02 8.47410728024e-02 8.22656900591e-02 7.75631573239e-02 7.10787520021e-02 6.33842515281e-02 - 5.20147259753e-02 4.38959177953e-02 3.64263171972e-02 2.98615217076e-02 2.43103322252e-02 1.97639178277e-02 - 1.61367490443e-02 1.33116675302e-02 1.11729588764e-02 9.61987006090e-03 8.57007132232e-03 7.96341795569e-03 - 7.76490388909e-03 7.96341795569e-03 8.57007132232e-03 9.61987006090e-03 1.11729588764e-02 1.33116675302e-02 - 1.61367490443e-02 1.97639178277e-02 2.43103322252e-02 2.98615217076e-02 3.64263171972e-02 4.38959177953e-02 - 5.20147259753e-02 6.03694423859e-02 6.84139609392e-02 7.55368812409e-02 8.11458755837e-02 8.47410728024e-02 - 8.59805323971e-02 8.47410728024e-02 8.11458755837e-02 7.55368812409e-02 6.84139609392e-02 6.03694423859e-02 - 4.80406383964e-02 4.03527020822e-02 3.34242157073e-02 2.74372089612e-02 2.24420850452e-02 1.83921353899e-02 - 1.51874137660e-02 1.27148275869e-02 1.08706042529e-02 9.56702175361e-03 8.73551184506e-03 8.33057919998e-03 - 8.33057919998e-03 8.73551184506e-03 9.56702175361e-03 1.08706042529e-02 1.27148275869e-02 1.51874137660e-02 - 1.83921353899e-02 2.24420850452e-02 2.74372089612e-02 3.34242157073e-02 4.03527020822e-02 4.80406383964e-02 - 5.61547897924e-02 6.42180018992e-02 7.16581855164e-02 7.78881394404e-02 8.23828782457e-02 8.47410728024e-02 - 8.47410728024e-02 8.23828782457e-02 7.78881394404e-02 7.16581855164e-02 6.42180018992e-02 5.61547897924e-02 - 4.34838779539e-02 3.64535808156e-02 3.02323588099e-02 2.49333108373e-02 2.05587788214e-02 1.70389543521e-02 - 1.42737851127e-02 1.21629507848e-02 1.06181928008e-02 9.56702175361e-03 8.95658363692e-03 8.75631776595e-03 - 8.95658363692e-03 9.56702175361e-03 1.06181928008e-02 1.21629507848e-02 1.42737851127e-02 1.70389543521e-02 - 2.05587788214e-02 2.49333108373e-02 3.02323588099e-02 3.64535808156e-02 4.34838779539e-02 5.10737783335e-02 - 5.88318176265e-02 6.62522137956e-02 7.27796836797e-02 7.78881394404e-02 8.11458755837e-02 8.22656900591e-02 - 8.11458755837e-02 7.78881394404e-02 7.27796836797e-02 6.62522137956e-02 5.88318176265e-02 5.10737783335e-02 - 3.86662855632e-02 3.24534608631e-02 2.70402901784e-02 2.24815496090e-02 1.87467470027e-02 1.57591868798e-02 - 1.34297677852e-02 1.16751572683e-02 1.04238516982e-02 9.61987006090e-03 9.22648243576e-03 9.22648243576e-03 - 9.61987006090e-03 1.04238516982e-02 1.16751572683e-02 1.34297677852e-02 1.57591868798e-02 1.87467470027e-02 - 2.24815496090e-02 2.70402901784e-02 3.24534608631e-02 3.86662855632e-02 4.55081727847e-02 5.26787408684e-02 - 5.97584596222e-02 6.62522137956e-02 7.16581855164e-02 7.55368812409e-02 7.75631573239e-02 7.75631573239e-02 - 7.55368812409e-02 7.16581855164e-02 6.62522137956e-02 5.97584596222e-02 5.26787408684e-02 4.55081727847e-02 - 3.38859304601e-02 2.85734174953e-02 2.40011711299e-02 2.01812628043e-02 1.70678712692e-02 1.45906790875e-02 - 1.26769712537e-02 1.12609832188e-02 1.02881382638e-02 9.71912104775e-03 9.53173661310e-03 9.71912104775e-03 - 1.02881382638e-02 1.12609832188e-02 1.26769712537e-02 1.45906790875e-02 1.70678712692e-02 2.01812628043e-02 - 2.40011711299e-02 2.85734174953e-02 3.38859304601e-02 3.98358227133e-02 4.62088704848e-02 5.26787408684e-02 - 5.88318176265e-02 6.42180018992e-02 6.84139609392e-02 7.10787520021e-02 7.19923628057e-02 7.10787520021e-02 - 6.84139609392e-02 6.42180018992e-02 5.88318176265e-02 5.26787408684e-02 4.62088704848e-02 3.98358227133e-02 - 2.93819034216e-02 2.49776956914e-02 2.12198093897e-02 1.80960146721e-02 1.55601992220e-02 1.35553259639e-02 - 1.20255038743e-02 1.09215936737e-02 1.02054916185e-02 9.85294674885e-03 9.85294674885e-03 1.02054916185e-02 - 1.09215936737e-02 1.20255038743e-02 1.35553259639e-02 1.55601992220e-02 1.80960146721e-02 2.12198093897e-02 - 2.49776956914e-02 2.93819034216e-02 3.43811654173e-02 3.98358227133e-02 4.55081727847e-02 5.10737783335e-02 - 5.61547897924e-02 6.03694423859e-02 6.33842515281e-02 6.49555724266e-02 6.49555724266e-02 6.33842515281e-02 - 6.03694423859e-02 5.61547897924e-02 5.10737783335e-02 4.55081727847e-02 3.98358227133e-02 3.43811654173e-02 - 2.57176061925e-02 2.25132701769e-02 1.97871783123e-02 1.75241772421e-02 1.56960478729e-02 1.42727054437e-02 - 1.32272933414e-02 1.25396406703e-02 1.21980827392e-02 1.21980827392e-02 1.25396406703e-02 1.32272933414e-02 - 1.42727054437e-02 1.56960478729e-02 1.75241772421e-02 1.97871783123e-02 2.25132701769e-02 2.57176061925e-02 - 2.93819034216e-02 3.34304675050e-02 3.77147526395e-02 4.20165784801e-02 4.60731359718e-02 4.96193341715e-02 - 5.24339557043e-02 5.43692149489e-02 5.53499973529e-02 5.53499973529e-02 5.43692149489e-02 5.24339557043e-02 - 4.96193341715e-02 4.60731359718e-02 4.20165784801e-02 3.77147526395e-02 3.34304675050e-02 2.93819034216e-02 - 2.25132701769e-02 2.00258575799e-02 1.79167348748e-02 1.61729889157e-02 1.47756456624e-02 1.37059602390e-02 - 1.29494247541e-02 1.24976141314e-02 1.23472319177e-02 1.24976141314e-02 1.29494247541e-02 1.37059602390e-02 - 1.47756456624e-02 1.61729889157e-02 1.79167348748e-02 2.00258575799e-02 2.25132701769e-02 2.53749373622e-02 - 2.85734174953e-02 3.20210145144e-02 3.55725175924e-02 3.90350130516e-02 4.21941579647e-02 4.48486167771e-02 - 4.68401774785e-02 4.80677366203e-02 4.84815544672e-02 4.80677366203e-02 4.68401774785e-02 4.48486167771e-02 - 4.21941579647e-02 3.90350130516e-02 3.55725175924e-02 3.20210145144e-02 2.85734174953e-02 2.53749373622e-02 - 1.97871783123e-02 1.79167348748e-02 1.63370205752e-02 1.50389831834e-02 1.40109856905e-02 1.32437842255e-02 - 1.27327884289e-02 1.24770996440e-02 1.24770996440e-02 1.27327884289e-02 1.32437842255e-02 1.40109856905e-02 - 1.50389831834e-02 1.63370205752e-02 1.79167348748e-02 1.97871783123e-02 2.19482820950e-02 2.43819637041e-02 - 2.70402901784e-02 2.98349904445e-02 3.26363277502e-02 3.52857897121e-02 3.76190713504e-02 3.94908104948e-02 - 4.07924714489e-02 4.14579289512e-02 4.14579289512e-02 4.07924714489e-02 3.94908104948e-02 3.76190713504e-02 - 3.52857897121e-02 3.26363277502e-02 2.98349904445e-02 2.70402901784e-02 2.43819637041e-02 2.19482820950e-02 - 1.75241772421e-02 1.61729889157e-02 1.50389831834e-02 1.41157952825e-02 1.33976732300e-02 1.28827341282e-02 - 1.25723726562e-02 1.24686371753e-02 1.25723726562e-02 1.28827341282e-02 1.33976732300e-02 1.41157952825e-02 - 1.50389831834e-02 1.61729889157e-02 1.75241772421e-02 1.90940368490e-02 2.08735527936e-02 2.28368095394e-02 - 2.49333108373e-02 2.70827915169e-02 2.91781605866e-02 3.10978190541e-02 3.27229087590e-02 3.39533984936e-02 - 3.47182328687e-02 3.49773595797e-02 3.47182328687e-02 3.39533984936e-02 3.27229087590e-02 3.10978190541e-02 - 2.91781605866e-02 2.70827915169e-02 2.49333108373e-02 2.28368095394e-02 2.08735527936e-02 1.90940368490e-02 - 1.56960478729e-02 1.47756456624e-02 1.40109856905e-02 1.33976732300e-02 1.29342051284e-02 1.26225341258e-02 - 1.24657333634e-02 1.24657333634e-02 1.26225341258e-02 1.29342051284e-02 1.33976732300e-02 1.40109856905e-02 - 1.47756456624e-02 1.56960478729e-02 1.67754563001e-02 1.80109897723e-02 1.93892705934e-02 2.08820531014e-02 - 2.24420850452e-02 2.40022165572e-02 2.54803066383e-02 2.67889182249e-02 2.78466298707e-02 2.85879356046e-02 - 2.89691250092e-02 2.89691250092e-02 2.85879356046e-02 2.78466298707e-02 2.67889182249e-02 2.54803066383e-02 - 2.40022165572e-02 2.24420850452e-02 2.08820531014e-02 1.93892705934e-02 1.80109897723e-02 1.67754563001e-02 - 1.42727054437e-02 1.37059602390e-02 1.32437842255e-02 1.28827341282e-02 1.26225341258e-02 1.24650738064e-02 - 1.24123312979e-02 1.24650738064e-02 1.26225341258e-02 1.28827341282e-02 1.32437842255e-02 1.37059602390e-02 - 1.42727054437e-02 1.49488960464e-02 1.57370100687e-02 1.66330383744e-02 1.76229803621e-02 1.86800926235e-02 - 1.97639178277e-02 2.08223402545e-02 2.17964249596e-02 2.26267522861e-02 2.32603028496e-02 2.36566460915e-02 - 2.37914166767e-02 2.36566460915e-02 2.32603028496e-02 2.26267522861e-02 2.17964249596e-02 2.08223402545e-02 - 1.97639178277e-02 1.86800926235e-02 1.76229803621e-02 1.66330383744e-02 1.57370100687e-02 1.49488960464e-02 - 1.32272933414e-02 1.29494247541e-02 1.27327884289e-02 1.25723726562e-02 1.24657333634e-02 1.24123312979e-02 - 1.24123312979e-02 1.24657333634e-02 1.25723726562e-02 1.27327884289e-02 1.29494247541e-02 1.32272933414e-02 - 1.35733603577e-02 1.39945083398e-02 1.44944499034e-02 1.50702461704e-02 1.57094271493e-02 1.63890080671e-02 - 1.70770073925e-02 1.77355963866e-02 1.83246021902e-02 1.88053010662e-02 1.91448778653e-02 1.93203741197e-02 - 1.93203741197e-02 1.91448778653e-02 1.88053010662e-02 1.83246021902e-02 1.77355963866e-02 1.70770073925e-02 - 1.63890080671e-02 1.57094271493e-02 1.50702461704e-02 1.44944499034e-02 1.39945083398e-02 1.35733603577e-02 - 1.25396406703e-02 1.24976141314e-02 1.24770996440e-02 1.24686371753e-02 1.24657333634e-02 1.24650738064e-02 - 1.24657333634e-02 1.24686371753e-02 1.24770996440e-02 1.24976141314e-02 1.25396406703e-02 1.26143883181e-02 - 1.27333396536e-02 1.29064893850e-02 1.31397287366e-02 1.34318126710e-02 1.37726366090e-02 1.41440793855e-02 - 1.45226393383e-02 1.48820928374e-02 1.51956958667e-02 1.54388806266e-02 1.55924938344e-02 1.56449525655e-02 - 1.55924938344e-02 1.54388806266e-02 1.51956958667e-02 1.48820928374e-02 1.45226393383e-02 1.41440793855e-02 - 1.37726366090e-02 1.34318126710e-02 1.31397287366e-02 1.29064893850e-02 1.27333396536e-02 1.26143883181e-02 - 1.21980827392e-02 1.23472319177e-02 1.24770996440e-02 1.25723726562e-02 1.26225341258e-02 1.26225341258e-02 - 1.25723726562e-02 1.24770996440e-02 1.23472319177e-02 1.21980827392e-02 1.20475550421e-02 1.19137265332e-02 - 1.18131307076e-02 1.17590249893e-02 1.17590249893e-02 1.18131307076e-02 1.19137265332e-02 1.20475550421e-02 - 1.21980827392e-02 1.23472319177e-02 1.24770996440e-02 1.25723726562e-02 1.26225341258e-02 1.26225341258e-02 - 1.25723726562e-02 1.24770996440e-02 1.23472319177e-02 1.21980827392e-02 1.20475550421e-02 1.19137265332e-02 - 1.18131307076e-02 1.17590249893e-02 1.17590249893e-02 1.18131307076e-02 1.19137265332e-02 1.20475550421e-02 - 1.21980827392e-02 1.24976141314e-02 1.27327884289e-02 1.28827341282e-02 1.29342051284e-02 1.28827341282e-02 - 1.27327884289e-02 1.24976141314e-02 1.21980827392e-02 1.18598583649e-02 1.15097880648e-02 1.11729588764e-02 - 1.08706042529e-02 1.06181928008e-02 1.04238516982e-02 1.02881382638e-02 1.02054916185e-02 1.01663421573e-02 - 1.01587603229e-02 1.01697655067e-02 1.01870819285e-02 1.02011860999e-02 1.02064774226e-02 1.02011860999e-02 - 1.01870819285e-02 1.01697655067e-02 1.01587603229e-02 1.01663421573e-02 1.02054916185e-02 1.02881382638e-02 - 1.04238516982e-02 1.06181928008e-02 1.08706042529e-02 1.11729588764e-02 1.15097880648e-02 1.18598583649e-02 - 1.25396406703e-02 1.29494247541e-02 1.32437842255e-02 1.33976732300e-02 1.33976732300e-02 1.32437842255e-02 - 1.29494247541e-02 1.25396406703e-02 1.20475550421e-02 1.15097880648e-02 1.09620544703e-02 1.04356792319e-02 - 9.95507847617e-03 9.53627070961e-03 9.18679124184e-03 8.90705726329e-03 8.69246386814e-03 8.53524112695e-03 - 8.42580807925e-03 8.35413904759e-03 8.31144312544e-03 8.29158854156e-03 8.29158854156e-03 8.31144312544e-03 - 8.35413904759e-03 8.42580807925e-03 8.53524112695e-03 8.69246386814e-03 8.90705726329e-03 9.18679124184e-03 - 9.53627070961e-03 9.95507847617e-03 1.04356792319e-02 1.09620544703e-02 1.15097880648e-02 1.20475550421e-02 - 1.32272933414e-02 1.37059602390e-02 1.40109856905e-02 1.41157952825e-02 1.40109856905e-02 1.37059602390e-02 - 1.32272933414e-02 1.26143883181e-02 1.19137265332e-02 1.11729588764e-02 1.04356792319e-02 9.73748464183e-03 - 9.10381322670e-03 8.54973346172e-03 8.08133005705e-03 7.69793885145e-03 7.39443450458e-03 7.16308508658e-03 - 6.99504538611e-03 6.88181758770e-03 6.81664387654e-03 6.79537428806e-03 6.81664387654e-03 6.88181758770e-03 - 6.99504538611e-03 7.16308508658e-03 7.39443450458e-03 7.69793885145e-03 8.08133005705e-03 8.54973346172e-03 - 9.10381322670e-03 9.73748464183e-03 1.04356792319e-02 1.11729588764e-02 1.19137265332e-02 1.26143883181e-02 - 1.42727054437e-02 1.47756456624e-02 1.50389831834e-02 1.50389831834e-02 1.47756456624e-02 1.42727054437e-02 - 1.35733603577e-02 1.27333396536e-02 1.18131307076e-02 1.08706042529e-02 9.95507847617e-03 9.10381322670e-03 - 8.34122341388e-03 7.68014935330e-03 7.12420828954e-03 6.67049181789e-03 6.31209415558e-03 6.04016501968e-03 - 5.84558656512e-03 5.72047031573e-03 5.65928321674e-03 5.65928321674e-03 5.72047031573e-03 5.84558656512e-03 - 6.04016501968e-03 6.31209415558e-03 6.67049181789e-03 7.12420828954e-03 7.68014935330e-03 8.34122341388e-03 - 9.10381322670e-03 9.95507847617e-03 1.08706042529e-02 1.18131307076e-02 1.27333396536e-02 1.35733603577e-02 - 1.56960478729e-02 1.61729889157e-02 1.63370205752e-02 1.61729889157e-02 1.56960478729e-02 1.49488960464e-02 - 1.39945083398e-02 1.29064893850e-02 1.17590249893e-02 1.06181928008e-02 9.53627070961e-03 8.54973346172e-03 - 7.68014935330e-03 6.93665223838e-03 6.31909087196e-03 5.82127807001e-03 5.43377044817e-03 5.14599535674e-03 - 4.94806264494e-03 4.83232712929e-03 4.79423577304e-03 4.83232712929e-03 4.94806264494e-03 5.14599535674e-03 - 5.43377044817e-03 5.82127807001e-03 6.31909087196e-03 6.93665223838e-03 7.68014935330e-03 8.54973346172e-03 - 9.53627070961e-03 1.06181928008e-02 1.17590249893e-02 1.29064893850e-02 1.39945083398e-02 1.49488960464e-02 - 1.75241772421e-02 1.79167348748e-02 1.79167348748e-02 1.75241772421e-02 1.67754563001e-02 1.57370100687e-02 - 1.44944499034e-02 1.31397287366e-02 1.17590249893e-02 1.04238516982e-02 9.18679124184e-03 8.08133005705e-03 - 7.12420828954e-03 6.31909087196e-03 5.66079261571e-03 5.13913617973e-03 4.74176747355e-03 4.45623663297e-03 - 4.27192322596e-03 4.18152878343e-03 4.18152878343e-03 4.27192322596e-03 4.45623663297e-03 4.74176747355e-03 - 5.13913617973e-03 5.66079261571e-03 6.31909087196e-03 7.12420828954e-03 8.08133005705e-03 9.18679124184e-03 - 1.04238516982e-02 1.17590249893e-02 1.31397287366e-02 1.44944499034e-02 1.57370100687e-02 1.67754563001e-02 - 1.97871783123e-02 2.00258575799e-02 1.97871783123e-02 1.90940368490e-02 1.80109897723e-02 1.66330383744e-02 - 1.50702461704e-02 1.34318126710e-02 1.18131307076e-02 1.02881382638e-02 8.90705726329e-03 7.69793885145e-03 - 6.67049181789e-03 5.82127807001e-03 5.13913617973e-03 4.60945880297e-03 4.21692866215e-03 3.94752033538e-03 - 3.79030883078e-03 3.73863341678e-03 3.79030883078e-03 3.94752033538e-03 4.21692866215e-03 4.60945880297e-03 - 5.13913617973e-03 5.82127807001e-03 6.67049181789e-03 7.69793885145e-03 8.90705726329e-03 1.02881382638e-02 - 1.18131307076e-02 1.34318126710e-02 1.50702461704e-02 1.66330383744e-02 1.80109897723e-02 1.90940368490e-02 - 2.25132701769e-02 2.25132701769e-02 2.19482820950e-02 2.08735527936e-02 1.93892705934e-02 1.76229803621e-02 - 1.57094271493e-02 1.37726366090e-02 1.19137265332e-02 1.02054916185e-02 8.69246386814e-03 7.39443450458e-03 - 6.31209415558e-03 5.43377044817e-03 4.74176747355e-03 4.21692866215e-03 3.84131375804e-03 3.59990872378e-03 - 3.48198055848e-03 3.48198055848e-03 3.59990872378e-03 3.84131375804e-03 4.21692866215e-03 4.74176747355e-03 - 5.43377044817e-03 6.31209415558e-03 7.39443450458e-03 8.69246386814e-03 1.02054916185e-02 1.19137265332e-02 - 1.37726366090e-02 1.57094271493e-02 1.76229803621e-02 1.93892705934e-02 2.08735527936e-02 2.19482820950e-02 - 2.57176061925e-02 2.53749373622e-02 2.43819637041e-02 2.28368095394e-02 2.08820531014e-02 1.86800926235e-02 - 1.63890080671e-02 1.41440793855e-02 1.20475550421e-02 1.01663421573e-02 8.53524112695e-03 7.16308508658e-03 - 6.04016501968e-03 5.14599535674e-03 4.45623663297e-03 3.94752033538e-03 3.59990872378e-03 3.39799742507e-03 - 3.33184951460e-03 3.39799742507e-03 3.59990872378e-03 3.94752033538e-03 4.45623663297e-03 5.14599535674e-03 - 6.04016501968e-03 7.16308508658e-03 8.53524112695e-03 1.01663421573e-02 1.20475550421e-02 1.41440793855e-02 - 1.63890080671e-02 1.86800926235e-02 2.08820531014e-02 2.28368095394e-02 2.43819637041e-02 2.53749373622e-02 - 2.93819034216e-02 2.85734174953e-02 2.70402901784e-02 2.49333108373e-02 2.24420850452e-02 1.97639178277e-02 - 1.70770073925e-02 1.45226393383e-02 1.21980827392e-02 1.01587603229e-02 8.42580807925e-03 6.99504538611e-03 - 5.84558656512e-03 4.94806264494e-03 4.27192322596e-03 3.79030883078e-03 3.48198055848e-03 3.33184951460e-03 - 3.33184951460e-03 3.48198055848e-03 3.79030883078e-03 4.27192322596e-03 4.94806264494e-03 5.84558656512e-03 - 6.99504538611e-03 8.42580807925e-03 1.01587603229e-02 1.21980827392e-02 1.45226393383e-02 1.70770073925e-02 - 1.97639178277e-02 2.24420850452e-02 2.49333108373e-02 2.70402901784e-02 2.85734174953e-02 2.93819034216e-02 - 3.34304675050e-02 3.20210145144e-02 2.98349904445e-02 2.70827915169e-02 2.40022165572e-02 2.08223402545e-02 - 1.77355963866e-02 1.48820928374e-02 1.23472319177e-02 1.01697655067e-02 8.35413904759e-03 6.88181758770e-03 - 5.72047031573e-03 4.83232712929e-03 4.18152878343e-03 3.73863341678e-03 3.48198055848e-03 3.39799742507e-03 - 3.48198055848e-03 3.73863341678e-03 4.18152878343e-03 4.83232712929e-03 5.72047031573e-03 6.88181758770e-03 - 8.35413904759e-03 1.01697655067e-02 1.23472319177e-02 1.48820928374e-02 1.77355963866e-02 2.08223402545e-02 - 2.40022165572e-02 2.70827915169e-02 2.98349904445e-02 3.20210145144e-02 3.34304675050e-02 3.39176800802e-02 - 3.77147526395e-02 3.55725175924e-02 3.26363277502e-02 2.91781605866e-02 2.54803066383e-02 2.17964249596e-02 - 1.83246021902e-02 1.51956958667e-02 1.24770996440e-02 1.01870819285e-02 8.31144312544e-03 6.81664387654e-03 - 5.65928321674e-03 4.79423577304e-03 4.18152878343e-03 3.79030883078e-03 3.59990872378e-03 3.59990872378e-03 - 3.79030883078e-03 4.18152878343e-03 4.79423577304e-03 5.65928321674e-03 6.81664387654e-03 8.31144312544e-03 - 1.01870819285e-02 1.24770996440e-02 1.51956958667e-02 1.83246021902e-02 2.17964249596e-02 2.54803066383e-02 - 2.91781605866e-02 3.26363277502e-02 3.55725175924e-02 3.77147526395e-02 3.88462459817e-02 3.88462459817e-02 - 4.20165784801e-02 3.90350130516e-02 3.52857897121e-02 3.10978190541e-02 2.67889182249e-02 2.26267522861e-02 - 1.88053010662e-02 1.54388806266e-02 1.25723726562e-02 1.02011860999e-02 8.29158854156e-03 6.79537428806e-03 - 5.65928321674e-03 4.83232712929e-03 4.27192322596e-03 3.94752033538e-03 3.84131375804e-03 3.94752033538e-03 - 4.27192322596e-03 4.83232712929e-03 5.65928321674e-03 6.79537428806e-03 8.29158854156e-03 1.02011860999e-02 - 1.25723726562e-02 1.54388806266e-02 1.88053010662e-02 2.26267522861e-02 2.67889182249e-02 3.10978190541e-02 - 3.52857897121e-02 3.90350130516e-02 4.20165784801e-02 4.39402098517e-02 4.46053414397e-02 4.39402098517e-02 - 4.60731359718e-02 4.21941579647e-02 3.76190713504e-02 3.27229087590e-02 2.78466298707e-02 2.32603028496e-02 - 1.91448778653e-02 1.55924938344e-02 1.26225341258e-02 1.02064774226e-02 8.29158854156e-03 6.81664387654e-03 - 5.72047031573e-03 4.94806264494e-03 4.45623663297e-03 4.21692866215e-03 4.21692866215e-03 4.45623663297e-03 - 4.94806264494e-03 5.72047031573e-03 6.81664387654e-03 8.29158854156e-03 1.02064774226e-02 1.26225341258e-02 - 1.55924938344e-02 1.91448778653e-02 2.32603028496e-02 2.78466298707e-02 3.27229087590e-02 3.76190713504e-02 - 4.21941579647e-02 4.60731359718e-02 4.88987422193e-02 5.03893328752e-02 5.03893328752e-02 4.88987422193e-02 - 4.96193341715e-02 4.48486167771e-02 3.94908104948e-02 3.39533984936e-02 2.85879356046e-02 2.36566460915e-02 - 1.93203741197e-02 1.56449525655e-02 1.26225341258e-02 1.02011860999e-02 8.31144312544e-03 6.88181758770e-03 - 5.84558656512e-03 5.14599535674e-03 4.74176747355e-03 4.60945880297e-03 4.74176747355e-03 5.14599535674e-03 - 5.84558656512e-03 6.88181758770e-03 8.31144312544e-03 1.02011860999e-02 1.26225341258e-02 1.56449525655e-02 - 1.93203741197e-02 2.36566460915e-02 2.85879356046e-02 3.39533984936e-02 3.94908104948e-02 4.48486167771e-02 - 4.96193341715e-02 5.33923081840e-02 5.58153453540e-02 5.66509609539e-02 5.58153453540e-02 5.33923081840e-02 - 5.24339557043e-02 4.68401774785e-02 4.07924714489e-02 3.47182328687e-02 2.89691250092e-02 2.37914166767e-02 - 1.93203741197e-02 1.55924938344e-02 1.25723726562e-02 1.01870819285e-02 8.35413904759e-03 6.99504538611e-03 - 6.04016501968e-03 5.43377044817e-03 5.13913617973e-03 5.13913617973e-03 5.43377044817e-03 6.04016501968e-03 - 6.99504538611e-03 8.35413904759e-03 1.01870819285e-02 1.25723726562e-02 1.55924938344e-02 1.93203741197e-02 - 2.37914166767e-02 2.89691250092e-02 3.47182328687e-02 4.07924714489e-02 4.68401774785e-02 5.24339557043e-02 - 5.71251588417e-02 6.05090723285e-02 6.22821499923e-02 6.22821499923e-02 6.05090723285e-02 5.71251588417e-02 - 5.43692149489e-02 4.80677366203e-02 4.14579289512e-02 3.49773595797e-02 2.89691250092e-02 2.36566460915e-02 - 1.91448778653e-02 1.54388806266e-02 1.24770996440e-02 1.01697655067e-02 8.42580807925e-03 7.16308508658e-03 - 6.31209415558e-03 5.82127807001e-03 5.66079261571e-03 5.82127807001e-03 6.31209415558e-03 7.16308508658e-03 - 8.42580807925e-03 1.01697655067e-02 1.24770996440e-02 1.54388806266e-02 1.91448778653e-02 2.36566460915e-02 - 2.89691250092e-02 3.49773595797e-02 4.14579289512e-02 4.80677366203e-02 5.43692149489e-02 5.98878714669e-02 - 6.41840706496e-02 6.69101294891e-02 6.78442738531e-02 6.69101294891e-02 6.41840706496e-02 5.98878714669e-02 - 5.53499973529e-02 4.84815544672e-02 4.14579289512e-02 3.47182328687e-02 2.85879356046e-02 2.32603028496e-02 - 1.88053010662e-02 1.51956958667e-02 1.23472319177e-02 1.01587603229e-02 8.53524112695e-03 7.39443450458e-03 - 6.67049181789e-03 6.31909087196e-03 6.31909087196e-03 6.67049181789e-03 7.39443450458e-03 8.53524112695e-03 - 1.01587603229e-02 1.23472319177e-02 1.51956958667e-02 1.88053010662e-02 2.32603028496e-02 2.85879356046e-02 - 3.47182328687e-02 4.14579289512e-02 4.84815544672e-02 5.53499973529e-02 6.15702941626e-02 6.66786802062e-02 - 7.03019494995e-02 7.21810172465e-02 7.21810172465e-02 7.03019494995e-02 6.66786802062e-02 6.15702941626e-02 - 5.53499973529e-02 4.80677366203e-02 4.07924714489e-02 3.39533984936e-02 2.78466298707e-02 2.26267522861e-02 - 1.83246021902e-02 1.48820928374e-02 1.21980827392e-02 1.01663421573e-02 8.69246386814e-03 7.69793885145e-03 - 7.12420828954e-03 6.93665223838e-03 7.12420828954e-03 7.69793885145e-03 8.69246386814e-03 1.01663421573e-02 - 1.21980827392e-02 1.48820928374e-02 1.83246021902e-02 2.26267522861e-02 2.78466298707e-02 3.39533984936e-02 - 4.07924714489e-02 4.80677366203e-02 5.53499973529e-02 6.21334821617e-02 6.79320857310e-02 7.23556493700e-02 - 7.51264696898e-02 7.60705845667e-02 7.51264696898e-02 7.23556493700e-02 6.79320857310e-02 6.21334821617e-02 - 5.43692149489e-02 4.68401774785e-02 3.94908104948e-02 3.27229087590e-02 2.67889182249e-02 2.17964249596e-02 - 1.77355963866e-02 1.45226393383e-02 1.20475550421e-02 1.02054916185e-02 8.90705726329e-03 8.08133005705e-03 - 7.68014935330e-03 7.68014935330e-03 8.08133005705e-03 8.90705726329e-03 1.02054916185e-02 1.20475550421e-02 - 1.45226393383e-02 1.77355963866e-02 2.17964249596e-02 2.67889182249e-02 3.27229087590e-02 3.94908104948e-02 - 4.68401774785e-02 5.43692149489e-02 6.15702941626e-02 6.79320857310e-02 7.30418134594e-02 7.66122811094e-02 - 7.84511058955e-02 7.84511058955e-02 7.66122811094e-02 7.30418134594e-02 6.79320857310e-02 6.15702941626e-02 - 5.24339557043e-02 4.48486167771e-02 3.76190713504e-02 3.10978190541e-02 2.54803066383e-02 2.08223402545e-02 - 1.70770073925e-02 1.41440793855e-02 1.19137265332e-02 1.02881382638e-02 9.18679124184e-03 8.54973346172e-03 - 8.34122341388e-03 8.54973346172e-03 9.18679124184e-03 1.02881382638e-02 1.19137265332e-02 1.41440793855e-02 - 1.70770073925e-02 2.08223402545e-02 2.54803066383e-02 3.10978190541e-02 3.76190713504e-02 4.48486167771e-02 - 5.24339557043e-02 5.98878714669e-02 6.66786802062e-02 7.23556493700e-02 7.66122811094e-02 7.92532152557e-02 - 8.01500628124e-02 7.92532152557e-02 7.66122811094e-02 7.23556493700e-02 6.66786802062e-02 5.98878714669e-02 - 4.96193341715e-02 4.21941579647e-02 3.52857897121e-02 2.91781605866e-02 2.40022165572e-02 1.97639178277e-02 - 1.63890080671e-02 1.37726366090e-02 1.18131307076e-02 1.04238516982e-02 9.53627070961e-03 9.10381322670e-03 - 9.10381322670e-03 9.53627070961e-03 1.04238516982e-02 1.18131307076e-02 1.37726366090e-02 1.63890080671e-02 - 1.97639178277e-02 2.40022165572e-02 2.91781605866e-02 3.52857897121e-02 4.21941579647e-02 4.96193341715e-02 - 5.71251588417e-02 6.41840706496e-02 7.03019494995e-02 7.51264696898e-02 7.84511058955e-02 8.01500628124e-02 - 8.01500628124e-02 7.84511058955e-02 7.51264696898e-02 7.03019494995e-02 6.41840706496e-02 5.71251588417e-02 - 4.60731359718e-02 3.90350130516e-02 3.26363277502e-02 2.70827915169e-02 2.24420850452e-02 1.86800926235e-02 - 1.57094271493e-02 1.34318126710e-02 1.17590249893e-02 1.06181928008e-02 9.95507847617e-03 9.73748464183e-03 - 9.95507847617e-03 1.06181928008e-02 1.17590249893e-02 1.34318126710e-02 1.57094271493e-02 1.86800926235e-02 - 2.24420850452e-02 2.70827915169e-02 3.26363277502e-02 3.90350130516e-02 4.60731359718e-02 5.33923081840e-02 - 6.05090723285e-02 6.69101294891e-02 7.21810172465e-02 7.60705845667e-02 7.84511058955e-02 7.92532152557e-02 - 7.84511058955e-02 7.60705845667e-02 7.21810172465e-02 6.69101294891e-02 6.05090723285e-02 5.33923081840e-02 - 4.20165784801e-02 3.55725175924e-02 2.98349904445e-02 2.49333108373e-02 2.08820531014e-02 1.76229803621e-02 - 1.50702461704e-02 1.31397287366e-02 1.17590249893e-02 1.08706042529e-02 1.04356792319e-02 1.04356792319e-02 - 1.08706042529e-02 1.17590249893e-02 1.31397287366e-02 1.50702461704e-02 1.76229803621e-02 2.08820531014e-02 - 2.49333108373e-02 2.98349904445e-02 3.55725175924e-02 4.20165784801e-02 4.88987422193e-02 5.58153453540e-02 - 6.22821499923e-02 6.78442738531e-02 7.21810172465e-02 7.51264696898e-02 7.66122811094e-02 7.66122811094e-02 - 7.51264696898e-02 7.21810172465e-02 6.78442738531e-02 6.22821499923e-02 5.58153453540e-02 4.88987422193e-02 - 3.77147526395e-02 3.20210145144e-02 2.70402901784e-02 2.28368095394e-02 1.93892705934e-02 1.66330383744e-02 - 1.44944499034e-02 1.29064893850e-02 1.18131307076e-02 1.11729588764e-02 1.09620544703e-02 1.11729588764e-02 - 1.18131307076e-02 1.29064893850e-02 1.44944499034e-02 1.66330383744e-02 1.93892705934e-02 2.28368095394e-02 - 2.70402901784e-02 3.20210145144e-02 3.77147526395e-02 4.39402098517e-02 5.03893328752e-02 5.66509609539e-02 - 6.22821499923e-02 6.69101294891e-02 7.03019494995e-02 7.23556493700e-02 7.30418134594e-02 7.23556493700e-02 - 7.03019494995e-02 6.69101294891e-02 6.22821499923e-02 5.66509609539e-02 5.03893328752e-02 4.39402098517e-02 - 3.34304675050e-02 2.85734174953e-02 2.43819637041e-02 2.08735527936e-02 1.80109897723e-02 1.57370100687e-02 - 1.39945083398e-02 1.27333396536e-02 1.19137265332e-02 1.15097880648e-02 1.15097880648e-02 1.19137265332e-02 - 1.27333396536e-02 1.39945083398e-02 1.57370100687e-02 1.80109897723e-02 2.08735527936e-02 2.43819637041e-02 - 2.85734174953e-02 3.34304675050e-02 3.88462459817e-02 4.46053414397e-02 5.03893328752e-02 5.58153453540e-02 - 6.05090723285e-02 6.41840706496e-02 6.66786802062e-02 6.79320857310e-02 6.79320857310e-02 6.66786802062e-02 - 6.41840706496e-02 6.05090723285e-02 5.58153453540e-02 5.03893328752e-02 4.46053414397e-02 3.88462459817e-02 - 2.93819034216e-02 2.53749373622e-02 2.19482820950e-02 1.90940368490e-02 1.67754563001e-02 1.49488960464e-02 - 1.35733603577e-02 1.26143883181e-02 1.20475550421e-02 1.18598583649e-02 1.20475550421e-02 1.26143883181e-02 - 1.35733603577e-02 1.49488960464e-02 1.67754563001e-02 1.90940368490e-02 2.19482820950e-02 2.53749373622e-02 - 2.93819034216e-02 3.39176800802e-02 3.88462459817e-02 4.39402098517e-02 4.88987422193e-02 5.33923081840e-02 - 5.71251588417e-02 5.98878714669e-02 6.15702941626e-02 6.21334821617e-02 6.15702941626e-02 5.98878714669e-02 - 5.71251588417e-02 5.33923081840e-02 4.88987422193e-02 4.39402098517e-02 3.88462459817e-02 3.39176800802e-02 - 2.69304328597e-02 2.40237109616e-02 2.15413174517e-02 1.94746684497e-02 1.78072941675e-02 1.65234811342e-02 - 1.56112881223e-02 1.50645020089e-02 1.48820928374e-02 1.50645020089e-02 1.56112881223e-02 1.65234811342e-02 - 1.78072941675e-02 1.94746684497e-02 2.15413174517e-02 2.40237109616e-02 2.69304328597e-02 3.02423286704e-02 - 3.38859304601e-02 3.77147526395e-02 4.15120643887e-02 4.50208900473e-02 4.79989400749e-02 5.02828320119e-02 - 5.18281863755e-02 5.26931433274e-02 5.29676178633e-02 5.26931433274e-02 5.18281863755e-02 5.02828320119e-02 - 4.79989400749e-02 4.50208900473e-02 4.15120643887e-02 3.77147526395e-02 3.38859304601e-02 3.02423286704e-02 - 2.40237109616e-02 2.18005508565e-02 1.99070659239e-02 1.83376793613e-02 1.70848695603e-02 1.61434902729e-02 - 1.55127511572e-02 1.51956958667e-02 1.51956958667e-02 1.55127511572e-02 1.61434902729e-02 1.70848695603e-02 - 1.83376793613e-02 1.99070659239e-02 2.18005508565e-02 2.40237109616e-02 2.65706573512e-02 2.94074293899e-02 - 3.24534608631e-02 3.55725175924e-02 3.85829474965e-02 4.12888114430e-02 4.35234290368e-02 4.51877782102e-02 - 4.62623331670e-02 4.67810667612e-02 4.67810667612e-02 4.62623331670e-02 4.51877782102e-02 4.35234290368e-02 - 4.12888114430e-02 3.85829474965e-02 3.55725175924e-02 3.24534608631e-02 2.94074293899e-02 2.65706573512e-02 - 2.15413174517e-02 1.99070659239e-02 1.85201445811e-02 1.73786828448e-02 1.64818809732e-02 1.58329883187e-02 - 1.54388806266e-02 1.53065353883e-02 1.54388806266e-02 1.58329883187e-02 1.64818809732e-02 1.73786828448e-02 - 1.85201445811e-02 1.99070659239e-02 2.15413174517e-02 2.34202555044e-02 2.55281844546e-02 2.78244998346e-02 - 3.02323588099e-02 3.26363277502e-02 3.48956024912e-02 3.68707660171e-02 3.84534160516e-02 3.95849180057e-02 - 4.02540981079e-02 4.04742233092e-02 4.02540981079e-02 3.95849180057e-02 3.84534160516e-02 3.68707660171e-02 - 3.48956024912e-02 3.26363277502e-02 3.02323588099e-02 2.78244998346e-02 2.55281844546e-02 2.34202555044e-02 - 1.94746684497e-02 1.83376793613e-02 1.73786828448e-02 1.65980023724e-02 1.59997599900e-02 1.55924938344e-02 - 1.53857855201e-02 1.53857855201e-02 1.55924938344e-02 1.59997599900e-02 1.65980023724e-02 1.73786828448e-02 - 1.83376793613e-02 1.94746684497e-02 2.07887392229e-02 2.22726314479e-02 2.39063871143e-02 2.56499234494e-02 - 2.74372089612e-02 2.91781605866e-02 3.07715106065e-02 3.21243272248e-02 3.31691643222e-02 3.38709874542e-02 - 3.42208946471e-02 3.42208946471e-02 3.38709874542e-02 3.31691643222e-02 3.21243272248e-02 3.07715106065e-02 - 2.91781605866e-02 2.74372089612e-02 2.56499234494e-02 2.39063871143e-02 2.22726314479e-02 2.07887392229e-02 - 1.78072941675e-02 1.70848695603e-02 1.64818809732e-02 1.59997599900e-02 1.56449525655e-02 1.54267827082e-02 - 1.53530693596e-02 1.54267827082e-02 1.56449525655e-02 1.59997599900e-02 1.64818809732e-02 1.70848695603e-02 - 1.78072941675e-02 1.86504890434e-02 1.96135589165e-02 2.06884779452e-02 2.18557815330e-02 2.30804654510e-02 - 2.43103322252e-02 2.54803066383e-02 2.65227612839e-02 2.73794467347e-02 2.80098127199e-02 2.83925891295e-02 - 2.85205562719e-02 2.83925891295e-02 2.80098127199e-02 2.73794467347e-02 2.65227612839e-02 2.54803066383e-02 - 2.43103322252e-02 2.30804654510e-02 2.18557815330e-02 2.06884779452e-02 1.96135589165e-02 1.86504890434e-02 - 1.65234811342e-02 1.61434902729e-02 1.58329883187e-02 1.55924938344e-02 1.54267827082e-02 1.53419303249e-02 - 1.53419303249e-02 1.54267827082e-02 1.55924938344e-02 1.58329883187e-02 1.61434902729e-02 1.65234811342e-02 - 1.69767793036e-02 1.75083321070e-02 1.81196807915e-02 1.88049742175e-02 1.95479913088e-02 2.03206914317e-02 - 2.10847229658e-02 2.17964249596e-02 2.24136125305e-02 2.29016184223e-02 2.32368358951e-02 2.34067395586e-02 - 2.34067395586e-02 2.32368358951e-02 2.29016184223e-02 2.24136125305e-02 2.17964249596e-02 2.10847229658e-02 - 2.03206914317e-02 1.95479913088e-02 1.88049742175e-02 1.81196807915e-02 1.75083321070e-02 1.69767793036e-02 - 1.56112881223e-02 1.55127511572e-02 1.54388806266e-02 1.53857855201e-02 1.53530693596e-02 1.53419303249e-02 - 1.53530693596e-02 1.53857855201e-02 1.54388806266e-02 1.55127511572e-02 1.56112881223e-02 1.57423428102e-02 - 1.59162612755e-02 1.61427916872e-02 1.64272283654e-02 1.67669692380e-02 1.71497889118e-02 1.75547637226e-02 - 1.79555609317e-02 1.83246021902e-02 1.86367379277e-02 1.88720574247e-02 1.90175139009e-02 1.90666010177e-02 - 1.90175139009e-02 1.88720574247e-02 1.86367379277e-02 1.83246021902e-02 1.79555609317e-02 1.75547637226e-02 - 1.71497889118e-02 1.67669692380e-02 1.64272283654e-02 1.61427916872e-02 1.59162612755e-02 1.57423428102e-02 - 1.50645020089e-02 1.51956958667e-02 1.53065353883e-02 1.53857855201e-02 1.54267827082e-02 1.54267827082e-02 - 1.53857855201e-02 1.53065353883e-02 1.51956958667e-02 1.50645020089e-02 1.49279448733e-02 1.48031251671e-02 - 1.47072813037e-02 1.46550533623e-02 1.46550533623e-02 1.47072813037e-02 1.48031251671e-02 1.49279448733e-02 - 1.50645020089e-02 1.51956958667e-02 1.53065353883e-02 1.53857855201e-02 1.54267827082e-02 1.54267827082e-02 - 1.53857855201e-02 1.53065353883e-02 1.51956958667e-02 1.50645020089e-02 1.49279448733e-02 1.48031251671e-02 - 1.47072813037e-02 1.46550533623e-02 1.46550533623e-02 1.47072813037e-02 1.48031251671e-02 1.49279448733e-02 - 1.48820928374e-02 1.51956958667e-02 1.54388806266e-02 1.55924938344e-02 1.56449525655e-02 1.55924938344e-02 - 1.54388806266e-02 1.51956958667e-02 1.48820928374e-02 1.45226393383e-02 1.41440793855e-02 1.37726366090e-02 - 1.34318126710e-02 1.31397287366e-02 1.29064893850e-02 1.27333396536e-02 1.26143883181e-02 1.25396406703e-02 - 1.24976141314e-02 1.24770996440e-02 1.24686371753e-02 1.24657333634e-02 1.24650738064e-02 1.24657333634e-02 - 1.24686371753e-02 1.24770996440e-02 1.24976141314e-02 1.25396406703e-02 1.26143883181e-02 1.27333396536e-02 - 1.29064893850e-02 1.31397287366e-02 1.34318126710e-02 1.37726366090e-02 1.41440793855e-02 1.45226393383e-02 - 1.50645020089e-02 1.55127511572e-02 1.58329883187e-02 1.59997599900e-02 1.59997599900e-02 1.58329883187e-02 - 1.55127511572e-02 1.50645020089e-02 1.45226393383e-02 1.39256808178e-02 1.33116675302e-02 1.27148275869e-02 - 1.21629507848e-02 1.16751572683e-02 1.12609832188e-02 1.09215936737e-02 1.06524671204e-02 1.04460621935e-02 - 1.02937156151e-02 1.01870819285e-02 1.01194532806e-02 1.00865795572e-02 1.00865795572e-02 1.01194532806e-02 - 1.01870819285e-02 1.02937156151e-02 1.04460621935e-02 1.06524671204e-02 1.09215936737e-02 1.12609832188e-02 - 1.16751572683e-02 1.21629507848e-02 1.27148275869e-02 1.33116675302e-02 1.39256808178e-02 1.45226393383e-02 - 1.56112881223e-02 1.61434902729e-02 1.64818809732e-02 1.65980023724e-02 1.64818809732e-02 1.61434902729e-02 - 1.56112881223e-02 1.49279448733e-02 1.41440793855e-02 1.33116675302e-02 1.24785638223e-02 1.16845233837e-02 - 1.09586567104e-02 1.03186231402e-02 9.77183223433e-03 9.31810768724e-03 8.95261635749e-03 8.66817035987e-03 - 8.45686847188e-03 8.31144312544e-03 8.22635918544e-03 8.19834740781e-03 8.22635918544e-03 8.31144312544e-03 - 8.45686847188e-03 8.66817035987e-03 8.95261635749e-03 9.31810768724e-03 9.77183223433e-03 1.03186231402e-02 - 1.09586567104e-02 1.16845233837e-02 1.24785638223e-02 1.33116675302e-02 1.41440793855e-02 1.49279448733e-02 - 1.65234811342e-02 1.70848695603e-02 1.73786828448e-02 1.73786828448e-02 1.70848695603e-02 1.65234811342e-02 - 1.57423428102e-02 1.48031251671e-02 1.37726366090e-02 1.27148275869e-02 1.16845233837e-02 1.07235056315e-02 - 9.85925299562e-03 9.10613117226e-03 8.46823559623e-03 7.94279014126e-03 7.52314503521e-03 7.20097316500e-03 - 6.96786738821e-03 6.81664387654e-03 6.74228118806e-03 6.74228118806e-03 6.81664387654e-03 6.96786738821e-03 - 7.20097316500e-03 7.52314503521e-03 7.94279014126e-03 8.46823559623e-03 9.10613117226e-03 9.85925299562e-03 - 1.07235056315e-02 1.16845233837e-02 1.27148275869e-02 1.37726366090e-02 1.48031251671e-02 1.57423428102e-02 - 1.78072941675e-02 1.83376793613e-02 1.85201445811e-02 1.83376793613e-02 1.78072941675e-02 1.69767793036e-02 - 1.59162612755e-02 1.47072813037e-02 1.34318126710e-02 1.21629507848e-02 1.09586567104e-02 9.85925299562e-03 - 8.88822832040e-03 8.05519399644e-03 7.35981258047e-03 6.79567554150e-03 6.35335851926e-03 6.02253909249e-03 - 5.79365065764e-03 5.65928321674e-03 5.61497680711e-03 5.65928321674e-03 5.79365065764e-03 6.02253909249e-03 - 6.35335851926e-03 6.79567554150e-03 7.35981258047e-03 8.05519399644e-03 8.88822832040e-03 9.85925299562e-03 - 1.09586567104e-02 1.21629507848e-02 1.34318126710e-02 1.47072813037e-02 1.59162612755e-02 1.69767793036e-02 - 1.94746684497e-02 1.99070659239e-02 1.99070659239e-02 1.94746684497e-02 1.86504890434e-02 1.75083321070e-02 - 1.61427916872e-02 1.46550533623e-02 1.31397287366e-02 1.16751572683e-02 1.03186231402e-02 9.10613117226e-03 - 8.05519399644e-03 7.16922584820e-03 6.44245195186e-03 5.86418256271e-03 5.42174879265e-03 5.10253249618e-03 - 4.89581524939e-03 4.79423577304e-03 4.79423577304e-03 4.89581524939e-03 5.10253249618e-03 5.42174879265e-03 - 5.86418256271e-03 6.44245195186e-03 7.16922584820e-03 8.05519399644e-03 9.10613117226e-03 1.03186231402e-02 - 1.16751572683e-02 1.31397287366e-02 1.46550533623e-02 1.61427916872e-02 1.75083321070e-02 1.86504890434e-02 - 2.15413174517e-02 2.18005508565e-02 2.15413174517e-02 2.07887392229e-02 1.96135589165e-02 1.81196807915e-02 - 1.64272283654e-02 1.46550533623e-02 1.29064893850e-02 1.12609832188e-02 9.77183223433e-03 8.46823559623e-03 - 7.35981258047e-03 6.44245195186e-03 5.70420021497e-03 5.12972310883e-03 4.70304044562e-03 4.40955813989e-03 - 4.23798561825e-03 4.18152878343e-03 4.23798561825e-03 4.40955813989e-03 4.70304044562e-03 5.12972310883e-03 - 5.70420021497e-03 6.44245195186e-03 7.35981258047e-03 8.46823559623e-03 9.77183223433e-03 1.12609832188e-02 - 1.29064893850e-02 1.46550533623e-02 1.64272283654e-02 1.81196807915e-02 1.96135589165e-02 2.07887392229e-02 - 2.40237109616e-02 2.40237109616e-02 2.34202555044e-02 2.22726314479e-02 2.06884779452e-02 1.88049742175e-02 - 1.67669692380e-02 1.47072813037e-02 1.27333396536e-02 1.09215936737e-02 9.31810768724e-03 7.94279014126e-03 - 6.79567554150e-03 5.86418256271e-03 5.12972310883e-03 4.57225197605e-03 4.17292027232e-03 3.91597292758e-03 - 3.79030883078e-03 3.79030883078e-03 3.91597292758e-03 4.17292027232e-03 4.57225197605e-03 5.12972310883e-03 - 5.86418256271e-03 6.79567554150e-03 7.94279014126e-03 9.31810768724e-03 1.09215936737e-02 1.27333396536e-02 - 1.47072813037e-02 1.67669692380e-02 1.88049742175e-02 2.06884779452e-02 2.22726314479e-02 2.34202555044e-02 - 2.69304328597e-02 2.65706573512e-02 2.55281844546e-02 2.39063871143e-02 2.18557815330e-02 1.95479913088e-02 - 1.71497889118e-02 1.48031251671e-02 1.26143883181e-02 1.06524671204e-02 8.95261635749e-03 7.52314503521e-03 - 6.35335851926e-03 5.42174879265e-03 4.70304044562e-03 4.17292027232e-03 3.81054695208e-03 3.59990872378e-03 - 3.53085792774e-03 3.59990872378e-03 3.81054695208e-03 4.17292027232e-03 4.70304044562e-03 5.42174879265e-03 - 6.35335851926e-03 7.52314503521e-03 8.95261635749e-03 1.06524671204e-02 1.26143883181e-02 1.48031251671e-02 - 1.71497889118e-02 1.95479913088e-02 2.18557815330e-02 2.39063871143e-02 2.55281844546e-02 2.65706573512e-02 - 3.02423286704e-02 2.94074293899e-02 2.78244998346e-02 2.56499234494e-02 2.30804654510e-02 2.03206914317e-02 - 1.75547637226e-02 1.49279448733e-02 1.25396406703e-02 1.04460621935e-02 8.66817035987e-03 7.20097316500e-03 - 6.02253909249e-03 5.10253249618e-03 4.40955813989e-03 3.91597292758e-03 3.59990872378e-03 3.44594928533e-03 - 3.44594928533e-03 3.59990872378e-03 3.91597292758e-03 4.40955813989e-03 5.10253249618e-03 6.02253909249e-03 - 7.20097316500e-03 8.66817035987e-03 1.04460621935e-02 1.25396406703e-02 1.49279448733e-02 1.75547637226e-02 - 2.03206914317e-02 2.30804654510e-02 2.56499234494e-02 2.78244998346e-02 2.94074293899e-02 3.02423286704e-02 - 3.38859304601e-02 3.24534608631e-02 3.02323588099e-02 2.74372089612e-02 2.43103322252e-02 2.10847229658e-02 - 1.79555609317e-02 1.50645020089e-02 1.24976141314e-02 1.02937156151e-02 8.45686847188e-03 6.96786738821e-03 - 5.79365065764e-03 4.89581524939e-03 4.23798561825e-03 3.79030883078e-03 3.53085792774e-03 3.44594928533e-03 - 3.53085792774e-03 3.79030883078e-03 4.23798561825e-03 4.89581524939e-03 5.79365065764e-03 6.96786738821e-03 - 8.45686847188e-03 1.02937156151e-02 1.24976141314e-02 1.50645020089e-02 1.79555609317e-02 2.10847229658e-02 - 2.43103322252e-02 2.74372089612e-02 3.02323588099e-02 3.24534608631e-02 3.38859304601e-02 3.43811654173e-02 - 3.77147526395e-02 3.55725175924e-02 3.26363277502e-02 2.91781605866e-02 2.54803066383e-02 2.17964249596e-02 - 1.83246021902e-02 1.51956958667e-02 1.24770996440e-02 1.01870819285e-02 8.31144312544e-03 6.81664387654e-03 - 5.65928321674e-03 4.79423577304e-03 4.18152878343e-03 3.79030883078e-03 3.59990872378e-03 3.59990872378e-03 - 3.79030883078e-03 4.18152878343e-03 4.79423577304e-03 5.65928321674e-03 6.81664387654e-03 8.31144312544e-03 - 1.01870819285e-02 1.24770996440e-02 1.51956958667e-02 1.83246021902e-02 2.17964249596e-02 2.54803066383e-02 - 2.91781605866e-02 3.26363277502e-02 3.55725175924e-02 3.77147526395e-02 3.88462459817e-02 3.88462459817e-02 - 4.15120643887e-02 3.85829474965e-02 3.48956024912e-02 3.07715106065e-02 2.65227612839e-02 2.24136125305e-02 - 1.86367379277e-02 1.53065353883e-02 1.24686371753e-02 1.01194532806e-02 8.22635918544e-03 6.74228118806e-03 - 5.61497680711e-03 4.79423577304e-03 4.23798561825e-03 3.91597292758e-03 3.81054695208e-03 3.91597292758e-03 - 4.23798561825e-03 4.79423577304e-03 5.61497680711e-03 6.74228118806e-03 8.22635918544e-03 1.01194532806e-02 - 1.24686371753e-02 1.53065353883e-02 1.86367379277e-02 2.24136125305e-02 2.65227612839e-02 3.07715106065e-02 - 3.48956024912e-02 3.85829474965e-02 4.15120643887e-02 4.34003076052e-02 4.40529168852e-02 4.34003076052e-02 - 4.50208900473e-02 4.12888114430e-02 3.68707660171e-02 3.21243272248e-02 2.73794467347e-02 2.29016184223e-02 - 1.88720574247e-02 1.53857855201e-02 1.24657333634e-02 1.00865795572e-02 8.19834740781e-03 6.74228118806e-03 - 5.65928321674e-03 4.89581524939e-03 4.40955813989e-03 4.17292027232e-03 4.17292027232e-03 4.40955813989e-03 - 4.89581524939e-03 5.65928321674e-03 6.74228118806e-03 8.19834740781e-03 1.00865795572e-02 1.24657333634e-02 - 1.53857855201e-02 1.88720574247e-02 2.29016184223e-02 2.73794467347e-02 3.21243272248e-02 3.68707660171e-02 - 4.12888114430e-02 4.50208900473e-02 4.77311231410e-02 4.91578982971e-02 4.91578982971e-02 4.77311231410e-02 - 4.79989400749e-02 4.35234290368e-02 3.84534160516e-02 3.31691643222e-02 2.80098127199e-02 2.32368358951e-02 - 1.90175139009e-02 1.54267827082e-02 1.24650738064e-02 1.00865795572e-02 8.22635918544e-03 6.81664387654e-03 - 5.79365065764e-03 5.10253249618e-03 4.70304044562e-03 4.57225197605e-03 4.70304044562e-03 5.10253249618e-03 - 5.79365065764e-03 6.81664387654e-03 8.22635918544e-03 1.00865795572e-02 1.24650738064e-02 1.54267827082e-02 - 1.90175139009e-02 2.32368358951e-02 2.80098127199e-02 3.31691643222e-02 3.84534160516e-02 4.35234290368e-02 - 4.79989400749e-02 5.15101646150e-02 5.37510492057e-02 5.45211951056e-02 5.37510492057e-02 5.15101646150e-02 - 5.02828320119e-02 4.51877782102e-02 3.95849180057e-02 3.38709874542e-02 2.83925891295e-02 2.34067395586e-02 - 1.90666010177e-02 1.54267827082e-02 1.24657333634e-02 1.01194532806e-02 8.31144312544e-03 6.96786738821e-03 - 6.02253909249e-03 5.42174879265e-03 5.12972310883e-03 5.12972310883e-03 5.42174879265e-03 6.02253909249e-03 - 6.96786738821e-03 8.31144312544e-03 1.01194532806e-02 1.24657333634e-02 1.54267827082e-02 1.90666010177e-02 - 2.34067395586e-02 2.83925891295e-02 3.38709874542e-02 3.95849180057e-02 4.51877782102e-02 5.02828320119e-02 - 5.44829894560e-02 5.74676014035e-02 5.90154969276e-02 5.90154969276e-02 5.74676014035e-02 5.44829894560e-02 - 5.18281863755e-02 4.62623331670e-02 4.02540981079e-02 3.42208946471e-02 2.85205562719e-02 2.34067395586e-02 - 1.90175139009e-02 1.53857855201e-02 1.24686371753e-02 1.01870819285e-02 8.45686847188e-03 7.20097316500e-03 - 6.35335851926e-03 5.86418256271e-03 5.70420021497e-03 5.86418256271e-03 6.35335851926e-03 7.20097316500e-03 - 8.45686847188e-03 1.01870819285e-02 1.24686371753e-02 1.53857855201e-02 1.90175139009e-02 2.34067395586e-02 - 2.85205562719e-02 3.42208946471e-02 4.02540981079e-02 4.62623331670e-02 5.18281863755e-02 5.65511919643e-02 - 6.01184381094e-02 6.23288110708e-02 6.30764730892e-02 6.23288110708e-02 6.01184381094e-02 5.65511919643e-02 - 5.26931433274e-02 4.67810667612e-02 4.04742233092e-02 3.42208946471e-02 2.83925891295e-02 2.32368358951e-02 - 1.88720574247e-02 1.53065353883e-02 1.24770996440e-02 1.02937156151e-02 8.66817035987e-03 7.52314503521e-03 - 6.79567554150e-03 6.44245195186e-03 6.44245195186e-03 6.79567554150e-03 7.52314503521e-03 8.66817035987e-03 - 1.02937156151e-02 1.24770996440e-02 1.53065353883e-02 1.88720574247e-02 2.32368358951e-02 2.83925891295e-02 - 3.42208946471e-02 4.04742233092e-02 4.67810667612e-02 5.26931433274e-02 5.77843769256e-02 6.17513938278e-02 - 6.44394828494e-02 6.57918464265e-02 6.57918464265e-02 6.44394828494e-02 6.17513938278e-02 5.77843769256e-02 - 5.29676178633e-02 4.67810667612e-02 4.02540981079e-02 3.38709874542e-02 2.80098127199e-02 2.29016184223e-02 - 1.86367379277e-02 1.51956958667e-02 1.24976141314e-02 1.04460621935e-02 8.95261635749e-03 7.94279014126e-03 - 7.35981258047e-03 7.16922584820e-03 7.35981258047e-03 7.94279014126e-03 8.95261635749e-03 1.04460621935e-02 - 1.24976141314e-02 1.51956958667e-02 1.86367379277e-02 2.29016184223e-02 2.80098127199e-02 3.38709874542e-02 - 4.02540981079e-02 4.67810667612e-02 5.29676178633e-02 5.83399236929e-02 6.25800698666e-02 6.55787911247e-02 - 6.73541476702e-02 6.79419572879e-02 6.73541476702e-02 6.55787911247e-02 6.25800698666e-02 5.83399236929e-02 - 5.26931433274e-02 4.62623331670e-02 3.95849180057e-02 3.31691643222e-02 2.73794467347e-02 2.24136125305e-02 - 1.83246021902e-02 1.50645020089e-02 1.25396406703e-02 1.06524671204e-02 9.31810768724e-03 8.46823559623e-03 - 8.05519399644e-03 8.05519399644e-03 8.46823559623e-03 9.31810768724e-03 1.06524671204e-02 1.25396406703e-02 - 1.50645020089e-02 1.83246021902e-02 2.24136125305e-02 2.73794467347e-02 3.31691643222e-02 3.95849180057e-02 - 4.62623331670e-02 5.26931433274e-02 5.83399236929e-02 6.28259810566e-02 6.60504635380e-02 6.81077724909e-02 - 6.91119067669e-02 6.91119067669e-02 6.81077724909e-02 6.60504635380e-02 6.28259810566e-02 5.83399236929e-02 - 5.18281863755e-02 4.51877782102e-02 3.84534160516e-02 3.21243272248e-02 2.65227612839e-02 2.17964249596e-02 - 1.79555609317e-02 1.49279448733e-02 1.26143883181e-02 1.09215936737e-02 9.77183223433e-03 9.10613117226e-03 - 8.88822832040e-03 9.10613117226e-03 9.77183223433e-03 1.09215936737e-02 1.26143883181e-02 1.49279448733e-02 - 1.79555609317e-02 2.17964249596e-02 2.65227612839e-02 3.21243272248e-02 3.84534160516e-02 4.51877782102e-02 - 5.18281863755e-02 5.77843769256e-02 6.25800698666e-02 6.60504635380e-02 6.83266751007e-02 6.96179820017e-02 - 7.00400365127e-02 6.96179820017e-02 6.83266751007e-02 6.60504635380e-02 6.25800698666e-02 5.77843769256e-02 - 5.02828320119e-02 4.35234290368e-02 3.68707660171e-02 3.07715106065e-02 2.54803066383e-02 2.10847229658e-02 - 1.75547637226e-02 1.48031251671e-02 1.27333396536e-02 1.12609832188e-02 1.03186231402e-02 9.85925299562e-03 - 9.85925299562e-03 1.03186231402e-02 1.12609832188e-02 1.27333396536e-02 1.48031251671e-02 1.75547637226e-02 - 2.10847229658e-02 2.54803066383e-02 3.07715106065e-02 3.68707660171e-02 4.35234290368e-02 5.02828320119e-02 - 5.65511919643e-02 6.17513938278e-02 6.55787911247e-02 6.81077724909e-02 6.96179820017e-02 7.03323963389e-02 - 7.03323963389e-02 6.96179820017e-02 6.81077724909e-02 6.55787911247e-02 6.17513938278e-02 5.65511919643e-02 - 4.79989400749e-02 4.12888114430e-02 3.48956024912e-02 2.91781605866e-02 2.43103322252e-02 2.03206914317e-02 - 1.71497889118e-02 1.47072813037e-02 1.29064893850e-02 1.16751572683e-02 1.09586567104e-02 1.07235056315e-02 - 1.09586567104e-02 1.16751572683e-02 1.29064893850e-02 1.47072813037e-02 1.71497889118e-02 2.03206914317e-02 - 2.43103322252e-02 2.91781605866e-02 3.48956024912e-02 4.12888114430e-02 4.79989400749e-02 5.44829894560e-02 - 6.01184381094e-02 6.44394828494e-02 6.73541476702e-02 6.91119067669e-02 7.00400365127e-02 7.03323963389e-02 - 7.00400365127e-02 6.91119067669e-02 6.73541476702e-02 6.44394828494e-02 6.01184381094e-02 5.44829894560e-02 - 4.50208900473e-02 3.85829474965e-02 3.26363277502e-02 2.74372089612e-02 2.30804654510e-02 1.95479913088e-02 - 1.67669692380e-02 1.46550533623e-02 1.31397287366e-02 1.21629507848e-02 1.16845233837e-02 1.16845233837e-02 - 1.21629507848e-02 1.31397287366e-02 1.46550533623e-02 1.67669692380e-02 1.95479913088e-02 2.30804654510e-02 - 2.74372089612e-02 3.26363277502e-02 3.85829474965e-02 4.50208900473e-02 5.15101646150e-02 5.74676014035e-02 - 6.23288110708e-02 6.57918464265e-02 6.79419572879e-02 6.91119067669e-02 6.96179820017e-02 6.96179820017e-02 - 6.91119067669e-02 6.79419572879e-02 6.57918464265e-02 6.23288110708e-02 5.74676014035e-02 5.15101646150e-02 - 4.15120643887e-02 3.55725175924e-02 3.02323588099e-02 2.56499234494e-02 2.18557815330e-02 1.88049742175e-02 - 1.64272283654e-02 1.46550533623e-02 1.34318126710e-02 1.27148275869e-02 1.24785638223e-02 1.27148275869e-02 - 1.34318126710e-02 1.46550533623e-02 1.64272283654e-02 1.88049742175e-02 2.18557815330e-02 2.56499234494e-02 - 3.02323588099e-02 3.55725175924e-02 4.15120643887e-02 4.77311231410e-02 5.37510492057e-02 5.90154969276e-02 - 6.30764730892e-02 6.57918464265e-02 6.73541476702e-02 6.81077724909e-02 6.83266751007e-02 6.81077724909e-02 - 6.73541476702e-02 6.57918464265e-02 6.30764730892e-02 5.90154969276e-02 5.37510492057e-02 4.77311231410e-02 - 3.77147526395e-02 3.24534608631e-02 2.78244998346e-02 2.39063871143e-02 2.06884779452e-02 1.81196807915e-02 - 1.61427916872e-02 1.47072813037e-02 1.37726366090e-02 1.33116675302e-02 1.33116675302e-02 1.37726366090e-02 - 1.47072813037e-02 1.61427916872e-02 1.81196807915e-02 2.06884779452e-02 2.39063871143e-02 2.78244998346e-02 - 3.24534608631e-02 3.77147526395e-02 4.34003076052e-02 4.91578982971e-02 5.45211951056e-02 5.90154969276e-02 - 6.23288110708e-02 6.44394828494e-02 6.55787911247e-02 6.60504635380e-02 6.60504635380e-02 6.55787911247e-02 - 6.44394828494e-02 6.23288110708e-02 5.90154969276e-02 5.45211951056e-02 4.91578982971e-02 4.34003076052e-02 - 3.38859304601e-02 2.94074293899e-02 2.55281844546e-02 2.22726314479e-02 1.96135589165e-02 1.75083321070e-02 - 1.59162612755e-02 1.48031251671e-02 1.41440793855e-02 1.39256808178e-02 1.41440793855e-02 1.48031251671e-02 - 1.59162612755e-02 1.75083321070e-02 1.96135589165e-02 2.22726314479e-02 2.55281844546e-02 2.94074293899e-02 - 3.38859304601e-02 3.88462459817e-02 4.40529168852e-02 4.91578982971e-02 5.37510492057e-02 5.74676014035e-02 - 6.01184381094e-02 6.17513938278e-02 6.25800698666e-02 6.28259810566e-02 6.25800698666e-02 6.17513938278e-02 - 6.01184381094e-02 5.74676014035e-02 5.37510492057e-02 4.91578982971e-02 4.40529168852e-02 3.88462459817e-02 - 3.02423286704e-02 2.65706573512e-02 2.34202555044e-02 2.07887392229e-02 1.86504890434e-02 1.69767793036e-02 - 1.57423428102e-02 1.49279448733e-02 1.45226393383e-02 1.45226393383e-02 1.49279448733e-02 1.57423428102e-02 - 1.69767793036e-02 1.86504890434e-02 2.07887392229e-02 2.34202555044e-02 2.65706573512e-02 3.02423286704e-02 - 3.43811654173e-02 3.88462459817e-02 4.34003076052e-02 4.77311231410e-02 5.15101646150e-02 5.44829894560e-02 - 5.65511919643e-02 5.77843769256e-02 5.83399236929e-02 5.83399236929e-02 5.77843769256e-02 5.65511919643e-02 - 5.44829894560e-02 5.15101646150e-02 4.77311231410e-02 4.34003076052e-02 3.88462459817e-02 3.43811654173e-02 - 2.89647599965e-02 2.63252408289e-02 2.40594329852e-02 2.21666114252e-02 2.06439962171e-02 1.94921954522e-02 - 1.87162119832e-02 1.83246021902e-02 1.83246021902e-02 1.87162119832e-02 1.94921954522e-02 2.06439962171e-02 - 2.21666114252e-02 2.40594329852e-02 2.63252408289e-02 2.89647599965e-02 3.19590319446e-02 3.52402742752e-02 - 3.86662855632e-02 4.20165784801e-02 4.50208900473e-02 4.74231711778e-02 4.90700187394e-02 4.99825941802e-02 - 5.03535465114e-02 5.04463447592e-02 5.04463447592e-02 5.03535465114e-02 4.99825941802e-02 4.90700187394e-02 - 4.74231711778e-02 4.50208900473e-02 4.20165784801e-02 3.86662855632e-02 3.52402742752e-02 3.19590319446e-02 - 2.63252408289e-02 2.43476957086e-02 2.26519365039e-02 2.12413612776e-02 2.01220876747e-02 1.93050944183e-02 - 1.88053010662e-02 1.86367379277e-02 1.88053010662e-02 1.93050944183e-02 2.01220876747e-02 2.12413612776e-02 - 2.26519365039e-02 2.43476957086e-02 2.63252408289e-02 2.85763383726e-02 3.10717223250e-02 3.37399765679e-02 - 3.64535808156e-02 3.90350130516e-02 4.12888114430e-02 4.30547772101e-02 4.42634768270e-02 4.49623774036e-02 - 4.52857661696e-02 4.53738413591e-02 4.52857661696e-02 4.49623774036e-02 4.42634768270e-02 4.30547772101e-02 - 4.12888114430e-02 3.90350130516e-02 3.64535808156e-02 3.37399765679e-02 3.10717223250e-02 2.85763383726e-02 - 2.40594329852e-02 2.26519365039e-02 2.14468462049e-02 2.04512222766e-02 1.96777557044e-02 1.91448778653e-02 - 1.88720574247e-02 1.88720574247e-02 1.91448778653e-02 1.96777557044e-02 2.04512222766e-02 2.14468462049e-02 - 2.26519365039e-02 2.40594329852e-02 2.56635113913e-02 2.74512061786e-02 2.93901320501e-02 3.14154606035e-02 - 3.34242157073e-02 3.52857897121e-02 3.68707660171e-02 3.80886538087e-02 3.89160663350e-02 3.93968315223e-02 - 3.96081166256e-02 3.96081166256e-02 3.93968315223e-02 3.89160663350e-02 3.80886538087e-02 3.68707660171e-02 - 3.52857897121e-02 3.34242157073e-02 3.14154606035e-02 2.93901320501e-02 2.74512061786e-02 2.56635113913e-02 - 2.21666114252e-02 2.12413612776e-02 2.04512222766e-02 1.98052910067e-02 1.93203741197e-02 1.90175139009e-02 - 1.89142861556e-02 1.90175139009e-02 1.93203741197e-02 1.98052910067e-02 2.04512222766e-02 2.12413612776e-02 - 2.21666114252e-02 2.32231030162e-02 2.44059448105e-02 2.57019293917e-02 2.70818268649e-02 2.84935612207e-02 - 2.98615217076e-02 3.10978190541e-02 3.21243272248e-02 3.28952522339e-02 3.34071767353e-02 3.36893635306e-02 - 3.37780927799e-02 3.36893635306e-02 3.34071767353e-02 3.28952522339e-02 3.21243272248e-02 3.10978190541e-02 - 2.98615217076e-02 2.84935612207e-02 2.70818268649e-02 2.57019293917e-02 2.44059448105e-02 2.32231030162e-02 - 2.06439962171e-02 2.01220876747e-02 1.96777557044e-02 1.93203741197e-02 1.90666010177e-02 1.89341271390e-02 - 1.89341271390e-02 1.90666010177e-02 1.93203741197e-02 1.96777557044e-02 2.01220876747e-02 2.06439962171e-02 - 2.12421582644e-02 2.19185274002e-02 2.26718438342e-02 2.34923498457e-02 2.43576039836e-02 2.52298202509e-02 - 2.60582031450e-02 2.67889182249e-02 2.73794467347e-02 2.78094015925e-02 2.80812943983e-02 2.82105864296e-02 - 2.82105864296e-02 2.80812943983e-02 2.78094015925e-02 2.73794467347e-02 2.67889182249e-02 2.60582031450e-02 - 2.52298202509e-02 2.43576039836e-02 2.34923498457e-02 2.26718438342e-02 2.19185274002e-02 2.12421582644e-02 - 1.94921954522e-02 1.93050944183e-02 1.91448778653e-02 1.90175139009e-02 1.89341271390e-02 1.89049688962e-02 - 1.89341271390e-02 1.90175139009e-02 1.91448778653e-02 1.93050944183e-02 1.94921954522e-02 1.97084075068e-02 - 1.99620901041e-02 2.02621880335e-02 2.06126999880e-02 2.10090352784e-02 2.14361295219e-02 2.18687619531e-02 - 2.22755921268e-02 2.26267522861e-02 2.29016184223e-02 2.30924993956e-02 2.32023283361e-02 2.32378434698e-02 - 2.32023283361e-02 2.30924993956e-02 2.29016184223e-02 2.26267522861e-02 2.22755921268e-02 2.18687619531e-02 - 2.14361295219e-02 2.10090352784e-02 2.06126999880e-02 2.02621880335e-02 1.99620901041e-02 1.97084075068e-02 - 1.87162119832e-02 1.88053010662e-02 1.88720574247e-02 1.89142861556e-02 1.89341271390e-02 1.89341271390e-02 - 1.89142861556e-02 1.88720574247e-02 1.88053010662e-02 1.87162119832e-02 1.86137801375e-02 1.85132658939e-02 - 1.84326960165e-02 1.83878553878e-02 1.83878553878e-02 1.84326960165e-02 1.85132658939e-02 1.86137801375e-02 - 1.87162119832e-02 1.88053010662e-02 1.88720574247e-02 1.89142861556e-02 1.89341271390e-02 1.89341271390e-02 - 1.89142861556e-02 1.88720574247e-02 1.88053010662e-02 1.87162119832e-02 1.86137801375e-02 1.85132658939e-02 - 1.84326960165e-02 1.83878553878e-02 1.83878553878e-02 1.84326960165e-02 1.85132658939e-02 1.86137801375e-02 - 1.83246021902e-02 1.86367379277e-02 1.88720574247e-02 1.90175139009e-02 1.90666010177e-02 1.90175139009e-02 - 1.88720574247e-02 1.86367379277e-02 1.83246021902e-02 1.79555609317e-02 1.75547637226e-02 1.71497889118e-02 - 1.67669692380e-02 1.64272283654e-02 1.61427916872e-02 1.59162612755e-02 1.57423428102e-02 1.56112881223e-02 - 1.55127511572e-02 1.54388806266e-02 1.53857855201e-02 1.53530693596e-02 1.53419303249e-02 1.53530693596e-02 - 1.53857855201e-02 1.54388806266e-02 1.55127511572e-02 1.56112881223e-02 1.57423428102e-02 1.59162612755e-02 - 1.61427916872e-02 1.64272283654e-02 1.67669692380e-02 1.71497889118e-02 1.75547637226e-02 1.79555609317e-02 - 1.83246021902e-02 1.88053010662e-02 1.91448778653e-02 1.93203741197e-02 1.93203741197e-02 1.91448778653e-02 - 1.88053010662e-02 1.83246021902e-02 1.77355963866e-02 1.70770073925e-02 1.63890080671e-02 1.57094271493e-02 - 1.50702461704e-02 1.44944499034e-02 1.39945083398e-02 1.35733603577e-02 1.32272933414e-02 1.29494247541e-02 - 1.27327884289e-02 1.25723726562e-02 1.24657333634e-02 1.24123312979e-02 1.24123312979e-02 1.24657333634e-02 - 1.25723726562e-02 1.27327884289e-02 1.29494247541e-02 1.32272933414e-02 1.35733603577e-02 1.39945083398e-02 - 1.44944499034e-02 1.50702461704e-02 1.57094271493e-02 1.63890080671e-02 1.70770073925e-02 1.77355963866e-02 - 1.87162119832e-02 1.93050944183e-02 1.96777557044e-02 1.98052910067e-02 1.96777557044e-02 1.93050944183e-02 - 1.87162119832e-02 1.79555609317e-02 1.70770073925e-02 1.61367490443e-02 1.51874137660e-02 1.42737851127e-02 - 1.34297677852e-02 1.26769712537e-02 1.20255038743e-02 1.14766013692e-02 1.10259974674e-02 1.06671499136e-02 - 1.03937663652e-02 1.02011860999e-02 1.00865795572e-02 1.00485204973e-02 1.00865795572e-02 1.02011860999e-02 - 1.03937663652e-02 1.06671499136e-02 1.10259974674e-02 1.14766013692e-02 1.20255038743e-02 1.26769712537e-02 - 1.34297677852e-02 1.42737851127e-02 1.51874137660e-02 1.61367490443e-02 1.70770073925e-02 1.79555609317e-02 - 1.94921954522e-02 2.01220876747e-02 2.04512222766e-02 2.04512222766e-02 2.01220876747e-02 1.94921954522e-02 - 1.86137801375e-02 1.75547637226e-02 1.63890080671e-02 1.51874137660e-02 1.40112393540e-02 1.29079014387e-02 - 1.19093466628e-02 1.10330000246e-02 1.02846446979e-02 9.66211927865e-03 9.15892896774e-03 8.76725594498e-03 - 8.47998103933e-03 8.29158854156e-03 8.19834740781e-03 8.19834740781e-03 8.29158854156e-03 8.47998103933e-03 - 8.76725594498e-03 9.15892896774e-03 9.66211927865e-03 1.02846446979e-02 1.10330000246e-02 1.19093466628e-02 - 1.29079014387e-02 1.40112393540e-02 1.51874137660e-02 1.63890080671e-02 1.75547637226e-02 1.86137801375e-02 - 2.06439962171e-02 2.12413612776e-02 2.14468462049e-02 2.12413612776e-02 2.06439962171e-02 1.97084075068e-02 - 1.85132658939e-02 1.71497889118e-02 1.57094271493e-02 1.42737851127e-02 1.29079014387e-02 1.16573532374e-02 - 1.05489279259e-02 9.59384043225e-03 8.79214216133e-03 8.13716815266e-03 7.61927184895e-03 7.22847713667e-03 - 6.95605972443e-03 6.79537428806e-03 6.74228118806e-03 6.79537428806e-03 6.95605972443e-03 7.22847713667e-03 - 7.61927184895e-03 8.13716815266e-03 8.79214216133e-03 9.59384043225e-03 1.05489279259e-02 1.16573532374e-02 - 1.29079014387e-02 1.42737851127e-02 1.57094271493e-02 1.71497889118e-02 1.85132658939e-02 1.97084075068e-02 - 2.21666114252e-02 2.26519365039e-02 2.26519365039e-02 2.21666114252e-02 2.12421582644e-02 1.99620901041e-02 - 1.84326960165e-02 1.67669692380e-02 1.50702461704e-02 1.34297677852e-02 1.19093466628e-02 1.05489279259e-02 - 9.36769905218e-03 8.36917339040e-03 7.54684340873e-03 6.88914005847e-03 6.38291972351e-03 6.01563766373e-03 - 5.77685140016e-03 5.65928321674e-03 5.65928321674e-03 5.77685140016e-03 6.01563766373e-03 6.38291972351e-03 - 6.88914005847e-03 7.54684340873e-03 8.36917339040e-03 9.36769905218e-03 1.05489279259e-02 1.19093466628e-02 - 1.34297677852e-02 1.50702461704e-02 1.67669692380e-02 1.84326960165e-02 1.99620901041e-02 2.12421582644e-02 - 2.40594329852e-02 2.43476957086e-02 2.40594329852e-02 2.32231030162e-02 2.19185274002e-02 2.02621880335e-02 - 1.83878553878e-02 1.64272283654e-02 1.44944499034e-02 1.26769712537e-02 1.10330000246e-02 9.59384043225e-03 - 8.36917339040e-03 7.35383003280e-03 6.53448601861e-03 5.89466652251e-03 5.41768978229e-03 5.08859106656e-03 - 4.89581524939e-03 4.83232712929e-03 4.89581524939e-03 5.08859106656e-03 5.41768978229e-03 5.89466652251e-03 - 6.53448601861e-03 7.35383003280e-03 8.36917339040e-03 9.59384043225e-03 1.10330000246e-02 1.26769712537e-02 - 1.44944499034e-02 1.64272283654e-02 1.83878553878e-02 2.02621880335e-02 2.19185274002e-02 2.32231030162e-02 - 2.63252408289e-02 2.63252408289e-02 2.56635113913e-02 2.44059448105e-02 2.26718438342e-02 2.06126999880e-02 - 1.83878553878e-02 1.61427916872e-02 1.39945083398e-02 1.20255038743e-02 1.02846446979e-02 8.79214216133e-03 - 7.54684340873e-03 6.53448601861e-03 5.73495116497e-03 5.12697112440e-03 4.69069423954e-03 4.40955813989e-03 - 4.27192322596e-03 4.27192322596e-03 4.40955813989e-03 4.69069423954e-03 5.12697112440e-03 5.73495116497e-03 - 6.53448601861e-03 7.54684340873e-03 8.79214216133e-03 1.02846446979e-02 1.20255038743e-02 1.39945083398e-02 - 1.61427916872e-02 1.83878553878e-02 2.06126999880e-02 2.26718438342e-02 2.44059448105e-02 2.56635113913e-02 - 2.89647599965e-02 2.85763383726e-02 2.74512061786e-02 2.57019293917e-02 2.34923498457e-02 2.10090352784e-02 - 1.84326960165e-02 1.59162612755e-02 1.35733603577e-02 1.14766013692e-02 9.66211927865e-03 8.13716815266e-03 - 6.88914005847e-03 5.89466652251e-03 5.12697112440e-03 4.56041706509e-03 4.17292027232e-03 3.94752033538e-03 - 3.87358926493e-03 3.94752033538e-03 4.17292027232e-03 4.56041706509e-03 5.12697112440e-03 5.89466652251e-03 - 6.88914005847e-03 8.13716815266e-03 9.66211927865e-03 1.14766013692e-02 1.35733603577e-02 1.59162612755e-02 - 1.84326960165e-02 2.10090352784e-02 2.34923498457e-02 2.57019293917e-02 2.74512061786e-02 2.85763383726e-02 - 3.19590319446e-02 3.10717223250e-02 2.93901320501e-02 2.70818268649e-02 2.43576039836e-02 2.14361295219e-02 - 1.85132658939e-02 1.57423428102e-02 1.32272933414e-02 1.10259974674e-02 9.15892896774e-03 7.61927184895e-03 - 6.38291972351e-03 5.41768978229e-03 4.69069423954e-03 4.17292027232e-03 3.84131375804e-03 3.67971968314e-03 - 3.67971968314e-03 3.84131375804e-03 4.17292027232e-03 4.69069423954e-03 5.41768978229e-03 6.38291972351e-03 - 7.61927184895e-03 9.15892896774e-03 1.10259974674e-02 1.32272933414e-02 1.57423428102e-02 1.85132658939e-02 - 2.14361295219e-02 2.43576039836e-02 2.70818268649e-02 2.93901320501e-02 3.10717223250e-02 3.19590319446e-02 - 3.52402742752e-02 3.37399765679e-02 3.14154606035e-02 2.84935612207e-02 2.52298202509e-02 2.18687619531e-02 - 1.86137801375e-02 1.56112881223e-02 1.29494247541e-02 1.06671499136e-02 8.76725594498e-03 7.22847713667e-03 - 6.01563766373e-03 5.08859106656e-03 4.40955813989e-03 3.94752033538e-03 3.67971968314e-03 3.59206217435e-03 - 3.67971968314e-03 3.94752033538e-03 4.40955813989e-03 5.08859106656e-03 6.01563766373e-03 7.22847713667e-03 - 8.76725594498e-03 1.06671499136e-02 1.29494247541e-02 1.56112881223e-02 1.86137801375e-02 2.18687619531e-02 - 2.52298202509e-02 2.84935612207e-02 3.14154606035e-02 3.37399765679e-02 3.52402742752e-02 3.57591480990e-02 - 3.86662855632e-02 3.64535808156e-02 3.34242157073e-02 2.98615217076e-02 2.60582031450e-02 2.22755921268e-02 - 1.87162119832e-02 1.55127511572e-02 1.27327884289e-02 1.03937663652e-02 8.47998103933e-03 6.95605972443e-03 - 5.77685140016e-03 4.89581524939e-03 4.27192322596e-03 3.87358926493e-03 3.67971968314e-03 3.67971968314e-03 - 3.87358926493e-03 4.27192322596e-03 4.89581524939e-03 5.77685140016e-03 6.95605972443e-03 8.47998103933e-03 - 1.03937663652e-02 1.27327884289e-02 1.55127511572e-02 1.87162119832e-02 2.22755921268e-02 2.60582031450e-02 - 2.98615217076e-02 3.34242157073e-02 3.64535808156e-02 3.86662855632e-02 3.98358227133e-02 3.98358227133e-02 - 4.20165784801e-02 3.90350130516e-02 3.52857897121e-02 3.10978190541e-02 2.67889182249e-02 2.26267522861e-02 - 1.88053010662e-02 1.54388806266e-02 1.25723726562e-02 1.02011860999e-02 8.29158854156e-03 6.79537428806e-03 - 5.65928321674e-03 4.83232712929e-03 4.27192322596e-03 3.94752033538e-03 3.84131375804e-03 3.94752033538e-03 - 4.27192322596e-03 4.83232712929e-03 5.65928321674e-03 6.79537428806e-03 8.29158854156e-03 1.02011860999e-02 - 1.25723726562e-02 1.54388806266e-02 1.88053010662e-02 2.26267522861e-02 2.67889182249e-02 3.10978190541e-02 - 3.52857897121e-02 3.90350130516e-02 4.20165784801e-02 4.39402098517e-02 4.46053414397e-02 4.39402098517e-02 - 4.50208900473e-02 4.12888114430e-02 3.68707660171e-02 3.21243272248e-02 2.73794467347e-02 2.29016184223e-02 - 1.88720574247e-02 1.53857855201e-02 1.24657333634e-02 1.00865795572e-02 8.19834740781e-03 6.74228118806e-03 - 5.65928321674e-03 4.89581524939e-03 4.40955813989e-03 4.17292027232e-03 4.17292027232e-03 4.40955813989e-03 - 4.89581524939e-03 5.65928321674e-03 6.74228118806e-03 8.19834740781e-03 1.00865795572e-02 1.24657333634e-02 - 1.53857855201e-02 1.88720574247e-02 2.29016184223e-02 2.73794467347e-02 3.21243272248e-02 3.68707660171e-02 - 4.12888114430e-02 4.50208900473e-02 4.77311231410e-02 4.91578982971e-02 4.91578982971e-02 4.77311231410e-02 - 4.74231711778e-02 4.30547772101e-02 3.80886538087e-02 3.28952522339e-02 2.78094015925e-02 2.30924993956e-02 - 1.89142861556e-02 1.53530693596e-02 1.24123312979e-02 1.00485204973e-02 8.19834740781e-03 6.79537428806e-03 - 5.77685140016e-03 5.08859106656e-03 4.69069423954e-03 4.56041706509e-03 4.69069423954e-03 5.08859106656e-03 - 5.77685140016e-03 6.79537428806e-03 8.19834740781e-03 1.00485204973e-02 1.24123312979e-02 1.53530693596e-02 - 1.89142861556e-02 2.30924993956e-02 2.78094015925e-02 3.28952522339e-02 3.80886538087e-02 4.30547772101e-02 - 4.74231711778e-02 5.08390344517e-02 5.30133769166e-02 5.37595739225e-02 5.30133769166e-02 5.08390344517e-02 - 4.90700187394e-02 4.42634768270e-02 3.89160663350e-02 3.34071767353e-02 2.80812943983e-02 2.32023283361e-02 - 1.89341271390e-02 1.53419303249e-02 1.24123312979e-02 1.00865795572e-02 8.29158854156e-03 6.95605972443e-03 - 6.01563766373e-03 5.41768978229e-03 5.12697112440e-03 5.12697112440e-03 5.41768978229e-03 6.01563766373e-03 - 6.95605972443e-03 8.29158854156e-03 1.00865795572e-02 1.24123312979e-02 1.53419303249e-02 1.89341271390e-02 - 2.32023283361e-02 2.80812943983e-02 3.34071767353e-02 3.89160663350e-02 4.42634768270e-02 4.90700187394e-02 - 5.29846351657e-02 5.57363453523e-02 5.71527035674e-02 5.71527035674e-02 5.57363453523e-02 5.29846351657e-02 - 4.99825941802e-02 4.49623774036e-02 3.93968315223e-02 3.36893635306e-02 2.82105864296e-02 2.32378434698e-02 - 1.89341271390e-02 1.53530693596e-02 1.24657333634e-02 1.02011860999e-02 8.47998103933e-03 7.22847713667e-03 - 6.38291972351e-03 5.89466652251e-03 5.73495116497e-03 5.89466652251e-03 6.38291972351e-03 7.22847713667e-03 - 8.47998103933e-03 1.02011860999e-02 1.24657333634e-02 1.53530693596e-02 1.89341271390e-02 2.32378434698e-02 - 2.82105864296e-02 3.36893635306e-02 3.93968315223e-02 4.49623774036e-02 4.99825941802e-02 5.41129564364e-02 - 5.71366804742e-02 5.89627863020e-02 5.95715936141e-02 5.89627863020e-02 5.71366804742e-02 5.41129564364e-02 - 5.03535465114e-02 4.52857661696e-02 3.96081166256e-02 3.37780927799e-02 2.82105864296e-02 2.32023283361e-02 - 1.89142861556e-02 1.53857855201e-02 1.25723726562e-02 1.03937663652e-02 8.76725594498e-03 7.61927184895e-03 - 6.88914005847e-03 6.53448601861e-03 6.53448601861e-03 6.88914005847e-03 7.61927184895e-03 8.76725594498e-03 - 1.03937663652e-02 1.25723726562e-02 1.53857855201e-02 1.89142861556e-02 2.32023283361e-02 2.82105864296e-02 - 3.37780927799e-02 3.96081166256e-02 4.52857661696e-02 5.03535465114e-02 5.44475263977e-02 5.74105494947e-02 - 5.92810318582e-02 6.01752681104e-02 6.01752681104e-02 5.92810318582e-02 5.74105494947e-02 5.44475263977e-02 - 5.04463447592e-02 4.53738413591e-02 3.96081166256e-02 3.36893635306e-02 2.80812943983e-02 2.30924993956e-02 - 1.88720574247e-02 1.54388806266e-02 1.27327884289e-02 1.06671499136e-02 9.15892896774e-03 8.13716815266e-03 - 7.54684340873e-03 7.35383003280e-03 7.54684340873e-03 8.13716815266e-03 9.15892896774e-03 1.06671499136e-02 - 1.27327884289e-02 1.54388806266e-02 1.88720574247e-02 2.30924993956e-02 2.80812943983e-02 3.36893635306e-02 - 3.96081166256e-02 4.53738413591e-02 5.04463447592e-02 5.43925934286e-02 5.70772559013e-02 5.86758842735e-02 - 5.94868177545e-02 5.97323039443e-02 5.94868177545e-02 5.86758842735e-02 5.70772559013e-02 5.43925934286e-02 - 5.04463447592e-02 4.52857661696e-02 3.93968315223e-02 3.34071767353e-02 2.78094015925e-02 2.29016184223e-02 - 1.88053010662e-02 1.55127511572e-02 1.29494247541e-02 1.10259974674e-02 9.66211927865e-03 8.79214216133e-03 - 8.36917339040e-03 8.36917339040e-03 8.79214216133e-03 9.66211927865e-03 1.10259974674e-02 1.29494247541e-02 - 1.55127511572e-02 1.88053010662e-02 2.29016184223e-02 2.78094015925e-02 3.34071767353e-02 3.93968315223e-02 - 4.52857661696e-02 5.04463447592e-02 5.43239294918e-02 5.67236888968e-02 5.79103146750e-02 5.83777841365e-02 - 5.85232784436e-02 5.85232784436e-02 5.83777841365e-02 5.79103146750e-02 5.67236888968e-02 5.43239294918e-02 - 5.03535465114e-02 4.49623774036e-02 3.89160663350e-02 3.28952522339e-02 2.73794467347e-02 2.26267522861e-02 - 1.87162119832e-02 1.56112881223e-02 1.32272933414e-02 1.14766013692e-02 1.02846446979e-02 9.59384043225e-03 - 9.36769905218e-03 9.59384043225e-03 1.02846446979e-02 1.14766013692e-02 1.32272933414e-02 1.56112881223e-02 - 1.87162119832e-02 2.26267522861e-02 2.73794467347e-02 3.28952522339e-02 3.89160663350e-02 4.49623774036e-02 - 5.03535465114e-02 5.43925934286e-02 5.67236888968e-02 5.75824043038e-02 5.76200322747e-02 5.74463352203e-02 - 5.73653289979e-02 5.74463352203e-02 5.76200322747e-02 5.75824043038e-02 5.67236888968e-02 5.43925934286e-02 - 4.99825941802e-02 4.42634768270e-02 3.80886538087e-02 3.21243272248e-02 2.67889182249e-02 2.22755921268e-02 - 1.86137801375e-02 1.57423428102e-02 1.35733603577e-02 1.20255038743e-02 1.10330000246e-02 1.05489279259e-02 - 1.05489279259e-02 1.10330000246e-02 1.20255038743e-02 1.35733603577e-02 1.57423428102e-02 1.86137801375e-02 - 2.22755921268e-02 2.67889182249e-02 3.21243272248e-02 3.80886538087e-02 4.42634768270e-02 4.99825941802e-02 - 5.44475263977e-02 5.70772559013e-02 5.79103146750e-02 5.76200322747e-02 5.70355201353e-02 5.66663226477e-02 - 5.66663226477e-02 5.70355201353e-02 5.76200322747e-02 5.79103146750e-02 5.70772559013e-02 5.44475263977e-02 - 4.90700187394e-02 4.30547772101e-02 3.68707660171e-02 3.10978190541e-02 2.60582031450e-02 2.18687619531e-02 - 1.85132658939e-02 1.59162612755e-02 1.39945083398e-02 1.26769712537e-02 1.19093466628e-02 1.16573532374e-02 - 1.19093466628e-02 1.26769712537e-02 1.39945083398e-02 1.59162612755e-02 1.85132658939e-02 2.18687619531e-02 - 2.60582031450e-02 3.10978190541e-02 3.68707660171e-02 4.30547772101e-02 4.90700187394e-02 5.41129564364e-02 - 5.74105494947e-02 5.86758842735e-02 5.83777841365e-02 5.74463352203e-02 5.66663226477e-02 5.63846435627e-02 - 5.66663226477e-02 5.74463352203e-02 5.83777841365e-02 5.86758842735e-02 5.74105494947e-02 5.41129564364e-02 - 4.74231711778e-02 4.12888114430e-02 3.52857897121e-02 2.98615217076e-02 2.52298202509e-02 2.14361295219e-02 - 1.84326960165e-02 1.61427916872e-02 1.44944499034e-02 1.34297677852e-02 1.29079014387e-02 1.29079014387e-02 - 1.34297677852e-02 1.44944499034e-02 1.61427916872e-02 1.84326960165e-02 2.14361295219e-02 2.52298202509e-02 - 2.98615217076e-02 3.52857897121e-02 4.12888114430e-02 4.74231711778e-02 5.29846351657e-02 5.71366804742e-02 - 5.92810318582e-02 5.94868177545e-02 5.85232784436e-02 5.73653289979e-02 5.66663226477e-02 5.66663226477e-02 - 5.73653289979e-02 5.85232784436e-02 5.94868177545e-02 5.92810318582e-02 5.71366804742e-02 5.29846351657e-02 - 4.50208900473e-02 3.90350130516e-02 3.34242157073e-02 2.84935612207e-02 2.43576039836e-02 2.10090352784e-02 - 1.83878553878e-02 1.64272283654e-02 1.50702461704e-02 1.42737851127e-02 1.40112393540e-02 1.42737851127e-02 - 1.50702461704e-02 1.64272283654e-02 1.83878553878e-02 2.10090352784e-02 2.43576039836e-02 2.84935612207e-02 - 3.34242157073e-02 3.90350130516e-02 4.50208900473e-02 5.08390344517e-02 5.57363453523e-02 5.89627863020e-02 - 6.01752681104e-02 5.97323039443e-02 5.85232784436e-02 5.74463352203e-02 5.70355201353e-02 5.74463352203e-02 - 5.85232784436e-02 5.97323039443e-02 6.01752681104e-02 5.89627863020e-02 5.57363453523e-02 5.08390344517e-02 - 4.20165784801e-02 3.64535808156e-02 3.14154606035e-02 2.70818268649e-02 2.34923498457e-02 2.06126999880e-02 - 1.83878553878e-02 1.67669692380e-02 1.57094271493e-02 1.51874137660e-02 1.51874137660e-02 1.57094271493e-02 - 1.67669692380e-02 1.83878553878e-02 2.06126999880e-02 2.34923498457e-02 2.70818268649e-02 3.14154606035e-02 - 3.64535808156e-02 4.20165784801e-02 4.77311231410e-02 5.30133769166e-02 5.71527035674e-02 5.95715936141e-02 - 6.01752681104e-02 5.94868177545e-02 5.83777841365e-02 5.76200322747e-02 5.76200322747e-02 5.83777841365e-02 - 5.94868177545e-02 6.01752681104e-02 5.95715936141e-02 5.71527035674e-02 5.30133769166e-02 4.77311231410e-02 - 3.86662855632e-02 3.37399765679e-02 2.93901320501e-02 2.57019293917e-02 2.26718438342e-02 2.02621880335e-02 - 1.84326960165e-02 1.71497889118e-02 1.63890080671e-02 1.61367490443e-02 1.63890080671e-02 1.71497889118e-02 - 1.84326960165e-02 2.02621880335e-02 2.26718438342e-02 2.57019293917e-02 2.93901320501e-02 3.37399765679e-02 - 3.86662855632e-02 4.39402098517e-02 4.91578982971e-02 5.37595739225e-02 5.71527035674e-02 5.89627863020e-02 - 5.92810318582e-02 5.86758842735e-02 5.79103146750e-02 5.75824043038e-02 5.79103146750e-02 5.86758842735e-02 - 5.92810318582e-02 5.89627863020e-02 5.71527035674e-02 5.37595739225e-02 4.91578982971e-02 4.39402098517e-02 - 3.52402742752e-02 3.10717223250e-02 2.74512061786e-02 2.44059448105e-02 2.19185274002e-02 1.99620901041e-02 - 1.85132658939e-02 1.75547637226e-02 1.70770073925e-02 1.70770073925e-02 1.75547637226e-02 1.85132658939e-02 - 1.99620901041e-02 2.19185274002e-02 2.44059448105e-02 2.74512061786e-02 3.10717223250e-02 3.52402742752e-02 - 3.98358227133e-02 4.46053414397e-02 4.91578982971e-02 5.30133769166e-02 5.57363453523e-02 5.71366804742e-02 - 5.74105494947e-02 5.70772559013e-02 5.67236888968e-02 5.67236888968e-02 5.70772559013e-02 5.74105494947e-02 - 5.71366804742e-02 5.57363453523e-02 5.30133769166e-02 4.91578982971e-02 4.46053414397e-02 3.98358227133e-02 - 3.19590319446e-02 2.85763383726e-02 2.56635113913e-02 2.32231030162e-02 2.12421582644e-02 1.97084075068e-02 - 1.86137801375e-02 1.79555609317e-02 1.77355963866e-02 1.79555609317e-02 1.86137801375e-02 1.97084075068e-02 - 2.12421582644e-02 2.32231030162e-02 2.56635113913e-02 2.85763383726e-02 3.19590319446e-02 3.57591480990e-02 - 3.98358227133e-02 4.39402098517e-02 4.77311231410e-02 5.08390344517e-02 5.29846351657e-02 5.41129564364e-02 - 5.44475263977e-02 5.43925934286e-02 5.43239294918e-02 5.43925934286e-02 5.44475263977e-02 5.41129564364e-02 - 5.29846351657e-02 5.08390344517e-02 4.77311231410e-02 4.39402098517e-02 3.98358227133e-02 3.57591480990e-02 - 3.18414068716e-02 2.94586793037e-02 2.73972646659e-02 2.56657154446e-02 2.42781130820e-02 2.32562353108e-02 - 2.26267522861e-02 2.24136125305e-02 2.26267522861e-02 2.32562353108e-02 2.42781130820e-02 2.56657154446e-02 - 2.73972646659e-02 2.94586793037e-02 3.18414068716e-02 3.45282284639e-02 3.74634706166e-02 4.05199675384e-02 - 4.34838779539e-02 4.60731359718e-02 4.79989400749e-02 4.90700187394e-02 4.93048229800e-02 4.89738024005e-02 - 4.85080722970e-02 4.83002627794e-02 4.85080722970e-02 4.89738024005e-02 4.93048229800e-02 4.90700187394e-02 - 4.79989400749e-02 4.60731359718e-02 4.34838779539e-02 4.05199675384e-02 3.74634706166e-02 3.45282284639e-02 - 2.94586793037e-02 2.77227537368e-02 2.62153172241e-02 2.49511167951e-02 2.39549635512e-02 2.32603028496e-02 - 2.29016184223e-02 2.29016184223e-02 2.32603028496e-02 2.39549635512e-02 2.49511167951e-02 2.62153172241e-02 - 2.77227537368e-02 2.94586793037e-02 3.14127386696e-02 3.35632692529e-02 3.58537824974e-02 3.81729635435e-02 - 4.03527020822e-02 4.21941579647e-02 4.35234290368e-02 4.42634768270e-02 4.44868574481e-02 4.44045560444e-02 - 4.42752514752e-02 4.42752514752e-02 4.44045560444e-02 4.44868574481e-02 4.42634768270e-02 4.35234290368e-02 - 4.21941579647e-02 4.03527020822e-02 3.81729635435e-02 3.58537824974e-02 3.35632692529e-02 3.14127386696e-02 - 2.73972646659e-02 2.62153172241e-02 2.51823253991e-02 2.43184216158e-02 2.36566460915e-02 2.32368358951e-02 - 2.30924993956e-02 2.32368358951e-02 2.36566460915e-02 2.43184216158e-02 2.51823253991e-02 2.62153172241e-02 - 2.73972646659e-02 2.87187367840e-02 3.01717861136e-02 3.17358390207e-02 3.33624200108e-02 3.49654910486e-02 - 3.64263171972e-02 3.76190713504e-02 3.84534160516e-02 3.89160663350e-02 3.90848689472e-02 3.90976289629e-02 - 3.90842281235e-02 3.90976289629e-02 3.90848689472e-02 3.89160663350e-02 3.84534160516e-02 3.76190713504e-02 - 3.64263171972e-02 3.49654910486e-02 3.33624200108e-02 3.17358390207e-02 3.01717861136e-02 2.87187367840e-02 - 2.56657154446e-02 2.49511167951e-02 2.43184216158e-02 2.37914166767e-02 2.34067395586e-02 2.32023283361e-02 - 2.32023283361e-02 2.34067395586e-02 2.37914166767e-02 2.43184216158e-02 2.49511167951e-02 2.56657154446e-02 - 2.64534808200e-02 2.73140021666e-02 2.82446089484e-02 2.92302840650e-02 3.02357338101e-02 3.12022017908e-02 - 3.20546920774e-02 3.27229087590e-02 3.31691643222e-02 3.34071767353e-02 3.34971688966e-02 3.35158471123e-02 - 3.35158471123e-02 3.34971688966e-02 3.34071767353e-02 3.31691643222e-02 3.27229087590e-02 3.20546920774e-02 - 3.12022017908e-02 3.02357338101e-02 2.92302840650e-02 2.82446089484e-02 2.73140021666e-02 2.64534808200e-02 - 2.42781130820e-02 2.39549635512e-02 2.36566460915e-02 2.34067395586e-02 2.32378434698e-02 2.31779027969e-02 - 2.32378434698e-02 2.34067395586e-02 2.36566460915e-02 2.39549635512e-02 2.42781130820e-02 2.46187421852e-02 - 2.49827563157e-02 2.53797852965e-02 2.58139075627e-02 2.62778950395e-02 2.67502344749e-02 2.71955666447e-02 - 2.75721078901e-02 2.78466298707e-02 2.80098127199e-02 2.80812943983e-02 2.80994006567e-02 2.81005086407e-02 - 2.80994006567e-02 2.80812943983e-02 2.80098127199e-02 2.78466298707e-02 2.75721078901e-02 2.71955666447e-02 - 2.67502344749e-02 2.62778950395e-02 2.58139075627e-02 2.53797852965e-02 2.49827563157e-02 2.46187421852e-02 - 2.32562353108e-02 2.32603028496e-02 2.32368358951e-02 2.32023283361e-02 2.31779027969e-02 2.31779027969e-02 - 2.32023283361e-02 2.32368358951e-02 2.32603028496e-02 2.32562353108e-02 2.32217587400e-02 2.31688478126e-02 - 2.31175818882e-02 2.30866420056e-02 2.30866420056e-02 2.31175818882e-02 2.31688478126e-02 2.32217587400e-02 - 2.32562353108e-02 2.32603028496e-02 2.32368358951e-02 2.32023283361e-02 2.31779027969e-02 2.31779027969e-02 - 2.32023283361e-02 2.32368358951e-02 2.32603028496e-02 2.32562353108e-02 2.32217587400e-02 2.31688478126e-02 - 2.31175818882e-02 2.30866420056e-02 2.30866420056e-02 2.31175818882e-02 2.31688478126e-02 2.32217587400e-02 - 2.26267522861e-02 2.29016184223e-02 2.30924993956e-02 2.32023283361e-02 2.32378434698e-02 2.32023283361e-02 - 2.30924993956e-02 2.29016184223e-02 2.26267522861e-02 2.22755921268e-02 2.18687619531e-02 2.14361295219e-02 - 2.10090352784e-02 2.06126999880e-02 2.02621880335e-02 1.99620901041e-02 1.97084075068e-02 1.94921954522e-02 - 1.93050944183e-02 1.91448778653e-02 1.90175139009e-02 1.89341271390e-02 1.89049688962e-02 1.89341271390e-02 - 1.90175139009e-02 1.91448778653e-02 1.93050944183e-02 1.94921954522e-02 1.97084075068e-02 1.99620901041e-02 - 2.02621880335e-02 2.06126999880e-02 2.10090352784e-02 2.14361295219e-02 2.18687619531e-02 2.22755921268e-02 - 2.24136125305e-02 2.29016184223e-02 2.32368358951e-02 2.34067395586e-02 2.34067395586e-02 2.32368358951e-02 - 2.29016184223e-02 2.24136125305e-02 2.17964249596e-02 2.10847229658e-02 2.03206914317e-02 1.95479913088e-02 - 1.88049742175e-02 1.81196807915e-02 1.75083321070e-02 1.69767793036e-02 1.65234811342e-02 1.61434902729e-02 - 1.58329883187e-02 1.55924938344e-02 1.54267827082e-02 1.53419303249e-02 1.53419303249e-02 1.54267827082e-02 - 1.55924938344e-02 1.58329883187e-02 1.61434902729e-02 1.65234811342e-02 1.69767793036e-02 1.75083321070e-02 - 1.81196807915e-02 1.88049742175e-02 1.95479913088e-02 2.03206914317e-02 2.10847229658e-02 2.17964249596e-02 - 2.26267522861e-02 2.32603028496e-02 2.36566460915e-02 2.37914166767e-02 2.36566460915e-02 2.32603028496e-02 - 2.26267522861e-02 2.17964249596e-02 2.08223402545e-02 1.97639178277e-02 1.86800926235e-02 1.76229803621e-02 - 1.66330383744e-02 1.57370100687e-02 1.49488960464e-02 1.42727054437e-02 1.37059602390e-02 1.32437842255e-02 - 1.28827341282e-02 1.26225341258e-02 1.24650738064e-02 1.24123312979e-02 1.24650738064e-02 1.26225341258e-02 - 1.28827341282e-02 1.32437842255e-02 1.37059602390e-02 1.42727054437e-02 1.49488960464e-02 1.57370100687e-02 - 1.66330383744e-02 1.76229803621e-02 1.86800926235e-02 1.97639178277e-02 2.08223402545e-02 2.17964249596e-02 - 2.32562353108e-02 2.39549635512e-02 2.43184216158e-02 2.43184216158e-02 2.39549635512e-02 2.32562353108e-02 - 2.22755921268e-02 2.10847229658e-02 1.97639178277e-02 1.83921353899e-02 1.70389543521e-02 1.57591868798e-02 - 1.45906790875e-02 1.35553259639e-02 1.26620800682e-02 1.19105819676e-02 1.12951380995e-02 1.08088949298e-02 - 1.04468583553e-02 1.02064774226e-02 1.00865795572e-02 1.00865795572e-02 1.02064774226e-02 1.04468583553e-02 - 1.08088949298e-02 1.12951380995e-02 1.19105819676e-02 1.26620800682e-02 1.35553259639e-02 1.45906790875e-02 - 1.57591868798e-02 1.70389543521e-02 1.83921353899e-02 1.97639178277e-02 2.10847229658e-02 2.22755921268e-02 - 2.42781130820e-02 2.49511167951e-02 2.51823253991e-02 2.49511167951e-02 2.42781130820e-02 2.32217587400e-02 - 2.18687619531e-02 2.03206914317e-02 1.86800926235e-02 1.70389543521e-02 1.54709928045e-02 1.40283418589e-02 - 1.27424344623e-02 1.16276251073e-02 1.06856809758e-02 9.91029781221e-03 9.29162040305e-03 8.82009872524e-03 - 8.48843476768e-03 8.29158854156e-03 8.22635918544e-03 8.29158854156e-03 8.48843476768e-03 8.82009872524e-03 - 9.29162040305e-03 9.91029781221e-03 1.06856809758e-02 1.16276251073e-02 1.27424344623e-02 1.40283418589e-02 - 1.54709928045e-02 1.70389543521e-02 1.86800926235e-02 2.03206914317e-02 2.18687619531e-02 2.32217587400e-02 - 2.56657154446e-02 2.62153172241e-02 2.62153172241e-02 2.56657154446e-02 2.46187421852e-02 2.31688478126e-02 - 2.14361295219e-02 1.95479913088e-02 1.76229803621e-02 1.57591868798e-02 1.40283418589e-02 1.24755048074e-02 - 1.11228159589e-02 9.97511028176e-03 9.02578945364e-03 8.26229038338e-03 7.67065297497e-03 7.23847314555e-03 - 6.95605972443e-03 6.81664387654e-03 6.81664387654e-03 6.95605972443e-03 7.23847314555e-03 7.67065297497e-03 - 8.26229038338e-03 9.02578945364e-03 9.97511028176e-03 1.11228159589e-02 1.24755048074e-02 1.40283418589e-02 - 1.57591868798e-02 1.76229803621e-02 1.95479913088e-02 2.14361295219e-02 2.31688478126e-02 2.46187421852e-02 - 2.73972646659e-02 2.77227537368e-02 2.73972646659e-02 2.64534808200e-02 2.49827563157e-02 2.31175818882e-02 - 2.10090352784e-02 1.88049742175e-02 1.66330383744e-02 1.45906790875e-02 1.27424344623e-02 1.11228159589e-02 - 9.74245511371e-03 8.59555582378e-03 7.66717366082e-03 6.93908976898e-03 6.39361872594e-03 6.01563766373e-03 - 5.79365065764e-03 5.72047031573e-03 5.79365065764e-03 6.01563766373e-03 6.39361872594e-03 6.93908976898e-03 - 7.66717366082e-03 8.59555582378e-03 9.74245511371e-03 1.11228159589e-02 1.27424344623e-02 1.45906790875e-02 - 1.66330383744e-02 1.88049742175e-02 2.10090352784e-02 2.31175818882e-02 2.49827563157e-02 2.64534808200e-02 - 2.94586793037e-02 2.94586793037e-02 2.87187367840e-02 2.73140021666e-02 2.53797852965e-02 2.30866420056e-02 - 2.06126999880e-02 1.81196807915e-02 1.57370100687e-02 1.35553259639e-02 1.16276251073e-02 9.97511028176e-03 - 8.59555582378e-03 7.47255069610e-03 6.58362639444e-03 5.90565973456e-03 5.41768978229e-03 5.10253249618e-03 - 4.94806264494e-03 4.94806264494e-03 5.10253249618e-03 5.41768978229e-03 5.90565973456e-03 6.58362639444e-03 - 7.47255069610e-03 8.59555582378e-03 9.97511028176e-03 1.16276251073e-02 1.35553259639e-02 1.57370100687e-02 - 1.81196807915e-02 2.06126999880e-02 2.30866420056e-02 2.53797852965e-02 2.73140021666e-02 2.87187367840e-02 - 3.18414068716e-02 3.14127386696e-02 3.01717861136e-02 2.82446089484e-02 2.58139075627e-02 2.30866420056e-02 - 2.02621880335e-02 1.75083321070e-02 1.49488960464e-02 1.26620800682e-02 1.06856809758e-02 9.02578945364e-03 - 7.66717366082e-03 6.58362639444e-03 5.74602373426e-03 5.12697112440e-03 4.70304044562e-03 4.45623663297e-03 - 4.37525079151e-03 4.45623663297e-03 4.70304044562e-03 5.12697112440e-03 5.74602373426e-03 6.58362639444e-03 - 7.66717366082e-03 9.02578945364e-03 1.06856809758e-02 1.26620800682e-02 1.49488960464e-02 1.75083321070e-02 - 2.02621880335e-02 2.30866420056e-02 2.58139075627e-02 2.82446089484e-02 3.01717861136e-02 3.14127386696e-02 - 3.45282284639e-02 3.35632692529e-02 3.17358390207e-02 2.92302840650e-02 2.62778950395e-02 2.31175818882e-02 - 1.99620901041e-02 1.69767793036e-02 1.42727054437e-02 1.19105819676e-02 9.91029781221e-03 8.26229038338e-03 - 6.93908976898e-03 5.90565973456e-03 5.12697112440e-03 4.57225197605e-03 4.21692866215e-03 4.04374575730e-03 - 4.04374575730e-03 4.21692866215e-03 4.57225197605e-03 5.12697112440e-03 5.90565973456e-03 6.93908976898e-03 - 8.26229038338e-03 9.91029781221e-03 1.19105819676e-02 1.42727054437e-02 1.69767793036e-02 1.99620901041e-02 - 2.31175818882e-02 2.62778950395e-02 2.92302840650e-02 3.17358390207e-02 3.35632692529e-02 3.45282284639e-02 - 3.74634706166e-02 3.58537824974e-02 3.33624200108e-02 3.02357338101e-02 2.67502344749e-02 2.31688478126e-02 - 1.97084075068e-02 1.65234811342e-02 1.37059602390e-02 1.12951380995e-02 9.29162040305e-03 7.67065297497e-03 - 6.39361872594e-03 5.41768978229e-03 4.70304044562e-03 4.21692866215e-03 3.93522801758e-03 3.84302280796e-03 - 3.93522801758e-03 4.21692866215e-03 4.70304044562e-03 5.41768978229e-03 6.39361872594e-03 7.67065297497e-03 - 9.29162040305e-03 1.12951380995e-02 1.37059602390e-02 1.65234811342e-02 1.97084075068e-02 2.31688478126e-02 - 2.67502344749e-02 3.02357338101e-02 3.33624200108e-02 3.58537824974e-02 3.74634706166e-02 3.80204685260e-02 - 4.05199675384e-02 3.81729635435e-02 3.49654910486e-02 3.12022017908e-02 2.71955666447e-02 2.32217587400e-02 - 1.94921954522e-02 1.61434902729e-02 1.32437842255e-02 1.08088949298e-02 8.82009872524e-03 7.23847314555e-03 - 6.01563766373e-03 5.10253249618e-03 4.45623663297e-03 4.04374575730e-03 3.84302280796e-03 3.84302280796e-03 - 4.04374575730e-03 4.45623663297e-03 5.10253249618e-03 6.01563766373e-03 7.23847314555e-03 8.82009872524e-03 - 1.08088949298e-02 1.32437842255e-02 1.61434902729e-02 1.94921954522e-02 2.32217587400e-02 2.71955666447e-02 - 3.12022017908e-02 3.49654910486e-02 3.81729635435e-02 4.05199675384e-02 4.17618689283e-02 4.17618689283e-02 - 4.34838779539e-02 4.03527020822e-02 3.64263171972e-02 3.20546920774e-02 2.75721078901e-02 2.32562353108e-02 - 1.93050944183e-02 1.58329883187e-02 1.28827341282e-02 1.04468583553e-02 8.48843476768e-03 6.95605972443e-03 - 5.79365065764e-03 4.94806264494e-03 4.37525079151e-03 4.04374575730e-03 3.93522801758e-03 4.04374575730e-03 - 4.37525079151e-03 4.94806264494e-03 5.79365065764e-03 6.95605972443e-03 8.48843476768e-03 1.04468583553e-02 - 1.28827341282e-02 1.58329883187e-02 1.93050944183e-02 2.32562353108e-02 2.75721078901e-02 3.20546920774e-02 - 3.64263171972e-02 4.03527020822e-02 4.34838779539e-02 4.55081727847e-02 4.62088704848e-02 4.55081727847e-02 - 4.60731359718e-02 4.21941579647e-02 3.76190713504e-02 3.27229087590e-02 2.78466298707e-02 2.32603028496e-02 - 1.91448778653e-02 1.55924938344e-02 1.26225341258e-02 1.02064774226e-02 8.29158854156e-03 6.81664387654e-03 - 5.72047031573e-03 4.94806264494e-03 4.45623663297e-03 4.21692866215e-03 4.21692866215e-03 4.45623663297e-03 - 4.94806264494e-03 5.72047031573e-03 6.81664387654e-03 8.29158854156e-03 1.02064774226e-02 1.26225341258e-02 - 1.55924938344e-02 1.91448778653e-02 2.32603028496e-02 2.78466298707e-02 3.27229087590e-02 3.76190713504e-02 - 4.21941579647e-02 4.60731359718e-02 4.88987422193e-02 5.03893328752e-02 5.03893328752e-02 4.88987422193e-02 - 4.79989400749e-02 4.35234290368e-02 3.84534160516e-02 3.31691643222e-02 2.80098127199e-02 2.32368358951e-02 - 1.90175139009e-02 1.54267827082e-02 1.24650738064e-02 1.00865795572e-02 8.22635918544e-03 6.81664387654e-03 - 5.79365065764e-03 5.10253249618e-03 4.70304044562e-03 4.57225197605e-03 4.70304044562e-03 5.10253249618e-03 - 5.79365065764e-03 6.81664387654e-03 8.22635918544e-03 1.00865795572e-02 1.24650738064e-02 1.54267827082e-02 - 1.90175139009e-02 2.32368358951e-02 2.80098127199e-02 3.31691643222e-02 3.84534160516e-02 4.35234290368e-02 - 4.79989400749e-02 5.15101646150e-02 5.37510492057e-02 5.45211951056e-02 5.37510492057e-02 5.15101646150e-02 - 4.90700187394e-02 4.42634768270e-02 3.89160663350e-02 3.34071767353e-02 2.80812943983e-02 2.32023283361e-02 - 1.89341271390e-02 1.53419303249e-02 1.24123312979e-02 1.00865795572e-02 8.29158854156e-03 6.95605972443e-03 - 6.01563766373e-03 5.41768978229e-03 5.12697112440e-03 5.12697112440e-03 5.41768978229e-03 6.01563766373e-03 - 6.95605972443e-03 8.29158854156e-03 1.00865795572e-02 1.24123312979e-02 1.53419303249e-02 1.89341271390e-02 - 2.32023283361e-02 2.80812943983e-02 3.34071767353e-02 3.89160663350e-02 4.42634768270e-02 4.90700187394e-02 - 5.29846351657e-02 5.57363453523e-02 5.71527035674e-02 5.71527035674e-02 5.57363453523e-02 5.29846351657e-02 - 4.93048229800e-02 4.44868574481e-02 3.90848689472e-02 3.34971688966e-02 2.80994006567e-02 2.31779027969e-02 - 1.89049688962e-02 1.53419303249e-02 1.24650738064e-02 1.02064774226e-02 8.48843476768e-03 7.23847314555e-03 - 6.39361872594e-03 5.90565973456e-03 5.74602373426e-03 5.90565973456e-03 6.39361872594e-03 7.23847314555e-03 - 8.48843476768e-03 1.02064774226e-02 1.24650738064e-02 1.53419303249e-02 1.89049688962e-02 2.31779027969e-02 - 2.80994006567e-02 3.34971688966e-02 3.90848689472e-02 4.44868574481e-02 4.93048229800e-02 5.32152215954e-02 - 5.60372557288e-02 5.77208882781e-02 5.82782465337e-02 5.77208882781e-02 5.60372557288e-02 5.32152215954e-02 - 4.89738024005e-02 4.44045560444e-02 3.90976289629e-02 3.35158471123e-02 2.81005086407e-02 2.31779027969e-02 - 1.89341271390e-02 1.54267827082e-02 1.26225341258e-02 1.04468583553e-02 8.82009872524e-03 7.67065297497e-03 - 6.93908976898e-03 6.58362639444e-03 6.58362639444e-03 6.93908976898e-03 7.67065297497e-03 8.82009872524e-03 - 1.04468583553e-02 1.26225341258e-02 1.54267827082e-02 1.89341271390e-02 2.31779027969e-02 2.81005086407e-02 - 3.35158471123e-02 3.90976289629e-02 4.44045560444e-02 4.89738024005e-02 5.24797871309e-02 5.48533676650e-02 - 5.62463189889e-02 5.68740665481e-02 5.68740665481e-02 5.62463189889e-02 5.48533676650e-02 5.24797871309e-02 - 4.85080722970e-02 4.42752514752e-02 3.90842281235e-02 3.35158471123e-02 2.80994006567e-02 2.32023283361e-02 - 1.90175139009e-02 1.55924938344e-02 1.28827341282e-02 1.08088949298e-02 9.29162040305e-03 8.26229038338e-03 - 7.66717366082e-03 7.47255069610e-03 7.66717366082e-03 8.26229038338e-03 9.29162040305e-03 1.08088949298e-02 - 1.28827341282e-02 1.55924938344e-02 1.90175139009e-02 2.32023283361e-02 2.80994006567e-02 3.35158471123e-02 - 3.90842281235e-02 4.42752514752e-02 4.85080722970e-02 5.13869204668e-02 5.29210396854e-02 5.34983990182e-02 - 5.36143814352e-02 5.36149267734e-02 5.36143814352e-02 5.34983990182e-02 5.29210396854e-02 5.13869204668e-02 - 4.83002627794e-02 4.42752514752e-02 3.90976289629e-02 3.34971688966e-02 2.80812943983e-02 2.32368358951e-02 - 1.91448778653e-02 1.58329883187e-02 1.32437842255e-02 1.12951380995e-02 9.91029781221e-03 9.02578945364e-03 - 8.59555582378e-03 8.59555582378e-03 9.02578945364e-03 9.91029781221e-03 1.12951380995e-02 1.32437842255e-02 - 1.58329883187e-02 1.91448778653e-02 2.32368358951e-02 2.80812943983e-02 3.34971688966e-02 3.90976289629e-02 - 4.42752514752e-02 4.83002627794e-02 5.06194135765e-02 5.12221625406e-02 5.07010770424e-02 4.98718618187e-02 - 4.93308963719e-02 4.93308963719e-02 4.98718618187e-02 5.07010770424e-02 5.12221625406e-02 5.06194135765e-02 - 4.85080722970e-02 4.44045560444e-02 3.90848689472e-02 3.34071767353e-02 2.80098127199e-02 2.32603028496e-02 - 1.93050944183e-02 1.61434902729e-02 1.37059602390e-02 1.19105819676e-02 1.06856809758e-02 9.97511028176e-03 - 9.74245511371e-03 9.97511028176e-03 1.06856809758e-02 1.19105819676e-02 1.37059602390e-02 1.61434902729e-02 - 1.93050944183e-02 2.32603028496e-02 2.80098127199e-02 3.34071767353e-02 3.90848689472e-02 4.44045560444e-02 - 4.85080722970e-02 5.06194135765e-02 5.05555186569e-02 4.89850720157e-02 4.70389926376e-02 4.56222411881e-02 - 4.51254329663e-02 4.56222411881e-02 4.70389926376e-02 4.89850720157e-02 5.05555186569e-02 5.06194135765e-02 - 4.89738024005e-02 4.44868574481e-02 3.89160663350e-02 3.31691643222e-02 2.78466298707e-02 2.32562353108e-02 - 1.94921954522e-02 1.65234811342e-02 1.42727054437e-02 1.26620800682e-02 1.16276251073e-02 1.11228159589e-02 - 1.11228159589e-02 1.16276251073e-02 1.26620800682e-02 1.42727054437e-02 1.65234811342e-02 1.94921954522e-02 - 2.32562353108e-02 2.78466298707e-02 3.31691643222e-02 3.89160663350e-02 4.44868574481e-02 4.89738024005e-02 - 5.13869204668e-02 5.12221625406e-02 4.89850720157e-02 4.60013609401e-02 4.35588929466e-02 4.22847991283e-02 - 4.22847991283e-02 4.35588929466e-02 4.60013609401e-02 4.89850720157e-02 5.12221625406e-02 5.13869204668e-02 - 4.93048229800e-02 4.42634768270e-02 3.84534160516e-02 3.27229087590e-02 2.75721078901e-02 2.32217587400e-02 - 1.97084075068e-02 1.69767793036e-02 1.49488960464e-02 1.35553259639e-02 1.27424344623e-02 1.24755048074e-02 - 1.27424344623e-02 1.35553259639e-02 1.49488960464e-02 1.69767793036e-02 1.97084075068e-02 2.32217587400e-02 - 2.75721078901e-02 3.27229087590e-02 3.84534160516e-02 4.42634768270e-02 4.93048229800e-02 5.24797871309e-02 - 5.29210396854e-02 5.07010770424e-02 4.70389926376e-02 4.35588929466e-02 4.13123485649e-02 4.05694134160e-02 - 4.13123485649e-02 4.35588929466e-02 4.70389926376e-02 5.07010770424e-02 5.29210396854e-02 5.24797871309e-02 - 4.90700187394e-02 4.35234290368e-02 3.76190713504e-02 3.20546920774e-02 2.71955666447e-02 2.31688478126e-02 - 1.99620901041e-02 1.75083321070e-02 1.57370100687e-02 1.45906790875e-02 1.40283418589e-02 1.40283418589e-02 - 1.45906790875e-02 1.57370100687e-02 1.75083321070e-02 1.99620901041e-02 2.31688478126e-02 2.71955666447e-02 - 3.20546920774e-02 3.76190713504e-02 4.35234290368e-02 4.90700187394e-02 5.32152215954e-02 5.48533676650e-02 - 5.34983990182e-02 4.98718618187e-02 4.56222411881e-02 4.22847991283e-02 4.05694134160e-02 4.05694134160e-02 - 4.22847991283e-02 4.56222411881e-02 4.98718618187e-02 5.34983990182e-02 5.48533676650e-02 5.32152215954e-02 - 4.79989400749e-02 4.21941579647e-02 3.64263171972e-02 3.12022017908e-02 2.67502344749e-02 2.31175818882e-02 - 2.02621880335e-02 1.81196807915e-02 1.66330383744e-02 1.57591868798e-02 1.54709928045e-02 1.57591868798e-02 - 1.66330383744e-02 1.81196807915e-02 2.02621880335e-02 2.31175818882e-02 2.67502344749e-02 3.12022017908e-02 - 3.64263171972e-02 4.21941579647e-02 4.79989400749e-02 5.29846351657e-02 5.60372557288e-02 5.62463189889e-02 - 5.36143814352e-02 4.93308963719e-02 4.51254329663e-02 4.22847991283e-02 4.13123485649e-02 4.22847991283e-02 - 4.51254329663e-02 4.93308963719e-02 5.36143814352e-02 5.62463189889e-02 5.60372557288e-02 5.29846351657e-02 - 4.60731359718e-02 4.03527020822e-02 3.49654910486e-02 3.02357338101e-02 2.62778950395e-02 2.30866420056e-02 - 2.06126999880e-02 1.88049742175e-02 1.76229803621e-02 1.70389543521e-02 1.70389543521e-02 1.76229803621e-02 - 1.88049742175e-02 2.06126999880e-02 2.30866420056e-02 2.62778950395e-02 3.02357338101e-02 3.49654910486e-02 - 4.03527020822e-02 4.60731359718e-02 5.15101646150e-02 5.57363453523e-02 5.77208882781e-02 5.68740665481e-02 - 5.36149267734e-02 4.93308963719e-02 4.56222411881e-02 4.35588929466e-02 4.35588929466e-02 4.56222411881e-02 - 4.93308963719e-02 5.36149267734e-02 5.68740665481e-02 5.77208882781e-02 5.57363453523e-02 5.15101646150e-02 - 4.34838779539e-02 3.81729635435e-02 3.33624200108e-02 2.92302840650e-02 2.58139075627e-02 2.30866420056e-02 - 2.10090352784e-02 1.95479913088e-02 1.86800926235e-02 1.83921353899e-02 1.86800926235e-02 1.95479913088e-02 - 2.10090352784e-02 2.30866420056e-02 2.58139075627e-02 2.92302840650e-02 3.33624200108e-02 3.81729635435e-02 - 4.34838779539e-02 4.88987422193e-02 5.37510492057e-02 5.71527035674e-02 5.82782465337e-02 5.68740665481e-02 - 5.36143814352e-02 4.98718618187e-02 4.70389926376e-02 4.60013609401e-02 4.70389926376e-02 4.98718618187e-02 - 5.36143814352e-02 5.68740665481e-02 5.82782465337e-02 5.71527035674e-02 5.37510492057e-02 4.88987422193e-02 - 4.05199675384e-02 3.58537824974e-02 3.17358390207e-02 2.82446089484e-02 2.53797852965e-02 2.31175818882e-02 - 2.14361295219e-02 2.03206914317e-02 1.97639178277e-02 1.97639178277e-02 2.03206914317e-02 2.14361295219e-02 - 2.31175818882e-02 2.53797852965e-02 2.82446089484e-02 3.17358390207e-02 3.58537824974e-02 4.05199675384e-02 - 4.55081727847e-02 5.03893328752e-02 5.45211951056e-02 5.71527035674e-02 5.77208882781e-02 5.62463189889e-02 - 5.34983990182e-02 5.07010770424e-02 4.89850720157e-02 4.89850720157e-02 5.07010770424e-02 5.34983990182e-02 - 5.62463189889e-02 5.77208882781e-02 5.71527035674e-02 5.45211951056e-02 5.03893328752e-02 4.55081727847e-02 - 3.74634706166e-02 3.35632692529e-02 3.01717861136e-02 2.73140021666e-02 2.49827563157e-02 2.31688478126e-02 - 2.18687619531e-02 2.10847229658e-02 2.08223402545e-02 2.10847229658e-02 2.18687619531e-02 2.31688478126e-02 - 2.49827563157e-02 2.73140021666e-02 3.01717861136e-02 3.35632692529e-02 3.74634706166e-02 4.17618689283e-02 - 4.62088704848e-02 5.03893328752e-02 5.37510492057e-02 5.57363453523e-02 5.60372557288e-02 5.48533676650e-02 - 5.29210396854e-02 5.12221625406e-02 5.05555186569e-02 5.12221625406e-02 5.29210396854e-02 5.48533676650e-02 - 5.60372557288e-02 5.57363453523e-02 5.37510492057e-02 5.03893328752e-02 4.62088704848e-02 4.17618689283e-02 - 3.45282284639e-02 3.14127386696e-02 2.87187367840e-02 2.64534808200e-02 2.46187421852e-02 2.32217587400e-02 - 2.22755921268e-02 2.17964249596e-02 2.17964249596e-02 2.22755921268e-02 2.32217587400e-02 2.46187421852e-02 - 2.64534808200e-02 2.87187367840e-02 3.14127386696e-02 3.45282284639e-02 3.80204685260e-02 4.17618689283e-02 - 4.55081727847e-02 4.88987422193e-02 5.15101646150e-02 5.29846351657e-02 5.32152215954e-02 5.24797871309e-02 - 5.13869204668e-02 5.06194135765e-02 5.06194135765e-02 5.13869204668e-02 5.24797871309e-02 5.32152215954e-02 - 5.29846351657e-02 5.15101646150e-02 4.88987422193e-02 4.55081727847e-02 4.17618689283e-02 3.80204685260e-02 - 3.55932306397e-02 3.34710625414e-02 3.16041856284e-02 3.00149219248e-02 2.87439673059e-02 2.78466298707e-02 - 2.73794467347e-02 2.73794467347e-02 2.78466298707e-02 2.87439673059e-02 3.00149219248e-02 3.16041856284e-02 - 3.34710625414e-02 3.55932306397e-02 3.79563421300e-02 4.05244812822e-02 4.32002938784e-02 4.57968161948e-02 - 4.80406383964e-02 4.96193341715e-02 5.02828320119e-02 4.99825941802e-02 4.89738024005e-02 4.77793166757e-02 - 4.69885184966e-02 4.69885184966e-02 4.77793166757e-02 4.89738024005e-02 4.99825941802e-02 5.02828320119e-02 - 4.96193341715e-02 4.80406383964e-02 4.57968161948e-02 4.32002938784e-02 4.05244812822e-02 3.79563421300e-02 - 3.34710625414e-02 3.19731919657e-02 3.06330408871e-02 2.94854041377e-02 2.85879356046e-02 2.80098127199e-02 - 2.78094015925e-02 2.80098127199e-02 2.85879356046e-02 2.94854041377e-02 3.06330408871e-02 3.19731919657e-02 - 3.34710625414e-02 3.51127517762e-02 3.68889471691e-02 3.87673596218e-02 4.06654278454e-02 4.24386109393e-02 - 4.38959177953e-02 4.48486167771e-02 4.51877782102e-02 4.49623774036e-02 4.44045560444e-02 4.38595264834e-02 - 4.36365698621e-02 4.38595264834e-02 4.44045560444e-02 4.49623774036e-02 4.51877782102e-02 4.48486167771e-02 - 4.38959177953e-02 4.24386109393e-02 4.06654278454e-02 3.87673596218e-02 3.68889471691e-02 3.51127517762e-02 - 3.16041856284e-02 3.06330408871e-02 2.97391273192e-02 2.89691250092e-02 2.83925891295e-02 2.80812943983e-02 - 2.80812943983e-02 2.83925891295e-02 2.89691250092e-02 2.97391273192e-02 3.06330408871e-02 3.16041856284e-02 - 3.26341221073e-02 3.37228748044e-02 3.48695445110e-02 3.60511821341e-02 3.72078996967e-02 3.82415861113e-02 - 3.90347179512e-02 3.94908104948e-02 3.95849180057e-02 3.93968315223e-02 3.90976289629e-02 3.88830541657e-02 - 3.88830541657e-02 3.90976289629e-02 3.93968315223e-02 3.95849180057e-02 3.94908104948e-02 3.90347179512e-02 - 3.82415861113e-02 3.72078996967e-02 3.60511821341e-02 3.48695445110e-02 3.37228748044e-02 3.26341221073e-02 - 3.00149219248e-02 2.94854041377e-02 2.89691250092e-02 2.85205562719e-02 2.82105864296e-02 2.80994006567e-02 - 2.82105864296e-02 2.85205562719e-02 2.89691250092e-02 2.94854041377e-02 3.00149219248e-02 3.05340710560e-02 - 3.10465495213e-02 3.15673758761e-02 3.21049723875e-02 3.26483588385e-02 3.31615306069e-02 3.35871770820e-02 - 3.38635928392e-02 3.39533984936e-02 3.38709874542e-02 3.36893635306e-02 3.35158471123e-02 3.34454153402e-02 - 3.35158471123e-02 3.36893635306e-02 3.38709874542e-02 3.39533984936e-02 3.38635928392e-02 3.35871770820e-02 - 3.31615306069e-02 3.26483588385e-02 3.21049723875e-02 3.15673758761e-02 3.10465495213e-02 3.05340710560e-02 - 2.87439673059e-02 2.85879356046e-02 2.83925891295e-02 2.82105864296e-02 2.81005086407e-02 2.81005086407e-02 - 2.82105864296e-02 2.83925891295e-02 2.85879356046e-02 2.87439673059e-02 2.88348357920e-02 2.88661050079e-02 - 2.88631293974e-02 2.88533907006e-02 2.88533907006e-02 2.88631293974e-02 2.88661050079e-02 2.88348357920e-02 - 2.87439673059e-02 2.85879356046e-02 2.83925891295e-02 2.82105864296e-02 2.81005086407e-02 2.81005086407e-02 - 2.82105864296e-02 2.83925891295e-02 2.85879356046e-02 2.87439673059e-02 2.88348357920e-02 2.88661050079e-02 - 2.88631293974e-02 2.88533907006e-02 2.88533907006e-02 2.88631293974e-02 2.88661050079e-02 2.88348357920e-02 - 2.78466298707e-02 2.80098127199e-02 2.80812943983e-02 2.80994006567e-02 2.81005086407e-02 2.80994006567e-02 - 2.80812943983e-02 2.80098127199e-02 2.78466298707e-02 2.75721078901e-02 2.71955666447e-02 2.67502344749e-02 - 2.62778950395e-02 2.58139075627e-02 2.53797852965e-02 2.49827563157e-02 2.46187421852e-02 2.42781130820e-02 - 2.39549635512e-02 2.36566460915e-02 2.34067395586e-02 2.32378434698e-02 2.31779027969e-02 2.32378434698e-02 - 2.34067395586e-02 2.36566460915e-02 2.39549635512e-02 2.42781130820e-02 2.46187421852e-02 2.49827563157e-02 - 2.53797852965e-02 2.58139075627e-02 2.62778950395e-02 2.67502344749e-02 2.71955666447e-02 2.75721078901e-02 - 2.73794467347e-02 2.78094015925e-02 2.80812943983e-02 2.82105864296e-02 2.82105864296e-02 2.80812943983e-02 - 2.78094015925e-02 2.73794467347e-02 2.67889182249e-02 2.60582031450e-02 2.52298202509e-02 2.43576039836e-02 - 2.34923498457e-02 2.26718438342e-02 2.19185274002e-02 2.12421582644e-02 2.06439962171e-02 2.01220876747e-02 - 1.96777557044e-02 1.93203741197e-02 1.90666010177e-02 1.89341271390e-02 1.89341271390e-02 1.90666010177e-02 - 1.93203741197e-02 1.96777557044e-02 2.01220876747e-02 2.06439962171e-02 2.12421582644e-02 2.19185274002e-02 - 2.26718438342e-02 2.34923498457e-02 2.43576039836e-02 2.52298202509e-02 2.60582031450e-02 2.67889182249e-02 - 2.73794467347e-02 2.80098127199e-02 2.83925891295e-02 2.85205562719e-02 2.83925891295e-02 2.80098127199e-02 - 2.73794467347e-02 2.65227612839e-02 2.54803066383e-02 2.43103322252e-02 2.30804654510e-02 2.18557815330e-02 - 2.06884779452e-02 1.96135589165e-02 1.86504890434e-02 1.78072941675e-02 1.70848695603e-02 1.64818809732e-02 - 1.59997599900e-02 1.56449525655e-02 1.54267827082e-02 1.53530693596e-02 1.54267827082e-02 1.56449525655e-02 - 1.59997599900e-02 1.64818809732e-02 1.70848695603e-02 1.78072941675e-02 1.86504890434e-02 1.96135589165e-02 - 2.06884779452e-02 2.18557815330e-02 2.30804654510e-02 2.43103322252e-02 2.54803066383e-02 2.65227612839e-02 - 2.78466298707e-02 2.85879356046e-02 2.89691250092e-02 2.89691250092e-02 2.85879356046e-02 2.78466298707e-02 - 2.67889182249e-02 2.54803066383e-02 2.40022165572e-02 2.24420850452e-02 2.08820531014e-02 1.93892705934e-02 - 1.80109897723e-02 1.67754563001e-02 1.56960478729e-02 1.47756456624e-02 1.40109856905e-02 1.33976732300e-02 - 1.29342051284e-02 1.26225341258e-02 1.24657333634e-02 1.24657333634e-02 1.26225341258e-02 1.29342051284e-02 - 1.33976732300e-02 1.40109856905e-02 1.47756456624e-02 1.56960478729e-02 1.67754563001e-02 1.80109897723e-02 - 1.93892705934e-02 2.08820531014e-02 2.24420850452e-02 2.40022165572e-02 2.54803066383e-02 2.67889182249e-02 - 2.87439673059e-02 2.94854041377e-02 2.97391273192e-02 2.94854041377e-02 2.87439673059e-02 2.75721078901e-02 - 2.60582031450e-02 2.43103322252e-02 2.24420850452e-02 2.05587788214e-02 1.87467470027e-02 1.70678712692e-02 - 1.55601992220e-02 1.42425749040e-02 1.31198380533e-02 1.21873907787e-02 1.14361707830e-02 1.08577130860e-02 - 1.04468583553e-02 1.02011860999e-02 1.01194532806e-02 1.02011860999e-02 1.04468583553e-02 1.08577130860e-02 - 1.14361707830e-02 1.21873907787e-02 1.31198380533e-02 1.42425749040e-02 1.55601992220e-02 1.70678712692e-02 - 1.87467470027e-02 2.05587788214e-02 2.24420850452e-02 2.43103322252e-02 2.60582031450e-02 2.75721078901e-02 - 3.00149219248e-02 3.06330408871e-02 3.06330408871e-02 3.00149219248e-02 2.88348357920e-02 2.71955666447e-02 - 2.52298202509e-02 2.30804654510e-02 2.08820531014e-02 1.87467470027e-02 1.67567114426e-02 1.49636867906e-02 - 1.33939588194e-02 1.20550163598e-02 1.09414577715e-02 1.00404664762e-02 9.33741418467e-03 8.82009872524e-03 - 8.47998103933e-03 8.31144312544e-03 8.31144312544e-03 8.47998103933e-03 8.82009872524e-03 9.33741418467e-03 - 1.00404664762e-02 1.09414577715e-02 1.20550163598e-02 1.33939588194e-02 1.49636867906e-02 1.67567114426e-02 - 1.87467470027e-02 2.08820531014e-02 2.30804654510e-02 2.52298202509e-02 2.71955666447e-02 2.88348357920e-02 - 3.16041856284e-02 3.19731919657e-02 3.16041856284e-02 3.05340710560e-02 2.88661050079e-02 2.67502344749e-02 - 2.43576039836e-02 2.18557815330e-02 1.93892705934e-02 1.70678712692e-02 1.49636867906e-02 1.31152359900e-02 - 1.15351431719e-02 1.02181471415e-02 9.14830218340e-03 8.30549434438e-03 7.67065297497e-03 7.22847713667e-03 - 6.96786738821e-03 6.88181758770e-03 6.96786738821e-03 7.22847713667e-03 7.67065297497e-03 8.30549434438e-03 - 9.14830218340e-03 1.02181471415e-02 1.15351431719e-02 1.31152359900e-02 1.49636867906e-02 1.70678712692e-02 - 1.93892705934e-02 2.18557815330e-02 2.43576039836e-02 2.67502344749e-02 2.88661050079e-02 3.05340710560e-02 - 3.34710625414e-02 3.34710625414e-02 3.26341221073e-02 3.10465495213e-02 2.88631293974e-02 2.62778950395e-02 - 2.34923498457e-02 2.06884779452e-02 1.80109897723e-02 1.55601992220e-02 1.33939588194e-02 1.15351431719e-02 - 9.98127039361e-03 8.71419097250e-03 7.70870330534e-03 6.93908976898e-03 6.38291972351e-03 6.02253909249e-03 - 5.84558656512e-03 5.84558656512e-03 6.02253909249e-03 6.38291972351e-03 6.93908976898e-03 7.70870330534e-03 - 8.71419097250e-03 9.98127039361e-03 1.15351431719e-02 1.33939588194e-02 1.55601992220e-02 1.80109897723e-02 - 2.06884779452e-02 2.34923498457e-02 2.62778950395e-02 2.88631293974e-02 3.10465495213e-02 3.26341221073e-02 - 3.55932306397e-02 3.51127517762e-02 3.37228748044e-02 3.15673758761e-02 2.88533907006e-02 2.58139075627e-02 - 2.26718438342e-02 1.96135589165e-02 1.67754563001e-02 1.42425749040e-02 1.20550163598e-02 1.02181471415e-02 - 8.71419097250e-03 7.51351058269e-03 6.58362639444e-03 5.89466652251e-03 5.42174879265e-03 5.14599535674e-03 - 5.05545032098e-03 5.14599535674e-03 5.42174879265e-03 5.89466652251e-03 6.58362639444e-03 7.51351058269e-03 - 8.71419097250e-03 1.02181471415e-02 1.20550163598e-02 1.42425749040e-02 1.67754563001e-02 1.96135589165e-02 - 2.26718438342e-02 2.58139075627e-02 2.88533907006e-02 3.15673758761e-02 3.37228748044e-02 3.51127517762e-02 - 3.79563421300e-02 3.68889471691e-02 3.48695445110e-02 3.21049723875e-02 2.88533907006e-02 2.53797852965e-02 - 2.19185274002e-02 1.86504890434e-02 1.56960478729e-02 1.31198380533e-02 1.09414577715e-02 9.14830218340e-03 - 7.70870330534e-03 6.58362639444e-03 5.73495116497e-03 5.12972310883e-03 4.74176747355e-03 4.55262020357e-03 - 4.55262020357e-03 4.74176747355e-03 5.12972310883e-03 5.73495116497e-03 6.58362639444e-03 7.70870330534e-03 - 9.14830218340e-03 1.09414577715e-02 1.31198380533e-02 1.56960478729e-02 1.86504890434e-02 2.19185274002e-02 - 2.53797852965e-02 2.88533907006e-02 3.21049723875e-02 3.48695445110e-02 3.68889471691e-02 3.79563421300e-02 - 4.05244812822e-02 3.87673596218e-02 3.60511821341e-02 3.26483588385e-02 2.88631293974e-02 2.49827563157e-02 - 2.12421582644e-02 1.78072941675e-02 1.47756456624e-02 1.21873907787e-02 1.00404664762e-02 8.30549434438e-03 - 6.93908976898e-03 5.89466652251e-03 5.12972310883e-03 4.60945880297e-03 4.30805835198e-03 4.20942844716e-03 - 4.30805835198e-03 4.60945880297e-03 5.12972310883e-03 5.89466652251e-03 6.93908976898e-03 8.30549434438e-03 - 1.00404664762e-02 1.21873907787e-02 1.47756456624e-02 1.78072941675e-02 2.12421582644e-02 2.49827563157e-02 - 2.88631293974e-02 3.26483588385e-02 3.60511821341e-02 3.87673596218e-02 4.05244812822e-02 4.11328816616e-02 - 4.32002938784e-02 4.06654278454e-02 3.72078996967e-02 3.31615306069e-02 2.88661050079e-02 2.46187421852e-02 - 2.06439962171e-02 1.70848695603e-02 1.40109856905e-02 1.14361707830e-02 9.33741418467e-03 7.67065297497e-03 - 6.38291972351e-03 5.42174879265e-03 4.74176747355e-03 4.30805835198e-03 4.09713024865e-03 4.09713024865e-03 - 4.30805835198e-03 4.74176747355e-03 5.42174879265e-03 6.38291972351e-03 7.67065297497e-03 9.33741418467e-03 - 1.14361707830e-02 1.40109856905e-02 1.70848695603e-02 2.06439962171e-02 2.46187421852e-02 2.88661050079e-02 - 3.31615306069e-02 3.72078996967e-02 4.06654278454e-02 4.32002938784e-02 4.45431970579e-02 4.45431970579e-02 - 4.57968161948e-02 4.24386109393e-02 3.82415861113e-02 3.35871770820e-02 2.88348357920e-02 2.42781130820e-02 - 2.01220876747e-02 1.64818809732e-02 1.33976732300e-02 1.08577130860e-02 8.82009872524e-03 7.22847713667e-03 - 6.02253909249e-03 5.14599535674e-03 4.55262020357e-03 4.20942844716e-03 4.09713024865e-03 4.20942844716e-03 - 4.55262020357e-03 5.14599535674e-03 6.02253909249e-03 7.22847713667e-03 8.82009872524e-03 1.08577130860e-02 - 1.33976732300e-02 1.64818809732e-02 2.01220876747e-02 2.42781130820e-02 2.88348357920e-02 3.35871770820e-02 - 3.82415861113e-02 4.24386109393e-02 4.57968161948e-02 4.79731106469e-02 4.87273692032e-02 4.79731106469e-02 - 4.80406383964e-02 4.38959177953e-02 3.90347179512e-02 3.38635928392e-02 2.87439673059e-02 2.39549635512e-02 - 1.96777557044e-02 1.59997599900e-02 1.29342051284e-02 1.04468583553e-02 8.47998103933e-03 6.96786738821e-03 - 5.84558656512e-03 5.05545032098e-03 4.55262020357e-03 4.30805835198e-03 4.30805835198e-03 4.55262020357e-03 - 5.05545032098e-03 5.84558656512e-03 6.96786738821e-03 8.47998103933e-03 1.04468583553e-02 1.29342051284e-02 - 1.59997599900e-02 1.96777557044e-02 2.39549635512e-02 2.87439673059e-02 3.38635928392e-02 3.90347179512e-02 - 4.38959177953e-02 4.80406383964e-02 5.10737783335e-02 5.26787408684e-02 5.26787408684e-02 5.10737783335e-02 - 4.96193341715e-02 4.48486167771e-02 3.94908104948e-02 3.39533984936e-02 2.85879356046e-02 2.36566460915e-02 - 1.93203741197e-02 1.56449525655e-02 1.26225341258e-02 1.02011860999e-02 8.31144312544e-03 6.88181758770e-03 - 5.84558656512e-03 5.14599535674e-03 4.74176747355e-03 4.60945880297e-03 4.74176747355e-03 5.14599535674e-03 - 5.84558656512e-03 6.88181758770e-03 8.31144312544e-03 1.02011860999e-02 1.26225341258e-02 1.56449525655e-02 - 1.93203741197e-02 2.36566460915e-02 2.85879356046e-02 3.39533984936e-02 3.94908104948e-02 4.48486167771e-02 - 4.96193341715e-02 5.33923081840e-02 5.58153453540e-02 5.66509609539e-02 5.58153453540e-02 5.33923081840e-02 - 5.02828320119e-02 4.51877782102e-02 3.95849180057e-02 3.38709874542e-02 2.83925891295e-02 2.34067395586e-02 - 1.90666010177e-02 1.54267827082e-02 1.24657333634e-02 1.01194532806e-02 8.31144312544e-03 6.96786738821e-03 - 6.02253909249e-03 5.42174879265e-03 5.12972310883e-03 5.12972310883e-03 5.42174879265e-03 6.02253909249e-03 - 6.96786738821e-03 8.31144312544e-03 1.01194532806e-02 1.24657333634e-02 1.54267827082e-02 1.90666010177e-02 - 2.34067395586e-02 2.83925891295e-02 3.38709874542e-02 3.95849180057e-02 4.51877782102e-02 5.02828320119e-02 - 5.44829894560e-02 5.74676014035e-02 5.90154969276e-02 5.90154969276e-02 5.74676014035e-02 5.44829894560e-02 - 4.99825941802e-02 4.49623774036e-02 3.93968315223e-02 3.36893635306e-02 2.82105864296e-02 2.32378434698e-02 - 1.89341271390e-02 1.53530693596e-02 1.24657333634e-02 1.02011860999e-02 8.47998103933e-03 7.22847713667e-03 - 6.38291972351e-03 5.89466652251e-03 5.73495116497e-03 5.89466652251e-03 6.38291972351e-03 7.22847713667e-03 - 8.47998103933e-03 1.02011860999e-02 1.24657333634e-02 1.53530693596e-02 1.89341271390e-02 2.32378434698e-02 - 2.82105864296e-02 3.36893635306e-02 3.93968315223e-02 4.49623774036e-02 4.99825941802e-02 5.41129564364e-02 - 5.71366804742e-02 5.89627863020e-02 5.95715936141e-02 5.89627863020e-02 5.71366804742e-02 5.41129564364e-02 - 4.89738024005e-02 4.44045560444e-02 3.90976289629e-02 3.35158471123e-02 2.81005086407e-02 2.31779027969e-02 - 1.89341271390e-02 1.54267827082e-02 1.26225341258e-02 1.04468583553e-02 8.82009872524e-03 7.67065297497e-03 - 6.93908976898e-03 6.58362639444e-03 6.58362639444e-03 6.93908976898e-03 7.67065297497e-03 8.82009872524e-03 - 1.04468583553e-02 1.26225341258e-02 1.54267827082e-02 1.89341271390e-02 2.31779027969e-02 2.81005086407e-02 - 3.35158471123e-02 3.90976289629e-02 4.44045560444e-02 4.89738024005e-02 5.24797871309e-02 5.48533676650e-02 - 5.62463189889e-02 5.68740665481e-02 5.68740665481e-02 5.62463189889e-02 5.48533676650e-02 5.24797871309e-02 - 4.77793166757e-02 4.38595264834e-02 3.88830541657e-02 3.34454153402e-02 2.81005086407e-02 2.32378434698e-02 - 1.90666010177e-02 1.56449525655e-02 1.29342051284e-02 1.08577130860e-02 9.33741418467e-03 8.30549434438e-03 - 7.70870330534e-03 7.51351058269e-03 7.70870330534e-03 8.30549434438e-03 9.33741418467e-03 1.08577130860e-02 - 1.29342051284e-02 1.56449525655e-02 1.90666010177e-02 2.32378434698e-02 2.81005086407e-02 3.34454153402e-02 - 3.88830541657e-02 4.38595264834e-02 4.77793166757e-02 5.02620593726e-02 5.13723037105e-02 5.15765048907e-02 - 5.14403532045e-02 5.13523903781e-02 5.14403532045e-02 5.15765048907e-02 5.13723037105e-02 5.02620593726e-02 - 4.69885184966e-02 4.36365698621e-02 3.88830541657e-02 3.35158471123e-02 2.82105864296e-02 2.34067395586e-02 - 1.93203741197e-02 1.59997599900e-02 1.33976732300e-02 1.14361707830e-02 1.00404664762e-02 9.14830218340e-03 - 8.71419097250e-03 8.71419097250e-03 9.14830218340e-03 1.00404664762e-02 1.14361707830e-02 1.33976732300e-02 - 1.59997599900e-02 1.93203741197e-02 2.34067395586e-02 2.82105864296e-02 3.35158471123e-02 3.88830541657e-02 - 4.36365698621e-02 4.69885184966e-02 4.83941231678e-02 4.79609401864e-02 4.64751950426e-02 4.49279278957e-02 - 4.40123223759e-02 4.40123223759e-02 4.49279278957e-02 4.64751950426e-02 4.79609401864e-02 4.83941231678e-02 - 4.69885184966e-02 4.38595264834e-02 3.90976289629e-02 3.36893635306e-02 2.83925891295e-02 2.36566460915e-02 - 1.96777557044e-02 1.64818809732e-02 1.40109856905e-02 1.21873907787e-02 1.09414577715e-02 1.02181471415e-02 - 9.98127039361e-03 1.02181471415e-02 1.09414577715e-02 1.21873907787e-02 1.40109856905e-02 1.64818809732e-02 - 1.96777557044e-02 2.36566460915e-02 2.83925891295e-02 3.36893635306e-02 3.90976289629e-02 4.38595264834e-02 - 4.69885184966e-02 4.76689314688e-02 4.58777097769e-02 4.26203265537e-02 3.93541671489e-02 3.71417160544e-02 - 3.63849623957e-02 3.71417160544e-02 3.93541671489e-02 4.26203265537e-02 4.58777097769e-02 4.76689314688e-02 - 4.77793166757e-02 4.44045560444e-02 3.93968315223e-02 3.38709874542e-02 2.85879356046e-02 2.39549635512e-02 - 2.01220876747e-02 1.70848695603e-02 1.47756456624e-02 1.31198380533e-02 1.20550163598e-02 1.15351431719e-02 - 1.15351431719e-02 1.20550163598e-02 1.31198380533e-02 1.47756456624e-02 1.70848695603e-02 2.01220876747e-02 - 2.39549635512e-02 2.85879356046e-02 3.38709874542e-02 3.93968315223e-02 4.44045560444e-02 4.77793166757e-02 - 4.83941231678e-02 4.58777097769e-02 4.11986868029e-02 3.62214481565e-02 3.25101129901e-02 3.06594619284e-02 - 3.06594619284e-02 3.25101129901e-02 3.62214481565e-02 4.11986868029e-02 4.58777097769e-02 4.83941231678e-02 - 4.89738024005e-02 4.49623774036e-02 3.95849180057e-02 3.39533984936e-02 2.87439673059e-02 2.42781130820e-02 - 2.06439962171e-02 1.78072941675e-02 1.56960478729e-02 1.42425749040e-02 1.33939588194e-02 1.31152359900e-02 - 1.33939588194e-02 1.42425749040e-02 1.56960478729e-02 1.78072941675e-02 2.06439962171e-02 2.42781130820e-02 - 2.87439673059e-02 3.39533984936e-02 3.95849180057e-02 4.49623774036e-02 4.89738024005e-02 5.02620593726e-02 - 4.79609401864e-02 4.26203265537e-02 3.62214481565e-02 3.09103717113e-02 2.77489957459e-02 2.67478820537e-02 - 2.77489957459e-02 3.09103717113e-02 3.62214481565e-02 4.26203265537e-02 4.79609401864e-02 5.02620593726e-02 - 4.99825941802e-02 4.51877782102e-02 3.94908104948e-02 3.38635928392e-02 2.88348357920e-02 2.46187421852e-02 - 2.12421582644e-02 1.86504890434e-02 1.67754563001e-02 1.55601992220e-02 1.49636867906e-02 1.49636867906e-02 - 1.55601992220e-02 1.67754563001e-02 1.86504890434e-02 2.12421582644e-02 2.46187421852e-02 2.88348357920e-02 - 3.38635928392e-02 3.94908104948e-02 4.51877782102e-02 4.99825941802e-02 5.24797871309e-02 5.13723037105e-02 - 4.64751950426e-02 3.93541671489e-02 3.25101129901e-02 2.77489957459e-02 2.54935088837e-02 2.54935088837e-02 - 2.77489957459e-02 3.25101129901e-02 3.93541671489e-02 4.64751950426e-02 5.13723037105e-02 5.24797871309e-02 - 5.02828320119e-02 4.48486167771e-02 3.90347179512e-02 3.35871770820e-02 2.88661050079e-02 2.49827563157e-02 - 2.19185274002e-02 1.96135589165e-02 1.80109897723e-02 1.70678712692e-02 1.67567114426e-02 1.70678712692e-02 - 1.80109897723e-02 1.96135589165e-02 2.19185274002e-02 2.49827563157e-02 2.88661050079e-02 3.35871770820e-02 - 3.90347179512e-02 4.48486167771e-02 5.02828320119e-02 5.41129564364e-02 5.48533676650e-02 5.15765048907e-02 - 4.49279278957e-02 3.71417160544e-02 3.06594619284e-02 2.67478820537e-02 2.54935088837e-02 2.67478820537e-02 - 3.06594619284e-02 3.71417160544e-02 4.49279278957e-02 5.15765048907e-02 5.48533676650e-02 5.41129564364e-02 - 4.96193341715e-02 4.38959177953e-02 3.82415861113e-02 3.31615306069e-02 2.88631293974e-02 2.53797852965e-02 - 2.26718438342e-02 2.06884779452e-02 1.93892705934e-02 1.87467470027e-02 1.87467470027e-02 1.93892705934e-02 - 2.06884779452e-02 2.26718438342e-02 2.53797852965e-02 2.88631293974e-02 3.31615306069e-02 3.82415861113e-02 - 4.38959177953e-02 4.96193341715e-02 5.44829894560e-02 5.71366804742e-02 5.62463189889e-02 5.14403532045e-02 - 4.40123223759e-02 3.63849623957e-02 3.06594619284e-02 2.77489957459e-02 2.77489957459e-02 3.06594619284e-02 - 3.63849623957e-02 4.40123223759e-02 5.14403532045e-02 5.62463189889e-02 5.71366804742e-02 5.44829894560e-02 - 4.80406383964e-02 4.24386109393e-02 3.72078996967e-02 3.26483588385e-02 2.88533907006e-02 2.58139075627e-02 - 2.34923498457e-02 2.18557815330e-02 2.08820531014e-02 2.05587788214e-02 2.08820531014e-02 2.18557815330e-02 - 2.34923498457e-02 2.58139075627e-02 2.88533907006e-02 3.26483588385e-02 3.72078996967e-02 4.24386109393e-02 - 4.80406383964e-02 5.33923081840e-02 5.74676014035e-02 5.89627863020e-02 5.68740665481e-02 5.13523903781e-02 - 4.40123223759e-02 3.71417160544e-02 3.25101129901e-02 3.09103717113e-02 3.25101129901e-02 3.71417160544e-02 - 4.40123223759e-02 5.13523903781e-02 5.68740665481e-02 5.89627863020e-02 5.74676014035e-02 5.33923081840e-02 - 4.57968161948e-02 4.06654278454e-02 3.60511821341e-02 3.21049723875e-02 2.88533907006e-02 2.62778950395e-02 - 2.43576039836e-02 2.30804654510e-02 2.24420850452e-02 2.24420850452e-02 2.30804654510e-02 2.43576039836e-02 - 2.62778950395e-02 2.88533907006e-02 3.21049723875e-02 3.60511821341e-02 4.06654278454e-02 4.57968161948e-02 - 5.10737783335e-02 5.58153453540e-02 5.90154969276e-02 5.95715936141e-02 5.68740665481e-02 5.14403532045e-02 - 4.49279278957e-02 3.93541671489e-02 3.62214481565e-02 3.62214481565e-02 3.93541671489e-02 4.49279278957e-02 - 5.14403532045e-02 5.68740665481e-02 5.95715936141e-02 5.90154969276e-02 5.58153453540e-02 5.10737783335e-02 - 4.32002938784e-02 3.87673596218e-02 3.48695445110e-02 3.15673758761e-02 2.88631293974e-02 2.67502344749e-02 - 2.52298202509e-02 2.43103322252e-02 2.40022165572e-02 2.43103322252e-02 2.52298202509e-02 2.67502344749e-02 - 2.88631293974e-02 3.15673758761e-02 3.48695445110e-02 3.87673596218e-02 4.32002938784e-02 4.79731106469e-02 - 5.26787408684e-02 5.66509609539e-02 5.90154969276e-02 5.89627863020e-02 5.62463189889e-02 5.15765048907e-02 - 4.64751950426e-02 4.26203265537e-02 4.11986868029e-02 4.26203265537e-02 4.64751950426e-02 5.15765048907e-02 - 5.62463189889e-02 5.89627863020e-02 5.90154969276e-02 5.66509609539e-02 5.26787408684e-02 4.79731106469e-02 - 4.05244812822e-02 3.68889471691e-02 3.37228748044e-02 3.10465495213e-02 2.88661050079e-02 2.71955666447e-02 - 2.60582031450e-02 2.54803066383e-02 2.54803066383e-02 2.60582031450e-02 2.71955666447e-02 2.88661050079e-02 - 3.10465495213e-02 3.37228748044e-02 3.68889471691e-02 4.05244812822e-02 4.45431970579e-02 4.87273692032e-02 - 5.26787408684e-02 5.58153453540e-02 5.74676014035e-02 5.71366804742e-02 5.48533676650e-02 5.13723037105e-02 - 4.79609401864e-02 4.58777097769e-02 4.58777097769e-02 4.79609401864e-02 5.13723037105e-02 5.48533676650e-02 - 5.71366804742e-02 5.74676014035e-02 5.58153453540e-02 5.26787408684e-02 4.87273692032e-02 4.45431970579e-02 - 3.79563421300e-02 3.51127517762e-02 3.26341221073e-02 3.05340710560e-02 2.88348357920e-02 2.75721078901e-02 - 2.67889182249e-02 2.65227612839e-02 2.67889182249e-02 2.75721078901e-02 2.88348357920e-02 3.05340710560e-02 - 3.26341221073e-02 3.51127517762e-02 3.79563421300e-02 4.11328816616e-02 4.45431970579e-02 4.79731106469e-02 - 5.10737783335e-02 5.33923081840e-02 5.44829894560e-02 5.41129564364e-02 5.24797871309e-02 5.02620593726e-02 - 4.83941231678e-02 4.76689314688e-02 4.83941231678e-02 5.02620593726e-02 5.24797871309e-02 5.41129564364e-02 - 5.44829894560e-02 5.33923081840e-02 5.10737783335e-02 4.79731106469e-02 4.45431970579e-02 4.11328816616e-02 - 4.02453701311e-02 3.83718132369e-02 3.66568505349e-02 3.51532871168e-02 3.39533984936e-02 3.31691643222e-02 - 3.28952522339e-02 3.31691643222e-02 3.39533984936e-02 3.51532871168e-02 3.66568505349e-02 3.83718132369e-02 - 4.02453701311e-02 4.22610610741e-02 4.44094609233e-02 4.66403070569e-02 4.88190878681e-02 5.07121410456e-02 - 5.20147259753e-02 5.24339557043e-02 5.18281863755e-02 5.03535465114e-02 4.85080722970e-02 4.69885184966e-02 - 4.64020316983e-02 4.69885184966e-02 4.85080722970e-02 5.03535465114e-02 5.18281863755e-02 5.24339557043e-02 - 5.20147259753e-02 5.07121410456e-02 4.88190878681e-02 4.66403070569e-02 4.44094609233e-02 4.22610610741e-02 - 3.83718132369e-02 3.70689589239e-02 3.58243136049e-02 3.47182328687e-02 3.38709874542e-02 3.34071767353e-02 - 3.34071767353e-02 3.38709874542e-02 3.47182328687e-02 3.58243136049e-02 3.70689589239e-02 3.83718132369e-02 - 3.97029159910e-02 4.10670403681e-02 4.24686468881e-02 4.38725463784e-02 4.51788789706e-02 4.62258246981e-02 - 4.68264624901e-02 4.68401774785e-02 4.62623331670e-02 4.52857661696e-02 4.42752514752e-02 4.36365698621e-02 - 4.36365698621e-02 4.42752514752e-02 4.52857661696e-02 4.62623331670e-02 4.68401774785e-02 4.68264624901e-02 - 4.62258246981e-02 4.51788789706e-02 4.38725463784e-02 4.24686468881e-02 4.10670403681e-02 3.97029159910e-02 - 3.66568505349e-02 3.58243136049e-02 3.49773595797e-02 3.42208946471e-02 3.36893635306e-02 3.34971688966e-02 - 3.36893635306e-02 3.42208946471e-02 3.49773595797e-02 3.58243136049e-02 3.66568505349e-02 3.74259862301e-02 - 3.81345549630e-02 3.88104397494e-02 3.94725484932e-02 4.01041807768e-02 4.06430475235e-02 4.09927131873e-02 - 4.10571769449e-02 4.07924714489e-02 4.02540981079e-02 3.96081166256e-02 3.90842281235e-02 3.88830541657e-02 - 3.90842281235e-02 3.96081166256e-02 4.02540981079e-02 4.07924714489e-02 4.10571769449e-02 4.09927131873e-02 - 4.06430475235e-02 4.01041807768e-02 3.94725484932e-02 3.88104397494e-02 3.81345549630e-02 3.74259862301e-02 - 3.51532871168e-02 3.47182328687e-02 3.42208946471e-02 3.37780927799e-02 3.35158471123e-02 3.35158471123e-02 - 3.37780927799e-02 3.42208946471e-02 3.47182328687e-02 3.51532871168e-02 3.54595415232e-02 3.56312088557e-02 - 3.57044700685e-02 3.57259716101e-02 3.57259716101e-02 3.57044700685e-02 3.56312088557e-02 3.54595415232e-02 - 3.51532871168e-02 3.47182328687e-02 3.42208946471e-02 3.37780927799e-02 3.35158471123e-02 3.35158471123e-02 - 3.37780927799e-02 3.42208946471e-02 3.47182328687e-02 3.51532871168e-02 3.54595415232e-02 3.56312088557e-02 - 3.57044700685e-02 3.57259716101e-02 3.57259716101e-02 3.57044700685e-02 3.56312088557e-02 3.54595415232e-02 - 3.39533984936e-02 3.38709874542e-02 3.36893635306e-02 3.35158471123e-02 3.34454153402e-02 3.35158471123e-02 - 3.36893635306e-02 3.38709874542e-02 3.39533984936e-02 3.38635928392e-02 3.35871770820e-02 3.31615306069e-02 - 3.26483588385e-02 3.21049723875e-02 3.15673758761e-02 3.10465495213e-02 3.05340710560e-02 3.00149219248e-02 - 2.94854041377e-02 2.89691250092e-02 2.85205562719e-02 2.82105864296e-02 2.80994006567e-02 2.82105864296e-02 - 2.85205562719e-02 2.89691250092e-02 2.94854041377e-02 3.00149219248e-02 3.05340710560e-02 3.10465495213e-02 - 3.15673758761e-02 3.21049723875e-02 3.26483588385e-02 3.31615306069e-02 3.35871770820e-02 3.38635928392e-02 - 3.31691643222e-02 3.34071767353e-02 3.34971688966e-02 3.35158471123e-02 3.35158471123e-02 3.34971688966e-02 - 3.34071767353e-02 3.31691643222e-02 3.27229087590e-02 3.20546920774e-02 3.12022017908e-02 3.02357338101e-02 - 2.92302840650e-02 2.82446089484e-02 2.73140021666e-02 2.64534808200e-02 2.56657154446e-02 2.49511167951e-02 - 2.43184216158e-02 2.37914166767e-02 2.34067395586e-02 2.32023283361e-02 2.32023283361e-02 2.34067395586e-02 - 2.37914166767e-02 2.43184216158e-02 2.49511167951e-02 2.56657154446e-02 2.64534808200e-02 2.73140021666e-02 - 2.82446089484e-02 2.92302840650e-02 3.02357338101e-02 3.12022017908e-02 3.20546920774e-02 3.27229087590e-02 - 3.28952522339e-02 3.34071767353e-02 3.36893635306e-02 3.37780927799e-02 3.36893635306e-02 3.34071767353e-02 - 3.28952522339e-02 3.21243272248e-02 3.10978190541e-02 2.98615217076e-02 2.84935612207e-02 2.70818268649e-02 - 2.57019293917e-02 2.44059448105e-02 2.32231030162e-02 2.21666114252e-02 2.12413612776e-02 2.04512222766e-02 - 1.98052910067e-02 1.93203741197e-02 1.90175139009e-02 1.89142861556e-02 1.90175139009e-02 1.93203741197e-02 - 1.98052910067e-02 2.04512222766e-02 2.12413612776e-02 2.21666114252e-02 2.32231030162e-02 2.44059448105e-02 - 2.57019293917e-02 2.70818268649e-02 2.84935612207e-02 2.98615217076e-02 3.10978190541e-02 3.21243272248e-02 - 3.31691643222e-02 3.38709874542e-02 3.42208946471e-02 3.42208946471e-02 3.38709874542e-02 3.31691643222e-02 - 3.21243272248e-02 3.07715106065e-02 2.91781605866e-02 2.74372089612e-02 2.56499234494e-02 2.39063871143e-02 - 2.22726314479e-02 2.07887392229e-02 1.94746684497e-02 1.83376793613e-02 1.73786828448e-02 1.65980023724e-02 - 1.59997599900e-02 1.55924938344e-02 1.53857855201e-02 1.53857855201e-02 1.55924938344e-02 1.59997599900e-02 - 1.65980023724e-02 1.73786828448e-02 1.83376793613e-02 1.94746684497e-02 2.07887392229e-02 2.22726314479e-02 - 2.39063871143e-02 2.56499234494e-02 2.74372089612e-02 2.91781605866e-02 3.07715106065e-02 3.21243272248e-02 - 3.39533984936e-02 3.47182328687e-02 3.49773595797e-02 3.47182328687e-02 3.39533984936e-02 3.27229087590e-02 - 3.10978190541e-02 2.91781605866e-02 2.70827915169e-02 2.49333108373e-02 2.28368095394e-02 2.08735527936e-02 - 1.90940368490e-02 1.75241772421e-02 1.61729889157e-02 1.50389831834e-02 1.41157952825e-02 1.33976732300e-02 - 1.28827341282e-02 1.25723726562e-02 1.24686371753e-02 1.25723726562e-02 1.28827341282e-02 1.33976732300e-02 - 1.41157952825e-02 1.50389831834e-02 1.61729889157e-02 1.75241772421e-02 1.90940368490e-02 2.08735527936e-02 - 2.28368095394e-02 2.49333108373e-02 2.70827915169e-02 2.91781605866e-02 3.10978190541e-02 3.27229087590e-02 - 3.51532871168e-02 3.58243136049e-02 3.58243136049e-02 3.51532871168e-02 3.38635928392e-02 3.20546920774e-02 - 2.98615217076e-02 2.74372089612e-02 2.49333108373e-02 2.24815496090e-02 2.01812628043e-02 1.80960146721e-02 - 1.62588522549e-02 1.46810426016e-02 1.33594815778e-02 1.22825573408e-02 1.14361707830e-02 1.08088949298e-02 - 1.03937663652e-02 1.01870819285e-02 1.01870819285e-02 1.03937663652e-02 1.08088949298e-02 1.14361707830e-02 - 1.22825573408e-02 1.33594815778e-02 1.46810426016e-02 1.62588522549e-02 1.80960146721e-02 2.01812628043e-02 - 2.24815496090e-02 2.49333108373e-02 2.74372089612e-02 2.98615217076e-02 3.20546920774e-02 3.38635928392e-02 - 3.66568505349e-02 3.70689589239e-02 3.66568505349e-02 3.54595415232e-02 3.35871770820e-02 3.12022017908e-02 - 2.84935612207e-02 2.56499234494e-02 2.28368095394e-02 2.01812628043e-02 1.77666865554e-02 1.56375665721e-02 - 1.38094745262e-02 1.22786655737e-02 1.10293847869e-02 1.00404664762e-02 9.29162040305e-03 8.76725594498e-03 - 8.45686847188e-03 8.35413904759e-03 8.45686847188e-03 8.76725594498e-03 9.29162040305e-03 1.00404664762e-02 - 1.10293847869e-02 1.22786655737e-02 1.38094745262e-02 1.56375665721e-02 1.77666865554e-02 2.01812628043e-02 - 2.28368095394e-02 2.56499234494e-02 2.84935612207e-02 3.12022017908e-02 3.35871770820e-02 3.54595415232e-02 - 3.83718132369e-02 3.83718132369e-02 3.74259862301e-02 3.56312088557e-02 3.31615306069e-02 3.02357338101e-02 - 2.70818268649e-02 2.39063871143e-02 2.08735527936e-02 1.80960146721e-02 1.56375665721e-02 1.35231772103e-02 - 1.17508350709e-02 1.03016601350e-02 9.14830218340e-03 8.26229038338e-03 7.61927184895e-03 7.20097316500e-03 - 6.99504538611e-03 6.99504538611e-03 7.20097316500e-03 7.61927184895e-03 8.26229038338e-03 9.14830218340e-03 - 1.03016601350e-02 1.17508350709e-02 1.35231772103e-02 1.56375665721e-02 1.80960146721e-02 2.08735527936e-02 - 2.39063871143e-02 2.70818268649e-02 3.02357338101e-02 3.31615306069e-02 3.56312088557e-02 3.74259862301e-02 - 4.02453701311e-02 3.97029159910e-02 3.81345549630e-02 3.57044700685e-02 3.26483588385e-02 2.92302840650e-02 - 2.57019293917e-02 2.22726314479e-02 1.90940368490e-02 1.62588522549e-02 1.38094745262e-02 1.17508350709e-02 - 1.00633149755e-02 8.71419097250e-03 7.66717366082e-03 6.88914005847e-03 6.35335851926e-03 6.04016501968e-03 - 5.93719631865e-03 6.04016501968e-03 6.35335851926e-03 6.88914005847e-03 7.66717366082e-03 8.71419097250e-03 - 1.00633149755e-02 1.17508350709e-02 1.38094745262e-02 1.62588522549e-02 1.90940368490e-02 2.22726314479e-02 - 2.57019293917e-02 2.92302840650e-02 3.26483588385e-02 3.57044700685e-02 3.81345549630e-02 3.97029159910e-02 - 4.22610610741e-02 4.10670403681e-02 3.88104397494e-02 3.57259716101e-02 3.21049723875e-02 2.82446089484e-02 - 2.44059448105e-02 2.07887392229e-02 1.75241772421e-02 1.46810426016e-02 1.22786655737e-02 1.03016601350e-02 - 8.71419097250e-03 7.47255069610e-03 6.53448601861e-03 5.86418256271e-03 5.43377044817e-03 5.22371135458e-03 - 5.22371135458e-03 5.43377044817e-03 5.86418256271e-03 6.53448601861e-03 7.47255069610e-03 8.71419097250e-03 - 1.03016601350e-02 1.22786655737e-02 1.46810426016e-02 1.75241772421e-02 2.07887392229e-02 2.44059448105e-02 - 2.82446089484e-02 3.21049723875e-02 3.57259716101e-02 3.88104397494e-02 4.10670403681e-02 4.22610610741e-02 - 4.44094609233e-02 4.24686468881e-02 3.94725484932e-02 3.57259716101e-02 3.15673758761e-02 2.73140021666e-02 - 2.32231030162e-02 1.94746684497e-02 1.61729889157e-02 1.33594815778e-02 1.10293847869e-02 9.14830218340e-03 - 7.66717366082e-03 6.53448601861e-03 5.70420021497e-03 5.13913617973e-03 4.81172327806e-03 4.70458873539e-03 - 4.81172327806e-03 5.13913617973e-03 5.70420021497e-03 6.53448601861e-03 7.66717366082e-03 9.14830218340e-03 - 1.10293847869e-02 1.33594815778e-02 1.61729889157e-02 1.94746684497e-02 2.32231030162e-02 2.73140021666e-02 - 3.15673758761e-02 3.57259716101e-02 3.94725484932e-02 4.24686468881e-02 4.44094609233e-02 4.50819394473e-02 - 4.66403070569e-02 4.38725463784e-02 4.01041807768e-02 3.57044700685e-02 3.10465495213e-02 2.64534808200e-02 - 2.21666114252e-02 1.83376793613e-02 1.50389831834e-02 1.22825573408e-02 1.00404664762e-02 8.26229038338e-03 - 6.88914005847e-03 5.86418256271e-03 5.13913617973e-03 4.67692793169e-03 4.45230019628e-03 4.45230019628e-03 - 4.67692793169e-03 5.13913617973e-03 5.86418256271e-03 6.88914005847e-03 8.26229038338e-03 1.00404664762e-02 - 1.22825573408e-02 1.50389831834e-02 1.83376793613e-02 2.21666114252e-02 2.64534808200e-02 3.10465495213e-02 - 3.57044700685e-02 4.01041807768e-02 4.38725463784e-02 4.66403070569e-02 4.81082332430e-02 4.81082332430e-02 - 4.88190878681e-02 4.51788789706e-02 4.06430475235e-02 3.56312088557e-02 3.05340710560e-02 2.56657154446e-02 - 2.12413612776e-02 1.73786828448e-02 1.41157952825e-02 1.14361707830e-02 9.29162040305e-03 7.61927184895e-03 - 6.35335851926e-03 5.43377044817e-03 4.81172327806e-03 4.45230019628e-03 4.33477840900e-03 4.45230019628e-03 - 4.81172327806e-03 5.43377044817e-03 6.35335851926e-03 7.61927184895e-03 9.29162040305e-03 1.14361707830e-02 - 1.41157952825e-02 1.73786828448e-02 2.12413612776e-02 2.56657154446e-02 3.05340710560e-02 3.56312088557e-02 - 4.06430475235e-02 4.51788789706e-02 4.88190878681e-02 5.11831265828e-02 5.20033431247e-02 5.11831265828e-02 - 5.07121410456e-02 4.62258246981e-02 4.09927131873e-02 3.54595415232e-02 3.00149219248e-02 2.49511167951e-02 - 2.04512222766e-02 1.65980023724e-02 1.33976732300e-02 1.08088949298e-02 8.76725594498e-03 7.20097316500e-03 - 6.04016501968e-03 5.22371135458e-03 4.70458873539e-03 4.45230019628e-03 4.45230019628e-03 4.70458873539e-03 - 5.22371135458e-03 6.04016501968e-03 7.20097316500e-03 8.76725594498e-03 1.08088949298e-02 1.33976732300e-02 - 1.65980023724e-02 2.04512222766e-02 2.49511167951e-02 3.00149219248e-02 3.54595415232e-02 4.09927131873e-02 - 4.62258246981e-02 5.07121410456e-02 5.40097122002e-02 5.57595749637e-02 5.57595749637e-02 5.40097122002e-02 - 5.20147259753e-02 4.68264624901e-02 4.10571769449e-02 3.51532871168e-02 2.94854041377e-02 2.43184216158e-02 - 1.98052910067e-02 1.59997599900e-02 1.28827341282e-02 1.03937663652e-02 8.45686847188e-03 6.99504538611e-03 - 5.93719631865e-03 5.22371135458e-03 4.81172327806e-03 4.67692793169e-03 4.81172327806e-03 5.22371135458e-03 - 5.93719631865e-03 6.99504538611e-03 8.45686847188e-03 1.03937663652e-02 1.28827341282e-02 1.59997599900e-02 - 1.98052910067e-02 2.43184216158e-02 2.94854041377e-02 3.51532871168e-02 4.10571769449e-02 4.68264624901e-02 - 5.20147259753e-02 5.61547897924e-02 5.88318176265e-02 5.97584596222e-02 5.88318176265e-02 5.61547897924e-02 - 5.24339557043e-02 4.68401774785e-02 4.07924714489e-02 3.47182328687e-02 2.89691250092e-02 2.37914166767e-02 - 1.93203741197e-02 1.55924938344e-02 1.25723726562e-02 1.01870819285e-02 8.35413904759e-03 6.99504538611e-03 - 6.04016501968e-03 5.43377044817e-03 5.13913617973e-03 5.13913617973e-03 5.43377044817e-03 6.04016501968e-03 - 6.99504538611e-03 8.35413904759e-03 1.01870819285e-02 1.25723726562e-02 1.55924938344e-02 1.93203741197e-02 - 2.37914166767e-02 2.89691250092e-02 3.47182328687e-02 4.07924714489e-02 4.68401774785e-02 5.24339557043e-02 - 5.71251588417e-02 6.05090723285e-02 6.22821499923e-02 6.22821499923e-02 6.05090723285e-02 5.71251588417e-02 - 5.18281863755e-02 4.62623331670e-02 4.02540981079e-02 3.42208946471e-02 2.85205562719e-02 2.34067395586e-02 - 1.90175139009e-02 1.53857855201e-02 1.24686371753e-02 1.01870819285e-02 8.45686847188e-03 7.20097316500e-03 - 6.35335851926e-03 5.86418256271e-03 5.70420021497e-03 5.86418256271e-03 6.35335851926e-03 7.20097316500e-03 - 8.45686847188e-03 1.01870819285e-02 1.24686371753e-02 1.53857855201e-02 1.90175139009e-02 2.34067395586e-02 - 2.85205562719e-02 3.42208946471e-02 4.02540981079e-02 4.62623331670e-02 5.18281863755e-02 5.65511919643e-02 - 6.01184381094e-02 6.23288110708e-02 6.30764730892e-02 6.23288110708e-02 6.01184381094e-02 5.65511919643e-02 - 5.03535465114e-02 4.52857661696e-02 3.96081166256e-02 3.37780927799e-02 2.82105864296e-02 2.32023283361e-02 - 1.89142861556e-02 1.53857855201e-02 1.25723726562e-02 1.03937663652e-02 8.76725594498e-03 7.61927184895e-03 - 6.88914005847e-03 6.53448601861e-03 6.53448601861e-03 6.88914005847e-03 7.61927184895e-03 8.76725594498e-03 - 1.03937663652e-02 1.25723726562e-02 1.53857855201e-02 1.89142861556e-02 2.32023283361e-02 2.82105864296e-02 - 3.37780927799e-02 3.96081166256e-02 4.52857661696e-02 5.03535465114e-02 5.44475263977e-02 5.74105494947e-02 - 5.92810318582e-02 6.01752681104e-02 6.01752681104e-02 5.92810318582e-02 5.74105494947e-02 5.44475263977e-02 - 4.85080722970e-02 4.42752514752e-02 3.90842281235e-02 3.35158471123e-02 2.80994006567e-02 2.32023283361e-02 - 1.90175139009e-02 1.55924938344e-02 1.28827341282e-02 1.08088949298e-02 9.29162040305e-03 8.26229038338e-03 - 7.66717366082e-03 7.47255069610e-03 7.66717366082e-03 8.26229038338e-03 9.29162040305e-03 1.08088949298e-02 - 1.28827341282e-02 1.55924938344e-02 1.90175139009e-02 2.32023283361e-02 2.80994006567e-02 3.35158471123e-02 - 3.90842281235e-02 4.42752514752e-02 4.85080722970e-02 5.13869204668e-02 5.29210396854e-02 5.34983990182e-02 - 5.36143814352e-02 5.36149267734e-02 5.36143814352e-02 5.34983990182e-02 5.29210396854e-02 5.13869204668e-02 - 4.69885184966e-02 4.36365698621e-02 3.88830541657e-02 3.35158471123e-02 2.82105864296e-02 2.34067395586e-02 - 1.93203741197e-02 1.59997599900e-02 1.33976732300e-02 1.14361707830e-02 1.00404664762e-02 9.14830218340e-03 - 8.71419097250e-03 8.71419097250e-03 9.14830218340e-03 1.00404664762e-02 1.14361707830e-02 1.33976732300e-02 - 1.59997599900e-02 1.93203741197e-02 2.34067395586e-02 2.82105864296e-02 3.35158471123e-02 3.88830541657e-02 - 4.36365698621e-02 4.69885184966e-02 4.83941231678e-02 4.79609401864e-02 4.64751950426e-02 4.49279278957e-02 - 4.40123223759e-02 4.40123223759e-02 4.49279278957e-02 4.64751950426e-02 4.79609401864e-02 4.83941231678e-02 - 4.64020316983e-02 4.36365698621e-02 3.90842281235e-02 3.37780927799e-02 2.85205562719e-02 2.37914166767e-02 - 1.98052910067e-02 1.65980023724e-02 1.41157952825e-02 1.22825573408e-02 1.10293847869e-02 1.03016601350e-02 - 1.00633149755e-02 1.03016601350e-02 1.10293847869e-02 1.22825573408e-02 1.41157952825e-02 1.65980023724e-02 - 1.98052910067e-02 2.37914166767e-02 2.85205562719e-02 3.37780927799e-02 3.90842281235e-02 4.36365698621e-02 - 4.64020316983e-02 4.65545163206e-02 4.41366450522e-02 4.02808330656e-02 3.65582592974e-02 3.40771392673e-02 - 3.32338776264e-02 3.40771392673e-02 3.65582592974e-02 4.02808330656e-02 4.41366450522e-02 4.65545163206e-02 - 4.69885184966e-02 4.42752514752e-02 3.96081166256e-02 3.42208946471e-02 2.89691250092e-02 2.43184216158e-02 - 2.04512222766e-02 1.73786828448e-02 1.50389831834e-02 1.33594815778e-02 1.22786655737e-02 1.17508350709e-02 - 1.17508350709e-02 1.22786655737e-02 1.33594815778e-02 1.50389831834e-02 1.73786828448e-02 2.04512222766e-02 - 2.43184216158e-02 2.89691250092e-02 3.42208946471e-02 3.96081166256e-02 4.42752514752e-02 4.69885184966e-02 - 4.65545163206e-02 4.27064575993e-02 3.67025276917e-02 3.07039905741e-02 2.63856510811e-02 2.42761411551e-02 - 2.42761411551e-02 2.63856510811e-02 3.07039905741e-02 3.67025276917e-02 4.27064575993e-02 4.65545163206e-02 - 4.85080722970e-02 4.52857661696e-02 4.02540981079e-02 3.47182328687e-02 2.94854041377e-02 2.49511167951e-02 - 2.12413612776e-02 1.83376793613e-02 1.61729889157e-02 1.46810426016e-02 1.38094745262e-02 1.35231772103e-02 - 1.38094745262e-02 1.46810426016e-02 1.61729889157e-02 1.83376793613e-02 2.12413612776e-02 2.49511167951e-02 - 2.94854041377e-02 3.47182328687e-02 4.02540981079e-02 4.52857661696e-02 4.85080722970e-02 4.83941231678e-02 - 4.41366450522e-02 3.67025276917e-02 2.86292518106e-02 2.23413746600e-02 1.87771308641e-02 1.76819501362e-02 - 1.87771308641e-02 2.23413746600e-02 2.86292518106e-02 3.67025276917e-02 4.41366450522e-02 4.83941231678e-02 - 5.03535465114e-02 4.62623331670e-02 4.07924714489e-02 3.51532871168e-02 3.00149219248e-02 2.56657154446e-02 - 2.21666114252e-02 1.94746684497e-02 1.75241772421e-02 1.62588522549e-02 1.56375665721e-02 1.56375665721e-02 - 1.62588522549e-02 1.75241772421e-02 1.94746684497e-02 2.21666114252e-02 2.56657154446e-02 3.00149219248e-02 - 3.51532871168e-02 4.07924714489e-02 4.62623331670e-02 5.03535465114e-02 5.13869204668e-02 4.79609401864e-02 - 4.02808330656e-02 3.07039905741e-02 2.23413746600e-02 1.69819929531e-02 1.46090879135e-02 1.46090879135e-02 - 1.69819929531e-02 2.23413746600e-02 3.07039905741e-02 4.02808330656e-02 4.79609401864e-02 5.13869204668e-02 - 5.18281863755e-02 4.68401774785e-02 4.10571769449e-02 3.54595415232e-02 3.05340710560e-02 2.64534808200e-02 - 2.32231030162e-02 2.07887392229e-02 1.90940368490e-02 1.80960146721e-02 1.77666865554e-02 1.80960146721e-02 - 1.90940368490e-02 2.07887392229e-02 2.32231030162e-02 2.64534808200e-02 3.05340710560e-02 3.54595415232e-02 - 4.10571769449e-02 4.68401774785e-02 5.18281863755e-02 5.44475263977e-02 5.29210396854e-02 4.64751950426e-02 - 3.65582592974e-02 2.63856510811e-02 1.87771308641e-02 1.46090879135e-02 1.33581335706e-02 1.46090879135e-02 - 1.87771308641e-02 2.63856510811e-02 3.65582592974e-02 4.64751950426e-02 5.29210396854e-02 5.44475263977e-02 - 5.24339557043e-02 4.68264624901e-02 4.09927131873e-02 3.56312088557e-02 3.10465495213e-02 2.73140021666e-02 - 2.44059448105e-02 2.22726314479e-02 2.08735527936e-02 2.01812628043e-02 2.01812628043e-02 2.08735527936e-02 - 2.22726314479e-02 2.44059448105e-02 2.73140021666e-02 3.10465495213e-02 3.56312088557e-02 4.09927131873e-02 - 4.68264624901e-02 5.24339557043e-02 5.65511919643e-02 5.74105494947e-02 5.34983990182e-02 4.49279278957e-02 - 3.40771392673e-02 2.42761411551e-02 1.76819501362e-02 1.46090879135e-02 1.46090879135e-02 1.76819501362e-02 - 2.42761411551e-02 3.40771392673e-02 4.49279278957e-02 5.34983990182e-02 5.74105494947e-02 5.65511919643e-02 - 5.20147259753e-02 4.62258246981e-02 4.06430475235e-02 3.57044700685e-02 3.15673758761e-02 2.82446089484e-02 - 2.57019293917e-02 2.39063871143e-02 2.28368095394e-02 2.24815496090e-02 2.28368095394e-02 2.39063871143e-02 - 2.57019293917e-02 2.82446089484e-02 3.15673758761e-02 3.57044700685e-02 4.06430475235e-02 4.62258246981e-02 - 5.20147259753e-02 5.71251588417e-02 6.01184381094e-02 5.92810318582e-02 5.36143814352e-02 4.40123223759e-02 - 3.32338776264e-02 2.42761411551e-02 1.87771308641e-02 1.69819929531e-02 1.87771308641e-02 2.42761411551e-02 - 3.32338776264e-02 4.40123223759e-02 5.36143814352e-02 5.92810318582e-02 6.01184381094e-02 5.71251588417e-02 - 5.07121410456e-02 4.51788789706e-02 4.01041807768e-02 3.57259716101e-02 3.21049723875e-02 2.92302840650e-02 - 2.70818268649e-02 2.56499234494e-02 2.49333108373e-02 2.49333108373e-02 2.56499234494e-02 2.70818268649e-02 - 2.92302840650e-02 3.21049723875e-02 3.57259716101e-02 4.01041807768e-02 4.51788789706e-02 5.07121410456e-02 - 5.61547897924e-02 6.05090723285e-02 6.23288110708e-02 6.01752681104e-02 5.36149267734e-02 4.40123223759e-02 - 3.40771392673e-02 2.63856510811e-02 2.23413746600e-02 2.23413746600e-02 2.63856510811e-02 3.40771392673e-02 - 4.40123223759e-02 5.36149267734e-02 6.01752681104e-02 6.23288110708e-02 6.05090723285e-02 5.61547897924e-02 - 4.88190878681e-02 4.38725463784e-02 3.94725484932e-02 3.57259716101e-02 3.26483588385e-02 3.02357338101e-02 - 2.84935612207e-02 2.74372089612e-02 2.70827915169e-02 2.74372089612e-02 2.84935612207e-02 3.02357338101e-02 - 3.26483588385e-02 3.57259716101e-02 3.94725484932e-02 4.38725463784e-02 4.88190878681e-02 5.40097122002e-02 - 5.88318176265e-02 6.22821499923e-02 6.30764730892e-02 6.01752681104e-02 5.36143814352e-02 4.49279278957e-02 - 3.65582592974e-02 3.07039905741e-02 2.86292518106e-02 3.07039905741e-02 3.65582592974e-02 4.49279278957e-02 - 5.36143814352e-02 6.01752681104e-02 6.30764730892e-02 6.22821499923e-02 5.88318176265e-02 5.40097122002e-02 - 4.66403070569e-02 4.24686468881e-02 3.88104397494e-02 3.57044700685e-02 3.31615306069e-02 3.12022017908e-02 - 2.98615217076e-02 2.91781605866e-02 2.91781605866e-02 2.98615217076e-02 3.12022017908e-02 3.31615306069e-02 - 3.57044700685e-02 3.88104397494e-02 4.24686468881e-02 4.66403070569e-02 5.11831265828e-02 5.57595749637e-02 - 5.97584596222e-02 6.22821499923e-02 6.23288110708e-02 5.92810318582e-02 5.34983990182e-02 4.64751950426e-02 - 4.02808330656e-02 3.67025276917e-02 3.67025276917e-02 4.02808330656e-02 4.64751950426e-02 5.34983990182e-02 - 5.92810318582e-02 6.23288110708e-02 6.22821499923e-02 5.97584596222e-02 5.57595749637e-02 5.11831265828e-02 - 4.44094609233e-02 4.10670403681e-02 3.81345549630e-02 3.56312088557e-02 3.35871770820e-02 3.20546920774e-02 - 3.10978190541e-02 3.07715106065e-02 3.10978190541e-02 3.20546920774e-02 3.35871770820e-02 3.56312088557e-02 - 3.81345549630e-02 4.10670403681e-02 4.44094609233e-02 4.81082332430e-02 5.20033431247e-02 5.57595749637e-02 - 5.88318176265e-02 6.05090723285e-02 6.01184381094e-02 5.74105494947e-02 5.29210396854e-02 4.79609401864e-02 - 4.41366450522e-02 4.27064575993e-02 4.41366450522e-02 4.79609401864e-02 5.29210396854e-02 5.74105494947e-02 - 6.01184381094e-02 6.05090723285e-02 5.88318176265e-02 5.57595749637e-02 5.20033431247e-02 4.81082332430e-02 - 4.22610610741e-02 3.97029159910e-02 3.74259862301e-02 3.54595415232e-02 3.38635928392e-02 3.27229087590e-02 - 3.21243272248e-02 3.21243272248e-02 3.27229087590e-02 3.38635928392e-02 3.54595415232e-02 3.74259862301e-02 - 3.97029159910e-02 4.22610610741e-02 4.50819394473e-02 4.81082332430e-02 5.11831265828e-02 5.40097122002e-02 - 5.61547897924e-02 5.71251588417e-02 5.65511919643e-02 5.44475263977e-02 5.13869204668e-02 4.83941231678e-02 - 4.65545163206e-02 4.65545163206e-02 4.83941231678e-02 5.13869204668e-02 5.44475263977e-02 5.65511919643e-02 - 5.71251588417e-02 5.61547897924e-02 5.40097122002e-02 5.11831265828e-02 4.81082332430e-02 4.50819394473e-02 - 4.57409612273e-02 4.40291518527e-02 4.23378898536e-02 4.07924714489e-02 3.95849180057e-02 3.89160663350e-02 - 3.89160663350e-02 3.95849180057e-02 4.07924714489e-02 4.23378898536e-02 4.40291518527e-02 4.57409612273e-02 - 4.74313143781e-02 4.91148354625e-02 5.08044555558e-02 5.24477482650e-02 5.38883507401e-02 5.48714786192e-02 - 5.51031089527e-02 5.43692149489e-02 5.26931433274e-02 5.04463447592e-02 4.83002627794e-02 4.69885184966e-02 - 4.69885184966e-02 4.83002627794e-02 5.04463447592e-02 5.26931433274e-02 5.43692149489e-02 5.51031089527e-02 - 5.48714786192e-02 5.38883507401e-02 5.24477482650e-02 5.08044555558e-02 4.91148354625e-02 4.74313143781e-02 - 4.40291518527e-02 4.27763236460e-02 4.14579289512e-02 4.02540981079e-02 3.93968315223e-02 3.90848689472e-02 - 3.93968315223e-02 4.02540981079e-02 4.14579289512e-02 4.27763236460e-02 4.40291518527e-02 4.51323632879e-02 - 4.60913389830e-02 4.69561004766e-02 4.77625301985e-02 4.84855850881e-02 4.90231496620e-02 4.92182336225e-02 - 4.89192305177e-02 4.80677366203e-02 4.67810667612e-02 4.53738413591e-02 4.42752514752e-02 4.38595264834e-02 - 4.42752514752e-02 4.53738413591e-02 4.67810667612e-02 4.80677366203e-02 4.89192305177e-02 4.92182336225e-02 - 4.90231496620e-02 4.84855850881e-02 4.77625301985e-02 4.69561004766e-02 4.60913389830e-02 4.51323632879e-02 - 4.23378898536e-02 4.14579289512e-02 4.04742233092e-02 3.96081166256e-02 3.90976289629e-02 3.90976289629e-02 - 3.96081166256e-02 4.04742233092e-02 4.14579289512e-02 4.23378898536e-02 4.29832635915e-02 4.33721592307e-02 - 4.35604474537e-02 4.36277000850e-02 4.36277000850e-02 4.35604474537e-02 4.33721592307e-02 4.29832635915e-02 - 4.23378898536e-02 4.14579289512e-02 4.04742233092e-02 3.96081166256e-02 3.90976289629e-02 3.90976289629e-02 - 3.96081166256e-02 4.04742233092e-02 4.14579289512e-02 4.23378898536e-02 4.29832635915e-02 4.33721592307e-02 - 4.35604474537e-02 4.36277000850e-02 4.36277000850e-02 4.35604474537e-02 4.33721592307e-02 4.29832635915e-02 - 4.07924714489e-02 4.02540981079e-02 3.96081166256e-02 3.90842281235e-02 3.88830541657e-02 3.90842281235e-02 - 3.96081166256e-02 4.02540981079e-02 4.07924714489e-02 4.10571769449e-02 4.09927131873e-02 4.06430475235e-02 - 4.01041807768e-02 3.94725484932e-02 3.88104397494e-02 3.81345549630e-02 3.74259862301e-02 3.66568505349e-02 - 3.58243136049e-02 3.49773595797e-02 3.42208946471e-02 3.36893635306e-02 3.34971688966e-02 3.36893635306e-02 - 3.42208946471e-02 3.49773595797e-02 3.58243136049e-02 3.66568505349e-02 3.74259862301e-02 3.81345549630e-02 - 3.88104397494e-02 3.94725484932e-02 4.01041807768e-02 4.06430475235e-02 4.09927131873e-02 4.10571769449e-02 - 3.95849180057e-02 3.93968315223e-02 3.90976289629e-02 3.88830541657e-02 3.88830541657e-02 3.90976289629e-02 - 3.93968315223e-02 3.95849180057e-02 3.94908104948e-02 3.90347179512e-02 3.82415861113e-02 3.72078996967e-02 - 3.60511821341e-02 3.48695445110e-02 3.37228748044e-02 3.26341221073e-02 3.16041856284e-02 3.06330408871e-02 - 2.97391273192e-02 2.89691250092e-02 2.83925891295e-02 2.80812943983e-02 2.80812943983e-02 2.83925891295e-02 - 2.89691250092e-02 2.97391273192e-02 3.06330408871e-02 3.16041856284e-02 3.26341221073e-02 3.37228748044e-02 - 3.48695445110e-02 3.60511821341e-02 3.72078996967e-02 3.82415861113e-02 3.90347179512e-02 3.94908104948e-02 - 3.89160663350e-02 3.90848689472e-02 3.90976289629e-02 3.90842281235e-02 3.90976289629e-02 3.90848689472e-02 - 3.89160663350e-02 3.84534160516e-02 3.76190713504e-02 3.64263171972e-02 3.49654910486e-02 3.33624200108e-02 - 3.17358390207e-02 3.01717861136e-02 2.87187367840e-02 2.73972646659e-02 2.62153172241e-02 2.51823253991e-02 - 2.43184216158e-02 2.36566460915e-02 2.32368358951e-02 2.30924993956e-02 2.32368358951e-02 2.36566460915e-02 - 2.43184216158e-02 2.51823253991e-02 2.62153172241e-02 2.73972646659e-02 2.87187367840e-02 3.01717861136e-02 - 3.17358390207e-02 3.33624200108e-02 3.49654910486e-02 3.64263171972e-02 3.76190713504e-02 3.84534160516e-02 - 3.89160663350e-02 3.93968315223e-02 3.96081166256e-02 3.96081166256e-02 3.93968315223e-02 3.89160663350e-02 - 3.80886538087e-02 3.68707660171e-02 3.52857897121e-02 3.34242157073e-02 3.14154606035e-02 2.93901320501e-02 - 2.74512061786e-02 2.56635113913e-02 2.40594329852e-02 2.26519365039e-02 2.14468462049e-02 2.04512222766e-02 - 1.96777557044e-02 1.91448778653e-02 1.88720574247e-02 1.88720574247e-02 1.91448778653e-02 1.96777557044e-02 - 2.04512222766e-02 2.14468462049e-02 2.26519365039e-02 2.40594329852e-02 2.56635113913e-02 2.74512061786e-02 - 2.93901320501e-02 3.14154606035e-02 3.34242157073e-02 3.52857897121e-02 3.68707660171e-02 3.80886538087e-02 - 3.95849180057e-02 4.02540981079e-02 4.04742233092e-02 4.02540981079e-02 3.95849180057e-02 3.84534160516e-02 - 3.68707660171e-02 3.48956024912e-02 3.26363277502e-02 3.02323588099e-02 2.78244998346e-02 2.55281844546e-02 - 2.34202555044e-02 2.15413174517e-02 1.99070659239e-02 1.85201445811e-02 1.73786828448e-02 1.64818809732e-02 - 1.58329883187e-02 1.54388806266e-02 1.53065353883e-02 1.54388806266e-02 1.58329883187e-02 1.64818809732e-02 - 1.73786828448e-02 1.85201445811e-02 1.99070659239e-02 2.15413174517e-02 2.34202555044e-02 2.55281844546e-02 - 2.78244998346e-02 3.02323588099e-02 3.26363277502e-02 3.48956024912e-02 3.68707660171e-02 3.84534160516e-02 - 4.07924714489e-02 4.14579289512e-02 4.14579289512e-02 4.07924714489e-02 3.94908104948e-02 3.76190713504e-02 - 3.52857897121e-02 3.26363277502e-02 2.98349904445e-02 2.70402901784e-02 2.43819637041e-02 2.19482820950e-02 - 1.97871783123e-02 1.79167348748e-02 1.63370205752e-02 1.50389831834e-02 1.40109856905e-02 1.32437842255e-02 - 1.27327884289e-02 1.24770996440e-02 1.24770996440e-02 1.27327884289e-02 1.32437842255e-02 1.40109856905e-02 - 1.50389831834e-02 1.63370205752e-02 1.79167348748e-02 1.97871783123e-02 2.19482820950e-02 2.43819637041e-02 - 2.70402901784e-02 2.98349904445e-02 3.26363277502e-02 3.52857897121e-02 3.76190713504e-02 3.94908104948e-02 - 4.23378898536e-02 4.27763236460e-02 4.23378898536e-02 4.10571769449e-02 3.90347179512e-02 3.64263171972e-02 - 3.34242157073e-02 3.02323588099e-02 2.70402901784e-02 2.40011711299e-02 2.12198093897e-02 1.87538902948e-02 - 1.66250325509e-02 1.48317912783e-02 1.33594815778e-02 1.21873907787e-02 1.12951380995e-02 1.06671499136e-02 - 1.02937156151e-02 1.01697655067e-02 1.02937156151e-02 1.06671499136e-02 1.12951380995e-02 1.21873907787e-02 - 1.33594815778e-02 1.48317912783e-02 1.66250325509e-02 1.87538902948e-02 2.12198093897e-02 2.40011711299e-02 - 2.70402901784e-02 3.02323588099e-02 3.34242157073e-02 3.64263171972e-02 3.90347179512e-02 4.10571769449e-02 - 4.40291518527e-02 4.40291518527e-02 4.29832635915e-02 4.09927131873e-02 3.82415861113e-02 3.49654910486e-02 - 3.14154606035e-02 2.78244998346e-02 2.43819637041e-02 2.12198093897e-02 1.84129279741e-02 1.59907282434e-02 - 1.39522993746e-02 1.22786655737e-02 1.09414577715e-02 9.91029781221e-03 9.15892896774e-03 8.66817035987e-03 - 8.42580807925e-03 8.42580807925e-03 8.66817035987e-03 9.15892896774e-03 9.91029781221e-03 1.09414577715e-02 - 1.22786655737e-02 1.39522993746e-02 1.59907282434e-02 1.84129279741e-02 2.12198093897e-02 2.43819637041e-02 - 2.78244998346e-02 3.14154606035e-02 3.49654910486e-02 3.82415861113e-02 4.09927131873e-02 4.29832635915e-02 - 4.57409612273e-02 4.51323632879e-02 4.33721592307e-02 4.06430475235e-02 3.72078996967e-02 3.33624200108e-02 - 2.93901320501e-02 2.55281844546e-02 2.19482820950e-02 1.87538902948e-02 1.59907282434e-02 1.36633879542e-02 - 1.17508350709e-02 1.02181471415e-02 9.02578945364e-03 8.13716815266e-03 7.52314503521e-03 7.16308508658e-03 - 7.04448483440e-03 7.16308508658e-03 7.52314503521e-03 8.13716815266e-03 9.02578945364e-03 1.02181471415e-02 - 1.17508350709e-02 1.36633879542e-02 1.59907282434e-02 1.87538902948e-02 2.19482820950e-02 2.55281844546e-02 - 2.93901320501e-02 3.33624200108e-02 3.72078996967e-02 4.06430475235e-02 4.33721592307e-02 4.51323632879e-02 - 4.74313143781e-02 4.60913389830e-02 4.35604474537e-02 4.01041807768e-02 3.60511821341e-02 3.17358390207e-02 - 2.74512061786e-02 2.34202555044e-02 1.97871783123e-02 1.66250325509e-02 1.39522993746e-02 1.17508350709e-02 - 9.98127039361e-03 8.59555582378e-03 7.54684340873e-03 6.79567554150e-03 6.31209415558e-03 6.07562992209e-03 - 6.07562992209e-03 6.31209415558e-03 6.79567554150e-03 7.54684340873e-03 8.59555582378e-03 9.98127039361e-03 - 1.17508350709e-02 1.39522993746e-02 1.66250325509e-02 1.97871783123e-02 2.34202555044e-02 2.74512061786e-02 - 3.17358390207e-02 3.60511821341e-02 4.01041807768e-02 4.35604474537e-02 4.60913389830e-02 4.74313143781e-02 - 4.91148354625e-02 4.69561004766e-02 4.36277000850e-02 3.94725484932e-02 3.48695445110e-02 3.01717861136e-02 - 2.56635113913e-02 2.15413174517e-02 1.79167348748e-02 1.48317912783e-02 1.22786655737e-02 1.02181471415e-02 - 8.59555582378e-03 7.35383003280e-03 6.44245195186e-03 5.82127807001e-03 5.46093720174e-03 5.34296096392e-03 - 5.46093720174e-03 5.82127807001e-03 6.44245195186e-03 7.35383003280e-03 8.59555582378e-03 1.02181471415e-02 - 1.22786655737e-02 1.48317912783e-02 1.79167348748e-02 2.15413174517e-02 2.56635113913e-02 3.01717861136e-02 - 3.48695445110e-02 3.94725484932e-02 4.36277000850e-02 4.69561004766e-02 4.91148354625e-02 4.98633146719e-02 - 5.08044555558e-02 4.77625301985e-02 4.36277000850e-02 3.88104397494e-02 3.37228748044e-02 2.87187367840e-02 - 2.40594329852e-02 1.99070659239e-02 1.63370205752e-02 1.33594815778e-02 1.09414577715e-02 9.02578945364e-03 - 7.54684340873e-03 6.44245195186e-03 5.66079261571e-03 5.16243150929e-03 4.92029966810e-03 4.92029966810e-03 - 5.16243150929e-03 5.66079261571e-03 6.44245195186e-03 7.54684340873e-03 9.02578945364e-03 1.09414577715e-02 - 1.33594815778e-02 1.63370205752e-02 1.99070659239e-02 2.40594329852e-02 2.87187367840e-02 3.37228748044e-02 - 3.88104397494e-02 4.36277000850e-02 4.77625301985e-02 5.08044555558e-02 5.24194501424e-02 5.24194501424e-02 - 5.24477482650e-02 4.84855850881e-02 4.35604474537e-02 3.81345549630e-02 3.26341221073e-02 2.73972646659e-02 - 2.26519365039e-02 1.85201445811e-02 1.50389831834e-02 1.21873907787e-02 9.91029781221e-03 8.13716815266e-03 - 6.79567554150e-03 5.82127807001e-03 5.16243150929e-03 4.78210810048e-03 4.65785937656e-03 4.78210810048e-03 - 5.16243150929e-03 5.82127807001e-03 6.79567554150e-03 8.13716815266e-03 9.91029781221e-03 1.21873907787e-02 - 1.50389831834e-02 1.85201445811e-02 2.26519365039e-02 2.73972646659e-02 3.26341221073e-02 3.81345549630e-02 - 4.35604474537e-02 4.84855850881e-02 5.24477482650e-02 5.50251512552e-02 5.59201471811e-02 5.50251512552e-02 - 5.38883507401e-02 4.90231496620e-02 4.33721592307e-02 3.74259862301e-02 3.16041856284e-02 2.62153172241e-02 - 2.14468462049e-02 1.73786828448e-02 1.40109856905e-02 1.12951380995e-02 9.15892896774e-03 7.52314503521e-03 - 6.31209415558e-03 5.46093720174e-03 4.92029966810e-03 4.65785937656e-03 4.65785937656e-03 4.92029966810e-03 - 5.46093720174e-03 6.31209415558e-03 7.52314503521e-03 9.15892896774e-03 1.12951380995e-02 1.40109856905e-02 - 1.73786828448e-02 2.14468462049e-02 2.62153172241e-02 3.16041856284e-02 3.74259862301e-02 4.33721592307e-02 - 4.90231496620e-02 5.38883507401e-02 5.74762428735e-02 5.93841418824e-02 5.93841418824e-02 5.74762428735e-02 - 5.48714786192e-02 4.92182336225e-02 4.29832635915e-02 3.66568505349e-02 3.06330408871e-02 2.51823253991e-02 - 2.04512222766e-02 1.64818809732e-02 1.32437842255e-02 1.06671499136e-02 8.66817035987e-03 7.16308508658e-03 - 6.07562992209e-03 5.34296096392e-03 4.92029966810e-03 4.78210810048e-03 4.92029966810e-03 5.34296096392e-03 - 6.07562992209e-03 7.16308508658e-03 8.66817035987e-03 1.06671499136e-02 1.32437842255e-02 1.64818809732e-02 - 2.04512222766e-02 2.51823253991e-02 3.06330408871e-02 3.66568505349e-02 4.29832635915e-02 4.92182336225e-02 - 5.48714786192e-02 5.94150808572e-02 6.23688231248e-02 6.33941825467e-02 6.23688231248e-02 5.94150808572e-02 - 5.51031089527e-02 4.89192305177e-02 4.23378898536e-02 3.58243136049e-02 2.97391273192e-02 2.43184216158e-02 - 1.96777557044e-02 1.58329883187e-02 1.27327884289e-02 1.02937156151e-02 8.42580807925e-03 7.04448483440e-03 - 6.07562992209e-03 5.46093720174e-03 5.16243150929e-03 5.16243150929e-03 5.46093720174e-03 6.07562992209e-03 - 7.04448483440e-03 8.42580807925e-03 1.02937156151e-02 1.27327884289e-02 1.58329883187e-02 1.96777557044e-02 - 2.43184216158e-02 2.97391273192e-02 3.58243136049e-02 4.23378898536e-02 4.89192305177e-02 5.51031089527e-02 - 6.03694423859e-02 6.42180018992e-02 6.62522137956e-02 6.62522137956e-02 6.42180018992e-02 6.03694423859e-02 - 5.43692149489e-02 4.80677366203e-02 4.14579289512e-02 3.49773595797e-02 2.89691250092e-02 2.36566460915e-02 - 1.91448778653e-02 1.54388806266e-02 1.24770996440e-02 1.01697655067e-02 8.42580807925e-03 7.16308508658e-03 - 6.31209415558e-03 5.82127807001e-03 5.66079261571e-03 5.82127807001e-03 6.31209415558e-03 7.16308508658e-03 - 8.42580807925e-03 1.01697655067e-02 1.24770996440e-02 1.54388806266e-02 1.91448778653e-02 2.36566460915e-02 - 2.89691250092e-02 3.49773595797e-02 4.14579289512e-02 4.80677366203e-02 5.43692149489e-02 5.98878714669e-02 - 6.41840706496e-02 6.69101294891e-02 6.78442738531e-02 6.69101294891e-02 6.41840706496e-02 5.98878714669e-02 - 5.26931433274e-02 4.67810667612e-02 4.04742233092e-02 3.42208946471e-02 2.83925891295e-02 2.32368358951e-02 - 1.88720574247e-02 1.53065353883e-02 1.24770996440e-02 1.02937156151e-02 8.66817035987e-03 7.52314503521e-03 - 6.79567554150e-03 6.44245195186e-03 6.44245195186e-03 6.79567554150e-03 7.52314503521e-03 8.66817035987e-03 - 1.02937156151e-02 1.24770996440e-02 1.53065353883e-02 1.88720574247e-02 2.32368358951e-02 2.83925891295e-02 - 3.42208946471e-02 4.04742233092e-02 4.67810667612e-02 5.26931433274e-02 5.77843769256e-02 6.17513938278e-02 - 6.44394828494e-02 6.57918464265e-02 6.57918464265e-02 6.44394828494e-02 6.17513938278e-02 5.77843769256e-02 - 5.04463447592e-02 4.53738413591e-02 3.96081166256e-02 3.36893635306e-02 2.80812943983e-02 2.30924993956e-02 - 1.88720574247e-02 1.54388806266e-02 1.27327884289e-02 1.06671499136e-02 9.15892896774e-03 8.13716815266e-03 - 7.54684340873e-03 7.35383003280e-03 7.54684340873e-03 8.13716815266e-03 9.15892896774e-03 1.06671499136e-02 - 1.27327884289e-02 1.54388806266e-02 1.88720574247e-02 2.30924993956e-02 2.80812943983e-02 3.36893635306e-02 - 3.96081166256e-02 4.53738413591e-02 5.04463447592e-02 5.43925934286e-02 5.70772559013e-02 5.86758842735e-02 - 5.94868177545e-02 5.97323039443e-02 5.94868177545e-02 5.86758842735e-02 5.70772559013e-02 5.43925934286e-02 - 4.83002627794e-02 4.42752514752e-02 3.90976289629e-02 3.34971688966e-02 2.80812943983e-02 2.32368358951e-02 - 1.91448778653e-02 1.58329883187e-02 1.32437842255e-02 1.12951380995e-02 9.91029781221e-03 9.02578945364e-03 - 8.59555582378e-03 8.59555582378e-03 9.02578945364e-03 9.91029781221e-03 1.12951380995e-02 1.32437842255e-02 - 1.58329883187e-02 1.91448778653e-02 2.32368358951e-02 2.80812943983e-02 3.34971688966e-02 3.90976289629e-02 - 4.42752514752e-02 4.83002627794e-02 5.06194135765e-02 5.12221625406e-02 5.07010770424e-02 4.98718618187e-02 - 4.93308963719e-02 4.93308963719e-02 4.98718618187e-02 5.07010770424e-02 5.12221625406e-02 5.06194135765e-02 - 4.69885184966e-02 4.38595264834e-02 3.90976289629e-02 3.36893635306e-02 2.83925891295e-02 2.36566460915e-02 - 1.96777557044e-02 1.64818809732e-02 1.40109856905e-02 1.21873907787e-02 1.09414577715e-02 1.02181471415e-02 - 9.98127039361e-03 1.02181471415e-02 1.09414577715e-02 1.21873907787e-02 1.40109856905e-02 1.64818809732e-02 - 1.96777557044e-02 2.36566460915e-02 2.83925891295e-02 3.36893635306e-02 3.90976289629e-02 4.38595264834e-02 - 4.69885184966e-02 4.76689314688e-02 4.58777097769e-02 4.26203265537e-02 3.93541671489e-02 3.71417160544e-02 - 3.63849623957e-02 3.71417160544e-02 3.93541671489e-02 4.26203265537e-02 4.58777097769e-02 4.76689314688e-02 - 4.69885184966e-02 4.42752514752e-02 3.96081166256e-02 3.42208946471e-02 2.89691250092e-02 2.43184216158e-02 - 2.04512222766e-02 1.73786828448e-02 1.50389831834e-02 1.33594815778e-02 1.22786655737e-02 1.17508350709e-02 - 1.17508350709e-02 1.22786655737e-02 1.33594815778e-02 1.50389831834e-02 1.73786828448e-02 2.04512222766e-02 - 2.43184216158e-02 2.89691250092e-02 3.42208946471e-02 3.96081166256e-02 4.42752514752e-02 4.69885184966e-02 - 4.65545163206e-02 4.27064575993e-02 3.67025276917e-02 3.07039905741e-02 2.63856510811e-02 2.42761411551e-02 - 2.42761411551e-02 2.63856510811e-02 3.07039905741e-02 3.67025276917e-02 4.27064575993e-02 4.65545163206e-02 - 4.83002627794e-02 4.53738413591e-02 4.04742233092e-02 3.49773595797e-02 2.97391273192e-02 2.51823253991e-02 - 2.14468462049e-02 1.85201445811e-02 1.63370205752e-02 1.48317912783e-02 1.39522993746e-02 1.36633879542e-02 - 1.39522993746e-02 1.48317912783e-02 1.63370205752e-02 1.85201445811e-02 2.14468462049e-02 2.51823253991e-02 - 2.97391273192e-02 3.49773595797e-02 4.04742233092e-02 4.53738413591e-02 4.83002627794e-02 4.76689314688e-02 - 4.27064575993e-02 3.45455630665e-02 2.59250062413e-02 1.93490286376e-02 1.56860392578e-02 1.45732066269e-02 - 1.56860392578e-02 1.93490286376e-02 2.59250062413e-02 3.45455630665e-02 4.27064575993e-02 4.76689314688e-02 - 5.04463447592e-02 4.67810667612e-02 4.14579289512e-02 3.58243136049e-02 3.06330408871e-02 2.62153172241e-02 - 2.26519365039e-02 1.99070659239e-02 1.79167348748e-02 1.66250325509e-02 1.59907282434e-02 1.59907282434e-02 - 1.66250325509e-02 1.79167348748e-02 1.99070659239e-02 2.26519365039e-02 2.62153172241e-02 3.06330408871e-02 - 3.58243136049e-02 4.14579289512e-02 4.67810667612e-02 5.04463447592e-02 5.06194135765e-02 4.58777097769e-02 - 3.67025276917e-02 2.59250062413e-02 1.69491736420e-02 1.14596764125e-02 9.13060134292e-03 9.13060134292e-03 - 1.14596764125e-02 1.69491736420e-02 2.59250062413e-02 3.67025276917e-02 4.58777097769e-02 5.06194135765e-02 - 5.26931433274e-02 4.80677366203e-02 4.23378898536e-02 3.66568505349e-02 3.16041856284e-02 2.73972646659e-02 - 2.40594329852e-02 2.15413174517e-02 1.97871783123e-02 1.87538902948e-02 1.84129279741e-02 1.87538902948e-02 - 1.97871783123e-02 2.15413174517e-02 2.40594329852e-02 2.73972646659e-02 3.16041856284e-02 3.66568505349e-02 - 4.23378898536e-02 4.80677366203e-02 5.26931433274e-02 5.43925934286e-02 5.12221625406e-02 4.26203265537e-02 - 3.07039905741e-02 1.93490286376e-02 1.14596764125e-02 7.45857574908e-03 6.32692063078e-03 7.45857574908e-03 - 1.14596764125e-02 1.93490286376e-02 3.07039905741e-02 4.26203265537e-02 5.12221625406e-02 5.43925934286e-02 - 5.43692149489e-02 4.89192305177e-02 4.29832635915e-02 3.74259862301e-02 3.26341221073e-02 2.87187367840e-02 - 2.56635113913e-02 2.34202555044e-02 2.19482820950e-02 2.12198093897e-02 2.12198093897e-02 2.19482820950e-02 - 2.34202555044e-02 2.56635113913e-02 2.87187367840e-02 3.26341221073e-02 3.74259862301e-02 4.29832635915e-02 - 4.89192305177e-02 5.43692149489e-02 5.77843769256e-02 5.70772559013e-02 5.07010770424e-02 3.93541671489e-02 - 2.63856510811e-02 1.56860392578e-02 9.13060134292e-03 6.32692063078e-03 6.32692063078e-03 9.13060134292e-03 - 1.56860392578e-02 2.63856510811e-02 3.93541671489e-02 5.07010770424e-02 5.70772559013e-02 5.77843769256e-02 - 5.51031089527e-02 4.92182336225e-02 4.33721592307e-02 3.81345549630e-02 3.37228748044e-02 3.01717861136e-02 - 2.74512061786e-02 2.55281844546e-02 2.43819637041e-02 2.40011711299e-02 2.43819637041e-02 2.55281844546e-02 - 2.74512061786e-02 3.01717861136e-02 3.37228748044e-02 3.81345549630e-02 4.33721592307e-02 4.92182336225e-02 - 5.51031089527e-02 5.98878714669e-02 6.17513938278e-02 5.86758842735e-02 4.98718618187e-02 3.71417160544e-02 - 2.42761411551e-02 1.45732066269e-02 9.13060134292e-03 7.45857574908e-03 9.13060134292e-03 1.45732066269e-02 - 2.42761411551e-02 3.71417160544e-02 4.98718618187e-02 5.86758842735e-02 6.17513938278e-02 5.98878714669e-02 - 5.48714786192e-02 4.90231496620e-02 4.35604474537e-02 3.88104397494e-02 3.48695445110e-02 3.17358390207e-02 - 2.93901320501e-02 2.78244998346e-02 2.70402901784e-02 2.70402901784e-02 2.78244998346e-02 2.93901320501e-02 - 3.17358390207e-02 3.48695445110e-02 3.88104397494e-02 4.35604474537e-02 4.90231496620e-02 5.48714786192e-02 - 6.03694423859e-02 6.41840706496e-02 6.44394828494e-02 5.94868177545e-02 4.93308963719e-02 3.63849623957e-02 - 2.42761411551e-02 1.56860392578e-02 1.14596764125e-02 1.14596764125e-02 1.56860392578e-02 2.42761411551e-02 - 3.63849623957e-02 4.93308963719e-02 5.94868177545e-02 6.44394828494e-02 6.41840706496e-02 6.03694423859e-02 - 5.38883507401e-02 4.84855850881e-02 4.36277000850e-02 3.94725484932e-02 3.60511821341e-02 3.33624200108e-02 - 3.14154606035e-02 3.02323588099e-02 2.98349904445e-02 3.02323588099e-02 3.14154606035e-02 3.33624200108e-02 - 3.60511821341e-02 3.94725484932e-02 4.36277000850e-02 4.84855850881e-02 5.38883507401e-02 5.94150808572e-02 - 6.42180018992e-02 6.69101294891e-02 6.57918464265e-02 5.97323039443e-02 4.93308963719e-02 3.71417160544e-02 - 2.63856510811e-02 1.93490286376e-02 1.69491736420e-02 1.93490286376e-02 2.63856510811e-02 3.71417160544e-02 - 4.93308963719e-02 5.97323039443e-02 6.57918464265e-02 6.69101294891e-02 6.42180018992e-02 5.94150808572e-02 - 5.24477482650e-02 4.77625301985e-02 4.36277000850e-02 4.01041807768e-02 3.72078996967e-02 3.49654910486e-02 - 3.34242157073e-02 3.26363277502e-02 3.26363277502e-02 3.34242157073e-02 3.49654910486e-02 3.72078996967e-02 - 4.01041807768e-02 4.36277000850e-02 4.77625301985e-02 5.24477482650e-02 5.74762428735e-02 6.23688231248e-02 - 6.62522137956e-02 6.78442738531e-02 6.57918464265e-02 5.94868177545e-02 4.98718618187e-02 3.93541671489e-02 - 3.07039905741e-02 2.59250062413e-02 2.59250062413e-02 3.07039905741e-02 3.93541671489e-02 4.98718618187e-02 - 5.94868177545e-02 6.57918464265e-02 6.78442738531e-02 6.62522137956e-02 6.23688231248e-02 5.74762428735e-02 - 5.08044555558e-02 4.69561004766e-02 4.35604474537e-02 4.06430475235e-02 3.82415861113e-02 3.64263171972e-02 - 3.52857897121e-02 3.48956024912e-02 3.52857897121e-02 3.64263171972e-02 3.82415861113e-02 4.06430475235e-02 - 4.35604474537e-02 4.69561004766e-02 5.08044555558e-02 5.50251512552e-02 5.93841418824e-02 6.33941825467e-02 - 6.62522137956e-02 6.69101294891e-02 6.44394828494e-02 5.86758842735e-02 5.07010770424e-02 4.26203265537e-02 - 3.67025276917e-02 3.45455630665e-02 3.67025276917e-02 4.26203265537e-02 5.07010770424e-02 5.86758842735e-02 - 6.44394828494e-02 6.69101294891e-02 6.62522137956e-02 6.33941825467e-02 5.93841418824e-02 5.50251512552e-02 - 4.91148354625e-02 4.60913389830e-02 4.33721592307e-02 4.09927131873e-02 3.90347179512e-02 3.76190713504e-02 - 3.68707660171e-02 3.68707660171e-02 3.76190713504e-02 3.90347179512e-02 4.09927131873e-02 4.33721592307e-02 - 4.60913389830e-02 4.91148354625e-02 5.24194501424e-02 5.59201471811e-02 5.93841418824e-02 6.23688231248e-02 - 6.42180018992e-02 6.41840706496e-02 6.17513938278e-02 5.70772559013e-02 5.12221625406e-02 4.58777097769e-02 - 4.27064575993e-02 4.27064575993e-02 4.58777097769e-02 5.12221625406e-02 5.70772559013e-02 6.17513938278e-02 - 6.41840706496e-02 6.42180018992e-02 6.23688231248e-02 5.93841418824e-02 5.59201471811e-02 5.24194501424e-02 - 4.74313143781e-02 4.51323632879e-02 4.29832635915e-02 4.10571769449e-02 3.94908104948e-02 3.84534160516e-02 - 3.80886538087e-02 3.84534160516e-02 3.94908104948e-02 4.10571769449e-02 4.29832635915e-02 4.51323632879e-02 - 4.74313143781e-02 4.98633146719e-02 5.24194501424e-02 5.50251512552e-02 5.74762428735e-02 5.94150808572e-02 - 6.03694423859e-02 5.98878714669e-02 5.77843769256e-02 5.43925934286e-02 5.06194135765e-02 4.76689314688e-02 - 4.65545163206e-02 4.76689314688e-02 5.06194135765e-02 5.43925934286e-02 5.77843769256e-02 5.98878714669e-02 - 6.03694423859e-02 5.94150808572e-02 5.74762428735e-02 5.50251512552e-02 5.24194501424e-02 4.98633146719e-02 - 5.18034033720e-02 5.00090134447e-02 4.80677366203e-02 4.62623331670e-02 4.49623774036e-02 4.44868574481e-02 - 4.49623774036e-02 4.62623331670e-02 4.80677366203e-02 5.00090134447e-02 5.18034033720e-02 5.33236907840e-02 - 5.45841783826e-02 5.56676247698e-02 5.66331890923e-02 5.74449785733e-02 5.79474348197e-02 5.78981879671e-02 - 5.70612480291e-02 5.53499973529e-02 5.29676178633e-02 5.04463447592e-02 4.85080722970e-02 4.77793166757e-02 - 4.85080722970e-02 5.04463447592e-02 5.29676178633e-02 5.53499973529e-02 5.70612480291e-02 5.78981879671e-02 - 5.79474348197e-02 5.74449785733e-02 5.66331890923e-02 5.56676247698e-02 5.45841783826e-02 5.33236907840e-02 - 5.00090134447e-02 4.84815544672e-02 4.67810667612e-02 4.52857661696e-02 4.44045560444e-02 4.44045560444e-02 - 4.52857661696e-02 4.67810667612e-02 4.84815544672e-02 5.00090134447e-02 5.11403130173e-02 5.18355302331e-02 - 5.21839135623e-02 5.23143637463e-02 5.23143637463e-02 5.21839135623e-02 5.18355302331e-02 5.11403130173e-02 - 5.00090134447e-02 4.84815544672e-02 4.67810667612e-02 4.52857661696e-02 4.44045560444e-02 4.44045560444e-02 - 4.52857661696e-02 4.67810667612e-02 4.84815544672e-02 5.00090134447e-02 5.11403130173e-02 5.18355302331e-02 - 5.21839135623e-02 5.23143637463e-02 5.23143637463e-02 5.21839135623e-02 5.18355302331e-02 5.11403130173e-02 - 4.80677366203e-02 4.67810667612e-02 4.53738413591e-02 4.42752514752e-02 4.38595264834e-02 4.42752514752e-02 - 4.53738413591e-02 4.67810667612e-02 4.80677366203e-02 4.89192305177e-02 4.92182336225e-02 4.90231496620e-02 - 4.84855850881e-02 4.77625301985e-02 4.69561004766e-02 4.60913389830e-02 4.51323632879e-02 4.40291518527e-02 - 4.27763236460e-02 4.14579289512e-02 4.02540981079e-02 3.93968315223e-02 3.90848689472e-02 3.93968315223e-02 - 4.02540981079e-02 4.14579289512e-02 4.27763236460e-02 4.40291518527e-02 4.51323632879e-02 4.60913389830e-02 - 4.69561004766e-02 4.77625301985e-02 4.84855850881e-02 4.90231496620e-02 4.92182336225e-02 4.89192305177e-02 - 4.62623331670e-02 4.52857661696e-02 4.42752514752e-02 4.36365698621e-02 4.36365698621e-02 4.42752514752e-02 - 4.52857661696e-02 4.62623331670e-02 4.68401774785e-02 4.68264624901e-02 4.62258246981e-02 4.51788789706e-02 - 4.38725463784e-02 4.24686468881e-02 4.10670403681e-02 3.97029159910e-02 3.83718132369e-02 3.70689589239e-02 - 3.58243136049e-02 3.47182328687e-02 3.38709874542e-02 3.34071767353e-02 3.34071767353e-02 3.38709874542e-02 - 3.47182328687e-02 3.58243136049e-02 3.70689589239e-02 3.83718132369e-02 3.97029159910e-02 4.10670403681e-02 - 4.24686468881e-02 4.38725463784e-02 4.51788789706e-02 4.62258246981e-02 4.68264624901e-02 4.68401774785e-02 - 4.49623774036e-02 4.44045560444e-02 4.38595264834e-02 4.36365698621e-02 4.38595264834e-02 4.44045560444e-02 - 4.49623774036e-02 4.51877782102e-02 4.48486167771e-02 4.38959177953e-02 4.24386109393e-02 4.06654278454e-02 - 3.87673596218e-02 3.68889471691e-02 3.51127517762e-02 3.34710625414e-02 3.19731919657e-02 3.06330408871e-02 - 2.94854041377e-02 2.85879356046e-02 2.80098127199e-02 2.78094015925e-02 2.80098127199e-02 2.85879356046e-02 - 2.94854041377e-02 3.06330408871e-02 3.19731919657e-02 3.34710625414e-02 3.51127517762e-02 3.68889471691e-02 - 3.87673596218e-02 4.06654278454e-02 4.24386109393e-02 4.38959177953e-02 4.48486167771e-02 4.51877782102e-02 - 4.44868574481e-02 4.44045560444e-02 4.42752514752e-02 4.42752514752e-02 4.44045560444e-02 4.44868574481e-02 - 4.42634768270e-02 4.35234290368e-02 4.21941579647e-02 4.03527020822e-02 3.81729635435e-02 3.58537824974e-02 - 3.35632692529e-02 3.14127386696e-02 2.94586793037e-02 2.77227537368e-02 2.62153172241e-02 2.49511167951e-02 - 2.39549635512e-02 2.32603028496e-02 2.29016184223e-02 2.29016184223e-02 2.32603028496e-02 2.39549635512e-02 - 2.49511167951e-02 2.62153172241e-02 2.77227537368e-02 2.94586793037e-02 3.14127386696e-02 3.35632692529e-02 - 3.58537824974e-02 3.81729635435e-02 4.03527020822e-02 4.21941579647e-02 4.35234290368e-02 4.42634768270e-02 - 4.49623774036e-02 4.52857661696e-02 4.53738413591e-02 4.52857661696e-02 4.49623774036e-02 4.42634768270e-02 - 4.30547772101e-02 4.12888114430e-02 3.90350130516e-02 3.64535808156e-02 3.37399765679e-02 3.10717223250e-02 - 2.85763383726e-02 2.63252408289e-02 2.43476957086e-02 2.26519365039e-02 2.12413612776e-02 2.01220876747e-02 - 1.93050944183e-02 1.88053010662e-02 1.86367379277e-02 1.88053010662e-02 1.93050944183e-02 2.01220876747e-02 - 2.12413612776e-02 2.26519365039e-02 2.43476957086e-02 2.63252408289e-02 2.85763383726e-02 3.10717223250e-02 - 3.37399765679e-02 3.64535808156e-02 3.90350130516e-02 4.12888114430e-02 4.30547772101e-02 4.42634768270e-02 - 4.62623331670e-02 4.67810667612e-02 4.67810667612e-02 4.62623331670e-02 4.51877782102e-02 4.35234290368e-02 - 4.12888114430e-02 3.85829474965e-02 3.55725175924e-02 3.24534608631e-02 2.94074293899e-02 2.65706573512e-02 - 2.40237109616e-02 2.18005508565e-02 1.99070659239e-02 1.83376793613e-02 1.70848695603e-02 1.61434902729e-02 - 1.55127511572e-02 1.51956958667e-02 1.51956958667e-02 1.55127511572e-02 1.61434902729e-02 1.70848695603e-02 - 1.83376793613e-02 1.99070659239e-02 2.18005508565e-02 2.40237109616e-02 2.65706573512e-02 2.94074293899e-02 - 3.24534608631e-02 3.55725175924e-02 3.85829474965e-02 4.12888114430e-02 4.35234290368e-02 4.51877782102e-02 - 4.80677366203e-02 4.84815544672e-02 4.80677366203e-02 4.68401774785e-02 4.48486167771e-02 4.21941579647e-02 - 3.90350130516e-02 3.55725175924e-02 3.20210145144e-02 2.85734174953e-02 2.53749373622e-02 2.25132701769e-02 - 2.00258575799e-02 1.79167348748e-02 1.61729889157e-02 1.47756456624e-02 1.37059602390e-02 1.29494247541e-02 - 1.24976141314e-02 1.23472319177e-02 1.24976141314e-02 1.29494247541e-02 1.37059602390e-02 1.47756456624e-02 - 1.61729889157e-02 1.79167348748e-02 2.00258575799e-02 2.25132701769e-02 2.53749373622e-02 2.85734174953e-02 - 3.20210145144e-02 3.55725175924e-02 3.90350130516e-02 4.21941579647e-02 4.48486167771e-02 4.68401774785e-02 - 5.00090134447e-02 5.00090134447e-02 4.89192305177e-02 4.68264624901e-02 4.38959177953e-02 4.03527020822e-02 - 3.64535808156e-02 3.24534608631e-02 2.85734174953e-02 2.49776956914e-02 2.17657781241e-02 1.89804120902e-02 - 1.66250325509e-02 1.46810426016e-02 1.31198380533e-02 1.19105819676e-02 1.10259974674e-02 1.04460621935e-02 - 1.01587603229e-02 1.01587603229e-02 1.04460621935e-02 1.10259974674e-02 1.19105819676e-02 1.31198380533e-02 - 1.46810426016e-02 1.66250325509e-02 1.89804120902e-02 2.17657781241e-02 2.49776956914e-02 2.85734174953e-02 - 3.24534608631e-02 3.64535808156e-02 4.03527020822e-02 4.38959177953e-02 4.68264624901e-02 4.89192305177e-02 - 5.18034033720e-02 5.11403130173e-02 4.92182336225e-02 4.62258246981e-02 4.24386109393e-02 3.81729635435e-02 - 3.37399765679e-02 2.94074293899e-02 2.53749373622e-02 2.17657781241e-02 1.86354478304e-02 1.59907282434e-02 - 1.38094745262e-02 1.20550163598e-02 1.06856809758e-02 9.66211927865e-03 8.95261635749e-03 8.53524112695e-03 - 8.39746782805e-03 8.53524112695e-03 8.95261635749e-03 9.66211927865e-03 1.06856809758e-02 1.20550163598e-02 - 1.38094745262e-02 1.59907282434e-02 1.86354478304e-02 2.17657781241e-02 2.53749373622e-02 2.94074293899e-02 - 3.37399765679e-02 3.81729635435e-02 4.24386109393e-02 4.62258246981e-02 4.92182336225e-02 5.11403130173e-02 - 5.33236907840e-02 5.18355302331e-02 4.90231496620e-02 4.51788789706e-02 4.06654278454e-02 3.58537824974e-02 - 3.10717223250e-02 2.65706573512e-02 2.25132701769e-02 1.89804120902e-02 1.59907282434e-02 1.35231772103e-02 - 1.15351431719e-02 9.97511028176e-03 8.79214216133e-03 7.94279014126e-03 7.39443450458e-03 7.12561826537e-03 - 7.12561826537e-03 7.39443450458e-03 7.94279014126e-03 8.79214216133e-03 9.97511028176e-03 1.15351431719e-02 - 1.35231772103e-02 1.59907282434e-02 1.89804120902e-02 2.25132701769e-02 2.65706573512e-02 3.10717223250e-02 - 3.58537824974e-02 4.06654278454e-02 4.51788789706e-02 4.90231496620e-02 5.18355302331e-02 5.33236907840e-02 - 5.45841783826e-02 5.21839135623e-02 4.84855850881e-02 4.38725463784e-02 3.87673596218e-02 3.35632692529e-02 - 2.85763383726e-02 2.40237109616e-02 2.00258575799e-02 1.66250325509e-02 1.38094745262e-02 1.15351431719e-02 - 9.74245511371e-03 8.36917339040e-03 7.35981258047e-03 6.67049181789e-03 6.26978037715e-03 6.13840739734e-03 - 6.26978037715e-03 6.67049181789e-03 7.35981258047e-03 8.36917339040e-03 9.74245511371e-03 1.15351431719e-02 - 1.38094745262e-02 1.66250325509e-02 2.00258575799e-02 2.40237109616e-02 2.85763383726e-02 3.35632692529e-02 - 3.87673596218e-02 4.38725463784e-02 4.84855850881e-02 5.21839135623e-02 5.45841783826e-02 5.54167137150e-02 - 5.56676247698e-02 5.23143637463e-02 4.77625301985e-02 4.24686468881e-02 3.68889471691e-02 3.14127386696e-02 - 2.63252408289e-02 2.18005508565e-02 1.79167348748e-02 1.46810426016e-02 1.20550163598e-02 9.97511028176e-03 - 8.36917339040e-03 7.16922584820e-03 6.31909087196e-03 5.77651892440e-03 5.51272438194e-03 5.51272438194e-03 - 5.77651892440e-03 6.31909087196e-03 7.16922584820e-03 8.36917339040e-03 9.97511028176e-03 1.20550163598e-02 - 1.46810426016e-02 1.79167348748e-02 2.18005508565e-02 2.63252408289e-02 3.14127386696e-02 3.68889471691e-02 - 4.24686468881e-02 4.77625301985e-02 5.23143637463e-02 5.56676247698e-02 5.74494623672e-02 5.74494623672e-02 - 5.66331890923e-02 5.23143637463e-02 4.69561004766e-02 4.10670403681e-02 3.51127517762e-02 2.94586793037e-02 - 2.43476957086e-02 1.99070659239e-02 1.61729889157e-02 1.31198380533e-02 1.06856809758e-02 8.79214216133e-03 - 7.35981258047e-03 6.31909087196e-03 5.61528193683e-03 5.20914423543e-03 5.07652462266e-03 5.20914423543e-03 - 5.61528193683e-03 6.31909087196e-03 7.35981258047e-03 8.79214216133e-03 1.06856809758e-02 1.31198380533e-02 - 1.61729889157e-02 1.99070659239e-02 2.43476957086e-02 2.94586793037e-02 3.51127517762e-02 4.10670403681e-02 - 4.69561004766e-02 5.23143637463e-02 5.66331890923e-02 5.94462807362e-02 6.04237632524e-02 5.94462807362e-02 - 5.74449785733e-02 5.21839135623e-02 4.60913389830e-02 3.97029159910e-02 3.34710625414e-02 2.77227537368e-02 - 2.26519365039e-02 1.83376793613e-02 1.47756456624e-02 1.19105819676e-02 9.66211927865e-03 7.94279014126e-03 - 6.67049181789e-03 5.77651892440e-03 5.20914423543e-03 4.93405372394e-03 4.93405372394e-03 5.20914423543e-03 - 5.77651892440e-03 6.67049181789e-03 7.94279014126e-03 9.66211927865e-03 1.19105819676e-02 1.47756456624e-02 - 1.83376793613e-02 2.26519365039e-02 2.77227537368e-02 3.34710625414e-02 3.97029159910e-02 4.60913389830e-02 - 5.21839135623e-02 5.74449785733e-02 6.13334872428e-02 6.34040688222e-02 6.34040688222e-02 6.13334872428e-02 - 5.79474348197e-02 5.18355302331e-02 4.51323632879e-02 3.83718132369e-02 3.19731919657e-02 2.62153172241e-02 - 2.12413612776e-02 1.70848695603e-02 1.37059602390e-02 1.10259974674e-02 8.95261635749e-03 7.39443450458e-03 - 6.26978037715e-03 5.51272438194e-03 5.07652462266e-03 4.93405372394e-03 5.07652462266e-03 5.51272438194e-03 - 6.26978037715e-03 7.39443450458e-03 8.95261635749e-03 1.10259974674e-02 1.37059602390e-02 1.70848695603e-02 - 2.12413612776e-02 2.62153172241e-02 3.19731919657e-02 3.83718132369e-02 4.51323632879e-02 5.18355302331e-02 - 5.79474348197e-02 6.28828729732e-02 6.61022866145e-02 6.72218662363e-02 6.61022866145e-02 6.28828729732e-02 - 5.78981879671e-02 5.11403130173e-02 4.40291518527e-02 3.70689589239e-02 3.06330408871e-02 2.49511167951e-02 - 2.01220876747e-02 1.61434902729e-02 1.29494247541e-02 1.04460621935e-02 8.53524112695e-03 7.12561826537e-03 - 6.13840739734e-03 5.51272438194e-03 5.20914423543e-03 5.20914423543e-03 5.51272438194e-03 6.13840739734e-03 - 7.12561826537e-03 8.53524112695e-03 1.04460621935e-02 1.29494247541e-02 1.61434902729e-02 2.01220876747e-02 - 2.49511167951e-02 3.06330408871e-02 3.70689589239e-02 4.40291518527e-02 5.11403130173e-02 5.78981879671e-02 - 6.37149803432e-02 6.80033074139e-02 7.02831021338e-02 7.02831021338e-02 6.80033074139e-02 6.37149803432e-02 - 5.70612480291e-02 5.00090134447e-02 4.27763236460e-02 3.58243136049e-02 2.94854041377e-02 2.39549635512e-02 - 1.93050944183e-02 1.55127511572e-02 1.24976141314e-02 1.01587603229e-02 8.39746782805e-03 7.12561826537e-03 - 6.26978037715e-03 5.77651892440e-03 5.61528193683e-03 5.77651892440e-03 6.26978037715e-03 7.12561826537e-03 - 8.39746782805e-03 1.01587603229e-02 1.24976141314e-02 1.55127511572e-02 1.93050944183e-02 2.39549635512e-02 - 2.94854041377e-02 3.58243136049e-02 4.27763236460e-02 5.00090134447e-02 5.70612480291e-02 6.33842515281e-02 - 6.84139609392e-02 7.16581855164e-02 7.27796836797e-02 7.16581855164e-02 6.84139609392e-02 6.33842515281e-02 - 5.53499973529e-02 4.84815544672e-02 4.14579289512e-02 3.47182328687e-02 2.85879356046e-02 2.32603028496e-02 - 1.88053010662e-02 1.51956958667e-02 1.23472319177e-02 1.01587603229e-02 8.53524112695e-03 7.39443450458e-03 - 6.67049181789e-03 6.31909087196e-03 6.31909087196e-03 6.67049181789e-03 7.39443450458e-03 8.53524112695e-03 - 1.01587603229e-02 1.23472319177e-02 1.51956958667e-02 1.88053010662e-02 2.32603028496e-02 2.85879356046e-02 - 3.47182328687e-02 4.14579289512e-02 4.84815544672e-02 5.53499973529e-02 6.15702941626e-02 6.66786802062e-02 - 7.03019494995e-02 7.21810172465e-02 7.21810172465e-02 7.03019494995e-02 6.66786802062e-02 6.15702941626e-02 - 5.29676178633e-02 4.67810667612e-02 4.02540981079e-02 3.38709874542e-02 2.80098127199e-02 2.29016184223e-02 - 1.86367379277e-02 1.51956958667e-02 1.24976141314e-02 1.04460621935e-02 8.95261635749e-03 7.94279014126e-03 - 7.35981258047e-03 7.16922584820e-03 7.35981258047e-03 7.94279014126e-03 8.95261635749e-03 1.04460621935e-02 - 1.24976141314e-02 1.51956958667e-02 1.86367379277e-02 2.29016184223e-02 2.80098127199e-02 3.38709874542e-02 - 4.02540981079e-02 4.67810667612e-02 5.29676178633e-02 5.83399236929e-02 6.25800698666e-02 6.55787911247e-02 - 6.73541476702e-02 6.79419572879e-02 6.73541476702e-02 6.55787911247e-02 6.25800698666e-02 5.83399236929e-02 - 5.04463447592e-02 4.52857661696e-02 3.93968315223e-02 3.34071767353e-02 2.78094015925e-02 2.29016184223e-02 - 1.88053010662e-02 1.55127511572e-02 1.29494247541e-02 1.10259974674e-02 9.66211927865e-03 8.79214216133e-03 - 8.36917339040e-03 8.36917339040e-03 8.79214216133e-03 9.66211927865e-03 1.10259974674e-02 1.29494247541e-02 - 1.55127511572e-02 1.88053010662e-02 2.29016184223e-02 2.78094015925e-02 3.34071767353e-02 3.93968315223e-02 - 4.52857661696e-02 5.04463447592e-02 5.43239294918e-02 5.67236888968e-02 5.79103146750e-02 5.83777841365e-02 - 5.85232784436e-02 5.85232784436e-02 5.83777841365e-02 5.79103146750e-02 5.67236888968e-02 5.43239294918e-02 - 4.85080722970e-02 4.44045560444e-02 3.90848689472e-02 3.34071767353e-02 2.80098127199e-02 2.32603028496e-02 - 1.93050944183e-02 1.61434902729e-02 1.37059602390e-02 1.19105819676e-02 1.06856809758e-02 9.97511028176e-03 - 9.74245511371e-03 9.97511028176e-03 1.06856809758e-02 1.19105819676e-02 1.37059602390e-02 1.61434902729e-02 - 1.93050944183e-02 2.32603028496e-02 2.80098127199e-02 3.34071767353e-02 3.90848689472e-02 4.44045560444e-02 - 4.85080722970e-02 5.06194135765e-02 5.05555186569e-02 4.89850720157e-02 4.70389926376e-02 4.56222411881e-02 - 4.51254329663e-02 4.56222411881e-02 4.70389926376e-02 4.89850720157e-02 5.05555186569e-02 5.06194135765e-02 - 4.77793166757e-02 4.44045560444e-02 3.93968315223e-02 3.38709874542e-02 2.85879356046e-02 2.39549635512e-02 - 2.01220876747e-02 1.70848695603e-02 1.47756456624e-02 1.31198380533e-02 1.20550163598e-02 1.15351431719e-02 - 1.15351431719e-02 1.20550163598e-02 1.31198380533e-02 1.47756456624e-02 1.70848695603e-02 2.01220876747e-02 - 2.39549635512e-02 2.85879356046e-02 3.38709874542e-02 3.93968315223e-02 4.44045560444e-02 4.77793166757e-02 - 4.83941231678e-02 4.58777097769e-02 4.11986868029e-02 3.62214481565e-02 3.25101129901e-02 3.06594619284e-02 - 3.06594619284e-02 3.25101129901e-02 3.62214481565e-02 4.11986868029e-02 4.58777097769e-02 4.83941231678e-02 - 4.85080722970e-02 4.52857661696e-02 4.02540981079e-02 3.47182328687e-02 2.94854041377e-02 2.49511167951e-02 - 2.12413612776e-02 1.83376793613e-02 1.61729889157e-02 1.46810426016e-02 1.38094745262e-02 1.35231772103e-02 - 1.38094745262e-02 1.46810426016e-02 1.61729889157e-02 1.83376793613e-02 2.12413612776e-02 2.49511167951e-02 - 2.94854041377e-02 3.47182328687e-02 4.02540981079e-02 4.52857661696e-02 4.85080722970e-02 4.83941231678e-02 - 4.41366450522e-02 3.67025276917e-02 2.86292518106e-02 2.23413746600e-02 1.87771308641e-02 1.76819501362e-02 - 1.87771308641e-02 2.23413746600e-02 2.86292518106e-02 3.67025276917e-02 4.41366450522e-02 4.83941231678e-02 - 5.04463447592e-02 4.67810667612e-02 4.14579289512e-02 3.58243136049e-02 3.06330408871e-02 2.62153172241e-02 - 2.26519365039e-02 1.99070659239e-02 1.79167348748e-02 1.66250325509e-02 1.59907282434e-02 1.59907282434e-02 - 1.66250325509e-02 1.79167348748e-02 1.99070659239e-02 2.26519365039e-02 2.62153172241e-02 3.06330408871e-02 - 3.58243136049e-02 4.14579289512e-02 4.67810667612e-02 5.04463447592e-02 5.06194135765e-02 4.58777097769e-02 - 3.67025276917e-02 2.59250062413e-02 1.69491736420e-02 1.14596764125e-02 9.13060134292e-03 9.13060134292e-03 - 1.14596764125e-02 1.69491736420e-02 2.59250062413e-02 3.67025276917e-02 4.58777097769e-02 5.06194135765e-02 - 5.29676178633e-02 4.84815544672e-02 4.27763236460e-02 3.70689589239e-02 3.19731919657e-02 2.77227537368e-02 - 2.43476957086e-02 2.18005508565e-02 2.00258575799e-02 1.89804120902e-02 1.86354478304e-02 1.89804120902e-02 - 2.00258575799e-02 2.18005508565e-02 2.43476957086e-02 2.77227537368e-02 3.19731919657e-02 3.70689589239e-02 - 4.27763236460e-02 4.84815544672e-02 5.29676178633e-02 5.43239294918e-02 5.05555186569e-02 4.11986868029e-02 - 2.86292518106e-02 1.69491736420e-02 9.05419851032e-03 5.17285277950e-03 4.10298626852e-03 5.17285277950e-03 - 9.05419851032e-03 1.69491736420e-02 2.86292518106e-02 4.11986868029e-02 5.05555186569e-02 5.43239294918e-02 - 5.53499973529e-02 5.00090134447e-02 4.40291518527e-02 3.83718132369e-02 3.34710625414e-02 2.94586793037e-02 - 2.63252408289e-02 2.40237109616e-02 2.25132701769e-02 2.17657781241e-02 2.17657781241e-02 2.25132701769e-02 - 2.40237109616e-02 2.63252408289e-02 2.94586793037e-02 3.34710625414e-02 3.83718132369e-02 4.40291518527e-02 - 5.00090134447e-02 5.53499973529e-02 5.83399236929e-02 5.67236888968e-02 4.89850720157e-02 3.62214481565e-02 - 2.23413746600e-02 1.14596764125e-02 5.17285277950e-03 2.64004483879e-03 2.64004483879e-03 5.17285277950e-03 - 1.14596764125e-02 2.23413746600e-02 3.62214481565e-02 4.89850720157e-02 5.67236888968e-02 5.83399236929e-02 - 5.70612480291e-02 5.11403130173e-02 4.51323632879e-02 3.97029159910e-02 3.51127517762e-02 3.14127386696e-02 - 2.85763383726e-02 2.65706573512e-02 2.53749373622e-02 2.49776956914e-02 2.53749373622e-02 2.65706573512e-02 - 2.85763383726e-02 3.14127386696e-02 3.51127517762e-02 3.97029159910e-02 4.51323632879e-02 5.11403130173e-02 - 5.70612480291e-02 6.15702941626e-02 6.25800698666e-02 5.79103146750e-02 4.70389926376e-02 3.25101129901e-02 - 1.87771308641e-02 9.13060134292e-03 4.10298626852e-03 2.64004483879e-03 4.10298626852e-03 9.13060134292e-03 - 1.87771308641e-02 3.25101129901e-02 4.70389926376e-02 5.79103146750e-02 6.25800698666e-02 6.15702941626e-02 - 5.78981879671e-02 5.18355302331e-02 4.60913389830e-02 4.10670403681e-02 3.68889471691e-02 3.35632692529e-02 - 3.10717223250e-02 2.94074293899e-02 2.85734174953e-02 2.85734174953e-02 2.94074293899e-02 3.10717223250e-02 - 3.35632692529e-02 3.68889471691e-02 4.10670403681e-02 4.60913389830e-02 5.18355302331e-02 5.78981879671e-02 - 6.33842515281e-02 6.66786802062e-02 6.55787911247e-02 5.83777841365e-02 4.56222411881e-02 3.06594619284e-02 - 1.76819501362e-02 9.13060134292e-03 5.17285277950e-03 5.17285277950e-03 9.13060134292e-03 1.76819501362e-02 - 3.06594619284e-02 4.56222411881e-02 5.83777841365e-02 6.55787911247e-02 6.66786802062e-02 6.33842515281e-02 - 5.79474348197e-02 5.21839135623e-02 4.69561004766e-02 4.24686468881e-02 3.87673596218e-02 3.58537824974e-02 - 3.37399765679e-02 3.24534608631e-02 3.20210145144e-02 3.24534608631e-02 3.37399765679e-02 3.58537824974e-02 - 3.87673596218e-02 4.24686468881e-02 4.69561004766e-02 5.21839135623e-02 5.79474348197e-02 6.37149803432e-02 - 6.84139609392e-02 7.03019494995e-02 6.73541476702e-02 5.85232784436e-02 4.51254329663e-02 3.06594619284e-02 - 1.87771308641e-02 1.14596764125e-02 9.05419851032e-03 1.14596764125e-02 1.87771308641e-02 3.06594619284e-02 - 4.51254329663e-02 5.85232784436e-02 6.73541476702e-02 7.03019494995e-02 6.84139609392e-02 6.37149803432e-02 - 5.74449785733e-02 5.23143637463e-02 4.77625301985e-02 4.38725463784e-02 4.06654278454e-02 3.81729635435e-02 - 3.64535808156e-02 3.55725175924e-02 3.55725175924e-02 3.64535808156e-02 3.81729635435e-02 4.06654278454e-02 - 4.38725463784e-02 4.77625301985e-02 5.23143637463e-02 5.74449785733e-02 6.28828729732e-02 6.80033074139e-02 - 7.16581855164e-02 7.21810172465e-02 6.79419572879e-02 5.85232784436e-02 4.56222411881e-02 3.25101129901e-02 - 2.23413746600e-02 1.69491736420e-02 1.69491736420e-02 2.23413746600e-02 3.25101129901e-02 4.56222411881e-02 - 5.85232784436e-02 6.79419572879e-02 7.21810172465e-02 7.16581855164e-02 6.80033074139e-02 6.28828729732e-02 - 5.66331890923e-02 5.23143637463e-02 4.84855850881e-02 4.51788789706e-02 4.24386109393e-02 4.03527020822e-02 - 3.90350130516e-02 3.85829474965e-02 3.90350130516e-02 4.03527020822e-02 4.24386109393e-02 4.51788789706e-02 - 4.84855850881e-02 5.23143637463e-02 5.66331890923e-02 6.13334872428e-02 6.61022866145e-02 7.02831021338e-02 - 7.27796836797e-02 7.21810172465e-02 6.73541476702e-02 5.83777841365e-02 4.70389926376e-02 3.62214481565e-02 - 2.86292518106e-02 2.59250062413e-02 2.86292518106e-02 3.62214481565e-02 4.70389926376e-02 5.83777841365e-02 - 6.73541476702e-02 7.21810172465e-02 7.27796836797e-02 7.02831021338e-02 6.61022866145e-02 6.13334872428e-02 - 5.56676247698e-02 5.21839135623e-02 4.90231496620e-02 4.62258246981e-02 4.38959177953e-02 4.21941579647e-02 - 4.12888114430e-02 4.12888114430e-02 4.21941579647e-02 4.38959177953e-02 4.62258246981e-02 4.90231496620e-02 - 5.21839135623e-02 5.56676247698e-02 5.94462807362e-02 6.34040688222e-02 6.72218662363e-02 7.02831021338e-02 - 7.16581855164e-02 7.03019494995e-02 6.55787911247e-02 5.79103146750e-02 4.89850720157e-02 4.11986868029e-02 - 3.67025276917e-02 3.67025276917e-02 4.11986868029e-02 4.89850720157e-02 5.79103146750e-02 6.55787911247e-02 - 7.03019494995e-02 7.16581855164e-02 7.02831021338e-02 6.72218662363e-02 6.34040688222e-02 5.94462807362e-02 - 5.45841783826e-02 5.18355302331e-02 4.92182336225e-02 4.68264624901e-02 4.48486167771e-02 4.35234290368e-02 - 4.30547772101e-02 4.35234290368e-02 4.48486167771e-02 4.68264624901e-02 4.92182336225e-02 5.18355302331e-02 - 5.45841783826e-02 5.74494623672e-02 6.04237632524e-02 6.34040688222e-02 6.61022866145e-02 6.80033074139e-02 - 6.84139609392e-02 6.66786802062e-02 6.25800698666e-02 5.67236888968e-02 5.05555186569e-02 4.58777097769e-02 - 4.41366450522e-02 4.58777097769e-02 5.05555186569e-02 5.67236888968e-02 6.25800698666e-02 6.66786802062e-02 - 6.84139609392e-02 6.80033074139e-02 6.61022866145e-02 6.34040688222e-02 6.04237632524e-02 5.74494623672e-02 - 5.33236907840e-02 5.11403130173e-02 4.89192305177e-02 4.68401774785e-02 4.51877782102e-02 4.42634768270e-02 - 4.42634768270e-02 4.51877782102e-02 4.68401774785e-02 4.89192305177e-02 5.11403130173e-02 5.33236907840e-02 - 5.54167137150e-02 5.74494623672e-02 5.94462807362e-02 6.13334872428e-02 6.28828729732e-02 6.37149803432e-02 - 6.33842515281e-02 6.15702941626e-02 5.83399236929e-02 5.43239294918e-02 5.06194135765e-02 4.83941231678e-02 - 4.83941231678e-02 5.06194135765e-02 5.43239294918e-02 5.83399236929e-02 6.15702941626e-02 6.33842515281e-02 - 6.37149803432e-02 6.28828729732e-02 6.13334872428e-02 5.94462807362e-02 5.74494623672e-02 5.54167137150e-02 - 5.77319585491e-02 5.53499973529e-02 5.26931433274e-02 5.03535465114e-02 4.89738024005e-02 4.89738024005e-02 - 5.03535465114e-02 5.26931433274e-02 5.53499973529e-02 5.77319585491e-02 5.94941697642e-02 6.05796981280e-02 - 6.11288569567e-02 6.13379141192e-02 6.13379141192e-02 6.11288569567e-02 6.05796981280e-02 5.94941697642e-02 - 5.77319585491e-02 5.53499973529e-02 5.26931433274e-02 5.03535465114e-02 4.89738024005e-02 4.89738024005e-02 - 5.03535465114e-02 5.26931433274e-02 5.53499973529e-02 5.77319585491e-02 5.94941697642e-02 6.05796981280e-02 - 6.11288569567e-02 6.13379141192e-02 6.13379141192e-02 6.11288569567e-02 6.05796981280e-02 5.94941697642e-02 - 5.53499973529e-02 5.29676178633e-02 5.04463447592e-02 4.85080722970e-02 4.77793166757e-02 4.85080722970e-02 - 5.04463447592e-02 5.29676178633e-02 5.53499973529e-02 5.70612480291e-02 5.78981879671e-02 5.79474348197e-02 - 5.74449785733e-02 5.66331890923e-02 5.56676247698e-02 5.45841783826e-02 5.33236907840e-02 5.18034033720e-02 - 5.00090134447e-02 4.80677366203e-02 4.62623331670e-02 4.49623774036e-02 4.44868574481e-02 4.49623774036e-02 - 4.62623331670e-02 4.80677366203e-02 5.00090134447e-02 5.18034033720e-02 5.33236907840e-02 5.45841783826e-02 - 5.56676247698e-02 5.66331890923e-02 5.74449785733e-02 5.79474348197e-02 5.78981879671e-02 5.70612480291e-02 - 5.26931433274e-02 5.04463447592e-02 4.83002627794e-02 4.69885184966e-02 4.69885184966e-02 4.83002627794e-02 - 5.04463447592e-02 5.26931433274e-02 5.43692149489e-02 5.51031089527e-02 5.48714786192e-02 5.38883507401e-02 - 5.24477482650e-02 5.08044555558e-02 4.91148354625e-02 4.74313143781e-02 4.57409612273e-02 4.40291518527e-02 - 4.23378898536e-02 4.07924714489e-02 3.95849180057e-02 3.89160663350e-02 3.89160663350e-02 3.95849180057e-02 - 4.07924714489e-02 4.23378898536e-02 4.40291518527e-02 4.57409612273e-02 4.74313143781e-02 4.91148354625e-02 - 5.08044555558e-02 5.24477482650e-02 5.38883507401e-02 5.48714786192e-02 5.51031089527e-02 5.43692149489e-02 - 5.03535465114e-02 4.85080722970e-02 4.69885184966e-02 4.64020316983e-02 4.69885184966e-02 4.85080722970e-02 - 5.03535465114e-02 5.18281863755e-02 5.24339557043e-02 5.20147259753e-02 5.07121410456e-02 4.88190878681e-02 - 4.66403070569e-02 4.44094609233e-02 4.22610610741e-02 4.02453701311e-02 3.83718132369e-02 3.66568505349e-02 - 3.51532871168e-02 3.39533984936e-02 3.31691643222e-02 3.28952522339e-02 3.31691643222e-02 3.39533984936e-02 - 3.51532871168e-02 3.66568505349e-02 3.83718132369e-02 4.02453701311e-02 4.22610610741e-02 4.44094609233e-02 - 4.66403070569e-02 4.88190878681e-02 5.07121410456e-02 5.20147259753e-02 5.24339557043e-02 5.18281863755e-02 - 4.89738024005e-02 4.77793166757e-02 4.69885184966e-02 4.69885184966e-02 4.77793166757e-02 4.89738024005e-02 - 4.99825941802e-02 5.02828320119e-02 4.96193341715e-02 4.80406383964e-02 4.57968161948e-02 4.32002938784e-02 - 4.05244812822e-02 3.79563421300e-02 3.55932306397e-02 3.34710625414e-02 3.16041856284e-02 3.00149219248e-02 - 2.87439673059e-02 2.78466298707e-02 2.73794467347e-02 2.73794467347e-02 2.78466298707e-02 2.87439673059e-02 - 3.00149219248e-02 3.16041856284e-02 3.34710625414e-02 3.55932306397e-02 3.79563421300e-02 4.05244812822e-02 - 4.32002938784e-02 4.57968161948e-02 4.80406383964e-02 4.96193341715e-02 5.02828320119e-02 4.99825941802e-02 - 4.89738024005e-02 4.85080722970e-02 4.83002627794e-02 4.85080722970e-02 4.89738024005e-02 4.93048229800e-02 - 4.90700187394e-02 4.79989400749e-02 4.60731359718e-02 4.34838779539e-02 4.05199675384e-02 3.74634706166e-02 - 3.45282284639e-02 3.18414068716e-02 2.94586793037e-02 2.73972646659e-02 2.56657154446e-02 2.42781130820e-02 - 2.32562353108e-02 2.26267522861e-02 2.24136125305e-02 2.26267522861e-02 2.32562353108e-02 2.42781130820e-02 - 2.56657154446e-02 2.73972646659e-02 2.94586793037e-02 3.18414068716e-02 3.45282284639e-02 3.74634706166e-02 - 4.05199675384e-02 4.34838779539e-02 4.60731359718e-02 4.79989400749e-02 4.90700187394e-02 4.93048229800e-02 - 5.03535465114e-02 5.04463447592e-02 5.04463447592e-02 5.03535465114e-02 4.99825941802e-02 4.90700187394e-02 - 4.74231711778e-02 4.50208900473e-02 4.20165784801e-02 3.86662855632e-02 3.52402742752e-02 3.19590319446e-02 - 2.89647599965e-02 2.63252408289e-02 2.40594329852e-02 2.21666114252e-02 2.06439962171e-02 1.94921954522e-02 - 1.87162119832e-02 1.83246021902e-02 1.83246021902e-02 1.87162119832e-02 1.94921954522e-02 2.06439962171e-02 - 2.21666114252e-02 2.40594329852e-02 2.63252408289e-02 2.89647599965e-02 3.19590319446e-02 3.52402742752e-02 - 3.86662855632e-02 4.20165784801e-02 4.50208900473e-02 4.74231711778e-02 4.90700187394e-02 4.99825941802e-02 - 5.26931433274e-02 5.29676178633e-02 5.26931433274e-02 5.18281863755e-02 5.02828320119e-02 4.79989400749e-02 - 4.50208900473e-02 4.15120643887e-02 3.77147526395e-02 3.38859304601e-02 3.02423286704e-02 2.69304328597e-02 - 2.40237109616e-02 2.15413174517e-02 1.94746684497e-02 1.78072941675e-02 1.65234811342e-02 1.56112881223e-02 - 1.50645020089e-02 1.48820928374e-02 1.50645020089e-02 1.56112881223e-02 1.65234811342e-02 1.78072941675e-02 - 1.94746684497e-02 2.15413174517e-02 2.40237109616e-02 2.69304328597e-02 3.02423286704e-02 3.38859304601e-02 - 3.77147526395e-02 4.15120643887e-02 4.50208900473e-02 4.79989400749e-02 5.02828320119e-02 5.18281863755e-02 - 5.53499973529e-02 5.53499973529e-02 5.43692149489e-02 5.24339557043e-02 4.96193341715e-02 4.60731359718e-02 - 4.20165784801e-02 3.77147526395e-02 3.34304675050e-02 2.93819034216e-02 2.57176061925e-02 2.25132701769e-02 - 1.97871783123e-02 1.75241772421e-02 1.56960478729e-02 1.42727054437e-02 1.32272933414e-02 1.25396406703e-02 - 1.21980827392e-02 1.21980827392e-02 1.25396406703e-02 1.32272933414e-02 1.42727054437e-02 1.56960478729e-02 - 1.75241772421e-02 1.97871783123e-02 2.25132701769e-02 2.57176061925e-02 2.93819034216e-02 3.34304675050e-02 - 3.77147526395e-02 4.20165784801e-02 4.60731359718e-02 4.96193341715e-02 5.24339557043e-02 5.43692149489e-02 - 5.77319585491e-02 5.70612480291e-02 5.51031089527e-02 5.20147259753e-02 4.80406383964e-02 4.34838779539e-02 - 3.86662855632e-02 3.38859304601e-02 2.93819034216e-02 2.53146898274e-02 2.17657781241e-02 1.87538902948e-02 - 1.62588522549e-02 1.42425749040e-02 1.26620800682e-02 1.14766013692e-02 1.06524671204e-02 1.01663421573e-02 - 1.00055755901e-02 1.01663421573e-02 1.06524671204e-02 1.14766013692e-02 1.26620800682e-02 1.42425749040e-02 - 1.62588522549e-02 1.87538902948e-02 2.17657781241e-02 2.53146898274e-02 2.93819034216e-02 3.38859304601e-02 - 3.86662855632e-02 4.34838779539e-02 4.80406383964e-02 5.20147259753e-02 5.51031089527e-02 5.70612480291e-02 - 5.94941697642e-02 5.78981879671e-02 5.48714786192e-02 5.07121410456e-02 4.57968161948e-02 4.05199675384e-02 - 3.52402742752e-02 3.02423286704e-02 2.57176061925e-02 2.17657781241e-02 1.84129279741e-02 1.56375665721e-02 - 1.33939588194e-02 1.16276251073e-02 1.02846446979e-02 9.31810768724e-03 8.69246386814e-03 8.38500711079e-03 - 8.38500711079e-03 8.69246386814e-03 9.31810768724e-03 1.02846446979e-02 1.16276251073e-02 1.33939588194e-02 - 1.56375665721e-02 1.84129279741e-02 2.17657781241e-02 2.57176061925e-02 3.02423286704e-02 3.52402742752e-02 - 4.05199675384e-02 4.57968161948e-02 5.07121410456e-02 5.48714786192e-02 5.78981879671e-02 5.94941697642e-02 - 6.05796981280e-02 5.79474348197e-02 5.38883507401e-02 4.88190878681e-02 4.32002938784e-02 3.74634706166e-02 - 3.19590319446e-02 2.69304328597e-02 2.25132701769e-02 1.87538902948e-02 1.56375665721e-02 1.31152359900e-02 - 1.11228159589e-02 9.59384043225e-03 8.46823559623e-03 7.69793885145e-03 7.24904282964e-03 7.10160482063e-03 - 7.24904282964e-03 7.69793885145e-03 8.46823559623e-03 9.59384043225e-03 1.11228159589e-02 1.31152359900e-02 - 1.56375665721e-02 1.87538902948e-02 2.25132701769e-02 2.69304328597e-02 3.19590319446e-02 3.74634706166e-02 - 4.32002938784e-02 4.88190878681e-02 5.38883507401e-02 5.79474348197e-02 6.05796981280e-02 6.14923433640e-02 - 6.11288569567e-02 5.74449785733e-02 5.24477482650e-02 4.66403070569e-02 4.05244812822e-02 3.45282284639e-02 - 2.89647599965e-02 2.40237109616e-02 1.97871783123e-02 1.62588522549e-02 1.33939588194e-02 1.11228159589e-02 - 9.36769905218e-03 8.05519399644e-03 7.12420828954e-03 6.52902358143e-03 6.23916674188e-03 6.23916674188e-03 - 6.52902358143e-03 7.12420828954e-03 8.05519399644e-03 9.36769905218e-03 1.11228159589e-02 1.33939588194e-02 - 1.62588522549e-02 1.97871783123e-02 2.40237109616e-02 2.89647599965e-02 3.45282284639e-02 4.05244812822e-02 - 4.66403070569e-02 5.24477482650e-02 5.74449785733e-02 6.11288569567e-02 6.30873277659e-02 6.30873277659e-02 - 6.13379141192e-02 5.66331890923e-02 5.08044555558e-02 4.44094609233e-02 3.79563421300e-02 3.18414068716e-02 - 2.63252408289e-02 2.15413174517e-02 1.75241772421e-02 1.42425749040e-02 1.16276251073e-02 9.59384043225e-03 - 8.05519399644e-03 6.93665223838e-03 6.17967298585e-03 5.74257125314e-03 5.59978938003e-03 5.74257125314e-03 - 6.17967298585e-03 6.93665223838e-03 8.05519399644e-03 9.59384043225e-03 1.16276251073e-02 1.42425749040e-02 - 1.75241772421e-02 2.15413174517e-02 2.63252408289e-02 3.18414068716e-02 3.79563421300e-02 4.44094609233e-02 - 5.08044555558e-02 5.66331890923e-02 6.13379141192e-02 6.44054743742e-02 6.54719417706e-02 6.44054743742e-02 - 6.13379141192e-02 5.56676247698e-02 4.91148354625e-02 4.22610610741e-02 3.55932306397e-02 2.94586793037e-02 - 2.40594329852e-02 1.94746684497e-02 1.56960478729e-02 1.26620800682e-02 1.02846446979e-02 8.46823559623e-03 - 7.12420828954e-03 6.17967298585e-03 5.58034633768e-03 5.28994524639e-03 5.28994524639e-03 5.58034633768e-03 - 6.17967298585e-03 7.12420828954e-03 8.46823559623e-03 1.02846446979e-02 1.26620800682e-02 1.56960478729e-02 - 1.94746684497e-02 2.40594329852e-02 2.94586793037e-02 3.55932306397e-02 4.22610610741e-02 4.91148354625e-02 - 5.56676247698e-02 6.13379141192e-02 6.55352798807e-02 6.77723654588e-02 6.77723654588e-02 6.55352798807e-02 - 6.11288569567e-02 5.45841783826e-02 4.74313143781e-02 4.02453701311e-02 3.34710625414e-02 2.73972646659e-02 - 2.21666114252e-02 1.78072941675e-02 1.42727054437e-02 1.14766013692e-02 9.31810768724e-03 7.69793885145e-03 - 6.52902358143e-03 5.74257125314e-03 5.28994524639e-03 5.14226972170e-03 5.28994524639e-03 5.74257125314e-03 - 6.52902358143e-03 7.69793885145e-03 9.31810768724e-03 1.14766013692e-02 1.42727054437e-02 1.78072941675e-02 - 2.21666114252e-02 2.73972646659e-02 3.34710625414e-02 4.02453701311e-02 4.74313143781e-02 5.45841783826e-02 - 6.11288569567e-02 6.64284767715e-02 6.98920688762e-02 7.10977313661e-02 6.98920688762e-02 6.64284767715e-02 - 6.05796981280e-02 5.33236907840e-02 4.57409612273e-02 3.83718132369e-02 3.16041856284e-02 2.56657154446e-02 - 2.06439962171e-02 1.65234811342e-02 1.32272933414e-02 1.06524671204e-02 8.69246386814e-03 7.24904282964e-03 - 6.23916674188e-03 5.59978938003e-03 5.28994524639e-03 5.28994524639e-03 5.59978938003e-03 6.23916674188e-03 - 7.24904282964e-03 8.69246386814e-03 1.06524671204e-02 1.32272933414e-02 1.65234811342e-02 2.06439962171e-02 - 2.56657154446e-02 3.16041856284e-02 3.83718132369e-02 4.57409612273e-02 5.33236907840e-02 6.05796981280e-02 - 6.68641206041e-02 7.15201290633e-02 7.40032629540e-02 7.40032629540e-02 7.15201290633e-02 6.68641206041e-02 - 5.94941697642e-02 5.18034033720e-02 4.40291518527e-02 3.66568505349e-02 3.00149219248e-02 2.42781130820e-02 - 1.94921954522e-02 1.56112881223e-02 1.25396406703e-02 1.01663421573e-02 8.38500711079e-03 7.10160482063e-03 - 6.23916674188e-03 5.74257125314e-03 5.58034633768e-03 5.74257125314e-03 6.23916674188e-03 7.10160482063e-03 - 8.38500711079e-03 1.01663421573e-02 1.25396406703e-02 1.56112881223e-02 1.94921954522e-02 2.42781130820e-02 - 3.00149219248e-02 3.66568505349e-02 4.40291518527e-02 5.18034033720e-02 5.94941697642e-02 6.64898780493e-02 - 7.21264918488e-02 7.57970302390e-02 7.70723261920e-02 7.57970302390e-02 7.21264918488e-02 6.64898780493e-02 - 5.77319585491e-02 5.00090134447e-02 4.23378898536e-02 3.51532871168e-02 2.87439673059e-02 2.32562353108e-02 - 1.87162119832e-02 1.50645020089e-02 1.21980827392e-02 1.00055755901e-02 8.38500711079e-03 7.24904282964e-03 - 6.52902358143e-03 6.17967298585e-03 6.17967298585e-03 6.52902358143e-03 7.24904282964e-03 8.38500711079e-03 - 1.00055755901e-02 1.21980827392e-02 1.50645020089e-02 1.87162119832e-02 2.32562353108e-02 2.87439673059e-02 - 3.51532871168e-02 4.23378898536e-02 5.00090134447e-02 5.77319585491e-02 6.49555724266e-02 7.10787520021e-02 - 7.55368812409e-02 7.78881394404e-02 7.78881394404e-02 7.55368812409e-02 7.10787520021e-02 6.49555724266e-02 - 5.53499973529e-02 4.80677366203e-02 4.07924714489e-02 3.39533984936e-02 2.78466298707e-02 2.26267522861e-02 - 1.83246021902e-02 1.48820928374e-02 1.21980827392e-02 1.01663421573e-02 8.69246386814e-03 7.69793885145e-03 - 7.12420828954e-03 6.93665223838e-03 7.12420828954e-03 7.69793885145e-03 8.69246386814e-03 1.01663421573e-02 - 1.21980827392e-02 1.48820928374e-02 1.83246021902e-02 2.26267522861e-02 2.78466298707e-02 3.39533984936e-02 - 4.07924714489e-02 4.80677366203e-02 5.53499973529e-02 6.21334821617e-02 6.79320857310e-02 7.23556493700e-02 - 7.51264696898e-02 7.60705845667e-02 7.51264696898e-02 7.23556493700e-02 6.79320857310e-02 6.21334821617e-02 - 5.26931433274e-02 4.62623331670e-02 3.95849180057e-02 3.31691643222e-02 2.73794467347e-02 2.24136125305e-02 - 1.83246021902e-02 1.50645020089e-02 1.25396406703e-02 1.06524671204e-02 9.31810768724e-03 8.46823559623e-03 - 8.05519399644e-03 8.05519399644e-03 8.46823559623e-03 9.31810768724e-03 1.06524671204e-02 1.25396406703e-02 - 1.50645020089e-02 1.83246021902e-02 2.24136125305e-02 2.73794467347e-02 3.31691643222e-02 3.95849180057e-02 - 4.62623331670e-02 5.26931433274e-02 5.83399236929e-02 6.28259810566e-02 6.60504635380e-02 6.81077724909e-02 - 6.91119067669e-02 6.91119067669e-02 6.81077724909e-02 6.60504635380e-02 6.28259810566e-02 5.83399236929e-02 - 5.03535465114e-02 4.49623774036e-02 3.89160663350e-02 3.28952522339e-02 2.73794467347e-02 2.26267522861e-02 - 1.87162119832e-02 1.56112881223e-02 1.32272933414e-02 1.14766013692e-02 1.02846446979e-02 9.59384043225e-03 - 9.36769905218e-03 9.59384043225e-03 1.02846446979e-02 1.14766013692e-02 1.32272933414e-02 1.56112881223e-02 - 1.87162119832e-02 2.26267522861e-02 2.73794467347e-02 3.28952522339e-02 3.89160663350e-02 4.49623774036e-02 - 5.03535465114e-02 5.43925934286e-02 5.67236888968e-02 5.75824043038e-02 5.76200322747e-02 5.74463352203e-02 - 5.73653289979e-02 5.74463352203e-02 5.76200322747e-02 5.75824043038e-02 5.67236888968e-02 5.43925934286e-02 - 4.89738024005e-02 4.44868574481e-02 3.89160663350e-02 3.31691643222e-02 2.78466298707e-02 2.32562353108e-02 - 1.94921954522e-02 1.65234811342e-02 1.42727054437e-02 1.26620800682e-02 1.16276251073e-02 1.11228159589e-02 - 1.11228159589e-02 1.16276251073e-02 1.26620800682e-02 1.42727054437e-02 1.65234811342e-02 1.94921954522e-02 - 2.32562353108e-02 2.78466298707e-02 3.31691643222e-02 3.89160663350e-02 4.44868574481e-02 4.89738024005e-02 - 5.13869204668e-02 5.12221625406e-02 4.89850720157e-02 4.60013609401e-02 4.35588929466e-02 4.22847991283e-02 - 4.22847991283e-02 4.35588929466e-02 4.60013609401e-02 4.89850720157e-02 5.12221625406e-02 5.13869204668e-02 - 4.89738024005e-02 4.49623774036e-02 3.95849180057e-02 3.39533984936e-02 2.87439673059e-02 2.42781130820e-02 - 2.06439962171e-02 1.78072941675e-02 1.56960478729e-02 1.42425749040e-02 1.33939588194e-02 1.31152359900e-02 - 1.33939588194e-02 1.42425749040e-02 1.56960478729e-02 1.78072941675e-02 2.06439962171e-02 2.42781130820e-02 - 2.87439673059e-02 3.39533984936e-02 3.95849180057e-02 4.49623774036e-02 4.89738024005e-02 5.02620593726e-02 - 4.79609401864e-02 4.26203265537e-02 3.62214481565e-02 3.09103717113e-02 2.77489957459e-02 2.67478820537e-02 - 2.77489957459e-02 3.09103717113e-02 3.62214481565e-02 4.26203265537e-02 4.79609401864e-02 5.02620593726e-02 - 5.03535465114e-02 4.62623331670e-02 4.07924714489e-02 3.51532871168e-02 3.00149219248e-02 2.56657154446e-02 - 2.21666114252e-02 1.94746684497e-02 1.75241772421e-02 1.62588522549e-02 1.56375665721e-02 1.56375665721e-02 - 1.62588522549e-02 1.75241772421e-02 1.94746684497e-02 2.21666114252e-02 2.56657154446e-02 3.00149219248e-02 - 3.51532871168e-02 4.07924714489e-02 4.62623331670e-02 5.03535465114e-02 5.13869204668e-02 4.79609401864e-02 - 4.02808330656e-02 3.07039905741e-02 2.23413746600e-02 1.69819929531e-02 1.46090879135e-02 1.46090879135e-02 - 1.69819929531e-02 2.23413746600e-02 3.07039905741e-02 4.02808330656e-02 4.79609401864e-02 5.13869204668e-02 - 5.26931433274e-02 4.80677366203e-02 4.23378898536e-02 3.66568505349e-02 3.16041856284e-02 2.73972646659e-02 - 2.40594329852e-02 2.15413174517e-02 1.97871783123e-02 1.87538902948e-02 1.84129279741e-02 1.87538902948e-02 - 1.97871783123e-02 2.15413174517e-02 2.40594329852e-02 2.73972646659e-02 3.16041856284e-02 3.66568505349e-02 - 4.23378898536e-02 4.80677366203e-02 5.26931433274e-02 5.43925934286e-02 5.12221625406e-02 4.26203265537e-02 - 3.07039905741e-02 1.93490286376e-02 1.14596764125e-02 7.45857574908e-03 6.32692063078e-03 7.45857574908e-03 - 1.14596764125e-02 1.93490286376e-02 3.07039905741e-02 4.26203265537e-02 5.12221625406e-02 5.43925934286e-02 - 5.53499973529e-02 5.00090134447e-02 4.40291518527e-02 3.83718132369e-02 3.34710625414e-02 2.94586793037e-02 - 2.63252408289e-02 2.40237109616e-02 2.25132701769e-02 2.17657781241e-02 2.17657781241e-02 2.25132701769e-02 - 2.40237109616e-02 2.63252408289e-02 2.94586793037e-02 3.34710625414e-02 3.83718132369e-02 4.40291518527e-02 - 5.00090134447e-02 5.53499973529e-02 5.83399236929e-02 5.67236888968e-02 4.89850720157e-02 3.62214481565e-02 - 2.23413746600e-02 1.14596764125e-02 5.17285277950e-03 2.64004483879e-03 2.64004483879e-03 5.17285277950e-03 - 1.14596764125e-02 2.23413746600e-02 3.62214481565e-02 4.89850720157e-02 5.67236888968e-02 5.83399236929e-02 - 5.77319585491e-02 5.18034033720e-02 4.57409612273e-02 4.02453701311e-02 3.55932306397e-02 3.18414068716e-02 - 2.89647599965e-02 2.69304328597e-02 2.57176061925e-02 2.53146898274e-02 2.57176061925e-02 2.69304328597e-02 - 2.89647599965e-02 3.18414068716e-02 3.55932306397e-02 4.02453701311e-02 4.57409612273e-02 5.18034033720e-02 - 5.77319585491e-02 6.21334821617e-02 6.28259810566e-02 5.75824043038e-02 4.60013609401e-02 3.09103717113e-02 - 1.69819929531e-02 7.45857574908e-03 2.64004483879e-03 1.27020863940e-03 2.64004483879e-03 7.45857574908e-03 - 1.69819929531e-02 3.09103717113e-02 4.60013609401e-02 5.75824043038e-02 6.28259810566e-02 6.21334821617e-02 - 5.94941697642e-02 5.33236907840e-02 4.74313143781e-02 4.22610610741e-02 3.79563421300e-02 3.45282284639e-02 - 3.19590319446e-02 3.02423286704e-02 2.93819034216e-02 2.93819034216e-02 3.02423286704e-02 3.19590319446e-02 - 3.45282284639e-02 3.79563421300e-02 4.22610610741e-02 4.74313143781e-02 5.33236907840e-02 5.94941697642e-02 - 6.49555724266e-02 6.79320857310e-02 6.60504635380e-02 5.76200322747e-02 4.35588929466e-02 2.77489957459e-02 - 1.46090879135e-02 6.32692063078e-03 2.64004483879e-03 2.64004483879e-03 6.32692063078e-03 1.46090879135e-02 - 2.77489957459e-02 4.35588929466e-02 5.76200322747e-02 6.60504635380e-02 6.79320857310e-02 6.49555724266e-02 - 6.05796981280e-02 5.45841783826e-02 4.91148354625e-02 4.44094609233e-02 4.05244812822e-02 3.74634706166e-02 - 3.52402742752e-02 3.38859304601e-02 3.34304675050e-02 3.38859304601e-02 3.52402742752e-02 3.74634706166e-02 - 4.05244812822e-02 4.44094609233e-02 4.91148354625e-02 5.45841783826e-02 6.05796981280e-02 6.64898780493e-02 - 7.10787520021e-02 7.23556493700e-02 6.81077724909e-02 5.74463352203e-02 4.22847991283e-02 2.67478820537e-02 - 1.46090879135e-02 7.45857574908e-03 5.17285277950e-03 7.45857574908e-03 1.46090879135e-02 2.67478820537e-02 - 4.22847991283e-02 5.74463352203e-02 6.81077724909e-02 7.23556493700e-02 7.10787520021e-02 6.64898780493e-02 - 6.11288569567e-02 5.56676247698e-02 5.08044555558e-02 4.66403070569e-02 4.32002938784e-02 4.05199675384e-02 - 3.86662855632e-02 3.77147526395e-02 3.77147526395e-02 3.86662855632e-02 4.05199675384e-02 4.32002938784e-02 - 4.66403070569e-02 5.08044555558e-02 5.56676247698e-02 6.11288569567e-02 6.68641206041e-02 7.21264918488e-02 - 7.55368812409e-02 7.51264696898e-02 6.91119067669e-02 5.73653289979e-02 4.22847991283e-02 2.77489957459e-02 - 1.69819929531e-02 1.14596764125e-02 1.14596764125e-02 1.69819929531e-02 2.77489957459e-02 4.22847991283e-02 - 5.73653289979e-02 6.91119067669e-02 7.51264696898e-02 7.55368812409e-02 7.21264918488e-02 6.68641206041e-02 - 6.13379141192e-02 5.66331890923e-02 5.24477482650e-02 4.88190878681e-02 4.57968161948e-02 4.34838779539e-02 - 4.20165784801e-02 4.15120643887e-02 4.20165784801e-02 4.34838779539e-02 4.57968161948e-02 4.88190878681e-02 - 5.24477482650e-02 5.66331890923e-02 6.13379141192e-02 6.64284767715e-02 7.15201290633e-02 7.57970302390e-02 - 7.78881394404e-02 7.60705845667e-02 6.91119067669e-02 5.74463352203e-02 4.35588929466e-02 3.09103717113e-02 - 2.23413746600e-02 1.93490286376e-02 2.23413746600e-02 3.09103717113e-02 4.35588929466e-02 5.74463352203e-02 - 6.91119067669e-02 7.60705845667e-02 7.78881394404e-02 7.57970302390e-02 7.15201290633e-02 6.64284767715e-02 - 6.13379141192e-02 5.74449785733e-02 5.38883507401e-02 5.07121410456e-02 4.80406383964e-02 4.60731359718e-02 - 4.50208900473e-02 4.50208900473e-02 4.60731359718e-02 4.80406383964e-02 5.07121410456e-02 5.38883507401e-02 - 5.74449785733e-02 6.13379141192e-02 6.55352798807e-02 6.98920688762e-02 7.40032629540e-02 7.70723261920e-02 - 7.78881394404e-02 7.51264696898e-02 6.81077724909e-02 5.76200322747e-02 4.60013609401e-02 3.62214481565e-02 - 3.07039905741e-02 3.07039905741e-02 3.62214481565e-02 4.60013609401e-02 5.76200322747e-02 6.81077724909e-02 - 7.51264696898e-02 7.78881394404e-02 7.70723261920e-02 7.40032629540e-02 6.98920688762e-02 6.55352798807e-02 - 6.11288569567e-02 5.79474348197e-02 5.48714786192e-02 5.20147259753e-02 4.96193341715e-02 4.79989400749e-02 - 4.74231711778e-02 4.79989400749e-02 4.96193341715e-02 5.20147259753e-02 5.48714786192e-02 5.79474348197e-02 - 6.11288569567e-02 6.44054743742e-02 6.77723654588e-02 7.10977313661e-02 7.40032629540e-02 7.57970302390e-02 - 7.55368812409e-02 7.23556493700e-02 6.60504635380e-02 5.75824043038e-02 4.89850720157e-02 4.26203265537e-02 - 4.02808330656e-02 4.26203265537e-02 4.89850720157e-02 5.75824043038e-02 6.60504635380e-02 7.23556493700e-02 - 7.55368812409e-02 7.57970302390e-02 7.40032629540e-02 7.10977313661e-02 6.77723654588e-02 6.44054743742e-02 - 6.05796981280e-02 5.78981879671e-02 5.51031089527e-02 5.24339557043e-02 5.02828320119e-02 4.90700187394e-02 - 4.90700187394e-02 5.02828320119e-02 5.24339557043e-02 5.51031089527e-02 5.78981879671e-02 6.05796981280e-02 - 6.30873277659e-02 6.54719417706e-02 6.77723654588e-02 6.98920688762e-02 7.15201290633e-02 7.21264918488e-02 - 7.10787520021e-02 6.79320857310e-02 6.28259810566e-02 5.67236888968e-02 5.12221625406e-02 4.79609401864e-02 - 4.79609401864e-02 5.12221625406e-02 5.67236888968e-02 6.28259810566e-02 6.79320857310e-02 7.10787520021e-02 - 7.21264918488e-02 7.15201290633e-02 6.98920688762e-02 6.77723654588e-02 6.54719417706e-02 6.30873277659e-02 - 5.94941697642e-02 5.70612480291e-02 5.43692149489e-02 5.18281863755e-02 4.99825941802e-02 4.93048229800e-02 - 4.99825941802e-02 5.18281863755e-02 5.43692149489e-02 5.70612480291e-02 5.94941697642e-02 6.14923433640e-02 - 6.30873277659e-02 6.44054743742e-02 6.55352798807e-02 6.64284767715e-02 6.68641206041e-02 6.64898780493e-02 - 6.49555724266e-02 6.21334821617e-02 5.83399236929e-02 5.43925934286e-02 5.13869204668e-02 5.02620593726e-02 - 5.13869204668e-02 5.43925934286e-02 5.83399236929e-02 6.21334821617e-02 6.49555724266e-02 6.64898780493e-02 - 6.68641206041e-02 6.64284767715e-02 6.55352798807e-02 6.44054743742e-02 6.30873277659e-02 6.14923433640e-02 - 6.21334821617e-02 5.83399236929e-02 5.43925934286e-02 5.13869204668e-02 5.02620593726e-02 5.13869204668e-02 - 5.43925934286e-02 5.83399236929e-02 6.21334821617e-02 6.49555724266e-02 6.64898780493e-02 6.68641206041e-02 - 6.64284767715e-02 6.55352798807e-02 6.44054743742e-02 6.30873277659e-02 6.14923433640e-02 5.94941697642e-02 - 5.70612480291e-02 5.43692149489e-02 5.18281863755e-02 4.99825941802e-02 4.93048229800e-02 4.99825941802e-02 - 5.18281863755e-02 5.43692149489e-02 5.70612480291e-02 5.94941697642e-02 6.14923433640e-02 6.30873277659e-02 - 6.44054743742e-02 6.55352798807e-02 6.64284767715e-02 6.68641206041e-02 6.64898780493e-02 6.49555724266e-02 - 5.83399236929e-02 5.43239294918e-02 5.06194135765e-02 4.83941231678e-02 4.83941231678e-02 5.06194135765e-02 - 5.43239294918e-02 5.83399236929e-02 6.15702941626e-02 6.33842515281e-02 6.37149803432e-02 6.28828729732e-02 - 6.13334872428e-02 5.94462807362e-02 5.74494623672e-02 5.54167137150e-02 5.33236907840e-02 5.11403130173e-02 - 4.89192305177e-02 4.68401774785e-02 4.51877782102e-02 4.42634768270e-02 4.42634768270e-02 4.51877782102e-02 - 4.68401774785e-02 4.89192305177e-02 5.11403130173e-02 5.33236907840e-02 5.54167137150e-02 5.74494623672e-02 - 5.94462807362e-02 6.13334872428e-02 6.28828729732e-02 6.37149803432e-02 6.33842515281e-02 6.15702941626e-02 - 5.43925934286e-02 5.06194135765e-02 4.76689314688e-02 4.65545163206e-02 4.76689314688e-02 5.06194135765e-02 - 5.43925934286e-02 5.77843769256e-02 5.98878714669e-02 6.03694423859e-02 5.94150808572e-02 5.74762428735e-02 - 5.50251512552e-02 5.24194501424e-02 4.98633146719e-02 4.74313143781e-02 4.51323632879e-02 4.29832635915e-02 - 4.10571769449e-02 3.94908104948e-02 3.84534160516e-02 3.80886538087e-02 3.84534160516e-02 3.94908104948e-02 - 4.10571769449e-02 4.29832635915e-02 4.51323632879e-02 4.74313143781e-02 4.98633146719e-02 5.24194501424e-02 - 5.50251512552e-02 5.74762428735e-02 5.94150808572e-02 6.03694423859e-02 5.98878714669e-02 5.77843769256e-02 - 5.13869204668e-02 4.83941231678e-02 4.65545163206e-02 4.65545163206e-02 4.83941231678e-02 5.13869204668e-02 - 5.44475263977e-02 5.65511919643e-02 5.71251588417e-02 5.61547897924e-02 5.40097122002e-02 5.11831265828e-02 - 4.81082332430e-02 4.50819394473e-02 4.22610610741e-02 3.97029159910e-02 3.74259862301e-02 3.54595415232e-02 - 3.38635928392e-02 3.27229087590e-02 3.21243272248e-02 3.21243272248e-02 3.27229087590e-02 3.38635928392e-02 - 3.54595415232e-02 3.74259862301e-02 3.97029159910e-02 4.22610610741e-02 4.50819394473e-02 4.81082332430e-02 - 5.11831265828e-02 5.40097122002e-02 5.61547897924e-02 5.71251588417e-02 5.65511919643e-02 5.44475263977e-02 - 5.02620593726e-02 4.83941231678e-02 4.76689314688e-02 4.83941231678e-02 5.02620593726e-02 5.24797871309e-02 - 5.41129564364e-02 5.44829894560e-02 5.33923081840e-02 5.10737783335e-02 4.79731106469e-02 4.45431970579e-02 - 4.11328816616e-02 3.79563421300e-02 3.51127517762e-02 3.26341221073e-02 3.05340710560e-02 2.88348357920e-02 - 2.75721078901e-02 2.67889182249e-02 2.65227612839e-02 2.67889182249e-02 2.75721078901e-02 2.88348357920e-02 - 3.05340710560e-02 3.26341221073e-02 3.51127517762e-02 3.79563421300e-02 4.11328816616e-02 4.45431970579e-02 - 4.79731106469e-02 5.10737783335e-02 5.33923081840e-02 5.44829894560e-02 5.41129564364e-02 5.24797871309e-02 - 5.13869204668e-02 5.06194135765e-02 5.06194135765e-02 5.13869204668e-02 5.24797871309e-02 5.32152215954e-02 - 5.29846351657e-02 5.15101646150e-02 4.88987422193e-02 4.55081727847e-02 4.17618689283e-02 3.80204685260e-02 - 3.45282284639e-02 3.14127386696e-02 2.87187367840e-02 2.64534808200e-02 2.46187421852e-02 2.32217587400e-02 - 2.22755921268e-02 2.17964249596e-02 2.17964249596e-02 2.22755921268e-02 2.32217587400e-02 2.46187421852e-02 - 2.64534808200e-02 2.87187367840e-02 3.14127386696e-02 3.45282284639e-02 3.80204685260e-02 4.17618689283e-02 - 4.55081727847e-02 4.88987422193e-02 5.15101646150e-02 5.29846351657e-02 5.32152215954e-02 5.24797871309e-02 - 5.43925934286e-02 5.43239294918e-02 5.43925934286e-02 5.44475263977e-02 5.41129564364e-02 5.29846351657e-02 - 5.08390344517e-02 4.77311231410e-02 4.39402098517e-02 3.98358227133e-02 3.57591480990e-02 3.19590319446e-02 - 2.85763383726e-02 2.56635113913e-02 2.32231030162e-02 2.12421582644e-02 1.97084075068e-02 1.86137801375e-02 - 1.79555609317e-02 1.77355963866e-02 1.79555609317e-02 1.86137801375e-02 1.97084075068e-02 2.12421582644e-02 - 2.32231030162e-02 2.56635113913e-02 2.85763383726e-02 3.19590319446e-02 3.57591480990e-02 3.98358227133e-02 - 4.39402098517e-02 4.77311231410e-02 5.08390344517e-02 5.29846351657e-02 5.41129564364e-02 5.44475263977e-02 - 5.83399236929e-02 5.83399236929e-02 5.77843769256e-02 5.65511919643e-02 5.44829894560e-02 5.15101646150e-02 - 4.77311231410e-02 4.34003076052e-02 3.88462459817e-02 3.43811654173e-02 3.02423286704e-02 2.65706573512e-02 - 2.34202555044e-02 2.07887392229e-02 1.86504890434e-02 1.69767793036e-02 1.57423428102e-02 1.49279448733e-02 - 1.45226393383e-02 1.45226393383e-02 1.49279448733e-02 1.57423428102e-02 1.69767793036e-02 1.86504890434e-02 - 2.07887392229e-02 2.34202555044e-02 2.65706573512e-02 3.02423286704e-02 3.43811654173e-02 3.88462459817e-02 - 4.34003076052e-02 4.77311231410e-02 5.15101646150e-02 5.44829894560e-02 5.65511919643e-02 5.77843769256e-02 - 6.21334821617e-02 6.15702941626e-02 5.98878714669e-02 5.71251588417e-02 5.33923081840e-02 4.88987422193e-02 - 4.39402098517e-02 3.88462459817e-02 3.39176800802e-02 2.93819034216e-02 2.53749373622e-02 2.19482820950e-02 - 1.90940368490e-02 1.67754563001e-02 1.49488960464e-02 1.35733603577e-02 1.26143883181e-02 1.20475550421e-02 - 1.18598583649e-02 1.20475550421e-02 1.26143883181e-02 1.35733603577e-02 1.49488960464e-02 1.67754563001e-02 - 1.90940368490e-02 2.19482820950e-02 2.53749373622e-02 2.93819034216e-02 3.39176800802e-02 3.88462459817e-02 - 4.39402098517e-02 4.88987422193e-02 5.33923081840e-02 5.71251588417e-02 5.98878714669e-02 6.15702941626e-02 - 6.49555724266e-02 6.33842515281e-02 6.03694423859e-02 5.61547897924e-02 5.10737783335e-02 4.55081727847e-02 - 3.98358227133e-02 3.43811654173e-02 2.93819034216e-02 2.49776956914e-02 2.12198093897e-02 1.80960146721e-02 - 1.55601992220e-02 1.35553259639e-02 1.20255038743e-02 1.09215936737e-02 1.02054916185e-02 9.85294674885e-03 - 9.85294674885e-03 1.02054916185e-02 1.09215936737e-02 1.20255038743e-02 1.35553259639e-02 1.55601992220e-02 - 1.80960146721e-02 2.12198093897e-02 2.49776956914e-02 2.93819034216e-02 3.43811654173e-02 3.98358227133e-02 - 4.55081727847e-02 5.10737783335e-02 5.61547897924e-02 6.03694423859e-02 6.33842515281e-02 6.49555724266e-02 - 6.64898780493e-02 6.37149803432e-02 5.94150808572e-02 5.40097122002e-02 4.79731106469e-02 4.17618689283e-02 - 3.57591480990e-02 3.02423286704e-02 2.53749373622e-02 2.12198093897e-02 1.77666865554e-02 1.49636867906e-02 - 1.27424344623e-02 1.10330000246e-02 9.77183223433e-03 8.90705726329e-03 8.40200942373e-03 8.23585736203e-03 - 8.40200942373e-03 8.90705726329e-03 9.77183223433e-03 1.10330000246e-02 1.27424344623e-02 1.49636867906e-02 - 1.77666865554e-02 2.12198093897e-02 2.53749373622e-02 3.02423286704e-02 3.57591480990e-02 4.17618689283e-02 - 4.79731106469e-02 5.40097122002e-02 5.94150808572e-02 6.37149803432e-02 6.64898780493e-02 6.74494907981e-02 - 6.68641206041e-02 6.28828729732e-02 5.74762428735e-02 5.11831265828e-02 4.45431970579e-02 3.80204685260e-02 - 3.19590319446e-02 2.65706573512e-02 2.19482820950e-02 1.80960146721e-02 1.49636867906e-02 1.24755048074e-02 - 1.05489279259e-02 9.10613117226e-03 8.08133005705e-03 7.42492384580e-03 7.10459522193e-03 7.10459522193e-03 - 7.42492384580e-03 8.08133005705e-03 9.10613117226e-03 1.05489279259e-02 1.24755048074e-02 1.49636867906e-02 - 1.80960146721e-02 2.19482820950e-02 2.65706573512e-02 3.19590319446e-02 3.80204685260e-02 4.45431970579e-02 - 5.11831265828e-02 5.74762428735e-02 6.28828729732e-02 6.68641206041e-02 6.89793219251e-02 6.89793219251e-02 - 6.64284767715e-02 6.13334872428e-02 5.50251512552e-02 4.81082332430e-02 4.11328816616e-02 3.45282284639e-02 - 2.85763383726e-02 2.34202555044e-02 1.90940368490e-02 1.55601992220e-02 1.27424344623e-02 1.05489279259e-02 - 8.88822832040e-03 7.68014935330e-03 6.86170422323e-03 6.38840491477e-03 6.23361812745e-03 6.38840491477e-03 - 6.86170422323e-03 7.68014935330e-03 8.88822832040e-03 1.05489279259e-02 1.27424344623e-02 1.55601992220e-02 - 1.90940368490e-02 2.34202555044e-02 2.85763383726e-02 3.45282284639e-02 4.11328816616e-02 4.81082332430e-02 - 5.50251512552e-02 6.13334872428e-02 6.64284767715e-02 6.97522426294e-02 7.09081350393e-02 6.97522426294e-02 - 6.55352798807e-02 5.94462807362e-02 5.24194501424e-02 4.50819394473e-02 3.79563421300e-02 3.14127386696e-02 - 2.56635113913e-02 2.07887392229e-02 1.67754563001e-02 1.35553259639e-02 1.10330000246e-02 9.10613117226e-03 - 7.68014935330e-03 6.67761981445e-03 6.04118457084e-03 5.73268604942e-03 5.73268604942e-03 6.04118457084e-03 - 6.67761981445e-03 7.68014935330e-03 9.10613117226e-03 1.10330000246e-02 1.35553259639e-02 1.67754563001e-02 - 2.07887392229e-02 2.56635113913e-02 3.14127386696e-02 3.79563421300e-02 4.50819394473e-02 5.24194501424e-02 - 5.94462807362e-02 6.55352798807e-02 7.00474085615e-02 7.24538631804e-02 7.24538631804e-02 7.00474085615e-02 - 6.44054743742e-02 5.74494623672e-02 4.98633146719e-02 4.22610610741e-02 3.51127517762e-02 2.87187367840e-02 - 2.32231030162e-02 1.86504890434e-02 1.49488960464e-02 1.20255038743e-02 9.77183223433e-03 8.08133005705e-03 - 6.86170422323e-03 6.04118457084e-03 5.56920678348e-03 5.41531278039e-03 5.56920678348e-03 6.04118457084e-03 - 6.86170422323e-03 8.08133005705e-03 9.77183223433e-03 1.20255038743e-02 1.49488960464e-02 1.86504890434e-02 - 2.32231030162e-02 2.87187367840e-02 3.51127517762e-02 4.22610610741e-02 4.98633146719e-02 5.74494623672e-02 - 6.44054743742e-02 7.00474085615e-02 7.37387049341e-02 7.50243106749e-02 7.37387049341e-02 7.00474085615e-02 - 6.30873277659e-02 5.54167137150e-02 4.74313143781e-02 3.97029159910e-02 3.26341221073e-02 2.64534808200e-02 - 2.12421582644e-02 1.69767793036e-02 1.35733603577e-02 1.09215936737e-02 8.90705726329e-03 7.42492384580e-03 - 6.38840491477e-03 5.73268604942e-03 5.41531278039e-03 5.41531278039e-03 5.73268604942e-03 6.38840491477e-03 - 7.42492384580e-03 8.90705726329e-03 1.09215936737e-02 1.35733603577e-02 1.69767793036e-02 2.12421582644e-02 - 2.64534808200e-02 3.26341221073e-02 3.97029159910e-02 4.74313143781e-02 5.54167137150e-02 6.30873277659e-02 - 6.97522426294e-02 7.47020608958e-02 7.73458021392e-02 7.73458021392e-02 7.47020608958e-02 6.97522426294e-02 - 6.14923433640e-02 5.33236907840e-02 4.51323632879e-02 3.74259862301e-02 3.05340710560e-02 2.46187421852e-02 - 1.97084075068e-02 1.57423428102e-02 1.26143883181e-02 1.02054916185e-02 8.40200942373e-03 7.10459522193e-03 - 6.23361812745e-03 5.73268604942e-03 5.56920678348e-03 5.73268604942e-03 6.23361812745e-03 7.10459522193e-03 - 8.40200942373e-03 1.02054916185e-02 1.26143883181e-02 1.57423428102e-02 1.97084075068e-02 2.46187421852e-02 - 3.05340710560e-02 3.74259862301e-02 4.51323632879e-02 5.33236907840e-02 6.14923433640e-02 6.89793219251e-02 - 7.50510418428e-02 7.90236437036e-02 8.04073084192e-02 7.90236437036e-02 7.50510418428e-02 6.89793219251e-02 - 5.94941697642e-02 5.11403130173e-02 4.29832635915e-02 3.54595415232e-02 2.88348357920e-02 2.32217587400e-02 - 1.86137801375e-02 1.49279448733e-02 1.20475550421e-02 9.85294674885e-03 8.23585736203e-03 7.10459522193e-03 - 6.38840491477e-03 6.04118457084e-03 6.04118457084e-03 6.38840491477e-03 7.10459522193e-03 8.23585736203e-03 - 9.85294674885e-03 1.20475550421e-02 1.49279448733e-02 1.86137801375e-02 2.32217587400e-02 2.88348357920e-02 - 3.54595415232e-02 4.29832635915e-02 5.11403130173e-02 5.94941697642e-02 6.74494907981e-02 7.43082663472e-02 - 7.93709590427e-02 8.20645507484e-02 8.20645507484e-02 7.93709590427e-02 7.43082663472e-02 6.74494907981e-02 - 5.70612480291e-02 4.89192305177e-02 4.10571769449e-02 3.38635928392e-02 2.75721078901e-02 2.22755921268e-02 - 1.79555609317e-02 1.45226393383e-02 1.18598583649e-02 9.85294674885e-03 8.40200942373e-03 7.42492384580e-03 - 6.86170422323e-03 6.67761981445e-03 6.86170422323e-03 7.42492384580e-03 8.40200942373e-03 9.85294674885e-03 - 1.18598583649e-02 1.45226393383e-02 1.79555609317e-02 2.22755921268e-02 2.75721078901e-02 3.38635928392e-02 - 4.10571769449e-02 4.89192305177e-02 5.70612480291e-02 6.49555724266e-02 7.19923628057e-02 7.75631573239e-02 - 8.11458755837e-02 8.23828782457e-02 8.11458755837e-02 7.75631573239e-02 7.19923628057e-02 6.49555724266e-02 - 5.43692149489e-02 4.68401774785e-02 3.94908104948e-02 3.27229087590e-02 2.67889182249e-02 2.17964249596e-02 - 1.77355963866e-02 1.45226393383e-02 1.20475550421e-02 1.02054916185e-02 8.90705726329e-03 8.08133005705e-03 - 7.68014935330e-03 7.68014935330e-03 8.08133005705e-03 8.90705726329e-03 1.02054916185e-02 1.20475550421e-02 - 1.45226393383e-02 1.77355963866e-02 2.17964249596e-02 2.67889182249e-02 3.27229087590e-02 3.94908104948e-02 - 4.68401774785e-02 5.43692149489e-02 6.15702941626e-02 6.79320857310e-02 7.30418134594e-02 7.66122811094e-02 - 7.84511058955e-02 7.84511058955e-02 7.66122811094e-02 7.30418134594e-02 6.79320857310e-02 6.15702941626e-02 - 5.18281863755e-02 4.51877782102e-02 3.84534160516e-02 3.21243272248e-02 2.65227612839e-02 2.17964249596e-02 - 1.79555609317e-02 1.49279448733e-02 1.26143883181e-02 1.09215936737e-02 9.77183223433e-03 9.10613117226e-03 - 8.88822832040e-03 9.10613117226e-03 9.77183223433e-03 1.09215936737e-02 1.26143883181e-02 1.49279448733e-02 - 1.79555609317e-02 2.17964249596e-02 2.65227612839e-02 3.21243272248e-02 3.84534160516e-02 4.51877782102e-02 - 5.18281863755e-02 5.77843769256e-02 6.25800698666e-02 6.60504635380e-02 6.83266751007e-02 6.96179820017e-02 - 7.00400365127e-02 6.96179820017e-02 6.83266751007e-02 6.60504635380e-02 6.25800698666e-02 5.77843769256e-02 - 4.99825941802e-02 4.42634768270e-02 3.80886538087e-02 3.21243272248e-02 2.67889182249e-02 2.22755921268e-02 - 1.86137801375e-02 1.57423428102e-02 1.35733603577e-02 1.20255038743e-02 1.10330000246e-02 1.05489279259e-02 - 1.05489279259e-02 1.10330000246e-02 1.20255038743e-02 1.35733603577e-02 1.57423428102e-02 1.86137801375e-02 - 2.22755921268e-02 2.67889182249e-02 3.21243272248e-02 3.80886538087e-02 4.42634768270e-02 4.99825941802e-02 - 5.44475263977e-02 5.70772559013e-02 5.79103146750e-02 5.76200322747e-02 5.70355201353e-02 5.66663226477e-02 - 5.66663226477e-02 5.70355201353e-02 5.76200322747e-02 5.79103146750e-02 5.70772559013e-02 5.44475263977e-02 - 4.93048229800e-02 4.42634768270e-02 3.84534160516e-02 3.27229087590e-02 2.75721078901e-02 2.32217587400e-02 - 1.97084075068e-02 1.69767793036e-02 1.49488960464e-02 1.35553259639e-02 1.27424344623e-02 1.24755048074e-02 - 1.27424344623e-02 1.35553259639e-02 1.49488960464e-02 1.69767793036e-02 1.97084075068e-02 2.32217587400e-02 - 2.75721078901e-02 3.27229087590e-02 3.84534160516e-02 4.42634768270e-02 4.93048229800e-02 5.24797871309e-02 - 5.29210396854e-02 5.07010770424e-02 4.70389926376e-02 4.35588929466e-02 4.13123485649e-02 4.05694134160e-02 - 4.13123485649e-02 4.35588929466e-02 4.70389926376e-02 5.07010770424e-02 5.29210396854e-02 5.24797871309e-02 - 4.99825941802e-02 4.51877782102e-02 3.94908104948e-02 3.38635928392e-02 2.88348357920e-02 2.46187421852e-02 - 2.12421582644e-02 1.86504890434e-02 1.67754563001e-02 1.55601992220e-02 1.49636867906e-02 1.49636867906e-02 - 1.55601992220e-02 1.67754563001e-02 1.86504890434e-02 2.12421582644e-02 2.46187421852e-02 2.88348357920e-02 - 3.38635928392e-02 3.94908104948e-02 4.51877782102e-02 4.99825941802e-02 5.24797871309e-02 5.13723037105e-02 - 4.64751950426e-02 3.93541671489e-02 3.25101129901e-02 2.77489957459e-02 2.54935088837e-02 2.54935088837e-02 - 2.77489957459e-02 3.25101129901e-02 3.93541671489e-02 4.64751950426e-02 5.13723037105e-02 5.24797871309e-02 - 5.18281863755e-02 4.68401774785e-02 4.10571769449e-02 3.54595415232e-02 3.05340710560e-02 2.64534808200e-02 - 2.32231030162e-02 2.07887392229e-02 1.90940368490e-02 1.80960146721e-02 1.77666865554e-02 1.80960146721e-02 - 1.90940368490e-02 2.07887392229e-02 2.32231030162e-02 2.64534808200e-02 3.05340710560e-02 3.54595415232e-02 - 4.10571769449e-02 4.68401774785e-02 5.18281863755e-02 5.44475263977e-02 5.29210396854e-02 4.64751950426e-02 - 3.65582592974e-02 2.63856510811e-02 1.87771308641e-02 1.46090879135e-02 1.33581335706e-02 1.46090879135e-02 - 1.87771308641e-02 2.63856510811e-02 3.65582592974e-02 4.64751950426e-02 5.29210396854e-02 5.44475263977e-02 - 5.43692149489e-02 4.89192305177e-02 4.29832635915e-02 3.74259862301e-02 3.26341221073e-02 2.87187367840e-02 - 2.56635113913e-02 2.34202555044e-02 2.19482820950e-02 2.12198093897e-02 2.12198093897e-02 2.19482820950e-02 - 2.34202555044e-02 2.56635113913e-02 2.87187367840e-02 3.26341221073e-02 3.74259862301e-02 4.29832635915e-02 - 4.89192305177e-02 5.43692149489e-02 5.77843769256e-02 5.70772559013e-02 5.07010770424e-02 3.93541671489e-02 - 2.63856510811e-02 1.56860392578e-02 9.13060134292e-03 6.32692063078e-03 6.32692063078e-03 9.13060134292e-03 - 1.56860392578e-02 2.63856510811e-02 3.93541671489e-02 5.07010770424e-02 5.70772559013e-02 5.77843769256e-02 - 5.70612480291e-02 5.11403130173e-02 4.51323632879e-02 3.97029159910e-02 3.51127517762e-02 3.14127386696e-02 - 2.85763383726e-02 2.65706573512e-02 2.53749373622e-02 2.49776956914e-02 2.53749373622e-02 2.65706573512e-02 - 2.85763383726e-02 3.14127386696e-02 3.51127517762e-02 3.97029159910e-02 4.51323632879e-02 5.11403130173e-02 - 5.70612480291e-02 6.15702941626e-02 6.25800698666e-02 5.79103146750e-02 4.70389926376e-02 3.25101129901e-02 - 1.87771308641e-02 9.13060134292e-03 4.10298626852e-03 2.64004483879e-03 4.10298626852e-03 9.13060134292e-03 - 1.87771308641e-02 3.25101129901e-02 4.70389926376e-02 5.79103146750e-02 6.25800698666e-02 6.15702941626e-02 - 5.94941697642e-02 5.33236907840e-02 4.74313143781e-02 4.22610610741e-02 3.79563421300e-02 3.45282284639e-02 - 3.19590319446e-02 3.02423286704e-02 2.93819034216e-02 2.93819034216e-02 3.02423286704e-02 3.19590319446e-02 - 3.45282284639e-02 3.79563421300e-02 4.22610610741e-02 4.74313143781e-02 5.33236907840e-02 5.94941697642e-02 - 6.49555724266e-02 6.79320857310e-02 6.60504635380e-02 5.76200322747e-02 4.35588929466e-02 2.77489957459e-02 - 1.46090879135e-02 6.32692063078e-03 2.64004483879e-03 2.64004483879e-03 6.32692063078e-03 1.46090879135e-02 - 2.77489957459e-02 4.35588929466e-02 5.76200322747e-02 6.60504635380e-02 6.79320857310e-02 6.49555724266e-02 - 6.14923433640e-02 5.54167137150e-02 4.98633146719e-02 4.50819394473e-02 4.11328816616e-02 3.80204685260e-02 - 3.57591480990e-02 3.43811654173e-02 3.39176800802e-02 3.43811654173e-02 3.57591480990e-02 3.80204685260e-02 - 4.11328816616e-02 4.50819394473e-02 4.98633146719e-02 5.54167137150e-02 6.14923433640e-02 6.74494907981e-02 - 7.19923628057e-02 7.30418134594e-02 6.83266751007e-02 5.70355201353e-02 4.13123485649e-02 2.54935088837e-02 - 1.33581335706e-02 6.32692063078e-03 4.10298626852e-03 6.32692063078e-03 1.33581335706e-02 2.54935088837e-02 - 4.13123485649e-02 5.70355201353e-02 6.83266751007e-02 7.30418134594e-02 7.19923628057e-02 6.74494907981e-02 - 6.30873277659e-02 5.74494623672e-02 5.24194501424e-02 4.81082332430e-02 4.45431970579e-02 4.17618689283e-02 - 3.98358227133e-02 3.88462459817e-02 3.88462459817e-02 3.98358227133e-02 4.17618689283e-02 4.45431970579e-02 - 4.81082332430e-02 5.24194501424e-02 5.74494623672e-02 6.30873277659e-02 6.89793219251e-02 7.43082663472e-02 - 7.75631573239e-02 7.66122811094e-02 6.96179820017e-02 5.66663226477e-02 4.05694134160e-02 2.54935088837e-02 - 1.46090879135e-02 9.13060134292e-03 9.13060134292e-03 1.46090879135e-02 2.54935088837e-02 4.05694134160e-02 - 5.66663226477e-02 6.96179820017e-02 7.66122811094e-02 7.75631573239e-02 7.43082663472e-02 6.89793219251e-02 - 6.44054743742e-02 5.94462807362e-02 5.50251512552e-02 5.11831265828e-02 4.79731106469e-02 4.55081727847e-02 - 4.39402098517e-02 4.34003076052e-02 4.39402098517e-02 4.55081727847e-02 4.79731106469e-02 5.11831265828e-02 - 5.50251512552e-02 5.94462807362e-02 6.44054743742e-02 6.97522426294e-02 7.50510418428e-02 7.93709590427e-02 - 8.11458755837e-02 7.84511058955e-02 7.00400365127e-02 5.66663226477e-02 4.13123485649e-02 2.77489957459e-02 - 1.87771308641e-02 1.56860392578e-02 1.87771308641e-02 2.77489957459e-02 4.13123485649e-02 5.66663226477e-02 - 7.00400365127e-02 7.84511058955e-02 8.11458755837e-02 7.93709590427e-02 7.50510418428e-02 6.97522426294e-02 - 6.55352798807e-02 6.13334872428e-02 5.74762428735e-02 5.40097122002e-02 5.10737783335e-02 4.88987422193e-02 - 4.77311231410e-02 4.77311231410e-02 4.88987422193e-02 5.10737783335e-02 5.40097122002e-02 5.74762428735e-02 - 6.13334872428e-02 6.55352798807e-02 7.00474085615e-02 7.47020608958e-02 7.90236437036e-02 8.20645507484e-02 - 8.23828782457e-02 7.84511058955e-02 6.96179820017e-02 5.70355201353e-02 4.35588929466e-02 3.25101129901e-02 - 2.63856510811e-02 2.63856510811e-02 3.25101129901e-02 4.35588929466e-02 5.70355201353e-02 6.96179820017e-02 - 7.84511058955e-02 8.23828782457e-02 8.20645507484e-02 7.90236437036e-02 7.47020608958e-02 7.00474085615e-02 - 6.64284767715e-02 6.28828729732e-02 5.94150808572e-02 5.61547897924e-02 5.33923081840e-02 5.15101646150e-02 - 5.08390344517e-02 5.15101646150e-02 5.33923081840e-02 5.61547897924e-02 5.94150808572e-02 6.28828729732e-02 - 6.64284767715e-02 7.00474085615e-02 7.37387049341e-02 7.73458021392e-02 8.04073084192e-02 8.20645507484e-02 - 8.11458755837e-02 7.66122811094e-02 6.83266751007e-02 5.76200322747e-02 4.70389926376e-02 3.93541671489e-02 - 3.65582592974e-02 3.93541671489e-02 4.70389926376e-02 5.76200322747e-02 6.83266751007e-02 7.66122811094e-02 - 8.11458755837e-02 8.20645507484e-02 8.04073084192e-02 7.73458021392e-02 7.37387049341e-02 7.00474085615e-02 - 6.68641206041e-02 6.37149803432e-02 6.03694423859e-02 5.71251588417e-02 5.44829894560e-02 5.29846351657e-02 - 5.29846351657e-02 5.44829894560e-02 5.71251588417e-02 6.03694423859e-02 6.37149803432e-02 6.68641206041e-02 - 6.97522426294e-02 7.24538631804e-02 7.50243106749e-02 7.73458021392e-02 7.90236437036e-02 7.93709590427e-02 - 7.75631573239e-02 7.30418134594e-02 6.60504635380e-02 5.79103146750e-02 5.07010770424e-02 4.64751950426e-02 - 4.64751950426e-02 5.07010770424e-02 5.79103146750e-02 6.60504635380e-02 7.30418134594e-02 7.75631573239e-02 - 7.93709590427e-02 7.90236437036e-02 7.73458021392e-02 7.50243106749e-02 7.24538631804e-02 6.97522426294e-02 - 6.64898780493e-02 6.33842515281e-02 5.98878714669e-02 5.65511919643e-02 5.41129564364e-02 5.32152215954e-02 - 5.41129564364e-02 5.65511919643e-02 5.98878714669e-02 6.33842515281e-02 6.64898780493e-02 6.89793219251e-02 - 7.09081350393e-02 7.24538631804e-02 7.37387049341e-02 7.47020608958e-02 7.50510418428e-02 7.43082663472e-02 - 7.19923628057e-02 6.79320857310e-02 6.25800698666e-02 5.70772559013e-02 5.29210396854e-02 5.13723037105e-02 - 5.29210396854e-02 5.70772559013e-02 6.25800698666e-02 6.79320857310e-02 7.19923628057e-02 7.43082663472e-02 - 7.50510418428e-02 7.47020608958e-02 7.37387049341e-02 7.24538631804e-02 7.09081350393e-02 6.89793219251e-02 - 6.49555724266e-02 6.15702941626e-02 5.77843769256e-02 5.44475263977e-02 5.24797871309e-02 5.24797871309e-02 - 5.44475263977e-02 5.77843769256e-02 6.15702941626e-02 6.49555724266e-02 6.74494907981e-02 6.89793219251e-02 - 6.97522426294e-02 7.00474085615e-02 7.00474085615e-02 6.97522426294e-02 6.89793219251e-02 6.74494907981e-02 - 6.49555724266e-02 6.15702941626e-02 5.77843769256e-02 5.44475263977e-02 5.24797871309e-02 5.24797871309e-02 - 5.44475263977e-02 5.77843769256e-02 6.15702941626e-02 6.49555724266e-02 6.74494907981e-02 6.89793219251e-02 - 6.97522426294e-02 7.00474085615e-02 7.00474085615e-02 6.97522426294e-02 6.89793219251e-02 6.74494907981e-02 - 6.28259810566e-02 5.67236888968e-02 5.12221625406e-02 4.79609401864e-02 4.79609401864e-02 5.12221625406e-02 - 5.67236888968e-02 6.28259810566e-02 6.79320857310e-02 7.10787520021e-02 7.21264918488e-02 7.15201290633e-02 - 6.98920688762e-02 6.77723654588e-02 6.54719417706e-02 6.30873277659e-02 6.05796981280e-02 5.78981879671e-02 - 5.51031089527e-02 5.24339557043e-02 5.02828320119e-02 4.90700187394e-02 4.90700187394e-02 5.02828320119e-02 - 5.24339557043e-02 5.51031089527e-02 5.78981879671e-02 6.05796981280e-02 6.30873277659e-02 6.54719417706e-02 - 6.77723654588e-02 6.98920688762e-02 7.15201290633e-02 7.21264918488e-02 7.10787520021e-02 6.79320857310e-02 - 5.67236888968e-02 5.05555186569e-02 4.58777097769e-02 4.41366450522e-02 4.58777097769e-02 5.05555186569e-02 - 5.67236888968e-02 6.25800698666e-02 6.66786802062e-02 6.84139609392e-02 6.80033074139e-02 6.61022866145e-02 - 6.34040688222e-02 6.04237632524e-02 5.74494623672e-02 5.45841783826e-02 5.18355302331e-02 4.92182336225e-02 - 4.68264624901e-02 4.48486167771e-02 4.35234290368e-02 4.30547772101e-02 4.35234290368e-02 4.48486167771e-02 - 4.68264624901e-02 4.92182336225e-02 5.18355302331e-02 5.45841783826e-02 5.74494623672e-02 6.04237632524e-02 - 6.34040688222e-02 6.61022866145e-02 6.80033074139e-02 6.84139609392e-02 6.66786802062e-02 6.25800698666e-02 - 5.12221625406e-02 4.58777097769e-02 4.27064575993e-02 4.27064575993e-02 4.58777097769e-02 5.12221625406e-02 - 5.70772559013e-02 6.17513938278e-02 6.41840706496e-02 6.42180018992e-02 6.23688231248e-02 5.93841418824e-02 - 5.59201471811e-02 5.24194501424e-02 4.91148354625e-02 4.60913389830e-02 4.33721592307e-02 4.09927131873e-02 - 3.90347179512e-02 3.76190713504e-02 3.68707660171e-02 3.68707660171e-02 3.76190713504e-02 3.90347179512e-02 - 4.09927131873e-02 4.33721592307e-02 4.60913389830e-02 4.91148354625e-02 5.24194501424e-02 5.59201471811e-02 - 5.93841418824e-02 6.23688231248e-02 6.42180018992e-02 6.41840706496e-02 6.17513938278e-02 5.70772559013e-02 - 4.79609401864e-02 4.41366450522e-02 4.27064575993e-02 4.41366450522e-02 4.79609401864e-02 5.29210396854e-02 - 5.74105494947e-02 6.01184381094e-02 6.05090723285e-02 5.88318176265e-02 5.57595749637e-02 5.20033431247e-02 - 4.81082332430e-02 4.44094609233e-02 4.10670403681e-02 3.81345549630e-02 3.56312088557e-02 3.35871770820e-02 - 3.20546920774e-02 3.10978190541e-02 3.07715106065e-02 3.10978190541e-02 3.20546920774e-02 3.35871770820e-02 - 3.56312088557e-02 3.81345549630e-02 4.10670403681e-02 4.44094609233e-02 4.81082332430e-02 5.20033431247e-02 - 5.57595749637e-02 5.88318176265e-02 6.05090723285e-02 6.01184381094e-02 5.74105494947e-02 5.29210396854e-02 - 4.79609401864e-02 4.58777097769e-02 4.58777097769e-02 4.79609401864e-02 5.13723037105e-02 5.48533676650e-02 - 5.71366804742e-02 5.74676014035e-02 5.58153453540e-02 5.26787408684e-02 4.87273692032e-02 4.45431970579e-02 - 4.05244812822e-02 3.68889471691e-02 3.37228748044e-02 3.10465495213e-02 2.88661050079e-02 2.71955666447e-02 - 2.60582031450e-02 2.54803066383e-02 2.54803066383e-02 2.60582031450e-02 2.71955666447e-02 2.88661050079e-02 - 3.10465495213e-02 3.37228748044e-02 3.68889471691e-02 4.05244812822e-02 4.45431970579e-02 4.87273692032e-02 - 5.26787408684e-02 5.58153453540e-02 5.74676014035e-02 5.71366804742e-02 5.48533676650e-02 5.13723037105e-02 - 5.12221625406e-02 5.05555186569e-02 5.12221625406e-02 5.29210396854e-02 5.48533676650e-02 5.60372557288e-02 - 5.57363453523e-02 5.37510492057e-02 5.03893328752e-02 4.62088704848e-02 4.17618689283e-02 3.74634706166e-02 - 3.35632692529e-02 3.01717861136e-02 2.73140021666e-02 2.49827563157e-02 2.31688478126e-02 2.18687619531e-02 - 2.10847229658e-02 2.08223402545e-02 2.10847229658e-02 2.18687619531e-02 2.31688478126e-02 2.49827563157e-02 - 2.73140021666e-02 3.01717861136e-02 3.35632692529e-02 3.74634706166e-02 4.17618689283e-02 4.62088704848e-02 - 5.03893328752e-02 5.37510492057e-02 5.57363453523e-02 5.60372557288e-02 5.48533676650e-02 5.29210396854e-02 - 5.67236888968e-02 5.67236888968e-02 5.70772559013e-02 5.74105494947e-02 5.71366804742e-02 5.57363453523e-02 - 5.30133769166e-02 4.91578982971e-02 4.46053414397e-02 3.98358227133e-02 3.52402742752e-02 3.10717223250e-02 - 2.74512061786e-02 2.44059448105e-02 2.19185274002e-02 1.99620901041e-02 1.85132658939e-02 1.75547637226e-02 - 1.70770073925e-02 1.70770073925e-02 1.75547637226e-02 1.85132658939e-02 1.99620901041e-02 2.19185274002e-02 - 2.44059448105e-02 2.74512061786e-02 3.10717223250e-02 3.52402742752e-02 3.98358227133e-02 4.46053414397e-02 - 4.91578982971e-02 5.30133769166e-02 5.57363453523e-02 5.71366804742e-02 5.74105494947e-02 5.70772559013e-02 - 6.28259810566e-02 6.25800698666e-02 6.17513938278e-02 6.01184381094e-02 5.74676014035e-02 5.37510492057e-02 - 4.91578982971e-02 4.40529168852e-02 3.88462459817e-02 3.38859304601e-02 2.94074293899e-02 2.55281844546e-02 - 2.22726314479e-02 1.96135589165e-02 1.75083321070e-02 1.59162612755e-02 1.48031251671e-02 1.41440793855e-02 - 1.39256808178e-02 1.41440793855e-02 1.48031251671e-02 1.59162612755e-02 1.75083321070e-02 1.96135589165e-02 - 2.22726314479e-02 2.55281844546e-02 2.94074293899e-02 3.38859304601e-02 3.88462459817e-02 4.40529168852e-02 - 4.91578982971e-02 5.37510492057e-02 5.74676014035e-02 6.01184381094e-02 6.17513938278e-02 6.25800698666e-02 - 6.79320857310e-02 6.66786802062e-02 6.41840706496e-02 6.05090723285e-02 5.58153453540e-02 5.03893328752e-02 - 4.46053414397e-02 3.88462459817e-02 3.34304675050e-02 2.85734174953e-02 2.43819637041e-02 2.08735527936e-02 - 1.80109897723e-02 1.57370100687e-02 1.39945083398e-02 1.27333396536e-02 1.19137265332e-02 1.15097880648e-02 - 1.15097880648e-02 1.19137265332e-02 1.27333396536e-02 1.39945083398e-02 1.57370100687e-02 1.80109897723e-02 - 2.08735527936e-02 2.43819637041e-02 2.85734174953e-02 3.34304675050e-02 3.88462459817e-02 4.46053414397e-02 - 5.03893328752e-02 5.58153453540e-02 6.05090723285e-02 6.41840706496e-02 6.66786802062e-02 6.79320857310e-02 - 7.10787520021e-02 6.84139609392e-02 6.42180018992e-02 5.88318176265e-02 5.26787408684e-02 4.62088704848e-02 - 3.98358227133e-02 3.38859304601e-02 2.85734174953e-02 2.40011711299e-02 2.01812628043e-02 1.70678712692e-02 - 1.45906790875e-02 1.26769712537e-02 1.12609832188e-02 1.02881382638e-02 9.71912104775e-03 9.53173661310e-03 - 9.71912104775e-03 1.02881382638e-02 1.12609832188e-02 1.26769712537e-02 1.45906790875e-02 1.70678712692e-02 - 2.01812628043e-02 2.40011711299e-02 2.85734174953e-02 3.38859304601e-02 3.98358227133e-02 4.62088704848e-02 - 5.26787408684e-02 5.88318176265e-02 6.42180018992e-02 6.84139609392e-02 7.10787520021e-02 7.19923628057e-02 - 7.21264918488e-02 6.80033074139e-02 6.23688231248e-02 5.57595749637e-02 4.87273692032e-02 4.17618689283e-02 - 3.52402742752e-02 2.94074293899e-02 2.43819637041e-02 2.01812628043e-02 1.67567114426e-02 1.40283418589e-02 - 1.19093466628e-02 1.03186231402e-02 9.18679124184e-03 8.46060891145e-03 8.10563303358e-03 8.10563303358e-03 - 8.46060891145e-03 9.18679124184e-03 1.03186231402e-02 1.19093466628e-02 1.40283418589e-02 1.67567114426e-02 - 2.01812628043e-02 2.43819637041e-02 2.94074293899e-02 3.52402742752e-02 4.17618689283e-02 4.87273692032e-02 - 5.57595749637e-02 6.23688231248e-02 6.80033074139e-02 7.21264918488e-02 7.43082663472e-02 7.43082663472e-02 - 7.15201290633e-02 6.61022866145e-02 5.93841418824e-02 5.20033431247e-02 4.45431970579e-02 3.74634706166e-02 - 3.10717223250e-02 2.55281844546e-02 2.08735527936e-02 1.70678712692e-02 1.40283418589e-02 1.16573532374e-02 - 9.85925299562e-03 8.54973346172e-03 7.66146344666e-03 7.14689010595e-03 6.97836085285e-03 7.14689010595e-03 - 7.66146344666e-03 8.54973346172e-03 9.85925299562e-03 1.16573532374e-02 1.40283418589e-02 1.70678712692e-02 - 2.08735527936e-02 2.55281844546e-02 3.10717223250e-02 3.74634706166e-02 4.45431970579e-02 5.20033431247e-02 - 5.93841418824e-02 6.61022866145e-02 7.15201290633e-02 7.50510418428e-02 7.62783857555e-02 7.50510418428e-02 - 6.98920688762e-02 6.34040688222e-02 5.59201471811e-02 4.81082332430e-02 4.05244812822e-02 3.35632692529e-02 - 2.74512061786e-02 2.22726314479e-02 1.80109897723e-02 1.45906790875e-02 1.19093466628e-02 9.85925299562e-03 - 8.34122341388e-03 7.27338017313e-03 6.59479473082e-03 6.26545793635e-03 6.26545793635e-03 6.59479473082e-03 - 7.27338017313e-03 8.34122341388e-03 9.85925299562e-03 1.19093466628e-02 1.45906790875e-02 1.80109897723e-02 - 2.22726314479e-02 2.74512061786e-02 3.35632692529e-02 4.05244812822e-02 4.81082332430e-02 5.59201471811e-02 - 6.34040688222e-02 6.98920688762e-02 7.47020608958e-02 7.72682499914e-02 7.72682499914e-02 7.47020608958e-02 - 6.77723654588e-02 6.04237632524e-02 5.24194501424e-02 4.44094609233e-02 3.68889471691e-02 3.01717861136e-02 - 2.44059448105e-02 1.96135589165e-02 1.57370100687e-02 1.26769712537e-02 1.03186231402e-02 8.54973346172e-03 - 7.27338017313e-03 6.41444748147e-03 5.92021996667e-03 5.75903981319e-03 5.92021996667e-03 6.41444748147e-03 - 7.27338017313e-03 8.54973346172e-03 1.03186231402e-02 1.26769712537e-02 1.57370100687e-02 1.96135589165e-02 - 2.44059448105e-02 3.01717861136e-02 3.68889471691e-02 4.44094609233e-02 5.24194501424e-02 6.04237632524e-02 - 6.77723654588e-02 7.37387049341e-02 7.76449689484e-02 7.90059272690e-02 7.76449689484e-02 7.37387049341e-02 - 6.54719417706e-02 5.74494623672e-02 4.91148354625e-02 4.10670403681e-02 3.37228748044e-02 2.73140021666e-02 - 2.19185274002e-02 1.75083321070e-02 1.39945083398e-02 1.12609832188e-02 9.18679124184e-03 7.66146344666e-03 - 6.59479473082e-03 5.92021996667e-03 5.59394004869e-03 5.59394004869e-03 5.92021996667e-03 6.59479473082e-03 - 7.66146344666e-03 9.18679124184e-03 1.12609832188e-02 1.39945083398e-02 1.75083321070e-02 2.19185274002e-02 - 2.73140021666e-02 3.37228748044e-02 4.10670403681e-02 4.91148354625e-02 5.74494623672e-02 6.54719417706e-02 - 7.24538631804e-02 7.76449689484e-02 8.04193974336e-02 8.04193974336e-02 7.76449689484e-02 7.24538631804e-02 - 6.30873277659e-02 5.45841783826e-02 4.60913389830e-02 3.81345549630e-02 3.10465495213e-02 2.49827563157e-02 - 1.99620901041e-02 1.59162612755e-02 1.27333396536e-02 1.02881382638e-02 8.46060891145e-03 7.14689010595e-03 - 6.26545793635e-03 5.75903981319e-03 5.59394004869e-03 5.75903981319e-03 6.26545793635e-03 7.14689010595e-03 - 8.46060891145e-03 1.02881382638e-02 1.27333396536e-02 1.59162612755e-02 1.99620901041e-02 2.49827563157e-02 - 3.10465495213e-02 3.81345549630e-02 4.60913389830e-02 5.45841783826e-02 6.30873277659e-02 7.09081350393e-02 - 7.72682499914e-02 8.14375530661e-02 8.28911486673e-02 8.14375530661e-02 7.72682499914e-02 7.09081350393e-02 - 6.05796981280e-02 5.18355302331e-02 4.33721592307e-02 3.56312088557e-02 2.88661050079e-02 2.31688478126e-02 - 1.85132658939e-02 1.48031251671e-02 1.19137265332e-02 9.71912104775e-03 8.10563303358e-03 6.97836085285e-03 - 6.26545793635e-03 5.92021996667e-03 5.92021996667e-03 6.26545793635e-03 6.97836085285e-03 8.10563303358e-03 - 9.71912104775e-03 1.19137265332e-02 1.48031251671e-02 1.85132658939e-02 2.31688478126e-02 2.88661050079e-02 - 3.56312088557e-02 4.33721592307e-02 5.18355302331e-02 6.05796981280e-02 6.89793219251e-02 7.62783857555e-02 - 8.16998180862e-02 8.45957298814e-02 8.45957298814e-02 8.16998180862e-02 7.62783857555e-02 6.89793219251e-02 - 5.78981879671e-02 4.92182336225e-02 4.09927131873e-02 3.35871770820e-02 2.71955666447e-02 2.18687619531e-02 - 1.75547637226e-02 1.41440793855e-02 1.15097880648e-02 9.53173661310e-03 8.10563303358e-03 7.14689010595e-03 - 6.59479473082e-03 6.41444748147e-03 6.59479473082e-03 7.14689010595e-03 8.10563303358e-03 9.53173661310e-03 - 1.15097880648e-02 1.41440793855e-02 1.75547637226e-02 2.18687619531e-02 2.71955666447e-02 3.35871770820e-02 - 4.09927131873e-02 4.92182336225e-02 5.78981879671e-02 6.64898780493e-02 7.43082663472e-02 8.06097207709e-02 - 8.47143937707e-02 8.61408122915e-02 8.47143937707e-02 8.06097207709e-02 7.43082663472e-02 6.64898780493e-02 - 5.51031089527e-02 4.68264624901e-02 3.90347179512e-02 3.20546920774e-02 2.60582031450e-02 2.10847229658e-02 - 1.70770073925e-02 1.39256808178e-02 1.15097880648e-02 9.71912104775e-03 8.46060891145e-03 7.66146344666e-03 - 7.27338017313e-03 7.27338017313e-03 7.66146344666e-03 8.46060891145e-03 9.71912104775e-03 1.15097880648e-02 - 1.39256808178e-02 1.70770073925e-02 2.10847229658e-02 2.60582031450e-02 3.20546920774e-02 3.90347179512e-02 - 4.68264624901e-02 5.51031089527e-02 6.33842515281e-02 7.10787520021e-02 7.75631573239e-02 8.22656900591e-02 - 8.47410728024e-02 8.47410728024e-02 8.22656900591e-02 7.75631573239e-02 7.10787520021e-02 6.33842515281e-02 - 5.24339557043e-02 4.48486167771e-02 3.76190713504e-02 3.10978190541e-02 2.54803066383e-02 2.08223402545e-02 - 1.70770073925e-02 1.41440793855e-02 1.19137265332e-02 1.02881382638e-02 9.18679124184e-03 8.54973346172e-03 - 8.34122341388e-03 8.54973346172e-03 9.18679124184e-03 1.02881382638e-02 1.19137265332e-02 1.41440793855e-02 - 1.70770073925e-02 2.08223402545e-02 2.54803066383e-02 3.10978190541e-02 3.76190713504e-02 4.48486167771e-02 - 5.24339557043e-02 5.98878714669e-02 6.66786802062e-02 7.23556493700e-02 7.66122811094e-02 7.92532152557e-02 - 8.01500628124e-02 7.92532152557e-02 7.66122811094e-02 7.23556493700e-02 6.66786802062e-02 5.98878714669e-02 - 5.02828320119e-02 4.35234290368e-02 3.68707660171e-02 3.07715106065e-02 2.54803066383e-02 2.10847229658e-02 - 1.75547637226e-02 1.48031251671e-02 1.27333396536e-02 1.12609832188e-02 1.03186231402e-02 9.85925299562e-03 - 9.85925299562e-03 1.03186231402e-02 1.12609832188e-02 1.27333396536e-02 1.48031251671e-02 1.75547637226e-02 - 2.10847229658e-02 2.54803066383e-02 3.07715106065e-02 3.68707660171e-02 4.35234290368e-02 5.02828320119e-02 - 5.65511919643e-02 6.17513938278e-02 6.55787911247e-02 6.81077724909e-02 6.96179820017e-02 7.03323963389e-02 - 7.03323963389e-02 6.96179820017e-02 6.81077724909e-02 6.55787911247e-02 6.17513938278e-02 5.65511919643e-02 - 4.90700187394e-02 4.30547772101e-02 3.68707660171e-02 3.10978190541e-02 2.60582031450e-02 2.18687619531e-02 - 1.85132658939e-02 1.59162612755e-02 1.39945083398e-02 1.26769712537e-02 1.19093466628e-02 1.16573532374e-02 - 1.19093466628e-02 1.26769712537e-02 1.39945083398e-02 1.59162612755e-02 1.85132658939e-02 2.18687619531e-02 - 2.60582031450e-02 3.10978190541e-02 3.68707660171e-02 4.30547772101e-02 4.90700187394e-02 5.41129564364e-02 - 5.74105494947e-02 5.86758842735e-02 5.83777841365e-02 5.74463352203e-02 5.66663226477e-02 5.63846435627e-02 - 5.66663226477e-02 5.74463352203e-02 5.83777841365e-02 5.86758842735e-02 5.74105494947e-02 5.41129564364e-02 - 4.90700187394e-02 4.35234290368e-02 3.76190713504e-02 3.20546920774e-02 2.71955666447e-02 2.31688478126e-02 - 1.99620901041e-02 1.75083321070e-02 1.57370100687e-02 1.45906790875e-02 1.40283418589e-02 1.40283418589e-02 - 1.45906790875e-02 1.57370100687e-02 1.75083321070e-02 1.99620901041e-02 2.31688478126e-02 2.71955666447e-02 - 3.20546920774e-02 3.76190713504e-02 4.35234290368e-02 4.90700187394e-02 5.32152215954e-02 5.48533676650e-02 - 5.34983990182e-02 4.98718618187e-02 4.56222411881e-02 4.22847991283e-02 4.05694134160e-02 4.05694134160e-02 - 4.22847991283e-02 4.56222411881e-02 4.98718618187e-02 5.34983990182e-02 5.48533676650e-02 5.32152215954e-02 - 5.02828320119e-02 4.48486167771e-02 3.90347179512e-02 3.35871770820e-02 2.88661050079e-02 2.49827563157e-02 - 2.19185274002e-02 1.96135589165e-02 1.80109897723e-02 1.70678712692e-02 1.67567114426e-02 1.70678712692e-02 - 1.80109897723e-02 1.96135589165e-02 2.19185274002e-02 2.49827563157e-02 2.88661050079e-02 3.35871770820e-02 - 3.90347179512e-02 4.48486167771e-02 5.02828320119e-02 5.41129564364e-02 5.48533676650e-02 5.15765048907e-02 - 4.49279278957e-02 3.71417160544e-02 3.06594619284e-02 2.67478820537e-02 2.54935088837e-02 2.67478820537e-02 - 3.06594619284e-02 3.71417160544e-02 4.49279278957e-02 5.15765048907e-02 5.48533676650e-02 5.41129564364e-02 - 5.24339557043e-02 4.68264624901e-02 4.09927131873e-02 3.56312088557e-02 3.10465495213e-02 2.73140021666e-02 - 2.44059448105e-02 2.22726314479e-02 2.08735527936e-02 2.01812628043e-02 2.01812628043e-02 2.08735527936e-02 - 2.22726314479e-02 2.44059448105e-02 2.73140021666e-02 3.10465495213e-02 3.56312088557e-02 4.09927131873e-02 - 4.68264624901e-02 5.24339557043e-02 5.65511919643e-02 5.74105494947e-02 5.34983990182e-02 4.49279278957e-02 - 3.40771392673e-02 2.42761411551e-02 1.76819501362e-02 1.46090879135e-02 1.46090879135e-02 1.76819501362e-02 - 2.42761411551e-02 3.40771392673e-02 4.49279278957e-02 5.34983990182e-02 5.74105494947e-02 5.65511919643e-02 - 5.51031089527e-02 4.92182336225e-02 4.33721592307e-02 3.81345549630e-02 3.37228748044e-02 3.01717861136e-02 - 2.74512061786e-02 2.55281844546e-02 2.43819637041e-02 2.40011711299e-02 2.43819637041e-02 2.55281844546e-02 - 2.74512061786e-02 3.01717861136e-02 3.37228748044e-02 3.81345549630e-02 4.33721592307e-02 4.92182336225e-02 - 5.51031089527e-02 5.98878714669e-02 6.17513938278e-02 5.86758842735e-02 4.98718618187e-02 3.71417160544e-02 - 2.42761411551e-02 1.45732066269e-02 9.13060134292e-03 7.45857574908e-03 9.13060134292e-03 1.45732066269e-02 - 2.42761411551e-02 3.71417160544e-02 4.98718618187e-02 5.86758842735e-02 6.17513938278e-02 5.98878714669e-02 - 5.78981879671e-02 5.18355302331e-02 4.60913389830e-02 4.10670403681e-02 3.68889471691e-02 3.35632692529e-02 - 3.10717223250e-02 2.94074293899e-02 2.85734174953e-02 2.85734174953e-02 2.94074293899e-02 3.10717223250e-02 - 3.35632692529e-02 3.68889471691e-02 4.10670403681e-02 4.60913389830e-02 5.18355302331e-02 5.78981879671e-02 - 6.33842515281e-02 6.66786802062e-02 6.55787911247e-02 5.83777841365e-02 4.56222411881e-02 3.06594619284e-02 - 1.76819501362e-02 9.13060134292e-03 5.17285277950e-03 5.17285277950e-03 9.13060134292e-03 1.76819501362e-02 - 3.06594619284e-02 4.56222411881e-02 5.83777841365e-02 6.55787911247e-02 6.66786802062e-02 6.33842515281e-02 - 6.05796981280e-02 5.45841783826e-02 4.91148354625e-02 4.44094609233e-02 4.05244812822e-02 3.74634706166e-02 - 3.52402742752e-02 3.38859304601e-02 3.34304675050e-02 3.38859304601e-02 3.52402742752e-02 3.74634706166e-02 - 4.05244812822e-02 4.44094609233e-02 4.91148354625e-02 5.45841783826e-02 6.05796981280e-02 6.64898780493e-02 - 7.10787520021e-02 7.23556493700e-02 6.81077724909e-02 5.74463352203e-02 4.22847991283e-02 2.67478820537e-02 - 1.46090879135e-02 7.45857574908e-03 5.17285277950e-03 7.45857574908e-03 1.46090879135e-02 2.67478820537e-02 - 4.22847991283e-02 5.74463352203e-02 6.81077724909e-02 7.23556493700e-02 7.10787520021e-02 6.64898780493e-02 - 6.30873277659e-02 5.74494623672e-02 5.24194501424e-02 4.81082332430e-02 4.45431970579e-02 4.17618689283e-02 - 3.98358227133e-02 3.88462459817e-02 3.88462459817e-02 3.98358227133e-02 4.17618689283e-02 4.45431970579e-02 - 4.81082332430e-02 5.24194501424e-02 5.74494623672e-02 6.30873277659e-02 6.89793219251e-02 7.43082663472e-02 - 7.75631573239e-02 7.66122811094e-02 6.96179820017e-02 5.66663226477e-02 4.05694134160e-02 2.54935088837e-02 - 1.46090879135e-02 9.13060134292e-03 9.13060134292e-03 1.46090879135e-02 2.54935088837e-02 4.05694134160e-02 - 5.66663226477e-02 6.96179820017e-02 7.66122811094e-02 7.75631573239e-02 7.43082663472e-02 6.89793219251e-02 - 6.54719417706e-02 6.04237632524e-02 5.59201471811e-02 5.20033431247e-02 4.87273692032e-02 4.62088704848e-02 - 4.46053414397e-02 4.40529168852e-02 4.46053414397e-02 4.62088704848e-02 4.87273692032e-02 5.20033431247e-02 - 5.59201471811e-02 6.04237632524e-02 6.54719417706e-02 7.09081350393e-02 7.62783857555e-02 8.06097207709e-02 - 8.22656900591e-02 7.92532152557e-02 7.03323963389e-02 5.63846435627e-02 4.05694134160e-02 2.67478820537e-02 - 1.76819501362e-02 1.45732066269e-02 1.76819501362e-02 2.67478820537e-02 4.05694134160e-02 5.63846435627e-02 - 7.03323963389e-02 7.92532152557e-02 8.22656900591e-02 8.06097207709e-02 7.62783857555e-02 7.09081350393e-02 - 6.77723654588e-02 6.34040688222e-02 5.93841418824e-02 5.57595749637e-02 5.26787408684e-02 5.03893328752e-02 - 4.91578982971e-02 4.91578982971e-02 5.03893328752e-02 5.26787408684e-02 5.57595749637e-02 5.93841418824e-02 - 6.34040688222e-02 6.77723654588e-02 7.24538631804e-02 7.72682499914e-02 8.16998180862e-02 8.47143937707e-02 - 8.47410728024e-02 8.01500628124e-02 7.03323963389e-02 5.66663226477e-02 4.22847991283e-02 3.06594619284e-02 - 2.42761411551e-02 2.42761411551e-02 3.06594619284e-02 4.22847991283e-02 5.66663226477e-02 7.03323963389e-02 - 8.01500628124e-02 8.47410728024e-02 8.47143937707e-02 8.16998180862e-02 7.72682499914e-02 7.24538631804e-02 - 6.98920688762e-02 6.61022866145e-02 6.23688231248e-02 5.88318176265e-02 5.58153453540e-02 5.37510492057e-02 - 5.30133769166e-02 5.37510492057e-02 5.58153453540e-02 5.88318176265e-02 6.23688231248e-02 6.61022866145e-02 - 6.98920688762e-02 7.37387049341e-02 7.76449689484e-02 8.14375530661e-02 8.45957298814e-02 8.61408122915e-02 - 8.47410728024e-02 7.92532152557e-02 6.96179820017e-02 5.74463352203e-02 4.56222411881e-02 3.71417160544e-02 - 3.40771392673e-02 3.71417160544e-02 4.56222411881e-02 5.74463352203e-02 6.96179820017e-02 7.92532152557e-02 - 8.47410728024e-02 8.61408122915e-02 8.45957298814e-02 8.14375530661e-02 7.76449689484e-02 7.37387049341e-02 - 7.15201290633e-02 6.80033074139e-02 6.42180018992e-02 6.05090723285e-02 5.74676014035e-02 5.57363453523e-02 - 5.57363453523e-02 5.74676014035e-02 6.05090723285e-02 6.42180018992e-02 6.80033074139e-02 7.15201290633e-02 - 7.47020608958e-02 7.76449689484e-02 8.04193974336e-02 8.28911486673e-02 8.45957298814e-02 8.47143937707e-02 - 8.22656900591e-02 7.66122811094e-02 6.81077724909e-02 5.83777841365e-02 4.98718618187e-02 4.49279278957e-02 - 4.49279278957e-02 4.98718618187e-02 5.83777841365e-02 6.81077724909e-02 7.66122811094e-02 8.22656900591e-02 - 8.47143937707e-02 8.45957298814e-02 8.28911486673e-02 8.04193974336e-02 7.76449689484e-02 7.47020608958e-02 - 7.21264918488e-02 6.84139609392e-02 6.41840706496e-02 6.01184381094e-02 5.71366804742e-02 5.60372557288e-02 - 5.71366804742e-02 6.01184381094e-02 6.41840706496e-02 6.84139609392e-02 7.21264918488e-02 7.50510418428e-02 - 7.72682499914e-02 7.90059272690e-02 8.04193974336e-02 8.14375530661e-02 8.16998180862e-02 8.06097207709e-02 - 7.75631573239e-02 7.23556493700e-02 6.55787911247e-02 5.86758842735e-02 5.34983990182e-02 5.15765048907e-02 - 5.34983990182e-02 5.86758842735e-02 6.55787911247e-02 7.23556493700e-02 7.75631573239e-02 8.06097207709e-02 - 8.16998180862e-02 8.14375530661e-02 8.04193974336e-02 7.90059272690e-02 7.72682499914e-02 7.50510418428e-02 - 7.10787520021e-02 6.66786802062e-02 6.17513938278e-02 5.74105494947e-02 5.48533676650e-02 5.48533676650e-02 - 5.74105494947e-02 6.17513938278e-02 6.66786802062e-02 7.10787520021e-02 7.43082663472e-02 7.62783857555e-02 - 7.72682499914e-02 7.76449689484e-02 7.76449689484e-02 7.72682499914e-02 7.62783857555e-02 7.43082663472e-02 - 7.10787520021e-02 6.66786802062e-02 6.17513938278e-02 5.74105494947e-02 5.48533676650e-02 5.48533676650e-02 - 5.74105494947e-02 6.17513938278e-02 6.66786802062e-02 7.10787520021e-02 7.43082663472e-02 7.62783857555e-02 - 7.72682499914e-02 7.76449689484e-02 7.76449689484e-02 7.72682499914e-02 7.62783857555e-02 7.43082663472e-02 - 6.79320857310e-02 6.25800698666e-02 5.70772559013e-02 5.29210396854e-02 5.13723037105e-02 5.29210396854e-02 - 5.70772559013e-02 6.25800698666e-02 6.79320857310e-02 7.19923628057e-02 7.43082663472e-02 7.50510418428e-02 - 7.47020608958e-02 7.37387049341e-02 7.24538631804e-02 7.09081350393e-02 6.89793219251e-02 6.64898780493e-02 - 6.33842515281e-02 5.98878714669e-02 5.65511919643e-02 5.41129564364e-02 5.32152215954e-02 5.41129564364e-02 - 5.65511919643e-02 5.98878714669e-02 6.33842515281e-02 6.64898780493e-02 6.89793219251e-02 7.09081350393e-02 - 7.24538631804e-02 7.37387049341e-02 7.47020608958e-02 7.50510418428e-02 7.43082663472e-02 7.19923628057e-02 - 5.75824043038e-02 4.89850720157e-02 4.26203265537e-02 4.02808330656e-02 4.26203265537e-02 4.89850720157e-02 - 5.75824043038e-02 6.60504635380e-02 7.23556493700e-02 7.55368812409e-02 7.57970302390e-02 7.40032629540e-02 - 7.10977313661e-02 6.77723654588e-02 6.44054743742e-02 6.11288569567e-02 5.79474348197e-02 5.48714786192e-02 - 5.20147259753e-02 4.96193341715e-02 4.79989400749e-02 4.74231711778e-02 4.79989400749e-02 4.96193341715e-02 - 5.20147259753e-02 5.48714786192e-02 5.79474348197e-02 6.11288569567e-02 6.44054743742e-02 6.77723654588e-02 - 7.10977313661e-02 7.40032629540e-02 7.57970302390e-02 7.55368812409e-02 7.23556493700e-02 6.60504635380e-02 - 4.89850720157e-02 4.11986868029e-02 3.67025276917e-02 3.67025276917e-02 4.11986868029e-02 4.89850720157e-02 - 5.79103146750e-02 6.55787911247e-02 7.03019494995e-02 7.16581855164e-02 7.02831021338e-02 6.72218662363e-02 - 6.34040688222e-02 5.94462807362e-02 5.56676247698e-02 5.21839135623e-02 4.90231496620e-02 4.62258246981e-02 - 4.38959177953e-02 4.21941579647e-02 4.12888114430e-02 4.12888114430e-02 4.21941579647e-02 4.38959177953e-02 - 4.62258246981e-02 4.90231496620e-02 5.21839135623e-02 5.56676247698e-02 5.94462807362e-02 6.34040688222e-02 - 6.72218662363e-02 7.02831021338e-02 7.16581855164e-02 7.03019494995e-02 6.55787911247e-02 5.79103146750e-02 - 4.26203265537e-02 3.67025276917e-02 3.45455630665e-02 3.67025276917e-02 4.26203265537e-02 5.07010770424e-02 - 5.86758842735e-02 6.44394828494e-02 6.69101294891e-02 6.62522137956e-02 6.33941825467e-02 5.93841418824e-02 - 5.50251512552e-02 5.08044555558e-02 4.69561004766e-02 4.35604474537e-02 4.06430475235e-02 3.82415861113e-02 - 3.64263171972e-02 3.52857897121e-02 3.48956024912e-02 3.52857897121e-02 3.64263171972e-02 3.82415861113e-02 - 4.06430475235e-02 4.35604474537e-02 4.69561004766e-02 5.08044555558e-02 5.50251512552e-02 5.93841418824e-02 - 6.33941825467e-02 6.62522137956e-02 6.69101294891e-02 6.44394828494e-02 5.86758842735e-02 5.07010770424e-02 - 4.02808330656e-02 3.67025276917e-02 3.67025276917e-02 4.02808330656e-02 4.64751950426e-02 5.34983990182e-02 - 5.92810318582e-02 6.23288110708e-02 6.22821499923e-02 5.97584596222e-02 5.57595749637e-02 5.11831265828e-02 - 4.66403070569e-02 4.24686468881e-02 3.88104397494e-02 3.57044700685e-02 3.31615306069e-02 3.12022017908e-02 - 2.98615217076e-02 2.91781605866e-02 2.91781605866e-02 2.98615217076e-02 3.12022017908e-02 3.31615306069e-02 - 3.57044700685e-02 3.88104397494e-02 4.24686468881e-02 4.66403070569e-02 5.11831265828e-02 5.57595749637e-02 - 5.97584596222e-02 6.22821499923e-02 6.23288110708e-02 5.92810318582e-02 5.34983990182e-02 4.64751950426e-02 - 4.26203265537e-02 4.11986868029e-02 4.26203265537e-02 4.64751950426e-02 5.15765048907e-02 5.62463189889e-02 - 5.89627863020e-02 5.90154969276e-02 5.66509609539e-02 5.26787408684e-02 4.79731106469e-02 4.32002938784e-02 - 3.87673596218e-02 3.48695445110e-02 3.15673758761e-02 2.88631293974e-02 2.67502344749e-02 2.52298202509e-02 - 2.43103322252e-02 2.40022165572e-02 2.43103322252e-02 2.52298202509e-02 2.67502344749e-02 2.88631293974e-02 - 3.15673758761e-02 3.48695445110e-02 3.87673596218e-02 4.32002938784e-02 4.79731106469e-02 5.26787408684e-02 - 5.66509609539e-02 5.90154969276e-02 5.89627863020e-02 5.62463189889e-02 5.15765048907e-02 4.64751950426e-02 - 4.89850720157e-02 4.89850720157e-02 5.07010770424e-02 5.34983990182e-02 5.62463189889e-02 5.77208882781e-02 - 5.71527035674e-02 5.45211951056e-02 5.03893328752e-02 4.55081727847e-02 4.05199675384e-02 3.58537824974e-02 - 3.17358390207e-02 2.82446089484e-02 2.53797852965e-02 2.31175818882e-02 2.14361295219e-02 2.03206914317e-02 - 1.97639178277e-02 1.97639178277e-02 2.03206914317e-02 2.14361295219e-02 2.31175818882e-02 2.53797852965e-02 - 2.82446089484e-02 3.17358390207e-02 3.58537824974e-02 4.05199675384e-02 4.55081727847e-02 5.03893328752e-02 - 5.45211951056e-02 5.71527035674e-02 5.77208882781e-02 5.62463189889e-02 5.34983990182e-02 5.07010770424e-02 - 5.75824043038e-02 5.79103146750e-02 5.86758842735e-02 5.92810318582e-02 5.89627863020e-02 5.71527035674e-02 - 5.37595739225e-02 4.91578982971e-02 4.39402098517e-02 3.86662855632e-02 3.37399765679e-02 2.93901320501e-02 - 2.57019293917e-02 2.26718438342e-02 2.02621880335e-02 1.84326960165e-02 1.71497889118e-02 1.63890080671e-02 - 1.61367490443e-02 1.63890080671e-02 1.71497889118e-02 1.84326960165e-02 2.02621880335e-02 2.26718438342e-02 - 2.57019293917e-02 2.93901320501e-02 3.37399765679e-02 3.86662855632e-02 4.39402098517e-02 4.91578982971e-02 - 5.37595739225e-02 5.71527035674e-02 5.89627863020e-02 5.92810318582e-02 5.86758842735e-02 5.79103146750e-02 - 6.60504635380e-02 6.55787911247e-02 6.44394828494e-02 6.23288110708e-02 5.90154969276e-02 5.45211951056e-02 - 4.91578982971e-02 4.34003076052e-02 3.77147526395e-02 3.24534608631e-02 2.78244998346e-02 2.39063871143e-02 - 2.06884779452e-02 1.81196807915e-02 1.61427916872e-02 1.47072813037e-02 1.37726366090e-02 1.33116675302e-02 - 1.33116675302e-02 1.37726366090e-02 1.47072813037e-02 1.61427916872e-02 1.81196807915e-02 2.06884779452e-02 - 2.39063871143e-02 2.78244998346e-02 3.24534608631e-02 3.77147526395e-02 4.34003076052e-02 4.91578982971e-02 - 5.45211951056e-02 5.90154969276e-02 6.23288110708e-02 6.44394828494e-02 6.55787911247e-02 6.60504635380e-02 - 7.23556493700e-02 7.03019494995e-02 6.69101294891e-02 6.22821499923e-02 5.66509609539e-02 5.03893328752e-02 - 4.39402098517e-02 3.77147526395e-02 3.20210145144e-02 2.70402901784e-02 2.28368095394e-02 1.93892705934e-02 - 1.66330383744e-02 1.44944499034e-02 1.29064893850e-02 1.18131307076e-02 1.11729588764e-02 1.09620544703e-02 - 1.11729588764e-02 1.18131307076e-02 1.29064893850e-02 1.44944499034e-02 1.66330383744e-02 1.93892705934e-02 - 2.28368095394e-02 2.70402901784e-02 3.20210145144e-02 3.77147526395e-02 4.39402098517e-02 5.03893328752e-02 - 5.66509609539e-02 6.22821499923e-02 6.69101294891e-02 7.03019494995e-02 7.23556493700e-02 7.30418134594e-02 - 7.55368812409e-02 7.16581855164e-02 6.62522137956e-02 5.97584596222e-02 5.26787408684e-02 4.55081727847e-02 - 3.86662855632e-02 3.24534608631e-02 2.70402901784e-02 2.24815496090e-02 1.87467470027e-02 1.57591868798e-02 - 1.34297677852e-02 1.16751572683e-02 1.04238516982e-02 9.61987006090e-03 9.22648243576e-03 9.22648243576e-03 - 9.61987006090e-03 1.04238516982e-02 1.16751572683e-02 1.34297677852e-02 1.57591868798e-02 1.87467470027e-02 - 2.24815496090e-02 2.70402901784e-02 3.24534608631e-02 3.86662855632e-02 4.55081727847e-02 5.26787408684e-02 - 5.97584596222e-02 6.62522137956e-02 7.16581855164e-02 7.55368812409e-02 7.75631573239e-02 7.75631573239e-02 - 7.57970302390e-02 7.02831021338e-02 6.33941825467e-02 5.57595749637e-02 4.79731106469e-02 4.05199675384e-02 - 3.37399765679e-02 2.78244998346e-02 2.28368095394e-02 1.87467470027e-02 1.54709928045e-02 1.29079014387e-02 - 1.09586567104e-02 9.53627070961e-03 8.57007132232e-03 8.00955236461e-03 7.82576853226e-03 8.00955236461e-03 - 8.57007132232e-03 9.53627070961e-03 1.09586567104e-02 1.29079014387e-02 1.54709928045e-02 1.87467470027e-02 - 2.28368095394e-02 2.78244998346e-02 3.37399765679e-02 4.05199675384e-02 4.79731106469e-02 5.57595749637e-02 - 6.33941825467e-02 7.02831021338e-02 7.57970302390e-02 7.93709590427e-02 8.06097207709e-02 7.93709590427e-02 - 7.40032629540e-02 6.72218662363e-02 5.93841418824e-02 5.11831265828e-02 4.32002938784e-02 3.58537824974e-02 - 2.93901320501e-02 2.39063871143e-02 1.93892705934e-02 1.57591868798e-02 1.29079014387e-02 1.07235056315e-02 - 9.10381322670e-03 7.96341795569e-03 7.23785699764e-03 6.88519888788e-03 6.88519888788e-03 7.23785699764e-03 - 7.96341795569e-03 9.10381322670e-03 1.07235056315e-02 1.29079014387e-02 1.57591868798e-02 1.93892705934e-02 - 2.39063871143e-02 2.93901320501e-02 3.58537824974e-02 4.32002938784e-02 5.11831265828e-02 5.93841418824e-02 - 6.72218662363e-02 7.40032629540e-02 7.90236437036e-02 8.16998180862e-02 8.16998180862e-02 7.90236437036e-02 - 7.10977313661e-02 6.34040688222e-02 5.50251512552e-02 4.66403070569e-02 3.87673596218e-02 3.17358390207e-02 - 2.57019293917e-02 2.06884779452e-02 1.66330383744e-02 1.34297677852e-02 1.09586567104e-02 9.10381322670e-03 - 7.76490388909e-03 6.86339437793e-03 6.34416762186e-03 6.17468606834e-03 6.34416762186e-03 6.86339437793e-03 - 7.76490388909e-03 9.10381322670e-03 1.09586567104e-02 1.34297677852e-02 1.66330383744e-02 2.06884779452e-02 - 2.57019293917e-02 3.17358390207e-02 3.87673596218e-02 4.66403070569e-02 5.50251512552e-02 6.34040688222e-02 - 7.10977313661e-02 7.73458021392e-02 8.14375530661e-02 8.28633557769e-02 8.14375530661e-02 7.73458021392e-02 - 6.77723654588e-02 5.94462807362e-02 5.08044555558e-02 4.24686468881e-02 3.48695445110e-02 2.82446089484e-02 - 2.26718438342e-02 1.81196807915e-02 1.44944499034e-02 1.16751572683e-02 9.53627070961e-03 7.96341795569e-03 - 6.86339437793e-03 6.16759269815e-03 5.83098728503e-03 5.83098728503e-03 6.16759269815e-03 6.86339437793e-03 - 7.96341795569e-03 9.53627070961e-03 1.16751572683e-02 1.44944499034e-02 1.81196807915e-02 2.26718438342e-02 - 2.82446089484e-02 3.48695445110e-02 4.24686468881e-02 5.08044555558e-02 5.94462807362e-02 6.77723654588e-02 - 7.50243106749e-02 8.04193974336e-02 8.33038946145e-02 8.33038946145e-02 8.04193974336e-02 7.50243106749e-02 - 6.44054743742e-02 5.56676247698e-02 4.69561004766e-02 3.88104397494e-02 3.15673758761e-02 2.53797852965e-02 - 2.02621880335e-02 1.61427916872e-02 1.29064893850e-02 1.04238516982e-02 8.57007132232e-03 7.23785699764e-03 - 6.34416762186e-03 5.83098728503e-03 5.66378434823e-03 5.83098728503e-03 6.34416762186e-03 7.23785699764e-03 - 8.57007132232e-03 1.04238516982e-02 1.29064893850e-02 1.61427916872e-02 2.02621880335e-02 2.53797852965e-02 - 3.15673758761e-02 3.88104397494e-02 4.69561004766e-02 5.56676247698e-02 6.44054743742e-02 7.24538631804e-02 - 7.90059272690e-02 8.33038946145e-02 8.48028174918e-02 8.33038946145e-02 7.90059272690e-02 7.24538631804e-02 - 6.11288569567e-02 5.21839135623e-02 4.35604474537e-02 3.57044700685e-02 2.88631293974e-02 2.31175818882e-02 - 1.84326960165e-02 1.47072813037e-02 1.18131307076e-02 9.61987006090e-03 8.00955236461e-03 6.88519888788e-03 - 6.17468606834e-03 5.83098728503e-03 5.83098728503e-03 6.17468606834e-03 6.88519888788e-03 8.00955236461e-03 - 9.61987006090e-03 1.18131307076e-02 1.47072813037e-02 1.84326960165e-02 2.31175818882e-02 2.88631293974e-02 - 3.57044700685e-02 4.35604474537e-02 5.21839135623e-02 6.11288569567e-02 6.97522426294e-02 7.72682499914e-02 - 8.28633557769e-02 8.58561529560e-02 8.58561529560e-02 8.28633557769e-02 7.72682499914e-02 6.97522426294e-02 - 5.79474348197e-02 4.90231496620e-02 4.06430475235e-02 3.31615306069e-02 2.67502344749e-02 2.14361295219e-02 - 1.71497889118e-02 1.37726366090e-02 1.11729588764e-02 9.22648243576e-03 7.82576853226e-03 6.88519888788e-03 - 6.34416762186e-03 6.16759269815e-03 6.34416762186e-03 6.88519888788e-03 7.82576853226e-03 9.22648243576e-03 - 1.11729588764e-02 1.37726366090e-02 1.71497889118e-02 2.14361295219e-02 2.67502344749e-02 3.31615306069e-02 - 4.06430475235e-02 4.90231496620e-02 5.79474348197e-02 6.68641206041e-02 7.50510418428e-02 8.16998180862e-02 - 8.60542685404e-02 8.75716967614e-02 8.60542685404e-02 8.16998180862e-02 7.50510418428e-02 6.68641206041e-02 - 5.48714786192e-02 4.62258246981e-02 3.82415861113e-02 3.12022017908e-02 2.52298202509e-02 2.03206914317e-02 - 1.63890080671e-02 1.33116675302e-02 1.09620544703e-02 9.22648243576e-03 8.00955236461e-03 7.23785699764e-03 - 6.86339437793e-03 6.86339437793e-03 7.23785699764e-03 8.00955236461e-03 9.22648243576e-03 1.09620544703e-02 - 1.33116675302e-02 1.63890080671e-02 2.03206914317e-02 2.52298202509e-02 3.12022017908e-02 3.82415861113e-02 - 4.62258246981e-02 5.48714786192e-02 6.37149803432e-02 7.21264918488e-02 7.93709590427e-02 8.47143937707e-02 - 8.75562567048e-02 8.75562567048e-02 8.47143937707e-02 7.93709590427e-02 7.21264918488e-02 6.37149803432e-02 - 5.20147259753e-02 4.38959177953e-02 3.64263171972e-02 2.98615217076e-02 2.43103322252e-02 1.97639178277e-02 - 1.61367490443e-02 1.33116675302e-02 1.11729588764e-02 9.61987006090e-03 8.57007132232e-03 7.96341795569e-03 - 7.76490388909e-03 7.96341795569e-03 8.57007132232e-03 9.61987006090e-03 1.11729588764e-02 1.33116675302e-02 - 1.61367490443e-02 1.97639178277e-02 2.43103322252e-02 2.98615217076e-02 3.64263171972e-02 4.38959177953e-02 - 5.20147259753e-02 6.03694423859e-02 6.84139609392e-02 7.55368812409e-02 8.11458755837e-02 8.47410728024e-02 - 8.59805323971e-02 8.47410728024e-02 8.11458755837e-02 7.55368812409e-02 6.84139609392e-02 6.03694423859e-02 - 4.96193341715e-02 4.21941579647e-02 3.52857897121e-02 2.91781605866e-02 2.40022165572e-02 1.97639178277e-02 - 1.63890080671e-02 1.37726366090e-02 1.18131307076e-02 1.04238516982e-02 9.53627070961e-03 9.10381322670e-03 - 9.10381322670e-03 9.53627070961e-03 1.04238516982e-02 1.18131307076e-02 1.37726366090e-02 1.63890080671e-02 - 1.97639178277e-02 2.40022165572e-02 2.91781605866e-02 3.52857897121e-02 4.21941579647e-02 4.96193341715e-02 - 5.71251588417e-02 6.41840706496e-02 7.03019494995e-02 7.51264696898e-02 7.84511058955e-02 8.01500628124e-02 - 8.01500628124e-02 7.84511058955e-02 7.51264696898e-02 7.03019494995e-02 6.41840706496e-02 5.71251588417e-02 - 4.79989400749e-02 4.12888114430e-02 3.48956024912e-02 2.91781605866e-02 2.43103322252e-02 2.03206914317e-02 - 1.71497889118e-02 1.47072813037e-02 1.29064893850e-02 1.16751572683e-02 1.09586567104e-02 1.07235056315e-02 - 1.09586567104e-02 1.16751572683e-02 1.29064893850e-02 1.47072813037e-02 1.71497889118e-02 2.03206914317e-02 - 2.43103322252e-02 2.91781605866e-02 3.48956024912e-02 4.12888114430e-02 4.79989400749e-02 5.44829894560e-02 - 6.01184381094e-02 6.44394828494e-02 6.73541476702e-02 6.91119067669e-02 7.00400365127e-02 7.03323963389e-02 - 7.00400365127e-02 6.91119067669e-02 6.73541476702e-02 6.44394828494e-02 6.01184381094e-02 5.44829894560e-02 - 4.74231711778e-02 4.12888114430e-02 3.52857897121e-02 2.98615217076e-02 2.52298202509e-02 2.14361295219e-02 - 1.84326960165e-02 1.61427916872e-02 1.44944499034e-02 1.34297677852e-02 1.29079014387e-02 1.29079014387e-02 - 1.34297677852e-02 1.44944499034e-02 1.61427916872e-02 1.84326960165e-02 2.14361295219e-02 2.52298202509e-02 - 2.98615217076e-02 3.52857897121e-02 4.12888114430e-02 4.74231711778e-02 5.29846351657e-02 5.71366804742e-02 - 5.92810318582e-02 5.94868177545e-02 5.85232784436e-02 5.73653289979e-02 5.66663226477e-02 5.66663226477e-02 - 5.73653289979e-02 5.85232784436e-02 5.94868177545e-02 5.92810318582e-02 5.71366804742e-02 5.29846351657e-02 - 4.79989400749e-02 4.21941579647e-02 3.64263171972e-02 3.12022017908e-02 2.67502344749e-02 2.31175818882e-02 - 2.02621880335e-02 1.81196807915e-02 1.66330383744e-02 1.57591868798e-02 1.54709928045e-02 1.57591868798e-02 - 1.66330383744e-02 1.81196807915e-02 2.02621880335e-02 2.31175818882e-02 2.67502344749e-02 3.12022017908e-02 - 3.64263171972e-02 4.21941579647e-02 4.79989400749e-02 5.29846351657e-02 5.60372557288e-02 5.62463189889e-02 - 5.36143814352e-02 4.93308963719e-02 4.51254329663e-02 4.22847991283e-02 4.13123485649e-02 4.22847991283e-02 - 4.51254329663e-02 4.93308963719e-02 5.36143814352e-02 5.62463189889e-02 5.60372557288e-02 5.29846351657e-02 - 4.96193341715e-02 4.38959177953e-02 3.82415861113e-02 3.31615306069e-02 2.88631293974e-02 2.53797852965e-02 - 2.26718438342e-02 2.06884779452e-02 1.93892705934e-02 1.87467470027e-02 1.87467470027e-02 1.93892705934e-02 - 2.06884779452e-02 2.26718438342e-02 2.53797852965e-02 2.88631293974e-02 3.31615306069e-02 3.82415861113e-02 - 4.38959177953e-02 4.96193341715e-02 5.44829894560e-02 5.71366804742e-02 5.62463189889e-02 5.14403532045e-02 - 4.40123223759e-02 3.63849623957e-02 3.06594619284e-02 2.77489957459e-02 2.77489957459e-02 3.06594619284e-02 - 3.63849623957e-02 4.40123223759e-02 5.14403532045e-02 5.62463189889e-02 5.71366804742e-02 5.44829894560e-02 - 5.20147259753e-02 4.62258246981e-02 4.06430475235e-02 3.57044700685e-02 3.15673758761e-02 2.82446089484e-02 - 2.57019293917e-02 2.39063871143e-02 2.28368095394e-02 2.24815496090e-02 2.28368095394e-02 2.39063871143e-02 - 2.57019293917e-02 2.82446089484e-02 3.15673758761e-02 3.57044700685e-02 4.06430475235e-02 4.62258246981e-02 - 5.20147259753e-02 5.71251588417e-02 6.01184381094e-02 5.92810318582e-02 5.36143814352e-02 4.40123223759e-02 - 3.32338776264e-02 2.42761411551e-02 1.87771308641e-02 1.69819929531e-02 1.87771308641e-02 2.42761411551e-02 - 3.32338776264e-02 4.40123223759e-02 5.36143814352e-02 5.92810318582e-02 6.01184381094e-02 5.71251588417e-02 - 5.48714786192e-02 4.90231496620e-02 4.35604474537e-02 3.88104397494e-02 3.48695445110e-02 3.17358390207e-02 - 2.93901320501e-02 2.78244998346e-02 2.70402901784e-02 2.70402901784e-02 2.78244998346e-02 2.93901320501e-02 - 3.17358390207e-02 3.48695445110e-02 3.88104397494e-02 4.35604474537e-02 4.90231496620e-02 5.48714786192e-02 - 6.03694423859e-02 6.41840706496e-02 6.44394828494e-02 5.94868177545e-02 4.93308963719e-02 3.63849623957e-02 - 2.42761411551e-02 1.56860392578e-02 1.14596764125e-02 1.14596764125e-02 1.56860392578e-02 2.42761411551e-02 - 3.63849623957e-02 4.93308963719e-02 5.94868177545e-02 6.44394828494e-02 6.41840706496e-02 6.03694423859e-02 - 5.79474348197e-02 5.21839135623e-02 4.69561004766e-02 4.24686468881e-02 3.87673596218e-02 3.58537824974e-02 - 3.37399765679e-02 3.24534608631e-02 3.20210145144e-02 3.24534608631e-02 3.37399765679e-02 3.58537824974e-02 - 3.87673596218e-02 4.24686468881e-02 4.69561004766e-02 5.21839135623e-02 5.79474348197e-02 6.37149803432e-02 - 6.84139609392e-02 7.03019494995e-02 6.73541476702e-02 5.85232784436e-02 4.51254329663e-02 3.06594619284e-02 - 1.87771308641e-02 1.14596764125e-02 9.05419851032e-03 1.14596764125e-02 1.87771308641e-02 3.06594619284e-02 - 4.51254329663e-02 5.85232784436e-02 6.73541476702e-02 7.03019494995e-02 6.84139609392e-02 6.37149803432e-02 - 6.11288569567e-02 5.56676247698e-02 5.08044555558e-02 4.66403070569e-02 4.32002938784e-02 4.05199675384e-02 - 3.86662855632e-02 3.77147526395e-02 3.77147526395e-02 3.86662855632e-02 4.05199675384e-02 4.32002938784e-02 - 4.66403070569e-02 5.08044555558e-02 5.56676247698e-02 6.11288569567e-02 6.68641206041e-02 7.21264918488e-02 - 7.55368812409e-02 7.51264696898e-02 6.91119067669e-02 5.73653289979e-02 4.22847991283e-02 2.77489957459e-02 - 1.69819929531e-02 1.14596764125e-02 1.14596764125e-02 1.69819929531e-02 2.77489957459e-02 4.22847991283e-02 - 5.73653289979e-02 6.91119067669e-02 7.51264696898e-02 7.55368812409e-02 7.21264918488e-02 6.68641206041e-02 - 6.44054743742e-02 5.94462807362e-02 5.50251512552e-02 5.11831265828e-02 4.79731106469e-02 4.55081727847e-02 - 4.39402098517e-02 4.34003076052e-02 4.39402098517e-02 4.55081727847e-02 4.79731106469e-02 5.11831265828e-02 - 5.50251512552e-02 5.94462807362e-02 6.44054743742e-02 6.97522426294e-02 7.50510418428e-02 7.93709590427e-02 - 8.11458755837e-02 7.84511058955e-02 7.00400365127e-02 5.66663226477e-02 4.13123485649e-02 2.77489957459e-02 - 1.87771308641e-02 1.56860392578e-02 1.87771308641e-02 2.77489957459e-02 4.13123485649e-02 5.66663226477e-02 - 7.00400365127e-02 7.84511058955e-02 8.11458755837e-02 7.93709590427e-02 7.50510418428e-02 6.97522426294e-02 - 6.77723654588e-02 6.34040688222e-02 5.93841418824e-02 5.57595749637e-02 5.26787408684e-02 5.03893328752e-02 - 4.91578982971e-02 4.91578982971e-02 5.03893328752e-02 5.26787408684e-02 5.57595749637e-02 5.93841418824e-02 - 6.34040688222e-02 6.77723654588e-02 7.24538631804e-02 7.72682499914e-02 8.16998180862e-02 8.47143937707e-02 - 8.47410728024e-02 8.01500628124e-02 7.03323963389e-02 5.66663226477e-02 4.22847991283e-02 3.06594619284e-02 - 2.42761411551e-02 2.42761411551e-02 3.06594619284e-02 4.22847991283e-02 5.66663226477e-02 7.03323963389e-02 - 8.01500628124e-02 8.47410728024e-02 8.47143937707e-02 8.16998180862e-02 7.72682499914e-02 7.24538631804e-02 - 7.10977313661e-02 6.72218662363e-02 6.33941825467e-02 5.97584596222e-02 5.66509609539e-02 5.45211951056e-02 - 5.37595739225e-02 5.45211951056e-02 5.66509609539e-02 5.97584596222e-02 6.33941825467e-02 6.72218662363e-02 - 7.10977313661e-02 7.50243106749e-02 7.90059272690e-02 8.28633557769e-02 8.60542685404e-02 8.75562567048e-02 - 8.59805323971e-02 8.01500628124e-02 7.00400365127e-02 5.73653289979e-02 4.51254329663e-02 3.63849623957e-02 - 3.32338776264e-02 3.63849623957e-02 4.51254329663e-02 5.73653289979e-02 7.00400365127e-02 8.01500628124e-02 - 8.59805323971e-02 8.75562567048e-02 8.60542685404e-02 8.28633557769e-02 7.90059272690e-02 7.50243106749e-02 - 7.40032629540e-02 7.02831021338e-02 6.62522137956e-02 6.22821499923e-02 5.90154969276e-02 5.71527035674e-02 - 5.71527035674e-02 5.90154969276e-02 6.22821499923e-02 6.62522137956e-02 7.02831021338e-02 7.40032629540e-02 - 7.73458021392e-02 8.04193974336e-02 8.33038946145e-02 8.58561529560e-02 8.75716967614e-02 8.75562567048e-02 - 8.47410728024e-02 7.84511058955e-02 6.91119067669e-02 5.85232784436e-02 4.93308963719e-02 4.40123223759e-02 - 4.40123223759e-02 4.93308963719e-02 5.85232784436e-02 6.91119067669e-02 7.84511058955e-02 8.47410728024e-02 - 8.75562567048e-02 8.75716967614e-02 8.58561529560e-02 8.33038946145e-02 8.04193974336e-02 7.73458021392e-02 - 7.57970302390e-02 7.16581855164e-02 6.69101294891e-02 6.23288110708e-02 5.89627863020e-02 5.77208882781e-02 - 5.89627863020e-02 6.23288110708e-02 6.69101294891e-02 7.16581855164e-02 7.57970302390e-02 7.90236437036e-02 - 8.14375530661e-02 8.33038946145e-02 8.48028174918e-02 8.58561529560e-02 8.60542685404e-02 8.47143937707e-02 - 8.11458755837e-02 7.51264696898e-02 6.73541476702e-02 5.94868177545e-02 5.36143814352e-02 5.14403532045e-02 - 5.36143814352e-02 5.94868177545e-02 6.73541476702e-02 7.51264696898e-02 8.11458755837e-02 8.47143937707e-02 - 8.60542685404e-02 8.58561529560e-02 8.48028174918e-02 8.33038946145e-02 8.14375530661e-02 7.90236437036e-02 - 7.55368812409e-02 7.03019494995e-02 6.44394828494e-02 5.92810318582e-02 5.62463189889e-02 5.62463189889e-02 - 5.92810318582e-02 6.44394828494e-02 7.03019494995e-02 7.55368812409e-02 7.93709590427e-02 8.16998180862e-02 - 8.28633557769e-02 8.33038946145e-02 8.33038946145e-02 8.28633557769e-02 8.16998180862e-02 7.93709590427e-02 - 7.55368812409e-02 7.03019494995e-02 6.44394828494e-02 5.92810318582e-02 5.62463189889e-02 5.62463189889e-02 - 5.92810318582e-02 6.44394828494e-02 7.03019494995e-02 7.55368812409e-02 7.93709590427e-02 8.16998180862e-02 - 8.28633557769e-02 8.33038946145e-02 8.33038946145e-02 8.28633557769e-02 8.16998180862e-02 7.93709590427e-02 - 7.23556493700e-02 6.55787911247e-02 5.86758842735e-02 5.34983990182e-02 5.15765048907e-02 5.34983990182e-02 - 5.86758842735e-02 6.55787911247e-02 7.23556493700e-02 7.75631573239e-02 8.06097207709e-02 8.16998180862e-02 - 8.14375530661e-02 8.04193974336e-02 7.90059272690e-02 7.72682499914e-02 7.50510418428e-02 7.21264918488e-02 - 6.84139609392e-02 6.41840706496e-02 6.01184381094e-02 5.71366804742e-02 5.60372557288e-02 5.71366804742e-02 - 6.01184381094e-02 6.41840706496e-02 6.84139609392e-02 7.21264918488e-02 7.50510418428e-02 7.72682499914e-02 - 7.90059272690e-02 8.04193974336e-02 8.14375530661e-02 8.16998180862e-02 8.06097207709e-02 7.75631573239e-02 - 6.60504635380e-02 5.79103146750e-02 5.07010770424e-02 4.64751950426e-02 4.64751950426e-02 5.07010770424e-02 - 5.79103146750e-02 6.60504635380e-02 7.30418134594e-02 7.75631573239e-02 7.93709590427e-02 7.90236437036e-02 - 7.73458021392e-02 7.50243106749e-02 7.24538631804e-02 6.97522426294e-02 6.68641206041e-02 6.37149803432e-02 - 6.03694423859e-02 5.71251588417e-02 5.44829894560e-02 5.29846351657e-02 5.29846351657e-02 5.44829894560e-02 - 5.71251588417e-02 6.03694423859e-02 6.37149803432e-02 6.68641206041e-02 6.97522426294e-02 7.24538631804e-02 - 7.50243106749e-02 7.73458021392e-02 7.90236437036e-02 7.93709590427e-02 7.75631573239e-02 7.30418134594e-02 - 4.60013609401e-02 3.62214481565e-02 3.07039905741e-02 3.07039905741e-02 3.62214481565e-02 4.60013609401e-02 - 5.76200322747e-02 6.81077724909e-02 7.51264696898e-02 7.78881394404e-02 7.70723261920e-02 7.40032629540e-02 - 6.98920688762e-02 6.55352798807e-02 6.13379141192e-02 5.74449785733e-02 5.38883507401e-02 5.07121410456e-02 - 4.80406383964e-02 4.60731359718e-02 4.50208900473e-02 4.50208900473e-02 4.60731359718e-02 4.80406383964e-02 - 5.07121410456e-02 5.38883507401e-02 5.74449785733e-02 6.13379141192e-02 6.55352798807e-02 6.98920688762e-02 - 7.40032629540e-02 7.70723261920e-02 7.78881394404e-02 7.51264696898e-02 6.81077724909e-02 5.76200322747e-02 - 3.62214481565e-02 2.86292518106e-02 2.59250062413e-02 2.86292518106e-02 3.62214481565e-02 4.70389926376e-02 - 5.83777841365e-02 6.73541476702e-02 7.21810172465e-02 7.27796836797e-02 7.02831021338e-02 6.61022866145e-02 - 6.13334872428e-02 5.66331890923e-02 5.23143637463e-02 4.84855850881e-02 4.51788789706e-02 4.24386109393e-02 - 4.03527020822e-02 3.90350130516e-02 3.85829474965e-02 3.90350130516e-02 4.03527020822e-02 4.24386109393e-02 - 4.51788789706e-02 4.84855850881e-02 5.23143637463e-02 5.66331890923e-02 6.13334872428e-02 6.61022866145e-02 - 7.02831021338e-02 7.27796836797e-02 7.21810172465e-02 6.73541476702e-02 5.83777841365e-02 4.70389926376e-02 - 3.07039905741e-02 2.59250062413e-02 2.59250062413e-02 3.07039905741e-02 3.93541671489e-02 4.98718618187e-02 - 5.94868177545e-02 6.57918464265e-02 6.78442738531e-02 6.62522137956e-02 6.23688231248e-02 5.74762428735e-02 - 5.24477482650e-02 4.77625301985e-02 4.36277000850e-02 4.01041807768e-02 3.72078996967e-02 3.49654910486e-02 - 3.34242157073e-02 3.26363277502e-02 3.26363277502e-02 3.34242157073e-02 3.49654910486e-02 3.72078996967e-02 - 4.01041807768e-02 4.36277000850e-02 4.77625301985e-02 5.24477482650e-02 5.74762428735e-02 6.23688231248e-02 - 6.62522137956e-02 6.78442738531e-02 6.57918464265e-02 5.94868177545e-02 4.98718618187e-02 3.93541671489e-02 - 3.07039905741e-02 2.86292518106e-02 3.07039905741e-02 3.65582592974e-02 4.49279278957e-02 5.36143814352e-02 - 6.01752681104e-02 6.30764730892e-02 6.22821499923e-02 5.88318176265e-02 5.40097122002e-02 4.88190878681e-02 - 4.38725463784e-02 3.94725484932e-02 3.57259716101e-02 3.26483588385e-02 3.02357338101e-02 2.84935612207e-02 - 2.74372089612e-02 2.70827915169e-02 2.74372089612e-02 2.84935612207e-02 3.02357338101e-02 3.26483588385e-02 - 3.57259716101e-02 3.94725484932e-02 4.38725463784e-02 4.88190878681e-02 5.40097122002e-02 5.88318176265e-02 - 6.22821499923e-02 6.30764730892e-02 6.01752681104e-02 5.36143814352e-02 4.49279278957e-02 3.65582592974e-02 - 3.62214481565e-02 3.62214481565e-02 3.93541671489e-02 4.49279278957e-02 5.14403532045e-02 5.68740665481e-02 - 5.95715936141e-02 5.90154969276e-02 5.58153453540e-02 5.10737783335e-02 4.57968161948e-02 4.06654278454e-02 - 3.60511821341e-02 3.21049723875e-02 2.88533907006e-02 2.62778950395e-02 2.43576039836e-02 2.30804654510e-02 - 2.24420850452e-02 2.24420850452e-02 2.30804654510e-02 2.43576039836e-02 2.62778950395e-02 2.88533907006e-02 - 3.21049723875e-02 3.60511821341e-02 4.06654278454e-02 4.57968161948e-02 5.10737783335e-02 5.58153453540e-02 - 5.90154969276e-02 5.95715936141e-02 5.68740665481e-02 5.14403532045e-02 4.49279278957e-02 3.93541671489e-02 - 4.60013609401e-02 4.70389926376e-02 4.98718618187e-02 5.36143814352e-02 5.68740665481e-02 5.82782465337e-02 - 5.71527035674e-02 5.37510492057e-02 4.88987422193e-02 4.34838779539e-02 3.81729635435e-02 3.33624200108e-02 - 2.92302840650e-02 2.58139075627e-02 2.30866420056e-02 2.10090352784e-02 1.95479913088e-02 1.86800926235e-02 - 1.83921353899e-02 1.86800926235e-02 1.95479913088e-02 2.10090352784e-02 2.30866420056e-02 2.58139075627e-02 - 2.92302840650e-02 3.33624200108e-02 3.81729635435e-02 4.34838779539e-02 4.88987422193e-02 5.37510492057e-02 - 5.71527035674e-02 5.82782465337e-02 5.68740665481e-02 5.36143814352e-02 4.98718618187e-02 4.70389926376e-02 - 5.76200322747e-02 5.83777841365e-02 5.94868177545e-02 6.01752681104e-02 5.95715936141e-02 5.71527035674e-02 - 5.30133769166e-02 4.77311231410e-02 4.20165784801e-02 3.64535808156e-02 3.14154606035e-02 2.70818268649e-02 - 2.34923498457e-02 2.06126999880e-02 1.83878553878e-02 1.67669692380e-02 1.57094271493e-02 1.51874137660e-02 - 1.51874137660e-02 1.57094271493e-02 1.67669692380e-02 1.83878553878e-02 2.06126999880e-02 2.34923498457e-02 - 2.70818268649e-02 3.14154606035e-02 3.64535808156e-02 4.20165784801e-02 4.77311231410e-02 5.30133769166e-02 - 5.71527035674e-02 5.95715936141e-02 6.01752681104e-02 5.94868177545e-02 5.83777841365e-02 5.76200322747e-02 - 6.81077724909e-02 6.73541476702e-02 6.57918464265e-02 6.30764730892e-02 5.90154969276e-02 5.37510492057e-02 - 4.77311231410e-02 4.15120643887e-02 3.55725175924e-02 3.02323588099e-02 2.56499234494e-02 2.18557815330e-02 - 1.88049742175e-02 1.64272283654e-02 1.46550533623e-02 1.34318126710e-02 1.27148275869e-02 1.24785638223e-02 - 1.27148275869e-02 1.34318126710e-02 1.46550533623e-02 1.64272283654e-02 1.88049742175e-02 2.18557815330e-02 - 2.56499234494e-02 3.02323588099e-02 3.55725175924e-02 4.15120643887e-02 4.77311231410e-02 5.37510492057e-02 - 5.90154969276e-02 6.30764730892e-02 6.57918464265e-02 6.73541476702e-02 6.81077724909e-02 6.83266751007e-02 - 7.51264696898e-02 7.21810172465e-02 6.78442738531e-02 6.22821499923e-02 5.58153453540e-02 4.88987422193e-02 - 4.20165784801e-02 3.55725175924e-02 2.98349904445e-02 2.49333108373e-02 2.08820531014e-02 1.76229803621e-02 - 1.50702461704e-02 1.31397287366e-02 1.17590249893e-02 1.08706042529e-02 1.04356792319e-02 1.04356792319e-02 - 1.08706042529e-02 1.17590249893e-02 1.31397287366e-02 1.50702461704e-02 1.76229803621e-02 2.08820531014e-02 - 2.49333108373e-02 2.98349904445e-02 3.55725175924e-02 4.20165784801e-02 4.88987422193e-02 5.58153453540e-02 - 6.22821499923e-02 6.78442738531e-02 7.21810172465e-02 7.51264696898e-02 7.66122811094e-02 7.66122811094e-02 - 7.78881394404e-02 7.27796836797e-02 6.62522137956e-02 5.88318176265e-02 5.10737783335e-02 4.34838779539e-02 - 3.64535808156e-02 3.02323588099e-02 2.49333108373e-02 2.05587788214e-02 1.70389543521e-02 1.42737851127e-02 - 1.21629507848e-02 1.06181928008e-02 9.56702175361e-03 8.95658363692e-03 8.75631776595e-03 8.95658363692e-03 - 9.56702175361e-03 1.06181928008e-02 1.21629507848e-02 1.42737851127e-02 1.70389543521e-02 2.05587788214e-02 - 2.49333108373e-02 3.02323588099e-02 3.64535808156e-02 4.34838779539e-02 5.10737783335e-02 5.88318176265e-02 - 6.62522137956e-02 7.27796836797e-02 7.78881394404e-02 8.11458755837e-02 8.22656900591e-02 8.11458755837e-02 - 7.70723261920e-02 7.02831021338e-02 6.23688231248e-02 5.40097122002e-02 4.57968161948e-02 3.81729635435e-02 - 3.14154606035e-02 2.56499234494e-02 2.08820531014e-02 1.70389543521e-02 1.40112393540e-02 1.16845233837e-02 - 9.95507847617e-03 8.73551184506e-03 7.95863052826e-03 7.58058258839e-03 7.58058258839e-03 7.95863052826e-03 - 8.73551184506e-03 9.95507847617e-03 1.16845233837e-02 1.40112393540e-02 1.70389543521e-02 2.08820531014e-02 - 2.56499234494e-02 3.14154606035e-02 3.81729635435e-02 4.57968161948e-02 5.40097122002e-02 6.23688231248e-02 - 7.02831021338e-02 7.70723261920e-02 8.20645507484e-02 8.47143937707e-02 8.47143937707e-02 8.20645507484e-02 - 7.40032629540e-02 6.61022866145e-02 5.74762428735e-02 4.88190878681e-02 4.06654278454e-02 3.33624200108e-02 - 2.70818268649e-02 2.18557815330e-02 1.76229803621e-02 1.42737851127e-02 1.16845233837e-02 9.73748464183e-03 - 8.33057919998e-03 7.38252390656e-03 6.83583874198e-03 6.65719946009e-03 6.83583874198e-03 7.38252390656e-03 - 8.33057919998e-03 9.73748464183e-03 1.16845233837e-02 1.42737851127e-02 1.76229803621e-02 2.18557815330e-02 - 2.70818268649e-02 3.33624200108e-02 4.06654278454e-02 4.88190878681e-02 5.74762428735e-02 6.61022866145e-02 - 7.40032629540e-02 8.04073084192e-02 8.45957298814e-02 8.60542685404e-02 8.45957298814e-02 8.04073084192e-02 - 6.98920688762e-02 6.13334872428e-02 5.24477482650e-02 4.38725463784e-02 3.60511821341e-02 2.92302840650e-02 - 2.34923498457e-02 1.88049742175e-02 1.50702461704e-02 1.21629507848e-02 9.95507847617e-03 8.33057919998e-03 - 7.19410390186e-03 6.47483593539e-03 6.12657930585e-03 6.12657930585e-03 6.47483593539e-03 7.19410390186e-03 - 8.33057919998e-03 9.95507847617e-03 1.21629507848e-02 1.50702461704e-02 1.88049742175e-02 2.34923498457e-02 - 2.92302840650e-02 3.60511821341e-02 4.38725463784e-02 5.24477482650e-02 6.13334872428e-02 6.98920688762e-02 - 7.73458021392e-02 8.28911486673e-02 8.58561529560e-02 8.58561529560e-02 8.28911486673e-02 7.73458021392e-02 - 6.55352798807e-02 5.66331890923e-02 4.77625301985e-02 3.94725484932e-02 3.21049723875e-02 2.58139075627e-02 - 2.06126999880e-02 1.64272283654e-02 1.31397287366e-02 1.06181928008e-02 8.73551184506e-03 7.38252390656e-03 - 6.47483593539e-03 5.95356833121e-03 5.78371930190e-03 5.95356833121e-03 6.47483593539e-03 7.38252390656e-03 - 8.73551184506e-03 1.06181928008e-02 1.31397287366e-02 1.64272283654e-02 2.06126999880e-02 2.58139075627e-02 - 3.21049723875e-02 3.94725484932e-02 4.77625301985e-02 5.66331890923e-02 6.55352798807e-02 7.37387049341e-02 - 8.04193974336e-02 8.48028174918e-02 8.63317298438e-02 8.48028174918e-02 8.04193974336e-02 7.37387049341e-02 - 6.13379141192e-02 5.23143637463e-02 4.36277000850e-02 3.57259716101e-02 2.88533907006e-02 2.30866420056e-02 - 1.83878553878e-02 1.46550533623e-02 1.17590249893e-02 9.56702175361e-03 7.95863052826e-03 6.83583874198e-03 - 6.12657930585e-03 5.78371930190e-03 5.78371930190e-03 6.12657930585e-03 6.83583874198e-03 7.95863052826e-03 - 9.56702175361e-03 1.17590249893e-02 1.46550533623e-02 1.83878553878e-02 2.30866420056e-02 2.88533907006e-02 - 3.57259716101e-02 4.36277000850e-02 5.23143637463e-02 6.13379141192e-02 7.00474085615e-02 7.76449689484e-02 - 8.33038946145e-02 8.63317298438e-02 8.63317298438e-02 8.33038946145e-02 7.76449689484e-02 7.00474085615e-02 - 5.74449785733e-02 4.84855850881e-02 4.01041807768e-02 3.26483588385e-02 2.62778950395e-02 2.10090352784e-02 - 1.67669692380e-02 1.34318126710e-02 1.08706042529e-02 8.95658363692e-03 7.58058258839e-03 6.65719946009e-03 - 6.12657930585e-03 5.95356833121e-03 6.12657930585e-03 6.65719946009e-03 7.58058258839e-03 8.95658363692e-03 - 1.08706042529e-02 1.34318126710e-02 1.67669692380e-02 2.10090352784e-02 2.62778950395e-02 3.26483588385e-02 - 4.01041807768e-02 4.84855850881e-02 5.74449785733e-02 6.64284767715e-02 7.47020608958e-02 8.14375530661e-02 - 8.58561529560e-02 8.73972293003e-02 8.58561529560e-02 8.14375530661e-02 7.47020608958e-02 6.64284767715e-02 - 5.38883507401e-02 4.51788789706e-02 3.72078996967e-02 3.02357338101e-02 2.43576039836e-02 1.95479913088e-02 - 1.57094271493e-02 1.27148275869e-02 1.04356792319e-02 8.75631776595e-03 7.58058258839e-03 6.83583874198e-03 - 6.47483593539e-03 6.47483593539e-03 6.83583874198e-03 7.58058258839e-03 8.75631776595e-03 1.04356792319e-02 - 1.27148275869e-02 1.57094271493e-02 1.95479913088e-02 2.43576039836e-02 3.02357338101e-02 3.72078996967e-02 - 4.51788789706e-02 5.38883507401e-02 6.28828729732e-02 7.15201290633e-02 7.90236437036e-02 8.45957298814e-02 - 8.75716967614e-02 8.75716967614e-02 8.45957298814e-02 7.90236437036e-02 7.15201290633e-02 6.28828729732e-02 - 5.07121410456e-02 4.24386109393e-02 3.49654910486e-02 2.84935612207e-02 2.30804654510e-02 1.86800926235e-02 - 1.51874137660e-02 1.24785638223e-02 1.04356792319e-02 8.95658363692e-03 7.95863052826e-03 7.38252390656e-03 - 7.19410390186e-03 7.38252390656e-03 7.95863052826e-03 8.95658363692e-03 1.04356792319e-02 1.24785638223e-02 - 1.51874137660e-02 1.86800926235e-02 2.30804654510e-02 2.84935612207e-02 3.49654910486e-02 4.24386109393e-02 - 5.07121410456e-02 5.94150808572e-02 6.80033074139e-02 7.57970302390e-02 8.20645507484e-02 8.61408122915e-02 - 8.75562567048e-02 8.61408122915e-02 8.20645507484e-02 7.57970302390e-02 6.80033074139e-02 5.94150808572e-02 - 4.80406383964e-02 4.03527020822e-02 3.34242157073e-02 2.74372089612e-02 2.24420850452e-02 1.83921353899e-02 - 1.51874137660e-02 1.27148275869e-02 1.08706042529e-02 9.56702175361e-03 8.73551184506e-03 8.33057919998e-03 - 8.33057919998e-03 8.73551184506e-03 9.56702175361e-03 1.08706042529e-02 1.27148275869e-02 1.51874137660e-02 - 1.83921353899e-02 2.24420850452e-02 2.74372089612e-02 3.34242157073e-02 4.03527020822e-02 4.80406383964e-02 - 5.61547897924e-02 6.42180018992e-02 7.16581855164e-02 7.78881394404e-02 8.23828782457e-02 8.47410728024e-02 - 8.47410728024e-02 8.23828782457e-02 7.78881394404e-02 7.16581855164e-02 6.42180018992e-02 5.61547897924e-02 - 4.60731359718e-02 3.90350130516e-02 3.26363277502e-02 2.70827915169e-02 2.24420850452e-02 1.86800926235e-02 - 1.57094271493e-02 1.34318126710e-02 1.17590249893e-02 1.06181928008e-02 9.95507847617e-03 9.73748464183e-03 - 9.95507847617e-03 1.06181928008e-02 1.17590249893e-02 1.34318126710e-02 1.57094271493e-02 1.86800926235e-02 - 2.24420850452e-02 2.70827915169e-02 3.26363277502e-02 3.90350130516e-02 4.60731359718e-02 5.33923081840e-02 - 6.05090723285e-02 6.69101294891e-02 7.21810172465e-02 7.60705845667e-02 7.84511058955e-02 7.92532152557e-02 - 7.84511058955e-02 7.60705845667e-02 7.21810172465e-02 6.69101294891e-02 6.05090723285e-02 5.33923081840e-02 - 4.50208900473e-02 3.85829474965e-02 3.26363277502e-02 2.74372089612e-02 2.30804654510e-02 1.95479913088e-02 - 1.67669692380e-02 1.46550533623e-02 1.31397287366e-02 1.21629507848e-02 1.16845233837e-02 1.16845233837e-02 - 1.21629507848e-02 1.31397287366e-02 1.46550533623e-02 1.67669692380e-02 1.95479913088e-02 2.30804654510e-02 - 2.74372089612e-02 3.26363277502e-02 3.85829474965e-02 4.50208900473e-02 5.15101646150e-02 5.74676014035e-02 - 6.23288110708e-02 6.57918464265e-02 6.79419572879e-02 6.91119067669e-02 6.96179820017e-02 6.96179820017e-02 - 6.91119067669e-02 6.79419572879e-02 6.57918464265e-02 6.23288110708e-02 5.74676014035e-02 5.15101646150e-02 - 4.50208900473e-02 3.90350130516e-02 3.34242157073e-02 2.84935612207e-02 2.43576039836e-02 2.10090352784e-02 - 1.83878553878e-02 1.64272283654e-02 1.50702461704e-02 1.42737851127e-02 1.40112393540e-02 1.42737851127e-02 - 1.50702461704e-02 1.64272283654e-02 1.83878553878e-02 2.10090352784e-02 2.43576039836e-02 2.84935612207e-02 - 3.34242157073e-02 3.90350130516e-02 4.50208900473e-02 5.08390344517e-02 5.57363453523e-02 5.89627863020e-02 - 6.01752681104e-02 5.97323039443e-02 5.85232784436e-02 5.74463352203e-02 5.70355201353e-02 5.74463352203e-02 - 5.85232784436e-02 5.97323039443e-02 6.01752681104e-02 5.89627863020e-02 5.57363453523e-02 5.08390344517e-02 - 4.60731359718e-02 4.03527020822e-02 3.49654910486e-02 3.02357338101e-02 2.62778950395e-02 2.30866420056e-02 - 2.06126999880e-02 1.88049742175e-02 1.76229803621e-02 1.70389543521e-02 1.70389543521e-02 1.76229803621e-02 - 1.88049742175e-02 2.06126999880e-02 2.30866420056e-02 2.62778950395e-02 3.02357338101e-02 3.49654910486e-02 - 4.03527020822e-02 4.60731359718e-02 5.15101646150e-02 5.57363453523e-02 5.77208882781e-02 5.68740665481e-02 - 5.36149267734e-02 4.93308963719e-02 4.56222411881e-02 4.35588929466e-02 4.35588929466e-02 4.56222411881e-02 - 4.93308963719e-02 5.36149267734e-02 5.68740665481e-02 5.77208882781e-02 5.57363453523e-02 5.15101646150e-02 - 4.80406383964e-02 4.24386109393e-02 3.72078996967e-02 3.26483588385e-02 2.88533907006e-02 2.58139075627e-02 - 2.34923498457e-02 2.18557815330e-02 2.08820531014e-02 2.05587788214e-02 2.08820531014e-02 2.18557815330e-02 - 2.34923498457e-02 2.58139075627e-02 2.88533907006e-02 3.26483588385e-02 3.72078996967e-02 4.24386109393e-02 - 4.80406383964e-02 5.33923081840e-02 5.74676014035e-02 5.89627863020e-02 5.68740665481e-02 5.13523903781e-02 - 4.40123223759e-02 3.71417160544e-02 3.25101129901e-02 3.09103717113e-02 3.25101129901e-02 3.71417160544e-02 - 4.40123223759e-02 5.13523903781e-02 5.68740665481e-02 5.89627863020e-02 5.74676014035e-02 5.33923081840e-02 - 5.07121410456e-02 4.51788789706e-02 4.01041807768e-02 3.57259716101e-02 3.21049723875e-02 2.92302840650e-02 - 2.70818268649e-02 2.56499234494e-02 2.49333108373e-02 2.49333108373e-02 2.56499234494e-02 2.70818268649e-02 - 2.92302840650e-02 3.21049723875e-02 3.57259716101e-02 4.01041807768e-02 4.51788789706e-02 5.07121410456e-02 - 5.61547897924e-02 6.05090723285e-02 6.23288110708e-02 6.01752681104e-02 5.36149267734e-02 4.40123223759e-02 - 3.40771392673e-02 2.63856510811e-02 2.23413746600e-02 2.23413746600e-02 2.63856510811e-02 3.40771392673e-02 - 4.40123223759e-02 5.36149267734e-02 6.01752681104e-02 6.23288110708e-02 6.05090723285e-02 5.61547897924e-02 - 5.38883507401e-02 4.84855850881e-02 4.36277000850e-02 3.94725484932e-02 3.60511821341e-02 3.33624200108e-02 - 3.14154606035e-02 3.02323588099e-02 2.98349904445e-02 3.02323588099e-02 3.14154606035e-02 3.33624200108e-02 - 3.60511821341e-02 3.94725484932e-02 4.36277000850e-02 4.84855850881e-02 5.38883507401e-02 5.94150808572e-02 - 6.42180018992e-02 6.69101294891e-02 6.57918464265e-02 5.97323039443e-02 4.93308963719e-02 3.71417160544e-02 - 2.63856510811e-02 1.93490286376e-02 1.69491736420e-02 1.93490286376e-02 2.63856510811e-02 3.71417160544e-02 - 4.93308963719e-02 5.97323039443e-02 6.57918464265e-02 6.69101294891e-02 6.42180018992e-02 5.94150808572e-02 - 5.74449785733e-02 5.23143637463e-02 4.77625301985e-02 4.38725463784e-02 4.06654278454e-02 3.81729635435e-02 - 3.64535808156e-02 3.55725175924e-02 3.55725175924e-02 3.64535808156e-02 3.81729635435e-02 4.06654278454e-02 - 4.38725463784e-02 4.77625301985e-02 5.23143637463e-02 5.74449785733e-02 6.28828729732e-02 6.80033074139e-02 - 7.16581855164e-02 7.21810172465e-02 6.79419572879e-02 5.85232784436e-02 4.56222411881e-02 3.25101129901e-02 - 2.23413746600e-02 1.69491736420e-02 1.69491736420e-02 2.23413746600e-02 3.25101129901e-02 4.56222411881e-02 - 5.85232784436e-02 6.79419572879e-02 7.21810172465e-02 7.16581855164e-02 6.80033074139e-02 6.28828729732e-02 - 6.13379141192e-02 5.66331890923e-02 5.24477482650e-02 4.88190878681e-02 4.57968161948e-02 4.34838779539e-02 - 4.20165784801e-02 4.15120643887e-02 4.20165784801e-02 4.34838779539e-02 4.57968161948e-02 4.88190878681e-02 - 5.24477482650e-02 5.66331890923e-02 6.13379141192e-02 6.64284767715e-02 7.15201290633e-02 7.57970302390e-02 - 7.78881394404e-02 7.60705845667e-02 6.91119067669e-02 5.74463352203e-02 4.35588929466e-02 3.09103717113e-02 - 2.23413746600e-02 1.93490286376e-02 2.23413746600e-02 3.09103717113e-02 4.35588929466e-02 5.74463352203e-02 - 6.91119067669e-02 7.60705845667e-02 7.78881394404e-02 7.57970302390e-02 7.15201290633e-02 6.64284767715e-02 - 6.55352798807e-02 6.13334872428e-02 5.74762428735e-02 5.40097122002e-02 5.10737783335e-02 4.88987422193e-02 - 4.77311231410e-02 4.77311231410e-02 4.88987422193e-02 5.10737783335e-02 5.40097122002e-02 5.74762428735e-02 - 6.13334872428e-02 6.55352798807e-02 7.00474085615e-02 7.47020608958e-02 7.90236437036e-02 8.20645507484e-02 - 8.23828782457e-02 7.84511058955e-02 6.96179820017e-02 5.70355201353e-02 4.35588929466e-02 3.25101129901e-02 - 2.63856510811e-02 2.63856510811e-02 3.25101129901e-02 4.35588929466e-02 5.70355201353e-02 6.96179820017e-02 - 7.84511058955e-02 8.23828782457e-02 8.20645507484e-02 7.90236437036e-02 7.47020608958e-02 7.00474085615e-02 - 6.98920688762e-02 6.61022866145e-02 6.23688231248e-02 5.88318176265e-02 5.58153453540e-02 5.37510492057e-02 - 5.30133769166e-02 5.37510492057e-02 5.58153453540e-02 5.88318176265e-02 6.23688231248e-02 6.61022866145e-02 - 6.98920688762e-02 7.37387049341e-02 7.76449689484e-02 8.14375530661e-02 8.45957298814e-02 8.61408122915e-02 - 8.47410728024e-02 7.92532152557e-02 6.96179820017e-02 5.74463352203e-02 4.56222411881e-02 3.71417160544e-02 - 3.40771392673e-02 3.71417160544e-02 4.56222411881e-02 5.74463352203e-02 6.96179820017e-02 7.92532152557e-02 - 8.47410728024e-02 8.61408122915e-02 8.45957298814e-02 8.14375530661e-02 7.76449689484e-02 7.37387049341e-02 - 7.40032629540e-02 7.02831021338e-02 6.62522137956e-02 6.22821499923e-02 5.90154969276e-02 5.71527035674e-02 - 5.71527035674e-02 5.90154969276e-02 6.22821499923e-02 6.62522137956e-02 7.02831021338e-02 7.40032629540e-02 - 7.73458021392e-02 8.04193974336e-02 8.33038946145e-02 8.58561529560e-02 8.75716967614e-02 8.75562567048e-02 - 8.47410728024e-02 7.84511058955e-02 6.91119067669e-02 5.85232784436e-02 4.93308963719e-02 4.40123223759e-02 - 4.40123223759e-02 4.93308963719e-02 5.85232784436e-02 6.91119067669e-02 7.84511058955e-02 8.47410728024e-02 - 8.75562567048e-02 8.75716967614e-02 8.58561529560e-02 8.33038946145e-02 8.04193974336e-02 7.73458021392e-02 - 7.70723261920e-02 7.27796836797e-02 6.78442738531e-02 6.30764730892e-02 5.95715936141e-02 5.82782465337e-02 - 5.95715936141e-02 6.30764730892e-02 6.78442738531e-02 7.27796836797e-02 7.70723261920e-02 8.04073084192e-02 - 8.28911486673e-02 8.48028174918e-02 8.63317298438e-02 8.73972293003e-02 8.75716967614e-02 8.61408122915e-02 - 8.23828782457e-02 7.60705845667e-02 6.79419572879e-02 5.97323039443e-02 5.36149267734e-02 5.13523903781e-02 - 5.36149267734e-02 5.97323039443e-02 6.79419572879e-02 7.60705845667e-02 8.23828782457e-02 8.61408122915e-02 - 8.75716967614e-02 8.73972293003e-02 8.63317298438e-02 8.48028174918e-02 8.28911486673e-02 8.04073084192e-02 - 7.78881394404e-02 7.21810172465e-02 6.57918464265e-02 6.01752681104e-02 5.68740665481e-02 5.68740665481e-02 - 6.01752681104e-02 6.57918464265e-02 7.21810172465e-02 7.78881394404e-02 8.20645507484e-02 8.45957298814e-02 - 8.58561529560e-02 8.63317298438e-02 8.63317298438e-02 8.58561529560e-02 8.45957298814e-02 8.20645507484e-02 - 7.78881394404e-02 7.21810172465e-02 6.57918464265e-02 6.01752681104e-02 5.68740665481e-02 5.68740665481e-02 - 6.01752681104e-02 6.57918464265e-02 7.21810172465e-02 7.78881394404e-02 8.20645507484e-02 8.45957298814e-02 - 8.58561529560e-02 8.63317298438e-02 8.63317298438e-02 8.58561529560e-02 8.45957298814e-02 8.20645507484e-02 - 7.51264696898e-02 6.73541476702e-02 5.94868177545e-02 5.36143814352e-02 5.14403532045e-02 5.36143814352e-02 - 5.94868177545e-02 6.73541476702e-02 7.51264696898e-02 8.11458755837e-02 8.47143937707e-02 8.60542685404e-02 - 8.58561529560e-02 8.48028174918e-02 8.33038946145e-02 8.14375530661e-02 7.90236437036e-02 7.57970302390e-02 - 7.16581855164e-02 6.69101294891e-02 6.23288110708e-02 5.89627863020e-02 5.77208882781e-02 5.89627863020e-02 - 6.23288110708e-02 6.69101294891e-02 7.16581855164e-02 7.57970302390e-02 7.90236437036e-02 8.14375530661e-02 - 8.33038946145e-02 8.48028174918e-02 8.58561529560e-02 8.60542685404e-02 8.47143937707e-02 8.11458755837e-02 - 6.81077724909e-02 5.83777841365e-02 4.98718618187e-02 4.49279278957e-02 4.49279278957e-02 4.98718618187e-02 - 5.83777841365e-02 6.81077724909e-02 7.66122811094e-02 8.22656900591e-02 8.47143937707e-02 8.45957298814e-02 - 8.28911486673e-02 8.04193974336e-02 7.76449689484e-02 7.47020608958e-02 7.15201290633e-02 6.80033074139e-02 - 6.42180018992e-02 6.05090723285e-02 5.74676014035e-02 5.57363453523e-02 5.57363453523e-02 5.74676014035e-02 - 6.05090723285e-02 6.42180018992e-02 6.80033074139e-02 7.15201290633e-02 7.47020608958e-02 7.76449689484e-02 - 8.04193974336e-02 8.28911486673e-02 8.45957298814e-02 8.47143937707e-02 8.22656900591e-02 7.66122811094e-02 - 5.76200322747e-02 4.70389926376e-02 3.93541671489e-02 3.65582592974e-02 3.93541671489e-02 4.70389926376e-02 - 5.76200322747e-02 6.83266751007e-02 7.66122811094e-02 8.11458755837e-02 8.20645507484e-02 8.04073084192e-02 - 7.73458021392e-02 7.37387049341e-02 7.00474085615e-02 6.64284767715e-02 6.28828729732e-02 5.94150808572e-02 - 5.61547897924e-02 5.33923081840e-02 5.15101646150e-02 5.08390344517e-02 5.15101646150e-02 5.33923081840e-02 - 5.61547897924e-02 5.94150808572e-02 6.28828729732e-02 6.64284767715e-02 7.00474085615e-02 7.37387049341e-02 - 7.73458021392e-02 8.04073084192e-02 8.20645507484e-02 8.11458755837e-02 7.66122811094e-02 6.83266751007e-02 - 3.09103717113e-02 2.23413746600e-02 1.93490286376e-02 2.23413746600e-02 3.09103717113e-02 4.35588929466e-02 - 5.74463352203e-02 6.91119067669e-02 7.60705845667e-02 7.78881394404e-02 7.57970302390e-02 7.15201290633e-02 - 6.64284767715e-02 6.13379141192e-02 5.66331890923e-02 5.24477482650e-02 4.88190878681e-02 4.57968161948e-02 - 4.34838779539e-02 4.20165784801e-02 4.15120643887e-02 4.20165784801e-02 4.34838779539e-02 4.57968161948e-02 - 4.88190878681e-02 5.24477482650e-02 5.66331890923e-02 6.13379141192e-02 6.64284767715e-02 7.15201290633e-02 - 7.57970302390e-02 7.78881394404e-02 7.60705845667e-02 6.91119067669e-02 5.74463352203e-02 4.35588929466e-02 - 2.23413746600e-02 1.69491736420e-02 1.69491736420e-02 2.23413746600e-02 3.25101129901e-02 4.56222411881e-02 - 5.85232784436e-02 6.79419572879e-02 7.21810172465e-02 7.16581855164e-02 6.80033074139e-02 6.28828729732e-02 - 5.74449785733e-02 5.23143637463e-02 4.77625301985e-02 4.38725463784e-02 4.06654278454e-02 3.81729635435e-02 - 3.64535808156e-02 3.55725175924e-02 3.55725175924e-02 3.64535808156e-02 3.81729635435e-02 4.06654278454e-02 - 4.38725463784e-02 4.77625301985e-02 5.23143637463e-02 5.74449785733e-02 6.28828729732e-02 6.80033074139e-02 - 7.16581855164e-02 7.21810172465e-02 6.79419572879e-02 5.85232784436e-02 4.56222411881e-02 3.25101129901e-02 - 1.93490286376e-02 1.69491736420e-02 1.93490286376e-02 2.63856510811e-02 3.71417160544e-02 4.93308963719e-02 - 5.97323039443e-02 6.57918464265e-02 6.69101294891e-02 6.42180018992e-02 5.94150808572e-02 5.38883507401e-02 - 4.84855850881e-02 4.36277000850e-02 3.94725484932e-02 3.60511821341e-02 3.33624200108e-02 3.14154606035e-02 - 3.02323588099e-02 2.98349904445e-02 3.02323588099e-02 3.14154606035e-02 3.33624200108e-02 3.60511821341e-02 - 3.94725484932e-02 4.36277000850e-02 4.84855850881e-02 5.38883507401e-02 5.94150808572e-02 6.42180018992e-02 - 6.69101294891e-02 6.57918464265e-02 5.97323039443e-02 4.93308963719e-02 3.71417160544e-02 2.63856510811e-02 - 2.23413746600e-02 2.23413746600e-02 2.63856510811e-02 3.40771392673e-02 4.40123223759e-02 5.36149267734e-02 - 6.01752681104e-02 6.23288110708e-02 6.05090723285e-02 5.61547897924e-02 5.07121410456e-02 4.51788789706e-02 - 4.01041807768e-02 3.57259716101e-02 3.21049723875e-02 2.92302840650e-02 2.70818268649e-02 2.56499234494e-02 - 2.49333108373e-02 2.49333108373e-02 2.56499234494e-02 2.70818268649e-02 2.92302840650e-02 3.21049723875e-02 - 3.57259716101e-02 4.01041807768e-02 4.51788789706e-02 5.07121410456e-02 5.61547897924e-02 6.05090723285e-02 - 6.23288110708e-02 6.01752681104e-02 5.36149267734e-02 4.40123223759e-02 3.40771392673e-02 2.63856510811e-02 - 3.09103717113e-02 3.25101129901e-02 3.71417160544e-02 4.40123223759e-02 5.13523903781e-02 5.68740665481e-02 - 5.89627863020e-02 5.74676014035e-02 5.33923081840e-02 4.80406383964e-02 4.24386109393e-02 3.72078996967e-02 - 3.26483588385e-02 2.88533907006e-02 2.58139075627e-02 2.34923498457e-02 2.18557815330e-02 2.08820531014e-02 - 2.05587788214e-02 2.08820531014e-02 2.18557815330e-02 2.34923498457e-02 2.58139075627e-02 2.88533907006e-02 - 3.26483588385e-02 3.72078996967e-02 4.24386109393e-02 4.80406383964e-02 5.33923081840e-02 5.74676014035e-02 - 5.89627863020e-02 5.68740665481e-02 5.13523903781e-02 4.40123223759e-02 3.71417160544e-02 3.25101129901e-02 - 4.35588929466e-02 4.56222411881e-02 4.93308963719e-02 5.36149267734e-02 5.68740665481e-02 5.77208882781e-02 - 5.57363453523e-02 5.15101646150e-02 4.60731359718e-02 4.03527020822e-02 3.49654910486e-02 3.02357338101e-02 - 2.62778950395e-02 2.30866420056e-02 2.06126999880e-02 1.88049742175e-02 1.76229803621e-02 1.70389543521e-02 - 1.70389543521e-02 1.76229803621e-02 1.88049742175e-02 2.06126999880e-02 2.30866420056e-02 2.62778950395e-02 - 3.02357338101e-02 3.49654910486e-02 4.03527020822e-02 4.60731359718e-02 5.15101646150e-02 5.57363453523e-02 - 5.77208882781e-02 5.68740665481e-02 5.36149267734e-02 4.93308963719e-02 4.56222411881e-02 4.35588929466e-02 - 5.74463352203e-02 5.85232784436e-02 5.97323039443e-02 6.01752681104e-02 5.89627863020e-02 5.57363453523e-02 - 5.08390344517e-02 4.50208900473e-02 3.90350130516e-02 3.34242157073e-02 2.84935612207e-02 2.43576039836e-02 - 2.10090352784e-02 1.83878553878e-02 1.64272283654e-02 1.50702461704e-02 1.42737851127e-02 1.40112393540e-02 - 1.42737851127e-02 1.50702461704e-02 1.64272283654e-02 1.83878553878e-02 2.10090352784e-02 2.43576039836e-02 - 2.84935612207e-02 3.34242157073e-02 3.90350130516e-02 4.50208900473e-02 5.08390344517e-02 5.57363453523e-02 - 5.89627863020e-02 6.01752681104e-02 5.97323039443e-02 5.85232784436e-02 5.74463352203e-02 5.70355201353e-02 - 6.91119067669e-02 6.79419572879e-02 6.57918464265e-02 6.23288110708e-02 5.74676014035e-02 5.15101646150e-02 - 4.50208900473e-02 3.85829474965e-02 3.26363277502e-02 2.74372089612e-02 2.30804654510e-02 1.95479913088e-02 - 1.67669692380e-02 1.46550533623e-02 1.31397287366e-02 1.21629507848e-02 1.16845233837e-02 1.16845233837e-02 - 1.21629507848e-02 1.31397287366e-02 1.46550533623e-02 1.67669692380e-02 1.95479913088e-02 2.30804654510e-02 - 2.74372089612e-02 3.26363277502e-02 3.85829474965e-02 4.50208900473e-02 5.15101646150e-02 5.74676014035e-02 - 6.23288110708e-02 6.57918464265e-02 6.79419572879e-02 6.91119067669e-02 6.96179820017e-02 6.96179820017e-02 - 7.60705845667e-02 7.21810172465e-02 6.69101294891e-02 6.05090723285e-02 5.33923081840e-02 4.60731359718e-02 - 3.90350130516e-02 3.26363277502e-02 2.70827915169e-02 2.24420850452e-02 1.86800926235e-02 1.57094271493e-02 - 1.34318126710e-02 1.17590249893e-02 1.06181928008e-02 9.95507847617e-03 9.73748464183e-03 9.95507847617e-03 - 1.06181928008e-02 1.17590249893e-02 1.34318126710e-02 1.57094271493e-02 1.86800926235e-02 2.24420850452e-02 - 2.70827915169e-02 3.26363277502e-02 3.90350130516e-02 4.60731359718e-02 5.33923081840e-02 6.05090723285e-02 - 6.69101294891e-02 7.21810172465e-02 7.60705845667e-02 7.84511058955e-02 7.92532152557e-02 7.84511058955e-02 - 7.78881394404e-02 7.16581855164e-02 6.42180018992e-02 5.61547897924e-02 4.80406383964e-02 4.03527020822e-02 - 3.34242157073e-02 2.74372089612e-02 2.24420850452e-02 1.83921353899e-02 1.51874137660e-02 1.27148275869e-02 - 1.08706042529e-02 9.56702175361e-03 8.73551184506e-03 8.33057919998e-03 8.33057919998e-03 8.73551184506e-03 - 9.56702175361e-03 1.08706042529e-02 1.27148275869e-02 1.51874137660e-02 1.83921353899e-02 2.24420850452e-02 - 2.74372089612e-02 3.34242157073e-02 4.03527020822e-02 4.80406383964e-02 5.61547897924e-02 6.42180018992e-02 - 7.16581855164e-02 7.78881394404e-02 8.23828782457e-02 8.47410728024e-02 8.47410728024e-02 8.23828782457e-02 - 7.57970302390e-02 6.80033074139e-02 5.94150808572e-02 5.07121410456e-02 4.24386109393e-02 3.49654910486e-02 - 2.84935612207e-02 2.30804654510e-02 1.86800926235e-02 1.51874137660e-02 1.24785638223e-02 1.04356792319e-02 - 8.95658363692e-03 7.95863052826e-03 7.38252390656e-03 7.19410390186e-03 7.38252390656e-03 7.95863052826e-03 - 8.95658363692e-03 1.04356792319e-02 1.24785638223e-02 1.51874137660e-02 1.86800926235e-02 2.30804654510e-02 - 2.84935612207e-02 3.49654910486e-02 4.24386109393e-02 5.07121410456e-02 5.94150808572e-02 6.80033074139e-02 - 7.57970302390e-02 8.20645507484e-02 8.61408122915e-02 8.75562567048e-02 8.61408122915e-02 8.20645507484e-02 - 7.15201290633e-02 6.28828729732e-02 5.38883507401e-02 4.51788789706e-02 3.72078996967e-02 3.02357338101e-02 - 2.43576039836e-02 1.95479913088e-02 1.57094271493e-02 1.27148275869e-02 1.04356792319e-02 8.75631776595e-03 - 7.58058258839e-03 6.83583874198e-03 6.47483593539e-03 6.47483593539e-03 6.83583874198e-03 7.58058258839e-03 - 8.75631776595e-03 1.04356792319e-02 1.27148275869e-02 1.57094271493e-02 1.95479913088e-02 2.43576039836e-02 - 3.02357338101e-02 3.72078996967e-02 4.51788789706e-02 5.38883507401e-02 6.28828729732e-02 7.15201290633e-02 - 7.90236437036e-02 8.45957298814e-02 8.75716967614e-02 8.75716967614e-02 8.45957298814e-02 7.90236437036e-02 - 6.64284767715e-02 5.74449785733e-02 4.84855850881e-02 4.01041807768e-02 3.26483588385e-02 2.62778950395e-02 - 2.10090352784e-02 1.67669692380e-02 1.34318126710e-02 1.08706042529e-02 8.95658363692e-03 7.58058258839e-03 - 6.65719946009e-03 6.12657930585e-03 5.95356833121e-03 6.12657930585e-03 6.65719946009e-03 7.58058258839e-03 - 8.95658363692e-03 1.08706042529e-02 1.34318126710e-02 1.67669692380e-02 2.10090352784e-02 2.62778950395e-02 - 3.26483588385e-02 4.01041807768e-02 4.84855850881e-02 5.74449785733e-02 6.64284767715e-02 7.47020608958e-02 - 8.14375530661e-02 8.58561529560e-02 8.73972293003e-02 8.58561529560e-02 8.14375530661e-02 7.47020608958e-02 - 6.13379141192e-02 5.23143637463e-02 4.36277000850e-02 3.57259716101e-02 2.88533907006e-02 2.30866420056e-02 - 1.83878553878e-02 1.46550533623e-02 1.17590249893e-02 9.56702175361e-03 7.95863052827e-03 6.83583874198e-03 - 6.12657930585e-03 5.78371930190e-03 5.78371930190e-03 6.12657930585e-03 6.83583874198e-03 7.95863052826e-03 - 9.56702175361e-03 1.17590249893e-02 1.46550533623e-02 1.83878553878e-02 2.30866420056e-02 2.88533907006e-02 - 3.57259716101e-02 4.36277000850e-02 5.23143637463e-02 6.13379141192e-02 7.00474085615e-02 7.76449689484e-02 - 8.33038946145e-02 8.63317298438e-02 8.63317298438e-02 8.33038946145e-02 7.76449689484e-02 7.00474085615e-02 - 5.66331890923e-02 4.77625301985e-02 3.94725484932e-02 3.21049723875e-02 2.58139075627e-02 2.06126999880e-02 - 1.64272283654e-02 1.31397287366e-02 1.06181928008e-02 8.73551184506e-03 7.38252390656e-03 6.47483593539e-03 - 5.95356833121e-03 5.78371930190e-03 5.95356833121e-03 6.47483593539e-03 7.38252390656e-03 8.73551184506e-03 - 1.06181928008e-02 1.31397287366e-02 1.64272283654e-02 2.06126999880e-02 2.58139075627e-02 3.21049723875e-02 - 3.94725484932e-02 4.77625301985e-02 5.66331890923e-02 6.55352798807e-02 7.37387049341e-02 8.04193974336e-02 - 8.48028174918e-02 8.63317298438e-02 8.48028174918e-02 8.04193974336e-02 7.37387049341e-02 6.55352798807e-02 - 5.24477482650e-02 4.38725463784e-02 3.60511821341e-02 2.92302840650e-02 2.34923498457e-02 1.88049742175e-02 - 1.50702461704e-02 1.21629507848e-02 9.95507847617e-03 8.33057919998e-03 7.19410390186e-03 6.47483593539e-03 - 6.12657930585e-03 6.12657930585e-03 6.47483593539e-03 7.19410390186e-03 8.33057919998e-03 9.95507847617e-03 - 1.21629507848e-02 1.50702461704e-02 1.88049742175e-02 2.34923498457e-02 2.92302840650e-02 3.60511821341e-02 - 4.38725463784e-02 5.24477482650e-02 6.13334872428e-02 6.98920688762e-02 7.73458021392e-02 8.28911486673e-02 - 8.58561529560e-02 8.58561529560e-02 8.28911486673e-02 7.73458021392e-02 6.98920688762e-02 6.13334872428e-02 - 4.88190878681e-02 4.06654278454e-02 3.33624200108e-02 2.70818268649e-02 2.18557815330e-02 1.76229803621e-02 - 1.42737851127e-02 1.16845233837e-02 9.73748464183e-03 8.33057919998e-03 7.38252390656e-03 6.83583874198e-03 - 6.65719946009e-03 6.83583874198e-03 7.38252390656e-03 8.33057919998e-03 9.73748464183e-03 1.16845233837e-02 - 1.42737851127e-02 1.76229803621e-02 2.18557815330e-02 2.70818268649e-02 3.33624200108e-02 4.06654278454e-02 - 4.88190878681e-02 5.74762428735e-02 6.61022866145e-02 7.40032629540e-02 8.04073084192e-02 8.45957298814e-02 - 8.60542685404e-02 8.45957298814e-02 8.04073084192e-02 7.40032629540e-02 6.61022866145e-02 5.74762428735e-02 - 4.57968161948e-02 3.81729635435e-02 3.14154606035e-02 2.56499234494e-02 2.08820531014e-02 1.70389543521e-02 - 1.40112393540e-02 1.16845233837e-02 9.95507847617e-03 8.73551184506e-03 7.95863052826e-03 7.58058258839e-03 - 7.58058258839e-03 7.95863052826e-03 8.73551184506e-03 9.95507847617e-03 1.16845233837e-02 1.40112393540e-02 - 1.70389543521e-02 2.08820531014e-02 2.56499234494e-02 3.14154606035e-02 3.81729635435e-02 4.57968161948e-02 - 5.40097122002e-02 6.23688231248e-02 7.02831021338e-02 7.70723261920e-02 8.20645507484e-02 8.47143937707e-02 - 8.47143937707e-02 8.20645507484e-02 7.70723261920e-02 7.02831021338e-02 6.23688231248e-02 5.40097122002e-02 - 4.34838779539e-02 3.64535808156e-02 3.02323588099e-02 2.49333108373e-02 2.05587788214e-02 1.70389543521e-02 - 1.42737851127e-02 1.21629507848e-02 1.06181928008e-02 9.56702175361e-03 8.95658363692e-03 8.75631776595e-03 - 8.95658363692e-03 9.56702175361e-03 1.06181928008e-02 1.21629507848e-02 1.42737851127e-02 1.70389543521e-02 - 2.05587788214e-02 2.49333108373e-02 3.02323588099e-02 3.64535808156e-02 4.34838779539e-02 5.10737783335e-02 - 5.88318176265e-02 6.62522137956e-02 7.27796836797e-02 7.78881394404e-02 8.11458755837e-02 8.22656900591e-02 - 8.11458755837e-02 7.78881394404e-02 7.27796836797e-02 6.62522137956e-02 5.88318176265e-02 5.10737783335e-02 - 4.20165784801e-02 3.55725175924e-02 2.98349904445e-02 2.49333108373e-02 2.08820531014e-02 1.76229803621e-02 - 1.50702461704e-02 1.31397287366e-02 1.17590249893e-02 1.08706042529e-02 1.04356792319e-02 1.04356792319e-02 - 1.08706042529e-02 1.17590249893e-02 1.31397287366e-02 1.50702461704e-02 1.76229803621e-02 2.08820531014e-02 - 2.49333108373e-02 2.98349904445e-02 3.55725175924e-02 4.20165784801e-02 4.88987422193e-02 5.58153453540e-02 - 6.22821499923e-02 6.78442738531e-02 7.21810172465e-02 7.51264696898e-02 7.66122811094e-02 7.66122811094e-02 - 7.51264696898e-02 7.21810172465e-02 6.78442738531e-02 6.22821499923e-02 5.58153453540e-02 4.88987422193e-02 - 4.15120643887e-02 3.55725175924e-02 3.02323588099e-02 2.56499234494e-02 2.18557815330e-02 1.88049742175e-02 - 1.64272283654e-02 1.46550533623e-02 1.34318126710e-02 1.27148275869e-02 1.24785638223e-02 1.27148275869e-02 - 1.34318126710e-02 1.46550533623e-02 1.64272283654e-02 1.88049742175e-02 2.18557815330e-02 2.56499234494e-02 - 3.02323588099e-02 3.55725175924e-02 4.15120643887e-02 4.77311231410e-02 5.37510492057e-02 5.90154969276e-02 - 6.30764730892e-02 6.57918464265e-02 6.73541476702e-02 6.81077724909e-02 6.83266751007e-02 6.81077724909e-02 - 6.73541476702e-02 6.57918464265e-02 6.30764730892e-02 5.90154969276e-02 5.37510492057e-02 4.77311231410e-02 - 4.20165784801e-02 3.64535808156e-02 3.14154606035e-02 2.70818268649e-02 2.34923498457e-02 2.06126999880e-02 - 1.83878553878e-02 1.67669692380e-02 1.57094271493e-02 1.51874137660e-02 1.51874137660e-02 1.57094271493e-02 - 1.67669692380e-02 1.83878553878e-02 2.06126999880e-02 2.34923498457e-02 2.70818268649e-02 3.14154606035e-02 - 3.64535808156e-02 4.20165784801e-02 4.77311231410e-02 5.30133769166e-02 5.71527035674e-02 5.95715936141e-02 - 6.01752681104e-02 5.94868177545e-02 5.83777841365e-02 5.76200322747e-02 5.76200322747e-02 5.83777841365e-02 - 5.94868177545e-02 6.01752681104e-02 5.95715936141e-02 5.71527035674e-02 5.30133769166e-02 4.77311231410e-02 - 4.34838779539e-02 3.81729635435e-02 3.33624200108e-02 2.92302840650e-02 2.58139075627e-02 2.30866420056e-02 - 2.10090352784e-02 1.95479913088e-02 1.86800926235e-02 1.83921353899e-02 1.86800926235e-02 1.95479913088e-02 - 2.10090352784e-02 2.30866420056e-02 2.58139075627e-02 2.92302840650e-02 3.33624200108e-02 3.81729635435e-02 - 4.34838779539e-02 4.88987422193e-02 5.37510492057e-02 5.71527035674e-02 5.82782465337e-02 5.68740665481e-02 - 5.36143814352e-02 4.98718618187e-02 4.70389926376e-02 4.60013609401e-02 4.70389926376e-02 4.98718618187e-02 - 5.36143814352e-02 5.68740665481e-02 5.82782465337e-02 5.71527035674e-02 5.37510492057e-02 4.88987422193e-02 - 4.57968161948e-02 4.06654278454e-02 3.60511821341e-02 3.21049723875e-02 2.88533907006e-02 2.62778950395e-02 - 2.43576039836e-02 2.30804654510e-02 2.24420850452e-02 2.24420850452e-02 2.30804654510e-02 2.43576039836e-02 - 2.62778950395e-02 2.88533907006e-02 3.21049723875e-02 3.60511821341e-02 4.06654278454e-02 4.57968161948e-02 - 5.10737783335e-02 5.58153453540e-02 5.90154969276e-02 5.95715936141e-02 5.68740665481e-02 5.14403532045e-02 - 4.49279278957e-02 3.93541671489e-02 3.62214481565e-02 3.62214481565e-02 3.93541671489e-02 4.49279278957e-02 - 5.14403532045e-02 5.68740665481e-02 5.95715936141e-02 5.90154969276e-02 5.58153453540e-02 5.10737783335e-02 - 4.88190878681e-02 4.38725463784e-02 3.94725484932e-02 3.57259716101e-02 3.26483588385e-02 3.02357338101e-02 - 2.84935612207e-02 2.74372089612e-02 2.70827915169e-02 2.74372089612e-02 2.84935612207e-02 3.02357338101e-02 - 3.26483588385e-02 3.57259716101e-02 3.94725484932e-02 4.38725463784e-02 4.88190878681e-02 5.40097122002e-02 - 5.88318176265e-02 6.22821499923e-02 6.30764730892e-02 6.01752681104e-02 5.36143814352e-02 4.49279278957e-02 - 3.65582592974e-02 3.07039905741e-02 2.86292518106e-02 3.07039905741e-02 3.65582592974e-02 4.49279278957e-02 - 5.36143814352e-02 6.01752681104e-02 6.30764730892e-02 6.22821499923e-02 5.88318176265e-02 5.40097122002e-02 - 5.24477482650e-02 4.77625301985e-02 4.36277000850e-02 4.01041807768e-02 3.72078996967e-02 3.49654910486e-02 - 3.34242157073e-02 3.26363277502e-02 3.26363277502e-02 3.34242157073e-02 3.49654910486e-02 3.72078996967e-02 - 4.01041807768e-02 4.36277000850e-02 4.77625301985e-02 5.24477482650e-02 5.74762428735e-02 6.23688231248e-02 - 6.62522137956e-02 6.78442738531e-02 6.57918464265e-02 5.94868177545e-02 4.98718618187e-02 3.93541671489e-02 - 3.07039905741e-02 2.59250062413e-02 2.59250062413e-02 3.07039905741e-02 3.93541671489e-02 4.98718618187e-02 - 5.94868177545e-02 6.57918464265e-02 6.78442738531e-02 6.62522137956e-02 6.23688231248e-02 5.74762428735e-02 - 5.66331890923e-02 5.23143637463e-02 4.84855850881e-02 4.51788789706e-02 4.24386109393e-02 4.03527020822e-02 - 3.90350130516e-02 3.85829474965e-02 3.90350130516e-02 4.03527020822e-02 4.24386109393e-02 4.51788789706e-02 - 4.84855850881e-02 5.23143637463e-02 5.66331890923e-02 6.13334872428e-02 6.61022866145e-02 7.02831021338e-02 - 7.27796836797e-02 7.21810172465e-02 6.73541476702e-02 5.83777841365e-02 4.70389926376e-02 3.62214481565e-02 - 2.86292518106e-02 2.59250062413e-02 2.86292518106e-02 3.62214481565e-02 4.70389926376e-02 5.83777841365e-02 - 6.73541476702e-02 7.21810172465e-02 7.27796836797e-02 7.02831021338e-02 6.61022866145e-02 6.13334872428e-02 - 6.13379141192e-02 5.74449785733e-02 5.38883507401e-02 5.07121410456e-02 4.80406383964e-02 4.60731359718e-02 - 4.50208900473e-02 4.50208900473e-02 4.60731359718e-02 4.80406383964e-02 5.07121410456e-02 5.38883507401e-02 - 5.74449785733e-02 6.13379141192e-02 6.55352798807e-02 6.98920688762e-02 7.40032629540e-02 7.70723261920e-02 - 7.78881394404e-02 7.51264696898e-02 6.81077724909e-02 5.76200322747e-02 4.60013609401e-02 3.62214481565e-02 - 3.07039905741e-02 3.07039905741e-02 3.62214481565e-02 4.60013609401e-02 5.76200322747e-02 6.81077724909e-02 - 7.51264696898e-02 7.78881394404e-02 7.70723261920e-02 7.40032629540e-02 6.98920688762e-02 6.55352798807e-02 - 6.64284767715e-02 6.28828729732e-02 5.94150808572e-02 5.61547897924e-02 5.33923081840e-02 5.15101646150e-02 - 5.08390344517e-02 5.15101646150e-02 5.33923081840e-02 5.61547897924e-02 5.94150808572e-02 6.28828729732e-02 - 6.64284767715e-02 7.00474085615e-02 7.37387049341e-02 7.73458021392e-02 8.04073084192e-02 8.20645507484e-02 - 8.11458755837e-02 7.66122811094e-02 6.83266751007e-02 5.76200322747e-02 4.70389926376e-02 3.93541671489e-02 - 3.65582592974e-02 3.93541671489e-02 4.70389926376e-02 5.76200322747e-02 6.83266751007e-02 7.66122811094e-02 - 8.11458755837e-02 8.20645507484e-02 8.04073084192e-02 7.73458021392e-02 7.37387049341e-02 7.00474085615e-02 - 7.15201290633e-02 6.80033074139e-02 6.42180018992e-02 6.05090723285e-02 5.74676014035e-02 5.57363453523e-02 - 5.57363453523e-02 5.74676014035e-02 6.05090723285e-02 6.42180018992e-02 6.80033074139e-02 7.15201290633e-02 - 7.47020608958e-02 7.76449689484e-02 8.04193974336e-02 8.28911486673e-02 8.45957298814e-02 8.47143937707e-02 - 8.22656900591e-02 7.66122811094e-02 6.81077724909e-02 5.83777841365e-02 4.98718618187e-02 4.49279278957e-02 - 4.49279278957e-02 4.98718618187e-02 5.83777841365e-02 6.81077724909e-02 7.66122811094e-02 8.22656900591e-02 - 8.47143937707e-02 8.45957298814e-02 8.28911486673e-02 8.04193974336e-02 7.76449689484e-02 7.47020608958e-02 - 7.57970302390e-02 7.16581855164e-02 6.69101294891e-02 6.23288110708e-02 5.89627863020e-02 5.77208882781e-02 - 5.89627863020e-02 6.23288110708e-02 6.69101294891e-02 7.16581855164e-02 7.57970302390e-02 7.90236437036e-02 - 8.14375530661e-02 8.33038946145e-02 8.48028174918e-02 8.58561529560e-02 8.60542685404e-02 8.47143937707e-02 - 8.11458755837e-02 7.51264696898e-02 6.73541476702e-02 5.94868177545e-02 5.36143814352e-02 5.14403532045e-02 - 5.36143814352e-02 5.94868177545e-02 6.73541476702e-02 7.51264696898e-02 8.11458755837e-02 8.47143937707e-02 - 8.60542685404e-02 8.58561529560e-02 8.48028174918e-02 8.33038946145e-02 8.14375530661e-02 7.90236437036e-02 - 7.78881394404e-02 7.21810172465e-02 6.57918464265e-02 6.01752681104e-02 5.68740665481e-02 5.68740665481e-02 - 6.01752681104e-02 6.57918464265e-02 7.21810172465e-02 7.78881394404e-02 8.20645507484e-02 8.45957298814e-02 - 8.58561529560e-02 8.63317298438e-02 8.63317298438e-02 8.58561529560e-02 8.45957298814e-02 8.20645507484e-02 - 7.78881394404e-02 7.21810172465e-02 6.57918464265e-02 6.01752681104e-02 5.68740665481e-02 5.68740665481e-02 - 6.01752681104e-02 6.57918464265e-02 7.21810172465e-02 7.78881394404e-02 8.20645507484e-02 8.45957298814e-02 - 8.58561529560e-02 8.63317298438e-02 8.63317298438e-02 8.58561529560e-02 8.45957298814e-02 8.20645507484e-02 - 7.60705845667e-02 6.79419572879e-02 5.97323039443e-02 5.36149267734e-02 5.13523903781e-02 5.36149267734e-02 - 5.97323039443e-02 6.79419572879e-02 7.60705845667e-02 8.23828782457e-02 8.61408122915e-02 8.75716967614e-02 - 8.73972293003e-02 8.63317298438e-02 8.48028174918e-02 8.28911486673e-02 8.04073084192e-02 7.70723261920e-02 - 7.27796836797e-02 6.78442738531e-02 6.30764730892e-02 5.95715936141e-02 5.82782465337e-02 5.95715936141e-02 - 6.30764730892e-02 6.78442738531e-02 7.27796836797e-02 7.70723261920e-02 8.04073084192e-02 8.28911486673e-02 - 8.48028174918e-02 8.63317298438e-02 8.73972293003e-02 8.75716967614e-02 8.61408122915e-02 8.23828782457e-02 - 6.91119067669e-02 5.85232784436e-02 4.93308963719e-02 4.40123223759e-02 4.40123223759e-02 4.93308963719e-02 - 5.85232784436e-02 6.91119067669e-02 7.84511058955e-02 8.47410728024e-02 8.75562567048e-02 8.75716967614e-02 - 8.58561529560e-02 8.33038946145e-02 8.04193974336e-02 7.73458021392e-02 7.40032629540e-02 7.02831021338e-02 - 6.62522137956e-02 6.22821499923e-02 5.90154969276e-02 5.71527035674e-02 5.71527035674e-02 5.90154969276e-02 - 6.22821499923e-02 6.62522137956e-02 7.02831021338e-02 7.40032629540e-02 7.73458021392e-02 8.04193974336e-02 - 8.33038946145e-02 8.58561529560e-02 8.75716967614e-02 8.75562567048e-02 8.47410728024e-02 7.84511058955e-02 - 5.74463352203e-02 4.56222411881e-02 3.71417160544e-02 3.40771392673e-02 3.71417160544e-02 4.56222411881e-02 - 5.74463352203e-02 6.96179820017e-02 7.92532152557e-02 8.47410728024e-02 8.61408122915e-02 8.45957298814e-02 - 8.14375530661e-02 7.76449689484e-02 7.37387049341e-02 6.98920688762e-02 6.61022866145e-02 6.23688231248e-02 - 5.88318176265e-02 5.58153453540e-02 5.37510492057e-02 5.30133769166e-02 5.37510492057e-02 5.58153453540e-02 - 5.88318176265e-02 6.23688231248e-02 6.61022866145e-02 6.98920688762e-02 7.37387049341e-02 7.76449689484e-02 - 8.14375530661e-02 8.45957298814e-02 8.61408122915e-02 8.47410728024e-02 7.92532152557e-02 6.96179820017e-02 - 4.35588929466e-02 3.25101129901e-02 2.63856510811e-02 2.63856510811e-02 3.25101129901e-02 4.35588929466e-02 - 5.70355201353e-02 6.96179820017e-02 7.84511058955e-02 8.23828782457e-02 8.20645507484e-02 7.90236437036e-02 - 7.47020608958e-02 7.00474085615e-02 6.55352798807e-02 6.13334872428e-02 5.74762428735e-02 5.40097122002e-02 - 5.10737783335e-02 4.88987422193e-02 4.77311231410e-02 4.77311231410e-02 4.88987422193e-02 5.10737783335e-02 - 5.40097122002e-02 5.74762428735e-02 6.13334872428e-02 6.55352798807e-02 7.00474085615e-02 7.47020608958e-02 - 7.90236437036e-02 8.20645507484e-02 8.23828782457e-02 7.84511058955e-02 6.96179820017e-02 5.70355201353e-02 - 1.69819929531e-02 1.14596764125e-02 1.14596764125e-02 1.69819929531e-02 2.77489957459e-02 4.22847991283e-02 - 5.73653289979e-02 6.91119067669e-02 7.51264696898e-02 7.55368812409e-02 7.21264918488e-02 6.68641206041e-02 - 6.11288569567e-02 5.56676247698e-02 5.08044555558e-02 4.66403070569e-02 4.32002938784e-02 4.05199675384e-02 - 3.86662855632e-02 3.77147526395e-02 3.77147526395e-02 3.86662855632e-02 4.05199675384e-02 4.32002938784e-02 - 4.66403070569e-02 5.08044555558e-02 5.56676247698e-02 6.11288569567e-02 6.68641206041e-02 7.21264918488e-02 - 7.55368812409e-02 7.51264696898e-02 6.91119067669e-02 5.73653289979e-02 4.22847991283e-02 2.77489957459e-02 - 1.14596764125e-02 9.05419851032e-03 1.14596764125e-02 1.87771308641e-02 3.06594619284e-02 4.51254329663e-02 - 5.85232784436e-02 6.73541476702e-02 7.03019494995e-02 6.84139609392e-02 6.37149803432e-02 5.79474348197e-02 - 5.21839135623e-02 4.69561004766e-02 4.24686468881e-02 3.87673596218e-02 3.58537824974e-02 3.37399765679e-02 - 3.24534608631e-02 3.20210145144e-02 3.24534608631e-02 3.37399765679e-02 3.58537824974e-02 3.87673596218e-02 - 4.24686468881e-02 4.69561004766e-02 5.21839135623e-02 5.79474348197e-02 6.37149803432e-02 6.84139609392e-02 - 7.03019494995e-02 6.73541476702e-02 5.85232784436e-02 4.51254329663e-02 3.06594619284e-02 1.87771308641e-02 - 1.14596764125e-02 1.14596764125e-02 1.56860392578e-02 2.42761411551e-02 3.63849623957e-02 4.93308963719e-02 - 5.94868177545e-02 6.44394828494e-02 6.41840706496e-02 6.03694423859e-02 5.48714786192e-02 4.90231496620e-02 - 4.35604474537e-02 3.88104397494e-02 3.48695445110e-02 3.17358390207e-02 2.93901320501e-02 2.78244998346e-02 - 2.70402901784e-02 2.70402901784e-02 2.78244998346e-02 2.93901320501e-02 3.17358390207e-02 3.48695445110e-02 - 3.88104397494e-02 4.35604474537e-02 4.90231496620e-02 5.48714786192e-02 6.03694423859e-02 6.41840706496e-02 - 6.44394828494e-02 5.94868177545e-02 4.93308963719e-02 3.63849623957e-02 2.42761411551e-02 1.56860392578e-02 - 1.69819929531e-02 1.87771308641e-02 2.42761411551e-02 3.32338776264e-02 4.40123223759e-02 5.36143814352e-02 - 5.92810318582e-02 6.01184381094e-02 5.71251588417e-02 5.20147259753e-02 4.62258246981e-02 4.06430475235e-02 - 3.57044700685e-02 3.15673758761e-02 2.82446089484e-02 2.57019293917e-02 2.39063871143e-02 2.28368095394e-02 - 2.24815496090e-02 2.28368095394e-02 2.39063871143e-02 2.57019293917e-02 2.82446089484e-02 3.15673758761e-02 - 3.57044700685e-02 4.06430475235e-02 4.62258246981e-02 5.20147259753e-02 5.71251588417e-02 6.01184381094e-02 - 5.92810318582e-02 5.36143814352e-02 4.40123223759e-02 3.32338776264e-02 2.42761411551e-02 1.87771308641e-02 - 2.77489957459e-02 3.06594619284e-02 3.63849623957e-02 4.40123223759e-02 5.14403532045e-02 5.62463189889e-02 - 5.71366804742e-02 5.44829894560e-02 4.96193341715e-02 4.38959177953e-02 3.82415861113e-02 3.31615306069e-02 - 2.88631293974e-02 2.53797852965e-02 2.26718438342e-02 2.06884779452e-02 1.93892705934e-02 1.87467470027e-02 - 1.87467470027e-02 1.93892705934e-02 2.06884779452e-02 2.26718438342e-02 2.53797852965e-02 2.88631293974e-02 - 3.31615306069e-02 3.82415861113e-02 4.38959177953e-02 4.96193341715e-02 5.44829894560e-02 5.71366804742e-02 - 5.62463189889e-02 5.14403532045e-02 4.40123223759e-02 3.63849623957e-02 3.06594619284e-02 2.77489957459e-02 - 4.22847991283e-02 4.51254329663e-02 4.93308963719e-02 5.36143814352e-02 5.62463189889e-02 5.60372557288e-02 - 5.29846351657e-02 4.79989400749e-02 4.21941579647e-02 3.64263171972e-02 3.12022017908e-02 2.67502344749e-02 - 2.31175818882e-02 2.02621880335e-02 1.81196807915e-02 1.66330383744e-02 1.57591868798e-02 1.54709928045e-02 - 1.57591868798e-02 1.66330383744e-02 1.81196807915e-02 2.02621880335e-02 2.31175818882e-02 2.67502344749e-02 - 3.12022017908e-02 3.64263171972e-02 4.21941579647e-02 4.79989400749e-02 5.29846351657e-02 5.60372557288e-02 - 5.62463189889e-02 5.36143814352e-02 4.93308963719e-02 4.51254329663e-02 4.22847991283e-02 4.13123485649e-02 - 5.73653289979e-02 5.85232784436e-02 5.94868177545e-02 5.92810318582e-02 5.71366804742e-02 5.29846351657e-02 - 4.74231711778e-02 4.12888114430e-02 3.52857897121e-02 2.98615217076e-02 2.52298202509e-02 2.14361295219e-02 - 1.84326960165e-02 1.61427916872e-02 1.44944499034e-02 1.34297677852e-02 1.29079014387e-02 1.29079014387e-02 - 1.34297677852e-02 1.44944499034e-02 1.61427916872e-02 1.84326960165e-02 2.14361295219e-02 2.52298202509e-02 - 2.98615217076e-02 3.52857897121e-02 4.12888114430e-02 4.74231711778e-02 5.29846351657e-02 5.71366804742e-02 - 5.92810318582e-02 5.94868177545e-02 5.85232784436e-02 5.73653289979e-02 5.66663226477e-02 5.66663226477e-02 - 6.91119067669e-02 6.73541476702e-02 6.44394828494e-02 6.01184381094e-02 5.44829894560e-02 4.79989400749e-02 - 4.12888114430e-02 3.48956024912e-02 2.91781605866e-02 2.43103322252e-02 2.03206914317e-02 1.71497889118e-02 - 1.47072813037e-02 1.29064893850e-02 1.16751572683e-02 1.09586567104e-02 1.07235056315e-02 1.09586567104e-02 - 1.16751572683e-02 1.29064893850e-02 1.47072813037e-02 1.71497889118e-02 2.03206914317e-02 2.43103322252e-02 - 2.91781605866e-02 3.48956024912e-02 4.12888114430e-02 4.79989400749e-02 5.44829894560e-02 6.01184381094e-02 - 6.44394828494e-02 6.73541476702e-02 6.91119067669e-02 7.00400365127e-02 7.03323963389e-02 7.00400365127e-02 - 7.51264696898e-02 7.03019494995e-02 6.41840706496e-02 5.71251588417e-02 4.96193341715e-02 4.21941579647e-02 - 3.52857897121e-02 2.91781605866e-02 2.40022165572e-02 1.97639178277e-02 1.63890080671e-02 1.37726366090e-02 - 1.18131307076e-02 1.04238516982e-02 9.53627070961e-03 9.10381322670e-03 9.10381322670e-03 9.53627070961e-03 - 1.04238516982e-02 1.18131307076e-02 1.37726366090e-02 1.63890080671e-02 1.97639178277e-02 2.40022165572e-02 - 2.91781605866e-02 3.52857897121e-02 4.21941579647e-02 4.96193341715e-02 5.71251588417e-02 6.41840706496e-02 - 7.03019494995e-02 7.51264696898e-02 7.84511058955e-02 8.01500628124e-02 8.01500628124e-02 7.84511058955e-02 - 7.55368812409e-02 6.84139609392e-02 6.03694423859e-02 5.20147259753e-02 4.38959177953e-02 3.64263171972e-02 - 2.98615217076e-02 2.43103322252e-02 1.97639178277e-02 1.61367490443e-02 1.33116675302e-02 1.11729588764e-02 - 9.61987006090e-03 8.57007132232e-03 7.96341795569e-03 7.76490388909e-03 7.96341795569e-03 8.57007132232e-03 - 9.61987006090e-03 1.11729588764e-02 1.33116675302e-02 1.61367490443e-02 1.97639178277e-02 2.43103322252e-02 - 2.98615217076e-02 3.64263171972e-02 4.38959177953e-02 5.20147259753e-02 6.03694423859e-02 6.84139609392e-02 - 7.55368812409e-02 8.11458755837e-02 8.47410728024e-02 8.59805323971e-02 8.47410728024e-02 8.11458755837e-02 - 7.21264918488e-02 6.37149803432e-02 5.48714786192e-02 4.62258246981e-02 3.82415861113e-02 3.12022017908e-02 - 2.52298202509e-02 2.03206914317e-02 1.63890080671e-02 1.33116675302e-02 1.09620544703e-02 9.22648243576e-03 - 8.00955236461e-03 7.23785699764e-03 6.86339437793e-03 6.86339437793e-03 7.23785699764e-03 8.00955236461e-03 - 9.22648243576e-03 1.09620544703e-02 1.33116675302e-02 1.63890080671e-02 2.03206914317e-02 2.52298202509e-02 - 3.12022017908e-02 3.82415861113e-02 4.62258246981e-02 5.48714786192e-02 6.37149803432e-02 7.21264918488e-02 - 7.93709590427e-02 8.47143937707e-02 8.75562567048e-02 8.75562567048e-02 8.47143937707e-02 7.93709590427e-02 - 6.68641206041e-02 5.79474348197e-02 4.90231496620e-02 4.06430475235e-02 3.31615306069e-02 2.67502344749e-02 - 2.14361295219e-02 1.71497889118e-02 1.37726366090e-02 1.11729588764e-02 9.22648243576e-03 7.82576853226e-03 - 6.88519888788e-03 6.34416762186e-03 6.16759269815e-03 6.34416762186e-03 6.88519888788e-03 7.82576853226e-03 - 9.22648243576e-03 1.11729588764e-02 1.37726366090e-02 1.71497889118e-02 2.14361295219e-02 2.67502344749e-02 - 3.31615306069e-02 4.06430475235e-02 4.90231496620e-02 5.79474348197e-02 6.68641206041e-02 7.50510418428e-02 - 8.16998180862e-02 8.60542685404e-02 8.75716967614e-02 8.60542685404e-02 8.16998180862e-02 7.50510418428e-02 - 6.11288569567e-02 5.21839135623e-02 4.35604474537e-02 3.57044700685e-02 2.88631293974e-02 2.31175818882e-02 - 1.84326960165e-02 1.47072813037e-02 1.18131307076e-02 9.61987006090e-03 8.00955236461e-03 6.88519888788e-03 - 6.17468606834e-03 5.83098728503e-03 5.83098728503e-03 6.17468606834e-03 6.88519888788e-03 8.00955236461e-03 - 9.61987006090e-03 1.18131307076e-02 1.47072813037e-02 1.84326960165e-02 2.31175818882e-02 2.88631293974e-02 - 3.57044700685e-02 4.35604474537e-02 5.21839135623e-02 6.11288569567e-02 6.97522426294e-02 7.72682499914e-02 - 8.28633557769e-02 8.58561529560e-02 8.58561529560e-02 8.28633557769e-02 7.72682499914e-02 6.97522426294e-02 - 5.56676247698e-02 4.69561004766e-02 3.88104397494e-02 3.15673758761e-02 2.53797852965e-02 2.02621880335e-02 - 1.61427916872e-02 1.29064893850e-02 1.04238516982e-02 8.57007132232e-03 7.23785699764e-03 6.34416762186e-03 - 5.83098728503e-03 5.66378434823e-03 5.83098728503e-03 6.34416762186e-03 7.23785699764e-03 8.57007132232e-03 - 1.04238516982e-02 1.29064893850e-02 1.61427916872e-02 2.02621880335e-02 2.53797852965e-02 3.15673758761e-02 - 3.88104397494e-02 4.69561004766e-02 5.56676247698e-02 6.44054743742e-02 7.24538631804e-02 7.90059272690e-02 - 8.33038946145e-02 8.48028174918e-02 8.33038946145e-02 7.90059272690e-02 7.24538631804e-02 6.44054743742e-02 - 5.08044555558e-02 4.24686468881e-02 3.48695445110e-02 2.82446089484e-02 2.26718438342e-02 1.81196807915e-02 - 1.44944499034e-02 1.16751572683e-02 9.53627070961e-03 7.96341795569e-03 6.86339437793e-03 6.16759269815e-03 - 5.83098728503e-03 5.83098728503e-03 6.16759269815e-03 6.86339437793e-03 7.96341795569e-03 9.53627070961e-03 - 1.16751572683e-02 1.44944499034e-02 1.81196807915e-02 2.26718438342e-02 2.82446089484e-02 3.48695445110e-02 - 4.24686468881e-02 5.08044555558e-02 5.94462807362e-02 6.77723654588e-02 7.50243106749e-02 8.04193974336e-02 - 8.33038946145e-02 8.33038946145e-02 8.04193974336e-02 7.50243106749e-02 6.77723654588e-02 5.94462807362e-02 - 4.66403070569e-02 3.87673596218e-02 3.17358390207e-02 2.57019293917e-02 2.06884779452e-02 1.66330383744e-02 - 1.34297677852e-02 1.09586567104e-02 9.10381322670e-03 7.76490388909e-03 6.86339437793e-03 6.34416762186e-03 - 6.17468606834e-03 6.34416762186e-03 6.86339437793e-03 7.76490388909e-03 9.10381322670e-03 1.09586567104e-02 - 1.34297677852e-02 1.66330383744e-02 2.06884779452e-02 2.57019293917e-02 3.17358390207e-02 3.87673596218e-02 - 4.66403070569e-02 5.50251512552e-02 6.34040688222e-02 7.10977313661e-02 7.73458021392e-02 8.14375530661e-02 - 8.28633557769e-02 8.14375530661e-02 7.73458021392e-02 7.10977313661e-02 6.34040688222e-02 5.50251512552e-02 - 4.32002938784e-02 3.58537824974e-02 2.93901320501e-02 2.39063871143e-02 1.93892705934e-02 1.57591868798e-02 - 1.29079014387e-02 1.07235056315e-02 9.10381322670e-03 7.96341795569e-03 7.23785699764e-03 6.88519888788e-03 - 6.88519888788e-03 7.23785699764e-03 7.96341795569e-03 9.10381322670e-03 1.07235056315e-02 1.29079014387e-02 - 1.57591868798e-02 1.93892705934e-02 2.39063871143e-02 2.93901320501e-02 3.58537824974e-02 4.32002938784e-02 - 5.11831265828e-02 5.93841418824e-02 6.72218662363e-02 7.40032629540e-02 7.90236437036e-02 8.16998180862e-02 - 8.16998180862e-02 7.90236437036e-02 7.40032629540e-02 6.72218662363e-02 5.93841418824e-02 5.11831265828e-02 - 4.05199675384e-02 3.37399765679e-02 2.78244998346e-02 2.28368095394e-02 1.87467470027e-02 1.54709928045e-02 - 1.29079014387e-02 1.09586567104e-02 9.53627070961e-03 8.57007132232e-03 8.00955236461e-03 7.82576853226e-03 - 8.00955236461e-03 8.57007132232e-03 9.53627070961e-03 1.09586567104e-02 1.29079014387e-02 1.54709928045e-02 - 1.87467470027e-02 2.28368095394e-02 2.78244998346e-02 3.37399765679e-02 4.05199675384e-02 4.79731106469e-02 - 5.57595749637e-02 6.33941825467e-02 7.02831021338e-02 7.57970302390e-02 7.93709590427e-02 8.06097207709e-02 - 7.93709590427e-02 7.57970302390e-02 7.02831021338e-02 6.33941825467e-02 5.57595749637e-02 4.79731106469e-02 - 3.86662855632e-02 3.24534608631e-02 2.70402901784e-02 2.24815496090e-02 1.87467470027e-02 1.57591868798e-02 - 1.34297677852e-02 1.16751572683e-02 1.04238516982e-02 9.61987006090e-03 9.22648243576e-03 9.22648243576e-03 - 9.61987006090e-03 1.04238516982e-02 1.16751572683e-02 1.34297677852e-02 1.57591868798e-02 1.87467470027e-02 - 2.24815496090e-02 2.70402901784e-02 3.24534608631e-02 3.86662855632e-02 4.55081727847e-02 5.26787408684e-02 - 5.97584596222e-02 6.62522137956e-02 7.16581855164e-02 7.55368812409e-02 7.75631573239e-02 7.75631573239e-02 - 7.55368812409e-02 7.16581855164e-02 6.62522137956e-02 5.97584596222e-02 5.26787408684e-02 4.55081727847e-02 - 3.77147526395e-02 3.20210145144e-02 2.70402901784e-02 2.28368095394e-02 1.93892705934e-02 1.66330383744e-02 - 1.44944499034e-02 1.29064893850e-02 1.18131307076e-02 1.11729588764e-02 1.09620544703e-02 1.11729588764e-02 - 1.18131307076e-02 1.29064893850e-02 1.44944499034e-02 1.66330383744e-02 1.93892705934e-02 2.28368095394e-02 - 2.70402901784e-02 3.20210145144e-02 3.77147526395e-02 4.39402098517e-02 5.03893328752e-02 5.66509609539e-02 - 6.22821499923e-02 6.69101294891e-02 7.03019494995e-02 7.23556493700e-02 7.30418134594e-02 7.23556493700e-02 - 7.03019494995e-02 6.69101294891e-02 6.22821499923e-02 5.66509609539e-02 5.03893328752e-02 4.39402098517e-02 - 3.77147526395e-02 3.24534608631e-02 2.78244998346e-02 2.39063871143e-02 2.06884779452e-02 1.81196807915e-02 - 1.61427916872e-02 1.47072813037e-02 1.37726366090e-02 1.33116675302e-02 1.33116675302e-02 1.37726366090e-02 - 1.47072813037e-02 1.61427916872e-02 1.81196807915e-02 2.06884779452e-02 2.39063871143e-02 2.78244998346e-02 - 3.24534608631e-02 3.77147526395e-02 4.34003076052e-02 4.91578982971e-02 5.45211951056e-02 5.90154969276e-02 - 6.23288110708e-02 6.44394828494e-02 6.55787911247e-02 6.60504635380e-02 6.60504635380e-02 6.55787911247e-02 - 6.44394828494e-02 6.23288110708e-02 5.90154969276e-02 5.45211951056e-02 4.91578982971e-02 4.34003076052e-02 - 3.86662855632e-02 3.37399765679e-02 2.93901320501e-02 2.57019293917e-02 2.26718438342e-02 2.02621880335e-02 - 1.84326960165e-02 1.71497889118e-02 1.63890080671e-02 1.61367490443e-02 1.63890080671e-02 1.71497889118e-02 - 1.84326960165e-02 2.02621880335e-02 2.26718438342e-02 2.57019293917e-02 2.93901320501e-02 3.37399765679e-02 - 3.86662855632e-02 4.39402098517e-02 4.91578982971e-02 5.37595739225e-02 5.71527035674e-02 5.89627863020e-02 - 5.92810318582e-02 5.86758842735e-02 5.79103146750e-02 5.75824043038e-02 5.79103146750e-02 5.86758842735e-02 - 5.92810318582e-02 5.89627863020e-02 5.71527035674e-02 5.37595739225e-02 4.91578982971e-02 4.39402098517e-02 - 4.05199675384e-02 3.58537824974e-02 3.17358390207e-02 2.82446089484e-02 2.53797852965e-02 2.31175818882e-02 - 2.14361295219e-02 2.03206914317e-02 1.97639178277e-02 1.97639178277e-02 2.03206914317e-02 2.14361295219e-02 - 2.31175818882e-02 2.53797852965e-02 2.82446089484e-02 3.17358390207e-02 3.58537824974e-02 4.05199675384e-02 - 4.55081727847e-02 5.03893328752e-02 5.45211951056e-02 5.71527035674e-02 5.77208882781e-02 5.62463189889e-02 - 5.34983990182e-02 5.07010770424e-02 4.89850720157e-02 4.89850720157e-02 5.07010770424e-02 5.34983990182e-02 - 5.62463189889e-02 5.77208882781e-02 5.71527035674e-02 5.45211951056e-02 5.03893328752e-02 4.55081727847e-02 - 4.32002938784e-02 3.87673596218e-02 3.48695445110e-02 3.15673758761e-02 2.88631293974e-02 2.67502344749e-02 - 2.52298202509e-02 2.43103322252e-02 2.40022165572e-02 2.43103322252e-02 2.52298202509e-02 2.67502344749e-02 - 2.88631293974e-02 3.15673758761e-02 3.48695445110e-02 3.87673596218e-02 4.32002938784e-02 4.79731106469e-02 - 5.26787408684e-02 5.66509609539e-02 5.90154969276e-02 5.89627863020e-02 5.62463189889e-02 5.15765048907e-02 - 4.64751950426e-02 4.26203265537e-02 4.11986868029e-02 4.26203265537e-02 4.64751950426e-02 5.15765048907e-02 - 5.62463189889e-02 5.89627863020e-02 5.90154969276e-02 5.66509609539e-02 5.26787408684e-02 4.79731106469e-02 - 4.66403070569e-02 4.24686468881e-02 3.88104397494e-02 3.57044700685e-02 3.31615306069e-02 3.12022017908e-02 - 2.98615217076e-02 2.91781605866e-02 2.91781605866e-02 2.98615217076e-02 3.12022017908e-02 3.31615306069e-02 - 3.57044700685e-02 3.88104397494e-02 4.24686468881e-02 4.66403070569e-02 5.11831265828e-02 5.57595749637e-02 - 5.97584596222e-02 6.22821499923e-02 6.23288110708e-02 5.92810318582e-02 5.34983990182e-02 4.64751950426e-02 - 4.02808330656e-02 3.67025276917e-02 3.67025276917e-02 4.02808330656e-02 4.64751950426e-02 5.34983990182e-02 - 5.92810318582e-02 6.23288110708e-02 6.22821499923e-02 5.97584596222e-02 5.57595749637e-02 5.11831265828e-02 - 5.08044555558e-02 4.69561004766e-02 4.35604474537e-02 4.06430475235e-02 3.82415861113e-02 3.64263171972e-02 - 3.52857897121e-02 3.48956024912e-02 3.52857897121e-02 3.64263171972e-02 3.82415861113e-02 4.06430475235e-02 - 4.35604474537e-02 4.69561004766e-02 5.08044555558e-02 5.50251512552e-02 5.93841418824e-02 6.33941825467e-02 - 6.62522137956e-02 6.69101294891e-02 6.44394828494e-02 5.86758842735e-02 5.07010770424e-02 4.26203265537e-02 - 3.67025276917e-02 3.45455630665e-02 3.67025276917e-02 4.26203265537e-02 5.07010770424e-02 5.86758842735e-02 - 6.44394828494e-02 6.69101294891e-02 6.62522137956e-02 6.33941825467e-02 5.93841418824e-02 5.50251512552e-02 - 5.56676247698e-02 5.21839135623e-02 4.90231496620e-02 4.62258246981e-02 4.38959177953e-02 4.21941579647e-02 - 4.12888114430e-02 4.12888114430e-02 4.21941579647e-02 4.38959177953e-02 4.62258246981e-02 4.90231496620e-02 - 5.21839135623e-02 5.56676247698e-02 5.94462807362e-02 6.34040688222e-02 6.72218662363e-02 7.02831021338e-02 - 7.16581855164e-02 7.03019494995e-02 6.55787911247e-02 5.79103146750e-02 4.89850720157e-02 4.11986868029e-02 - 3.67025276917e-02 3.67025276917e-02 4.11986868029e-02 4.89850720157e-02 5.79103146750e-02 6.55787911247e-02 - 7.03019494995e-02 7.16581855164e-02 7.02831021338e-02 6.72218662363e-02 6.34040688222e-02 5.94462807362e-02 - 6.11288569567e-02 5.79474348197e-02 5.48714786192e-02 5.20147259753e-02 4.96193341715e-02 4.79989400749e-02 - 4.74231711778e-02 4.79989400749e-02 4.96193341715e-02 5.20147259753e-02 5.48714786192e-02 5.79474348197e-02 - 6.11288569567e-02 6.44054743742e-02 6.77723654588e-02 7.10977313661e-02 7.40032629540e-02 7.57970302390e-02 - 7.55368812409e-02 7.23556493700e-02 6.60504635380e-02 5.75824043038e-02 4.89850720157e-02 4.26203265537e-02 - 4.02808330656e-02 4.26203265537e-02 4.89850720157e-02 5.75824043038e-02 6.60504635380e-02 7.23556493700e-02 - 7.55368812409e-02 7.57970302390e-02 7.40032629540e-02 7.10977313661e-02 6.77723654588e-02 6.44054743742e-02 - 6.68641206041e-02 6.37149803432e-02 6.03694423859e-02 5.71251588417e-02 5.44829894560e-02 5.29846351657e-02 - 5.29846351657e-02 5.44829894560e-02 5.71251588417e-02 6.03694423859e-02 6.37149803432e-02 6.68641206041e-02 - 6.97522426294e-02 7.24538631804e-02 7.50243106749e-02 7.73458021392e-02 7.90236437036e-02 7.93709590427e-02 - 7.75631573239e-02 7.30418134594e-02 6.60504635380e-02 5.79103146750e-02 5.07010770424e-02 4.64751950426e-02 - 4.64751950426e-02 5.07010770424e-02 5.79103146750e-02 6.60504635380e-02 7.30418134594e-02 7.75631573239e-02 - 7.93709590427e-02 7.90236437036e-02 7.73458021392e-02 7.50243106749e-02 7.24538631804e-02 6.97522426294e-02 - 7.21264918488e-02 6.84139609392e-02 6.41840706496e-02 6.01184381094e-02 5.71366804742e-02 5.60372557288e-02 - 5.71366804742e-02 6.01184381094e-02 6.41840706496e-02 6.84139609392e-02 7.21264918488e-02 7.50510418428e-02 - 7.72682499914e-02 7.90059272690e-02 8.04193974336e-02 8.14375530661e-02 8.16998180862e-02 8.06097207709e-02 - 7.75631573239e-02 7.23556493700e-02 6.55787911247e-02 5.86758842735e-02 5.34983990182e-02 5.15765048907e-02 - 5.34983990182e-02 5.86758842735e-02 6.55787911247e-02 7.23556493700e-02 7.75631573239e-02 8.06097207709e-02 - 8.16998180862e-02 8.14375530661e-02 8.04193974336e-02 7.90059272690e-02 7.72682499914e-02 7.50510418428e-02 - 7.55368812409e-02 7.03019494995e-02 6.44394828494e-02 5.92810318582e-02 5.62463189889e-02 5.62463189889e-02 - 5.92810318582e-02 6.44394828494e-02 7.03019494995e-02 7.55368812409e-02 7.93709590427e-02 8.16998180862e-02 - 8.28633557769e-02 8.33038946145e-02 8.33038946145e-02 8.28633557769e-02 8.16998180862e-02 7.93709590427e-02 - 7.55368812409e-02 7.03019494995e-02 6.44394828494e-02 5.92810318582e-02 5.62463189889e-02 5.62463189889e-02 - 5.92810318582e-02 6.44394828494e-02 7.03019494995e-02 7.55368812409e-02 7.93709590427e-02 8.16998180862e-02 - 8.28633557769e-02 8.33038946145e-02 8.33038946145e-02 8.28633557769e-02 8.16998180862e-02 7.93709590427e-02 - 7.51264696898e-02 6.73541476702e-02 5.94868177545e-02 5.36143814352e-02 5.14403532045e-02 5.36143814352e-02 - 5.94868177545e-02 6.73541476702e-02 7.51264696898e-02 8.11458755837e-02 8.47143937707e-02 8.60542685404e-02 - 8.58561529560e-02 8.48028174918e-02 8.33038946145e-02 8.14375530661e-02 7.90236437036e-02 7.57970302390e-02 - 7.16581855164e-02 6.69101294891e-02 6.23288110708e-02 5.89627863020e-02 5.77208882781e-02 5.89627863020e-02 - 6.23288110708e-02 6.69101294891e-02 7.16581855164e-02 7.57970302390e-02 7.90236437036e-02 8.14375530661e-02 - 8.33038946145e-02 8.48028174918e-02 8.58561529560e-02 8.60542685404e-02 8.47143937707e-02 8.11458755837e-02 - 6.91119067669e-02 5.85232784436e-02 4.93308963719e-02 4.40123223759e-02 4.40123223759e-02 4.93308963719e-02 - 5.85232784436e-02 6.91119067669e-02 7.84511058955e-02 8.47410728024e-02 8.75562567048e-02 8.75716967614e-02 - 8.58561529560e-02 8.33038946145e-02 8.04193974336e-02 7.73458021392e-02 7.40032629540e-02 7.02831021338e-02 - 6.62522137956e-02 6.22821499923e-02 5.90154969276e-02 5.71527035674e-02 5.71527035674e-02 5.90154969276e-02 - 6.22821499923e-02 6.62522137956e-02 7.02831021338e-02 7.40032629540e-02 7.73458021392e-02 8.04193974336e-02 - 8.33038946145e-02 8.58561529560e-02 8.75716967614e-02 8.75562567048e-02 8.47410728024e-02 7.84511058955e-02 - 5.73653289979e-02 4.51254329663e-02 3.63849623957e-02 3.32338776264e-02 3.63849623957e-02 4.51254329663e-02 - 5.73653289979e-02 7.00400365127e-02 8.01500628124e-02 8.59805323971e-02 8.75562567048e-02 8.60542685404e-02 - 8.28633557769e-02 7.90059272690e-02 7.50243106749e-02 7.10977313661e-02 6.72218662363e-02 6.33941825467e-02 - 5.97584596222e-02 5.66509609539e-02 5.45211951056e-02 5.37595739225e-02 5.45211951056e-02 5.66509609539e-02 - 5.97584596222e-02 6.33941825467e-02 6.72218662363e-02 7.10977313661e-02 7.50243106749e-02 7.90059272690e-02 - 8.28633557769e-02 8.60542685404e-02 8.75562567048e-02 8.59805323971e-02 8.01500628124e-02 7.00400365127e-02 - 4.22847991283e-02 3.06594619284e-02 2.42761411551e-02 2.42761411551e-02 3.06594619284e-02 4.22847991283e-02 - 5.66663226477e-02 7.03323963389e-02 8.01500628124e-02 8.47410728024e-02 8.47143937707e-02 8.16998180862e-02 - 7.72682499914e-02 7.24538631804e-02 6.77723654588e-02 6.34040688222e-02 5.93841418824e-02 5.57595749637e-02 - 5.26787408684e-02 5.03893328752e-02 4.91578982971e-02 4.91578982971e-02 5.03893328752e-02 5.26787408684e-02 - 5.57595749637e-02 5.93841418824e-02 6.34040688222e-02 6.77723654588e-02 7.24538631804e-02 7.72682499914e-02 - 8.16998180862e-02 8.47143937707e-02 8.47410728024e-02 8.01500628124e-02 7.03323963389e-02 5.66663226477e-02 - 2.77489957459e-02 1.87771308641e-02 1.56860392578e-02 1.87771308641e-02 2.77489957459e-02 4.13123485649e-02 - 5.66663226477e-02 7.00400365127e-02 7.84511058955e-02 8.11458755837e-02 7.93709590427e-02 7.50510418428e-02 - 6.97522426294e-02 6.44054743742e-02 5.94462807362e-02 5.50251512552e-02 5.11831265828e-02 4.79731106469e-02 - 4.55081727847e-02 4.39402098517e-02 4.34003076052e-02 4.39402098517e-02 4.55081727847e-02 4.79731106469e-02 - 5.11831265828e-02 5.50251512552e-02 5.94462807362e-02 6.44054743742e-02 6.97522426294e-02 7.50510418428e-02 - 7.93709590427e-02 8.11458755837e-02 7.84511058955e-02 7.00400365127e-02 5.66663226477e-02 4.13123485649e-02 - 7.45857574908e-03 5.17285277950e-03 7.45857574908e-03 1.46090879135e-02 2.67478820537e-02 4.22847991283e-02 - 5.74463352203e-02 6.81077724909e-02 7.23556493700e-02 7.10787520021e-02 6.64898780493e-02 6.05796981280e-02 - 5.45841783826e-02 4.91148354625e-02 4.44094609233e-02 4.05244812822e-02 3.74634706166e-02 3.52402742752e-02 - 3.38859304601e-02 3.34304675050e-02 3.38859304601e-02 3.52402742752e-02 3.74634706166e-02 4.05244812822e-02 - 4.44094609233e-02 4.91148354625e-02 5.45841783826e-02 6.05796981280e-02 6.64898780493e-02 7.10787520021e-02 - 7.23556493700e-02 6.81077724909e-02 5.74463352203e-02 4.22847991283e-02 2.67478820537e-02 1.46090879135e-02 - 5.17285277950e-03 5.17285277950e-03 9.13060134292e-03 1.76819501362e-02 3.06594619284e-02 4.56222411881e-02 - 5.83777841365e-02 6.55787911247e-02 6.66786802062e-02 6.33842515281e-02 5.78981879671e-02 5.18355302331e-02 - 4.60913389830e-02 4.10670403681e-02 3.68889471691e-02 3.35632692529e-02 3.10717223250e-02 2.94074293899e-02 - 2.85734174953e-02 2.85734174953e-02 2.94074293899e-02 3.10717223250e-02 3.35632692529e-02 3.68889471691e-02 - 4.10670403681e-02 4.60913389830e-02 5.18355302331e-02 5.78981879671e-02 6.33842515281e-02 6.66786802062e-02 - 6.55787911247e-02 5.83777841365e-02 4.56222411881e-02 3.06594619284e-02 1.76819501362e-02 9.13060134292e-03 - 7.45857574908e-03 9.13060134292e-03 1.45732066269e-02 2.42761411551e-02 3.71417160544e-02 4.98718618187e-02 - 5.86758842735e-02 6.17513938278e-02 5.98878714669e-02 5.51031089527e-02 4.92182336225e-02 4.33721592307e-02 - 3.81345549630e-02 3.37228748044e-02 3.01717861136e-02 2.74512061786e-02 2.55281844546e-02 2.43819637041e-02 - 2.40011711299e-02 2.43819637041e-02 2.55281844546e-02 2.74512061786e-02 3.01717861136e-02 3.37228748044e-02 - 3.81345549630e-02 4.33721592307e-02 4.92182336225e-02 5.51031089527e-02 5.98878714669e-02 6.17513938278e-02 - 5.86758842735e-02 4.98718618187e-02 3.71417160544e-02 2.42761411551e-02 1.45732066269e-02 9.13060134292e-03 - 1.46090879135e-02 1.76819501362e-02 2.42761411551e-02 3.40771392673e-02 4.49279278957e-02 5.34983990182e-02 - 5.74105494947e-02 5.65511919643e-02 5.24339557043e-02 4.68264624901e-02 4.09927131873e-02 3.56312088557e-02 - 3.10465495213e-02 2.73140021666e-02 2.44059448105e-02 2.22726314479e-02 2.08735527936e-02 2.01812628043e-02 - 2.01812628043e-02 2.08735527936e-02 2.22726314479e-02 2.44059448105e-02 2.73140021666e-02 3.10465495213e-02 - 3.56312088557e-02 4.09927131873e-02 4.68264624901e-02 5.24339557043e-02 5.65511919643e-02 5.74105494947e-02 - 5.34983990182e-02 4.49279278957e-02 3.40771392673e-02 2.42761411551e-02 1.76819501362e-02 1.46090879135e-02 - 2.67478820537e-02 3.06594619284e-02 3.71417160544e-02 4.49279278957e-02 5.15765048907e-02 5.48533676650e-02 - 5.41129564364e-02 5.02828320119e-02 4.48486167771e-02 3.90347179512e-02 3.35871770820e-02 2.88661050079e-02 - 2.49827563157e-02 2.19185274002e-02 1.96135589165e-02 1.80109897723e-02 1.70678712692e-02 1.67567114426e-02 - 1.70678712692e-02 1.80109897723e-02 1.96135589165e-02 2.19185274002e-02 2.49827563157e-02 2.88661050079e-02 - 3.35871770820e-02 3.90347179512e-02 4.48486167771e-02 5.02828320119e-02 5.41129564364e-02 5.48533676650e-02 - 5.15765048907e-02 4.49279278957e-02 3.71417160544e-02 3.06594619284e-02 2.67478820537e-02 2.54935088837e-02 - 4.22847991283e-02 4.56222411881e-02 4.98718618187e-02 5.34983990182e-02 5.48533676650e-02 5.32152215954e-02 - 4.90700187394e-02 4.35234290368e-02 3.76190713504e-02 3.20546920774e-02 2.71955666447e-02 2.31688478126e-02 - 1.99620901041e-02 1.75083321070e-02 1.57370100687e-02 1.45906790875e-02 1.40283418589e-02 1.40283418589e-02 - 1.45906790875e-02 1.57370100687e-02 1.75083321070e-02 1.99620901041e-02 2.31688478126e-02 2.71955666447e-02 - 3.20546920774e-02 3.76190713504e-02 4.35234290368e-02 4.90700187394e-02 5.32152215954e-02 5.48533676650e-02 - 5.34983990182e-02 4.98718618187e-02 4.56222411881e-02 4.22847991283e-02 4.05694134160e-02 4.05694134160e-02 - 5.74463352203e-02 5.83777841365e-02 5.86758842735e-02 5.74105494947e-02 5.41129564364e-02 4.90700187394e-02 - 4.30547772101e-02 3.68707660171e-02 3.10978190541e-02 2.60582031450e-02 2.18687619531e-02 1.85132658939e-02 - 1.59162612755e-02 1.39945083398e-02 1.26769712537e-02 1.19093466628e-02 1.16573532374e-02 1.19093466628e-02 - 1.26769712537e-02 1.39945083398e-02 1.59162612755e-02 1.85132658939e-02 2.18687619531e-02 2.60582031450e-02 - 3.10978190541e-02 3.68707660171e-02 4.30547772101e-02 4.90700187394e-02 5.41129564364e-02 5.74105494947e-02 - 5.86758842735e-02 5.83777841365e-02 5.74463352203e-02 5.66663226477e-02 5.63846435627e-02 5.66663226477e-02 - 6.81077724909e-02 6.55787911247e-02 6.17513938278e-02 5.65511919643e-02 5.02828320119e-02 4.35234290368e-02 - 3.68707660171e-02 3.07715106065e-02 2.54803066383e-02 2.10847229658e-02 1.75547637226e-02 1.48031251671e-02 - 1.27333396536e-02 1.12609832188e-02 1.03186231402e-02 9.85925299562e-03 9.85925299562e-03 1.03186231402e-02 - 1.12609832188e-02 1.27333396536e-02 1.48031251671e-02 1.75547637226e-02 2.10847229658e-02 2.54803066383e-02 - 3.07715106065e-02 3.68707660171e-02 4.35234290368e-02 5.02828320119e-02 5.65511919643e-02 6.17513938278e-02 - 6.55787911247e-02 6.81077724909e-02 6.96179820017e-02 7.03323963389e-02 7.03323963389e-02 6.96179820017e-02 - 7.23556493700e-02 6.66786802062e-02 5.98878714669e-02 5.24339557043e-02 4.48486167771e-02 3.76190713504e-02 - 3.10978190541e-02 2.54803066383e-02 2.08223402545e-02 1.70770073925e-02 1.41440793855e-02 1.19137265332e-02 - 1.02881382638e-02 9.18679124184e-03 8.54973346172e-03 8.34122341388e-03 8.54973346172e-03 9.18679124184e-03 - 1.02881382638e-02 1.19137265332e-02 1.41440793855e-02 1.70770073925e-02 2.08223402545e-02 2.54803066383e-02 - 3.10978190541e-02 3.76190713504e-02 4.48486167771e-02 5.24339557043e-02 5.98878714669e-02 6.66786802062e-02 - 7.23556493700e-02 7.66122811094e-02 7.92532152557e-02 8.01500628124e-02 7.92532152557e-02 7.66122811094e-02 - 7.10787520021e-02 6.33842515281e-02 5.51031089527e-02 4.68264624901e-02 3.90347179512e-02 3.20546920774e-02 - 2.60582031450e-02 2.10847229658e-02 1.70770073925e-02 1.39256808178e-02 1.15097880648e-02 9.71912104775e-03 - 8.46060891145e-03 7.66146344666e-03 7.27338017313e-03 7.27338017313e-03 7.66146344666e-03 8.46060891145e-03 - 9.71912104775e-03 1.15097880648e-02 1.39256808178e-02 1.70770073925e-02 2.10847229658e-02 2.60582031450e-02 - 3.20546920774e-02 3.90347179512e-02 4.68264624901e-02 5.51031089527e-02 6.33842515281e-02 7.10787520021e-02 - 7.75631573239e-02 8.22656900591e-02 8.47410728024e-02 8.47410728024e-02 8.22656900591e-02 7.75631573239e-02 - 6.64898780493e-02 5.78981879671e-02 4.92182336225e-02 4.09927131873e-02 3.35871770820e-02 2.71955666447e-02 - 2.18687619531e-02 1.75547637226e-02 1.41440793855e-02 1.15097880648e-02 9.53173661310e-03 8.10563303358e-03 - 7.14689010595e-03 6.59479473082e-03 6.41444748147e-03 6.59479473082e-03 7.14689010595e-03 8.10563303358e-03 - 9.53173661310e-03 1.15097880648e-02 1.41440793855e-02 1.75547637226e-02 2.18687619531e-02 2.71955666447e-02 - 3.35871770820e-02 4.09927131873e-02 4.92182336225e-02 5.78981879671e-02 6.64898780493e-02 7.43082663472e-02 - 8.06097207709e-02 8.47143937707e-02 8.61408122915e-02 8.47143937707e-02 8.06097207709e-02 7.43082663472e-02 - 6.05796981280e-02 5.18355302331e-02 4.33721592307e-02 3.56312088557e-02 2.88661050079e-02 2.31688478126e-02 - 1.85132658939e-02 1.48031251671e-02 1.19137265332e-02 9.71912104775e-03 8.10563303358e-03 6.97836085285e-03 - 6.26545793635e-03 5.92021996667e-03 5.92021996667e-03 6.26545793635e-03 6.97836085285e-03 8.10563303358e-03 - 9.71912104775e-03 1.19137265332e-02 1.48031251671e-02 1.85132658939e-02 2.31688478126e-02 2.88661050079e-02 - 3.56312088557e-02 4.33721592307e-02 5.18355302331e-02 6.05796981280e-02 6.89793219251e-02 7.62783857555e-02 - 8.16998180862e-02 8.45957298814e-02 8.45957298814e-02 8.16998180862e-02 7.62783857555e-02 6.89793219251e-02 - 5.45841783826e-02 4.60913389830e-02 3.81345549630e-02 3.10465495213e-02 2.49827563157e-02 1.99620901041e-02 - 1.59162612755e-02 1.27333396536e-02 1.02881382638e-02 8.46060891145e-03 7.14689010595e-03 6.26545793635e-03 - 5.75903981319e-03 5.59394004869e-03 5.75903981319e-03 6.26545793635e-03 7.14689010595e-03 8.46060891145e-03 - 1.02881382638e-02 1.27333396536e-02 1.59162612755e-02 1.99620901041e-02 2.49827563157e-02 3.10465495213e-02 - 3.81345549630e-02 4.60913389830e-02 5.45841783826e-02 6.30873277659e-02 7.09081350393e-02 7.72682499914e-02 - 8.14375530661e-02 8.28911486673e-02 8.14375530661e-02 7.72682499914e-02 7.09081350393e-02 6.30873277659e-02 - 4.91148354625e-02 4.10670403681e-02 3.37228748044e-02 2.73140021666e-02 2.19185274002e-02 1.75083321070e-02 - 1.39945083398e-02 1.12609832188e-02 9.18679124184e-03 7.66146344666e-03 6.59479473082e-03 5.92021996667e-03 - 5.59394004869e-03 5.59394004869e-03 5.92021996667e-03 6.59479473082e-03 7.66146344666e-03 9.18679124184e-03 - 1.12609832188e-02 1.39945083398e-02 1.75083321070e-02 2.19185274002e-02 2.73140021666e-02 3.37228748044e-02 - 4.10670403681e-02 4.91148354625e-02 5.74494623672e-02 6.54719417706e-02 7.24538631804e-02 7.76449689484e-02 - 8.04193974336e-02 8.04193974336e-02 7.76449689484e-02 7.24538631804e-02 6.54719417706e-02 5.74494623672e-02 - 4.44094609233e-02 3.68889471691e-02 3.01717861136e-02 2.44059448105e-02 1.96135589165e-02 1.57370100687e-02 - 1.26769712537e-02 1.03186231402e-02 8.54973346172e-03 7.27338017313e-03 6.41444748147e-03 5.92021996667e-03 - 5.75903981319e-03 5.92021996667e-03 6.41444748147e-03 7.27338017313e-03 8.54973346172e-03 1.03186231402e-02 - 1.26769712537e-02 1.57370100687e-02 1.96135589165e-02 2.44059448105e-02 3.01717861136e-02 3.68889471691e-02 - 4.44094609233e-02 5.24194501424e-02 6.04237632524e-02 6.77723654588e-02 7.37387049341e-02 7.76449689484e-02 - 7.90059272690e-02 7.76449689484e-02 7.37387049341e-02 6.77723654588e-02 6.04237632524e-02 5.24194501424e-02 - 4.05244812822e-02 3.35632692529e-02 2.74512061786e-02 2.22726314479e-02 1.80109897723e-02 1.45906790875e-02 - 1.19093466628e-02 9.85925299562e-03 8.34122341388e-03 7.27338017313e-03 6.59479473082e-03 6.26545793635e-03 - 6.26545793635e-03 6.59479473082e-03 7.27338017313e-03 8.34122341388e-03 9.85925299562e-03 1.19093466628e-02 - 1.45906790875e-02 1.80109897723e-02 2.22726314479e-02 2.74512061786e-02 3.35632692529e-02 4.05244812822e-02 - 4.81082332430e-02 5.59201471811e-02 6.34040688222e-02 6.98920688762e-02 7.47020608958e-02 7.72682499914e-02 - 7.72682499914e-02 7.47020608958e-02 6.98920688762e-02 6.34040688222e-02 5.59201471811e-02 4.81082332430e-02 - 3.74634706166e-02 3.10717223250e-02 2.55281844546e-02 2.08735527936e-02 1.70678712692e-02 1.40283418589e-02 - 1.16573532374e-02 9.85925299562e-03 8.54973346172e-03 7.66146344666e-03 7.14689010595e-03 6.97836085285e-03 - 7.14689010595e-03 7.66146344666e-03 8.54973346172e-03 9.85925299562e-03 1.16573532374e-02 1.40283418589e-02 - 1.70678712692e-02 2.08735527936e-02 2.55281844546e-02 3.10717223250e-02 3.74634706166e-02 4.45431970579e-02 - 5.20033431247e-02 5.93841418824e-02 6.61022866145e-02 7.15201290633e-02 7.50510418428e-02 7.62783857555e-02 - 7.50510418428e-02 7.15201290633e-02 6.61022866145e-02 5.93841418824e-02 5.20033431247e-02 4.45431970579e-02 - 3.52402742752e-02 2.94074293899e-02 2.43819637041e-02 2.01812628043e-02 1.67567114426e-02 1.40283418589e-02 - 1.19093466628e-02 1.03186231402e-02 9.18679124184e-03 8.46060891145e-03 8.10563303358e-03 8.10563303358e-03 - 8.46060891145e-03 9.18679124184e-03 1.03186231402e-02 1.19093466628e-02 1.40283418589e-02 1.67567114426e-02 - 2.01812628043e-02 2.43819637041e-02 2.94074293899e-02 3.52402742752e-02 4.17618689283e-02 4.87273692032e-02 - 5.57595749637e-02 6.23688231248e-02 6.80033074139e-02 7.21264918488e-02 7.43082663472e-02 7.43082663472e-02 - 7.21264918488e-02 6.80033074139e-02 6.23688231248e-02 5.57595749637e-02 4.87273692032e-02 4.17618689283e-02 - 3.38859304601e-02 2.85734174953e-02 2.40011711299e-02 2.01812628043e-02 1.70678712692e-02 1.45906790875e-02 - 1.26769712537e-02 1.12609832188e-02 1.02881382638e-02 9.71912104775e-03 9.53173661310e-03 9.71912104775e-03 - 1.02881382638e-02 1.12609832188e-02 1.26769712537e-02 1.45906790875e-02 1.70678712692e-02 2.01812628043e-02 - 2.40011711299e-02 2.85734174953e-02 3.38859304601e-02 3.98358227133e-02 4.62088704848e-02 5.26787408684e-02 - 5.88318176265e-02 6.42180018992e-02 6.84139609392e-02 7.10787520021e-02 7.19923628057e-02 7.10787520021e-02 - 6.84139609392e-02 6.42180018992e-02 5.88318176265e-02 5.26787408684e-02 4.62088704848e-02 3.98358227133e-02 - 3.34304675050e-02 2.85734174953e-02 2.43819637041e-02 2.08735527936e-02 1.80109897723e-02 1.57370100687e-02 - 1.39945083398e-02 1.27333396536e-02 1.19137265332e-02 1.15097880648e-02 1.15097880648e-02 1.19137265332e-02 - 1.27333396536e-02 1.39945083398e-02 1.57370100687e-02 1.80109897723e-02 2.08735527936e-02 2.43819637041e-02 - 2.85734174953e-02 3.34304675050e-02 3.88462459817e-02 4.46053414397e-02 5.03893328752e-02 5.58153453540e-02 - 6.05090723285e-02 6.41840706496e-02 6.66786802062e-02 6.79320857310e-02 6.79320857310e-02 6.66786802062e-02 - 6.41840706496e-02 6.05090723285e-02 5.58153453540e-02 5.03893328752e-02 4.46053414397e-02 3.88462459817e-02 - 3.38859304601e-02 2.94074293899e-02 2.55281844546e-02 2.22726314479e-02 1.96135589165e-02 1.75083321070e-02 - 1.59162612755e-02 1.48031251671e-02 1.41440793855e-02 1.39256808178e-02 1.41440793855e-02 1.48031251671e-02 - 1.59162612755e-02 1.75083321070e-02 1.96135589165e-02 2.22726314479e-02 2.55281844546e-02 2.94074293899e-02 - 3.38859304601e-02 3.88462459817e-02 4.40529168852e-02 4.91578982971e-02 5.37510492057e-02 5.74676014035e-02 - 6.01184381094e-02 6.17513938278e-02 6.25800698666e-02 6.28259810566e-02 6.25800698666e-02 6.17513938278e-02 - 6.01184381094e-02 5.74676014035e-02 5.37510492057e-02 4.91578982971e-02 4.40529168852e-02 3.88462459817e-02 - 3.52402742752e-02 3.10717223250e-02 2.74512061786e-02 2.44059448105e-02 2.19185274002e-02 1.99620901041e-02 - 1.85132658939e-02 1.75547637226e-02 1.70770073925e-02 1.70770073925e-02 1.75547637226e-02 1.85132658939e-02 - 1.99620901041e-02 2.19185274002e-02 2.44059448105e-02 2.74512061786e-02 3.10717223250e-02 3.52402742752e-02 - 3.98358227133e-02 4.46053414397e-02 4.91578982971e-02 5.30133769166e-02 5.57363453523e-02 5.71366804742e-02 - 5.74105494947e-02 5.70772559013e-02 5.67236888968e-02 5.67236888968e-02 5.70772559013e-02 5.74105494947e-02 - 5.71366804742e-02 5.57363453523e-02 5.30133769166e-02 4.91578982971e-02 4.46053414397e-02 3.98358227133e-02 - 3.74634706166e-02 3.35632692529e-02 3.01717861136e-02 2.73140021666e-02 2.49827563157e-02 2.31688478126e-02 - 2.18687619531e-02 2.10847229658e-02 2.08223402545e-02 2.10847229658e-02 2.18687619531e-02 2.31688478126e-02 - 2.49827563157e-02 2.73140021666e-02 3.01717861136e-02 3.35632692529e-02 3.74634706166e-02 4.17618689283e-02 - 4.62088704848e-02 5.03893328752e-02 5.37510492057e-02 5.57363453523e-02 5.60372557288e-02 5.48533676650e-02 - 5.29210396854e-02 5.12221625406e-02 5.05555186569e-02 5.12221625406e-02 5.29210396854e-02 5.48533676650e-02 - 5.60372557288e-02 5.57363453523e-02 5.37510492057e-02 5.03893328752e-02 4.62088704848e-02 4.17618689283e-02 - 4.05244812822e-02 3.68889471691e-02 3.37228748044e-02 3.10465495213e-02 2.88661050079e-02 2.71955666447e-02 - 2.60582031450e-02 2.54803066383e-02 2.54803066383e-02 2.60582031450e-02 2.71955666447e-02 2.88661050079e-02 - 3.10465495213e-02 3.37228748044e-02 3.68889471691e-02 4.05244812822e-02 4.45431970579e-02 4.87273692032e-02 - 5.26787408684e-02 5.58153453540e-02 5.74676014035e-02 5.71366804742e-02 5.48533676650e-02 5.13723037105e-02 - 4.79609401864e-02 4.58777097769e-02 4.58777097769e-02 4.79609401864e-02 5.13723037105e-02 5.48533676650e-02 - 5.71366804742e-02 5.74676014035e-02 5.58153453540e-02 5.26787408684e-02 4.87273692032e-02 4.45431970579e-02 - 4.44094609233e-02 4.10670403681e-02 3.81345549630e-02 3.56312088557e-02 3.35871770820e-02 3.20546920774e-02 - 3.10978190541e-02 3.07715106065e-02 3.10978190541e-02 3.20546920774e-02 3.35871770820e-02 3.56312088557e-02 - 3.81345549630e-02 4.10670403681e-02 4.44094609233e-02 4.81082332430e-02 5.20033431247e-02 5.57595749637e-02 - 5.88318176265e-02 6.05090723285e-02 6.01184381094e-02 5.74105494947e-02 5.29210396854e-02 4.79609401864e-02 - 4.41366450522e-02 4.27064575993e-02 4.41366450522e-02 4.79609401864e-02 5.29210396854e-02 5.74105494947e-02 - 6.01184381094e-02 6.05090723285e-02 5.88318176265e-02 5.57595749637e-02 5.20033431247e-02 4.81082332430e-02 - 4.91148354625e-02 4.60913389830e-02 4.33721592307e-02 4.09927131873e-02 3.90347179512e-02 3.76190713504e-02 - 3.68707660171e-02 3.68707660171e-02 3.76190713504e-02 3.90347179512e-02 4.09927131873e-02 4.33721592307e-02 - 4.60913389830e-02 4.91148354625e-02 5.24194501424e-02 5.59201471811e-02 5.93841418824e-02 6.23688231248e-02 - 6.42180018992e-02 6.41840706496e-02 6.17513938278e-02 5.70772559013e-02 5.12221625406e-02 4.58777097769e-02 - 4.27064575993e-02 4.27064575993e-02 4.58777097769e-02 5.12221625406e-02 5.70772559013e-02 6.17513938278e-02 - 6.41840706496e-02 6.42180018992e-02 6.23688231248e-02 5.93841418824e-02 5.59201471811e-02 5.24194501424e-02 - 5.45841783826e-02 5.18355302331e-02 4.92182336225e-02 4.68264624901e-02 4.48486167771e-02 4.35234290368e-02 - 4.30547772101e-02 4.35234290368e-02 4.48486167771e-02 4.68264624901e-02 4.92182336225e-02 5.18355302331e-02 - 5.45841783826e-02 5.74494623672e-02 6.04237632524e-02 6.34040688222e-02 6.61022866145e-02 6.80033074139e-02 - 6.84139609392e-02 6.66786802062e-02 6.25800698666e-02 5.67236888968e-02 5.05555186569e-02 4.58777097769e-02 - 4.41366450522e-02 4.58777097769e-02 5.05555186569e-02 5.67236888968e-02 6.25800698666e-02 6.66786802062e-02 - 6.84139609392e-02 6.80033074139e-02 6.61022866145e-02 6.34040688222e-02 6.04237632524e-02 5.74494623672e-02 - 6.05796981280e-02 5.78981879671e-02 5.51031089527e-02 5.24339557043e-02 5.02828320119e-02 4.90700187394e-02 - 4.90700187394e-02 5.02828320119e-02 5.24339557043e-02 5.51031089527e-02 5.78981879671e-02 6.05796981280e-02 - 6.30873277659e-02 6.54719417706e-02 6.77723654588e-02 6.98920688762e-02 7.15201290633e-02 7.21264918488e-02 - 7.10787520021e-02 6.79320857310e-02 6.28259810566e-02 5.67236888968e-02 5.12221625406e-02 4.79609401864e-02 - 4.79609401864e-02 5.12221625406e-02 5.67236888968e-02 6.28259810566e-02 6.79320857310e-02 7.10787520021e-02 - 7.21264918488e-02 7.15201290633e-02 6.98920688762e-02 6.77723654588e-02 6.54719417706e-02 6.30873277659e-02 - 6.64898780493e-02 6.33842515281e-02 5.98878714669e-02 5.65511919643e-02 5.41129564364e-02 5.32152215954e-02 - 5.41129564364e-02 5.65511919643e-02 5.98878714669e-02 6.33842515281e-02 6.64898780493e-02 6.89793219251e-02 - 7.09081350393e-02 7.24538631804e-02 7.37387049341e-02 7.47020608958e-02 7.50510418428e-02 7.43082663472e-02 - 7.19923628057e-02 6.79320857310e-02 6.25800698666e-02 5.70772559013e-02 5.29210396854e-02 5.13723037105e-02 - 5.29210396854e-02 5.70772559013e-02 6.25800698666e-02 6.79320857310e-02 7.19923628057e-02 7.43082663472e-02 - 7.50510418428e-02 7.47020608958e-02 7.37387049341e-02 7.24538631804e-02 7.09081350393e-02 6.89793219251e-02 - 7.10787520021e-02 6.66786802062e-02 6.17513938278e-02 5.74105494947e-02 5.48533676650e-02 5.48533676650e-02 - 5.74105494947e-02 6.17513938278e-02 6.66786802062e-02 7.10787520021e-02 7.43082663472e-02 7.62783857555e-02 - 7.72682499914e-02 7.76449689484e-02 7.76449689484e-02 7.72682499914e-02 7.62783857555e-02 7.43082663472e-02 - 7.10787520021e-02 6.66786802062e-02 6.17513938278e-02 5.74105494947e-02 5.48533676650e-02 5.48533676650e-02 - 5.74105494947e-02 6.17513938278e-02 6.66786802062e-02 7.10787520021e-02 7.43082663472e-02 7.62783857555e-02 - 7.72682499914e-02 7.76449689484e-02 7.76449689484e-02 7.72682499914e-02 7.62783857555e-02 7.43082663472e-02 - 7.23556493700e-02 6.55787911247e-02 5.86758842735e-02 5.34983990182e-02 5.15765048907e-02 5.34983990182e-02 - 5.86758842735e-02 6.55787911247e-02 7.23556493700e-02 7.75631573239e-02 8.06097207709e-02 8.16998180862e-02 - 8.14375530661e-02 8.04193974336e-02 7.90059272690e-02 7.72682499914e-02 7.50510418428e-02 7.21264918488e-02 - 6.84139609392e-02 6.41840706496e-02 6.01184381094e-02 5.71366804742e-02 5.60372557288e-02 5.71366804742e-02 - 6.01184381094e-02 6.41840706496e-02 6.84139609392e-02 7.21264918488e-02 7.50510418428e-02 7.72682499914e-02 - 7.90059272690e-02 8.04193974336e-02 8.14375530661e-02 8.16998180862e-02 8.06097207709e-02 7.75631573239e-02 - 6.81077724909e-02 5.83777841365e-02 4.98718618187e-02 4.49279278957e-02 4.49279278957e-02 4.98718618187e-02 - 5.83777841365e-02 6.81077724909e-02 7.66122811094e-02 8.22656900591e-02 8.47143937707e-02 8.45957298814e-02 - 8.28911486673e-02 8.04193974336e-02 7.76449689484e-02 7.47020608958e-02 7.15201290633e-02 6.80033074139e-02 - 6.42180018992e-02 6.05090723285e-02 5.74676014035e-02 5.57363453523e-02 5.57363453523e-02 5.74676014035e-02 - 6.05090723285e-02 6.42180018992e-02 6.80033074139e-02 7.15201290633e-02 7.47020608958e-02 7.76449689484e-02 - 8.04193974336e-02 8.28911486673e-02 8.45957298814e-02 8.47143937707e-02 8.22656900591e-02 7.66122811094e-02 - 5.74463352203e-02 4.56222411881e-02 3.71417160544e-02 3.40771392673e-02 3.71417160544e-02 4.56222411881e-02 - 5.74463352203e-02 6.96179820017e-02 7.92532152557e-02 8.47410728024e-02 8.61408122915e-02 8.45957298814e-02 - 8.14375530661e-02 7.76449689484e-02 7.37387049341e-02 6.98920688762e-02 6.61022866145e-02 6.23688231248e-02 - 5.88318176265e-02 5.58153453540e-02 5.37510492057e-02 5.30133769166e-02 5.37510492057e-02 5.58153453540e-02 - 5.88318176265e-02 6.23688231248e-02 6.61022866145e-02 6.98920688762e-02 7.37387049341e-02 7.76449689484e-02 - 8.14375530661e-02 8.45957298814e-02 8.61408122915e-02 8.47410728024e-02 7.92532152557e-02 6.96179820017e-02 - 4.22847991283e-02 3.06594619284e-02 2.42761411551e-02 2.42761411551e-02 3.06594619284e-02 4.22847991283e-02 - 5.66663226477e-02 7.03323963389e-02 8.01500628124e-02 8.47410728024e-02 8.47143937707e-02 8.16998180862e-02 - 7.72682499914e-02 7.24538631804e-02 6.77723654588e-02 6.34040688222e-02 5.93841418824e-02 5.57595749637e-02 - 5.26787408684e-02 5.03893328752e-02 4.91578982971e-02 4.91578982971e-02 5.03893328752e-02 5.26787408684e-02 - 5.57595749637e-02 5.93841418824e-02 6.34040688222e-02 6.77723654588e-02 7.24538631804e-02 7.72682499914e-02 - 8.16998180862e-02 8.47143937707e-02 8.47410728024e-02 8.01500628124e-02 7.03323963389e-02 5.66663226477e-02 - 2.67478820537e-02 1.76819501362e-02 1.45732066269e-02 1.76819501362e-02 2.67478820537e-02 4.05694134160e-02 - 5.63846435627e-02 7.03323963389e-02 7.92532152557e-02 8.22656900591e-02 8.06097207709e-02 7.62783857555e-02 - 7.09081350393e-02 6.54719417706e-02 6.04237632524e-02 5.59201471811e-02 5.20033431247e-02 4.87273692032e-02 - 4.62088704848e-02 4.46053414397e-02 4.40529168852e-02 4.46053414397e-02 4.62088704848e-02 4.87273692032e-02 - 5.20033431247e-02 5.59201471811e-02 6.04237632524e-02 6.54719417706e-02 7.09081350393e-02 7.62783857555e-02 - 8.06097207709e-02 8.22656900591e-02 7.92532152557e-02 7.03323963389e-02 5.63846435627e-02 4.05694134160e-02 - 1.46090879135e-02 9.13060134292e-03 9.13060134292e-03 1.46090879135e-02 2.54935088837e-02 4.05694134160e-02 - 5.66663226477e-02 6.96179820017e-02 7.66122811094e-02 7.75631573239e-02 7.43082663472e-02 6.89793219251e-02 - 6.30873277659e-02 5.74494623672e-02 5.24194501424e-02 4.81082332430e-02 4.45431970579e-02 4.17618689283e-02 - 3.98358227133e-02 3.88462459817e-02 3.88462459817e-02 3.98358227133e-02 4.17618689283e-02 4.45431970579e-02 - 4.81082332430e-02 5.24194501424e-02 5.74494623672e-02 6.30873277659e-02 6.89793219251e-02 7.43082663472e-02 - 7.75631573239e-02 7.66122811094e-02 6.96179820017e-02 5.66663226477e-02 4.05694134160e-02 2.54935088837e-02 - 2.64004483879e-03 2.64004483879e-03 6.32692063078e-03 1.46090879135e-02 2.77489957459e-02 4.35588929466e-02 - 5.76200322747e-02 6.60504635380e-02 6.79320857310e-02 6.49555724266e-02 5.94941697642e-02 5.33236907840e-02 - 4.74313143781e-02 4.22610610741e-02 3.79563421300e-02 3.45282284639e-02 3.19590319446e-02 3.02423286704e-02 - 2.93819034216e-02 2.93819034216e-02 3.02423286704e-02 3.19590319446e-02 3.45282284639e-02 3.79563421300e-02 - 4.22610610741e-02 4.74313143781e-02 5.33236907840e-02 5.94941697642e-02 6.49555724266e-02 6.79320857310e-02 - 6.60504635380e-02 5.76200322747e-02 4.35588929466e-02 2.77489957459e-02 1.46090879135e-02 6.32692063078e-03 - 2.64004483879e-03 4.10298626852e-03 9.13060134292e-03 1.87771308641e-02 3.25101129901e-02 4.70389926376e-02 - 5.79103146750e-02 6.25800698666e-02 6.15702941626e-02 5.70612480291e-02 5.11403130173e-02 4.51323632879e-02 - 3.97029159910e-02 3.51127517762e-02 3.14127386696e-02 2.85763383726e-02 2.65706573512e-02 2.53749373622e-02 - 2.49776956914e-02 2.53749373622e-02 2.65706573512e-02 2.85763383726e-02 3.14127386696e-02 3.51127517762e-02 - 3.97029159910e-02 4.51323632879e-02 5.11403130173e-02 5.70612480291e-02 6.15702941626e-02 6.25800698666e-02 - 5.79103146750e-02 4.70389926376e-02 3.25101129901e-02 1.87771308641e-02 9.13060134292e-03 4.10298626852e-03 - 6.32692063078e-03 9.13060134292e-03 1.56860392578e-02 2.63856510811e-02 3.93541671489e-02 5.07010770424e-02 - 5.70772559013e-02 5.77843769256e-02 5.43692149489e-02 4.89192305177e-02 4.29832635915e-02 3.74259862301e-02 - 3.26341221073e-02 2.87187367840e-02 2.56635113913e-02 2.34202555044e-02 2.19482820950e-02 2.12198093897e-02 - 2.12198093897e-02 2.19482820950e-02 2.34202555044e-02 2.56635113913e-02 2.87187367840e-02 3.26341221073e-02 - 3.74259862301e-02 4.29832635915e-02 4.89192305177e-02 5.43692149489e-02 5.77843769256e-02 5.70772559013e-02 - 5.07010770424e-02 3.93541671489e-02 2.63856510811e-02 1.56860392578e-02 9.13060134292e-03 6.32692063078e-03 - 1.46090879135e-02 1.87771308641e-02 2.63856510811e-02 3.65582592974e-02 4.64751950426e-02 5.29210396854e-02 - 5.44475263977e-02 5.18281863755e-02 4.68401774785e-02 4.10571769449e-02 3.54595415232e-02 3.05340710560e-02 - 2.64534808200e-02 2.32231030162e-02 2.07887392229e-02 1.90940368490e-02 1.80960146721e-02 1.77666865554e-02 - 1.80960146721e-02 1.90940368490e-02 2.07887392229e-02 2.32231030162e-02 2.64534808200e-02 3.05340710560e-02 - 3.54595415232e-02 4.10571769449e-02 4.68401774785e-02 5.18281863755e-02 5.44475263977e-02 5.29210396854e-02 - 4.64751950426e-02 3.65582592974e-02 2.63856510811e-02 1.87771308641e-02 1.46090879135e-02 1.33581335706e-02 - 2.77489957459e-02 3.25101129901e-02 3.93541671489e-02 4.64751950426e-02 5.13723037105e-02 5.24797871309e-02 - 4.99825941802e-02 4.51877782102e-02 3.94908104948e-02 3.38635928392e-02 2.88348357920e-02 2.46187421852e-02 - 2.12421582644e-02 1.86504890434e-02 1.67754563001e-02 1.55601992220e-02 1.49636867906e-02 1.49636867906e-02 - 1.55601992220e-02 1.67754563001e-02 1.86504890434e-02 2.12421582644e-02 2.46187421852e-02 2.88348357920e-02 - 3.38635928392e-02 3.94908104948e-02 4.51877782102e-02 4.99825941802e-02 5.24797871309e-02 5.13723037105e-02 - 4.64751950426e-02 3.93541671489e-02 3.25101129901e-02 2.77489957459e-02 2.54935088837e-02 2.54935088837e-02 - 4.35588929466e-02 4.70389926376e-02 5.07010770424e-02 5.29210396854e-02 5.24797871309e-02 4.93048229800e-02 - 4.42634768270e-02 3.84534160516e-02 3.27229087590e-02 2.75721078901e-02 2.32217587400e-02 1.97084075068e-02 - 1.69767793036e-02 1.49488960464e-02 1.35553259639e-02 1.27424344623e-02 1.24755048074e-02 1.27424344623e-02 - 1.35553259639e-02 1.49488960464e-02 1.69767793036e-02 1.97084075068e-02 2.32217587400e-02 2.75721078901e-02 - 3.27229087590e-02 3.84534160516e-02 4.42634768270e-02 4.93048229800e-02 5.24797871309e-02 5.29210396854e-02 - 5.07010770424e-02 4.70389926376e-02 4.35588929466e-02 4.13123485649e-02 4.05694134160e-02 4.13123485649e-02 - 5.76200322747e-02 5.79103146750e-02 5.70772559013e-02 5.44475263977e-02 4.99825941802e-02 4.42634768270e-02 - 3.80886538087e-02 3.21243272248e-02 2.67889182249e-02 2.22755921268e-02 1.86137801375e-02 1.57423428102e-02 - 1.35733603577e-02 1.20255038743e-02 1.10330000246e-02 1.05489279259e-02 1.05489279259e-02 1.10330000246e-02 - 1.20255038743e-02 1.35733603577e-02 1.57423428102e-02 1.86137801375e-02 2.22755921268e-02 2.67889182249e-02 - 3.21243272248e-02 3.80886538087e-02 4.42634768270e-02 4.99825941802e-02 5.44475263977e-02 5.70772559013e-02 - 5.79103146750e-02 5.76200322747e-02 5.70355201353e-02 5.66663226477e-02 5.66663226477e-02 5.70355201353e-02 - 6.60504635380e-02 6.25800698666e-02 5.77843769256e-02 5.18281863755e-02 4.51877782102e-02 3.84534160516e-02 - 3.21243272248e-02 2.65227612839e-02 2.17964249596e-02 1.79555609317e-02 1.49279448733e-02 1.26143883181e-02 - 1.09215936737e-02 9.77183223433e-03 9.10613117226e-03 8.88822832040e-03 9.10613117226e-03 9.77183223433e-03 - 1.09215936737e-02 1.26143883181e-02 1.49279448733e-02 1.79555609317e-02 2.17964249596e-02 2.65227612839e-02 - 3.21243272248e-02 3.84534160516e-02 4.51877782102e-02 5.18281863755e-02 5.77843769256e-02 6.25800698666e-02 - 6.60504635380e-02 6.83266751007e-02 6.96179820017e-02 7.00400365127e-02 6.96179820017e-02 6.83266751007e-02 - 6.79320857310e-02 6.15702941626e-02 5.43692149489e-02 4.68401774785e-02 3.94908104948e-02 3.27229087590e-02 - 2.67889182249e-02 2.17964249596e-02 1.77355963866e-02 1.45226393383e-02 1.20475550421e-02 1.02054916185e-02 - 8.90705726329e-03 8.08133005705e-03 7.68014935330e-03 7.68014935330e-03 8.08133005705e-03 8.90705726329e-03 - 1.02054916185e-02 1.20475550421e-02 1.45226393383e-02 1.77355963866e-02 2.17964249596e-02 2.67889182249e-02 - 3.27229087590e-02 3.94908104948e-02 4.68401774785e-02 5.43692149489e-02 6.15702941626e-02 6.79320857310e-02 - 7.30418134594e-02 7.66122811094e-02 7.84511058955e-02 7.84511058955e-02 7.66122811094e-02 7.30418134594e-02 - 6.49555724266e-02 5.70612480291e-02 4.89192305177e-02 4.10571769449e-02 3.38635928392e-02 2.75721078901e-02 - 2.22755921268e-02 1.79555609317e-02 1.45226393383e-02 1.18598583649e-02 9.85294674885e-03 8.40200942373e-03 - 7.42492384580e-03 6.86170422323e-03 6.67761981445e-03 6.86170422323e-03 7.42492384580e-03 8.40200942373e-03 - 9.85294674885e-03 1.18598583649e-02 1.45226393383e-02 1.79555609317e-02 2.22755921268e-02 2.75721078901e-02 - 3.38635928392e-02 4.10571769449e-02 4.89192305177e-02 5.70612480291e-02 6.49555724266e-02 7.19923628057e-02 - 7.75631573239e-02 8.11458755837e-02 8.23828782457e-02 8.11458755837e-02 7.75631573239e-02 7.19923628057e-02 - 5.94941697642e-02 5.11403130173e-02 4.29832635915e-02 3.54595415232e-02 2.88348357920e-02 2.32217587400e-02 - 1.86137801375e-02 1.49279448733e-02 1.20475550421e-02 9.85294674885e-03 8.23585736203e-03 7.10459522193e-03 - 6.38840491477e-03 6.04118457084e-03 6.04118457084e-03 6.38840491477e-03 7.10459522193e-03 8.23585736203e-03 - 9.85294674885e-03 1.20475550421e-02 1.49279448733e-02 1.86137801375e-02 2.32217587400e-02 2.88348357920e-02 - 3.54595415232e-02 4.29832635915e-02 5.11403130173e-02 5.94941697642e-02 6.74494907981e-02 7.43082663472e-02 - 7.93709590427e-02 8.20645507484e-02 8.20645507484e-02 7.93709590427e-02 7.43082663472e-02 6.74494907981e-02 - 5.33236907840e-02 4.51323632879e-02 3.74259862301e-02 3.05340710560e-02 2.46187421852e-02 1.97084075068e-02 - 1.57423428102e-02 1.26143883181e-02 1.02054916185e-02 8.40200942373e-03 7.10459522193e-03 6.23361812745e-03 - 5.73268604942e-03 5.56920678348e-03 5.73268604942e-03 6.23361812745e-03 7.10459522193e-03 8.40200942373e-03 - 1.02054916185e-02 1.26143883181e-02 1.57423428102e-02 1.97084075068e-02 2.46187421852e-02 3.05340710560e-02 - 3.74259862301e-02 4.51323632879e-02 5.33236907840e-02 6.14923433640e-02 6.89793219251e-02 7.50510418428e-02 - 7.90236437036e-02 8.04073084192e-02 7.90236437036e-02 7.50510418428e-02 6.89793219251e-02 6.14923433640e-02 - 4.74313143781e-02 3.97029159910e-02 3.26341221073e-02 2.64534808200e-02 2.12421582644e-02 1.69767793036e-02 - 1.35733603577e-02 1.09215936737e-02 8.90705726329e-03 7.42492384580e-03 6.38840491477e-03 5.73268604942e-03 - 5.41531278039e-03 5.41531278039e-03 5.73268604942e-03 6.38840491477e-03 7.42492384580e-03 8.90705726329e-03 - 1.09215936737e-02 1.35733603577e-02 1.69767793036e-02 2.12421582644e-02 2.64534808200e-02 3.26341221073e-02 - 3.97029159910e-02 4.74313143781e-02 5.54167137150e-02 6.30873277659e-02 6.97522426294e-02 7.47020608958e-02 - 7.73458021392e-02 7.73458021392e-02 7.47020608958e-02 6.97522426294e-02 6.30873277659e-02 5.54167137150e-02 - 4.22610610741e-02 3.51127517762e-02 2.87187367840e-02 2.32231030162e-02 1.86504890434e-02 1.49488960464e-02 - 1.20255038743e-02 9.77183223433e-03 8.08133005705e-03 6.86170422323e-03 6.04118457084e-03 5.56920678348e-03 - 5.41531278039e-03 5.56920678348e-03 6.04118457084e-03 6.86170422323e-03 8.08133005705e-03 9.77183223433e-03 - 1.20255038743e-02 1.49488960464e-02 1.86504890434e-02 2.32231030162e-02 2.87187367840e-02 3.51127517762e-02 - 4.22610610741e-02 4.98633146719e-02 5.74494623672e-02 6.44054743742e-02 7.00474085615e-02 7.37387049341e-02 - 7.50243106749e-02 7.37387049341e-02 7.00474085615e-02 6.44054743742e-02 5.74494623672e-02 4.98633146719e-02 - 3.79563421300e-02 3.14127386696e-02 2.56635113913e-02 2.07887392229e-02 1.67754563001e-02 1.35553259639e-02 - 1.10330000246e-02 9.10613117226e-03 7.68014935330e-03 6.67761981445e-03 6.04118457084e-03 5.73268604942e-03 - 5.73268604942e-03 6.04118457084e-03 6.67761981445e-03 7.68014935330e-03 9.10613117226e-03 1.10330000246e-02 - 1.35553259639e-02 1.67754563001e-02 2.07887392229e-02 2.56635113913e-02 3.14127386696e-02 3.79563421300e-02 - 4.50819394473e-02 5.24194501424e-02 5.94462807362e-02 6.55352798807e-02 7.00474085615e-02 7.24538631804e-02 - 7.24538631804e-02 7.00474085615e-02 6.55352798807e-02 5.94462807362e-02 5.24194501424e-02 4.50819394473e-02 - 3.45282284639e-02 2.85763383726e-02 2.34202555044e-02 1.90940368490e-02 1.55601992220e-02 1.27424344623e-02 - 1.05489279259e-02 8.88822832040e-03 7.68014935330e-03 6.86170422323e-03 6.38840491477e-03 6.23361812745e-03 - 6.38840491477e-03 6.86170422323e-03 7.68014935330e-03 8.88822832040e-03 1.05489279259e-02 1.27424344623e-02 - 1.55601992220e-02 1.90940368490e-02 2.34202555044e-02 2.85763383726e-02 3.45282284639e-02 4.11328816616e-02 - 4.81082332430e-02 5.50251512552e-02 6.13334872428e-02 6.64284767715e-02 6.97522426294e-02 7.09081350393e-02 - 6.97522426294e-02 6.64284767715e-02 6.13334872428e-02 5.50251512552e-02 4.81082332430e-02 4.11328816616e-02 - 3.19590319446e-02 2.65706573512e-02 2.19482820950e-02 1.80960146721e-02 1.49636867906e-02 1.24755048074e-02 - 1.05489279259e-02 9.10613117226e-03 8.08133005705e-03 7.42492384580e-03 7.10459522193e-03 7.10459522193e-03 - 7.42492384580e-03 8.08133005705e-03 9.10613117226e-03 1.05489279259e-02 1.24755048074e-02 1.49636867906e-02 - 1.80960146721e-02 2.19482820950e-02 2.65706573512e-02 3.19590319446e-02 3.80204685260e-02 4.45431970579e-02 - 5.11831265828e-02 5.74762428735e-02 6.28828729732e-02 6.68641206041e-02 6.89793219251e-02 6.89793219251e-02 - 6.68641206041e-02 6.28828729732e-02 5.74762428735e-02 5.11831265828e-02 4.45431970579e-02 3.80204685260e-02 - 3.02423286704e-02 2.53749373622e-02 2.12198093897e-02 1.77666865554e-02 1.49636867906e-02 1.27424344623e-02 - 1.10330000246e-02 9.77183223433e-03 8.90705726329e-03 8.40200942373e-03 8.23585736203e-03 8.40200942373e-03 - 8.90705726329e-03 9.77183223433e-03 1.10330000246e-02 1.27424344623e-02 1.49636867906e-02 1.77666865554e-02 - 2.12198093897e-02 2.53749373622e-02 3.02423286704e-02 3.57591480990e-02 4.17618689283e-02 4.79731106469e-02 - 5.40097122002e-02 5.94150808572e-02 6.37149803432e-02 6.64898780493e-02 6.74494907981e-02 6.64898780493e-02 - 6.37149803432e-02 5.94150808572e-02 5.40097122002e-02 4.79731106469e-02 4.17618689283e-02 3.57591480990e-02 - 2.93819034216e-02 2.49776956914e-02 2.12198093897e-02 1.80960146721e-02 1.55601992220e-02 1.35553259639e-02 - 1.20255038743e-02 1.09215936737e-02 1.02054916185e-02 9.85294674885e-03 9.85294674885e-03 1.02054916185e-02 - 1.09215936737e-02 1.20255038743e-02 1.35553259639e-02 1.55601992220e-02 1.80960146721e-02 2.12198093897e-02 - 2.49776956914e-02 2.93819034216e-02 3.43811654173e-02 3.98358227133e-02 4.55081727847e-02 5.10737783335e-02 - 5.61547897924e-02 6.03694423859e-02 6.33842515281e-02 6.49555724266e-02 6.49555724266e-02 6.33842515281e-02 - 6.03694423859e-02 5.61547897924e-02 5.10737783335e-02 4.55081727847e-02 3.98358227133e-02 3.43811654173e-02 - 2.93819034216e-02 2.53749373622e-02 2.19482820950e-02 1.90940368490e-02 1.67754563001e-02 1.49488960464e-02 - 1.35733603577e-02 1.26143883181e-02 1.20475550421e-02 1.18598583649e-02 1.20475550421e-02 1.26143883181e-02 - 1.35733603577e-02 1.49488960464e-02 1.67754563001e-02 1.90940368490e-02 2.19482820950e-02 2.53749373622e-02 - 2.93819034216e-02 3.39176800802e-02 3.88462459817e-02 4.39402098517e-02 4.88987422193e-02 5.33923081840e-02 - 5.71251588417e-02 5.98878714669e-02 6.15702941626e-02 6.21334821617e-02 6.15702941626e-02 5.98878714669e-02 - 5.71251588417e-02 5.33923081840e-02 4.88987422193e-02 4.39402098517e-02 3.88462459817e-02 3.39176800802e-02 - 3.02423286704e-02 2.65706573512e-02 2.34202555044e-02 2.07887392229e-02 1.86504890434e-02 1.69767793036e-02 - 1.57423428102e-02 1.49279448733e-02 1.45226393383e-02 1.45226393383e-02 1.49279448733e-02 1.57423428102e-02 - 1.69767793036e-02 1.86504890434e-02 2.07887392229e-02 2.34202555044e-02 2.65706573512e-02 3.02423286704e-02 - 3.43811654173e-02 3.88462459817e-02 4.34003076052e-02 4.77311231410e-02 5.15101646150e-02 5.44829894560e-02 - 5.65511919643e-02 5.77843769256e-02 5.83399236929e-02 5.83399236929e-02 5.77843769256e-02 5.65511919643e-02 - 5.44829894560e-02 5.15101646150e-02 4.77311231410e-02 4.34003076052e-02 3.88462459817e-02 3.43811654173e-02 - 3.19590319446e-02 2.85763383726e-02 2.56635113913e-02 2.32231030162e-02 2.12421582644e-02 1.97084075068e-02 - 1.86137801375e-02 1.79555609317e-02 1.77355963866e-02 1.79555609317e-02 1.86137801375e-02 1.97084075068e-02 - 2.12421582644e-02 2.32231030162e-02 2.56635113913e-02 2.85763383726e-02 3.19590319446e-02 3.57591480990e-02 - 3.98358227133e-02 4.39402098517e-02 4.77311231410e-02 5.08390344517e-02 5.29846351657e-02 5.41129564364e-02 - 5.44475263977e-02 5.43925934286e-02 5.43239294918e-02 5.43925934286e-02 5.44475263977e-02 5.41129564364e-02 - 5.29846351657e-02 5.08390344517e-02 4.77311231410e-02 4.39402098517e-02 3.98358227133e-02 3.57591480990e-02 - 3.45282284639e-02 3.14127386696e-02 2.87187367840e-02 2.64534808200e-02 2.46187421852e-02 2.32217587400e-02 - 2.22755921268e-02 2.17964249596e-02 2.17964249596e-02 2.22755921268e-02 2.32217587400e-02 2.46187421852e-02 - 2.64534808200e-02 2.87187367840e-02 3.14127386696e-02 3.45282284639e-02 3.80204685260e-02 4.17618689283e-02 - 4.55081727847e-02 4.88987422193e-02 5.15101646150e-02 5.29846351657e-02 5.32152215954e-02 5.24797871309e-02 - 5.13869204668e-02 5.06194135765e-02 5.06194135765e-02 5.13869204668e-02 5.24797871309e-02 5.32152215954e-02 - 5.29846351657e-02 5.15101646150e-02 4.88987422193e-02 4.55081727847e-02 4.17618689283e-02 3.80204685260e-02 - 3.79563421300e-02 3.51127517762e-02 3.26341221073e-02 3.05340710560e-02 2.88348357920e-02 2.75721078901e-02 - 2.67889182249e-02 2.65227612839e-02 2.67889182249e-02 2.75721078901e-02 2.88348357920e-02 3.05340710560e-02 - 3.26341221073e-02 3.51127517762e-02 3.79563421300e-02 4.11328816616e-02 4.45431970579e-02 4.79731106469e-02 - 5.10737783335e-02 5.33923081840e-02 5.44829894560e-02 5.41129564364e-02 5.24797871309e-02 5.02620593726e-02 - 4.83941231678e-02 4.76689314688e-02 4.83941231678e-02 5.02620593726e-02 5.24797871309e-02 5.41129564364e-02 - 5.44829894560e-02 5.33923081840e-02 5.10737783335e-02 4.79731106469e-02 4.45431970579e-02 4.11328816616e-02 - 4.22610610741e-02 3.97029159910e-02 3.74259862301e-02 3.54595415232e-02 3.38635928392e-02 3.27229087590e-02 - 3.21243272248e-02 3.21243272248e-02 3.27229087590e-02 3.38635928392e-02 3.54595415232e-02 3.74259862301e-02 - 3.97029159910e-02 4.22610610741e-02 4.50819394473e-02 4.81082332430e-02 5.11831265828e-02 5.40097122002e-02 - 5.61547897924e-02 5.71251588417e-02 5.65511919643e-02 5.44475263977e-02 5.13869204668e-02 4.83941231678e-02 - 4.65545163206e-02 4.65545163206e-02 4.83941231678e-02 5.13869204668e-02 5.44475263977e-02 5.65511919643e-02 - 5.71251588417e-02 5.61547897924e-02 5.40097122002e-02 5.11831265828e-02 4.81082332430e-02 4.50819394473e-02 - 4.74313143781e-02 4.51323632879e-02 4.29832635915e-02 4.10571769449e-02 3.94908104948e-02 3.84534160516e-02 - 3.80886538087e-02 3.84534160516e-02 3.94908104948e-02 4.10571769449e-02 4.29832635915e-02 4.51323632879e-02 - 4.74313143781e-02 4.98633146719e-02 5.24194501424e-02 5.50251512552e-02 5.74762428735e-02 5.94150808572e-02 - 6.03694423859e-02 5.98878714669e-02 5.77843769256e-02 5.43925934286e-02 5.06194135765e-02 4.76689314688e-02 - 4.65545163206e-02 4.76689314688e-02 5.06194135765e-02 5.43925934286e-02 5.77843769256e-02 5.98878714669e-02 - 6.03694423859e-02 5.94150808572e-02 5.74762428735e-02 5.50251512552e-02 5.24194501424e-02 4.98633146719e-02 - 5.33236907840e-02 5.11403130173e-02 4.89192305177e-02 4.68401774785e-02 4.51877782102e-02 4.42634768270e-02 - 4.42634768270e-02 4.51877782102e-02 4.68401774785e-02 4.89192305177e-02 5.11403130173e-02 5.33236907840e-02 - 5.54167137150e-02 5.74494623672e-02 5.94462807362e-02 6.13334872428e-02 6.28828729732e-02 6.37149803432e-02 - 6.33842515281e-02 6.15702941626e-02 5.83399236929e-02 5.43239294918e-02 5.06194135765e-02 4.83941231678e-02 - 4.83941231678e-02 5.06194135765e-02 5.43239294918e-02 5.83399236929e-02 6.15702941626e-02 6.33842515281e-02 - 6.37149803432e-02 6.28828729732e-02 6.13334872428e-02 5.94462807362e-02 5.74494623672e-02 5.54167137150e-02 - 5.94941697642e-02 5.70612480291e-02 5.43692149489e-02 5.18281863755e-02 4.99825941802e-02 4.93048229800e-02 - 4.99825941802e-02 5.18281863755e-02 5.43692149489e-02 5.70612480291e-02 5.94941697642e-02 6.14923433640e-02 - 6.30873277659e-02 6.44054743742e-02 6.55352798807e-02 6.64284767715e-02 6.68641206041e-02 6.64898780493e-02 - 6.49555724266e-02 6.21334821617e-02 5.83399236929e-02 5.43925934286e-02 5.13869204668e-02 5.02620593726e-02 - 5.13869204668e-02 5.43925934286e-02 5.83399236929e-02 6.21334821617e-02 6.49555724266e-02 6.64898780493e-02 - 6.68641206041e-02 6.64284767715e-02 6.55352798807e-02 6.44054743742e-02 6.30873277659e-02 6.14923433640e-02 - 6.49555724266e-02 6.15702941626e-02 5.77843769256e-02 5.44475263977e-02 5.24797871309e-02 5.24797871309e-02 - 5.44475263977e-02 5.77843769256e-02 6.15702941626e-02 6.49555724266e-02 6.74494907981e-02 6.89793219251e-02 - 6.97522426294e-02 7.00474085615e-02 7.00474085615e-02 6.97522426294e-02 6.89793219251e-02 6.74494907981e-02 - 6.49555724266e-02 6.15702941626e-02 5.77843769256e-02 5.44475263977e-02 5.24797871309e-02 5.24797871309e-02 - 5.44475263977e-02 5.77843769256e-02 6.15702941626e-02 6.49555724266e-02 6.74494907981e-02 6.89793219251e-02 - 6.97522426294e-02 7.00474085615e-02 7.00474085615e-02 6.97522426294e-02 6.89793219251e-02 6.74494907981e-02 - 6.79320857310e-02 6.25800698666e-02 5.70772559013e-02 5.29210396854e-02 5.13723037105e-02 5.29210396854e-02 - 5.70772559013e-02 6.25800698666e-02 6.79320857310e-02 7.19923628057e-02 7.43082663472e-02 7.50510418428e-02 - 7.47020608958e-02 7.37387049341e-02 7.24538631804e-02 7.09081350393e-02 6.89793219251e-02 6.64898780493e-02 - 6.33842515281e-02 5.98878714669e-02 5.65511919643e-02 5.41129564364e-02 5.32152215954e-02 5.41129564364e-02 - 5.65511919643e-02 5.98878714669e-02 6.33842515281e-02 6.64898780493e-02 6.89793219251e-02 7.09081350393e-02 - 7.24538631804e-02 7.37387049341e-02 7.47020608958e-02 7.50510418428e-02 7.43082663472e-02 7.19923628057e-02 - 6.60504635380e-02 5.79103146750e-02 5.07010770424e-02 4.64751950426e-02 4.64751950426e-02 5.07010770424e-02 - 5.79103146750e-02 6.60504635380e-02 7.30418134594e-02 7.75631573239e-02 7.93709590427e-02 7.90236437036e-02 - 7.73458021392e-02 7.50243106749e-02 7.24538631804e-02 6.97522426294e-02 6.68641206041e-02 6.37149803432e-02 - 6.03694423859e-02 5.71251588417e-02 5.44829894560e-02 5.29846351657e-02 5.29846351657e-02 5.44829894560e-02 - 5.71251588417e-02 6.03694423859e-02 6.37149803432e-02 6.68641206041e-02 6.97522426294e-02 7.24538631804e-02 - 7.50243106749e-02 7.73458021392e-02 7.90236437036e-02 7.93709590427e-02 7.75631573239e-02 7.30418134594e-02 - 5.76200322747e-02 4.70389926376e-02 3.93541671489e-02 3.65582592974e-02 3.93541671489e-02 4.70389926376e-02 - 5.76200322747e-02 6.83266751007e-02 7.66122811094e-02 8.11458755837e-02 8.20645507484e-02 8.04073084192e-02 - 7.73458021392e-02 7.37387049341e-02 7.00474085615e-02 6.64284767715e-02 6.28828729732e-02 5.94150808572e-02 - 5.61547897924e-02 5.33923081840e-02 5.15101646150e-02 5.08390344517e-02 5.15101646150e-02 5.33923081840e-02 - 5.61547897924e-02 5.94150808572e-02 6.28828729732e-02 6.64284767715e-02 7.00474085615e-02 7.37387049341e-02 - 7.73458021392e-02 8.04073084192e-02 8.20645507484e-02 8.11458755837e-02 7.66122811094e-02 6.83266751007e-02 - 4.35588929466e-02 3.25101129901e-02 2.63856510811e-02 2.63856510811e-02 3.25101129901e-02 4.35588929466e-02 - 5.70355201353e-02 6.96179820017e-02 7.84511058955e-02 8.23828782457e-02 8.20645507484e-02 7.90236437036e-02 - 7.47020608958e-02 7.00474085615e-02 6.55352798807e-02 6.13334872428e-02 5.74762428735e-02 5.40097122002e-02 - 5.10737783335e-02 4.88987422193e-02 4.77311231410e-02 4.77311231410e-02 4.88987422193e-02 5.10737783335e-02 - 5.40097122002e-02 5.74762428735e-02 6.13334872428e-02 6.55352798807e-02 7.00474085615e-02 7.47020608958e-02 - 7.90236437036e-02 8.20645507484e-02 8.23828782457e-02 7.84511058955e-02 6.96179820017e-02 5.70355201353e-02 - 2.77489957459e-02 1.87771308641e-02 1.56860392578e-02 1.87771308641e-02 2.77489957459e-02 4.13123485649e-02 - 5.66663226477e-02 7.00400365127e-02 7.84511058955e-02 8.11458755837e-02 7.93709590427e-02 7.50510418428e-02 - 6.97522426294e-02 6.44054743742e-02 5.94462807362e-02 5.50251512552e-02 5.11831265828e-02 4.79731106469e-02 - 4.55081727847e-02 4.39402098517e-02 4.34003076052e-02 4.39402098517e-02 4.55081727847e-02 4.79731106469e-02 - 5.11831265828e-02 5.50251512552e-02 5.94462807362e-02 6.44054743742e-02 6.97522426294e-02 7.50510418428e-02 - 7.93709590427e-02 8.11458755837e-02 7.84511058955e-02 7.00400365127e-02 5.66663226477e-02 4.13123485649e-02 - 1.46090879135e-02 9.13060134292e-03 9.13060134292e-03 1.46090879135e-02 2.54935088837e-02 4.05694134160e-02 - 5.66663226477e-02 6.96179820017e-02 7.66122811094e-02 7.75631573239e-02 7.43082663472e-02 6.89793219251e-02 - 6.30873277659e-02 5.74494623672e-02 5.24194501424e-02 4.81082332430e-02 4.45431970579e-02 4.17618689283e-02 - 3.98358227133e-02 3.88462459817e-02 3.88462459817e-02 3.98358227133e-02 4.17618689283e-02 4.45431970579e-02 - 4.81082332430e-02 5.24194501424e-02 5.74494623672e-02 6.30873277659e-02 6.89793219251e-02 7.43082663472e-02 - 7.75631573239e-02 7.66122811094e-02 6.96179820017e-02 5.66663226477e-02 4.05694134160e-02 2.54935088837e-02 - 6.32692063078e-03 4.10298626852e-03 6.32692063078e-03 1.33581335706e-02 2.54935088837e-02 4.13123485649e-02 - 5.70355201353e-02 6.83266751007e-02 7.30418134594e-02 7.19923628057e-02 6.74494907981e-02 6.14923433640e-02 - 5.54167137150e-02 4.98633146719e-02 4.50819394473e-02 4.11328816616e-02 3.80204685260e-02 3.57591480990e-02 - 3.43811654173e-02 3.39176800802e-02 3.43811654173e-02 3.57591480990e-02 3.80204685260e-02 4.11328816616e-02 - 4.50819394473e-02 4.98633146719e-02 5.54167137150e-02 6.14923433640e-02 6.74494907981e-02 7.19923628057e-02 - 7.30418134594e-02 6.83266751007e-02 5.70355201353e-02 4.13123485649e-02 2.54935088837e-02 1.33581335706e-02 diff --git a/source/module_io/to_qo.h b/source/module_io/to_qo.h deleted file mode 100644 index f7d709aa69..0000000000 --- a/source/module_io/to_qo.h +++ /dev/null @@ -1,249 +0,0 @@ -#ifndef TOQO_H -#define TOQO_H - -#include -#include -#include "source_cell/unitcell.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_base/atom_in.h" -#include "source_base/vector3.h" -/* - Quasiatomic Orbital (QO) transformation and analysis - - Technical details and procedures: - 1. first project a given set of atomic orbitals onto one certain set, nao or pw(not implemented) - AO now supports hydrogen-like radial orbitals - 2. project AO onto the eigenstate, then substrate them from AO, get AO' - 3. Diagonalize AO' and use canoincal orthogonalization to find in total m states (m is arbitrary to user) - 4. merge space spanned by eigenstate and the one of m states - 5. project AO onto this new space basis - - Functionalities: - 1. support different projectors like: - (1) hydrogen-like: full, minimal and double. Full may exceed the dimensional of space of nao, minimal - will not in most cases - (2) pseudowavefunction (pswfc): only avaiable for pseudpotentials with pswfc, unlike SG15. - 2. output overlap between the given projectors and nao, so make it easy to calculate QO and Hamiltonian in - QO representation. - - Workflow: - 1. create an instance of toQO: toQO() - 2. initialize the class: initialize() - 2.1. import information from unitcell: unwrap_unitcell() - 2.2. build orbitals, nao and ao: build_nao() and build_ao() - 2.3. scan neighboring list: scan_supercell() - 2.4. allocate memory for ovlp_ao_nao_R_ and ovlp_ao_nao_k_: clean_up(), deallocate_ovlp() and allocate_ovlp() - 3. calculate overlap S(k): calculate() - 3.1. calculate S(R) for all R: calculate_ovlpk(), calculate_ovlpR() - 3.2. fold S(R) to S(k): fold_ovlpR() -*/ -class toQO -{ - public: - // constructor is identical with what INPUT needs to define a toQO task - // how user defines a QO task in INPUT, how it is constructed here, this - // is to ensure the self-containedness of the class, as much as possible - // to avoid introducing variables not from constructor or other under - // control functions. - toQO(const std::string& qo_basis, //< basis of QO, hydrogen or pswfc - const std::vector& strategies, //< strategies for each atom type, more details see manual - const double& qo_thr, //< threshold for QO - const std::vector& screening_coeffs); //< screening coefficients for pseudowavefunction or Slater screening - ~toQO(); - - // initialize function is to import program-related information, it is, - // more dynamic than constructor because this is actually an interface - // to states of rest of program, unlike constructor, actually defines - // the state of the class. - void initialize(const std::string& out_dir, //< directory of output files - const std::string& pseudo_dir, //< directory of pseudopotentials - const std::string& orbital_dir, //< directory of numerical atomic orbitals - const UnitCell* p_ucell, //< interface to the unitcell - const std::vector>& kvecs_d, //< kpoints - std::ofstream& ofs_running, //< output stream for running information - const int& rank, //< rank of present processor - const int& nranks); //< total number of processors - // import structure, including supercell and kvectors are read in this function - void read_structures(const UnitCell* p_ucell, //< interface to the unitcell - const std::vector>& kvecs_d, //< kpoints - const int& iproc, //< rank of present processor - const int& nprocs); //< total number of processors - - // Two-center integral - // QO is just one kind of representation, here it is representation from numerical - // atomic orbitals spanned space to atomic orbitals spanned space. Therefore two-center - // integral is the core of the whole transformation, it calculates the overlap between - // atomic orbitals and numerical atomic orbitals - // for |>: to build RadialCollection filled with AtomicRadials - void build_nao(const int ntype, //< number of atom types - const std::string orbital_dir, //< directory of numerical atomic orbitals - const std::string* const orbital_fn, //< filenames of numerical atomic orbitals - const int rank); //< rank of present processor - // for <|: to build RadialCollection filled with PswfcRadials or HydrogenRadials - void build_ao(const int ntype, //< number of atom types - const std::string pseudo_dir, //< directory of pseudopotentials - const std::string* const pspot_fn = nullptr, //< filenames of pseudopotentials - const std::vector screening_coeffs = std::vector(), //< screening coefficients of pseudopotentials - const double qo_thr = 1e-10, //< threshold for QO - const std::ofstream& ofs = std::ofstream(), //< output stream for running information - const int rank = 0); //< rank of present processor - // for <|: to build RadialCollection filled with HydrogenRadials - void build_hydrogen(const int ntype, //< number of atom types - const double* const charges, //< charges of atoms - const bool slater_screening, //< whether use slater screening - const int* const nmax, //< maximum principle quantum number of atoms - const double qo_thr, //< threshold for QO - const int rank); //< rank of present processor - // for <|: to build RadialCollection filled with PswfcRadials - void build_pswfc(const int ntype, //< number of atom types - const std::string pseudo_dir, //< directory of pseudopotentials - const std::string* const pspot_fn, //< filenames of pseudopotentials - const double* const screening_coeffs, //< screening coefficients of pseudopotentials, appears like a factor (exp[-s*r]) scaling the pswfc - const double qo_thr, //< threshold for QO - const int rank); //< rank of present processor - void build_szv(); - // EXTERNAL EXPOSED FUNCTION, calculate all things in one shot - void calculate(); - // calculate = Sij(R) - void calculate_ovlpR(const int iR); //< iR index of supercell vector - // calculate = Sij(k) - void calculate_ovlpk(int ik); //< ik index of kpoint - // for overlap I/O - // S to file - template - void write_ovlp(const std::string& dir, //< directory of output files - const std::vector& matrix, //< matrix to write - const int& nrows, //< number of rows - const int& ncols, //< number of columns - const bool& is_R = false, //< whether it is in real space - const int& imat = 0); //< index of matrix - // S from file - void read_ovlp(const std::string& dir, //< directory of output files - const int& nrows, //< number of rows - const int& ncols, //< number of columns - const bool& is_R = false, //< whether it is in real space - const int& imat = 0); //< index of matrix - /// @brief build bidirectional map indexing for one single RadialCollection object, which is an axis of two-center-integral table. - /// @details from (it,ia,l,zeta,m) to index and vice versa - void radialcollection_indexing(const RadialCollection&, //< [in] instance of RadialCollection - const std::vector&, //< [in] number of atoms for each type - const bool&, //< [in] whether enable orbital filtering - std::map,int>&, //< [out] mapping from (it,ia,l,zeta,m) to index - std::map>&); //< [out] mapping from index to (it,ia,l,zeta,m) - /// @brief calculate vectors connecting all atom pairs that needed to calculate their overlap - ModuleBase::Vector3 cal_two_center_vector(ModuleBase::Vector3 rij, //< vector connecting atom i and atom j - ModuleBase::Vector3 R); //< supercell vector - /// @brief when indexing, select where one orbital is really included in the two-center integral - bool orbital_filter_out(const int& itype, //< itype - const int& l, //< angular momentum - const int& izeta //< zeta - ); - - void deallocate_ovlp(const bool& is_R = false); //< deallocate memory for ovlp_ao_nao_R_ or ovlp_ao_nao_k_ - void allocate_ovlp(const bool& is_R = false); //< allocate memory for ovlp_ao_nao_R_ or ovlp_ao_nao_k_ - void zero_out_ovlps(const bool& is_R); //< zero out ovlp_ao_nao_R_ or ovlp_ao_nao_k_ - void append_ovlpR_eiRk(int ik, int iR); //< append S(R) to S(k), memory saving - - // MPI related - static void bcast_stdvector_ofvector3int(std::vector>& vec, - const int rank); - static void bcast_stdvector_ofvector3double(std::vector>& vec, - const int rank); - - // Neighboring list - /// @brief get all possible (n1n2n3) defining supercell and scatter if MPI enabled - void scan_supercell(const int& iproc, //< rank of present processor - const int& nprocs); //< total number of processors - /// @brief this is a basic functional for scanning (ijR) pair for one certain i, return Rs - /// @attention an algorithm loop over (i,)j,R, and return Rs - /// @return a vector collects (n1, n2, n3) for present atom - std::vector> scan_supercell_for_atom(int it, //< type of atom i - int ia, //< index of atom i - int start_it = 0, //< starting scan index of atom type - int start_ia = 0); //< starting scan index of atom - /// @brief core algorithm to scan supercells, find the maximal supercell according to present cutoff radius - /// @return a vector of (n1n2n3) defining supercell - std::vector rcut_to_supercell_index(double rcut, //< sum of cutoff radius of orbitals of atom i and atom j - ModuleBase::Vector3 a, //< cell vector a (in Bohr) - ModuleBase::Vector3 b, //< cell vector b (in Bohr) - ModuleBase::Vector3 c); //< cell vector c (in Bohr) - /// @brief get vector squared norm in supercell - /// @return (rij + n1R1 + n2R2 + n3R3)^2 - double norm2_rij_supercell(ModuleBase::Vector3 rij, //< vector connecting atom i and atom j in unitcell - int n1, //< supercell index 1 - int n2, //< supercell index 2 - int n3); //< supercell index 3 - /// @brief eliminate duplicate vectors in a vector of vector3 - template - void eliminate_duplicate_vector3(std::vector>& vector3s); - /// @brief write supercells information to file - void write_supercells(); - - // getters - int ntype() const { return ntype_; } - int nks() const { return nks_; } - std::string qo_basis() const { return qo_basis_; } - std::vector strategies() const { return strategies_; } - std::string strategy(const int itype) const { return strategies_[itype]; } - UnitCell* p_ucell() const { return const_cast(p_ucell_); } - RadialCollection* p_nao() const { return nao_.get(); } - RadialCollection* p_ao() const { return ao_.get(); } - int nR() const { return nR_; } - int nchi() const { return nchi_; } - int nphi() const { return nphi_; } - std::vector> supercells() const { return supercells_; } - std::vector ovlpR() const { return ovlpR_; } - double ovlpR(const int i, const int j) const { return ovlpR_[i*nchi_+j]; } - std::vector> ovlpk() const { return ovlpk_; } - std::complex ovlpk(const int i, const int j) const { return ovlpk_[i*nchi_+j]; } - std::vector symbols() const { return symbols_; } - std::vector charges() const { return charges_; } - atom_in atom_database() const { return atom_database_; } - std::vector> kvecs_d() const { return kvecs_d_; } - - private: - // Variables defining QO task - std::string qo_basis_ = "hydrogen"; - std::vector strategies_; - double qo_thr_ = 1e-10; - std::vector screening_coeffs_; - // Variables defining I/O - std::string out_dir_; //< directory of output files - std::string pseudo_dir_; //< directory of pseudopotentials - std::string orbital_dir_; //< directory of numerical atomic orbitals - // Variables defining parallelism - int iproc_ = 0; - int nprocs_ = 1; - // variables defining structure - const UnitCell* p_ucell_ = nullptr; //< interface to the unitcell, its lifespan is not managed here - std::vector iRs_; //< indices of supercell vectors (local) - std::vector> supercells_; //< supercell vectors (global) - std::vector iks_; //< indices of kpoints (local) - std::vector> kvecs_d_; //< kpoints (global) - // Two center integral - std::unique_ptr nao_; //< numerical atomic orbitals - std::unique_ptr ao_; //< atomic orbitals - std::unique_ptr overlap_calculator_; //< two center integrator - std::vector ovlpR_; //< overlap between atomic orbitals and numerical atomic orbitals, in real space - std::vector> ovlpk_; //< overlap between atomic orbitals and numerical atomic orbitals, in k space - //< indices - std::map,int> index_ao_; //< mapping from (it,ia,l,zeta,m) to index - std::map> rindex_ao_; //< mapping from index to (it,ia,l,zeta,m) - std::map,int> index_nao_; //< mapping from (it,ia,l,zeta,m) to index - std::map> rindex_nao_; //< mapping from index to (it,ia,l,zeta,m) - // Variables defining dimensions or resource allocation - int nks_ = 0; //< number of kpoints for present processor, for S(k) - int nks_tot_ = 0; //< total number of kpoints - int nR_ = 0; //< number of supercell vectors on present processor, for S(R) - int nR_tot_ = 0; //< total number of supercell vectors - int nchi_ = 0; //< number of atomic orbitals, chi in \mathbf{S}^{\chi\phi}(\mathbf{k}) - int nphi_ = 0; //< number of numerical atomic orbitals, phi in \mathbf{S}^{\chi\phi}(\mathbf{k}) - // Variables defining atoms - atom_in atom_database_; //< atomic information database - int ntype_ = 0; //< number of atom types - std::vector na_; //< number of atoms for each type - std::vector symbols_; //< symbols of atoms - std::vector charges_; //< charges of atoms - std::vector nmax_; //< maximum principle quantum number of atoms -}; -#endif // TOQO_H \ No newline at end of file diff --git a/source/module_io/to_qo_kernel.cpp b/source/module_io/to_qo_kernel.cpp deleted file mode 100644 index 9e6ec4b74d..0000000000 --- a/source/module_io/to_qo_kernel.cpp +++ /dev/null @@ -1,622 +0,0 @@ -#include "source_base/libm/libm.h" -#include "source_base/ylm.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "module_io/to_qo.h" -#ifdef __MPI -#include "source_base/parallel_common.h" -#endif -// how define QO task, how create QO instance -toQO::toQO(const std::string& qo_basis, - const std::vector& strategies, - const double& qo_thr, - const std::vector& screening_coeffs) -{ - // totally the same as what defined in INPUT - // qo_switch_ = 1 // certainly, this constructor will only be called when qo_switch_ == 1 - qo_basis_ = qo_basis; - strategies_ = strategies; - qo_thr_ = qo_thr; - screening_coeffs_ = screening_coeffs; -} - -toQO::~toQO() -{ -} // we dont use any new or malloc, so no need to delete or free - -// initialize means to initialize in actual program environment, therefore most of program -// -dependent vairables import here. -void toQO::initialize(const std::string& out_dir, - const std::string& pseudo_dir, - const std::string& orbital_dir, - const UnitCell* p_ucell, - const std::vector>& kvecs_d, - std::ofstream& ofs_running, - const int& rank, - const int& nranks) -{ - // print parameter settings for QO - if (rank == 0) - { - std::string init_info = "\nQuasiatomic orbital analysis activated.\n"; - init_info += "Parameters settings check:\n"; - init_info += "qo_basis: " + qo_basis_ + "\n"; - init_info += "qo_thr: " + std::to_string(qo_thr_) + "\n"; - init_info += "qo_strategies: "; - for (auto s: strategies_) { - init_info += s + " "; -} - init_info += "\n"; - init_info += "Output directory: " + out_dir + "\n"; - init_info += "Pseudopotential directory: " + pseudo_dir + "\n"; - init_info += "Numerical atomic orbital directory: " + orbital_dir + "\n"; - init_info += "Number of kpoints: " + std::to_string(kvecs_d.size()) + "\n"; - init_info += "Parallelized on " + std::to_string(nranks) + " MPI processes\n"; - printf("%s", init_info.c_str()); - } -#ifdef __MPI - // this MPI_Barrier is to ensure the above information is printed before the following - MPI_Barrier(MPI_COMM_WORLD); -#endif - // initialize the variables defining I/O - out_dir_ = out_dir; - pseudo_dir_ = pseudo_dir; - orbital_dir_ = orbital_dir; - - // initialize the variables defining parallelism - iproc_ = rank; - nprocs_ = nranks; - - // initialize the variables defining the structure - // review what are needed by toQO module from UnitCell - // - read_structures(p_ucell, kvecs_d, iproc_, nprocs_); - - // build orbitals, for all processes - // orbitals building operation is to (for example) read all orbital files and save to - // radial collection data structure. These kinds of information is irrelevant to the - // structure simulated. Once two atoms' one certain overlap integral is needed, get - // orbitals from radial collection by type-l-izeta, so that get the radial function. - // Then specify the angular part Ylm l and m, also l' and m', and the correct distance. - // Then the overlap integral is calculated. - // build two-center overlap calculator - overlap_calculator_ = std::unique_ptr(new TwoCenterIntegrator); - // build the numerical atomic orbital basis - build_nao(ntype_, orbital_dir_, p_ucell_->orbital_fn.data(), iproc_); - // build another atomic orbital - build_ao(ntype_, pseudo_dir_, p_ucell_->pseudo_fn.data(), screening_coeffs_, qo_thr_, ofs_running, iproc_); - - // neighbor list search, based on built RadialCollection(s) - scan_supercell(iproc_, nprocs_); - - // build grids, for all processes - double rcut_max = std::max(nao_->rcut_max(), ao_->rcut_max()); - int ngrid = int(rcut_max / 0.01) + 1; - double cutoff = 2.0 * rcut_max; - nao_->set_uniform_grid(true, ngrid, cutoff, 'i', true); - ao_->set_uniform_grid(true, ngrid, cutoff, 'i', true); - overlap_calculator_->tabulate(*ao_, *nao_, 'S', ngrid, cutoff); - - // prepare for Ylm, if this is not called, the Ylm will not be available and always - // return 0.0 - ModuleBase::Ylm::set_coefficients(); - - // based on built RadialCollection(s), allocate memory for overlap integrals - allocate_ovlp(true); - allocate_ovlp(false); -} - -void toQO::build_nao(const int ntype, - const std::string orbital_dir, - const std::string* const orbital_fn, - const int rank) -{ - // build the numerical atomic orbital basis - ModuleBase::SphericalBesselTransformer sbt; - nao_ = std::unique_ptr(new RadialCollection); - int ntype_ = ntype; -#ifdef __MPI - Parallel_Common::bcast_int(ntype_); -#endif - std::string* orbital_fn_ = new std::string[ntype_]; - if (rank == 0) - { - for (int it = 0; it < ntype_; it++) - { - orbital_fn_[it] = orbital_dir + orbital_fn[it]; - } - } -#ifdef __MPI - Parallel_Common::bcast_string(orbital_fn_, ntype_); -#endif - // this method is done by RANK-0, then broadcast to other processes. - nao_->build(ntype_, orbital_fn_, 'o'); - nao_->set_transformer(sbt); - // indexing, all processes can do together. It is also cumbersome to broadcast a std::map of std::tuple - // by ABACUS self-built MPI broadcast function, so the following indexing is done by all processes, - // directly. - radialcollection_indexing(*nao_, na_, false, index_nao_, rindex_nao_); - nphi_ = index_nao_.size(); - - delete[] orbital_fn_; - if (rank == 0) - { - std::string nao_build_info - = "toQO::build_nao: built numerical atomic orbitals for calculating QO overlap integrals\n"; - nao_build_info += "Number of columns in QO_ovlp_*.dat: " + std::to_string(nphi_) + "\n"; - nao_build_info += "Orbitals arrange in sequence of (it, ia, l, zeta, m), m in order of 0, 1, -1, 2, -2, ...\n"; - printf("%s", nao_build_info.c_str()); - } -} - -bool toQO::orbital_filter_out(const int& itype, const int& l, const int& izeta) -{ - // true = filter out, false = not filter out = keep - // this function works for RadialCollection, to select the orbitals of interest - std::vector l2symbol = {"s", "p", "d", "f", "g"}; // seems enough - if (qo_basis_ == "pswfc") - { - // for pswfc, what supports is specifying the name of subshell layer, like - // qo_strategy sp spdf - // means for the first atom type, use s and p orbitals, for the second, use - // s, p, d, and f orbitals - // default is `all` for all types, and for each type, all orbitals are used - if (strategies_[itype] == "all") { - return false; - } else if (l >= l2symbol.size()) { - return true; - } else if (strategies_[itype].find_first_of(l2symbol[l]) != std::string::npos) { - return false; - } else { - return true; -} - } - else if (qo_basis_ == "szv") - { - // use two individual logic branch allows them have different orbital filtering logic, - // although presently they are almost the same - if (izeta != 0) { - return true; // filter out - } else if (strategies_[itype] == "all") { - return false; // keep - } else if (l >= l2symbol.size()) { - return true; // filter out - } else if (strategies_[itype].find_first_of(l2symbol[l]) != std::string::npos) { - return false; // keep - } else { - return true; // filter out -} - } - else { - return false; -} -} - -void toQO::build_hydrogen(const int ntype, - const double* const charges, - const bool slater_screening, - const int* const nmax, - const double qo_thr, - const int rank) -{ - ModuleBase::SphericalBesselTransformer sbt; - ao_ = std::unique_ptr(new RadialCollection); - // for this method, all processes CAN do together, there is no apparent conflict between processes - ao_->build(ntype, charges, slater_screening, nmax, symbols_.data(), qo_thr, strategies_.data(), rank); - ao_->set_transformer(sbt); - // indexing, all processes can do together. It is also cumbersome to broadcast a std::map of std::tuple - // by ABACUS self-built MPI broadcast function, so the following indexing is done by all processes, - // directly. - radialcollection_indexing(*ao_, na_, true, index_ao_, rindex_ao_); - nchi_ = index_ao_.size(); -} - -void toQO::build_pswfc(const int ntype, - const std::string pseudo_dir, - const std::string* const pspot_fn, - const double* const screening_coeffs, - const double qo_thr, - const int rank) -{ - ModuleBase::SphericalBesselTransformer sbt; - ao_ = std::unique_ptr(new RadialCollection); - int ntype_ = ntype; -#ifdef __MPI - Parallel_Common::bcast_int(ntype_); -#endif - std::string* pspot_fn_ = new std::string[ntype_]; - for (int it = 0; it < ntype; it++) - { - pspot_fn_[it] = pseudo_dir + pspot_fn[it]; - } -#ifdef __MPI - Parallel_Common::bcast_string(pspot_fn_, ntype_); -#endif - // for this method, all processes MIGHT NOT do together, because of possible conflict of reading files - // in the following build function, the file reading is done by RANK-0, then broadcast to other processes - // this MPI strategy is done by refactoring PswfcRadials instance. For details, see the impelementation - // of build function of PswfcRadials: source/source_basis/module_nao/pswfc_radials.cpp - ao_->build(ntype, pspot_fn_, screening_coeffs, qo_thr, rank); - ao_->set_transformer(sbt); - // indexing, all processes can do together. It is also cumbersome to broadcast a std::map of std::tuple - // by ABACUS self-built MPI broadcast function, so the following indexing is done by all processes, - // directly. - radialcollection_indexing(*ao_, na_, true, index_ao_, rindex_ao_); - nchi_ = index_ao_.size(); - delete[] pspot_fn_; -} - -void toQO::build_szv() -{ - // build the numerical atomic orbital basis - ModuleBase::SphericalBesselTransformer sbt; - ao_ = std::unique_ptr(new RadialCollection(*nao_)); - ao_->set_transformer(sbt); - // indexing, all processes can do together. It is also cumbersome to broadcast a std::map of std::tuple - // by ABACUS self-built MPI broadcast function, so the following indexing is done by all processes, - // directly. - radialcollection_indexing(*ao_, na_, true, index_ao_, rindex_ao_); - nchi_ = index_ao_.size(); -} - -void toQO::build_ao(const int ntype, - const std::string pseudo_dir, - const std::string* const pspot_fn, - const std::vector screening_coeffs, - const double qo_thr, - const std::ofstream& ofs_running, - const int rank) -{ - if (qo_basis_ == "hydrogen") - { - bool with_slater_screening - = std::find_if(screening_coeffs.begin(), screening_coeffs.end(), [](double sc) { return sc > 1e-10; }) - != screening_coeffs.end(); - build_hydrogen(ntype_, /// ntype - charges_.data(), /// charges - with_slater_screening, /// slater_screening - nmax_.data(), /// nmax - qo_thr, /// qo_thr - rank); /// rank - } - else if (qo_basis_ == "pswfc") - { - build_pswfc(ntype_, /// ntype - pseudo_dir, /// pseudo_dir - pspot_fn, /// pspot_fn - screening_coeffs.data(), /// screening_coeffs - qo_thr, /// qo_thr - rank); /// rank - } - else if (qo_basis_ == "szv") { - build_szv(); -} - if (rank == 0) - { - std::string ao_build_info = "toQO::build_ao: built atomic orbitals for calculating QO overlap integrals\n"; - ao_build_info += "Atom-centered orbital to project is: " + qo_basis_ + "\n"; - ao_build_info += "Number of rows in QO_ovlp_*.dat: " + std::to_string(nchi_) + "\n"; - ao_build_info += "Orbitals arrange in sequence of (it, ia, l, zeta, m), m in order of 0, 1, -1, 2, -2, ...\n"; - printf("%s", ao_build_info.c_str()); - } -} - -void toQO::calculate_ovlpR(const int iR) -{ - assert(rindex_ao_.size() == nchi_); - assert(rindex_nao_.size() == nphi_); - for (int irow = 0; irow < nchi_; irow++) - { - // it, ia, li, izeta, mi - std::tuple orb1 = rindex_ao_[irow]; - int it = std::get<0>(orb1); - int ia = std::get<1>(orb1); - int li = std::get<2>(orb1); - int izeta = std::get<3>(orb1); - int mi = std::get<4>(orb1); - for (int icol = 0; icol < nphi_; icol++) - { - // jt, ja, lj, jzeta, mj - std::tuple orb2 = rindex_nao_[icol]; - int jt = std::get<0>(orb2); - int ja = std::get<1>(orb2); - int lj = std::get<2>(orb2); - int jzeta = std::get<3>(orb2); - int mj = std::get<4>(orb2); - ModuleBase::Vector3 rij = p_ucell_->atoms[jt].tau[ja] - p_ucell_->atoms[it].tau[ia]; - // there is waste here, but for easy to understand, I don't optimize it. - ModuleBase::Vector3 R = supercells_[iR]; - ModuleBase::Vector3 Rij; - Rij.x = rij.x + double(R.x) * p_ucell_->a1.x + double(R.y) * p_ucell_->a2.x + double(R.z) * p_ucell_->a3.x; - Rij.y = rij.y + double(R.x) * p_ucell_->a1.y + double(R.y) * p_ucell_->a2.y + double(R.z) * p_ucell_->a3.y; - Rij.z = rij.z + double(R.x) * p_ucell_->a1.z + double(R.y) * p_ucell_->a2.z + double(R.z) * p_ucell_->a3.z; - Rij *= p_ucell_->lat0; // convert to Bohr - overlap_calculator_->calculate(it, li, izeta, mi, jt, lj, jzeta, mj, Rij, &ovlpR_[irow * nphi_ + icol]); - } - } -} - -void toQO::calculate_ovlpk(int ik) -{ - // On the parallelization of toQO module - // 2024-03-12, kirk0830 - // Let's plant trees! - // present parallelization strategy will brings a little bit of burden to the disk IO - // another disk-friendly parallelization strategy is to save all two-center integrals - // on one single process and broadcast to other processes. This is more memory-consuming, - // but less disk IO. - - // for the first run, need to calculate all two-center integrals in realspace. - // the calculation of two-center integrals in realspace is also parallelized. - // but to avoid high frequency of sending and receiving messages, use file to - // store the results of two-center integrals in realspace. Then read the files - // and calculate the two-center integrals in k-space. - if (ik == iks_[0]) - { - for (auto iR: iRs_) - { - calculate_ovlpR(iR); - write_ovlp(out_dir_, ovlpR_, nchi_, nphi_, true, iR); - } - } - // then read and calculate all ks corresponding two-center integrals on own process - // there is a way to avoid the conflict of reading files between different processes, - // that is, when proc1 is reading R1, let proc2 read R2, and so on. After the first - // round of reading, then proc1 reads R2, proc2 reads R3, and so on. This way, everytime - // before a new-reading, should all processes be synchronized. - for (int iR = 0; iR < nR_tot_; iR++) - { - int barrier_iR = (iR + iproc_) % nR_tot_; -#ifdef __MPI - // the following MPI_Barrier ensures two unexpected things, the first has been mentioned - // above, the second is that, avoid the case for one process has finished calculation - // of integral in realspace and ready for calculating in kspace but other processes are - // still calculating in realspace, if that happens, the faster process can not find all - // the files needed, which are, all QO_ovlpR_*.dat files. - MPI_Barrier(MPI_COMM_WORLD); -#endif - // ik == -1 corresponds to the case of those processes with less kpoints than others - if (ik != -1) { - read_ovlp(out_dir_, nchi_, nphi_, true, barrier_iR); -} - if (ik != -1) { - append_ovlpR_eiRk(ik, barrier_iR); -} - } -} - -void toQO::calculate() -{ - for (auto ik: iks_) - { -#ifdef __MPI - // we must enforce the process to be highly synchronized and as much as possible near the REAL - // kpoint parallelism because need to avoid the possible conflict of reading files between - // different processes - MPI_Barrier(MPI_COMM_WORLD); -#endif - // while for zero_out overlap, it can be not so strictly synchronized - zero_out_ovlps(false); - calculate_ovlpk(ik); - if (ik != -1) { - write_ovlp>(out_dir_, ovlpk_, nchi_, nphi_, false, ik); -} - } -#ifdef __MPI - // once the calculation of S(k) is finished, prone to delete all QO_ovlpR_*.dat files. But the most - // important thing is to ensure all processes have finished the calculation of S(k), so MPI_Barrier. - MPI_Barrier(MPI_COMM_WORLD); -#endif - // delete all QO_ovlpR_* files - if (iproc_ == 0) - { - for (int iR = 0; iR < nR_tot_; iR++) - { - std::string filename = out_dir_ + "/QO_ovlpR_" + std::to_string(iR) + ".dat"; - std::remove(filename.c_str()); - } - printf("toQO::calculate: calculation of S(k) done, run /tools/qo/postprocess.py to do representation " - "transform.\n"); - } -} - -void toQO::append_ovlpR_eiRk(int ik, int iR) -{ - // calculate sum S(R)*eiRk = S(k) - ModuleBase::Vector3 R(double(supercells_[iR].x), double(supercells_[iR].y), double(supercells_[iR].z)); - double arg = (kvecs_d_[ik] * R) * ModuleBase::TWO_PI; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex phase = std::complex(cosp, sinp); - // add all values of ovlpR_ to ovlpk_ with multiplication of phase - for (int i = 0; i < nchi_ * nphi_; i++) { - ovlpk_[i] += ovlpR_[i] * phase; -} -} - -void toQO::allocate_ovlp(const bool& is_R) -{ - if (is_R) { - ovlpR_.resize(nchi_ * nphi_, 0.0); - } else { - ovlpk_.resize(nchi_ * nphi_, std::complex(0.0, 0.0)); -} -} - -void toQO::deallocate_ovlp(const bool& is_R) -{ - if (is_R) - { - ovlpR_.clear(); - ovlpR_.shrink_to_fit(); - } - else - { - ovlpk_.clear(); - ovlpk_.shrink_to_fit(); - } -} - -void toQO::zero_out_ovlps(const bool& is_R) -{ - if (is_R) { - std::fill(ovlpR_.begin(), ovlpR_.end(), 0.0); - } else { - std::fill(ovlpk_.begin(), ovlpk_.end(), std::complex(0.0, 0.0)); -} -} - -void toQO::radialcollection_indexing(const RadialCollection& radcol, - const std::vector& natoms, - const bool& with_filter, - std::map, int>& index_map, - std::map>& index_map_reverse) -{ - // in RadialCollection, radials are stored type by type and actually not relevant with exact atom index, - // so the number of atom of each type is external information. - // the map should be like: (itype, iatom, l, izeta, m) -> index and the reverse one is index -> (itype, iatom, l, - // izeta, m) - int index = 0; - for (int itype = 0; itype < radcol.ntype(); itype++) - { - for (int iatom = 0; iatom < natoms[itype]; iatom++) - { - for (int l = 0; l <= radcol.lmax(itype); l++) - { - std::vector ms; - for (int m_abs = 0; m_abs <= l; m_abs++) - { - ms.push_back(m_abs); - if (m_abs != 0) { - ms.push_back(-m_abs); -} - } - for (int izeta = 0; izeta < radcol.nzeta(itype, l); izeta++) - { - // usually, the orbital is distinguished by it, l and zeta, the ia and m are not - // commonly used. - if (orbital_filter_out(itype, l, izeta) && with_filter) { - continue; -} - for (int m: ms) - { - index_map[std::make_tuple(itype, iatom, l, izeta, m)] = index; - index_map_reverse[index] = std::make_tuple(itype, iatom, l, izeta, m); - index++; - } - } - } - } - } -} - -// template function definition -// 20240310 make compatible with R space matrices -template -void toQO::write_ovlp(const std::string& dir, - const std::vector& ovlp, - const int& nrows, - const int& ncols, - const bool& is_R, - const int& i) -{ - std::string filename = is_R ? "QO_ovlpR_" + std::to_string(i) + ".dat" : "QO_ovlp_" + std::to_string(i) + ".dat"; - std::ofstream ofs(dir + filename); - if (!ofs.is_open()) - { - ModuleBase::WARNING_QUIT("toQO::write_ovlp", "can not open file: " + filename); - } - if (is_R) - { - ofs << "SUPERCELL_COORDINATE: " << std::setw(5) << std::right << supercells_[i].x << " " << std::setw(5) - << std::right << supercells_[i].y << " " << std::setw(5) << std::right << supercells_[i].z << std::endl; - } - else - { - ofs << "KPOINT_COORDINATE: " << std::setw(22) << std::setprecision(14) << std::right << std::scientific - << kvecs_d_[i].x << " " << std::setw(22) << std::setprecision(14) << std::right << std::scientific - << kvecs_d_[i].y << " " << std::setw(22) << std::setprecision(14) << std::right << std::scientific - << kvecs_d_[i].z << std::endl; - } - for (int irow = 0; irow < nrows; irow++) - { - for (int icol = 0; icol < ncols; icol++) - { - ofs << std::setw(22) << std::setprecision(14) << std::right << std::scientific << ovlp[irow * ncols + icol] - << " "; - } - ofs << std::endl; - } - ofs.close(); -} -// explicit instantiation -template void toQO::write_ovlp(const std::string& dir, - const std::vector& ovlp, - const int& nrows, - const int& ncols, - const bool& is_R, - const int& ik); -template void toQO::write_ovlp>(const std::string& dir, - const std::vector>& ovlp, - const int& nrows, - const int& ncols, - const bool& is_R, - const int& ik); -// a free function to convert string storing C++ std::complex to std::complex -// format: (real,imag), both part in scientific format -std::complex str2complex(const std::string& str) -{ - std::string real_str, imag_str; - int i = 1; // skip '(' - while (str[i] != ',') { - real_str += str[i]; -} - i++; - i++; // skip ',' - while (str[i] != ')') { - imag_str += str[i]; -} - i++; - return std::complex(std::stod(real_str), std::stod(imag_str)); -} -// complete I/O of QO module -void toQO::read_ovlp(const std::string& dir, const int& nrows, const int& ncols, const bool& is_R, const int& ik) -{ - zero_out_ovlps(is_R); // clear the ovlp vector before reading - assert(nrows * ncols == nchi_ * nphi_); - std::string filename = is_R ? "QO_ovlpR_" + std::to_string(ik) + ".dat" : "QO_ovlp_" + std::to_string(ik) + ".dat"; - std::ifstream ifs(dir + "/" + filename); - if (!ifs.is_open()) - { - ModuleBase::WARNING_QUIT("toQO::read_ovlp", "can not open file: " + filename); - } - // read header - std::string line; - std::getline(ifs, line); - // read ovlp values - int inum = 0; - while (ifs.good()) - { - if (is_R) - { - double val; - ifs >> val; - inum++; - if (inum <= nchi_ * nphi_) { - ovlpR_[inum - 1] = val; - } else { - break; -} - } - else - { - std::string val_str; - ifs >> val_str; - inum++; - if (inum <= nchi_ * nphi_) { - ovlpk_[inum - 1] = str2complex(val_str); - } else { - break; -} - } - } -} diff --git a/source/module_io/to_qo_mpi.cpp b/source/module_io/to_qo_mpi.cpp deleted file mode 100644 index 4de45c1447..0000000000 --- a/source/module_io/to_qo_mpi.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "module_io/to_qo.h" -#ifdef __MPI -#include "../source_base/parallel_common.h" -#endif - -void toQO::bcast_stdvector_ofvector3int(std::vector>& vec, - const int rank) -{ - #ifdef __MPI - int dim; - std::vector vec_1d; - if(rank == 0) - { - dim = vec.size(); - for(int i = 0; i < dim; i++) - { - vec_1d.push_back(vec[i].x); - vec_1d.push_back(vec[i].y); - vec_1d.push_back(vec[i].z); - } - } - Parallel_Common::bcast_int(dim); - if(rank != 0) { vec_1d.resize(dim * 3); } - Parallel_Common::bcast_int(vec_1d.data(), dim * 3); - if(rank != 0) - { - vec.clear(); vec.resize(dim); - for(int i = 0; i < dim; i++) - { - vec[i] = ModuleBase::Vector3(vec_1d[i*3], vec_1d[i*3+1], vec_1d[i*3+2]); - } - } - #endif -} - -void toQO::bcast_stdvector_ofvector3double(std::vector>& vec, - const int rank) -{ - #ifdef __MPI - int dim; - std::vector vec_1d; - if(rank == 0) - { - dim = vec.size(); - for(int i = 0; i < dim; i++) - { - vec_1d.push_back(vec[i].x); - vec_1d.push_back(vec[i].y); - vec_1d.push_back(vec[i].z); - } - } - Parallel_Common::bcast_int(dim); - if(rank != 0) { vec_1d.resize(dim * 3); } - Parallel_Common::bcast_double(vec_1d.data(), dim * 3); - if(rank != 0) - { - vec.clear(); vec.resize(dim); - for(int i = 0; i < dim; i++) - { - vec[i] = ModuleBase::Vector3(vec_1d[i*3], vec_1d[i*3+1], vec_1d[i*3+2]); - } - } - #endif -} diff --git a/source/module_io/to_qo_structures.cpp b/source/module_io/to_qo_structures.cpp deleted file mode 100644 index 347197b14f..0000000000 --- a/source/module_io/to_qo_structures.cpp +++ /dev/null @@ -1,298 +0,0 @@ -#include "module_io/to_qo.h" -#ifdef __MPI -#include "../source_base/parallel_common.h" -#endif -void toQO::read_structures(const UnitCell* p_ucell, - const std::vector>& kvecs_d, - const int& rank, - const int& nranks) -{ - // assume p_ucell will be totally available for all processors if MPI is enabled - p_ucell_ = p_ucell; - - // atom related properties - ntype_ = p_ucell->ntype; - std::for_each(p_ucell->atoms, p_ucell->atoms + p_ucell->ntype, [this](Atom& atom){ - symbols_.push_back(atom.ncpp.psd); - na_.push_back(atom.na); - }); - nmax_.resize(ntype_); - charges_.resize(ntype_); - for(int itype = 0; itype < ntype_; itype++) - { - std::cout << "type " << itype << " " << symbols_[itype] << " strategy: " << strategies_[itype] << std::endl; - nmax_[itype] = (strategies_[itype].substr(0, 6) != "energy")? atom_database_.principle_quantum_number[symbols_[itype]]: atom_database_.atom_Z[symbols_[itype]]; - charges_[itype] = atom_database_.atom_Z[symbols_[itype]]; - } - - // k point related properties - kvecs_d_ = kvecs_d; - nks_ = kvecs_d.size(); - nks_tot_ = nks_; - - iks_ = std::vector(nks_); - for(int i = 0; i < nks_; i++) iks_[i] = i; - - // scatter k points to all ranks if MPI is enabled -#ifdef __MPI - // scatter kvecs_d_ to all ranks - std::vector> nks_divided(nranks); // indiced by iproc, then list of indices of kvecs_d_ - if(rank == 0) - { - int nks = nks_tot_; - int nks_perrank = nks / nranks; - int nks_remain = nks % nranks; - - int start_ik = 0; - for(int i = 0; i < nranks; i++) - { - int nks_this_rank = nks_perrank + int(i < nks_remain); - std::vector nks_this_rank_indices; - for(int j = 0; j < nks_this_rank; j++) - { - nks_this_rank_indices.push_back(start_ik + j); - } - // for those ranks with less k points, pad with -1 - if((i >= nks_remain)&&(nks_remain > 0)) nks_this_rank_indices.push_back(-1); - start_ik += nks_this_rank; - nks_divided[i] = nks_this_rank_indices; - } - } - for(int i = 0; i < nranks; i++) - { - int nks_dim; - if(iproc_ == 0) nks_dim = nks_divided[i].size(); - Parallel_Common::bcast_int(nks_dim); - if(iproc_ != 0) nks_divided[i].resize(nks_dim); - Parallel_Common::bcast_int(nks_divided[i].data(), nks_dim); - } - //bcast_stdvector_ofvector3double(kvecs_d_); // because kvecs_d is already broadcasted in the main program - iks_.clear(); - for(int i = 0; i < nks_divided[rank].size(); i++) - { - if(nks_divided[rank][i] != -1) iks_.push_back(nks_divided[rank][i]); // we want it is explicitly -1 - else iks_.push_back(-1); - } - nks_ = iks_.size(); - - // ensure all kpoints are successfully scattered - MPI_Barrier(MPI_COMM_WORLD); -#endif - if(rank == 0) printf("toQO KPOINTS parallelization: calculation of S(k) will be parallelized on %d processes\n", nranks); -#ifdef __MPI - // the following information should be printed after the report of number of ranks - // therefore barrier to wait rank0. - MPI_Barrier(MPI_COMM_WORLD); - int last_ik_ = (iks_[nks_-1] == -1)? iks_[nks_-2]: iks_[nks_-1]; - printf("KPOINTS distributed on process %d will calculate in range [%d, %d]\n", rank, iks_[0], last_ik_); -#endif -} - -template -void toQO::eliminate_duplicate_vector3(std::vector> &v) -{ - std::vector> v_; - // convert vector3 to vector - for(int i = 0; i < v.size(); i++) - { - v_.push_back(std::vector{v[i].x, v[i].y, v[i].z}); - } - std::sort(v_.begin(), v_.end()); - v_.erase(std::unique(v_.begin(), v_.end()), v_.end()); - v.clear(); - v.resize(v_.size()); - for(int i = 0; i < v_.size(); i++) - { - v[i] = ModuleBase::Vector3(v_[i][0], v_[i][1], v_[i][2]); - } -} -template void toQO::eliminate_duplicate_vector3(std::vector> &v); - -std::vector> toQO::scan_supercell_for_atom(int it, int ia, int start_it, int start_ia) -{ - std::vector> n1n2n3; - // cutoff radius of numerical atomic orbital of atom itia - double rcut_i = ao_->rcut_max(it); - // lattice vectors - for(int itype = start_it; itype < p_ucell_->ntype; itype++) - { - for(int iatom = start_ia; iatom < p_ucell_->atoms[itype].na; iatom++) - { - double rcut_j = nao_->rcut_max(itype); - ModuleBase::Vector3 rij = p_ucell_->atoms[itype].tau[iatom] - p_ucell_->atoms[it].tau[ia]; // in unit lat0? - int n1 = 0; int n2 = 0; int n3 = 0; - // calculate the sup of n1, n2, n3 - // rcut_i, j in bohr! a1, a2 and a3 are in lat0, so multiply with lat0 - // int n1max = int(std::ceil((rcut_i + rcut_j)/p_ucell_->a1.norm()/p_ucell_->lat0)); - // int n2max = int(std::ceil((rcut_i + rcut_j)/p_ucell_->a2.norm()/p_ucell_->lat0)); - // int n3max = int(std::ceil((rcut_i + rcut_j)/p_ucell_->a3.norm()/p_ucell_->lat0)); - ModuleBase::Vector3 a1_in_Bohr = p_ucell_->a1 * p_ucell_->lat0; - ModuleBase::Vector3 a2_in_Bohr = p_ucell_->a2 * p_ucell_->lat0; - ModuleBase::Vector3 a3_in_Bohr = p_ucell_->a3 * p_ucell_->lat0; - double rcut_ij = rcut_i + rcut_j; - std::vector n1n2n3_max = rcut_to_supercell_index(rcut_ij, a1_in_Bohr, a2_in_Bohr, a3_in_Bohr); - // scan n1, n2, n3 - for(int n1 = -n1n2n3_max[0]; n1 <= n1n2n3_max[0]; n1++) - { - for(int n2 = -n1n2n3_max[1]; n2 <= n1n2n3_max[1]; n2++) - { - for(int n3 = -n1n2n3_max[2]; n3 <= n1n2n3_max[2]; n3++) - { - double f = norm2_rij_supercell(rij, n1, n2, n3); - if(f < std::pow(rcut_i + rcut_j, 2)) - { - n1n2n3.push_back(ModuleBase::Vector3(n1, n2, n3)); - } - } - } - } - } - } - eliminate_duplicate_vector3(n1n2n3); - return n1n2n3; -} - -double cosine_between_vector3(ModuleBase::Vector3 v1, ModuleBase::Vector3 v2) -{ - double f = v1 * v2; - f /= v1.norm(); - f /= v2.norm(); - return f; -} - -std::vector toQO::rcut_to_supercell_index(double rcut, ModuleBase::Vector3 a, ModuleBase::Vector3 b, ModuleBase::Vector3 c) -{ - double fab = std::sqrt(1-std::pow(cosine_between_vector3(a, b), 2)); - double fac = std::sqrt(1-std::pow(cosine_between_vector3(a, c), 2)); - double fbc = std::sqrt(1-std::pow(cosine_between_vector3(b ,c), 2)); - double fa = std::min(fab, fac); - double fb = std::min(fab, fbc); - double fc = std::min(fac, fbc); - int n1max = int(std::ceil(rcut/a.norm()/fa)); - int n2max = int(std::ceil(rcut/b.norm()/fb)); - int n3max = int(std::ceil(rcut/c.norm()/fc)); - std::vector n1n2n3 = {n1max, n2max, n3max}; - return n1n2n3; -} - -double toQO::norm2_rij_supercell(ModuleBase::Vector3 rij, int n1, int n2, int n3) -{ - double f = rij * rij; - f += n1*n1*(p_ucell_->a1*p_ucell_->a1); - f += n2*n2*(p_ucell_->a2*p_ucell_->a2); - f += n3*n3*(p_ucell_->a3*p_ucell_->a3); - f += 2*n1*n2*(p_ucell_->a1*p_ucell_->a2); - f += 2*n1*n3*(p_ucell_->a1*p_ucell_->a3); - f += 2*n2*n3*(p_ucell_->a2*p_ucell_->a3); - f += 2*n1*(p_ucell_->a1*rij); - f += 2*n2*(p_ucell_->a2*rij); - f += 2*n3*(p_ucell_->a3*rij); - return f; -} - -void toQO::scan_supercell(const int& rank, const int& nranks) -{ - if(rank == 0) - { - std::vector> n1n2n3_overall; - for(int it = 0; it < p_ucell_->ntype; it++) - { - for(int ia = 0; ia < p_ucell_->atoms[it].na; ia++) - { - std::vector> n1n2n3 = scan_supercell_for_atom(it, ia); - n1n2n3_overall.insert(n1n2n3_overall.end(), n1n2n3.begin(), n1n2n3.end()); - } - } - // delete duplicates - eliminate_duplicate_vector3(n1n2n3_overall); - - supercells_ = n1n2n3_overall; - nR_ = supercells_.size(); - nR_tot_ = nR_; - - iRs_ = std::vector(nR_); - for(int i = 0; i < nR_; i++) iRs_[i] = i; - - write_supercells(); - } - /*-------------------------------------------------------------------------------------------*/ -#ifdef __MPI // scatter supercells_ to all ranks - Parallel_Common::bcast_int(nR_); - Parallel_Common::bcast_int(nR_tot_); - bcast_stdvector_ofvector3int(supercells_, iproc_); - // scatter - std::vector> nR_divided(nranks); // indiced by iproc, then list of indices of supercells_ - if(rank == 0) - { - // divide nR into std::vector of std::vector, each std::vector is a chunk of indices of supercells_ - int nRs = nR_; - int nRs_perrank = nRs / nranks; - int nRs_remain = nRs % nranks; - - int start_iR = 0; - for(int i = 0; i < nranks; i++) - { - int nR_this_rank = nRs_perrank + int(i < nRs_remain); - std::vector nR_this_rank_indices; - for(int j = 0; j < nR_this_rank; j++) - { - nR_this_rank_indices.push_back(start_iR + j); - } - start_iR += nR_this_rank; - nR_divided[i] = nR_this_rank_indices; - } - } - for(int i = 0; i < nranks; i++) - { - int nR_dim; - if(rank == 0) nR_dim = nR_divided[i].size(); - Parallel_Common::bcast_int(nR_dim); - if(rank != 0) nR_divided[i].resize(nR_dim); - Parallel_Common::bcast_int(nR_divided[i].data(), nR_dim); - } - iRs_.clear(); - for(int i = 0; i < nR_divided[rank].size(); i++) iRs_.push_back(nR_divided[rank][i]); - nR_ = iRs_.size(); - - MPI_Barrier(MPI_COMM_WORLD); -#endif - if(rank == 0) printf("toQO SUPERCELLS parallelization: calculation of S(R) will be parallelized on %d processes\n", nranks); -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); - int last_iR_ = nR_ - 1; - printf("SUPERCELLS distributed on process %d will calculate in range [%d, %d]\n", rank, iRs_[0], iRs_[last_iR_]); -#endif -} - -ModuleBase::Vector3 toQO::cal_two_center_vector(ModuleBase::Vector3 rij, - ModuleBase::Vector3 R) -{ - ModuleBase::Vector3 Rij; - Rij.x = rij.x + R.x * p_ucell_->a1.x - + R.y * p_ucell_->a2.x - + R.z * p_ucell_->a3.x; - Rij.y = rij.y + R.x * p_ucell_->a1.y - + R.y * p_ucell_->a2.y - + R.z * p_ucell_->a3.y; - Rij.z = rij.z + R.x * p_ucell_->a1.z - + R.y * p_ucell_->a2.z - + R.z * p_ucell_->a3.z; - return Rij; -} - -void toQO::write_supercells() -{ - std::ofstream ofs(out_dir_ + "QO_supercells.dat"); - if(!ofs.is_open()) - { - ModuleBase::WARNING_QUIT("toQO::write_supercells", "can not open file: QO_supercells.dat"); - } - for(int i = 0; i < supercells_.size(); i++) - { - ofs << std::setw(5) << std::right << supercells_[i].x << " " - << std::setw(5) << std::right << supercells_[i].y << " " - << std::setw(5) << std::right << supercells_[i].z << std::endl; - } - ofs.close(); -} - diff --git a/source/module_io/to_wannier90.cpp b/source/module_io/to_wannier90.cpp deleted file mode 100644 index a57a10126b..0000000000 --- a/source/module_io/to_wannier90.cpp +++ /dev/null @@ -1,517 +0,0 @@ -#include "to_wannier90.h" - -#include "module_parameter/parameter.h" -#include "source_base/math_integral.h" -#include "source_base/math_polyint.h" -#include "source_base/math_sphbes.h" -#include "source_base/math_ylmreal.h" -#include "source_pw/hamilt_pwdft/global.h" - -toWannier90::toWannier90() -{ -} - -toWannier90::toWannier90(const bool& out_wannier_mmn, - const bool& out_wannier_amn, - const bool& out_wannier_unk, - const bool& out_wannier_eig, - const bool& out_wannier_wvfn_formatted, - const std::string& nnkpfile, - const std::string& wannier_spin) -{ - this->out_wannier_mmn = out_wannier_mmn; - this->out_wannier_amn = out_wannier_amn; - this->out_wannier_unk = out_wannier_unk; - this->out_wannier_eig = out_wannier_eig; - this->out_wannier_wvfn_formatted = out_wannier_wvfn_formatted; - this->nnkpfile = nnkpfile; - this->wannier_file_name = nnkpfile; - this->wannier_file_name = wannier_file_name.substr(0, wannier_file_name.length() - 5); - this->wannier_spin = wannier_spin; - - if (GlobalV::KPAR != 1) - { - ModuleBase::WARNING_QUIT("toWannier90", "The wannier90 interface does not currently support kpar groups"); - } - - if (PARAM.inp.bndpar != 1) - { - ModuleBase::WARNING_QUIT("toWannier90", "The wannier90 interface does not currently support bndpar groups"); - } -} - -toWannier90::~toWannier90() -{ - if (out_wannier_amn) - { - delete[] R_centre; - delete[] L; - delete[] m; - delete[] rvalue; - delete[] z_axis; - delete[] x_axis; - delete[] alfa; - - if (PARAM.inp.nspin == 4) - { - delete[] spin_eig; - delete[] spin_qaxis; - delete[] up_con; - delete[] dn_con; - } - } - - // delete[] exclude_bands; - // delete[] tag_cal_band; - delete[] cal_band_index; -} - -void toWannier90::calculate() -{ -} - -void toWannier90::read_nnkp(const UnitCell& ucell, const K_Vectors& kv) -{ - // read *.nnkp file - GlobalV::ofs_running << "reading the " << wannier_file_name << ".nnkp file." << std::endl; - - bool read_success = false; - if (GlobalV::MY_RANK == 0) - { - read_success = try_read_nnkp(ucell,kv); - } - -#ifdef __MPI - Parallel_Common::bcast_bool(read_success); -#endif - - if (GlobalV::MY_RANK != 0 && read_success) - { - read_success = try_read_nnkp(ucell,kv); - } - -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif -} - -void toWannier90::out_eig(const ModuleBase::matrix& ekb) -{ -#ifdef __MPI - if (GlobalV::MY_RANK == 0) -#endif - { - std::string fileaddress = PARAM.globalv.global_out_dir + wannier_file_name + ".eig"; - std::ofstream eig_file(fileaddress.c_str()); - for (int ik = start_k_index; ik < (cal_num_kpts + start_k_index); ik++) - { - for (int ib = 0; ib < num_bands; ib++) - { - eig_file << std::setw(5) << ib + 1 << std::setw(5) << ik + 1 - start_k_index << std::setw(18) - << std::showpoint << std::fixed << std::setprecision(12) - << ekb(ik, cal_band_index[ib]) * ModuleBase::Ry_to_eV << std::endl; - } - } - - eig_file.close(); - } -} - -void toWannier90::out_unk() -{ -} - -void toWannier90::cal_Amn() -{ -} - -void toWannier90::cal_Mmn() -{ -} - -bool toWannier90::try_read_nnkp(const UnitCell& ucell, const K_Vectors& kv) -{ - std::ifstream nnkp_read(nnkpfile.c_str(), std::ios::in); - - if (!nnkp_read) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Error during readin parameters."); - } - - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "real_lattice")) - { - ModuleBase::Matrix3 real_lattice_nnkp; - nnkp_read >> real_lattice_nnkp.e11 >> real_lattice_nnkp.e12 >> real_lattice_nnkp.e13 >> real_lattice_nnkp.e21 - >> real_lattice_nnkp.e22 >> real_lattice_nnkp.e23 >> real_lattice_nnkp.e31 >> real_lattice_nnkp.e32 - >> real_lattice_nnkp.e33; - real_lattice_nnkp = real_lattice_nnkp / ucell.lat0_angstrom; - - if (std::abs(real_lattice_nnkp.e11 - ucell.latvec.e11) > 1.0e-4 - || std::abs(real_lattice_nnkp.e12 - ucell.latvec.e12) > 1.0e-4 - || std::abs(real_lattice_nnkp.e13 - ucell.latvec.e13) > 1.0e-4 - || std::abs(real_lattice_nnkp.e21 - ucell.latvec.e21) > 1.0e-4 - || std::abs(real_lattice_nnkp.e22 - ucell.latvec.e22) > 1.0e-4 - || std::abs(real_lattice_nnkp.e23 - ucell.latvec.e23) > 1.0e-4 - || std::abs(real_lattice_nnkp.e31 - ucell.latvec.e31) > 1.0e-4 - || std::abs(real_lattice_nnkp.e32 - ucell.latvec.e32) > 1.0e-4 - || std::abs(real_lattice_nnkp.e33 - ucell.latvec.e33) > 1.0e-4) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Error real_lattice in *.nnkp file"); - } - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find real_lattice in *.nnkp file"); - } - - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "recip_lattice")) - { - ModuleBase::Matrix3 recip_lattice_nnkp; - nnkp_read >> recip_lattice_nnkp.e11 >> recip_lattice_nnkp.e12 >> recip_lattice_nnkp.e13 - >> recip_lattice_nnkp.e21 >> recip_lattice_nnkp.e22 >> recip_lattice_nnkp.e23 >> recip_lattice_nnkp.e31 - >> recip_lattice_nnkp.e32 >> recip_lattice_nnkp.e33; - const double tpiba_angstrom = ModuleBase::TWO_PI / ucell.lat0_angstrom; - recip_lattice_nnkp = recip_lattice_nnkp / tpiba_angstrom; - - if (std::abs(recip_lattice_nnkp.e11 - ucell.G.e11) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e12 - ucell.G.e12) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e13 - ucell.G.e13) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e21 - ucell.G.e21) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e22 - ucell.G.e22) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e23 - ucell.G.e23) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e31 - ucell.G.e31) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e32 - ucell.G.e32) > 1.0e-4 - || std::abs(recip_lattice_nnkp.e33 - ucell.G.e33) > 1.0e-4) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Error recip_lattice in *.nnkp file"); - } - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find recip_lattice in *.nnkp file"); - } - - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "kpoints")) - { - num_kpts = kv.get_nkstot(); - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - cal_num_kpts = num_kpts; - } - else if (PARAM.inp.nspin == 2) - { - cal_num_kpts = num_kpts / 2; - } - - int numkpt_nnkp; - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, numkpt_nnkp); - if ((PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) && numkpt_nnkp != num_kpts) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Error kpoints in *.nnkp file"); - } - else if (PARAM.inp.nspin == 2 && numkpt_nnkp != (num_kpts / 2)) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Error kpoints in *.nnkp file"); - } - - ModuleBase::Vector3* kpoints_direct_nnkp = new ModuleBase::Vector3[numkpt_nnkp]; - for (int ik = 0; ik < numkpt_nnkp; ik++) - { - nnkp_read >> kpoints_direct_nnkp[ik].x >> kpoints_direct_nnkp[ik].y >> kpoints_direct_nnkp[ik].z; - if (std::abs(kpoints_direct_nnkp[ik].x - kv.kvec_d[ik].x) > 1.0e-4 - || std::abs(kpoints_direct_nnkp[ik].y - kv.kvec_d[ik].y) > 1.0e-4 - || std::abs(kpoints_direct_nnkp[ik].z - kv.kvec_d[ik].z) > 1.0e-4) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Error kpoints in *.nnkp file"); - } - } - delete[] kpoints_direct_nnkp; - - // ModuleBase::Vector3 my_gamma_point(0.0, 0.0, 0.0); - // if( (num_kpts == 1) && (kv.kvec_d[0] == my_gamma_point) ) gamma_only_wannier = true; - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find kpoints in *.nnkp file"); - } - - // read projections - if (out_wannier_amn) - { - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) - { - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "projections")) - { - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, num_wannier); - - if (num_wannier < 0) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "wannier number is lower than 0"); - } - - R_centre = new ModuleBase::Vector3[num_wannier]; - L = new int[num_wannier]; - m = new int[num_wannier]; - rvalue = new int[num_wannier]; - z_axis = new ModuleBase::Vector3[num_wannier]; - x_axis = new ModuleBase::Vector3[num_wannier]; - alfa = new double[num_wannier]; - - for (int count = 0; count < num_wannier; count++) - { - nnkp_read >> R_centre[count].x >> R_centre[count].y >> R_centre[count].z; - nnkp_read >> L[count] >> m[count]; - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, rvalue[count]); - nnkp_read >> z_axis[count].x >> z_axis[count].y >> z_axis[count].z; - nnkp_read >> x_axis[count].x >> x_axis[count].y >> x_axis[count].z; - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, alfa[count]); - } - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find projections in *.nnkp file"); - } - } - else if (PARAM.inp.nspin == 4) - { - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "spinor_projections")) - { - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, num_wannier); - - if (num_wannier < 0) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "wannier number is lower than 0"); - } - - R_centre = new ModuleBase::Vector3[num_wannier]; - L = new int[num_wannier]; - m = new int[num_wannier]; - rvalue = new int[num_wannier]; - z_axis = new ModuleBase::Vector3[num_wannier]; - x_axis = new ModuleBase::Vector3[num_wannier]; - alfa = new double[num_wannier]; - spin_eig = new int[num_wannier]; - spin_qaxis = new ModuleBase::Vector3[num_wannier]; - - for (int count = 0; count < num_wannier; count++) - { - nnkp_read >> R_centre[count].x >> R_centre[count].y >> R_centre[count].z; - nnkp_read >> L[count] >> m[count]; - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, rvalue[count]); - nnkp_read >> z_axis[count].x >> z_axis[count].y >> z_axis[count].z; - nnkp_read >> x_axis[count].x >> x_axis[count].y >> x_axis[count].z; - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, alfa[count]); - nnkp_read >> spin_eig[count] >> spin_qaxis[count].x >> spin_qaxis[count].y; - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, spin_qaxis[count].z); - } - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find spinor_projections in *.nnkp file"); - } - } - - for (int i = 0; i < num_wannier; i++) - { - R_centre[i] = R_centre[i] * ucell.latvec; - m[i] = m[i] - 1; - } - - // Check whether the parameters of the trial orbitals are correct - for (int i = 0; i < num_wannier; i++) - { - if (L[i] < -5 || L[i] > 3) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "L angular momentum is wrong, please check !!!"); - } - - if (L[i] >= 0) - { - if (m[i] < 0 || m[i] > 2 * L[i]) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "m momentum is wrong, please check !!!"); - } - } - else - { - if (m[i] < 0 || m[i] > -L[i]) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "m momentum is wrong, please check !!!"); - } - } - } - - // Generate spin-related coefficients - if (PARAM.inp.nspin == 4) - { - up_con = new std::complex[num_wannier]; - dn_con = new std::complex[num_wannier]; - - bool spin_z_pos = false; - bool spin_z_neg = false; - for (int i = 0; i < num_wannier; i++) - { - if (std::abs(spin_qaxis[i].x) < 1e-6 && std::abs(spin_qaxis[i].y) < 1e-6 - && std::abs(spin_qaxis[i].z - 1.0) < 1e-6) - { - spin_z_pos = true; - if (spin_eig[i] == 1) - { - up_con[i] = 1.0; - dn_con[i] = 0.0; - } - else - { - up_con[i] = 0.0; - dn_con[i] = 1.0; - } - } - - if (std::abs(spin_qaxis[i].x) < 1e-6 && std::abs(spin_qaxis[i].y) < 1e-6 - && std::abs(spin_qaxis[i].z + 1.0) < 1e-6) - { - spin_z_neg = true; - if (spin_eig[i] == 1) - { - up_con[i] = 0.0; - dn_con[i] = 1.0; - } - else - { - up_con[i] = 1.0; - dn_con[i] = 0.0; - } - } - - if (!spin_z_pos && !spin_z_neg) - { - if (spin_eig[i] == 1) - { - up_con[i] = (1.0 / std::sqrt(1.0 + spin_qaxis[i].z)) * (spin_qaxis[i].z + 1.0); - dn_con[i] = (1.0 / std::sqrt(1.0 + spin_qaxis[i].z)) - * (spin_qaxis[i].x + ModuleBase::IMAG_UNIT * spin_qaxis[i].y); - } - else - { - up_con[i] = (1.0 / std::sqrt(1.0 - spin_qaxis[i].z)) * (spin_qaxis[i].z - 1.0); - dn_con[i] = (1.0 / std::sqrt(1.0 - spin_qaxis[i].z)) - * (spin_qaxis[i].x + ModuleBase::IMAG_UNIT * spin_qaxis[i].y); - } - } - } - } - } - - if (out_wannier_mmn) - { - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "nnkpts")) - { - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, nntot); - nnlist.resize(kv.get_nkstot()); - nncell.resize(kv.get_nkstot()); - for (int ik = 0; ik < kv.get_nkstot(); ik++) - { - nnlist[ik].resize(nntot); - nncell[ik].resize(nntot); - } - - int numkpt_nnkp; - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - numkpt_nnkp = kv.get_nkstot(); - } - else if (PARAM.inp.nspin == 2) - { - numkpt_nnkp = kv.get_nkstot() / 2; - } - else - { - throw std::runtime_error("numkpt_nnkp uninitialized in " + std::string(__FILE__) - + " line " + std::to_string(__LINE__)); - } - - for (int ik = 0; ik < numkpt_nnkp; ik++) - { - for (int ib = 0; ib < nntot; ib++) - { - int ik_nnkp; - nnkp_read >> ik_nnkp; - if (ik_nnkp != (ik + 1)) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "error nnkpts in *.nnkp file"); - } - nnkp_read >> nnlist[ik][ib]; - nnkp_read >> nncell[ik][ib].x >> nncell[ik][ib].y >> nncell[ik][ib].z; - nnlist[ik][ib]--; // this is c++ , begin from 0 - } - } - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find nnkpts in *.nnkp file"); - } - } - - if (ModuleBase::GlobalFunc::SCAN_BEGIN(nnkp_read, "exclude_bands")) - { - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, num_exclude_bands); - - if (num_exclude_bands < 0) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "the exclude bands is wrong, please check *.nnkp file."); - } - - if (num_exclude_bands > 0) - { - int temp_ib = 0; - for (int i = 0; i < num_exclude_bands; i++) - { - ModuleBase::GlobalFunc::READ_VALUE(nnkp_read, temp_ib); - temp_ib--; // this is c++ , begin from 0 - exclude_bands.insert(temp_ib); - } - } - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", "Cannot find exclude_bands in *.nnkp file"); - } - - nnkp_read.close(); - - if (PARAM.inp.nbands <= num_exclude_bands) - { - ModuleBase::WARNING_QUIT("toWannier90::read_nnkp", - "you set the band numer is not enough, please add bands number."); - } - - // tag_cal_band = new bool[PARAM.inp.nbands]; - // for (int ib = 0; ib < PARAM.inp.nbands; ib++) tag_cal_band[ib] = true; - // for (int ib = 0; ib < num_exclude_bands; ib++) tag_cal_band[ib] = false; - - if (num_exclude_bands == 0) - { - num_bands = PARAM.inp.nbands; - cal_band_index = new int[num_bands]; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - cal_band_index[ib] = ib; - } - } - else - { - num_bands = PARAM.inp.nbands - num_exclude_bands; - cal_band_index = new int[num_bands]; - int count = 0; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - if (exclude_bands.count(ib) != 1) - { - cal_band_index[count] = ib; - count++; - } - } - } - - return true; -} \ No newline at end of file diff --git a/source/module_io/to_wannier90.h b/source/module_io/to_wannier90.h deleted file mode 100644 index 004222b4bb..0000000000 --- a/source/module_io/to_wannier90.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef TOWannier90_H -#define TOWannier90_H - -#include -#include -#include -#include -#include -#include - -#include "source_base/complexmatrix.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/lapack_connector.h" -#include "source_base/matrix.h" -#include "source_base/matrix3.h" -#include "source_cell/klist.h" -#include "module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.h" -#include "source_psi/psi.h" -#include "source_base/parallel_common.h" -#include "source_base/parallel_reduce.h" - -class toWannier90 -{ - public: - toWannier90(); - - toWannier90( - const bool &out_wannier_mmn, - const bool &out_wannier_amn, - const bool &out_wannier_unk, - const bool &out_wannier_eig, - const bool &out_wannier_wvfn_formatted, - const std::string &nnkpfile, - const std::string &wannier_spin - ); - ~toWannier90(); - - void calculate(); - void read_nnkp(const UnitCell& ucell, const K_Vectors& kv); - - void out_eig(const ModuleBase::matrix& ekb); - void cal_Amn(); - void cal_Mmn(); - void out_unk(); - - protected: - bool try_read_nnkp(const UnitCell& ucell, const K_Vectors& kv); - - // Parameters related to k point - int num_kpts=0; - int cal_num_kpts=0; - std::vector> nnlist; - std::vector>> nncell; - int nntot = 0; - int start_k_index = 0; - - // Parameters related to trial orbitals - int num_wannier=0; // Number of Wannier orbits - ModuleBase::Vector3 *R_centre = nullptr; - int *L = nullptr; - int *m = nullptr; - int *rvalue = nullptr; - ModuleBase::Vector3 *z_axis = nullptr; - ModuleBase::Vector3 *x_axis = nullptr; - double *alfa = nullptr; - int *spin_eig = nullptr; // 'up' state is 1, 'down' state is -1 - ModuleBase::Vector3 *spin_qaxis = nullptr; // spin quantisation axis - std::complex *up_con = nullptr; - std::complex *dn_con = nullptr; - - // Wannier control parameters - bool out_wannier_mmn = true; - bool out_wannier_amn = true; - bool out_wannier_unk = true; - bool out_wannier_eig = true; - bool out_wannier_wvfn_formatted = true; - - std::string nnkpfile = ""; - std::string wannier_file_name = "seedname"; - std::string wannier_spin = "up"; - - int num_exclude_bands = 0; - // int *exclude_bands = nullptr; - std::unordered_set exclude_bands; - // bool *tag_cal_band = nullptr; - int num_bands = 0; - int *cal_band_index = nullptr; - bool gamma_only_wannier = false; - - -}; - -#endif diff --git a/source/module_io/to_wannier90_lcao.cpp b/source/module_io/to_wannier90_lcao.cpp deleted file mode 100644 index af88da4c4a..0000000000 --- a/source/module_io/to_wannier90_lcao.cpp +++ /dev/null @@ -1,1214 +0,0 @@ -#include "to_wannier90_lcao.h" - -#include "module_parameter/parameter.h" -#include "fR_overlap.h" -#include "source_base/math_integral.h" -#include "source_base/math_polyint.h" -#include "source_base/math_sphbes.h" -#include "source_base/math_ylmreal.h" -#include "source_base/parallel_reduce.h" -#include "source_base/scalapack_connector.h" -#include "module_hamilt_lcao/module_hcontainer/atom_pair.h" -#include "source_pw/hamilt_pwdft/global.h" - -#include -#include - -#ifdef __LCAO -toWannier90_LCAO::toWannier90_LCAO(const bool& out_wannier_mmn, - const bool& out_wannier_amn, - const bool& out_wannier_unk, - const bool& out_wannier_eig, - const bool& out_wannier_wvfn_formatted, - const std::string& nnkpfile, - const std::string& wannier_spin, - const LCAO_Orbitals& orb) - : toWannier90(out_wannier_mmn, - out_wannier_amn, - out_wannier_unk, - out_wannier_eig, - out_wannier_wvfn_formatted, - nnkpfile, - wannier_spin), - orb_(orb) -{ -} - -toWannier90_LCAO::~toWannier90_LCAO() -{ -} - -void toWannier90_LCAO::calculate(const UnitCell& ucell, - const Grid_Driver& gd, - const ModuleBase::matrix& ekb, - const K_Vectors& kv, - const psi::Psi>& psi, - const Parallel_Orbitals* pv) -{ - this->ParaV = pv; - - read_nnkp(ucell,kv); - - if (PARAM.inp.nspin == 2) - { - if (wannier_spin == "up") - { - start_k_index = 0; - } - else if (wannier_spin == "down") - { - start_k_index = num_kpts / 2; - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::calculate", "Error wannier_spin set,is not \"up\" or \"down\" "); - } - } - - if (out_wannier_mmn || out_wannier_amn) - { - iw2it.resize(PARAM.globalv.nlocal); - iw2ia.resize(PARAM.globalv.nlocal); - iw2iL.resize(PARAM.globalv.nlocal); - iw2iN.resize(PARAM.globalv.nlocal); - iw2im.resize(PARAM.globalv.nlocal); - iw2iorb.resize(PARAM.globalv.nlocal); - - std::map>> temp_orb_index; - int count = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int iL = 0; iL < ucell.atoms[it].nwl + 1; iL++) - { - for (int iN = 0; iN < ucell.atoms[it].l_nchi[iL]; iN++) - { - temp_orb_index[it][iL][iN] = count; - count++; - } - } - } - - int iw = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int iL = 0; iL < ucell.atoms[it].nwl + 1; iL++) - { - for (int iN = 0; iN < ucell.atoms[it].l_nchi[iL]; iN++) - { - for (int im = 0; im < (2 * iL + 1); im++) - { - iw2it[iw] = it; - iw2ia[iw] = ia; - iw2iL[iw] = iL; - iw2iN[iw] = iN; - iw2im[iw] = im; - iw2iorb[iw] = temp_orb_index[it][iL][iN]; - - iw++; - } - } - } - } - } - - initialize_orb_table(ucell); - produce_basis_orb(); - set_R_coor(ucell, gd); - count_delta_k(ucell,kv); - } - - if (out_wannier_eig) - { - out_eig(ekb); - } - - if (out_wannier_mmn) - { - int dk_size = delta_k_all.size(); - this->FR.resize(dk_size); - std::vector(ModuleBase::Vector3)>> fr_ptr(dk_size); - for (int i = 0; i < dk_size; i++) - { - ModuleBase::Vector3 delta_k(delta_k_all[i].x, delta_k_all[i].y, delta_k_all[i].z); - - fr_ptr[i] = [delta_k](ModuleBase::Vector3 r) -> std::complex { - double phase = delta_k * r; - std::complex exp_idkr = std::exp(-1.0 * ModuleBase::IMAG_UNIT * phase); - return exp_idkr; - }; - - FR[i].set_parameters(fr_ptr[i], &ucell, &orb_, &gd, ParaV, 140, 110); - FR[i].calculate_FR(); - } - - cal_Mmn(ucell,kv, psi); - } - - if (out_wannier_amn) - { - cal_Amn(ucell,kv, psi); - } - - if (out_wannier_unk) - { - out_unk(psi); - } -} - -void toWannier90_LCAO::cal_Mmn(const UnitCell& ucell, const K_Vectors& kv, const psi::Psi>& psi) -{ - // write .mmn file - std::ofstream mmn_file; - - if (GlobalV::MY_RANK == 0) - { - std::string fileaddress = PARAM.globalv.global_out_dir + wannier_file_name + ".mmn"; - mmn_file.open(fileaddress.c_str(), std::ios::out); - - time_t time_now = time(nullptr); - mmn_file << " Created on " << ctime(&time_now); - mmn_file << std::setw(12) << num_bands << std::setw(12) << cal_num_kpts << std::setw(12) << nntot << std::endl; - } - - for (int ik = 0; ik < cal_num_kpts; ik++) - { - for (int ib = 0; ib < nntot; ib++) - { - int ikb = nnlist[ik][ib]; - ModuleBase::Vector3 phase_G = nncell[ik][ib]; - ModuleBase::ComplexMatrix Mmn; - - int cal_ik = ik + start_k_index; - int cal_ikb = ikb + start_k_index; - unkdotkb(ucell,kv, psi, cal_ik, cal_ikb, phase_G, Mmn); - - if (GlobalV::MY_RANK == 0) - { - mmn_file << std::setw(5) << ik + 1 << std::setw(5) << ikb + 1 << std::setw(5) << int(phase_G.x) - << std::setw(5) << int(phase_G.y) << std::setw(5) << int(phase_G.z) << std::endl; - - for (int n = 0; n < num_bands; n++) - { - for (int m = 0; m < num_bands; m++) - { - mmn_file << std::setw(18) << std::setprecision(12) << std::showpoint << std::fixed - << Mmn(m, n).real() << std::setw(18) << std::setprecision(12) << std::showpoint - << std::fixed - << Mmn(m, n).imag() - // jingan test - // << " " << std::setw(12) << std::setprecision(9) << std::abs(Mmn(m, n)) - << std::endl; - } - } - } - } - } - - if (GlobalV::MY_RANK == 0) { - mmn_file.close(); -} -} - -void toWannier90_LCAO::cal_Amn(const UnitCell& ucell, const K_Vectors& kv, const psi::Psi>& psi) -{ - produce_trial_in_lcao(); - construct_overlap_table_project(); - cal_orbA_overlap_R(ucell); - - // write .amn file - std::ofstream Amn_file; - - if (GlobalV::MY_RANK == 0) - { - time_t time_now = time(nullptr); - std::string fileaddress = PARAM.globalv.global_out_dir + wannier_file_name + ".amn"; - Amn_file.open(fileaddress.c_str(), std::ios::out); - Amn_file << " Created on " << ctime(&time_now); - Amn_file << std::setw(12) << num_bands << std::setw(12) << cal_num_kpts << std::setw(12) << num_wannier - << std::endl; - } - - for (int ik = start_k_index; ik < (cal_num_kpts + start_k_index); ik++) - { - ModuleBase::ComplexMatrix Amn; - unkdotA(kv, psi, ik, Amn); - - if (GlobalV::MY_RANK == 0) - { - for (int iw = 0; iw < num_wannier; iw++) - { - for (int ib = 0; ib < num_bands; ib++) - { - Amn_file << std::setw(5) << ib + 1 << std::setw(5) << iw + 1 << std::setw(5) - << ik + 1 - start_k_index << std::setw(18) << std::showpoint << std::fixed - << std::setprecision(12) << Amn(ib, iw).real() << std::setw(18) << std::showpoint - << std::fixed << std::setprecision(12) - << Amn(ib, iw).imag() - // jingan test - //<< " " << std::setw(18) << std::setprecision(13) << std::abs(Amn(ib, iw)) - << std::endl; - } - } - } - } - - if (GlobalV::MY_RANK == 0) { - Amn_file.close(); -} -} - -void toWannier90_LCAO::out_unk(const psi::Psi>& psi) -{ -} - -void toWannier90_LCAO::initialize_orb_table(const UnitCell& ucell) -{ - int Lmax_used = 0; - int Lmax = 0; - int exx_lmax = 0; -#ifdef __EXX - exx_lmax = GlobalC::exx_info.info_ri.abfs_Lmax; -#endif - -#ifdef __LCAO - const int ntype = orb_.get_ntype(); - int lmax_orb = -1, lmax_beta = -1; - for (int it = 0; it < ntype; it++) - { - lmax_orb = std::max(lmax_orb, orb_.Phi[it].getLmax()); - lmax_beta = std::max(lmax_beta, ucell.infoNL.Beta[it].getLmax()); - } - const double dr = orb_.get_dR(); - const double dk = orb_.get_dk(); - const int kmesh = orb_.get_kmesh() * 4 + 1; - int Rmesh = static_cast(orb_.get_Rmax() / dr) + 4; - Rmesh += 1 - Rmesh % 2; - - Center2_Orb::init_Table_Spherical_Bessel(2, - 3, - Lmax_used, - Lmax, - exx_lmax, - lmax_orb, - lmax_beta, - dr, - dk, - kmesh, - Rmesh, - psb_); - ModuleBase::Ylm::set_coefficients(); - MGT.init_Gaunt_CH(Lmax); - MGT.init_Gaunt(Lmax); -#endif -} - -void toWannier90_LCAO::set_R_coor(const UnitCell& ucell, const Grid_Driver& gd) -{ - int R_minX = int(-gd.getGlayerX_minus()); - int R_minY = int(-gd.getGlayerY_minus()); - int R_minZ = int(-gd.getGlayerZ_minus()); - - int R_x = gd.getGlayerX() + gd.getGlayerX_minus(); - int R_y = gd.getGlayerY() + gd.getGlayerY_minus(); - int R_z = gd.getGlayerZ() + gd.getGlayerZ_minus(); - - int R_num = R_x * R_y * R_z; - R_coor_car.resize(R_num); - - int count = 0; - for (int ix = 0; ix < R_x; ix++) - { - for (int iy = 0; iy < R_y; iy++) - { - for (int iz = 0; iz < R_z; iz++) - { - ModuleBase::Vector3 tmpR(ix + R_minX, iy + R_minY, iz + R_minZ); - R_coor_car[count] = tmpR * ucell.latvec; - count++; - } - } - } -} - -void toWannier90_LCAO::count_delta_k(const UnitCell& ucell, const K_Vectors& kv) -{ - std::set delta_k_all_tmp; - for (int ik = 0; ik < cal_num_kpts; ik++) - { - for (int ib = 0; ib < nntot; ib++) - { - int ikb = nnlist[ik][ib]; - ModuleBase::Vector3 G = nncell[ik][ib]; - - int cal_ik = ik + start_k_index; - int cal_ikb = ikb + start_k_index; - - ModuleBase::Vector3 ik_car = kv.kvec_c[ik]; - ModuleBase::Vector3 ikb_car = kv.kvec_c[ikb] + G * ucell.G; - Abfs::Vector3_Order dk = (ikb_car - ik_car) * ucell.tpiba; - Coordinate_3D temp_dk(dk.x, dk.y, dk.z); - delta_k_all_tmp.insert(temp_dk); - } - } - - delta_k_all.resize(delta_k_all_tmp.size()); - - int index = 0; - for (auto& delta_k: delta_k_all_tmp) - { - delta_k_all_index[delta_k] = index; - delta_k_all[index] = delta_k; - index++; - } -} - -void toWannier90_LCAO::unkdotkb(const UnitCell& ucell, - const K_Vectors& kv, - const psi::Psi>& psi_in, - const int& ik, - const int& ikb, - const ModuleBase::Vector3 G, - ModuleBase::ComplexMatrix& Mmn) -{ - Mmn.create(num_bands, num_bands); - - int row = this->ParaV->get_row_size(); - int col = this->ParaV->get_col_size(); - int nloc = row * col; - std::complex* midmatrix = new std::complex[nloc]; - ModuleBase::GlobalFunc::ZEROS(midmatrix, nloc); - - int R_num = R_coor_car.size(); - ModuleBase::Vector3 ik_car = kv.kvec_c[ik]; - ModuleBase::Vector3 ikb_car = kv.kvec_c[ikb] + G * ucell.G; - Abfs::Vector3_Order dk = (ikb_car - ik_car) * ucell.tpiba; - Coordinate_3D temp_dk(dk.x, dk.y, dk.z); - int delta_k_index = delta_k_all_index[temp_dk]; - - hamilt::HContainer>* tmp_FR_container = FR[delta_k_index].get_FR_pointer(); - auto row_indexes = ParaV->get_indexes_row(); - auto col_indexes = ParaV->get_indexes_col(); - - for (int iap = 0; iap < tmp_FR_container->size_atom_pairs(); ++iap) - { - int atom_i = tmp_FR_container->get_atom_pair(iap).get_atom_i(); - int atom_j = tmp_FR_container->get_atom_pair(iap).get_atom_j(); - int start_i = ParaV->atom_begin_row[atom_i]; - int start_j = ParaV->atom_begin_col[atom_j]; - int row_size = ParaV->get_row_size(atom_i); - int col_size = ParaV->get_col_size(atom_j); - for (int iR = 0; iR < tmp_FR_container->get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = tmp_FR_container->get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = tmp_FR_container->get_atom_pair(iap).get_R_index(iR); - ModuleBase::Vector3 dR - = ModuleBase::Vector3(r_index.x, r_index.y, r_index.z) * ucell.latvec; - double phase = ikb_car * dR * ModuleBase::TWO_PI; - std::complex kRn_phase = std::exp(ModuleBase::IMAG_UNIT * phase); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - int ir = ParaV->global2local_row(mu); - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - int ic = ParaV->global2local_col(nu); - int index = ic * row + ir; - midmatrix[index] += kRn_phase * matrix.get_value(i, j); - } - } - } - } - - char transa = 'C'; - char transb = 'N'; - int Bands = PARAM.inp.nbands; - int nlocal = PARAM.globalv.nlocal; - std::complex alpha = {1.0, 0.0}, beta = {0.0, 0.0}; - int one = 1; - - std::complex* C_matrix = new std::complex[nloc]; - std::complex* out_matrix = new std::complex[nloc]; - ModuleBase::GlobalFunc::ZEROS(C_matrix, nloc); - ModuleBase::GlobalFunc::ZEROS(out_matrix, nloc); - -#ifdef __MPI - pzgemm_(&transa, - &transb, - &Bands, - &nlocal, - &nlocal, - &alpha, - &psi_in(ik, 0, 0), - &one, - &one, - this->ParaV->desc, - midmatrix, - &one, - &one, - this->ParaV->desc, - &beta, - C_matrix, - &one, - &one, - this->ParaV->desc); - - pzgemm_(&transb, - &transb, - &Bands, - &Bands, - &nlocal, - &alpha, - C_matrix, - &one, - &one, - this->ParaV->desc, - &psi_in(ikb, 0, 0), - &one, - &one, - this->ParaV->desc, - &beta, - out_matrix, - &one, - &one, - this->ParaV->desc); -#endif - - int count_m = -1; - for (int m = 0; m < PARAM.inp.nbands; m++) - { - if (exclude_bands.count(m)) { - continue; -} - count_m++; - - int ir = this->ParaV->global2local_row(m); - if (ir >= 0) - { - int count_n = -1; - for (int n = 0; n < PARAM.inp.nbands; n++) - { - if (exclude_bands.count(n)) { - continue; -} - count_n++; - - int ic = this->ParaV->global2local_col(n); - if (ic >= 0) - { - int index = ic * row + ir; - Mmn(count_m, count_n) = out_matrix[index]; - } - } - } - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(Mmn.c, num_bands * num_bands); -#endif - - delete[] midmatrix; - delete[] C_matrix; - delete[] out_matrix; -} - -void toWannier90_LCAO::produce_basis_orb() -{ - int mat_Nr = orb_.Phi[0].PhiLN(0, 0).getNr(); - int count_Nr = 0; - - orbs.resize(orb_.get_ntype()); - for (int T = 0; T < orb_.get_ntype(); ++T) - { - count_Nr = orb_.Phi[T].PhiLN(0, 0).getNr(); - if (count_Nr > mat_Nr) - { - mat_Nr = count_Nr; - orb_r_ntype = T; - } - - orbs[T].resize(orb_.Phi[T].getLmax() + 1); - for (int L = 0; L <= orb_.Phi[T].getLmax(); ++L) - { - orbs[T][L].resize(orb_.Phi[T].getNchi(L)); - for (int N = 0; N < orb_.Phi[T].getNchi(L); ++N) - { - const auto& orb_origin = orb_.Phi[T].PhiLN(L, N); - orbs[T][L][N].set_orbital_info(orb_origin.getLabel(), - orb_origin.getType(), - orb_origin.getL(), - orb_origin.getChi(), - orb_origin.getNr(), - orb_origin.getRab(), - orb_origin.getRadial(), - Numerical_Orbital_Lm::Psi_Type::Psi, - orb_origin.getPsi(), - static_cast(orb_origin.getNk() * kmesh_times) | 1, - orb_origin.getDk(), - orb_origin.getDruniform(), - false, - true, - PARAM.inp.cal_force); - } - } - } -} - -void toWannier90_LCAO::produce_trial_in_lcao() -{ - A_orbs.resize(num_wannier); - - double* r = new double[mesh_r]; - double* rab = new double[mesh_r]; - - for (int ir = 0; ir < mesh_r; ir++) - { - rab[ir] = dr; - r[ir] = ir * dr; - } - - const auto& orb_origin = orb_.Phi[orb_r_ntype].PhiLN(0, 0); - - double* psi = new double[mesh_r]; - double* psir = new double[mesh_r]; - double* inner = new double[mesh_r]; - for (int i = 0; i < num_wannier; i++) - { - double alfa32 = pow(alfa[i], 3.0 / 2.0); - double alfa_new = alfa[i]; - int wannier_index = i; - - if (rvalue[i] == 1) - { - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] = 2.0 * alfa32 * exp(-alfa_new * r[ir]); - } - } - - if (rvalue[i] == 2) - { - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] = 1.0 / sqrt(8.0) * alfa32 * (2.0 - alfa_new * r[ir]) * exp(-alfa_new * r[ir] * 0.5); - } - } - - if (rvalue[i] == 3) - { - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] = sqrt(4.0 / 27.0) * alfa32 - * (1.0 - 2.0 / 3.0 * alfa_new * r[ir] + 2.0 / 27.0 * pow(alfa_new, 2.0) * r[ir] * r[ir]) - * exp(-alfa_new * r[ir] * 1.0 / 3.0); - } - } - - for (int ir = 0; ir < mesh_r; ir++) - { - psir[ir] = psi[ir] * r[ir]; - } - - // renormalize radial wave functions - for (int ir = 0; ir < mesh_r; ir++) - { - inner[ir] = psir[ir] * psir[ir]; - } - double unit = 0.0; - ModuleBase::Integral::Simpson_Integral(mesh_r, inner, rab, unit); - - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] /= sqrt(unit); - } - - if (L[i] >= 0) - { - A_orbs[i].resize(1); - - A_orbs[i][0].set_orbital_info(orb_origin.getLabel(), - orb_origin.getType(), - L[i], - 1, - mesh_r, - rab, - r, - Numerical_Orbital_Lm::Psi_Type::Psi, - psi, - static_cast(orb_origin.getNk() * kmesh_times) | 1, - orb_origin.getDk(), - orb_origin.getDruniform(), - false, - true, - PARAM.inp.cal_force); - } - else - { - int tmp_size = 0; - - if (L[i] == -1 || L[i] == -2 || L[i] == -3) { - tmp_size = 2; -} - - if (L[i] == -4 || L[i] == -5) { - tmp_size = 3; -} - - A_orbs[i].resize(tmp_size); - - for (int tmp_L = 0; tmp_L < tmp_size; tmp_L++) - { - A_orbs[i][tmp_L].set_orbital_info(orb_origin.getLabel(), - orb_origin.getType(), - tmp_L, - 1, - mesh_r, - rab, - r, - Numerical_Orbital_Lm::Psi_Type::Psi, - psi, - static_cast(orb_origin.getNk() * kmesh_times) | 1, - orb_origin.getDk(), - orb_origin.getDruniform(), - false, - true, - PARAM.inp.cal_force); - } - } - } - - delete[] r; - delete[] rab; - delete[] psi; - delete[] psir; - delete[] inner; -} - -void toWannier90_LCAO::construct_overlap_table_project() -{ - int row = this->ParaV->get_row_size(); - int global_ir = 0; - - for (int ir = 0; ir < row; ir += PARAM.globalv.npol) - { - global_ir = ParaV->local2global_row(ir); - int orb_index_row = global_ir / PARAM.globalv.npol; - - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - if (L[wannier_index] >= 0) - { - center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].insert(std::make_pair( - 0, - Center2_Orb::Orb11(orbs[iw2it[orb_index_row]][iw2iL[orb_index_row]][iw2iN[orb_index_row]], - A_orbs[wannier_index][0], - psb_, - MGT))); - } - else - { - int tmp_size = 0; - - if (L[wannier_index] == -1 || L[wannier_index] == -2 || L[wannier_index] == -3) { - tmp_size = 2; -} - - if (L[wannier_index] == -4 || L[wannier_index] == -5) { - tmp_size = 3; -} - - for (int tmp_L = 0; tmp_L < tmp_size; tmp_L++) - { - center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].insert(std::make_pair( - tmp_L, - Center2_Orb::Orb11(orbs[iw2it[orb_index_row]][iw2iL[orb_index_row]][iw2iN[orb_index_row]], - A_orbs[wannier_index][tmp_L], - psb_, - MGT))); - } - } - } - } - - for (auto& co1: center2_orb11_A) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - co3.second.init_radial_table(); - } - } - } -} - -void toWannier90_LCAO::cal_orbA_overlap_R(const UnitCell& ucell) -{ - int row = this->ParaV->get_row_size(); - int R_num = R_coor_car.size(); - int global_ir = 0; - - psi_psiA_R.resize(row); - for (int ir = 0; ir < row; ir++) - { - psi_psiA_R[ir].resize(num_wannier); - - for (int ic = 0; ic < num_wannier; ++ic) - { - psi_psiA_R[ir][ic].resize(R_num); - } - } - - double bs2, bs3, bs6, bs12; - bs2 = 1.0 / sqrt(2.0); - bs3 = 1.0 / sqrt(3.0); - bs6 = 1.0 / sqrt(6.0); - bs12 = 1.0 / sqrt(12.0); - - for (int ir = 0; ir < row; ir++) - { - global_ir = ParaV->local2global_row(ir); - int orb_index_row = global_ir / PARAM.globalv.npol; - - int it1 = iw2it[orb_index_row]; - int ia1 = iw2ia[orb_index_row]; - int im1 = iw2im[orb_index_row]; - - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - if (L[wannier_index] >= 0) - { - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center = R_centre[wannier_index] * ucell.lat0; - - double overlap_o - = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap(orb_center, - project_orb_center, - im1, - m[wannier_index]); - psi_psiA_R[ir][wannier_index][iR] = overlap_o; - } - } - else - { - if (L[wannier_index] == -1) - { - double tmp_bs2 = 0; - if (m[wannier_index] == 0) { - tmp_bs2 = bs2; -} - if (m[wannier_index] == -1) { - tmp_bs2 = -bs2; -} - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(1).cal_overlap( - orb_center, - project_orb_center, - im1, - 1); - psi_psiA_R[ir][wannier_index][iR] = bs2 * overlap_s + tmp_bs2 * overlap_px; - } - } - - if (L[wannier_index] == -2) - { - if (m[wannier_index] == 0 || m[wannier_index] == 1) - { - double tmp_bs2 = bs2; - if (m[wannier_index] == -1) { - tmp_bs2 = -bs2; -} - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 1); - double overlap_py = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 2); - psi_psiA_R[ir][wannier_index][iR] - = bs3 * overlap_s - bs6 * overlap_px + tmp_bs2 * overlap_py; - } - } - else if (m[wannier_index] == 2) - { - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 1); - psi_psiA_R[ir][wannier_index][iR] = bs3 * overlap_s + 2.0 * bs6 * overlap_px; - } - } - } - - if (L[wannier_index] == -3) - { - double m_px = 1.0; - double m_py = 1.0; - double m_pz = 1.0; - - if (m[wannier_index] == 1) - { - m_py = -1.0; - m_pz = -1.0; - } - else if (m[wannier_index] == 2) - { - m_px = -1.0; - m_pz = -1.0; - } - else if (m[wannier_index] == 3) - { - m_px = -1.0; - m_py = -1.0; - } - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(1).cal_overlap( - orb_center, - project_orb_center, - im1, - 1); - double overlap_py = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(1).cal_overlap( - orb_center, - project_orb_center, - im1, - 2); - double overlap_pz = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(1).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - psi_psiA_R[ir][wannier_index][iR] - = 0.5 * (overlap_s + m_px * overlap_px + m_py * overlap_py + m_pz * overlap_pz); - } - } - - if (L[wannier_index] == -4) - { - if (m[wannier_index] == 0 || m[wannier_index] == 1) - { - double tmp_bs2 = bs2; - if (m[wannier_index] == -1) { - tmp_bs2 = -bs2; -} - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 1); - double overlap_py = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 2); - psi_psiA_R[ir][wannier_index][iR] - = bs3 * overlap_s - bs6 * overlap_px + tmp_bs2 * overlap_py; - } - } - else if (m[wannier_index] == 2) - { - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 1); - psi_psiA_R[ir][wannier_index][iR] = bs3 * overlap_s + 2.0 * bs6 * overlap_px; - } - } - else if (m[wannier_index] == 3 || m[wannier_index] == 4) - { - double m_pz = 1.0; - if (m[wannier_index] == 4) { - m_pz = -1.0; -} - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_pz = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 0); - double overlap_dz2 = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(2) - .cal_overlap(orb_center, project_orb_center, im1, 0); - psi_psiA_R[ir][wannier_index][iR] = bs2 * (m_pz * overlap_pz + overlap_dz2); - } - } - } - - if (L[wannier_index] == -5) - { - if (m[wannier_index] == 0 || m[wannier_index] == 1) - { - double tmp_bs2 = -bs2; - double tmp_bs12 = -bs12; - double tmp_d = 0.5; - - if (m[wannier_index] == 1) - { - tmp_bs2 = bs2; - } - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_px = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 1); - double overlap_dz2 = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(2) - .cal_overlap(orb_center, project_orb_center, im1, 0); - double overlap_dx2_y2 = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(2) - .cal_overlap(orb_center, project_orb_center, im1, 3); - psi_psiA_R[ir][wannier_index][iR] = bs6 * overlap_s + tmp_bs2 * overlap_px - + tmp_bs12 * overlap_dz2 + tmp_d * overlap_dx2_y2; - } - } - else if (m[wannier_index] == 2 || m[wannier_index] == 3) - { - double tmp_bs2 = -bs2; - double tmp_bs12 = -bs12; - double tmp_d = -0.5; - - if (m[wannier_index] == 3) - { - tmp_bs2 = bs2; - } - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_py = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 2); - double overlap_dz2 = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(2) - .cal_overlap(orb_center, project_orb_center, im1, 0); - double overlap_dx2_y2 = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(2) - .cal_overlap(orb_center, project_orb_center, im1, 3); - psi_psiA_R[ir][wannier_index][iR] = bs6 * overlap_s + tmp_bs2 * overlap_py - + tmp_bs12 * overlap_dz2 + tmp_d * overlap_dx2_y2; - } - } - else if (m[wannier_index] == 4 || m[wannier_index] == 5) - { - double tmp_pz = -1.0; - - if (m[wannier_index] == 5) { - tmp_pz = 1.0; -} - - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R_car = R_coor_car[iR]; - ModuleBase::Vector3 orb_center - = (ucell.atoms[it1].tau[ia1] + R_car) * ucell.lat0; - ModuleBase::Vector3 project_orb_center - = R_centre[wannier_index] * ucell.lat0; - - double overlap_s = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index].at(0).cal_overlap( - orb_center, - project_orb_center, - im1, - 0); - double overlap_pz = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(1) - .cal_overlap(orb_center, project_orb_center, im1, 0); - double overlap_dz2 = center2_orb11_A[iw2iorb[orb_index_row]][wannier_index] - .at(2) - .cal_overlap(orb_center, project_orb_center, im1, 0); - psi_psiA_R[ir][wannier_index][iR] - = bs6 * overlap_s + tmp_pz * bs2 * overlap_pz + bs3 * overlap_dz2; - } - } - } - } - } - } -} - -void toWannier90_LCAO::unkdotA(const K_Vectors& kv, - const psi::Psi>& psi_in, - const int& ik, - ModuleBase::ComplexMatrix& Amn) -{ - Amn.create(num_bands, num_wannier); - - int row = this->ParaV->get_row_size(); - int index_band = -1; - int R_num = R_coor_car.size(); - if (PARAM.inp.nspin != 4) - { - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - if (exclude_bands.count(ib)) { - continue; -} - index_band++; - - int ic = this->ParaV->global2local_col(ib); - if (ic >= 0) - { - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R = R_coor_car[iR]; - double kRn = -1.0 * kv.kvec_c[ik] * R * ModuleBase::TWO_PI; - std::complex kRn_phase(cos(kRn), sin(kRn)); - std::complex tmp(0.0, 0.0); - - for (int ir = 0; ir < row; ir++) - { - tmp += std::conj(psi_in(ik, ic, ir)) * psi_psiA_R[ir][wannier_index][iR]; - } - - Amn(index_band, wannier_index) += kRn_phase * tmp; - } - } - } - } - } - else - { - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - if (exclude_bands.count(ib)) { - continue; -} - index_band++; - - int ic = this->ParaV->global2local_col(ib); - if (ic >= 0) - { - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - for (int iR = 0; iR < R_num; iR++) - { - ModuleBase::Vector3 R = R_coor_car[iR]; - double kRn = kv.kvec_c[ik] * R * ModuleBase::TWO_PI; - std::complex kRn_phase(cos(kRn), sin(kRn)); - std::complex tmp(0.0, 0.0); - int half_row = row / 2; - for (int ir = 0; ir < half_row; ir++) - { - tmp += up_con[wannier_index] * std::conj(psi_in(ik, ic, 2 * ir)) - * psi_psiA_R[2 * ir][wannier_index][iR] - + dn_con[wannier_index] * std::conj(psi_in(ik, ic, 2 * ir + 1)) - * psi_psiA_R[2 * ir + 1][wannier_index][iR]; - } - - Amn(index_band, wannier_index) += kRn_phase * tmp; - } - } - } - } - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(Amn.c, Amn.size); -#endif -} -#endif diff --git a/source/module_io/to_wannier90_lcao.h b/source/module_io/to_wannier90_lcao.h deleted file mode 100644 index eca2f9bf46..0000000000 --- a/source/module_io/to_wannier90_lcao.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef TOWannier90_LCAO_H -#define TOWannier90_LCAO_H - -#include "source_base/abfs-vector3_order.h" -#include "source_base/complexmatrix.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/lapack_connector.h" -#include "source_base/matrix.h" -#include "source_base/matrix3.h" -#include "source_base/parallel_reduce.h" -#include "source_base/sph_bessel_recursive.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb.h" -#include "module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_psi/psi.h" -#include "single_R_io.h" -#include "to_wannier90.h" - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __LCAO -#include "fR_overlap.h" -#include "source_base/abfs-vector3_order.h" -#include "source_base/math_lebedev_laikov.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -class Coordinate_3D -{ - public: - double x = 0; - double y = 0; - double z = 0; - - Coordinate_3D(double x = 0.0, double y = 0.0, double z = 0.0) : x(x), y(y), z(z) - { - } - - bool operator<(const Coordinate_3D& other) const - { - const double threshold = 1e-8; - if (std::abs(x - other.x) >= threshold) - return x < other.x; - if (std::abs(y - other.y) >= threshold) - return y < other.y; - return std::abs(z - other.z) >= threshold && z < other.z; - } -}; - -class toWannier90_LCAO : public toWannier90 -{ - public: - toWannier90_LCAO(const bool& out_wannier_mmn, - const bool& out_wannier_amn, - const bool& out_wannier_unk, - const bool& out_wannier_eig, - const bool& out_wannier_wvfn_formatted, - const std::string& nnkpfile, - const std::string& wannier_spin, - const LCAO_Orbitals& orb - ); - ~toWannier90_LCAO(); - - void calculate(const UnitCell& ucell, - const Grid_Driver& gd, - const ModuleBase::matrix& ekb, - const K_Vectors& kv, - const psi::Psi>& psi, - const Parallel_Orbitals* pv); - - void calculate(const UnitCell& ucell, - const Grid_Driver& gd, - const ModuleBase::matrix& ekb, - const K_Vectors& kv, - const psi::Psi& psi, - const Parallel_Orbitals* pv) - { - throw std::logic_error("The wave function of toWannier90_LCAO_IN_PW is generally a std::complex type."); - } - - void cal_Amn(const UnitCell& ucell, const K_Vectors& kv, const psi::Psi>& psi); - void cal_Mmn(const UnitCell& ucell, const K_Vectors& kv, const psi::Psi>& psi); - void out_unk(const psi::Psi>& psi); - - protected: - // Radial section of trial orbitals - const int mesh_r = 1001; // unit is a.u. - const double dr = 0.01; - std::vector> A_orbs; - - const LCAO_Orbitals& orb_; - - // Use default element orbital information - int orb_r_ntype = 0; - - ModuleBase::Sph_Bessel_Recursive::D2* psb_ = nullptr; - ORB_gaunt_table MGT; - double kmesh_times = 1; - - Numerical_Orbital_Lm orb_r; - std::vector>> orbs; - std::map>> center2_orb11_A; - - std::vector> R_coor_car; - std::vector>> psi_psiA_R; - - std::vector iw2it; - std::vector iw2ia; - std::vector iw2iL; - std::vector iw2iN; - std::vector iw2im; - std::vector iw2iorb; - - const Parallel_Orbitals* ParaV; - - void initialize_orb_table(const UnitCell& ucell); - void produce_basis_orb(); - void set_R_coor(const UnitCell& ucell, const Grid_Driver& gd); - void count_delta_k(const UnitCell& ucell, const K_Vectors& kv); - - std::vector delta_k_all; - std::map delta_k_all_index; - - void unkdotkb(const UnitCell& ucell, - const K_Vectors& kv, - const psi::Psi>& psi_in, - const int& ik, - const int& ikb, - const ModuleBase::Vector3 G, - ModuleBase::ComplexMatrix& Mmn); - - void produce_trial_in_lcao(); - void construct_overlap_table_project(); - void cal_orbA_overlap_R(const UnitCell& ucell); - - void unkdotA(const K_Vectors& kv, - const psi::Psi>& psi_in, - const int& ik, - ModuleBase::ComplexMatrix& Amn); - - std::vector>> FR; -}; -#endif -#endif diff --git a/source/module_io/to_wannier90_lcao_in_pw.cpp b/source/module_io/to_wannier90_lcao_in_pw.cpp deleted file mode 100644 index 634c7945a3..0000000000 --- a/source/module_io/to_wannier90_lcao_in_pw.cpp +++ /dev/null @@ -1,276 +0,0 @@ -#include "to_wannier90_lcao_in_pw.h" - -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/math_integral.h" -#include "source_base/math_polyint.h" -#include "source_base/math_sphbes.h" -#include "source_base/math_ylmreal.h" -#include "source_base/parallel_reduce.h" -#include "binstream.h" - -#include "source_psi/psi_initializer_nao.h" -#ifdef __LCAO -toWannier90_LCAO_IN_PW::toWannier90_LCAO_IN_PW( - const bool &out_wannier_mmn, - const bool &out_wannier_amn, - const bool &out_wannier_unk, - const bool &out_wannier_eig, - const bool &out_wannier_wvfn_formatted, - const std::string &nnkpfile, - const std::string &wannier_spin -):toWannier90_PW(out_wannier_mmn, out_wannier_amn, out_wannier_unk, out_wannier_eig, out_wannier_wvfn_formatted, nnkpfile, wannier_spin) -{ -} - -toWannier90_LCAO_IN_PW::~toWannier90_LCAO_IN_PW() -{ - delete psi_initer_; - delete psi; -} - -void toWannier90_LCAO_IN_PW::calculate( - UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw, - const Structure_Factor& sf, - const K_Vectors& kv, - const psi::Psi>* psi, - const Parallel_Orbitals *pv -) -{ - this->ParaV = pv; - - Structure_Factor* sf_ptr = const_cast(&sf); - ModulePW::PW_Basis_K* wfcpw_ptr = const_cast(wfcpw); - delete this->psi_initer_; - this->psi_initer_ = new psi_initializer_nao>(); - this->psi_initer_->initialize(sf_ptr, wfcpw_ptr, &ucell, &kv, 1, nullptr, GlobalV::MY_RANK); - this->psi_initer_->tabulate(); - delete this->psi; - const int nks_psi = (PARAM.inp.calculation == "nscf" && PARAM.inp.mem_saver == 1)? 1 : wfcpw->nks; - const int nks_psig = (PARAM.inp.basis_type == "pw")? 1 : nks_psi; - const int nbands_actual = this->psi_initer_->nbands_start(); - this->psi = new psi::Psi, base_device::DEVICE_CPU>(nks_psig, - nbands_actual, - wfcpw->npwk_max*PARAM.globalv.npol, - kv.ngk, - true); - read_nnkp(ucell,kv); - - if (PARAM.inp.nspin == 2) - { - if (wannier_spin == "up") - { - start_k_index = 0; - } - else if (wannier_spin == "down") - { - start_k_index = num_kpts / 2; - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::calculate", "Error wannier_spin set,is not \"up\" or \"down\" "); - } - } - - psi::Psi> *unk_inLcao = get_unk_from_lcao(ucell,*psi, wfcpw, sf, kv); - - if (out_wannier_eig) - { - out_eig(ekb); - } - -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - // To calculate the Mmn and Amn files, cal_band_index needs to be modified, - // because the wave function unk_inLcao only stores the energy bands that need to be calculated. - for (int ib = 0; ib < num_bands; ib++) - { - cal_band_index[ib] = ib; - } - - if (out_wannier_mmn) - { - cal_Mmn(*unk_inLcao, wfcpw); - } - - if (out_wannier_amn) - { - cal_Amn(*unk_inLcao, wfcpw); - } - - if (out_wannier_unk) - { - out_unk(*unk_inLcao, wfcpw, bigpw); - } - - delete unk_inLcao; -} - -psi::Psi>* toWannier90_LCAO_IN_PW::get_unk_from_lcao( - const UnitCell& ucell, - const psi::Psi>& psi_in, - const ModulePW::PW_Basis_K* wfcpw, - const Structure_Factor& sf, - const K_Vectors& kv -) -{ - // init - int npwx = wfcpw->npwk_max; - psi::Psi> *unk_inLcao = new psi::Psi>(num_kpts, - num_bands, - npwx*PARAM.globalv.npol, - kv.ngk, - true); - unk_inLcao->zero_out(); - - // Orbital projection to plane wave - ModuleBase::realArray table_local(ucell.ntype, ucell.nmax_total, PARAM.globalv.nqx); - - for (int ik = 0; ik < num_kpts; ik++) - { - int npw = kv.ngk[ik]; - ModuleBase::ComplexMatrix orbital_in_G(PARAM.globalv.nlocal, npwx*PARAM.globalv.npol); - // Wavefunc_in_pw::produce_local_basis_in_pw(ik, wfcpw, sf, orbital_in_G, table_local); - //produce_local_basis_in_pw(ik, wfcpw, sf, orbital_in_G, table_local); - nao_G_expansion(ik, wfcpw, orbital_in_G); - - ModuleBase::ComplexMatrix lcao_wfc_global; - get_lcao_wfc_global_ik(ik, psi_in, lcao_wfc_global); - - if (PARAM.inp.nspin != 4) - { - for (int ib = 0; ib < num_bands; ib++) - { - for (int ig = 0; ig < npw; ig++) - { - for (int iw = 0; iw < PARAM.globalv.nlocal; iw++) - { - unk_inLcao[0](ik, ib, ig) += lcao_wfc_global(ib, iw) * orbital_in_G(iw, ig); - } - } - - std::complex anorm(0.0, 0.0); - for (int ig = 0; ig < npw; ig++) - { - anorm = anorm + conj(unk_inLcao[0](ik, ib, ig)) * unk_inLcao[0](ik, ib, ig); - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(anorm); -#endif - - for (int ig = 0; ig < npw; ig++) - { - unk_inLcao[0](ik, ib, ig) = unk_inLcao[0](ik, ib, ig) / sqrt(anorm); - } - } - } - else - { - for (int ib = 0; ib < num_bands; ib++) - { - // for (int ig = 0; ig < npwx*PARAM.globalv.npol; ig++) - // { - // for (int iw = 0; iw < PARAM.globalv.nlocal; iw++) - // { - // unk_inLcao[0](ik, ib, ig) += lcao_wfc_global(ib, iw) * orbital_in_G(iw, ig); - // } - // } - - for (int ig = 0; ig < npw; ig++) - { - int basis_num = PARAM.globalv.nlocal / 2; - for (int iw = 0; iw < basis_num; iw++) - { - unk_inLcao[0](ik, ib, ig) += lcao_wfc_global(ib, 2*iw) * orbital_in_G(iw, ig); - unk_inLcao[0](ik, ib, ig+npwx) += lcao_wfc_global(ib, 2*iw+1) * orbital_in_G(iw, ig); - } - } - - std::complex anorm(0.0, 0.0); - for (int ig = 0; ig < npw; ig++) - { - anorm = anorm + conj(unk_inLcao[0](ik, ib, ig)) * unk_inLcao[0](ik, ib, ig) + conj(unk_inLcao[0](ik, ib, ig+npwx)) * unk_inLcao[0](ik, ib, ig+npwx); - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(anorm); -#endif - - for (int ig = 0; ig < npw; ig++) - { - unk_inLcao[0](ik, ib, ig) = unk_inLcao[0](ik, ib, ig) / sqrt(anorm); - unk_inLcao[0](ik, ib, ig+npwx) = unk_inLcao[0](ik, ib, ig+npwx) / sqrt(anorm); - } - } - } - - } - -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - return unk_inLcao; -} - -void toWannier90_LCAO_IN_PW::nao_G_expansion( - const int& ik, - const ModulePW::PW_Basis_K* wfcpw, - ModuleBase::ComplexMatrix& psi -) -{ - int npwx = wfcpw->npwk_max; - this->psi->fix_k(ik); - this->psi_initer_->init_psig(this->psi->get_pointer(), ik); - int nbands = PARAM.globalv.nlocal; - int nbasis = npwx*PARAM.globalv.npol; - for (int ib = 0; ib < nbands; ib++) - { - for (int ig = 0; ig < nbasis; ig++) - { - psi(ib, ig) = this->psi->operator()(ib, ig); - } - } -} - -void toWannier90_LCAO_IN_PW::get_lcao_wfc_global_ik( - const int ik, - const psi::Psi>& psi_in, - ModuleBase::ComplexMatrix &lcao_wfc_global -) -{ - lcao_wfc_global.create(num_bands, PARAM.globalv.nlocal); - - int count_b = -1; - int row = this->ParaV->get_row_size(); - int global_row_index = 0; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - if (exclude_bands.count(ib)) { continue; -} - count_b++; - - int ic = this->ParaV->global2local_col(ib); - - if (ic >= 0) - { - for (int ir = 0; ir < row; ir++) - { - global_row_index = this->ParaV->local2global_row(ir); - lcao_wfc_global(count_b, global_row_index) = psi_in(ik, ic, ir); - } - } - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(lcao_wfc_global.c, lcao_wfc_global.size); -#endif - -} -#endif diff --git a/source/module_io/to_wannier90_lcao_in_pw.h b/source/module_io/to_wannier90_lcao_in_pw.h deleted file mode 100644 index 7437881763..0000000000 --- a/source/module_io/to_wannier90_lcao_in_pw.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_TO_WANNIER90_LCAO_IN_PW_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_TO_WANNIER90_LCAO_IN_PW_H - -#include "source_base/abfs-vector3_order.h" -#include "source_base/complexmatrix.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/lapack_connector.h" -#include "source_base/matrix.h" -#include "source_base/matrix3.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_base/vector3.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_psi/psi.h" -#include "single_R_io.h" -#include "to_wannier90.h" -#include "to_wannier90_pw.h" - -#include -#include -#include -#include -#include - -#ifdef __LCAO -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" -#include "source_psi/psi_initializer.h" - -class toWannier90_LCAO_IN_PW : public toWannier90_PW -{ - public: - toWannier90_LCAO_IN_PW(const bool& out_wannier_mmn, - const bool& out_wannier_amn, - const bool& out_wannier_unk, - const bool& out_wannier_eig, - const bool& out_wannier_wvfn_formatted, - const std::string& nnkpfile, - const std::string& wannier_spin); - ~toWannier90_LCAO_IN_PW(); - - void calculate(UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw, - const Structure_Factor& sf, - const K_Vectors& kv, - const psi::Psi>* psi, - const Parallel_Orbitals* pv); - - void calculate(UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw, - const Structure_Factor& sf, - const K_Vectors& kv, - const psi::Psi* psi, - const Parallel_Orbitals* pv) - { - throw std::logic_error("The wave function of toWannier90_LCAO_IN_PW is generally a std::complex type."); - } - - protected: - const Parallel_Orbitals* ParaV; - /// @brief psi initializer for expanding nao in planewave basis - psi_initializer>* psi_initer_ = nullptr; - - psi::Psi, base_device::DEVICE_CPU>* psi = nullptr; - - /// @brief get Bloch function from LCAO wavefunction - /// @param psi_in - /// @param wfcpw [in] data carrier, storing planewave basis number and k information - /// @param sf [in] computational methods instance, structure factor calculator - /// @param kv [in] data carrier, storing kpoints information - /// @return psi::Psi>* - psi::Psi>* get_unk_from_lcao(const UnitCell& ucell, - const psi::Psi>& psi_in, - const ModulePW::PW_Basis_K* wfcpw, - const Structure_Factor& sf, - const K_Vectors& kv); - /// @brief expand numerical atomic orbital (nao) in planewave basis at specific k point - /// @param ik [in] index of kpoint - /// @param wfc_basis [in] data carrier, storing planewave basis number and k information - /// @param psi [out] data carrier, storing the expanded wavefunction - void nao_G_expansion(const int& ik, const ModulePW::PW_Basis_K* wfc_basis, ModuleBase::ComplexMatrix& psi); - - void get_lcao_wfc_global_ik(const int ik, - const psi::Psi>& psi_in, - ModuleBase::ComplexMatrix& lcao_wfc_global); -}; -#endif - -#endif diff --git a/source/module_io/to_wannier90_pw.cpp b/source/module_io/to_wannier90_pw.cpp deleted file mode 100644 index 26eb145108..0000000000 --- a/source/module_io/to_wannier90_pw.cpp +++ /dev/null @@ -1,1057 +0,0 @@ -#include "to_wannier90_pw.h" - -#include "module_parameter/parameter.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_base/math_integral.h" -#include "source_base/math_polyint.h" -#include "source_base/math_sphbes.h" -#include "source_base/math_ylmreal.h" -#include "source_base/parallel_reduce.h" -#include "binstream.h" - -toWannier90_PW::toWannier90_PW( - const bool &out_wannier_mmn, - const bool &out_wannier_amn, - const bool &out_wannier_unk, - const bool &out_wannier_eig, - const bool &out_wannier_wvfn_formatted, - const std::string &nnkpfile, - const std::string &wannier_spin -):toWannier90(out_wannier_mmn, out_wannier_amn, out_wannier_unk, out_wannier_eig, out_wannier_wvfn_formatted, nnkpfile, wannier_spin) -{ - -} - -toWannier90_PW::~toWannier90_PW() -{ - -} - -void toWannier90_PW::calculate( - const UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw, - const K_Vectors& kv, - const psi::Psi>* psi -) -{ - read_nnkp(ucell,kv); - - if (PARAM.inp.nspin == 2) - { - if (wannier_spin == "up") - { - start_k_index = 0; - } - else if (wannier_spin == "down") - { - start_k_index = num_kpts / 2; - } - else - { - ModuleBase::WARNING_QUIT("toWannier90::calculate", "Error wannier_spin set,is not \"up\" or \"down\" "); - } - } - - if (out_wannier_eig) - { - out_eig(ekb); - } - - if (out_wannier_mmn) - { - cal_Mmn(*psi, wfcpw); - } - - if (out_wannier_amn) - { - cal_Amn(*psi, wfcpw); - } - - if (out_wannier_unk) - { - out_unk(*psi, wfcpw, bigpw); - } - -} -void toWannier90_PW::set_tpiba_omega(const double& tpiba, const double& omega) -{ - this->tpiba = &tpiba; - this->omega = ω - -} - -void toWannier90_PW::cal_Mmn( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw -) -{ - std::ofstream mmn_file; - - if (GlobalV::MY_RANK == 0) - { - std::string fileaddress = PARAM.globalv.global_out_dir + wannier_file_name + ".mmn"; - mmn_file.open(fileaddress.c_str(), std::ios::out); - - time_t time_now = time(NULL); - mmn_file << " Created on " << ctime(&time_now); - mmn_file << std::setw(12) << num_bands << std::setw(12) << cal_num_kpts << std::setw(12) << nntot << std::endl; - } - - for (int ik = 0; ik < cal_num_kpts; ik++) - { - for (int ib = 0; ib < nntot; ib++) - { - int ikb = nnlist[ik][ib]; - ModuleBase::Vector3 phase_G = nncell[ik][ib]; - ModuleBase::ComplexMatrix Mmn; - - int cal_ik = ik + start_k_index; - int cal_ikb = ikb + start_k_index; - unkdotkb(psi_pw, wfcpw, cal_ik, cal_ikb, phase_G, Mmn); - - if (GlobalV::MY_RANK == 0) - { - mmn_file << std::setw(5) << ik + 1 << std::setw(5) << ikb + 1 << std::setw(5) << int(phase_G.x) - << std::setw(5) << int(phase_G.y) << std::setw(5) << int(phase_G.z) << std::endl; - - for (int n = 0; n < num_bands; n++) - { - for (int m = 0; m < num_bands; m++) - { - mmn_file << std::setw(18) << std::setprecision(12) << std::showpoint << std::fixed << Mmn(m, n).real() - << std::setw(18) << std::setprecision(12) << std::showpoint << std::fixed - << Mmn(m, n).imag() - // jingan test - // << " " << std::setw(12) << std::setprecision(9) << std::abs(Mmn(m, n)) - << std::endl; - } - } - } - - } - } - - if (GlobalV::MY_RANK == 0) mmn_file.close(); - -} - - -void toWannier90_PW::cal_Amn( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw -) -{ - std::vector radial_in_q; - gen_radial_function_in_q(radial_in_q); - - std::ofstream Amn_file; - - if (GlobalV::MY_RANK == 0) - { - time_t time_now = time(NULL); - std::string fileaddress = PARAM.globalv.global_out_dir + wannier_file_name + ".amn"; - Amn_file.open(fileaddress.c_str(), std::ios::out); - Amn_file << " Created on " << ctime(&time_now); - Amn_file << std::setw(12) << num_bands << std::setw(12) << cal_num_kpts << std::setw(12) << num_wannier - << std::endl; - } - - for (int ik = start_k_index; ik < (cal_num_kpts + start_k_index); ik++) - { - ModuleBase::ComplexMatrix Amn; - unkdotW_A(psi_pw, wfcpw, ik, radial_in_q, Amn); - - if (GlobalV::MY_RANK == 0) - { - for (int iw = 0; iw < num_wannier; iw++) - { - for (int ib_w = 0; ib_w < num_bands; ib_w++) - { - Amn_file << std::setw(5) << ib_w + 1 << std::setw(5) << iw + 1 << std::setw(5) - << ik + 1 - start_k_index << std::setw(18) << std::showpoint << std::fixed << std::setprecision(12) - << Amn(ib_w, iw).real() << std::setw(18) << std::showpoint << std::fixed << std::setprecision(12) - << Amn(ib_w, iw).imag() - // jingan test - //<< " " << std::setw(18) << std::setprecision(13) << std::abs(Amn(ib_w, iw)) - << std::endl; - } - } - } - } - - if (GlobalV::MY_RANK == 0) Amn_file.close(); - -} - -void toWannier90_PW::out_unk( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw -) -{ - const bool wvfn_formatted = out_wannier_wvfn_formatted; - -#ifdef __MPI - // which_ip: found iz belongs to which ip. - std::vector which_ip(wfcpw->nz); - ModuleBase::GlobalFunc::ZEROS(which_ip.data(), wfcpw->nz); - - for (int ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) - { - int iz = wfcpw->startz[ip]; - for (int index = 0; index < wfcpw->numz[ip]; index++) - { - which_ip[iz+index] = ip; - } - } - - // only do in the first pool. - std::complex* porter = new std::complex[wfcpw->nrxx]; - int nxy = wfcpw->nx * wfcpw->ny; - std::complex *zpiece = new std::complex[nxy]; - - if (GlobalV::MY_POOL == 0) - { - for (int ik = start_k_index; ik < (cal_num_kpts + start_k_index); ik++) - { - std::ofstream unkfile; - Binstream unkfile_b; - - if (GlobalV::RANK_IN_POOL == 0) - { - - std::stringstream name; - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - name << PARAM.globalv.global_out_dir << "UNK" << std::setw(5) << std::setfill('0') << ik + 1 << ".1"; - } - else if (PARAM.inp.nspin == 2) - { - if (wannier_spin == "up") - name << PARAM.globalv.global_out_dir << "UNK" << std::setw(5) << std::setfill('0') - << ik + 1 - start_k_index << ".1"; - else if (wannier_spin == "down") - name << PARAM.globalv.global_out_dir << "UNK" << std::setw(5) << std::setfill('0') - << ik + 1 - start_k_index << ".2"; - } - if (wvfn_formatted) - { - unkfile.open(name.str(), std::ios::out); - unkfile << std::setw(12) << wfcpw->nx << std::setw(12) << wfcpw->ny << std::setw(12) << wfcpw->nz - << std::setw(12) << ik + 1 << std::setw(12) << num_bands << std::endl; - } - else - { - unkfile_b.open(name.str(), "w"); - unkfile_b << int(20) << wfcpw->nx << wfcpw->ny << wfcpw->nz << ik + 1 << num_bands << 20; - } - } - - for (int ib_w = 0; ib_w < num_bands; ib_w++) - { - int ib = cal_band_index[ib_w]; - - wfcpw->recip2real(&psi_pw(ik, ib, 0), porter, ik); - - if (GlobalV::RANK_IN_POOL == 0) - { - if (!wvfn_formatted) - { - unkfile_b << wfcpw->nz * wfcpw->ny * wfcpw->nx * 8 * 2; // sizeof(double) = 8 - } - } - - // save the rho one z by one z. - for (int iz = 0; iz < wfcpw->nz; iz++) - { - // tag must be different for different iz. - ModuleBase::GlobalFunc::ZEROS(zpiece, nxy); - int tag = iz; - MPI_Status ierror; - - // case 1: the first part of rho in processor 0. - if (which_ip[iz] == 0 && GlobalV::RANK_IN_POOL == 0) - { - for (int ir = 0; ir < nxy; ir++) - { - zpiece[ir] = porter[ir * wfcpw->nplane + iz - wfcpw->startz_current]; - } - } - // case 2: > first part rho: send the rho to - // processor 0. - else if (which_ip[iz] == GlobalV::RANK_IN_POOL) - { - for (int ir = 0; ir < nxy; ir++) - { - zpiece[ir] = porter[ir * wfcpw->nplane + iz - wfcpw->startz_current]; - } - MPI_Send(zpiece, nxy, MPI_DOUBLE_COMPLEX, 0, tag, POOL_WORLD); - } - - // case 2: > first part rho: processor 0 receive the rho - // from other processors - else if (GlobalV::RANK_IN_POOL == 0) - { - MPI_Recv(zpiece, nxy, MPI_DOUBLE_COMPLEX, which_ip[iz], tag, POOL_WORLD, &ierror); - } - - // write data - if (GlobalV::RANK_IN_POOL == 0) - { - if (wvfn_formatted) - { - for (int iy = 0; iy < wfcpw->ny; iy++) - { - for (int ix = 0; ix < wfcpw->nx; ix++) - { - unkfile << std::setw(20) << std::setprecision(9) << std::setiosflags(std::ios::scientific) - << zpiece[ix * wfcpw->ny + iy].real() << std::setw(20) << std::setprecision(9) - << std::setiosflags(std::ios::scientific) << zpiece[ix * wfcpw->ny + iy].imag() - << std::endl; - } - } - } - else - { - for (int iy = 0; iy < wfcpw->ny; iy++) - { - for (int ix = 0; ix < wfcpw->nx; ix++) - { - unkfile_b << zpiece[ix * wfcpw->ny + iy].real() << zpiece[ix * wfcpw->ny + iy].imag(); - } - } - } - } - } // end iz - if (GlobalV::RANK_IN_POOL == 0) - { - if (!wvfn_formatted) - { - unkfile_b << wfcpw->nz * wfcpw->ny * wfcpw->nx * 8 * 2; // sizeof(double) = 8 - } - } - MPI_Barrier(POOL_WORLD); - } // ib_w - - if (GlobalV::RANK_IN_POOL == 0) - { - if (wvfn_formatted) - unkfile.close(); - else - unkfile_b.close(); - } - } - } - MPI_Barrier(MPI_COMM_WORLD); - - delete[] porter; - delete[] zpiece; - -#endif - -} - - -void toWannier90_PW::unkdotkb( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw, - const int& cal_ik, - const int& cal_ikb, - const ModuleBase::Vector3 G, - ModuleBase::ComplexMatrix &Mmn -) -{ - Mmn.create(num_bands, num_bands); - - for (int m = 0; m < num_bands; m++) - { - int im = cal_band_index[m]; - std::complex* phase = new std::complex[wfcpw->nmaxgr]; - ModuleBase::GlobalFunc::ZEROS(phase, wfcpw->nmaxgr); - - // get the phase value in realspace - for (int ig = 0; ig < wfcpw->npwk[cal_ik]; ig++) - { - // if wfcpw->getgdirect(cal_ik, ig) == phase_G - ModuleBase::Vector3 temp_G = wfcpw->getgdirect(cal_ik, ig) - G; - if (temp_G.norm() < 1e-9) - { - phase[ig] = std::complex(1.0, 0.0); - break; - } - } - - wfcpw->recip2real(phase, phase, cal_ik); - - if (PARAM.inp.nspin == 4) - { - // (1) set value - std::complex* psir_up = new std::complex[wfcpw->nmaxgr]; - std::complex* psir_dn = new std::complex[wfcpw->nmaxgr]; - ModuleBase::GlobalFunc::ZEROS(psir_up, wfcpw->nmaxgr); - ModuleBase::GlobalFunc::ZEROS(psir_dn, wfcpw->nmaxgr); - - // (2) fft and get value - // int npw_ik = wfcpw->npwk[cal_ik]; - int npwx = wfcpw->npwk_max; - wfcpw->recip2real(&psi_pw(cal_ik, im, 0), psir_up, cal_ik); - // wfcpw->recip2real(&psi_pw(cal_ik, im, npw_ik), psir_dn, cal_ik); - wfcpw->recip2real(&psi_pw(cal_ik, im, npwx), psir_dn, cal_ik); - for (int ir = 0; ir < wfcpw->nrxx; ir++) - { - psir_up[ir] *= phase[ir]; - psir_dn[ir] *= phase[ir]; - } - - wfcpw->real2recip(psir_up, psir_up, cal_ikb); - wfcpw->real2recip(psir_dn, psir_dn, cal_ikb); - - for (int n = 0; n < num_bands; n++) - { - int in = cal_band_index[n]; - - if (!gamma_only_wannier) - { - std::complex result_tem(0.0, 0.0); - - // int npw_ikb = wfcpw->npwk[cal_ikb]; - int pwNumberMax = wfcpw->npwk_max; - - // Can be accelerated using lapack - for (int ig = 0; ig < pwNumberMax; ig++) - { - result_tem = result_tem + conj(psir_up[ig]) * psi_pw(cal_ikb, in, ig) + conj(psir_dn[ig]) * psi_pw(cal_ikb, in, ig+pwNumberMax); - } -#ifdef __MPI - Parallel_Reduce::reduce_all(result_tem); -#endif - Mmn(m, n) = result_tem; - } - else - { - // GlobalV::ofs_running << "gamma only test" << std::endl; - } - - } - - delete[] psir_up; - delete[] psir_dn; - - } - else - { - // (1) set value - std::complex* psir = new std::complex[wfcpw->nmaxgr]; - ModuleBase::GlobalFunc::ZEROS(psir, wfcpw->nmaxgr); - - // (2) fft and get value - wfcpw->recip2real(&psi_pw(cal_ik, im, 0), psir, cal_ik); - for (int ir = 0; ir < wfcpw->nrxx; ir++) - { - psir[ir] *= phase[ir]; - } - - wfcpw->real2recip(psir, psir, cal_ikb); - - for (int n = 0; n < num_bands; n++) - { - int in = cal_band_index[n]; - - if (!gamma_only_wannier) - { - std::complex result_tem(0.0, 0.0); - - // Can be accelerated using lapack - for (int ig = 0; ig < wfcpw->npwk[cal_ikb]; ig++) - { - result_tem = result_tem + conj(psir[ig]) * psi_pw(cal_ikb, in, ig); - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(result_tem); -#endif - Mmn(m, n) = result_tem; - } - else - { - // GlobalV::ofs_running << "gamma only test" << std::endl; - } - - } - - delete[] psir; - - } - - delete[] phase; - - } - -} - -void toWannier90_PW::gen_radial_function_in_q(std::vector &radial_in_q) -{ - // The radial function is Fourier transformed into the q-space. - radial_in_q.resize(num_wannier); - - double *r = new double[mesh_r]; - double *dr = new double[mesh_r]; - double *psi = new double[mesh_r]; - double *psir = new double[mesh_r]; - - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - double x = 0; - for (int ir = 0; ir < mesh_r; ir++) - { - x = x_min + ir * dx; - r[ir] = exp(x) / alfa[wannier_index]; - dr[ir] = dx * r[ir]; - } - - double alfa32 = pow(alfa[wannier_index], 3.0 / 2.0); - double alfa_new = alfa[wannier_index]; - - if (rvalue[wannier_index] == 1) - { - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] = 2.0 * alfa32 * exp(-alfa_new * r[ir]); - } - } - - if (rvalue[wannier_index] == 2) - { - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] = 1.0 / sqrt(8.0) * alfa32 * (2.0 - alfa_new * r[ir]) * exp(-alfa_new * r[ir] * 0.5); - } - } - - if (rvalue[wannier_index] == 3) - { - for (int ir = 0; ir < mesh_r; ir++) - { - psi[ir] = sqrt(4.0 / 27.0) * alfa32 - * (1.0 - 2.0 / 3.0 * alfa_new * r[ir] + 2.0 / 27.0 * pow(alfa_new, 2.0) * r[ir] * r[ir]) - * exp(-alfa_new * r[ir] * 1.0 / 3.0); - } - } - - for (int ir = 0; ir < mesh_r; ir++) - { - psir[ir] = psi[ir] * r[ir]; - } - - auto &tmp_radial = radial_in_q[wannier_index]; - if (L[wannier_index] >= 0) - { - tmp_radial.create(1, PARAM.globalv.nqx); - integral(mesh_r, psir, r, dr, L[wannier_index], tmp_radial.c); - } - else - { - int tmp_size = 0; - - if (L[wannier_index] == -1 || L[wannier_index] == -2 || L[wannier_index] == -3) tmp_size = 2; - - if (L[wannier_index] == -4 || L[wannier_index] == -5) tmp_size = 3; - - tmp_radial.create(tmp_size, PARAM.globalv.nqx); - - for (int tmp_L = 0; tmp_L < tmp_size; tmp_L++) - { - integral(mesh_r, psir, r, dr, tmp_L, tmp_radial.c+tmp_L*PARAM.globalv.nqx); - } - } - - } - - delete[] r; - delete[] dr; - delete[] psi; - delete[] psir; - -} - -void toWannier90_PW::produce_trial_in_pw( - const psi::Psi>& psi_pw, - const int& ik, - const ModulePW::PW_Basis_K* wfcpw, - const std::vector &radial_in_q, - ModuleBase::ComplexMatrix& trial_orbitals_k -) -{ - const int npw = wfcpw->npwk[ik]; - const int npwx = wfcpw->npwk_max; - - trial_orbitals_k.create(num_wannier, npwx); - - const int total_lm = 16; - ModuleBase::matrix ylm(total_lm, npw); - - ModuleBase::Vector3 *gk = new ModuleBase::Vector3[npw]; - for (int ig = 0; ig < npw; ig++) - { - gk[ig] = wfcpw->getgpluskcar(ik, ig); - } - - ModuleBase::YlmReal::Ylm_Real(total_lm, npw, gk, ylm); - - // Keep it consistent with the definition of spherical harmonic functions in Wannier90 - std::vector need_inv = {2, 3, 5, 6, 14, 15}; - for (auto index : need_inv) - { - for (int ig = 0; ig < npw; ig++) - { - ylm(index, ig) = -1.0 * ylm(index, ig); - } - } - - double bs2, bs3, bs6, bs12; - bs2 = 1.0 / sqrt(2.0); - bs3 = 1.0 / sqrt(3.0); - bs6 = 1.0 / sqrt(6.0); - bs12 = 1.0 / sqrt(12.0); - - std::complex *sf = new std::complex[npw]; - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - if (L[wannier_index] >= 0) - { - get_trial_orbitals_lm_k(L[wannier_index], m[wannier_index], ylm, gk, npw, radial_in_q[wannier_index].c, trial_orbitals_k.c + wannier_index*npwx); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * trial_orbitals_k(wannier_index, ig); - } - - } - else - { - if (L[wannier_index] == -1) - { - double tmp_bs2 = 0; - if (m[wannier_index] == 0) tmp_bs2 = bs2; - if (m[wannier_index] == 1) tmp_bs2 = -bs2; - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs2 * orb_s[ig] + tmp_bs2 * orb_px[ig]); - } - - delete[] orb_s; - delete[] orb_px; - } - - if (L[wannier_index] == -2) - { - if (m[wannier_index] == 0 || m[wannier_index] == 1) - { - double tmp_bs2 = bs2; - if (m[wannier_index] == 1) tmp_bs2 = -bs2; - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - std::complex *orb_py = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - get_trial_orbitals_lm_k(1, 2, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_py); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs3 * orb_s[ig] - bs6 * orb_px[ig] + tmp_bs2 * orb_py[ig]); - } - - delete[] orb_s; - delete[] orb_px; - delete[] orb_py; - } - else if (m[wannier_index] == 2) - { - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs3 * orb_s[ig] + 2.0 * bs6 * orb_px[ig]); - } - - delete[] orb_s; - delete[] orb_px; - } - } - - if (L[wannier_index] == -3) - { - double m_px = 1.0; - double m_py = 1.0; - double m_pz = 1.0; - - if (m[wannier_index] == 1) - { - m_py = -1.0; - m_pz = -1.0; - } - else if (m[wannier_index] == 2) - { - m_px = -1.0; - m_pz = -1.0; - } - else if (m[wannier_index] == 3) - { - m_px = -1.0; - m_py = -1.0; - } - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - std::complex *orb_py = new std::complex[npw]; - std::complex *orb_pz = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - get_trial_orbitals_lm_k(1, 2, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_py); - get_trial_orbitals_lm_k(1, 0, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_pz); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * 0.5 * (orb_s[ig] + m_px * orb_px[ig] + m_py * orb_py[ig] + m_pz * orb_pz[ig]); - } - - delete[] orb_s; - delete[] orb_px; - delete[] orb_py; - delete[] orb_pz; - } - - if (L[wannier_index] == -4) - { - if (m[wannier_index] == 0 || m[wannier_index] == 1) - { - double tmp_bs2 = bs2; - if (m[wannier_index] == 1) tmp_bs2 = -bs2; - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - std::complex *orb_py = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - get_trial_orbitals_lm_k(1, 2, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_py); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs3 * orb_s[ig] - bs6 * orb_px[ig] + tmp_bs2 * orb_py[ig]); - } - - delete[] orb_s; - delete[] orb_px; - delete[] orb_py; - } - else if (m[wannier_index] == 2) - { - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs3 * orb_s[ig] + 2.0 * bs6 * orb_px[ig]); - } - - delete[] orb_s; - delete[] orb_px; - } - else if (m[wannier_index] == 3 || m[wannier_index] == 4) - { - double m_pz = 1.0; - if (m[wannier_index] == 4) m_pz = -1.0; - - std::complex *orb_pz = new std::complex[npw]; - std::complex *orb_dz2 = new std::complex[npw]; - - get_trial_orbitals_lm_k(1, 0, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_pz); - get_trial_orbitals_lm_k(2, 0, ylm, gk, npw, radial_in_q[wannier_index].c+2*PARAM.globalv.nqx, orb_dz2); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * bs2 * (m_pz * orb_pz[ig] + orb_dz2[ig]); - } - - delete[] orb_pz; - delete[] orb_dz2; - } - } - - if (L[wannier_index] == -5) - { - if (m[wannier_index] == 0 || m[wannier_index] == 1) - { - double tmp_bs2 = -bs2; - double tmp_bs12 = -bs12; - double tmp_d = 0.5; - - if (m[wannier_index] == 1) - { - tmp_bs2 = bs2; - } - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_px = new std::complex[npw]; - std::complex *orb_dz2 = new std::complex[npw]; - std::complex *orb_dx2_y2 = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 1, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_px); - get_trial_orbitals_lm_k(2, 0, ylm, gk, npw, radial_in_q[wannier_index].c+2*PARAM.globalv.nqx, orb_dz2); - get_trial_orbitals_lm_k(2, 3, ylm, gk, npw, radial_in_q[wannier_index].c+2*PARAM.globalv.nqx, orb_dx2_y2); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs6 * orb_s[ig] + tmp_bs2 * orb_px[ig] + tmp_bs12 * orb_dz2[ig] + tmp_d * orb_dx2_y2[ig]); - } - - delete[] orb_s; - delete[] orb_px; - delete[] orb_dz2; - delete[] orb_dx2_y2; - } - else if (m[wannier_index] == 2 || m[wannier_index] == 3) - { - double tmp_bs2 = -bs2; - double tmp_bs12 = -bs12; - double tmp_d = -0.5; - - if (m[wannier_index] == 3) - { - tmp_bs2 = bs2; - } - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_py = new std::complex[npw]; - std::complex *orb_dz2 = new std::complex[npw]; - std::complex *orb_dx2_y2 = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 2, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_py); - get_trial_orbitals_lm_k(2, 0, ylm, gk, npw, radial_in_q[wannier_index].c+2*PARAM.globalv.nqx, orb_dz2); - get_trial_orbitals_lm_k(2, 3, ylm, gk, npw, radial_in_q[wannier_index].c+2*PARAM.globalv.nqx, orb_dx2_y2); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs6 * orb_s[ig] + tmp_bs2 * orb_py[ig] + tmp_bs12 * orb_dz2[ig] + tmp_d * orb_dx2_y2[ig]); - } - - delete[] orb_s; - delete[] orb_py; - delete[] orb_dz2; - delete[] orb_dx2_y2; - } - else if (m[wannier_index] == 4 || m[wannier_index] == 5) - { - double tmp_pz = -1.0; - - if (m[wannier_index] == 5) tmp_pz = 1.0; - - std::complex *orb_s = new std::complex[npw]; - std::complex *orb_pz = new std::complex[npw]; - std::complex *orb_dz2 = new std::complex[npw]; - - get_trial_orbitals_lm_k(0, 0, ylm, gk, npw, radial_in_q[wannier_index].c, orb_s); - get_trial_orbitals_lm_k(1, 0, ylm, gk, npw, radial_in_q[wannier_index].c+PARAM.globalv.nqx, orb_pz); - get_trial_orbitals_lm_k(2, 0, ylm, gk, npw, radial_in_q[wannier_index].c+2*PARAM.globalv.nqx, orb_dz2); - - for (int ig = 0; ig < npw; ig++) - { - const double arg = (gk[ig] * R_centre[wannier_index]) * ModuleBase::TWO_PI; - sf[ig] = std::complex(cos(arg), -sin(arg)); - - trial_orbitals_k(wannier_index, ig) = sf[ig] * (bs6 * orb_s[ig] + tmp_pz * bs2 * orb_pz[ig] + bs3 * orb_dz2[ig]); - } - - delete[] orb_s; - delete[] orb_pz; - delete[] orb_dz2; - } - } - - } - } - - for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++) - { - std::complex anorm(0.0, 0.0); - for (int ig = 0; ig < npw; ig++) - { - anorm += conj(trial_orbitals_k(wannier_index, ig)) * trial_orbitals_k(wannier_index, ig); - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(anorm); -#endif - for (int ig = 0; ig < npw; ig++) - { - trial_orbitals_k(wannier_index, ig) = trial_orbitals_k(wannier_index, ig) / sqrt(anorm); - } - } - - delete[] gk; - delete[] sf; -} - -void toWannier90_PW::get_trial_orbitals_lm_k( - const int &orbital_L, - const int &orbital_m, - const ModuleBase::matrix &ylm, - const ModuleBase::Vector3 *gk, - const int &npw, - double *radial_in_q_single, - std::complex *orbital_in_G_single -) -{ - const double tpiba = *this->tpiba; - for (int ig = 0; ig < npw; ig++) - { - orbital_in_G_single[ig] = ModuleBase::PolyInt::Polynomial_Interpolation(radial_in_q_single, PARAM.globalv.nqx, PARAM.globalv.dq, gk[ig].norm() * tpiba); - } - - std::complex lphase = pow(ModuleBase::NEG_IMAG_UNIT, orbital_L); - int index = orbital_L * orbital_L + orbital_m; - for (int ig = 0; ig < npw; ig++) - { - orbital_in_G_single[ig] = lphase * ylm(index, ig) * orbital_in_G_single[ig]; - } - - return; -} - -void toWannier90_PW::integral( - const int meshr, - const double *psir, - const double *r, - const double *rab, - const int &l, - double *table -) -{ - const double pref = ModuleBase::FOUR_PI / sqrt(*this->omega); - - double *inner_part = new double[meshr]; - for (int ir = 0; ir < meshr; ir++) - { - inner_part[ir] = psir[ir] * psir[ir]; - } - - double unit = 0.0; - ModuleBase::Integral::Simpson_Integral(meshr, inner_part, rab, unit); - delete[] inner_part; - - double *aux = new double[meshr]; - double *vchi = new double[meshr]; - for (int iq = 0; iq < PARAM.globalv.nqx; iq++) - { - const double q = PARAM.globalv.dq * iq; - ModuleBase::Sphbes::Spherical_Bessel(meshr, r, q, l, aux); - for (int ir = 0; ir < meshr; ir++) - { - vchi[ir] = psir[ir] * aux[ir] * r[ir]; - } - - double vqint = 0.0; - ModuleBase::Integral::Simpson_Integral(meshr, vchi, rab, vqint); - - table[iq] = vqint * pref; - } - delete[] aux; - delete[] vchi; - return; -} - -void toWannier90_PW::unkdotW_A( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw, - const int& ik, - const std::vector &radial_in_q, - ModuleBase::ComplexMatrix &Amn -) -{ - Amn.create(num_bands, num_wannier); - - int npw = wfcpw->npwk[ik]; - int npwx = wfcpw->npwk_max; - ModuleBase::ComplexMatrix trial_orbitals; - produce_trial_in_pw(psi_pw, ik, wfcpw, radial_in_q, trial_orbitals); - - for (int iw = 0; iw < num_wannier; iw++) - { - for (int ib_w = 0; ib_w < num_bands; ib_w++) - { - int ib = cal_band_index[ib_w]; - - if (PARAM.inp.nspin != 4) - { - for (int ig = 0; ig < npw; ig++) - { - Amn(ib_w, iw) += conj(psi_pw(ik, ib, ig)) * trial_orbitals(iw, ig); - } - } - else - { - for (int ig = 0; ig < npw; ig++) - { - Amn(ib_w, iw) += up_con[iw] * conj(psi_pw(ik, ib, ig)) * trial_orbitals(iw, ig) - + dn_con[iw] * conj(psi_pw(ik, ib, ig+npwx)) * trial_orbitals(iw, ig); - } - } - } - } - -#ifdef __MPI - Parallel_Reduce::reduce_all(Amn.c, Amn.size); -#endif - -} diff --git a/source/module_io/to_wannier90_pw.h b/source/module_io/to_wannier90_pw.h deleted file mode 100644 index 3d3f8f07b7..0000000000 --- a/source/module_io/to_wannier90_pw.h +++ /dev/null @@ -1,121 +0,0 @@ -#ifndef TOWannier90_PW_H -#define TOWannier90_PW_H - -#include -#include -#include -#include -#include - -#include "to_wannier90.h" - -#include "source_base/complexmatrix.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/lapack_connector.h" -#include "source_base/matrix.h" -#include "source_base/matrix3.h" -#include "source_cell/klist.h" -#include "module_hamilt_lcao/hamilt_lcaodft/wavefunc_in_pw.h" -#include "source_psi/psi.h" - -class toWannier90_PW : public toWannier90 -{ - public: - toWannier90_PW( - const bool &out_wannier_mmn, - const bool &out_wannier_amn, - const bool &out_wannier_unk, - const bool &out_wannier_eig, - const bool &out_wannier_wvfn_formatted, - const std::string &nnkpfile, - const std::string &wannier_spin - ); - ~toWannier90_PW(); - - void calculate( - const UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw, - const K_Vectors& kv, - const psi::Psi>* psi - ); - - void calculate( - const UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw, - const K_Vectors& kv, - const psi::Psi* psi - ) - { - throw std::logic_error("The wave function of toWannier90_PW is generally a std::complex type."); - } - - void cal_Amn(const psi::Psi>& psi_pw, const ModulePW::PW_Basis_K* wfcpw); - void cal_Mmn(const psi::Psi>& psi_pw, const ModulePW::PW_Basis_K* wfcpw); - void out_unk( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw, - const ModulePW::PW_Basis_Big* bigpw - ); - void set_tpiba_omega(const double& tpiba, const double& omega); - protected: - // Radial section of trial orbitals - const int mesh_r = 333; - const double dx = 0.025; - const double x_min = -6.0; - double const *tpiba; - double const *omega; - - void unkdotkb( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw, - const int& ik, - const int& ikb, - const ModuleBase::Vector3 G, - ModuleBase::ComplexMatrix &Mmn - ); - - void gen_radial_function_in_q(std::vector &radial_in_q); - - void integral( - const int meshr, - const double *psir, - const double *r, - const double *rab, - const int &l, - double *table - ); - - void produce_trial_in_pw( - const psi::Psi>& psi_pw, - const int& ik, - const ModulePW::PW_Basis_K* wfcpw, - const std::vector &radial_in_q, - ModuleBase::ComplexMatrix& trial_orbitals_k - ); - - void get_trial_orbitals_lm_k( - const int &orbital_L, - const int &orbital_m, - const ModuleBase::matrix &ylm, - const ModuleBase::Vector3 *gk, - const int &npw, - double *radial_in_q_single, - std::complex *orbital_in_G_single - ); - - void unkdotW_A( - const psi::Psi>& psi_pw, - const ModulePW::PW_Basis_K* wfcpw, - const int& ik, - const std::vector &radial_in_q, - ModuleBase::ComplexMatrix &Amn - ); - -}; - -#endif diff --git a/source/module_io/unk_overlap_lcao.cpp b/source/module_io/unk_overlap_lcao.cpp deleted file mode 100644 index b8ed9a417e..0000000000 --- a/source/module_io/unk_overlap_lcao.cpp +++ /dev/null @@ -1,657 +0,0 @@ -#include "unk_overlap_lcao.h" - -#include "module_parameter/parameter.h" -#include "ctime" -#include "source_base/scalapack_connector.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" - -unkOverlap_lcao::unkOverlap_lcao() -{ - allocate_flag = false; -} - -unkOverlap_lcao::~unkOverlap_lcao() -{ - if (allocate_flag) - { - for (int iw = 0; iw < PARAM.globalv.nlocal; iw++) - { - delete [] cal_tag[iw]; - } - delete [] cal_tag; - } - -} - -void unkOverlap_lcao::init(const UnitCell& ucell, - const Grid_Technique& gt, - const int nkstot, - const LCAO_Orbitals& orb) -{ - - int Lmax_used = 0; - int Lmax = 0; - int exx_lmax = 0; -#ifdef __EXX - exx_lmax = GlobalC::exx_info.info_ri.abfs_Lmax; -#endif - - const int ntype = orb.get_ntype(); - int lmax_orb = -1, lmax_beta = -1; - for (int it = 0; it < ntype; it++) - { - lmax_orb = std::max(lmax_orb, orb.Phi[it].getLmax()); - lmax_beta = std::max(lmax_beta, ucell.infoNL.Beta[it].getLmax()); - } - const double dr = orb.get_dR(); - const double dk = orb.get_dk(); - const int kmesh = orb.get_kmesh() * 4 + 1; - int Rmesh = static_cast(orb.get_Rmax() / dr) + 4; - Rmesh += 1 - Rmesh % 2; - - Center2_Orb::init_Table_Spherical_Bessel(2, - 3, - Lmax_used, - Lmax, - exx_lmax, - lmax_orb, - lmax_beta, - dr, - dk, - kmesh, - Rmesh, - psb_); - - ModuleBase::Ylm::set_coefficients(); - - MGT.init_Gaunt_CH(Lmax); - MGT.init_Gaunt(Lmax); - - const int T = 0; // any selected element type - orb_r.set_orbital_info(orb.Phi[T].PhiLN(0, 0).getLabel(), // atom label - T, // atom type - 1, // angular momentum L - 1, // number of orbitals of this L , just N - orb.Phi[T].PhiLN(0, 0).getNr(), // number of radial mesh - orb.Phi[T].PhiLN(0, 0).getRab(), // the mesh interval in radial mesh - orb.Phi[T].PhiLN(0, 0).getRadial(), // radial mesh value(a.u.) - Numerical_Orbital_Lm::Psi_Type::Psi, - orb.Phi[T].PhiLN(0, 0).getRadial(), // radial wave function - orb.Phi[T].PhiLN(0, 0).getNk(), - orb.Phi[T].PhiLN(0, 0).getDk(), - orb.Phi[T].PhiLN(0, 0).getDruniform(), - false, - true, - PARAM.inp.cal_force); - - // array initialization - allocate_flag = true; - this->kpoints_number = nkstot; - if (allocate_flag) - { - cal_tag = new int*[PARAM.globalv.nlocal]; - for (int iw = 0; iw < PARAM.globalv.nlocal; iw++) - { - cal_tag[iw] = new int[PARAM.globalv.nlocal]; - ModuleBase::GlobalFunc::ZEROS(cal_tag[iw], PARAM.globalv.nlocal); - } - } - -#ifdef __MPI - // parallel scheme - int nproc=0; - int myrank=0; - MPI_Comm_size(MPI_COMM_WORLD, &nproc); - MPI_Comm_rank(MPI_COMM_WORLD, &myrank); - const int total_term = PARAM.globalv.nlocal * PARAM.globalv.nlocal; - const int remain = total_term % nproc; - int local_term = total_term / nproc; - if (myrank < remain) - { - local_term++; - } - int start; - for (int rank = 0; rank < nproc; rank++) - { - if (rank == myrank) - { - if (myrank < remain) - { - start = myrank * local_term; - } - else - { - start = myrank * local_term + remain; - } - } - } -#else - int start = 0; - int local_term = PARAM.globalv.nlocal * PARAM.globalv.nlocal; -#endif - int count = -1; - for (int iw1 = 0; iw1 < PARAM.globalv.nlocal; iw1++) - { - for (int iw2 = 0; iw2 < PARAM.globalv.nlocal; iw2++) - { - count++; - if (count >= start && count < (start + local_term)) - { - cal_tag[iw1][iw2] = 1; - } - } - } - - for (int TA = 0; TA < ucell.ntype; TA++) - { - for (int TB = 0; TB < ucell.ntype; TB++) - { - for (int LA = 0; LA <= orb.Phi[TA].getLmax(); LA++) - { - for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) - { - for (int LB = 0; LB <= orb.Phi[TB].getLmax(); ++LB) - { - for (int NB = 0; NB < orb.Phi[TB].getNchi(LB); ++NB) - { - center2_orb11[TA][TB][LA][NA][LB].insert( - std::make_pair(NB, - Center2_Orb::Orb11(orb.Phi[TA].PhiLN(LA, NA), - orb.Phi[TB].PhiLN(LB, NB), - psb_, - MGT))); - } - } - } - } - } - } - - for (int TA = 0; TA < ucell.ntype; TA++) - { - for (int TB = 0; TB < ucell.ntype; TB++) - { - for (int LA = 0; LA <= orb.Phi[TA].getLmax(); LA++) - { - for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) - { - for (int LB = 0; LB <= orb.Phi[TB].getLmax(); ++LB) - { - for (int NB = 0; NB < orb.Phi[TB].getNchi(LB); ++NB) - { - center2_orb21_r[TA][TB][LA][NA][LB].insert( - std::make_pair(NB, - Center2_Orb::Orb21(orb.Phi[TA].PhiLN(LA, NA), - orb_r, - orb.Phi[TB].PhiLN(LB, NB), - psb_, - MGT))); - } - } - } - } - } - } - - for (auto& co1: center2_orb11) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - for (auto& co4: co3.second) - { - for (auto& co5: co4.second) - { - for (auto& co6: co5.second) - { - co6.second.init_radial_table(); - } - } - } - } - } - } - - for (auto& co1: center2_orb21_r) - { - for (auto& co2: co1.second) - { - for (auto& co3: co2.second) - { - for (auto& co4: co3.second) - { - for (auto& co5: co4.second) - { - for (auto& co6: co5.second) - { - co6.second.init_radial_table(); - } - } - } - } - } - } - - rcut_orb_.resize(orb.get_ntype()); - for (int it = 0; it < orb.get_ntype(); ++it) - { - rcut_orb_[it] = orb.Phi[it].getRcut(); - } - - return; -} - -int unkOverlap_lcao::iw2it(const UnitCell& ucell, int iw) -{ - int ic = 0; - int type = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int L = 0; L < ucell.atoms[it].nwl + 1; L++) - { - for (int N = 0; N < ucell.atoms[it].l_nchi[L]; N++) - { - for (int i = 0; i < (2 * L + 1); i++) - { - if (ic == iw) - { - type = it; - } - ic++; - } - } - } - } - } - return type; -} - -int unkOverlap_lcao::iw2ia(const UnitCell& ucell,int iw) -{ - int ic = 0; - int na = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int L = 0; L < ucell.atoms[it].nwl + 1; L++) - { - for (int N = 0; N < ucell.atoms[it].l_nchi[L]; N++) - { - for (int i = 0; i < (2 * L + 1); i++) - { - if (ic == iw) - { - na = ia; - } - ic++; - } - } - } - } - } - return na; -} - -int unkOverlap_lcao::iw2iL(const UnitCell& ucell, int iw) -{ - int ic = 0; - int iL = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int L = 0; L < ucell.atoms[it].nwl + 1; L++) - { - for (int N = 0; N < ucell.atoms[it].l_nchi[L]; N++) - { - for (int i = 0; i < (2 * L + 1); i++) - { - if (ic == iw) - { - iL = L; - } - ic++; - } - } - } - } - } - return iL; -} - -int unkOverlap_lcao::iw2iN(const UnitCell& ucell,int iw) -{ - int ic, iN; - ic = 0; - iN = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int L = 0; L < ucell.atoms[it].nwl + 1; L++) - { - for (int N = 0; N < ucell.atoms[it].l_nchi[L]; N++) - { - for (int i = 0; i < (2 * L + 1); i++) - { - if (ic == iw) - { - iN = N; - } - ic++; - } - } - } - } - } - return iN; -} - -int unkOverlap_lcao::iw2im(const UnitCell& ucell, int iw) -{ - int ic = 0; - int im = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - for (int L = 0; L < ucell.atoms[it].nwl + 1; L++) - { - for (int N = 0; N < ucell.atoms[it].l_nchi[L]; N++) - { - for (int i = 0; i < (2 * L + 1); i++) - { - if (ic == iw) - { - im = i; - } - ic++; - } - } - } - } - } - return im; -} - -// search for the nearest neighbor atoms -void unkOverlap_lcao::cal_R_number(const UnitCell& ucell, const Grid_Driver& gd) -{ - // The number of overlaps between atomic orbitals 1 and atomic orbitals 2, - // or the number of R, is empty when there is no overlap - orb1_orb2_R.resize(PARAM.globalv.nlocal); - for (int iw = 0; iw < PARAM.globalv.nlocal; iw++) - { - orb1_orb2_R[iw].resize(PARAM.globalv.nlocal); - } - - ModuleBase::Vector3 tau1, tau2, dtau; - for (int T1 = 0; T1 < ucell.ntype; ++T1) - { - Atom* atom1 = &ucell.atoms[T1]; - for (int I1 = 0; I1 < atom1->na; ++I1) - { - tau1 = atom1->tau[I1]; - gd.Find_atom(ucell, tau1, T1, I1); - - for (int ad = 0; ad < gd.getAdjacentNum() + 1; ++ad) - { - const int T2 = gd.getType(ad); - const int I2 = gd.getNatom(ad); - Atom* atom2 = &ucell.atoms[T2]; - const double R_direct_x = (double)gd.getBox(ad).x; - const double R_direct_y = (double)gd.getBox(ad).y; - const double R_direct_z = (double)gd.getBox(ad).z; - - tau2 = gd.getAdjacentTau(ad); - dtau = tau2 - tau1; - double distance = dtau.norm() * ucell.lat0; - double rcut = rcut_orb_[T1] + rcut_orb_[T2]; - if (distance < rcut - 1.0e-15) - { - // translate: the unit of R_car is ucell.lat0 - ModuleBase::Vector3 R_car = R_direct_x * ucell.a1 + R_direct_y * ucell.a2 - + R_direct_z * ucell.a3; - - for (int iw1 = 0; iw1 < atom1->nw; iw1++) - { - int orb_index_in_NLOCAL_1 = ucell.itiaiw2iwt(T1, I1, iw1); - for (int iw2 = 0; iw2 < atom2->nw; iw2++) - { - int orb_index_in_NLOCAL_2 = ucell.itiaiw2iwt(T2, I2, iw2); - orb1_orb2_R[orb_index_in_NLOCAL_1][orb_index_in_NLOCAL_2].push_back(R_car); - } // end iw2 - - } // end iw1 - } - - } // end ad - - } // end I1 - - } // end T1 - - return; -} - -void unkOverlap_lcao::cal_orb_overlap(const UnitCell& ucell) -{ - // std::cout << "the cal_orb_overlap is start" << std::endl; - psi_psi.resize(PARAM.globalv.nlocal); - psi_r_psi.resize(PARAM.globalv.nlocal); - for (int iw = 0; iw < PARAM.globalv.nlocal; iw++) - { - psi_psi[iw].resize(PARAM.globalv.nlocal); - psi_r_psi[iw].resize(PARAM.globalv.nlocal); - } - - ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); - - for (int iw1 = 0; iw1 < PARAM.globalv.nlocal; iw1++) - { - for (int iw2 = 0; iw2 < PARAM.globalv.nlocal; iw2++) - { - // if ( !pv.in_this_processor(iw1,iw2) ) continue; - - // iw1 and iw2 never have overlap - if (orb1_orb2_R[iw1][iw2].empty()) - { - continue; - } - - int atomType1 = iw2it(ucell,iw1); - int ia1 = iw2ia(ucell,iw1); - int N1 = iw2iN(ucell,iw1); - int L1 = iw2iL(ucell,iw1); - int m1 = iw2im(ucell,iw1); - int atomType2 = iw2it(ucell,iw2); - int ia2 = iw2ia(ucell,iw2); - int N2 = iw2iN(ucell,iw2); - int L2 = iw2iL(ucell,iw2); - int m2 = iw2im(ucell,iw2); - - for (int iR = 0; iR < orb1_orb2_R[iw1][iw2].size(); iR++) - { - ModuleBase::Vector3 r_distance - = (ucell.atoms[atomType2].tau[ia2] - ucell.atoms[atomType1].tau[ia1] - + orb1_orb2_R[iw1][iw2][iR]) - * ucell.lat0; - psi_psi[iw1][iw2].push_back( - center2_orb11[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap(origin_point, - r_distance, - m1, - m2)); - - double overlap_x = -1 * sqrt(ModuleBase::FOUR_PI / 3.0) - * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap(origin_point, - r_distance, - m1, - 1, - m2); // m = 1 - double overlap_y = -1 * sqrt(ModuleBase::FOUR_PI / 3.0) - * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap(origin_point, - r_distance, - m1, - 2, - m2); // m = -1 - double overlap_z = sqrt(ModuleBase::FOUR_PI / 3.0) - * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap(origin_point, - r_distance, - m1, - 0, - m2); // m =0 - ModuleBase::Vector3 overlap(overlap_x, overlap_y, overlap_z); - - psi_r_psi[iw1][iw2].push_back(overlap); - } - } - } - - return; -} - -void unkOverlap_lcao::prepare_midmatrix_pblas(const UnitCell& ucell, - const int ik_L, - const int ik_R, - const ModuleBase::Vector3 dk, - std::complex*& midmatrix, - const Parallel_Orbitals& pv, - const K_Vectors& kv) -{ - assert(pv.nloc>0); - - midmatrix = new std::complex[pv.nloc]; - ModuleBase::GlobalFunc::ZEROS(midmatrix, pv.nloc); - for (int iw_row = 0; iw_row < PARAM.globalv.nlocal; iw_row++) // global - { - for (int iw_col = 0; iw_col < PARAM.globalv.nlocal; iw_col++) // global - { - int ir = pv.global2local_row(iw_row); // local - int ic = pv.global2local_col(iw_col); // local - - if (ir >= 0 && ic >= 0) - { - int index = ic * pv.nrow + ir; - ModuleBase::Vector3 tau1 = ucell.atoms[iw2it(ucell,iw_row)].tau[iw2ia(ucell,iw_row)]; - for (int iR = 0; iR < orb1_orb2_R[iw_row][iw_col].size(); iR++) - { - double kRn = (kv.kvec_c[ik_R] * orb1_orb2_R[iw_row][iw_col][iR] - dk * tau1) * ModuleBase::TWO_PI; - std::complex kRn_phase(cos(kRn), sin(kRn)); - std::complex orb_overlap(psi_psi[iw_row][iw_col][iR], - (-dk * ucell.tpiba * psi_r_psi[iw_row][iw_col][iR])); - midmatrix[index] = midmatrix[index] + kRn_phase * orb_overlap; - } - } - } - } -} - -std::complex unkOverlap_lcao::det_berryphase(const UnitCell& ucell, - const int ik_L, - const int ik_R, - const ModuleBase::Vector3 dk, - const int occ_bands, - const Parallel_Orbitals& para_orb, - const psi::Psi>* psi_in, - const K_Vectors& kv) -{ - const std::complex minus = std::complex(-1.0, 0.0); - std::complex det = std::complex(1.0, 0.0); - std::complex* midmatrix = nullptr; - std::complex* C_matrix = new std::complex[para_orb.nloc]; - std::complex* out_matrix = new std::complex[para_orb.nloc]; - ModuleBase::GlobalFunc::ZEROS(C_matrix, para_orb.nloc); - ModuleBase::GlobalFunc::ZEROS(out_matrix, para_orb.nloc); - - this->prepare_midmatrix_pblas(ucell,ik_L, ik_R, dk, midmatrix, para_orb, kv); - - char transa = 'C'; - char transb = 'N'; - int occBands = occ_bands; - int nlocal = PARAM.globalv.nlocal; - std::complex alpha = {1.0, 0.0}, beta = {0.0, 0.0}; - int one = 1; -#ifdef __MPI - pzgemm_(&transa, - &transb, - &occBands, - &nlocal, - &nlocal, - &alpha, - &psi_in[0](ik_L, 0, 0), - &one, - &one, - para_orb.desc, - midmatrix, - &one, - &one, - para_orb.desc, - &beta, - C_matrix, - &one, - &one, - para_orb.desc); - - pzgemm_(&transb, - &transb, - &occBands, - &occBands, - &nlocal, - &alpha, - C_matrix, - &one, - &one, - para_orb.desc, - &psi_in[0](ik_R, 0, 0), - &one, - &one, - para_orb.desc, - &beta, - out_matrix, - &one, - &one, - para_orb.desc); - - assert(para_orb.nrow>0); - - int* ipiv = new int[para_orb.nrow]; - int info = 0; - pzgetrf_(&occBands, &occBands, out_matrix, &one, &one, para_orb.desc, ipiv, &info); - - for (int i = 0; i < occBands; i++) // global - { - int ir = para_orb.global2local_row(i); // local - int ic = para_orb.global2local_col(i); // local - if (ir >= 0 && ic >= 0) - { - int index = ic * para_orb.nrow + ir; - if (ipiv[ir] != (i + 1)) - { - det = minus * det * out_matrix[index]; - } - else - { - det = det * out_matrix[index]; - } - } - } - delete[] ipiv; -#endif - delete[] midmatrix; - delete[] C_matrix; - delete[] out_matrix; - -#ifdef __MPI - // note: the mpi uses MPI_COMMON_WORLD,so you must make the GlobalV::KPAR = 1. - std::complex result; - MPI_Allreduce(&det, &result, 1, MPI_DOUBLE_COMPLEX, MPI_PROD, DIAG_WORLD); - return result; -#endif - - return det; -} diff --git a/source/module_io/unk_overlap_lcao.h b/source/module_io/unk_overlap_lcao.h deleted file mode 100644 index f3600a1295..0000000000 --- a/source/module_io/unk_overlap_lcao.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef UNKOVERLAP_LCAO -#define UNKOVERLAP_LCAO - -#include "source_base/sph_bessel_recursive.h" -#include "source_base/vector3.h" -#include "source_base/ylm.h" -#include "source_basis/module_ao/ORB_atomic_lm.h" -#include "source_basis/module_ao/ORB_gaunt_table.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/klist.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb.h" -#include "module_hamilt_lcao/module_gint/grid_technique.h" - -#include -#include -#include - -class unkOverlap_lcao -{ - public: - ModuleBase::Sph_Bessel_Recursive::D2* psb_ = nullptr; - ORB_gaunt_table MGT; - Numerical_Orbital_Lm orb_r; // New r vector, exists in atomic orbital form, expanded in solid spherical function - - std::vector>>> orb1_orb2_R; - std::vector>> psi_psi; - std::vector>>> psi_r_psi; - bool allocate_flag; // translate: Used to initialize the array - int** cal_tag=nullptr; // Used for parallel scheme - - int kpoints_number=0; - - std::vector rcut_orb_; // real space cutoffs of LCAO orbitals' radial functions - - std::map< - size_t, - std::map>>>>> - center2_orb11; - - std::map< - size_t, - std::map>>>>> - center2_orb21_r; - - unkOverlap_lcao(); - ~unkOverlap_lcao(); - - void init(const UnitCell& ucell, const Grid_Technique& gt, const int nkstot, const LCAO_Orbitals& orb); - int iw2it(const UnitCell& ucell, int iw); - int iw2ia(const UnitCell& ucell, int iw); - int iw2iL(const UnitCell& ucell, int iw); - int iw2iN(const UnitCell& ucell, int iw); - int iw2im(const UnitCell& ucell, int iw); - void cal_R_number(const UnitCell& ucell, const Grid_Driver& gd); - void cal_orb_overlap(const UnitCell& ucell); - void prepare_midmatrix_pblas(const UnitCell& ucell, - const int ik_L, - const int ik_R, - const ModuleBase::Vector3 dk, - std::complex*& midmatrix, - const Parallel_Orbitals& pv, - const K_Vectors& kv); - std::complex det_berryphase(const UnitCell& ucell, - const int ik_L, - const int ik_R, - const ModuleBase::Vector3 dk, - const int occ_bands, - const Parallel_Orbitals& para_orb, - const psi::Psi>* psi_in, - const K_Vectors& kv); -}; - -#endif diff --git a/source/module_io/unk_overlap_pw.cpp b/source/module_io/unk_overlap_pw.cpp deleted file mode 100644 index db61be105b..0000000000 --- a/source/module_io/unk_overlap_pw.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include "unk_overlap_pw.h" - -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -unkOverlap_pw::unkOverlap_pw() -{ -} - -unkOverlap_pw::~unkOverlap_pw() -{ -} - -std::complex unkOverlap_pw::unkdotp_G(const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const psi::Psi>* evc) -{ - - std::complex result(0.0, 0.0); - const int number_pw = wfcpw->npw; - std::complex* unk_L = new std::complex[number_pw]; - std::complex* unk_R = new std::complex[number_pw]; - ModuleBase::GlobalFunc::ZEROS(unk_L, number_pw); - ModuleBase::GlobalFunc::ZEROS(unk_R, number_pw); - - for (int igl = 0; igl < evc->get_ngk(ik_L); igl++) - { - unk_L[wfcpw->getigl2ig(ik_L, igl)] = evc[0](ik_L, iband_L, igl); - } - - for (int igl = 0; igl < evc->get_ngk(ik_R); igl++) - { - unk_R[wfcpw->getigl2ig(ik_R, igl)] = evc[0](ik_R, iband_R, igl); - } - - for (int iG = 0; iG < number_pw; iG++) - { - - result = result + conj(unk_L[iG]) * unk_R[iG]; - } - -#ifdef __MPI - // note: the mpi uses MPI_COMMON_WORLD,so you must make the GlobalV::KPAR = 1. - double in_date_real = result.real(); - double in_date_imag = result.imag(); - double out_date_real = 0.0; - double out_date_imag = 0.0; - MPI_Allreduce(&in_date_real, &out_date_real, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - MPI_Allreduce(&in_date_imag, &out_date_imag, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - result = std::complex(out_date_real, out_date_imag); -#endif - - delete[] unk_L; - delete[] unk_R; - return result; -} - -std::complex unkOverlap_pw::unkdotp_G0(const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const psi::Psi>* evc, - const ModuleBase::Vector3 G) -{ - // (1) set value - std::complex result(0.0, 0.0); - std::complex* psi_r = new std::complex[wfcpw->nmaxgr]; - std::complex* phase = new std::complex[rhopw->nmaxgr]; - - // get the phase value in realspace - for (int ig = 0; ig < rhopw->npw; ig++) - { - ModuleBase::Vector3 delta_G = rhopw->gdirect[ig] - G; - if (delta_G.norm2() < 1e-10) // rhopw->gdirect[ig] == G - { - phase[ig] = std::complex(1.0, 0.0); - break; - } - } - - // (2) fft and get value - rhopw->recip2real(phase, phase); - wfcpw->recip2real(&evc[0](ik_L, iband_L, 0), psi_r, ik_L); - - for (int ir = 0; ir < rhopw->nrxx; ir++) - { - psi_r[ir] = psi_r[ir] * phase[ir]; - } - - // (3) calculate the overlap in ik_L and ik_R - wfcpw->real2recip(psi_r, psi_r, ik_R); - - for (int ig = 0; ig < evc->get_ngk(ik_R); ig++) - { - result = result + conj(psi_r[ig]) * evc[0](ik_R, iband_R, ig); - } - -#ifdef __MPI - // note: the mpi uses MPI_COMMON_WORLD,so you must make the GlobalV::KPAR = 1. - double in_date_real = result.real(); - double in_date_imag = result.imag(); - double out_date_real = 0.0; - double out_date_imag = 0.0; - MPI_Allreduce(&in_date_real, &out_date_real, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - MPI_Allreduce(&in_date_imag, &out_date_imag, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - result = std::complex(out_date_real, out_date_imag); -#endif - - delete[] psi_r; - delete[] phase; - return result; -} - -// if noncollinear = 1 or PARAM.inp.nspin = 4 , you need this routine to calculate overlap unk -std::complex unkOverlap_pw::unkdotp_soc_G(const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const int npwx, - const psi::Psi>* evc) -{ - - std::complex result(0.0, 0.0); - const int number_pw = wfcpw->npw; - std::complex* unk_L = new std::complex[number_pw * PARAM.globalv.npol]; - std::complex* unk_R = new std::complex[number_pw * PARAM.globalv.npol]; - ModuleBase::GlobalFunc::ZEROS(unk_L, number_pw * PARAM.globalv.npol); - ModuleBase::GlobalFunc::ZEROS(unk_R, number_pw * PARAM.globalv.npol); - - for (int i = 0; i < PARAM.globalv.npol; i++) - { - for (int igl = 0; igl < evc->get_ngk(ik_L); igl++) - { - unk_L[wfcpw->getigl2ig(ik_L, igl) + i * number_pw] = evc[0](ik_L, iband_L, igl + i * npwx); - } - - for (int igl = 0; igl < evc->get_ngk(ik_R); igl++) - { - unk_R[wfcpw->getigl2ig(ik_L, igl) + i * number_pw] = evc[0](ik_R, iband_R, igl + i * npwx); - } - } - - for (int iG = 0; iG < number_pw * PARAM.globalv.npol; iG++) - { - - result = result + conj(unk_L[iG]) * unk_R[iG]; - } - -#ifdef __MPI - // note: the mpi uses MPI_COMMON_WORLD,so you must make the GlobalV::KPAR = 1. - double in_date_real = result.real(); - double in_date_imag = result.imag(); - double out_date_real = 0.0; - double out_date_imag = 0.0; - MPI_Allreduce(&in_date_real, &out_date_real, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - MPI_Allreduce(&in_date_imag, &out_date_imag, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - result = std::complex(out_date_real, out_date_imag); -#endif - - delete[] unk_L; - delete[] unk_R; - return result; -} - -// here G is in direct coordinate -std::complex unkOverlap_pw::unkdotp_soc_G0(const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const psi::Psi>* evc, - const ModuleBase::Vector3 G) -{ - // (1) set value - std::complex result(0.0, 0.0); - std::complex* phase = new std::complex[rhopw->nmaxgr]; - std::complex* psi_up = new std::complex[wfcpw->nmaxgr]; - std::complex* psi_down = new std::complex[wfcpw->nmaxgr]; - const int npwx = wfcpw->npwk_max; - - // get the phase value in realspace - for (int ig = 0; ig < rhopw->npw; ig++) - { - if (rhopw->gdirect[ig] == G) - { - phase[ig] = std::complex(1.0, 0.0); - break; - } - } - - // (2) fft and get value - rhopw->recip2real(phase, phase); - wfcpw->recip2real(&evc[0](ik_L, iband_L, 0), psi_up, ik_L); - wfcpw->recip2real(&evc[0](ik_L, iband_L, npwx), psi_down, ik_L); - - for (int ir = 0; ir < wfcpw->nrxx; ir++) - { - psi_up[ir] = psi_up[ir] * phase[ir]; - psi_down[ir] = psi_down[ir] * phase[ir]; - } - - // (3) calculate the overlap in ik_L and ik_R - wfcpw->real2recip(psi_up, psi_up, ik_L); - wfcpw->real2recip(psi_down, psi_down, ik_L); - - for (int i = 0; i < PARAM.globalv.npol; i++) - { - for (int ig = 0; ig < evc->get_ngk(ik_R); ig++) - { - if (i == 0) - { - result = result + conj(psi_up[ig]) * evc[0](ik_R, iband_R, ig); - } - if (i == 1) - { - result = result + conj(psi_down[ig]) * evc[0](ik_R, iband_R, ig + npwx); - } - } - } - -#ifdef __MPI - // note: the mpi uses MPI_COMMON_WORLD,so you must make the GlobalV::KPAR = 1. - double in_date_real = result.real(); - double in_date_imag = result.imag(); - double out_date_real = 0.0; - double out_date_imag = 0.0; - MPI_Allreduce(&in_date_real, &out_date_real, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - MPI_Allreduce(&in_date_imag, &out_date_imag, 1, MPI_DOUBLE, MPI_SUM, POOL_WORLD); - result = std::complex(out_date_real, out_date_imag); -#endif - - delete[] psi_up; - delete[] psi_down; - return result; -} diff --git a/source/module_io/unk_overlap_pw.h b/source/module_io/unk_overlap_pw.h deleted file mode 100644 index d781159706..0000000000 --- a/source/module_io/unk_overlap_pw.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef UNKOVERLAP_PW -#define UNKOVERLAP_PW - -#include -#include -#include -#include - -#include "source_base/complexmatrix.h" -#include "source_base/global_variable.h" -#include "source_base/lapack_connector.h" -#include "source_base/parallel_reduce.h" -#include "source_base/vector3.h" -#include "source_basis/module_pw/pw_basis.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_psi/psi.h" - -class unkOverlap_pw -{ - public: - unkOverlap_pw(); - ~unkOverlap_pw(); - std::complex unkdotp_G(const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const psi::Psi>* evc); - std::complex unkdotp_G0(const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const psi::Psi>* evc, - const ModuleBase::Vector3 G); - std::complex unkdotp_soc_G(const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const int npwx, - const psi::Psi>* evc); - std::complex unkdotp_soc_G0(const ModulePW::PW_Basis* rhopw, - const ModulePW::PW_Basis_K* wfcpw, - const int ik_L, - const int ik_R, - const int iband_L, - const int iband_R, - const psi::Psi>* evc, - const ModuleBase::Vector3 G); - - // this function just for test the class unkOverlap_pw that is works successful. - void test_for_unkOverlap_pw(); - - // std::complex unkdotp_R(int ik_L, int ik_R, int iband_L, int iband_R, ModuleBase::ComplexMatrix *evc); - // std::complex g00(int ik_R, int ik_L, int ib_L, int ib_R, double x, double y, double z, - // ModuleBase::ComplexMatrix *evc); -}; - -#endif diff --git a/source/module_io/winput.cpp b/source/module_io/winput.cpp deleted file mode 100644 index 52cbecef81..0000000000 --- a/source/module_io/winput.cpp +++ /dev/null @@ -1,770 +0,0 @@ -#include "winput.h" - -#ifdef __MPI -#include "mpi.h" -#endif - -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#include -#include - -std::string winput::target; // add 2008-06-04 -std::string winput::wlmr_dir; -double winput::rcut; // a.u. -bool winput::before_iter; //"1" stop before iteration -bool winput::after_iter; -bool winput::begin_stop_flag; -bool winput::end_flag; -std::string winput::wf_type; -bool winput::build_wf; -int winput::imp_pao = 0; -bool winput::b_out_wf; -bool winput::b_fftwan; // add 2008-07-20 -bool winput::b_plot_build; // add 2008-06-04 -bool winput::b_plot_atomic; // add 2008-06-04 -std::string winput::trial; //"atomic" or "gauss" -double winput::bs; // parameters for gauss orbit -double winput::bp; -double winput::px; -double winput::g1; -double winput::g2; -double winput::trunc_ao; -double winput::trunc_wlmr; -double winput::trunc_wan; -double winput::fermi_t; -double winput::clm2_lowest; -int winput::bloch_begin; -int winput::bloch_end; -int winput::sph_proj; //"1" spherical project,"2": first minus atomic orbitals -bool winput::sph_type; // 0:Rewrite 1:Skip -bool winput::b_recon; //"1" reconstruction of wannier function -bool winput::b_mix_wf; // add 2008-06-15 -double winput::mix_wf; // add 2008-06-13 -bool winput::recon_wanq; -bool winput::speed_mode; -bool winput::b_near_atom; -double winput::range0; -double winput::range1; -int winput::L_start; -int winput::L_end; -int winput::atom_start; -int winput::atom_end; -bool winput::plot_wanq; // add 2008-01-26 -std::string winput::plot_option; //(110),[110] etc. -int winput::n_unitcell; // number of unitcell to plot -bool winput::out_all; -int winput::out_chg; -std::string winput::charge_type; -bool winput::cal_bands; // for wan wan basis + wan charge -bool winput::cal_bands2; // for semi-wan ;pw basis + wan charge add 2008-4-11 -bool winput::cal_dos; -int winput::mesh; -double winput::dr; - -bool winput::no_center; -int winput::sum_lm; -bool winput::compare_atomic; -int winput::out_spillage; -std::string winput::spillage_outdir = "./"; // mohan add 2010-06-07 - -winput::winput() -{ -} - -winput::~winput() -{ -} - -void winput::Init(const std::string& fn) -{ - Default(); - //========================================== - // First readin and check value in root cpu - // and then bcast value - //========================================== - Read(fn); - Check(); - -#ifdef __MPI - Bcast(); -#endif - return; -} - -void winput::Read(const std::string& fn) -{ - ModuleBase::TITLE("winput", "Read"); - - if (GlobalV::MY_RANK != 0) - { - return; - } - - std::ifstream ifs(fn.c_str(), std::ios::in); - if (!ifs) - { - return; - } - else - { - GlobalV::ofs_running << "Open file : " << fn << std::endl; - } - - ifs.clear(); - ifs.seekg(0); - - char word[80]; - int ierr = 0; - ifs.rdstate(); - - while (ifs.good()) - { - ifs >> word; - ifs.ignore(75, '\n'); - - if (std::strcmp(word, "WANNIER_PARAMETERS") == 0) - { - ierr = 1; - break; - } - - ifs.rdstate(); - } - - if (ierr == 0) - { - ModuleBase::WARNING("winput::Read", "error parameteters title, should be WANNIER_PARAMETERS"); - } - - ifs.rdstate(); - - while (ifs.good()) - { - ifs >> word; - for (auto& i: word) - { - i = tolower(i); - } - // parameters for users - - if (strcmp("target", word) == 0) - { - read_value(ifs, target); - } - else if (strcmp("trial", word) == 0) - { - read_value(ifs, trial); - } - - else if (strcmp("near_atom", word) == 0) - { - read_value(ifs, b_near_atom); - } - else if (strcmp("range0", word) == 0) - { - read_value(ifs, range0); - } - else if (strcmp("range1", word) == 0) - { - read_value(ifs, range1); - } - - else if (strcmp("wlmr_dir", word) == 0) - { - read_value(ifs, wlmr_dir); - } - else if (strcmp("no_center", word) == 0) - { - read_value(ifs, no_center); - } - else if (strcmp("sph_proj", word) == 0) - { - read_value(ifs, sph_proj); - } - else if (strcmp("sph_type", word) == 0) - { - read_value(ifs, sph_type); - } - else if (strcmp("b_recon", word) == 0) - { - read_value(ifs, b_recon); - } - else if (strcmp("speed_mode", word) == 0) - { - read_value(ifs, speed_mode); - } - else if (strcmp("recon_wanq", word) == 0) - { - read_value(ifs, recon_wanq); - } - else if (strcmp("b_mix_wf", word) == 0) - { - read_value(ifs, b_mix_wf); - } - else if (strcmp("b_near_atom", word) == 0) - { - read_value(ifs, b_near_atom); - } - else if (strcmp("mix_wf", word) == 0) - { - read_value(ifs, mix_wf); - } - - else if (strcmp("wf_type", word) == 0) - { - read_value(ifs, wf_type); - } - else if (strcmp("build_wf", word) == 0) - { - read_value(ifs, build_wf); - } - else if (strcmp("imp_pao", word) == 0) - { - read_value(ifs, imp_pao); - } - else if (strcmp("b_out_wf", word) == 0) - { - read_value(ifs, b_out_wf); - } - else if (strcmp("b_plot_build", word) == 0) - { - read_value(ifs, b_plot_build); - } - else if (strcmp("b_plot_atomic", word) == 0) - { - read_value(ifs, b_plot_atomic); - } - else if (strcmp("plot_option", word) == 0) - { - read_value(ifs, plot_option); - } - else if (strcmp("n_unitcell", word) == 0) - { - read_value(ifs, n_unitcell); - } - - else if (strcmp("l_start", word) == 0) - { - read_value(ifs, L_start); - } - else if (strcmp("l_end", word) == 0) - { - read_value(ifs, L_end); - } - else if (strcmp("atom_start", word) == 0) - { - read_value(ifs, atom_start); - } - else if (strcmp("atom_end", word) == 0) - { - read_value(ifs, atom_end); - } - - else if (strcmp("trunc_ao", word) == 0) - { - read_value(ifs, trunc_ao); - } - else if (strcmp("trunc_wlmr", word) == 0) - { - read_value(ifs, trunc_wlmr); - } - else if (strcmp("trunc_wan", word) == 0) - { - read_value(ifs, trunc_wan); - } - else if (strcmp("fermi_t", word) == 0) - { - read_value(ifs, fermi_t); - } - else if (strcmp("clm2_lowest", word) == 0) - { - read_value(ifs, clm2_lowest); - } - else if (strcmp("rcut", word) == 0) - { - read_value(ifs, rcut); - } - - else if (strcmp("plotflag", word) == 0) - { - read_value(ifs, plot_option); - } - else if (strcmp("unit", word) == 0) - { - read_value(ifs, n_unitcell); - } - - else if (strcmp("bs", word) == 0) - { - read_value(ifs, bs); - } - else if (strcmp("bp", word) == 0) - { - read_value(ifs, bp); - } - else if (strcmp("px", word) == 0) - { - read_value(ifs, px); - } - else if (strcmp("g1", word) == 0) - { - read_value(ifs, g1); - } - else if (strcmp("g2", word) == 0) - { - read_value(ifs, g2); - } - - else if (strcmp("before_iter", word) == 0) - { - read_value(ifs, before_iter); - } - else if (strcmp("after_iter", word) == 0) - { - read_value(ifs, after_iter); - } - - else if (strcmp("begin_stop_flag", word) == 0) - { - read_value(ifs, begin_stop_flag); - } - else if (strcmp("end_flag", word) == 0) - { - read_value(ifs, end_flag); - } - - else if (strcmp("out_all", word) == 0) - { - read_value(ifs, out_all); - } - else if (strcmp("out_chg", word) == 0) - { - read_value(ifs, out_chg); - } - else if (strcmp("charge_type", word) == 0) - { - read_value(ifs, charge_type); - } - else if (strcmp("compare_atomic", word) == 0) - { - read_value(ifs, compare_atomic); - } - // add 2008-1-26 - else if (strcmp("plot_wanq", word) == 0) - { - read_value(ifs, plot_wanq); - } - - // add 2008-3-10 - else if (strcmp("cal_bands", word) == 0) - { - read_value(ifs, cal_bands); - } - else if (strcmp("cal_bands2", word) == 0) - { - read_value(ifs, cal_bands2); - } - else if (strcmp("chgtype", word) == 0) - { - read_value(ifs, charge_type); - } - else if (strcmp("cal_dos", word) == 0) - { - read_value(ifs, cal_dos); - } - else if (strcmp("sum_lm", word) == 0) - { - read_value(ifs, sum_lm); - } - - // add 2008-3-17 - else if (strcmp("bloch_begin", word) == 0) - { - read_value(ifs, bloch_begin); - } - else if (strcmp("bloch_end", word) == 0) - { - read_value(ifs, bloch_end); - } - - else if (strcmp("mesh", word) == 0) - { - read_value(ifs, mesh); - } - else if (strcmp("dr", word) == 0) - { - read_value(ifs, dr); - } - - // add 2008-07-20 - else if (strcmp("b_fftwan", word) == 0) - { - read_value(ifs, b_fftwan); - } - // add 2009-04-19 - else if (strcmp("out_spillage", word) == 0) - { - read_value(ifs, out_spillage); - } - // add 2010-06-07 - else if (strcmp("spillage_outdir", word) == 0) - { - read_value(ifs, spillage_outdir); - } - else - { - if (word[0] != '#' && word[0] != '/') - { - std::cout << " The parameter name '" << word << "' is not used." << std::endl; - } - ifs.ignore(150, '\n'); - } - - ifs.rdstate(); - - if (ifs.eof() != 0) - { - break; - } - else if (ifs.bad() != 0) - { - std::cout << "bad parameter. " << std::endl; - break; - } - else if (ifs.fail() != 0) - { - std::cout << " bad parameter. " << std::endl; - break; - } - else if (ifs.good() == 0) - { - break; - } - } -} - -void winput::Default() -{ - //======================== - // part1 : control - //======================== - target = "test"; - wlmr_dir = "./"; - rcut = 10; - before_iter = false; - after_iter = false; - begin_stop_flag = false; - end_flag = false; - - //======================= - // part2 : Build wf - //======================= - wf_type = "V"; - build_wf = false; - imp_pao = 0; - b_out_wf = false; - b_fftwan = false; - b_plot_build = false; - b_plot_atomic = false; - //========================= - // part2.1 select trial wf - //========================= - trial = "atomic"; // atomic || gauss - bs = 2.5; // - bp = 2.0; // gausss para,eters - px = 2.0; // - g1 = 3.0; // D orbital center - g2 = 3.0; // D orbital center - //======================= - // part2.2 select bands - //======================= - bloch_begin = 0; - bloch_end = 0; - - //======================== - // part3: spheri & recon - //======================== - no_center = false; - sph_proj = 0; - sph_type = false; // Rewrite mode - b_recon = false; - speed_mode = true; - recon_wanq = false; - b_mix_wf = false; - mix_wf = 0; - //=============================== - // part2.1: multi-center shperi - //=============================== - b_near_atom = false; - range0 = 0; - range1 = 0; - //========================== - // part2.2: select L,atom - //========================== - L_start = 0; - L_end = 2; - atom_start = 0; - atom_end = 1; - //======================= - // part2.3: truncation - //======================= - trunc_ao = 6; - trunc_wlmr = 14; - trunc_wan = 6; - fermi_t = 1; - clm2_lowest = 10e-8; - - //============================== - // part3 : Plot wavefunction - //============================== - plot_wanq = false; // add 2008-1-26 - plot_option = "(110)"; - n_unitcell = 2; - - //=============================== - // part4 : out_all || out_charge - //=============================== - out_all = false; - out_chg = 0; - compare_atomic = false; - - //======================================= - // part5 : other functions: bands & dos - //======================================= - // add 2008-3-10 - cal_bands = false; - cal_bands2 = false; - charge_type = "planewave"; - cal_dos = false; - - out_spillage = 0; - spillage_outdir = "./"; - - // add 2008-3-17 - //========================================= - // part6 : Uniform mesh ,but not used now - //========================================= - mesh = 999; - dr = 0.01; - - return; -} - -void winput::Check() -{ - if (GlobalV::MY_RANK != 0) - return; - - if (PARAM.inp.calculation == "nscf") - { - if (out_chg) - { - out_chg = false; - ModuleBase::GlobalFunc::AUTO_SET("winput::out_chg", out_chg); - } - } - //===================== - // calculate sum_lm - //===================== - for (int il = L_start; il <= L_end; il++) - { - sum_lm += il * 2 + 1; - } - - if (out_chg == true || cal_bands == true || out_all == true || cal_bands2 == true || cal_dos == true) - { - end_flag = true; - } - - if (b_plot_build == true || b_plot_atomic == true) - { - if (b_plot_build == true && b_plot_atomic == true) - { - ModuleBase::WARNING_QUIT("winput::Check()", "Plot atomic or plot build wannier functions?"); - } - else - { - b_fftwan = true; - ModuleBase::GlobalFunc::AUTO_SET("b_fftwan", b_fftwan); - } - } - - return; -} - -void winput::Print(const std::string& fn) -{ - if (GlobalV::MY_RANK != 0) - { - return; - } - - std::ofstream ofs(fn.c_str()); - ofs << std::setiosflags(std::ios::left); - ofs << "WANNIER_PARAMETERS" << std::endl; - - ofs << "#Parameters (General)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "target", target); - ModuleBase::GlobalFunc::OUTP(ofs, "wlmr_dir", wlmr_dir); - ModuleBase::GlobalFunc::OUTP(ofs, "rcut", rcut); - ModuleBase::GlobalFunc::OUTP(ofs, "before_iter", before_iter); - ModuleBase::GlobalFunc::OUTP(ofs, "after_iter", after_iter); - ModuleBase::GlobalFunc::OUTP(ofs, "begin_stop_flag", begin_stop_flag); - ModuleBase::GlobalFunc::OUTP(ofs, "end_flag", end_flag); - - ofs << "#Parameters (Build Wannier Functions)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "wf_type", wf_type); - ModuleBase::GlobalFunc::OUTP(ofs, "build_wf", build_wf); - ModuleBase::GlobalFunc::OUTP(ofs, "imp_pao", imp_pao); - ModuleBase::GlobalFunc::OUTP(ofs, "b_out_wf", b_out_wf); - ModuleBase::GlobalFunc::OUTP(ofs, "b_fftwan", b_fftwan); - ModuleBase::GlobalFunc::OUTP(ofs, "b_plot_build", b_plot_build); - ModuleBase::GlobalFunc::OUTP(ofs, "b_plot_atomic", b_plot_atomic); - - ofs << "#Parameters (Select trial wave functions)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "trial", trial); - ModuleBase::GlobalFunc::OUTP(ofs, "bs", bs); - ModuleBase::GlobalFunc::OUTP(ofs, "bp", bp); - ModuleBase::GlobalFunc::OUTP(ofs, "px", px); - ModuleBase::GlobalFunc::OUTP(ofs, "g1", g1); - ModuleBase::GlobalFunc::OUTP(ofs, "g2", g2); - - ofs << "#Parameters (Select bands)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "bloch_begin", bloch_begin); - ModuleBase::GlobalFunc::OUTP(ofs, "bloch_end", bloch_end); - - ofs << "#Parameters (Spheri & recon)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "no_center", no_center); - ModuleBase::GlobalFunc::OUTP(ofs, "sph_proj", sph_proj); - ModuleBase::GlobalFunc::OUTP(ofs, "sph_type", sph_type); - ModuleBase::GlobalFunc::OUTP(ofs, "b_recon", b_recon); - ModuleBase::GlobalFunc::OUTP(ofs, "speed_mode", speed_mode); - ModuleBase::GlobalFunc::OUTP(ofs, "recon_wanq", recon_wanq); - ModuleBase::GlobalFunc::OUTP(ofs, "b_mix_wf", b_mix_wf); - ModuleBase::GlobalFunc::OUTP(ofs, "mix_wf", mix_wf); - - ofs << "#Parameters (Multi-center spheri)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "b_near_atom", b_near_atom); - ModuleBase::GlobalFunc::OUTP(ofs, "range0", range0); - ModuleBase::GlobalFunc::OUTP(ofs, "range1", range1); - - ofs << "#Parameters (Select L, atom)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "L_start", L_start); - ModuleBase::GlobalFunc::OUTP(ofs, "L_end", L_end); - ModuleBase::GlobalFunc::OUTP(ofs, "atom_start", atom_start); - ModuleBase::GlobalFunc::OUTP(ofs, "atom_end", atom_end); - - ofs << "#Parameters (Truncation)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "trunc_ao", trunc_ao); - ModuleBase::GlobalFunc::OUTP(ofs, "trunc_wlmr", trunc_wlmr); - ModuleBase::GlobalFunc::OUTP(ofs, "trunc_wan", trunc_wan); - ModuleBase::GlobalFunc::OUTP(ofs, "fermi_t", fermi_t); - ModuleBase::GlobalFunc::OUTP(ofs, "clm2_lowest", clm2_lowest); - - ofs << "#Parameters (Plot wave functions)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "plot_wanq", plot_wanq); - ModuleBase::GlobalFunc::OUTP(ofs, "plot_option", plot_option); - ModuleBase::GlobalFunc::OUTP(ofs, "n_unitcell", n_unitcell); - - ofs << "#Parameters (out_all || out_chg)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "out_all", out_all); - ModuleBase::GlobalFunc::OUTP(ofs, "out_chg", out_chg); - ModuleBase::GlobalFunc::OUTP(ofs, "compare_atomic", compare_atomic); - - ofs << "#Parameters (Other functions: bands & dos)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "cal_bands", cal_bands); - ModuleBase::GlobalFunc::OUTP(ofs, "cal_bands2", cal_bands2); - ModuleBase::GlobalFunc::OUTP(ofs, "charge_type", charge_type); - ModuleBase::GlobalFunc::OUTP(ofs, "cal_dos", cal_dos); - ModuleBase::GlobalFunc::OUTP(ofs, "out_spillage", out_spillage); - ModuleBase::GlobalFunc::OUTP(ofs, "spillage_outdir", spillage_outdir); - - ofs << "#Parameters (Uniform mesh)" << std::endl; - ModuleBase::GlobalFunc::OUTP(ofs, "mesh", mesh); - ModuleBase::GlobalFunc::OUTP(ofs, "dr", dr); - - ModuleBase::GlobalFunc::OUTP(ofs, "sum_lm", sum_lm); - - ofs.close(); - return; -} - -#include "source_base/parallel_common.h" -#ifdef __MPI -void winput::Bcast() -{ - Parallel_Common::bcast_string(target); - Parallel_Common::bcast_bool(before_iter); - Parallel_Common::bcast_bool(after_iter); - Parallel_Common::bcast_bool(begin_stop_flag); - Parallel_Common::bcast_bool(end_flag); - - Parallel_Common::bcast_double(rcut); - Parallel_Common::bcast_double(trunc_ao); - Parallel_Common::bcast_double(trunc_wlmr); - Parallel_Common::bcast_double(trunc_wan); - - Parallel_Common::bcast_string(wlmr_dir); - Parallel_Common::bcast_string(wf_type); - Parallel_Common::bcast_bool(build_wf); - Parallel_Common::bcast_int(imp_pao); - Parallel_Common::bcast_bool(b_out_wf); - Parallel_Common::bcast_bool(b_fftwan); - Parallel_Common::bcast_bool(b_plot_build); - Parallel_Common::bcast_bool(b_plot_atomic); - - Parallel_Common::bcast_string(trial); - Parallel_Common::bcast_double(bs); - Parallel_Common::bcast_double(bp); - Parallel_Common::bcast_double(px); - Parallel_Common::bcast_double(g1); - Parallel_Common::bcast_double(g2); - - Parallel_Common::bcast_int(bloch_begin); - Parallel_Common::bcast_int(bloch_end); - Parallel_Common::bcast_double(fermi_t); - Parallel_Common::bcast_double(clm2_lowest); - - Parallel_Common::bcast_int(sph_proj); - Parallel_Common::bcast_bool(sph_type); - - Parallel_Common::bcast_bool(b_recon); - Parallel_Common::bcast_bool(b_mix_wf); - Parallel_Common::bcast_double(mix_wf); - Parallel_Common::bcast_bool(recon_wanq); - - Parallel_Common::bcast_bool(speed_mode); - - Parallel_Common::bcast_bool(b_near_atom); - Parallel_Common::bcast_double(range0); - Parallel_Common::bcast_double(range1); - - Parallel_Common::bcast_int(L_start); - Parallel_Common::bcast_int(L_end); - Parallel_Common::bcast_int(atom_start); - Parallel_Common::bcast_int(atom_end); - - Parallel_Common::bcast_bool(plot_wanq); - Parallel_Common::bcast_string(plot_option); - Parallel_Common::bcast_int(n_unitcell); - Parallel_Common::bcast_bool(out_all); - Parallel_Common::bcast_int(out_chg); - - Parallel_Common::bcast_string(charge_type); - Parallel_Common::bcast_bool(cal_bands); - Parallel_Common::bcast_bool(cal_bands2); - Parallel_Common::bcast_bool(cal_dos); - Parallel_Common::bcast_int(mesh); - Parallel_Common::bcast_double(dr); - - Parallel_Common::bcast_int(out_spillage); - Parallel_Common::bcast_string(spillage_outdir); - - Parallel_Common::bcast_bool(no_center); - Parallel_Common::bcast_int(sum_lm); - Parallel_Common::bcast_bool(compare_atomic); - - return; -} -#endif diff --git a/source/module_io/winput.h b/source/module_io/winput.h deleted file mode 100644 index 232edc113d..0000000000 --- a/source/module_io/winput.h +++ /dev/null @@ -1,153 +0,0 @@ -//========================================================== -// AUTHOR : mohan -// DATE : 2008-11-08 -// Last Update: 2010-06-07 -//========================================================== -#ifndef WINPUT_H -#define WINPUT_H - -#include -#include - -//========================================================== -// CLASS : -// NAME : winput -// ( Readin wannier parameters. -// Check wannier parameters. -// Print wannier parameters ) -//========================================================== -class winput -{ -public: - - winput(); - ~winput(); - -//========================================================== -// MEMBER FUNCTIONS : -// NAME : target( no use now) -// NAME : before_iter ( call wannier::runnning ) -// NAME : after_iter ( call wannier::running ) -// NAME : begin_stop_flag ( only use readin information , -// stop at the very beginning ). -// NAME : end_flag ( output data, etc. ) -//========================================================== - static std::string target; - static bool before_iter; - static bool after_iter; - static bool begin_stop_flag; - static bool end_flag; - -//========================================================== -// MEMBER FUNCTIONS : -// NAME : rcut( PAO cutoff ) -// NAME : trunc_ao ( PAO cutoff ) -// NAME : trunc_wlmr ( 1D Radial wave function cutoff ) -// NAME : trunc_wan ( 3D wannier function cutoff ) -//========================================================== - static double rcut; - static double trunc_ao; - static double trunc_wlmr; - static double trunc_wan; - -//========================================================== -// MEMBER FUNCTIONS : -// NAME : wlmr_dir( if reconstruction , this is wlmr adress) -// NAME : wf_type ( type of wannier functions) -// NAME : build_wf -// NAME : imp_pao -// NAME : b_out_wf -// NAME : b_fftwan -// NAME : b_plot_build -// NAME : b_plot_atomic -//========================================================== - static std::string wlmr_dir; - static std::string wf_type; - static bool build_wf; - static int imp_pao; - static bool b_out_wf; - static bool b_fftwan;//add 2008-07-20 - static bool b_plot_build;//add 2008-06-04 - static bool b_plot_atomic;//add 2008-06-04 - -//========================================================== -// MEMBER FUNCTIONS : -// NAME : trial ( trial wave functions , "atomic" or "gauss") -// NAME : bs(parameters for gauss orbit) -// NAME : bp -// NAME : px -// NAME : g1 -// NAME : g2 -//========================================================== - static std::string trial;//"atomic" or "gauss" - static double bs;//parameters for gauss orbit - static double bp; - static double px; - static double g1; - static double g2; - - static int bloch_begin; - static int bloch_end; - - static double fermi_t; - static double clm2_lowest; - - static int sph_proj;//"1" spherical project,"2": first minus atomic orbitals - static bool sph_type;//0:Rewrite 1:Skip - - static bool b_recon;//"1" reconstruction of wannier function - static bool b_mix_wf;// add 2008-06-15 - static double mix_wf;//add 2008-06-13 - static bool recon_wanq; - - static bool speed_mode; - - static bool b_near_atom; - static double range0; - static double range1; - - static int L_start; - static int L_end; - static int atom_start; - static int atom_end; - - static bool plot_wanq;//add 2008-01-26 - static std::string plot_option;//(110),[110] etc. - static int n_unitcell;//number of unitcell to plot - static bool out_all; - static int out_chg; - static std::string charge_type; - static bool cal_bands; //for wan wan basis + wan charge - static bool cal_bands2;//for semi-wan ;pw basis + wan charge add 2008-4-11 - static bool cal_dos; - static int mesh; - static double dr; - - static bool no_center; - static int sum_lm; - static bool compare_atomic; - - static int out_spillage; // output spillage file. - static std::string spillage_outdir; - - static void Init(const std::string &fn); - static void Print(const std::string &fn); -private: - - template - static void read_value(std::ifstream &ifs, T &var) - { - ifs >> var; - ifs.ignore(75, '\n'); - return; - } - - static void Read(const std::string &fn); - static void Default(); - static void Check(void); -#ifdef __MPI - static void Bcast(); -#endif -}; - -#endif diff --git a/source/module_io/write_HS.h b/source/module_io/write_HS.h deleted file mode 100644 index dae3f8ef11..0000000000 --- a/source/module_io/write_HS.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef WRITE_HS_H -#define WRITE_HS_H - -#include -#include - -//#include "source_base/global_function.h" -//#include "source_base/global_variable.h" -#include "source_basis/module_ao/parallel_orbitals.h" // use Parallel_Orbitals - - -// mohan add this file 2010-09-10 -namespace ModuleIO -{ - template - void write_hsk( - const std::string &global_out_dir, - const int nspin, - const int nks, - const int nkstot, - const std::vector &ik2iktot, - const std::vector &isk, - hamilt::Hamilt* p_hamilt, - const Parallel_Orbitals &pv, - const bool gamma_only, - const bool out_app_flag, - const int istep, - std::ofstream &ofs_running); - - /// @brief save a square matrix, such as H(k) and S(k) - /// @param[in] istep : the step of the calculation - /// @param[in] mat : the local matrix - /// @param[in] bit : true for binary, false for decimal - /// @param[in] tri : true for upper triangle, false for full matrix - /// @param[in] app : true for append, false for overwrite - /// @param[in] file_name : the name of the output file - /// @param[in] pv : the 2d-block parallelization information - /// @param[in] drank : the rank of the current process - template - 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_2D& pv, - const int drank, - const bool reduce = true); - -} -#include "write_HS.hpp" -#endif diff --git a/source/module_io/write_HS.hpp b/source/module_io/write_HS.hpp deleted file mode 100644 index de6e7934a0..0000000000 --- a/source/module_io/write_HS.hpp +++ /dev/null @@ -1,285 +0,0 @@ -#include "write_HS.h" - -#include "module_parameter/parameter.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_io/filename.h" // use filename_output function - - -template -void ModuleIO::write_hsk( - const std::string &global_out_dir, - const int nspin, - const int nks, - const int nkstot, - const std::vector &ik2iktot, - const std::vector &isk, - hamilt::Hamilt* p_hamilt, - const Parallel_Orbitals &pv, - const bool gamma_only, - const bool out_app_flag, - const int istep, - std::ofstream &ofs_running) -{ - - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - ">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << " | " - " |" << std::endl; - ofs_running << " | Write Hamiltonian matrix H(k) or overlap matrix S(k) in numerical |" << std::endl; - ofs_running << " | atomic orbitals at each k-point. |" << std::endl; - ofs_running << " | " - " |" << std::endl; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - ">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - ofs_running << "\n WRITE H(k) OR S(k)" << std::endl; - - for (int ik = 0; ik < nks; ++ik) - { - p_hamilt->updateHk(ik); - bool bit = false; // LiuXh, 2017-03-21 - // if set bit = true, there would be error in soc-multi-core - // calculation, noted by zhengdy-soc - - hamilt::MatrixBlock h_mat; - hamilt::MatrixBlock s_mat; - - p_hamilt->matrix(h_mat, s_mat); - - const int out_label=1; // 1: .txt, 2: .dat - - std::string h_fn = ModuleIO::filename_output(global_out_dir, - "hk","nao",ik,ik2iktot,nspin,nkstot, - out_label,out_app_flag,gamma_only,istep); - - ModuleIO::save_mat(istep, - h_mat.p, - PARAM.globalv.nlocal, - bit, - PARAM.inp.out_mat_hs[1], - 1, - out_app_flag, - h_fn, - pv, - GlobalV::DRANK); - - // mohan note 2025-06-02 - // for overlap matrix, the two spin channels yield the same matrix - // so we only need to print matrix from one spin channel. - const int current_spin = isk[ik]; - if(current_spin == 1) - { - continue; - } - - std::string s_fn = ModuleIO::filename_output(global_out_dir, - "sk","nao",ik,ik2iktot,nspin,nkstot, - out_label,out_app_flag,gamma_only,istep); - - ofs_running << " The output filename is " << s_fn << std::endl; - - ModuleIO::save_mat(istep, - s_mat.p, - PARAM.globalv.nlocal, - bit, - PARAM.inp.out_mat_hs[1], - 1, - out_app_flag, - s_fn, - pv, - GlobalV::DRANK); - } // end ik -} - - -// output a square matrix -template -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& filename, - const Parallel_2D& pv, - const int drank, - const bool reduce) -{ - ModuleBase::TITLE("ModuleIO", "save_mat"); - ModuleBase::timer::tick("ModuleIO", "save_mat"); - - // print out .dat file - if (bit) - { -#ifdef __MPI - FILE* g = nullptr; - - if (drank == 0) - { - g = fopen(filename.c_str(), "wb"); - fwrite(&dim, sizeof(int), 1, g); - } - - int ir=0; - int ic=0; - for (int i = 0; i < dim; ++i) - { - T* line = new T[tri ? dim - i : dim]; - ModuleBase::GlobalFunc::ZEROS(line, tri ? dim - i : dim); - - ir = pv.global2local_row(i); - if (ir >= 0) - { - // data collection - for (int j = (tri ? i : 0); j < dim; ++j) - { - ic = pv.global2local_col(j); - if (ic >= 0) - { - int iic; - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - line[tri ? j - i : j] = mat[iic]; - } - } - } - - if (reduce) - { - Parallel_Reduce::reduce_all(line, tri ? dim - i : dim); - } - - if (drank == 0) - { - for (int j = (tri ? i : 0); j < dim; ++j) - { - fwrite(&line[tri ? j - i : j], sizeof(T), 1, g); - } - } - delete[] line; - - MPI_Barrier(DIAG_WORLD); - } - - if (drank == 0) - { - fclose(g); - } -#else - FILE* g = fopen(filename.c_str(), "wb"); - - fwrite(&dim, sizeof(int), 1, g); - - for (int i = 0; i < dim; i++) - { - for (int j = (tri ? i : 0); j < dim; j++) - { - fwrite(&mat[i * dim + j], sizeof(T), 1, g); - } - } - fclose(g); -#endif - } // end .dat file - else // .txt file - { - std::ofstream g; - g << std::setprecision(precision); -#ifdef __MPI - if (drank == 0) - { - if (app && istep > 0) - { - g.open(filename.c_str(), std::ofstream::app); - } - else - { - g.open(filename.c_str()); - } - g << dim; - } - - int ir=0; - int ic=0; - for (int i = 0; i < dim; i++) - { - T* line = new T[tri ? dim - i : dim]; - ModuleBase::GlobalFunc::ZEROS(line, tri ? dim - i : dim); - - ir = pv.global2local_row(i); - if (ir >= 0) - { - // data collection - for (int j = (tri ? i : 0); j < dim; ++j) - { - ic = pv.global2local_col(j); - if (ic >= 0) - { - int iic; - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - iic = ir + ic * pv.nrow; - } - else - { - iic = ir * pv.ncol + ic; - } - line[tri ? j - i : j] = mat[iic]; - } - } - } - - if (reduce) - { - Parallel_Reduce::reduce_all(line, tri ? dim - i : dim); - } - - if (drank == 0) - { - for (int j = (tri ? i : 0); j < dim; j++) - { - g << " " << line[tri ? j - i : j]; - } - g << std::endl; - } - delete[] line; - } - - if (drank == 0) - { // Peize Lin delete ; at 2020.01.31 - g.close(); - } -#else - if (app) - { - std::ofstream g(filename.c_str(), std::ofstream::app); - } - else - { - std::ofstream g(filename.c_str()); - } - - g << dim; - g << std::setprecision(precision); - for (int i = 0; i < dim; i++) - { - for (int j = (tri ? i : 0); j < dim; j++) - { - g << " " << mat[i * dim + j]; - } - g << std::endl; - } - g.close(); -#endif - } - ModuleBase::timer::tick("ModuleIO", "save_mat"); - return; -} diff --git a/source/module_io/write_HS_R.cpp b/source/module_io/write_HS_R.cpp deleted file mode 100644 index e2540dca40..0000000000 --- a/source/module_io/write_HS_R.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "write_HS_R.h" - -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_dh.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_st.h" -#include "write_HS_sparse.h" - -// if 'binary=true', output binary file. -// The 'sparse_thr' is the accuracy of the sparse matrix. -// If the absolute value of the matrix element is less than or equal to the -// 'sparse_thr', it will be ignored. -void ModuleIO::output_HSR(const UnitCell& ucell, - const int& istep, - const ModuleBase::matrix& v_eff, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, // mohan add 2024-04-06 - const K_Vectors& kv, - hamilt::Hamilt>* p_ham, -#ifdef __EXX - const std::vector>>>* Hexxd, - const std::vector>>>>* Hexxc, -#endif - const std::string& SR_filename, - const std::string& HR_filename_up, - const std::string HR_filename_down, - const bool& binary, - const double& sparse_thr) -{ - - ModuleBase::TITLE("ModuleIO", "output_HSR"); - ModuleBase::timer::tick("ModuleIO", "output_HSR"); - - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out Hamiltonian matrix H(R) or overlap matrix S(R)# |" << std::endl; - GlobalV::ofs_running << " | Use numerical atomic orbitals basis. Here R is the Bravis lattice |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - - const int nspin = PARAM.inp.nspin; - - if (nspin == 1 || nspin == 4) { - const int spin_now = 0; - // jingan add 2021-6-4, modify 2021-12-2 - sparse_format::cal_HSR(ucell,pv, HS_Arrays, grid, spin_now, sparse_thr, kv.nmp, p_ham -#ifdef __EXX - , Hexxd, Hexxc -#endif - ); - } - else if (nspin == 2) { - int spin_now = 1; - - // save HR of spin down first (the current spin always be down) - sparse_format::cal_HSR(ucell,pv, HS_Arrays, grid, spin_now, sparse_thr, kv.nmp, p_ham -#ifdef __EXX - , Hexxd, Hexxc -#endif - ); - - // cal HR of the spin up - if (PARAM.inp.vl_in_h) { - const int ik = 0; - p_ham->refresh(); - p_ham->updateHk(ik); - spin_now = 0; - } - - sparse_format::cal_HSR(ucell,pv, HS_Arrays, grid, spin_now, sparse_thr, kv.nmp, p_ham -#ifdef __EXX - , Hexxd, Hexxc -#endif - ); - } - - ModuleIO::save_HSR_sparse(istep, - pv, - HS_Arrays, - sparse_thr, - binary, - SR_filename, - HR_filename_up, - HR_filename_down); - - sparse_format::destroy_HS_R_sparse(HS_Arrays); - - ModuleBase::timer::tick("ModuleIO", "output_HSR"); - return; -} - -void ModuleIO::output_dSR(const int& istep, - const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, // mohan add 2024-04-06 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const K_Vectors& kv, - const bool& binary, - const double& sparse_thr) -{ - ModuleBase::TITLE("ModuleIO", "output_dSR"); - ModuleBase::timer::tick("ModuleIO", "output_dSR"); - - sparse_format::cal_dS(ucell, - pv, - HS_Arrays, - grid, - two_center_bundle, - orb, - sparse_thr); - - // mohan update 2024-04-01 - ModuleIO::save_dH_sparse(istep, pv, HS_Arrays, sparse_thr, binary, "s"); - - sparse_format::destroy_dH_R_sparse(HS_Arrays); - - ModuleBase::timer::tick("ModuleIO", "output_dSR"); - return; -} - -void ModuleIO::output_dHR(const int& istep, - const ModuleBase::matrix& v_eff, - Gint_k& gint_k, // mohan add 2024-04-01 - const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, // mohan add 2024-04-06 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const K_Vectors& kv, - const bool& binary, - const double& sparse_thr) -{ - ModuleBase::TITLE("ModuleIO", "output_dHR"); - ModuleBase::timer::tick("ModuleIO", "output_dHR"); - - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out dH/dR# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - const int nspin = PARAM.inp.nspin; - - if (nspin == 1 || nspin == 4) - { - // mohan add 2024-04-01 - const int cspin = 0; - - sparse_format::cal_dH(ucell, - pv, - HS_Arrays, - grid, - two_center_bundle, - orb, - cspin, - sparse_thr, - v_eff, - gint_k); - } - else if (nspin == 2) - { - for (int cspin = 0; cspin < 2; cspin++) - { - sparse_format::cal_dH(ucell, - pv, - HS_Arrays, - grid, - two_center_bundle, - orb, - cspin, - sparse_thr, - v_eff, - gint_k); - } - } - // mohan update 2024-04-01 - ModuleIO::save_dH_sparse(istep, pv, HS_Arrays, sparse_thr, binary); - - sparse_format::destroy_dH_R_sparse(HS_Arrays); - - ModuleBase::timer::tick("ModuleIO", "output_dHR"); - return; -} - -void ModuleIO::output_SR(Parallel_Orbitals& pv, - const Grid_Driver& grid, - hamilt::Hamilt>* p_ham, - const std::string& SR_filename, - const bool& binary, - const double& sparse_thr) -{ - ModuleBase::TITLE("ModuleIO", "output_SR"); - ModuleBase::timer::tick("ModuleIO", "output_SR"); - - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out overlap matrix S(R)# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - std::cout << " Overlap matrix file is in " << SR_filename << std::endl; - GlobalV::ofs_running << " Overlap matrix file is in " << SR_filename << std::endl; - - - LCAO_HS_Arrays HS_Arrays; - - sparse_format::cal_SR(pv, - HS_Arrays.all_R_coor, - HS_Arrays.SR_sparse, - HS_Arrays.SR_soc_sparse, - grid, - sparse_thr, - p_ham); - - const int istep = 0; - - if (PARAM.inp.nspin == 4) - { - ModuleIO::save_sparse(HS_Arrays.SR_soc_sparse, - HS_Arrays.all_R_coor, - sparse_thr, - binary, - SR_filename, - pv, - "S", - istep); - } - else - { - ModuleIO::save_sparse(HS_Arrays.SR_sparse, - HS_Arrays.all_R_coor, - sparse_thr, - binary, - SR_filename, - pv, - "S", - istep); - } - - sparse_format::destroy_HS_R_sparse(HS_Arrays); - - ModuleBase::timer::tick("ModuleIO", "output_SR"); - return; -} - -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 bool& binary, - const double& sparse_thr) -{ - ModuleBase::TITLE("ModuleIO", "output_TR"); - ModuleBase::timer::tick("ModuleIO", "output_TR"); - - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out kinetic energy term matrix T(R)# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - - std::stringstream sst; - if (PARAM.inp.calculation == "md" && !PARAM.inp.out_app_flag) - { - sst << PARAM.globalv.global_matrix_dir << TR_filename << "g" << istep; - GlobalV::ofs_running << " T(R) data are in file: " << sst.str() << std::endl; - } - else - { - sst << PARAM.globalv.global_out_dir << TR_filename; - GlobalV::ofs_running << " T(R) data are in file: " << sst.str() << std::endl; - } - - sparse_format::cal_TR(ucell, - pv, - HS_Arrays, - grid, - two_center_bundle, - orb, - sparse_thr); - - ModuleIO::save_sparse(HS_Arrays.TR_sparse, - HS_Arrays.all_R_coor, - sparse_thr, - binary, - sst.str().c_str(), - pv, - "T", - istep); - - sparse_format::destroy_T_R_sparse(HS_Arrays); - - ModuleBase::timer::tick("ModuleIO", "output_TR"); - return; -} diff --git a/source/module_io/write_HS_R.h b/source/module_io/write_HS_R.h deleted file mode 100644 index 32b06e542c..0000000000 --- a/source/module_io/write_HS_R.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef WRITE_HS_R_H -#define WRITE_HS_R_H - -#include "source_base/matrix.h" -#include "source_basis/module_nao/two_center_bundle.h" -#include "source_cell/klist.h" -#include "source_hamilt/hamilt.h" -#include "module_hamilt_lcao/module_gint/gint_k.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace ModuleIO -{ - using TAC = std::pair>; - void output_HSR(const UnitCell& ucell, - const int& istep, - const ModuleBase::matrix& v_eff, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, // mohan add 2024-04-06 - const K_Vectors& kv, - hamilt::Hamilt>* p_ham, -#ifdef __EXX - const std::vector>>>* Hexxd = nullptr, - const std::vector>>>>* Hexxc = nullptr, -#endif - const std::string& SR_filename = "srs1_nao.csr", - const std::string& HR_filename_up = "hrs1_nao.csr", - const std::string HR_filename_down = "hrs2_nao.csr", - const bool& binary = false, - const double& sparse_threshold = 1e-10); // LiuXh add 2019-07-15, modify in 2021-12-3 - - void output_dHR(const int& istep, - const ModuleBase::matrix& v_eff, - Gint_k& gint_k, // mohan add 2024-04-01 - const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, // mohan add 2024-04-06 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const K_Vectors& kv, - const bool& binary = false, - const double& sparse_threshold = 1e-10); - - void output_dSR(const int& istep, - const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, // mohan add 2024-04-06 - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - const K_Vectors& kv, - const bool& binary = false, - const double& sparse_thr = 1e-10); - - 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 = "trs1_nao.csr", - const bool& binary = false, - const double& sparse_threshold = 1e-10); - - void output_SR(Parallel_Orbitals& pv, - const Grid_Driver& grid, - hamilt::Hamilt>* p_ham, - const std::string& SR_filename = "srs1_nao.csr", - const bool& binary = false, - const double& sparse_threshold = 1e-10); -} // namespace ModuleIO - -#endif diff --git a/source/module_io/write_HS_sparse.cpp b/source/module_io/write_HS_sparse.cpp deleted file mode 100644 index 770776cf37..0000000000 --- a/source/module_io/write_HS_sparse.cpp +++ /dev/null @@ -1,835 +0,0 @@ -#include "write_HS_sparse.h" - -#include "module_parameter/parameter.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "single_R_io.h" - -void ModuleIO::save_HSR_sparse(const int& istep, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const double& sparse_thr, - const bool& binary, - const std::string& SR_filename, - const std::string& HR_filename_up, - const std::string& HR_filename_down = "") { - ModuleBase::TITLE("ModuleIO", "save_HSR_sparse"); - ModuleBase::timer::tick("ModuleIO", "save_HSR_sparse"); - - auto& all_R_coor_ptr = HS_Arrays.all_R_coor; - auto& output_R_coor_ptr = HS_Arrays.output_R_coor; - auto& HR_sparse_ptr = HS_Arrays.HR_sparse; - auto& SR_sparse_ptr = HS_Arrays.SR_sparse; - auto& HR_soc_sparse_ptr = HS_Arrays.HR_soc_sparse; - auto& SR_soc_sparse_ptr = HS_Arrays.SR_soc_sparse; - - int total_R_num = all_R_coor_ptr.size(); - int output_R_number = 0; - int* H_nonzero_num[2] = {nullptr, nullptr}; - int* S_nonzero_num = nullptr; - int step = istep; - - S_nonzero_num = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(S_nonzero_num, total_R_num); - - int spin_loop = 1; - if (PARAM.inp.nspin == 2) { - spin_loop = 2; - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - H_nonzero_num[ispin] = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(H_nonzero_num[ispin], total_R_num); - } - - int count = 0; - for (auto& R_coor: all_R_coor_ptr) { - if (PARAM.inp.nspin != 4) { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { - auto iter - = TD_info::td_vel_op->HR_sparse_td_vel[ispin].find( - R_coor); - if (iter - != TD_info::td_vel_op->HR_sparse_td_vel[ispin] - .end()) { - for (auto& row_loop: iter->second) { - H_nonzero_num[ispin][count] - += row_loop.second.size(); - } - } - } else { - auto iter = HR_sparse_ptr[ispin].find(R_coor); - if (iter != HR_sparse_ptr[ispin].end()) { - for (auto& row_loop: iter->second) { - H_nonzero_num[ispin][count] - += row_loop.second.size(); - } - } - } - } - - auto iter = SR_sparse_ptr.find(R_coor); - if (iter != SR_sparse_ptr.end()) { - for (auto& row_loop: iter->second) { - S_nonzero_num[count] += row_loop.second.size(); - } - } - } else { - auto iter = HR_soc_sparse_ptr.find(R_coor); - if (iter != HR_soc_sparse_ptr.end()) { - for (auto& row_loop: iter->second) { - H_nonzero_num[0][count] += row_loop.second.size(); - } - } - - iter = SR_soc_sparse_ptr.find(R_coor); - if (iter != SR_soc_sparse_ptr.end()) { - for (auto& row_loop: iter->second) { - S_nonzero_num[count] += row_loop.second.size(); - } - } - } - - count++; - } - - Parallel_Reduce::reduce_all(S_nonzero_num, total_R_num); - for (int ispin = 0; ispin < spin_loop; ++ispin) { - Parallel_Reduce::reduce_all(H_nonzero_num[ispin], total_R_num); - } - - if (PARAM.inp.nspin == 2) { - for (int index = 0; index < total_R_num; ++index) { - if (H_nonzero_num[0][index] != 0 || H_nonzero_num[1][index] != 0 - || S_nonzero_num[index] != 0) { - output_R_number++; - } - } - } else { - for (int index = 0; index < total_R_num; ++index) { - if (H_nonzero_num[0][index] != 0 || S_nonzero_num[index] != 0) { - output_R_number++; - } - } - } - - std::stringstream ssh[2]; - std::stringstream sss; - if (PARAM.inp.calculation == "md" && !PARAM.inp.out_app_flag) { - ssh[0] << PARAM.globalv.global_matrix_dir << step << "_" << HR_filename_up; - ssh[1] << PARAM.globalv.global_matrix_dir << step << "_" << HR_filename_down; - sss << PARAM.globalv.global_matrix_dir << step << "_" << SR_filename; - } else { - ssh[0] << PARAM.globalv.global_out_dir << HR_filename_up; - ssh[1] << PARAM.globalv.global_out_dir << HR_filename_down; - sss << PARAM.globalv.global_out_dir << SR_filename; - } - - GlobalV::ofs_running << " The output filename is " << ssh[0].str() << std::endl; - GlobalV::ofs_running << " The output filename is " << ssh[1].str() << std::endl; - GlobalV::ofs_running << " The output filename is " << sss.str() << std::endl; - - std::ofstream g1[2]; - std::ofstream g2; - - if (GlobalV::DRANK == 0) { - if (binary) { - int nlocal = PARAM.globalv.nlocal; - for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag - && step) { - g1[ispin].open(ssh[ispin].str().c_str(), - std::ios::binary | std::ios::app); - } else { - g1[ispin].open(ssh[ispin].str().c_str(), std::ios::binary); - } - g1[ispin].write(reinterpret_cast(&step), sizeof(int)); - g1[ispin].write(reinterpret_cast(&nlocal), - sizeof(int)); - g1[ispin].write(reinterpret_cast(&output_R_number), - sizeof(int)); - } - - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) { - g2.open(sss.str().c_str(), std::ios::binary | std::ios::app); - } else { - g2.open(sss.str().c_str(), std::ios::binary); - } - g2.write(reinterpret_cast(&step), sizeof(int)); - g2.write(reinterpret_cast(&nlocal), sizeof(int)); - g2.write(reinterpret_cast(&output_R_number), sizeof(int)); - } else { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag - && step) { - g1[ispin].open(ssh[ispin].str().c_str(), std::ios::app); - } else { - g1[ispin].open(ssh[ispin].str().c_str()); - } - g1[ispin] << "STEP: " << step << std::endl; - g1[ispin] << "Matrix Dimension of H(R): " << PARAM.globalv.nlocal - << std::endl; - g1[ispin] << "Matrix number of H(R): " << output_R_number - << std::endl; - } - - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) { - g2.open(sss.str().c_str(), std::ios::app); - } else { - g2.open(sss.str().c_str()); - } - g2 << "STEP: " << step << std::endl; - g2 << "Matrix Dimension of S(R): " << PARAM.globalv.nlocal << std::endl; - g2 << "Matrix number of S(R): " << output_R_number << std::endl; - } - } - - output_R_coor_ptr.clear(); - - count = 0; - for (auto& R_coor: all_R_coor_ptr) { - int dRx = R_coor.x; - int dRy = R_coor.y; - int dRz = R_coor.z; - - if (PARAM.inp.nspin == 2) { - if (H_nonzero_num[0][count] == 0 && H_nonzero_num[1][count] == 0 - && S_nonzero_num[count] == 0) { - count++; - continue; - } - } else { - if (H_nonzero_num[0][count] == 0 && S_nonzero_num[count] == 0) { - count++; - continue; - } - } - - output_R_coor_ptr.insert(R_coor); - - if (GlobalV::DRANK == 0) { - if (binary) { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1[ispin].write(reinterpret_cast(&dRx), sizeof(int)); - g1[ispin].write(reinterpret_cast(&dRy), sizeof(int)); - g1[ispin].write(reinterpret_cast(&dRz), sizeof(int)); - g1[ispin].write( - reinterpret_cast(&H_nonzero_num[ispin][count]), - sizeof(int)); - } - - g2.write(reinterpret_cast(&dRx), sizeof(int)); - g2.write(reinterpret_cast(&dRy), sizeof(int)); - g2.write(reinterpret_cast(&dRz), sizeof(int)); - g2.write(reinterpret_cast(&S_nonzero_num[count]), - sizeof(int)); - } else { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1[ispin] << dRx << " " << dRy << " " << dRz << " " - << H_nonzero_num[ispin][count] << std::endl; - } - g2 << dRx << " " << dRy << " " << dRz << " " - << S_nonzero_num[count] << std::endl; - } - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (H_nonzero_num[ispin][count] == 0) { - // if (GlobalV::DRANK == 0) - // { - // if (!binary) - // { - // g1[ispin] << std::endl; - // g1[ispin] << std::endl; - // for (int index = 0; index < PARAM.globalv.nlocal+1; - // ++index) - // { - // g1[ispin] << 0 << " "; - // } - // g1[ispin] << std::endl; - // } - // } - } else { - if (PARAM.inp.nspin != 4) { - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { - output_single_R(g1[ispin], - TD_info::td_vel_op - ->HR_sparse_td_vel[ispin][R_coor], - sparse_thr, - binary, - pv); - } else { - output_single_R(g1[ispin], - HR_sparse_ptr[ispin][R_coor], - sparse_thr, - binary, - pv); - } - } else { - output_single_R(g1[ispin], - HR_soc_sparse_ptr[R_coor], - sparse_thr, - binary, - pv); - } - } - } - - if (S_nonzero_num[count] == 0) { - // if (!binary) - // { - // if (GlobalV::DRANK == 0) - // { - // g2 << std::endl; - // g2 << std::endl; - // for (int index = 0; index < PARAM.globalv.nlocal+1; ++index) - // { - // g2 << 0 << " "; - // } - // g2 << std::endl; - // } - // } - } else { - if (PARAM.inp.nspin != 4) { - output_single_R(g2, - SR_sparse_ptr[R_coor], - sparse_thr, - binary, - pv); - } else { - output_single_R(g2, - SR_soc_sparse_ptr[R_coor], - sparse_thr, - binary, - pv); - } - } - - count++; - } - - if (GlobalV::DRANK == 0) { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1[ispin].close(); - } - g2.close(); - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - delete[] H_nonzero_num[ispin]; - H_nonzero_num[ispin] = nullptr; - } - delete[] S_nonzero_num; - S_nonzero_num = nullptr; - - ModuleBase::timer::tick("ModuleIO", "save_HSR_sparse"); - return; -} - -void ModuleIO::save_dH_sparse(const int& istep, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const double& sparse_thr, - const bool& binary, - const std::string& fileflag) { - ModuleBase::TITLE("ModuleIO", "save_dH_sparse"); - ModuleBase::timer::tick("ModuleIO", "save_dH_sparse"); - - auto& all_R_coor_ptr = HS_Arrays.all_R_coor; - auto& output_R_coor_ptr = HS_Arrays.output_R_coor; - auto& dHRx_sparse_ptr = HS_Arrays.dHRx_sparse; - auto& dHRx_soc_sparse_ptr = HS_Arrays.dHRx_soc_sparse; - auto& dHRy_sparse_ptr = HS_Arrays.dHRy_sparse; - auto& dHRy_soc_sparse_ptr = HS_Arrays.dHRy_soc_sparse; - auto& dHRz_sparse_ptr = HS_Arrays.dHRz_sparse; - auto& dHRz_soc_sparse_ptr = HS_Arrays.dHRz_soc_sparse; - - int total_R_num = all_R_coor_ptr.size(); - int output_R_number = 0; - int* dHx_nonzero_num[2] = {nullptr, nullptr}; - int* dHy_nonzero_num[2] = {nullptr, nullptr}; - int* dHz_nonzero_num[2] = {nullptr, nullptr}; - int step = istep; - - int spin_loop = 1; - if (PARAM.inp.nspin == 2) { - spin_loop = 2; - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - dHx_nonzero_num[ispin] = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(dHx_nonzero_num[ispin], total_R_num); - dHy_nonzero_num[ispin] = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(dHy_nonzero_num[ispin], total_R_num); - dHz_nonzero_num[ispin] = new int[total_R_num]; - ModuleBase::GlobalFunc::ZEROS(dHz_nonzero_num[ispin], total_R_num); - } - - int count = 0; - for (auto& R_coor: all_R_coor_ptr) { - if (PARAM.inp.nspin != 4) { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - auto iter1 = dHRx_sparse_ptr[ispin].find(R_coor); - if (iter1 != dHRx_sparse_ptr[ispin].end()) { - for (auto& row_loop: iter1->second) { - dHx_nonzero_num[ispin][count] += row_loop.second.size(); - } - } - - auto iter2 = dHRy_sparse_ptr[ispin].find(R_coor); - if (iter2 != dHRy_sparse_ptr[ispin].end()) { - for (auto& row_loop: iter2->second) { - dHy_nonzero_num[ispin][count] += row_loop.second.size(); - } - } - - auto iter3 = dHRz_sparse_ptr[ispin].find(R_coor); - if (iter3 != dHRz_sparse_ptr[ispin].end()) { - for (auto& row_loop: iter3->second) { - dHz_nonzero_num[ispin][count] += row_loop.second.size(); - } - } - } - } else { - auto iter = dHRx_soc_sparse_ptr.find(R_coor); - if (iter != dHRx_soc_sparse_ptr.end()) { - for (auto& row_loop: iter->second) { - dHx_nonzero_num[0][count] += row_loop.second.size(); - } - } - } - - count++; - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - Parallel_Reduce::reduce_all(dHx_nonzero_num[ispin], total_R_num); - Parallel_Reduce::reduce_all(dHy_nonzero_num[ispin], total_R_num); - Parallel_Reduce::reduce_all(dHz_nonzero_num[ispin], total_R_num); - } - - if (PARAM.inp.nspin == 2) - { - for (int index = 0; index < total_R_num; ++index) - { - if (dHx_nonzero_num[0][index] != 0 || dHx_nonzero_num[1][index] != 0 - || dHy_nonzero_num[0][index] != 0 - || dHy_nonzero_num[1][index] != 0 - || dHz_nonzero_num[0][index] != 0 - || dHz_nonzero_num[1][index] != 0) - { - output_R_number++; - } - } - } else - { - for (int index = 0; index < total_R_num; ++index) - { - if (dHx_nonzero_num[0][index] != 0 || dHy_nonzero_num[0][index] != 0 - || dHz_nonzero_num[0][index] != 0) - { - output_R_number++; - } - } - } - - std::stringstream sshx[2]; - std::stringstream sshy[2]; - std::stringstream sshz[2]; - - if (PARAM.inp.calculation == "md" && !PARAM.inp.out_app_flag) - { - sshx[0] << PARAM.globalv.global_matrix_dir - << "d"<(&step), sizeof(int)); - g1x[ispin].write(reinterpret_cast(&nlocal), - sizeof(int)); - g1x[ispin].write(reinterpret_cast(&output_R_number), - sizeof(int)); - - g1y[ispin].write(reinterpret_cast(&step), sizeof(int)); - g1y[ispin].write(reinterpret_cast(&nlocal), - sizeof(int)); - g1y[ispin].write(reinterpret_cast(&output_R_number), - sizeof(int)); - - g1z[ispin].write(reinterpret_cast(&step), sizeof(int)); - g1z[ispin].write(reinterpret_cast(&nlocal), - sizeof(int)); - g1z[ispin].write(reinterpret_cast(&output_R_number), - sizeof(int)); - } - } - else - { - for (int ispin = 0; ispin < spin_loop; ++ispin) - { - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag && step) - { - g1x[ispin].open(sshx[ispin].str().c_str(), std::ios::app); - g1y[ispin].open(sshy[ispin].str().c_str(), std::ios::app); - g1z[ispin].open(sshz[ispin].str().c_str(), std::ios::app); - } - else - { - GlobalV::ofs_running << " dH/dRx data are in file: " << sshx[ispin].str() << std::endl; - GlobalV::ofs_running << " dH/dRy data are in file: " << sshy[ispin].str() << std::endl; - GlobalV::ofs_running << " dH/dRz data are in file: " << sshz[ispin].str() << std::endl; - g1x[ispin].open(sshx[ispin].str().c_str()); - g1y[ispin].open(sshy[ispin].str().c_str()); - g1z[ispin].open(sshz[ispin].str().c_str()); - } - - g1x[ispin] << "STEP: " << step << std::endl; - g1x[ispin] << "Matrix Dimension of dHx(R): " << PARAM.globalv.nlocal - << std::endl; - g1x[ispin] << "Matrix number of dHx(R): " << output_R_number - << std::endl; - - g1y[ispin] << "STEP: " << step << std::endl; - g1y[ispin] << "Matrix Dimension of dHy(R): " << PARAM.globalv.nlocal - << std::endl; - g1y[ispin] << "Matrix number of dHy(R): " << output_R_number - << std::endl; - - g1z[ispin] << "STEP: " << step << std::endl; - g1z[ispin] << "Matrix Dimension of dHz(R): " << PARAM.globalv.nlocal - << std::endl; - g1z[ispin] << "Matrix number of dHz(R): " << output_R_number - << std::endl; - } - } - } - - output_R_coor_ptr.clear(); - - count = 0; - for (auto& R_coor: all_R_coor_ptr) { - int dRx = R_coor.x; - int dRy = R_coor.y; - int dRz = R_coor.z; - - if (PARAM.inp.nspin == 2) { - if (dHx_nonzero_num[0][count] == 0 && dHx_nonzero_num[1][count] == 0 - && dHy_nonzero_num[0][count] == 0 - && dHy_nonzero_num[1][count] == 0 - && dHz_nonzero_num[0][count] == 0 - && dHz_nonzero_num[1][count] == 0) { - count++; - continue; - } - } else { - if (dHx_nonzero_num[0][count] == 0 && dHy_nonzero_num[0][count] == 0 - && dHz_nonzero_num[0][count] == 0) { - count++; - continue; - } - } - - output_R_coor_ptr.insert(R_coor); - - if (GlobalV::DRANK == 0) { - if (binary) { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1x[ispin].write(reinterpret_cast(&dRx), - sizeof(int)); - g1x[ispin].write(reinterpret_cast(&dRy), - sizeof(int)); - g1x[ispin].write(reinterpret_cast(&dRz), - sizeof(int)); - g1x[ispin].write( - reinterpret_cast(&dHx_nonzero_num[ispin][count]), - sizeof(int)); - - g1y[ispin].write(reinterpret_cast(&dRx), - sizeof(int)); - g1y[ispin].write(reinterpret_cast(&dRy), - sizeof(int)); - g1y[ispin].write(reinterpret_cast(&dRz), - sizeof(int)); - g1y[ispin].write( - reinterpret_cast(&dHy_nonzero_num[ispin][count]), - sizeof(int)); - - g1z[ispin].write(reinterpret_cast(&dRx), - sizeof(int)); - g1z[ispin].write(reinterpret_cast(&dRy), - sizeof(int)); - g1z[ispin].write(reinterpret_cast(&dRz), - sizeof(int)); - g1z[ispin].write( - reinterpret_cast(&dHz_nonzero_num[ispin][count]), - sizeof(int)); - } - } else { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1x[ispin] << dRx << " " << dRy << " " << dRz << " " - << dHx_nonzero_num[ispin][count] << std::endl; - g1y[ispin] << dRx << " " << dRy << " " << dRz << " " - << dHy_nonzero_num[ispin][count] << std::endl; - g1z[ispin] << dRx << " " << dRy << " " << dRz << " " - << dHz_nonzero_num[ispin][count] << std::endl; - } - } - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (dHx_nonzero_num[ispin][count] > 0) { - if (PARAM.inp.nspin != 4) { - output_single_R(g1x[ispin], - dHRx_sparse_ptr[ispin][R_coor], - sparse_thr, - binary, - pv); - } else { - output_single_R(g1x[ispin], - dHRx_soc_sparse_ptr[R_coor], - sparse_thr, - binary, - pv); - } - } - if (dHy_nonzero_num[ispin][count] > 0) { - if (PARAM.inp.nspin != 4) { - output_single_R(g1y[ispin], - dHRy_sparse_ptr[ispin][R_coor], - sparse_thr, - binary, - pv); - } else { - output_single_R(g1y[ispin], - dHRy_soc_sparse_ptr[R_coor], - sparse_thr, - binary, - pv); - } - } - if (dHz_nonzero_num[ispin][count] > 0) { - if (PARAM.inp.nspin != 4) { - output_single_R(g1z[ispin], - dHRz_sparse_ptr[ispin][R_coor], - sparse_thr, - binary, - pv); - } else { - output_single_R(g1z[ispin], - dHRz_soc_sparse_ptr[R_coor], - sparse_thr, - binary, - pv); - } - } - } - - count++; - } - - if (GlobalV::DRANK == 0) { - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1x[ispin].close(); - } - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1y[ispin].close(); - } - for (int ispin = 0; ispin < spin_loop; ++ispin) { - g1z[ispin].close(); - } - } - - for (int ispin = 0; ispin < spin_loop; ++ispin) { - delete[] dHx_nonzero_num[ispin]; - dHx_nonzero_num[ispin] = nullptr; - delete[] dHy_nonzero_num[ispin]; - dHy_nonzero_num[ispin] = nullptr; - delete[] dHz_nonzero_num[ispin]; - dHz_nonzero_num[ispin] = nullptr; - } - - ModuleBase::timer::tick("ModuleIO", "save_dH_sparse"); - return; -} - -template -void ModuleIO::save_sparse( - const std::map, - std::map>>& smat, - const std::set>& all_R_coor, - const double& sparse_thr, - const bool& binary, - const std::string& filename, - const Parallel_Orbitals& pv, - const std::string& label, - const int& istep, - const bool& reduce) { - ModuleBase::TITLE("ModuleIO", "save_sparse"); - ModuleBase::timer::tick("ModuleIO", "save_sparse"); - - int total_R_num = all_R_coor.size(); - std::vector nonzero_num(total_R_num, 0); - int count = 0; - for (auto& R_coor: all_R_coor) { - auto iter = smat.find(R_coor); - if (iter != smat.end()) { - for (auto& row_loop: iter->second) { - nonzero_num[count] += row_loop.second.size(); - } - } - ++count; - } - if (reduce) { - Parallel_Reduce::reduce_all(nonzero_num.data(), total_R_num); - } - - int output_R_number = 0; - for (int index = 0; index < total_R_num; ++index) { - if (nonzero_num[index] != 0) { - ++output_R_number; - } - } - - std::stringstream sss; - sss << filename; - std::ofstream ofs; - if (!reduce || GlobalV::DRANK == 0) { - if (binary) { - int nlocal = PARAM.globalv.nlocal; - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag - && istep) { - ofs.open(sss.str().c_str(), std::ios::binary | std::ios::app); - } else { - ofs.open(sss.str().c_str(), std::ios::binary); - } - ofs.write(reinterpret_cast(0), sizeof(int)); - ofs.write(reinterpret_cast(&nlocal), sizeof(int)); - ofs.write(reinterpret_cast(&output_R_number), sizeof(int)); - } else { - if (PARAM.inp.calculation == "md" && PARAM.inp.out_app_flag - && istep) { - ofs.open(sss.str().c_str(), std::ios::app); - } else { - ofs.open(sss.str().c_str()); - } - ofs << "STEP: " << std::max(istep, 0) << std::endl; - ofs << "Matrix Dimension of " + label + "(R): " << PARAM.globalv.nlocal - << std::endl; - ofs << "Matrix number of " + label + "(R): " << output_R_number - << std::endl; - } - } - - count = 0; - for (auto& R_coor: all_R_coor) { - int dRx = R_coor.x; - int dRy = R_coor.y; - int dRz = R_coor.z; - - if (nonzero_num[count] == 0) { - count++; - continue; - } - - if (!reduce || GlobalV::DRANK == 0) { - if (binary) { - ofs.write(reinterpret_cast(&dRx), sizeof(int)); - ofs.write(reinterpret_cast(&dRy), sizeof(int)); - ofs.write(reinterpret_cast(&dRz), sizeof(int)); - ofs.write(reinterpret_cast(&nonzero_num[count]), - sizeof(int)); - } else { - ofs << dRx << " " << dRy << " " << dRz << " " - << nonzero_num[count] << std::endl; - } - } - - if (smat.count(R_coor)) - { - output_single_R(ofs, smat.at(R_coor), sparse_thr, binary, pv, reduce); - } - else - { - std::map> empty_map; - output_single_R(ofs, empty_map, sparse_thr, binary, pv, reduce); - } - ++count; - } - if (!reduce || GlobalV::DRANK == 0) { - ofs.close(); - } - - ModuleBase::timer::tick("ModuleIO", "save_sparse"); -} - -template void ModuleIO::save_sparse( - const std::map, - std::map>>&, - const std::set>&, - const double&, - const bool&, - const std::string&, - const Parallel_Orbitals&, - const std::string&, - const int&, - const bool&); - -template void ModuleIO::save_sparse>( - const std::map, - std::map>>>&, - const std::set>&, - const double&, - const bool&, - const std::string&, - const Parallel_Orbitals&, - const std::string&, - const int&, - const bool&); diff --git a/source/module_io/write_HS_sparse.h b/source/module_io/write_HS_sparse.h deleted file mode 100644 index a12085fba6..0000000000 --- a/source/module_io/write_HS_sparse.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef WRITE_HS_SPARSE_H -#define WRITE_HS_SPARSE_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_HS_arrays.hpp" - -#include - -namespace ModuleIO -{ - -// jingan add 2021-6-4, modify 2021-12-2 -void save_HSR_sparse(const int& istep, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const double& sparse_thr, - const bool& binary, - const std::string& SR_filename, - const std::string& HR_filename_up, - const std::string& HR_filename_down); - -void save_dH_sparse(const int& istep, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const double& sparse_thr, - const bool& binary, - const std::string& fileflag = "h"); - -template -void save_sparse(const std::map, std::map>>& smat, - const std::set>& all_R_coor, - const double& sparse_thr, - const bool& binary, - const std::string& filename, - const Parallel_Orbitals& pv, - const std::string& label, - const int& istep = -1, - const bool& reduce = true); -} // namespace ModuleIO - -#endif diff --git a/source/module_io/write_cube.cpp b/source/module_io/write_cube.cpp deleted file mode 100644 index 1ab3fd510e..0000000000 --- a/source/module_io/write_cube.cpp +++ /dev/null @@ -1,255 +0,0 @@ -#include "source_base/element_name.h" -#include "source_base/parallel_comm.h" -#include "source_pw/hamilt_pwdft/parallel_grid.h" -#include "module_io/cube_io.h" -#include "module_parameter/parameter.h" - -#include - -#ifdef __MPI -#include -#endif - -#include - -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 reduce_all_pool) -{ - ModuleBase::TITLE("ModuleIO", "write_vdata_palgrid"); - - const int my_rank = GlobalV::MY_RANK; - const int my_pool = GlobalV::MY_POOL; - const int rank_in_pool = GlobalV::RANK_IN_POOL; - - time_t start; - time_t end; - std::stringstream ss; - - const int& nx = pgrid.nx; - const int& ny = pgrid.ny; - const int& nz = pgrid.nz; - const int& nxyz = nx * ny * nz; - - start = time(nullptr); - - // reduce - std::vector data_xyz_full(nxyz); // data to be written -#ifdef __MPI // reduce to rank 0 - if (GlobalV::MY_BNDGROUP == 0) - { - pgrid.reduce(data_xyz_full.data(), data, reduce_all_pool); - } - if (!reduce_all_pool) - { - MPI_Barrier(MPI_COMM_WORLD); - } - else - { - MPI_Barrier(POOL_WORLD); - } -#else - std::memcpy(data_xyz_full.data(), data, nxyz * sizeof(double)); -#endif - - // build the info structure - if ((!reduce_all_pool && my_rank == 0) || (reduce_all_pool && rank_in_pool == 0)) - { - /// output header for cube file - ss << "STEP: " << iter << " Cubefile created from ABACUS. Inner loop is z, followed by y and x" << std::endl; - - ss << nspin << " (nspin) "; - ss << std::fixed; - ss << std::setprecision(6); - if (out_fermi == 1) - { - if (PARAM.globalv.two_fermi) - { - if (is == 0) - { - ss << ef << " (fermi energy for spin=1, in Ry)" << std::endl; - } - else if (is == 1) - { - ss << ef << " (fermi energy for spin=2, in Ry)" << std::endl; - } - } - else - { - ss << ef << " (fermi energy, in Ry)" << std::endl; - } - } - else - { - ss << std::endl; - } - - std::vector comment(2); - for (int i = 0; i < 2; ++i) - { - std::getline(ss, comment[i]); - } - - double fac = ucell->lat0; - std::vector dx = {fac * ucell->latvec.e11 / double(nx), - fac * ucell->latvec.e12 / double(nx), - fac * ucell->latvec.e13 / double(nx)}; - - std::vector dy = {fac * ucell->latvec.e21 / double(ny), - fac * ucell->latvec.e22 / double(ny), - fac * ucell->latvec.e23 / double(ny)}; - - std::vector dz = {fac * ucell->latvec.e31 / double(nz), - fac * ucell->latvec.e32 / double(nz), - fac * ucell->latvec.e33 / double(nz)}; - - std::string element = ""; - std::vector atom_type; - std::vector atom_charge; - std::vector> atom_pos; - for (int it = 0; it < ucell->ntype; it++) - { - // erase the number in label, such as Fe1. - element = ucell->atoms[it].label; - std::string::iterator temp = element.begin(); - while (temp != element.end()) - { - if ((*temp >= '1') && (*temp <= '9')) - { - temp = element.erase(temp); - } - else - { - temp++; - } - } - - for (int ia = 0; ia < ucell->atoms[it].na; ia++) - { - // convert from label to atomic number - int z = 0; - for (int j = 0; j != ModuleBase::element_name.size(); j++) - { - if (element == ModuleBase::element_name[j]) - { - z = j + 1; - break; - } - } - atom_type.push_back(z); - atom_charge.push_back(ucell->atoms[it].ncpp.zv); - atom_pos.push_back({fac * ucell->atoms[it].tau[ia].x, - fac * ucell->atoms[it].tau[ia].y, - fac * ucell->atoms[it].tau[ia].z}); - } - } - write_cube(fn, - comment, - ucell->nat, - {0.0, 0.0, 0.0}, - nx, - ny, - nz, - dx, - dy, - dz, - atom_type, - atom_charge, - atom_pos, - data_xyz_full, - precision); - - end = time(nullptr); - ModuleBase::GlobalFunc::OUT_TIME("write_vdata_palgrid", start, end); - } - - return; -} - -void ModuleIO::write_cube(const std::string& file, - const std::vector& comment, - const int& natom, - const std::vector& origin, - const int& nx, - const int& ny, - const int& nz, - const std::vector& dx, - const std::vector& dy, - const std::vector& dz, - const std::vector& atom_type, - const std::vector& atom_charge, - const std::vector>& atom_pos, - const std::vector& data, - const int precision, - const int ndata_line) -{ - assert(comment.size() >= 2); - for (int i = 0; i < 2; ++i) - { - assert(comment[i].find("\n") == std::string::npos); - } - - assert(origin.size() >= 3); - assert(dx.size() >= 3); - assert(dy.size() >= 3); - assert(dz.size() >= 3); - assert(atom_type.size() >= natom); - assert(atom_charge.size() >= natom); - assert(atom_pos.size() >= natom); - - for (int i = 0; i < natom; ++i) - { - assert(atom_pos[i].size() >= 3); - } - - assert(data.size() >= nx * ny * nz); - - std::ofstream ofs(file); - - for (int i = 0; i < 2; ++i) - { - ofs << comment[i] << "\n"; - } - - ofs << std::fixed; - ofs << std::setprecision(1); // as before - - ofs << natom << " " << origin[0] << " " << origin[1] << " " << origin[2] << " \n"; - - ofs << std::setprecision(6); // as before - ofs << nx << " " << dx[0] << " " << dx[1] << " " << dx[2] << "\n"; - ofs << ny << " " << dy[0] << " " << dy[1] << " " << dy[2] << "\n"; - ofs << nz << " " << dz[0] << " " << dz[1] << " " << dz[2] << "\n"; - - for (int i = 0; i < natom; ++i) - { - ofs << " " << atom_type[i] << " " << atom_charge[i] << " " << atom_pos[i][0] << " " << atom_pos[i][1] << " " - << atom_pos[i][2] << "\n"; - } - - ofs.unsetf(std::ofstream::fixed); - ofs << std::setprecision(precision); - ofs << std::scientific; - const int nxy = nx * ny; - for (int ixy = 0; ixy < nxy; ++ixy) - { - for (int iz = 0; iz < nz; ++iz) - { - ofs << " " << data[ixy * nz + iz]; - if ((iz + 1) % ndata_line == 0 && iz != nz - 1) - { - ofs << "\n"; - } - } - ofs << "\n"; - } - ofs.close(); -} diff --git a/source/module_io/write_dipole.cpp b/source/module_io/write_dipole.cpp deleted file mode 100644 index ad0838475a..0000000000 --- a/source/module_io/write_dipole.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include "source_base/parallel_reduce.h" -#include "source_estate/module_charge/charge.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_io/dipole_io.h" - -// fuxiang add 2017-03-15 -void ModuleIO::write_dipole(const UnitCell& ucell, - const double* rho_save, - const ModulePW::PW_Basis* rhopw, - const int& is, - const int& istep, - const std::string& fn, - const int& precision, - const bool for_plot) -{ - ModuleBase::TITLE("ModuleIO", "write_dipole"); - - time_t start, end; - std::ofstream ofs; - - if (GlobalV::MY_RANK == 0) - { - start = time(NULL); - - ofs.open(fn.c_str(), std::ofstream::app); - if (!ofs) - { - ModuleBase::WARNING("ModuleIO", "Can't create Charge File!"); - } - } - - double bmod[3]; - for (int i = 0; i < 3; i++) - { - bmod[i] = prepare(ucell, i); - } - -#ifndef __MPI - double dipole_elec_x = 0.0, dipole_elec_y = 0.0, dipole_elec_z = 0.0; - double lat_factor_x = ucell.lat0 * 0.529177 / rhopw->nx; - double lat_factor_y = ucell.lat0 * 0.529177 / rhopw->ny; - double lat_factor_z = ucell.lat0 * 0.529177 / rhopw->nz; - - for (int k = 0; k < rhopw->nz; k++) - { - for (int j = 0; j < rhopw->ny; j++) - { - for (int i = 0; i < rhopw->nx; i++) - { - int index = i * rhopw->ny * rhopw->nz + j * rhopw->nz + k; - double rho_val = rho_save[index]; - - dipole_elec_x += rho_val * i * lat_factor_x; - dipole_elec_y += rho_val * j * lat_factor_y; - dipole_elec_z += rho_val * k * lat_factor_z; - } - } - } - - dipole_elec_x *= ucell.omega / static_cast(rhopw->nxyz); - dipole_elec_y *= ucell.omega / static_cast(rhopw->nxyz); - dipole_elec_z *= ucell.omega / static_cast(rhopw->nxyz); - Parallel_Reduce::reduce_pool(dipole_elec_x); - Parallel_Reduce::reduce_pool(dipole_elec_y); - Parallel_Reduce::reduce_pool(dipole_elec_z); - - ofs << istep << " " << dipole_elec_x << " " << dipole_elec_y << dipole_elec_z; -#else - - double dipole_elec[3] = {0.0, 0.0, 0.0}; - - for (int ir = 0; ir < rhopw->nrxx; ++ir) - { - int i = ir / (rhopw->ny * rhopw->nplane); - int j = ir / rhopw->nplane - i * rhopw->ny; - int k = ir % rhopw->nplane + rhopw->startz_current; - double x = (double)i / rhopw->nx; - double y = (double)j / rhopw->ny; - double z = (double)k / rhopw->nz; - - dipole_elec[0] += rho_save[ir] * x; - dipole_elec[1] += rho_save[ir] * y; - dipole_elec[2] += rho_save[ir] * z; - } - - Parallel_Reduce::reduce_pool(dipole_elec[0]); - Parallel_Reduce::reduce_pool(dipole_elec[1]); - Parallel_Reduce::reduce_pool(dipole_elec[2]); - for (int i = 0; i < 3; ++i) - { - dipole_elec[i] *= ucell.lat0 / bmod[i] * ucell.omega / rhopw->nxyz; - } - - std::cout << std::setprecision(15) << "dipole_elec_x: " << dipole_elec[0] << std::endl; - std::cout << std::setprecision(15) << "dipole_elec_y: " << dipole_elec[1] << std::endl; - std::cout << std::setprecision(15) << "dipole_elec_z: " << dipole_elec[2] << std::endl; - - ofs << std::setprecision(8) << istep << " " << dipole_elec[0] << " " << dipole_elec[1] << " " << dipole_elec[2] - << std::endl; - - double dipole_ion[3] = {0.0}; - double dipole_sum = 0.0; - - for (int i = 0; i < 3; ++i) - { - for (int it = 0; it < ucell.ntype; ++it) - { - double sum = 0; - for (int ia = 0; ia < ucell.atoms[it].na; ++ia) - { - sum += ucell.atoms[it].taud[ia][i]; - } - dipole_ion[i] += sum * ucell.atoms[it].ncpp.zv; - } - dipole_ion[i] *= ucell.lat0 / bmod[i]; //* ModuleBase::FOUR_PI / ucell.omega; - } - - std::cout << std::setprecision(8) << "dipole_ion_x: " << dipole_ion[0] << std::endl; - std::cout << std::setprecision(8) << "dipole_ion_y: " << dipole_ion[1] << std::endl; - std::cout << std::setprecision(8) << "dipole_ion_z: " << dipole_ion[2] << std::endl; - - double dipole[3] = {0.0}; - for (int i = 0; i < 3; ++i) - { - dipole[i] = dipole_ion[i] - dipole_elec[i]; - } - std::cout << std::setprecision(8) << "dipole_x: " << dipole[0] << std::endl; - std::cout << std::setprecision(8) << "dipole_y: " << dipole[1] << std::endl; - std::cout << std::setprecision(8) << "dipole_z: " << dipole[2] << std::endl; - dipole_sum = sqrt(dipole[0] * dipole[0] + dipole[1] * dipole[1] + dipole[2] * dipole[2]); - std::cout << std::setprecision(8) << "dipole_sum: " << dipole_sum << std::endl; - -#endif - - if (GlobalV::MY_RANK == 0) - { - end = time(NULL); - ModuleBase::GlobalFunc::OUT_TIME("write_dipole", start, end); - ofs.close(); - } - - return; -} - -double ModuleIO::prepare(const UnitCell& cell, int& dir) -{ - double bvec[3] = {0.0}; - double bmod = 0.0; - if (dir == 0) - { - bvec[0] = cell.G.e11; - bvec[1] = cell.G.e12; - bvec[2] = cell.G.e13; - } - else if (dir == 1) - { - bvec[0] = cell.G.e21; - bvec[1] = cell.G.e22; - bvec[2] = cell.G.e23; - } - else if (dir == 2) - { - bvec[0] = cell.G.e31; - bvec[1] = cell.G.e32; - bvec[2] = cell.G.e33; - } - else - { - ModuleBase::WARNING_QUIT("ModuleIO::prepare", "direction is wrong!"); - } - bmod = sqrt(pow(bvec[0], 2) + pow(bvec[1], 2) + pow(bvec[2], 2)); - return bmod; -} diff --git a/source/module_io/write_dmr.cpp b/source/module_io/write_dmr.cpp deleted file mode 100644 index 6aaa48583c..0000000000 --- a/source/module_io/write_dmr.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "write_dmr.h" - -#include "module_parameter/parameter.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "module_hamilt_lcao/module_hcontainer/output_hcontainer.h" -#include "source_pw/hamilt_pwdft/global.h" - -#include - -namespace ModuleIO -{ -std::string dmr_gen_fname(const int out_type, const int ispin, const bool append, const int istep) -{ - std::string fname = "dmr.csr"; - if (out_type == 1) - { - if (!append && istep >= 0) - { - // spa stands for sparse - fname = "dmrs" + std::to_string(ispin+1) + "g" + std::to_string(istep + 1) + "_nao.csr"; - } - else - { - fname = "dmrs" + std::to_string(ispin+1) + "_nao.csr"; - } - } - else if (out_type == 2) - { - fname = "dmrs" + std::to_string(ispin+1) + "_nao.npz"; - } - else - { - ModuleBase::WARNING("write_dmr", "the output type of density matrix DM(R) should be csr or npz."); - } - return fname; -} - -void write_dmr_csr(std::string& fname, hamilt::HContainer* dm_serial, const int istep) -{ - // write the head: ION step number, basis number and R loop number - - std::ofstream ofs; - - // mohan update 2025-05-26 - if(istep<=0) - { - ofs.open(fname); - } - else if(istep>0) - { - ofs.open(fname, std::ios::app); - } - - ofs << "IONIC_STEP: " << istep+1 << std::endl; - ofs << "Matrix Dimension of DM(R): " << dm_serial->get_nbasis() << std::endl; - ofs << "Matrix number of DM(R): " << dm_serial->size_R_loop() << std::endl; - - // write HR_serial to ofs - const double sparse_threshold = 1e-10; - const int precision = 8; - hamilt::Output_HContainer out_dmr(dm_serial, ofs, sparse_threshold, precision); - out_dmr.write(); - ofs.close(); -} - -void write_dmr(const std::vector*> dmr, - const Parallel_2D& paraV, - const bool append, - const int* iat2iwt, - const int nat, - const int istep) -{ - for (int ispin = 0; ispin < dmr.size(); ispin++) - { - const int nbasis = dmr[ispin]->get_nbasis(); - // gather the parallel matrix to serial matrix -#ifdef __MPI - Parallel_Orbitals serialV; - serialV.init(nbasis, nbasis, nbasis, paraV.comm()); - serialV.set_serial(nbasis, nbasis); - serialV.set_atomic_trace(iat2iwt, nat, nbasis); - hamilt::HContainer dm_serial(&serialV); - hamilt::gatherParallels(*dmr[ispin], &dm_serial, 0); -#else - hamilt::HContainer dm_serial(*dmr[ispin]); -#endif - if (GlobalV::MY_RANK == 0) - { - std::string fname = PARAM.globalv.global_out_dir + dmr_gen_fname(1, ispin, append, istep); - write_dmr_csr(fname, &dm_serial, istep); - } - } -} - -} // namespace ModuleIO diff --git a/source/module_io/write_dmr.h b/source/module_io/write_dmr.h deleted file mode 100644 index 14f6f542eb..0000000000 --- a/source/module_io/write_dmr.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef MODULE_IO_WRITE_DMR_H -#define MODULE_IO_WRITE_DMR_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include - -namespace ModuleIO -{ - -/** - * Generates a filename for the DMR output based on the given parameters. - * - * @param out_type The output type. 1: csr, 2: npz. - * @param ispin The spin value, starting from 0. - * @param append A boolean indicating whether append the data to one file or create a new file. - * @param istep The ION step (default: -1), starting from 0. - * @return The generated filename as a string. - */ -std::string dmr_gen_fname(const int out_type, const int ispin, const bool append = true, const int istep = -1); - -/** - * Writes HContainer to a csr file. - * - * @param fname The name of the file to write the CSR representation to. - * @param dm_serial A pointer to the Hamiltonian container. - * @param istep The current step number. - */ -void write_dmr_csr(std::string& fname, hamilt::HContainer* dm_serial, const int istep); - -/** - * Writes DMR to a file. - * - * @param dmr The 2D block parallel matrix representing the density matrix. The first dimension is the spin index. - * @param paraV The parallel 2D object. - * @param out_type The output file type. 1: csr, 2: npz. - * @param sparse Whether output the sparse DM. - * @param ispin The spin index, starting from 0. - * @param append Whether to append the data to an existing file or create a new file. The file name is related to this - * flag. - * @param istep The ION step, starting from 0. - */ -void write_dmr(const std::vector*> dmr, - const Parallel_2D& paraV, - const bool append, - const int* iat2iwt, - const int nat, - const int istep); -} // namespace ModuleIO - -#endif diff --git a/source/module_io/write_dos_lcao.cpp b/source/module_io/write_dos_lcao.cpp deleted file mode 100644 index c39ec605ee..0000000000 --- a/source/module_io/write_dos_lcao.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "write_dos_lcao.h" -#include "cal_dos.h" -#include "cal_pdos_gamma.h" -#include "cal_pdos_multik.h" -#include "nscf_fermi_surf.h" -#include "module_parameter/parameter.h" - -namespace ModuleIO -{ - -template -void write_dos_lcao( - const psi::Psi* psi, - hamilt::Hamilt* 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 bool out_app_flag, - const int istep, - std::ofstream &ofs_running) -{ - ModuleBase::TITLE("ModuleIO", "write_dos_lcao"); - - const int nspin0 = (PARAM.inp.nspin == 2) ? 2 : 1; - - double emax = 0.0; - double emin = 0.0; - - prepare_dos(ofs_running, - energy_fermi, - ekb, - kv.get_nks(), - nbands, - dos_edelta_ev, - dos_scale, - emax, - emin); - - // output the DOS file. - for (int is = 0; is < nspin0; ++is) - { - std::stringstream ss; - - ss << PARAM.globalv.global_out_dir << "doss" << is + 1; - - if(istep>=0) - { - ss << "g" << istep+1; - } - - ss << "_nao.txt"; - - ModuleIO::cal_dos(is, - ss.str(), - dos_edelta_ev, - emax, - emin, - bcoeff, - kv.get_nks(), - kv.get_nkstot(), - kv.wk, - kv.isk, - nbands, - ekb, - wg); - } - - - if (PARAM.inp.out_dos == 2) - { - cal_pdos(psi, - p_ham, - pv, - ucell, - kv, - nspin0, - nbands, - ekb, - emax, - emin, - dos_edelta_ev, - bcoeff); - } - - if(PARAM.inp.out_dos == 3) - { - for (int is = 0; is < nspin0; is++) - { - std::stringstream ss3; - ss3 << PARAM.globalv.global_out_dir << "fermi" << is << ".bxsf"; - nscf_fermi_surface(ss3.str(), nbands, energy_fermi.ef, kv, ucell, ekb); - } - } - - ofs_running << " #DOS CALCULATION ENDS# " << std::endl; - - return; -} - - -template void write_dos_lcao( - const psi::Psi* psi, - hamilt::Hamilt* 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 bool out_app_flag, - const int istep, - std::ofstream &ofs_running); - - -template void write_dos_lcao( - const psi::Psi>* psi, - hamilt::Hamilt>* 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 bool out_app_flag, - const int istep, - std::ofstream &ofs_running); - -} diff --git a/source/module_io/write_dos_lcao.h b/source/module_io/write_dos_lcao.h deleted file mode 100644 index 73d21a22a4..0000000000 --- a/source/module_io/write_dos_lcao.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef WRITE_DOS_LCAO_H -#define WRITE_DOS_LCAO_H - -#include "source_base/matrix.h" // use matrix -#include "source_cell/klist.h" // use K_Vectors -#include "source_psi/psi.h" // use psi::Psi -#include "source_hamilt/hamilt.h" // use hamilt::Hamilt -#include "source_basis/module_ao/parallel_orbitals.h" // use Parallel_Orbitals -#include "source_estate/fp_energy.h" // use elecstate::efermi - - -namespace ModuleIO -{ - /// @brief calculate density of states(DOS), - /// partial density of states(PDOS), - /// and mulliken charge for LCAO base - template - void write_dos_lcao( - const psi::Psi* psi, // LCAO wave functions - hamilt::Hamilt* p_ham, // Hamiltonian - const Parallel_Orbitals &pv, // Parallel scheme for LCAO wave functions - const UnitCell& ucell, // Unit cell information - const K_Vectors& kv, // k-point information in Brillouin zone - const int nbands, // Number of bands - const elecstate::efermi &energy_fermi, // Fermi energy - const ModuleBase::matrix& ekb, // Eigenvalues per k-point and band - const ModuleBase::matrix& wg, // Weights of eigenvalues - const double& dos_edelta_ev, // Delta energy - const double& dos_scale, - const double& bcoeff, - const bool out_app_flag, - const int istep, - std::ofstream &ofs_running); -} -#endif diff --git a/source/module_io/write_dos_pw.cpp b/source/module_io/write_dos_pw.cpp deleted file mode 100644 index 04ed63e714..0000000000 --- a/source/module_io/write_dos_pw.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include "write_dos_pw.h" -#include "cal_dos.h" -#include "nscf_fermi_surf.h" -#include "source_base/parallel_reduce.h" -#include "module_parameter/parameter.h" - -void ModuleIO::write_dos_pw( - const UnitCell& ucell, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const K_Vectors& kv, - const int nbands, - const elecstate::efermi &energy_fermi, - const double& dos_edelta_ev, - const double& dos_scale, - const double& bcoeff, - std::ofstream& ofs_running) -{ - ModuleBase::TITLE("ModuleIO", "write_dos_pw"); - - const int nspin0 = (PARAM.inp.nspin == 2) ? 2 : 1; - - double emax = 0.0; - double emin = 0.0; - - prepare_dos(ofs_running, - energy_fermi, - ekb, - kv.get_nks(), - nbands, - dos_edelta_ev, - dos_scale, - emax, - emin); - - for (int is = 0; is < nspin0; ++is) - { - // DOS_ispin contains not smoothed dos - std::stringstream ss; - ss << PARAM.globalv.global_out_dir << "doss" << is + 1 << "_pw.txt"; - - std::stringstream ss1; - ss1 << PARAM.globalv.global_out_dir << "doss" << is + 1 << "s_pw.txt"; - - ModuleBase::GlobalFunc::OUT(ofs_running, "DOS file", ss.str()); - - ModuleIO::cal_dos(is, - ss.str(), - dos_edelta_ev, - emax, - emin, - bcoeff, - kv.get_nks(), - kv.get_nkstot(), - kv.wk, - kv.isk, - nbands, - ekb, - wg); - } - - - if (PARAM.inp.out_dos == 2) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_dos_pw","PW basis do not support PDOS calculations yet."); - } - - if(PARAM.inp.out_dos == 3) - { - for (int is = 0; is < nspin0; is++) - { - std::stringstream ss3; - ss3 << PARAM.globalv.global_out_dir << "fermi" << is << ".bxsf"; - nscf_fermi_surface(ss3.str(), nbands, energy_fermi.ef, kv, ucell, ekb); - } - } - - ofs_running << " #DOS CALCULATION ENDS# " << std::endl; -} diff --git a/source/module_io/write_dos_pw.h b/source/module_io/write_dos_pw.h deleted file mode 100644 index f6ebb398cd..0000000000 --- a/source/module_io/write_dos_pw.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef WRITE_DOS_PW_H -#define WRITE_DOS_PW_H - -#include "source_base/matrix.h" -#include "source_cell/unitcell.h" -#include "source_cell/klist.h" -#include "source_estate/fp_energy.h" - -namespace ModuleIO -{ - /// @brief calculate density of states(DOS) for PW base - void write_dos_pw( - const UnitCell& ucell, - const ModuleBase::matrix &ekb, - const ModuleBase::matrix &wg, - const K_Vectors& kv, - const int nbands, - const elecstate::efermi &energy_fermi, - const double &dos_edelta_ev, - const double &dos_scale, - const double &bcoeff, - std::ofstream& ofs_running); -} -#endif diff --git a/source/module_io/write_eband_terms.hpp b/source/module_io/write_eband_terms.hpp deleted file mode 100644 index fa233e79be..0000000000 --- a/source/module_io/write_eband_terms.hpp +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef WRITE_EBAND_TERMS_HPP -#define WRITE_EBAND_TERMS_HPP - -#include "module_io/write_vxc.hpp" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h" -#include "source_basis/module_nao/two_center_bundle.h" - -namespace ModuleIO -{ -template -void write_eband_terms(const int nspin, - const int nbasis, - const int drank, - const Parallel_Orbitals* pv, - const psi::Psi& 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, - Gint_Gamma& gint_gamma, // mohan add 2024-04-01 - Gint_k& gint_k, // mohan add 2024-04-01 - const K_Vectors& kv, - const ModuleBase::matrix& wg, - Grid_Driver& gd, - const std::vector& orb_cutoff, - const TwoCenterBundle& two_center_bundle -#ifdef __EXX - , - std::vector>>>* Hexxd = nullptr, - std::vector>>>>* Hexxc = nullptr -#endif -) - { - // 0. prepare - const int& nbands = wg.nc; - const int& nspin0 = (nspin == 2) ? 2 : 1; - double etxc = 0.0; - double vtxc = 0.0; - - Parallel_2D p2d; - - set_para2d_MO(*pv, nbands, p2d); - - typename TGint::type* gint = nullptr; - - set_gint_pointer(gint_gamma, gint_k, gint); - - auto if_gamma_fix = [](hamilt::HContainer& hR) - { - if (std::is_same::value) - { - hR.fix_gamma(); - } - }; - - auto all_band_energy = [&wg](const int ik, const std::vector& e_orb)->double - { - double e = 0; - for (int i = 0; i < e_orb.size(); ++i) { e += e_orb[i] * wg(ik, i); } - return e; - }; - - auto all_k_all_band_energy = [&wg, &all_band_energy](const std::vector>& e_orb)->double - { - double e = 0; - for (int ik = 0; ik < e_orb.size(); ++ik) - { - e += all_band_energy(ik, e_orb[ik]); - } - return e; - }; - - // 1. kinetic - if (PARAM.inp.t_in_h) - { - hamilt::HS_Matrix_K kinetic_k_ao(pv, 1); - hamilt::HContainer kinetic_R_ao(pv); - if_gamma_fix(kinetic_R_ao); - - hamilt::EkineticNew> kinetic_op(&kinetic_k_ao, kv.kvec_d, - &kinetic_R_ao, &ucell, orb_cutoff, &gd, two_center_bundle.kinetic_orb.get()); - - kinetic_op.contributeHR(); - - std::vector> e_orb_kinetic; - - for (int ik = 0;ik < kv.get_nks();++ik) - { - kinetic_k_ao.set_zero_hk(); - dynamic_cast*>(&kinetic_op)->contributeHk(ik); - e_orb_kinetic.emplace_back(orbital_energy(ik, nbands, - cVc(kinetic_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d), p2d)); - } - - write_orb_energy(kv, nspin0, nbands, e_orb_kinetic, "kinetic", ""); - } - - // 2. pp: local - if (PARAM.inp.vl_in_h) - { - elecstate::Potential pot_local(&rhod_basis, &rho_basis, &ucell, &vloc, &sf, &solvent, &etxc, &vtxc); - pot_local.pot_register({ "local" }); - pot_local.update_from_charge(&chg, &ucell); - hamilt::HS_Matrix_K v_pp_local_k_ao(pv, 1); - hamilt::HContainer v_pp_local_R_ao(pv); - if_gamma_fix(v_pp_local_R_ao); - std::vector> e_orb_pp_local; - - hamilt::Veff> v_pp_local_op(gint, - &v_pp_local_k_ao, - kv.kvec_d, - &pot_local, - &v_pp_local_R_ao, - &ucell, - orb_cutoff, - &gd, - nspin); - - v_pp_local_op.contributeHR(); - for (int ik = 0;ik < kv.get_nks();++ik) - { - v_pp_local_k_ao.set_zero_hk(); - dynamic_cast*>(&v_pp_local_op)->contributeHk(ik); - e_orb_pp_local.emplace_back(orbital_energy(ik, nbands, - cVc(v_pp_local_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d), p2d)); - } - write_orb_energy(kv, nspin0, nbands, e_orb_pp_local, "vpp_local", ""); - } - - // 3. pp: nonlocal - if (PARAM.inp.vnl_in_h) - { - hamilt::HS_Matrix_K v_pp_nonlocal_k_ao(pv, 1); - hamilt::HContainer v_pp_nonlocal_R_ao(pv); - if_gamma_fix(v_pp_nonlocal_R_ao); - std::vector> e_orb_pp_nonlocal; - hamilt::NonlocalNew> v_pp_nonlocal_op(&v_pp_nonlocal_k_ao, kv.kvec_d, - &v_pp_nonlocal_R_ao, &ucell, orb_cutoff, &gd, two_center_bundle.overlap_orb_beta.get()); - v_pp_nonlocal_op.contributeHR(); - for (int ik = 0;ik < kv.get_nks();++ik) - { - v_pp_nonlocal_k_ao.set_zero_hk(); - dynamic_cast*>(&v_pp_nonlocal_op)->contributeHk(ik); - e_orb_pp_nonlocal.emplace_back(orbital_energy(ik, nbands, - cVc(v_pp_nonlocal_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d), p2d)); - } - write_orb_energy(kv, nspin0, nbands, e_orb_pp_nonlocal, "vpp_nonlocal", ""); - } - - // 4. hartree - if (PARAM.inp.vh_in_h) - { - elecstate::Potential pot_hartree(&rhod_basis, &rho_basis, &ucell, &vloc, &sf, &solvent, &etxc, &vtxc); - pot_hartree.pot_register({ "hartree" }); - pot_hartree.update_from_charge(&chg, &ucell); - std::vector> v_hartree_R_ao(nspin0, hamilt::HContainer(pv)); - for (int is = 0; is < nspin0; ++is) - { - v_hartree_R_ao[is].set_zero(); - if_gamma_fix(v_hartree_R_ao[is]); - } - hamilt::HS_Matrix_K v_hartree_k_ao(pv, 1); - std::vector>*> v_hartree_op(nspin0); - for (int is = 0; is < nspin0; ++is) - { - v_hartree_op[is] = new hamilt::Veff>(gint, - &v_hartree_k_ao, kv.kvec_d, &pot_hartree, &v_hartree_R_ao[is], &ucell, orb_cutoff, &gd, nspin); - v_hartree_op[is]->contributeHR(); - } - std::vector> e_orb_hartree; - for (int ik = 0;ik < kv.get_nks();++ik) - { - int is = kv.isk[ik]; - v_hartree_k_ao.set_zero_hk(); - dynamic_cast*>(v_hartree_op[is])->contributeHk(ik); - e_orb_hartree.emplace_back(orbital_energy(ik, nbands, - cVc(v_hartree_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d), p2d)); - } - for (auto& op : v_hartree_op) { delete op; } - write_orb_energy(kv, nspin0, nbands, e_orb_hartree, "vhartree", ""); - } - - // 5. xc (including exx) - if (!PARAM.inp.out_mat_xc) // avoid duplicate output - { - write_Vxc(nspin, - nbasis, - drank, - pv, - psi, - ucell, - sf, - solvent, - rho_basis, - rhod_basis, - vloc, - chg, - gint_gamma, - gint_k, - kv, - orb_cutoff, - wg, - gd -#ifdef __EXX - , - Hexxd, - Hexxc -#endif - ); - } - } -} -#endif diff --git a/source/module_io/write_eig_occ.cpp b/source/module_io/write_eig_occ.cpp deleted file mode 100644 index 0c9c8ddc2f..0000000000 --- a/source/module_io/write_eig_occ.cpp +++ /dev/null @@ -1,187 +0,0 @@ -#include "write_eig_occ.h" - -#include "module_parameter/parameter.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/timer.h" -#include "source_base/parallel_comm.h" // use POOL_WORLD - -#ifdef __MPI -#include // use MPI_Barrier -#endif - -void ModuleIO::write_eig_iter(const ModuleBase::matrix &ekb,const ModuleBase::matrix &wg, const K_Vectors& kv) -{ - ModuleBase::TITLE("ModuleIO","write_eig_iter"); - ModuleBase::timer::tick("ModuleIO", "write_eig_iter"); - - GlobalV::ofs_running << "\n PRINT #EIGENVALUES# AND #OCCUPATIONS#" << std::endl; - - const int nspin = PARAM.inp.nspin; - const int nks = kv.get_nks(); - const int nkstot = kv.get_nkstot(); - - std::vector ngk_tot = kv.ngk; - -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, ngk_tot.data(), nks, MPI_INT, MPI_SUM, POOL_WORLD); -#endif - - const int nk_fac = nspin == 2 ? 2 : 1; - const int nks_np = nks / nk_fac; - const int nkstot_np = nkstot / nk_fac; - const int kpar = GlobalV::KPAR; - - for (int is = 0; is < nk_fac; ++is) - { - for (int ip = 0; ip < kpar; ++ip) - { -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - bool ip_flag = PARAM.inp.out_alllog || (GlobalV::RANK_IN_POOL == 0 && GlobalV::MY_BNDGROUP == 0); - - if (GlobalV::MY_POOL == ip && ip_flag) - { - GlobalV::ofs_running << std::setprecision(8); -// ofs_eig << std::setiosflags(std::ios::showpoint); - - const int start_ik = nks_np * is; - const int end_ik = nks_np * (is + 1); - for (int ik = start_ik; ik < end_ik; ++ik) - { - GlobalV::ofs_running << " spin=" << is+1 << " k-point=" - << kv.ik2iktot[ik] + 1 - is * nkstot_np << std::endl; - - GlobalV::ofs_running << std::setw(8) << "Index" - << std::setw(18) << "Eigenvalues(eV)" - << std::setw(18) << "Occupations" << std::endl; - - for (int ib = 0; ib < ekb.nc; ib++) - { - GlobalV::ofs_running << std::setw(8) << ib + 1 - << std::setw(18) << ekb(ik, ib) * ModuleBase::Ry_to_eV - << std::setw(18) << wg(ik, ib) << std::endl; - } - GlobalV::ofs_running << std::endl; - } - } - } -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - } - - ModuleBase::timer::tick("ModuleIO", "write_eig_iter"); -} - -void ModuleIO::write_eig_file(const ModuleBase::matrix &ekb,const ModuleBase::matrix &wg, const K_Vectors& kv) -{ - ModuleBase::TITLE("ModuleIO","write_eig_file"); - ModuleBase::timer::tick("ModuleIO", "write_eig_file"); - - GlobalV::ofs_running << "\n"; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out the eigenvalues and occupations# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - GlobalV::ofs_running << "\n"; - - const int nspin = PARAM.inp.nspin; - const int nks = kv.get_nks(); - const int nkstot = kv.get_nkstot(); - - bool wrong = false; - - for (int ik = 0; ik < nks; ++ik) - { - for (int ib = 0; ib < ekb.nc; ++ib) - { - if (std::abs(ekb(ik, ib)) > 1.0e10) - { - GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 - << " " << ekb(ik, ib) << " Ry" << std::endl; - wrong = true; - } - } - } - -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, &wrong, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD); -#endif - if (wrong) - { - ModuleBase::WARNING_QUIT("ModuleIO::write_eig_file", "Eigenvalues are too large!"); - } - - std::vector ngk_tot = kv.ngk; - -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, ngk_tot.data(), nks, MPI_INT, MPI_SUM, POOL_WORLD); -#endif - - // file name to store eigenvalues - std::string filename = PARAM.globalv.global_out_dir + "eig.txt"; - GlobalV::ofs_running << " Eigenvalues and occupations are in file: " << filename << std::endl; - - if (GlobalV::MY_RANK == 0) - { - std::ofstream ofs_eig0(filename.c_str()); // clear eig.txt - ofs_eig0 << " Electronic state energy (eV) and occupations" << std::endl; - ofs_eig0 << " Spin number " << nspin << std::endl; - ofs_eig0.close(); - } - - const int nk_fac = nspin == 2 ? 2 : 1; - const int nks_np = nks / nk_fac; - const int nkstot_np = nkstot / nk_fac; - const int kpar = GlobalV::KPAR; - - for (int is = 0; is < nk_fac; ++is) - { - for (int ip = 0; ip < kpar; ++ip) - { -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - bool ip_flag = PARAM.inp.out_alllog || (GlobalV::RANK_IN_POOL == 0 && GlobalV::MY_BNDGROUP == 0); - - if (GlobalV::MY_POOL == ip && ip_flag) - { - std::ofstream ofs_eig(filename.c_str(), std::ios::app); - ofs_eig << std::setprecision(8); - ofs_eig << std::setiosflags(std::ios::showpoint); - - const int start_ik = nks_np * is; - const int end_ik = nks_np * (is + 1); - for (int ik = start_ik; ik < end_ik; ++ik) - { - ofs_eig << " spin=" << is+1 << " k-point=" - << kv.ik2iktot[ik] + 1 - is * nkstot_np << "/" << nkstot_np - << " Cartesian=" << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y - << " " << kv.kvec_c[ik].z << " (" << ngk_tot[ik] << " plane wave)" << std::endl; - - ofs_eig << std::setprecision(16); - ofs_eig << std::setiosflags(std::ios::showpoint); - for (int ib = 0; ib < ekb.nc; ib++) - { - ofs_eig << " " << ib + 1 << " " << ekb(ik, ib) * ModuleBase::Ry_to_eV - << " " << wg(ik, ib) << std::endl; - } - ofs_eig << std::endl; - } - - ofs_eig.close(); - } - } -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - } - - ModuleBase::timer::tick("ModuleIO", "write_eig_file"); - return; -} diff --git a/source/module_io/write_eig_occ.h b/source/module_io/write_eig_occ.h deleted file mode 100644 index fe1ffca90c..0000000000 --- a/source/module_io/write_eig_occ.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef WRITE_EIG_OCC_H -#define WRITE_EIG_OCC_H -#include "source_base/matrix.h" -#include "source_cell/klist.h" -#include "source_cell/parallel_kpoints.h" - -namespace ModuleIO -{ - void write_eig_iter(const ModuleBase::matrix &ekb, - const ModuleBase::matrix &wg, - const K_Vectors& kv); - - void write_eig_file(const ModuleBase::matrix &ekb, - const ModuleBase::matrix &wg, - const K_Vectors& kv); -} - -#endif diff --git a/source/module_io/write_elecstat_pot.cpp b/source/module_io/write_elecstat_pot.cpp deleted file mode 100644 index 2959440278..0000000000 --- a/source/module_io/write_elecstat_pot.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include "source_base/element_name.h" -#include "source_base/timer.h" -#include "module_parameter/parameter.h" -#include "source_estate/module_pot/H_Hartree_pw.h" -#include "source_estate/module_pot/efield.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_io/cube_io.h" -#include "module_io/output_log.h" -#include "write_elecstat_pot.h" - -namespace ModuleIO -{ - -void write_elecstat_pot( -#ifdef __MPI - const int& bz, - const int& nbz, -#endif - const std::string& fn, - const int& istep, - ModulePW::PW_Basis* rho_basis, - const Charge* const chr, - const UnitCell* ucell, - const double* v_eff, - const surchem& solvent) -{ - ModuleBase::TITLE("ModuleIO", "write_elecstat_pot"); - ModuleBase::timer::tick("ModuleIO", "write_elecstat_pot"); - - std::vector v_elecstat(rho_basis->nrxx, 0.0); - - const int nspin = PARAM.inp.nspin; - const int efield = PARAM.inp.efield_flag; - const int dip_corr = PARAM.inp.dip_cor_flag; - const bool imp_sol = PARAM.inp.imp_sol; - - //========================================== - // Hartree potential - //========================================== - ModuleBase::matrix vh(nspin, rho_basis->nrxx); - vh = elecstate::H_Hartree_pw::v_hartree(*ucell, rho_basis, nspin, chr->rho); - - //========================================== - //! Dipole correction - //========================================== - ModuleBase::matrix v_efield; - if (efield>0 && dip_corr>0) - { - v_efield.create(nspin, rho_basis->nrxx); - v_efield = elecstate::Efield::add_efield(*ucell, - const_cast(rho_basis), - nspin, - chr->rho, - solvent); - } - - //========================================== - //! Add hartree potential and local pseudopot - //========================================== - for (int ir = 0; ir < rho_basis->nrxx; ir++) - { - // the spin index is 0 - v_elecstat[ir] = vh(0, ir) + v_eff[ir]; - - if (efield>0 && dip_corr>0) - { - v_elecstat[ir] += v_efield(0, ir); - } - if(imp_sol == true) - { - v_elecstat[ir] += solvent.delta_phi[ir]; - } - } - - //------------------------------------------- - //! Get the vacuum level of the system - //------------------------------------------- - ModuleIO::output_vacuum_level(ucell, - chr->rho, - v_elecstat.data(), - rho_basis->nx, - rho_basis->ny, - rho_basis->nz, - rho_basis->nxyz, - rho_basis->nrxx, - rho_basis->nplane, - rho_basis->startz_current); - - //------------------------------------------- - //! Write down the electrostatic potential - //------------------------------------------- - int precision = 9; - int is = -1; - double ef_tmp = 0.0; - int out_fermi = 0; - - ModuleIO::write_vdata_palgrid(*chr->pgrid, - v_elecstat.data(), - is, - nspin, - istep, - fn, - ef_tmp, - ucell, - precision, - out_fermi); - - ModuleBase::timer::tick("ModuleIO", "write_elecstat_pot"); - return; -} - -} // namespace ModuleIO diff --git a/source/module_io/write_elecstat_pot.h b/source/module_io/write_elecstat_pot.h deleted file mode 100644 index 76c90bf70d..0000000000 --- a/source/module_io/write_elecstat_pot.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef POTENTIAL_IO_H -#define POTENTIAL_IO_H -#include "source_basis/module_pw/pw_basis.h" -#include "source_cell/unitcell.h" -#include "source_estate/module_charge/charge.h" -#include "source_hamilt/module_surchem/surchem.h" - -#include - -namespace ModuleIO -{ - -/// @brief write electric static potential to file -/// @param bz -/// @param nbz -/// @param fn -/// @param istep -/// @param rho_basis -/// @param chr -/// @param ucell_ -/// @param v_effective_fixed -void write_elecstat_pot( -#ifdef __MPI - const int& bz, - const int& nbz, -#endif - const std::string& fn, - const int& istep, - ModulePW::PW_Basis* rho_basis, - const Charge* const chr, - const UnitCell* ucell_, - const double* v_effective_fixed, - const surchem& solvent); - -} // namespace ModuleIO - -#endif // POTENTIAL_IO_H diff --git a/source/module_io/write_elf.cpp b/source/module_io/write_elf.cpp deleted file mode 100644 index be24410504..0000000000 --- a/source/module_io/write_elf.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include "write_elf.h" -#include "module_io/cube_io.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace ModuleIO -{ -void write_elf( -#ifdef __MPI - const int& bz, - const int& nbz, -#endif - const std::string& out_dir, - const int& istep, - const int& nspin, - const double* const* rho, - const double* const* tau, - ModulePW::PW_Basis* rho_basis, - const Parallel_Grid& pgrid, - const UnitCell* ucell_, - const int& precision) -{ - std::vector> elf(nspin, std::vector(rho_basis->nrxx, 0.)); - // 1) calculate the kinetic energy density of vW KEDF - std::vector> tau_vw(nspin, std::vector(rho_basis->nrxx, 0.)); - std::vector phi(rho_basis->nrxx, 0.); // phi = sqrt(rho) - - for (int is = 0; is < nspin; ++is) - { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) - { - phi[ir] = std::sqrt(std::abs(rho[is][ir])); - } - - std::vector> gradient_phi(3, std::vector(rho_basis->nrxx, 0.)); - std::vector> recip_phi(rho_basis->npw, 0.0); - std::vector> recip_gradient_phi(rho_basis->npw, 0.0); - - rho_basis->real2recip(phi.data(), recip_phi.data()); - - std::complex img(0.0, 1.0); - for (int j = 0; j < 3; ++j) - { - for (int ip = 0; ip < rho_basis->npw; ++ip) - { - recip_gradient_phi[ip] = img * rho_basis->gcar[ip][j] * recip_phi[ip] * rho_basis->tpiba; - } - - rho_basis->recip2real(recip_gradient_phi.data(), gradient_phi[j].data()); - - for (int ir = 0; ir < rho_basis->nrxx; ++ir) - { - tau_vw[is][ir] += gradient_phi[j][ir] * gradient_phi[j][ir] / 2. * 2.; // convert Ha to Ry. - } - } - } - - // 2) calculate the kinetic energy density of TF KEDF - std::vector> tau_TF(nspin, std::vector(rho_basis->nrxx, 0.)); - const double c_tf - = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0) - * 2.0; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2) - if (nspin == 1) - { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) - { - tau_TF[0][ir] = c_tf * std::pow(rho[0][ir], 5.0 / 3.0); - } - } - else if (nspin == 2) - { - for (int is = 0; is < nspin; ++is) - { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) - { - tau_TF[is][ir] = 0.5 * c_tf * std::pow(2.0 * rho[is][ir], 5.0 / 3.0); - } - } - } - - // 3) calculate the enhancement factor F = (tau_KS - tau_vw) / tau_TF, and then ELF = 1 / (1 + F^2) - double eps = 1.0e-5; // suppress the numerical instability in LCAO (Ref: Acta Phys. -Chim. Sin. 2011, 27(12), 2786-2792. doi: 10.3866/PKU.WHXB20112786) - for (int is = 0; is < nspin; ++is) - { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) - { - elf[is][ir] = (tau[is][ir] - tau_vw[is][ir] + eps) / tau_TF[is][ir]; - elf[is][ir] = 1. / (1. + elf[is][ir] * elf[is][ir]); - } - } - - // 4) output the ELF = 1 / (1 + F^2) to cube file - double ef_tmp = 0.0; - int out_fermi = 0; - - if (nspin == 1) - { - std::string fn = out_dir + "/ELF.cube"; - - int is = -1; - ModuleIO::write_vdata_palgrid(pgrid, - elf[0].data(), - is, - nspin, - istep, - fn, - ef_tmp, - ucell_, - precision, - out_fermi); - } - else if (nspin == 2) - { - for (int is = 0; is < nspin; ++is) - { - std::string fn_temp = out_dir + "/ELF_SPIN" + std::to_string(is + 1) + ".cube"; - int ispin = is + 1; - - ModuleIO::write_vdata_palgrid(pgrid, - elf[is].data(), - ispin, - nspin, - istep, - fn_temp, - ef_tmp, - ucell_, - precision, - out_fermi); - } - - std::vector elf_tot(rho_basis->nrxx, 0.0); - for (int ir = 0; ir < rho_basis->nrxx; ++ir) - { - elf_tot[ir] = (tau[0][ir] + tau[1][ir] - tau_vw[0][ir] - tau_vw[1][ir]) / (tau_TF[0][ir] + tau_TF[1][ir]); - elf_tot[ir] = 1. / (1. + elf_tot[ir] * elf_tot[ir]); - } - std::string fn = out_dir + "/ELF.cube"; - - int is = -1; - ModuleIO::write_vdata_palgrid(pgrid, - elf_tot.data(), - is, - nspin, - istep, - fn, - ef_tmp, - ucell_, - precision, - out_fermi); - } -} -} \ No newline at end of file diff --git a/source/module_io/write_elf.h b/source/module_io/write_elf.h deleted file mode 100644 index 6cc71434f6..0000000000 --- a/source/module_io/write_elf.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef WRITE_ELF_H -#define WRITE_ELF_H -#include -#include "source_cell/unitcell.h" -#include "source_basis/module_pw/pw_basis.h" -#include "source_estate/module_charge/charge.h" - -namespace ModuleIO -{ -void write_elf( -#ifdef __MPI - const int& bz, - const int& nbz, -#endif - const std::string& out_dir, - const int& istep, - const int& nspin, - const double* const* rho, - const double* const* tau, - ModulePW::PW_Basis* rho_basis, - const Parallel_Grid& pgrid, - const UnitCell* ucell_, - const int& precision); -} - -#endif \ No newline at end of file diff --git a/source/module_io/write_libxc_r.cpp b/source/module_io/write_libxc_r.cpp deleted file mode 100644 index 195126eafd..0000000000 --- a/source/module_io/write_libxc_r.cpp +++ /dev/null @@ -1,448 +0,0 @@ -//====================== -// AUTHOR : Peize Lin -// DATE : 2024-09-12 -//====================== - -#ifdef USE_LIBXC - -#include "write_libxc_r.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "source_hamilt/module_xc/xc_functional_libxc.h" -#include "source_estate/module_charge/charge.h" -#include "source_basis/module_pw/pw_basis_big.h" -#include "source_basis/module_pw/pw_basis.h" -#include "module_io/cube_io.h" -#include "source_base/global_variable.h" -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" - -#include -#include -#include -#include -#include - -void ModuleIO::write_libxc_r( - const int order, - const std::vector &func_id, - const int &nrxx, // number of real-space grid - const double &omega, // volume of cell - const double tpiba, - const Charge &chr, - const ModulePW::PW_Basis_Big &pw_big, - const ModulePW::PW_Basis &pw_rhod) -{ - ModuleBase::TITLE("ModuleIO","write_libxc_r"); - ModuleBase::timer::tick("ModuleIO","write_libxc_r"); - - const int nspin = - (PARAM.inp.nspin == 1 || ( PARAM.inp.nspin ==4 && !PARAM.globalv.domag && !PARAM.globalv.domag_z)) - ? 1 : 2; - - //---------------------------------------------------------- - // xc_func_type is defined in Libxc package - // to understand the usage of xc_func_type, - // use can check on website, for example: - // https://www.tddft.org/programs/libxc/manual/libxc-5.1.x/ - //---------------------------------------------------------- - - std::vector funcs = XC_Functional_Libxc::init_func( func_id, (1==nspin) ? XC_UNPOLARIZED:XC_POLARIZED ); - - const bool is_gga = [&funcs]() - { - for( xc_func_type &func : funcs ) - { - switch( func.info->family ) - { - case XC_FAMILY_GGA: - case XC_FAMILY_HYB_GGA: - return true; - } - } - return false; - }(); - - // converting rho - std::vector rho; - std::vector amag; - if(1==nspin || 2==PARAM.inp.nspin) - { - rho = XC_Functional_Libxc::convert_rho(nspin, nrxx, &chr); - } - else - { - std::tuple,std::vector> rho_amag = XC_Functional_Libxc::convert_rho_amag_nspin4(nspin, nrxx, &chr); - rho = std::get<0>(std::move(rho_amag)); - amag = std::get<1>(std::move(rho_amag)); - } - - std::vector sigma; - if(is_gga) - { - const std::vector>> gdr = XC_Functional_Libxc::cal_gdr(nspin, nrxx, rho, tpiba, &chr); - sigma = XC_Functional_Libxc::convert_sigma(gdr); - } - - std::vector exc; - std::vector vrho; - std::vector vsigma; - std::vector v2rho2; - std::vector v2rhosigma; - std::vector v2sigma2; - std::vector v3rho3; - std::vector v3rho2sigma; - std::vector v3rhosigma2; - std::vector v3sigma3; - std::vector v4rho4; - std::vector v4rho3sigma; - std::vector v4rho2sigma2; - std::vector v4rhosigma3; - std::vector v4sigma4; - // attention: order 4321 don't break - switch( order ) - { - case 4: v4rho4.resize( nrxx * ((1==nspin)?1:5) ); - case 3: v3rho3.resize( nrxx * ((1==nspin)?1:4) ); - case 2: v2rho2.resize( nrxx * ((1==nspin)?1:3) ); - case 1: vrho .resize( nrxx * nspin ); - case 0: exc .resize( nrxx ); - break; - default: throw std::domain_error("order ="+std::to_string(order) - +" unfinished in "+std::string(__FILE__)+" line "+std::to_string(__LINE__)); - break; - } - if(is_gga) - { - switch( order ) - { - case 4: v4rho3sigma .resize( nrxx * ((1==nspin)?1:12) ); - v4rho2sigma2.resize( nrxx * ((1==nspin)?1:15) ); - v4rhosigma3 .resize( nrxx * ((1==nspin)?1:20) ); - v4sigma4 .resize( nrxx * ((1==nspin)?1:15) ); - case 3: v3rho2sigma .resize( nrxx * ((1==nspin)?1:9) ); - v3rhosigma2 .resize( nrxx * ((1==nspin)?1:12) ); - v3sigma3 .resize( nrxx * ((1==nspin)?1:10) ); - case 2: v2rhosigma .resize( nrxx * ((1==nspin)?1:6) ); - v2sigma2 .resize( nrxx * ((1==nspin)?1:6) ); - case 1: vsigma .resize( nrxx * ((1==nspin)?1:3) ); - case 0: break; - default: throw std::domain_error("order ="+std::to_string(order) - +" unfinished in "+std::string(__FILE__)+" line "+std::to_string(__LINE__)); - break; - } - } - - for( xc_func_type &func : funcs ) - { - // jiyy add for threshold - constexpr double rho_threshold = 1E-6; - constexpr double grho_threshold = 1E-10; - - xc_func_set_dens_threshold(&func, rho_threshold); - - // sgn for threshold mask - const std::vector sgn = XC_Functional_Libxc::cal_sgn(rho_threshold, grho_threshold, func, nspin, nrxx, rho, sigma); - - // call libxc function - // attention: order 432 don't break - switch( func.info->family ) - { - case XC_FAMILY_LDA: - { - switch( order ) - { - case 4: xc_lda_lxc ( &func, nrxx, rho.data(), v4rho4.data() ); - case 3: xc_lda_kxc ( &func, nrxx, rho.data(), v3rho3.data() ); - case 2: xc_lda_fxc ( &func, nrxx, rho.data(), v2rho2.data() ); - case 1: xc_lda_exc_vxc( &func, nrxx, rho.data(), exc.data(), vrho.data() ); - break; - case 0: xc_lda_exc ( &func, nrxx, rho.data(), exc.data() ); - break; - default: throw std::domain_error("order ="+std::to_string(order) - +" unfinished in "+std::string(__FILE__)+" line "+std::to_string(__LINE__)); - break; - } - break; - } - case XC_FAMILY_GGA: - case XC_FAMILY_HYB_GGA: - { - switch( order ) - { - case 4: xc_gga_lxc ( &func, nrxx, rho.data(), sigma.data(), v4rho4.data(), v4rho3sigma.data(), v4rho2sigma2.data(), v4rhosigma3.data(), v4sigma4.data() ); - case 3: xc_gga_kxc ( &func, nrxx, rho.data(), sigma.data(), v3rho3.data(), v3rho2sigma.data(), v3rhosigma2.data(), v3sigma3.data() ); - case 2: xc_gga_fxc ( &func, nrxx, rho.data(), sigma.data(), v2rho2.data(), v2rhosigma.data(), v2sigma2.data() ); - case 1: xc_gga_exc_vxc( &func, nrxx, rho.data(), sigma.data(), exc.data(), vrho.data(), vsigma.data() ); - break; - case 0: xc_gga_exc ( &func, nrxx, rho.data(), sigma.data(), exc.data() ); - break; - default: throw std::domain_error("order ="+std::to_string(order) - +" unfinished in "+std::string(__FILE__)+" line "+std::to_string(__LINE__)); - break; - } - break; - } - default: - { - throw std::domain_error("func.info->family ="+std::to_string(func.info->family) - +" unfinished in "+std::string(__FILE__)+" line "+std::to_string(__LINE__)); - break; - } - } // end switch( func.info->family ) - } // end for( xc_func_type &func : funcs ) - - auto write_data = [&pw_big, &pw_rhod]( - const std::string data_name, - const std::vector &data, - const int number_spin) - { - for(int is=0; is data_cube(nxyz, 0.0); - - // num_z: how many planes on processor 'ip' - std::vector num_z(nproc_in_pool, 0); - for (int iz = 0; iz < nbz; iz++) - { - const int ip = iz % nproc_in_pool; - num_z[ip] += bz; - } - - // start_z: start position of z in - // processor ip. - std::vector start_z(nproc_in_pool, 0); - for (int ip = 1; ip < nproc_in_pool; ip++) - { - start_z[ip] = start_z[ip - 1] + num_z[ip - 1]; - } - - // which_ip: found iz belongs to which ip. - std::vector which_ip(nz, 0); - for (int iz = 0; iz < nz; iz++) - { - for (int ip = 0; ip < nproc_in_pool; ip++) - { - if (iz >= start_z[nproc_in_pool - 1]) - { - which_ip[iz] = nproc_in_pool - 1; - break; - } - else if (iz >= start_z[ip] && iz < start_z[ip + 1]) - { - which_ip[iz] = ip; - break; - } - } - } - - int count = 0; - std::vector zpiece(nxy, 0.0); - - // save the rho one z by one z. - for (int iz = 0; iz < nz; iz++) - { - zpiece.assign(nxy, 0.0); - - // tag must be different for different iz. - const int tag = iz; - MPI_Status ierror; - - // case 1: the first part of rho in processor 0. - if (which_ip[iz] == 0 && rank_in_pool == 0) - { - for (int ixy = 0; ixy < nxy; ixy++) - { - // mohan change to rho_save on 2012-02-10 - // because this can make our next restart calculation lead - // to the same scf_thr as the one saved. - zpiece[ixy] = data[ixy * nplane + (iz - startz_current) * nld]; - } - } - // case 2: > first part rho: send the rho to - // processor 0. - else if (which_ip[iz] == rank_in_pool) - { - for (int ixy = 0; ixy < nxy; ixy++) - { - zpiece[ixy] = data[ixy * nplane + (iz - startz_current) * nld]; - } - MPI_Send(zpiece.data(), nxy, MPI_DOUBLE, 0, tag, POOL_WORLD); - } - - // case 2: > first part rho: processor 0 receive the rho - // from other processors - else if (rank_in_pool == 0) - { - MPI_Recv(zpiece.data(), nxy, MPI_DOUBLE, which_ip[iz], tag, POOL_WORLD, &ierror); - } - - if (my_rank == 0) - { - /// for cube file - for (int ixy = 0; ixy < nxy; ixy++) - { - data_cube[ixy * nz + iz] = zpiece[ixy]; - } - /// for cube file - } - } // end iz - - // for cube file - if (my_rank == 0) - { - for (int ixy = 0; ixy < nxy; ixy++) - { - for (int iz = 0; iz < nz; iz++) - { - ofs_cube << " " << data_cube[ixy * nz + iz]; - if ((iz % n_data_newline == n_data_newline-1) && (iz != nz - 1)) - { - ofs_cube << "\n"; - } - } - ofs_cube << "\n"; - } - } - /// for cube file - } - MPI_Barrier(MPI_COMM_WORLD); -} - -#else // #ifdef __MPI - -void ModuleIO::write_cube_core( - std::ofstream &ofs_cube, - const double*const data, - const int nxy, - const int nz, - const int n_data_newline) -{ - ModuleBase::TITLE("ModuleIO", "write_cube_core"); - for (int ixy = 0; ixy < nxy; ixy++) - { - for (int iz = 0; iz < nz; iz++) - { - ofs_cube << " " << data[iz * nxy + ixy]; - // ++count_cube; - if ((iz % n_data_newline == n_data_newline-1) && (iz != nz - 1)) - { - ofs_cube << "\n"; - } - } - ofs_cube << "\n"; - } -} - -#endif // #ifdef __MPI - -#endif // USE_LIBXC \ No newline at end of file diff --git a/source/module_io/write_libxc_r.h b/source/module_io/write_libxc_r.h deleted file mode 100644 index ad82e68b57..0000000000 --- a/source/module_io/write_libxc_r.h +++ /dev/null @@ -1,54 +0,0 @@ -//====================== -// AUTHOR : Peize Lin -// DATE : 2024-09-12 -//====================== - -#ifndef WRITE_LIBXC_R_H -#define WRITE_LIBXC_R_H - -#ifdef USE_LIBXC - -#include -#include - - class Charge; - namespace ModulePW{ class PW_Basis_Big; } - namespace ModulePW{ class PW_Basis; } - -namespace ModuleIO -{ - extern void write_libxc_r( - const int order, - const std::vector &func_id, - const int &nrxx, // number of real-space grid - const double &omega, // volume of cell - const double tpiba, - const Charge &chr, - const ModulePW::PW_Basis_Big &pw_big, - const ModulePW::PW_Basis &pw_rhod); - - #ifdef __MPI - extern void write_cube_core( - std::ofstream &ofs_cube, - const int bz, - const int nbz, - const int nplane, - const int startz_current, - const double*const data, - const int nxy, - const int nz, - const int nld, - const int n_data_newline); - #else - extern void write_cube_core( - std::ofstream &ofs_cube, - const double*const data, - const int nxy, - const int nz, - const int n_data_newline); - #endif -} - -#endif // USE_LIBXC - -#endif // WRITE_LIBXC_R_H \ No newline at end of file diff --git a/source/module_io/write_mlkedf_descriptors.cpp b/source/module_io/write_mlkedf_descriptors.cpp deleted file mode 100644 index b758f7a047..0000000000 --- a/source/module_io/write_mlkedf_descriptors.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#ifdef __MLALGO - -#include "write_mlkedf_descriptors.h" - -#include "npy.hpp" -#include "source_estate/module_charge/symmetry_rho.h" - -namespace ModuleIO -{ -void Write_MLKEDF_Descriptors::generateTrainData_KS( - const std::string& out_dir, - psi::Psi> *psi, - elecstate::ElecState *pelec, - ModulePW::PW_Basis_K *pw_psi, - ModulePW::PW_Basis *pw_rho, - UnitCell& ucell, - const double* veff -) -{ - std::vector> nablaRho(3, std::vector(this->cal_tool->nx, 0.)); - - this->generate_descriptor(out_dir, pelec->charge->rho, pw_rho, nablaRho); - - std::vector container(this->cal_tool->nx); - std::vector containernl(this->cal_tool->nx); - - const long unsigned cshape[] = {(long unsigned) this->cal_tool->nx}; // shape of container and containernl - // enhancement factor of Pauli energy, and Pauli potential - this->cal_tool->getF_KS(psi, pelec, pw_psi, pw_rho, ucell, nablaRho, container, containernl); - - Symmetry_rho srho; - - Charge* ptempRho = new Charge(); - ptempRho->nspin = PARAM.inp.nspin; - ptempRho->nrxx = this->cal_tool->nx; - ptempRho->rho_core = pelec->charge->rho_core; - ptempRho->rho = new double*[1]; - ptempRho->rho[0] = new double[this->cal_tool->nx]; - ptempRho->rhog = new std::complex*[1]; - ptempRho->rhog[0] = new std::complex[pw_rho->npw]; - - for (int ir = 0; ir < this->cal_tool->nx; ++ir){ - ptempRho->rho[0][ir] = container[ir]; - } - srho.begin(0, *ptempRho, pw_rho, ucell.symm); - for (int ir = 0; ir < this->cal_tool->nx; ++ir){ - container[ir] = ptempRho->rho[0][ir]; - } - - for (int ir = 0; ir < this->cal_tool->nx; ++ir){ - ptempRho->rho[0][ir] = containernl[ir]; - } - srho.begin(0, *ptempRho, pw_rho, ucell.symm); - for (int ir = 0; ir < this->cal_tool->nx; ++ir){ - containernl[ir] = ptempRho->rho[0][ir]; - } - - npy::SaveArrayAsNumpy(out_dir + "/enhancement.npy", false, 1, cshape, container); - npy::SaveArrayAsNumpy(out_dir + "/pauli.npy", false, 1, cshape, containernl); - - for (int ir = 0; ir < this->cal_tool->nx; ++ir) - { - container[ir] = veff[ir]; - } - npy::SaveArrayAsNumpy(out_dir + "/veff.npy", false, 1, cshape, container); - - delete ptempRho; -} - -void Write_MLKEDF_Descriptors::generate_descriptor( - const std::string& out_dir, - const double * const *prho, - ModulePW::PW_Basis *pw_rho, - std::vector> &nablaRho -) -{ - // container which will contain gamma, p, q in turn - std::vector container(this->cal_tool->nx); - std::vector new_container(this->cal_tool->nx); - // container contains gammanl, pnl, qnl in turn - std::vector containernl(this->cal_tool->nx); - std::vector new_containernl(this->cal_tool->nx); - - const long unsigned cshape[] = {(long unsigned) this->cal_tool->nx}; // shape of container and containernl - - // rho - std::vector rho(this->cal_tool->nx); - for (int ir = 0; ir < this->cal_tool->nx; ++ir){ - rho[ir] = prho[0][ir]; - } - npy::SaveArrayAsNumpy(out_dir + "/rho.npy", false, 1, cshape, rho); - - // gamma - this->cal_tool->getGamma(prho, container); - npy::SaveArrayAsNumpy(out_dir + "/gamma.npy", false, 1, cshape, container); - - for (int ik = 0; ik < this->cal_tool->nkernel; ++ik) - { - int ktype = this->cal_tool->kernel_type[ik]; - double kscaling = this->cal_tool->kernel_scaling[ik]; - - // gamma_nl - this->cal_tool->getGammanl(ik, container, pw_rho, containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "gammanl", ktype, kscaling), false, 1, cshape, containernl); - - // xi = gamma_nl/gamma - this->cal_tool->getXi(container, containernl, new_container); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "xi", ktype, kscaling), false, 1, cshape, new_container); - - // tanhxi = tanh(xi) - this->cal_tool->getTanhXi(ik, container, containernl, new_container); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "tanhxi", ktype, kscaling), false, 1, cshape, new_container); - - // (tanhxi)_nl - this->cal_tool->getTanhXi_nl(ik, new_container, pw_rho, new_containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "tanhxi_nl", ktype, kscaling), false, 1, cshape, new_containernl); - } - - // nabla rho - this->cal_tool->getNablaRho(prho, pw_rho, nablaRho); - npy::SaveArrayAsNumpy(out_dir + "/nablaRhox.npy", false, 1, cshape, nablaRho[0]); - npy::SaveArrayAsNumpy(out_dir + "/nablaRhoy.npy", false, 1, cshape, nablaRho[1]); - npy::SaveArrayAsNumpy(out_dir + "/nablaRhoz.npy", false, 1, cshape, nablaRho[2]); - - // p - this->cal_tool->getP(prho, pw_rho, nablaRho, container); - npy::SaveArrayAsNumpy("p.npy", false, 1, cshape, container); - - for (int ik = 0; ik < this->cal_tool->nkernel; ++ik) - { - int ktype = this->cal_tool->kernel_type[ik]; - double kscaling = this->cal_tool->kernel_scaling[ik]; - - // p_nl - this->cal_tool->getPnl(ik, container, pw_rho, containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "pnl", ktype, kscaling), false, 1, cshape, containernl); - - // tanh(p_nl) - this->cal_tool->getTanh_Pnl(ik, containernl, new_containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "tanh_pnl", ktype, kscaling), false, 1, cshape, new_containernl); - - // tanh(p) - this->cal_tool->getTanhP(container, new_container); - npy::SaveArrayAsNumpy(out_dir + "/tanhp.npy", false, 1, cshape, new_container); - - // tanh(p)_nl - this->cal_tool->getTanhP_nl(ik, new_container, pw_rho, new_containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "tanhp_nl", ktype, kscaling), false, 1, cshape, new_containernl); - } - - // q - this->cal_tool->getQ(prho, pw_rho, container); - npy::SaveArrayAsNumpy(out_dir + "/q.npy", false, 1, cshape, container); - - for (int ik = 0; ik < this->cal_tool->nkernel; ++ik) - { - int ktype = this->cal_tool->kernel_type[ik]; - double kscaling = this->cal_tool->kernel_scaling[ik]; - - // q_nl - this->cal_tool->getQnl(ik, container, pw_rho, containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "qnl", ktype, kscaling), false, 1, cshape, containernl); - - // tanh(q_nl) - this->cal_tool->getTanh_Qnl(ik, containernl, new_containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "tanh_qnl", ktype, kscaling), false, 1, cshape, new_containernl); - - // tanh(q) - this->cal_tool->getTanhQ(container, new_container); - npy::SaveArrayAsNumpy(out_dir + "/tanhq.npy", false, 1, cshape, new_container); - - // tanh(q)_nl - this->cal_tool->getTanhQ_nl(ik, new_container, pw_rho, new_containernl); - npy::SaveArrayAsNumpy(this->file_name(out_dir, "tanhq_nl", ktype, kscaling), false, 1, cshape, new_containernl); - } -} - -std::string Write_MLKEDF_Descriptors::file_name( - const std::string& out_dir, - std::string parameter, - const int kernel_type, - const double kernel_scaling -) -{ - std::stringstream ss; - ss << out_dir << "/" << parameter << "_" << kernel_type << "_" << kernel_scaling << ".npy"; - return ss.str(); -} - -} - -#endif \ No newline at end of file diff --git a/source/module_io/write_mlkedf_descriptors.h b/source/module_io/write_mlkedf_descriptors.h deleted file mode 100644 index 56f6ae7d64..0000000000 --- a/source/module_io/write_mlkedf_descriptors.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef Write_MLKEDF_DESCRIPTORS_H -#define Write_MLKEDF_DESCRIPTORS_H - -#ifdef __MLALGO - -#include "module_io/cal_mlkedf_descriptors.h" -#include "source_estate/elecstate_pw.h" - -namespace ModuleIO -{ - -class Write_MLKEDF_Descriptors -{ -public: - Write_MLKEDF_Descriptors() { - this->cal_tool = new Cal_MLKEDF_Descriptors(); - } - - ~Write_MLKEDF_Descriptors() { - if (this->cal_tool != nullptr) { - delete this->cal_tool; - this->cal_tool = nullptr; - } - } - - void generateTrainData_KS( - const std::string& out_dir, - psi::Psi> *psi, - elecstate::ElecState *pelec, - ModulePW::PW_Basis_K *pw_psi, - ModulePW::PW_Basis *pw_rho, - UnitCell& ucell, - const double *veff - ); - void generateTrainData_KS( - const std::string& out_dir, - psi::Psi> *psi, - elecstate::ElecState *pelec, - ModulePW::PW_Basis_K *pw_psi, - ModulePW::PW_Basis *pw_rho, - UnitCell& ucell, - const double *veff - ){} // a mock function - void generate_descriptor( - const std::string& out_dir, - const double * const *prho, - ModulePW::PW_Basis *pw_rho, - std::vector> &nablaRho - ); - - std::string file_name( - const std::string& out_dir, - std::string parameter, - const int kernel_type, - const double kernel_scaling - ); - - Cal_MLKEDF_Descriptors* cal_tool = nullptr; // pointer to the calculation tool -}; - -} // namespace ModuleIO -#endif -#endif \ No newline at end of file diff --git a/source/module_io/write_orb_info.cpp b/source/module_io/write_orb_info.cpp deleted file mode 100644 index 69da61a282..0000000000 --- a/source/module_io/write_orb_info.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "write_orb_info.h" - -#include "module_parameter/parameter.h" -#include "source_base/name_angular.h" -#include "source_cell/atom_spec.h" - -void ModuleIO::write_orb_info(const UnitCell* ucell) -{ - std::stringstream os; - os << PARAM.globalv.global_out_dir << "Orbital"; - std::ofstream out(os.str().c_str()); - out << std::setw(5) << "#io" - << std::setw(8) << "spec" - << std::setw(5) << "l" - << std::setw(5) << "m" - << std::setw(5) << "z" - << std::setw(5) << "sym" << std::endl; - - for (int i = 0; i < ucell->nat; i++) - { - int t = ucell->iat2it[i]; - Atom* atom1 = &ucell->atoms[t]; - for (int j = 0; j < atom1->nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - out << std::setw(5) << i << std::setw(8) << ucell->atoms[t].label << std::setw(5) << L1 - << std::setw(5) << m1 << std::setw(5) << N1 + 1 << std::setw(15) << ModuleBase::Name_Angular[L1][m1] - << std::endl; - } - } - out << std::endl << std::endl; - out << std::setw(5) << "#io" << std::setw(2) << "=" << std::setw(2) << "Orbital index in supercell" << std::endl; - out << std::setw(5) << "#spec" << std::setw(2) << "=" << std::setw(2) << "Atomic species label" << std::endl; - out << std::setw(5) << "#l" << std::setw(2) << "=" << std::setw(2) << "Angular mumentum quantum number" << std::endl; - out << std::setw(5) << "#m" << std::setw(2) << "=" << std::setw(2) << "Magnetic quantum number" << std::endl; - out << std::setw(5) << "#z" << std::setw(2) << "=" << std::setw(2) << "Zeta index of orbital" << std::endl; - out << std::setw(5) << "#sym" << std::setw(2) << "=" << std::setw(2) << "Symmetry name of real orbital" << std::endl; - out.close(); - - return; -} diff --git a/source/module_io/write_orb_info.h b/source/module_io/write_orb_info.h deleted file mode 100644 index c759a3b2d8..0000000000 --- a/source/module_io/write_orb_info.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef WRITE_ORB_INFO -#define WRITE_ORB_INFO -#include "source_cell/unitcell.h" - -namespace ModuleIO -{ - void write_orb_info(const UnitCell* ucell); -} - -#endif diff --git a/source/module_io/write_pao.cpp b/source/module_io/write_pao.cpp deleted file mode 100644 index f145263a03..0000000000 --- a/source/module_io/write_pao.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "write_pao.h" -#include "source_base/global_variable.h" -#include "module_parameter/parameter.h" - -#include -namespace ModuleIO -{ -void print_PAOs(const UnitCell& ucell) -{ - if (GlobalV::MY_RANK != 0) - { - return; - } - for (int it = 0; it < ucell.ntype; it++) - { - for (int icc = 0; icc < ucell.atoms[it].ncpp.nchi; icc++) - { - std::stringstream ss; - ss << PARAM.globalv.global_out_dir << ucell.atoms[it].label << "/" << ucell.atoms[it].label << "-" - << ucell.atoms[it].ncpp.els[icc] << ".ORBITAL"; - - std::ofstream ofs(ss.str().c_str()); - ofs << "Mesh " << ucell.atoms[it].ncpp.msh; - ofs << "\n" << std::setw(15) << "Radial" << std::setw(15) << "Psi" << std::setw(15) << "Rab"; - - for (int i = 0; i < ucell.atoms[it].ncpp.msh; i++) - { - ofs << "\n" - << std::setw(15) << ucell.atoms[it].ncpp.r[i] << std::setw(15) << ucell.atoms[it].ncpp.chi(icc, i) - << std::setw(15) << ucell.atoms[it].ncpp.rab[i]; - } - ofs.close(); - } - // end out put - } - return; -} -} // namespace ModuleIO \ No newline at end of file diff --git a/source/module_io/write_pao.h b/source/module_io/write_pao.h deleted file mode 100644 index 7c188aaaa4..0000000000 --- a/source/module_io/write_pao.h +++ /dev/null @@ -1,10 +0,0 @@ -#include "source_cell/unitcell.h" -namespace ModuleIO -{ - /** - * @brief print chi (PAO) in pseudopotential file - * - * @param ucell - */ - void print_PAOs(const UnitCell& ucell); -} \ No newline at end of file diff --git a/source/module_io/write_proj_band_lcao.cpp b/source/module_io/write_proj_band_lcao.cpp deleted file mode 100644 index 868385ffaa..0000000000 --- a/source/module_io/write_proj_band_lcao.cpp +++ /dev/null @@ -1,401 +0,0 @@ -#include "write_proj_band_lcao.h" - -#include "module_parameter/parameter.h" -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/scalapack_connector.h" -#include "source_base/timer.h" -#include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "write_orb_info.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -template<> -void ModuleIO::write_proj_band_lcao( - const psi::Psi* psi, - const Parallel_Orbitals &pv, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const UnitCell &ucell, - hamilt::Hamilt* p_ham) -{ - ModuleBase::TITLE("ModuleIO", "write_proj_band_lcao"); - ModuleBase::timer::tick("ModuleIO", "write_proj_band_lcao"); - - GlobalV::ofs_running << "\n"; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out projected bands (psi in double)# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - GlobalV::ofs_running << "\n"; - - // get the date pointer of SK - const double* sk = dynamic_cast*>(p_ham)->getSk(); - - int nspin0 = 1; - if (PARAM.inp.nspin == 2) - { - nspin0 = 2; - } - - int nks = 0; - if (nspin0 == 1) - { - nks = kv.get_nkstot(); - } - else if (nspin0 == 2) - { - nks = kv.get_nkstot() / 2; - } - - ModuleBase::ComplexMatrix weightk; - ModuleBase::matrix weight; - int NUM = PARAM.globalv.nlocal * PARAM.inp.nbands * nspin0; - weightk.create(nspin0, PARAM.inp.nbands * PARAM.globalv.nlocal, true); - weight.create(nspin0, PARAM.inp.nbands * PARAM.globalv.nlocal, true); - - - for (int is = 0; is < nspin0; is++) - { - std::vector Mulk; - Mulk.resize(1); - Mulk[0].create(pv.ncol, pv.nrow); - - psi->fix_k(is); - for (int i = 0; i < PARAM.inp.nbands; ++i) - { - const int NB = i + 1; - - const double one_float = 1.0, zero_float = 0.0; - const int one_int = 1; -#ifdef __MPI - const char T_char = 'T'; - pdgemv_(&T_char, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one_float, - sk, - &one_int, - &one_int, - pv.desc, - psi->get_pointer(), - &one_int, - &NB, - pv.desc, - &one_int, - &zero_float, - Mulk[0].c, - &one_int, - &NB, - pv.desc, - &one_int); -#endif - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - - if (pv.in_this_processor(j, i)) - { - const int ir = pv.global2local_row(j); - const int ic = pv.global2local_col(i); - weightk(is, i * PARAM.globalv.nlocal + j) = Mulk[0](ic, ir) * psi[0](ic, ir); - } - } - } // ib -#ifdef __MPI - MPI_Reduce(weightk.real().c, weight.c, NUM, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); -#endif - - if (GlobalV::MY_RANK == 0) - { - std::stringstream ps2; - ps2 << PARAM.globalv.global_out_dir << "pbands" << is + 1 << ".xml"; - GlobalV::ofs_running << " Output projected bands are in file: " << ps2.str() << std::endl; - std::ofstream out(ps2.str().c_str()); - - out << "" << std::endl; - out << "" << PARAM.inp.nspin << "" << std::endl; - if (PARAM.inp.nspin == 4) - { - out << "" << std::setw(2) << PARAM.globalv.nlocal / 2 << "" << std::endl; - } - else - { - out << "" << std::setw(2) << PARAM.globalv.nlocal << "" << std::endl; - } - out << "" - << std::endl; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - out << " " << (pelec->ekb(is * nks, ib)) * ModuleBase::Ry_to_eV; - } - out << std::endl; - out << "" << std::endl; - - for (int i = 0; i < ucell.nat; i++) - { - int a = ucell.iat2ia[i]; - int t = ucell.iat2it[i]; - Atom* atom1 = &ucell.atoms[t]; - const int s0 = ucell.itiaiw2iwt(t, a, 0); - for (int j = 0; j < atom1->nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - const int w = ucell.itiaiw2iwt(t, a, j); - - // out << "" <" << std::endl; - out << "" << std::endl; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2) { - out << std::setw(13) << weight(is, ib * PARAM.globalv.nlocal + w); - } else if (PARAM.inp.nspin == 4) - { - int w0 = w - s0; - out << std::setw(13) - << weight(is, ib * PARAM.globalv.nlocal + s0 + 2 * w0) - + weight(is, ib * PARAM.globalv.nlocal + s0 + 2 * w0 + 1); - } - } - out << std::endl; - out << "" << std::endl; - out << "" << std::endl; - } // j - } // i - - out << "" << std::endl; - out.close(); - } - } // is - ModuleIO::write_orb_info(&ucell); - - ModuleBase::timer::tick("ModuleIO", "write_proj_band_lcao"); - return; -} - -template<> -void ModuleIO::write_proj_band_lcao( - const psi::Psi>* psi, - const Parallel_Orbitals &pv, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const UnitCell& ucell, - hamilt::Hamilt>* p_ham) -{ - ModuleBase::TITLE("ModuleIO", "write_proj_band_lcao"); - ModuleBase::timer::tick("ModuleIO", "write_proj_band_lcao"); - - GlobalV::ofs_running << "\n"; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " | #Print out projected bands (psi in complex)# |" << std::endl; - GlobalV::ofs_running << " | |" << std::endl; - GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - GlobalV::ofs_running << "\n"; - - int nspin0 = 1; - if (PARAM.inp.nspin == 2) - { - nspin0 = 2; - } - int nks = 0; - if (nspin0 == 1) - { - nks = kv.get_nkstot(); - } - else if (nspin0 == 2) - { - nks = kv.get_nkstot() / 2; - } - - ModuleBase::ComplexMatrix weightk; - ModuleBase::matrix weight; - int NUM = PARAM.globalv.nlocal * PARAM.inp.nbands * kv.get_nks(); - weightk.create(kv.get_nks(), PARAM.inp.nbands * PARAM.globalv.nlocal, true); - weight.create(kv.get_nks(), PARAM.inp.nbands * PARAM.globalv.nlocal, true); - - for (int is = 0; is < nspin0; is++) - { - std::vector Mulk; - Mulk.resize(1); - Mulk[0].create(pv.ncol, pv.nrow); - - for (int ik = 0; ik < kv.get_nks(); ik++) - { - if (is == kv.isk[ik]) - { - // calculate SK for current k point - const std::complex* sk = nullptr; - if (PARAM.inp.nspin == 4) - { - dynamic_cast, std::complex>*>(p_ham)->updateSk(ik, 1); - sk = dynamic_cast, std::complex>*>(p_ham)->getSk(); - } - else - { - dynamic_cast, double>*>(p_ham)->updateSk(ik, 1); - sk = dynamic_cast, double>*>(p_ham)->getSk(); - } - - // calculate Mulk - psi->fix_k(ik); - psi::Psi> Dwfc(1, - psi->get_nbands(), - psi->get_nbasis(), - psi->get_nbasis(), - true); - - std::complex* p_dwfc = Dwfc.get_pointer(); - for (int index = 0; index < Dwfc.size(); ++index) - { - p_dwfc[index] = conj(psi->get_pointer()[index]); - } - - for (int i = 0; i < PARAM.inp.nbands; ++i) - { - const int NB = i + 1; - - const double one_float[2] = { 1.0, 0.0 }; - const double zero_float[2] = { 0.0, 0.0 }; - const int one_int = 1; - const char T_char = 'T'; -#ifdef __MPI - pzgemv_(&T_char, - &PARAM.globalv.nlocal, - &PARAM.globalv.nlocal, - &one_float[0], - sk, - &one_int, - &one_int, - pv.desc, - p_dwfc, - &one_int, - &NB, - pv.desc, - &one_int, - &zero_float[0], - Mulk[0].c, - &one_int, - &NB, - pv.desc, - &one_int); -#endif - for (int j = 0; j < PARAM.globalv.nlocal; ++j) - { - - if (pv.in_this_processor(j, i)) - { - - const int ir = pv.global2local_row(j); - const int ic = pv.global2local_col(i); - - weightk(ik, i * PARAM.globalv.nlocal + j) = Mulk[0](ic, ir) * psi[0](ic, ir); - } - } - - } // ib - - } // if - } // ik -#ifdef __MPI - MPI_Reduce(weightk.real().c, weight.c, NUM, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); -#endif - - if (GlobalV::MY_RANK == 0) - { - std::stringstream ps2; - ps2 << PARAM.globalv.global_out_dir << "pbands" << is + 1 << ".xml"; - GlobalV::ofs_running << " Output projected bands in file: " << ps2.str() << std::endl; - std::ofstream out(ps2.str().c_str()); - - out << "" << std::endl; - out << "" << PARAM.inp.nspin << "" << std::endl; - if (PARAM.inp.nspin == 4) - { - out << "" << std::setw(2) << PARAM.globalv.nlocal / 2 << "" << std::endl; - } - else - { - out << "" << std::setw(2) << PARAM.globalv.nlocal << "" << std::endl; - } - - out << "" - << std::endl; - - for (int ik = 0; ik < nks; ik++) - { - for (int ib = 0; ib < PARAM.inp.nbands; ib++) { - out << " " << (pelec->ekb(ik + is * nks, ib)) * ModuleBase::Ry_to_eV; -} - out << std::endl; - } - out << "" << std::endl; - - for (int i = 0; i < ucell.nat; i++) - { - int a = ucell.iat2ia[i]; - int t = ucell.iat2it[i]; - Atom* atom1 = &ucell.atoms[t]; - const int s0 = ucell.itiaiw2iwt(t, a, 0); - for (int j = 0; j < atom1->nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - const int w = ucell.itiaiw2iwt(t, a, j); - - // out << "" <" << std::endl; - out << "" << std::endl; - for (int ik = 0; ik < nks; ik++) - { - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - if (PARAM.inp.nspin == 1) - { - out << std::setw(13) << weight(ik, ib * PARAM.globalv.nlocal + w); - } - else if (PARAM.inp.nspin == 2) - { - out << std::setw(13) << weight(ik + nks * is, ib * PARAM.globalv.nlocal + w); - } - else if (PARAM.inp.nspin == 4) - { - int w0 = w - s0; - out << std::setw(13) - << weight(ik, ib * PARAM.globalv.nlocal + s0 + 2 * w0) - + weight(ik, ib * PARAM.globalv.nlocal + s0 + 2 * w0 + 1); - } - } - out << std::endl; - } - out << "" << std::endl; - out << "" << std::endl; - } // j - } // i - - out << "" << std::endl; - out.close(); - } - } // is - ModuleIO::write_orb_info(&ucell); - - ModuleBase::timer::tick("ModuleIO", "write_proj_band_lcao"); - return; -} diff --git a/source/module_io/write_proj_band_lcao.h b/source/module_io/write_proj_band_lcao.h deleted file mode 100644 index 480d184d5b..0000000000 --- a/source/module_io/write_proj_band_lcao.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef WRITE_PROJ_BAND_LCAO_H -#define WRITE_PROJ_BAND_LCAO_H -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "source_estate/elecstate.h" -#include "source_psi/psi.h" -#include "source_hamilt/hamilt.h" -#include "source_basis/module_ao/parallel_orbitals.h" - -namespace ModuleIO -{ - template - void write_proj_band_lcao( - const psi::Psi* psi, - const Parallel_Orbitals &pv, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const UnitCell &ucell, - hamilt::Hamilt* p_ham); -} - -#endif diff --git a/source/module_io/write_vxc.hpp b/source/module_io/write_vxc.hpp deleted file mode 100644 index 6f6e6ebc6d..0000000000 --- a/source/module_io/write_vxc.hpp +++ /dev/null @@ -1,344 +0,0 @@ -#ifndef __WRITE_VXC_H_ -#define __WRITE_VXC_H_ -#include "module_parameter/parameter.h" -#include "source_base/parallel_reduce.h" -#include "source_base/module_container/base/third_party/blas.h" -#include "source_base/scalapack_connector.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h" -#include "source_psi/psi.h" -#include "module_io/write_HS.h" -#include "module_io/filename.h" // use filename_output function - -#ifndef TGINT_H -#define TGINT_H -template -struct TGint; - -template <> -struct TGint -{ - using type = Gint_Gamma; -}; - -template <> -struct TGint> -{ - using type = Gint_k; -}; -#endif - -namespace ModuleIO -{ - -inline void set_para2d_MO(const Parallel_Orbitals& pv, const int nbands, Parallel_2D& p2d) -{ - std::ofstream ofs; -#ifdef __MPI - p2d.set(nbands, nbands, pv.nb, pv.blacs_ctxt); -#else - p2d.set_serial(nbands, nbands); -#endif -} - -template -inline std::vector cVc(T* V, - T* c, - const int nbasis, - const int nbands, - const Parallel_Orbitals& pv, - const Parallel_2D& p2d) -{ - std::vector Vc(pv.nloc_wfc, 0.0); - char transa = 'N'; - char transb = 'N'; - const T alpha = (T)1.0; - const T beta = (T)0.0; -#ifdef __MPI - const int i1 = 1; - ScalapackConnector::gemm(transa, transb, - nbasis, nbands, nbasis, - alpha, V, i1, i1, pv.desc, - c, i1, i1, pv.desc_wfc, - beta, Vc.data(), i1, i1, pv.desc_wfc); -#else - container::BlasConnector::gemm(transa, transb, nbasis, nbands, nbasis, alpha, V, nbasis, c, nbasis, beta, Vc.data(), nbasis); -#endif - std::vector cVc(p2d.nloc, 0.0); - transa = (std::is_same::value ? 'T' : 'C'); -#ifdef __MPI - ScalapackConnector::gemm(transa, transb, - nbands, nbands, nbasis, - alpha, c, i1, i1, pv.desc_wfc, - Vc.data(), i1, i1, pv.desc_wfc, - beta, cVc.data(), i1, i1, p2d.desc); -#else - container::BlasConnector::gemm(transa, transb, nbands, nbands, nbasis, alpha, c, nbasis, Vc.data(), nbasis, beta, cVc.data(), nbasis); -#endif - return cVc; -} - -inline double get_real(const std::complex& c) -{ - return c.real(); -} - -inline double get_real(const double& d) -{ - return d; -} - -template -double all_band_energy(const int ik, const std::vector& mat_mo, const Parallel_2D& p2d, const ModuleBase::matrix& wg) -{ - double e = 0.0; - for (int i = 0; i < p2d.get_row_size(); ++i) - { - for (int j = 0; j < p2d.get_col_size(); ++j) - { - if (p2d.local2global_row(i) == p2d.local2global_col(j)) - { - e += get_real(mat_mo[j * p2d.get_row_size() + i]) * wg(ik, p2d.local2global_row(i)); - } - } - } - Parallel_Reduce::reduce_all(e); - return e; -} - -template -std::vector orbital_energy(const int ik, const int nbands, const std::vector& mat_mo, const Parallel_2D& p2d) -{ -#ifdef __DEBUG - assert(nbands >= 0); -#endif - std::vector e(nbands, 0.0); - for (int i = 0; i < nbands; ++i) - { - if (p2d.in_this_processor(i, i)) - { - const int index = p2d.global2local_col(i) * p2d.get_row_size() + p2d.global2local_row(i); - e[i] = get_real(mat_mo[index]); - } - } - Parallel_Reduce::reduce_all(e.data(), nbands); - return e; -} - -#ifndef SET_GINT_POINTER_H -#define SET_GINT_POINTER_H -// mohan update 2024-04-01 -template -void set_gint_pointer(Gint_Gamma& gint_gamma, Gint_k& gint_k, typename TGint::type*& gint); - -// mohan update 2024-04-01 -template <> -void set_gint_pointer(Gint_Gamma& gint_gamma, Gint_k& gint_k, typename TGint::type*& gint) -{ - gint = &gint_gamma; -} - -// mohan update 2024-04-01 -template <> -void set_gint_pointer>(Gint_Gamma& gint_gamma, - Gint_k& gint_k, - typename TGint>::type*& gint) -{ - gint = &gint_k; -} -#endif - -inline void write_orb_energy(const K_Vectors& kv, - const int nspin0, const int nbands, - const std::vector>& e_orb, - const std::string& term, const std::string& label, const bool app = false) -{ - assert(e_orb.size() == kv.get_nks()); - const int nk = kv.get_nks() / nspin0; - std::ofstream ofs; - ofs.open(PARAM.globalv.global_out_dir + term + "_" + (label == "" ? "out.dat" : label + "_out.dat"), - app ? std::ios::app : std::ios::out); - ofs << nk << "\n" << nspin0 << "\n" << nbands << "\n"; - ofs << std::scientific << std::setprecision(16); - for (int ik = 0; ik < nk; ++ik) - { - for (int is = 0; is < nspin0; ++is) - { - for (auto e : e_orb[is * nk + ik]) - { // Hartree and eV - ofs << e / 2. << "\t" << e * ModuleBase::Ry_to_eV << "\n"; - } - } - } -} - -/// @brief write the Vxc matrix in KS orbital representation, usefull for GW calculation -/// including terms: local/semi-local XC, EXX, DFTU -template -void write_Vxc(const int nspin, - const int nbasis, - const int drank, - const Parallel_Orbitals* pv, - const psi::Psi& 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, - Gint_Gamma& gint_gamma, // mohan add 2024-04-01 - Gint_k& gint_k, // mohan add 2024-04-01 - const K_Vectors& kv, - const std::vector& orb_cutoff, - const ModuleBase::matrix& wg, - Grid_Driver& gd -#ifdef __EXX - , - std::vector>>>* Hexxd = nullptr, - std::vector>>>>* Hexxc = nullptr -#endif -) -{ - ModuleBase::TITLE("ModuleIO", "write_Vxc"); - int nbands = wg.nc; - // 1. real-space xc potential - // ModuleBase::matrix vr_xc(nspin, chg.nrxx); - double etxc = 0.0; - double vtxc = 0.0; - // elecstate::PotXC* potxc(&rho_basis, &etxc, vtxc, nullptr); - // potxc.cal_v_eff(&chg, &ucell, vr_xc); - elecstate::Potential* potxc - = new elecstate::Potential(&rhod_basis, &rho_basis, &ucell, &vloc, &sf, &solvent, &etxc, &vtxc); - std::vector compnents_list = {"xc"}; - potxc->pot_register(compnents_list); - potxc->update_from_charge(&chg, &ucell); - - // 2. allocate AO-matrix - // R (the number of hR: 1 for nspin=1, 4; 2 for nspin=2) - int nspin0 = (nspin == 2) ? 2 : 1; - std::vector> vxcs_R_ao(nspin0, hamilt::HContainer(ucell, pv)); - for (int is = 0; is < nspin0; ++is) { - vxcs_R_ao[is].set_zero(); - if (std::is_same::value) { vxcs_R_ao[is].fix_gamma(); } - } - // k (size for each k-point) - hamilt::HS_Matrix_K vxc_k_ao(pv, 1); // only hk is needed, sk is skipped - - // 3. allocate operators and contribute HR - // op (corresponding to hR) - typename TGint::type* gint = nullptr; - - set_gint_pointer(gint_gamma, gint_k, gint); - - std::vector>*> vxcs_op_ao(nspin0); - for (int is = 0; is < nspin0; ++is) - { - vxcs_op_ao[is] = new hamilt::Veff>(gint, - &vxc_k_ao, kv.kvec_d, potxc, &vxcs_R_ao[is], &ucell, orb_cutoff, &gd, nspin); - - vxcs_op_ao[is]->contributeHR(); - } - std::vector> e_orb_locxc; // orbital energy (local XC) - std::vector> e_orb_tot; // orbital energy (total) -#ifdef __EXX - hamilt::OperatorEXX> vexx_op_ao(&vxc_k_ao, - &vxcs_R_ao[0],ucell,/*for paraV*/ kv, Hexxd, Hexxc, hamilt::Add_Hexx_Type::k); - hamilt::HS_Matrix_K vexxonly_k_ao(pv, 1); // only hk is needed, sk is skipped - hamilt::OperatorEXX> vexxonly_op_ao(&vexxonly_k_ao, - &vxcs_R_ao[0],ucell,/*for paraV*/ kv, Hexxd, Hexxc, hamilt::Add_Hexx_Type::k); - std::vector> e_orb_exx; // orbital energy (EXX) -#endif - hamilt::OperatorDFTU> vdftu_op_ao(&vxc_k_ao, kv.kvec_d, nullptr, kv.isk); - - // 4. calculate and write the MO-matrix Exc - Parallel_2D p2d; - set_para2d_MO(*pv, nbands, p2d); - - // ======test======= - // double total_energy = 0.0; - // double exx_energy = 0.0; - // ======test======= - for (int ik = 0; ik < kv.get_nks(); ++ik) - { - vxc_k_ao.set_zero_hk(); - int is = kv.isk[ik]; - dynamic_cast*>(vxcs_op_ao[is])->contributeHk(ik); - const std::vector& vlocxc_k_mo = cVc(vxc_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d); - -#ifdef __EXX - if (GlobalC::exx_info.info_global.cal_exx) - { - e_orb_locxc.emplace_back(orbital_energy(ik, nbands, vlocxc_k_mo, p2d)); - ModuleBase::GlobalFunc::ZEROS(vexxonly_k_ao.get_hk(), pv->nloc); - vexx_op_ao.contributeHk(ik); - vexxonly_op_ao.contributeHk(ik); - std::vector vexx_k_mo = cVc(vexxonly_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d); - e_orb_exx.emplace_back(orbital_energy(ik, nbands, vexx_k_mo, p2d)); - // ======test======= - // exx_energy += all_band_energy(ik, vexx_k_mo, p2d, wg); - // ======test======= - } -#endif - if (PARAM.inp.dft_plus_u) - { - vdftu_op_ao.contributeHk(ik); - } - const std::vector& vxc_tot_k_mo = cVc(vxc_k_ao.get_hk(), &psi(ik, 0, 0), nbasis, nbands, *pv, p2d); - e_orb_tot.emplace_back(orbital_energy(ik, nbands, vxc_tot_k_mo, p2d)); - - // write - - // mohan add 2025-06-02 - const int istep = -1; - const int out_label = 1; // 1 means .txt while 2 means .dat - const bool out_app_flag = 0; - const bool gamma_only = PARAM.globalv.gamma_only_local; - - std::string vxc_file = ModuleIO::filename_output( - PARAM.globalv.global_out_dir, - "vxc","nao",ik,kv.ik2iktot,nspin,kv.get_nkstot(), - out_label,out_app_flag,gamma_only,istep); - - ModuleIO::save_mat(istep, - vxc_tot_k_mo.data(), - nbands, - false /*binary*/, - PARAM.inp.out_ndigits, - true /*triangle*/, - out_app_flag /*append*/, - vxc_file, - p2d, - drank); - // ======test======= - // total_energy += all_band_energy(ik, vxc_tot_k_mo, p2d, wg); - // ======test======= - } - // ======test======= - // total_energy -= 0.5 * exx_energy; - // std::cout << "total energy: " << total_energy << std::endl; - // std::cout << "etxc: " << etxc << std::endl; - // std::cout << "vtxc_cal: " << total_energy - 0.5 * exx_energy << std::endl; - // std::cout << "vtxc_ref: " << vtxc << std::endl; - // std::cout << "exx_energy: " << 0.5 * exx_energy << std::endl; - // ======test======= - delete potxc; - for (int is = 0; is < nspin0; ++is) - { - delete vxcs_op_ao[is]; - } - - if (GlobalV::MY_RANK == 0) - { - write_orb_energy(kv, nspin0, nbands, e_orb_tot, "vxc", ""); -#ifdef __EXX - if (GlobalC::exx_info.info_global.cal_exx) - { - write_orb_energy(kv, nspin0, nbands, e_orb_locxc, "vxc", "local"); - write_orb_energy(kv, nspin0, nbands, e_orb_exx, "vxc", "exx"); - } -#endif - } -} -} // namespace ModuleIO -#endif diff --git a/source/module_io/write_vxc_lip.hpp b/source/module_io/write_vxc_lip.hpp deleted file mode 100644 index 8c2414358b..0000000000 --- a/source/module_io/write_vxc_lip.hpp +++ /dev/null @@ -1,296 +0,0 @@ -#ifndef __WRITE_VXC_LIP_H_ -#define __WRITE_VXC_LIP_H_ -#include "module_parameter/parameter.h" -#include "source_base/parallel_reduce.h" -#include "source_base/module_container/base/third_party/blas.h" -#include "source_pw/hamilt_pwdft/operator_pw/veff_pw.h" -#include "source_psi/psi.h" -#include "source_cell/unitcell.h" -#include "source_cell/klist.h" -#include "source_estate/module_pot/potential_new.h" -#include "module_io/write_HS.h" -#include "module_io/filename.h" // use filename_output function -#include - -namespace ModuleIO -{ - template - using Real = typename GetTypeReal::type; - - template - inline FPTYPE get_real(const std::complex& c) - { - return c.real(); - } - template - inline FPTYPE get_real(const FPTYPE& d) - { - return d; - } - - template - std::vector cVc(T* const V, T* const c, int nbasis, int nbands) - { - std::vector Vc(nbasis * nbands, 0.0); - char transa = 'N'; - char transb = 'N'; - const T alpha(1.0, 0.0); - const T beta(0.0, 0.0); - container::BlasConnector::gemm(transa, transb, nbasis, nbands, nbasis, - alpha, V, nbasis, c, nbasis, beta, Vc.data(), nbasis); - - std::vector cVc(nbands * nbands, 0.0); - transa = ((std::is_same::value || std::is_same::value) ? 'T' : 'C'); - container::BlasConnector::gemm(transa, transb, nbands, nbands, nbasis, - alpha, c, nbasis, Vc.data(), nbasis, beta, cVc.data(), nbands); - return cVc; - } - - template - std::vector> psi_Hpsi(std::complex* const psi, - std::complex* const hpsi, const int nbasis, const int nbands) - { - using T = std::complex; - std::vector cVc(nbands * nbands, (T)0.0); - const T alpha(1.0, 0.0); - const T beta(0.0, 0.0); - container::BlasConnector::gemm('C', 'N', nbands, nbands, nbasis, alpha, - psi, nbasis, hpsi, nbasis, beta, cVc.data(), nbands); - return cVc; - } - - template - std::vector orbital_energy(const int ik, const int nbands, - const std::vector>& mat_mo) - { -#ifdef __DEBUG - assert(nbands >= 0); -#endif - std::vector e(nbands, 0.0); - for (int i = 0; i < nbands; ++i) - { - e[i] = get_real(mat_mo[i * nbands + i]); - } - return e; - } - - template - FPTYPE all_band_energy(const int ik, const int nbands, - const std::vector>& mat_mo, const ModuleBase::matrix& wg) - { - FPTYPE e = 0.0; - for (int i = 0; i < nbands; ++i) - { - e += get_real(mat_mo[i * nbands + i]) * (FPTYPE)wg(ik, i); - } - return e; - } - - template - FPTYPE all_band_energy(const int ik, const std::vector& orbital_energy, - const ModuleBase::matrix& wg) - { - FPTYPE e = 0.0; - for (int i = 0; i < orbital_energy.size(); ++i) - { - e += orbital_energy[i] * (FPTYPE)wg(ik, i); - } - return e; - } - - /// @brief write the Vxc matrix in KS orbital representation, usefull for GW calculation - /// including terms: local/semi-local XC and EXX - template - void write_Vxc(int nspin, - int naos, - int drank, - const psi::Psi>& psi_pw, - // const psi::Psi& psi_lcao, - 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 -#ifdef __EXX - , - const Exx_Lip>& exx_lip -#endif - ) - { - using T = std::complex; - ModuleBase::TITLE("ModuleIO", "write_Vxc_LIP"); - int nbands = wg.nc; - // 1. real-space xc potential - // ModuleBase::matrix vr_xc(nspin, chg.nrxx); - double etxc = 0.0; - double vtxc = 0.0; - // elecstate::PotXC* potxc(&rho_basis, &etxc, vtxc, nullptr); - // potxc.cal_v_eff(&chg, &ucell, vr_xc); - elecstate::Potential* potxc - = new elecstate::Potential(&rhod_basis, &rho_basis, &ucell, &vloc, &sf, &solvent, &etxc, &vtxc); - std::vector compnents_list = { "xc" }; - - potxc->pot_register(compnents_list); - potxc->update_from_charge(&chg, &ucell); - // const ModuleBase::matrix vr_localxc = potxc->get_veff_smooth(); - - // 2. allocate xc operator - psi::Psi hpsi_localxc(psi_pw.get_nk(), psi_pw.get_nbands(), psi_pw.get_nbasis(), kv.ngk, true); - hpsi_localxc.zero_out(); - // std::cout << "hpsi.nk=" << hpsi_localxc.get_nk() << std::endl; - // std::cout << "hpsi.nbands=" << hpsi_localxc.get_nbands() << std::endl; - // std::cout << "hpsi.nbasis=" << hpsi_localxc.get_nbasis() << std::endl; - hamilt::Veff>* vxcs_op_pw; - - - std::vector> e_orb_locxc; // orbital energy (local XC) - std::vector> e_orb_tot; // orbital energy (total) - std::vector> e_orb_exx; // orbital energy (EXX) - Parallel_2D p2d_serial; - p2d_serial.set_serial(nbands, nbands); - // ======test======= - std::vector exx_energy(kv.get_nks()); - // ======test=======s - for (int ik = 0; ik < kv.get_nks(); ++ik) - { - // 2.1 local xc - vxcs_op_pw = new hamilt::Veff>(kv.isk.data(), - potxc->get_veff_smooth_data(), potxc->get_veff_smooth().nr, potxc->get_veff_smooth().nc, &wfc_basis); - vxcs_op_pw->init(ik); // set k-point index - psi_pw.fix_k(ik); - hpsi_localxc.fix_k(ik); -#ifdef __DEBUG - assert(hpsi_localxc.get_current_nbas() == psi_pw.get_current_nbas()); - assert(hpsi_localxc.get_current_nbas() == hpsi_localxc.get_ngk(ik)); -#endif - /// wrap psi and act band-by-band (the same result as act all bands at once) - // for (int ib = 0;ib < psi_pw.get_nbands();++ib) - // { - // std::cout<<"ib="< psi_single_band(&psi_pw(ik, ib, 0), 1, 1, psi_pw.get_current_nbas()); - // psi::Psi hpsi_single_band(&hpsi_localxc(ik, ib, 0), 1, 1, hpsi_localxc.get_current_nbas()); - // vxcs_op_pw->act(1, psi_pw.get_current_nbas(), psi_pw.npol, psi_single_band.get_pointer(), hpsi_single_band.get_pointer(), psi_pw.get_ngk(ik)); - // } - vxcs_op_pw->act(psi_pw.get_nbands(), psi_pw.get_nbasis(), psi_pw.get_npol(), &psi_pw(ik, 0, 0), &hpsi_localxc(ik, 0, 0), psi_pw.get_ngk(ik)); - delete vxcs_op_pw; - std::vector vxc_local_k_mo = psi_Hpsi(&psi_pw(ik, 0, 0), &hpsi_localxc(ik, 0, 0), psi_pw.get_nbasis(), psi_pw.get_nbands()); - Parallel_Reduce::reduce_pool(vxc_local_k_mo.data(), nbands * nbands); - e_orb_locxc.emplace_back(orbital_energy(ik, nbands, vxc_local_k_mo)); - - // 2.2 exx - std::vector vxc_tot_k_mo(std::move(vxc_local_k_mo)); - std::vector vexx_k_ao(naos * naos); -#if((defined __LCAO)&&(defined __EXX) && !(defined __CUDA)&& !(defined __ROCM)) - if (GlobalC::exx_info.info_global.cal_exx) - { - for (int n = 0; n < naos; ++n) - { - for (int m = 0; m < naos; ++m) - { - vexx_k_ao[n * naos + m] += (T)GlobalC::exx_info.info_global.hybrid_alpha - * exx_lip.get_exx_matrix()[ik][m][n]; - } - } - std::vector vexx_k_mo = cVc(vexx_k_ao.data(), &(exx_lip.get_hvec()(ik, 0, 0)), naos, nbands); - Parallel_Reduce::reduce_pool(vexx_k_mo.data(), nbands * nbands); - e_orb_exx.emplace_back(orbital_energy(ik, nbands, vexx_k_mo)); - // ======test======= - // std::cout << "exx_energy from matrix:" << all_band_energy(ik, nbands, vexx_k_mo, wg) << std::endl; - // std::cout << "exx_energy from orbitals: " << all_band_energy(ik, e_orb_exx.at(ik), wg) << std::endl; - // std::cout << "exx_energy from exx_lip: " << GlobalC::exx_info.info_global.hybrid_alpha * exx_lip.get_exx_energy() << std::endl; - // ======test======= - container::BlasConnector::axpy(nbands * nbands, 1.0, vexx_k_mo.data(), 1, vxc_tot_k_mo.data(), 1); - } -#endif - - /// add-up and write - // mohan add 2025-06-02 - const int istep = -1; - const int out_label = 1; // 1 means .txt while 2 means .dat - const bool out_app_flag = 0; - const bool gamma_only = PARAM.globalv.gamma_only_local; - - std::string vxc_file = ModuleIO::filename_output( - PARAM.globalv.global_out_dir, - "vxc","nao",ik,kv.ik2iktot,nspin,kv.get_nkstot(), - out_label,out_app_flag,gamma_only,istep); - - ModuleIO::save_mat(istep, vxc_tot_k_mo.data(), nbands, - false, PARAM.inp.out_ndigits, true, - out_app_flag, vxc_file, - p2d_serial, drank, false); - - e_orb_tot.emplace_back(orbital_energy(ik, nbands, vxc_tot_k_mo)); - } - //===== test total xc energy ======= - // std::cout << "xc energy =" << etxc << std::endl; - // std::cout << "vtxc=" << vtxc << std::endl; - // FPTYPE exc_by_orb = 0.0; - // for (int ik = 0;ik < e_orb_locxc.size();++ik) - // exc_by_orb += all_band_energy(ik, e_orb_locxc[ik], wg); - // std::cout << "xc all-bands energy by orbital =" << exc_by_orb << std::endl; - // /// calculate orbital energy by grid integration of vtxc*rho - // FPTYPE exc_by_rho = 0.0; - // for (int ir = 0;ir < potxc->get_veff_smooth().nc;++ir) - // exc_by_rho += potxc->get_veff_smooth()(0, ir) * chg.rho[0][ir]; - // Parallel_Reduce::reduce_all(exc_by_rho); - // exc_by_rho *= ((FPTYPE)ucell.omega * (FPTYPE)GlobalV::NPROC / (FPTYPE)potxc->get_veff_smooth().nc); - // std::cout << "xc all-bands energy by rho =" << exc_by_rho << std::endl; - //===== test total xc energy ======= - //===== test total exx energy ======= -// #if((defined __LCAO)&&(defined __EXX) && !(defined __CUDA)&& !(defined __ROCM)) -// if (GlobalC::exx_info.info_global.cal_exx) -// { -// FPTYPE exx_by_orb = 0.0; -// for (int ik = 0;ik < e_orb_exx.size();++ik) -// exx_by_orb += all_band_energy(ik, e_orb_exx[ik], wg); -// exx_by_orb /= 2; -// std::cout << "exx all-bands energy by orbital =" << exx_by_orb << std::endl; -// FPTYPE exx_from_lip = GlobalC::exx_info.info_global.hybrid_alpha * exx_lip.get_exx_energy(); -// std::cout << "exx all-bands energy from exx_lip =" << exx_from_lip << std::endl; -// } -// #endif - //===== test total exx energy ======= - // write the orbital energy for xc and exx in LibRPA format - const int nspin0 = (nspin == 2) ? 2 : 1; - auto write_orb_energy = [&kv, &nspin0, &nbands](const std::vector>& e_orb, - const std::string& label, - const bool app = false) { - assert(e_orb.size() == kv.get_nks()); - const int nk = kv.get_nks() / nspin0; - std::ofstream ofs; - ofs.open(PARAM.globalv.global_out_dir + "vxc_" + (label == "" ? "out.dat" : label + "_out.dat"), - app ? std::ios::app : std::ios::out); - ofs << nk << "\n" << nspin0 << "\n" << nbands << "\n"; - ofs << std::scientific << std::setprecision(16); - for (int ik = 0; ik < nk; ++ik) - { - for (int is = 0; is < nspin0; ++is) - { - for (auto e : e_orb[is * nk + ik]) - { // Hartree and eV - ofs << e / 2. << "\t" << e * (FPTYPE)ModuleBase::Ry_to_eV << "\n"; - } - } - } - }; - - if (GlobalV::MY_RANK == 0) - { - write_orb_energy(e_orb_tot, ""); -#if((defined __LCAO)&&(defined __EXX) && !(defined __CUDA)&& !(defined __ROCM)) - if (GlobalC::exx_info.info_global.cal_exx) - { - write_orb_energy(e_orb_locxc, "local"); - write_orb_energy(e_orb_exx, "exx"); - } -#endif - } - } -} // namespace ModuleIO -#endif diff --git a/source/module_io/write_vxc_r.hpp b/source/module_io/write_vxc_r.hpp deleted file mode 100644 index 29cef9e588..0000000000 --- a/source/module_io/write_vxc_r.hpp +++ /dev/null @@ -1,203 +0,0 @@ -#ifndef __WRITE_VXC_R_H_ -#define __WRITE_VXC_R_H_ -#include "module_parameter/parameter.h" -#include "source_base/scalapack_connector.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_dftu_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" -#include "module_io/write_HS_sparse.h" -#ifdef __EXX -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h" -#include "module_ri/RI_2D_Comm.h" -#endif - -#ifndef TGINT_H -#define TGINT_H -template -struct TGint; - -template <> -struct TGint -{ - using type = Gint_Gamma; -}; - -template <> -struct TGint> -{ - using type = Gint_k; -}; -#endif - -namespace ModuleIO -{ - -#ifndef SET_GINT_POINTER_H -#define SET_GINT_POINTER_H -template -void set_gint_pointer(Gint_Gamma& gint_gamma, Gint_k& gint_k, typename TGint::type*& gint); - -template <> -void set_gint_pointer(Gint_Gamma& gint_gamma, Gint_k& gint_k, typename TGint::type*& gint) -{ - gint = &gint_gamma; -} - -template <> -void set_gint_pointer>(Gint_Gamma& gint_gamma, - Gint_k& gint_k, - typename TGint>::type*& gint) -{ - gint = &gint_k; -} -#endif - -template std::set> get_R_range(const hamilt::HContainer& hR) -{ - std::set> all_R_coor; - - return all_R_coor; -} - -template -std::map, std::map>> -cal_HR_sparse(const hamilt::HContainer& hR, - const int current_spin, - const double sparse_thr); - -template <> -std::map, std::map>> -cal_HR_sparse(const hamilt::HContainer& hR, - const int current_spin, - const double sparse_thr) -{ - std::map, std::map>> target; - sparse_format::cal_HContainer_d(*hR.get_paraV(), current_spin, sparse_thr, hR, target); - return target; -} -template <> -std::map, std::map>>> -cal_HR_sparse(const hamilt::HContainer>& hR, - const int current_spin, - const double sparse_thr) -{ - std::map, std::map>>> target; - sparse_format::cal_HContainer_cd(*hR.get_paraV(), current_spin, sparse_thr, hR, target); - return target; -} - -/// @brief write the Vxc matrix in KS orbital representation, usefull for GW calculation -/// including terms: local/semi-local XC, EXX, DFTU -template -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, - Gint_Gamma& gint_gamma, - Gint_k& gint_k, - const K_Vectors& kv, - const std::vector& orb_cutoff, - Grid_Driver& gd, -#ifdef __EXX - const std::vector>>>* const Hexxd, - const std::vector>>>>* const Hexxc, -#endif -const double sparse_thr=1e-10) -{ - ModuleBase::TITLE("ModuleIO", "write_Vxc_R"); - // 1. real-space xc potential - // ModuleBase::matrix vr_xc(nspin, chg.nrxx); - double etxc = 0.0; - double vtxc = 0.0; - // elecstate::PotXC* potxc(&rho_basis, &etxc, vtxc, nullptr); - // potxc.cal_v_eff(&chg, &ucell, vr_xc); - elecstate::Potential* potxc - = new elecstate::Potential(&rhod_basis, &rho_basis, &ucell, &vloc, &sf, &solvent, &etxc, &vtxc); - std::vector compnents_list = {"xc"}; - potxc->pot_register(compnents_list); - potxc->update_from_charge(&chg, &ucell); - - // 2. allocate H(R) - // (the number of hR: 1 for nspin=1, 4; 2 for nspin=2) - int nspin0 = (nspin == 2) ? 2 : 1; - std::vector> vxcs_R_ao(nspin0, hamilt::HContainer(ucell, pv)); // call move constructor -#ifdef __EXX - std::array Rs_period = { kv.nmp[0], kv.nmp[1], kv.nmp[2] }; - const auto cell_nearest = hamilt::init_cell_nearest(ucell, Rs_period); -#endif - for (int is = 0; is < nspin0; ++is) - { - if (std::is_same::value) { vxcs_R_ao[is].fix_gamma(); } -#ifdef __EXX - if (GlobalC::exx_info.info_global.cal_exx) - { - GlobalC::exx_info.info_ri.real_number ? - hamilt::reallocate_hcontainer(*Hexxd, &vxcs_R_ao[is], &cell_nearest) : - hamilt::reallocate_hcontainer(*Hexxc, &vxcs_R_ao[is], &cell_nearest); - } -#endif - } - - // 3. calculate the Vxc(R) - hamilt::HS_Matrix_K vxc_k_ao(pv, 1); // only hk is needed, sk is skipped - typename TGint::type* gint = nullptr; - set_gint_pointer(gint_gamma, gint_k, gint); - std::vector>*> vxcs_op_ao(nspin0); - for (int is = 0; is < nspin0; ++is) - { - vxcs_op_ao[is] = new hamilt::Veff>(gint, - &vxc_k_ao, kv.kvec_d, potxc, &vxcs_R_ao[is], &ucell, orb_cutoff, &gd, nspin); - vxcs_op_ao[is]->contributeHR(); -#ifdef __EXX - if (GlobalC::exx_info.info_global.cal_exx) - { - GlobalC::exx_info.info_ri.real_number ? - RI_2D_Comm::add_HexxR(is, GlobalC::exx_info.info_global.hybrid_alpha, *Hexxd, *pv, ucell.get_npol(), vxcs_R_ao[is], &cell_nearest) : - RI_2D_Comm::add_HexxR(is, GlobalC::exx_info.info_global.hybrid_alpha, *Hexxc, *pv, ucell.get_npol(), vxcs_R_ao[is], &cell_nearest); - } -#endif - } - - // test: fold Vxc(R) and check whether it is equal to Vxc(k) - // for (int ik = 0; ik < kv.get_nks(); ++ik) - // { - // vxc_k_ao.set_zero_hk(); - // dynamic_cast*>(vxcs_op_ao[kv.isk[ik]])->contributeHk(ik); - - // // output Vxc(k) (test) - // const TK* const hk = vxc_k_ao.get_hk(); - // std::cout << "ik=" << ik << ", Vxc(K): " << std::endl; - // for (int i = 0; i < pv->get_row_size(); i++) - // { - // for (int j = 0; j < pv->get_col_size(); j++) - // { - // std::cout << hk[j * pv->get_row_size() + i] << " "; - // } - // std::cout << std::endl; - // } - // } - - // 4. write Vxc(R) in csr format - for (int is = 0; is < nspin0; ++is) - { - std::set> all_R_coor = sparse_format::get_R_range(vxcs_R_ao[is]); - const std::string filename = "Vxc_R_spin" + std::to_string(is); - ModuleIO::save_sparse( - cal_HR_sparse(vxcs_R_ao[is], is, sparse_thr), - all_R_coor, - sparse_thr, - false, //binary - PARAM.globalv.global_out_dir + filename + ".csr", - *pv, - filename, - -1, - true); //all-reduce - } -} -} // namespace ModuleIO -#endif diff --git a/source/module_io/write_wfc_nao.cpp b/source/module_io/write_wfc_nao.cpp deleted file mode 100644 index 8297b7e35c..0000000000 --- a/source/module_io/write_wfc_nao.cpp +++ /dev/null @@ -1,328 +0,0 @@ -#include "write_wfc_nao.h" - -#include "module_parameter/parameter.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_base/parallel_2d.h" -#include "source_base/scalapack_connector.h" -#include "source_base/global_variable.h" -#include "source_base/global_function.h" -#include "binstream.h" -#include "filename.h" - -namespace ModuleIO -{ - -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) -{ - ModuleBase::TITLE("ModuleIO", "wfc_nao_write2file"); - ModuleBase::timer::tick("ModuleIO", "wfc_nao_write2file"); - - int nbands = ekb.nc; - - if (writeBinary) - { - Binstream ofs; - if (append_flag) - { - ofs.open(name, "a"); - } - else - { - ofs.open(name, "w"); - } - if (!ofs) - { - ModuleBase::WARNING("ModuleIO::wfc_nao_write2file", "Can't write local orbital wave functions."); - } - - ofs << nbands; - ofs << nlocal; - - for (int i = 0; i < nbands; i++) - { - ofs << i + 1; - ofs << ekb(ik, i); - ofs << wg(ik, i); - - for (int j = 0; j < nlocal; j++) - { - ofs << ctot[i * nlocal + j]; - } - } - ofs.close(); - } - else - { - std::ofstream ofs; - if (append_flag) - { - ofs.open(name.c_str(), std::ofstream::app); - } - else - { - ofs.open(name.c_str()); - } - if (!ofs) - { - ModuleBase::WARNING("ModuleIO::wfc_nao_write2file", "Can't write local orbital wave functions."); - } - ofs << nbands << " (number of bands)" << std::endl; - ofs << nlocal << " (number of orbitals)"; - ofs << std::setprecision(8); - ofs << std::scientific; - - for (int i = 0; i < nbands; i++) - { - // +1 to mean more clearly. - // band index start from 1. - ofs << "\n" << i + 1 << " (band)"; - ofs << "\n" << ekb(ik, i) << " (Ry)"; - ofs << "\n" << wg(ik, i) << " (Occupations)"; - for (int j = 0; j < nlocal; j++) - { - if (j % 5 == 0) - { - ofs << "\n"; - } - ofs << ctot[i * nlocal + j] << " "; - } - } - ofs << std::endl; - ofs.close(); - } - - ModuleBase::timer::tick("ModuleIO", "wfc_nao_write2file"); - return; -} - -void wfc_nao_write2file_complex(const std::string& name, - const std::complex* ctot, - const int nlocal, - const int& ik, - const ModuleBase::Vector3& kvec_c, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const bool& writeBinary, - const bool& append_flag) -{ - ModuleBase::TITLE("ModuleIO","wfc_nao_write2file_complex"); - ModuleBase::timer::tick("ModuleIO","wfc_nao_write2file_complex"); - - int nbands = ekb.nc; - - if (writeBinary) - { - Binstream ofs; - if (append_flag) - { - ofs.open(name, "a"); - } - else - { - ofs.open(name, "w"); - } - if (!ofs) - { - ModuleBase::WARNING("ModuleIO::wfc_nao_write2file_complex", "Can't write local orbital wave functions."); - } - ofs << ik + 1; - ofs << kvec_c.x; - ofs << kvec_c.y; - ofs << kvec_c.z; - ofs << nbands; - ofs << nlocal; - - for (int i = 0; i < nbands; i++) - { - ofs << i + 1; - ofs << ekb(ik, i); - ofs << wg(ik, i); - - for (int j = 0; j < nlocal; j++) - { - ofs << ctot[i * nlocal + j].real() << ctot[i * nlocal + j].imag(); - } - } - ofs.close(); - } - else - { - std::ofstream ofs; - if (append_flag) - { - ofs.open(name.c_str(), std::ofstream::app); - } - else - { - ofs.open(name.c_str()); - } - if (!ofs) - { - ModuleBase::WARNING("ModuleIO::wfc_nao_write2file_complex", "Can't write local orbital wave functions."); - } - ofs << std::setprecision(8); - ofs << ik + 1 << " (index of k points)" << std::endl; - ofs << kvec_c.x << " " << kvec_c.y << " " << kvec_c.z << std::endl; - ofs << nbands << " (number of bands)" << std::endl; - ofs << nlocal << " (number of orbitals)"; - ofs << std::scientific; - - for (int i = 0; i < nbands; i++) - { - // +1 to mean more clearly. - // band index start from 1. - ofs << "\n" << i + 1 << " (band)"; - ofs << "\n" << ekb(ik, i) << " (Ry)"; - ofs << "\n" << wg(ik, i) << " (Occupations)"; - for (int j = 0; j < nlocal; j++) - { - if (j % 5 == 0) - { - ofs << "\n"; - } - ofs << ctot[i * nlocal + j].real() << " " << ctot[i * nlocal + j].imag() << " "; - } - } - ofs << std::endl; - ofs.close(); - } - - ModuleBase::timer::tick("ModuleIO","wfc_nao_write2file_complex"); - return; -} - -template -void write_wfc_nao(const int out_type, - const bool out_app_flag, - const psi::Psi& psi, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const std::vector>& kvec_c, - const std::vector &ik2iktot, - const int nkstot, - const Parallel_Orbitals& pv, - const int nspin, - const int istep) -{ - if (!out_type) - { - return; - } - ModuleBase::TITLE("ModuleIO", "write_wfc_nao"); - ModuleBase::timer::tick("ModuleIO", "write_wfc_nao"); - int myid = 0; - int nbands = 0; - int nlocal = 0; - - // If using MPI, the nbasis and nbands in psi is the value on local rank, - // so get nlocal and nbands from pv->desc_wfc[2] and pv->desc_wfc[3] -#ifdef __MPI - MPI_Comm_rank(pv.comm(), &myid); - nlocal = pv.desc_wfc[2]; - nbands = pv.desc_wfc[3]; -#else - nlocal = psi.get_nbasis(); - nbands = psi.get_nbands(); -#endif - - bool gamma_only = (std::is_same::value); - bool writeBinary = (out_type == 2); - Parallel_2D pv_glb; - int blk_glb = std::max(nlocal, nbands); - std::vector ctot(myid == 0 ? nbands * nlocal : 0); - ModuleBase::Memory::record("ModuleIO::write_wfc_nao::glb", sizeof(T) * nlocal * nbands); - - for (int ik = 0; ik < psi.get_nk(); ik++) - { - psi.fix_k(ik); -#ifdef __MPI - pv_glb.set(nlocal, nbands, blk_glb, pv.blacs_ctxt); - Cpxgemr2d(nlocal, - nbands, - psi.get_pointer(), - 1, - 1, - const_cast(pv.desc_wfc), - ctot.data(), - 1, - 1, - pv_glb.desc, - pv_glb.blacs_ctxt); -#else - for (int ib = 0; ib < nbands; ib++) - { - for (int i = 0; i < nlocal; i++) - { - ctot[ib * nlocal + i] = psi(ib,i); - } - } -#endif - - if (myid == 0) - { - std::string fn = filename_output(PARAM.globalv.global_wfc_dir,"wf","nao",ik,ik2iktot,nspin,nkstot, - out_type,out_app_flag,gamma_only,istep); - - bool append_flag = (istep > 0 && out_app_flag); - if (std::is_same::value) - { - wfc_nao_write2file(fn, - reinterpret_cast(ctot.data()), - nlocal, - ik, - ekb, - wg, - writeBinary, - append_flag); - } - else - { - wfc_nao_write2file_complex(fn, - reinterpret_cast*>(ctot.data()), - nlocal, - ik, - kvec_c[ik], - ekb, - wg, - writeBinary, - append_flag); - } - } - } - ModuleBase::timer::tick("ModuleIO", "write_wfc_nao"); -} - -template void write_wfc_nao(const int out_type, - const bool out_app_flag, - const psi::Psi& psi, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const std::vector>& kvec_c, - const std::vector &ik2iktot, - const int nkstot, - const Parallel_Orbitals& pv, - const int nspin, - const int istep); - -template void write_wfc_nao>(const int out_type, - const bool out_app_flag, - const psi::Psi>& psi, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const std::vector>& kvec_c, - const std::vector &ik2iktot, - const int nkstot, - const Parallel_Orbitals& pv, - const int nspin, - const int istep); - -} // namespace ModuleIO diff --git a/source/module_io/write_wfc_nao.h b/source/module_io/write_wfc_nao.h deleted file mode 100644 index 48284d9911..0000000000 --- a/source/module_io/write_wfc_nao.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef WRITE_WFC_NAO_H -#define WRITE_WFC_NAO_H -#include "source_base/matrix.h" -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_psi/psi.h" -#include "source_base/vector3.h" -#include - -namespace ModuleIO -{ - - /** - * 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]. - * - * @param out_type The output file type. 1 for text, 2 for binary. - * @param psi The Psi object containing the wavefunction coefficients. - * @param ekb The matrix of Kohn-Sham eigenvalues. - * @param wg The matrix of Kohn-Sham eigenvectors. - * @param kvec_c The vector of k-points in Cartesian coordinates. - * @param pv The Parallel_Orbitals object containing additional information. - * @param istep The current step number. if < 0, the step number is not included in the file name. - */ -template -void write_wfc_nao(const int out_type, - const bool out_app_flag, - const psi::Psi& psi, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const std::vector>& kvec_c, - const std::vector &ik2iktot, - const int nkstot, - const Parallel_Orbitals& pv, - const int nspin, - const int istep=-1) ; - -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 = false); - -void wfc_nao_write2file_complex(const std::string& name, - const std::complex* ctot, - const int nlocal, - const int& ik, - const ModuleBase::Vector3& kvec_c, - const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const bool& writeBinary = false, - const bool& append_flag = false); -}// namespace ModuleIO -#endif diff --git a/source/module_io/write_wfc_pw.cpp b/source/module_io/write_wfc_pw.cpp deleted file mode 100644 index 31e52d8f01..0000000000 --- a/source/module_io/write_wfc_pw.cpp +++ /dev/null @@ -1,310 +0,0 @@ -#include "write_wfc_pw.h" - -#ifdef __MPI -#include "mpi.h" -#endif - -#include "binstream.h" -#include "source_base/global_variable.h" -#include "source_base/parallel_global.h" -#include "source_base/tool_title.h" -#include "module_parameter/parameter.h" -#include "module_io/filename.h" - -void ModuleIO::write_wfc_pw( - 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 double& ecutwfc, - const std::string& global_out_dir, - const psi::Psi>& psi, - const K_Vectors& kv, - const ModulePW::PW_Basis_K* wfcpw, - std::ofstream &ofs_running) -{ - ModuleBase::TITLE("ModuleIO", "write_wfc_pw"); - - if(out_wfc_pw!=1 && out_wfc_pw!=2) - { - return; - } - - const int nkstot = kv.get_nkstot(); - const int nks = kv.get_nks(); - - assert(nkstot>0); - assert(nks>0); - - bool out_app_flag = false; // need to modify later, mohan 2025-05-17 - bool gamma_only = false; // need to modify later, mohan 2025-05-17 - int istep = -1; // need to modify later, mohan 2025-05-17 - - std::string* wfilename = new std::string[nks]; - - for (int ip = 0; ip < kpar; ip++) - { - if (my_pool != ip) continue; - - for (int ik_local = 0; ik_local < kv.get_nks(); ik_local++) - { - std::string fn = filename_output(global_out_dir,"wf","pw", - ik_local,kv.ik2iktot,nspin,nkstot, - out_wfc_pw,out_app_flag,gamma_only,istep); - - ofs_running << " Write G-space wave functions into file " - << fn << std::endl; - - wfilename[ik_local] = fn; - - if (rank_in_pool == 0) - { - if (out_wfc_pw == 1) - { - std::ofstream ofs(fn.c_str()); // clear all wavefunc files. - ofs.close(); - } - else if (out_wfc_pw == 2) - { - Binstream wfs(fn, "w"); - wfs.close(); - } - } - } - } - - -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - - - -#ifdef __MPI - // out put the wave functions in plane wave basis. - for (int ip = 0; ip < kpar; ip++) - { - if (my_pool == ip) - { -#endif - for (int ik = 0; ik < psi.get_nk(); ik++) - { - psi.fix_k(ik); - int ikngtot = 0; // ikngtot: the total number of plane waves of ikpoint - const int ng = kv.ngk[ik]; - const int ng_max = wfcpw->npwk_max; - const int ikstot = kv.ik2iktot[ik]; -#ifdef __MPI - MPI_Allreduce(&kv.ngk[ik], &ikngtot, 1, MPI_INT, MPI_SUM, POOL_WORLD); -#else - ikngtot = kv.ngk[ik]; -#endif - const int ikngtot_npol = ikngtot * npol; -#ifdef __MPI - for (int id = 0; id < nproc_in_pool; id++) - { - MPI_Barrier(POOL_WORLD); - if (rank_in_pool == id) - { -#else - int id = 0; -#endif - if (out_wfc_pw == 1) - { - std::ofstream ofs2(wfilename[ik].c_str(), std::ios::app); - if (id == 0) - { - ofs2 << std::setprecision(6); - ofs2 << std::setw(10) << "Kpoint" << std::setw(10) << "nKpoint" << std::setw(10) - << "kv.x" << std::setw(10) << "kv.y" << std::setw(10) << "kv.z" << std::setw(10) - << "weight" << std::setw(10) << "ngtot" << std::setw(10) << "nband" - << std::setw(10) << "ecut" << std::setw(10) << "lat0" << std::setw(10) - << "2pi/lat0" << std::endl; - ofs2 << std::setw(10) << ikstot + 1 << std::setw(10) << nkstot << std::setw(10) - << kv.kvec_c[ik].x << std::setw(10) << kv.kvec_c[ik].y << std::setw(10) - << kv.kvec_c[ik].z << std::setw(10) << kv.wk[ik] << std::setw(10) << ikngtot - << std::setw(10) << nbands << std::setw(10) << ecutwfc - << std::setw(10) << wfcpw->lat0 << std::setw(10) << wfcpw->tpiba << std::endl; - ofs2 << "\n" << std::endl; - ofs2 << std::setw(10) << wfcpw->G.e11 << std::setw(10) << wfcpw->G.e12 << std::setw(10) - << wfcpw->G.e13 << std::endl; - ofs2 << std::setw(10) << wfcpw->G.e21 << std::setw(10) << wfcpw->G.e22 << std::setw(10) - << wfcpw->G.e23 << std::endl; - ofs2 << std::setw(10) << wfcpw->G.e31 << std::setw(10) << wfcpw->G.e32 << std::setw(10) - << wfcpw->G.e33 << std::endl; - ofs2 << "\n" << std::endl; - ofs2 << "" << std::endl; - } - for (int igl = 0; igl < wfcpw->npwk[ik]; ++igl) - { - int isz = wfcpw->igl2isz_k[ik * wfcpw->npwk_max + igl]; - int iz = isz % wfcpw->nz; - int is = isz / wfcpw->nz; - int ixy = wfcpw->is2fftixy[is]; - int ix = ixy / wfcpw->fftny; - int iy = ixy % wfcpw->fftny; - - ofs2 << std::setw(10) << ix << std::setw(10) << iy << std::setw(10) << iz << std::endl; - } - if (id == nproc_in_pool - 1) - { - ofs2 << "\n" << std::endl; - } - ofs2.close(); - } - else if (out_wfc_pw == 2) - { - Binstream wfs2(wfilename[ik], "a"); - if (id == 0) - { - wfs2 << int(72) << ikstot + 1 << nkstot << kv.kvec_c[ik].x << kv.kvec_c[ik].y - << kv.kvec_c[ik].z << kv.wk[ik] << ikngtot << nbands << ecutwfc - << wfcpw->lat0 << wfcpw->tpiba << 72; // 4 int + 7 double is 72B - wfs2 << 72 << wfcpw->G.e11 << wfcpw->G.e12 << wfcpw->G.e13 << wfcpw->G.e21 - << wfcpw->G.e22 << wfcpw->G.e23 << wfcpw->G.e31 << wfcpw->G.e32 << wfcpw->G.e33 - << 72; // 9 double is 72B - } - if (id == 0) - { - wfs2 << ikngtot * 4 * 3; - } - for (int igl = 0; igl < wfcpw->npwk[ik]; ++igl) - { - int isz = wfcpw->igl2isz_k[ik * wfcpw->npwk_max + igl]; - int iz = isz % wfcpw->nz; - int is = isz / wfcpw->nz; - int ixy = wfcpw->is2fftixy[is]; - int ix = ixy / wfcpw->fftny; - int iy = ixy % wfcpw->fftny; - - wfs2 << ix << iy << iz; - } - if (id == nproc_in_pool - 1) - { - wfs2 << ikngtot * 4 * 3; - } - wfs2.close(); - } -#ifdef __MPI - } - } // end id -#endif - for (int ib = 0; ib < nbands; ib++) - { -#ifdef __MPI - for (int id = 0; id < nproc_in_pool; id++) - { - MPI_Barrier(POOL_WORLD); // qianrui add - if (rank_in_pool == id) - { -#else - int id = 0; -#endif - if (out_wfc_pw == 1) - { - std::ofstream ofs2(wfilename[ik].c_str(), std::ios::app); - if (id == 0) - { - ofs2 << "\n< Band " << ib + 1 << " >" << std::endl; - } - ofs2 << std::scientific; - for (int ig = 0; ig < ng; ig++) - { - if (ig % 4 == 0 && (ig != 0 || id != 0)) - { - ofs2 << "\n"; - } - ofs2 << std::setw(15) << psi(ib, ig).real() << std::setw(15) << psi(ib, ig).imag(); - } // end ig - if (id == nproc_in_pool - 1 && npol == 1) - { - ofs2 << "\n< Band " << ib + 1 << " >" << std::endl; - } - ofs2.close(); - } - else if (out_wfc_pw == 2) - { - Binstream wfs2(wfilename[ik], "a"); - if (id == 0) - { - wfs2 << ikngtot_npol * 16; - } - for (int ig = 0; ig < ng; ig++) - { - wfs2 << psi(ib, ig).real() << psi(ib, ig).imag(); - } - if (id == nproc_in_pool - 1 && npol == 1) - { - wfs2 << ikngtot_npol * 16; - } - wfs2.close(); - } -#ifdef __MPI - } - } // end id -#endif - if (npol > 1) - { -#ifdef __MPI - for (int id = 0; id < nproc_in_pool; id++) - { - MPI_Barrier(POOL_WORLD); // qianrui add - if (rank_in_pool == id) - { -#else - int id = 0; -#endif - if (out_wfc_pw == 1) - { - std::ofstream ofs2(wfilename[ik].c_str(), std::ios::app); - - ofs2 << std::scientific; - for (int ig = 0; ig < ng; ig++) - { - if (ig % 4 == 0 && (ig != 0 || id != 0)) - { - ofs2 << "\n"; - } - ofs2 << std::setw(15) << psi(ib, ig + ng_max).real() << std::setw(15) - << psi(ib, ig + ng_max).imag(); - } // end ig - if (id == nproc_in_pool - 1) - { - ofs2 << "\n< Band " << ib + 1 << " >" << std::endl; - } - ofs2.close(); - } - else if (out_wfc_pw == 2) - { - Binstream wfs2(wfilename[ik], "a"); - for (int ig = 0; ig < ng; ig++) - { - wfs2 << psi(ib, ig + ng_max).real() << psi(ib, ig + ng_max).imag(); - } - if (id == nproc_in_pool - 1) - { - wfs2 << ikngtot_npol * 16; - } - wfs2.close(); - } -#ifdef __MPI - } // end if rank_in_pool - } // end id -#endif - } // end if npol>1 - - } // end ib - } // end ik -#ifdef __MPI - } // end if my_pool - } // end ipool -#endif - - delete[] wfilename; - return; -} diff --git a/source/module_io/write_wfc_pw.h b/source/module_io/write_wfc_pw.h deleted file mode 100644 index b149741f17..0000000000 --- a/source/module_io/write_wfc_pw.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef WRITE_WFC_PW_H -#define WRITE_WFC_PW_H -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/klist.h" -#include "source_psi/psi.h" - -namespace ModuleIO -{ - -void write_wfc_pw( - 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 double& ecutwfc, - const std::string& global_out_dir, - const psi::Psi>& psi, - const K_Vectors& kv, - const ModulePW::PW_Basis_K* wfcpw, - std::ofstream &ofs_running); - -} - -#endif diff --git a/source/module_io/write_wfc_r.cpp b/source/module_io/write_wfc_r.cpp deleted file mode 100644 index ef52c4347a..0000000000 --- a/source/module_io/write_wfc_r.cpp +++ /dev/null @@ -1,207 +0,0 @@ -//====================== -// AUTHOR : Peize Lin -#include "module_parameter/parameter.h" -// DATE : 2021-11-21 -//====================== - -//====================== -// WARNING: These interfaces will be removed in the future! Do not use them! -// Taoni add 2024-10-08 -//====================== - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "write_wfc_r.h" - -#include -#include -#include - -namespace ModuleIO -{ -// write ||wfc_r|| for all k-points and all bands -// Input: wfc_g(ik, ib, ig) -// loop order is for(z){for(y){for(x)}} -void write_psi_r_1(const UnitCell& ucell, - const psi::Psi>& wfc_g, - const ModulePW::PW_Basis_K* wfcpw, - const std::string& folder_name, - const bool& square, - const K_Vectors& kv) -{ - ModuleBase::TITLE("ModuleIO", "write_psi_r_1"); - ModuleBase::timer::tick("ModuleIO", "write_psi_r_1"); - - const std::string outdir = PARAM.globalv.global_out_dir + folder_name + "/"; - ModuleBase::GlobalFunc::MAKE_DIR(outdir); -#ifdef __MPI - std::vector mpi_requests; -#endif - for (int ik = 0; ik < wfc_g.get_nk(); ++ik) - { - wfc_g.fix_k(ik); - const int ik_out = (PARAM.inp.nspin != 2) - ? ik + kv.para_k.startk_pool[GlobalV::MY_POOL] - : ik - kv.get_nks() / 2 * kv.isk[ik] + kv.get_nkstot() / 2 * kv.isk[ik] - + kv.para_k.startk_pool[GlobalV::MY_POOL]; - for (int ib = 0; ib < wfc_g.get_nbands(); ++ib) - { - const std::vector> wfc_r = cal_wfc_r(wfcpw, wfc_g, ik, ib); - - std::vector wfc_real(wfc_r.size()); - std::vector wfc_imag; - if (square) - { - for (int ir = 0; ir < wfc_real.size(); ++ir) - { - wfc_real[ir] = std::norm(wfc_r[ir]); // "std::norm(z)" returns |z|^2 - } - } - else - { - wfc_imag.resize(wfc_r.size()); - for (int ir = 0; ir < wfc_real.size(); ++ir) - { - wfc_real[ir] = wfc_r[ir].real(); - wfc_imag[ir] = wfc_r[ir].imag(); - } - } - const std::string file_name_base = outdir + "wfc_realspace_" + - ModuleBase::GlobalFunc::TO_STRING(ik_out) + "_" + - ModuleBase::GlobalFunc::TO_STRING(ib); - const std::string file_name = square ? file_name_base : file_name_base + "_imag"; -#ifdef __MPI - // Use write_chg_r_1 to output the real and imaginary parts of the wave function to file - mpi_requests.push_back({}); - write_chg_r_1(ucell,wfcpw, wfc_real, file_name, mpi_requests.back()); -#else - write_chg_r_1(ucell,wfcpw, wfc_real, file_name); - // if (!square) - // write_chg_r_1(wfc_imag, file_name + "_imag", mpi_requests.back()); -#endif - } - } -#ifdef __MPI - MPI_Waitall(mpi_requests.size(), mpi_requests.data(), MPI_STATUSES_IGNORE); -#endif - ModuleBase::timer::tick("ModuleIO", "write_psi_r_1"); -} -// processes output pipeline: -// -// t0 t1 t2 t3 t4 t5 t6 t7 -// --------------------------------> -// rank0 k0 k1 k2 k3 k4 k5 -// \ \ \ \ \ \ - // rank1 k0 k1 k2 k3 k4 k5 -// \ \ \ \ \ \ - // rank2 k0 k1 k2 k3 k4 k5 - -// Input: wfc_g(ib,ig) -// Output: wfc_r[ir] -std::vector> cal_wfc_r(const ModulePW::PW_Basis_K* wfcpw, - const psi::Psi>& wfc_g, - const int ik, - const int ib) -{ - ModuleBase::timer::tick("ModuleIO", "cal_wfc_r"); - - std::vector> wfc_r(wfcpw->nrxx); - wfcpw->recip2real(&wfc_g(ib, 0), wfc_r.data(), ik); - - ModuleBase::timer::tick("ModuleIO", "cal_wfc_r"); - return wfc_r; -} - -// Input: chg_r[ir] -void write_chg_r_1(const UnitCell& ucell, - const ModulePW::PW_Basis_K* wfcpw, - const std::vector& chg_r, - const std::string& file_name - #ifdef __MPI - ,MPI_Request& mpi_request - #endif - ) -{ - ModuleBase::timer::tick("ModuleIO", "write_chg_r_1"); - std::ofstream ofs; - -#ifdef __MPI - constexpr int mpi_tag = 100; - if (GlobalV::RANK_IN_POOL == 0) - { -#endif - ofs.open(file_name); - - ofs << "calculated by ABACUS" << std::endl; - ofs << ucell.lat0_angstrom << std::endl; - ofs << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 - << std::endl - << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 - << std::endl - << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 - << std::endl; - - for (int it = 0; it < ucell.ntype; ++it) - { - ofs << ucell.atoms[it].label << "\t"; - } - ofs << std::endl; - for (int it = 0; it < ucell.ntype; ++it) - { - ofs << ucell.atoms[it].na << "\t"; - } - ofs << std::endl; - - ofs << "Direct" << std::endl; - for (int it = 0; it < ucell.ntype; ++it) - { - for (int ia = 0; ia < ucell.atoms[it].na; ++ia) - { - ofs << ucell.atoms[it].taud[ia].x << " " << ucell.atoms[it].taud[ia].y << " " - << ucell.atoms[it].taud[ia].z << std::endl; - } - } - ofs << std::endl; - - ofs << wfcpw->nx << " " << wfcpw->ny << " " << wfcpw->nz << std::endl; -#ifdef __MPI - } - else - { - char recv_tmp; - MPI_Recv(&recv_tmp, 1, MPI_CHAR, GlobalV::RANK_IN_POOL - 1, mpi_tag, POOL_WORLD, MPI_STATUS_IGNORE); - - ofs.open(file_name, std::ofstream::app); - } -#endif - - assert(wfcpw->nx * wfcpw->ny * wfcpw->nplane == chg_r.size()); - for (int iz = 0; iz < wfcpw->nplane; ++iz) - { - for (int iy = 0; iy < wfcpw->ny; ++iy) - { - for (int ix = 0; ix < wfcpw->nx; ++ix) - { - const int ir = (ix * wfcpw->ny + iy) * wfcpw->nplane + iz; - ofs << chg_r[ir] << " "; - } - ofs << "\n"; - } - } - ofs.close(); - -#ifdef __MPI - if (GlobalV::RANK_IN_POOL < GlobalV::NPROC_IN_POOL - 1) - { - const char send_tmp = 'c'; - MPI_Isend(&send_tmp, 1, MPI_CHAR, GlobalV::RANK_IN_POOL + 1, mpi_tag, POOL_WORLD, &mpi_request); - } - else - { - mpi_request = MPI_REQUEST_NULL; - } -#endif - ModuleBase::timer::tick("ModuleIO", "write_chg_r_1"); -} -}; // namespace ModuleIO diff --git a/source/module_io/write_wfc_r.h b/source/module_io/write_wfc_r.h deleted file mode 100644 index f952c21603..0000000000 --- a/source/module_io/write_wfc_r.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef WRITE_WFC_R_H -#define WRITE_WFC_R_H - -#ifdef __MPI -#include "mpi.h" -#endif - -#include -#include -#include - -#include "source_base/complexmatrix.h" -#include "source_base/vector3.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/klist.h" -#include "source_psi/psi.h" - -namespace ModuleIO -{ - // write ||wfc_r|| for all k-points and all bands - // Input: wfc_g[ik](ib,ig) - // loop order is for(z){for(y){for(x)}} -void write_psi_r_1(const UnitCell& ucell, - const psi::Psi>& wfc_g, - const ModulePW::PW_Basis_K* wfcpw, - const std::string& folder_name, - const bool& square, - const K_Vectors& kv); - -// Input: wfc_g(ib,ig) -// Output: wfc_r[ir] -std::vector> cal_wfc_r(const ModulePW::PW_Basis_K* wfcpw, - const psi::Psi>& wfc_g, - const int ik, - const int ib); - -// Input: chg_r[ir] -void write_chg_r_1(const UnitCell& ucell, - const ModulePW::PW_Basis_K* wfcpw, - const std::vector& chg_r, - const std::string& file_name - #ifdef __MPI - ,MPI_Request& mpi_request - #endif - ); -} - -#endif From cce302d0babc65c8eb432c8074771650f6a64020 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:35:17 +0800 Subject: [PATCH 73/81] Update esolver_ks_lcao_tddft.cpp --- .../source_esolver/esolver_ks_lcao_tddft.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/source_esolver/esolver_ks_lcao_tddft.cpp b/source/source_esolver/esolver_ks_lcao_tddft.cpp index 20803dd35f..9d3528ea2c 100644 --- a/source/source_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/source_esolver/esolver_ks_lcao_tddft.cpp @@ -1,12 +1,12 @@ #include "esolver_ks_lcao_tddft.h" -#include "module_io/cal_r_overlap_R.h" -#include "module_io/dipole_io.h" -#include "module_io/td_current_io.h" -#include "module_io/read_wfc_nao.h" -#include "module_io/write_HS.h" -#include "module_io/write_HS_R.h" -#include "module_io/output_log.h" +#include "source_io/cal_r_overlap_R.h" +#include "source_io/dipole_io.h" +#include "source_io/td_current_io.h" +#include "source_io/read_wfc_nao.h" +#include "source_io/write_HS.h" +#include "source_io/write_HS_R.h" +#include "source_io/output_log.h" #include "source_estate/elecstate_tools.h" //--------------temporary---------------------------- @@ -19,21 +19,21 @@ #include "source_estate/module_dm/cal_edm_tddft.h" #include "source_estate/module_dm/density_matrix.h" #include "source_estate/occupy.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" +#include "source_lcao/module_tddft/evolve_elec.h" #include "source_pw/hamilt_pwdft/global.h" -#include "module_io/print_info.h" +#include "source_io/print_info.h" //-----HSolver ElecState Hamilt-------- #include "source_estate/cal_ux.h" #include "source_estate/elecstate_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_hsolver/hsolver_lcao.h" #include "module_parameter/parameter.h" #include "source_psi/psi.h" #include "source_estate/module_pot/H_TDDFT_pw.h" //-----force& stress------------------- -#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" +#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" //--------------------------------------------------- From a403d76cc25e5898a1b5bb3ca4138911dea312d7 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:36:04 +0800 Subject: [PATCH 74/81] Delete source/module_lr/lr_spectrum.h --- source/module_lr/lr_spectrum.h | 92 ---------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 source/module_lr/lr_spectrum.h diff --git a/source/module_lr/lr_spectrum.h b/source/module_lr/lr_spectrum.h deleted file mode 100644 index 052a85882a..0000000000 --- a/source/module_lr/lr_spectrum.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once -#include "source_cell/klist.h" -#include "module_lr/utils/gint_template.h" -#include "source_psi/psi.h" -#include "source_estate/module_dm/density_matrix.h" -#include "module_lr/utils/lr_util.h" -#include "source_basis/module_nao/two_center_bundle.h" -#include "module_hamilt_lcao/module_tddft/velocity_op.h" -namespace LR -{ - template - class LR_Spectrum - { - public: - LR_Spectrum(const int& nspin_global, const int& naos, const std::vector& nocc, const std::vector& nvirt, - typename TGint::type* gint, const ModulePW::PW_Basis& rho_basis, psi::Psi& psi_ks_in, - const UnitCell& ucell, const K_Vectors& kv_in, const Grid_Driver& gd, const std::vector& orb_cutoff, - const TwoCenterBundle& two_center_bundle_, - const std::vector& pX_in, const Parallel_2D& pc_in, const Parallel_Orbitals& pmat_in, - const double* eig, const T* X, const int& nstate, const bool& openshell, - const std::string& gauge = "length") : - nspin_x(openshell ? 2 : 1), naos(naos), nocc(nocc), nvirt(nvirt), nk(kv_in.get_nks() / nspin_global), - gint(gint), rho_basis(rho_basis), ucell(ucell), kv(kv_in), gd_(gd), - orb_cutoff_(orb_cutoff), two_center_bundle_(two_center_bundle_), - pX(pX_in), pc(pc_in), pmat(pmat_in), - eig(eig), X(X), nstate(nstate), - ldim(nk* (nspin_x == 2 ? pX_in[0].get_local_size() + pX_in[1].get_local_size() : pX_in[0].get_local_size())), - gdim(nk* std::inner_product(nocc.begin(), nocc.end(), nvirt.begin(), 0)) - { - for (int is = 0;is < nspin_global;++is) { psi_ks.emplace_back(LR_Util::get_psi_spin(psi_ks_in, is, nk)); } - gauge == "velocity" ? this->cal_transition_dipoles_velocity() : this->cal_transition_dipoles_length(); - this->oscillator_strength(); - }; - /// @brief calculate the optical absorption spectrum with $Im[1/[(w+i\eta)^2-\Omega_S^2]]$ - void optical_absorption_method1(const std::vector& freq, const double eta); - /// @brief calculate the optical absorption spectrum with lorentzian delta function - void optical_absorption_method2(const std::vector& freq, const double eta); - /// @brief print out the transition dipole moment and the main contributions to the transition amplitude - void transition_analysis(const std::string& spintype); - - //========================================== test functions ============================================== - /// @brief write transition dipole - void write_transition_dipole(const std::string& filename); - /// @brief calculate transition dipole in velocity gauge using ks eigenvalues instead of excitation energies - void test_transition_dipoles_velocity_ks(const double* const ks_eig); - //====================================================================================================== - private: - /// $$2/3\Omega\sum_{ia\sigma} |\braket{\psi_{i}|\mathbf{r}|\psi_{a}} |^2\int \rho_{\alpha\beta}(\mathbf{r}) \mathbf{r} d\mathbf{r}$$ - void oscillator_strength(); - /// calculate the transition dipole of state S in length gauge: $\sum_{iak}X^S_{iak}$ - ModuleBase::Vector3 cal_transition_dipole_istate_length(const int istate); - /// calculate the transition dipole of all states in length gauge - void cal_transition_dipoles_length(); - /// calculate the transition dipole of state S in velocity gauge: $i(\sum_{iak}X^S_{iak})/\Omega_S$ - ModuleBase::Vector3 cal_transition_dipole_istate_velocity_R(const int istate, const Velocity_op>& vR); - ModuleBase::Vector3 cal_transition_dipole_istate_velocity_k(const int istate, const Velocity_op>& vR); - /// calculate the transition dipole of all states in velocity gauge - void cal_transition_dipoles_velocity(); - double cal_mean_squared_dipole(ModuleBase::Vector3 dipole); - /// calculate the transition density matrix - elecstate::DensityMatrix cal_transition_density_matrix(const int istate, const T* X_in = nullptr, const bool need_R = true); - const int nspin_x = 1; ///< 1 for singlet/triplet, 2 for updown(openshell) - const int naos = 1; - const std::vector& nocc; - const std::vector& nvirt; - const int nk = 1; - const int nstate = 1; - const int ldim = 1;///< local leading dimension of X, or the data size of each state - const int gdim = 1;///< global leading dimension of X - const double ana_thr = 0.3; ///< {abs(X) > thr} will appear in the transition analysis log - const double* eig; - const T* X; - const K_Vectors& kv; - std::vector> psi_ks; - const std::vector& pX; - const Parallel_2D& pc; - const Parallel_Orbitals& pmat; - typename TGint::type* gint = nullptr; - const ModulePW::PW_Basis& rho_basis; - const Grid_Driver& gd_; - const UnitCell& ucell; - const std::vector& orb_cutoff_; - const TwoCenterBundle& two_center_bundle_; - - void cal_gint_rho(double** rho, const int& nrxx); - std::map get_pair_info(const int i); ///< given the index in X, return its ispin, ik, iocc, ivirt - - std::vector> transition_dipole_; ///< $\braket{ \psi_{i} | \mathbf{r} | \psi_{a} }$ - std::vector mean_squared_transition_dipole_; /// $|dipole|^2/3$, atomic unit (Hartree) - std::vector oscillator_strength_;///< $2/3\Omega |\sum_{ia\sigma} \braket{\psi_{i}|\mathbf{r}|\psi_{a}} |^2$, atomic unit (Hartree) - }; -} From f4bac2c9590d061edd611e1b1ca768448b8c6a23 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:36:22 +0800 Subject: [PATCH 75/81] Delete source/source_esolver/esolver_ks_lcao_tddft.cpp --- .../source_esolver/esolver_ks_lcao_tddft.cpp | 616 ------------------ 1 file changed, 616 deletions(-) delete mode 100644 source/source_esolver/esolver_ks_lcao_tddft.cpp diff --git a/source/source_esolver/esolver_ks_lcao_tddft.cpp b/source/source_esolver/esolver_ks_lcao_tddft.cpp deleted file mode 100644 index 9d3528ea2c..0000000000 --- a/source/source_esolver/esolver_ks_lcao_tddft.cpp +++ /dev/null @@ -1,616 +0,0 @@ -#include "esolver_ks_lcao_tddft.h" - -#include "source_io/cal_r_overlap_R.h" -#include "source_io/dipole_io.h" -#include "source_io/td_current_io.h" -#include "source_io/read_wfc_nao.h" -#include "source_io/write_HS.h" -#include "source_io/write_HS_R.h" -#include "source_io/output_log.h" -#include "source_estate/elecstate_tools.h" - -//--------------temporary---------------------------- -#include "source_base/blas_connector.h" -#include "source_base/global_function.h" -#include "source_base/lapack_connector.h" -#include "source_base/scalapack_connector.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "source_estate/module_dm/cal_dm_psi.h" -#include "source_estate/module_dm/cal_edm_tddft.h" -#include "source_estate/module_dm/density_matrix.h" -#include "source_estate/occupy.h" -#include "source_lcao/module_tddft/evolve_elec.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "source_io/print_info.h" - -//-----HSolver ElecState Hamilt-------- -#include "source_estate/cal_ux.h" -#include "source_estate/elecstate_lcao.h" -#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_hsolver/hsolver_lcao.h" -#include "module_parameter/parameter.h" -#include "source_psi/psi.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" - -//-----force& stress------------------- -#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" - -//--------------------------------------------------- - -namespace ModuleESolver -{ - -template -ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() -{ - this->classname = "ESolver_rtTDDFT"; - this->basisname = "LCAO"; - - // If the device is GPU, we must open use_tensor and use_lapack - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - if (ct_device_type == ct::DeviceType::GpuDevice) - { - use_tensor = true; - use_lapack = true; - } -} - -template -ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() -{ - delete psi_laststep; - if (Hk_laststep != nullptr) - { - for (int ik = 0; ik < this->kv.get_nks(); ++ik) - { - delete[] Hk_laststep[ik]; - } - delete[] Hk_laststep; - } - if (Sk_laststep != nullptr) - { - for (int ik = 0; ik < this->kv.get_nks(); ++ik) - { - delete[] Sk_laststep[ik]; - } - delete[] Sk_laststep; - } - if (td_p != nullptr) - { - delete td_p; - } - TD_info::td_vel_op = nullptr; -} - -template -void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const Input_para& inp) -{ - // 1) run before_all_runners in ESolver_KS_LCAO - ESolver_KS_LCAO, TR>::before_all_runners(ucell, inp); - - // this line should be optimized - // this->pelec = dynamic_cast(this->pelec); - - td_p = new TD_info(&ucell); - TD_info::td_vel_op = td_p; - totstep += TD_info::estep_shift; - - if (PARAM.inp.init_wfc == "file") - { - if (!ModuleIO::read_wfc_nao(PARAM.globalv.global_readin_dir, - this->pv, - *(this->psi), - this->pelec, - this->pelec->klist->ik2iktot, - this->pelec->klist->get_nkstot(), - PARAM.inp.nspin, - TD_info::estep_shift)) - { - ModuleBase::WARNING_QUIT("ESolver_KS_LCAO", "read electronic wave functions failed"); - } - } -} -template -void ESolver_KS_LCAO_TDDFT::runner(UnitCell& ucell, const int istep) -{ - ModuleBase::TITLE("ESolver_KS_LCAO_TDDFT", "runner"); - ModuleBase::timer::tick(this->classname, "runner"); - - //---------------------------------------------------------------- - // 1) before_scf (electronic iteration loops) - //---------------------------------------------------------------- - this->before_scf(ucell, istep); - ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT SCF"); - - // things only initialize once - //this->pelec_td->first_evolve = true; - if(PARAM.inp.td_stype!=1 && TD_info::out_current) - { - // initialize the velocity operator - velocity_mat = new Velocity_op(&ucell, &(this->gd), &this->pv, this->orb_, this->two_center_bundle_.overlap_orb.get()); - //calculate velocity operator - velocity_mat->calculate_grad_term(); - velocity_mat->calculate_vcomm_r(); - } - int estep_max = (istep == 0) ? PARAM.inp.estep_per_md +1 : PARAM.inp.estep_per_md; - //int estep_max = PARAM.inp.estep_per_md; - for(int estep =0; estep < estep_max; estep++) - { - // calculate total time step - this->totstep++; - this->print_step(); - //update At - if(PARAM.inp.td_stype > 0) - { - elecstate::H_TDDFT_pw::update_At(); - td_p->cal_cart_At(elecstate::H_TDDFT_pw::At); - } - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", td_p->cart_At[0]); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ay(t)", td_p->cart_At[1]); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Az(t)", td_p->cart_At[2]); - //std::cout<<"Et: "<CE.update_all_dis(ucell); - this->CE.extrapolate_charge(&this->Pgrid, - ucell, - &this->chr, - &this->sf, - GlobalV::ofs_running, - GlobalV::ofs_warning); - //need to test if correct when estep>0 - this->pelec->init_scf(totstep, ucell, this->Pgrid, this->sf.strucFac, this->locpp.numeric, ucell.symm); - /*if(PARAM.inp.td_stype == 2) - { - dynamic_cast>*>(this->pelec)->get_DM()->cal_DMR_td(ucell, td_p->cart_At); - } - else - { - dynamic_cast>*>(this->pelec)->get_DM()->cal_DMR(); - }*/ - - if(totstep <= PARAM.inp.td_tend + 1) - { - TD_info::evolve_once = true; - } - } - //---------------------------------------------------------------- - // 2) SCF iterations - //---------------------------------------------------------------- - bool conv_esolver = false; - this->niter = this->maxniter; - this->diag_ethr = PARAM.inp.pw_diag_thr; - for (int iter = 1; iter <= this->maxniter; ++iter) - { - ModuleIO::write_head_td(GlobalV::ofs_running, istep, estep, iter, this->basisname); - //---------------------------------------------------------------- - // 3) initialization of SCF iterations - //---------------------------------------------------------------- - this->iter_init(ucell, totstep, iter); - - //---------------------------------------------------------------- - // 4) use Hamiltonian to obtain charge density - //---------------------------------------------------------------- - this->hamilt2rho(ucell, totstep, iter, this->diag_ethr); - - //---------------------------------------------------------------- - // 5) finish scf iterations - //---------------------------------------------------------------- - this->iter_finish(ucell, totstep, iter, conv_esolver); - - //---------------------------------------------------------------- - // 6) check convergence - //---------------------------------------------------------------- - if (conv_esolver || this->oscillate_esolver) - { - this->niter = iter; - if (this->oscillate_esolver) - { - std::cout << " !! Density oscillation is found, STOP HERE !!" << std::endl; - } - break; - } - } // end scf iterations - - //---------------------------------------------------------------- - // 7) after scf - //---------------------------------------------------------------- - this->after_scf(ucell, totstep, conv_esolver); - if(!restart_done && PARAM.inp.mdp.md_restart) - { - estep += TD_info::estep_shift%PARAM.inp.estep_per_md; - restart_done = true; - if(estep==0)break; - } - } - if(PARAM.inp.td_stype!=1 && TD_info::out_current) - { - delete velocity_mat; - } - ModuleBase::timer::tick(this->classname, "runner"); - return; -} -//output electronic step infos -template -void ESolver_KS_LCAO_TDDFT::print_step() -{ - std::cout << " -------------------------------------------" << std::endl; - GlobalV::ofs_running << "\n -------------------------------------------" << std::endl; - std::cout << " STEP OF ELECTRON EVOLVE : " << unsigned(totstep) << std::endl; - GlobalV::ofs_running << " STEP OF ELECTRON EVOLVE : " << unsigned(totstep) << std::endl; - std::cout << " -------------------------------------------" << std::endl; - GlobalV::ofs_running << " -------------------------------------------" << std::endl; -} -template -void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, - const int istep, - const int iter, - const double ethr) -{ - if (PARAM.inp.init_wfc == "file") - { - if (istep >= TD_info::estep_shift + 1) - { - module_tddft::Evolve_elec::solve_psi(istep, - PARAM.inp.nbands, - PARAM.globalv.nlocal, - this->kv.get_nks(), - this->p_hamilt, - this->pv, - this->psi, - this->psi_laststep, - this->Hk_laststep, - this->Sk_laststep, - this->pelec->ekb, - GlobalV::ofs_running, - td_htype, - PARAM.inp.propagator, - use_tensor, - use_lapack); - } - this->weight_dm_rho(ucell); - } - else if (istep >= 1) - { - module_tddft::Evolve_elec::solve_psi(istep, - PARAM.inp.nbands, - PARAM.globalv.nlocal, - this->kv.get_nks(), - this->p_hamilt, - this->pv, - this->psi, - this->psi_laststep, - this->Hk_laststep, - this->Sk_laststep, - this->pelec->ekb, - GlobalV::ofs_running, - td_htype, - PARAM.inp.propagator, - use_tensor, - use_lapack); - this->weight_dm_rho(ucell); - } - else - { - // reset energy - this->pelec->f_en.eband = 0.0; - this->pelec->f_en.demet = 0.0; - if (this->psi != nullptr) - { - bool skip_charge = PARAM.inp.calculation == "nscf" ? true : false; - hsolver::HSolverLCAO> hsolver_lcao_obj(&this->pv, PARAM.inp.ks_solver); - hsolver_lcao_obj.solve(this->p_hamilt, this->psi[0], this->pelec, skip_charge); - } - } - - // symmetrize the charge density only for ground state - if (istep <= 1) - { - Symmetry_rho srho; - for (int is = 0; is < PARAM.inp.nspin; is++) - { - srho.begin(is, this->chr, this->pw_rho, ucell.symm); - } - } - - // (7) calculate delta energy - this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); -} - -template -void ESolver_KS_LCAO_TDDFT::iter_finish( - UnitCell& ucell, - const int istep, - int& iter, - bool& conv_esolver) -{ - // print occupation of each band - if (iter == 1 && istep <= 2) - { - GlobalV::ofs_running << " ---------------------------------------------------------" - << std::endl; - GlobalV::ofs_running << " occupations of electrons" << std::endl; - GlobalV::ofs_running << " k-point state occupation" << std::endl; - GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); - GlobalV::ofs_running << std::left; - std::setprecision(6); - for (int ik = 0; ik < this->kv.get_nks(); ik++) - { - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - GlobalV::ofs_running << " " << std::setw(9) - << ik+1 << std::setw(8) << ib + 1 - << std::setw(12) << this->pelec->wg(ik, ib) << std::endl; - } - } - GlobalV::ofs_running << " ---------------------------------------------------------" - << std::endl; - } - - ESolver_KS_LCAO, TR>::iter_finish(ucell, istep, iter, conv_esolver); -} - -template -void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, - const int istep, - const int iter, - const bool conv_esolver) -{ - // Calculate new potential according to new Charge Density - if (!conv_esolver) - { - elecstate::cal_ux(ucell); - this->pelec->pot->update_from_charge(&this->chr, &ucell); - this->pelec->f_en.descf = this->pelec->cal_delta_escf(); - } - else - { - this->pelec->cal_converged(); - } - - const int nloc = this->pv.nloc; - const int ncol_nbands = this->pv.ncol_bands; - const int nrow = this->pv.nrow; - const int nbands = PARAM.inp.nbands; - const int nlocal = PARAM.globalv.nlocal; - - // store wfc and Hk laststep - if (conv_esolver) - { - if (this->psi_laststep == nullptr) - { - int ncol_tmp = 0; - int nrow_tmp = 0; -#ifdef __MPI - ncol_tmp = ncol_nbands; - nrow_tmp = nrow; -#else - ncol_tmp = nbands; - nrow_tmp = nlocal; -#endif - this->psi_laststep = new psi::Psi>(this->kv.get_nks(), ncol_tmp, nrow_tmp, this->kv.ngk, true); - - } - - // allocate memory for Hk_laststep and Sk_laststep - if (td_htype == 1) - { - // Length of Hk_laststep and Sk_laststep, nlocal * nlocal for global, nloc for local - const int len_HS = use_tensor && use_lapack ? nlocal * nlocal : nloc; - - if (this->Hk_laststep == nullptr) - { - this->Hk_laststep = new std::complex*[this->kv.get_nks()]; - for (int ik = 0; ik < this->kv.get_nks(); ++ik) - { - // Allocate memory for Hk_laststep, if (use_tensor && use_lapack), should be global - this->Hk_laststep[ik] = new std::complex[len_HS]; - ModuleBase::GlobalFunc::ZEROS(Hk_laststep[ik], len_HS); - } - } - if (this->Sk_laststep == nullptr) - { - this->Sk_laststep = new std::complex*[this->kv.get_nks()]; - for (int ik = 0; ik < this->kv.get_nks(); ++ik) - { - // Allocate memory for Sk_laststep, if (use_tensor && use_lapack), should be global - this->Sk_laststep[ik] = new std::complex[len_HS]; - ModuleBase::GlobalFunc::ZEROS(Sk_laststep[ik], len_HS); - } - } - } - - // put information to Hk_laststep and Sk_laststep - for (int ik = 0; ik < this->kv.get_nks(); ++ik) - { - this->psi->fix_k(ik); - this->psi_laststep->fix_k(ik); - - // copy the data from psi to psi_laststep - const int size0 = this->psi->get_nbands() * this->psi->get_nbasis(); - for (int index = 0; index < size0; ++index) - { - psi_laststep[0].get_pointer()[index] = this->psi[0].get_pointer()[index]; - } - - // store Hamiltonian - if (td_htype == 1) - { - this->p_hamilt->updateHk(ik); - hamilt::MatrixBlock> h_mat; - hamilt::MatrixBlock> s_mat; - this->p_hamilt->matrix(h_mat, s_mat); - - if (use_tensor && use_lapack) - { - // Gather H and S matrices to root process -#ifdef __MPI - int myid = 0; - int num_procs = 1; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - MPI_Comm_size(MPI_COMM_WORLD, &num_procs); - - Matrix_g> h_mat_g; // Global matrix structure - Matrix_g> s_mat_g; // Global matrix structure - - // Collect H matrix - gatherMatrix(myid, 0, h_mat, h_mat_g); - BlasConnector::copy(nlocal * nlocal, h_mat_g.p.get(), 1, Hk_laststep[ik], 1); - - // Collect S matrix - gatherMatrix(myid, 0, s_mat, s_mat_g); - BlasConnector::copy(nlocal * nlocal, s_mat_g.p.get(), 1, Sk_laststep[ik], 1); -#endif - } - else - { - BlasConnector::copy(nloc, h_mat.p, 1, Hk_laststep[ik], 1); - BlasConnector::copy(nloc, s_mat.p, 1, Sk_laststep[ik], 1); - } - } - } - - // calculate energy density matrix for tddft - if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) && PARAM.inp.td_edm == 0) - { - elecstate::cal_edm_tddft(this->pv, this->pelec, this->kv, this->p_hamilt); - } - } - - // print "eigen value" for tddft -// it seems uncessary to print out E_ii because the band energies are printed -/* - if (conv_esolver) - { - GlobalV::ofs_running << "----------------------------------------------------------" - << std::endl; - GlobalV::ofs_running << " Print E= " << std::endl; - GlobalV::ofs_running << " k-point state energy (eV)" << std::endl; - GlobalV::ofs_running << "----------------------------------------------------------" - << std::endl; - GlobalV::ofs_running << std::setprecision(6); - GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); - - for (int ik = 0; ik < this->kv.get_nks(); ik++) - { - for (int ib = 0; ib < PARAM.inp.nbands; ib++) - { - GlobalV::ofs_running << " " << std::setw(7) << ik + 1 - << std::setw(7) << ib + 1 - << std::setw(10) << this->pelec->ekb(ik, ib) * ModuleBase::Ry_to_eV - << std::endl; - } - } - } -*/ -} - -template -void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) -{ - ModuleBase::TITLE("ESolver_LCAO_TDDFT", "after_scf"); - ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); - - ESolver_KS_LCAO, TR>::after_scf(ucell, istep, conv_esolver); - - // (1) write dipole information - for (int is = 0; is < PARAM.inp.nspin; is++) - { - if (PARAM.inp.out_dipole == 1) - { - std::stringstream ss_dipole; - ss_dipole << PARAM.globalv.global_out_dir << "SPIN" << is + 1 << "_DIPOLE"; - ModuleIO::write_dipole(ucell, - this->chr.rho_save[is], - this->chr.rhopw, - is, - istep, - ss_dipole.str()); - } - } - elecstate::DensityMatrix, double>* tmp_DM - = dynamic_cast>*>(this->pelec)->get_DM(); - // (2) write current information - if(TD_info::out_current) - { - if(TD_info::out_current_k) - { - ModuleIO::write_current_eachk(ucell, - istep, - this->psi, - this->pelec, - this->kv, - this->two_center_bundle_.overlap_orb.get(), - tmp_DM->get_paraV_pointer(), - this->orb_, - this->velocity_mat, - this->RA); - } - else - { - ModuleIO::write_current(ucell, - istep, - this->psi, - this->pelec, - this->kv, - this->two_center_bundle_.overlap_orb.get(), - tmp_DM->get_paraV_pointer(), - this->orb_, - this->velocity_mat, - this->RA); - } - } - // (3) output energy for sub loop - std::cout << "Potential (Ry): " << std::setprecision(15) << this->pelec->f_en.etot <out_restart_info(istep, elecstate::H_TDDFT_pw::At, elecstate::H_TDDFT_pw::At_laststep); - } - - ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); -} - -template -void ESolver_KS_LCAO_TDDFT::weight_dm_rho(const UnitCell& ucell) -{ - if (PARAM.inp.ocp == 1) - { - elecstate::fixed_weights(PARAM.inp.ocp_kb, - PARAM.inp.nbands, - PARAM.inp.nelec, - this->pelec->klist, - this->pelec->wg, - this->pelec->skip_weights); - } - - // calculate Eband energy - elecstate::calEBand(this->pelec->ekb,this->pelec->wg,this->pelec->f_en); - - // calculate the density matrix - ModuleBase::GlobalFunc::NOTE("Calculate the density matrix."); - - auto _pes = dynamic_cast>*>(this->pelec); - elecstate::cal_dm_psi(_pes->DM->get_paraV_pointer(), _pes->wg, this->psi[0], *(_pes->DM)); - if(PARAM.inp.td_stype == 2) - { - _pes->DM->cal_DMR_td(ucell, td_p->cart_At); - } - else - { - _pes->DM->cal_DMR(); - } - - // get the real-space charge density - this->pelec->psiToRho(this->psi[0]); -} - -template class ESolver_KS_LCAO_TDDFT; -template class ESolver_KS_LCAO_TDDFT, base_device::DEVICE_CPU>; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template class ESolver_KS_LCAO_TDDFT; -template class ESolver_KS_LCAO_TDDFT, base_device::DEVICE_GPU>; -#endif - -} // namespace ModuleESolver From b277fcb007cca29e3ccd8edb533894a269463254 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:38:30 +0800 Subject: [PATCH 76/81] Add files via upload --- source/module_lr/lr_spectrum.h | 92 ++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 source/module_lr/lr_spectrum.h diff --git a/source/module_lr/lr_spectrum.h b/source/module_lr/lr_spectrum.h new file mode 100644 index 0000000000..aee905ccdf --- /dev/null +++ b/source/module_lr/lr_spectrum.h @@ -0,0 +1,92 @@ +#pragma once +#include "source_cell/klist.h" +#include "module_lr/utils/gint_template.h" +#include "source_psi/psi.h" +#include "source_estate/module_dm/density_matrix.h" +#include "module_lr/utils/lr_util.h" +#include "source_basis/module_nao/two_center_bundle.h" +#include "source_lcao/module_tddft/td_current.h" +namespace LR +{ + template + class LR_Spectrum + { + public: + LR_Spectrum(const int& nspin_global, const int& naos, const std::vector& nocc, const std::vector& nvirt, + typename TGint::type* gint, const ModulePW::PW_Basis& rho_basis, psi::Psi& psi_ks_in, + const UnitCell& ucell, const K_Vectors& kv_in, const Grid_Driver& gd, const std::vector& orb_cutoff, + const TwoCenterBundle& two_center_bundle_, + const std::vector& pX_in, const Parallel_2D& pc_in, const Parallel_Orbitals& pmat_in, + const double* eig, const T* X, const int& nstate, const bool& openshell, + const std::string& gauge = "length") : + nspin_x(openshell ? 2 : 1), naos(naos), nocc(nocc), nvirt(nvirt), nk(kv_in.get_nks() / nspin_global), + gint(gint), rho_basis(rho_basis), ucell(ucell), kv(kv_in), gd_(gd), + orb_cutoff_(orb_cutoff), two_center_bundle_(two_center_bundle_), + pX(pX_in), pc(pc_in), pmat(pmat_in), + eig(eig), X(X), nstate(nstate), + ldim(nk* (nspin_x == 2 ? pX_in[0].get_local_size() + pX_in[1].get_local_size() : pX_in[0].get_local_size())), + gdim(nk* std::inner_product(nocc.begin(), nocc.end(), nvirt.begin(), 0)) + { + for (int is = 0;is < nspin_global;++is) { psi_ks.emplace_back(LR_Util::get_psi_spin(psi_ks_in, is, nk)); } + gauge == "velocity" ? this->cal_transition_dipoles_velocity() : this->cal_transition_dipoles_length(); + this->oscillator_strength(); + }; + /// @brief calculate the optical absorption spectrum with $Im[1/[(w+i\eta)^2-\Omega_S^2]]$ + void optical_absorption_method1(const std::vector& freq, const double eta); + /// @brief calculate the optical absorption spectrum with lorentzian delta function + void optical_absorption_method2(const std::vector& freq, const double eta); + /// @brief print out the transition dipole moment and the main contributions to the transition amplitude + void transition_analysis(const std::string& spintype); + + //========================================== test functions ============================================== + /// @brief write transition dipole + void write_transition_dipole(const std::string& filename); + /// @brief calculate transition dipole in velocity gauge using ks eigenvalues instead of excitation energies + void test_transition_dipoles_velocity_ks(const double* const ks_eig); + //====================================================================================================== + private: + /// $$2/3\Omega\sum_{ia\sigma} |\braket{\psi_{i}|\mathbf{r}|\psi_{a}} |^2\int \rho_{\alpha\beta}(\mathbf{r}) \mathbf{r} d\mathbf{r}$$ + void oscillator_strength(); + /// calculate the transition dipole of state S in length gauge: $\sum_{iak}X^S_{iak}$ + ModuleBase::Vector3 cal_transition_dipole_istate_length(const int istate); + /// calculate the transition dipole of all states in length gauge + void cal_transition_dipoles_length(); + /// calculate the transition dipole of state S in velocity gauge: $i(\sum_{iak}X^S_{iak})/\Omega_S$ + ModuleBase::Vector3 cal_transition_dipole_istate_velocity_R(const int istate, const TD_current& vR); + ModuleBase::Vector3 cal_transition_dipole_istate_velocity_k(const int istate, const TD_current& vR); + /// calculate the transition dipole of all states in velocity gauge + void cal_transition_dipoles_velocity(); + double cal_mean_squared_dipole(ModuleBase::Vector3 dipole); + /// calculate the transition density matrix + elecstate::DensityMatrix cal_transition_density_matrix(const int istate, const T* X_in = nullptr, const bool need_R = true); + const int nspin_x = 1; ///< 1 for singlet/triplet, 2 for updown(openshell) + const int naos = 1; + const std::vector& nocc; + const std::vector& nvirt; + const int nk = 1; + const int nstate = 1; + const int ldim = 1;///< local leading dimension of X, or the data size of each state + const int gdim = 1;///< global leading dimension of X + const double ana_thr = 0.3; ///< {abs(X) > thr} will appear in the transition analysis log + const double* eig; + const T* X; + const K_Vectors& kv; + std::vector> psi_ks; + const std::vector& pX; + const Parallel_2D& pc; + const Parallel_Orbitals& pmat; + typename TGint::type* gint = nullptr; + const ModulePW::PW_Basis& rho_basis; + const Grid_Driver& gd_; + const UnitCell& ucell; + const std::vector& orb_cutoff_; + const TwoCenterBundle& two_center_bundle_; + + void cal_gint_rho(double** rho, const int& nrxx); + std::map get_pair_info(const int i); ///< given the index in X, return its ispin, ik, iocc, ivirt + + std::vector> transition_dipole_; ///< $\braket{ \psi_{i} | \mathbf{r} | \psi_{a} }$ + std::vector mean_squared_transition_dipole_; /// $|dipole|^2/3$, atomic unit (Hartree) + std::vector oscillator_strength_;///< $2/3\Omega |\sum_{ia\sigma} \braket{\psi_{i}|\mathbf{r}|\psi_{a}} |^2$, atomic unit (Hartree) + }; +} From 88fc3ec5076a72407bfb9fbc642fe06f23198569 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:38:57 +0800 Subject: [PATCH 77/81] Add files via upload --- .../source_esolver/esolver_ks_lcao_tddft.cpp | 431 ++++++++++++++++++ 1 file changed, 431 insertions(+) create mode 100644 source/source_esolver/esolver_ks_lcao_tddft.cpp diff --git a/source/source_esolver/esolver_ks_lcao_tddft.cpp b/source/source_esolver/esolver_ks_lcao_tddft.cpp new file mode 100644 index 0000000000..8c71cc2df2 --- /dev/null +++ b/source/source_esolver/esolver_ks_lcao_tddft.cpp @@ -0,0 +1,431 @@ +#include "esolver_ks_lcao_tddft.h" + +#include "source_io/cal_r_overlap_R.h" +#include "source_io/dipole_io.h" +#include "source_io/td_current_io.h" +#include "source_io/write_HS.h" +#include "source_io/write_HS_R.h" +#include "source_estate/elecstate_tools.h" + +//--------------temporary---------------------------- +#include "source_base/blas_connector.h" +#include "source_base/global_function.h" +#include "source_base/lapack_connector.h" +#include "source_base/scalapack_connector.h" +#include "source_estate/module_charge/symmetry_rho.h" +#include "source_estate/module_dm/cal_dm_psi.h" +#include "source_estate/module_dm/cal_edm_tddft.h" +#include "source_estate/module_dm/density_matrix.h" +#include "source_estate/occupy.h" +#include "source_lcao/module_tddft/evolve_elec.h" +#include "source_lcao/module_tddft/td_velocity.h" +#include "source_pw/hamilt_pwdft/global.h" +#include "source_io/print_info.h" + +//-----HSolver ElecState Hamilt-------- +#include "source_estate/cal_ux.h" +#include "source_estate/elecstate_lcao.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_hsolver/hsolver_lcao.h" +#include "module_parameter/parameter.h" +#include "source_psi/psi.h" + +//-----force& stress------------------- +#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" + +//--------------------------------------------------- + +namespace ModuleESolver +{ + +template +ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() +{ + classname = "ESolver_rtTDDFT"; + basisname = "LCAO"; + + // If the device is GPU, we must open use_tensor and use_lapack + ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; + if (ct_device_type == ct::DeviceType::GpuDevice) + { + use_tensor = true; + use_lapack = true; + } +} + +template +ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() +{ + delete psi_laststep; + if (Hk_laststep != nullptr) + { + for (int ik = 0; ik < kv.get_nks(); ++ik) + { + delete[] Hk_laststep[ik]; + } + delete[] Hk_laststep; + } + if (Sk_laststep != nullptr) + { + for (int ik = 0; ik < kv.get_nks(); ++ik) + { + delete[] Sk_laststep[ik]; + } + delete[] Sk_laststep; + } +} + +template +void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const Input_para& inp) +{ + // 1) run before_all_runners in ESolver_KS_LCAO + ESolver_KS_LCAO, double>::before_all_runners(ucell, inp); + + // this line should be optimized + // this->pelec = dynamic_cast(this->pelec); +} + +template +void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, + const int istep, + const int iter, + const double ethr) +{ + if (PARAM.inp.init_wfc == "file") + { + if (istep >= 1) + { + module_tddft::Evolve_elec::solve_psi(istep, + PARAM.inp.nbands, + PARAM.globalv.nlocal, + kv.get_nks(), + this->p_hamilt, + this->pv, + this->psi, + this->psi_laststep, + this->Hk_laststep, + this->Sk_laststep, + this->pelec->ekb, + GlobalV::ofs_running, + td_htype, + PARAM.inp.propagator, + use_tensor, + use_lapack); + this->weight_dm_rho(); + } + this->weight_dm_rho(); + } + else if (istep >= 2) + { + module_tddft::Evolve_elec::solve_psi(istep, + PARAM.inp.nbands, + PARAM.globalv.nlocal, + kv.get_nks(), + this->p_hamilt, + this->pv, + this->psi, + this->psi_laststep, + this->Hk_laststep, + this->Sk_laststep, + this->pelec->ekb, + GlobalV::ofs_running, + td_htype, + PARAM.inp.propagator, + use_tensor, + use_lapack); + this->weight_dm_rho(); + } + else + { + // reset energy + this->pelec->f_en.eband = 0.0; + this->pelec->f_en.demet = 0.0; + if (this->psi != nullptr) + { + bool skip_charge = PARAM.inp.calculation == "nscf" ? true : false; + hsolver::HSolverLCAO> hsolver_lcao_obj(&this->pv, PARAM.inp.ks_solver); + hsolver_lcao_obj.solve(this->p_hamilt, this->psi[0], this->pelec, skip_charge); + } + } + + // symmetrize the charge density only for ground state + if (istep <= 1) + { + Symmetry_rho srho; + for (int is = 0; is < PARAM.inp.nspin; is++) + { + srho.begin(is, this->chr, pw_rho, ucell.symm); + } + } + + // (7) calculate delta energy + this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); +} + +template +void ESolver_KS_LCAO_TDDFT::iter_finish( + UnitCell& ucell, + const int istep, + int& iter, + bool& conv_esolver) +{ + // print occupation of each band + if (iter == 1 && istep <= 2) + { + GlobalV::ofs_running << " ---------------------------------------------------------" + << std::endl; + GlobalV::ofs_running << " occupations of electrons" << std::endl; + GlobalV::ofs_running << " k-point state occupation" << std::endl; + GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); + GlobalV::ofs_running << std::left; + std::setprecision(6); + for (int ik = 0; ik < kv.get_nks(); ik++) + { + for (int ib = 0; ib < PARAM.inp.nbands; ib++) + { + GlobalV::ofs_running << " " << std::setw(9) + << ik+1 << std::setw(8) << ib + 1 + << std::setw(12) << this->pelec->wg(ik, ib) << std::endl; + } + } + GlobalV::ofs_running << " ---------------------------------------------------------" + << std::endl; + } + + ESolver_KS_LCAO, double>::iter_finish(ucell, istep, iter, conv_esolver); +} + +template +void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, + const int istep, + const int iter, + const bool conv_esolver) +{ + // Calculate new potential according to new Charge Density + if (!conv_esolver) + { + elecstate::cal_ux(ucell); + this->pelec->pot->update_from_charge(&this->chr, &ucell); + this->pelec->f_en.descf = this->pelec->cal_delta_escf(); + } + else + { + this->pelec->cal_converged(); + } + + const int nloc = this->pv.nloc; + const int ncol_nbands = this->pv.ncol_bands; + const int nrow = this->pv.nrow; + const int nbands = PARAM.inp.nbands; + const int nlocal = PARAM.globalv.nlocal; + + // store wfc and Hk laststep + if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) && conv_esolver) + { + if (this->psi_laststep == nullptr) + { + int ncol_tmp = 0; + int nrow_tmp = 0; +#ifdef __MPI + ncol_tmp = ncol_nbands; + nrow_tmp = nrow; +#else + ncol_tmp = nbands; + nrow_tmp = nlocal; +#endif + this->psi_laststep = new psi::Psi>(kv.get_nks(), ncol_tmp, nrow_tmp, kv.ngk, true); + + } + + // allocate memory for Hk_laststep and Sk_laststep + if (td_htype == 1) + { + // Length of Hk_laststep and Sk_laststep, nlocal * nlocal for global, nloc for local + const int len_HS = use_tensor && use_lapack ? nlocal * nlocal : nloc; + + if (this->Hk_laststep == nullptr) + { + this->Hk_laststep = new std::complex*[kv.get_nks()]; + for (int ik = 0; ik < kv.get_nks(); ++ik) + { + // Allocate memory for Hk_laststep, if (use_tensor && use_lapack), should be global + this->Hk_laststep[ik] = new std::complex[len_HS]; + ModuleBase::GlobalFunc::ZEROS(Hk_laststep[ik], len_HS); + } + } + if (this->Sk_laststep == nullptr) + { + this->Sk_laststep = new std::complex*[kv.get_nks()]; + for (int ik = 0; ik < kv.get_nks(); ++ik) + { + // Allocate memory for Sk_laststep, if (use_tensor && use_lapack), should be global + this->Sk_laststep[ik] = new std::complex[len_HS]; + ModuleBase::GlobalFunc::ZEROS(Sk_laststep[ik], len_HS); + } + } + } + + // put information to Hk_laststep and Sk_laststep + for (int ik = 0; ik < kv.get_nks(); ++ik) + { + this->psi->fix_k(ik); + this->psi_laststep->fix_k(ik); + + // copy the data from psi to psi_laststep + const int size0 = psi->get_nbands() * psi->get_nbasis(); + for (int index = 0; index < size0; ++index) + { + psi_laststep[0].get_pointer()[index] = psi[0].get_pointer()[index]; + } + + // store Hamiltonian + if (td_htype == 1) + { + this->p_hamilt->updateHk(ik); + hamilt::MatrixBlock> h_mat; + hamilt::MatrixBlock> s_mat; + this->p_hamilt->matrix(h_mat, s_mat); + + if (use_tensor && use_lapack) + { + // Gather H and S matrices to root process +#ifdef __MPI + int myid = 0; + int num_procs = 1; + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + Matrix_g> h_mat_g; // Global matrix structure + Matrix_g> s_mat_g; // Global matrix structure + + // Collect H matrix + gatherMatrix(myid, 0, h_mat, h_mat_g); + BlasConnector::copy(nlocal * nlocal, h_mat_g.p.get(), 1, Hk_laststep[ik], 1); + + // Collect S matrix + gatherMatrix(myid, 0, s_mat, s_mat_g); + BlasConnector::copy(nlocal * nlocal, s_mat_g.p.get(), 1, Sk_laststep[ik], 1); +#endif + } + else + { + BlasConnector::copy(nloc, h_mat.p, 1, Hk_laststep[ik], 1); + BlasConnector::copy(nloc, s_mat.p, 1, Sk_laststep[ik], 1); + } + } + } + + // calculate energy density matrix for tddft + if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 2) && PARAM.inp.td_edm == 0) + { + elecstate::cal_edm_tddft(this->pv, this->pelec, this->kv, this->p_hamilt); + } + } + + // print "eigen value" for tddft +// it seems uncessary to print out E_ii because the band energies are printed +/* + if (conv_esolver) + { + GlobalV::ofs_running << "----------------------------------------------------------" + << std::endl; + GlobalV::ofs_running << " Print E= " << std::endl; + GlobalV::ofs_running << " k-point state energy (eV)" << std::endl; + GlobalV::ofs_running << "----------------------------------------------------------" + << std::endl; + GlobalV::ofs_running << std::setprecision(6); + GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); + + for (int ik = 0; ik < kv.get_nks(); ik++) + { + for (int ib = 0; ib < PARAM.inp.nbands; ib++) + { + GlobalV::ofs_running << " " << std::setw(7) << ik + 1 + << std::setw(7) << ib + 1 + << std::setw(10) << this->pelec->ekb(ik, ib) * ModuleBase::Ry_to_eV + << std::endl; + } + } + } +*/ +} + +template +void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) +{ + ModuleBase::TITLE("ESolver_LCAO_TDDFT", "after_scf"); + ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); + + ESolver_KS_LCAO, double>::after_scf(ucell, istep, conv_esolver); + + // (1) write dipole information + for (int is = 0; is < PARAM.inp.nspin; is++) + { + if (PARAM.inp.out_dipole == 1) + { + std::stringstream ss_dipole; + ss_dipole << PARAM.globalv.global_out_dir << "SPIN" << is + 1 << "_DIPOLE"; + ModuleIO::write_dipole(ucell, + this->chr.rho_save[is], + this->chr.rhopw, + is, + istep, + ss_dipole.str()); + } + } + + // (2) write current information + if (TD_Velocity::out_current == true) + { + elecstate::DensityMatrix, double>* tmp_DM + = dynamic_cast>*>(this->pelec)->get_DM(); + + ModuleIO::write_current(ucell, + this->gd, + istep, + this->psi, + pelec, + kv, + two_center_bundle_.overlap_orb.get(), + tmp_DM->get_paraV_pointer(), + orb_, + this->RA); + } + + + ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); +} + +template +void ESolver_KS_LCAO_TDDFT::weight_dm_rho() +{ + if (PARAM.inp.ocp == 1) + { + elecstate::fixed_weights(PARAM.inp.ocp_kb, + PARAM.inp.nbands, + PARAM.inp.nelec, + this->pelec->klist, + this->pelec->wg, + this->pelec->skip_weights); + } + + // calculate Eband energy + elecstate::calEBand(this->pelec->ekb,this->pelec->wg,this->pelec->f_en); + + // calculate the density matrix + ModuleBase::GlobalFunc::NOTE("Calculate the density matrix."); + + auto _pes = dynamic_cast>*>(this->pelec); + elecstate::cal_dm_psi(_pes->DM->get_paraV_pointer(), _pes->wg, this->psi[0], *(_pes->DM)); + _pes->DM->cal_DMR(); + + // get the real-space charge density + this->pelec->psiToRho(this->psi[0]); +} + +template class ESolver_KS_LCAO_TDDFT; +#if ((defined __CUDA) /* || (defined __ROCM) */) +template class ESolver_KS_LCAO_TDDFT; +#endif + +} // namespace ModuleESolver From 115d5e8f622ab6f6541ed76e1b6ea3efac59be11 Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:42:39 +0800 Subject: [PATCH 78/81] Add files via upload --- source/module_lr/lr_spectrum.h | 6 +- .../source_esolver/esolver_ks_lcao_tddft.cpp | 331 ++++++-- source/source_hamilt_lcao/CMakeLists.txt | 6 + .../hamilt_lcaodft/CMakeLists.txt | 56 ++ .../hamilt_lcaodft/hamilt_lcao.cpp | 548 +++++++++++++ .../operator_lcao/CMakeLists.txt | 27 + .../operator_lcao/operator_lcao.cpp | 296 +++++++ .../operator_lcao/overlap_new.cpp | 271 +++++++ .../operator_lcao/td_ekinetic_lcao.cpp | 406 ++++++++++ .../operator_lcao/td_ekinetic_lcao.h | 126 +++ .../operator_lcao/td_nonlocal_lcao.cpp | 447 +++++++++++ .../operator_lcao/td_nonlocal_lcao.h | 108 +++ .../operator_lcao/td_pot_hybrid.cpp | 300 +++++++ .../operator_lcao/td_pot_hybrid.h | 129 +++ .../hamilt_lcaodft/spar_hsr.cpp | 454 +++++++++++ .../module_tddft/CMakeLists.txt | 36 + .../module_tddft/evolve_elec.cpp | 226 ++++++ .../module_tddft/evolve_elec.h | 185 +++++ .../module_tddft/evolve_psi.cpp | 352 +++++++++ .../module_tddft/evolve_psi.h | 47 ++ .../module_tddft/middle_hamilt.cpp | 290 +++++++ .../module_tddft/middle_hamilt.h | 62 ++ .../module_tddft/norm_psi.cpp | 671 ++++++++++++++++ .../module_tddft/norm_psi.h | 56 ++ .../module_tddft/propagator.cpp | 107 +++ .../module_tddft/propagator.h | 222 ++++++ .../module_tddft/propagator_cn2.cpp | 734 ++++++++++++++++++ .../module_tddft/propagator_etrs.cpp | 50 ++ .../module_tddft/propagator_taylor.cpp | 343 ++++++++ .../module_tddft/snap_psibeta_half_tddft.cpp | 247 ++++++ .../module_tddft/snap_psibeta_half_tddft.h | 31 + .../module_tddft/solve_propagation.cpp | 114 +++ .../module_tddft/solve_propagation.h | 34 + .../module_tddft/td_folding.cpp | 53 ++ .../module_tddft/td_info.cpp | 227 ++++++ .../source_hamilt_lcao/module_tddft/td_info.h | 108 +++ .../source_hamilt_lcao/module_tddft/upsi.cpp | 271 +++++++ source/source_hamilt_lcao/module_tddft/upsi.h | 60 ++ .../module_tddft/velocity_op.cpp | 532 +++++++++++++ .../module_tddft/velocity_op.h | 79 ++ source/source_io/cal_r_overlap_R.cpp | 368 +++++++++ source/source_io/cal_r_overlap_R.h | 42 +- source/source_io/input_conv.cpp | 45 +- source/source_io/output_log.cpp | 12 + source/source_io/output_log.h | 8 + source/source_io/read_input.cpp | 3 +- source/source_io/read_input_item_md.cpp | 11 +- source/source_io/read_input_item_system.cpp | 4 + source/source_io/read_input_item_tddft.cpp | 27 +- source/source_io/read_set_globalv.cpp | 6 + source/source_io/read_wfc_nao.cpp | 12 +- 51 files changed, 9073 insertions(+), 113 deletions(-) create mode 100644 source/source_hamilt_lcao/CMakeLists.txt create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h create mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/CMakeLists.txt create mode 100644 source/source_hamilt_lcao/module_tddft/evolve_elec.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/evolve_elec.h create mode 100644 source/source_hamilt_lcao/module_tddft/evolve_psi.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/evolve_psi.h create mode 100644 source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/middle_hamilt.h create mode 100644 source/source_hamilt_lcao/module_tddft/norm_psi.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/norm_psi.h create mode 100644 source/source_hamilt_lcao/module_tddft/propagator.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/propagator.h create mode 100644 source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h create mode 100644 source/source_hamilt_lcao/module_tddft/solve_propagation.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/solve_propagation.h create mode 100644 source/source_hamilt_lcao/module_tddft/td_folding.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/td_info.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/td_info.h create mode 100644 source/source_hamilt_lcao/module_tddft/upsi.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/upsi.h create mode 100644 source/source_hamilt_lcao/module_tddft/velocity_op.cpp create mode 100644 source/source_hamilt_lcao/module_tddft/velocity_op.h diff --git a/source/module_lr/lr_spectrum.h b/source/module_lr/lr_spectrum.h index aee905ccdf..052a85882a 100644 --- a/source/module_lr/lr_spectrum.h +++ b/source/module_lr/lr_spectrum.h @@ -5,7 +5,7 @@ #include "source_estate/module_dm/density_matrix.h" #include "module_lr/utils/lr_util.h" #include "source_basis/module_nao/two_center_bundle.h" -#include "source_lcao/module_tddft/td_current.h" +#include "module_hamilt_lcao/module_tddft/velocity_op.h" namespace LR { template @@ -52,8 +52,8 @@ namespace LR /// calculate the transition dipole of all states in length gauge void cal_transition_dipoles_length(); /// calculate the transition dipole of state S in velocity gauge: $i(\sum_{iak}X^S_{iak})/\Omega_S$ - ModuleBase::Vector3 cal_transition_dipole_istate_velocity_R(const int istate, const TD_current& vR); - ModuleBase::Vector3 cal_transition_dipole_istate_velocity_k(const int istate, const TD_current& vR); + ModuleBase::Vector3 cal_transition_dipole_istate_velocity_R(const int istate, const Velocity_op>& vR); + ModuleBase::Vector3 cal_transition_dipole_istate_velocity_k(const int istate, const Velocity_op>& vR); /// calculate the transition dipole of all states in velocity gauge void cal_transition_dipoles_velocity(); double cal_mean_squared_dipole(ModuleBase::Vector3 dipole); diff --git a/source/source_esolver/esolver_ks_lcao_tddft.cpp b/source/source_esolver/esolver_ks_lcao_tddft.cpp index 8c71cc2df2..20803dd35f 100644 --- a/source/source_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/source_esolver/esolver_ks_lcao_tddft.cpp @@ -1,10 +1,12 @@ #include "esolver_ks_lcao_tddft.h" -#include "source_io/cal_r_overlap_R.h" -#include "source_io/dipole_io.h" -#include "source_io/td_current_io.h" -#include "source_io/write_HS.h" -#include "source_io/write_HS_R.h" +#include "module_io/cal_r_overlap_R.h" +#include "module_io/dipole_io.h" +#include "module_io/td_current_io.h" +#include "module_io/read_wfc_nao.h" +#include "module_io/write_HS.h" +#include "module_io/write_HS_R.h" +#include "module_io/output_log.h" #include "source_estate/elecstate_tools.h" //--------------temporary---------------------------- @@ -17,32 +19,32 @@ #include "source_estate/module_dm/cal_edm_tddft.h" #include "source_estate/module_dm/density_matrix.h" #include "source_estate/occupy.h" -#include "source_lcao/module_tddft/evolve_elec.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_tddft/evolve_elec.h" #include "source_pw/hamilt_pwdft/global.h" -#include "source_io/print_info.h" +#include "module_io/print_info.h" //-----HSolver ElecState Hamilt-------- #include "source_estate/cal_ux.h" #include "source_estate/elecstate_lcao.h" -#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_hsolver/hsolver_lcao.h" #include "module_parameter/parameter.h" #include "source_psi/psi.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" //-----force& stress------------------- -#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" +#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" //--------------------------------------------------- namespace ModuleESolver { -template -ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() +template +ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() { - classname = "ESolver_rtTDDFT"; - basisname = "LCAO"; + this->classname = "ESolver_rtTDDFT"; + this->basisname = "LCAO"; // If the device is GPU, we must open use_tensor and use_lapack ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; @@ -53,13 +55,13 @@ ESolver_KS_LCAO_TDDFT::ESolver_KS_LCAO_TDDFT() } } -template -ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() +template +ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() { delete psi_laststep; if (Hk_laststep != nullptr) { - for (int ik = 0; ik < kv.get_nks(); ++ik) + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { delete[] Hk_laststep[ik]; } @@ -67,38 +69,192 @@ ESolver_KS_LCAO_TDDFT::~ESolver_KS_LCAO_TDDFT() } if (Sk_laststep != nullptr) { - for (int ik = 0; ik < kv.get_nks(); ++ik) + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { delete[] Sk_laststep[ik]; } delete[] Sk_laststep; } + if (td_p != nullptr) + { + delete td_p; + } + TD_info::td_vel_op = nullptr; } -template -void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const Input_para& inp) +template +void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const Input_para& inp) { // 1) run before_all_runners in ESolver_KS_LCAO - ESolver_KS_LCAO, double>::before_all_runners(ucell, inp); + ESolver_KS_LCAO, TR>::before_all_runners(ucell, inp); // this line should be optimized // this->pelec = dynamic_cast(this->pelec); + + td_p = new TD_info(&ucell); + TD_info::td_vel_op = td_p; + totstep += TD_info::estep_shift; + + if (PARAM.inp.init_wfc == "file") + { + if (!ModuleIO::read_wfc_nao(PARAM.globalv.global_readin_dir, + this->pv, + *(this->psi), + this->pelec, + this->pelec->klist->ik2iktot, + this->pelec->klist->get_nkstot(), + PARAM.inp.nspin, + TD_info::estep_shift)) + { + ModuleBase::WARNING_QUIT("ESolver_KS_LCAO", "read electronic wave functions failed"); + } + } } +template +void ESolver_KS_LCAO_TDDFT::runner(UnitCell& ucell, const int istep) +{ + ModuleBase::TITLE("ESolver_KS_LCAO_TDDFT", "runner"); + ModuleBase::timer::tick(this->classname, "runner"); + + //---------------------------------------------------------------- + // 1) before_scf (electronic iteration loops) + //---------------------------------------------------------------- + this->before_scf(ucell, istep); + ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT SCF"); + + // things only initialize once + //this->pelec_td->first_evolve = true; + if(PARAM.inp.td_stype!=1 && TD_info::out_current) + { + // initialize the velocity operator + velocity_mat = new Velocity_op(&ucell, &(this->gd), &this->pv, this->orb_, this->two_center_bundle_.overlap_orb.get()); + //calculate velocity operator + velocity_mat->calculate_grad_term(); + velocity_mat->calculate_vcomm_r(); + } + int estep_max = (istep == 0) ? PARAM.inp.estep_per_md +1 : PARAM.inp.estep_per_md; + //int estep_max = PARAM.inp.estep_per_md; + for(int estep =0; estep < estep_max; estep++) + { + // calculate total time step + this->totstep++; + this->print_step(); + //update At + if(PARAM.inp.td_stype > 0) + { + elecstate::H_TDDFT_pw::update_At(); + td_p->cal_cart_At(elecstate::H_TDDFT_pw::At); + } + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", td_p->cart_At[0]); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ay(t)", td_p->cart_At[1]); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Az(t)", td_p->cart_At[2]); + //std::cout<<"Et: "<CE.update_all_dis(ucell); + this->CE.extrapolate_charge(&this->Pgrid, + ucell, + &this->chr, + &this->sf, + GlobalV::ofs_running, + GlobalV::ofs_warning); + //need to test if correct when estep>0 + this->pelec->init_scf(totstep, ucell, this->Pgrid, this->sf.strucFac, this->locpp.numeric, ucell.symm); + /*if(PARAM.inp.td_stype == 2) + { + dynamic_cast>*>(this->pelec)->get_DM()->cal_DMR_td(ucell, td_p->cart_At); + } + else + { + dynamic_cast>*>(this->pelec)->get_DM()->cal_DMR(); + }*/ + + if(totstep <= PARAM.inp.td_tend + 1) + { + TD_info::evolve_once = true; + } + } + //---------------------------------------------------------------- + // 2) SCF iterations + //---------------------------------------------------------------- + bool conv_esolver = false; + this->niter = this->maxniter; + this->diag_ethr = PARAM.inp.pw_diag_thr; + for (int iter = 1; iter <= this->maxniter; ++iter) + { + ModuleIO::write_head_td(GlobalV::ofs_running, istep, estep, iter, this->basisname); + //---------------------------------------------------------------- + // 3) initialization of SCF iterations + //---------------------------------------------------------------- + this->iter_init(ucell, totstep, iter); + + //---------------------------------------------------------------- + // 4) use Hamiltonian to obtain charge density + //---------------------------------------------------------------- + this->hamilt2rho(ucell, totstep, iter, this->diag_ethr); + + //---------------------------------------------------------------- + // 5) finish scf iterations + //---------------------------------------------------------------- + this->iter_finish(ucell, totstep, iter, conv_esolver); + + //---------------------------------------------------------------- + // 6) check convergence + //---------------------------------------------------------------- + if (conv_esolver || this->oscillate_esolver) + { + this->niter = iter; + if (this->oscillate_esolver) + { + std::cout << " !! Density oscillation is found, STOP HERE !!" << std::endl; + } + break; + } + } // end scf iterations -template -void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, + //---------------------------------------------------------------- + // 7) after scf + //---------------------------------------------------------------- + this->after_scf(ucell, totstep, conv_esolver); + if(!restart_done && PARAM.inp.mdp.md_restart) + { + estep += TD_info::estep_shift%PARAM.inp.estep_per_md; + restart_done = true; + if(estep==0)break; + } + } + if(PARAM.inp.td_stype!=1 && TD_info::out_current) + { + delete velocity_mat; + } + ModuleBase::timer::tick(this->classname, "runner"); + return; +} +//output electronic step infos +template +void ESolver_KS_LCAO_TDDFT::print_step() +{ + std::cout << " -------------------------------------------" << std::endl; + GlobalV::ofs_running << "\n -------------------------------------------" << std::endl; + std::cout << " STEP OF ELECTRON EVOLVE : " << unsigned(totstep) << std::endl; + GlobalV::ofs_running << " STEP OF ELECTRON EVOLVE : " << unsigned(totstep) << std::endl; + std::cout << " -------------------------------------------" << std::endl; + GlobalV::ofs_running << " -------------------------------------------" << std::endl; +} +template +void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) { if (PARAM.inp.init_wfc == "file") { - if (istep >= 1) + if (istep >= TD_info::estep_shift + 1) { module_tddft::Evolve_elec::solve_psi(istep, PARAM.inp.nbands, PARAM.globalv.nlocal, - kv.get_nks(), + this->kv.get_nks(), this->p_hamilt, this->pv, this->psi, @@ -111,16 +267,15 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, PARAM.inp.propagator, use_tensor, use_lapack); - this->weight_dm_rho(); } - this->weight_dm_rho(); + this->weight_dm_rho(ucell); } - else if (istep >= 2) + else if (istep >= 1) { module_tddft::Evolve_elec::solve_psi(istep, PARAM.inp.nbands, PARAM.globalv.nlocal, - kv.get_nks(), + this->kv.get_nks(), this->p_hamilt, this->pv, this->psi, @@ -133,7 +288,7 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, PARAM.inp.propagator, use_tensor, use_lapack); - this->weight_dm_rho(); + this->weight_dm_rho(ucell); } else { @@ -154,7 +309,7 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, Symmetry_rho srho; for (int is = 0; is < PARAM.inp.nspin; is++) { - srho.begin(is, this->chr, pw_rho, ucell.symm); + srho.begin(is, this->chr, this->pw_rho, ucell.symm); } } @@ -162,8 +317,8 @@ void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); } -template -void ESolver_KS_LCAO_TDDFT::iter_finish( +template +void ESolver_KS_LCAO_TDDFT::iter_finish( UnitCell& ucell, const int istep, int& iter, @@ -179,7 +334,7 @@ void ESolver_KS_LCAO_TDDFT::iter_finish( GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); GlobalV::ofs_running << std::left; std::setprecision(6); - for (int ik = 0; ik < kv.get_nks(); ik++) + for (int ik = 0; ik < this->kv.get_nks(); ik++) { for (int ib = 0; ib < PARAM.inp.nbands; ib++) { @@ -192,11 +347,11 @@ void ESolver_KS_LCAO_TDDFT::iter_finish( << std::endl; } - ESolver_KS_LCAO, double>::iter_finish(ucell, istep, iter, conv_esolver); + ESolver_KS_LCAO, TR>::iter_finish(ucell, istep, iter, conv_esolver); } -template -void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, +template +void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver) @@ -220,7 +375,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, const int nlocal = PARAM.globalv.nlocal; // store wfc and Hk laststep - if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) && conv_esolver) + if (conv_esolver) { if (this->psi_laststep == nullptr) { @@ -233,7 +388,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, ncol_tmp = nbands; nrow_tmp = nlocal; #endif - this->psi_laststep = new psi::Psi>(kv.get_nks(), ncol_tmp, nrow_tmp, kv.ngk, true); + this->psi_laststep = new psi::Psi>(this->kv.get_nks(), ncol_tmp, nrow_tmp, this->kv.ngk, true); } @@ -245,8 +400,8 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, if (this->Hk_laststep == nullptr) { - this->Hk_laststep = new std::complex*[kv.get_nks()]; - for (int ik = 0; ik < kv.get_nks(); ++ik) + this->Hk_laststep = new std::complex*[this->kv.get_nks()]; + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { // Allocate memory for Hk_laststep, if (use_tensor && use_lapack), should be global this->Hk_laststep[ik] = new std::complex[len_HS]; @@ -255,8 +410,8 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, } if (this->Sk_laststep == nullptr) { - this->Sk_laststep = new std::complex*[kv.get_nks()]; - for (int ik = 0; ik < kv.get_nks(); ++ik) + this->Sk_laststep = new std::complex*[this->kv.get_nks()]; + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { // Allocate memory for Sk_laststep, if (use_tensor && use_lapack), should be global this->Sk_laststep[ik] = new std::complex[len_HS]; @@ -266,16 +421,16 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, } // put information to Hk_laststep and Sk_laststep - for (int ik = 0; ik < kv.get_nks(); ++ik) + for (int ik = 0; ik < this->kv.get_nks(); ++ik) { this->psi->fix_k(ik); this->psi_laststep->fix_k(ik); // copy the data from psi to psi_laststep - const int size0 = psi->get_nbands() * psi->get_nbasis(); + const int size0 = this->psi->get_nbands() * this->psi->get_nbasis(); for (int index = 0; index < size0; ++index) { - psi_laststep[0].get_pointer()[index] = psi[0].get_pointer()[index]; + psi_laststep[0].get_pointer()[index] = this->psi[0].get_pointer()[index]; } // store Hamiltonian @@ -316,7 +471,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, } // calculate energy density matrix for tddft - if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 2) && PARAM.inp.td_edm == 0) + if (istep >= (PARAM.inp.init_wfc == "file" ? 0 : 1) && PARAM.inp.td_edm == 0) { elecstate::cal_edm_tddft(this->pv, this->pelec, this->kv, this->p_hamilt); } @@ -336,7 +491,7 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, GlobalV::ofs_running << std::setprecision(6); GlobalV::ofs_running << std::setiosflags(std::ios::showpoint); - for (int ik = 0; ik < kv.get_nks(); ik++) + for (int ik = 0; ik < this->kv.get_nks(); ik++) { for (int ib = 0; ib < PARAM.inp.nbands; ib++) { @@ -350,13 +505,13 @@ void ESolver_KS_LCAO_TDDFT::update_pot(UnitCell& ucell, */ } -template -void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) +template +void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) { ModuleBase::TITLE("ESolver_LCAO_TDDFT", "after_scf"); ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); - ESolver_KS_LCAO, double>::after_scf(ucell, istep, conv_esolver); + ESolver_KS_LCAO, TR>::after_scf(ucell, istep, conv_esolver); // (1) write dipole information for (int is = 0; is < PARAM.inp.nspin; is++) @@ -373,31 +528,52 @@ void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep, ss_dipole.str()); } } - - // (2) write current information - if (TD_Velocity::out_current == true) - { - elecstate::DensityMatrix, double>* tmp_DM + elecstate::DensityMatrix, double>* tmp_DM = dynamic_cast>*>(this->pelec)->get_DM(); - - ModuleIO::write_current(ucell, - this->gd, - istep, - this->psi, - pelec, - kv, - two_center_bundle_.overlap_orb.get(), - tmp_DM->get_paraV_pointer(), - orb_, - this->RA); + // (2) write current information + if(TD_info::out_current) + { + if(TD_info::out_current_k) + { + ModuleIO::write_current_eachk(ucell, + istep, + this->psi, + this->pelec, + this->kv, + this->two_center_bundle_.overlap_orb.get(), + tmp_DM->get_paraV_pointer(), + this->orb_, + this->velocity_mat, + this->RA); + } + else + { + ModuleIO::write_current(ucell, + istep, + this->psi, + this->pelec, + this->kv, + this->two_center_bundle_.overlap_orb.get(), + tmp_DM->get_paraV_pointer(), + this->orb_, + this->velocity_mat, + this->RA); + } } + // (3) output energy for sub loop + std::cout << "Potential (Ry): " << std::setprecision(15) << this->pelec->f_en.etot <out_restart_info(istep, elecstate::H_TDDFT_pw::At, elecstate::H_TDDFT_pw::At_laststep); + } + ModuleBase::timer::tick("ESolver_LCAO_TDDFT", "after_scf"); } -template -void ESolver_KS_LCAO_TDDFT::weight_dm_rho() +template +void ESolver_KS_LCAO_TDDFT::weight_dm_rho(const UnitCell& ucell) { if (PARAM.inp.ocp == 1) { @@ -417,15 +593,24 @@ void ESolver_KS_LCAO_TDDFT::weight_dm_rho() auto _pes = dynamic_cast>*>(this->pelec); elecstate::cal_dm_psi(_pes->DM->get_paraV_pointer(), _pes->wg, this->psi[0], *(_pes->DM)); - _pes->DM->cal_DMR(); + if(PARAM.inp.td_stype == 2) + { + _pes->DM->cal_DMR_td(ucell, td_p->cart_At); + } + else + { + _pes->DM->cal_DMR(); + } // get the real-space charge density this->pelec->psiToRho(this->psi[0]); } -template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT, base_device::DEVICE_CPU>; #if ((defined __CUDA) /* || (defined __ROCM) */) -template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT; +template class ESolver_KS_LCAO_TDDFT, base_device::DEVICE_GPU>; #endif } // namespace ModuleESolver diff --git a/source/source_hamilt_lcao/CMakeLists.txt b/source/source_hamilt_lcao/CMakeLists.txt new file mode 100644 index 0000000000..116cccbec9 --- /dev/null +++ b/source/source_hamilt_lcao/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(hamilt_lcaodft) +add_subdirectory(module_tddft) +add_subdirectory(module_deepks) +add_subdirectory(module_dftu) +add_subdirectory(module_hcontainer) +add_subdirectory(module_deltaspin) diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt b/source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt new file mode 100644 index 0000000000..ba00725b73 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt @@ -0,0 +1,56 @@ +if(ENABLE_LCAO) + add_subdirectory(operator_lcao) + list(APPEND objects + hamilt_lcao.cpp + operator_lcao/operator_lcao.cpp + operator_lcao/veff_lcao.cpp + operator_lcao/meta_lcao.cpp + operator_lcao/op_dftu_lcao.cpp + operator_lcao/deepks_lcao.cpp + operator_lcao/op_exx_lcao.cpp + operator_lcao/overlap_new.cpp + operator_lcao/ekinetic_new.cpp + operator_lcao/nonlocal_new.cpp + operator_lcao/td_ekinetic_lcao.cpp + operator_lcao/td_nonlocal_lcao.cpp + operator_lcao/td_pot_hybrid.cpp + operator_lcao/dspin_lcao.cpp + operator_lcao/dftu_lcao.cpp + pulay_force_stress_center2.cpp + FORCE_STRESS.cpp + FORCE_gamma.cpp + FORCE_k.cpp + stress_tools.cpp + edm.cpp + grid_init.cpp + spar_dh.cpp + spar_exx.cpp + spar_hsr.cpp + spar_st.cpp + spar_u.cpp + LCAO_set_fs.cpp + LCAO_set_st.cpp + LCAO_nl_mu.cpp + LCAO_set_zero.cpp + LCAO_allocate.cpp + LCAO_set_mat2d.cpp + LCAO_init_basis.cpp + record_adj.cpp + center2_orb.cpp + center2_orb-orb11.cpp + center2_orb-orb21.cpp + center2_orb-orb22.cpp + wavefunc_in_pw.cpp + ) + + add_library( + hamilt_lcao + OBJECT + ${objects} + ) + + if(ENABLE_COVERAGE) + add_coverage(hamilt_lcao) + endif() + +endif() diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp new file mode 100644 index 0000000000..87867bb927 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp @@ -0,0 +1,548 @@ +#include "hamilt_lcao.h" + +#include "source_base/global_variable.h" +#include "source_base/memory.h" +#include "source_base/timer.h" +#include "module_hamilt_lcao/module_dftu/dftu.h" +#include "source_pw/hamilt_pwdft/global.h" +#include "module_parameter/parameter.h" + +#include + +#ifdef __MLALGO +#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" +#include "operator_lcao/deepks_lcao.h" +#endif + +#ifdef __EXX +#include "module_ri/Exx_LRI_interface.h" +#include "operator_lcao/op_exx_lcao.h" +#endif + +#ifdef __ELPA +#include "source_hsolver/diago_elpa.h" +#endif + +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "source_hamilt/module_xc/xc_functional.h" +#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_hsolver/hsolver_lcao.h" +#include "operator_lcao/dftu_lcao.h" +#include "operator_lcao/dspin_lcao.h" +#include "operator_lcao/ekinetic_new.h" +#include "operator_lcao/meta_lcao.h" +#include "operator_lcao/nonlocal_new.h" +#include "operator_lcao/op_dftu_lcao.h" +#include "operator_lcao/op_exx_lcao.h" +#include "operator_lcao/overlap_new.h" +#include "operator_lcao/td_ekinetic_lcao.h" +#include "operator_lcao/td_nonlocal_lcao.h" +#include "operator_lcao/td_pot_hybrid.h" +#include "operator_lcao/veff_lcao.h" + +namespace hamilt +{ + +template +HamiltLCAO::HamiltLCAO(const UnitCell& ucell, + const Grid_Driver& grid_d, + const Parallel_Orbitals* paraV, + const K_Vectors& kv_in, + const TwoCenterIntegrator& intor_overlap_orb, + const std::vector& orb_cutoff) +{ + this->classname = "HamiltLCAO"; + + this->kv = &kv_in; + + // initialize the overlap matrix + this->sR = new HContainer(paraV); + + this->getOperator() = new OverlapNew>(this->hsk, + this->kv->kvec_d, + this->hR, + this->sR, + &ucell, + orb_cutoff, + &grid_d, + &intor_overlap_orb); +} + +template +HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, + Gint_k* GK_in, + const UnitCell& ucell, + const Grid_Driver& grid_d, + const Parallel_Orbitals* paraV, + elecstate::Potential* pot_in, + const K_Vectors& kv_in, + const TwoCenterBundle& two_center_bundle, + const LCAO_Orbitals& orb, + elecstate::DensityMatrix* DM_in +#ifdef __MLALGO + , + LCAO_Deepks* ld_in +#endif +#ifdef __EXX + , + const int istep, + int* exx_two_level_step, + std::vector>>>* Hexxd, + std::vector>>>>* Hexxc +#endif +) +{ + this->classname = "HamiltLCAO"; + + this->kv = &kv_in; + + // Real space Hamiltonian is inited with template TR + this->hR = new HContainer(paraV); + this->sR = new HContainer(paraV); + this->hsk = new HS_Matrix_K(paraV); + + // Effective potential term (\sum_r ) is registered without template + std::vector pot_register_in; + if (PARAM.inp.vl_in_h) + { + if (PARAM.inp.vion_in_h) + { + pot_register_in.push_back("local"); + } + if (PARAM.inp.vh_in_h) + { + pot_register_in.push_back("hartree"); + } + pot_register_in.push_back("xc"); + if (PARAM.inp.imp_sol) + { + pot_register_in.push_back("surchem"); + } + if (PARAM.inp.efield_flag) + { + pot_register_in.push_back("efield"); + } + if (PARAM.inp.gate_flag) + { + pot_register_in.push_back("gatefield"); + } + if (PARAM.inp.esolver_type == "tddft") + { + pot_register_in.push_back("tddft"); + } + } + + // Gamma_only case to initialize HamiltLCAO + // + // code block to construct Operator Chains + if (std::is_same::value) + { + // fix HR to gamma case, where SR will be fixed in Overlap Operator + this->hR->fix_gamma(); + // initial operator for Gamma_only case + // overlap term () is indispensable + // in Gamma_only case, target SK is this->hsk->get_sk(), the target SR is this->sR + this->getOperator() = new OverlapNew>(this->hsk, + this->kv->kvec_d, + this->hR, + this->sR, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.overlap_orb.get()); + + // kinetic term () + if (PARAM.inp.t_in_h) + { + Operator* ekinetic = new EkineticNew>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.kinetic_orb.get()); + this->getOperator()->add(ekinetic); + } + + // nonlocal term (D) + // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() + if (PARAM.inp.vnl_in_h) + { + Operator* nonlocal = new NonlocalNew>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.overlap_orb_beta.get()); + this->getOperator()->add(nonlocal); + } + + // Effective potential term (\sum_r ) + // in general case, target HR is Gint::hRGint, while target HK is this->hsk->get_hk() + if (PARAM.inp.vl_in_h) + { + // only Potential is not empty, Veff and Meta are available + if (pot_register_in.size() > 0) + { + // register Potential by gathered operator + pot_in->pot_register(pot_register_in); + // effective potential term + Operator* veff = new Veff>(GG_in, + this->hsk, + this->kv->kvec_d, + pot_in, + this->hR, // no explicit call yet + &ucell, + orb.cutoffs(), + &grid_d, + PARAM.inp.nspin); + this->getOperator()->add(veff); + } + } + +#ifdef __MLALGO + if (PARAM.inp.deepks_scf) + { + Operator* deepks = new DeePKS>(this->hsk, + this->kv->kvec_d, + this->hR, // no explicit call yet + &ucell, + &grid_d, + two_center_bundle.overlap_orb_alpha.get(), + &orb, + this->kv->get_nks(), + DM_in, + ld_in); + this->getOperator()->add(deepks); + this->V_delta_R = dynamic_cast>*>(deepks)->get_V_delta_R(); + } +#endif + + // end node should be OperatorDFTU + if (PARAM.inp.dft_plus_u) + { + Operator* dftu = nullptr; + if (PARAM.inp.dft_plus_u == 2) + { + dftu = new OperatorDFTU>(this->hsk, + this->kv->kvec_d, + this->hR, // no explicit call yet + this->kv->isk); + } + else + { + dftu = new DFTU>(this->hsk, + this->kv->kvec_d, + this->hR, + ucell, + &grid_d, + two_center_bundle.overlap_orb_onsite.get(), + orb.cutoffs(), + &GlobalC::dftu); + } + this->getOperator()->add(dftu); + } + } + // multi-k-points case to initialize HamiltLCAO, ops will be used + else if (std::is_same>::value) + { + // Effective potential term (\sum_r ) + // Meta potential term (\sum_r ) + // in general case, target HR is Gint::pvpR_reduced, while target HK is this->hsk->get_hk() + if (PARAM.inp.vl_in_h) + { + // only Potential is not empty, Veff and Meta are available + if (pot_register_in.size() > 0) + { + // register Potential by gathered operator + pot_in->pot_register(pot_register_in); + // Veff term + this->getOperator() = new Veff>(GK_in, + this->hsk, + this->kv->kvec_d, + pot_in, + this->hR, + &ucell, + orb.cutoffs(), + &grid_d, + PARAM.inp.nspin); + } + } + + // initial operator for multi-k case + // overlap term is indispensable + Operator* overlap = new OverlapNew>(this->hsk, + this->kv->kvec_d, + this->hR, + this->sR, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.overlap_orb.get()); + if (this->getOperator() == nullptr) + { + this->getOperator() = overlap; + } + else + { + this->getOperator()->add(overlap); + } + + // kinetic term (), + // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() + if (PARAM.inp.t_in_h) + { + Operator* ekinetic = new EkineticNew>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.kinetic_orb.get()); + this->getOperator()->add(ekinetic); + } + + // nonlocal term (D) + // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() + if (PARAM.inp.vnl_in_h) + { + Operator* nonlocal = new NonlocalNew>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.overlap_orb_beta.get()); + // TDDFT velocity gauge will calculate full non-local potential including the original one and the + // correction on its own. So the original non-local potential term should be skipped + if (PARAM.inp.esolver_type != "tddft" || elecstate::H_TDDFT_pw::stype != 1) + { + this->getOperator()->add(nonlocal); + } + else + { + delete nonlocal; + } + } + +#ifdef __MLALGO + if (PARAM.inp.deepks_scf) + { + Operator* deepks = new DeePKS>(this->hsk, + this->kv->kvec_d, + hR, + &ucell, + &grid_d, + two_center_bundle.overlap_orb_alpha.get(), + &orb, + this->kv->get_nks(), + DM_in, + ld_in); + this->getOperator()->add(deepks); + this->V_delta_R = dynamic_cast>*>(deepks)->get_V_delta_R(); + } +#endif + // TDDFT_velocity_gauge + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) + { + Operator* td_ekinetic = new TDEkinetic>(this->hsk, + this->hR, + this->kv, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.overlap_orb.get()); + this->getOperator()->add(td_ekinetic); + + Operator* td_nonlocal = new TDNonlocal>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb, + &grid_d); + this->getOperator()->add(td_nonlocal); + } + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 2) + { + Operator* td_pot_hybrid = new TD_pot_hybrid>(this->hsk, + this->kv, + this->hR, + this->sR, + orb, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.kinetic_orb.get()); + this->getOperator()->add(td_pot_hybrid); + } + if (PARAM.inp.dft_plus_u) + { + Operator* dftu = nullptr; + if (PARAM.inp.dft_plus_u == 2) + { + dftu = new OperatorDFTU>(this->hsk, + this->kv->kvec_d, + this->hR, // no explicit call yet + this->kv->isk); + } + else + { + dftu = new DFTU>(this->hsk, + this->kv->kvec_d, + this->hR, + ucell, + &grid_d, + two_center_bundle.overlap_orb_onsite.get(), + orb.cutoffs(), + &GlobalC::dftu); + } + this->getOperator()->add(dftu); + } + if (PARAM.inp.sc_mag_switch) + { + Operator* sc_lambda = new DeltaSpin>(this->hsk, + this->kv->kvec_d, + this->hR, + ucell, + &grid_d, + two_center_bundle.overlap_orb_onsite.get(), + orb.cutoffs()); + this->getOperator()->add(sc_lambda); + spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); + sc.set_operator(sc_lambda); + } + } + +#ifdef __EXX + if (GlobalC::exx_info.info_global.cal_exx) + { + // Peize Lin add 2016-12-03 + // set xc type before the first cal of xc in pelec->init_scf + // and calculate Cs, Vs + Operator* exx = new OperatorEXX>(this->hsk, + this->hR, + ucell, + *kv, + Hexxd, + Hexxc, + Add_Hexx_Type::R, + istep, + exx_two_level_step, + !GlobalC::restart.info_load.restart_exx + && GlobalC::restart.info_load.load_H); + this->getOperator()->add(exx); + } +#endif + + // if NSPIN==2, HR should be separated into two parts, save HR into this->hRS2 + int memory_fold = 1; + if (PARAM.inp.nspin == 2) + { + this->hRS2.resize(this->hR->get_nnr() * 2); + this->hR->allocate(this->hRS2.data(), 0); + memory_fold = 2; + } + + ModuleBase::Memory::record("HamiltLCAO::hR", this->hR->get_memory_size() * memory_fold); + ModuleBase::Memory::record("HamiltLCAO::sR", this->sR->get_memory_size()); + + return; +} + +// case for multi-k-points +template +void HamiltLCAO::matrix(MatrixBlock& hk_in, MatrixBlock& sk_in) +{ + auto op = dynamic_cast*>(this->getOperator()); + assert(op != nullptr); + op->matrixHk(hk_in, sk_in); +} + +template +void HamiltLCAO::updateHk(const int ik) +{ + ModuleBase::TITLE("HamiltLCAO", "updateHk"); + ModuleBase::timer::tick("HamiltLCAO", "updateHk"); + + // update global spin index + if (PARAM.inp.nspin == 2) + { + // if Veff is added and current_spin is changed, refresh HR + if (PARAM.inp.vl_in_h && this->kv->isk[ik] != this->current_spin) + { + // change data pointer of HR + this->hR->allocate(this->hRS2.data() + this->hRS2.size() / 2 * this->kv->isk[ik], 0); + if (this->refresh_times > 0) + { + this->refresh_times--; + dynamic_cast*>(this->ops)->set_hr_done(false); + } + } + this->current_spin = this->kv->isk[ik]; + } + this->getOperator()->init(ik); + ModuleBase::timer::tick("HamiltLCAO", "updateHk"); +} + +template +void HamiltLCAO::refresh() +{ + ModuleBase::TITLE("HamiltLCAO", "refresh"); + dynamic_cast*>(this->ops)->set_hr_done(false); + if (PARAM.inp.nspin == 2) + { + this->refresh_times = 1; + this->current_spin = 0; + if (this->hR->get_nnr() != this->hRS2.size() / 2) + { + // operator has changed, resize hRS2 + this->hRS2.resize(this->hR->get_nnr() * 2); + } + this->hR->allocate(this->hRS2.data(), 0); + } +} + +// get Operator base class pointer +template +Operator*& HamiltLCAO::getOperator() +{ + return this->ops; +} + +template +void HamiltLCAO::updateSk( + const int ik, + const int hk_type) +{ + ModuleBase::TITLE("HamiltLCAO", "updateSk"); + ModuleBase::timer::tick("HamiltLCAO", "updateSk"); + + ModuleBase::GlobalFunc::ZEROS(this->getSk(), this->get_size_hsk()); + + if (hk_type == 1) // collumn-major matrix for SK + { + const int nrow = this->hsk->get_pv()->get_row_size(); + hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], nrow, 1); + } + else if (hk_type == 0) // row-major matrix for SK + { + const int ncol = this->hsk->get_pv()->get_col_size(); + hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], ncol, 0); + } + else + { + ModuleBase::WARNING_QUIT("updateSk","the value of hk_type is incorrect."); + } + + ModuleBase::timer::tick("HamiltLCAO", "updateSk"); +} + +// case for nspin<4, gamma-only k-point +template class HamiltLCAO; +// case for nspin<4, multi-k-points +template class HamiltLCAO, double>; +// case for nspin == 4, non-collinear spin case +template class HamiltLCAO, std::complex>; +} // namespace hamilt diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt new file mode 100644 index 0000000000..0e49a9dc43 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt @@ -0,0 +1,27 @@ +add_library( + operator_ks_lcao + OBJECT + op_exx_lcao.cpp + op_dftu_lcao.cpp + meta_lcao.cpp + veff_lcao.cpp + deepks_lcao.cpp + overlap_new.cpp + ekinetic_new.cpp + nonlocal_new.cpp + td_ekinetic_lcao.cpp + td_nonlocal_lcao.cpp + td_pot_hybrid.cpp + dspin_lcao.cpp + dftu_lcao.cpp +) + +if(ENABLE_COVERAGE) + add_coverage(operator_ks_lcao) +endif() + +IF (BUILD_TESTING) + if(ENABLE_MPI) + add_subdirectory(test) + endif() +endif() diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp new file mode 100644 index 0000000000..ca94601fa9 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp @@ -0,0 +1,296 @@ +#include "operator_lcao.h" + +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_hsolver/hsolver_lcao.h" + +#include "module_parameter/parameter.h" + +#ifdef __ELPA +#include "source_hsolver/diago_elpa.h" +#include "source_hsolver/diago_elpa_native.h" +#endif + +#include "module_hamilt_lcao/module_tddft/td_info.h" + +namespace hamilt { + +template <> +void OperatorLCAO::get_hs_pointers() { + ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); + this->hmatrix_k = this->hsk->get_hk(); + if ((this->new_e_iteration && ik == 0) || PARAM.inp.out_mat_hs[0]) + { + if (this->smatrix_k == nullptr) + { + this->smatrix_k = new double[this->hsk->get_size()]; + this->allocated_smatrix = true; + } + const int inc = 1; + BlasConnector::copy(this->hsk->get_size(), this->hsk->get_sk(), inc, this->smatrix_k, inc); +#ifdef __ELPA + hsolver::DiagoElpa::DecomposedState = 0; + hsolver::DiagoElpaNative::DecomposedState = 0; +#endif + this->new_e_iteration = false; + } + ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); +} + +template<> +void OperatorLCAO, double>::get_hs_pointers() +{ + this->hmatrix_k = this->hsk->get_hk(); + this->smatrix_k = this->hsk->get_sk(); +} + +template<> +void OperatorLCAO, std::complex>::get_hs_pointers() +{ + this->hmatrix_k = this->hsk->get_hk(); + this->smatrix_k = this->hsk->get_sk(); +} + +template +void OperatorLCAO::refresh_h() +{ + // Set the matrix 'H' to zero. + this->hsk->set_zero_hk(); +} + +template +void OperatorLCAO::set_hr_done(bool hr_done_in) { + this->hr_done = hr_done_in; +} + +template +void OperatorLCAO::set_current_spin(const int current_spin_in) +{ + this->current_spin = current_spin_in; + if(this->next_op != nullptr) + { + dynamic_cast*>(this->next_op)->set_current_spin(current_spin_in); + } + if(this->next_sub_op != nullptr) + { + dynamic_cast*>(this->next_sub_op)->set_current_spin(current_spin_in); + } +} + +template +void OperatorLCAO::init(const int ik_in) { + ModuleBase::TITLE("OperatorLCAO", "init"); + ModuleBase::timer::tick("OperatorLCAO", "init"); + if (this->is_first_node) { + // refresh HK + this->refresh_h(); + if (!this->hr_done) { + // refresh HR + this->hR->set_zero(); + } + } + switch (this->cal_type) { + case calculation_type::lcao_overlap: { + // cal_type=lcao_overlap refer to overlap matrix operators, which are + // only rely on stucture, and not changed during SCF + + if (!this->hr_done) { + // update SR first + // in cal_type=lcao_overlap, SR should be updated by each sub-chain + // nodes + OperatorLCAO* last = this; + while (last != nullptr) { + last->contributeHR(); + last = dynamic_cast*>(last->next_sub_op); + } + } + + // update SK next + // in cal_type=lcao_overlap, SK should be update here + this->contributeHk(ik_in); + + break; + } + case calculation_type::lcao_fixed: { + // cal_type=lcao_fixed refer to fixed matrix operators, which are only + // rely on stucture, and not changed during SCF + + // update HR first + if (!this->hr_done) { + // in cal_type=lcao_fixed, HR should be updated by each sub-chain + // nodes + OperatorLCAO* last = this; + while (last != nullptr) { + last->contributeHR(); + last = dynamic_cast*>(last->next_sub_op); + } + } + + // update HK next + // in cal_type=lcao_fixed, HK will update in the last node with + // OperatorLCAO::contributeHk() + + break; + } + case calculation_type::lcao_gint: { + // cal_type=lcao_gint refer to grid integral operators, which are relied + // on stucture and potential based on real space grids and should be + // updated each SCF steps + + if (!this->hr_done) { + OperatorLCAO* last = this; + while (last != nullptr) { + // update HR first + // in cal_type=lcao_gint, HR should be updated by every + // sub-node. + last->contributeHR(); + + // update HK next + // in cal_type=lcao_gint, HK will update in the last node with + // OperatorLCAO::contributeHk() + last = dynamic_cast*>(last->next_sub_op); + } + } + + break; + } +#ifdef __MLALGO + case calculation_type::lcao_deepks: { + // update HR first + if (!this->hr_done) { + // in cal_type=lcao_deepks, HR should be updated + this->contributeHR(); + } + + // update V_delta in k space next + this->contributeHk(ik_in); + + break; + } +#endif + case calculation_type::lcao_dftu: + { + //only HK should be updated when cal_type=lcao_dftu + //in cal_type=lcao_dftu, HK only need to update from one node + if(!this->hr_done) + { + //in cal_type=lcao_deepks, HR should be updated + this->contributeHR(); + } + break; + } + case calculation_type::lcao_sc_lambda: + { + //update HR first + this->contributeHR(); + //in cal_type=lcao_sc_mag, + //this->contributeHk(ik_in); + break; + } + case calculation_type::lcao_exx: + { + //update HR first + if (!this->hr_done) + { + this->contributeHR(); + } + + //update HK next + //in cal_type=lcao_exx, HK only need to update from one node + // this->contributeHk(ik_in); + + break; + } + case calculation_type::lcao_tddft_periodic: { + if (!this->hr_done) { + // in cal_type=lcao_fixed, HR should be updated by each sub-chain + // nodes + OperatorLCAO* last = this; + while (last != nullptr) { + last->contributeHR(); + last = dynamic_cast*>(last->next_sub_op); + } + } + this->contributeHk(ik_in); + + break; + } + default: { + ModuleBase::WARNING_QUIT("OperatorLCAO::init", "unknown cal_type"); + break; + } + } + if (this->next_op + != nullptr) { // it is not the last node, loop next init() function + // pass HR status to next node and than set HR status of this node to + // done + if (!this->hr_done) { + dynamic_cast*>(this->next_op)->hr_done + = this->hr_done; + } + // call init() function of next node + this->next_op->init(ik_in); + } else { // it is the last node, update HK with the current total HR + OperatorLCAO::contributeHk(ik_in); + } + + // set HR status of this node to done + this->hr_done = true; + + ModuleBase::timer::tick("OperatorLCAO", "init"); +} + +// contributeHk() +template <> +void OperatorLCAO::contributeHk(int ik) { + ModuleBase::TITLE("OperatorLCAO", "contributeHk"); + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); + if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->hsk->get_pv()->get_row_size(); + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + else + { + const int ncol = this->hsk->get_pv()->get_col_size(); + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); +} +// contributeHk() +template +void OperatorLCAO::contributeHk(int ik) { + ModuleBase::TITLE("OperatorLCAO", "contributeHk"); + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); + if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->hsk->get_pv()->get_row_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + else + { + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + } + else + { + const int ncol = this->hsk->get_pv()->get_col_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + else + { + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + } + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); +} + +template class OperatorLCAO; +template class OperatorLCAO, double>; +template class OperatorLCAO, std::complex>; +} // namespace hamilt diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp new file mode 100644 index 0000000000..f96f8fd67f --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp @@ -0,0 +1,271 @@ +#include "overlap_new.h" + +#include "module_parameter/parameter.h" +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include +#include "module_hamilt_lcao/module_tddft/td_info.h" + +template +hamilt::OverlapNew>::OverlapNew(HS_Matrix_K* hsk_in, + const std::vector>& kvec_d_in, + hamilt::HContainer* hR_in, + hamilt::HContainer* SR_in, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor) + : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_cutoff_(orb_cutoff), intor_(intor) +{ + this->cal_type = calculation_type::lcao_overlap; + this->ucell = ucell_in; + this->SR = SR_in; +#ifdef __DEBUG + assert(this->ucell != nullptr); + assert(this->SR != nullptr); +#endif + // initialize SR to allocate sparse overlap matrix memory + this->initialize_SR(GridD_in); +} + +// initialize_SR() +template +void hamilt::OverlapNew>::initialize_SR(const Grid_Driver* GridD) +{ + ModuleBase::TITLE("OverlapNew", "initialize_SR"); + ModuleBase::timer::tick("OverlapNew", "initialize_SR"); + auto* paraV = this->SR->get_paraV(); // get parallel orbitals from HR + // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1=0; + int I1=0; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index = adjs.box[ad]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index).norm() * this->ucell->lat0 + >= orb_cutoff_[T1] + orb_cutoff_[T2]) + { + continue; + } + hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); + SR->insert_pair(tmp); + } + } + // allocate the memory of BaseMatrix in SR, and set the new values to zero + SR->allocate(nullptr, true); + ModuleBase::timer::tick("OverlapNew", "initialize_SR"); +} + +template +void hamilt::OverlapNew>::calculate_SR() +{ + ModuleBase::TITLE("OverlapNew", "calculate_SR"); + ModuleBase::timer::tick("OverlapNew", "calculate_SR"); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iap = 0; iap < this->SR->size_atom_pairs(); ++iap) + { + hamilt::AtomPair& tmp = this->SR->get_atom_pair(iap); + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + const Parallel_Orbitals* paraV = tmp.get_paraV(); + + for (int iR = 0; iR < tmp.get_R_size(); ++iR) + { + const ModuleBase::Vector3 R_index = tmp.get_R_index(iR); + auto dtau = ucell->cal_dtau(iat1, iat2, R_index); + TR* data_pointer = tmp.get_pointer(iR); + this->cal_SR_IJR(iat1, iat2, paraV, dtau, data_pointer); + } + } + // if TK == double, then SR should be fixed to gamma case + // judge type of TK equal to double + if (std::is_same::value) + { + this->SR->fix_gamma(); + } + ModuleBase::timer::tick("OverlapNew", "calculate_SR"); +} + +// cal_SR_IJR() +template +void hamilt::OverlapNew>::cal_SR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* data_pointer) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1=0; + int I1=0; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2=0; + int I2=0; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + + // --------------------------------------------- + // calculate the overlap matrix for each pair of orbitals + // --------------------------------------------- + double olm[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, olm); + for (int ipol = 0; ipol < npol; ipol++) + { + data_pointer[ipol * step_trace] += olm[0]; + } + data_pointer += npol; + } + data_pointer += (npol - 1) * col_indexes.size(); + } +} + +// contributeHR() +template +void hamilt::OverlapNew>::contributeHR() +{ + if (this->SR_fixed_done) + { + return; + } + this->calculate_SR(); + this->SR_fixed_done = true; +} + +// contributeHk() +template <> +void hamilt::OverlapNew>::contributeHk(int ik) +{ + //! if k vector is not changed, then do nothing and return, only for gamma_only case + if (this->kvec_d[ik] == this->kvec_d_old) + { + return; + } + ModuleBase::TITLE("OverlapNew", "contributeHk"); + ModuleBase::timer::tick("OverlapNew", "contributeHk"); + + //! set SK to zero and then calculate SK for each k vector + this->hsk->set_zero_sk(); + if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + else + { + const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + + // update kvec_d_old + this->kvec_d_old = this->kvec_d[ik]; + + ModuleBase::timer::tick("OverlapNew", "contributeHk"); +} +template +void hamilt::OverlapNew>::contributeHk(int ik) +{ + ModuleBase::TITLE("OverlapNew", "contributeHk"); + ModuleBase::timer::tick("OverlapNew", "contributeHk"); + + //! set SK to zero and then calculate SK for each k vector + this->hsk->set_zero_sk(); + if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + else + { + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + } + else + { + const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + else + { + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + } + + // update kvec_d_old + this->kvec_d_old = this->kvec_d[ik]; + + ModuleBase::timer::tick("OverlapNew", "contributeHk"); +} +template +TK* hamilt::OverlapNew>::getSk() +{ + if (this->hsk != nullptr) + { + return this->hsk->get_sk(); + } + return nullptr; +} + +template class hamilt::OverlapNew>; +template class hamilt::OverlapNew, double>>; +template class hamilt::OverlapNew, std::complex>>; diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp new file mode 100644 index 0000000000..2b202b7811 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp @@ -0,0 +1,406 @@ +#include "td_ekinetic_lcao.h" + +#include "module_parameter/parameter.h" +#include "source_base/global_variable.h" +#include "source_base/libm/libm.h" +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" +#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_pw/hamilt_pwdft/global.h" + +namespace hamilt +{ +template +TDEkinetic>::TDEkinetic(HS_Matrix_K* hsk_in, + hamilt::HContainer* hR_in, + const K_Vectors* kv_in, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor) + : OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), orb_cutoff_(orb_cutoff), kv(kv_in), intor_(intor) +{ + this->ucell = ucell_in; + this->cal_type = calculation_type::lcao_tddft_periodic; + this->Grid = GridD_in; + // initialize HR to get adjs info. + this->initialize_HR(Grid); +} + +template +TDEkinetic>::~TDEkinetic() +{ + if (this->hR_tmp != nullptr) + { + delete this->hR_tmp; + } + TD_info::td_vel_op = nullptr; +} + +// term A^2*S +template +void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc, + const TR& overlap, + int nnr) +{ + // the correction term A^2/2. From Hatree to Ry, it needs to be multiplied by 2.0 + Hloc[nnr] += cart_At.norm2() * overlap; + return; +} +// term A dot āˆ‡ +template +void TDEkinetic>::td_ekinetic_grad(std::complex* Hloc, + int nnr, + ModuleBase::Vector3 grad_overlap) +{ + // the correction term -iA dot āˆ‡r + //āˆ‡ refer to the integral āˆ«šœ™(š‘Ÿ)šœ•/šœ•š‘Ÿšœ™(š‘Ÿāˆ’š‘…)š‘‘š‘Ÿ,but abacus only provide the integral of āˆ«šœ™(š‘Ÿ)šœ•/šœ•Ršœ™(š‘Ÿāˆ’š‘…)š‘‘š‘Ÿ. An extra + //minus must be counted in. The final term is iA dot āˆ‡R. From Hatree to Ry, it needs to be multiplied by 2.0 + std::complex tmp = {0, grad_overlap * cart_At}; + Hloc[nnr] += tmp * 2.0; + return; +} + +template +void TDEkinetic>::calculate_HR() +{ + ModuleBase::TITLE("TDEkinetic", "calculate_HR"); + if (this->hR_tmp == nullptr || this->hR_tmp->size_atom_pairs() <= 0) + { + ModuleBase::WARNING_QUIT("TDEkinetic::calculate_HR", "hR_tmp is nullptr or empty"); + } + ModuleBase::timer::tick("TDEkinetic", "calculate_HR"); + + const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_all[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + hamilt::BaseMatrix>* tmp = this->hR_tmp->find_matrix(iat1, iat2, R_index2); + if (tmp != nullptr) + { + if (TD_info::out_current) + { + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); + } + this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_c); + } + else + { + this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), nullptr); + } + } + else + { + ModuleBase::WARNING_QUIT("TDEkinetic::calculate_HR", "R_index not found in HR"); + } + } + } + ModuleBase::timer::tick("TDEkinetic", "calculate_HR"); +} + +template +void TDEkinetic>::cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex* hr_mat_p, + std::complex** current_mat_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1=0; + int I1=0; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2=0; + int I2=0; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + // --------------------------------------------- + // get tau1 (in cell <0,0,0>) and tau2 (in cell R) + // in principle, only dtau is needed in this function + // snap_psipsi should be refactored to use dtau directly + // --------------------------------------------- + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double grad[3] = {0, 0, 0}; + double overlap = 0; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + // calculate , which equals to -. + intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, &overlap, grad); + ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); + + for (int ipol = 0; ipol < npol; ipol++) + { + // key change + td_ekinetic_scalar(hr_mat_p, overlap, ipol * step_trace); + td_ekinetic_grad(hr_mat_p, ipol * step_trace, grad_overlap); + } + hr_mat_p += npol; + // current grad part + if (current_mat_p != nullptr) + { + for (int dir = 0; dir < 3; dir++) + { + for (int ipol = 0; ipol < npol; ipol++) + { + // part of Momentum operator, -iāˆ‡r,used to calculate the current + // here is actually iāˆ‡R + current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); + // part of Momentum operator, eA,used to calculate the current + current_mat_p[dir][ipol * step_trace] += std::complex(overlap * cart_At[dir], 0); + } + current_mat_p[dir] += npol; + } + } + } + hr_mat_p += (npol - 1) * col_indexes.size(); + if (current_mat_p != nullptr) + { + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } + } +} +//update vector potential for td_ekintic term +template +void TDEkinetic>::update_td() +{ + //std::cout<<"velocity"<cart_At = TD_info::td_vel_op->cart_At; +} + +template +void hamilt::TDEkinetic>::set_HR_fixed(void* hR_tmp_in) +{ + this->hR_tmp = static_cast>*>(hR_tmp_in); + this->allocated = false; +} +template +void TDEkinetic>::initialize_HR(const Grid_Driver* GridD) +{ + if (elecstate::H_TDDFT_pw::stype != 1) + { + return; + } + ModuleBase::TITLE("TDEkinetic", "initialize_HR"); + ModuleBase::timer::tick("TDEkinetic", "initialize_HR"); + + auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR + // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. + + this->adjs_all.clear(); + this->adjs_all.reserve(this->ucell->nat); + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_cutoff_[T1] + orb_cutoff_[T2]) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_all.push_back(adjs); + } + ModuleBase::timer::tick("TDEkinetic", "initialize_HR"); +} +template +void TDEkinetic>::initialize_HR_tmp() +{ + if (elecstate::H_TDDFT_pw::stype != 1) + { + return; + } + ModuleBase::TITLE("TDEkinetic", "initialize_HR_tmp"); + ModuleBase::timer::tick("TDEkinetic", "initialize_HR_tmp"); + + auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR + // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. + for (int i = 0; i < this->hR->size_atom_pairs(); ++i) + { + hamilt::AtomPair& tmp = this->hR->get_atom_pair(i); + for (int ir = 0; ir < tmp.get_R_size(); ++ir) + { + const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + + hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); + this->hR_tmp->insert_pair(tmp1); + } + } + this->hR_tmp->allocate(nullptr, true); + + ModuleBase::timer::tick("TDEkinetic", "initialize_HR_tmp"); +} + +template +void TDEkinetic>::contributeHR() +{ + // const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); + ModuleBase::TITLE("TDEkinetic", "contributeHR"); + ModuleBase::timer::tick("TDEkinetic", "contributeHR"); + // skip if not TDDFT velocity gauge + if (elecstate::H_TDDFT_pw::stype != 1) + { + return; + } + if (!this->hR_tmp_done || TD_info::evolve_once) + { + const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); + // if this Operator is the first node of the sub_chain, then hR_tmp is nullptr + if (this->hR_tmp == nullptr) + { + this->hR_tmp = new hamilt::HContainer>(this->hR->get_paraV()); + // allocate memory for hR_tmp use the same memory as hR + this->initialize_HR_tmp(); + this->allocated = true; + } + if (this->next_sub_op != nullptr) + { + // pass pointer of hR_tmp to the next node + static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); + } + // initialize current term if needed + if (TD_info::out_current) + { + TD_info::td_vel_op->initialize_current_term(this->hR_tmp, paraV); + } + // calculate the values in hR_tmp + this->update_td(); + this->hR_tmp->set_zero(); + this->calculate_HR(); + this->hR_tmp_done = true; + } + + ModuleBase::timer::tick("TDEkinetic", "contributeHR"); + return; +} + +template +void TDEkinetic>::contributeHk(int ik) +{ + if (PARAM.inp.td_stype != 1) + { + return; + } + else + { + ModuleBase::TITLE("TDEkinetic", "contributeHk"); + ModuleBase::timer::tick("TDEkinetic", "contributeHk"); + const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); + // save HR data for output + int spin_tot = PARAM.inp.nspin; + if (!output_hR_done && TD_info::out_mat_R) + { + for (int spin_now = 0; spin_now < spin_tot; spin_now++) + { + sparse_format::cal_HContainer_cd(*(paraV), + spin_now, + 1e-10, + *hR_tmp, + TD_info::td_vel_op->HR_sparse_td_vel[spin_now]); + } + output_hR_done = true; + } + // folding inside HR to HK + if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = paraV->get_row_size(); + hamilt::folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + else + { + const int ncol = paraV->get_col_size(); + hamilt::folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + + ModuleBase::timer::tick("TDEkinetic", "contributeHk"); + } +} + +template class TDEkinetic, double>>; +template class TDEkinetic, std::complex>>; + +} // namespace hamilt diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h new file mode 100644 index 0000000000..310504aa07 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h @@ -0,0 +1,126 @@ +#ifndef TDEKINETIC_H +#define TDEKINETIC_H +#include "source_base/timer.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_cell/klist.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "operator_lcao.h" +#include + + +namespace hamilt +{ + +#ifndef __TDEKINETICTEMPLATE +#define __TDEKINETICTEMPLATE + +/// The TDEkinetic class template inherits from class T +/// It is used to calculate correction term of kinetic energy in time-dependent DFT +template +class TDEkinetic : public T +{ +}; + +#endif + +/// TDEkinetic class template specialization for OperatorLCAO base class +/// It is used to calculate correction term of kinetic energy in time-dependent DFT +/// Template parameters: +/// - TK: data type of k-space Hamiltonian +/// - TR: data type of real space Hamiltonian + +template +class TDEkinetic> : public OperatorLCAO +{ + public: + TDEkinetic>(HS_Matrix_K* hsk_in, + hamilt::HContainer* hR_in, + const K_Vectors* kv_in, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor); + ~TDEkinetic(); + + virtual void contributeHR() override; + + virtual void contributeHk(int ik) override; + + /// @brief update vector potential + void update_td(); + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_HR(const Grid_Driver* GridD); + + /** + * @brief initialize HR_tmp + * Allocate the memory for HR_tmp with the same size as HR + */ + void initialize_HR_tmp(); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex* hr_mat_p, + std::complex** current_mat_p); + + /** + * @brief calculate the ekinetic matrix correction term in tddft with specific atom-pairs + * nearest neighbor atoms don't need to be calculated again + * loop the atom-pairs in HR and calculate the ekinetic matrix + */ + void calculate_HR(); + + virtual void set_HR_fixed(void*) override; + + + private: + + const UnitCell* ucell = nullptr; + + std::vector orb_cutoff_; + + HContainer* SR = nullptr; + + /// @brief Store real space hamiltonian. TD term should include imaginary part, + /// thus it has to be complex type. Only shared between TD operators. + HContainer>* hR_tmp = nullptr; + + const Grid_Driver* Grid = nullptr; + + const K_Vectors* kv; + + /// @brief correction term i A nabla + void td_ekinetic_scalar(std::complex* Hloc, const TR& Sloc, int nnr); + + /// @brief correction term A^2*S + void td_ekinetic_grad(std::complex* Hloc, int nnr, ModuleBase::Vector3 grad_overlap); + + const TwoCenterIntegrator* intor_ = nullptr; + + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_all; + + bool hR_tmp_done = false; + + bool allocated = false; + + bool output_hR_done = false; +}; + +} // namespace hamilt +#endif + diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp new file mode 100644 index 0000000000..391dca66f0 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp @@ -0,0 +1,447 @@ +#include "td_nonlocal_lcao.h" + +#include "module_parameter/parameter.h" +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" +#include "source_pw/hamilt_pwdft/global.h" +#ifdef _OPENMP +#include +#include +#endif + +template +hamilt::TDNonlocal>::TDNonlocal(HS_Matrix_K* hsk_in, + const std::vector>& kvec_d_in, + hamilt::HContainer* hR_in, + const UnitCell* ucell_in, + const LCAO_Orbitals& orb, + const Grid_Driver* GridD_in) + : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_(orb) +{ + this->cal_type = calculation_type::lcao_tddft_periodic; + this->ucell = ucell_in; + this->Grid = GridD_in; +#ifdef __DEBUG + assert(this->ucell != nullptr); +#endif + // initialize HR to get adjs info. + this->initialize_HR(Grid); +} + +// destructor +template +hamilt::TDNonlocal>::~TDNonlocal() +{ + if (this->allocated) + { + delete this->hR_tmp; + } +} +template +void hamilt::TDNonlocal>::update_td() +{ + // calculate At in cartesian coorinates. + this->cart_At = TD_info::td_vel_op->cart_At; +} +// initialize_HR() +template +void hamilt::TDNonlocal>::initialize_HR(const Grid_Driver* GridD) +{ + if (elecstate::H_TDDFT_pw::stype != 1) + { + return; + } + ModuleBase::TITLE("TDNonlocal", "initialize_HR"); + ModuleBase::timer::tick("TDNonlocal", "initialize_HR"); + + this->adjs_all.clear(); + this->adjs_all.reserve(this->ucell->nat); + for (int iat0 = 0; iat0 < ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_all.push_back(adjs); + } + + ModuleBase::timer::tick("TDNonlocal", "initialize_HR"); +} + +// initialize_HR_tmp() +template +void hamilt::TDNonlocal>::initialize_HR_tmp(const Parallel_Orbitals* paraV) +{ + if (elecstate::H_TDDFT_pw::stype != 1) + { + return; + } + ModuleBase::TITLE("TDNonlocal", "initialize_HR_tmp"); + ModuleBase::timer::tick("TDNonlocal", "initialize_HR_tmp"); + + for (int i = 0; i < this->hR->size_atom_pairs(); ++i) + { + hamilt::AtomPair& tmp = this->hR->get_atom_pair(i); + for (int ir = 0; ir < tmp.get_R_size(); ++ir) + { + const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + + hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); + this->hR_tmp->insert_pair(tmp1); + } + } + this->hR_tmp->allocate(nullptr, true); + + ModuleBase::timer::tick("TDNonlocal", "initialize_HR_tmp"); +} + +template +void hamilt::TDNonlocal>::calculate_HR() +{ + ModuleBase::TITLE("TDNonlocal", "calculate_HR"); + ModuleBase::timer::tick("TDNonlocal", "calculate_HR"); + + const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); + const int npol = this->ucell->get_npol(); + const int nlm_dim = TD_info::out_current ? 4 : 1; + // 1. calculate for each pair of atoms + + for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) + { + const auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + const AdjacentAtomInfo& adjs = this->adjs_all[iat0]; + std::vector>>>> nlm_tot; + nlm_tot.resize(adjs.adj_num + 1); + for (int i = 0; i < adjs.adj_num + 1; i++) + { + nlm_tot[i].resize(nlm_dim); + } + + #pragma omp parallel + { + #pragma omp for schedule(dynamic) + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; + const Atom* atom1 = &ucell->atoms[T1]; + auto all_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat1); + all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); + std::sort(all_indexes.begin(), all_indexes.end()); + all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); + for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) + { + const int iw1 = all_indexes[iw1l] / npol; + std::vector>> nlm; + // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false + // and size of outer vector is 4 when out_current is true (3 for , 1 for + // ) inner loop : all projectors (L0,M0) + + // snap_psibeta_half_tddft() are used to calculate + // and as well if current are needed + module_tddft::snap_psibeta_half_tddft(orb_, + this->ucell->infoNL, + nlm, + tau1 * this->ucell->lat0, + T1, + atom1->iw2l[iw1], + atom1->iw2m[iw1], + atom1->iw2n[iw1], + tau0 * this->ucell->lat0, + T0, + cart_At, + TD_info::out_current); + for (int dir = 0; dir < nlm_dim; dir++) + { + nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); + } + } + } + +#ifdef _OPENMP + // record the iat number of the adjacent atoms + std::set ad_atom_set; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + ad_atom_set.insert(iat1); + } + + // split the ad_atom_set into num_threads parts + const int num_threads = omp_get_num_threads(); + const int thread_id = omp_get_thread_num(); + std::set ad_atom_set_thread; + int i = 0; + for(const auto iat1 : ad_atom_set) + { + if (i % num_threads == thread_id) + { + ad_atom_set_thread.insert(iat1); + } + i++; + } +#endif + + // 2. calculate D for each pair of atoms + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + +#ifdef _OPENMP + if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) + { + continue; + } +#endif + + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + const ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], + R_index2[1] - R_index1[1], + R_index2[2] - R_index1[2]); + hamilt::BaseMatrix>* tmp + = this->hR_tmp->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); + // if not found , skip this pair of atoms + if (tmp != nullptr) + { + if (TD_info::out_current) + { + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i) + ->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]) + ->get_pointer(); + } + this->cal_HR_IJR(iat1, + iat2, + T0, + paraV, + nlm_tot[ad1], + nlm_tot[ad2], + tmp->get_pointer(), + tmp_c); + } + else + { + this->cal_HR_IJR(iat1, + iat2, + T0, + paraV, + nlm_tot[ad1], + nlm_tot[ad2], + tmp->get_pointer(), + nullptr); + } + } + } + } + } + } + + ModuleBase::timer::tick("TDNonlocal", "calculate_HR"); +} + +// cal_HR_IJR() +template +void hamilt::TDNonlocal>::cal_HR_IJR( + const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>>& nlm1_all, + const std::vector>>>& nlm2_all, + std::complex* data_pointer, + std::complex** data_pointer_c) +{ + const int nlm_dim = TD_info::out_current ? 4 : 1; + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + // --------------------------------------------- + // calculate the Nonlocal matrix for each pair of orbitals + // --------------------------------------------- + double olm[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + std::vector step_trace(npol * npol, 0); + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = col_indexes.size() * is + is2; + } + } + // calculate the local matrix + const std::complex* tmp_d = nullptr; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); + std::vector>*> nlm1; + for (int dir = 0; dir < nlm_dim; dir++) + { + nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); + } + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + std::vector>*> nlm2; + for (int dir = 0; dir < nlm_dim; dir++) + { + nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); + } +#ifdef __DEBUG + assert(nlm1.size() == nlm2.size()); +#endif + for (int is = 0; is < npol * npol; ++is) + { + std::complex nlm_tmp = std::complex{0, 0}; + for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) + { + const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; + const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; + this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); + nlm_tmp += nlm1[0]->at(p1) * std::conj(nlm2[0]->at(p2)) * (*tmp_d); + } + data_pointer[step_trace[is]] += nlm_tmp; + if (data_pointer_c != nullptr) + { + for (int dir = 0; dir < 3; dir++) + { + std::complex nlm_r_tmp = std::complex{0, 0}; + std::complex imag_unit = std::complex{0, 1}; + for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) + { + const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; + const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; + this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); + //- + // multiply d in the end + nlm_r_tmp += (nlm1[dir + 1]->at(p1) * std::conj(nlm2[0]->at(p2)) + - nlm1[0]->at(p1) * std::conj(nlm2[dir + 1]->at(p2))) + * (*tmp_d); + } + // -i[r,Vnl], 2.0 due to the unit transformation + data_pointer_c[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; + } + } + } + data_pointer += npol; + if (data_pointer_c != nullptr) + { + for (int dir = 0; dir < 3; dir++) + { + data_pointer_c[dir] += npol; + } + } + } + data_pointer += (npol - 1) * col_indexes.size(); + if (data_pointer_c != nullptr) + { + for (int dir = 0; dir < 3; dir++) + { + data_pointer_c[dir] += (npol - 1) * col_indexes.size(); + } + } + } +} + +// set_hR_tmp() +template +void hamilt::TDNonlocal>::set_HR_fixed(void* hR_tmp_in) +{ + this->hR_tmp = static_cast>*>(hR_tmp_in); + this->allocated = false; +} + + +// contributeHR() +template +void hamilt::TDNonlocal>::contributeHR() +{ + ModuleBase::TITLE("TDNonlocal", "contributeHR"); + + if (elecstate::H_TDDFT_pw::stype != 1) + { + return; + } + + ModuleBase::timer::tick("TDNonlocal", "contributeHR"); + + if (!this->hR_tmp_done || TD_info::evolve_once) + { + if (this->hR_tmp == nullptr) + { + this->hR_tmp = new hamilt::HContainer>(this->hsk->get_pv()); + // allocate memory for hR_tmp use the same memory as hR + this->initialize_HR_tmp(this->hsk->get_pv()); + this->allocated = true; + } + if (this->next_sub_op != nullptr) + { + // pass pointer of hR_tmp to the next node + static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); + } + + // calculate the values in hR_tmp + this->update_td(); + this->calculate_HR(); + this->hR_tmp_done = true; + TD_info::evolve_once = false; + } + + ModuleBase::timer::tick("TDNonlocal", "contributeHR"); + return; +} + + +template +void hamilt::TDNonlocal>::contributeHk(int ik) +{ + return; +} + +template class hamilt::TDNonlocal, double>>; +template class hamilt::TDNonlocal, std::complex>>; diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h new file mode 100644 index 0000000000..d89e7b38e5 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h @@ -0,0 +1,108 @@ +#ifndef TDNONLOCAL_H +#define TDNONLOCAL_H +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" + +#include + +namespace hamilt +{ + +#ifndef __TD_NONLOCALTEMPLATE +#define __TD_NONLOCALTEMPLATE + +/// The TDNonlocal class template inherits from class T +/// It is used to calculate correction term of non-local pseudopotential in time-dependent DFT +template +class TDNonlocal : public T +{ +}; + +#endif + +/// TDNonlocal class template specialization for OperatorLCAO base class +/// It is used to calculate correction term of non-local pseudopotential in time-dependent DFT +/// Template parameters: +/// - TK: data type of k-space Hamiltonian +/// - TR: data type of real space Hamiltonian +template +class TDNonlocal> : public OperatorLCAO +{ + public: + TDNonlocal>(HS_Matrix_K* hsk_in, + const std::vector>& kvec_d_in, + hamilt::HContainer* hR_in, + const UnitCell* ucell_in, + const LCAO_Orbitals& orb, + const Grid_Driver* GridD_in); + ~TDNonlocal>(); + + /** + * @brief contributeHR() is used to calculate the HR matrix + * D_{p1, p2} + */ + virtual void contributeHR() override; + virtual void contributeHk(int ik) override; + + virtual void set_HR_fixed(void*) override; + + private: + const UnitCell* ucell = nullptr; + const LCAO_Orbitals& orb_; + + HContainer* HR = nullptr; + /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only + /// shared between TD operators. + HContainer>* hR_tmp = nullptr; + const Grid_Driver* Grid = nullptr; + + bool allocated = false; + + bool hR_tmp_done = false; + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_HR(const Grid_Driver* GridD_in); + + /** + * @brief initialize HR_tmp + * Allocate the memory for HR_tmp with the same size as HR + */ + void initialize_HR_tmp(const Parallel_Orbitals* paraV); + /// @brief init vector potential for td_nonlocal term + void update_td(); + /** + * @brief calculate the non-local pseudopotential matrix with specific atom-pairs + * nearest neighbor atoms don't need to be calculated again + * loop the atom-pairs in HR and calculate the non-local pseudopotential matrix + */ + void calculate_HR(); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_HR_IJR(const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>>& nlm1_all, + const std::vector>>>& nlm2_all, + std::complex* data_pointer, + std::complex** data_pointer_c); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_all; + /// @brief Store the vector potential for td_nonlocal term + ModuleBase::Vector3 cart_At; +}; + +} // namespace hamilt +#endif diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp new file mode 100644 index 0000000000..54b5471c5d --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp @@ -0,0 +1,300 @@ +#include "td_pot_hybrid.h" + +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_pw/hamilt_pwdft/global.h" + +// Constructor +template +cal_r_overlap_R hamilt::TD_pot_hybrid>::r_calculator; + +template +hamilt::TD_pot_hybrid>::TD_pot_hybrid( + HS_Matrix_K* hsk_in, + const K_Vectors* kv_in, + hamilt::HContainer* hR_in, + hamilt::HContainer* SR_in, + const LCAO_Orbitals& orb, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor) + : hamilt::OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), SR(SR_in), orb_(orb), orb_cutoff_(orb_cutoff), intor_(intor) +{ + this->cal_type = calculation_type::lcao_tddft_periodic; + this->ucell = ucell_in; +#ifdef __DEBUG + assert(this->ucell != nullptr); + assert(this->hsk != nullptr); +#endif + this->init_td(); + // initialize HR to allocate sparse Ekinetic matrix memory + this->initialize_HR(GridD_in); +} + +// destructor +template +hamilt::TD_pot_hybrid>::~TD_pot_hybrid() +{ + if (this->allocated) + { + delete this->HR_fixed; + } + /*if(TD_info::td_vel_op!=nullptr) + { + TD_info::td_vel_op->hk_hybrid = nullptr; + }*/ +} + +// initialize_HR() +template +void hamilt::TD_pot_hybrid>::initialize_HR(const Grid_Driver* GridD) +{ + ModuleBase::TITLE("TD_pot_hybrid", "initialize_HR"); + ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); + + auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR + // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. + + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_cutoff_[T1] + orb_cutoff_[T2]) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_all.push_back(adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index = adjs.box[ad]; + hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); + this->hR->insert_pair(tmp); + } + } + // allocate the memory of BaseMatrix in HR, and set the new values to zero + this->hR->allocate(nullptr, true); + + ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); +} + +template +void hamilt::TD_pot_hybrid>::calculate_HR() +{ + ModuleBase::TITLE("TD_pot_hybrid", "calculate_HR"); + if (this->HR_fixed == nullptr || this->HR_fixed->size_atom_pairs() <= 0) + { + ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "HR_fixed is nullptr or empty"); + } + ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); + + const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_all[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + hamilt::BaseMatrix* tmp = this->HR_fixed->find_matrix(iat1, iat2, R_index2); + hamilt::BaseMatrix* tmp_overlap = this->SR->find_matrix(iat1, iat2, R_index2); + if (tmp != nullptr) + { + this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_overlap->get_pointer()); + } + else + { + ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "R_index not found in HR"); + } + } + } + + ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); +} + +// cal_HR_IJR() +template +void hamilt::TD_pot_hybrid>::cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* hr_mat_p, + TR* sr_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1, I1; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2, I2; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double olm[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + + ModuleBase::Vector3 tmp_r = r_calculator.get_psi_r_psi(tau1 * this->ucell->lat0, T1, L1, m1, N1, tau2 * this->ucell->lat0, T2, L2, m2, N2); + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + for (int ipol = 0; ipol < npol; ipol++) + { + hr_mat_p[ipol * step_trace] += tmp_r * Et; + hr_mat_p[ipol * step_trace] -= ((dtau + tau1) * Et) * sr_p[ipol * step_trace] * this->ucell->lat0; + } + hr_mat_p += npol; + sr_p += npol; + } + hr_mat_p += (npol - 1) * col_indexes.size(); + sr_p += (npol - 1) * col_indexes.size(); + } +} +// init two center integrals and vector potential for td_ekintic term +template +void hamilt::TD_pot_hybrid>::init_td() +{ + // initialize the r_calculator + if(TD_info::td_vel_op->get_istep()==(TD_info::estep_shift-1)) + { + //std::cout << "init_r_overlap" <hR->get_paraV(), orb_); + } + //hk_hybrid.resize(this->hR->get_paraV()->nloc); +} +template +void hamilt::TD_pot_hybrid>::update_td() +{ + //std::cout<<"hybrid gague" <cart_At = TD_info::td_vel_op->cart_At; + //std::cout<<"At: "<< TD_info::td_vel_op->cart_At[0] <<" "<cart_At[1]<<" "<cart_At[2]<<" "< +void hamilt::TD_pot_hybrid>::set_HR_fixed(void* HR_fixed_in) +{ + this->HR_fixed = static_cast*>(HR_fixed_in); + this->allocated = false; +} + +// contributeHR() +template +void hamilt::TD_pot_hybrid>::contributeHR() +{ + ModuleBase::TITLE("TD_pot_hybrid", "contributeHR"); + ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); + + if (!this->HR_fixed_done || TD_info::evolve_once) + { + // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr + if (this->HR_fixed == nullptr) + { + this->HR_fixed = new hamilt::HContainer(*this->hR); + this->HR_fixed->set_zero(); + this->allocated = true; + } + if (this->next_sub_op != nullptr) + { + // pass pointer of HR_fixed to the next node + static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); + } + // calculate the values in HR_fixed + this->update_td(); + this->HR_fixed->set_zero(); + this->calculate_HR(); + this->HR_fixed_done = true; + TD_info::evolve_once = false; + } + // last node of sub-chain, add HR_fixed into HR + if (this->next_sub_op == nullptr) + { + this->hR->add(*(this->HR_fixed)); + } + + ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); + return; +} + +//ETD +// contributeHk() +template +void hamilt::TD_pot_hybrid>::contributeHk(int ik) { + return; +} + +template class hamilt::TD_pot_hybrid, double>>; +template class hamilt::TD_pot_hybrid, std::complex>>; diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h new file mode 100644 index 0000000000..4d7b577e32 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h @@ -0,0 +1,129 @@ +#ifndef TD_POT_HYBRID_H +#define TD_POT_HYBRID_H +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_cell/klist.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include +#include "module_io/cal_r_overlap_R.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" + +namespace hamilt +{ + +#ifndef __TD_POT_HYBRIDTEMPLATE +#define __TD_POT_HYBRIDTEMPLATE + +/// The EkineticNew class template inherits from class T +/// it is used to calculate the electronic kinetic +/// Template parameters: +/// - T: base class, it would be OperatorLCAO or OperatorPW +/// - TR: data type of real space Hamiltonian, it would be double or std::complex +template +class TD_pot_hybrid : public T +{ +}; + +#endif + +/// EkineticNew class template specialization for OperatorLCAO base class +/// It is used to calculate the electronic kinetic matrix in real space and fold it to k-space +/// HR = +/// HK = = \sum_{R} e^{ikR} HR +/// Template parameters: +/// - TK: data type of k-space Hamiltonian +/// - TR: data type of real space Hamiltonian +template +class TD_pot_hybrid> : public OperatorLCAO +{ + public: + /** + * @brief Construct a new EkineticNew object + */ + TD_pot_hybrid>(HS_Matrix_K* hsk_in, + const K_Vectors* kv_in, + HContainer* hR_in, + HContainer* SR_in, + const LCAO_Orbitals& orb, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor); + + /** + * @brief Destroy the EkineticNew object + */ + ~TD_pot_hybrid>(); + + /** + * @brief contributeHR() is used to calculate the HR matrix + * + */ + virtual void contributeHR() override; + //ETD + virtual void contributeHk(int ik) override; + //ETD + + virtual void set_HR_fixed(void*) override; + + + private: + const UnitCell* ucell = nullptr; + std::vector orb_cutoff_; + const LCAO_Orbitals& orb_; + + hamilt::HContainer* HR_fixed = nullptr; + + hamilt::HContainer* SR = nullptr; + + const TwoCenterIntegrator* intor_ = nullptr; + + bool allocated = false; + + bool HR_fixed_done = false; + //tddft part + static cal_r_overlap_R r_calculator; + //ETD + //std::vector> hk_hybrid; + //ETD + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + ModuleBase::Vector3 Et; + + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the electronic kinetic matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_HR(const Grid_Driver* GridD_in); + + void init_td(); + void update_td(); + + /** + * @brief calculate the electronic kinetic matrix with specific atom-pairs + * use the adjs_all to calculate the HR matrix + */ + void calculate_HR(); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* hr_mat_p, + TR* sr_p); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_all; +}; + +} // namespace hamilt +#endif diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp new file mode 100644 index 0000000000..786d7809f5 --- /dev/null +++ b/source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp @@ -0,0 +1,454 @@ +#include "spar_hsr.h" + +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "module_parameter/parameter.h" +#include "spar_dh.h" +#include "spar_exx.h" +#include "spar_u.h" + +#ifdef __MPI +void sparse_format::sync_all_R_coor(std::set>& all_R_coor, MPI_Comm comm) +{ + int my_rank, nproc; + MPI_Comm_rank(comm, &my_rank); + MPI_Comm_size(comm, &nproc); + + // Step 1: Gather the number of R coordinates from each process + int local_size = all_R_coor.size(); + std::vector recv_counts(nproc, 0); + MPI_Allgather(&local_size, 1, MPI_INT, recv_counts.data(), 1, MPI_INT, comm); + + // Step 2: Calculate the number of integers sent by each process (each R coordinate contains 3 integers) + std::vector recv_counts_elements(nproc); + std::vector displacements(nproc, 0); + int total_size_elements = 0; + + for (int i = 0; i < nproc; ++i) + { + recv_counts_elements[i] = recv_counts[i] * 3; // Number of integers sent by each process + displacements[i] = total_size_elements; + total_size_elements += recv_counts_elements[i]; + } + + // Step 3: Gather the raw data of all R coordinates (each R coordinate is stored as 3 integers) + std::vector local_R_data; + local_R_data.reserve(local_size * 3); + for (const auto& R: all_R_coor) + { + local_R_data.push_back(R.x); + local_R_data.push_back(R.y); + local_R_data.push_back(R.z); + } + + // Step 4: Allocate the receive buffer and call MPI_Allgatherv + std::vector global_R_data(total_size_elements); + MPI_Allgatherv(local_R_data.data(), + local_size * 3, + MPI_INT, + global_R_data.data(), + recv_counts_elements.data(), + displacements.data(), + MPI_INT, + comm); + + // Step 5: Merge to create a global set of R coordinates + std::set> global_R_coor; + for (int i = 0; i < total_size_elements; i += 3) + { + int x = global_R_data[i]; + int y = global_R_data[i + 1]; + int z = global_R_data[i + 2]; + global_R_coor.insert(Abfs::Vector3_Order(x, y, z)); + } + + // Step 6: Update all processes' all_R_coor + all_R_coor = std::move(global_R_coor); +} +#endif // __MPI + +void sparse_format::cal_HSR(const UnitCell& ucell, + const Parallel_Orbitals& pv, + LCAO_HS_Arrays& HS_Arrays, + const Grid_Driver& grid, + const int& current_spin, + const double& sparse_thr, + const int (&nmp)[3], + hamilt::Hamilt>* p_ham +#ifdef __EXX + , + const std::vector>>>* Hexxd, + const std::vector>>>>* Hexxc +#endif +) +{ + ModuleBase::TITLE("sparse_format", "cal_HSR"); + + // sparse_format::set_R_range(HS_Arrays.all_R_coor, grid); + + const int nspin = PARAM.inp.nspin; + + // cal_STN_R_sparse(current_spin, sparse_thr); + if (nspin == 1 || nspin == 2) + { + hamilt::HamiltLCAO, double>* p_ham_lcao + = dynamic_cast, double>*>(p_ham); + + HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); + + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) + { + sparse_format::cal_HContainer_td(pv, + current_spin, + sparse_thr, + *(p_ham_lcao->getHR()), + TD_info::td_vel_op->HR_sparse_td_vel[current_spin]); + } + else + { + + sparse_format::cal_HContainer_d(pv, + current_spin, + sparse_thr, + *(p_ham_lcao->getHR()), + HS_Arrays.HR_sparse[current_spin]); + } + + sparse_format::cal_HContainer_d(pv, current_spin, sparse_thr, *(p_ham_lcao->getSR()), HS_Arrays.SR_sparse); + } + else if (nspin == 4) + { + hamilt::HamiltLCAO, std::complex>* p_ham_lcao + = dynamic_cast, std::complex>*>(p_ham); + + HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); + + sparse_format::cal_HContainer_cd(pv, current_spin, sparse_thr, *(p_ham_lcao->getHR()), HS_Arrays.HR_soc_sparse); + + sparse_format::cal_HContainer_cd(pv, current_spin, sparse_thr, *(p_ham_lcao->getSR()), HS_Arrays.SR_soc_sparse); + } + else + { + ModuleBase::WARNING_QUIT("cal_HSR", "check the value of nspin."); + } + + // only old DFT+U method need to cal extra contribution to HR + if (PARAM.inp.dft_plus_u == 2) + { + if (nspin == 1 || nspin == 2) + { + cal_HR_dftu(pv, HS_Arrays.all_R_coor, HS_Arrays.SR_sparse, HS_Arrays.HR_sparse, current_spin, sparse_thr); + } + else if (nspin == 4) + { + cal_HR_dftu_soc(pv, + HS_Arrays.all_R_coor, + HS_Arrays.SR_soc_sparse, + HS_Arrays.HR_soc_sparse, + current_spin, + sparse_thr); + } + else + { + ModuleBase::WARNING_QUIT("cal_HSR", "check the value of nspin."); + } + } + +#ifdef __EXX +#ifdef __MPI + // if EXX is considered + if (GlobalC::exx_info.info_global.cal_exx) + { + + if (Hexxd && GlobalC::exx_info.info_ri.real_number) + { + + sparse_format::cal_HR_exx(ucell, pv, HS_Arrays, current_spin, sparse_thr, nmp, *Hexxd); + } + else if (Hexxc && !GlobalC::exx_info.info_ri.real_number) + { + + sparse_format::cal_HR_exx(ucell, pv, HS_Arrays, current_spin, sparse_thr, nmp, *Hexxc); + } + } +#endif // __MPI +#endif // __EXX + + sparse_format::clear_zero_elements(HS_Arrays, current_spin, sparse_thr); + + return; +} + +void sparse_format::cal_HContainer_d( + const Parallel_Orbitals& pv, + const int& current_spin, + const double& sparse_thr, + const hamilt::HContainer& hR, + std::map, std::map>>& target) +{ + ModuleBase::TITLE("sparse_format", "cal_HContainer_d"); + + auto row_indexes = pv.get_indexes_row(); + auto col_indexes = pv.get_indexes_col(); + for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) + { + int atom_i = hR.get_atom_pair(iap).get_atom_i(); + int atom_j = hR.get_atom_pair(iap).get_atom_j(); + int start_i = pv.atom_begin_row[atom_i]; + int start_j = pv.atom_begin_col[atom_j]; + int row_size = pv.get_row_size(atom_i); + int col_size = pv.get_col_size(atom_j); + for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) + { + auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); + const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); + Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); + for (int i = 0; i < row_size; ++i) + { + int mu = row_indexes[start_i + i]; + for (int j = 0; j < col_size; ++j) + { + int nu = col_indexes[start_j + j]; + const auto& value_tmp = matrix.get_value(i, j); + if (std::abs(value_tmp) > sparse_thr) + { + target[dR][mu][nu] = value_tmp; + } + } + } + } + } + + return; +} + +void sparse_format::cal_HContainer_cd( + const Parallel_Orbitals& pv, + const int& current_spin, + const double& sparse_thr, + const hamilt::HContainer>& hR, + std::map, std::map>>>& target) +{ + ModuleBase::TITLE("sparse_format", "cal_HContainer_cd"); + + auto row_indexes = pv.get_indexes_row(); + auto col_indexes = pv.get_indexes_col(); + for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) + { + int atom_i = hR.get_atom_pair(iap).get_atom_i(); + int atom_j = hR.get_atom_pair(iap).get_atom_j(); + int start_i = pv.atom_begin_row[atom_i]; + int start_j = pv.atom_begin_col[atom_j]; + int row_size = pv.get_row_size(atom_i); + int col_size = pv.get_col_size(atom_j); + for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) + { + auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); + const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); + Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); + for (int i = 0; i < row_size; ++i) + { + int mu = row_indexes[start_i + i]; + for (int j = 0; j < col_size; ++j) + { + int nu = col_indexes[start_j + j]; + const auto& value_tmp = matrix.get_value(i, j); + if (std::abs(value_tmp) > sparse_thr) + { + target[dR][mu][nu] = value_tmp; + } + } + } + } + } + + return; +} + +void sparse_format::cal_HContainer_td( + const Parallel_Orbitals& pv, + const int& current_spin, + const double& sparse_thr, + const hamilt::HContainer& hR, + std::map, std::map>>>& target) +{ + ModuleBase::TITLE("sparse_format", "cal_HContainer_td"); + + auto row_indexes = pv.get_indexes_row(); + auto col_indexes = pv.get_indexes_col(); + for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) + { + int atom_i = hR.get_atom_pair(iap).get_atom_i(); + int atom_j = hR.get_atom_pair(iap).get_atom_j(); + int start_i = pv.atom_begin_row[atom_i]; + int start_j = pv.atom_begin_col[atom_j]; + int row_size = pv.get_row_size(atom_i); + int col_size = pv.get_col_size(atom_j); + for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) + { + auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); + const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); + Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); + for (int i = 0; i < row_size; ++i) + { + int mu = row_indexes[start_i + i]; + for (int j = 0; j < col_size; ++j) + { + int nu = col_indexes[start_j + j]; + const auto& value_tmp = std::complex(matrix.get_value(i, j), 0.0); + if (std::abs(value_tmp) > sparse_thr) + { + target[dR][mu][nu] += value_tmp; + } + } + } + } + } + + return; +} + +// in case there are elements smaller than the threshold +void sparse_format::clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& current_spin, const double& sparse_thr) +{ + ModuleBase::TITLE("sparse_format", "clear_zero_elements"); + + if (PARAM.inp.nspin != 4) + { + for (auto& R_loop: HS_Arrays.HR_sparse[current_spin]) + { + for (auto& row_loop: R_loop.second) + { + auto& col_map = row_loop.second; + auto iter = col_map.begin(); + while (iter != col_map.end()) + { + if (std::abs(iter->second) <= sparse_thr) + { + col_map.erase(iter++); + } + else + { + iter++; + } + } + } + } + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) + { + for (auto& R_loop: TD_info::td_vel_op->HR_sparse_td_vel[current_spin]) + { + for (auto& row_loop: R_loop.second) + { + auto& col_map = row_loop.second; + auto iter = col_map.begin(); + while (iter != col_map.end()) + { + if (std::abs(iter->second) <= sparse_thr) + { + col_map.erase(iter++); + } + else + { + iter++; + } + } + } + } + } + + for (auto& R_loop: HS_Arrays.SR_sparse) + { + for (auto& row_loop: R_loop.second) + { + auto& col_map = row_loop.second; + auto iter = col_map.begin(); + while (iter != col_map.end()) + { + if (std::abs(iter->second) <= sparse_thr) + { + col_map.erase(iter++); + } + else + { + iter++; + } + } + } + } + } + else + { + for (auto& R_loop: HS_Arrays.HR_soc_sparse) + { + for (auto& row_loop: R_loop.second) + { + auto& col_map = row_loop.second; + auto iter = col_map.begin(); + while (iter != col_map.end()) + { + if (std::abs(iter->second) <= sparse_thr) + { + col_map.erase(iter++); + } + else + { + iter++; + } + } // end while iter + } // end row loop + } // end R loop + + for (auto& R_loop: HS_Arrays.SR_soc_sparse) + { + for (auto& row_loop: R_loop.second) + { + auto& col_map = row_loop.second; + auto iter = col_map.begin(); + while (iter != col_map.end()) + { + if (std::abs(iter->second) <= sparse_thr) + { + col_map.erase(iter++); + } + else + { + iter++; + } + } // end while iter + } // end row_loop + } // end R_loop + } + + return; +} + +void sparse_format::destroy_HS_R_sparse(LCAO_HS_Arrays& HS_Arrays) +{ + ModuleBase::TITLE("sparse_format", "destroy_HS_R_sparse"); + + if (PARAM.inp.nspin != 4) + { + std::map, std::map>> empty_HR_sparse_up; + std::map, std::map>> empty_HR_sparse_down; + std::map, std::map>> empty_SR_sparse; + HS_Arrays.HR_sparse[0].swap(empty_HR_sparse_up); + HS_Arrays.HR_sparse[1].swap(empty_HR_sparse_down); + HS_Arrays.SR_sparse.swap(empty_SR_sparse); + } + else + { + std::map, std::map>>> + empty_HR_soc_sparse; + std::map, std::map>>> + empty_SR_soc_sparse; + HS_Arrays.HR_soc_sparse.swap(empty_HR_soc_sparse); + HS_Arrays.SR_soc_sparse.swap(empty_SR_soc_sparse); + } + + // 'all_R_coor' has a small memory requirement and does not need to be + // deleted. std::set> empty_all_R_coor; + // all_R_coor.swap(empty_all_R_coor); + + return; +} diff --git a/source/source_hamilt_lcao/module_tddft/CMakeLists.txt b/source/source_hamilt_lcao/module_tddft/CMakeLists.txt new file mode 100644 index 0000000000..58bc834a5f --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/CMakeLists.txt @@ -0,0 +1,36 @@ +if(ENABLE_LCAO) + list(APPEND objects + evolve_elec.cpp + evolve_psi.cpp + band_energy.cpp + middle_hamilt.cpp + norm_psi.cpp + propagator.cpp + propagator_cn2.cpp + propagator_taylor.cpp + propagator_etrs.cpp + upsi.cpp + td_info.cpp + velocity_op.cpp + snap_psibeta_half_tddft.cpp + td_folding.cpp + solve_propagation.cpp + ) + + add_library( + tddft + OBJECT + ${objects} + ) + + if(ENABLE_COVERAGE) + add_coverage(tddft) + endif() + + IF (BUILD_TESTING) + if(ENABLE_MPI) + add_subdirectory(test) + endif() + endif() + +endif() diff --git a/source/source_hamilt_lcao/module_tddft/evolve_elec.cpp b/source/source_hamilt_lcao/module_tddft/evolve_elec.cpp new file mode 100644 index 0000000000..f9c31081f3 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/evolve_elec.cpp @@ -0,0 +1,226 @@ +#include "evolve_elec.h" + +#include "evolve_psi.h" +#include "source_base/parallel_reduce.h" +#include "source_base/timer.h" +#include "source_estate/module_charge/symmetry_rho.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "module_hamilt_lcao/module_dftu/dftu.h" +#include "source_pw/hamilt_pwdft/global.h" + +namespace module_tddft +{ +template +Evolve_elec::Evolve_elec(){}; +template +Evolve_elec::~Evolve_elec(){}; + +template +ct::DeviceType Evolve_elec::ct_device_type = ct::DeviceTypeToEnum::value; + +// this routine only serves for TDDFT using LCAO basis set +template +void Evolve_elec::solve_psi(const int& istep, + const int nband, + const int nlocal, + const int& nks, + hamilt::Hamilt>* phm, + Parallel_Orbitals& para_orb, + psi::Psi>* psi, + psi::Psi>* psi_laststep, + std::complex** Hk_laststep, + std::complex** Sk_laststep, + ModuleBase::matrix& ekb, + std::ofstream& ofs_running, + const int htype, + const int propagator, + const bool use_tensor, + const bool use_lapack) +{ + ModuleBase::TITLE("Evolve_elec", "solve_psi"); + ModuleBase::timer::tick("Evolve_elec", "solve_psi"); + + // Control the print of matrix to running_md.log + const int print_matrix = 0; + + for (int ik = 0; ik < nks; ik++) + { + phm->updateHk(ik); + + ModuleBase::timer::tick("Efficiency", "evolve_k"); + psi->fix_k(ik); + psi_laststep->fix_k(ik); + if (htype == 0) + { + evolve_psi(nband, + nlocal, + &(para_orb), + phm, + psi[0].get_pointer(), + psi_laststep[0].get_pointer(), + nullptr, + nullptr, + &(ekb(ik, 0)), + htype, + propagator, + ofs_running, + print_matrix); + } + else if (htype == 1) + { + if (!use_tensor) + { + evolve_psi(nband, + nlocal, + &(para_orb), + phm, + psi[0].get_pointer(), + psi_laststep[0].get_pointer(), + Hk_laststep[ik], + Sk_laststep[ik], + &(ekb(ik, 0)), + htype, + propagator, + ofs_running, + print_matrix); + // std::cout << "Print ekb: " << std::endl; + // ekb.print(std::cout); + } + else + { + const int len_psi_k_1 = use_lapack ? nband : psi->get_nbands(); + const int len_psi_k_2 = use_lapack ? nlocal : psi->get_nbasis(); + const int len_HS_laststep = use_lapack ? nlocal * nlocal : para_orb.nloc; + + // Create Tensor for psi_k, psi_k_laststep, H_laststep, S_laststep, ekb + ct::Tensor psi_k_tensor(ct::DataType::DT_COMPLEX_DOUBLE, + ct_device_type, + ct::TensorShape({len_psi_k_1, len_psi_k_2})); + ct::Tensor psi_k_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, + ct_device_type, + ct::TensorShape({len_psi_k_1, len_psi_k_2})); + ct::Tensor H_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, + ct_device_type, + ct::TensorShape({len_HS_laststep})); + ct::Tensor S_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, + ct_device_type, + ct::TensorShape({len_HS_laststep})); + ct::Tensor ekb_tensor(ct::DataType::DT_DOUBLE, ct_device_type, ct::TensorShape({nband})); + + // Global psi + ModuleESolver::Matrix_g> psi_g; + ModuleESolver::Matrix_g> psi_laststep_g; + + if (use_lapack) + { + // Need to gather the psi to the root process on CPU + // H_laststep and S_laststep are already gathered in esolver_ks_lcao_tddft.cpp +#ifdef __MPI + // Access the rank of the calling process in the communicator + int myid = 0; + int root_proc = 0; + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + + // Gather psi to the root process + gatherPsi(myid, root_proc, psi[0].get_pointer(), para_orb, psi_g); + gatherPsi(myid, root_proc, psi_laststep[0].get_pointer(), para_orb, psi_laststep_g); + + // Syncronize data from CPU to Device + syncmem_complex_h2d_op()(psi_k_tensor.data>(), + psi_g.p.get(), + len_psi_k_1 * len_psi_k_2); + syncmem_complex_h2d_op()(psi_k_laststep_tensor.data>(), + psi_laststep_g.p.get(), + len_psi_k_1 * len_psi_k_2); +#endif + } + else + { + // Syncronize data from CPU to Device + syncmem_complex_h2d_op()(psi_k_tensor.data>(), + psi[0].get_pointer(), + len_psi_k_1 * len_psi_k_2); + syncmem_complex_h2d_op()(psi_k_laststep_tensor.data>(), + psi_laststep[0].get_pointer(), + len_psi_k_1 * len_psi_k_2); + } + + syncmem_complex_h2d_op()(H_laststep_tensor.data>(), + Hk_laststep[ik], + len_HS_laststep); + syncmem_complex_h2d_op()(S_laststep_tensor.data>(), + Sk_laststep[ik], + len_HS_laststep); + syncmem_double_h2d_op()(ekb_tensor.data(), &(ekb(ik, 0)), nband); + + evolve_psi_tensor(nband, + nlocal, + &(para_orb), + phm, + psi_k_tensor, + psi_k_laststep_tensor, + H_laststep_tensor, + S_laststep_tensor, + ekb_tensor, + htype, + propagator, + ofs_running, + print_matrix, + use_lapack); + + // Need to distribute global psi back to all processes + if (use_lapack) + { +#ifdef __MPI + // Syncronize data from Device to CPU + syncmem_complex_d2h_op()(psi_g.p.get(), + psi_k_tensor.data>(), + len_psi_k_1 * len_psi_k_2); + syncmem_complex_d2h_op()(psi_laststep_g.p.get(), + psi_k_laststep_tensor.data>(), + len_psi_k_1 * len_psi_k_2); + + // Distribute psi to all processes + distributePsi(para_orb, psi[0].get_pointer(), psi_g); + distributePsi(para_orb, psi_laststep[0].get_pointer(), psi_laststep_g); +#endif + } + else + { + // Syncronize data from Device to CPU + syncmem_complex_d2h_op()(psi[0].get_pointer(), + psi_k_tensor.data>(), + len_psi_k_1 * len_psi_k_2); + syncmem_complex_d2h_op()(psi_laststep[0].get_pointer(), + psi_k_laststep_tensor.data>(), + len_psi_k_1 * len_psi_k_2); + } + syncmem_complex_d2h_op()(Hk_laststep[ik], + H_laststep_tensor.data>(), + len_HS_laststep); + syncmem_complex_d2h_op()(Sk_laststep[ik], + S_laststep_tensor.data>(), + len_HS_laststep); + syncmem_double_d2h_op()(&(ekb(ik, 0)), ekb_tensor.data(), nband); + + // std::cout << "Print ekb tensor: " << std::endl; + // ekb.print(std::cout); + } + } + else + { + std::cout << "method of htype is wrong" << std::endl; + } + + ModuleBase::timer::tick("Efficiency", "evolve_k"); + } // end k + + ModuleBase::timer::tick("Evolve_elec", "solve_psi"); + return; +} + +template class Evolve_elec; +#if ((defined __CUDA) /* || (defined __ROCM) */) +template class Evolve_elec; +#endif +} // namespace module_tddft \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/evolve_elec.h b/source/source_hamilt_lcao/module_tddft/evolve_elec.h new file mode 100644 index 0000000000..44972bae3f --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/evolve_elec.h @@ -0,0 +1,185 @@ +#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_TDDFT_EVOLVE_ELEC_H +#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_TDDFT_EVOLVE_ELEC_H + +#include "source_base/global_function.h" +#include "source_base/global_variable.h" +#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor +#include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap +#include "source_base/module_device/device.h" // base_device +#include "source_base/module_device/memory_op.h" // memory operations +#include "source_base/scalapack_connector.h" // Cpxgemr2d +#include "source_esolver/esolver_ks_lcao.h" +#include "source_esolver/esolver_ks_lcao_tddft.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_psi/psi.h" + +//----------------------------------------------------------- +// mohan add 2021-02-09 +// This class is used to evolve the electronic wave functions +// in TDDFT in terms of the multiple k points +// k is the index for the points in the first Brillouin zone +//----------------------------------------------------------- + +//------------------------ Debugging utility function ------------------------// + +// Print the shape of a Tensor +inline void print_tensor_shape(const ct::Tensor& tensor, const std::string& name) +{ + std::cout << "Shape of " << name << ": ["; + for (int i = 0; i < tensor.shape().ndim(); ++i) + { + std::cout << tensor.shape().dim_size(i); + if (i < tensor.shape().ndim() - 1) + { + std::cout << ", "; + } + } + std::cout << "]" << std::endl; +} + +// Recursive print function +template +inline void print_tensor_data_recursive(const T* data, + const std::vector& shape, + const std::vector& strides, + int dim, + std::vector& indices, + const std::string& name) +{ + if (dim == shape.size()) + { + // Recursion base case: print data when reaching the innermost dimension + std::cout << name; + for (size_t i = 0; i < indices.size(); ++i) + { + std::cout << "[" << indices[i] << "]"; + } + std::cout << " = " << *data << std::endl; + return; + } + // Recursively process the current dimension + for (int64_t i = 0; i < shape[dim]; ++i) + { + indices[dim] = i; + print_tensor_data_recursive(data + i * strides[dim], shape, strides, dim + 1, indices, name); + } +} + +// Generic print function +template +inline void print_tensor_data(const ct::Tensor& tensor, const std::string& name) +{ + const std::vector& shape = tensor.shape().dims(); + const std::vector& strides = tensor.shape().strides(); + const T* data = tensor.data(); + std::vector indices(shape.size(), 0); + print_tensor_data_recursive(data, shape, strides, 0, indices, name); +} + +// Specialization for std::complex +template <> +inline void print_tensor_data>(const ct::Tensor& tensor, const std::string& name) +{ + const std::vector& shape = tensor.shape().dims(); + const std::vector& strides = tensor.shape().strides(); + const std::complex* data = tensor.data>(); + std::vector indices(shape.size(), 0); + print_tensor_data_recursive(data, shape, strides, 0, indices, name); +} + +//------------------------ Debugging utility function ------------------------// + +namespace module_tddft +{ +#ifdef __MPI +//------------------------ MPI gathering and distributing functions ------------------------// +template +void gatherPsi(const int myid, + const int root_proc, + T* psi_l, + const Parallel_Orbitals& para_orb, + ModuleESolver::Matrix_g& psi_g) +{ + const int* desc_psi = para_orb.desc_wfc; // Obtain the descriptor from Parallel_Orbitals + int ctxt = desc_psi[1]; // BLACS context + int nrows = desc_psi[2]; // Global matrix row number + int ncols = desc_psi[3]; // Global matrix column number + + if (myid == root_proc) + { + psi_g.p.reset(new T[nrows * ncols]); // No need to delete[] since it is a shared_ptr + } + else + { + psi_g.p.reset(new T[nrows * ncols]); // Placeholder for non-root processes + } + + // Set the descriptor of the global psi + psi_g.desc.reset(new int[9]{1, ctxt, nrows, ncols, nrows, ncols, 0, 0, nrows}); + psi_g.row = nrows; + psi_g.col = ncols; + + // Call the Cpxgemr2d function in ScaLAPACK to collect the matrix data + Cpxgemr2d(nrows, ncols, psi_l, 1, 1, const_cast(desc_psi), psi_g.p.get(), 1, 1, psi_g.desc.get(), ctxt); +} + +template +void distributePsi(const Parallel_Orbitals& para_orb, T* psi_l, const ModuleESolver::Matrix_g& psi_g) +{ + const int* desc_psi = para_orb.desc_wfc; // Obtain the descriptor from Parallel_Orbitals + int ctxt = desc_psi[1]; // BLACS context + int nrows = desc_psi[2]; // Global matrix row number + int ncols = desc_psi[3]; // Global matrix column number + + // Call the Cpxgemr2d function in ScaLAPACK to distribute the matrix data + Cpxgemr2d(nrows, ncols, psi_g.p.get(), 1, 1, psi_g.desc.get(), psi_l, 1, 1, const_cast(desc_psi), ctxt); +} +//------------------------ MPI gathering and distributing functions ------------------------// +#endif // __MPI + +template +class Evolve_elec +{ + friend class ModuleESolver::ESolver_KS_LCAO, double>; + + // Template parameter is needed for the friend class declaration + friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; + friend class ModuleESolver::ESolver_KS_LCAO_TDDFT, Device>; + + public: + Evolve_elec(); + ~Evolve_elec(); + + private: + static void solve_psi(const int& istep, + const int nband, + const int nlocal, + const int& nks, + hamilt::Hamilt>* phm, + Parallel_Orbitals& para_orb, + psi::Psi>* psi, + psi::Psi>* psi_laststep, + std::complex** Hk_laststep, + std::complex** Sk_laststep, + ModuleBase::matrix& ekb, + std::ofstream& ofs_running, + const int htype, + const int propagator, + const bool use_tensor, + const bool use_lapack); + + // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice + static ct::DeviceType ct_device_type; + // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU + using ct_Device = typename ct::PsiToContainer::type; + + // Memory operations + using syncmem_double_h2d_op = base_device::memory::synchronize_memory_op; + using syncmem_double_d2h_op = base_device::memory::synchronize_memory_op; + using syncmem_complex_h2d_op + = base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>; + using syncmem_complex_d2h_op + = base_device::memory::synchronize_memory_op, base_device::DEVICE_CPU, Device>; +}; +} // namespace module_tddft +#endif diff --git a/source/source_hamilt_lcao/module_tddft/evolve_psi.cpp b/source/source_hamilt_lcao/module_tddft/evolve_psi.cpp new file mode 100644 index 0000000000..29c9e88125 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/evolve_psi.cpp @@ -0,0 +1,352 @@ +#include "evolve_psi.h" + +#include "band_energy.h" +#include "middle_hamilt.h" +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" // cuBLAS handle +#include "source_base/module_container/ATen/kernels/lapack.h" // cuSOLVER handle +#include "source_base/scalapack_connector.h" +#include "source_esolver/esolver_ks_lcao_tddft.h" // use gatherMatrix +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_pw/hamilt_pwdft/global.h" +#include "module_parameter/parameter.h" +#include "norm_psi.h" +#include "propagator.h" +#include "upsi.h" +#include "solve_propagation.h" + +#include + +namespace module_tddft +{ +void evolve_psi(const int nband, + const int nlocal, + const Parallel_Orbitals* pv, + hamilt::Hamilt>* p_hamilt, + std::complex* psi_k, + std::complex* psi_k_laststep, + std::complex* H_laststep, + std::complex* S_laststep, + double* ekb, + int htype, + int propagator, + std::ofstream& ofs_running, + const int print_matrix) +{ + ModuleBase::TITLE("Evolve_psi", "evolve_psi"); + ofs_running << " Evolving electronic wave functions begins" << std::endl; + + time_t time_start = time(nullptr); + ofs_running << " Start Time : " << ctime(&time_start); + +#ifdef __MPI + + hamilt::MatrixBlock> h_mat; + hamilt::MatrixBlock> s_mat; + p_hamilt->matrix(h_mat, s_mat); + + std::complex* Stmp = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(Stmp, pv->nloc); + BlasConnector::copy(pv->nloc, s_mat.p, 1, Stmp, 1); + + std::complex* Htmp = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(Htmp, pv->nloc); + BlasConnector::copy(pv->nloc, h_mat.p, 1, Htmp, 1); + + std::complex* Hold = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(Hold, pv->nloc); + BlasConnector::copy(pv->nloc, h_mat.p, 1, Hold, 1); + + std::complex* U_operator = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(U_operator, pv->nloc); + + // (1)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief compute H(t+dt/2) + /// @input H_laststep, Htmp, print_matrix + /// @output Htmp + if (htype == 1 && propagator != 2) + { + half_Hmatrix(pv, nband, nlocal, Htmp, Stmp, H_laststep, S_laststep, ofs_running, print_matrix); + } + + // (2)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + if (propagator != 3) + { + /// @brief compute U_operator + /// @input Stmp, Htmp, print_matrix + /// @output U_operator + Propagator prop(propagator, pv, PARAM.inp.td_dt); + prop.compute_propagator(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); + } + + // (3)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + if (propagator != 3) + { + /// @brief apply U_operator to the wave function of the previous step for new wave function + /// @input U_operator, psi_k_laststep, print_matrix + /// @output psi_k + upsi(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); + } + else + { + /// @brief solve the propagation equation + /// @input Stmp, Htmp, psi_k_laststep + /// @output psi_k + solve_propagation(pv, nband, nlocal, PARAM.inp.td_dt, Stmp, Htmp, psi_k_laststep, psi_k); + } + + // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief normalize psi_k + /// @input Stmp, psi_not_norm, psi_k, print_matrix + /// @output psi_k + norm_psi(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); + + // (5)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief compute ekb + /// @input Htmp, psi_k + /// @output ekb + compute_ekb(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); + + delete[] Stmp; + delete[] Htmp; + delete[] Hold; + delete[] U_operator; + +#endif + + time_t time_end = time(nullptr); + ModuleBase::GlobalFunc::OUT_TIME("evolve(std::complex)", time_start, time_end); + + ofs_running << " Evolving electronic wave functions ends" << std::endl; + + return; +} + +template +void evolve_psi_tensor(const int nband, + const int nlocal, + const Parallel_Orbitals* pv, + hamilt::Hamilt>* p_hamilt, + ct::Tensor& psi_k, + ct::Tensor& psi_k_laststep, + ct::Tensor& H_laststep, + ct::Tensor& S_laststep, + ct::Tensor& ekb, + int htype, + int propagator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack) +{ + // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice + ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; + // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU + using ct_Device = typename ct::PsiToContainer::type; + // Memory operations + using syncmem_complex_h2d_op + = base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>; + +#if ((defined __CUDA) /* || (defined __ROCM) */) + // Initialize cuBLAS & cuSOLVER handle + ct::kernels::createGpuSolverHandle(); + ct::kernels::createGpuBlasHandle(); +#endif // __CUDA + + ofs_running << " evolve_psi_tensor::start " << std::endl; + + ModuleBase::TITLE("Evolve_psi", "evolve_psi"); + time_t time_start = time(nullptr); + ofs_running << " Start Time : " << ctime(&time_start); + +#ifdef __MPI + + hamilt::MatrixBlock> h_mat, s_mat; + p_hamilt->matrix(h_mat, s_mat); + + // Create Tensor objects for temporary data and sync from host to device + const int len_HS = use_lapack ? nlocal * nlocal : pv->nloc; + ct::Tensor Stmp(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); + ct::Tensor Htmp(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); + ct::Tensor Hold(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); + + if (use_lapack) + { + // Need to gather H and S matrix to root process here + int myid = 0; + int num_procs = 1; + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + ModuleESolver::Matrix_g> h_mat_g, s_mat_g; // Global matrix structure + + // Collect H matrix + ModuleESolver::gatherMatrix(myid, 0, h_mat, h_mat_g); + syncmem_complex_h2d_op()(Htmp.data>(), h_mat_g.p.get(), len_HS); + syncmem_complex_h2d_op()(Hold.data>(), h_mat_g.p.get(), len_HS); + + // Collect S matrix + ModuleESolver::gatherMatrix(myid, 0, s_mat, s_mat_g); + syncmem_complex_h2d_op()(Stmp.data>(), s_mat_g.p.get(), len_HS); + } + else + { + // Original code + syncmem_complex_h2d_op()(Stmp.data>(), s_mat.p, len_HS); + syncmem_complex_h2d_op()(Htmp.data>(), h_mat.p, len_HS); + syncmem_complex_h2d_op()(Hold.data>(), h_mat.p, len_HS); + } + + ct::Tensor U_operator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); + U_operator.zero(); + + int myid = 0; + int root_proc = 0; + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + + // (1)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief compute H(t+dt/2) + /// @input H_laststep, Htmp, print_matrix + /// @output Htmp + if (htype == 1 && propagator != 2) + { + if (!use_lapack) + { + half_Hmatrix_tensor(pv, nband, nlocal, Htmp, Stmp, H_laststep, S_laststep, ofs_running, print_matrix); + } + else + { + if (myid == root_proc) + { + half_Hmatrix_tensor_lapack(pv, + nband, + nlocal, + Htmp, + Stmp, + H_laststep, + S_laststep, + ofs_running, + print_matrix); + } + } + } + + // (2)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief compute U_operator + /// @input Stmp, Htmp, print_matrix + /// @output U_operator + Propagator prop(propagator, pv, PARAM.mdp.md_dt); + prop.compute_propagator_tensor(nlocal, + Stmp, + Htmp, + H_laststep, + U_operator, + ofs_running, + print_matrix, + use_lapack); + + // (3)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief apply U_operator to the wave function of the previous step for new wave function + /// @input U_operator, psi_k_laststep, print_matrix + /// @output psi_k + if (!use_lapack) + { + upsi_tensor(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); + } + else + { + if (myid == root_proc) + { + upsi_tensor_lapack(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); + } + } + + // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief normalize psi_k + /// @input Stmp, psi_not_norm, psi_k, print_matrix + /// @output psi_k + if (!use_lapack) + { + norm_psi_tensor(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); + } + else + { + if (myid == root_proc) + { + norm_psi_tensor_lapack(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); + } + } + + // (5)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + /// @brief compute ekb + /// @input Htmp, psi_k + /// @output ekb + if (!use_lapack) + { + compute_ekb_tensor(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); + } + else + { + if (myid == root_proc) + { + compute_ekb_tensor_lapack(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); + } + } + +#endif // __MPI + + time_t time_end = time(nullptr); + ModuleBase::GlobalFunc::OUT_TIME("evolve(std::complex)", time_start, time_end); + + ofs_running << " evolve_psi_tensor::end " << std::endl; + +#if ((defined __CUDA) /* || (defined __ROCM) */) + // Destroy cuBLAS & cuSOLVER handle + ct::kernels::destroyGpuSolverHandle(); + ct::kernels::destroyGpuBlasHandle(); +#endif // __CUDA + + return; +} + +// Explicit instantiation of template functions +template void evolve_psi_tensor(const int nband, + const int nlocal, + const Parallel_Orbitals* pv, + hamilt::Hamilt>* p_hamilt, + ct::Tensor& psi_k, + ct::Tensor& psi_k_laststep, + ct::Tensor& H_laststep, + ct::Tensor& S_laststep, + ct::Tensor& ekb, + int htype, + int propagator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack); + +#if ((defined __CUDA) /* || (defined __ROCM) */) +template void evolve_psi_tensor(const int nband, + const int nlocal, + const Parallel_Orbitals* pv, + hamilt::Hamilt>* p_hamilt, + ct::Tensor& psi_k, + ct::Tensor& psi_k_laststep, + ct::Tensor& H_laststep, + ct::Tensor& S_laststep, + ct::Tensor& ekb, + int htype, + int propagator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack); +#endif // __CUDA + +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/evolve_psi.h b/source/source_hamilt_lcao/module_tddft/evolve_psi.h new file mode 100644 index 0000000000..e1b64f7c9b --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/evolve_psi.h @@ -0,0 +1,47 @@ +/** + * @file evolve_psi.h + * @brief evolve the wave function + * This file originally belonged to file LCAO_evolve.cpp + */ +#ifndef ELEC_PSI_H +#define ELEC_PSI_H + +#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor +#include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap +#include "source_basis/module_ao/parallel_orbitals.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" + +namespace module_tddft +{ +void evolve_psi(const int nband, + const int nlocal, + const Parallel_Orbitals* pv, + hamilt::Hamilt>* p_hamilt, + std::complex* psi_k, + std::complex* psi_k_laststep, + std::complex* H_laststep, + std::complex* S_laststep, + double* ekb, + int htype, + int propagator, + std::ofstream& ofs_running, + const int print_matrix); + +template +void evolve_psi_tensor(const int nband, + const int nlocal, + const Parallel_Orbitals* pv, + hamilt::Hamilt>* p_hamilt, + ct::Tensor& psi_k, + ct::Tensor& psi_k_laststep, + ct::Tensor& H_laststep, + ct::Tensor& S_laststep, + ct::Tensor& ekb, + int htype, + int propagator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack); +} // namespace module_tddft + +#endif \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp b/source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp new file mode 100644 index 0000000000..da72911335 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp @@ -0,0 +1,290 @@ +#include "middle_hamilt.h" + +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/module_device/memory_op.h" // memory operations +#include "source_base/scalapack_connector.h" + +#include +#include + +namespace module_tddft +{ +#ifdef __MPI + +void half_Hmatrix(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + std::complex* Htmp, + std::complex* Stmp, + const std::complex* H_laststep, + const std::complex* S_laststep, + std::ofstream& ofs_running, + const int print_matrix) +{ + if (print_matrix) + { + ofs_running << std::setprecision(10); + ofs_running << std::endl; + ofs_running << " H(t+dt) :" << std::endl; + for (int i = 0; i < pv->nrow; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H(t):" << std::endl; + for (int i = 0; i < pv->nrow; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + ofs_running << H_laststep[in + j].real() << "+" << H_laststep[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + std::complex alpha = {0.5, 0.0}; + std::complex beta = {0.5, 0.0}; + ScalapackConnector::geadd('N', nlocal, nlocal, alpha, H_laststep, 1, 1, pv->desc, beta, Htmp, 1, 1, pv->desc); + ScalapackConnector::geadd('N', nlocal, nlocal, alpha, S_laststep, 1, 1, pv->desc, beta, Stmp, 1, 1, pv->desc); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " H (t+dt/2) :" << std::endl; + for (int i = 0; i < pv->nrow; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } +} + +void half_Hmatrix_tensor(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + ct::Tensor& Htmp, + ct::Tensor& Stmp, + const ct::Tensor& H_laststep, + const ct::Tensor& S_laststep, + std::ofstream& ofs_running, + const int print_matrix) +{ + if (print_matrix) + { + ofs_running << std::setprecision(10); + ofs_running << std::endl; + ofs_running << " H(t+dt) :" << std::endl; + for (int i = 0; i < pv->nrow; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + ofs_running << Htmp.data>()[in + j].real() << "+" + << Htmp.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H(t):" << std::endl; + for (int i = 0; i < pv->nrow; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + ofs_running << H_laststep.data>()[in + j].real() << "+" + << H_laststep.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + std::complex alpha = {0.5, 0.0}; + std::complex beta = {0.5, 0.0}; + + // Perform the operation Htmp = alpha * H_laststep + beta * Htmp + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + H_laststep.data>(), + 1, + 1, + pv->desc, + beta, + Htmp.data>(), + 1, + 1, + pv->desc); + + // Perform the operation Stmp = alpha * S_laststep + beta * Stmp + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + S_laststep.data>(), + 1, + 1, + pv->desc, + beta, + Stmp.data>(), + 1, + 1, + pv->desc); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " H (t+dt/2) :" << std::endl; + for (int i = 0; i < pv->nrow; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + ofs_running << Htmp.data>()[in + j].real() << "+" + << Htmp.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } +} + +template +void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + ct::Tensor& Htmp, + ct::Tensor& Stmp, + const ct::Tensor& H_laststep, + const ct::Tensor& S_laststep, + std::ofstream& ofs_running, + const int print_matrix) +{ + // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice + ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; + // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU + using ct_Device = typename ct::PsiToContainer::type; + + if (print_matrix) + { + ct::Tensor Htmp_cpu = Htmp.to_device(); + ct::Tensor H_laststep_cpu = H_laststep.to_device(); + + ofs_running << std::setprecision(10); + ofs_running << std::endl; + ofs_running << " H(t+dt) :" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Htmp_cpu.data>()[in + j].real() << "+" + << Htmp_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H(t):" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << H_laststep_cpu.data>()[in + j].real() << "+" + << H_laststep_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + std::complex one_half = {0.5, 0.0}; + + // Perform the operation Htmp = one_half * H_laststep + one_half * Htmp + // Scale Htmp by one_half + ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, + &one_half, + Htmp.data>(), + 1); + // Htmp = one_half * H_laststep + Htmp + ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, + &one_half, + H_laststep.data>(), + 1, + Htmp.data>(), + 1); + + // Perform the operation Stmp = one_half * S_laststep + one_half * Stmp + // Scale Stmp by one_half + ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, + &one_half, + Stmp.data>(), + 1); + // Stmp = one_half * S_laststep + Stmp + ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, + &one_half, + S_laststep.data>(), + 1, + Stmp.data>(), + 1); + + if (print_matrix) + { + ct::Tensor Htmp_cpu = Htmp.to_device(); + + ofs_running << std::endl; + ofs_running << " H (t+dt/2) :" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Htmp_cpu.data>()[in + j].real() << "+" + << Htmp_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } +} + +// Explicit instantiation of template functions +template void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + ct::Tensor& Htmp, + ct::Tensor& Stmp, + const ct::Tensor& H_laststep, + const ct::Tensor& S_laststep, + std::ofstream& ofs_running, + const int print_matrix); +#if ((defined __CUDA) /* || (defined __ROCM) */) +template void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + ct::Tensor& Htmp, + ct::Tensor& Stmp, + const ct::Tensor& H_laststep, + const ct::Tensor& S_laststep, + std::ofstream& ofs_running, + const int print_matrix); +#endif // __CUDA +#endif // __MPI +} // namespace module_tddft \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/middle_hamilt.h b/source/source_hamilt_lcao/module_tddft/middle_hamilt.h new file mode 100644 index 0000000000..6e5cb45d78 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/middle_hamilt.h @@ -0,0 +1,62 @@ +/** + * @file middle_hamilt.h + * @brief compute H(t+dt/2) + * This file originally belonged to file LCAO_evolve.cpp + */ +#ifndef MIDDLE_HAMILT_H +#define MIDDLE_HAMILT_H + +#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor +#include "source_basis/module_ao/parallel_orbitals.h" + +#include + +namespace module_tddft +{ +#ifdef __MPI +/** + * @brief compute H(t+dt/2) + * + * @param[in] pv information of parallel + * @param[in] nband number of bands + * @param[in] nlocal number of orbitals + * @param[in] Htmp H(t+dt) + * @param[in] H_laststep H(t) + * @param[in] print_matirx print internal matrix or not + * @param[out] Htmp H(t+dt/2) + */ +void half_Hmatrix(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + std::complex* Htmp, + std::complex* Stmp, + const std::complex* H_laststep, + const std::complex* S_laststep, + std::ofstream& ofs_running, + const int print_matrix); + +void half_Hmatrix_tensor(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + ct::Tensor& Htmp, + ct::Tensor& Stmp, + const ct::Tensor& H_laststep, + const ct::Tensor& S_laststep, + std::ofstream& ofs_running, + const int print_matrix); + +template +void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + ct::Tensor& Htmp, + ct::Tensor& Stmp, + const ct::Tensor& H_laststep, + const ct::Tensor& S_laststep, + std::ofstream& ofs_running, + const int print_matrix); + +#endif // __MPI +} // namespace module_tddft + +#endif diff --git a/source/source_hamilt_lcao/module_tddft/norm_psi.cpp b/source/source_hamilt_lcao/module_tddft/norm_psi.cpp new file mode 100644 index 0000000000..913554c815 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/norm_psi.cpp @@ -0,0 +1,671 @@ +#include "norm_psi.h" + +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/scalapack_connector.h" + +#include +#include + +namespace module_tddft +{ +#ifdef __MPI + +inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) +{ + int iblock, gIndex; + iblock = localindex / nblk; + gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; + return gIndex; +} + +void norm_psi(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const std::complex* Stmp, + std::complex* psi_k, + std::ofstream& ofs_running, + const int print_matrix) +{ + assert(pv->nloc_wfc > 0 && pv->nloc > 0); + + std::complex* tmp1 = new std::complex[pv->nloc_wfc]; + ModuleBase::GlobalFunc::ZEROS(tmp1, pv->nloc_wfc); + + std::complex* Cij = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(Cij, pv->nloc); + + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nlocal, + 1.0, + Stmp, + 1, + 1, + pv->desc, + psi_k, + 1, + 1, + pv->desc_wfc, + 0.0, + tmp1, + 1, + 1, + pv->desc_wfc); + + ScalapackConnector::gemm('C', + 'N', + nband, + nband, + nlocal, + 1.0, + psi_k, + 1, + 1, + pv->desc_wfc, + tmp1, + 1, + 1, + pv->desc_wfc, + 0.0, + Cij, + 1, + 1, + pv->desc_Eij); + + if (print_matrix) + { + ofs_running << "original Cij :" << std::endl; + for (int i = 0; i < pv->ncol; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->nrow; j++) + { + double aa = Cij[in + j].real(); + double bb = Cij[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + int naroc[2] = {0, 0}; // maximum number of row or column + + for (int iprow = 0; iprow < pv->dim0; ++iprow) + { + for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) + { + if (iprow == pv->coord[0] && ipcol == pv->coord[1]) + { + naroc[0] = pv->nrow; + naroc[1] = pv->ncol; + for (int j = 0; j < naroc[1]; ++j) + { + int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); + if (igcol >= nband) + { + continue; + } + for (int i = 0; i < naroc[0]; ++i) + { + int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); + if (igrow >= nband) + { + continue; + } + if (igcol == igrow) + { + Cij[j * naroc[0] + i] = {1.0 / sqrt(Cij[j * naroc[0] + i].real()), 0.0}; + } + else + { + Cij[j * naroc[0] + i] = {0.0, 0.0}; + } + } + } + } + } // loop ipcol + } // loop iprow + + BlasConnector::copy(pv->nloc_wfc, psi_k, 1, tmp1, 1); + + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nband, + 1.0, + tmp1, + 1, + 1, + pv->desc_wfc, + Cij, + 1, + 1, + pv->desc_Eij, + 0.0, + psi_k, + 1, + 1, + pv->desc_wfc); + + if (print_matrix) + { + ofs_running << " Cij:" << std::endl; + for (int i = 0; i < pv->ncol; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->nrow; j++) + { + ofs_running << Cij[in + j].real() << "+" << Cij[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " psi_k:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = psi_k[in + j].real(); + double bb = psi_k[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " psi_k before normalization:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = tmp1[in + j].real(); + double bb = tmp1[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + } + + delete[] tmp1; + delete[] Cij; +} + +void norm_psi_tensor(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& Stmp, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix) +{ + assert(pv->nloc_wfc > 0 && pv->nloc > 0); + + // Create Tensor objects for temporary data + ct::Tensor tmp1(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc_wfc})); + tmp1.zero(); + + ct::Tensor Cij(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc})); + Cij.zero(); + + // Perform matrix multiplication: tmp1 = Stmp * psi_k + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nlocal, + 1.0, + Stmp.data>(), + 1, + 1, + pv->desc, + psi_k.data>(), + 1, + 1, + pv->desc_wfc, + 0.0, + tmp1.data>(), + 1, + 1, + pv->desc_wfc); + + // Perform matrix multiplication: Cij = psi_k^dagger * tmp1 + ScalapackConnector::gemm('C', + 'N', + nband, + nband, + nlocal, + 1.0, + psi_k.data>(), + 1, + 1, + pv->desc_wfc, + tmp1.data>(), + 1, + 1, + pv->desc_wfc, + 0.0, + Cij.data>(), + 1, + 1, + pv->desc_Eij); + + if (print_matrix) + { + ofs_running << "original Cij :" << std::endl; + for (int i = 0; i < pv->ncol; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->nrow; j++) + { + double aa = Cij.data>()[in + j].real(); + double bb = Cij.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + int naroc[2] = {0, 0}; // maximum number of row or column + + for (int iprow = 0; iprow < pv->dim0; ++iprow) + { + for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) + { + if (iprow == pv->coord[0] && ipcol == pv->coord[1]) + { + naroc[0] = pv->nrow; + naroc[1] = pv->ncol; + for (int j = 0; j < naroc[1]; ++j) + { + int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); + if (igcol >= nband) + { + continue; + } + for (int i = 0; i < naroc[0]; ++i) + { + int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); + if (igrow >= nband) + { + continue; + } + if (igcol == igrow) + { + Cij.data>()[j * naroc[0] + i] + = {1.0 / sqrt(Cij.data>()[j * naroc[0] + i].real()), 0.0}; + } + else + { + Cij.data>()[j * naroc[0] + i] = {0.0, 0.0}; + } + } + } + } + } // loop ipcol + } // loop iprow + + // Copy psi_k to tmp1 (using deep copy) + // tmp1.CopyFrom(psi_k); // Does not work because this will cause tmp1 and psi_k to share the same data + tmp1 = psi_k; // operator= overload for Tensor class + + // Perform matrix multiplication: psi_k = tmp1 * Cij + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nband, + 1.0, + tmp1.data>(), + 1, + 1, + pv->desc_wfc, + Cij.data>(), + 1, + 1, + pv->desc_Eij, + 0.0, + psi_k.data>(), + 1, + 1, + pv->desc_wfc); + + if (print_matrix) + { + ofs_running << " Cij:" << std::endl; + for (int i = 0; i < pv->ncol; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->nrow; j++) + { + ofs_running << Cij.data>()[in + j].real() << "+" + << Cij.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " psi_k:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = psi_k.data>()[in + j].real(); + double bb = psi_k.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " psi_k before normalization:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = tmp1.data>()[in + j].real(); + double bb = tmp1.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + } +} + +template +void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& Stmp, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix) +{ + // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice + ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; + // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU + using ct_Device = typename ct::PsiToContainer::type; + + // Create Tensor objects for temporary data + ct::Tensor tmp1( + ct::DataType::DT_COMPLEX_DOUBLE, + ct_device_type, + ct::TensorShape({nlocal * nband})); // tmp1 shape: nlocal * nband (under 2D block cyclic is pv->nloc_wfc) + tmp1.zero(); + + ct::Tensor Cij(ct::DataType::DT_COMPLEX_DOUBLE, + ct_device_type, + ct::TensorShape({nlocal * nlocal})); // Cij shape: nlocal * nlocal + Cij.zero(); + + std::complex alpha = {1.0, 0.0}; + std::complex beta = {0.0, 0.0}; + + // Perform matrix multiplication: tmp1 = Stmp * psi_k + ct::kernels::blas_gemm, ct_Device>()('N', + 'N', + nlocal, + nband, + nlocal, + &alpha, + Stmp.data>(), + nlocal, // Leading dimension of Stmp + psi_k.data>(), + nlocal, // Leading dimension of psi_k + &beta, + tmp1.data>(), + nlocal); // Leading dimension of tmp1 + + // Perform matrix multiplication: Cij = psi_k^dagger * tmp1 + ct::kernels::blas_gemm, ct_Device>()('C', + 'N', + nband, + nband, + nlocal, + &alpha, + psi_k.data>(), + nlocal, // Leading dimension of psi_k + tmp1.data>(), + nlocal, // Leading dimension of tmp1 + &beta, + Cij.data>(), + nlocal); // Leading dimension of Cij + + if (print_matrix) + { + ct::Tensor Cij_print_cpu = Cij.to_device(); + + ofs_running << "original Cij :" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + double aa = Cij_print_cpu.data>()[in + j].real(); + double bb = Cij_print_cpu.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + // Normalize Cij: set diagonal elements to 1/sqrt(Cij[i][i]), off-diagonal elements to 0 + if (ct_device_type == ct::DeviceType::GpuDevice) + { + // Step 1: Copy Cij from GPU to CPU + ct::Tensor Cij_cpu = Cij.to_device(); + + // Step 2: Perform normalization on CPU + for (int i = 0; i < nband; ++i) + { + const int in = i * nlocal; + for (int j = 0; j < nband; ++j) + { + if (i == j) + { + Cij_cpu.data>()[in + j] + = {1.0 / sqrt(Cij_cpu.data>()[in + j].real()), 0.0}; + } + else + { + Cij_cpu.data>()[in + j] = {0.0, 0.0}; + } + } + } + + // Step 3: Copy normalized Cij back to GPU + Cij = Cij_cpu.to_device(); + } + else + { + // CPU implementation + for (int i = 0; i < nband; ++i) + { + const int in = i * nlocal; + for (int j = 0; j < nband; ++j) + { + if (i == j) + { + Cij.data>()[in + j] + = {1.0 / sqrt(Cij.data>()[in + j].real()), 0.0}; + } + else + { + Cij.data>()[in + j] = {0.0, 0.0}; + } + } + } + } + + // Copy psi_k to tmp1 (using deep copy) + // tmp1.CopyFrom(psi_k); // Does not work because this will cause tmp1 and psi_k to share the same data + tmp1 = psi_k; // operator= overload for Tensor class + + // Perform matrix multiplication: psi_k = tmp1 * Cij + ct::kernels::blas_gemm, ct_Device>()('N', + 'N', + nlocal, + nband, + nband, + &alpha, + tmp1.data>(), + nlocal, // Leading dimension of tmp1 + Cij.data>(), + nlocal, // Leading dimension of Cij + &beta, + psi_k.data>(), + nlocal); // Leading dimension of psi_k + + if (print_matrix) + { + ct::Tensor Cij_print_cpu = Cij.to_device(); + ct::Tensor psi_k_cpu = psi_k.to_device(); + ct::Tensor tmp1_cpu = tmp1.to_device(); + + ofs_running << " Cij:" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Cij_print_cpu.data>()[in + j].real() << "+" + << Cij_print_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " psi_k:" << std::endl; + for (int i = 0; i < nband; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + double aa = psi_k_cpu.data>()[in + j].real(); + double bb = psi_k_cpu.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " psi_k before normalization:" << std::endl; + for (int i = 0; i < nband; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + double aa = tmp1_cpu.data>()[in + j].real(); + double bb = tmp1_cpu.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + } +} + +// Explicit instantiation of template functions +template void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& Stmp, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); +#if ((defined __CUDA) /* || (defined __ROCM) */) +template void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& Stmp, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); +#endif // __CUDA +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/norm_psi.h b/source/source_hamilt_lcao/module_tddft/norm_psi.h new file mode 100644 index 0000000000..1f3cc8ec2b --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/norm_psi.h @@ -0,0 +1,56 @@ +/** + * @file norm_psi.h + * @brief normalize the wave function + * This file originally belonged to file LCAO_evolve.cpp + */ +#ifndef NORM_PSI_H +#define NORM_PSI_H + +#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor +#include "source_basis/module_ao/parallel_orbitals.h" + +#include + +namespace module_tddft +{ +#ifdef __MPI +/** + * @brief normalize the wave function + * + * @param[in] pv information of parallel + * @param[in] nband number of bands + * @param[in] nlocal number of orbitals + * @param[in] Stmp overlap matrix + * @param[in] psi_k psi of this step + * @param[in] print_matirx print internal matrix or not + * @param[out] psi_k psi of this step after normalization + */ +void norm_psi(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const std::complex* Stmp, + std::complex* psi_k, + std::ofstream& ofs_running, + const int print_matrix); + +void norm_psi_tensor(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& Stmp, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); + +template +void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& Stmp, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); + +#endif // __MPI +} // namespace module_tddft + +#endif diff --git a/source/source_hamilt_lcao/module_tddft/propagator.cpp b/source/source_hamilt_lcao/module_tddft/propagator.cpp new file mode 100644 index 0000000000..74f1c3088f --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/propagator.cpp @@ -0,0 +1,107 @@ +#include "propagator.h" + +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/module_container/ATen/kernels/lapack.h" +#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) +#include "source_base/module_device/memory_op.h" // memory operations +#include "source_base/scalapack_connector.h" +#include "module_parameter/parameter.h" + +#include +#include + +namespace module_tddft +{ +Propagator::~Propagator() +{ +} +#ifdef __MPI +void Propagator::compute_propagator(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + const std::complex* H_laststep, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix) const +{ + int tag; + switch (ptype) + { + case 0: + compute_propagator_cn2(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); + break; + + case 1: + tag = 1; + compute_propagator_taylor(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix, tag); + break; + + case 2: + compute_propagator_etrs(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); + break; + + default: + ModuleBase::WARNING_QUIT("Propagator::compute_propagator", "Method of RT-TDDFT propagator is wrong!"); + break; + } +} + +template +void Propagator::compute_propagator_tensor(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + const ct::Tensor& H_laststep, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack) const +{ + int tag; + switch (ptype) + { + case 0: + if (!use_lapack) + { + compute_propagator_cn2_tensor(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); + } + else + { + int myid = 0; + int root_proc = 0; + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + if (myid == root_proc) + { + compute_propagator_cn2_tensor_lapack(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); + } + } + break; + + default: + ModuleBase::WARNING_QUIT("Propagator::compute_propagator_tensor", + "The Tensor-based RT-TDDFT propagator currently supports Crank–Nicolson method only!"); + break; + } +} + +// Explicit instantiation of template functions +template void Propagator::compute_propagator_tensor(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + const ct::Tensor& H_laststep, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack) const; +#if ((defined __CUDA) /* || (defined __ROCM) */) +template void Propagator::compute_propagator_tensor(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + const ct::Tensor& H_laststep, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack) const; +#endif // __CUDA +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/propagator.h b/source/source_hamilt_lcao/module_tddft/propagator.h new file mode 100644 index 0000000000..0b13f5453f --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/propagator.h @@ -0,0 +1,222 @@ +/** + * @file propagator.h + * @brief compute propagtor to evolve the wave function + * This file originally belonged to file LCAO_evolve.cpp + */ +#ifndef PROPAGATOR_H +#define PROPAGATOR_H + +#include "source_base/constants.h" +#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor +#include "source_basis/module_ao/parallel_orbitals.h" + +#include + +namespace module_tddft +{ +//--------------------------------- Utility function ---------------------------------// +#ifdef __MPI +inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) +{ + int iblock, gIndex; + iblock = localindex / nblk; + gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; + return gIndex; +} +#endif // __MPI + +// Auxiliary function: process non-complex types, return value 1.0 +template +inline T init_value(typename std::enable_if>::value + && !std::is_same>::value>::type* = nullptr) +{ + return T(1.0); +} + +// Auxiliary function: process complex types, return value 1.0 + 0.0i +template +inline T init_value(typename std::enable_if>::value + || std::is_same>::value>::type* = nullptr) +{ + return T(1.0, 0.0); +} + +// Create an identity matrix of size nƗn +template +ct::Tensor create_identity_matrix(const int n, ct::DeviceType device = ct::DeviceType::CpuDevice) +{ + // Choose the data type of the Tensor + ct::DataType data_type; + if (std::is_same::value) + { + data_type = ct::DataType::DT_FLOAT; + } + else if (std::is_same::value) + { + data_type = ct::DataType::DT_DOUBLE; + } + else if (std::is_same>::value) + { + data_type = ct::DataType::DT_COMPLEX; + } + else if (std::is_same>::value) + { + data_type = ct::DataType::DT_COMPLEX_DOUBLE; + } + else + { + static_assert(std::is_same::value || std::is_same::value + || std::is_same>::value + || std::is_same>::value, + "Unsupported data type!"); + } + + ct::Tensor tensor(data_type, device, ct::TensorShape({n, n})); + tensor.zero(); + + // Set the diagonal elements to 1 + if (device == ct::DeviceType::CpuDevice) + { + // For CPU, we can directly access the data + T* data_ptr = tensor.data(); + for (int i = 0; i < n; ++i) + { + data_ptr[i * n + i] = init_value(); + } + } +#if ((defined __CUDA)) + else if (device == ct::DeviceType::GpuDevice) + { + // For GPU, we need to use a kernel to set the diagonal elements + T* data_ptr = tensor.data(); + for (int i = 0; i < n; ++i) + { + T value = init_value(); + ct::kernels::set_memory()(data_ptr + i * n + i, value, 1); + } + } +#endif + + return tensor; +} +//--------------------------------- Utility function ---------------------------------// + +class Propagator +{ + public: + Propagator(const int ptype, const Parallel_Orbitals* pv, const double& dt) + { + this->ptype = ptype; + this->ParaV = pv; + this->dt = dt / ModuleBase::AU_to_FS; + } + ~Propagator(); + +#ifdef __MPI + /** + * @brief compute propagator + * + * @param[in] nlocal number of orbitals + * @param[in] Stmp overlap matrix + * @param[in] Htmp H(t+dt/2) or H(t+dt) + * @param[in] H_laststep H(t) + * @param[in] print_matirx print internal matrix or not + * @param[out] U_operator operator of propagator + */ + void compute_propagator(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + const std::complex* H_laststep, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; + + template + void compute_propagator_tensor(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + const ct::Tensor& H_laststep, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix, + const bool use_lapack) const; +#endif // __MPI + + private: + int ptype; // type of propagator + const Parallel_Orbitals* ParaV; + double dt; // time step + +#ifdef __MPI + + /** + * @brief compute propagator of method Crank-Nicolson + * + * @param[in] nlocal number of orbitals + * @param[in] Stmp overlap matrix + * @param[in] Htmp H(t+dt/2) or H(t+dt) + * @param[in] print_matirx print internal matrix or not + * @param[out] U_operator operator of propagator + */ + void compute_propagator_cn2(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; + + void compute_propagator_cn2_tensor(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; + + template + void compute_propagator_cn2_tensor_lapack(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; + + /** + * @brief compute propagator of method 4th Taylor + * + * @param[in] nlocal number of orbitals + * @param[in] Stmp overlap matrix + * @param[in] Htmp H(t+dt/2) or H(t+dt) + * @param[in] print_matirx print internal matrix or not + * @param[in] tag a parametre different for 4th Taylor and ETRS + * @param[out] U_operator operator of propagator + */ + void compute_propagator_taylor(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix, + const int tag) const; + + /** + * @brief compute propagator of method ETRS + * + * @param[in] nlocal number of orbitals + * @param[in] Stmp overlap matrix + * @param[in] Htmp H(t+dt/2) or H(t+dt) + * @param[in] H_laststep H(t) + * @param[in] print_matirx print internal matrix or not + * @param[out] U_operator operator of propagator + */ + void compute_propagator_etrs(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + const std::complex* H_laststep, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; +#endif // __MPI +}; +} // namespace module_tddft + +#endif diff --git a/source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp b/source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp new file mode 100644 index 0000000000..8ccbd2a5a0 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp @@ -0,0 +1,734 @@ +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/module_container/ATen/kernels/lapack.h" +#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) +#include "source_base/module_device/memory_op.h" // memory operations +#include "source_base/scalapack_connector.h" +#include "module_parameter/parameter.h" +#include "propagator.h" + +#include +#include + +namespace module_tddft +{ +#ifdef __MPI +void Propagator::compute_propagator_cn2(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix) const +{ + assert(this->ParaV->nloc > 0); + + // (1) copy Htmp to Numerator & Denominator + std::complex* Numerator = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(Numerator, this->ParaV->nloc); + BlasConnector::copy(this->ParaV->nloc, Htmp, 1, Numerator, 1); + + std::complex* Denominator = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(Denominator, this->ParaV->nloc); + BlasConnector::copy(this->ParaV->nloc, Htmp, 1, Denominator, 1); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " S matrix :" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Stmp[in + j].real() << "+" << Stmp[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H matrix :" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Numerator[in + j].real() << "+" << Numerator[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (2) compute Numerator & Denominator by GEADD + // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt + // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt + std::complex alpha = {1.0, 0.0}; + std::complex beta1 = {0.0, -0.25 * this->dt}; + std::complex beta2 = {0.0, 0.25 * this->dt}; + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + Stmp, + 1, + 1, + this->ParaV->desc, + beta1, + Numerator, + 1, + 1, + this->ParaV->desc); + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + Stmp, + 1, + 1, + this->ParaV->desc, + beta2, + Denominator, + 1, + 1, + this->ParaV->desc); + + if (print_matrix) + { + ofs_running << " beta=" << beta1 << std::endl; + ofs_running << " fenmu:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Denominator[in + j].real() << "+" << Denominator[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (3) Next, invert Denominator + // What is the size of ipiv exactly? Need to check ScaLAPACK documentation! + // But anyway, not this->ParaV->nloc + int* ipiv = new int[this->ParaV->nrow + this->ParaV->nb]; + ModuleBase::GlobalFunc::ZEROS(ipiv, this->ParaV->nrow + this->ParaV->nb); + int info = 0; + // (3.1) compute ipiv + ScalapackConnector::getrf(nlocal, nlocal, Denominator, 1, 1, this->ParaV->desc, ipiv, &info); + + // Print ipiv + if (print_matrix) + { + ofs_running << " this->ParaV->nloc = " << this->ParaV->nloc << std::endl; + ofs_running << " this->ParaV->nrow = " << this->ParaV->nrow << std::endl; + ofs_running << " this->ParaV->ncol = " << this->ParaV->ncol << std::endl; + ofs_running << " this->ParaV->nb = " << this->ParaV->nb << std::endl; + ofs_running << " this->ParaV->get_block_size() = " << this->ParaV->get_block_size() << std::endl; + ofs_running << " nlocal = " << nlocal << std::endl; + ofs_running << " ipiv:" << std::endl; + for (int i = 0; i < this->ParaV->nloc; i++) + { + ofs_running << ipiv[i] << " "; + } + ofs_running << std::endl; + } + + int lwork = -1; + int liwotk = -1; + std::vector> work(1, 0); + std::vector iwork(1, 0); + // (3.2) compute work + ScalapackConnector::getri(nlocal, + Denominator, + 1, + 1, + this->ParaV->desc, + ipiv, + work.data(), + &lwork, + iwork.data(), + &liwotk, + &info); + lwork = work[0].real(); + work.resize(lwork, 0); + liwotk = iwork[0]; + iwork.resize(liwotk, 0); + // (3.3) compute inverse matrix of Denominator + ScalapackConnector::getri(nlocal, + Denominator, + 1, + 1, + this->ParaV->desc, + ipiv, + work.data(), + &lwork, + iwork.data(), + &liwotk, + &info); + assert(0 == info); + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + // (4) U_operator = Denominator * Numerator; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + 1.0, + Denominator, + 1, + 1, + this->ParaV->desc, + Numerator, + 1, + 1, + this->ParaV->desc, + 0.0, + U_operator, + 1, + 1, + this->ParaV->desc); + + if (print_matrix) + { + ofs_running << " fenmu^-1:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Denominator[in + j].real() << "+" << Denominator[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " fenzi:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Numerator[in + j].real() << "+" << Numerator[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " U operator:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + double aa = U_operator[in + j].real(); + double bb = U_operator[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + } + + delete[] Numerator; + delete[] Denominator; + delete[] ipiv; +} + +void Propagator::compute_propagator_cn2_tensor(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix) const +{ + // (1) copy Htmp to Numerator & Denominator + ct::Tensor Numerator(ct::DataType::DT_COMPLEX_DOUBLE, + ct::DeviceType::CpuDevice, + ct::TensorShape({this->ParaV->nloc})); + Numerator.zero(); + BlasConnector::copy(this->ParaV->nloc, + Htmp.data>(), + 1, + Numerator.data>(), + 1); + + ct::Tensor Denominator(ct::DataType::DT_COMPLEX_DOUBLE, + ct::DeviceType::CpuDevice, + ct::TensorShape({this->ParaV->nloc})); + Denominator.zero(); + BlasConnector::copy(this->ParaV->nloc, + Htmp.data>(), + 1, + Denominator.data>(), + 1); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " S matrix :" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Stmp.data>()[in + j].real() << "+" + << Stmp.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H matrix :" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Numerator.data>()[in + j].real() << "+" + << Numerator.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (2) compute Numerator & Denominator by GEADD + // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt + // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt + std::complex alpha = {1.0, 0.0}; + std::complex beta1 = {0.0, -0.25 * this->dt}; + std::complex beta2 = {0.0, 0.25 * this->dt}; + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + Stmp.data>(), + 1, + 1, + this->ParaV->desc, + beta1, + Numerator.data>(), + 1, + 1, + this->ParaV->desc); + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + Stmp.data>(), + 1, + 1, + this->ParaV->desc, + beta2, + Denominator.data>(), + 1, + 1, + this->ParaV->desc); + + if (print_matrix) + { + ofs_running << " beta=" << beta1 << std::endl; + ofs_running << " fenmu:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Denominator.data>()[in + j].real() << "+" + << Denominator.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (3) Next, invert Denominator + ct::Tensor ipiv(ct::DataType::DT_INT, + ct::DeviceType::CpuDevice, + ct::TensorShape({this->ParaV->nrow + this->ParaV->nb})); + ipiv.zero(); + int info = 0; + // (3.1) compute ipiv + ScalapackConnector::getrf(nlocal, + nlocal, + Denominator.data>(), + 1, + 1, + this->ParaV->desc, + ipiv.data(), + &info); + + // Print ipiv + if (print_matrix) + { + ofs_running << " this->ParaV->nloc = " << this->ParaV->nloc << std::endl; + ofs_running << " this->ParaV->nrow = " << this->ParaV->nrow << std::endl; + ofs_running << " this->ParaV->ncol = " << this->ParaV->ncol << std::endl; + ofs_running << " this->ParaV->nb = " << this->ParaV->nb << std::endl; + ofs_running << " this->ParaV->get_block_size() = " << this->ParaV->get_block_size() << std::endl; + ofs_running << " nlocal = " << nlocal << std::endl; + ofs_running << " ipiv:" << std::endl; + for (int i = 0; i < this->ParaV->nloc; i++) + { + ofs_running << ipiv.data()[i] << " "; + } + ofs_running << std::endl; + } + + int lwork = -1; + int liwotk = -1; + ct::Tensor work(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({1})); + ct::Tensor iwork(ct::DataType::DT_INT, ct::DeviceType::CpuDevice, ct::TensorShape({1})); + // (3.2) compute work + ScalapackConnector::getri(nlocal, + Denominator.data>(), + 1, + 1, + this->ParaV->desc, + ipiv.data(), + work.data>(), + &lwork, + iwork.data(), + &liwotk, + &info); + lwork = work.data>()[0].real(); + work.resize(ct::TensorShape({lwork})); + liwotk = iwork.data()[0]; + iwork.resize(ct::TensorShape({liwotk})); + // (3.3) compute inverse matrix of Denominator + ScalapackConnector::getri(nlocal, + Denominator.data>(), + 1, + 1, + this->ParaV->desc, + ipiv.data(), + work.data>(), + &lwork, + iwork.data(), + &liwotk, + &info); + assert(0 == info); + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + // (4) U_operator = Denominator * Numerator; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + 1.0, + Denominator.data>(), + 1, + 1, + this->ParaV->desc, + Numerator.data>(), + 1, + 1, + this->ParaV->desc, + 0.0, + U_operator.data>(), + 1, + 1, + this->ParaV->desc); + + if (print_matrix) + { + ofs_running << " fenmu^-1:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Denominator.data>()[in + j].real() << "+" + << Denominator.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " fenzi:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Numerator.data>()[in + j].real() << "+" + << Numerator.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " U operator:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + double aa = U_operator.data>()[in + j].real(); + double bb = U_operator.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + } +} + +template +void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix) const +{ + // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice + ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; + // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU + using ct_Device = typename ct::PsiToContainer::type; + + // (1) copy Htmp to Numerator & Denominator + ct::Tensor Numerator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({nlocal * nlocal})); + Numerator.zero(); + base_device::memory::synchronize_memory_op, Device, Device>()( + Numerator.data>(), + Htmp.data>(), + nlocal * nlocal); + + ct::Tensor Denominator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({nlocal * nlocal})); + Denominator.zero(); + base_device::memory::synchronize_memory_op, Device, Device>()( + Denominator.data>(), + Htmp.data>(), + nlocal * nlocal); + + if (print_matrix) + { + ct::Tensor Stmp_cpu = Stmp.to_device(); + ct::Tensor Numerator_cpu = Numerator.to_device(); + + ofs_running << std::endl; + ofs_running << " S matrix :" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Stmp_cpu.data>()[in + j].real() << "+" + << Stmp_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H matrix :" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Numerator_cpu.data>()[in + j].real() << "+" + << Numerator_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (2) compute Numerator & Denominator by GEADD + // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt + // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt + std::complex one = {1.0, 0.0}; + std::complex beta1 = {0.0, -0.25 * this->dt}; + std::complex beta2 = {0.0, 0.25 * this->dt}; + + // Numerator = -i*para * Htmp + ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, + &beta1, + Numerator.data>(), + 1); + // Numerator = Stmp + (-i*para * Htmp) + ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, + &one, + Stmp.data>(), + 1, + Numerator.data>(), + 1); + // Denominator = i*para * Htmp + ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, + &beta2, + Denominator.data>(), + 1); + // Denominator = Stmp + (i*para * Htmp) + ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, + &one, + Stmp.data>(), + 1, + Denominator.data>(), + 1); + + if (print_matrix) + { + ct::Tensor Denominator_cpu = Denominator.to_device(); + + ofs_running << " beta=" << beta1 << std::endl; + ofs_running << " fenmu:" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Denominator_cpu.data>()[in + j].real() << "+" + << Denominator_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (3) Next, invert Denominator + ct::Tensor ipiv(ct::DataType::DT_INT, ct_device_type, ct::TensorShape({nlocal})); + ipiv.zero(); + // (3.1) compute ipiv + ct::kernels::lapack_getrf, ct_Device>()(nlocal, + nlocal, + Denominator.data>(), + nlocal, + ipiv.data()); + + // Print ipiv + if (print_matrix) + { + ct::Tensor ipiv_cpu = ipiv.to_device(); + + ofs_running << " ipiv:" << std::endl; + for (int i = 0; i < nlocal; i++) + { + ofs_running << ipiv_cpu.data()[i] << " "; + } + ofs_running << std::endl; + } + + // (3.2) compute inverse matrix of Denominator + ct::Tensor Denominator_inv = create_identity_matrix>(nlocal, ct_device_type); + ct::kernels::lapack_getrs, ct_Device>()('N', + nlocal, + nlocal, + Denominator.data>(), + nlocal, + ipiv.data(), + Denominator_inv.data>(), + nlocal); + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + // (4) U_operator = Denominator_inv * Numerator; + std::complex one_gemm = {1.0, 0.0}; + std::complex zero_gemm = {0.0, 0.0}; + ct::kernels::blas_gemm, ct_Device>()('N', + 'N', + nlocal, + nlocal, + nlocal, + &one_gemm, + Denominator_inv.data>(), + nlocal, + Numerator.data>(), + nlocal, + &zero_gemm, + U_operator.data>(), + nlocal); + + if (print_matrix) + { + ct::Tensor Denominator_inv_cpu = Denominator_inv.to_device(); + ct::Tensor Numerator_cpu = Numerator.to_device(); + ct::Tensor U_operator_cpu = U_operator.to_device(); + + ofs_running << " fenmu^-1:" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Denominator_inv_cpu.data>()[in + j].real() << "+" + << Denominator_inv_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " fenzi:" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + ofs_running << Numerator_cpu.data>()[in + j].real() << "+" + << Numerator_cpu.data>()[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " U operator:" << std::endl; + for (int i = 0; i < nlocal; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + double aa = U_operator_cpu.data>()[in + j].real(); + double bb = U_operator_cpu.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + } +} + +// Explicit instantiation of template functions +template void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; +#if ((defined __CUDA) /* || (defined __ROCM) */) +template void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, + const ct::Tensor& Stmp, + const ct::Tensor& Htmp, + ct::Tensor& U_operator, + std::ofstream& ofs_running, + const int print_matrix) const; +#endif // __CUDA +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp b/source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp new file mode 100644 index 0000000000..e3dcec0b0d --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp @@ -0,0 +1,50 @@ +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/module_container/ATen/kernels/lapack.h" +#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) +#include "source_base/module_device/memory_op.h" // memory operations +#include "source_base/scalapack_connector.h" +#include "module_parameter/parameter.h" +#include "propagator.h" + +#include +#include + +namespace module_tddft +{ +#ifdef __MPI +void Propagator::compute_propagator_etrs(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + const std::complex* H_laststep, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix) const +{ + std::vector> U1(this->ParaV->nloc); + std::vector> U2(this->ParaV->nloc); + int tag = 2; + compute_propagator_taylor(nlocal, Stmp, Htmp, U1.data(), ofs_running, print_matrix, tag); + compute_propagator_taylor(nlocal, Stmp, H_laststep, U2.data(), ofs_running, print_matrix, tag); + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + 1.0, + U1.data(), + 1, + 1, + this->ParaV->desc, + U2.data(), + 1, + 1, + this->ParaV->desc, + 0.0, + U_operator, + 1, + 1, + this->ParaV->desc); +} +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp b/source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp new file mode 100644 index 0000000000..ae03c18417 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp @@ -0,0 +1,343 @@ +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/module_container/ATen/kernels/lapack.h" +#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) +#include "source_base/module_device/memory_op.h" // memory operations +#include "source_base/scalapack_connector.h" +#include "module_parameter/parameter.h" +#include "propagator.h" + +#include +#include + +namespace module_tddft +{ +#ifdef __MPI +void Propagator::compute_propagator_taylor(const int nlocal, + const std::complex* Stmp, + const std::complex* Htmp, + std::complex* U_operator, + std::ofstream& ofs_running, + const int print_matrix, + const int tag) const +{ + assert(this->ParaV->nloc > 0); + + ModuleBase::GlobalFunc::ZEROS(U_operator, this->ParaV->nloc); + std::complex* A_matrix = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(A_matrix, this->ParaV->nloc); + std::complex* rank0 = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(rank0, this->ParaV->nloc); + std::complex* rank2 = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(rank2, this->ParaV->nloc); + std::complex* rank3 = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(rank3, this->ParaV->nloc); + std::complex* rank4 = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(rank4, this->ParaV->nloc); + std::complex* tmp1 = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(tmp1, this->ParaV->nloc); + std::complex* tmp2 = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(tmp2, this->ParaV->nloc); + std::complex* Sinv = new std::complex[this->ParaV->nloc]; + ModuleBase::GlobalFunc::ZEROS(Sinv, this->ParaV->nloc); + BlasConnector::copy(this->ParaV->nloc, Stmp, 1, Sinv, 1); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " S matrix :" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Stmp[in + j].real() << "+" << Stmp[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << std::endl; + ofs_running << " H matrix :" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } + + // set rank0 + int info = 0; + int naroc[2] = {0, 0}; // maximum number of row or column + + for (int iprow = 0; iprow < this->ParaV->dim0; ++iprow) + { + for (int ipcol = 0; ipcol < this->ParaV->dim1; ++ipcol) + { + if (iprow == ParaV->coord[0] && ipcol == ParaV->coord[1]) + { + naroc[0] = this->ParaV->nrow; + naroc[1] = this->ParaV->ncol; + for (int j = 0; j < naroc[1]; ++j) + { + int igcol = globalIndex(j, this->ParaV->nb, this->ParaV->dim1, ipcol); + if (igcol >= nlocal) + { + continue; + } + for (int i = 0; i < naroc[0]; ++i) + { + int igrow = globalIndex(i, this->ParaV->nb, this->ParaV->dim0, iprow); + if (igrow >= nlocal) + { + continue; + } + if (igcol == igrow) + { + rank0[j * naroc[0] + i] = {1.0, 0.0}; + } + else + { + rank0[j * naroc[0] + i] = {0.0, 0.0}; + } + } + } + } + } // loop ipcol + } // loop iprow + + std::complex beta = {0.0, -0.5 * this->dt / tag}; // for ETRS tag=2 , for taylor tag=1 + + //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // invert Stmp + int* ipiv = new int[this->ParaV->nloc]; + // (3.1) compute ipiv + ScalapackConnector::getrf(nlocal, nlocal, Sinv, 1, 1, this->ParaV->desc, ipiv, &info); + int lwork = -1; + int liwotk = -1; + std::vector> work(1, 0); + std::vector iwork(1, 0); + // (3.2) compute work + ScalapackConnector::getri(nlocal, + Sinv, + 1, + 1, + this->ParaV->desc, + ipiv, + work.data(), + &lwork, + iwork.data(), + &liwotk, + &info); + lwork = work[0].real(); + work.resize(lwork, 0); + liwotk = iwork[0]; + iwork.resize(liwotk, 0); + ScalapackConnector::getri(nlocal, + Sinv, + 1, + 1, + this->ParaV->desc, + ipiv, + work.data(), + &lwork, + iwork.data(), + &liwotk, + &info); + assert(0 == info); + + // A_matrix = - idt S^-1 H ; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + beta, + Sinv, + 1, + 1, + this->ParaV->desc, + Htmp, + 1, + 1, + this->ParaV->desc, + 0.0, + U_operator, + 1, + 1, + this->ParaV->desc); + + // rank2 = A^2 ; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + 1.0, + U_operator, + 1, + 1, + this->ParaV->desc, + U_operator, + 1, + 1, + this->ParaV->desc, + 0.0, + rank2, + 1, + 1, + this->ParaV->desc); + + // rank3 = A^3 ; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + 1.0, + U_operator, + 1, + 1, + this->ParaV->desc, + rank2, + 1, + 1, + this->ParaV->desc, + 0.0, + rank3, + 1, + 1, + this->ParaV->desc); + + // rank4 = A^4 ; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nlocal, + nlocal, + 1.0, + U_operator, + 1, + 1, + this->ParaV->desc, + rank3, + 1, + 1, + this->ParaV->desc, + 0.0, + rank4, + 1, + 1, + this->ParaV->desc); + + std::complex p1 = {1.0, 0.0}; + std::complex p2 = {1.0 / 2.0, 0.0}; + std::complex p3 = {1.0 / 6.0, 0.0}; + std::complex p4 = {1.0 / 24.0, 0.0}; + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + p1, + rank0, + 1, + 1, + this->ParaV->desc, + p1, + U_operator, + 1, + 1, + this->ParaV->desc); + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + p2, + rank2, + 1, + 1, + this->ParaV->desc, + p1, + U_operator, + 1, + 1, + this->ParaV->desc); + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + p3, + rank3, + 1, + 1, + this->ParaV->desc, + p1, + U_operator, + 1, + 1, + this->ParaV->desc); + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + p4, + rank4, + 1, + 1, + this->ParaV->desc, + p1, + U_operator, + 1, + 1, + this->ParaV->desc); + + if (print_matrix) + { + ofs_running << " A_matrix:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + ofs_running << A_matrix[in + j].real() << "+" << A_matrix[in + j].imag() << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " U operator:" << std::endl; + for (int i = 0; i < this->ParaV->nrow; i++) + { + const int in = i * this->ParaV->ncol; + for (int j = 0; j < this->ParaV->ncol; j++) + { + double aa = U_operator[in + j].real(); + double bb = U_operator[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + } + delete[] A_matrix; + delete[] rank0; + delete[] rank2; + delete[] rank3; + delete[] rank4; + delete[] tmp1; + delete[] tmp2; + delete[] Sinv; + delete[] ipiv; +} +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp b/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp new file mode 100644 index 0000000000..97a71345c8 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp @@ -0,0 +1,247 @@ +#include "snap_psibeta_half_tddft.h" + +#include "source_base/constants.h" +#include "source_base/math_integral.h" +#include "source_base/math_polyint.h" +#include "source_base/timer.h" +#include "source_base/ylm.h" + +namespace module_tddft +{ + +// nlm[0] : +// nlm[1, 2, 3,] : , which a = x, y, z. +void snap_psibeta_half_tddft(const LCAO_Orbitals& orb, + const InfoNonlocal& infoNL_, + std::vector>>& nlm, + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R0, // The projector. + const int& T0, + const ModuleBase::Vector3& A, + const bool& calc_r) +{ + ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); + + // find number of projectors on atom R0 + const int nproj = infoNL_.nproj[T0]; + if (nproj == 0) + { + if (calc_r) + { + nlm.resize(4); + } + else + { + nlm.resize(1); + } + return; + } + + std::vector calproj(nproj); + std::vector rmesh1(nproj); + + if (calc_r) + { + nlm.resize(4); + } + else + { + nlm.resize(1); + } + + // Count number of projectors (l,m) + int natomwfc = 0; + for (int ip = 0; ip < nproj; ip++) + { + //============================ + // Use pseudo-atomic orbitals + //============================ + + const int L0 = infoNL_.Beta[T0].Proj[ip].getL(); // mohan add 2021-05-07 + natomwfc += 2 * L0 + 1; + } + + for (int dim = 0; dim < nlm.size(); dim++) + { + nlm[dim].resize(natomwfc); + for (auto& x: nlm[dim]) + { + x = 0.0; + } + } + + // rcut of orbtials and projectors + // in our calculation, we always put orbital phi at the left side of + // because = + const double Rcut1 = orb.Phi[T1].getRcut(); + const ModuleBase::Vector3 dRa = R0 - R1; + + double distance10 = dRa.norm(); + + bool all_out = true; + for (int ip = 0; ip < nproj; ip++) + { + const double Rcut0 = infoNL_.Beta[T0].Proj[ip].getRcut(); + if (distance10 > (Rcut1 + Rcut0)) + { + calproj[ip] = false; + } + else + { + all_out = false; + calproj[ip] = true; + } + } + + if (all_out) + { + ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); + return; + } + + const int mesh_r1 = orb.Phi[T1].PhiLN(L1, N1).getNr(); + const double* psi_1 = orb.Phi[T1].PhiLN(L1, N1).getPsi(); + const double dk_1 = orb.Phi[T1].PhiLN(L1, N1).getDk(); + + const int ridial_grid_num = 140; + const int angular_grid_num = 110; + std::vector r_ridial(ridial_grid_num); + std::vector weights_ridial(ridial_grid_num); + + int index = 0; + for (int nb = 0; nb < nproj; nb++) + { + const int L0 = infoNL_.Beta[T0].Proj[nb].getL(); + if (!calproj[nb]) + { + index += 2 * L0 + 1; + continue; + } + + const int mesh_r0 = infoNL_.Beta[T0].Proj[nb].getNr(); + const double* beta_r = infoNL_.Beta[T0].Proj[nb].getBeta_r(); + const double* radial0 = infoNL_.Beta[T0].Proj[nb].getRadial(); + const double dk_0 = infoNL_.Beta[T0].Proj[nb].getDk(); + + const double Rcut0 = infoNL_.Beta[T0].Proj[nb].getRcut(); + ModuleBase::Integral::Gauss_Legendre_grid_and_weight(radial0[0], + radial0[mesh_r0 - 1], + ridial_grid_num, + r_ridial.data(), + weights_ridial.data()); + + const double A_phase = A * R0; + const std::complex exp_iAR0 = std::exp(ModuleBase::IMAG_UNIT * A_phase); + + std::vector rly0(L0); + std::vector rly1(L1); + for (int ir = 0; ir < ridial_grid_num; ir++) + { + std::vector> result_angular(2 * L0 + 1, 0.0); + std::vector> result_angular_r_commu_x; + std::vector> result_angular_r_commu_y; + std::vector> result_angular_r_commu_z; + if (calc_r) + { + result_angular_r_commu_x.resize(2 * L0 + 1, 0.0); + result_angular_r_commu_y.resize(2 * L0 + 1, 0.0); + result_angular_r_commu_z.resize(2 * L0 + 1, 0.0); + } + + for (int ian = 0; ian < angular_grid_num; ian++) + { + const double x = ModuleBase::Integral::Lebedev_Laikov_grid110_x[ian]; + const double y = ModuleBase::Integral::Lebedev_Laikov_grid110_y[ian]; + const double z = ModuleBase::Integral::Lebedev_Laikov_grid110_z[ian]; + const double weights_angular = ModuleBase::Integral::Lebedev_Laikov_grid110_w[ian]; + const ModuleBase::Vector3 r_angular_tmp(x, y, z); + + const ModuleBase::Vector3 r_coor = r_ridial[ir] * r_angular_tmp; + const ModuleBase::Vector3 tmp_r_coor = r_coor + dRa; + const double tmp_r_coor_norm = tmp_r_coor.norm(); + if (tmp_r_coor_norm > Rcut1) + { + continue; + } + + ModuleBase::Vector3 tmp_r_unit; + if (tmp_r_coor_norm > 1e-10) + { + tmp_r_unit = tmp_r_coor / tmp_r_coor_norm; + } + + ModuleBase::Ylm::rl_sph_harm(L0, x, y, z, rly0); + + ModuleBase::Ylm::rl_sph_harm(L1, tmp_r_unit.x, tmp_r_unit.y, tmp_r_unit.z, rly1); + + const double phase = A * r_coor; + const std::complex exp_iAr = std::exp(ModuleBase::IMAG_UNIT * phase); + + const ModuleBase::Vector3 tmp_r_coor_r_commu = r_coor + R0; + const double interp_v = ModuleBase::PolyInt::Polynomial_Interpolation(psi_1, + mesh_r1, dk_1, tmp_r_coor_norm); + + for (int m0 = 0; m0 < 2 * L0 + 1; m0++) + { + std::complex temp = exp_iAr * rly0[L0 * L0 + m0] * rly1[L1 * L1 + m1] + * interp_v * weights_angular; + result_angular[m0] += temp; + + if (calc_r) + { + result_angular_r_commu_x[m0] += temp * tmp_r_coor_r_commu.x; + result_angular_r_commu_y[m0] += temp * tmp_r_coor_r_commu.y; + result_angular_r_commu_z[m0] += temp * tmp_r_coor_r_commu.z; + } + } + } + + int index_tmp = index; + const double temp = ModuleBase::PolyInt::Polynomial_Interpolation(beta_r, + mesh_r0, dk_0, r_ridial[ir]) * r_ridial[ir] * weights_ridial[ir]; + + if (!calc_r) + { + for (int m0 = 0; m0 < 2 * L0 + 1; m0++) + { + nlm[0][index_tmp] += temp * result_angular[m0] * exp_iAR0; + index_tmp++; + } + } + else + { + for (int m0 = 0; m0 < 2 * L0 + 1; m0++) + { + nlm[0][index_tmp] += temp * result_angular[m0] * exp_iAR0; + nlm[1][index_tmp] += temp * result_angular_r_commu_x[m0] * exp_iAR0; + nlm[2][index_tmp] += temp * result_angular_r_commu_y[m0] * exp_iAR0; + nlm[3][index_tmp] += temp * result_angular_r_commu_z[m0] * exp_iAR0; + index_tmp++; + } + } + } + + index += 2 * L0 + 1; + } + + for(int dim = 0; dim < nlm.size(); dim++) + { + for (auto &x : nlm[dim]) + { + // nlm[0] is + // nlm[1 or 2 or 3] is , a = x, y, z + x = std::conj(x); + } + } + + assert(index == natomwfc); + ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); + + return; +} + +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h b/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h new file mode 100644 index 0000000000..df736d3217 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h @@ -0,0 +1,31 @@ +#ifndef SNAP_PSIBETA_HALF_TDDFT +#define SNAP_PSIBETA_HALF_TDDFT + +#include +#include + +#include "source_base/vector3.h" +#include "source_basis/module_ao/ORB_read.h" +#include "source_cell/setup_nonlocal.h" + +namespace module_tddft +{ + // calculate the tddft nonlocal potential term + void snap_psibeta_half_tddft( + const LCAO_Orbitals &orb, + const InfoNonlocal &infoNL_, + std::vector>> &nlm, + const ModuleBase::Vector3 &R1, + const int &T1, + const int &L1, + const int &m1, + const int &N1, + const ModuleBase::Vector3 &R0, // The projector. + const int &T0, + const ModuleBase::Vector3 &A, + const bool &calc_r + ); + +} // namespace module_tddft + +#endif diff --git a/source/source_hamilt_lcao/module_tddft/solve_propagation.cpp b/source/source_hamilt_lcao/module_tddft/solve_propagation.cpp new file mode 100644 index 0000000000..5271f2fec3 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/solve_propagation.cpp @@ -0,0 +1,114 @@ +#include "solve_propagation.h" + +#include + +#include "source_base/lapack_connector.h" +#include "source_base/scalapack_connector.h" +#include "source_pw/hamilt_pwdft/global.h" + +namespace module_tddft +{ +#ifdef __MPI +void solve_propagation(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const double dt, + const std::complex* Stmp, + const std::complex* Htmp, + const std::complex* psi_k_laststep, + std::complex* psi_k) +{ + // (1) init A,B and copy Htmp to A & B + std::complex* operator_A = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(operator_A, pv->nloc); + BlasConnector::copy(pv->nloc, Htmp, 1, operator_A, 1); + + std::complex* operator_B = new std::complex[pv->nloc]; + ModuleBase::GlobalFunc::ZEROS(operator_B, pv->nloc); + BlasConnector::copy(pv->nloc, Htmp, 1, operator_B, 1); + + const double dt_au = dt / ModuleBase::AU_to_FS; + + // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (2) compute operator_A & operator_B by GEADD + // operator_A = Stmp + i*para * Htmp; beta2 = para = 0.25 * dt + // operator_B = Stmp - i*para * Htmp; beta1 = - para = -0.25 * dt + std::complex alpha = {1.0, 0.0}; + std::complex beta1 = {0.0, -0.25 * dt_au}; + std::complex beta2 = {0.0, 0.25 * dt_au}; + + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + Stmp, + 1, + 1, + pv->desc, + beta2, + operator_A, + 1, + 1, + pv->desc); + ScalapackConnector::geadd('N', + nlocal, + nlocal, + alpha, + Stmp, + 1, + 1, + pv->desc, + beta1, + operator_B, + 1, + 1, + pv->desc); + // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + // (3) b = operator_B @ psi_k_laststep + std::complex* tmp_b = new std::complex[pv->nloc_wfc]; + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nlocal, + 1.0, + operator_B, + 1, + 1, + pv->desc, + psi_k_laststep, + 1, + 1, + pv->desc_wfc, + 0.0, + tmp_b, + 1, + 1, + pv->desc_wfc); + //get ipiv + int* ipiv = new int[pv->nloc]; + int info = 0; + // (4) solve Ac=b + ScalapackConnector::gesv(nlocal, + nband, + operator_A, + 1, + 1, + pv->desc, + ipiv, + tmp_b, + 1, + 1, + pv->desc_wfc, + &info); + + //copy solution to psi_k + BlasConnector::copy(pv->nloc_wfc, tmp_b, 1, psi_k, 1); + + delete []tmp_b; + delete []ipiv; + delete []operator_A; + delete []operator_B; +} +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/solve_propagation.h b/source/source_hamilt_lcao/module_tddft/solve_propagation.h new file mode 100644 index 0000000000..fc707b20d7 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/solve_propagation.h @@ -0,0 +1,34 @@ +#ifndef TD_SOLVE_PROPAGATION_H +#define TD_SOLVE_PROPAGATION_H + +#include "source_basis/module_ao/parallel_orbitals.h" +#include + +namespace module_tddft +{ +#ifdef __MPI +/** +* @brief solve propagation equation A@c(t+dt) = B@c(t) +* +* @param[in] pv information of parallel +* @param[in] nband number of bands +* @param[in] nlocal number of orbitals +* @param[in] dt time interval +* @param[in] Stmp overlap matrix S(t+dt/2) +* @param[in] Htmp H(t+dt/2) +* @param[in] psi_k_laststep psi of last step +* @param[out] psi_k psi of this step +*/ +void solve_propagation(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const double dt, + const std::complex* Stmp, + const std::complex* Htmp, + const std::complex* psi_k_laststep, + std::complex* psi_k); + +#endif +} // namespace module_tddft + +#endif // TD_SOLVE_H \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/td_folding.cpp b/source/source_hamilt_lcao/module_tddft/td_folding.cpp new file mode 100644 index 0000000000..d7eefd240e --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/td_folding.cpp @@ -0,0 +1,53 @@ +#include "td_info.h" +#include "source_base/libm/libm.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +template +void TD_info::folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type) +{ +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int i = 0; i < hR.size_atom_pairs(); ++i) + { + hamilt::AtomPair& tmp = hR.get_atom_pair(i); + for(int ir = 0;ir < tmp.get_R_size(); ++ir ) + { + const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); + + //new + //cal tddft phase for hybrid gague + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + ModuleBase::Vector3 dtau = ucell->cal_dtau(iat1, iat2, r_index); + const double arg_td = cart_At * dtau * ucell->lat0; + //new + + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + + tmp.find_R(r_index); + tmp.add_to_matrix(hk, ncol, kphase, hk_type); + } + } +} +template +void TD_info::folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); +template +void TD_info::folding_HR_td>(const hamilt::HContainer>& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/td_info.cpp b/source/source_hamilt_lcao/module_tddft/td_info.cpp new file mode 100644 index 0000000000..26e2bab0a5 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/td_info.cpp @@ -0,0 +1,227 @@ +#include "td_info.h" + +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "module_parameter/parameter.h" + +bool TD_info::out_mat_R = false; +bool TD_info::out_vecpot = false; +bool TD_info::out_current = false; +bool TD_info::out_current_k = false; +bool TD_info::init_vecpot_file = false; +bool TD_info::evolve_once = false; + +TD_info* TD_info::td_vel_op = nullptr; + +int TD_info::estep_shift = 0; +int TD_info::istep = -1; +int TD_info::max_istep = -1; +std::vector> TD_info::At_from_file; + +TD_info::TD_info(const UnitCell* ucell_in) +{ + this->ucell = ucell_in; + if (init_vecpot_file && istep == -1) + { + this->read_cart_At(); + } + //read in restart step + if(PARAM.inp.mdp.md_restart) + { + std::stringstream ssc; + ssc << PARAM.globalv.global_readin_dir << "Restart_td.dat"; + std::ifstream file(ssc.str().c_str()); + if (!file) + { + ModuleBase::WARNING_QUIT("TD_info::TD_info", "No Restart_td.dat!"); + } + file >> estep_shift; + std::cout<<"estep_shift"<istep += estep_shift; + return; +} +TD_info::~TD_info() +{ + if(elecstate::H_TDDFT_pw::stype == 1) + { + this->destroy_HS_R_td_sparse(); + } + for (int dir = 0; dir < 3; dir++) + { + if (this->current_term[dir] != nullptr) + { + delete this->current_term[dir]; + } + } +} + +void TD_info::output_cart_At(const std::string& out_dir) +{ + if (GlobalV::MY_RANK == 0) + { + std::string out_file; + // generate the output file name + out_file = out_dir + "At.dat"; + std::ofstream ofs; + // output title + if (istep == estep_shift) + { + ofs.open(out_file.c_str(), std::ofstream::out); + ofs << std::left << std::setw(8) << "#istep" << std::setw(15) << "A_x" << std::setw(15) << "A_y" + << std::setw(15) << "A_z" << std::endl; + } + else + { + ofs.open(out_file.c_str(), std::ofstream::app); + } + // output the vector potential + ofs << std::left << std::setw(8) << istep; + // divide by 2.0 to get the atomic unit + for (int i = 0; i < 3; i++) + { + ofs << std::scientific << std::setprecision(4) << std::setw(15) << cart_At[i]; + } + ofs << std::endl; + ofs.close(); + } + return; +} + +void TD_info::cal_cart_At(const ModuleBase::Vector3& At) +{ + istep++; + if (init_vecpot_file) + { + this->cart_At = At_from_file[istep > max_istep ? max_istep : istep]; + } + else + { + // transfrom into atomic unit + this->cart_At = At / 2.0; + } + // output the vector potential if needed + if (out_vecpot == true) + { + this->output_cart_At(PARAM.globalv.global_out_dir); + } +} + +void TD_info::read_cart_At(void) +{ + std::string in_file; + // generate the input file name + in_file = "At.dat"; + std::ifstream ifs(in_file.c_str()); + // check if the file is exist + if (!ifs) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Cannot open Vector potential file!"); + } + std::string line; + std::vector str_vec; + // use tmp to skip the istep number + int tmp = 0; + while (std::getline(ifs, line)) + { + // A tmporary vector3 to store the data of this line + ModuleBase::Vector3 At; + if (line[0] == '#') + { + continue; + } + std::istringstream iss(line); + // skip the istep number + if (!(iss >> tmp)) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Error reading istep!"); + } + // read the vector potential + double component = 0; + // Read three components + for (int i = 0; i < 3; i++) + { + if (!(iss >> component)) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", + "Error reading component " + std::to_string(i + 1) + " for istep " + + std::to_string(tmp) + "!"); + } + At[i] = component; + } + // add the tmporary vector3 to the vector potential vector + At_from_file.push_back(At); + } + // set the max_istep + max_istep = At_from_file.size() - 1; + ifs.close(); + + return; +} +void TD_info::out_restart_info(const int nstep, + const ModuleBase::Vector3& At_current, + const ModuleBase::Vector3& At_laststep) +{ + if (GlobalV::MY_RANK == 0) + { + // open file + std::string outdir = PARAM.globalv.global_out_dir + "Restart_td.dat"; + std::ofstream outFile(outdir); + if (!outFile) { + ModuleBase::WARNING_QUIT("out_restart_info", "no Restart_td.dat!"); + } + // write data + outFile << nstep << std::endl; + outFile << At_current[0] << " " << At_current[1] << " " << At_current[2] << std::endl; + outFile << At_laststep[0] << " " << At_laststep[1] << " " << At_laststep[2] << std::endl; + outFile.close(); + } + + + return; +} + +void TD_info::initialize_current_term(const hamilt::HContainer>* HR, + const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("TD_info", "initialize_current_term"); + ModuleBase::timer::tick("TD_info", "initialize_current_term"); + + for (int dir = 0; dir < 3; dir++) + { + if (this->current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + + for (int i = 0; i < HR->size_atom_pairs(); ++i) + { + hamilt::AtomPair>& tmp = HR->get_atom_pair(i); + for (int ir = 0; ir < tmp.get_R_size(); ++ir) + { + const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + + hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); + for (int dir = 0; dir < 3; dir++) + { + this->current_term[dir]->insert_pair(tmp1); + } + } + } + for (int dir = 0; dir < 3; dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + + ModuleBase::timer::tick("TD_info", "initialize_current_term"); +} + +void TD_info::destroy_HS_R_td_sparse(void) +{ + std::map, std::map>>> + empty_HR_sparse_td_vel_up; + std::map, std::map>>> + empty_HR_sparse_td_vel_down; + HR_sparse_td_vel[0].swap(empty_HR_sparse_td_vel_up); + HR_sparse_td_vel[1].swap(empty_HR_sparse_td_vel_down); +} diff --git a/source/source_hamilt_lcao/module_tddft/td_info.h b/source/source_hamilt_lcao/module_tddft/td_info.h new file mode 100644 index 0000000000..79026c3b64 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/td_info.h @@ -0,0 +1,108 @@ +#ifndef TD_INFO_H +#define TD_INFO_H +#include "source_base/abfs-vector3_order.h" +#include "source_base/timer.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" + +#include +// Class to store TDDFT infos, mainly for periodic system. +class TD_info +{ + public: + TD_info(const UnitCell* ucell_in); + ~TD_info(); + + void init(); + + /// @brief switch to control the output of HR + static bool out_mat_R; + + /// @brief pointer to the only TD_info object itself + static TD_info* td_vel_op; + + /// @brief switch to control the output of At + static bool out_vecpot; + + /// @brief switch to control the output of current + static bool out_current; + + /// @brief switch to control the format of the output current, in total or in each k-point + static bool out_current_k; + + /// @brief switch to control the source of At + static bool init_vecpot_file; + + /// @brief if need to calculate more than once + static bool evolve_once; + + /// @brief Restart step + static int estep_shift; + + /// @brief Store the vector potential for tddft calculation + ModuleBase::Vector3 cart_At; + + /// @brief calculate the At in cartesian coordinate + void cal_cart_At(const ModuleBase::Vector3& At); + + /// @brief output RT-TDDFT info for restart + void out_restart_info(const int nstep, + const ModuleBase::Vector3& At_current, + const ModuleBase::Vector3& At_laststep); + + // allocate memory for current term. + void initialize_current_term(const hamilt::HContainer>* HR, const Parallel_Orbitals* paraV); + + hamilt::HContainer>* get_current_term_pointer(const int& i) const + { + return this->current_term[i]; + } + + + // folding HR to hk, for hybrid gague + template + void folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); + + int get_istep() + { + return istep; + } + + const UnitCell* get_ucell() + { + return this->ucell; + } + + // For TDDFT velocity gauge, to fix the output of HR + std::map, std::map>>> HR_sparse_td_vel[2]; + + private: + /// @brief pointer to the unit cell + const UnitCell* ucell = nullptr; + + /// @brief read At from output file + void read_cart_At(); + + /// @brief output cart_At to output file + void output_cart_At(const std::string& out_dir); + + /// @brief store isteps now + static int istep; + + /// @brief total steps of read in At + static int max_istep; + + /// @brief store the read in At_data + static std::vector> At_from_file; + + /// @brief destory HSR data stored + void destroy_HS_R_td_sparse(); + + /// @brief part of Momentum operator, -iāˆ‡ - i[r,Vnl]. Used to calculate current. + std::vector>*> current_term = {nullptr, nullptr, nullptr}; +}; + +#endif diff --git a/source/source_hamilt_lcao/module_tddft/upsi.cpp b/source/source_hamilt_lcao/module_tddft/upsi.cpp new file mode 100644 index 0000000000..15d78f19e2 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/upsi.cpp @@ -0,0 +1,271 @@ +#include "upsi.h" + +#include "source_base/lapack_connector.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/scalapack_connector.h" + +#include +#include + +namespace module_tddft +{ +#ifdef __MPI +void upsi(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const std::complex* U_operator, + const std::complex* psi_k_laststep, + std::complex* psi_k, + std::ofstream& ofs_running, + const int print_matrix) +{ + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nlocal, + 1.0, + U_operator, + 1, + 1, + pv->desc, + psi_k_laststep, + 1, + 1, + pv->desc_wfc, + 0.0, + psi_k, + 1, + 1, + pv->desc_wfc); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " psi_k:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = psi_k[in + j].real(); + double bb = psi_k[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " psi_k_laststep:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = psi_k_laststep[in + j].real(); + double bb = psi_k_laststep[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } +} + +void upsi_tensor(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& U_operator, + const ct::Tensor& psi_k_laststep, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix) +{ + ScalapackConnector::gemm('N', + 'N', + nlocal, + nband, + nlocal, + 1.0, + U_operator.data>(), + 1, + 1, + pv->desc, + psi_k_laststep.data>(), + 1, + 1, + pv->desc_wfc, + 0.0, + psi_k.data>(), + 1, + 1, + pv->desc_wfc); + + if (print_matrix) + { + ofs_running << std::endl; + ofs_running << " psi_k:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = psi_k.data>()[in + j].real(); + double bb = psi_k.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " psi_k_laststep:" << std::endl; + for (int i = 0; i < pv->ncol_bands; i++) + { + const int in = i * pv->ncol; + for (int j = 0; j < pv->ncol; j++) + { + double aa = psi_k_laststep.data>()[in + j].real(); + double bb = psi_k_laststep.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } +} + +template +void upsi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& U_operator, + const ct::Tensor& psi_k_laststep, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix) +{ + // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice + ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; + // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU + using ct_Device = typename ct::PsiToContainer::type; + + // Perform the matrix multiplication: psi_k = U_operator * psi_k_laststep + std::complex alpha = {1.0, 0.0}; + std::complex beta = {0.0, 0.0}; + + ct::kernels::blas_gemm, ct_Device>()('N', + 'N', + nlocal, + nband, + nlocal, + &alpha, + U_operator.data>(), + nlocal, + psi_k_laststep.data>(), + nlocal, + &beta, + psi_k.data>(), + nlocal); + + if (print_matrix) + { + ct::Tensor psi_k_cpu = psi_k.to_device(); + ct::Tensor psi_k_laststep_cpu = psi_k_laststep.to_device(); + + ofs_running << std::endl; + ofs_running << " psi_k:" << std::endl; + for (int i = 0; i < nband; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + double aa = psi_k_cpu.data>()[in + j].real(); + double bb = psi_k_cpu.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + ofs_running << " psi_k_laststep:" << std::endl; + for (int i = 0; i < nband; i++) + { + const int in = i * nlocal; + for (int j = 0; j < nlocal; j++) + { + double aa = psi_k_laststep_cpu.data>()[in + j].real(); + double bb = psi_k_laststep_cpu.data>()[in + j].imag(); + if (std::abs(aa) < 1e-8) + { + aa = 0.0; + } + if (std::abs(bb) < 1e-8) + { + bb = 0.0; + } + ofs_running << aa << "+" << bb << "i "; + } + ofs_running << std::endl; + } + ofs_running << std::endl; + } +} + +// Explicit instantiation of template functions +template void upsi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& U_operator, + const ct::Tensor& psi_k_laststep, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); +#if ((defined __CUDA) /* || (defined __ROCM) */) +template void upsi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& U_operator, + const ct::Tensor& psi_k_laststep, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); +#endif // __CUDA +#endif // __MPI +} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/upsi.h b/source/source_hamilt_lcao/module_tddft/upsi.h new file mode 100644 index 0000000000..459613b74b --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/upsi.h @@ -0,0 +1,60 @@ +/** + * @file upsi.h + * @brief apply U_operator to the wave function of the previous step for new wave function + * This file originally belonged to file LCAO_evolve.cpp + */ + +#ifndef UPSI_H +#define UPSI_H + +#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor +#include "source_basis/module_ao/parallel_orbitals.h" + +#include + +namespace module_tddft +{ +#ifdef __MPI +/** + * @brief apply U_operator to the wave function of the previous step for new wave function + * + * @param[in] pv information of parallel + * @param[in] nband number of bands + * @param[in] nlocal number of orbitals + * @param[in] U_operator operator of propagator + * @param[in] psi_k_laststep psi of last step + * @param[in] print_matirx print internal matrix or not + * @param[out] psi_k psi of this step + */ +void upsi(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const std::complex* U_operator, + const std::complex* psi_k_laststep, + std::complex* psi_k, + std::ofstream& ofs_running, + const int print_matrix); + +void upsi_tensor(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& U_operator, + const ct::Tensor& psi_k_laststep, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); + +template +void upsi_tensor_lapack(const Parallel_Orbitals* pv, + const int nband, + const int nlocal, + const ct::Tensor& U_operator, + const ct::Tensor& psi_k_laststep, + ct::Tensor& psi_k, + std::ofstream& ofs_running, + const int print_matrix); + +#endif // __MPI +} // namespace module_tddft + +#endif diff --git a/source/source_hamilt_lcao/module_tddft/velocity_op.cpp b/source/source_hamilt_lcao/module_tddft/velocity_op.cpp new file mode 100644 index 0000000000..7534b705ba --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/velocity_op.cpp @@ -0,0 +1,532 @@ +#include "velocity_op.h" +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" +#ifdef _OPENMP +#include +#include +#endif +#include "module_parameter/parameter.h" +template +cal_r_overlap_R Velocity_op::r_calculator; +template +bool Velocity_op::init_done = false; +template +Velocity_op::Velocity_op(const UnitCell* ucell_in, + const Grid_Driver* GridD_in, + const Parallel_Orbitals* paraV, + const LCAO_Orbitals& orb, + const TwoCenterIntegrator* intor) + : ucell(ucell_in), paraV(paraV) , orb_(orb), intor_(intor) +{ + // for length gague, the A(t) = 0 for all the time. + this->cart_At = ModuleBase::Vector3(0,0,0); + this->initialize_grad_term(GridD_in, paraV); + this->initialize_vcomm_r(GridD_in, paraV); +} +template +Velocity_op::~Velocity_op() +{ + for (int dir=0;dir<3;dir++) + { + delete this->current_term[dir]; + } +} +//allocate space for current_term +template +void Velocity_op::initialize_vcomm_r(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("Velocity_op", "initialize_vcomm_r"); + ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); + if(!init_done) + { + std::cout << "init_r_overlap_nonlocal" <current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + this->adjs_vcommr.clear(); + this->adjs_vcommr.reserve(this->ucell->nat); + for (int iat0 = 0; iat0 < ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_vcommr.push_back(adjs); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) + { + continue; + } + hamilt::AtomPair> tmp(iat1, + iat2, + R_index2.x - R_index1.x, + R_index2.y - R_index1.y, + R_index2.z - R_index1.z, + paraV); + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->insert_pair(tmp); + } + } + } + } + // allocate the memory of BaseMatrix in cal_vcomm_r_IJR, and set the new values to zero + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); +} +template +void Velocity_op::initialize_grad_term(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("Velocity_op", "initialize_grad_term"); + ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); + for (int dir=0;dir<3;dir++) + { + if (this->current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + this->adjs_grad.clear(); + this->adjs_grad.reserve(this->ucell->nat); + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + orb_.Phi[T2].getRcut()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_grad.push_back(adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index = adjs.box[ad]; + hamilt::AtomPair> tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->insert_pair(tmp); + } + } + } + // allocate the memory of BaseMatrix in HR, and set the new values to zero + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + + ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); +} +template +void Velocity_op::calculate_vcomm_r() +{ + ModuleBase::TITLE("Velocity_op", "calculate_vcomm_r"); + ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); + + const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); + const int npol = this->ucell->get_npol(); + + // 1. calculate for each pair of atoms + for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo& adjs = this->adjs_vcommr[iat0]; + std::vector>>> nlm_tot; + nlm_tot.resize(adjs.adj_num + 1); + for (int i = 0; i < adjs.adj_num + 1; i++) + { + nlm_tot[i].resize(4); + } + + #pragma omp parallel + { + #pragma omp for schedule(dynamic) + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; + const Atom* atom1 = &ucell->atoms[T1]; + auto all_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat1); + // insert col_indexes into all_indexes to get universal set with no repeat elements + all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); + std::sort(all_indexes.begin(), all_indexes.end()); + all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); + for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) + { + const int iw1 = all_indexes[iw1l] / npol; + //std::vector>> nlm; + std::vector> nlm; + // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false + // and size of outer vector is 4 when out_current is true (3 for , 1 for + // ) inner loop : all projectors (L0,M0) + + // snap_psibeta_half_tddft() are used to calculate + // and as well if current are needed + ModuleBase::Vector3 dtau = tau0 - tau1; + + r_calculator.get_psi_r_beta(*ucell, + nlm, + tau1 * this->ucell->lat0, + T1, + atom1->iw2l[iw1], + atom1->iw2m[iw1], + atom1->iw2n[iw1], + tau0 * this->ucell->lat0, + T0); + for (int dir = 0; dir < 4; dir++) + { + nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); + } + } + } + + #ifdef _OPENMP + // record the iat number of the adjacent atoms + std::set ad_atom_set; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + ad_atom_set.insert(iat1); + } + + // split the ad_atom_set into num_threads parts + const int num_threads = omp_get_num_threads(); + const int thread_id = omp_get_thread_num(); + std::set ad_atom_set_thread; + int i = 0; + for(const auto iat1 : ad_atom_set) + { + if (i % num_threads == thread_id) + { + ad_atom_set_thread.insert(iat1); + } + i++; + } + #endif + // 2. calculate D for each pair of atoms + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + #ifdef _OPENMP + if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) + { + continue; + } + #endif + ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], + R_index2[1] - R_index1[1], + R_index2[2] - R_index1[2]); + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2])->get_pointer(); + } + // if not found , skip this pair of atoms + if (tmp_c[0] != nullptr) + { + this->cal_vcomm_r_IJR(iat1, + iat2, + T0, + paraV, + nlm_tot[ad1], + nlm_tot[ad2], + tmp_c); + } + } + } + } + } + ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); +} + +// cal_HR_IJR() +template +void Velocity_op::cal_vcomm_r_IJR( + const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>& nlm1_all, + const std::vector>>& nlm2_all, + std::complex** current_mat_p) +{ + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + // --------------------------------------------- + // calculate the Nonlocal matrix for each pair of orbitals + // --------------------------------------------- + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + std::vector step_trace(npol * npol, 0); + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = col_indexes.size() * is + is2; + } + } + // calculate the local matrix + const TR* tmp_d = nullptr; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); + //std::vector>*> nlm1; + std::vector*> nlm1; + for (int dir = 0; dir < 4; dir++) + { + nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); + } + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + //std::vector>*> nlm2; + std::vector*> nlm2; + for (int dir = 0; dir < 4; dir++) + { + nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); + } + +#ifdef __DEBUG + assert(nlm1.size() == nlm2.size()); +#endif + for (int is = 0; is < npol * npol; ++is) + { + for (int dir = 0; dir < 3; dir++) + { + std::complex nlm_r_tmp = std::complex{0, 0}; + std::complex imag_unit = std::complex{0, 1}; + for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) + { + const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; + const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; + this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); + //- + // multiply d in the end + TR tmp = (nlm1[dir + 1]->at(p1) * nlm2[0]->at(p2) + - nlm1[0]->at(p1) * nlm2[dir + 1]->at(p2)) + * (*tmp_d); + nlm_r_tmp += tmp; + } + // -i[r,Vnl], 2.0 due to the unit transformation + current_mat_p[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += npol; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } +} +template +void Velocity_op::calculate_grad_term() +{ + ModuleBase::TITLE("Velocity_op", "calculate_grad_term"); + if(this->current_term[0]==nullptr || this->current_term[0]->size_atom_pairs()<=0) + { + ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "grad_term is nullptr or empty"); + } + ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); + + const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_grad[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_index2)->get_pointer(); + } + if (tmp_c[0] != nullptr) + { + this->cal_grad_IJR(iat1, iat2, paraV, dtau, tmp_c); + } + else + { + ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "R_index not found in HR"); + } + } + } + ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); +} +template +void Velocity_op::cal_grad_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex** current_mat_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1, I1; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2, I2; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + // --------------------------------------------- + // get tau1 (in cell <0,0,0>) and tau2 (in cell R) + // in principle, only dtau is needed in this function + // snap_psipsi should be refactored to use dtau directly + // --------------------------------------------- + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double grad[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + for(int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + // calculate , which equals to -. + intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, nullptr, grad); + ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); + + for (int dir = 0; dir < 3; dir++) + { + for (int ipol = 0; ipol < npol; ipol++) + { + // part of Momentum operator, -iāˆ‡r,used to calculate the current + // here is actually iāˆ‡R + current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); + } + current_mat_p[dir] += npol; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } +} +template class Velocity_op; +template class Velocity_op>; diff --git a/source/source_hamilt_lcao/module_tddft/velocity_op.h b/source/source_hamilt_lcao/module_tddft/velocity_op.h new file mode 100644 index 0000000000..cebf99c214 --- /dev/null +++ b/source/source_hamilt_lcao/module_tddft/velocity_op.h @@ -0,0 +1,79 @@ +#ifndef TD_VELOCITY_OP_H +#define TD_VELOCITY_OP_H +#include +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_base/vector3.h" +#include "module_io/cal_r_overlap_R.h" + +//design to calculate velocity operator +template +class Velocity_op +{ + public: + Velocity_op(const UnitCell* ucell_in, + const Grid_Driver* GridD_in, + const Parallel_Orbitals* paraV, + const LCAO_Orbitals& orb, + const TwoCenterIntegrator* intor); + ~Velocity_op(); + + hamilt::HContainer>* get_current_term_pointer(const int& i)const + { + return this->current_term[i]; + } + void calculate_vcomm_r(); + void calculate_grad_term(); + + private: + const UnitCell* ucell = nullptr; + + const Parallel_Orbitals* paraV = nullptr; + + const LCAO_Orbitals& orb_; + + /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only shared between TD operators. + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + + const TwoCenterIntegrator* intor_ = nullptr; + const TwoCenterIntegrator* intorbeta_ = nullptr; + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_vcomm_r(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); + void initialize_grad_term(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_vcomm_r_IJR(const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>& nlm1_all, + const std::vector>>& nlm2_all, + std::complex** current_mat_p); + void cal_grad_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex** current_mat_p); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_vcommr; + std::vector adjs_grad; + + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + static cal_r_overlap_R r_calculator; + static bool init_done; +}; + + +#endif // TD_CURRENT_H diff --git a/source/source_io/cal_r_overlap_R.cpp b/source/source_io/cal_r_overlap_R.cpp index 237723e06e..3c9a156a8a 100644 --- a/source/source_io/cal_r_overlap_R.cpp +++ b/source/source_io/cal_r_overlap_R.cpp @@ -5,6 +5,7 @@ #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_pw/hamilt_pwdft/global.h" +#include "source_base/mathzone_add1.h" cal_r_overlap_R::cal_r_overlap_R() { @@ -226,6 +227,238 @@ void cal_r_overlap_R::construct_orbs_and_orb_r(const UnitCell& ucell, } } +void cal_r_overlap_R::construct_orbs_and_nonlocal_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb) +{ + const InfoNonlocal& infoNL_ = ucell.infoNL; + + int orb_r_ntype = 0; + int mat_Nr = orb.Phi[0].PhiLN(0, 0).getNr(); + int count_Nr = 0; + + orbs.resize(orb.get_ntype()); + for (int T = 0; T < orb.get_ntype(); ++T) + { + count_Nr = orb.Phi[T].PhiLN(0, 0).getNr(); + if (count_Nr > mat_Nr) + { + mat_Nr = count_Nr; + orb_r_ntype = T; + } + + orbs[T].resize(orb.Phi[T].getLmax() + 1); + for (int L = 0; L <= orb.Phi[T].getLmax(); ++L) + { + orbs[T][L].resize(orb.Phi[T].getNchi(L)); + for (int N = 0; N < orb.Phi[T].getNchi(L); ++N) + { + const auto& orb_origin = orb.Phi[T].PhiLN(L, N); + orbs[T][L][N].set_orbital_info(orb_origin.getLabel(), + orb_origin.getType(), + orb_origin.getL(), + orb_origin.getChi(), + orb_origin.getNr(), + orb_origin.getRab(), + orb_origin.getRadial(), + Numerical_Orbital_Lm::Psi_Type::Psi, + orb_origin.getPsi(), + static_cast(orb_origin.getNk() * kmesh_times) | 1, + orb_origin.getDk(), + orb_origin.getDruniform(), + false, + true, + PARAM.inp.cal_force); + } + } + } + + orb_r.set_orbital_info(orbs[orb_r_ntype][0][0].getLabel(), // atom label + orb_r_ntype, // atom type + 1, // angular momentum L + 1, // number of orbitals of this L , just N + orbs[orb_r_ntype][0][0].getNr(), // number of radial mesh + orbs[orb_r_ntype][0][0].getRab(), // the mesh interval in radial mesh + orbs[orb_r_ntype][0][0].getRadial(), // radial mesh value(a.u.) + Numerical_Orbital_Lm::Psi_Type::Psi, + orbs[orb_r_ntype][0][0].getRadial(), // radial wave function + orbs[orb_r_ntype][0][0].getNk(), + orbs[orb_r_ntype][0][0].getDk(), + orbs[orb_r_ntype][0][0].getDruniform(), + false, + true, + PARAM.inp.cal_force); + + orbs_nonlocal.resize(orb.get_ntype()); + for (int T = 0; T < orb.get_ntype(); ++T) + { + const int nproj = infoNL_.nproj[T]; + orbs_nonlocal[T].resize(nproj); + for (int ip = 0; ip < nproj; ip++) + { + int nr = infoNL_.Beta[T].Proj[ip].getNr(); + double dr_uniform = 0.01; + int nr_uniform = static_cast((infoNL_.Beta[T].Proj[ip].getRadial(nr-1) - infoNL_.Beta[T].Proj[ip].getRadial(0))/dr_uniform) + 1; + double* rad = new double[nr_uniform]; + double* rab = new double[nr_uniform]; + for (int ir = 0; ir < nr_uniform; ir++) + { + rad[ir] = ir*dr_uniform; + rab[ir] = dr_uniform; + } + double* y2 = new double[nr]; + double* Beta_r_uniform = new double[nr_uniform]; + double* dbeta_uniform = new double[nr_uniform]; + ModuleBase::Mathzone_Add1::SplineD2(infoNL_.Beta[T].Proj[ip].getRadial(), infoNL_.Beta[T].Proj[ip].getBeta_r(), nr, 0.0, 0.0, y2); + ModuleBase::Mathzone_Add1::Cubic_Spline_Interpolation( + infoNL_.Beta[T].Proj[ip].getRadial(), + infoNL_.Beta[T].Proj[ip].getBeta_r(), + y2, + nr, + rad, + nr_uniform, + Beta_r_uniform, + dbeta_uniform + ); + + // linear extrapolation at the zero point + if (infoNL_.Beta[T].Proj[ip].getRadial(0) > 1e-10) + { + double slope = (infoNL_.Beta[T].Proj[ip].getBeta_r(1) - infoNL_.Beta[T].Proj[ip].getBeta_r(0)) / (infoNL_.Beta[T].Proj[ip].getRadial(1) - infoNL_.Beta[T].Proj[ip].getRadial(0)); + Beta_r_uniform[0] = infoNL_.Beta[T].Proj[ip].getBeta_r(0) - slope * infoNL_.Beta[T].Proj[ip].getRadial(0); + } + + // Here, the operation beta_r / r is performed. To avoid divergence at r=0, beta_r(0) is set to beta_r(1). + // However, this may introduce issues, so caution is needed. + for (int ir = 1; ir < nr_uniform; ir++) + { + Beta_r_uniform[ir] = Beta_r_uniform[ir] / rad[ir]; + } + Beta_r_uniform[0] = Beta_r_uniform[1]; + + orbs_nonlocal[T][ip].set_orbital_info(infoNL_.Beta[T].getLabel(), + infoNL_.Beta[T].getType(), + infoNL_.Beta[T].Proj[ip].getL(), + 1, + nr_uniform, + rab, + rad, + Numerical_Orbital_Lm::Psi_Type::Psi, + Beta_r_uniform, + static_cast(infoNL_.Beta[T].Proj[ip].getNk() * kmesh_times) | 1, + infoNL_.Beta[T].Proj[ip].getDk(), + infoNL_.Beta[T].Proj[ip].getDruniform(), + false, + true, + PARAM.inp.cal_force); + + delete [] rad; + delete [] rab; + delete [] y2; + delete [] Beta_r_uniform; + delete [] dbeta_uniform; + } + } + + for (int TA = 0; TA < orb.get_ntype(); ++TA) + { + for (int TB = 0; TB < orb.get_ntype(); ++TB) + { + for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) + { + for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) + { + for (int ip = 0; ip < infoNL_.nproj[TB]; ip++) + { + center2_orb11_nonlocal[TA][TB][LA][NA].insert( + std::make_pair(ip, Center2_Orb::Orb11(orbs[TA][LA][NA], orbs_nonlocal[TB][ip], psb_, MGT))); + } + } + } + } + } + + for (int TA = 0; TA < orb.get_ntype(); ++TA) + { + for (int TB = 0; TB < orb.get_ntype(); ++TB) + { + for (int LA = 0; LA <= orb.Phi[TA].getLmax(); ++LA) + { + for (int NA = 0; NA < orb.Phi[TA].getNchi(LA); ++NA) + { + for (int ip = 0; ip < infoNL_.nproj[TB]; ip++) + { + center2_orb21_r_nonlocal[TA][TB][LA][NA].insert(std::make_pair( + ip, + Center2_Orb::Orb21(orbs[TA][LA][NA], orb_r, orbs_nonlocal[TB][ip], psb_, MGT))); + } + } + } + } + } + + for (auto& co1: center2_orb11_nonlocal) + { + for (auto& co2: co1.second) + { + for (auto& co3: co2.second) + { + for (auto& co4: co3.second) + { + for (auto& co5: co4.second) + { + co5.second.init_radial_table(); + } + } + } + } + } + + for (auto& co1: center2_orb21_r_nonlocal) + { + for (auto& co2: co1.second) + { + for (auto& co3: co2.second) + { + for (auto& co4: co3.second) + { + for (auto& co5: co4.second) + { + co5.second.init_radial_table(); + } + } + } + } + } + + iw2it.resize(PARAM.globalv.nlocal); + iw2ia.resize(PARAM.globalv.nlocal); + iw2iL.resize(PARAM.globalv.nlocal); + iw2iN.resize(PARAM.globalv.nlocal); + iw2im.resize(PARAM.globalv.nlocal); + + int iw = 0; + for (int it = 0; it < ucell.ntype; it++) + { + for (int ia = 0; ia < ucell.atoms[it].na; ia++) + { + for (int iL = 0; iL < ucell.atoms[it].nwl + 1; iL++) + { + for (int iN = 0; iN < ucell.atoms[it].l_nchi[iL]; iN++) + { + for (int im = 0; im < (2 * iL + 1); im++) + { + iw2it[iw] = it; + iw2ia[iw] = ia; + iw2iL[iw] = iL; + iw2iN[iw] = iN; + iw2im[iw] = im; + iw++; + } + } + } + } + } +} + void cal_r_overlap_R::init(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb) { ModuleBase::TITLE("cal_r_overlap_R", "init"); @@ -239,6 +472,141 @@ void cal_r_overlap_R::init(const UnitCell& ucell,const Parallel_Orbitals& pv, co return; } +void cal_r_overlap_R::init_nonlocal(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb) +{ + ModuleBase::TITLE("cal_r_overlap_R", "init_nonlocal"); + ModuleBase::timer::tick("cal_r_overlap_R", "init_nonlocal"); + this->ParaV = &pv; + + initialize_orb_table(ucell,orb); + construct_orbs_and_nonlocal_and_orb_r(ucell,orb); + + ModuleBase::timer::tick("cal_r_overlap_R", "init_nonlocal"); + return; +} + +ModuleBase::Vector3 cal_r_overlap_R::get_psi_r_psi(const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2, + const int& L2, + const int& m2, + const int& N2) +{ + ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); + double factor = sqrt(ModuleBase::FOUR_PI / 3.0); + const ModuleBase::Vector3& distance = R2 - R1; + + double overlap_o = center2_orb11[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, distance, m1, m2); + + double overlap_x = -1 * factor + * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, + distance, + m1, + 1, + m2); // m = 1 + + double overlap_y = -1 * factor + * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, + distance, + m1, + 2, + m2); // m = -1 + + double overlap_z = factor + * center2_orb21_r[T1][T2][L1][N1][L2].at(N2).cal_overlap(origin_point, + distance, + m1, + 0, + m2); // m = 0 + + ModuleBase::Vector3 temp_prp + = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) + R1 * overlap_o; + + return temp_prp; +} + +void cal_r_overlap_R::get_psi_r_beta(const UnitCell& ucell, + std::vector>& nlm, + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2) +{ + ModuleBase::Vector3 origin_point(0.0, 0.0, 0.0); + double factor = sqrt(ModuleBase::FOUR_PI / 3.0); + const ModuleBase::Vector3& distance = R2 - R1; + const InfoNonlocal& infoNL_ = ucell.infoNL; + const int nproj = infoNL_.nproj[T2]; + nlm.resize(4); + if (nproj == 0) + { + for(int i = 0;i < 4;i++) + { + nlm[i].resize(1); + } + return; + } + + int natomwfc = 0; + for (int ip = 0; ip < nproj; ip++) + { + const int L2 = infoNL_.Beta[T2].Proj[ip].getL(); // mohan add 2021-05-07 + natomwfc += 2 * L2 + 1; + } + for(int i = 0;i < 4;i++) + { + nlm[i].resize(natomwfc); + } + int index = 0; + for (int ip = 0; ip < nproj; ip++) + { + const int L2 = infoNL_.Beta[T2].Proj[ip].getL(); + for (int m2 = 0; m2 < 2 * L2 + 1; m2++) + { + double overlap_o + = center2_orb11_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, distance, m1, m2); + + double overlap_x = -1 * factor + * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, + distance, + m1, + 1, + m2); // m = 1 + + double overlap_y = -1 * factor + * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, + distance, + m1, + 2, + m2); // m = -1 + + double overlap_z = factor + * center2_orb21_r_nonlocal[T1][T2][L1][N1].at(ip).cal_overlap(origin_point, + distance, + m1, + 0, + m2); // m = 0 + + //nlm[index] = ModuleBase::Vector3(overlap_x, overlap_y, overlap_z) + R1 * overlap_o; + + //nlm[index] = ModuleBase::Vector3(overlap_o, overlap_y, overlap_z);// + R1 * overlap_o; + nlm[0][index] = overlap_o; + nlm[1][index] = overlap_x + (R1 * overlap_o).x; + nlm[2][index] = overlap_y + (R1 * overlap_o).y; + nlm[3][index] = overlap_z + (R1 * overlap_o).z; + index++; + } + } +} + + void cal_r_overlap_R::out_rR(const UnitCell& ucell, const Grid_Driver& gd, const int& istep) { ModuleBase::TITLE("cal_r_overlap_R", "out_rR"); diff --git a/source/source_io/cal_r_overlap_R.h b/source/source_io/cal_r_overlap_R.h index f3d39d6a87..07f044f6b0 100644 --- a/source/source_io/cal_r_overlap_R.h +++ b/source/source_io/cal_r_overlap_R.h @@ -11,9 +11,9 @@ #include "source_basis/module_ao/parallel_orbitals.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" -#include "source_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "source_lcao/hamilt_lcaodft/center2_orb-orb21.h" -#include "source_lcao/hamilt_lcaodft/center2_orb.h" +#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" +#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h" +#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb.h" #include "single_R_io.h" #include @@ -33,12 +33,37 @@ class cal_r_overlap_R bool binary = false; void init(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb); + void init_nonlocal(const UnitCell& ucell,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb); + ModuleBase::Vector3 get_psi_r_psi( + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2, + const int& L2, + const int& m2, + const int& N2 + ); + void get_psi_r_beta( + const UnitCell& ucell, + std::vector>& nlm, + const ModuleBase::Vector3& R1, + const int& T1, + const int& L1, + const int& m1, + const int& N1, + const ModuleBase::Vector3& R2, + const int& T2 + ); void out_rR(const UnitCell& ucell, const Grid_Driver& gd, const int& istep); void out_rR_other(const UnitCell& ucell, const int& istep, const std::set>& output_R_coor); private: void initialize_orb_table(const UnitCell& ucell, const LCAO_Orbitals& orb); void construct_orbs_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb); + void construct_orbs_and_nonlocal_and_orb_r(const UnitCell& ucell,const LCAO_Orbitals& orb); std::vector iw2ia; std::vector iw2iL; @@ -51,6 +76,7 @@ class cal_r_overlap_R Numerical_Orbital_Lm orb_r; std::vector>> orbs; + std::vector> orbs_nonlocal; std::map< size_t, @@ -62,6 +88,16 @@ class cal_r_overlap_R std::map>>>>> center2_orb21_r; + std::map< + size_t, + std::map>>>> + center2_orb11_nonlocal; + + std::map< + size_t, + std::map>>>> + center2_orb21_r_nonlocal; + const Parallel_Orbitals* ParaV; }; #endif diff --git a/source/source_io/input_conv.cpp b/source/source_io/input_conv.cpp index 4f4e6cbfd1..5a451844e3 100644 --- a/source/source_io/input_conv.cpp +++ b/source/source_io/input_conv.cpp @@ -1,4 +1,4 @@ -#include "source_io/input_conv.h" +#include "module_io/input_conv.h" #include "source_base/global_function.h" #include "source_base/global_variable.h" @@ -7,10 +7,10 @@ #include "source_estate/occupy.h" #include "source_hamilt/module_surchem/surchem.h" #include "source_pw/hamilt_pwdft/global.h" -#include "source_io/berryphase.h" +#include "module_io/berryphase.h" #include "module_parameter/parameter.h" -#include "source_relax/ions_move_basic.h" -#include "source_relax/lattice_change_basic.h" +#include "module_relax/ions_move_basic.h" +#include "module_relax/lattice_change_basic.h" #include @@ -18,13 +18,13 @@ #include "module_ri/exx_abfs-jle.h" #endif -#include "source_lcao/module_dftu/dftu.h" +#include "module_hamilt_lcao/module_dftu/dftu.h" #ifdef __LCAO #include "source_basis/module_ao/ORB_read.h" #include "source_estate/module_pot/H_TDDFT_pw.h" -#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" -#include "source_lcao/module_tddft/evolve_elec.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" +#include "module_hamilt_lcao/module_tddft/evolve_elec.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #endif #ifdef __PEXSI #include "source_hsolver/module_pexsi/pexsi_solver.h" @@ -41,7 +41,7 @@ #include "source_estate/module_pot/gatefield.h" #include "source_hsolver/hsolver_lcao.h" #include "source_hsolver/hsolver_pw.h" -#include "source_md/md_func.h" +#include "module_md/md_func.h" #ifdef __LCAO std::vector Input_Conv::convert_units(std::string params, double c) { @@ -57,24 +57,25 @@ std::vector Input_Conv::convert_units(std::string params, double c) { void Input_Conv::read_td_efield() { elecstate::H_TDDFT_pw::stype = PARAM.inp.td_stype; - if (PARAM.inp.esolver_type == "tddft" && elecstate::H_TDDFT_pw::stype == 1) - { - TD_Velocity::tddft_velocity = true; - } else { - TD_Velocity::tddft_velocity = false; - } if (PARAM.inp.out_mat_hs2 == 1) { - TD_Velocity::out_mat_R = true; + TD_info::out_mat_R = true; } else { - TD_Velocity::out_mat_R = false; + TD_info::out_mat_R = false; } parse_expression(PARAM.inp.td_ttype, elecstate::H_TDDFT_pw::ttype); elecstate::H_TDDFT_pw::tstart = PARAM.inp.td_tstart; elecstate::H_TDDFT_pw::tend = PARAM.inp.td_tend; + if(PARAM.inp.td_dt!=-1.0) + { + elecstate::H_TDDFT_pw::dt = PARAM.inp.td_dt / ModuleBase::AU_to_FS; + } + else + { + elecstate::H_TDDFT_pw::dt = PARAM.mdp.md_dt / PARAM.inp.estep_per_md / ModuleBase::AU_to_FS; + } - elecstate::H_TDDFT_pw::dt = PARAM.mdp.md_dt / ModuleBase::AU_to_FS; elecstate::H_TDDFT_pw::dt_int = elecstate::H_TDDFT_pw::dt; // space domain parameters @@ -247,10 +248,10 @@ void Input_Conv::Convert() // Fuxiang He add 2016-10-26 //---------------------------------------------------------- #ifdef __LCAO - TD_Velocity::out_current = PARAM.inp.out_current; - TD_Velocity::out_current_k = PARAM.inp.out_current_k; - TD_Velocity::out_vecpot = PARAM.inp.out_vecpot; - TD_Velocity::init_vecpot_file = PARAM.inp.init_vecpot_file; + TD_info::out_current = PARAM.inp.out_current; + TD_info::out_current_k = PARAM.inp.out_current_k; + TD_info::out_vecpot = PARAM.inp.out_vecpot; + TD_info::init_vecpot_file = PARAM.inp.init_vecpot_file; read_td_efield(); #endif // __LCAO diff --git a/source/source_io/output_log.cpp b/source/source_io/output_log.cpp index 52f924b36d..bc202aec03 100644 --- a/source/source_io/output_log.cpp +++ b/source/source_io/output_log.cpp @@ -346,5 +346,17 @@ void write_head(std::ofstream& ofs, const int& istep, const int& iter, const std // ofs << "\n " << basisname << " ALGORITHM --------------- ION=" << std::setw(4) << istep + 1 // << " ELEC=" << std::setw(4) << iter << "--------------------------------\n"; } +void write_head_td(std::ofstream& ofs, const int& istep, const int& estep, const int& iter, const std::string& basisname) +{ + ofs << "\n"; + ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; + ofs << " --> IONIC RELAXATION STEP=" << std::setw(6) << istep+1 + << " ELECTRON PROPAGATION STEP=" << std::setw(6) << estep + << " ELECTRONIC ITERATION STEP=" << std::setw(6) << iter << "\n"; + ofs << " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<< std::endl; + +// ofs << "\n " << basisname << " ALGORITHM --------------- ION=" << std::setw(4) << istep + 1 +// << " ELEC=" << std::setw(4) << estep << " iter=" << std::setw(4) << iter << "--------------------------------\n"; +} }// namespace ModuleIO diff --git a/source/source_io/output_log.h b/source/source_io/output_log.h index d1b476fd0f..7eba64b0c4 100644 --- a/source/source_io/output_log.h +++ b/source/source_io/output_log.h @@ -77,6 +77,14 @@ void print_stress(const std::string& name, /// @param basisname basis set name void write_head(std::ofstream& ofs_running, const int& istep, const int& iter, const std::string& basisname); +/// @brief write head for scf iteration +/// @param ofs_running output stream +/// @param istep the ion step +/// @param estep the electron step +/// @param iter the scf iteration step +/// @param basisname basis set name +void write_head_td(std::ofstream& ofs_running, const int& istep, const int& estep, const int& iter, const std::string& basisname); + } // namespace ModuleIO #endif diff --git a/source/source_io/read_input.cpp b/source/source_io/read_input.cpp index e8ee9ef3fd..1bd8520519 100644 --- a/source/source_io/read_input.cpp +++ b/source/source_io/read_input.cpp @@ -194,6 +194,7 @@ void ReadInput::create_directory(const Parameter& param) ModuleBase::Global_File::make_dir_out(param.input.suffix, param.input.calculation, out_dir, + param.input.out_wfc_lcao, this->rank, param.input.mdp.md_restart, param.input.out_alllog); // xiaohui add 2013-09-01 @@ -372,7 +373,7 @@ void ReadInput::write_txt_input(const Parameter& param, const std::string& filen { ofs << "\n#Parameters (8.DeepKS)" << std::endl; } - else if (p_item->label == "td_force_dt") + else if (p_item->label == "td_dt") { ofs << "\n#Parameters (9.rt-tddft)" << std::endl; } diff --git a/source/source_io/read_input_item_md.cpp b/source/source_io/read_input_item_md.cpp index a49c1bd3e6..4ba795d63a 100644 --- a/source/source_io/read_input_item_md.cpp +++ b/source/source_io/read_input_item_md.cpp @@ -23,7 +23,7 @@ void ReadInput::item_md() Input_Item item("md_nstep"); item.annotation = "md steps"; item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.mdp.md_nstep == 0) + if (para.input.mdp.md_nstep == 0 && para.input.esolver_type != "tddft") { GlobalV::ofs_running << "md_nstep should be set. Autoset md_nstep to 50!" << std::endl; para.input.mdp.md_nstep = 50; @@ -40,6 +40,13 @@ void ReadInput::item_md() ModuleBase::WARNING_QUIT("ReadInput", "time interval of MD calculation should be positive"); } }; + item.reset_value = [](const Input_Item& item, Parameter& para) { + if (para.input.td_dt != -1.0) + { + GlobalV::ofs_running << "td_dt exist, set md_dt with td_dt" << std::endl; + para.input.mdp.md_dt = para.input.td_dt * para.input.estep_per_md; + } + }; read_sync_double(input.mdp.md_dt); this->add_item(item); } @@ -403,4 +410,4 @@ void ReadInput::item_md() this->add_item(item); } } -} // namespace ModuleIO \ No newline at end of file +} // namespace ModuleIO diff --git a/source/source_io/read_input_item_system.cpp b/source/source_io/read_input_item_system.cpp index d754f98465..ed8cd2f778 100644 --- a/source/source_io/read_input_item_system.cpp +++ b/source/source_io/read_input_item_system.cpp @@ -158,6 +158,10 @@ void ReadInput::item_system() { para.input.symmetry = "0"; } + if (para.input.esolver_type == "tddft") + { + para.input.symmetry = "-1"; + } if (para.input.qo_switch) { para.input.symmetry = "-1"; // disable kpoint reduce diff --git a/source/source_io/read_input_item_tddft.cpp b/source/source_io/read_input_item_tddft.cpp index 5a3ffe3214..0e44754db1 100644 --- a/source/source_io/read_input_item_tddft.cpp +++ b/source/source_io/read_input_item_tddft.cpp @@ -9,9 +9,28 @@ void ReadInput::item_rt_tddft() { // real time TDDFT { - Input_Item item("td_force_dt"); - item.annotation = "time of force change"; - read_sync_double(input.td_force_dt); + Input_Item item("td_dt"); + item.annotation = "time step for evolving wavefunction"; + item.reset_value = [](const Input_Item& item, Parameter& para) { + if (para.input.td_dt == -1.0) + { + GlobalV::ofs_running << "td_dt don't exist, set td_dt with md_dt" << std::endl; + para.input.td_dt = para.input.mdp.md_dt / para.input.estep_per_md; + } + }; + read_sync_double(input.td_dt); + this->add_item(item); + } + { + Input_Item item("estep_per_md"); + item.annotation = "steps of force change"; + read_sync_int(input.estep_per_md); + this->add_item(item); + } + { + Input_Item item("td_dt"); + item.annotation = "time step of propagation"; + read_sync_double(input.td_dt); this->add_item(item); } { @@ -388,4 +407,4 @@ void ReadInput::item_lr_tddft() this->add_item(item); } } -} \ No newline at end of file +} diff --git a/source/source_io/read_set_globalv.cpp b/source/source_io/read_set_globalv.cpp index be49b0a514..02fb9c8fa0 100644 --- a/source/source_io/read_set_globalv.cpp +++ b/source/source_io/read_set_globalv.cpp @@ -93,6 +93,11 @@ void ReadInput::set_global_dir(const Input_para& inp, System_para& sys) sys.global_matrix_dir = sys.global_out_dir + "matrix/"; sys.global_matrix_dir = to_dir(sys.global_matrix_dir); + /// get the global output directory + sys.global_wfc_dir = sys.global_out_dir + "WFC/"; + sys.global_wfc_dir = to_dir(sys.global_wfc_dir); + + /// get the global ML KEDF descriptor directory sys.global_mlkedf_descriptor_dir = sys.global_out_dir + "MLKEDF_Descriptors/"; sys.global_mlkedf_descriptor_dir = to_dir(sys.global_mlkedf_descriptor_dir); @@ -144,6 +149,7 @@ void ReadInput::set_global_dir(const Input_para& inp, System_para& sys) Parallel_Common::bcast_string(sys.global_readin_dir); Parallel_Common::bcast_string(sys.global_stru_dir); Parallel_Common::bcast_string(sys.global_matrix_dir); + Parallel_Common::bcast_string(sys.global_wfc_dir); Parallel_Common::bcast_string(sys.global_in_stru); #endif } diff --git a/source/source_io/read_wfc_nao.cpp b/source/source_io/read_wfc_nao.cpp index 0a7a62f5c2..b6f6262ef9 100644 --- a/source/source_io/read_wfc_nao.cpp +++ b/source/source_io/read_wfc_nao.cpp @@ -2,11 +2,11 @@ #include "source_base/parallel_common.h" #include "source_base/timer.h" -#include "source_io/write_wfc_nao.h" +#include "module_io/write_wfc_nao.h" #include "write_wfc_nao.h" #include "source_base/scalapack_connector.h" -#include "source_io/filename.h" +#include "module_io/filename.h" void ModuleIO::read_wfc_nao_one_data(std::ifstream& ifs, double& data) { @@ -30,6 +30,7 @@ bool ModuleIO::read_wfc_nao( const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep, const int skip_band) { ModuleBase::TITLE("ModuleIO", "read_wfc_nao"); @@ -155,11 +156,10 @@ bool ModuleIO::read_wfc_nao( if (myrank == 0) { const bool out_app_flag = false; - const int istep = -1; std::stringstream error_message; - std::string ss = ModuleIO::filename_output(global_readin_dir,"wf","nao", - ik,ik2iktot,nspin,nkstot,out_type,out_app_flag,gamma_only,istep); + std::string ss = ModuleIO::filename_output(global_readin_dir + "WFC/","wf","nao", + ik,ik2iktot,nspin,nkstot,out_type,out_app_flag,gamma_only,nstep); read_success = read_one_file(ss, error_message, ik, ctot); errors = error_message.str(); @@ -207,6 +207,7 @@ template bool ModuleIO::read_wfc_nao(const std::string& global_readin_di const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep, const int skip_band); template bool ModuleIO::read_wfc_nao>(const std::string& global_readin_dir, @@ -216,4 +217,5 @@ template bool ModuleIO::read_wfc_nao>(const std::string& gl const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep, const int skip_band); From b326fe845444eb9c351ab8ba74599a0980bf7cdd Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:43:33 +0800 Subject: [PATCH 79/81] Delete source/source_hamilt_lcao directory --- source/source_hamilt_lcao/CMakeLists.txt | 6 - .../hamilt_lcaodft/CMakeLists.txt | 56 -- .../hamilt_lcaodft/hamilt_lcao.cpp | 548 ------------- .../operator_lcao/CMakeLists.txt | 27 - .../operator_lcao/operator_lcao.cpp | 296 ------- .../operator_lcao/overlap_new.cpp | 271 ------- .../operator_lcao/td_ekinetic_lcao.cpp | 406 ---------- .../operator_lcao/td_ekinetic_lcao.h | 126 --- .../operator_lcao/td_nonlocal_lcao.cpp | 447 ----------- .../operator_lcao/td_nonlocal_lcao.h | 108 --- .../operator_lcao/td_pot_hybrid.cpp | 300 ------- .../operator_lcao/td_pot_hybrid.h | 129 --- .../hamilt_lcaodft/spar_hsr.cpp | 454 ----------- .../module_tddft/CMakeLists.txt | 36 - .../module_tddft/evolve_elec.cpp | 226 ------ .../module_tddft/evolve_elec.h | 185 ----- .../module_tddft/evolve_psi.cpp | 352 --------- .../module_tddft/evolve_psi.h | 47 -- .../module_tddft/middle_hamilt.cpp | 290 ------- .../module_tddft/middle_hamilt.h | 62 -- .../module_tddft/norm_psi.cpp | 671 ---------------- .../module_tddft/norm_psi.h | 56 -- .../module_tddft/propagator.cpp | 107 --- .../module_tddft/propagator.h | 222 ------ .../module_tddft/propagator_cn2.cpp | 734 ------------------ .../module_tddft/propagator_etrs.cpp | 50 -- .../module_tddft/propagator_taylor.cpp | 343 -------- .../module_tddft/snap_psibeta_half_tddft.cpp | 247 ------ .../module_tddft/snap_psibeta_half_tddft.h | 31 - .../module_tddft/solve_propagation.cpp | 114 --- .../module_tddft/solve_propagation.h | 34 - .../module_tddft/td_folding.cpp | 53 -- .../module_tddft/td_info.cpp | 227 ------ .../source_hamilt_lcao/module_tddft/td_info.h | 108 --- .../source_hamilt_lcao/module_tddft/upsi.cpp | 271 ------- source/source_hamilt_lcao/module_tddft/upsi.h | 60 -- .../module_tddft/velocity_op.cpp | 532 ------------- .../module_tddft/velocity_op.h | 79 -- 38 files changed, 8311 deletions(-) delete mode 100644 source/source_hamilt_lcao/CMakeLists.txt delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h delete mode 100644 source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/CMakeLists.txt delete mode 100644 source/source_hamilt_lcao/module_tddft/evolve_elec.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/evolve_elec.h delete mode 100644 source/source_hamilt_lcao/module_tddft/evolve_psi.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/evolve_psi.h delete mode 100644 source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/middle_hamilt.h delete mode 100644 source/source_hamilt_lcao/module_tddft/norm_psi.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/norm_psi.h delete mode 100644 source/source_hamilt_lcao/module_tddft/propagator.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/propagator.h delete mode 100644 source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h delete mode 100644 source/source_hamilt_lcao/module_tddft/solve_propagation.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/solve_propagation.h delete mode 100644 source/source_hamilt_lcao/module_tddft/td_folding.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/td_info.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/td_info.h delete mode 100644 source/source_hamilt_lcao/module_tddft/upsi.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/upsi.h delete mode 100644 source/source_hamilt_lcao/module_tddft/velocity_op.cpp delete mode 100644 source/source_hamilt_lcao/module_tddft/velocity_op.h diff --git a/source/source_hamilt_lcao/CMakeLists.txt b/source/source_hamilt_lcao/CMakeLists.txt deleted file mode 100644 index 116cccbec9..0000000000 --- a/source/source_hamilt_lcao/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(hamilt_lcaodft) -add_subdirectory(module_tddft) -add_subdirectory(module_deepks) -add_subdirectory(module_dftu) -add_subdirectory(module_hcontainer) -add_subdirectory(module_deltaspin) diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt b/source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt deleted file mode 100644 index ba00725b73..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -if(ENABLE_LCAO) - add_subdirectory(operator_lcao) - list(APPEND objects - hamilt_lcao.cpp - operator_lcao/operator_lcao.cpp - operator_lcao/veff_lcao.cpp - operator_lcao/meta_lcao.cpp - operator_lcao/op_dftu_lcao.cpp - operator_lcao/deepks_lcao.cpp - operator_lcao/op_exx_lcao.cpp - operator_lcao/overlap_new.cpp - operator_lcao/ekinetic_new.cpp - operator_lcao/nonlocal_new.cpp - operator_lcao/td_ekinetic_lcao.cpp - operator_lcao/td_nonlocal_lcao.cpp - operator_lcao/td_pot_hybrid.cpp - operator_lcao/dspin_lcao.cpp - operator_lcao/dftu_lcao.cpp - pulay_force_stress_center2.cpp - FORCE_STRESS.cpp - FORCE_gamma.cpp - FORCE_k.cpp - stress_tools.cpp - edm.cpp - grid_init.cpp - spar_dh.cpp - spar_exx.cpp - spar_hsr.cpp - spar_st.cpp - spar_u.cpp - LCAO_set_fs.cpp - LCAO_set_st.cpp - LCAO_nl_mu.cpp - LCAO_set_zero.cpp - LCAO_allocate.cpp - LCAO_set_mat2d.cpp - LCAO_init_basis.cpp - record_adj.cpp - center2_orb.cpp - center2_orb-orb11.cpp - center2_orb-orb21.cpp - center2_orb-orb22.cpp - wavefunc_in_pw.cpp - ) - - add_library( - hamilt_lcao - OBJECT - ${objects} - ) - - if(ENABLE_COVERAGE) - add_coverage(hamilt_lcao) - endif() - -endif() diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp deleted file mode 100644 index 87867bb927..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp +++ /dev/null @@ -1,548 +0,0 @@ -#include "hamilt_lcao.h" - -#include "source_base/global_variable.h" -#include "source_base/memory.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" - -#include - -#ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" -#include "operator_lcao/deepks_lcao.h" -#endif - -#ifdef __EXX -#include "module_ri/Exx_LRI_interface.h" -#include "operator_lcao/op_exx_lcao.h" -#endif - -#ifdef __ELPA -#include "source_hsolver/diago_elpa.h" -#endif - -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_hsolver/hsolver_lcao.h" -#include "operator_lcao/dftu_lcao.h" -#include "operator_lcao/dspin_lcao.h" -#include "operator_lcao/ekinetic_new.h" -#include "operator_lcao/meta_lcao.h" -#include "operator_lcao/nonlocal_new.h" -#include "operator_lcao/op_dftu_lcao.h" -#include "operator_lcao/op_exx_lcao.h" -#include "operator_lcao/overlap_new.h" -#include "operator_lcao/td_ekinetic_lcao.h" -#include "operator_lcao/td_nonlocal_lcao.h" -#include "operator_lcao/td_pot_hybrid.h" -#include "operator_lcao/veff_lcao.h" - -namespace hamilt -{ - -template -HamiltLCAO::HamiltLCAO(const UnitCell& ucell, - const Grid_Driver& grid_d, - const Parallel_Orbitals* paraV, - const K_Vectors& kv_in, - const TwoCenterIntegrator& intor_overlap_orb, - const std::vector& orb_cutoff) -{ - this->classname = "HamiltLCAO"; - - this->kv = &kv_in; - - // initialize the overlap matrix - this->sR = new HContainer(paraV); - - this->getOperator() = new OverlapNew>(this->hsk, - this->kv->kvec_d, - this->hR, - this->sR, - &ucell, - orb_cutoff, - &grid_d, - &intor_overlap_orb); -} - -template -HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, - Gint_k* GK_in, - const UnitCell& ucell, - const Grid_Driver& grid_d, - const Parallel_Orbitals* paraV, - elecstate::Potential* pot_in, - const K_Vectors& kv_in, - const TwoCenterBundle& two_center_bundle, - const LCAO_Orbitals& orb, - elecstate::DensityMatrix* DM_in -#ifdef __MLALGO - , - LCAO_Deepks* ld_in -#endif -#ifdef __EXX - , - const int istep, - int* exx_two_level_step, - std::vector>>>* Hexxd, - std::vector>>>>* Hexxc -#endif -) -{ - this->classname = "HamiltLCAO"; - - this->kv = &kv_in; - - // Real space Hamiltonian is inited with template TR - this->hR = new HContainer(paraV); - this->sR = new HContainer(paraV); - this->hsk = new HS_Matrix_K(paraV); - - // Effective potential term (\sum_r ) is registered without template - std::vector pot_register_in; - if (PARAM.inp.vl_in_h) - { - if (PARAM.inp.vion_in_h) - { - pot_register_in.push_back("local"); - } - if (PARAM.inp.vh_in_h) - { - pot_register_in.push_back("hartree"); - } - pot_register_in.push_back("xc"); - if (PARAM.inp.imp_sol) - { - pot_register_in.push_back("surchem"); - } - if (PARAM.inp.efield_flag) - { - pot_register_in.push_back("efield"); - } - if (PARAM.inp.gate_flag) - { - pot_register_in.push_back("gatefield"); - } - if (PARAM.inp.esolver_type == "tddft") - { - pot_register_in.push_back("tddft"); - } - } - - // Gamma_only case to initialize HamiltLCAO - // - // code block to construct Operator Chains - if (std::is_same::value) - { - // fix HR to gamma case, where SR will be fixed in Overlap Operator - this->hR->fix_gamma(); - // initial operator for Gamma_only case - // overlap term () is indispensable - // in Gamma_only case, target SK is this->hsk->get_sk(), the target SR is this->sR - this->getOperator() = new OverlapNew>(this->hsk, - this->kv->kvec_d, - this->hR, - this->sR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb.get()); - - // kinetic term () - if (PARAM.inp.t_in_h) - { - Operator* ekinetic = new EkineticNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.kinetic_orb.get()); - this->getOperator()->add(ekinetic); - } - - // nonlocal term (D) - // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() - if (PARAM.inp.vnl_in_h) - { - Operator* nonlocal = new NonlocalNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb_beta.get()); - this->getOperator()->add(nonlocal); - } - - // Effective potential term (\sum_r ) - // in general case, target HR is Gint::hRGint, while target HK is this->hsk->get_hk() - if (PARAM.inp.vl_in_h) - { - // only Potential is not empty, Veff and Meta are available - if (pot_register_in.size() > 0) - { - // register Potential by gathered operator - pot_in->pot_register(pot_register_in); - // effective potential term - Operator* veff = new Veff>(GG_in, - this->hsk, - this->kv->kvec_d, - pot_in, - this->hR, // no explicit call yet - &ucell, - orb.cutoffs(), - &grid_d, - PARAM.inp.nspin); - this->getOperator()->add(veff); - } - } - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - Operator* deepks = new DeePKS>(this->hsk, - this->kv->kvec_d, - this->hR, // no explicit call yet - &ucell, - &grid_d, - two_center_bundle.overlap_orb_alpha.get(), - &orb, - this->kv->get_nks(), - DM_in, - ld_in); - this->getOperator()->add(deepks); - this->V_delta_R = dynamic_cast>*>(deepks)->get_V_delta_R(); - } -#endif - - // end node should be OperatorDFTU - if (PARAM.inp.dft_plus_u) - { - Operator* dftu = nullptr; - if (PARAM.inp.dft_plus_u == 2) - { - dftu = new OperatorDFTU>(this->hsk, - this->kv->kvec_d, - this->hR, // no explicit call yet - this->kv->isk); - } - else - { - dftu = new DFTU>(this->hsk, - this->kv->kvec_d, - this->hR, - ucell, - &grid_d, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs(), - &GlobalC::dftu); - } - this->getOperator()->add(dftu); - } - } - // multi-k-points case to initialize HamiltLCAO, ops will be used - else if (std::is_same>::value) - { - // Effective potential term (\sum_r ) - // Meta potential term (\sum_r ) - // in general case, target HR is Gint::pvpR_reduced, while target HK is this->hsk->get_hk() - if (PARAM.inp.vl_in_h) - { - // only Potential is not empty, Veff and Meta are available - if (pot_register_in.size() > 0) - { - // register Potential by gathered operator - pot_in->pot_register(pot_register_in); - // Veff term - this->getOperator() = new Veff>(GK_in, - this->hsk, - this->kv->kvec_d, - pot_in, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - PARAM.inp.nspin); - } - } - - // initial operator for multi-k case - // overlap term is indispensable - Operator* overlap = new OverlapNew>(this->hsk, - this->kv->kvec_d, - this->hR, - this->sR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb.get()); - if (this->getOperator() == nullptr) - { - this->getOperator() = overlap; - } - else - { - this->getOperator()->add(overlap); - } - - // kinetic term (), - // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() - if (PARAM.inp.t_in_h) - { - Operator* ekinetic = new EkineticNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.kinetic_orb.get()); - this->getOperator()->add(ekinetic); - } - - // nonlocal term (D) - // in general case, target HR is this->hR, while target HK is this->hsk->get_hk() - if (PARAM.inp.vnl_in_h) - { - Operator* nonlocal = new NonlocalNew>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb_beta.get()); - // TDDFT velocity gauge will calculate full non-local potential including the original one and the - // correction on its own. So the original non-local potential term should be skipped - if (PARAM.inp.esolver_type != "tddft" || elecstate::H_TDDFT_pw::stype != 1) - { - this->getOperator()->add(nonlocal); - } - else - { - delete nonlocal; - } - } - -#ifdef __MLALGO - if (PARAM.inp.deepks_scf) - { - Operator* deepks = new DeePKS>(this->hsk, - this->kv->kvec_d, - hR, - &ucell, - &grid_d, - two_center_bundle.overlap_orb_alpha.get(), - &orb, - this->kv->get_nks(), - DM_in, - ld_in); - this->getOperator()->add(deepks); - this->V_delta_R = dynamic_cast>*>(deepks)->get_V_delta_R(); - } -#endif - // TDDFT_velocity_gauge - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) - { - Operator* td_ekinetic = new TDEkinetic>(this->hsk, - this->hR, - this->kv, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.overlap_orb.get()); - this->getOperator()->add(td_ekinetic); - - Operator* td_nonlocal = new TDNonlocal>(this->hsk, - this->kv->kvec_d, - this->hR, - &ucell, - orb, - &grid_d); - this->getOperator()->add(td_nonlocal); - } - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 2) - { - Operator* td_pot_hybrid = new TD_pot_hybrid>(this->hsk, - this->kv, - this->hR, - this->sR, - orb, - &ucell, - orb.cutoffs(), - &grid_d, - two_center_bundle.kinetic_orb.get()); - this->getOperator()->add(td_pot_hybrid); - } - if (PARAM.inp.dft_plus_u) - { - Operator* dftu = nullptr; - if (PARAM.inp.dft_plus_u == 2) - { - dftu = new OperatorDFTU>(this->hsk, - this->kv->kvec_d, - this->hR, // no explicit call yet - this->kv->isk); - } - else - { - dftu = new DFTU>(this->hsk, - this->kv->kvec_d, - this->hR, - ucell, - &grid_d, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs(), - &GlobalC::dftu); - } - this->getOperator()->add(dftu); - } - if (PARAM.inp.sc_mag_switch) - { - Operator* sc_lambda = new DeltaSpin>(this->hsk, - this->kv->kvec_d, - this->hR, - ucell, - &grid_d, - two_center_bundle.overlap_orb_onsite.get(), - orb.cutoffs()); - this->getOperator()->add(sc_lambda); - spinconstrain::SpinConstrain& sc = spinconstrain::SpinConstrain::getScInstance(); - sc.set_operator(sc_lambda); - } - } - -#ifdef __EXX - if (GlobalC::exx_info.info_global.cal_exx) - { - // Peize Lin add 2016-12-03 - // set xc type before the first cal of xc in pelec->init_scf - // and calculate Cs, Vs - Operator* exx = new OperatorEXX>(this->hsk, - this->hR, - ucell, - *kv, - Hexxd, - Hexxc, - Add_Hexx_Type::R, - istep, - exx_two_level_step, - !GlobalC::restart.info_load.restart_exx - && GlobalC::restart.info_load.load_H); - this->getOperator()->add(exx); - } -#endif - - // if NSPIN==2, HR should be separated into two parts, save HR into this->hRS2 - int memory_fold = 1; - if (PARAM.inp.nspin == 2) - { - this->hRS2.resize(this->hR->get_nnr() * 2); - this->hR->allocate(this->hRS2.data(), 0); - memory_fold = 2; - } - - ModuleBase::Memory::record("HamiltLCAO::hR", this->hR->get_memory_size() * memory_fold); - ModuleBase::Memory::record("HamiltLCAO::sR", this->sR->get_memory_size()); - - return; -} - -// case for multi-k-points -template -void HamiltLCAO::matrix(MatrixBlock& hk_in, MatrixBlock& sk_in) -{ - auto op = dynamic_cast*>(this->getOperator()); - assert(op != nullptr); - op->matrixHk(hk_in, sk_in); -} - -template -void HamiltLCAO::updateHk(const int ik) -{ - ModuleBase::TITLE("HamiltLCAO", "updateHk"); - ModuleBase::timer::tick("HamiltLCAO", "updateHk"); - - // update global spin index - if (PARAM.inp.nspin == 2) - { - // if Veff is added and current_spin is changed, refresh HR - if (PARAM.inp.vl_in_h && this->kv->isk[ik] != this->current_spin) - { - // change data pointer of HR - this->hR->allocate(this->hRS2.data() + this->hRS2.size() / 2 * this->kv->isk[ik], 0); - if (this->refresh_times > 0) - { - this->refresh_times--; - dynamic_cast*>(this->ops)->set_hr_done(false); - } - } - this->current_spin = this->kv->isk[ik]; - } - this->getOperator()->init(ik); - ModuleBase::timer::tick("HamiltLCAO", "updateHk"); -} - -template -void HamiltLCAO::refresh() -{ - ModuleBase::TITLE("HamiltLCAO", "refresh"); - dynamic_cast*>(this->ops)->set_hr_done(false); - if (PARAM.inp.nspin == 2) - { - this->refresh_times = 1; - this->current_spin = 0; - if (this->hR->get_nnr() != this->hRS2.size() / 2) - { - // operator has changed, resize hRS2 - this->hRS2.resize(this->hR->get_nnr() * 2); - } - this->hR->allocate(this->hRS2.data(), 0); - } -} - -// get Operator base class pointer -template -Operator*& HamiltLCAO::getOperator() -{ - return this->ops; -} - -template -void HamiltLCAO::updateSk( - const int ik, - const int hk_type) -{ - ModuleBase::TITLE("HamiltLCAO", "updateSk"); - ModuleBase::timer::tick("HamiltLCAO", "updateSk"); - - ModuleBase::GlobalFunc::ZEROS(this->getSk(), this->get_size_hsk()); - - if (hk_type == 1) // collumn-major matrix for SK - { - const int nrow = this->hsk->get_pv()->get_row_size(); - hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], nrow, 1); - } - else if (hk_type == 0) // row-major matrix for SK - { - const int ncol = this->hsk->get_pv()->get_col_size(); - hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], ncol, 0); - } - else - { - ModuleBase::WARNING_QUIT("updateSk","the value of hk_type is incorrect."); - } - - ModuleBase::timer::tick("HamiltLCAO", "updateSk"); -} - -// case for nspin<4, gamma-only k-point -template class HamiltLCAO; -// case for nspin<4, multi-k-points -template class HamiltLCAO, double>; -// case for nspin == 4, non-collinear spin case -template class HamiltLCAO, std::complex>; -} // namespace hamilt diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt deleted file mode 100644 index 0e49a9dc43..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -add_library( - operator_ks_lcao - OBJECT - op_exx_lcao.cpp - op_dftu_lcao.cpp - meta_lcao.cpp - veff_lcao.cpp - deepks_lcao.cpp - overlap_new.cpp - ekinetic_new.cpp - nonlocal_new.cpp - td_ekinetic_lcao.cpp - td_nonlocal_lcao.cpp - td_pot_hybrid.cpp - dspin_lcao.cpp - dftu_lcao.cpp -) - -if(ENABLE_COVERAGE) - add_coverage(operator_ks_lcao) -endif() - -IF (BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() -endif() diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp deleted file mode 100644 index ca94601fa9..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ /dev/null @@ -1,296 +0,0 @@ -#include "operator_lcao.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_hsolver/hsolver_lcao.h" - -#include "module_parameter/parameter.h" - -#ifdef __ELPA -#include "source_hsolver/diago_elpa.h" -#include "source_hsolver/diago_elpa_native.h" -#endif - -#include "module_hamilt_lcao/module_tddft/td_info.h" - -namespace hamilt { - -template <> -void OperatorLCAO::get_hs_pointers() { - ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); - this->hmatrix_k = this->hsk->get_hk(); - if ((this->new_e_iteration && ik == 0) || PARAM.inp.out_mat_hs[0]) - { - if (this->smatrix_k == nullptr) - { - this->smatrix_k = new double[this->hsk->get_size()]; - this->allocated_smatrix = true; - } - const int inc = 1; - BlasConnector::copy(this->hsk->get_size(), this->hsk->get_sk(), inc, this->smatrix_k, inc); -#ifdef __ELPA - hsolver::DiagoElpa::DecomposedState = 0; - hsolver::DiagoElpaNative::DecomposedState = 0; -#endif - this->new_e_iteration = false; - } - ModuleBase::timer::tick("OperatorLCAO", "get_hs_pointers"); -} - -template<> -void OperatorLCAO, double>::get_hs_pointers() -{ - this->hmatrix_k = this->hsk->get_hk(); - this->smatrix_k = this->hsk->get_sk(); -} - -template<> -void OperatorLCAO, std::complex>::get_hs_pointers() -{ - this->hmatrix_k = this->hsk->get_hk(); - this->smatrix_k = this->hsk->get_sk(); -} - -template -void OperatorLCAO::refresh_h() -{ - // Set the matrix 'H' to zero. - this->hsk->set_zero_hk(); -} - -template -void OperatorLCAO::set_hr_done(bool hr_done_in) { - this->hr_done = hr_done_in; -} - -template -void OperatorLCAO::set_current_spin(const int current_spin_in) -{ - this->current_spin = current_spin_in; - if(this->next_op != nullptr) - { - dynamic_cast*>(this->next_op)->set_current_spin(current_spin_in); - } - if(this->next_sub_op != nullptr) - { - dynamic_cast*>(this->next_sub_op)->set_current_spin(current_spin_in); - } -} - -template -void OperatorLCAO::init(const int ik_in) { - ModuleBase::TITLE("OperatorLCAO", "init"); - ModuleBase::timer::tick("OperatorLCAO", "init"); - if (this->is_first_node) { - // refresh HK - this->refresh_h(); - if (!this->hr_done) { - // refresh HR - this->hR->set_zero(); - } - } - switch (this->cal_type) { - case calculation_type::lcao_overlap: { - // cal_type=lcao_overlap refer to overlap matrix operators, which are - // only rely on stucture, and not changed during SCF - - if (!this->hr_done) { - // update SR first - // in cal_type=lcao_overlap, SR should be updated by each sub-chain - // nodes - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - } - - // update SK next - // in cal_type=lcao_overlap, SK should be update here - this->contributeHk(ik_in); - - break; - } - case calculation_type::lcao_fixed: { - // cal_type=lcao_fixed refer to fixed matrix operators, which are only - // rely on stucture, and not changed during SCF - - // update HR first - if (!this->hr_done) { - // in cal_type=lcao_fixed, HR should be updated by each sub-chain - // nodes - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - } - - // update HK next - // in cal_type=lcao_fixed, HK will update in the last node with - // OperatorLCAO::contributeHk() - - break; - } - case calculation_type::lcao_gint: { - // cal_type=lcao_gint refer to grid integral operators, which are relied - // on stucture and potential based on real space grids and should be - // updated each SCF steps - - if (!this->hr_done) { - OperatorLCAO* last = this; - while (last != nullptr) { - // update HR first - // in cal_type=lcao_gint, HR should be updated by every - // sub-node. - last->contributeHR(); - - // update HK next - // in cal_type=lcao_gint, HK will update in the last node with - // OperatorLCAO::contributeHk() - last = dynamic_cast*>(last->next_sub_op); - } - } - - break; - } -#ifdef __MLALGO - case calculation_type::lcao_deepks: { - // update HR first - if (!this->hr_done) { - // in cal_type=lcao_deepks, HR should be updated - this->contributeHR(); - } - - // update V_delta in k space next - this->contributeHk(ik_in); - - break; - } -#endif - case calculation_type::lcao_dftu: - { - //only HK should be updated when cal_type=lcao_dftu - //in cal_type=lcao_dftu, HK only need to update from one node - if(!this->hr_done) - { - //in cal_type=lcao_deepks, HR should be updated - this->contributeHR(); - } - break; - } - case calculation_type::lcao_sc_lambda: - { - //update HR first - this->contributeHR(); - //in cal_type=lcao_sc_mag, - //this->contributeHk(ik_in); - break; - } - case calculation_type::lcao_exx: - { - //update HR first - if (!this->hr_done) - { - this->contributeHR(); - } - - //update HK next - //in cal_type=lcao_exx, HK only need to update from one node - // this->contributeHk(ik_in); - - break; - } - case calculation_type::lcao_tddft_periodic: { - if (!this->hr_done) { - // in cal_type=lcao_fixed, HR should be updated by each sub-chain - // nodes - OperatorLCAO* last = this; - while (last != nullptr) { - last->contributeHR(); - last = dynamic_cast*>(last->next_sub_op); - } - } - this->contributeHk(ik_in); - - break; - } - default: { - ModuleBase::WARNING_QUIT("OperatorLCAO::init", "unknown cal_type"); - break; - } - } - if (this->next_op - != nullptr) { // it is not the last node, loop next init() function - // pass HR status to next node and than set HR status of this node to - // done - if (!this->hr_done) { - dynamic_cast*>(this->next_op)->hr_done - = this->hr_done; - } - // call init() function of next node - this->next_op->init(ik_in); - } else { // it is the last node, update HK with the current total HR - OperatorLCAO::contributeHk(ik_in); - } - - // set HR status of this node to done - this->hr_done = true; - - ModuleBase::timer::tick("OperatorLCAO", "init"); -} - -// contributeHk() -template <> -void OperatorLCAO::contributeHk(int ik) { - ModuleBase::TITLE("OperatorLCAO", "contributeHk"); - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); - if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); -} -// contributeHk() -template -void OperatorLCAO::contributeHk(int ik) { - ModuleBase::TITLE("OperatorLCAO", "contributeHk"); - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); - if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - else - { - hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - } - ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); -} - -template class OperatorLCAO; -template class OperatorLCAO, double>; -template class OperatorLCAO, std::complex>; -} // namespace hamilt diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp deleted file mode 100644 index f96f8fd67f..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp +++ /dev/null @@ -1,271 +0,0 @@ -#include "overlap_new.h" - -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include -#include "module_hamilt_lcao/module_tddft/td_info.h" - -template -hamilt::OverlapNew>::OverlapNew(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - hamilt::HContainer* SR_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_cutoff_(orb_cutoff), intor_(intor) -{ - this->cal_type = calculation_type::lcao_overlap; - this->ucell = ucell_in; - this->SR = SR_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); - assert(this->SR != nullptr); -#endif - // initialize SR to allocate sparse overlap matrix memory - this->initialize_SR(GridD_in); -} - -// initialize_SR() -template -void hamilt::OverlapNew>::initialize_SR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("OverlapNew", "initialize_SR"); - ModuleBase::timer::tick("OverlapNew", "initialize_SR"); - auto* paraV = this->SR->get_paraV(); // get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1=0; - int I1=0; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index = adjs.box[ad]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index).norm() * this->ucell->lat0 - >= orb_cutoff_[T1] + orb_cutoff_[T2]) - { - continue; - } - hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); - SR->insert_pair(tmp); - } - } - // allocate the memory of BaseMatrix in SR, and set the new values to zero - SR->allocate(nullptr, true); - ModuleBase::timer::tick("OverlapNew", "initialize_SR"); -} - -template -void hamilt::OverlapNew>::calculate_SR() -{ - ModuleBase::TITLE("OverlapNew", "calculate_SR"); - ModuleBase::timer::tick("OverlapNew", "calculate_SR"); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iap = 0; iap < this->SR->size_atom_pairs(); ++iap) - { - hamilt::AtomPair& tmp = this->SR->get_atom_pair(iap); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - const Parallel_Orbitals* paraV = tmp.get_paraV(); - - for (int iR = 0; iR < tmp.get_R_size(); ++iR) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(iR); - auto dtau = ucell->cal_dtau(iat1, iat2, R_index); - TR* data_pointer = tmp.get_pointer(iR); - this->cal_SR_IJR(iat1, iat2, paraV, dtau, data_pointer); - } - } - // if TK == double, then SR should be fixed to gamma case - // judge type of TK equal to double - if (std::is_same::value) - { - this->SR->fix_gamma(); - } - ModuleBase::timer::tick("OverlapNew", "calculate_SR"); -} - -// cal_SR_IJR() -template -void hamilt::OverlapNew>::cal_SR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* data_pointer) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1=0; - int I1=0; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2=0; - int I2=0; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - - // --------------------------------------------- - // calculate the overlap matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, olm); - for (int ipol = 0; ipol < npol; ipol++) - { - data_pointer[ipol * step_trace] += olm[0]; - } - data_pointer += npol; - } - data_pointer += (npol - 1) * col_indexes.size(); - } -} - -// contributeHR() -template -void hamilt::OverlapNew>::contributeHR() -{ - if (this->SR_fixed_done) - { - return; - } - this->calculate_SR(); - this->SR_fixed_done = true; -} - -// contributeHk() -template <> -void hamilt::OverlapNew>::contributeHk(int ik) -{ - //! if k vector is not changed, then do nothing and return, only for gamma_only case - if (this->kvec_d[ik] == this->kvec_d_old) - { - return; - } - ModuleBase::TITLE("OverlapNew", "contributeHk"); - ModuleBase::timer::tick("OverlapNew", "contributeHk"); - - //! set SK to zero and then calculate SK for each k vector - this->hsk->set_zero_sk(); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); - } - - // update kvec_d_old - this->kvec_d_old = this->kvec_d[ik]; - - ModuleBase::timer::tick("OverlapNew", "contributeHk"); -} -template -void hamilt::OverlapNew>::contributeHk(int ik) -{ - ModuleBase::TITLE("OverlapNew", "contributeHk"); - ModuleBase::timer::tick("OverlapNew", "contributeHk"); - - //! set SK to zero and then calculate SK for each k vector - this->hsk->set_zero_sk(); - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); - } - else - { - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); - } - } - else - { - const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); - if(PARAM.inp.td_stype == 2) - { - TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); - } - else - { - hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); - } - } - - // update kvec_d_old - this->kvec_d_old = this->kvec_d[ik]; - - ModuleBase::timer::tick("OverlapNew", "contributeHk"); -} -template -TK* hamilt::OverlapNew>::getSk() -{ - if (this->hsk != nullptr) - { - return this->hsk->get_sk(); - } - return nullptr; -} - -template class hamilt::OverlapNew>; -template class hamilt::OverlapNew, double>>; -template class hamilt::OverlapNew, std::complex>>; diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp deleted file mode 100644 index 2b202b7811..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp +++ /dev/null @@ -1,406 +0,0 @@ -#include "td_ekinetic_lcao.h" - -#include "module_parameter/parameter.h" -#include "source_base/global_variable.h" -#include "source_base/libm/libm.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace hamilt -{ -template -TDEkinetic>::TDEkinetic(HS_Matrix_K* hsk_in, - hamilt::HContainer* hR_in, - const K_Vectors* kv_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), orb_cutoff_(orb_cutoff), kv(kv_in), intor_(intor) -{ - this->ucell = ucell_in; - this->cal_type = calculation_type::lcao_tddft_periodic; - this->Grid = GridD_in; - // initialize HR to get adjs info. - this->initialize_HR(Grid); -} - -template -TDEkinetic>::~TDEkinetic() -{ - if (this->hR_tmp != nullptr) - { - delete this->hR_tmp; - } - TD_info::td_vel_op = nullptr; -} - -// term A^2*S -template -void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc, - const TR& overlap, - int nnr) -{ - // the correction term A^2/2. From Hatree to Ry, it needs to be multiplied by 2.0 - Hloc[nnr] += cart_At.norm2() * overlap; - return; -} -// term A dot āˆ‡ -template -void TDEkinetic>::td_ekinetic_grad(std::complex* Hloc, - int nnr, - ModuleBase::Vector3 grad_overlap) -{ - // the correction term -iA dot āˆ‡r - //āˆ‡ refer to the integral āˆ«šœ™(š‘Ÿ)šœ•/šœ•š‘Ÿšœ™(š‘Ÿāˆ’š‘…)š‘‘š‘Ÿ,but abacus only provide the integral of āˆ«šœ™(š‘Ÿ)šœ•/šœ•Ršœ™(š‘Ÿāˆ’š‘…)š‘‘š‘Ÿ. An extra - //minus must be counted in. The final term is iA dot āˆ‡R. From Hatree to Ry, it needs to be multiplied by 2.0 - std::complex tmp = {0, grad_overlap * cart_At}; - Hloc[nnr] += tmp * 2.0; - return; -} - -template -void TDEkinetic>::calculate_HR() -{ - ModuleBase::TITLE("TDEkinetic", "calculate_HR"); - if (this->hR_tmp == nullptr || this->hR_tmp->size_atom_pairs() <= 0) - { - ModuleBase::WARNING_QUIT("TDEkinetic::calculate_HR", "hR_tmp is nullptr or empty"); - } - ModuleBase::timer::tick("TDEkinetic", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_all[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - hamilt::BaseMatrix>* tmp = this->hR_tmp->find_matrix(iat1, iat2, R_index2); - if (tmp != nullptr) - { - if (TD_info::out_current) - { - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); - } - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_c); - } - else - { - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), nullptr); - } - } - else - { - ModuleBase::WARNING_QUIT("TDEkinetic::calculate_HR", "R_index not found in HR"); - } - } - } - ModuleBase::timer::tick("TDEkinetic", "calculate_HR"); -} - -template -void TDEkinetic>::cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex* hr_mat_p, - std::complex** current_mat_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1=0; - int I1=0; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2=0; - int I2=0; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - // --------------------------------------------- - // get tau1 (in cell <0,0,0>) and tau2 (in cell R) - // in principle, only dtau is needed in this function - // snap_psipsi should be refactored to use dtau directly - // --------------------------------------------- - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double grad[3] = {0, 0, 0}; - double overlap = 0; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - // calculate , which equals to -. - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, &overlap, grad); - ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); - - for (int ipol = 0; ipol < npol; ipol++) - { - // key change - td_ekinetic_scalar(hr_mat_p, overlap, ipol * step_trace); - td_ekinetic_grad(hr_mat_p, ipol * step_trace, grad_overlap); - } - hr_mat_p += npol; - // current grad part - if (current_mat_p != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - for (int ipol = 0; ipol < npol; ipol++) - { - // part of Momentum operator, -iāˆ‡r,used to calculate the current - // here is actually iāˆ‡R - current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); - // part of Momentum operator, eA,used to calculate the current - current_mat_p[dir][ipol * step_trace] += std::complex(overlap * cart_At[dir], 0); - } - current_mat_p[dir] += npol; - } - } - } - hr_mat_p += (npol - 1) * col_indexes.size(); - if (current_mat_p != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } - } -} -//update vector potential for td_ekintic term -template -void TDEkinetic>::update_td() -{ - //std::cout<<"velocity"<cart_At = TD_info::td_vel_op->cart_At; -} - -template -void hamilt::TDEkinetic>::set_HR_fixed(void* hR_tmp_in) -{ - this->hR_tmp = static_cast>*>(hR_tmp_in); - this->allocated = false; -} -template -void TDEkinetic>::initialize_HR(const Grid_Driver* GridD) -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDEkinetic", "initialize_HR"); - ModuleBase::timer::tick("TDEkinetic", "initialize_HR"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + orb_cutoff_[T2]) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - } - ModuleBase::timer::tick("TDEkinetic", "initialize_HR"); -} -template -void TDEkinetic>::initialize_HR_tmp() -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDEkinetic", "initialize_HR_tmp"); - ModuleBase::timer::tick("TDEkinetic", "initialize_HR_tmp"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - for (int i = 0; i < this->hR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = this->hR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - this->hR_tmp->insert_pair(tmp1); - } - } - this->hR_tmp->allocate(nullptr, true); - - ModuleBase::timer::tick("TDEkinetic", "initialize_HR_tmp"); -} - -template -void TDEkinetic>::contributeHR() -{ - // const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); - ModuleBase::TITLE("TDEkinetic", "contributeHR"); - ModuleBase::timer::tick("TDEkinetic", "contributeHR"); - // skip if not TDDFT velocity gauge - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - if (!this->hR_tmp_done || TD_info::evolve_once) - { - const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); - // if this Operator is the first node of the sub_chain, then hR_tmp is nullptr - if (this->hR_tmp == nullptr) - { - this->hR_tmp = new hamilt::HContainer>(this->hR->get_paraV()); - // allocate memory for hR_tmp use the same memory as hR - this->initialize_HR_tmp(); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of hR_tmp to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); - } - // initialize current term if needed - if (TD_info::out_current) - { - TD_info::td_vel_op->initialize_current_term(this->hR_tmp, paraV); - } - // calculate the values in hR_tmp - this->update_td(); - this->hR_tmp->set_zero(); - this->calculate_HR(); - this->hR_tmp_done = true; - } - - ModuleBase::timer::tick("TDEkinetic", "contributeHR"); - return; -} - -template -void TDEkinetic>::contributeHk(int ik) -{ - if (PARAM.inp.td_stype != 1) - { - return; - } - else - { - ModuleBase::TITLE("TDEkinetic", "contributeHk"); - ModuleBase::timer::tick("TDEkinetic", "contributeHk"); - const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); - // save HR data for output - int spin_tot = PARAM.inp.nspin; - if (!output_hR_done && TD_info::out_mat_R) - { - for (int spin_now = 0; spin_now < spin_tot; spin_now++) - { - sparse_format::cal_HContainer_cd(*(paraV), - spin_now, - 1e-10, - *hR_tmp, - TD_info::td_vel_op->HR_sparse_td_vel[spin_now]); - } - output_hR_done = true; - } - // folding inside HR to HK - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = paraV->get_row_size(); - hamilt::folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = paraV->get_col_size(); - hamilt::folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - - ModuleBase::timer::tick("TDEkinetic", "contributeHk"); - } -} - -template class TDEkinetic, double>>; -template class TDEkinetic, std::complex>>; - -} // namespace hamilt diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h deleted file mode 100644 index 310504aa07..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef TDEKINETIC_H -#define TDEKINETIC_H -#include "source_base/timer.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "operator_lcao.h" -#include - - -namespace hamilt -{ - -#ifndef __TDEKINETICTEMPLATE -#define __TDEKINETICTEMPLATE - -/// The TDEkinetic class template inherits from class T -/// It is used to calculate correction term of kinetic energy in time-dependent DFT -template -class TDEkinetic : public T -{ -}; - -#endif - -/// TDEkinetic class template specialization for OperatorLCAO base class -/// It is used to calculate correction term of kinetic energy in time-dependent DFT -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian - -template -class TDEkinetic> : public OperatorLCAO -{ - public: - TDEkinetic>(HS_Matrix_K* hsk_in, - hamilt::HContainer* hR_in, - const K_Vectors* kv_in, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - ~TDEkinetic(); - - virtual void contributeHR() override; - - virtual void contributeHk(int ik) override; - - /// @brief update vector potential - void update_td(); - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD); - - /** - * @brief initialize HR_tmp - * Allocate the memory for HR_tmp with the same size as HR - */ - void initialize_HR_tmp(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex* hr_mat_p, - std::complex** current_mat_p); - - /** - * @brief calculate the ekinetic matrix correction term in tddft with specific atom-pairs - * nearest neighbor atoms don't need to be calculated again - * loop the atom-pairs in HR and calculate the ekinetic matrix - */ - void calculate_HR(); - - virtual void set_HR_fixed(void*) override; - - - private: - - const UnitCell* ucell = nullptr; - - std::vector orb_cutoff_; - - HContainer* SR = nullptr; - - /// @brief Store real space hamiltonian. TD term should include imaginary part, - /// thus it has to be complex type. Only shared between TD operators. - HContainer>* hR_tmp = nullptr; - - const Grid_Driver* Grid = nullptr; - - const K_Vectors* kv; - - /// @brief correction term i A nabla - void td_ekinetic_scalar(std::complex* Hloc, const TR& Sloc, int nnr); - - /// @brief correction term A^2*S - void td_ekinetic_grad(std::complex* Hloc, int nnr, ModuleBase::Vector3 grad_overlap); - - const TwoCenterIntegrator* intor_ = nullptr; - - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; - - bool hR_tmp_done = false; - - bool allocated = false; - - bool output_hR_done = false; -}; - -} // namespace hamilt -#endif - diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp deleted file mode 100644 index 391dca66f0..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp +++ /dev/null @@ -1,447 +0,0 @@ -#include "td_nonlocal_lcao.h" - -#include "module_parameter/parameter.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" -#include "source_pw/hamilt_pwdft/global.h" -#ifdef _OPENMP -#include -#include -#endif - -template -hamilt::TDNonlocal>::TDNonlocal(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const LCAO_Orbitals& orb, - const Grid_Driver* GridD_in) - : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_(orb) -{ - this->cal_type = calculation_type::lcao_tddft_periodic; - this->ucell = ucell_in; - this->Grid = GridD_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); -#endif - // initialize HR to get adjs info. - this->initialize_HR(Grid); -} - -// destructor -template -hamilt::TDNonlocal>::~TDNonlocal() -{ - if (this->allocated) - { - delete this->hR_tmp; - } -} -template -void hamilt::TDNonlocal>::update_td() -{ - // calculate At in cartesian coorinates. - this->cart_At = TD_info::td_vel_op->cart_At; -} -// initialize_HR() -template -void hamilt::TDNonlocal>::initialize_HR(const Grid_Driver* GridD) -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDNonlocal", "initialize_HR"); - ModuleBase::timer::tick("TDNonlocal", "initialize_HR"); - - this->adjs_all.clear(); - this->adjs_all.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - } - - ModuleBase::timer::tick("TDNonlocal", "initialize_HR"); -} - -// initialize_HR_tmp() -template -void hamilt::TDNonlocal>::initialize_HR_tmp(const Parallel_Orbitals* paraV) -{ - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - ModuleBase::TITLE("TDNonlocal", "initialize_HR_tmp"); - ModuleBase::timer::tick("TDNonlocal", "initialize_HR_tmp"); - - for (int i = 0; i < this->hR->size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = this->hR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - this->hR_tmp->insert_pair(tmp1); - } - } - this->hR_tmp->allocate(nullptr, true); - - ModuleBase::timer::tick("TDNonlocal", "initialize_HR_tmp"); -} - -template -void hamilt::TDNonlocal>::calculate_HR() -{ - ModuleBase::TITLE("TDNonlocal", "calculate_HR"); - ModuleBase::timer::tick("TDNonlocal", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - const int nlm_dim = TD_info::out_current ? 4 : 1; - // 1. calculate for each pair of atoms - - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - const auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - const AdjacentAtomInfo& adjs = this->adjs_all[iat0]; - std::vector>>>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - for (int i = 0; i < adjs.adj_num + 1; i++) - { - nlm_tot[i].resize(nlm_dim); - } - - #pragma omp parallel - { - #pragma omp for schedule(dynamic) - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - std::vector>> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false - // and size of outer vector is 4 when out_current is true (3 for , 1 for - // ) inner loop : all projectors (L0,M0) - - // snap_psibeta_half_tddft() are used to calculate - // and as well if current are needed - module_tddft::snap_psibeta_half_tddft(orb_, - this->ucell->infoNL, - nlm, - tau1 * this->ucell->lat0, - T1, - atom1->iw2l[iw1], - atom1->iw2m[iw1], - atom1->iw2n[iw1], - tau0 * this->ucell->lat0, - T0, - cart_At, - TD_info::out_current); - for (int dir = 0; dir < nlm_dim; dir++) - { - nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); - } - } - } - -#ifdef _OPENMP - // record the iat number of the adjacent atoms - std::set ad_atom_set; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - ad_atom_set.insert(iat1); - } - - // split the ad_atom_set into num_threads parts - const int num_threads = omp_get_num_threads(); - const int thread_id = omp_get_thread_num(); - std::set ad_atom_set_thread; - int i = 0; - for(const auto iat1 : ad_atom_set) - { - if (i % num_threads == thread_id) - { - ad_atom_set_thread.insert(iat1); - } - i++; - } -#endif - - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - -#ifdef _OPENMP - if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) - { - continue; - } -#endif - - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - const ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - hamilt::BaseMatrix>* tmp - = this->hR_tmp->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]); - // if not found , skip this pair of atoms - if (tmp != nullptr) - { - if (TD_info::out_current) - { - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i) - ->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]) - ->get_pointer(); - } - this->cal_HR_IJR(iat1, - iat2, - T0, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - tmp->get_pointer(), - tmp_c); - } - else - { - this->cal_HR_IJR(iat1, - iat2, - T0, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - tmp->get_pointer(), - nullptr); - } - } - } - } - } - } - - ModuleBase::timer::tick("TDNonlocal", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::TDNonlocal>::cal_HR_IJR( - const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>>& nlm1_all, - const std::vector>>>& nlm2_all, - std::complex* data_pointer, - std::complex** data_pointer_c) -{ - const int nlm_dim = TD_info::out_current ? 4 : 1; - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = col_indexes.size() * is + is2; - } - } - // calculate the local matrix - const std::complex* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); - std::vector>*> nlm1; - for (int dir = 0; dir < nlm_dim; dir++) - { - nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); - } - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - std::vector>*> nlm2; - for (int dir = 0; dir < nlm_dim; dir++) - { - nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); - } -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - std::complex nlm_tmp = std::complex{0, 0}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - nlm_tmp += nlm1[0]->at(p1) * std::conj(nlm2[0]->at(p2)) * (*tmp_d); - } - data_pointer[step_trace[is]] += nlm_tmp; - if (data_pointer_c != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - std::complex nlm_r_tmp = std::complex{0, 0}; - std::complex imag_unit = std::complex{0, 1}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - //- - // multiply d in the end - nlm_r_tmp += (nlm1[dir + 1]->at(p1) * std::conj(nlm2[0]->at(p2)) - - nlm1[0]->at(p1) * std::conj(nlm2[dir + 1]->at(p2))) - * (*tmp_d); - } - // -i[r,Vnl], 2.0 due to the unit transformation - data_pointer_c[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; - } - } - } - data_pointer += npol; - if (data_pointer_c != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - data_pointer_c[dir] += npol; - } - } - } - data_pointer += (npol - 1) * col_indexes.size(); - if (data_pointer_c != nullptr) - { - for (int dir = 0; dir < 3; dir++) - { - data_pointer_c[dir] += (npol - 1) * col_indexes.size(); - } - } - } -} - -// set_hR_tmp() -template -void hamilt::TDNonlocal>::set_HR_fixed(void* hR_tmp_in) -{ - this->hR_tmp = static_cast>*>(hR_tmp_in); - this->allocated = false; -} - - -// contributeHR() -template -void hamilt::TDNonlocal>::contributeHR() -{ - ModuleBase::TITLE("TDNonlocal", "contributeHR"); - - if (elecstate::H_TDDFT_pw::stype != 1) - { - return; - } - - ModuleBase::timer::tick("TDNonlocal", "contributeHR"); - - if (!this->hR_tmp_done || TD_info::evolve_once) - { - if (this->hR_tmp == nullptr) - { - this->hR_tmp = new hamilt::HContainer>(this->hsk->get_pv()); - // allocate memory for hR_tmp use the same memory as hR - this->initialize_HR_tmp(this->hsk->get_pv()); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of hR_tmp to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); - } - - // calculate the values in hR_tmp - this->update_td(); - this->calculate_HR(); - this->hR_tmp_done = true; - TD_info::evolve_once = false; - } - - ModuleBase::timer::tick("TDNonlocal", "contributeHR"); - return; -} - - -template -void hamilt::TDNonlocal>::contributeHk(int ik) -{ - return; -} - -template class hamilt::TDNonlocal, double>>; -template class hamilt::TDNonlocal, std::complex>>; diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h deleted file mode 100644 index d89e7b38e5..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef TDNONLOCAL_H -#define TDNONLOCAL_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" - -#include - -namespace hamilt -{ - -#ifndef __TD_NONLOCALTEMPLATE -#define __TD_NONLOCALTEMPLATE - -/// The TDNonlocal class template inherits from class T -/// It is used to calculate correction term of non-local pseudopotential in time-dependent DFT -template -class TDNonlocal : public T -{ -}; - -#endif - -/// TDNonlocal class template specialization for OperatorLCAO base class -/// It is used to calculate correction term of non-local pseudopotential in time-dependent DFT -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class TDNonlocal> : public OperatorLCAO -{ - public: - TDNonlocal>(HS_Matrix_K* hsk_in, - const std::vector>& kvec_d_in, - hamilt::HContainer* hR_in, - const UnitCell* ucell_in, - const LCAO_Orbitals& orb, - const Grid_Driver* GridD_in); - ~TDNonlocal>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * D_{p1, p2} - */ - virtual void contributeHR() override; - virtual void contributeHk(int ik) override; - - virtual void set_HR_fixed(void*) override; - - private: - const UnitCell* ucell = nullptr; - const LCAO_Orbitals& orb_; - - HContainer* HR = nullptr; - /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only - /// shared between TD operators. - HContainer>* hR_tmp = nullptr; - const Grid_Driver* Grid = nullptr; - - bool allocated = false; - - bool hR_tmp_done = false; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD_in); - - /** - * @brief initialize HR_tmp - * Allocate the memory for HR_tmp with the same size as HR - */ - void initialize_HR_tmp(const Parallel_Orbitals* paraV); - /// @brief init vector potential for td_nonlocal term - void update_td(); - /** - * @brief calculate the non-local pseudopotential matrix with specific atom-pairs - * nearest neighbor atoms don't need to be calculated again - * loop the atom-pairs in HR and calculate the non-local pseudopotential matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>>& nlm1_all, - const std::vector>>>& nlm2_all, - std::complex* data_pointer, - std::complex** data_pointer_c); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; - /// @brief Store the vector potential for td_nonlocal term - ModuleBase::Vector3 cart_At; -}; - -} // namespace hamilt -#endif diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp deleted file mode 100644 index 54b5471c5d..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp +++ /dev/null @@ -1,300 +0,0 @@ -#include "td_pot_hybrid.h" - -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/hamilt_pwdft/global.h" - -// Constructor -template -cal_r_overlap_R hamilt::TD_pot_hybrid>::r_calculator; - -template -hamilt::TD_pot_hybrid>::TD_pot_hybrid( - HS_Matrix_K* hsk_in, - const K_Vectors* kv_in, - hamilt::HContainer* hR_in, - hamilt::HContainer* SR_in, - const LCAO_Orbitals& orb, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor) - : hamilt::OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), SR(SR_in), orb_(orb), orb_cutoff_(orb_cutoff), intor_(intor) -{ - this->cal_type = calculation_type::lcao_tddft_periodic; - this->ucell = ucell_in; -#ifdef __DEBUG - assert(this->ucell != nullptr); - assert(this->hsk != nullptr); -#endif - this->init_td(); - // initialize HR to allocate sparse Ekinetic matrix memory - this->initialize_HR(GridD_in); -} - -// destructor -template -hamilt::TD_pot_hybrid>::~TD_pot_hybrid() -{ - if (this->allocated) - { - delete this->HR_fixed; - } - /*if(TD_info::td_vel_op!=nullptr) - { - TD_info::td_vel_op->hk_hybrid = nullptr; - }*/ -} - -// initialize_HR() -template -void hamilt::TD_pot_hybrid>::initialize_HR(const Grid_Driver* GridD) -{ - ModuleBase::TITLE("TD_pot_hybrid", "initialize_HR"); - ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); - - auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR - // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. - - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_cutoff_[T1] + orb_cutoff_[T2]) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_all.push_back(adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index = adjs.box[ad]; - hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); - this->hR->insert_pair(tmp); - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - this->hR->allocate(nullptr, true); - - ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); -} - -template -void hamilt::TD_pot_hybrid>::calculate_HR() -{ - ModuleBase::TITLE("TD_pot_hybrid", "calculate_HR"); - if (this->HR_fixed == nullptr || this->HR_fixed->size_atom_pairs() <= 0) - { - ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "HR_fixed is nullptr or empty"); - } - ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); - - const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_all[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - hamilt::BaseMatrix* tmp = this->HR_fixed->find_matrix(iat1, iat2, R_index2); - hamilt::BaseMatrix* tmp_overlap = this->SR->find_matrix(iat1, iat2, R_index2); - if (tmp != nullptr) - { - this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_overlap->get_pointer()); - } - else - { - ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "R_index not found in HR"); - } - } - } - - ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); -} - -// cal_HR_IJR() -template -void hamilt::TD_pot_hybrid>::cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* hr_mat_p, - TR* sr_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double olm[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - - ModuleBase::Vector3 tmp_r = r_calculator.get_psi_r_psi(tau1 * this->ucell->lat0, T1, L1, m1, N1, tau2 * this->ucell->lat0, T2, L2, m2, N2); - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - for (int ipol = 0; ipol < npol; ipol++) - { - hr_mat_p[ipol * step_trace] += tmp_r * Et; - hr_mat_p[ipol * step_trace] -= ((dtau + tau1) * Et) * sr_p[ipol * step_trace] * this->ucell->lat0; - } - hr_mat_p += npol; - sr_p += npol; - } - hr_mat_p += (npol - 1) * col_indexes.size(); - sr_p += (npol - 1) * col_indexes.size(); - } -} -// init two center integrals and vector potential for td_ekintic term -template -void hamilt::TD_pot_hybrid>::init_td() -{ - // initialize the r_calculator - if(TD_info::td_vel_op->get_istep()==(TD_info::estep_shift-1)) - { - //std::cout << "init_r_overlap" <hR->get_paraV(), orb_); - } - //hk_hybrid.resize(this->hR->get_paraV()->nloc); -} -template -void hamilt::TD_pot_hybrid>::update_td() -{ - //std::cout<<"hybrid gague" <cart_At = TD_info::td_vel_op->cart_At; - //std::cout<<"At: "<< TD_info::td_vel_op->cart_At[0] <<" "<cart_At[1]<<" "<cart_At[2]<<" "< -void hamilt::TD_pot_hybrid>::set_HR_fixed(void* HR_fixed_in) -{ - this->HR_fixed = static_cast*>(HR_fixed_in); - this->allocated = false; -} - -// contributeHR() -template -void hamilt::TD_pot_hybrid>::contributeHR() -{ - ModuleBase::TITLE("TD_pot_hybrid", "contributeHR"); - ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); - - if (!this->HR_fixed_done || TD_info::evolve_once) - { - // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr - if (this->HR_fixed == nullptr) - { - this->HR_fixed = new hamilt::HContainer(*this->hR); - this->HR_fixed->set_zero(); - this->allocated = true; - } - if (this->next_sub_op != nullptr) - { - // pass pointer of HR_fixed to the next node - static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); - } - // calculate the values in HR_fixed - this->update_td(); - this->HR_fixed->set_zero(); - this->calculate_HR(); - this->HR_fixed_done = true; - TD_info::evolve_once = false; - } - // last node of sub-chain, add HR_fixed into HR - if (this->next_sub_op == nullptr) - { - this->hR->add(*(this->HR_fixed)); - } - - ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); - return; -} - -//ETD -// contributeHk() -template -void hamilt::TD_pot_hybrid>::contributeHk(int ik) { - return; -} - -template class hamilt::TD_pot_hybrid, double>>; -template class hamilt::TD_pot_hybrid, std::complex>>; diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h b/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h deleted file mode 100644 index 4d7b577e32..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef TD_POT_HYBRID_H -#define TD_POT_HYBRID_H -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_cell/klist.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include -#include "module_io/cal_r_overlap_R.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "source_estate/module_pot/H_TDDFT_pw.h" - -namespace hamilt -{ - -#ifndef __TD_POT_HYBRIDTEMPLATE -#define __TD_POT_HYBRIDTEMPLATE - -/// The EkineticNew class template inherits from class T -/// it is used to calculate the electronic kinetic -/// Template parameters: -/// - T: base class, it would be OperatorLCAO or OperatorPW -/// - TR: data type of real space Hamiltonian, it would be double or std::complex -template -class TD_pot_hybrid : public T -{ -}; - -#endif - -/// EkineticNew class template specialization for OperatorLCAO base class -/// It is used to calculate the electronic kinetic matrix in real space and fold it to k-space -/// HR = -/// HK = = \sum_{R} e^{ikR} HR -/// Template parameters: -/// - TK: data type of k-space Hamiltonian -/// - TR: data type of real space Hamiltonian -template -class TD_pot_hybrid> : public OperatorLCAO -{ - public: - /** - * @brief Construct a new EkineticNew object - */ - TD_pot_hybrid>(HS_Matrix_K* hsk_in, - const K_Vectors* kv_in, - HContainer* hR_in, - HContainer* SR_in, - const LCAO_Orbitals& orb, - const UnitCell* ucell_in, - const std::vector& orb_cutoff, - const Grid_Driver* GridD_in, - const TwoCenterIntegrator* intor); - - /** - * @brief Destroy the EkineticNew object - */ - ~TD_pot_hybrid>(); - - /** - * @brief contributeHR() is used to calculate the HR matrix - * - */ - virtual void contributeHR() override; - //ETD - virtual void contributeHk(int ik) override; - //ETD - - virtual void set_HR_fixed(void*) override; - - - private: - const UnitCell* ucell = nullptr; - std::vector orb_cutoff_; - const LCAO_Orbitals& orb_; - - hamilt::HContainer* HR_fixed = nullptr; - - hamilt::HContainer* SR = nullptr; - - const TwoCenterIntegrator* intor_ = nullptr; - - bool allocated = false; - - bool HR_fixed_done = false; - //tddft part - static cal_r_overlap_R r_calculator; - //ETD - //std::vector> hk_hybrid; - //ETD - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; - ModuleBase::Vector3 Et; - - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the electronic kinetic matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_HR(const Grid_Driver* GridD_in); - - void init_td(); - void update_td(); - - /** - * @brief calculate the electronic kinetic matrix with specific atom-pairs - * use the adjs_all to calculate the HR matrix - */ - void calculate_HR(); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_HR_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - TR* hr_mat_p, - TR* sr_p); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_all; -}; - -} // namespace hamilt -#endif diff --git a/source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp deleted file mode 100644 index 786d7809f5..0000000000 --- a/source/source_hamilt_lcao/hamilt_lcaodft/spar_hsr.cpp +++ /dev/null @@ -1,454 +0,0 @@ -#include "spar_hsr.h" - -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -#include "module_parameter/parameter.h" -#include "spar_dh.h" -#include "spar_exx.h" -#include "spar_u.h" - -#ifdef __MPI -void sparse_format::sync_all_R_coor(std::set>& all_R_coor, MPI_Comm comm) -{ - int my_rank, nproc; - MPI_Comm_rank(comm, &my_rank); - MPI_Comm_size(comm, &nproc); - - // Step 1: Gather the number of R coordinates from each process - int local_size = all_R_coor.size(); - std::vector recv_counts(nproc, 0); - MPI_Allgather(&local_size, 1, MPI_INT, recv_counts.data(), 1, MPI_INT, comm); - - // Step 2: Calculate the number of integers sent by each process (each R coordinate contains 3 integers) - std::vector recv_counts_elements(nproc); - std::vector displacements(nproc, 0); - int total_size_elements = 0; - - for (int i = 0; i < nproc; ++i) - { - recv_counts_elements[i] = recv_counts[i] * 3; // Number of integers sent by each process - displacements[i] = total_size_elements; - total_size_elements += recv_counts_elements[i]; - } - - // Step 3: Gather the raw data of all R coordinates (each R coordinate is stored as 3 integers) - std::vector local_R_data; - local_R_data.reserve(local_size * 3); - for (const auto& R: all_R_coor) - { - local_R_data.push_back(R.x); - local_R_data.push_back(R.y); - local_R_data.push_back(R.z); - } - - // Step 4: Allocate the receive buffer and call MPI_Allgatherv - std::vector global_R_data(total_size_elements); - MPI_Allgatherv(local_R_data.data(), - local_size * 3, - MPI_INT, - global_R_data.data(), - recv_counts_elements.data(), - displacements.data(), - MPI_INT, - comm); - - // Step 5: Merge to create a global set of R coordinates - std::set> global_R_coor; - for (int i = 0; i < total_size_elements; i += 3) - { - int x = global_R_data[i]; - int y = global_R_data[i + 1]; - int z = global_R_data[i + 2]; - global_R_coor.insert(Abfs::Vector3_Order(x, y, z)); - } - - // Step 6: Update all processes' all_R_coor - all_R_coor = std::move(global_R_coor); -} -#endif // __MPI - -void sparse_format::cal_HSR(const UnitCell& ucell, - const Parallel_Orbitals& pv, - LCAO_HS_Arrays& HS_Arrays, - const Grid_Driver& grid, - const int& current_spin, - const double& sparse_thr, - const int (&nmp)[3], - hamilt::Hamilt>* p_ham -#ifdef __EXX - , - const std::vector>>>* Hexxd, - const std::vector>>>>* Hexxc -#endif -) -{ - ModuleBase::TITLE("sparse_format", "cal_HSR"); - - // sparse_format::set_R_range(HS_Arrays.all_R_coor, grid); - - const int nspin = PARAM.inp.nspin; - - // cal_STN_R_sparse(current_spin, sparse_thr); - if (nspin == 1 || nspin == 2) - { - hamilt::HamiltLCAO, double>* p_ham_lcao - = dynamic_cast, double>*>(p_ham); - - HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); - - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) - { - sparse_format::cal_HContainer_td(pv, - current_spin, - sparse_thr, - *(p_ham_lcao->getHR()), - TD_info::td_vel_op->HR_sparse_td_vel[current_spin]); - } - else - { - - sparse_format::cal_HContainer_d(pv, - current_spin, - sparse_thr, - *(p_ham_lcao->getHR()), - HS_Arrays.HR_sparse[current_spin]); - } - - sparse_format::cal_HContainer_d(pv, current_spin, sparse_thr, *(p_ham_lcao->getSR()), HS_Arrays.SR_sparse); - } - else if (nspin == 4) - { - hamilt::HamiltLCAO, std::complex>* p_ham_lcao - = dynamic_cast, std::complex>*>(p_ham); - - HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); - - sparse_format::cal_HContainer_cd(pv, current_spin, sparse_thr, *(p_ham_lcao->getHR()), HS_Arrays.HR_soc_sparse); - - sparse_format::cal_HContainer_cd(pv, current_spin, sparse_thr, *(p_ham_lcao->getSR()), HS_Arrays.SR_soc_sparse); - } - else - { - ModuleBase::WARNING_QUIT("cal_HSR", "check the value of nspin."); - } - - // only old DFT+U method need to cal extra contribution to HR - if (PARAM.inp.dft_plus_u == 2) - { - if (nspin == 1 || nspin == 2) - { - cal_HR_dftu(pv, HS_Arrays.all_R_coor, HS_Arrays.SR_sparse, HS_Arrays.HR_sparse, current_spin, sparse_thr); - } - else if (nspin == 4) - { - cal_HR_dftu_soc(pv, - HS_Arrays.all_R_coor, - HS_Arrays.SR_soc_sparse, - HS_Arrays.HR_soc_sparse, - current_spin, - sparse_thr); - } - else - { - ModuleBase::WARNING_QUIT("cal_HSR", "check the value of nspin."); - } - } - -#ifdef __EXX -#ifdef __MPI - // if EXX is considered - if (GlobalC::exx_info.info_global.cal_exx) - { - - if (Hexxd && GlobalC::exx_info.info_ri.real_number) - { - - sparse_format::cal_HR_exx(ucell, pv, HS_Arrays, current_spin, sparse_thr, nmp, *Hexxd); - } - else if (Hexxc && !GlobalC::exx_info.info_ri.real_number) - { - - sparse_format::cal_HR_exx(ucell, pv, HS_Arrays, current_spin, sparse_thr, nmp, *Hexxc); - } - } -#endif // __MPI -#endif // __EXX - - sparse_format::clear_zero_elements(HS_Arrays, current_spin, sparse_thr); - - return; -} - -void sparse_format::cal_HContainer_d( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_thr, - const hamilt::HContainer& hR, - std::map, std::map>>& target) -{ - ModuleBase::TITLE("sparse_format", "cal_HContainer_d"); - - auto row_indexes = pv.get_indexes_row(); - auto col_indexes = pv.get_indexes_col(); - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - int atom_i = hR.get_atom_pair(iap).get_atom_i(); - int atom_j = hR.get_atom_pair(iap).get_atom_j(); - int start_i = pv.atom_begin_row[atom_i]; - int start_j = pv.atom_begin_col[atom_j]; - int row_size = pv.get_row_size(atom_i); - int col_size = pv.get_col_size(atom_j); - for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - const auto& value_tmp = matrix.get_value(i, j); - if (std::abs(value_tmp) > sparse_thr) - { - target[dR][mu][nu] = value_tmp; - } - } - } - } - } - - return; -} - -void sparse_format::cal_HContainer_cd( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_thr, - const hamilt::HContainer>& hR, - std::map, std::map>>>& target) -{ - ModuleBase::TITLE("sparse_format", "cal_HContainer_cd"); - - auto row_indexes = pv.get_indexes_row(); - auto col_indexes = pv.get_indexes_col(); - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - int atom_i = hR.get_atom_pair(iap).get_atom_i(); - int atom_j = hR.get_atom_pair(iap).get_atom_j(); - int start_i = pv.atom_begin_row[atom_i]; - int start_j = pv.atom_begin_col[atom_j]; - int row_size = pv.get_row_size(atom_i); - int col_size = pv.get_col_size(atom_j); - for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - const auto& value_tmp = matrix.get_value(i, j); - if (std::abs(value_tmp) > sparse_thr) - { - target[dR][mu][nu] = value_tmp; - } - } - } - } - } - - return; -} - -void sparse_format::cal_HContainer_td( - const Parallel_Orbitals& pv, - const int& current_spin, - const double& sparse_thr, - const hamilt::HContainer& hR, - std::map, std::map>>>& target) -{ - ModuleBase::TITLE("sparse_format", "cal_HContainer_td"); - - auto row_indexes = pv.get_indexes_row(); - auto col_indexes = pv.get_indexes_col(); - for (int iap = 0; iap < hR.size_atom_pairs(); ++iap) - { - int atom_i = hR.get_atom_pair(iap).get_atom_i(); - int atom_j = hR.get_atom_pair(iap).get_atom_j(); - int start_i = pv.atom_begin_row[atom_i]; - int start_j = pv.atom_begin_col[atom_j]; - int row_size = pv.get_row_size(atom_i); - int col_size = pv.get_col_size(atom_j); - for (int iR = 0; iR < hR.get_atom_pair(iap).get_R_size(); ++iR) - { - auto& matrix = hR.get_atom_pair(iap).get_HR_values(iR); - const ModuleBase::Vector3 r_index = hR.get_atom_pair(iap).get_R_index(iR); - Abfs::Vector3_Order dR(r_index.x, r_index.y, r_index.z); - for (int i = 0; i < row_size; ++i) - { - int mu = row_indexes[start_i + i]; - for (int j = 0; j < col_size; ++j) - { - int nu = col_indexes[start_j + j]; - const auto& value_tmp = std::complex(matrix.get_value(i, j), 0.0); - if (std::abs(value_tmp) > sparse_thr) - { - target[dR][mu][nu] += value_tmp; - } - } - } - } - } - - return; -} - -// in case there are elements smaller than the threshold -void sparse_format::clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& current_spin, const double& sparse_thr) -{ - ModuleBase::TITLE("sparse_format", "clear_zero_elements"); - - if (PARAM.inp.nspin != 4) - { - for (auto& R_loop: HS_Arrays.HR_sparse[current_spin]) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } - } - } - if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) - { - for (auto& R_loop: TD_info::td_vel_op->HR_sparse_td_vel[current_spin]) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } - } - } - } - - for (auto& R_loop: HS_Arrays.SR_sparse) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } - } - } - } - else - { - for (auto& R_loop: HS_Arrays.HR_soc_sparse) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } // end while iter - } // end row loop - } // end R loop - - for (auto& R_loop: HS_Arrays.SR_soc_sparse) - { - for (auto& row_loop: R_loop.second) - { - auto& col_map = row_loop.second; - auto iter = col_map.begin(); - while (iter != col_map.end()) - { - if (std::abs(iter->second) <= sparse_thr) - { - col_map.erase(iter++); - } - else - { - iter++; - } - } // end while iter - } // end row_loop - } // end R_loop - } - - return; -} - -void sparse_format::destroy_HS_R_sparse(LCAO_HS_Arrays& HS_Arrays) -{ - ModuleBase::TITLE("sparse_format", "destroy_HS_R_sparse"); - - if (PARAM.inp.nspin != 4) - { - std::map, std::map>> empty_HR_sparse_up; - std::map, std::map>> empty_HR_sparse_down; - std::map, std::map>> empty_SR_sparse; - HS_Arrays.HR_sparse[0].swap(empty_HR_sparse_up); - HS_Arrays.HR_sparse[1].swap(empty_HR_sparse_down); - HS_Arrays.SR_sparse.swap(empty_SR_sparse); - } - else - { - std::map, std::map>>> - empty_HR_soc_sparse; - std::map, std::map>>> - empty_SR_soc_sparse; - HS_Arrays.HR_soc_sparse.swap(empty_HR_soc_sparse); - HS_Arrays.SR_soc_sparse.swap(empty_SR_soc_sparse); - } - - // 'all_R_coor' has a small memory requirement and does not need to be - // deleted. std::set> empty_all_R_coor; - // all_R_coor.swap(empty_all_R_coor); - - return; -} diff --git a/source/source_hamilt_lcao/module_tddft/CMakeLists.txt b/source/source_hamilt_lcao/module_tddft/CMakeLists.txt deleted file mode 100644 index 58bc834a5f..0000000000 --- a/source/source_hamilt_lcao/module_tddft/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -if(ENABLE_LCAO) - list(APPEND objects - evolve_elec.cpp - evolve_psi.cpp - band_energy.cpp - middle_hamilt.cpp - norm_psi.cpp - propagator.cpp - propagator_cn2.cpp - propagator_taylor.cpp - propagator_etrs.cpp - upsi.cpp - td_info.cpp - velocity_op.cpp - snap_psibeta_half_tddft.cpp - td_folding.cpp - solve_propagation.cpp - ) - - add_library( - tddft - OBJECT - ${objects} - ) - - if(ENABLE_COVERAGE) - add_coverage(tddft) - endif() - - IF (BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() - endif() - -endif() diff --git a/source/source_hamilt_lcao/module_tddft/evolve_elec.cpp b/source/source_hamilt_lcao/module_tddft/evolve_elec.cpp deleted file mode 100644 index f9c31081f3..0000000000 --- a/source/source_hamilt_lcao/module_tddft/evolve_elec.cpp +++ /dev/null @@ -1,226 +0,0 @@ -#include "evolve_elec.h" - -#include "evolve_psi.h" -#include "source_base/parallel_reduce.h" -#include "source_base/timer.h" -#include "source_estate/module_charge/symmetry_rho.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace module_tddft -{ -template -Evolve_elec::Evolve_elec(){}; -template -Evolve_elec::~Evolve_elec(){}; - -template -ct::DeviceType Evolve_elec::ct_device_type = ct::DeviceTypeToEnum::value; - -// this routine only serves for TDDFT using LCAO basis set -template -void Evolve_elec::solve_psi(const int& istep, - const int nband, - const int nlocal, - const int& nks, - hamilt::Hamilt>* phm, - Parallel_Orbitals& para_orb, - psi::Psi>* psi, - psi::Psi>* psi_laststep, - std::complex** Hk_laststep, - std::complex** Sk_laststep, - ModuleBase::matrix& ekb, - std::ofstream& ofs_running, - const int htype, - const int propagator, - const bool use_tensor, - const bool use_lapack) -{ - ModuleBase::TITLE("Evolve_elec", "solve_psi"); - ModuleBase::timer::tick("Evolve_elec", "solve_psi"); - - // Control the print of matrix to running_md.log - const int print_matrix = 0; - - for (int ik = 0; ik < nks; ik++) - { - phm->updateHk(ik); - - ModuleBase::timer::tick("Efficiency", "evolve_k"); - psi->fix_k(ik); - psi_laststep->fix_k(ik); - if (htype == 0) - { - evolve_psi(nband, - nlocal, - &(para_orb), - phm, - psi[0].get_pointer(), - psi_laststep[0].get_pointer(), - nullptr, - nullptr, - &(ekb(ik, 0)), - htype, - propagator, - ofs_running, - print_matrix); - } - else if (htype == 1) - { - if (!use_tensor) - { - evolve_psi(nband, - nlocal, - &(para_orb), - phm, - psi[0].get_pointer(), - psi_laststep[0].get_pointer(), - Hk_laststep[ik], - Sk_laststep[ik], - &(ekb(ik, 0)), - htype, - propagator, - ofs_running, - print_matrix); - // std::cout << "Print ekb: " << std::endl; - // ekb.print(std::cout); - } - else - { - const int len_psi_k_1 = use_lapack ? nband : psi->get_nbands(); - const int len_psi_k_2 = use_lapack ? nlocal : psi->get_nbasis(); - const int len_HS_laststep = use_lapack ? nlocal * nlocal : para_orb.nloc; - - // Create Tensor for psi_k, psi_k_laststep, H_laststep, S_laststep, ekb - ct::Tensor psi_k_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_psi_k_1, len_psi_k_2})); - ct::Tensor psi_k_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_psi_k_1, len_psi_k_2})); - ct::Tensor H_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_HS_laststep})); - ct::Tensor S_laststep_tensor(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({len_HS_laststep})); - ct::Tensor ekb_tensor(ct::DataType::DT_DOUBLE, ct_device_type, ct::TensorShape({nband})); - - // Global psi - ModuleESolver::Matrix_g> psi_g; - ModuleESolver::Matrix_g> psi_laststep_g; - - if (use_lapack) - { - // Need to gather the psi to the root process on CPU - // H_laststep and S_laststep are already gathered in esolver_ks_lcao_tddft.cpp -#ifdef __MPI - // Access the rank of the calling process in the communicator - int myid = 0; - int root_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - - // Gather psi to the root process - gatherPsi(myid, root_proc, psi[0].get_pointer(), para_orb, psi_g); - gatherPsi(myid, root_proc, psi_laststep[0].get_pointer(), para_orb, psi_laststep_g); - - // Syncronize data from CPU to Device - syncmem_complex_h2d_op()(psi_k_tensor.data>(), - psi_g.p.get(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_h2d_op()(psi_k_laststep_tensor.data>(), - psi_laststep_g.p.get(), - len_psi_k_1 * len_psi_k_2); -#endif - } - else - { - // Syncronize data from CPU to Device - syncmem_complex_h2d_op()(psi_k_tensor.data>(), - psi[0].get_pointer(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_h2d_op()(psi_k_laststep_tensor.data>(), - psi_laststep[0].get_pointer(), - len_psi_k_1 * len_psi_k_2); - } - - syncmem_complex_h2d_op()(H_laststep_tensor.data>(), - Hk_laststep[ik], - len_HS_laststep); - syncmem_complex_h2d_op()(S_laststep_tensor.data>(), - Sk_laststep[ik], - len_HS_laststep); - syncmem_double_h2d_op()(ekb_tensor.data(), &(ekb(ik, 0)), nband); - - evolve_psi_tensor(nband, - nlocal, - &(para_orb), - phm, - psi_k_tensor, - psi_k_laststep_tensor, - H_laststep_tensor, - S_laststep_tensor, - ekb_tensor, - htype, - propagator, - ofs_running, - print_matrix, - use_lapack); - - // Need to distribute global psi back to all processes - if (use_lapack) - { -#ifdef __MPI - // Syncronize data from Device to CPU - syncmem_complex_d2h_op()(psi_g.p.get(), - psi_k_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_d2h_op()(psi_laststep_g.p.get(), - psi_k_laststep_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - - // Distribute psi to all processes - distributePsi(para_orb, psi[0].get_pointer(), psi_g); - distributePsi(para_orb, psi_laststep[0].get_pointer(), psi_laststep_g); -#endif - } - else - { - // Syncronize data from Device to CPU - syncmem_complex_d2h_op()(psi[0].get_pointer(), - psi_k_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - syncmem_complex_d2h_op()(psi_laststep[0].get_pointer(), - psi_k_laststep_tensor.data>(), - len_psi_k_1 * len_psi_k_2); - } - syncmem_complex_d2h_op()(Hk_laststep[ik], - H_laststep_tensor.data>(), - len_HS_laststep); - syncmem_complex_d2h_op()(Sk_laststep[ik], - S_laststep_tensor.data>(), - len_HS_laststep); - syncmem_double_d2h_op()(&(ekb(ik, 0)), ekb_tensor.data(), nband); - - // std::cout << "Print ekb tensor: " << std::endl; - // ekb.print(std::cout); - } - } - else - { - std::cout << "method of htype is wrong" << std::endl; - } - - ModuleBase::timer::tick("Efficiency", "evolve_k"); - } // end k - - ModuleBase::timer::tick("Evolve_elec", "solve_psi"); - return; -} - -template class Evolve_elec; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template class Evolve_elec; -#endif -} // namespace module_tddft \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/evolve_elec.h b/source/source_hamilt_lcao/module_tddft/evolve_elec.h deleted file mode 100644 index 44972bae3f..0000000000 --- a/source/source_hamilt_lcao/module_tddft/evolve_elec.h +++ /dev/null @@ -1,185 +0,0 @@ -#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_TDDFT_EVOLVE_ELEC_H -#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_TDDFT_EVOLVE_ELEC_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap -#include "source_base/module_device/device.h" // base_device -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" // Cpxgemr2d -#include "source_esolver/esolver_ks_lcao.h" -#include "source_esolver/esolver_ks_lcao_tddft.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_psi/psi.h" - -//----------------------------------------------------------- -// mohan add 2021-02-09 -// This class is used to evolve the electronic wave functions -// in TDDFT in terms of the multiple k points -// k is the index for the points in the first Brillouin zone -//----------------------------------------------------------- - -//------------------------ Debugging utility function ------------------------// - -// Print the shape of a Tensor -inline void print_tensor_shape(const ct::Tensor& tensor, const std::string& name) -{ - std::cout << "Shape of " << name << ": ["; - for (int i = 0; i < tensor.shape().ndim(); ++i) - { - std::cout << tensor.shape().dim_size(i); - if (i < tensor.shape().ndim() - 1) - { - std::cout << ", "; - } - } - std::cout << "]" << std::endl; -} - -// Recursive print function -template -inline void print_tensor_data_recursive(const T* data, - const std::vector& shape, - const std::vector& strides, - int dim, - std::vector& indices, - const std::string& name) -{ - if (dim == shape.size()) - { - // Recursion base case: print data when reaching the innermost dimension - std::cout << name; - for (size_t i = 0; i < indices.size(); ++i) - { - std::cout << "[" << indices[i] << "]"; - } - std::cout << " = " << *data << std::endl; - return; - } - // Recursively process the current dimension - for (int64_t i = 0; i < shape[dim]; ++i) - { - indices[dim] = i; - print_tensor_data_recursive(data + i * strides[dim], shape, strides, dim + 1, indices, name); - } -} - -// Generic print function -template -inline void print_tensor_data(const ct::Tensor& tensor, const std::string& name) -{ - const std::vector& shape = tensor.shape().dims(); - const std::vector& strides = tensor.shape().strides(); - const T* data = tensor.data(); - std::vector indices(shape.size(), 0); - print_tensor_data_recursive(data, shape, strides, 0, indices, name); -} - -// Specialization for std::complex -template <> -inline void print_tensor_data>(const ct::Tensor& tensor, const std::string& name) -{ - const std::vector& shape = tensor.shape().dims(); - const std::vector& strides = tensor.shape().strides(); - const std::complex* data = tensor.data>(); - std::vector indices(shape.size(), 0); - print_tensor_data_recursive(data, shape, strides, 0, indices, name); -} - -//------------------------ Debugging utility function ------------------------// - -namespace module_tddft -{ -#ifdef __MPI -//------------------------ MPI gathering and distributing functions ------------------------// -template -void gatherPsi(const int myid, - const int root_proc, - T* psi_l, - const Parallel_Orbitals& para_orb, - ModuleESolver::Matrix_g& psi_g) -{ - const int* desc_psi = para_orb.desc_wfc; // Obtain the descriptor from Parallel_Orbitals - int ctxt = desc_psi[1]; // BLACS context - int nrows = desc_psi[2]; // Global matrix row number - int ncols = desc_psi[3]; // Global matrix column number - - if (myid == root_proc) - { - psi_g.p.reset(new T[nrows * ncols]); // No need to delete[] since it is a shared_ptr - } - else - { - psi_g.p.reset(new T[nrows * ncols]); // Placeholder for non-root processes - } - - // Set the descriptor of the global psi - psi_g.desc.reset(new int[9]{1, ctxt, nrows, ncols, nrows, ncols, 0, 0, nrows}); - psi_g.row = nrows; - psi_g.col = ncols; - - // Call the Cpxgemr2d function in ScaLAPACK to collect the matrix data - Cpxgemr2d(nrows, ncols, psi_l, 1, 1, const_cast(desc_psi), psi_g.p.get(), 1, 1, psi_g.desc.get(), ctxt); -} - -template -void distributePsi(const Parallel_Orbitals& para_orb, T* psi_l, const ModuleESolver::Matrix_g& psi_g) -{ - const int* desc_psi = para_orb.desc_wfc; // Obtain the descriptor from Parallel_Orbitals - int ctxt = desc_psi[1]; // BLACS context - int nrows = desc_psi[2]; // Global matrix row number - int ncols = desc_psi[3]; // Global matrix column number - - // Call the Cpxgemr2d function in ScaLAPACK to distribute the matrix data - Cpxgemr2d(nrows, ncols, psi_g.p.get(), 1, 1, psi_g.desc.get(), psi_l, 1, 1, const_cast(desc_psi), ctxt); -} -//------------------------ MPI gathering and distributing functions ------------------------// -#endif // __MPI - -template -class Evolve_elec -{ - friend class ModuleESolver::ESolver_KS_LCAO, double>; - - // Template parameter is needed for the friend class declaration - friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; - friend class ModuleESolver::ESolver_KS_LCAO_TDDFT, Device>; - - public: - Evolve_elec(); - ~Evolve_elec(); - - private: - static void solve_psi(const int& istep, - const int nband, - const int nlocal, - const int& nks, - hamilt::Hamilt>* phm, - Parallel_Orbitals& para_orb, - psi::Psi>* psi, - psi::Psi>* psi_laststep, - std::complex** Hk_laststep, - std::complex** Sk_laststep, - ModuleBase::matrix& ekb, - std::ofstream& ofs_running, - const int htype, - const int propagator, - const bool use_tensor, - const bool use_lapack); - - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - static ct::DeviceType ct_device_type; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Memory operations - using syncmem_double_h2d_op = base_device::memory::synchronize_memory_op; - using syncmem_double_d2h_op = base_device::memory::synchronize_memory_op; - using syncmem_complex_h2d_op - = base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>; - using syncmem_complex_d2h_op - = base_device::memory::synchronize_memory_op, base_device::DEVICE_CPU, Device>; -}; -} // namespace module_tddft -#endif diff --git a/source/source_hamilt_lcao/module_tddft/evolve_psi.cpp b/source/source_hamilt_lcao/module_tddft/evolve_psi.cpp deleted file mode 100644 index 29c9e88125..0000000000 --- a/source/source_hamilt_lcao/module_tddft/evolve_psi.cpp +++ /dev/null @@ -1,352 +0,0 @@ -#include "evolve_psi.h" - -#include "band_energy.h" -#include "middle_hamilt.h" -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" // cuBLAS handle -#include "source_base/module_container/ATen/kernels/lapack.h" // cuSOLVER handle -#include "source_base/scalapack_connector.h" -#include "source_esolver/esolver_ks_lcao_tddft.h" // use gatherMatrix -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_pw/hamilt_pwdft/global.h" -#include "module_parameter/parameter.h" -#include "norm_psi.h" -#include "propagator.h" -#include "upsi.h" -#include "solve_propagation.h" - -#include - -namespace module_tddft -{ -void evolve_psi(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - std::complex* psi_k, - std::complex* psi_k_laststep, - std::complex* H_laststep, - std::complex* S_laststep, - double* ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix) -{ - ModuleBase::TITLE("Evolve_psi", "evolve_psi"); - ofs_running << " Evolving electronic wave functions begins" << std::endl; - - time_t time_start = time(nullptr); - ofs_running << " Start Time : " << ctime(&time_start); - -#ifdef __MPI - - hamilt::MatrixBlock> h_mat; - hamilt::MatrixBlock> s_mat; - p_hamilt->matrix(h_mat, s_mat); - - std::complex* Stmp = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Stmp, pv->nloc); - BlasConnector::copy(pv->nloc, s_mat.p, 1, Stmp, 1); - - std::complex* Htmp = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Htmp, pv->nloc); - BlasConnector::copy(pv->nloc, h_mat.p, 1, Htmp, 1); - - std::complex* Hold = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Hold, pv->nloc); - BlasConnector::copy(pv->nloc, h_mat.p, 1, Hold, 1); - - std::complex* U_operator = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(U_operator, pv->nloc); - - // (1)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute H(t+dt/2) - /// @input H_laststep, Htmp, print_matrix - /// @output Htmp - if (htype == 1 && propagator != 2) - { - half_Hmatrix(pv, nband, nlocal, Htmp, Stmp, H_laststep, S_laststep, ofs_running, print_matrix); - } - - // (2)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - if (propagator != 3) - { - /// @brief compute U_operator - /// @input Stmp, Htmp, print_matrix - /// @output U_operator - Propagator prop(propagator, pv, PARAM.inp.td_dt); - prop.compute_propagator(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); - } - - // (3)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - if (propagator != 3) - { - /// @brief apply U_operator to the wave function of the previous step for new wave function - /// @input U_operator, psi_k_laststep, print_matrix - /// @output psi_k - upsi(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); - } - else - { - /// @brief solve the propagation equation - /// @input Stmp, Htmp, psi_k_laststep - /// @output psi_k - solve_propagation(pv, nband, nlocal, PARAM.inp.td_dt, Stmp, Htmp, psi_k_laststep, psi_k); - } - - // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief normalize psi_k - /// @input Stmp, psi_not_norm, psi_k, print_matrix - /// @output psi_k - norm_psi(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); - - // (5)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute ekb - /// @input Htmp, psi_k - /// @output ekb - compute_ekb(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); - - delete[] Stmp; - delete[] Htmp; - delete[] Hold; - delete[] U_operator; - -#endif - - time_t time_end = time(nullptr); - ModuleBase::GlobalFunc::OUT_TIME("evolve(std::complex)", time_start, time_end); - - ofs_running << " Evolving electronic wave functions ends" << std::endl; - - return; -} - -template -void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - // Memory operations - using syncmem_complex_h2d_op - = base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>; - -#if ((defined __CUDA) /* || (defined __ROCM) */) - // Initialize cuBLAS & cuSOLVER handle - ct::kernels::createGpuSolverHandle(); - ct::kernels::createGpuBlasHandle(); -#endif // __CUDA - - ofs_running << " evolve_psi_tensor::start " << std::endl; - - ModuleBase::TITLE("Evolve_psi", "evolve_psi"); - time_t time_start = time(nullptr); - ofs_running << " Start Time : " << ctime(&time_start); - -#ifdef __MPI - - hamilt::MatrixBlock> h_mat, s_mat; - p_hamilt->matrix(h_mat, s_mat); - - // Create Tensor objects for temporary data and sync from host to device - const int len_HS = use_lapack ? nlocal * nlocal : pv->nloc; - ct::Tensor Stmp(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - ct::Tensor Htmp(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - ct::Tensor Hold(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - - if (use_lapack) - { - // Need to gather H and S matrix to root process here - int myid = 0; - int num_procs = 1; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - MPI_Comm_size(MPI_COMM_WORLD, &num_procs); - - ModuleESolver::Matrix_g> h_mat_g, s_mat_g; // Global matrix structure - - // Collect H matrix - ModuleESolver::gatherMatrix(myid, 0, h_mat, h_mat_g); - syncmem_complex_h2d_op()(Htmp.data>(), h_mat_g.p.get(), len_HS); - syncmem_complex_h2d_op()(Hold.data>(), h_mat_g.p.get(), len_HS); - - // Collect S matrix - ModuleESolver::gatherMatrix(myid, 0, s_mat, s_mat_g); - syncmem_complex_h2d_op()(Stmp.data>(), s_mat_g.p.get(), len_HS); - } - else - { - // Original code - syncmem_complex_h2d_op()(Stmp.data>(), s_mat.p, len_HS); - syncmem_complex_h2d_op()(Htmp.data>(), h_mat.p, len_HS); - syncmem_complex_h2d_op()(Hold.data>(), h_mat.p, len_HS); - } - - ct::Tensor U_operator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({len_HS})); - U_operator.zero(); - - int myid = 0; - int root_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - - // (1)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute H(t+dt/2) - /// @input H_laststep, Htmp, print_matrix - /// @output Htmp - if (htype == 1 && propagator != 2) - { - if (!use_lapack) - { - half_Hmatrix_tensor(pv, nband, nlocal, Htmp, Stmp, H_laststep, S_laststep, ofs_running, print_matrix); - } - else - { - if (myid == root_proc) - { - half_Hmatrix_tensor_lapack(pv, - nband, - nlocal, - Htmp, - Stmp, - H_laststep, - S_laststep, - ofs_running, - print_matrix); - } - } - } - - // (2)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute U_operator - /// @input Stmp, Htmp, print_matrix - /// @output U_operator - Propagator prop(propagator, pv, PARAM.mdp.md_dt); - prop.compute_propagator_tensor(nlocal, - Stmp, - Htmp, - H_laststep, - U_operator, - ofs_running, - print_matrix, - use_lapack); - - // (3)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief apply U_operator to the wave function of the previous step for new wave function - /// @input U_operator, psi_k_laststep, print_matrix - /// @output psi_k - if (!use_lapack) - { - upsi_tensor(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); - } - else - { - if (myid == root_proc) - { - upsi_tensor_lapack(pv, nband, nlocal, U_operator, psi_k_laststep, psi_k, ofs_running, print_matrix); - } - } - - // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief normalize psi_k - /// @input Stmp, psi_not_norm, psi_k, print_matrix - /// @output psi_k - if (!use_lapack) - { - norm_psi_tensor(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); - } - else - { - if (myid == root_proc) - { - norm_psi_tensor_lapack(pv, nband, nlocal, Stmp, psi_k, ofs_running, print_matrix); - } - } - - // (5)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - /// @brief compute ekb - /// @input Htmp, psi_k - /// @output ekb - if (!use_lapack) - { - compute_ekb_tensor(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); - } - else - { - if (myid == root_proc) - { - compute_ekb_tensor_lapack(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running); - } - } - -#endif // __MPI - - time_t time_end = time(nullptr); - ModuleBase::GlobalFunc::OUT_TIME("evolve(std::complex)", time_start, time_end); - - ofs_running << " evolve_psi_tensor::end " << std::endl; - -#if ((defined __CUDA) /* || (defined __ROCM) */) - // Destroy cuBLAS & cuSOLVER handle - ct::kernels::destroyGpuSolverHandle(); - ct::kernels::destroyGpuBlasHandle(); -#endif // __CUDA - - return; -} - -// Explicit instantiation of template functions -template void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack); - -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack); -#endif // __CUDA - -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/evolve_psi.h b/source/source_hamilt_lcao/module_tddft/evolve_psi.h deleted file mode 100644 index e1b64f7c9b..0000000000 --- a/source/source_hamilt_lcao/module_tddft/evolve_psi.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file evolve_psi.h - * @brief evolve the wave function - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef ELEC_PSI_H -#define ELEC_PSI_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap -#include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" - -namespace module_tddft -{ -void evolve_psi(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - std::complex* psi_k, - std::complex* psi_k_laststep, - std::complex* H_laststep, - std::complex* S_laststep, - double* ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix); - -template -void evolve_psi_tensor(const int nband, - const int nlocal, - const Parallel_Orbitals* pv, - hamilt::Hamilt>* p_hamilt, - ct::Tensor& psi_k, - ct::Tensor& psi_k_laststep, - ct::Tensor& H_laststep, - ct::Tensor& S_laststep, - ct::Tensor& ekb, - int htype, - int propagator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack); -} // namespace module_tddft - -#endif \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp b/source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp deleted file mode 100644 index da72911335..0000000000 --- a/source/source_hamilt_lcao/module_tddft/middle_hamilt.cpp +++ /dev/null @@ -1,290 +0,0 @@ -#include "middle_hamilt.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI - -void half_Hmatrix(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - std::complex* Htmp, - std::complex* Stmp, - const std::complex* H_laststep, - const std::complex* S_laststep, - std::ofstream& ofs_running, - const int print_matrix) -{ - if (print_matrix) - { - ofs_running << std::setprecision(10); - ofs_running << std::endl; - ofs_running << " H(t+dt) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H(t):" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << H_laststep[in + j].real() << "+" << H_laststep[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - std::complex alpha = {0.5, 0.0}; - std::complex beta = {0.5, 0.0}; - ScalapackConnector::geadd('N', nlocal, nlocal, alpha, H_laststep, 1, 1, pv->desc, beta, Htmp, 1, 1, pv->desc); - ScalapackConnector::geadd('N', nlocal, nlocal, alpha, S_laststep, 1, 1, pv->desc, beta, Stmp, 1, 1, pv->desc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " H (t+dt/2) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -void half_Hmatrix_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix) -{ - if (print_matrix) - { - ofs_running << std::setprecision(10); - ofs_running << std::endl; - ofs_running << " H(t+dt) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp.data>()[in + j].real() << "+" - << Htmp.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H(t):" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << H_laststep.data>()[in + j].real() << "+" - << H_laststep.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - std::complex alpha = {0.5, 0.0}; - std::complex beta = {0.5, 0.0}; - - // Perform the operation Htmp = alpha * H_laststep + beta * Htmp - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - H_laststep.data>(), - 1, - 1, - pv->desc, - beta, - Htmp.data>(), - 1, - 1, - pv->desc); - - // Perform the operation Stmp = alpha * S_laststep + beta * Stmp - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - S_laststep.data>(), - 1, - 1, - pv->desc, - beta, - Stmp.data>(), - 1, - 1, - pv->desc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " H (t+dt/2) :" << std::endl; - for (int i = 0; i < pv->nrow; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - ofs_running << Htmp.data>()[in + j].real() << "+" - << Htmp.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -template -void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - if (print_matrix) - { - ct::Tensor Htmp_cpu = Htmp.to_device(); - ct::Tensor H_laststep_cpu = H_laststep.to_device(); - - ofs_running << std::setprecision(10); - ofs_running << std::endl; - ofs_running << " H(t+dt) :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Htmp_cpu.data>()[in + j].real() << "+" - << Htmp_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H(t):" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << H_laststep_cpu.data>()[in + j].real() << "+" - << H_laststep_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - std::complex one_half = {0.5, 0.0}; - - // Perform the operation Htmp = one_half * H_laststep + one_half * Htmp - // Scale Htmp by one_half - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &one_half, - Htmp.data>(), - 1); - // Htmp = one_half * H_laststep + Htmp - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one_half, - H_laststep.data>(), - 1, - Htmp.data>(), - 1); - - // Perform the operation Stmp = one_half * S_laststep + one_half * Stmp - // Scale Stmp by one_half - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &one_half, - Stmp.data>(), - 1); - // Stmp = one_half * S_laststep + Stmp - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one_half, - S_laststep.data>(), - 1, - Stmp.data>(), - 1); - - if (print_matrix) - { - ct::Tensor Htmp_cpu = Htmp.to_device(); - - ofs_running << std::endl; - ofs_running << " H (t+dt/2) :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Htmp_cpu.data>()[in + j].real() << "+" - << Htmp_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -// Explicit instantiation of template functions -template void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/middle_hamilt.h b/source/source_hamilt_lcao/module_tddft/middle_hamilt.h deleted file mode 100644 index 6e5cb45d78..0000000000 --- a/source/source_hamilt_lcao/module_tddft/middle_hamilt.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file middle_hamilt.h - * @brief compute H(t+dt/2) - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef MIDDLE_HAMILT_H -#define MIDDLE_HAMILT_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief compute H(t+dt/2) - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] Htmp H(t+dt) - * @param[in] H_laststep H(t) - * @param[in] print_matirx print internal matrix or not - * @param[out] Htmp H(t+dt/2) - */ -void half_Hmatrix(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - std::complex* Htmp, - std::complex* Stmp, - const std::complex* H_laststep, - const std::complex* S_laststep, - std::ofstream& ofs_running, - const int print_matrix); - -void half_Hmatrix_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); - -template -void half_Hmatrix_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - ct::Tensor& Htmp, - ct::Tensor& Stmp, - const ct::Tensor& H_laststep, - const ct::Tensor& S_laststep, - std::ofstream& ofs_running, - const int print_matrix); - -#endif // __MPI -} // namespace module_tddft - -#endif diff --git a/source/source_hamilt_lcao/module_tddft/norm_psi.cpp b/source/source_hamilt_lcao/module_tddft/norm_psi.cpp deleted file mode 100644 index 913554c815..0000000000 --- a/source/source_hamilt_lcao/module_tddft/norm_psi.cpp +++ /dev/null @@ -1,671 +0,0 @@ -#include "norm_psi.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI - -inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - int iblock, gIndex; - iblock = localindex / nblk; - gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} - -void norm_psi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* Stmp, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - assert(pv->nloc_wfc > 0 && pv->nloc > 0); - - std::complex* tmp1 = new std::complex[pv->nloc_wfc]; - ModuleBase::GlobalFunc::ZEROS(tmp1, pv->nloc_wfc); - - std::complex* Cij = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(Cij, pv->nloc); - - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - Stmp, - 1, - 1, - pv->desc, - psi_k, - 1, - 1, - pv->desc_wfc, - 0.0, - tmp1, - 1, - 1, - pv->desc_wfc); - - ScalapackConnector::gemm('C', - 'N', - nband, - nband, - nlocal, - 1.0, - psi_k, - 1, - 1, - pv->desc_wfc, - tmp1, - 1, - 1, - pv->desc_wfc, - 0.0, - Cij, - 1, - 1, - pv->desc_Eij); - - if (print_matrix) - { - ofs_running << "original Cij :" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - double aa = Cij[in + j].real(); - double bb = Cij[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - int naroc[2] = {0, 0}; // maximum number of row or column - - for (int iprow = 0; iprow < pv->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) - { - if (iprow == pv->coord[0] && ipcol == pv->coord[1]) - { - naroc[0] = pv->nrow; - naroc[1] = pv->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); - if (igcol >= nband) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); - if (igrow >= nband) - { - continue; - } - if (igcol == igrow) - { - Cij[j * naroc[0] + i] = {1.0 / sqrt(Cij[j * naroc[0] + i].real()), 0.0}; - } - else - { - Cij[j * naroc[0] + i] = {0.0, 0.0}; - } - } - } - } - } // loop ipcol - } // loop iprow - - BlasConnector::copy(pv->nloc_wfc, psi_k, 1, tmp1, 1); - - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nband, - 1.0, - tmp1, - 1, - 1, - pv->desc_wfc, - Cij, - 1, - 1, - pv->desc_Eij, - 0.0, - psi_k, - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << " Cij:" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - ofs_running << Cij[in + j].real() << "+" << Cij[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k[in + j].real(); - double bb = psi_k[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k before normalization:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = tmp1[in + j].real(); - double bb = tmp1[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - } - - delete[] tmp1; - delete[] Cij; -} - -void norm_psi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - assert(pv->nloc_wfc > 0 && pv->nloc > 0); - - // Create Tensor objects for temporary data - ct::Tensor tmp1(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc_wfc})); - tmp1.zero(); - - ct::Tensor Cij(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({pv->nloc})); - Cij.zero(); - - // Perform matrix multiplication: tmp1 = Stmp * psi_k - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - Stmp.data>(), - 1, - 1, - pv->desc, - psi_k.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - tmp1.data>(), - 1, - 1, - pv->desc_wfc); - - // Perform matrix multiplication: Cij = psi_k^dagger * tmp1 - ScalapackConnector::gemm('C', - 'N', - nband, - nband, - nlocal, - 1.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc, - tmp1.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - Cij.data>(), - 1, - 1, - pv->desc_Eij); - - if (print_matrix) - { - ofs_running << "original Cij :" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - double aa = Cij.data>()[in + j].real(); - double bb = Cij.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - int naroc[2] = {0, 0}; // maximum number of row or column - - for (int iprow = 0; iprow < pv->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < pv->dim1; ++ipcol) - { - if (iprow == pv->coord[0] && ipcol == pv->coord[1]) - { - naroc[0] = pv->nrow; - naroc[1] = pv->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, pv->nb, pv->dim1, ipcol); - if (igcol >= nband) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, pv->nb, pv->dim0, iprow); - if (igrow >= nband) - { - continue; - } - if (igcol == igrow) - { - Cij.data>()[j * naroc[0] + i] - = {1.0 / sqrt(Cij.data>()[j * naroc[0] + i].real()), 0.0}; - } - else - { - Cij.data>()[j * naroc[0] + i] = {0.0, 0.0}; - } - } - } - } - } // loop ipcol - } // loop iprow - - // Copy psi_k to tmp1 (using deep copy) - // tmp1.CopyFrom(psi_k); // Does not work because this will cause tmp1 and psi_k to share the same data - tmp1 = psi_k; // operator= overload for Tensor class - - // Perform matrix multiplication: psi_k = tmp1 * Cij - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nband, - 1.0, - tmp1.data>(), - 1, - 1, - pv->desc_wfc, - Cij.data>(), - 1, - 1, - pv->desc_Eij, - 0.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << " Cij:" << std::endl; - for (int i = 0; i < pv->ncol; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->nrow; j++) - { - ofs_running << Cij.data>()[in + j].real() << "+" - << Cij.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k.data>()[in + j].real(); - double bb = psi_k.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k before normalization:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = tmp1.data>()[in + j].real(); - double bb = tmp1.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - } -} - -template -void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Create Tensor objects for temporary data - ct::Tensor tmp1( - ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({nlocal * nband})); // tmp1 shape: nlocal * nband (under 2D block cyclic is pv->nloc_wfc) - tmp1.zero(); - - ct::Tensor Cij(ct::DataType::DT_COMPLEX_DOUBLE, - ct_device_type, - ct::TensorShape({nlocal * nlocal})); // Cij shape: nlocal * nlocal - Cij.zero(); - - std::complex alpha = {1.0, 0.0}; - std::complex beta = {0.0, 0.0}; - - // Perform matrix multiplication: tmp1 = Stmp * psi_k - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nlocal, - &alpha, - Stmp.data>(), - nlocal, // Leading dimension of Stmp - psi_k.data>(), - nlocal, // Leading dimension of psi_k - &beta, - tmp1.data>(), - nlocal); // Leading dimension of tmp1 - - // Perform matrix multiplication: Cij = psi_k^dagger * tmp1 - ct::kernels::blas_gemm, ct_Device>()('C', - 'N', - nband, - nband, - nlocal, - &alpha, - psi_k.data>(), - nlocal, // Leading dimension of psi_k - tmp1.data>(), - nlocal, // Leading dimension of tmp1 - &beta, - Cij.data>(), - nlocal); // Leading dimension of Cij - - if (print_matrix) - { - ct::Tensor Cij_print_cpu = Cij.to_device(); - - ofs_running << "original Cij :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = Cij_print_cpu.data>()[in + j].real(); - double bb = Cij_print_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // Normalize Cij: set diagonal elements to 1/sqrt(Cij[i][i]), off-diagonal elements to 0 - if (ct_device_type == ct::DeviceType::GpuDevice) - { - // Step 1: Copy Cij from GPU to CPU - ct::Tensor Cij_cpu = Cij.to_device(); - - // Step 2: Perform normalization on CPU - for (int i = 0; i < nband; ++i) - { - const int in = i * nlocal; - for (int j = 0; j < nband; ++j) - { - if (i == j) - { - Cij_cpu.data>()[in + j] - = {1.0 / sqrt(Cij_cpu.data>()[in + j].real()), 0.0}; - } - else - { - Cij_cpu.data>()[in + j] = {0.0, 0.0}; - } - } - } - - // Step 3: Copy normalized Cij back to GPU - Cij = Cij_cpu.to_device(); - } - else - { - // CPU implementation - for (int i = 0; i < nband; ++i) - { - const int in = i * nlocal; - for (int j = 0; j < nband; ++j) - { - if (i == j) - { - Cij.data>()[in + j] - = {1.0 / sqrt(Cij.data>()[in + j].real()), 0.0}; - } - else - { - Cij.data>()[in + j] = {0.0, 0.0}; - } - } - } - } - - // Copy psi_k to tmp1 (using deep copy) - // tmp1.CopyFrom(psi_k); // Does not work because this will cause tmp1 and psi_k to share the same data - tmp1 = psi_k; // operator= overload for Tensor class - - // Perform matrix multiplication: psi_k = tmp1 * Cij - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nband, - &alpha, - tmp1.data>(), - nlocal, // Leading dimension of tmp1 - Cij.data>(), - nlocal, // Leading dimension of Cij - &beta, - psi_k.data>(), - nlocal); // Leading dimension of psi_k - - if (print_matrix) - { - ct::Tensor Cij_print_cpu = Cij.to_device(); - ct::Tensor psi_k_cpu = psi_k.to_device(); - ct::Tensor tmp1_cpu = tmp1.to_device(); - - ofs_running << " Cij:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Cij_print_cpu.data>()[in + j].real() << "+" - << Cij_print_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = psi_k_cpu.data>()[in + j].real(); - double bb = psi_k_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k before normalization:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = tmp1_cpu.data>()[in + j].real(); - double bb = tmp1_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - } -} - -// Explicit instantiation of template functions -template void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/norm_psi.h b/source/source_hamilt_lcao/module_tddft/norm_psi.h deleted file mode 100644 index 1f3cc8ec2b..0000000000 --- a/source/source_hamilt_lcao/module_tddft/norm_psi.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file norm_psi.h - * @brief normalize the wave function - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef NORM_PSI_H -#define NORM_PSI_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief normalize the wave function - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] psi_k psi of this step - * @param[in] print_matirx print internal matrix or not - * @param[out] psi_k psi of this step after normalization - */ -void norm_psi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* Stmp, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -void norm_psi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -template -void norm_psi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& Stmp, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -#endif // __MPI -} // namespace module_tddft - -#endif diff --git a/source/source_hamilt_lcao/module_tddft/propagator.cpp b/source/source_hamilt_lcao/module_tddft/propagator.cpp deleted file mode 100644 index 74f1c3088f..0000000000 --- a/source/source_hamilt_lcao/module_tddft/propagator.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "propagator.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" - -#include -#include - -namespace module_tddft -{ -Propagator::~Propagator() -{ -} -#ifdef __MPI -void Propagator::compute_propagator(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - int tag; - switch (ptype) - { - case 0: - compute_propagator_cn2(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); - break; - - case 1: - tag = 1; - compute_propagator_taylor(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix, tag); - break; - - case 2: - compute_propagator_etrs(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); - break; - - default: - ModuleBase::WARNING_QUIT("Propagator::compute_propagator", "Method of RT-TDDFT propagator is wrong!"); - break; - } -} - -template -void Propagator::compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const -{ - int tag; - switch (ptype) - { - case 0: - if (!use_lapack) - { - compute_propagator_cn2_tensor(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); - } - else - { - int myid = 0; - int root_proc = 0; - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - if (myid == root_proc) - { - compute_propagator_cn2_tensor_lapack(nlocal, Stmp, Htmp, U_operator, ofs_running, print_matrix); - } - } - break; - - default: - ModuleBase::WARNING_QUIT("Propagator::compute_propagator_tensor", - "The Tensor-based RT-TDDFT propagator currently supports Crank–Nicolson method only!"); - break; - } -} - -// Explicit instantiation of template functions -template void Propagator::compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void Propagator::compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const; -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/propagator.h b/source/source_hamilt_lcao/module_tddft/propagator.h deleted file mode 100644 index 0b13f5453f..0000000000 --- a/source/source_hamilt_lcao/module_tddft/propagator.h +++ /dev/null @@ -1,222 +0,0 @@ -/** - * @file propagator.h - * @brief compute propagtor to evolve the wave function - * This file originally belonged to file LCAO_evolve.cpp - */ -#ifndef PROPAGATOR_H -#define PROPAGATOR_H - -#include "source_base/constants.h" -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -//--------------------------------- Utility function ---------------------------------// -#ifdef __MPI -inline int globalIndex(int localindex, int nblk, int nprocs, int myproc) -{ - int iblock, gIndex; - iblock = localindex / nblk; - gIndex = (iblock * nprocs + myproc) * nblk + localindex % nblk; - return gIndex; -} -#endif // __MPI - -// Auxiliary function: process non-complex types, return value 1.0 -template -inline T init_value(typename std::enable_if>::value - && !std::is_same>::value>::type* = nullptr) -{ - return T(1.0); -} - -// Auxiliary function: process complex types, return value 1.0 + 0.0i -template -inline T init_value(typename std::enable_if>::value - || std::is_same>::value>::type* = nullptr) -{ - return T(1.0, 0.0); -} - -// Create an identity matrix of size nƗn -template -ct::Tensor create_identity_matrix(const int n, ct::DeviceType device = ct::DeviceType::CpuDevice) -{ - // Choose the data type of the Tensor - ct::DataType data_type; - if (std::is_same::value) - { - data_type = ct::DataType::DT_FLOAT; - } - else if (std::is_same::value) - { - data_type = ct::DataType::DT_DOUBLE; - } - else if (std::is_same>::value) - { - data_type = ct::DataType::DT_COMPLEX; - } - else if (std::is_same>::value) - { - data_type = ct::DataType::DT_COMPLEX_DOUBLE; - } - else - { - static_assert(std::is_same::value || std::is_same::value - || std::is_same>::value - || std::is_same>::value, - "Unsupported data type!"); - } - - ct::Tensor tensor(data_type, device, ct::TensorShape({n, n})); - tensor.zero(); - - // Set the diagonal elements to 1 - if (device == ct::DeviceType::CpuDevice) - { - // For CPU, we can directly access the data - T* data_ptr = tensor.data(); - for (int i = 0; i < n; ++i) - { - data_ptr[i * n + i] = init_value(); - } - } -#if ((defined __CUDA)) - else if (device == ct::DeviceType::GpuDevice) - { - // For GPU, we need to use a kernel to set the diagonal elements - T* data_ptr = tensor.data(); - for (int i = 0; i < n; ++i) - { - T value = init_value(); - ct::kernels::set_memory()(data_ptr + i * n + i, value, 1); - } - } -#endif - - return tensor; -} -//--------------------------------- Utility function ---------------------------------// - -class Propagator -{ - public: - Propagator(const int ptype, const Parallel_Orbitals* pv, const double& dt) - { - this->ptype = ptype; - this->ParaV = pv; - this->dt = dt / ModuleBase::AU_to_FS; - } - ~Propagator(); - -#ifdef __MPI - /** - * @brief compute propagator - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] H_laststep H(t) - * @param[in] print_matirx print internal matrix or not - * @param[out] U_operator operator of propagator - */ - void compute_propagator(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - template - void compute_propagator_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - const ct::Tensor& H_laststep, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const bool use_lapack) const; -#endif // __MPI - - private: - int ptype; // type of propagator - const Parallel_Orbitals* ParaV; - double dt; // time step - -#ifdef __MPI - - /** - * @brief compute propagator of method Crank-Nicolson - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] print_matirx print internal matrix or not - * @param[out] U_operator operator of propagator - */ - void compute_propagator_cn2(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - void compute_propagator_cn2_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - template - void compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; - - /** - * @brief compute propagator of method 4th Taylor - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] print_matirx print internal matrix or not - * @param[in] tag a parametre different for 4th Taylor and ETRS - * @param[out] U_operator operator of propagator - */ - void compute_propagator_taylor(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const int tag) const; - - /** - * @brief compute propagator of method ETRS - * - * @param[in] nlocal number of orbitals - * @param[in] Stmp overlap matrix - * @param[in] Htmp H(t+dt/2) or H(t+dt) - * @param[in] H_laststep H(t) - * @param[in] print_matirx print internal matrix or not - * @param[out] U_operator operator of propagator - */ - void compute_propagator_etrs(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; -#endif // __MPI -}; -} // namespace module_tddft - -#endif diff --git a/source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp b/source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp deleted file mode 100644 index 8ccbd2a5a0..0000000000 --- a/source/source_hamilt_lcao/module_tddft/propagator_cn2.cpp +++ /dev/null @@ -1,734 +0,0 @@ -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "propagator.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void Propagator::compute_propagator_cn2(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - assert(this->ParaV->nloc > 0); - - // (1) copy Htmp to Numerator & Denominator - std::complex* Numerator = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(Numerator, this->ParaV->nloc); - BlasConnector::copy(this->ParaV->nloc, Htmp, 1, Numerator, 1); - - std::complex* Denominator = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(Denominator, this->ParaV->nloc); - BlasConnector::copy(this->ParaV->nloc, Htmp, 1, Denominator, 1); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Stmp[in + j].real() << "+" << Stmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator[in + j].real() << "+" << Numerator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute Numerator & Denominator by GEADD - // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt - // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt - std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * this->dt}; - std::complex beta2 = {0.0, 0.25 * this->dt}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - this->ParaV->desc, - beta1, - Numerator, - 1, - 1, - this->ParaV->desc); - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - this->ParaV->desc, - beta2, - Denominator, - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " beta=" << beta1 << std::endl; - ofs_running << " fenmu:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator[in + j].real() << "+" << Denominator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) Next, invert Denominator - // What is the size of ipiv exactly? Need to check ScaLAPACK documentation! - // But anyway, not this->ParaV->nloc - int* ipiv = new int[this->ParaV->nrow + this->ParaV->nb]; - ModuleBase::GlobalFunc::ZEROS(ipiv, this->ParaV->nrow + this->ParaV->nb); - int info = 0; - // (3.1) compute ipiv - ScalapackConnector::getrf(nlocal, nlocal, Denominator, 1, 1, this->ParaV->desc, ipiv, &info); - - // Print ipiv - if (print_matrix) - { - ofs_running << " this->ParaV->nloc = " << this->ParaV->nloc << std::endl; - ofs_running << " this->ParaV->nrow = " << this->ParaV->nrow << std::endl; - ofs_running << " this->ParaV->ncol = " << this->ParaV->ncol << std::endl; - ofs_running << " this->ParaV->nb = " << this->ParaV->nb << std::endl; - ofs_running << " this->ParaV->get_block_size() = " << this->ParaV->get_block_size() << std::endl; - ofs_running << " nlocal = " << nlocal << std::endl; - ofs_running << " ipiv:" << std::endl; - for (int i = 0; i < this->ParaV->nloc; i++) - { - ofs_running << ipiv[i] << " "; - } - ofs_running << std::endl; - } - - int lwork = -1; - int liwotk = -1; - std::vector> work(1, 0); - std::vector iwork(1, 0); - // (3.2) compute work - ScalapackConnector::getri(nlocal, - Denominator, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - lwork = work[0].real(); - work.resize(lwork, 0); - liwotk = iwork[0]; - iwork.resize(liwotk, 0); - // (3.3) compute inverse matrix of Denominator - ScalapackConnector::getri(nlocal, - Denominator, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - assert(0 == info); - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - // (4) U_operator = Denominator * Numerator; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - Denominator, - 1, - 1, - this->ParaV->desc, - Numerator, - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator, - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " fenmu^-1:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator[in + j].real() << "+" << Denominator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " fenzi:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator[in + j].real() << "+" << Numerator[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - double aa = U_operator[in + j].real(); - double bb = U_operator[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } - - delete[] Numerator; - delete[] Denominator; - delete[] ipiv; -} - -void Propagator::compute_propagator_cn2_tensor(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - // (1) copy Htmp to Numerator & Denominator - ct::Tensor Numerator(ct::DataType::DT_COMPLEX_DOUBLE, - ct::DeviceType::CpuDevice, - ct::TensorShape({this->ParaV->nloc})); - Numerator.zero(); - BlasConnector::copy(this->ParaV->nloc, - Htmp.data>(), - 1, - Numerator.data>(), - 1); - - ct::Tensor Denominator(ct::DataType::DT_COMPLEX_DOUBLE, - ct::DeviceType::CpuDevice, - ct::TensorShape({this->ParaV->nloc})); - Denominator.zero(); - BlasConnector::copy(this->ParaV->nloc, - Htmp.data>(), - 1, - Denominator.data>(), - 1); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Stmp.data>()[in + j].real() << "+" - << Stmp.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator.data>()[in + j].real() << "+" - << Numerator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute Numerator & Denominator by GEADD - // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt - // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt - std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * this->dt}; - std::complex beta2 = {0.0, 0.25 * this->dt}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp.data>(), - 1, - 1, - this->ParaV->desc, - beta1, - Numerator.data>(), - 1, - 1, - this->ParaV->desc); - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp.data>(), - 1, - 1, - this->ParaV->desc, - beta2, - Denominator.data>(), - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " beta=" << beta1 << std::endl; - ofs_running << " fenmu:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator.data>()[in + j].real() << "+" - << Denominator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) Next, invert Denominator - ct::Tensor ipiv(ct::DataType::DT_INT, - ct::DeviceType::CpuDevice, - ct::TensorShape({this->ParaV->nrow + this->ParaV->nb})); - ipiv.zero(); - int info = 0; - // (3.1) compute ipiv - ScalapackConnector::getrf(nlocal, - nlocal, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - ipiv.data(), - &info); - - // Print ipiv - if (print_matrix) - { - ofs_running << " this->ParaV->nloc = " << this->ParaV->nloc << std::endl; - ofs_running << " this->ParaV->nrow = " << this->ParaV->nrow << std::endl; - ofs_running << " this->ParaV->ncol = " << this->ParaV->ncol << std::endl; - ofs_running << " this->ParaV->nb = " << this->ParaV->nb << std::endl; - ofs_running << " this->ParaV->get_block_size() = " << this->ParaV->get_block_size() << std::endl; - ofs_running << " nlocal = " << nlocal << std::endl; - ofs_running << " ipiv:" << std::endl; - for (int i = 0; i < this->ParaV->nloc; i++) - { - ofs_running << ipiv.data()[i] << " "; - } - ofs_running << std::endl; - } - - int lwork = -1; - int liwotk = -1; - ct::Tensor work(ct::DataType::DT_COMPLEX_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({1})); - ct::Tensor iwork(ct::DataType::DT_INT, ct::DeviceType::CpuDevice, ct::TensorShape({1})); - // (3.2) compute work - ScalapackConnector::getri(nlocal, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - ipiv.data(), - work.data>(), - &lwork, - iwork.data(), - &liwotk, - &info); - lwork = work.data>()[0].real(); - work.resize(ct::TensorShape({lwork})); - liwotk = iwork.data()[0]; - iwork.resize(ct::TensorShape({liwotk})); - // (3.3) compute inverse matrix of Denominator - ScalapackConnector::getri(nlocal, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - ipiv.data(), - work.data>(), - &lwork, - iwork.data(), - &liwotk, - &info); - assert(0 == info); - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - // (4) U_operator = Denominator * Numerator; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - Denominator.data>(), - 1, - 1, - this->ParaV->desc, - Numerator.data>(), - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator.data>(), - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " fenmu^-1:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Denominator.data>()[in + j].real() << "+" - << Denominator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " fenzi:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Numerator.data>()[in + j].real() << "+" - << Numerator.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - double aa = U_operator.data>()[in + j].real(); - double bb = U_operator.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } -} - -template -void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // (1) copy Htmp to Numerator & Denominator - ct::Tensor Numerator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({nlocal * nlocal})); - Numerator.zero(); - base_device::memory::synchronize_memory_op, Device, Device>()( - Numerator.data>(), - Htmp.data>(), - nlocal * nlocal); - - ct::Tensor Denominator(ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape({nlocal * nlocal})); - Denominator.zero(); - base_device::memory::synchronize_memory_op, Device, Device>()( - Denominator.data>(), - Htmp.data>(), - nlocal * nlocal); - - if (print_matrix) - { - ct::Tensor Stmp_cpu = Stmp.to_device(); - ct::Tensor Numerator_cpu = Numerator.to_device(); - - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Stmp_cpu.data>()[in + j].real() << "+" - << Stmp_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Numerator_cpu.data>()[in + j].real() << "+" - << Numerator_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute Numerator & Denominator by GEADD - // Numerator = Stmp - i*para * Htmp; beta1 = - para = -0.25 * this->dt - // Denominator = Stmp + i*para * Htmp; beta2 = para = 0.25 * this->dt - std::complex one = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * this->dt}; - std::complex beta2 = {0.0, 0.25 * this->dt}; - - // Numerator = -i*para * Htmp - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &beta1, - Numerator.data>(), - 1); - // Numerator = Stmp + (-i*para * Htmp) - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one, - Stmp.data>(), - 1, - Numerator.data>(), - 1); - // Denominator = i*para * Htmp - ct::kernels::blas_scal, ct_Device>()(nlocal * nlocal, - &beta2, - Denominator.data>(), - 1); - // Denominator = Stmp + (i*para * Htmp) - ct::kernels::blas_axpy, ct_Device>()(nlocal * nlocal, - &one, - Stmp.data>(), - 1, - Denominator.data>(), - 1); - - if (print_matrix) - { - ct::Tensor Denominator_cpu = Denominator.to_device(); - - ofs_running << " beta=" << beta1 << std::endl; - ofs_running << " fenmu:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Denominator_cpu.data>()[in + j].real() << "+" - << Denominator_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) Next, invert Denominator - ct::Tensor ipiv(ct::DataType::DT_INT, ct_device_type, ct::TensorShape({nlocal})); - ipiv.zero(); - // (3.1) compute ipiv - ct::kernels::lapack_getrf, ct_Device>()(nlocal, - nlocal, - Denominator.data>(), - nlocal, - ipiv.data()); - - // Print ipiv - if (print_matrix) - { - ct::Tensor ipiv_cpu = ipiv.to_device(); - - ofs_running << " ipiv:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - ofs_running << ipiv_cpu.data()[i] << " "; - } - ofs_running << std::endl; - } - - // (3.2) compute inverse matrix of Denominator - ct::Tensor Denominator_inv = create_identity_matrix>(nlocal, ct_device_type); - ct::kernels::lapack_getrs, ct_Device>()('N', - nlocal, - nlocal, - Denominator.data>(), - nlocal, - ipiv.data(), - Denominator_inv.data>(), - nlocal); - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - // (4) U_operator = Denominator_inv * Numerator; - std::complex one_gemm = {1.0, 0.0}; - std::complex zero_gemm = {0.0, 0.0}; - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nlocal, - nlocal, - &one_gemm, - Denominator_inv.data>(), - nlocal, - Numerator.data>(), - nlocal, - &zero_gemm, - U_operator.data>(), - nlocal); - - if (print_matrix) - { - ct::Tensor Denominator_inv_cpu = Denominator_inv.to_device(); - ct::Tensor Numerator_cpu = Numerator.to_device(); - ct::Tensor U_operator_cpu = U_operator.to_device(); - - ofs_running << " fenmu^-1:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Denominator_inv_cpu.data>()[in + j].real() << "+" - << Denominator_inv_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " fenzi:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - ofs_running << Numerator_cpu.data>()[in + j].real() << "+" - << Numerator_cpu.data>()[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < nlocal; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = U_operator_cpu.data>()[in + j].real(); - double bb = U_operator_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } -} - -// Explicit instantiation of template functions -template void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void Propagator::compute_propagator_cn2_tensor_lapack(const int nlocal, - const ct::Tensor& Stmp, - const ct::Tensor& Htmp, - ct::Tensor& U_operator, - std::ofstream& ofs_running, - const int print_matrix) const; -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp b/source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp deleted file mode 100644 index e3dcec0b0d..0000000000 --- a/source/source_hamilt_lcao/module_tddft/propagator_etrs.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "propagator.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void Propagator::compute_propagator_etrs(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* H_laststep, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix) const -{ - std::vector> U1(this->ParaV->nloc); - std::vector> U2(this->ParaV->nloc); - int tag = 2; - compute_propagator_taylor(nlocal, Stmp, Htmp, U1.data(), ofs_running, print_matrix, tag); - compute_propagator_taylor(nlocal, Stmp, H_laststep, U2.data(), ofs_running, print_matrix, tag); - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U1.data(), - 1, - 1, - this->ParaV->desc, - U2.data(), - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator, - 1, - 1, - this->ParaV->desc); -} -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp b/source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp deleted file mode 100644 index ae03c18417..0000000000 --- a/source/source_hamilt_lcao/module_tddft/propagator_taylor.cpp +++ /dev/null @@ -1,343 +0,0 @@ -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/module_container/ATen/kernels/lapack.h" -#include "source_base/module_container/ATen/kernels/memory.h" // memory operations (Tensor) -#include "source_base/module_device/memory_op.h" // memory operations -#include "source_base/scalapack_connector.h" -#include "module_parameter/parameter.h" -#include "propagator.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void Propagator::compute_propagator_taylor(const int nlocal, - const std::complex* Stmp, - const std::complex* Htmp, - std::complex* U_operator, - std::ofstream& ofs_running, - const int print_matrix, - const int tag) const -{ - assert(this->ParaV->nloc > 0); - - ModuleBase::GlobalFunc::ZEROS(U_operator, this->ParaV->nloc); - std::complex* A_matrix = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(A_matrix, this->ParaV->nloc); - std::complex* rank0 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank0, this->ParaV->nloc); - std::complex* rank2 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank2, this->ParaV->nloc); - std::complex* rank3 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank3, this->ParaV->nloc); - std::complex* rank4 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(rank4, this->ParaV->nloc); - std::complex* tmp1 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(tmp1, this->ParaV->nloc); - std::complex* tmp2 = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(tmp2, this->ParaV->nloc); - std::complex* Sinv = new std::complex[this->ParaV->nloc]; - ModuleBase::GlobalFunc::ZEROS(Sinv, this->ParaV->nloc); - BlasConnector::copy(this->ParaV->nloc, Stmp, 1, Sinv, 1); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " S matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Stmp[in + j].real() << "+" << Stmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << std::endl; - ofs_running << " H matrix :" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << Htmp[in + j].real() << "+" << Htmp[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } - - // set rank0 - int info = 0; - int naroc[2] = {0, 0}; // maximum number of row or column - - for (int iprow = 0; iprow < this->ParaV->dim0; ++iprow) - { - for (int ipcol = 0; ipcol < this->ParaV->dim1; ++ipcol) - { - if (iprow == ParaV->coord[0] && ipcol == ParaV->coord[1]) - { - naroc[0] = this->ParaV->nrow; - naroc[1] = this->ParaV->ncol; - for (int j = 0; j < naroc[1]; ++j) - { - int igcol = globalIndex(j, this->ParaV->nb, this->ParaV->dim1, ipcol); - if (igcol >= nlocal) - { - continue; - } - for (int i = 0; i < naroc[0]; ++i) - { - int igrow = globalIndex(i, this->ParaV->nb, this->ParaV->dim0, iprow); - if (igrow >= nlocal) - { - continue; - } - if (igcol == igrow) - { - rank0[j * naroc[0] + i] = {1.0, 0.0}; - } - else - { - rank0[j * naroc[0] + i] = {0.0, 0.0}; - } - } - } - } - } // loop ipcol - } // loop iprow - - std::complex beta = {0.0, -0.5 * this->dt / tag}; // for ETRS tag=2 , for taylor tag=1 - - //->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // invert Stmp - int* ipiv = new int[this->ParaV->nloc]; - // (3.1) compute ipiv - ScalapackConnector::getrf(nlocal, nlocal, Sinv, 1, 1, this->ParaV->desc, ipiv, &info); - int lwork = -1; - int liwotk = -1; - std::vector> work(1, 0); - std::vector iwork(1, 0); - // (3.2) compute work - ScalapackConnector::getri(nlocal, - Sinv, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - lwork = work[0].real(); - work.resize(lwork, 0); - liwotk = iwork[0]; - iwork.resize(liwotk, 0); - ScalapackConnector::getri(nlocal, - Sinv, - 1, - 1, - this->ParaV->desc, - ipiv, - work.data(), - &lwork, - iwork.data(), - &liwotk, - &info); - assert(0 == info); - - // A_matrix = - idt S^-1 H ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - beta, - Sinv, - 1, - 1, - this->ParaV->desc, - Htmp, - 1, - 1, - this->ParaV->desc, - 0.0, - U_operator, - 1, - 1, - this->ParaV->desc); - - // rank2 = A^2 ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U_operator, - 1, - 1, - this->ParaV->desc, - U_operator, - 1, - 1, - this->ParaV->desc, - 0.0, - rank2, - 1, - 1, - this->ParaV->desc); - - // rank3 = A^3 ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U_operator, - 1, - 1, - this->ParaV->desc, - rank2, - 1, - 1, - this->ParaV->desc, - 0.0, - rank3, - 1, - 1, - this->ParaV->desc); - - // rank4 = A^4 ; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nlocal, - nlocal, - 1.0, - U_operator, - 1, - 1, - this->ParaV->desc, - rank3, - 1, - 1, - this->ParaV->desc, - 0.0, - rank4, - 1, - 1, - this->ParaV->desc); - - std::complex p1 = {1.0, 0.0}; - std::complex p2 = {1.0 / 2.0, 0.0}; - std::complex p3 = {1.0 / 6.0, 0.0}; - std::complex p4 = {1.0 / 24.0, 0.0}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p1, - rank0, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p2, - rank2, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p3, - rank3, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - p4, - rank4, - 1, - 1, - this->ParaV->desc, - p1, - U_operator, - 1, - 1, - this->ParaV->desc); - - if (print_matrix) - { - ofs_running << " A_matrix:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - ofs_running << A_matrix[in + j].real() << "+" << A_matrix[in + j].imag() << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " U operator:" << std::endl; - for (int i = 0; i < this->ParaV->nrow; i++) - { - const int in = i * this->ParaV->ncol; - for (int j = 0; j < this->ParaV->ncol; j++) - { - double aa = U_operator[in + j].real(); - double bb = U_operator[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - } - delete[] A_matrix; - delete[] rank0; - delete[] rank2; - delete[] rank3; - delete[] rank4; - delete[] tmp1; - delete[] tmp2; - delete[] Sinv; - delete[] ipiv; -} -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp b/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp deleted file mode 100644 index 97a71345c8..0000000000 --- a/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.cpp +++ /dev/null @@ -1,247 +0,0 @@ -#include "snap_psibeta_half_tddft.h" - -#include "source_base/constants.h" -#include "source_base/math_integral.h" -#include "source_base/math_polyint.h" -#include "source_base/timer.h" -#include "source_base/ylm.h" - -namespace module_tddft -{ - -// nlm[0] : -// nlm[1, 2, 3,] : , which a = x, y, z. -void snap_psibeta_half_tddft(const LCAO_Orbitals& orb, - const InfoNonlocal& infoNL_, - std::vector>>& nlm, - const ModuleBase::Vector3& R1, - const int& T1, - const int& L1, - const int& m1, - const int& N1, - const ModuleBase::Vector3& R0, // The projector. - const int& T0, - const ModuleBase::Vector3& A, - const bool& calc_r) -{ - ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); - - // find number of projectors on atom R0 - const int nproj = infoNL_.nproj[T0]; - if (nproj == 0) - { - if (calc_r) - { - nlm.resize(4); - } - else - { - nlm.resize(1); - } - return; - } - - std::vector calproj(nproj); - std::vector rmesh1(nproj); - - if (calc_r) - { - nlm.resize(4); - } - else - { - nlm.resize(1); - } - - // Count number of projectors (l,m) - int natomwfc = 0; - for (int ip = 0; ip < nproj; ip++) - { - //============================ - // Use pseudo-atomic orbitals - //============================ - - const int L0 = infoNL_.Beta[T0].Proj[ip].getL(); // mohan add 2021-05-07 - natomwfc += 2 * L0 + 1; - } - - for (int dim = 0; dim < nlm.size(); dim++) - { - nlm[dim].resize(natomwfc); - for (auto& x: nlm[dim]) - { - x = 0.0; - } - } - - // rcut of orbtials and projectors - // in our calculation, we always put orbital phi at the left side of - // because = - const double Rcut1 = orb.Phi[T1].getRcut(); - const ModuleBase::Vector3 dRa = R0 - R1; - - double distance10 = dRa.norm(); - - bool all_out = true; - for (int ip = 0; ip < nproj; ip++) - { - const double Rcut0 = infoNL_.Beta[T0].Proj[ip].getRcut(); - if (distance10 > (Rcut1 + Rcut0)) - { - calproj[ip] = false; - } - else - { - all_out = false; - calproj[ip] = true; - } - } - - if (all_out) - { - ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); - return; - } - - const int mesh_r1 = orb.Phi[T1].PhiLN(L1, N1).getNr(); - const double* psi_1 = orb.Phi[T1].PhiLN(L1, N1).getPsi(); - const double dk_1 = orb.Phi[T1].PhiLN(L1, N1).getDk(); - - const int ridial_grid_num = 140; - const int angular_grid_num = 110; - std::vector r_ridial(ridial_grid_num); - std::vector weights_ridial(ridial_grid_num); - - int index = 0; - for (int nb = 0; nb < nproj; nb++) - { - const int L0 = infoNL_.Beta[T0].Proj[nb].getL(); - if (!calproj[nb]) - { - index += 2 * L0 + 1; - continue; - } - - const int mesh_r0 = infoNL_.Beta[T0].Proj[nb].getNr(); - const double* beta_r = infoNL_.Beta[T0].Proj[nb].getBeta_r(); - const double* radial0 = infoNL_.Beta[T0].Proj[nb].getRadial(); - const double dk_0 = infoNL_.Beta[T0].Proj[nb].getDk(); - - const double Rcut0 = infoNL_.Beta[T0].Proj[nb].getRcut(); - ModuleBase::Integral::Gauss_Legendre_grid_and_weight(radial0[0], - radial0[mesh_r0 - 1], - ridial_grid_num, - r_ridial.data(), - weights_ridial.data()); - - const double A_phase = A * R0; - const std::complex exp_iAR0 = std::exp(ModuleBase::IMAG_UNIT * A_phase); - - std::vector rly0(L0); - std::vector rly1(L1); - for (int ir = 0; ir < ridial_grid_num; ir++) - { - std::vector> result_angular(2 * L0 + 1, 0.0); - std::vector> result_angular_r_commu_x; - std::vector> result_angular_r_commu_y; - std::vector> result_angular_r_commu_z; - if (calc_r) - { - result_angular_r_commu_x.resize(2 * L0 + 1, 0.0); - result_angular_r_commu_y.resize(2 * L0 + 1, 0.0); - result_angular_r_commu_z.resize(2 * L0 + 1, 0.0); - } - - for (int ian = 0; ian < angular_grid_num; ian++) - { - const double x = ModuleBase::Integral::Lebedev_Laikov_grid110_x[ian]; - const double y = ModuleBase::Integral::Lebedev_Laikov_grid110_y[ian]; - const double z = ModuleBase::Integral::Lebedev_Laikov_grid110_z[ian]; - const double weights_angular = ModuleBase::Integral::Lebedev_Laikov_grid110_w[ian]; - const ModuleBase::Vector3 r_angular_tmp(x, y, z); - - const ModuleBase::Vector3 r_coor = r_ridial[ir] * r_angular_tmp; - const ModuleBase::Vector3 tmp_r_coor = r_coor + dRa; - const double tmp_r_coor_norm = tmp_r_coor.norm(); - if (tmp_r_coor_norm > Rcut1) - { - continue; - } - - ModuleBase::Vector3 tmp_r_unit; - if (tmp_r_coor_norm > 1e-10) - { - tmp_r_unit = tmp_r_coor / tmp_r_coor_norm; - } - - ModuleBase::Ylm::rl_sph_harm(L0, x, y, z, rly0); - - ModuleBase::Ylm::rl_sph_harm(L1, tmp_r_unit.x, tmp_r_unit.y, tmp_r_unit.z, rly1); - - const double phase = A * r_coor; - const std::complex exp_iAr = std::exp(ModuleBase::IMAG_UNIT * phase); - - const ModuleBase::Vector3 tmp_r_coor_r_commu = r_coor + R0; - const double interp_v = ModuleBase::PolyInt::Polynomial_Interpolation(psi_1, - mesh_r1, dk_1, tmp_r_coor_norm); - - for (int m0 = 0; m0 < 2 * L0 + 1; m0++) - { - std::complex temp = exp_iAr * rly0[L0 * L0 + m0] * rly1[L1 * L1 + m1] - * interp_v * weights_angular; - result_angular[m0] += temp; - - if (calc_r) - { - result_angular_r_commu_x[m0] += temp * tmp_r_coor_r_commu.x; - result_angular_r_commu_y[m0] += temp * tmp_r_coor_r_commu.y; - result_angular_r_commu_z[m0] += temp * tmp_r_coor_r_commu.z; - } - } - } - - int index_tmp = index; - const double temp = ModuleBase::PolyInt::Polynomial_Interpolation(beta_r, - mesh_r0, dk_0, r_ridial[ir]) * r_ridial[ir] * weights_ridial[ir]; - - if (!calc_r) - { - for (int m0 = 0; m0 < 2 * L0 + 1; m0++) - { - nlm[0][index_tmp] += temp * result_angular[m0] * exp_iAR0; - index_tmp++; - } - } - else - { - for (int m0 = 0; m0 < 2 * L0 + 1; m0++) - { - nlm[0][index_tmp] += temp * result_angular[m0] * exp_iAR0; - nlm[1][index_tmp] += temp * result_angular_r_commu_x[m0] * exp_iAR0; - nlm[2][index_tmp] += temp * result_angular_r_commu_y[m0] * exp_iAR0; - nlm[3][index_tmp] += temp * result_angular_r_commu_z[m0] * exp_iAR0; - index_tmp++; - } - } - } - - index += 2 * L0 + 1; - } - - for(int dim = 0; dim < nlm.size(); dim++) - { - for (auto &x : nlm[dim]) - { - // nlm[0] is - // nlm[1 or 2 or 3] is , a = x, y, z - x = std::conj(x); - } - } - - assert(index == natomwfc); - ModuleBase::timer::tick("module_tddft", "snap_psibeta_half_tddft"); - - return; -} - -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h b/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h deleted file mode 100644 index df736d3217..0000000000 --- a/source/source_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SNAP_PSIBETA_HALF_TDDFT -#define SNAP_PSIBETA_HALF_TDDFT - -#include -#include - -#include "source_base/vector3.h" -#include "source_basis/module_ao/ORB_read.h" -#include "source_cell/setup_nonlocal.h" - -namespace module_tddft -{ - // calculate the tddft nonlocal potential term - void snap_psibeta_half_tddft( - const LCAO_Orbitals &orb, - const InfoNonlocal &infoNL_, - std::vector>> &nlm, - const ModuleBase::Vector3 &R1, - const int &T1, - const int &L1, - const int &m1, - const int &N1, - const ModuleBase::Vector3 &R0, // The projector. - const int &T0, - const ModuleBase::Vector3 &A, - const bool &calc_r - ); - -} // namespace module_tddft - -#endif diff --git a/source/source_hamilt_lcao/module_tddft/solve_propagation.cpp b/source/source_hamilt_lcao/module_tddft/solve_propagation.cpp deleted file mode 100644 index 5271f2fec3..0000000000 --- a/source/source_hamilt_lcao/module_tddft/solve_propagation.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "solve_propagation.h" - -#include - -#include "source_base/lapack_connector.h" -#include "source_base/scalapack_connector.h" -#include "source_pw/hamilt_pwdft/global.h" - -namespace module_tddft -{ -#ifdef __MPI -void solve_propagation(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const double dt, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* psi_k_laststep, - std::complex* psi_k) -{ - // (1) init A,B and copy Htmp to A & B - std::complex* operator_A = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(operator_A, pv->nloc); - BlasConnector::copy(pv->nloc, Htmp, 1, operator_A, 1); - - std::complex* operator_B = new std::complex[pv->nloc]; - ModuleBase::GlobalFunc::ZEROS(operator_B, pv->nloc); - BlasConnector::copy(pv->nloc, Htmp, 1, operator_B, 1); - - const double dt_au = dt / ModuleBase::AU_to_FS; - - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (2) compute operator_A & operator_B by GEADD - // operator_A = Stmp + i*para * Htmp; beta2 = para = 0.25 * dt - // operator_B = Stmp - i*para * Htmp; beta1 = - para = -0.25 * dt - std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * dt_au}; - std::complex beta2 = {0.0, 0.25 * dt_au}; - - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - pv->desc, - beta2, - operator_A, - 1, - 1, - pv->desc); - ScalapackConnector::geadd('N', - nlocal, - nlocal, - alpha, - Stmp, - 1, - 1, - pv->desc, - beta1, - operator_B, - 1, - 1, - pv->desc); - // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - // (3) b = operator_B @ psi_k_laststep - std::complex* tmp_b = new std::complex[pv->nloc_wfc]; - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - operator_B, - 1, - 1, - pv->desc, - psi_k_laststep, - 1, - 1, - pv->desc_wfc, - 0.0, - tmp_b, - 1, - 1, - pv->desc_wfc); - //get ipiv - int* ipiv = new int[pv->nloc]; - int info = 0; - // (4) solve Ac=b - ScalapackConnector::gesv(nlocal, - nband, - operator_A, - 1, - 1, - pv->desc, - ipiv, - tmp_b, - 1, - 1, - pv->desc_wfc, - &info); - - //copy solution to psi_k - BlasConnector::copy(pv->nloc_wfc, tmp_b, 1, psi_k, 1); - - delete []tmp_b; - delete []ipiv; - delete []operator_A; - delete []operator_B; -} -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/solve_propagation.h b/source/source_hamilt_lcao/module_tddft/solve_propagation.h deleted file mode 100644 index fc707b20d7..0000000000 --- a/source/source_hamilt_lcao/module_tddft/solve_propagation.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef TD_SOLVE_PROPAGATION_H -#define TD_SOLVE_PROPAGATION_H - -#include "source_basis/module_ao/parallel_orbitals.h" -#include - -namespace module_tddft -{ -#ifdef __MPI -/** -* @brief solve propagation equation A@c(t+dt) = B@c(t) -* -* @param[in] pv information of parallel -* @param[in] nband number of bands -* @param[in] nlocal number of orbitals -* @param[in] dt time interval -* @param[in] Stmp overlap matrix S(t+dt/2) -* @param[in] Htmp H(t+dt/2) -* @param[in] psi_k_laststep psi of last step -* @param[out] psi_k psi of this step -*/ -void solve_propagation(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const double dt, - const std::complex* Stmp, - const std::complex* Htmp, - const std::complex* psi_k_laststep, - std::complex* psi_k); - -#endif -} // namespace module_tddft - -#endif // TD_SOLVE_H \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/td_folding.cpp b/source/source_hamilt_lcao/module_tddft/td_folding.cpp deleted file mode 100644 index d7eefd240e..0000000000 --- a/source/source_hamilt_lcao/module_tddft/td_folding.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "td_info.h" -#include "source_base/libm/libm.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" -template -void TD_info::folding_HR_td(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type) -{ -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int i = 0; i < hR.size_atom_pairs(); ++i) - { - hamilt::AtomPair& tmp = hR.get_atom_pair(i); - for(int ir = 0;ir < tmp.get_R_size(); ++ir ) - { - const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); - - //new - //cal tddft phase for hybrid gague - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - ModuleBase::Vector3 dtau = ucell->cal_dtau(iat1, iat2, r_index); - const double arg_td = cart_At * dtau * ucell->lat0; - //new - - // cal k_phase - // if TK==std::complex, kphase is e^{ikR} - const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI + arg_td; - double sinp, cosp; - ModuleBase::libm::sincos(arg, &sinp, &cosp); - std::complex kphase = std::complex(cosp, sinp); - - tmp.find_R(r_index); - tmp.add_to_matrix(hk, ncol, kphase, hk_type); - } - } -} -template -void TD_info::folding_HR_td(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); -template -void TD_info::folding_HR_td>(const hamilt::HContainer>& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); \ No newline at end of file diff --git a/source/source_hamilt_lcao/module_tddft/td_info.cpp b/source/source_hamilt_lcao/module_tddft/td_info.cpp deleted file mode 100644 index 26e2bab0a5..0000000000 --- a/source/source_hamilt_lcao/module_tddft/td_info.cpp +++ /dev/null @@ -1,227 +0,0 @@ -#include "td_info.h" - -#include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_parameter/parameter.h" - -bool TD_info::out_mat_R = false; -bool TD_info::out_vecpot = false; -bool TD_info::out_current = false; -bool TD_info::out_current_k = false; -bool TD_info::init_vecpot_file = false; -bool TD_info::evolve_once = false; - -TD_info* TD_info::td_vel_op = nullptr; - -int TD_info::estep_shift = 0; -int TD_info::istep = -1; -int TD_info::max_istep = -1; -std::vector> TD_info::At_from_file; - -TD_info::TD_info(const UnitCell* ucell_in) -{ - this->ucell = ucell_in; - if (init_vecpot_file && istep == -1) - { - this->read_cart_At(); - } - //read in restart step - if(PARAM.inp.mdp.md_restart) - { - std::stringstream ssc; - ssc << PARAM.globalv.global_readin_dir << "Restart_td.dat"; - std::ifstream file(ssc.str().c_str()); - if (!file) - { - ModuleBase::WARNING_QUIT("TD_info::TD_info", "No Restart_td.dat!"); - } - file >> estep_shift; - std::cout<<"estep_shift"<istep += estep_shift; - return; -} -TD_info::~TD_info() -{ - if(elecstate::H_TDDFT_pw::stype == 1) - { - this->destroy_HS_R_td_sparse(); - } - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] != nullptr) - { - delete this->current_term[dir]; - } - } -} - -void TD_info::output_cart_At(const std::string& out_dir) -{ - if (GlobalV::MY_RANK == 0) - { - std::string out_file; - // generate the output file name - out_file = out_dir + "At.dat"; - std::ofstream ofs; - // output title - if (istep == estep_shift) - { - ofs.open(out_file.c_str(), std::ofstream::out); - ofs << std::left << std::setw(8) << "#istep" << std::setw(15) << "A_x" << std::setw(15) << "A_y" - << std::setw(15) << "A_z" << std::endl; - } - else - { - ofs.open(out_file.c_str(), std::ofstream::app); - } - // output the vector potential - ofs << std::left << std::setw(8) << istep; - // divide by 2.0 to get the atomic unit - for (int i = 0; i < 3; i++) - { - ofs << std::scientific << std::setprecision(4) << std::setw(15) << cart_At[i]; - } - ofs << std::endl; - ofs.close(); - } - return; -} - -void TD_info::cal_cart_At(const ModuleBase::Vector3& At) -{ - istep++; - if (init_vecpot_file) - { - this->cart_At = At_from_file[istep > max_istep ? max_istep : istep]; - } - else - { - // transfrom into atomic unit - this->cart_At = At / 2.0; - } - // output the vector potential if needed - if (out_vecpot == true) - { - this->output_cart_At(PARAM.globalv.global_out_dir); - } -} - -void TD_info::read_cart_At(void) -{ - std::string in_file; - // generate the input file name - in_file = "At.dat"; - std::ifstream ifs(in_file.c_str()); - // check if the file is exist - if (!ifs) - { - ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Cannot open Vector potential file!"); - } - std::string line; - std::vector str_vec; - // use tmp to skip the istep number - int tmp = 0; - while (std::getline(ifs, line)) - { - // A tmporary vector3 to store the data of this line - ModuleBase::Vector3 At; - if (line[0] == '#') - { - continue; - } - std::istringstream iss(line); - // skip the istep number - if (!(iss >> tmp)) - { - ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Error reading istep!"); - } - // read the vector potential - double component = 0; - // Read three components - for (int i = 0; i < 3; i++) - { - if (!(iss >> component)) - { - ModuleBase::WARNING_QUIT("TD_info::read_cart_At", - "Error reading component " + std::to_string(i + 1) + " for istep " - + std::to_string(tmp) + "!"); - } - At[i] = component; - } - // add the tmporary vector3 to the vector potential vector - At_from_file.push_back(At); - } - // set the max_istep - max_istep = At_from_file.size() - 1; - ifs.close(); - - return; -} -void TD_info::out_restart_info(const int nstep, - const ModuleBase::Vector3& At_current, - const ModuleBase::Vector3& At_laststep) -{ - if (GlobalV::MY_RANK == 0) - { - // open file - std::string outdir = PARAM.globalv.global_out_dir + "Restart_td.dat"; - std::ofstream outFile(outdir); - if (!outFile) { - ModuleBase::WARNING_QUIT("out_restart_info", "no Restart_td.dat!"); - } - // write data - outFile << nstep << std::endl; - outFile << At_current[0] << " " << At_current[1] << " " << At_current[2] << std::endl; - outFile << At_laststep[0] << " " << At_laststep[1] << " " << At_laststep[2] << std::endl; - outFile.close(); - } - - - return; -} - -void TD_info::initialize_current_term(const hamilt::HContainer>* HR, - const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("TD_info", "initialize_current_term"); - ModuleBase::timer::tick("TD_info", "initialize_current_term"); - - for (int dir = 0; dir < 3; dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - - for (int i = 0; i < HR->size_atom_pairs(); ++i) - { - hamilt::AtomPair>& tmp = HR->get_atom_pair(i); - for (int ir = 0; ir < tmp.get_R_size(); ++ir) - { - const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); - const int iat1 = tmp.get_atom_i(); - const int iat2 = tmp.get_atom_j(); - - hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->insert_pair(tmp1); - } - } - } - for (int dir = 0; dir < 3; dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - - ModuleBase::timer::tick("TD_info", "initialize_current_term"); -} - -void TD_info::destroy_HS_R_td_sparse(void) -{ - std::map, std::map>>> - empty_HR_sparse_td_vel_up; - std::map, std::map>>> - empty_HR_sparse_td_vel_down; - HR_sparse_td_vel[0].swap(empty_HR_sparse_td_vel_up); - HR_sparse_td_vel[1].swap(empty_HR_sparse_td_vel_down); -} diff --git a/source/source_hamilt_lcao/module_tddft/td_info.h b/source/source_hamilt_lcao/module_tddft/td_info.h deleted file mode 100644 index 79026c3b64..0000000000 --- a/source/source_hamilt_lcao/module_tddft/td_info.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef TD_INFO_H -#define TD_INFO_H -#include "source_base/abfs-vector3_order.h" -#include "source_base/timer.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" - -#include -// Class to store TDDFT infos, mainly for periodic system. -class TD_info -{ - public: - TD_info(const UnitCell* ucell_in); - ~TD_info(); - - void init(); - - /// @brief switch to control the output of HR - static bool out_mat_R; - - /// @brief pointer to the only TD_info object itself - static TD_info* td_vel_op; - - /// @brief switch to control the output of At - static bool out_vecpot; - - /// @brief switch to control the output of current - static bool out_current; - - /// @brief switch to control the format of the output current, in total or in each k-point - static bool out_current_k; - - /// @brief switch to control the source of At - static bool init_vecpot_file; - - /// @brief if need to calculate more than once - static bool evolve_once; - - /// @brief Restart step - static int estep_shift; - - /// @brief Store the vector potential for tddft calculation - ModuleBase::Vector3 cart_At; - - /// @brief calculate the At in cartesian coordinate - void cal_cart_At(const ModuleBase::Vector3& At); - - /// @brief output RT-TDDFT info for restart - void out_restart_info(const int nstep, - const ModuleBase::Vector3& At_current, - const ModuleBase::Vector3& At_laststep); - - // allocate memory for current term. - void initialize_current_term(const hamilt::HContainer>* HR, const Parallel_Orbitals* paraV); - - hamilt::HContainer>* get_current_term_pointer(const int& i) const - { - return this->current_term[i]; - } - - - // folding HR to hk, for hybrid gague - template - void folding_HR_td(const hamilt::HContainer& hR, - std::complex* hk, - const ModuleBase::Vector3& kvec_d_in, - const int ncol, - const int hk_type); - - int get_istep() - { - return istep; - } - - const UnitCell* get_ucell() - { - return this->ucell; - } - - // For TDDFT velocity gauge, to fix the output of HR - std::map, std::map>>> HR_sparse_td_vel[2]; - - private: - /// @brief pointer to the unit cell - const UnitCell* ucell = nullptr; - - /// @brief read At from output file - void read_cart_At(); - - /// @brief output cart_At to output file - void output_cart_At(const std::string& out_dir); - - /// @brief store isteps now - static int istep; - - /// @brief total steps of read in At - static int max_istep; - - /// @brief store the read in At_data - static std::vector> At_from_file; - - /// @brief destory HSR data stored - void destroy_HS_R_td_sparse(); - - /// @brief part of Momentum operator, -iāˆ‡ - i[r,Vnl]. Used to calculate current. - std::vector>*> current_term = {nullptr, nullptr, nullptr}; -}; - -#endif diff --git a/source/source_hamilt_lcao/module_tddft/upsi.cpp b/source/source_hamilt_lcao/module_tddft/upsi.cpp deleted file mode 100644 index 15d78f19e2..0000000000 --- a/source/source_hamilt_lcao/module_tddft/upsi.cpp +++ /dev/null @@ -1,271 +0,0 @@ -#include "upsi.h" - -#include "source_base/lapack_connector.h" -#include "source_base/module_container/ATen/kernels/blas.h" -#include "source_base/scalapack_connector.h" - -#include -#include - -namespace module_tddft -{ -#ifdef __MPI -void upsi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* U_operator, - const std::complex* psi_k_laststep, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - U_operator, - 1, - 1, - pv->desc, - psi_k_laststep, - 1, - 1, - pv->desc_wfc, - 0.0, - psi_k, - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k[in + j].real(); - double bb = psi_k[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k_laststep:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k_laststep[in + j].real(); - double bb = psi_k_laststep[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -void upsi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - ScalapackConnector::gemm('N', - 'N', - nlocal, - nband, - nlocal, - 1.0, - U_operator.data>(), - 1, - 1, - pv->desc, - psi_k_laststep.data>(), - 1, - 1, - pv->desc_wfc, - 0.0, - psi_k.data>(), - 1, - 1, - pv->desc_wfc); - - if (print_matrix) - { - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k.data>()[in + j].real(); - double bb = psi_k.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k_laststep:" << std::endl; - for (int i = 0; i < pv->ncol_bands; i++) - { - const int in = i * pv->ncol; - for (int j = 0; j < pv->ncol; j++) - { - double aa = psi_k_laststep.data>()[in + j].real(); - double bb = psi_k_laststep.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -template -void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix) -{ - // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice - ct::DeviceType ct_device_type = ct::DeviceTypeToEnum::value; - // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU - using ct_Device = typename ct::PsiToContainer::type; - - // Perform the matrix multiplication: psi_k = U_operator * psi_k_laststep - std::complex alpha = {1.0, 0.0}; - std::complex beta = {0.0, 0.0}; - - ct::kernels::blas_gemm, ct_Device>()('N', - 'N', - nlocal, - nband, - nlocal, - &alpha, - U_operator.data>(), - nlocal, - psi_k_laststep.data>(), - nlocal, - &beta, - psi_k.data>(), - nlocal); - - if (print_matrix) - { - ct::Tensor psi_k_cpu = psi_k.to_device(); - ct::Tensor psi_k_laststep_cpu = psi_k_laststep.to_device(); - - ofs_running << std::endl; - ofs_running << " psi_k:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = psi_k_cpu.data>()[in + j].real(); - double bb = psi_k_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - ofs_running << " psi_k_laststep:" << std::endl; - for (int i = 0; i < nband; i++) - { - const int in = i * nlocal; - for (int j = 0; j < nlocal; j++) - { - double aa = psi_k_laststep_cpu.data>()[in + j].real(); - double bb = psi_k_laststep_cpu.data>()[in + j].imag(); - if (std::abs(aa) < 1e-8) - { - aa = 0.0; - } - if (std::abs(bb) < 1e-8) - { - bb = 0.0; - } - ofs_running << aa << "+" << bb << "i "; - } - ofs_running << std::endl; - } - ofs_running << std::endl; - } -} - -// Explicit instantiation of template functions -template void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#if ((defined __CUDA) /* || (defined __ROCM) */) -template void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); -#endif // __CUDA -#endif // __MPI -} // namespace module_tddft diff --git a/source/source_hamilt_lcao/module_tddft/upsi.h b/source/source_hamilt_lcao/module_tddft/upsi.h deleted file mode 100644 index 459613b74b..0000000000 --- a/source/source_hamilt_lcao/module_tddft/upsi.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file upsi.h - * @brief apply U_operator to the wave function of the previous step for new wave function - * This file originally belonged to file LCAO_evolve.cpp - */ - -#ifndef UPSI_H -#define UPSI_H - -#include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor -#include "source_basis/module_ao/parallel_orbitals.h" - -#include - -namespace module_tddft -{ -#ifdef __MPI -/** - * @brief apply U_operator to the wave function of the previous step for new wave function - * - * @param[in] pv information of parallel - * @param[in] nband number of bands - * @param[in] nlocal number of orbitals - * @param[in] U_operator operator of propagator - * @param[in] psi_k_laststep psi of last step - * @param[in] print_matirx print internal matrix or not - * @param[out] psi_k psi of this step - */ -void upsi(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const std::complex* U_operator, - const std::complex* psi_k_laststep, - std::complex* psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -void upsi_tensor(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -template -void upsi_tensor_lapack(const Parallel_Orbitals* pv, - const int nband, - const int nlocal, - const ct::Tensor& U_operator, - const ct::Tensor& psi_k_laststep, - ct::Tensor& psi_k, - std::ofstream& ofs_running, - const int print_matrix); - -#endif // __MPI -} // namespace module_tddft - -#endif diff --git a/source/source_hamilt_lcao/module_tddft/velocity_op.cpp b/source/source_hamilt_lcao/module_tddft/velocity_op.cpp deleted file mode 100644 index 7534b705ba..0000000000 --- a/source/source_hamilt_lcao/module_tddft/velocity_op.cpp +++ /dev/null @@ -1,532 +0,0 @@ -#include "velocity_op.h" -#include "source_base/timer.h" -#include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" -#ifdef _OPENMP -#include -#include -#endif -#include "module_parameter/parameter.h" -template -cal_r_overlap_R Velocity_op::r_calculator; -template -bool Velocity_op::init_done = false; -template -Velocity_op::Velocity_op(const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator* intor) - : ucell(ucell_in), paraV(paraV) , orb_(orb), intor_(intor) -{ - // for length gague, the A(t) = 0 for all the time. - this->cart_At = ModuleBase::Vector3(0,0,0); - this->initialize_grad_term(GridD_in, paraV); - this->initialize_vcomm_r(GridD_in, paraV); -} -template -Velocity_op::~Velocity_op() -{ - for (int dir=0;dir<3;dir++) - { - delete this->current_term[dir]; - } -} -//allocate space for current_term -template -void Velocity_op::initialize_vcomm_r(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("Velocity_op", "initialize_vcomm_r"); - ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); - if(!init_done) - { - std::cout << "init_r_overlap_nonlocal" <current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - this->adjs_vcommr.clear(); - this->adjs_vcommr.reserve(this->ucell->nat); - for (int iat0 = 0; iat0 < ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_vcommr.push_back(adjs); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) - { - continue; - } - hamilt::AtomPair> tmp(iat1, - iat2, - R_index2.x - R_index1.x, - R_index2.y - R_index1.y, - R_index2.z - R_index1.z, - paraV); - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->insert_pair(tmp); - } - } - } - } - // allocate the memory of BaseMatrix in cal_vcomm_r_IJR, and set the new values to zero - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); -} -template -void Velocity_op::initialize_grad_term(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) -{ - ModuleBase::TITLE("Velocity_op", "initialize_grad_term"); - ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); - for (int dir=0;dir<3;dir++) - { - if (this->current_term[dir] == nullptr) - this->current_term[dir] = new hamilt::HContainer>(paraV); - } - this->adjs_grad.clear(); - this->adjs_grad.reserve(this->ucell->nat); - for (int iat1 = 0; iat1 < ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo adjs; - GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); - std::vector is_adj(adjs.adj_num + 1, false); - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T2 = adjs.ntype[ad1]; - const int I2 = adjs.natom[ad1]; - const int iat2 = ucell->itia2iat(T2, I2); - if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) - { - continue; - } - const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; - // choose the real adjacent atoms - // Note: the distance of atoms should less than the cutoff radius, - // When equal, the theoretical value of matrix element is zero, - // but the calculated value is not zero due to the numerical error, which would lead to result changes. - if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 - < orb_.Phi[T1].getRcut() + orb_.Phi[T2].getRcut()) - { - is_adj[ad1] = true; - } - } - filter_adjs(is_adj, adjs); - this->adjs_grad.push_back(adjs); - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index = adjs.box[ad]; - hamilt::AtomPair> tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->insert_pair(tmp); - } - } - } - // allocate the memory of BaseMatrix in HR, and set the new values to zero - for (int dir=0;dir<3;dir++) - { - this->current_term[dir]->allocate(nullptr, true); - } - - ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); -} -template -void Velocity_op::calculate_vcomm_r() -{ - ModuleBase::TITLE("Velocity_op", "calculate_vcomm_r"); - ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); - - const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); - const int npol = this->ucell->get_npol(); - - // 1. calculate for each pair of atoms - for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) - { - auto tau0 = ucell->get_tau(iat0); - int T0, I0; - ucell->iat2iait(iat0, &I0, &T0); - AdjacentAtomInfo& adjs = this->adjs_vcommr[iat0]; - std::vector>>> nlm_tot; - nlm_tot.resize(adjs.adj_num + 1); - for (int i = 0; i < adjs.adj_num + 1; i++) - { - nlm_tot[i].resize(4); - } - - #pragma omp parallel - { - #pragma omp for schedule(dynamic) - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; - const Atom* atom1 = &ucell->atoms[T1]; - auto all_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat1); - // insert col_indexes into all_indexes to get universal set with no repeat elements - all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); - std::sort(all_indexes.begin(), all_indexes.end()); - all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); - for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) - { - const int iw1 = all_indexes[iw1l] / npol; - //std::vector>> nlm; - std::vector> nlm; - // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false - // and size of outer vector is 4 when out_current is true (3 for , 1 for - // ) inner loop : all projectors (L0,M0) - - // snap_psibeta_half_tddft() are used to calculate - // and as well if current are needed - ModuleBase::Vector3 dtau = tau0 - tau1; - - r_calculator.get_psi_r_beta(*ucell, - nlm, - tau1 * this->ucell->lat0, - T1, - atom1->iw2l[iw1], - atom1->iw2m[iw1], - atom1->iw2n[iw1], - tau0 * this->ucell->lat0, - T0); - for (int dir = 0; dir < 4; dir++) - { - nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); - } - } - } - - #ifdef _OPENMP - // record the iat number of the adjacent atoms - std::set ad_atom_set; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T1 = adjs.ntype[ad]; - const int I1 = adjs.natom[ad]; - const int iat1 = ucell->itia2iat(T1, I1); - ad_atom_set.insert(iat1); - } - - // split the ad_atom_set into num_threads parts - const int num_threads = omp_get_num_threads(); - const int thread_id = omp_get_thread_num(); - std::set ad_atom_set_thread; - int i = 0; - for(const auto iat1 : ad_atom_set) - { - if (i % num_threads == thread_id) - { - ad_atom_set_thread.insert(iat1); - } - i++; - } - #endif - // 2. calculate D for each pair of atoms - for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) - { - const int T1 = adjs.ntype[ad1]; - const int I1 = adjs.natom[ad1]; - const int iat1 = ucell->itia2iat(T1, I1); - #ifdef _OPENMP - if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) - { - continue; - } - #endif - ModuleBase::Vector3& R_index1 = adjs.box[ad1]; - for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) - { - const int T2 = adjs.ntype[ad2]; - const int I2 = adjs.natom[ad2]; - const int iat2 = ucell->itia2iat(T2, I2); - ModuleBase::Vector3& R_index2 = adjs.box[ad2]; - ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], - R_index2[1] - R_index1[1], - R_index2[2] - R_index1[2]); - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2])->get_pointer(); - } - // if not found , skip this pair of atoms - if (tmp_c[0] != nullptr) - { - this->cal_vcomm_r_IJR(iat1, - iat2, - T0, - paraV, - nlm_tot[ad1], - nlm_tot[ad2], - tmp_c); - } - } - } - } - } - ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); -} - -// cal_HR_IJR() -template -void Velocity_op::cal_vcomm_r_IJR( - const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>& nlm1_all, - const std::vector>>& nlm2_all, - std::complex** current_mat_p) -{ - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - // --------------------------------------------- - // calculate the Nonlocal matrix for each pair of orbitals - // --------------------------------------------- - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 - std::vector step_trace(npol * npol, 0); - for (int is = 0; is < npol; is++) - { - for (int is2 = 0; is2 < npol; is2++) - { - step_trace[is * npol + is2] = col_indexes.size() * is + is2; - } - } - // calculate the local matrix - const TR* tmp_d = nullptr; - for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); - //std::vector>*> nlm1; - std::vector*> nlm1; - for (int dir = 0; dir < 4; dir++) - { - nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); - } - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - //std::vector>*> nlm2; - std::vector*> nlm2; - for (int dir = 0; dir < 4; dir++) - { - nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); - } - -#ifdef __DEBUG - assert(nlm1.size() == nlm2.size()); -#endif - for (int is = 0; is < npol * npol; ++is) - { - for (int dir = 0; dir < 3; dir++) - { - std::complex nlm_r_tmp = std::complex{0, 0}; - std::complex imag_unit = std::complex{0, 1}; - for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) - { - const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; - const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; - this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); - //- - // multiply d in the end - TR tmp = (nlm1[dir + 1]->at(p1) * nlm2[0]->at(p2) - - nlm1[0]->at(p1) * nlm2[dir + 1]->at(p2)) - * (*tmp_d); - nlm_r_tmp += tmp; - } - // -i[r,Vnl], 2.0 due to the unit transformation - current_mat_p[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += npol; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } -} -template -void Velocity_op::calculate_grad_term() -{ - ModuleBase::TITLE("Velocity_op", "calculate_grad_term"); - if(this->current_term[0]==nullptr || this->current_term[0]->size_atom_pairs()<=0) - { - ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "grad_term is nullptr or empty"); - } - ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); - - const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) - { - auto tau1 = ucell->get_tau(iat1); - int T1, I1; - ucell->iat2iait(iat1, &I1, &T1); - AdjacentAtomInfo& adjs = this->adjs_grad[iat1]; - for (int ad = 0; ad < adjs.adj_num + 1; ++ad) - { - const int T2 = adjs.ntype[ad]; - const int I2 = adjs.natom[ad]; - const int iat2 = ucell->itia2iat(T2, I2); - const ModuleBase::Vector3& R_index2 = adjs.box[ad]; - ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); - - std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; - for (int i = 0; i < 3; i++) - { - tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_index2)->get_pointer(); - } - if (tmp_c[0] != nullptr) - { - this->cal_grad_IJR(iat1, iat2, paraV, dtau, tmp_c); - } - else - { - ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "R_index not found in HR"); - } - } - } - ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); -} -template -void Velocity_op::cal_grad_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex** current_mat_p) -{ - // --------------------------------------------- - // get info of orbitals of atom1 and atom2 from ucell - // --------------------------------------------- - int T1, I1; - this->ucell->iat2iait(iat1, &I1, &T1); - int T2, I2; - this->ucell->iat2iait(iat2, &I2, &T2); - Atom& atom1 = this->ucell->atoms[T1]; - Atom& atom2 = this->ucell->atoms[T2]; - - // npol is the number of polarizations, - // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), - // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) - const int npol = this->ucell->get_npol(); - - const int* iw2l1 = atom1.iw2l.data(); - const int* iw2n1 = atom1.iw2n.data(); - const int* iw2m1 = atom1.iw2m.data(); - const int* iw2l2 = atom2.iw2l.data(); - const int* iw2n2 = atom2.iw2n.data(); - const int* iw2m2 = atom2.iw2m.data(); - // --------------------------------------------- - // get tau1 (in cell <0,0,0>) and tau2 (in cell R) - // in principle, only dtau is needed in this function - // snap_psipsi should be refactored to use dtau directly - // --------------------------------------------- - const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); - const ModuleBase::Vector3 tau2 = tau1 + dtau; - // --------------------------------------------- - // calculate the Ekinetic matrix for each pair of orbitals - // --------------------------------------------- - double grad[3] = {0, 0, 0}; - auto row_indexes = paraV->get_indexes_row(iat1); - auto col_indexes = paraV->get_indexes_col(iat2); - const int step_trace = col_indexes.size() + 1; - for(int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) - { - const int iw1 = row_indexes[iw1l] / npol; - const int L1 = iw2l1[iw1]; - const int N1 = iw2n1[iw1]; - const int m1 = iw2m1[iw1]; - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; - - for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) - { - const int iw2 = col_indexes[iw2l] / npol; - const int L2 = iw2l2[iw2]; - const int N2 = iw2n2[iw2]; - const int m2 = iw2m2[iw2]; - // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) - int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; - - // calculate , which equals to -. - intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, nullptr, grad); - ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); - - for (int dir = 0; dir < 3; dir++) - { - for (int ipol = 0; ipol < npol; ipol++) - { - // part of Momentum operator, -iāˆ‡r,used to calculate the current - // here is actually iāˆ‡R - current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); - } - current_mat_p[dir] += npol; - } - } - for (int dir = 0; dir < 3; dir++) - { - current_mat_p[dir] += (npol - 1) * col_indexes.size(); - } - } -} -template class Velocity_op; -template class Velocity_op>; diff --git a/source/source_hamilt_lcao/module_tddft/velocity_op.h b/source/source_hamilt_lcao/module_tddft/velocity_op.h deleted file mode 100644 index cebf99c214..0000000000 --- a/source/source_hamilt_lcao/module_tddft/velocity_op.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef TD_VELOCITY_OP_H -#define TD_VELOCITY_OP_H -#include -#include "source_basis/module_ao/parallel_orbitals.h" -#include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "source_basis/module_nao/two_center_integrator.h" -#include "source_base/vector3.h" -#include "module_io/cal_r_overlap_R.h" - -//design to calculate velocity operator -template -class Velocity_op -{ - public: - Velocity_op(const UnitCell* ucell_in, - const Grid_Driver* GridD_in, - const Parallel_Orbitals* paraV, - const LCAO_Orbitals& orb, - const TwoCenterIntegrator* intor); - ~Velocity_op(); - - hamilt::HContainer>* get_current_term_pointer(const int& i)const - { - return this->current_term[i]; - } - void calculate_vcomm_r(); - void calculate_grad_term(); - - private: - const UnitCell* ucell = nullptr; - - const Parallel_Orbitals* paraV = nullptr; - - const LCAO_Orbitals& orb_; - - /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only shared between TD operators. - std::vector>*> current_term = {nullptr, nullptr, nullptr}; - - const TwoCenterIntegrator* intor_ = nullptr; - const TwoCenterIntegrator* intorbeta_ = nullptr; - - /** - * @brief initialize HR, search the nearest neighbor atoms - * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs - * the size of HR will be fixed after initialization - */ - void initialize_vcomm_r(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); - void initialize_grad_term(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); - - /** - * @brief calculate the HR local matrix of atom pair - */ - void cal_vcomm_r_IJR(const int& iat1, - const int& iat2, - const int& T0, - const Parallel_Orbitals* paraV, - const std::vector>>& nlm1_all, - const std::vector>>& nlm2_all, - std::complex** current_mat_p); - void cal_grad_IJR(const int& iat1, - const int& iat2, - const Parallel_Orbitals* paraV, - const ModuleBase::Vector3& dtau, - std::complex** current_mat_p); - - /// @brief exact the nearest neighbor atoms from all adjacent atoms - std::vector adjs_vcommr; - std::vector adjs_grad; - - /// @brief Store the vector potential for td_ekinetic term - ModuleBase::Vector3 cart_At; - static cal_r_overlap_R r_calculator; - static bool init_done; -}; - - -#endif // TD_CURRENT_H From fc061bb47a7add196834d3804f6eaf0b7ac6fb3f Mon Sep 17 00:00:00 2001 From: HTZhao <104255052+ESROAMER@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:45:37 +0800 Subject: [PATCH 80/81] Add files via upload --- .../source_lcao/hamilt_lcaodft/CMakeLists.txt | 1 + .../hamilt_lcaodft/hamilt_lcao.cpp | 36 +- .../operator_lcao/CMakeLists.txt | 1 + .../operator_lcao/operator_lcao.cpp | 41 +- .../operator_lcao/overlap_new.cpp | 48 +- .../operator_lcao/td_ekinetic_lcao.cpp | 73 +-- .../operator_lcao/td_ekinetic_lcao.h | 10 +- .../operator_lcao/td_nonlocal_lcao.cpp | 57 +- .../operator_lcao/td_nonlocal_lcao.h | 8 +- .../operator_lcao/td_pot_hybrid.cpp | 300 ++++++++++ .../operator_lcao/td_pot_hybrid.h | 129 +++++ .../source_lcao/hamilt_lcaodft/spar_hsr.cpp | 14 +- .../source_lcao/module_tddft/CMakeLists.txt | 5 +- .../source_lcao/module_tddft/evolve_elec.cpp | 4 +- source/source_lcao/module_tddft/evolve_elec.h | 5 +- .../source_lcao/module_tddft/evolve_psi.cpp | 6 +- source/source_lcao/module_tddft/evolve_psi.h | 2 +- .../module_tddft/solve_propagation.cpp | 7 +- .../source_lcao/module_tddft/td_folding.cpp | 53 ++ source/source_lcao/module_tddft/td_info.cpp | 227 ++++++++ source/source_lcao/module_tddft/td_info.h | 108 ++++ .../source_lcao/module_tddft/velocity_op.cpp | 532 ++++++++++++++++++ source/source_lcao/module_tddft/velocity_op.h | 79 +++ 23 files changed, 1605 insertions(+), 141 deletions(-) create mode 100644 source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp create mode 100644 source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h create mode 100644 source/source_lcao/module_tddft/td_folding.cpp create mode 100644 source/source_lcao/module_tddft/td_info.cpp create mode 100644 source/source_lcao/module_tddft/td_info.h create mode 100644 source/source_lcao/module_tddft/velocity_op.cpp create mode 100644 source/source_lcao/module_tddft/velocity_op.h diff --git a/source/source_lcao/hamilt_lcaodft/CMakeLists.txt b/source/source_lcao/hamilt_lcaodft/CMakeLists.txt index 2f1cd951ae..ba00725b73 100644 --- a/source/source_lcao/hamilt_lcaodft/CMakeLists.txt +++ b/source/source_lcao/hamilt_lcaodft/CMakeLists.txt @@ -13,6 +13,7 @@ if(ENABLE_LCAO) operator_lcao/nonlocal_new.cpp operator_lcao/td_ekinetic_lcao.cpp operator_lcao/td_nonlocal_lcao.cpp + operator_lcao/td_pot_hybrid.cpp operator_lcao/dspin_lcao.cpp operator_lcao/dftu_lcao.cpp pulay_force_stress_center2.cpp diff --git a/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp b/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp index 0a4fd2a802..87867bb927 100644 --- a/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp @@ -3,14 +3,14 @@ #include "source_base/global_variable.h" #include "source_base/memory.h" #include "source_base/timer.h" -#include "source_lcao/module_dftu/dftu.h" +#include "module_hamilt_lcao/module_dftu/dftu.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #include #ifdef __MLALGO -#include "source_lcao/module_deepks/LCAO_deepks.h" +#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" #include "operator_lcao/deepks_lcao.h" #endif @@ -25,8 +25,8 @@ #include "source_estate/module_pot/H_TDDFT_pw.h" #include "source_hamilt/module_xc/xc_functional.h" -#include "source_lcao/module_deltaspin/spin_constrain.h" -#include "source_lcao/module_hcontainer/hcontainer_funcs.h" +#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_hsolver/hsolver_lcao.h" #include "operator_lcao/dftu_lcao.h" #include "operator_lcao/dspin_lcao.h" @@ -38,6 +38,7 @@ #include "operator_lcao/overlap_new.h" #include "operator_lcao/td_ekinetic_lcao.h" #include "operator_lcao/td_nonlocal_lcao.h" +#include "operator_lcao/td_pot_hybrid.h" #include "operator_lcao/veff_lcao.h" namespace hamilt @@ -344,12 +345,8 @@ HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, } #endif // TDDFT_velocity_gauge - if (TD_Velocity::tddft_velocity) + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { - if (!TD_Velocity::init_vecpot_file) - { - elecstate::H_TDDFT_pw::update_At(); - } Operator* td_ekinetic = new TDEkinetic>(this->hsk, this->hR, this->kv, @@ -359,10 +356,27 @@ HamiltLCAO::HamiltLCAO(Gint_Gamma* GG_in, two_center_bundle.overlap_orb.get()); this->getOperator()->add(td_ekinetic); - Operator* td_nonlocal - = new TDNonlocal>(this->hsk, this->kv->kvec_d, this->hR, &ucell, orb, &grid_d); + Operator* td_nonlocal = new TDNonlocal>(this->hsk, + this->kv->kvec_d, + this->hR, + &ucell, + orb, + &grid_d); this->getOperator()->add(td_nonlocal); } + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 2) + { + Operator* td_pot_hybrid = new TD_pot_hybrid>(this->hsk, + this->kv, + this->hR, + this->sR, + orb, + &ucell, + orb.cutoffs(), + &grid_d, + two_center_bundle.kinetic_orb.get()); + this->getOperator()->add(td_pot_hybrid); + } if (PARAM.inp.dft_plus_u) { Operator* dftu = nullptr; diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt b/source/source_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt index 2e1afc328e..0e49a9dc43 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/CMakeLists.txt @@ -11,6 +11,7 @@ add_library( nonlocal_new.cpp td_ekinetic_lcao.cpp td_nonlocal_lcao.cpp + td_pot_hybrid.cpp dspin_lcao.cpp dftu_lcao.cpp ) diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp index 4d119dfad8..ca94601fa9 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp @@ -2,7 +2,7 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "source_lcao/module_hcontainer/hcontainer_funcs.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_hsolver/hsolver_lcao.h" #include "module_parameter/parameter.h" @@ -12,6 +12,8 @@ #include "source_hsolver/diago_elpa_native.h" #endif +#include "module_hamilt_lcao/module_tddft/td_info.h" + namespace hamilt { template <> @@ -200,7 +202,7 @@ void OperatorLCAO::init(const int ik_in) { break; } - case calculation_type::lcao_tddft_velocity: { + case calculation_type::lcao_tddft_periodic: { if (!this->hr_done) { // in cal_type=lcao_fixed, HR should be updated by each sub-chain // nodes @@ -240,8 +242,8 @@ void OperatorLCAO::init(const int ik_in) { } // contributeHk() -template -void OperatorLCAO::contributeHk(int ik) { +template <> +void OperatorLCAO::contributeHk(int ik) { ModuleBase::TITLE("OperatorLCAO", "contributeHk"); ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) @@ -256,6 +258,37 @@ void OperatorLCAO::contributeHk(int ik) { } ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); } +// contributeHk() +template +void OperatorLCAO::contributeHk(int ik) { + ModuleBase::TITLE("OperatorLCAO", "contributeHk"); + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); + if(ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->hsk->get_pv()->get_row_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + else + { + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); + } + } + else + { + const int ncol = this->hsk->get_pv()->get_col_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + else + { + hamilt::folding_HR(*this->hR, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); + } + } + ModuleBase::timer::tick("OperatorLCAO", "contributeHk"); +} template class OperatorLCAO; template class OperatorLCAO, double>; diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp index abc6ce95fa..f96f8fd67f 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp @@ -4,9 +4,10 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "source_lcao/module_hcontainer/hcontainer_funcs.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" #include +#include "module_hamilt_lcao/module_tddft/td_info.h" template hamilt::OverlapNew>::OverlapNew(HS_Matrix_K* hsk_in, @@ -188,11 +189,11 @@ void hamilt::OverlapNew>::contributeHR() } // contributeHk() -template -void hamilt::OverlapNew>::contributeHk(int ik) +template <> +void hamilt::OverlapNew>::contributeHk(int ik) { //! if k vector is not changed, then do nothing and return, only for gamma_only case - if (this->kvec_d[ik] == this->kvec_d_old && std::is_same::value) + if (this->kvec_d[ik] == this->kvec_d_old) { return; } @@ -217,7 +218,44 @@ void hamilt::OverlapNew>::contributeHk(int ik) ModuleBase::timer::tick("OverlapNew", "contributeHk"); } +template +void hamilt::OverlapNew>::contributeHk(int ik) +{ + ModuleBase::TITLE("OverlapNew", "contributeHk"); + ModuleBase::timer::tick("OverlapNew", "contributeHk"); + + //! set SK to zero and then calculate SK for each k vector + this->hsk->set_zero_sk(); + if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) + { + const int nrow = this->SR->get_atom_pair(0).get_paraV()->get_row_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + else + { + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], nrow, 1); + } + } + else + { + const int ncol = this->SR->get_atom_pair(0).get_paraV()->get_col_size(); + if(PARAM.inp.td_stype == 2) + { + TD_info::td_vel_op->folding_HR_td(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + else + { + hamilt::folding_HR(*this->SR, this->hsk->get_sk(), this->kvec_d[ik], ncol, 0); + } + } + + // update kvec_d_old + this->kvec_d_old = this->kvec_d[ik]; + ModuleBase::timer::tick("OverlapNew", "contributeHk"); +} template TK* hamilt::OverlapNew>::getSk() { diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp index b83608d64f..2b202b7811 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp @@ -7,9 +7,9 @@ #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_estate/module_pot/H_TDDFT_pw.h" -#include "source_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "source_lcao/hamilt_lcaodft/spar_hsr.h" -#include "source_lcao/module_hcontainer/hcontainer_funcs.h" +#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" +#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_pw/hamilt_pwdft/global.h" namespace hamilt @@ -25,9 +25,8 @@ TDEkinetic>::TDEkinetic(HS_Matrix_K* hsk_in, : OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), orb_cutoff_(orb_cutoff), kv(kv_in), intor_(intor) { this->ucell = ucell_in; - this->cal_type = calculation_type::lcao_tddft_velocity; + this->cal_type = calculation_type::lcao_tddft_periodic; this->Grid = GridD_in; - this->init_td(); // initialize HR to get adjs info. this->initialize_HR(Grid); } @@ -39,28 +38,19 @@ TDEkinetic>::~TDEkinetic() { delete this->hR_tmp; } - TD_Velocity::td_vel_op = nullptr; + TD_info::td_vel_op = nullptr; } // term A^2*S template -void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc,const TR& overlap, int nnr) -{ - return; -} - -// term A^2*S -template <> -void TDEkinetic, double>>::td_ekinetic_scalar(std::complex* Hloc, - const double& overlap, - int nnr) +void TDEkinetic>::td_ekinetic_scalar(std::complex* Hloc, + const TR& overlap, + int nnr) { // the correction term A^2/2. From Hatree to Ry, it needs to be multiplied by 2.0 - std::complex tmp = {cart_At.norm2() * overlap, 0}; - Hloc[nnr] += tmp; + Hloc[nnr] += cart_At.norm2() * overlap; return; } - // term A dot āˆ‡ template void TDEkinetic>::td_ekinetic_grad(std::complex* Hloc, @@ -106,12 +96,12 @@ void TDEkinetic>::calculate_HR() hamilt::BaseMatrix>* tmp = this->hR_tmp->find_matrix(iat1, iat2, R_index2); if (tmp != nullptr) { - if (TD_Velocity::out_current) + if (TD_info::out_current) { std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; for (int i = 0; i < 3; i++) { - tmp_c[i] = td_velocity.get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); + tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i)->find_matrix(iat1, iat2, R_index2)->get_pointer(); } this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_c); } @@ -233,19 +223,12 @@ void TDEkinetic>::cal_HR_IJR(const int& iat1, } } } -// init two center integrals and vector potential for td_ekintic term +//update vector potential for td_ekintic term template -void TDEkinetic>::init_td() +void TDEkinetic>::update_td() { - TD_Velocity::td_vel_op = &td_velocity; - // calculate At in cartesian coorinates. - td_velocity.cal_cart_At(elecstate::H_TDDFT_pw::At); - this->cart_At = td_velocity.cart_At; - - // mohan update 2025-04-20 - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ax(t)", cart_At[0]); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Ay(t)", cart_At[1]); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Cartesian vector potential Az(t)", cart_At[2]); + //std::cout<<"velocity"<cart_At = TD_info::td_vel_op->cart_At; } template @@ -343,7 +326,7 @@ void TDEkinetic>::contributeHR() { return; } - if (!this->hR_tmp_done) + if (!this->hR_tmp_done || TD_info::evolve_once) { const Parallel_Orbitals* paraV = this->hR->get_atom_pair(0).get_paraV(); // if this Operator is the first node of the sub_chain, then hR_tmp is nullptr @@ -360,11 +343,13 @@ void TDEkinetic>::contributeHR() static_cast*>(this->next_sub_op)->set_HR_fixed(this->hR_tmp); } // initialize current term if needed - if (TD_Velocity::out_current) + if (TD_info::out_current) { - td_velocity.initialize_current_term(this->hR_tmp, paraV); + TD_info::td_vel_op->initialize_current_term(this->hR_tmp, paraV); } // calculate the values in hR_tmp + this->update_td(); + this->hR_tmp->set_zero(); this->calculate_HR(); this->hR_tmp_done = true; } @@ -376,12 +361,7 @@ void TDEkinetic>::contributeHR() template void TDEkinetic>::contributeHk(int ik) { - return; -} -template <> -void TDEkinetic, double>>::contributeHk(int ik) -{ - if (TD_Velocity::tddft_velocity == false) + if (PARAM.inp.td_stype != 1) { return; } @@ -392,12 +372,7 @@ void TDEkinetic, double>>::contributeHk(int ik const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); // save HR data for output int spin_tot = PARAM.inp.nspin; - - if (spin_tot == 4) - { - - } - else if (!output_hR_done && TD_Velocity::out_mat_R) + if (!output_hR_done && TD_info::out_mat_R) { for (int spin_now = 0; spin_now < spin_tot; spin_now++) { @@ -405,11 +380,10 @@ void TDEkinetic, double>>::contributeHk(int ik spin_now, 1e-10, *hR_tmp, - td_velocity.HR_sparse_td_vel[spin_now]); + TD_info::td_vel_op->HR_sparse_td_vel[spin_now]); } output_hR_done = true; } - // folding inside HR to HK if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) { @@ -426,7 +400,6 @@ void TDEkinetic, double>>::contributeHk(int ik } } -template class TDEkinetic>; template class TDEkinetic, double>>; template class TDEkinetic, std::complex>>; diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h index 591815aae7..310504aa07 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h @@ -4,8 +4,8 @@ #include "source_basis/module_nao/two_center_integrator.h" #include "source_cell/klist.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_lcao/module_hcontainer/hcontainer.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include "operator_lcao.h" #include @@ -48,8 +48,8 @@ class TDEkinetic> : public OperatorLCAO virtual void contributeHk(int ik) override; - /// @brief init two center integrals and vector potential for td_ekintic term - void init_td(); + /// @brief update vector potential + void update_td(); /** * @brief initialize HR, search the nearest neighbor atoms @@ -83,7 +83,6 @@ class TDEkinetic> : public OperatorLCAO virtual void set_HR_fixed(void*) override; - TD_Velocity td_velocity; private: @@ -124,3 +123,4 @@ class TDEkinetic> : public OperatorLCAO } // namespace hamilt #endif + diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp index 207fa31f1a..391dca66f0 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp @@ -4,9 +4,9 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "source_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_lcao/module_tddft/snap_psibeta_half_tddft.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" #include "source_pw/hamilt_pwdft/global.h" #ifdef _OPENMP #include @@ -22,14 +22,13 @@ hamilt::TDNonlocal>::TDNonlocal(HS_Matrix_K* hs const Grid_Driver* GridD_in) : hamilt::OperatorLCAO(hsk_in, kvec_d_in, hR_in), orb_(orb) { - this->cal_type = calculation_type::lcao_tddft_velocity; + this->cal_type = calculation_type::lcao_tddft_periodic; this->ucell = ucell_in; this->Grid = GridD_in; #ifdef __DEBUG assert(this->ucell != nullptr); #endif // initialize HR to get adjs info. - this->init_td(); this->initialize_HR(Grid); } @@ -43,10 +42,10 @@ hamilt::TDNonlocal>::~TDNonlocal() } } template -void hamilt::TDNonlocal>::init_td() +void hamilt::TDNonlocal>::update_td() { // calculate At in cartesian coorinates. - this->cart_At = TD_Velocity::td_vel_op->cart_At; + this->cart_At = TD_info::td_vel_op->cart_At; } // initialize_HR() template @@ -130,7 +129,7 @@ void hamilt::TDNonlocal>::calculate_HR() const Parallel_Orbitals* paraV = this->hR_tmp->get_atom_pair(0).get_paraV(); const int npol = this->ucell->get_npol(); - const int nlm_dim = TD_Velocity::out_current ? 4 : 1; + const int nlm_dim = TD_info::out_current ? 4 : 1; // 1. calculate for each pair of atoms for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) @@ -182,7 +181,7 @@ void hamilt::TDNonlocal>::calculate_HR() tau0 * this->ucell->lat0, T0, cart_At, - TD_Velocity::out_current); + TD_info::out_current); for (int dir = 0; dir < nlm_dim; dir++) { nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); @@ -245,12 +244,12 @@ void hamilt::TDNonlocal>::calculate_HR() // if not found , skip this pair of atoms if (tmp != nullptr) { - if (TD_Velocity::out_current) + if (TD_info::out_current) { std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; for (int i = 0; i < 3; i++) { - tmp_c[i] = TD_Velocity::td_vel_op->get_current_term_pointer(i) + tmp_c[i] = TD_info::td_vel_op->get_current_term_pointer(i) ->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2]) ->get_pointer(); } @@ -295,7 +294,7 @@ void hamilt::TDNonlocal>::cal_HR_IJR( std::complex* data_pointer, std::complex** data_pointer_c) { - const int nlm_dim = TD_Velocity::out_current ? 4 : 1; + const int nlm_dim = TD_info::out_current ? 4 : 1; // npol is the number of polarizations, // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) @@ -411,7 +410,7 @@ void hamilt::TDNonlocal>::contributeHR() ModuleBase::timer::tick("TDNonlocal", "contributeHR"); - if (!this->hR_tmp_done) + if (!this->hR_tmp_done || TD_info::evolve_once) { if (this->hR_tmp == nullptr) { @@ -427,8 +426,10 @@ void hamilt::TDNonlocal>::contributeHR() } // calculate the values in hR_tmp + this->update_td(); this->calculate_HR(); this->hR_tmp_done = true; + TD_info::evolve_once = false; } ModuleBase::timer::tick("TDNonlocal", "contributeHR"); @@ -442,35 +443,5 @@ void hamilt::TDNonlocal>::contributeHk(int ik) return; } - -template <> -void hamilt::TDNonlocal, double>>::contributeHk(int ik) -{ - if (TD_Velocity::tddft_velocity == false) - { - return; - } - else - { - ModuleBase::TITLE("TDNonlocal", "contributeHk"); - ModuleBase::timer::tick("TDNonlocal", "contributeHk"); - - // folding inside HR to HK - if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver)) - { - const int nrow = this->hsk->get_pv()->get_row_size(); - folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], nrow, 1); - } - else - { - const int ncol = this->hsk->get_pv()->get_col_size(); - folding_HR(*this->hR_tmp, this->hsk->get_hk(), this->kvec_d[ik], ncol, 0); - } - - ModuleBase::timer::tick("TDNonlocal", "contributeHk"); - } -} - -template class hamilt::TDNonlocal>; template class hamilt::TDNonlocal, double>>; template class hamilt::TDNonlocal, std::complex>>; diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h index 16af65660d..d89e7b38e5 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h @@ -4,9 +4,9 @@ #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" #include "source_estate/module_pot/H_TDDFT_pw.h" -#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "source_lcao/module_hcontainer/hcontainer.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include @@ -78,7 +78,7 @@ class TDNonlocal> : public OperatorLCAO */ void initialize_HR_tmp(const Parallel_Orbitals* paraV); /// @brief init vector potential for td_nonlocal term - void init_td(); + void update_td(); /** * @brief calculate the non-local pseudopotential matrix with specific atom-pairs * nearest neighbor atoms don't need to be calculated again diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp new file mode 100644 index 0000000000..54b5471c5d --- /dev/null +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp @@ -0,0 +1,300 @@ +#include "td_pot_hybrid.h" + +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_pw/hamilt_pwdft/global.h" + +// Constructor +template +cal_r_overlap_R hamilt::TD_pot_hybrid>::r_calculator; + +template +hamilt::TD_pot_hybrid>::TD_pot_hybrid( + HS_Matrix_K* hsk_in, + const K_Vectors* kv_in, + hamilt::HContainer* hR_in, + hamilt::HContainer* SR_in, + const LCAO_Orbitals& orb, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor) + : hamilt::OperatorLCAO(hsk_in, kv_in->kvec_d, hR_in), SR(SR_in), orb_(orb), orb_cutoff_(orb_cutoff), intor_(intor) +{ + this->cal_type = calculation_type::lcao_tddft_periodic; + this->ucell = ucell_in; +#ifdef __DEBUG + assert(this->ucell != nullptr); + assert(this->hsk != nullptr); +#endif + this->init_td(); + // initialize HR to allocate sparse Ekinetic matrix memory + this->initialize_HR(GridD_in); +} + +// destructor +template +hamilt::TD_pot_hybrid>::~TD_pot_hybrid() +{ + if (this->allocated) + { + delete this->HR_fixed; + } + /*if(TD_info::td_vel_op!=nullptr) + { + TD_info::td_vel_op->hk_hybrid = nullptr; + }*/ +} + +// initialize_HR() +template +void hamilt::TD_pot_hybrid>::initialize_HR(const Grid_Driver* GridD) +{ + ModuleBase::TITLE("TD_pot_hybrid", "initialize_HR"); + ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); + + auto* paraV = this->hR->get_paraV();// get parallel orbitals from HR + // TODO: if paraV is nullptr, AtomPair can not use paraV for constructor, I will repair it in the future. + + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_cutoff_[T1] + orb_cutoff_[T2]) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_all.push_back(adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index = adjs.box[ad]; + hamilt::AtomPair tmp(iat1, iat2, R_index, paraV); + this->hR->insert_pair(tmp); + } + } + // allocate the memory of BaseMatrix in HR, and set the new values to zero + this->hR->allocate(nullptr, true); + + ModuleBase::timer::tick("TD_pot_hybrid", "initialize_HR"); +} + +template +void hamilt::TD_pot_hybrid>::calculate_HR() +{ + ModuleBase::TITLE("TD_pot_hybrid", "calculate_HR"); + if (this->HR_fixed == nullptr || this->HR_fixed->size_atom_pairs() <= 0) + { + ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "HR_fixed is nullptr or empty"); + } + ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); + + const Parallel_Orbitals* paraV = this->HR_fixed->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_all[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + hamilt::BaseMatrix* tmp = this->HR_fixed->find_matrix(iat1, iat2, R_index2); + hamilt::BaseMatrix* tmp_overlap = this->SR->find_matrix(iat1, iat2, R_index2); + if (tmp != nullptr) + { + this->cal_HR_IJR(iat1, iat2, paraV, dtau, tmp->get_pointer(), tmp_overlap->get_pointer()); + } + else + { + ModuleBase::WARNING_QUIT("hamilt::TD_pot_hybrid::calculate_HR", "R_index not found in HR"); + } + } + } + + ModuleBase::timer::tick("TD_pot_hybrid", "calculate_HR"); +} + +// cal_HR_IJR() +template +void hamilt::TD_pot_hybrid>::cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* hr_mat_p, + TR* sr_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1, I1; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2, I2; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double olm[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + + ModuleBase::Vector3 tmp_r = r_calculator.get_psi_r_psi(tau1 * this->ucell->lat0, T1, L1, m1, N1, tau2 * this->ucell->lat0, T2, L2, m2, N2); + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + for (int ipol = 0; ipol < npol; ipol++) + { + hr_mat_p[ipol * step_trace] += tmp_r * Et; + hr_mat_p[ipol * step_trace] -= ((dtau + tau1) * Et) * sr_p[ipol * step_trace] * this->ucell->lat0; + } + hr_mat_p += npol; + sr_p += npol; + } + hr_mat_p += (npol - 1) * col_indexes.size(); + sr_p += (npol - 1) * col_indexes.size(); + } +} +// init two center integrals and vector potential for td_ekintic term +template +void hamilt::TD_pot_hybrid>::init_td() +{ + // initialize the r_calculator + if(TD_info::td_vel_op->get_istep()==(TD_info::estep_shift-1)) + { + //std::cout << "init_r_overlap" <hR->get_paraV(), orb_); + } + //hk_hybrid.resize(this->hR->get_paraV()->nloc); +} +template +void hamilt::TD_pot_hybrid>::update_td() +{ + //std::cout<<"hybrid gague" <cart_At = TD_info::td_vel_op->cart_At; + //std::cout<<"At: "<< TD_info::td_vel_op->cart_At[0] <<" "<cart_At[1]<<" "<cart_At[2]<<" "< +void hamilt::TD_pot_hybrid>::set_HR_fixed(void* HR_fixed_in) +{ + this->HR_fixed = static_cast*>(HR_fixed_in); + this->allocated = false; +} + +// contributeHR() +template +void hamilt::TD_pot_hybrid>::contributeHR() +{ + ModuleBase::TITLE("TD_pot_hybrid", "contributeHR"); + ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); + + if (!this->HR_fixed_done || TD_info::evolve_once) + { + // if this Operator is the first node of the sub_chain, then HR_fixed is nullptr + if (this->HR_fixed == nullptr) + { + this->HR_fixed = new hamilt::HContainer(*this->hR); + this->HR_fixed->set_zero(); + this->allocated = true; + } + if (this->next_sub_op != nullptr) + { + // pass pointer of HR_fixed to the next node + static_cast*>(this->next_sub_op)->set_HR_fixed(this->HR_fixed); + } + // calculate the values in HR_fixed + this->update_td(); + this->HR_fixed->set_zero(); + this->calculate_HR(); + this->HR_fixed_done = true; + TD_info::evolve_once = false; + } + // last node of sub-chain, add HR_fixed into HR + if (this->next_sub_op == nullptr) + { + this->hR->add(*(this->HR_fixed)); + } + + ModuleBase::timer::tick("TD_pot_hybrid", "contributeHR"); + return; +} + +//ETD +// contributeHk() +template +void hamilt::TD_pot_hybrid>::contributeHk(int ik) { + return; +} + +template class hamilt::TD_pot_hybrid, double>>; +template class hamilt::TD_pot_hybrid, std::complex>>; diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h new file mode 100644 index 0000000000..4d7b577e32 --- /dev/null +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h @@ -0,0 +1,129 @@ +#ifndef TD_POT_HYBRID_H +#define TD_POT_HYBRID_H +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_cell/klist.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include +#include "module_io/cal_r_overlap_R.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_estate/module_pot/H_TDDFT_pw.h" + +namespace hamilt +{ + +#ifndef __TD_POT_HYBRIDTEMPLATE +#define __TD_POT_HYBRIDTEMPLATE + +/// The EkineticNew class template inherits from class T +/// it is used to calculate the electronic kinetic +/// Template parameters: +/// - T: base class, it would be OperatorLCAO or OperatorPW +/// - TR: data type of real space Hamiltonian, it would be double or std::complex +template +class TD_pot_hybrid : public T +{ +}; + +#endif + +/// EkineticNew class template specialization for OperatorLCAO base class +/// It is used to calculate the electronic kinetic matrix in real space and fold it to k-space +/// HR = +/// HK = = \sum_{R} e^{ikR} HR +/// Template parameters: +/// - TK: data type of k-space Hamiltonian +/// - TR: data type of real space Hamiltonian +template +class TD_pot_hybrid> : public OperatorLCAO +{ + public: + /** + * @brief Construct a new EkineticNew object + */ + TD_pot_hybrid>(HS_Matrix_K* hsk_in, + const K_Vectors* kv_in, + HContainer* hR_in, + HContainer* SR_in, + const LCAO_Orbitals& orb, + const UnitCell* ucell_in, + const std::vector& orb_cutoff, + const Grid_Driver* GridD_in, + const TwoCenterIntegrator* intor); + + /** + * @brief Destroy the EkineticNew object + */ + ~TD_pot_hybrid>(); + + /** + * @brief contributeHR() is used to calculate the HR matrix + * + */ + virtual void contributeHR() override; + //ETD + virtual void contributeHk(int ik) override; + //ETD + + virtual void set_HR_fixed(void*) override; + + + private: + const UnitCell* ucell = nullptr; + std::vector orb_cutoff_; + const LCAO_Orbitals& orb_; + + hamilt::HContainer* HR_fixed = nullptr; + + hamilt::HContainer* SR = nullptr; + + const TwoCenterIntegrator* intor_ = nullptr; + + bool allocated = false; + + bool HR_fixed_done = false; + //tddft part + static cal_r_overlap_R r_calculator; + //ETD + //std::vector> hk_hybrid; + //ETD + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + ModuleBase::Vector3 Et; + + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the electronic kinetic matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_HR(const Grid_Driver* GridD_in); + + void init_td(); + void update_td(); + + /** + * @brief calculate the electronic kinetic matrix with specific atom-pairs + * use the adjs_all to calculate the HR matrix + */ + void calculate_HR(); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_HR_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + TR* hr_mat_p, + TR* sr_p); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_all; +}; + +} // namespace hamilt +#endif diff --git a/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp index 6e64be1c5f..786d7809f5 100644 --- a/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp +++ b/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp @@ -1,7 +1,7 @@ #include "spar_hsr.h" -#include "source_lcao/module_hcontainer/hcontainer.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" #include "module_parameter/parameter.h" #include "spar_dh.h" #include "spar_exx.h" @@ -96,13 +96,13 @@ void sparse_format::cal_HSR(const UnitCell& ucell, HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR())); - if (TD_Velocity::tddft_velocity) + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { sparse_format::cal_HContainer_td(pv, current_spin, sparse_thr, *(p_ham_lcao->getHR()), - TD_Velocity::td_vel_op->HR_sparse_td_vel[current_spin]); + TD_info::td_vel_op->HR_sparse_td_vel[current_spin]); } else { @@ -334,9 +334,9 @@ void sparse_format::clear_zero_elements(LCAO_HS_Arrays& HS_Arrays, const int& cu } } } - if (TD_Velocity::tddft_velocity) + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { - for (auto& R_loop: TD_Velocity::td_vel_op->HR_sparse_td_vel[current_spin]) + for (auto& R_loop: TD_info::td_vel_op->HR_sparse_td_vel[current_spin]) { for (auto& row_loop: R_loop.second) { @@ -451,4 +451,4 @@ void sparse_format::destroy_HS_R_sparse(LCAO_HS_Arrays& HS_Arrays) // all_R_coor.swap(empty_all_R_coor); return; -} \ No newline at end of file +} diff --git a/source/source_lcao/module_tddft/CMakeLists.txt b/source/source_lcao/module_tddft/CMakeLists.txt index e81ceb3368..58bc834a5f 100644 --- a/source/source_lcao/module_tddft/CMakeLists.txt +++ b/source/source_lcao/module_tddft/CMakeLists.txt @@ -10,9 +10,10 @@ if(ENABLE_LCAO) propagator_taylor.cpp propagator_etrs.cpp upsi.cpp - td_velocity.cpp - td_current.cpp + td_info.cpp + velocity_op.cpp snap_psibeta_half_tddft.cpp + td_folding.cpp solve_propagation.cpp ) diff --git a/source/source_lcao/module_tddft/evolve_elec.cpp b/source/source_lcao/module_tddft/evolve_elec.cpp index 3a1cfd25db..f9c31081f3 100644 --- a/source/source_lcao/module_tddft/evolve_elec.cpp +++ b/source/source_lcao/module_tddft/evolve_elec.cpp @@ -4,8 +4,8 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_estate/module_charge/symmetry_rho.h" -#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "source_lcao/module_dftu/dftu.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "module_hamilt_lcao/module_dftu/dftu.h" #include "source_pw/hamilt_pwdft/global.h" namespace module_tddft diff --git a/source/source_lcao/module_tddft/evolve_elec.h b/source/source_lcao/module_tddft/evolve_elec.h index 4763129f6e..44972bae3f 100644 --- a/source/source_lcao/module_tddft/evolve_elec.h +++ b/source/source_lcao/module_tddft/evolve_elec.h @@ -10,7 +10,7 @@ #include "source_base/scalapack_connector.h" // Cpxgemr2d #include "source_esolver/esolver_ks_lcao.h" #include "source_esolver/esolver_ks_lcao_tddft.h" -#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_psi/psi.h" //----------------------------------------------------------- @@ -143,7 +143,8 @@ class Evolve_elec friend class ModuleESolver::ESolver_KS_LCAO, double>; // Template parameter is needed for the friend class declaration - friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; + friend class ModuleESolver::ESolver_KS_LCAO_TDDFT; + friend class ModuleESolver::ESolver_KS_LCAO_TDDFT, Device>; public: Evolve_elec(); diff --git a/source/source_lcao/module_tddft/evolve_psi.cpp b/source/source_lcao/module_tddft/evolve_psi.cpp index 269bd44fa7..29c9e88125 100644 --- a/source/source_lcao/module_tddft/evolve_psi.cpp +++ b/source/source_lcao/module_tddft/evolve_psi.cpp @@ -7,7 +7,7 @@ #include "source_base/module_container/ATen/kernels/lapack.h" // cuSOLVER handle #include "source_base/scalapack_connector.h" #include "source_esolver/esolver_ks_lcao_tddft.h" // use gatherMatrix -#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #include "norm_psi.h" @@ -76,7 +76,7 @@ void evolve_psi(const int nband, /// @brief compute U_operator /// @input Stmp, Htmp, print_matrix /// @output U_operator - Propagator prop(propagator, pv, PARAM.mdp.md_dt); + Propagator prop(propagator, pv, PARAM.inp.td_dt); prop.compute_propagator(nlocal, Stmp, Htmp, H_laststep, U_operator, ofs_running, print_matrix); } @@ -93,7 +93,7 @@ void evolve_psi(const int nband, /// @brief solve the propagation equation /// @input Stmp, Htmp, psi_k_laststep /// @output psi_k - solve_propagation(pv, nband, nlocal, PARAM.mdp.md_dt / ModuleBase::AU_to_FS, Stmp, Htmp, psi_k_laststep, psi_k); + solve_propagation(pv, nband, nlocal, PARAM.inp.td_dt, Stmp, Htmp, psi_k_laststep, psi_k); } // (4)->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> diff --git a/source/source_lcao/module_tddft/evolve_psi.h b/source/source_lcao/module_tddft/evolve_psi.h index ed00d32591..e1b64f7c9b 100644 --- a/source/source_lcao/module_tddft/evolve_psi.h +++ b/source/source_lcao/module_tddft/evolve_psi.h @@ -9,7 +9,7 @@ #include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor #include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap #include "source_basis/module_ao/parallel_orbitals.h" -#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" namespace module_tddft { diff --git a/source/source_lcao/module_tddft/solve_propagation.cpp b/source/source_lcao/module_tddft/solve_propagation.cpp index f8df6a6c71..5271f2fec3 100644 --- a/source/source_lcao/module_tddft/solve_propagation.cpp +++ b/source/source_lcao/module_tddft/solve_propagation.cpp @@ -4,6 +4,7 @@ #include "source_base/lapack_connector.h" #include "source_base/scalapack_connector.h" +#include "source_pw/hamilt_pwdft/global.h" namespace module_tddft { @@ -25,14 +26,16 @@ void solve_propagation(const Parallel_Orbitals* pv, std::complex* operator_B = new std::complex[pv->nloc]; ModuleBase::GlobalFunc::ZEROS(operator_B, pv->nloc); BlasConnector::copy(pv->nloc, Htmp, 1, operator_B, 1); + + const double dt_au = dt / ModuleBase::AU_to_FS; // ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // (2) compute operator_A & operator_B by GEADD // operator_A = Stmp + i*para * Htmp; beta2 = para = 0.25 * dt // operator_B = Stmp - i*para * Htmp; beta1 = - para = -0.25 * dt std::complex alpha = {1.0, 0.0}; - std::complex beta1 = {0.0, -0.25 * dt}; - std::complex beta2 = {0.0, 0.25 * dt}; + std::complex beta1 = {0.0, -0.25 * dt_au}; + std::complex beta2 = {0.0, 0.25 * dt_au}; ScalapackConnector::geadd('N', nlocal, diff --git a/source/source_lcao/module_tddft/td_folding.cpp b/source/source_lcao/module_tddft/td_folding.cpp new file mode 100644 index 0000000000..d7eefd240e --- /dev/null +++ b/source/source_lcao/module_tddft/td_folding.cpp @@ -0,0 +1,53 @@ +#include "td_info.h" +#include "source_base/libm/libm.h" +#include "module_hamilt_lcao/module_tddft/td_info.h" +template +void TD_info::folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type) +{ +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int i = 0; i < hR.size_atom_pairs(); ++i) + { + hamilt::AtomPair& tmp = hR.get_atom_pair(i); + for(int ir = 0;ir < tmp.get_R_size(); ++ir ) + { + const ModuleBase::Vector3 r_index = tmp.get_R_index(ir); + + //new + //cal tddft phase for hybrid gague + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + ModuleBase::Vector3 dtau = ucell->cal_dtau(iat1, iat2, r_index); + const double arg_td = cart_At * dtau * ucell->lat0; + //new + + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + const double arg = (kvec_d_in * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + + tmp.find_R(r_index); + tmp.add_to_matrix(hk, ncol, kphase, hk_type); + } + } +} +template +void TD_info::folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); +template +void TD_info::folding_HR_td>(const hamilt::HContainer>& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); \ No newline at end of file diff --git a/source/source_lcao/module_tddft/td_info.cpp b/source/source_lcao/module_tddft/td_info.cpp new file mode 100644 index 0000000000..26e2bab0a5 --- /dev/null +++ b/source/source_lcao/module_tddft/td_info.cpp @@ -0,0 +1,227 @@ +#include "td_info.h" + +#include "source_estate/module_pot/H_TDDFT_pw.h" +#include "module_parameter/parameter.h" + +bool TD_info::out_mat_R = false; +bool TD_info::out_vecpot = false; +bool TD_info::out_current = false; +bool TD_info::out_current_k = false; +bool TD_info::init_vecpot_file = false; +bool TD_info::evolve_once = false; + +TD_info* TD_info::td_vel_op = nullptr; + +int TD_info::estep_shift = 0; +int TD_info::istep = -1; +int TD_info::max_istep = -1; +std::vector> TD_info::At_from_file; + +TD_info::TD_info(const UnitCell* ucell_in) +{ + this->ucell = ucell_in; + if (init_vecpot_file && istep == -1) + { + this->read_cart_At(); + } + //read in restart step + if(PARAM.inp.mdp.md_restart) + { + std::stringstream ssc; + ssc << PARAM.globalv.global_readin_dir << "Restart_td.dat"; + std::ifstream file(ssc.str().c_str()); + if (!file) + { + ModuleBase::WARNING_QUIT("TD_info::TD_info", "No Restart_td.dat!"); + } + file >> estep_shift; + std::cout<<"estep_shift"<istep += estep_shift; + return; +} +TD_info::~TD_info() +{ + if(elecstate::H_TDDFT_pw::stype == 1) + { + this->destroy_HS_R_td_sparse(); + } + for (int dir = 0; dir < 3; dir++) + { + if (this->current_term[dir] != nullptr) + { + delete this->current_term[dir]; + } + } +} + +void TD_info::output_cart_At(const std::string& out_dir) +{ + if (GlobalV::MY_RANK == 0) + { + std::string out_file; + // generate the output file name + out_file = out_dir + "At.dat"; + std::ofstream ofs; + // output title + if (istep == estep_shift) + { + ofs.open(out_file.c_str(), std::ofstream::out); + ofs << std::left << std::setw(8) << "#istep" << std::setw(15) << "A_x" << std::setw(15) << "A_y" + << std::setw(15) << "A_z" << std::endl; + } + else + { + ofs.open(out_file.c_str(), std::ofstream::app); + } + // output the vector potential + ofs << std::left << std::setw(8) << istep; + // divide by 2.0 to get the atomic unit + for (int i = 0; i < 3; i++) + { + ofs << std::scientific << std::setprecision(4) << std::setw(15) << cart_At[i]; + } + ofs << std::endl; + ofs.close(); + } + return; +} + +void TD_info::cal_cart_At(const ModuleBase::Vector3& At) +{ + istep++; + if (init_vecpot_file) + { + this->cart_At = At_from_file[istep > max_istep ? max_istep : istep]; + } + else + { + // transfrom into atomic unit + this->cart_At = At / 2.0; + } + // output the vector potential if needed + if (out_vecpot == true) + { + this->output_cart_At(PARAM.globalv.global_out_dir); + } +} + +void TD_info::read_cart_At(void) +{ + std::string in_file; + // generate the input file name + in_file = "At.dat"; + std::ifstream ifs(in_file.c_str()); + // check if the file is exist + if (!ifs) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Cannot open Vector potential file!"); + } + std::string line; + std::vector str_vec; + // use tmp to skip the istep number + int tmp = 0; + while (std::getline(ifs, line)) + { + // A tmporary vector3 to store the data of this line + ModuleBase::Vector3 At; + if (line[0] == '#') + { + continue; + } + std::istringstream iss(line); + // skip the istep number + if (!(iss >> tmp)) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", "Error reading istep!"); + } + // read the vector potential + double component = 0; + // Read three components + for (int i = 0; i < 3; i++) + { + if (!(iss >> component)) + { + ModuleBase::WARNING_QUIT("TD_info::read_cart_At", + "Error reading component " + std::to_string(i + 1) + " for istep " + + std::to_string(tmp) + "!"); + } + At[i] = component; + } + // add the tmporary vector3 to the vector potential vector + At_from_file.push_back(At); + } + // set the max_istep + max_istep = At_from_file.size() - 1; + ifs.close(); + + return; +} +void TD_info::out_restart_info(const int nstep, + const ModuleBase::Vector3& At_current, + const ModuleBase::Vector3& At_laststep) +{ + if (GlobalV::MY_RANK == 0) + { + // open file + std::string outdir = PARAM.globalv.global_out_dir + "Restart_td.dat"; + std::ofstream outFile(outdir); + if (!outFile) { + ModuleBase::WARNING_QUIT("out_restart_info", "no Restart_td.dat!"); + } + // write data + outFile << nstep << std::endl; + outFile << At_current[0] << " " << At_current[1] << " " << At_current[2] << std::endl; + outFile << At_laststep[0] << " " << At_laststep[1] << " " << At_laststep[2] << std::endl; + outFile.close(); + } + + + return; +} + +void TD_info::initialize_current_term(const hamilt::HContainer>* HR, + const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("TD_info", "initialize_current_term"); + ModuleBase::timer::tick("TD_info", "initialize_current_term"); + + for (int dir = 0; dir < 3; dir++) + { + if (this->current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + + for (int i = 0; i < HR->size_atom_pairs(); ++i) + { + hamilt::AtomPair>& tmp = HR->get_atom_pair(i); + for (int ir = 0; ir < tmp.get_R_size(); ++ir) + { + const ModuleBase::Vector3 R_index = tmp.get_R_index(ir); + const int iat1 = tmp.get_atom_i(); + const int iat2 = tmp.get_atom_j(); + + hamilt::AtomPair> tmp1(iat1, iat2, R_index, paraV); + for (int dir = 0; dir < 3; dir++) + { + this->current_term[dir]->insert_pair(tmp1); + } + } + } + for (int dir = 0; dir < 3; dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + + ModuleBase::timer::tick("TD_info", "initialize_current_term"); +} + +void TD_info::destroy_HS_R_td_sparse(void) +{ + std::map, std::map>>> + empty_HR_sparse_td_vel_up; + std::map, std::map>>> + empty_HR_sparse_td_vel_down; + HR_sparse_td_vel[0].swap(empty_HR_sparse_td_vel_up); + HR_sparse_td_vel[1].swap(empty_HR_sparse_td_vel_down); +} diff --git a/source/source_lcao/module_tddft/td_info.h b/source/source_lcao/module_tddft/td_info.h new file mode 100644 index 0000000000..79026c3b64 --- /dev/null +++ b/source/source_lcao/module_tddft/td_info.h @@ -0,0 +1,108 @@ +#ifndef TD_INFO_H +#define TD_INFO_H +#include "source_base/abfs-vector3_order.h" +#include "source_base/timer.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" + +#include +// Class to store TDDFT infos, mainly for periodic system. +class TD_info +{ + public: + TD_info(const UnitCell* ucell_in); + ~TD_info(); + + void init(); + + /// @brief switch to control the output of HR + static bool out_mat_R; + + /// @brief pointer to the only TD_info object itself + static TD_info* td_vel_op; + + /// @brief switch to control the output of At + static bool out_vecpot; + + /// @brief switch to control the output of current + static bool out_current; + + /// @brief switch to control the format of the output current, in total or in each k-point + static bool out_current_k; + + /// @brief switch to control the source of At + static bool init_vecpot_file; + + /// @brief if need to calculate more than once + static bool evolve_once; + + /// @brief Restart step + static int estep_shift; + + /// @brief Store the vector potential for tddft calculation + ModuleBase::Vector3 cart_At; + + /// @brief calculate the At in cartesian coordinate + void cal_cart_At(const ModuleBase::Vector3& At); + + /// @brief output RT-TDDFT info for restart + void out_restart_info(const int nstep, + const ModuleBase::Vector3& At_current, + const ModuleBase::Vector3& At_laststep); + + // allocate memory for current term. + void initialize_current_term(const hamilt::HContainer>* HR, const Parallel_Orbitals* paraV); + + hamilt::HContainer>* get_current_term_pointer(const int& i) const + { + return this->current_term[i]; + } + + + // folding HR to hk, for hybrid gague + template + void folding_HR_td(const hamilt::HContainer& hR, + std::complex* hk, + const ModuleBase::Vector3& kvec_d_in, + const int ncol, + const int hk_type); + + int get_istep() + { + return istep; + } + + const UnitCell* get_ucell() + { + return this->ucell; + } + + // For TDDFT velocity gauge, to fix the output of HR + std::map, std::map>>> HR_sparse_td_vel[2]; + + private: + /// @brief pointer to the unit cell + const UnitCell* ucell = nullptr; + + /// @brief read At from output file + void read_cart_At(); + + /// @brief output cart_At to output file + void output_cart_At(const std::string& out_dir); + + /// @brief store isteps now + static int istep; + + /// @brief total steps of read in At + static int max_istep; + + /// @brief store the read in At_data + static std::vector> At_from_file; + + /// @brief destory HSR data stored + void destroy_HS_R_td_sparse(); + + /// @brief part of Momentum operator, -iāˆ‡ - i[r,Vnl]. Used to calculate current. + std::vector>*> current_term = {nullptr, nullptr, nullptr}; +}; + +#endif diff --git a/source/source_lcao/module_tddft/velocity_op.cpp b/source/source_lcao/module_tddft/velocity_op.cpp new file mode 100644 index 0000000000..7534b705ba --- /dev/null +++ b/source/source_lcao/module_tddft/velocity_op.cpp @@ -0,0 +1,532 @@ +#include "velocity_op.h" +#include "source_base/timer.h" +#include "source_base/tool_title.h" +#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" +#ifdef _OPENMP +#include +#include +#endif +#include "module_parameter/parameter.h" +template +cal_r_overlap_R Velocity_op::r_calculator; +template +bool Velocity_op::init_done = false; +template +Velocity_op::Velocity_op(const UnitCell* ucell_in, + const Grid_Driver* GridD_in, + const Parallel_Orbitals* paraV, + const LCAO_Orbitals& orb, + const TwoCenterIntegrator* intor) + : ucell(ucell_in), paraV(paraV) , orb_(orb), intor_(intor) +{ + // for length gague, the A(t) = 0 for all the time. + this->cart_At = ModuleBase::Vector3(0,0,0); + this->initialize_grad_term(GridD_in, paraV); + this->initialize_vcomm_r(GridD_in, paraV); +} +template +Velocity_op::~Velocity_op() +{ + for (int dir=0;dir<3;dir++) + { + delete this->current_term[dir]; + } +} +//allocate space for current_term +template +void Velocity_op::initialize_vcomm_r(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("Velocity_op", "initialize_vcomm_r"); + ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); + if(!init_done) + { + std::cout << "init_r_overlap_nonlocal" <current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + this->adjs_vcommr.clear(); + this->adjs_vcommr.reserve(this->ucell->nat); + for (int iat0 = 0; iat0 < ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau0, T0, I0, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad1]; + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat0, iat1, R_index1).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + this->ucell->infoNL.Beta[T0].get_rcut_max()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_vcommr.push_back(adjs); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + if (paraV->get_col_size(iat2) <= 0 || paraV->get_row_size(iat1) <= 0) + { + continue; + } + hamilt::AtomPair> tmp(iat1, + iat2, + R_index2.x - R_index1.x, + R_index2.y - R_index1.y, + R_index2.z - R_index1.z, + paraV); + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->insert_pair(tmp); + } + } + } + } + // allocate the memory of BaseMatrix in cal_vcomm_r_IJR, and set the new values to zero + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + ModuleBase::timer::tick("Velocity_op", "initialize_vcomm_r"); +} +template +void Velocity_op::initialize_grad_term(const Grid_Driver* GridD, const Parallel_Orbitals* paraV) +{ + ModuleBase::TITLE("Velocity_op", "initialize_grad_term"); + ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); + for (int dir=0;dir<3;dir++) + { + if (this->current_term[dir] == nullptr) + this->current_term[dir] = new hamilt::HContainer>(paraV); + } + this->adjs_grad.clear(); + this->adjs_grad.reserve(this->ucell->nat); + for (int iat1 = 0; iat1 < ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo adjs; + GridD->Find_atom(*ucell, tau1, T1, I1, &adjs); + std::vector is_adj(adjs.adj_num + 1, false); + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T2 = adjs.ntype[ad1]; + const int I2 = adjs.natom[ad1]; + const int iat2 = ucell->itia2iat(T2, I2); + if (paraV->get_row_size(iat1) <= 0 || paraV->get_col_size(iat2) <= 0) + { + continue; + } + const ModuleBase::Vector3& R_index2 = adjs.box[ad1]; + // choose the real adjacent atoms + // Note: the distance of atoms should less than the cutoff radius, + // When equal, the theoretical value of matrix element is zero, + // but the calculated value is not zero due to the numerical error, which would lead to result changes. + if (this->ucell->cal_dtau(iat1, iat2, R_index2).norm() * this->ucell->lat0 + < orb_.Phi[T1].getRcut() + orb_.Phi[T2].getRcut()) + { + is_adj[ad1] = true; + } + } + filter_adjs(is_adj, adjs); + this->adjs_grad.push_back(adjs); + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index = adjs.box[ad]; + hamilt::AtomPair> tmp(iat1, iat2, R_index.x, R_index.y, R_index.z, paraV); + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->insert_pair(tmp); + } + } + } + // allocate the memory of BaseMatrix in HR, and set the new values to zero + for (int dir=0;dir<3;dir++) + { + this->current_term[dir]->allocate(nullptr, true); + } + + ModuleBase::timer::tick("Velocity_op", "initialize_grad_term"); +} +template +void Velocity_op::calculate_vcomm_r() +{ + ModuleBase::TITLE("Velocity_op", "calculate_vcomm_r"); + ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); + + const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); + const int npol = this->ucell->get_npol(); + + // 1. calculate for each pair of atoms + for (int iat0 = 0; iat0 < this->ucell->nat; iat0++) + { + auto tau0 = ucell->get_tau(iat0); + int T0, I0; + ucell->iat2iait(iat0, &I0, &T0); + AdjacentAtomInfo& adjs = this->adjs_vcommr[iat0]; + std::vector>>> nlm_tot; + nlm_tot.resize(adjs.adj_num + 1); + for (int i = 0; i < adjs.adj_num + 1; i++) + { + nlm_tot[i].resize(4); + } + + #pragma omp parallel + { + #pragma omp for schedule(dynamic) + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + const ModuleBase::Vector3& tau1 = adjs.adjacent_tau[ad]; + const Atom* atom1 = &ucell->atoms[T1]; + auto all_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat1); + // insert col_indexes into all_indexes to get universal set with no repeat elements + all_indexes.insert(all_indexes.end(), col_indexes.begin(), col_indexes.end()); + std::sort(all_indexes.begin(), all_indexes.end()); + all_indexes.erase(std::unique(all_indexes.begin(), all_indexes.end()), all_indexes.end()); + for (int iw1l = 0; iw1l < all_indexes.size(); iw1l += npol) + { + const int iw1 = all_indexes[iw1l] / npol; + //std::vector>> nlm; + std::vector> nlm; + // nlm is a vector of vectors, but size of outer vector is only 1 when out_current is false + // and size of outer vector is 4 when out_current is true (3 for , 1 for + // ) inner loop : all projectors (L0,M0) + + // snap_psibeta_half_tddft() are used to calculate + // and as well if current are needed + ModuleBase::Vector3 dtau = tau0 - tau1; + + r_calculator.get_psi_r_beta(*ucell, + nlm, + tau1 * this->ucell->lat0, + T1, + atom1->iw2l[iw1], + atom1->iw2m[iw1], + atom1->iw2n[iw1], + tau0 * this->ucell->lat0, + T0); + for (int dir = 0; dir < 4; dir++) + { + nlm_tot[ad][dir].insert({all_indexes[iw1l], nlm[dir]}); + } + } + } + + #ifdef _OPENMP + // record the iat number of the adjacent atoms + std::set ad_atom_set; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T1 = adjs.ntype[ad]; + const int I1 = adjs.natom[ad]; + const int iat1 = ucell->itia2iat(T1, I1); + ad_atom_set.insert(iat1); + } + + // split the ad_atom_set into num_threads parts + const int num_threads = omp_get_num_threads(); + const int thread_id = omp_get_thread_num(); + std::set ad_atom_set_thread; + int i = 0; + for(const auto iat1 : ad_atom_set) + { + if (i % num_threads == thread_id) + { + ad_atom_set_thread.insert(iat1); + } + i++; + } + #endif + // 2. calculate D for each pair of atoms + for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1) + { + const int T1 = adjs.ntype[ad1]; + const int I1 = adjs.natom[ad1]; + const int iat1 = ucell->itia2iat(T1, I1); + #ifdef _OPENMP + if (ad_atom_set_thread.find(iat1) == ad_atom_set_thread.end()) + { + continue; + } + #endif + ModuleBase::Vector3& R_index1 = adjs.box[ad1]; + for (int ad2 = 0; ad2 < adjs.adj_num + 1; ++ad2) + { + const int T2 = adjs.ntype[ad2]; + const int I2 = adjs.natom[ad2]; + const int iat2 = ucell->itia2iat(T2, I2); + ModuleBase::Vector3& R_index2 = adjs.box[ad2]; + ModuleBase::Vector3 R_vector(R_index2[0] - R_index1[0], + R_index2[1] - R_index1[1], + R_index2[2] - R_index1[2]); + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_vector[0], R_vector[1], R_vector[2])->get_pointer(); + } + // if not found , skip this pair of atoms + if (tmp_c[0] != nullptr) + { + this->cal_vcomm_r_IJR(iat1, + iat2, + T0, + paraV, + nlm_tot[ad1], + nlm_tot[ad2], + tmp_c); + } + } + } + } + } + ModuleBase::timer::tick("Velocity_op", "calculate_vcomm_r"); +} + +// cal_HR_IJR() +template +void Velocity_op::cal_vcomm_r_IJR( + const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>& nlm1_all, + const std::vector>>& nlm2_all, + std::complex** current_mat_p) +{ + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + // --------------------------------------------- + // calculate the Nonlocal matrix for each pair of orbitals + // --------------------------------------------- + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + std::vector step_trace(npol * npol, 0); + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = col_indexes.size() * is + is2; + } + } + // calculate the local matrix + const TR* tmp_d = nullptr; + for (int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + // const std::vector>* nlm1 = &(nlm1_all[0].find(row_indexes[iw1l])->second); + //std::vector>*> nlm1; + std::vector*> nlm1; + for (int dir = 0; dir < 4; dir++) + { + nlm1.push_back(&(nlm1_all[dir].find(row_indexes[iw1l])->second)); + } + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + //std::vector>*> nlm2; + std::vector*> nlm2; + for (int dir = 0; dir < 4; dir++) + { + nlm2.push_back(&(nlm2_all[dir].find(col_indexes[iw2l])->second)); + } + +#ifdef __DEBUG + assert(nlm1.size() == nlm2.size()); +#endif + for (int is = 0; is < npol * npol; ++is) + { + for (int dir = 0; dir < 3; dir++) + { + std::complex nlm_r_tmp = std::complex{0, 0}; + std::complex imag_unit = std::complex{0, 1}; + for (int no = 0; no < this->ucell->atoms[T0].ncpp.non_zero_count_soc[is]; no++) + { + const int p1 = this->ucell->atoms[T0].ncpp.index1_soc[is][no]; + const int p2 = this->ucell->atoms[T0].ncpp.index2_soc[is][no]; + this->ucell->atoms[T0].ncpp.get_d(is, p1, p2, tmp_d); + //- + // multiply d in the end + TR tmp = (nlm1[dir + 1]->at(p1) * nlm2[0]->at(p2) + - nlm1[0]->at(p1) * nlm2[dir + 1]->at(p2)) + * (*tmp_d); + nlm_r_tmp += tmp; + } + // -i[r,Vnl], 2.0 due to the unit transformation + current_mat_p[dir][step_trace[is]] -= imag_unit * nlm_r_tmp / 2.0; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += npol; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } +} +template +void Velocity_op::calculate_grad_term() +{ + ModuleBase::TITLE("Velocity_op", "calculate_grad_term"); + if(this->current_term[0]==nullptr || this->current_term[0]->size_atom_pairs()<=0) + { + ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "grad_term is nullptr or empty"); + } + ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); + + const Parallel_Orbitals* paraV = this->current_term[0]->get_atom_pair(0).get_paraV(); +#ifdef _OPENMP +#pragma omp parallel for +#endif + for (int iat1 = 0; iat1 < this->ucell->nat; iat1++) + { + auto tau1 = ucell->get_tau(iat1); + int T1, I1; + ucell->iat2iait(iat1, &I1, &T1); + AdjacentAtomInfo& adjs = this->adjs_grad[iat1]; + for (int ad = 0; ad < adjs.adj_num + 1; ++ad) + { + const int T2 = adjs.ntype[ad]; + const int I2 = adjs.natom[ad]; + const int iat2 = ucell->itia2iat(T2, I2); + const ModuleBase::Vector3& R_index2 = adjs.box[ad]; + ModuleBase::Vector3 dtau = this->ucell->cal_dtau(iat1, iat2, R_index2); + + std::complex* tmp_c[3] = {nullptr, nullptr, nullptr}; + for (int i = 0; i < 3; i++) + { + tmp_c[i] = this->current_term[i]->find_matrix(iat1, iat2, R_index2)->get_pointer(); + } + if (tmp_c[0] != nullptr) + { + this->cal_grad_IJR(iat1, iat2, paraV, dtau, tmp_c); + } + else + { + ModuleBase::WARNING_QUIT("Velocity_op::calculate_grad_term", "R_index not found in HR"); + } + } + } + ModuleBase::timer::tick("Velocity_op", "calculate_grad_term"); +} +template +void Velocity_op::cal_grad_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex** current_mat_p) +{ + // --------------------------------------------- + // get info of orbitals of atom1 and atom2 from ucell + // --------------------------------------------- + int T1, I1; + this->ucell->iat2iait(iat1, &I1, &T1); + int T2, I2; + this->ucell->iat2iait(iat2, &I2, &T2); + Atom& atom1 = this->ucell->atoms[T1]; + Atom& atom2 = this->ucell->atoms[T2]; + + // npol is the number of polarizations, + // 1 for non-magnetic (one Hamiltonian matrix only has spin-up or spin-down), + // 2 for magnetic (one Hamiltonian matrix has both spin-up and spin-down) + const int npol = this->ucell->get_npol(); + + const int* iw2l1 = atom1.iw2l.data(); + const int* iw2n1 = atom1.iw2n.data(); + const int* iw2m1 = atom1.iw2m.data(); + const int* iw2l2 = atom2.iw2l.data(); + const int* iw2n2 = atom2.iw2n.data(); + const int* iw2m2 = atom2.iw2m.data(); + // --------------------------------------------- + // get tau1 (in cell <0,0,0>) and tau2 (in cell R) + // in principle, only dtau is needed in this function + // snap_psipsi should be refactored to use dtau directly + // --------------------------------------------- + const ModuleBase::Vector3& tau1 = this->ucell->get_tau(iat1); + const ModuleBase::Vector3 tau2 = tau1 + dtau; + // --------------------------------------------- + // calculate the Ekinetic matrix for each pair of orbitals + // --------------------------------------------- + double grad[3] = {0, 0, 0}; + auto row_indexes = paraV->get_indexes_row(iat1); + auto col_indexes = paraV->get_indexes_col(iat2); + const int step_trace = col_indexes.size() + 1; + for(int iw1l = 0; iw1l < row_indexes.size(); iw1l += npol) + { + const int iw1 = row_indexes[iw1l] / npol; + const int L1 = iw2l1[iw1]; + const int N1 = iw2n1[iw1]; + const int m1 = iw2m1[iw1]; + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M1 = (m1 % 2 == 0) ? -m1 / 2 : (m1 + 1) / 2; + + for (int iw2l = 0; iw2l < col_indexes.size(); iw2l += npol) + { + const int iw2 = col_indexes[iw2l] / npol; + const int L2 = iw2l2[iw2]; + const int N2 = iw2n2[iw2]; + const int m2 = iw2m2[iw2]; + // convert m (0,1,...2l) to M (-l, -l+1, ..., l-1, l) + int M2 = (m2 % 2 == 0) ? -m2 / 2 : (m2 + 1) / 2; + + // calculate , which equals to -. + intor_->calculate(T1, L1, N1, M1, T2, L2, N2, M2, dtau * this->ucell->lat0, nullptr, grad); + ModuleBase::Vector3 grad_overlap(grad[0], grad[1], grad[2]); + + for (int dir = 0; dir < 3; dir++) + { + for (int ipol = 0; ipol < npol; ipol++) + { + // part of Momentum operator, -iāˆ‡r,used to calculate the current + // here is actually iāˆ‡R + current_mat_p[dir][ipol * step_trace] += std::complex(0, grad_overlap[dir]); + } + current_mat_p[dir] += npol; + } + } + for (int dir = 0; dir < 3; dir++) + { + current_mat_p[dir] += (npol - 1) * col_indexes.size(); + } + } +} +template class Velocity_op; +template class Velocity_op>; diff --git a/source/source_lcao/module_tddft/velocity_op.h b/source/source_lcao/module_tddft/velocity_op.h new file mode 100644 index 0000000000..cebf99c214 --- /dev/null +++ b/source/source_lcao/module_tddft/velocity_op.h @@ -0,0 +1,79 @@ +#ifndef TD_VELOCITY_OP_H +#define TD_VELOCITY_OP_H +#include +#include "source_basis/module_ao/parallel_orbitals.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" +#include "source_cell/unitcell.h" +#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "source_basis/module_nao/two_center_integrator.h" +#include "source_base/vector3.h" +#include "module_io/cal_r_overlap_R.h" + +//design to calculate velocity operator +template +class Velocity_op +{ + public: + Velocity_op(const UnitCell* ucell_in, + const Grid_Driver* GridD_in, + const Parallel_Orbitals* paraV, + const LCAO_Orbitals& orb, + const TwoCenterIntegrator* intor); + ~Velocity_op(); + + hamilt::HContainer>* get_current_term_pointer(const int& i)const + { + return this->current_term[i]; + } + void calculate_vcomm_r(); + void calculate_grad_term(); + + private: + const UnitCell* ucell = nullptr; + + const Parallel_Orbitals* paraV = nullptr; + + const LCAO_Orbitals& orb_; + + /// @brief Store real space hamiltonian. TD term should include imaginary part, thus it has to be complex type. Only shared between TD operators. + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + + const TwoCenterIntegrator* intor_ = nullptr; + const TwoCenterIntegrator* intorbeta_ = nullptr; + + /** + * @brief initialize HR, search the nearest neighbor atoms + * HContainer is used to store the non-local pseudopotential matrix with specific atom-pairs + * the size of HR will be fixed after initialization + */ + void initialize_vcomm_r(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); + void initialize_grad_term(const Grid_Driver* GridD_in, const Parallel_Orbitals* paraV); + + /** + * @brief calculate the HR local matrix of atom pair + */ + void cal_vcomm_r_IJR(const int& iat1, + const int& iat2, + const int& T0, + const Parallel_Orbitals* paraV, + const std::vector>>& nlm1_all, + const std::vector>>& nlm2_all, + std::complex** current_mat_p); + void cal_grad_IJR(const int& iat1, + const int& iat2, + const Parallel_Orbitals* paraV, + const ModuleBase::Vector3& dtau, + std::complex** current_mat_p); + + /// @brief exact the nearest neighbor atoms from all adjacent atoms + std::vector adjs_vcommr; + std::vector adjs_grad; + + /// @brief Store the vector potential for td_ekinetic term + ModuleBase::Vector3 cart_At; + static cal_r_overlap_R r_calculator; + static bool init_done; +}; + + +#endif // TD_CURRENT_H From 74e14fa79b73c2cfe03ead38d84f43e529585c15 Mon Sep 17 00:00:00 2001 From: ESROAMER Date: Sat, 28 Jun 2025 19:24:59 +0800 Subject: [PATCH 81/81] rename --- source/module_lr/lr_spectrum.h | 2 +- .../source_esolver/esolver_ks_lcao_tddft.cpp | 22 +- source/source_esolver/esolver_ks_lcao_tddft.h | 4 +- source/source_io/cal_r_overlap_R.h | 6 +- source/source_io/input_conv.cpp | 18 +- source/source_io/read_wfc_nao.cpp | 4 +- source/source_io/read_wfc_nao.h | 1 + source/source_io/td_current_io.cpp | 421 +++++++++++++++--- source/source_io/td_current_io.h | 45 +- source/source_io/write_HS_sparse.cpp | 12 +- source/source_io/write_wfc_nao.cpp | 2 +- .../hamilt_lcaodft/hamilt_lcao.cpp | 8 +- .../operator_lcao/operator_lcao.cpp | 4 +- .../operator_lcao/overlap_new.cpp | 6 +- .../operator_lcao/td_ekinetic_lcao.cpp | 6 +- .../operator_lcao/td_ekinetic_lcao.h | 4 +- .../operator_lcao/td_nonlocal_lcao.cpp | 6 +- .../operator_lcao/td_nonlocal_lcao.h | 6 +- .../operator_lcao/td_pot_hybrid.cpp | 4 +- .../operator_lcao/td_pot_hybrid.h | 8 +- .../source_lcao/hamilt_lcaodft/spar_hsr.cpp | 4 +- .../source_lcao/module_tddft/evolve_elec.cpp | 4 +- source/source_lcao/module_tddft/evolve_elec.h | 2 +- .../source_lcao/module_tddft/evolve_psi.cpp | 2 +- source/source_lcao/module_tddft/evolve_psi.h | 2 +- .../source_lcao/module_tddft/td_folding.cpp | 2 +- source/source_lcao/module_tddft/td_info.h | 2 +- .../source_lcao/module_tddft/velocity_op.cpp | 2 +- source/source_lcao/module_tddft/velocity_op.h | 4 +- 29 files changed, 466 insertions(+), 147 deletions(-) diff --git a/source/module_lr/lr_spectrum.h b/source/module_lr/lr_spectrum.h index 052a85882a..9a286c95dd 100644 --- a/source/module_lr/lr_spectrum.h +++ b/source/module_lr/lr_spectrum.h @@ -5,7 +5,7 @@ #include "source_estate/module_dm/density_matrix.h" #include "module_lr/utils/lr_util.h" #include "source_basis/module_nao/two_center_bundle.h" -#include "module_hamilt_lcao/module_tddft/velocity_op.h" +#include "source_lcao/module_tddft/velocity_op.h" namespace LR { template diff --git a/source/source_esolver/esolver_ks_lcao_tddft.cpp b/source/source_esolver/esolver_ks_lcao_tddft.cpp index 20803dd35f..9d3528ea2c 100644 --- a/source/source_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/source_esolver/esolver_ks_lcao_tddft.cpp @@ -1,12 +1,12 @@ #include "esolver_ks_lcao_tddft.h" -#include "module_io/cal_r_overlap_R.h" -#include "module_io/dipole_io.h" -#include "module_io/td_current_io.h" -#include "module_io/read_wfc_nao.h" -#include "module_io/write_HS.h" -#include "module_io/write_HS_R.h" -#include "module_io/output_log.h" +#include "source_io/cal_r_overlap_R.h" +#include "source_io/dipole_io.h" +#include "source_io/td_current_io.h" +#include "source_io/read_wfc_nao.h" +#include "source_io/write_HS.h" +#include "source_io/write_HS_R.h" +#include "source_io/output_log.h" #include "source_estate/elecstate_tools.h" //--------------temporary---------------------------- @@ -19,21 +19,21 @@ #include "source_estate/module_dm/cal_edm_tddft.h" #include "source_estate/module_dm/density_matrix.h" #include "source_estate/occupy.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" +#include "source_lcao/module_tddft/evolve_elec.h" #include "source_pw/hamilt_pwdft/global.h" -#include "module_io/print_info.h" +#include "source_io/print_info.h" //-----HSolver ElecState Hamilt-------- #include "source_estate/cal_ux.h" #include "source_estate/elecstate_lcao.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_hsolver/hsolver_lcao.h" #include "module_parameter/parameter.h" #include "source_psi/psi.h" #include "source_estate/module_pot/H_TDDFT_pw.h" //-----force& stress------------------- -#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" +#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" //--------------------------------------------------- diff --git a/source/source_esolver/esolver_ks_lcao_tddft.h b/source/source_esolver/esolver_ks_lcao_tddft.h index e588bdf8c1..9071b65600 100644 --- a/source/source_esolver/esolver_ks_lcao_tddft.h +++ b/source/source_esolver/esolver_ks_lcao_tddft.h @@ -5,8 +5,8 @@ #include "source_base/scalapack_connector.h" // Cpxgemr2d #include "source_lcao/hamilt_lcaodft/record_adj.h" #include "source_psi/psi.h" -#include "module_hamilt_lcao/module_tddft/velocity_op.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/module_tddft/velocity_op.h" +#include "source_lcao/module_tddft/td_info.h" namespace ModuleESolver { diff --git a/source/source_io/cal_r_overlap_R.h b/source/source_io/cal_r_overlap_R.h index 07f044f6b0..de30c0b8f5 100644 --- a/source/source_io/cal_r_overlap_R.h +++ b/source/source_io/cal_r_overlap_R.h @@ -11,9 +11,9 @@ #include "source_basis/module_ao/parallel_orbitals.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb21.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb.h" +#include "source_lcao/hamilt_lcaodft/center2_orb-orb11.h" +#include "source_lcao/hamilt_lcaodft/center2_orb-orb21.h" +#include "source_lcao/hamilt_lcaodft/center2_orb.h" #include "single_R_io.h" #include diff --git a/source/source_io/input_conv.cpp b/source/source_io/input_conv.cpp index 5a451844e3..240ff80894 100644 --- a/source/source_io/input_conv.cpp +++ b/source/source_io/input_conv.cpp @@ -1,4 +1,4 @@ -#include "module_io/input_conv.h" +#include "source_io/input_conv.h" #include "source_base/global_function.h" #include "source_base/global_variable.h" @@ -7,10 +7,10 @@ #include "source_estate/occupy.h" #include "source_hamilt/module_surchem/surchem.h" #include "source_pw/hamilt_pwdft/global.h" -#include "module_io/berryphase.h" +#include "source_io/berryphase.h" #include "module_parameter/parameter.h" -#include "module_relax/ions_move_basic.h" -#include "module_relax/lattice_change_basic.h" +#include "source_relax/ions_move_basic.h" +#include "source_relax/lattice_change_basic.h" #include @@ -18,13 +18,13 @@ #include "module_ri/exx_abfs-jle.h" #endif -#include "module_hamilt_lcao/module_dftu/dftu.h" +#include "source_lcao/module_dftu/dftu.h" #ifdef __LCAO #include "source_basis/module_ao/ORB_read.h" #include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h" -#include "module_hamilt_lcao/module_tddft/evolve_elec.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/hamilt_lcaodft/FORCE_STRESS.h" +#include "source_lcao/module_tddft/evolve_elec.h" +#include "source_lcao/module_tddft/td_info.h" #endif #ifdef __PEXSI #include "source_hsolver/module_pexsi/pexsi_solver.h" @@ -41,7 +41,7 @@ #include "source_estate/module_pot/gatefield.h" #include "source_hsolver/hsolver_lcao.h" #include "source_hsolver/hsolver_pw.h" -#include "module_md/md_func.h" +#include "source_md/md_func.h" #ifdef __LCAO std::vector Input_Conv::convert_units(std::string params, double c) { diff --git a/source/source_io/read_wfc_nao.cpp b/source/source_io/read_wfc_nao.cpp index b6f6262ef9..b330213d1d 100644 --- a/source/source_io/read_wfc_nao.cpp +++ b/source/source_io/read_wfc_nao.cpp @@ -2,11 +2,11 @@ #include "source_base/parallel_common.h" #include "source_base/timer.h" -#include "module_io/write_wfc_nao.h" +#include "source_io/write_wfc_nao.h" #include "write_wfc_nao.h" #include "source_base/scalapack_connector.h" -#include "module_io/filename.h" +#include "source_io/filename.h" void ModuleIO::read_wfc_nao_one_data(std::ifstream& ifs, double& data) { diff --git a/source/source_io/read_wfc_nao.h b/source/source_io/read_wfc_nao.h index 370071f04b..e0993d2482 100644 --- a/source/source_io/read_wfc_nao.h +++ b/source/source_io/read_wfc_nao.h @@ -44,6 +44,7 @@ bool read_wfc_nao( const std::vector &ik2iktot, const int nkstot, const int nspin, + const int nstep = -1, const int skip_band = 0); } // namespace ModuleIO diff --git a/source/source_io/td_current_io.cpp b/source/source_io/td_current_io.cpp index c9c1f6e9aa..23c7f5a163 100644 --- a/source/source_io/td_current_io.cpp +++ b/source/source_io/td_current_io.cpp @@ -10,30 +10,210 @@ #include "source_estate/module_dm/cal_dm_psi.h" #include "source_estate/module_pot/H_TDDFT_pw.h" #include "source_lcao/hamilt_lcaodft/LCAO_domain.h" -#include "source_lcao/module_tddft/td_current.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "source_lcao/module_tddft/td_info.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #ifdef __LCAO +void ModuleIO::cal_tmp_DM(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, + elecstate::DensityMatrix, double>& DM_imag, + int nspin_dm) +{ + ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + for (int is = 1; is <= nspin_dm; ++is) + { + for (int ik = 0; ik < DM_real.get_DMK_nks() / nspin_dm; ++ik) + { + cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is, false); + } + } + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); +} +template +void ModuleIO::write_current(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra) +{ + + ModuleBase::TITLE("ModuleIO", "write_current"); + ModuleBase::timer::tick("ModuleIO", "write_current"); + std::vector>*> current_term = {nullptr, nullptr, nullptr}; + if (PARAM.inp.td_stype!=1) + { + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = cal_current->get_current_term_pointer(dir); + } + } + else + { + if (TD_info::td_vel_op == nullptr) + { + ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); + } + for (int dir = 0; dir < 3; dir++) + { + current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); + } + } + double omega=ucell.omega; + // construct a DensityMatrix object + // Since the function cal_dm_psi do not suport DMR in complex type, I replace it with two DMR in double type. Should + // be refactored in the future. + const int nspin0 = PARAM.inp.nspin; + const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; + elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); + // calculate DMK + elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); + + // init DMR + DM_real.init_DMR(ra, &ucell); + DM_imag.init_DMR(ra, &ucell); + cal_tmp_DM(ucell, DM_real, DM_imag, nspin_dm); + //DM_real.sum_DMR_spin(); + //DM_imag.sum_DMR_spin(); + + double current_total[3] = {0.0, 0.0, 0.0}; +#ifdef _OPENMP +#pragma omp parallel + { + double local_current[3] = {0.0, 0.0, 0.0}; +#else + // ModuleBase::matrix& local_soverlap = soverlap; + double* local_current = current_total; +#endif + ModuleBase::Vector3 tau1, dtau, tau2; + +#ifdef _OPENMP +#pragma omp for schedule(dynamic) +#endif + for (int iat = 0; iat < ucell.nat; iat++) + { + const int T1 = ucell.iat2it[iat]; + Atom* atom1 = &ucell.atoms[T1]; + const int I1 = ucell.iat2ia[iat]; + // get iat1 + int iat1 = ucell.itia2iat(T1, I1); + const int start1 = ucell.itiaiw2iwt(T1, I1, 0); + for (int cb = 0; cb < ra.na_each[iat]; ++cb) + { + const int T2 = ra.info[iat][cb][3]; + const int I2 = ra.info[iat][cb][4]; + + const int start2 = ucell.itiaiw2iwt(T2, I2, 0); + + Atom* atom2 = &ucell.atoms[T2]; + + // get iat2 + int iat2 = ucell.itia2iat(T2, I2); + double Rx = ra.info[iat][cb][0]; + double Ry = ra.info[iat][cb][1]; + double Rz = ra.info[iat][cb][2]; + //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; + // get BaseMatrix + hamilt::BaseMatrix* tmp_matrix_real + = DM_real.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix* tmp_matrix_imag + = DM_imag.get_DMR_pointer(1)->find_matrix(iat1, iat2, Rx, Ry, Rz); + // refactor + hamilt::BaseMatrix>* tmp_m_rvx + = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvy + = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); + hamilt::BaseMatrix>* tmp_m_rvz + = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); + if (tmp_matrix_real == nullptr) + { + continue; + } + int row_ap = pv->atom_begin_row[iat1]; + int col_ap = pv->atom_begin_col[iat2]; + // get DMR + for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) + { + for (int nu = 0; nu < pv->get_col_size(iat2); ++nu) + { + double dm2d1_real = tmp_matrix_real->get_value(mu, nu); + double dm2d1_imag = tmp_matrix_imag->get_value(mu, nu); + + std::complex rvx = {0, 0}; + std::complex rvy = {0, 0}; + std::complex rvz = {0, 0}; + + if (tmp_m_rvx != nullptr) + { + rvx = tmp_m_rvx->get_value(mu, nu); + rvy = tmp_m_rvy->get_value(mu, nu); + rvz = tmp_m_rvz->get_value(mu, nu); + } + //std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; + // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; + //std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; + local_current[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); + local_current[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); + local_current[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); + } // end kk + } // end jj + } // end cb + } // end iat +#ifdef _OPENMP +#pragma omp critical(cal_current_k_reduce) + { + for (int i = 0; i < 3; ++i) + { + current_total[i] += local_current[i]; + } + } + } +#endif + Parallel_Reduce::reduce_all(current_total, 3); + // write end + if (GlobalV::MY_RANK == 0) + { + std::string filename = PARAM.globalv.global_out_dir + "current_total.dat"; + std::ofstream fout; + fout.open(filename, std::ios::app); + fout << std::setprecision(16); + fout << std::scientific; + fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; + fout.close(); + } -void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double>& DM_real, + ModuleBase::timer::tick("ModuleIO", "write_current"); + return; +} +void ModuleIO::cal_tmp_DM_k(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, elecstate::DensityMatrix, double>& DM_imag, const int ik, const int nspin, - const int is) + const int is, + const bool reset) { - ModuleBase::TITLE("ModuleIO", "cal_tmp_DM"); - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + ModuleBase::TITLE("ModuleIO", "cal_tmp_DM_k"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); int ld_hk = DM_real.get_paraV_pointer()->nrow; int ld_hk2 = 2 * ld_hk; // tmp for is int ik_begin = DM_real.get_DMK_nks() / nspin * (is - 1); // jump nk for spin_down if nspin==2 - - hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[is - 1]; - hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[is - 1]; - tmp_DMR_real->set_zero(); - tmp_DMR_imag->set_zero(); + //sum spin up and down into up + hamilt::HContainer* tmp_DMR_real = DM_real.get_DMR_vector()[0]; + hamilt::HContainer* tmp_DMR_imag = DM_imag.get_DMR_vector()[0]; + if(reset) + { + tmp_DMR_real->set_zero(); + tmp_DMR_imag->set_zero(); + } #ifdef _OPENMP #pragma omp parallel for #endif @@ -46,6 +226,12 @@ void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double> // get global indexes of whole matrix for each atom in this process int row_ap = DM_real.get_paraV_pointer()->atom_begin_row[iat1]; int col_ap = DM_real.get_paraV_pointer()->atom_begin_col[iat2]; + // SOC + std::vector> tmp_DMR; + if (PARAM.inp.nspin == 4) + { + tmp_DMR.resize(tmp_ap_real.get_size()); + } for (int ir = 0; ir < tmp_ap_real.get_R_size(); ++ir) { const ModuleBase::Vector3 r_index = tmp_ap_real.get_R_index(ir); @@ -61,10 +247,20 @@ void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double> // only ik if (PARAM.inp.nspin != 4) { + double arg_td = 0.0; + if(elecstate::H_TDDFT_pw::stype == 2) + { + //cal tddft phase for hybrid gague + const int iat1 = tmp_ap_real.get_atom_i(); + const int iat2 = tmp_ap_real.get_atom_j(); + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + double& tmp_lat0 = ucell.lat0; + arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; + } // cal k_phase // if TK==std::complex, kphase is e^{ikR} const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); - const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI; + const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; double sinp, cosp; ModuleBase::libm::sincos(arg, &sinp, &cosp); std::complex kphase = std::complex(cosp, sinp); @@ -112,13 +308,97 @@ void ModuleIO::cal_tmp_DM(elecstate::DensityMatrix, double> tmp_DMR_imag_pointer += DM_imag.get_paraV_pointer()->get_col_size(iat2); } } + // treat DMR as pauli matrix when NSPIN=4 + if (PARAM.inp.nspin == 4) + { + tmp_DMR.assign(tmp_ap_real.get_size(), std::complex(0.0, 0.0)); + { + // cal k_phase + // if TK==std::complex, kphase is e^{ikR} + const ModuleBase::Vector3 dR(r_index.x, r_index.y, r_index.z); + double arg_td = 0.0; + if(elecstate::H_TDDFT_pw::stype == 2) + { + //new + //cal tddft phase for mixing gague + const int iat1 = tmp_ap_real.get_atom_i(); + const int iat2 = tmp_ap_real.get_atom_j(); + ModuleBase::Vector3 dtau = ucell.cal_dtau(iat1, iat2, r_index); + double& tmp_lat0 = ucell.lat0; + arg_td = TD_info::td_vel_op->cart_At * dtau * tmp_lat0; + } + const double arg = (DM_real.get_kvec_d()[ik] * dR) * ModuleBase::TWO_PI + arg_td; + double sinp, cosp; + ModuleBase::libm::sincos(arg, &sinp, &cosp); + std::complex kphase = std::complex(cosp, sinp); + // set DMR element + std::complex* tmp_DMR_pointer = tmp_DMR.data(); + std::complex* tmp_DMK_pointer = DM_real.get_DMK_pointer(ik + ik_begin);; + double* DMK_real_pointer = nullptr; + double* DMK_imag_pointer = nullptr; + // jump DMK to fill DMR + // DMR is row-major, DMK is column-major + tmp_DMK_pointer += col_ap * DM_real.get_paraV_pointer()->nrow + row_ap; + for (int mu = 0; mu < tmp_ap_real.get_row_size(); ++mu) + { + BlasConnector::axpy(tmp_ap_real.get_col_size(), + kphase, + tmp_DMK_pointer, + ld_hk, + tmp_DMR_pointer, + 1); + tmp_DMK_pointer += 1; + tmp_DMR_pointer += tmp_ap_real.get_col_size(); + } + } + int npol = 2; + // step_trace = 0 for NSPIN=1,2; ={0, 1, local_col, local_col+1} for NSPIN=4 + int step_trace[4]; + for (int is = 0; is < npol; is++) + { + for (int is2 = 0; is2 < npol; is2++) + { + step_trace[is * npol + is2] = tmp_ap_real.get_col_size() * is + is2; + } + } + std::complex tmp[4]; + double* target_DMR_real = tmp_matrix_real->get_pointer(); + double* target_DMR_imag = tmp_matrix_imag->get_pointer(); + std::complex* tmp_DMR_pointer = tmp_DMR.data(); + for (int irow = 0; irow < tmp_ap_real.get_row_size(); irow += 2) + { + for (int icol = 0; icol < tmp_ap_real.get_col_size(); icol += 2) + { + // catch the 4 spin component value of one orbital pair + tmp[0] = tmp_DMR_pointer[icol + step_trace[0]]; + tmp[1] = tmp_DMR_pointer[icol + step_trace[1]]; + tmp[2] = tmp_DMR_pointer[icol + step_trace[2]]; + tmp[3] = tmp_DMR_pointer[icol + step_trace[3]]; + // transfer to Pauli matrix and save the real part + // save them back to the tmp_matrix + target_DMR_real[icol + step_trace[0]] += tmp[0].real() + tmp[3].real(); + target_DMR_real[icol + step_trace[1]] += tmp[1].real() + tmp[2].real(); + target_DMR_real[icol + step_trace[2]] + += -tmp[1].imag() + tmp[2].imag(); // (i * (rho_updown - rho_downup)).real() + target_DMR_real[icol + step_trace[3]] += tmp[0].real() - tmp[3].real(); + //imag part + target_DMR_imag[icol + step_trace[0]] += tmp[0].imag() + tmp[3].imag(); + target_DMR_imag[icol + step_trace[1]] += tmp[1].imag() + tmp[2].imag(); + target_DMR_imag[icol + step_trace[2]] + += tmp[1].real() - tmp[2].real(); // (i * (rho_updown - rho_downup)).real() + target_DMR_imag[icol + step_trace[3]] += tmp[0].imag() - tmp[3].imag(); + } + tmp_DMR_pointer += tmp_ap_real.get_col_size() * 2; + target_DMR_real += tmp_ap_real.get_col_size() * 2; + target_DMR_imag += tmp_ap_real.get_col_size() * 2; + } + } } } - ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM"); + ModuleBase::timer::tick("ModuleIO", "cal_tmp_DM_k"); } - -void ModuleIO::write_current(const UnitCell& ucell, - const Grid_Driver& gd, +template +void ModuleIO::write_current_eachk(const UnitCell& ucell, const int istep, const psi::Psi>* psi, const elecstate::ElecState* pelec, @@ -126,19 +406,15 @@ void ModuleIO::write_current(const UnitCell& ucell, const TwoCenterIntegrator* intor, const Parallel_Orbitals* pv, const LCAO_Orbitals& orb, + const Velocity_op* cal_current, Record_adj& ra) { + ModuleBase::TITLE("ModuleIO", "write_current"); ModuleBase::timer::tick("ModuleIO", "write_current"); - - TD_current* cal_current = nullptr; std::vector>*> current_term = {nullptr, nullptr, nullptr}; - - if (!TD_Velocity::tddft_velocity) + if (PARAM.inp.td_stype != 1) { - cal_current = new TD_current(&ucell, &gd, pv, orb, intor); - cal_current->calculate_vcomm_r(); - cal_current->calculate_grad_term(); for (int dir = 0; dir < 3; dir++) { current_term[dir] = cal_current->get_current_term_pointer(dir); @@ -146,16 +422,16 @@ void ModuleIO::write_current(const UnitCell& ucell, } else { - if (TD_Velocity::td_vel_op == nullptr) + if (TD_info::td_vel_op == nullptr) { - ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gauge infos is null!"); + ModuleBase::WARNING_QUIT("ModuleIO::write_current", "velocity gague infos is null!"); } for (int dir = 0; dir < 3; dir++) { - current_term[dir] = TD_Velocity::td_vel_op->get_current_term_pointer(dir); + current_term[dir] = TD_info::td_vel_op->get_current_term_pointer(dir); } } - + double omega=ucell.omega; // construct a DensityMatrix object // Since the function cal_dm_psi do not suport DMR in complex type, // I replace it with two DMR in double type. @@ -163,10 +439,8 @@ void ModuleIO::write_current(const UnitCell& ucell, const int nspin0 = PARAM.inp.nspin; const int nspin_dm = std::map({ {1,1},{2,2},{4,1} })[nspin0]; - elecstate::DensityMatrix, double> DM_real(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); elecstate::DensityMatrix, double> DM_imag(pv, nspin_dm, kv.kvec_d, kv.get_nks() / nspin_dm); - // calculate DMK elecstate::cal_dm_psi(DM_real.get_paraV_pointer(), pelec->wg, psi[0], DM_real); @@ -174,32 +448,23 @@ void ModuleIO::write_current(const UnitCell& ucell, DM_real.init_DMR(ra, &ucell); DM_imag.init_DMR(ra, &ucell); - int nks = DM_real.get_DMK_nks(); - if (nspin0 == 2) - { - nks /= 2; - } - + int nks = DM_real.get_DMK_nks() / nspin_dm; double current_total[3] = {0.0, 0.0, 0.0}; - for (int is = 1; is <= nspin0; ++is) + for (int is = 1; is <= nspin_dm; ++is) { for (int ik = 0; ik < nks; ++ik) { - cal_tmp_DM(DM_real, DM_imag, ik, nspin0, is); + cal_tmp_DM_k(ucell, DM_real, DM_imag, ik, nspin_dm, is); // check later double current_ik[3] = {0.0, 0.0, 0.0}; - int total_irr = 0; - #ifdef _OPENMP #pragma omp parallel { int num_threads = omp_get_num_threads(); double local_current_ik[3] = {0.0, 0.0, 0.0}; - int local_total_irr = 0; #else // ModuleBase::matrix& local_soverlap = soverlap; double* local_current_ik = current_ik; - int& local_total_irr = total_irr; #endif ModuleBase::Vector3 tau1, dtau, tau2; @@ -214,8 +479,6 @@ void ModuleIO::write_current(const UnitCell& ucell, const int I1 = ucell.iat2ia[iat]; // get iat1 int iat1 = ucell.itia2iat(T1, I1); - - int irr = pv->nlocstart[iat]; const int start1 = ucell.itiaiw2iwt(T1, I1, 0); for (int cb = 0; cb < ra.na_each[iat]; ++cb) { @@ -231,13 +494,12 @@ void ModuleIO::write_current(const UnitCell& ucell, double Rx = ra.info[iat][cb][0]; double Ry = ra.info[iat][cb][1]; double Rz = ra.info[iat][cb][2]; - + //std::cout<< "iat1: " << iat1 << " iat2: " << iat2 << " Rx: " << Rx << " Ry: " << Ry << " Rz:" << Rz << std::endl; // get BaseMatrix hamilt::BaseMatrix* tmp_matrix_real = DM_real.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); hamilt::BaseMatrix* tmp_matrix_imag = DM_imag.get_DMR_pointer(is)->find_matrix(iat1, iat2, Rx, Ry, Rz); - // refactor hamilt::BaseMatrix>* tmp_m_rvx = current_term[0]->find_matrix(iat1, iat2, Rx, Ry, Rz); @@ -245,15 +507,12 @@ void ModuleIO::write_current(const UnitCell& ucell, = current_term[1]->find_matrix(iat1, iat2, Rx, Ry, Rz); hamilt::BaseMatrix>* tmp_m_rvz = current_term[2]->find_matrix(iat1, iat2, Rx, Ry, Rz); - if (tmp_matrix_real == nullptr) { continue; } - int row_ap = pv->atom_begin_row[iat1]; int col_ap = pv->atom_begin_col[iat2]; - // get DMR for (int mu = 0; mu < pv->get_row_size(iat1); ++mu) { @@ -272,12 +531,12 @@ void ModuleIO::write_current(const UnitCell& ucell, rvy = tmp_m_rvy->get_value(mu, nu); rvz = tmp_m_rvz->get_value(mu, nu); } - local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); + // std::cout<<"mu: "<< mu <<" nu: "<< nu << std::endl; + // std::cout<<"dm2d1_real: "<< dm2d1_real << " dm2d1_imag: "<< dm2d1_imag << std::endl; + // std::cout<<"rvz: "<< rvz.real() << " " << rvz.imag() << std::endl; + local_current_ik[0] -= dm2d1_real * rvx.real() - dm2d1_imag * rvx.imag(); local_current_ik[1] -= dm2d1_real * rvy.real() - dm2d1_imag * rvy.imag(); local_current_ik[2] -= dm2d1_real * rvz.real() - dm2d1_imag * rvz.imag(); - - ++local_total_irr; - ++irr; } // end kk } // end jj } // end cb @@ -285,7 +544,6 @@ void ModuleIO::write_current(const UnitCell& ucell, #ifdef _OPENMP #pragma omp critical(cal_current_k_reduce) { - total_irr += local_total_irr; for (int i = 0; i < 3; ++i) { current_ik[i] += local_current_ik[i]; @@ -298,9 +556,8 @@ void ModuleIO::write_current(const UnitCell& ucell, { current_total[i] += current_ik[i]; } - // MPI_Reduce(local_current_ik, current_ik, 3, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); - if (GlobalV::MY_RANK == 0 && TD_Velocity::out_current_k) + if (GlobalV::MY_RANK == 0 && TD_info::out_current_k) { std::string filename = PARAM.globalv.global_out_dir + "current_spin" + std::to_string(is) + "_ik" + std::to_string(ik) + ".dat"; @@ -308,7 +565,7 @@ void ModuleIO::write_current(const UnitCell& ucell, fout.open(filename, std::ios::app); fout << std::setprecision(16); fout << std::scientific; - fout << istep << " " << current_ik[0] << " " << current_ik[1] << " " << current_ik[2] << std::endl; + fout << istep << " " << current_ik[0]/omega << " " << current_ik[1]/omega << " " << current_ik[2]/omega << std::endl; fout.close(); } // write end @@ -321,15 +578,57 @@ void ModuleIO::write_current(const UnitCell& ucell, fout.open(filename, std::ios::app); fout << std::setprecision(16); fout << std::scientific; - fout << istep << " " << current_total[0] << " " << current_total[1] << " " << current_total[2] << std::endl; + fout << istep << " " << current_total[0]/omega << " " << current_total[1]/omega << " " << current_total[2]/omega << std::endl; fout.close(); } - if (!TD_Velocity::tddft_velocity) - { - delete cal_current; - } ModuleBase::timer::tick("ModuleIO", "write_current"); return; } +template +void ModuleIO::write_current_eachk( + const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current_eachk>(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op>* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template +void ModuleIO::write_current>(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op>* cal_current, + Record_adj& ra); #endif //__LCAO + diff --git a/source/source_io/td_current_io.h b/source/source_io/td_current_io.h index 5f1424c3b8..9fd079fd42 100644 --- a/source/source_io/td_current_io.h +++ b/source/source_io/td_current_io.h @@ -5,30 +5,49 @@ #include "source_estate/elecstate_lcao.h" #include "source_estate/module_dm/density_matrix.h" #include "source_psi/psi.h" +#include "source_lcao/module_tddft/velocity_op.h" namespace ModuleIO { #ifdef __LCAO /// @brief func to output current, only used in tddft +template +void write_current_eachk(const UnitCell& ucell, + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); +template void write_current(const UnitCell& ucell, - const Grid_Driver& gd, - const int istep, - const psi::Psi>* psi, - const elecstate::ElecState* pelec, - const K_Vectors& kv, - const TwoCenterIntegrator* intor, - const Parallel_Orbitals* pv, - const LCAO_Orbitals& orb, - Record_adj& ra); + const int istep, + const psi::Psi>* psi, + const elecstate::ElecState* pelec, + const K_Vectors& kv, + const TwoCenterIntegrator* intor, + const Parallel_Orbitals* pv, + const LCAO_Orbitals& orb, + const Velocity_op* cal_current, + Record_adj& ra); /// @brief calculate sum_n[šœŒ_(š‘›š‘˜,šœ‡šœˆ)] for current calculation -void cal_tmp_DM(elecstate::DensityMatrix, double>& DM_real, +void cal_tmp_DM_k(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, elecstate::DensityMatrix, double>& DM_imag, const int ik, const int nspin, - const int is); + const int is, + const bool reset = true); + +void cal_tmp_DM(const UnitCell& ucell, + elecstate::DensityMatrix, double>& DM_real, + elecstate::DensityMatrix, double>& DM_imag, + const int nspin); #endif // __LCAO } // namespace ModuleIO - -#endif +#endif // W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_IO_TD_CURRENT_IO_H diff --git a/source/source_io/write_HS_sparse.cpp b/source/source_io/write_HS_sparse.cpp index 1ccb46c7f5..98ec8a0385 100644 --- a/source/source_io/write_HS_sparse.cpp +++ b/source/source_io/write_HS_sparse.cpp @@ -3,7 +3,7 @@ #include "module_parameter/parameter.h" #include "source_base/parallel_reduce.h" #include "source_base/timer.h" -#include "source_lcao/module_tddft/td_velocity.h" +#include "source_lcao/module_tddft/td_info.h" #include "source_pw/hamilt_pwdft/global.h" #include "single_R_io.h" @@ -48,12 +48,12 @@ void ModuleIO::save_HSR_sparse(const int& istep, for (auto& R_coor: all_R_coor_ptr) { if (PARAM.inp.nspin != 4) { for (int ispin = 0; ispin < spin_loop; ++ispin) { - if (TD_Velocity::tddft_velocity) { + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { auto iter - = TD_Velocity::td_vel_op->HR_sparse_td_vel[ispin].find( + = TD_info::td_vel_op->HR_sparse_td_vel[ispin].find( R_coor); if (iter - != TD_Velocity::td_vel_op->HR_sparse_td_vel[ispin] + != TD_info::td_vel_op->HR_sparse_td_vel[ispin] .end()) { for (auto& row_loop: iter->second) { H_nonzero_num[ispin][count] @@ -254,9 +254,9 @@ void ModuleIO::save_HSR_sparse(const int& istep, // } } else { if (PARAM.inp.nspin != 4) { - if (TD_Velocity::tddft_velocity) { + if (PARAM.inp.esolver_type == "tddft" && PARAM.inp.td_stype == 1) { output_single_R(g1[ispin], - TD_Velocity::td_vel_op + TD_info::td_vel_op ->HR_sparse_td_vel[ispin][R_coor], sparse_thr, binary, diff --git a/source/source_io/write_wfc_nao.cpp b/source/source_io/write_wfc_nao.cpp index 162a280b13..8297b7e35c 100644 --- a/source/source_io/write_wfc_nao.cpp +++ b/source/source_io/write_wfc_nao.cpp @@ -269,7 +269,7 @@ void write_wfc_nao(const int out_type, if (myid == 0) { - std::string fn = filename_output(PARAM.globalv.global_out_dir,"wf","nao",ik,ik2iktot,nspin,nkstot, + std::string fn = filename_output(PARAM.globalv.global_wfc_dir,"wf","nao",ik,ik2iktot,nspin,nkstot, out_type,out_app_flag,gamma_only,istep); bool append_flag = (istep > 0 && out_app_flag); diff --git a/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp b/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp index 87867bb927..d1d0568e0f 100644 --- a/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/hamilt_lcao.cpp @@ -3,14 +3,14 @@ #include "source_base/global_variable.h" #include "source_base/memory.h" #include "source_base/timer.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" +#include "source_lcao/module_dftu/dftu.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #include #ifdef __MLALGO -#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" +#include "source_lcao/module_deepks/LCAO_deepks.h" #include "operator_lcao/deepks_lcao.h" #endif @@ -25,8 +25,8 @@ #include "source_estate/module_pot/H_TDDFT_pw.h" #include "source_hamilt/module_xc/xc_functional.h" -#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_lcao/module_deltaspin/spin_constrain.h" +#include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_hsolver/hsolver_lcao.h" #include "operator_lcao/dftu_lcao.h" #include "operator_lcao/dspin_lcao.h" diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp index ca94601fa9..44423f28ee 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.cpp @@ -2,7 +2,7 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_hsolver/hsolver_lcao.h" #include "module_parameter/parameter.h" @@ -12,7 +12,7 @@ #include "source_hsolver/diago_elpa_native.h" #endif -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/module_tddft/td_info.h" namespace hamilt { diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp index f96f8fd67f..503cc584c4 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp @@ -4,10 +4,10 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/module_tddft/td_info.h" template hamilt::OverlapNew>::OverlapNew(HS_Matrix_K* hsk_in, diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp index 2b202b7811..320e1a8f60 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.cpp @@ -7,9 +7,9 @@ #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/center2_orb-orb11.h" -#include "module_hamilt_lcao/hamilt_lcaodft/spar_hsr.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_lcao/hamilt_lcaodft/center2_orb-orb11.h" +#include "source_lcao/hamilt_lcaodft/spar_hsr.h" +#include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_pw/hamilt_pwdft/global.h" namespace hamilt diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h index 310504aa07..f429328dc1 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_ekinetic_lcao.h @@ -4,8 +4,8 @@ #include "source_basis/module_nao/two_center_integrator.h" #include "source_cell/klist.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/module_hcontainer/hcontainer.h" +#include "source_lcao/module_tddft/td_info.h" #include "operator_lcao.h" #include diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp index 391dca66f0..e24b71b8cb 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.cpp @@ -4,9 +4,9 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" +#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "source_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_lcao/module_tddft/snap_psibeta_half_tddft.h" #include "source_pw/hamilt_pwdft/global.h" #ifdef _OPENMP #include diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h index d89e7b38e5..72c1f76dee 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_nonlocal_lcao.h @@ -4,9 +4,9 @@ #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" #include "source_estate/module_pot/H_TDDFT_pw.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "source_lcao/module_hcontainer/hcontainer.h" +#include "source_lcao/module_tddft/td_info.h" #include diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp index 54b5471c5d..d45f68d53d 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.cpp @@ -3,8 +3,8 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h" +#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_pw/hamilt_pwdft/global.h" // Constructor diff --git a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h index 4d7b577e32..349b847137 100644 --- a/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h +++ b/source/source_lcao/hamilt_lcaodft/operator_lcao/td_pot_hybrid.h @@ -5,11 +5,11 @@ #include "source_cell/klist.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" -#include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "source_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" +#include "source_lcao/module_hcontainer/hcontainer.h" #include -#include "module_io/cal_r_overlap_R.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_io/cal_r_overlap_R.h" +#include "source_lcao/module_tddft/td_info.h" #include "source_estate/module_pot/H_TDDFT_pw.h" namespace hamilt diff --git a/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp b/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp index 786d7809f5..22237a7041 100644 --- a/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp +++ b/source/source_lcao/hamilt_lcaodft/spar_hsr.cpp @@ -1,7 +1,7 @@ #include "spar_hsr.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/module_hcontainer/hcontainer.h" +#include "source_lcao/module_tddft/td_info.h" #include "module_parameter/parameter.h" #include "spar_dh.h" #include "spar_exx.h" diff --git a/source/source_lcao/module_tddft/evolve_elec.cpp b/source/source_lcao/module_tddft/evolve_elec.cpp index f9c31081f3..3a1cfd25db 100644 --- a/source/source_lcao/module_tddft/evolve_elec.cpp +++ b/source/source_lcao/module_tddft/evolve_elec.cpp @@ -4,8 +4,8 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_estate/module_charge/symmetry_rho.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" -#include "module_hamilt_lcao/module_dftu/dftu.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_lcao/module_dftu/dftu.h" #include "source_pw/hamilt_pwdft/global.h" namespace module_tddft diff --git a/source/source_lcao/module_tddft/evolve_elec.h b/source/source_lcao/module_tddft/evolve_elec.h index 44972bae3f..30e55b859c 100644 --- a/source/source_lcao/module_tddft/evolve_elec.h +++ b/source/source_lcao/module_tddft/evolve_elec.h @@ -10,7 +10,7 @@ #include "source_base/scalapack_connector.h" // Cpxgemr2d #include "source_esolver/esolver_ks_lcao.h" #include "source_esolver/esolver_ks_lcao_tddft.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_psi/psi.h" //----------------------------------------------------------- diff --git a/source/source_lcao/module_tddft/evolve_psi.cpp b/source/source_lcao/module_tddft/evolve_psi.cpp index 29c9e88125..8a4b0816e3 100644 --- a/source/source_lcao/module_tddft/evolve_psi.cpp +++ b/source/source_lcao/module_tddft/evolve_psi.cpp @@ -7,7 +7,7 @@ #include "source_base/module_container/ATen/kernels/lapack.h" // cuSOLVER handle #include "source_base/scalapack_connector.h" #include "source_esolver/esolver_ks_lcao_tddft.h" // use gatherMatrix -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "source_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #include "norm_psi.h" diff --git a/source/source_lcao/module_tddft/evolve_psi.h b/source/source_lcao/module_tddft/evolve_psi.h index e1b64f7c9b..ed00d32591 100644 --- a/source/source_lcao/module_tddft/evolve_psi.h +++ b/source/source_lcao/module_tddft/evolve_psi.h @@ -9,7 +9,7 @@ #include "source_base/module_container/ATen/core/tensor.h" // ct::Tensor #include "source_base/module_container/ATen/core/tensor_map.h" // TensorMap #include "source_basis/module_ao/parallel_orbitals.h" -#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" +#include "source_lcao/hamilt_lcaodft/hamilt_lcao.h" namespace module_tddft { diff --git a/source/source_lcao/module_tddft/td_folding.cpp b/source/source_lcao/module_tddft/td_folding.cpp index d7eefd240e..a190ade46b 100644 --- a/source/source_lcao/module_tddft/td_folding.cpp +++ b/source/source_lcao/module_tddft/td_folding.cpp @@ -1,6 +1,6 @@ #include "td_info.h" #include "source_base/libm/libm.h" -#include "module_hamilt_lcao/module_tddft/td_info.h" +#include "source_lcao/module_tddft/td_info.h" template void TD_info::folding_HR_td(const hamilt::HContainer& hR, std::complex* hk, diff --git a/source/source_lcao/module_tddft/td_info.h b/source/source_lcao/module_tddft/td_info.h index 79026c3b64..60e4273266 100644 --- a/source/source_lcao/module_tddft/td_info.h +++ b/source/source_lcao/module_tddft/td_info.h @@ -2,7 +2,7 @@ #define TD_INFO_H #include "source_base/abfs-vector3_order.h" #include "source_base/timer.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "source_lcao/module_hcontainer/hcontainer.h" #include // Class to store TDDFT infos, mainly for periodic system. diff --git a/source/source_lcao/module_tddft/velocity_op.cpp b/source/source_lcao/module_tddft/velocity_op.cpp index 7534b705ba..dcdc80d059 100644 --- a/source/source_lcao/module_tddft/velocity_op.cpp +++ b/source/source_lcao/module_tddft/velocity_op.cpp @@ -1,7 +1,7 @@ #include "velocity_op.h" #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "module_hamilt_lcao/module_tddft/snap_psibeta_half_tddft.h" +#include "source_lcao/module_tddft/snap_psibeta_half_tddft.h" #ifdef _OPENMP #include #include diff --git a/source/source_lcao/module_tddft/velocity_op.h b/source/source_lcao/module_tddft/velocity_op.h index cebf99c214..7c3986a431 100644 --- a/source/source_lcao/module_tddft/velocity_op.h +++ b/source/source_lcao/module_tddft/velocity_op.h @@ -4,10 +4,10 @@ #include "source_basis/module_ao/parallel_orbitals.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" -#include "module_hamilt_lcao/module_hcontainer/hcontainer.h" +#include "source_lcao/module_hcontainer/hcontainer.h" #include "source_basis/module_nao/two_center_integrator.h" #include "source_base/vector3.h" -#include "module_io/cal_r_overlap_R.h" +#include "source_io/cal_r_overlap_R.h" //design to calculate velocity operator template