We present a theoretical analysis for the interaction of the n‐heptane molecule with an HZSM‐5 zeolite, modeled as a ring structure. The Turbomole program, which is a density functional theory based method, was used. Quantum mechanical (QM) calculations were all‐electron using the gradient‐corrected BLYP approach. We employed orbital basis sets of DZP quality for all atoms. Two coordination modes were studied for the n‐heptane–zeolite interaction: a reference structure with the n‐heptane moiety located at the center of the ring, and a structure where n‐heptane is close either to a Broensted acid site (the region around the Al atom) or to a Lewis acid site. Although the chosen ring represents a minimal model for a zeolitic cavity, the obtained results give insight about the formation of the carbocationic species, proposed as intermediaries during the catalytic cracking reactions. The key electronic effects such as charge transfers and frontier molecular orbitals, involved in the adsorption of n‐heptane over the inner surface of the HZSM‐5 cavity are presented and discussed for the representative coordination modes studied. The Mulliken and the Roby‐Davidson population analysis were done. They are very useful, particularly the second one, to identify the catalytic sites, nucleophilic and/or electrophilic centers, as well as to locate the possible intermediates or transition states with a carbocation character, which are of considerable importance in the hydrocarbon catalytic cracking chemistry. Lastly, we have studied some of the effects that the surroundings produce on the chosen rings–hydrocarbon systems. This was accomplished through the use of a QM/MM(molecular mechanics) methodology. In this way, the embedded QM region representing the cavity it is described more properly for these host–guest interactions. ©1999 John Wiley & Sons, Inc. Int J Quant Chem 75: 725–740, 1999