Skip to main content

qcopt

Minimizations, transition-state searches, and IRCs for the qc* stack. Inputs and outputs are qcdata objects; gradients and Hessians come from axtb in-process or from any program qccompute runs.

import qcopt
from qcdata import Structure

# accuracy 0.01: at axtb's default SCF accuracy, g-xTB gradients carry ~1e-5 Eh/bohr
# of noise, the size of qcopt's convergence threshold (12% more time per gradient).
gxtb = {"program": "axtb", "model": {"method": "gxtb-v2.0.1"}, "keywords": {"accuracy": 0.01}}
guess = Structure.open("ts_guess.xyz")

ts = qcopt.find_ts(guess, gxtb, hessian=True, frequencies=True)  # ProgramOutput
ts.results.extras["n_imaginary"]                                   # 1
path = qcopt.irc(ts.results.final_structure, gxtb, hessian=True)   # ProgramOutput (PathData)

hessian names the program computing Hessians: True for the gradient program, or another one, often a cheaper method. Frames keep the gradient program's energies and gradients:

gfn2 = {"program": "axtb", "model": {"method": "gfn2"}, "keywords": {"accuracy": 0.01}}
ts = qcopt.find_ts(guess, gxtb, hessian=gfn2)   # g-xTB saddle from a GFN2 starting Hessian

Keyword arguments are qcopt's keywords (qcopt.keywords), such as maxiter, initial_hessian ("model", "exact", ...) or hessian_every.

Or as a qcdata input, alone or many at once (they advance together, and each round's gradients from all of them are computed in one call):

from qcdata import ProgramInput, ProgramSpec

inp = ProgramInput(
    program="qcopt",
    calctype="transition_state",
    structure=guess,
    keywords={"maxiter": 300},
    subprograms=[
        ProgramSpec(program="axtb", calctype="gradient", model={"method": "gxtb-v2.0.1"},
                    keywords={"accuracy": 0.01}),
        ProgramSpec(program="axtb", calctype="hessian", model={"method": "gxtb-v2.0.1"},
                    keywords={"accuracy": 0.01}),
    ],
)
out = qcopt.run(inp)            # or qcopt.run([inp1, inp2, ...])

What it does

Calculation Method
optimization RS-RFO in TRIC coordinates (Wang and Song, 2016: each molecule's internal coordinates plus its translation and rotation), or delocalized internals, or Cartesians; Lindh model Hessian or the program's exact one; BFGS updates (Bofill while the Hessian is indefinite); optional frequency check that steps off saddle points
transition_state RS-P-RFO climbing the lowest mode (or, in Cartesians, one following a guide direction); exact (or a cheaper method's) or finite-difference starting Hessian; TS-BFGS updates; recomputed when the negative mode is lost; fails when it ends without negative curvature (pass frequencies=True for a check by the exact Hessian's frequencies)
irc Mass-weighted steepest descent by Gonzalez-Schlegel steps (or the local quadratic approximation), both branches together, frames in the input's frame; overshoots retried at half the step; optionally both ends minimized together (minimize_ends)

Distances, angles and dihedrals can be held at target values (constraints), atoms frozen (frozen_atoms). Every frame is a qcdata Frame with the energy and gradient computed there.

With qccompute installed, qcopt is also a program it runs:

from qccompute import compute
out = compute(inp)   # the ProgramInput above

Benchmarks

benchmarks/ compares qcopt with Sella, geomeTRIC and OptKing on the same axtb gradients; results are summarized in AFH's findings.

Install

pip install "qcopt[axtb]"       # with axtb: in-process g-xTB and GFN2-xTB, analytic Hessians
pip install "qcopt[qccompute]"  # any program qccompute runs
pip install qcopt               # your own gradient function

axtb 0.1.0 or newer. Its wheels are for x86-64 Linux; elsewhere pip builds it from source, which needs Rust.

Status

0.x: the API may still change between minor versions.

License

MIT.

Metadata

Release files for qcopt 0.2.2

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

Source distribution (sdist)

Source distribution for qcopt 0.2.2
File Size Uploaded Provenance Actions
qcopt-0.2.2.tar.gz 183.4 kB With provenance Details for qcopt-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qcopt 0.2.2
File Interpreter ABI Platform Actions
qcopt-0.2.2-py3-none-any.whl Python 3 none any Details for qcopt-0.2.2-py3-none-any.whl

Total release size: 247.3 kB

Release files / qcopt-0.2.2.tar.gz

Download URL qcopt-0.2.2.tar.gz
Size 183.4 kB
Tags Source
SHA-256 checksum
How to use checksums
953227f509646201ba52176aafbfdba719fe576af66facf7cd3e74150a0cbd19
BLAKE2b-256 checksum
How to use checksums
29302e320c58f31bafb22333f986e837d6f13f7d0d400f6c009e0d5bd67eaa0e
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 7, 2026.

Transparency log

Release files / qcopt-0.2.2-py3-none-any.whl

Download URL qcopt-0.2.2-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f5f40fa311eb298bf72e9fc507de9e9cfaf0e76a5bb732efdcb7ec31f8fecbc
BLAKE2b-256 checksum
How to use checksums
bc3b7fd71b6552998d04509cf9d47afc0d8edf4021d39bd50c0a47633466e3c4
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 7, 2026.

Transparency log

Security for qcopt 0.2.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qcopt-0.2.2.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 7, 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