Skip to main content

Fitting tools for repulsive two body interactions using curvature constrained splines.

Project description

CCS - Curvature Constrained Splines

Latest Release License DOI Build

The CCS package is a tool to construct two-body potentials using the idea of curvature constrained splines.

Getting Started

Package Layout

ccs-x.y.z
├── CHANGELOG.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── bin
│   ├── ccs_build_db
│   ├── ccs_export_sktable
│   ├── ccs_fetch
│   ├── ccs_fit
│   └── ccs_validate
├── docs
├── examples
│   ├── CCS
│   ├── CCS_with_LAMMPS
│   ├── DFTB_repulsive_fitting
│   ├── Preparing_ASE_db_trainingsets
│   ├── Simple_regressor
│   ├── Twobody_fit_for_an_O2_molecule
│   ├── Twobody_fit_for_solid_Ne
│   └── ppmd_interfacing
├── logo.png
├── poetry.lock
├── pyproject.toml
├── src
│   └── ccs
│       ├── ase_calculator
│       ├── common
│       ├── data
│       ├── debugging_tools
│       ├── fitting
│       ├── ppmd_interface
│       ├── regression_tool
│       └── scripts
│           ├── ccs_build_db.py
│           ├── ccs_export_sktable.py
│           ├── ccs_fetch.py
│           ├── ccs_fit.py
│           └── ccs_validate.py
└── tests
  • ccs_fetch - Executable to construct the traning-set (structures.json) from a pre-existing ASE-database with DFT-data.
  • ccs_fit - The primary executable file for the ccs package.
  • main.py - A module to parse input files.
  • objective.py - A module which contains the objective function and solver.
  • spline_functions.py - A module for spline construction/evaluation/output.

(Recommended) installing from pip

pip install ccs_fit

Installing from source using poetry

git clone https://github.com/Teoroo-CMC/CCS_fit.git ccs_fit
cd ccs_fit

# Install python package manager poetry (see https://python-poetry.org/docs/ for more explicit installation instructions)
curl -sSL https://install.python-poetry.org | python3 -
# You might have to add poetry to your PATH
poetry --version # to see if poetry installed correctly
poetry install # to install ccs_fit

Environment Variables

Set the following environment variables:

$export PYTHONPATH=<path-to-CCS-package>:$PYTHONPATH
$export PATH=<path-to-CCS-bin>:$PATH

Within a conda virtual environment, you can update the path by using:
conda develop <path-to-CCS-package>

Tutorials

We provide tutorials in the examples folder. To run the example, go to one of the folders. Each contain the neccesery input files required for the task at hand. A sample CCS_input.json for O2 is shown below:

{
        "General": {
                "interface": "CCS"
        },
        "Train-set": "structures.json",
        "Twobody": {
                "O-O": {
                        "Rcut": 2.5,
                        "Resolution": 0.02,
                        "Swtype": "sw"
                }
        },
        "Onebody": [
                "O"
        ]
}

The CCS_input.json file should provide at a minimum the block "General" specifying an interface. The default is to look for input structures in the file structure.json file. The format for structure.json is shown below :

{
"energies":{
        "S1": {
                "Energy": -4.22425752,
                "Atoms": {
                        "O": 2
                },
                "O-O": [
                        0.96
                ]
        },
        "S2": {
                "Energy": -5.29665634,
                "Atoms": {
                        "O": 2
                },
                "O-O": [
                        0.98
                ]
        },
        "S3": {
                "Energy": -6.20910363,
                "Atoms": {
                        "O": 2
                },
                "O-O": [
                        1.0
                ]
        },
        "S4": {
                "Energy": -6.98075271,
                "Atoms": {
                        "O": 2
                },
                "O-O": [
                        1.02
                ]
        }
}
}

The structure.json file contains different configurations labeled ("S1", "S2"...) and corresponding energy, pairwise distances (contained in an array labelled as "O-O" for oxygen). The stoichiometry of each configuration is given under the atoms label ("Atoms") as a key-value pair ("O" : 2 ).

To perform the fit :

ccs_fit

The following output files are obtained:

CCS_params.json CCS_error.out ccs.log 
  • CCS_params.json - Contains the spline coefficients, and one-body terms for two body potentials.
  • error.out - Contains target energies, predicted energies and absolute error for each configuration.
  • ccs.log - Contains debug information

Authors

  • Akshay Krishna AK
  • Jolla Kullgren
  • Eddie Wadbro
  • Peter Broqvist
  • Thijs Smolders

Funding

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 957189.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details.

Acknowledgement

We thank all the members of TEOROO-group at Uppsala University, Sweden.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccs_fit-0.11.18.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccs_fit-0.11.18-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

Details for the file ccs_fit-0.11.18.tar.gz.

File metadata

  • Download URL: ccs_fit-0.11.18.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for ccs_fit-0.11.18.tar.gz
Algorithm Hash digest
SHA256 da911fbbc6d561577a4e9c561b99b9432a9dc97d535aeefd7bf498d72af1b749
MD5 b0bbfc7e0f5e5f1e075f549f7b71033c
BLAKE2b-256 2df9348b68ac39a4ff012c023006158b2416323dd7b2fb62425e05044bfdf63b

See more details on using hashes here.

File details

Details for the file ccs_fit-0.11.18-py3-none-any.whl.

File metadata

  • Download URL: ccs_fit-0.11.18-py3-none-any.whl
  • Upload date:
  • Size: 57.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for ccs_fit-0.11.18-py3-none-any.whl
Algorithm Hash digest
SHA256 6a5a3132e4eafac1869e585297d4cea199d8ceb6c6fcea4a4979385c889829d2
MD5 232677c4fc7dc4e0f7e078b23179b3de
BLAKE2b-256 13a3b8ee2ff3a2d80cc2ec15ec691220c7ad9acc0298463fcbb99080d1fb01bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page