Author Topic: what's happen when I compute the voltage drop?  (Read 2872 times)

0 Members and 1 Guest are viewing this topic.

Offline zdhlover

  • Global Moderator
  • QuantumATK Guru
  • *****
  • Posts: 106
  • Reputation: 2
    • View Profile
what's happen when I compute the voltage drop?
« on: April 16, 2010, 05:34 »
 ;D ;D ;D
Hi,everyone

I use the three scripts compute the voltage drop,but  why I get two strange images?What's happen?Could someone help me ?

The voltage drop script is append  here:
"""
Script for calculating the voltage drop given a zero bias twoprobe calculation
and a finite bias calculation for the same system.

The script will write to the voltage drop to the file specified by vnl_filename,
and it will write to screen the xy-average effective potential.

Specifiy the zero bias calculation by giving the name of the file as zero_bias_filename.
Specifiy the finite bias calculation by giving the name of the file as finiate_bias_filename.
Specify the destination output VNL file for storage of the 3D dataset.

Example of usage:
    atk voltagedrop.py > my_voltage_drop.dat
"""

zero_bias_filename = 'D:/voltage/0.nc'
finiate_bias_filename = 'D:/voltage/1.nc'
vnl_filename = 'D:/voltage/voltage_drop.vnl'


""" ------------ No need to modify anything below this point --------------------- """
# Implementation of the voltage drop.
from ATK.TwoProbe import *; import numpy

# Zero bias calculation.
zero_bias = restoreSelfConsistentCalculation(zero_bias_filename)
# Finite bias calculation.
finite_bias = restoreSelfConsistentCalculation(finiate_bias_filename)
# Calculate the voltage drop.
voltage_drop = calculateEffectivePotential(finite_bias) - calculateEffectivePotential(zero_bias)

# Store the results in a VNL file.
file = VNLFile(vnl_filename)
file.addToSample(voltage_drop,'Voltage Drop','Voltage Drop')

# Get the raw number of the potential, and print the average potential to the screen.
raw_data = voltage_drop.toArray()
z_axis_length = voltage_drop._cell().c().z()
print '### Voltage drop ###'
print '# z(bohr) V(Ry)'
# Loop over all the data and calculate the average in the xy-plane.
for i in range(raw_data.shape[2]):
    print i*z_axis_length/float(raw_data.shape[2]), numpy.average(raw_data[:,:,i])

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: what's happen when I compute the voltage drop?
« Reply #1 on: April 16, 2010, 11:21 »
Your Z coordinates are not very clean (did you relax it?). Try to edit them manually, i.e. instead of 43.23999844 have 43.24, and so on. I think these small differences create voltage drop drop = resistance in places where it shouldn't be, because you break the periodicity of the perfect Li chain.

Offline zdhlover

  • Global Moderator
  • QuantumATK Guru
  • *****
  • Posts: 106
  • Reputation: 2
    • View Profile
Re: what's happen when I compute the voltage drop?
« Reply #2 on: April 16, 2010, 13:37 »
 :( :( :(

I also use the  lih2li.vnl in VNL 's example, it should be keep  the periodicity of the perfect Li chain. But the same thing happen, what's wrong??

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: what's happen when I compute the voltage drop?
« Reply #3 on: April 16, 2010, 13:51 »
Please don't use the examples. Those files are not checked, I think they should be deleted and forgotten.

The system you used this time is bad for another reason, it has way too few screening atoms.

Just use the setup from http://quantumwise.com/forum/index.php?topic=21.0 and you should at least get the same results as in that post :)