The paper studies relative structural stability for various crystal phases of tin and lead from first principles with the full-potential all-electron FP-LMTO method to pressures of a few TPa both at zero temperature and at T>0. Using data from our calculations we construct phase diagrams for the two metals in the region of very high compressions and obtain their melting curves. For tin at pressures <100 GPa and zero temperature, we did not find the region of stability of the body-centered orthorhombic (bco) phase, as it was earlier observed in experiments by Salamat et al. [Phys Rev. B 88, 104104 (2013)]. Our calculations suggest that one structural transition from the tetragonal to cubic phase, bct→bcc, occurs in perfect Sn crystal at T=0 K in the pressure range of about 27-32 GPa. But any deviation from perfection may cause an orthorhombic distortion of its tetragonal phase. At pressures above 100 GPa, the bcc→hcp transition exists in both metals, and the phase boundary has a domed shape and does not rise in temperature above 2 kK. This behavior of the phase boundary with the increasing temperature is caused by the softer phonon modes of the bcc structure and the smaller contribution of lattice vibrations to the free energy of the crystal compared to the hcp phase. At pressures above 2.5 TPa and T≤1 kK, lead can also undergo another structural transition, hcp→fcc, but at Т>1.5 kK there must exist the more energetically preferable bcc→fcc transition.
Ab initio calculations of the phase diagrams of tin and lead under pressures up to a few TPa.