Skip to main content

Molecular/crystal structure optimizer

Project description

PyBerny

checks coverage python pypi commits since last commit license code style doi

PyBerny is an optimizer of molecular geometries with respect to the total energy, using nuclear gradient information.

In each step, it takes energy and Cartesian gradients as an input, and returns a new equilibrium structure estimate.

The package implements a single optimization algorithm, which is an amalgam of several techniques, comprising the quasi-Newton method, redundant internal coordinates, an iterative Hessian approximation, a trust region scheme, linear search, and coordinate weighting. The algorithm is described in more detail in the documentation.

Several desirable features are missing or incomplete at the moment, some of them being actively worked on (help is always welcome): crystal geometries, coordinate constraints, coordinate weighting, transition state search.

PyBerny is available in PySCF and QCEngine.

Installing

Install and update using Pip:

pip install -U pyberny

Example

The snippet below optimizes a geometry from geom.xyz end-to-end using GFN2-xTB (via tblite) as the energy/gradient backend:

from berny import Berny, geomlib, optimize
from berny.solvers import XTBSolver

optimizer = Berny(geomlib.readfile('geom.xyz'))
relaxed = optimize(optimizer, XTBSolver())

To plug in a different backend, replace XTBSolver() with any coroutine that follows the same interface (see the documentation for the manual generator pattern and the solver protocol).

Citing

If you use PyBerny in published work, please cite it via its Zenodo DOI: 10.5281/zenodo.3695037. The linked record resolves to the latest release and lists per-version DOIs for citing a specific version.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyberny-0.7.0.tar.gz (83.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyberny-0.7.0-py3-none-any.whl (102.2 kB view details)

Uploaded Python 3

File details

Details for the file pyberny-0.7.0.tar.gz.

File metadata

  • Download URL: pyberny-0.7.0.tar.gz
  • Upload date:
  • Size: 83.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyberny-0.7.0.tar.gz
Algorithm Hash digest
SHA256 54729005140f8b8d98db72d5fa635d994e1cb74666b15c02ff08e5312808abd5
MD5 bb6df5e22f96686d096361d6ebdd1bcb
BLAKE2b-256 0edc630d6f87c2eae530b028f2e4d35ed1b8e2bf3442efe1bee5fd40943e0a72

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyberny-0.7.0.tar.gz:

Publisher: publish.yaml on pyberny/pyberny

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyberny-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: pyberny-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 102.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyberny-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9db1982ba2af45fc98f2d0578e56680b3fbb7e3213c672f7c27a05be922fd749
MD5 e87310096ac97e0feb2558f40203de94
BLAKE2b-256 b2e12b4d739ee7e3b9aa9f63875f37026d71634733ba320a6000b0c5839369fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyberny-0.7.0-py3-none-any.whl:

Publisher: publish.yaml on pyberny/pyberny

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page