The transfer-matrix method is used when the total system can be broken into a sequence of subsystems that interact only with adjacent subsystems. For example, a three-dimensional cubical lattice of spins in an Ising model can be decomposed into a sequence of two-dimensional planar lattices of spins that interact only adjacently. The dimension p of the p × p transfer matrix equals the number of states the subsystem may have; the transfer matrix itself W k encodes the statistical weight associated with a particular state of subsystem k − 1 being next to another state of subsystem k.