chemistrykit: Computational Chemistry in Python#

chemistrykit is a unified numerical toolkit for computational chemistry, spanning 14 domains – from reaction kinetics to crystallography – sharing common ODE integrators and chemical constants under one NumPy-based API. It’s built for chemistry students working through a textbook problem, curious learners exploring a topic on their own, and educators building a demonstration. All 14 domains from chemistrykit-spec.md (in the repository root) are implemented, listed below.

Belousov-Zhabotinsky oscillations, ethanol's 1H NMR spectrum, and van der Waals isotherms of CO2, all drawn with chemistrykit

Every subpackage is grounded in the chemistry it implements, not just coded against it: public functions carry runnable, CI-checked examples, and each subpackage’s history page traces the breakthroughs behind it – from Wilhelmy’s 1850 first rate law to the Brunauer-Emmett-Teller isotherm, whose co-discoverer Paul Emmett went on to develop uranium-separation barrier materials for the Manhattan Project – each one linked to the code that reproduces it.

Important

Each domain is a teaching-depth subset of its field, not a complete implementation. chemistrykit is not a replacement for specialist libraries in production work: for that, use the dedicated tools (RDKit, PySCF, Cantera, ASE, OpenMM, pymatgen, and the like) directly.

  • chemistrykit.analytical – analytical chemistry: redox and complexometric (EDTA) titration-curve simulation with equivalence-point detection, alongside chemistrykit.solutions’s acid-base titrations; chromatographic plate theory and the van Deemter equation; linear-regression calibration curves with IUPAC-convention limits of detection/quantitation; and propagation-of-uncertainty formulas plus Dixon’s Q-test for outlier rejection.

    Tsvet's chromatogram of leaf pigments, the van Deemter curve, and EDTA titrations
  • chemistrykit.crystal – crystallography and solid-state chemistry: the 7 crystal systems and general unit-cell volume; hard-sphere packing (packing fraction, coordination number) for SC/BCC/FCC/HCP lattices; ionic-crystal lattice energy via the Born-Lande and Kapustinskii equations, backed by a genuinely converging (Evjen-method) numerical Madelung constant; Bragg’s law and powder-XRD peak positions with structure factors and systematic absences; and Schottky/Frenkel point-defect equilibrium.

    Powder XRD patterns of Fe and Cu, Evjen's Madelung sum, and packing fractions
  • chemistrykit.electrochem – electrochemistry: the Nernst equation for standard and concentration cells with Debye-Huckel activity corrections; a curated standard-reduction-potential table with redox-couple balancing; Butler-Volmer electrode kinetics and Tafel-plot linearization; galvanic vs. electrolytic cells and Faraday’s laws of electrolysis; and a simplified constant-current battery discharge model with Peukert’s-law rate dependence.

    Butler-Volmer partial currents, a two-ion polarogram, and a Tafel plot
  • chemistrykit.kinetics – reaction kinetics: integrated rate laws, the Arrhenius equation, Michaelis-Menten enzyme kinetics, a general stoichiometric reaction-network engine, the Brusselator oscillator, Lindemann-Hinshelwood unimolecular falloff, and H2/O2 chain-branching explosion limits.

    Brusselator limit cycle, Oregonator oscillations, and Gillespie stochastic paths
  • chemistrykit.md – molecular dynamics and force fields: the Lennard-Jones fluid in reduced units (periodic boundary conditions, a Verlet neighbor list, pressure, g(r)), Morse/Buckingham/harmonic bonded potentials, velocity-rescaling/Nose-Hoover thermostats, and XYZ trajectory export for VMD/OVITO.

    Radial distribution function of liquid argon, MD speeds vs. Maxwell-Boltzmann, and mean-squared displacement
  • chemistrykit.photochem – photochemistry: Jablonski-diagram excited-state kinetics built on chemistrykit.kinetics’s reaction-network engine; fluorescence/phosphorescence quantum yields and the photochemical quantum yield via Beer-Lambert; Stern-Volmer quenching with a static-vs-dynamic diagnostic; and photostationary- state kinetics for a two-state photoswitch.

    Jablonski state populations, a Stern-Volmer plot, and FRET efficiency vs. distance
  • chemistrykit.polymer – polymer chemistry: ideal random-walk chain statistics and the Flory exponent for real chains under theta/good/poor solvent conditions; molecular-weight-distribution statistics and the closed-form Flory-Schulz distribution; step-growth kinetics via the Carothers equation; and chain-growth/ free-radical polymerization kinetics built on chemistrykit.kinetics’s reaction-network engine.

    A freely jointed chain, the Flory-Schulz distribution, and Flory-Huggins spinodals
  • chemistrykit.quantum – quantum chemistry: particle-in-a-box models (with the free-electron model of conjugated-dye color); the quantum harmonic oscillator vs. the exact Morse potential; the rigid rotor; hydrogen-like orbitals; Huckel molecular-orbital theory and its 4n+2 aromaticity rule; a minimal variational treatment of H2+; restricted Hartree-Fock SCF in an STO-3G basis for H2 and HeH+; and Rayleigh-Schrodinger perturbation theory for the anharmonic oscillator.

    Hydrogen radial distributions, H2+ bonding and antibonding orbitals, and Frost circles
  • chemistrykit.solutions – solution chemistry: pH/pOH and weak acid/base equilibria with Henderson-Hasselbalch buffers, titration curves, Ksp solubility equilibria, polyprotic and metal-ligand complexation speciation, and Debye-Huckel activity coefficients.

    Strong and weak acid titration curves, phosphoric acid speciation, and activity coefficients
  • chemistrykit.spectro – spectroscopy: the Beer-Lambert absorbance law and its stray-light deviation from linearity; rigid-rotor rotational spectra with isotope shifts; harmonic vs. Morse vibrational band positions plus a Wilson GF-matrix triatomic normal-mode calculation; Franck-Condon vibronic progressions; and first-order NMR multiplets plus exact second-order (AB, ABX) spectra.

    Ethanol's 1H NMR spectrum, a Franck-Condon progression, and the HCl rotational spectrum
  • chemistrykit.statmech – statistical mechanics of molecules: translational/rotational/vibrational partition functions and their thermodynamic functions, the Maxwell-Boltzmann speed distribution, and a canonical-ensemble lattice-gas adsorption model.

    Maxwell-Boltzmann speeds, Onsager's Ising magnetization, and Debye vs. Einstein heat capacity
  • chemistrykit.structure – molecular structure and bonding: a lightweight Molecule container; VSEPR geometry prediction with real 3D coordinate generation; point-group determination from 3D coordinates and character tables; bond order from the Pauling length correlation and Huckel-theory MO coefficients; and formal-charge/ oxidation-state assignment from a Lewis structure.

    SF4's seesaw geometry in 3D, crystal-field splitting, and Pauling's bond-order/length correlation
  • chemistrykit.surface – surface chemistry and catalysis: Langmuir, Freundlich, and BET adsorption isotherms with their standard linearizations for fitting parameters from data; Langmuir-Hinshelwood single- and dual-site surface-reaction kinetics; and a turnover-frequency/rate-enhancement catalysis model built on chemistrykit.kinetics’s Arrhenius equation.

    BET vs. Langmuir isotherms, Balandin's volcano curve, and temperature-programmed desorption
  • chemistrykit.thermo – chemical thermodynamics: equations of state (ideal gas, van der Waals, Redlich-Kwong), Clausius-Clapeyron and Antoine vapor-pressure curves, reaction equilibrium (Kp/Kc, van’t Hoff, and a Gibbs-energy-minimization equilibrium-composition solver), Raoult’s/Henry’s law mixtures with colligative properties, and Margules/Wilson/NRTL/UNIQUAC activity models for non-ideal vapor-liquid equilibrium and azeotropes.

    van der Waals isotherms of CO2, the ethanol-water azeotrope, and water's phase diagram

General-chemistry helpers sit at the top level: chemistrykit.periodic_table (all 118 elements and a formula parser, e.g. molar_mass("Ca(OH)2")) and chemistrykit.stoichiometry (equation balancing, including redox; limiting reagents; yields; empirical formulas).

Units#

Every function takes and returns plain floats and NumPy arrays; there is no unit-tracking library and nothing checks that units are consistent. Physical constants in chemistrykit.constants are SI values from scipy.constants, and each docstring states the unit of every argument and return value. Most models work in SI (J, m, Pa, K, mol/m3). The exceptions are the conventional ones, documented per function: solution concentrations in mol/L, NMR shifts in ppm and couplings in Hz, spectroscopic line positions in cm-1, the Lennard-Jones fluid in reduced units (sigma, epsilon, particle mass), and empirical correlations (Antoine constants, activity-model and rate-constant parameters) in whatever units their constants were tabulated in. Converting inputs to the documented units is the caller’s job.

chemistrykit is part of a family of packages – physicskit, mathematicskit and chemistrykit – that share the same architecture, API conventions, and history-driven documentation.

Conventionally imported as ck:

import chemistrykit as ck

network = ck.kinetics.StoichiometricNetwork.consecutive(k1=1.0, k2=0.3)
result = network.integrate((0.0, 10.0), dt=1e-3, method="rk4")

acid = ck.solutions.WeakAcid(Ca=0.1, Ka=1.8e-5)
print(acid.pH())

fluid = ck.md.LJFluid.from_lattice(n_per_side=6, density=0.7, temperature=1.0)
result = fluid.run(dt=0.002, n_steps=2000)

Related toolkits

Sibling Python toolkits for learning and teaching, built the same way: