# [CP2K:2842] how to output current density

Hanning Chen chenh... at gmail.com
Thu Sep 16 20:17:42 UTC 2010

```Hi, Juerg,

I have figured out a way to build up the density matrix I need. But my
density matrix is in the form of two dimensional array, i.e., REAL(KIND=dp),
DIMENSION(N,N).

Could you tell me how to convert the 2D array into dbscr_obj matrix that
is needed by the subroutine "collocate_pgf_product_rspace"?

Thanks

Hanning

On Wed, Sep 15, 2010 at 3:33 PM, Hanning Chen <chenh... at gmail.com> wrote:

> Juerg,
>
>   My density matrix is anti-symmetric (i.e., M_ij and M_ji are conjugate to
> each other) instead of symmetric because it is under an external
> perturbation. It turns out that what I really need is
>
>    Summation_Over_n_m { (Rn * Im - Rm * In) * (phi_m) * (gradient(phi_n)) }
>
>  where Rn, Rm, In and Im are the Real and Imaginary parts of the orbital
> coefficients for the basis functions of phi_m and phi_n. Note that Rn, Rm,
> In and Im are all real numbers now.
>
>  How should I set up the parameters for the subroutine
> "collocate_pgf_product_rspace" ?
>
>   Thanks.
>
> Hanning
>
>
>
>
>
> On Wed, Sep 15, 2010 at 2:41 AM, Juerg Hutter <hut... at pci.uzh.ch> wrote:
>
>> Hi
>>
>> the routines work for real density matrices. You have to
>> be carefull with symmetry, is your density matrix non-symmetric?
>> If you have a complex density matrix you have to decompose
>> it yourself and pass the appropriate part to the routine
>> in order to get the real/imaginary part of the current
>> back.
>>
>>
>> regards
>>
>> Juerg
>>
>> ----------------------------------------------------------
>> Juerg Hutter                   Phone : ++41 44 635 4491
>> Physical Chemistry Institute   FAX   : ++41 44 635 6838
>> University of Zurich           E-mail: hut... at pci.uzh.ch
>> Winterthurerstrasse 190
>> CH-8057 Zurich, Switzerland
>> ----------------------------------------------------------
>>
>>
>> On Wed, 15 Sep 2010, Hanning Chen wrote:
>>
>>  Juerg,
>>>
>>>  Using calculate_drho_elec as the template, I ought to change the
>>> parameter
>>> Then, what I am supposed to get is the real part of the following
>>> expression:
>>>
>>>                                                     (phi*) x
>>>
>>> instead of the imaginary part that I really need.
>>>
>>> I guess there should exist an easy way to access the imaginary part of
>>> the
>>> product, but the output pw_grid seems to have the real part only....
>>>
>>>  Thanks for your kind help.
>>>
>>> Hanning
>>>
>>>
>>> On Tue, Sep 14, 2010 at 12:38 PM, Hanning Chen <chenh... at gmail.com
>>> >wrote:
>>>
>>>  Juerg,
>>>>
>>>>
>>>>  Thanks.
>>>>
>>>> Hanning
>>>>
>>>>
>>>> On Tue, Sep 14, 2010 at 11:19 AM, Juerg Hutter <hut... at pci.uzh.ch>
>>>> wrote:
>>>>
>>>>  Hi
>>>>>
>>>>> there is currently only the calculation of the response current
>>>>> density within the NMR code. To calculate the current
>>>>> density you have to call the routine
>>>>> calculate_rho_elec
>>>>> in the call to
>>>>> collocate_pgf_product_rspace.
>>>>>
>>>>> For a template see calculate_drho_elec
>>>>>
>>>>> regards
>>>>>
>>>>> Juerg
>>>>>
>>>>> ----------------------------------------------------------
>>>>> Juerg Hutter                   Phone : ++41 44 635 4491
>>>>> Physical Chemistry Institute   FAX   : ++41 44 635 6838
>>>>> University of Zurich           E-mail: hut... at pci.uzh.ch
>>>>> Winterthurerstrasse 190
>>>>> CH-8057 Zurich, Switzerland
>>>>> ----------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 14 Sep 2010, Hanning Chen wrote:
>>>>>
>>>>>  Dear CP2K community,
>>>>>
>>>>>>
>>>>>>  I am wondering if I can output the current density (Jx Jy Jz) in CP2K
>>>>>> as
>>>>>> defined in the following page:
>>>>>>
>>>>>>  http://en.wikipedia.org/wiki/Probability_current
>>>>>>
>>>>>>  Thanks.
>>>>>>
>>>>>> Hanning Chen
>>>>>> Northwestern University
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> "cp2k" group.
>>>>>> To post to this group, send email to cp... at googlegroups.com.
>>>>>> To unsubscribe from this group, send email to
>>>>>> >.
>>>>>>
>>>>>> For more options, visit this group at
>>>>>>
>>>>>>
>>>>>>
>>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups
>>>>> "cp2k" group.
>>>>> To post to this group, send email to cp... at googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> >.
>>>>>
>>>>> For more options, visit this group at
>>>>>
>>>>>
>>>>>
>>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "cp2k" group.
>>> To post to this group, send email to cp... at googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> For more options, visit this group at
>>>
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "cp2k" group.
>> To post to this group, send email to cp... at googlegroups.com.
>> To unsubscribe from this group, send email to