Dynamic control of halide perovskite structures for tailored ferroelectric and second-order nonlinear optical functionalities | Synapse