Skip to main content

License GitHub issues Documentation Status DOI

NanoParticleLibrary (NPL)

NPL Logo

Table of contents

About NPL

NPL is a Python library for the simulation and structural optimization of nanoparticles, specifically tailored for bimetallic nanoparticles. Built on the robust ASE (Atomic Simulation Environment), it enables users to easily set up and analyze complex nanoparticle structures across a range of chemical compositions and structures. NPL provides high-level abstractions, making it accessible for both beginners and experienced researchers aiming to perform detailed nanoparticle simulations.

Documentation

A partial documentation is available at: https://nplib.readthedocs.io/en/latest/

Installation

Requirements

  • Python 3.10+
  • Atomic Simulation Environment (ASE) >= 3.23
  • numpy, scipy, scikit-learn, sortedcontainers

Installation from PyPI

You can install NPL with pip:

pip install npl

The wheels include a compiled Rust extension that makes ACT basin hopping and the ACT genetic algorithm 24-42x faster.

Installation from source

Building from source compiles that extension, so it needs a Rust toolchain (https://rustup.rs):

git clone https://github.com/farrisric/npl
pip install ./npl

Examples

TOP Energy Evaluation Example

This example demonstrates how to evaluate the topological (TOP) energy of a bimetallic nanoparticle using pretrained coefficients shipped with NPL. A 201-atom truncated-octahedral Pt151Cu50 particle is constructed, its extended topological feature vector is computed, and the energy is evaluated using a TOPCalculator loaded from pretrained linear-model coefficients. The result is a fast relative energy, in the units of the pretrained coefficients, without requiring an external calculator.

from npl.core import Nanoparticle
from npl.calculators import TOPCalculator
from npl.descriptors import ExtendedTopologicalFeaturesClassifier

calculator = TOPCalculator(
    "ETOP",
    stoichiometry="Pt151Cu50",
    feature_classifier=ExtendedTopologicalFeaturesClassifier,
)
feature_classifier = calculator.get_feature_classifier()

particle = Nanoparticle()
particle.truncated_octahedron(7, 2, {"Pt": 151, "Cu": 50})

feature_classifier.compute_feature_vector(particle)
energy = calculator.compute_energy(particle)

print(f"TOP energy of Pt151Cu50: {float(energy):.4f}")

NPL optimizes the chemical ordering of a particle with guided local optimization, basin hopping and a genetic algorithm (model="TOP" or "ACT" for two metals, model="ETOP" for three or more), or with Metropolis Monte Carlo over a fitted energy model (npl.monte_carlo.run_monte_carlo). See examples/basin_hopping_act.py for a two-metal search and examples/multimet_go.ipynb for a trimetallic (Pd/Au/Cu) workflow that compares ETOP basin hopping with Monte Carlo.

Note: npl's Monte Carlo samples chemical ordering at fixed composition (canonical). For grand-canonical Monte Carlo with machine-learning interatomic potentials (variable particle number, MACE/alchemi), see the companion package mcpy.

References

If you use this code, please cite our papers:

@article{neumann2021,
  author  = {Neumann, Felix and Margraf, Johannes T. and Reuter, Karsten and Bruix, Albert},
  title   = {Interplay between shape and composition in bimetallic nanoparticles revealed by an efficient optimal-exchange optimization algorithm},
  journal = {ChemRxiv},
  year    = {2021},
  doi     = {10.26434/chemrxiv-2021-26ztp}
}

@article{farris2024zr,
  author  = {Farris, Riccardo and Merinov, Boris V. and Bruix, Albert and Neyman, Konstantin M.},
  title   = {Effects of {Zr} dopants on properties of {PtNi} nanoparticles for {ORR} catalysis: A {DFT} modeling},
  journal = {The Journal of Chemical Physics},
  volume  = {160},
  number  = {12},
  pages   = {124706},
  year    = {2024},
  doi     = {10.1063/5.0193848}
}

@article{farris2024ordering,
  author  = {Farris, Riccardo and Neyman, Konstantin M. and Bruix, Albert},
  title   = {Determining the chemical ordering in nanoalloys by considering atomic coordination types},
  journal = {The Journal of Chemical Physics},
  volume  = {161},
  number  = {13},
  pages   = {134114},
  year    = {2024},
  doi     = {10.1063/5.0214377}
}

Contact

For any questions or issues, please contact:

License

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

Metadata

Release files for npl 3.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 npl 3.1.0
File Size Uploaded Provenance Actions
npl-3.1.0.tar.gz 58.0 kB With provenance Details for npl-3.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for npl 3.1.0
File Actions
npl-3.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for npl-3.1.0-cp310-abi3-win_amd64.whl
npl-3.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for npl-3.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
npl-3.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for npl-3.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
npl-3.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for npl-3.1.0-cp310-abi3-macosx_11_0_arm64.whl
npl-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for npl-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 1.4 MB

Release files / npl-3.1.0.tar.gz

Download URL npl-3.1.0.tar.gz
Size 58.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5689d75909a175b38432d2ce971d9dacef6420ca13b4da296b401e66094e624c
BLAKE2b-256 checksum
How to use checksums
fa54bf05222eea8cee7bee299286aaf6e93eacf8425a6c06e71d516348726d5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Release files / npl-3.1.0-cp310-abi3-win_amd64.whl

Download URL npl-3.1.0-cp310-abi3-win_amd64.whl
Size 198.1 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1ba0300d9d6c34e8b3fab2d1accf298a9684fbac8098a45f6e0e1e5f2bbf5361
BLAKE2b-256 checksum
How to use checksums
d2991b75afeadc7872928ccb370baa3244c8d4b0c0ba1625131975fb927ab4cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Release files / npl-3.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL npl-3.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 303.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
235139043a2bbf988b91bc49eebb4d28066ae08d57307b5aac97eede74aa56ed
BLAKE2b-256 checksum
How to use checksums
a9f80ae367903414fee3eb92c12b8721e50d42de85c8b25f7dd97c47c770bf89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Release files / npl-3.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL npl-3.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 301.1 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ad580581de64ed763b9a48a5de1e22237466ecae585ecc1d3b4d367d38d4554b
BLAKE2b-256 checksum
How to use checksums
5f5b16307d4fe9306a905c1c4784cd4cea9675b350073964144defeef478b453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Release files / npl-3.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL npl-3.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 281.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f2e17d77baa296b889b4a8bf760a089b4b1773453794f3ec6e67e66f73343062
BLAKE2b-256 checksum
How to use checksums
3c1de04a8ae4aa891683b8bd7e353b1c0681d67097071c4c57febcca26ae92a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Release files / npl-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL npl-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 291.8 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7bd0f891ba7f030296b7d87e70b5d2b1de94293391811247a3b44731ed695fbb
BLAKE2b-256 checksum
How to use checksums
9f8e87ec903d1e52430ef564e24bfd98f3371839fdc9758f7dff3dcf5598324c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Security for npl 3.1.0

Provenance

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

Full provenance

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

Select from 6 files

Attestation for npl-3.1.0.tar.gz

PyPI Publish Attestation

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

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

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

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

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