Skip to content

Wrong Voronoi volume for hcp atoms #1630

@usaikia

Description

@usaikia

With pyiron structure = pr.create.structure.bulk("Mg"); structure.analyse.pyscal_voronoi_volume(), I have obtained different values of Voronoi volume for the two atoms in my hcp primitive unitcell. However, they should be same.

This is happening with only pyscal3, not with pyscal, and, as far as I understood, current version of pyiron use pyscal3 for Voronoi volume analysis.

The following code can be used to reproduce this bug:

from pyiron_atomistics import Project
from pyiron_atomistics import pyiron_to_ase
from structuretoolkit.common.pyscal import ase_to_pyscal

pr = Project("test")

hcp_mg = pyiron_to_ase(pr.create.structure.bulk("Mg", a=3.19258898, covera=1.6226, orthorhombic=False))

def calc_vv_with_pyscal3(structure):
    
    hcp = ase_to_pyscal(structure)
    hcp.find.neighbors(method='voronoi')
    
    return hcp.atoms.voronoi.volume

def calc_vv_with_pyscal(structure):
    import pyscal.core as pc
    
    sys = pc.System()
    hcp = sys.read_inputfile(hcp_mg, format="ase")
    sys.find_neighbors(method="voronoi")
    
    return [atom.volume for atom in sys.atoms]

print("With pyscal3 :", calc_vv_with_pyscal3(hcp_mg))

print("With pyscal :", calc_vv_with_pyscal(hcp_mg))

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions