spinw icon indicating copy to clipboard operation
spinw copied to clipboard

Plotting orbitals

Open tsdev opened this issue 7 years ago • 3 comments

I am preparing the code for plotting orbitals (orbital-dev branch). It would be a great help if some of you could give a few tips how you would like to use it. Coordinate system The most difficult part of the user interface is, that the user needs to define an xyz coordinate system on the atom to show the orbitals. The main question is what would be the easiest/most reasonable way to do it. I have 2 ideas:

  • The user defines the orientation of the xyz coordinate system on the atom by selecting the central atom and 2 ligand atoms. The x-axis will point from central atom to ligand#1, and xy plane will be defined by the 3 atoms. Then I can draw d_xy, d_xz, etc. orbitals.
  • The user selects operators from the point group of the central atom which defines the orientations of the orbitals, for example selecting 4-fold rotation axes would set it to z-axis, etc. This is not yet clear how would work in the general case.
  • Which option (or a 3rd one) would you prefer to input the orientation of the orbitals?

Symmetry transformations After the user defined the orientation of the orbital on a selected atom, the orbital orientation will be transformed to all symmetry equivalent atoms. This could be switched off if the user requests (the system has lower symmetry than the given space group).

I am also curious any other new ideas! Example script plotting d_xy (works with orbital-dev branch):

R = [0 0 0;1 0 0;1 1 0;0 1 0]';
T = sw_rotmatd([0 0 1],90);
T = cat(3,T,T^2,T^3,T^4);
swplot.plot('type','orbital','qLabel','d_xy','position',R,'T',T,'scale',0.03,'nPatch',100,'color',{'red' 'green'});

And the result: http://pasteboard.co/D8UAtHj5S.png

tsdev avatar Feb 26 '17 22:02 tsdev

Having discussed it with a couple of interest people, we came to the conclusion that the first option is best since it is often the case that the central atom takes a Wyckoff position with site symmetry 1 so it will be the most general option.

PascalManuel avatar Feb 28 '17 23:02 PascalManuel

I implemented plotting orbitals, it is in the orbital-dev branch submission 1b66d52. Now you can plot p and d orbitals and the code will use the space group information to transform the orbitals on symmetry equivalent positions. For example the following code defines a fictitious crystal with P4 symmetry and puts d_xy orbitals at (1/4,1/4,1/2) and symmetry equivalent positions:

quad = spinw;
quad.genlattice('lat_const',[6 6 4],'spgr','P 4')
quad.addatom('r',[1/4 1/4 1/2],'S',1,'label','atom1')
plot(quad)
swplot.plotorbital('center',r0,'ligand1',[1 0 0],'ligand2',[0 1 0],'type','d_xy','color','red','color2','blue')

The result of the code is the following: screen shot 2017-03-09 at 14 04 23 Let me know if it worked for you and if there is any issue with the new code!

tsdev avatar Mar 09 '17 19:03 tsdev

Thanks Sandor. That s great! I am.going to the APS so not sure I ll have tine to play much with it for a week bit when I come back, I ll definitely will

Sent from my Windows Phone


From: Sándor Tóthmailto:[email protected] Sent: ‎09/‎03/‎2017 19:05 To: tsdev/spinwmailto:[email protected] Cc: Manuel, Pascal (STFC,RAL,ISIS)mailto:[email protected]; Commentmailto:[email protected] Subject: Re: [tsdev/spinw] Plotting orbitals (#30)

I implemented plotting orbitals, it is in the orbital-dev branch submission 1b66d52https://github.com/tsdev/spinw/commit/1b66d52af2e0e3e3490cb0d1f8db6057516bec31. Now you can plot p and d orbitals and the code will use the space group information to transform the orbitals on symmetry equivalent positions. For example the following code defines a fictitious crystal with P4 symmetry and puts d_xy orbitals at (1/4,1/4,1/2) and symmetry equivalent positions:

quad = spinw; quad.genlattice('lat_const',[6 6 4],'spgr','P 4') quad.addatom('r',[1/4 1/4 1/2],'S',1,'label','atom1') plot(quad) swplot.plotorbital('center',r0,'ligand1',[1 0 0],'ligand2',[0 1 0],'type','d_xy','color','red','color2','blue')

The result of the code is the following: [screen shot 2017-03-09 at 14 04 23]https://cloud.githubusercontent.com/assets/9294105/23766043/a1806cee-0503-11e7-81ed-705fc1494498.png Let me know if it worked for you and if there is any issue with the new code!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/tsdev/spinw/issues/30#issuecomment-285447897, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABGFWxJtwtT4Nxj1UpCRintmzLKYXuMbks5rkE1kgaJpZM4MMi3B.

PascalManuel avatar Mar 10 '17 08:03 PascalManuel