Skip to main content

Implementation of World Particle

Project description

WorldParticle

Implementation of WorldParticle, Unified Simulation of Lagrangian Particle Dynamics via Transformer

Install

$ pip install worldparticle

Usage

import torch
from worldparticle import WorldParticle, ParticleTokenizer

tokenizer = ParticleTokenizer(
    dim = 64,
    dim_attr = 1,
    grid_res = 5,
    spatial_radius = 2.0,
    boundary_radius = 2.0
)

model = WorldParticle(
    predictor = dict(
        delta_time = 0.01
    ),
    corrector = dict(
        dim = 64,
        enc_depth = 4,
        dec_depth = 4,
        enc_dim_head = 96,
        enc_heads = 8,
        dec_dim_head = 96,
        dec_heads = 8
    ),
    tokenizer = tokenizer
)

pos = torch.randn(2, 512, 3)
vel = torch.randn(2, 512, 3)
forces = torch.randn(2, 512, 3)
mass = torch.ones(2, 512)

boundary_pos = torch.randn(2, 128, 3)

# forward 1 step

out = model(
    pos = pos,
    vel = vel,
    mass = mass,
    forces = forces,
    attrs = mass,
    boundary_pos = boundary_pos
)

# out.pos (2, 512, 3)
# out.vel (2, 512, 3)

# or multi-step rollout

out_trajectory = model(
    num_steps = 10,
    pos = pos,
    vel = vel,
    mass = mass,
    forces = forces,
    return_initial_state = True,
    attrs = mass,
    boundary_pos = boundary_pos
)

# out_trajectory.pos (2, 11, 512, 3)
# out_trajectory.vel (2, 11, 512, 3)

Citations

@misc{wang2026unifiedsimulationlagrangianparticle,
    title   = {Unified Simulation of Lagrangian Particle Dynamics via Transformer},
    author  = {Caoliwen Wang and Minghao Guo and Siyuan Chen and Heng Zhang and Mengdi Wang and Xingyu Ni and Hanson Sun and Kunyi Wang and Zherong Pan and Kui Wu and Lingjie Liu and Yin Yang and Chenfanfu Jiang and Taku Komura and Wojciech Matusik and Peter Yichen Chen},
    year    = {2026},
    eprint  = {2605.15305},
    archivePrefix = {arXiv},
    primaryClass = {cs.GR},
    url     = {https://arxiv.org/abs/2605.15305},
}
@misc{teoh2026nextlatentpredictiontransformerslearn,
    title   = {Next-Latent Prediction Transformers Learn Compact World Models},
    author  = {Jayden Teoh and Manan Tomar and Kwangjun Ahn and Edward S. Hu and Tim Pearce and Pratyusha Sharma and Akshay Krishnamurthy and Riashat Islam and Alex Lamb and John Langford},
    year    = {2026},
    eprint  = {2511.05963},
    archivePrefix = {arXiv},
    primaryClass = {cs.LG},
    url     = {https://arxiv.org/abs/2511.05963},
}

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

worldparticle-0.1.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

worldparticle-0.1.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file worldparticle-0.1.1.tar.gz.

File metadata

  • Download URL: worldparticle-0.1.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for worldparticle-0.1.1.tar.gz
Algorithm Hash digest
SHA256 549f89f4bbac27ef84679234a16bec573bb9e3f406dff2d2b93a6d34fcb17bd6
MD5 f15e81e112471491d8923dc15d06eb1d
BLAKE2b-256 8c24f52dd395806b3dad0abbae769e93880994a5e2c175049ccc2c98ea831326

See more details on using hashes here.

File details

Details for the file worldparticle-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for worldparticle-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e711dd5a20a94e6d955e8ba25911918eb72211c8f66981fe1e5065123c83be8
MD5 3177ba6174da88ba9fca1921b15cb904
BLAKE2b-256 78b284521217682e8e2de7c678ff6c3f39ef03fcaaaaac279fd5b3abf49c6d0c

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