QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: fangyongxinxi on January 11, 2010, 09:01

Title: Could ATK calculate the "bond population" ?
Post by: fangyongxinxi on January 11, 2010, 09:01
Dear Sir,

ATK could calculate the mulli-population on atoms,
I wonder it could calculate the "bond population " or not ?
or can we use the atom-population to do something about the "bond population" ?
Thank you.
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on January 12, 2010, 13:18
I made a script once which could compute the Mulliken overlap populations. Not exactly the same thing as bond order, but it gives a similar picture. It's quite complex to use, however, and even more to plot the results (the computed quantity is a matrix, with pairs of all atoms...). I used Matlab to make the plot attached. If this is of interest, I can publish the script too, but I think I need to polish it a bit first...
Title: Re: Could ATK calculate the "bond population" ?
Post by: fangyongxinxi on January 13, 2010, 01:52
Looking forward
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on January 19, 2010, 09:20
The three attached scripts were, essentially, used to produce the figure in the previous post, in Matlab.

To use them (after downloading and saving in a suitable directory):

1) Edit the script calculate_overlap_populations.py. Probably you only need to change line 4, to give the correct name of the checkpoint file
2) Run the script, and pipe the output to a file, say "op.out"
3) In Matlab, edit the script op_plot.m, in particular line 4 to point to the relevant output file (op.out), and run it. You probably will need to play around with the parameters on lines 6-14 to get a nice plot

Hope it works for you! In the future, this should be possible to do in VNL.
Title: Re: Could ATK calculate the "bond population" ?
Post by: perfetti on October 11, 2012, 17:14
Hi every one,
    I want to calculate the Mulliken overlap populations. And I found this old post. However, the script is not compatible with the VNL 12.2.0 I am using. Typical error is like this: 
 
from ATK.TwoProbe import *
ImportError: No module named ATK.TwoProbe
   

I think I need to rewrite the script but I am not good at coding. Can anyone help me out with the coding, or tell me there's a way to calculate the MOP in vnl 12.2.0?
 
Best regards.

Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on October 11, 2012, 21:07
Very simple :)

Code: python
m = MullikenPopulation(configuration)
print m.bond(5,18)

gives you the Mulliken overlap population betweens atoms 5 and 18. And so on.

See http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.mullikenpopulation.html
Title: Re: Could ATK calculate the "bond population" ?
Post by: perfetti on October 11, 2012, 23:25
Thanks Dr. Blom.

But if there are many atoms in my device, could it just generate the MOP bonds between each other atoms at one time?

I also want to get the plot as showed in this post, is there any easy way to do it?

Thanks.

BR.
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on October 11, 2012, 23:31
For multiple atoms you would of course loop over all pairs of atoms, the function is fast anyway.

The plot is highly non-trivial, it was made with Matlab a long time ago. I have no alternative solution today, but VNL 13.2 is being engineered towards making such plots possible.
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on October 12, 2012, 11:03
Turns out I had a JMol version for an ancient ATK version. I modernized it to work with the new ATK. You need both files.

You need to edit the filename in the script to make it find your NC file with the converged calculation. Running the script as

atkpython mulliken_jmol_script.py

produces two files: an ".xyz" file and a ".jmol" file. Drop the ".xyz" file on JMol, then the ".jmol" file and then open File>Script Editor and click "Run"

Many plot options can be tuned, and are explained in the file. One may need to experiment with these a bit to get a good picture.
Title: Re: Could ATK calculate the "bond population" ?
Post by: perfetti on October 12, 2012, 17:31
1)I generated the two files, and throw them to Jmol as you said, then I opened File>Script Editor and click "Run",
but nothing happened.

2)What's the colormap.py for?
   So this time it has no relation with Matlab, only Jmol itself could get the final plot?

Thank you.


Turns out I had a JMol version for an ancient ATK version. I modernized it to work with the new ATK. You need both files.

You need to edit the filename in the script to make it find your NC file with the converged calculation. Running the script as

atkpython mulliken_jmol_script.py

produces two files: an ".xyz" file and a ".jmol" file. Drop the ".xyz" file on JMol, then the ".jmol" file and then open File>Script Editor and click "Run"

Many plot options can be tuned, and are explained in the file. One may need to experiment with these a bit to get a good picture.
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on October 13, 2012, 14:47
1. More info needed. Do you at least see the structure when dropping the XYZ file? Is the XYZ file correct?

2. No Matlab needed, I just encoded the Matlab colormaps into Python. Guess I could have used the colormaps from Matplotlib instead, but I didn't feel like rewriting this class right now.
Title: Re: Could ATK calculate the "bond population" ?
Post by: perfetti on October 15, 2012, 15:35
I was experimenting with a H2O molecule.
When I throw the xyz file into Jmol, it appears as the first pic,
after I throw the jmol file into it, it appears as the second pic.

Then I clicked  the run button, and no change appeared. It shaked once, and then stayed the same.
I don't know what should happen cause I never used Jmol before.

Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on October 15, 2012, 15:46
So, it looks good. This is precisely what it's supposed to do.
Title: Re: Could ATK calculate the "bond population" ?
Post by: perfetti on December 7, 2012, 19:44
Dear Dr. Blom and everyone,
       I am using your method to plot the mulliken population, it works well, but I have a few questions:
       1) does the generated bond thickness indicate the strength of the bond?
       2) If so, I got very thin bond in some area, but when I try to use the picture, the bond is too thin to be visible especially after shrank. Could one find a way to manipulate the thickness of the bond,( in scale), and thus it apppears in good looking?
       I am attatching the two files (.xyz, and .jmol) I got for reference.
      Best regards.
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on December 7, 2012, 20:03
In the Python file is a parameter called "cylinder_scaling". You can increase this.

The overlap population doesn't immediately indicate the absolute bond strength, but there is a correlation since a double bond is generally stronger than a single bond. So you could say it is a measure of the bond strength, however to actually compute the bond strength you need to do more work.
Title: Re: Could ATK calculate the "bond population" ?
Post by: perfetti on December 7, 2012, 21:05
Dear Dr. Blom,
       Can you tell me how to actually compute the bond strength? 
        :D
Title: Re: Could ATK calculate the "bond population" ?
Post by: Anders Blom on December 9, 2012, 23:42
The concept of "bond strength" in ambiguous. See http://en.wikipedia.org/wiki/Bond_strength. As you can see, indeed the Mulliken overlap population is one type of measure of the bond strength, but there are others, and each one is computed in a different way. As the Wikipedia page says, to calculate the bond energy "requires lengthy calculations, even for the simplest bonds", and similar is true for bond-dissociation energy. Plus, it's mostly a concept used for molecules where the system makes sense if you break a single bond.

So, for a complex system, probably the overlap population is as good as you can get it. As with most things - the important thing is to define and motivate why you quote and use a particular number in a publication, and not just rely on any standard definition of ambiguous concepts. So, don't call it "Bond Strength", just call it Mulliken overlap population, and say that you use this as a measure of the bond strength.