TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::Property::EnergyResolvedProperty< DataType > Class Template Reference

Base class for energy resolved Properties. More...

#include <EnergyResolvedProperty.h>

Inheritance diagram for TBTK::Property::EnergyResolvedProperty< DataType >:
TBTK::Property::AbstractProperty< DataType > TBTK::Property::Property TBTK::Serializable TBTK::Streamable

Public Types

enum  EnergyType { Real, FermionicMatsubara, BosonicMatsubara }
 
- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 

Public Member Functions

 EnergyResolvedProperty ()
 
 EnergyResolvedProperty (double lowerBound, double upperBound, unsigned int resolution)
 
 EnergyResolvedProperty (double lowerBound, double upperBound, unsigned int resolution, const DataType *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 DataType *data)
 
 EnergyResolvedProperty (const IndexTree &indexTree, double lowerBound, double upperBound, unsigned int resolution)
 
 EnergyResolvedProperty (const IndexTree &indexTree, double lowerBound, double upperBound, unsigned int resolution, const DataType *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 DataType *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< DataType >
unsigned int getBlockSize () const
 
unsigned int getSize () const
 
const std::vector< DataType > & getData () const
 
std::vector< DataType > & 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< DataType > > toSparseMatrices (const Model &model) const
 
virtual const DataType & operator() (const Index &index, unsigned int offset=0) const
 
virtual DataType & operator() (const Index &index, unsigned int offset=0)
 
DataType & operator() (const std::initializer_list< Subindex > &index)
 
const DataType & operator() (const std::initializer_list< Subindex > &index) const
 
virtual const DataType & operator() (unsigned int offset) const
 
virtual DataType & operator() (unsigned int offset)
 
void setAllowIndexOutOfBoundsAccess (bool allowIndexOutOfBoundsAccess)
 
void setDefaultValue (const DataType &defaultValue)
 
void replaceValues (const DataType &targetValue, const DataType &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)
 
template<>
unsigned int deserialize (const std::string &serialization, Mode mode)
 
template<>
double deserialize (const std::string &serialization, Mode mode)
 
template<>
std::complex< double > deserialize (const std::string &serialization, Mode mode)
 
template<>
SpinMatrix deserialize (const std::string &serialization, Mode mode)
 
template<>
Statistics deserialize (const std::string &serialization, Mode mode)
 
template<>
std::vector< std::complex< double > > deserialize (const std::string &serialization, Mode mode)
 

Protected Member Functions

EnergyResolvedPropertyoperator+= (const EnergyResolvedProperty &rhs)
 
EnergyResolvedPropertyoperator-= (const EnergyResolvedProperty &rhs)
 
EnergyResolvedPropertyoperator*= (const DataType &rhs)
 
EnergyResolvedPropertyoperator/= (const DataType &rhs)
 
- Protected Member Functions inherited from TBTK::Property::AbstractProperty< DataType >
 AbstractProperty ()
 
 AbstractProperty (unsigned int blockSize)
 
 AbstractProperty (unsigned int blockSize, const DataType *data)
 
 AbstractProperty (const std::vector< int > &ranges, unsigned int blockSize)
 
 AbstractProperty (const std::vector< int > &ranges, unsigned int blockSize, const DataType *data)
 
 AbstractProperty (const IndexTree &indexTree, unsigned int blockSize)
 
 AbstractProperty (const IndexTree &indexTree, unsigned int blockSize, const DataType *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 DataType &rhs)
 
AbstractPropertyoperator/= (const DataType &rhs)
 
- Protected Member Functions inherited from TBTK::Property::Property
 Property ()
 
virtual ~Property ()
 

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)
 
- 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

template<typename DataType>
class TBTK::Property::EnergyResolvedProperty< DataType >

Base class for energy resolved Properties.

The EnergyResolvedProperty is a base class for energy dependent Properties. For more information about specific EnergyDependentProperties, see:

Block structure

If the EnergyResolvedProperty has no Index structure, it contains a single block, otherwise it contains one block per Index. Inside of a block, values are stored for a range of energies. See AbstractProperty for more information about blocks.

EnergyType

The EnergyResolvedProperty can have one of three different energy types. Depending on the EnergyType, different member functions are usefull. It is possible to get the EnergyType using

= energyResolvedProperty.getEnergyType();

EnergyResolvedProperty<DataType>::EnergyType::Real

The data is stored for a range of real energies on a regular grid of on an interval [lowerBound, upperBound]. It is possible to get the lower and upper bound and the number of points with which the energy grid is resolved using

double lowerBound = energyResolvedProperty.getLowerBound();
double upperBound = energyResolvedProperty.getUpperBound();
unsigned int resolution = energyResolvedProperty.getResolution();

It is also possible to get the distance \(\Delta E\) between neighboring points and the energy for specific points on the grid using

double dE = energyResolvedProperty.getDeltaE();
double E = energyResolvedProperty.getEnergy(n);

EnergyResolvedProperty<DataType>::EnergyType::FermionicMatsubara

EnergyResolvedProperty<DataType>::EnergyType::BosonicMatsubara

Not yet publicly supported.

Member Enumeration Documentation

◆ EnergyType

template<typename DataType>
enum TBTK::Property::EnergyResolvedProperty::EnergyType
strong

Enum class for specifying the energy type.

Constructor & Destructor Documentation

◆ EnergyResolvedProperty() [1/10]

template<typename DataType >
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( )

Constructs an uninitialized EnergyResolvedProperty.

◆ EnergyResolvedProperty() [2/10]

template<typename DataType >
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( double  lowerBound,
double  upperBound,
unsigned int  resolution 
)

Constructs an EnergyResolvedProperty with real energies on the None format. [See AbstractProperty for detailed information about the None format.]

Parameters
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.

◆ EnergyResolvedProperty() [3/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( double  lowerBound,
double  upperBound,
unsigned int  resolution,
const DataType *  data 
)

Constructs an EnergyResolvedProperty with real energies on the None format. [See AbstractProperty for detailed information about the None format.]

Parameters
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.
dataRaw data to initialize the EnergyResolvedProperty with.

◆ EnergyResolvedProperty() [4/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( const std::vector< int > &  ranges,
double  lowerBound,
double  upperBound,
unsigned int  resolution 
)

Construct an EnergyResolvedProperty with real energies on the Ranges format. [See AbstractProperty for detailed information about the Ranges format.]

Parameters
rangesA list of upper limits for the ranges of the different dimensions. The nth dimension will have the range [0, ranges[n]).
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.

◆ EnergyResolvedProperty() [5/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( const std::vector< int > &  ranges,
double  lowerBound,
double  upperBound,
unsigned int  resolution,
const DataType *  data 
)

Construct an EnergyResolvedProperty with real energies on the Ranges format. [See AbstractProperty for detailed information about the Ranges format.]

Parameters
rangesA list of upper limits for the ranges of the different dimensions. The nth dimension will have the range [0, ranges[n]).
lowerBoundLower bound for the energy.
upperBoundUpper bound for the energy.
resolutionNumber of points to use for the energy.
dataRaw data to initialize the EnergyResolvedProperty with.

◆ EnergyResolvedProperty() [6/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( const IndexTree indexTree,
double  lowerBound,
double  upperBound,
unsigned int  resolution 
)

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

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

◆ EnergyResolvedProperty() [7/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( const IndexTree indexTree,
double  lowerBound,
double  upperBound,
unsigned int  resolution,
const DataType *  data 
)

Constructs an EnergyResolvedProperty with real energie 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 EnergyResolvedProperty 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 EnergyResolvedProperty with.

◆ EnergyResolvedProperty() [8/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( EnergyType  energyType,
const IndexTree indexTree,
int  lowerMatsubaraEnergyIndex,
int  upperMatsubaraEnergtIndex,
double  fundamentalMatsubaraEnergy 
)

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

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

◆ EnergyResolvedProperty() [9/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( EnergyType  energyType,
const IndexTree indexTree,
int  lowerMatsubaraEnergyIndex,
int  upperMatsubaraEnergtIndex,
double  fundamentalMatsubaraEnergy,
const DataType *  data 
)

Constructs an EnergyResolvedProperty 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 EnergyResolvedProperty 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 EnergyResolvedProperty with.

◆ EnergyResolvedProperty() [10/10]

template<typename DataType>
TBTK::Property::EnergyResolvedProperty< DataType >::EnergyResolvedProperty ( const std::string &  serialization,
Serializable::Mode  mode 
)

Constructor. Constructs the EnergyResolvedProperty from a serialization string.

Parameters
serializationSerialization string from which to construct the EnergyResolvedProperty.

Member Function Documentation

◆ energyWindowsAreEqual()

template<typename DataType >
bool TBTK::Property::EnergyResolvedProperty< DataType >::energyWindowsAreEqual ( const EnergyResolvedProperty< DataType > &  energyResolvedProperty,
double  precision = 1e-1 
) const
inline

Check whether the energy windows are equal. The energy windows are considered equal if the number of energies are equal and the upper and lower bounds (upper and lower Matsubara frequencies) are the same within a given relative precision.

Parameters
energyResolvedPropertyThe EnergyResolvedProperty to compare with.
precisionThe required precision with which the bounds must agree. A value of 1 means that the difference between the bounds must be no larger than the difference between two succesive energy points.
Returns
True if the energy windows are equal, otherwise false.

◆ getDeltaE()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getDeltaE ( ) const
inline

Get the step length \(\Delta E\) between neigboring energy indices.

Returns
The energy step length \(\Delta\).

◆ getEnergy()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getEnergy ( unsigned int  n) const
inline

Get the nth energy value.

Parameters
nThe energy index to get the energy for.
Returns
The energy for the nth energy index.

◆ getFundamentalMatsubaraEnergy()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getFundamentalMatsubaraEnergy ( ) const
inline

Get the fundamental Matsubara energy E_0 in the expression E = (l + 2*n)*E_0.

◆ getLowerBound()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getLowerBound ( ) const
inline

Get lower bound for the energy.

Returns
Lower bound for the energy.

◆ getLowerMatsubaraEnergy()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getLowerMatsubaraEnergy ( ) const
inline

Get the lower Matsubara energy.

Returns
The lowest Matsubara energy.

◆ getLowerMatsubaraEnergyIndex()

template<typename DataType >
int TBTK::Property::EnergyResolvedProperty< DataType >::getLowerMatsubaraEnergyIndex ( ) const
inline

Get the lower Matsubara energy index. That is, l in the expression E = (l + 2*n)*E_0.

Returns
The lowest Matsubara energy index.

◆ getMatsubaraEnergy()

template<typename DataType >
std::complex< double > TBTK::Property::EnergyResolvedProperty< DataType >::getMatsubaraEnergy ( unsigned int  n) const
inline

Get the nth Matsubara energy.

◆ getNumEnergies()

template<typename DataType >
unsigned int TBTK::Property::EnergyResolvedProperty< DataType >::getNumEnergies ( ) const
inline

Get the number of energies. The same as EnergyResolvedProperty::getResolution() for EnergyType::Real and EnergyResolvedProperty::getNumMatsubaraEnergies() for EnergyType::FermionicMatsubara and EnergyTpe::BosnicMatsubara.

Returns
The number of energies.

◆ getNumMatsubaraEnergies()

template<typename DataType >
unsigned int TBTK::Property::EnergyResolvedProperty< DataType >::getNumMatsubaraEnergies ( ) const
inline

Get the number of Matsubara energies.

Returns
The number of Matsubara energies.

◆ getResolution()

template<typename DataType >
unsigned int TBTK::Property::EnergyResolvedProperty< DataType >::getResolution ( ) const
inline

Get the energy resolution (number of points used for the energy axis).

Returns
The energy resolution.

◆ getUpperBound()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getUpperBound ( ) const
inline

Get upper bound for the energy.

Returns
Upper bound for the energy.

◆ getUpperMatsubaraEnergy()

template<typename DataType >
double TBTK::Property::EnergyResolvedProperty< DataType >::getUpperMatsubaraEnergy ( ) const
inline

Get the upper Matsubara energy.

Returns
The highest Matsubara energy.

◆ getUpperMatsubaraEnergyIndex()

template<typename DataType >
int TBTK::Property::EnergyResolvedProperty< DataType >::getUpperMatsubaraEnergyIndex ( ) const
inline

Get the upper Matsubara energy index. That is, l+N-1, where l is the lowest Matsubara energy index and N is the number of Matsubara energies.

Returns
The largest Matsubara energy index.

◆ operator*=()

template<typename DataType>
EnergyResolvedProperty< DataType > & TBTK::Property::EnergyResolvedProperty< DataType >::operator*= ( const DataType &  rhs)
inlineprotected

◆ operator+=()

template<typename DataType >
EnergyResolvedProperty< DataType > & TBTK::Property::EnergyResolvedProperty< DataType >::operator+= ( const EnergyResolvedProperty< DataType > &  rhs)
inlineprotected

◆ operator-=()

template<typename DataType >
EnergyResolvedProperty< DataType > & TBTK::Property::EnergyResolvedProperty< DataType >::operator-= ( const EnergyResolvedProperty< DataType > &  rhs)
inlineprotected

◆ operator/=()

template<typename DataType>
EnergyResolvedProperty< DataType > & TBTK::Property::EnergyResolvedProperty< DataType >::operator/= ( const DataType &  rhs)
inlineprotected

◆ serialize()

template<typename DataType >
std::string TBTK::Property::EnergyResolvedProperty< DataType >::serialize ( Serializable::Mode  mode) const
inlinevirtual

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