TBTK
|
Need a break? Support the development by playing Polarity Puzzles |
Hopping amplitude from state 'from' to state 'to'. More...
#include <HoppingAmplitude.h>
Classes | |
class | AmplitudeCallback |
Public Member Functions | |
HoppingAmplitude () | |
HoppingAmplitude (std::complex< double > amplitude, Index toIndex, Index fromIndex) | |
HoppingAmplitude (const AmplitudeCallback &callback, Index toIndex, Index fromIndex) | |
HoppingAmplitude (const HoppingAmplitude &ha) | |
HoppingAmplitude (const std::string &serialization, Serializable::Mode mode) | |
HoppingAmplitude | getHermitianConjugate () const |
void | print () const |
std::complex< double > | getAmplitude () const |
std::tuple< HoppingAmplitude, HoppingAmplitude > | operator+ (const HermitianConjugate hc) |
const Index & | getToIndex () const |
const Index & | getFromIndex () const |
bool | getIsCallbackDependent () const |
const AmplitudeCallback & | getAmplitudeCallback () const |
std::string | toString () const |
std::string | serialize (Serializable::Mode mode) const |
unsigned int | getSizeInBytes () const |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const HoppingAmplitude &hoppingAmplitude) |
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.
TBTK::HoppingAmplitude::HoppingAmplitude | ( | ) |
Constructs an uninitialized HoppingAmplitude.
TBTK::HoppingAmplitude::HoppingAmplitude | ( | std::complex< double > | amplitude, |
Index | toIndex, | ||
Index | fromIndex | ||
) |
Constructs a HoppingAmplitude from a value and two Indices.
amplitude | The amplitude value. |
toIndex | The left index (i or to-Index) on the HoppingAmplitude. |
fromIndex | The right index (j or from-Index) on the HoppingAmplitude. |
TBTK::HoppingAmplitude::HoppingAmplitude | ( | const AmplitudeCallback & | callback, |
Index | toIndex, | ||
Index | fromIndex | ||
) |
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 toIndex and fromIndex. |
toIndex | The left index (i or to-Index) on the HoppingAmplitude. |
fromIndex | The right index (j or from-Index) on the HoppingAmplitude. |
TBTK::HoppingAmplitude::HoppingAmplitude | ( | const HoppingAmplitude & | ha | ) |
Copy constructor.
ha | HoppingAmplitude to copy. |
TBTK::HoppingAmplitude::HoppingAmplitude | ( | const std::string & | serialization, |
Serializable::Mode | mode | ||
) |
Constructor. Constructs the HoppingAmplitude from a serialization string.
serialization | Serialization string from which to construct the Index. |
mode | Mode with which the string has been serialized. |
|
inline |
Get the amplitude value \(a_{ij}\).
|
inline |
Get the AmplitudeCallback that is used to determine the value of the HoppingAmplitude. This function stops execution if no AmplitudeCallback is used for the HoppingAmplitude. Therefore always first check whether the HoppingAmplitude is callback dependent with getIsCallbackDependent().
|
inline |
Get from index.
HoppingAmplitude TBTK::HoppingAmplitude::getHermitianConjugate | ( | ) | const |
Get the Hermitian cojugate of the HoppingAmplitude.
|
inline |
Get whether the value of the HoppingAmplitude is determined through an AmplitudeCallback.
|
inline |
Get size in bytes.
|
inline |
Get to index.
|
inline |
Addition operator. Creates a tuple containing the HoppingAmplitude and its Hermitian conjugate. Used to allow the syntax
model << hoppingAmplitude + HC.
hc | Should be HC. |
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.
mode | Serialization mode to use. |
|
inline |
Get string representation of the HoppingAmplitude.
|
friend |
Writes the HoppingAmplitudes toString()-representation to a stream.
stream | The stream to write to. |
hoppingAmplitude | The HoppingAmplitude to write. |