  I develop a transfer matrix algorithm for computing the exact partition
function of a square lattice polymer with nearest-neighbor interaction, by
extending a previous algorithm for computing the total number of self-avoiding
walks. The computation time scales as ~1.6^N with the chain length N, in
contrast to the explicit enumeration where the scaling is ~ 2.7^N. The exact
partition function can be obtained faster with the transfer matrix method than
with the explicit enumeration, for N>25. The new results for up to N=42 are
presented.
