TBTK
|
Need a break? Support the development by playing Polarity Puzzles |
Overlap amplitude between state 'bra' and 'ket'. More...
#include <OverlapAmplitude.h>
Classes | |
class | AmplitudeCallback |
Public Member Functions | |
OverlapAmplitude () | |
OverlapAmplitude (std::complex< double > amplitude, const Index &braIndex, const Index &ketIndex) | |
OverlapAmplitude (const AmplitudeCallback &litudeCallback, const Index &braIndex, const Index &ketIndex) | |
OverlapAmplitude (const std::string &serializeation, Serializable::Mode mode) | |
std::complex< double > | getAmplitude () const |
const Index & | getBraIndex () const |
const Index & | getKetIndex () const |
bool | getIsCallbackDependent () const |
const AmplitudeCallback & | getAmplitudeCallback () 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) |
Overlap amplitude between state 'bra' and 'ket'.
|
inline |
Constructor.
TBTK::OverlapAmplitude::OverlapAmplitude | ( | std::complex< double > | amplitude, |
const Index & | braIndex, | ||
const Index & | ketIndex | ||
) |
Constructs an OverlapAmplitude from a value and two Indices .
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.
amplitudeCallback | An AmplitudeCallback that is able to return a value when passed bra. |
braIndex | The Index of the bra state. |
ketIndex | The Index of the ket state. |
TBTK::OverlapAmplitude::OverlapAmplitude | ( | const std::string & | serializeation, |
Serializable::Mode | mode | ||
) |
Constructor. Constructs the OverlapAmplitude from a serialization string.
serialization | Serialization string from which to construct the OverlapAmplitude. |
mode | Mode with which the string has been serialized. |
|
inline |
Get the amplitude value \(\langle\Psi_{bra}|\Psi_{ket}\rangle\).
|
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().
|
inline |
Get bra index.
|
inline |
Get whether the value of the OverlapAmplitude is determined through an AmplitudeCallback.
|
inline |
Get ket index.
|
inline |
Get size in bytes.
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.
mode | Serialization mode to use. |
|
inline |
Get string representation of the OverlapAmplitude.