We develop a matrix method to compute the configurational partition functions of chain molecules that have intramolecular double strands, including RNA and DNA and antiparallel beta-sheet regions in proteins. An accurate theory has not been available for these types of molecules due to the nature of their self-contacts: (i) biomolecules have many self-contacts, and (ii) contacts are sequence-specific. The present theory, which we call the firehose model, can treat such conformations, including specific loops, bulges, and stems. The method is based on the use of polymer graphs. Tests against exact enumeration results on the two-dimensional (2D) square lattice show that conformational entropies are predicted quite accurately. As an example, we compute the denaturation profile of a 2D chain designed to resemble an RNA structure. (C) 1995 American Institute of Physics.