59 using PlanewaveProvenanceRecord::PlanewaveProvenanceRecord;
64 method[
"pseudopotentials"] = pseudopotentials_json();
76 [[nodiscard]] nlohmann::json pseudopotentials_json()
const {
77 nlohmann::json pseudopotentials = nlohmann::json::array();
81 bool set_is_loaded =
false;
85 }
catch (
const std::exception& error) {
87 "Provenance: cannot re-read pseudopotentials ({}); recording file identity only.",
91 for (std::size_t species_index = 0; species_index <
input().
species.size();
93 const AtomSpecies& one_species =
input().
species[species_index];
94 nlohmann::json identity = species_identity_json(one_species);
96 if (set_is_loaded && species_index <
static_cast<std::size_t
>(loaded_set.
size())) {
97 const Pseudopotential& pseudopotential =
98 loaded_set[
static_cast<int>(species_index)];
100 identity[
"valence_electron_count"] = pseudopotential.valence_charge;
103 pseudopotentials.push_back(identity);
105 return pseudopotentials;
109 [[nodiscard]] nlohmann::json species_identity_json(
const AtomSpecies& one_species)
const {
110 nlohmann::json identity;
111 identity[
"element_symbol"] = one_species.symbol;
112 identity[
"content_sha256"] =
"";
134 identity[
"source_filename"] =
135 std::filesystem::path(one_species.pseudopotential_file).filename().string();
138 one_species.pseudopotential_file,
input().pseudopotential_directory);
140 }
catch (
const std::exception& error) {
141 log::warn(
"Provenance: cannot identify the dataset for species '{}' ({}); "
142 "recording an empty digest.",