pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

Support for FPLO lattice convention

Open mueslo opened this issue 4 years ago • 4 comments

https://github.com/materialsproject/pymatgen/blob/fcb84a1e129da3a3010b9f6b9cf18beddf39f245/pymatgen/core/lattice.py#L310-L363

It would be great if pymatgen also supported FPLO conventions on lattice generation from parameters.

They are as follows: https://www.listserv.dfn.de/sympa/arc/fplo-users/2020-01/msg00002.html

mueslo avatar Oct 25 '21 15:10 mueslo

The link doesn't work. Not sure what FLPO is. But in general, the lattice vectors should not have any impact on any analysis.

shyuep avatar Oct 25 '21 15:10 shyuep

FPLO is a major DFT code. Lattice vectors do have impact on analysis, e.g. if you use the cartesian k-vectors output by the DFT code, they will make no sense in the lattice generated by pymatgen, since their bases are not identical - but only in certain circumstances (e.g. when gamma is not 90°).

I've double-checked, and the link works from here, can you be more specific? I think you have to click the "I am not a spammer" button, and then reload the original link (unnecessarily complex, but works).

For convenience, I will quote it here:

Hexagonal/trigonal lattices are fixed as c=z, b=y, a in xy-plane at 30 degree clockwise from x. Rhomobohedral is the rhombo bravais cell of above mentioned trigonal cell. There are two settings, either as simple cell or as centered trigonal cell. But both have the same orientation with respect to the cartesian axes. cubic, ortho and tetra are along cartesian axes (tetra: c=z). monoclinic: c=z, b=y, a in in xz=plane triclinic are: c=z, b in yz=plane, a free

In general centered lattices are based on conventional cells as described above. Reciprocial cells are fully determined by the duality relation of both lattices.

mueslo avatar Oct 25 '21 16:10 mueslo

Screen Shot 2021-10-25 at 9 18 12 AM Initially the link brought me to this. But after reclicking it several times, it finally brought me to the definition.

I have no objections if someone wanted to implement the FLPO convention in pymatgen. I don't think it is a lot of effort. Just needs an additional "convention" parameter, which will allow other conventions to be specified too. Personally, I prefer if codes output things in formats that are invariant to the definition of the lattice vectors, which are honestly arbitrary. Alternatively, you can always parse the lattice vectors from the FLPO output itself and construct the lattice directly, e.g., Lattice(vectors), rather than using lattice parameters.

shyuep avatar Oct 25 '21 16:10 shyuep

I will either use a workaround (currently writing something similar to your suggestion) or write a new convention argument while keeping the vesta argument for the time being for compatibility until it is deprecated, with something like

if vesta: 
    convention = 'vesta'

Either way, I will come back to this issue and delete it or reference the pull request. Thank you for your input!

I definitely agree that it would be nice to get invariant definitions, but sadly FPLO nowhere outputs the lattice matrix, and I'm currently trying to go through the fortran code to find the exact code used to build the lattice so I'm sure it works in all cases.

mueslo avatar Oct 25 '21 16:10 mueslo