sisi4s
|
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>
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. | |
F | braket (const FockVector< F > &ket) const |
Returns the matrix product of this bra-FockVector with the given dual ket-FockVector ket. | |
F | 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. | |
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.
typedef F sisi4s::FockVector< F >::FieldType |
|
inline |
Default constructor for an empty Fock vector without elements.
|
inline |
Move constructor taking possession of the tensors owned by a.
|
inline |
Copy constructor copying the tensors owned by a.
|
inline |
Move constructor taking possession of the tensors given.
|
inline |
Move constructor taking possession of the tensors given by the iterators.
|
inline |
Returns the matrix product of this bra-FockVector with the given dual ket-FockVector ket.
|
inlineprotected |
\Brief Builds the index ends vector needed for the index translation methods get_index and fromIndex.
|
inlineprotected |
|
inlineprotected |
Check if two FockVectors are transpose of each other by swapping the first and the second half of the component indices.
|
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.
|
inlineprotected |
Sets this FockVector's component tensors by copying the given component tensors. Called by copy constructors and copy assignments.
|
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).
|
inline |
\Brief Translates the given index between 0 and get_dimension()-1 into a component number and component index into the corresponding component tensor.
|
inline |
Retrieves the i-th component tensor.
|
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.
|
inline |
|
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.
|
inline |
\Brief Translates the given component and component index into its element into an index between 0 and get_dimension()-1.
|
inline |
Retrieves the i-th component indices as modifiable string.
|
inline |
Retrieves the i-th component indices.
|
inline |
Multiply-by assignment operator scalar multiplying each component each component of this FockVector by the given scalar.
|
inline |
Add-to assignment operator adding each component of a to the respective component of this FockVector.
|
inline |
Subtract-from assignment operator subtracting each component of a from the respective component of this FockVector.
|
inline |
Move assignment operator taking possession of the tensors owned by a.
|
inline |
Copy assignment operator copying the tensors owned by a.
|
inline |
Reads out all locally stored values together with their respective indices. The indices are between 0 and get_dimension()-1.
|
inline |
Writes the given values together with their respective indices. The indices are between 0 and get_dimension()-1.
std::vector<std::string> sisi4s::FockVector< F >::component_indices |
std::vector<std::shared_ptr< Tensor<F> > > sisi4s::FockVector< F >::component_tensors |
|
protected |
The end of the FockVector index range for each component. This vector is used for translating component number and indices into FockVector indicies.