Author Topic: the script to calculate both -VE and +VE bias for unsymmetrical central region  (Read 1859 times)

0 Members and 1 Guest are viewing this topic.

Offline naash

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Reputation: 0
    • View Profile
i have been trying to calculate  the above problem using the below script but when i try it only gives me positive bias but no negative how should i set my script to bet the negative bias

#----------------------------------------
# Device Calculator
#----------------------------------------
calculator = DeviceLCAOCalculator(
    basis_set=basis_set,
    electrode_calculators=
        [left_electrode_calculator, right_electrode_calculator],
    )

nlsave('liliB-IV.nc', device_configuration)

for bias in numpy.linspace(0.,3.,16)*Volt:
   
    device_configuration.setCalculator(
        calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
        initial_state=device_configuration
    )
    device_configuration.update()

# -------------------------------------------------------------
# Transmission spectrum
# -------------------------------------------------------------
    transmission_spectrum = TransmissionSpectrum(
        configuration=device_configuration,
        energies=numpy.linspace(-3,3,100)*eV,
        kpoints=MonkhorstPackGrid(1,1),
        energy_zero_parameter=AverageFermiLevel,
        infinitesimal=1e-06*eV,
        self_energy_calculator=KrylovSelfEnergy(),
        )
    nlsave('liliB-IV.nc', transmission_spectrum, object_id="transmission %s" % bias)
    nlprint(transmission_spectrum)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5423
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Just run the same script but change the line
Code: python
calculator(electrode_voltages=(0.5*bias,-0.5*bias)),
to
Code: python
calculator(electrode_voltages=(-0.5*bias,0.5*bias)),
I note that you don't save the converged calculation anywhere; in case you ever want to recalculate something, like the transmission spectrum with more points, you will be forced to run the self-consistent loop again. I recommend adding a line
Code: python
nlsave('liliB-IV_scf_bias_%g.nc' % bias.inUnitsOf(Volt), device_configuration, object_id="bias %s" % bias)
just after the "update" statement. The new line should be indented on the same level as the update line. Note that we use separate files in this case, as the files grow rather large. If you had done this, you could have avoided re-running the zero-bias calculation for the opposite bias case.
« Last Edit: March 29, 2012, 10:02 by Anders Blom »