Active tuning of photonic device characteristics during operation by ferroelectric domain switching