Author Topic: What is the corresponding energy convergence per atom?  (Read 4767 times)

0 Members and 1 Guest are viewing this topic.

Offline fly

  • Regular QuantumATK user
  • **
  • Posts: 20
  • Reputation: 0
    • View Profile
If the geometry of 4-ZGNR is optimized until all residual forces on each atom are smaller than 0.05 eV/angstrom , what is the physical meaning for 0.05 eV/angstrom , and What is the corresponding energy convergence per atom?  The configuration of 4-ZGNR is obtained using following manuscript. I have carefully read ATK manual, but I cannot find corresponding information for this question. Who can help me?

armchair = False   # False -> zigzag
width = 8          # ribbon width across, number of layers (must be even for zigzag)
repetitions = 1    # repetitions of the minimal unit along the ribbon
PAC = True         # False -> molecule

# C-C and C-H and unit cell padding distances (all in Angstrom)
aCC = 1.42086
aCH = 1.101
cell_pad = 30.

'''===========================================================================
Nothing needs to be modified below this line!
==========================================================================='''

from ATK.KohnSham import *
from numpy import array, fromfunction
import math

# -------------------------------------------------------------------------------------------
# Positions are in units of aCC until the very end!
# -------------------------------------------------------------------------------------------

def unit_cell_C_atoms (zigzag,layers):
   
    zpos = []
    xpos = []
    zigzag_zpos = [0.0,0.5,0.5,0.0]
    zigzag_xpos = [0.0,0.5,1.5,2.0]
    for x in range(0,layers):
        if zigzag:
            zpos += [zigzag_zpos[x%4] * math.sqrt(3.)]
            xpos += [zigzag_xpos[x%4] + 3.*(x//4)]
        else:
            zpos += [0.5+1.5*(x%2), 1.5-1.5*(x%2)]
            xpos += [x*math.sqrt(3.)/2.,]*2
    return (xpos,zpos)

def unit_cell_H_atoms (zigzag,layers,xpos,zpos,xCH,zCH):

    if zigzag:
        hydrogen_z = [0., 0.5*math.sqrt(3.)*((width/2)%2)]
        hydrogen_x = [xpos[0]-xCH, xpos[-1]+xCH]
    else:
        hydrogen_z = [zpos[0]-zCH, zpos[1]+zCH, zpos[-2]-zCH, zpos[-1]+zCH]
        hydrogen_x = [xpos[0]-xCH, xpos[0]-xCH, xpos[-1]+xCH, xpos[-1]+xCH]
    return (hydrogen_x,hydrogen_z)

# -----------------------------------------------------------------------

zigzag = not armchair

if (zigzag and (width%2==1)):
    raise ValueError, "Width must be an even number for zigzag"

pad = cell_pad/aCC

# For zigzag, the unit cell in Z is sqrt(3)*aCC, for armchair 3*aCC
if zigzag:
    atoms_per_cell = width + 2
    period_z = math.sqrt(3.)
    xCH = aCH/aCC
    zCH = 0.
    elements = ([Carbon,]*width+[Hydrogen,]*2)*repetitions
else:
    atoms_per_cell = width*2 + 4
    period_z = 3.
    xCH = aCH/aCC*math.sqrt(3.)/2.
    zCH = aCH/aCC/2.
    elements = ([Carbon,]*2*width+[Hydrogen,]*4)*repetitions

# -----------------------------------------------------------------------

# Set up the unit cell along the ribbon
(xpos,zpos) = unit_cell_C_atoms (zigzag,width)
(h_xpos,h_zpos) = unit_cell_H_atoms (zigzag,width,xpos,zpos,xCH,zCH)

# Merge C and H, and repeat desired times along ribbon length (Z)
xpos = array((xpos + h_xpos)*repetitions)
zpos = array((zpos + h_zpos)*repetitions)

# The coordinates in zpos must still be shifted along z by N*unit cell width where N=0,1,2,3,...,repetitions-1
# This part is not needed if we would do all repetitions in VNL
shift = fromfunction( lambda i,j : j//atoms_per_cell, (1,atoms_per_cell*repetitions) )
zpos = zpos + shift[0] * period_z

# Unit cell
# In x, add the desired padding the the distance between the outermost atoms
# In y, use the desired padding
# In z, the period is given by period_z, we just need to scale it properly
unit_x = (max(xpos)-min(xpos)) + pad
unit_y = pad
unit_z = period_z * repetitions
unit_cell = array([ [unit_x, 0., 0. ],
                    [0., unit_y, 0. ],
                    [0., 0., unit_z ] ])
             
# Center the atoms in the unit cell
# For x, first adjust for position of H atom, then shift by half the padding
xpos += xCH + pad/2.
# z shift is half
if zigzag:
    zpos += period_z / 4.
else:
    zpos += period_z / 6.   
# And finally y
ypos = array([0.] * repetitions * atoms_per_cell) + pad/2.
   
# Merge coordinates to xyz
pos = array([xpos,ypos,zpos]).transpose()

# Apply final scaling by aCC * Angstrom
# Note: If PACs can be dropped on Molecular Builder, we can do PAC=True permanently
if PAC:
    graphene_ribbon = PeriodicAtomConfiguration (unit_cell*aCC*Ang, elements, pos*aCC*Ang)
else:
    graphene_ribbon_as_molecule = MoleculeConfiguration (elements,pos*aCC*Ang)

Offline fly

  • Regular QuantumATK user
  • **
  • Posts: 20
  • Reputation: 0
    • View Profile
Re: What is the corresponding energy convergence per atom?
« Reply #1 on: January 9, 2012, 13:29 »
Our studied configuration is optimized until all residual forces on each atom are smaller than 0.04 eV/angstrom , but the reviewer thinks that this force convergence criteria is a little too large. He ask us provide the information about energy convergence per atom. How can I obtain energy convergence per atom in geometry optimization by using ATK. Our convergence criterion for geometry optimization is 10^−5 (Ry) in total energy.. Whether energy convergence per atom is 10^−5/the number of atoms?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5577
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: What is the corresponding energy convergence per atom?
« Reply #2 on: January 9, 2012, 14:53 »
Yes, that would be correct.

The referee might be right in that 0.04 eV/Ang is slightly high; in graphene the forces are in general quite small, and so if you are really looking for accurate geometries, I would go for 0.01 eV/Ang or something like that. If the structure contains only C and H, you can use the Brenner potential and compare to DFT for a small structure (not too small though; the Brenner potential needs a certain minimum size of the cell vectors); if the structures agree well, you can use Brenner for the larger structure, which will be extremely fast (in runs in a few minutes at most).
« Last Edit: January 9, 2012, 14:56 by Anders Blom »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5577
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: What is the corresponding energy convergence per atom?
« Reply #3 on: January 10, 2012, 15:17 »
I would like to revise my answer a little bit. If you used 1e-5 Ry as "tolerance" in the IterationControlParameters, then this is not a convergence criterion for the total energy, but rather the Hamiltonian matrix elements. ATK doesn't use the total energy as convergence criterion (at least not since the 10.8 version). If you want to know the total energy accuracy of the converged result, look at "dE" in the last iteration; usually it's smaller than 1e-7 Hartree (for all atoms combined). So the "total energy convergence criterion" you are looking for is rather this value over the number of atoms. (The unit of dE is always Hartree.)