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

Overlap amplitude between state 'bra' and 'ket'. More...

#include <OverlapAmplitude.h>

Inheritance diagram for TBTK::OverlapAmplitude:
TBTK::PseudoSerializable

Classes

class  AmplitudeCallback
 

Public Member Functions

 OverlapAmplitude ()
 
 OverlapAmplitude (std::complex< double > amplitude, const Index &braIndex, const Index &ketIndex)
 
 OverlapAmplitude (const AmplitudeCallback &amplitudeCallback, const Index &braIndex, const Index &ketIndex)
 
 OverlapAmplitude (const std::string &serializeation, Serializable::Mode mode)
 
std::complex< double > getAmplitude () const
 
const IndexgetBraIndex () const
 
const IndexgetKetIndex () const
 
bool getIsCallbackDependent () const
 
const AmplitudeCallbackgetAmplitudeCallback () const
 
std::string toString () const
 
std::string serialize (Serializable::Mode mode) const
 
unsigned int getSizeInBytes () const
 
- Public Member Functions inherited from TBTK::PseudoSerializable
std::string serialize (Serializable::Mode mode)
 

Detailed Description

Overlap amplitude between state 'bra' and 'ket'.

Constructor & Destructor Documentation

◆ OverlapAmplitude() [1/4]

TBTK::OverlapAmplitude::OverlapAmplitude ( )
inline

Constructor.

◆ OverlapAmplitude() [2/4]

TBTK::OverlapAmplitude::OverlapAmplitude ( std::complex< double >  amplitude,
const Index braIndex,
const Index ketIndex 
)

Constructs an OverlapAmplitude from a value and two Indices .

Parameters
amplitudeThe amplitude value.
braIndexThe Index of the bra state.
ketIndexThe Index of the ket state.

◆ OverlapAmplitude() [3/4]

TBTK::OverlapAmplitude::OverlapAmplitude ( const AmplitudeCallback amplitudeCallback,
const Index braIndex,
const Index ketIndex 
)

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

Parameters
amplitudeCallbackAn AmplitudeCallback that is able to return a value when passed bra.
braIndexThe Index of the bra state.
ketIndexThe Index of the ket state.

◆ OverlapAmplitude() [4/4]

TBTK::OverlapAmplitude::OverlapAmplitude ( const std::string &  serializeation,
Serializable::Mode  mode 
)

Constructor. Constructs the OverlapAmplitude from a serialization string.

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

Member Function Documentation

◆ getAmplitude()

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

Get the amplitude value \(\langle\Psi_{bra}|\Psi_{ket}\rangle\).

Returns
The value of the amplitude.

◆ getAmplitudeCallback()

const OverlapAmplitude::AmplitudeCallback & TBTK::OverlapAmplitude::getAmplitudeCallback ( ) const
inline

Get the AmplitudeCallback that is used to determine the value of the OverlapAmplitude. This function stops execution if no AmplitudeCallback is used for the OverlapAmplitude. Therefore always first check whether the OverlapAmplitude is callback dependent with getIsCallbackDependent().

Returns
The AmplitudeCallback that is used to determine the value of the OverlapAmplitude.

◆ getBraIndex()

const Index & TBTK::OverlapAmplitude::getBraIndex ( ) const
inline

Get bra index.

Returns
The bra-Index.

◆ getIsCallbackDependent()

bool TBTK::OverlapAmplitude::getIsCallbackDependent ( ) const
inline

Get whether the value of the OverlapAmplitude is determined through an AmplitudeCallback.

Returns
True if the value of the OverlapAmplitude is determined through an AmplitudeCallback.

◆ getKetIndex()

const Index & TBTK::OverlapAmplitude::getKetIndex ( ) const
inline

Get ket index.

Returns
The ket-Index.

◆ getSizeInBytes()

unsigned int TBTK::OverlapAmplitude::getSizeInBytes ( ) const
inline

Get size in bytes.

Returns
Memory size required to store the OverlapAmplitude.

◆ serialize()

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

Serialize OverlapAmplitude. Note that OverlapAmplitude 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 OverlapAmplitude.

◆ toString()

std::string TBTK::OverlapAmplitude::toString ( ) const
inline

Get string representation of the OverlapAmplitude.

Returns
A string representation of the OverlapAmplitude.

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