Back to .md Directory

CLAUDE.md

Guides Claude Code on building, testing, and navigating a Python quantum chemistry package called pyquante2.

May 2, 2026
0 downloads
0 views
ai eval claude
View source

What this file does

Guides Claude Code on building, testing, and navigating a Python quantum chemistry package called pyquante2.

When to use it

  • You want Claude to understand a Python quantum chemistry codebase
  • You need to run tests or build a package with uv and make
  • You want to enforce project-specific naming conventions and ignore archived code
  • You are publishing a PyPI package and need a version bump checklist reminder

Assumes this stack

Python 3.11+numpypytestCythonuvmake

CLAUDE.md

This file provides guidance for Claude Code when working with the pyquante2 codebase.

Project Overview

PyQuante2 is a Python quantum chemistry suite for developing and testing quantum chemistry methods. It includes implementations of Hartree-Fock (RHF, UHF), DFT, and MP2, with optional Cython extensions for performance-critical routines.

Status: Published on PyPI as pyquante2 (current version: 0.2.0)

Project Structure

pyquante2/
├── src/pyquante2/       # Main source code
│   ├── basis/           # Gaussian basis sets (PGBF, CGBF)
│   ├── cints/           # Cython/C integral routines
│   ├── dft/             # Density functional theory
│   ├── geo/             # Molecular geometry (atoms, molecules)
│   ├── graphics/        # Visualization tools
│   ├── grid/            # Numerical grids for DFT
│   ├── hylleraas/       # Hylleraas variational methods
│   ├── ints/            # Integral evaluation (one/two-electron)
│   ├── pt/              # Perturbation theory (MP2)
│   ├── scf/             # SCF solvers and Hamiltonians
│   └── viewer/          # Molecular viewer
├── tests/               # Test suite
├── attic/               # Archived/deprecated code
├── docs/                # Documentation
├── CHANGELOG.md         # Release history
├── VERSION_MANAGEMENT.md # Version bump checklist
├── FUTURE_TASKS.md      # Planned improvements
├── CODE_REVIEW.md       # Code quality findings
└── TODO.md              # Original task list

Development Commands

# Install with dev dependencies
uv sync --extra dev

# Run tests (preferred)
make test

# Or directly with pytest
uv run pytest

# Run tests with doctests
uv run pytest --doctest-modules --ignore=attic

# Build package for PyPI
make clean          # Clean old builds
make build          # Build wheel + source distribution
uv run twine check dist/*  # Verify package

# Publish to PyPI (see VERSION_MANAGEMENT.md first!)
make install_test   # Upload to TestPyPI
make install        # Upload to PyPI

Testing

  • Tests are in tests/ directory using pytest
  • Many modules include doctests in docstrings
  • Run make test to run all tests including doctests
  • 3 DFT tests are skipped (conditional functionality)

Code Style

  • Python 3.11+ required
  • Uses numpy extensively for numerical operations
  • Classes use lowercase names (e.g., molecule, atom, cgbf)
  • Doctests serve as both documentation and tests
  • No type annotations currently used

Key Concepts

  • PGBF: Primitive Gaussian Basis Function
  • CGBF: Contracted Gaussian Basis Function
  • HGP: Head-Gordon-Pople integral algorithm
  • RHF/UHF: Restricted/Unrestricted Hartree-Fock
  • DFT: Density Functional Theory (LDA, GGA functionals)

Dependencies

  • Core: numpy, ipykernel
  • Dev/Test: pytest, matplotlib, build, twine
  • Build: setuptools, Cython (for C extensions)

Notes

  • Cython extensions in src/pyquante2/cints/ are optional but improve performance
  • The attic/ directory contains archived code - ignore when searching
  • Uses uv for package management (uv.lock present)
  • Before version bumps: Review VERSION_MANAGEMENT.md checklist
  • For future tasks: See FUTURE_TASKS.md
  • PyPI package: Available at https://pypi.org/project/pyquante2/

What's inside

9 sections, 6 code blocks, 4 key concept definitions, 3 dependency groups, 3 cross-file references

Change this for your project

  • Replace pyquante2 with your own package name throughout
  • Replace rpmuller/pyquante2 with your own repository path
  • Replace https://pypi.org/project/pyquante2/ with your PyPI URL

Where it goes

Save as CLAUDE.md in your repository root. Claude Code reads it automatically at the start of every session.

Worth borrowing

  • Pointing Claude to companion files (VERSION_MANAGEMENT.md, FUTURE_TASKS.md) for context
  • Listing skipped tests explicitly so Claude does not waste time debugging them
  • Naming conventions section to avoid style arguments during code generation

Related Documents