Skip to main content

A SageMath package to beautifully format rational functions arising from enumerative algebra into plaintext and latex.

Project description

BRational

A SageMath package to beautifully format rational functions arising from enumerative algebra into plaintext and latex.

Version: 2.0

Documentation


Example 1

The default factored expression for

$$\dfrac{1 + 3q^{-1}t - 4q^{-1} - 4q^{-2}t + 3q^{-2} + q^{-3}t}{(1 - q^{-1}t)(1 - q^{-2}t^4)}$$

in SageMath is sometimes expressed as

-(q^2 + 3*q*t - 3*q - t)*(q - 1)/((t^2 + q)*(t^2 - q)*(q - t))

Using brational, we get

q^-3*(1 - q)*(t + 3*q - 3*q*t - q^2)/((1 - q^-1*t)*(1 - q^-2*t^4))

Want $\LaTeX$? No problem:

sage: print(br.brat(q^-3*(1 - q)*(t + 3*q - 3*q*t - q^2)/((1 - q^-1*t)*(1 - q^-2*t^4))).factor().latex())
\dfrac{q^{-3}(1 - q)(t + 3q - 3qt - q^2)}{(1 - q^{-1}t)(1 - q^{-2}t^4)}

Example 2

The default expression for

$$\dfrac{1 + 26T + 66T^2 + 26T^3 + T^4}{(1 - T)^5}$$

in SageMath is sometimes expressed as

(-T^4 - 26*T^3 - 66*T^2 - 26*T - 1)/(T^5 - 5*T^4 + 10*T^3 - 10*T^2 + 5*T - 1)

Using brational, the default is

(1 + 26*T + 66*T^2 + 26*T^3 + T^4)/(1 - T)^5

And latex:

sage: print(br.brat((1 + 26*T + 66*T^2 + 26*T^3 + T^4)/(1 - T)^5).latex())
\dfrac{1 + 26T + 66T^2 + 26T^3 + T^4}{(1 - T)^5}

Project details


Download files

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

Source Distribution

brational-2.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

brational-2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file brational-2.0.tar.gz.

File metadata

  • Download URL: brational-2.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for brational-2.0.tar.gz
Algorithm Hash digest
SHA256 89c19e5301172dfdda23841c660d81d1c5b98d41c19e08b54b279915eef0e186
MD5 21b8221499180126ae87aa8d9aa69f0b
BLAKE2b-256 c3dc1dc6e08a409a7bd129483ee50831b834972e5c2a5b98520a2e8e045d146b

See more details on using hashes here.

File details

Details for the file brational-2.0-py3-none-any.whl.

File metadata

  • Download URL: brational-2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for brational-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab4e7b5f65b4547cd19d62b9858c4adae05a5a015bd63865db80b67969d2588c
MD5 1e9be22ab79ebcf9c06f6203b364c28e
BLAKE2b-256 fdea3ad0cd97dda94a249bdcf792d730716e0c2b4b447e379ae0b67b0fb76804

See more details on using hashes here.

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