Skip to main content

CCS_fit - Fitting using Curvature Constrained Splines

PyPI License DOI Build Documentation Python version

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

Getting Started

Package Layout

ccs_fit-x.y.z
├── CHANGELOG.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── bin
│   ├── ccs_build_db
│   ├── ccs_export_sktable
|   ├── ccs_export_FF
│   ├── ccs_fetch
│   ├── ccs_fit
│   └── ccs_validate
├── docs
├── examples
│   └── Basic_Tutorial
│       └── tutorial.ipynb
│   └── Advanced_Tutorials
│       ├── CCS
│       ├── CCS_with_LAMMPS
│       ├── DFTB_repulsive_fitting
│       ├── ppmd_interfacing
│       ├── Preparing_ASE_db_trainingsets
│       ├── Search_mode
│       └── Simple_regressor
├── 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_FF.py
│           ├── ccs_export_sktable.py
│           ├── ccs_fetch.py
│           ├── ccs_fit.py
│           └── ccs_validate.py
└── tests
  • ccs_build_db - Routine that builds an ASE-database.
  • ccs_fetch - Executable to construct the traning-set (structures.json) from a pre-existing ASE-database.
  • ccs_fit - The primary executable file for the ccs_fit package.
  • ccs_export_sktable - Export the spline in a dftbplus-compatible layout.
  • ccs_export_FF - Fit the spline to commonly employed force fields; Buckingham, Morse and Lennard Jones.
  • ccs_validate - Validation of the energies and forces of the fit compared to the training set.
  • 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.
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

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 O$_2$ 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, and the Swedish National Strategic e-Science programme eSSENCE. The project is part of BATTERY 2030+, the large-scale European research initiative for inventing the sustainable batteries of the future.

License

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

Acknowledgement

We want to thank Pavlin Mitev, Christof Köhler, Matthew Wolf, Kersti Hermansson, Bálint Aradi and Tammo van der Heide, and all the members of the TEOROO-group at Uppsala University, Sweden for fruitful discussions and general support.

Metadata

Release files for ccs-fit 0.22.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccs-fit 0.22.5
File Size Uploaded
ccs_fit-0.22.5.tar.gz 53.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ccs-fit 0.22.5
File Interpreter ABI Platform
ccs_fit-0.22.5-py3-none-any.whl Python 3 none any Details

Total release size: 125.4 kB

Release files / ccs_fit-0.22.5.tar.gz

Download URL ccs_fit-0.22.5.tar.gz
Size 53.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e2b09fc14115a817dc3cafd65d20a238326fc3bb562b51aefa9b8633ed216e83
BLAKE2b-256 checksum
How to use checksums
d8b3b3d9590e6bd8e63935480e831421e2c71f4c948be545fc282f1248c7ae51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / ccs_fit-0.22.5-py3-none-any.whl

Download URL ccs_fit-0.22.5-py3-none-any.whl
Size 72.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2818c31aa6edb05b446a0b800de5130afa408cba2f172c8d95a84c686c996c9
BLAKE2b-256 checksum
How to use checksums
2d0653146d03c16b87353d66e22d3fa70057e98b123752f5b5303a91e02bcf52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.22.5 This release

2 release files

0.22.3

2 release files

0.22.2

2 release files

0.22.1

2 release files

0.21.8

2 release files

0.21.7

2 release files

0.21.6

2 release files

0.21.5

2 release files

0.21.4

2 release files

0.21.3

2 release files

0.21.2

2 release files

0.21.1

2 release files

0.20.2

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.2

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.18.4

2 release files

0.18.3

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.17.1

2 release files

0.14.9

2 release files

0.14.8

2 release files

0.14.7

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page