TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::Property::GreensFunction Class Reference

Property container for the Green's function. More...

#include <GreensFunction.h>

Inheritance diagram for TBTK::Property::GreensFunction:
TBTK::Property::EnergyResolvedProperty< std::complex< double > > TBTK::Property::AbstractProperty< std::complex< double > > TBTK::Property::Property TBTK::Serializable TBTK::Streamable

Public Types

enum  Type {
  TimeOrdered, Advanced, Retarded, Principal,
  NonPrincipal, Matsubara
}
 
- Public Types inherited from TBTK::Property::EnergyResolvedProperty< std::complex< double > >
enum  EnergyType
 
- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 

Public Member Functions

 GreensFunction ()
 
 GreensFunction (const IndexTree &indexTree, Type type, double lowerBound, double upperBound, unsigned int resolution)
 
 GreensFunction (const IndexTree &indexTree, Type type, double lowerBound, double upperBound, unsigned int resolution, const std::complex< double > *data)
 
 GreensFunction (const IndexTree &indexTree, int lowerMatsubaraEnergyIndex, int upperMatsubaraEnergyIndex, double fundamentalMatsubaraEnergy)
 
 GreensFunction (const IndexTree &indexTree, int lowerMatsubaraEnergyIndex, int upperMatsubaraEnergyIndex, double fundamentalMatsubaraEnergy, const std::complex< double > *data)
 
GreensFunctionoperator+= (const GreensFunction &rhs)
 
GreensFunction operator+ (const GreensFunction &rhs) const
 
GreensFunctionoperator-= (const GreensFunction &rhs)
 
GreensFunction operator- (const GreensFunction &rhs) const
 
GreensFunctionoperator*= (const std::complex< double > &rhs)
 
GreensFunction operator* (const std::complex< double > &rhs) const
 
GreensFunctionoperator/= (const std::complex< double > &rhs)
 
GreensFunction operator/ (const std::complex< double > &rhs) const
 
Type getType () const
 
std::string toString () const
 
- Public Member Functions inherited from TBTK::Property::EnergyResolvedProperty< std::complex< double > >
 EnergyResolvedProperty ()
 
 EnergyResolvedProperty (double lowerBound, double upperBound, unsigned int resolution)
 
 EnergyResolvedProperty (double lowerBound, double upperBound, unsigned int resolution, const std::complex< double > *data)
 
 EnergyResolvedProperty (const std::vector< int > &ranges, double lowerBound, double upperBound, unsigned int resolution)
 
 EnergyResolvedProperty (const std::vector< int > &ranges, double lowerBound, double upperBound, unsigned int resolution, const std::complex< double > *data)
 
 EnergyResolvedProperty (const IndexTree &indexTree, double lowerBound, double upperBound, unsigned int resolution)
 
 EnergyResolvedProperty (const IndexTree &indexTree, double lowerBound, double upperBound, unsigned int resolution, const std::complex< double > *data)
 
 EnergyResolvedProperty (EnergyType energyType, const IndexTree &indexTree, int lowerMatsubaraEnergyIndex, int upperMatsubaraEnergtIndex, double fundamentalMatsubaraEnergy)
 
 EnergyResolvedProperty (EnergyType energyType, const IndexTree &indexTree, int lowerMatsubaraEnergyIndex, int upperMatsubaraEnergtIndex, double fundamentalMatsubaraEnergy, const std::complex< double > *data)
 
 EnergyResolvedProperty (const std::string &serialization, Serializable::Mode mode)
 
EnergyType getEnergyType () const
 
double getLowerBound () const
 
double getUpperBound () const
 
unsigned int getResolution () const
 
double getDeltaE () const
 
double getEnergy (unsigned int n) const
 
int getLowerMatsubaraEnergyIndex () const
 
int getUpperMatsubaraEnergyIndex () const
 
unsigned int getNumMatsubaraEnergies () const
 
double getFundamentalMatsubaraEnergy () const
 
double getLowerMatsubaraEnergy () const
 
double getUpperMatsubaraEnergy () const
 
std::complex< double > getMatsubaraEnergy (unsigned int n) const
 
unsigned int getNumEnergies () const
 
bool energyWindowsAreEqual (const EnergyResolvedProperty &energyResolvedProperty, double precision=1e-1) const
 
virtual std::string serialize (Serializable::Mode mode) const
 
- Public Member Functions inherited from TBTK::Property::AbstractProperty< std::complex< double > >
unsigned int getBlockSize () const
 
unsigned int getSize () const
 
const std::vector< std::complex< double > > & getData () const
 
std::vector< std::complex< double > > & getDataRW ()
 
unsigned int getDimensions () const
 
std::vector< int > getRanges () const
 
int getOffset (const Index &index) const
 
const IndexDescriptorgetIndexDescriptor () const
 
bool contains (const Index &index) const
 
void reduce (const std::vector< Index > &targetPatterns, const std::vector< Index > &newPatterns)
 
void hermitianConjugate ()
 
std::vector< SparseMatrix< std::complex< double > > > toSparseMatrices (const Model &model) const
 
virtual const std::complex< double > & operator() (const Index &index, unsigned int offset=0) const
 
virtual std::complex< double > & operator() (const Index &index, unsigned int offset=0)
 
std::complex< double > & operator() (const std::initializer_list< Subindex > &index)
 
const std::complex< double > & operator() (const std::initializer_list< Subindex > &index) const
 
virtual const std::complex< double > & operator() (unsigned int offset) const
 
virtual std::complex< double > & operator() (unsigned int offset)
 
void setAllowIndexOutOfBoundsAccess (bool allowIndexOutOfBoundsAccess)
 
void setDefaultValue (const std::complex< double > &defaultValue)
 
void replaceValues (const std::complex< double > &targetValue, const std::complex< double > &replacementValue)
 
virtual std::string toString () const
 
- Public Member Functions inherited from TBTK::Serializable
template<>
std::string serialize (const bool &data, Mode mode)
 
template<>
std::string serialize (const double &data, Mode mode)
 
template<>
std::string serialize (const std::complex< double > &data, Mode mode)
 
template<>
std::string serialize (const int &data, Mode mode)
 
template<>
std::string serialize (const unsigned int &data, Mode mode)
 
template<>
std::string serialize (const SpinMatrix &data, Mode mode)
 
template<>
std::string serialize (const Statistics &data, Mode mode)
 
template<>
std::string serialize (const std::vector< std::complex< double >> &data, Mode mode)
 
template<>
int deserialize (const std::string &serialization, Mode mode)
 

Friends

GreensFunction operator* (const std::complex< double > &lhs, const GreensFunction &rhs)
 

Additional Inherited Members

- Static Public Member Functions inherited from TBTK::Serializable
static bool hasID (const std::string &serialization, Mode mode)
 
static std::string getID (const std::string &serialization, Mode mode)
 
static std::string extractComponent (const std::string &serialization, const std::string &containerID, const std::string &componentID, const std::string &componentName, Mode mode)
 
- Protected Member Functions inherited from TBTK::Property::EnergyResolvedProperty< std::complex< double > >
EnergyResolvedPropertyoperator+= (const EnergyResolvedProperty &rhs)
 
EnergyResolvedPropertyoperator-= (const EnergyResolvedProperty &rhs)
 
EnergyResolvedPropertyoperator*= (const std::complex< double > &rhs)
 
EnergyResolvedPropertyoperator/= (const std::complex< double > &rhs)
 
- Protected Member Functions inherited from TBTK::Property::AbstractProperty< std::complex< double > >
 AbstractProperty ()
 
 AbstractProperty (unsigned int blockSize)
 
 AbstractProperty (unsigned int blockSize, const std::complex< double > *data)
 
 AbstractProperty (const std::vector< int > &ranges, unsigned int blockSize)
 
 AbstractProperty (const std::vector< int > &ranges, unsigned int blockSize, const std::complex< double > *data)
 
 AbstractProperty (const IndexTree &indexTree, unsigned int blockSize)
 
 AbstractProperty (const IndexTree &indexTree, unsigned int blockSize, const std::complex< double > *data)
 
 AbstractProperty (const AbstractProperty &abstractProperty)
 
 AbstractProperty (AbstractProperty &&abstractProperty)
 
 AbstractProperty (const std::string &serialization, Mode mode)
 
virtual ~AbstractProperty ()
 
AbstractPropertyoperator= (const AbstractProperty &abstractProperty)
 
AbstractPropertyoperator= (AbstractProperty &&abstractProperty)
 
AbstractPropertyoperator+= (const AbstractProperty &rhs)
 
AbstractPropertyoperator-= (const AbstractProperty &rhs)
 
AbstractPropertyoperator*= (const std::complex< double > &rhs)
 
AbstractPropertyoperator/= (const std::complex< double > &rhs)
 
- Protected Member Functions inherited from TBTK::Property::Property
 Property ()
 
virtual ~Property ()
 
- Static Protected Member Functions inherited from TBTK::Serializable
static bool validate (const std::string &serialization, const std::string &id, Mode mode)
 
static std::string getContent (const std::string &serialization, Mode mode)
 
static std::vector< std::string > split (const std::string &content, Mode mode)
 
template<typename DataType >
static std::enable_if<!std::is_pointer< DataType >::value, std::string >::type serialize (const DataType &data, Mode mode)
 
template<typename DataType >
static std::enable_if< std::is_pointer< DataType >::value, std::string >::type serialize (const DataType &data, Mode mode)
 
template<typename DataType >
static DataType deserialize (const std::string &serialization, Mode mode)
 
static std::string extract (const std::string &serialization, Mode mode, std::string component)
 

Detailed Description

Property container for the Green's function.

The GreensFunction is an EnergyResolvedProperty with DataType std::complex<double>.

Example

#include "TBTK/PropertyExtractor/Diagonalizer.h"
#include "TBTK/Streams.h"
#include "TBTK/TBTK.h"
using namespace TBTK;
int main(){
const unsigned int SIZE_X = 10;
const unsigned int SIZE_Y = 10;
double t = 1;
Model model = Models::SquareLattice({SIZE_X, SIZE_Y}, {0, t});
model.construct();
solver.setModel(model);
solver.run();
const double LOWER_BOUND = -5;
const double UPPER_BOUND = 5;
const unsigned int RESOLUTION = 100;
PropertyExtractor::Diagonalizer propertyExtractor(solver);
propertyExtractor.setEnergyWindow(
LOWER_BOUND,
UPPER_BOUND,
RESOLUTION
);
Property::GreensFunction greensFunction
= propertyExtractor.calculateGreensFunction({
{{5, 5}, {5, 5}}
});
Streams::out << greensFunction << "\n";
Streams::out << "greensFunction({{5, 5}, {5, 5}}, 50) = "
<< greensFunction({{5, 5}, {5, 5}}, 50) << "\n";
}

Output

EnergyType: Real
Lower bound: -5 eV (-5 n.u.)
Upper bound: 5 eV (5 n.u.)
Resolution: 100
greensFunction({{5, 5}, {5, 5}}, 50) = (2.64575,-0.0545233)

Member Enumeration Documentation

◆ Type

Enum class for specifying the Green's function type.

Constructor & Destructor Documentation

◆ GreensFunction() [1/5]

TBTK::Property::GreensFunction::GreensFunction ( )

Constructs an uninitialized GreensFunction.

◆ GreensFunction() [2/5]

TBTK::Property::GreensFunction::GreensFunction ( const IndexTree indexTree,
Type  type,
double  lowerBound,
double  upperBound,
unsigned int  resolution 
)

Constructs a GreensFunction with real energies on the Custom format. [See AbstractProperty for detailed information about the Custom format.]

Parameters
indexTreeIndexTree containing the Indices for which the GreensFunction should be contained.
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.

◆ GreensFunction() [3/5]

TBTK::Property::GreensFunction::GreensFunction ( const IndexTree indexTree,
Type  type,
double  lowerBound,
double  upperBound,
unsigned int  resolution,
const std::complex< double > *  data 
)

Constructs a GreensFunction with real energies on the Custom format and initializes it with data. [See AbstractProperty for detailed information about the Custom format and the raw data format.]

Parameters
indexTreeIndexTree containing the Indices for which the GreensFunction should be contained.
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.
dataRaw data to initialize the GreensFunction with.

◆ GreensFunction() [4/5]

TBTK::Property::GreensFunction::GreensFunction ( const IndexTree indexTree,
int  lowerMatsubaraEnergyIndex,
int  upperMatsubaraEnergyIndex,
double  fundamentalMatsubaraEnergy 
)

Constructs a GreensFunction with Matsubara energies on the Custom format. [See AbstractProperty for detailed information about the Custom format.]

Parameters
indexTreeIndexTree containing the Indices for which the GreensFunction should be contained.
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.

◆ GreensFunction() [5/5]

TBTK::Property::GreensFunction::GreensFunction ( const IndexTree indexTree,
int  lowerMatsubaraEnergyIndex,
int  upperMatsubaraEnergyIndex,
double  fundamentalMatsubaraEnergy,
const std::complex< double > *  data 
)

Constructs a GreensFunction with Matsubara energies on the Custom format and initializes it with data. [See AbstractProperty for detailed information about the Custom format and the raw data format.]

Parameters
indexTreeIndexTree containing the Indices for which the GreensFunction should be contained.
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.
dataRaw data to initialize the GreensFunction with.

Member Function Documentation

◆ getType()

GreensFunction::Type TBTK::Property::GreensFunction::getType ( ) const
inline

Get the Green's function type.

Returns
The Green's function type.

◆ operator*()

GreensFunction TBTK::Property::GreensFunction::operator* ( const std::complex< double > &  rhs) const
inline

Multiplication operator.

Parameters
rhsThe right hand side of the equation.
Returns
A new GreensFunction that is the product of the GreensFunction and the right hand side.

◆ operator*=()

GreensFunction & TBTK::Property::GreensFunction::operator*= ( const std::complex< double > &  rhs)
inline

◆ operator+()

GreensFunction TBTK::Property::GreensFunction::operator+ ( const GreensFunction rhs) const
inline

Addition operator.

Parameters
rhsThe right hand side of the equation.
Returns
A new GreensFunction that is the sum of this GreensFunction and the right hand side.

◆ operator+=()

GreensFunction & TBTK::Property::GreensFunction::operator+= ( const GreensFunction rhs)
inline

◆ operator-()

GreensFunction TBTK::Property::GreensFunction::operator- ( const GreensFunction rhs) const
inline

Subtraction operator.

Parameters
rhsThe right hand side of the equation.
Returns
A new GreensFunction that is the difference between this GreensFunction and the right hand side.

◆ operator-=()

GreensFunction & TBTK::Property::GreensFunction::operator-= ( const GreensFunction rhs)
inline

◆ operator/()

GreensFunction TBTK::Property::GreensFunction::operator/ ( const std::complex< double > &  rhs) const
inline

Division operator.

Parameters
rhsThe right hand side of the equation.
Returns
A new GreensFunction that is the quotient between the GreensFunction and the right hand side.

◆ operator/=()

GreensFunction & TBTK::Property::GreensFunction::operator/= ( const std::complex< double > &  rhs)
inline

◆ toString()

std::string TBTK::Property::GreensFunction::toString ( ) const
virtual

Implements Streamable::toString().

Implements TBTK::Streamable.

Friends And Related Function Documentation

◆ operator*

GreensFunction operator* ( const std::complex< double > &  lhs,
const GreensFunction rhs 
)
friend

Multiplication operator.

Parameters
lhsThe left hand side of the equation.
rhsThe right hand side of the equation.
Returns
A new GreensFunction that is the product of the left hand side and the GreensFunction.

The documentation for this class was generated from the following file:
TBTK::Model
Container of Model related information.
Definition: Model.h:57
TBTK::Solver::Diagonalizer
Solves a Model using diagonalization.
Definition: Diagonalizer.h:52
Streams.h
Streams for TBTK output.
TBTK::PropertyExtractor::Diagonalizer
Extracts physical properties from the Solver::Diagonalizer.
Definition: Diagonalizer.h:55
TBTK::Solver::Diagonalizer::run
void run()
Diagonalizer.h
Solves a Model using diagonalization.
TBTK::Initialize
void Initialize()
TBTK::Solver::Solver::setModel
virtual void setModel(Model &model)
Definition: Solver.h:69
TBTK::Property::GreensFunction::GreensFunction
GreensFunction()
TBTK::Property::GreensFunction
Property container for the Green's function.
Definition: GreensFunction.h:44
SquareLattice.h
Square lattice model.
GreensFunction.h
Property container for the Green's function.
TBTK::Streams::out
static std::ostream out
Definition: Streams.h:70
TBTK::Property::EnergyResolvedProperty< std::complex< double > >::EnergyType
EnergyType
Definition: EnergyResolvedProperty.h:86
TBTK.h
TBTK initialization.
TBTK::Model::construct
void construct()
TBTK::Models::SquareLattice
Square lattice model.
Definition: SquareLattice.h:60