romerogroup/pyprocar

Spin texture plot error

Opened this issue · 7 comments

Hi,

I tried to plot rashba spliting with pyprocar.fermi2D. Here is my command.

import pyprocar
pyprocar.fermi2D(code='vasp',dirname='.', energy=1, spin_texture=True, no_arrow=True, arrow_projection='x', color_bar=True)

This command worked for BiSb example in pyprocar documentation. However, it made error for my file:

 ____        ____
|  _ \ _   _|  _ \ _ __ ___   ___ __ _ _ __ 
| |_) | | | | |_) | '__/ _ \ / __/ _` | '__|
|  __/| |_| |  __/| | | (_) | (_| (_| | |   
|_|    \__, |_|   |_|  \___/ \___\__,_|_|
       |___/
A Python library for electronic structure pre/post-processing.

Version 6.0.0 created on Jun 10th, 2021

Please cite:
 Uthpala Herath, Pedram Tavadze, Xu He, Eric Bousquet, Sobhit Singh, Francisco Muñoz and Aldo Romero.,
 PyProcar: A Python library for electronic structure pre/post-processing.,
 Computer Physics Communications 251 (2020):107080.


Developers:
- Francisco Muñoz
- Aldo Romero
- Sobhit Singh
- Uthpala Herath
- Pedram Tavadze
- Eric Bousquet
- Xu He
- Reese Boucher
- Logan Lang
- Freddy Farah
    
dirname         :  .
bands           :  None
atoms           :  [-1]
orbitals        :  [-1]
spin comp.      :  None
energy          :  1
rot. symmetry   :  1
origin (trasl.) :  [0, 0, 0]
rotation        :  [0, 0, 0, 1]
save figure     :  1
spin_texture    :  True
no_arrows       :  True
'str' object has no attribute 'dos'
_____________________________________________________
Useful band indices for spin-0 : [460 461]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/polyucmp/.local/lib/python3.8/site-packages/pyprocar/scripts/scriptFermi2D.py", line 235, in fermi2D
    fs.spin_texture(sx=symm.sx, 
  File "/home/polyucmp/.local/lib/python3.8/site-packages/pyprocar/core/fermisurface.py", line 319, in spin_texture
    bnew.append(griddata((x, y), band, (xnew, ynew), method="cubic"))
  File "/home/polyucmp/.local/lib/python3.8/site-packages/scipy/interpolate/_ndgriddata.py", line 268, in griddata
    ip = CloughTocher2DInterpolator(points, values, fill_value=fill_value,
  File "interpnd.pyx", line 899, in scipy.interpolate.interpnd.CloughTocher2DInterpolator.__init__
  File "_qhull.pyx", line 1841, in scipy.spatial._qhull.Delaunay.__init__
  File "_qhull.pyx", line 353, in scipy.spatial._qhull._Qhull.__init__
scipy.spatial._qhull.QhullError: QH6154 Qhull precision error: Initial simplex is flat (facet 1 is coplanar with the interior point)

While executing:  | qhull d Qz Qc Qt Q12 Qbb
Options selected for Qhull 2019.1.r 2019/06/21:
  run-id 1269081006  delaunay  Qz-infinity-point  Qcoplanar-keep  Qtriangulate
  Q12-allow-wide  Qbbound-last  _pre-merge  _zero-centrum  Qinterior-keep
  Pgood  _max-width 0.35  Error-roundoff 4.9e-16  _one-merge 3.4e-15
  Visible-distance 9.8e-16  U-max-coplanar 9.8e-16  Width-outside 2e-15
  _wide-facet 5.9e-15  _maxoutside 3.9e-15

The input to qhull appears to be less than 3 dimensional, or a
computation has overflowed.

Qhull could not construct a clearly convex simplex from points:
- p1(v4):  0.34     0  0.31
- p52(v3):  0.17     0  0.35
- p0(v2):  0.35     0  0.32
- p49(v1):     0     0     0

The center point is coplanar with a facet, or a vertex is coplanar
with a neighboring facet.  The maximum round off error for
computing distances is 4.9e-16.  The center point, facets and distances
to the center point are as follows:

center point   0.2165        0   0.2447

facet p52 p0 p49 distance=    0
facet p1 p0 p49 distance=    0
facet p1 p52 p49 distance=    0
facet p1 p52 p0 distance=    0

These points either have a maximum or minimum x-coordinate, or
they maximize the determinant for k coordinates.  Trial points
are first selected from points that maximize a coordinate.

The min and max coordinates for each dimension are:
  0:         0    0.3519  difference= 0.3519
  1:         0         0  difference=    0
  2:         0    0.3519  difference= 0.3519

If the input should be full dimensional, you have several options that
may determine an initial simplex:
  - use 'QJ'  to joggle the input and make it full dimensional
  - use 'QbB' to scale the points to the unit cube
  - use 'QR0' to randomly rotate the input for different maximum points
  - use 'Qs'  to search all points for the initial simplex
  - use 'En'  to specify a maximum roundoff error less than 4.9e-16.
  - trace execution with 'T3' to see the determinant for each point.

If the input is lower dimensional:
  - use 'QJ' to joggle the input and make it full dimensional
  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should
    pick the coordinate with the least range.  The hull will have the
    correct topology.
  - determine the flat containing the points, rotate the points
    into a coordinate plane, and delete the other coordinates.
  - add one or more points to make the input full dimensional.

I saw the Useful band indices for spin-0 : [460 461]. I think that most of plotting procedure have completed. Maybe last of steps made some error. Hope developers can help me solve this problem. Thanks! I upload my file in this onedrive link since it is too big. https://1drv.ms/u/s!AtO91yh6_pLhg8A51vik1x3lnDl1ZA?e=VY03Vh

It seems like my KPOINTS is not suitable for plotting spin texture:

Kpoints
50 
line
Reciprocal
0.5 0.0 0.0 1.0
0.0 0.0 0.0 1.0

0.0 0.0 0.0 1.0
0.0 0.0 0.5 1.0

This KPOINTS was used for band structure. Maybe not for spin texture.

Well , after I revised KPOINTS using pyprocar.generate2Dkmesh. Same error occured. Hope developers can help me.

The used grid interval is the one you used in your KPOINTS… if you still have problems after, please provide more details because it is hard to see where the problem comes from, if you want to share some data, that is also fine but I guess through email is hard… you have save it someplace and allow one of us to check it out soon…
::::____ Prof. Aldo Humberto Romero Director Research Computing, West Virginia University Eberly Family Distinguished Professor Fellow American Physical Society Editor Physica B, Assistant Editor EPJB Section Editor Papers in Physics Member of the Editorial Board of “Materials” and “Symmetry Physics” Physics and Astronomy Department West Virginia University 135 Willey Street, PO Box 6315 111 White Hall Morgantown, WV 26506 Phone: 304-293-6317 Fax: 304-293-5732 email: @.*** From: Tieyuan BIAN @.> Date: Thursday, August 3, 2023 at 10:17 AM To: romerogroup/pyprocar @.> Cc: Aldo Romero @.>, Comment @.> Subject: Re: [romerogroup/pyprocar] Spin texture plot error (Issue #123) Hi, Thanks for your reply. I realized my issue and recalculated with new KPOINTS which is a full grid. However, it made same error. I noticed in error message the min and max value is 0 and 0.3519. But in my grid generated by pyprocar, I set them in 0 and 0.5. May this caused the problem? Aldo Romero @.>于2023年8月3日 周四22:06写道:
To plot spin texture you need a grid, no a path!... you can plot the projection into the path and do some analysis from it but doing the texture will require the full grid. ::::____ Prof. Aldo Humberto Romero Director Research Computing, West Virginia University Eberly Family Distinguished Professor Fellow American Physical Society Editor Physica B, Assistant Editor EPJB Section Editor Papers in Physics Member of the Editorial Board of “Materials” and “Symmetry Physics” Physics and Astronomy Department West Virginia University 135 Willey Street https://www.google.com/maps/search/135+Willey+Street?entry=gmail&source=g, PO Box 6315 111 White Hall Morgantown, WV 26506 Phone: 304-293-6317 Fax: 304-293-5732 email: @.
From: Tieyuan BIAN @.> Date: Thursday, August 3, 2023 at 2:51 AM To: romerogroup/pyprocar @.> Cc: Subscribed @.> Subject: Re: [romerogroup/pyprocar] Spin texture plot error (Issue #123) It seems like my KPOINTS is not suitable for plotting spin texture: Kpoints 50 line Reciprocal 0.5 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.5 1.0 This KPOINTS was used for band structure. Maybe not for spin texture. ― Reply to this email directly, view it on GitHub< #123 (comment)>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AB24DTJ7R5RNVP7W7RYKMO3XTNC7RANCNFSM6AAAAAA272HOXU>. You are receiving this because you are subscribed to this thread.Message ID: @.> ― Reply to this email directly, view it on GitHub <#123 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5GJC6FURM6I6XZIH4BTOTTXTOV6LANCNFSM6AAAAAA272HOXU . You are receiving this because you authored the thread.Message ID: @.>
― Reply to this email directly, view it on GitHub<#123 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB24DTL2TDW55OQZCGCQJUDXTOXHDANCNFSM6AAAAAA272HOXU. You are receiving this because you commented.Message ID: @.
>

Sorry for my unclear reply.

Here is my KPOINTS.

Generated by PyProcar
100
Reciprocal
0.0000000 	0.0000000 	0.0000000 	1.0000000 
0.0000000 	0.0000000 	0.0555556 	1.0000000 
0.0000000 	0.0000000 	0.1111111 	1.0000000 
0.0000000 	0.0000000 	0.1666667 	1.0000000 
0.0000000 	0.0000000 	0.2222222 	1.0000000 
0.0000000 	0.0000000 	0.2777778 	1.0000000 
0.0000000 	0.0000000 	0.3333333 	1.0000000 
0.0000000 	0.0000000 	0.3888889 	1.0000000 
0.0000000 	0.0000000 	0.4444444 	1.0000000 
0.0000000 	0.0000000 	0.5000000 	1.0000000 
0.0555556 	0.0000000 	0.0000000 	1.0000000 
0.0555556 	0.0000000 	0.0555556 	1.0000000 
0.0555556 	0.0000000 	0.1111111 	1.0000000 
0.0555556 	0.0000000 	0.1666667 	1.0000000 
0.0555556 	0.0000000 	0.2222222 	1.0000000 
0.0555556 	0.0000000 	0.2777778 	1.0000000 
0.0555556 	0.0000000 	0.3333333 	1.0000000 
0.0555556 	0.0000000 	0.3888889 	1.0000000 
0.0555556 	0.0000000 	0.4444444 	1.0000000 
0.0555556 	0.0000000 	0.5000000 	1.0000000 
0.1111111 	0.0000000 	0.0000000 	1.0000000 
0.1111111 	0.0000000 	0.0555556 	1.0000000 
0.1111111 	0.0000000 	0.1111111 	1.0000000 
0.1111111 	0.0000000 	0.1666667 	1.0000000 
0.1111111 	0.0000000 	0.2222222 	1.0000000 
0.1111111 	0.0000000 	0.2777778 	1.0000000 
0.1111111 	0.0000000 	0.3333333 	1.0000000 
0.1111111 	0.0000000 	0.3888889 	1.0000000 
0.1111111 	0.0000000 	0.4444444 	1.0000000 
0.1111111 	0.0000000 	0.5000000 	1.0000000 
0.1666667 	0.0000000 	0.0000000 	1.0000000 
0.1666667 	0.0000000 	0.0555556 	1.0000000 
0.1666667 	0.0000000 	0.1111111 	1.0000000 
0.1666667 	0.0000000 	0.1666667 	1.0000000 
0.1666667 	0.0000000 	0.2222222 	1.0000000 
0.1666667 	0.0000000 	0.2777778 	1.0000000 
0.1666667 	0.0000000 	0.3333333 	1.0000000 
0.1666667 	0.0000000 	0.3888889 	1.0000000 
0.1666667 	0.0000000 	0.4444444 	1.0000000 
0.1666667 	0.0000000 	0.5000000 	1.0000000 
0.2222222 	0.0000000 	0.0000000 	1.0000000 
0.2222222 	0.0000000 	0.0555556 	1.0000000 
0.2222222 	0.0000000 	0.1111111 	1.0000000 
0.2222222 	0.0000000 	0.1666667 	1.0000000 
0.2222222 	0.0000000 	0.2222222 	1.0000000 
0.2222222 	0.0000000 	0.2777778 	1.0000000 
0.2222222 	0.0000000 	0.3333333 	1.0000000 
0.2222222 	0.0000000 	0.3888889 	1.0000000 
0.2222222 	0.0000000 	0.4444444 	1.0000000 
0.2222222 	0.0000000 	0.5000000 	1.0000000 
0.2777778 	0.0000000 	0.0000000 	1.0000000 
0.2777778 	0.0000000 	0.0555556 	1.0000000 
0.2777778 	0.0000000 	0.1111111 	1.0000000 
0.2777778 	0.0000000 	0.1666667 	1.0000000 
0.2777778 	0.0000000 	0.2222222 	1.0000000 
0.2777778 	0.0000000 	0.2777778 	1.0000000 
0.2777778 	0.0000000 	0.3333333 	1.0000000 
0.2777778 	0.0000000 	0.3888889 	1.0000000 
0.2777778 	0.0000000 	0.4444444 	1.0000000 
0.2777778 	0.0000000 	0.5000000 	1.0000000 
0.3333333 	0.0000000 	0.0000000 	1.0000000 
0.3333333 	0.0000000 	0.0555556 	1.0000000 
0.3333333 	0.0000000 	0.1111111 	1.0000000 
0.3333333 	0.0000000 	0.1666667 	1.0000000 
0.3333333 	0.0000000 	0.2222222 	1.0000000 
0.3333333 	0.0000000 	0.2777778 	1.0000000 
0.3333333 	0.0000000 	0.3333333 	1.0000000 
0.3333333 	0.0000000 	0.3888889 	1.0000000 
0.3333333 	0.0000000 	0.4444444 	1.0000000 
0.3333333 	0.0000000 	0.5000000 	1.0000000 
0.3888889 	0.0000000 	0.0000000 	1.0000000 
0.3888889 	0.0000000 	0.0555556 	1.0000000 
0.3888889 	0.0000000 	0.1111111 	1.0000000 
0.3888889 	0.0000000 	0.1666667 	1.0000000 
0.3888889 	0.0000000 	0.2222222 	1.0000000 
0.3888889 	0.0000000 	0.2777778 	1.0000000 
0.3888889 	0.0000000 	0.3333333 	1.0000000 
0.3888889 	0.0000000 	0.3888889 	1.0000000 
0.3888889 	0.0000000 	0.4444444 	1.0000000 
0.3888889 	0.0000000 	0.5000000 	1.0000000 
0.4444444 	0.0000000 	0.0000000 	1.0000000 
0.4444444 	0.0000000 	0.0555556 	1.0000000 
0.4444444 	0.0000000 	0.1111111 	1.0000000 
0.4444444 	0.0000000 	0.1666667 	1.0000000 
0.4444444 	0.0000000 	0.2222222 	1.0000000 
0.4444444 	0.0000000 	0.2777778 	1.0000000 
0.4444444 	0.0000000 	0.3333333 	1.0000000 
0.4444444 	0.0000000 	0.3888889 	1.0000000 
0.4444444 	0.0000000 	0.4444444 	1.0000000 
0.4444444 	0.0000000 	0.5000000 	1.0000000 
0.5000000 	0.0000000 	0.0000000 	1.0000000 
0.5000000 	0.0000000 	0.0555556 	1.0000000 
0.5000000 	0.0000000 	0.1111111 	1.0000000 
0.5000000 	0.0000000 	0.1666667 	1.0000000 
0.5000000 	0.0000000 	0.2222222 	1.0000000 
0.5000000 	0.0000000 	0.2777778 	1.0000000 
0.5000000 	0.0000000 	0.3333333 	1.0000000 
0.5000000 	0.0000000 	0.3888889 	1.0000000 
0.5000000 	0.0000000 	0.4444444 	1.0000000 
0.5000000 	0.0000000 	0.5000000 	1.0000000 

I upload my input file for Pyprocar to plot here https://1drv.ms/f/s!AtO91yh6_pLhg8E07E32lRw7nxHbQQ?e=GR7Vip.

Please check. Thanks for your reply.

Problem solved, translate and rotation is the cause. Here is my original POSCAR, which I have to rotate to plot x-z plane spin texture:

n4-single                               
   1.00000000000000     
     8.9273996353000005    0.0000000000000000    0.0000000000000000
     0.0000000000000000   64.4709014893000045    0.0000000000000000
     0.0000000000000000    0.0000000000000000    8.8816003799000001
   H    Pb   I    C    N 
    92     8    26    26    10
Direct
  0.5758297357166687  0.4903827417802102  0.2627901133497593
  0.6274400974600965  0.5172244593445906  0.2815425617526683
  0.6602269027770101  0.5916615752980088  0.4352811375066963
  0.3735496065688272  0.4824763406532190  0.7847291926615296
  ...

Then I manually roate it and recalculate, Here is my new POSCAR:

n4-single                               
   1.00000000000000     
   8.9273996353000000 	0.0000000000000000 	0.0000000000000000 
   0.0000000000000000 	8.8816003799000000 	0.0000000000000000 
   0.0000000000000000 	0.0000000000000000 	64.4709014893000000 
   H    Pb   I    C    N 
    92     8    26    26    10
Direct
0.5758297357166680 	0.2627901133497593	0.4903827417802102
0.6274400974600960 	0.2815425617526683	0.5172244593445906
0.6602269027770100 	0.4352811375066963	0.5916615752980088
0.3735496065688270 	0.7847291926615296	0.4824763406532190
0.3342149103948390 	0.9387701237513510	0.4075574220821555
0.8441278754112170 	0.2567095022476648	0.4820758014693710
0.7957457287365940 	0.1121280833056420	0.4977303530166223
0.5471329181491580 	0.2976057389738275	0.4041998049971277
0.1495588231430130 	0.7585634132958763	0.5166991013757758
0.2021610267924490 	0.6144165928575426	0.5012621758926373
...

Also I revised KPOINTS based on new POSCAR. Then error disappeared. I think the translate and rotation function for spin texture in Pyprocar might have some issues. Just my opinion.