  Following the promising beamforming gains offered by reconfigurable
intelligent surfaces (RISs), a new hardware architecture, known as \emph{beyond
diagonal RIS (BD-RIS)}, has recently been proposed. This architecture enables
controllable signal flows between the RIS elements, thereby providing greater
design flexibility. However, the physics-imposed symmetry and orthogonality
conditions on the non-diagonal reflection matrix make the design challenging.
In this letter, we analyze how a BD-RIS can improve a wideband channel,
starting from fundamental principles and deriving the capacity. Our analysis
considers the effects of various channel taps and their frequency-domain
characteristics. We introduce a new algorithm designed to optimize the
configuration of the BD-RIS to maximize wideband capacity. The proposed
algorithm has better performance than the benchmarks. A BD-RIS is beneficial
compared to a conventional RIS in the absence of static path or when the Rician
$\kappa$-factor is smaller than $10$.
