  We describe CPMC-Lab, a Matlab program for the constrained-path and phaseless
auxiliary-field Monte Carlo methods. These methods have allowed applications
ranging from the study of strongly correlated models, such as the Hubbard
model, to ab initio calculations in molecules and solids. The present package
implements the full ground-state constrained-path Monte Carlo (CPMC) method in
Matlab with a graphical interface, using the Hubbard model as an example. The
package can perform calculations in finite supercells in any dimensions, under
periodic or twist boundary conditions. Importance sampling and all other
algorithmic details of a total energy calculation are included and illustrated.
This open-source tool allows users to experiment with various model and run
parameters and visualize the results. It provides a direct and interactive
environment to learn the method and study the code with minimal overhead for
setup. Furthermore, the package can be easily generalized for auxiliary-field
quantum Monte Carlo (AFQMC) calculations in many other models for correlated
electron systems, and can serve as a template for developing a production code
for AFQMC total energy calculations in real materials. Several illustrative
studies are carried out in one- and two-dimensional lattices on total energy,
kinetic energy, potential energy, and charge- and spin-gaps.
