Skip to main content

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.

Release files for physical-basis 1.0.0

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

Source distribution (sdist)

Source distribution for physical-basis 1.0.0
File Size Uploaded
physical_basis-1.0.0.tar.gz 15.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for physical-basis 1.0.0
File Interpreter ABI Platform
physical_basis-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.6 MB

Release files / physical_basis-1.0.0.tar.gz

Download URL physical_basis-1.0.0.tar.gz
Size 15.8 MB
Tags Source
SHA-256 checksum
How to use checksums
b545636efa87ef048be036b5d5c61627d2aca367fa4bb27300e93b593202fb04
BLAKE2b-256 checksum
How to use checksums
81c266c005f882c2c0f524abfd8cec48287a43c5f2f5a91df2968017519964cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / physical_basis-1.0.0-py3-none-any.whl

Download URL physical_basis-1.0.0-py3-none-any.whl
Size 15.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
adaa701a6f4d13b00b20151c0d257a71d9e342c032a11d2bba9f29d26691d90b
BLAKE2b-256 checksum
How to use checksums
4dff9198fdbae41b42dd68184b90ad5ed5939e9f077e5232249feec5d502d260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

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