/home/0/.local/lib/python3.11/site-packages/pymatgen/core/structure.py:3087: EncodingWarning: We strongly encourage explicit
encoding, and we would use UTF-8 by default as per PEP 686
with zopen(filename, mode=“rt”, errors=“replace”) as file:
/home/0/.local/lib/python3.11/site-packages/pymatgen/core/structure.py:3087: EncodingWarning: We strongly encourage explicitencoding, and we would use UTF-8 by default as per PEP 686
with zopen(filename, mode=“rt”, errors=“replace”) as file:
기존 당신이 저에게 주신 코드는 encoding 에러가 발생했습니다.
이에 저는 아래와 같이 코드를 수정하였습니다.
import warnings
warnings.filterwarnings("ignore", message=r".*explicit `encoding`.*")
from pymatgen.analysis.structure_matcher import StructureMatcher
from pymatgen.core import Structure
matcher = StructureMatcher()
s_bp = Structure.from_file("POSCAR_bp")
s_bcp = Structure.from_file("POSCAR_bcp")
for s in (s_bp, s_bcp):
for k in s.site_properties:
s.remove_site_property(k)
print(matcher.fit(s_bp, s_bcp))
위 코드를 실행해서 제가 얻은 값은 True 입니다.
POSCAR_bp
Co1 F3
1.0
2.6472384033333332 1.5283830066666670 2.1613651899999997
0.0000023733333334 -3.0567679833333337 2.1613661900000003
2.6472397666666665 -1.5283839666666665 -2.1613641800000001
Co F
1 3
direct
0.9999965233333332 0.9999965233333331 0.0000034766666666 Co3+
0.5000006766666666 0.0001207133333332 0.0001185800000000 F-
0.0001207133333334 0.9998814199999999 0.4999993233333332 F-
0.9998810866666666 0.5000006766666668 0.9998789533333333 F-
POSCAR_bcp
Co1 F3
1.0
-2.6472393272282879 -1.5283843381846158 2.1613651866667190
-2.6472393272282879 1.5283843381846154 -2.1613651866667194
0.0000000000000000 -3.0567686763692312 -2.1613651866667190
Co F
1 3
direct
0.9999999999999999 0.0000000000000001 0.0000000000000001 Co3+
0.0001198116666665 0.5000000000000001 0.0001198116666667 F-
0.9998801883333335 0.9998801883333335 0.4999999999999999 F-
0.5000000000000000 0.0001198116666666 0.9998801883333335 F-
더 나아가 band gap을 아래의 코드를 활용해 계산하였습니다.
I referenced your other answer.
from pymatgen.io.vasp import Vasprun
vasprun = Vasprun("bcp_vasprun.xml") # or the path to your vasprun.xml
gap = vasprun.get_band_structure(efermi="smart").get_band_gap()
print("band gap from vasprun:", gap)
For B > C > P structure
band gap from vasprun: {‘direct’: False, ‘transition’: ‘(0.500,0.500,0.500)-(0.000,0.000,0.000)’, ‘energy’: 0.20450000000000002}
For B > P structure
band gap from vasprun: {‘energy’: 0.0, ‘direct’: False, ‘transition’: None}
Now, regarding the question you asked,
- Since the material I’m examining is a metal, using the default value LEGACY might be inaccurate. (Though I don’t fully understand, is it correct that the default sets the Fermi level below VBM and CBM like insulators?)
So I modified it to EFERMI = MIDGAP and ran the codes again, but
the error keeps occurring as shown in the image.
-
The initial structures are identical in both cases.
-
The Band Gap is as shown above.
According to those results, does this mean that Co1F3, which should be a metal, is behaving like a semiconductor (with a band gap of ~0.2045 eV) in the b>c>p structure?
How can it be divided into conductor/semiconductor when the structures are identical and the Total energy (though it has no physical meaning) is the same?
I tried to keep it as short as possible, but it ended up being long again.
I apologize.