ergo
mat::TC2< Treal, Tmatrix >::Fun Class Reference

Help class for bisection root finding calls. More...

#include <TC2.h>

Public Member Functions

 Fun (int const *const p, int const pl, Treal const s)
 
Treal eval (Treal const x) const
 
 TC2 (Tmatrix &F, Tmatrix &DM, const int size, const int noc, const Treal trunc=0, const int maxmm=100)
 Constructor Initializes everything.
 
Treal fermi_level (Treal tol=1e-15) const
 Returns the Fermi level.
 
Treal homo (Treal tol=1e-15) const
 Returns upper bound of the HOMO eigenvalue.
 
Treal lumo (Treal tol=1e-15) const
 Returns lower bound of the LUMO eigenvalue.
 
int n_multiplies () const
 Returns the number of used matrix matrix multiplications.
 
void print_data (int const start, int const stop) const
 
virtual ~TC2 ()
 Destructor.
 

Protected Member Functions

void purify ()
 Runs purification.
 

Protected Attributes

Tmatrix & X
 Fock / Kohn-Sham matrix at initialization.
 
Tmatrix & D
 Density matrix after purification.
 
const int n
 System size.
 
const int nocc
 Number of occupied orbitals.
 
const Treal frob_trunc
 Threshold for the truncation.
 
const int maxmul
 Number of tolerated matrix multiplications.
 
Treal lmin
 Lower bound for eigenvalue spectrum.
 
Treal lmax
 Upper bound for eigenvalue spectrum.
 
int nmul
 Number of used matrix multiplications.
 
int nmul_firstpart
 Number of used matrix multiplications in the first part of the purification.
 
Treal * idemerror
 Upper bound of euclidean norm ||D-D^2||_2 before each step.
 
Treal * tracediff
 The difference between the trace of the matrix and the number of occupied orbitals before each step.
 
int * polys
 Choices of polynomials 0 for x^2 and 1 for 2x-x^2 Length: nmul.
 

Private Attributes

int const *const pol
 
int const pollength
 
Treal const shift
 

Detailed Description

template<typename Treal, typename Tmatrix>
class mat::TC2< Treal, Tmatrix >::Fun

Help class for bisection root finding calls.

See also
fermi_level
homo
lumo

Constructor & Destructor Documentation

◆ Fun()

template<typename Treal, typename Tmatrix>
mat::TC2< Treal, Tmatrix >::Fun::Fun ( int const *const p,
int const pl,
Treal const s )
inline

References pol, pollength, and shift.

Referenced by purify().

◆ ~TC2()

virtual mat::TC2< Treal, Tmatrix >::~TC2 ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ eval()

template<typename Treal, typename Tmatrix>
Treal mat::TC2< Treal, Tmatrix >::Fun::eval ( Treal const x) const
inline

References pol, pollength, and shift.

◆ fermi_level()

Treal mat::TC2< Treal, Tmatrix >::fermi_level ( Treal tol = 1e-15) const

Returns the Fermi level.

Run after call to purify().

Parameters
tolFault-tolerance for result.

◆ homo()

Treal mat::TC2< Treal, Tmatrix >::homo ( Treal tol = 1e-15) const

Returns upper bound of the HOMO eigenvalue.

Run after call to purify().

Parameters
tolFault-tolerance for result.

◆ lumo()

Treal mat::TC2< Treal, Tmatrix >::lumo ( Treal tol = 1e-15) const

Returns lower bound of the LUMO eigenvalue.

Run after call to purify().

Parameters
tolFault-tolerance for result.

◆ n_multiplies()

int mat::TC2< Treal, Tmatrix >::n_multiplies ( ) const
inline

Returns the number of used matrix matrix multiplications.

◆ print_data()

void mat::TC2< Treal, Tmatrix >::print_data ( int const start,
int const stop ) const

◆ purify()

void mat::TC2< Treal, Tmatrix >::purify ( )
protected

Runs purification.

Run by constructor.

References Fun().

◆ TC2()

mat::TC2< Treal, Tmatrix >::TC2 ( Tmatrix & F,
Tmatrix & DM,
const int size,
const int noc,
const Treal trunc = 0,
const int maxmm = 100 )

Constructor Initializes everything.

Constructor.

< Run purification

Parameters
FFock/Kohn-Sham matrix (input/workspace)
DMDensity matrix (output)
sizeSystem size (Number of basis functions)
nocNumber of occupied orbitals.
truncThreshold for truncation in Frobenius norm.
maxmmMaximum aloud number of mm-multiplications.

Member Data Documentation

◆ D

Tmatrix& mat::TC2< Treal, Tmatrix >::D
protected

Density matrix after purification.

◆ frob_trunc

const Treal mat::TC2< Treal, Tmatrix >::frob_trunc
protected

Threshold for the truncation.

◆ idemerror

Treal* mat::TC2< Treal, Tmatrix >::idemerror
protected

Upper bound of euclidean norm ||D-D^2||_2 before each step.

This means: idemerror[i] = norm(D[i]-D[i]^2) where D[0] is the initial matrix and D[i] is the matrix after i steps in the purification. This value is calculated after the step since D[i]^2 or 2D[i] - D[i]^2 is needed. Length: nmul

◆ lmax

Treal mat::TC2< Treal, Tmatrix >::lmax
protected

Upper bound for eigenvalue spectrum.

◆ lmin

Treal mat::TC2< Treal, Tmatrix >::lmin
protected

Lower bound for eigenvalue spectrum.

◆ maxmul

const int mat::TC2< Treal, Tmatrix >::maxmul
protected

Number of tolerated matrix multiplications.

◆ n

const int mat::TC2< Treal, Tmatrix >::n
protected

System size.

◆ nmul

int mat::TC2< Treal, Tmatrix >::nmul
protected

Number of used matrix multiplications.

◆ nmul_firstpart

int mat::TC2< Treal, Tmatrix >::nmul_firstpart
protected

Number of used matrix multiplications in the first part of the purification.

◆ nocc

const int mat::TC2< Treal, Tmatrix >::nocc
protected

Number of occupied orbitals.

◆ pol

template<typename Treal, typename Tmatrix>
int const* const mat::TC2< Treal, Tmatrix >::Fun::pol
private

Referenced by eval(), and Fun().

◆ pollength

template<typename Treal, typename Tmatrix>
int const mat::TC2< Treal, Tmatrix >::Fun::pollength
private

Referenced by eval(), and Fun().

◆ polys

int* mat::TC2< Treal, Tmatrix >::polys
protected

Choices of polynomials 0 for x^2 and 1 for 2x-x^2 Length: nmul.

◆ shift

template<typename Treal, typename Tmatrix>
Treal const mat::TC2< Treal, Tmatrix >::Fun::shift
private

Referenced by eval(), and Fun().

◆ tracediff

Treal* mat::TC2< Treal, Tmatrix >::tracediff
protected

The difference between the trace of the matrix and the number of occupied orbitals before each step.

Length: nmul + 1

◆ X

Tmatrix& mat::TC2< Treal, Tmatrix >::X
protected

Fock / Kohn-Sham matrix at initialization.

Then used as workspace by purify(). Empty after call to purify().


The documentation for this class was generated from the following file: