Loading...
Searching...
No Matches
init.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * Diagonalizer — abstract interface for eigenvalue solvers.
5 *
6 * Provides the generic base for all eigensolvers. Planewave-specific
7 * solve() methods, cached projector management, and smooth potential
8 * cache invalidation are declared in the PlanewaveDiagonalizer subclass.
9 */
10
11#include <string>
12
14
15namespace q3 {
16
17// Abstract interface for eigenvalue solvers.
19 public:
20 virtual ~Diagonalizer() = default;
21
22 [[nodiscard]] virtual std::string name() const = 0;
23
24 /**
25 * Set the convergence tolerance for iterative eigensolvers.
26 * No-op for direct solvers; overridden by Davidson and similar.
27 */
28 virtual void set_tolerance(Real /*tolerance*/) {}
29
30 /**
31 * Set whether this is the first SCF iteration.
32 * No-op by default; overridden by solvers like Davidson to control convergence checks.
33 */
34 virtual void set_first_iteration(bool /*is_first_iteration*/) {}
35};
36
37} // namespace q3
virtual void set_tolerance(Real)
Definition init.hpp:28
virtual ~Diagonalizer()=default
virtual void set_first_iteration(bool)
Definition init.hpp:34
virtual std::string name() const =0
double Real