Author Topic: Reading Spin Dependent Transmission Data from nc file  (Read 4390 times)

0 Members and 1 Guest are viewing this topic.

Offline Hasan Sahin

  • Heavy QuantumATK user
  • ***
  • Posts: 44
  • Reputation: 0
    • View Profile
Reading Spin Dependent Transmission Data from nc file
« on: December 13, 2009, 15:00 »
Hello, I use the script given in ATK tutorial but it works only for unpolarized systems. How I must modify it to get up and down spin transmissions.

The script is :

from ATK.TwoProbe import *
from ATK.MPI import processIsMaster

old_scf_zero_bias = \
    restoreSelfConsistentCalculation("bare.nc")

temporary_list = range(-50,50,1)
energy_list = []
for i in temporary_list:
    energy_list.append(i/10.0)

trans_spectrum = calculateTransmissionSpectrum(
       old_scf_zero_bias,
       energies = energy_list*electronVolt
       )

trans_energy = trans_spectrum.energies()
trans_coeff = trans_spectrum.coefficients()
trans_energy = trans_energy.tolist()
trans_energy.reverse()
trans_coeff = trans_coeff.tolist()
trans_coeff.reverse()

while len(trans_energy)>0:
    if processIsMaster(): print trans_energy.pop(),'\t',trans_coeff.pop()

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Reading Spin Dependent Transmission Data from nc file
« Reply #1 on: December 13, 2009, 22:29 »
The object returned by coefficients() will be an array with two elements in this case, for spin up and down. Since I don't much care for the list mangling with reverse and pop, I would do:
Code
trans_coeff = trans_spectrum.coefficients()
print "E / eV\tT(E) up\tT(E) down"
print "="*60
for i in range(len(energy_list)):
    print energy_list[i],'\t',trans_coeff[0][i],'\t',trans_coeff[1][i]
Also, you can simplify the energy list generation a bit:
Code
import numpy
energy_list = numpy.arange(-5.0,5.01,0.1)
to make it more obvious what the range is (-5 to 5) or, if you prefer to control the number of points:
Code
import numpy
energy_list = numpy.linspace(-5.0,5.0,101)

Offline Hasan Sahin

  • Heavy QuantumATK user
  • ***
  • Posts: 44
  • Reputation: 0
    • View Profile
Re: Reading Spin Dependent Transmission Data from nc file
« Reply #2 on: December 13, 2009, 22:48 »
Thank You