Skip to main content
Torx Logo

Torx

Probabilistic circuits in JAX.

Torx is a JAX-based library for PSCs and DFGs with all the benefits of JAX (native GPU/TPU acceleration, differentiability, vectorization).

Installation

Requires Python 3.11+.

pip install extro-torx

or

git clone https://github.com/extropic-ai/torx.git
cd torx
pip install -e ".[testing,examples]"

Documentation

Available at docs.torx.ai.

Quick example

Build and simulate a simple probabilistic circuit:

import jax
import jax.numpy as jnp
from torx import psc

gates = [
    psc.PNOT(0),
    psc.PCNOT([0, 1]),
]

circuit = psc.DiscretePCircuit(gates)
thetas = circuit.init_params(jax.random.key(0))
sim = psc.StateVectorSimulator()
compiled = sim.build_circuit(circuit, thetas)

state = jnp.array([1.0, 0.0, 0.0, 0.0])

density = sim.density(compiled, state)
print(f"Final distribution: {density}")

Citation

If you found this library useful in academic research, please cite:

@misc{verdon2026frameworkstochasticdifferentiableprogramming,
  title         = {A Framework for Stochastic Differentiable Programming},
  author        = {Guillaume Verdon and Leo Tyrpak and Owen Lockwood and Seth Morton and Alexander Neagoe and Anton Sugolov and Ian MacCormack and Mirko Amico},
  year          = {2026},
  eprint        = {2608.01612},
  archivePrefix = {arXiv},
  primaryClass  = {cs.ET},
  url           = {https://arxiv.org/abs/2608.01612},
}

See also: other libraries in the JAX ecosystem

thrml: probabilistic graphical models and block Gibbs sampling in JAX.

Awesome JAX: a longer list of other JAX projects.

Metadata

Release files for extro-torx 0.0.1

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

Source distribution (sdist)

Source distribution for extro-torx 0.0.1
File Size Uploaded
extro_torx-0.0.1.tar.gz 71.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for extro-torx 0.0.1
File Interpreter ABI Platform
extro_torx-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 136.2 kB

Release files / extro_torx-0.0.1.tar.gz

Download URL extro_torx-0.0.1.tar.gz
Size 71.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c7bbeb0c39e5c7f9a241b9d3f68c224b8dddbc29674ffc15c78d21d05eb0149a
BLAKE2b-256 checksum
How to use checksums
04a4b61c701f152a42fac14d1988363875f6d76094c3d1672b36c69d52bf1645
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

Release files / extro_torx-0.0.1-py3-none-any.whl

Download URL extro_torx-0.0.1-py3-none-any.whl
Size 64.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e51d6efe0a8bc62fb4b2b417d5e4ac8190e3fb22c9d14d9342c207afdc64a23c
BLAKE2b-256 checksum
How to use checksums
201972299cd52431a0562161c33420f126383d43669dcab7ca761f9c1b11d063
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.2

2 release files

This release

0.0.1 This release

2 release files

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