QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: venkata reddy mallidi on June 20, 2014, 10:40

Title: GATE SCAN ATTACHMENT
Post by: venkata reddy mallidi on June 20, 2014, 10:40
I am using the tutorial of si nanowire fet to analyse for InAs nanowire. but gatescan script im using here is not running plz help me to analyse gate scan for InAs nanowire and the error is

File “c:\users\mamta\appdata\local\temp\5203870735644037.py”,line16
New_region = [m(value = gate_voltage) for m in metallic_region]
                     ^
IndentationError: expected an indented block
Title: Re: GATE SCAN ATTACHMENT
Post by: kstokbro on June 20, 2014, 15:37
This is a python syntax error,
The syntax of the script is not correct, there is an indentation error.
Please attach the full script for us to pinpoint what is wrong in the script
Title: Re: GATE SCAN ATTACHMENT
Post by: venkata reddy mallidi on June 23, 2014, 08:55
# Read in the old configuration
device_configuration = nlread("nanodevice_huckel.nc",DeviceConfiguration)[0]
calculator = device_configuration.calculator()
metallic_regions = device_configuration.metallicRegions()
# Define gate_voltages
gate_voltage_list=[1.0, 2.0, 3.0, 4.0, 5.0]*Volt
# Define output file name
filename= "nanodevice_huckel.nc"
# Perform loop over gate voltages
for gate_voltage in gate_voltage_list:
    # Set the gate voltages to the new values
    new_regions = [m(value = gate_voltage) for m in metallic_regions]
    device_configuration.setMetallicRegions(new_regions)
    # Make a copy of the calculator and attach it to the configuration
    # Restart from the previous scf state
    device_configuration.setCalculator(calculator(),
         initial_state=device_configuration)
    device_configuration.update()
    nlsave(filename, device_configuration)
# Calculate analysis objects
electron_density = ElectronDifferenceDensity(device_configuration)
nlsave(filename, electron_density)
electrostatic_potential = ElectrostaticDifferencePotential(device_configuration)
nlsave(filename, electrostatic_potential)
transmission_spectrum = TransmissionSpectrum(
    configuration=device_configuration,
    energies=numpy.linspace(-3,3,101)*eV,
    self_energy_calculator=DirectSelfEnergy(),
    )
nlsave(filename, transmission_spectrum)
nlprint(transmission_spectrum)
Title: Re: GATE SCAN ATTACHMENT
Post by: Umberto Martinez on June 23, 2014, 12:48
The script looks fine to me. Maybe something has been modified during the copy and paste operations.
try one more time to download the script directly from here http://quantumwise.com/documents/tutorials/latest/NanowireDevice/index.html/examples/nanodevice-gatescan.py

just check that the filename here
Code
device_configuration = nlread("nanodevice_huckel.nc",DeviceConfiguration)[0]
is correct.
Title: Re: GATE SCAN ATTACHMENT
Post by: venkata reddy mallidi on June 23, 2014, 13:35
i have saved the nc file of silicon nanowire fet in the name of si_nanowirefet.nc
so in the very first line of gate scan script:
device_configuration = nlread("nanodevice_huckel.nc",DeviceConfiguration)[0]

should i need to write si_nanowirefet.nc instead of nanodevice_huckel.nc
   
Thanks
Title: Re: GATE SCAN ATTACHMENT
Post by: Umberto Martinez on June 23, 2014, 13:51
yes, of course.
at that point you should not even have a file named nanodevice_huckel.nc which instead will be created by the nanodevice-gatescan.py script.

that should be pretty much straightforward. We will modify the script though.
hope you solved the problem now.
Title: Re: GATE SCAN ATTACHMENT
Post by: venkata reddy mallidi on June 24, 2014, 10:26
There may be some error in this line of script of gate scan
new_regions = [m(value = gate_voltage) for m in metallic_regions],
bcoz many times I have run the script but it is showing the same error
\


new_regions = [m(value = gate_voltage) for m in metallic_regions]
              ^
IndentationError: expected an indented block


what is the meaning of m(value = gate_voltage),
please check the script

please help me in this regard.....I am trying for last many days
Title: Re: GATE SCAN ATTACHMENT
Post by: Umberto Martinez on June 24, 2014, 10:48
can you attach the script to the post?
not copy and paste. attach it directly.
Title: Re: GATE SCAN ATTACHMENT
Post by: venkata reddy mallidi on June 25, 2014, 09:49
sure
Title: Re: GATE SCAN ATTACHMENT
Post by: Umberto Martinez on June 25, 2014, 10:05
As expected indentation is missing giving the syntax error.

please open the file and check again and download the file http://quantumwise.com/documents/tutorials/latest/NanowireDevice/index.html/examples/nanodevice-gatescan.py which is formatted correctly.
the script you copied below was correct, though.
Title: Re: GATE SCAN ATTACHMENT
Post by: venkata reddy mallidi on June 27, 2014, 11:16
its ahowing like this help me in solvig this