DiffuseCode from Python#

Warning

This is an early preview. The Python interface covers a small set of DISCUS commands so far, and the API may still change. It is built from the claude-python-app branch.

The diffuse package runs DISCUS from Python. You read a structure, run a calculation, and get the results back as NumPy arrays, ready for matplotlib, SciPy or your own analysis.

import diffuse as dc

cr = dc.read_structure("anatase.cif", supercell=(10, 10, 4))
p = dc.powder(cr, qmin=0.5, qmax=10, dq=0.005, radiation="xray")
p.plot()

f = dc.fourier(cr, ll=(-4, -4, 0), lr=(4, -4, 0), ul=(-4, 4, 0))   # hk0 plane
g = dc.pdf(cr, rmax=20, qmax=25)                                    # G(r)