Author Topic: how to center the lattice through python script?  (Read 2990 times)

0 Members and 1 Guest are viewing this topic.

Offline lknife

  • QuantumATK Guru
  • ****
  • Posts: 214
  • Country: us
  • Reputation: 1
    • View Profile
how to center the lattice through python script?
« on: May 18, 2017, 22:04 »
Dear all,

Followed the tutorial, I made a script to adjust the interlayer distance of a bilayer system with various D values. I wanted to calculate the "total energy vs interlayer distance" curve. I found that the value of lattice vectors had some effects on the total energy. Thus, I don't want to change the value of vector c as the tutorial does:
--------------------------------------------   
vc = vc + [0.0, 0.0, d]*Angstrom
--------------------------------------------
However, if I delete this code line, the final bulk configuration will not be at the center of the lattice, which will also affect the successive calculation.

My question is: how to center the bulk configuration through python script?

I am looking forward to your kind help!

Thank you very much for your time!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: how to center the lattice through python script?
« Reply #1 on: May 18, 2017, 23:26 »
There are many ways, but the easiest (even if it's a bit unofficial, so maybe in later versions it doesn't work) is

from NL.CommonConcepts.Configurations.Utilities import center
center(bulk_configuration, axes=[False,False,True])

where the "axes" keyword controls in which directions the centering should be applied (A,B,C).

Offline lknife

  • QuantumATK Guru
  • ****
  • Posts: 214
  • Country: us
  • Reputation: 1
    • View Profile
Re: how to center the lattice through python script?
« Reply #2 on: May 19, 2017, 19:03 »
Thank you very much for your kind help!