sisi4s
Loading...
Searching...
No Matches
sisi4s::FockVector< F > Class Template Reference

Represents the direct sum of Tensors and provides the vector space operations of addition, scalar multiplication, inner product, complex conjugation to get dual vectors and matrix multiplication between vectors and duals, which yields a scalar. More...

#include <FockVector.hpp>

Inheritance diagram for sisi4s::FockVector< F >:
Collaboration diagram for sisi4s::FockVector< F >:

Public Types

typedef F FieldType
 

Public Member Functions

 FockVector ()
 Default constructor for an empty Fock vector without elements.
 
 FockVector (FockVector< F > &&a)
 Move constructor taking possession of the tensors owned by a.
 
 FockVector (const FockVector< F > &a)
 Copy constructor copying the tensors owned by a.
 
 FockVector (const std::vector< std::shared_ptr< Tensor< F > > > &tensors, const std::vector< std::string > &indices)
 Move constructor taking possession of the tensors given.
 
template<typename TensorsIterator , typename IndicesIterator >
 FockVector (TensorsIterator tensorsBegin, TensorsIterator tensorsEnd, IndicesIterator indicesBegin, IndicesIterator indicesEnd)
 Move constructor taking possession of the tensors given by the iterators.
 
const std::shared_ptr< Tensor< F > > & get (const size_t i) const
 Retrieves the i-th component tensor. Note that the Tensor is not const since rearrangement may be required also in non-modifying tensor operations.
 
std::shared_ptr< Tensor< F > > & get (const size_t i)
 Retrieves the i-th component tensor.
 
const std::string & get_indices (const size_t i) const
 Retrieves the i-th component indices.
 
std::string & get_indices (const size_t i)
 Retrieves the i-th component indices as modifiable string.
 
FockVector< F > & operator= (const FockVector< F > &&a)
 Move assignment operator taking possession of the tensors owned by a.
 
FockVector< F > & operator= (const FockVector< F > &a)
 Copy assignment operator copying the tensors owned by a.
 
FockVector< F > & operator+= (const FockVector< F > &a)
 Add-to assignment operator adding each component of a to the respective component of this FockVector.
 
FockVector< F > & operator-= (const FockVector< F > &a)
 Subtract-from assignment operator subtracting each component of a from the respective component of this FockVector.
 
FockVector< F > & operator*= (const F s)
 Multiply-by assignment operator scalar multiplying each component each component of this FockVector by the given scalar.
 
FockVector< F > conjugateTranspose () const
 Creates and returns the conjugate transpose of this FockVector. The first and the second half of the inidices in each component are swapped for the transposition. For real types F the conjugation does nothing.
 
braket (const FockVector< F > &ket) const
 Returns the matrix product of this bra-FockVector with the given dual ket-FockVector ket.
 
dot (const FockVector< F > &a) const
 Returns the inner product of this ket-FockVector with the given ket-FockVector a. The elements of this FockVector are conjugated in the inner product, i.e. this->dot(a) yields the same results as this->conjugateTranspose().braket(a).
 
size_t get_components_count () const
 Get the number of component tensors of this FockVector.
 
size_t get_dimension () const
 Get the total number of degrees of freedom represented by this FockVector, i.e. the total number of field values contained in all component tensors. The indices used by read and write are between 0 and get_dimension()-1.
 
size_t get_index (const size_t component, const size_t componentIndex) const
 
void fromIndex (const size_t index, size_t &component, size_t &componentIndex) const
 
std::vector< std::pair< size_t, F > > readLocal () const
 Reads out all locally stored values together with their respective indices. The indices are between 0 and get_dimension()-1.
 
void write (const std::vector< std::pair< size_t, F > > &elements)
 Writes the given values together with their respective indices. The indices are between 0 and get_dimension()-1.
 

Public Attributes

std::vector< std::shared_ptr< Tensor< F > > > component_tensors
 
std::vector< std::string > component_indices
 

Protected Member Functions

void build_index_translation ()
 
void copy_components (const std::vector< std::shared_ptr< Tensor< F > > > &components)
 Sets this FockVector's component tensors by copying the given component tensors. Called by copy constructors and copy assignments.
 
void checkDualCompatibility (const FockVector< F > &a) const
 Check if two FockVectors are transpose of each other by swapping the first and the second half of the component indices.
 
void checkCompatibilityTo (const FockVector< F > &a) const
 

Protected Attributes

std::vector< size_t > index_ends
 The end of the FockVector index range for each component. This vector is used for translating component number and indices into FockVector indicies.
 

Detailed Description

template<typename F = double>
class sisi4s::FockVector< F >

Represents the direct sum of Tensors and provides the vector space operations of addition, scalar multiplication, inner product, complex conjugation to get dual vectors and matrix multiplication between vectors and duals, which yields a scalar.

Member Typedef Documentation

◆ FieldType

template<typename F = double>
typedef F sisi4s::FockVector< F >::FieldType

Constructor & Destructor Documentation

◆ FockVector() [1/5]

template<typename F = double>
sisi4s::FockVector< F >::FockVector ( )
inline

Default constructor for an empty Fock vector without elements.

◆ FockVector() [2/5]

template<typename F = double>
sisi4s::FockVector< F >::FockVector ( FockVector< F > &&  a)
inline

Move constructor taking possession of the tensors owned by a.

Here is the call graph for this function:

◆ FockVector() [3/5]

template<typename F = double>
sisi4s::FockVector< F >::FockVector ( const FockVector< F > &  a)
inline

Copy constructor copying the tensors owned by a.

Here is the call graph for this function:

◆ FockVector() [4/5]

template<typename F = double>
sisi4s::FockVector< F >::FockVector ( const std::vector< std::shared_ptr< Tensor< F > > > &  tensors,
const std::vector< std::string > &  indices 
)
inline

Move constructor taking possession of the tensors given.

Here is the call graph for this function:

◆ FockVector() [5/5]

template<typename F = double>
template<typename TensorsIterator , typename IndicesIterator >
sisi4s::FockVector< F >::FockVector ( TensorsIterator  tensorsBegin,
TensorsIterator  tensorsEnd,
IndicesIterator  indicesBegin,
IndicesIterator  indicesEnd 
)
inline

Move constructor taking possession of the tensors given by the iterators.

Here is the call graph for this function:

Member Function Documentation

◆ braket()

template<typename F = double>
F sisi4s::FockVector< F >::braket ( const FockVector< F > &  ket) const
inline

Returns the matrix product of this bra-FockVector with the given dual ket-FockVector ket.

Here is the call graph for this function:

◆ build_index_translation()

template<typename F = double>
void sisi4s::FockVector< F >::build_index_translation ( )
inlineprotected

\Brief Builds the index ends vector needed for the index translation methods get_index and fromIndex.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkCompatibilityTo()

template<typename F = double>
void sisi4s::FockVector< F >::checkCompatibilityTo ( const FockVector< F > &  a) const
inlineprotected
Here is the caller graph for this function:

◆ checkDualCompatibility()

template<typename F = double>
void sisi4s::FockVector< F >::checkDualCompatibility ( const FockVector< F > &  a) const
inlineprotected

Check if two FockVectors are transpose of each other by swapping the first and the second half of the component indices.

Here is the call graph for this function:

◆ conjugateTranspose()

template<typename F = double>
FockVector< F > sisi4s::FockVector< F >::conjugateTranspose ( ) const
inline

Creates and returns the conjugate transpose of this FockVector. The first and the second half of the inidices in each component are swapped for the transposition. For real types F the conjugation does nothing.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_components()

template<typename F = double>
void sisi4s::FockVector< F >::copy_components ( const std::vector< std::shared_ptr< Tensor< F > > > &  components)
inlineprotected

Sets this FockVector's component tensors by copying the given component tensors. Called by copy constructors and copy assignments.

Here is the caller graph for this function:

◆ dot()

template<typename F = double>
F sisi4s::FockVector< F >::dot ( const FockVector< F > &  a) const
inline

Returns the inner product of this ket-FockVector with the given ket-FockVector a. The elements of this FockVector are conjugated in the inner product, i.e. this->dot(a) yields the same results as this->conjugateTranspose().braket(a).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromIndex()

template<typename F = double>
void sisi4s::FockVector< F >::fromIndex ( const size_t  index,
size_t &  component,
size_t &  componentIndex 
) const
inline

\Brief Translates the given index between 0 and get_dimension()-1 into a component number and component index into the corresponding component tensor.

Here is the caller graph for this function:

◆ get() [1/2]

template<typename F = double>
std::shared_ptr< Tensor< F > > & sisi4s::FockVector< F >::get ( const size_t  i)
inline

Retrieves the i-th component tensor.

◆ get() [2/2]

template<typename F = double>
const std::shared_ptr< Tensor< F > > & sisi4s::FockVector< F >::get ( const size_t  i) const
inline

Retrieves the i-th component tensor. Note that the Tensor is not const since rearrangement may be required also in non-modifying tensor operations.

Here is the caller graph for this function:

◆ get_components_count()

template<typename F = double>
size_t sisi4s::FockVector< F >::get_components_count ( ) const
inline

Get the number of component tensors of this FockVector.

Here is the caller graph for this function:

◆ get_dimension()

template<typename F = double>
size_t sisi4s::FockVector< F >::get_dimension ( ) const
inline

Get the total number of degrees of freedom represented by this FockVector, i.e. the total number of field values contained in all component tensors. The indices used by read and write are between 0 and get_dimension()-1.

◆ get_index()

template<typename F = double>
size_t sisi4s::FockVector< F >::get_index ( const size_t  component,
const size_t  componentIndex 
) const
inline

\Brief Translates the given component and component index into its element into an index between 0 and get_dimension()-1.

Here is the caller graph for this function:

◆ get_indices() [1/2]

template<typename F = double>
std::string & sisi4s::FockVector< F >::get_indices ( const size_t  i)
inline

Retrieves the i-th component indices as modifiable string.

◆ get_indices() [2/2]

template<typename F = double>
const std::string & sisi4s::FockVector< F >::get_indices ( const size_t  i) const
inline

Retrieves the i-th component indices.

Here is the caller graph for this function:

◆ operator*=()

template<typename F = double>
FockVector< F > & sisi4s::FockVector< F >::operator*= ( const F  s)
inline

Multiply-by assignment operator scalar multiplying each component each component of this FockVector by the given scalar.

Here is the call graph for this function:

◆ operator+=()

template<typename F = double>
FockVector< F > & sisi4s::FockVector< F >::operator+= ( const FockVector< F > &  a)
inline

Add-to assignment operator adding each component of a to the respective component of this FockVector.

Here is the call graph for this function:

◆ operator-=()

template<typename F = double>
FockVector< F > & sisi4s::FockVector< F >::operator-= ( const FockVector< F > &  a)
inline

Subtract-from assignment operator subtracting each component of a from the respective component of this FockVector.

Here is the call graph for this function:

◆ operator=() [1/2]

template<typename F = double>
FockVector< F > & sisi4s::FockVector< F >::operator= ( const FockVector< F > &&  a)
inline

Move assignment operator taking possession of the tensors owned by a.

Here is the call graph for this function:

◆ operator=() [2/2]

template<typename F = double>
FockVector< F > & sisi4s::FockVector< F >::operator= ( const FockVector< F > &  a)
inline

Copy assignment operator copying the tensors owned by a.

Here is the call graph for this function:

◆ readLocal()

template<typename F = double>
std::vector< std::pair< size_t, F > > sisi4s::FockVector< F >::readLocal ( ) const
inline

Reads out all locally stored values together with their respective indices. The indices are between 0 and get_dimension()-1.

Here is the call graph for this function:

◆ write()

template<typename F = double>
void sisi4s::FockVector< F >::write ( const std::vector< std::pair< size_t, F > > &  elements)
inline

Writes the given values together with their respective indices. The indices are between 0 and get_dimension()-1.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ component_indices

template<typename F = double>
std::vector<std::string> sisi4s::FockVector< F >::component_indices

◆ component_tensors

template<typename F = double>
std::vector<std::shared_ptr< Tensor<F> > > sisi4s::FockVector< F >::component_tensors

◆ index_ends

template<typename F = double>
std::vector<size_t> sisi4s::FockVector< F >::index_ends
protected

The end of the FockVector index range for each component. This vector is used for translating component number and indices into FockVector indicies.


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