Experimental demonstration of a transient grating controlled all-optical switch