Crystallographica review

Crystallographica – a software toolkit for crystallography

J. Appl. Cryst. (1997) 30 418-419
Copyright International Union of Crystallography

Have you ever tried to write a program visualizing the succession of phase transitions in the powder pattern of ferroelectric BaTiO3? Such a problem is not easily solved and requires advanced programming techniques, using graphing as well as crystallographic computing. A set of subroutines, dedicated to crystallographic computing, integrated with graphing and plotting routines, would surely make such a task easier. Such a system is now available: Oxford Cryosystems’ Crystallographica is a suite of crystallographic routines, functions, predefined variables and macros, complemented by a data-graphing engine and a crystal-plotting package.Oxford Cryosystems inform us that the latest version of Crystallographica now incorporates VRML output for structure drawing and a new window displaying the reciprocal lattice. The routines are accessible either interactively through a Pascal interpreter or through a script written in Pascal. A convenient front end lets users import SHELX files and Crystallographic Information Files (CIFs) directly. A standard ASCII file import similar to LAZY PULVERIX format is, however, not available. The data are then stored in a crystallographic structure of variables, allowing the quick computation of properties. If any one of these variables is changed, dependent values get updated automatically. This automatic check for self-consistency is very convenient and helps to avoid error propagation. The routines and functions available in Crystallographica can access and modify the values in this structure, allowing for instance the calculation of the density or an angle between planes etc.

Running Crystallographica gives access to a graphical user interface. The interactive mode is easy and straightforward, working in a console window with the functions accessible via the command line, or partially through the menu items. The interpreter accepts Pascal commands, which takes some getting used to, but is adequate for the task. In interactive mode, Crystallographica operates as a convenient crystallographic desktop calculator. A powder-pattern calculation is at your fingertips, and so is a display routine that gives ball-and-stick representations of the structure. The powder-pattern routines include various profile functions and it is easy to set options for the display. Zooming in/out and pattern shifting can be accessed via buttons. The structure-graphing engine is also accessible via a button, and rotations may be done using the mouse. The structure drawing is not as sophisticated as in other programs, but the simplicity of the interface and the input makes up for these shortcomings.

The symmetry treatment in Crystallographica is done either through a look-up table (via the short Hermann – Maugin symbol) or via space-group generators. The latter allow for user-defined symmetries in nonstandard settings, as well as nonstandard supergroups, like F4/mmm. Such a treatment for symmetry is both elegant and powerful, if, for instance, one wants to explore various group/subgroup relationships and the effects on the multiplicity of the atomic positions. However, the program provides no checks (yet?) of the self-consistency of the symmetry produced. An elegant symmetry-generation program, giving generators and checking for self-consistency, is actually incorporated in GSAS and NRCVAX, and this can be used to obtain the basic generator set for all possible self-consistent space-group symbols.

A small script was written as a test program, which illustrates the oxidation/reduction of the high-Tc superconductor YBa2Cu3O7-x, starting out as an orthorhombic structure with full oxygen content (x = 0) and going to the tetragonal oxygen-deficient structure (x = 1). The transition was set up, for ease of use, as being linear with the oxygen content and without internal rearrangement of the atoms. This is not quite correct but does little to the overall changes in the intensity calculation. The data for YBa2Cu3O7-x were previously entered into a CIF (Y123.cif, a = 3.827, b = 3.877, c = 11.708 A and O4 in (0,1/2,0), making the data available in a script. The script is given here.

{ procedure declaration ModifyCell }

procedure ModifyCell(n:integer);

var a,a1,b,b1,c,c1,occupancy,occ1:real;
var i:integer;

begin
    { first get the unit cell and }
    { occupancy parameters from the CIF }
    GetCell(a,b,c);
    GetOccupancy("O4",occupancy);
    for i:=1 to n do
    begin
        { modify parameters in steps of 1/n }
        a1:=a+(i*0.031/n);
        b1:=b-(i*0.019/n);
        c1:=c+(i*0.156/n);
        occ1:=occupancy*i/n;
        { write modified parameters back }
        SetOccupancy("O4",occ1);
        SetCell(a1,b1,c1);
    end;
    { reset to initial parameters }
    SetCell(a,b,c);
    SetOccupancy("O4",occupancy);
end; { End of procedure definition }

{ Executable statements }

{ Read CIF }
ReadCif("Y123.cif");

{ Prepare powder simulation }
SetPowderRange(20,30,0.01);
AddGraph("Powder Simulation","","");
PlotPowder("Powder Simulation","Y123");

{ Continuously cycle, modify parameters }
{ in steps of 1/10 }
while true do ModifyCell(10);

The script changes the occupancy of the oxygen position in steps of 10%, together with the lattice parameters that in a predefined parameter structure contain the information for YBa2Cu3O7-x. After each change, the powder pattern is recalculated and displayed and, after each full cycle, the parameters are reset to the values for the fully oxidized system. The result is an animated powder pattern, where the orthorhombic splitting of the peaks is gradually removed, changing the peak appearance and, to some extent, the intensities. This animation is quite instructive, showing the merging of peaks and a pseudotetragonal pattern long before the last (metrically tetragonal) pattern is displayed. Various resolution/peak-shape functions may also be explored in order to investigate their effects on the powder pattern.

Developing scripts in Crystallographica is easy, but for people not familiar with Pascal, a debugger would be quite useful. The strictly enforced Pascal syntax can be the source of long error messages. A simple debugger examining each line of code and checking for the correctness of the syntax would be useful, so errors do not propagate. After some tinkering with scripts, it is straightforward to develop your own, either for teaching or research.

There are obviously other programs available that are capable of doing similar things to Crystallographica. For example, the freely available (DOS version) POWDERCELL program displays the structure as well as the powder pattern, gives distances etc. but does not provide access to specific functions and does not allow one to write scripts. On the other hand, systems like CERIUS do give superior visualization and ease of use in the user interface, but also require more powerful computers and do cost substantially more. Crystallographica with its seamless integration of graphing and crystallographic computing presents an extremely useful compromise. The tool set of functions as well as the display capabilities allowing one to produce `animation sequences’ lets one write scripts that can address many crystallographic problems that would otherwise require extensive programming.

Crystallographica was installed on a 486/66 processor with 16 MBytes of memory and was run under Windows 95. The performance was adequate, giving acceptable update rates of any of the animated script examples that were included in the distribution. A Pentium-processor-based system is expected to give a better performance, but even a 386 processor could be used, albeit with considerably poorer performance.

Crystallographica is definitively recommended for anybody involved in X-ray diffraction who needs to write programs dealing with nonstandard problems, integrating graphing as well as powder-pattern calculations. It is a great tool for teaching aspects of symmetry and diffraction, and it is strongly recommended.

THEO SIEGRIST
Bell Laboratories
Lucent Technologies Inc.
Murray Hill
NJ 07974
USA