Author Topic: Regarding the problem of converting the structure from atkpython to cif  (Read 1295 times)

0 Members and 1 Guest are viewing this topic.

Offline dmicje12

  • Heavy QuantumATK user
  • ***
  • Posts: 27
  • Country: tw
  • Reputation: 0
    • View Profile
Hello everyone
Because I need to make some changes to the structure and save it as a new structure, and the new structure must be in the form of a cif file.
So is there any way to convert the structure in atkpython form into cif file form using command line or python syntax?
Thanks!

Offline dmicje12

  • Heavy QuantumATK user
  • ***
  • Posts: 27
  • Country: tw
  • Reputation: 0
    • View Profile
I'd like to know the commands for converting 'atkpython' files to CIF or POSCAR. Thank you everyone.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5616
  • Country: dk
  • Reputation: 107
    • View Profile
    • QuantumATK at Synopsys
What you need is either
Code: python
from NL.QuantumATK.ConfigurationConverters.CIFConverters import configurationToCIF
with open("myfile.cif", 'w') as f:
    f.write(configurationToCIF(configuration))
or
Code: python
from AddOns.VASPPlugins.IO import writePOSCAR
writePOSCAR(configuration, "POSCAR")
NOTE: In case someone wants to use this export function for more advanced crystallography purposes, bear in mind that the QuantumATK CIF exporter is rather primitive and can only save structure as P1, so it will not use the correct spacegroup symmetries to reduce the atom list to the irreducible basis.
« Last Edit: January 8, 2025, 20:44 by Anders Blom »

Offline dmicje12

  • Heavy QuantumATK user
  • ***
  • Posts: 27
  • Country: tw
  • Reputation: 0
    • View Profile
Thanks for your reply!
This is exactly what i need!