Author Topic: How to initialize an optimization calculation using elec.dens. of another calc.?  (Read 4912 times)

0 Members and 1 Guest are viewing this topic.

Offline duygu

  • Regular QuantumATK user
  • **
  • Posts: 13
  • Reputation: 0
    • View Profile
I want to  use relaxed atomic positions and electron density of a previously converged calculation as an initial guess to an optimization calculation. However, 'initial_calculation' argument is only avaible for executeSelfConsistentCalculation not for calculateOptimizedAtomicGeometry. Is there another way?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
It is possible to provide a converged calculation as input to calculateOptimizedAtomicGeometry(), the keyword is called self_consistent_calculation. See http://quantumwise.com/documents/manuals/ATK-2008.10/ref.calculateoptimizedatomicgeometry.html for details (section "Usage examples"). However, you cannot in this case change the geometry or the method, that is, you cannot change any of the parameters used for the calculation. The purpose of this functionality is thus really to restart an optimization that didn't converge. This is analogous to the way you can restart a non-converged SCF calculation via executeSelfConsistentCalculation(self_consistent_calculation) (see http://quantumwise.com/documents/manuals/ATK-2008.10/ref.executeselfconsistentcalculation.html, the third example in the beginning). The simplest way to use a converged density, but also change some parameters, for instance k-point sampling or some other parameter that doesn't change the size of the density matrix (basically only the basis set size changes the matrix size), would be to run a single-point calculation with the new parameters, initialized from the old calculation. Then you have a self_consistent_calculation object with the desired method, and with a (hopefully) reasonable density matrix, that you now can use to bootstrap the geometry optimization. Meta-code:
Code
scf_0 = restoreSelfConsistentCalculation("file.nc")
new_method = KohnShamMethod(...)
scf_1 = executeSelfConsistentCalculation(
    new_geometry,
    new_method,
    initial_calculation=scf_0)
relaxed_geometry = calculateOptimizedAtomicGeometry(scf_1)
Do note that new_geometry must have the same atoms, ordered in the same way, as originally used to compute "file.nc", or the whole thing breaks down. I hope this helps; there are other solutions, which involve a bit more coding...
« Last Edit: February 12, 2009, 16:49 by Anders Blom »

Offline duygu

  • Regular QuantumATK user
  • **
  • Posts: 13
  • Reputation: 0
    • View Profile
i tried to use the code given above but i got confused about how to define electron density in the method. when i dont define ant initial electron density in the method it becomes spin unpolarized by default and i got "The two system has different spin dimensions"  error since the initial calculation is spin polarized. On the other hand i dont want to define any initial electron density because i want to start the calculation from previous calculation's density. So what do you suggest?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Fortunately this is not as impossible as it seems, you just need to include "initial_scaled_spin" in your new method. It will not be used if an initial calculation is also specified, but it must be specified to ATK so it knows the method should be set up as spin-polarized.

Offline duygu

  • Regular QuantumATK user
  • **
  • Posts: 13
  • Reputation: 0
    • View Profile
thanks a lot..