Author Topic: Adaptive grid  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

Offline jalmeida

  • Heavy QuantumATK user
  • ***
  • Posts: 36
  • Country: fr
  • Reputation: 0
    • View Profile
Adaptive grid
« on: February 6, 2024, 12:10 »
Dear, I am simulating an electronic transmission function for a single molecular junction and part of the k-points used are not contributing well for the transmission values in some energies. So now I am trying to use the AdaptiveGrid that it takes much more time than the Monkhorst-Pack scheme. I decrease the maximum number of refinement steps (=7 now) to see if can be faster. How can I use the flag << function_values >> in this case if the transmission value for each k-point depends on the energy? The list of k-points for this function values is given in the flag << kpoints >>, right? How does it affect the kpoints chosen to construct the triangles?  My initial code is below.
Code

device_configuration=nlread('/path/device.hdf5', DeviceConfiguration)[0]

# -------------------------------------------------------------
# Transmission Spectrum
# -------------------------------------------------------------

kpoints = AdaptiveGrid(
    kA_range=[-0.5, 0.5],
    kB_range=[-0.5, 0.5],
    tolerance=1e-3,
    error_measure=Absolute,
    number_of_initial_levels=3,
    maximum_number_of_levels=20,
    kpoints=None,
    intervals=None,
    triangles=None,
    function_values=None,
    )

transmission_spectrum = TransmissionSpectrum(
    configuration=device_configuration,
    energies=numpy.linspace(-1.0, 1.0, 800)*eV,
    kpoints=kpoints,
    energy_zero_parameter=AverageFermiLevel,
    infinitesimal=1e-06*eV,
    self_energy_calculator=RecursionSelfEnergy(),
    )
nlsave('device.hdf5', transmission_spectrum)
nlprint(transmission_spectrum)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Adaptive grid
« Reply #1 on: February 9, 2024, 21:32 »
Sounds like a good idea.

function_values cannot be used if you specify kA_range. As the manual states, this is to be used if restarting from an older created adaptive grid (same with kpoints, triangles, and intervals).

So for your first attempt, just stick to kA_range, tolerance and experiment with the refinement. Indeed, to much refinement might be slower than a (coarse) MP sampling, but will generally be more accurate. The manual is quite explicit on how the triangles are constructed, see https://docs.quantumatk.com/manual/Types/AdaptiveGrid/AdaptiveGrid.html