  We report results of a microscopic calculation of a second-order phase
transition into a state breaking time-reversal and translational invariance
along pair-breaking edges of $d$-wave superconductors. By solving a
tight-binding model through exact diagonalization with the Bogoliubov-de~Gennes
method, we find that such a state with current loops having a diameter of a few
coherence lengths is energetically favorable below $T^*$ between 10%-20% of
$T_{\mathrm{c}}$ of bulk superconductivity, depending on model parameters. This
extends our previous studies of such a phase crystal within the quasiclassical
theory of superconductivity, and shows that the instability is not
qualitatively different when including a more realistic band structure and the
fast oscillations on the scale of the Fermi wavelength. Effects of size
quantization and Friedel oscillations are not detrimental. We also report on a
comparison with quasiclassical theory with the Fermi surfaces extracted from
the tight-binding models used in the microscopic calculation. There are
quantitative differences in for instance the value of $T^*$ between the
different models, but we can explain the predicted transition temperature
within each model as due to the different spectral weights of zero-energy
Andreev bound states and the resulting gain in free energy by breaking
time-reversal and translational invariance below $T^*$.
