Density functional theory (DFT) calculations have been carried out for the Cs2AgBiCl6 and g-C3N4 phases, the interface, and defect in the supercell approach. Ionic positions were optimized using the CP2K software package using the PBE0 exchange-correlation functional, and by including DFT-D3 dispersion corrections. For g-C3N4, we employ an orthorhombic 2×2×2 supercell with a=7.08 Å, b=12.27 Å, c=6.97 Å; for Cs2AgBiCl6, we use the cubic phase with a=b=c=10.77 Å. In all cases, geometry optimization was carried out at the Γ-point of the Brillouin zone. We used the Goedecker-Teter-Hutter (GTH) norm-conserving pseudopotentials and MOLOPT double-zeta Gaussian basis sets. The auxiliary density matrix method has been used to accelerate calculations with the hybrid PBE0 functional. To refine the defect formation energies and thermodynamic ionizations levels, single point DFT calculations were carried out using the hybrid HSE06 functional with inclusion of spin orbit coupling (SOC) corrections on the optimized geometries within the Quantum Espresso software package. Screening of the fraction of exact exchange of the Cs2AgBiCl6 shows best agreement at a value of α=0.31 with the experimental values, as shown in Table . All calculations were carried out at the Γ point of the Brillouin zone, using norm conserving full relativistic pseudopotentials with electrons from Cl 5s, 5p; Cs 5s, 5p, 6s; Ag 5s, 5p, 4d; and Bi 6s, 6p, 5d shells explicitly included. Plane-wave basis set cutoffs for the smooth part of the wave functions and the Fock grid of 40 and 80 Ry, respectively, were chosen. Dispersion corrections were accounted for using the D3 scheme.