Spin dynamics in GaN- and InGaAs-based semiconductor structures