  Energy band structures are calculated for the new superconductor MgB$_2$ and
the related compounds by using the LDA and an FLAPW method. It is found that
the strong three dimensional network in low-lying $\pi$ bands brings about two
dimensional $\sigma$ holes in MgB$_2$, which should be responsible for the
superconductivity. The de Haas-van Alphen frequencies and the cyclotron masses
are obtained for the Fermi surfaces. The $\sigma$ hole is not found in LiBC due
to the less three dimensional network. MgB$_2$C$_2$ is found a semiconductor,
but the top of the valence bands are similar to the $\sigma$ bands in MgB$_2$.
The total energy calculations are also performed for Mg$_{1-x}$Al$_x$B$_2$ to
investigate the structural phase instability, experimentally observed around
$x=$10%.
