The aim of the study was to investigate the effect of heteroatoms on the deformation of graphene, as well as on the formation of the Stone-Wallace defect. To date, research on processes involving nanocarbon materials is relevant. In particular, in the formation of fullerenes, nanoonions and a number of other carbon nanoforms, the five-membered carbon cycles (pentactagonis) of the hepatogenesis (pentactagon) play the most important role in the curvature of initially flat graphene sheets and the formation of fullerene-like structures in the form of closed, skeletal, macromolecular formations. It should be noted, however, that the Pentagon is not the only factor in distorting the flat structure of graphene sheets in layered carbon materials. Some other defects of the carbon lattice (in particular, seven-membered carbon cycles and heteroatoms of a number of nonmetals with covalent radii exceeding the radius of the carbon atom) may play a similar role to one degree or another. These heteroatoms (primarily Si, P, S) are usually part of the precursors of mineral or vegetable origin and can be embedded in the carbon lattice in the process of coal production. Stone-Wallace there is their mutual compensation and preservation of a flat structure. The calculations were performed using quantum chemical modeling of doped nanographs in clusters of different size, composition and morphology, using the theory of density functional (DFT) with exchange-correlation functional B3LYP, based on the extended valence-split basis 6-31G (d) with full optimism clusters using the Firefly software package. It has been found that heteroatoms of non-metals with covalent radii exceeding the radius of the C atom, which are usually present in the precursors of mineral or vegetable origin used to produce pyrolyzed carbon materials, can play a significant role in energy. a number of nanoforms of carbon, activated carbon and other pyrolyzed nanostructured carbon materials.