tsdev / spinw

SpinW Matlab library for spin wave calculation
www.psi.ch/spinw
GNU General Public License v3.0
30 stars 35 forks source link

Plotting orbitals #30

Open tsdev opened 7 years ago

tsdev commented 7 years ago

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:

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

PascalManuel commented 7 years ago

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.

tsdev commented 7 years ago

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!

PascalManuel commented 7 years ago

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:notifications@github.com Sent: ‎09/‎03/‎2017 19:05 To: tsdev/spinwmailto:spinw@noreply.github.com Cc: Manuel, Pascal (STFC,RAL,ISIS)mailto:pascal.manuel@stfc.ac.uk; Commentmailto:comment@noreply.github.com 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.