# Pyscf

> Use when running molecular quantum chemistry calculations in Python. Computes single-point energies, optimized geometries, vibrational frequencies, and population analysis using HF, DFT, or MP2 methods.

- **Type:** Skill
- **Install:** `agentstack add skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-pyscf`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [WuGroup-XJTLU](https://agentstack.voostack.com/s/wugroup-xjtlu)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [WuGroup-XJTLU](https://github.com/WuGroup-XJTLU)
- **Source:** https://github.com/WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group/tree/main/plugins/pyscf/skills/pyscf

## Install

```sh
agentstack add skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-pyscf
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# PySCF - Python-based Simulations of Chemistry Framework

## Overview

PySCF is a pure-Python quantum chemistry package for molecular electronic-structure calculations.

## When to Use PySCF vs. Other Tools

| Scenario | Recommended Tool | Why |
|---|---|---|
| HF, DFT, or MP2 calculations in a Python workflow | **PySCF** | Native Python API, easy scripting |
| Methods requiring dispersion corrections, triple-zeta basis sets, or exotic DFT functionals | **ORCA / Gaussian** | Broader built-in functional and basis-set libraries |
| Periodic solids or plane-wave calculations | **ASE + VASP / Quantum ESPRESSO / CP2K** | PySCF is primarily molecular |

**Key rule:** Use PySCF when you need HF/DFT/MP2 energies, geometries, or frequencies for molecules within a Python codebase.

## Installation

```bash
uv pip install pyscf
```

## Core Capabilities

### 1. Single-Point Energy

```bash
python scripts/run_calculation.py --molecule "H 0 0 0; H 0 0 0.74" --method HF --basis sto-3g --task energy
```

### 2. Geometry Optimization

```bash
python scripts/run_calculation.py --molecule "H 0 0 0; H 0 0 0.74" --method DFT:B3LYP --basis 6-31g --task opt
```

### 3. Vibrational Frequencies

```bash
python scripts/run_calculation.py --molecule "H 0 0 0; H 0 0 0.74" --method HF --basis sto-3g --task freq
```

## Output

All results are printed as JSON to stdout.

## Anti-Patterns (Do Not Do These)

- **Do not use `sto-3g` for quantitative results.** It is a minimal basis useful only for teaching or very rough guesses.
- **Do not rely on default SCF settings for difficult systems.** Strongly correlated or open-shell systems often need adjusted convergence helpers.
- **Do not use closed-shell RHF for open-shell molecules without caution.** Check the spin state; use ROHF or UHF when appropriate.
- **Do not run vibrational frequencies on a geometry that is not well optimized.** Frequencies are only meaningful at stationary points.

## Best Practices

- Start with `6-31g(d)` or `def2-svp` for reasonably accurate geometries and energies.
- Check SCF convergence; increase `mf.max_cycle` or use a level-shift if convergence is slow.
- For larger systems, enable density fitting (e.g., `mf = scf.RHF(mol).density_fit()`) to reduce cost.
- If the SCF converges to an unphysical state, run stability analysis (`mf.stability()`) and re-start.
- Always verify that an optimized geometry has no imaginary frequencies before using it for thermochemistry.
- **For questions about the latest PySCF features, newly added methods, or version-specific syntax changes, use `WebFetch` on https://pyscf.org/manual.html before answering.**

## Common Errors and Fixes

| Error / Symptom | Likely Cause | Fix |
|---|---|---|
| SCF does not converge | Bad initial guess, strong correlation, or charge distribution | Try `mf.init_guess = '1e'`, add smearing, or increase `max_cycle` |
| `BasisSetNotFoundError` | Basis set name misspelled or unsupported | Check spelling and case against the Basis Set Exchange |
| Memory error during large calculation | Exact integrals exceed RAM | Use density fitting (`mf.density_fit()`) or reduce basis size |
| Negative frequencies after optimization | Geometry not fully converged to a minimum | Re-optimize with tighter convergence or check for transition states |
| `OverflowError` in large systems | Numerical instability in integral evaluation | Switch to density fitting or use a more diffuse basis with care |

## References

- **Official Documentation**: https://pyscf.org/manual.html
- **ReadTheDocs**: https://pyscf.readthedocs.io/en/latest/
- **GitHub**: https://github.com/pyscf/pyscf

## Getting Live Information

If the user asks about recently added features, new options, or version-specific syntax changes, use `WebFetch` on the official documentation at https://pyscf.org/manual.html before answering.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [WuGroup-XJTLU](https://github.com/WuGroup-XJTLU)
- **Source:** [WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group](https://github.com/WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-pyscf
- Seller: https://agentstack.voostack.com/s/wugroup-xjtlu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
