Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
soap-plus-plus
Commits
556d4e7c
Commit
556d4e7c
authored
Sep 19, 2016
by
Carl Poelking
Browse files
Structure density customization.
parent
af6d7114
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/soap/soapy/elements.py
View file @
556d4e7c
...
...
@@ -16,17 +16,17 @@ class PeriodicTable(object):
]
# Allen scale
element_names
=
[
"?"
,
"H
"
,
"He
"
,
"Li
"
,
"Be
"
,
"B
"
,
"C
"
,
"N
"
,
"O
"
,
"F
"
,
"Ne
"
,
"Na
"
,
"Mg
"
,
"Al
"
,
"Si
"
,
"P
"
,
"S
"
,
"Cl
"
,
"Ar
"
,
"K
"
,
"Ca
"
,
"Sc
"
,
"Ti
"
,
"V
"
,
"Cr
"
,
"Mn
"
,
"Fe
"
,
"Co
"
,
"Ni
"
,
"Cu
"
,
"Zn
"
,
"Ga
"
,
"Ge
"
,
"As
"
,
"Se
"
,
"Br
"
,
"Kr
"
,
"Rb
"
,
"Sr
"
,
"Y
"
,
"Zr
"
,
"Nb
"
,
"Mo
"
,
"Tc
"
,
"Ru
"
,
"Rh
"
,
"Pd
"
,
"Ag
"
,
"Cd
"
,
"In
"
,
"Sn
"
,
"Sb
"
,
"Te
"
,
"I
"
,
"Xe
"
,
"Cs
"
,
"Ba
"
,
"La
"
,
"Ce
"
,
"Pr
"
,
"Nd
"
,
"Pm
"
,
"Sm
"
,
"Eu
"
,
"Gd
"
,
"Tb
"
,
"Dy
"
,
"Ho
"
,
"Er
"
,
"Tm
"
,
"Yb
"
,
"Lu
"
,
"Hf
"
,
"Ta
"
,
"W
"
,
"Re
"
,
"Os
"
,
"Ir
"
,
"Pt
"
,
"Au
"
,
"Hg
"
,
"Tl
"
,
"Pb
"
,
"Bi
"
,
"Po
"
,
"At
"
,
"Rn
"
,
"Fr
"
,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Db"
,
"Sg"
,
"Bh"
,
"Hs"
,
"Mt"
,
"Ds"
,
"Rg"
,
"Uub"
,
"Uut"
,
"Uuq"
,
"Uup"
,
"Uuh"
]
element_mass
=
[
-
1.
,
1.00794
,
4.00260
,
6.941
,
9.012187
,
10.811
,
12.0107
,
14.00674
,
15.9994
,
18.99840
,
20.1797
,
22.98977
,
...
...
src/soap/soapy/lagraph.py
View file @
556d4e7c
...
...
@@ -581,6 +581,30 @@ class ParticleGraph(object):
elif
descriptor_type
==
'soap'
:
# Structure
structure
=
soap
.
tools
.
setup_structure_ase
(
self
.
label
,
atoms
)
# Customize density
density_type
=
options
[
"atomic_density"
][
"density_type"
]
use_covrad
=
options
[
"atomic_density"
][
"use_covrad"
]
atom_rad_scale
=
float
(
options
[
"atomic_density"
][
"atomic_radius"
])
# ... Particle radii
if
use_covrad
:
radius_map
=
soap
.
soapy
.
elements
.
periodic_table
.
getPropertyDict
(
"covrad"
,
convert
=
lambda
x
:
x
*
atom_rad_scale
)
else
:
radius_map
=
{}
for
elem
in
soap
.
soapy
.
elements
.
PeriodicTable
.
element_names
:
radius_map
[
elem
]
=
atom_rad_scale
# ... Particle 'charge'
if
density_type
==
"elneg_density"
:
charge_map
=
soap
.
soapy
.
elements
.
periodic_table
.
getPropertyDict
(
"elneg"
)
elif
density_type
==
"z_density"
:
charge_map
=
soap
.
soapy
.
elements
.
periodic_table
.
getPropertyDict
(
"z"
)
elif
density_type
==
"number_density"
:
charge_map
=
{}
for
elem
in
soap
.
soapy
.
elements
.
PeriodicTable
.
element_names
:
charge_map
[
elem
]
=
1.
else
:
raise
NotImplementedError
(
"Density type '%s'"
%
density_type
)
# ... Apply
soap
.
tools
.
setup_structure_density
(
structure
,
radius_map
=
radius_map
,
charge_map
=
charge_map
)
# Options
options_soap
=
soap
.
Options
()
for
item
in
options_descriptor
.
items
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment