CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::PrimGrid Class Reference

#include <PrimGrid.hh>

Detailed Description

Definition at line 30 of file PrimGrid.hh.

Public Member Functions

 PrimGrid (const Lattice &p_lat, const Lattice &s_lat, Index NB=1)
 
 PrimGrid (const Lattice &p_lat, const Lattice &s_lat, const Eigen::Ref< const PrimGrid::matrix_type > &U, const Eigen::Ref< const PrimGrid::matrix_type > &Smat, Index NB)
 
Index size () const
 
const matrix_typematrixU () const
 
const matrix_typeinvU () const
 
const Eigen::DiagonalWrapper
< const PrimGrid::vector_type
matrixS () const
 
int S (Index i) const
 
Index find (const Coordinate &_coord) const
 
Index find (const UnitCell &_unitcell) const
 
Index find (const UnitCellCoord &_coord) const
 
Index find_cart (const Eigen::Ref< const Eigen::Vector3d > &_cart_coord) const
 
UnitCellCoord get_within (const UnitCellCoord &_uccoord) const
 
Coordinate coord (Index l, CELL_TYPE lat_mode) const
 
Coordinate coord (const UnitCellCoord &bijk, CELL_TYPE lat_mode) const
 
UnitCell unitcell (Index i) const
 
UnitCellCoord uccoord (Index i) const
 
SymGroupRepID make_permutation_representation (const SymGroup &group, SymGroupRepID basis_permute_rep) const
 
ReturnArray< Permutationmake_translation_permutations (Index NB) const
 
const Array< Permutation > & translation_permutations () const
 const access to m_trans_permutations. Generates permutations if they don't already exist. More...
 
const Permutationtranslation_permutation (Index i) const
 
SymOp sym_op (Index l) const
 

Private Types

typedef Eigen::Matrix< long, 3, 3 > matrix_type
 
typedef Eigen::Matrix< long, 3, 1 > vector_type
 

Private Member Functions

UnitCellCoord to_canonical (const UnitCellCoord &bijk) const
 
UnitCellCoord from_canonical (const UnitCellCoord &bmnp) const
 

Private Attributes

Lattice const * m_lat [2]
 m_lat[PRIM] is primitive lattice, lat[SCEL] is super lattice More...
 
long int m_N_vol
 Number of primgrid lattice points in the supercell. More...
 
long int m_NB
 Number of basis atoms in the primitive cell. More...
 
matrix_type m_plane_mat
 
matrix_type m_trans_mat
 
matrix_type m_U
 The Smith Normal Form decomposition is: trans_mat = U*S*V, with det(U)=det(V)=1; S is diagonal. More...
 
matrix_type m_invU
 
Array< Permutationm_trans_permutations
 Permutations that describe how translation permutes sites of the supercell. More...
 
int m_stride [2]
 
Eigen::Matrix< long, 3, 1 > m_S
 

Member Typedef Documentation

typedef Eigen::Matrix<long, 3, 3> CASM::PrimGrid::matrix_type
private

Definition at line 32 of file PrimGrid.hh.

typedef Eigen::Matrix<long, 3, 1> CASM::PrimGrid::vector_type
private

Definition at line 33 of file PrimGrid.hh.

Constructor & Destructor Documentation

CASM::PrimGrid::PrimGrid ( const Lattice p_lat,
const Lattice s_lat,
Index  NB = 1 
)

Definition at line 16 of file PrimGrid.cc.

CASM::PrimGrid::PrimGrid ( const Lattice p_lat,
const Lattice s_lat,
const Eigen::Ref< const PrimGrid::matrix_type > &  U,
const Eigen::Ref< const PrimGrid::matrix_type > &  Smat,
Index  NB 
)

Definition at line 84 of file PrimGrid.cc.

Member Function Documentation

Coordinate CASM::PrimGrid::coord ( Index  l,
CELL_TYPE  lat_mode 
) const

Definition at line 223 of file PrimGrid.cc.

Coordinate CASM::PrimGrid::coord ( const UnitCellCoord bijk,
CELL_TYPE  lat_mode 
) const

Definition at line 213 of file PrimGrid.cc.

Index CASM::PrimGrid::find ( const Coordinate _coord) const

Definition at line 144 of file PrimGrid.cc.

Index CASM::PrimGrid::find ( const UnitCell _unitcell) const

Definition at line 156 of file PrimGrid.cc.

Index CASM::PrimGrid::find ( const UnitCellCoord _coord) const

Definition at line 162 of file PrimGrid.cc.

Index CASM::PrimGrid::find_cart ( const Eigen::Ref< const Eigen::Vector3d > &  _cart_coord) const

Definition at line 171 of file PrimGrid.cc.

UnitCellCoord CASM::PrimGrid::from_canonical ( const UnitCellCoord bmnp) const
private

Convert canonical UnitCellCoord (bmnp) to UnitCellCoord (bijk) U*mnp = ijk

Definition at line 364 of file PrimGrid.cc.

UnitCellCoord CASM::PrimGrid::get_within ( const UnitCellCoord bijk) const

The m_plane_mat works because of the following:

prim_frac_coord = m_trans_mat * scel_frac_coord

m_trans_mat is integer, and (if scel_frac_coord is a lattice translation) then prim_frac_coord is also integer.

transf_mat.inverse() does the inverse mapping, but it is NOT integer. However,

 m_plane_mat = transf_mat.determinant()*transf_mat.inverse()

is integer. This is because it is simply the adjugate matrix (i.e., the transpose of the cofactor matrix, which can be obtained without using division).

This means that

  m_plane_mat*prim_frac_coord = m_N_vol*scel_frac_coord

again, for a lattice translation, the left hand side is integer, so the right hand side must be also. Moreover, the elements of the RHS should be on the interval [0,m_N_vol-1] if it is within the supercell.

Definition at line 200 of file PrimGrid.cc.

const matrix_type& CASM::PrimGrid::invU ( ) const
inline

Definition at line 115 of file PrimGrid.hh.

SymGroupRepID CASM::PrimGrid::make_permutation_representation ( const SymGroup group,
SymGroupRepID  basis_permute_rep 
) const

Definition at line 247 of file PrimGrid.cc.

ReturnArray< Permutation > CASM::PrimGrid::make_translation_permutations ( Index  NB) const

Definition at line 308 of file PrimGrid.cc.

const Eigen::DiagonalWrapper< const PrimGrid::vector_type > CASM::PrimGrid::matrixS ( ) const

Definition at line 140 of file PrimGrid.cc.

const matrix_type& CASM::PrimGrid::matrixU ( ) const
inline

Definition at line 112 of file PrimGrid.hh.

int CASM::PrimGrid::S ( Index  i) const
inline

Definition at line 121 of file PrimGrid.hh.

Index CASM::PrimGrid::size ( ) const
inline

Definition at line 108 of file PrimGrid.hh.

SymOp CASM::PrimGrid::sym_op ( Index  l) const

Definition at line 375 of file PrimGrid.cc.

UnitCellCoord CASM::PrimGrid::to_canonical ( const UnitCellCoord bijk) const
private

Convert UnitCellCoord (bijk) to canonical UnitCellCoord (bmnp) mnp = invU * ijk

Convert UnitCellCoord (bijk) to canonical UnitCellCoord (bmnp) mnp = m_invU * ijk

Definition at line 348 of file PrimGrid.cc.

const Permutation& CASM::PrimGrid::translation_permutation ( Index  i) const
inline

Definition at line 159 of file PrimGrid.hh.

const Array<Permutation>& CASM::PrimGrid::translation_permutations ( ) const
inline

const access to m_trans_permutations. Generates permutations if they don't already exist.

Definition at line 147 of file PrimGrid.hh.

UnitCellCoord CASM::PrimGrid::uccoord ( Index  i) const

Definition at line 235 of file PrimGrid.cc.

UnitCell CASM::PrimGrid::unitcell ( Index  i) const

Definition at line 229 of file PrimGrid.cc.

Member Data Documentation

matrix_type CASM::PrimGrid::m_invU
private

Definition at line 49 of file PrimGrid.hh.

Lattice const* CASM::PrimGrid::m_lat[2]
private

m_lat[PRIM] is primitive lattice, lat[SCEL] is super lattice

Definition at line 35 of file PrimGrid.hh.

long int CASM::PrimGrid::m_N_vol
private

Number of primgrid lattice points in the supercell.

Definition at line 38 of file PrimGrid.hh.

long int CASM::PrimGrid::m_NB
private

Number of basis atoms in the primitive cell.

Definition at line 41 of file PrimGrid.hh.

matrix_type CASM::PrimGrid::m_plane_mat
private

The transformation matrix, 'trans_mat', is: lat[SCEL]->lat_column_mat() = (lat[PRIM]->lat_column_mat())*trans_mat; plane_mat = trans_mat.determinant()*trans_mat.inverse();

Definition at line 46 of file PrimGrid.hh.

Eigen::Matrix<long, 3, 1> CASM::PrimGrid::m_S
private

Definition at line 88 of file PrimGrid.hh.

int CASM::PrimGrid::m_stride[2]
private

============================================================================================== Because m_lat[SCEL]->lat_column_mat() = (m_lat[PRIM]->lat_column_mat())*trans_mat; and trans_mat=U*S*V we know that (m_lat[SCEL]->lat_column_mat())*V.inverse() = (m_lat[PRIM]->lat_column_mat())*U*S;

In other words, [(m_lat[PRIM]->lat_column_mat())*U] is a primitive lattice that perfectly tiles the equivalent super lattice [(m_lat[SCEL]->lat_column_mat())*V.inverse()] – (because S is diagonal)

We thus use (m,n,p) on the grid specified by [(m_lat[PRIM]->lat_column_mat())*U] as a canonical indexing

We can do this by manipulating fractional coordinates: trans_mat*super_frac_coord = prim_frac_coord

so U*S*V*super_frac_coord = prim_frac_coord

and finally S*V*super_frac_coord = U.inverse()*prim_frac_coord

meaning that multiplication of prim_frac_coord by invU gives the canonical index

This means that:

(m,n,p) = invU * (i,j,k) and (i,j,k) = U * (m,n,p)

where (i,j,k) are the UnitCellCoords relative to m_lat[PRIM], and (m,n,p) are canonical UnitCellCoords, relative to (m_lat[PRIM]->lat_column_mat())*U

Definition at line 87 of file PrimGrid.hh.

matrix_type CASM::PrimGrid::m_trans_mat
private

Definition at line 46 of file PrimGrid.hh.

Array<Permutation> CASM::PrimGrid::m_trans_permutations
mutableprivate

Permutations that describe how translation permutes sites of the supercell.

Definition at line 52 of file PrimGrid.hh.

matrix_type CASM::PrimGrid::m_U
private

The Smith Normal Form decomposition is: trans_mat = U*S*V, with det(U)=det(V)=1; S is diagonal.

Definition at line 49 of file PrimGrid.hh.


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