Author Topic: How to optimize the bulk lattice  (Read 10005 times)

0 Members and 1 Guest are viewing this topic.

Offline frsy

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
How to optimize the bulk lattice
« on: March 19, 2009, 13:41 »
Dear all,
  I'm new here. Now, I can build and calculate one simple bulk. But how can I optimize the lattice of the bulk while keep the fractional coordinates of all atoms fixed? I looked up the manual and foud ATK ONLY can relax the coordinates of the atom. Do I miss something?
  Regards,

Frsy

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: How to optimize the bulk lattice
« Reply #1 on: March 19, 2009, 13:49 »
Hey frsy and welcome too :)

The best way to optimize the geometry in your case, is to calculate the equation of states - or simply the total energy as a function of the lattice constant. The minimum of this curve is then the optimized geometry,
and if the crystal, you are looking at, is defined by a single lattice constant, then this is the superior way.

However if the crystal is defined by more than one lattice constant, it might require alot of calculations in order to determine the minimum, and for that I have create my own little smart script for doing so.
This you can read more about here on the forum

Good luck ! :)

P.S Just out of curiosity, what system are you calculating on?

Offline frsy

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: How to optimize the bulk lattice
« Reply #2 on: March 19, 2009, 14:11 »
Thank you, Nordland!
I'm trying to optimize rutile. It has two variable lattice lengths so your script is helpful to me.
Regards,

Frsy

Offline frsy

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: How to optimize the bulk lattice
« Reply #3 on: March 23, 2009, 11:43 »
Dear Nordland,
   My input file for optimizating rutile bulk is :
###############################
from stress_optimizers import *
import ATK; ATK.setVerbosityLevel(1)
from ATK.KohnSham import *
# Select Bravais lattice and define lattice constants
bravais_lattice = BodyCenteredTetragonal(
    a=4.594000 * Angstrom,
    c=2.959000 * Angstrom
    )

# Define bulk elements and unit cell coordinates
elements = [Titanium, Oxygen]
coordinates = [[ 0.        ,  0.        ,  0.        ],
               [ 0.69520000,  0.30480000,  0.        ]]

# Set up bulk configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice,
    elements,
    fractional_coordinates=coordinates
    )
nlPrint(bulk_configuration)

method = KohnShamMethod(brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters((5,5,7)),
                        basis_set_parameters = basisSetParameters())
opt_conf = calculateOptimizedBulkConfiguration(bulk_configuration, method, runtimeParameters(1))
################################

    I noticed from the output, the initially calculated stress is very large:
# Stresses
# Stress (A) = -277.951887706 eV/Ang**3
# Stress (C) = -277.700861096 eV/Ang**3
    I think my lattices (4.954, 2.959) are not too far from the experimental ones. Is this stress reliable? Or do I make something wrong?
    Regards,

Frsy

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: How to optimize the bulk lattice
« Reply #4 on: March 23, 2009, 13:34 »
Hey Frsy.

The stress is calculated in a very crude way, and I don't think they should be taken for more than a measurement if the cell is in optimal
configuration or not.

I will try to run your script and see what I get for the optimial structure..

Offline frsy

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: How to optimize the bulk lattice
« Reply #5 on: March 24, 2009, 08:44 »
After debug "pseudoStress" and "findFractionalCoordinates" I found incorrect fractional_coordinates were used to build strained_configuration. So the energy difference is large and thus the absolute stress is also large.
Maybe the sub "findFractionalCoordiantes" doesn't work in my case. (BCT Rutile)

My input fractional coords:
coordinates = [[ 0.        ,  0.        ,  0.        ],
               [ 0.69520000,  0.30480000,  0.        ]]

The initial coords in output:
# Index  Element  x (Ang)  y (Ang)  z (Ang)
      0       Ti     0.00     0.00     0.00
      1       O     -0.91     0.91     1.48

Recognized coords in the pseudoStress for the first time:
# Index  Element  x (Ang)  y (Ang)  z (Ang)
      0       Ti     0.00     0.00     0.00
      1       O     -0.91     0.91     1.48

Strained coords after using "findFractionalCoordinates":
# Index  Element  x (Ang)  y (Ang)  z (Ang)
      0       Ti     0.00     0.00     0.00
      1       O      2.07     0.25    -0.74

It is far from the original coords, the calculated fractional coords may be questionable.
« Last Edit: March 24, 2009, 08:47 by frsy »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How to optimize the bulk lattice
« Reply #6 on: March 24, 2009, 12:04 »
One should use the primitiveVectors(), not conventionalVectors(), when you compute the fractional coordinates. If you change that single line in the routine findFractionalCoordinates() I believe it will work as intended, that is line 12 in stress_optimizers.py should be:
Code
uc = configuration.bravaisLattice().primitiveVectors()

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: How to optimize the bulk lattice
« Reply #7 on: March 24, 2009, 13:54 »
I have reupload the script in a new version to support cells where the conventional cell and the primitive is not the same.

Offline frsy

  • Heavy QuantumATK user
  • ***
  • Posts: 33
  • Reputation: 0
    • View Profile
Re: How to optimize the bulk lattice
« Reply #8 on: March 25, 2009, 04:22 »
Yes, Blom.
The stress is normal now. Thank you.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How to optimize the bulk lattice
« Reply #9 on: March 25, 2009, 08:52 »
Apparently there were two places in the script that needed modifying, so I hope you used the updated script posted by Nordland.