On 22 October 2010 18:26, Pavel Kaderavek <
pavel.kaderavek@xxxxxxxxx> wrote:
> Hi,
> I am continuing in the discussion started in my post
>
https://mail.gna.org/public/relax-devel/2010-09/msg00020.html
> It covers changes of functions func_mf.py, func_local_tm , func_diff,
> func_all and their equivalents for a first and second derivatives (class Mf,
> file maths_fns/mf.py).
>
> I would like to include into next patch also treatment of the fact, that it
> is necessary to sum together contributions of all interactions. It seems to
> me that the most suitable way is to do that by the modification just revised
> functions (func_mf.py, func_local_tm ...)
> I would suggest to initialize ri_prime before loop over interactions and
> then step by step add the contributions into the ri_prime:
>
> data = "" # the cases
> when `i` is replaced by `0` were discussed in your last mail
> ri_prime=0
>
>
> for j in xrange(self.num_interactions[i]):
>
> ...
> ...
>
> # Calculate the R1, R2, and sigma_noe values.
> ri_prime = ri_prime + data[j].create_ri_prime(data[j])
>
> data[0].ri_prime = ri_prime
>
>
> When the loop over interactions is finished the accumulated relaxation rate
> is copied into the data storage of the first interaction. Then it is
> possible to call functions, where total ri_prime is needed:
>
> # Calculate the NOE values.
> data[0].ri = data[0].ri_prime * 1.0
> for m in xrange(data[0].num_ri):
> if data[0].create_ri[m]:
> data[0].create_ri[m](data[0], m, data[0].remap_table[m],
> data[0].get_r1, params)
>
> # Calculate the chi-squared value.
> data[0].chi2 = chi2(data[0].relax_data, data[0].ri, data[0].errors)
>
> Regards,
> Pavel
>
> On 19 October 2010 13:49, Edward d'Auvergne <
edward@xxxxxxxxxxxxx> wrote:
>>
>> Hi,
>>
>> Sorry for the delay, I just came back from a 2 week holiday. This is
>> correct, the func_mf, func_local_tm, etc. methods are working on a
>> single spin. This is stored in self.data[0]. The other functions
>> work on multiple spin data located in self.data[0], self.data[1], etc.
>>
>> Regards,
>>
>> Edward
>>
>>
>>
>> On 14 October 2010 19:38, Pavel Kaderavek <
pavel.kaderavek@xxxxxxxxx>
>> wrote:
>> > Hi,
>> >
>> > I would like to announce a small clarification of my previous mail about
>> > changes in functions func_mf, func_local_tm, func_diff, func_all, and
>> > their
>> > derivatives (class Mf, file maths_fns/mf.py). Loop suggested in my last
>> > post:
>> >
>> >
https://mail.gna.org/public/relax-devel/2010-09/msg00020.html
>> >
>> > is valid just for the functions func_diff, func_all, and their
>> > equivalents
>> > for a first and second derivatives.
>> > While for the functions func_mf, func_local_tm, and corresponding
>> > derivatives the index of self.num_interactions should be set to `0`
>> > instead
>> > of index `i`
>> >
>> > for j in xrange(self.num_interactions[0]):
>> >
>> > (The rest of the loop remains the same)
>> > That comes from the fact that these functions (func_mf, func_local_tm,
>> > ...
>> > ) are called for each spin separately. As it is indicated by the
>> > preceding
>> > statement:
>> >
>> > data = "">
>> >
>> > Regards,
>> > Pavel
>> >
>> > On 29 September 2010 10:53, Edward d'Auvergne <
edward@xxxxxxxxxxxxx>
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> This is the perfect approach. It will abstract the calculations so
>> >> that we will not need to touch many of maths_fns modules. With this
>> >> code in place, I would aim at then making the test suite pass again by
>> >> having the correct data structures pass into maths_fns.mf. The last
>> >> step would be to input CSA tensors and the multi-dipole interactions
>> >> via user functions. If you make a patch for all of the func_*(),
>> >> dfunc_*(), and d2func_*() methods, I can check and apply it quickly.
>> >>
>> >> Regards,
>> >>
>> >> Edward
>> >>
>> >>
>> >> On 28 September 2010 12:07, Pavel Kaderavek <
pavel.kaderavek@xxxxxxxxx>
>> >> wrote:
>> >> > Hi,
>> >> > we were thinking about next necessary changes in the CST branch.
>> >> >
>> >> > Now we need to break through the problem, which implies the fact we
>> >> > split
>> >> > the relaxation rate calculation into contributions of individual
>> >> > interactions. Each of them has its own data class to store its
>> >> > parameters
>> >> > (so far called data[i][j], where the [i] was a spin index and [j] was
>> >> > the
>> >> > interaction index).
>> >> >
>> >> > It seems to us, that it the best way to deal with it is to edit
>> >> > functions:
>> >> > func_mf, func_local_tm , func_diff, func_all and their equivalents
>> >> > for a
>> >> > first and second derivatives (defined in mf.py file).
>> >> >
>> >> > Within these functions the calculations of direction cosines,
>> >> > diffusion
>> >> > tensor weight calculations, components of the spectral densities and
>> >> > so
>> >> > on
>> >> > are performed. All these must be calculated for each interaction
>> >> > separately,
>> >> > because each interaction has its own data storage (which replaced
>> >> > previously
>> >> > used one data class container for the whole IS spin system).
>> >> >
>> >> > Instead of:
>> >> >
>> >> >
>> >> > # Direction cosine calculations.
>> >> > if self.diff_data.calc_di:
>> >> > self.diff_data.calc_di(data, self.diff_data)
>> >> >
>> >> > # Diffusion tensor weight calculations.
>> >> > self.diff_data.calc_ci(data, self.diff_data)
>> >> >
>> >> > # Diffusion tensor correlation times.
>> >> > self.diff_data.calc_ti(data, self.diff_data)
>> >> >
>> >> > # Calculate the components of the spectral densities.
>> >> > if data.calc_jw_comps:
>> >> > data.calc_jw_comps(data, params)
>> >> >
>> >> > # Calculate the R1, R2, and sigma_noe values.
>> >> > data.ri_prime = data.create_ri_prime(data)
>> >> >
>> >> >
>> >> > we would suggest to introduce a loop over interacations
>> >> > for j in xrange(self.num_interactions[i]):
>> >> > # Direction cosine calculations.
>> >> > if self.diff_data.calc_di:
>> >> > self.diff_data.calc_di(data[j], self.diff_data)
>> >> >
>> >> > # Diffusion tensor weight calculations.
>> >> > self.diff_data.calc_ci(data[j], self.diff_data)
>> >> >
>> >> > # Diffusion tensor correlation times.
>> >> > self.diff_data.calc_ti(data[j], self.diff_data)
>> >> >
>> >> > # Calculate the components of the spectral densities.
>> >> > if data.calc_jw_comps:
>> >> > data.calc_jw_comps(data[j], params)
>> >> >
>> >> > # Calculate the R1, R2, and sigma_noe components.
>> >> > data.ri_prime = data.create_ri_prime(data[j])
>> >> >
>> >> >
>> >> > It must be accompanied in the next step by a change the ri_prime
>> >> > function so
>> >> > that it just calculate only a product of specific interaction
>> >> > constant
>> >> > and
>> >> > corresponding linear combination of spectral densities. While the
>> >> > final
>> >> > sumation over all interactions should be done in a separate step.
>> >> >
>> >> > Moreover it will be also necessary to distinguish within the function
>> >> > setup_equation the type of equation used for contribution of
>> >> > individual
>> >> > interactions according to their type.
>> >> >
>> >> > Best
>> >> > Pavel
>> >> >
>> >> >
>> >> > On 10 September 2010 15:43, Edward d'Auvergne <
edward@xxxxxxxxxxxxx>
>> >> > wrote:
>> >> >>
>> >> >> Hi Pavel,
>> >> >>
>> >> >> I missed it in the patches, but there were tab characters '\t'
>> >> >> causing
>> >> >> problems. These are now fixed. relax requires that a tab is
>> >> >> replaced
>> >> >> by 4 spaces. I have also added you to the copyright notices
>> >> >> (
http://svn.gna.org/viewcvs/relax?view=rev&revision=11543) of the
>> >> >> files you have modified.
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Edward
>> >> >>
>> >> >> On 10 September 2010 15:36, Edward d'Auvergne <
edward@xxxxxxxxxxxxx>
>> >> >> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > I've carefully checked the patches and committed them with the
>> >> >> > messages you wrote. Sorry again for the delays. It should be
>> >> >> > faster
>> >> >> > now that I am no longer in the tropical wilderness of far north
>> >> >> > Australia.
>> >> >> >
>> >> >> > Regards,
>> >> >> >
>> >> >> > Edward
>> >> >> >
>> >> >> >
>> >> >> > On 6 September 2010 13:23, Edward d'Auvergne
>> >> >> > <
edward@xxxxxxxxxxxxx>
>> >> >> > wrote:
>> >> >> >> Hi Pavel,
>> >> >> >>
>> >> >> >> Sorry for the delayed response. I was at the ICMRBS conference
>> >> >> >> in
>> >> >> >> Australia and then travelled through the tropical north end of
>> >> >> >> Australia afterwards. I came back yesterday out of the remote
>> >> >> >> wilderness and can soon start looking at this patches.
>> >> >> >>
>> >> >> >> Regards,
>> >> >> >>
>> >> >> >> Edward
>> >> >> >>
>> >> >> >>
>> >> >> >> On 31 August 2010 18:00, Pavel Kaderavek
>> >> >> >> <
pavel.kaderavek@xxxxxxxxx>
>> >> >> >> wrote:
>> >> >> >>> Hi,
>> >> >> >>>
>> >> >> >>> some time ago, we submitted two patches regarding CST branch. We
>> >> >> >>> are
>> >> >> >>> not
>> >> >> >>> sure if we should wait for some additional comment from your
>> >> >> >>> side,
>> >> >> >>> or
>> >> >> >>> we can
>> >> >> >>> continue with introducing further changes in the code.
>> >> >> >>> Next step would be a splitting of the relaxation equation so
>> >> >> >>> that
>> >> >> >>> contribution to the relaxation due to the individual types of
>> >> >> >>> interaction
>> >> >> >>> (dipole-dipole, CSA) can be calculated separately.
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> Regars,
>> >> >> >>>
>> >> >> >>> Pavel, Petr
>> >> >> >>>
>> >> >> >>
>> >> >> >
>> >> >
>> >> >
>> >
>> >
>
>