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

ProbabilityDensityAnalysis results in strange chargcar #310

Open
thienbinh92 opened this issue May 18, 2022 · 6 comments
Open

ProbabilityDensityAnalysis results in strange chargcar #310

thienbinh92 opened this issue May 18, 2022 · 6 comments

Comments

@thienbinh92
Copy link

Hello,
I get a strange result from ProbabilityDensityAnalysis. Li and transition metal layers are not arranged like POSCAR/CONTCAR. Here is the code I use:
file = ["tem-1000/out_vasprun.xml"]
analyzer = DiffusionAnalyzer.from_files(file, specie="Li", smoothed=False)
structure = analyzer.structure
trajectories = [s.frac_coords for s in analyzer.get_drift_corrected_structures()]
pda = ProbabilityDensityAnalysis(structure, trajectories, species="Li")
pda.to_chgcar("CHGCAR.vasp")
I attach vasprun file below. Hope that someone help me to check.

Screenshot 0004-05-19 at 0 24 26

[AIMD.zip](https://github.com/materialsvirtuallab/pymatgen-analysis-diffusion/files/8717660/AIMD.zip)
@JiQi535
Copy link

JiQi535 commented May 18, 2022

@thienbinh92 Can you explain more why you say "Li and transition metal layers are not arranged like POSCAR/CONTCAR"?

From my check, the CHGCAR.vasp from ProbabilityDensityAnalysis has the same atom coordinates as that of the initial structure in the AIMD snapshots you attached. I added structure.to("cif","AIMD_01.cif") to your code and compared AIMD_01.cif and CHGCAR.vasp.

@thienbinh92
Copy link
Author

thienbinh92 commented May 19, 2022

@JiQi535 Do you get "AIMD_01.cif" from vasprun.xml?
I found that the orders of elements in vasprun file (Li Co O 24 36 72) and in CHGCAR.vasp (Co Li O 36 24 72) are not the same. Here is from vasprun file:
Screenshot 0004-05-19 at 13 52 41

Here is CHGCAR.vasp generated from ProbabilityDensityAnalysis:
charge.zip

Screenshot 0004-05-19 at 13 50 08

Since the code defines incorrectly element order, may it result in wrong MSD and diffusivity?

@JiQi535
Copy link

JiQi535 commented May 19, 2022

@thienbinh92 Yes, I got the AIMD_01.cif from vasprun.xml. The structure it contains should be equivalent to the initial structure of AIMD, instead of structure in CONTCAR.

With the code you provided, I generated one CHAGCAR.vasp file that does not have the problem you described.
CHGCAR.vasp.zip

I believe what you are reporting is related to a solved issue. Please update your package with git pull and pip install ., then the issue should be solved.

@thienbinh92
Copy link
Author

@JiQi535 I am not clear on how to upgrade. So I have just uninstalled pymatgen-analysis-diffusion and re-install with the command pip install pymatgen-analysis-diffusion. It still works incorrectly.

@JiQi535
Copy link

JiQi535 commented May 19, 2022

@thienbinh92 You can update it with the below codes and try again:

pip uninstall pymatgen-analysis-diffusion
git pull https://github.com/materialsvirtuallab/pymatgen-analysis-diffusion
cd pymatgen-analysis-diffusion; pip install .

@shyuep Hi Shyue Ping, I think it may be necessary to update the release on pypi, as the bug described in issue #125 has been fixed.

@thienbinh92
Copy link
Author

@JiQi535 Thanks a lot. I downloaded and its result looks good.
PS: git pull does not work on my laptop. but git clone https://github.com/materialsvirtuallab/pymatgen-analysis-diffusion works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants