50#include <nlohmann/json.hpp>
60 if (number_of_spin_components == 4) {
61 return "non_collinear";
63 if (number_of_spin_components == 2) {
75 [[nodiscard]] nlohmann::json
to_json()
const {
76 nlohmann::json provenance;
77 provenance[
"generator"] = generator_json();
78 provenance[
"model"] = model_json();
79 provenance[
"method"] = method_json();
80 provenance[
"precision"] = precision_json();
82 provenance[
"relaxation"] = {
106 [[nodiscard]] nlohmann::json generator_json()
const {
107 nlohmann::json generator;
108 generator[
"engine_name"] =
"q3";
109 generator[
"engine_version"] =
version;
110 generator[
"engine_commit"] =
commit;
117 nlohmann::json addons = nlohmann::json::array();
119 addons.push_back({{
"name", addon.name}, {
"version", addon.version}});
120 generator[
"addons"] = addons;
124 [[nodiscard]] nlohmann::json model_json()
const {
125 nlohmann::json model;
132 nlohmann::json hubbard_by_species = nlohmann::json::object();
133 for (
const HubbardSpecification& specification : input_.hubbard) {
134 hubbard_by_species[specification.species_symbol +
"-" +
135 specification.orbital_label] = specification.u_rydberg;
137 model[
"hubbard_u_rydberg_by_species"] = hubbard_by_species;
142 [[nodiscard]] nlohmann::json method_json()
const {
143 nlohmann::json method;
147 method[
"kpoint_shift"] = {
149 const bool uses_smearing = (input_.
smearing !=
"none");
150 method[
"electronic_occupation"] = uses_smearing ?
"smearing" :
"fixed";
152 method[
"smearing_kind"] = input_.
smearing;
159 [[nodiscard]] nlohmann::json precision_json()
const {
160 nlohmann::json precision;
166 const InputData& input_;
nlohmann::json to_json() const
The provenance block, grouped the way the consumer's record is.
virtual ~QuantumSystemProvenanceRecord()=default
QuantumSystemProvenanceRecord(const InputData &input)
virtual void add_representation_method_details(nlohmann::json &) const
const InputData & input() const
The input the calculation consumed, for a subclass to report on in turn.
const std::vector< AddonIdentity > & active_addons()
The add-ons compiled into this build, in the order the build discovered them.
constexpr const char * commit
constexpr const char * version
constexpr const char * linear_algebra_libraries
The BLAS/LAPACK libraries this build links, as CMake found them; empty if unknown.
std::string spin_treatment_name(int number_of_spin_components)
Map the number of spin components to the consumer schema's spin treatment.
One add-on compiled into this build.