<commit_before>#ifndef MJOLNIR_READ_POTENTIAL
#define MJOLNIR_READ_POTENTIAL
#include <extlib/toml/toml.hpp>
#include <mjolnir/potential/local/HarmonicPotential.hpp>
#include <mjolnir/potential/local/Go1012ContactPotential.hpp>
#include <mjolnir/potential/local/ClementiDihedralPotential.hpp>
#include <mjolnir/potential/local/GaussianPotential.hpp>
#include <mjolnir/potential/local/AngularGaussianPotential.hpp>
#include <mjolnir/potential/local/FlexibleLocalAnglePotential.hpp>
#include <mjolnir/potential/local/FlexibleLocalDihedralPotential.hpp>
#include <mjolnir/potential/local/SumLocalPotential.hpp>
#include <mjolnir/potential/global/ExcludedVolumePotential.hpp>
#include <mjolnir/potential/global/LennardJonesPotential.hpp>
#include <mjolnir/potential/global/UniformLennardJonesPotential.hpp>
#include <mjolnir/potential/global/DebyeHuckelPotential.hpp>
#include <mjolnir/potential/external/ImplicitMembranePotential.hpp>
#include <mjolnir/potential/external/LennardJonesWallPotential.hpp>
#include <mjolnir/potential/external/ExcludedVolumeWallPotential.hpp>
#include <mjolnir/core/Topology.hpp>
#include <mjolnir/util/get_toml_value.hpp>
#include <mjolnir/util/make_unique.hpp>
#include <mjolnir/util/logger.hpp>

namespace mjolnir
{

// this reads...
// parameters = [
// {indices = [1, 2], k = 10.0, v0 = 1.0} <- a portion of this table, k and v0.
// ]
template<typename realT>
HarmonicPotential<realT> read_harmonic_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location = "element of [[parameters]] in harmonic potential";

    const auto k  = get_toml_value<real_type>(param, "k",  location);
    const auto v0 = get_toml_value<real_type>(param, "v0", location);

    MJOLNIR_LOG_INFO("HarmonicPotential = {v0 = ", v0, ", k = ", k, '}');
    return HarmonicPotential<realT>(k, v0);
}

template<typename realT>
Go1012ContactPotential<realT>
read_go1012_contact_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location = "element of [[parameters]] in Go-10-12 potential";

    const auto k  = get_toml_value<real_type>(param, "k",  location);
    const auto v0 = get_toml_value<real_type>(param, "v0", location);

    MJOLNIR_LOG_INFO("GoContactPotential = {v0 = ", v0, ", k = ", k, '}');
    return Go1012ContactPotential<realT>(k, v0);
}

template<typename realT>
GaussianPotential<realT> read_gaussian_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location = "element of [[parameters]] in Gaussian potential";

    const auto v0    = get_toml_value<real_type>(param, "v0",    location);
    const auto k     = get_toml_value<real_type>(param, "k",     location);
    const auto sigma = get_toml_value<real_type>(param, "sigma", location);

    MJOLNIR_LOG_INFO("GaussianPotential = {v0 = ", v0, ", k = ", k,
                     ", sigma = ", sigma, '}');
    return GaussianPotential<realT>(k, sigma, v0);
}

template<typename realT>
AngularGaussianPotential<realT>
read_angular_gaussian_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location =
        "element of [[parameters]] in Angular Gaussian potential";

    const auto v0    = get_toml_value<real_type>(param, "v0",    location);
    const auto k     = get_toml_value<real_type>(param, "k",     location);
    const auto sigma = get_toml_value<real_type>(param, "sigma", location);

    MJOLNIR_LOG_INFO("AngularGaussianPotential = {v0 = ", v0, ", k = ", k,<commit_msg>add using sigma character (U+03C3) in gaussian potential<commit_after>#ifndef MJOLNIR_READ_POTENTIAL
#define MJOLNIR_READ_POTENTIAL
#include <extlib/toml/toml.hpp>
#include <mjolnir/potential/local/HarmonicPotential.hpp>
#include <mjolnir/potential/local/Go1012ContactPotential.hpp>
#include <mjolnir/potential/local/ClementiDihedralPotential.hpp>
#include <mjolnir/potential/local/GaussianPotential.hpp>
#include <mjolnir/potential/local/AngularGaussianPotential.hpp>
#include <mjolnir/potential/local/FlexibleLocalAnglePotential.hpp>
#include <mjolnir/potential/local/FlexibleLocalDihedralPotential.hpp>
#include <mjolnir/potential/local/SumLocalPotential.hpp>
#include <mjolnir/potential/global/ExcludedVolumePotential.hpp>
#include <mjolnir/potential/global/LennardJonesPotential.hpp>
#include <mjolnir/potential/global/UniformLennardJonesPotential.hpp>
#include <mjolnir/potential/global/DebyeHuckelPotential.hpp>
#include <mjolnir/potential/external/ImplicitMembranePotential.hpp>
#include <mjolnir/potential/external/LennardJonesWallPotential.hpp>
#include <mjolnir/potential/external/ExcludedVolumeWallPotential.hpp>
#include <mjolnir/core/Topology.hpp>
#include <mjolnir/util/get_toml_value.hpp>
#include <mjolnir/util/string.hpp>
#include <mjolnir/util/make_unique.hpp>
#include <mjolnir/util/logger.hpp>

namespace mjolnir
{

// this reads...
// parameters = [
// {indices = [1, 2], k = 10.0, v0 = 1.0} <- a portion of this table, k and v0.
// ]
template<typename realT>
HarmonicPotential<realT> read_harmonic_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location = "element of [[parameters]] in harmonic potential";

    const auto k  = get_toml_value<real_type>(param, "k",  location);
    const auto v0 = get_toml_value<real_type>(param, "v0", location);

    MJOLNIR_LOG_INFO("HarmonicPotential = {v0 = ", v0, ", k = ", k, '}');
    return HarmonicPotential<realT>(k, v0);
}

template<typename realT>
Go1012ContactPotential<realT>
read_go1012_contact_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location = "element of [[parameters]] in Go-10-12 potential";

    const auto k  = get_toml_value<real_type>(param, "k",  location);
    const auto v0 = get_toml_value<real_type>(param, "v0", location);

    MJOLNIR_LOG_INFO("GoContactPotential = {v0 = ", v0, ", k = ", k, '}');
    return Go1012ContactPotential<realT>(k, v0);
}

template<typename realT>
GaussianPotential<realT> read_gaussian_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location = "element of [[parameters]] in Gaussian potential";

    const auto v0    = get_toml_value<real_type>(param, "v0",    location);
    const auto k     = get_toml_value<real_type>(param, "k",     location);
    const auto sigma =
        get_toml_value<real_type>(param, {"sigma"_str, u8"σ"_str}, location);

    MJOLNIR_LOG_INFO("GaussianPotential = {v0 = ", v0, ", k = ", k,
                     ", sigma = ", sigma, '}');
    return GaussianPotential<realT>(k, sigma, v0);
}

template<typename realT>
AngularGaussianPotential<realT>
read_angular_gaussian_potential(const toml::Table& param)
{
    MJOLNIR_GET_DEFAULT_LOGGER();
    using real_type = realT;
    const auto location =
        "element of [[parameters]] in Angular Gaussian potential";

    const auto v0    = get_toml_value<real_type>(param, "v0",    location);
    const auto k     = get_toml_value<real_type>(param, "k",     location);
    const auto sigma =
        get_toml_value<real_type>(param, {"sigma"_str, u8"σ"_str}, location);

    MJOLNIR_LOG_INFO("AngularGaussianPotential = {v0 = ", v0, ", k = ", k,
{'fraction_non_alphanumeric': 0.128354567633505, 'fraction_numerical': 0.013689346706424506, 'mean_word_length': 5.185247275775356, 'pattern_counts': {'":': 0, '<': 88, '<?xml version=': 0, '>': 86, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '104519', 'n_tokens_mistral': 2833, 'n_tokens_neox': 2574, 'n_words': 476}