[CPMD-list] NMR: 2 possible bugs

Reinout Declerck reinout.declerck at UGent.be
Wed Dec 29 13:45:36 CET 2004


Hi all,

Upon studying the cpmd implementation of NMR, I noticed 2 rather odd things.

1) in nmr_p.F, line 97:

> l_c1 = 2*ngw*nstate
> if (Tcurrent) l_c1 = 6 * 2*ngw*nstate
> if (TNMR_FULL) l_c1 = 6 * 2*ngw*nstate
> if (Tcurrent .AND. TNMR_FULL) l_c1 = 9 * l_c1

the complex array c1 contains the corrections to the unperturbed KS-orbitals, and its dimensions in terms of real words are defined here with l_c1. Possible dimensions go from ngw x nstate with no extra's to a whopping 54 x ngw x nstate if a full calculation and a current calculation is desired. From my interpretation of the rest of the code, only 9 x 2 x ngw x nstate is needed with Tcurrent and TNMR_FULL switched on. 


2) in nmr_full_p.F, line 189:

> if (TCURRENT)
> & call DAXPY(2*ngw, 1.d0, c1(1,i_state,i_c1),1,
> & c1(1,i_state,i_c1+3),1)

Here, i_c1 = iB + 3. 

As the filename reveals, these lines are called when TNMR_FULL and Tcurrent are switched on. The dimensions of c1 are then 9 x ngw x nstate, and the corrections to the non-full calculation (of the corrections to the unperturbed KS-orbitals of the H^(p) perturbing Hamiltonian, that is) are stored in column 4-5-6, and then added up to the non-full calculation stored in column 7-8-9. When the subroutine calc_current is then called, the current is calculated from the first six columns, thus using the corrections to the corrections due to H^(p) only.

I wish to emphasize though that I could be wrong on this, so I look forward reading your comments!

Season's greetings to all of you,

Reinout Declerck

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cpmd.org/pipermail/cpmd-list/attachments/20041229/38154158/attachment.html 


More information about the CPMD-list mailing list