Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantid::Geometry::SymmetryOperation Class Reference

Crystallographic symmetry operations are composed of a rotational component, which is represented by a matrix and a translational part, which is described by a vector. More...

#include <SymmetryOperation.h>

Public Member Functions

bool hasTranslation () const
 Returns true if the operation has a translational component. More...
 
std::string identifier () const
 Returns the string-identifier for this symmetry operation. More...
 
SymmetryOperation inverse () const
 Returns the inverse of the symmetry operation. More...
 
bool isIdentity () const
 Returns true if this is the identity operation. More...
 
const Kernel::IntMatrixmatrix () const
 Returns a const reference to the internally stored matrix. More...
 
bool operator!= (const SymmetryOperation &other) const
 Returns true if operatios are not equal. More...
 
SymmetryOperation operator* (const SymmetryOperation &operand) const
 Multiplication operator for combining symmetry operations. More...
 
template<typename T >
operator* (const T &operand) const
 Returns the transformed vector. More...
 
bool operator< (const SymmetryOperation &other) const
 Returns true if SymmetryOperation is "smaller" than other, determined by using the identifier strings. More...
 
bool operator== (const SymmetryOperation &other) const
 Returns true if matrix and vector are equal. More...
 
SymmetryOperation operator^ (size_t exponent) const
 Returns the symmetry operation, applied to itself (exponent) times. More...
 
size_t order () const
 Returns the order of the symmetry operation. More...
 
const V3RreducedVector () const
 SymmetryOperation::reducedVector. More...
 
 SymmetryOperation ()
 Default constructor, results in identity. More...
 
 SymmetryOperation (const Kernel::DblMatrix &matrix, const V3R &vector)
 Convenience constructor for double-matrices. More...
 
 SymmetryOperation (const Kernel::IntMatrix &matrix, const V3R &vector)
 Constructs a symmetry operation from a matrix component and a vector, derives order and identifier from matrix and vector. More...
 
 SymmetryOperation (const std::string &identifier)
 Construct a symmetry operation from a Jones faithful representation. More...
 
Kernel::V3D transformHKL (const Kernel::V3D &hkl) const
 Transforms an index triplet hkl. More...
 
const V3Rvector () const
 Returns a const reference to the internall stored vector. More...
 

Protected Member Functions

size_t getOrderFromMatrix (const Kernel::IntMatrix &matrix) const
 Returns the order of the symmetry operation based on the matrix. More...
 
V3R getReducedVector (const Kernel::IntMatrix &matrix, const V3R &vector) const
 
void init (const MatrixVectorPair< int, V3R > &matrixVectorPair)
 Initialize from matrix and vector. More...
 

Protected Attributes

std::string m_identifier
 
MatrixVectorPair< int, V3Rm_matrixVectorPair
 
size_t m_order
 
V3R m_reducedVector
 
Kernel::IntMatrix m_transposedInverseMatrix
 

Detailed Description

Crystallographic symmetry operations are composed of a rotational component, which is represented by a matrix and a translational part, which is described by a vector.

In this interface, each symmetry operation has a so-called order, which is an unsigned integer describing the number of times a symmetry operation has to be applied to an object until it is identical.

Furthermore, each symmetry operation has a string-identifier. It contains the Jones faithful representation of the operation, as it is commonly used in many crystallographic programs and of course the International Tables for Crystallography, where the symmetry operations and their representations may be found [1].

The Jones faithful notation is a very concise way of describing matrix/vector pairs. The matrix/vector pair of a two-fold rotation axis along z is for example:

Matrix      Vector
-1  0  0     0
 0 -1  0     0
 0  0  1     0

This is described by the symbol '-x,-y,z'. If it were a 2_1 screw axis in the same direction, the matrix/vector pair would look like this:

Matrix      Vector
-1  0  0     0
 0 -1  0     0
 0  0  1    1/2

And this is represented by the string '-x,-y,z+1/2'. In hexagonal systems there are often operations involving 1/3 or 2/3, so the translational part is kept as a vector of rational numbers in order to carry out precise calculations. For details, see the class Kernel::V3R.

Using the symmetry operations in code is easy, since SymmetryOperationSymbolParser is automatically called by the string-based constructor of SymmetryOperation and the multiplication operator is overloaded:

SymmetryOperation inversion("-x,-y,-z");
V3D transformed = inversion * V3D(1, 1, -1); // results in -1, -1, 1

The operator is templated and works for any object Kernel::IntMatrix can be multiplied with and V3R can be added to (for example V3R, V3D). Note that for the transformation of HKLs, the matrix needs to be transposed. In some cases, such as the example above, it does not matter, because the matrix is identical to its transposed. In general however, transposing is necessary, so there is a dedicated method for that:

SymmetryOperation sixFold("x-y,x,z");
V3D hklPrime = sixFold.transformHKL(V3D(1,0,0)); //

A special case is the multiplication of several symmetry operations, which can be used to generate new operations:

SymmetryOperation inversion("-x,-y,-z");
SymmetryOperation identity = inversion * inversion;

In context of Group, the vector of SymmetryOperation is wrapped onto the interval (0, 1] using the getUnitCellIntervalOperation-function.

Constructing a SymmetryOperation object from a string is heavy, because the string has to be parsed every time. It's preferable to use the available factory:

SymmetryOperation inversion =
    SymmetryOperationFactory::Instance().createSymOp("-x,-y,-z");

It stores a prototype of the created operation and copy constructs a new instance on subsequent calls with the same string.

SymmetryOperation-objects are for example used in PointGroup.

References: [1] International Tables for Crystallography, Volume A, Fourth edition, pp 797-798.

Author
Michael Wedel, Paul Scherrer Institut - SINQ
Date
25/07/2014

Definition at line 106 of file SymmetryOperation.h.

Constructor & Destructor Documentation

◆ SymmetryOperation() [1/4]

Mantid::Geometry::SymmetryOperation::SymmetryOperation ( )

Default constructor, results in identity.

Definition at line 16 of file SymmetryOperation.cpp.

References Mantid::Geometry::SymmetryOperationSymbolParser::getNormalizedIdentifier(), m_identifier, and m_matrixVectorPair.

Referenced by inverse(), operator*(), and operator^().

◆ SymmetryOperation() [2/4]

Mantid::Geometry::SymmetryOperation::SymmetryOperation ( const std::string &  identifier)

Construct a symmetry operation from a Jones faithful representation.

This method invokes SymmetryOperationSymbolParser and tries to parse the supplied string. Please not that parsing this string is not very efficient. If you have to create the same operations very often, use SymmetryOperationFactory, which works with the copy constructor - it's orders of magnitude faster.

Parameters
identifier:: Jones faithful representation of a symmetry operation

Definition at line 33 of file SymmetryOperation.cpp.

References identifier(), init(), and Mantid::Geometry::SymmetryOperationSymbolParser::parseIdentifier().

◆ SymmetryOperation() [3/4]

Mantid::Geometry::SymmetryOperation::SymmetryOperation ( const Kernel::IntMatrix matrix,
const V3R vector 
)

Constructs a symmetry operation from a matrix component and a vector, derives order and identifier from matrix and vector.

Definition at line 39 of file SymmetryOperation.cpp.

References init(), matrix(), and vector().

◆ SymmetryOperation() [4/4]

Mantid::Geometry::SymmetryOperation::SymmetryOperation ( const Kernel::DblMatrix matrix,
const V3R vector 
)

Convenience constructor for double-matrices.

Definition at line 44 of file SymmetryOperation.cpp.

References init(), matrix(), and vector().

Member Function Documentation

◆ getOrderFromMatrix()

size_t Mantid::Geometry::SymmetryOperation::getOrderFromMatrix ( const Kernel::IntMatrix matrix) const
protected

Returns the order of the symmetry operation based on the matrix.

From "Introduction to Crystal Growth and Characterization, Benz and Neumann, Wiley, 2014, p. 51."

Definition at line 196 of file SymmetryOperation.cpp.

References Mantid::Kernel::Matrix< T >::determinant(), matrix(), and Mantid::Kernel::Matrix< T >::Trace().

Referenced by init().

◆ getReducedVector()

V3R Mantid::Geometry::SymmetryOperation::getReducedVector ( const Kernel::IntMatrix matrix,
const V3R vector 
) const
protected

Definition at line 235 of file SymmetryOperation.cpp.

References matrix(), order(), and vector().

Referenced by init().

◆ hasTranslation()

bool Mantid::Geometry::SymmetryOperation::hasTranslation ( ) const

Returns true if the operation has a translational component.

Definition at line 115 of file SymmetryOperation.cpp.

References m_matrixVectorPair.

Referenced by Mantid::Geometry::SymmetryElementIdentityGenerator::canProcess(), Mantid::Geometry::SymmetryElementTranslationGenerator::canProcess(), and isIdentity().

◆ identifier()

std::string Mantid::Geometry::SymmetryOperation::identifier ( ) const

Returns the string-identifier for this symmetry operation.

Returns
Identifier of the symmetry operation

Definition at line 107 of file SymmetryOperation.cpp.

References m_identifier.

Referenced by Mantid::Geometry::SymmetryElementFactoryImpl::createSymElement(), export_SymmetryOperation(), Mantid::Geometry::operator<<(), and SymmetryOperation().

◆ init()

void Mantid::Geometry::SymmetryOperation::init ( const MatrixVectorPair< int, V3R > &  matrixVectorPair)
protected

◆ inverse()

SymmetryOperation Mantid::Geometry::SymmetryOperation::inverse ( ) const

Returns the inverse of the symmetry operation.

Definition at line 154 of file SymmetryOperation.cpp.

References inverse(), m_matrixVectorPair, and SymmetryOperation().

Referenced by Mantid::Geometry::SpaceGroupFactoryImpl::getTransformedSymbolOrthorhombic(), and inverse().

◆ isIdentity()

bool Mantid::Geometry::SymmetryOperation::isIdentity ( ) const

Returns true if this is the identity operation.

Definition at line 110 of file SymmetryOperation.cpp.

References hasTranslation(), and m_matrixVectorPair.

◆ matrix()

const Kernel::IntMatrix & Mantid::Geometry::SymmetryOperation::matrix ( ) const

◆ operator!=()

bool Mantid::Geometry::SymmetryOperation::operator!= ( const SymmetryOperation other) const

Returns true if operatios are not equal.

Definition at line 191 of file SymmetryOperation.cpp.

References operator==().

◆ operator*() [1/2]

SymmetryOperation Mantid::Geometry::SymmetryOperation::operator* ( const SymmetryOperation operand) const

Multiplication operator for combining symmetry operations.

This operator constructs from S1 (this) and S2 (other) a new symmetry operation SymOp' with

  SymOp'(M', v')

where M' = M1 * M2

and v' = (M1 * v2) + v1

and the components of v' are on the interval (0, 1].

Parameters
operand
Returns

Definition at line 148 of file SymmetryOperation.cpp.

References Mantid::Geometry::MatrixVectorPair< MatrixNumericType, VectorType >::getMatrix(), Mantid::Geometry::MatrixVectorPair< MatrixNumericType, VectorType >::getVector(), m_matrixVectorPair, and SymmetryOperation().

◆ operator*() [2/2]

template<typename T >
T Mantid::Geometry::SymmetryOperation::operator* ( const T &  operand) const
inline

Returns the transformed vector.

Definition at line 124 of file SymmetryOperation.h.

◆ operator<()

bool Mantid::Geometry::SymmetryOperation::operator< ( const SymmetryOperation other) const

Returns true if SymmetryOperation is "smaller" than other, determined by using the identifier strings.

Definition at line 188 of file SymmetryOperation.cpp.

References m_identifier.

◆ operator==()

bool Mantid::Geometry::SymmetryOperation::operator== ( const SymmetryOperation other) const

Returns true if matrix and vector are equal.

Definition at line 182 of file SymmetryOperation.cpp.

References m_matrixVectorPair.

Referenced by operator!=().

◆ operator^()

SymmetryOperation Mantid::Geometry::SymmetryOperation::operator^ ( size_t  exponent) const

Returns the symmetry operation, applied to itself (exponent) times.

Definition at line 161 of file SymmetryOperation.cpp.

References SymmetryOperation().

◆ order()

size_t Mantid::Geometry::SymmetryOperation::order ( ) const

◆ reducedVector()

const V3R & Mantid::Geometry::SymmetryOperation::reducedVector ( ) const

SymmetryOperation::reducedVector.

According to ITA, 11.2, the translation component of a symmetry operation can be termined with the following algorithm. First, a matrix \(W\) is calculated using the symmetry operation \(S\) and its powers up to its order \(k\), adding the matrices of the resulting operations:

\[ W = W_1(S^0) + W_2(S^1) + \dots + W_k(S^{k-1}) \]

The translation vector is then calculation from the vector \(w\) of the operation:

\[ t = \frac{1}{k}\cdot (W \times w) \]

For operations which do not have translation components, this algorithm returns a 0-vector.

Returns
Translation vector.

Definition at line 93 of file SymmetryOperation.cpp.

References m_reducedVector.

Referenced by Mantid::Geometry::SymmetryElementWithAxisGenerator::determineTranslation().

◆ transformHKL()

Kernel::V3D Mantid::Geometry::SymmetryOperation::transformHKL ( const Kernel::V3D hkl) const

Transforms an index triplet hkl.

Unlike coordinates, hkls are transformed using the inverse transformation matrix, as detailed in the footnote on ITA, page 766. This method performs the multiplication with the transposed matrix.

Parameters
hkl:: HKL index triplet to transform
Returns
:: Transformed index triplet.

Definition at line 127 of file SymmetryOperation.cpp.

References m_transposedInverseMatrix.

Referenced by Mantid::MDAlgorithms::MDNorm::buildSymmetryMatrix(), and Mantid::MDAlgorithms::MDNorm::calQTransform().

◆ vector()

const V3R & Mantid::Geometry::SymmetryOperation::vector ( ) const

Member Data Documentation

◆ m_identifier

std::string Mantid::Geometry::SymmetryOperation::m_identifier
protected

Definition at line 146 of file SymmetryOperation.h.

Referenced by identifier(), init(), operator<(), and SymmetryOperation().

◆ m_matrixVectorPair

MatrixVectorPair<int, V3R> Mantid::Geometry::SymmetryOperation::m_matrixVectorPair
protected

◆ m_order

size_t Mantid::Geometry::SymmetryOperation::m_order
protected

Definition at line 143 of file SymmetryOperation.h.

Referenced by init(), and order().

◆ m_reducedVector

V3R Mantid::Geometry::SymmetryOperation::m_reducedVector
protected

Definition at line 145 of file SymmetryOperation.h.

Referenced by init(), and reducedVector().

◆ m_transposedInverseMatrix

Kernel::IntMatrix Mantid::Geometry::SymmetryOperation::m_transposedInverseMatrix
protected

Definition at line 144 of file SymmetryOperation.h.

Referenced by init(), and transformHKL().


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