there is no longer any need to be afraid

### BRST Quantization, Symplectic Reduction, and Syzygies I

I want to talk a bit about quantizing gauge theories with syzygies (I’ll explain what I mean by this). I’ll probably take a few posts to do this. First an overview.

A gauge theory, roughly speaking, is a QFT whose physical configurations form a category with non-trivial morphisms. Take BF theory for example. This has the action functional

$\int B \wedge dA$,

where $A$ and $B$ are a 1-form and 2-form, respectively. This theory has the gauge symmetries

$B \rightarrow B + d\alpha$

$A \rightarrow A + df$.

These describe an isomorphism between the configurations $(A,B)$ and $(A+df,B+d\alpha)$. There are even 2-morphisms. If we take

$\alpha \rightarrow \alpha + dg$,

then we get an equivalent gauge transformation. This is an example of a syzygy–a relation between relations.

Put another way, our configuration space, $C$ is actually a 2-groupoid. Its fundamental 2-group with basepoint at a particular configuration is presented by the crossed module (of sheaves on a suitable site)

$\Omega^0 \stackrel{t}{\rightarrow} \Omega^1 \oplus \Omega^0 \rightarrow *$

where the target map $t$ is the de Rham differential into the first summand. The BV-BRST formalism gives us a method to use this presentation to quantize BF theory.

What does it mean to quantize a gauge theory? Let’s recall what we need to do geometrically and then (in later posts) translate this into algebra. First we form the unreduced phase space of the theory. What this means is that we need to come up with some canonically conjugate coordinates. If we pick a coordinate $\phi$, we can use the Lagrangian $L$, which in this case is $B\wedge dA$ to pick a particularly nice conjugate momentum : $\frac{\delta L}{\delta (d \phi)}$. In this case, we see that $A$ and $B$ are a natural choice of conjugate variables. We define a Poisson bracket so

$\{A,B\} = 1$.

This uniquely defines a symplectic structure on $C$. Now we must restrict to the submanifold $C_0$ cut out by the equations of motion. We can describe $C_0$ as the homology of the complex

$0 \rightarrow \mathrm{ker} dS \rightarrow Der(\mathcal{O}_C,\mathcal{O}_C) \stackrel{dS}{\rightarrow} \mathcal{O}_C \rightarrow 0$.

This is the sheafy version of D’Alembert’s principle. Here, $Der$ denotes $\mathcal{O}_C$-linear derivations, ie. vector fields, and $dS$ is a one-form describing the variation of the action $S$ along some vector field. Roughly speaking, what this says is that the classical solutions are the configurations where the action is stationary.

Note that $\mathrm{ker} dS := N_S$, called the Noether ideal, consists of those vector fields which generate symmetries of the action off shell, ie. away from where the action is stationary. This includes gauge transformations as well as ordinary symmetries. Resolution of this ideal sheaf will concern us quite a bit in quantizing this theory.

In this case, one finds (try it!) that the equations cutting out $C_0$ are

$dA=0$

$dB=0$

as long as the spacetime is without boundary. Now we want to identify physically equivalent states, ie. our reduced phase space should be $\pi_0 C_0$. This is just the sum of the first and second homology of our spacetime, which until now I have not mentioned, but should be some 4-manifold $M$. This space is not even dimensional in general, but it is if we insist $M=\Sigma_3 \times \mathbb{R}$ for some 3-manifold $\Sigma_3$. It seems like this is the only case where it is possible to quantize this theory in this method, but it is really the one we’re interested in for constructing BF theory as a TQFT. More on why this is the case in later posts. It has to do with Anton Kapustin and others’ program of extending TQFTs by Kaluza-Klein compactifications. This will include a discussion of symplectic reduction next time.

Once we have a good phase space, one thing we can do is geometric quantization. We can cook up a line bundle with connection whose curvature gives the symplectic form. This is called the prequantum line bundle. Then we pick a polarization–some kind of involutive distribution on this line bundle such as a complex structure, and ask for the Hilbert space completion of the space of polarized (think holomorphic) sections of this line bundle. That’s our Hilbert space, and there are ways to take functions on the phase space and produce Hermitian operators on this Hilbert space. Voila! Quantization.

### Wilson loops, confinement, and Lie group extensions

Today I want to talk about Wilson loops, their role in defining what it means for a QFT to have confined monopoles, and a toy example that illustrates how we expect confinement to have something to do with group extensions. The primary reference is Ed Witten’s lectures 7 and 10 in the IAS course on quantum fields and strings, vol 2.

A monopole in electrodynamics is a particle that carries electric or magnetic charge. Ordinary electrodynamics has no magnetic monopoles and in this post I will only consider electric monopoles. I may discuss the magnetic situation from the perspective of abelian duality another time. We can generalize this definition to a gauge theory with arbitrary gauge group $G$ by saying an electric monopole is a particle charged in $G$, in other words, equipped with a representation $R$ of the gauge group. For electrodynamics, $G=U(1)$ and irreducible representations are labelled by integers, which is the ordinary notion of charge.

Monopoles are confined when it costs infinite energy to separate attracting charges. The phase where there is a finite energy cost to do so is not confining and can be in a Higgs or Coulomb phase, as well as many others. We can imagine that a monopole and its antimonopole are created at time $t = 0$ and quickly separated a distance $L$ apart and remain stationary until they quickly return to their spot of origin and annihilate eachother at time $t = T \gg L$. In other words, we are considering a rectangular worldline with length $L$ in the spatial direction and length $T$ in the time direction.

The phase accumulated around this loop is proportional to $V(L) T$, where $V(L)$ is the energy required to separate the monopole and antimonopole. In the Coulomb or Higgs phase we tend to have $V(L)\sim\mathrm{constant}$ as $L \rightarrow \infty$, so the phase is proportional to $T$, which is approximately the perimeter of the loop since we assume $T\gg L$. In the confining phase we expect $V(L)\sim L$ as $L \rightarrow \infty$, so the phase is proportional to the area of the loop.

When our theory has a mass gap, we expect all loops–not just rectangles like these–to behave the same way. Thus, by measuring whether the phase accumulated by a monopole travelling in a loop in spacetime is proportional to the perimeter or the area of the loop as the loop gets large detects whether we are in the confining phase or not.

In fact my discussion so far is too narrow if $G$ is not simply connected. Instead of taking the charge to be a representation of $G$, we can take it to be a representation of the universal cover of $G$. This is the same phenomenon that occurs throughout quantum mechanics. It is only the magnitude of a quantum state that is physically relevant, so a priori we should only expect to obtain projective representations of $G$ on the Hilbert space of the theory.

These always lift to honest representations of the universal cover of $G$. It turns out that particles charged in honest representations of $G$ are never confining. I don’t yet understand the reason for this, but hopefully an example will be illustrative…

I’ll consider a 2 dimensional Euclidean $U(1)$ theory with action

$S=\int_{\Sigma} d^2 x (\frac{1}{4e}|F|^2+\frac{1}{2}|d_A \phi |^2 +\frac{\lambda}{4}(|\phi|^2-a^2)^2)-\frac{i\theta}{2\pi}\int_{\Sigma} F$

Here the spacetime is a Riemann surface $\Sigma$ with volume form $d^2 x$; $A$ is a connection on a principal $U(1)$ bundle $P\rightarrow\Sigma$ with curvature $F$; $\phi$ is a section of a complex line bundle associated to $P$ by a 1d unitary representation $R$ of $U(1)$ with covariant derivative $d_A$; and $e$, $a$, and $\theta$ are parameters of the theory. Note that the “theta angle term” does not depend on the metric. Indeed it is proportional to the first Chern number of $P$.

At low energies, to minimize the action, $\phi$ wants to have magnitude $a$. It becomes constrained to the radius $a$ circle bundle in the line bundle $P\times_R \mathbb{C}$ (where $\phi$ lives in general). In other words, any finite action configuration must satisfy $\phi \sim a exp{i \alpha}$ at infinity, where $\alpha : \partial \Sigma \rightarrow U(1)$.

A gauge transformation is determined by a map $\beta : \Sigma \rightarrow U(1)$ and sends $\alpha$ to $\alpha + \beta$, where I write $U(1)$ additively. If $\alpha$ extends to a map on all of $\Sigma$, we can use a gauge transformation to fix $\phi$ to be real. This is not the case in general, but it is the case if $\phi$ is nowhere vanishing. If we make the additional assumption that $\frac{1}{e}\ll \lambda a^4$, there is no trouble. (This is resolved another way if the spacetime is not compact, but that’s a story for another time). In this case, the cost of a large vanishing set is large due to the potential term $latex \frac{\lambda}{4}(|\phi|^2-a^2)^2$.

Thus, for configurations with small action we can perform a gauge transformation that forces $\phi$ to be of the form $a + w$, where $w$ is a real field representing fluctuations of $\phi$ about the vacuum value $\phi = a$. This “spends” or “breaks” the $U(1)$ symmetry (we have picked a representative of an equivalence class). We are left with an effective low energy action

$\frac{1}{4e} \int d^2 x |F|^2 + \frac{1}{2} \int d^2 x a^2 A^2 + \int d^2 x ((dw)^2 + \lambda a^2 w^2)- \frac{i \theta}{2\pi}\int F$.

Our old theory had a massless gauge boson $A$ and a massless charged scalar $\phi$. We see that after symmetry breaking the theory has a massive gauge boson $A$ with mass $a^2$ and a massive real scalar $w$ with mass $\lambda a^2$. This is the famous Higgs mechanism.

In this limit, the theta angle has a funny behavior. Because the section $\phi$ must have zeros representing the first Chern class of $P$, if $P$ is topologically nontrivial, the potential term costs a large amount of action along this zero locus. Thus, in perturbation theory to any finite order in $e^2$, the theta angle contributes nothing to any observable. Nonetheless, in the quantum theory, there are corrections due to instantons (something I’ll definitely talk about later when I understand more about localization) that makes the theory depend on $\theta$. One finds that the partition function is

$Z(\theta) = \int DA D\phi D\bar{\phi} e^{-S}=e^{V P_0}e^{2 P e^{-I} cos \theta}$,

where $V$ is the volume of $\Sigma$, $P_0$ and $P$ are numerical constants, and $I$ is the instanton action.

Consider a Wilson loop along $\gamma : S^1 \rightarrow \Sigma$ of charge $\lambda \in \mathbb{R}$ (1d unitary representations of $\mathbb{R}$, the universal cover of $U(1)$ are labelled by real numbers). To calculate the expectation value of the Wilson loop, ie. the expected phase of a monopole with electric charge $\lambda$ travelling around the loop, we use the path integral to average

$e^{i \lambda \int_\gamma A}$

over all field configurations, weighted by $e^{-S}$, where $S$ is the action. This should be read as the trace in the representation $R$ (corresponding to $\lambda$) of the holonomy of the connection $A$ around the loop $\gamma$. This only makes sense for noninteger $\lambda$ if $\gamma$ is homologically trivial. For instance if $\gamma$ is bounded by $C$, the Wilson loop becomes

$e^{i \lambda \int_C F}$

and $F$ is gauge invariant. This is the case we will consider.

The Wilson loop expectation is then

$\frac{1}{Z}\int DA D\phi D\bar{\phi}e^{-S}e^{i\lambda \int_C F}$

The Wilson loop divides the surface $\Sigma$ into an inner and an outer region. Because the theory has a mass gap (so massive excitations have a uniform exponential upper bound to their decay over $\Sigma$), we expect the path integral above to separate into a product of path integrals over $C$ and over $\Sigma - C$.

Now note that the Wilson loop term is of the same form as the theta angle term in the action. The path integral over $C$ and $\Sigma - C$ are each expressed by the partition function on those spaces. Let $A_C$ be the area of $C$. Then from what we know the partition function to be,

$\langle e^{i\lambda \int_C F} \rangle = \frac{1}{Z(\Sigma,\theta)} Z(C,\theta+2\pi\lambda) Z(\Sigma-C,\theta)$

$= e^{A_C (E(\theta)-E(\theta+2\pi\lambda))}$,

where $E(\theta)$ is the vacuum energy defined by $Z(\theta) = e^{V E(\theta)}$. For $\theta = 0$, the exponent is $E(0)-E(\lambda) = 2(cos(2\pi\lambda)-1)e^{-I}P$. Thus, we see that even though the theory is a Higgs theory, we see confinement for $\lambda$ not an integer. When $\lambda$ is an integer, we have $cos(2\pi\lambda)-1 = 0$ and the theory is not confining, as I said we expect “physical” charges coming from representations of $U(1)$ to never be confined.

### T-duality for sigma models

First post! Today I’d like to work out an example of T-duality, a crucial piece of the mirror symmetry puzzle. Along the way I’ll show you the appearance of a curious thing called the B-field, which serves as the extra bit of information in a “complexified” Kahler structure, and we’ll see some hints of the modular invariance of string theory…

A sigma model is a quantum field theory with a scalar field

$\sigma : \Sigma \rightarrow M$

at center stage. Here, when $M$ is the real numbers and $\Sigma$ is spacetime, then we have the ordinary notion of a real scalar field. Often, however, we think of $\Sigma$ as the worldspace of some perhaps-extended object such as a string and $M$ either as spacetime or as some moduli space. In the first case, this describes how the worldsheet of the string is embedded in spacetime via a field on the worldsheet itself. Scalar, by the way, means that under an isometry $\alpha$ of $\Sigma$ , $(\alpha \sigma)(x)=\sigma(\alpha^{-1}x)$.

We will consider the case $\Sigma = \mathbb{R}\times S^1$. We give this a metric with signature + – so that the circle has length 1, and we think of the $\mathbb{R}$ factor as the time direction.

The action which is easiest to consider is the free one:

$\frac{1}{2}\int_\Sigma d\sigma \wedge *d\sigma$.

If we let $M$ be a circle of radius $R$, we find that the partition function is invariant under the exchange $R \leftrightarrow 1/R$. This is called T-duality and is beautifully derived in chapter 11 of Clay Math’s Mirror Symmetry. I want to consider the case when $M$ is a torus $\mathbb{C}/\Lambda$, where we have the lattice $\Lambda = \left$, where $r$ is real. (This disagrees with the convention in the Clay Math Mirror Symmetry text, where they would use $M = \mathbb{C}/2\pi\Lambda$.) When the torus is rectangular, ie. $\tau$ is imaginary, we can think of $M$ as a product of two circles of radius $R_1=r$ and $R_2=-i\tau$, so the complex structure is given by the modulus $R_1/R_2$. The Kahler structure, meanwhile, is just the area $A=R_1 R_2$. We see that T-duality on one of the circle factors exchanges the complex and Kahler structures of the target space. However, when $M$ is not rectangular, the complex structure is complex, and it seems the duality breaks down unless we turn the Kahler structure also into a complex parameter.

The way we do this is by adding a “B-field” to the action. This is a background field, meaning we just pick some cohomology class $B \in H^2(M,\mathbb{R})$ and the new action is

$\frac{1}{2}\int_\Sigma d\sigma \wedge * d\sigma -\int\sigma^*B$.

Now we can consider the complexified Kahler parameter $\rho = B/2\pi + iA$. We will find by a calculation that the partition function is invariant under the exchange $\rho \leftrightarrow \tau/r$ (we replace $\tau$ with a representative in a standard fundamental domain of the modular group $SL(2,\mathbb{Z})$). This does not prove the duality for this theory. It only gives an indication. The partition function is the most basic observable of a quantum field theory. If we wanted to prove the duality outright, we would have to show invariance of all observables under this duality transformation. This is best shown by a path integral manipulation, examples of which I will likely discuss some other time. Anyway…

The partition function is defined to be

$Z(\beta)=\mathrm{Tr} e^{-\beta H}$,

where $H$ is the Hamiltonian. This is equivalent to evaluating the path integral with periodic temporal boundary conditions over a time $\beta$, ie. over a rectangular torus worldsheet, $\Sigma$ of temporal length $\beta$ (it is easy to confuse this with the target torus, $M$). We can enrich this by considering a nonrectangular worldsheet, say one with modulus $\beta=\beta_1+i\beta_2$. Such a torus has temporal length $\beta_2$ and spacial twist $\beta_1$. The worldsheet momentum operator, $P$ generates spacial translation, so this corresponds to the partition function

$Z(\beta)=\mathrm{Tr}e^{-2\pi i\beta_1 P}e^{-2\pi i \beta_2 H}$.

We can define right moving and left moving Hamiltonians

$H_R = \frac{1}{2}(H-P)$

$H_L = \frac{1}{2}(H+P)$,

as well as the modular parameter $q=e^{2\pi i \beta}$, so

$Z(\beta) = \mathrm{Tr}q^{H_R}\bar{q}^{H_L}$.

This technique allows us to continue thinking about the worldsheet as a rectangular tube.  An aside : it turns out that $H_R$ and $H_L$ are the generators of time translation for the two chiral factors of the Virasoro algebra, though I do not yet understand this. Now I’ll move on to quantizing the classical theory just described. (I haven’t yet told you what $H$ is or even what Hilbert space it acts on!)

Fixing $t$, $\sigma(t,-)$ describes a loop in $M$. Time translation defines a homotopy of loops (without basepoint), so the theory will have a conserved charge in $\pi_1(M)^{ab}=H_1(M,\mathbb{Z})=\Lambda$, defining so-called topological sectors into which the Hilbert space splits as a direct sum.

As for the Hilbert space of each topological sector, every $\sigma$ in the $\vec{v}\in\Lambda$ sector of the Hilbert space can be written as a product $\sigma_0 \sigma_{\vec{v}}$ for some “zero mode” $\sigma_0$ in the contractible sector and any representative $\sigma_{\vec{v}}$ of the $\vec{v}$ sector. It therefore suffices to understand those maps which can be unwound. We can think of this theory of zero modes as a sigma model with target $\mathbb{R}^2$. This is because the topologically trivial maps are precisely those that lift to the universal cover $\mathbb{C}=\mathbb{R}^2$ of $M=\mathbb{C}/\Lambda$. This lifting is unique up to the action of $\Lambda$. States in such a theory are labelled by their momenta (they are real scalars, hence have no spin or parity, etc.), so it remains to determine the momentum spectrum.

Write $\sigma = (y_1,y_2)$ in terms of the period 1 coordinates along the basis for $\Lambda$. The canonical momenta for $y_1$ and $y_2$ are obtained from the Lagrangian by $j_{1,2}=\frac{\delta L}{\delta y_1,y_2}$. We can write

$\sigma^* B = B dt \wedge d\theta (y_{1t} y_{2\theta}-y_{1\theta} y_{2t})$,

$\sigma_t^2-\sigma_\theta^2 = (y_{1t}+\tau_1 y_{2t})^2 + \tau_2^2 y_{2t}^2-(y_{1\theta}+\tau_1 y_{2\theta})^2 - \tau_2^2 y_{2\theta}^2$.

From this, we find

$j_1 = y_{1t} + \tau_1 y_{2t} - B n_2 \tau$

$j_2 = \tau_2 y_{2t} + \tau_1 y_{1t} + B n_1 r$,

where we are in the topological sector $\vec{v}=n_1r + n_2\tau$. Thus, the spectrum of the target space momentum operators for the theory with the B-field can be obtained from the spectrum without the B-field by a shift. If we were calculating the partition function within a particular topological sector, this would not matter. It would contribute an overall constant factor to the partition function, which is unphysical. However, when we consider the whole partition function, the relative shifts matter.

Consider the sigma model with target $M$ and no B-field. If $\sigma$ is in the $(a,b)$ sector, we can take the Fourier expansion $\sigma (\theta,t) = \sum \sigma_n (t) e^{in\theta}+(a r + b \tau )\theta$. We calculate

$\frac{1}{4\pi}\int d\theta\sigma_t^2 = \frac{1}{2}\dot\sigma_0^2+\sum |\dot\sigma_n|^2$

$\frac{1}{4\pi}\int d\theta\sigma_\theta^2 = \frac{1}{2}|a r + b \tau|^2 + \sum n^2 |\sigma_n|^2$

With this in hand, the action decomposes into a sum of harmonic oscillators $|\dot\sigma_n|^2 - n^2 |\sigma_n|^2$, a massless mode $\frac{1}{2} \dot\sigma_0^2$, and a constant factor from the winding numbers. Here, $\sigma_0$ takes values in $\mathbb{R}^2$ and $\sigma_n$ takes values in $\mathbb{C}^2$. We can find the classical Hamitonian by the Noether procedure:

$H=\frac{1}{4\pi}\int d\theta(\sigma_t^2+\sigma_\theta^2)$

We can think of each oscillator as two identical uncoupled oscillators and handle each of these in the ordinary way by introducing creation and annihilation operators $\alpha_{-n}, \tilde\alpha_{-n}$ and $\alpha_n, \tilde\alpha_n$ and a lowest energy state $|0\rangle _n$ annihilated by $\alpha_n$ and $\tilde\alpha_n$. This will be a short hand for us. Later we will have to square the contribution from a single oscillator to account for the complete pair. The Hilbert space is spanned by the descendants of this state, ie. it’s Verma module. On it, the Hamiltonian is

$H = \alpha_{-n}\alpha_n+\tilde\alpha_{-n}\tilde\alpha_n+n$.

The half-Hilbert space of all these single oscillators is the tensor product of these Verma modules for $n>0$ with the Hamiltonian

$\sum\alpha_{-n}\alpha_n+\sum\tilde\alpha_{-n}\tilde\alpha_n-1/12$,

where I use zeta function regularization $\sum n = -1/12$. This regularization scheme is necessary for modular invariance to be preserved. I suspect it has much to do with why modular forms keep popping up in conformal field theory.

The massless mode, meanwhile, has a Hilbert space spanned by a basis of target space momentum eigenfunctions. To get the correct spectrum for these modes, we need to think about the quotient $M$ again. Target space translations are generated by the target space momentum operators, $J=(J_1,J_2)$ (not to be confused with the worldsheet momentum $P$ above). For any vector $v \in \Lambda$, we should have

$e^{ 2\pi iJv} = \mathrm{id}$

since this just corresponds to circling around the torus $M$ a few times and ending up in the same spot. Thus, the eigenvalues of $J$ are contained in the dual lattice $\Lambda^*$. Here I use the shorthand $Jv = J_1 v_1 +J_2 v_2$. I will use similar shorthand to talk about eigenvalues (an “eigenvalue” of $J$ will be a vector in $\mathbb{R}^2$). This is just to emphasize the fact that the quantization does not depend on the coordinates of the target space. Note that $J_1$ and $J_2$ are the quantized versions of $j_1,j_2$ considered above. In other words, $J=(J_1,J_2)$ is canonically conjugate to the target space position operator $Y = (y_1,y_2)$. $J$ is the operator whose spectrum is shifted by the addition of a B-field.

It is easy to come up with eigenfunctions for every element of the dual lattice, so $\Lambda^*$ is precisely the target space momentum lattice of the system.

The Hamiltonian for the massless mode is just

$H = \frac{1}{2}J^2$.

We have a copy of the ground state $|0\rangle$ defined above for each target space momentum $j \in \Lambda^*$–call it $|j\rangle$–such that

$J|j\rangle = j|j\rangle$.

To finish off the construction of the quantum Hamiltonian, we need to handle the winding number term. We introduce operators $W=(W_1,W_2)$ that count the winding number. Here I use the same shorthand as $J$. We have a ground state $|j\rangle$ as defined above for every winding number $k\in\Lambda^*$, which we call $|j,k\rangle$. Then we want

$W|j,k\rangle = k|j,k\rangle$

There is clearly some analogy between $W$ and $J$. Indeed, we should include in our discussion a canonically conjugate operator $\hat{W}$ analogous to the target space position operator $Y$. We should have

$e^{2\pi i Y u} |j,k\rangle = |j,k+u\rangle$

$e^{2\pi i \hat W v} |j,k\rangle = |j+v, k\rangle$.

In summary, the quantum Hilbert space has a unique ground state $|0,0\rangle$ and other states $|j,k\rangle$ are obtained by applying $Y$ and $\hat W$. Then we have, for each $|j,k\rangle$ its Verma module for the creation and annihilation operators $\alpha_n, \tilde\alpha_n$ for each $n$. We can write down the quantum Hamiltonian for an arbitrary sector of the Hilbert space:

$H=\frac{1}{2}(W^2+J^2)+\sum\alpha_{-n}\alpha_n+\sum\tilde\alpha_{-n}\tilde\alpha_n-1/12$

To find the left-moving and right-moving Hamiltonians, we need to also find the worldsheet momentum $P$ for this model. We can obtain this from the spacetime translations using the Noether procedure as we did for the Hamiltonian. The Hamiltonian is a diagonal element of the stress-energy, and the momentum is an off-diagonal one. This determines them up to signs as the stress-energy for these theories is antisymmetric (a hint of their conformal invariance!). We find that the classical worldsheet momentum is

$\frac{1}{2\pi} \int d\theta \sigma_t \cdot \sigma_\theta=\dot\sigma_0 \cdot j+\sum n \sigma_n \cdot \dot\sigma_{-n}$.

The evident quantized operator, using the definitions of the creation and annihilation operators, is

$P = J W - \sum \alpha_{-n} \alpha_{n}+\sum \tilde\alpha_{-n}\tilde\alpha_n$.

Here I note that $J$ and $W$ commute since they are simultaneously diagonalized by $|j,k\rangle$. Then we see

$H_R = \frac{1}{2}(H-P) = \frac{1}{4}(J-W)^2+\sum \alpha_{-n}\alpha_n-1/24$

$H_L = \frac{1}{2}(H+P) = \frac{1}{4}(J+W)^2 + \sum \tilde\alpha_{-n}\tilde\alpha_n-1/24$

We see from this that the only terms affected by the B-field is the zero mode terms $\frac{1}{4}(J\pm W)$. The oscillator terms are unaffected, so we can calculate them outright. Recall our short hand that cuts down the number of oscillators by half, so we must square the contribution to the trace. An easy calculation shows that they contribute a factor of

$(q\bar{q})^{-1/12}\prod |\frac{1}{1-q^n}|^4 = |\eta(\beta)|^{-4}$,

where $\eta$ is the Dedekind eta modular form. This is where the factor of $1/12$ is crucial to modular invariance. Go figure.

Without the B-field, the contribution from the zero modes is

$\sum_{w,j \in \Lambda \oplus \Lambda^*} q^{\frac{1}{4}|j-w|^2}\bar{q}^{\frac{1}{4}|j+w|^2}$.

With the B-field, the entire partition function becomes

$Z(\beta) = |\eta(\beta)|^{-4} \sum_{w,j \in \Lambda \oplus \Lambda^*} q^{\frac{1}{4}|j-w+\hat{B}w|^2}\bar{q}^{\frac{1}{4}|j+w+\hat{B}w|^2}$,

where $\hat{B}$ is the matrix

$\begin{pmatrix} 0 & B \\ -B & 0 \end{pmatrix}$.

A quick inspection shows that this is indeed invariant under the change $\tau/r \leftrightarrow \rho$, where $\rho$ is defined above.
What does this symmetry represent purely in terms of the lattices involved? What is this business with the B-field really about from a geometric standpoint?