pepsy is a Python package for circuit simulation and related DMRG fitting workflows.
Current package version: 0.2.0 (from pyproject.toml / pepsy.__version__).
src/pepsy/: installable library codebackends/: backend selection, conversion, and linear algebra registrationtensors/: lattice maps (OneDMap), state/MPO/PEPO builders, contraction helpersoperators/: gates, gate application, MPO/PEPO builders, and Hamiltonian helpersboundary/: boundary state initialization (BdyMPS), sweeps (CompBdy), and metricssolvers/: gradient-based and finite-difference solversfitting/: local tensor fitting routines (FIT)optimizers/: sweep, global, energy, MPS, and MPO optimizerssampling/:MpsSamplerand related sampling utilities_internal/: private formatting and utility helpers
examples/: runnable examples (e.g.MpsMagnetization/2D ITF Trotter MPS evolution)docs/: Sphinx documentation sourcetests/: package tests
pip install -U --no-deps -e .
# Optional backends:
# pip install -e .[torch]
# pip install -e .[solvers]
# jax backend (manual, platform-specific wheels):
# pip install jax jaxlib
# Optional plotting helpers:
# pip install -e .[viz]import pepsy
import quimb.tensor as qtn
ket = qtn.PEPS.rand(Lx=3, Ly=3, bond_dim=2, seed=1, dtype="complex128")
ket_tagged, norm = pepsy.build_bra_ket(ket=ket)
bdy = pepsy.BdyMPS(tn_flat=ket_tagged, tn_double=norm, chi=32, single_layer=False)
res = pepsy.contract_boundary(norm=norm, bdy=bdy, direction="y", n_iter=2)
print(pepsy.__version__, res.cost)Build docs locally:
pip install -e .[docs]
NUMBA_CACHE_DIR=/tmp PYTHONPYCACHEPREFIX=/tmp \
sphinx-build -W -b html docs docs/_build/htmlMain docs sections:
getting_startedtutorials/howto/api/
.gitattributesmarks notebooks as binary to avoid noisy diffs..gitignoreexcludes checkpoints, caches,cash/, andnohup.out.