Sagebrush · Permissively licensed research mathematics software for Python, JavaScript and Rust

Python 3.14 compiled to JavaScript, with numpy and Sagebrush's math engines — runs entirely on your machine. No server.

loading…

How it is built

Articles, algorithm by algorithm: what worked, what did not, and why.

Independent and open

MIT or Apache-2.0, written from papers and books. No code from Magma, PARI, Sage, Singular, FLINT or GMP, so when Sagebrush agrees with them, that is independent confirmation.

Use it anywhere

  • Here, in your browser
  • Python: pip install sagebrush
  • Command line: npx sagebrush
  • Agents: llms.txt and an MCP server
Notebook tips
  • The keys are Jupyter's: Shift+Enter runs a cell and moves on, Ctrl/Cmd+Enter runs it in place; Esc is command mode (A/B insert, DD deletes, M/Y switch to Markdown or code, H lists them all); Ctrl+; splits a cell. Drag a cell by its prompt to move it; hover between cells to add one.
  • + Text adds a Markdown cell (headings, lists, tables, links, $math$): Shift+Enter shows it, double-click edits it.
  • Tab after a name completes it (e.Tab lists what e can do); otherwise it indents: press Esc first to Tab out of the cell. File → Print saves the notebook, outputs and all, as a PDF. Variables persist between cells; the Console (in the ⋯ menu) is a scratchpad with its own interpreter.
  • Sage mode: ^ is a power (^^ is xor), 2/3 is an exact rational; factor, is_prime, ModularSymbols, EllipticCurve, polynomial rings, Gröbner bases and symbolic calculus (diff, integrate, solve, desolve) run on Sagebrush's Rust engines.
  • Magma mode: Magma programs are translated to Python in this page and print what Magma prints.
  • Python: CPython 3.14's own grammar, with numpy (checked against NumPy itself), matplotlib.pyplot, Sage-style plot, @interact and animate; pure-Python packages such as mpmath pass their own test suites.
  • Notebooks and files are saved in this browser as you work: File opens, downloads and uploads .ipynb; Files lists what Python's open() sees. Your code runs in a Web Worker on this page; nothing is sent anywhere.
Examples

Each opens as a new notebook; yours stays saved.

Share

A link with the notebook in it

No account needed. The link holds the cells' code and text, not outputs or files, and is never sent to a server.

Upload, with its files

A page at sagebrush.space/s/… with this notebook, its outputs and the files you choose, for anyone with the link. You can delete it at any time. Needs a CoCalc account.


  
In a cell, name? shows this, name?? the source.
Notebooks in this browser