Octopus
chebyshev_filter_oracle_oct_m Module Reference

Data Types

type  three_term_relation
 

Functions/Subroutines

subroutine three_term_relation_init (this, n)
 Initialize an instance three_term_relation More...
 
subroutine finalize (this)
 Finalize an instance three_term_relation More...
 
subroutine, public optimal_chebyshev_polynomial_degree (namespace, st, ik, residual, residual_tol, bounds, max_degree, max_degree_estimate)
 Approximate an optimal Chebyshev polynomial filter degree. Batchified. More...
 
pure integer function get_max_state_index (st, bounds, ik)
 Detect the highest meaningful eigenstate. More...
 
integer function optimal_polynomial_degree (prior_residual, eigenvalues, bounds, T, target_residual, max_degree, first_eigenval)
 Approximate an optimal Chebyshev polynomial filter degree. More...
 

Function/Subroutine Documentation

◆ three_term_relation_init()

subroutine chebyshev_filter_oracle_oct_m::three_term_relation_init ( class(three_term_relation this,
integer, intent(in)  n 
)
private

Initialize an instance three_term_relation

Definition at line 136 of file chebyshev_filter_oracle.F90.

◆ finalize()

subroutine chebyshev_filter_oracle_oct_m::finalize ( type(three_term_relation), intent(inout)  this)
private

Finalize an instance three_term_relation

Definition at line 149 of file chebyshev_filter_oracle.F90.

◆ optimal_chebyshev_polynomial_degree()

subroutine, public chebyshev_filter_oracle_oct_m::optimal_chebyshev_polynomial_degree ( type(namespace_t), intent(in)  namespace,
type(states_elec_t), intent(in)  st,
integer, intent(in)  ik,
real(real64), dimension(:), intent(in)  residual,
real(real64), intent(in)  residual_tol,
type(chebyshev_filter_bounds_t), intent(in)  bounds,
integer, intent(in)  max_degree,
integer, dimension(:), intent(out)  max_degree_estimate 
)

Approximate an optimal Chebyshev polynomial filter degree. Batchified.

Batch/block wrapper for approximating an optimal Chebyshev polynomial filter degree, based on how much the magnitude of the Chebyshev polynomial scales the corresponding residuals.

Parameters
[in]stKS states containing eigenvalues
[in]ikk-point index
[in]residualResidual vector from prior SCF iteration
[in]residual_tolThreshold at which the residuals are
[in]boundsPolynomial filter bounds.
[in]max_degreeMaximum degree to consider.
[out]max_degree_estimateMaximum polynomial degree estimate,

Definition at line 164 of file chebyshev_filter_oracle.F90.

◆ get_max_state_index()

pure integer function chebyshev_filter_oracle_oct_m::get_max_state_index ( type(states_elec_t), intent(in)  st,
type(chebyshev_filter_bounds_t), intent(in)  bounds,
integer, intent(in)  ik 
)
private

Detect the highest meaningful eigenstate.

The topmost state is a fixed point, with a shifted eigenenergy of -1 or very close to it. We exclude this state at it will always make the last batch be very slow to converge

Parameters
[in]stKS states containing eigenvalues
[in]boundsPolynomial filter bounds.
[in]ikk-point index

Definition at line 242 of file chebyshev_filter_oracle.F90.

◆ optimal_polynomial_degree()

integer function chebyshev_filter_oracle_oct_m::optimal_polynomial_degree ( real(real64), dimension(:), intent(in)  prior_residual,
real(real64), dimension(:), intent(in)  eigenvalues,
type(chebyshev_filter_bounds_t), intent(in)  bounds,
type(three_term_relation), intent(inout)  T,
real(real64), intent(in)  target_residual,
integer, intent(in)  max_degree,
real(real64), intent(in)  first_eigenval 
)
private

Approximate an optimal Chebyshev polynomial filter degree.

Approximate an optimal Chebyshev polynomial filter degree based on how much the magnitude of the Chebyshev polynomial, evaluated for a set of eignevalues, scales the corresponding residuals. Based on the ABINIT implementation documented in [Parallel eigensolvers in plane-wave Density Functional Theory](https:

Selection Criteria

The criteria are implemented such that for early SCF cycles, when the absolute residual values are large, the degree returned should not result in a reduction in the smallest residual by more than an order of magnitude. Once the absolute values of residuals are the same order of magnitude as target_residual, the absolute criterion should take over.

\(\epsilon * |T_n(E_1)| \ll 1\) is implemented to prevent obtaining large polynomial degrees, as this will result in the Gram matrix being ill-conditioned. Like Abinit, we apply this condition to the lowest eigenvalue. In general, we do not expect this criterion to be evaluated unless \(|T_n|\) increases exponentially from \(n\) to \(n+1\).

If max_degree == 1, filter_degree = 1 is returned.

Note
  • This function implements the simple Chebyshev polynomial filter, consistent with Algorithm 3.1 in [Chebyshev-filtered subspace iteration method free of sparse diagonalization for solving the Kohn–Sham equation](https: The scaled polynomial was tested but the magnitude of the polynomial did not appear to consistently increase as a function of degree. That implementation was assumed to be erroneous and removed, but should be revisited.
  • The Chebyshev polynomial increases in magnitude as the degree is increased, but the sign switches per iteration. One therefore should implement \(|T_n|\), which is a subtle detail missing from the ABINIT paper.
Parameters
[in]prior_residualResidual vector from prior SCF iteration.
[in]eigenvaluesEigenvalues (or a subset) of eigenvalues
[in]boundsPolynomial filter bounds.
[in,out]tFilter work arrays: Polynomial filter
[in]target_residualAbsolute value for target residual.
[in]max_degreeMaximum polynomial degree to consider.
[in]first_eigenvalFirst eigenvalue
Returns
Optimal maximum polynomial order.

Definition at line 292 of file chebyshev_filter_oracle.F90.