ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
Public Member Functions | Friends | List of all members
MBPT::RDMatrix< T >

#include <RDMatrix.hpp>

Public Member Functions

 RDMatrix (std::size_t i0, std::size_t stride, std::size_t size, bool incl_g, std::shared_ptr< const Grid > rgrid)
 
T & ff (std::size_t i, std::size_t j)
 direct access to matrix elements
 
T & fg (std::size_t i, std::size_t j)
 
T & gf (std::size_t i, std::size_t j)
 
T & gg (std::size_t i, std::size_t j)
 
const T ff (std::size_t i, std::size_t j) const
 
const T fg (std::size_t i, std::size_t j) const
 
const T gf (std::size_t i, std::size_t j) const
 
const T gg (std::size_t i, std::size_t j) const
 
const LinAlg::Matrix< T > & ff () const
 direct access to matrix's
 
const LinAlg::Matrix< T > & fg () const
 
const LinAlg::Matrix< T > & gf () const
 
const LinAlg::Matrix< T > & gg () const
 
LinAlg::Matrix< T > & ff ()
 
LinAlg::Matrix< T > & fg ()
 
LinAlg::Matrix< T > & gf ()
 
LinAlg::Matrix< T > & gg ()
 
std::size_t size () const
 
std::size_t g_size () const
 
bool includes_g () const
 
std::size_t i0 () const
 
std::size_t stride () const
 
void zero ()
 Sets all matrix elements to zero.
 
void make_identity ()
 
RDMatrix< T > & plusIdent (T a=T{1.0})
 
RDMatrix< T > & operator+= (const RDMatrix< T > &rhs)
 Matrix adition +,-.
 
RDMatrix< T > & operator-= (const RDMatrix< T > &rhs)
 Matrix adition +,-.
 
RDMatrix< T > & operator*= (const T x)
 Scalar multiplication.
 
RDMatrix< T > & operator+= (T aI)
 Adition of identity: Matrix<T> += T : T assumed to be *Identity!
 
RDMatrix< T > & operator-= (T aI)
 Adition of identity: Matrix<T> -= T : T assumed to be *Identity!
 
RDMatrix< T > & mult_elements_by (const RDMatrix< T > &rhs)
 Multiply elements (in place): Gij -> Gij*Bij.
 
RDMatrix< T > conj () const
 Returns conjugate of matrix.
 
RDMatrix< double > real () const
 Returns real part of complex matrix (changes type; returns a real matrix)
 
RDMatrix< double > imag () const
 Returns imag part of complex matrix (changes type; returns a real matrix)
 
RDMatrix< std::complex< double > > complex () const
 Converts a real to complex matrix (changes type; returns a complex matrix)
 
RDMatrix< T > & invert_in_place ()
 Inversion (in place)
 
RDMatrix< T > inverse () const
 Returns inverse of matrix; original matrix unchanged.
 
RDMatrix< T > & drj_in_place ()
 Multiplies by drj: Q_ij -> Q_ij*dr_j, in place.
 
RDMatrix< T > & dri_in_place ()
 Multiplies by dri: Q_ij -> Q_ij*dr_i, in place.
 
RDMatrix< T > drj () const
 Multiplies by drj: Q_ij -> Q_ij*dr_j. Returns new matrix (orig unchanged)
 
RDMatrix< T > dri () const
 Multiplies by dri: Q_ij -> Q_ij*dr_i. Returns new matrix (orig unchanged)
 
double dr (std::size_t sub_index) const
 returns dr at position along sub grid
 
std::size_t index_to_fullgrid (std::size_t i) const
 Converts an index on the sub-grid to the full grid.
 
void add (const DiracSpinor &ket, const DiracSpinor &bra, T k=T(1.0))
 Adds k*|ket><bra| to matrix (used for building Green's functions)
 
DiracSpinor operator* (const DiracSpinor &Fn) const
 Action of RDMatrix operator on DiracSpinor. Inludes Integration: G*F = Int[G(r,r')*F(r') dr'] = sum_j G_ij*F_j*drdu_j*du.
 

Friends

RDMatrix< T > operator+ (RDMatrix< T > lhs, const RDMatrix< T > &rhs)
 Matrix adition +,-.
 
RDMatrix< T > operator- (RDMatrix< T > lhs, const RDMatrix< T > &rhs)
 Matrix adition +,-.
 
RDMatrix< T > operator* (const T x, RDMatrix< T > rhs)
 Scalar multiplication.
 
RDMatrix< T > operator+ (RDMatrix< T > M, T aI)
 Adition of identity: Matrix<T> + T : T assumed to be *Identity!
 
RDMatrix< T > operator- (RDMatrix< T > M, T aI)
 Adition of identity: Matrix<T> - T : T assumed to be *Identity!
 
RDMatrix< T > operator* (const RDMatrix< T > &a, const RDMatrix< T > &b)
 Matrix multplication: C=A*B := Cij = \sum_k Aik*Bkj. Note: integration measure not included: call .drj() first to include it!
 
RDMatrix< T > mult_elements (RDMatrix< T > lhs, const RDMatrix< T > &rhs)
 Multiply elements (new matrix): Gij = Aij*Bij.
 
std::ostream & operator<< (std::ostream &os, const RDMatrix< T > &a)
 

Detailed Description

template<typename T>
class MBPT::RDMatrix< T >

Defines RDMatrix, Radial Dirac (Spinor) matrix. Designed to store Greens-function like operators: |Fa><Fb| (where Fa, Fb are radial Dirac spinors), as a radial matrix. The matrix is stored on a sub-grid (between r0 and rmax), with a specified stride.

RDMatrix is a 4*4 matrix in spinor space {ff, fg, gf, gg} - the g blocks are small and are optional. Each block is an N*N radial matrix, where N is a subset of the number of points along the full radial grid. May store doubles or complex doubles.

RDMatrix = {ff fg} {gf gg} RDMatrix * F = {ff fg} * (f) {gf gg} (g) = (ff(r,r')*f(r') + fg(r,r')*g(r')) (gf(r,r')*f(r') + gg(r,r')*g(r'))

Note: Careful to distinguish RDMatrix multiplication/integration: G1 * G2 = Int G1(ra,rb)*G2(rb,rc) = Sum_j G1(i,j)*G2(j,k)

G1.drj() * G2 = Int G1(ra,rb)*G2(rb,rc)*dr_b = Sum_j G1(i,j)*G2(j,k)*drdu_j*du = G1 * G2.dri()

While almost always symmetric, this doesn't assume that.


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