QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Hasan Sahin on December 13, 2009, 15:00

Title: Reading Spin Dependent Transmission Data from nc file
Post by: Hasan Sahin 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()
Title: Re: Reading Spin Dependent Transmission Data from nc file
Post by: Anders Blom 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)
Title: Re: Reading Spin Dependent Transmission Data from nc file
Post by: Hasan Sahin on December 13, 2009, 22:48
Thank You