Fail to extend space-group with centring translations
Hello there, with the latest cctbx release, the following Python snippet fails from cctbx.sgtbx import * info = space_group_info("P2/a") g = info.group() g.expand_ltr(tr_vec((1,1,1),2)) The exception indicates that it is not possible to add a centring translation with a denominator of 2 to a group which does not have any centring translations with that denominator. Of course, in that case, that description is trivial because P2/a does not have any centring translations! My real intent was actually to introduce 1/3 centring translations so as to deal with a tripled cell. I am just citing the example above to show the extent of the problem. My original, failing, snippet was therefore from cctbx import sgtbx s = sgtbx.space_group_symbols("P21/c") g = sgtbx.space_group(s) g.expand_ltr(sgtbx.tr_vec((1,0,1),3)) g.expand_ltr(sgtbx.tr_vec((2,0,2),3)) It fails with the same class of exception. It seems like it is a deeply rooted limitation and that brings me to the bigger picture. I am currently working on an EPSRC grant to write the next generation of small molecule crystallographic software, a joint collaboration between Judith Howard in Durham and David Watkin in Oxford (all in UK, just in case…!). The CCTBX is obviously a seducing foundation for such a project. Thus we have tried to push it into corners which do actually matter to a significant minority of small molecule crystallographers. So I would like to know how difficult it would be to lift the limitation at hand. Would it trigger a cascade of changes throughout the sgtbx? Luc Bourhis
Hi Luc,
with the latest cctbx release, the following Python snippet fails
from cctbx.sgtbx import * info = space_group_info("P2/a") g = info.group() g.expand_ltr(tr_vec((1,1,1),2))
If you do it like this: from cctbx import sgtbx info = sgtbx.space_group_info("P2/a") g = info.group() t = sgtbx.tr_vec( (1,1,1), 2 ) t = t.new_denominator( g.t_den() ) g.expand_ltr( t ) print sgtbx.space_group_info(group=g) The trick lies in obtaining the translational denominator from the group it self and setting that value in your t vector. The same issue is there when multiplying in an extra rotation operator. In that case you need the g.r_den().
from cctbx import sgtbx s = sgtbx.space_group_symbols("P21/c") g = sgtbx.space_group(s) g.expand_ltr(sgtbx.tr_vec((1,0,1),3)) g.expand_ltr(sgtbx.tr_vec((2,0,2),3))
from cctbx import sgtbx info = sgtbx.space_group_info("P2/a") g = info.group() g.expand_ltr(sgtbx.tr_vec((1,0,1),3).new_denominator( g.t_den() ) ) g.expand_ltr(sgtbx.tr_vec((2,0,2),3).new_denominator( g.t_den() ) ) print sgtbx.space_group_info( group=g ) works.
It seems like it is a deeply rooted limitation and that brings me to the bigger picture. I am currently working on an EPSRC grant to write the next generation of small molecule crystallographic software, a joint collaboration between Judith Howard in Durham and David Watkin in Oxford (all in UK, just in case…!). The CCTBX is obviously a seducing foundation for such a project. Thus we have tried to push it into corners which do actually matter to a significant minority of small molecule crystallographers.
So I would like to know how difficult it would be to lift the limitation at hand. Would it trigger a cascade of changes throughout the sgtbx?
The r_den, t_den thing is confusing and using an approach with rational numbers would make sense. time time ... Cheers Peter
Hi Peter,
[…]
Thanks for your help.
The r_den, t_den thing is confusing and using an approach with rational numbers would make sense.
time time ...
This is indeed a bit confusing and impossible to guess from the documentation, unless I missed something. But it does what I wanted once the trick is learned. Probably not worth the effort from your point of view. As for my project, it would be easy to wrap the cctbx symmetry objects behind a proxy which may not expose the user to such a trick if it happens to be important to our programmers… thanks again, Luc
participants (2)
-
Luc Bourhis
-
Peter Zwart