QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: GJK on August 4, 2014, 18:28

Title: Total dipole moment
Post by: GJK on August 4, 2014, 18:28
Hi,

Dipole moment calculation as said by the script http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.electrondifferencedensity.html gives dipole moment for three axes.

How to calculate the total dipole moment???
Title: Re: Total dipole moment
Post by: Carsten on August 6, 2014, 10:54
if you have the dipole moment vector as [dx, dy, dz], than
take the norm as d_total = (d[0]**2 + d[1]**2 + d[2]**2)**0.5

hope that's what you meant.
Title: Re: Total dipole moment
Post by: GJK on August 10, 2014, 07:46
Dear Mr.Carsten

First of all thanks for the reply.But that is not my question actually from the link http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.electrondifferencedensity.html

The script calculated the dipoles and multipoles for my system.But the result is shown in three coordinates for center of mass,dipole etc...But actually the script is made as shown below to calculate the overall center of mass and dipole..But the results are displayed in three coordinates.

For example in the option Print monopole,print dipole I am getting three values instead of one which is the actual script.


center_of_mass = Mi*dX + Mj*dY+ Mk*dZ
m0 = density_sum*dV
m1 = (dX*dens_i + dY*dens_j + dZ*dens_k)*dV
print "center of mass (bohr)  = ", center_of_mass

print "monopole   (e)         = ", m0
print "dipole     (e*bohr)    = ", m1
print "quadropole (e*bohr**2) = "
print m2
Title: Re: Total dipole moment
Post by: Anders Blom on August 10, 2014, 08:18
Yes, the 3 components of the dipole moment VECTOR
Title: Re: Total dipole moment
Post by: GJK on August 10, 2014, 09:40
Ya Dr.Anders,

Question 1:
But the script says we get one value for dipole moment
eg: m1 = (dX*dens_i + dY*dens_j + dZ*dens_k)*dV is labelled as sum of three components which should be calulated and displayed as m1(single number) know???? but instead its displayed as three components.

Question 2:
 Mr.Carsten has given me the equation if you have the dipole moment vector as [dx, dy, dz], than
take the norm as d_total = (d[0]**2 + d[1]**2 + d[2]**2)**0.5
What does the number 2 and 0.5 indicate???


Title: Re: Total dipole moment
Post by: Anders Blom on August 10, 2014, 10:07
1. dens_ijk are numbers, but dX dY dZ are not, they are vectors (as clearly indicated by the way they are used to compute the total volume of the cell in the same script, in the manual).

2. Maybe you are actually asking about what ** means it is the Python notation for power, 3**2=9.
Title: Re: Total dipole moment
Post by: GJK on August 10, 2014, 10:23
Dear Dr.Anders,

Question 1:
I am getting my dipole moment  result as eg:[3.553,2.689,5.335] but the script is made clearly to give the total of the three numbers(dipole moment for full system know) know???
 So I should get a number for m1 at the nlprint rather than three values according to your script.That's my question???







Title: Re: Total dipole moment
Post by: kstokbro on August 10, 2014, 23:40
The dipole is a vector, what you ask for is the length of the vector which is easily calculated as Sqrt(mx*mx+my*my+mz*mz)
Title: Re: Total dipole moment
Post by: Dhirendra on October 13, 2017, 12:23
Hi,
The link to the script to calculate dipole moment is not working. It takes to the atk manual. Is it possible to share it?
Title: Re: Total dipole moment
Post by: Petr Khomyakov on October 13, 2017, 13:13
Try out this link https://docs.quantumwise.com/manuals/Types/ElectronDifferenceDensity/ElectronDifferenceDensity.html.
Title: Re: Total dipole moment
Post by: berna on February 5, 2018, 17:42
The page containing the script is missing. Could you please send me the total dipole moment script?
Title: Re: Total dipole moment
Post by: Anders Blom on February 6, 2018, 02:41
https://docs.quantumwise.com/manuals/Types/ElectronDensity/ElectronDensity.html#electrondensity-c
Title: Re: Total dipole moment
Post by: berna on February 6, 2018, 08:14
Thank you.
Title: Re: Total dipole moment
Post by: berna on February 18, 2018, 02:14
I run this script but gave an error like this:

"TypeError: 'PhysicalQuantity' object is not callable"

How can I solve the error?
Title: Re: Total dipole moment
Post by: Petr Khomyakov on February 19, 2018, 10:38
Which version of ATK are you using? I have been able to run the script (taken from that manual) with no problem, using ATK 2016.4 and 2017.12. 
Title: Re: Total dipole moment
Post by: berna on February 19, 2018, 13:09
I am using ATK 2017.1 and 2017.2.  Both of them gave same error. You can download my hdf5 file from this link:
https://www.dropbox.com/s/lkayzhsg9ran4hg/ns33-m.hdf5?dl=0

The script I used was attached as a file.

Title: Re: Total dipole moment
Post by: Petr Khomyakov on February 19, 2018, 15:38
Your script does not look like identical to the one in the manual. Generate the Electron Density and use the script from the manual. I enclose the script to my post.
Title: Re: Total dipole moment
Post by: berna on February 19, 2018, 16:12
Thank you. It worked.