  The chiral de Rham complex of Malikov, Schechtman, and Vaintrob, is a sheaf
of differential graded vertex algebras that exists on any smooth manifold $Z$,
and contains the ordinary de Rham complex at weight zero. Given a closed 3-form
$H$ on $Z$, we construct the twisted chiral de Rham differential $D_H$, which
coincides with the ordinary twisted differential in weight zero. We show that
its cohomology vanishes in positive weight and coincides with the ordinary
twisted cohomology in weight zero. As a consequence, we propose that in a
background flux, Ramond-Ramond fields can be interpreted as $D_H$-closed
elements of the chiral de Rham complex. Given a T-dual pair of principal circle
bundles $Z, \widehat{Z}$ with fluxes $H, \widehat{H}$, we establish a
degree-shifting linear isomorphism between a central quotient of the $i
\mathbb{R}[t]$-invariant chiral de Rham complexes of $Z$ and $\widehat{Z}$. At
weight zero, it restricts to the usual isomorphism of $S^1$-invariant
differential forms, and induces the usual isomorphism in twisted cohomology.
This is interpreted as T-duality in type II string theory from a loop space
perspective. A key ingredient in defining this isomorphism is the language of
Courant algebroids, which clarifies the notion of functoriality of the chiral
de Rham complex.
