Author Topic: Can the Electron Density (or Converged State) Calculated from IV Characteristic  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Offline dmicje12

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Country: tw
  • Reputation: 0
    • View Profile
Hello everyone!

Currently, I need to calculate three properties: IV characteristics, current density, and effective potential.
Each time, I have to restart the SCF calculation from scratch.

I would like to ask: is it possible to use the electron density obtained from the IV characteristics calculation for the effective potential calculation?
Would it work if I directly use nlread to read the HDF5 file generated from the IV characteristics?

Or are there other ways to improve the efficiency?

Thank you all!
« Last Edit: November 26, 2024, 13:53 by dmicje12 »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5583
  • Country: dk
  • Reputation: 100
    • View Profile
    • QuantumATK at Synopsys
QuantumATK is designed so that you never have to redo the self-consistent calculation from scratch. If you have done it once, and of course saved it properly, you can always read the state of the converged calculation from the HDF5 file and compute any post-processing data from that. So yes, you can read the DeviceConfiguration from the HDF5 file and use that for the potential etc, and it will not redo the DFT/NEGF calculation itself.

Offline dmicje12

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Country: tw
  • Reputation: 0
    • View Profile
Thanks for reply!
I have a few questions:
1.How do I use the nlread command?
potential_calculate = nlread(
    'iv_calculate.hdf5',
    DeviceConfiguration_0
)
Should I replace the DeviceConfiguration part of the original script with the text above?

2.Is there a strict requirement for reading DeviceConfiguration_0? For example, if I want to calculate the effective potential of gate (metallic region) at -1V, do I necessarily need to read the DeviceConfiguration at gate (metallic region) -1V? If I read DeviceConfiguration at gate (metallic region) 0V, will it restart the calculation, or will it take this converged state as the initial state and continue from there?

Thank you!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5583
  • Country: dk
  • Reputation: 100
    • View Profile
    • QuantumATK at Synopsys
configuration = nlread("file.hdf5", DeviceConfiguration)

will return a list of all DeviceConfiguration objects in the file. You can either loop over them, or pick a specific one, like the last (and often only)

configuration = nlread("file.hdf5", DeviceConfiguration)[-1]

For an I-V calculation you need to identify the objects by bias, which is easiest in the GUI. Once you know which object ID to use, you can do

configuration = nlread("file.hdf5", DeviceConfiguration, object_id="DeviceConfiguration_0")[0]

Note that you will still need the [-1] since nlread always returns a list.

It will never recalculate if you read an already computed configuration from a file.

Offline dmicje12

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Country: tw
  • Reputation: 0
    • View Profile
Thanks for reply!
but,I still don’t understand
1.
I added configuration = nlread("file.hdf5", DeviceConfiguration)[-1] to the script.
If the metallic region in the DeviceConfiguration of file.hdf5 is at 0V, does that mean the calculated Veff result will be the "effective potential of the metallic region at 0V"?
But if I want to use the "DeviceConfiguration of the metallic region at 0V" as the initial state for calculating the "effective potential of the metallic region at -1V," is that possible?
2.
Also, where exactly should configuration = nlread("file.hdf5", DeviceConfiguration)[-1] be added in the script?
I tried adding it to both DeviceLCAOCalculator and DeviceConfiguration, but neither worked.
Thanks!
=======================================================
Thanks!
I already know how to import the initial state!

Just place the following:
job.setCalculator(
    calculator=calculator, initial_state=nlread("file.hdf5", DeviceConfiguration)[0]
)
before job.update()

« Last Edit: November 29, 2024, 07:18 by dmicje12 »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5583
  • Country: dk
  • Reputation: 100
    • View Profile
    • QuantumATK at Synopsys
In a nutshell, for post-processing calculations, the nlread command would be the first line in the script and following that you have all the stuff you want to calculate.

If you are modifying an existing script, you can remove/replace everything until and including the "update" line with the single nlread line.