seitz-symbol-0.1.0.0: Read and Display Seitz Symbol

Copyright(c) Jun Narumi 2020
LicenseMIT
Maintainernarumij@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Matrix.SeitzSymbol

Description

Read and Display Seitz Symbol

References

A. Michael Glazer et al. Seitz symbols Acta Cryst. (2014). A70

ネスポロ マッシモ:日本結晶学会誌 59,210-222(2017). https:/www.jstage.jst.go.jparticlejcrsj59559_210/_pdf

Synopsis

Documentation

type SeitzSymbol a = (String, String, (a, a, a), (Ratio a, Ratio a, Ratio a)) Source #

fromSeitzSymbolS :: (Integral a, Read a) => SourceName -> Either ParseError (Matrix (Ratio a)) Source #

for cubic, tetragonal, orthorhombic, monoclinic and triclinic crystal systems.

>>> prettyXYZ <$> fromSeitzSymbolS "{ 1 | 0 0 0 }"
Right "x,y,z"
>>> prettyXYZ <$> fromSeitzSymbolS "{ 2 010 | 1/2 1/2 1/2 }"
Right "-x+1/2,y+1/2,-z+1/2"
>>> prettyXYZ <$> fromSeitzSymbolS "{ 3+ 111 | 1/2 1/2 1/2 }"
Right "z+1/2,x+1/2,y+1/2"
>>> prettyXYZ <$> fromSeitzSymbolS "{ -3+ 111 | 1/2 1/2 1/2 }"
Right "-z+1/2,-x+1/2,-y+1/2"
>>> prettyXYZ <$> fromSeitzSymbolS "{ m 100 | 0 0 0 }"
Right "-x,y,z"
>>> (liftError . fromSeitzSymbolS) "{ 2 010 | 1/2 1/2 1/2 }" >>= fromMatrix
Right " 2 (0,1/2,0) 1/4,y,1/4"
>>> (liftError . fromSeitzSymbolS) "{ 3+ 111 | 1/2 1/2 1/2 }" >>= fromMatrix
Right " 3+(1/2,1/2,1/2) x,x,x"
>>> (liftError . fromSeitzSymbolS) "{ -3+ 111 | 1/2 1/2 1/2 }" >>= fromMatrix
Right "-3+ x,x,x; 1/4,1/4,1/4"
>>> (liftError . fromSeitzSymbolS) "{ m 100 | 0 0 0 }" >>= fromMatrix
Right " m  0,y,z"

fromSeitzSymbolHexS :: (Integral a, Read a) => String -> Either ParseError (Matrix (Ratio a)) Source #

for hexagonal and trigonal crystal systems.

>>> prettyXYZ <$> fromSeitzSymbolHexS "{ m 100 | 0 0 0 }"
Right "y-x,y,z"
>>> prettyXYZ <$> fromSeitzSymbolHexS "{ m 120 | 0 0 0 }"
Right "x-y,-y,z"
>>> prettyXYZ <$> fromSeitzSymbolHexS "{ 2 100 | 0 0 0 }"
Right "x-y,-y,-z"
>>> (liftError . fromSeitzSymbolHexS) "{ m 100 | 0 0 0 }" >>= fromMatrix
Right " m  x,2x,z"
>>> (liftError . fromSeitzSymbolHexS) "{ m 120 | 0 0 0 }" >>= fromMatrix
Right " m  x,0,z"
>>> (liftError . fromSeitzSymbolHexS) "{ 2 100 | 0 0 0 }" >>= fromMatrix
Right " 2  x,0,0"

toSeitzSymbolS :: (Integral a, Show a) => Matrix (Ratio a) -> Maybe String Source #

>>> toSeitzSymbolS . fromXYZ $ "x,y,z"
Just "{ 1 | 0 0 0 }"
>>> toSeitzSymbolS . fromXYZ $ "-x+1/2,y+1/2,-z+1/2"
Just "{ 2 010 | 1/2 1/2 1/2 }"