{"id":6355,"library":"e3nn","title":"e3nn","description":"e3nn is a Python library built on PyTorch for developing Euclidean (E(3)) equivariant neural networks. It focuses on symmetries related to 3D rotations, translations, and mirrors, providing fundamental mathematical operations like tensor products and spherical harmonics. The library is under active development, with version 0.6.0 being the current release, and follows a release cadence where the second version number is incremented for breaking changes.","status":"active","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/e3nn/e3nn","tags":["neural networks","equivariant","pytorch","machine learning","3d","geometry","group theory"],"install":[{"cmd":"pip install --upgrade e3nn","lang":"bash","label":"Install e3nn (requires PyTorch pre-installed)"}],"dependencies":[{"reason":"e3nn is built on PyTorch and requires it as a core dependency.","package":"torch","optional":false}],"imports":[{"note":"The 'o3' submodule contains core O(3) irreducible representations and operations.","symbol":"o3","correct":"from e3nn import o3"},{"note":"While 'from e3nn import o3' is common, specific classes like Irreps are found within the 'o3' submodule.","wrong":"from e3nn import Irreps","symbol":"Irreps","correct":"from e3nn.o3 import Irreps"}],"quickstart":{"code":"import torch\nfrom e3nn import o3\n\n# Create a random array made of scalar (0e) and a vector (1o) representations\n# '0e' denotes a scalar with even parity, '1o' denotes a vector with odd parity.\nirreps_in = o3.Irreps(\"0e + 1o\")\nx = irreps_in.randn(-1)\n\n# Define output representations and apply a linear layer\nirreps_out = o3.Irreps(\"2x0e + 2x1o\") # Two scalars and two vectors\nlinear = o3.Linear(irreps_in=irreps_in, irreps_out=irreps_out)\ny = linear(x)\n\n# Compute a tensor product of the input with itself\ntp = o3.FullTensorProduct(irreps_in1=irreps_in, irreps_in2=irreps_in)\nz = tp(x, x)\n\nprint(f\"Input (x) shape: {x.shape}, irreps: {irreps_in}\")\nprint(f\"Linear output (y) shape: {y.shape}, irreps: {irreps_out}\")\nprint(f\"Tensor product output (z) shape: {z.shape}, irreps: {tp.irreps_out}\")\n\n# For performance, modules can optionally be compiled with torch.compile\n# tp_pt2 = torch.compile(tp, fullgraph=True)\n# z_pt2 = tp_pt2(x, x)\n# torch.testing.assert_close(z, z_pt2)","lang":"python","description":"This example demonstrates how to define irreducible representations (Irreps), apply a linear transformation, and compute a tensor product using e3nn's o3 submodule. It showcases basic operations for building equivariant neural networks."},"warnings":[{"fix":"Consult the official CHANGELOG (https://github.com/e3nn/e3nn/blob/main/CHANGELOG.md) before upgrading to new minor versions to adapt your code for breaking API changes.","message":"e3nn is under active development. Breaking changes are introduced in minor version increments (e.g., from 0.x.x to 0.y.x). Always check the CHANGELOG when updating.","severity":"breaking","affected_versions":"<=0.6.0 (ongoing)"},{"fix":"If upgrading from pre-0.4.0, existing models using these operations might produce different results. Retrain or re-evaluate models if using custom normalization or assuming previous constant values.","message":"Normalization constants for `o3.TensorProduct` and `o3.Linear` were changed in version 0.4.0. Models with inhomogeneous multiplicities may be affected.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Carefully design your network architecture, especially the irreducible representations (Irreps) for intermediate and output layers, to ensure symmetry constraints are respected. Refer to the 'Simple Tasks and Symmetry' tutorial for examples.","message":"The output of an e3nn model (or any equivariant operation) must always have equal or higher symmetry than its input. Designing models that violate this principle can lead to unexpected behavior or errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Prioritize the official e3nn documentation (e3nn.org) and the e3nn GitHub repository for up-to-date examples and best practices. Avoid relying on older, unmaintained tutorial repositories.","message":"Older tutorials and examples (especially those for e3nn versions < 0.2) may be outdated and incompatible with current API versions. Always refer to the latest User Guide.","severity":"deprecated","affected_versions":"<0.2 tutorials for >=0.2 usage"},{"fix":"Ensure your development environment uses Python 3.8 or a newer compatible version.","message":"Python 3.6 support was dropped in earlier versions. The current library requires Python 3.8 or higher.","severity":"breaking","affected_versions":"<0.4.0 to >=0.4.0 transition and onward"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}