TBTK
TBTK::Model Class Reference

Container of Model related information. More...

#include <Model.h>

Inheritance diagram for TBTK::Model:
TBTK::Serializable TBTK::Communicator

Public Member Functions

 Model ()
 
 Model (const std::vector< unsigned int > &capacity)
 
 Model (const Model &model)
 
 Model (Model &&model)
 
 Model (const std::string &serialization, Mode mode)
 
virtual ~Model ()
 
Modeloperator= (const Model &rhs)
 
Modeloperator= (Model &&rhs)
 
void add (HoppingAmplitude ha)
 
void addModel (const Model &model, const Index &subsytemIndex)
 
int getBasisIndex (const Index &index) const
 
int getBasisSize () const
 
void construct ()
 
bool getIsConstructed ()
 
void sortHoppingAmplitudes ()
 
void constructCOO ()
 
void destructCOO ()
 
void reconstructCOO ()
 
void setTemperature (double temperature)
 
double getTemperature () const
 
void setChemicalPotential (double chemicalPotential)
 
double getChemicalPotential () const
 
void setStatistics (Statistics statistics)
 
Statistics getStatistics () const
 
const HoppingAmplitudeSetgetHoppingAmplitudeSet () const
 
const SourceAmplitudeSetgetSourceAmplitudeSet () const
 
void createGeometry (int dimensions, int numSpecifiers=0)
 
GeometrygetGeometry ()
 
const GeometrygetGeometry () const
 
void createManyParticleContext ()
 
ManyParticleContextgetManyParticleContext ()
 
void setFilter (const AbstractHoppingAmplitudeFilter &hoppingAmplitudeFilter)
 
void setFilter (const AbstractIndexFilter &indexFilter)
 
Modeloperator<< (const HoppingAmplitude &hoppingAmplitude)
 
Modeloperator<< (const std::tuple< HoppingAmplitude, HoppingAmplitude > &hoppingAmplitudes)
 
Modeloperator<< (const HoppingAmplitudeList &hoppingAmplitudeList)
 
Modeloperator<< (const SourceAmplitude &sourceAmplitude)
 
std::string serialize (Mode mode) const
 
- Public Member Functions inherited from TBTK::Communicator
 Communicator (bool verbose)
 
void setVerbose (bool verbose)
 
bool getVerbose () const
 

Friends

class FileReader
 

Additional Inherited Members

- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 
- 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 Public Member Functions inherited from TBTK::Communicator
static void setGlobalVerbose (bool globalVerbose)
 
static bool getGlobalVerbose ()
 
- 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)
 
static std::string serialize (bool b, Mode mode)
 
static void deserialize (const std::string &serialization, bool *b, Mode mode)
 
static std::string serialize (int i, Mode mode)
 
static void deserialize (const std::string &serialization, int *i, Mode mode)
 
static std::string serialize (unsigned int u, Mode mode)
 
static void deserialize (const std::string &serialization, unsigned int *u, Mode mode)
 
static std::string serialize (double d, Mode mode)
 
static void deserialize (const std::string &serialization, double *d, Mode mode)
 
static std::string serialize (std::complex< double > c, Mode mode)
 
static void deserialize (const std::string &serialization, std::complex< double > *c, Mode mode)
 
static std::string serialize (Statistics s, Mode mode)
 
static void deserialize (const std::string &serialization, Statistics *s, Mode mode)
 
static std::string extract (const std::string &serialization, Mode mode, std::string component)
 

Detailed Description

Container of Model related information.

The Model conatins all model related information such as the Hamiltonian, temperature, and chemical potential.

Constructor & Destructor Documentation

TBTK::Model::Model ( )

Constructor.

TBTK::Model::Model ( const std::vector< unsigned int > &  capacity)

Constructs a Model with a preallocated storage structure such that the addition of HoppingAmplitudes with indices that have the same subindex structure as 'capacity', but with smaller subindices will not cause reallocation for the main storage structure. Internal containers for HoppingAmplitudes may still be reallocated.

Parameters
capacityThe 'Index capacity'.
TBTK::Model::Model ( const Model model)

Copy constructor.

Parameters
modelModel to copy.
TBTK::Model::Model ( Model &&  model)

Move constructor.

Parameters
modelModel to move.
TBTK::Model::Model ( const std::string &  serialization,
Mode  mode 
)

Constructor. Constructs the Model from a serialization string. Note that the ManyParticleContext is not yet serialized.

Parameters
serializationSerialization string from which to construct the Index.
modeMode with which the string has been serialized.
virtual TBTK::Model::~Model ( )
virtual

Destructor.

Member Function Documentation

void TBTK::Model::add ( HoppingAmplitude  ha)
inline

Add a HoppingAmplitude.

Parameters
haHoppingAmplitude to add.
void TBTK::Model::addModel ( const Model model,
const Index subsytemIndex 
)

Add a Model as a subsystem.

Parameters
modelModel to include as subsystem.
subsystemIndexIndex that will be prepended to each Index in the model.
void TBTK::Model::construct ( )

Construct Hilbert space. No more HoppingAmplitudes should be added after this call.

void TBTK::Model::constructCOO ( )
inline

Construct Hamiltonian on COO format.

void TBTK::Model::createGeometry ( int  dimensions,
int  numSpecifiers = 0 
)
inline

Create geometry.

Parameters
dimensionsNumber of spatial dimensions to use for the Geometry.
numSpecifiersThe number of additional specifiers to use per Index.
void TBTK::Model::createManyParticleContext ( )
inline
void TBTK::Model::destructCOO ( )
inline

Destruct Hamiltonian on COO format.

int TBTK::Model::getBasisIndex ( const Index index) const
inline

Get Hilbert space index corresponding to given 'from'-index.

Parameters
indexPhysical Index for which to obtain the Hilbert space index.
Returns
The Hilbert space index corresponding to the given Physical Index. Returns -1 if Model::construct() has not been called.
int TBTK::Model::getBasisSize ( ) const
inline

Get size of Hilbert space.

Returns
The basis size if the basis has been constructed using the call to Model::construct(), otherwise -1.
double TBTK::Model::getChemicalPotential ( ) const
inline

Get chemical potential.

Returns
The chemical potential.
Geometry * TBTK::Model::getGeometry ( )
inline

Get geometry.

Returns
Pointer to the contained Geometry.
const Geometry * TBTK::Model::getGeometry ( ) const
inline

Get geometry.

Returns
Pointer to the contained Geometry.
const HoppingAmplitudeSet & TBTK::Model::getHoppingAmplitudeSet ( ) const
inline

Get amplitude set.

Returns
Reference to the contained HoppingAmplitudeSet.
bool TBTK::Model::getIsConstructed ( )
inline

Check whether the Hilbert space basis has been constructed.

Returns
True if the Hilbert space basis has been constructed.
ManyParticleContext * TBTK::Model::getManyParticleContext ( )
inline

Get ManyParticleContext.

Returns
Pointer to the contained ManyParticleContext.
const SourceAmplitudeSet & TBTK::Model::getSourceAmplitudeSet ( ) const
inline

Get SourceAmplitudeSet.

Returns
Reference to the contained SourceAmplitudeSet.
Statistics TBTK::Model::getStatistics ( ) const
inline

Get statistics.

Returns
The currently set Statistics.
double TBTK::Model::getTemperature ( ) const
inline

Get temperature.

Returns
The temperature.
Model & TBTK::Model::operator<< ( const HoppingAmplitude hoppingAmplitude)
inline

Operator<<.

Model & TBTK::Model::operator<< ( const std::tuple< HoppingAmplitude, HoppingAmplitude > &  hoppingAmplitudes)
inline

Operator<<.

Model & TBTK::Model::operator<< ( const HoppingAmplitudeList hoppingAmplitudeList)
inline

Operator<<.

Model & TBTK::Model::operator<< ( const SourceAmplitude sourceAmplitude)
inline

Operator<<.

Model& TBTK::Model::operator= ( const Model rhs)

Assignment operator.

Parameters
rhsModel to assign to the left hand side.
Returns
Reference to the assigned Model.
Model& TBTK::Model::operator= ( Model &&  rhs)

Move assignment operator.

Parameters
rhsModel to assign to the left hand side.
Returns
Reference to the assigned Model.
void TBTK::Model::reconstructCOO ( )
inline

To be called when HoppingAmplitudes need to be reevaluated. This is required if the HoppingAmplitudeSet in addition to its standard storage format also utilizes a more effective format such as COO format and some HoppingAmplitudes are evaluated through the use of callbacks.

std::string TBTK::Model::serialize ( Mode  mode) const
virtual

Implements Serializable::serialize(). Note that the ManyParticleContext is not yet serialized.

Implements TBTK::Serializable.

void TBTK::Model::setChemicalPotential ( double  chemicalPotential)
inline

Set chemical potential.

Parameters
chemicalPotentialThe chemical potential.
void TBTK::Model::setFilter ( const AbstractHoppingAmplitudeFilter hoppingAmplitudeFilter)
inline

Set a HoppingAmplitudeFilter. The HoppingAmplitudeFilter will be used by the Model to determine whether a given HoppingAmplitude that is passed to the Model actually should be added or not. If no HoppingAmplitudeFilter is set, all HoppingAmplitudes are added. But if a HoppingAmplitudeFilter is set, only those HoppingAmplitudes that the filter returns true for are added.

Parameters
hoppingAmplitudeFilterThe HoppingAmplitudeFilter to use.
void TBTK::Model::setFilter ( const AbstractIndexFilter indexFilter)
inline

Set an IndexFilter. The IndexFilter will be used by the Model to determine whether a given HoppingAmplitude that is passed to the Model actually should be added or not. If no IndexFilter is set, all HoppingAmplitudes are added. But if an IndexFilter is set, only those HoppingAmplitudes for which the filter returns true for both Indices are added.

Parameters
indexFilterThe IndexFilter to use.
void TBTK::Model::setStatistics ( Statistics  statistics)
inline

Set statistics.

Parameters
statisticsThe statistics to use.
void TBTK::Model::setTemperature ( double  temperature)
inline

Set temperature.

Parameters
temperatureThe temperature.
void TBTK::Model::sortHoppingAmplitudes ( )
inline

Sort HoppingAmplitudes.

Friends And Related Function Documentation

friend class FileReader
friend

FileReader is a friend class to allow it to write Model data.


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