Skip to main content

SupertropicalPy

Python Version License Open In Colab

A comprehensive Python package for supertropical algebra, featuring tangible and ghost elements, matrix operations, and linear system solving using Cramer's rule.

🚀 Try it now! Click the "Open in Colab" badge above to run the interactive tutorial instantly in your browser - fast and free! No installation needed.

✨ Features

  • 🎯 Tangible & Ghost Elements: Full support for both element types with automatic conversion

  • 🧮 Supertropical Operations: Addition $\oplus$ defined by $a\oplus b=\max{a,b}$ (with ghost rules), and multiplication $\odot$ defined by $a\odot b=a+b$.

  • 📐 Matrix Operations: Matrix multiplication, permanent (supertropical determinant), adjoint.

  • 🔧 Linear System Solver: Cramer's rule implementation for solving $Ax = b$

  • 🚀 NumPy Integration: Efficient computations using NumPy arrays

  • 📚 Comprehensive Documentation: Full API reference, theory guide, and interactive tutorials

  • ✅ Type Safety: Automatic type coercion and validation

📦 Installation

pip install supertropicalpy

Or install from source:

git clone https://github.com/TetewHeroez/supertropicalpy.git

cd supertropicalpy

pip install -e .

📖 Documentation

🧪 Running Tests

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

Run with coverage

pytest --cov=supertropical

📚 Building Documentation Locally

# Install docs dependencies
pip install -e ".[docs]"

# Build HTML docs
cd docs
sphinx-build -b html source build
pytest --cov=supertropical

📚 Building Documentation Locally

# Install docs dependencies

pip install -e ".[docs]"

# Build HTML docs

cd docs

sphinx-build -b html source build
# Or use make (on Unix/Mac/Windows with make installed)
cd docs

make html

🎓 Mathematical Background

Supertropical algebra extends tropical algebra with ghost elements:

Operations:

  • Addition: $a \oplus b = \max(a, b)$ with special ghost rules

  • Multiplication: $a \odot b = a + b$ (classical addition)

Elements:

  • Tangible: Regular elements (e.g., $5.0$)

  • Ghost: Elements marked with $\nu$ (e.g., $5.0\nu$)

  • Zero: $-\infty$ (additive identity)

  • One: $0$ (multiplicative identity)

Key Properties:

  • Matrix permanent replaces determinant

  • Cramer's rule works for nonsingular matrices (permanent is tangible)

  • Applications in optimization, algebraic geometry, and phylogenetics

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.```

👥 Authors

  • Supertropical Team

🙏 Acknowledgments

  • Based on research by Izhakian, Z., & Rowen, L. on supertropical algebra

📞 Contact

Metadata

Release files for supertropicalpy 0.1.2

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

Source distribution (sdist)

Source distribution for supertropicalpy 0.1.2
File Size Uploaded Provenance Actions
supertropicalpy-0.1.2.tar.gz 11.9 kB With provenance Details for supertropicalpy-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for supertropicalpy 0.1.2
File Interpreter ABI Platform Actions
supertropicalpy-0.1.2-py3-none-any.whl Python 3 none any Details for supertropicalpy-0.1.2-py3-none-any.whl

Total release size: 22.3 kB

Release files / supertropicalpy-0.1.2.tar.gz

Download URL supertropicalpy-0.1.2.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e8822fd72fa6cfb6a0122b8cc7d5181b9a657dd9f7aec305ce7ba7f6496e0b0b
BLAKE2b-256 checksum
How to use checksums
bf50a8a99559e98a6bdb3764111fb517ce7322c28ffa7fbf9c7c6467ee0ae5e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2025.

Transparency log

Release files / supertropicalpy-0.1.2-py3-none-any.whl

Download URL supertropicalpy-0.1.2-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f022e6f41cca6f30570ccfca06b38bd7b93dc8c29e8befc557de94db5decf62f
BLAKE2b-256 checksum
How to use checksums
7d4e5dcc4f6860b4df4d038f4bdab146d9ca33dd2f9c9a8deb9bfcf9e45d86d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2025.

Transparency log

Security for supertropicalpy 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for supertropicalpy-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

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