pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

[Feature Request]: SubstrateAnalyzer class does not save the oringinal vector orientation

Open jinlhr542 opened this issue 1 year ago • 0 comments

Problem

In the SlabGenerator class, the vectors used to do lattice matching were extracted from the slab model made by the SlabGenerator. This reorient the vectors and in this way from the final results of lattice matching, the user might get lost of this information. As shown below: print(around(dot(inv(Ni3S2.lattice.matrix.T), matches[14].substrate_sl_vectors.T),8)) [[ 0.8660254 4.60393528] [-0. 5.74376895] [-0.40207068 2.41242407]] I have no idea what the substrate selected vectors are

Proposed Solution

Change the generate_surface_vectors function in the SubstrateAnalyzer class by using oriented_unit_cell:

for f in film_millers: film_slab = SlabGenerator(self.film, f, 20, 15, primitive=False).get_slab() film_vectors = reduce_vectors(film_slab.oriented_unit_cell.lattice.matrix[0], film_slab.oriented_unit_cell.lattice.matrix[1])

        for s in substrate_millers:
            substrate_slab = SlabGenerator(self.substrate, s, 20, 15, primitive=False).get_slab()
            substrate_vectors = reduce_vectors(substrate_slab.**oriented_unit_cell**.lattice.matrix[0], substrate_slab.**oriented_unit_cell**.lattice.matrix[1])

Alternatives

No response

jinlhr542 avatar Nov 07 '23 03:11 jinlhr542