wiki:SpaceGroupInterpreter

Version 10 (modified by toby, 11 years ago) (diff)

--

Space Group Interpreter

GSAS-II incorporates the unique space group interpretation code developed for GSAS by Alan Larson and maintained by Robert Von Dreele as a Python module that wraps the GSAS Fortran code and provides several Python functions. These codes work by performing group theory analysis on the supplied space group name, rather than looking it up from tables, so it is capable of generation of operators for all standard settings of space groups (in Origin 2 only, where a choice exists) plus a very large number of non-standard space group settings. The f2py tool supplied in SciPy integrates the Fortran code into Python quite nicely. The GSASIIspc.py is intended to be used as an independent module for programs needing space group interpretation capabilities.

The symmetry code includes routines:

  • SpcGroup: Determines cell and symmetry information from a short H-M space group name
  • SpaceGroup: Prints the results from SpcGroup in a nicely formatted way
  • GenAtom: Generates the full set of equivalent positions for a space group and one member of the set
  • SytSym: Determines the site multiplicity for a supplied fractional coordinate and classifies the site symmetry

See the documentation inside the code for more information.

The files used in this module are:

Unit Tests

Unit tests are provided that check that the results from SpcGroup and SpaceGroup are identical across platforms and match those computed independently (from program sgtbx in cctbx). Tests are done on SpcGroup and SpaceGroup on all 230 space groups. The SytSym & GenAtom routines are tested on representative space group settings against values taken from then International Tables Volume A.

The unit tests can be run by simply invoking the GSASIIspc.py file directly (python GSASIIspc.py). Alternately the python package nosetests which will run file unit_tests.py will test all defined unit tests in GSAS-II. Note that unit tests require as input files sgtbxtestinp.py and spctestinp.py in directory testinp/.

Binary distributions

Binary distributions are provided that include a compiled and linked version of GSASIIspc.py as a loadable library (.pyd on windows and .so on Linux and Mac/OS X). The binary distributions for a limited number of platforms are found here https://subversion.xor.aps.anl.gov/pyGSAS/binaries in directories named binXXXN.mproc/ where XXX can be win, mac or linux and N.m indicates the python version (2.5 or 2.6) and the optional suffix proc indicates a processor type, if not i86 (Intel 32-bit). The binary distributions can be placed in the directory with this name in the same location as the GSASIIspc.py file or in a directory named bin/. The GSASIIspc.pyd or GSASIIspc.so file can also be in any location in the python search path, but bin/ will be checked first and then binXXXN.mproc/.

Compiling and linking pyspg.for

A sample Makefile is provided to compile and link the Fortran routines used in GSAS-II. In all likelihood, all that is needed to changed in the file will be to provide values for the variables:

  • COMPILER: this defines the compiler options supplied to f2py
  • PACKCOPTS: this defines extra compiler options needed to compile the pack_f program (not used in GSASIIspg)
  • SUFFIX: name added to produced library (pyd or so)
  • F2PY: name of f2py program (f2py.py or f2py, if not in path, include a full path name.)
  • MOVE: name of program used to copy or move the compiled/linked library to directory bin/
  • DEL: delete command to be used after a copy or move
  • GSASlib: full path to GSAS library (needed only for pypowder, not used in GSASIIspg).

The provided Makefile has examples that have been used on all three platforms.