Metadata-Version: 2.4
Name: psi4_step
Version: 2026.11.9.1
Summary: A SEAMM plug-in to setup, run and analyze quantum chemistry calculations using Psi4
Home-page: https://github.com/molssi-seamm/psi4_step
Author: Paul Saxe
Author-email: psaxe@molssi.org
License: BSD-3-Clause
Keywords: SEAMM,plug-in,flowchart,Psi4,DFT,quantum chemistry,CCSD
Platform: Linux
Platform: Mac OS-X
Platform: Unix
Platform: Windows
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: cclib
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: py-cpuinfo
Requires-Dist: scipy
Requires-Dist: seamm>=2026.10.24
Requires-Dist: seamm-bsse
Requires-Dist: tabulate
Requires-Dist: seamm-exec>=2026.10.6
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: platform
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

==================
SEAMM Psi4 Plug-in
==================

.. image:: https://img.shields.io/github/issues-pr-raw/molssi-seamm/psi4_step
   :target: https://github.com/molssi-seamm/psi4_step/pulls
   :alt: GitHub pull requests

.. image:: https://github.com/molssi-seamm/psi4_step/workflows/CI/badge.svg
   :target: https://github.com/molssi-seamm/psi4_step/actions
   :alt: Build Status

.. image:: https://codecov.io/gh/molssi-seamm/psi4_step/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/molssi-seamm/psi4_step
   :alt: Code Coverage

.. image:: https://github.com/molssi-seamm/psi4_step/workflows/CodeQL/badge.svg
   :target: https://github.com/molssi-seamm/psi4_step/security/code-scanning
   :alt: Code Quality

.. image:: https://github.com/molssi-seamm/psi4_step/workflows/Documentation/badge.svg
   :target: https://molssi-seamm.github.io/psi4_step/index.html
   :alt: Documentation Status

.. image:: https://pyup.io/repos/github/molssi-seamm/psi4_step/shield.svg
   :target: https://pyup.io/repos/github/molssi-seamm/psi4_step/
   :alt: Updates for Dependencies

.. image:: https://img.shields.io/pypi/v/psi4_step.svg
   :target: https://pypi.python.org/pypi/psi4_step
   :alt: PyPi VERSION

A SEAMM plug-in to setup, run and analyze quantum chemistry
calculations using Psi4.

* Free software: BSD-3-Clause
* Documentation: https://molssi-seamm.github.io/psi4_step/index.html
* Code: https://github.com/molssi-seamm/psi4_step

Features
--------

* About 100 methods supported, including HF, DFT, coupled-cluster, CI
  and MCSCF
* About DFT functionals supported.
* Wide range of basis sets.
* Single-point energy.
* Geometry optimization.
* Second derivatives of the energy.
* Results can be stored in flowchart variables or tables_.

.. _tables: https://molssi-seamm.github.io/table_step/index.html

Acknowledgements
----------------

This package was created with Cookiecutter_ and the `molssi-seamm/cookiecutter-seamm-plugin`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`molssi-seamm/cookiecutter-seamm-plugin`: https://github.com/molssi-seamm/cookiecutter-seamm-plugin

Developed by the Molecular Sciences Software Institute (MolSSI_),
which receives funding from the `National Science Foundation`_ under
award OAC-1547580 and CHE-2136142.

.. _MolSSI: https://www.molssi.org
.. _`National Science Foundation`: https://www.nsf.gov


=======
History
=======
2026.11.9 -- Bugfix: the Thermochemistry results name the method that ran
    * With 'use existing parameters' the header of the Thermochemistry results named
      the step's own, unused method (e.g. Kohn-Sham DFT) instead of the method of the
      calculation it analyzed, and correlated methods showed 'R-None'. It now names
      the method that ran.
    * The developer guide's ALMO-EDA campaign records the validation and cost of the
      Psi4 backend of the Interaction EDA step.

2026.11.8.1 -- Bugfix: optimizations did not store the optimized structure
    * Since version 2025.3.9 an Optimization looked for Psi4's optimized structure in
      the wrong directory, did not find it, and silently kept the starting coordinates
      -- while still naming the configuration as optimized. The optimized structure
      is now written for each Optimization and stored, aligned with the starting
      structure, and a missing structure is an error rather than silently ignored.
      Later steps in the same Psi4 step (e.g. Thermochemistry) were not affected:
      Psi4 itself used the optimized geometry.
    * The results table again gives the number of optimization steps and whether the
      optimization converged when cclib cannot read Psi4's output (as for the
      current conda-forge build of Psi4 1.11).

2026.11.8 -- Bugfix: wrong correlated gradients in optimizations; derivatives and CC convergence options
    * Bugfix: Psi4's optimizer keeps the previous step's scratch files, and a
      correlated gradient computed with them present can be wrong -- for the
      all-electron CCSD(T) gradient of CH4 near its minimum, ten times too large, so a
      tight optimization wandered uphill and never converged. Optimizations with
      correlated methods now clean the scratch files before each gradient. The
      previous step's orbitals are still used as the starting guess, and Hessians,
      whose displaced gradients Psi4 computes afresh, were not affected.
    * New "Derivatives" in Optimization and Thermochemistry: "analytic where
      available" (as before) or "finite differences of energies", which uses only
      energies even where Psi4 has analytic gradients -- a check on them, or a way
      around them.
    * New "CC amplitude convergence" for the correlated methods: Psi4's
      r_convergence, the convergence of the amplitude and lambda equations. "default"
      leaves Psi4's own.
    * Bugfix: with "use existing parameters", Thermochemistry described the step's own
      unused settings (e.g. "B3LYP") rather than the previous step's method, which is
      what runs. It now names the previous step's method, integrals and frozen core.
    * Bugfix: a Thermochemistry step with its own parameters ignored its "Correlation
      integrals" setting.

2026.11.7.2 -- Density-fitted and Cholesky correlation integrals, with analytic DF gradients
    * New "Correlation integrals" setting for MP2, MP2.5, MP3, LCCD, CCD, CCSD, CCSD(T)
      and the orbital-optimized methods: Psi4's default for the method, conventional,
      density fitting (with an optional fitting basis), or Cholesky decomposition.
    * Density-fitted CCSD(T) and CCSD have analytic gradients with a frozen core, via
      Psi4's DFOCC module, so frozen-core coupled-cluster optimizations and Hessians no
      longer need finite differences of energies. The step uses DFOCC for the energy
      too, so energy and gradient come from the same code.
    * A model whose integrals differ from the method's default is named with a
      prefix -- DF-CCSD(T)/cc-pVTZ, CD-..., CONV-MP2 -- so its results are kept apart
      from the others.
    * The rules for analytic gradients now cover the integrals: conventional MP2,
      MP2.5, MP3 and LCCD gradients are all-electron only, and Cholesky-decomposed
      integrals have none; the step then uses energies and says so.

2026.11.7.1 -- Bugfix: Psi4 runs on node-local scratch under a queueing system
    * Under a queueing system such as SLURM, Psi4 now runs in a temporary directory on
      the node's local disk ($TMPDIR), with its scratch files there too, and the
      output and results are brought back to the step's directory. Before, it ran in
      the job's directory, often on a shared filesystem: on a busy day the many small
      writes Psi4 makes (its output, timer and scratch files) stalled it, so that a
      CCSD(T) gradient that takes 20 s ran for many minutes. Interactive runs are
      unchanged.
    * The developer guide has the design of a Psi4 backend for the Interaction EDA
      step (second-generation ALMO-EDA on CPUs).

2026.11.7 -- Bugfix: analytic CCSD(T) gradients, and no silent finite differences
    * CCSD(T) optimizations and thermochemistry used finite differences of energies,
      not Psi4's analytic gradients: Psi4 uses them only when told to use its
      ``ccenergy`` module, which the step did not do. All-electron CCSD(T) now uses the
      analytic gradients, which for a Hessian is many times faster.
    * Psi4's analytic CCSD(T), CCSD, EOM-CCSD and LCCD gradients are all-electron only.
      With the core frozen the step now asks Psi4 for finite differences of energies
      explicitly and warns in the output, rather than Psi4 switching silently (or, for
      CCSD, stopping with an error).
    * An energy calculation computes the gradient as well only when it is analytic, so
      a CCSD(T) energy with a frozen core no longer costs a finite-difference gradient.
    * CCD is marked as having no analytic gradient. The user guide explains which
      methods have analytic gradients.
    * A Psi4 output that cclib cannot read, e.g. from a development build of Psi4, no
      longer stops the step; the results come from Psi4's own data as before.

2026.10.24 -- The optimized structure keeps its name
    * The structures that optimizations write are now named '{current name} optimized
      with {model}' by default, keeping the name the structure had, such as a title
      read from an SDF file: 'DMC_cc optimized with B3LYP/def2-SVP'. Before, every
      structure was named 'optimized with <model>', so the titles of several molecules
      were lost. Flowcharts already saved keep their setting, and the previous choice
      remains in the list. Needs seamm 2026.10.24.

2026.10.18 -- Internal: read the output files from disk
    * seamm-exec 2026.10.18 no longer reads the files a calculation returns into memory,
      since they can be gigabytes. The Psi4 step now reads the ones it needs from the
      step's directory, which works with earlier versions of seamm-exec too.

2026.10.11 -- The step declares what its cost model is made of
    * ``psi4.TIMING_SPEC`` -- basis functions, electrons and atoms as the size
      variables, the method as the class, the task, and SCF runs as the unit -- is
      passed with each timing record (seamm-exec 2026.10.6.1 and later write it beside
      the records), so the cost model is fitted from the step's own description.
    * Removed the Docker image (and its recipe and release job) and the Docker settings
      in the default psi4.ini, which were no longer used or maintained.
    * Requires Python 3.12 or later.

2026.10.6 -- Timing records that a cost model can be fitted to
    * Each Psi4 run appends a record to ``~/.seamm.d/timing/psi4.csv`` through
      ``seamm_exec.timing``: the machine class, processes, wall time and outcome, and
      the descriptors of the calculation: the method and basis, the structure, and from the output the basis functions, electrons, SCF iterations and Psi4's own wall time. This replaces the step's own CSV
      (SMILES, formula and the whole parameter dictionary as JSON), which grew
      without bound. See seamm_exec's campaign of 2026-10-05.
    * Requires seamm-exec 2026.10.6.
2026.10.1 -- Settings that depend on each other, and three bug fixes
    * The dialogs show only the settings that apply with the current choices, and SEAMM's
      flowchart tools use the same rules: the functional only for DFT; the frozen core
      only for correlated methods; a dispersion correction only from the functional's own
      list; the damping, level-shift and second-order SCF controls only when switched on.
    * BSSE no longer offers the 17 Energy settings it does not use (Psi4's own SCF
      settings are used, and no plots are made), and Thermochemistry's plots apply only
      when it uses its own settings.
    * Bugfix: Thermochemistry right after Initialization tried to use the previous
      step's method; it now uses its own settings.
    * Bugfix: a functional given by its short name (e.g. a variable set to 'b3lyp')
      raised KeyError.
    * Bugfix: keeping the dispersion choice valid in the dialog raised a TypeError.
    * Documented in the user guide. Needs seamm 2026.10.1.
    * Internal: CI now installs the package's declared dependencies with uv rather than
      a conda test environment; seamm-exec, which it uses, is now declared.

2026.8.7 -- Bugfix: catch a mis-assigned per-fragment BSSE charge before running Psi4
   * The BSSE (counterpoise) sub-step now passes the cluster's atomic numbers into
     ``seamm_bsse.validate_fragments``, which checks that every fragment has an
     even electron count at its assigned charge. Previously, a per-fragment
     charge given to the wrong fragment (e.g. an ion's charge assigned to its
     neutral partner instead of the ion) could still sum correctly to the
     complex's own charge and pass validation, only to fail deep inside Psi4
     once that fragment ran as an impossible odd-electron singlet. This is now
     caught up front with a clear message naming the offending fragment.
   * Leaving ``fragment charges`` empty no longer always means all-neutral: if
     the structure carries per-atom formal charges (e.g. an ion marked with an
     SDF/MOL ``M  CHG`` record, such as the Na+ in a ``Na+..H2O`` complex), each
     fragment now defaults to the sum of its own atoms' formal charge. This
     covers monatomic ions (Na+, Cl-) and polyatomic ions (NH4+, BF4-) alike
     without the caller needing to spell out ``fragment charges`` at all --
     removing the main way to trigger the mis-assignment above in the first
     place. An explicit ``fragment charges`` still overrides it.

2026.8.4 -- Added a BSSE (counterpoise) sub-step
   * New BSSE sub-step: computes the counterpoise-corrected (Boys-Bernardi)
     energy and gradient of an N-fragment complex, with an independent charge
     per fragment -- needed for ions, e.g. a Na+/Cl- pair or a Na+/Cl-/H2O
     cluster. A thin wrapper around Psi4's own native N-fragment counterpoise
     driver (``bsse_type=['cp', 'nocp']``); requires the new ``seamm-bsse``
     package for the fragment-definition/validation layer shared with
     orca_step's own BSSE sub-step. Validated against real Psi4 and
     cross-checked against orca_step's independently-implemented BSSE
     sub-step on the water dimer, charged ion/water pairs, and a
     three-fragment Na+/Cl-/H2O cluster -- agreement to a few hundredths of
     a kcal/mol throughout.

2026.3.1 -- Internal: switching from deprecated library pkg_resources to importlib

2025.3.9 -- Optimization and thermochemistry enhancements
   * Expanded the output to include gap, HOMO, LUMO, RMSD between initial and final
     structure for optimizations, dipole moment, etc.
   * Added control for updating the structure after optimization.
   * Added enthalpy of formation to the thermochemistry output for known basis sets.
   * Updated the installation to work with recent changes.
     
2024.12.7 -- Minor update due to changes in molsystem
   * The molsystem was updated to improve the handling of properties. This required
     changes in this module to match the new molsystem.
    
2024.10.15 -- Bugfix: error if used in a loop and previous directories deleted.
   * The code crashed if called with a loop in the flowchart, and the last directory of
     a previous loop iteration was deleted before running the next iteration.
     
2024.10.5 -- Enhancements and bug fixes for thermochemistry
   * Improved GUI for thermochemistry so that it automatically recognizes whether it is
     after e.g. an optimization and configures appropriately.
   * Fixed and issue with transferring the multipole moments to the JSON file
     
2024.7.30 -- Enhanced results and fixed problem with psi4.ini
   * Added to the results by using cclib to parse the output.
   * If ~/SEAMM/psi4.ini did not exist the version that was automatically created was
     not complete, causing calculations to fail.
     
2024.5.23.3 -- Added auxiliary codes that help Psi4
   * Psi4 uses codes like DFTD4 and DFTD4 for parts of e.g. dispersion
     calculations. This release adds them to the Conda install SEAMM uses for Psi4.
     
2024.5.23.2 -- Bugfix: incorrect name for gradients
   * There was a typo in the name for the gradients, such that they could not be output
     to Results.json.
   * The units for the energy and gradients in Results.json were incorrect.
     
2024.5.23.1 -- Internal fix for creating Docker image.

2024.5.23 -- Added standard energy and gradients to results
   * Added 'energy' and 'gradients' to optional results to support e.g. Energy Scan
   * Fixed crashing bug in description of the Energy substep.
     
2024.3.17 -- Updated the installer
   * Updated the installer to use the new version of the SEAMM installer.
   * Finalizes installing either with Conda or Docker
     
2024.3.4 -- Allowing short names for method and DFT functionals
   * Added short names for the methods (Hamiltonians)  and DFT functionals.
   * Catch errors in Psi4 calculating properties for e.g. CISD(T) method

2024.2.29 -- Completed support for containers
   * Fixed issues with running amd64 containers on arm64 systems.
     
2024.1.11 -- Changes to allow running in containers.
   * Moved to the new executor and ensured it still runs directly.
   * Fixed bugs in printing the summary output.

2023.8.23 -- Fix for installation of Psi4
   * Psi4 is now available on CondaForge, so install from there if requested.
   * Psi4 crashes if asked to optimize and atom, so change to doing a single point
     energy is optimization is requested for and atom.

2023.8.22 -- Enhancement of orbital plots
   * Added structure to the orbital plots
   * Fixed a bug if the default number of cores was not 'available'

2023.6.4 -- Enhancements
   * Added thermochemistry substep to compute the vibrational and other corrections for
     thermochemistry.
   * Added ability to create .cube files for plotting the density and orbitals.
     
2023.2.21 -- Added control over SCF convergence
   * Able to set convergence criteria.
   * Options for damping. level shifting and second-order SCF
   * Set default for number of steps for optimization to 6*nAtoms to
     make it more explicit.
     
2023.2.17 -- Checking more thoroughly for errors in Psi4
   * Check and throw errors for various issues when running Psi4, including whenever it
     does not complete successfully according to the output.
     
2023.2.16.1 -- OptKing will not die!!!
   * Yet another part needed to be removed.
     
2023.2.16 -- Thoroughly removing calls to OptKing
   * OptKing is causing compatibility issues, and is not currently being used in the
     Python, so am temporarily removing it.

2023.1.23 (23 January 2023)
---------------------------

* Corrected bugs, including if no dispersion term requested
* Added preliminary version of accelerated optimization using
  MOPAC for Hessians, etc. May not fully work at the moment.
* Updated documentation theme and structure to match new style.

2022.11.18 -- Added total charge and multiplicity to Psi4 input

2021.2.11 (11 February 2021)
----------------------------

* Updated the README file to give a better description.
* Updated the short description in setup.py to work with the new installer.
* Added keywords for better searchability.

2021.2.4 (4 February 2021)
--------------------------

* Updated for compatibility with the new system classes in MolSystem
  2021.2.2 release.

2020.12.5 (5 December 2020)
---------------------------

* Internal: switching CI from TravisCI to GitHub Actions, and in the
  process moving documentation from ReadTheDocs to GitHub Pages where
  it is consolidated with the main SEAMM documentation.

2020.11.2 (2 November 2020)
---------------------------

* Updated to be compatible with the new command-line argument
  handling.

2020.9.28 (28 September 2020)
-----------------------------

* Improved handling of results

  - Selection depends on both calculation and method.
  - Arrays can be stored in variables (but not tables!).
  - Multipoles gathered as arrays rather than a large number of scalars.

2020.8.1 (1 August 2020)
------------------------

* Fixed minor bugs.

2020.7.3 (24 July 2020)
------------------------

* Added control options for number of threads and amount of memory to
  use.

2020.7.2 (23 July 2020)
------------------------

* First pass at specifying number of threads and amount of memory.

2020.7.1 (23 July 2020)
------------------------

* Added substep for optimization.

2020.7.0 (21 July 2020)
------------------------

* First release on PyPI of initial working version.
