Halide perovskites from first principles: from fundamental optoelectronic properties to the impact of structural and chemical heterogeneity | Synapse