[cctbxbb] Problems with conversion from conventional to primitive cell

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Nov 24 09:37:40 PST 2005

--- Jörg-Rüdiger Hill <Joerg-Ruediger.Hill at scienomics.com> wrote:

> Dear All,
> I am trying to convert from a conventional cell to a primitive cell using
> cctbx, but I am having some problems.

Are you doing this in C++ or in Python?

> What I do is the following:
> 1) I construct a spaceGroup object using the space group symbol
> 2) I retrieve the change of basis operator using z2p_op() from the space
>    group object
> 3) I apply this operator to the conventional cell
> 4) I take a list of symmetry unique atoms and apply the operator to their
>   fractional coordinates
> At this point I have a primitive cell which agrees exactly with what I get
> from other codes.

Note that there are ambiguities in the choice of the change-of-basis operator
to the primitive cell. You may get different results from different programs,
which are all correct. It is a coincidence if you get the same result.

> The problem comes when I am trying to construct all atoms
> from the symmetry unique ones. I do this by the following procedure:
> 5) I take the space group object and call its change_basis() method with
>    the z2p_op() operator
> 6) I loop over all order_z() symmetry operations in the space group applying
>    the operation to the fractional coordinates making sure that I don't
>    create two atoms at the same position

You could use the site_symmetry and sym_equiv_sites classes to deal with the
special positions.

> The whole procedure works well, e. g., for cubic crystals. However, if I
> take a hexagonal crystal (e. g., Cr2O3, R -3 c) the crystal build by steps
> 5 and 6 above is not correct. In this case the conventional cell has a=b !=
> c,
> alpha=beta=90, and gamma=120, but the primitive cell has a=b=c and
> alpha=beta=gamma.

That's what I'd expect.

> I have tried to add ":R" to the space group symbol and
> constructing a new spaceGroup object in step 5 above, but that does not make
> any difference. What do I have to do to build the crystal in this case or
> what is wrong with my procedure ?

Attached is a copy of the new cctbx/cctbx/examples/cr2o3_primitive_cell.py
script (in the CVS already; will also be in the next set of auto-build
bundles). Could you please compare your results to the output of this script?

The script shows a high-level implementation. I could add a lower-level
equivalent that is more in line with what you'd do in C++. Let me know if this
is what you need.


from cctbx import xray
from cctbx import crystal
from cctbx.array_family import flex

def demo():
  Result of ICSD query:
    N * -Cr2O3-[R3-CH] Baster, M.;Bouree, F.;Kowalska, A.;Latacz, Z(2000)
    C 4.961950 4.961950 13.597400 90.000000 90.000000 120.000000
    S GRUP R -3 C
    A Cr1    0.000000 0.000000 0.347570 0.000000
    A O1    0.305830 0.000000 0.250000
  crystal_symmetry = crystal.symmetry(
    unit_cell="4.961950 4.961950 13.597400 90.000000 90.000000 120.000000",
    space_group_symbol="R -3 C")
  scatterers = flex.xray_scatterer()
    label="Cr1", site=(0.000000,0.000000,0.347570)))
    label="O1", site=(0.305830,0.000000,0.250000)))
  icsd_structure = xray.structure(
  primitive_structure = icsd_structure.primitive_setting()
  p1_structure = primitive_structure.expand_to_p1()
  print "OK"

if (__name__ == "__main__"):

Yahoo! Music Unlimited 
Access over 1 million songs. Try it free. 

More information about the cctbxbb mailing list