Closed shelbygalinat closed 1 year ago
Hi,
The error is associated with As ("KeyError: 33"). There is no pair potentials for As in -3 oxidation state. There are not many you can do, I would suggest to manually change it to As+5: ".... _atom_type_oxidation_number Mg2+ 2.0 As3- 5.0 N3- -3.0" ...."
After that, you need to provide oxi_check = False key when reading cif file (see an example below). Worked in my case. However, this method is rough (because As3- and As5+ are significantly different) and can used for visualization of diffusion pathways rather than for activation energy estimation. Another disadvantage is that this method cannot be used for high throughtput screenings (well, it can be used but after some coding for auto re-assigning As oxidation state)
from bvlain import Lain
calc = Lain()
file = r"C:\Users\Dembitskiy\Downloads\Mg3AsN.cif" # materials project file
calc.read_file(file, oxi_check = False) # Forces to not use pymatgen's BVAnalyzer for oxi states assignment
calc.bvse_distribution(mobile_ion = 'Mg2+')
calc.percolation_analysis()
{'E_1D': 2.1094, 'E_2D': 2.1094, 'E_3D': 2.1094}
I've been trying to run BVSE for materials with Mg2+ as the mobile ion, and while it works for some cifs (like MgZr4(PO4)6 and MgO), I keep getting "KeyError: 33" and this error message for Mg3NAs: "Oops. No BVSE data for a given combination of oxidation states." I have tried editing the oxidation states in the text file for the cif to make sure they were correct and in the right format:
"_atom_type_oxidation_number Mg2+ 2.0 As3- -3.0 N3- -3.0"
but that doesn't seem to fix the problem. My guess is the 3- charges for N and As in this material are confusing to the code, but I'm not sure if there's anyway around this.