  We propose a method to produce pure single photons with an arbitrary designed
temporal shape in a heralded, lossless and scalable way. As the indispensable
resource, the method uses pairs of time-energy entangled photons. To accomplish
the shaping, one photon of a pair undergoes temporal modulation according to
the desired shape. Subsequent frequency-resolving detection of the photon
heralds its entangled counterpart in a pure quantum state with a temporal shape
non-locally affected by the modulation. We found conditions for the shape of
the heralded photon to reproduce the modulation function. The method can be
implemented with various sources of time-energy entangled photons. In
particular, using entangled photons from the parametric down-conversion the
method enables generation of pure photons with tunable shape within
unprecedentedly broad range of temporal durations - from tenths of femtoseconds
to microseconds. Proposed shaping of single photons will push forward
implementation of scalable multidimensional quantum information protocols,
efficient photon-matter coupling and quantum control at the level of single
quanta.
