bjmorgan / polyhedral-analysis

MIT License
3 stars 2 forks source link

inconsistent polyhedral assignment for structure and its supercell #3

Open alexsquires opened 2 years ago

alexsquires commented 2 years ago

given a structure (cif format)

data_image0
_chemical_formula_structural       W3O9W3O9
_chemical_formula_sum              "W6 O18"
_cell_length_a       3.899
_cell_length_b       7.298
_cell_length_c       12.6405
_cell_angle_alpha    90
_cell_angle_beta     90
_cell_angle_gamma    90

_space_group_name_H-M_alt    "P 1"
_space_group_IT_number       1

loop_
  _space_group_symop_operation_xyz
  'x, y, z'

loop_
  _atom_site_type_symbol
  _atom_site_label
  _atom_site_symmetry_multiplicity
  _atom_site_fract_x
  _atom_site_fract_y
  _atom_site_fract_z
  _atom_site_occupancy
  W   W1        1.0  0.00000  0.25000  0.25000  1.0000
  W   W2        1.0  0.00000  0.50000  0.00000  1.0000
  W   W3        1.0  0.00000  0.75000  0.25000  1.0000
  O   O1        1.0  0.50000  0.25000  0.25000  1.0000
  O   O2        1.0  0.50000  0.50000  0.00000  1.0000
  O   O3        1.0  0.50000  0.75000  0.25000  1.0000
  O   O4        1.0  0.00000  0.68200  0.10600  1.0000
  O   O5        1.0  0.00000  0.50000  0.28800  1.0000
  O   O6        1.0  0.00000  0.31800  0.10600  1.0000
  O   O7        1.0  0.00000  0.81800  0.39400  1.0000
  O   O8        1.0  0.00000  0.18200  0.39400  1.0000
  O   O9        1.0  0.00000  0.00000  0.21200  1.0000
  W   W4        1.0  0.00000  0.75000  0.75000  1.0000
  W   W5        1.0  0.00000  0.00000  0.50000  1.0000
  W   W6        1.0  0.00000  0.25000  0.75000  1.0000
  O   O10       1.0  0.50000  0.75000  0.75000  1.0000
  O   O11       1.0  0.50000  0.00000  0.50000  1.0000
  O   O12       1.0  0.50000  0.25000  0.75000  1.0000
  O   O13       1.0  0.00000  0.18200  0.60600  1.0000
  O   O14       1.0  0.00000  0.00000  0.78800  1.0000
  O   O15       1.0  0.00000  0.81800  0.60600  1.0000
  O   O16       1.0  0.00000  0.31800  0.89400  1.0000
  O   O17       1.0  0.00000  0.68200  0.89400  1.0000
  O   O18       1.0  0.00000  0.50000  0.71200  1.0000

if I assign polyhedra in this structure using the recipe

  recipe = PolyhedraRecipe(
    method="distance cutoff",
    coordination_cutoff=3,
    central_atoms="W",
    vertex_atoms=["O"],
)

The polyhedra are incorrectly assigned as being 5 coordinate, but if I make a supercell of this structure, they all come out as six coordinate - they should all be found as octahedra in both structures

Here's an mwe:

from polyhedral_analysis.configuration import Configuration
from polyhedral_analysis.polyhedra_recipe import PolyhedraRecipe
from pymatgen.core import Structure

structure = Structure.from_file('{provided-cif}.cif')

recipe = PolyhedraRecipe(
    method="distance cutoff",
    coordination_cutoff=3,
    central_atoms="W",
    vertex_atoms=["O"],
)

config = Configuration(structure, [recipe])
for p in config.polyhedra:
    print(p.vertex_count)

structure.make_supercell(2)
config = Configuration(structure, [recipe])
for p in config.polyhedra:
    print(p.vertex_count)
bjmorgan commented 2 years ago

This is an issue with periodic boundary conditions. I think each atom can only appear in a specific polyhedron once. So if your polyhedra wrap across PBCs and include the same atom twice the current algorithm only reports that atom once.