A modern Python package for global optimization of atomic clusters using ASE with Basin Hopping and Genetic Algorithms. Features clean code, comprehensive testing, and support for multiple energy calculators.
Project description
SCGO: Simple Cluster Global Optimization
A compact toolkit for global optimization of atomic clusters using ASE. SCGO provides a focused API for Basin Hopping (BH) and Genetic Algorithm (GA) workflows with practical defaults.
Documentation: Comprehensive API documentation is available in the docs/ directory. For online documentation, see ReadTheDocs.
Install
SCGO has a small core dependency set plus two mutually exclusive MLIP extras:
[mace]for MACE + TorchSim +nvalchemi-toolkit-ops[uma]forfairchem-coreUMA checkpoints
Install only one of [mace] or [uma] per environment.
From PyPI (recommended):
pip install "scgo[mace]" # or: pip install "scgo[uma]"
For development or editable installs from source, clone the repository and use pip install -e ".[mace]" (see installation docs).
Conda (full dev stack from source):
git clone https://github.com/rlaplaza-lab/scgo.git
cd scgo
conda env create -f environment.yml
conda activate scgo
environment.yml installs the package editable with [mace,dev] (MACE/TorchSim + test/lint tooling).
The conda env uses torch-sim-atomistic[mace] with nvalchemi-toolkit-ops for TorchSim neighbor lists. Do not install vesin or vesin-torch—they conflict with the TorchSim stack we use.
Note: SCGO requires SQLite with the JSON1 extension (for json_extract and related functions). If you installed using conda, ensure sqlite from conda-forge is available in your environment (e.g., conda install -c conda-forge sqlite). If you use pip-only installs, consider installing pysqlite3-binary (e.g., pip install pysqlite3-binary) so that the Python sqlite3 module exposes JSON1. This repository's CI enforces JSON1 availability.
Sella is not required by the core SCGO package and has been removed from the default pip constraints to avoid heavy native builds during dependency resolution. If you need Sella for advanced optimization features, install it manually (it builds C extensions and may require a C toolchain and Cython).
Editable install from source (alternative):
git clone https://github.com/rlaplaza-lab/scgo.git
cd scgo
pip install -e ".[mace]" # or: pip install -e ".[uma]"
For pip installs, the same TorchSim stack applies: ensure nvalchemi-toolkit-ops is available; uninstall vesin and vesin-torch if you see TorchSim-related errors.
Dependency note: SCGO now allows scipy>=1.14,<3 so the UMA/fairchem extra can resolve cleanly with torch-sim-atomistic[fairchem] (which constrains SciPy to <1.17 in current releases).
For development with tests and linting (after a runtime-only pip install -e .):
pip install -e ".[mace,dev]" # or UMA: pip install -e ".[uma,dev]"
pre-commit install
Running on HPC (Slurm, shared filesystem)
- SQLite: SCGO keeps WAL mode off by default (fewer
-wal/-shmissues on Lustre/GPFS/NFS). Prefer writing active*.dbfiles under job-local scratch ($SLURM_TMPDIRor site-specific scratch) when you can, then copying results back to project storage. - Parallel jobs: SCGO creates unique
run_<timestamp>_<microseconds>folders, so jobs sharing a parent output directory usually write different DB files. Lock contention is still possible if jobs touch the same*.db(for example, reused explicitrun_id/path) or if shared filesystems serialize lock files; for high parallelism, prefer one output directory per job. - Registry: Discovery may write
.scgo_db_registry.jsonand.scgo_db_registry.lock(withflockon Linux) for fast DB listing. When your run lives under a directory whose name ends in_searches, the index is kept at that parent only (not beside everytrial_*folder). If your filesystem does not honorflock, use separate output directories per job or avoid parallel registry updates. - Logging: Batch-friendly defaults suppress noisy third-party loggers. For local debugging, set
SCGO_LOCAL_DEV=1or callconfigure_logging(..., hpc_mode=False).
Documentation
Comprehensive documentation is available in the docs/ directory:
- Installation:
docs/source/installation.rst- Setup instructions for conda and pip - Quick Start:
docs/source/quickstart.rst- Basic usage examples and workflows - API Reference:
docs/source/api/runner_api.rst- High-level API entry pointsdocs/source/api/surface.rst- Slab configuration and depositiondocs/source/api/cluster_adsorbate.rst- Adsorbate placement and GA repositioningdocs/source/api/param_presets.rst- Parameter presetsdocs/source/api/system_types.rst- System type definitions
To build the documentation locally:
pip install -e .
pip install -r docs/source/requirements.txt
cd docs && make html
The built documentation will be available in docs/build/html/index.html.
Quick start
from scgo import run_go
from scgo.param_presets import get_testing_params
results = run_go(
["Pt"] * 4,
params=get_testing_params(),
seed=42,
system_type="gas_cluster",
)
resultsis a list of(energy, Atoms)for unique minima (sorted by energy by default).- Sequential multi-composition GO uses
run_go_campaign([...], system_type=...)fromscgo.runner_api(also re-exported fromscgo).
Explicit system types
SCGO supports exactly four explicit system_type values:
gas_cluster: gas-phase cluster (no slab, no extra adsorbate constraints)surface_cluster: cluster supported on a slab (surface_configrequired)gas_cluster_adsorbate: gas-phase cluster that includes adsorbate-like species (no slab)surface_cluster_adsorbate: supported cluster + adsorbate species (surface_configrequired)
system_type must be passed to each run_* API call. Top-level system_type is rejected inside preset dicts (go_params / ts_params); use the run function argument instead. For surface workflows, surface_config may appear in presets (e.g. get_torchsim_ga_params, get_ts_search_params) and on the run_* call—values must agree when both are set.
For adsorbate system types (gas_cluster_adsorbate, surface_cluster_adsorbate),
high-level runners require core-only composition and adsorbates (one ASE Atoms
fragment or a list of fragments). SCGO flattens adsorbate symbols in provided fragment
order and constructs the full mobile composition as
core_composition + flattened_adsorbate_symbols (mobile region after any slab).
Hierarchical initialization is the only supported adsorbate layout.
What to expect on disk (output)
When you run a search for composition Pt4, SCGO writes into Pt4_searches/ with the following structure:
Global optimization ({formula}_searches/)
Pt4_searches/run_<YYYYMMDD_HHMMSS_ffffff>/trial_<N>/bh_go.dborga_go.db(ASE database with candidates and relaxed structures)population.log(GA runs)
Pt4_searches/results_summary.json— campaign-level snapshot after the latest run. Top-level keys include:- Provenance (same convention as other SCGO JSON sidecars):
schema_version(currently 3),scgo_version,created_at(UTC ISO8601),python_version - Run summary:
composition(formula string, e.g."Pt4"),total_unique_minima,minima_by_run(map ofrun_id→ count),current_run_id,params(JSON-safe snapshot aligned withrun_*/metadata.json),run_metadata_relpath(e.g.run_<id>/metadata.json)
- Provenance (same convention as other SCGO JSON sidecars):
Pt4_searches/final_unique_minima/— final XYZ files, named likePt4_minimum_01_run_YYYYMMDD_HHMMSS_ffffff_trial_1.xyzPt4_searches/run_<...>/metadata.json— per-run record: provenance header above plusrun_id,timestamp,composition(symbol list),formula,params, and related run fieldsPt4_searches/validation/— optional; created whenvalidate_with_hessian=Trueto run vibrational checksPt4_searches/.scgo_db_registry.jsonand.scgo_db_registry.lock— optional DB index and lock (see Running on HPC above)
Notes:
- If
clean=False, SCGO will merge previous runs by scanningrun_*directories andtrial_*/DB files. .dbfiles are ignored by the project.gitignore.
Transition state search (ts_results_{formula}/)
run_ts_search (from scgo, wrapping scgo.runner_api) reads minima from {formula}_searches/ (or the output_dir you pass) and writes under the same tree into a dedicated folder:
{formula}_searches/ts_results_{formula}/- Per pair
pair_id(e.g.0_1):ts_{pair_id}.xyz,reactant_{pair_id}.xyz,product_{pair_id}.xyz(when geometries exist), andneb_{pair_id}_metadata.json ts_search_summary_{formula}.json— full run: provenance header, NEB settings (calculator_name,neb_fmax,neb_steps_resolved,neb_backendtorchsimorase,use_parallel_neb, climb/interpolation flags, image count, spring constant, etc.),composition,formula,num_total_pairs,num_successful,num_converged,results(list of per-pair records), andstatistics(total_ts_found,converged_ts,successful_ts,min_barrier/max_barrier/avg_barrierover successes)ts_network_metadata_{formula}.json— graph-oriented view:ts_connections[](each edge:pair_id,minima_indices, energies,barrier_height, optionalbarrier_forward/barrier_reverse,neb_converged,n_images, optionalminima_provenance),num_minima,statistics, optionalminima_base_dirfinal_unique_ts/— after deduplication:final_unique_ts_summary_{formula}.json(provenance +unique_ts[]withconnected_edges,connected_minima,filename, energies, etc.) and one.xyzper deduplicated TS (names may includepair_…when a single edge maps to that file)
- Per pair
Per-pair entries in ts_search_summary_*.json (and overlapping fields in neb_*_metadata.json) typically include: pair_id, status (success / failed), neb_converged, n_images, spring_constant, reactant_energy, product_energy, ts_energy, barrier_height, error, and on success ts_image_index. When traceability is available, minima_indices and minima_provenance appear: each endpoint lists run_id, trial_id, source_db, source_db_relpath, systems_row_id, confid, gaid, unique_id, final_id, energy (see scgo/ts_search/transition_state_io.py).
neb_{pair_id}_metadata.json merges the provenance header with pair fields above plus, when present: final_fmax, steps_taken, force_calls, and NEB-parameter echoes (use_torchsim, neb_backend, interpolation_method, climb, align_endpoints, perturb_sigma, neb_interpolation_mic, neb_surface_cell_remap, neb_surface_lattice_rotation, neb_surface_max_lattice_shift, fmax, neb_steps, etc.).
Key options (short)
- Global optimization (
paramsforrun_go/run_go_campaign) is merged withget_default_params()viainitialize_params: any preset that omits keys inherits defaults. Common entry points:get_default_params(),get_minimal_ga_params(),get_testing_params(),get_high_energy_params(),get_diversity_params(),get_default_uma_params()(fairchem UMA), andget_torchsim_ga_params(system_type=..., surface_config=..., seed=..., model_name=...)(MACE + TorchSim GA benchmark stack; requiresscgo[mace]). - Transition-state search (
ts_paramsforrun_ts_search/run_go_ts) is not merged with GO defaults. Build a flat dict withget_ts_search_params(...)(e.g.calculator="UMA"for UMA) and pass it explicitly alongsidego_paramswhen usingrun_go_ts/run_go_ts_campaign.
NEB endpoint alignment (on by default): Presets set neb_align_endpoints=True for all system types. Before ASE path interpolation (idpp or linear), SCGO reorders product atoms to match the reactant, then rigidly aligns endpoints so interior images start from a sensible band:
- Gas clusters — 3D Kabsch on the mobile region (or whole structure when no slab prefix).
- Slab / periodic systems — lattice-compatible PBC alignment (
neb_interpolation_mic=Trueon surface types): MIC-aware atom matching, collective mobile lattice-image selection, per-atom MIC snapping, optional integer in-plane lattice shifts (neb_surface_cell_remap, search spanneb_surface_max_lattice_shiftdefault1), and global in-plane rotation evaluated jointly with each shift (neb_surface_lattice_rotation). Slab/FixAtomsanchors stay registered; mobile atoms are not rotated independently of the lattice frame (avoids energy-inequivalent distortions).
Path interpolation always uses the aligned reactant and product copies as band endpoints; only interior images are filled by NEB.interpolate. Disable with ts_params["neb_align_endpoints"] = False only when you intentionally want raw GO minima as endpoints.
Surface GO final XYZ alignment: For surface_cluster and surface_cluster_adsorbate, before writing final_unique_minima/*.xyz, SCGO PBC-aligns each minimum to the lowest-energy trial using the same slab protocol as NEB (neb_surface_cell_remap, neb_surface_lattice_rotation, neb_surface_max_lattice_shift from optimizer kwargs, gated by SystemPolicy). This keeps stored frames comparable across trials; TS/NEB endpoint alignment is unchanged.
Initialization clash factor: Default min_distance_factor is 0.4 (was 0.5) in scgo.initialization.initialization_config.MIN_DISTANCE_FACTOR_DEFAULT; override per run if you need stricter placement.
Preset-vs-runtime split in runner_api:
- Put scientific/tuning knobs in preset dicts (
go_params/ts_params): calculator choice, optimizer settings, NEB settings, pairing thresholds, adsorbate placement (cluster_adsorbate_config), connectivity (connectivity_factor), etc. - Keep run-control knobs on the
run_*call itself:verbosity,output_dir,output_root,output_stem,seed,log_summary,write_timing_json,profile_ga. - Keep system-definition inputs on the
run_*call itself:system_type, core-onlycomposition, andadsorbateswhen applicable. - For surface system types, pass
surface_configon therun_*call and in preset builders (get_torchsim_ga_params,get_ts_search_params); SCGO validates coherence across GO/TS presets and run arguments.
Inspect -> edit -> run pattern:
from scgo import run_go_ts
from scgo.param_presets import get_default_params, get_ts_search_params
go_params = get_default_params()
ts_params = get_ts_search_params(system_type="gas_cluster")
print(go_params["optimizer_params"]["ga"]["niter"])
go_params["optimizer_params"]["ga"]["niter"] = 8
ts_params["max_pairs"] = 12
summary = run_go_ts(
"Pt5",
go_params=go_params,
ts_params=ts_params,
system_type="gas_cluster",
seed=7,
verbosity=1,
)
After writing final XYZ files, SCGO can optionally tag the corresponding database records with metadata ("final_unique_minimum": true, "final_rank", and "final_written") so downstream tools can find final minima without re-scanning databases. This is enabled by default; disable with params['tag_final_minima'] = False.
fitness_strategy:low_energy(default),high_energy, ordiversity. Thediversitystrategy requires adiversity_reference_dbglob (e.g.,"Pt*_searches/**/*.db").validate_with_hessian(bool): run force + Hessian checks (uses ASE vibrational analysis).- GA backend: MLIPs use TorchSim batched GA; classical calculators use ASE GA.
- Database/perf knobs:
db_enable_expression_indexes(GA/BH, defaultFalse): enable extra SQLite JSON expression indexes for frequent metadata predicates/sorts.ga_adaptive_retry_enabled(defaultTrue): adapt offspring attempt budget to recent acceptance rate instead of fixed10*n_offspring.ga_retry_floor_multiplier/ga_retry_ceiling_multiplier(defaults4/15): lower/upper bounds for adaptive retry budget.ga_fast_prefilter_enabled(defaultTrue): cheap severe-clash prefilter before full system-type validation.write_timing_json=Trueincludes per-run retry failure counters (retry_failures) and per-generation acceptance/failure breakdown in detailed mode.
Surface workflows (supported clusters)
SCGO can run genetic-algorithm global optimization for a small adsorbate cluster on a periodic slab. The GA explores the adsorbate degrees of freedom (composition); the slab supplies the cell and controls which substrate atoms move during local relaxations via SurfaceSystemConfig (FixAtoms under the hood, including on the TorchSim GA path).
How to run
Build (or load) any ASE Atoms slab and pass it through the generic surface helper:
from ase.build import fcc111
from scgo.surface import make_surface_config
slab = fcc111("Pt", size=(3, 3, 3), vacuum=10.0)
surface_config = make_surface_config(slab)
For the graphite preset used in example runners, use scgo.surface.make_graphite_surface_config (or from scgo import make_graphite_surface_config) instead of building a slab by hand.
Then build GO/TS presets and pass the same surface_config to the runner:
from scgo.param_presets import get_torchsim_ga_params, get_ts_search_params
from scgo import run_go_ts
go_params = get_torchsim_ga_params(
system_type="surface_cluster",
surface_config=surface_config,
seed=42,
)
ts_params = get_ts_search_params(
system_type="surface_cluster",
surface_config=surface_config,
seed=42,
)
For the bundled graphite preset, make_graphite_surface_config(slab_layers=3) controls slab thickness (see examples/example_pt5_graphite.py).
- Direct API (any adsorbate size):
from scgo import ga_go, SurfaceSystemConfigand passsurface_config=.... run_go: passsurface_config=...directly torun_go(...); it is copied into each presentoptimizer_paramsentry amongsimple/bh/gaso the active algorithm sees the slab. Automatic algorithm choice follows mobile atom count (see Algorithm selection under Global optimization).- For slab workflows, choose
system_type="surface_cluster"(supported cluster only) orsystem_type="surface_cluster_adsorbate"(supported cluster with explicit adsorbate-mode policies). Usescgo.surface.make_surface_configfor a custom ASE slab; usescgo.surface.make_graphite_surface_configfor the bundled graphite template.
Adsorbate inputs and initial structures: For both gas_cluster_adsorbate and surface_cluster_adsorbate, use core-only composition plus adsorbates as the primary API (Atoms for one fragment, or list[Atoms] for multiple fragments). SCGO derives a strict mobile partition in order (core_symbols == composition, then flattened adsorbate symbols); slab atoms are not part of composition. SCGO uses hierarchical initialization only: build the core, place rigid fragment(s) on convex-hull adsorption sites (vertex/edge/facet), then (for surface) deposit the combined cluster on the slab. Placement ranks candidate poses by steric deficit (covalent-radius blmin) and progressively relaxes height/clash thresholds on retry. Optional fragment placement and validation tuning lives in go_params (cluster_adsorbate_config=ClusterAdsorbateConfig(...), or set connectivity_factor alone for the common case). Use scgo.surface.describe_surface_config to log effective slab and height settings. GA and basin-hopping attach n_core_atoms and per-role symbol JSON in metadata for round-trip checks (including fragment-length metadata for multi-fragment adsorbates). When adsorbate metadata is present, validate_structure_for_system_type also asserts that the mobile region's chemical symbols match core_symbols + adsorbate_symbols in order (in addition to geometry checks). Input adsorbates fragments are validated to be connected geometries. adsorbate_definition['adsorbate_fragment_lengths'] is optional for manual definitions: when set, integrity is enforced per fragment; when omitted, integrity falls back to the full adsorbate block as one connected subgraph. Set freeze_adsorbate_internal_geometry=True in GO params for strict template rigidity (Kabsch restore after mutations); the default (False) still preserves intra-fragment bonds via tag-rigid GA operators.
Adsorbate GA behavior (*_adsorbate)
For adsorbate system types, the GA uses ASE tags to partition the mobile region: core (tag 0) vs adsorbate fragments (tags 1..N).
| Mechanism | Behavior |
|---|---|
| Crossover | Cut-and-splice on the core only; adsorbate fragments stay on parent 0. |
| Rattle / overlap relief | Tag-rigid: each fragment moves as a unit (intra-fragment geometry preserved). |
| Rotational / mirror / flattening / breathing | Core-targeted variants (*_core); adsorbate distortions omitted or scoped to adsorbate tags when freeze is off. |
fragment_reposition |
Re-place one adsorbate fragment on fresh hull sites (same placement engine as init). |
in_plane_slide |
Surface-only; core and adsorbate variants (in_plane_slide_core, in_plane_slide_ads). |
| Validation | enforce_adsorbate_subgraph_integrity=True (default) rejects dissociated fragments post-operator and post-relax. |
Clash tables (blmin) and placement use gap-filled covalent radii via build_blmin (BLMIN_RATIO_DEFAULT=0.7). Structure validation uses connectivity_factor (default 1.4) — typically stricter than operator sterics, so borderline disconnections are caught at validation rather than during mutation.
Slab motion during local relaxation
| Mode | Settings |
|---|---|
| Entire slab frozen | fix_all_slab_atoms=True (default) |
Relax only the top N slab layers (along surface_normal_axis) |
fix_all_slab_atoms=False, n_relax_top_slab_layers=N |
| Same intent, using bottom layer count | fix_all_slab_atoms=False, n_fix_bottom_slab_layers=L - N where L is the number of distinct slab layers along that axis |
| Slab fully free to relax | fix_all_slab_atoms=False and leave n_relax_top_slab_layers and n_fix_bottom_slab_layers unset (None) |
Do not set n_relax_top_slab_layers together with n_fix_bottom_slab_layers, or together with fix_all_slab_atoms=True. For typical ase.build.fcc111 slabs with vacuum along z, use surface_normal_axis=2 (the default).
Run metadata records a JSON-safe summary of these flags (no embedded Atoms) under the sanitized surface_config key.
Surface mobile connectivity (validation)
For surface_cluster and surface_cluster_adsorbate, GO/GA/BH and TS validate that the mobile region is slab-bound. Defaults in get_default_params() and get_ts_search_params():
| Flag | Default | Effect when True |
|---|---|---|
allow_cluster_fragmentation |
False |
Multiple disconnected core/mixed mobile subgroups allowed (each must touch the slab). |
allow_adsorbate_surface_detachment |
False |
Adsorbate-only mobile subgroups on the slab without cluster contact (requires exactly one core/mixed subgroup when fragmentation is off). |
enforce_adsorbate_subgraph_integrity |
True |
Keep adsorbate subgraphs connected (non-dissociative). With adsorbate_fragment_lengths, this is per fragment; otherwise it applies to the whole adsorbate block. External bonds to core/other fragments are still allowed. |
Typical modes: both False (strict single connected mobile cluster); fragmentation only (True, False); both True (any mobile split, each subgroup slab-connected). For surface_cluster_adsorbate, core vs adsorbate subgroups are classified using adsorbate_definition['core_symbols'].
Breaking rename: allow_dissociative_adsorption was removed. Migration:
| Old | New |
|---|---|
False |
allow_cluster_fragmentation=False, allow_adsorbate_surface_detachment=False |
True |
both flags True |
| (no old equivalent) | fragmentation only or detachment only — use the partial combos above |
TS pair selection: When surface_config is set, structural similarity and pair filtering use n_slab=len(slab) so displacements in frozen slab atoms alone do not create spurious distinct-minima pairs.
Testing
# Fast default
pytest tests/ -m "not slow"
# Integration-only
pytest tests/ -m integration
# Slow-only
pytest tests/ -m slow
Fast EMT "benchmark" smoke tests (initialization and dimers) live under tests/benchmarks/; long MLIP regression sweeps live under the top-level benchmark/ package (see benchmark/README.md).
For long GA/TorchSim tests, run in foreground with live output (-s) and an explicit timeout to avoid "looks stalled" sessions:
timeout 5400 pytest tests/ -m "not slow" -vv -s
High-Level API
Canonical workflow entry points are defined in scgo/runner_api.py and imported from the scgo package. Composition arguments may be a formula string ("Pt3Au"), a symbol list, or ase.Atoms (only symbols are used for GO).
Global optimization
run_go(composition, params=None, seed=None, ...)
Single composition; returns a list of (energy, Atoms) unique minima.
from scgo import run_go
from scgo.param_presets import get_default_params
results = run_go(
["Pt", "Pt", "Pt", "Pt"],
params=get_default_params(),
seed=42,
verbosity=1,
clean=False,
output_dir=None,
system_type="gas_cluster",
)
Algorithm selection (mobile atom count): 1–2 → simple (plain gas_cluster only); 3 → basin hopping; 4+ → genetic algorithm. Adsorbate system types skip simple (two-atom mobile regions use GA). For basin hopping and surface adsorbate runs, scgo builds hierarchical initial structures from adsorbate_fragment_template and reads adsorbate_definition / cluster_adsorbate_config from go_params; init-only keys (fragment template, placement glob, etc.) are not forwarded to the algorithm entry point.
run_go_campaign(compositions, ..., system_type=...)
Run GO for each composition sequentially; returns dict[formula, list[(energy, Atoms)]].
For element or binary size scans, build composition lists with helpers from scgo.runner_api, then pass them to run_go_campaign:
from scgo import run_go_campaign
from scgo.param_presets import get_testing_params
from scgo.runner_api import build_one_element_compositions, build_two_element_compositions
params = get_testing_params()
pt_scan = build_one_element_compositions("Pt", min_atoms=2, max_atoms=6)
au_pt_scan = build_two_element_compositions("Au", "Pt", min_atoms=2, max_atoms=4)
results = run_go_campaign(pt_scan, params=params, seed=42, system_type="gas_cluster")
Transition state search
run_ts_search and run_ts_campaign take a flat ts_params dict from get_ts_search_params (or edit a copy). TorchSim use is resolved from the calculator; pass system_type on the run_* call.
Per-system NEB defaults from get_ts_search_params include:
| Key | Gas types | Surface types |
|---|---|---|
neb_align_endpoints |
True |
True |
neb_interpolation_mic |
False |
True (forced by policy) |
neb_surface_cell_remap |
False |
True |
neb_surface_lattice_rotation |
False |
True |
neb_surface_max_lattice_shift |
1 |
1 |
For *_adsorbate runs, pass adsorbates= to run_go_ts so TS can use blockwise slab / core / adsorbate endpoint matching when alignment is enabled.
from scgo import run_ts_search
from scgo.param_presets import get_ts_search_params
ts_params = get_ts_search_params(system_type="gas_cluster", seed=42)
ts_results = run_ts_search(
["Pt", "Pt", "Pt"],
output_dir="Pt3_searches",
ts_params=ts_params,
seed=42,
system_type="gas_cluster",
)
run_ts_campaign forwards the same ts_params to each composition.
GO then TS
run_go_ts / run_go_ts_campaign use go_params= (merged like other GO runs) and ts_params= (same flat shape as above; not deep-merged with get_default_params()). For *_adsorbate system types, pass core-only composition and adsorbates on the run_* call (same as run_go); SCGO builds the full mobile composition internally. For surface workflows, pass surface_config on the run_* call and in preset builders (get_torchsim_ga_params, get_ts_search_params); values must agree when both are set. For MACE + TorchSim GA, start from get_torchsim_ga_params with system_type=... and seed (optional surface_config= / model_name=), set go_params["calculator"] = "MACE" and optimizer_params["ga"] as needed; pair with get_ts_search_params(...) and set ts_params["max_pairs"], etc. For UMA NEB defaults, use get_ts_search_params(calculator="UMA", ...). See examples/example_pt5_gas.py for a minimal end-to-end example. Default output if output_dir is omitted is under scgo_runs/<stem>_<mace|uma>/ (set output_root / output_stem to change).
Benchmarks comparing MACE vs UMA on the same GA structure can use get_uma_ga_benchmark_params (re-exported from scgo). See benchmark/ for long-running MLIP regression sweeps.
Advanced / internals
from scgo.runner_api import _run_go_trials,_run_go_campaign_compositions,build_one_element_compositions,build_two_element_compositions, …from scgo.surface import make_surface_configfor arbitrary ASE slabs (preset graphite:make_graphite_surface_config)from scgo.cluster_adsorbate import ClusterAdsorbateConfig, place_fragment_on_cluster— adsorbate placement; seedocs/source/api/cluster_adsorbate.rstfrom scgo.initialization.atomic_radii import build_blmin— covalent-radius clash tables for GA and placement- Low-level
scgo(...)/run_trials(...): passsystem_typeinglobal_optimizer_kwargs(required forscgo;run_trialsdefaults missing values to"gas_cluster") from scgo.ts_search.transition_state_run import run_transition_state_searchfor a flat keyword API without thets_paramsdict.
Notes
- TorchSim is an optional tool that provides GPU-accelerated batched optimization when available; SCGO works with EMT (CPU) out of the box for quick tests.
- For reproducible results, pass
seed=to the workflow functions above. - Optional scripts in
examples/are minimal, no-CLI examples that callrun_go_ts. Each is tuned for MACE + TorchSim (edit calculator in the script if needed):
| Script | system_type |
Notes |
|---|---|---|
examples/example_pt5_gas.py |
gas_cluster |
Gas-phase Pt5 only |
examples/example_pt5_graphite.py |
surface_cluster |
Pt5 on preset graphite |
examples/example_pt5_oh_gas.py |
gas_cluster_adsorbate |
core-only Pt5 + one OH; tag-aware GA, optional freeze_adsorbate_internal_geometry |
examples/example_pt5_2oh_graphite.py |
surface_cluster_adsorbate |
core-only Pt5 + two OH on graphite; hull-site placement + fragment_reposition |
For multi-size MLIP sweeps, see benchmark/ (e.g. benchmark/benchmark_Pt.py, benchmark/benchmark_Pt_surface_graphite.py), not tests/benchmarks/.
See tests/ for concrete usage patterns and acceptance tests for adsorbate GA operators.
MIT License — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scgo-0.1.0.tar.gz.
File metadata
- Download URL: scgo-0.1.0.tar.gz
- Upload date:
- Size: 549.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db025c080ddbadc31a11927af75fd732fbd313fbc1a57042dffe0dbf9a2a138
|
|
| MD5 |
caf3da8a3b1dabc68103d7e91e751ed7
|
|
| BLAKE2b-256 |
5f5afa1340393e2c42e40817d8d1c106ecd92295e83f22dbaaf619fe64e3383a
|
Provenance
The following attestation bundles were made for scgo-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on rlaplaza-lab/scgo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scgo-0.1.0.tar.gz -
Subject digest:
9db025c080ddbadc31a11927af75fd732fbd313fbc1a57042dffe0dbf9a2a138 - Sigstore transparency entry: 2021405714
- Sigstore integration time:
-
Permalink:
rlaplaza-lab/scgo@64b565154d90068be8478feeb9225251180b93db -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rlaplaza-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@64b565154d90068be8478feeb9225251180b93db -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scgo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scgo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 637.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
776e6eb9f48c728adf61a175d2fa8b55fb19c2e76d044b470aaa49ca457e8a90
|
|
| MD5 |
0dbbf904eac866e4c3db2e7e6ef194ae
|
|
| BLAKE2b-256 |
e6a3d00f1cae7ed7192844d7a944c9b6c3a8d04dbf7d5b5f71b4a6644ad73026
|
Provenance
The following attestation bundles were made for scgo-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on rlaplaza-lab/scgo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scgo-0.1.0-py3-none-any.whl -
Subject digest:
776e6eb9f48c728adf61a175d2fa8b55fb19c2e76d044b470aaa49ca457e8a90 - Sigstore transparency entry: 2021405746
- Sigstore integration time:
-
Permalink:
rlaplaza-lab/scgo@64b565154d90068be8478feeb9225251180b93db -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rlaplaza-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@64b565154d90068be8478feeb9225251180b93db -
Trigger Event:
workflow_dispatch
-
Statement type: