28{
   29    
   30    map<string, string> m;
   31    
   32    map<string, vector<string>> a;
   33    
   34    map<string, shared_ptr<settings::Key>> r;
   35 
   36    
   37    m["number_of_elements"                 ] = "";
   38    m["elements"                           ] = "";
   39    m["atom_energy"                        ] = "";
   40    m["cutoff_type"                        ] = "";
   41    m["symfunction_short"                  ] = "";
   42    m["scale_symmetry_functions"           ] = "";
   43    m["scale_min_short"                    ] = "";
   44    m["scale_max_short"                    ] = "";
   45    m["center_symmetry_functions"          ] = "";
   46    m["scale_symmetry_functions_sigma"     ] = "";
   47    m["global_hidden_layers_short"         ] = "";
   48    m["global_hidden_layers_electrostatic" ] = "";
   49    m["global_nodes_short"                 ] = "";
   50    m["global_nodes_electrostatic"         ] = "";
   51    m["global_activation_short"            ] = "";
   52    m["global_activation_electrostatic"    ] = "";
   53    m["element_hidden_layers_short"        ] = "";
   54    m["element_hidden_layers_electrostatic"] = "";
   55    m["element_nodes_short"                ] = "";
   56    m["element_nodes_electrostatic"        ] = "";
   57    m["element_activation_short"           ] = "";
   58    m["element_activation_electrostatic"   ] = "";
   59    m["normalize_nodes"                    ] = "";
   60    m["mean_energy"                        ] = "";
   61    m["conv_length"                        ] = "";
   62    m["conv_energy"                        ] = "";
   63    m["conv_charge"                        ] = "";
   64    m["nnp_type"                           ] = "";
   65    m["fixed_gausswidth"                   ] = "";
   66    m["ewald_truncation_error_method"      ] = "";
   67    m["kspace_solver"                      ] = "";
   68    m["ewald_prec"                         ] = "";
   69    m["screen_electrostatics"              ] = "";
   70    m["four_pi_epsilon"                    ] = "";
   71 
   72    
   73    m["random_seed"                        ] = "";
   74    m["test_fraction"                      ] = "";
   75    m["epochs"                             ] = "";
   76    m["normalize_data_set"                 ] = "";
   77    m["use_short_forces"                   ] = "";
   78    m["rmse_threshold"                     ] = "";
   79    m["rmse_threshold_energy"              ] = "";
   80    m["rmse_threshold_force"               ] = "";
   81    m["rmse_threshold_charge"              ] = "";
   82    m["rmse_threshold_trials"              ] = "";
   83    m["rmse_threshold_trials_energy"       ] = "";
   84    m["rmse_threshold_trials_force"        ] = "";
   85    m["rmse_threshold_trials_charge"       ] = "";
   86    m["energy_fraction"                    ] = "";
   87    m["force_fraction"                     ] = "";
   88    m["force_energy_ratio"                 ] = "";
   89    m["charge_fraction"                    ] = "";
   90    m["use_old_weights_short"              ] = "";
   91    m["use_old_weights_charge"             ] = "";
   92    m["weights_min"                        ] = "";
   93    m["weights_max"                        ] = "";
   94    m["initial_hardness"                   ] = "";
   95    m["nguyen_widrow_weights_short"        ] = "";
   96    m["nguyen_widrow_weights_charge"       ] = "";
   97    m["precondition_weights"               ] = "";
   98    m["main_error_metric"                  ] = "";
   99    m["write_trainpoints"                  ] = "";
  100    m["write_trainforces"                  ] = "";
  101    m["write_traincharges"                 ] = "";
  102    m["write_weights_epoch"                ] = "";
  103    m["write_neuronstats"                  ] = "";
  104    m["write_trainlog"                     ] = "";
  105    m["repeated_energy_update"             ] = "";
  106    m["updater_type"                       ] = "";
  107    m["parallel_mode"                      ] = "";
  108    m["jacobian_mode"                      ] = "";
  109    m["update_strategy"                    ] = "";
  110    m["selection_mode"                     ] = "";
  111    m["selection_mode_energy"              ] = "";
  112    m["selection_mode_force"               ] = "";
  113    m["selection_mode_charge"              ] = "";
  114    m["task_batch_size_energy"             ] = "";
  115    m["task_batch_size_force"              ] = "";
  116    m["task_batch_size_charge"             ] = "";
  117    m["gradient_type"                      ] = "";
  118    m["gradient_eta"                       ] = "";
  119    m["gradient_adam_eta"                  ] = "";
  120    m["gradient_adam_beta1"                ] = "";
  121    m["gradient_adam_beta2"                ] = "";
  122    m["gradient_adam_epsilon"              ] = "";
  123    m["kalman_type"                        ] = "";
  124    m["kalman_epsilon"                     ] = "";
  125    m["kalman_eta"                         ] = "";
  126    m["kalman_etatau"                      ] = "";
  127    m["kalman_etamax"                      ] = "";
  128    m["kalman_q0"                          ] = "";
  129    m["kalman_qtau"                        ] = "";
  130    m["kalman_qmin"                        ] = "";
  131    m["kalman_lambda_short"                ] = "";
  132    m["kalman_nue_short"                   ] = "";
  133    m["memorize_symfunc_results"           ] = "";
  134    m["force_weight"                       ] = "";
  135 
  136    
  137    a["nnp_type"             ] = {"nnp_generation", "nnp_type_gen", "nnp_gen"};
  138    a["rmse_threshold_energy"] = {"short_energy_error_threshold"};
  139    a["rmse_threshold_force" ] = {"short_force_error_threshold"};
  140    a["energy_fraction"      ] = {"short_energy_fraction"};
  141    a["force_fraction"       ] = {"short_force_fraction"};
  142    a["symfunction_short"    ] = {"symfunction"};
  143 
  144    for (auto im : m)
  145    {
  146        
  147        if (r.find(im.first) != r.end())
  148        {
  149            throw runtime_error("ERROR: Multiple definition of keyword.\n");
  150        }
  151        
  152        r[im.first] = make_shared<settings::Key>();
  153        
  154        r.at(im.first)->addAlternative(im.first);
  155        
  156        r.at(im.first)->setDescription(im.second);
  157        
  158        if (a.find(im.first) != a.end())
  159        {
  160            
  161            for (auto alt : a.at(im.first))
  162            {
  163                
  164                if (r.find(alt) != r.end())
  165                {
  166                    throw runtime_error("ERROR: Multiple definition of "
  167                                        "alternative keyword.\n");
  168                }
  169                
  170                r[alt] = r.at(im.first);
  171                
  172                r[alt]->addAlternative(alt);
  173            }
  174        }
  175    }
  176 
  177    return r;
  178}