ValueError: Unknown atom or ion symbol

56 views
Skip to first unread message

Jingyang

unread,
Jun 16, 2020, 8:17:10 PM6/16/20
to diffpy-users
I'm trying to calculate the pdf of a polyanion structure using PDFcalculator module, and ran into a value error.

"""
from diffpy.srreal.pdfcalculator import PDFCalculator
from diffpy.structure import loadStructure

nasicon_stru = loadStructure('Na3Cr2P3O12.cif') # A standard .cif file downloaded from ICSD
pdfc = PDFCalculator(rmax=10)
r, g = pdfc(nasicon_stru)

ValueError: Unknown atom or ion symbol 'P5+'
"""
Same error occurs when I calculate the pdf of MoO2: Unknown atom or ion symbol 'Mo4+'

The error message disappear if I drop the '5+' in the element symbol. I wonder what is the requirement for the input of PDFcalculator?

Na3Cr2P3O12.cif

Monica Dapiaggi

unread,
Jun 17, 2020, 1:56:26 AM6/17/20
to diffpy...@googlegroups.com
Hello there,
Just remove the 5+ and 4+ from the atomic symbols and use the neutral ones. Best is to remove the ionic charges from everything in your structure. 

Good luck
Monica 

---
Monica Dapiaggi

Il giorno 17 giu 2020, alle ore 02:17, Jingyang <jingya...@berkeley.edu> ha scritto:


--
You received this message because you are subscribed to the Google Groups "diffpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/diffpy-users/026b4335-97fa-4d75-9c59-490e93a4799do%40googlegroups.com.
<Na3Cr2P3O12.cif>

Pavol Juhas

unread,
Jun 17, 2020, 5:59:27 AM6/17/20
to DiffPy users
Hi Jingyang,

PDFCalculator knows of atom and ion symbols defined on the "#S" lines here
https://github.com/diffpy/libdiffpy/blob/master/src/runtime/f0_WaasKirf.dat.
If some ions are missing, you can specify their scattering factors using
[See "help(pdfc.scatteringfactortable)" for a brief usage info.]

pdfc.scatteringfactortable.setCustomAs("P5+", "Ne")
or
pdfc.scatteringfactortable.setCustomAs("P5+", "P", 10)

The first form in effect treats P5+ atoms as Neons,
and the second one rescales f_P(Q) dependence to equal 10 at Q=0.
This makes no difference for PDFCalculator, because it only uses
the f(Q) value at Q=0 which is in both cases 10.  For DebyePDFCalculator,
which evaluates f_P over a Q-range, the Q-dependencies would differ giving a
slightly different results. 

Removing the "5+" charge as Monica suggested is also a way to go,
however note these 2 options produce different PDF amplitudes,
because they set scattering powers at P sites as 10 and 15.
[The best approximation might be somewhere in between
reflecting the actual electron distribution in the P-O bonds.]

Best wishes,

Pavol

Jingyang

unread,
Jun 17, 2020, 3:25:50 PM6/17/20
to diffpy-users
Thank you so much Monica and Pavol! This is really helpful ;)
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "diffpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy...@googlegroups.com.

Peter Metz

unread,
Jun 17, 2020, 5:24:12 PM6/17/20
to diffpy-users
Another thought for posterity--

The effect of using the full atomic form factor to compute pair distribution function has been discussed ( Masson & Thomas 2012 | 10.1107/S0021889812051357 ). 

If I recall correctly, the influence on the PDF is most pronounced in cases mixing light and heavy elements (Masson & Thomas' example is LaB6), and the effects are largely absorbed into the ADP parameters.

I didn't realize the Debye PDF calculator took f(Q) into account, thanks for pointing that out!

-Peter
Reply all
Reply to author
Forward
0 new messages