its all part of a complicated script so i am pulling it apart
parameter file looks like this: (some not used in ldos)
| |
| |
| |
| |
| |
| from NanoLanguage import * |
| import numpy |
| import ase |
| |
| logs = "../logs/" |
| nc_files = "../nc_files/" |
| plots = "../plots/" |
| |
| |
| |
| dopingLvl = 2 |
| dopingOn = True |
| dopingType = 3 |
| |
| outFileName = "" |
| outFileName2 = "" |
| |
| |
| gate_voltage_list = [0.01, 0.02, 0.03, 0.04, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1.0]*Volt |
| bias_voltage_list = [0.01, 0.025, 0.05, 0.1]*Volt |
| |
| transSpecEnergies = numpy.linspace(-2,2,21)*eV |
| kPntsX = 1 |
| kPntsY = 1 |
| kPntsZ = 1 |
| ldos_energies = [1]*eV |
| iteration_control_parameters = IterationControlParameters(number_of_history_steps=12, tolerance=1e-4) |
| numerical_accuracy_parameters = NumericalAccuracyParameters(k_point_sampling=(kPntsX, kPntsY, kPntsZ)) |
| |
| |
| pps=30 |
| bafl=10 |
| |
| SCF = 1 |
| |
| ldosBiasVoltage = 0.1*Volt |
| ldosGateVoltage = 0.0*Volt |
| |
| |
| vac = 12.0*Ang |
| |
| doubleGate = True |
| |
| |
| dist_1 = float(0.71043) * float(0.1) |
| dist_2 = float(3.55215) * float(0.1) |
| dist_3 = float(5.68344) * float(0.1) |
| |
| |
then the ldos calc:
| |
| def doLDOS(): |
| configuration = nlread(nc_files + outFileName, object_id="cfg")[0] |
| calculator = my_DeviceLCAOCalculator() |
| |
| #configuration.setCalculator(calculator) |
| configuration.setCalculator( |
| calculator(electrode_voltages=(ldosBiasVoltage,0.0*Volt)), |
| initial_state=configuration) |
| |
| metallic_region0 = configuration.metallicRegions()[0] |
| metallic_region1 = None |
| if doubleGate: |
| metallic_region1 = configuration.metallicRegions()[1] |
| configuration.setMetallicRegions([metallic_region0(value = ldosGateVoltage), metallic_region1(value = ldosGateVoltage)] ) |
| else: |
| configuration.setMetallicRegions([metallic_region0(value = ldosGateVoltage)] ) |
| |
| configuration.update() |
| |
| |
| # Energies at which to compute the LDOS; |
| |
| energies = ldos_energies |
| |
| # calculate ldos for each energy in the list |
| for energy in energies: |
| LDOS = LocalDeviceDensityOfStates( |
| configuration=configuration, |
| energy=energy, |
| kpoints=MonkhorstPackGrid(3,3), |
| contributions=All, |
| energy_zero_parameter=AverageFermiLevel, |
| infinitesimal=1e-06*eV, |
| self_energy_calculator=KrylovSelfEnergy(), |
| spin=Spin.Sum, |
| ) |
| nlsave(nc_files + outFileName + '_ldos.nc', LDOS, object_id="LDOS at %s" % energy) |
| now = date.today() |
| nlprint("energy " + str(energy) + " done " + str(now.strftime("%m-%d-%y %I:%M %p"))) |
| |
| |
and a supporting function:
| |
| def my_DeviceLCAOCalculator(): |
| |
| # ------------------------------------------------------------- |
| |
| |
| |
| if SCF == 1: |
| |
| #---------------------------------------- |
| |
| |
| left_electrode_calculator = LCAOCalculator( |
| numerical_accuracy_parameters=numerical_accuracy_parameters, |
| |
| iteration_control_parameters=iteration_control_parameters, |
| ) |
| |
| right_electrode_calculator = LCAOCalculator( |
| numerical_accuracy_parameters=numerical_accuracy_parameters, |
| |
| iteration_control_parameters=iteration_control_parameters, |
| ) |
| |
| #---------------------------------------- |
| |
| |
| calculator = DeviceLCAOCalculator( |
| |
| numerical_accuracy_parameters=numerical_accuracy_parameters, |
| iteration_control_parameters=iteration_control_parameters, |
| electrode_calculators= |
| [left_electrode_calculator, right_electrode_calculator], |
| ) |
| |
| else: |
| |
| |
| |
| left_electrode_calculator = LCAOCalculator( |
| iteration_control_parameters=NonSelfconsistent, |
| numerical_accuracy_parameters=numerical_accuracy_parameters, |
| ) |
| |
| right_electrode_calculator = LCAOCalculator( |
| iteration_control_parameters=NonSelfconsistent, |
| numerical_accuracy_parameters=numerical_accuracy_parameters, |
| ) |
| |
| #---------------------------------------- |
| |
| |
| device_algorithm_parameters = DeviceAlgorithmParameters( |
| initial_density_type=NeutralAtom(electrode_constraint_length=0.0*Ang), |
| ) |
| calculator = DeviceLCAOCalculator( |
| numerical_accuracy_parameters=numerical_accuracy_parameters, |
| iteration_control_parameters=NonSelfconsistent, |
| device_algorithm_parameters = device_algorithm_parameters, |
| electrode_calculators= [left_electrode_calculator, right_electrode_calculator], |
| ) |
| |
| return calculator |
| |
Note SCF is 1
attached is the nc file with the device