Skip to main content

License GitHub issues Documentation Status

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, DFT-quality energy estimate 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.0.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.0.0
File Size Uploaded Provenance Actions
npl-3.0.0.tar.gz 57.5 kB With provenance Details for npl-3.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for npl 3.0.0
File Actions
npl-3.0.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for npl-3.0.0-cp310-abi3-win_amd64.whl
npl-3.0.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.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
npl-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for npl-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
npl-3.0.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for npl-3.0.0-cp310-abi3-macosx_11_0_arm64.whl
npl-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for npl-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 1.4 MB

Release files / npl-3.0.0.tar.gz

Download URL npl-3.0.0.tar.gz
Size 57.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1c040cb4063bc75cf01aa33c26deb97659655b98833928b47adb5043db7a8608
BLAKE2b-256 checksum
How to use checksums
cdb386df06e76d766178b762d7aadd462a7f0194e907424bd680a6306da946be
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 3, 2026.

Transparency log

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

Download URL npl-3.0.0-cp310-abi3-win_amd64.whl
Size 197.7 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
970c1677df8fc3a57cb4b905e5efba4f278eb53cf4e3860f207ac083b3b82fd7
BLAKE2b-256 checksum
How to use checksums
be187265af1712a4598e376e1b7fc60777b581782d82dee3d3a43025124bb6be
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 3, 2026.

Transparency log

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

Download URL npl-3.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 302.9 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3174a6f388c1d715a45e1a6f4b8dad0f6ba235e0efdaed29c3f82f1c2af08e02
BLAKE2b-256 checksum
How to use checksums
40a6cb3baf588c9a07971c41d9453ab6d0eb6da71a20bbba5cc5efe3488fc485
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 3, 2026.

Transparency log

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

Download URL npl-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 300.6 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
dba5da89cf6617051078ccc3b63c9dfbab6e3c292d0b173bba4c3c5003441e02
BLAKE2b-256 checksum
How to use checksums
b68311b235902f930929e22075c7ceff6f9ea59a8920b360a86839ecfb00106d
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 3, 2026.

Transparency log

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

Download URL npl-3.0.0-cp310-abi3-macosx_11_0_arm64.whl
Size 282.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ed058f7d40f7448d0d3f9a6b10eafa939298d5115d77f3604b3559d120a3eb33
BLAKE2b-256 checksum
How to use checksums
bb48d88ba777728322587ecc7a6708fb7de7efc06b7bd58a06c80ce545012921
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 3, 2026.

Transparency log

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

Download URL npl-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 292.3 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8cf5ac4176de9f8f4bdd3de6865493aca3b29f691ac3e89d1918aa93973de81f
BLAKE2b-256 checksum
How to use checksums
d47e4e36c7a3bf8c0a431e992645d6ec115938027282eec206eaaed164077414
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 3, 2026.

Transparency log

Security for npl 3.0.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.0.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 3, 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