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

#include <SpinorMatrix.hpp>

Public Member Functions

 SpinorMatrix (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.
 
SpinorMatrix< T > & drop_g ()
 Kills g parts of spinor matrix, in place!
 
SpinorMatrix< T > & create_g ()
 Creates g parts of spinor matrix - will have value 0.
 
SpinorMatrix< T > & operator+= (const SpinorMatrix< T > &rhs)
 Matrix adition +,-.
 
SpinorMatrix< T > & operator-= (const SpinorMatrix< T > &rhs)
 Matrix adition +,-.
 
SpinorMatrix< T > & operator*= (const T x)
 Scalar multiplication.
 
SpinorMatrix< T > & operator+= (T aI)
 Adition of identity: Matrix<T> += T : T assumed to be *Identity!
 
SpinorMatrix< T > & operator-= (T aI)
 Adition of identity: Matrix<T> -= T : T assumed to be *Identity!
 
SpinorMatrix< T > & mult_elements_by (const SpinorMatrix< T > &rhs)
 Multiply elements (in place): Gij -> Gij*Bij.
 
SpinorMatrix< T > & mult_elements_by (const RadialMatrix< T > &rhs)
 Multiply elements (in place): Gij -> Gij*Bij.
 
SpinorMatrix< T > conj () const
 Returns conjugate of matrix.
 
SpinorMatrix< double > real () const
 Returns real part of complex matrix (changes type; returns a real matrix)
 
SpinorMatrix< double > imag () const
 Returns imag part of complex matrix (changes type; returns a real matrix)
 
SpinorMatrix< std::complex< double > > complex () const
 Converts a real to complex matrix (changes type; returns a complex matrix)
 
SpinorMatrix< T > & invert_in_place ()
 Inversion (in place)
 
SpinorMatrix< T > inverse () const
 Returns inverse of matrix; original matrix unchanged.
 
SpinorMatrix< T > & drj_in_place ()
 Multiplies by drj: Q_ij -> Q_ij*dr_j, in place.
 
SpinorMatrix< T > & dri_in_place ()
 Multiplies by dri: Q_ij -> Q_ij*dr_i, in place.
 
SpinorMatrix< T > drj () const
 Multiplies by drj: Q_ij -> Q_ij*dr_j. Returns new matrix (orig unchanged)
 
SpinorMatrix< 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 SpinorMatrix operator on DiracSpinor. Inludes Integration: G*F = Int[G(r,r')*F(r') dr'] = sum_j G_ij*F_j*drdu_j*du.
 

Friends

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

Detailed Description

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

Defines SpinorMatrix, 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.

SpinorMatrix is a 2*2 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.

SpinorMatrix = {ff fg} {gf gg} SpinorMatrix * 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 SpinorMatrix 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: