pymatgen-analysis-diffusion icon indicating copy to clipboard operation
pymatgen-analysis-diffusion copied to clipboard

Inaccuracy in RDF calculation over several structures

Open vishankkumar opened this issue 5 years ago • 11 comments

Dear Developers,

I have used RadialDistributionFunction class in vanhove module of this package and found one ambiguity. Input data are 5 structures with same composition.

While passing single structure, each of them have the first RDF peak at around 2 Angstrom but when I pass all the five structures, the resulting RDF (single plot) shows a peak at 2 Angstrom along with another peak below 2 Angstrom, which to me seems ambiguous. Will you please have a look at it and let me know.

Feel free to ask me if you need the input files for testing.

Thanks for your help in advance, Regards, Vishank

vishankkumar avatar Sep 18 '19 15:09 vishankkumar

Can you send us the example structures?

shyuep avatar Sep 18 '19 16:09 shyuep

Dear Ping Ong,

Thank you for your quick response. PFA tar.gz folder containing "structure" folder having 5 different structures with same composition and "plot" folder containing their individual RDF plots and an average RDF plot by providing all the 5 structures as the structure list.

As you can see in the individual plots, the first RDF peak starts after 2 Angstrom, however in the combined plot "w24_v1_v5.png" the first peak is below 2 Angstrom.

Here is the small script I am using to compute the average RDF using the RDF class:

def test_compute_rdf(repeats=5): type1 = "Li" type2 = "Si" r_cutoff = 8.0 structure_list = [] for version in range(repeats): file_path = "/Users/vishankkumar/Documents/abimd/delithiate/li13si4/md50/flow_Li13Si4_v"
+ str(version + 1) + "_md_work/" file = os.path.join(file_path, "w24", "t1", "outdata", "out_GSR.nc") structure_list.append(Structure.from_file(file)) obj = Rdf(structure_list, indices=structure_list[0].indices_from_symbol(type1), reference_indices=structure_list[0].indices_from_symbol(type2), ngrid=101, rmax=r_cutoff, cell_range=1, sigma=0.2) plt = obj.get_rdf_plot(label="RDF", xlim=[0.0, r_cutoff])

Let me know if I am making some mistake in initializing the class or plotting the RDF's.

Thanks in advance for your response.

Best regards, Vishank


From: Shyue Ping Ong [email protected] Sent: Wednesday, September 18, 2019 18:42 To: materialsvirtuallab/pymatgen-diffusion [email protected] Cc: Vishank Kumar [email protected]; Author [email protected] Subject: Re: [materialsvirtuallab/pymatgen-diffusion] Inaccuracy in RDF calculation over several structures (#28)

Can you send us the example structures?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/materialsvirtuallab/pymatgen-diffusion/issues/28?email_source=notifications&email_token=AHVFG6RJP3IDLPNUHPVEGOTQKJK5RA5CNFSM4IYATKJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7AWHXQ#issuecomment-532767710, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHVFG6Q6KFKBX2U2LVBFY33QKJK5RANCNFSM4IYATKJQ.

vishankkumar avatar Sep 18 '19 21:09 vishankkumar

I don't see te file attached.

shyuep avatar Sep 18 '19 21:09 shyuep

Dear Ping Ong,

It is showing in my sent mail. Anyways, I will include it here one by one, instead of a tarball.

Regards, Vishank


From: Vishank Kumar [email protected] Sent: Wednesday, September 18, 2019 23:14 To: materialsvirtuallab/pymatgen-diffusion [email protected]; materialsvirtuallab/pymatgen-diffusion [email protected] Cc: Author [email protected] Subject: Re: [materialsvirtuallab/pymatgen-diffusion] Inaccuracy in RDF calculation over several structures (#28)

Dear Ping Ong,

Thank you for your quick response. PFA tar.gz folder containing "structure" folder having 5 different structures with same composition and "plot" folder containing their individual RDF plots and an average RDF plot by providing all the 5 structures as the structure list.

As you can see in the individual plots, the first RDF peak starts after 2 Angstrom, however in the combined plot "w24_v1_v5.png" the first peak is below 2 Angstrom.

Here is the small script I am using to compute the average RDF using the RDF class:

def test_compute_rdf(repeats=5): type1 = "Li" type2 = "Si" r_cutoff = 8.0 structure_list = [] for version in range(repeats): file_path = "/Users/vishankkumar/Documents/abimd/delithiate/li13si4/md50/flow_Li13Si4_v"
+ str(version + 1) + "_md_work/" file = os.path.join(file_path, "w24", "t1", "outdata", "out_GSR.nc") structure_list.append(Structure.from_file(file)) obj = Rdf(structure_list, indices=structure_list[0].indices_from_symbol(type1), reference_indices=structure_list[0].indices_from_symbol(type2), ngrid=101, rmax=r_cutoff, cell_range=1, sigma=0.2) plt = obj.get_rdf_plot(label="RDF", xlim=[0.0, r_cutoff])

Let me know if I am making some mistake in initializing the class or plotting the RDF's.

Thanks in advance for your response.

Best regards, Vishank


From: Shyue Ping Ong [email protected] Sent: Wednesday, September 18, 2019 18:42 To: materialsvirtuallab/pymatgen-diffusion [email protected] Cc: Vishank Kumar [email protected]; Author [email protected] Subject: Re: [materialsvirtuallab/pymatgen-diffusion] Inaccuracy in RDF calculation over several structures (#28)

Can you send us the example structures?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/materialsvirtuallab/pymatgen-diffusion/issues/28?email_source=notifications&email_token=AHVFG6RJP3IDLPNUHPVEGOTQKJK5RA5CNFSM4IYATKJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7AWHXQ#issuecomment-532767710, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHVFG6Q6KFKBX2U2LVBFY33QKJK5RANCNFSM4IYATKJQ.

vishankkumar avatar Sep 18 '19 21:09 vishankkumar

Here are the files. Sorry, earlier I was trying to attach by email. pymatgen_diffusion_rdf_test.tar.gz

vishankkumar avatar Sep 18 '19 21:09 vishankkumar

Thanks. @HanmeiTang Pls look into the said issue.

shyuep avatar Sep 18 '19 21:09 shyuep

@shyuep Sure!

HanmeiTang avatar Sep 18 '19 21:09 HanmeiTang

@shyuep @vishankkumar This issue should be solved.

The wrong result reported by @vishankkumar is caused by passing a list of structures with different lattices. In our original RadialDistributionFunction class, it assumes all structures are in the same lattice. Now, this bug has been fixed along with corresponding unittests.

The circleCi failed tests are coming from pymatgen_diffusion/neb/tests/test_full_path_mapper.py, which is irrelevant to this issue. @shyuep how about closing this solved issue and opening a new one to fix the failed tests, which may also need @jmmshn's assistance.

HanmeiTang avatar Sep 26 '19 22:09 HanmeiTang

ooops I mixed up some code in the last PR will fix this

jmmshn avatar Sep 26 '19 22:09 jmmshn

Thank you for solving the issue and I did not know that the lattice have to be same. I will test it and will let you know. Thanks.

vishankkumar avatar Sep 27 '19 07:09 vishankkumar

Hi, I found some features are non-exhaustive. Are they still problematic?

thienbinh92 avatar Apr 29 '22 08:04 thienbinh92