PSCF v1.1
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Pscf::SpaceSymmetry< D > Class Template Reference

A SpaceSymmetry represents a crystallographic space group symmetry. More...

#include <SpaceSymmetry.h>

Public Types

typedef FMatrix< int, D, D > Rotation
 Typedef for matrix used to represent point group operation. More...
 
typedef FArray< Rational, D > Translation
 Typedef for vector used to represent fractional translation. More...
 

Public Member Functions

 SpaceSymmetry ()
 Default constructor. More...
 
 SpaceSymmetry (const SpaceSymmetry< D > &other)
 Copy constructor. More...
 
SpaceSymmetry< D > & operator= (const SpaceSymmetry< D > &other)
 Assignment operator. More...
 
void normalize ()
 Shift components of translation to [0,1). More...
 
void shiftOrigin (Translation const &origin)
 Shift the origin of space used in the coordinate system. More...
 
SpaceSymmetry< D > inverse () const
 Compute and return the inverse of this symmetry element. More...
 
SpaceSymmetry< D >::Rotation inverseRotation () const
 Compute and return the inverse of the rotation matrix. More...
 
int determinant () const
 Compute and return the determinant of the rotation matrix. More...
 
int & R (int i, int j)
 Return an element of the matrix by reference. More...
 
int R (int i, int j) const
 Return an element of the matrix by value. More...
 
Rationalt (int i)
 Return a component of the translation by reference. More...
 
Rational t (int i) const
 Return an element of the translation by value. More...
 

Static Public Member Functions

static const SpaceSymmetry< D > & identity ()
 Return the identity element. More...
 

Friends

bool operator== (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Are two SpaceSymmetry objects equivalent? More...
 
bool operator!= (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Are two SpaceSymmetry objects not equivalent? More...
 
SpaceSymmetry< D > operator* (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Return the product A*B of two symmetry objects. More...
 
IntVec< D > operator* (const IntVec< D > &V, const SpaceSymmetry< D > &S)
 Return the IntVec<D> product V*S of an IntVec<D> and a rotation matrix. More...
 
IntVec< D > operator* (const SpaceSymmetry< D > &S, const IntVec< D > &V)
 Return the IntVec<D> product S*V of a rotation matrix and an IntVec<D>. More...
 
std::ostream & operator<< (std::ostream &out, const SpaceSymmetry< D > &A)
 Output stream inserter for a SpaceSymmetry<D> More...
 
std::istream & operator>> (std::istream &in, SpaceSymmetry< D > &A)
 Input stream extractor for a SpaceSymmetry<D> More...
 

Detailed Description

template<int D>
class Pscf::SpaceSymmetry< D >

A SpaceSymmetry represents a crystallographic space group symmetry.

Crystallographic space group symmetry operation combines a point group operation (e.g., 2, 3, and 4 fold rotations about axes, reflections, or inversion) with possible translations by a fraction of a unit cell.

Both the rotation matrix R and the translation t are represented using a basis of Bravais lattice basis vectors. Because Bravais basis vectors must map onto other lattice vectors, this implies that elements of all elements of the rotation matrix must be integers. To guarantee that the inverse of the rotation matrix is also a matrix of integers, we require that the determinant of the rotation matrix must be +1 or -1. The translation vector is represented by a vector of D rational numbers (i.e., fractions) of the form n/m with m = 2, 3, or 4 and n < m.

The basis used to describe a crytallographic group may be either a primitive or non-primitive unit cell. Thus, for example, the space group of a bcc crystal may be expressed either using a basis of 3 three orthogonal simple cubic unit vectors, with a translation t = (1/2, 1/2, 1/2), or as a point group using a set of three non-orthogonal basis vectors for the primitive unit cell.

Definition at line 137 of file SpaceSymmetry.h.

Member Typedef Documentation

◆ Rotation

template<int D>
typedef FMatrix<int, D, D> Pscf::SpaceSymmetry< D >::Rotation

Typedef for matrix used to represent point group operation.

Definition at line 143 of file SpaceSymmetry.h.

◆ Translation

template<int D>
typedef FArray<Rational, D> Pscf::SpaceSymmetry< D >::Translation

Typedef for vector used to represent fractional translation.

Definition at line 146 of file SpaceSymmetry.h.

Constructor & Destructor Documentation

◆ SpaceSymmetry() [1/2]

template<int D>
Pscf::SpaceSymmetry< D >::SpaceSymmetry

Default constructor.

All elements of the rotation matrix are initialized to zero.

Definition at line 22 of file SpaceSymmetry.tpp.

◆ SpaceSymmetry() [2/2]

template<int D>
Pscf::SpaceSymmetry< D >::SpaceSymmetry ( const SpaceSymmetry< D > &  other)

Copy constructor.

Definition at line 43 of file SpaceSymmetry.tpp.

Member Function Documentation

◆ operator=()

template<int D>
SpaceSymmetry< D > & Pscf::SpaceSymmetry< D >::operator= ( const SpaceSymmetry< D > &  other)

Assignment operator.

Definition at line 60 of file SpaceSymmetry.tpp.

◆ normalize()

template<int D>
void Pscf::SpaceSymmetry< D >::normalize

Shift components of translation to [0,1).

Definition at line 79 of file SpaceSymmetry.tpp.

References UTIL_ASSERT.

Referenced by Pscf::SpaceSymmetry< D >::inverse().

◆ shiftOrigin()

template<int D>
void Pscf::SpaceSymmetry< D >::shiftOrigin ( Translation const &  origin)

Shift the origin of space used in the coordinate system.

This function modifies the translation vector so as to refer to an equivalent symmetry defined using a new coordinate system with a shifted origin. The argument gives the coordinates of the origin of the new coordinate system as defined in the old coordinate system.

Parameters
originlocation of origin of the new coordinate system

Definition at line 150 of file SpaceSymmetry.tpp.

◆ inverse()

template<int D>
SpaceSymmetry< D > Pscf::SpaceSymmetry< D >::inverse

Compute and return the inverse of this symmetry element.

Definition at line 124 of file SpaceSymmetry.tpp.

References Pscf::SpaceSymmetry< D >::normalize().

◆ inverseRotation()

template<int D>
SpaceSymmetry< D >::Rotation Pscf::SpaceSymmetry< D >::inverseRotation ( ) const

Compute and return the inverse of the rotation matrix.

◆ determinant()

template<int D>
int Pscf::SpaceSymmetry< D >::determinant ( ) const

Compute and return the determinant of the rotation matrix.

◆ R() [1/2]

template<int D>
int & Pscf::SpaceSymmetry< D >::R ( int  i,
int  j 
)
inline

Return an element of the matrix by reference.

Parameters
i1st (row) index
j2nd (column) index

Definition at line 326 of file SpaceSymmetry.h.

◆ R() [2/2]

template<int D>
int Pscf::SpaceSymmetry< D >::R ( int  i,
int  j 
) const
inline

Return an element of the matrix by value.

Parameters
i1st (row) index
j2nd (column) index

Definition at line 334 of file SpaceSymmetry.h.

◆ t() [1/2]

template<int D>
Rational & Pscf::SpaceSymmetry< D >::t ( int  i)
inline

Return a component of the translation by reference.

Parameters
icomponent index

Definition at line 342 of file SpaceSymmetry.h.

◆ t() [2/2]

template<int D>
Rational Pscf::SpaceSymmetry< D >::t ( int  i) const
inline

Return an element of the translation by value.

Parameters
icomponent index

Definition at line 350 of file SpaceSymmetry.h.

◆ identity()

template<int D>
const SpaceSymmetry< D > & Pscf::SpaceSymmetry< D >::identity
inlinestatic

Return the identity element.

Definition at line 358 of file SpaceSymmetry.h.

Friends And Related Function Documentation

◆ operator==

template<int D>
bool operator== ( const SpaceSymmetry< D > &  A,
const SpaceSymmetry< D > &  B 
)
friend

Are two SpaceSymmetry objects equivalent?

Parameters
Afirst symmetry
Bsecond symmetry
Returns
True if A == B, false otherwise

Definition at line 370 of file SpaceSymmetry.h.

◆ operator!=

template<int D>
bool operator!= ( const SpaceSymmetry< D > &  A,
const SpaceSymmetry< D > &  B 
)
friend

Are two SpaceSymmetry objects not equivalent?

Parameters
Afirst symmetry
Bsecond symmetry
Returns
True if A != B, false otherwise

Definition at line 318 of file SpaceSymmetry.h.

◆ operator* [1/3]

template<int D>
SpaceSymmetry< D > operator* ( const SpaceSymmetry< D > &  A,
const SpaceSymmetry< D > &  B 
)
friend

Return the product A*B of two symmetry objects.

Parameters
Afirst symmetry
Bsecond symmetry
Returns
product A*B

Definition at line 391 of file SpaceSymmetry.h.

◆ operator* [2/3]

template<int D>
IntVec< D > operator* ( const IntVec< D > &  V,
const SpaceSymmetry< D > &  S 
)
friend

Return the IntVec<D> product V*S of an IntVec<D> and a rotation matrix.

The product is defined to be the matrix product of the integer vector and the space group rotation matrix S.R * V.

Parameters
Vinteger vector
Ssymmetry operation
Returns
product V*S

Definition at line 441 of file SpaceSymmetry.h.

◆ operator* [3/3]

template<int D>
IntVec< D > operator* ( const SpaceSymmetry< D > &  S,
const IntVec< D > &  V 
)
friend

Return the IntVec<D> product S*V of a rotation matrix and an IntVec<D>.

The product is defined to be the matrix product of the rotation matrix and the integer vector S.R * V.

Parameters
Ssymmetry operation
Vinteger vector
Returns
product S*V

Definition at line 424 of file SpaceSymmetry.h.

◆ operator<<

template<int D>
std::ostream & operator<< ( std::ostream &  out,
const SpaceSymmetry< D > &  A 
)
friend

Output stream inserter for a SpaceSymmetry<D>

Parameters
outoutput stream
ASpaceSymmetry<D> object to be output
Returns
modified output stream

Definition at line 458 of file SpaceSymmetry.h.

◆ operator>>

template<int D>
std::istream & operator>> ( std::istream &  in,
SpaceSymmetry< D > &  A 
)
friend

Input stream extractor for a SpaceSymmetry<D>

Parameters
ininput stream
ASpaceSymmetry<D> object to be input
Returns
modified input stream

Definition at line 478 of file SpaceSymmetry.h.


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