Author Topic: Molecular Dynamics Error  (Read 7743 times)

0 Members and 1 Guest are viewing this topic.

Offline Parveen

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Country: in
  • Reputation: 0
    • View Profile
Molecular Dynamics Error
« on: January 11, 2016, 09:08 »
Hi All,

I was trying to make minimum energy state Metal-Insulator-Metal (MIM) structure with insulator being an organic molecule. But i got this error after execution completed.

  File "/tmp/5701470339676073.py", line 27, in <module>
    method=method
  File "./zipdir/NL/Dynamics/MolecularDynamics/MolecularDynamics.py", line 215, in MolecularDynamics
  File "./build/atkpython/lib/python2.7/site-packages/ase/md/nptberendsen.py", line 110, in step
  File "./build/atkpython/lib/python2.7/site-packages/ase/md/nptberendsen.py", line 100, in scale_positions_and_cell
  File "./zipdir/NL/Dynamics/ASEAtomsInterface.py", line 352, in set_cell
AttributeError: 'DeviceConfiguration' object has no attribute '_setBravaisLattice'


I did following modifications

1) convert bulk structure to device structure
2) Apply Fit Cell in Bulk Tools
3) Sent it to script generator
4)  Add New calculator
5) Add MolecularDynamics from optimization
6)  In New calculator i take ATK-DFT calculator
7) In Molecular Dynamics I take NPT Berendsen Type
8 ) in constraints i select left and right electrode metal atoms
9) keep all other parameters as default.

I want to ask you why i am facing this problem. Is that because of asymmetry of device or anything else. Please help

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: Molecular Dynamics Error
« Reply #1 on: January 13, 2016, 14:25 »
1) Could you attach the script yo uare running?

2) Why do you use molecular dynamics for optimizing the structure? I would expect force minimization using a BFGS-type algorithm (GeometryOptimization) to be more suitable. See e.g. http://docs.quantumwise.com/tutorials/device_relaxation.html

Offline Parveen

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Country: in
  • Reputation: 0
    • View Profile
Re: Molecular Dynamics Error
« Reply #2 on: January 14, 2016, 07:30 »
i also tried optimize Geometry but i think that, change in molecular structure is not conceptually correct at room temperature.

Please check trajectory file
« Last Edit: January 14, 2016, 07:35 by parveen »

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: Molecular Dynamics Error
« Reply #3 on: January 14, 2016, 09:07 »
Could you also attach the nc file with the device calculation?

I do not understand your thoughts on geometry optimization.

A few initial comments on your calculation:
1) You do not set the k-points for the calculator. I recommend to use at least (3, 3, 100) in this case, instead of the default (1, 1, 100) grid.
2) The electron temperature is 2000 Kelvin. Seems a lot.

Offline Julian Schneider

  • QuantumATK Staff
  • QuantumATK Guru
  • *****
  • Posts: 164
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Molecular Dynamics Error
« Reply #4 on: January 14, 2016, 10:45 »
It is generally not recommended to perform MD simulations at constant pressure (i.e. NPT simulations) on DeviceConfigurations, especially not NPTBerendsen, (see last paragraph in the MD tutorial www.docs.quantumwise.com/tutorials/md_basics.html). You should use constant volume simulations (i.e. NVE or NVT) instead.
If you want to optimize the cell of the device with respect to the stress you should adopt the scheme outlined in the device relaxation tutorial (www.docs.quantumwise.com/tutorials/device_relaxation.html).
However, it should technically be possible to run NPT on a device configuration, and the error you see seems to be a bug, which we'll fix.

Offline Parveen

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Country: in
  • Reputation: 0
    • View Profile
Re: Molecular Dynamics Error
« Reply #5 on: January 19, 2016, 05:57 »
Dear Jess and Julian

this time i tried NVT Berendsen molecular dynamics. But i am confused with the results, as the bonds are breaking apart in the molecule. I am surprised why this is happening at room temperature.

so far i was thinking that by doing optimization (OG or MD) we will get a molecule which is supposed to be at those environmental conditions. i was expecting tiny little change in bond-length not breaking of bonds.

Please help me with the little i know.

Due to size constraints i can't attach .nc file

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: Molecular Dynamics Error
« Reply #6 on: January 19, 2016, 08:23 »
Are you sure that the set of classical potentials that you use are suitable for an interface between gold an a C-O-H containing molecule?

Offline Parveen

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Country: in
  • Reputation: 0
    • View Profile
Re: Molecular Dynamics Error
« Reply #7 on: January 19, 2016, 13:27 »
I didn't find any option in New calculator :-> ATK-DFT calculator or in molecular dynamics for classical potential. please tell where shall i find these potential values

In ATK-classical calculator it shows warning. PFA

Offline Julian Schneider

  • QuantumATK Staff
  • QuantumATK Guru
  • *****
  • Posts: 164
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Molecular Dynamics Error
« Reply #8 on: January 19, 2016, 15:14 »
Yes, you are right, you are using DFT so the forces are probably not totally wrong.
I made some tests, and it looks as if the problem is that you initially have quite large forces on the atoms of the molecule, as the molecule is a little compressed (it expands quite a bit if you optimize the molecule alone).
That means that in the beginning of your MD the large forces accelerate the atoms in the molecule away from the center of the molecule.
Then you use zero initial velocities (initial_velocities=None). As the average temperature is below the target temperature of 300K the thermostat additionally accelerates the atoms in order to reach the target temperature. This will cause that the atoms of the molecule will be driven apart even further, and for a moment it looks as if the bonds are broken.
However, remember that the bonds in the viewer are just a graphical representation based on the atom distance, and it doesn't necessarily mean that the bonds really are broken. If you'd continue the MD for longer times they'd very likely find their equilibrium bond lengths in the end.
To prevent this effect, I suggest you use the Langevin thermostat instead of the NVT Berendsen thermostat. The Langevin  thermostat couples each atom more tightly to the heat bath and the friction force prevents that atoms become accelerated to much (see the MD tutorial http://www.docs.quantumwise.com/tutorials/md_basics.html).

Offline Parveen

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Country: in
  • Reputation: 0
    • View Profile
Re: Molecular Dynamics Error
« Reply #9 on: January 25, 2016, 06:00 »
Thank you for your suggestion. I gave run with Langvin type MolecularDynamics and for geometry optimization as well. I have some doubts about both results.

1) Langvin MD
 
In results i got one device configuration file and one MD trajectory file. In MD trajectory file I got following results, PFA. can you tell me what does it signify and what does it optimize?

2) Geometry Optimization

In results i got two device configuration files and when i drag .nc file into stash it generated two device structure there. Then I checked their coordinates and i found that two device structures have different coordinates. Do you think that changed coordinates are geometry optimized one. Also I checked it for only 10 steps, do you think that increasing steps will give much better results.

Offline Julian Schneider

  • QuantumATK Staff
  • QuantumATK Guru
  • *****
  • Posts: 164
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Molecular Dynamics Error
« Reply #10 on: January 26, 2016, 10:23 »

1) Langvin MD
 
In results i got one device configuration file and one MD trajectory file. In MD trajectory file I got following results, PFA. can you tell me what does it signify and what does it optimize?


MD does not optimize anything. It generates a number of snapshots drawn from a canonical ensemble. Note that different snapshots of the same MD simulation may yield different results for the same property. That means that a single snapshot from an MD trajectory not may be too meaningful, but it is rather the average over many snapshots that should be considered.
In your case you have simulated only over a very short time span and the system has very likely not had enough time to reach thermal equilibrium. This is the reason why the molecule looks a bit strange.
Please read the tutorial about MD simulations (www.docs.quantumwise.com/tutorials/md_basics.html) to learn more about how to equilibrate a system.


2) Geometry Optimization

In results i got two device configuration files and when i drag .nc file into stash it generated two device structure there. Then I checked their coordinates and i found that two device structures have different coordinates. Do you think that changed coordinates are geometry optimized one. Also I checked it for only 10 steps, do you think that increasing steps will give much better results.

The first of the two configuration is the initial structure of the device, whereas the second one is the structure after optimizing the geometry, i.e. minimizing the total energy. They should have different coordinates, as the atomic positions change during the optimization. That means the second configuration is the one to use.
In geometry optimization the decisive criteria is not the number of steps but the max. force parameter, which sets the threshold that the optimization stops as soon as the forces on all atoms are below this value. The default value of 0.05 eV/Ang is generally ok, for a very precise optimization it should be decreased, though.
The number of steps is only a parameter that prevents that an  optimization simulation runs forever if it for some reason doesn't manage to converge.

In your case, you should check at the end of the log file, if the optimization has converged, i.e. if all forces are below the specified max. force value. There will be a line which informs you about this.

Offline Parveen

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Country: in
  • Reputation: 0
    • View Profile
Re: Molecular Dynamics Error
« Reply #11 on: January 28, 2016, 13:12 »
Hi again

After geometry optimization i was checking transmission spectra and device density of states. for that I take reference of Molecular device tutorial (https://www.quantumwise.com/documents/tutorials/latest/MolecularDevice/index.html/chap.analysis.html). In Energy dependent LDDOS I got following plot. Do you think that it's a valid plot? It looks like two plots are overlapped over one another.  PFA