We report the observation of the ratchet effect for a relativistic flux qua
ntum trapped in an annular Josephson junction embedded in an inhomogeneous
magnetic field. In such a solid state system, mechanical quantities are pro
portional to electrical quantities, so that the ratchet effect represents t
he realization of a relativistic-flux-quantum-based diode. Man static volta
ge response, equivalent to direct fluxon motion,is experimentally demonstra
ted in such a diode for deterministic as well as stochastic oscillating cur
rent forcing.