Code Monkey home page Code Monkey logo

Comments (5)

JaGeo avatar JaGeo commented on June 11, 2024

Thanks for raising the issue.

Could you be a bit more specific on the output that you get? For example, if you are using the cation-anion modus in the analysis, I would expect the anion neighbor lists to be empty.

from pymatgen.

Atefeh-Yadegarifard avatar Atefeh-Yadegarifard commented on June 11, 2024

Hello. I am using all the default settings of the ChemEnv module. This error also occurs for cations. For example in the code below, ChemEnv shows an empty list for the site 2, which is Na atom:

from pymatgen.core.structure import Structure
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import LocalGeometryFinder
from pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies import SimplestChemenvStrategy, MultiWeightsChemenvStrategy
from pymatgen.analysis.chemenv.coordination_environments.structure_environments import LightStructureEnvironments

cif_file='030a7f2455.CIF'
structure = Structure.from_file (cif_file)
lgf = LocalGeometryFinder()
lgf.setup_parameters(centering_type="centroid", include_central_site_in_centroid=True)
lgf.setup_structure(structure=structure)
se = lgf.compute_structure_environments(maximum_distance_factor=1.41)
strategy = MultiWeightsChemenvStrategy.stats_article_weights_parameters()
lse = LightStructureEnvironments.from_structure_environments(strategy=strategy, structure_environments=se)
         
species = {}
for i in range(len(lse.as_dict()['structure']['sites'])):         
    species[i] = (lse.as_dict()['structure']['sites'][i]['label'])
    
print (species)    
print (lse.coordination_environments[2])  

cif file in the code .zip

from pymatgen.

JaGeo avatar JaGeo commented on June 11, 2024

Will need to check in more detail.

My ideas:

  • remove "maximum_distance_factor" to see what happens
  • check what happens if you look at all bonds instead of cation-anion ones.

from pymatgen.

JaGeo avatar JaGeo commented on June 11, 2024

If you provide the valences with the bond valence analyser, everything works as expected:

from pymatgen.core.structure import Structure
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import LocalGeometryFinder
from pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies import SimplestChemenvStrategy, \
    MultiWeightsChemenvStrategy
from pymatgen.analysis.chemenv.coordination_environments.structure_environments import LightStructureEnvironments
from pymatgen.analysis.bond_valence import BVAnalyzer

cif_file = '030a7f2455.CIF'
structure = Structure.from_file(cif_file)
bva = BVAnalyzer()
valences = bva.get_valences(structure)
lgf = LocalGeometryFinder()
lgf.setup_structure(structure=structure)
se = lgf.compute_structure_environments(valences=valences)
strategy = MultiWeightsChemenvStrategy.stats_article_weights_parameters()
lse = LightStructureEnvironments.from_structure_environments(strategy=strategy, structure_environments=se)

for isite, (site,ce) in enumerate(zip(structure, lse.coordination_environments)):
    if ce is not None:
        print(site.species_string+str(isite)+': '+str(ce[0]["ce_symbol"]))

ChemEnv cannot deal with coordination numbers larger 13. The coordination numbers get larger 13 if you consider all bonds.

Output from the code above is:

Na0: DDPN:8
Na1: DDPN:8
Na2: BO_2:8
Na3: T:6
Na4: BO_2:8
Na5: DDPN:8
Na6: T:6
Na7: DDPN:8
Na8: T:6
Na9: BO_2:8
Na10: BO_2:8
Na11: T:6
Eu12: SBT:8
Eu13: SBT:8
Eu14: SBT:8
Eu15: SBT:8
B16: TL:3
B17: TL:3
B18: TL:3
B19: TL:3
B20: TL:3
B21: TL:3
B22: TL:3
B23: TL:3

from pymatgen.

JaGeo avatar JaGeo commented on June 11, 2024

I think it is resolved. I am therefore closing the issue. Let me know if there are further issues.

from pymatgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.