PSCF v1.3
Pscf::Prdc::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.
typedef FArray< Rational, D > Translation
 Typedef for vector used to represent fractional translation.

Public Member Functions

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

Static Public Member Functions

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

Friends

bool operator== (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Are two SpaceSymmetry objects equivalent?
bool operator!= (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Are two SpaceSymmetry objects not equivalent?
SpaceSymmetry< D > operator* (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Return the product A*B of two symmetry objects.
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.
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>.
std::ostream & operator<< (std::ostream &out, const SpaceSymmetry< D > &A)
 Output stream inserter for a SpaceSymmetry<D>
std::istream & operator>> (std::istream &in, SpaceSymmetry< D > &A)
 Input stream extractor for a SpaceSymmetry<D>

Detailed Description

template<int D>
class Pscf::Prdc::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.

See also
Appendix: Space Group Symmetry

Definition at line 139 of file SpaceSymmetry.h.

Member Typedef Documentation

◆ Rotation

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

Typedef for matrix used to represent point group operation.

Definition at line 145 of file SpaceSymmetry.h.

◆ Translation

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

Typedef for vector used to represent fractional translation.

Definition at line 148 of file SpaceSymmetry.h.

Constructor & Destructor Documentation

◆ SpaceSymmetry() [1/2]

template<int D>
Pscf::Prdc::SpaceSymmetry< D >::SpaceSymmetry ( )

Default constructor.

All elements of the rotation matrix are initialized to zero.

Definition at line 22 of file SpaceSymmetry.tpp.

Referenced by determinant(), identity(), inverse(), operator!=, operator*, operator*, operator*, operator<<, operator=(), operator==, operator>>, and SpaceSymmetry().

◆ SpaceSymmetry() [2/2]

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

Copy constructor.

Definition at line 43 of file SpaceSymmetry.tpp.

References normalize(), and SpaceSymmetry().

Member Function Documentation

◆ operator=()

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

Assignment operator.

Definition at line 60 of file SpaceSymmetry.tpp.

References normalize(), and SpaceSymmetry().

◆ normalize()

template<int D>
void Pscf::Prdc::SpaceSymmetry< D >::normalize ( )

Shift components of translation to [0,1).

Definition at line 79 of file SpaceSymmetry.tpp.

References UTIL_ASSERT.

Referenced by inverse(), operator*, operator=(), shiftOrigin(), and SpaceSymmetry().

◆ shiftOrigin()

template<int D>
void Pscf::Prdc::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.

References normalize().

◆ inverse()

template<int D>
SpaceSymmetry< D > Pscf::Prdc::SpaceSymmetry< D >::inverse ( ) const

Compute and return the inverse of this symmetry element.

Definition at line 124 of file SpaceSymmetry.tpp.

References inverseRotation(), normalize(), and SpaceSymmetry().

◆ inverseRotation()

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

Compute and return the inverse of the rotation matrix.

Referenced by inverse().

◆ determinant()

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

Compute and return the determinant of the rotation matrix.

References SpaceSymmetry().

◆ R() [1/2]

template<int D>
int & Pscf::Prdc::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 328 of file SpaceSymmetry.h.

◆ R() [2/2]

template<int D>
int Pscf::Prdc::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 336 of file SpaceSymmetry.h.

◆ t() [1/2]

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

Return a component of the translation by reference.

Parameters
icomponent index

Definition at line 344 of file SpaceSymmetry.h.

◆ t() [2/2]

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

Return an element of the translation by value.

Parameters
icomponent index

Definition at line 352 of file SpaceSymmetry.h.

◆ identity()

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

Return the identity element.

Definition at line 360 of file SpaceSymmetry.h.

References SpaceSymmetry().

◆ 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 372 of file SpaceSymmetry.h.

References SpaceSymmetry().

◆ 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 320 of file SpaceSymmetry.h.

References SpaceSymmetry().

◆ 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 393 of file SpaceSymmetry.h.

References normalize(), and SpaceSymmetry().

◆ 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 443 of file SpaceSymmetry.h.

References SpaceSymmetry().

◆ 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 426 of file SpaceSymmetry.h.

References SpaceSymmetry().

◆ 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 460 of file SpaceSymmetry.h.

References SpaceSymmetry().

◆ 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 480 of file SpaceSymmetry.h.

References SpaceSymmetry().


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