Author Topic: Transmission spectrum  (Read 3867 times)

0 Members and 1 Guest are viewing this topic.

Offline naash

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Reputation: 0
    • View Profile
Transmission spectrum
« on: April 4, 2011, 06:22 »
# Set up configuration
central_region = BulkConfiguration(
    bravais_lattice=central_region_lattice,
    elements=central_region_elements,
    cartesian_coordinates=central_region_coordinates
    )

device_configuration = DeviceConfiguration(
    central_region,
    [left_electrode, right_electrode]
    )

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = [
    LDABasis.Gold_SingleZetaPolarized,
    LDABasis.Carbon_DoubleZetaPolarized,
    ]

#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
left_electrode_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(10, 10, 100),
    )

right_electrode_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(10, 10, 100),
    )

device_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(10, 10, 100),
    )

#----------------------------------------
# Poisson Solver Settings
#----------------------------------------
device_poisson_solver = MultigridSolver(
    boundary_conditions=[[PeriodicBoundaryCondition,PeriodicBoundaryCondition],
                         [PeriodicBoundaryCondition,PeriodicBoundaryCondition],
                         [DirichletBoundaryCondition,DirichletBoundaryCondition]]
    )

#----------------------------------------
# Electrode Calculators
#----------------------------------------
left_electrode_calculator = LCAOCalculator(
    basis_set=basis_set,
    numerical_accuracy_parameters=left_electrode_numerical_accuracy_parameters,
    )

right_electrode_calculator = LCAOCalculator(
    basis_set=basis_set,
    numerical_accuracy_parameters=right_electrode_numerical_accuracy_parameters,
    )

#----------------------------------------
# Device Calculator
#----------------------------------------
voltagelist=[0.2*i for i in range(26)]
for myvolt in voltagelist:     
    calculator = DeviceLCAOCalculator(
    basis_set=basis_set,
    numerical_accuracy_parameters=device_numerical_accuracy_parameters,
    electrode_calculators=
        [left_electrode_calculator, right_electrode_calculator],
    electrode_voltages=( 0.0*Volt, myvolt*Volt)
    )

    device_configuration.setCalculator(calculator)
    nlprint(device_configuration)
    device_configuration.update()
    if(myvolt<0.3):
        nlsave('/home/hassan/C80/C80mr61.nc', device_configuration)

# -------------------------------------------------------------
# Transmission spectrum
# -------------------------------------------------------------
    transmission_spectrum = TransmissionSpectrum(
    configuration=device_configuration,
    energies=numpy.linspace(-5,5,100)*eV,
    kpoints=MonkhorstPackGrid(1,1),
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    self_energy_calculator=KrylovSelfEnergy(),
    )
    nlsave('/home/hassan/C80/C80mr61.nc', transmission_spectrum)
    nlprint(transmission_spectrum)




what is wrom with the above script for it does not generate the specified number of transmission curves

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Transmission spectrum
« Reply #1 on: April 5, 2011, 09:24 »
In the line:
nlsave('/home/hassan/C80/C80mr61.nc', transmission_spectrum)
you had better to add different "object_id" for each calculated transmission spectrum to distinguish. Otherwise, only the transmission spectrum of the last bias voltage is saved.
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/XHTML/ref.nlsave.html

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5577
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Transmission spectrum
« Reply #2 on: April 5, 2011, 10:13 »
This is incorrect. If no object_id is given it will automatically be generated. Only if the line is not properly indented you would get the effect that only the last one is saved, but specifying the object_id doesn't help for that.

Naash, you don't write clearly what the problem is. When you run the script, inspect the log file: are there multiple transmission spectra printed? In the generated NC file, are there multiple transmission spectra?

Or is the problem that when you try to plot the spectra in the NC file in the Analyzer, that you only see one (or no) transmission?

In general, it is recommended not to insert large amounts of code directly in a post. First of all it's hard to read, second it's hard to troubleshoot because vital formatting - namely the indentation - is very hard to see and tabs can get converted to spaces. So, attach scripts, unless your question in on a few specific lines, in which case you should wrap them in [code=python]...[/code].