Bridge++  Ver. 2.0.2
AFopr_Sign< AFIELD > Class Template Reference

Sign function of a given fermion operator. More...

#include <afopr_Sign.h>

Inheritance diagram for AFopr_Sign< AFIELD >:
AFopr< AFIELD >

Public Types

typedef AFopr< AFIELDAFOPR
 
typedef AFIELD::real_t real_t
 
typedef ComplexTraits< real_t >::complex_t complex_t
 

Public Member Functions

 AFopr_Sign (AFOPR *fopr, const Parameters &params)
 
DEPRECATED AFopr_Sign (AFOPR *fopr)
 
 ~AFopr_Sign ()
 
void set_parameters (const Parameters &params)
 sets parameters by a Parameter object: to be implemented in a subclass. More...
 
void set_parameters (const int Np, const real_t x_min, const real_t x_max, const int Niter, const real_t Stop_cond)
 
void get_parameters (Parameters &params) const
 gets parameters by a Parameter object: to be implemented in a subclass. More...
 
void set_config (Field *U)
 sets the gauge configuration. More...
 
void set_mode (const std::string mode)
 setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelevant call. More...
 
std::string get_mode () const
 returns the current mult mode. More...
 
void set_lowmodes (const int Nsbt, std::vector< real_t > *, std::vector< AFIELD > *)
 
void mult (AFIELD &v, const AFIELD &w)
 multiplies fermion operator to a given field. More...
 
void mult_dag (AFIELD &v, const AFIELD &w)
 hermitian conjugate of mult. More...
 
virtual bool needs_convert ()
 returns true if additional field conversion is needed. More...
 
virtual void convert (AFIELD &v, const Field &w)
 converts a Field object into other format if necessary. More...
 
virtual void reverse (Field &v, const AFIELD &w)
 reverses to a Field object from other format if necessary. More...
 
int field_nin ()
 returns the on-site degree of freedom of the fermion field. More...
 
int field_nvol ()
 returns the volume of the fermion field. More...
 
int field_nex ()
 returns the external degree of freedom of the fermion field. More...
 
double flop_count ()
 returns the number of floating point operations. More...
 
double flop_count (const std::string mode)
 returns the flops per site for specified mode. More...
 
- Public Member Functions inherited from AFopr< AFIELD >
 AFopr ()
 
virtual ~AFopr ()
 
virtual void mult (AFIELD &, const AFIELD &, const std::string mode)
 executes mult with specified mode (unchanging internal mode). More...
 
virtual void mult_dag (AFIELD &, const AFIELD &, const std::string mode)
 executes mult_dag with specified mode (unchanging internal mode). More...
 
virtual void mult_gm5 (AFIELD &, const AFIELD &)
 multiplies gamma_5 matrix. More...
 
virtual void mult_up (int mu, AFIELD &, const AFIELD &)
 upward nearest neighbor hopping term. More...
 
virtual void mult_dn (int mu, AFIELD &, const AFIELD &)
 downward nearest neighbor hopping term. More...
 
virtual void normalize_fprop (AFIELD &)
 normalize propagator if necessary (default: do nothing) More...
 
virtual void normalize_fopr (AFIELD &)
 normalize propagator if necessary (default: do nothing) More...
 

Static Public Attributes

static const std::string class_name = "AFopr_Sign"
 

Private Member Functions

void init ()
 
void init (const Parameters &params)
 
void tidyup ()
 
void init_parameters ()
 
void subtract_lowmodes (AFIELD &)
 
void evaluate_lowmodes (AFIELD &, const AFIELD &)
 
real_t sign_zolotarev (const real_t x)
 

Private Attributes

int m_Np
 number of poles in rational approx. More...
 
real_t m_x_min
 lower range of approximate sign function More...
 
real_t m_x_max
 upper range of approximate sign function More...
 
int m_Niter
 max iteration of shiftsolver More...
 
real_t m_Stop_cond
 stopping condition of shift solver More...
 
Bridge::VerboseLevel m_vl
 
std::string m_mode
 
AFOPRm_fopr
 
int m_Nin
 
int m_Nvol
 
int m_Nex
 
std::vector< real_tm_cl
 
std::vector< real_tm_bl
 
std::vector< real_tm_sigma
 
int m_Nsbt
 
std::vector< real_t > * m_ev
 
std::vector< AFIELD > * m_vk
 
AShiftsolver_CG< AFIELD, AFOPR > * m_solver
 
std::vector< AFIELDm_xq
 
AFIELD m_w1
 

Additional Inherited Members

- Static Protected Attributes inherited from AFopr< AFIELD >
static const std::string class_name
 

Detailed Description

template<typename AFIELD>
class AFopr_Sign< AFIELD >

Sign function of a given fermion operator.

This class defines a sign function of a given fermion operator, which must be provided at the construction, and thus itself being a kind of fermion operator. The sign function is approximated with partially fractional series whose coefficients are given by Zolotarev approximation. When eigenvalues and eigenvectors of the base fermion operator are given, contribution of these modes to sign function are explicitly calculated and subtracted from the approximation formula. Number of subtracted modes are initially set to zero, and if the function set_lowmodes() is not called, no subtraction is performed. In the present implementation, shiftsolver is explicitly set to CG, which might be generalized. 20 Dec 2011 H.Matsufuru YAML is implemented. [14 Nov 2012 Y.Namekawa] unique_ptr is introduced to avoid memory leaks [21 Mar 2015 Y.Namekawa] Changed to a template class in ver.2.0. [12 Feb 2022 H.Matsufuru]

Definition at line 56 of file afopr_Sign.h.

Member Typedef Documentation

◆ AFOPR

template<typename AFIELD >
typedef AFopr<AFIELD> AFopr_Sign< AFIELD >::AFOPR

Definition at line 59 of file afopr_Sign.h.

◆ complex_t

template<typename AFIELD >
typedef ComplexTraits<real_t>::complex_t AFopr_Sign< AFIELD >::complex_t

Definition at line 61 of file afopr_Sign.h.

◆ real_t

template<typename AFIELD >
typedef AFIELD::real_t AFopr_Sign< AFIELD >::real_t

Definition at line 60 of file afopr_Sign.h.

Constructor & Destructor Documentation

◆ AFopr_Sign() [1/2]

template<typename AFIELD >
AFopr_Sign< AFIELD >::AFopr_Sign ( AFOPR fopr,
const Parameters params 
)
inline

Definition at line 100 of file afopr_Sign.h.

◆ AFopr_Sign() [2/2]

template<typename AFIELD >
DEPRECATED AFopr_Sign< AFIELD >::AFopr_Sign ( AFOPR fopr)
inline

Definition at line 104 of file afopr_Sign.h.

◆ ~AFopr_Sign()

template<typename AFIELD >
AFopr_Sign< AFIELD >::~AFopr_Sign ( )
inline

Definition at line 106 of file afopr_Sign.h.

Member Function Documentation

◆ convert()

template<typename AFIELD >
virtual void AFopr_Sign< AFIELD >::convert ( AFIELD v,
const Field w 
)
inlinevirtual

converts a Field object into other format if necessary.

Reimplemented from AFopr< AFIELD >.

Definition at line 133 of file afopr_Sign.h.

◆ evaluate_lowmodes()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::evaluate_lowmodes ( AFIELD x,
const AFIELD w 
)
private

Definition at line 333 of file afopr_Sign-tmpl.h.

◆ field_nex()

template<typename AFIELD >
int AFopr_Sign< AFIELD >::field_nex ( )
inlinevirtual

returns the external degree of freedom of the fermion field.

Implements AFopr< AFIELD >.

Definition at line 142 of file afopr_Sign.h.

◆ field_nin()

template<typename AFIELD >
int AFopr_Sign< AFIELD >::field_nin ( )
inlinevirtual

returns the on-site degree of freedom of the fermion field.

Implements AFopr< AFIELD >.

Definition at line 140 of file afopr_Sign.h.

◆ field_nvol()

template<typename AFIELD >
int AFopr_Sign< AFIELD >::field_nvol ( )
inlinevirtual

returns the volume of the fermion field.

Implements AFopr< AFIELD >.

Definition at line 141 of file afopr_Sign.h.

◆ flop_count() [1/2]

template<typename AFIELD >
double AFopr_Sign< AFIELD >::flop_count
virtual

returns the number of floating point operations.

Reimplemented from AFopr< AFIELD >.

Definition at line 368 of file afopr_Sign-tmpl.h.

◆ flop_count() [2/2]

template<typename AFIELD >
double AFopr_Sign< AFIELD >::flop_count ( const std::string  mode)
virtual

returns the flops per site for specified mode.

Reimplemented from AFopr< AFIELD >.

Definition at line 376 of file afopr_Sign-tmpl.h.

◆ get_mode()

template<typename AFIELD >
std::string AFopr_Sign< AFIELD >::get_mode ( ) const
inlinevirtual

returns the current mult mode.

Reimplemented from AFopr< AFIELD >.

Definition at line 119 of file afopr_Sign.h.

◆ get_parameters()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::get_parameters ( Parameters params) const
virtual

gets parameters by a Parameter object: to be implemented in a subclass.

Reimplemented from AFopr< AFIELD >.

Definition at line 222 of file afopr_Sign-tmpl.h.

◆ init() [1/2]

template<typename AFIELD >
void AFopr_Sign< AFIELD >::init
private

Definition at line 56 of file afopr_Sign-tmpl.h.

◆ init() [2/2]

template<typename AFIELD >
void AFopr_Sign< AFIELD >::init ( const Parameters params)
private

Definition at line 28 of file afopr_Sign-tmpl.h.

◆ init_parameters()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::init_parameters
private

Definition at line 174 of file afopr_Sign-tmpl.h.

◆ mult()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::mult ( AFIELD ,
const AFIELD  
)
virtual

multiplies fermion operator to a given field.

Reimplemented from AFopr< AFIELD >.

Definition at line 278 of file afopr_Sign-tmpl.h.

◆ mult_dag()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::mult_dag ( AFIELD ,
const AFIELD  
)
inlinevirtual

hermitian conjugate of mult.

Reimplemented from AFopr< AFIELD >.

Definition at line 126 of file afopr_Sign.h.

◆ needs_convert()

template<typename AFIELD >
virtual bool AFopr_Sign< AFIELD >::needs_convert ( )
inlinevirtual

returns true if additional field conversion is needed.

Reimplemented from AFopr< AFIELD >.

Definition at line 129 of file afopr_Sign.h.

◆ reverse()

template<typename AFIELD >
virtual void AFopr_Sign< AFIELD >::reverse ( Field v,
const AFIELD w 
)
inlinevirtual

reverses to a Field object from other format if necessary.

Reimplemented from AFopr< AFIELD >.

Definition at line 137 of file afopr_Sign.h.

◆ set_config()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::set_config ( Field )
virtual

sets the gauge configuration.

Implements AFopr< AFIELD >.

Definition at line 236 of file afopr_Sign-tmpl.h.

◆ set_lowmodes()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::set_lowmodes ( const int  Nsbt,
std::vector< real_t > *  ev,
std::vector< AFIELD > *  vk 
)

Definition at line 260 of file afopr_Sign-tmpl.h.

◆ set_mode()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::set_mode ( const std::string  mode)
virtual

setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelevant call.

Reimplemented from AFopr< AFIELD >.

Definition at line 244 of file afopr_Sign-tmpl.h.

◆ set_parameters() [1/2]

template<typename AFIELD >
void AFopr_Sign< AFIELD >::set_parameters ( const int  Np,
const real_t  x_min,
const real_t  x_max,
const int  Niter,
const real_t  Stop_cond 
)

Definition at line 125 of file afopr_Sign-tmpl.h.

◆ set_parameters() [2/2]

template<typename AFIELD >
void AFopr_Sign< AFIELD >::set_parameters ( const Parameters params)
virtual

sets parameters by a Parameter object: to be implemented in a subclass.

Reimplemented from AFopr< AFIELD >.

Definition at line 88 of file afopr_Sign-tmpl.h.

◆ sign_zolotarev()

template<typename AFIELD >
AFIELD::real_t AFopr_Sign< AFIELD >::sign_zolotarev ( const real_t  x)
private

Definition at line 351 of file afopr_Sign-tmpl.h.

◆ subtract_lowmodes()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::subtract_lowmodes ( AFIELD w)
private

Definition at line 319 of file afopr_Sign-tmpl.h.

◆ tidyup()

template<typename AFIELD >
void AFopr_Sign< AFIELD >::tidyup
private

Definition at line 80 of file afopr_Sign-tmpl.h.

Member Data Documentation

◆ class_name

template<typename AFIELD >
const std::string AFopr_Sign< AFIELD >::class_name = "AFopr_Sign"
static

Definition at line 63 of file afopr_Sign.h.

◆ m_bl

template<typename AFIELD >
std::vector<real_t> AFopr_Sign< AFIELD >::m_bl
private

Definition at line 83 of file afopr_Sign.h.

◆ m_cl

template<typename AFIELD >
std::vector<real_t> AFopr_Sign< AFIELD >::m_cl
private

Definition at line 82 of file afopr_Sign.h.

◆ m_ev

template<typename AFIELD >
std::vector<real_t>* AFopr_Sign< AFIELD >::m_ev
private

Definition at line 88 of file afopr_Sign.h.

◆ m_fopr

template<typename AFIELD >
AFOPR* AFopr_Sign< AFIELD >::m_fopr
private

Definition at line 77 of file afopr_Sign.h.

◆ m_mode

template<typename AFIELD >
std::string AFopr_Sign< AFIELD >::m_mode
private

Definition at line 75 of file afopr_Sign.h.

◆ m_Nex

template<typename AFIELD >
int AFopr_Sign< AFIELD >::m_Nex
private

Definition at line 80 of file afopr_Sign.h.

◆ m_Nin

template<typename AFIELD >
int AFopr_Sign< AFIELD >::m_Nin
private

Definition at line 80 of file afopr_Sign.h.

◆ m_Niter

template<typename AFIELD >
int AFopr_Sign< AFIELD >::m_Niter
private

max iteration of shiftsolver

Definition at line 70 of file afopr_Sign.h.

◆ m_Np

template<typename AFIELD >
int AFopr_Sign< AFIELD >::m_Np
private

number of poles in rational approx.

Definition at line 67 of file afopr_Sign.h.

◆ m_Nsbt

template<typename AFIELD >
int AFopr_Sign< AFIELD >::m_Nsbt
private

Definition at line 87 of file afopr_Sign.h.

◆ m_Nvol

template<typename AFIELD >
int AFopr_Sign< AFIELD >::m_Nvol
private

Definition at line 80 of file afopr_Sign.h.

◆ m_sigma

template<typename AFIELD >
std::vector<real_t> AFopr_Sign< AFIELD >::m_sigma
private

Definition at line 84 of file afopr_Sign.h.

◆ m_solver

template<typename AFIELD >
AShiftsolver_CG<AFIELD, AFOPR>* AFopr_Sign< AFIELD >::m_solver
private

Definition at line 92 of file afopr_Sign.h.

◆ m_Stop_cond

template<typename AFIELD >
real_t AFopr_Sign< AFIELD >::m_Stop_cond
private

stopping condition of shift solver

Definition at line 71 of file afopr_Sign.h.

◆ m_vk

template<typename AFIELD >
std::vector<AFIELD>* AFopr_Sign< AFIELD >::m_vk
private

Definition at line 89 of file afopr_Sign.h.

◆ m_vl

template<typename AFIELD >
Bridge::VerboseLevel AFopr_Sign< AFIELD >::m_vl
private

Definition at line 73 of file afopr_Sign.h.

◆ m_w1

template<typename AFIELD >
AFIELD AFopr_Sign< AFIELD >::m_w1
private

Definition at line 96 of file afopr_Sign.h.

◆ m_x_max

template<typename AFIELD >
real_t AFopr_Sign< AFIELD >::m_x_max
private

upper range of approximate sign function

Definition at line 69 of file afopr_Sign.h.

◆ m_x_min

template<typename AFIELD >
real_t AFopr_Sign< AFIELD >::m_x_min
private

lower range of approximate sign function

Definition at line 68 of file afopr_Sign.h.

◆ m_xq

template<typename AFIELD >
std::vector<AFIELD> AFopr_Sign< AFIELD >::m_xq
private

Definition at line 93 of file afopr_Sign.h.


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