Author Topic: Error in code of Transmission pathway because of 'spin'  (Read 3967 times)

0 Members and 1 Guest are viewing this topic.

Offline Subhban15

  • Heavy QuantumATK user
  • ***
  • Posts: 54
  • Country: in
  • Reputation: 0
    • View Profile
Error in code of Transmission pathway because of 'spin'
« on: December 10, 2015, 12:37 »
Code
configuration = nlread('/root/Desktop/Device_perf_final2_4.nc', object_id='gID000')[0]

# -------------------------------------------------------------
# Transmission pathways
# -------------------------------------------------------------

# Loop over energies
energies = numpy.linspace(-2,0,3)
for energy in energies:
    transmission_pathways = TransmissionPathways(
    configuration=configuration,
    energy=energy*eV,
    kpoints=MonkhorstPackGrid(10,1),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    contributions=Left,
    spin=(Spin.Up,Spin.Down,Spin.Sum),
    self_energy_calculator=KrylovSelfEnergy(),
    )
    nlsave('/root/Desktop/Device_check_pathway_E0_2.nc', transmission_pathways)
    nlprint(transmission_pathways)
    
Is this code wrong in some way? I am getting this error Traceback (most recent call last):   File "/tmp/3312699940121523.py", line 22, in <module>     self_energy_calculator=KrylovSelfEnergy(), TypeError: __init__() got an unexpected keyword argument 'spin'

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Error in code of Transmission pathway because of 'spin'
« Reply #1 on: December 10, 2015, 15:15 »
As the error message says ... there is no "spin" keyword for TransmissionPathways, so remove that.
Your script is probably produced by 2014 or older version, the change was made in 2015, now all spin-related selection is done afterwards, when you plot the results.

Offline Subhban15

  • Heavy QuantumATK user
  • ***
  • Posts: 54
  • Country: in
  • Reputation: 0
    • View Profile
Re: Error in code of Transmission pathway because of 'spin'
« Reply #2 on: December 10, 2015, 20:27 »
I saw an old post of yours and tried building the script, but I have been trying to run it on 2014 version, yet the error.

You have said
now all spin-related selection is done afterwards, when you plot the results.

Could you please explain? Is there some functionality in viewer or are you talking about the "text representation" plug in, where I can get the data for up and down spins? But then is there an option in vnl for plotting the same?
Or will I have to extract the data and plot it using matlab, origin, etc? That's a tedious job, though...  :-\

P.S. Please make the necessary changes is this document as well http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.transmissionspectrum.html
which says
spin
The spin of the current

Type: Spin.Up | Spin.Down | Spin.Sum

Default: Spin.Sum
« Last Edit: December 11, 2015, 00:19 by Subhban15 »

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: Error in code of Transmission pathway because of 'spin'
« Reply #3 on: December 11, 2015, 07:57 »
TransmissionPathways and TransmissionSpectrum is not the same. The latter has no spin argument:
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.transmissionpathways.html

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Error in code of Transmission pathway because of 'spin'
« Reply #4 on: January 14, 2016, 23:52 »
You have to do things quite differently in 2014 and 2015, so don't mix up the two. When you plot the results in 2015 you can choose which spin components to see in the Transmission Analyzer.