CASM  1.1.0
A Clusters Approach to Statistical Mechanics
Tensor

Detailed Description

Data structure representing tensors.

Classes

class  CASM::Tensor< T >
 
class  CASM::ReturnTensor< T >
 
class  CASM::TensorBasis< T >
 

Functions

template<class T >
Tensor< T > CASM::operator* (const T &LHS, const Tensor< T > &RHS)
 
template<class T >
Tensor< T > CASM::operator* (const SymOp &LHS, const Tensor< T > &RHS)
 
template<class T >
std::ostream & CASM::operator<< (std::ostream &stream, const Tensor< T > &RHS)
 
template<class T >
std::istream & CASM::operator>> (std::istream &stream, Tensor< T > &RHS)
 
template<class T >
CASM::dot (const Tensor< T > &LHS, const Tensor< T > &RHS)
 
template<class T >
CASM::norm (const Tensor< T > &ttens)
 
void CASM::Tensor< T >::swap (Tensor &RHS)
 
template<int dim1, int dim2, int flag1>
Tensor< T > & CASM::Tensor< T >::operator= (const Eigen::Matrix< T, dim1, dim2, flag1 > &LHS)
 
void CASM::Tensor< T >::redefine (Array< Index > _Ndim)
 
void CASM::Tensor< T >::redefine (Array< Index > _Ndim, T fill_val)
 
TensorCASM::Tensor< T >::dim_permute (const Array< Index > &iperm)
 
TensorCASM::Tensor< T >::dim_permute (const Permutation &perm)
 
TensorCASM::Tensor< T >::dim_ipermute (const Array< Index > &perm)
 
TensorCASM::Tensor< T >::dim_ipermute (const Permutation &perm)
 
TensorCASM::Tensor< T >::dim_unpermute ()
 
bool CASM::Tensor< T >::next_permute ()
 
void CASM::Tensor< T >::reset_idim ()
 
void CASM::Tensor< T >::permute_symmetrize ()
 Symmetrize tensor with respect to index permutation. More...
 
void CASM::Tensor< T >::permute_symmetrize (const Array< Array< Index > > &unique_dim)
 
Counter< Array< Index > > CASM::Tensor< T >::element_counter () const
 
const Array< Index > & CASM::Tensor< T >::ind_max () const
 
const Array< Index > & CASM::Tensor< T >::dim () const
 
Index CASM::Tensor< T >::dim (Index i) const
 
const Array< Index > & CASM::Tensor< T >::mult_array () const
 
Index CASM::Tensor< T >::rank () const
 
const T & CASM::Tensor< T >::get (const Array< Index > &inds) const
 
T & CASM::Tensor< T >::at (const Array< Index > &inds)
 
const T & CASM::Tensor< T >::at (const Array< Index > &inds) const
 
T & CASM::Tensor< T >::operator() (const Array< Index > &inds)
 
const T & CASM::Tensor< T >::operator() (const Array< Index > &inds) const
 
T & CASM::Tensor< T >::operator() (Index i, Index j)
 
const T & CASM::Tensor< T >::operator() (Index i, Index j) const
 
TensorCASM::Tensor< T >::operator+= (const Tensor &RHS)
 
TensorCASM::Tensor< T >::operator-= (const Tensor &RHS)
 
TensorCASM::Tensor< T >::operator*= (T RHS)
 
TensorCASM::Tensor< T >::operator/= (T RHS)
 
ReturnTensor< T > CASM::Tensor< T >::operator- ()
 
ReturnTensor< T > CASM::Tensor< T >::operator+ (const Tensor &RHS)
 
ReturnTensor< T > CASM::Tensor< T >::operator- (const Tensor &RHS)
 
CASM::Tensor< T >::scalar_prod (const Tensor &RHS) const
 
ReturnTensor< T > CASM::Tensor< T >::tensor_prod (const Tensor &RHS)
 
TensorCASM::Tensor< T >::normalize ()
 
static ReturnTensor< T > CASM::Tensor< T >::identity (Index trank, Index tdim)
 
TensorCASM::Tensor< T >::transform (const SymOp &op, Array< SymGroupRepID > rep_IDs)
 
TensorCASM::Tensor< T >::symmetrize_index (const SymOp &op, Array< SymGroupRepID > rep_IDs, Array< Index > inner_ind)
 
TensorCASM::Tensor< T >::apply_sym (const SymOp &op)
 
void CASM::Tensor< T >::read (std::istream &stream)
 
TensorCASM::Tensor< T >::transform (const Eigen::MatrixXd &op)
 
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > CASM::Tensor< T >::convert_to_Eigen () const
 
void CASM::TensorBasis< T >::generate_basis (Index Nrank, const SymGroup &sym_group)
 
void CASM::TensorBasis< T >::generate_basis (Index Nrank, const SymGroup &sym_group, Index Rep_ID)
 
void CASM::TensorBasis< T >::generate_basis (Index Nrank, const SymGroup &sym_group, const SymGroupRep &perm_group)
 
void CASM::TensorBasis< T >::make_orthogonal_to (const TensorBasis &ortho_basis)
 
TensorBasisCASM::TensorBasis< T >::apply_sym (const SymOp &op)
 
void CASM::TensorBasis< T >::normalize ()
 
void CASM::TensorBasis< T >::idealize ()
 
bool CASM::TensorBasis< T >::read (std::istream &stream)
 

Function Documentation

◆ apply_sym() [1/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::apply_sym ( const SymOp op)

Definition at line 790 of file Tensor.hh.

◆ apply_sym() [2/2]

template<class T >
TensorBasis< T > & CASM::TensorBasis< T >::apply_sym ( const SymOp op)

Definition at line 1077 of file Tensor.hh.

◆ at() [1/2]

template<class T >
T & CASM::Tensor< T >::at ( const Array< Index > &  inds)

Definition at line 525 of file Tensor.hh.

◆ at() [2/2]

template<class T >
const T & CASM::Tensor< T >::at ( const Array< Index > &  inds) const

Definition at line 535 of file Tensor.hh.

◆ convert_to_Eigen()

template<class T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > CASM::Tensor< T >::convert_to_Eigen

Definition at line 888 of file Tensor.hh.

◆ dim() [1/2]

template<class T >
const Array< Index > & CASM::Tensor< T >::dim

Definition at line 487 of file Tensor.hh.

◆ dim() [2/2]

template<class T >
Index CASM::Tensor< T >::dim ( Index  i) const

Definition at line 494 of file Tensor.hh.

◆ dim_ipermute() [1/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::dim_ipermute ( const Array< Index > &  perm)

Definition at line 337 of file Tensor.hh.

◆ dim_ipermute() [2/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::dim_ipermute ( const Permutation perm)

Definition at line 355 of file Tensor.hh.

◆ dim_permute() [1/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::dim_permute ( const Array< Index > &  iperm)

Definition at line 312 of file Tensor.hh.

◆ dim_permute() [2/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::dim_permute ( const Permutation perm)

Definition at line 331 of file Tensor.hh.

◆ dim_unpermute()

template<class T >
Tensor< T > & CASM::Tensor< T >::dim_unpermute

Definition at line 361 of file Tensor.hh.

◆ dot()

template<class T >
T CASM::dot ( const Tensor< T > &  LHS,
const Tensor< T > &  RHS 
)

Definition at line 925 of file Tensor.hh.

◆ element_counter()

template<class T >
Counter< Array< Index > > CASM::Tensor< T >::element_counter

Definition at line 472 of file Tensor.hh.

◆ generate_basis() [1/3]

template<class T >
void CASM::TensorBasis< T >::generate_basis ( Index  Nrank,
const SymGroup sym_group 
)

Definition at line 985 of file Tensor.hh.

◆ generate_basis() [2/3]

template<class T >
void CASM::TensorBasis< T >::generate_basis ( Index  Nrank,
const SymGroup sym_group,
const SymGroupRep perm_group 
)

Definition at line 1033 of file Tensor.hh.

◆ generate_basis() [3/3]

template<class T >
void CASM::TensorBasis< T >::generate_basis ( Index  Nrank,
const SymGroup sym_group,
Index  Rep_ID 
)

Definition at line 1006 of file Tensor.hh.

◆ get()

template<class T >
const T & CASM::Tensor< T >::get ( const Array< Index > &  inds) const

Definition at line 515 of file Tensor.hh.

◆ idealize()

template<class T >
void CASM::TensorBasis< T >::idealize

Definition at line 1095 of file Tensor.hh.

◆ identity()

template<class T >
ReturnTensor< T > CASM::Tensor< T >::identity ( Index  trank,
Index  tdim 
)
static

Definition at line 731 of file Tensor.hh.

◆ ind_max()

template<class T >
const Array< Index > & CASM::Tensor< T >::ind_max

Definition at line 480 of file Tensor.hh.

◆ make_orthogonal_to()

template<class T >
void CASM::TensorBasis< T >::make_orthogonal_to ( const TensorBasis< T > &  ortho_basis)

Definition at line 1063 of file Tensor.hh.

◆ mult_array()

template<class T >
const Array< Index > & CASM::Tensor< T >::mult_array

Definition at line 501 of file Tensor.hh.

◆ next_permute()

template<class T >
bool CASM::Tensor< T >::next_permute

Definition at line 374 of file Tensor.hh.

◆ norm()

template<class T >
T CASM::norm ( const Tensor< T > &  ttens)

Definition at line 932 of file Tensor.hh.

◆ normalize() [1/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::normalize

Definition at line 724 of file Tensor.hh.

◆ normalize() [2/2]

template<class T >
void CASM::TensorBasis< T >::normalize

Definition at line 1087 of file Tensor.hh.

◆ operator()() [1/4]

template<class T >
T & CASM::Tensor< T >::operator() ( const Array< Index > &  inds)

Definition at line 545 of file Tensor.hh.

◆ operator()() [2/4]

template<class T >
const T & CASM::Tensor< T >::operator() ( const Array< Index > &  inds) const

Definition at line 555 of file Tensor.hh.

◆ operator()() [3/4]

template<class T >
T & CASM::Tensor< T >::operator() ( Index  i,
Index  j 
)

Definition at line 564 of file Tensor.hh.

◆ operator()() [4/4]

template<class T >
const T & CASM::Tensor< T >::operator() ( Index  i,
Index  j 
) const

Definition at line 571 of file Tensor.hh.

◆ operator*() [1/2]

template<class T >
Tensor< T > CASM::operator* ( const SymOp LHS,
const Tensor< T > &  RHS 
)

Definition at line 918 of file Tensor.hh.

◆ operator*() [2/2]

template<class T >
Tensor< T > CASM::operator* ( const T &  LHS,
const Tensor< T > &  RHS 
)

Definition at line 911 of file Tensor.hh.

◆ operator*=()

template<class T >
Tensor< T > & CASM::Tensor< T >::operator*= ( RHS)

Definition at line 627 of file Tensor.hh.

◆ operator+()

template<class T >
ReturnTensor< T > CASM::Tensor< T >::operator+ ( const Tensor< T > &  RHS)

Definition at line 654 of file Tensor.hh.

◆ operator+=()

template<class T >
Tensor< T > & CASM::Tensor< T >::operator+= ( const Tensor< T > &  RHS)

Definition at line 578 of file Tensor.hh.

◆ operator-() [1/2]

template<class T >
ReturnTensor< T > CASM::Tensor< T >::operator-

Definition at line 645 of file Tensor.hh.

◆ operator-() [2/2]

template<class T >
ReturnTensor< T > CASM::Tensor< T >::operator- ( const Tensor< T > &  RHS)

Definition at line 661 of file Tensor.hh.

◆ operator-=()

template<class T >
Tensor< T > & CASM::Tensor< T >::operator-= ( const Tensor< T > &  RHS)

Definition at line 603 of file Tensor.hh.

◆ operator/=()

template<class T >
Tensor< T > & CASM::Tensor< T >::operator/= ( RHS)

Definition at line 636 of file Tensor.hh.

◆ operator<<()

template<class T >
std::ostream & CASM::operator<< ( std::ostream &  stream,
const Tensor< T > &  RHS 
)

Definition at line 939 of file Tensor.hh.

◆ operator=()

template<class T >
template<int dim1, int dim2, int flag1>
Tensor<T>& CASM::Tensor< T >::operator= ( const Eigen::Matrix< T, dim1, dim2, flag1 > &  LHS)

Definition at line 255 of file Tensor.hh.

◆ operator>>()

template<class T >
std::istream & CASM::operator>> ( std::istream &  stream,
Tensor< T > &  RHS 
)

Definition at line 976 of file Tensor.hh.

◆ permute_symmetrize() [1/2]

template<class T >
void CASM::Tensor< T >::permute_symmetrize

Symmetrize tensor with respect to index permutation.

Definition at line 433 of file Tensor.hh.

◆ permute_symmetrize() [2/2]

template<class T >
void CASM::Tensor< T >::permute_symmetrize ( const Array< Array< Index > > &  unique_dim)

Symmetrize tensor with respect to index permutation if not all dimensions are quivalent unique_dim lists each subset of indices which are mutually equivalent

Definition at line 448 of file Tensor.hh.

◆ rank()

template<class T >
Index CASM::Tensor< T >::rank

Definition at line 508 of file Tensor.hh.

◆ read() [1/2]

template<class T >
void CASM::Tensor< T >::read ( std::istream &  stream)

Definition at line 818 of file Tensor.hh.

◆ read() [2/2]

template<class T >
bool CASM::TensorBasis< T >::read ( std::istream &  stream)

Definition at line 1107 of file Tensor.hh.

◆ redefine() [1/2]

template<class T >
void CASM::Tensor< T >::redefine ( Array< Index _Ndim)

Definition at line 276 of file Tensor.hh.

◆ redefine() [2/2]

template<class T >
void CASM::Tensor< T >::redefine ( Array< Index _Ndim,
fill_val 
)

Definition at line 294 of file Tensor.hh.

◆ reset_idim()

template<class T >
void CASM::Tensor< T >::reset_idim

Definition at line 415 of file Tensor.hh.

◆ scalar_prod()

template<class T >
T CASM::Tensor< T >::scalar_prod ( const Tensor< T > &  RHS) const

Definition at line 668 of file Tensor.hh.

◆ swap()

template<class T >
void CASM::Tensor< T >::swap ( Tensor< T > &  RHS)

Definition at line 241 of file Tensor.hh.

◆ symmetrize_index()

template<class T >
Tensor< T > & CASM::Tensor< T >::symmetrize_index ( const SymOp op,
Array< SymGroupRepID rep_IDs,
Array< Index inner_ind 
)

Definition at line 768 of file Tensor.hh.

◆ tensor_prod()

template<class T >
ReturnTensor< T > CASM::Tensor< T >::tensor_prod ( const Tensor< T > &  RHS)

Definition at line 696 of file Tensor.hh.

◆ transform() [1/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::transform ( const Eigen::MatrixXd &  mat)

A temporary hack for multiplying tensors – This only works for a rank 2 tensor of dimension 3x3 multiplying a Vector3. It returns a rank 2 tensor of dimension 3x1

Definition at line 861 of file Tensor.hh.

◆ transform() [2/2]

template<class T >
Tensor< T > & CASM::Tensor< T >::transform ( const SymOp op,
Array< SymGroupRepID rep_IDs 
)

Definition at line 740 of file Tensor.hh.