Re: writing potentials
Charles Schwieters <charles <at> schwieters.org>
2012-02-09 02:23:52 GMT
Hello Gary--
>
> 1.how do you write mixed python c /fortran based potentials using pypot?
> Specifically I wanted to use c for calculating energies and derivatives but
> python for all other set-up house keeping etc
Probably the closest example to what you want to do is
python/h3JNCPot.py in recent distributions. Depending on the nature of
the numerical calculations, builtin Xplor-NIH or numpy code might be
fast enough. If not, you'll have to go through swig.
> 2. how can I access the non bonded list from c or fortran and from
> python?
There is no easy way to do this. Our experience is that all nonbond
lists are different- different update frequency, distance cutoff,
etc. We just roll our own when necessary. An example can be found in
xplor/nmrPot/nbTargetPot.cc
> 3. in PyPot based potentials is calcEnergy guaranteed to be called before
> calcEnergyAndDerivs as shown in the example you give in the documentation
>
No. calcEnergy *can* be called separately (for instance, in Monte
Carlo algorithms) so that expensive gradient calculations aren't made,
calcEnergyAndDerivs must return an energy. One option is for
calcEnergyAndDerivs to call calcEnergy.
I hope this helps--
Charles
--
Charles Schwieters email: Charles <at> Schwieters.org
www: http://schwieters.org/cds
phone: (301) 402-4914 PGP key: http://schwieters.org/cds/pgp.txt
_______________________________________________
Xplor-nih mailing list
Xplor-nih <at> nmr.cit.nih.gov
http://dcb.cit.nih.gov/mailman/listinfo/xplor-nih