Skip to main content

SAPPHIRE

Sapphire-logos_black

Sapphire is a post-processing environment for the structural characterisation of metallic nanoparticles and nanoalloys from molecular-dynamics trajectories. It turns frames into physics: pair-distance distributions and per-frame nearest-neighbour cutoffs, adjacency and coordination, atop generalised coordination numbers (aGCN) and the GCN-based oxygen-reduction mass-activity model, common-neighbour-analysis (CNA) signatures and patterns with an SVM structure classifier, chemical ordering in alloys (mixing parameter, LAE, per-species neighbour counts), shape and shell-by-shell morphology, and the distribution divergences and change-point statistics that locate melting and other transitions along a run.

It reads anything ASE can read and writes plain per-frame text files that any tool can consume. Documentation, rendered tutorials and the full API reference live at https://jonesrobm.github.io/Sapphire/.

Citing Sapphire

If Sapphire contributes to your work, please cite the method paper:

R. M. Jones, K. Rossi, C. Zeni, M. Vanzan, I. Vasiljevic, A. Santana-Bonilla and F. Baletto, Structural characterisation of nanoalloys for (photo)catalytic applications with the Sapphire library, Faraday Discussions, 2023, 242, 326–352. doi:10.1039/D2FD00097K

@article{Jones2023Sapphire,
  author  = {Jones, Robert M. and Rossi, Kevin and Zeni, Claudio and Vanzan, Mirko and
             Vasiljevic, Igor and Santana-Bonilla, Alejandro and Baletto, Francesca},
  title   = {Structural characterisation of nanoalloys for (photo)catalytic applications
             with the Sapphire library},
  journal = {Faraday Discussions},
  year    = {2023},
  volume  = {242},
  pages   = {326--352},
  doi     = {10.1039/D2FD00097K},
}

The GCN-based mass-activity model implemented in Post_Process.Mass_Activity follows Rossi, Asara & Baletto, ChemPhysChem 2019, 20, 3037 (doi:10.1002/cphc.201900564), building on Rück, Bandarenka, Calle-Vallejo & Gagliardi, J. Phys. Chem. Lett. 2018, 9, 4463.

Installation

Sapphire supports Python 3.10+.

python -m venv .venv && source .venv/bin/activate
pip install -e ".[plot,changepoint]"      # core + plotting + change-point analysis

Extras: ml (CNA structure classifier), mlpot (MACE foundation-model potentials; pulls in PyTorch), light (pyGDM2 optics), quote, notebooks, docs, dev, all. Verify with python -c "import Sapphire; print(Sapphire.__version__)" and, with the dev extra, pytest.

Quick start

from Sapphire.api import run
from Sapphire.Tutorials import data

xyz = data.sample("AuPt", "work/")            # bundled Au80Pt20 melting trajectory (70 frames)
r = run(xyz, "work/out/", quantities=["pdf", "adj", "nn", "agcn", "cna_sigs"],
        frames=(0, 70, 7), statistics={"JSD": ["pdf"]})
r.load("agcn")                                 # (frames, atoms) atop generalised coordination numbers

Results are plain per-frame text files (see the file contract) readable with Sapphire.IO.Reader or any other tool. The classic two-dictionary interface to Sapphire.Process is unchanged (examples/run_analysis.py); examples/from_lammps.py ingests a LAMMPS dump.

Tutorials

Nine executable notebooks in main/Sapphire/Tutorials/, run in CI and rendered on the documentation site:

# Topic
01 Build a cluster; CN/GCN; surface–core peeling (Morphology)
02 Pair-distance KDE, RDF, deriving the cutoff
03 Adjacency, aGCN and the ORR mass-activity volcano
04 CNA signatures, patterns, structure classifier
05 Bimetallic trajectory with Process, Reader, Graphing
06 Divergences, collectivity, change-point detection
07 Shape: inertia, radii of gyration, radial density
08 Ensemble averaging over runs
09 MD with a MACE foundation-model potential

The bundled samples are down-sampled from four 14 ns bimetallic MD data sets published as a GitHub release; fetch the full trajectories with Sapphire.Tutorials.data.fetch(...).

Repository layout

Path Contents
main/Sapphire/ the package (api, Process, Post_Process, CNA, IO, Graphing, Potentials, Light, Utilities, Tutorials)
examples/ driver-script templates
tests/ pytest suite (import sweep, numerics, end-to-end runs on bundled data)
docs/ mkdocs site: guides, file contract, API reference, changelog (mkdocs serve)
legacy/ earlier code kept for reference; not installed

Authors and acknowledgements

Sapphire was written in the Baletto group at King's College London.

  • Robert M. Jones — lead author and maintainer (Robert.M.Jones@kcl.ac.uk)
  • Francesca Baletto — principal investigator
  • Claudio Zeni, Kevin Rossi, Mirko Vanzan, Igor Vasiljevic, Alejandro Santana-Bonilla — co-authors of the Sapphire paper
  • Matteo Tibberi, Armand Aquier — contributors to early versions of the CNA-pattern pipeline and morphology tools (their originals are preserved under legacy/)

The library builds on ASE, numpy/scipy, and optionally ruptures, scikit-learn, pyGDM2 and MACE.

Sapphire is research software in active development: if something looks wrong, please open an issue with whatever you can share — trajectories, logs, or just the surprise.

Licence

GPL-3.0 (see LICENSE).

Metadata

Release files for sapphire-nano 1.1.0

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

Source distribution (sdist)

Source distribution for sapphire-nano 1.1.0
File Size Uploaded
sapphire_nano-1.1.0.tar.gz 8.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sapphire-nano 1.1.0
File Interpreter ABI Platform
sapphire_nano-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 MB

Release files / sapphire_nano-1.1.0.tar.gz

Download URL sapphire_nano-1.1.0.tar.gz
Size 8.0 MB
Tags Source
SHA-256 checksum
How to use checksums
ac8cec5fc1635f80d0824f09a9e4eb163b7d0d8e4f5cc4a020f300883507c91b
BLAKE2b-256 checksum
How to use checksums
57e88321b005e32632de4a9a41d7e825c802349a6df5bbc6fa88875cc17d6c63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / sapphire_nano-1.1.0-py3-none-any.whl

Download URL sapphire_nano-1.1.0-py3-none-any.whl
Size 8.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
49e595d26b4c94b90efab25f766bdb1f5e995e8cbab57cdcd0ce1cab712542f8
BLAKE2b-256 checksum
How to use checksums
e98a14872029bd3adf4033f234d8a9ae8dcd723c1f82c6f22c26caa566fd7ea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.0

2 release files

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page