Electronic properties and bonding configuration at the TiN/MgO(001) interface