[cctbxbb] sgtbx.space_group and sgtbx.space_group_info query

Winter, Graeme (DLSLtd,RAL,LSCI) Graeme.Winter at diamond.ac.uk
Mon Oct 14 03:33:28 PDT 2019


HI Luc

Thanks for this - it’s a helpful description of the difference which would make a good addition to the documentation

Does not explain why the output is different (or whether the output _should_ be different) though

All the best Graeme

> On 14 Oct 2019, at 11:03, Luc Bourhis <luc_j_bourhis at mac.com> wrote:
> 
> Hi,
> 
> For the particular operation you showed, space_group_info is more efficient because it caches the result of determining space group type. The computation is delegated to an underlying sgtbx.space_group object. Asking such an object for the type results in a significant bunch of computations being done every time you ask. That’s because essentially a sgtbx.space_group object is just a list of rotation matrices and translation vectors. A space_group_info is more clever! 
> 
> Moreover, space_group_info provides an easy entry point for many operations which would otherwise be more obscure to write. For example, if you want to change the hand, without space_group_info, you would need to do, starting from a space_group object sg
> 
> sgt = sg.type()
> op = sgt.change_of_hand_op()
> sg_other_hand = sg.change_basis(op)
> 
> With a space_group_info sgi, you can just do
> 
> sgi_other_hand = sgi.change_hand()
> 
> to you get a new space_group_info with the opposite hand.
> 
> Best wishes,
> 
> Luc
> 
> 
> 
>> On 9 Oct 2019, at 18:08, Ben Williams <ben.williams at diamond.ac.uk> wrote:
>> 
>> Dear CCTBX devs,
>> 
>>  What is a sgtbx.space_group_info object, and why does it do something subtly different to sgtbx.space_group?
>> 
>>>>> from cctbx import sgtbx
>>>>> print(sgtbx.space_group('C2').type().universal_hermann_mauguin_symbol())
>>    P 1 2 1 (c,2*a+c,b)
>>>>> print(sgtbx.space_group_info('C2').group().type().universal_hermann_mauguin_symbol())
>>    C 1 2 1
>> 
>> sgtbx.space_group_info is notably lacking in docstring (or indeed comments in the code). sgtbx.space_group isn't too hot on the documentation either...
>> 
>>  Cheers,
>>   Ben
>> 
>> -- 
>> Ben Williams
>> Post-doctoral research associate
>> Scientific Software
>> Diamond Light Source
>> 
>> 
>> -- 
>> This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
>> Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
>> Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
>> _______________________________________________
>> cctbxbb mailing list
>> cctbxbb at phenix-online.org
>> http://phenix-online.org/mailman/listinfo/cctbxbb
> 
> 
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb




More information about the cctbxbb mailing list