QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: deepwave on June 7, 2012, 07:54

Title: urgent problem
Post by: deepwave on June 7, 2012, 07:54

i want to know this script can be use  the former calculation result. such as we can use 0.2V self-consistent result to calculate the 0.3V properties? i found this script just using the zero bias  self-consistent result or just DeviceConfiguration. thank you!


#read in the old configuration
device_configuration = nlread("li-h2.nc",DeviceConfiguration)[0]
calculator = device_configuration.calculator()

# Define bias voltages
voltage_list=[0.1,0.2, 0.3, 0.4]*Volt
#make loop
for voltage in voltage_list:
    # Set new calculator with modified electrode voltages on the configuration
    # use the self consistent state of  the old calculation as starting input.
    device_configuration.setCalculator(
          calculator(electrode_voltages=(0*Volt, voltage)),
          initial_state=device_configuration)

    # Calculate the transmission spectrum
    transmission_spectrum = TransmissionSpectrum(
        configuration=device_configuration,
        energies=numpy.linspace(-5,5,100)*eV,
        )

    nlsave('li-h2.nc', transmission_spectrum)
Title: Re: urgent problem
Post by: Anders Blom on June 7, 2012, 09:54
This script seems to assume that you have already computed the zero-bias self-consistent state, and saved that in "li-h2.nc". The script will then compute the self-consistent state for 0.1, 0.2, 0.3 and 0.4 V and calculate the transmission spectrum, and save that in the same NC file.

It will however not save the self-consistent state for any finite bias, since there is no statement nlsave("li-h2.nc", device_configuration).
Title: Re: urgent problem
Post by: deepwave on June 7, 2012, 10:11
i know that, i just want to know this script can be realized  the former self-consistent calculation result. such as, use self-consistent result(0.2.nc) of 0.2V bias to calculate the 0.3V bias properties? thank you!
Title: Re: urgent problem
Post by: Anders Blom on June 7, 2012, 10:19
If you have 0.2.nc all you need is to replace the nlread statement with something that reads from that file instead,

Code: python
device_configuration = nlread("0.2.nc", DeviceConfiguration)[0]

and then make the "voltage_list" start with 0.3.
Title: Re: urgent problem
Post by: deepwave on June 7, 2012, 10:47
so ,if i just have the 0.nc, can modify this script to realized use self-consistent result(0.2.nc) of 0.2V bias to calculate the 0.3V bias properties? because every bias have a bias.nc file.
Title: Re: urgent problem
Post by: Anders Blom on June 7, 2012, 10:58
I don't understand. You say "I just have 0.nc", and then "every bias have a bias.nc file". Which is it? Do you have 0.2.nc or not?

If you don't, you have to modify the script to add an nlsave statement for the device_configuration, but in that case you still have to rerun everything from zero bias, so it doesn't matter so much. If you do then my answer above is the solution.