24 #ifndef COM_DAFER45_TBTK_INTERACTION_AMPLITUDE
25 #define COM_DAFER45_TBTK_INTERACTION_AMPLITUDE
30 #include <initializer_list>
34 class InteractionAmplitude{
37 InteractionAmplitude();
41 std::complex<double> amplitude,
42 std::initializer_list<Index> creationOperatorIndices,
43 std::initializer_list<Index> annihilationOperatorIndices
50 std::complex<double> (*amplitudeCallback)(
const std::vector<Index>&,
const std::vector<Index>&),
51 std::initializer_list<Index> toIndex,
52 std::initializer_list<Index> fromIndex
56 InteractionAmplitude(
const InteractionAmplitude &ia);
59 ~InteractionAmplitude();
64 std::complex<double> getAmplitude()
const;
67 unsigned int getNumCreationOperators()
const;
70 unsigned int getNumAnnihilationOperators()
const;
73 const Index& getCreationOperatorIndex(
unsigned int n)
const;
76 const Index& getAnnihilationOperatorIndex(
unsigned int n)
const;
79 std::complex<double> amplitude;
83 std::complex<double> (*amplitudeCallback)(
84 const std::vector<Index> &toIndex,
85 const std::vector<Index> &fromIndex
89 std::vector<Index> creationOperatorIndices;
92 std::vector<Index> annihilationOperatorIndices;
95 inline std::complex<double> InteractionAmplitude::getAmplitude()
const{
97 return amplitudeCallback(creationOperatorIndices, annihilationOperatorIndices);
102 inline unsigned int InteractionAmplitude::getNumCreationOperators()
const{
103 return creationOperatorIndices.size();
106 inline unsigned int InteractionAmplitude::getNumAnnihilationOperators()
const{
107 return annihilationOperatorIndices.size();
110 inline const Index& InteractionAmplitude::getCreationOperatorIndex(
unsigned int n)
const{
111 return creationOperatorIndices.at(n);
114 inline const Index& InteractionAmplitude::getAnnihilationOperatorIndex(
unsigned int n)
const{
115 return annihilationOperatorIndices.at(n);