  (1) Purpose: Conditions of formation of compound nuclear system needed for
synthesis of heavy nuclei in pycnonuclear reactions in compact stars are
studied on a quantum mechanical basis. (2) Methods: Method of multiple internal
reflections is generalized for pycnoreactions in compact stars with new
calculations of quasibound spectra and spectra of zero-point vibrations. (3)
Results: Peculiarities of the method are analyzed for reaction with isotopes of
Carbon. The developed method takes into account continuity and conservation of
quantum flux (describing pycnonuclear reaction) inside the full spacial region
of reaction including nuclear region. This gives appearance of new states
(called as quasibound states), in which compound nuclear systems of Magnesium
are formed with the largest probability. These states have not been studied yet
in synthesis of elements in stars. Energy spectra of zero-point vibrations and
spectra of quasibound states are estimated with high precision for reactions
with isotopes of Carbon. At the first time influence of plasma screening on
quasibound states and states of zero-point vibrations in pycnonuclear reactions
has been studied. (4) Conclusion: The probability of formation of compound
nuclear system in quasibound states in pycnonuclear reaction is essentially
larger than the probability of formation of this system in states of zero-point
vibrations studied by Zel'dovich and followers. So, synthesis of Magnesium from
isotopes of Carbon is more probable through the quasibound states than through
the states of zero-point vibrations in compact stars. Energy spectra of
zero-point vibrations are changed essentially after taking plasma screening
into account. Analysis shows that from all studied isotopes of Magnesium only
\isotope[24]{Mg} is stable after synthesis at energy of relative motion of
4.881~MeV of incident nuclei \isotope[12]{C}.
