Re: CST branch
Posted by Edward d'Auvergne on July 28, 2010 - 17:08:
I can't remember where, it has been a long time since we discussed
this, but somewhere in the discussion I though we decided that the
code example from:
should be switched to match your suggestion of:
That way the major loop is the spin loop, and then we loop over each
spin-specific interaction (which can be variable). So exactly the
code example you give. Sorry for the confusion.
On 27 July 2010 19:51, Pavel Kaderavek <pavel.kaderavek@xxxxxxxxx> wrote:
we are a bit confused by last few posts. In the post:
it is suggested to consider the interactions as higher level than the spin
and build the data matrix as follows:
Based on this we created an example:
However, in the post:
the example was commented in the following way:
"The first index is the spin and the second is the interaction - your
example here has this around the other way."
As it seems to be a bit contradictory and we would like to clarify this
point. We think that the correct order of the indices should be like this:
as mentioned in the last reply.
Generally, the code suggested in:
could be used with the following modifications:
# Create the data list of lists used to store the interaction
and spin specific data.
self.data = 
for spin_index in xrange(self.num_spins):
# Add an empty list for the spin.
# Total number of ri (only sum for the first interaction).
self.total_num_ri = self.total_num_ri + num_ri[spin_index]
# Loop over the interactions.
for int_index in xrange(self.num_interactions[spin_index]):
# The ratio of gyromagnetic ratios.
g_ratio = gh[spin_index][int_index] /
# Append the class instance Data to the interaction
list for this spin.
Pavel & Petr
Powered by MHonArc
, Updated Wed Jul 28 17:20:18 2010