  We demonstrate that the electronic, thermal, and optical properties of a
graphene bilayer with boron and nitrogen dopant atoms can be controlled by the
interlayer distance between the layers in which the interaction energy and the
van der Waals interaction between the dopant atoms play an essential role. We
find a conversion of an AA- to an AB-stacked bilayer graphene caused by the
repulsive interaction between dopant atoms. At a short interlayer distance, a
strong repulsive interaction inducing a strong electric dipole moment of the
dopant atoms is found. This gives rise to a breaking of the high symmetry,
opening up a bandgap. Consequently, a considerable change in thermoelectric
properties such as the Seebeck coefficient and the figure of merit are seen.
The repulsive interaction is reduced by increasing the interlayer distance, and
at a large interlayer distance the conversion process of the stacking order
vanishes. A small bandgap is found leading to a low Seebeck coefficient and a
figure of merit. For both short and large interlayer distances, a prominent
peak in the optical response is found in the visible range and the peak
position is inversely proportional to the interlayer distance.
