INFO
Material classification according to known structure types (prototypes).
The program called classify4me_prototypes.py
reads the calculation data and classifies their structures by prototypes
on the basis of the space_group and normalized_wyckoff, and adds labels to the calculations.
Delivered metadata is called prototype_label
(as defined in public.nomad-metainfo.json
) and is defined by space group number and occupation of normalized wyckoff positions.
For crystal structure classification based on prototypes a functions get_normalized_wyckoff
and get_structure_type
are defined in https://gitlab.mpcdf.mpg.de/nomad-lab/normalizer-prototypes/blob/master/normalizer/normalizer-prototypes/classify4me_prototypes.py
. The later function take as argument space group and normalized wyckoff positions and returns the information on the prototype.
Detailed information on Wyckoff position normaization is located here: https://gitlab.mpcdf.mpg.de/nomad-lab/normalizer-prototypes/wikis/info-on-normalization-of-wyckoff-positions
Classification "algorithm":
We start from atom labels, positions and simulation cell.
Than SPGLIB is used to calculate the symmetry of a given system,
we get wyckoffs and space group number.
We get the normalized wyckoff (get_norm_wyckoff
), compare it with the one in the prototypes in the field normalized_wyckoff_spg which were calculated in the same way.
If we find a matching structure type (get_structure_type
), it returns the information on the prototype.
Other applications:
- in Encyclopedia in the structure box, as in this example:
more info you can find here: https://gitlab.mpcdf.mpg.de/nomad-lab/encyclopedia-general/wikis/general-info-on-classification
- in beaker notebook that allows one to perform prototype classification for a given structure from the NOMAD Archive and find most matching structures using SOAP (Smooth Overlap of Atomic Positions). There one can set own parameters like spglib precission or similarity threshold etc.
Testing
For testing the normalized prototypes classification one shall run classify4me_prototypes.py
code and give as an argument the structure taken from api/resolve:
or
The program classifies the material on the basis of prototypes (stored in structure_types.py
that can be imported from nomadcore in python-common). The outputs of the code for two example cases are presented below:
command:
python classify4me_prototypes.py < example.inp
example 1:
INPUT:
{
"type": "nomad_section_2_0",
"name": "section_system",
"gIndex": 0,
"uri": "nmd://NcC8TDWGWCtQLhWeB2a1N8y9Q7y4r/CDr1v3DHDKNRb1PB79i5Mf4LPEqIx/section_run/0c/section_system/0c",
"atom_labels": {"flatData":["Cl","Cl"],"shape":[2]},
"atom_positions": {"flatData":[0.0,0.0,0.0,1.82678709E-10,1.0546960410939205E-10,1.96114275E-10],"shape":[2,3]},
"atom_species": [17,17],
"configuration_periodic_dimensions": [{"flatData":[true,true,true],"shape":[3]}],
"configuration_raw_gid": "szLBA5_1qtdZt3a2l9FmX22hj1sAI",
"simulation_cell": {"flatData":[1.82678709E-10,-3.1640880600000004E-10,0.0,1.82678709E-10,3.1640880600000004E-10,-0.0,0.0,0.0,3.9222855E-10],"shape":[3,3]},
"system_composition": "Cl2",
"system_configuration_consistent": true,
"system_reweighted_composition": "Cl100"
}
OUTPUT:
{
"type": "nomad_parse_events_1_0",
"mainFileUri": "blabla",
"parserInfo": {
"name":"PrototypesNormalizer",
"version":"1.0"
},
"events": [{
"event":"openContext",
"nomadUri":"nmd://NcC8TDWGWCtQLhWeB2a1N8y9Q7y4r/CDr1v3DHDKNRb1PB79i5Mf4LPEqIx/section_run/0c/section_system/0c"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"prototype_label",
"value":"194-Mg-hP2"
}, {
"event":"closeContext",
"nomadUri":"nmd://NcC8TDWGWCtQLhWeB2a1N8y9Q7y4r/CDr1v3DHDKNRb1PB79i5Mf4LPEqIx/section_run/0c/section_system/0c"
}],
"parserStatus": "ParseSuccess"
example 2:
INPUT:
{
"type": "nomad_section_2_0",
"name": "section_system",
"gIndex": 0,
"uri": "nmd://NcC8TDWGWCtQLhWeB2a1N8y9Q7y4r/Cx_ur73_FOgMaVin27w-dT6nh3dvN/section_run/0c/section_system/0c",
"atom_labels": [{"flatData":["In"],"shape":[1]}],
"atom_positions": [{"flatData":[0.0,0.0,0.0],"shape":[1,3]}],
"configuration_periodic_dimensions": [{"flatData":[true,true,true],"shape":[3]}],
"simulation_cell": {"flatData":[-1.83172656E-10,1.83172656E-10,1.83172656E-10,1.83172656E-10,-1.83172656E-10,1.83172656E-10,1.83172656E-10,1.83172656E-10,-1.83172656E-10],"shape":[3,3]}
}
OUTPUT:
{
"event":"openContext",
"nomadUri":"nmd://NcC8TDWGWCtQLhWeB2a1N8y9Q7y4r/Cx_ur73_FOgMaVin27w-dT6nh3dvN/section_run/0c/section_system/0c"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"prototype_label",
"value":"229-W-cI2"
}, {
"event":"closeContext",
"nomadUri":"nmd://NcC8TDWGWCtQLhWeB2a1N8y9Q7y4r/Cx_ur73_FOgMaVin27w-dT6nh3dvN/section_run/0c/section_system/0c"
}
Done normalization steps:
-
added submodule to nomad-lab-base called normalizer-prototypes in normalizers/prototypes
-
git submodule add git@gitlab.mpcdf.mpg.de:nomad-lab/normalizer-prototypes.git prototypes
-
edited and added .gitmodules
-
added
setup-paths.py
in../prototypes/normalizer/normalizer-prototypes/setup_paths.py
SCALA PART
- added and adapted
PrototypesNormalizer.scala
in/nomad-lab-base/normalizers/prototypes/src/main/scala/eu/nomad_lab/normalizers
added cmd
cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/normalizers/protot\ ypes/normalizer/normalizer-prototypes/classify4me_prototypes.py",
and defined function outputSysSection that writes out to json secSystem
-
added
PrototypesNormalizerSpec.scala
in/nomad-lab-base/normalizers/prototypes/src/test/scala/eu/nomad_lab/normalizers
and included:object PrototypesNormalizerSpec extends Specification
-
included normalizer-prototypes in
AllNormalizers.scala
-
modified
build.sbt
lazy val prototypesNormalizer = (project in file("normalizers/prototypes")).
+ dependsOn(core).
+ enablePlugins(BuildInfoPlugin).
+ settings(gitVersionSettings: _*).
+ settings(commonSettings: _*).
+ settings(
+ name := "prototypes",
+ (unmanagedResourceDirectories in Compile) += baseDirectory.value / "normalizer"
+ ).
+ settings(Revolver.settings: _*)
and added also in
lazy val normalize = (project in file("normalize")).
dependsOn(stats).
dependsOn(fhiAimsBasis).
dependsOn(springer).
+ dependsOn(prototypesNormalizer).
enablePlugins(BuildInfoPlugin).
settings(gitVersionSettings: _*).
settings(commonSettings: _*).