Skip to main content

No project description provided

Project description

MRA FIT

Fit curves with high precision using Multi resolution analysis and Wavelet transform. The module direclty implements Orthongonal Gausslets as described in the paper, however in addition the module also have hat basis function, and also allow to construct custom Gausslets.

Installation

simply run

pip install mrafit

Use cases

Approximating curve using basis function

mrafit allows to reconstruct a curve by expressing them in terms of localized basis function. In other words a curve represented by list of points $x_i$, $y_i$ can be represented as a much smaller list of coefficients $c_i$ which reduces dimensionality of representation. Same can be done for any 3-d curve represneted by $x_i$, $y_i$, $z_i$.

Quantum chemistry and molecular structure

Quantum chemisty invovlves calcuation elecotronic staets in Atoms and molecules with large number of electron using Schrodinger's equation, which makes it particularly challenging due complexity involved in electron-electron interactions. Orthogonal wavelet transformation can drastically simplify quantum chemistry calculation by reducing complexity from O(4) to O(2) while calculating electron interaction Potential

ML and AI

Since any 2-d, 3-d curve can be reduced to 1-d representation of of coeffiecients, this can provide massive computational advantage in ML problems where parametric learning of curves is required. Instead of learnign points, one can simply apply mrafit and learn mra coefficients instead.

Examples

To use existing wavelet bases

import mrafit.wavelet_bases as wavelet_bases

From wavelet_bases, an instance of any available basis can be created, for example to use orthogonal gausslet basis, we can define

gb = wavelet_bases.GaussletBasis()

To approximate any given function defined over domain (-1, 1) with respect to a basis

X = np.linspace(-1, 1, 100)
coeffs, approx_func, error = gb.get_mra_approx(func, X)

The example below includes list of all steps to fit a synthetic function using mrafit

""" This paramter controls how preicely you want to approximate a function, smaller the value better the approximation"""
resolution = 0.5

wid = 10
N = 800
error_bound = 10e-2 * resolution

""" Use this section if you want to test gausslet with Stephen White's coefficients"""
gb = wavelet_bases.GaussletBasis(resolution=resolution, wavelet_coefficients=coeffs[int(len(coeffs)/2):])

""" Sample function to be approximated, you can change it as per your need"""
func = lambda x : np.exp(-x**2/3) * (x**2 - x + 1)

""" Finally applying the mra approximation"""
X = np.linspace(-wid, wid, N)
coeffs, approx_func, error = gb.get_mra_approx(func, X)

The image below shows the approximate function vs the actual function alt text

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

mrafit-1.1.0.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

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

mrafit-1.1.0-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file mrafit-1.1.0.tar.gz.

File metadata

  • Download URL: mrafit-1.1.0.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mrafit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 113614678c606d328722db1e4db605263069cd392b27bf20db8d157ef9f21a6d
MD5 00c3d7dca6fdea117341fe04619151ab
BLAKE2b-256 eafcf2425603e232d64e7caf6736e5fe21f469e45b7238bdbbc787feeab49af8

See more details on using hashes here.

File details

Details for the file mrafit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mrafit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mrafit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a42a6db7c0707f06d11f5f2795863cfbc7c65ad4f4274bc14b2725c5180ae755
MD5 28528c17ccfc739a00904dc16cbb2456
BLAKE2b-256 be59240b86437d4a1e3455a23111d7f9bd19d96875893af11213a4cf939e35dd

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