Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Voronoi volume for hcp atoms #1630

Open
usaikia opened this issue Dec 17, 2024 · 0 comments
Open

Wrong Voronoi volume for hcp atoms #1630

usaikia opened this issue Dec 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@usaikia
Copy link
Contributor

usaikia commented Dec 17, 2024

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))
@usaikia usaikia added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants