Sol-gel nanocomposites for optical applications