  Designing new compounds with the coexistence of diverse physical properties
is of great significance for broad applications in multifunctional electronic
devices. In this work, based on density functional theory, we predict the
coexistence of mechanical superhardness and the controllable magnetism in the
clathrate material \b{eta}-C3N2 through the implant of the external atom into
the intrinsic cage structure. Taking hydrogen-doping (H@\b{eta}-C3N2) and
fluorine-doping (F@\b{eta}-C3N2) as examples, our calculations indicate these
two doped configurations are stable and discovered that they belong to
antiferromagnetic semiconductor and ferromagnetic semi-metal, respectively.
These intriguing magnetic phase transitions originate from their distinctive
band structure around the Fermi level and can be well understood by the 3D
Hubbard model with half-filling occupation and the Stoner model. Moreover, the
high Vickers hardness of 49.0 GPa for H@\b{eta}-C3N2 and 48.2 GPa for
F@\b{eta}-C3N2 are obtained, suggesting they are clathrate superhard materials
as its host. Therefore, the incorporation of H and F in \b{eta}-C3N2 gives rise
to a new type of superhard antiferromagnetic semiconductor and superhard
ferromagnetic semimetal, respectively, which could have potential applications
in harsh conditions. Our work provides an effective strategy to design a new
class of highly desirable multifunctional materials with excellent mechanical
properties and magnetic properties, which may arouse spintronic applications in
superhard materials in the future.
