Author Topic: how to write python code for read bulk configuration from *.car file  (Read 2723 times)

0 Members and 1 Guest are viewing this topic.

Offline njuxyh

  • QuantumATK Guru
  • ****
  • Posts: 163
  • Reputation: 0
    • View Profile
Hi all:

i know that  nlread function  can read car file,  but i do not know how to write  any  continue code to specify the  what is bulk_configuration, bravais_lattice and so on similar with the following :
 # Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )

is any can kindly help me.

best wishes

 

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
When the nlread()  function read a car file, it will return a molecular configuration. You can know the elements, and the cartesian_coordinates. In order to convert this configuration into a bulk configuration, you have to define the bravais lattice by yourself.

your_molecule = nlread('yourfile.car')[0]
your_lattice =.....
bulk_configuration = BulkConfiguration(
    bravais_lattice=your_lattice,
    elements=your_molecule.elements(),
    cartesian_coordinates=your_molecule.cartesianCoordinates()
    )