  Modern communication and sensing technologies rely on connecting the optical
domain with the microwave domain. Terahertz technologies, spanning increased
frequencies from 100 GHz to 10 THz, are critical for providing larger
bandwidths and faster switching capabilities. Despite progress in
high-frequency electronic sources and detectors, these technologies lack a
direct link to the optical domain, and face challenges with increasing
frequencies (> 1 THz). Nonlinear processes, such as optical rectification,
offer potential solutions for terahertz generation but are currently limited to
discrete components based on bulk nonlinear crystals, missing out
miniaturisation opportunities from integration of optical circuits with
terahertz ones. We address this challenge by integrating phase-matched
terahertz transmission lines with photonic circuits in a single hybrid
architecture on the thin-film lithium niobate~(TFLN) platform. This design
demonstrates phase-matched, broadband terahertz emission spanning four octaves
(200 GHz to 3.5 THz) through broadband down-conversion of optical signals at
telecommunication wavelengths. The micron-sized transmission lines provide
terahertz field confinement with minimal radiative loss, enabling compact THz
cavities embedded in integrated photonic circuits. This integration is crucial
for leveraging photonics' advantages in low-noise, low-loss, and high-speed
operations for terahertz generation. Our platform can readily be integrated
with other mature photonics components, such as electro-optic modulators,
frequency comb sources, or femtosecond sources to pave the way for compact,
power-efficient, and frequency-agile broadband sources with applications in
telecommunications, spectroscopy, quantum electrodynamics and optical
computing.
