Skip to main content

treetensor

Kinetic plasma simulation on tree tensor networks. The ttn module calls a C++20 runtime in double precision. The same model runs in the browser as the npm package @tensortree/plasma.

pip install treetensor

Wheels exist for Linux x86_64 and aarch64 (glibc 2.17 or later) and for macOS 14 or later on Apple silicon. Python 3.11 and later are supported.

import math
import ttn as t
x, v = t.periodic("x", 48, [0, 4 * math.pi]), t.periodic("v", 64, [-6, 6])
space, velocity = t.cartesian(x), t.cartesian(v)
density = t.cosine(x, 0.5, offset=1, amplitude=0.04)
electrons = t.species("electrons", charge=-1, mass=1, velocity=velocity,
                      initial=t.normalized(t.maxwellian(velocity, density=density), space.volume))
fields = t.maxwell(c_squared=16, electric=t.vector(x=t.product(-0.08, t.sine(x, 0.5))))
plasma = t.vlasov(space=space, species=[electrons], fields=fields)
Ex = t.observable("Ex", t.component(plasma.fields.electric, "x"))
s = (t.run(plasma).represent(electrons.f, t.ttn(rank=t.automatic(capacity=48)))
     .time(t.fixed_step(0.05, final_time=40)).observe(electrons.f, Ex, plasma.energy.total).compile())
while not s.done:
    s.advance()
    field = s.tensor(Ex)  # NumPy copy over x

TTN_CPU_THREADS sets the number of CPU executor threads. Python mirrors the JavaScript API with keyword arguments in snake case; the JavaScript reference is at https://itsuwari.github.io/vlasov/llms.txt. The live browser demo is at https://itsuwari.github.io/vlasov/.

Metadata

Release files for treetensor 0.1.0

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

Built distributions (wheels)

Table of built distributions (wheels) for treetensor 0.1.0
File
treetensor-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
treetensor-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
treetensor-0.1.0-cp312-abi3-macosx_14_0_arm64.whl CPython 3.12 abi3 macOS 14.0+ ARM64 Details
treetensor-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
treetensor-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
treetensor-0.1.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details

Total release size: 40.4 MB

Release files / treetensor-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL treetensor-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
eee0f7439b6031b96bc3f55ea700749c37f8e616c4bf05e779c4794f4ee06edb
BLAKE2b-256 checksum
How to use checksums
e206ae0d67b462eef4583c339b502b954ebbce8f11ffe48fb4d8c5fd506908d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / treetensor-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL treetensor-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.1 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b056130dfce265060c6c62600f0f2c1ee2df72eab27a9a229a4d0b8023e95775
BLAKE2b-256 checksum
How to use checksums
035274d93281280e6984a5e194567c1e4983eb4a710a72b3f1febf1fc495963e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / treetensor-0.1.0-cp312-abi3-macosx_14_0_arm64.whl

Download URL treetensor-0.1.0-cp312-abi3-macosx_14_0_arm64.whl
Size 4.0 MB
Tags CPython 3.12 abi3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d52443f175923c5f26c78062241977a55517ed2a5f98a904d797c0028945fc98
BLAKE2b-256 checksum
How to use checksums
a9c632d0e315ba516fd01e8a71e8449babef5e763a48f267e26a2352c2ad4cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / treetensor-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL treetensor-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
06eab6f8855a86a9ae256c495cad01c4894cdbbc533dc57d4c1447cbda5c16aa
BLAKE2b-256 checksum
How to use checksums
7af4b7f6a04790fa848edf52324bc2c28463fa9f3628aab3ee690a454a6b59b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / treetensor-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL treetensor-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.1 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
079ab668d532e70669b3f720f1c628cccdb6a10af145bdc6d472cc005d61b6c0
BLAKE2b-256 checksum
How to use checksums
4b4bfaa4f3d0abd07eb9650b3056f87cf01b49366d412b96ca6b6a40d13d8c01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / treetensor-0.1.0-cp311-cp311-macosx_14_0_arm64.whl

Download URL treetensor-0.1.0-cp311-cp311-macosx_14_0_arm64.whl
Size 4.0 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
767cc24b1611e55c583e0fe1db22b586815e0f921f1fce8e2ec9a90702856b56
BLAKE2b-256 checksum
How to use checksums
101637d9134baa6d3582d727fcf2da07095983f6dd9a8afe5b90546e5451f2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.2.0

6 release files

This release

0.1.0 This release

6 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