QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Jenny on February 17, 2015, 00:59

Title: Optimization geometry at different electron temperature
Post by: Jenny on February 17, 2015, 00:59
Dear all,

recently, I tried to get an optimized unit cell configuration at different temperature. However, when I set the electron temperature at different temperature (ex: room temperature 300K, low temperature 50K, high temperature 400K), the optimized unit cells have the same configuration which doesn't match my expectation. I applied DFT method here and attached the script I used.
Please give me an explanation or any reference for the explanation.

Jenny.
Title: Re: Optimization geometry at different electron temperature
Post by: zh on February 17, 2015, 07:18
This electron temperature parameter would affect the electron occupation, rather than the lattice or atoms. Your results look quite normal. The geometry optimization is performed only for zero temperature of ions (atoms).

To consider the temperature effect on the lattice atoms, you may try the molecular dynamics simulation at the different temperature, where the ion temperature is used to control the kinetic energy of atoms.

In short, you need to read the background of methodology in ATK-DFT  to understand the difference between "electron temperature" and "ion (atomic) temperature".
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/chap.atkdft.html#sect1.atkdft.background
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.moleculardynamics.html

Title: Re: Optimization geometry at different electron temperature
Post by: Jenny on February 20, 2015, 20:45
This electron temperature parameter would affect the electron occupation, rather than the lattice or atoms. Your results look quite normal. The geometry optimization is performed only for zero temperature of ions (atoms).

To consider the temperature effect on the lattice atoms, you may try the molecular dynamics simulation at the different temperature, where the ion temperature is used to control the kinetic energy of atoms.

In short, you need to read the background of methodology in ATK-DFT  to understand the difference between "electron temperature" and "ion (atomic) temperature".
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/chap.atkdft.html#sect1.atkdft.background
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.moleculardynamics.html

Zh, thank you for your explanation. This really  helps a lot. But for "The geometry optimization is performed only for zero temperature of ions (atoms)" here you mentioned, "zero temperature" means 0K or room temprature?

Jenny
Title: Re: Optimization geometry at different electron temperature
Post by: Anders Blom on February 20, 2015, 22:22
On what scale is room temperature zero? :) Of course it means 0 K.
Title: Re: Optimization geometry at different electron temperature
Post by: Jenny on February 27, 2015, 00:56
Thank you for the reply. When I looked into the molecular dynamics method, I couldn't find any convergence criteria like max force or energy. I don't understand. :-\
Title: Re: Optimization geometry at different electron temperature
Post by: zh on February 27, 2015, 02:52
For the molecular dynamics simulations, the important thing is what kind of ensembles is chosen. There is no any convergence criteria in the force or energy.
Please learn more about the background of molecular dynamics:
http://en.wikipedia.org/wiki/Molecular_dynamics
Title: Re: Optimization geometry at different electron temperature
Post by: Anders Blom on February 27, 2015, 07:40
And even better:
http://quantumwise.com/publications/tutorials/item/732-basic-molecular-dynamics-tutorial
Title: Re: Optimization geometry at different electron temperature
Post by: Jenny on March 2, 2015, 21:07
And even better:
http://quantumwise.com/publications/tutorials/item/732-basic-molecular-dynamics-tutorial

Dr. Anders Blom,

Thank you for the reference. It helped a lot. I still have two questions.
1. Since I'm using atk-13.8.1 version. The movie tool is not available in this version. Is there any method I can find the energy or temperature curves?
2. If I'd like to do some modification based on the molecular dynamics algorithm here, where can I find the original coding part?

Thanks a lot.

Jenny
Title: Re: Optimization geometry at different electron temperature
Post by: Anders Blom on March 2, 2015, 23:00
1. I guess you can script yourself out of it using the manual, but older versions are not supported. If you have the trajectory you can compute the corresponding quantities image by image and plot the data.

2. We use the ASE library for most of the MD functionality, which is open source. The byte-compiled files (pyc) are in lib/{python-2.7}/site-packages/ase/md, but you could replace these with your own if you get the sources from ASE (see https://wiki.fysik.dtu.dk/ase/ase/md.html).

In general, ATK is however designed in a way that often lets you solve problems in the Python interface without modifying the basic source code. So if you give a hint what you want to achieve, there may be a lot simpler option than fiddling with the source code.
Title: Re: Optimization geometry at different electron temperature
Post by: Jenny on March 5, 2015, 20:05
1. I guess you can script yourself out of it using the manual, but older versions are not supported. If you have the trajectory you can compute the corresponding quantities image by image and plot the data.

2. We use the ASE library for most of the MD functionality, which is open source. The byte-compiled files (pyc) are in lib/{python-2.7}/site-packages/ase/md, but you could replace these with your own if you get the sources from ASE (see https://wiki.fysik.dtu.dk/ase/ase/md.html).

In general, ATK is however designed in a way that often lets you solve problems in the Python interface without modifying the basic source code. So if you give a hint what you want to achieve, there may be a lot simpler option than fiddling with the source code.

Thank you, Dr. Blom.

When I did the MD simulation, it failed and gave information saying "Traceback (most recent call last):
  File "c:\users\mems\appdata\local\temp\7143933610221804.py", line 136, in <module>
    method=method
  File ".\zipdir\NL\Dynamics\MolecularDynamics\MolecularDynamics.py", line 215, in MolecularDynamics
  File ".\build\atkpython\lib\site-packages\ase\md\nptberendsen.py", line 110, in step
  File ".\build\atkpython\lib\site-packages\ase\md\nptberendsen.py", line 100, in scale_positions_and_cell
  File ".\zipdir\NL\Dynamics\ASEAtomsInterface.py", line 346, in set_cell
NL.ComputerScienceUtilities.Exceptions.NLExecutionError: The variation of cell size during the step was too large."

Is there anyway I can solve the problem?

I've attached the script in the attachment.
Title: Re: Optimization geometry at different electron temperature
Post by: Jenny on March 5, 2015, 23:15
1. I guess you can script yourself out of it using the manual, but older versions are not supported. If you have the trajectory you can compute the corresponding quantities image by image and plot the data.

2. We use the ASE library for most of the MD functionality, which is open source. The byte-compiled files (pyc) are in lib/{python-2.7}/site-packages/ase/md, but you could replace these with your own if you get the sources from ASE (see https://wiki.fysik.dtu.dk/ase/ase/md.html).

In general, ATK is however designed in a way that often lets you solve problems in the Python interface without modifying the basic source code. So if you give a hint what you want to achieve, there may be a lot simpler option than fiddling with the source code.

Also, Dr. Blom. Is it possible for me to access the original code(py), since decompile the code would cause unwanted problem?

Thank you very much.

Jenny
Title: Re: Optimization geometry at different electron temperature
Post by: Anders Blom on March 5, 2015, 23:43
The ASE source code is at https://wiki.fysik.dtu.dk/ase/download.html
Title: Re: Optimization geometry at different electron temperature
Post by: Julian Schneider on March 6, 2015, 19:31
Hi Jenny,

Unless you are explicitly interested in thermal or temperature dependent properties (e.g. thermal expansion), performing a geometry optimization at 0K and then calculating the desired properties based on the final structure is in fact the most common approach, in particular when you are interested in electronic-structure-related properties.
I see that your MD temperature is 50 K, and for this low temperature I would expect the difference to the 0K-structure to be very small.
The disadvantage of finite-temperature-structures is that there is no unique structure but rather an ensemble of configurations that you would have to average over.
If you really want to use finite temperature structures, then in your case, you would have to use the the NPTMelchionna-thermostat isntead of the NPTBerendsen-thermostat. The reason is that you have an anisotropic structure that is only periodic in z-direction, and NPTBerendsen treats everything as isotropic (cf. MD-tutorial), which probably causes your error message.
So you'd have to use something like:

method = NPTMelchionna(
    time_step=1*femtoSecond,
    reservoir_temperature=50*Kelvin,
    external_stress=1*bar,
    thermostat_timescale=100*femtoSecond,
    barostat_timescale=100*femtoSecond,
    bulk_modulus=1e+06*bar,
    initial_velocity=initial_velocity,
    mask=[[False, False, False], [False, False, False], [False, False, True]]
)
Title: Re: Optimization geometry at different electron temperature
Post by: Om Prakash Upadhyay on February 18, 2017, 04:23
Actually what is the difference between electron temperature, atomic temperature and room temperature?
Title: Re: Optimization geometry at different electron temperature
Post by: zh on February 18, 2017, 11:01
To understand the difference among them, my suggestion is to first understand the "Born–Oppenheimer approximation" used in the DFT calculations:
https://en.wikipedia.org/wiki/Born%E2%80%93Oppenheimer_approximation

Title: Re: Optimization geometry at different electron temperature
Post by: Gurleen Kaur Walia on June 20, 2017, 08:59
Please tell if I select electron temperature as 300K, does it mean I am selecting room temperature i.e. 27 deg celsius??
Title: Re: Optimization geometry at different electron temperature
Post by: Ulrik G. Vej-Hansen on June 20, 2017, 09:11
In a sense yes, as 300K and 27 degree C are equivalent, but your material is still modeled at 0K. The electron temperature is just a measure of the width of the distribution used.
Title: Re: Optimization geometry at different electron temperature
Post by: lknife on June 20, 2017, 14:58
What did you mean that " The electron temperature is just a measure of the width of the distribution used."? And, did you mean that all the materials are modeled at 0K no matter how the electron temperature is set? Can ATK simulate the influence of  environment temperature on the properties of materials, such as determining the Curie temperature of a superconductor?
Title: Re: Optimization geometry at different electron temperature
Post by: Anders Blom on June 21, 2017, 09:27
Real temperature involves phonons, which ATK can compute, but that's not the point here. The electron temperature is basically just a convergence trick in DFT.

This has been discussed here before, see e.g. http://quantumwise.com/forum/index.php?topic=3260