Coder Social home page Coder Social logo

smtg-bham / doped Goto Github PK

View Code? Open in Web Editor NEW
104.0 15.0 26.0 1.8 GB

doped is a Python software for the generation, pre-/post-processing and analysis of defect supercell calculations, implementing the defect simulation workflow in an efficient, reproducible, user-friendly yet powerful and fully-customisable manner.

Home Page: https://doped.readthedocs.io

License: MIT License

Python 98.64% Jupyter Notebook 1.33% Ruby 0.02%
ab-initio computational-chemistry computational-materials-science defect-formation-energy defects dft doping fermi-level point-defects pymatgen

doped's Introduction

Build status Documentation Status PyPI Conda Version Downloads DOI

Schematic of a doped (defect-containing) crystal, inspired by the biological analogy to (semiconductor) doping.doped is a Python software for the generation, pre-/post-processing and analysis of defect supercell calculations, implementing the defect simulation workflow in an efficient, reproducible, user-friendly yet powerful and fully-customisable manner.

Tutorials showing the code functionality and usage are provided on the docs site, and an overview of the key advances of the package is given in the JOSS paper.

Key Features

All features and functionality are fully-customisable:

  • Supercell Generation: Generate an optimal supercell, maximising periodic image separation for the minimum number of atoms (computational cost).
  • Defect Generation: Generate defect supercells and guess likely charge states based on chemical intuition.
  • Calculation I/O: Automatically write inputs and parse calculations (VASP & other DFT/force-field codes).
  • Chemical Potentials: Determine relevant competing phases for chemical potential limits, with automated calculation setup, parsing and analysis.
  • Defect Analysis: Automatically parse calculation outputs to compute defect formation energies, finite-size corrections (FNV & eFNV), symmetries, degeneracies, transition levels, etc.
  • Thermodynamic Analysis: Compute (non-)equilibrium Fermi levels, defect/carrier concentrations etc. as functions of annealing/cooling temperature, chemical potentials etc.
  • Plotting: Generate publication-quality plots of defect formation energies, chemical potential limits, defect/carrier concentrations, Fermi levels, charge corrections, etc.
  • Python Interface: Fully-customisable, modular Python API. Plug-and-play w/ShakeNBreakdefect structure-searching, easyunfold – band unfolding, CarrierCapture.jl/nonrad – non-radiative recombination etc.
  • Reproducibility, tabulation, automated compatibility/sanity checking, strain/displacement analysis, shallow defect analysis, high-throughput compatibility, Wyckoff analysis...

Performance and Example Outputs

https://github.com/openjournals/joss-reviews/issues/6433 (a) Optimal supercell generation comparison. (b) Charge state estimation comparison. Example (c) Kumagai-Oba (eFNV) finite-size correction plot, (d) defect formation energy diagram, (e) chemical potential / stability region, (f) Fermi level vs. annealing temperature, (g) defect/carrier concentrations vs. annealing temperature and (h) Fermi level / carrier concentration heatmap plots from doped. Automated plots of (i,j) single-particle eigenvalues and (k) site displacements from DFT supercell calculations. See the JOSS paper for more details.

Installation

pip install doped  # install doped and dependencies
conda install -c conda-forge spglib  # bundle C libraries with spglib

Note that either conda install -c conda-forge spglib or pip install git+https://github.com/spglib/spglib --config-settings=cmake.define.SPGLIB_SHARED_LIBS=OFF should be used after pip install doped, which ensures that the correct C libraries are bundled with spglib, to prevent unnecessary warnings.

Alternatively if desired, doped can also be installed from conda with:

  conda install -c conda-forge doped
  pip install pydefect  # pydefect not available on conda, so needs to be installed with pip or otherwise, if using the eFNV correction

If you haven't done so already, you will need to set up your VASP POTCAR files and Materials Project API with pymatgen using the .pmgrc.yaml file, in order for doped to automatically generate VASP input files for defect calculations and determine competing phases for chemical potentials. See the docs Installation page for details on this.

Citation

If you use doped in your research, please cite:

ShakeNBreak

As shown in the doped tutorials, it is highly recommended to use the ShakeNBreak approach when calculating point defects in solids, to ensure you have identified the groundstate structures of your defects. As detailed in the theory paper, skipping this step can result in drastically incorrect formation energies, transition levels, carrier capture (basically any property associated with defects). This approach is followed in the doped example notebook, with a more in-depth explanation and tutorial given on the ShakeNBreak website.

ShakeNBreak Summary

Studies using doped, so far

  • B. E. Murdock et al. Li-Site Defects Induce Formation of Li-Rich Impurity Phases: Implications for Charge Distribution and Performance of LiNi0.5-xMxMn1.5O4 Cathodes (M = Fe and Mg; x = 0.05–0.2) Advanced Materials 2024
  • A. G. Squires et al. Oxygen dimerization as a defect-driven process in bulk LiNiO22 ChemRxiv 2024
  • X. Wang et al. Upper efficiency limit of Sb2Se3 solar cells arXiv 2024
  • I. Mosquera-Lois et al. Machine-learning structural reconstructions for accelerated point defect calculations arXiv 2024
  • W. Dou et al. Giant Band Degeneracy via Orbital Engineering Enhances Thermoelectric Performance from Sb2Si2Te6 to Sc2Si2Te6 ChemRxiv 2024
  • K. Li et al. Computational Prediction of an Antimony-based n-type Transparent Conducting Oxide: F-doped Sb2O5 Chemistry of Materials 2023
  • X. Wang et al. Four-electron negative-U vacancy defects in antimony selenide Physical Review B 2023
  • Y. Kumagai et al. Alkali Mono-Pnictides: A New Class of Photovoltaic Materials by Element Mutation PRX Energy 2023
  • S. M. Liga & S. R. Kavanagh, A. Walsh, D. O. Scanlon, G. Konstantatos Mixed-Cation Vacancy-Ordered Perovskites (Cs2Ti1–xSnxX6; X = I or Br): Low-Temperature Miscibility, Additivity, and Tunable Stability Journal of Physical Chemistry C 2023
  • A. T. J. Nicolson et al. Cu2SiSe3 as a promising solar absorber: harnessing cation dissimilarity to avoid killer antisites Journal of Materials Chemistry A 2023
  • Y. W. Woo, Z. Li, Y-K. Jung, J-S. Park, A. Walsh Inhomogeneous Defect Distribution in Mixed-Polytype Metal Halide Perovskites ACS Energy Letters 2023
  • P. A. Hyde et al. Lithium Intercalation into the Excitonic Insulator Candidate Ta2NiSe5 Inorganic Chemistry 2023
  • J. Willis, K. B. Spooner, D. O. Scanlon On the possibility of p-type doping in barium stannate Applied Physics Letters 2023
  • J. Cen et al. Cation disorder dominates the defect chemistry of high-voltage LiMn1.5Ni0.5O4 (LMNO) spinel cathodes Journal of Materials Chemistry A 2023
  • J. Willis & R. Claes et al. Limits to Hole Mobility and Doping in Copper Iodide Chemistry of Materials 2023
  • I. Mosquera-Lois & S. R. Kavanagh, A. Walsh, D. O. Scanlon Identifying the ground state structures of point defects in solids npj Computational Materials 2023
  • Y. T. Huang & S. R. Kavanagh et al. Strong absorption and ultrafast localisation in NaBiS2 nanocrystals with slow charge-carrier recombination Nature Communications 2022
  • S. R. Kavanagh, D. O. Scanlon, A. Walsh, C. Freysoldt Impact of metastable defect structures on carrier recombination in solar cells Faraday Discussions 2022
  • Y-S. Choi et al. Intrinsic Defects and Their Role in the Phase Transition of Na-Ion Anode Na2Ti3O7 ACS Applied Energy Materials 2022
  • S. R. Kavanagh, D. O. Scanlon, A. Walsh Rapid Recombination by Cadmium Vacancies in CdTe ACS Energy Letters 2021
  • C. J. Krajewska et al. Enhanced visible light absorption in layered Cs3Bi2Br9 through mixed-valence Sn(II)/Sn(IV) doping Chemical Science 2021

Acknowledgments

doped (née DefectsWithTheBoys #iykyk) has benefitted from feedback from many users, in particular members of the Scanlon and Walsh research groups who have used / are using it in their work. Direct contributors are listed in the Contributors sidebar above; including Seán Kavanagh, Alex Squires, Adair Nicolson, Irea Mosquera-Lois, Alex Ganose, Bonan Zhu, Katarina Brlec, Sabrine Hachmioune and Savya Aggarwal.

doped was originally based on the excellent PyCDT (no longer maintained), but transformed and morphed over time as more and more functionality was added. After breaking changes in pymatgen, the package was entirely refactored and rewritten, to work with the new pymatgen-analysis-defects package.

doped's People

Contributors

adair-nicolson avatar aronwalsh avatar brlec avatar ireaml avatar kavanase avatar sabrine-28 avatar savya10 avatar zhubonan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doped's Issues

Pymatgen PR: Fix DefectPhaseDiagram entries setup

Easier to put this here rather than on ToDo.md, so I can attach a screenshot of the problem. Noticed this issue before but forgot.

The setup of the stable_entries, entries etc properties for DefectPhaseDiagram objects is incorrect, and also unnecessarily inconsistent (some are sets, some are lists, some are dicts?).

For example, with this defect there are 4 stable charge states:
image

But also many (7) metastable states:
image

As shown in the example screenshot below, some of the 'entries' properties are just wrong. Likely a relatively simple processing issue in the pymatgen DefectPhaseDiagram code.
image

JOSS review issues #1

I will ad a number of issues seen from Review by tomorrow. There are just minor issues.

In this issue, I used doped to parse my old calculations (trying to use doped to get degeneracy factors for defect densities):
CaO_bulk v_Ca_0 v_Ca_+1 v_Ca_-1 v_Ca_-2

The jupyter-notebook is found: https://github.com/yuan-gist/doped_review/blob/main/doped.ipynb

The calculations are found: the file sizes are too large, can I put on Google drive and share via email?

The issue is that it seems v_Ca_+1 is not parsed. I also tested other cases. it seems only one type charge states can be parsed.

Multiprocessing slows defect input writing on M1 Mac

The default multiprocessing options actually slow down input set writing on my M1 Max Mac.

Setup

from pymatgen.core import Structure
from doped.generation import DefectsGenerator
from doped.vasp import DefectsSet

prim = Structure.from_file("prim.vasp")
defect_gen = DefectsGenerator(prim)
defect_set = DefectsSet(defect_gen, soc=False)

Writing with multiprocessing

defect_set.write_files("defects", unperturbed_poscar=True)

Time taken: 5 minutes 1 second

Writing without multiprocessing

# same as before...
defect_set.write_files("defects", unperturbed_poscar=True, processes=1)

Time taken: 14 seconds

Fix

Using multiple threads instead of multiple processes seems to fix the issue.

from multiprocessing.pool import ThreadPool as Pool

Time taken: 13 seconds

However, the timing doesn't substantially improve on no multiprocessing.

`DOPED` doesn't set `NBANDS` (?)

RE: my post in the #defects channel on the SMTG slack, I noticed a significant performance drop between calculations of the same defect in different charge state. This was due to different values of NBANDS being used, which in turn affects the parallelisation, in this case quite significantly (LOOP times roughly an order of magnitude larger).

Is there anyway of implementing into the input file generation step a check for choosing a sensible number for NBANDS? Or at least flash up a big warning or something 😬 Even in the comment line at the top of the INCAR, NBANDS isn't specified as a variable parameter, i.e. something you should check for each system.

Hope this is helpful!

Joe

pymatgen compatibiilty issue

When I tried to get phase diagram using
cpa.calculate_chempots()

I am getting error:

ValueError Traceback (most recent call last)
/tmp/ipykernel_623835/2503364578.py in
----> 1 cpa.calculate_chempots()

~/Downloads/cplap/doped/doped/competing_phases.py in calculate_chempots(self, csv_fname)
393 # presumably checks if the phase is intrinsic
394 if set(Composition(d['formula']).elements).issubset(self.bulk_composition.elements):
--> 395 pd_entries_intrinsic.append(e)
396 if e.composition == self.bulk_composition:
397 self.bulk_pde = e

~/Downloads/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/phase_diagram.py in init(self, entries, elements, computed_data)
357 self.entries = entries
358 if computed_data is None:
--> 359 computed_data = self._compute()
360 else:
361 computed_data = MontyDecoder().process_decoded(computed_data)

~/Downloads/anaconda3/lib/python3.9/site-packages/pymatgen/analysis/phase_diagram.py in _compute(self)
421 if len(el_refs) != dim:
422 missing = set(elements).difference(el_refs.keys())
--> 423 raise ValueError(f"There are no entries for the terminal elements: {missing}")
424
425 data = np.array(

ValueError: There are no entries for the terminal elements: {Element O, Element La, Element Mn}

non-default POTCAR causing total NELECT to be incorrect

Recent change to select which POTCAR is generated for each element when writing vasp_gam, vasp_std files using the argument:

potcar_settings={"POTCAR": {"Sn": "Sn"}}

when the default POTCAR for Sn is Sn_d. However, the total NELECT generated in the INCAR is calculated from the valence electrons from the default POTCAR, while the updated POTCAR is copied to POTCAR file. So I think the POTCAR implementation needs to come before the determination of NELECT.

I confirmed this by running a simple bash script to calculate the number of electrons in the system from POSCAR and POTCAR:

species+=($(head -6 POSCAR | tail -1))
numbers+=($(head -7 POSCAR | tail -1))
electrons+=($(grep ZVAL POTCAR | awk '{print $6/1}'))
list=$(echo ${#numbers[@]} -1 | bc)

for i in $(seq 0 $list); do
       sum[$i]+=$(echo "${numbers[$i]} * ${electrons[$i]}" | bc)
done

for j in ${sum[@]}; do
       let tot+=$j
done
echo "electrons = ${tot}"

which returns a different value (by a couple hundred electrons...) to the value of NELECT that doped writes to the INCAR.

I noticed this was an issue because all of my calculations (at gamma point) were returning hugely positive energies!!

Cheers

Point defect generation in ternary alloy

I am currently trying to generate point defects in a Zn_108Se_27Te_81 alloy using a 3x3x3 supercell configuration of the zinc blende crystal structure, which comprises a total of 216 atoms. However, the output from the doped has been unexpected and appears to deviate from anticipated results.

Based on the output data, it seems there may be a considerable number of non-equivalent defect sites within the structure, which could be influencing the behavior of the DefectGeneration class, triggering unexpected results. This observation suggests potential issues in the symmetry or initial configuration of the supercell that may need to be addressed.

Could you please review the attached file and provide your insights on whether the presence of these non-equivalent defect sites might be affecting the doped outcomes? Your expertise in this area would be invaluable in diagnosing and resolving this issue.

Also, I would suggest

  1. Refactoring respective Class capable of adaptively placing defects based on the local atomic environment, rather than a uniform approach. This would allow the class to manage non-equivalent sites more effectively by adjusting the defect characteristics to match the unique aspects of each site.

  2. Consider implementing machine learning (https://github.com/materialsvirtuallab/matgl) techniques to quickly identify the equivalent sites and high energy defects

Thank you for your assistance.

Best regards,
Habibur

POSCAR.zip
file.zip

Feature request: Support versions of spglib above 2.0.2

Right now, I can't install the most recent versions of doped and phonopy due to an incompatibility with spglib:

pip install doped==2.4.2 phonopy==2.33.1
ERROR: Cannot install doped==2.4.2 and phonopy==2.23.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    doped 2.4.2 depends on spglib<=2.0.2
    phonopy 2.23.1 depends on spglib>=2.3

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

So, this issue report is simply a feature request to support newer versions of spglib. I actually got this error when trying to install shakenbreak==3.3.3 and phonopy==2.33.1, which then downgraded doped to such a degree that much of my code was not working anymore.

error in ExtrinsicCompetingPhases module

Dear Team,
I get below error when running an example calculation:
Do you know how to resolve this error?

from doped.chemical_potentials import ExtrinsicCompetingPhases
ex_cp = ExtrinsicCompetingPhases(composition="ZrO2", extrinsic_species="La", e_above_hull=0.03)

The 'inc_structure' argument is deprecated as structure data is now always included in all returned entry objects.
Retrieving ThermoDoc documents: 100%|█████████████████████████████████████████████| 59/59 [00:00<00:00, 558609.34it/s]
Traceback (most recent call last):
File "", line 1, in
File "/home/aaa/Downloads/miniconda3/lib/python3.11/site-packages/doped/chemical_potentials.py", line 810, in init
super().init(composition, e_above_hull, api_key)
File "/home/aaa/Downloads/miniconda3/lib/python3.11/site-packages/doped/chemical_potentials.py", line 399, in init
self.MP_full_pd_entries = mpr.get_entries_in_chemsys(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aaa/Downloads/miniconda3/lib/python3.11/site-packages/mp_api/client/mprester.py", line 1192, in get_entries_in_chemsys
self.get_entries(
File "/home/aaa/Downloads/miniconda3/lib/python3.11/site-packages/mp_api/client/mprester.py", line 759, in get_entries
doc.model_dump()[property] # type: ignore
~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'pretty_formula'

unable to calculate the chemical potential ranges for extrinsic dopant

Hello.
I have been trying to dope CsPbI3 with Sn at the B-site. I have generated the competing phases with doped using e_above_hull = 0, which resulted in ['Sn', 'SnI4', 'Cs2SnI6']. After relaxing the structures, and trying to parse the data if I put only Cs2SnI6_EaH_0, Sn_EaH_0 and SnI4_EaH_0 in the competing_phases folder, the code asks for the relaxation data of the parent bulk phase as:
"Could not find bulk phase for CsPbI3 in the supplied data. Found phases: []"
However, if i put the vasp relaxtion result of CsPbI3_bulk into the competing_phases folder, this error occurs:

``---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[2], line 2
1 cpa = CompetingPhasesAnalyzer("CsPbI3", extrinsic_species = "Sn")
----> 2 cpa.from_vaspruns(path='./competing_phases/',
3 folder = "vasp_std",
4 csv_fname = "./competing_phases/cspbi3_Sn_doped_energies.csv")
5 df= cpa.calculate_chempots (csv_fname = "./competing_phases/cspbi3_Sn_chempots.csv")

File ~/miniconda3/lib/python3.11/site-packages/doped/chemical_potentials.py:1199, in CompetingPhasesAnalyzer.from_vaspruns(self, path, folder, csv_fname)
1190 d = {
1191 "formula": v["pretty_formula"],
1192 "kpoints": kpoints,
(...)
1195 "energy": final_energy,
1196 }
1197 temp_data.append(d)
-> 1199 formation_energy_df = _calculate_formation_energies(temp_data, self.elemental_energies)
1200 if csv_fname is not None:
1201 formation_energy_df.to_csv(csv_fname, index=False)

File ~/miniconda3/lib/python3.11/site-packages/doped/chemical_potentials.py:181, in _calculate_formation_energies(data, elemental)
179 for d in data:
180 for e in elemental:
--> 181 d[e] = Composition(d["formula"]).as_dict()[e]
183 formation_energy_df = pd.DataFrame(data)
184 formation_energy_df["formation_energy"] = formation_energy_df["energy_per_fu"]

KeyError: 'Sn'

I would like to ask how to solve this issue.
Thank you.

Add support for dumbbell/split interstitials

Are there any plans to support split interstitial generation? Maybe this is already supported with some advanced configuration but it was not obvious to me from the defect generation tutorial.

Seeking Assistance with Errors in Example Run

Hello,

I seem to have encountered some errors while running an example. Could you please advise on how to proceed?

Traceback (most recent call last):
File "/public/home/jyan/test.py", line 8, in
cp = CompetingPhases("ZrO2")
^^^^^^^^^^^^^^^^^^^^^^^
File "/public/home/jyan/anaconda3/lib/python3.11/site-packages/doped/chemical_potentials.py", line 395, in init
self.MP_full_pd_entries = mpr.get_entries_in_chemsys(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/public/home/jyan/anaconda3/lib/python3.11/site-packages/mp_api/client/mprester.py", line 1192, in get_entries_in_chemsys
self.get_entries(
File "/public/home/jyan/anaconda3/lib/python3.11/site-packages/mp_api/client/mprester.py", line 759, in get_entries
doc.model_dump()[property] # type: ignore
~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'pretty_formula'

Thank you for your time and assistance.

Error massage during making csv file with CompetingPhasesAnalyzer

I got this error message when using CompetingPhasesAnalyzer to generate a csv file, although the file seems to be generated successfully. In addition, it says "parsing 33 vaspruns,", but only 28 phases are listed in the csv file.

cpa.from_vaspruns(path="./PhadeDiagram/", folder="", csv_fname="STO_competing_Phase.csv"

Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrAl4O7_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/home, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr2Ti6O13_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Al_EaH=0.011, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Ti2O_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrAl2O4_EaH=0.012, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr_EaH=0.013, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/TiO2_EaH=0.0081, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/.DS_Store, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr_EaH=0.0056, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrO2_EaH=0.0096, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/O2_EaH=0.0017, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Ti_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Ti_EaH=0.004, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrO2_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrAl2O4_EaH=0.006, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/TiO_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrTi11O20_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrAl2O4_EaH=0.019, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr_EaH=0.0064, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/O2_EaH=0.01, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrTiO3_EaH=0.00057, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Al_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/TiO2_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrTiO3_EaH=0.00088, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/TiO2_EaH=0.0064, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr_EaH=0.0079, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/O2_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrTi3Al8O19_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrTiO3_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/SrAl2O4_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Ti2O3_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/Sr3Ti2O7_EaH=0, proceed with caution
Can't find a vasprun.xml(.gz) file for PhadeDiagram/O2_EaH=0.012, proceed with caution
parsing 33 vaspruns, this may take a while

Mismatched atomic order causing incorrect kumagai corrections

l have been trying to track down a change of results after upgrading doped from an older version (Apil 2022). The results from the kumagai correction are different from before, and I have found this is due to the incorrect site_maching_indices extract.

The problem is down to the fact that the bulk structure and the defect structure appears to have different ordering of the species. In particular, the bulk structure has Al O Sb while the defects generated has Al Sb O. This change is due to the use of MPRelaxSet when preparing the input structure, which includes a standardisation step that may change the ordering of species.

In the old version, the initial_defect_structure was used for the kumagai and I had it as the "unrelaxed defect structure". However, in the more recent version the unrelaxed_defect_structure takes the precedence. It is generated from the bulk structure, but as I mentioned above, it can have a different ordering of the atoms compared to that used in the actual calculation. Hence, this generates an incorrect site_maching_indices needed for kumagai. More confusingly, the kumagai_loader saves this structure as initial_defect_structure.

A few solutions to this issue:

  1. Do we really need to use the MPRelaxSet? It reorders the structure, which is OK for database building but perhaps not so for defect calculations. My suggestion is to get rid of it or at least have our own implementation that does a similar thing.
  2. A warning should be printed if the bulk and the defect have different species orderings.
  3. The site matching for kumagai (matching between the bulk and the defect) should be performed using the actual defect structure used in the calculation initial_defect_structure, rather than the unrelaxed_defect_structure. But this should be really be resolved by guaranteeing the defect structure calculated is really the one that is generated with the same ordering (solving 1).

standard pip installation does not work....

~/miniconda3/envs/aiida-1.0-py3/lib/python3.8/site-packages/monty/io.py in zopen(filename, *args, **kwargs)
     41     if ext in (".GZ", ".Z"):
     42         return gzip.open(filename, *args, **kwargs)
---> 43     return io.open(filename, *args, **kwargs)  # pylint: disable=R1732
     44 
     45 

FileNotFoundError: [Errno 2] No such file or directory: '/home/bonan/miniconda3/envs/aiida-1.0-py3/lib/python3.8/site-packages/doped/default_POTCARs.yaml'

I think it is because default_POTCARs.yaml is not included in the python package....

Parsing issues

Hi, thank you for developing such tool. When I wanted to parse the output, it was throwing out this error messages
Screenshot 2024-04-19 at 4 32 18 PM
This is my script to parse the output....

from doped.analysis import DefectsParser

dielectric = 8.99 # dielectric constant (this can be a single number (isotropic), or a 3x1 array or 3x3 matrix (anisotropic))
bulk_path='/depot/amannodi/data/Benji_Sabria_Calculations_Folder/Sabria/CdTe/Ground_State_POSCAR/bulk/vasp_std'
dp = DefectsParser('/depot/amannodi/data/Benji_Sabria_Calculations_Folder/Sabria/CdTe/Ground_State_POSCAR/', dielectric=dielectric) # dielectric needed for charge corrections

Under '/depot/amannodi/data/Benji_Sabria_Calculations_Folder/Sabria/CdTe/Ground_State_POSCAR/', I have bunch of defect folders
Screenshot 2024-04-19 at 4 35 52 PM

Extrinsic Competing Phases error

Why am I getting error while generating competing phase diagram with external impurity?
In material project there is an entry Cs2CuBiI6

x_cp = ExtrinsicCompetingPhases(composition="Cs3Cu3I5", extrinsic_species="Bi", e_above_hull=0.03)
You are using the legacy MPRester. This version of the MPRester will no longer be updated. To access the latest data with the new MPRester, obtain a new API key from https://materialsproject.org/api and consult the docs at https://docs.materialsproject.org/ for more information.
Traceback (most recent call last):
File "", line 1, in
File "/scratch/aaa/miniconda3/lib/python3.12/site-packages/doped/chemical_potentials.py", line 810, in init
super().init(composition, e_above_hull, api_key)
File "/scratch/aaa/miniconda3/lib/python3.12/site-packages/doped/chemical_potentials.py", line 444, in init
bulk_ce = bulk_entries[0] # lowest energy entry for bulk composition (after sorting)
~~~~~~~~~~~~^^^
IndexError: list index out of range

pymatgen API update breaks DefectsGenerator

Hello,

I am using Python 3.11, doped 2.4.1, and pymatgen 2024.5.1.

I was following the Defects Generation tutorial, but instantiating a DefectsGenerator object fails.
This occurs due to a breaking change in pymatgen's API (not sure when it was introduced), which updated the Lattice.get_points_in_sphere() function to return a Tuple instead of a List. When the doped.utils.supercells.get_min_image_distance() function is called, the .sort() called in Line 80 of supercells.py fails because Tuple has no sort() function.

Potentials fixes:

  1. Update doped.utils.supercells.get_min_image_distance() to use Lattice.get_points_in_sphere_old(), but there's no guarantee for how long pymatgen will retain the old version of the function.
  2. Change the .sort() in line 80 of supercells.py to use sorted() instead.
  3. Change the tuple returned by Lattice.get_points_in_sphere() to a list using list().

Thanks!

Repository size seems to be very large?

I tried to clone the repository for development but it takes a long time with git reporting receiving over 1GB worth of objects and du -sh reports a directory size of 1.6 GB.

This is probably due to the large files? I had the impression that the size of the repo is not easy to reduce retrospectively without messing up the commit history. But it may be worth keeping it growing further? It may be useful to move large examples files into dedicated repositories.

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.