{"id":8636,"library":"sevenn","title":"SevenNet (sevenn)","description":"SevenNet is a Python library implementing Scalable EquiVariance Enabled Neural Networks, primarily for atomistic simulations and materials science. It integrates with the Atomic Simulation Environment (ASE) for molecular dynamics, energy, and force calculations. The library is actively developed, with frequent minor releases and specific checkpoint releases for new pre-trained models. The current stable version is 0.12.1.","status":"active","version":"0.12.1","language":"en","source_language":"en","source_url":"https://github.com/MDIL-SNU/SevenNet","tags":["machine learning","materials science","molecular dynamics","neural network","equivariant","ase","deep learning"],"install":[{"cmd":"pip install sevenn","lang":"bash","label":"Stable release"},{"cmd":"pip install sevenn[gpu]","lang":"bash","label":"With GPU support (requires CUDA setup)"}],"dependencies":[{"reason":"Core functionality for equivariant neural networks.","package":"e3nn","optional":false},{"reason":"Required for FlashTP compilation, an optional performance feature.","package":"ninja","optional":true},{"reason":"Primary deep learning framework backend.","package":"torch","optional":false}],"imports":[{"note":"The calculator is located in the 'calculator' submodule.","wrong":"from sevenn import SevenNetCalculator","symbol":"SevenNetCalculator","correct":"from sevenn.calculator import SevenNetCalculator"},{"note":"The main model class resides in the 'model' submodule.","wrong":"from sevenn import SevenNet","symbol":"SevenNet","correct":"from sevenn.model import SevenNet"},{"note":"CLI operations are consolidated under 'sevenn.cli'.","wrong":"import sevenn.train","symbol":"run","correct":"from sevenn.cli import run"}],"quickstart":{"code":"import os\nimport numpy as np\nfrom ase.build import bulk\nfrom sevenn.calculator import SevenNetCalculator\n\n# Assuming a pre-trained model checkpoint path\n# Replace with your actual model path or a path to a downloaded checkpoint\n# Example: sevenn_cp download 'SevenNet-Omni-i8' will download to current dir\nMODEL_PATH = os.environ.get('SEVENN_MODEL_PATH', 'SevenNet-Omni-i8.ckpt')\n\n# Create an ASE atom object\natoms = bulk('Si', 'diamond', a=5.43, cubic=True)\natoms.set_positions(atoms.get_positions() + np.random.rand(*atoms.get_positions().shape) * 0.1)\n\n# Initialize the SevenNetCalculator\ncalculator = SevenNetCalculator(\n    path=MODEL_PATH,\n    device='cuda' if os.environ.get('SEVENN_USE_CUDA', 'false').lower() == 'true' else 'cpu'\n)\natoms.set_calculator(calculator)\n\n# Get energy and forces\nenergy = atoms.get_potential_energy()\nforces = atoms.get_forces()\nstress = atoms.get_stress()\n\nprint(f\"Energy: {energy:.4f} eV\")\nprint(f\"Forces (first atom): {forces[0]}\")\nprint(f\"Stress: {stress}\")\n\n# Clean up (optional, if you're done with the calculator)\ncalculator.cleanup()","lang":"python","description":"This quickstart demonstrates how to use `SevenNetCalculator` to compute energy, forces, and stress for an ASE `Atoms` object using a pre-trained SevenNet model. Ensure you have a model checkpoint available locally."},"warnings":[{"fix":"Update your CLI commands to use the `sevenn <subcommand>` pattern. Refer to the official documentation for updated subcommand syntax.","message":"The command-line interface (CLI) was significantly refactored in v0.11.1, changing from a single `sevenn_train` or `sevenn_inference` script to a subcommand-based structure (e.g., `sevenn train`, `sevenn inference`).","severity":"breaking","affected_versions":">=0.11.1"},{"fix":"Always install `sevenn` using its `pip install sevenn` command, which will handle `e3nn` dependencies. If manually managing `e3nn`, check `sevenn`'s `pyproject.toml` or `setup.py` for the exact required `e3nn` version range for your `sevenn` version.","message":"SevenNet has strict compatibility requirements with the `e3nn` library. Versions `0.10.4` and older are compatible with `e3nn < 0.5.0`, while `0.11.1` and newer likely require `e3nn >= 0.5.0` or a specific range. Installing an incompatible `e3nn` version can lead to runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `ninja` manually (`pip install ninja`) or install `sevenn` with the `[flashtp]` extra (e.g., `pip install sevenn[flashtp]`) if available, or manually install dependencies for the FlashTP feature.","message":"Using the FlashTP feature for accelerated calculations requires the `ninja` package to be installed, as it's used for compiling optimized kernels. If `ninja` is not present, FlashTP will fail to initialize.","severity":"gotcha","affected_versions":">=0.12.0"},{"fix":"Upgrade to `v0.12.1` or later and review your configuration files and CLI calls, especially those related to FlashTP, to ensure they use the standardized argument names.","message":"Inconsistent argument naming for FlashTP-related settings in CLI and configuration files was fixed in `v0.12.1`. Older scripts or configs might use deprecated argument names.","severity":"deprecated","affected_versions":"<0.12.1"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Use the new subcommand-based CLI interface: `from sevenn.cli import run` and call `run(['train', ...])`, or execute `sevenn train ...` from the terminal.","cause":"Attempting to use the old CLI command style (e.g., `sevenn.train.run()`) after the CLI refactor in `v0.11.1`.","error":"AttributeError: module 'sevenn' has no attribute 'train'"},{"fix":"Reinstall `sevenn` to ensure `e3nn` is installed correctly via its dependencies, or manually ensure your `e3nn` version matches the requirements for your `sevenn` version (e.g., `pip install 'e3nn>=0.5.0,<0.6.0'` if specified).","cause":"`e3nn` library version incompatibility with your installed `sevenn` version.","error":"RuntimeError: Could not find a suitable E3nn version. The installed version is X.Y.Z, but SevenNet requires A.B.C."},{"fix":"Install the `ninja` package: `pip install ninja`. This dependency is required for FlashTP's optimized kernel compilation.","cause":"Attempting to enable or use the FlashTP feature without the `ninja` package installed.","error":"ModuleNotFoundError: No module named 'ninja'"}]}