On 8 April 2010 17:23, Pavel Kaderavek <pavel.kaderavek@xxxxxxxxx> wrote:
Hi, I would do it as you suggested by "list of list" architecture, the outer loop would correspond to the loop over spins and the inner loop over the interactions. to sum up, here are the suggested changes in the __init__() method (class Mf, file mf.py) currently it is necessary to load for all spins one unit vector for xh one bond length for xh one gyromagnetic ratio of attached nucleus (proton) one csa
Hi, This is correct.
this needs to be changed to: list of units vectors over all dipole-dipole interactions and two unit vectors for CST (this correspond to two axially symmetric chemical shielding tensors to which the asymmetric chemical shielding tensor can be decomposed)
This is good. What do you think of having special arguments for these? For example in the future someone may come up with a better way to handle rhombic and non-collinear CSA (i.e. the spectral densities are different in different directions). So we could have a system whereby the interactions are classified. The first dimension of the unit vector list of lists would be the interaction, the second the spin pair, and the third are the 3D coordinates. A second argument such as 'interactions' could be added to identify each one. I.e. it could be something like: ..., interactions=['dipole-dipole', 'dipole-dipole', 'csa_split1', 'csa_split2'], ...
list of bond lengths
This first dimension can match the above 'interactions' arg.
list of gyromagnetic constants of attached nuclei
This can also match the interactions arg. The 'gx' arg could be renamed to gratio_spin and be a single value - the spin being looked at doesn't change, just the interactions. The 'gh' arg could be changed to something like 'gratio_ext' and turned into a list matching 'interactions' It would then have a value if the interaction is dipole-dipole, and be set to None for the CSA interactions. We don't need to specify that the interacting remote spin is covalently attached though.
two "csa" corresponding to mentioned CST tensors mentioned above
This could also be a list corresponding to 'interactions'. Set the values when needed, otherwise use None for dipole-dipole, etc. The point of having these all lists of the same length is just so that you don't have to deconvolute the incoming data to work out what belongs to what. You loop over 'interactions' in __init__() and pack the data container using the appropriate data. It will make the code much cleaner. What do you think? Regards, Edward