Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SynEltra

SynEltra

A framework for electron-flow mechanism generation from atom-mapped reaction SMILES.

SynEltra builds imaginary transition-state (ITS) graphs from mapped reactions, enumerates electron-pushing trajectories via beam search, ranks them by electronic scoring, and renders them as Nature-style arrow-pushing figures.


Installation

conda env create -f env.yaml
conda activate syneltra-env
pip install -e .

Requirements: Python ≥ 3.11, SynKit ≥ 1.3.2, RDKit, NetworkX, NumPy, Matplotlib.


Quick Start

from syneltra import rsmi_to_trajs

rsmi = "[CH3:1][Br:2].[OH-:3]>>[CH3:1][OH:3].[Br-:2]"

trajs = rsmi_to_trajs(rsmi)          # sorted best-first
best  = trajs[0]                     # top-ranked mechanism

graphs      = best.graphs()          # RC-context graphs per step (list[nx.Graph])
graphs_full = best.graphs(full=True) # full molecular graphs
transitions = best.transitions       # list[Transition] — arrow sequence

print(f"Found {len(trajs)} trajectories, {len(transitions)} steps in best")
for i, t in enumerate(transitions):
    print(f"  [{i+1}] {t.kind}  {t.src} → {t.dst}")

rsmi_to_trajs parameters

Parameter Default Description
rsmi — Atom-mapped reaction SMILES (reactants>>products)
family None "polar", "pericyclic", or "radical". Auto-inferred when None.
k 0 Context-expansion radius for the workspace builder
max_depth 20 Maximum arrow-step depth for beam search
beam_width 64 Beam width; wider = more diverse trajectories, higher cost
max_results 20 Max trajectories returned before ranking
electronic_mode "fmo-hsab-resonance" Electronic scoring mode ("consensus", etc.)

Visualization

import matplotlib.pyplot as plt
from syneltra import rsmi_to_trajs, rsmi_to_reaction_bundle
from syneltra.visualization import MechanismVisualizer

rsmi   = "[CH3:1][Br:2].[OH-:3]>>[CH3:1][OH:3].[Br-:2]"
bundle = rsmi_to_reaction_bundle(rsmi)
trajs  = rsmi_to_trajs(rsmi)
best   = trajs[0]
viz    = MechanismVisualizer()

Reactant + ITS panel (default)

fig = viz.visualize_trajectory(
    reactant_graph=bundle.reactant_graph,
    transitions=best.transitions,
    its_graph=bundle.its,
    product_graph=bundle.product_graph,
    title="SN2: MeBr + OH⁻",
)
plt.show()

Step-by-step elementary panels

fig = viz.visualize_trajectory(
    reactant_graph=bundle.reactant_graph,
    transitions=best.transitions,
    its_graph=bundle.its,
    all_graphs=best.graphs(full=True),  # required for this mode
    product_graph=bundle.product_graph,
    title="SN2: step-by-step",
    show_elementary_steps=True,
    arrows_per_step=1,
)
plt.show()

Iterate over all ranked trajectories

for i, traj in enumerate(trajs):
    fig = viz.visualize_trajectory(
        reactant_graph=bundle.reactant_graph,
        transitions=traj.transitions,
        its_graph=bundle.its,
        product_graph=bundle.product_graph,
        title=f"Trajectory {i+1}/{len(trajs)}",
        fade_non_rc=True,
        use_rc_glow=True,
    )
    plt.show()

Key visualize_trajectory options

Parameter Default Description
fade_non_rc False Fade non-reaction-centre bonds
use_rc_glow True Soft halo around changed bonds
show_elementary_steps False One panel per arrow group
arrows_per_step 2 Arrows per panel (elementary mode)
show_atom_map True Show atom-map badges
step_labels True Label individual arrows
gap 3.0 Horizontal spacing between panels

Low-level API

from syneltra import (
    rsmi_to_reaction_graphs,   # → (reactant_graph, product_graph)
    rsmi_to_its,               # → ITS nx.Graph
    rsmi_to_reaction_bundle,   # → ReactionGraphBundle
    build_endpoint_states_from_its,
    MechanismEnumerator,
    ITSPlanner,
)

# Build graphs manually
r_graph, p_graph = rsmi_to_reaction_graphs(rsmi)

# Enumerate without ranking
from syneltra import MechanismEnumerator, rsmi_to_its
its = rsmi_to_its(rsmi)
trajs = MechanismEnumerator().enumerate_from_its(its, max_depth=10, beam_width=32)

Supported reaction families

Family Vocabulary Notes
polar LP-/B+, B-/LP+, B-/B+ Ionic / heterolytic; default fallback
pericyclic B-/B+ only Concerted bond-flow (Diels-Alder, sigmatropic, …)
radical above + B-/2R•, 2R•-/B+, R•/B-/B+, R•-/H-/R•+ Homolytic / chain processes

Project structure

syneltra/
├── chemistry/      # IO, ITS construction, endpoint states
├── constraints/    # Arrow-plan validity constraints
├── core/           # Config, models (Trajectory, StateSnapshot, …)
├── mechanism/      # Operators, planner, vocabulary, pruner
├── ranker/         # Trajectory ranking by electronic score
├── scoring/        # FMO, HSAB, resonance scoring functions
├── search/         # Beam-search enumerator
└── visualization/  # MechanismVisualizer, arrow rendering

Contributing

Publication

SYnEltra:

License

This project is licensed under MIT License - see the License file for details.

Acknowledgments

This project has received funding from the European Unions Horizon Europe Doctoral Network programme under the Marie-Skłodowska-Curie grant agreement No 101072930 (TACsy -- Training Alliance for Computational)

Metadata

Release files for syneltra 0.1.0b1

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

Source distribution (sdist)

Source distribution for syneltra 0.1.0b1
File Size Uploaded Provenance Actions
syneltra-0.1.0b1.tar.gz 189.8 kB With provenance Details for syneltra-0.1.0b1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for syneltra 0.1.0b1
File Interpreter ABI Platform Actions
syneltra-0.1.0b1-py3-none-any.whl Python 3 none any Details for syneltra-0.1.0b1-py3-none-any.whl

Total release size: 407.2 kB

Release files / syneltra-0.1.0b1.tar.gz

Download URL syneltra-0.1.0b1.tar.gz
Size 189.8 kB
Tags Source
SHA-256 checksum
How to use checksums
69e875b9fb9ca870f219062059d0047dfc1a0371f22a268c5fca98f6ca195d5b
BLAKE2b-256 checksum
How to use checksums
a00a2739853452a2979622917638e3e7f2e5dce3522bb335833a64c6b986a00c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 21, 2026.

Transparency log

Release files / syneltra-0.1.0b1-py3-none-any.whl

Download URL syneltra-0.1.0b1-py3-none-any.whl
Size 217.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e537cdb4c9bb80b962abb56de059901faaf29144a64e45739e2731777b8b8f8a
BLAKE2b-256 checksum
How to use checksums
a29e7cc3971b1c4ff7cd1f766bea51524b25b1b4f5b7c7f5c02ebe6844ae941d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 21, 2026.

Transparency log

Security for syneltra 0.1.0b1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for syneltra-0.1.0b1.tar.gz

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 May 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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