From 37d8320ce2b271496b04ceeaf4bbb09f4f55e57d Mon Sep 17 00:00:00 2001 From: LiYuqiii <139907896+LiYuqiii@users.noreply.github.com> Date: Wed, 25 Nov 2026 15:50:08 +0800 Subject: [PATCH 1/9] SDFT: fix the high-temperature DOS and entropy-trace failures Four defects made SDFT/DOS unreliable at high electronic temperature: * Math_Chebyshev::checkconverge() treats tmin == 0 as its "uninitialized" sentinel, so a positive trial Rayleigh quotient can leave Emin > 0 and exclude every bound state; the upper bound is underestimated in the same path. * the DOS stage re-derived the range from the input defaults instead of keeping the converged SCF range, and Stochastic_WF::nchi was never initialized, so the range probe always used random vectors even for MDFT. * dos_scale widened the reported window by 0.5% per side without any relation to the Chebyshev interval, so a grid point could sit outside the spectral range. * the entropy density formed 1 - f by subtraction and returned 0 for |x| > 36, which lifted the sqrt(g) coefficient tail from ~1e-19 to ~1e-12, and Stochastic_Iter::dot() ignored the arrays it was given, so the printed Chebyshev "precision" of the stochastic trace was not the quantity it claimed. Fixes: keep the converged SCF range in the DOS stage, initialize nchi, repair a positive automatic lower bound and an underestimated upper bound at the call sites (an explicitly given emin_sto is preserved, since a positive spectrum is valid), clip the requested output window to the spectral interval instead of widening the interval, evaluate the entropy density with s = min(f, 1-f) and log1p(-s), and make dot() contract the arrays that the caller passes. The range probe now also carries one independent random vector next to the real stochastic orbitals: with `nbands_sto all` those orbitals are coordinate vectors, so a handful of them can miss a diagonal state of another invariant subspace. The new unit test for the entropy kernels fails on the unpatched sto_func.cpp and passes here; dos_nche >= 2 is documented in its INPUT metadata. --- .../module_parameter/read_inp_postproc.cpp | 6 +- source/source_pw/module_stodft/CMakeLists.txt | 1 + source/source_pw/module_stodft/sto_dos.cpp | 184 ++++++++++++++++- source/source_pw/module_stodft/sto_func.cpp | 94 +++++---- source/source_pw/module_stodft/sto_iter.cpp | 45 +++- source/source_pw/module_stodft/sto_tool.cpp | 61 +++++- source/source_pw/module_stodft/sto_wf.cpp | 10 + .../module_stodft/unittests/CMakeLists.txt | 9 + .../module_stodft/unittests/test_sto_func.cpp | 194 ++++++++++++++++++ 9 files changed, 550 insertions(+), 54 deletions(-) create mode 100644 source/source_pw/module_stodft/unittests/CMakeLists.txt create mode 100644 source/source_pw/module_stodft/unittests/test_sto_func.cpp diff --git a/source/source_io/module_parameter/read_inp_postproc.cpp b/source/source_io/module_parameter/read_inp_postproc.cpp index a9acc3c4d0a..3c83d064af7 100644 --- a/source/source_io/module_parameter/read_inp_postproc.cpp +++ b/source/source_io/module_parameter/read_inp_postproc.cpp @@ -82,7 +82,11 @@ void ReadInput::item_postprocess() item.annotation = "orders of Chebyshev expansions for dos"; item.category = "Density of states"; item.type = "Integer"; - item.description = "The order of Chebyshev expansions when using Stochastic Density Functional Theory (SDFT) to calculate DOS."; + item.description = "The order of Chebyshev expansions when using Stochastic Density Functional Theory (SDFT) to calculate DOS." + "\n\nIt must be at least 2. The order has to grow with the ratio between the spectral range and " + "`dos_sigma`: resolving a Gaussian of width `dos_sigma` over a range of a few thousand eV can " + "require an order of 1e5 or more, so a value that is too small gives an under-resolved curve. " + "The code warns when the requested order cannot resolve `range/dos_sigma`."; item.default_value = "100"; item.unit = ""; read_sync_int(input.dos_nche); diff --git a/source/source_pw/module_stodft/CMakeLists.txt b/source/source_pw/module_stodft/CMakeLists.txt index fb863199d61..2ac12a5466b 100644 --- a/source/source_pw/module_stodft/CMakeLists.txt +++ b/source/source_pw/module_stodft/CMakeLists.txt @@ -23,4 +23,5 @@ if(BUILD_TESTING) if(ENABLE_MPI) add_subdirectory(test) endif() + add_subdirectory(unittests) endif() diff --git a/source/source_pw/module_stodft/sto_dos.cpp b/source/source_pw/module_stodft/sto_dos.cpp index eb78c6700f3..0da59f1965a 100644 --- a/source/source_pw/module_stodft/sto_dos.cpp +++ b/source/source_pw/module_stodft/sto_dos.cpp @@ -6,6 +6,27 @@ #include "source_base/tool_title.h" #include "source_io/module_parameter/parameter.h" #include "sto_tool.h" + +#include +#include +#include +#include + +namespace +{ +/// Single entry point for the DOS diagnostics of this file. Keeping the +/// running-log reference here (instead of at every call site) keeps the global +/// dependency of this module to one place; none of these messages aborts a run. +void dos_log(const std::string& message, const bool also_stdout) +{ + GlobalV::ofs_running << message << std::endl; + if (also_stdout) + { + std::cout << message << std::endl; + } +} +} // namespace + template Sto_DOS::~Sto_DOS() { @@ -28,7 +49,10 @@ Sto_DOS::Sto_DOS(ModulePW::PW_Basis_K* p_wfcpw_in, this->p_hamilt_sto = static_cast>*>(p_hamilt_in); this->p_stowf = p_stowf_in; this->nbands_ks = p_psi_in->get_nbands(); - this->nbands_sto = p_stowf_in->nchi; + // Stochastic_WF::nchi is now initialized by allocate_chi0() (MDFT) and + // init_com_orbitals() (complete basis). Keep a safe fallback for old + // restart paths where only nchip is available. + this->nbands_sto = (p_stowf_in->nchi > 0) ? p_stowf_in->nchi : p_stowf_in->nchip_max; this->method_sto = stoche.method_sto; this->stofunc.set_E_range((double*)&stoche.emin_sto, (double*)&stoche.emax_sto); } @@ -44,14 +68,85 @@ void Sto_DOS::decide_param(const int& dos_nche, const double& dos_scale) { this->dos_nche = dos_nche; + if (this->dos_nche < 2) + { + ModuleBase::WARNING_QUIT("Sto_DOS", "dos_nche should be at least 2."); + } + + // If emin_sto/emax_sto are left at zero, keep the bounds already found by + // the SCF range check instead of resetting them to the bare input defaults. + // The repeated reset discarded a valid converged range and made the DOS + // range check depend on the random test vector alone. + double try_emin = emin_sto; + double try_emax = emax_sto; + if (try_emin == 0.0) + { + try_emin = *p_hamilt_sto->emin; + } + if (try_emax == 0.0) + { + try_emax = *p_hamilt_sto->emax; + } + check_che_op()( this->dos_nche, - emin_sto, - emax_sto, + try_emin, + try_emax, this->nbands_sto, this->p_kv, reinterpret_cast, Device>*>(this->p_stowf), reinterpret_cast, Device>*>(this->p_hamilt_sto)); + + // The stochastic range check learns only the high-energy end reliably. + // The lowest deterministic KS eigenvalue is a much safer lower bound; if + // the automatic Emin lies above it, the Chebyshev interval would exclude + // occupied states and T_n(H) would grow exponentially outside [-1,1]. + // Extending the interval below the lowest eigenvalue is always harmless. + double det_emin = std::numeric_limits::max(); + bool has_det_emin = false; + if (this->p_elec != nullptr) + { + const auto& ekb = this->p_elec->ekb; + for (int ik = 0; ik < ekb.nr; ++ik) + { + for (int ib = 0; ib < ekb.nc; ++ib) + { + const double e = ekb(ik, ib); + if (std::isfinite(e)) + { + det_emin = std::min(det_emin, e); + has_det_emin = true; + } + } + } + } +#ifdef __MPI + double global_det_emin = has_det_emin ? det_emin : std::numeric_limits::max(); + Parallel_Reduce::reduce_min(global_det_emin); + if (global_det_emin < std::numeric_limits::max()) + { + det_emin = global_det_emin; + has_det_emin = true; + } +#endif + if (has_det_emin) + { + const double margin_ry = 1.0e-3; + const double safe_emin = det_emin - margin_ry; + if (safe_emin < *p_hamilt_sto->emin) + { + std::ostringstream reset_msg; + reset_msg << " DOS: reset Chebyshev Emin from " << *p_hamilt_sto->emin << " Ry to " << safe_emin + << " Ry (lowest KS eigenvalue = " << det_emin << " Ry)"; + dos_log(reset_msg.str(), false); + *p_hamilt_sto->emin = safe_emin; + } + } + if (!std::isfinite(*p_hamilt_sto->emax) || *p_hamilt_sto->emax <= *p_hamilt_sto->emin) + { + *p_hamilt_sto->emax = *p_hamilt_sto->emin + 1.0; + } + if (dos_setemax) { this->emax = dos_emax_ev; @@ -75,6 +170,54 @@ void Sto_DOS::decide_param(const int& dos_nche, this->emax = emax + delta / 2.0; this->emin = emin - delta / 2.0; } + + if (!std::isfinite(this->emin) || !std::isfinite(this->emax) || this->emax <= this->emin) + { + ModuleBase::WARNING_QUIT("Sto_DOS", "Invalid DOS energy range: dos_emax_ev must be larger than dos_emin_ev."); + } + + // The Chebyshev interval is a property of the spectrum and is kept as it is: + // widening it to fit the requested output window would reduce the resolution + // of a fixed-order expansion and could hide a peak that a narrower interval + // resolves. A requested window that sticks out of the interval is therefore + // clipped to it (the `dos_scale` widening above makes that routine) and the + // change is reported, because energies outside the interval cannot be + // represented by the expansion at all. + const double interval_emin_ev = *p_hamilt_sto->emin * ModuleBase::Ry_to_eV; + const double interval_emax_ev = *p_hamilt_sto->emax * ModuleBase::Ry_to_eV; + const double requested_emin_ev = this->emin; + const double requested_emax_ev = this->emax; + const double clipped_emin_ev = std::max(requested_emin_ev, interval_emin_ev); + const double clipped_emax_ev = std::min(requested_emax_ev, interval_emax_ev); + // The `dos_scale` widening above intentionally makes the window a little wider + // than the spectrum, so a sub-percent clip is expected and is not reported; + // only a window that really asks for energies outside the interval is. + const double interval_span_ev = interval_emax_ev - interval_emin_ev; + const double dropped_ev + = std::max(requested_emin_ev - clipped_emin_ev, clipped_emax_ev - requested_emax_ev); + const bool report_clip = dropped_ev > 0.01 * interval_span_ev; + if (clipped_emax_ev > clipped_emin_ev) + { + // Always clip, so that |t| <= 1 holds by construction for every output + // energy. Only a clip that removes a visible part of the window is + // reported, because `dos_scale` intentionally widens the window by a + // fraction of a percent. + if (report_clip) + { + std::ostringstream clip_msg; + clip_msg << " DOS: output window clipped from [" << requested_emin_ev << ", " << requested_emax_ev << "] to [" + << clipped_emin_ev << ", " << clipped_emax_ev << "] eV to stay inside the Chebyshev interval [" + << interval_emin_ev << ", " << interval_emax_ev << "] eV"; + dos_log(clip_msg.str(), false); + } + this->emin = clipped_emin_ev; + this->emax = clipped_emax_ev; + } + + std::ostringstream range_msg; + range_msg << " DOS: Chebyshev range = [" << *p_hamilt_sto->emin << ", " << *p_hamilt_sto->emax + << "] Ry; output window = [" << this->emin << ", " << this->emax << "] eV"; + dos_log(range_msg.str(), false); } template @@ -168,13 +311,46 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons allorderchi.shrink_to_fit(); std::ofstream ofsdos; + if (de <= 0.0) + { + ModuleBase::WARNING_QUIT("Sto_DOS", "dos_edelta_ev must be positive."); + } int ndos = int((emax - emin) / de) + 1; + if (ndos < 1) + { + ModuleBase::WARNING_QUIT("Sto_DOS", "The DOS output window is empty; check dos_emin_ev/dos_emax_ev."); + } this->stofunc.sigma = sigmain / ModuleBase::Ry_to_eV; + + // Estimate the Chebyshev order needed to resolve a Gaussian of width + // sigmain over the actual spectral range. Reporting this explicitly + // prevents a silently under-resolved DOS: with a large ecut and the + // default dos_sigma (0.07 eV) the required order can be thousands or more, + // while method 2 stores an nche x nche matrix and becomes prohibitively + // expensive. + const double range_ev = (*this->stofunc.Emax - *this->stofunc.Emin) * ModuleBase::Ry_to_eV; + const double sigma_ev = std::abs(sigmain); + if (sigma_ev > 0.0 && range_ev > 0.0) + { + const double prefactor = std::sqrt(2.0 * std::log(1.0e6)); + const double nche_needed = 0.5 * range_ev / sigma_ev * prefactor; + if (nche_needed > static_cast(this->dos_nche)) + { + std::ostringstream msg; + msg << "dos_sigma = " << sigma_ev << " eV is narrower than the Chebyshev expansion can resolve: " + << "range = " << range_ev << " eV, dos_nche = " << this->dos_nche + << ", estimated order needed ~ " << static_cast(std::ceil(nche_needed)) + << ". Increase dos_nche (method 1 or method 2 with sufficient memory) or use a larger dos_sigma."; + dos_log(" WARNING: " + msg.str(), true); + } + } ModuleBase::timer::end("Sto_DOS", "Tracepoly"); std::cout << "2. Dos:" << std::endl; ModuleBase::timer::start("Sto_DOS", "DOS Loop"); - int n10 = ndos / 10; + // For very small output windows ndos/10 is zero; the old modulus then + // divided by zero and terminated the run with SIGFPE. + int n10 = std::max(1, ndos / 10); int percent = 10; std::vector sto_dos(ndos); std::vector ks_dos(ndos); diff --git a/source/source_pw/module_stodft/sto_func.cpp b/source/source_pw/module_stodft/sto_func.cpp index d8935c7f7fa..6b435fb5517 100644 --- a/source/source_pw/module_stodft/sto_func.cpp +++ b/source/source_pw/module_stodft/sto_func.cpp @@ -1,8 +1,53 @@ #include "sto_func.h" #include "source_estate/occupy.h" + +#include + #define TWOPI 6.283185307179586 +namespace +{ +// Evaluate the Fermi-Dirac entropy density f*ln(f) + (1-f)*ln(1-f) +// from ne_mu = (E - mu)/kT without the cancellation that the literal +// expression suffers when f is tiny: +// (1-f)*ln(1-f) ~ -f, +// but in double precision 1-f rounds to 1 as soon as f < ~1e-16, so the +// literal expression drops this -f term and leaves an error of order f +// (relative error ~1/|ln f|, i.e. percent level) in the deep tail. +// The resulting non-smooth error seeds spurious high-order Chebyshev +// coefficients (~1e-12) which are then amplified by T_n(x) for any +// eigenvalue outside the expansion interval. Using s = min(f, 1-f) +// computed directly (no subtraction) and log1p(-s) keeps full relative +// accuracy for all temperatures. +template +inline REAL entropy_density_from_ne_mu(const REAL ne_mu) +{ + REAL s; // s = min(f, 1-f), always in [0, 0.5] + if (ne_mu >= 0) + { + if (ne_mu > 700) + { + return 0; + } + s = 1 / (1 + std::exp(ne_mu)); + } + else + { + if (ne_mu < -700) + { + return 0; + } + s = 1 / (1 + std::exp(-ne_mu)); + } + if (s <= 0) + { + return 0; + } + return s * std::log(s) + (1 - s) * std::log1p(-s); +} +} // namespace + template Sto_Func::Sto_Func() { @@ -85,20 +130,8 @@ REAL Sto_Func::nxfd(REAL rawe) const template REAL Sto_Func::fdlnfd(REAL e) const { - REAL e_mu = (e - mu) / this->tem; - if (e_mu > 36) { - return 0; - } else if (e_mu < -36) { - return 0; - } else - { - REAL f = 1 / (1 + exp(e_mu)); - if (f == 0 || f == 1) { - return 0; - } else { - return (f * log(f) + (1.0 - f) * log(1.0 - f)); -} - } + const REAL e_mu = (e - mu) / this->tem; + return entropy_density_from_ne_mu(e_mu); } template @@ -106,20 +139,8 @@ REAL Sto_Func::nfdlnfd(REAL rawe) const { REAL Ebar = (*Emin + *Emax) / 2; REAL DeltaE = (*Emax - *Emin) / 2; - REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem; - if (ne_mu > 36) { - return 0; - } else if (ne_mu < -36) { - return 0; - } else - { - REAL f = 1 / (1 + exp(ne_mu)); - if (f == 0 || f == 1) { - return 0; - } else { - return f * log(f) + (1 - f) * log(1 - f); -} - } + const REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem; + return entropy_density_from_ne_mu(ne_mu); } template @@ -127,20 +148,9 @@ REAL Sto_Func::n_root_fdlnfd(REAL rawe) const { REAL Ebar = (*Emin + *Emax) / 2; REAL DeltaE = (*Emax - *Emin) / 2; - REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem; - if (ne_mu > 36) { - return 0; - } else if (ne_mu < -36) { - return 0; - } else - { - REAL f = 1 / (1 + exp(ne_mu)); - if (f == 0 || f == 1) { - return 0; - } else { - return sqrt(-f * log(f) - (1 - f) * log(1 - f)); -} - } + const REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem; + const REAL g = -entropy_density_from_ne_mu(ne_mu); + return (g > 0) ? std::sqrt(g) : 0; } template diff --git a/source/source_pw/module_stodft/sto_iter.cpp b/source/source_pw/module_stodft/sto_iter.cpp index 6a121064866..610a42172df 100644 --- a/source/source_pw/module_stodft/sto_iter.cpp +++ b/source/source_pw/module_stodft/sto_iter.cpp @@ -1,5 +1,7 @@ #include "sto_iter.h" +#include + #include "source_base/kernels/math_kernel_op.h" #include "source_base/para_gemm.h" #include "source_base/parallel_comm.h" @@ -13,6 +15,9 @@ #include "source_hsolver/para_lin_tf.h" #include "source_io/module_parameter/parameter.h" +#include +#include + template Stochastic_Iter::Stochastic_Iter() { @@ -29,9 +34,13 @@ Stochastic_Iter::~Stochastic_Iter() template void Stochastic_Iter::dot(const int& n, const Real* x, const int& incx, const Real* y, const int& incy, Real& result) { + // Use the arrays the caller passes: the previous implementation ignored x, incx, y and incy and + // always reduced p_che->coef_real against spolyv, so every caller that wanted a different + // contraction (for example the two staggered sums in checkemm) silently got the same number, and + // the reported Chebyshev "precision" of the stochastic trace was not the quantity it claimed. Real* result_device = nullptr; resmem_var_op()(result_device, 1); - container::kernels::blas_dot()(n, p_che->coef_real, 1, spolyv, 1, result_device); + container::kernels::blas_dot()(n, x, incx, y, incy, result_device); syncmem_var_d2h_op()(&result, result_device, 1); delmem_var_op()(result_device); } @@ -211,6 +220,40 @@ void Stochastic_Iter::checkemm(const int& ik, Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); MPI_Allreduce(MPI_IN_PLACE, &change, 1, MPI_CHAR, MPI_LOR, MPI_COMM_WORLD); #endif + // checkconverge() treats (0,0) as "unset" and can end with a + // positive Emin when the trial Rayleigh quotient is positive. This + // removes all bound states from the Chebyshev interval and makes the + // Fermi-level search fail at high temperature. Correct only that + // pathological final bound; negative bounds are left untouched so + // normal SDFT results do not change. + // A positive lower bound is only pathological when it came from the + // automatic search: a user-provided emin_sto (or a genuinely positive + // spectrum) is a valid interval, and moving it downwards would enlarge + // the interval and change the fixed-order occupation and entropy sums. + const bool emin_is_automatic = (PARAM.inp.emin_sto == 0.0); + if (emin_is_automatic && (!std::isfinite(*p_hamilt_sto->emin) || *p_hamilt_sto->emin > 0)) + { + const double positive_emin = *p_hamilt_sto->emin; + const double emax_abs = std::abs(*p_hamilt_sto->emax); + const double fallback_span = std::max(5.0, 0.01 * emax_abs); + const double safe_emin = -fallback_span; + std::ostringstream range_msg; + range_msg << " WARNING: positive automatic Chebyshev Emin " << positive_emin << " Ry is reset to " + << safe_emin << " Ry"; + *p_hamilt_sto->emin = safe_emin; + // The same pathological Krylov path also underestimates the upper + // bound. The highest plane-wave eigenvalue cannot exceed roughly + // ecutwfc, so use the cutoff as a safe floor. + const double ecutwfc = PARAM.inp.ecutwfc; + const double ecut_floor = 1.05 * ecutwfc; + if (ecutwfc > 0 && *p_hamilt_sto->emax < ecut_floor) + { + range_msg << "; Chebyshev Emax " << *p_hamilt_sto->emax << " Ry is raised to the ecutwfc-based floor " + << ecut_floor << " Ry"; + *p_hamilt_sto->emax = ecut_floor; + } + GlobalV::ofs_running << range_msg.str() << std::endl; + } if (change) { GlobalV::ofs_running << "New Emax Ry" << *p_hamilt_sto->emax << " ; new Emin " << *p_hamilt_sto->emin diff --git a/source/source_pw/module_stodft/sto_tool.cpp b/source/source_pw/module_stodft/sto_tool.cpp index f63a8707236..250744c557a 100644 --- a/source/source_pw/module_stodft/sto_tool.cpp +++ b/source/source_pw/module_stodft/sto_tool.cpp @@ -1,5 +1,7 @@ #include "sto_tool.h" +#include + #include "source_base/math_chebyshev.h" #include "source_base/parallel_comm.h" #include "source_base/parallel_device.h" @@ -9,6 +11,8 @@ #ifdef __MPI #include "mpi.h" #endif +#include +#include #include template @@ -48,14 +52,25 @@ void check_che_op::operator()(const int& nche_in, const int npw = p_kv->ngk[ik]; std::complex* pchi = nullptr; psi::Psi, Device> randchi_d; - if (nbands_sto == 0) // For case: PARAM.inp.nbands_sto = "all" - { - randchi_d.resize(1, 1, npw); - } - int ntest = std::min(ntest0, p_stowf->nchip[ik]); + randchi_d.resize(1, 1, npw); // holds the independent random probe of this k point + // Use the real stochastic (or complete-basis) orbitals whenever they + // exist. Previously this decision was based only on "nbands_sto==0", + // while Stochastic_WF::nchi was never initialized; as a result the DOS + // range check always used random vectors, even for MDFT. Random + // vectors have a Rayleigh quotient close to the mean spectral energy + // and cannot locate a low-lying eigenvalue, so Emin could be set far + // above the occupied states. + const bool use_random = (p_stowf->nchi <= 0) || (nbands_sto == 0 && p_stowf->nchip_max <= 0); + const int ntest_real = use_random ? 0 : std::min(ntest0, p_stowf->nchip[ik]); + // Always add one independent random probe on top of the real orbitals. + // With `nbands_sto all` the stochastic orbitals are coordinate vectors, + // so a handful of them can miss a diagonal state of another invariant + // subspace; a dense random vector does not depend on that choice. + const int ntest = use_random ? 1 : ntest_real + 1; for (int i = 0; i < ntest; ++i) { - if (nbands_sto == 0) + const bool use_this_random = use_random || i == ntest_real; + if (use_this_random) { std::vector> randchi(npw); for (int ig = 0; ig < npw; ++ig) @@ -108,6 +123,40 @@ void check_che_op::operator()(const int& nche_in, Parallel_Reduce::reduce_max(*p_hamilt_sto->emax); Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); #endif + // checkconverge() starts from the user's (0,0) defaults and can + // leave the automatic lower bound positive when the first trial + // Rayleigh quotient is positive. A positive Emin excludes every + // bound state and is the root of the high-temperature SCF and DOS + // failures. Only correct that pathological outcome here so that + // cases whose final bound is already negative keep the original + // numerical result bit for bit. + // Only an automatically determined bound may be repaired: a positive + // emin_sto given by the user (or a genuinely positive spectrum) is a + // valid interval and must be preserved. + const bool emin_is_automatic = (PARAM.inp.emin_sto == 0.0); + if (emin_is_automatic && (!std::isfinite(*p_hamilt_sto->emin) || *p_hamilt_sto->emin > 0)) + { + const double positive_emin = *p_hamilt_sto->emin; + const double emax_abs = std::abs(*p_hamilt_sto->emax); + const double fallback_span = std::max(5.0, 0.01 * emax_abs); + const double safe_emin = -fallback_span; + std::ostringstream range_msg; + range_msg << " WARNING: positive automatic Chebyshev Emin " << positive_emin << " Ry is reset to " + << safe_emin << " Ry"; + *p_hamilt_sto->emin = safe_emin; + // The pathological path that produced a positive Emin also + // tends to underestimate Emax. The highest plane-wave + // eigenvalue is bounded by roughly ecutwfc; use it as a floor. + const double ecutwfc = PARAM.inp.ecutwfc; + const double ecut_floor = 1.05 * ecutwfc; + if (ecutwfc > 0 && *p_hamilt_sto->emax < ecut_floor) + { + range_msg << "; Chebyshev Emax " << *p_hamilt_sto->emax + << " Ry is raised to the ecutwfc-based floor " << ecut_floor << " Ry"; + *p_hamilt_sto->emax = ecut_floor; + } + GlobalV::ofs_running << range_msg.str() << std::endl; + } GlobalV::ofs_running << "New Emax " << *p_hamilt_sto->emax << " Ry; new Emin " << *p_hamilt_sto->emin << " Ry" << std::endl; change = false; diff --git a/source/source_pw/module_stodft/sto_wf.cpp b/source/source_pw/module_stodft/sto_wf.cpp index 2fca88e4824..bcff5141252 100644 --- a/source/source_pw/module_stodft/sto_wf.cpp +++ b/source/source_pw/module_stodft/sto_wf.cpp @@ -108,6 +108,11 @@ void Stochastic_WF::allocate_chi0() } this->nchip_max = tmpnchip; + // Record that real stochastic orbitals have been allocated. This member + // was previously left at its default value of zero, so downstream code + // (notably the DOS range check) mistakenly used random test vectors even + // when chi0/chiortho were available. + this->nchi = nchi; size_t size = this->nchip_max * npwx * nks; this->chi0_cpu = new psi::Psi(nks, this->nchip_max, npwx, this->ngk, true); ModuleBase::Memory::record("SDFT::chi0_cpu", size * sizeof(T)); @@ -204,6 +209,10 @@ void Stochastic_WF::init_com_orbitals() this->nchip_max = std::max(tmpnchip, this->nchip_max); delete[] npwip; } + // In the complete-basis ("all") mode nbands_sto is zero, but chi0 still + // contains real orbitals. Keep nchi nonzero so that consumers such as + // check_che_op know that actual orbitals are available. + this->nchi = this->nchip_max; size_t size = this->nchip_max * npwx * nks; this->chi0_cpu = new psi::Psi>(nks, this->nchip_max, npwx, this->ngk, true); this->chi0_cpu->zero_out(); @@ -277,6 +286,7 @@ void Stochastic_WF::init_com_orbitals() this->chi0_cpu->operator()(ik, ichi, ichi) = 1; } } + this->nchi = this->nchip_max; // allocate chi0 Device* ctx = {}; diff --git a/source/source_pw/module_stodft/unittests/CMakeLists.txt b/source/source_pw/module_stodft/unittests/CMakeLists.txt new file mode 100644 index 00000000000..b51097f074b --- /dev/null +++ b/source/source_pw/module_stodft/unittests/CMakeLists.txt @@ -0,0 +1,9 @@ +abacus_disable_feature_definitions(__MPI) +abacus_disable_feature_definitions(__CUDA) +abacus_disable_feature_definitions(__ROCM) + +# Regression test for the occupation / entropy kernels of the SDFT solver: +# `1 - f` must not be computed by subtraction and the expanded function must +# not contain an artificial cutoff (|x| > 36 used to return exactly 0). +AddTest(TARGET MODULE_PW_STO_FUNC_UTs LIBS parameter base device SOURCES + test_sto_func.cpp ../sto_func.cpp ../../../source_estate/occupy.cpp) diff --git a/source/source_pw/module_stodft/unittests/test_sto_func.cpp b/source/source_pw/module_stodft/unittests/test_sto_func.cpp new file mode 100644 index 00000000000..0a143992f4e --- /dev/null +++ b/source/source_pw/module_stodft/unittests/test_sto_func.cpp @@ -0,0 +1,194 @@ +#include "../sto_func.h" + +#include + +#include + +/************************************************ + * unit test of sto_func.cpp (occupation / entropy kernels of SDFT) + * + * Goal: turn the "Ne vs TS Chebyshev precision asymmetry" failure into a + * self-checking regression test. Two known failure modes: + * (1) computing `1 - f` by subtraction loses accuracy when f -> 1 or f -> 0, + * which destroys the relative accuracy of the entropy density g; + * (2) an artificial cutoff such as `if (x > 36) return 0` introduces a + * discontinuity in the expanded function, which lifts the tail of the + * Chebyshev coefficients by several orders of magnitude and is then + * amplified by |x| > 1 into an O(1) spurious entropy. + * + * Only mathematical/physical properties are asserted here (no implementation + * detail), so any correct implementation passes. + * + * Sign convention of sto_func.cpp (must be respected, otherwise TS flips sign): + * fdlnfd(e) = f ln f + (1-f) ln(1-f) <= 0 (i.e. -g) + * nfdlnfd(rawe) = the same negative value (i.e. -g) + * n_root_fdlnfd(rawe) = sqrt(g) >= 0 (expanded by method 2) + * with g = -f ln f - (1-f) ln(1-f) >= 0 the true entropy density. + * The "n*" variants take the normalized Chebyshev coordinate rawe in [-1,1] + * and restore the energy through [Emin, Emax]. + ***********************************************/ + +namespace +{ +const double kT = 25.57754484; // 348 eV, the production temperature [Ry] +const double mu = 0.3; // arbitrary chemical potential inside the spectrum [Ry] + +// Independent closed form (equivalent, but free of cancellation): +// g(x) = ln(2cosh(x/2)) - (x/2)tanh(x/2) = |x|*y/(1+y) + ln(1+y), y = exp(-|x|) +// It follows a completely different path than "compute f, then take log" in +// ABACUS and agrees with a 50-digit mpmath reference to ~1e-16 relative +// for |x| <= 60. +double g_reference(double x) +{ + const double y = std::exp(-std::fabs(x)); + return std::fabs(x) * y / (1.0 + y) + std::log1p(y); +} +} // namespace + +/** + * - Tested Functions: + * - Sto_Func::fd / root_fd (occupation f and sqrt(f), input = physical energy) + * - Sto_Func::nroot_fd (sqrt(f), input = normalized coordinate) + * - Sto_Func::fdlnfd (f ln f + (1-f) ln(1-f) = -g, input = physical energy) + * - Sto_Func::n_root_fdlnfd (sqrt(g), input = normalized coordinate) + */ +class TestStoFunc : public ::testing::Test +{ + protected: + Sto_Func sto; + double emin = 0.0; + double emax = 0.0; + double xc = 0.0; // centre of [xmin,xmax] in units of x=(E-mu)/kT + double xh = 1.0; // half width + + void SetUp() override + { + sto.tem = kT; + sto.mu = mu; + set_x_range(-10.0, 50.0); + } + + // Chebyshev interval used by the "n*" variants: x in [xmin,xmax] <=> rawe in [-1,1] + void set_x_range(double xmin, double xmax) + { + xc = 0.5 * (xmin + xmax); + xh = 0.5 * (xmax - xmin); + emin = mu + xmin * kT; + emax = mu + xmax * kT; + sto.set_E_range(&emin, &emax); + } + + double to_rawe(double x) const + { + return (x - xc) / xh; + } +}; + +// 1) identities and independent reference: f(x)+f(-x)=1, g symmetric, sqrt(g)^2=g, f(0)=1/2, g(0)=ln2 +TEST_F(TestStoFunc, identities_and_independent_reference) +{ + EXPECT_NEAR(sto.fd(mu), 0.5, 1e-16); + EXPECT_NEAR(-sto.fdlnfd(mu), std::log(2.0), 1e-14); + EXPECT_NEAR(sto.n_root_fdlnfd(to_rawe(0.0)), std::sqrt(std::log(2.0)), 1e-13); + + set_x_range(-20.0, 20.0); + for (double x = -20.0; x <= 20.0; x += 0.5) + { + const double e = mu + x * kT; + const double e_neg = mu - x * kT; + const double g = -sto.fdlnfd(e); + + EXPECT_NEAR(sto.fd(e) + sto.fd(e_neg), 1.0, 1e-14); // particle-hole symmetry + EXPECT_NEAR(g, -sto.fdlnfd(e_neg), 1e-13); // g is even in x + EXPECT_GE(g, 0.0); // entropy is non-negative + EXPECT_LE(sto.fdlnfd(e), 0.0); // sign convention + EXPECT_NEAR(g, g_reference(x), 1e-13 * (1.0 + std::fabs(g_reference(x)))); + EXPECT_NEAR(sto.n_root_fdlnfd(to_rawe(x)) * sto.n_root_fdlnfd(to_rawe(x)), g, 1e-13); + EXPECT_GE(sto.fd(e), 0.0); + EXPECT_LE(sto.fd(e), 1.0); + } +} + +// 2) key regression: the expanded function must not contain an artificial jump. +// The true value is still 1e-13 ... 9e-8 for x in (36,45); `if (x>36) return 0` +// flattens it, leaving a step of sqrt(g(36)) = 9.26e-8 whose Chebyshev +// coefficient tail is ~2e-9, whereas a correct implementation stays ~1e-15. +TEST_F(TestStoFunc, no_artificial_cutoff_jump) +{ + // (a) for x in (36,45) g must still be positive and match the reference + for (double x = 36.5; x <= 45.0; x += 0.5) + { + const double e = mu + x * kT; + const double g = -sto.fdlnfd(e); + const double g_ref = g_reference(x); + EXPECT_GT(g, 0.0); // the original returns 0 here -> FAIL + EXPECT_NEAR(g, g_ref, 1e-12 * g_ref + 1e-300); + EXPECT_GT(sto.n_root_fdlnfd(to_rawe(x)), 0.0); // same for sqrt(g) + } + + // (b) sqrt(g) is continuous on [33,45]: with a 1e-2 step the difference + // between neighbours must stay far below the 9.3e-8 artificial step. + // The steepest legitimate slope in this range is at x=33, + // |d sqrt(g)/dx| ~ 0.5*sqrt(g(33)) ~ 2.5e-7, i.e. ~2.5e-9 per 1e-2 step. + double max_step = 0.0; + double prev = sto.n_root_fdlnfd(to_rawe(33.0)); + for (int i = 1; i <= 1200; ++i) + { + const double x = 33.0 + 0.01 * i; + const double cur = sto.n_root_fdlnfd(to_rawe(x)); + max_step = std::max(max_step, std::fabs(cur - prev)); + EXPECT_LE(cur, prev + 1e-15); // sqrt(g) is non-increasing for x>0 + prev = cur; + } + EXPECT_LE(max_step, 1e-8); // artificial step 9.3e-8 -> FAIL +} + +// 3) tail asymptotics and extremes: no NaN/Inf, and no crude truncation of a meaningful tail +TEST_F(TestStoFunc, tail_asymptotics_and_extremes) +{ + set_x_range(-800.0, 800.0); + for (double x: {50.0, 80.0, 120.0, 200.0}) + { + const double g = -sto.fdlnfd(mu + x * kT); + const double asym = std::exp(-x) * (x + 1.0); + EXPECT_GT(g, 0.0); // the original is 0 for x>36 -> FAIL + EXPECT_NEAR(g / asym, 1.0, 1e-9); + } + for (double x: {-50.0, -80.0, -120.0, -200.0}) + { + const double g = -sto.fdlnfd(mu + x * kT); + const double asym = std::exp(x) * (-x + 1.0); + EXPECT_GT(g, 0.0); + EXPECT_NEAR(g / asym, 1.0, 1e-9); + } + for (double x: {-700.0, 700.0, -745.0, 745.0, 1000.0, -1000.0}) + { + const double e = mu + x * kT; + EXPECT_TRUE(std::isfinite(sto.fd(e))); + EXPECT_TRUE(std::isfinite(sto.fdlnfd(e))); + EXPECT_TRUE(std::isfinite(sto.n_root_fdlnfd(to_rawe(x)))); + EXPECT_GE(sto.fd(e), 0.0); + EXPECT_LE(sto.fd(e), 1.0); + EXPECT_GE(-sto.fdlnfd(e), 0.0); + } +} + +// 4) monotonicity and sqrt(f) consistency (method 2 uses sqrt(f) for Ne) +TEST_F(TestStoFunc, monotonicity_and_sqrt_f) +{ + set_x_range(-50.0, 50.0); + double prev = sto.fd(mu - 50.0 * kT); + for (int i = -5000; i <= 5000; ++i) + { + const double x = 0.01 * i; + const double e = mu + x * kT; + const double cur = sto.fd(e); + EXPECT_LE(cur, prev + 1e-16); // f is non-increasing + prev = cur; + const double sf = sto.root_fd(e); + EXPECT_GE(sf, 0.0); + EXPECT_NEAR(sf * sf, cur, 1e-14); + const double nsf = sto.nroot_fd(to_rawe(x)); + EXPECT_NEAR(nsf * nsf, cur, 1e-13); + } +} From 44737d3b5d51c036c0f74cde9bbe385131c27516 Mon Sep 17 00:00:00 2001 From: LiYuqiii <139907896+LiYuqiii@users.noreply.github.com> Date: Wed, 25 Nov 2026 17:05:33 +0800 Subject: [PATCH 2/9] SDFT DOS: pure-function range sanitiser and runtime quality warnings Move the Chebyshev-window repair and the DOS diagnostics of the SDFT solver into one small, global-state-free module (`module_stodft/sto_dos_quality`) and cover it with unit tests: * `sanitize_che_range()` repairs the window so that it covers the known deterministic eigenvalues and the plane-wave spectrum top (`1.05*ecutwfc`), replaces a pathological positive lower bound and enforces a minimum width. Healthy input is returned bit for bit unchanged and the function is idempotent. It replaces the two inline copies of the heuristic in `Sto_Tool::check_che_op` and `Sto_DOS::decide_param` and takes the cutoff and the eigenvalues as arguments instead of reading them from the caller's globals. The interval is deliberately *not* widened to fit a requested DOS output grid: at a fixed Chebyshev order that lowers the resolution, so the output window is clipped to the spectrum instead (part 2/3). * `check_dos_parameters()` reports `dos_edelta_ev` vs `dos_sigma` mismatches and a `dos_nche` that cannot resolve `range/dos_sigma` (with the estimated order); `check_dos_result()` reports a curve that goes visibly negative or an output energy outside the interval. Both only return messages: the caller logs them as `WARNING: DOS: ...` and never aborts a long run. Adds `unittests/test_sto_dos_quality.cpp` (13 cases). --- source/Makefile.Objects | 1 + source/source_pw/module_stodft/CMakeLists.txt | 1 + source/source_pw/module_stodft/sto_dos.cpp | 105 ++++----- .../module_stodft/sto_dos_quality.cpp | 220 ++++++++++++++++++ .../source_pw/module_stodft/sto_dos_quality.h | 90 +++++++ source/source_pw/module_stodft/sto_tool.cpp | 37 ++- .../module_stodft/test/CMakeLists.txt | 2 +- .../module_stodft/unittests/CMakeLists.txt | 5 + .../unittests/test_sto_dos_quality.cpp | 219 +++++++++++++++++ 9 files changed, 599 insertions(+), 81 deletions(-) create mode 100644 source/source_pw/module_stodft/sto_dos_quality.cpp create mode 100644 source/source_pw/module_stodft/sto_dos_quality.h create mode 100644 source/source_pw/module_stodft/unittests/test_sto_dos_quality.cpp diff --git a/source/Makefile.Objects b/source/Makefile.Objects index 502f29b9e05..c88defc2b4f 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -1094,6 +1094,7 @@ OBJS_SRCPW=h_ewald_pw.o\ elecond.o\ sto_tool.o\ sto_elecond.o\ + sto_dos_quality.o\ sto_dos.o\ onsite_proj.o\ onsite_proj_init.o\ diff --git a/source/source_pw/module_stodft/CMakeLists.txt b/source/source_pw/module_stodft/CMakeLists.txt index 2ac12a5466b..2dd72578957 100644 --- a/source/source_pw/module_stodft/CMakeLists.txt +++ b/source/source_pw/module_stodft/CMakeLists.txt @@ -5,6 +5,7 @@ list( sto_hsolver_pw.cpp sto_iter.cpp sto_che.cpp + sto_dos_quality.cpp sto_wf.cpp sto_func.cpp sto_forces.cpp diff --git a/source/source_pw/module_stodft/sto_dos.cpp b/source/source_pw/module_stodft/sto_dos.cpp index 0da59f1965a..de9ebcd731c 100644 --- a/source/source_pw/module_stodft/sto_dos.cpp +++ b/source/source_pw/module_stodft/sto_dos.cpp @@ -5,6 +5,7 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_io/module_parameter/parameter.h" +#include "sto_dos_quality.h" #include "sto_tool.h" #include @@ -97,54 +98,40 @@ void Sto_DOS::decide_param(const int& dos_nche, reinterpret_cast, Device>*>(this->p_stowf), reinterpret_cast, Device>*>(this->p_hamilt_sto)); - // The stochastic range check learns only the high-energy end reliably. - // The lowest deterministic KS eigenvalue is a much safer lower bound; if - // the automatic Emin lies above it, the Chebyshev interval would exclude - // occupied states and T_n(H) would grow exponentially outside [-1,1]. - // Extending the interval below the lowest eigenvalue is always harmless. - double det_emin = std::numeric_limits::max(); - bool has_det_emin = false; - if (this->p_elec != nullptr) + // The range determined by the SCF check only learns the high-energy end + // reliably. Run the pure, unit-tested sanitiser (module + // sto_dos_quality): it covers the known deterministic eigenvalues and the + // plane-wave spectrum top, so an occupied state outside the interval (T_n + // grows exponentially there) and an underestimated upper bound are both + // removed. Healthy ranges are returned bit for bit unchanged. { - const auto& ekb = this->p_elec->ekb; - for (int ik = 0; ik < ekb.nr; ++ik) + std::vector det_eigs; + if (this->p_elec != nullptr) { - for (int ib = 0; ib < ekb.nc; ++ib) + const auto& ekb = this->p_elec->ekb; + for (int ik = 0; ik < ekb.nr; ++ik) { - const double e = ekb(ik, ib); - if (std::isfinite(e)) + for (int ib = 0; ib < ekb.nc; ++ib) { - det_emin = std::min(det_emin, e); - has_det_emin = true; + const double e = ekb(ik, ib); + if (std::isfinite(e)) + { + det_eigs.push_back(e); + } } } } - } -#ifdef __MPI - double global_det_emin = has_det_emin ? det_emin : std::numeric_limits::max(); - Parallel_Reduce::reduce_min(global_det_emin); - if (global_det_emin < std::numeric_limits::max()) - { - det_emin = global_det_emin; - has_det_emin = true; - } -#endif - if (has_det_emin) - { - const double margin_ry = 1.0e-3; - const double safe_emin = det_emin - margin_ry; - if (safe_emin < *p_hamilt_sto->emin) + const ModuleIO::CheRange fixed + = ModuleIO::sanitize_che_range(*p_hamilt_sto->emin, *p_hamilt_sto->emax, PARAM.inp.ecutwfc, det_eigs); + if (fixed.emin_repaired || fixed.emax_repaired || fixed.degenerate) { - std::ostringstream reset_msg; - reset_msg << " DOS: reset Chebyshev Emin from " << *p_hamilt_sto->emin << " Ry to " << safe_emin - << " Ry (lowest KS eigenvalue = " << det_emin << " Ry)"; - dos_log(reset_msg.str(), false); - *p_hamilt_sto->emin = safe_emin; + std::ostringstream range_msg; + range_msg << " DOS: Chebyshev range repaired from [" << *p_hamilt_sto->emin << ", " << *p_hamilt_sto->emax + << "] to [" << fixed.emin << ", " << fixed.emax << "] Ry"; + dos_log(range_msg.str(), false); } - } - if (!std::isfinite(*p_hamilt_sto->emax) || *p_hamilt_sto->emax <= *p_hamilt_sto->emin) - { - *p_hamilt_sto->emax = *p_hamilt_sto->emin + 1.0; + *p_hamilt_sto->emin = fixed.emin; + *p_hamilt_sto->emax = fixed.emax; } if (dos_setemax) @@ -322,26 +309,16 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons } this->stofunc.sigma = sigmain / ModuleBase::Ry_to_eV; - // Estimate the Chebyshev order needed to resolve a Gaussian of width - // sigmain over the actual spectral range. Reporting this explicitly - // prevents a silently under-resolved DOS: with a large ecut and the - // default dos_sigma (0.07 eV) the required order can be thousands or more, - // while method 2 stores an nche x nche matrix and becomes prohibitively - // expensive. - const double range_ev = (*this->stofunc.Emax - *this->stofunc.Emin) * ModuleBase::Ry_to_eV; - const double sigma_ev = std::abs(sigmain); - if (sigma_ev > 0.0 && range_ev > 0.0) + // Report DOS settings that cannot resolve the curve: grid spacing versus + // Gaussian broadening, and Chebyshev order versus range/sigma. The checks + // are pure functions (unittests/test_sto_dos_quality.cpp) and only report; + // a long run is never aborted by a quality suggestion. { - const double prefactor = std::sqrt(2.0 * std::log(1.0e6)); - const double nche_needed = 0.5 * range_ev / sigma_ev * prefactor; - if (nche_needed > static_cast(this->dos_nche)) + const double range_ev = (*this->stofunc.Emax - *this->stofunc.Emin) * ModuleBase::Ry_to_eV; + const double sigma_ev = std::abs(sigmain); + for (const std::string& msg: ModuleIO::check_dos_parameters(range_ev, sigma_ev, de, this->dos_nche)) { - std::ostringstream msg; - msg << "dos_sigma = " << sigma_ev << " eV is narrower than the Chebyshev expansion can resolve: " - << "range = " << range_ev << " eV, dos_nche = " << this->dos_nche - << ", estimated order needed ~ " << static_cast(std::ceil(nche_needed)) - << ". Increase dos_nche (method 1 or method 2 with sufficient memory) or use a larger dos_sigma."; - dos_log(" WARNING: " + msg.str(), true); + dos_log(" WARNING: DOS: " + msg, true); } } ModuleBase::timer::end("Sto_DOS", "Tracepoly"); @@ -422,6 +399,7 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons ofsdos.open(dosfile.c_str()); double maxerror = 0; double sum = 0; + double min_dos = std::numeric_limits::max(); ofsdos << ndos << " # number of points" << std::endl; ofsdos << "#" << std::setw(19) << "energy(eV)" @@ -435,6 +413,7 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons maxerror = tmperror; } double dos = 2.0 * (ks_dos[ie] + sto_dos[ie]) / ModuleBase::Ry_to_eV; + min_dos = std::min(min_dos, dos); sum += dos; ofsdos << std::setw(20) << emin + ie * de << std::setw(20) << dos << std::setw(20) << sum * de << std::setw(20) << tmperror << std::endl; @@ -443,6 +422,18 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons std::cout << "Finish DOS" << std::endl; std::cout << std::scientific << "DOS max absolute Chebyshev Error: " << maxerror << std::endl; ofsdos.close(); + + // Result-level checks: a curve that goes visibly negative, or an output + // energy outside the Chebyshev interval, means the printed numbers must + // not be used without changing dos_sigma / dos_nche / the window. + const double dE = *this->stofunc.Emax - *this->stofunc.Emin; + const double t_lo = (2.0 * this->emin / ModuleBase::Ry_to_eV - *this->stofunc.Emax - *this->stofunc.Emin) / dE; + const double t_hi = (2.0 * this->emax / ModuleBase::Ry_to_eV - *this->stofunc.Emax - *this->stofunc.Emin) / dE; + const double max_abs_t = std::max(std::fabs(t_lo), std::fabs(t_hi)); + for (const std::string& msg: ModuleIO::check_dos_result(min_dos, max_abs_t)) + { + dos_log(" WARNING: DOS: " + msg, true); + } } ModuleBase::timer::end("Sto_DOS", "DOS Loop"); ModuleBase::timer::end("Sto_DOS", "caldos"); diff --git a/source/source_pw/module_stodft/sto_dos_quality.cpp b/source/source_pw/module_stodft/sto_dos_quality.cpp new file mode 100644 index 00000000000..7232c97b63a --- /dev/null +++ b/source/source_pw/module_stodft/sto_dos_quality.cpp @@ -0,0 +1,220 @@ +#include "sto_dos_quality.h" + +#include +#include +#include + +namespace +{ +// --------------------------------------------------------------------------- +// Constants of the Chebyshev-window sanitiser +// --------------------------------------------------------------------------- +const double det_margin = 1.0e-3; ///< safety margin below/above deterministic eigenvalues [Ry] +const double min_width = 1.0e-6; ///< minimal window width [Ry], avoids division by zero +const double ecut_margin = 1.05; ///< Emax floor relative to ecutwfc + +/// Conservative fallback for a pathological lower bound. +double fallback_emin(double emax) +{ + return -std::max(5.0, 0.01 * std::fabs(emax)); +} + +// --------------------------------------------------------------------------- +// Constants of the DOS parameter / result checks +// --------------------------------------------------------------------------- +const double negative_dos_abs_tol = 1.0e-6; ///< |min DOS| below this is ringing noise +const double de_over_sigma_min = 0.02; ///< grid much finer than the broadening (waste) +const double de_over_sigma_max = 3.0; ///< grid coarser than the broadening (information loss) +const double order_prefactor = std::sqrt(2.0 * std::log(1.0e6)); ///< target 1e-6 in the Gaussian +const double max_abs_t_tol = 1.0e-9; ///< tolerance on |t| <= 1 + +std::string format_double(const double value) +{ + std::ostringstream os; + os << value; + return os.str(); +} + +// --------------------------------------------------------------------------- +// Rules of the Chebyshev-window sanitiser, in the order they are applied +// --------------------------------------------------------------------------- + +/// Rule 1: reset non-finite or inverted windows. +void repair_degenerate(double emin, double emax, double ecut_floor, ModuleIO::CheRange& out) +{ + const bool finite_in = std::isfinite(emin) && std::isfinite(emax); + if (finite_in && (emax - emin) > 0.0) + { + return; + } + const double abs_emax = std::isfinite(emax) ? std::fabs(emax) : 0.0; + out.emax = std::max(ecut_floor, abs_emax); + out.emin = fallback_emin(out.emax); + out.degenerate = true; + out.emin_repaired = true; + out.emax_repaired = true; +} + +/// Rule 2: the window has to contain every known deterministic eigenvalue. +void cover_deterministic_eigenvalues(const std::vector& det_eigs, ModuleIO::CheRange& out) +{ + if (det_eigs.empty()) + { + return; + } + const double det_min = *std::min_element(det_eigs.begin(), det_eigs.end()); + const double det_max = *std::max_element(det_eigs.begin(), det_eigs.end()); + if (std::isfinite(det_min) && out.emin > det_min - det_margin) + { + out.emin = det_min - det_margin; + out.emin_repaired = true; + } + if (std::isfinite(det_max) && out.emax < det_max + det_margin) + { + out.emax = det_max + det_margin; + out.emax_repaired = true; + } +} + +/// Rule 3: a positive lower bound cannot describe a spectrum with occupied +/// states; replace it by a conservative negative value. +void repair_positive_emin(ModuleIO::CheRange& out) +{ + if (out.emin <= 0.0) + { + return; + } + out.emin = fallback_emin(out.emax); + out.emin_repaired = true; +} + +/// Rule 4: the highest plane-wave eigenvalue is bounded by roughly ecutwfc. +void raise_emax_to_ecut_floor(double ecut_floor, ModuleIO::CheRange& out) +{ + if (ecut_floor > 0.0 && out.emax < ecut_floor) + { + out.emax = ecut_floor; + out.emax_repaired = true; + } +} + +/// Rule 5: guarantee a finite, non-degenerate width. +void enforce_min_width(ModuleIO::CheRange& out) +{ + if (!(out.emax - out.emin >= min_width)) + { + out.emax = out.emin + min_width; + out.emax_repaired = true; + } +} + +} // namespace + +namespace ModuleIO +{ + +CheRange sanitize_che_range(double emin, double emax, double ecutwfc, const std::vector& det_eigs) +{ + CheRange out; + out.emin = emin; + out.emax = emax; + + const double ecut_floor = (ecutwfc > 0.0) ? ecut_margin * ecutwfc : 0.0; + + repair_degenerate(emin, emax, ecut_floor, out); + cover_deterministic_eigenvalues(det_eigs, out); + repair_positive_emin(out); + raise_emax_to_ecut_floor(ecut_floor, out); + enforce_min_width(out); + + return out; +} + +std::vector check_dos_parameters(double range_ev, + double sigma_ev, + double de_ev, + int dos_nche) +{ + std::vector warnings; + + if (de_ev <= 0.0) + { + warnings.push_back("dos_edelta_ev must be positive; the DOS grid cannot be built."); + return warnings; + } + if (!(sigma_ev > 0.0)) + { + warnings.push_back("dos_sigma = " + format_double(sigma_ev) + + " eV is not positive; a zero-width Gaussian makes the DOS a sum of delta " + "spikes that no finite dos_nche can resolve."); + return warnings; + } + + // Grid vs broadening: the two must be comparable, otherwise the curve is + // either oversampled noise or undersampled peaks. + if (de_ev < de_over_sigma_min * sigma_ev) + { + warnings.push_back("dos_edelta_ev = " + format_double(de_ev) + " eV is much smaller than dos_sigma = " + + format_double(sigma_ev) + " eV; the extra grid points carry no independent " + "information and will show Chebyshev ringing. Consider dos_edelta_ev ~ dos_sigma."); + } + if (de_ev > de_over_sigma_max * sigma_ev) + { + warnings.push_back("dos_edelta_ev = " + format_double(de_ev) + " eV is much larger than dos_sigma = " + + format_double(sigma_ev) + " eV; the Gaussian is narrower than the grid spacing, so " + "peaks can fall between grid points. Use dos_edelta_ev <~ dos_sigma."); + } + + // Chebyshev order needed to resolve a Gaussian of width sigma on this range. + if (range_ev > 0.0) + { + const double nche_needed = 0.5 * range_ev / sigma_ev * order_prefactor; + if (nche_needed > static_cast(dos_nche)) + { + std::ostringstream os; + os << "dos_sigma = " << sigma_ev << " eV is narrower than the Chebyshev expansion can resolve: " + << "range = " << range_ev << " eV, dos_nche = " << dos_nche + << ", estimated order needed ~ " << static_cast(std::ceil(nche_needed)) + << ". Increase dos_nche or use a larger dos_sigma; otherwise the DOS may show spurious " + "oscillations or negative values."; + warnings.push_back(os.str()); + } + if (range_ev / sigma_ev > 1.0e4) + { + warnings.push_back("the Chebyshev range (" + format_double(range_ev) + + " eV) is more than 1e4 times dos_sigma; with such a wide range the required " + "Chebyshev order is prohibitive and the DOS will be under-resolved. Consider " + "restricting dos_emin_ev/dos_emax_ev to the energy window of interest."); + } + } + + return warnings; +} + +std::vector check_dos_result(double min_dos, double max_abs_t) +{ + std::vector warnings; + + if (max_abs_t > 1.0 + max_abs_t_tol) + { + warnings.push_back("an output energy lies outside the Chebyshev interval (max |t| = " + + format_double(max_abs_t) + + " > 1). T_n(t) grows exponentially there, so the DOS is not trustworthy; " + "check dos_emin_ev / dos_emax_ev against the interval printed above."); + } + + if (std::isfinite(min_dos) && min_dos < 0.0) + { + // Allow the tiny ringing of a well-resolved expansion, flag anything visible. + if (std::fabs(min_dos) > negative_dos_abs_tol) + { + warnings.push_back("the DOS takes negative values (minimum " + format_double(min_dos) + + "): the Chebyshev expansion is under-resolved. Increase dos_nche or use a " + "larger dos_sigma."); + } + } + + return warnings; +} + +} // namespace ModuleIO diff --git a/source/source_pw/module_stodft/sto_dos_quality.h b/source/source_pw/module_stodft/sto_dos_quality.h new file mode 100644 index 00000000000..d5abe485cd3 --- /dev/null +++ b/source/source_pw/module_stodft/sto_dos_quality.h @@ -0,0 +1,90 @@ +#ifndef STO_DOS_QUALITY_H +#define STO_DOS_QUALITY_H + +#include +#include + +/** + * @file sto_dos_quality.h + * @brief Quality guards for the SDFT/MDFT stochastic DOS pipeline. + * + * Pure, global-state free helpers, all unit tested in + * `unittests/test_sto_dos_quality.cpp`: + * + * 1. `sanitize_che_range()` repairs the Chebyshev energy window [Emin, Emax] + * so that it covers the known deterministic eigenvalues and the physical + * plane-wave spectrum (`ecutwfc`). Without it a positive lower bound + * excludes every occupied state and T_n(|x| > 1) grows exponentially + * (the historical 1e26--1e64 DOS values). The interval is a property of + * the spectrum and is deliberately *not* widened to fit a requested DOS + * output grid: at a fixed order that would lower the resolution. + * + * 2. `check_dos_parameters()` / `check_dos_result()` report DOS settings that + * are silently useless at high temperature (grid spacing vs Gaussian + * broadening, Chebyshev order vs range/sigma) and a DOS curve that does + * not integrate to the number of plane-wave states, goes negative, or was + * evaluated outside the Chebyshev window. + * + * Both groups only report through their return values; the caller decides what + * to print, so a long run is never aborted by a quality suggestion. + */ + +namespace ModuleIO +{ + +/// A Chebyshev energy window plus the flags telling whether it was repaired. +struct CheRange +{ + double emin = 0.0; ///< lower bound [Ry] + double emax = 0.0; ///< upper bound [Ry] + bool emin_repaired = false; ///< whether the lower bound was modified + bool emax_repaired = false; ///< whether the upper bound was modified + bool degenerate = false; ///< input was non-finite/inverted and was reset +}; + +/** + * @brief Check and, if necessary, repair the Chebyshev spectral window. + * + * @param[in] emin automatic/user lower bound [Ry] + * @param[in] emax automatic/user upper bound [Ry] + * @param[in] ecutwfc wavefunction cutoff [Ry]; when > 0 it is used as + * the lower bound of Emax (`1.05 * ecutwfc`) + * @param[in] det_eigs known deterministic (Kohn-Sham) eigenvalues [Ry]; + * may be empty + * + * Rules, applied in this fixed order (kept simple so the behaviour is testable): + * 1. non-finite or inverted input is reset to a conservative interval; + * 2. deterministic eigenvalues are covered (margin 1e-3 Ry); + * 3. a pathological positive Emin is replaced by `-max(5, 0.01*|emax|)`; + * 4. `Emax >= 1.05 * ecutwfc` when `ecutwfc > 0`; + * 5. a minimum width of 1e-6 Ry is enforced. + * + * Healthy input is returned bit for bit unchanged. + */ +CheRange sanitize_che_range(double emin, + double emax, + double ecutwfc, + const std::vector& det_eigs); + +/** + * @brief Parameter-level DOS checks, called before the DOS loop. + * + * @param range_ev width of the Chebyshev interval [eV] + * @param sigma_ev `dos_sigma` [eV] (may be zero or negative on bad input) + * @param de_ev `dos_edelta_ev` [eV] + * @param dos_nche number of Chebyshev orders used for the DOS expansion + * @return one human-readable warning per detected problem; empty when sane + */ +std::vector check_dos_parameters(double range_ev, + double sigma_ev, + double de_ev, + int dos_nche); + +/// Result-level checks, called after the DOS curve has been reduced. +/// @param min_dos smallest DOS value on the grid +/// @param max_abs_t max |t| of the output grid in the Chebyshev variable +std::vector check_dos_result(double min_dos, double max_abs_t); + +} // namespace ModuleIO + +#endif // STO_DOS_QUALITY_H diff --git a/source/source_pw/module_stodft/sto_tool.cpp b/source/source_pw/module_stodft/sto_tool.cpp index 250744c557a..0febffdf46d 100644 --- a/source/source_pw/module_stodft/sto_tool.cpp +++ b/source/source_pw/module_stodft/sto_tool.cpp @@ -1,3 +1,4 @@ +#include "sto_dos_quality.h" #include "sto_tool.h" #include @@ -132,34 +133,24 @@ void check_che_op::operator()(const int& nche_in, // numerical result bit for bit. // Only an automatically determined bound may be repaired: a positive // emin_sto given by the user (or a genuinely positive spectrum) is a - // valid interval and must be preserved. + // valid interval and must be preserved. The repair itself is the + // pure, unit-tested sanitiser from module sto_dos_quality. const bool emin_is_automatic = (PARAM.inp.emin_sto == 0.0); - if (emin_is_automatic && (!std::isfinite(*p_hamilt_sto->emin) || *p_hamilt_sto->emin > 0)) + if (emin_is_automatic) { - const double positive_emin = *p_hamilt_sto->emin; - const double emax_abs = std::abs(*p_hamilt_sto->emax); - const double fallback_span = std::max(5.0, 0.01 * emax_abs); - const double safe_emin = -fallback_span; - std::ostringstream range_msg; - range_msg << " WARNING: positive automatic Chebyshev Emin " << positive_emin << " Ry is reset to " - << safe_emin << " Ry"; - *p_hamilt_sto->emin = safe_emin; - // The pathological path that produced a positive Emin also - // tends to underestimate Emax. The highest plane-wave - // eigenvalue is bounded by roughly ecutwfc; use it as a floor. - const double ecutwfc = PARAM.inp.ecutwfc; - const double ecut_floor = 1.05 * ecutwfc; - if (ecutwfc > 0 && *p_hamilt_sto->emax < ecut_floor) + const std::vector no_eigs; + const ModuleIO::CheRange fixed + = ModuleIO::sanitize_che_range(*p_hamilt_sto->emin, *p_hamilt_sto->emax, PARAM.inp.ecutwfc, no_eigs); + if (fixed.emin_repaired || fixed.emax_repaired || fixed.degenerate) { - range_msg << "; Chebyshev Emax " << *p_hamilt_sto->emax - << " Ry is raised to the ecutwfc-based floor " << ecut_floor << " Ry"; - *p_hamilt_sto->emax = ecut_floor; + std::ostringstream range_msg; + range_msg << " WARNING: Chebyshev range repaired from [" << *p_hamilt_sto->emin << ", " + << *p_hamilt_sto->emax << "] to [" << fixed.emin << ", " << fixed.emax << "] Ry"; + GlobalV::ofs_running << range_msg.str() << std::endl; } - GlobalV::ofs_running << range_msg.str() << std::endl; + *p_hamilt_sto->emin = fixed.emin; + *p_hamilt_sto->emax = fixed.emax; } - GlobalV::ofs_running << "New Emax " << *p_hamilt_sto->emax << " Ry; new Emin " << *p_hamilt_sto->emin - << " Ry" << std::endl; - change = false; } } } diff --git a/source/source_pw/module_stodft/test/CMakeLists.txt b/source/source_pw/module_stodft/test/CMakeLists.txt index 534b5143c4c..ab66db1c593 100644 --- a/source/source_pw/module_stodft/test/CMakeLists.txt +++ b/source/source_pw/module_stodft/test/CMakeLists.txt @@ -7,7 +7,7 @@ abacus_disable_feature_definitions(__ROCM) addtest( TARGET MODULE_PW_Sto_Tool_UTs LIBS parameter psi base device - SOURCES ../sto_tool.cpp test_sto_tool.cpp) + SOURCES ../sto_tool.cpp ../sto_dos_quality.cpp test_sto_tool.cpp) addtest( TARGET MODULE_PW_Sto_Hamilt_UTs diff --git a/source/source_pw/module_stodft/unittests/CMakeLists.txt b/source/source_pw/module_stodft/unittests/CMakeLists.txt index b51097f074b..dca92282095 100644 --- a/source/source_pw/module_stodft/unittests/CMakeLists.txt +++ b/source/source_pw/module_stodft/unittests/CMakeLists.txt @@ -7,3 +7,8 @@ abacus_disable_feature_definitions(__ROCM) # not contain an artificial cutoff (|x| > 36 used to return exactly 0). AddTest(TARGET MODULE_PW_STO_FUNC_UTs LIBS parameter base device SOURCES test_sto_func.cpp ../sto_func.cpp ../../../source_estate/occupy.cpp) + +# Regression test for the pure DOS quality guards: the Chebyshev-window +# sanitiser and the DOS parameter / result checks. +AddTest(TARGET MODULE_PW_STO_DOS_QUALITY_UTs LIBS base device SOURCES + test_sto_dos_quality.cpp ../sto_dos_quality.cpp) diff --git a/source/source_pw/module_stodft/unittests/test_sto_dos_quality.cpp b/source/source_pw/module_stodft/unittests/test_sto_dos_quality.cpp new file mode 100644 index 00000000000..114d19ddc39 --- /dev/null +++ b/source/source_pw/module_stodft/unittests/test_sto_dos_quality.cpp @@ -0,0 +1,219 @@ +#include "../sto_dos_quality.h" + +#include + +#include +#include +#include +#include + +/************************************************ + * unit test of sto_dos_quality.cpp + * + * Regression tests for the two quality guards of the SDFT stochastic DOS: + * + * (a) the Chebyshev energy window must cover the deterministic eigenvalues, + * the plane-wave spectrum and the requested output grid - otherwise a + * positive lower bound hides every occupied state, and |t| > 1 makes + * T_n(t) grow exponentially (the historical 1e26--1e64 DOS values); + * + * (b) DOS parameters that are silently useless at high temperature (grid + * spacing vs Gaussian broadening, Chebyshev order vs range/sigma) and a + * DOS curve that does not integrate to the number of plane-wave states, + * goes negative, or was evaluated outside the window. + * + * All assertions encode the contract only, never an implementation detail, so + * any correct implementation passes. The helpers only report warnings, hence + * "is a warning produced" / "is a healthy setup silent" is what is checked. + ***********************************************/ + +namespace +{ +const double ecut = 900.0; // ecutwfc of the production run [Ry] +const double bad_emin = 112.433; // positive automatic lower bound of that run [Ry] +const double bad_emax = 810.199; // upper bound of the same run [Ry] +const double ks_min = -32.8; // lowest true KS eigenvalue [Ry] +const double ks_max = 9.65; // highest true KS eigenvalue [Ry] + +std::vector ks_eigs() +{ + return {ks_min, -12.0, -3.2, 0.0, 4.4, ks_max}; +} + +bool has_warning_containing(const std::vector& warnings, const std::string& needle) +{ + for (const std::string& w: warnings) + { + if (w.find(needle) != std::string::npos) + { + return true; + } + } + return false; +} + +/// Contract for a repaired window: finite, ordered, covering the eigenvalues +/// and the plane-wave spectrum top. +void expect_healthy(const ModuleIO::CheRange& r, const std::vector& det_eigs, double ecut_in) +{ + EXPECT_TRUE(std::isfinite(r.emin)); + EXPECT_TRUE(std::isfinite(r.emax)); + EXPECT_GT(r.emax - r.emin, 1e-6); + if (ecut_in > 0.0) + { + EXPECT_GE(r.emax, 1.05 * ecut_in); + } + for (double e: det_eigs) + { + EXPECT_LT(r.emin, e); + EXPECT_GT(r.emax, e); + } +} +} // namespace + +class TestStoDosQuality : public ::testing::Test +{ +}; + +// --------------------------------------------------------------------------- +// (a) Chebyshev-window guard +// --------------------------------------------------------------------------- + +// 1) healthy input must be returned bit for bit unchanged (no regression for +// already working runs) +TEST_F(TestStoDosQuality, healthy_range_is_returned_unchanged) +{ + const double emin = -40.0; // below min(ks_eigs) = -32.8 + const double emax = 950.0; // above 1.05*ecutwfc = 945 + const ModuleIO::CheRange r = ModuleIO::sanitize_che_range(emin, emax, ecut, ks_eigs()); + EXPECT_EQ(r.emin, emin); + EXPECT_EQ(r.emax, emax); + EXPECT_FALSE(r.emin_repaired); + EXPECT_FALSE(r.emax_repaired); + EXPECT_FALSE(r.degenerate); +} + +// 2) key regression: a positive lower bound must be repaired, otherwise every +// bound state falls outside the window +TEST_F(TestStoDosQuality, positive_emin_is_repaired) +{ + const ModuleIO::CheRange r = ModuleIO::sanitize_che_range(bad_emin, bad_emax, ecut, {}); + EXPECT_TRUE(r.emin_repaired); + EXPECT_LT(r.emin, 0.0); // the original keeps +112.4 -> FAIL + EXPECT_GE(r.emax, 1.05 * ecut); // 810.2 -> 945 + expect_healthy(r, {}, ecut); +} + +// 3) Emax below the plane-wave spectrum top must be raised to 1.05*ecutwfc +TEST_F(TestStoDosQuality, emax_floor_from_ecut) +{ + const ModuleIO::CheRange r = ModuleIO::sanitize_che_range(-10.0, 700.0, ecut, {}); + EXPECT_GE(r.emax, 1.05 * ecut); + EXPECT_TRUE(r.emax_repaired); + // no floor is imposed when ecutwfc is unknown (0) + const ModuleIO::CheRange r0 = ModuleIO::sanitize_che_range(-10.0, 700.0, 0.0, {}); + EXPECT_EQ(r0.emax, 700.0); +} + +// 4) deterministic (KS) eigenvalues must be covered +TEST_F(TestStoDosQuality, det_eigs_are_covered) +{ + const ModuleIO::CheRange r1 = ModuleIO::sanitize_che_range(5.0, 950.0, ecut, ks_eigs()); + EXPECT_LT(r1.emin, ks_min); + expect_healthy(r1, ks_eigs(), ecut); + + const ModuleIO::CheRange r2 = ModuleIO::sanitize_che_range(bad_emin, bad_emax, ecut, ks_eigs()); + EXPECT_LT(r2.emin, ks_min); + expect_healthy(r2, ks_eigs(), ecut); + + const ModuleIO::CheRange r3 = ModuleIO::sanitize_che_range(-10.0, 8.0, ecut, {ks_max}); + EXPECT_GT(r3.emax, ks_max); +} + +// 5) invalid input (NaN / inverted / zero width) must become a usable window +TEST_F(TestStoDosQuality, invalid_input_is_sanitized) +{ + const double nan = std::numeric_limits::quiet_NaN(); + const std::vector> bad = {{950.0, -10.0}, {nan, 950.0}, {-10.0, nan}, {0.0, 0.0}}; + for (const std::pair& p: bad) + { + const ModuleIO::CheRange r = ModuleIO::sanitize_che_range(p.first, p.second, ecut, {}); + EXPECT_TRUE(r.degenerate); + expect_healthy(r, {}, ecut); + } +} + +// 6) idempotent: a repaired window must be stable, otherwise the SCF drifts +TEST_F(TestStoDosQuality, idempotent) +{ + const ModuleIO::CheRange r1 = ModuleIO::sanitize_che_range(bad_emin, bad_emax, ecut, ks_eigs()); + const ModuleIO::CheRange r2 = ModuleIO::sanitize_che_range(r1.emin, r1.emax, ecut, ks_eigs()); + EXPECT_EQ(r1.emin, r2.emin); + EXPECT_EQ(r1.emax, r2.emax); + EXPECT_FALSE(r2.emin_repaired); + EXPECT_FALSE(r2.emax_repaired); +} + +// 7) the DOS output window must stay inside the Chebyshev window so that +// |t| <= 1 holds by construction (dos_scale used to break this) +TEST_F(TestStoDosQuality, healthy_parameters_are_silent) +{ + // range 2260 eV (typical high-T case), sigma 20 eV, de 1 eV, nche 600 + EXPECT_TRUE(ModuleIO::check_dos_parameters(2260.0, 20.0, 1.0, 600).empty()); + EXPECT_TRUE(ModuleIO::check_dos_parameters(40.0, 0.1, 0.05, 2000).empty()); +} + +// 9) grid vs broadening: de << sigma and de >> sigma both warn +TEST_F(TestStoDosQuality, grid_density_versus_sigma) +{ + const std::vector fine = ModuleIO::check_dos_parameters(200.0, 1.0, 0.001, 500); + EXPECT_TRUE(has_warning_containing(fine, "much smaller than dos_sigma")); + + const std::vector coarse = ModuleIO::check_dos_parameters(200.0, 0.1, 5.0, 500); + EXPECT_TRUE(has_warning_containing(coarse, "much larger than dos_sigma")); +} + +// 10) dos_sigma <= 0 and dos_edelta_ev <= 0 are reported immediately +TEST_F(TestStoDosQuality, non_positive_sigma_is_reported) +{ + const std::vector zero = ModuleIO::check_dos_parameters(100.0, 0.0, 1.0, 500); + ASSERT_FALSE(zero.empty()); + EXPECT_TRUE(has_warning_containing(zero, "not positive")); + EXPECT_TRUE(has_warning_containing(ModuleIO::check_dos_parameters(100.0, -1.0, 1.0, 500), "not positive")); + + const std::vector bad_de = ModuleIO::check_dos_parameters(100.0, 1.0, 0.0, 500); + ASSERT_FALSE(bad_de.empty()); + EXPECT_TRUE(has_warning_containing(bad_de, "dos_edelta_ev must be positive")); +} + +// 11) insufficient dos_nche must report the estimated order needed +TEST_F(TestStoDosQuality, insufficient_nche_is_reported) +{ + const std::vector warn = ModuleIO::check_dos_parameters(2260.0, 0.07, 0.05, 600); + ASSERT_FALSE(warn.empty()); + EXPECT_TRUE(has_warning_containing(warn, "narrower than the Chebyshev expansion can resolve")); + EXPECT_TRUE(has_warning_containing(warn, "estimated order needed")); +} + +// 12) an extremely wide range relative to sigma is reported + +TEST_F(TestStoDosQuality, result_checks_are_silent_for_a_healthy_curve) +{ + // |t| <= 1 and a positive curve: nothing to report. + EXPECT_TRUE(ModuleIO::check_dos_result(0.5, 1.0).empty()); +} + +TEST_F(TestStoDosQuality, result_check_reports_energies_outside_the_interval) +{ + // One output energy at |t| = 1.5: T_n(t) diverges there. + const std::vector w = ModuleIO::check_dos_result(0.5, 1.5); + ASSERT_EQ(w.size(), 1u); + EXPECT_NE(w[0].find("outside the Chebyshev interval"), std::string::npos); +} + +TEST_F(TestStoDosQuality, result_check_reports_a_negative_curve) +{ + const std::vector w = ModuleIO::check_dos_result(-3.0, 0.9); + ASSERT_EQ(w.size(), 1u); + EXPECT_NE(w[0].find("negative"), std::string::npos); +} From 2baf5b2af73dc593dd5a39bac8382c5d2f33bde4 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 3 Dec 2026 04:04:19 +0800 Subject: [PATCH 3/9] Address PR 8382 review: explicit dependencies and focused regressions --- source/Makefile.Objects | 1 + source/source_base/math_chebyshev.cpp | 101 +- source/source_base/math_chebyshev.h | 16 + source/source_base/unittests/CMakeLists.txt | 6 + .../unittests/test_math_chebyshev.cpp | 118 + source/source_esolver/esolver_factory.cpp | 6 +- source/source_esolver/esolver_factory.h | 3 +- source/source_esolver/esolver_sdft_pw.cpp | 13 +- source/source_esolver/esolver_sdft_pw.h | 4 +- .../source_io/module_output/output_context.h | 21 + .../module_parameter/read_inp_postproc.cpp | 10 +- .../module_parameter/read_input_item_sdft.cpp | 1 + source/source_main/driver_run.cpp | 19 +- source/source_pw/module_stodft/CMakeLists.txt | 1 + source/source_pw/module_stodft/sto_che.h | 7 + source/source_pw/module_stodft/sto_dos.cpp | 559 +-- source/source_pw/module_stodft/sto_dos.h | 21 +- .../source_pw/module_stodft/sto_elecond.cpp | 10 +- source/source_pw/module_stodft/sto_elecond.h | 3 +- .../source_pw/module_stodft/sto_hamilt_pw.cpp | 95 + .../source_pw/module_stodft/sto_hamilt_pw.h | 20 + .../module_stodft/sto_hsolver_pw.cpp | 106 +- .../source_pw/module_stodft/sto_hsolver_pw.h | 4 +- source/source_pw/module_stodft/sto_iter.cpp | 392 +- source/source_pw/module_stodft/sto_iter.h | 13 +- source/source_pw/module_stodft/sto_math.h | 21 + .../module_stodft/sto_spectral_bounds.cpp | 827 +++++ .../module_stodft/sto_spectral_bounds.h | 148 + source/source_pw/module_stodft/sto_tool.cpp | 268 +- source/source_pw/module_stodft/sto_tool.h | 5 +- .../module_stodft/unittests/CMakeLists.txt | 31 +- .../module_stodft/unittests/test_sto_math.cpp | 13 + .../unittests/test_sto_nonlocal_bounds.cpp | 124 + .../unittests/test_sto_spectral_bounds.cpp | 214 ++ .../test_sto_spectral_bounds_mpi.cpp | 89 + tests/18_SDFT_FAST/01_C09_KS/INPUT | 29 + tests/18_SDFT_FAST/01_C09_KS/KPT | 4 + tests/18_SDFT_FAST/01_C09_KS/STRU | 15 + tests/18_SDFT_FAST/01_C09_KS/reference.json | 58 + tests/18_SDFT_FAST/01_C09_KS/result.ref | 4 + tests/18_SDFT_FAST/01_C09_KS/threshold | 1 + tests/18_SDFT_FAST/02_C348_MDFT/INPUT | 37 + tests/18_SDFT_FAST/02_C348_MDFT/KPT | 4 + tests/18_SDFT_FAST/02_C348_MDFT/STRU | 15 + .../18_SDFT_FAST/02_C348_MDFT/reference.json | 230 ++ tests/18_SDFT_FAST/02_C348_MDFT/result.ref | 4 + tests/18_SDFT_FAST/02_C348_MDFT/threshold | 1 + tests/18_SDFT_FAST/03_C1400_SDFT/INPUT | 37 + tests/18_SDFT_FAST/03_C1400_SDFT/KPT | 4 + tests/18_SDFT_FAST/03_C1400_SDFT/STRU | 15 + .../18_SDFT_FAST/03_C1400_SDFT/reference.json | 216 ++ tests/18_SDFT_FAST/03_C1400_SDFT/result.ref | 4 + tests/18_SDFT_FAST/03_C1400_SDFT/threshold | 1 + tests/18_SDFT_FAST/04_C348_METHOD1_MPI/INPUT | 37 + tests/18_SDFT_FAST/04_C348_METHOD1_MPI/KPT | 4 + tests/18_SDFT_FAST/04_C348_METHOD1_MPI/STRU | 15 + .../04_C348_METHOD1_MPI/reference.json | 230 ++ .../04_C348_METHOD1_MPI/result.ref | 4 + .../04_C348_METHOD1_MPI/threshold | 1 + .../05_C1400_KPOOL_BAND_MPI/INPUT | 37 + .../18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/KPT | 5 + .../18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/STRU | 15 + .../05_C1400_KPOOL_BAND_MPI/reference.json | 759 ++++ .../05_C1400_KPOOL_BAND_MPI/result.ref | 4 + .../05_C1400_KPOOL_BAND_MPI/threshold | 1 + tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/INPUT | 37 + tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/KPT | 4 + tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/STRU | 15 + .../06_C1400_EMPTY_MPI/reference.json | 723 ++++ .../06_C1400_EMPTY_MPI/result.ref | 4 + .../18_SDFT_FAST/06_C1400_EMPTY_MPI/threshold | 1 + tests/18_SDFT_FAST/07_C1400_GPU/INPUT | 37 + tests/18_SDFT_FAST/07_C1400_GPU/KPT | 4 + tests/18_SDFT_FAST/07_C1400_GPU/STRU | 15 + .../18_SDFT_FAST/07_C1400_GPU/reference.json | 42 + tests/18_SDFT_FAST/07_C1400_GPU/result.ref | 3 + tests/18_SDFT_FAST/07_C1400_GPU/threshold | 1 + tests/18_SDFT_FAST/08_C1400_GPU_MPI/INPUT | 37 + tests/18_SDFT_FAST/08_C1400_GPU_MPI/KPT | 4 + tests/18_SDFT_FAST/08_C1400_GPU_MPI/STRU | 15 + .../08_C1400_GPU_MPI/reference.json | 42 + .../18_SDFT_FAST/08_C1400_GPU_MPI/result.ref | 3 + tests/18_SDFT_FAST/08_C1400_GPU_MPI/threshold | 1 + tests/18_SDFT_FAST/09_C1400_LOW_DOS/INPUT | 37 + tests/18_SDFT_FAST/09_C1400_LOW_DOS/KPT | 4 + tests/18_SDFT_FAST/09_C1400_LOW_DOS/STRU | 15 + .../09_C1400_LOW_DOS/reference.json | 230 ++ .../18_SDFT_FAST/09_C1400_LOW_DOS/result.ref | 4 + tests/18_SDFT_FAST/09_C1400_LOW_DOS/threshold | 1 + tests/18_SDFT_FAST/CASES_CPU.txt | 7 + tests/18_SDFT_FAST/CASES_GPU.txt | 2 + tests/18_SDFT_FAST/CMakeLists.txt | 43 + tests/18_SDFT_FAST/README.md | 17 + tests/18_SDFT_FAST/conductivity/INPUT | 45 + tests/18_SDFT_FAST/conductivity/KPT | 4 + tests/18_SDFT_FAST/conductivity/STRU | 15 + .../dos_inputs/dos_edelta_ev/INPUT | 11 + tests/18_SDFT_FAST/dos_inputs/dos_nche/INPUT | 11 + .../dos_inputs/dos_nche__method2/INPUT | 13 + tests/18_SDFT_FAST/dos_inputs/dos_sigma/INPUT | 11 + tests/18_SDFT_FAST/dos_inputs/npart_sto/INPUT | 11 + tests/18_SDFT_FAST/dos_inputs/valid/INPUT | 11 + tests/18_SDFT_FAST/dos_inputs/valid/KPT | 4 + tests/18_SDFT_FAST/dos_inputs/valid/STRU | 15 + tests/18_SDFT_FAST/manifest.json | 56 + tests/18_SDFT_FAST/pseudo/C-0.7.UPF | 3295 +++++++++++++++++ tests/CMakeLists.txt | 2 + .../validation_tools/check_sdft_dos_inputs.py | 37 + .../validation_tools/check_sdft_fast.py | 124 + 109 files changed, 9550 insertions(+), 544 deletions(-) create mode 100644 source/source_base/unittests/test_math_chebyshev.cpp create mode 100644 source/source_io/module_output/output_context.h create mode 100644 source/source_pw/module_stodft/sto_math.h create mode 100644 source/source_pw/module_stodft/sto_spectral_bounds.cpp create mode 100644 source/source_pw/module_stodft/sto_spectral_bounds.h create mode 100644 source/source_pw/module_stodft/unittests/test_sto_math.cpp create mode 100644 source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp create mode 100644 source/source_pw/module_stodft/unittests/test_sto_spectral_bounds.cpp create mode 100644 source/source_pw/module_stodft/unittests/test_sto_spectral_bounds_mpi.cpp create mode 100644 tests/18_SDFT_FAST/01_C09_KS/INPUT create mode 100644 tests/18_SDFT_FAST/01_C09_KS/KPT create mode 100644 tests/18_SDFT_FAST/01_C09_KS/STRU create mode 100644 tests/18_SDFT_FAST/01_C09_KS/reference.json create mode 100644 tests/18_SDFT_FAST/01_C09_KS/result.ref create mode 100644 tests/18_SDFT_FAST/01_C09_KS/threshold create mode 100644 tests/18_SDFT_FAST/02_C348_MDFT/INPUT create mode 100644 tests/18_SDFT_FAST/02_C348_MDFT/KPT create mode 100644 tests/18_SDFT_FAST/02_C348_MDFT/STRU create mode 100644 tests/18_SDFT_FAST/02_C348_MDFT/reference.json create mode 100644 tests/18_SDFT_FAST/02_C348_MDFT/result.ref create mode 100644 tests/18_SDFT_FAST/02_C348_MDFT/threshold create mode 100644 tests/18_SDFT_FAST/03_C1400_SDFT/INPUT create mode 100644 tests/18_SDFT_FAST/03_C1400_SDFT/KPT create mode 100644 tests/18_SDFT_FAST/03_C1400_SDFT/STRU create mode 100644 tests/18_SDFT_FAST/03_C1400_SDFT/reference.json create mode 100644 tests/18_SDFT_FAST/03_C1400_SDFT/result.ref create mode 100644 tests/18_SDFT_FAST/03_C1400_SDFT/threshold create mode 100644 tests/18_SDFT_FAST/04_C348_METHOD1_MPI/INPUT create mode 100644 tests/18_SDFT_FAST/04_C348_METHOD1_MPI/KPT create mode 100644 tests/18_SDFT_FAST/04_C348_METHOD1_MPI/STRU create mode 100644 tests/18_SDFT_FAST/04_C348_METHOD1_MPI/reference.json create mode 100644 tests/18_SDFT_FAST/04_C348_METHOD1_MPI/result.ref create mode 100644 tests/18_SDFT_FAST/04_C348_METHOD1_MPI/threshold create mode 100644 tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/INPUT create mode 100644 tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/KPT create mode 100644 tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/STRU create mode 100644 tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/reference.json create mode 100644 tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/result.ref create mode 100644 tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/threshold create mode 100644 tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/INPUT create mode 100644 tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/KPT create mode 100644 tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/STRU create mode 100644 tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/reference.json create mode 100644 tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/result.ref create mode 100644 tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/threshold create mode 100644 tests/18_SDFT_FAST/07_C1400_GPU/INPUT create mode 100644 tests/18_SDFT_FAST/07_C1400_GPU/KPT create mode 100644 tests/18_SDFT_FAST/07_C1400_GPU/STRU create mode 100644 tests/18_SDFT_FAST/07_C1400_GPU/reference.json create mode 100644 tests/18_SDFT_FAST/07_C1400_GPU/result.ref create mode 100644 tests/18_SDFT_FAST/07_C1400_GPU/threshold create mode 100644 tests/18_SDFT_FAST/08_C1400_GPU_MPI/INPUT create mode 100644 tests/18_SDFT_FAST/08_C1400_GPU_MPI/KPT create mode 100644 tests/18_SDFT_FAST/08_C1400_GPU_MPI/STRU create mode 100644 tests/18_SDFT_FAST/08_C1400_GPU_MPI/reference.json create mode 100644 tests/18_SDFT_FAST/08_C1400_GPU_MPI/result.ref create mode 100644 tests/18_SDFT_FAST/08_C1400_GPU_MPI/threshold create mode 100644 tests/18_SDFT_FAST/09_C1400_LOW_DOS/INPUT create mode 100644 tests/18_SDFT_FAST/09_C1400_LOW_DOS/KPT create mode 100644 tests/18_SDFT_FAST/09_C1400_LOW_DOS/STRU create mode 100644 tests/18_SDFT_FAST/09_C1400_LOW_DOS/reference.json create mode 100644 tests/18_SDFT_FAST/09_C1400_LOW_DOS/result.ref create mode 100644 tests/18_SDFT_FAST/09_C1400_LOW_DOS/threshold create mode 100644 tests/18_SDFT_FAST/CASES_CPU.txt create mode 100644 tests/18_SDFT_FAST/CASES_GPU.txt create mode 100644 tests/18_SDFT_FAST/CMakeLists.txt create mode 100644 tests/18_SDFT_FAST/README.md create mode 100644 tests/18_SDFT_FAST/conductivity/INPUT create mode 100644 tests/18_SDFT_FAST/conductivity/KPT create mode 100644 tests/18_SDFT_FAST/conductivity/STRU create mode 100644 tests/18_SDFT_FAST/dos_inputs/dos_edelta_ev/INPUT create mode 100644 tests/18_SDFT_FAST/dos_inputs/dos_nche/INPUT create mode 100644 tests/18_SDFT_FAST/dos_inputs/dos_nche__method2/INPUT create mode 100644 tests/18_SDFT_FAST/dos_inputs/dos_sigma/INPUT create mode 100644 tests/18_SDFT_FAST/dos_inputs/npart_sto/INPUT create mode 100644 tests/18_SDFT_FAST/dos_inputs/valid/INPUT create mode 100644 tests/18_SDFT_FAST/dos_inputs/valid/KPT create mode 100644 tests/18_SDFT_FAST/dos_inputs/valid/STRU create mode 100644 tests/18_SDFT_FAST/manifest.json create mode 100644 tests/18_SDFT_FAST/pseudo/C-0.7.UPF create mode 100644 tests/integrate/validation_tools/check_sdft_dos_inputs.py create mode 100644 tests/integrate/validation_tools/check_sdft_fast.py diff --git a/source/Makefile.Objects b/source/Makefile.Objects index 502f29b9e05..c11442084a6 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -1070,6 +1070,7 @@ OBJS_SRCPW=h_ewald_pw.o\ sto_hsolver_pw.o\ sto_iter.o\ sto_che.o\ + sto_spectral_bounds.o\ sto_wf.o\ sto_func.o\ sto_forces.o\ diff --git a/source/source_base/math_chebyshev.cpp b/source/source_base/math_chebyshev.cpp index 9bf4e93aa7b..d8321f34765 100644 --- a/source/source_base/math_chebyshev.cpp +++ b/source/source_base/math_chebyshev.cpp @@ -156,9 +156,31 @@ REAL Chebyshev::ddot_real(const std::complex* psi_L, return result; } +template +void Chebyshev::prepare_nodes() +{ + if (!midpoint_nodes.empty()) { return; } + midpoint_nodes.resize(norder2); + trapezoid_nodes.resize(norder2); + midpoint_cos.resize(norder); + midpoint_sin.resize(norder); + for (int i = 0; i < norder2; ++i) + { + midpoint_nodes[i] = cos((i + 0.5) * ModuleBase::TWO_PI / norder2); + trapezoid_nodes[i] = cos(i * ModuleBase::TWO_PI / norder2); + } + for (int i = 0; i < norder; ++i) + { + const REAL phi = i * ModuleBase::PI / norder2; + midpoint_cos[i] = cos(phi); + midpoint_sin[i] = sin(phi); + } +} + template void Chebyshev::calcoef_real(std::function fun) { + this->prepare_nodes(); std::complex* pcoef = (std::complex*)this->fftw.ccoef; // three point = 2/3 M + 1/3 T; @@ -167,7 +189,7 @@ void Chebyshev::calcoef_real(std::function fun) //----------------------------------------------- for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun((REAL)cos((i + 0.5) * ModuleBase::TWO_PI / norder2)); + this->fftw.dcoef[i] = fun(midpoint_nodes[i]); } // this->fftw.dcoef --FFT--> fftw.pcoef @@ -175,14 +197,13 @@ void Chebyshev::calcoef_real(std::function fun) for (int i = 0; i < norder; ++i) { - REAL phi = i * ModuleBase::PI / norder2; if (i == 0) { - coefr_cpu[i] = (cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 2 / 3; + coefr_cpu[i] = (midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 2 / 3; } else { - coefr_cpu[i] = (cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 4 / 3; + coefr_cpu[i] = (midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 4 / 3; } } @@ -191,7 +212,7 @@ void Chebyshev::calcoef_real(std::function fun) //----------------------------------------------- for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun(cos(i * ModuleBase::TWO_PI / norder2)); + this->fftw.dcoef[i] = fun(trapezoid_nodes[i]); } // this->fftw.dcoef --FFT--> fftw.pcoef @@ -221,6 +242,7 @@ void Chebyshev::calcoef_real(std::function fun) template void Chebyshev::calcoef_complex(std::function(std::complex)> fun) { + this->prepare_nodes(); std::complex* pcoef = (std::complex*)this->fftw.ccoef; // three point = 2/3 M + 1/3 T; @@ -229,37 +251,35 @@ void Chebyshev::calcoef_complex(std::function(s //----------------------------------------------- for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun(cos((i + 0.5) * ModuleBase::TWO_PI / norder2)).real(); + this->fftw.dcoef[i] = fun(midpoint_nodes[i]).real(); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) { - REAL phi = i * ModuleBase::PI / norder2; if (i == 0) { - coefc_cpu[i].real((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 2 / 3); + coefc_cpu[i].real((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 2 / 3); } else { - coefc_cpu[i].real((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 4 / 3); + coefc_cpu[i].real((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 4 / 3); } } for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun(cos((i + 0.5) * ModuleBase::TWO_PI / norder2)).imag(); + this->fftw.dcoef[i] = fun(midpoint_nodes[i]).imag(); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) { - REAL phi = i * ModuleBase::PI / norder2; if (i == 0) { - coefc_cpu[i].imag((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 2 / 3); + coefc_cpu[i].imag((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 2 / 3); } else { - coefc_cpu[i].imag((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 4 / 3); + coefc_cpu[i].imag((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 4 / 3); } } @@ -268,7 +288,7 @@ void Chebyshev::calcoef_complex(std::function(s //----------------------------------------------- for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun(cos(i * ModuleBase::TWO_PI / norder2)).real(); + this->fftw.dcoef[i] = fun(trapezoid_nodes[i]).real(); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) @@ -285,7 +305,7 @@ void Chebyshev::calcoef_complex(std::function(s for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun(cos(i * ModuleBase::TWO_PI / norder2)).imag(); + this->fftw.dcoef[i] = fun(trapezoid_nodes[i]).imag(); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) @@ -311,6 +331,7 @@ void Chebyshev::calcoef_complex(std::function(s template void Chebyshev::calcoef_pair(std::function fun1, std::function fun2) { + this->prepare_nodes(); std::complex* pcoef = (std::complex*)this->fftw.ccoef; // three point = 2/3 M + 1/3 T; @@ -319,37 +340,35 @@ void Chebyshev::calcoef_pair(std::function fun1, std:: //----------------------------------------------- for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun1(cos((i + 0.5) * ModuleBase::TWO_PI / norder2)); + this->fftw.dcoef[i] = fun1(midpoint_nodes[i]); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) { - REAL phi = i * ModuleBase::PI / norder2; if (i == 0) { - coefc_cpu[i].real((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 2 / 3); + coefc_cpu[i].real((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 2 / 3); } else { - coefc_cpu[i].real((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 4 / 3); + coefc_cpu[i].real((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 4 / 3); } } for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun2(cos((i + 0.5) * ModuleBase::TWO_PI / norder2)); + this->fftw.dcoef[i] = fun2(midpoint_nodes[i]); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) { - REAL phi = i * ModuleBase::PI / norder2; if (i == 0) { - coefc_cpu[i].imag((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 2 / 3); + coefc_cpu[i].imag((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 2 / 3); } else { - coefc_cpu[i].imag((cos(phi) * pcoef[i].real() + sin(phi) * pcoef[i].imag()) / norder2 * 4 / 3); + coefc_cpu[i].imag((midpoint_cos[i] * pcoef[i].real() + midpoint_sin[i] * pcoef[i].imag()) / norder2 * 4 / 3); } } @@ -358,7 +377,7 @@ void Chebyshev::calcoef_pair(std::function fun1, std:: //----------------------------------------------- for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun1(cos(i * ModuleBase::TWO_PI / norder2)); + this->fftw.dcoef[i] = fun1(trapezoid_nodes[i]); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) @@ -375,7 +394,7 @@ void Chebyshev::calcoef_pair(std::function fun1, std:: for (int i = 0; i < norder2; ++i) { - this->fftw.dcoef[i] = fun2(cos(i * ModuleBase::TWO_PI / norder2)); + this->fftw.dcoef[i] = fun2(trapezoid_nodes[i]); } this->fftw.execute_fftw(); for (int i = 0; i < norder; ++i) @@ -546,8 +565,6 @@ void Chebyshev::calpolyvec_complex( assert(N >= 0 && LDA >= N); const int ndmxt = LDA * m; - std::complex* arraynp1 = polywaveout + 2 * ndmxt; - std::complex* arrayn = polywaveout + ndmxt; std::complex* arrayn_1 = polywaveout; std::complex*tmpin = wavein, *tmpout = arrayn_1; @@ -559,6 +576,14 @@ void Chebyshev::calpolyvec_complex( tmpout += LDA; } + if (norder == 1) + { + return; + } + + std::complex* arraynp1 = polywaveout + 2 * ndmxt; + std::complex* arrayn = polywaveout + ndmxt; + // 1-st order funA(arrayn_1, arrayn, m); @@ -581,6 +606,25 @@ void Chebyshev::tracepolyA( const int LDA, const int m) { + const std::function*)> observe_final; + this->tracepolyA(funA, wavein, N, LDA, m, observe_final); +} + +template +void Chebyshev::tracepolyA( + std::function*, std::complex*, const int)> funA, + std::complex* wavein, + const int N, + const int LDA, + const int m, + const std::function*)>& observe_final) +{ + polytrace[0] = this->ddot_real(wavein, wavein, N, LDA, m); + if (norder == 1) + { + if (observe_final) { observe_final(wavein); } + return; + } std::complex* arraynp1 = nullptr; std::complex* arrayn = nullptr; std::complex* arrayn_1 = nullptr; @@ -604,7 +648,6 @@ void Chebyshev::tracepolyA( funA(arrayn_1, arrayn, m); - polytrace[0] = this->ddot_real(wavein, wavein, N, LDA, m); polytrace[1] = this->ddot_real(wavein, arrayn, N, LDA, m); // more than 1-st orders @@ -618,6 +661,8 @@ void Chebyshev::tracepolyA( arraynp1 = tem; } + if (observe_final) { observe_final(arrayn); } + delmem_complex_op()(arraynp1); delmem_complex_op()(arrayn); delmem_complex_op()(arrayn_1); diff --git a/source/source_base/math_chebyshev.h b/source/source_base/math_chebyshev.h index cd66b6a1106..d0c62121e87 100644 --- a/source/source_base/math_chebyshev.h +++ b/source/source_base/math_chebyshev.h @@ -7,6 +7,7 @@ #include #include +#include namespace ModuleBase { @@ -140,6 +141,15 @@ class Chebyshev const int LDA = 1, const int m = 1); + // Observe T_{norder-1}(A) wavein before its workspace is released. + // The pointer uses this Chebyshev object's device and is valid only in the callback. + void tracepolyA(std::function*, std::complex*, const int)> funA, + std::complex* wavein, + const int N, + const int LDA, + const int m, + const std::function*)>& observe_final); + // get T_n(x) void getpolyval(REAL x, REAL* polyval, const int N); @@ -225,6 +235,12 @@ class Chebyshev const int m = 1); private: + void prepare_nodes(); + std::vector midpoint_nodes; + std::vector trapezoid_nodes; + std::vector midpoint_cos; + std::vector midpoint_sin; + Device* ctx = {}; base_device::DEVICE_CPU* cpu_ctx = {}; using ct_Device = typename container::PsiToContainer::type; diff --git a/source/source_base/unittests/CMakeLists.txt b/source/source_base/unittests/CMakeLists.txt index 5381e4f9f59..ee6ecc8a0c6 100644 --- a/source/source_base/unittests/CMakeLists.txt +++ b/source/source_base/unittests/CMakeLists.txt @@ -1,6 +1,12 @@ abacus_disable_feature_definitions(__MPI) abacus_copy_test_files(support) +AddTest( + TARGET MODULE_BASE_chebyshev_final_vector + LIBS parameter base device container + SOURCES test_math_chebyshev.cpp +) + addtest( TARGET MODULE_BASE_csr_reader LIBS parameter base device diff --git a/source/source_base/unittests/test_math_chebyshev.cpp b/source/source_base/unittests/test_math_chebyshev.cpp new file mode 100644 index 00000000000..0702c443b89 --- /dev/null +++ b/source/source_base/unittests/test_math_chebyshev.cpp @@ -0,0 +1,118 @@ +#include "source_base/math_chebyshev.h" +#include "gtest/gtest.h" + +#include +#include +#include + +namespace +{ +double exact_polynomial(const double x, const int order) +{ + if (x > 1.0) { return std::cosh(order * std::acosh(x)); } + return std::cos(order * std::acos(x)); +} + +void check_final_vector(const int orders, const int bands, const double edge) +{ + const int n = 3; + const int lda = 5; + const double eigenvalues[n] = {-0.8, 0.3, edge}; + std::vector> initial(lda * bands, 0.0); + for (int ib = 0; ib < bands; ++ib) + { + for (int ig = 0; ig < n; ++ig) { initial[ib * lda + ig] = {double(ib + 1), double(ig + 1)}; } + } + int applications = 0; + auto apply = [&](std::complex* in, std::complex* out, const int count) { + ++applications; + for (int ib = 0; ib < count; ++ib) + { + for (int ig = 0; ig < n; ++ig) { out[ib * lda + ig] = eigenvalues[ig] * in[ib * lda + ig]; } + } + }; + int observations = 0; + auto observe = [&](const std::complex* last) { + ++observations; + for (int ib = 0; ib < bands; ++ib) + { + for (int ig = 0; ig < n; ++ig) + { + const auto expected = exact_polynomial(eigenvalues[ig], orders - 1) * initial[ib * lda + ig]; + EXPECT_NEAR(std::abs(last[ib * lda + ig] - expected), 0.0, 1e-9 * std::max(1.0, std::abs(expected))); + } + } + }; + ModuleBase::Chebyshev che(orders); + che.tracepolyA(apply, initial.data(), n, lda, bands, observe); + EXPECT_EQ(observations, 1); + EXPECT_EQ(applications, orders - 1); + for (int order = 0; order < orders; ++order) + { + double expected = 0.0; + for (int ib = 0; ib < bands; ++ib) + { + for (int ig = 0; ig < n; ++ig) + { + expected += std::norm(initial[ib * lda + ig]) * exact_polynomial(eigenvalues[ig], order); + } + } + EXPECT_NEAR(che.polytrace[order], expected, 1e-9 * std::max(1.0, std::abs(expected))); + } + applications = 0; + std::vector> all(orders * lda * bands, 0.0); + che.calpolyvec_complex(apply, initial.data(), all.data(), n, lda, bands); + const auto* last = all.data() + (orders - 1) * lda * bands; + observe(last); + EXPECT_EQ(applications, orders - 1); +} +} + +TEST(ChebyshevFinalVector, ConstantAndLinearOrders) +{ + check_final_vector(1, 1, 0.9); + check_final_vector(2, 1, 0.9); +} + +TEST(ChebyshevFinalVector, PaddedMultipleVectors) +{ + check_final_vector(1, 3, 0.9); + check_final_vector(2, 3, 0.9); + check_final_vector(32, 3, 0.9); +} + +TEST(ChebyshevFinalVector, OutsideSpectrumGrowthWithoutExtraApplications) +{ + check_final_vector(64, 1, 1.02); + check_final_vector(64, 3, 1.02); +} + +// Analytic Chebyshev coefficients check reuse after changing the target function. +TEST(ChebyshevCoefficients, CachedNodesDoNotCacheFunctionValues) +{ + ModuleBase::Chebyshev che(16); + for (int degree = 0; degree < 8; ++degree) + { + auto real_fun = [=](double x) { return std::cos(degree * std::acos(x)); }; + auto imag_fun = [=](double x) { return 2.0 * std::cos((degree + 1) * std::acos(x)); }; + che.calcoef_real(real_fun); + for (int i = 0; i < 16; ++i) + { + const double expected = i == degree ? 1.0 : 0.0; + EXPECT_NEAR(che.coef_real[i], expected, 2e-14); + } + che.calcoef_pair(real_fun, imag_fun); + std::vector> paired(che.coef_complex, che.coef_complex + 16); + che.calcoef_complex([=](std::complex x) { + return std::complex(real_fun(x.real()), imag_fun(x.real())); + }); + for (int i = 0; i < 16; ++i) + { + const double real_expected = i == degree ? 1.0 : 0.0; + const double imag_expected = i == degree + 1 ? 2.0 : 0.0; + EXPECT_NEAR(paired[i].real(), real_expected, 2e-14); + EXPECT_NEAR(paired[i].imag(), imag_expected, 2e-14); + EXPECT_NEAR(std::abs(che.coef_complex[i] - paired[i]), 0.0, 2e-14); + } + } +} diff --git a/source/source_esolver/esolver_factory.cpp b/source/source_esolver/esolver_factory.cpp index 572cbdef7ff..07c167bd5c4 100644 --- a/source/source_esolver/esolver_factory.cpp +++ b/source/source_esolver/esolver_factory.cpp @@ -153,7 +153,7 @@ std::string determine_type(const Input_para &inp) } // Some API to operate E_Solver -ESolver *init_esolver(const Input_para &inp) +ESolver *init_esolver(const Input_para &inp, const ModuleIO::OutputContext& output) { // determine type of esolver based on INPUT information const std::string esolver_type = determine_type(inp); @@ -226,7 +226,7 @@ ESolver *init_esolver(const Input_para &inp) // } // else // { - return new ESolver_SDFT_PW, base_device::DEVICE_GPU>(); + return new ESolver_SDFT_PW, base_device::DEVICE_GPU>(output); // } } #endif @@ -236,7 +236,7 @@ ESolver *init_esolver(const Input_para &inp) // } // else // { - return new ESolver_SDFT_PW, base_device::DEVICE_CPU>(); + return new ESolver_SDFT_PW, base_device::DEVICE_CPU>(output); // } } #ifdef __LCAO diff --git a/source/source_esolver/esolver_factory.h b/source/source_esolver/esolver_factory.h index 801fe94d9b2..5b5e2c95a34 100644 --- a/source/source_esolver/esolver_factory.h +++ b/source/source_esolver/esolver_factory.h @@ -2,6 +2,7 @@ #define ESOLVER_FACTORY_H #include +#include "source_io/module_output/output_context.h" struct Input_para; @@ -32,7 +33,7 @@ std::string determine_type(const Input_para &inp); * @param [in] inp Input parameters used to select and configure the ESolver. * @return [out] A pointer to the newly created ESolver object. */ -ESolver *init_esolver(const Input_para &inp); +ESolver *init_esolver(const Input_para &inp, const ModuleIO::OutputContext& output); } // namespace ModuleESolver diff --git a/source/source_esolver/esolver_sdft_pw.cpp b/source/source_esolver/esolver_sdft_pw.cpp index d648da97604..29a591f7567 100644 --- a/source/source_esolver/esolver_sdft_pw.cpp +++ b/source/source_esolver/esolver_sdft_pw.cpp @@ -3,6 +3,7 @@ #include "source_base/global_variable.h" #include "source_base/memory_recorder.h" #include "source_base/parallel_comm.h" +#include "source_base/parallel_reduce.h" #include "source_estate/module_charge/chg_symm.h" #include "source_hsolver/diago_iter_assist.h" #include "source_hsolver/diago_params.h" @@ -20,7 +21,8 @@ namespace ModuleESolver { template -ESolver_SDFT_PW::ESolver_SDFT_PW() +ESolver_SDFT_PW::ESolver_SDFT_PW(const ModuleIO::OutputContext& output_in) + : output(output_in) { this->classname = "ESolver_SDFT_PW"; this->basisname = "PW"; @@ -162,7 +164,7 @@ void ESolver_SDFT_PW::hamilt2rho_single( sto_hsolver_pw_obj.solve( ucell, static_cast *>(this->p_hamilt), *this->stp.template get_psi_t(), - this->stp.psi_cpu[0], this->pelec, this->pw_wfc, this->stowf, istep, iter, GlobalV::ofs_running, skip_charge); + this->stp.psi_cpu[0], this->pelec, this->pw_wfc, this->stowf, istep, iter, this->output.log, skip_charge, this->inp_->smearing_sigma); // set_diagethr need it this->esolver_KS_ne = sto_hsolver_pw_obj.stoiter.KS_ne; @@ -246,10 +248,11 @@ void ESolver_SDFT_PW::after_all_runners(BaseCell &basecell) Sto_DOS sto_dos( this->pw_wfc, &this->kv, this->pelec, reinterpret_cast> *>(this->stp.psi_cpu), reinterpret_cast> *>(this->p_hamilt), this->stoche, - reinterpret_cast, base_device::DEVICE_CPU> *>(&stowf)); + reinterpret_cast, base_device::DEVICE_CPU> *>(&stowf), this->output); sto_dos.decide_param( this->inp_->dos_nche, this->inp_->emin_sto, this->inp_->emax_sto, PARAM.globalv.dos_setemin, - PARAM.globalv.dos_setemax, this->inp_->dos_emin_ev, this->inp_->dos_emax_ev, this->inp_->dos_scale); + PARAM.globalv.dos_setemax, this->inp_->dos_emin_ev, this->inp_->dos_emax_ev, this->inp_->dos_scale, + this->inp_->dos_sigma); sto_dos.caldos(this->inp_->dos_sigma, this->inp_->dos_edelta_ev, this->inp_->npart_sto); } @@ -259,7 +262,7 @@ void ESolver_SDFT_PW::after_all_runners(BaseCell &basecell) Sto_EleCond sto_elecond( &ucell, &this->kv, this->pelec, this->pw_wfc, this->stp.template get_psi_t(), &this->ppcell, static_cast, Device> *>(this->p_hamilt), this->stoche, &stowf); - sto_elecond.decide_nche(this->inp_->cond_dt, 1e-8, this->nche_sto, this->inp_->emin_sto, this->inp_->emax_sto); + sto_elecond.decide_nche(this->inp_->cond_dt, 1e-8, this->nche_sto, this->inp_->emin_sto, this->inp_->emax_sto, this->output.log); sto_elecond.sKG( this->inp_->cond_smear, this->inp_->cond_fwhm, this->inp_->cond_wcut, this->inp_->cond_dw, this->inp_->cond_dt, this->inp_->cond_nonlocal, this->inp_->npart_sto); diff --git a/source/source_esolver/esolver_sdft_pw.h b/source/source_esolver/esolver_sdft_pw.h index 680d66dbff4..6daf8ad2994 100644 --- a/source/source_esolver/esolver_sdft_pw.h +++ b/source/source_esolver/esolver_sdft_pw.h @@ -2,6 +2,7 @@ #define ESOLVER_SDFT_PW_H #include "esolver_ks_pw.h" +#include "source_io/module_output/output_context.h" #include "source_pw/module_stodft/sto_che.h" #include "source_pw/module_stodft/sto_hamilt_pw.h" #include "source_pw/module_stodft/sto_iter.h" @@ -17,7 +18,7 @@ class ESolver_SDFT_PW : public ESolver_KS_PW using Real = typename GetTypeReal::type; public: - ESolver_SDFT_PW(); + ESolver_SDFT_PW(const ModuleIO::OutputContext& output); ~ESolver_SDFT_PW(); void before_all_runners(BaseCell &basecell, const Input_para &inp) override; @@ -53,6 +54,7 @@ class ESolver_SDFT_PW : public ESolver_KS_PW virtual void after_all_runners(BaseCell &basecell) override; private: + const ModuleIO::OutputContext output; int nche_sto; ///< norder of Chebyshev int method_sto; ///< method of SDFT }; diff --git a/source/source_io/module_output/output_context.h b/source/source_io/module_output/output_context.h new file mode 100644 index 00000000000..7fc45cbe70e --- /dev/null +++ b/source/source_io/module_output/output_context.h @@ -0,0 +1,21 @@ +#ifndef MODULEIO_OUTPUT_CONTEXT_H +#define MODULEIO_OUTPUT_CONTEXT_H + +#include +#include + +namespace ModuleIO +{ +// Application-owned output destinations and parallel identity, passed explicitly +// to solvers. No workflow state or global lookups are kept in this context. +struct OutputContext +{ + std::string directory; + std::string wavefunction_directory; + std::ofstream& log; + int rank; + int pool; + int band_group; +}; +} +#endif diff --git a/source/source_io/module_parameter/read_inp_postproc.cpp b/source/source_io/module_parameter/read_inp_postproc.cpp index 3c83d064af7..f42b88280c2 100644 --- a/source/source_io/module_parameter/read_inp_postproc.cpp +++ b/source/source_io/module_parameter/read_inp_postproc.cpp @@ -11,6 +11,7 @@ void ReadInput::item_postprocess() // Please preserve this ordering when adding new parameters. { Input_Item item("dos_edelta_ev"); + item.domain.set_rule("value>0"); item.annotation = "delta energy for dos"; item.category = "Density of states"; item.type = "Real"; @@ -22,6 +23,7 @@ void ReadInput::item_postprocess() } { Input_Item item("dos_sigma"); + item.domain.set_rule("value>0"); item.annotation = "gauss b coefficeinet(default=0.07)"; item.category = "Density of states"; item.type = "Real"; @@ -79,14 +81,12 @@ void ReadInput::item_postprocess() } { Input_Item item("dos_nche"); + item.domain.add_requirement("method_sto==2", "dos_nche<=46340"); + item.domain.set_rule("value>=1"); item.annotation = "orders of Chebyshev expansions for dos"; item.category = "Density of states"; item.type = "Integer"; - item.description = "The order of Chebyshev expansions when using Stochastic Density Functional Theory (SDFT) to calculate DOS." - "\n\nIt must be at least 2. The order has to grow with the ratio between the spectral range and " - "`dos_sigma`: resolving a Gaussian of width `dos_sigma` over a range of a few thousand eV can " - "require an order of 1e5 or more, so a value that is too small gives an under-resolved curve. " - "The code warns when the requested order cannot resolve `range/dos_sigma`."; + item.description = "The number of Chebyshev terms for stochastic DOS (at least 1). Method 2 supports dos_nche <= 46340 because its Gram matrix uses int indexing; vector/BLAS dimensions are checked before allocation. A narrower output window does not reduce the expansion order needed to resolve dos_sigma."; item.default_value = "100"; item.unit = ""; read_sync_int(input.dos_nche); diff --git a/source/source_io/module_parameter/read_input_item_sdft.cpp b/source/source_io/module_parameter/read_input_item_sdft.cpp index 2bb794c91f5..6afcac4402a 100644 --- a/source/source_io/module_parameter/read_input_item_sdft.cpp +++ b/source/source_io/module_parameter/read_input_item_sdft.cpp @@ -165,6 +165,7 @@ void ReadInput::item_sdft() } { Input_Item item("npart_sto"); + item.domain.set_rule("value>=1"); item.annotation = "Reduce memory when calculating Stochastic DOS"; item.category = "Electronic structure (SDFT)"; item.type = "Integer"; diff --git a/source/source_main/driver_run.cpp b/source/source_main/driver_run.cpp index 0ab161b9d6f..6c1ddbfa6aa 100644 --- a/source/source_main/driver_run.cpp +++ b/source/source_main/driver_run.cpp @@ -50,14 +50,17 @@ void Driver::driver_run() const std::string cal = PARAM.inp.calculation; const Input_para& input = PARAM.inp; + const ModuleIO::OutputContext output{PARAM.globalv.global_out_dir, PARAM.globalv.global_psi_dir, + GlobalV::ofs_running, GlobalV::MY_RANK, + GlobalV::MY_POOL, GlobalV::MY_BNDGROUP}; this->init_hardware(); - ModuleESolver::ESolver* p_esolver = ModuleESolver::init_esolver(PARAM.inp); + ModuleESolver::ESolver* p_esolver = ModuleESolver::init_esolver(input, output); const bool direct_mdcell = input.esolver_type == "lj" || input.esolver_type == "dp" || input.esolver_type == "nep" || input.esolver_type == "snap"; UnitCell ucell; bool ucell_initialized = false; - const auto initialize_ucell = [&ucell, &ucell_initialized, &input]() { + const auto initialize_ucell = [&ucell, &ucell_initialized, &input, &output]() { if (ucell_initialized) { return; @@ -65,7 +68,7 @@ void Driver::driver_run() ucell.setup_from_input(input.latname, input.ntype, input.lmaxmax, input.init_vel, input.fixed_axes); ucell.setup_cell(PARAM.globalv.global_in_stru, - GlobalV::ofs_running, + output.log, input.symmetry_prec, input.dfthalf_type, input.pseudo_dir, @@ -101,8 +104,8 @@ void Driver::driver_run() input.cell_replica, input.mdp.md_restart, input.mdp.md_neighbor_skin, - GlobalV::ofs_running); - p_esolver->before_all_runners(mdcell, PARAM.inp); + output.log); + p_esolver->before_all_runners(mdcell, input); Run_MD::md_line(mdcell, p_esolver, PARAM, decomp); p_esolver->after_all_runners(mdcell); } @@ -110,7 +113,7 @@ void Driver::driver_run() { initialize_ucell(); MDCellAdapter::initialize_backed_from_unitcell(mdcell, decomp, ucell); - p_esolver->before_all_runners(ucell, PARAM.inp); + p_esolver->before_all_runners(ucell, input); Run_MD::md_line(mdcell, p_esolver, PARAM, decomp); p_esolver->after_all_runners(ucell); } @@ -118,11 +121,11 @@ void Driver::driver_run() else { initialize_ucell(); - p_esolver->before_all_runners(ucell, PARAM.inp); + p_esolver->before_all_runners(ucell, input); if (cal == "scf" || cal == "relax" || cal == "cell-relax" || cal == "nscf") { Relax_Driver rl_driver; - rl_driver.relax_driver(p_esolver, ucell, PARAM.inp, GlobalV::ofs_running); + rl_driver.relax_driver(p_esolver, ucell, input, output.log); } else if (cal == "get_s") { diff --git a/source/source_pw/module_stodft/CMakeLists.txt b/source/source_pw/module_stodft/CMakeLists.txt index 2ac12a5466b..1a3b0110833 100644 --- a/source/source_pw/module_stodft/CMakeLists.txt +++ b/source/source_pw/module_stodft/CMakeLists.txt @@ -5,6 +5,7 @@ list( sto_hsolver_pw.cpp sto_iter.cpp sto_che.cpp + sto_spectral_bounds.cpp sto_wf.cpp sto_func.cpp sto_forces.cpp diff --git a/source/source_pw/module_stodft/sto_che.h b/source/source_pw/module_stodft/sto_che.h index 2c142cf375d..fe2f5427f04 100644 --- a/source/source_pw/module_stodft/sto_che.h +++ b/source/source_pw/module_stodft/sto_che.h @@ -54,6 +54,13 @@ class StoChe REAL emax_sto = 0.0; ///< maximum energy for normalization REAL emin_sto = 0.0; ///< minimum energy for normalization + // NOTE: min V_eff alone omits the signed nonlocal contribution, and + // ecutwfc + max V_eff is only an + // upper bound once lambda_max(V_NL) is added. The rigorous bracket is therefore + // [min V_eff + lambda_min(V_NL), ecutwfc + max V_eff + lambda_max(V_NL)], built in + // StoHamiltPW::nonlocal_bounds(); these two values only provide the local part. + REAL emin_analytic = 0.0; ///< min of V_eff (local part of the bracket, not a bound of H alone) + REAL emax_analytic = 0.0; ///< ecutwfc + max of V_eff (local part of the upper bound) private: Device* ctx = {}; diff --git a/source/source_pw/module_stodft/sto_dos.cpp b/source/source_pw/module_stodft/sto_dos.cpp index 0da59f1965a..70b795ef485 100644 --- a/source/source_pw/module_stodft/sto_dos.cpp +++ b/source/source_pw/module_stodft/sto_dos.cpp @@ -4,28 +4,24 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "source_io/module_parameter/parameter.h" +#include "source_io/module_output/write_notice.h" #include "sto_tool.h" #include -#include -#include #include - +#include namespace { -/// Single entry point for the DOS diagnostics of this file. Keeping the -/// running-log reference here (instead of at every call site) keeps the global -/// dependency of this module to one place; none of these messages aborts a run. -void dos_log(const std::string& message, const bool also_stdout) +bool dos_method2_dimensions_supported(const int order, const int basis, const int bands) { - GlobalV::ofs_running << message << std::endl; - if (also_stdout) - { - std::cout << message << std::endl; - } -} -} // namespace + const int limit = std::numeric_limits::max(); + if (order < 1 || basis < 0 || bands < 0 || order > limit / order) { return false; } + if (bands == 0 || basis == 0) { return true; } + // Avoid overflowing even the check itself, before any multiplication. + if (basis > limit / bands) { return false; } + const int vector_size = basis * bands; + return vector_size <= limit / 2 && vector_size <= limit / order; +}} template Sto_DOS::~Sto_DOS() @@ -39,7 +35,9 @@ Sto_DOS::Sto_DOS(ModulePW::PW_Basis_K* p_wfcpw_in, psi::Psi>* p_psi_in, hamilt::Hamilt>* p_hamilt_in, StoChe& stoche, - Stochastic_WF, base_device::DEVICE_CPU>* p_stowf_in) + Stochastic_WF, base_device::DEVICE_CPU>* p_stowf_in, + const ModuleIO::OutputContext& output_in) + : output(output_in) { this->p_wfcpw = p_wfcpw_in; this->p_kv = p_kv_in; @@ -49,10 +47,7 @@ Sto_DOS::Sto_DOS(ModulePW::PW_Basis_K* p_wfcpw_in, this->p_hamilt_sto = static_cast>*>(p_hamilt_in); this->p_stowf = p_stowf_in; this->nbands_ks = p_psi_in->get_nbands(); - // Stochastic_WF::nchi is now initialized by allocate_chi0() (MDFT) and - // init_com_orbitals() (complete basis). Keep a safe fallback for old - // restart paths where only nchip is available. - this->nbands_sto = (p_stowf_in->nchi > 0) ? p_stowf_in->nchi : p_stowf_in->nchip_max; + this->nbands_sto = p_stowf_in->nchi; this->method_sto = stoche.method_sto; this->stofunc.set_E_range((double*)&stoche.emin_sto, (double*)&stoche.emax_sto); } @@ -65,174 +60,119 @@ void Sto_DOS::decide_param(const int& dos_nche, const bool& dos_setemax, const double& dos_emin_ev, const double& dos_emax_ev, - const double& dos_scale) + const double& dos_scale, + const double& dos_sigma) { this->dos_nche = dos_nche; - if (this->dos_nche < 2) - { - ModuleBase::WARNING_QUIT("Sto_DOS", "dos_nche should be at least 2."); - } - // If emin_sto/emax_sto are left at zero, keep the bounds already found by - // the SCF range check instead of resetting them to the bare input defaults. - // The repeated reset discarded a valid converged range and made the DOS - // range check depend on the random test vector alone. - double try_emin = emin_sto; - double try_emax = emax_sto; - if (try_emin == 0.0) + // 1) The interval is a property of the spectrum: inherit the one the SCF stage + // decided (and refined while the density evolved). When the input provides + // emin_sto/emax_sto explicitly, those are kept and only widened if needed. + double try_emin = *p_hamilt_sto->emin; + if (emin_sto != 0.0) { try_emin = std::min(try_emin, emin_sto); } + double try_emax = std::max(*p_hamilt_sto->emax, emax_sto); + *p_hamilt_sto->emin = try_emin; + *p_hamilt_sto->emax = try_emax; + if (!(try_emax > try_emin)) { - try_emin = *p_hamilt_sto->emin; - } - if (try_emax == 0.0) - { - try_emax = *p_hamilt_sto->emax; - } - - check_che_op()( - this->dos_nche, - try_emin, - try_emax, - this->nbands_sto, - this->p_kv, - reinterpret_cast, Device>*>(this->p_stowf), - reinterpret_cast, Device>*>(this->p_hamilt_sto)); - - // The stochastic range check learns only the high-energy end reliably. - // The lowest deterministic KS eigenvalue is a much safer lower bound; if - // the automatic Emin lies above it, the Chebyshev interval would exclude - // occupied states and T_n(H) would grow exponentially outside [-1,1]. - // Extending the interval below the lowest eigenvalue is always harmless. - double det_emin = std::numeric_limits::max(); - bool has_det_emin = false; - if (this->p_elec != nullptr) - { - const auto& ekb = this->p_elec->ekb; - for (int ik = 0; ik < ekb.nr; ++ik) - { - for (int ib = 0; ib < ekb.nc; ++ib) - { - const double e = ekb(ik, ib); - if (std::isfinite(e)) - { - det_emin = std::min(det_emin, e); - has_det_emin = true; - } - } - } - } -#ifdef __MPI - double global_det_emin = has_det_emin ? det_emin : std::numeric_limits::max(); - Parallel_Reduce::reduce_min(global_det_emin); - if (global_det_emin < std::numeric_limits::max()) - { - det_emin = global_det_emin; - has_det_emin = true; - } -#endif - if (has_det_emin) - { - const double margin_ry = 1.0e-3; - const double safe_emin = det_emin - margin_ry; - if (safe_emin < *p_hamilt_sto->emin) - { - std::ostringstream reset_msg; - reset_msg << " DOS: reset Chebyshev Emin from " << *p_hamilt_sto->emin << " Ry to " << safe_emin - << " Ry (lowest KS eigenvalue = " << det_emin << " Ry)"; - dos_log(reset_msg.str(), false); - *p_hamilt_sto->emin = safe_emin; - } - } - if (!std::isfinite(*p_hamilt_sto->emax) || *p_hamilt_sto->emax <= *p_hamilt_sto->emin) - { - *p_hamilt_sto->emax = *p_hamilt_sto->emin + 1.0; + check_che_op()(this->dos_nche, try_emin, try_emax, + this->p_kv, reinterpret_cast, Device>*>(this->p_stowf), + reinterpret_cast, Device>*>(this->p_hamilt_sto), this->output.log); } + this->refresh_bounds(); + this->fixed_emin = dos_setemin; + this->fixed_emax = dos_setemax; + this->window_scale = dos_scale; + this->emin = dos_emin_ev; + this->emax = dos_emax_ev; + this->update_window(dos_sigma); +} - if (dos_setemax) - { - this->emax = dos_emax_ev; - } - else - { - this->emax = *p_hamilt_sto->emax * ModuleBase::Ry_to_eV; - } - if (dos_setemin) - { - this->emin = dos_emin_ev; - } - else +template +void Sto_DOS::refresh_bounds() +{ + ModuleBase::timer::start("Sto_DOS", "refresh_bounds"); + // SCF updates the potential after its last spectral estimate. Track those + // endpoint shifts even when they are too small for a growth probe to resolve. + for (int ik = 0; ik < p_kv->get_nks(); ++ik) { - this->emin = *p_hamilt_sto->emin * ModuleBase::Ry_to_eV; + p_hamilt_sto->updateHk(ik); + auto apply = [this](std::complex* in, std::complex* out, const int bands) { + p_hamilt_sto->hPsi(in, out, bands); + }; + const unsigned probe_seed = static_cast(ik); + const auto bounds = ModuleIO::lanczos_spectral_bounds( + apply, p_wfcpw->npwk_max, 30, 1e-4, 0.0, p_wfcpw->poolrank, probe_seed, false, true, nullptr, p_kv->ngk[ik]); + *p_hamilt_sto->emin = std::min(*p_hamilt_sto->emin, bounds.emin); + *p_hamilt_sto->emax = std::max(*p_hamilt_sto->emax, bounds.emax); } + Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); + Parallel_Reduce::reduce_max(*p_hamilt_sto->emax); + ModuleBase::timer::end("Sto_DOS", "refresh_bounds"); +} - if (!dos_setemax && !dos_setemin) +template +void Sto_DOS::update_window(const double dos_sigma) +{ + if (!fixed_emin) { emin = *p_hamilt_sto->emin * ModuleBase::Ry_to_eV; } + if (!fixed_emax) { emax = *p_hamilt_sto->emax * ModuleBase::Ry_to_eV; } + if (!fixed_emin && !fixed_emax) { - double delta = (emax - emin) * dos_scale; - this->emax = emax + delta / 2.0; - this->emin = emin - delta / 2.0; + const double padding = 0.5 * (emax - emin) * window_scale + 3.0 * dos_sigma; + emin -= padding; + emax += padding; } if (!std::isfinite(this->emin) || !std::isfinite(this->emax) || this->emax <= this->emin) { ModuleBase::WARNING_QUIT("Sto_DOS", "Invalid DOS energy range: dos_emax_ev must be larger than dos_emin_ev."); } +} - // The Chebyshev interval is a property of the spectrum and is kept as it is: - // widening it to fit the requested output window would reduce the resolution - // of a fixed-order expansion and could hide a peak that a narrower interval - // resolves. A requested window that sticks out of the interval is therefore - // clipped to it (the `dos_scale` widening above makes that routine) and the - // change is reported, because energies outside the interval cannot be - // represented by the expansion at all. - const double interval_emin_ev = *p_hamilt_sto->emin * ModuleBase::Ry_to_eV; - const double interval_emax_ev = *p_hamilt_sto->emax * ModuleBase::Ry_to_eV; - const double requested_emin_ev = this->emin; - const double requested_emax_ev = this->emax; - const double clipped_emin_ev = std::max(requested_emin_ev, interval_emin_ev); - const double clipped_emax_ev = std::min(requested_emax_ev, interval_emax_ev); - // The `dos_scale` widening above intentionally makes the window a little wider - // than the spectrum, so a sub-percent clip is expected and is not reported; - // only a window that really asks for energies outside the interval is. - const double interval_span_ev = interval_emax_ev - interval_emin_ev; - const double dropped_ev - = std::max(requested_emin_ev - clipped_emin_ev, clipped_emax_ev - requested_emax_ev); - const bool report_clip = dropped_ev > 0.01 * interval_span_ev; - if (clipped_emax_ev > clipped_emin_ev) +namespace +{ +// Check the same first two local orbitals as the former standalone probe, using +// the highest order actually needed by DOS. Padding is excluded from each norm. +double dos_polynomial_growth(const std::complex* initial, + const std::complex* last, + const int npw, + const int lda, + const int probes) +{ + double norms[4] = {0.0, 0.0, 0.0, 0.0}; + for (int ib = 0; ib < probes; ++ib) { - // Always clip, so that |t| <= 1 holds by construction for every output - // energy. Only a clip that removes a visible part of the window is - // reported, because `dos_scale` intentionally widens the window by a - // fraction of a percent. - if (report_clip) + for (int ig = 0; ig < npw; ++ig) { - std::ostringstream clip_msg; - clip_msg << " DOS: output window clipped from [" << requested_emin_ev << ", " << requested_emax_ev << "] to [" - << clipped_emin_ev << ", " << clipped_emax_ev << "] eV to stay inside the Chebyshev interval [" - << interval_emin_ev << ", " << interval_emax_ev << "] eV"; - dos_log(clip_msg.str(), false); + norms[2 * ib] += std::norm(initial[ib * lda + ig]); + norms[2 * ib + 1] += std::norm(last[ib * lda + ig]); } - this->emin = clipped_emin_ev; - this->emax = clipped_emax_ev; } - - std::ostringstream range_msg; - range_msg << " DOS: Chebyshev range = [" << *p_hamilt_sto->emin << ", " << *p_hamilt_sto->emax - << "] Ry; output window = [" << this->emin << ", " << this->emax << "] eV"; - dos_log(range_msg.str(), false); + Parallel_Reduce::reduce_pool(norms, 2 * probes); + double growth = 0.0; + for (int ib = 0; ib < probes; ++ib) + { + if (!std::isfinite(norms[2 * ib + 1])) { return std::numeric_limits::infinity(); } + if (norms[2 * ib] > 0.0) + { + growth = std::max(growth, std::sqrt(norms[2 * ib + 1] / norms[2 * ib])); + } + } + return growth; +} } template -void Sto_DOS::caldos(const double sigmain, const double de, const int npart) +double Sto_DOS::trace_moments(ModuleBase::Chebyshev& che, + std::vector& spolyv, + const int npart) { - ModuleBase::TITLE("Sto_DOS", "caldos"); - ModuleBase::timer::start("Sto_DOS", "caldos"); - std::cout << "=========================" << std::endl; - std::cout << "###Calculating Dos....###" << std::endl; - std::cout << "=========================" << std::endl; - ModuleBase::Chebyshev che(dos_nche); + ModuleBase::timer::start("Sto_DOS", "trace_moments"); const int nk = p_kv->get_nks(); const int npwx = p_wfcpw->npwk_max; - std::vector spolyv; + std::fill(spolyv.begin(), spolyv.end(), 0.0); + double growth = 0.0; std::vector> allorderchi; if (this->method_sto == 1) { @@ -240,24 +180,22 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons } else { - spolyv.resize(dos_nche * dos_nche, 0); + spolyv.resize(static_cast(dos_nche) * dos_nche, 0); int nchip_new = ceil((double)this->p_stowf->nchip_max / npart); - allorderchi.resize(nchip_new * npwx * dos_nche); + allorderchi.resize(static_cast(nchip_new) * npwx * dos_nche); } - ModuleBase::timer::start("Sto_DOS", "Tracepoly"); std::cout << "1. TracepolyA:" << std::endl; for (int ik = 0; ik < nk; ik++) { std::cout << "ik: " << ik + 1 << std::endl; - if (nk > 1) - { - this->p_hamilt->updateHk(ik); - } + this->p_hamilt->updateHk(ik); const int npw = p_kv->ngk[ik]; const int nchipk = this->p_stowf->nchip[ik]; + if (nchipk == 0) { continue; } + std::complex* pchi; - if (PARAM.inp.nbands > 0) + if (this->nbands_ks > 0) { p_stowf->chiortho->fix_k(ik); pchi = p_stowf->chiortho->get_pointer(); @@ -274,7 +212,12 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons std::placeholders::_3); if (this->method_sto == 1) { - che.tracepolyA(hchi_norm, pchi, npw, npwx, nchipk); + const int probes = std::min(nchipk, 2); + const auto observe_final = [&](const std::complex* last) { + const double measured = dos_polynomial_growth(pchi, last, npw, npwx, probes); + growth = std::max(growth, measured); + }; + che.tracepolyA(hchi_norm, pchi, npw, npwx, nchipk, observe_final); for (int i = 0; i < dos_nche; ++i) { spolyv[i] += che.polytrace[i] * p_kv->wk[ik] / 2; @@ -285,7 +228,7 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons int N = dos_nche; double kweight = p_kv->wk[ik] / 2; char trans = 'T'; - char normal = 'N'; + char upper = 'U'; double one = 1; for (int ipart = 0; ipart < npart; ++ipart) { @@ -296,155 +239,269 @@ void Sto_DOS::caldos(const double sigmain, const double de, cons nchipk_new++; start_nchipk = ipart * nchipk_new; } + if (nchipk_new == 0) { continue; } ModuleBase::GlobalFunc::ZEROS(allorderchi.data(), nchipk_new * npwx * dos_nche); std::complex* tmpchi = pchi + start_nchipk * npwx; che.calpolyvec_complex(hchi_norm, tmpchi, allorderchi.data(), npw, npwx, nchipk_new); + const int probes = std::min(nchipk_new, std::max(0, 2 - start_nchipk)); + if (probes > 0) + { + const auto* last = allorderchi.data() + static_cast(dos_nche - 1) * npwx * nchipk_new; + const double measured = dos_polynomial_growth(tmpchi, last, npw, npwx, probes); + growth = std::max(growth, measured); + } double* vec_all = (double*)allorderchi.data(); int LDA = npwx * nchipk_new * 2; int M = npwx * nchipk_new * 2; - BlasConnector::gemm(normal, trans, N, N, M, kweight, vec_all, LDA, vec_all, LDA, one, spolyv.data(), N); + // Polynomial vectors are columns of a real M-by-N matrix. + dsyrk_(&upper, &trans, &N, &M, &kweight, vec_all, &LDA, &one, spolyv.data(), &N); } } } - allorderchi.clear(); - allorderchi.shrink_to_fit(); + if (this->method_sto == 2) + { + // Complete the lower triangle once, after all partitions and k points. + for (int col = 0; col < dos_nche; ++col) + { + for (int row = col + 1; row < dos_nche; ++row) + { + spolyv[row + static_cast(col) * dos_nche] = spolyv[col + static_cast(row) * dos_nche]; + } + } + } - std::ofstream ofsdos; - if (de <= 0.0) + // Every pool and stochastic group must retry together, with one common interval. + Parallel_Reduce::reduce_max(growth); + ModuleBase::timer::end("Sto_DOS", "trace_moments"); + return growth; +} + +template +void Sto_DOS::caldos(const double sigmain, const double de, const int npart) +{ + ModuleBase::TITLE("Sto_DOS", "caldos"); + ModuleBase::timer::start("Sto_DOS", "caldos"); + std::cout << "=========================" << std::endl; + std::cout << "###Calculating Dos....###" << std::endl; + std::cout << "=========================" << std::endl; + const int partition_bands = p_stowf->nchip_max / npart + (p_stowf->nchip_max % npart != 0); + if (method_sto == 2 && !dos_method2_dimensions_supported(dos_nche, p_wfcpw->npwk_max, partition_bands)) { - ModuleBase::WARNING_QUIT("Sto_DOS", "dos_edelta_ev must be positive."); + ModuleBase::WARNING_QUIT("Sto_DOS", "DOS method 2 exceeds int indexing/BLAS limits. Reduce dos_nche, increase npart_sto for vector storage, or use method_sto=1."); } - int ndos = int((emax - emin) / de) + 1; - if (ndos < 1) + ModuleBase::Chebyshev che(dos_nche); + const int nk = p_kv->get_nks(); + std::vector spolyv; + for (int attempt = 0; ; ++attempt) { - ModuleBase::WARNING_QUIT("Sto_DOS", "The DOS output window is empty; check dos_emin_ev/dos_emax_ev."); + const double growth = this->trace_moments(che, spolyv, npart); + this->output.log << " DOS: refreshed spectral interval [" << *p_hamilt_sto->emin + << ", " << *p_hamilt_sto->emax << "] Ry\n" + << " DOS: growth from computed moments " << growth << std::endl; + if (growth <= 1.5) { break; } + if (attempt == 2) + { + ModuleBase::WARNING_QUIT("Sto_DOS", "DOS polynomial growth persists after interval recovery"); + } + const double previous_lo = *p_hamilt_sto->emin; + const double previous_hi = *p_hamilt_sto->emax; + // Only an observed failure pays for the existing interval recovery probes. + check_che_op()(this->dos_nche, previous_lo, previous_hi, + this->p_kv, reinterpret_cast, Device>*>(this->p_stowf), + reinterpret_cast, Device>*>(this->p_hamilt_sto), this->output.log); + int needs_bracket = (*p_hamilt_sto->emin == previous_lo && *p_hamilt_sto->emax == previous_hi); + Parallel_Reduce::reduce_max(needs_bracket); + if (needs_bracket) + { + // The old probe uses order n, whereas DOS ends at n-1. If only the + // latter detects growth, use the existing operator bracket to recover. + for (int ik = 0; ik < nk; ++ik) + { + p_hamilt_sto->updateHk(ik); + const auto bracket = p_hamilt_sto->spectral_bounds(ik); + if (!bracket.ok) { ModuleBase::WARNING_QUIT("Sto_DOS", "Spectral bracket unavailable"); } + *p_hamilt_sto->emin = std::min(*p_hamilt_sto->emin, bracket.lo); + *p_hamilt_sto->emax = std::max(*p_hamilt_sto->emax, bracket.hi); + } + Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); + Parallel_Reduce::reduce_max(*p_hamilt_sto->emax); + } + this->output.log << " DOS: rebuilding moments on [" << *p_hamilt_sto->emin + << ", " << *p_hamilt_sto->emax << "] Ry" << std::endl; } - this->stofunc.sigma = sigmain / ModuleBase::Ry_to_eV; - - // Estimate the Chebyshev order needed to resolve a Gaussian of width - // sigmain over the actual spectral range. Reporting this explicitly - // prevents a silently under-resolved DOS: with a large ecut and the - // default dos_sigma (0.07 eV) the required order can be thousands or more, - // while method 2 stores an nche x nche matrix and becomes prohibitively - // expensive. - const double range_ev = (*this->stofunc.Emax - *this->stofunc.Emin) * ModuleBase::Ry_to_eV; - const double sigma_ev = std::abs(sigmain); - if (sigma_ev > 0.0 && range_ev > 0.0) + this->update_window(sigmain); + this->under_resolved = false; + // Under-resolved parameters must be reported, not silently accepted: resolving a + // Gaussian of width sigma over a range R needs about 0.5*R/sigma*sqrt(2 ln 1e6) + // Chebyshev orders, i.e. ~2.63*R/sigma. { - const double prefactor = std::sqrt(2.0 * std::log(1.0e6)); - const double nche_needed = 0.5 * range_ev / sigma_ev * prefactor; - if (nche_needed > static_cast(this->dos_nche)) + const double span_ev = (*p_hamilt_sto->emax - *p_hamilt_sto->emin) * ModuleBase::Ry_to_eV; + const double sigma_ev = std::fabs(sigmain); + if (sigma_ev > 0.0 && span_ev > 0.0) { - std::ostringstream msg; - msg << "dos_sigma = " << sigma_ev << " eV is narrower than the Chebyshev expansion can resolve: " - << "range = " << range_ev << " eV, dos_nche = " << this->dos_nche - << ", estimated order needed ~ " << static_cast(std::ceil(nche_needed)) - << ". Increase dos_nche (method 1 or method 2 with sufficient memory) or use a larger dos_sigma."; - dos_log(" WARNING: " + msg.str(), true); + this->nche_needed = 2.63 * span_ev / sigma_ev; + if (this->nche_needed > static_cast(this->dos_nche)) + { + this->under_resolved = true; + std::ostringstream msg; + msg << "dos_nche = " << this->dos_nche << " is too small: resolving dos_sigma = " << sigma_ev + << " eV over a range of " << span_ev << " eV needs about " + << static_cast(this->nche_needed) << " Chebyshev orders. Increase dos_nche, use a " + "larger dos_sigma; narrowing the output window does not reduce the expansion order required. The DOS written for this run is " + "marked as untrustworthy."; + this->output.log << " WARNING: DOS: " << msg.str() << std::endl; + std::cout << " WARNING: DOS: " << msg.str() << std::endl; + } } } - ModuleBase::timer::end("Sto_DOS", "Tracepoly"); + + + std::ofstream ofsdos; + int ndos = int((emax - emin) / de) + 1; + this->stofunc.sigma = sigmain / ModuleBase::Ry_to_eV; std::cout << "2. Dos:" << std::endl; - ModuleBase::timer::start("Sto_DOS", "DOS Loop"); - // For very small output windows ndos/10 is zero; the old modulus then - // divided by zero and terminated the run with SIGFPE. - int n10 = std::max(1, ndos / 10); + int n10 = std::max(ndos / 10, 1); int percent = 10; std::vector sto_dos(ndos); std::vector ks_dos(ndos); std::vector error(ndos); - for (int ie = 0; ie < ndos; ++ie) + // Reuse coefficient/product storage and read the Gram matrix once per batch. + const int batch_size = 32; + std::vector coefficients(dos_nche * batch_size); + std::vector products; + if (this->method_sto == 2) { products.resize(dos_nche * batch_size); } + for (int first = 0; first < ndos; first += batch_size) { - double tmpks = 0; - double tmpsto = 0; - this->stofunc.targ_e = (emin + ie * de) / ModuleBase::Ry_to_eV; - if (this->method_sto == 1) + const int count = std::min(batch_size, ndos - first); + for (int column = 0; column < count; ++column) { - auto ngauss = std::bind(&Sto_Func::ngauss, &this->stofunc, std::placeholders::_1); - che.calcoef_real(ngauss); - tmpsto = BlasConnector::dot(dos_nche, che.coef_real, 1, spolyv.data(), 1); + this->stofunc.targ_e = (emin + (first + column) * de) / ModuleBase::Ry_to_eV; + if (this->method_sto == 1) + { + auto ngauss = std::bind(&Sto_Func::ngauss, &this->stofunc, std::placeholders::_1); + che.calcoef_real(ngauss); + } + else + { + auto nroot_gauss = std::bind(&Sto_Func::nroot_gauss, &this->stofunc, std::placeholders::_1); + che.calcoef_real(nroot_gauss); + } + std::copy(che.coef_real, che.coef_real + dos_nche, coefficients.data() + column * dos_nche); } - else + if (this->method_sto == 2) { - auto nroot_gauss = std::bind(&Sto_Func::nroot_gauss, &this->stofunc, std::placeholders::_1); - che.calcoef_real(nroot_gauss); - tmpsto = vTMv(che.coef_real, spolyv.data(), dos_nche); + BlasConnector::gemm_cm('N', 'N', dos_nche, count, dos_nche, 1.0, + spolyv.data(), dos_nche, coefficients.data(), dos_nche, + 0.0, products.data(), dos_nche); } - if (PARAM.inp.nbands > 0) + for (int column = 0; column < count; ++column) { - for (int ik = 0; ik < nk; ++ik) + const int ie = first + column; + const double* coef = coefficients.data() + column * dos_nche; + const double* moments = spolyv.data(); + if (this->method_sto == 2) { moments = products.data() + column * dos_nche; } + const double tmpsto = BlasConnector::dot(dos_nche, coef, 1, moments, 1); + double tmpks = 0; + this->stofunc.targ_e = (emin + ie * de) / ModuleBase::Ry_to_eV; + if (this->nbands_ks > 0) { - double* en = &(this->p_elec->ekb(ik, 0)); - for (int ib = 0; ib < PARAM.inp.nbands; ++ib) + for (int ik = 0; ik < nk; ++ik) { - tmpks += this->stofunc.gauss(en[ib]) * p_kv->wk[ik] / 2; + double* en = &(this->p_elec->ekb(ik, 0)); + for (int ib = 0; ib < this->nbands_ks; ++ib) + { + tmpks += this->stofunc.gauss(en[ib]) * p_kv->wk[ik] / 2; + } } } - } - tmpks /= GlobalV::NPROC_IN_POOL; + tmpks /= p_wfcpw->poolnproc; - double tmperror = 0; - if (this->method_sto == 1) - { - tmperror = che.coef_real[dos_nche - 1] * spolyv[dos_nche - 1]; - } - else - { - const int norder = dos_nche; - double last_coef = che.coef_real[norder - 1]; - double last_spolyv = spolyv[norder * norder - 1]; - tmperror = last_coef - * (BlasConnector::dot(norder, che.coef_real, 1, spolyv.data() + norder * (norder - 1), 1) - + BlasConnector::dot(norder, che.coef_real, 1, spolyv.data() + norder - 1, norder) - - last_coef * last_spolyv); - } + double tmperror = 0; + if (this->method_sto == 1) + { + tmperror = coef[dos_nche - 1] * spolyv[dos_nche - 1]; + } + else + { + const int norder = dos_nche; + double last_coef = coef[norder - 1]; + double last_spolyv = spolyv[static_cast(norder) * norder - 1]; + tmperror = last_coef + * (BlasConnector::dot(norder, coef, 1, spolyv.data() + static_cast(norder) * (norder - 1), 1) + + BlasConnector::dot(norder, coef, 1, spolyv.data() + norder - 1, norder) + - last_coef * last_spolyv); + } - if (ie % n10 == n10 - 1) - { - std::cout << percent << "%" - << " "; - percent += 10; + if (ie % n10 == n10 - 1) + { + std::cout << percent << "%" + << " "; + percent += 10; + } + sto_dos[ie] = tmpsto; + ks_dos[ie] = tmpks; + error[ie] = tmperror; } - sto_dos[ie] = tmpsto; - ks_dos[ie] = tmpks; - error[ie] = tmperror; } #ifdef __MPI MPI_Allreduce(MPI_IN_PLACE, ks_dos.data(), ndos, MPI_DOUBLE, MPI_SUM, INT_BGROUP); Parallel_Reduce::reduce_all(sto_dos.data(), ndos); Parallel_Reduce::reduce_all(error.data(), ndos); #endif - if (GlobalV::MY_RANK == 0) + if (this->output.rank == 0) { - std::string dosfile = PARAM.globalv.global_out_dir + "dos_sdft.txt"; + std::string dosfile = this->output.directory + "dos_sdft.txt"; ofsdos.open(dosfile.c_str()); + if (!ofsdos) { ModuleBase::WARNING_QUIT("Sto_DOS", "Cannot open DOS output file"); } + ModuleIO::write_notice(this->output.log, "Stochastic DOS", dosfile); double maxerror = 0; double sum = 0; + bool non_finite = false; - ofsdos << ndos << " # number of points" << std::endl; + ofsdos << ndos << " # number of points"; + if (this->under_resolved) + { + // The marker is part of the header line's comment so that existing readers, + // which take the first field as the number of points, keep working. + ofsdos << " # WARNING: THIS DOS IS NOT TRUSTWORTHY: dos_nche = " << this->dos_nche + << " is too small (about " << static_cast(this->nche_needed) + << " orders are needed for this range/dos_sigma)"; + } + ofsdos << std::endl; ofsdos << "#" << std::setw(19) << "energy(eV)" << std::setw(20) << "dos(eV^-1)" << std::setw(20) << "sum" << std::setw(20) << "error(eV^-1)" << std::endl; for (int ie = 0; ie < ndos; ++ie) { - double tmperror = 2.0 * std::abs(error[ie]); + double tmperror = 2.0 * std::abs(error[ie]) / ModuleBase::Ry_to_eV; if (maxerror < tmperror) { maxerror = tmperror; } double dos = 2.0 * (ks_dos[ie] + sto_dos[ie]) / ModuleBase::Ry_to_eV; + if (!std::isfinite(dos)) + { + non_finite = true; + } sum += dos; ofsdos << std::setw(20) << emin + ie * de << std::setw(20) << dos << std::setw(20) << sum * de << std::setw(20) << tmperror << std::endl; } std::cout << std::endl; std::cout << "Finish DOS" << std::endl; + if (non_finite) + { + this->output.log << " WARNING: DOS: the curve contains non-finite values: " + "dos_nche = " << this->dos_nche + << "; check the spectral interval and expansion convergence" + << std::endl; + } std::cout << std::scientific << "DOS max absolute Chebyshev Error: " << maxerror << std::endl; ofsdos.close(); + if (!ofsdos) { ModuleBase::WARNING_QUIT("Sto_DOS", "Cannot write DOS output file"); } } - ModuleBase::timer::end("Sto_DOS", "DOS Loop"); ModuleBase::timer::end("Sto_DOS", "caldos"); return; } diff --git a/source/source_pw/module_stodft/sto_dos.h b/source/source_pw/module_stodft/sto_dos.h index ffd1cfc08c0..d44e97d68ef 100644 --- a/source/source_pw/module_stodft/sto_dos.h +++ b/source/source_pw/module_stodft/sto_dos.h @@ -1,10 +1,13 @@ #ifndef STO_DOS #define STO_DOS +#include "source_base/math_chebyshev.h" #include "source_estate/elecstate.h" #include "source_pw/module_stodft/sto_hamilt_pw.h" #include "source_pw/module_stodft/sto_che.h" #include "source_pw/module_stodft/sto_func.h" #include "source_pw/module_stodft/sto_wf.h" +#include +#include "source_io/module_output/output_context.h" template class Sto_DOS @@ -16,7 +19,8 @@ class Sto_DOS psi::Psi>* p_psi_in, hamilt::Hamilt>* p_hamilt_in, StoChe& stoche, - Stochastic_WF, base_device::DEVICE_CPU>* p_stowf_in); + Stochastic_WF, base_device::DEVICE_CPU>* p_stowf_in, + const ModuleIO::OutputContext& output); ~Sto_DOS(); /** @@ -38,7 +42,8 @@ class Sto_DOS const bool& dos_setemax, const double& dos_emin_ev, const double& dos_emax_ev, - const double& dos_scale); + const double& dos_scale, + const double& dos_sigma); /** * @brief Calculate DOS using stochastic wavefunctions * @@ -49,9 +54,19 @@ class Sto_DOS void caldos(const double sigmain, const double de, const int npart); protected: + const ModuleIO::OutputContext output; + double trace_moments(ModuleBase::Chebyshev& che, std::vector& spolyv, const int npart); + void refresh_bounds(); + void update_window(const double dos_sigma); + + bool fixed_emin = false; ///< user-specified DOS grid endpoint + bool fixed_emax = false; + double window_scale = 0.0; ///< padding for an automatic DOS grid int nbands_ks = 0; ///< number of KS bands int nbands_sto = 0; ///< number of stochastic bands int dos_nche = 0; ///< number of Chebyshev orders for DOS + bool under_resolved = false; ///< dos_nche is too small for range/dos_sigma + double nche_needed = 0.0; ///< estimated orders needed for range/dos_sigma int method_sto = 1; ///< method for sDFT double emax = 0.0; ///< maximum energy double emin = 0.0; ///< minimum energy @@ -68,4 +83,4 @@ class Sto_DOS StoHamiltPW>* p_hamilt_sto = nullptr; ///< pointer to the Hamiltonian for sDFT }; -#endif // STO_DOS \ No newline at end of file +#endif // STO_DOS diff --git a/source/source_pw/module_stodft/sto_elecond.cpp b/source/source_pw/module_stodft/sto_elecond.cpp index 6a6ea4526fc..7638f7b2fa0 100644 --- a/source/source_pw/module_stodft/sto_elecond.cpp +++ b/source/source_pw/module_stodft/sto_elecond.cpp @@ -38,6 +38,7 @@ Sto_EleCond::Sto_EleCond(UnitCell* p_ucell_in, this->nbands_ks = p_psi_in->get_nbands(); this->nbands_sto = p_stowf_in->nchi; this->stofunc.set_E_range(&stoche.emin_sto, &stoche.emax_sto); + this->emax_analytic = stoche.emax_analytic; this->cond_dtbatch = PARAM.inp.cond_dtbatch; #ifdef __FLOAT_FFTW if(!std::is_same::value) @@ -52,7 +53,7 @@ void Sto_EleCond::decide_nche(const FPTYPE dt, const FPTYPE cond_thr, const int& fd_nche, FPTYPE try_emin, - FPTYPE try_emax) + FPTYPE try_emax, std::ostream& log) { int nche_guess = 1000; ModuleBase::Chebyshev chet(nche_guess); @@ -107,13 +108,14 @@ void Sto_EleCond::decide_nche(const FPTYPE dt, int nche_new = 0; loop: // re-set Emin & Emax both in p_hamilt_sto & stofunc - check_che_op()(std::max(nche_old * 2, fd_nche), + const int check_order = std::max(nche_old * 2, fd_nche); + check_che_op()(check_order, try_emin, try_emax, - this->nbands_sto, this->p_kv, this->p_stowf, - this->p_hamilt_sto); + this->p_hamilt_sto, + log); // second try to find nche with new Emin & Emax getnche(nche_new); diff --git a/source/source_pw/module_stodft/sto_elecond.h b/source/source_pw/module_stodft/sto_elecond.h index 4845525dcc6..2c50a47ad8d 100644 --- a/source/source_pw/module_stodft/sto_elecond.h +++ b/source/source_pw/module_stodft/sto_elecond.h @@ -51,7 +51,7 @@ class Sto_EleCond : protected EleCond * @param try_emax trial Emax * */ - void decide_nche(const FPTYPE dt, const FPTYPE cond_thr, const int& fd_nche, FPTYPE try_emin, FPTYPE try_emax); + void decide_nche(const FPTYPE dt, const FPTYPE cond_thr, const int& fd_nche, FPTYPE try_emin, FPTYPE try_emax, std::ostream& log); /** * @brief calculate Stochastic Kubo-Greenwood * @@ -80,6 +80,7 @@ class Sto_EleCond : protected EleCond int cond_dtbatch = 0; ///< number of time steps in a batch hamilt::Hamilt, Device>* p_hamilt = nullptr; ///< pointer to the Hamiltonian Stochastic_WF, Device>* p_stowf = nullptr; ///< pointer to the stochastic wavefunctions + double emax_analytic = 0.0; ///< analytic upper bound of H (ecutwfc + V_max) Sto_Func stofunc; ///< functions StoHamiltPW, Device>* p_hamilt_sto = nullptr; ///< pointer to the Hamiltonian for sDFT diff --git a/source/source_pw/module_stodft/sto_hamilt_pw.cpp b/source/source_pw/module_stodft/sto_hamilt_pw.cpp index 2bb5040a361..5707f71147c 100644 --- a/source/source_pw/module_stodft/sto_hamilt_pw.cpp +++ b/source/source_pw/module_stodft/sto_hamilt_pw.cpp @@ -1,5 +1,7 @@ #include "sto_hamilt_pw.h" #include "source_base/timer.h" +#include "source_base/parallel_reduce.h" +#include #include "kernels/hpsi_norm_op.h" template @@ -13,6 +15,8 @@ StoHamiltPW::StoHamiltPW(elecstate::Potential* pot_in, Real* emax_in) : hamilt::HamiltPW(pot_in, wfc_basis, p_kv, nlpp, nullptr, ucell, nullptr), ngk(p_kv->ngk) { + potential_context = pot_in; + basis_context = wfc_basis; this->classname = "StoHamiltPW"; this->npwk_max = wfc_basis->npwk_max; this->npol = npol; @@ -65,3 +69,94 @@ template class StoHamiltPW, base_device::DEVICE_CPU>; template class StoHamiltPW, base_device::DEVICE_GPU>; template class StoHamiltPW, base_device::DEVICE_GPU>; #endif + +template +ModuleIO::NonlocalBounds StoHamiltPW::nonlocal_bounds(const int ik) const +{ + ModuleIO::NonlocalBounds out; + const pseudopot_cell_vnl* pp = this->ppcell; + if (pp == nullptr || this->ucell == nullptr || this->npwk_max <= 0) + { + return out; + } + if (pp->nkb == 0) + { + out.ok = true; + return out; + } + const int nkb = pp->nkb; + const int lda = this->npwk_max; + // Projectors of this k. The same convention as the nonlocal operator itself is + // used here (matching Device and ctx, device buffer), so nothing is recomputed on + // the host for a GPU build; only the m x m bound itself is a host calculation, and + // it runs only on the fallback path. + // getvnl is templated on the *real* type, and writes std::complex + using cplx = std::complex; + using resmem_op = base_device::memory::resize_memory_op; + using delmem_op = base_device::memory::delete_memory_op; + using syncmem_d2h_op = base_device::memory::synchronize_memory_op; + cplx* vkb_dev = nullptr; + const size_t vkb_size = static_cast(nkb) * lda; + resmem_op()(vkb_dev, vkb_size); + const ModuleBase::Vector3 vec_pot(0.0, 0.0, 0.0); + pp->template getvnl(this->ctx, *this->ucell, ik, vec_pot, vkb_dev); + std::vector vkb_native(vkb_size, cplx(0.0, 0.0)); + syncmem_d2h_op()(vkb_native.data(), vkb_dev, vkb_size); + delmem_op()(vkb_dev); + // the bound itself is a small host calculation (m x m) and runs on the fallback path + std::vector> vkb_host(vkb_size, std::complex(0.0, 0.0)); + for (size_t i = 0; i < vkb_size; ++i) + { + vkb_host[i] = std::complex(static_cast(vkb_native[i].real()), + static_cast(vkb_native[i].imag())); + } + + const UnitCell& cell = *this->ucell; + std::vector na(cell.ntype, 0); + std::vector nh(cell.ntype, 0); + for (int it = 0; it < cell.ntype; ++it) + { + na[it] = cell.atoms[it].na; + nh[it] = cell.atoms[it].ncpp.nh; + } + out = ModuleIO::nonlocal_operator_bounds(vkb_host.data(), + lda, + this->ngk[ik], + nkb, + pp->deeq.ptr, + pp->deeq.getBound2(), + pp->deeq.getBound3(), + pp->deeq.getBound4(), + pp->deeq.getBound1(), // nspin: the bracket is the union + cell.ntype, + na.data(), + nh.data()); + return out; +} + +template +ModuleIO::NonlocalBounds StoHamiltPW::spectral_bounds(const int ik) const +{ + ModuleIO::NonlocalBounds bounds = nonlocal_bounds(ik); + if (!bounds.ok) { return bounds; } + const auto& potential = potential_context->get_eff_v(); + double lo = std::numeric_limits::max(); + double hi = -std::numeric_limits::max(); + for (int i = 0; i < potential.nr * potential.nc; ++i) + { + lo = std::min(lo, potential.c[i]); + hi = std::max(hi, potential.c[i]); + } + double kinetic_max = 0.0; + for (int ig = 0; ig < ngk[ik]; ++ig) + { + const double kinetic = basis_context->getgk2(ik, ig) * basis_context->tpiba2; + kinetic_max = std::max(kinetic_max, kinetic); + } + Parallel_Reduce::reduce_min_pool(basis_context->poolnproc, lo); + Parallel_Reduce::reduce_max_pool(basis_context->poolnproc, hi); + Parallel_Reduce::reduce_max_pool(basis_context->poolnproc, kinetic_max); + bounds.lo += lo; + bounds.hi += hi + kinetic_max; + return bounds; +} diff --git a/source/source_pw/module_stodft/sto_hamilt_pw.h b/source/source_pw/module_stodft/sto_hamilt_pw.h index 31f5716af80..37a2f2b4491 100644 --- a/source/source_pw/module_stodft/sto_hamilt_pw.h +++ b/source/source_pw/module_stodft/sto_hamilt_pw.h @@ -3,6 +3,8 @@ #include "source_pw/module_pwdft/hamilt_pw.h" +#include "sto_spectral_bounds.h" + template class StoHamiltPW : public hamilt::HamiltPW { @@ -50,10 +52,28 @@ class StoHamiltPW : public hamilt::HamiltPW */ void hPsi_norm(const T* psi_in, T* hpsi, const int& nbands = 1); + /** + * @brief Rigorous bounds of the nonlocal operator for k: |psi> -> V_NL|psi>. + * + * lambda_min(H) >= min V_eff + lo and lambda_max(H) <= ecutwfc + max V_eff + hi, + * with [lo, hi] the extremes of V_NL inside the plane-wave space. These are + * exact extremes of a finite-rank operator, so the resulting interval contains + * the spectrum whatever the SCF state, the start vectors or nche_sto are. + */ + ModuleIO::NonlocalBounds nonlocal_bounds(const int ik) const; + + ModuleIO::NonlocalBounds spectral_bounds(const int ik) const; + + /// Rank in the pool distributing this Hamiltonian's plane-wave vectors. + int pool_rank() const { return basis_context->poolrank; } + int pool_size() const { return basis_context->poolnproc; } + Real* emin = nullptr; ///< Emin of the Hamiltonian Real* emax = nullptr; ///< Emax of the Hamiltonian private: + elecstate::Potential* potential_context = nullptr; + ModulePW::PW_Basis_K* basis_context = nullptr; int npwk_max = 0; ///< maximum number of plane waves int npol = 0; ///< number of polarizations std::vector& ngk; ///< number of G vectors diff --git a/source/source_pw/module_stodft/sto_hsolver_pw.cpp b/source/source_pw/module_stodft/sto_hsolver_pw.cpp index dcb53ec9ddc..096a2abb8fd 100644 --- a/source/source_pw/module_stodft/sto_hsolver_pw.cpp +++ b/source/source_pw/module_stodft/sto_hsolver_pw.cpp @@ -2,6 +2,8 @@ #include "source_base/global_function.h" #include "source_base/parallel_comm.h" +#include "source_base/parallel_reduce.h" +#include "source_base/tool_quit.h" #include "source_base/parallel_device.h" #include "source_base/timer.h" #include "source_base/tool_title.h" @@ -22,7 +24,7 @@ void StoHSolverPW::solve(const UnitCell& ucell, const int istep, const int iter, std::ostream& log, - const bool skip_charge) + const bool skip_charge, const double smearing_sigma) { ModuleBase::TITLE("StoHSolverPW", "solve"); ModuleBase::timer::start("StoHSolverPW", "solve"); @@ -54,6 +56,33 @@ void StoHSolverPW::solve(const UnitCell& ucell, // the iterative eigensolvers see the Hamiltonian only through this operator hamilt::HamiltHSOperator op(pHamilt, wfc_basis); + // Use the current SCF potential, not the atomic-density potential cached before SCF. + const auto& potential = pes->pot->get_eff_v(); + double vmin = std::numeric_limits::max(); + double vmax = -std::numeric_limits::max(); + for (int i = 0; i < potential.nr * potential.nc; ++i) + { + vmin = std::min(vmin, potential.c[i]); + vmax = std::max(vmax, potential.c[i]); + } + Parallel_Reduce::reduce_min(vmin); + Parallel_Reduce::reduce_max(vmax); + stoiter.emin_analytic = vmin; + double kinetic_max = 0.0; + for (int ik = 0; ik < nks; ++ik) + { + for (int ig = 0; ig < wfc_basis->npwk[ik]; ++ig) + { + const double kinetic = wfc_basis->getgk2(ik, ig) * wfc_basis->tpiba2; + kinetic_max = std::max(kinetic_max, kinetic); + } + } + Parallel_Reduce::reduce_max(kinetic_max); + stoiter.emax_analytic = kinetic_max + vmax; + + // expose the deterministic eigenvalues to the range estimator + stoiter.p_elec_ctx = pes; + // part of KSDFT to get KS orbitals for (int ik = 0; ik < nks; ++ik) { @@ -79,22 +108,81 @@ void StoHSolverPW::solve(const UnitCell& ucell, #endif ModuleBase::timer::end("StoHSolverPW", "solve_KS"); stoiter.orthog(ik, psi, stowf); - stoiter.checkemm(ik, istep, iter, stowf); // check and reset emax & emin + stoiter.checkemm(ik, istep, iter, stowf, smearing_sigma, log); // check and reset emax & emin + } + + for (int ik = 0; ik < pes->ekb.nr; ++ik) + { + for (int ib = 0; ib < pes->ekb.nc; ++ib) + { + *stoiter.p_hamilt_sto->emin = std::min(*stoiter.p_hamilt_sto->emin, pes->ekb(ik, ib)); + *stoiter.p_hamilt_sto->emax = std::max(*stoiter.p_hamilt_sto->emax, pes->ekb(ik, ib)); + } } + Parallel_Reduce::reduce_min(*stoiter.p_hamilt_sto->emin); + Parallel_Reduce::reduce_max(*stoiter.p_hamilt_sto->emax); this->output_iterInfo(log); - for (int ik = 0; ik < nks; ik++) + // Check the moments at the actual expansion order before fitting the chemical + // potential. Truncation error alone is not a reason to widen the interval. + double dimension = 0.0; + for (int ik = 0; ik < nks; ++ik) + { + dimension += wfc_basis->npwk[ik]; + } + Parallel_Reduce::reduce_all(dimension); + for (int attempt = 0; ; ++attempt) { - // init k - if (nks > 1) + for (int ik = 0; ik < nks; ++ik) { - pHamilt->updateHk(ik); // necessary , because emax and emin should be decided first + pHamilt->updateHk(ik); + stoiter.calPn(ik, stowf); } - stoiter.calPn(ik, stowf); + const double growth = stoiter.polynomial_growth(); + if (growth <= 1.5) + { + break; + } + if (attempt >= 3) + { + ModuleBase::WARNING_QUIT("StoHSolverPW", "Polynomial growth persists inside the spectral bracket"); + } + double lo = *stoiter.p_hamilt_sto->emin; + double hi = *stoiter.p_hamilt_sto->emax; + if (attempt == 2 || !std::isfinite(growth)) + { + for (int ik = 0; ik < nks; ++ik) + { + const auto nb = stoiter.p_hamilt_sto->spectral_bounds(ik); + if (!nb.ok) + { + ModuleBase::WARNING_QUIT("StoHSolverPW", "Nonlocal spectral bracket unavailable"); + } + lo = std::min(lo, nb.lo); + hi = std::max(hi, nb.hi); + } + Parallel_Reduce::reduce_min(lo); + Parallel_Reduce::reduce_max(hi); + } + else + { + const int order = std::max(stoiter.p_che->norder - 1, 1); + const double weight_scale = stoiter.method == 1 ? std::max(dimension, 1.0) + : std::sqrt(std::max(dimension, 1.0)); + const double amplitude = growth * weight_scale; + const double factor = std::cosh(std::acosh(amplitude) / order); + const double center = 0.5 * (lo + hi); + const double half = 0.5 * (hi - lo); + lo = center - factor * half; + hi = center + factor * half; + } + *stoiter.p_hamilt_sto->emin = lo; + *stoiter.p_hamilt_sto->emax = hi; + log << " SDFT: polynomial growth " << growth << "; rebuilding moments on [" + << lo << ", " << hi << "] Ry" << std::endl; + // Every interval change is followed by calPn, including the final bracket. } - - // iterate to get mu stoiter.itermu(iter, pes); // prepare sqrt{f(\hat{H})}|\chi> to calculate density, force and stress diff --git a/source/source_pw/module_stodft/sto_hsolver_pw.h b/source/source_pw/module_stodft/sto_hsolver_pw.h index 8c9b8cef9c2..8bdd1742238 100644 --- a/source/source_pw/module_stodft/sto_hsolver_pw.h +++ b/source/source_pw/module_stodft/sto_hsolver_pw.h @@ -50,6 +50,8 @@ class StoHSolverPW : public hsolver::HSolverPW ks_run(ks_run_in), all_ks_run(all_ks_run_in), bndpar(bndpar_in) { stoiter.init(pkv, wfc_basis_in, stowf, stoche, p_hamilt_sto); + stoiter.emin_analytic = stoche.emin_analytic; // analytic bracket of the spectrum + stoiter.emax_analytic = stoche.emax_analytic; } void solve(const UnitCell& ucell, @@ -62,7 +64,7 @@ class StoHSolverPW : public hsolver::HSolverPW const int istep, const int iter, std::ostream& log, - const bool skip_charge); + const bool skip_charge, const double smearing_sigma); Stochastic_Iter stoiter; diff --git a/source/source_pw/module_stodft/sto_iter.cpp b/source/source_pw/module_stodft/sto_iter.cpp index 610a42172df..ae63dd0bfa6 100644 --- a/source/source_pw/module_stodft/sto_iter.cpp +++ b/source/source_pw/module_stodft/sto_iter.cpp @@ -1,6 +1,7 @@ #include "sto_iter.h" +#include "sto_math.h" -#include +#include "sto_spectral_bounds.h" #include "source_base/kernels/math_kernel_op.h" #include "source_base/para_gemm.h" @@ -15,9 +16,6 @@ #include "source_hsolver/para_lin_tf.h" #include "source_io/module_parameter/parameter.h" -#include -#include - template Stochastic_Iter::Stochastic_Iter() { @@ -34,15 +32,7 @@ Stochastic_Iter::~Stochastic_Iter() template void Stochastic_Iter::dot(const int& n, const Real* x, const int& incx, const Real* y, const int& incy, Real& result) { - // Use the arrays the caller passes: the previous implementation ignored x, incx, y and incy and - // always reduced p_che->coef_real against spolyv, so every caller that wanted a different - // contraction (for example the two staggered sums in checkemm) silently got the same number, and - // the reported Chebyshev "precision" of the stochastic trace was not the quantity it claimed. - Real* result_device = nullptr; - resmem_var_op()(result_device, 1); - container::kernels::blas_dot()(n, x, incx, y, incy, result_device); - syncmem_var_d2h_op()(&result, result_device, 1); - delmem_var_op()(result_device); + result = stochastic_dot(n, x, incx, y, incy); } template @@ -148,115 +138,282 @@ template void Stochastic_Iter::checkemm(const int& ik, const int istep, const int iter, - Stochastic_WF& stowf) + Stochastic_WF& stowf, + const double smearing_sigma, std::ostream& log) { ModuleBase::TITLE("Stochastic_Iter", "checkemm"); ModuleBase::timer::start("Stochastic_Iter", "checkemm"); // iter = 1,2,... istep = 0,1,2,... - // if( istep%PARAM.inp.initsto_freq != 0 ) return; const int npw = stowf.ngk[ik]; const int nks = stowf.nks; - if (istep == 0) + const int norder = p_che->norder; + const unsigned probe_seed = 131u * static_cast(ik) + 7919u * static_cast(iter) + + 104729u * static_cast(istep); + const int pool_rank = p_hamilt_sto->pool_rank(); + const int pool_size = p_hamilt_sto->pool_size(); + // Estimate once; subsequent density passes validate their already-computed + // moments at the full order. A probe is evidence of containment, not a proof. + const bool first_decision = (*p_hamilt_sto->emin == 0.0 || *p_hamilt_sto->emax == 0.0); + const bool range_check = first_decision; + if (!first_decision && std::is_same>::value) { - if (iter > 5) - { - ModuleBase::timer::end("Stochastic_Iter", "checkemm"); - return; - } + // Track slow spectral drift even when it is too small to cause measurable + // polynomial growth. A single short run replaces the old full-order probes. + auto apply = [this](std::complex* in, std::complex* out, const int bands) { + p_hamilt_sto->hPsi(reinterpret_cast(in), reinterpret_cast(out), bands); + }; + const auto estimate = ModuleIO::lanczos_spectral_bounds( + apply, stowf.npwx, 30, 1e-4, 0.0, pool_rank, probe_seed, false, true, nullptr, npw); + *p_hamilt_sto->emin = std::min(*p_hamilt_sto->emin, estimate.emin); + *p_hamilt_sto->emax = std::max(*p_hamilt_sto->emax, estimate.emax); + change = true; } - else + if (range_check && std::is_same>::value) { - if (iter > 1) + // npwx, not npw: hPsi uses npwk_max as the leading dimension of its vectors. + const int n_lanczos = stowf.npwx; + const int npw_k = stowf.ngk[ik]; + double probe_dimension = npw_k; + Parallel_Reduce::reduce_pool(probe_dimension); + // The certificate must use the order that will actually be used, because its + // sensitivity grows like cosh(M acosh|t|). A single-digit order is useless and + // a very large one only costs hPsi calls, so it is capped. + const int m_cert = std::min(std::max(norder, 2), 200); + const double cert_limit = 1.5; // |T_M| <= 1 inside the interval; 1.5 leaves room for round-off + const std::complex* start_vec = nullptr; + if (nchip[ik] > 0) { - ModuleBase::timer::end("Stochastic_Iter", "checkemm"); - return; + if (stowf.chiortho != nullptr) + { + stowf.chiortho->fix_k(ik); + start_vec = stowf.chiortho->get_pointer(); + } + else + { + stowf.chi0->fix_k(ik); + start_vec = stowf.chi0->get_pointer(); + } } - } - - const int norder = p_che->norder; - T* pchi = nullptr; - int ntest = 1; + auto apply_H = std::bind(&StoHamiltPW::hPsi, p_hamilt_sto, std::placeholders::_1, + std::placeholders::_2, std::placeholders::_3); + const std::function*, std::complex*, const int)> fun + = [&apply_H](std::complex* in, std::complex* out, const int n) { + apply_H(reinterpret_cast(in), reinterpret_cast(out), n); + }; + int hpsi_calls = 0; + double seconds = 0.0; + double growth = 0.0; - if (nchip[ik] < ntest) - { - ntest = nchip[ik]; - } + // ||T_M(H~) chi|| on the orbitals that are about to be integrated + auto certificate = [&](const double emin, const double emax) -> double { + if (start_vec == nullptr || !(emax > emin)) + { + return 0.0; + } + double g = 0.0; + // two orbitals at the first decision, one afterwards (the interval only + // grows, so a single probe is enough for the follow-up checks) + const int n_orbitals = std::min(nchip[ik], (iter == 1) ? 2 : 1); + for (int ichi = 0; ichi < n_orbitals; ++ichi) + { + const std::complex* chi = nullptr; + if (stowf.chiortho != nullptr) + { + stowf.chiortho->fix_k(ik); + chi = &stowf.chiortho->operator()(ik, ichi, 0); + } + else + { + stowf.chi0->fix_k(ik); + chi = &stowf.chi0->operator()(ik, ichi, 0); + } + const double measured = ModuleIO::chebyshev_growth_check( + fun, n_lanczos, m_cert, emin, emax, chi, npw_k); + g = std::isfinite(measured) ? std::max(g, measured) : std::numeric_limits::infinity(); + } + hpsi_calls += m_cert * n_orbitals; + return g; + }; - for (int ichi = 0; ichi < ntest; ++ichi) - { - if (PARAM.globalv.nbands_l > 0) + // the stochastic orbitals are not available: nothing to validate against, the + // deterministic bands (if any) still pin the bottom + if (start_vec == nullptr) { - pchi = &stowf.chiortho->operator()(ik, ichi, 0); + if (first_decision && this->emax_analytic > 0.0) + { + *p_hamilt_sto->emax = this->emax_analytic; + } } else { - pchi = &stowf.chi0->operator()(ik, ichi, 0); - } - while (true) - { - bool converge; - auto hchi_norm = std::bind(&StoHamiltPW::hPsi_norm, - p_hamilt_sto, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3); - converge - = p_che->checkconverge(hchi_norm, pchi, npw, stowf.npwx, *p_hamilt_sto->emax, *p_hamilt_sto->emin, 5.0); - - if (!converge) - { - change = true; - } - else + bool need_estimate = first_decision; + + if (need_estimate) { - break; + // ---- 1. candidate interval from the Lanczos estimate --------------- + // The start vector decides what the Krylov space can see. A stochastic + // orbital has (numerically) no weight on some bound states - with the + // orbital as start the lowest state of the small-cell case was missed by + // 30 Ry - so a small *block* of random vectors is used instead: a random + // vector has weight ~1/npw on every state, and taking the min/max over the + // block makes missing a state exponentially unlikely. + double emin_try = 0.0; + double emax_try = 0.0; + int steps_used = 0; + bool have_estimate = false; + bool upper_converged = true; + // Block 0 starts from the stochastic orbital (it resolves the part of the + // spectrum the SCF actually populates), blocks 1-2 from random vectors + // (they typically have weight ~1/npw on every state, reducing the chance + // of missing a bound state). The interval is the union over the block. + for (int blk = 0; blk < 3; ++blk) + { + const std::complex* blk_start = (blk == 0) ? start_vec : nullptr; + const unsigned block_seed = probe_seed + static_cast(blk); + const ModuleIO::RangeBounds b = ModuleIO::lanczos_spectral_bounds( + fun, n_lanczos, 30, 1.0e-4, 0.0, pool_rank, block_seed, true, true, blk_start, npw_k); + hpsi_calls += b.steps; + if (b.steps >= 2) { hpsi_calls += 2; } // explicit endpoint residuals + seconds += b.seconds; + steps_used += b.steps; + if (std::isfinite(b.emin) && std::isfinite(b.emax) && b.emax > b.emin) + { + // Keep the measured residual even when the Ritz value has not converged. + const double candidate_lo = b.emin; + const double candidate_hi = b.emax_change <= 1e-4 ? b.emax : b.ritz_max; + upper_converged = upper_converged && b.emax_change <= 1e-4; + emin_try = have_estimate ? std::min(emin_try, candidate_lo) : candidate_lo; + emax_try = have_estimate ? std::max(emax_try, candidate_hi) : candidate_hi; + have_estimate = true; + } + } + if (!have_estimate) + { + emin_try = *p_hamilt_sto->emin; + emax_try = *p_hamilt_sto->emax; + } + // Use the local/kinetic estimate when the Ritz upper end has not converged. + // The actual growth check below also sees nonlocal contributions. + if (!upper_converged && this->emax_analytic > emax_try) + { + emax_try = this->emax_analytic; + } + // exact eigenvalues of the deterministic bands pin the bottom + if (this->p_elec_ctx != nullptr && this->p_elec_ctx->ekb.nc > 0) + { + double e_min_ks = std::numeric_limits::max(); + const auto& ekb = this->p_elec_ctx->ekb; + for (int ik2 = 0; ik2 < ekb.nr; ++ik2) + { + for (int ib = 0; ib < ekb.nc; ++ib) + { + if (std::isfinite(ekb(ik2, ib))) + { + e_min_ks = std::min(e_min_ks, ekb(ik2, ib)); + } + } + } +#ifdef __MPI + Parallel_Reduce::reduce_min_pool(pool_size, e_min_ks); +#endif + if (e_min_ks < std::numeric_limits::max()) + { + emin_try = std::min(emin_try, e_min_ks); + } + } + // keep the interval monotone: it may only grow during a run + if (*p_hamilt_sto->emin != 0.0) + { + emin_try = std::min(emin_try, *p_hamilt_sto->emin); + } + if (*p_hamilt_sto->emax != 0.0) + { + emax_try = std::max(emax_try, *p_hamilt_sto->emax); + } + + // ---- 2. validate, widen from the measured growth, validate again --- + growth = certificate(emin_try, emax_try); + // Random-state weight scale used to propose a widening. It is not + // a lower bound on overlaps, so every proposal is checked again. + const double w_min = 1.0 / std::max(1.0, probe_dimension * double(std::max(nchip[ik], 1))); + bool validated = (growth <= cert_limit); + int rounds = 0; + while (!validated && rounds < 2) + { + ++rounds; + // G >= sqrt(w_min) * cosh(M acosh|t|) => solve for |t| + const double amp = std::max(growth / std::sqrt(w_min), 1.0 + 1.0e-12); + const double arg = std::acosh(amp) / double(m_cert); + // a single round may not widen by more than 4x the half span + const double t_abs = std::min(std::cosh(arg), 4.0); + const double e_center = 0.5 * (emin_try + emax_try); + const double e_half = 0.5 * (emax_try - emin_try); + emin_try = std::min(emin_try, e_center - t_abs * e_half); + emax_try = std::max(emax_try, e_center + t_abs * e_half); + growth = certificate(emin_try, emax_try); + validated = (growth <= cert_limit); + } + if (!validated) + { + const auto bracket = p_hamilt_sto->spectral_bounds(ik); + if (!bracket.ok) + { + ModuleBase::WARNING_QUIT("Stochastic_Iter", "Spectral bracket unavailable"); + } + emin_try = bracket.lo; + emax_try = bracket.hi; + if (*p_hamilt_sto->emin != 0.0) + { + emin_try = std::min(emin_try, *p_hamilt_sto->emin); + } + if (*p_hamilt_sto->emax != 0.0) + { + emax_try = std::max(emax_try, *p_hamilt_sto->emax); + } + } + *p_hamilt_sto->emin = emin_try; + *p_hamilt_sto->emax = emax_try; + + // ---- 4. was the expansion numerically resolved? ------------------ + const double span = *p_hamilt_sto->emax - *p_hamilt_sto->emin; + const double sigma = smearing_sigma; + if (sigma > 0.0 && norder > 0) + { + const double nche_needed = 2.63 * span / sigma; + if (nche_needed > double(norder)) + { + log << " WARNING: SDFT: nche_sto = " << norder << " is below the " + << nche_needed << " orders the interval [" << *p_hamilt_sto->emin + << ", " << *p_hamilt_sto->emax << "] Ry and smearing_sigma " << sigma + << " Ry need; the interval itself is validated, but the expansion is " + "under-resolved" + << std::endl; + } + } + if (ik == 0) + { + log << " SDFT: spectral interval [" << *p_hamilt_sto->emin << ", " + << *p_hamilt_sto->emax << "] Ry (iter " << iter << ", " << steps_used + << " Lanczos + " << rounds + 1 << " x M=" << m_cert + << " certificates, growth " << growth << ", " << seconds << " s; " + << hpsi_calls << " hPsi)" << std::endl; + } } } + change = true; } if (ik == nks - 1) { #ifdef __MPI Parallel_Reduce::reduce_max(*p_hamilt_sto->emax); Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); - MPI_Allreduce(MPI_IN_PLACE, &change, 1, MPI_CHAR, MPI_LOR, MPI_COMM_WORLD); + int changed = change; + Parallel_Reduce::reduce_max(changed); + change = changed != 0; #endif - // checkconverge() treats (0,0) as "unset" and can end with a - // positive Emin when the trial Rayleigh quotient is positive. This - // removes all bound states from the Chebyshev interval and makes the - // Fermi-level search fail at high temperature. Correct only that - // pathological final bound; negative bounds are left untouched so - // normal SDFT results do not change. - // A positive lower bound is only pathological when it came from the - // automatic search: a user-provided emin_sto (or a genuinely positive - // spectrum) is a valid interval, and moving it downwards would enlarge - // the interval and change the fixed-order occupation and entropy sums. - const bool emin_is_automatic = (PARAM.inp.emin_sto == 0.0); - if (emin_is_automatic && (!std::isfinite(*p_hamilt_sto->emin) || *p_hamilt_sto->emin > 0)) - { - const double positive_emin = *p_hamilt_sto->emin; - const double emax_abs = std::abs(*p_hamilt_sto->emax); - const double fallback_span = std::max(5.0, 0.01 * emax_abs); - const double safe_emin = -fallback_span; - std::ostringstream range_msg; - range_msg << " WARNING: positive automatic Chebyshev Emin " << positive_emin << " Ry is reset to " - << safe_emin << " Ry"; - *p_hamilt_sto->emin = safe_emin; - // The same pathological Krylov path also underestimates the upper - // bound. The highest plane-wave eigenvalue cannot exceed roughly - // ecutwfc, so use the cutoff as a safe floor. - const double ecutwfc = PARAM.inp.ecutwfc; - const double ecut_floor = 1.05 * ecutwfc; - if (ecutwfc > 0 && *p_hamilt_sto->emax < ecut_floor) - { - range_msg << "; Chebyshev Emax " << *p_hamilt_sto->emax << " Ry is raised to the ecutwfc-based floor " - << ecut_floor << " Ry"; - *p_hamilt_sto->emax = ecut_floor; - } - GlobalV::ofs_running << range_msg.str() << std::endl; - } if (change) { - GlobalV::ofs_running << "New Emax Ry" << *p_hamilt_sto->emax << " ; new Emin " << *p_hamilt_sto->emin + log << "New Emax Ry" << *p_hamilt_sto->emax << " ; new Emin " << *p_hamilt_sto->emin << " Ry" << std::endl; } change = false; @@ -298,6 +455,11 @@ void Stochastic_Iter::check_precision(const double ref, const double Parallel_Reduce::reduce_all(error); #endif double relative_error = std::abs(error / ref); + if (info.find("Ne") != std::string::npos) + { + // This last-term indicator diagnoses truncation; it does not establish spectral containment. + this->ne_rel_error = relative_error; + } GlobalV::ofs_running << info << "Relative Chebyshev Precision: " << relative_error * 1e9 << "E-09" << std::endl; if (relative_error > thr) { @@ -315,6 +477,36 @@ void Stochastic_Iter::check_precision(const double ref, const double //=============================== } +// Reuse the moments already computed by calPn; no additional Hamiltonian applications. +// For a contained spectrum, || <= ||chi||^2 (method 1), +// and ||T_n chi||^2 <= ||chi||^2 (method 2). +template +double Stochastic_Iter::polynomial_growth() const +{ + const int n = p_che->norder; + Real* diagonal = nullptr; + resmem_var_op()(diagonal, n); + const int stride = method == 1 ? 1 : n + 1; + container::kernels::blas_copy()(n, spolyv, stride, diagonal, 1); + std::vector moments(n); + syncmem_var_d2h_op()(moments.data(), diagonal, n); + delmem_var_op()(diagonal); + Parallel_Reduce::reduce_all(moments.data(), n); + double growth = 1.0; + for (int i = 0; i < n; ++i) + { + if (!std::isfinite(moments[i])) + { + return std::numeric_limits::infinity(); + } + if (moments[0] > 0.0) + { + growth = std::max(growth, std::abs(double(moments[i] / moments[0]))); + } + } + return method == 1 ? growth : std::sqrt(growth); +} + template void Stochastic_Iter::itermu(const int iter, elecstate::ElecState* pes) { @@ -431,6 +623,17 @@ void Stochastic_Iter::calPn(const int& ik, Stochastic_WF& setmem_var_op()(spolyv, 0, norder * norder); } } + // Empty stochastic groups contribute zero moments. Do not send a zero + // leading dimension to BLAS; the later global reductions still include us. + if (nchip_ik == 0) + { + if (this->method == 1 && ik == this->pkv->get_nks() - 1) + { + syncmem_var_h2d_op()(spolyv, spolyv_cpu, norder); + } + ModuleBase::timer::end("Stochastic_Iter", "calPn"); + return; + } T* pchi = nullptr; if (PARAM.globalv.nbands_l > 0) { @@ -790,6 +993,9 @@ void Stochastic_Iter::cal_storho(const UnitCell& ucell, template void Stochastic_Iter::calTnchi_ik(const int& ik, Stochastic_WF& stowf) { + // This is a local projection; no output rows or collectives exist here + // for an empty stochastic group. + if (nchip[ik] == 0) { return; } const int npw = stowf.ngk[ik]; const int npwx = stowf.npwx; stowf.shchi->fix_k(ik); diff --git a/source/source_pw/module_stodft/sto_iter.h b/source/source_pw/module_stodft/sto_iter.h index 60c3a7a56af..0de171c730b 100644 --- a/source/source_pw/module_stodft/sto_iter.h +++ b/source/source_pw/module_stodft/sto_iter.h @@ -1,5 +1,6 @@ #ifndef STO_ITER_H #define STO_ITER_H +#include #include "source_base/math_chebyshev.h" #include "source_estate/elecstate_pw.h" #include "source_hamilt/hamilt.h" @@ -103,7 +104,8 @@ class Stochastic_Iter * @param iter scf iteration index * @param stowf stochastic wave functions */ - void checkemm(const int& ik, const int istep, const int iter, Stochastic_WF& stowf); + void checkemm(const int& ik, const int istep, const int iter, Stochastic_WF& stowf, + const double smearing_sigma, std::ostream& log); /** * @brief check precision of Chebyshev expansion @@ -116,9 +118,18 @@ class Stochastic_Iter ModuleBase::Chebyshev* p_che = nullptr; + double emin_analytic = 0.0; ///< analytic lower bound of H (min V_eff), set by the esolver + double emax_analytic = 0.0; ///< analytic upper bound of H (ecutwfc + V_max), set by the esolver + const elecstate::ElecState* p_elec_ctx = nullptr; ///< eigenvalues of the deterministic bands, set by the solver + double ritz_min_prev = 0.0; ///< raw lower Ritz value of the previous range check + double ritz_max_prev = 0.0; ///< raw upper Ritz value of the previous range check + int range_checks = 0; ///< number of completed range checks + Sto_Func stofunc; StoHamiltPW* p_hamilt_sto = nullptr; + double ne_rel_error = 0.0; ///< last-term truncation indicator, not an electron-number residual + double polynomial_growth() const; double mu0 = 0.0; // chemical potential; unit in Ry bool change = false; double targetne=0.0; diff --git a/source/source_pw/module_stodft/sto_math.h b/source/source_pw/module_stodft/sto_math.h new file mode 100644 index 00000000000..664a3aef5e7 --- /dev/null +++ b/source/source_pw/module_stodft/sto_math.h @@ -0,0 +1,21 @@ +#ifndef STO_MATH_H +#define STO_MATH_H + +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/module_device/memory_op.h" + +// Device dot with a host result, used by stochastic traces and their indicators. +// Both operands and both strides are significant. +template +Real stochastic_dot(const int n, const Real* x, const int incx, const Real* y, const int incy) +{ + using ContainerDevice = typename container::PsiToContainer::type; + Real* device_result = nullptr; + base_device::memory::resize_memory_op()(device_result, 1); + container::kernels::blas_dot()(n, x, incx, y, incy, device_result); + Real result = 0; + base_device::memory::synchronize_memory_op()(&result, device_result, 1); + base_device::memory::delete_memory_op()(device_result); + return result; +} +#endif diff --git a/source/source_pw/module_stodft/sto_spectral_bounds.cpp b/source/source_pw/module_stodft/sto_spectral_bounds.cpp new file mode 100644 index 00000000000..3aa76ad69b6 --- /dev/null +++ b/source/source_pw/module_stodft/sto_spectral_bounds.cpp @@ -0,0 +1,827 @@ +#include "sto_spectral_bounds.h" +#include "source_base/module_external/lapack_connector.h" +#include "source_base/tool_quit.h" + +#include "source_base/module_device/memory_op.h" +#include "source_base/module_container/ATen/kernels/blas.h" +#include "source_base/global_variable.h" +#include "source_base/parallel_reduce.h" + +#include +#include +#include +#include +#include +#include + +namespace ModuleIO +{ +namespace +{ + +/// Eigenvalues of a real symmetric matrix by the cyclic Jacobi method. +/// The matrix is the Lanczos tridiagonal (m <= nsteps, a few dozen), so a plain +/// rotation sweep is enough and this module stays free of a LAPACK dependency; +/// it also runs on the host while the Lanczos vectors live on the device. +struct SymEig +{ + std::vector values; ///< ascending eigenvalues + std::vector vectors; ///< row-major, column j is the eigenvector of values[j] +}; + +SymEig symmetric_eigen(std::vector a, const int m) +{ + std::vector v(m * m, 0.0); + for (int i = 0; i < m; ++i) + { + v[i * m + i] = 1.0; + } + for (int sweep = 0; sweep < 100; ++sweep) + { + double off = 0.0; + for (int p = 0; p < m; ++p) + { + for (int q = p + 1; q < m; ++q) + { + off += a[p * m + q] * a[p * m + q]; + } + } + if (off < 1.0e-30) + { + break; + } + for (int p = 0; p < m; ++p) + { + for (int q = p + 1; q < m; ++q) + { + const double apq = a[p * m + q]; + if (std::fabs(apq) < 1.0e-300) + { + continue; + } + const double theta = 0.5 * (a[q * m + q] - a[p * m + p]) / apq; + const double t = (theta >= 0.0 ? 1.0 : -1.0) / (std::fabs(theta) + std::sqrt(theta * theta + 1.0)); + const double c = 1.0 / std::sqrt(t * t + 1.0); + const double s = t * c; + for (int k = 0; k < m; ++k) + { + const double akp = a[k * m + p]; + const double akq = a[k * m + q]; + a[k * m + p] = c * akp - s * akq; + a[k * m + q] = s * akp + c * akq; + } + for (int k = 0; k < m; ++k) + { + const double apk = a[p * m + k]; + const double aqk = a[q * m + k]; + a[p * m + k] = c * apk - s * aqk; + a[q * m + k] = s * apk + c * aqk; + } + for (int k = 0; k < m; ++k) + { + const double vkp = v[k * m + p]; + const double vkq = v[k * m + q]; + v[k * m + p] = c * vkp - s * vkq; + v[k * m + q] = s * vkp + c * vkq; + } + } + } + } + // sort the diagonal values and carry the eigenvectors along + std::vector order(m); + for (int i = 0; i < m; ++i) + { + order[i] = i; + } + std::sort(order.begin(), order.end(), [&a, m](int i, int j) { return a[i * m + i] < a[j * m + j]; }); + SymEig out; + out.values.resize(m); + out.vectors.assign(m * m, 0.0); + for (int j = 0; j < m; ++j) + { + const int src = order[j]; + out.values[j] = a[src * m + src]; + for (int i = 0; i < m; ++i) + { + out.vectors[i * m + j] = v[i * m + src]; + } + } + return out; +} + +struct HermEig +{ + std::vector values; + std::vector> vectors; +}; + +HermEig hermitian_eigen(const std::vector>& a, const int m) +{ + ModuleBase::ComplexMatrix matrix(m, m); + for (int i = 0; i < m; ++i) + { + for (int j = 0; j < m; ++j) + { + matrix(i, j) = a[i * m + j]; + } + } + HermEig result; + result.values.resize(m); + result.vectors.resize(m * m); + const int lwork = std::max(1, 2 * m - 1); + std::vector> work(lwork); + std::vector rwork(std::max(1, 3 * m - 2)); + int info = 0; + LapackConnector::zheev('V', 'U', m, matrix, m, result.values.data(), work.data(), lwork, rwork.data(), &info); + if (info != 0) + { + ModuleBase::WARNING_QUIT("hermitian_eigen", "Nonlocal spectral decomposition failed"); + } + for (int i = 0; i < m; ++i) + { + for (int j = 0; j < m; ++j) + { + result.vectors[i * m + j] = matrix(i, j); + } + } + return result; +} + +} // namespace + +template +RangeBounds lanczos_spectral_bounds( + const std::function* in, std::complex* out, const int nbands)>& apply_H, + const int n, + const int nsteps, + const double tol, + const double margin, + const int pool_rank, + const unsigned probe_seed, + const bool lower_only, + const bool reorth, + const std::complex* start, + const int nvalid_in) +{ + 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>; + using syncmem_var_d2h_op = base_device::memory::synchronize_memory_op; + using resmem_complex_op = base_device::memory::resize_memory_op, Device>; + using delmem_complex_op = base_device::memory::delete_memory_op, Device>; + using resmem_var_op = base_device::memory::resize_memory_op; + using delmem_var_op = base_device::memory::delete_memory_op; + using ct_Device = typename container::PsiToContainer::type; + + RangeBounds bounds; + if (n <= 0 || nsteps < 2) + { + return bounds; + } + const auto t_begin = std::chrono::steady_clock::now(); + // The step count must not depend on any per-rank quantity: a difference of one + // hPsi call between ranks desynchronises the pool collectives inside hPsi. + double dimension = nvalid_in >= 0 ? nvalid_in : n; + +#ifdef __MPI + Parallel_Reduce::reduce_pool(dimension); +#endif + const int m_max = std::min(nsteps, static_cast(2 * dimension)); + const int inc = 1; + // hPsi works on npwk_max-long vectors, but only the first `nvalid` entries are + // physical plane waves; the rest is rank-dependent padding. Every inner product + // must therefore run over `nvalid` entries only. + const int nval = nvalid_in >= 0 ? nvalid_in : n; + + std::complex* q = nullptr; + std::complex* w = nullptr; + std::complex* v = nullptr; // Ritz vector (must not alias q: q is rebuilt for the second end) + resmem_complex_op()(q, static_cast(m_max) * n); + resmem_complex_op()(w, n); + resmem_complex_op()(v, n); + double* dot_device = nullptr; + resmem_var_op()(dot_device, 1); + + // Local dot of the physical part; `dot_pool` sums it over the pool. The Lanczos + // recurrence is only a Lanczos recurrence when the inner products are global: + // partial sums make the computed tridiagonal a Rayleigh quotient of no subspace, + // and the Ritz values lose their variational property (they may even leave the + // spectrum, which is what once produced a wrong interval). + auto dot_local = [&](const std::complex* a, const std::complex* b) -> double { + container::kernels::blas_dot()(2 * nval, (const double*)a, inc, (const double*)b, inc, + dot_device); + double value = 0.0; + syncmem_var_d2h_op()(&value, dot_device, 1); + return value; + }; + auto dot_pool = [&](const std::complex* a, const std::complex* b) -> double { + double value = dot_local(a, b); +#ifdef __MPI + Parallel_Reduce::reduce_pool(value); +#endif + return value; + }; + auto axpy = [&](const double alpha, const std::complex* x, std::complex* y) { + const std::complex a(alpha, 0.0); + container::kernels::blas_axpy, ct_Device>()(n, &a, x, inc, y, inc); + }; + auto scal = [&](const double alpha, std::complex* x) { + const std::complex a(alpha, 0.0); + container::kernels::blas_scal, ct_Device>()(n, &a, x, inc); + }; + + std::vector> host(n, std::complex(0.0, 0.0)); + std::vector> tmp_host(n, std::complex(0.0, 0.0)); + if (start != nullptr) + { + syncmem_complex_d2h_op()(host.data(), start, nval); + } + else + { + // local, deterministic generator: std::rand() is shared with the rest of the + // code (orbital initialisation, seeds), so its state must not be touched here. + // Different pool ranks need different streams: repeated local blocks can + // be orthogonal to an entire spectral subspace. + const unsigned rank_seed = 0x9E3779B9u * static_cast(pool_rank); + std::mt19937 rng(0x5EED0000u + probe_seed + rank_seed); + std::uniform_real_distribution uni(-0.5, 0.5); + for (int i = 0; i < nval; ++i) + { + host[i] = std::complex(uni(rng), uni(rng)); + } + } + syncmem_complex_h2d_op()(q, host.data(), n); + const double init_norm = std::sqrt(std::max(dot_pool(q, q), 1.0e-300)); + scal(1.0 / init_norm, q); + + std::vector alpha(m_max, 0.0); + std::vector beta(m_max, 0.0); + SymEig final_eig; + int final_eig_size = 0; + double ritz_min = std::numeric_limits::max(); + double ritz_max = -std::numeric_limits::max(); + + for (int j = 0; j < m_max; ++j) + { + std::complex* qj = q + static_cast(j) * n; + apply_H(qj, w, 1); // w = H q_j + + alpha[j] = dot_pool(qj, w); + axpy(-alpha[j], qj, w); + if (j > 0) + { + axpy(-beta[j - 1], q + static_cast(j - 1) * n, w); + } + if (reorth) + { + // only reached when the caller asks for it: O(m^2) inner products + for (int pass = 0; pass < 2; ++pass) + { + for (int i = 0; i <= j; ++i) + { + std::complex* qi = q + static_cast(i) * n; + const double proj = dot_pool(qi, w); + if (proj != 0.0) + { + axpy(-proj, qi, w); + } + } + } + } + beta[j] = std::sqrt(std::max(dot_pool(w, w), 0.0)); + bounds.steps = j + 1; + + // Diagonalise the tridiagonal only now and then: the extreme Ritz values are + // what the caller needs, and a Jacobi decomposition at every one of the steps + // dominated the cost of the whole estimator. + const bool do_eig = (j + 1 == m_max) || ((j + 1) % 10 == 0); + if (do_eig) + { + const int m = j + 1; + std::vector tri(m * m, 0.0); + for (int i = 0; i < m; ++i) + { + tri[i * m + i] = alpha[i]; + if (i + 1 < m) + { + tri[i * m + i + 1] = beta[i]; + tri[(i + 1) * m + i] = beta[i]; + } + } + final_eig = symmetric_eigen(tri, m); + final_eig_size = m; + const SymEig& eig = final_eig; + // the extremes are tracked over the whole run: Ritz values are always + // inside the spectrum, so taking the minimum/maximum over the iterations + // can only improve the estimate, never break it + ritz_min = std::min(ritz_min, eig.values.front()); + ritz_max = std::max(ritz_max, eig.values.back()); + bounds.ritz_min = ritz_min; + bounds.ritz_max = ritz_max; + bounds.emin = ritz_min; + bounds.emax = ritz_max; + const double res_lo = std::fabs(beta[j] * eig.vectors[(m - 1) * m + 0]); + const double res_hi = std::fabs(beta[j] * eig.vectors[(m - 1) * m + (m - 1)]); + bounds.emin_change = res_lo; + bounds.emax_change = res_hi; + bounds.converged = ((lower_only ? res_lo : std::max(res_lo, res_hi)) < tol); + } + + if (j + 1 < m_max) + { + std::complex* qnext = q + static_cast(j + 1) * n; + if (beta[j] > 1.0e-10) + { + container::kernels::blas_copy, ct_Device>()(n, w, inc, qnext, inc); + scal(1.0 / beta[j], qnext); + } + else + { + // The Krylov space is exhausted (small basis, few plane waves): a fresh + // direction keeps the number of hPsi calls fixed instead of dividing by + // zero. beta[j] = 0 makes the tridiagonal block diagonal, which is the + // correct Lanczos bookkeeping for a restarted run. + beta[j] = 0.0; + const unsigned rank_seed = 0x9E3779B9u * static_cast(pool_rank); + std::mt19937 rng_r(0x5EED0000u + 7919u * static_cast(j + 1) + probe_seed + rank_seed); + std::uniform_real_distribution uni_r(-0.5, 0.5); + for (int i = 0; i < nval; ++i) + { + host[i] = std::complex(uni_r(rng_r), uni_r(rng_r)); + } + for (int i = nval; i < n; ++i) + { + host[i] = std::complex(0.0, 0.0); + } + syncmem_complex_h2d_op()(qnext, host.data(), n); + for (int pass = 0; pass < 2; ++pass) + { + for (int i = 0; i <= j; ++i) + { + std::complex* qi = q + static_cast(i) * n; + const double proj = dot_pool(qi, qnext); + if (proj != 0.0) + { + axpy(-proj, qi, qnext); + } + } + } + const double nrm = std::sqrt(std::max(dot_pool(qnext, qnext), 0.0)); + if (nrm < 1.0e-10) { break; } + scal(1.0 / nrm, qnext); + } + } + } + + // Residuals measure distance to some eigenvalue, not necessarily a spectral + // endpoint. They help track resolved edges; callers still validate growth and + // use the operator bracket when needed. + double theta_lo = bounds.ritz_min; + double theta_hi = bounds.ritz_max; + double res_lo = 0.0; + double res_hi = 0.0; + if (bounds.steps >= 2) + { + const int m = bounds.steps; + if (final_eig_size != m) + { + std::vector tri(m * m, 0.0); + for (int i = 0; i < m; ++i) + { + tri[i * m + i] = alpha[i]; + if (i + 1 < m) + { + tri[i * m + i + 1] = beta[i]; + tri[(i + 1) * m + i] = beta[i]; + } + } + final_eig = symmetric_eigen(tri, m); + } + const SymEig& eig = final_eig; + for (int end = 0; end < 2; ++end) + { + const int col = (end == 0) ? 0 : (m - 1); + std::vector> y(m); + for (int i = 0; i < m; ++i) + { + y[i] = std::complex(eig.vectors[i * m + col], 0.0); + } + // v = sum_i y_i q_i + for (int i = 0; i < n; ++i) + { + host[i] = std::complex(0.0, 0.0); + } + for (int i = 0; i < m; ++i) + { + const double yi = y[i].real(); + if (yi == 0.0) + { + continue; + } + const std::complex* qi = q + static_cast(i) * n; + syncmem_complex_d2h_op()(tmp_host.data(), qi, n); + for (int p = 0; p < nval; ++p) + { + host[p] += yi * tmp_host[p]; + } + } + syncmem_complex_h2d_op()(v, host.data(), n); + apply_H(v, w, 1); + const double theta = dot_pool(v, w); + axpy(-theta, v, w); + const double res = std::sqrt(std::max(dot_pool(w, w), 0.0)); + if (end == 0) + { + theta_lo = theta; + res_lo = res; + } + else + { + theta_hi = theta; + res_hi = res; + } + } + } + bounds.ritz_min = theta_lo; + bounds.ritz_max = theta_hi; + bounds.emin = theta_lo - res_lo; + bounds.emax = theta_hi + res_hi; + bounds.emin_change = res_lo; + bounds.emax_change = res_hi; + + delmem_var_op()(dot_device); + delmem_complex_op()(w); + delmem_complex_op()(v); + delmem_complex_op()(q); + + bounds.seconds = std::chrono::duration(std::chrono::steady_clock::now() - t_begin).count(); + // `margin` is kept in the interface for the unit tests only; the production call + // sites pass 0.0. The interval includes the measured Ritz residuals. + if (margin > 0.0) + { + bounds.emin -= margin; + bounds.emax += margin; + } + // identical bounds on every rank of the pool: the caller branches on them, and the + // cross-pool unification happens at a synchronised point +// All Ritz values and residual norms already use pool-wide inner products. + // Each rank therefore has the same endpoints; no further reduction is needed. + return bounds; +} + +template RangeBounds lanczos_spectral_bounds( + const std::function*, std::complex*, const int)>& apply_H, + const int n, + const int nsteps, + const double tol, + const double margin, + const int pool_rank, + const unsigned probe_seed, + const bool lower_only, + const bool reorth, + const std::complex* start, + const int nvalid); +#if ((defined __CUDA) || (defined __ROCM)) +template RangeBounds lanczos_spectral_bounds( + const std::function*, std::complex*, const int)>& apply_H, + const int n, + const int nsteps, + const double tol, + const double margin, + const int pool_rank, + const unsigned probe_seed, + const bool lower_only, + const bool reorth, + const std::complex* start, + const int nvalid); +#endif + + +template +double chebyshev_growth_check( + const std::function* in, std::complex* out, const int nbands)>& apply_H, + const int n, + const int m, + const double emin, + const double emax, + const std::complex* start, + const int nvalid_in) +{ + 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>; + using syncmem_var_d2h_op = base_device::memory::synchronize_memory_op; + using resmem_complex_op = base_device::memory::resize_memory_op, Device>; + using delmem_complex_op = base_device::memory::delete_memory_op, Device>; + using resmem_var_op = base_device::memory::resize_memory_op; + using delmem_var_op = base_device::memory::delete_memory_op; + using ct_Device = typename container::PsiToContainer::type; + + if (n <= 0 || m < 1 || !(emax > emin) || start == nullptr) + { + return 0.0; + } + const int inc = 1; + const int nval = nvalid_in >= 0 ? nvalid_in : n; + std::complex* v1 = nullptr; + std::complex* v2 = nullptr; + std::complex* tmp = nullptr; + resmem_complex_op()(v1, n); + resmem_complex_op()(v2, n); + resmem_complex_op()(tmp, n); + double* dot_device = nullptr; + resmem_var_op()(dot_device, 1); + // The inner products must be reduced over the pool: every rank then takes the same + // branch and the same number of Lanczos steps, which is required because hPsi does + // pool collectives internally. A purely local dot made the ranks disagree and hung + // the run as soon as more than one rank was used. + auto dot_real = [&](const std::complex* a, const std::complex* b) -> double { + container::kernels::blas_dot()(2 * nval, (const double*)a, inc, (const double*)b, inc, + dot_device); + double value = 0.0; + syncmem_var_d2h_op()(&value, dot_device, 1); +#ifdef __MPI + Parallel_Reduce::reduce_pool(value); +#endif + return value; + }; + auto axpy = [&](const double alpha, const std::complex* x, std::complex* y) { + const std::complex al(alpha, 0.0); + container::kernels::blas_axpy, ct_Device>()(n, &al, x, inc, y, inc); + }; + auto scal = [&](const double alpha, std::complex* x) { + const std::complex al(alpha, 0.0); + container::kernels::blas_scal, ct_Device>()(n, &al, x, inc); + }; + auto copy = [&](const std::complex* src, std::complex* dst) { + container::kernels::blas_copy, ct_Device>()(n, src, inc, dst, inc); + }; + + const double shift = emin + emax; + const double width = emax - emin; + auto apply_scaled = [&](const std::complex* in, std::complex* out) { + apply_H(const_cast*>(in), out, 1); + axpy(-0.5 * shift, in, out); + scal(2.0 / width, out); + }; + + std::vector> host(n); + syncmem_complex_d2h_op()(host.data(), start, n); + syncmem_complex_h2d_op()(v1, host.data(), n); // T_0 v = v + const double norm0 = std::sqrt(std::max(dot_real(v1, v1), 1.0e-300)); + if (m == 1) + { + apply_scaled(v1, v2); + const double g = std::sqrt(std::max(dot_real(v2, v2), 0.0)) / norm0; + delmem_var_op()(dot_device); + delmem_complex_op()(tmp); + delmem_complex_op()(v2); + delmem_complex_op()(v1); + return g; + } + apply_scaled(v1, v2); // T_1 + std::complex* vprev = v1; + std::complex* vcur = v2; + std::complex* vnext = tmp; + for (int k = 2; k <= m; ++k) + { + apply_scaled(vcur, vnext); + scal(2.0, vnext); + axpy(-1.0, vprev, vnext); + std::complex* swap = vprev; + vprev = vcur; + vcur = vnext; + vnext = swap; + } + const double g = std::sqrt(std::max(dot_real(vcur, vcur), 0.0)) / norm0; + delmem_var_op()(dot_device); + delmem_complex_op()(tmp); + delmem_complex_op()(v2); + delmem_complex_op()(v1); + return g; +} + +template double chebyshev_growth_check( + const std::function*, std::complex*, const int)>& apply_H, + const int n, + const int m, + const double emin, + const double emax, + const std::complex* start, + const int nvalid); +#if ((defined __CUDA) || (defined __ROCM)) +template double chebyshev_growth_check( + const std::function*, std::complex*, const int)>& apply_H, + const int n, + const int m, + const double emin, + const double emax, + const std::complex* start, + const int nvalid); + + +#endif + +} // namespace ModuleIO + +namespace ModuleIO +{ + +template +double random_chebyshev_growth_check( + const std::function*, std::complex*, const int)>& apply_H, + const int n, const int nvalid, const int order, const double emin, const double emax, + const int pool_rank, const unsigned probe_seed) +{ + const unsigned seed = 0x5EED0000u + probe_seed + 0x9E3779B9u * static_cast(pool_rank); + std::mt19937 rng(seed); + std::uniform_real_distribution uniform(-0.5, 0.5); + std::vector> host(n, 0.0); + for (int i = 0; i < nvalid; ++i) + { + const double real = uniform(rng); + const double imag = uniform(rng); + host[i] = std::complex(real, imag); + } + std::complex* probe = nullptr; + base_device::memory::resize_memory_op, Device>()(probe, n); + base_device::memory::synchronize_memory_op, Device, base_device::DEVICE_CPU>()( + probe, host.data(), n); + const double growth = chebyshev_growth_check(apply_H, n, order, emin, emax, probe, nvalid); + base_device::memory::delete_memory_op, Device>()(probe); + return growth; +} + +template double random_chebyshev_growth_check( + const std::function*, std::complex*, const int)>&, + const int, const int, const int, const double, const double, const int, const unsigned); +#if defined(__CUDA) || defined(__ROCM) +template double random_chebyshev_growth_check( + const std::function*, std::complex*, const int)>&, + const int, const int, const int, const double, const double, const int, const unsigned); +#endif + +NonlocalBounds nonlocal_operator_bounds(const std::complex* vkb, + const int lda, + const int npw, + const int nkb, + const double* deeq, + const int nb2, + const int nb3, + const int nb4, + const int nspin, + const int ntype, + const int* na, + const int* nh) +{ + NonlocalBounds out; + if (vkb == nullptr || deeq == nullptr || nkb <= 0 || npw <= 0) + { + return out; + } + const int m = nkb; + + // ---- Gram matrix S = over the pool ------------------------ + std::vector gram(static_cast(2) * m * m, 0.0); + for (int i = 0; i < m; ++i) + { + for (int j = i; j < m; ++j) + { + double re = 0.0; + double im = 0.0; + for (int g = 0; g < npw; ++g) + { + const std::complex bi = vkb[static_cast(i) * lda + g]; + const std::complex bj = vkb[static_cast(j) * lda + g]; + re += bi.real() * bj.real() + bi.imag() * bj.imag(); + im += bi.real() * bj.imag() - bi.imag() * bj.real(); + } + gram[static_cast(2) * (i * m + j)] = re; + gram[static_cast(2) * (i * m + j) + 1] = im; + } + } +#ifdef __MPI + Parallel_Reduce::reduce_pool(gram.data(), static_cast(gram.size())); +#endif + std::vector> s_mat(static_cast(m) * m, 0.0); + for (int i = 0; i < m; ++i) + { + for (int j = i; j < m; ++j) + { + const double re = gram[static_cast(2) * (i * m + j)]; + const double im = gram[static_cast(2) * (i * m + j) + 1]; + s_mat[i * m + j] = std::complex(re, im); + s_mat[j * m + i] = std::complex(re, -im); + } + } + + // ---- global D matrix, per spin ------------------------------------------- + // deeq is laid out as deeq[spin][atom][ih][jh]; the extremes are the union over + // the spins, so the bracket does not depend on which spin is being diagonalised. + auto build_d = [&](const int spin) { + std::vector d(static_cast(m) * m, 0.0); + int beta_offset = 0; + int atom_offset = 0; + for (int it = 0; it < ntype; ++it) + { + const int nproj = nh[it]; + for (int ia = 0; ia < na[it]; ++ia) + { + const int iat = atom_offset + ia; + for (int ih = 0; ih < nproj; ++ih) + { + for (int jh = 0; jh < nproj; ++jh) + { + const size_t idx = static_cast(spin) * nb2 * nb3 * nb4 + + static_cast(iat) * nb3 * nb4 + static_cast(ih) * nb4 + jh; + const int bi = beta_offset + ia * nproj + ih; + const int bj = beta_offset + ia * nproj + jh; + if (bi < m && bj < m) + { + d[bi * m + bj] = deeq[idx]; + } + } + } + } + beta_offset += na[it] * nproj; + atom_offset += na[it]; + } + return d; + }; + + double lo_all = 0.0; + double hi_all = 0.0; + for (int spin = 0; spin < std::max(nspin, 1); ++spin) + { + const std::vector d_mat = build_d(spin); + // ---- eigenvalues of M = S^{1/2} D S^{1/2} -------------------------------- + // The symmetric square root of the (positive semidefinite) Gram matrix is taken + // with a Jacobi decomposition; D enters with its own signs, because they decide + // whether the nonlocal operator is attractive or repulsive. Using |D| here would + // lose that information and is only enough for a norm bound. + const HermEig eig_s = hermitian_eigen(s_mat, m); + std::vector> sqrt_s(static_cast(m) * m, 0.0); + for (int i = 0; i < m; ++i) + { + for (int j = 0; j < m; ++j) + { + std::complex acc = 0.0; + for (int k = 0; k < m; ++k) + { + acc += eig_s.vectors[i * m + k] * std::sqrt(std::max(eig_s.values[k], 0.0)) + * std::conj(eig_s.vectors[j * m + k]); + } + sqrt_s[i * m + j] = acc; + } + } + std::vector> tmp(static_cast(m) * m, 0.0); + std::vector> mm(static_cast(m) * m, 0.0); + for (int i = 0; i < m; ++i) + { + for (int j = 0; j < m; ++j) + { + std::complex acc = 0.0; + for (int k = 0; k < m; ++k) + { + acc += sqrt_s[i * m + k] * d_mat[k * m + j]; + } + tmp[i * m + j] = acc; + } + } + for (int i = 0; i < m; ++i) + { + for (int j = 0; j < m; ++j) + { + std::complex acc = 0.0; + for (int k = 0; k < m; ++k) + { + acc += tmp[i * m + k] * sqrt_s[k * m + j]; + } + mm[i * m + j] = acc; + } + } + for (int i = 0; i < m; ++i) + { + for (int j = i + 1; j < m; ++j) + { + const std::complex v = 0.5 * (mm[i * m + j] + std::conj(mm[j * m + i])); + mm[i * m + j] = v; + mm[j * m + i] = std::conj(v); + } + } + const HermEig eig_m = hermitian_eigen(mm, m); + // The operator is V_NL = B D B^dagger with the D that ABACUS stores (it is the + // same sign as in the UPF file), so its extreme eigenvalues are those of M, plus 0 + // for the directions the projectors do not cover. + lo_all = std::min(lo_all, std::min(0.0, eig_m.values.front())); + hi_all = std::max(hi_all, std::max(0.0, eig_m.values.back())); + } // spin + out.lo = lo_all; + out.hi = hi_all; + out.ok = true; + return out; +} + +} // namespace ModuleIO diff --git a/source/source_pw/module_stodft/sto_spectral_bounds.h b/source/source_pw/module_stodft/sto_spectral_bounds.h new file mode 100644 index 00000000000..caf70984d3b --- /dev/null +++ b/source/source_pw/module_stodft/sto_spectral_bounds.h @@ -0,0 +1,148 @@ +#ifndef STO_SPECTRAL_BOUNDS_H +#define STO_SPECTRAL_BOUNDS_H + +#include +#include + +/** + * @file sto_spectral_bounds.h + * @brief Estimate the extreme eigenvalues of the stochastic DFT Hamiltonian. + * + * The SDFT solver needs an interval [Emin, Emax] that contains the whole + * spectrum of H, because the Chebyshev expansion is only valid on it: a state + * outside gives |t| > 1, where T_n(t) = cosh(n*acosh|t|) grows exponentially. + * + * The previous implementation estimated both ends from the Rayleigh quotient of + * a few random vectors. Such a quotient concentrates at Tr(H)/N (the mean of + * the spectrum), so the returned interval sat in the middle of the spectrum and + * excluded every bound state. This module replaces that probe with a Lanczos + * iteration on H, which converges to the *extreme* Ritz values, i.e. to the ends + * of the spectrum, and reports the residual change so the caller can see whether + * the estimate converged. + */ + +namespace ModuleIO +{ + +struct RangeBounds +{ + double emin = 0.0; ///< lower bound of the spectrum [Ry] + double emax = 0.0; ///< upper bound of the spectrum [Ry] + int steps = 0; ///< number of Lanczos steps actually taken + double emin_change = 0.0; ///< |change of the lower Ritz value| in the last step + double emax_change = 0.0; ///< |change of the upper Ritz value| in the last step + bool converged = false; ///< the residual of both extreme Ritz pairs fell below the tolerance + double seconds = 0.0; ///< wall time spent in the estimator + double ritz_min = 0.0; ///< raw lower Ritz value (no margin), for change tracking + double ritz_max = 0.0; ///< raw upper Ritz value (no margin) +}; + +/** + * @brief Lanczos estimate of the extreme eigenvalues of the operator `apply_H`. + * + * `apply_H(in, out, nbands)` must compute out = H * in for `nbands` vectors of + * length `n` (the same convention as `StoHamiltPW::hPsi`), on the given Device. + * + * The iteration keeps m = nsteps Lanczos vectors with full reorthogonalisation + * (twice, for numerical stability) and takes the smallest and largest Ritz value + * of the tridiagonal matrix. The returned interval is expanded by `margin` on + * both sides: Ritz values lie *inside* the spectrum, so a Chebyshev interval + * built directly from them would still clip the ends. + * + * @param apply_H functor computing H * in + * @param n vector length (number of plane waves of this k point) + * @param nsteps maximum number of Lanczos steps (30 is usually enough) + * @param tol convergence tolerance on the extreme Ritz values [Ry] + * @param margin expansion applied to both ends of the final interval [Ry] + * @param pool_rank rank within the distributed vector's pool; distinguishes the + * reproducible random streams for both initial and restart vectors + * @param probe_seed explicit stream identity (k point / SCF step / block); no shared RNG state + * @param lower_only stop as soon as the *lower* end converged; used when the upper + * end is already given by the analytic bound E_cut + V_max + * @param reorth full reorthogonalisation of the Lanczos vectors (robust, but + * O(m^2) inner products). Without it the extreme Ritz values are + * still usable to pick the interval, which is the "compute first, + * choose the parameters afterwards" idea of the spectrum-adaptive + * KPM (T. Chen, arXiv:2308.15683); ghosts may appear in the middle + * of the spectrum, but we only read the two extreme values. + */ +template +RangeBounds lanczos_spectral_bounds( + const std::function* in, std::complex* out, const int nbands)>& apply_H, + const int n, + const int nsteps, + const double tol, + const double margin, + const int pool_rank, + const unsigned probe_seed, + const bool lower_only = false, + const bool reorth = true, + const std::complex* start = nullptr, + const int nvalid = -1); + +/** + * @brief Growth of a Chebyshev-filtered vector, used as a runtime self check. + * + * Applies T_m of the scaled operator (the interval [emin, emax] is mapped to + * [-1, 1]) to `start` and returns ||T_m v|| / ||v||. Inside the interval the + * growth is bounded by 1, so a value larger than that (up to roundoff) + * means that some state lies outside the interval and the caller must widen it. + */ +template +double chebyshev_growth_check( + const std::function* in, std::complex* out, const int nbands)>& apply_H, + const int n, + const int m, + const double emin, + const double emax, + const std::complex* start, + const int nvalid = -1); + +// An independent dense probe also sees directions absent from selected real +// orbitals (e.g. the first columns of nbands_sto=all). Does not touch orbital RNG. +template +double random_chebyshev_growth_check( + const std::function*, std::complex*, const int)>& apply_H, + const int n, const int nvalid, const int order, const double emin, const double emax, + const int pool_rank, const unsigned probe_seed); + +/** + * @brief Rigorous bounds of the nonlocal operator V_NL = sum_ij |beta_i> D_ij , + * || <= lambda_max(|D|) * lambda_max() . + * The exact extremes of V_NL inside the plane-wave space are the extremes of + * M = S^{1/2} D S^{1/2}, S = , an m x m problem with + * m = number of projectors. Together with lambda_min(H) >= min V_eff + lambda_min(V_NL) + * and lambda_max(H) <= ecutwfc + max V_eff + lambda_max(V_NL) this gives an + * interval that is guaranteed to contain the spectrum, independently of any + * iteration, of nche_sto and of the stochastic orbitals. + * + * @param vkb projectors of the current k, local part only (nkb x lda) + * @param deeq D matrix, laid out as deeq[spin][atom][ih][jh]; the bounds are the + * union over all spins, so the result does not depend on which spin + * the calling iteration happens to use. + */ +struct NonlocalBounds +{ + double lo = 0.0; ///< lower bound of lambda_min(V_NL) (<= 0) + double hi = 0.0; ///< upper bound of lambda_max(V_NL) (>= 0) + bool ok = false; ///< the data were available +}; + +NonlocalBounds nonlocal_operator_bounds(const std::complex* vkb, + const int lda, + const int npw, + const int nkb, + const double* deeq, + const int nb2, + const int nb3, + const int nb4, + const int nspin, + const int ntype, + const int* na, + const int* nh); + +} // namespace ModuleIO + +#endif // STO_SPECTRAL_BOUNDS_H diff --git a/source/source_pw/module_stodft/sto_tool.cpp b/source/source_pw/module_stodft/sto_tool.cpp index 250744c557a..173c7dc081d 100644 --- a/source/source_pw/module_stodft/sto_tool.cpp +++ b/source/source_pw/module_stodft/sto_tool.cpp @@ -1,7 +1,11 @@ +#include +#include +#include +#include +#include "source_base/tool_quit.h" +#include "sto_spectral_bounds.h" #include "sto_tool.h" -#include - #include "source_base/math_chebyshev.h" #include "source_base/parallel_comm.h" #include "source_base/parallel_device.h" @@ -11,157 +15,171 @@ #ifdef __MPI #include "mpi.h" #endif -#include -#include #include template void check_che_op::operator()(const int& nche_in, const double& try_emin, const double& try_emax, - const int& nbands_sto, K_Vectors* p_kv, Stochastic_WF, Device>* p_stowf, - StoHamiltPW, Device>* p_hamilt_sto) + StoHamiltPW, Device>* p_hamilt_sto, + std::ostream& log) { - //------------------------------ - // Convergence test - //------------------------------ - bool change = false; + // The Chebyshev expansions below are only valid inside the spectral interval + // of H. Estimate the interval with a Lanczos iteration, which converges to + // the *extreme* eigenvalues: the Rayleigh quotient of a random vector - what + // this function used to do - concentrates at Tr(H)/N, i.e. in the middle of + // the spectrum, and therefore cannot see the ends at all. const int nk = p_kv->get_nks(); - ModuleBase::Chebyshev chetest(nche_in); - int ntest0 = 5; - *p_hamilt_sto->emax = try_emax; - *p_hamilt_sto->emin = try_emin; - // if (PARAM.inp.nbands > 0) - // { - // double tmpemin = 1e10; - // for (int ik = 0; ik < nk; ++ik) - // { - // tmpemin = std::min(tmpemin, this->pelec->ekb(ik, PARAM.inp.nbands - 1)); - // } - // *p_hamilt_sto->emin = tmpemin; - // } - // else - // { - // *p_hamilt_sto->emin = 0; - // } - for (int ik = 0; ik < nk; ++ik) + const int nsteps = 40; // Lanczos steps; the residual is reported below + const double tol = 1.0e-4; // convergence target for the extreme Ritz values [Ry] + const double margin = 1.0e-2; + const int pool_rank = p_hamilt_sto->pool_rank(); + + double emin_est = 0.0; + double emax_est = 0.0; + double inherited_lo = *p_hamilt_sto->emin; + double inherited_hi = *p_hamilt_sto->emax; + if (try_emin != 0.0) { inherited_lo = std::min(inherited_lo, try_emin); } + if (try_emax != 0.0) { inherited_hi = std::max(inherited_hi, try_emax); } + const bool have_range = std::isfinite(inherited_lo) && std::isfinite(inherited_hi) + && inherited_hi > inherited_lo; + if (have_range) { - p_hamilt_sto->updateHk(ik); - const int npw = p_kv->ngk[ik]; - std::complex* pchi = nullptr; - psi::Psi, Device> randchi_d; - randchi_d.resize(1, 1, npw); // holds the independent random probe of this k point - // Use the real stochastic (or complete-basis) orbitals whenever they - // exist. Previously this decision was based only on "nbands_sto==0", - // while Stochastic_WF::nchi was never initialized; as a result the DOS - // range check always used random vectors, even for MDFT. Random - // vectors have a Rayleigh quotient close to the mean spectral energy - // and cannot locate a low-lying eigenvalue, so Emin could be set far - // above the occupied states. - const bool use_random = (p_stowf->nchi <= 0) || (nbands_sto == 0 && p_stowf->nchip_max <= 0); - const int ntest_real = use_random ? 0 : std::min(ntest0, p_stowf->nchip[ik]); - // Always add one independent random probe on top of the real orbitals. - // With `nbands_sto all` the stochastic orbitals are coordinate vectors, - // so a handful of them can miss a diagonal state of another invariant - // subspace; a dense random vector does not depend on that choice. - const int ntest = use_random ? 1 : ntest_real + 1; - for (int i = 0; i < ntest; ++i) + // Start from the SCF interval, then validate at the postprocessing order + // using a dense independent probe as well as the selected orbitals. + *p_hamilt_sto->emin = inherited_lo; + *p_hamilt_sto->emax = inherited_hi; + log << " DOS: Chebyshev interval inherited from SCF [" << inherited_lo << ", " << inherited_hi + << "] Ry" << std::endl; + } + else if (std::is_same::value) + { + bool first = true; + std::vector min_changes; + for (int ik = 0; ik < nk; ++ik) { - const bool use_this_random = use_random || i == ntest_real; - if (use_this_random) + p_hamilt_sto->updateHk(ik); + const int npw = p_kv->ngk[ik]; + auto apply_H = std::bind(&StoHamiltPW, Device>::hPsi, + p_hamilt_sto, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3); + const std::function*, std::complex*, const int)> fun + = [&apply_H](std::complex* in, std::complex* out, const int n) { + apply_H(reinterpret_cast*>(in), reinterpret_cast*>(out), n); + }; + // Estimate both endpoints; the nonlocal operator can shift either one. + const unsigned probe_seed = static_cast(ik); + const ModuleIO::RangeBounds b + // The operator works with a leading dimension of npwk_max, so the + // Lanczos vectors must have that length (zeros in the padding). Using + // npw here made hPsi write past the buffer and hung multi-rank runs. + = ModuleIO::lanczos_spectral_bounds(fun, p_stowf->npwx, nsteps, tol, margin, pool_rank, probe_seed, false, true, nullptr, npw); + if (!std::isfinite(b.emin) || !std::isfinite(b.emax) || b.emax <= b.emin) { - std::vector> randchi(npw); - for (int ig = 0; ig < npw; ++ig) - { - FPTYPE rr = std::rand() / FPTYPE(RAND_MAX); - FPTYPE arg = std::rand() / FPTYPE(RAND_MAX); - randchi[ig] = std::complex(rr * cos(arg), rr * sin(arg)); - } - syncmem_complex_h2d_op()(randchi_d.get_pointer(), randchi.data(), npw); - pchi = randchi_d.get_pointer(); + continue; } - else if (PARAM.inp.nbands > 0) + emin_est = first ? b.emin : std::min(emin_est, b.emin); + emax_est = first ? b.emax : std::max(emax_est, b.emax); + min_changes.push_back(b.emin_change); + first = false; + } + if (!first) + { + // The user may have supplied bounds; the interval still has to contain + // the spectrum, so keep whichever end is wider. + if (try_emin != 0.0) { - pchi = &p_stowf->chiortho[0](ik, i, 0); + emin_est = std::min(emin_est, try_emin); } - else + if (try_emax != 0.0) { - pchi = &p_stowf->chi0[0](ik, i, 0); + emax_est = std::max(emax_est, try_emax); } - while (true) - { - bool converge; - auto hchi_norm = std::bind(&StoHamiltPW, Device>::hPsi_norm, - p_hamilt_sto, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3); - converge = chetest.checkconverge(hchi_norm, - pchi, - npw, - p_stowf->npwx, - *p_hamilt_sto->emax, - *p_hamilt_sto->emin, - 2.0); + *p_hamilt_sto->emin = emin_est; + *p_hamilt_sto->emax = emax_est; - if (!converge) - { - change = true; - } - else - { - break; - } - } + const double worst = *std::max_element(min_changes.begin(), min_changes.end()); + log << " SDFT: spectral interval [" << *p_hamilt_sto->emin << ", " << *p_hamilt_sto->emax + << "] Ry (Lanczos residual " << worst << " Ry)" << std::endl; } + } + else + { + // The float compatibility path uses the operator bracket, without a + // sign assumption about the lower endpoint or a cutoff-only upper bound. + bool first = true; + for (int ik = 0; ik < nk; ++ik) + { + p_hamilt_sto->updateHk(ik); + const auto bracket = p_hamilt_sto->spectral_bounds(ik); + if (!bracket.ok) { ModuleBase::WARNING_QUIT("check_che_op", "Spectral bracket unavailable"); } + *p_hamilt_sto->emin = first ? bracket.lo : std::min(*p_hamilt_sto->emin, bracket.lo); + *p_hamilt_sto->emax = first ? bracket.hi : std::max(*p_hamilt_sto->emax, bracket.hi); + first = false; + } + } - if (ik == nk - 1) + // The SCF order can be much smaller than the DOS/KG order. Validate against + // the actual order here, retaining the SCF interval as the starting point. + const int certificate_order = std::max(nche_in, 2); + for (int ik = 0; ik < nk; ++ik) + { + p_hamilt_sto->updateHk(ik); + const int npw = p_kv->ngk[ik]; + const int lda = p_stowf->npwx; + auto apply_H = [p_hamilt_sto](std::complex* in, std::complex* out, const int bands) { + p_hamilt_sto->hPsi(reinterpret_cast*>(in), + reinterpret_cast*>(out), bands); + }; + if (!std::is_same::value) { continue; } + for (int round = 0; round < 3; ++round) { -#ifdef __MPI - Parallel_Reduce::reduce_max(*p_hamilt_sto->emax); - Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); -#endif - // checkconverge() starts from the user's (0,0) defaults and can - // leave the automatic lower bound positive when the first trial - // Rayleigh quotient is positive. A positive Emin excludes every - // bound state and is the root of the high-temperature SCF and DOS - // failures. Only correct that pathological outcome here so that - // cases whose final bound is already negative keep the original - // numerical result bit for bit. - // Only an automatically determined bound may be repaired: a positive - // emin_sto given by the user (or a genuinely positive spectrum) is a - // valid interval and must be preserved. - const bool emin_is_automatic = (PARAM.inp.emin_sto == 0.0); - if (emin_is_automatic && (!std::isfinite(*p_hamilt_sto->emin) || *p_hamilt_sto->emin > 0)) + const unsigned probe_seed = static_cast(ik); + double growth = ModuleIO::random_chebyshev_growth_check( + apply_H, lda, npw, certificate_order, *p_hamilt_sto->emin, *p_hamilt_sto->emax, + pool_rank, probe_seed); + if (!std::isfinite(growth)) { growth = std::numeric_limits::infinity(); } + const int probes = std::min(p_stowf->nchip[ik], 2); + auto* orbitals = p_stowf->chiortho != nullptr ? p_stowf->chiortho : p_stowf->chi0; + if (probes > 0) { orbitals->fix_k(ik); } + for (int ichi = 0; ichi < probes; ++ichi) { - const double positive_emin = *p_hamilt_sto->emin; - const double emax_abs = std::abs(*p_hamilt_sto->emax); - const double fallback_span = std::max(5.0, 0.01 * emax_abs); - const double safe_emin = -fallback_span; - std::ostringstream range_msg; - range_msg << " WARNING: positive automatic Chebyshev Emin " << positive_emin << " Ry is reset to " - << safe_emin << " Ry"; - *p_hamilt_sto->emin = safe_emin; - // The pathological path that produced a positive Emin also - // tends to underestimate Emax. The highest plane-wave - // eigenvalue is bounded by roughly ecutwfc; use it as a floor. - const double ecutwfc = PARAM.inp.ecutwfc; - const double ecut_floor = 1.05 * ecutwfc; - if (ecutwfc > 0 && *p_hamilt_sto->emax < ecut_floor) + const auto* start = reinterpret_cast*>(&(*orbitals)(ik, ichi, 0)); + const double g = ModuleIO::chebyshev_growth_check( + apply_H, lda, certificate_order, *p_hamilt_sto->emin, *p_hamilt_sto->emax, start, npw); + growth = std::isfinite(g) ? std::max(growth, g) : std::numeric_limits::infinity(); + } + if (growth <= 1.5) { break; } + if (round == 2 || !std::isfinite(growth)) + { + const auto bracket = p_hamilt_sto->spectral_bounds(ik); + if (!bracket.ok) { - range_msg << "; Chebyshev Emax " << *p_hamilt_sto->emax - << " Ry is raised to the ecutwfc-based floor " << ecut_floor << " Ry"; - *p_hamilt_sto->emax = ecut_floor; + ModuleBase::WARNING_QUIT("check_che_op", "Spectral bracket unavailable"); } - GlobalV::ofs_running << range_msg.str() << std::endl; + *p_hamilt_sto->emin = std::min(*p_hamilt_sto->emin, bracket.lo); + *p_hamilt_sto->emax = std::max(*p_hamilt_sto->emax, bracket.hi); + break; } - GlobalV::ofs_running << "New Emax " << *p_hamilt_sto->emax << " Ry; new Emin " << *p_hamilt_sto->emin - << " Ry" << std::endl; - change = false; + double dimension = npw; + Parallel_Reduce::reduce_pool(dimension); + const double amplitude = growth * std::sqrt(std::max(dimension, 1.0)); + const double factor = std::cosh(std::acosh(amplitude) / certificate_order); + const double center = 0.5 * (*p_hamilt_sto->emin + *p_hamilt_sto->emax); + const double half = 0.5 * (*p_hamilt_sto->emax - *p_hamilt_sto->emin); + *p_hamilt_sto->emin = center - factor * half; + *p_hamilt_sto->emax = center + factor * half; } } + +#ifdef __MPI + Parallel_Reduce::reduce_max(*p_hamilt_sto->emax); + Parallel_Reduce::reduce_min(*p_hamilt_sto->emin); +#endif } template diff --git a/source/source_pw/module_stodft/sto_tool.h b/source/source_pw/module_stodft/sto_tool.h index c2fa7fcad30..3f3b24c65ae 100644 --- a/source/source_pw/module_stodft/sto_tool.h +++ b/source/source_pw/module_stodft/sto_tool.h @@ -1,6 +1,7 @@ #ifndef STO_TOOL_H #define STO_TOOL_H +#include #include #include "source_cell/klist.h" @@ -24,10 +25,10 @@ struct check_che_op void operator()(const int& nche_in, const double& try_emin, const double& try_emax, - const int& nbands_sto, K_Vectors* p_kv, Stochastic_WF, Device>* p_stowf, - StoHamiltPW, Device>* p_hamilt_sto); + StoHamiltPW, Device>* p_hamilt_sto, + std::ostream& log); }; /** diff --git a/source/source_pw/module_stodft/unittests/CMakeLists.txt b/source/source_pw/module_stodft/unittests/CMakeLists.txt index b51097f074b..9dc0607c9d8 100644 --- a/source/source_pw/module_stodft/unittests/CMakeLists.txt +++ b/source/source_pw/module_stodft/unittests/CMakeLists.txt @@ -1,9 +1,34 @@ abacus_disable_feature_definitions(__MPI) abacus_disable_feature_definitions(__CUDA) abacus_disable_feature_definitions(__ROCM) +abacus_disable_feature_definitions(__EXX) + +# Regression test for the Lanczos estimate of the spectral interval that the +# SDFT Chebyshev expansions are built on. +AddTest(TARGET MODULE_PW_STO_SPECTRAL_BOUNDS_UTs LIBS base device SOURCES + test_sto_spectral_bounds.cpp ../sto_spectral_bounds.cpp) + +# Rigorous bracket of the interval: the extremes of the nonlocal operator are exact +# eigenvalues of a finite-rank operator, so they are checked against the explicit matrix. +AddTest(TARGET MODULE_PW_STO_NONLOCAL_BOUNDS_UTs LIBS base device SOURCES + test_sto_nonlocal_bounds.cpp ../sto_spectral_bounds.cpp) + +if(ENABLE_MPI) + AddTest(TARGET MODULE_PW_STO_SPECTRAL_BOUNDS_MPI_UTs + KEEP_FEATURE_DEFINITIONS __MPI + LIBS base device + SOURCES test_sto_spectral_bounds_mpi.cpp ../sto_spectral_bounds.cpp) + set_tests_properties(MODULE_PW_STO_SPECTRAL_BOUNDS_MPI_UTs PROPERTIES + TIMEOUT 30 ENVIRONMENT "OMP_NUM_THREADS=1;OPENBLAS_NUM_THREADS=1") + add_test(NAME MODULE_PW_STO_SPECTRAL_BOUNDS_MPI_2_UTs + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ${MPIEXEC_PREFLAGS} + $ ${MPIEXEC_POSTFLAGS}) + set_tests_properties(MODULE_PW_STO_SPECTRAL_BOUNDS_MPI_2_UTs PROPERTIES + PROCESSORS 2 TIMEOUT 30 ENVIRONMENT "OMP_NUM_THREADS=1;OPENBLAS_NUM_THREADS=1") +endif() -# Regression test for the occupation / entropy kernels of the SDFT solver: -# `1 - f` must not be computed by subtraction and the expanded function must -# not contain an artificial cutoff (|x| > 36 used to return exactly 0). AddTest(TARGET MODULE_PW_STO_FUNC_UTs LIBS parameter base device SOURCES test_sto_func.cpp ../sto_func.cpp ../../../source_estate/occupy.cpp) + + +AddTest(TARGET MODULE_PW_STO_MATH_UTs LIBS base device SOURCES test_sto_math.cpp) diff --git a/source/source_pw/module_stodft/unittests/test_sto_math.cpp b/source/source_pw/module_stodft/unittests/test_sto_math.cpp new file mode 100644 index 00000000000..b866e798e19 --- /dev/null +++ b/source/source_pw/module_stodft/unittests/test_sto_math.cpp @@ -0,0 +1,13 @@ +#include "../sto_math.h" +#include + +TEST(StochasticDot, DifferentOperandsAndStrides) +{ + const double x[] = {1, 99, 2, 99, -3}; + const double y[] = {4, 88, 88, -5, 88, 88, 6}; + const double result = stochastic_dot(3, x, 2, y, 3); + EXPECT_DOUBLE_EQ(result, -24.0); + const double contiguous[] = {4, -5, 6}; + const double mixed = stochastic_dot(3, x, 2, contiguous, 1); + EXPECT_DOUBLE_EQ(mixed, result); +} diff --git a/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp b/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp new file mode 100644 index 00000000000..b8521ae772c --- /dev/null +++ b/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp @@ -0,0 +1,124 @@ +#include "source_pw/module_stodft/sto_spectral_bounds.h" + +#include + +#include +#include +#include + +/** + * The rigorous bracket of the SDFT spectral interval needs the extremes of the + * nonlocal operator V_NL = sum_ij |beta_i> D_ij eigenvalues_2x2(const double s00, const double s01, const double s11, + const double d00, const double d01, const double d11) +{ + const double tr = s00 * d00 + s01 * d01 + s01 * d01 + s11 * d11; + const double det = (s00 * d00 + s01 * d01) * (s01 * d01 + s11 * d11) + - (s00 * d01 + s01 * d11) * (s01 * d00 + s11 * d01); + const double disc = std::sqrt(std::max(tr * tr - 4.0 * det, 0.0)); + return {(tr - disc) / 2.0, (tr + disc) / 2.0}; +} +} // namespace + +TEST(StoNonlocalBounds, matches_the_explicit_matrix) +{ + // two projectors, three plane waves, non-orthonormal beta set: + // beta_1 = (1,0,0), beta_2 = (1,1,0) -> S = [[1,1],[1,2]] + const int lda = 3; + const int npw = 3; + const int nkb = 2; + std::vector> vkb(static_cast(nkb) * lda, {0.0, 0.0}); + vkb[0 * lda + 0] = {1.0, 0.0}; + vkb[1 * lda + 0] = {1.0, 0.0}; + vkb[1 * lda + 1] = {1.0, 0.0}; + + // D = diag(2, 0.5) as stored by ABACUS + const int ntype = 1; + const int na[1] = {1}; + const int nh[1] = {2}; + std::vector deeq(static_cast(1) * 1 * 2 * 2, 0.0); + deeq[0] = 2.0; + deeq[3] = 0.5; + + const ModuleIO::NonlocalBounds b = ModuleIO::nonlocal_operator_bounds( + vkb.data(), lda, npw, nkb, deeq.data(), 1, 2, 2, 1, ntype, na, nh); + + ASSERT_TRUE(b.ok); + const auto lam = eigenvalues_2x2(1.0, 1.0, 2.0, 2.0, 0.0, 0.5); + // V_NL = B D B^dagger: its extremes are min(lam) and max(lam), plus 0 + EXPECT_NEAR(b.lo, std::min(0.0, lam.first), 1.0e-10); + EXPECT_NEAR(b.hi, std::max(0.0, lam.second), 1.0e-10); + EXPECT_NEAR(lam.second, 2.6180339887498949, 1.0e-10); // golden ratio^2 +} + +TEST(StoNonlocalBounds, is_the_union_over_spins) +{ + const int lda = 3; + const int npw = 3; + const int nkb = 2; + std::vector> vkb(static_cast(nkb) * lda, {0.0, 0.0}); + vkb[0 * lda + 0] = {1.0, 0.0}; + vkb[1 * lda + 0] = {1.0, 0.0}; + vkb[1 * lda + 1] = {1.0, 0.0}; + + const int ntype = 1; + const int na[1] = {1}; + const int nh[1] = {2}; + const int nspin = 2; + std::vector deeq(static_cast(nspin) * 1 * 2 * 2, 0.0); + deeq[0] = 2.0; // spin 0: D = diag(2, 0.5) + deeq[3] = 0.5; + deeq[4] = -1.0; // spin 1: D = diag(-1, -0.5) + deeq[7] = -0.5; + + const ModuleIO::NonlocalBounds b = ModuleIO::nonlocal_operator_bounds( + vkb.data(), lda, npw, nkb, deeq.data(), 1, 2, 2, nspin, ntype, na, nh); + + ASSERT_TRUE(b.ok); + const auto lam0 = eigenvalues_2x2(1.0, 1.0, 2.0, 2.0, 0.0, 0.5); + const auto lam1 = eigenvalues_2x2(1.0, 1.0, 2.0, -1.0, 0.0, -0.5); + EXPECT_NEAR(b.lo, std::min({0.0, lam0.first, lam1.first}), 1.0e-10); + EXPECT_NEAR(b.hi, std::max({0.0, lam0.second, lam1.second}), 1.0e-10); + // the union is strictly wider than the first spin alone on the attractive side, + // and unchanged on the other one (the second spin is the repulsive one) + EXPECT_LT(b.lo, std::min(0.0, lam0.first) - 1.0e-6); + EXPECT_NEAR(b.hi, std::max(0.0, lam0.second), 1.0e-10); +} + +TEST(StoNonlocalBounds, complex_projectors_preserve_the_hermitian_gram_matrix) +{ + const std::complex beta[] = {{1, 0}, {0, 0}, {0, 1}, {1, 0}}; + const int na[] = {1}; + const int nh[] = {2}; + for (int sign : {1, -1}) + { + const double d[] = {double(sign), 0, 0, double(sign)}; + const auto b = ModuleIO::nonlocal_operator_bounds(beta, 2, 2, 2, d, 1, 2, 2, 1, 1, na, nh); + const double extreme = (3.0 + std::sqrt(5.0)) / 2.0; + ASSERT_TRUE(b.ok); + EXPECT_NEAR(b.lo, sign < 0 ? -extreme : 0.0, 1e-12); + EXPECT_NEAR(b.hi, sign > 0 ? extreme : 0.0, 1e-12); + } +} + +TEST(StoNonlocalBounds, multiple_atoms_and_mixed_signs) +{ + const std::complex beta[] = {{1, 0}, {0, 0}, {0, 1}, {1, 0}}; + const int na[] = {2}; + const int nh[] = {1}; + const double d[] = {2, -1, -3, 1}; // [spin][atom][1][1] + const auto b = ModuleIO::nonlocal_operator_bounds(beta, 2, 2, 2, d, 2, 1, 1, 2, 1, na, nh); + ASSERT_TRUE(b.ok); + // Spin 0 has eigenvalues +/-sqrt(2); spin 1: (-1 +/- sqrt(13))/2. + EXPECT_NEAR(b.lo, (-1.0 - std::sqrt(13.0)) / 2.0, 1e-12); + EXPECT_NEAR(b.hi, std::sqrt(2.0), 1e-12); +} diff --git a/source/source_pw/module_stodft/unittests/test_sto_spectral_bounds.cpp b/source/source_pw/module_stodft/unittests/test_sto_spectral_bounds.cpp new file mode 100644 index 00000000000..a74c837f4db --- /dev/null +++ b/source/source_pw/module_stodft/unittests/test_sto_spectral_bounds.cpp @@ -0,0 +1,214 @@ +#include "../sto_spectral_bounds.h" + +#include "source_base/module_device/types.h" + +#include + +#include +#include +#include + +namespace +{ + +/// Diagonal operator with a prescribed spectrum: mimics H in the plane-wave +/// basis (a dense top from the kinetic cutoff, an isolated bottom state). +std::function*, std::complex*, const int)> diagonal_operator( + const std::vector& eig) +{ + return [&eig](std::complex* in, std::complex* out, const int nbands) { + for (int ib = 0; ib < nbands; ++ib) + { + for (size_t i = 0; i < eig.size(); ++i) + { + out[ib * eig.size() + i] = eig[i] * in[ib * eig.size() + i]; + } + } + }; +} + +std::vector plane_wave_like_spectrum(const int n) +{ + // eigenvalues in [-0.42, 210] Ry, dense near the top: eps_i = Ecut*(i/n)^2 - 0.42 + std::vector eig(n); + for (int i = 0; i < n; ++i) + { + const double s = double(i + 1) / n; + eig[i] = 210.0 * s * s - 0.42; + } + return eig; +} + +} // namespace + +TEST(StoDosQuality, lanczos_finds_the_extreme_eigenvalues) +{ + const int n = 2000; + const std::vector eig = plane_wave_like_spectrum(n); + const auto apply_H = diagonal_operator(eig); + + const ModuleIO::RangeBounds b + = ModuleIO::lanczos_spectral_bounds(apply_H, n, 40, 1.0e-6, 1.0e-2, 0, 0u); + + // The hard requirement for a Chebyshev interval is containment: every + // eigenvalue must be inside, otherwise |t| > 1 and T_n(t) diverges. The + // residual widening is sufficient for this particular test spectrum; it + // is not a general containment theorem. + EXPECT_LE(b.emin, eig.front()) << "lower bound must contain the spectrum"; + EXPECT_GE(b.emax, eig.back()) << "upper bound must contain the spectrum"; + // tightness: at most a couple of Ry wider than the true spectrum + EXPECT_LE(b.emax - b.emin, (eig.back() - eig.front()) + 2.0); + EXPECT_LE(b.steps, 40); +} + +TEST(StoDosQuality, lanczos_bounds_contain_random_vector_rayleigh_quotients) +{ + // A random vector gives the *mean* of the spectrum, never the ends; the + // Lanczos interval must contain it (and be much wider than it). + const int n = 1000; + const std::vector eig = plane_wave_like_spectrum(n); + const auto apply_H = diagonal_operator(eig); + const ModuleIO::RangeBounds b + = ModuleIO::lanczos_spectral_bounds(apply_H, n, 30, 1.0e-8, 0.0, 0, 0u); + + double mean = 0.0; + for (double e : eig) + { + mean += e; + } + mean /= n; + EXPECT_LT(b.emin, mean); + EXPECT_GT(b.emax, mean); + // the width has to reflect the real spectrum, not the mean + EXPECT_GT(b.emax - b.emin, 100.0); +} + +TEST(StoDosQuality, lanczos_handles_a_degenerate_spectrum) +{ + // Every state has the same energy: after the first step the residual is + // zero and the single Ritz value is exact. + const int n = 300; + std::vector eig(n, 3.5); + const auto apply_H = diagonal_operator(eig); + const ModuleIO::RangeBounds b + = ModuleIO::lanczos_spectral_bounds(apply_H, n, 10, 1.0e-10, 0.0, 0, 0u); + EXPECT_NEAR(b.emin, 3.5, 1.0e-8); + EXPECT_NEAR(b.emax, 3.5, 1.0e-8); + EXPECT_TRUE(b.converged); +} + +TEST(StoDosQuality, lanczos_reports_narrow_spectrum_accurately) +{ + const int n = 500; + std::vector eig(n); + for (int i = 0; i < n; ++i) + { + eig[i] = -1.0 + 2.0 * double(i) / (n - 1); // [-1, 1] + } + const auto apply_H = diagonal_operator(eig); + const ModuleIO::RangeBounds b + = ModuleIO::lanczos_spectral_bounds(apply_H, n, 60, 1.0e-9, 1.0e-6, 0, 0u); + EXPECT_LE(b.emin, -1.0); + EXPECT_GE(b.emax, 1.0); + EXPECT_LE(b.emax - b.emin, 2.0 + 0.05); +} + +// Full reorthogonalisation vs the "spectrum adaptive" variant of T. Chen +// (arXiv:2308.15683): skipping the reorthogonalisation must still deliver the +// extreme Ritz values, so the interval is usable, while using fewer inner products. +TEST(StoDosQuality, reorthogonalisation_can_be_skipped_for_the_bounds) +{ + const int n = 3000; + const std::vector eig = plane_wave_like_spectrum(n); + const auto apply_H = diagonal_operator(eig); + + const ModuleIO::RangeBounds with + = ModuleIO::lanczos_spectral_bounds(apply_H, n, 60, 1.0e-4, 1.0e-2, 0, 0u, false, true); + const ModuleIO::RangeBounds without + = ModuleIO::lanczos_spectral_bounds(apply_H, n, 60, 1.0e-4, 1.0e-2, 0, 0u, false, false); + + std::cout << "[reorth ] interval [" << with.emin << ", " << with.emax << "] " << with.seconds << " s\n"; + std::cout << "[no reorth] interval [" << without.emin << ", " << without.emax << "] " << without.seconds << " s\n"; + + // both must contain the spectrum and agree on the ends + EXPECT_LE(with.emin, eig.front()); + EXPECT_GE(with.emax, eig.back()); + EXPECT_LE(without.emin, eig.front()); + EXPECT_GE(without.emax, eig.back()); + EXPECT_NEAR(without.emin, with.emin, 1.0); + EXPECT_NEAR(without.emax, with.emax, 1.0); +} + +TEST(StoSpectralGrowth, uses_the_same_affine_map_as_the_expansion) +{ + const std::complex start(1.0, 0.0); + const std::vector high{1.5}; + const auto hhigh = diagonal_operator(high); + const double growth = ModuleIO::chebyshev_growth_check( + hhigh, 1, 10, -1.0, 1.0, &start, 1); + EXPECT_NEAR(growth, 7563.5, 1e-9); + const std::vector edge{1.0}; + const auto hedge = diagonal_operator(edge); + const double bounded = ModuleIO::chebyshev_growth_check( + hedge, 1, 10, 1.0, 3.0, &start, 1); + EXPECT_NEAR(bounded, 1.0, 1e-12); +} + +TEST(StoSpectralGrowth, detects_a_state_missed_at_the_scf_order) +{ + const std::vector spectrum{1.0001}; + const auto h = diagonal_operator(spectrum); + const std::complex start(1.0, 0.0); + const double low = ModuleIO::chebyshev_growth_check( + h, 1, 40, -1.0, 1.0, &start, 1); + const double high = ModuleIO::chebyshev_growth_check( + h, 1, 600, -1.0, 1.0, &start, 1); + EXPECT_LT(low, 1.5); + EXPECT_GT(high, 1000.0); +} + +TEST(StoDosQuality, exhausted_space_does_not_introduce_a_zero_eigenvalue) +{ + const std::vector spectrum{3.5}; + const auto h = diagonal_operator(spectrum); + const auto bounds = ModuleIO::lanczos_spectral_bounds( + h, 1, 30, 1e-10, 0.0, 0, 0u, false, true, nullptr, 1); + EXPECT_NEAR(bounds.ritz_min, 3.5, 1e-10); + EXPECT_NEAR(bounds.ritz_max, 3.5, 1e-10); +} + +TEST(StoSpectralGrowth, DenseProbeSeesDirectionsAbsentFromFirstTwoOrbitals) +{ + const std::vector spectrum{0.5, 1.0, 4.0}; + const auto h = diagonal_operator(spectrum); + for (int column = 0; column < 2; ++column) + { + std::complex orbital[3] = {}; + orbital[column] = 1.0; + const double growth = ModuleIO::chebyshev_growth_check( + h, 3, 40, 0.0, 2.0, orbital, 3); + EXPECT_LE(growth, 1.0); + } + const double dense = ModuleIO::random_chebyshev_growth_check( + h, 3, 3, 40, 0.0, 2.0, 0, 7u); + EXPECT_GT(dense, 1e20); + const double contained = ModuleIO::random_chebyshev_growth_check( + h, 3, 3, 40, 0.0, 4.1, 0, 7u); + EXPECT_LE(contained, 1.0 + 1e-12); +} + +TEST(StoSpectralBounds, PositiveSpectrumShiftAndExplicitStreamAreReproducible) +{ + const std::vector spectrum{0.5, 1.0, 4.0}; + const std::vector shifted{10.5, 11.0, 14.0}; + const auto h = diagonal_operator(spectrum); + const auto hs = diagonal_operator(shifted); + const auto a = ModuleIO::lanczos_spectral_bounds(h, 3, 30, 1e-10, 0.0, 0, 7u); + const auto b = ModuleIO::lanczos_spectral_bounds(hs, 3, 30, 1e-10, 0.0, 0, 9u); + const auto repeat = ModuleIO::lanczos_spectral_bounds(h, 3, 30, 1e-10, 0.0, 0, 7u); + EXPECT_DOUBLE_EQ(a.emin, repeat.emin); + EXPECT_DOUBLE_EQ(a.emax, repeat.emax); + EXPECT_GT(a.emin, 0.0); + EXPECT_NEAR(b.ritz_min - a.ritz_min, 10.0, 1e-10); + EXPECT_NEAR(b.ritz_max - a.ritz_max, 10.0, 1e-10); +} diff --git a/source/source_pw/module_stodft/unittests/test_sto_spectral_bounds_mpi.cpp b/source/source_pw/module_stodft/unittests/test_sto_spectral_bounds_mpi.cpp new file mode 100644 index 00000000000..af242d2cdb3 --- /dev/null +++ b/source/source_pw/module_stodft/unittests/test_sto_spectral_bounds_mpi.cpp @@ -0,0 +1,89 @@ +#include "../sto_spectral_bounds.h" +#include "source_base/module_device/types.h" +#include "source_base/parallel_global.h" +#include "source_base/parallel_reduce.h" + +#include +#include +#include + +namespace +{ +void check_rank_antisymmetric_mode(const bool symmetric_start, const int pool_size, const int pool_rank) +{ + ASSERT_TRUE(pool_size == 1 || pool_size == 2); + const int total = 6; + const int local = total / pool_size; + const int offset = local * pool_rank; + // Exact eigenvalues: {-3, 2, 2, 2, 2, 3}. Repeated rank-local + // blocks miss (e2-e5)/sqrt(2), the eigenvector at -3. + auto apply = [=](std::complex* in, std::complex* out, const int bands) { + for (int band = 0; band < bands; ++band) + { + std::complex full[total] = {}; + for (int i = 0; i < local; ++i) + { + full[offset + i] = in[band * local + i]; + } + Parallel_Reduce::reduce_pool(full, total); + for (int i = 0; i < local; ++i) + { + const int g = offset + i; + if (g == 2) { out[band * local + i] = 3.0 * full[5]; } + else if (g == 5) { out[band * local + i] = 3.0 * full[2]; } + else { out[band * local + i] = 2.0 * full[g]; } + } + } + }; + const std::vector> ones(local, 1.0); + const std::complex* start = symmetric_start ? ones.data() : nullptr; + for (int repeat = 0; repeat < 3; ++repeat) + { + const auto bounds = ModuleIO::lanczos_spectral_bounds( + apply, local, 30, 1e-8, 0.0, pool_rank, static_cast(repeat), false, true, start, local); + EXPECT_NEAR(bounds.emin, -3.0, 1e-10); + EXPECT_NEAR(bounds.emax, 3.0, 1e-10); + } +} +} + +class SpectralMPITest : public ::testing::Test +{ + public: + SpectralMPITest(const int size, const int rank, const bool restart) + : size_(size), rank_(rank), restart_(restart) {} + void TestBody() override { check_rank_antisymmetric_mode(restart_, size_, rank_); } + private: + const int size_; + const int rank_; + const bool restart_; +}; + +int main(int argc, char** argv) +{ + int size = 1; + int rank = 0; + int threads = 1; + int band_size = 1; + int band_rank = 0; + int band_group = 0; + int pool = 0; + int pool_size = 1; + int pool_rank = 0; + Parallel_Global::read_pal_param(argc, argv, size, threads, rank); + Parallel_Global::init_pools(size, rank, 1, 1, band_size, band_rank, band_group, + pool_size, pool_rank, pool); + int group_rank = 0; + int group_size = 1; + int group_color = 0; + Parallel_Global::split_grid_world(1, size, rank, group_rank, group_size); + Parallel_Global::split_diag_world(1, size, rank, group_rank, group_size, group_color); + ::testing::InitGoogleTest(&argc, argv); + ::testing::RegisterTest("StoSpectralBoundsMPI", "IndependentInitialDirections", nullptr, nullptr, + __FILE__, __LINE__, [=]() { return new SpectralMPITest(pool_size, pool_rank, false); }); + ::testing::RegisterTest("StoSpectralBoundsMPI", "IndependentRestartDirections", nullptr, nullptr, + __FILE__, __LINE__, [=]() { return new SpectralMPITest(pool_size, pool_rank, true); }); + const int result = RUN_ALL_TESTS(); + Parallel_Global::finalize_mpi(); + return result; +} diff --git a/tests/18_SDFT_FAST/01_C09_KS/INPUT b/tests/18_SDFT_FAST/01_C09_KS/INPUT new file mode 100644 index 00000000000..6e9a489cd19 --- /dev/null +++ b/tests/18_SDFT_FAST/01_C09_KS/INPUT @@ -0,0 +1,29 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type ksdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 0.6614877991617898 +nbands 20 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 diff --git a/tests/18_SDFT_FAST/01_C09_KS/KPT b/tests/18_SDFT_FAST/01_C09_KS/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/01_C09_KS/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/01_C09_KS/STRU b/tests/18_SDFT_FAST/01_C09_KS/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/01_C09_KS/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/01_C09_KS/reference.json b/tests/18_SDFT_FAST/01_C09_KS/reference.json new file mode 100644 index 00000000000..67e54c176a3 --- /dev/null +++ b/tests/18_SDFT_FAST/01_C09_KS/reference.json @@ -0,0 +1,58 @@ +{ + "expected": "normal", + "energy_eV": 260.6800260824528, + "entropy_Ry": -2.5414720804, + "ts_tails": [], + "ts_true_relative_errors": [], + "dos_spectra": [ + { + "energies_eV": [ + -129.1182651163222, + 403.5450697881483, + 647.4472672897625, + 647.4472674831458, + 647.4472675038779, + 705.7268432098568, + 705.7268435418828, + 1169.094425878354, + 1309.6064038433, + 1309.606404068183, + 1309.606404154367, + 1401.688817943296, + 1401.688817972509, + 1401.688818164961, + 1403.891630381352, + 1403.89163085932, + 1403.891630985295, + 1407.525379066221, + 1407.525379184048, + 2027.131542117677 + ], + "weights": [ + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0 + ], + "sigma_eV": 100.0 + } + ], + "ks": true, + "scf_intervals_Ry": [] +} diff --git a/tests/18_SDFT_FAST/01_C09_KS/result.ref b/tests/18_SDFT_FAST/01_C09_KS/result.ref new file mode 100644 index 00000000000..55140b851a9 --- /dev/null +++ b/tests/18_SDFT_FAST/01_C09_KS/result.ref @@ -0,0 +1,4 @@ +etotref 260.680026082452798 +etotperatomref 260.6800260825 +totaldosref 40.000000 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/01_C09_KS/threshold b/tests/18_SDFT_FAST/01_C09_KS/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/01_C09_KS/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/02_C348_MDFT/INPUT b/tests/18_SDFT_FAST/02_C348_MDFT/INPUT new file mode 100644 index 00000000000..02c8c2183c2 --- /dev/null +++ b/tests/18_SDFT_FAST/02_C348_MDFT/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 25.577528234255873 +nbands 7 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 2 +nbands_sto all +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/02_C348_MDFT/KPT b/tests/18_SDFT_FAST/02_C348_MDFT/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/02_C348_MDFT/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/02_C348_MDFT/STRU b/tests/18_SDFT_FAST/02_C348_MDFT/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/02_C348_MDFT/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/02_C348_MDFT/reference.json b/tests/18_SDFT_FAST/02_C348_MDFT/reference.json new file mode 100644 index 00000000000..6585616f7c5 --- /dev/null +++ b/tests/18_SDFT_FAST/02_C348_MDFT/reference.json @@ -0,0 +1,230 @@ +{ + "expected": "normal", + "energy_eV": -2632.387198641911, + "entropy_Ry": -333.1770090058, + "ts_tails": [ + 1.1056133609476669e-17, + 9.150286392275856e-19, + 8.073591868525071e-18, + 3.6380978298676266e-17, + 1.0454023214776179e-17 + ], + "ts_true_relative_errors": [ + 1.192784651020328e-15, + 6.820487432344224e-16, + 0.0, + 1.3648813471239247e-15, + 1.7061026818878007e-16 + ], + "dos_spectra": [ + { + "energies_eV": [ + -136.67594422298725, + 395.1432724213331, + 644.8249312910121, + 644.8249313486524, + 644.8249320293033, + 704.2310860808997, + 704.2310868416723, + 1163.3181877410932, + 1305.9721663470052, + 1305.9721664941185, + 1305.9721674091707, + 1401.204581921036, + 1401.2045823503336, + 1401.204582748434, + 1403.7811821830587, + 1403.7811825083852, + 1403.7811829268487, + 1405.2698753381508, + 1405.2698755668353, + 2024.0783757870847, + 2050.1727898527442, + 2050.172790827411, + 2050.1727909056012, + 2100.609673961931, + 2102.1844351259697, + 2102.1844354073864, + 2102.1844356522074, + 2746.518939525057, + 2746.5189401079297, + 2746.5189413933363, + 2756.5132940291974, + 2800.6650317867934, + 2800.665032209479, + 3338.7643394874513, + 3338.7643395883133, + 3338.7643401881633, + 3436.5515169800906, + 3499.3859209539746, + 3499.385921182598, + 3499.385921716115, + 3499.982133167584, + 3499.982134115075, + 3500.55642634958, + 3500.5564268882013, + 3500.556427027495, + 3500.746910404237, + 3500.746910897687, + 3500.746911065102, + 3500.835016929453, + 3500.8350173620684, + 3500.8350175963387, + 3502.7424109864382, + 3502.742411372258, + 3502.8956810226687, + 3502.895681164112, + 3502.8956814116846, + 3503.3292514550744, + 4101.312681098713, + 4101.312682188666, + 4101.312682253962, + 4184.180968660779, + 4198.967008817967, + 4198.978786974018, + 4198.978787499084, + 4198.978787710134, + 4200.231010185168, + 4200.231010529699, + 4200.769924667681, + 4200.7699249975085, + 4200.769925221683, + 4201.828313884077, + 4201.828314146951, + 4201.828314525613, + 4202.098544322433, + 4202.098544416237, + 4202.098544747193, + 4202.202786298531, + 4202.202786462495, + 4202.202786560662, + 4202.633956083458, + 4202.633956186736, + -136.67563299657405, + 395.14354151972253, + 644.8249289391325, + 644.8249435780086, + 644.8249585531122, + 704.2312162855719, + 704.2312408168336 + ], + "weights": [ + 1.1329090720724242e-13, + 5.0025877003289754e-12, + 4.581844821555271e-13, + 9.075431020425946e-13, + 1.7184722403416746e-13, + 1.1563894207323591e-11, + 3.199730961444583e-12, + 1.9999999999857825, + 1.9999999999998617, + 1.9999999999998481, + 1.9999999999988747, + 1.999999999999998, + 1.999999999999997, + 1.9999999999999991, + 1.9999999999999956, + 1.999999999999999, + 1.9999999999999873, + 1.9999999999962854, + 1.9999999999990552, + 1.9999999999999383, + 1.9999999999999678, + 1.9999999999999793, + 1.999999999999994, + 1.9999999999999962, + 1.999999999999999, + 1.9999999999999993, + 1.9999999999999993, + 1.9999999999999944, + 1.999999999999985, + 1.9999999999999893, + 1.9999999999999354, + 1.9999999999998863, + 1.9999999999997837, + 1.99999999999999, + 1.9999999999999933, + 1.9999999999999978, + 1.9999999999999163, + 1.9999999999999991, + 2.0000000000000004, + 2.0000000000000013, + 1.9999999999999798, + 1.999999999999991, + 2.000000000000001, + 1.9999999999999984, + 1.9999999999999991, + 1.9999999999999858, + 1.9999999999999947, + 1.9999999999999953, + 2.0000000000000004, + 1.9999999999999991, + 1.9999999999999998, + 1.9999999999999916, + 1.9999999999999991, + 2.000000000000001, + 2.0000000000000018, + 1.9999999999999996, + 2.0, + 1.99999999999999, + 1.9999999999999962, + 1.999999999999986, + 1.9999999999999478, + 1.9999999999999785, + 1.9999999999999851, + 1.9999999999999871, + 1.9999999999999962, + 1.999999999999997, + 1.9999999999999774, + 1.9999999999999898, + 1.9999999999999845, + 1.9999999999999956, + 1.999999999999999, + 2.0000000000000004, + 1.9999999999999907, + 1.999999999999997, + 1.9999999999999811, + 1.9999999999999756, + 1.9999999999999636, + 1.9999999999999896, + 1.999999999999947, + 1.9999999999999751, + 1.9999999999999902, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0 + ], + "sigma_eV": 100.0 + } + ], + "true_dos_interval_Ry": [ + -10.045493014984402, + 308.8877877626518 + ], + "scf_intervals_Ry": [ + [ + -9.73172909023458, + 308.8930208608015 + ], + [ + -9.901999743942554, + 308.88678954588704 + ], + [ + -10.046332335336842, + 308.88784399432774 + ], + [ + -10.045344000570822, + 308.88780685362974 + ], + [ + -10.045470140293446, + 308.8877982321092 + ] + ] +} diff --git a/tests/18_SDFT_FAST/02_C348_MDFT/result.ref b/tests/18_SDFT_FAST/02_C348_MDFT/result.ref new file mode 100644 index 00000000000..8b7485a1139 --- /dev/null +++ b/tests/18_SDFT_FAST/02_C348_MDFT/result.ref @@ -0,0 +1,4 @@ +etotref -2632.387198641910800 +etotperatomref -2632.3871986419 +totaldosref 161.998 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/02_C348_MDFT/threshold b/tests/18_SDFT_FAST/02_C348_MDFT/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/02_C348_MDFT/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/03_C1400_SDFT/INPUT b/tests/18_SDFT_FAST/03_C1400_SDFT/INPUT new file mode 100644 index 00000000000..a085ec3c854 --- /dev/null +++ b/tests/18_SDFT_FAST/03_C1400_SDFT/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 102.89810209183398 +nbands 0 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 2 +nbands_sto all +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/03_C1400_SDFT/KPT b/tests/18_SDFT_FAST/03_C1400_SDFT/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/03_C1400_SDFT/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/03_C1400_SDFT/STRU b/tests/18_SDFT_FAST/03_C1400_SDFT/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/03_C1400_SDFT/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/03_C1400_SDFT/reference.json b/tests/18_SDFT_FAST/03_C1400_SDFT/reference.json new file mode 100644 index 00000000000..9cbe285a48f --- /dev/null +++ b/tests/18_SDFT_FAST/03_C1400_SDFT/reference.json @@ -0,0 +1,216 @@ +{ + "expected": "normal", + "energy_eV": -23305.08480563327, + "entropy_Ry": -2388.2514294381, + "ts_tails": [ + 2.2117605342132548e-17, + 1.0163493738943317e-17, + 2.9896312308387154e-18, + 5.381336124835561e-18, + 8.968892527743162e-18 + ], + "ts_true_relative_errors": [ + 0.0, + 7.615469171867029e-16, + 9.520509531331551e-16, + 1.9041018741826783e-16, + 5.71230497695276e-16 + ], + "dos_spectra": [ + { + "energies_eV": [ + -144.2591372409406, + 390.1834235863962, + 641.6831132395048, + 641.6831132395124, + 641.6831132395159, + 704.4285379990705, + 704.4285379990728, + 1163.8411985598655, + 1303.7368692355053, + 1303.736869235507, + 1303.7368692355112, + 1399.9940617119212, + 1399.9940617119246, + 1399.9940617119269, + 1404.2750230818044, + 1404.275023081805, + 1404.2750230818062, + 1405.988987678519, + 1405.9889876785264, + 2026.4649518972005, + 2050.739545806703, + 2050.7395458067035, + 2050.739545806704, + 2099.617333646256, + 2101.6167119127654, + 2101.6167119127695, + 2101.6167119127754, + 2743.678541830536, + 2743.678541830537, + 2743.678541830538, + 2754.4232923649747, + 2799.46569541178, + 2799.4656954117804, + 3337.18521926351, + 3337.185219263513, + 3337.185219263515, + 3435.0744551935663, + 3497.9948348883363, + 3497.994834888337, + 3497.994834888338, + 3498.4934871605233, + 3498.4934871605246, + 3499.353988449968, + 3499.35398844997, + 3499.3539884499714, + 3499.980668873896, + 3499.980668873896, + 3499.980668873898, + 3500.3060698930817, + 3500.306069893082, + 3500.306069893087, + 3503.076175680464, + 3503.076175680466, + 3503.6899661802336, + 3503.689966180236, + 3503.6899661802377, + 3504.72037277997, + 4102.4761973505565, + 4102.476197350557, + 4102.476197350558, + 4183.6391810356945, + 4197.193848014244, + 4197.464360208798, + 4197.464360208801, + 4197.464360208804, + 4200.0519880483835, + 4200.051988048385, + 4200.888213546805, + 4200.888213546806, + 4200.888213546807, + 4202.1612458188365, + 4202.161245818837, + 4202.161245818839, + 4202.183992058194, + 4202.183992058194, + 4202.183992058195, + 4202.325442327516, + 4202.325442327517, + 4202.325442327518, + 4203.334667800844, + 4203.334667800846 + ], + "weights": [ + 1.999999999999997, + 2.0000000000000013, + 2.000000000000001, + 1.9999999999999998, + 1.9999999999999991, + 1.9999999999999996, + 2.0000000000000004, + 2.0000000000000044, + 2.0000000000000013, + 1.9999999999999993, + 1.9999999999999996, + 1.999999999999997, + 2.000000000000001, + 2.0000000000000013, + 2.0000000000000013, + 1.9999999999999996, + 2.0000000000000013, + 1.9999999999999991, + 1.9999999999999978, + 2.0, + 2.0, + 2.0000000000000004, + 2.0, + 2.0, + 1.9999999999999993, + 1.9999999999999993, + 1.9999999999999993, + 2.0000000000000004, + 1.9999999999999984, + 2.0000000000000013, + 1.9999999999999993, + 2.0000000000000018, + 2.0000000000000004, + 1.9999999999999984, + 2.0000000000000018, + 2.0000000000000018, + 1.9999999999999998, + 2.0000000000000004, + 2.000000000000001, + 1.9999999999999998, + 1.999999999999999, + 1.9999999999999996, + 2.000000000000002, + 2.0, + 2.0, + 1.9999999999999996, + 2.0000000000000004, + 2.000000000000001, + 2.000000000000001, + 2.000000000000001, + 2.0000000000000013, + 1.9999999999999987, + 2.0000000000000027, + 2.000000000000001, + 2.000000000000002, + 2.0, + 2.0, + 2.000000000000002, + 2.0, + 2.0000000000000013, + 1.999999999999999, + 2.000000000000001, + 1.9999999999999996, + 2.0000000000000018, + 2.000000000000003, + 1.9999999999999996, + 1.9999999999999993, + 1.9999999999999998, + 1.999999999999999, + 1.9999999999999998, + 2.000000000000001, + 1.9999999999999973, + 2.0000000000000018, + 2.0000000000000004, + 2.000000000000002, + 1.9999999999999998, + 1.9999999999999996, + 1.999999999999998, + 1.999999999999998, + 2.0000000000000018, + 1.9999999999999996 + ], + "sigma_eV": 100.0 + } + ], + "true_dos_interval_Ry": [ + -10.602847221872821, + 308.93928909790924 + ], + "scf_intervals_Ry": [ + [ + -9.73172909023458, + 308.8930208608015 + ], + [ + -10.192614177600944, + 308.8977501964805 + ], + [ + -10.603189548708713, + 308.93900216067556 + ], + [ + -10.60321089416965, + 308.93935323508157 + ], + [ + -10.602842167764436, + 308.93928803674356 + ] + ] +} diff --git a/tests/18_SDFT_FAST/03_C1400_SDFT/result.ref b/tests/18_SDFT_FAST/03_C1400_SDFT/result.ref new file mode 100644 index 00000000000..7addb2878b6 --- /dev/null +++ b/tests/18_SDFT_FAST/03_C1400_SDFT/result.ref @@ -0,0 +1,4 @@ +etotref -23305.084805633268843 +etotperatomref -23305.0848056333 +totaldosref 161.998 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/03_C1400_SDFT/threshold b/tests/18_SDFT_FAST/03_C1400_SDFT/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/03_C1400_SDFT/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/INPUT b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/INPUT new file mode 100644 index 00000000000..283633cc86f --- /dev/null +++ b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 25.577528234255873 +nbands 7 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 1 +nbands_sto all +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/KPT b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/STRU b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/reference.json b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/reference.json new file mode 100644 index 00000000000..c912658755a --- /dev/null +++ b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/reference.json @@ -0,0 +1,230 @@ +{ + "expected": "normal", + "energy_eV": -2632.387198641949, + "entropy_Ry": -333.1770090058, + "ts_tails": [ + 4.2562099475753e-18, + 2.1295314334956524e-18, + 1.9176861175738073e-17, + 4.2615101553242745e-18, + 1.4288312974182676e-31 + ], + "ts_true_relative_errors": [ + 6.815912291544733e-16, + 2.387170601320481e-15, + 1.1942752582216594e-15, + 0.0, + 6.82441072755123e-16 + ], + "dos_spectra": [ + { + "energies_eV": [ + -136.67594422130279, + 395.14327242264943, + 644.8249312917806, + 644.8249313493967, + 644.8249320300325, + 704.2310860807173, + 704.2310868414165, + 1163.3181877410173, + 1305.9721663480846, + 1305.9721664951846, + 1305.972167410228, + 1401.2045819212149, + 1401.2045823505075, + 1401.2045827485963, + 1403.7811821827122, + 1403.7811825079912, + 1403.7811829264779, + 1405.2698753380278, + 1405.2698755666245, + 2024.0783757867364, + 2050.172789852807, + 2050.1727908274906, + 2050.1727909056535, + 2100.6096739618743, + 2102.18443512622, + 2102.1844354076393, + 2102.184435652434, + 2746.5189395255443, + 2746.5189401084262, + 2746.518941393769, + 2756.5132940293056, + 2800.665031787326, + 2800.665032209969, + 3338.764339487714, + 3338.764339588627, + 3338.7643401884284, + 3436.5515169805803, + 3499.385920954609, + 3499.385921183256, + 3499.3859217167847, + 3499.9821331686267, + 3499.982134116061, + 3500.556426350081, + 3500.5564268886915, + 3500.5564270279297, + 3500.7469104044208, + 3500.746910897891, + 3500.746911065295, + 3500.8350169293067, + 3500.835017361862, + 3500.8350175961996, + 3502.7424109862773, + 3502.742411371969, + 3502.895681022355, + 3502.895681163738, + 3502.8956814113126, + 3503.3292514545274, + 4101.312681098591, + 4101.3126821886, + 4101.312682253869, + 4184.180968661089, + 4198.967008819128, + 4198.978786974697, + 4198.978787499758, + 4198.97878771085, + 4200.231010184752, + 4200.231010529293, + 4200.76992466754, + 4200.769924997299, + 4200.769925221492, + 4201.828313884139, + 4201.82831414702, + 4201.828314525649, + 4202.098544322354, + 4202.098544416209, + 4202.098544747119, + 4202.202786298654, + 4202.2027864626, + 4202.202786560786, + 4202.63395608352, + 4202.633956186716, + -136.67563299653037, + 395.14354151971634, + 644.8249289391529, + 644.8249435780347, + 644.824958553134, + 704.2312162855889, + 704.231240816845 + ], + "weights": [ + 1.1325170377841251e-13, + 5.001630844089378e-12, + 4.581191391553394e-13, + 9.077962735498902e-13, + 1.7183353802291427e-13, + 1.1563574387258285e-11, + 3.199287616886433e-12, + 1.9999999999857856, + 1.999999999999862, + 1.9999999999998483, + 1.999999999998875, + 1.9999999999999938, + 1.9999999999999964, + 1.999999999999998, + 1.9999999999999973, + 1.9999999999999978, + 1.9999999999999871, + 1.9999999999962867, + 1.9999999999990574, + 1.9999999999999387, + 1.999999999999968, + 1.9999999999999782, + 1.9999999999999918, + 1.9999999999999936, + 1.9999999999999993, + 1.999999999999998, + 2.0000000000000004, + 1.9999999999999947, + 1.999999999999985, + 1.9999999999999902, + 1.9999999999999352, + 1.9999999999998863, + 1.999999999999783, + 1.9999999999999893, + 1.9999999999999922, + 1.999999999999997, + 1.9999999999999145, + 2.000000000000001, + 2.0, + 1.9999999999999991, + 1.9999999999999827, + 1.99999999999999, + 2.0000000000000004, + 1.9999999999999998, + 2.0000000000000004, + 1.9999999999999858, + 1.9999999999999953, + 1.9999999999999944, + 1.9999999999999987, + 2.0, + 1.999999999999998, + 1.9999999999999925, + 1.999999999999999, + 1.9999999999999993, + 2.000000000000001, + 2.0, + 1.999999999999999, + 1.9999999999999896, + 1.9999999999999951, + 1.9999999999999856, + 1.9999999999999465, + 1.9999999999999811, + 1.9999999999999845, + 1.999999999999987, + 1.9999999999999976, + 1.9999999999999976, + 1.9999999999999747, + 1.9999999999999907, + 1.9999999999999845, + 1.999999999999996, + 1.9999999999999962, + 1.999999999999999, + 1.9999999999999885, + 1.999999999999997, + 1.9999999999999798, + 1.9999999999999751, + 1.9999999999999616, + 1.9999999999999896, + 1.9999999999999474, + 1.999999999999975, + 1.9999999999999882, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0 + ], + "sigma_eV": 100.0 + } + ], + "true_dos_interval_Ry": [ + -10.045493014860597, + 308.8877877626503 + ], + "scf_intervals_Ry": [ + [ + -9.731729090234637, + 308.89302086080164 + ], + [ + -9.901999743942667, + 308.88678954588704 + ], + [ + -10.046332335337127, + 308.8878439943276 + ], + [ + -10.04534400057048, + 308.8878068536298 + ], + [ + -10.045470140290206, + 308.887798232108 + ] + ] +} diff --git a/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/result.ref b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/result.ref new file mode 100644 index 00000000000..b051765c0d4 --- /dev/null +++ b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/result.ref @@ -0,0 +1,4 @@ +etotref -2632.387198641948999 +etotperatomref -2632.3871986419 +totaldosref 161.998 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/threshold b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/04_C348_METHOD1_MPI/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/INPUT b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/INPUT new file mode 100644 index 00000000000..219f7b0f109 --- /dev/null +++ b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 2 +bndpar 2 +ecutwfc 400 +smearing_method fd +smearing_sigma 102.89810209183398 +nbands 0 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 2 +nbands_sto all +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/KPT b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/KPT new file mode 100644 index 00000000000..463ef99219f --- /dev/null +++ b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/KPT @@ -0,0 +1,5 @@ +K_POINTS +2 +Direct +0 0 0 0.5 +0.17 0.23 0.11 0.5 diff --git a/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/STRU b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/reference.json b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/reference.json new file mode 100644 index 00000000000..69a8db69e75 --- /dev/null +++ b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/reference.json @@ -0,0 +1,759 @@ +{ + "expected": "normal", + "energy_eV": -23347.46219188074, + "entropy_Ry": -2400.2495003789, + "ts_tails": [ + 4.758283220665391e-18, + 2.6768892830072135e-18, + 1.6360778647232044e-18, + 1.1750013581097086e-17, + 1.487343322466986e-18 + ], + "ts_true_relative_errors": [ + 5.682299578601896e-16, + 3.788702123422432e-16, + 7.578335655302049e-16, + 1.8945838856660093e-16, + 1.894583670633747e-16 + ], + "dos_spectra": [ + { + "energies_eV": [ + -96.12738742340649, + 305.1157371687523, + 456.45413848654493, + 550.5597643871868, + 781.97401689333, + 864.8534135411132, + 925.8274221599843, + 974.5765105803617, + 1018.2173965807488, + 1065.2643223973237, + 1237.5237429247657, + 1341.4860469394098, + 1348.7626831293044, + 1422.1137115966785, + 1490.2294839890867, + 1523.9898063253863, + 1611.3298745696427, + 1729.578810566274, + 1810.569452259613, + 1898.7333500851819, + 1913.2564982348904, + 2002.8967776948884, + 2068.4363695314987, + 2170.94429456049, + 2222.732901067053, + 2338.646941016495, + 2389.743941688781, + 2505.104811905804, + 2555.2507053554177, + 2640.19425676803, + 2736.5609272882457, + 2750.9506899186626, + 2850.9430788519503, + 2896.358137401843, + 2919.9288191929886, + 2998.9547865564405, + 3042.655526285624, + 3135.063299028242, + 3141.1690980405847, + 3202.5581968101374, + 3221.6309027008747, + 3292.8204586435545, + 3319.7338168419, + 3382.800338651098, + 3389.257196780889, + 3451.4386992280065, + 3485.320358734454, + 3514.453439069911, + 3540.7768952943784, + 3568.438637936138, + 3605.251373881682, + 3625.9996830266537, + 3680.4804085002993, + 3709.3416024757157, + 3854.335612536885, + 3876.5800952597247, + 3923.428049044102, + 3959.9085424109276, + 3990.309822778872, + 4009.691343769007, + 4032.5469962882576, + 4044.926668278568, + 4090.0973964307514, + 4172.038179722969, + 4184.919911288644, + 4244.881490976016, + 4264.93342205053, + 4334.276157421055, + 4357.5007390491755, + 4433.162706407925, + 4474.227454412617, + 4503.4515874416875, + 4512.837473147225, + 4533.652806388662, + 4566.058286655772, + 4645.0560344456135, + 4701.415073034222, + 4816.925245969639, + 4867.741247318959, + 4898.6020499476435, + 4984.409207254362, + 5078.668169896063, + 5123.149721277996, + 5167.815651828008, + 5209.570698901567, + 5253.4890489450545, + 5294.634635087209, + 5319.490818784693, + 5387.300211284961, + 5395.709695800985 + ], + "weights": [ + 0.06293543450021656, + 0.20757113149665812, + 0.5643083880305878, + 0.19821376888303527, + 0.2783750561757837, + 0.6137861021945532, + 0.13319919472794942, + 0.07134273484074187, + 0.4988813128811478, + 0.41869866146182805, + 0.11348779226039013, + 0.5454466090583887, + 0.334579666517924, + 0.9341310308422336, + 0.4288753332965633, + 0.5217395570435895, + 0.0847395775513206, + 0.9426904391400758, + 0.048789570338619206, + 0.00946324488363387, + 0.01971008386891392, + 0.017151393745337418, + 0.9519089618528264, + 0.027507101137960663, + 0.009857454520537415, + 0.9875095127180508, + 0.9797093185239716, + 0.025223004423559583, + 0.04267731603099232, + 0.851553918719041, + 0.5542689400890087, + 0.5433445756607593, + 0.08861559521658632, + 0.5055929032927261, + 0.4528801839075776, + 0.8713518737608409, + 0.09966375492266293, + 0.07001262342534009, + 0.051467627755264256, + 0.9777979453406229, + 0.9000747330825462, + 0.9851805839755388, + 0.9806695613447148, + 0.9541124070466772, + 0.9561415545171458, + 0.21363485939304497, + 0.07405571957399225, + 0.4250324426920911, + 0.4457456962636201, + 0.03553526299397087, + 0.9203325120833759, + 0.9726451646126799, + 0.3580745793373171, + 0.6606032690240858, + 0.30698399792398295, + 0.701694370138413, + 0.8609090082691364, + 0.9758863431213329, + 0.6089296891337275, + 0.5288216084074273, + 0.8060854117601192, + 0.1562555016354603, + 0.08536054666665219, + 0.458325772648181, + 0.5308399618235551, + 0.9607362543443501, + 0.9966902886467405, + 0.49615471635694364, + 0.4954113234145762, + 0.05482055819616481, + 0.08933212227705908, + 0.309304933757971, + 0.6641516143075851, + 0.9193725201016991, + 0.9864129964335397, + 0.9531339408468776, + 0.05216065686219522, + 0.987281416422899, + 0.9949503990808596, + 0.9833436856974511, + 0.024677969773603082, + 0.9441672694701467, + 0.1041765372003118, + 0.9463876212270571, + 0.9823764430886189, + 0.9876461192200744, + 0.02495828017770876, + 0.009537482149528355, + 0.42588071250859033, + 0.5659448859310382 + ], + "sigma_eV": 100.0 + }, + { + "energies_eV": [ + -144.25384934548035, + 390.1841561173848, + 641.6853749002208, + 641.686385175785, + 641.6869401441346, + 704.427551703787, + 704.4284797553366, + 1163.8379713459017, + 1303.7389343486393, + 1303.7395544502128, + 1303.7400004402348, + 1399.9937549772817, + 1399.9957535289286, + 1399.9966700203702, + 1404.2732113082034, + 1404.2738501067995, + 1404.2751954838811, + 1405.9879815889824, + 1405.9884312914805, + 2026.462032620515, + 2050.7375577730113, + 2050.7384128475082, + 2050.7391811250595, + 2099.6180627266654, + 2101.6174216102, + 2101.6176678012785, + 2101.6183478086996, + 2743.678285661857, + 2743.680144579474, + 2743.681009340836, + 2754.4238767345555, + 2799.467278538747, + 2799.467662242502, + 3337.178079540189, + 3337.182185961296, + 3337.1846202339266, + 3435.076668933429, + 3497.997909714987, + 3497.998509154768, + 3498.000008481392, + 3498.4957736446554, + 3498.4965968778724, + 3499.3549939746063, + 3499.3554343087094, + 3499.35647197126, + 3499.9801279547773, + 3499.9826381897637, + 3499.983547953762, + 3500.3044613362, + 3500.3052338694247, + 3500.3067434466584, + 3503.074892310278, + 3503.075494576071, + 3503.688308355933, + 3503.688592383342, + 3503.689450128993, + 3504.7191551900464, + 4102.469203052227, + 4102.473116488087, + 4102.474959821252, + 4183.64175509924, + 4197.20064904324, + 4197.46487772744, + 4197.466450250411, + 4197.468249313158, + 4200.050837611922, + 4200.051231163787, + 4200.88842351744, + 4200.888561656165, + 4200.888652757937, + 4202.16169011088, + 4202.161834241316, + 4202.162024582276, + 4202.182636032159, + 4202.182907444518, + 4202.183689382265, + 4202.324929160992, + 4202.3266839494645, + 4202.3272455237, + 4203.3336763756815, + 4203.333848572519 + ], + "weights": [ + 0.024648979233347464, + 0.17159902664103502, + 0.1544916406334647, + 0.015679729857297445, + 0.3433851293516902, + 0.058719358449133154, + 0.2750866482996906, + 0.3142079547028858, + 0.45822720403426787, + 0.2608104318482299, + 0.28050307745553027, + 0.2766739226182682, + 0.48318082763724945, + 0.24084059817285922, + 0.4046147683049753, + 0.2505436064465314, + 0.3449227459847954, + 0.3490343633922031, + 0.3172370220412901, + 0.489505814905726, + 0.5020736567361692, + 0.49384542016389293, + 0.4926129761233203, + 0.5000428315472417, + 0.4999366880970608, + 0.49995442458207234, + 0.499610711939812, + 0.022537803954108183, + 0.035709248008484844, + 0.9659890014222583, + 0.3371580697995649, + 0.5480991025010077, + 0.119369520770438, + 0.4854456106638552, + 0.31182479718425865, + 0.7088240879515589, + 0.49834730556416473, + 0.43565230104523234, + 0.6885949274332545, + 0.3763254251478227, + 0.6104920087294154, + 0.38961520725463206, + 0.5022365491471326, + 0.4917366346651071, + 0.5070367191083239, + 0.5047047572414595, + 0.4546263644072013, + 0.5409686084936276, + 0.27380978276095724, + 0.7078328727948078, + 0.5192586300677097, + 0.5863986631208044, + 0.41364235975194263, + 0.724700685949471, + 0.28210358395548346, + 0.4932747336152263, + 0.5000028362113542, + 0.7131604493906589, + 0.6622272407131974, + 0.7180884759237787, + 0.706227933509939, + 0.7082808078862407, + 0.6511525725406924, + 0.7487670344039752, + 0.7246314905552794, + 0.6698016210552968, + 0.7468334523504978, + 0.6983941253857258, + 0.7214729460824126, + 0.7045113645160244, + 0.627764506776839, + 0.7554974096581035, + 0.7426847542741524, + 0.6376931805672988, + 0.7169642352913769, + 0.7697005621372517, + 0.6759857738964389, + 0.6647712747438365, + 0.7814318290662696, + 0.850613321407742, + 0.5650358799463602 + ], + "sigma_eV": 100.0 + }, + { + "energies_eV": [ + -96.12738742340649, + 305.1157371687523, + 456.45413848654493, + 550.5597643871868, + 781.97401689333, + 864.8534135411132, + 925.8274221599843, + 974.5765105803617, + 1018.2173965807488, + 1065.2643223973237, + 1237.5237429247657, + 1341.4860469394098, + 1348.7626831293044, + 1422.1137115966785, + 1490.2294839890867, + 1523.9898063253863, + 1611.3298745696427, + 1729.578810566274, + 1810.569452259613, + 1898.7333500851819, + 1913.2564982348904, + 2002.8967776948884, + 2068.4363695314987, + 2170.94429456049, + 2222.732901067053, + 2338.646941016495, + 2389.743941688781, + 2505.104811905804, + 2555.2507053554177, + 2640.19425676803, + 2736.5609272882457, + 2750.9506899186626, + 2850.9430788519503, + 2896.358137401843, + 2919.9288191929886, + 2998.9547865564405, + 3042.655526285624, + 3135.063299028242, + 3141.1690980405847, + 3202.5581968101374, + 3221.6309027008747, + 3292.8204586435545, + 3319.7338168419, + 3382.800338651098, + 3389.257196780889, + 3451.4386992280065, + 3485.320358734454, + 3514.453439069911, + 3540.7768952943784, + 3568.438637936138, + 3605.251373881682, + 3625.9996830266537, + 3680.4804085002993, + 3709.3416024757157, + 3854.335612536885, + 3876.5800952597247, + 3923.428049044102, + 3959.9085424109276, + 3990.309822778872, + 4009.691343769007, + 4032.5469962882576, + 4044.926668278568, + 4090.0973964307514, + 4172.038179722969, + 4184.919911288644, + 4244.881490976016, + 4264.93342205053, + 4334.276157421055, + 4357.5007390491755, + 4433.162706407925, + 4474.227454412617, + 4503.4515874416875, + 4512.837473147225, + 4533.652806388662, + 4566.058286655772, + 4645.0560344456135, + 4701.415073034222, + 4816.925245969639, + 4867.741247318959, + 4898.6020499476435, + 4984.409207254362, + 5078.668169896063, + 5123.149721277996, + 5167.815651828008, + 5209.570698901567, + 5253.4890489450545, + 5294.634635087209, + 5319.490818784693, + 5387.300211284961, + 5395.709695800985 + ], + "weights": [ + 0.9370645654997837, + 0.7924288685033425, + 0.4356916119694118, + 0.801786231116966, + 0.7216249438242167, + 0.38621389780544607, + 0.8668008052720507, + 0.9286572651592587, + 0.5011186871188521, + 0.581301338538172, + 0.8865122077396095, + 0.45455339094161135, + 0.6654203334820755, + 0.0658689691577667, + 0.5711246667034372, + 0.4782604429564103, + 0.9152604224486793, + 0.05730956085992302, + 0.951210429661381, + 0.9905367551163661, + 0.9802899161310851, + 0.9828486062546622, + 0.04809103814717309, + 0.9724928988620395, + 0.9901425454794618, + 0.012490487281948959, + 0.020290681476028676, + 0.9747769955764403, + 0.9573226839690078, + 0.1484460812809589, + 0.44573105991099127, + 0.45665542433924017, + 0.9113844047834124, + 0.49440709670727434, + 0.5471198160924229, + 0.1286481262391589, + 0.9003362450773371, + 0.9299873765746597, + 0.9485323722447355, + 0.022202054659376767, + 0.09992526691745322, + 0.014819416024461384, + 0.01933043865528557, + 0.04588759295332277, + 0.04385844548285413, + 0.7863651406069548, + 0.9259442804260082, + 0.5749675573079078, + 0.5542543037363802, + 0.9644647370060306, + 0.07966748791662379, + 0.02735483538732042, + 0.6419254206626831, + 0.3393967309759145, + 0.6930160020760171, + 0.2983056298615874, + 0.13909099173086367, + 0.02411365687866687, + 0.39107031086627286, + 0.4711783915925729, + 0.19391458823988084, + 0.8437444983645398, + 0.9146394533333482, + 0.5416742273518188, + 0.4691600381764447, + 0.039263745655650155, + 0.0033097113532588466, + 0.5038452836430563, + 0.5045886765854243, + 0.9451794418038366, + 0.9106678777229411, + 0.690695066242029, + 0.3358483856924148, + 0.08062747989830153, + 0.013587003566460807, + 0.046866059153123044, + 0.9478393431378052, + 0.012718583577101126, + 0.0050496009191406, + 0.016656314302547586, + 0.9753220302263969, + 0.05583273052985304, + 0.8958234627996879, + 0.05361237877294242, + 0.017623556911381278, + 0.01235388077992546, + 0.9750417198222917, + 0.9904625178504721, + 0.5741192874914111, + 0.4340551140689624 + ], + "sigma_eV": 100.0 + }, + { + "energies_eV": [ + -144.25384934548035, + 390.1841561173848, + 641.6853749002208, + 641.686385175785, + 641.6869401441346, + 704.427551703787, + 704.4284797553366, + 1163.8379713459017, + 1303.7389343486393, + 1303.7395544502128, + 1303.7400004402348, + 1399.9937549772817, + 1399.9957535289286, + 1399.9966700203702, + 1404.2732113082034, + 1404.2738501067995, + 1404.2751954838811, + 1405.9879815889824, + 1405.9884312914805, + 2026.462032620515, + 2050.7375577730113, + 2050.7384128475082, + 2050.7391811250595, + 2099.6180627266654, + 2101.6174216102, + 2101.6176678012785, + 2101.6183478086996, + 2743.678285661857, + 2743.680144579474, + 2743.681009340836, + 2754.4238767345555, + 2799.467278538747, + 2799.467662242502, + 3337.178079540189, + 3337.182185961296, + 3337.1846202339266, + 3435.076668933429, + 3497.997909714987, + 3497.998509154768, + 3498.000008481392, + 3498.4957736446554, + 3498.4965968778724, + 3499.3549939746063, + 3499.3554343087094, + 3499.35647197126, + 3499.9801279547773, + 3499.9826381897637, + 3499.983547953762, + 3500.3044613362, + 3500.3052338694247, + 3500.3067434466584, + 3503.074892310278, + 3503.075494576071, + 3503.688308355933, + 3503.688592383342, + 3503.689450128993, + 3504.7191551900464, + 4102.469203052227, + 4102.473116488087, + 4102.474959821252, + 4183.64175509924, + 4197.20064904324, + 4197.46487772744, + 4197.466450250411, + 4197.468249313158, + 4200.050837611922, + 4200.051231163787, + 4200.88842351744, + 4200.888561656165, + 4200.888652757937, + 4202.16169011088, + 4202.161834241316, + 4202.162024582276, + 4202.182636032159, + 4202.182907444518, + 4202.183689382265, + 4202.324929160992, + 4202.3266839494645, + 4202.3272455237, + 4203.3336763756815, + 4203.333848572519 + ], + "weights": [ + 0.9753510207666525, + 0.8284009733589645, + 0.8455083593665357, + 0.9843202701427018, + 0.656614870648309, + 0.9412806415508658, + 0.7249133517003099, + 0.6857920452971141, + 0.5417727959657321, + 0.7391895681517704, + 0.7194969225444696, + 0.7233260773817313, + 0.5168191723627509, + 0.7591594018271411, + 0.5953852316950252, + 0.7494563935534695, + 0.6550772540152052, + 0.6509656366077969, + 0.6827629779587107, + 0.5104941850942728, + 0.4979263432638309, + 0.506154579836107, + 0.5073870238766793, + 0.4999571684527586, + 0.5000633119029396, + 0.5000455754179277, + 0.5003892880601881, + 0.9774621960458924, + 0.9642907519915157, + 0.034010998577741966, + 0.6628419302004345, + 0.4519008974989925, + 0.8806304792295625, + 0.5145543893361445, + 0.6881752028157414, + 0.29117591204844095, + 0.5016526944358356, + 0.5643476989547682, + 0.31140507256674593, + 0.6236745748521776, + 0.38950799127058433, + 0.6103847927453672, + 0.49776345085286705, + 0.5082633653348918, + 0.4929632808916754, + 0.4952952427585404, + 0.545373635592799, + 0.45903139150637234, + 0.7261902172390423, + 0.29216712720519245, + 0.48074136993228966, + 0.4136013368791958, + 0.5863576402480575, + 0.2752993140505294, + 0.7178964160445166, + 0.5067252663847732, + 0.49999716378864645, + 0.28683955060934113, + 0.3377727592868036, + 0.28191152407622194, + 0.29377206649006204, + 0.2917191921137598, + 0.348847427459308, + 0.2512329655960251, + 0.27536850944472085, + 0.33019837894470333, + 0.2531665476495028, + 0.30160587461427435, + 0.2785270539175887, + 0.2954886354839752, + 0.37223549322316063, + 0.24450259034189714, + 0.2573152457258471, + 0.36230681943270115, + 0.2830357647086231, + 0.23029943786274817, + 0.32401422610356106, + 0.33522872525616365, + 0.2185681709337302, + 0.14938667859225824, + 0.43496412005363977 + ], + "sigma_eV": 100.0 + } + ], + "true_dos_interval_Ry": [ + -10.602458568864336, + 396.5772058001717 + ], + "scf_intervals_Ry": [ + [ + -9.73172909023458, + 396.64516400846463 + ], + [ + -10.19243210705423, + 396.59937117830356 + ], + [ + -10.602798504664463, + 396.57736173062466 + ], + [ + -10.602824258939847, + 396.57719141213397 + ], + [ + -10.602453593627729, + 396.57720625457245 + ] + ] +} diff --git a/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/result.ref b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/result.ref new file mode 100644 index 00000000000..fb4919c1171 --- /dev/null +++ b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/result.ref @@ -0,0 +1,4 @@ +etotref -23347.462191880738828 +etotperatomref -23347.4621918807 +totaldosref 171 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/threshold b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/05_C1400_KPOOL_BAND_MPI/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/INPUT b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/INPUT new file mode 100644 index 00000000000..fb303b27873 --- /dev/null +++ b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 4 +ecutwfc 400 +smearing_method fd +smearing_sigma 102.89810209183398 +nbands 0 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 2 +nbands_sto 2 +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 32 diff --git a/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/KPT b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/STRU b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/reference.json b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/reference.json new file mode 100644 index 00000000000..2e908f34851 --- /dev/null +++ b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/reference.json @@ -0,0 +1,723 @@ +{ + "expected": "normal", + "energy_eV": -23099.3865938399, + "entropy_Ry": -2396.9399321059, + "ts_tails": [ + 1.7441246419395612e-17, + 0.0, + 1.875441002036227e-17, + 2.099032051812574e-18, + 6.063976810690202e-18 + ], + "ts_true_relative_errors": [ + 3.79654128692911e-16, + 5.693045080981583e-16, + 7.5888089422141485e-16, + 3.984123267426614e-15, + 1.3280397283082849e-15 + ], + "dos_spectra": [ + { + "energies_eV": [ + -148.42429220654438, + 394.05395718627415, + 640.7620085288922, + 643.8292036174686, + 645.3294977458993, + 708.2657028036648, + 709.0345310900252, + 1175.790607429806, + 1305.2689300906616, + 1309.598475511505, + 1310.5645411643115, + 1403.1324958461785, + 1404.4031793803138, + 1405.0666510275084, + 1407.649058788924, + 1408.6744328191492, + 1409.530291382195, + 1412.605043436398, + 1415.4806444838234, + 2037.8572167393866, + 2055.5306781407226, + 2057.0728235789675, + 2060.400840874815, + 2106.0121652249563, + 2107.0469159687723, + 2107.7063206212833, + 2109.318864227083, + 2745.085052531634, + 2745.223291111908, + 2746.50244118577, + 2759.1791241861815, + 2801.2223080629064, + 2804.1480718227813, + 3340.544808011372, + 3344.711025168565, + 3346.06597190763, + 3444.1143006354955, + 3497.893566358187, + 3498.5964194982753, + 3499.5146842434306, + 3500.338272934724, + 3501.4029481974535, + 3502.432815816549, + 3503.4239423641757, + 3504.0777260240843, + 3505.0702478300145, + 3505.2485254157214, + 3505.390162212784, + 3506.822561575343, + 3507.385954615071, + 3509.0393942719343, + 3509.2354279489814, + 3509.8763920739602, + 3510.793380352239, + 3511.461579984644, + 3511.940052356123, + 3513.15064394729, + 4111.004523952559, + 4112.359984015383, + 4115.289635527202, + 4190.927807402104, + 4200.012368282002, + 4201.327615740492, + 4202.818905927895, + 4203.22723616026, + 4203.803157709655, + 4203.979830450559, + 4204.874052415584, + 4205.812979878329, + 4206.173645782175, + 4206.636481256514, + 4207.539581927733, + 4207.898765526977, + 4208.676494903325, + 4209.290206943602, + 4209.56181880377, + 4210.773006657522, + 4212.069599701378, + 4212.464880012492, + 4212.914674509709, + 4213.981102922574 + ], + "weights": [ + 1.0202477236211858, + 0.06770912229988223, + 0.10298071324773439, + 1.76502473042136, + 1.0430764847343492, + 1.952877616811955, + 0.42013198348581565, + 0.03242556227191009, + 2.2019448393582124, + 1.288027833787963, + 3.3195717473314277, + 0.30426472801958065, + 2.856917011848876, + 0.021475171453749775, + 0.7817166577902903, + 0.5782571502630857, + 0.010123323949128729, + 0.12289819480823741, + 0.21800753191038405, + 0.5254118241835822, + 5.396378572092667, + 0.9793743266280779, + 0.6422298028845047, + 0.4811353546109418, + 0.23085312979059905, + 0.745132081654252, + 0.22284895182516443, + 1.9392289107517409, + 0.41075667177442254, + 0.45661269533454274, + 1.6696721725722798, + 0.30881288748945335, + 0.7278866790709168, + 0.178423457241379, + 0.017094679704319736, + 0.7174025093818268, + 1.0233385427815045, + 8.757175949202304, + 0.23271581396926624, + 0.7715171912243295, + 0.32251571132619744, + 0.14195933108600117, + 0.9759527985270193, + 2.185940705870637, + 0.5036941648980399, + 1.2404359529791311, + 1.0161312919355017, + 0.7664339687099603, + 2.136055580319805, + 0.644826085025016, + 0.3146896344384445, + 0.5429443785749626, + 0.16682303186486808, + 0.581681075694339, + 0.25394078794562536, + 0.1144522013846407, + 0.20957565862074554, + 0.11506966182110541, + 2.1913816197157368, + 1.4161822194718614, + 0.0665788075615754, + 1.6854227119291123, + 1.3321958210594265, + 0.1525793597304915, + 0.18960388305171788, + 0.8627479514146437, + 1.2171989520217807, + 2.977011196784084, + 0.0023293024529533113, + 0.3275043003164306, + 1.1115117690114749, + 0.6255319890964549, + 0.31224774834381097, + 2.8156706043764514, + 0.25454052503892044, + 0.7723898543976425, + 0.49425810851122454, + 1.013217409715679, + 1.2909937212074172, + 0.39393508602737404, + 2.7201647061587497 + ], + "sigma_eV": 100.0 + }, + { + "energies_eV": [ + -148.42429220654438, + 394.05395718627415, + 640.7620085288922, + 643.8292036174686, + 645.3294977458993, + 708.2657028036648, + 709.0345310900252, + 1175.790607429806, + 1305.2689300906616, + 1309.598475511505, + 1310.5645411643115, + 1403.1324958461785, + 1404.4031793803138, + 1405.0666510275084, + 1407.649058788924, + 1408.6744328191492, + 1409.530291382195, + 1412.605043436398, + 1415.4806444838234, + 2037.8572167393866, + 2055.5306781407226, + 2057.0728235789675, + 2060.400840874815, + 2106.0121652249563, + 2107.0469159687723, + 2107.7063206212833, + 2109.318864227083, + 2745.085052531634, + 2745.223291111908, + 2746.50244118577, + 2759.1791241861815, + 2801.2223080629064, + 2804.1480718227813, + 3340.544808011372, + 3344.711025168565, + 3346.06597190763, + 3444.1143006354955, + 3497.893566358187, + 3498.5964194982753, + 3499.5146842434306, + 3500.338272934724, + 3501.4029481974535, + 3502.432815816549, + 3503.4239423641757, + 3504.0777260240843, + 3505.0702478300145, + 3505.2485254157214, + 3505.390162212784, + 3506.822561575343, + 3507.385954615071, + 3509.0393942719343, + 3509.2354279489814, + 3509.8763920739602, + 3510.793380352239, + 3511.461579984644, + 3511.940052356123, + 3513.15064394729, + 4111.004523952559, + 4112.359984015383, + 4115.289635527202, + 4190.927807402104, + 4200.012368282002, + 4201.327615740492, + 4202.818905927895, + 4203.22723616026, + 4203.803157709655, + 4203.979830450559, + 4204.874052415584, + 4205.812979878329, + 4206.173645782175, + 4206.636481256514, + 4207.539581927733, + 4207.898765526977, + 4208.676494903325, + 4209.290206943602, + 4209.56181880377, + 4210.773006657522, + 4212.069599701378, + 4212.464880012492, + 4212.914674509709, + 4213.981102922574 + ], + "weights": [ + 0.7571709085963045, + 0.42654158697003014, + 0.7521112933601163, + 0.3049597215364185, + 2.1623935434634873, + 0.5450598346042996, + 0.9155501257198342, + 3.8372321407032763, + 0.9620150942636806, + 0.7333505169968647, + 0.25464866004875186, + 0.26796497179519546, + 0.37900561048733933, + 1.327283051959608, + 2.050530910033943, + 0.025290837102816724, + 0.2782583416689126, + 0.051868029152468235, + 1.6780216484362953, + 2.2244354285543704, + 0.5752478570622425, + 0.5004028245732185, + 1.6958800125537565, + 0.6765522934939768, + 1.2266085894338215, + 0.2884382353597857, + 2.6056176586535287, + 1.9094227704501385, + 2.4407999340845583, + 0.6407107430300962, + 0.3470601040673472, + 0.25983356129018037, + 0.03957049299777524, + 0.3784855298301852, + 0.22229651430160594, + 0.6412322820936591, + 2.498205600492606, + 0.6372252031139031, + 1.1138905245260167, + 1.1554948920288095, + 0.6454179217524204, + 0.3316709660570526, + 4.24948053231945, + 0.9895379394973683, + 0.4506809094197139, + 0.6343784726075403, + 0.8604086776009294, + 0.6547063773714454, + 1.7990000566983178, + 0.4528872634369804, + 0.7239264587539376, + 0.2930268485985894, + 2.5537166216200893, + 1.8193101210660603, + 0.21312920428640228, + 0.46734359011950194, + 0.2066521613580817, + 0.2674637537829993, + 0.25215819693618463, + 1.428650570634467, + 0.25093866954524435, + 2.103691457999856, + 1.2595048905134416, + 0.8925968746091822, + 0.126761093497044, + 1.2634336424512347, + 0.27341422733652926, + 0.44922159365306247, + 0.9923506452284544, + 2.017215041732749, + 0.22570544822190416, + 0.7208624694464868, + 3.342678780124925, + 0.12828655116036566, + 1.2989528835206203, + 1.8685359003568724, + 1.4362618899274198, + 0.681959707075987, + 1.0075958909394909, + 0.19167018728189206, + 1.3881476325685118 + ], + "sigma_eV": 100.0 + }, + { + "energies_eV": [ + -148.42429220654438, + 394.05395718627415, + 640.7620085288922, + 643.8292036174686, + 645.3294977458993, + 708.2657028036648, + 709.0345310900252, + 1175.790607429806, + 1305.2689300906616, + 1309.598475511505, + 1310.5645411643115, + 1403.1324958461785, + 1404.4031793803138, + 1405.0666510275084, + 1407.649058788924, + 1408.6744328191492, + 1409.530291382195, + 1412.605043436398, + 1415.4806444838234, + 2037.8572167393866, + 2055.5306781407226, + 2057.0728235789675, + 2060.400840874815, + 2106.0121652249563, + 2107.0469159687723, + 2107.7063206212833, + 2109.318864227083, + 2745.085052531634, + 2745.223291111908, + 2746.50244118577, + 2759.1791241861815, + 2801.2223080629064, + 2804.1480718227813, + 3340.544808011372, + 3344.711025168565, + 3346.06597190763, + 3444.1143006354955, + 3497.893566358187, + 3498.5964194982753, + 3499.5146842434306, + 3500.338272934724, + 3501.4029481974535, + 3502.432815816549, + 3503.4239423641757, + 3504.0777260240843, + 3505.0702478300145, + 3505.2485254157214, + 3505.390162212784, + 3506.822561575343, + 3507.385954615071, + 3509.0393942719343, + 3509.2354279489814, + 3509.8763920739602, + 3510.793380352239, + 3511.461579984644, + 3511.940052356123, + 3513.15064394729, + 4111.004523952559, + 4112.359984015383, + 4115.289635527202, + 4190.927807402104, + 4200.012368282002, + 4201.327615740492, + 4202.818905927895, + 4203.22723616026, + 4203.803157709655, + 4203.979830450559, + 4204.874052415584, + 4205.812979878329, + 4206.173645782175, + 4206.636481256514, + 4207.539581927733, + 4207.898765526977, + 4208.676494903325, + 4209.290206943602, + 4209.56181880377, + 4210.773006657522, + 4212.069599701378, + 4212.464880012492, + 4212.914674509709, + 4213.981102922574 + ], + "weights": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "sigma_eV": 100.0 + }, + { + "energies_eV": [ + -148.42429220654438, + 394.05395718627415, + 640.7620085288922, + 643.8292036174686, + 645.3294977458993, + 708.2657028036648, + 709.0345310900252, + 1175.790607429806, + 1305.2689300906616, + 1309.598475511505, + 1310.5645411643115, + 1403.1324958461785, + 1404.4031793803138, + 1405.0666510275084, + 1407.649058788924, + 1408.6744328191492, + 1409.530291382195, + 1412.605043436398, + 1415.4806444838234, + 2037.8572167393866, + 2055.5306781407226, + 2057.0728235789675, + 2060.400840874815, + 2106.0121652249563, + 2107.0469159687723, + 2107.7063206212833, + 2109.318864227083, + 2745.085052531634, + 2745.223291111908, + 2746.50244118577, + 2759.1791241861815, + 2801.2223080629064, + 2804.1480718227813, + 3340.544808011372, + 3344.711025168565, + 3346.06597190763, + 3444.1143006354955, + 3497.893566358187, + 3498.5964194982753, + 3499.5146842434306, + 3500.338272934724, + 3501.4029481974535, + 3502.432815816549, + 3503.4239423641757, + 3504.0777260240843, + 3505.0702478300145, + 3505.2485254157214, + 3505.390162212784, + 3506.822561575343, + 3507.385954615071, + 3509.0393942719343, + 3509.2354279489814, + 3509.8763920739602, + 3510.793380352239, + 3511.461579984644, + 3511.940052356123, + 3513.15064394729, + 4111.004523952559, + 4112.359984015383, + 4115.289635527202, + 4190.927807402104, + 4200.012368282002, + 4201.327615740492, + 4202.818905927895, + 4203.22723616026, + 4203.803157709655, + 4203.979830450559, + 4204.874052415584, + 4205.812979878329, + 4206.173645782175, + 4206.636481256514, + 4207.539581927733, + 4207.898765526977, + 4208.676494903325, + 4209.290206943602, + 4209.56181880377, + 4210.773006657522, + 4212.069599701378, + 4212.464880012492, + 4212.914674509709, + 4213.981102922574 + ], + "weights": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "sigma_eV": 100.0 + } + ], + "true_dos_interval_Ry": [ + -10.908980355623385, + 309.7217873660413 + ], + "scf_intervals_Ry": [ + [ + -9.73172909023458, + 308.8930208608015 + ], + [ + -10.441657012369546, + 309.3584722214083 + ], + [ + -10.90563753930627, + 309.7303545730341 + ], + [ + -10.905675244899442, + 309.72196526770637 + ], + [ + -10.908964655317902, + 309.7218020184725 + ] + ] +} diff --git a/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/result.ref b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/result.ref new file mode 100644 index 00000000000..63c051a37c3 --- /dev/null +++ b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/result.ref @@ -0,0 +1,4 @@ +etotref -23099.386593839899433 +etotperatomref -23099.3865938399 +totaldosref 161.997 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/threshold b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/06_C1400_EMPTY_MPI/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/07_C1400_GPU/INPUT b/tests/18_SDFT_FAST/07_C1400_GPU/INPUT new file mode 100644 index 00000000000..01a3f5229d6 --- /dev/null +++ b/tests/18_SDFT_FAST/07_C1400_GPU/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device gpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 102.89810209183398 +nbands 0 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 0 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 1 +nbands_sto all +seed_sto 20000 +nche_sto 16 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/07_C1400_GPU/KPT b/tests/18_SDFT_FAST/07_C1400_GPU/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/07_C1400_GPU/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/07_C1400_GPU/STRU b/tests/18_SDFT_FAST/07_C1400_GPU/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/07_C1400_GPU/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/07_C1400_GPU/reference.json b/tests/18_SDFT_FAST/07_C1400_GPU/reference.json new file mode 100644 index 00000000000..3fab33c3e6a --- /dev/null +++ b/tests/18_SDFT_FAST/07_C1400_GPU/reference.json @@ -0,0 +1,42 @@ +{ + "expected": "normal", + "energy_eV": -23305.08480563067, + "entropy_Ry": -2388.2514294318, + "ts_tails": [ + 6.840833062338039e-12, + 7.060332785202823e-12, + 7.355563115863465e-12, + 7.354125577252531e-12, + 7.353544757718035e-12 + ], + "ts_true_relative_errors": [ + 2.6850479223098614e-12, + 2.679312441392117e-12, + 2.65431805733525e-12, + 2.6537467820484147e-12, + 2.653746482126369e-12 + ], + "dos_spectra": [], + "scf_intervals_Ry": [ + [ + -9.731729090234637, + 308.8930208608016 + ], + [ + -10.192614177600944, + 308.8977501964807 + ], + [ + -10.603189548708315, + 308.9390021606766 + ], + [ + -10.603210894168967, + 308.9393532350825 + ], + [ + -10.60284216776381, + 308.9392880367445 + ] + ] +} diff --git a/tests/18_SDFT_FAST/07_C1400_GPU/result.ref b/tests/18_SDFT_FAST/07_C1400_GPU/result.ref new file mode 100644 index 00000000000..77cc27d1694 --- /dev/null +++ b/tests/18_SDFT_FAST/07_C1400_GPU/result.ref @@ -0,0 +1,3 @@ +etotref -23305.084805630671326 +etotperatomref -23305.0848056307 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/07_C1400_GPU/threshold b/tests/18_SDFT_FAST/07_C1400_GPU/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/07_C1400_GPU/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/08_C1400_GPU_MPI/INPUT b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/INPUT new file mode 100644 index 00000000000..127818ea03d --- /dev/null +++ b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device gpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 2 +ecutwfc 400 +smearing_method fd +smearing_sigma 102.89810209183398 +nbands 0 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 0 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 1 +nbands_sto all +seed_sto 20000 +nche_sto 16 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/08_C1400_GPU_MPI/KPT b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/08_C1400_GPU_MPI/STRU b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/08_C1400_GPU_MPI/reference.json b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/reference.json new file mode 100644 index 00000000000..d5dae576480 --- /dev/null +++ b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/reference.json @@ -0,0 +1,42 @@ +{ + "expected": "normal", + "energy_eV": -23305.08480563067, + "entropy_Ry": -2388.2514294318, + "ts_tails": [ + 6.840833062338035e-12, + 7.0603220238565055e-12, + 7.355598991438222e-12, + 7.354113618727798e-12, + 7.353541170161026e-12 + ], + "ts_true_relative_errors": [ + 2.684857560883253e-12, + 2.6791220546628203e-12, + 2.653937236953997e-12, + 2.653937192235833e-12, + 2.6537464821263694e-12 + ], + "dos_spectra": [], + "scf_intervals_Ry": [ + [ + -9.731729090234637, + 308.8930208608016 + ], + [ + -10.192614177600944, + 308.8977501964805 + ], + [ + -10.603189548708258, + 308.9390021606766 + ], + [ + -10.603210894168797, + 308.93935323508254 + ], + [ + -10.602842167763754, + 308.93928803674453 + ] + ] +} diff --git a/tests/18_SDFT_FAST/08_C1400_GPU_MPI/result.ref b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/result.ref new file mode 100644 index 00000000000..77cc27d1694 --- /dev/null +++ b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/result.ref @@ -0,0 +1,3 @@ +etotref -23305.084805630671326 +etotperatomref -23305.0848056307 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/08_C1400_GPU_MPI/threshold b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/08_C1400_GPU_MPI/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/09_C1400_LOW_DOS/INPUT b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/INPUT new file mode 100644 index 00000000000..feb8edeb60a --- /dev/null +++ b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/INPUT @@ -0,0 +1,37 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 102.89810209183398 +nbands 0 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 1 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 2 +nbands_sto all +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 4 +npart_sto 8 diff --git a/tests/18_SDFT_FAST/09_C1400_LOW_DOS/KPT b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/09_C1400_LOW_DOS/STRU b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/09_C1400_LOW_DOS/reference.json b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/reference.json new file mode 100644 index 00000000000..8bc98d43333 --- /dev/null +++ b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/reference.json @@ -0,0 +1,230 @@ +{ + "expected": "low_dos", + "energy_eV": -23305.08480563327, + "entropy_Ry": -2388.2514294381, + "ts_tails": [ + 2.2117605342132548e-17, + 1.0163493738943317e-17, + 2.9896312308387154e-18, + 5.381336124835561e-18, + 8.968892527743162e-18 + ], + "ts_true_relative_errors": [ + 0.0, + 7.615469171867029e-16, + 9.520509531331551e-16, + 1.9041018741826783e-16, + 5.71230497695276e-16 + ], + "dos_spectra": [ + { + "energies_eV": [ + -144.2591372409406, + 390.1834235863962, + 641.6831132395048, + 641.6831132395124, + 641.6831132395159, + 704.4285379990705, + 704.4285379990728, + 1163.8411985598655, + 1303.7368692355053, + 1303.736869235507, + 1303.7368692355112, + 1399.9940617119212, + 1399.9940617119246, + 1399.9940617119269, + 1404.2750230818044, + 1404.275023081805, + 1404.2750230818062, + 1405.988987678519, + 1405.9889876785264, + 2026.4649518972005, + 2050.739545806703, + 2050.7395458067035, + 2050.739545806704, + 2099.617333646256, + 2101.6167119127654, + 2101.6167119127695, + 2101.6167119127754, + 2743.678541830536, + 2743.678541830537, + 2743.678541830538, + 2754.4232923649747, + 2799.46569541178, + 2799.4656954117804, + 3337.18521926351, + 3337.185219263513, + 3337.185219263515, + 3435.0744551935663, + 3497.9948348883363, + 3497.994834888337, + 3497.994834888338, + 3498.4934871605233, + 3498.4934871605246, + 3499.353988449968, + 3499.35398844997, + 3499.3539884499714, + 3499.980668873896, + 3499.980668873896, + 3499.980668873898, + 3500.3060698930817, + 3500.306069893082, + 3500.306069893087, + 3503.076175680464, + 3503.076175680466, + 3503.6899661802336, + 3503.689966180236, + 3503.6899661802377, + 3504.72037277997, + 4102.4761973505565, + 4102.476197350557, + 4102.476197350558, + 4183.6391810356945, + 4197.193848014244, + 4197.464360208798, + 4197.464360208801, + 4197.464360208804, + 4200.0519880483835, + 4200.051988048385, + 4200.888213546805, + 4200.888213546806, + 4200.888213546807, + 4202.1612458188365, + 4202.161245818837, + 4202.161245818839, + 4202.183992058194, + 4202.183992058194, + 4202.183992058195, + 4202.325442327516, + 4202.325442327517, + 4202.325442327518, + 4203.334667800844, + 4203.334667800846 + ], + "weights": [ + 1.999999999999997, + 2.0000000000000013, + 2.000000000000001, + 1.9999999999999998, + 1.9999999999999991, + 1.9999999999999996, + 2.0000000000000004, + 2.0000000000000044, + 2.0000000000000013, + 1.9999999999999993, + 1.9999999999999996, + 1.999999999999997, + 2.000000000000001, + 2.0000000000000013, + 2.0000000000000013, + 1.9999999999999996, + 2.0000000000000013, + 1.9999999999999991, + 1.9999999999999978, + 2.0, + 2.0, + 2.0000000000000004, + 2.0, + 2.0, + 1.9999999999999993, + 1.9999999999999993, + 1.9999999999999993, + 2.0000000000000004, + 1.9999999999999984, + 2.0000000000000013, + 1.9999999999999993, + 2.0000000000000018, + 2.0000000000000004, + 1.9999999999999984, + 2.0000000000000018, + 2.0000000000000018, + 1.9999999999999998, + 2.0000000000000004, + 2.000000000000001, + 1.9999999999999998, + 1.999999999999999, + 1.9999999999999996, + 2.000000000000002, + 2.0, + 2.0, + 1.9999999999999996, + 2.0000000000000004, + 2.000000000000001, + 2.000000000000001, + 2.000000000000001, + 2.0000000000000013, + 1.9999999999999987, + 2.0000000000000027, + 2.000000000000001, + 2.000000000000002, + 2.0, + 2.0, + 2.000000000000002, + 2.0, + 2.0000000000000013, + 1.999999999999999, + 2.000000000000001, + 1.9999999999999996, + 2.0000000000000018, + 2.000000000000003, + 1.9999999999999996, + 1.9999999999999993, + 1.9999999999999998, + 1.999999999999999, + 1.9999999999999998, + 2.000000000000001, + 1.9999999999999973, + 2.0000000000000018, + 2.0000000000000004, + 2.000000000000002, + 1.9999999999999998, + 1.9999999999999996, + 1.999999999999998, + 1.999999999999998, + 2.0000000000000018, + 1.9999999999999996 + ], + "sigma_eV": 100.0 + } + ], + "true_dos_interval_Ry": [ + -10.602847221872821, + 308.93928909790924 + ], + "scf_intervals_Ry": [ + [ + -9.73172909023458, + 308.8930208608015 + ], + [ + -10.192614177600944, + 308.8977501964805 + ], + [ + -10.603189548708713, + 308.93900216067556 + ], + [ + -10.60321089416965, + 308.93935323508157 + ], + [ + -10.602842167764436, + 308.93928803674356 + ] + ], + "dos_tail_reference": [ + { + "energy_eV": 4173.71, + "error_eV_inv": 0.02211956843743383 + }, + { + "energy_eV": 4213.71, + "error_eV_inv": 0.02333989448474796 + }, + { + "energy_eV": 4253.71, + "error_eV_inv": 0.021474103308126994 + } + ] +} diff --git a/tests/18_SDFT_FAST/09_C1400_LOW_DOS/result.ref b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/result.ref new file mode 100644 index 00000000000..ec0f86b48bf --- /dev/null +++ b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/result.ref @@ -0,0 +1,4 @@ +etotref -23305.084805633268843 +etotperatomref -23305.0848056333 +totaldosref 74.3833 +totaltimeref 1 diff --git a/tests/18_SDFT_FAST/09_C1400_LOW_DOS/threshold b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/threshold new file mode 100644 index 00000000000..33e27fb6c5f --- /dev/null +++ b/tests/18_SDFT_FAST/09_C1400_LOW_DOS/threshold @@ -0,0 +1 @@ +threshold 0.00001 diff --git a/tests/18_SDFT_FAST/CASES_CPU.txt b/tests/18_SDFT_FAST/CASES_CPU.txt new file mode 100644 index 00000000000..1be0449b861 --- /dev/null +++ b/tests/18_SDFT_FAST/CASES_CPU.txt @@ -0,0 +1,7 @@ +01_C09_KS +02_C348_MDFT +03_C1400_SDFT +04_C348_METHOD1_MPI +05_C1400_KPOOL_BAND_MPI +06_C1400_EMPTY_MPI +09_C1400_LOW_DOS diff --git a/tests/18_SDFT_FAST/CASES_GPU.txt b/tests/18_SDFT_FAST/CASES_GPU.txt new file mode 100644 index 00000000000..69fa8455837 --- /dev/null +++ b/tests/18_SDFT_FAST/CASES_GPU.txt @@ -0,0 +1,2 @@ +07_C1400_GPU +08_C1400_GPU_MPI diff --git a/tests/18_SDFT_FAST/CMakeLists.txt b/tests/18_SDFT_FAST/CMakeLists.txt new file mode 100644 index 00000000000..f9faa8e0ec2 --- /dev/null +++ b/tests/18_SDFT_FAST/CMakeLists.txt @@ -0,0 +1,43 @@ +# Autotest owns scalar checks; the helper adds full DOS and expected-failure checks. +find_program(SDFT_FAST_PYTHON NAMES python3) +find_program(SDFT_FAST_BASH NAMES bash) +if(SDFT_FAST_PYTHON AND SDFT_FAST_BASH AND MPIEXEC_EXECUTABLE) + function(sdft_fast_case name ranks device) + add_test(NAME SDFT_FAST_${name} + COMMAND ${SDFT_FAST_PYTHON} + ${CMAKE_CURRENT_SOURCE_DIR}/../integrate/validation_tools/check_sdft_fast.py + --binary ${ABACUS_BIN_PATH} --fixture ${CMAKE_CURRENT_SOURCE_DIR}/${name} + --ranks ${ranks} --timeout 240) + set_tests_properties(SDFT_FAST_${name} PROPERTIES + PROCESSORS ${ranks} TIMEOUT 250 LABELS "SDFT_FAST;${device}" + ENVIRONMENT "OMP_NUM_THREADS=1;OPENBLAS_NUM_THREADS=1;ABACUS_MPIEXEC=${MPIEXEC_EXECUTABLE};ABACUS_MPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG}") + string(REPLACE ";" " " preflags "${MPIEXEC_PREFLAGS}") + string(REPLACE ";" " " postflags "${MPIEXEC_POSTFLAGS}") + set_property(TEST SDFT_FAST_${name} APPEND PROPERTY ENVIRONMENT + "ABACUS_MPIEXEC_PREFLAGS=${preflags}" "ABACUS_MPIEXEC_POSTFLAGS=${postflags}") + if(device STREQUAL "GPU") + set_tests_properties(SDFT_FAST_${name} PROPERTIES RESOURCE_LOCK sdft_fast_gpu) + endif() + endfunction() + if(USE_CUDA OR USE_ROCM) + sdft_fast_case(07_C1400_GPU 1 GPU) + sdft_fast_case(08_C1400_GPU_MPI 2 GPU) + else() + # Invalid input is an expected failure, outside Autotest's scalar references. + add_test(NAME SDFT_FAST_DOS_INPUTS + COMMAND ${SDFT_FAST_PYTHON} + ${CMAKE_CURRENT_SOURCE_DIR}/../integrate/validation_tools/check_sdft_dos_inputs.py + --binary ${ABACUS_BIN_PATH} + --fixtures ${CMAKE_CURRENT_SOURCE_DIR}/dos_inputs) + set_tests_properties(SDFT_FAST_DOS_INPUTS PROPERTIES + TIMEOUT 120 LABELS "SDFT_FAST;CPU" + ENVIRONMENT "OMP_NUM_THREADS=1;OPENBLAS_NUM_THREADS=1") + sdft_fast_case(01_C09_KS 1 CPU) + sdft_fast_case(02_C348_MDFT 1 CPU) + sdft_fast_case(03_C1400_SDFT 1 CPU) + sdft_fast_case(04_C348_METHOD1_MPI 2 CPU) + sdft_fast_case(05_C1400_KPOOL_BAND_MPI 4 CPU) + sdft_fast_case(06_C1400_EMPTY_MPI 4 CPU) + sdft_fast_case(09_C1400_LOW_DOS 1 CPU) + endif() +endif() diff --git a/tests/18_SDFT_FAST/README.md b/tests/18_SDFT_FAST/README.md new file mode 100644 index 00000000000..c9bb8075e38 --- /dev/null +++ b/tests/18_SDFT_FAST/README.md @@ -0,0 +1,17 @@ +# Fast interval / DOS regression suite + +Run `ctest --test-dir build -L SDFT_FAST --output-on-failure -j 1`. +CPU builds cover one-atom carbon at 9, 348 and 1400 eV, including densities +above 100 g/cc, methods 1/2, 2/4 MPI ranks, k pools, stochastic band groups, +empty groups and intentionally insufficient DOS order. GPU builds select +the two SCF GPU cases (DOS remains CPU-only). + +Autotest supplies scalar energy/charge references. The validation helper also +checks the DOS curve, units and diagnostic headers, which scalar references +cannot express. Invalid INPUT fixtures test expected failures before allocation. +Use OMP_NUM_THREADS=1; launch flags and process counts are forwarded by CTest. +The Ne/TS total-error estimator studies are kept outside this PR. + +The spectral estimator and DOS calculation receive logging/output dependencies +explicitly. The application Driver is the legacy-global adaptation boundary; +no exception is requested for the global dependency budget. diff --git a/tests/18_SDFT_FAST/conductivity/INPUT b/tests/18_SDFT_FAST/conductivity/INPUT new file mode 100644 index 00000000000..c53a31872fa --- /dev/null +++ b/tests/18_SDFT_FAST/conductivity/INPUT @@ -0,0 +1,45 @@ +INPUT_PARAMETERS +suffix autotest +calculation scf +esolver_type sdft +basis_type pw +device cpu +pseudo_dir ../pseudo +ntype 1 +nspin 1 +symmetry 0 +kpar 1 +bndpar 1 +ecutwfc 400 +smearing_method fd +smearing_sigma 25.577528234255873 +nbands 7 +scf_thr 1e-8 +scf_nmax 40 +ks_solver cg +pw_seed 1 +mixing_type broyden +mixing_beta 0.5 +mixing_gg0 0 +out_dos 0 +dos_sigma 100 +dos_edelta_ev 40 +cal_force 0 +cal_stress 0 +min_dist_coef 0 +method_sto 2 +nbands_sto all +seed_sto 20000 +nche_sto 80 +emin_sto 0 +emax_sto 0 +dos_nche 192 +npart_sto 8 + +cal_cond 1 +cond_fwhm 1000 +cond_wcut 1000 +cond_dw 200 +cond_dt 0.01 +cond_dtbatch 1 +cond_nonlocal 0 diff --git a/tests/18_SDFT_FAST/conductivity/KPT b/tests/18_SDFT_FAST/conductivity/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/conductivity/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/conductivity/STRU b/tests/18_SDFT_FAST/conductivity/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/conductivity/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/dos_inputs/dos_edelta_ev/INPUT b/tests/18_SDFT_FAST/dos_inputs/dos_edelta_ev/INPUT new file mode 100644 index 00000000000..1689afdf732 --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/dos_edelta_ev/INPUT @@ -0,0 +1,11 @@ +INPUT_PARAMETERS +basis_type pw +esolver_type sdft +device cpu +ntype 1 +nbands_sto all +out_dos 1 +dos_sigma 0.1 +dos_edelta_ev 0 +dos_nche 1 +npart_sto 1 diff --git a/tests/18_SDFT_FAST/dos_inputs/dos_nche/INPUT b/tests/18_SDFT_FAST/dos_inputs/dos_nche/INPUT new file mode 100644 index 00000000000..2920eb7df7b --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/dos_nche/INPUT @@ -0,0 +1,11 @@ +INPUT_PARAMETERS +basis_type pw +esolver_type sdft +device cpu +ntype 1 +nbands_sto all +out_dos 1 +dos_sigma 0.1 +dos_edelta_ev 0.1 +dos_nche 0 +npart_sto 1 diff --git a/tests/18_SDFT_FAST/dos_inputs/dos_nche__method2/INPUT b/tests/18_SDFT_FAST/dos_inputs/dos_nche__method2/INPUT new file mode 100644 index 00000000000..c2c169bd73f --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/dos_nche__method2/INPUT @@ -0,0 +1,13 @@ +INPUT_PARAMETERS +basis_type pw +esolver_type sdft +device cpu +ntype 1 +nbands_sto all +out_dos 1 +dos_sigma 0.1 +dos_edelta_ev 0.1 +dos_nche 100000 +npart_sto 1 + +method_sto 2 diff --git a/tests/18_SDFT_FAST/dos_inputs/dos_sigma/INPUT b/tests/18_SDFT_FAST/dos_inputs/dos_sigma/INPUT new file mode 100644 index 00000000000..dc010f98040 --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/dos_sigma/INPUT @@ -0,0 +1,11 @@ +INPUT_PARAMETERS +basis_type pw +esolver_type sdft +device cpu +ntype 1 +nbands_sto all +out_dos 1 +dos_sigma 0 +dos_edelta_ev 0.1 +dos_nche 1 +npart_sto 1 diff --git a/tests/18_SDFT_FAST/dos_inputs/npart_sto/INPUT b/tests/18_SDFT_FAST/dos_inputs/npart_sto/INPUT new file mode 100644 index 00000000000..396e0c927d4 --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/npart_sto/INPUT @@ -0,0 +1,11 @@ +INPUT_PARAMETERS +basis_type pw +esolver_type sdft +device cpu +ntype 1 +nbands_sto all +out_dos 1 +dos_sigma 0.1 +dos_edelta_ev 0.1 +dos_nche 1 +npart_sto 0 diff --git a/tests/18_SDFT_FAST/dos_inputs/valid/INPUT b/tests/18_SDFT_FAST/dos_inputs/valid/INPUT new file mode 100644 index 00000000000..f0e5e70046b --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/valid/INPUT @@ -0,0 +1,11 @@ +INPUT_PARAMETERS +basis_type pw +esolver_type sdft +device cpu +ntype 1 +nbands_sto all +out_dos 1 +dos_sigma 0.1 +dos_edelta_ev 0.1 +dos_nche 1 +npart_sto 1 diff --git a/tests/18_SDFT_FAST/dos_inputs/valid/KPT b/tests/18_SDFT_FAST/dos_inputs/valid/KPT new file mode 100644 index 00000000000..c289c0158aa --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/valid/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/18_SDFT_FAST/dos_inputs/valid/STRU b/tests/18_SDFT_FAST/dos_inputs/valid/STRU new file mode 100644 index 00000000000..212133dcc34 --- /dev/null +++ b/tests/18_SDFT_FAST/dos_inputs/valid/STRU @@ -0,0 +1,15 @@ +ATOMIC_SPECIES +C 12.0107 C-0.7.UPF upf201 + +LATTICE_CONSTANT +0.876317209776481 +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 +ATOMIC_POSITIONS +Direct +C +0.0 +1 +0 0 0 0 0 0 diff --git a/tests/18_SDFT_FAST/manifest.json b/tests/18_SDFT_FAST/manifest.json new file mode 100644 index 00000000000..3b9ff304868 --- /dev/null +++ b/tests/18_SDFT_FAST/manifest.json @@ -0,0 +1,56 @@ +[ + { + "case": "01_C09_KS", + "ranks": 1, + "device": "cpu", + "expected": "normal" + }, + { + "case": "02_C348_MDFT", + "ranks": 1, + "device": "cpu", + "expected": "normal" + }, + { + "case": "03_C1400_SDFT", + "ranks": 1, + "device": "cpu", + "expected": "normal" + }, + { + "case": "04_C348_METHOD1_MPI", + "ranks": 2, + "device": "cpu", + "expected": "normal" + }, + { + "case": "05_C1400_KPOOL_BAND_MPI", + "ranks": 4, + "device": "cpu", + "expected": "normal" + }, + { + "case": "06_C1400_EMPTY_MPI", + "ranks": 4, + "device": "cpu", + "expected": "normal" + }, + { + "case": "07_C1400_GPU", + "ranks": 1, + "device": "gpu", + "expected": "normal" + }, + { + "case": "08_C1400_GPU_MPI", + "ranks": 2, + "device": "gpu", + "expected": "normal" + }, + { + "case": "09_C1400_LOW_DOS", + "ranks": 1, + "device": "cpu", + "expected": "low_dos" + } +] diff --git a/tests/18_SDFT_FAST/pseudo/C-0.7.UPF b/tests/18_SDFT_FAST/pseudo/C-0.7.UPF new file mode 100644 index 00000000000..0d49e7a18d7 --- /dev/null +++ b/tests/18_SDFT_FAST/pseudo/C-0.7.UPF @@ -0,0 +1,3295 @@ + + + + This pseudopotential file has been produced using the code + ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) + scalar-relativistic version 4.0.1 06/04/2019 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. + + +# ATOM AND REFERENCE CONFIGURATION +# atsym z nc nv iexc psfile + C 6.00 0 3 4 upf +# +# n l f energy (Ha) + 1 0 2.00 + 2 0 2.00 + 2 1 2.00 +# +# PSEUDOPOTENTIAL AND OPTIMIZATION +# lmax + 1 +# +# l, rc, ep, ncon, nbas, qcut + 0 0.70000 0.00000 5 8 19.90000 + 1 0.60000 0.00000 5 8 18.30000 +# +# LOCAL POTENTIAL +# lloc, lpopt, rc(5), dvloc0 + 4 5 0.55000 0.00000 +# +# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs +# l, nproj, debl + 0 2 1.09624 + 1 2 1.27170 +# +# MODEL CORE CHARGE +# icmod, fcfact, rcfact + 0 0.00000 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 6.0200 6.0300 6.0400 6.0500 6.0600 6.0700 + 6.0800 6.0900 6.1000 6.1100 6.1200 6.1300 6.1400 6.1500 + 6.1600 6.1700 6.1800 6.1900 6.2000 6.2100 6.2200 6.2300 + 6.2400 6.2500 6.2600 6.2700 6.2800 6.2900 6.3000 6.3100 + 6.3200 6.3300 6.3400 6.3500 6.3600 6.3700 6.3800 6.3900 + 6.4000 6.4100 6.4200 6.4300 6.4400 6.4500 6.4600 6.4700 + 6.4800 6.4900 6.5000 6.5100 6.5200 6.5300 6.5400 6.5500 + 6.5600 6.5700 6.5800 6.5900 6.6000 6.6100 6.6200 6.6300 + 6.6400 6.6500 6.6600 6.6700 6.6800 6.6900 6.7000 6.7100 + 6.7200 6.7300 6.7400 6.7500 6.7600 6.7700 6.7800 6.7900 + 6.8000 6.8100 6.8200 6.8300 6.8400 6.8500 6.8600 6.8700 + 6.8800 6.8900 6.9000 6.9100 6.9200 6.9300 6.9400 6.9500 + 6.9600 6.9700 6.9800 6.9900 7.0000 7.0100 7.0200 7.0300 + 7.0400 7.0500 7.0600 7.0700 7.0800 7.0900 7.1000 7.1100 + 7.1200 7.1300 7.1400 7.1500 7.1600 7.1700 7.1800 7.1900 + 7.2000 7.2100 7.2200 7.2300 7.2400 7.2500 7.2600 7.2700 + 7.2800 7.2900 7.3000 7.3100 7.3200 7.3300 7.3400 7.3500 + 7.3600 7.3700 7.3800 7.3900 7.4000 7.4100 7.4200 7.4300 + 7.4400 7.4500 7.4600 7.4700 7.4800 7.4900 7.5000 7.5100 + 7.5200 7.5300 7.5400 7.5500 7.5600 7.5700 7.5800 7.5900 + 7.6000 7.6100 7.6200 7.6300 7.6400 7.6500 7.6600 7.6700 + 7.6800 7.6900 7.7000 7.7100 7.7200 7.7300 7.7400 7.7500 + 7.7600 7.7700 7.7800 7.7900 7.8000 7.8100 7.8200 7.8300 + 7.8400 7.8500 7.8600 7.8700 7.8800 7.8900 7.9000 7.9100 + 7.9200 7.9300 7.9400 7.9500 7.9600 7.9700 7.9800 7.9900 + 8.0000 8.0100 8.0200 8.0300 8.0400 8.0500 8.0600 8.0700 + 8.0800 8.0900 8.1000 8.1100 8.1200 8.1300 8.1400 8.1500 + 8.1600 8.1700 8.1800 8.1900 8.2000 8.2100 8.2200 8.2300 + 8.2400 8.2500 8.2600 8.2700 8.2800 8.2900 8.3000 8.3100 + 8.3200 8.3300 8.3400 8.3500 8.3600 8.3700 8.3800 8.3900 + 8.4000 8.4100 8.4200 8.4300 8.4400 8.4500 8.4600 8.4700 + 8.4800 8.4900 8.5000 8.5100 8.5200 8.5300 8.5400 8.5500 + 8.5600 8.5700 8.5800 8.5900 8.6000 8.6100 8.6200 8.6300 + 8.6400 8.6500 8.6600 8.6700 8.6800 8.6900 8.7000 8.7100 + 8.7200 8.7300 8.7400 8.7500 8.7600 8.7700 8.7800 8.7900 + 8.8000 8.8100 8.8200 8.8300 8.8400 8.8500 8.8600 8.8700 + 8.8800 8.8900 8.9000 8.9100 8.9200 8.9300 8.9400 8.9500 + 8.9600 8.9700 8.9800 8.9900 9.0000 9.0100 9.0200 9.0300 + 9.0400 9.0500 9.0600 9.0700 9.0800 9.0900 9.1000 9.1100 + 9.1200 9.1300 9.1400 9.1500 9.1600 9.1700 9.1800 9.1900 + 9.2000 9.2100 9.2200 9.2300 9.2400 9.2500 9.2600 9.2700 + 9.2800 9.2900 9.3000 9.3100 9.3200 9.3300 9.3400 9.3500 + 9.3600 9.3700 9.3800 9.3900 9.4000 9.4100 9.4200 9.4300 + 9.4400 9.4500 9.4600 9.4700 9.4800 9.4900 9.5000 9.5100 + 9.5200 9.5300 9.5400 9.5500 9.5600 9.5700 9.5800 9.5900 + 9.6000 9.6100 9.6200 9.6300 9.6400 9.6500 9.6600 9.6700 + 9.6800 9.6900 9.7000 9.7100 9.7200 9.7300 9.7400 9.7500 + 9.7600 9.7700 9.7800 9.7900 9.8000 9.8100 9.8200 9.8300 + 9.8400 9.8500 9.8600 9.8700 9.8800 9.8900 9.9000 9.9100 + 9.9200 9.9300 9.9400 9.9500 9.9600 9.9700 9.9800 9.9900 + 10.0000 10.0100 10.0200 10.0300 10.0400 10.0500 10.0600 10.0700 + 10.0800 10.0900 10.1000 10.1100 10.1200 10.1300 10.1400 10.1500 + 10.1600 10.1700 10.1800 10.1900 10.2000 10.2100 10.2200 10.2300 + 10.2400 10.2500 10.2600 10.2700 10.2800 10.2900 10.3000 10.3100 + 10.3200 10.3300 10.3400 10.3500 10.3600 10.3700 10.3800 10.3900 + 10.4000 10.4100 10.4200 10.4300 10.4400 10.4500 10.4600 10.4700 + 10.4800 10.4900 10.5000 10.5100 10.5200 10.5300 10.5400 10.5500 + 10.5600 10.5700 10.5800 10.5900 10.6000 10.6100 10.6200 10.6300 + 10.6400 10.6500 10.6600 10.6700 10.6800 10.6900 10.7000 10.7100 + 10.7200 10.7300 10.7400 10.7500 10.7600 10.7700 10.7800 10.7900 + 10.8000 10.8100 10.8200 10.8300 10.8400 10.8500 10.8600 10.8700 + 10.8800 10.8900 10.9000 10.9100 10.9200 10.9300 10.9400 10.9500 + 10.9600 10.9700 10.9800 10.9900 11.0000 11.0100 11.0200 11.0300 + 11.0400 11.0500 11.0600 11.0700 11.0800 11.0900 11.1000 11.1100 + 11.1200 11.1300 11.1400 11.1500 11.1600 11.1700 11.1800 11.1900 + 11.2000 11.2100 11.2200 11.2300 11.2400 11.2500 11.2600 11.2700 + 11.2800 11.2900 11.3000 11.3100 11.3200 11.3300 11.3400 11.3500 + 11.3600 11.3700 11.3800 11.3900 11.4000 11.4100 11.4200 11.4300 + 11.4400 11.4500 11.4600 11.4700 11.4800 11.4900 11.5000 11.5100 + 11.5200 11.5300 11.5400 11.5500 11.5600 11.5700 11.5800 11.5900 + 11.6000 11.6100 11.6200 11.6300 11.6400 11.6500 11.6600 11.6700 + 11.6800 11.6900 11.7000 11.7100 11.7200 11.7300 11.7400 11.7500 + 11.7600 11.7700 11.7800 11.7900 11.8000 11.8100 11.8200 11.8300 + 11.8400 11.8500 11.8600 11.8700 11.8800 11.8900 11.9000 11.9100 + 11.9200 11.9300 11.9400 11.9500 11.9600 11.9700 11.9800 11.9900 + 12.0000 12.0100 12.0200 12.0300 12.0400 12.0500 12.0600 12.0700 + 12.0800 12.0900 12.1000 12.1100 12.1200 12.1300 12.1400 12.1500 + 12.1600 12.1700 12.1800 12.1900 12.2000 12.2100 12.2200 12.2300 + 12.2400 12.2500 12.2600 12.2700 12.2800 12.2900 12.3000 12.3100 + 12.3200 12.3300 12.3400 12.3500 12.3600 12.3700 12.3800 12.3900 + 12.4000 12.4100 12.4200 12.4300 12.4400 12.4500 + + + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + + + + -4.5131621749E+01 -4.5105202634E+01 -4.5027359617E+01 -4.4901975567E+01 + -4.4734450013E+01 -4.4530593652E+01 -4.4295744720E+01 -4.4034292035E+01 + -4.3749578306E+01 -4.3444046906E+01 -4.3119487368E+01 -4.2777279576E+01 + -4.2418588069E+01 -4.2044494366E+01 -4.1656074133E+01 -4.1254432444E+01 + -4.0840710198E+01 -4.0416072173E+01 -3.9981684091E+01 -3.9538683655E+01 + -3.9088148744E+01 -3.8631064938E+01 -3.8168294130E+01 -3.7700545966E+01 + -3.7228354251E+01 -3.6752060927E+01 -3.6271810712E+01 -3.5787559569E+01 + -3.5299099617E+01 -3.4806101580E+01 -3.4308173496E+01 -3.3804931349E+01 + -3.3296074476E+01 -3.2781456663E+01 -3.2261143712E+01 -3.1735450043E+01 + -3.1204950344E+01 -3.0670466520E+01 -3.0133034211E+01 -2.9593856001E+01 + -2.9054249691E+01 -2.8515599509E+01 -2.7979316288E+01 -2.7446809875E+01 + -2.6919474031E+01 -2.6398681179E+01 -2.5885781979E+01 -2.5382103126E+01 + -2.4888936175E+01 -2.4407510915E+01 -2.3938949018E+01 -2.3484197534E+01 + -2.3043947019E+01 -2.2618545011E+01 -2.2207920966E+01 -2.1811541827E+01 + -2.1428429621E+01 -2.1057442480E+01 -2.0697648898E+01 -2.0348408233E+01 + -2.0009352799E+01 -1.9680328589E+01 -1.9361292897E+01 -1.9052197243E+01 + -1.8752907337E+01 -1.8463165086E+01 -1.8182595435E+01 -1.7910746267E+01 + -1.7647142296E+01 -1.7391316026E+01 -1.7142849227E+01 -1.6901389493E+01 + -1.6666641033E+01 -1.6438327150E+01 -1.6216186191E+01 -1.5999970504E+01 + -1.5789445591E+01 -1.5584389271E+01 -1.5384590887E+01 -1.5189850560E+01 + -1.4999978487E+01 -1.4814794302E+01 -1.4634126480E+01 -1.4457811786E+01 + -1.4285694775E+01 -1.4117627328E+01 -1.3953468213E+01 -1.3793082696E+01 + -1.3636342163E+01 -1.3483123777E+01 -1.3333310160E+01 -1.3186789087E+01 + -1.3043453212E+01 -1.2903199802E+01 -1.2765930493E+01 -1.2631551059E+01 + -1.2499971203E+01 -1.2371104344E+01 -1.2244867438E+01 -1.2121180793E+01 + -1.1999967904E+01 -1.1881155295E+01 -1.1764672373E+01 -1.1650451283E+01 + -1.1538426780E+01 -1.1428536105E+01 -1.1320718868E+01 -1.1214916934E+01 + -1.1111074322E+01 -1.1009137106E+01 -1.0909053320E+01 -1.0810772870E+01 + -1.0714247453E+01 -1.0619430474E+01 -1.0526276974E+01 -1.0434743556E+01 + -1.0344788323E+01 -1.0256370806E+01 -1.0169451911E+01 -1.0083993857E+01 + -9.9999601221E+00 -9.9173153925E+00 -9.8360255117E+00 -9.7560574341E+00 + -9.6773791802E+00 -9.5999597937E+00 -9.5237693011E+00 -9.4487786732E+00 + -9.3749597875E+00 -9.3022853940E+00 -9.2307290809E+00 -9.1602652430E+00 + -9.0908690508E+00 -9.0225164220E+00 -8.9551839926E+00 -8.8888490915E+00 + -8.8234897139E+00 -8.7590844977E+00 -8.6956126999E+00 -8.6330541747E+00 + -8.5713893516E+00 -8.5105992154E+00 -8.4506652865E+00 -8.3915696023E+00 + -8.3332946991E+00 -8.2758235950E+00 -8.2191397734E+00 -8.1632271670E+00 + -8.1080701430E+00 -8.0536534879E+00 -7.9999623943E+00 -7.9469824467E+00 + -7.8946996093E+00 -7.8431002131E+00 -7.7921709439E+00 -7.7418988316E+00 + -7.6922712381E+00 -7.6432758479E+00 -7.5949006568E+00 -7.5471339627E+00 + -7.4999643563E+00 -7.4533807115E+00 -7.4073721771E+00 -7.3619281680E+00 + -7.3170383574E+00 -7.2726926689E+00 -7.2288812687E+00 -7.1855945589E+00 + -7.1428231697E+00 -7.1005579535E+00 -7.0587899775E+00 -7.0175105182E+00 + -6.9767110549E+00 -6.9363832638E+00 -6.8965190125E+00 -6.8571103546E+00 + -6.8181495241E+00 -6.7796289307E+00 -6.7415411546E+00 -6.7038789418E+00 + -6.6666351995E+00 -6.6298029916E+00 -6.5933755346E+00 -6.5573461930E+00 + -6.5217084759E+00 -6.4864560325E+00 -6.4515826487E+00 -6.4170822432E+00 + -6.3829488643E+00 -6.3491766860E+00 -6.3157600051E+00 -6.2826932379E+00 + -6.2499709169E+00 -6.2175876881E+00 -6.1855383072E+00 -6.1538176394E+00 + -6.1224206540E+00 -6.0913424162E+00 -6.0605781021E+00 -6.0301229784E+00 + -5.9999724060E+00 -5.9701218399E+00 -5.9405668243E+00 -5.9113029916E+00 + -5.8823260596E+00 -5.8536318298E+00 -5.8252161852E+00 -5.7970750882E+00 + -5.7692045790E+00 -5.7416007737E+00 -5.7142598621E+00 -5.6871781064E+00 + -5.6603518395E+00 -5.6337774626E+00 -5.6074514436E+00 -5.5813703240E+00 + -5.5555306939E+00 -5.5299292093E+00 -5.5045626073E+00 -5.4794276649E+00 + -5.4545212213E+00 -5.4298401761E+00 -5.4053814830E+00 -5.3811421508E+00 + -5.3571192417E+00 -5.3333098700E+00 -5.3097112011E+00 -5.2863204505E+00 + -5.2631348824E+00 -5.2401518088E+00 -5.2173685886E+00 -5.1947826261E+00 + -5.1723913708E+00 -5.1501923157E+00 -5.1281829966E+00 -5.1063609914E+00 + -5.0847239191E+00 -5.0632694387E+00 -5.0419952487E+00 -5.0208990859E+00 + -4.9999787252E+00 -4.9792319781E+00 -4.9586566924E+00 -4.9382507512E+00 + -4.9180120726E+00 -4.8979386083E+00 -4.8780283437E+00 -4.8582792965E+00 + -4.8386895165E+00 -4.8192570849E+00 -4.7999801136E+00 -4.7808567443E+00 + -4.7618851486E+00 -4.7430635267E+00 -4.7243901073E+00 -4.7058631470E+00 + -4.6874809293E+00 -4.6692417646E+00 -4.6511439897E+00 -4.6331859667E+00 + -4.6153660831E+00 -4.5976827512E+00 -4.5801344073E+00 -4.5627195117E+00 + -4.5454365480E+00 -4.5282840225E+00 -4.5112604642E+00 -4.4943644239E+00 + -4.4775944743E+00 -4.4609492092E+00 -4.4444272430E+00 -4.4280272110E+00 + -4.4117477683E+00 -4.3955875896E+00 -4.3795453691E+00 -4.3636198202E+00 + -4.3478096744E+00 -4.3321136821E+00 -4.3165306113E+00 -4.3010592478E+00 + -4.2856983948E+00 -4.2704468723E+00 -4.2553035174E+00 -4.2402671832E+00 + -4.2253367394E+00 -4.2105110713E+00 -4.1957890797E+00 -4.1811696811E+00 + -4.1666518066E+00 -4.1522344023E+00 -4.1379164290E+00 -4.1236968616E+00 + -4.1095746889E+00 -4.0955489138E+00 -4.0816185526E+00 -4.0677826350E+00 + -4.0540402038E+00 -4.0403903146E+00 -4.0268320357E+00 -4.0133644481E+00 + -3.9999866447E+00 -3.9866977307E+00 -3.9734968230E+00 -3.9603830504E+00 + -3.9473555528E+00 -3.9344134817E+00 -3.9215559995E+00 -3.9087822795E+00 + -3.8960915060E+00 -3.8834828736E+00 -3.8709555873E+00 -3.8585088624E+00 + -3.8461419243E+00 -3.8338540083E+00 -3.8216443592E+00 -3.8095122317E+00 + -3.7974568899E+00 -3.7854776069E+00 -3.7735736653E+00 -3.7617443565E+00 + -3.7499889808E+00 -3.7383068472E+00 -3.7266972732E+00 -3.7151595850E+00 + -3.7036931169E+00 -3.6922972115E+00 -3.6809712194E+00 -3.6697144991E+00 + -3.6585264172E+00 -3.6474063475E+00 -3.6363536720E+00 -3.6253677796E+00 + -3.6144480670E+00 -3.6035939378E+00 -3.5928048031E+00 -3.5820800806E+00 + -3.5714191954E+00 -3.5608215791E+00 -3.5502866701E+00 -3.5398139135E+00 + -3.5294027609E+00 -3.5190526702E+00 -3.5087631058E+00 -3.4985335383E+00 + -3.4883634445E+00 -3.4782523071E+00 -3.4681996152E+00 -3.4582048634E+00 + -3.4482675517E+00 -3.4383871855E+00 -3.4285632785E+00 -3.4187953499E+00 + -3.4090829206E+00 -3.3994255164E+00 -3.3898226717E+00 -3.3802739276E+00 + -3.3707788283E+00 -3.3613369222E+00 -3.3519477632E+00 -3.3426109106E+00 + -3.3333259287E+00 -3.3240923865E+00 -3.3149098574E+00 -3.3057779201E+00 + -3.2966961574E+00 -3.2876641570E+00 -3.2786815110E+00 -3.2697478159E+00 + -3.2608626727E+00 -3.2520256866E+00 -3.2432364671E+00 -3.2344946281E+00 + -3.2257997874E+00 -3.2171515669E+00 -3.2085495928E+00 -3.1999934950E+00 + -3.1914829075E+00 -3.1830174681E+00 -3.1745968186E+00 -3.1662206043E+00 + -3.1578884745E+00 -3.1496000821E+00 -3.1413550835E+00 -3.1331531389E+00 + -3.1249939119E+00 -3.1168770696E+00 -3.1088022826E+00 -3.1007692250E+00 + -3.0927775739E+00 -3.0848270102E+00 -3.0769172178E+00 -3.0690478838E+00 + -3.0612186986E+00 -3.0534293557E+00 -3.0456795518E+00 -3.0379689865E+00 + -3.0302973627E+00 -3.0226643860E+00 -3.0150697651E+00 -3.0075132117E+00 + -2.9999944402E+00 -2.9925131681E+00 -2.9850691153E+00 -2.9776620050E+00 + -2.9702915627E+00 -2.9629575168E+00 -2.9556595985E+00 -2.9483975414E+00 + -2.9411710818E+00 -2.9339799587E+00 -2.9268239134E+00 -2.9197026900E+00 + -2.9126160349E+00 -2.9055636970E+00 -2.8985454276E+00 -2.8915609805E+00 + -2.8846101118E+00 -2.8776925798E+00 -2.8708081454E+00 -2.8639565715E+00 + -2.8571376235E+00 -2.8503510689E+00 -2.8435966773E+00 -2.8368742208E+00 + -2.8301834733E+00 -2.8235242111E+00 -2.8168962123E+00 -2.8102992575E+00 + -2.8037331289E+00 -2.7971976110E+00 -2.7906924903E+00 -2.7842175551E+00 + -2.7777725960E+00 -2.7713574051E+00 -2.7649717768E+00 -2.7586155072E+00 + -2.7522883942E+00 -2.7459902377E+00 -2.7397208394E+00 -2.7334800028E+00 + -2.7272675332E+00 -2.7210832375E+00 -2.7149269245E+00 -2.7087984049E+00 + -2.7026974907E+00 -2.6966239959E+00 -2.6905777361E+00 -2.6845585285E+00 + -2.6785661919E+00 -2.6726005468E+00 -2.6666614154E+00 -2.6607486211E+00 + -2.6548619893E+00 -2.6490013466E+00 -2.6431665214E+00 -2.6373573434E+00 + -2.6315736439E+00 -2.6258152557E+00 -2.6200820130E+00 -2.6143737514E+00 + -2.6086903081E+00 -2.6030315214E+00 -2.5973972314E+00 -2.5917872794E+00 + -2.5862015078E+00 -2.5806397609E+00 -2.5751018838E+00 -2.5695877233E+00 + -2.5640971274E+00 -2.5586299454E+00 -2.5531860277E+00 -2.5477652262E+00 + -2.5423673940E+00 -2.5369923855E+00 -2.5316400562E+00 -2.5263102628E+00 + -2.5210028633E+00 -2.5157177169E+00 -2.5104546840E+00 -2.5052136260E+00 + -2.4999944056E+00 -2.4947968867E+00 -2.4896209340E+00 -2.4844664138E+00 + -2.4793331932E+00 -2.4742211404E+00 -2.4691301248E+00 -2.4640600167E+00 + -2.4590106877E+00 -2.4539820103E+00 -2.4489738581E+00 -2.4439861056E+00 + -2.4390186285E+00 -2.4340713034E+00 -2.4291440079E+00 -2.4242366206E+00 + -2.4193490212E+00 -2.4144810902E+00 -2.4096327091E+00 -2.4048037604E+00 + -2.3999941274E+00 -2.3952036947E+00 -2.3904323473E+00 -2.3856799715E+00 + -2.3809464544E+00 -2.3762316839E+00 -2.3715355489E+00 -2.3668579391E+00 + -2.3621987451E+00 -2.3575578585E+00 -2.3529351715E+00 -2.3483305772E+00 + -2.3437439697E+00 -2.3391752438E+00 -2.3346242951E+00 -2.3300910200E+00 + -2.3255753159E+00 -2.3210770808E+00 -2.3165962134E+00 -2.3121326134E+00 + -2.3076861813E+00 -2.3032568180E+00 -2.2988444256E+00 -2.2944489068E+00 + -2.2900701648E+00 -2.2857081038E+00 -2.2813626288E+00 -2.2770336452E+00 + -2.2727210595E+00 -2.2684247785E+00 -2.2641447101E+00 -2.2598807625E+00 + -2.2556328450E+00 -2.2514008673E+00 -2.2471847398E+00 -2.2429843737E+00 + -2.2387996807E+00 -2.2346305733E+00 -2.2304769647E+00 -2.2263387684E+00 + -2.2222158990E+00 -2.2181082714E+00 -2.2140158012E+00 -2.2099384047E+00 + -2.2058759989E+00 -2.2018285011E+00 -2.1977958295E+00 -2.1937779027E+00 + -2.1897746401E+00 -2.1857859614E+00 -2.1818117872E+00 -2.1778520386E+00 + -2.1739066370E+00 -2.1699755046E+00 -2.1660585643E+00 -2.1621557392E+00 + -2.1582669532E+00 -2.1543921308E+00 -2.1505311967E+00 -2.1466840766E+00 + -2.1428506964E+00 -2.1390309825E+00 -2.1352248622E+00 -2.1314322629E+00 + -2.1276531127E+00 -2.1238873402E+00 -2.1201348745E+00 -2.1163956452E+00 + -2.1126695824E+00 -2.1089566167E+00 -2.1052566791E+00 -2.1015697012E+00 + -2.0978956150E+00 -2.0942343530E+00 -2.0905858482E+00 -2.0869500341E+00 + -2.0833268445E+00 -2.0797162137E+00 -2.0761180768E+00 -2.0725323688E+00 + -2.0689590254E+00 -2.0653979830E+00 -2.0618491780E+00 -2.0583125474E+00 + -2.0547880288E+00 -2.0512755600E+00 -2.0477750794E+00 -2.0442865256E+00 + -2.0408098378E+00 -2.0373449556E+00 -2.0338918189E+00 -2.0304503682E+00 + -2.0270205441E+00 -2.0236022880E+00 -2.0201955413E+00 -2.0168002460E+00 + -2.0134163445E+00 -2.0100437796E+00 -2.0066824943E+00 -2.0033324322E+00 + -1.9999935371E+00 -1.9966657533E+00 -1.9933490255E+00 -1.9900432986E+00 + -1.9867485179E+00 -1.9834646293E+00 -1.9801915788E+00 -1.9769293128E+00 + -1.9736777781E+00 -1.9704369219E+00 -1.9672066915E+00 -1.9639870350E+00 + -1.9607779003E+00 -1.9575792361E+00 -1.9543909911E+00 -1.9512131146E+00 + -1.9480455560E+00 -1.9448882652E+00 -1.9417411923E+00 -1.9386042878E+00 + -1.9354775026E+00 -1.9323607876E+00 -1.9292540944E+00 -1.9261573747E+00 + -1.9230705805E+00 -1.9199936642E+00 -1.9169265785E+00 -1.9138692763E+00 + -1.9108217109E+00 -1.9077838358E+00 -1.9047556049E+00 -1.9017369723E+00 + -1.8987278926E+00 -1.8957283203E+00 -1.8927382106E+00 -1.8897575186E+00 + -1.8867862001E+00 -1.8838242108E+00 -1.8808715068E+00 -1.8779280447E+00 + -1.8749937810E+00 -1.8720686727E+00 -1.8691526770E+00 -1.8662457514E+00 + -1.8633478537E+00 -1.8604589418E+00 -1.8575789741E+00 -1.8547079090E+00 + -1.8518457054E+00 -1.8489923222E+00 -1.8461477188E+00 -1.8433118547E+00 + -1.8404846897E+00 -1.8376661838E+00 -1.8348562974E+00 -1.8320549908E+00 + -1.8292622250E+00 -1.8264779608E+00 -1.8237021596E+00 -1.8209347828E+00 + -1.8181757920E+00 -1.8154251493E+00 -1.8126828168E+00 -1.8099487570E+00 + -1.8072229323E+00 -1.8045053058E+00 -1.8017958403E+00 -1.7990944994E+00 + -1.7964012464E+00 -1.7937160450E+00 -1.7910388593E+00 -1.7883696534E+00 + -1.7857083916E+00 -1.7830550386E+00 -1.7804095592E+00 -1.7777719183E+00 + -1.7751420812E+00 -1.7725200132E+00 -1.7699056801E+00 -1.7672990476E+00 + -1.7647000818E+00 -1.7621087489E+00 -1.7595250152E+00 -1.7569488475E+00 + -1.7543802125E+00 -1.7518190773E+00 -1.7492654091E+00 -1.7467191751E+00 + -1.7441803432E+00 -1.7416488809E+00 -1.7391247562E+00 -1.7366079374E+00 + -1.7340983927E+00 -1.7315960906E+00 -1.7291009999E+00 -1.7266130893E+00 + -1.7241323280E+00 -1.7216586852E+00 -1.7191921302E+00 -1.7167326327E+00 + -1.7142801624E+00 -1.7118346893E+00 -1.7093961833E+00 -1.7069646149E+00 + -1.7045399544E+00 -1.7021221725E+00 -1.6997112399E+00 -1.6973071275E+00 + -1.6949098064E+00 -1.6925192480E+00 -1.6901354236E+00 -1.6877583048E+00 + -1.6853878634E+00 -1.6830240712E+00 -1.6806669004E+00 -1.6783163231E+00 + -1.6759723117E+00 -1.6736348388E+00 -1.6713038770E+00 -1.6689793992E+00 + -1.6666613783E+00 -1.6643497875E+00 -1.6620446000E+00 -1.6597457893E+00 + -1.6574533290E+00 -1.6551671928E+00 -1.6528873545E+00 -1.6506137882E+00 + -1.6483464680E+00 -1.6460853682E+00 -1.6438304632E+00 -1.6415817276E+00 + -1.6393391362E+00 -1.6371026638E+00 -1.6348722854E+00 -1.6326479760E+00 + -1.6304297111E+00 -1.6282174659E+00 -1.6260112159E+00 -1.6238109370E+00 + -1.6216166047E+00 -1.6194281952E+00 -1.6172456843E+00 -1.6150690484E+00 + -1.6128982637E+00 -1.6107333066E+00 -1.6085741537E+00 -1.6064207818E+00 + -1.6042731675E+00 -1.6021312879E+00 -1.5999951201E+00 -1.5978646411E+00 + -1.5957398283E+00 -1.5936206592E+00 -1.5915071112E+00 -1.5893991621E+00 + -1.5872967896E+00 -1.5851999716E+00 -1.5831086861E+00 -1.5810229113E+00 + -1.5789426254E+00 -1.5768678068E+00 -1.5747984340E+00 -1.5727344855E+00 + -1.5706759400E+00 -1.5686227763E+00 -1.5665749735E+00 -1.5645325104E+00 + -1.5624953663E+00 -1.5604635203E+00 -1.5584369519E+00 -1.5564156406E+00 + -1.5543995658E+00 -1.5523887073E+00 -1.5503830448E+00 -1.5483825582E+00 + -1.5463872276E+00 -1.5443970329E+00 -1.5424119545E+00 -1.5404319726E+00 + -1.5384570675E+00 -1.5364872199E+00 -1.5345224103E+00 -1.5325626193E+00 + -1.5306078279E+00 -1.5286580168E+00 -1.5267131671E+00 -1.5247732598E+00 + -1.5228382762E+00 -1.5209081975E+00 -1.5189830051E+00 -1.5170626805E+00 + -1.5151472052E+00 -1.5132365608E+00 -1.5113307292E+00 -1.5094296921E+00 + -1.5075334316E+00 -1.5056419295E+00 -1.5037551681E+00 -1.5018731295E+00 + -1.4999957960E+00 -1.4981231500E+00 -1.4962551739E+00 -1.4943918503E+00 + -1.4925331619E+00 -1.4906790914E+00 -1.4888296215E+00 -1.4869847353E+00 + -1.4851444156E+00 -1.4833086455E+00 -1.4814774082E+00 -1.4796506869E+00 + -1.4778284649E+00 -1.4760107256E+00 -1.4741974526E+00 -1.4723886293E+00 + -1.4705842394E+00 -1.4687842666E+00 -1.4669886948E+00 -1.4651975077E+00 + -1.4634106894E+00 -1.4616282239E+00 -1.4598500953E+00 -1.4580762878E+00 + -1.4563067857E+00 -1.4545415732E+00 -1.4527806349E+00 -1.4510239552E+00 + -1.4492715188E+00 -1.4475233101E+00 -1.4457793140E+00 -1.4440395153E+00 + -1.4423038988E+00 -1.4405724494E+00 -1.4388451522E+00 -1.4371219922E+00 + -1.4354029546E+00 -1.4336880246E+00 -1.4319771876E+00 -1.4302704288E+00 + -1.4285677338E+00 -1.4268690880E+00 -1.4251744769E+00 -1.4234838863E+00 + -1.4217973018E+00 -1.4201147093E+00 -1.4184360945E+00 -1.4167614434E+00 + -1.4150907419E+00 -1.4134239762E+00 -1.4117611322E+00 -1.4101021962E+00 + -1.4084471544E+00 -1.4067959932E+00 -1.4051486988E+00 -1.4035052578E+00 + -1.4018656565E+00 -1.4002298817E+00 -1.3985979198E+00 -1.3969697576E+00 + -1.3953453819E+00 -1.3937247793E+00 -1.3921079369E+00 -1.3904948415E+00 + -1.3888854801E+00 -1.3872798398E+00 -1.3856779076E+00 -1.3840796708E+00 + -1.3824851166E+00 -1.3808942322E+00 -1.3793070050E+00 -1.3777234224E+00 + -1.3761434719E+00 -1.3745671410E+00 -1.3729944173E+00 -1.3714252883E+00 + -1.3698597418E+00 -1.3682977656E+00 -1.3667393474E+00 -1.3651844750E+00 + -1.3636331365E+00 -1.3620853197E+00 -1.3605410127E+00 -1.3590002036E+00 + -1.3574628804E+00 -1.3559290315E+00 -1.3543986449E+00 -1.3528717090E+00 + -1.3513482122E+00 -1.3498281428E+00 -1.3483114893E+00 -1.3467982402E+00 + -1.3452883840E+00 -1.3437819093E+00 -1.3422788048E+00 -1.3407790592E+00 + -1.3392826613E+00 -1.3377895998E+00 -1.3362998636E+00 -1.3348134416E+00 + -1.3333303227E+00 -1.3318504960E+00 -1.3303739505E+00 -1.3289006753E+00 + -1.3274306596E+00 -1.3259638925E+00 -1.3245003633E+00 -1.3230400613E+00 + -1.3215829758E+00 -1.3201290962E+00 -1.3186784119E+00 -1.3172309124E+00 + -1.3157865873E+00 -1.3143454261E+00 -1.3129074184E+00 -1.3114725539E+00 + -1.3100408222E+00 -1.3086122132E+00 -1.3071867167E+00 -1.3057643224E+00 + -1.3043450202E+00 -1.3029288001E+00 -1.3015156521E+00 -1.3001055662E+00 + -1.2986985324E+00 -1.2972945408E+00 -1.2958935816E+00 -1.2944956449E+00 + -1.2931007210E+00 -1.2917088002E+00 -1.2903198727E+00 -1.2889339290E+00 + -1.2875509594E+00 -1.2861709544E+00 -1.2847939044E+00 -1.2834197999E+00 + -1.2820486315E+00 -1.2806803899E+00 -1.2793150656E+00 -1.2779526494E+00 + -1.2765931319E+00 -1.2752365039E+00 -1.2738827562E+00 -1.2725318796E+00 + -1.2711838651E+00 -1.2698387035E+00 -1.2684963858E+00 -1.2671569029E+00 + -1.2658202460E+00 -1.2644864060E+00 -1.2631553741E+00 -1.2618271414E+00 + -1.2605016992E+00 -1.2591790385E+00 -1.2578591507E+00 -1.2565420270E+00 + -1.2552276589E+00 -1.2539160375E+00 -1.2526071544E+00 -1.2513010010E+00 + -1.2499975687E+00 -1.2486968491E+00 -1.2473988337E+00 -1.2461035140E+00 + -1.2448108817E+00 -1.2435209284E+00 -1.2422336459E+00 -1.2409490257E+00 + -1.2396670597E+00 -1.2383877397E+00 -1.2371110574E+00 -1.2358370047E+00 + -1.2345655735E+00 -1.2332967558E+00 -1.2320305434E+00 -1.2307669283E+00 + -1.2295059027E+00 -1.2282474584E+00 -1.2269915876E+00 -1.2257382825E+00 + -1.2244875351E+00 -1.2232393376E+00 -1.2219936823E+00 -1.2207505613E+00 + -1.2195099671E+00 -1.2182718917E+00 -1.2170363277E+00 -1.2158032674E+00 + -1.2145727031E+00 -1.2133446273E+00 -1.2121190324E+00 -1.2108959110E+00 + -1.2096752556E+00 -1.2084570586E+00 -1.2072413128E+00 -1.2060280106E+00 + -1.2048171448E+00 -1.2036087080E+00 -1.2024026929E+00 -1.2011990923E+00 + -1.1999978988E+00 -1.1987991053E+00 -1.1976027046E+00 -1.1964086896E+00 + -1.1952170530E+00 -1.1940277879E+00 -1.1928408870E+00 -1.1916563435E+00 + -1.1904741503E+00 -1.1892943003E+00 -1.1881167866E+00 -1.1869416024E+00 + -1.1857687406E+00 -1.1845981945E+00 -1.1834299571E+00 -1.1822640216E+00 + -1.1811003813E+00 -1.1799390294E+00 -1.1787799590E+00 -1.1776231636E+00 + -1.1764686364E+00 -1.1753163708E+00 -1.1741663600E+00 -1.1730185976E+00 + -1.1718730769E+00 -1.1707297913E+00 -1.1695887343E+00 -1.1684498995E+00 + -1.1673132803E+00 -1.1661788702E+00 -1.1650466629E+00 -1.1639166518E+00 + -1.1627888307E+00 -1.1616631932E+00 -1.1605397330E+00 -1.1594184436E+00 + -1.1582993189E+00 -1.1571823526E+00 -1.1560675384E+00 -1.1549548701E+00 + -1.1538443416E+00 -1.1527359466E+00 -1.1516296791E+00 -1.1505255329E+00 + -1.1494235019E+00 -1.1483235800E+00 -1.1472257612E+00 -1.1461300395E+00 + -1.1450364089E+00 -1.1439448633E+00 -1.1428553969E+00 -1.1417680036E+00 + -1.1406826776E+00 -1.1395994130E+00 -1.1385182040E+00 -1.1374390446E+00 + -1.1363619290E+00 -1.1352868515E+00 -1.1342138063E+00 -1.1331427876E+00 + -1.1320737897E+00 -1.1310068068E+00 -1.1299418333E+00 -1.1288788636E+00 + -1.1278178918E+00 -1.1267589125E+00 -1.1257019200E+00 -1.1246469088E+00 + -1.1235938732E+00 -1.1225428077E+00 -1.1214937069E+00 -1.1204465651E+00 + -1.1194013769E+00 -1.1183581369E+00 -1.1173168396E+00 -1.1162774796E+00 + -1.1152400515E+00 -1.1142045499E+00 -1.1131709694E+00 -1.1121393047E+00 + -1.1111095505E+00 -1.1100817015E+00 -1.1090557524E+00 -1.1080316979E+00 + -1.1070095328E+00 -1.1059892519E+00 -1.1049708499E+00 -1.1039543217E+00 + -1.1029396621E+00 -1.1019268660E+00 -1.1009159282E+00 -1.0999068436E+00 + -1.0988996072E+00 -1.0978942138E+00 -1.0968906584E+00 -1.0958889360E+00 + -1.0948890415E+00 -1.0938909700E+00 -1.0928947165E+00 -1.0919002759E+00 + -1.0909076435E+00 -1.0899168141E+00 -1.0889277830E+00 -1.0879405453E+00 + -1.0869550960E+00 -1.0859714303E+00 -1.0849895433E+00 -1.0840094304E+00 + -1.0830310866E+00 -1.0820545071E+00 -1.0810796872E+00 -1.0801066222E+00 + -1.0791353073E+00 -1.0781657378E+00 -1.0771979089E+00 -1.0762318161E+00 + -1.0752674546E+00 -1.0743048198E+00 -1.0733439071E+00 -1.0723847117E+00 + -1.0714272293E+00 -1.0704714551E+00 -1.0695173846E+00 -1.0685650132E+00 + -1.0676143364E+00 -1.0666653497E+00 -1.0657180486E+00 -1.0647724285E+00 + -1.0638284851E+00 -1.0628862139E+00 -1.0619456104E+00 -1.0610066702E+00 + -1.0600693889E+00 -1.0591337621E+00 -1.0581997854E+00 -1.0572674545E+00 + -1.0563367650E+00 -1.0554077126E+00 -1.0544802929E+00 -1.0535545018E+00 + -1.0526303348E+00 -1.0517077877E+00 -1.0507868563E+00 -1.0498675363E+00 + -1.0489498235E+00 -1.0480337137E+00 -1.0471192027E+00 -1.0462062863E+00 + -1.0452949603E+00 -1.0443852206E+00 -1.0434770631E+00 -1.0425704836E+00 + -1.0416654779E+00 -1.0407620422E+00 -1.0398601721E+00 -1.0389598637E+00 + -1.0380611130E+00 -1.0371639158E+00 -1.0362682682E+00 -1.0353741661E+00 + -1.0344816055E+00 -1.0335905826E+00 -1.0327010932E+00 -1.0318131334E+00 + -1.0309266994E+00 -1.0300417871E+00 -1.0291583927E+00 -1.0282765122E+00 + -1.0273961418E+00 -1.0265172776E+00 -1.0256399157E+00 -1.0247640522E+00 + -1.0238896834E+00 -1.0230168055E+00 -1.0221454145E+00 -1.0212755067E+00 + -1.0204070784E+00 -1.0195401257E+00 -1.0186746449E+00 -1.0178106323E+00 + -1.0169480841E+00 -1.0160869966E+00 -1.0152273661E+00 -1.0143691889E+00 + -1.0135124613E+00 -1.0126571796E+00 -1.0118033403E+00 -1.0109509395E+00 + -1.0100999738E+00 -1.0092504395E+00 -1.0084023330E+00 -1.0075556506E+00 + -1.0067103889E+00 -1.0058665441E+00 -1.0050241129E+00 -1.0041830915E+00 + -1.0033434766E+00 -1.0025052644E+00 -1.0016684517E+00 -1.0008330348E+00 + -9.9999901021E-01 -9.9916637453E-01 -9.9833512425E-01 -9.9750525593E-01 + -9.9667676612E-01 -9.9584965139E-01 -9.9502390831E-01 -9.9419953349E-01 + -9.9337652352E-01 -9.9255487501E-01 -9.9173458459E-01 -9.9091564890E-01 + -9.9009806457E-01 -9.8928182828E-01 -9.8846693669E-01 -9.8765338647E-01 + -9.8684117432E-01 -9.8603029694E-01 -9.8522075105E-01 -9.8441253336E-01 + -9.8360564061E-01 -9.8280006954E-01 -9.8199581691E-01 -9.8119287949E-01 + -9.8039125406E-01 -9.7959093739E-01 -9.7879192628E-01 -9.7799421755E-01 + -9.7719780802E-01 -9.7640269450E-01 -9.7560887385E-01 -9.7481634290E-01 + -9.7402509853E-01 -9.7323513759E-01 -9.7244645697E-01 -9.7165905356E-01 + -9.7087292426E-01 -9.7008806598E-01 -9.6930447563E-01 -9.6852215016E-01 + -9.6774108649E-01 -9.6696128158E-01 -9.6618273239E-01 -9.6540543588E-01 + -9.6462938904E-01 -9.6385458886E-01 + + + + -8.6841880309E-07 3.1061861962E-01 6.1638362395E-01 9.1255709259E-01 + 1.1946280535E+00 1.4584151186E+00 1.7001568336E+00 1.9165867906E+00 + 2.1049914210E+00 2.2632493405E+00 2.3898520963E+00 2.4839070895E+00 + 2.5451242543E+00 2.5737887165E+00 2.5707220889E+00 2.5372352688E+00 + 2.4750755849E+00 2.3863709110E+00 2.2735729668E+00 2.1394014944E+00 + 1.9867904099E+00 1.8188364297E+00 1.6387501246E+00 1.4498089241E+00 + 1.2553113019E+00 1.0585312653E+00 8.6267234071E-01 6.7082049719E-01 + 4.8589583564E-01 3.1060337122E-01 1.4738377781E-01 -1.6345000212E-03 + -1.3467989817E-01 -2.5037693866E-01 -3.4777761357E-01 -4.2638260559E-01 + -4.8615025390E-01 -5.2749163458E-01 -5.5125077011E-01 -5.5866977074E-01 + -5.5133958444E-01 -5.3113792596E-01 -5.0015679824E-01 -4.6062274252E-01 + -4.1481349597E-01 -3.6497504834E-01 -3.1324314269E-01 -2.6157304642E-01 + -2.1168094009E-01 -1.6499956301E-01 -1.2264986603E-01 -8.5429418156E-02 + -5.3817268537E-02 -2.7993956222E-02 -7.8744620851E-03 6.8488252527E-03 + 1.6657937794E-02 2.2180531775E-02 2.4169686723E-02 2.3453100023E-02 + 2.0872974389E-02 1.7224797088E-02 1.3201367876E-02 9.3491611965E-03 + 6.0429824399E-03 3.4821367929E-03 1.7077163519E-03 6.4346683931E-04 + 1.5338888235E-04 9.0655799278E-06 -9.9524011533E-08 2.4057341429E-09 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. + + + 2.4466839826E-06 -1.4334982369E-01 -2.8116489140E-01 -4.0811310198E-01 + -5.1925699262E-01 -6.1022513757E-01 -6.7735450296E-01 -7.1779733131E-01 + -7.2958857592E-01 -7.1167256917E-01 -6.6389027753E-01 -5.8693095821E-01 + -4.8225409872E-01 -3.5198903521E-01 -1.9882050264E-01 -2.5868521028E-02 + 1.6342952091E-01 3.6542788809E-01 5.7636759349E-01 7.9245452485E-01 + 1.0099196969E+00 1.2250627926E+00 1.4342819698E+00 1.6340942986E+00 + 1.8211520309E+00 1.9922601111E+00 2.1443999038E+00 2.2747630765E+00 + 2.3807980392E+00 2.4602694610E+00 2.5113293242E+00 2.5325959633E+00 + 2.5232357543E+00 2.4830407617E+00 2.4124948707E+00 2.3128208204E+00 + 2.1860011676E+00 2.0347675174E+00 1.8625542763E+00 1.6734155787E+00 + 1.4719067145E+00 1.2629341287E+00 1.0515806492E+00 8.4291479223E-01 + 6.4179461248E-01 4.5267744178E-01 2.7944691461E-01 1.2526787001E-01 + -7.5219012308E-03 -1.1747642268E-01 -2.0405903334E-01 -2.6761202771E-01 + -3.0928109621E-01 -3.3090030425E-01 -3.3484600338E-01 -3.2387009670E-01 + -3.0092984129E-01 -2.6910816731E-01 -2.3157342032E-01 -1.9142415730E-01 + -1.5150798572E-01 -1.1424573338E-01 -8.1483009055E-02 -5.4392699825E-02 + -3.3446710687E-02 -1.8464590307E-02 -8.7335426453E-03 -3.2063105263E-03 + -7.5220117285E-04 -4.8192066647E-05 4.1210241062E-07 -7.9997240547E-09 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. + + + -4.5112125178E-05 -5.6192720400E-02 -2.1648201808E-01 -4.5699769998E-01 + -7.4116127847E-01 -1.0241008078E+00 -1.2580932908E+00 -1.3984012738E+00 + -1.4088251380E+00 -1.2663265181E+00 -9.6418689021E-01 -5.1333553926E-01 + 5.8307464911E-02 7.0839995842E-01 1.3843674328E+00 2.0287415181E+00 + 2.5850494176E+00 3.0036011086E+00 3.2465411519E+00 3.2916238160E+00 + 3.1343219909E+00 2.7880732494E+00 2.2826772236E+00 1.6610623889E+00 + 9.7481398345E-01 2.7897890407E-01 -3.7327488203E-01 -9.3557272807E-01 + -1.3723202500E+00 -1.6613860339E+00 -1.7952652450E+00 -1.7806882295E+00 + -1.6368125058E+00 -1.3922859575E+00 -1.0815771521E+00 -7.4102481381E-01 + -4.0505866108E-01 -1.0299114393E-01 1.4331652722E-01 3.2073603584E-01 + 4.2506075945E-01 4.6019311435E-01 4.3653226166E-01 3.6884057902E-01 + 2.7390280969E-01 1.6828471476E-01 6.6452503947E-02 -2.0560771622E-02 + -8.5848037060E-02 -1.2668221725E-01 -1.4401939071E-01 -1.4160392214E-01 + -1.2486490617E-01 -9.9798393648E-02 -7.2005477185E-02 -4.6008404506E-02 + -2.4895645673E-02 -1.0147691254E-02 -2.1282963662E-03 1.3851628572E-04 + 4.7103476611E-05 3.1481702429E-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. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. + + + 1.5222654325E-05 3.0740491066E-02 1.2004338483E-01 2.5947411392E-01 + 4.3600938036E-01 6.3346589338E-01 8.3426962352E-01 1.0213666771E+00 + 1.1800616722E+00 1.2995786271E+00 1.3741716775E+00 1.4036645756E+00 + 1.3933628470E+00 1.3533531723E+00 1.2972729054E+00 1.2406908913E+00 + 1.1992824209E+00 1.1870017489E+00 1.2144531215E+00 1.2876363675E+00 + 1.4071990565E+00 1.5682693653E+00 1.7608789704E+00 1.9709209488E+00 + 2.1815310685E+00 2.3747381084E+00 2.5332043675E+00 2.6418734525E+00 + 2.6893585270E+00 2.6689379224E+00 2.5790718699E+00 2.4234083221E+00 + 2.2103009823E+00 1.9519125241E+00 1.6630152349E+00 1.3596261124E+00 + 1.0576218178E+00 7.7147088291E-01 5.1319813921E-01 2.9166299016E-01 + 1.1219347050E-01 -2.3422964142E-02 -1.1662847438E-01 -1.7153020994E-01 + -1.9416810467E-01 -1.9170904204E-01 -1.7165769411E-01 -1.4116079796E-01 + -1.0646090558E-01 -7.2531083249E-02 -4.2897158955E-02 -1.9632112020E-02 + -3.4905271384E-03 5.8588469087E-03 9.5471489844E-03 9.2071277685E-03 + 6.6865122419E-03 3.6651298892E-03 1.3333231653E-03 2.1788638821E-04 + -2.2245227517E-06 -3.8078025436E-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. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. + + + -5.1022814217E+01 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 -1.3913995237E+01 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 -9.7791781075E+01 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 -1.1375361464E+01 + + + + + -1.5695869271E-08 1.3566682906E-01 2.7044386015E-01 4.0345209821E-01 + 5.3383396698E-01 6.6076355529E-01 7.8345631917E-01 9.0117807775E-01 + 1.0132531562E+00 1.1190715480E+00 1.2180949906E+00 1.3098618693E+00 + 1.3939908940E+00 1.4701835108E+00 1.5382250444E+00 1.5979845842E+00 + 1.6494136556E+00 1.6925437376E+00 1.7274827067E+00 1.7544103070E+00 + 1.7735727577E+00 1.7852766228E+00 1.7898820745E+00 1.7877956900E+00 + 1.7794629195E+00 1.7653603679E+00 1.7459880240E+00 1.7218615718E+00 + 1.6935049036E+00 1.6614429526E+00 1.6261949445E+00 1.5882681607E+00 + 1.5481522883E+00 1.5063144198E+00 1.4631947512E+00 1.4192030099E+00 + 1.3747156316E+00 1.3300736894E+00 1.2855815645E+00 1.2415063351E+00 + 1.1980778464E+00 1.1554894150E+00 1.1138991093E+00 1.0734315407E+00 + 1.0341800904E+00 9.9620949542E-01 9.5955871016E-01 9.2424396087E-01 + 8.9026190903E-01 8.5759284313E-01 8.2620382193E-01 7.9605169839E-01 + 7.6708596108E-01 7.3925133878E-01 7.1249012441E-01 6.8674418519E-01 + 6.6195663785E-01 6.3807317930E-01 6.1504307469E-01 5.9281981591E-01 + 5.7136147371E-01 5.5063077600E-01 5.3059495166E-01 5.1122538547E-01 + 4.9249713264E-01 4.7438834324E-01 4.5687964585E-01 4.3995353736E-01 + 4.2359382459E-01 4.0778515439E-01 3.9251263538E-01 3.7776158810E-01 + 3.6351745587E-01 3.4976583788E-01 3.3649253186E-01 3.2368356183E-01 + 3.1132519495E-01 2.9940395124E-01 2.8790660892E-01 2.7682020746E-01 + 2.6613204943E-01 2.5582970193E-01 2.4590099788E-01 2.3633403718E-01 + 2.2711718791E-01 2.1823908723E-01 2.0968864213E-01 2.0145502980E-01 + 1.9352769760E-01 1.8589636264E-01 1.7855101083E-01 1.7148189554E-01 + 1.6467953572E-01 1.5813471368E-01 1.5183847239E-01 1.4578211242E-01 + 1.3995718858E-01 1.3435550616E-01 1.2896911699E-01 1.2379031522E-01 + 1.1881163287E-01 1.1402583527E-01 1.0942591627E-01 1.0500509342E-01 + 1.0075680298E-01 9.6674694929E-02 9.2752627863E-02 8.8984663900E-02 + 8.5365063558E-02 8.1888280637E-02 7.8548957115E-02 7.5341918070E-02 + 7.2262166642E-02 6.9304879042E-02 6.6465399610E-02 6.3739235946E-02 + 6.1122054105E-02 5.8609673861E-02 5.6198064060E-02 5.3883338053E-02 + 5.1661749211E-02 4.9529686536E-02 4.7483670358E-02 4.5520348132E-02 + 4.3636490325E-02 4.1828986399E-02 4.0094840895E-02 3.8431169608E-02 + 3.6835195867E-02 3.5304246899E-02 3.3835750307E-02 3.2427230626E-02 + 3.1076305988E-02 2.9780684874E-02 2.8538162957E-02 2.7346620044E-02 + 2.6204017105E-02 2.5108393384E-02 2.4057863613E-02 2.3050615295E-02 + 2.2084906083E-02 2.1159061235E-02 2.0271471155E-02 1.9420589007E-02 + 1.8604928412E-02 1.7823061216E-02 1.7073615334E-02 1.6355272665E-02 + 1.5666767078E-02 1.5006882462E-02 1.4374450850E-02 1.3768350600E-02 + 1.3187504640E-02 1.2630878781E-02 1.2097480079E-02 1.1586355258E-02 + 1.1096589196E-02 1.0627303454E-02 1.0177654864E-02 9.7468341638E-03 + 9.3340646889E-03 8.9386011015E-03 8.5597281731E-03 8.1967596091E-03 + 7.8490369170E-03 7.5159283164E-03 7.1968276893E-03 6.8911535700E-03 + 6.5983481723E-03 6.3178764529E-03 6.0492252108E-03 5.7919022206E-03 + 5.5454353977E-03 5.3093719966E-03 5.0832778387E-03 4.8667365702E-03 + 4.6593489485E-03 4.4607321554E-03 4.2705191378E-03 4.0883579730E-03 + 3.9139112591E-03 3.7468555288E-03 3.5868806866E-03 3.4336894673E-03 + 3.2869969160E-03 3.1465298885E-03 3.0120265716E-03 2.8832360218E-03 + 2.7599177225E-03 2.6418411586E-03 2.5287854085E-03 2.4205387513E-03 + 2.3168982904E-03 2.2176695921E-03 2.1226663381E-03 2.0317099924E-03 + 1.9446294816E-03 1.8612608871E-03 1.7814471512E-03 1.7050377937E-03 + 1.6318886407E-03 1.5618615639E-03 1.4948242306E-03 1.4306498642E-03 + 1.3692170135E-03 1.3104093327E-03 1.2541153687E-03 1.2002283585E-03 + 1.1486460344E-03 1.0992704363E-03 1.0520077334E-03 1.0067680514E-03 + 9.6346530791E-04 9.2201705436E-04 8.8234432408E-04 8.4437148699E-04 + 8.0802611010E-04 7.7323882377E-04 7.3994319348E-04 7.0807559692E-04 + 6.7757510611E-04 6.4838337442E-04 6.2044452826E-04 5.9370506323E-04 + 5.6811374461E-04 5.4362151193E-04 5.2018138756E-04 4.9774838902E-04 + 4.7627944501E-04 4.5573331488E-04 4.3607051149E-04 4.1725322725E-04 + 3.9924526326E-04 3.8201196139E-04 3.6552013925E-04 3.4973802781E-04 + 3.3463521165E-04 3.2018257173E-04 3.0635223052E-04 2.9311749946E-04 + 2.8045282863E-04 2.6833375846E-04 2.5673687358E-04 2.4563975848E-04 + 2.3502095515E-04 2.2485992242E-04 2.1513699705E-04 2.0583335643E-04 + 1.9693098289E-04 1.8841262947E-04 1.8026178717E-04 1.7246265353E-04 + 1.6500010263E-04 1.5785965620E-04 1.5102745616E-04 1.4449023811E-04 + 1.3823530609E-04 1.3225050833E-04 1.2652421406E-04 1.2104529129E-04 + 1.1580308551E-04 1.1078739937E-04 1.0598847309E-04 1.0139696585E-04 + 9.7003937835E-05 9.2800833137E-05 8.8779463340E-05 8.4931991807E-05 + 8.1250918642E-05 7.7729066283E-05 7.4359565712E-05 7.1135843253E-05 + 6.8051607927E-05 6.5100839348E-05 6.2277776134E-05 5.9576904813E-05 + 5.6992949196E-05 5.4520860213E-05 5.2155806168E-05 4.9893163425E-05 + 4.7728507482E-05 4.5657604424E-05 4.3676402752E-05 4.1781025545E-05 + 3.9967762973E-05 3.8233065118E-05 3.6573535106E-05 3.4985922535E-05 + 3.3467117178E-05 3.2014142963E-05 3.0624152203E-05 2.9294420077E-05 + 2.8022339347E-05 2.6805415302E-05 2.5641260915E-05 2.4527592211E-05 + 2.3462223831E-05 2.2443064789E-05 2.1468114409E-05 2.0535458433E-05 + 1.9643265304E-05 1.8789782602E-05 1.7973333633E-05 1.7192314168E-05 + 1.6445189320E-05 1.5730490554E-05 1.5046812828E-05 1.4392811853E-05 + 1.3767201476E-05 1.3168751170E-05 1.2596283639E-05 1.2048672513E-05 + 1.1524840159E-05 1.1023755573E-05 1.0544432369E-05 1.0085926852E-05 + 9.6473361759E-06 9.2277965772E-06 8.8264816900E-06 8.4426009290E-06 + 8.0753979443E-06 7.7241491417E-06 7.3881622679E-06 7.0667750557E-06 + 6.7593539281E-06 6.4652927577E-06 6.1840116806E-06 5.9149559600E-06 + 5.6575949004E-06 5.4114208073E-06 5.1759479924E-06 4.9507118216E-06 + 4.7352678045E-06 4.5291907220E-06 4.3320737932E-06 4.1435278768E-06 + 3.9631807077E-06 3.7906761668E-06 3.6256735816E-06 3.4678470574E-06 + 3.3168848379E-06 3.1724886919E-06 3.0343733288E-06 2.9022658370E-06 + 2.7759051481E-06 2.6550415237E-06 2.5394360649E-06 2.4288602417E-06 + 2.3230954445E-06 2.2219325540E-06 2.1251715292E-06 2.0326210149E-06 + 1.9440979641E-06 1.8594272787E-06 1.7784414643E-06 1.7009803005E-06 + 1.6268905258E-06 1.5560255354E-06 1.4882450925E-06 1.4234150526E-06 + 1.3614070984E-06 1.3020984876E-06 1.2453718108E-06 1.1911147600E-06 + 1.1392199076E-06 1.0895844941E-06 1.0421102257E-06 9.9670308075E-07 + 9.5327312389E-07 9.1173432891E-07 8.7200440896E-07 8.3400465420E-07 + 7.9765977653E-07 7.6289776097E-07 7.2964972355E-07 6.9784977531E-07 + 6.6743489226E-07 6.3834479090E-07 6.1052180924E-07 5.8391079287E-07 + 5.5845898605E-07 5.3411592753E-07 5.1083335079E-07 4.8856508876E-07 + 4.6726698252E-07 4.4689679412E-07 4.2741412301E-07 4.0878032628E-07 + 3.9095844218E-07 3.7391311711E-07 3.5761053570E-07 3.4201835395E-07 + 3.2710563525E-07 3.1284278923E-07 2.9920151319E-07 2.8615473616E-07 + 2.7367656527E-07 2.6174223464E-07 2.5032805625E-07 2.3941137316E-07 + 2.2897051461E-07 2.1898475316E-07 2.0943426365E-07 2.0030008398E-07 + 1.9156407753E-07 1.8320889728E-07 1.7521795145E-07 1.6757537066E-07 + 1.6026597649E-07 1.5327525141E-07 1.4658931003E-07 1.4019487163E-07 + 1.3407923380E-07 1.2823024729E-07 1.2263629197E-07 1.1728625375E-07 + 1.1216950260E-07 1.0727587148E-07 1.0259563616E-07 9.8119495977E-08 + 9.3838555381E-08 8.9744306317E-08 8.5828611341E-08 8.2083687496E-08 + 7.8502090883E-08 7.5076701885E-08 7.1800711075E-08 6.8667605683E-08 + 6.5671156700E-08 6.2805406516E-08 6.0064657095E-08 5.7443458691E-08 + 5.4936599016E-08 5.2539092912E-08 5.0246172459E-08 4.8053277505E-08 + 4.5956046629E-08 4.3950308483E-08 4.2032073504E-08 4.0197526014E-08 + 3.8443016627E-08 3.6765055020E-08 3.5160303000E-08 3.3625567871E-08 + 3.2157796107E-08 3.0754067281E-08 2.9411588266E-08 2.8127687698E-08 + 2.6899810661E-08 2.5725513618E-08 2.4602459561E-08 2.3528413361E-08 + 2.2501237341E-08 2.1518887018E-08 2.0579407048E-08 1.9680927342E-08 + 1.8821659349E-08 1.7999892502E-08 1.7213990824E-08 1.6462389669E-08 + 1.5743592623E-08 1.5056168525E-08 1.4398748618E-08 1.3770023843E-08 + 1.3168742223E-08 1.2593706380E-08 1.2043771162E-08 1.1517841352E-08 + 1.1014869504E-08 1.0533853855E-08 1.0073836335E-08 9.6339006598E-09 + 9.2131705139E-09 8.8108078023E-09 8.4260109896E-09 8.0580135031E-09 + 7.7060822071E-09 7.3695159497E-09 7.0476441641E-09 6.7398255351E-09 + 6.4454467273E-09 6.1639211612E-09 5.8946878472E-09 5.6372102723E-09 + 5.3909753292E-09 5.1554922974E-09 4.9302918679E-09 4.7149252068E-09 + 4.5089630643E-09 4.3119949208E-09 4.1236281680E-09 3.9434873297E-09 + 3.7712133142E-09 3.6064626983E-09 3.4489070456E-09 3.2982322523E-09 + 3.1541379208E-09 3.0163367638E-09 2.8845540313E-09 2.7585269630E-09 + 2.6380042671E-09 2.5227456187E-09 2.4125211813E-09 2.3071111499E-09 + 2.2063053133E-09 2.1099026346E-09 2.0177108522E-09 1.9295460966E-09 + 1.8452325230E-09 1.7646019632E-09 1.6874935894E-09 1.6137535936E-09 + 1.5432348826E-09 1.4757967840E-09 1.4113047661E-09 1.3496301701E-09 + 1.2906499544E-09 1.2342464482E-09 1.1803071182E-09 1.1287243442E-09 + 1.0793952042E-09 1.0322212697E-09 9.8710840995E-10 9.4396660373E-10 + 9.0270976013E-10 8.6325554766E-10 8.2552522932E-10 7.8944350589E-10 + 7.5493836655E-10 7.2194094461E-10 6.9038538018E-10 6.6020868986E-10 + 6.3135064028E-10 6.0375362814E-10 5.7736256599E-10 5.5212477192E-10 + 5.2798986446E-10 5.0490966255E-10 4.8283808935E-10 4.6173108010E-10 + 4.4154649454E-10 4.2224403304E-10 4.0378515586E-10 3.8613300640E-10 + 3.6925233812E-10 3.5310944376E-10 3.3767208815E-10 3.2290944440E-10 + 3.0879203198E-10 2.9529165794E-10 2.8238136094E-10 2.7003535737E-10 + 2.5822898975E-10 2.4693867774E-10 2.3614187118E-10 2.2581700487E-10 + 2.1594345559E-10 2.0650150126E-10 1.9747228127E-10 1.8883775886E-10 + 1.8058068538E-10 1.7268456574E-10 1.6513362539E-10 1.5791277897E-10 + 1.5100760030E-10 1.4440429342E-10 1.3808966502E-10 1.3205109843E-10 + 1.2627652812E-10 1.2075441571E-10 1.1547372702E-10 1.1042391002E-10 + 1.0559487371E-10 1.0097696797E-10 9.6560964495E-11 9.2338038130E-11 + 8.8299749318E-11 8.4438027379E-11 8.0745154297E-11 7.7213749283E-11 + 7.3836754087E-11 7.0607418975E-11 6.7519289139E-11 6.4566191810E-11 + 6.1742224066E-11 5.9041740936E-11 5.6459344122E-11 5.3989871259E-11 + 5.1628385648E-11 4.9370166319E-11 4.7210698597E-11 4.5145665194E-11 + 4.3170937499E-11 4.1282567330E-11 3.9476779070E-11 3.7749962175E-11 + 3.6098663888E-11 3.4519582343E-11 3.3009560046E-11 3.1565577512E-11 + 3.0184747230E-11 2.8864307890E-11 2.7601618936E-11 2.6394155215E-11 + 2.5239501939E-11 2.4135349903E-11 2.3079490858E-11 2.2069813078E-11 + 2.1104297128E-11 2.0181011904E-11 1.9298110705E-11 1.8453827552E-11 + 1.7646473674E-11 1.6874434152E-11 1.6136164658E-11 1.5430188367E-11 + 1.4755093042E-11 1.4109528191E-11 1.3492202360E-11 1.2901880546E-11 + 1.2337381774E-11 1.1797576690E-11 1.1281385317E-11 1.0787774894E-11 + 1.0315757836E-11 9.8643897311E-12 9.4327674534E-12 9.0200273758E-12 + 8.6253436416E-12 8.2479264996E-12 7.8870207238E-12 7.5419041280E-12 + 7.2118861041E-12 6.8963062400E-12 6.5945329940E-12 6.3059624615E-12 + 6.0300171384E-12 5.7661447727E-12 5.5138172604E-12 5.2725296052E-12 + 5.0417988892E-12 4.8211633104E-12 4.6101812643E-12 4.4084304671E-12 + 4.2155070986E-12 4.0310249956E-12 3.8546148884E-12 3.6859236610E-12 + 3.5246136383E-12 3.3703619095E-12 3.2228596936E-12 3.0818117156E-12 + 2.9469356131E-12 2.8179613696E-12 2.6946307862E-12 2.5766969565E-12 + 2.4639237719E-12 2.3560854480E-12 2.2529660834E-12 2.1543592187E-12 + 2.0600674243E-12 1.9699019030E-12 1.8836821235E-12 1.8012354488E-12 + 1.7223967930E-12 1.6470082887E-12 1.5749189809E-12 1.5059845155E-12 + 1.4400668526E-12 1.3770339885E-12 1.3167596999E-12 1.2591232830E-12 + 1.2040093140E-12 1.1513074162E-12 1.1009120470E-12 1.0527222788E-12 + 1.0066415992E-12 9.6257771630E-13 9.2044237995E-13 8.8015119951E-13 + 8.4162347613E-13 8.0478203999E-13 7.6955310083E-13 7.3586609585E-13 + 7.0365354918E-13 6.7285093565E-13 6.4339655629E-13 6.1523141107E-13 + 5.8829908090E-13 5.6284309162E-13 5.3850624053E-13 5.1495384928E-13 + 4.9208870122E-13 4.6816699178E-13 4.4465184724E-13 4.2440409627E-13 + 4.0824627313E-13 3.9998105141E-13 3.9744022240E-13 3.8753260152E-13 + 3.6334699527E-13 3.1589238829E-13 2.3705417556E-13 1.4973957531E-13 + 6.6114788963E-14 -1.3534210984E-15 -2.7825785635E-14 -3.2559578518E-14 + -2.1818282957E-14 -3.6836299210E-15 4.8013788242E-15 7.3500665462E-15 + 6.0781054467E-15 2.1461640903E-15 -3.9454642812E-16 -8.2672337110E-16 + -8.1432137656E-16 -4.2086030002E-16 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 8.8429663592E-09 -3.2511253418E-02 -6.4729406883E-02 -9.6365230318E-02 + -1.2713715467E-01 -1.5677490807E-01 -1.8502292561E-01 -2.1164346863E-01 + -2.3641939786E-01 -2.5915655536E-01 -2.7968572099E-01 -2.9786412074E-01 + -3.1357647562E-01 -3.2673559060E-01 -3.3728249303E-01 -3.4518613877E-01 + -3.5044271161E-01 -3.5307454751E-01 -3.5312871979E-01 -3.5067532447E-01 + -3.4580550727E-01 -3.3862927466E-01 -3.2927313194E-01 -3.1787759118E-01 + -3.0459459148E-01 -2.8958487345E-01 -2.7301534911E-01 -2.5505650772E-01 + -2.3587989709E-01 -2.1565571877E-01 -1.9455057390E-01 -1.7272539458E-01 + -1.5033359235E-01 -1.2751945212E-01 -1.0441679477E-01 -8.1147926404E-02 + -5.7822885284E-02 -3.4538990669E-02 -1.1380689544E-02 1.1580310539E-02 + 3.4284642299E-02 5.6684640427E-02 7.8743497863E-02 1.0043425566E-01 + 1.2173866924E-01 1.4264599579E-01 1.6315174782E-01 1.8325645598E-01 + 2.0296448084E-01 2.2228290813E-01 2.4122055556E-01 2.5978711210E-01 + 2.7799242258E-01 2.9584592320E-01 3.1335622550E-01 3.3053084036E-01 + 3.4737602795E-01 3.6389675540E-01 3.8009674164E-01 3.9597856785E-01 + 4.1154383214E-01 4.2679332891E-01 4.4172723592E-01 4.5634529535E-01 + 4.7064697893E-01 4.8463163066E-01 4.9829858430E-01 5.1164725528E-01 + 5.2467721225E-01 5.3738823029E-01 5.4978031250E-01 5.6185369956E-01 + 5.7360888512E-01 5.8504664373E-01 5.9616804963E-01 6.0697448234E-01 + 6.1746762124E-01 6.2764943224E-01 6.3752214902E-01 6.4708825152E-01 + 6.5635044334E-01 6.6531162940E-01 6.7397489462E-01 6.8234348415E-01 + 6.9042078523E-01 6.9821031074E-01 7.0571568444E-01 7.1294062766E-01 + 7.1988894734E-01 7.2656452526E-01 7.3297130832E-01 7.3911329971E-01 + 7.4499455084E-01 7.5061915398E-01 7.5599123543E-01 7.6111494929E-01 + 7.6599447158E-01 7.7063399483E-01 7.7503772296E-01 7.7920986650E-01 + 7.8315463816E-01 7.8687624856E-01 7.9037890229E-01 7.9366679413E-01 + 7.9674410561E-01 7.9961500161E-01 8.0228362731E-01 8.0475410521E-01 + 8.0703053248E-01 8.0911697830E-01 8.1101748154E-01 8.1273604848E-01 + 8.1427665078E-01 8.1564322355E-01 8.1683966358E-01 8.1786982770E-01 + 8.1873753132E-01 8.1944654703E-01 8.2000060339E-01 8.2040338380E-01 + 8.2065852550E-01 8.2076961868E-01 8.2074020569E-01 8.2057378033E-01 + 8.2027378727E-01 8.1984362153E-01 8.1928662807E-01 8.1860610140E-01 + 8.1780528537E-01 8.1688737292E-01 8.1585550596E-01 8.1471277529E-01 + 8.1346222059E-01 8.1210683048E-01 8.1064954258E-01 8.0909324365E-01 + 8.0744076980E-01 8.0569490669E-01 8.0385838981E-01 8.0193390477E-01 + 7.9992408762E-01 7.9783152524E-01 7.9565875573E-01 7.9340826879E-01 + 7.9108250620E-01 7.8868386226E-01 7.8621468429E-01 7.8367727311E-01 + 7.8107388355E-01 7.7840672502E-01 7.7567796201E-01 7.7288971466E-01 + 7.7004405932E-01 7.6714302915E-01 7.6418861465E-01 7.6118276428E-01 + 7.5812738506E-01 7.5502434315E-01 7.5187546444E-01 7.4868253517E-01 + 7.4544730253E-01 7.4217147527E-01 7.3885672428E-01 7.3550468324E-01 + 7.3211694917E-01 7.2869508307E-01 7.2524061050E-01 7.2175502219E-01 + 7.1823977462E-01 7.1469629063E-01 7.1112595997E-01 7.0753013992E-01 + 7.0391015584E-01 7.0026730176E-01 6.9660284094E-01 6.9291800640E-01 + 6.8921400153E-01 6.8549200062E-01 6.8175314936E-01 6.7799856544E-01 + 6.7422933903E-01 6.7044653335E-01 6.6665118513E-01 6.6284430517E-01 + 6.5902687882E-01 6.5519986647E-01 6.5136420406E-01 6.4752080354E-01 + 6.4367055336E-01 6.3981431893E-01 6.3595294309E-01 6.3208724653E-01 + 6.2821802829E-01 6.2434606616E-01 6.2047211712E-01 6.1659691777E-01 + 6.1272118475E-01 6.0884561514E-01 6.0497088686E-01 6.0109765911E-01 + 5.9722657268E-01 5.9335825043E-01 5.8949329757E-01 5.8563230212E-01 + 5.8177583520E-01 5.7792445142E-01 5.7407868926E-01 5.7023907133E-01 + 5.6640610480E-01 5.6258028168E-01 5.5876207915E-01 5.5495195988E-01 + 5.5115037236E-01 5.4735775120E-01 5.4357451741E-01 5.3980107874E-01 + 5.3603782992E-01 5.3228515298E-01 5.2854341751E-01 5.2481298096E-01 + 5.2109418887E-01 5.1738737517E-01 5.1369286241E-01 5.1001096204E-01 + 5.0634197464E-01 5.0268619017E-01 4.9904388819E-01 4.9541533814E-01 + 4.9180079953E-01 4.8820052217E-01 4.8461474640E-01 4.8104370331E-01 + 4.7748761494E-01 4.7394669451E-01 4.7042114658E-01 4.6691116730E-01 + 4.6341694457E-01 4.5993865826E-01 4.5647648037E-01 4.5303057525E-01 + 4.4960109973E-01 4.4618820334E-01 4.4279202848E-01 4.3941271056E-01 + 4.3605037822E-01 4.3270515343E-01 4.2937715170E-01 4.2606648220E-01 + 4.2277324795E-01 4.1949754596E-01 4.1623946734E-01 4.1299909751E-01 + 4.0977651630E-01 4.0657179808E-01 4.0338501194E-01 4.0021622179E-01 + 3.9706548648E-01 3.9393285997E-01 3.9081839143E-01 3.8772212535E-01 + 3.8464410171E-01 3.8158435604E-01 3.7854291956E-01 3.7551981931E-01 + 3.7251507823E-01 3.6952871531E-01 3.6656074565E-01 3.6361118060E-01 + 3.6068002784E-01 3.5776729149E-01 3.5487297222E-01 3.5199706733E-01 + 3.4913957084E-01 3.4630047360E-01 3.4347976336E-01 3.4067742490E-01 + 3.3789344005E-01 3.3512778783E-01 3.3238044452E-01 3.2965138372E-01 + 3.2694057647E-01 3.2424799128E-01 3.2157359425E-01 3.1891734910E-01 + 3.1627921730E-01 3.1365915809E-01 3.1105712857E-01 3.0847308377E-01 + 3.0590697671E-01 3.0335875850E-01 3.0082837833E-01 2.9831578361E-01 + 2.9582091999E-01 2.9334373143E-01 2.9088416025E-01 2.8844214719E-01 + 2.8601763150E-01 2.8361055094E-01 2.8122084185E-01 2.7884843925E-01 + 2.7649327681E-01 2.7415528698E-01 2.7183440096E-01 2.6953054883E-01 + 2.6724365953E-01 2.6497366094E-01 2.6272047991E-01 2.6048404231E-01 + 2.5826427308E-01 2.5606109625E-01 2.5387443500E-01 2.5170421169E-01 + 2.4955034791E-01 2.4741276447E-01 2.4529138153E-01 2.4318611854E-01 + 2.4109689432E-01 2.3902362711E-01 2.3696623456E-01 2.3492463378E-01 + 2.3289874141E-01 2.3088847357E-01 2.2889374596E-01 2.2691447386E-01 + 2.2495057218E-01 2.2300195544E-01 2.2106853784E-01 2.1915023328E-01 + 2.1724695538E-01 2.1535861748E-01 2.1348513271E-01 2.1162641400E-01 + 2.0978237405E-01 2.0795292545E-01 2.0613798060E-01 2.0433745181E-01 + 2.0255125128E-01 2.0077929111E-01 1.9902148336E-01 1.9727774005E-01 + 1.9554797314E-01 1.9383209462E-01 1.9213001647E-01 1.9044165068E-01 + 1.8876690932E-01 1.8710570449E-01 1.8545794835E-01 1.8382355318E-01 + 1.8220243133E-01 1.8059449529E-01 1.7899965765E-01 1.7741783117E-01 + 1.7584892873E-01 1.7429286341E-01 1.7274954844E-01 1.7121889725E-01 + 1.6970082347E-01 1.6819524092E-01 1.6670206366E-01 1.6522120598E-01 + 1.6375258239E-01 1.6229610767E-01 1.6085169684E-01 1.5941926519E-01 + 1.5799872829E-01 1.5659000198E-01 1.5519300240E-01 1.5380764598E-01 + 1.5243384945E-01 1.5107152985E-01 1.4972060454E-01 1.4838099121E-01 + 1.4705260786E-01 1.4573537284E-01 1.4442920484E-01 1.4313402288E-01 + 1.4184974635E-01 1.4057629497E-01 1.3931358884E-01 1.3806154842E-01 + 1.3682009454E-01 1.3558914838E-01 1.3436863152E-01 1.3315846591E-01 + 1.3195857389E-01 1.3076887817E-01 1.2958930187E-01 1.2841976848E-01 + 1.2726020190E-01 1.2611052641E-01 1.2497066672E-01 1.2384054790E-01 + 1.2272009545E-01 1.2160923528E-01 1.2050789369E-01 1.1941599740E-01 + 1.1833347354E-01 1.1726024964E-01 1.1619625365E-01 1.1514141395E-01 + 1.1409565930E-01 1.1305891892E-01 1.1203112241E-01 1.1101219980E-01 + 1.1000208155E-01 1.0900069853E-01 1.0800798202E-01 1.0702386373E-01 + 1.0604827578E-01 1.0508115073E-01 1.0412242155E-01 1.0317202161E-01 + 1.0222988472E-01 1.0129594511E-01 1.0037013743E-01 9.9452396743E-02 + 9.8542658523E-02 9.7640858675E-02 9.6746933515E-02 9.5860819779E-02 + 9.4982454616E-02 9.4111775592E-02 9.3248720687E-02 9.2393228295E-02 + 9.1545237222E-02 9.0704686686E-02 8.9871516317E-02 8.9045666152E-02 + 8.8227076639E-02 8.7415688633E-02 8.6611443394E-02 8.5814282588E-02 + 8.5024148285E-02 8.4240982957E-02 8.3464729475E-02 8.2695331114E-02 + 8.1932731544E-02 8.1176874832E-02 8.0427705441E-02 7.9685168228E-02 + 7.8949208442E-02 7.8219771722E-02 7.7496804097E-02 7.6780251983E-02 + 7.6070062182E-02 7.5366181879E-02 7.4668558643E-02 7.3977140423E-02 + 7.3291875547E-02 7.2612712721E-02 7.1939601025E-02 7.1272489914E-02 + 7.0611329213E-02 6.9956069120E-02 6.9306660199E-02 6.8663053381E-02 + 6.8025199961E-02 6.7393051598E-02 6.6766560312E-02 6.6145678479E-02 + 6.5530358835E-02 6.4920554470E-02 6.4316218827E-02 6.3717305701E-02 + 6.3123769236E-02 6.2535563922E-02 6.1952644597E-02 6.1374966440E-02 + 6.0802484975E-02 6.0235156061E-02 5.9672935898E-02 5.9115781021E-02 + 5.8563648298E-02 5.8016494929E-02 5.7474278445E-02 5.6936956703E-02 + 5.6404487887E-02 5.5876830504E-02 5.5353943383E-02 5.4835785675E-02 + 5.4322316846E-02 5.3813496680E-02 5.3309285274E-02 5.2809643038E-02 + 5.2314530690E-02 5.1823909259E-02 5.1337740078E-02 5.0855984786E-02 + 5.0378605322E-02 4.9905563928E-02 4.9436823142E-02 4.8972345800E-02 + 4.8512095032E-02 4.8056034261E-02 4.7604127199E-02 4.7156337849E-02 + 4.6712630499E-02 4.6272969723E-02 4.5837320378E-02 4.5405647601E-02 + 4.4977916810E-02 4.4554093698E-02 4.4134144236E-02 4.3718034666E-02 + 4.3305731504E-02 4.2897201534E-02 4.2492411810E-02 4.2091329650E-02 + 4.1693922637E-02 4.1300158618E-02 4.0910005698E-02 4.0523432242E-02 + 4.0140406873E-02 3.9760898468E-02 3.9384876158E-02 3.9012309325E-02 + 3.8643167601E-02 3.8277420867E-02 3.7915039249E-02 3.7555993119E-02 + 3.7200253090E-02 3.6847790018E-02 3.6498574996E-02 3.6152579357E-02 + 3.5809774669E-02 3.5470132733E-02 3.5133625585E-02 3.4800225489E-02 + 3.4469904941E-02 3.4142636662E-02 3.3818393600E-02 3.3497148927E-02 + 3.3178876038E-02 3.2863548548E-02 3.2551140291E-02 3.2241625319E-02 + 3.1934977902E-02 3.1631172521E-02 3.1330183872E-02 3.1031986862E-02 + 3.0736556607E-02 3.0443868431E-02 3.0153897866E-02 2.9866620648E-02 + 2.9582012716E-02 2.9300050212E-02 2.9020709478E-02 2.8743967053E-02 + 2.8469799678E-02 2.8198184285E-02 2.7929098003E-02 2.7662518154E-02 + 2.7398422251E-02 2.7136787996E-02 2.6877593281E-02 2.6620816186E-02 + 2.6366434974E-02 2.6114428094E-02 2.5864774178E-02 2.5617452038E-02 + 2.5372440668E-02 2.5129719240E-02 2.4889267103E-02 2.4651063782E-02 + 2.4415088976E-02 2.4181322558E-02 2.3949744574E-02 2.3720335238E-02 + 2.3493074935E-02 2.3267944217E-02 2.3044923803E-02 2.2823994578E-02 + 2.2605137590E-02 2.2388334049E-02 2.2173565328E-02 2.1960812960E-02 + 2.1750058637E-02 2.1541284206E-02 2.1334471675E-02 2.1129603203E-02 + 2.0926661106E-02 2.0725627850E-02 2.0526486055E-02 2.0329218490E-02 + 2.0133808073E-02 1.9940237871E-02 1.9748491097E-02 1.9558551110E-02 + 1.9370401412E-02 1.9184025651E-02 1.8999407614E-02 1.8816531232E-02 + 1.8635380574E-02 1.8455939848E-02 1.8278193399E-02 1.8102125712E-02 + 1.7927721402E-02 1.7754965222E-02 1.7583842059E-02 1.7414336928E-02 + 1.7246434979E-02 1.7080121491E-02 1.6915381872E-02 1.6752201656E-02 + 1.6590566508E-02 1.6430462214E-02 1.6271874688E-02 1.6114789969E-02 + 1.5959194214E-02 1.5805073707E-02 1.5652414851E-02 1.5501204166E-02 + 1.5351428295E-02 1.5203073997E-02 1.5056128149E-02 1.4910577741E-02 + 1.4766409882E-02 1.4623611791E-02 1.4482170805E-02 1.4342074369E-02 + 1.4203310040E-02 1.4065865487E-02 1.3929728488E-02 1.3794886928E-02 + 1.3661328800E-02 1.3529042206E-02 1.3398015351E-02 1.3268236547E-02 + 1.3139694209E-02 1.3012376854E-02 1.2886273105E-02 1.2761371683E-02 + 1.2637661412E-02 1.2515131214E-02 1.2393770110E-02 1.2273567222E-02 + 1.2154511766E-02 1.2036593056E-02 1.1919800501E-02 1.1804123607E-02 + 1.1689551971E-02 1.1576075286E-02 1.1463683335E-02 1.1352365995E-02 + 1.1242113234E-02 1.1132915107E-02 1.1024761763E-02 1.0917643436E-02 + 1.0811550450E-02 1.0706473215E-02 1.0602402229E-02 1.0499328074E-02 + 1.0397241418E-02 1.0296133013E-02 1.0195993694E-02 1.0096814380E-02 + 9.9985860711E-03 9.9012998493E-03 9.8049468774E-03 9.7095183980E-03 + 9.6150057331E-03 9.5214002836E-03 9.4286935280E-03 9.3368770226E-03 + 9.2459424001E-03 9.1558813692E-03 9.0666857140E-03 8.9783472934E-03 + 8.8908580404E-03 8.8042099612E-03 8.7183951349E-03 8.6334057130E-03 + 8.5492339182E-03 8.4658720443E-03 8.3833124555E-03 8.3015475855E-03 + 8.2205699372E-03 8.1403720821E-03 8.0609466594E-03 7.9822863759E-03 + 7.9043840049E-03 7.8272323859E-03 7.7508244240E-03 7.6751530894E-03 + 7.6002114166E-03 7.5259925040E-03 7.4524895135E-03 7.3796956695E-03 + 7.3076042588E-03 7.2362086299E-03 7.1655021923E-03 7.0954784162E-03 + 7.0261308317E-03 6.9574530288E-03 6.8894386563E-03 6.8220814213E-03 + 6.7553750892E-03 6.6893134829E-03 6.6238904820E-03 6.5591000229E-03 + 6.4949360975E-03 6.4313927538E-03 6.3684640943E-03 6.3061442762E-03 + 6.2444275107E-03 6.1833080626E-03 6.1227802496E-03 6.0628384423E-03 + 6.0034770631E-03 5.9446905862E-03 5.8864735373E-03 5.8288204924E-03 + 5.7717260781E-03 5.7151849707E-03 5.6591918962E-03 5.6037416292E-03 + 5.5488289931E-03 5.4944488594E-03 5.4405961471E-03 5.3872658228E-03 + 5.3344528995E-03 5.2821524370E-03 5.2303595409E-03 5.1790693624E-03 + 5.1282770979E-03 5.0779779887E-03 5.0281673204E-03 4.9788404225E-03 + 4.9299926681E-03 4.8816194737E-03 4.8337162982E-03 4.7862786434E-03 + 4.7393020529E-03 4.6927821119E-03 4.6467144470E-03 4.6010947256E-03 + 4.5559186559E-03 4.5111819860E-03 4.4668805040E-03 4.4230100373E-03 + 4.3795664526E-03 4.3365456552E-03 4.2939435889E-03 4.2517562355E-03 + 4.2099796145E-03 4.1686097828E-03 4.1276428343E-03 4.0870748996E-03 + 4.0469021457E-03 4.0071207755E-03 3.9677270279E-03 3.9287171769E-03 + 3.8900875316E-03 3.8518344359E-03 3.8139542681E-03 3.7764434406E-03 + 3.7392983997E-03 3.7025156251E-03 3.6660916296E-03 3.6300229591E-03 + 3.5943061919E-03 3.5589379387E-03 3.5239148420E-03 3.4892335763E-03 + 3.4548908472E-03 3.4208833918E-03 3.3872079776E-03 3.3538614030E-03 + 3.3208404964E-03 3.2881421164E-03 3.2557631514E-03 3.2237005189E-03 + 3.1919511659E-03 3.1605120682E-03 3.1293802302E-03 3.0985526848E-03 + 3.0680264930E-03 3.0377987434E-03 3.0078665526E-03 2.9782270644E-03 + 2.9488774496E-03 2.9198149059E-03 2.8910366578E-03 2.8625399558E-03 + 2.8343220768E-03 2.8063803234E-03 2.7787120241E-03 2.7513145324E-03 + 2.7241852273E-03 2.6973215126E-03 2.6707208168E-03 2.6443805929E-03 + 2.6182983181E-03 2.5924714937E-03 2.5668976446E-03 2.5415743196E-03 + 2.5164990906E-03 2.4916695528E-03 2.4670833241E-03 2.4427380454E-03 + 2.4186313799E-03 2.3947610131E-03 2.3711246529E-03 2.3477200286E-03 + 2.3245448914E-03 2.3015970142E-03 2.2788741908E-03 2.2563742363E-03 + 2.2340949865E-03 2.2120342982E-03 2.1901900484E-03 2.1685601346E-03 + 2.1471424742E-03 2.1259350047E-03 2.1049356833E-03 2.0841424867E-03 + 2.0635534111E-03 2.0431664717E-03 2.0229797030E-03 2.0029911580E-03 + 1.9831989085E-03 1.9636010449E-03 1.9441956758E-03 1.9249809278E-03 + 1.9059549458E-03 1.8871158922E-03 1.8684619472E-03 1.8499913084E-03 + 1.8317021907E-03 1.8135928262E-03 1.7956614639E-03 1.7779063697E-03 + 1.7603258261E-03 1.7429181321E-03 1.7256816032E-03 1.7086145708E-03 + 1.6917153827E-03 1.6749824023E-03 1.6584140089E-03 1.6420085974E-03 + 1.6257645781E-03 1.6096803765E-03 1.5937544335E-03 1.5779852048E-03 + 1.5623711611E-03 1.5469107878E-03 1.5316025848E-03 1.5164450667E-03 + 1.5014367621E-03 1.4865762140E-03 1.4718619795E-03 1.4572926294E-03 + 1.4428667485E-03 1.4285829351E-03 1.4144398010E-03 1.4004359717E-03 + 1.3865700856E-03 1.3728407944E-03 1.3592467629E-03 1.3457866687E-03 + 1.3324592022E-03 1.3192630664E-03 1.3061969770E-03 1.2932596619E-03 + 1.2804498615E-03 1.2677663282E-03 1.2552078266E-03 1.2427731332E-03 + 1.2304610362E-03 1.2182703359E-03 1.2061998438E-03 1.1942483832E-03 + 1.1824147886E-03 1.1706979059E-03 1.1590965920E-03 1.1476097152E-03 + 1.1362361545E-03 1.1249747998E-03 1.1138245518E-03 1.1027843219E-03 + 1.0918530320E-03 1.0810296144E-03 1.0703130118E-03 1.0597021772E-03 + 1.0491960737E-03 1.0387936746E-03 1.0284939629E-03 1.0182959316E-03 + 1.0081985836E-03 9.9820093137E-04 9.8830199689E-04 9.7850081174E-04 + 9.6879641689E-04 9.5918786262E-04 9.4967420844E-04 9.4025452299E-04 + 9.3092788397E-04 9.2169337804E-04 9.1255010074E-04 9.0349715640E-04 + 8.9453365808E-04 8.8565872744E-04 8.7687149469E-04 8.6817109852E-04 + 8.5955668598E-04 8.5102741242E-04 8.4258244143E-04 8.3422094473E-04 + 8.2594210210E-04 8.1774510131E-04 8.0962913804E-04 8.0159341580E-04 + 7.9363714587E-04 7.8575954721E-04 7.7795984637E-04 7.7023727746E-04 + 7.6259108206E-04 7.5502050911E-04 7.4752481491E-04 7.4010326298E-04 + 7.3275512405E-04 7.2547967594E-04 7.1827620351E-04 7.1114399863E-04 + 7.0408236004E-04 6.9709059335E-04 6.9016801092E-04 6.8331393186E-04 + 6.7652768189E-04 6.6980859332E-04 6.6315600500E-04 6.5656926221E-04 + 6.5004771664E-04 6.4359072632E-04 6.3719765552E-04 6.3086787475E-04 + 6.2460076065E-04 6.1839569598E-04 6.1225206951E-04 6.0616927598E-04 + 6.0014671607E-04 5.9418379629E-04 5.8827992897E-04 5.8243453220E-04 + 5.7664702974E-04 5.7091685098E-04 5.6524343092E-04 5.5962621007E-04 + 5.5406463442E-04 5.4855815537E-04 5.4310622970E-04 5.3770831950E-04 + 5.3236389214E-04 5.2707242018E-04 5.2183338138E-04 5.1664625858E-04 + 5.1151053969E-04 5.0642571765E-04 5.0139129037E-04 4.9640676065E-04 + 4.9147163619E-04 4.8658542950E-04 4.8174765787E-04 4.7695784332E-04 + 4.7221551257E-04 4.6752019695E-04 4.6287143240E-04 4.5826875942E-04 + 4.5371172301E-04 4.4919987261E-04 4.4473276210E-04 4.4030994975E-04 + 4.3593099813E-04 4.3159547412E-04 4.2730294885E-04 4.2305299765E-04 + 4.1884520003E-04 4.1467913961E-04 4.1055440411E-04 4.0647058529E-04 + 4.0242727893E-04 3.9842408477E-04 3.9446060646E-04 3.9053645158E-04 + 3.8665123154E-04 3.8280456158E-04 3.7899606070E-04 3.7522535165E-04 + 3.7149206091E-04 3.6779581860E-04 3.6413625848E-04 3.6051301793E-04 + 3.5692573786E-04 3.5337406273E-04 3.4985764051E-04 3.4637612260E-04 + 3.4292916383E-04 3.3951642246E-04 3.3613756006E-04 3.3279224157E-04 + 3.2948013520E-04 3.2620091243E-04 3.2295424797E-04 3.1973981975E-04 + 3.1655730883E-04 3.1340639945E-04 3.1028677892E-04 3.0719813765E-04 + 3.0414016909E-04 3.0111256971E-04 2.9811503897E-04 2.9514727927E-04 + 2.9220899596E-04 2.8929989729E-04 2.8641969438E-04 2.8356810118E-04 + 2.8074483447E-04 2.7794961382E-04 2.7518216157E-04 2.7244220277E-04 + 2.6972946521E-04 2.6704367934E-04 2.6438457826E-04 2.6175189772E-04 + 2.5914537606E-04 2.5656475422E-04 2.5400977565E-04 2.5148018638E-04 + 2.4897573490E-04 2.4649617221E-04 2.4404125175E-04 2.4161072939E-04 + 2.3920436341E-04 2.3682191448E-04 2.3446314562E-04 2.3212782218E-04 + 2.2981571186E-04 2.2752658460E-04 2.2526021266E-04 2.2301637050E-04 + 2.2079483485E-04 2.1859538460E-04 2.1641780085E-04 2.1426186685E-04 + 2.1212736800E-04 2.1001409179E-04 2.0792182785E-04 2.0585036784E-04 + 2.0379950551E-04 2.0176903663E-04 1.9975875900E-04 1.9776847239E-04 + 1.9579797858E-04 1.9384708129E-04 1.9191558616E-04 1.9000330080E-04 + 1.8811003466E-04 1.8623559912E-04 1.8437980739E-04 1.8254247455E-04 + 1.8072341748E-04 1.7892245491E-04 1.7713940731E-04 1.7537409696E-04 + 1.7362634789E-04 1.7189598586E-04 1.7018283835E-04 1.6848673455E-04 + 1.6680750535E-04 1.6514498330E-04 1.6349900259E-04 1.6186939908E-04 + 1.6025601023E-04 1.5865867512E-04 1.5707723441E-04 1.5551153034E-04 + 1.5396140671E-04 1.5242670887E-04 1.5090728368E-04 1.4940297955E-04 + 1.4791364636E-04 1.4643913547E-04 1.4497929974E-04 1.4353399346E-04 + 1.4210307237E-04 1.4068639365E-04 1.3928381585E-04 1.3789519898E-04 + 1.3652040439E-04 1.3515929482E-04 1.3381173436E-04 1.3247758846E-04 + 1.3115672388E-04 1.2984900872E-04 1.2855431237E-04 1.2727250552E-04 + 1.2600346013E-04 1.2474704945E-04 1.2350314796E-04 1.2227163140E-04 + 1.2105237673E-04 1.1984526213E-04 1.1865016700E-04 1.1746697190E-04 + 1.1629555862E-04 1.1513581008E-04 1.1398761037E-04 1.1285084475E-04 + 1.1172539959E-04 1.1061116240E-04 1.0950802179E-04 1.0841586749E-04 + 1.0733459032E-04 1.0626408217E-04 1.0520423601E-04 1.0415494586E-04 + 1.0311610681E-04 1.0208761498E-04 1.0106936751E-04 1.0006126256E-04 + 9.9063199324E-05 9.8075077966E-05 9.7096799653E-05 9.6128266528E-05 + 9.5169381707E-05 9.4220049264E-05 9.3280174223E-05 9.2349662554E-05 + 9.1428421153E-05 9.0516357845E-05 8.9613381364E-05 8.8719401353E-05 + 8.7834328347E-05 8.6958073772E-05 8.6090549930E-05 8.5231669992E-05 + 8.4381347993E-05 8.3539498818E-05 8.2706038197E-05 8.1880882696E-05 + 8.1063949709E-05 8.0255157448E-05 7.9454424937E-05 7.8661672005E-05 + 7.7876819273E-05 7.7099788153E-05 7.6330500833E-05 7.5568880277E-05 + 7.4814850211E-05 7.4068335117E-05 7.3329260229E-05 7.2597551522E-05 + 7.1873135703E-05 7.1155940210E-05 7.0445893200E-05 6.9742923541E-05 + 6.9046960810E-05 6.8357935282E-05 6.7675777923E-05 6.7000420386E-05 + 6.6331795000E-05 6.5669834768E-05 6.5014473357E-05 6.4365645094E-05 + 6.3723284956E-05 6.3087328567E-05 6.2457712190E-05 6.1834372719E-05 + 6.1217247678E-05 6.0606275209E-05 6.0001394069E-05 5.9402543623E-05 + 5.8809663837E-05 5.8222695277E-05 5.7641579094E-05 5.7066257028E-05 + 5.6496671396E-05 5.5932765086E-05 5.5374481557E-05 5.4821764828E-05 + 5.4274559472E-05 5.3732810616E-05 5.3196463931E-05 5.2665465626E-05 + 5.2139762447E-05 5.1619301667E-05 5.1104031084E-05 5.0593899016E-05 + 5.0088854291E-05 4.9588846249E-05 4.9093824731E-05 4.8603740078E-05 + 4.8118543123E-05 4.7638185190E-05 4.7162618084E-05 4.6691794091E-05 + 4.6225665970E-05 4.5764186951E-05 4.5307310726E-05 4.4854991451E-05 + 4.4407183736E-05 4.3963842641E-05 4.3524923674E-05 4.3090382785E-05 + 4.2660176364E-05 4.2234261230E-05 4.1812594636E-05 4.1395134257E-05 + 4.0981838189E-05 4.0572664947E-05 4.0167573456E-05 3.9766523051E-05 + 3.9369473470E-05 3.8976384852E-05 3.8587217733E-05 3.8201933041E-05 + 3.7820492091E-05 3.7442856587E-05 3.7068988608E-05 3.6698850616E-05 + 3.6332405441E-05 3.5969616287E-05 3.5610446722E-05 3.5254860677E-05 + 3.4902822440E-05 3.4554296657E-05 3.4209248325E-05 3.3867642786E-05 + 3.3529445732E-05 3.3194623192E-05 3.2863141536E-05 3.2534967466E-05 + 3.2210068017E-05 3.1888410552E-05 3.1569962758E-05 3.1254692643E-05 + 3.0942568534E-05 3.0633559074E-05 3.0327633218E-05 3.0024760228E-05 + 2.9724909673E-05 2.9428051425E-05 2.9134155656E-05 2.8843192835E-05 + 2.8555133723E-05 2.8269949376E-05 + + + 2.3184046349E-09 4.3547367208E-04 1.7388757542E-03 3.9011983153E-03 + 6.9075899094E-03 1.0737594222E-02 1.5365476101E-02 2.0760626826E-02 + 2.6888038158E-02 3.3708832553E-02 4.1180835123E-02 4.9259171628E-02 + 5.7896876293E-02 6.7045493534E-02 7.6655659079E-02 8.6677648213E-02 + 9.7061882030E-02 1.0775938627E-01 1.1872220126E-01 1.2990374510E-01 + 1.4125913558E-01 1.5274547806E-01 1.6432212755E-01 1.7595093243E-01 + 1.8759646492E-01 1.9922624033E-01 2.1081092245E-01 2.2232450831E-01 + 2.3374448112E-01 2.4505191704E-01 2.5623152993E-01 2.6727163846E-01 + 2.7816404253E-01 2.8890380075E-01 2.9948890717E-01 3.0991987326E-01 + 3.2019922960E-01 3.3033096922E-01 3.4031996173E-01 3.5017137126E-01 + 3.5989011336E-01 3.6948038430E-01 3.7894529182E-01 3.8828660881E-01 + 3.9750466176E-01 4.0659835480E-01 4.1556531904E-01 4.2440216641E-01 + 4.3310481895E-01 4.4166887898E-01 4.5009000332E-01 4.5836424651E-01 + 4.6648834287E-01 4.7445990494E-01 4.8227752623E-01 4.8994078666E-01 + 4.9745016989E-01 5.0480691044E-01 5.1201279554E-01 5.1906995774E-01 + 5.2598066968E-01 5.3274714708E-01 5.3937141764E-01 5.4585523788E-01 + 5.5220002500E-01 5.5840682272E-01 5.6447630687E-01 5.7040882652E-01 + 5.7620447223E-01 5.8186315977E-01 5.8738471727E-01 5.9276896563E-01 + 5.9801578494E-01 6.0312516363E-01 6.0809722986E-01 6.1293226741E-01 + 6.1763071927E-01 6.2219318237E-01 6.2662039685E-01 6.3091323245E-01 + 6.3507267377E-01 6.3909980582E-01 6.4299580057E-01 6.4676190483E-01 + 6.5039942956E-01 6.5390974074E-01 6.5729425142E-01 6.6055441512E-01 + 6.6369172006E-01 6.6670768439E-01 6.6960385203E-01 6.7238178912E-01 + 6.7504308091E-01 6.7758932904E-01 6.8002214915E-01 6.8234316864E-01 + 6.8455402472E-01 6.8665636254E-01 6.8865183347E-01 6.9054209351E-01 + 6.9232880174E-01 6.9401361888E-01 6.9559820587E-01 6.9708422259E-01 + 6.9847332653E-01 6.9976717163E-01 7.0096740709E-01 7.0207567625E-01 + 7.0309361554E-01 7.0402285349E-01 7.0486500974E-01 7.0562169416E-01 + 7.0629450599E-01 7.0688503304E-01 7.0739485091E-01 7.0782552235E-01 + 7.0817859654E-01 7.0845560851E-01 7.0865807860E-01 7.0878751191E-01 + 7.0884539786E-01 7.0883320972E-01 7.0875240427E-01 7.0860442141E-01 + 7.0839068389E-01 7.0811259699E-01 7.0777154830E-01 7.0736890750E-01 + 7.0690602622E-01 7.0638423783E-01 7.0580485735E-01 7.0516918137E-01 + 7.0447848796E-01 7.0373403660E-01 7.0293706822E-01 7.0208880510E-01 + 7.0119045099E-01 7.0024319105E-01 6.9924819197E-01 6.9820660197E-01 + 6.9711955093E-01 6.9598815046E-01 6.9481349400E-01 6.9359665695E-01 + 6.9233869679E-01 6.9104065320E-01 6.8970354825E-01 6.8832838650E-01 + 6.8691615520E-01 6.8546782444E-01 6.8398434733E-01 6.8246666017E-01 + 6.8091568265E-01 6.7933231804E-01 6.7771745335E-01 6.7607195957E-01 + 6.7439669185E-01 6.7269248969E-01 6.7096017715E-01 6.6920056308E-01 + 6.6741444130E-01 6.6560259081E-01 6.6376577601E-01 6.6190474690E-01 + 6.6002023930E-01 6.5811297506E-01 6.5618366224E-01 6.5423299536E-01 + 6.5226165559E-01 6.5027031095E-01 6.4825961653E-01 6.4623021468E-01 + 6.4418273523E-01 6.4211779569E-01 6.4003600143E-01 6.3793794591E-01 + 6.3582421085E-01 6.3369536646E-01 6.3155197158E-01 6.2939457391E-01 + 6.2722371022E-01 6.2503990648E-01 6.2284367807E-01 6.2063552997E-01 + 6.1841595696E-01 6.1618544374E-01 6.1394446515E-01 6.1169348634E-01 + 6.0943296293E-01 6.0716334116E-01 6.0488505809E-01 6.0259854176E-01 + 6.0030421132E-01 5.9800247721E-01 5.9569374131E-01 5.9337839712E-01 + 5.9105682985E-01 5.8872941662E-01 5.8639652660E-01 5.8405852112E-01 + 5.8171575384E-01 5.7936857090E-01 5.7701731102E-01 5.7466230565E-01 + 5.7230387911E-01 5.6994234872E-01 5.6757802489E-01 5.6521121130E-01 + 5.6284220498E-01 5.6047129645E-01 5.5809876984E-01 5.5572490298E-01 + 5.5334996755E-01 5.5097422917E-01 5.4859794750E-01 5.4622137638E-01 + 5.4384476390E-01 5.4146835256E-01 5.3909237926E-01 5.3671707552E-01 + 5.3434266752E-01 5.3196937619E-01 5.2959741736E-01 5.2722700177E-01 + 5.2485833523E-01 5.2249161867E-01 5.2012704826E-01 5.1776481545E-01 + 5.1540510711E-01 5.1304810557E-01 5.1069398872E-01 5.0834293008E-01 + 5.0599509890E-01 5.0365066021E-01 5.0130977491E-01 4.9897259987E-01 + 4.9663928793E-01 4.9430998806E-01 4.9198484537E-01 4.8966400121E-01 + 4.8734759321E-01 4.8503575539E-01 4.8272861818E-01 4.8042630851E-01 + 4.7812894989E-01 4.7583666242E-01 4.7354956290E-01 4.7126776489E-01 + 4.6899137874E-01 4.6672051165E-01 4.6445526776E-01 4.6219574820E-01 + 4.5994205109E-01 4.5769427169E-01 4.5545250237E-01 4.5321683271E-01 + 4.5098734954E-01 4.4876413697E-01 4.4654727649E-01 4.4433684697E-01 + 4.4213292474E-01 4.3993558364E-01 4.3774489503E-01 4.3556092788E-01 + 4.3338374881E-01 4.3121342210E-01 4.2905000978E-01 4.2689357164E-01 + 4.2474416531E-01 4.2260184625E-01 4.2046666785E-01 4.1833868143E-01 + 4.1621793631E-01 4.1410447980E-01 4.1199835733E-01 4.0989961238E-01 + 4.0780828661E-01 4.0572441985E-01 4.0364805013E-01 4.0157921376E-01 + 3.9951794534E-01 3.9746427777E-01 3.9541824235E-01 3.9337986873E-01 + 3.9134918504E-01 3.8932621783E-01 3.8731099218E-01 3.8530353167E-01 + 3.8330385847E-01 3.8131199332E-01 3.7932795559E-01 3.7735176331E-01 + 3.7538343318E-01 3.7342298063E-01 3.7147041982E-01 3.6952576368E-01 + 3.6758902396E-01 3.6566021120E-01 3.6373933482E-01 3.6182640312E-01 + 3.5992142330E-01 3.5802440148E-01 3.5613534277E-01 3.5425425123E-01 + 3.5238112994E-01 3.5051598102E-01 3.4865880564E-01 3.4680960403E-01 + 3.4496837556E-01 3.4313511869E-01 3.4130983105E-01 3.3949250940E-01 + 3.3768314975E-01 3.3588174726E-01 3.3408829635E-01 3.3230279070E-01 + 3.3052522324E-01 3.2875558620E-01 3.2699387111E-01 3.2524006885E-01 + 3.2349416962E-01 3.2175616300E-01 3.2002603796E-01 3.1830378284E-01 + 3.1658938543E-01 3.1488283294E-01 3.1318411201E-01 3.1149320879E-01 + 3.0981010886E-01 3.0813479734E-01 3.0646725885E-01 3.0480747751E-01 + 3.0315543702E-01 3.0151112061E-01 2.9987451109E-01 2.9824559085E-01 + 2.9662434188E-01 2.9501074578E-01 2.9340478376E-01 2.9180643668E-01 + 2.9021568504E-01 2.8863250900E-01 2.8705688839E-01 2.8548880272E-01 + 2.8392823120E-01 2.8237515274E-01 2.8082954596E-01 2.7929138922E-01 + 2.7776066059E-01 2.7623733792E-01 2.7472139880E-01 2.7321282056E-01 + 2.7171158035E-01 2.7021765507E-01 2.6873102143E-01 2.6725165593E-01 + 2.6577953489E-01 2.6431463444E-01 2.6285693053E-01 2.6140639895E-01 + 2.5996301536E-01 2.5852675521E-01 2.5709759386E-01 2.5567550650E-01 + 2.5426046822E-01 2.5285245395E-01 2.5145143854E-01 2.5005739671E-01 + 2.4867030308E-01 2.4729013217E-01 2.4591685842E-01 2.4455045618E-01 + 2.4319089971E-01 2.4183816320E-01 2.4049222079E-01 2.3915304653E-01 + 2.3782061441E-01 2.3649489841E-01 2.3517587240E-01 2.3386351024E-01 + 2.3255778576E-01 2.3125867272E-01 2.2996614489E-01 2.2868017597E-01 + 2.2740073968E-01 2.2612780968E-01 2.2486135965E-01 2.2360136324E-01 + 2.2234779409E-01 2.2110062585E-01 2.1985983215E-01 2.1862538665E-01 + 2.1739726298E-01 2.1617543481E-01 2.1495987580E-01 2.1375055963E-01 + 2.1254746002E-01 2.1135055067E-01 2.1015980534E-01 2.0897519778E-01 + 2.0779670180E-01 2.0662429122E-01 2.0545793991E-01 2.0429762175E-01 + 2.0314331067E-01 2.0199498065E-01 2.0085260568E-01 1.9971615984E-01 + 1.9858561721E-01 1.9746095193E-01 1.9634213820E-01 1.9522915027E-01 + 1.9412196242E-01 1.9302054900E-01 1.9192488441E-01 1.9083494311E-01 + 1.8975069961E-01 1.8867212849E-01 1.8759920439E-01 1.8653190199E-01 + 1.8547019605E-01 1.8441406140E-01 1.8336347292E-01 1.8231840556E-01 + 1.8127883434E-01 1.8024473435E-01 1.7921608075E-01 1.7819284874E-01 + 1.7717501364E-01 1.7616255081E-01 1.7515543568E-01 1.7415364377E-01 + 1.7315715066E-01 1.7216593201E-01 1.7117996355E-01 1.7019922109E-01 + 1.6922368051E-01 1.6825331777E-01 1.6728810892E-01 1.6632803006E-01 + 1.6537305739E-01 1.6442316718E-01 1.6347833577E-01 1.6253853960E-01 + 1.6160375517E-01 1.6067395908E-01 1.5974912797E-01 1.5882923862E-01 + 1.5791426783E-01 1.5700419253E-01 1.5609898969E-01 1.5519863640E-01 + 1.5430310979E-01 1.5341238712E-01 1.5252644568E-01 1.5164526288E-01 + 1.5076881619E-01 1.4989708318E-01 1.4903004149E-01 1.4816766885E-01 + 1.4730994305E-01 1.4645684199E-01 1.4560834365E-01 1.4476442607E-01 + 1.4392506738E-01 1.4309024582E-01 1.4225993967E-01 1.4143412733E-01 + 1.4061278725E-01 1.3979589798E-01 1.3898343815E-01 1.3817538647E-01 + 1.3737172173E-01 1.3657242281E-01 1.3577746867E-01 1.3498683833E-01 + 1.3420051093E-01 1.3341846566E-01 1.3264068179E-01 1.3186713871E-01 + 1.3109781584E-01 1.3033269271E-01 1.2957174894E-01 1.2881496419E-01 + 1.2806231825E-01 1.2731379095E-01 1.2656936223E-01 1.2582901209E-01 + 1.2509272061E-01 1.2436046796E-01 1.2363223439E-01 1.2290800022E-01 + 1.2218774586E-01 1.2147145177E-01 1.2075909854E-01 1.2005066678E-01 + 1.1934613723E-01 1.1864549068E-01 1.1794870799E-01 1.1725577012E-01 + 1.1656665810E-01 1.1588135303E-01 1.1519983609E-01 1.1452208855E-01 + 1.1384809173E-01 1.1317782705E-01 1.1251127599E-01 1.1184842013E-01 + 1.1118924108E-01 1.1053372058E-01 1.0988184041E-01 1.0923358244E-01 + 1.0858892860E-01 1.0794786090E-01 1.0731036144E-01 1.0667641238E-01 + 1.0604599595E-01 1.0541909446E-01 1.0479569029E-01 1.0417576591E-01 + 1.0355930384E-01 1.0294628667E-01 1.0233669709E-01 1.0173051784E-01 + 1.0112773174E-01 1.0052832168E-01 9.9932270624E-02 9.9339561599E-02 + 9.8750177712E-02 9.8164102138E-02 9.7581318123E-02 9.7001808982E-02 + 9.6425558104E-02 9.5852548943E-02 9.5282765027E-02 9.4716189951E-02 + 9.4152807380E-02 9.3592601048E-02 9.3035554759E-02 9.2481652385E-02 + 9.1930877866E-02 9.1383215210E-02 9.0838648495E-02 9.0297161865E-02 + 8.9758739531E-02 8.9223365774E-02 8.8691024941E-02 8.8161701444E-02 + 8.7635379764E-02 8.7112044448E-02 8.6591680110E-02 8.6074271429E-02 + 8.5559803149E-02 8.5048260083E-02 8.4539627107E-02 8.4033889162E-02 + 8.3531031255E-02 8.3031038458E-02 8.2533895907E-02 8.2039588804E-02 + 8.1548102413E-02 8.1059422063E-02 8.0573533147E-02 8.0090421123E-02 + 7.9610071510E-02 7.9132469891E-02 7.8657601913E-02 7.8185453285E-02 + 7.7716009779E-02 7.7249257229E-02 7.6785181532E-02 7.6323768646E-02 + 7.5865004592E-02 7.5408875451E-02 7.4955367369E-02 7.4504466548E-02 + 7.4056159256E-02 7.3610431819E-02 7.3167270624E-02 7.2726662120E-02 + 7.2288592815E-02 7.1853049277E-02 7.1420018134E-02 7.0989486076E-02 + 7.0561439848E-02 7.0135866259E-02 6.9712752175E-02 6.9292084520E-02 + 6.8873850278E-02 6.8458036493E-02 6.8044630265E-02 6.7633618752E-02 + 6.7224989173E-02 6.6818728803E-02 6.6414824974E-02 6.6013265076E-02 + 6.5614036558E-02 6.5217126923E-02 6.4822523734E-02 6.4430214608E-02 + 6.4040187222E-02 6.3652429305E-02 6.3266928647E-02 6.2883673089E-02 + 6.2502650533E-02 6.2123848933E-02 6.1747256299E-02 6.1372860698E-02 + 6.1000650250E-02 6.0630613132E-02 6.0262737575E-02 5.9897011863E-02 + 5.9533424337E-02 5.9171963391E-02 5.8812617473E-02 5.8455375085E-02 + 5.8100224782E-02 5.7747155173E-02 5.7396154922E-02 5.7047212744E-02 + 5.6700317408E-02 5.6355457735E-02 5.6012622600E-02 5.5671800929E-02 + 5.5332981701E-02 5.4996153947E-02 5.4661306750E-02 5.4328429246E-02 + 5.3997510620E-02 5.3668540110E-02 5.3341507005E-02 5.3016400646E-02 + 5.2693210423E-02 5.2371925779E-02 5.2052536205E-02 5.1735031244E-02 + 5.1419400489E-02 5.1105633583E-02 5.0793720218E-02 5.0483650138E-02 + 5.0175413133E-02 4.9868999046E-02 4.9564397767E-02 4.9261599235E-02 + 4.8960593439E-02 4.8661370415E-02 4.8363920249E-02 4.8068233074E-02 + 4.7774299073E-02 4.7482108475E-02 4.7191651558E-02 4.6902918647E-02 + 4.6615900115E-02 4.6330586382E-02 4.6046967915E-02 4.5765035228E-02 + 4.5484778881E-02 4.5206189483E-02 4.4929257686E-02 4.4653974192E-02 + 4.4380329747E-02 4.4108315142E-02 4.3837921215E-02 4.3569138850E-02 + 4.3301958976E-02 4.3036372567E-02 4.2772370643E-02 4.2509944266E-02 + 4.2249084548E-02 4.1989782639E-02 4.1732029740E-02 4.1475817091E-02 + 4.1221135980E-02 4.0967977736E-02 4.0716333733E-02 4.0466195388E-02 + 4.0217554163E-02 3.9970401561E-02 3.9724729129E-02 3.9480528459E-02 + 3.9237791182E-02 3.8996508974E-02 3.8756673553E-02 3.8518276679E-02 + 3.8281310154E-02 3.8045765821E-02 3.7811635568E-02 3.7578911321E-02 + 3.7347585049E-02 3.7117648763E-02 3.6889094513E-02 3.6661914391E-02 + 3.6436100531E-02 3.6211645106E-02 3.5988540330E-02 3.5766778457E-02 + 3.5546351781E-02 3.5327252637E-02 3.5109473399E-02 3.4893006480E-02 + 3.4677844334E-02 3.4463979453E-02 3.4251404369E-02 3.4040111653E-02 + 3.3830093913E-02 3.3621343798E-02 3.3413853995E-02 3.3207617229E-02 + 3.3002626262E-02 3.2798873896E-02 3.2596352970E-02 3.2395056361E-02 + 3.2194976982E-02 3.1996107786E-02 3.1798441762E-02 3.1601971935E-02 + 3.1406691368E-02 3.1212593162E-02 3.1019670451E-02 3.0827916410E-02 + 3.0637324246E-02 3.0447887206E-02 3.0259598570E-02 3.0072451654E-02 + 2.9886439813E-02 2.9701556433E-02 2.9517794938E-02 2.9335148788E-02 + 2.9153611474E-02 2.8973176527E-02 2.8793837510E-02 2.8615588020E-02 + 2.8438421689E-02 2.8262332185E-02 2.8087313209E-02 2.7913358494E-02 + 2.7740461809E-02 2.7568616958E-02 2.7397817775E-02 2.7228058130E-02 + 2.7059331925E-02 2.6891633096E-02 2.6724955611E-02 2.6559293471E-02 + 2.6394640710E-02 2.6230991394E-02 2.6068339622E-02 2.5906679525E-02 + 2.5746005266E-02 2.5586311039E-02 2.5427591070E-02 2.5269839619E-02 + 2.5113050974E-02 2.4957219457E-02 2.4802339419E-02 2.4648405243E-02 + 2.4495411343E-02 2.4343352165E-02 2.4192222182E-02 2.4042015902E-02 + 2.3892727859E-02 2.3744352620E-02 2.3596884782E-02 2.3450318970E-02 + 2.3304649839E-02 2.3159872076E-02 2.3015980396E-02 2.2872969541E-02 + 2.2730834287E-02 2.2589569434E-02 2.2449169815E-02 2.2309630289E-02 + 2.2170945745E-02 2.2033111101E-02 2.1896121300E-02 2.1759971319E-02 + 2.1624656157E-02 2.1490170845E-02 2.1356510441E-02 2.1223670029E-02 + 2.1091644723E-02 2.0960429662E-02 2.0830020013E-02 2.0700410972E-02 + 2.0571597760E-02 2.0443575626E-02 2.0316339843E-02 2.0189885716E-02 + 2.0064208570E-02 1.9939303762E-02 1.9815166671E-02 1.9691792705E-02 + 1.9569177297E-02 1.9447315905E-02 1.9326204013E-02 1.9205837132E-02 + 1.9086210797E-02 1.8967320569E-02 1.8849162033E-02 1.8731730801E-02 + 1.8615022508E-02 1.8499032815E-02 1.8383757407E-02 1.8269191995E-02 + 1.8155332313E-02 1.8042174119E-02 1.7929713197E-02 1.7817945353E-02 + 1.7706866418E-02 1.7596472247E-02 1.7486758719E-02 1.7377721736E-02 + 1.7269357222E-02 1.7161661127E-02 1.7054629424E-02 1.6948258106E-02 + 1.6842543193E-02 1.6737480725E-02 1.6633066766E-02 1.6529297402E-02 + 1.6426168743E-02 1.6323676920E-02 1.6221818085E-02 1.6120588416E-02 + 1.6019984110E-02 1.5920001387E-02 1.5820636488E-02 1.5721885677E-02 + 1.5623745238E-02 1.5526211477E-02 1.5429280724E-02 1.5332949326E-02 + 1.5237213654E-02 1.5142070099E-02 1.5047515073E-02 1.4953545009E-02 + 1.4860156361E-02 1.4767345602E-02 1.4675109229E-02 1.4583443755E-02 + 1.4492345716E-02 1.4401811668E-02 1.4311838187E-02 1.4222421867E-02 + 1.4133559325E-02 1.4045247195E-02 1.3957482133E-02 1.3870260812E-02 + 1.3783579926E-02 1.3697436189E-02 1.3611826333E-02 1.3526747109E-02 + 1.3442195287E-02 1.3358167657E-02 1.3274661027E-02 1.3191672223E-02 + 1.3109198092E-02 1.3027235497E-02 1.2945781321E-02 1.2864832463E-02 + 1.2784385844E-02 1.2704438400E-02 1.2624987086E-02 1.2546028875E-02 + 1.2467560757E-02 1.2389579741E-02 1.2312082854E-02 1.2235067139E-02 + 1.2158529656E-02 1.2082467484E-02 1.2006877719E-02 1.1931757473E-02 + 1.1857103877E-02 1.1782914077E-02 1.1709185236E-02 1.1635914535E-02 + 1.1563099172E-02 1.1490736359E-02 1.1418823327E-02 1.1347357323E-02 + 1.1276335609E-02 1.1205755464E-02 1.1135614185E-02 1.1065909081E-02 + 1.0996637481E-02 1.0927796727E-02 1.0859384178E-02 1.0791397210E-02 + 1.0723833211E-02 1.0656689589E-02 1.0589963764E-02 1.0523653172E-02 + 1.0457755266E-02 1.0392267512E-02 1.0327187392E-02 1.0262512404E-02 + 1.0198240059E-02 1.0134367885E-02 1.0070893423E-02 1.0007814229E-02 + 9.9451278735E-03 9.8828319427E-03 9.8209240361E-03 9.7594017679E-03 + 9.6982627664E-03 9.6375046742E-03 9.5771251482E-03 9.5171218590E-03 + 9.4574924912E-03 9.3982347436E-03 9.3393463284E-03 9.2808249716E-03 + 9.2226684130E-03 9.1648744059E-03 9.1074407170E-03 9.0503651264E-03 + 8.9936454276E-03 8.9372794274E-03 8.8812649457E-03 8.8255998154E-03 + 8.7702818826E-03 8.7153090063E-03 8.6606790585E-03 8.6063899237E-03 + 8.5524394994E-03 8.4988256956E-03 8.4455464351E-03 8.3925996531E-03 + 8.3399832971E-03 8.2876953272E-03 8.2357337157E-03 8.1840964471E-03 + 8.1327815181E-03 8.0817869375E-03 8.0311107262E-03 7.9807509169E-03 + 7.9307055543E-03 7.8809726949E-03 7.8315504069E-03 7.7824367701E-03 + 7.7336298762E-03 7.6851278281E-03 7.6369287405E-03 7.5890307393E-03 + 7.5414319617E-03 7.4941305565E-03 7.4471246834E-03 7.4004125133E-03 + 7.3539922284E-03 7.3078620216E-03 7.2620200971E-03 7.2164646696E-03 + 7.1711939651E-03 7.1262062200E-03 7.0814996816E-03 7.0370726077E-03 + 6.9929232668E-03 6.9490499379E-03 6.9054509104E-03 6.8621244842E-03 + 6.8190689694E-03 6.7762826865E-03 6.7337639662E-03 6.6915111492E-03 + 6.6495225866E-03 6.6077966393E-03 6.5663316783E-03 6.5251260843E-03 + 6.4841782483E-03 6.4434865706E-03 6.4030494616E-03 6.3628653413E-03 + 6.3229326393E-03 6.2832497948E-03 6.2438152565E-03 6.2046274826E-03 + 6.1656849408E-03 6.1269861078E-03 6.0885294701E-03 6.0503135231E-03 + 6.0123367714E-03 5.9745977290E-03 5.9370949187E-03 5.8998268724E-03 + 5.8627921311E-03 5.8259892446E-03 5.7894167717E-03 5.7530732798E-03 + 5.7169573452E-03 5.6810675529E-03 5.6454024967E-03 5.6099607787E-03 + 5.5747410098E-03 5.5397418094E-03 5.5049618053E-03 5.4703996337E-03 + 5.4360539391E-03 5.4019233745E-03 5.3680066010E-03 5.3343022879E-03 + 5.3008091128E-03 5.2675257613E-03 5.2344509271E-03 5.2015833119E-03 + 5.1689216254E-03 5.1364645851E-03 5.1042109167E-03 5.0721593533E-03 + 5.0403086362E-03 5.0086575140E-03 4.9772047433E-03 4.9459490884E-03 + 4.9148893208E-03 4.8840242201E-03 4.8533525728E-03 4.8228731734E-03 + 4.7925848236E-03 4.7624863323E-03 4.7325765161E-03 4.7028541985E-03 + 4.6733182105E-03 4.6439673903E-03 4.6148005830E-03 4.5858166412E-03 + 4.5570144242E-03 4.5283927985E-03 4.4999506377E-03 4.4716868220E-03 + 4.4436002390E-03 4.4156897826E-03 4.3879543540E-03 4.3603928608E-03 + 4.3330042177E-03 4.3057873457E-03 4.2787411728E-03 4.2518646335E-03 + 4.2251566687E-03 4.1986162262E-03 4.1722422599E-03 4.1460337305E-03 + 4.1199896048E-03 4.0941088563E-03 4.0683904647E-03 4.0428334158E-03 + 4.0174367021E-03 3.9921993219E-03 3.9671202800E-03 3.9421985872E-03 + 3.9174332603E-03 3.8928233226E-03 3.8683678030E-03 3.8440657366E-03 + 3.8199161644E-03 3.7959181334E-03 3.7720706965E-03 3.7483729125E-03 + 3.7248238458E-03 3.7014225669E-03 3.6781681518E-03 3.6550596825E-03 + 3.6320962462E-03 3.6092769364E-03 3.5866008517E-03 3.5640670965E-03 + 3.5416747807E-03 3.5194230197E-03 3.4973109346E-03 3.4753376515E-03 + 3.4535023024E-03 3.4318040243E-03 3.4102419598E-03 3.3888152567E-03 + 3.3675230682E-03 3.3463645525E-03 3.3253388733E-03 3.3044451994E-03 + 3.2836827047E-03 3.2630505682E-03 3.2425479742E-03 3.2221741117E-03 + 3.2019281752E-03 3.1818093638E-03 3.1618168818E-03 3.1419499384E-03 + 3.1222077475E-03 3.1025895283E-03 3.0830945045E-03 3.0637219047E-03 + 3.0444709624E-03 3.0253409158E-03 3.0063310078E-03 2.9874404861E-03 + 2.9686686029E-03 2.9500146152E-03 2.9314777846E-03 2.9130573773E-03 + 2.8947526640E-03 2.8765629199E-03 2.8584874249E-03 2.8405254632E-03 + 2.8226763235E-03 2.8049392990E-03 2.7873136871E-03 2.7697987898E-03 + 2.7523939134E-03 2.7350983684E-03 2.7179114697E-03 2.7008325364E-03 + 2.6838608918E-03 2.6669958635E-03 2.6502367834E-03 2.6335829873E-03 + 2.6170338153E-03 2.6005886116E-03 2.5842467244E-03 2.5680075060E-03 + 2.5518703128E-03 2.5358345052E-03 2.5198994475E-03 2.5040645080E-03 + 2.4883290590E-03 2.4726924767E-03 2.4571541410E-03 2.4417134359E-03 + 2.4263697492E-03 2.4111224724E-03 2.3959710010E-03 2.3809147339E-03 + 2.3659530742E-03 2.3510854285E-03 2.3363112070E-03 2.3216298237E-03 + 2.3070406964E-03 2.2925432462E-03 2.2781368980E-03 2.2638210805E-03 + 2.2495952255E-03 2.2354587687E-03 2.2214111492E-03 2.2074518097E-03 + 2.1935801961E-03 2.1797957582E-03 2.1660979487E-03 2.1524862243E-03 + 2.1389600446E-03 2.1255188729E-03 2.1121621757E-03 2.0988894228E-03 + 2.0857000873E-03 2.0725936459E-03 2.0595695782E-03 2.0466273671E-03 + 2.0337664989E-03 2.0209864631E-03 2.0082867522E-03 1.9956668620E-03 + 1.9831262915E-03 1.9706645427E-03 1.9582811208E-03 1.9459755341E-03 + 1.9337472939E-03 1.9215959147E-03 1.9095209138E-03 1.8975218118E-03 + 1.8855981320E-03 1.8737494010E-03 1.8619751481E-03 1.8502749056E-03 + 1.8386482089E-03 1.8270945960E-03 1.8156136081E-03 1.8042047891E-03 + 1.7928676858E-03 1.7816018478E-03 1.7704068275E-03 1.7592821801E-03 + 1.7482274638E-03 1.7372422392E-03 1.7263260700E-03 1.7154785223E-03 + 1.7046991653E-03 1.6939875704E-03 1.6833433122E-03 1.6727659677E-03 + 1.6622551164E-03 1.6518103408E-03 1.6414312257E-03 1.6311173587E-03 + 1.6208683299E-03 1.6106837319E-03 1.6005631599E-03 1.5905062118E-03 + 1.5805124878E-03 1.5705815906E-03 1.5607131256E-03 1.5509067005E-03 + 1.5411619254E-03 1.5314784131E-03 1.5218557785E-03 1.5122936392E-03 + 1.5027916151E-03 1.4933493283E-03 1.4839664036E-03 1.4746424678E-03 + 1.4653771503E-03 1.4561700828E-03 1.4470208991E-03 1.4379292356E-03 + 1.4288947307E-03 1.4199170253E-03 1.4109957623E-03 1.4021305871E-03 + 1.3933211470E-03 1.3845670920E-03 1.3758680737E-03 1.3672237464E-03 + 1.3586337663E-03 1.3500977918E-03 1.3416154835E-03 1.3331865040E-03 + 1.3248105181E-03 1.3164871928E-03 1.3082161969E-03 1.2999972017E-03 + 1.2918298802E-03 1.2837139075E-03 1.2756489610E-03 1.2676347198E-03 + 1.2596708652E-03 1.2517570805E-03 1.2438930508E-03 1.2360784635E-03 + 1.2283130076E-03 1.2205963743E-03 1.2129282567E-03 1.2053083498E-03 + 1.1977363504E-03 1.1902119574E-03 1.1827348714E-03 1.1753047951E-03 + 1.1679214329E-03 1.1605844911E-03 1.1532936777E-03 1.1460487029E-03 + 1.1388492783E-03 1.1316951177E-03 + + + + 0.0000000000E+00 3.8925319484E-02 1.5466560260E-01 3.4415014503E-01 + 6.0238055041E-01 9.2260428745E-01 1.2965467698E+00 1.7146917785E+00 + 2.1665981136E+00 2.6412390705E+00 3.1273507395E+00 3.6137752343E+00 + 4.0897857337E+00 4.5453815996E+00 4.9715437148E+00 5.3604424328E+00 + 5.7055930210E+00 6.0019560502E+00 6.2459827112E+00 6.4356073827E+00 + 6.5701918382E+00 6.6504271730E+00 6.6782007952E+00 6.6564366452E+00 + 6.5889171615E+00 6.4800954444E+00 6.3349056119E+00 6.1585785630E+00 + 5.9564693336E+00 5.7339010314E+00 5.4960290405E+00 5.2477278821E+00 + 4.9935018625E+00 4.7374194961E+00 4.4830707051E+00 4.2335449944E+00 + 3.9914282011E+00 3.7588150207E+00 3.5373343110E+00 3.3281841460E+00 + 3.1321737129E+00 2.9497693818E+00 2.7811425969E+00 2.6262176059E+00 + 2.4847174384E+00 2.3562069220E+00 2.2401318909E+00 2.1358540534E+00 + 2.0426812627E+00 1.9598931490E+00 1.8867622458E+00 1.8225708652E+00 + 1.7666240655E+00 1.7182591071E+00 1.6768518275E+00 1.6418203735E+00 + 1.6126267334E+00 1.5887764951E+00 1.5698172391E+00 1.5553359627E+00 + 1.5449558486E+00 1.5383326396E+00 1.5351509597E+00 1.5351207281E+00 + 1.5379737441E+00 1.5434605946E+00 1.5513479819E+00 1.5614165165E+00 + 1.5734589982E+00 1.5872791578E+00 1.6026907341E+00 1.6195168875E+00 + 1.6375899457E+00 1.6567513594E+00 1.6768516167E+00 1.6977500697E+00 + 1.7193146914E+00 1.7414217840E+00 1.7639556554E+00 1.7868082788E+00 + 1.8098789464E+00 1.8330739248E+00 1.8563061178E+00 1.8794947381E+00 + 1.9025649914E+00 1.9254477725E+00 1.9480793737E+00 1.9704012059E+00 + 1.9923595310E+00 2.0139052069E+00 2.0349934419E+00 2.0555835613E+00 + 2.0756387827E+00 2.0951260016E+00 2.1140155862E+00 2.1322811803E+00 + 2.1498995158E+00 2.1668502325E+00 2.1831157058E+00 2.1986808822E+00 + 2.2135331222E+00 2.2276620497E+00 2.2410594087E+00 2.2537189263E+00 + 2.2656361821E+00 2.2768084839E+00 2.2872347488E+00 2.2969153909E+00 + 2.3058522133E+00 2.3140483066E+00 2.3215079520E+00 2.3282365288E+00 + 2.3342404279E+00 2.3395269686E+00 2.3441043209E+00 2.3479814307E+00 + 2.3511679506E+00 2.3536741731E+00 2.3555109686E+00 2.3566897266E+00 + 2.3572222997E+00 2.3571209520E+00 2.3563983095E+00 2.3550673142E+00 + 2.3531411808E+00 2.3506333558E+00 2.3475574795E+00 2.3439273507E+00 + 2.3397568927E+00 2.3350601227E+00 2.3298511225E+00 2.3241440117E+00 + 2.3179529222E+00 2.3112919752E+00 2.3041752590E+00 2.2966168096E+00 + 2.2886305916E+00 2.2802304814E+00 2.2714302513E+00 2.2622435550E+00 + 2.2526839146E+00 2.2427647082E+00 2.2324991591E+00 2.2219003256E+00 + 2.2109810921E+00 2.1997541610E+00 2.1882320452E+00 2.1764270620E+00 + 2.1643513269E+00 2.1520167488E+00 2.1394350259E+00 2.1266176415E+00 + 2.1135758609E+00 2.1003207292E+00 2.0868630687E+00 2.0732134776E+00 + 2.0593823285E+00 2.0453797680E+00 2.0312157160E+00 2.0168998657E+00 + 2.0024416841E+00 1.9878504124E+00 1.9731350667E+00 1.9583044398E+00 + 1.9433671019E+00 1.9283314024E+00 1.9132054721E+00 1.8979972245E+00 + 1.8827143588E+00 1.8673643614E+00 1.8519545090E+00 1.8364918708E+00 + 1.8209833114E+00 1.8054354938E+00 1.7898548817E+00 1.7742477431E+00 + 1.7586201531E+00 1.7429779970E+00 1.7273269736E+00 1.7116725982E+00 + 1.6960202060E+00 1.6803749554E+00 1.6647418313E+00 1.6491256484E+00 + 1.6335310543E+00 1.6179625335E+00 1.6024244098E+00 1.5869208506E+00 + 1.5714558694E+00 1.5560333298E+00 1.5406569482E+00 1.5253302975E+00 + 1.5100568104E+00 1.4948397823E+00 1.4796823746E+00 1.4645876180E+00 + 1.4495584159E+00 1.4345975467E+00 1.4197076678E+00 1.4048913180E+00 + 1.3901509209E+00 1.3754887874E+00 1.3609071192E+00 1.3464080112E+00 + 1.3319934544E+00 1.3176653392E+00 1.3034254572E+00 1.2892755048E+00 + 1.2752170853E+00 1.2612517118E+00 1.2473808094E+00 1.2336057183E+00 + 1.2199276956E+00 1.2063479182E+00 1.1928674850E+00 1.1794874192E+00 + 1.1662086705E+00 1.1530321176E+00 1.1399585702E+00 1.1269887710E+00 + 1.1141233982E+00 1.1013630672E+00 1.0887083326E+00 1.0761596906E+00 + 1.0637175802E+00 1.0513823858E+00 1.0391544385E+00 1.0270340183E+00 + 1.0150213554E+00 1.0031166323E+00 9.9131998539E-01 9.7963150631E-01 + 9.6805124386E-01 9.5657920539E-01 9.4521535836E-01 9.3395963176E-01 + 9.2281191763E-01 9.1177207236E-01 9.0083991813E-01 8.9001524422E-01 + 8.7929780828E-01 8.6868733761E-01 8.5818353041E-01 8.4778605691E-01 + 8.3749456060E-01 8.2730865934E-01 8.1722794642E-01 8.0725199169E-01 + 7.9738034259E-01 7.8761252511E-01 7.7794804484E-01 7.6838638788E-01 + 7.5892702180E-01 7.4956939652E-01 7.4031294518E-01 7.3115708503E-01 + 7.2210121820E-01 7.1314473256E-01 7.0428700244E-01 6.9552738943E-01 + 6.8686524307E-01 6.7829990160E-01 6.6983069261E-01 6.6145693374E-01 + 6.5317793331E-01 6.4499299090E-01 6.3690139805E-01 6.2890243876E-01 + 6.2099539009E-01 6.1317952271E-01 6.0545410143E-01 5.9781838570E-01 + 5.9027163012E-01 5.8281308489E-01 5.7544199632E-01 5.6815760723E-01 + 5.6095915741E-01 5.5384588401E-01 5.4681702198E-01 5.3987180441E-01 + 5.3300946294E-01 5.2622922808E-01 5.1953032961E-01 5.1291199686E-01 + 5.0637345905E-01 4.9991394561E-01 4.9353268646E-01 4.8722891230E-01 + 4.8100185488E-01 4.7485074726E-01 4.6877482408E-01 4.6277332176E-01 + 4.5684547879E-01 4.5099053590E-01 4.4520773628E-01 4.3949632581E-01 + 4.3385555323E-01 4.2828467032E-01 4.2278293210E-01 4.1734959698E-01 + 4.1198392692E-01 4.0668518758E-01 4.0145264847E-01 3.9628558312E-01 + 3.9118326913E-01 3.8614498838E-01 3.8117002707E-01 3.7625767591E-01 + 3.7140723015E-01 3.6661798974E-01 3.6188925935E-01 3.5722034854E-01 + 3.5261057179E-01 3.4805924857E-01 3.4356570345E-01 3.3912926612E-01 + 3.3474927148E-01 3.3042505971E-01 3.2615597628E-01 3.2194137203E-01 + 3.1778060318E-01 3.1367303143E-01 3.0961802393E-01 3.0561495334E-01 + 3.0166319788E-01 2.9776214130E-01 2.9391117296E-01 2.9010968781E-01 + 2.8635708641E-01 2.8265277497E-01 2.7899616532E-01 2.7538667494E-01 + 2.7182372696E-01 2.6830675015E-01 2.6483517893E-01 2.6140845338E-01 + 2.5802601921E-01 2.5468732776E-01 2.5139183598E-01 2.4813900644E-01 + 2.4492830731E-01 2.4175921234E-01 2.3863120082E-01 2.3554375761E-01 + 2.3249637307E-01 2.2948854308E-01 2.2651976899E-01 2.2358955760E-01 + 2.2069742112E-01 2.1784287719E-01 2.1502544880E-01 2.1224466428E-01 + 2.0950005728E-01 2.0679116671E-01 2.0411753674E-01 2.0147871676E-01 + 1.9887426131E-01 1.9630373009E-01 1.9376668791E-01 1.9126270464E-01 + 1.8879135519E-01 1.8635221945E-01 1.8394488229E-01 1.8156893348E-01 + 1.7922396768E-01 1.7690958438E-01 1.7462538788E-01 1.7237098722E-01 + 1.7014599618E-01 1.6795003320E-01 1.6578272136E-01 1.6364368834E-01 + 1.6153256636E-01 1.5944899216E-01 1.5739260694E-01 1.5536305634E-01 + 1.5335999036E-01 1.5138306336E-01 1.4943193399E-01 1.4750626515E-01 + 1.4560572397E-01 1.4372998173E-01 1.4187871386E-01 1.4005159985E-01 + 1.3824832326E-01 1.3646857162E-01 1.3471203645E-01 1.3297841316E-01 + 1.3126740105E-01 1.2957870325E-01 1.2791202667E-01 1.2626708198E-01 + 1.2464358356E-01 1.2304124944E-01 1.2145980129E-01 1.1989896436E-01 + 1.1835846744E-01 1.1683804283E-01 1.1533742628E-01 1.1385635699E-01 + 1.1239457750E-01 1.1095183374E-01 1.0952787492E-01 1.0812245351E-01 + 1.0673532523E-01 1.0536624897E-01 1.0401498678E-01 1.0268130382E-01 + 1.0136496832E-01 1.0006575155E-01 9.8783427807E-02 9.7517774314E-02 + 9.6268571245E-02 9.5035601663E-02 9.3818651487E-02 9.2617509458E-02 + 9.1431967105E-02 9.0261818707E-02 8.9106861264E-02 8.7966894456E-02 + 8.6841720617E-02 8.5731144695E-02 8.4634974222E-02 8.3553019283E-02 + 8.2485092479E-02 8.1431008899E-02 8.0390586086E-02 7.9363644009E-02 + 7.8350005025E-02 7.7349493855E-02 7.6361937553E-02 7.5387165471E-02 + 7.4425009234E-02 7.3475302709E-02 7.2537881974E-02 7.1612585294E-02 + 7.0699253086E-02 6.9797727899E-02 6.8907854377E-02 6.8029479240E-02 + 6.7162451249E-02 6.6306621186E-02 6.5461841824E-02 6.4627967901E-02 + 6.3804856093E-02 6.2992364992E-02 6.2190355077E-02 6.1398688690E-02 + 6.0617230012E-02 5.9845845040E-02 5.9084401557E-02 5.8332769116E-02 + 5.7590819010E-02 5.6858424254E-02 5.6135459558E-02 5.5421801305E-02 + 5.4717327532E-02 5.4021917902E-02 5.3335453687E-02 5.2657817746E-02 + 5.1988894502E-02 5.1328569920E-02 5.0676731489E-02 5.0033268200E-02 + 4.9398070528E-02 4.8771030407E-02 4.8152041216E-02 4.7540997756E-02 + 4.6937796232E-02 4.6342334233E-02 4.5754510715E-02 4.5174225982E-02 + 4.4601381666E-02 4.4035880713E-02 4.3477627361E-02 4.2926527124E-02 + 4.2382486775E-02 4.1845414330E-02 4.1315219029E-02 4.0791811322E-02 + 4.0275102850E-02 3.9765006429E-02 3.9261436037E-02 3.8764306795E-02 + 3.8273534953E-02 3.7789037876E-02 3.7310734024E-02 3.6838542943E-02 + 3.6372385248E-02 3.5912182606E-02 3.5457857727E-02 3.5009334344E-02 + 3.4566537203E-02 3.4129392049E-02 3.3697825611E-02 3.3271765589E-02 + 3.2851140641E-02 3.2435880370E-02 3.2025915312E-02 3.1621176922E-02 + 3.1221597563E-02 3.0827110491E-02 3.0437649847E-02 3.0053150641E-02 + 2.9673548744E-02 2.9298780870E-02 2.8928784574E-02 2.8563498233E-02 + 2.8202861036E-02 2.7846812976E-02 2.7495294838E-02 2.7148248186E-02 + 2.6805615355E-02 2.6467339440E-02 2.6133364285E-02 2.5803634474E-02 + 2.5478095318E-02 2.5156692850E-02 2.4839373811E-02 2.4526085644E-02 + 2.4216776482E-02 2.3911395137E-02 2.3609891097E-02 2.3312214510E-02 + 2.3018316179E-02 2.2728147553E-02 2.2441660718E-02 2.2158808386E-02 + 2.1879543889E-02 2.1603821173E-02 2.1331594784E-02 2.1062819864E-02 + 2.0797452142E-02 2.0535447924E-02 2.0276764091E-02 2.0021358084E-02 + 1.9769187902E-02 1.9520212092E-02 1.9274389742E-02 1.9031680473E-02 + 1.8792044434E-02 1.8555442294E-02 1.8321835234E-02 1.8091184939E-02 + 1.7863453597E-02 1.7638603885E-02 1.7416598967E-02 1.7197402487E-02 + 1.6980978560E-02 1.6767291770E-02 1.6556307159E-02 1.6347990225E-02 + 1.6142306914E-02 1.5939223612E-02 1.5738707144E-02 1.5540724764E-02 + 1.5345244151E-02 1.5152233404E-02 1.4961661034E-02 1.4773495960E-02 + 1.4587707505E-02 1.4404265388E-02 1.4223139722E-02 1.4044301002E-02 + 1.3867720111E-02 1.3693368303E-02 1.3521217208E-02 1.3351238818E-02 + 1.3183405492E-02 1.3017689941E-02 1.2854065232E-02 1.2692504778E-02 + 1.2532982334E-02 1.2375471997E-02 1.2219948193E-02 1.2066385683E-02 + 1.1914759549E-02 1.1765045196E-02 1.1617218344E-02 1.1471255029E-02 + 1.1327131592E-02 1.1184824680E-02 1.1044311240E-02 1.0905568515E-02 + 1.0768574042E-02 1.0633305645E-02 1.0499741433E-02 1.0367859797E-02 + 1.0237639406E-02 1.0109059201E-02 9.9820983950E-03 9.8567364663E-03 + 9.7329531570E-03 9.6107284690E-03 9.4900426605E-03 9.3708762426E-03 + 9.2532099761E-03 9.1370248683E-03 9.0223021695E-03 8.9090233703E-03 + 8.7971701978E-03 8.6867246133E-03 8.5776688085E-03 8.4699852031E-03 + 8.3636564414E-03 8.2586653895E-03 8.1549951326E-03 8.0526289719E-03 + 7.9515504218E-03 7.8517432074E-03 7.7531912613E-03 7.6558787215E-03 + 7.5597899281E-03 7.4649094211E-03 7.3712219377E-03 7.2787124097E-03 + 7.1873659609E-03 7.0971679049E-03 7.0081037422E-03 6.9201591582E-03 + 6.8333200206E-03 6.7475723769E-03 6.6629024525E-03 6.5792966480E-03 + 6.4967415370E-03 6.4152238639E-03 6.3347305420E-03 6.2552486508E-03 + 6.1767654340E-03 6.0992682978E-03 6.0227448083E-03 5.9471826894E-03 + 5.8725698214E-03 5.7988942381E-03 5.7261441258E-03 5.6543078203E-03 + 5.5833738058E-03 5.5133307125E-03 5.4441673152E-03 5.3758725307E-03 + 5.3084354168E-03 5.2418451698E-03 5.1760911233E-03 5.1111627458E-03 + 5.0470496397E-03 4.9837415388E-03 4.9212283075E-03 4.8594999381E-03 + 4.7985465501E-03 4.7383583879E-03 4.6789258196E-03 4.6202393353E-03 + 4.5622895453E-03 4.5050671791E-03 4.4485630831E-03 4.3927682200E-03 + 4.3376736666E-03 4.2832706125E-03 4.2295503591E-03 4.1765043174E-03 + 4.1241240074E-03 4.0724010560E-03 4.0213271962E-03 3.9708942654E-03 + 3.9210942041E-03 3.8719190548E-03 3.8233609605E-03 3.7754121633E-03 + 3.7280650036E-03 3.6813119183E-03 3.6351454399E-03 3.5895581952E-03 + 3.5445429041E-03 3.5000923785E-03 3.4561995207E-03 3.4128573230E-03 + 3.3700588658E-03 3.3277973171E-03 3.2860659309E-03 3.2448580464E-03 + 3.2041670867E-03 3.1639865580E-03 3.1243100483E-03 3.0851312265E-03 + 3.0464438413E-03 3.0082417202E-03 2.9705187686E-03 2.9332689685E-03 + 2.8964863780E-03 2.8601651300E-03 2.8242994313E-03 2.7888835616E-03 + 2.7539118728E-03 2.7193787879E-03 2.6852788001E-03 2.6516064721E-03 + 2.6183564350E-03 2.5855233875E-03 2.5531020949E-03 2.5210873886E-03 + 2.4894741651E-03 2.4582573850E-03 2.4274320724E-03 2.3969933139E-03 + 2.3669362582E-03 2.3372561148E-03 2.3079481536E-03 2.2790077040E-03 + 2.2504301541E-03 2.2222109501E-03 2.1943455953E-03 2.1668296499E-03 + 2.1396587296E-03 2.1128285055E-03 2.0863347028E-03 2.0601731009E-03 + 2.0343395318E-03 2.0088298803E-03 1.9836400827E-03 1.9587661264E-03 + 1.9342040494E-03 1.9099499393E-03 1.8859999330E-03 1.8623502159E-03 + 1.8389970214E-03 1.8159366300E-03 1.7931653693E-03 1.7706796127E-03 + 1.7484757794E-03 1.7265503335E-03 1.7048997836E-03 1.6835206819E-03 + 1.6624096242E-03 1.6415632490E-03 1.6209782368E-03 1.6006513101E-03 + 1.5805792324E-03 1.5607588078E-03 1.5411868806E-03 1.5218603347E-03 + 1.5027760931E-03 1.4839311176E-03 1.4653224079E-03 1.4469470015E-03 + 1.4288019731E-03 1.4108844341E-03 1.3931915321E-03 1.3757204505E-03 + 1.3584684082E-03 1.3414326590E-03 1.3246104908E-03 1.3079992261E-03 + 1.2915962205E-03 1.2753988631E-03 1.2594045756E-03 1.2436108121E-03 + 1.2280150588E-03 1.2126148331E-03 1.1974076839E-03 1.1823911906E-03 + 1.1675629631E-03 1.1529206412E-03 1.1384618944E-03 1.1241844214E-03 + 1.1100859498E-03 1.0961642355E-03 1.0824170629E-03 1.0688422439E-03 + 1.0554376179E-03 1.0422010516E-03 1.0291304382E-03 1.0162236973E-03 + 1.0034787750E-03 9.9089364260E-04 9.7846629726E-04 9.6619476107E-04 + 9.5407708095E-04 9.4211132834E-04 9.3029559883E-04 9.1862801191E-04 + 9.0710671064E-04 8.9572986136E-04 8.8449565342E-04 8.7340229884E-04 + 8.6244803210E-04 8.5163110976E-04 8.4094981030E-04 8.3040243372E-04 + 8.1998730139E-04 8.0970275568E-04 7.9954715976E-04 7.8951889732E-04 + 7.7961637231E-04 7.6983800869E-04 7.6018225016E-04 7.5064755996E-04 + 7.4123242055E-04 7.3193533346E-04 7.2275481896E-04 7.1368941591E-04 + 7.0473768144E-04 6.9589819079E-04 6.8716953706E-04 6.7855033098E-04 + 6.7003920069E-04 6.6163479152E-04 6.5333576579E-04 6.4514080257E-04 + 6.3704859751E-04 6.2905786258E-04 6.2116732590E-04 6.1337573155E-04 + 6.0568183933E-04 5.9808442459E-04 5.9058227801E-04 5.8317420546E-04 + 5.7585902775E-04 5.6863558047E-04 5.6150271381E-04 5.5445929237E-04 + 5.4750419496E-04 5.4063631447E-04 5.3385455764E-04 5.2715784493E-04 + 5.2054511031E-04 5.1401530111E-04 5.0756737787E-04 5.0120031413E-04 + 4.9491309633E-04 4.8870472356E-04 4.8257420750E-04 4.7652057218E-04 + 4.7054285389E-04 4.6464010098E-04 4.5881137372E-04 4.5305574416E-04 + 4.4737229599E-04 4.4176012437E-04 4.3621833579E-04 4.3074604797E-04 + 4.2534238964E-04 4.2000650049E-04 4.1473753096E-04 4.0953464215E-04 + 4.0439700568E-04 3.9932380353E-04 3.9431422793E-04 3.8936748127E-04 + 3.8448277588E-04 3.7965933400E-04 3.7489638761E-04 3.7019317829E-04 + 3.6554895716E-04 3.6096298469E-04 3.5643453064E-04 3.5196287391E-04 + 3.4754730243E-04 3.4318711308E-04 3.3888161153E-04 3.3463011213E-04 + 3.3043193787E-04 3.2628642019E-04 3.2219289892E-04 3.1815072215E-04 + 3.1415924615E-04 3.1021783527E-04 3.0632586179E-04 3.0248270589E-04 + 2.9868775550E-04 2.9494040622E-04 2.9124006124E-04 2.8758613121E-04 + 2.8397803417E-04 2.8041519545E-04 2.7689704761E-04 2.7342303027E-04 + 2.6999259011E-04 2.6660518075E-04 2.6326026262E-04 2.5995730295E-04 + 2.5669577561E-04 2.5347516111E-04 2.5029494642E-04 2.4715462499E-04 + 2.4405369656E-04 2.4099166720E-04 2.3796804912E-04 2.3498236068E-04 + 2.3203412626E-04 2.2912287619E-04 2.2624814670E-04 2.2340947984E-04 + 2.2060642338E-04 2.1783853078E-04 2.1510536107E-04 2.1240647882E-04 + 2.0974145407E-04 2.0710986223E-04 2.0451128404E-04 2.0194530549E-04 + 1.9941151777E-04 1.9690951718E-04 1.9443890508E-04 1.9199928785E-04 + 1.8959027676E-04 1.8721148801E-04 1.8486254255E-04 1.8254306613E-04 + 1.8025268916E-04 1.7799104669E-04 1.7575777836E-04 1.7355252832E-04 + 1.7137494515E-04 1.6922468188E-04 1.6710139587E-04 1.6500474877E-04 + 1.6293440647E-04 1.6089003907E-04 1.5887132077E-04 1.5687792988E-04 + 1.5490954874E-04 1.5296586367E-04 1.5104656492E-04 1.4915134661E-04 + 1.4727990672E-04 1.4543194700E-04 1.4360717294E-04 1.4180529373E-04 + 1.4002602220E-04 1.3826907478E-04 1.3653417144E-04 1.3482103570E-04 + 1.3312939451E-04 1.3145897825E-04 1.2980952070E-04 1.2818075895E-04 + 1.2657243340E-04 1.2498428771E-04 1.2341606874E-04 1.2186752654E-04 + 1.2033841428E-04 1.1882848824E-04 1.1733750772E-04 1.1586523509E-04 + 1.1441143566E-04 1.1297587770E-04 1.1155833237E-04 1.1015857372E-04 + 1.0877637863E-04 1.0741152675E-04 1.0606380053E-04 1.0473298513E-04 + 1.0341886840E-04 1.0212124085E-04 1.0083989564E-04 9.9574628485E-05 + 9.8325237696E-05 9.7091524094E-05 9.5873291004E-05 9.4670344217E-05 + 9.3482491957E-05 9.2309544855E-05 9.1151315916E-05 9.0007620489E-05 + 8.8878276241E-05 8.7763103122E-05 8.6661923344E-05 8.5574561345E-05 + 8.4500843766E-05 8.3440599422E-05 8.2393659275E-05 8.1359856407E-05 + 8.0339025993E-05 7.9331005275E-05 7.8335633536E-05 7.7352752074E-05 + 7.6382204180E-05 7.5423835108E-05 7.4477492053E-05 7.3543024128E-05 + 7.2620282335E-05 7.1709119548E-05 7.0809390486E-05 6.9920951688E-05 + 6.9043661495E-05 6.8177380022E-05 6.7321969140E-05 6.6477292453E-05 + 6.5643215275E-05 6.4819604609E-05 6.4006329128E-05 6.3203259149E-05 + 6.2410266618E-05 6.1627225087E-05 6.0854009693E-05 6.0090497141E-05 + 5.9336565681E-05 5.8592095091E-05 5.7856966655E-05 5.7131063150E-05 + 5.6414268820E-05 5.5706469362E-05 5.5007551909E-05 5.4317405005E-05 + 5.3635918598E-05 5.2962984011E-05 5.2298493934E-05 5.1642342403E-05 + 5.0994424780E-05 5.0354637744E-05 4.9722879267E-05 4.9099048602E-05 + 4.8483046267E-05 4.7874774025E-05 4.7274134875E-05 4.6681033030E-05 + 4.6095373906E-05 4.5517064107E-05 4.4946011405E-05 4.4382124732E-05 + 4.3825314162E-05 4.3275490897E-05 4.2732567252E-05 4.2196456644E-05 + 4.1667073576E-05 4.1144333621E-05 4.0628153415E-05 4.0118450637E-05 + 3.9615144001E-05 3.9118153238E-05 3.8627399090E-05 3.8142803290E-05 + 3.7664288555E-05 3.7191778571E-05 3.6725197981E-05 3.6264472374E-05 + 3.5809528273E-05 3.5360293123E-05 3.4916695277E-05 3.4478663991E-05 + 3.4046129406E-05 3.3619022539E-05 3.3197275275E-05 3.2780820351E-05 + 3.2369591351E-05 3.1963522689E-05 3.1562549605E-05 3.1166608149E-05 + 3.0775635175E-05 3.0389568330E-05 3.0008346042E-05 2.9631907511E-05 + 2.9260192703E-05 2.8893142333E-05 2.8530697864E-05 2.8172801491E-05 + 2.7819396135E-05 2.7470425434E-05 2.7125833733E-05 2.6785566075E-05 + 2.6449568191E-05 2.6117786497E-05 2.5790168077E-05 2.5466660684E-05 + 2.5147212721E-05 2.4831773244E-05 2.4520291943E-05 2.4212719143E-05 + 2.3909005793E-05 2.3609103453E-05 2.3312964297E-05 2.3020541093E-05 + 2.2731787207E-05 2.2446656587E-05 2.2165103760E-05 2.1887083824E-05 + 2.1612552440E-05 2.1341465825E-05 2.1073780746E-05 2.0809454513E-05 + 2.0548444972E-05 2.0290710496E-05 2.0036209983E-05 1.9784902845E-05 + 1.9536749004E-05 1.9291708885E-05 1.9049743410E-05 1.8810813991E-05 + 1.8574882524E-05 1.8341911384E-05 1.8111863418E-05 1.7884701939E-05 + 1.7660390720E-05 1.7438893990E-05 1.7220176426E-05 1.7004203148E-05 + 1.6790939715E-05 1.6580352117E-05 1.6372406772E-05 1.6167070518E-05 + 1.5964310610E-05 1.5764094715E-05 1.5566390905E-05 1.5371167651E-05 + 1.5178393823E-05 1.4988038679E-05 1.4800071865E-05 1.4614463405E-05 + 1.4431183703E-05 1.4250203531E-05 1.4071494030E-05 1.3895026703E-05 + 1.3720773409E-05 1.3548706363E-05 1.3378798127E-05 1.3211021607E-05 + 1.3045350050E-05 1.2881757038E-05 1.2720216485E-05 1.2560702633E-05 + 1.2403190047E-05 1.2247653610E-05 1.2094068522E-05 1.1942410293E-05 + 1.1792654742E-05 1.1644777989E-05 1.1498756457E-05 1.1354566861E-05 + 1.1212186211E-05 1.1071591806E-05 1.0932761228E-05 1.0795672341E-05 + 1.0660303288E-05 1.0526632484E-05 1.0394638618E-05 1.0264300644E-05 + 1.0135597781E-05 1.0008509509E-05 9.8830155653E-06 9.7590959419E-06 + 9.6367308814E-06 9.5159008750E-06 9.3965866583E-06 9.2787692088E-06 + 9.1624297430E-06 9.0475497129E-06 8.9341108033E-06 8.8220949291E-06 + 8.7114842322E-06 8.6022610785E-06 8.4944080553E-06 8.3879079685E-06 + 8.2827438396E-06 8.1788989036E-06 8.0763566057E-06 7.9751005989E-06 + 7.8751147415E-06 7.7763830942E-06 7.6788899180E-06 7.5826196712E-06 + 7.4875570074E-06 7.3936867729E-06 7.3009940039E-06 7.2094639247E-06 + 7.1190819449E-06 7.0298336573E-06 6.9417048355E-06 6.8546814318E-06 + 6.7687495746E-06 6.6838955666E-06 6.6001058825E-06 6.5173671665E-06 + 6.4356662306E-06 6.3549900523E-06 6.2753257726E-06 6.1966606939E-06 + 6.1189822779E-06 6.0422781439E-06 5.9665360662E-06 5.8917439730E-06 + 5.8178899437E-06 5.7449622075E-06 5.6729491412E-06 5.6018392677E-06 + 5.5316212537E-06 5.4622839085E-06 5.3938161815E-06 5.3262071610E-06 + 5.2594460721E-06 5.1935222755E-06 5.1284252650E-06 5.0641446666E-06 + 5.0006702364E-06 4.9379918590E-06 4.8760995460E-06 4.8149834344E-06 + 4.7546337851E-06 4.6950409811E-06 4.6361955261E-06 4.5780880430E-06 + 4.5207092726E-06 4.4640500716E-06 4.4081014117E-06 4.3528543777E-06 + 4.2983001666E-06 4.2444300856E-06 4.1912355512E-06 4.1387080876E-06 + 4.0868393252E-06 4.0356209997E-06 3.9850449503E-06 3.9351031189E-06 + 3.8857875484E-06 3.8370903814E-06 3.7890038594E-06 3.7415203211E-06 + 3.6946322013E-06 3.6483320301E-06 3.6026124309E-06 3.5574661200E-06 + 3.5128859051E-06 3.4688646840E-06 3.4253954437E-06 3.3824712592E-06 + 3.3400852926E-06 3.2982307916E-06 3.2569010887E-06 3.2160896001E-06 + 3.1757898248E-06 3.1359953431E-06 3.0966998159E-06 3.0578969839E-06 + 3.0195806662E-06 2.9817447594E-06 2.9443832369E-06 2.9074901477E-06 + 2.8710596152E-06 2.8350858369E-06 2.7995630829E-06 2.7644856953E-06 + 2.7298480873E-06 2.6956447421E-06 2.6618702122E-06 2.6285191183E-06 + 2.5955861488E-06 2.5630660587E-06 + + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 147daf67b94..57b643c6af4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,3 +15,5 @@ add_subdirectory(17_DS_DFTU) if(ENABLE_MLALGO) add_subdirectory(09_DeePKS) endif() + +add_subdirectory(18_SDFT_FAST) diff --git a/tests/integrate/validation_tools/check_sdft_dos_inputs.py b/tests/integrate/validation_tools/check_sdft_dos_inputs.py new file mode 100644 index 00000000000..124f94708c9 --- /dev/null +++ b/tests/integrate/validation_tools/check_sdft_dos_inputs.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +"""Check expected DOS INPUT failures; these cannot be scalar Autotest cases.""" +import argparse +import os +from pathlib import Path +import shutil +import subprocess +import tempfile + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--binary', required=True, type=Path) + parser.add_argument('--fixtures', required=True, type=Path) + args = parser.parse_args() + binary = args.binary.resolve() + for fixture in sorted(args.fixtures.iterdir()): + if not fixture.is_dir(): + continue + with tempfile.TemporaryDirectory(prefix='abacus-dos-input-') as directory: + shutil.copytree(fixture, directory, dirs_exist_ok=True) + result = subprocess.run( + [str(binary), '--check-input'], cwd=directory, + env=dict(os.environ, OMP_NUM_THREADS='1', OPENBLAS_NUM_THREADS='1'), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + text=True, timeout=20) + accepted = 'INPUT parameters have been successfully checked!' in result.stdout + if fixture.name == 'valid': + assert result.returncode == 0 and accepted, result.stdout + else: + assert not accepted, result.stdout + assert "Invalid INPUT parameter '{}'".format(fixture.name.split("__")[0]) in result.stdout, result.stdout + print(fixture.name + ': expected INPUT behavior confirmed') + + +if __name__ == '__main__': + main() diff --git a/tests/integrate/validation_tools/check_sdft_fast.py b/tests/integrate/validation_tools/check_sdft_fast.py new file mode 100644 index 00000000000..68c2155db89 --- /dev/null +++ b/tests/integrate/validation_tools/check_sdft_fast.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python3 +"""Run a dedicated Autotest fixture and check spectral/DOS/TS output contracts. + +Autotest checks scalar references. Additional checks below compare the full DOS +with independent dense-H spectra and exercise expected low-order failures. +Only the Python standard library is needed for ordinary PR runs. +""" +import argparse +import json +import math +import os +from pathlib import Path +import re +import shutil +import subprocess +import tempfile + + +def numerical_rows(path, columns): + result = [] + for line in path.read_text().splitlines(): + try: + row = [float(x) for x in line.split()] + except ValueError: + continue + if len(row) == columns: + assert all(math.isfinite(x) for x in row), path + result.append(row) + assert result, path + return result + + +def validate(case, reference): + log = (case / 'OUT.autotest/running_scf.log').read_text() + assert '#SCF IS CONVERGED#' in log, 'SCF did not converge' + energy = float(re.findall(r'!FINAL_ETOT_IS\s+(\S+)', log)[-1]) + ts = float(re.findall(r'E_entropy\(-TS\)\s+(\S+)', log)[-1]) + assert abs(energy - reference['energy_eV']) < 1e-5, 'energy regression' + assert abs(ts - reference['entropy_Ry']) < 1e-7, 'TS regression' + tails = [float(x)*1e-9 for x in re.findall(r'TSRelative Chebyshev Precision:\s+(\S+)E-09', log)] + assert len(tails) == len(reference['ts_tails']), 'SCF iteration count changed; recompute independent reference' + for actual, expected in zip(tails, reference['ts_tails']): + assert math.isfinite(actual) and abs(actual-expected) < 2e-12+2e-5*abs(expected), 'TS tail formula regression' + if reference['expected'] == 'ts_underestimate': + assert any(error > 1.2*tail for error, tail in zip(reference['ts_true_relative_errors'], tails)) + if reference['expected'] in ['low_ts', 'ts_underestimate']: + assert 'under-resolved' in log, 'missing SCF order warning' + intervals = re.findall(r'New Emax Ry(\S+) ; new Emin (\S+) Ry', log) + assert len(intervals) == len(reference['scf_intervals_Ry']), 'missing SCF endpoint records' + for (upper, lower), (true_lower, true_upper) in zip(intervals, reference['scf_intervals_Ry']): + upper = float(upper) + lower = float(lower) + # SCF's legacy endpoint log has six significant digits. Certification + # exports use full precision and a separate strict 1e-7 Ry tolerance. + lower_rounding = 0.5*10**(math.floor(math.log10(max(abs(lower), 1e-30)))-5) + upper_rounding = 0.5*10**(math.floor(math.log10(max(abs(upper), 1e-30)))-5) + assert lower <= true_lower+lower_rounding+1e-7, 'SCF lower endpoint regression' + assert upper >= true_upper-upper_rounding-1e-7, 'SCF upper endpoint regression' + if not reference['dos_spectra']: + print(case.name+': SCF interval, energy and TS checks passed') + return + ks = reference.get('ks', False) + dosfile = case / ('OUT.autotest/doss1.txt' if ks else 'OUT.autotest/dos_sdft.txt') + data = numerical_rows(dosfile, 5 if ks else 4) + # Independently reconstructed last-term differences, expressed in eV^-1. + # These catch a missing Ry-to-eV conversion without assuming a total-error bound. + for expected in reference.get('dos_tail_reference', []): + row = min(data, key=lambda point: abs(point[0]-expected['energy_eV'])) + assert abs(row[0]-expected['energy_eV']) < 0.02, 'DOS tail reference grid mismatch' + assert abs(row[3]-expected['error_eV_inv']) < 1e-7, 'DOS tail units regression' + difference = 0.0 + norm = 0.0 + for row in data: + exact = 0.0 + for spectrum in reference['dos_spectra']: + sigma = spectrum['sigma_eV'] + for energy, weight in zip(spectrum['energies_eV'], spectrum['weights']): + exact += weight*math.exp(-0.5*((row[0]-energy)/sigma)**2)/(math.sqrt(2*math.pi)*sigma) + difference += abs(row[3 if ks else 1]-exact) + norm += abs(exact) + error = difference/norm + if reference['expected'] == 'low_dos': + assert error > 5e-4, 'negative control no longer under-resolved' + assert 'NOT TRUSTWORTHY' in dosfile.read_text(), 'missing DOS warning' + else: + assert error < 5e-4, 'DOS relative L1 error: {}'.format(error) + if not ks: + ranges = re.findall(r'DOS: refreshed spectral interval \[([^,]+), ([^\]]+)\] Ry', log) + assert ranges, 'missing current-H endpoint refresh' + lower, upper = map(float, ranges[-1]) + true_lower, true_upper = reference['true_dos_interval_Ry'] + assert lower <= true_lower+1e-7 and upper >= true_upper-1e-7, 'DOS interval misses dense-H spectrum' + print('{}: DOS L1={:.3g}; energy, TS and interval checks passed'.format(case.name, error)) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--binary', required=True, type=Path) + parser.add_argument('--fixture', required=True, type=Path) + parser.add_argument('--ranks', required=True, type=int) + parser.add_argument('--timeout', type=int, default=120) + args = parser.parse_args() + fixture = args.fixture.resolve() + tools = Path(__file__).resolve().parent + env = dict(os.environ, OMP_NUM_THREADS='1', OPENBLAS_NUM_THREADS='1') + with tempfile.TemporaryDirectory(prefix='abacus-sdft-fast-') as tmp: + root = Path(tmp) + suite = root/'18_SDFT_FAST' + suite.mkdir() + case = suite/fixture.name + shutil.copytree(fixture, case) + shutil.copytree(fixture.parent/'pseudo', suite/'pseudo') + shutil.copytree(tools.parent, root/'integrate', ignore=shutil.ignore_patterns('general_info.local', '__pycache__')) + (suite/'CASES_CPU.txt').write_text(fixture.name+'\n') + command = ['bash', '../integrate/Autotest.sh', '-a', str(args.binary.resolve()), '-n', str(args.ranks), '-o', '1'] + result = subprocess.run(command, cwd=suite, env=env, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, universal_newlines=True, timeout=args.timeout) + print(result.stdout) + assert result.returncode == 0, 'Autotest failed' + validate(case, json.loads((fixture/'reference.json').read_text())) + + +if __name__ == '__main__': + main() From c11d9722cdab04d877f464c475afb526bf7af72e Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 3 Dec 2026 04:17:23 +0800 Subject: [PATCH 4/9] Complete focused regression fixtures and migrate stale unit tests --- source/source_pw/module_stodft/CMakeLists.txt | 3 - .../module_stodft/test/CMakeLists.txt | 42 +---------- .../module_stodft/unittests/CMakeLists.txt | 41 +++++++++++ .../test_sto_hamilt_pw.cpp | 13 ++++ .../test_sto_hsolver_pw.cpp | 42 ++++++++--- .../{test => unittests}/test_sto_tool.cpp | 70 ++++++++++++++++++- tests/18_SDFT_FAST/README.md | 29 ++++++++ 7 files changed, 187 insertions(+), 53 deletions(-) rename source/source_pw/module_stodft/{test => unittests}/test_sto_hamilt_pw.cpp (86%) rename source/source_pw/module_stodft/{test => unittests}/test_sto_hsolver_pw.cpp (92%) rename source/source_pw/module_stodft/{test => unittests}/test_sto_tool.cpp (61%) diff --git a/source/source_pw/module_stodft/CMakeLists.txt b/source/source_pw/module_stodft/CMakeLists.txt index 1a3b0110833..5b615507553 100644 --- a/source/source_pw/module_stodft/CMakeLists.txt +++ b/source/source_pw/module_stodft/CMakeLists.txt @@ -21,8 +21,5 @@ if(ENABLE_COVERAGE) endif() if(BUILD_TESTING) - if(ENABLE_MPI) - add_subdirectory(test) - endif() add_subdirectory(unittests) endif() diff --git a/source/source_pw/module_stodft/test/CMakeLists.txt b/source/source_pw/module_stodft/test/CMakeLists.txt index 534b5143c4c..d0baf1f3776 100644 --- a/source/source_pw/module_stodft/test/CMakeLists.txt +++ b/source/source_pw/module_stodft/test/CMakeLists.txt @@ -1,41 +1 @@ -abacus_disable_feature_definitions(__MPI) -# These tests exercise CPU code only and link no GPU kernels, so build them -# without the device instantiations (as source_hsolver/unittests does). -abacus_disable_feature_definitions(__CUDA) -abacus_disable_feature_definitions(__ROCM) - -addtest( - TARGET MODULE_PW_Sto_Tool_UTs - LIBS parameter psi base device - SOURCES ../sto_tool.cpp test_sto_tool.cpp) - -addtest( - TARGET MODULE_PW_Sto_Hamilt_UTs - LIBS parameter psi base device planewave_serial symmetry - SOURCES ../sto_hamilt_pw.cpp - test_sto_hamilt_pw.cpp - ../../../source_hamilt/operator.cpp - ../../../source_cell/klist.cpp - ../../../source_cell/klist_io.cpp - ../../../source_cell/parallel_kpoints.cpp - ../../../source_cell/reciprocal_grid.cpp) - -addtest( - TARGET MODULE_PW_Sto_HSolver_UTs - LIBS parameter psi device base container MPI::MPI_CXX - SOURCES - test_sto_hsolver_pw.cpp - ../sto_hsolver_pw.cpp - ../../../source_hsolver/hsolver_pw.cpp - ../../../source_hsolver/diago_bpcg.cpp - ../../../source_hsolver/diago_dav_subspace.cpp - ../../../source_hsolver/diag_const_nums.cpp - ../../../source_hsolver/diago_iter_assist.cpp - ../../../source_hsolver/para_lin_tf.cpp - ../../../source_estate/elecstate_tools.cpp - ../../../source_estate/occupy.cpp - ../../../source_base/module_fft/fft_bundle.cpp - ../../../source_base/module_fft/fft_cpu.cpp - # This test calls MPI_Init in main() and its mocks take MPI_Comm arguments - # unconditionally, so it must keep __MPI even though this directory disables it. - KEEP_FEATURE_DEFINITIONS __MPI) +# Tests have moved to ../unittests. Kept so older build trees can regenerate. diff --git a/source/source_pw/module_stodft/unittests/CMakeLists.txt b/source/source_pw/module_stodft/unittests/CMakeLists.txt index 9dc0607c9d8..97c89805cfb 100644 --- a/source/source_pw/module_stodft/unittests/CMakeLists.txt +++ b/source/source_pw/module_stodft/unittests/CMakeLists.txt @@ -32,3 +32,44 @@ AddTest(TARGET MODULE_PW_STO_FUNC_UTs LIBS parameter base device SOURCES AddTest(TARGET MODULE_PW_STO_MATH_UTs LIBS base device SOURCES test_sto_math.cpp) + +if(ENABLE_MPI) +addtest( + TARGET MODULE_PW_Sto_Tool_UTs + LIBS parameter psi base device planewave_serial symmetry + SOURCES ../sto_tool.cpp ../sto_spectral_bounds.cpp test_sto_tool.cpp + ../../../source_cell/klist.cpp ../../../source_cell/klist_io.cpp + ../../../source_cell/parallel_kpoints.cpp ../../../source_cell/reciprocal_grid.cpp) + +addtest( + TARGET MODULE_PW_Sto_Hamilt_UTs + LIBS parameter psi base device planewave_serial symmetry + SOURCES ../sto_hamilt_pw.cpp ../sto_spectral_bounds.cpp + test_sto_hamilt_pw.cpp + ../../../source_hamilt/operator.cpp + ../../../source_cell/klist.cpp + ../../../source_cell/klist_io.cpp + ../../../source_cell/parallel_kpoints.cpp + ../../../source_cell/reciprocal_grid.cpp) + +addtest( + TARGET MODULE_PW_Sto_HSolver_UTs + LIBS parameter psi device base container MPI::MPI_CXX + SOURCES + test_sto_hsolver_pw.cpp + ../sto_hsolver_pw.cpp + ../../../source_hsolver/hsolver_pw.cpp + ../../../source_hsolver/diago_bpcg.cpp + ../../../source_hsolver/diago_dav_subspace.cpp + ../../../source_hsolver/diag_const_nums.cpp + ../../../source_hsolver/diago_iter_assist.cpp + ../../../source_hsolver/para_lin_tf.cpp + ../../../source_estate/elecstate_tools.cpp + ../../../source_estate/occupy.cpp + ../../../source_base/module_fft/fft_bundle.cpp + ../../../source_base/module_fft/fft_cpu.cpp + # This test initializes MPI through Parallel_Global and its mocks take MPI_Comm arguments + # unconditionally, so it must keep __MPI even though this directory disables it. + KEEP_FEATURE_DEFINITIONS __MPI) + +endif() diff --git a/source/source_pw/module_stodft/test/test_sto_hamilt_pw.cpp b/source/source_pw/module_stodft/unittests/test_sto_hamilt_pw.cpp similarity index 86% rename from source/source_pw/module_stodft/test/test_sto_hamilt_pw.cpp rename to source/source_pw/module_stodft/unittests/test_sto_hamilt_pw.cpp index 7023d90719b..f4897c397b7 100644 --- a/source/source_pw/module_stodft/test/test_sto_hamilt_pw.cpp +++ b/source/source_pw/module_stodft/unittests/test_sto_hamilt_pw.cpp @@ -33,6 +33,19 @@ template class hamilt::HamiltPW, base_device::DEVICE_CPU>; template class hamilt::HamiltPW, base_device::DEVICE_GPU>; template class hamilt::HamiltPW, base_device::DEVICE_GPU>; +template +void pseudopot_cell_vnl::getvnl(Device*, const UnitCell&, const int&, + const ModuleBase::Vector3&, std::complex*) const +{ + ADD_FAILURE() << "Hamiltonian application test must not request nonlocal projectors"; +} +template void pseudopot_cell_vnl::getvnl( + base_device::DEVICE_CPU*, const UnitCell&, const int&, + const ModuleBase::Vector3&, std::complex*) const; +template void pseudopot_cell_vnl::getvnl( + base_device::DEVICE_CPU*, const UnitCell&, const int&, + const ModuleBase::Vector3&, std::complex*) const; + /************************************************ * unit test of hamilt_sto_pw.cpp * - Tested Functions: diff --git a/source/source_pw/module_stodft/test/test_sto_hsolver_pw.cpp b/source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp similarity index 92% rename from source/source_pw/module_stodft/test/test_sto_hsolver_pw.cpp rename to source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp index 0a361000f7d..953def355f1 100644 --- a/source/source_pw/module_stodft/test/test_sto_hsolver_pw.cpp +++ b/source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp @@ -140,7 +140,7 @@ template void Stochastic_Iter::checkemm(const int& ik, const int istep, const int iter, - Stochastic_WF& stowf) + Stochastic_WF& stowf, const double smearing_sigma, std::ostream& log) { // do something to verify this function has been called stowf.nchi++; @@ -189,6 +189,20 @@ void Stochastic_Iter::cal_storho(const UnitCell& ucell, ModulePW::PW_Basis_K* wfc_basis) { } +template +double Stochastic_Iter::polynomial_growth() const { return 1.0; } + +template +ModuleIO::NonlocalBounds StoHamiltPW::spectral_bounds(const int) const +{ + ModuleIO::NonlocalBounds result; + result.lo = -1.0; + result.hi = 1.0; + result.ok = true; + return result; +} +template ModuleIO::NonlocalBounds StoHamiltPW, base_device::DEVICE_CPU>::spectral_bounds(const int) const; + template class Stochastic_Iter, base_device::DEVICE_CPU>; Charge::Charge(){}; @@ -406,18 +420,30 @@ class TestStoHSolverPW : public ::testing::Test #ifdef __MPI #include "source_base/parallel_comm.h" #include "source_base/timer.h" -#include "mpi.h" +#include "source_base/parallel_global.h" int main(int argc, char** argv) { ModuleBase::timer::disable(); - MPI_Init(&argc, &argv); + int size = 1; + int rank = 0; + int threads = 1; + int band_size = 1; + int band_rank = 0; + int band_group = 0; + int pool_size = 1; + int pool_rank = 0; + int pool = 0; + Parallel_Global::read_pal_param(argc, argv, size, threads, rank); + Parallel_Global::init_pools(size, rank, 1, 1, band_size, band_rank, band_group, + pool_size, pool_rank, pool); + int group_rank = 0; + int group_size = 1; + int group_color = 0; + Parallel_Global::split_grid_world(1, size, rank, group_rank, group_size); + Parallel_Global::split_diag_world(1, size, rank, group_rank, group_size, group_color); testing::InitGoogleTest(&argc, argv); - - MPI_Comm_split(MPI_COMM_WORLD, 0, 1, &BP_WORLD); int result = RUN_ALL_TESTS(); - - MPI_Comm_free(&BP_WORLD); - MPI_Finalize(); + Parallel_Global::finalize_mpi(); return result; } diff --git a/source/source_pw/module_stodft/test/test_sto_tool.cpp b/source/source_pw/module_stodft/unittests/test_sto_tool.cpp similarity index 61% rename from source/source_pw/module_stodft/test/test_sto_tool.cpp rename to source/source_pw/module_stodft/unittests/test_sto_tool.cpp index 8ba41f57c8c..b852c20c55b 100644 --- a/source/source_pw/module_stodft/test/test_sto_tool.cpp +++ b/source/source_pw/module_stodft/unittests/test_sto_tool.cpp @@ -1,9 +1,15 @@ #include "../sto_tool.h" #include "source_pw/module_pwdft/dftu_base.h" -#include "mpi.h" +#include +#include "source_base/parallel_reduce.h" #include +// This target tests the serial checker, even in an MPI-enabled build whose +// shared base object library contains MPI reductions. A one-rank sum is a no-op. +template <> +void Parallel_Reduce::reduce_pool(double&) {} + /************************************************ * unit test of sto_tool.cpp ***********************************************/ @@ -35,11 +41,39 @@ StoHamiltPW::StoHamiltPW(elecstate::Potential* pot_in, Real* emax_in) : hamilt::HamiltPW(pot_in, wfc_basis, p_kv, nlpp, nullptr, ucell, nullptr), ngk(p_kv->ngk) { + basis_context = wfc_basis; + emin = emin_in; + emax = emax_in; } template void StoHamiltPW::hPsi_norm(const T* psi_in, T* hpsi, const int& nbands){} +template +void StoHamiltPW::hPsi(const T* in, T* out, const int& bands) +{ + const int lda = basis_context->npwk_max; + for (int band = 0; band < bands; ++band) + { + for (int i = 0; i < lda; ++i) { out[band * lda + i] = static_cast(basis_context->gk2[i]) * in[band * lda + i]; } + } +} + +template +ModuleIO::NonlocalBounds StoHamiltPW::spectral_bounds(const int) const +{ + ModuleIO::NonlocalBounds result; + result.lo = basis_context->gk2[0]; + result.hi = basis_context->gk2[2]; + result.ok = true; + return result; +} + +template +Stochastic_WF::Stochastic_WF() {} +template +Stochastic_WF::~Stochastic_WF() { delete chi0; delete[] nchip; } + template class hamilt::HamiltPW, base_device::DEVICE_CPU>; template class StoHamiltPW, base_device::DEVICE_CPU>; template class hamilt::HamiltPW, base_device::DEVICE_CPU>; @@ -114,3 +148,37 @@ TEST_F(TestStoTool, gatherchi) = gatherchi_op()(chi, chi_all, npwx, nrecv_sto, displs_sto, perbands_sto); EXPECT_EQ(p_chi, &chi); } + +TEST_F(TestStoTool, PostprocessingCheckerSeesMissingDirectionAndPositiveShift) +{ + for (const double shift : {0.0, 10.0}) + { + ModulePW::PW_Basis_K basis; + basis.npwk_max = 4; + basis.gk2 = new double[4]{0.5 + shift, 1.0 + shift, 4.0 + shift, 0.0}; + K_Vectors kv; + kv.set_nks(1); + kv.ngk = {3}; + Stochastic_WF> orbitals; + orbitals.npwx = 4; + orbitals.nchip = new int[1]{2}; + orbitals.chi0 = new psi::Psi>(1, 2, 4, kv.ngk, true); + orbitals.chi0->zero_out(); + (*orbitals.chi0)(0, 0, 0) = 1.0; + (*orbitals.chi0)(0, 1, 1) = 1.0; + double lo = shift; + double hi = shift + 2.0; + StoHamiltPW> h(nullptr, &basis, &kv, nullptr, nullptr, 1, &lo, &hi); + std::ostringstream log; + // The first two complete-basis orbitals cannot see the eigenvalue 4+shift. + check_che_op()(40, lo, hi, &kv, &orbitals, &h, log); + EXPECT_LE(lo, 0.5 + shift); + EXPECT_GE(hi, 4.0 + shift); + lo = 0.0; + hi = 0.0; + check_che_op()(40, 0.0, 0.0, &kv, &orbitals, &h, log); + EXPECT_GT(lo, shift); + EXPECT_LE(lo, 0.5 + shift); + EXPECT_GE(hi, 4.0 + shift); + } +} diff --git a/tests/18_SDFT_FAST/README.md b/tests/18_SDFT_FAST/README.md index c9bb8075e38..a6620f963b1 100644 --- a/tests/18_SDFT_FAST/README.md +++ b/tests/18_SDFT_FAST/README.md @@ -15,3 +15,32 @@ The Ne/TS total-error estimator studies are kept outside this PR. The spectral estimator and DOS calculation receive logging/output dependencies explicitly. The application Driver is the legacy-global adaptation boundary; no exception is requested for the global dependency budget. + +## Review regression additions + +CPU builds register seven calculation cases and one DOS input check. The latter +checks four invalid zero values, an oversized method-2 order (`dos_nche=100000`), +and one valid boundary input. The method-2 DOS matrix uses BLAS integer +dimensions, so `dos_nche` must not exceed 46340 in method 2. This is checked +before allocation; method 1 does not inherit the square-matrix restriction. +The positive `dos_sigma`, `dos_edelta_ev`, `npart_sto`, and `dos_nche >= 1` +requirements still apply. + +The DOS output window is independent of the polynomial spectral interval. +Explicit endpoints are preserved; automatic endpoints include scale padding and +three Gaussian widths. Last-term DOS errors are reported in eV^-1, without +claiming that the last term bounds the total truncation error. + +`conductivity/` is a manual 348 eV sKG smoke fixture for the shared interval-check +call chain. Copy it to scratch alongside `pseudo/` and run ABACUS with one MPI +rank. Its coarse frequency/time settings keep runtime short; they are not +conductivity accuracy references. Check that `OUT.autotest/Onsager.txt` contains +five finite rows. `MODULE_PW_Sto_Tool_UTs` also tests a missed orthogonal direction +in `check_che_op`, with positive and shifted spectra. + +The scalar references and `reference.json` derive from prior full-Hamiltonian +certification, including every SCF step and the final DOS potential. Normal +DOS relative L1 error must stay below 5e-4. The intentionally low-order case +must retain its warning and expected error; references were not rewritten to +match this implementation. GPU cases exercise SCF/intervals only. Two MPI +ranks on a single GPU establish shared-device coverage, not multiple devices. From 7511e4d73bf49fca54689d8975c35fda1886c406 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 3 Dec 2026 04:19:19 +0800 Subject: [PATCH 5/9] Drop obsolete nchi bookkeeping from the former probe-selection path --- source/source_pw/module_stodft/sto_wf.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source/source_pw/module_stodft/sto_wf.cpp b/source/source_pw/module_stodft/sto_wf.cpp index bcff5141252..2fca88e4824 100644 --- a/source/source_pw/module_stodft/sto_wf.cpp +++ b/source/source_pw/module_stodft/sto_wf.cpp @@ -108,11 +108,6 @@ void Stochastic_WF::allocate_chi0() } this->nchip_max = tmpnchip; - // Record that real stochastic orbitals have been allocated. This member - // was previously left at its default value of zero, so downstream code - // (notably the DOS range check) mistakenly used random test vectors even - // when chi0/chiortho were available. - this->nchi = nchi; size_t size = this->nchip_max * npwx * nks; this->chi0_cpu = new psi::Psi(nks, this->nchip_max, npwx, this->ngk, true); ModuleBase::Memory::record("SDFT::chi0_cpu", size * sizeof(T)); @@ -209,10 +204,6 @@ void Stochastic_WF::init_com_orbitals() this->nchip_max = std::max(tmpnchip, this->nchip_max); delete[] npwip; } - // In the complete-basis ("all") mode nbands_sto is zero, but chi0 still - // contains real orbitals. Keep nchi nonzero so that consumers such as - // check_che_op know that actual orbitals are available. - this->nchi = this->nchip_max; size_t size = this->nchip_max * npwx * nks; this->chi0_cpu = new psi::Psi>(nks, this->nchip_max, npwx, this->ngk, true); this->chi0_cpu->zero_out(); @@ -286,7 +277,6 @@ void Stochastic_WF::init_com_orbitals() this->chi0_cpu->operator()(ik, ichi, ichi) = 1; } } - this->nchi = this->nchip_max; // allocate chi0 Device* ctx = {}; From c9894a857eda34396d4a42a77733ebc2835d86c8 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 3 Dec 2026 04:19:19 +0800 Subject: [PATCH 6/9] Drop obsolete nchi bookkeeping from the former probe-selection path --- source/source_pw/module_stodft/sto_wf.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source/source_pw/module_stodft/sto_wf.cpp b/source/source_pw/module_stodft/sto_wf.cpp index bcff5141252..2fca88e4824 100644 --- a/source/source_pw/module_stodft/sto_wf.cpp +++ b/source/source_pw/module_stodft/sto_wf.cpp @@ -108,11 +108,6 @@ void Stochastic_WF::allocate_chi0() } this->nchip_max = tmpnchip; - // Record that real stochastic orbitals have been allocated. This member - // was previously left at its default value of zero, so downstream code - // (notably the DOS range check) mistakenly used random test vectors even - // when chi0/chiortho were available. - this->nchi = nchi; size_t size = this->nchip_max * npwx * nks; this->chi0_cpu = new psi::Psi(nks, this->nchip_max, npwx, this->ngk, true); ModuleBase::Memory::record("SDFT::chi0_cpu", size * sizeof(T)); @@ -209,10 +204,6 @@ void Stochastic_WF::init_com_orbitals() this->nchip_max = std::max(tmpnchip, this->nchip_max); delete[] npwip; } - // In the complete-basis ("all") mode nbands_sto is zero, but chi0 still - // contains real orbitals. Keep nchi nonzero so that consumers such as - // check_che_op know that actual orbitals are available. - this->nchi = this->nchip_max; size_t size = this->nchip_max * npwx * nks; this->chi0_cpu = new psi::Psi>(nks, this->nchip_max, npwx, this->ngk, true); this->chi0_cpu->zero_out(); @@ -286,7 +277,6 @@ void Stochastic_WF::init_com_orbitals() this->chi0_cpu->operator()(ik, ichi, ichi) = 1; } } - this->nchi = this->nchip_max; // allocate chi0 Device* ctx = {}; From 0f38753835bbbe71c3ceac868b74a236b326dc91 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 3 Dec 2026 05:02:24 +0800 Subject: [PATCH 7/9] Read text DOS from the configured output layout in Autotest --- tests/integrate/validation_tools/props_basic.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integrate/validation_tools/props_basic.sh b/tests/integrate/validation_tools/props_basic.sh index 66f4c09477f..8310bd78efd 100644 --- a/tests/integrate/validation_tools/props_basic.sh +++ b/tests/integrate/validation_tools/props_basic.sh @@ -198,7 +198,9 @@ run_basic_props() { # DOS information #------------------------------- if ! test -z "$has_dos" && [ $has_dos == 1 ]; then - total_dos=$(cat OUT.autotest/dos*.txt | awk 'END {print}' | awk '{print $3}') + local dos_dir=OUT.autotest + if [ "$out_app_flag" = 2 ]; then dos_dir+=/DOS; fi + total_dos=$(awk 'END {print $3}' "$dos_dir"/dos*.txt) || return 1 echo "totaldosref $total_dos" >> $props_result_file elif [ "$has_dos" = 2 ]; then local dos_dir=OUT.autotest From f2eef41e284d8581694fb107ad2de3236925f9a1 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 4 Dec 2026 18:42:49 +0800 Subject: [PATCH 8/9] Include standard algorithms explicitly in nonlocal bounds test --- .../module_stodft/unittests/test_sto_nonlocal_bounds.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp b/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp index b8521ae772c..c5901ef4774 100644 --- a/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp +++ b/source/source_pw/module_stodft/unittests/test_sto_nonlocal_bounds.cpp @@ -2,8 +2,10 @@ #include +#include #include #include +#include #include /** From 1ff6ccb796b5f39cfbb6a447ca0c218eec0a1e03 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 4 Dec 2026 20:13:21 +0800 Subject: [PATCH 9/9] Construct nonmovable stochastic solver directly in C++14 test fixture --- .../unittests/test_sto_hsolver_pw.cpp | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp b/source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp index 398eb460f0f..a7d2b825f33 100644 --- a/source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp +++ b/source/source_pw/module_stodft/unittests/test_sto_hsolver_pw.cpp @@ -294,31 +294,30 @@ class TestStoHSolverPW : public ::testing::Test K_Vectors kv; StoChe stoche; StoHamiltPW>* p_hamilt_sto = nullptr; - StoHSolverPW, base_device::DEVICE_CPU> hs_d - = StoHSolverPW, base_device::DEVICE_CPU>( - &kv, - &pwbk, - stowf, - stoche, - p_hamilt_sto, - "scf", - "pw", - "cg", - false, - 1, - hsolver::DiagoIterAssist>::SCF_ITER, - hsolver::DiagoIterAssist>::PW_DIAG_NMAX, - hsolver::DiagoIterAssist>::PW_DIAG_THR, - hsolver::DiagoIterAssist>::need_subspace, - 0, - false, - 4, - "hard", - 0, - 0, - false, - true, - 1); + StoHSolverPW, base_device::DEVICE_CPU> hs_d{ + &kv, + &pwbk, + stowf, + stoche, + p_hamilt_sto, + "scf", + "pw", + "cg", + false, + 1, + hsolver::DiagoIterAssist>::SCF_ITER, + hsolver::DiagoIterAssist>::PW_DIAG_NMAX, + hsolver::DiagoIterAssist>::PW_DIAG_THR, + hsolver::DiagoIterAssist>::need_subspace, + 0, + false, + 4, + "hard", + 0, + 0, + false, + true, + 1}; hamilt::Hamilt> hamilt_test_d;