API reference

Graph construction and descriptors

Fast, geometry-free molecular graph construction and descriptors.

class synde.graph.ComponentFrontier(component_id: 'int', nodes: 'tuple[Any, ...]', homo_energy: 'float | None', lumo_energy: 'float | None', homo_density: 'dict[Any, float]', lumo_density: 'dict[Any, float]')[source]

Bases: object

component_id: int
homo_density: dict[Any, float]
homo_energy: float | None
lumo_density: dict[Any, float]
lumo_energy: float | None
nodes: tuple[Any, ...]
class synde.graph.DirectionalFMO(donor_component: 'int', acceptor_component: 'int', donor_atom: 'Any', acceptor_atom: 'Any', gap: 'float | None', regularized_gap: 'float | None', score: 'float', valid: 'bool', warning: 'str | None' = None)[source]

Bases: object

acceptor_atom: Any
acceptor_component: int
donor_atom: Any
donor_component: int
gap: float | None
regularized_gap: float | None
score: float
valid: bool
warning: str | None = None
class synde.graph.GeneralizedHuckel(parameters: HuckelParameters | None = None)[source]

Bases: object

Solve generalized Hückel systems built by synde.graph.pi_system.

frontier_subspaces(occupations: ndarray, energies: ndarray) → tuple[tuple[int, ...], tuple[int, ...]][source]

Return degenerate HOMO and LUMO subspaces from explicit occupations.

static occupations(n_orbitals: int, electron_count: int) → ndarray[source]

Return an explicit occupation vector (two electrons then one, if needed).

solve(assignment: PiAssignmentResult) → GeneralizedHuckelResult[source]

Solve every assigned pi system using its explicit electron count.

static subspace_density(coefficients: ndarray, indices: tuple[int, ...]) → ndarray[source]

Return a basis-invariant local density summed over an orbital subspace.

class synde.graph.GeneralizedHuckelResult(systems: tuple[HuckelSystemResult, ...], parameter_set: str, status: str, warnings: tuple[str, ...])[source]

Bases: object

Descriptor result for all pi systems in one normalized molecule graph.

parameter_set: str
property pi_stabilization: float
property raw_pi_energy: float
property reference_pi_energy: float
status: str
systems: tuple[HuckelSystemResult, ...]
warnings: tuple[str, ...]
class synde.graph.GraphBuilder[source]

Bases: object

static from_graph(graph: Graph, *, strict: bool = True) → NormalizedMolecularGraph[source]
static from_smiles(smiles: str, *, strict: bool = True) → NormalizedMolecularGraph[source]
static from_synkit_graph(graph: Graph, *, strict: bool = True, canonical_smiles: str | None = None) → NormalizedMolecularGraph[source]
static reaction_states_from_smiles(reaction_smiles: str, *, strict: bool = True) → tuple[NormalizedMolecularGraph, NormalizedMolecularGraph, Graph | None][source]

Convert reaction SMILES with Synkit’s native reaction graph converter.

The first two values are SynDE-normalized reactant and product state graphs. The third is Synkit’s paired-attribute ITS graph when complete atom mapping is available; otherwise it is None.

class synde.graph.GraphNormalizer(*, strict: bool = True)[source]

Bases: object

Create a normalized copy of a NetworkX molecular graph.

In strict mode, missing element labels and malformed edge orders are input errors. Unsupported chemical environments remain structured partial results so callers can inspect the graph and decide whether to continue.

normalize(graph: Graph, *, canonical_smiles: str | None = None, source: str = 'networkx') → NormalizedMolecularGraph[source]

Return a normalized copy of graph.

The input graph is never mutated. MultiGraphs and directed graphs are rejected because SYN’s current molecular representation is an undirected simple graph.

class synde.graph.GraphPairScorer(config: PairScoringConfig | None = None, parameters: HuckelParameters | None = None)[source]

Bases: object

Rank cross-component pi atom pairs; scores are not interaction energies.

rank(normalized: NormalizedMolecularGraph, *, top_k: int = 50, group_equivalence: bool = False) → list[PairScoreResult] | list[PairScoreGroup][source]
exception synde.graph.GraphValidationError[source]

Bases: ValueError

Raised for malformed graph input when strict validation is enabled.

class synde.graph.GraphWarning(code: str, message: str, nodes: tuple[Any, ...] = ())[source]

Bases: object

A structured warning emitted while normalizing a molecular graph.

code: str
message: str
nodes: tuple[Any, ...] = ()
class synde.graph.HSABDescriptor(component_id: 'int', electronegativity: 'float | None', hardness: 'float | None', softness: 'float | None', local_nucleophilic_softness: 'dict[Any, float]', local_electrophilic_softness: 'dict[Any, float]')[source]

Bases: object

component_id: int
electronegativity: float | None
hardness: float | None
local_electrophilic_softness: dict[Any, float]
local_nucleophilic_softness: dict[Any, float]
softness: float | None
class synde.graph.HuckelParameters(parameter_set: str = 'organic-v1', degeneracy_tolerance: float = 1e-08, beta_aromatic: float = -1.0, beta_double: float = -1.0, beta_conjugated: float = -0.8, hetero_beta_scale: float = 0.85, alpha: dict[str, float]=<factory>)[source]

Bases: object

Initial versioned alpha/beta configuration for common organic pi systems.

alpha: dict[str, float]
beta_aromatic: float = -1.0
beta_conjugated: float = -0.8
beta_double: float = -1.0
degeneracy_tolerance: float = 1e-08
hetero_beta_scale: float = 0.85
parameter_set: str = 'organic-v1'
class synde.graph.HuckelSystemResult(nodes: tuple[Any, ...], electron_count: int, hamiltonian: ndarray, orbital_energies: ndarray, coefficients: ndarray, occupations: ndarray, alpha: dict[Any, float], raw_pi_energy: float, reference_pi_energy: float, pi_stabilization: float, pi_populations: ndarray, homo_indices: tuple[int, ...], lumo_indices: tuple[int, ...], homo_density: ndarray, lumo_density: ndarray | None)[source]

Bases: object

Orbital and invariant descriptors for one connected pi system.

alpha: dict[Any, float]
coefficients: ndarray
electron_count: int
hamiltonian: ndarray
homo_density: ndarray
property homo_energy: float | None
homo_indices: tuple[int, ...]
lumo_density: ndarray | None
property lumo_energy: float | None
lumo_indices: tuple[int, ...]
nodes: tuple[Any, ...]
occupations: ndarray
orbital_energies: ndarray
pi_populations: ndarray
pi_stabilization: float
raw_pi_energy: float
reference_pi_energy: float
class synde.graph.ITSGraph(graph: Graph, reacting_atom_maps: tuple[int, ...], bond_changes: tuple[dict[str, Any], ...], reactant_graph: Graph, product_graph: Graph)[source]

Bases: object

Mapped union graph whose edges retain reactant/product bond orders.

bond_changes: tuple[dict[str, Any], ...]
graph: Graph
product_graph: Graph
reactant_graph: Graph
reacting_atom_maps: tuple[int, ...]
class synde.graph.ITSGraphBuilder[source]

Bases: object

Build an ITS graph only when atom mapping gives an unambiguous correspondence.

build(reactants: list[NormalizedMolecularGraph], products: list[NormalizedMolecularGraph], *, native_its: Graph | None = None) → ITSGraph[source]
class synde.graph.NormalizedMolecularGraph(graph: Graph, identity: str, canonical_smiles: str | None, status: str, warnings: tuple[GraphWarning, ...], source: str)[source]

Bases: object

Validated molecular graph plus identity, provenance, and warnings.

graph is a private copy of the input graph. Node identifiers are kept unchanged so atom-map and caller-level identities remain usable by later reaction modules.

canonical_smiles: str | None
graph: Graph
identity: str
source: str
status: str
to_dict() → dict[str, Any][source]

Return serializable graph metadata; the NetworkX graph is omitted.

warning_codes() → tuple[str, ...][source]

Return warning codes in encounter order.

warnings: tuple[GraphWarning, ...]
class synde.graph.PairScoreGroup(representative: PairScoreResult, pairs: tuple[tuple[Any, Any], ...], equivalence_key: tuple[Any, ...])[source]

Bases: object

Symmetry-equivalent candidate pairs represented by one score row.

equivalence_key: tuple[Any, ...]
property equivalent_pairs: tuple[tuple[Any, Any], ...]

Backward-compatible alias for the grouped candidate pairs.

pairs: tuple[tuple[Any, Any], ...]
representative: PairScoreResult
class synde.graph.PairScoreResult(atom_a: 'Any', atom_b: 'Any', component_a: 'int', component_b: 'int', pair_compatibility_score: 'float', direction: 'str', components: 'dict[str, float]', warnings: 'tuple[str, ...]', equivalence_key: 'tuple[Any, ...]')[source]

Bases: object

atom_a: Any
atom_b: Any
component_a: int
component_b: int
components: dict[str, float]
direction: str
equivalence_key: tuple[Any, ...]
pair_compatibility_score: float
warnings: tuple[str, ...]
class synde.graph.PairScoringConfig(gap_floor: 'float' = 0.05, fmo_weight: 'float' = 1.0, hsab_weight: 'float' = 0.25, charge_weight: 'float' = 0.05, accessibility_weight: 'float' = 0.1, proposed_bond_order: 'float' = 1.0)[source]

Bases: object

accessibility_weight: float = 0.1
charge_weight: float = 0.05
fmo_weight: float = 1.0
gap_floor: float = 0.05
hsab_weight: float = 0.25
proposed_bond_order: float = 1.0
class synde.graph.PiAssignmentResult(pi_graph: Graph, atoms: tuple[PiAtom, ...], systems: tuple[PiSystem, ...], status: str, warnings: tuple[GraphWarning, ...])[source]

Bases: object

Pi-system assignment for a normalized molecular graph.

atom_for(node: Any) → PiAtom[source]

Return the diagnostic record for node.

atoms: tuple[PiAtom, ...]
property electron_count: int

Return the total number of assigned pi electrons.

pi_graph: Graph
status: str
systems: tuple[PiSystem, ...]
warning_codes() → tuple[str, ...][source]
warnings: tuple[GraphWarning, ...]
class synde.graph.PiAtom(node: Any, included: bool, electrons: int | None, reason: str, confidence: str)[source]

Bases: object

Per-atom pi-orbital assignment diagnostic.

confidence: str
electrons: int | None
included: bool
node: Any
reason: str
class synde.graph.PiSystem(nodes: tuple[Any, ...], edges: tuple[tuple[Any, Any], ...], electron_count: int)[source]

Bases: object

One connected system of coupled p orbitals.

edges: tuple[tuple[Any, Any], ...]
electron_count: int
nodes: tuple[Any, ...]
class synde.graph.PiSystemAssigner[source]

Bases: object

Assign one-p-orbital Hückel systems for supported organic graphs.

The first v2 model intentionally supports one p orbital per atom. Triple bonds, radicals, and unsupported heteroatom environments are reported as diagnostics instead of being forced into an incorrect one-orbital model.

assign(normalized: NormalizedMolecularGraph) → PiAssignmentResult[source]

Build coupled pi systems and explicit electron counts.

synde.graph.assign_orbital_pi(normalized: NormalizedMolecularGraph) → PiAssignmentResult[source]

Expand stable pi assignments with explicit orthogonal orbitals.

synde.graph.assign_pi_systems(normalized: NormalizedMolecularGraph) → PiAssignmentResult[source]

Convenience wrapper around PiSystemAssigner.

synde.graph.directional_fmo(donor: ComponentFrontier, acceptor: ComponentFrontier, donor_atom: Any, acceptor_atom: Any, *, gap_floor: float = 0.05) → DirectionalFMO[source]

Return a graph-only donor-to-acceptor compatibility descriptor.

Non-positive gaps are invalid rather than replaced by an artificial tiny denominator. Small positive gaps are regularized and flagged.

synde.graph.hsab_descriptor(frontier: ComponentFrontier, *, hardness_floor: float = 0.05) → HSABDescriptor[source]

Build global and local HSAB features without claiming an energy value.

synde.graph.local_hsab_compatibility(donor: HSABDescriptor, acceptor: HSABDescriptor, donor_atom: Any, acceptor_atom: Any) → float[source]

Return a dimensionless local soft donor/acceptor compatibility feature.

synde.graph.normalize_graph(graph: Graph, *, strict: bool = True, canonical_smiles: str | None = None, source: str = 'networkx') → NormalizedMolecularGraph[source]

Convenience wrapper around GraphNormalizer.

synde.graph.solve_generalized_huckel(assignment: PiAssignmentResult, parameters: HuckelParameters | None = None) → GeneralizedHuckelResult[source]

Convenience wrapper for GeneralizedHuckel.

Energy and ranking predictor

class synde.energy.SynDEEnergyPredictor(*, card: SynDEEnergyModelCard, intercept: float, composition_weights: dict[str, float], connectivity_weights: dict[str, float], feature_means: dict[str, float], feature_scales: dict[str, float], training_distance_q99: float, composition_ranges: dict[str, tuple[int, int]], model_sha256: str | None = None, refinement_report: dict[str, Any] | None = None)[source]

Bases: object

Predict GFN2-xTB total energy and rank constitutional isomers.

The returned energy is the sum of three inspectable blocks: a fitted intercept, an extensive elemental-composition baseline, and a sparse connectivity correction over the named SynDE descriptor library.

COMPOSITION_WARNING = 'SYNDE_ENERGY_OUTSIDE_TRAINING_COMPOSITION_RANGE'
DISTANCE_WARNING = 'SYNDE_ENERGY_OUTSIDE_TRAINING_Q99_FEATURE_DISTANCE'
domain_description() → str[source]

Summarize the chemistry this artifact was fitted to accept.

Returns:

Single-line description of elements, charges, and structure.

Return type:

str

features(normalized: NormalizedMolecularGraph) → dict[str, float][source]

Return the same named coordinate-free descriptor library used in fit.

classmethod load(model_path: Path) → SynDEEnergyPredictor[source]

Load and hash a versioned cross-formula model artifact.

classmethod load_default() → SynDEEnergyPredictor[source]

Load the packaged energy-and-ranking artifact.

predict(normalized: NormalizedMolecularGraph) → SynDEEnergyPrediction[source]

Predict one total energy; unlike SynDEScorer, formulas may differ.

predict_group(candidates: list[NormalizedMolecularGraph]) → list[SynDEEnergyPrediction][source]

Predict one formula group with the same artifact used globally.

Requiring a common elemental composition and formal charge makes the ranking interpretation explicit: every composition contribution is identical, and all predicted differences come from connectivity.

predict_many(candidates: list[NormalizedMolecularGraph]) → list[SynDEEnergyPrediction][source]

Predict any collection; no shared-formula restriction is applied.

predict_many_smiles(smiles: Iterable[str]) → list[SynDEEnergyPrediction][source]

Parse and predict a collection of SMILES strings.

Parameters:

smiles (Iterable[str]) – SMILES strings; formulas may differ freely.

Returns:

One prediction per input, in input order.

Return type:

list[SynDEEnergyPrediction]

predict_smiles(smiles: str) → SynDEEnergyPrediction[source]

Parse one SMILES string and predict its total energy.

Parameters:

smiles (str) – SMILES string for a single neutral closed-shell molecule.

Returns:

Auditable prediction for the parsed structure.

Return type:

SynDEEnergyPrediction

rank_group(candidates: list[NormalizedMolecularGraph]) → SynDEEnergyRanking[source]

Return a same-formula group ordered from lowest predicted energy.

The result is a list of (input index, prediction) pairs exactly as in earlier releases, wrapped in a subclass that can render itself.

Parameters:

candidates (list[NormalizedMolecularGraph]) – Constitutional isomers sharing one formula.

Returns:

Ordered index and prediction pairs, lowest energy first.

Return type:

SynDEEnergyRanking

rank_smiles(smiles: Iterable[str]) → SynDEEnergyRanking[source]

Parse constitutional isomers and rank them by predicted energy.

Parameters:

smiles (Iterable[str]) – SMILES strings that share one formula and formal charge.

Returns:

Ordered index and prediction pairs, lowest energy first.

Return type:

SynDEEnergyRanking

refine(records: Iterable[EnergyRefinementRecord], *, dataset_name: str, alpha: float = 10.0, refine_intercept: bool = True, refine_composition: bool = True, refine_connectivity: bool = True) → tuple[SynDEEnergyPredictor, EnergyRefinementReport][source]

Return a new predictor refined on externally supplied labels.

The validated packaged artifact is never mutated. The returned model is explicitly marked as requiring fresh independent validation.

Parameters:
  • records – External structures and targets in this model’s units.

  • dataset_name – Human-readable external dataset identifier.

  • alpha – Ridge strength anchoring adjustments to current weights.

  • refine_intercept – Permit refinement of the intercept.

  • refine_composition – Permit refinement of elemental weights.

  • refine_connectivity – Permit refinement of connectivity weights.

Returns:

Refined predictor and fit diagnostics.

save(path: Path) → None[source]

Write this predictor as a loadable, versioned JSON artifact.

Parameters:

path – Destination JSON path.

summary(*, color: bool | None = None) → str[source]

Render this artifact’s provenance and applicability boundary.

Parameters:

color (bool | None) – Force ANSI colour on or off; None auto-detects.

Returns:

Multi-line model-card report.

Return type:

str

to_dict() → dict[str, Any][source]

Serialize the model without embedding its self-referential file hash.

class synde.energy.SynDEEnergyModelCard(model_name: str, schema_version: int, target: str, units: str, reference_protocol: str, training_source: str, training_source_sha256: str, training_groups: int, training_molecules: int, evaluation_status: str, formula_disjoint_evaluation: bool, connectivity_disjoint_evaluation: bool, composition_model: str, connectivity_model: str, supported_elements: tuple[str, ...], supported_formal_charges: tuple[int, ...], uses_coordinates_at_inference: bool, uses_conformers_at_inference: bool, connectivity_equation_unchanged: bool, connectivity_refit_on_amended_development_cohort: bool = False, ordinary_explicit_hydrogen_policy: str = 'not_recorded', isotope_policy: str = 'not_recorded')[source]

Bases: object

Provenance and applicability boundary of a cross-formula artifact.

composition_model: str
connectivity_disjoint_evaluation: bool
connectivity_equation_unchanged: bool
connectivity_model: str
connectivity_refit_on_amended_development_cohort: bool = False
evaluation_status: str
formula_disjoint_evaluation: bool
classmethod from_dict(payload: dict[str, Any]) → SynDEEnergyModelCard[source]
isotope_policy: str = 'not_recorded'
model_name: str
ordinary_explicit_hydrogen_policy: str = 'not_recorded'
reference_protocol: str
schema_version: int
summary(*, color: bool | None = None) → str[source]

Render this model card as an aligned text report.

Parameters:

color (bool | None) – Force ANSI colour on or off; None auto-detects.

Returns:

Multi-line model-card report.

Return type:

str

supported_elements: tuple[str, ...]
supported_formal_charges: tuple[int, ...]
target: str
training_groups: int
training_molecules: int
training_source: str
training_source_sha256: str
units: str
uses_conformers_at_inference: bool
uses_coordinates_at_inference: bool
class synde.energy.SynDEEnergyPrediction(status: str, predicted_energy: float, units: str, intercept_contribution: float, composition_contributions: dict[str, float], connectivity_contributions: dict[str, float], composition_total: float, connectivity_total: float, descriptors: dict[str, Any], warnings: tuple[str, ...], provenance: dict[str, Any])[source]

Bases: object

Auditable prediction of one protocol-defined total energy.

property canonical_smiles: str | None

Return the canonical SMILES recorded for the scored graph.

Returns:

Canonical SMILES, or None when the graph carried none.

Return type:

str | None

property composition: dict[str, int]

Return the element counts used by the composition block.

Returns:

Element symbol to count mapping including hydrogens.

Return type:

dict[str, int]

composition_contributions: dict[str, float]
composition_total: float
connectivity_contributions: dict[str, float]
connectivity_total: float
descriptors: dict[str, Any]
intercept_contribution: float
predicted_energy: float
provenance: dict[str, Any]
status: str
summary(*, color: bool | None = None, precision: int = 4, top: int = 8) → str[source]

Render the auditable breakdown of this prediction as text.

Parameters:
  • color (bool | None) – Force ANSI colour on or off; None auto-detects.

  • precision (int) – Digits kept after the decimal point.

  • top (int) – Number of connectivity terms listed.

Returns:

Multi-line report suitable for printing to a terminal.

Return type:

str

to_dict() → dict[str, Any][source]

Return the whole prediction as a JSON-ready mapping.

Returns:

Nested mapping of every field on this prediction.

Return type:

dict[str, Any]

top_contributions(limit: int = 8) → list[tuple[str, float]][source]

Return the largest-magnitude active connectivity terms.

Parameters:

limit (int) – Maximum number of terms returned.

Returns:

Term name and signed contribution pairs, largest first.

Return type:

list[tuple[str, float]]

units: str
warnings: tuple[str, ...]
class synde.energy.SynDEEnergyRanking(entries, labels=None)[source]

Bases: list

Ordered (input index, prediction) pairs from rank_group().

The class behaves exactly like the list of tuples returned by earlier releases and only adds rendering helpers, so existing unpacking code keeps working unchanged.

Parameters:
  • entries (Iterable[tuple[int, SynDEEnergyPrediction]]) – Ordered input-index and prediction pairs.

  • labels (Sequence[str] | None) – Display labels indexed by original input position.

summary(*, color: bool | None = None, precision: int = 4) → str[source]

Render this ranking as an aligned text table.

Parameters:
  • color (bool | None) – Force ANSI colour on or off; None auto-detects.

  • precision (int) – Digits kept after the decimal point.

Returns:

Multi-line ranking table.

Return type:

str

Errors

Every SynDE exception subclasses ValueError, so existing handlers keep working while gaining structured context.

Structured, actionable exceptions for the SynDE public interface.

Every error raised by the user-facing predictor carries the offending input, the domain rule that rejected it, and a concrete next step. All exceptions subclass ValueError so existing except ValueError call sites keep working unchanged.

exception synde.errors.SynDEDomainError(reason: str, *, subject: str | None = None, hint: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: SynDEError

A parsed structure lies outside the active model’s applicability domain.

Parameters:
  • reason (str) – Short sentence naming the violated domain rule.

  • subject (str | None) – Canonical SMILES or other identifier for the input.

  • hint (str | None) – Concrete remedial action offered to the caller.

  • details (dict[str, Any] | None) – Extra machine-readable context attached to the failure.

exception synde.errors.SynDEError[source]

Bases: ValueError

Base class for every SynDE error that reports a user-fixable problem.

exception synde.errors.SynDEInputError[source]

Bases: SynDEError

A structure could not be parsed into a normalized SynDE graph.

synde.errors.format_domain_message(reason: str, *, subject: str | None = None, hint: str | None = None) → str[source]

Compose a multi-line domain-error message.

Parameters:
  • reason (str) – Short sentence naming the violated domain rule.

  • subject (str | None) – Canonical SMILES or other identifier for the input.

  • hint (str | None) – Concrete remedial action offered to the caller.

Returns:

Human-readable message beginning with the violated rule.

Return type:

str

Command line interface

The synde console script is a thin wrapper over the predictor; see Command Line Interface for the user-facing documentation.

Command-line interface for SynDE energy prediction and isomer ranking.

Installed as the synde console script. Every subcommand accepts SMILES as positional arguments, from a file with --input, or on standard input, and every subcommand can emit machine-readable output with --format json or --format csv so results pipe cleanly into other tools.

synde.cli.build_parser() → ArgumentParser[source]

Construct the full command-line parser.

Returns:

Parser covering every SynDE subcommand.

Return type:

argparse.ArgumentParser

synde.cli.main(argv: Sequence[str] | None = None) → int[source]

Run the SynDE command-line interface.

Parameters:

argv (Sequence[str] | None) – Argument vector; defaults to sys.argv[1:].

Returns:

Process exit status.

Return type:

int

Presentation helpers

Rendering used by the command line interface and by the interactive __repr__ and _repr_html_ hooks.

Human-readable renderings of SynDE predictions, rankings, and model cards.

This module is the single presentation layer for the package. The command line interface, the interactive __repr__ implementations, and the Jupyter _repr_html_ hooks all render through the functions defined here, so terminal and notebook output stay consistent.

synde.report.composition_formula(composition: dict[str, int]) → str[source]

Render an element-count mapping in Hill notation.

Parameters:

composition (dict[str, int]) – Element symbol to count mapping.

Returns:

Hill-ordered molecular formula, or "-" when empty.

Return type:

str

synde.report.model_card_summary(card: SynDEEnergyModelCard, *, palette: Palette | None = None, model_sha256: str | None = None, width: int | None = None) → str[source]

Render the provenance and applicability boundary of one artifact.

Parameters:
  • card (SynDEEnergyModelCard) – Model card describing the active artifact.

  • palette (Palette | None) – Styling switch applied to headings.

  • model_sha256 (str | None) – Digest of the loaded artifact, when available.

  • width (int | None) – Rendering width; defaults to the terminal width.

Returns:

Multi-line model-card report without a trailing newline.

Return type:

str

synde.report.prediction_headline(prediction: SynDEEnergyPrediction, *, precision: int = 4) → str[source]

Render a single compact line describing one prediction.

Parameters:
  • prediction (SynDEEnergyPrediction) – Prediction to describe.

  • precision (int) – Digits kept after the decimal point.

Returns:

One-line summary suitable for __repr__.

Return type:

str

synde.report.prediction_html(prediction: SynDEEnergyPrediction, *, precision: int = 4, top: int = 8) → str[source]

Render one prediction as notebook-friendly HTML.

Parameters:
  • prediction (SynDEEnergyPrediction) – Prediction to render.

  • precision (int) – Digits kept after the decimal point.

  • top (int) – Number of connectivity terms listed.

Returns:

HTML fragment for _repr_html_.

Return type:

str

synde.report.prediction_summary(prediction: SynDEEnergyPrediction, *, palette: Palette | None = None, precision: int = 4, top: int = 8, width: int | None = None) → str[source]

Render the full auditable breakdown of one prediction.

Parameters:
  • prediction (SynDEEnergyPrediction) – Prediction to render.

  • palette (Palette | None) – Styling switch applied to headings and markers.

  • precision (int) – Digits kept after the decimal point.

  • top (int) – Number of connectivity terms listed.

  • width (int | None) – Rendering width; defaults to the terminal width.

Returns:

Multi-line report without a trailing newline.

Return type:

str

synde.report.ranking_html(entries: Sequence[tuple[int, 'SynDEEnergyPrediction']], *, labels: Sequence[str] | None = None, precision: int = 4) → str[source]

Render an ordered ranking as notebook-friendly HTML.

Parameters:
  • entries (Sequence[tuple[int, SynDEEnergyPrediction]]) – Input index and prediction pairs, already ordered.

  • labels (Sequence[str] | None) – Display labels indexed by original input position.

  • precision (int) – Digits kept after the decimal point.

Returns:

HTML fragment showing the ranking table.

Return type:

str

synde.report.ranking_summary(entries: Sequence[tuple[int, 'SynDEEnergyPrediction']], *, labels: Sequence[str] | None = None, palette: Palette | None = None, precision: int = 4, width: int | None = None) → str[source]

Render an ordered same-formula ranking table.

Parameters:
  • entries (Sequence[tuple[int, SynDEEnergyPrediction]]) – Input index and prediction pairs, already ordered.

  • labels (Sequence[str] | None) – Display labels indexed by original input position.

  • palette (Palette | None) – Styling switch applied to headings.

  • precision (int) – Digits kept after the decimal point.

  • width (int | None) – Rendering width; defaults to the terminal width.

Returns:

Multi-line ranking report without a trailing newline.

Return type:

str

synde.report.top_contributions(prediction: SynDEEnergyPrediction, limit: int = 8) → list[tuple[str, float]][source]

Return the largest-magnitude nonzero connectivity terms.

Parameters:
  • prediction (SynDEEnergyPrediction) – Prediction whose connectivity block is inspected.

  • limit (int) – Maximum number of terms returned.

Returns:

Term name and signed contribution pairs, largest magnitude first.

Return type:

list[tuple[str, float]]

Dependency-free terminal rendering primitives shared by the CLI and reprs.

The helpers here deliberately avoid third-party console libraries so that the default install stays lean. They emit plain ASCII plus optional ANSI colour, and every function is pure so the same output can be asserted in tests.

class synde.formatting.Palette(enabled: bool = False)[source]

Bases: object

Apply or suppress ANSI styling behind a single switch.

Parameters:

enabled (bool) – Emit ANSI escape sequences when true.

classmethod automatic(stream: IO[str] | None = None) → Palette[source]

Build a palette that respects the stream and the environment.

Parameters:

stream (IO[str] | None) – Output stream inspected for terminal attachment.

Returns:

Palette enabled only for a colour-capable interactive stream.

Return type:

Palette

synde.formatting.format_float(value: Any, precision: int = 4, *, signed: bool = False) → str[source]

Format a number for column display, tolerating non-numeric input.

Parameters:
  • value (Any) – Value to render.

  • precision (int) – Digits kept after the decimal point.

  • signed (bool) – Always write an explicit + or - sign.

Returns:

Fixed-point text, or str(value) when not a real number.

Return type:

str

synde.formatting.indent_block(text: str, prefix: str = '  ') → str[source]

Prefix every line of a block of text.

Parameters:
  • text (str) – Block to indent.

  • prefix (str) – Prefix applied to each line.

Returns:

Indented block without a trailing newline.

Return type:

str

synde.formatting.render_bar(value: float, scale: float, width: int = 12) → str[source]

Draw a signed magnitude bar that grows left or right from a centre.

Parameters:
  • value (float) – Signed magnitude to display.

  • scale (float) – Absolute value mapped to a full half-width bar.

  • width (int) – Total character width, split evenly around the centre.

Returns:

Fixed-width bar text.

Return type:

str

synde.formatting.render_fields(pairs: Iterable[tuple[str, str]], *, palette: Palette | None = None, indent: str = '') → str[source]

Render aligned label  value lines.

Parameters:
  • pairs (Iterable[tuple[str, str]]) – Label and value text pairs, rendered in order.

  • palette (Palette | None) – Styling switch applied to each label.

  • indent (str) – Prefix written before every rendered line.

Returns:

Multi-line text without a trailing newline.

Return type:

str

synde.formatting.render_rule(width: int, *, palette: Palette | None = None, indent: str = '') → str[source]

Render a horizontal rule.

Parameters:
  • width (int) – Rule length in characters.

  • palette (Palette | None) – Styling switch applied to the rule.

  • indent (str) – Prefix written before the rule.

Returns:

Single line of rule characters.

Return type:

str

synde.formatting.render_table(headers: Sequence[str], rows: Sequence[Sequence[str]], *, aligns: Sequence[str] | None = None, max_widths: Sequence[int] | None = None, palette: Palette | None = None, indent: str = '') → str[source]

Render a fixed-width text table with a ruled header.

Parameters:
  • headers (Sequence[str]) – Column titles.

  • rows (Sequence[Sequence[str]]) – Row cells already converted to text.

  • aligns (Sequence[str] | None) – Per-column alignment, "l" or "r".

  • max_widths (Sequence[int] | None) – Per-column truncation limits; zero means unlimited.

  • palette (Palette | None) – Styling switch applied to the header row.

  • indent (str) – Prefix written before every rendered line.

Returns:

Multi-line table text without a trailing newline.

Return type:

str

synde.formatting.supports_color(stream: IO[str]) → bool[source]

Report whether coloured output is appropriate for one stream.

Honours the NO_COLOR and FORCE_COLOR conventions before falling back to interactive-terminal detection.

Parameters:

stream (IO[str]) – Output stream to inspect.

Returns:

True when ANSI escapes should be written to the stream.

Return type:

bool

synde.formatting.terminal_width(default: int = 100) → int[source]

Return the rendering width for the active terminal.

Parameters:

default (int) – Width used when the terminal size cannot be determined.

Returns:

Column count clamped to a legible range.

Return type:

int

synde.formatting.truncate(text: str, width: int) → str[source]

Shorten text to a maximum width using a trailing ellipsis.

Parameters:
  • text (str) – Text to shorten.

  • width (int) – Maximum number of characters permitted.

Returns:

Text no longer than width characters.

Return type:

str

External refinement

class synde.energy.SynDEEnergyRefiner(base: SynDEEnergyPredictor, *, alpha: float = 10.0, refine_intercept: bool = True, refine_composition: bool = True, refine_connectivity: bool = True)[source]

Bases: object

Refine selected weights while shrinking changes toward a base artifact.

The fit minimizes squared residual error plus alpha times the squared standardized change from the supplied predictor. It returns a new predictor and never mutates the validated base artifact.

fit(records: Iterable[EnergyRefinementRecord], *, dataset_name: str) → tuple[SynDEEnergyPredictor, EnergyRefinementReport][source]

Fit coefficient adjustments to an external labeled dataset.

Parameters:
  • records – Structures and reference energies in base-model units.

  • dataset_name – Human-readable external dataset identifier.

Returns:

New unvalidated predictor and its refinement report.

class synde.energy.EnergyRefinementRecord(identifier: str, graph: NormalizedMolecularGraph, target: float, provenance: dict[str, ~typing.Any]=<factory>)[source]

Bases: object

One externally supplied structure and reference energy.

classmethod from_smiles(identifier: str, smiles: str, target: float, provenance: dict[str, Any] | None = None) → EnergyRefinementRecord[source]

Build a refinement record directly from SMILES.

Parameters:
  • identifier – Stable identifier for the external observation.

  • smiles – Molecular structure encoded as SMILES.

  • target – Reference energy in the base predictor’s units.

  • provenance – Optional source metadata retained by the caller.

Returns:

Normalized refinement record.

graph: NormalizedMolecularGraph
identifier: str
provenance: dict[str, Any]
target: float
class synde.energy.EnergyRefinementReport(dataset_name: str, dataset_sha256: str, record_count: int, formula_groups: int, alpha: float, refined_blocks: tuple[str, ...], baseline_metrics: dict[str, float], refined_metrics: dict[str, float], coefficient_l2_shift: float, validation_status: str = 'external refinement fitted; independent validation required')[source]

Bases: object

Diagnostics and provenance for one external refinement.

alpha: float
baseline_metrics: dict[str, float]
coefficient_l2_shift: float
dataset_name: str
dataset_sha256: str
formula_groups: int
record_count: int
refined_blocks: tuple[str, ...]
refined_metrics: dict[str, float]
to_dict() → dict[str, Any][source]

Return a JSON-serializable report.

validation_status: str = 'external refinement fitted; independent validation required'

Compatibility ranking scorer

class synde.energy.SynDEScorer(*, card: SynDEModelCard, weights: dict[str, float], feature_scales: dict[str, float], training_distance_q99: float, validation: SynDEValidationRecord | None = None, model_sha256: str | None = None)[source]

Bases: object

Apply the externally validated SynDE score within one formula group.

CALIBRATION_ONLY_WARNING = 'SYNDE_CALIBRATION_ONLY_NO_VALIDATION_RECORD'
DISTANCE_WARNING = 'SYNDE_OUTSIDE_TRAINING_Q99_FEATURE_DISTANCE'
property externally_validated: bool

Whether a matching leakage-free external-validation record was loaded.

features(normalized: NormalizedMolecularGraph) → dict[str, float][source]

Return the fixed named two-dimensional feature library.

classmethod load(model_path: Path, validation_path: Path | None = None) → SynDEScorer[source]

Load a model and, optionally, its matching validation record.

classmethod load_default() → SynDEScorer[source]

Load the packaged frozen model with its successful validation record.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Score one graph without claiming cross-formula comparability.

score_group(candidates: list[NormalizedMolecularGraph]) → list[MoleculeScoreResult][source]

Score one formula group and attach descriptive distance warnings.

to_dict() → dict[str, object][source]

Serialize the calibration artifact without rewriting its frozen card.

class synde.energy.SynDEModelCard(model_name: str, status_at_freeze: str, target: str, rdkit_generation_version: str, xtb_generation_version: str, feature_definition_sha256: str, training_source: str, training_source_sha256: str, training_groups: int, training_molecules: int, selected_profile: str, selection_method: str, selection_alpha: float | None, refit_alpha: float, formula_centered: bool, uses_coordinates: bool, training_labels_previously_used_for_prior_model_evaluation: bool, external_validation_complete_at_freeze: bool, supported_elements: tuple[str, ...] = (), ordinary_explicit_hydrogen_policy: str = 'not_recorded', isotope_policy: str = 'not_recorded')[source]

Bases: object

Immutable calibration-time provenance stored with the equation.

external_validation_complete_at_freeze: bool
feature_definition_sha256: str
formula_centered: bool
classmethod from_dict(payload: dict[str, Any]) → SynDEModelCard[source]

Translate the immutable artifact’s historical field names.

isotope_policy: str = 'not_recorded'
model_name: str
ordinary_explicit_hydrogen_policy: str = 'not_recorded'
rdkit_generation_version: str
refit_alpha: float
selected_profile: str
selection_alpha: float | None
selection_method: str
status_at_freeze: str
supported_elements: tuple[str, ...] = ()
target: str
training_groups: int
training_labels_previously_used_for_prior_model_evaluation: bool
training_molecules: int
training_source: str
training_source_sha256: str
uses_coordinates: bool
xtb_generation_version: str
class synde.energy.SynDEValidationRecord(protocol: str, executed_on: str, model_sha256: str, external_formula_and_graph_disjoint: bool, external_groups: int, external_molecules: int, group_scoreability: float, mean_group_pearson: float, mean_group_spearman: float, mean_pairwise_concordance: float, top1_accuracy: float, external_labels_used_for_fit_or_tuning: bool, post_external_model_revision: bool, all_prespecified_external_performance_criteria_met: bool, claim_boundary: str)[source]

Bases: object

Post-freeze external validation attached to the immutable equation.

all_prespecified_external_performance_criteria_met: bool
claim_boundary: str
property confirms_model: bool

Return whether the record is valid external evidence for this model.

External evaluation remains valid evidence when a prespecified performance threshold is missed; acceptance outcomes are retained in all_prespecified_external_performance_criteria_met rather than being used to hide the evaluation record.

executed_on: str
external_formula_and_graph_disjoint: bool
external_groups: int
external_labels_used_for_fit_or_tuning: bool
external_molecules: int
classmethod from_dict(payload: dict[str, Any]) → SynDEValidationRecord[source]
group_scoreability: float
mean_group_pearson: float
mean_group_spearman: float
mean_pairwise_concordance: float
model_sha256: str
post_external_model_revision: bool
protocol: str
top1_accuracy: float
class synde.energy.MoleculeScoreResult(status: 'str', score: 'float | None', units: 'str', components: 'dict[str, float]', descriptors: 'dict[str, Any]', warnings: 'tuple[str, ...]', provenance: 'dict[str, Any]')[source]

Bases: object

components: dict[str, float]
descriptors: dict[str, Any]
provenance: dict[str, Any]
score: float | None
status: str
to_dict() → dict[str, Any][source]
units: str
warnings: tuple[str, ...]

Advanced graph-scoring components

The symbols below support descriptor inspection, reaction scoring, geometry comparison, and model-development workflows. SynDEEnergyPredictor is the main inference interface; SynDEScorer preserves compatibility with the original connectivity-validation artifact.

Graph-derived molecular and reaction scoring, in explicit model units.

Public names resolve lazily: importing this package costs almost nothing, and each submodule loads only when a symbol it defines is first accessed.

class synde.energy.CalibratedPrediction(value: 'float', units: 'str', target: 'str', uncertainty: 'float | None', applicability: 'float', model_card: 'ModelCard')[source]

Bases: object

applicability: float
model_card: ModelCard
target: str
uncertainty: float | None
units: str
value: float
class synde.energy.CalibrationRecord(identifier: 'str', features: 'dict[str, float]', target: 'float', provenance: 'dict[str, Any]')[source]

Bases: object

features: dict[str, float]
identifier: str
provenance: dict[str, Any]
target: float
class synde.energy.EmpiricalTwoDEnergyConfig(parameter_set: str = 'empirical-2d-joback-huckel-v1-development', huckel_resonance_integral_kj_mol: float = 75.0, cyclopropane_strain_kj_mol: float = 115.0, cyclobutane_strain_kj_mol: float = 110.0, cyclopropene_extra_strain_kj_mol: float = 55.0, cyclobutene_extra_strain_kj_mol: float = 25.0, bridgehead_alkene_strain_kj_mol: float = 50.0, formal_charge_hardness_scale_kj_mol: float = 9.6485)[source]

Bases: object

Externally fixed scales for the graph-only empirical score.

huckel_resonance_integral_kj_mol is the conventional 17–20 kcal/mol magnitude inferred from hydrocarbon thermochemistry, represented here by the round value 75 kJ/mol. Joback group increments and its 68.29 kJ/mol reference offset are used verbatim by thermo.

bridgehead_alkene_strain_kj_mol: float = 50.0
cyclobutane_strain_kj_mol: float = 110.0
cyclobutene_extra_strain_kj_mol: float = 25.0
cyclopropane_strain_kj_mol: float = 115.0
cyclopropene_extra_strain_kj_mol: float = 55.0
formal_charge_hardness_scale_kj_mol: float = 9.6485
huckel_resonance_integral_kj_mol: float = 75.0
parameter_set: str = 'empirical-2d-joback-huckel-v1-development'
class synde.energy.EmpiricalTwoDEnergyScorer(config: EmpiricalTwoDEnergyConfig | None = None)[source]

Bases: object

Score a graph with named conventional empirical chemistry terms.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return a graph-only empirical score in a documented kJ/mol scale.

class synde.energy.FirstOrderTwoDEnergyConfig(parameter_set: str = 'first-order-2d-empirical-v1-frozen', huckel_resonance_integral_kj_mol: float = 75.0, hyperconjugation_per_alkyl_substituent_kj_mol: float = 6.0, protobranching_per_excess_13_contact_kj_mol: float = 8.0, carbon_graph_energy_scale_kj_mol: float = 8.0, carbon_wiener_scale_kj_mol: float = 8.0, rigid_intramolecular_hbond_kj_mol: float = 20.0, cyclopropane_strain_kj_mol: float = 115.0, cyclobutane_strain_kj_mol: float = 110.0, cyclopropene_extra_strain_kj_mol: float = 55.0, cyclobutene_extra_strain_kj_mol: float = 25.0, bridgehead_alkene_strain_kj_mol: float = 50.0, formal_charge_hardness_scale_kj_mol: float = 9.6485, evaluate_traditional_huckel_sensitivity: bool = False)[source]

Bases: object

Fixed conventional constants for the first-order graph score.

bridgehead_alkene_strain_kj_mol: float = 50.0
carbon_graph_energy_scale_kj_mol: float = 8.0
carbon_wiener_scale_kj_mol: float = 8.0
cyclobutane_strain_kj_mol: float = 110.0
cyclobutene_extra_strain_kj_mol: float = 25.0
cyclopropane_strain_kj_mol: float = 115.0
cyclopropene_extra_strain_kj_mol: float = 55.0
evaluate_traditional_huckel_sensitivity: bool = False
formal_charge_hardness_scale_kj_mol: float = 9.6485
huckel_resonance_integral_kj_mol: float = 75.0
hyperconjugation_per_alkyl_substituent_kj_mol: float = 6.0
parameter_set: str = 'first-order-2d-empirical-v1-frozen'
protobranching_per_excess_13_contact_kj_mol: float = 8.0
rigid_intramolecular_hbond_kj_mol: float = 20.0
class synde.energy.FirstOrderTwoDEnergyScorer(config: FirstOrderTwoDEnergyConfig | None = None)[source]

Bases: object

Evaluate named, non-overlapping first-order empirical graph terms.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]
class synde.energy.FormulaCalibrationRecord(identifier: str, formula_group: str, features: dict[str, float], target: float, provenance: dict[str, Any])[source]

Bases: object

One labeled 2D structure used for formula-relative calibration.

features: dict[str, float]
formula_group: str
identifier: str
provenance: dict[str, Any]
target: float
class synde.energy.FormulaRelativeEnsemble(models: Iterable[FormulaRelativeRidgeCalibrator], weights: Iterable[float] | None = None, *, model_name: str = 'synde-formula-relative-2d-ensemble')[source]

Bases: object

Average compatible formula-relative models using fixed explicit weights.

classmethod load(path: Path) → FormulaRelativeEnsemble[source]

Load a manifest whose member paths are relative to the manifest.

predict_graph_group(graphs: Iterable[NormalizedMolecularGraph], scorer: MoleculeScorer | None = None) → list[FormulaRelativeEnsemblePrediction][source]

Validate and predict one graph group with every member.

predict_group(features: Iterable[dict[str, float]]) → list[FormulaRelativeEnsemblePrediction][source]

Predict an already validated same-formula feature group.

predict_smiles_group(smiles: Iterable[str], scorer: MoleculeScorer | None = None) → list[FormulaRelativeEnsemblePrediction][source]

Build and predict a same-formula group directly from SMILES.

class synde.energy.FormulaRelativeEnsembleCard(model_name: str, target: str, units: str, weights: tuple[float, ...], member_profiles: tuple[str, ...], feature_schema: str, fitted_ensemble_weights: bool = False)[source]

Bases: object

Interpretation metadata for a fixed weighted ensemble.

feature_schema: str
fitted_ensemble_weights: bool = False
member_profiles: tuple[str, ...]
model_name: str
target: str
units: str
weights: tuple[float, ...]
class synde.energy.FormulaRelativeEnsemblePrediction(value: float, units: str, target: str, uncertainty: None, applicability: float, feature_distance: float, comparable_within_formula_only: bool, member_predictions: tuple[FormulaRelativePrediction, ...], model_card: FormulaRelativeEnsembleCard)[source]

Bases: object

One conservative aggregate plus its inspectable member predictions.

applicability: float
comparable_within_formula_only: bool
feature_distance: float
member_predictions: tuple[FormulaRelativePrediction, ...]
model_card: FormulaRelativeEnsembleCard
target: str
uncertainty: None
units: str
value: float
class synde.energy.FormulaRelativeModelCard(model_name: str, target: str, units: str, feature_names: tuple[str, ...], ridge_alpha: float, training_count: int, training_groups: int, centered_within_formula: bool = True, geometry_features: bool = False, feature_schema: str = 'synde-2d-features-v2', feature_profile: str = 'custom', selection_objective: str = 'unspecified', uncertainty_kind: str = 'training_residual_rmse', version: str = '1')[source]

Bases: object

Metadata needed to interpret a formula-relative model.

centered_within_formula: bool = True
feature_names: tuple[str, ...]
feature_profile: str = 'custom'
feature_schema: str = 'synde-2d-features-v2'
geometry_features: bool = False
model_name: str
ridge_alpha: float
selection_objective: str = 'unspecified'
target: str
training_count: int
training_groups: int
uncertainty_kind: str = 'training_residual_rmse'
units: str
version: str = '1'
class synde.energy.FormulaRelativePrediction(value: float, units: str, target: str, uncertainty: float | None, applicability: float, feature_distance: float, comparable_within_formula_only: bool, model_card: FormulaRelativeModelCard)[source]

Bases: object

A calibrated value that is comparable only within one formula group.

applicability: float
comparable_within_formula_only: bool
feature_distance: float
model_card: FormulaRelativeModelCard
target: str
uncertainty: float | None
units: str
value: float
class synde.energy.FormulaRelativeRidgeCalibrator(*, alpha: float = 1.0, target: str = 'formula-relative energy', units: str = 'target units', feature_profile: str = 'custom', selection_objective: str = 'unspecified')[source]

Bases: object

Transparent ridge model fitted to within-formula energy differences.

active: ndarray | None
card: FormulaRelativeModelCard | None
feature_names: tuple[str, ...]
fit(records: Iterable[FormulaCalibrationRecord]) → FormulaRelativeModelCard[source]

Fit after centering features and labels within every formula group.

classmethod load(path: Path) → FormulaRelativeRidgeCalibrator[source]

Load a model written by save().

mean: ndarray | None
predict(features: dict[str, float]) → FormulaRelativePrediction[source]

Predict a ranking coordinate; compare only within the same formula.

predict_graph(graph: NormalizedMolecularGraph, scorer: MoleculeScorer | None = None) → FormulaRelativePrediction[source]

Build 2D features and predict directly from a normalized graph.

predict_graph_group(graphs: Iterable[NormalizedMolecularGraph], scorer: MoleculeScorer | None = None) → list[FormulaRelativePrediction][source]

Predict and zero-center graphs after enforcing formula/charge equality.

predict_group(features: Iterable[dict[str, float]]) → list[FormulaRelativePrediction][source]

Center one formula group’s features before prediction and distance.

predict_smiles_group(smiles: Iterable[str], scorer: MoleculeScorer | None = None) → list[FormulaRelativePrediction][source]

Build, validate, and predict a same-formula group directly from SMILES.

residual_std: float | None
save(path: Path) → None[source]

Save all coefficients and interpretation metadata as JSON.

scale: ndarray | None
weights: ndarray | None
class synde.energy.GFN2SinglePointConfig(method: str = 'GFN2-xTB', embedding_method: str = 'ETKDGv3', seed_namespace: str = 'synde-gfn2-singlepoint-mmff-v1', preopt_max_iterations: int = 500, scf_max_iterations: int = 250, accuracy: float = 1.0)[source]

Bases: object

Frozen, unfitted protocol for deterministic GFN2-xTB scoring.

accuracy: float = 1.0
embedding_method: str = 'ETKDGv3'
method: str = 'GFN2-xTB'
preopt_max_iterations: int = 500
scf_max_iterations: int = 250
seed_namespace: str = 'synde-gfn2-singlepoint-mmff-v1'
class synde.energy.GFN2SinglePointScorer(config: GFN2SinglePointConfig | None = None)[source]

Bases: object

Run gas-phase closed-shell GFN2-xTB on a deterministic 3D conformer.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return an actual semiempirical energy in eV without target fitting.

class synde.energy.GFN2TwoCycleConfig(executable: str | None = None, parameter_file: str | Path | None = None, embedding_method: str = 'ETKDGv3', seed_namespace: str = 'synde-gfn2-two-cycle-mmff-v1', preopt_max_iterations: int = 500, timeout_seconds: int = 60)[source]

Bases: object

Frozen, zero-fit protocol selected using development groups only.

embedding_method: str = 'ETKDGv3'
executable: str | None = None
parameter_file: str | Path | None = None
preopt_max_iterations: int = 500
seed_namespace: str = 'synde-gfn2-two-cycle-mmff-v1'
timeout_seconds: int = 60
class synde.energy.GFN2TwoCycleScorer(config: GFN2TwoCycleConfig | None = None)[source]

Bases: object

Evaluate the additive two-cycle SCC plus pair-repulsion score.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return the uncalibrated two-term score in eV.

class synde.energy.GFN2XTBProxyConfig(parameter_set: str = 'gfn2-xtb-valence-reference-plus-synde-2d-v1')[source]

Bases: object

Fixed settings for the uncalibrated total-energy proxy.

parameter_set: str = 'gfn2-xtb-valence-reference-plus-synde-2d-v1'
class synde.energy.GFN2XTBProxyScorer(config: GFN2XTBProxyConfig | None = None, base_scorer: MoleculeScorer | None = None)[source]

Bases: object

Estimate a raw GFN2-xTB-like molecular energy without fitted weights.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return an eV-like proxy, or an explicit unsupported-element result.

class synde.energy.GraphEnergy[source]

Bases: object

rank_pairs_from_smiles(smiles: str, *, top_k: int = 50)[source]
score_its(reaction_smiles: str, *, config: ITSScoringConfig | None = None)[source]

Return mapped reaction-centre feasibility terms in graph score units.

score_molecule_empirical_two_d_from_graph(graph)[source]

Score a labeled graph without coordinates or learned coefficients.

score_molecule_empirical_two_d_from_smiles(smiles: str)[source]

Score with the interpretable Joback–Hückel graph-only ledger.

score_molecule_first_order_two_d_from_graph(graph)[source]

Score a labeled graph using only fixed empirical 2D terms.

score_molecule_first_order_two_d_from_smiles(smiles: str)[source]

Score with the first-order average-bond/Hückel graph ledger.

score_molecule_from_graph(graph)[source]
score_molecule_from_smiles(smiles: str)[source]
score_molecule_gfn2_from_graph(graph)[source]

Run GFN2-xTB for a labeled molecular graph.

score_molecule_gfn2_from_smiles(smiles: str)[source]

Run an uncalibrated GFN2-xTB single point on deterministic geometry.

score_molecule_gfn2_two_cycle_from_graph(graph)[source]

Evaluate the frozen two-term score for a labeled molecular graph.

score_molecule_gfn2_two_cycle_from_smiles(smiles: str)[source]

Evaluate the frozen two-cycle SCC plus explicit repulsion score.

score_molecule_graph_theory_from_graph(graph)[source]

Score a graph after excluding geometry-dependent coarse terms.

score_molecule_graph_theory_from_smiles(smiles: str)[source]

Score with the reduced graph-only v2 development candidate.

score_molecule_orbital_theory_from_graph(graph)[source]

Score a graph with the experimental orbital-level pi model.

score_molecule_orbital_theory_from_smiles(smiles: str)[source]

Score with the experimental donor/triple/cumulene orbital model.

score_molecule_theory_from_graph(graph)[source]

Score a NetworkX graph with the enhanced uncalibrated heuristic.

score_molecule_theory_from_smiles(smiles: str)[source]

Score with the enhanced, still-unfitted theory-guided heuristic.

score_molecule_valence_from_graph(graph)[source]

Score a labeled molecular graph with the valence decomposition.

score_molecule_valence_from_smiles(smiles: str)[source]

Score with the conventional non-overlapping valence decomposition.

score_molecule_with_geometry(smiles: str, *, config: GeometryScoringConfig | None = None, score_margin: float | None = None)[source]
score_molecule_xtb_proxy_from_graph(graph)[source]

Estimate the raw xTB-like proxy from a labeled molecular graph.

score_molecule_xtb_proxy_from_smiles(smiles: str)[source]

Estimate a raw GFN2-xTB-like total energy without running xTB.

score_reaction(reaction_smiles: str)[source]
class synde.energy.GraphTheoryEnergyConfig(parameter_set: str = 'theory-organic-v2-graph-development', excluded_components: tuple[str, ...] = ('ring_strain', 'steric_congestion'))[source]

Bases: object

Configuration for the reduced graph-only theory candidate.

excluded_components: tuple[str, ...] = ('ring_strain', 'steric_congestion')
parameter_set: str = 'theory-organic-v2-graph-development'
class synde.energy.GraphTheoryEnergyScorer(config: GraphTheoryEnergyConfig | None = None, base_scorer: MoleculeScorer | None = None)[source]

Bases: object

Exclude terms whose values cannot be resolved reliably without geometry.

The scorer retains the frozen v1 chemistry decomposition but sets its cycle-basis ring-strain and degree-only steric terms to zero. No coefficient is fitted: development data is used only for this discrete term-inclusion decision.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return the v2 development score while preserving frozen v1.

class synde.energy.ITSScoreResult(status: str, its_score: float | None, state_delta_score: float | None, units: str, components: dict[str, float], bond_changes: tuple[dict[str, Any], ...], reacting_atom_maps: tuple[int, ...], warnings: tuple[str, ...], provenance: dict[str, Any], its_graph: Any | None = None)[source]

Bases: object

Mapped reaction-centre feasibility result; not a physical TS energy.

bond_changes: tuple[dict[str, Any], ...]
components: dict[str, float]
its_graph: Any | None = None
its_score: float | None
provenance: dict[str, Any]
reacting_atom_maps: tuple[int, ...]
state_delta_score: float | None
status: str
to_dict() → dict[str, Any][source]
units: str
warnings: tuple[str, ...]
class synde.energy.ITSScorer(molecule_scorer: MoleculeScorer | None = None, pair_scorer: GraphPairScorer | None = None, config: ITSScoringConfig | None = None)[source]

Bases: object

Score mapped graph edits and actual formed-bond interaction descriptors.

Lower values indicate a more favourable initial heuristic. The score is a reaction-ranking feature, never an asserted transition-state energy.

score(reactants: list[NormalizedMolecularGraph], products: list[NormalizedMolecularGraph], reaction_smiles: str, *, native_its=None) → ITSScoreResult[source]
class synde.energy.ITSScoringConfig(state_delta_weight: float = 1.0, formed_bond_weight: float = 1.0, broken_bond_weight: float = 1.0, order_change_weight: float = 0.5, valence_reorganization_weight: float = 0.1, aromaticity_reorganization_weight: float = 0.2, fmo_weight: float = 1.0, hsab_weight: float = 0.25, charge_weight: float = 0.05)[source]

Bases: object

Initial transparent weights for the barrier-like ITS heuristic.

aromaticity_reorganization_weight: float = 0.2
broken_bond_weight: float = 1.0
charge_weight: float = 0.05
fmo_weight: float = 1.0
formed_bond_weight: float = 1.0
hsab_weight: float = 0.25
order_change_weight: float = 0.5
state_delta_weight: float = 1.0
valence_reorganization_weight: float = 0.1
class synde.energy.InterpretableTwoDV2Config(parameter_set: str = 'interpretable-2d-v2-uncalibrated-development', cyclopentane_strain_kj_mol: float = 26.0, cycloheptane_strain_kj_mol: float = 26.0, cyclooctane_strain_kj_mol: float = 40.0, cyclononane_strain_kj_mol: float = 54.0, cyclodecane_strain_kj_mol: float = 52.0)[source]

Bases: object

Chemistry-fixed increments for the uncalibrated v2 candidate.

cyclodecane_strain_kj_mol: float = 52.0
cycloheptane_strain_kj_mol: float = 26.0
cyclononane_strain_kj_mol: float = 54.0
cyclooctane_strain_kj_mol: float = 40.0
cyclopentane_strain_kj_mol: float = 26.0
parameter_set: str = 'interpretable-2d-v2-uncalibrated-development'
class synde.energy.InterpretableTwoDV2Scorer(config: InterpretableTwoDV2Config | None = None)[source]

Bases: object

Uncalibrated v2 score with chemistry-fixed additions to frozen v1.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]
class synde.energy.ModelCard(model_name: 'str', target: 'str', units: 'str', feature_names: 'tuple[str, ...]', ridge_alpha: 'float', metrics: 'dict[str, float]', training_count: 'int', version: 'str' = '1')[source]

Bases: object

feature_names: tuple[str, ...]
metrics: dict[str, float]
model_name: str
ridge_alpha: float
target: str
training_count: int
units: str
version: str = '1'
class synde.energy.MoleculeScorer(config: MoleculeScoringConfig | None = None, parameters: HuckelParameters | None = None)[source]

Bases: object

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]
class synde.energy.MoleculeScoringConfig(two_d: 'TwoDEnergyConfig' = <factory>)[source]

Bases: object

two_d: TwoDEnergyConfig
class synde.energy.OrbitalTheoryEnergyScorer(config: TheoryEnergyConfig | None = None, base_scorer: MoleculeScorer | None = None, huckel_parameters: HuckelParameters | None = None)[source]

Bases: object

Use explicit donor/triple/cumulene orbitals without ORD calibration.

score(graph: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return an experimental score while preserving the stable base scorer.

class synde.energy.QuantumGraphV3ModelCard(model_name: str, status: str, target: str, feature_definition_sha256: str, training_groups: int, training_molecules: int, admitted_v3_families: tuple[str, ...], selection_method: str, selection_alpha: float, refit_alpha: float, formula_centered: bool, uses_coordinates: bool, spent_v2_holdout_loaded: bool, external_validation_complete: bool)[source]

Bases: object

Metadata that prevents a development candidate being mistaken for a freeze.

admitted_v3_families: tuple[str, ...]
external_validation_complete: bool
feature_definition_sha256: str
formula_centered: bool
model_name: str
refit_alpha: float
selection_alpha: float
selection_method: str
spent_v2_holdout_loaded: bool
status: str
target: str
training_groups: int
training_molecules: int
uses_coordinates: bool
class synde.energy.QuantumGraphV3Scorer(*, card: QuantumGraphV3ModelCard, weights: dict[str, float])[source]

Bases: object

Apply the v2+v3 linear graph score.

The returned coordinate has no absolute thermochemical meaning. Only score differences inside one formula/formal-charge group are in scope.

features(normalized: NormalizedMolecularGraph) → dict[str, float][source]

Return the combined named v2 and fixed v3 graph coordinates.

classmethod load(path: Path) → QuantumGraphV3Scorer[source]
score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]
score_group(candidates: list[NormalizedMolecularGraph]) → list[MoleculeScoreResult][source]

Score one formula/formal-charge group without implying absolutes.

to_dict() → dict[str, object][source]
class synde.energy.ReactionScoreResult(status: 'str', reaction_delta_score: 'float | None', units: 'str', reactant_score: 'float | None', product_score: 'float | None', bond_changes: 'tuple[dict[str, Any], ...]', components: 'dict[str, float]', warnings: 'tuple[str, ...]', provenance: 'dict[str, Any]')[source]

Bases: object

bond_changes: tuple[dict[str, Any], ...]
components: dict[str, float]
product_score: float | None
provenance: dict[str, Any]
reactant_score: float | None
reaction_delta_score: float | None
status: str
to_dict() → dict[str, Any][source]
units: str
warnings: tuple[str, ...]
class synde.energy.ReactionScorer(molecule_scorer: MoleculeScorer | None = None, config: ReactionScoringConfig | None = None)[source]

Bases: object

score(reactants: list[NormalizedMolecularGraph], products: list[NormalizedMolecularGraph], reaction_smiles: str) → ReactionScoreResult[source]
class synde.energy.ReactionScoringConfig(require_atom_mapping: 'bool' = True)[source]

Bases: object

require_atom_mapping: bool = True
class synde.energy.RidgeCalibrator(*, alpha: float = 1e-06, target: str, units: str = 'kcal/mol')[source]

Bases: object

NumPy-only ridge baseline; suitable for transparent first calibration.

card: ModelCard | None
feature_names: tuple[str, ...]
fit(records: Iterable[CalibrationRecord]) → ModelCard[source]
mean: ndarray | None
predict(features: dict[str, float]) → CalibratedPrediction[source]
residual_std: float | None
save(path: Path) → None[source]
scale: ndarray | None
weights: ndarray | None
class synde.energy.SparseInterpretableTwoDModelCard(model_name: str, target: str, units: str, feature_schema: str, feature_profile: str, training_groups: int, training_molecules: int, selection_method: str, selection_alpha: float, selection_l1_ratio: float, selection_folds: int, minimum_selection_frequency: int, refit_method: str, refit_alpha: float, formula_centered_training: bool, uses_coordinates: bool, calibrated: bool, fitted_coefficients: bool, version: str = 'development-v1')[source]

Bases: object

Metadata needed to interpret a fitted sparse 2D equation.

calibrated: bool
feature_profile: str
feature_schema: str
fitted_coefficients: bool
formula_centered_training: bool
minimum_selection_frequency: int
model_name: str
refit_alpha: float
refit_method: str
selection_alpha: float
selection_folds: int
selection_l1_ratio: float
selection_method: str
target: str
training_groups: int
training_molecules: int
units: str
uses_coordinates: bool
version: str = 'development-v1'
class synde.energy.SparseInterpretableTwoDScorer(*, card: SparseInterpretableTwoDModelCard, weights: dict[str, float], training_scale: dict[str, float], residual_std: float | None = None, development_metrics: dict[str, float] | None = None, applicability: dict[str, Any] | None = None)[source]

Bases: object

Apply a saved linear equation over human-readable graph terms.

The raw coordinate is meaningful only for differences among molecules with the same formula and formal charge. Group centering is unnecessary for ranking because it changes every member by the same constant.

classmethod load(path: Path) → SparseInterpretableTwoDScorer[source]
score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]
score_group(candidates: list[NormalizedMolecularGraph]) → list[MoleculeScoreResult][source]

Score one formula/charge group and attach centered OOD distances.

to_dict() → dict[str, Any][source]
class synde.energy.TheoryEnergyConfig(parameter_set: str = 'theory-organic-v1-frozen', amide_resonance_reward: float = 0.7, ester_resonance_reward: float = 0.45, thioester_resonance_reward: float = 0.35, aryl_amine_resonance_reward: float = 0.25, aryl_oxygen_resonance_reward: float = 0.12, alkene_substituent_reward: float = 0.06, three_ring_alkene_penalty: float = 0.55, four_ring_alkene_penalty: float = 0.25, bridgehead_alkene_penalty: float = 0.5, carbonyl_pi_correction: float = 1.25, imine_pi_correction: float = 0.75, nitrogen_pi_correction: float = 0.3, nitrogen_oxygen_pi_correction: float = 1.5, oxygen_pi_correction: float = 1.25, thiocarbonyl_pi_correction: float = 0.4, amidine_resonance_reward: float = 0.55, sulfonamide_resonance_reward: float = 0.5, sulfonate_resonance_reward: float = 0.3, nitro_resonance_reward: float = 0.45)[source]

Bases: object

Fixed theory-derived corrections in existing heuristic score units.

alkene_substituent_reward: float = 0.06
amide_resonance_reward: float = 0.7
amidine_resonance_reward: float = 0.55
aryl_amine_resonance_reward: float = 0.25
aryl_oxygen_resonance_reward: float = 0.12
bridgehead_alkene_penalty: float = 0.5
carbonyl_pi_correction: float = 1.25
ester_resonance_reward: float = 0.45
four_ring_alkene_penalty: float = 0.25
imine_pi_correction: float = 0.75
nitro_resonance_reward: float = 0.45
nitrogen_oxygen_pi_correction: float = 1.5
nitrogen_pi_correction: float = 0.3
oxygen_pi_correction: float = 1.25
parameter_set: str = 'theory-organic-v1-frozen'
sulfonamide_resonance_reward: float = 0.5
sulfonate_resonance_reward: float = 0.3
thiocarbonyl_pi_correction: float = 0.4
thioester_resonance_reward: float = 0.35
three_ring_alkene_penalty: float = 0.55
class synde.energy.TheoryEnergyScorer(config: TheoryEnergyConfig | None = None, base_scorer: MoleculeScorer | None = None)[source]

Bases: object

Base uncalibrated heuristic plus fixed missing-chemistry corrections.

score(graph: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return the enhanced fixed score without fitted coefficients.

class synde.energy.TwoDEnergyConfig(sigma_scale: float = 0.01, pi_weight: float = 1.33, aromatic_reward_per_atom: float = 0.0, antiaromatic_penalty_per_atom: float = 0.25, charge_magnitude_penalty: float = 0.5, charge_pair_weight: float = 0.2, fused_ring_penalty: float = 0.08, large_ring_penalty: float = 0.4, tertiary_branch_reward: float = 0.08, quaternary_branch_reward: float = 0.12, steric_branch_weight: float = 0.04, steric_bond_weight: float = 0.02)[source]

Bases: object

Explicit fixed constants for the uncalibrated 2D heuristic.

antiaromatic_penalty_per_atom: float = 0.25
aromatic_reward_per_atom: float = 0.0
charge_magnitude_penalty: float = 0.5
charge_pair_weight: float = 0.2
fused_ring_penalty: float = 0.08
large_ring_penalty: float = 0.4
pi_weight: float = 1.33
quaternary_branch_reward: float = 0.12
sigma_scale: float = 0.01
steric_bond_weight: float = 0.02
steric_branch_weight: float = 0.04
tertiary_branch_reward: float = 0.08
class synde.energy.TwoDFeatureConfig(atom_environment_bins: int = 128, bond_environment_bins: int = 128, extended_atom_environment_bins: int = 192, atom_environment_radius: int = 3, pair_environment_bins: int = 128, maximum_pair_distance: int = 4, ring_environment_bins: int = 64)[source]

Bases: object

Fixed dimensions for hashed local environment counts.

atom_environment_bins: int = 128
atom_environment_radius: int = 3
bond_environment_bins: int = 128
extended_atom_environment_bins: int = 192
maximum_pair_distance: int = 4
pair_environment_bins: int = 128
ring_environment_bins: int = 64
class synde.energy.V3FeatureDefinition(name: str, family: str, description: str, units: str = 'dimensionless_graph_descriptor')[source]

Bases: object

One preregistered v3 descriptor definition.

description: str
family: str
name: str
units: str = 'dimensionless_graph_descriptor'
class synde.energy.ValenceEnergyConfig(parameter_set: str = 'valence-2d-v1-development', pi_energy_scale: float = 1.33, polarization_bond_coupling: float = 1.0, charge_localization_scale: float = 0.1, protobranching_13_reward: float = 0.08, weights: ValenceEnergyWeights = <factory>)[source]

Bases: object

Fixed internal parameters for the experimental conventional scorer.

charge_localization_scale: float = 0.1
parameter_set: str = 'valence-2d-v1-development'
pi_energy_scale: float = 1.33
polarization_bond_coupling: float = 1.0
protobranching_13_reward: float = 0.08
weights: ValenceEnergyWeights
class synde.energy.ValenceEnergyScorer(config: ValenceEnergyConfig | None = None, base_scorer: MoleculeScorer | None = None, huckel_parameters: HuckelParameters | None = None)[source]

Bases: object

Score a molecule with explicit, non-overlapping valence-energy terms.

score(normalized: NormalizedMolecularGraph) → MoleculeScoreResult[source]

Return weighted contributions and retain raw terms for calibration.

class synde.energy.ValenceEnergyWeights(atom_reference: float = 1.0, lewis_sigma_reference: float = 1.0, lewis_local_pi_reference: float = 1.0, aromatic_pi_delocalization: float = 0.0, mixed_pi_delocalization: float = 0.0, acyclic_pi_delocalization: float = 0.0, carbonyl_n_lone_pair_delocalization: float = 0.0, imine_n_lone_pair_delocalization: float = 0.0, aryl_n_lone_pair_delocalization: float = 1.0, other_n_lone_pair_delocalization: float = 0.0, sulfonyl_n_lone_pair_delocalization: float = 0.0, oxygen_lone_pair_delocalization: float = 1.0, sulfur_lone_pair_delocalization: float = 1.0, mixed_n_lone_pair_delocalization: float = 0.0, mixed_element_lone_pair_delocalization: float = 1.0, hyperconjugation: float = 0.0, graph_polarization: float = 0.0, charge_localization: float = 1.0, protobranching: float = 1.0, hard_topology: float = 1.0, small_saturated_ring_strain: float = 1.0)[source]

Bases: object

Global weights; the uncalibrated conventional model uses all ones.

acyclic_pi_delocalization: float = 0.0
aromatic_pi_delocalization: float = 0.0
aryl_n_lone_pair_delocalization: float = 1.0
atom_reference: float = 1.0
carbonyl_n_lone_pair_delocalization: float = 0.0
charge_localization: float = 1.0
graph_polarization: float = 0.0
hard_topology: float = 1.0
hyperconjugation: float = 0.0
imine_n_lone_pair_delocalization: float = 0.0
lewis_local_pi_reference: float = 1.0
lewis_sigma_reference: float = 1.0
mixed_element_lone_pair_delocalization: float = 1.0
mixed_n_lone_pair_delocalization: float = 0.0
mixed_pi_delocalization: float = 0.0
other_n_lone_pair_delocalization: float = 0.0
oxygen_lone_pair_delocalization: float = 1.0
protobranching: float = 1.0
small_saturated_ring_strain: float = 1.0
sulfonyl_n_lone_pair_delocalization: float = 0.0
sulfur_lone_pair_delocalization: float = 1.0
synde.energy.deterministic_split(records: Iterable[CalibrationRecord], *, train_fraction: float = 0.8) → tuple[list[CalibrationRecord], list[CalibrationRecord]][source]
synde.energy.extract_heuristic_features(result: MoleculeScoreResult) → dict[str, float][source]

Return only named heuristic components for pure weight recalibration.

synde.energy.extract_named_empirical_two_d_features(normalized: NormalizedMolecularGraph, first_order_result: MoleculeScoreResult | None = None) → dict[str, float][source]

Return an unhashed, auditable empirical and chemical-graph vocabulary.

synde.energy.extract_quantum_graph_v3_features(normalized: NormalizedMolecularGraph) → dict[str, float][source]

Return the complete fixed 52-coordinate v3 descriptor vector.

Unsupported or absent substructures produce zeros. Any nonfinite intermediate is replaced by zero, so callers always receive the exact preregistered manifest in deterministic order.

synde.energy.extract_two_d_features(normalized: NormalizedMolecularGraph, result: MoleculeScoreResult, config: TwoDFeatureConfig | None = None) → dict[str, float][source]

Return geometry-free features suitable for an interpretable linear model.

synde.energy.molecular_composition(normalized: NormalizedMolecularGraph) → dict[str, int][source]

Return element counts including implicit hydrogens.

Explicit hydrogen nodes are counted directly. For the usual implicit-H graph, normalized total_hcount attributes supply the hydrogen count.

synde.energy.molecular_formula_charge_key(graph: NormalizedMolecularGraph) → str[source]

Return a deterministic Hill-formula and formal-charge comparison key.

synde.energy.theory_energy_corrections(graph: Graph, config: TheoryEnergyConfig | None = None) → dict[str, float][source]

Return separately inspectable, fixed higher-level chemistry terms.

synde.energy.two_d_energy_components(graph: Graph, assignment: PiAssignmentResult, huckel: GeneralizedHuckelResult, config: TwoDEnergyConfig | None = None) → dict[str, float][source]

Return separately inspectable fixed 2D molecular-energy terms.

synde.energy.uncalibrated_v2_additions(normalized: NormalizedMolecularGraph, base: MoleculeScoreResult, config: InterpretableTwoDV2Config | None = None) → dict[str, float][source]

Return the prespecified kJ/mol additions without rescoring v1.

synde.energy.v3_feature_family(name: str) → str[source]

Return the fixed family of a preregistered v3 term.

synde.energy.valence_energy_terms(normalized: NormalizedMolecularGraph, config: ValenceEnergyConfig | None = None, *, base_result: MoleculeScoreResult | None = None, huckel: GeneralizedHuckel | None = None) → tuple[dict[str, float], PiAssignmentResult][source]

Return raw conventional terms before any global weighting.

Geometry and workflow integrations

Optional conformer-aware scoring utilities.

class synde.geometry.GeometryScoreResult(status: 'str', geometry_corrected_score: 'float | None', force_field_energy_kcal_mol: 'float | None', components: 'dict[str, float]', warnings: 'tuple[str, ...]', provenance: 'dict[str, Any]')[source]

Bases: object

components: dict[str, float]
force_field_energy_kcal_mol: float | None
geometry_corrected_score: float | None
provenance: dict[str, Any]
status: str
to_dict() → dict[str, Any][source]
warnings: tuple[str, ...]
class synde.geometry.GeometryScorer(config: GeometryScoringConfig | None = None, molecule_scorer: MoleculeScorer | None = None)[source]

Bases: object

static nonbonded_terms_for_positions(graph, positions: dict[int, tuple[float, float, float]]) → dict[str, float][source]

Distance-term helper for deterministic tests and supplied poses.

score_smiles(smiles: str) → GeometryScoreResult[source]
should_run(normalized, *, score_margin: float | None = None) → bool[source]

Apply explicit user/uncertainty/flexibility gating without embedding.

class synde.geometry.GeometryScoringConfig(num_conformers: 'int | str' = 'auto', force_field: 'str' = 'MMFF94', random_seed: 'int' = 42, gate: 'str' = 'always')[source]

Bases: object

force_field: str = 'MMFF94'
gate: str = 'always'
num_conformers: int | str = 'auto'
random_seed: int = 42

Adapters joining SynDE graph scores to higher-level workflows.

class synde.integration.CascadeReport(rows: 'tuple[CascadeRow, ...]', shortlist_size: 'int', graph_seconds: 'float', xtb_seconds: 'float')[source]

Bases: object

graph_seconds: float
rows: tuple[CascadeRow, ...]
shortlist_size: int
xtb_seconds: float
class synde.integration.CascadeRow(reaction_smiles: 'str', graph_score: 'float | None', xtb_delta_e: 'float | None', selected: 'bool', status: 'str')[source]

Bases: object

graph_score: float | None
reaction_smiles: str
selected: bool
status: str
xtb_delta_e: float | None
class synde.integration.GraphXTBCascade(graph_energy: GraphEnergy | None = None)[source]

Bases: object

Use graph scores to choose reactions for a named xTB evaluator.

screen(reactions: list[str], *, top_k: int = 10, level: str = 'loose', xtb_evaluator: Callable[[str, str], float] | None = None) → CascadeReport[source]
class synde.integration.SFEnergy(energy_type: str = 'XTB', num_threads: int = 4, verbose: int = 0, random_seed: int = 42)[source]

Bases: object

sort_reactions(reactions: List[str], num_conformers: str = 'auto', embedding_method: str = 'ETKDGv3', random_coords_threshold: int = 100, force_field_method: str = 'MMFF94', max_iter: str = 'auto', sort: bool = True) → Tuple[List[str], List[float]][source]

Score reactions and optionally sort them by ascending energy.

Parameters:
  • reactions (List[str]) – Reaction SMILES strings.

  • num_conformers (str) – Conformer-count strategy.

  • embedding_method (str) – RDKit embedding method.

  • random_coords_threshold (int) – Atom-count threshold for random coordinates.

  • force_field_method (str) – Force-field energy method.

  • max_iter (str) – Maximum-iteration strategy.

  • sort (bool) – Whether to sort results by ascending energy.

Returns:

Reaction SMILES strings and corresponding energy values.

Return type:

Tuple[List[str], List[float]]