  In spin-based electronics, information is encoded by the spin state of
electron bunches. Processing this information requires the controlled transport
of spin angular momentum through a solid, preferably at frequencies reaching
the so far unexplored terahertz (THz) regime. Here, we demonstrate, by
experiment and theory, that the temporal shape of femtosecond spin-current
bursts can be manipulated by using specifically designed magnetic
heterostructures. A laser pulse is employed to drive spins from a ferromagnetic
Fe thin film into a nonmagnetic cap layer that has either low (Ru) or high (Au)
electron mobility. The resulting transient spin current is detected by means of
an ultrafast, contactless amperemeter based on the inverse spin Hall effect
that converts the spin flow into a THz electromagnetic pulse. We find that the
Ru cap layer yields a considerably longer spin-current pulse because electrons
are injected in Ru d states that have a much smaller mobility than Au sp
states. Thus, spin current pulses and the resulting THz transients can be
shaped by tailoring magnetic heterostructures, which opens the door for
engineering high-speed spintronic devices as well as broadband THz emitters in
particular covering the elusive range from 5 to 10THz.
