Skip to main content

Physics-inspired basis functions for machine learning on atomic-scale systems.

Project description

Physical basis

This is the "physical basis", a set of radial basis functions specifically designed for atomistic machine learning models. You can find the theory behind these basis functions here:

Installation

You can install the package with pip install physical-basis.

Usage

The package contains two classes: one for use in NumPy and one for use in Torch.

NumPy

The NumPy class can be used as follows:

import numpy as np
from physical_basis import PhysicalBasis

physical_basis = PhysicalBasis()
x = np.array([0.1, 0.2, 0.3])
n = 2
l = 1
result = physical_basis.compute(n, l, x)
derivatives = physical_basis.compute_derivative(n, l, x)
eigenvalue = physical_basis.return_eigenvalue(n, l)

Torch

The Torch class inherits from torch.nn.Module, and it can be used as follows:

import torch
from physical_basis.torch import PhysicalBasis

physical_basis = PhysicalBasis()
x = torch.tensor([0.1, 0.2, 0.3])
n = 2
l = 1
result = physical_basis(n, l, x)
eigenvalue = physical_basis.return_eigenvalue(n, l)

Especially if you plan to use autograd, splining the functions is recommended for speed, as the computational graph generated by calls to this class can be large.

Solving the physical basis eigenvalue equation

The physical basis is generated from an eigenvalue equation that is solved numerically. This procedure finds coefficients that are then used to calculate the physical basis from a basis of trigonometric functions. Scripts to solve the eigenvalue equation, as well as instructions, are available in generate_coefficients.

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

physical_basis-1.0.0.tar.gz (15.8 MB view details)

Uploaded Source

Built Distribution

physical_basis-1.0.0-py3-none-any.whl (15.8 MB view details)

Uploaded Python 3

File details

Details for the file physical_basis-1.0.0.tar.gz.

File metadata

  • Download URL: physical_basis-1.0.0.tar.gz
  • Upload date:
  • Size: 15.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for physical_basis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b545636efa87ef048be036b5d5c61627d2aca367fa4bb27300e93b593202fb04
MD5 80a4d44dc78a869e863c7e1afdff374d
BLAKE2b-256 81c266c005f882c2c0f524abfd8cec48287a43c5f2f5a91df2968017519964cd

See more details on using hashes here.

File details

Details for the file physical_basis-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for physical_basis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 adaa701a6f4d13b00b20151c0d257a71d9e342c032a11d2bba9f29d26691d90b
MD5 013124cd738e4130b217b85e937f19ff
BLAKE2b-256 4dff9198fdbae41b42dd68184b90ad5ed5939e9f077e5232249feec5d502d260

See more details on using hashes here.

Supported by

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