Skip to main content

A library for working with Multivariate Taylor Functions.

Project description

mtflib: Multivariate Taylor Function Library

Documentation Status License: MIT

A Python library for creating, manipulating, and composing Multivariate Taylor Functions (MTF/mtf), with a C++ backend for performance-critical applications.

Installation

The recommended way to install mtflib is from PyPI:

pip install mtflib

Installation from Source

Alternatively, you can install mtflib directly from the source repository using pip. Ensure you have a C++17 compliant compiler (e.g., GCC, Clang, MSVC) for building the backend extensions.

pip install .

Quick Start

Here's a simple example to get you started with mtflib:

import numpy as np
from mtflib import mtf
from IPython.display import display

# 1. Initialize global settings (must be done once)
# This sets the max order of the Taylor series and the number of variables.
mtf.initialize_mtf(max_order=5, max_dimension=2)

# 2. Define symbolic variables
# var(1) corresponds to x, var(2) to y
x = mtf.var(1)
y = mtf.var(2)

# 3. Create a Taylor series expression
# This creates a Taylor series for sin(x) + y^2
f = mtf.sin(x) + y**2

# 4. Evaluate the result at a point
# Let's evaluate f at (x=0.5, y=2.0)
eval_point = np.array([0.5, 2.0])
result = f.eval(eval_point)

print(f"\nf(x, y) = sin(x) + y^2")
print(f"Result of f(0.5, 2.0): {result[0]}")

# For comparison, the exact value is sin(0.5) + 2.0^2
exact_value = np.sin(0.5) + 4.0
print(f"Exact value: {exact_value}")

# You can also view the Taylor series coefficients
print("\nTaylor Series Representation:")
print(f)

print("Symbolic representation of the function:")
display(f.symprint())  # This will print the series in a human-readable format

output:

Initializing MTF globals with: _MAX_ORDER=5, _MAX_DIMENSION=2
Loading/Precomputing Taylor coefficients up to order 5
Global precomputed coefficients loading/generation complete.
Size of precomputed_coefficients dictionary in memory: 464 bytes, 0.45 KB, 0.00 MB
MTF globals initialized: _MAX_ORDER=5, _MAX_DIMENSION=2, _INITIALIZED=True
Max coefficient count (order=5, nvars=2): 21
Precomputed coefficients loaded and ready for use.

f(x, y) = sin(x) + y^2
Result of f(0.5, 2.0): 4.479427083333333
Exact value: 4.479425538604203

Taylor Series Representation:
          Coefficient  Order Exponents
0  1.000000000000e+00      1    (1, 0)
1  1.000000000000e+00      2    (0, 2)
2 -1.666666666667e-01      3    (3, 0)
3  8.333333333333e-03      5    (5, 0)

Symbolic representation of the function:

$\displaystyle 0.00833333 x^{5} - 0.166667 x^{3} + 1.0 x + 1.0 y^{2}$

Running Tests

The project uses pytest for testing. First, install the test dependencies:

pip install -e .[test]

Then, run the test suite from the root of the repository:

pytest

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mtflib-1.5.1-cp312-cp312-win_amd64.whl (236.4 kB view details)

Uploaded CPython 3.12Windows x86-64

mtflib-1.5.1-cp312-cp312-musllinux_1_2_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

mtflib-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mtflib-1.5.1-cp311-cp311-win_amd64.whl (233.7 kB view details)

Uploaded CPython 3.11Windows x86-64

mtflib-1.5.1-cp311-cp311-musllinux_1_2_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

mtflib-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mtflib-1.5.1-cp310-cp310-win_amd64.whl (232.0 kB view details)

Uploaded CPython 3.10Windows x86-64

mtflib-1.5.1-cp310-cp310-musllinux_1_2_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

mtflib-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mtflib-1.5.1-cp39-cp39-win_amd64.whl (234.2 kB view details)

Uploaded CPython 3.9Windows x86-64

mtflib-1.5.1-cp39-cp39-musllinux_1_2_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

mtflib-1.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

mtflib-1.5.1-cp38-cp38-win_amd64.whl (231.3 kB view details)

Uploaded CPython 3.8Windows x86-64

mtflib-1.5.1-cp38-cp38-musllinux_1_2_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ x86-64

mtflib-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file mtflib-1.5.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 236.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mtflib-1.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2d36a7452060e97099806c5cc827a91721c0daf52e27adcefe0683cfc0519a6c
MD5 63204c260ecf1072da124eb24f0167d3
BLAKE2b-256 7898100d2fd63a72815db2bfcb19af8108c297a6dfcad82bcb5412fbebce824a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp312-cp312-win_amd64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c34dc49aaa5269307a710d1ec6b21d4aa361fdf66051811dff501e7c2a2ef16c
MD5 8405154bf98ed6bed19f8e5746057b34
BLAKE2b-256 e135ac0add7e3a35c5de9cd9feb8a79afa88cd8a463aea8993dd49eaf81a735a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 570f12f591ad0a73a76608b70ec883f5fe003d57e1f9db8e70a448903205fd4e
MD5 5bccf7640a28b534455ac2ac1b524723
BLAKE2b-256 91616cb9d1646fc5ffb208b983b2f99ba5b4fed24217db071f5507b28ece7efc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 233.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mtflib-1.5.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6c6670ef3c2aa7232de1b4c27828d5f789a1e8c4abbc80a37e70b6413b3b8e35
MD5 ae291a9cbcf33868e71836253f646520
BLAKE2b-256 3449df589c1b8a0ba31728c844e7814b38de8c1f6523134dfeb2e1322c992636

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp311-cp311-win_amd64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d42b0cca62086c6b80568e4469795f21ac838919b04ea1f125de79bf5624e163
MD5 3d062468acd849816f48e8fb719835db
BLAKE2b-256 ce71883c84376fdcfaa86e689c1433fd3472cf53becce1e282f33598c1e56d8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e527b6dce35ca751ad364973954200bb5f3a59a94fd2b84ed62743d917b66572
MD5 3b0acedad4849dcd4b8357e584e3c921
BLAKE2b-256 382ae6c08d6523a22167bc3b0fb60a6ecdbc74165540fe6e1340b0edc9c1f011

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 232.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mtflib-1.5.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1a280536254da340a6ce6974c4adee924c7894b61102df5defbf4cb48cd0f272
MD5 72b40139918e825d2521b960a4dc68c5
BLAKE2b-256 99254d0e2b9d5da723b24dd7b8125f48a9617d319299e4c5b001b8b2428f1420

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp310-cp310-win_amd64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 132454288bb81482a48ab4b780d13e34d59b7a92a7c46a5c18fe1a9b8a93cfe8
MD5 a19cb1c535c65a4248080ae4b83a62ca
BLAKE2b-256 012500792c31252c523a78431f752b9ccdf54cd1367008125a3c3377363b70f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75b380d4b8366fee923ac6113aa1b11860107c32e50a31b19da8c532100faa42
MD5 348e34e3a426b950bde1fa6af2a6318b
BLAKE2b-256 1c2ed29b0172ee7e8e644d08d3a4ba13110c99036e81ce6caa531290dbdf4a4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 234.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mtflib-1.5.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a327cca11f68591e4d9752059b19a2796510eb546490fdf86f63b3cacc7e77e5
MD5 45dee0d24112e6da620d308a04361d2a
BLAKE2b-256 814d1f66f655322fc66999727f475726aaf0b24c58b858baa333ef0302ac33f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp39-cp39-win_amd64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 41effd1349bf0b9b9e36c84c9752b96ca15d1145b3135e8d90450831ab458dcf
MD5 f6c0ec0b3009f13639debf0c94160529
BLAKE2b-256 de7f500699d75d3d3072ce5f60a97e5c9a568625ffc2a6810f43aa01b3a26a0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp39-cp39-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2db6e9abaa3da3d8d24b6b376a57a4c3d9630ce15ad570a4704f5cbafd321ebb
MD5 4de72b16f7c008b58acb22cdb6e323ab
BLAKE2b-256 34450f5b61b7c3bfdefdc51df3475b17fec8d1f07a2bab177c61de75aba70d19

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 231.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mtflib-1.5.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6e4a953c4b0f1d81609a891651de5182beccfbf81ddc892b7db4cec9f4370d26
MD5 870aee0cba06e1085a475f6f1d002192
BLAKE2b-256 b6b1fbee250ac69d029590249f9d0c412a98b5f1f126cbab1a1e600ade16d26a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp38-cp38-win_amd64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp38-cp38-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ea5df62ddad0ff4c7a4eb642cfe45d20e29dfd90953e32313eb6d0c918cf3e1c
MD5 d7553e099769c256b3556bcf125c0b57
BLAKE2b-256 add4cde3053943a1c486d20254af97eaecb141e5a9f28205756555b44ddd009e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp38-cp38-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mtflib-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8429c2d7448bf8fe059219c23141c3fda77122d4135274aaf0889871b4dbd946
MD5 2649a74b36184f7e13332c8b26bd371e
BLAKE2b-256 42e685e961aa43e3636c58578c08c731fbef58f84b7a4f1a150a3bd4a6e758bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on shashi-manikonda/MTFLibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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