A library for computational algebra using Transformers
Project description
CALT: Computer ALgebra with Transformer
Overview
CALT is a simple Python library for learning arithmetic and symbolic computation with a Transformer model (a deep neural model to realize sequence-to-sequence functions).
It offers a basic Transformer model and training, and non-experts of deep learning (e.g., mathematicians) can focus on constructing datasets to train and evaluate the model. Particularly, users only need to implement an instance generator for their own task.
For example, users define the following code for the polynomial addition task.
class PolynomialAdditionGenerator:
# Task - input: F=[f_1, ..., f_s], target: G=[g:= f_1+...+f_s]
def __init__(
self, sampler: PolynomialSampler, max_polynomials: int, min_polynomials: int
):
self.sampler = sampler
self.max_polynomials = max_polynomials
self.min_polynomials = min_polynomials
def __call__(self, seed: int) -> Tuple[List[PolyElement], PolyElement]:
random.seed(seed) # Set random seed
num_polys = random.randint(self.min_polynomials, self.max_polynomials)
F = self.sampler.sample(num_samples=num_polys)
g = sum(F)
return F, g
CALT automatically calls this generator in parallel to efficiently construct large datasets and trains a Transformer model to learn the computation. The sample generation process itself can reveal unexplored mathematical problems, enabling researchers to study their theoretical and algorithmic solutions. The following is a small list of such studies from our group.
- "Learning to Compute Gröbner Bases," Kera et al., 2024
- "Computational Algebra with Attention: Transformer Oracles for Border Basis Algorithms," Kera and Pelleriti et al., 2025
- "Geometric Generality of Transformer-Based Gröbner Basis Computation," Kambe et al., 2025
Refer to our paper "CALT: A Library for Computer Algebra with Transformer," Kera et al., 2025 for a comprehensive overview.
🚀 Quick Start
Basic Installation
pip install calt-x
For Research Projects
For researchers and developers who want to start experiments with CALT, we provide the CALT codebase - a comprehensive template repository with pre-configured environment and development tools.
git clone https://github.com/HiroshiKERA/calt-codebase.git
cd calt-codebase
conda env create -f environment.yml
📖 Documentation & Resources
- 📚 Full Documentation - Complete guide with quickstart and project organization tips
- ⚡ Quickstart Guide - Get up and running quickly
- 📓 Demo Notebook - Interactive examples
🔗 Links
Citation
If you use this code in your research, please cite our paper:
@misc{kera2025calt,
title={CALT: A Library for Computer Algebra with Transformer},
author={Hiroshi Kera and Shun Arawaka and Yuta Sato},
year={2025},
archivePrefix={arXiv},
eprint={2506.08600}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file calt_x-1.0.0.tar.gz.
File metadata
- Download URL: calt_x-1.0.0.tar.gz
- Upload date:
- Size: 83.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93bd0a9498044c5036853b34f81f9a168649e331a96888eff8194c573ea10371
|
|
| MD5 |
e094e178dc2e1acb8146da833f833db7
|
|
| BLAKE2b-256 |
6d1ca26b9bda0a8995f50531d202db7909a7f1907cb4370627a1f8f75ecc9871
|
Provenance
The following attestation bundles were made for calt_x-1.0.0.tar.gz:
Publisher:
pypi-release.yml on HiroshiKERA/calt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calt_x-1.0.0.tar.gz -
Subject digest:
93bd0a9498044c5036853b34f81f9a168649e331a96888eff8194c573ea10371 - Sigstore transparency entry: 973165637
- Sigstore integration time:
-
Permalink:
HiroshiKERA/calt@73e4f3d4c0e9197aecc2e16427a7781e4b081bff -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HiroshiKERA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@73e4f3d4c0e9197aecc2e16427a7781e4b081bff -
Trigger Event:
push
-
Statement type:
File details
Details for the file calt_x-1.0.0-py3-none-any.whl.
File metadata
- Download URL: calt_x-1.0.0-py3-none-any.whl
- Upload date:
- Size: 104.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abc43b249a27675ee8332ba98a8775e264b2979d7b506ed540ca9ad7dbcace64
|
|
| MD5 |
69b266bf114ace8824c123b6130f702a
|
|
| BLAKE2b-256 |
8864d4d2977c00595121c79d10a07b46747523df922ee0ea460b4e8985b4db91
|
Provenance
The following attestation bundles were made for calt_x-1.0.0-py3-none-any.whl:
Publisher:
pypi-release.yml on HiroshiKERA/calt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calt_x-1.0.0-py3-none-any.whl -
Subject digest:
abc43b249a27675ee8332ba98a8775e264b2979d7b506ed540ca9ad7dbcace64 - Sigstore transparency entry: 973165641
- Sigstore integration time:
-
Permalink:
HiroshiKERA/calt@73e4f3d4c0e9197aecc2e16427a7781e4b081bff -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HiroshiKERA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@73e4f3d4c0e9197aecc2e16427a7781e4b081bff -
Trigger Event:
push
-
Statement type: