TBTK
TBTK::HoppingAmplitude Class Reference

Hopping amplitude from state 'from' to state 'to'. More...

#include <HoppingAmplitude.h>

Public Member Functions

 HoppingAmplitude (std::complex< double > amplitude, Index toIndex, Index fromIndex)
 
 HoppingAmplitude (std::complex< double >(*amplitudeCallback)(const Index &to, const Index &from), Index toIndex, Index fromIndex)
 
 HoppingAmplitude (const HoppingAmplitude &ha)
 
 HoppingAmplitude (const std::string &serializeation, Serializable::Mode mode)
 
HoppingAmplitude getHermitianConjugate () const
 
void print () const
 
std::complex< double > getAmplitude () const
 
std::tuple< HoppingAmplitude, HoppingAmplitudeoperator+ (const HermitianConjugate hc)
 
const IndexgetToIndex () const
 
const IndexgetFromIndex () const
 
std::string toString () const
 
std::string serialize (Serializable::Mode mode) const
 
unsigned int getSizeInBytes () const
 

Detailed Description

Hopping amplitude from state 'from' to state 'to'.

A hopping amplitude is a coefficeint \(a_{ij}\) in a bilinear Hamiltonian \(H = \sum_{ij}a_{ij}c_{i}^{\dagger}c_{j}\), where \(i\) and \(j\) are reffered to using 'to' and 'from' respectively. The constructors can be called with the parameters either in the order (from, to, value) or the order (value, to, from). The former follows the order in which the process can be thought of as happening, while the later corresponds to the order in which values and operators stands in the Hamiltonian.

Constructor & Destructor Documentation

TBTK::HoppingAmplitude::HoppingAmplitude ( std::complex< double >  amplitude,
Index  toIndex,
Index  fromIndex 
)

Constructs a HoppingAmplitude from a value and two Indices.

Parameters
amplitudeThe amplitude value.
toIndexThe left index (i or to-Index) on the HoppingAmplitude.
fromIndexThe right index (j or from-Index) on the HoppingAmplitude.
TBTK::HoppingAmplitude::HoppingAmplitude ( std::complex< double >(*)(const Index &to, const Index &from)  amplitudeCallback,
Index  toIndex,
Index  fromIndex 
)

Constructor. Takes a callback function rather than a paramater value. The callback function has to be defined such that it returns a value for the given indices when called at run time.

Parameters
amplitudeCallbackA callback function able that is able to return a value when passed toIndex and fromIndex.
toIndexThe left index (i or to-Index) on the HoppingAmplitude.
fromIndexThe right index (j or from-Index) on the HoppingAmplitude.
TBTK::HoppingAmplitude::HoppingAmplitude ( const HoppingAmplitude ha)

Copy constructor.

Parameters
haHoppingAmplitude to copy.
TBTK::HoppingAmplitude::HoppingAmplitude ( const std::string &  serializeation,
Serializable::Mode  mode 
)

Constructor. Constructs the HoppingAmplitude from a serialization string.

Parameters
serializationSerialization string from which to construct the Index.
modeMode with which the string has been serialized.

Member Function Documentation

std::complex< double > TBTK::HoppingAmplitude::getAmplitude ( ) const
inline

Get the amplitude value \(a_{ij}\).

Returns
The value of the amplitude.
const Index & TBTK::HoppingAmplitude::getFromIndex ( ) const
inline

Get from index.

Returns
The from Index.
HoppingAmplitude TBTK::HoppingAmplitude::getHermitianConjugate ( ) const

Get the Hermitian cojugate of the HoppingAmplitude.

Returns
The Hermitian conjugate of the HoppingAmplitude.
unsigned int TBTK::HoppingAmplitude::getSizeInBytes ( ) const
inline

Get size in bytes.

Returns
Memory size required to store the HoppingAmplitude.
const Index & TBTK::HoppingAmplitude::getToIndex ( ) const
inline

Get to index.

Returns
The to-Index.
std::tuple< HoppingAmplitude, HoppingAmplitude > TBTK::HoppingAmplitude::operator+ ( const HermitianConjugate  hc)
inline

Addition operator. Creates a tuple containing the HoppingAmplitude and its Hermitian conjugate. Used to allow the syntax
model << hoppingAmplitude + HC.

Parameters
hcShould be HC.
Returns
HoppingAmplitude tuple containing the original HoppingAmplitude and its Hermitian conjugate.
void TBTK::HoppingAmplitude::print ( ) const

Print HoppingAmplitude. Mainly for debugging.

std::string TBTK::HoppingAmplitude::serialize ( Serializable::Mode  mode) const

Serialize HoppingAmplitude. Note that HoppingAmplitude is pseudo-Serializable in that it implements the Serializable interface, but does so non-virtually.

Parameters
modeSerialization mode to use.
Returns
Serialized string representation of the HoppingAmplitude.
std::string TBTK::HoppingAmplitude::toString ( ) const
inline

Get string representation of the HoppingAmplitude.

Returns
A string representation of the HoppingAmplitude.

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