Skip to main content

A library for working with Multivariate Taylor Functions.

Project description

mtflib: Multivariate Taylor Function Library

[!IMPORTANT] Version 1.5.0 is a major release with significant improvements and breaking changes. It is NOT backward compatible with previous versions. Please see the CHANGELOG.md for more details.

Documentation Status License: MIT

A Python library for creating, manipulating, and composing Multivariate Taylor Functions, 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.0-cp312-cp312-win_amd64.whl (235.3 kB view details)

Uploaded CPython 3.12Windows x86-64

mtflib-1.5.0-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.0-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.0-cp311-cp311-win_amd64.whl (232.6 kB view details)

Uploaded CPython 3.11Windows x86-64

mtflib-1.5.0-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.0-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.0-cp310-cp310-win_amd64.whl (230.9 kB view details)

Uploaded CPython 3.10Windows x86-64

mtflib-1.5.0-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.0-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.0-cp39-cp39-win_amd64.whl (233.1 kB view details)

Uploaded CPython 3.9Windows x86-64

mtflib-1.5.0-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.0-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.0-cp38-cp38-win_amd64.whl (230.2 kB view details)

Uploaded CPython 3.8Windows x86-64

mtflib-1.5.0-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.0-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.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 235.3 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 de653fb93509577771029f08a0c6846de29a2a818c804cc770933f4980efe197
MD5 54126be70f431029a3c5928ef60c8d52
BLAKE2b-256 6d97fd646bc82a95c6f7eaac50eff524ca7265923a97241e7d1c352a8be2616f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 de16d688a959651a64907906e2fe180a9888c675ac3635c77701c76537ed35dc
MD5 3f793c1628203249e59ec22e98e79c61
BLAKE2b-256 30504aecb22c95f37e430a0f638bdc270f942f01a3dae29a8f23209e460d2492

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b589df8ce9b3cfb2a791303cbd677ebafd79ace9527c2f3e94957b57c009761
MD5 842d2b734f614d01736b1e5ecae86d37
BLAKE2b-256 5ed22caf05f1ed37ad491c99f964b9120fa46fde615f52692a2c30b58cad0d81

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 232.6 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5c4f00687f978a391dd52f1407106404ed24fded0f08c507f58bd1e6d3e1f8d2
MD5 c07fc8f8b7575a8f5212649f2f41187a
BLAKE2b-256 7faed42236328c61c45c677720c991b8b5d29070834da74c8c17701ef8d7f081

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 530732f8f8fb0f91bc906705d38691d714013e606febd2ceaff70b665f599e09
MD5 75819e4dd597a6f1fa4f1ec0560f236f
BLAKE2b-256 f42d82502d4f2db23537ea16033e489162c9007dd558bd9f5432935725607b2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae0041ff5b37fba0fcf80e0933d73c25f52f0a6bd8e0c15bc200c5bb344b9cee
MD5 9a1ae76c52ceb5b9a89372d71d1c863c
BLAKE2b-256 f0355e958cd0ffef7f6fd1c3cf305784e6f2e99720730895e65dbf6ef18f144c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 230.9 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ae9be21aa37537560fada02d434bf19a9603e34078b6b26859db3bd4774d290c
MD5 f2f7de953cdd768798d4454410a0c914
BLAKE2b-256 6dab7b530599e5eeaaed7c8561803f63fcc504f976aeed48366a7b7616d02216

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6fc30dfe1b4612b952d80e1bef9f436c5ad279ef6a639bfcd90bfbf7af23d7c2
MD5 562a843c7f7f137932b0c3933f84058d
BLAKE2b-256 4e7c717b9fc0a2bf8caa2154d8bdcd52a24f115441959e8a9bf7bf5131246ba4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 391c4a8d3148d56c8b7d826565e036b11a6409327a65afbeecec51ab31073bc8
MD5 41f7446b3f45500790d87d2538d1037a
BLAKE2b-256 11e14ed96fa53ea7346912e331165946b97bbd5f3aa294092902a7840ca7776d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 233.1 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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 583ae2a32f53f09ce44732fcb53aee28e5736f49c0a0da6ba6f3223ddc1a9964
MD5 83bda3c1bac36cf6565ff35011d31d18
BLAKE2b-256 8b7b2e3e38166d0691259d1edc2a9195891a9364a6d64963df9b156ee74f7e2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3ef3696b914756cd856d66bfe215d9ee973e7a47351df4036bf7cb99b4d4c3e5
MD5 c236c4e86a0d6425a113f8bbe69b81c5
BLAKE2b-256 eb731b944f82da5d84cd5da44ed7402835bcb0e33511f42a142d2583b2bc3420

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 84b0ee087d21551bc812b50054859ef397e87256e46f1c2a9126adf267761eeb
MD5 a64e151ec938e4ed928a4053edf7f5b6
BLAKE2b-256 97783a391c617af7e6258ca6da362e8356d4f1f40915a1498178648fc3356c7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mtflib-1.5.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 230.2 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.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 76cbf5bc357fb0535470a875e6e83fb9be07645e7589ac0fcf7cbabf7b0637ba
MD5 d44efa7fe6fd4327a03449b50ac0e194
BLAKE2b-256 f36a535964c4cb520841e81d878f2c1d5b562fef0abe9b15c25be249569185f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp38-cp38-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 187f87661452fc2dc94453fce45af8cd58b873676fe9800559710cada85697eb
MD5 1841cc8a1bc0cbed20e04c52d34ccab2
BLAKE2b-256 d5260a47b48548d78af531b371242137445cadb2f9804496f55a6fbf38d96a0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mtflib-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6443c1c7ea1fd5996ba631fdb72e36900e9567675691c2f9889646876549e405
MD5 a630dc9ad84e8ceae0d575bcb5d4b531
BLAKE2b-256 4407b9e5365dc8d2cd4cb72d9d63a55f58ac00fa621f9a9087fe99b73bb792d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mtflib-1.5.0-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