interest in its practical application has given rise to research efforts toward investigations, both theoretical/computational and experimental/synthesis into how a band gap can be introduced. [16][17][18][19] Functionalization with oxygen atoms, [20] fluorine atoms, [21,22] and hydrogen atoms [23][24][25][26][27] alters the properties of graphene and, in some cases, causes a transition to a different kind of material: For example, full hydrogenation (a graphene layer with full coverage of hydrogen on each side) leads to a nonmagnetic, direct wide-gap semiconductor, as predicted by Sofo et al. [28] from ab initio calculations, which was demonstrated experimentally by Elias et al. [29] 2 years later. Semi-hydrogenation (full coverage of hydrogen on one side), on the other hand, as predicted by Zhou et al., [30] produces the ferromagnetic, indirect narrow-gap semiconductor graphone. The predicted transition from graphene to graphone and graphane with increasing hydrogen coverage, demonstrates the decisive role of adsorbed hydrogen for determining the properties of the resulting graphene derivate. Inducing a magnetic moment in the structure is particularly important for graphene-based spintronics. [31,32] A number of studies have reported that hydrogenated graphene is magnetic for certain degrees of hydrogenation. [14,[33][34][35][36] Optical spectra could be an effective approach for studying the exchange-split electronic band structure of magnetic hydrogenated graphene, and enable the determination of whether the ground state of hydrogenated graphene is magnetic. Functionalization by adsorbed atoms can to tune the atomic, electronic, and magnetic structure of 2DMs; in particular, hydrogenation. [37][38][39][40][41] By chemically modifying C 3 N to its fully hydrogenated form (FH) C 3 N, each C or N atom will have an extra nonbonding electron. Thus, fully hydrogenated C 3 N may be expected to have similar properties to graphene, silicene, or germanene, and become a Dirac material. [42,43] 2D polyaniline (C 3 N) has recently been synthesized [44] and may find numerous potential applications such as in solar cell devices, [45] gas sensors, [46][47][48][49][50] catalysts, [51] transistors, [52,53] energy storage, [52] and other applications. [54][55][56] Theoretical studies have been performed for C 3 N including heterostructures, [57,58] effect of external fields such as strain and electric field, [59][60][61] thermal transport and mechanical properties, [62][63][64][65] doping and vacancy defects, [66,67] layer thickness, [68] edge states, [69] and magnetism. [70] 2D polyaniline, C 3 N, is of recent high interest due to its unusual properties and potential use in various technological applications. In this work, through systematic first-principles calculations, the atomic, electronic, and magnetic structure of C 3 N and the changes induced due to functionalization by the adsorption of hydrogen, oxygen, and fluorine, for different coverages and sites, as well as on formation of nanoribbons including the effect of ads...