symmetry_operation
SymmetryOperation
Class to represent a crystallographic symmetry operation, composed of a rotation and a translation.
Attributes:
Name | Type | Description |
---|---|---|
rotation |
ndarray
|
(3, 3) rotation matrix in fractional coordinates |
translation |
ndarray
|
(3) translation vector in fractional coordinates |
Source code in chmpy/crystal/symmetry_operation.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
|
cif_form: str
property
Represent this SymmetryOperation in string form e.g. '+x,+y,+z'
integer_code: int
property
Represent this SymmetryOperation as a packed integer
seitz_matrix: np.ndarray
property
The Seitz matrix form of this SymmetryOperation
__add__(value)
Add a vector to this symmetry operation's translation vector.
Returns:
Name | Type | Description |
---|---|---|
SymmetryOperation |
a copy of this symmetry operation under additional translation" |
Source code in chmpy/crystal/symmetry_operation.py
__init__(rotation, translation)
Construct a new symmetry operation from a rotation matrix and a translation vector
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rotation
|
ndarray
|
(3, 3) rotation matrix |
required |
translation
|
ndarray
|
(3) translation vector |
required |
Returns:
Name | Type | Description |
---|---|---|
SymmetryOperation |
a new SymmetryOperation |
Source code in chmpy/crystal/symmetry_operation.py
__sub__(value)
Subtract a vector from this symmetry operation's translation.
Returns:
Name | Type | Description |
---|---|---|
SymmetryOperation |
a copy of this symmetry operation under additional translation" |
Source code in chmpy/crystal/symmetry_operation.py
apply(coordinates)
Apply this symmetry operation to a set of fractional coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coordinates
|
ndarray
|
(N,3) or (N,4) array of fractional coordinates or homogeneous fractional coordinates. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: (N, 3) array of transformed coordinates |
Source code in chmpy/crystal/symmetry_operation.py
from_integer_code(code)
classmethod
Alternative constructor from an integer-encoded symmetry operation e.g. 16484
See also the encode_symm_int
, decode_symm_int
methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
code
|
int
|
integer-encoded symmetry operation |
required |
Returns:
Name | Type | Description |
---|---|---|
SymmetryOperation |
a new symmetry operation from the provided integer code |
Source code in chmpy/crystal/symmetry_operation.py
from_string_code(code)
classmethod
Alternative constructor from a string encoded symmetry operation e.g. '+x,+y,+z'.
See also the encode_symm_str
, decode_symm_str
methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
code
|
str
|
string-encoded symmetry operation |
required |
Returns:
Name | Type | Description |
---|---|---|
SymmetryOperation |
a new symmetry operation from the provided string code |
Source code in chmpy/crystal/symmetry_operation.py
identity()
classmethod
inverted()
" A copy of this symmetry operation under inversion
Returns:
Name | Type | Description |
---|---|---|
SymmetryOperation |
an inverted copy of this symmetry operation |
decode_symm_int(coded_integer)
Decode an integer encoded symmetry operation.
A space group operation is compressed using ternary numerical system for rotation and duodecimal system for translation. This is achieved because each element of rotation matrix can have only one of {-1,0,1}, and the translation can have one of {0,2,3,4,6,8,9,10} divided by 12. Therefore 3^9 * 12^3 = 34012224 different values can map space group operations. In principle, octal numerical system can be used for translation, but duodecimal system is more convenient.
encode_symm_str(*decode_symm_int(16484)) '+x,+y,+z'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coded_integer
|
int
|
integer encoding a symmetry operation |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, np.ndarray]: (3,3) rotation matrix, (3) translation vector |
Source code in chmpy/crystal/symmetry_operation.py
decode_symm_str(s)
Decode a symmetry operation represented in the string form e.g. '1/2 + x, y, -z -0.25' into a rotation matrix and translation vector.
encode_symm_str(decode_symm_str("x,y,z")) '+x,+y,+z' encode_symm_str(decode_symm_str("1/2 - x,y-0.3333333,z")) '1/2-x,2/3+y,+z'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
str
|
the encoded symmetry operation string |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, np.ndarray]: a (3,3) rotation matrix and a (3) translation vector |
Source code in chmpy/crystal/symmetry_operation.py
encode_symm_int(rotation, translation)
Encode an integer encoded symmetry from a rotation matrix and translation vector.
A space group operation is compressed using ternary numerical system for rotation and duodecimal system for translation. This is achieved because each element of rotation matrix can have only one of {-1,0,1}, and the translation can have one of {0,2,3,4,6,8,9,10} divided by 12. Therefore 3^9 * 12^3 = 34012224 different values can map space group operations. In principle, octal numerical system can be used for translation, but duodecimal system is more convenient.
encode_symm_int(((1, 0, 0), (0, 1, 0), (0, 0, 1)), (0, 0, 0)) 16484 encode_symm_int(((1, 0, 0), (0, 1, 0), (0, 1, 1)), (0, 0.5, 0)) 1433663
Args: rotation (array_like): (3,3) matrix of -1, 0, or 1s encoding the rotation component of the symmetry operation translation (array_like): (3) vector of rational numbers encoding the translation component of the symmetry operation
Returns:
Name | Type | Description |
---|---|---|
int |
the encoded symmetry operation |
Source code in chmpy/crystal/symmetry_operation.py
encode_symm_str(rotation, translation)
Encode a rotation matrix (of -1, 0, 1s) and (rational) translation vector into string form e.g. 1/2-x,z-1/3,-y-1/6
encode_symm_str(((-1, 0, 0), (0, 0, 1), (0, 1, 0)), (0, 0.5, 1/3)) '-x,1/2+z,1/3+y' encode_symm_str(((1, 1, 1), (1, 0, 1), (0, 1, 0)), (0, 0.5, 1/3)) '+x+y+z,1/2+x+z,1/3+y'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rotation
|
array_like
|
(3,3) matrix of -1, 0, or 1s encoding the rotation component of the symmetry operation |
required |
translation
|
array_like
|
(3) vector of rational numbers encoding the translation component of the symmetry operation |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
the encoded symmetry operation |
Source code in chmpy/crystal/symmetry_operation.py
expanded_symmetry_list(reduced_symops, lattice_type)
Create an expanded list of symmetry operations from the minimum specification given a certain lattice type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reduced_symops
|
List[SymmetryOperation]
|
reduced list of symmetry operations |
required |
lattice_type
|
int
|
required |
Returns: List[SymmetryOperation]: an expanded list of symmetry operations given lattice type
Source code in chmpy/crystal/symmetry_operation.py
reduced_symmetry_list(full_symops, lattice_type)
Reduce an expanded list of symmetry operations to the minimum specification given a certain lattice type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
full_symops
|
List[SymmetryOperation]
|
list of symmetry operations |
required |
lattice_type
|
int
|
required |
Returns: List[SymmetryOperation]: minimal list of symmetry operations given lattice type