From: Luthaf (luthaf_at_luthaf.fr)
Date: Mon Apr 06 2020 - 09:37:45 CDT

Hi FX,

This is a very good idea, but please do not create a new format just for
this!

Their is a semi-standard extended XYZ format, implemented by ASE,
QUIP/libatom and some other software (AFAIK atomsk and OVITO):
https://web.archive.org/web/20181127185526/http://libatoms.github.io/QUIP/io.html#module-ase.io.extxyz

In this format, your example would look like
1188
Properties=species:S:1:pos:R:3 Lattice="27.565 -17.625 -0.1688 0.0
34.368 -0.822 0.0 0.0 10.715"
O        10.659605       14.038974        6.458052
  H        10.304418       14.500156        7.211330

Using a full Lattice instead of specific cell parameters (a, b, c, ...)
is also more flexible, since it does not require aligning the cell axis
with Cartesian axis (putting the cell matrix in upper triangular form).

Extended XYZ still retains the nice property of being readable by
software unaware of it (the comment line is ignored).

Cheers,
Guillaume

FX a écrit le 06.04.20 à 12:01 :
> Hi everyone,
>
> I was thinking about a way to add cell information to files read or
> written in XYZ format. As you know there is no cell information
> recorded in the XYZ file format, but it is actually pretty easy to add
> some: each structure has a comment line, which different tools can use
> to store additional information. We can add the cell information
> there, in a format that is unambiguous to anyone reading the file:
>
> 1188
>  generated by VMD, with cell: a=27.565001 b=38.624001 c=10.748000
> alpha=93.489998 beta=90.900002 gamma=117.150002
>  O        10.659605       14.038974        6.458052
>  H        10.304418       14.500156        7.211330
>
> and yet will be ignored by any tool that does not expect it.
>
> I also added the code to read back the information, so that XYZ files
> can be round-tripped with no loss of information. This can also allow
> other tools to start adding cell information in the future, in
> particular users’ own conversion/analysis scripts. The reading code is
> completely specific about what it expects, to avoid reading wrong
> information. It will only read information in the specific format
> above, where all the a= b= c= alpha= beta= gamma= fields are provided
> and non-zero. Otherwise, we fall back to the current behaviour.
>
> I hope this can be useful, and welcome feedback.
>
> Best regards,
> FX
>
> --
> Dr. François-Xavier Coudert
> Senior Researcher / Directeur de Recherche CNRS
> at the Institut de Recherche de Chimie Paris
> Professeur attaché ENS / PSL University
> Webpage: https://www.coudert.name/
>
>
>
>