Author Topic: plot the fatband of spin up electron for atomic orbital projection  (Read 2874 times)

0 Members and 1 Guest are viewing this topic.

Offline qiuweicheng

  • Heavy QuantumATK user
  • ***
  • Posts: 38
  • Country: cn
  • Reputation: 0
    • View Profile
Hi,
In the set of atomic orbital projection fatband, we can't distinguish the bands between spin up electron and spin down electron.
I try to solve this probelm.
I save the result of   atomic orbital projection fatband in 1.py file.
In the scatter line,  the data like this:
# Scatter
x = numpy.array([ 0.            ,  0.003333333333,  0.006666666667,  0.01          ,
                  0.013333333333,  0.016666666667,  0.02          ,  0.023333333333,
                  0.026666666667,  0.03          , .............,  1.0,
                   0.            ,  0.003333333333,  0.006666666667,  0.01          ,
                  0.013333333333,  0.016666666667,  0.02          ,  0.023333333333,
                  0.026666666667,  0.03          , .............,  1.0,
                    ..................................
 The band of spin up electron is list Followed by  the band of spin up electron .
The question:
How do I  distinguish  the datas between the spin up and spin down? or deal with this scatter line?
Could you give me the  relevant py file? or the relevant python commands?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
This is new feature so even I am a bit unused to it, but I think what you need to do is make several projections at the same time, for spin up and down separately. Then you can just choose different color for the projections in the GUI when you plot them. This cannot be done via the Script Generator, but actually the FatBandstucture object supports a lot more complex projection, via the Python interface. See the manual for details: http://docs.quantumwise.com/manuals/Types/FatBandstructure/FatBandstructure.html#fatbandstructure-c

Offline qiuweicheng

  • Heavy QuantumATK user
  • ***
  • Posts: 38
  • Country: cn
  • Reputation: 0
    • View Profile
thank you for your reply.
I  set py command according to the the manual:
    p3 = Projection(spin=Spin.Up),
    p1 = Projection(atoms=[Boron], l_quantum_number=[0, 1, 2])+Projection(atoms=[Carbon], l_quantum_number=[0, 1, 2])+Projection       (atoms=[Nitrogen], l_quantum_number=[0, 1, 2]),
    projections=p1*p3,
but, it is error:
TypeError: __init__() got an unexpected keyword argument 'l_quantum_number'

and then, i set the py command like this
projections=Projection(ProjectOnOrbitalsByElement, spin=Spin.Up)
but, it is also  error:
TypeError: __init__() got multiple values for keyword argument 'spin'

and then, i set the py command like this
projections=ProjectOnOrbitalsByElement*Projection(spin=Spin.Up),
but, it is also  error:
AttributeError: 'Projection' object has no attribute 'generate'

So, how can I make spin=Spin.Up and ProjectOnOrbitalsByElement projections at the same time? please help me

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
You just misspelled the keyword, it's "l_quantum_numbers", not "l_quantum_number"

Offline qiuweicheng

  • Heavy QuantumATK user
  • ***
  • Posts: 38
  • Country: cn
  • Reputation: 0
    • View Profile
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Analysis from File
# -------------------------------------------------------------
path = u'C:/Users/ThinkPad/.vnl/graphene-MD/band-Gr-BN.hdf5'
configuration = nlread(path, object_id='BulkConfiguration_0')[0]
# -------------------------------------------------------------
# Fat Bandstructure
#-------------------------------------------------------------
fat_bandstructure = FatBandstructure(
    configuration= configuration,
    route=['G', 'K', 'M'],
    points_per_segment=200,
    bands_above_fermi_level=All, 
    p3 = Projection(spin=Spin.Up),
    p1 = Projection(atoms=[Boron], l_quantum_numbers=[0, 1, 2])+Projection(atoms=[Carbon], l_quantum_numbers=[0, 1, 2])+Projection(atoms=[Nitrogen], l_quantum_numbers=[0, 1, 2]), 
    projections=p3*p1,
)
nlsave('band-Gr-BN.hdf5', fat_bandstructure)

Tt is also error:
NameError: name 'p3' is not defined

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
According to the online manual, you can not give the keyword agruments "p3" or "p1". That's the problem. You need instead to use only the keyword argument "projections", which may be a list of projections:
Code
p1 = Projection(atoms=[Boron], l_quantum_numbers=[0, 1, 2])+Projection(atoms=[Carbon], l_quantum_numbers=[0, 1, 2])+Projection(atoms=[Nitrogen], l_quantum_numbers=[0, 1, 2])
p3 = Projection(spin=Spin.Up)

fat_bandstructure = FatBandstructure(
    configuration= configuration,
    route=['G', 'K', 'M'],
    points_per_segment=200,
    bands_above_fermi_level=All,    
    projections=[p3,p1], # a list of the projections defined above
)

Offline qiuweicheng

  • Heavy QuantumATK user
  • ***
  • Posts: 38
  • Country: cn
  • Reputation: 0
    • View Profile
Thank you very much.
But, the  Projection(atoms=[Boron], l_quantum_numbers=[0, 1, 2])) is still used by the projection of spin=spin_sum, not the projection of spin=spin_up. and the results of projections=[p3,p1] is the sum of p3 and p1. see the attachments.
By the way,I want to calculate the ProjectOnOrbitalsByElement projections  used by the projection of spin=spin_up. How to solve it?
I write this py file according to the manual http://docs.quantumwise.com/manuals/Types/Projection/Projection.html#NL.Analysis.Projection.Projection

# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Analysis from File
# -------------------------------------------------------------
path = u'C:/Users/ThinkPad/.vnl/graphene-MD/band-Gr-BN.hdf5'
configuration = nlread(path, object_id='BulkConfiguration_0')[0]
# -------------------------------------------------------------
# Fat Bandstructure
#-------------------------------------------------------------
p1 = ProjectOnOrbitalsByElement
p3 = Projection(spin=Spin.Up)
fat_bandstructure = FatBandstructure(
    configuration= configuration,
    route=['G', 'K', 'M'],
    points_per_segment=200,
    bands_above_fermi_level=All,   
    projections=p1*p3, # a list of the projections defined above
)
nlsave('band-Gr-BN.hdf5', fat_bandstructure)

But, it is error:
Traceback (most recent call last):
  File "band-Gr-BN.py", line 17, in <module>
    projections=p1*p3, # a list of the projections defined above
  File "zipdir\NL\Analysis\FatBandstructure.py", line 122, in __init__
  File "zipdir\NL\Analysis\FatBandstructure.py", line 563, in setAndCheckProjections
  File "zipdir\NL\Analysis\ProjectionGenerator.py", line 271, in generate
AttributeError: 'Projection' object has no attribute 'generate'


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Why make it so complicated?
Why not just

p = [Projection(atoms=[Boron], l_quantum_numbers=[0, 1, 2], spin=Spin.Up), Projection(atoms=[Boron], l_quantum_numbers=[0, 1, 2], spin=Spin.Down)]