Some helper functions for State.hpp.
More...
#include <vector>
#include <math.h>
#include <string>
#include <algorithm>
#include <sstream>
#include <complex>
|
| template<class T > |
| T | conj (T t) |
| | Performs the usual complex conjugate.
|
| |
| template<> |
| float | conj< float > (float f) |
| | Template specialization. Complex conjugate is identity for floats.
|
| |
| template<> |
| double | conj< double > (double f) |
| | Template specialization. Complex conjugate is identity for doubles.
|
| |
| template<> |
| int | conj< int > (int f) |
| | Template specialization. Complex conjugate is identity for ints.
|
| |
| template<class Val , class Real > |
| Val | ovlpH (const std::vector< Val > &b, const std::vector< Real > &wf, Val(*get_ovlp)(const std::vector< Real > &, const std::vector< Real > &), const std::vector< std::vector< Real > > &waves) |
| | Computes the inner product of a OWF, and WF according to get_ovlp (cf. State).
|
| |
| template<class Val , class Real > |
| Val | ovlp (const std::vector< Val > &b, const std::vector< Val > &c, Val(*get_ovlp)(const std::vector< Real > &, const std::vector< Real > &), const std::vector< std::vector< Real > > &waves) |
| | Computes the inner product of two proto-orthogonal wave functions according to get_ovlp. Used in addBasisElem() (cf. State).
|
| |
Some helper functions for State.hpp.
- Author
- Fabian Wiesner (fabia.nosp@m.n.wi.nosp@m.esner.nosp@m.97@g.nosp@m.mail..nosp@m.com)
- Version
- 0.1
- Date
- 2024-06-06
- Copyright
- Copyright (c) 2024, provided under CC BY-NC 4.0. license
◆ conj()
Performs the usual complex conjugate.
- Template Parameters
-
- Parameters
-
| t | Number to perform the complex conj on. |
- Returns
- T Complex conjugate
◆ conj< double >()
template<>
| double conj< double > |
( |
double | f | ) |
|
Template specialization. Complex conjugate is identity for doubles.
- Parameters
-
| t | Number to perform the complex conj on. |
- Returns
- double Complex conjugate
◆ conj< float >()
template<>
| float conj< float > |
( |
float | f | ) |
|
Template specialization. Complex conjugate is identity for floats.
- Parameters
-
| t | Number to perform the complex conj on. |
- Returns
- float Complex conjugate
◆ conj< int >()
Template specialization. Complex conjugate is identity for ints.
- Parameters
-
| t | Number to perform the complex conj on. |
- Returns
- int Complex conjugate
◆ ovlp()
template<class Val , class Real >
| Val ovlp |
( |
const std::vector< Val > & | b, |
|
|
const std::vector< Val > & | c, |
|
|
Val(* | get_ovlp )(const std::vector< Real > &, const std::vector< Real > &), |
|
|
const std::vector< std::vector< Real > > & | waves ) |
Computes the inner product of two proto-orthogonal wave functions according to get_ovlp. Used in addBasisElem() (cf. State).
- Template Parameters
-
| Val | Value-type, cf. State. |
| Real | Real-type, cf. State. |
- Parameters
-
| b | proto-orthogonal wave function |
| c | proto-orthogonal wave function |
| Function | that provides the overlap given two wave functions. |
| waves | Wave functions that are used to express b. b provides the coefficients. |
- Returns
- Val Overlap of b and c.
◆ ovlpH()
template<class Val , class Real >
| Val ovlpH |
( |
const std::vector< Val > & | b, |
|
|
const std::vector< Real > & | wf, |
|
|
Val(* | get_ovlp )(const std::vector< Real > &, const std::vector< Real > &), |
|
|
const std::vector< std::vector< Real > > & | waves ) |
Computes the inner product of a OWF, and WF according to get_ovlp (cf. State).
- Template Parameters
-
| Val | Value-type, cf. State. |
| Real | Real-type, cf. State |
- Parameters
-
| b | Orthogonal wave function (OWF). |
| wf | Wave function WF |
| get_ovlp | Function that provides the overlap given two wave functions. |
| waves | Wave functions that are used to express b. b provides the coefficients. |
- Returns
- Val Overlap of b and wf.