  Consider the switch chain on the set of $d$-regular bipartite graphs on $n$
vertices with $3\leq d\leq n^{c}$, for a small universal constant $c>0$. We
prove that the chain satisfies a Poincar\'e inequality with a constant of order
$O(nd)$; moreover, when $d$ is fixed, we establish a log-Sobolev inequality for
the chain with a constant of order $O_d(n\log n)$. We show that both results
are optimal. The Poincar\'e inequality implies that in the regime $3\leq d\leq
n^c$ the mixing time of the switch chain is at most $O\big((nd)^2
\log(nd)\big)$, improving on the previously known bound $O\big((nd)^{13}
\log(nd)\big)$ due to Kannan, Tetali and Vempala and $O\big(n^7d^{18}
\log(nd)\big)$ obtained by Dyer et al. The log-Sobolev inequality that we
establish for constant $d$ implies a bound $O(n\log^2 n)$ on the mixing time of
the chain which, up to the $\log n$ factor, captures a conjectured optimal
bound. Our proof strategy relies on building, for any fixed function on the set
of $d$-regular bipartite simple graphs, an appropriate extension to a function
on the set of multigraphs given by the configuration model. We then establish a
comparison procedure with the well studied random transposition model in order
to obtain the corresponding functional inequalities. While our method falls
into a rich class of comparison techniques for Markov chains on different state
spaces, the crucial feature of the method - dealing with chains with a large
distortion between their stationary measures - is a novel addition to the
theory.
