Twist-field representations of W-algebras, exact conformal blocks and character identities

We study the twist-field representations of W-algebras and generalize construction of the corresponding vertex operators to D- and B-series. It is shown, how the computation of characters of these representations leads to nontrivial identities involving lattice theta-functions. We also propose a way to calculate their exact conformal blocks, expressing them for D-series in terms of geometric data of the corresponding Prym variety for covering curve with involution.

the asymptotic behavior of the conformal block on the boundary of the moduli space [7]. It turns out that for the general W N algebra it is no longer enough to do this by fixing quantum numbers in the intermediate channels. Even for three points on sphere, the vector space of conformal blocks becomes infinite dimensional for W N algebras with N > 2.
However, for certain particular cases this conformal block can be constructed explicitly applying some extra machinery. In what follows we first restrict ourselves to the case of integer and sometimes half-integer Virasoro central charges, when representations W-algebras are more directly related to the representations of the corresponding Kac-Moody (KM) algebras (of level k = 1), and the corresponding field theories can be directly described by free fields [8].
One of the recent methods [9] reduces the problem here to a Riemann-Hilbert problem, arising in the context of the isomonodromy/CFT correspondence [10,11,12]. The key idea of this approach is to extract concrete conformal block by implying condition that it has predictable monodromies after insertion of the simplest degenerate fields, or fermions. Morally saying, it means that we fix the 3-point blocks as eigenvectors of Verlinde loop operators and parameterize them by monodromy data.
Even in such situation, in case of generic monodromies one cannot write explicit formula for conformal block. Below, following [13], we are going to restrict ourselves to the case of so-called twist fields [14], corresponding to quasi-permutation monodromies, when the representations of the W-algebras become related to the twisted representations of the corresponding KM algebras 1 [15,16].
The paper is organized as follows. We start from the formulation of the representations of KM and W-algebras in terms of free bosons and fermions, remind first the GL(N) case and extend it to the D-and B-series, using real fermions. We define then the twist field representations corresponding to the elements of Cartan's normalizer g ∈ N G (h) together with some extra data (to be denoted asġ andg, see the details in Sect. 3 below). Bosonization of twist fields essentially depends on the conjugacy classes in the N G (h). We classify such classes for G = GL(N) and G = O(n) (for n = 2N and n = 2N + 1) and define the twist fields O g in terms of the boundary conditions and singularity structure in corresponding free theory.
Bosonization rules allow to compute easily the characters χ˙g(q) of the corresponding representations. For the twist fields of "GL(N) type" this goes back to the old results of Al. Zamolodchikov and V. Knizhnik, and we develop here similar technique in the case of real fermions and another class of twist fields, arising in D-and B-series. The character formulas include summations over the root lattices, reflecting the fact that we deal here with the class of lattice vertex algebras. Dependently of the conjugacy class g ∈ N G (h) of a twist field the lattice can be reduced to its projection to the Weyl-invariant part, in this case the "smaller" lattice theta functions show up, or we find even a kind of "exchange" between those for D-and B-series.
If two different elements g 1,2 ∈ N G (h) are nevertheless conjugated g 1 ∼ g 2 in G (but not in N G (h)), this gives for appropriate additional data a nontrivial identity χ˙g 1 (q) = χ˙g 2 (q) between two characters, involving lattice theta-functions. Such character identities go back to 1970's (see [17], [18]) and even to Gauss, but our derivation gives probably the new ones, involving in particular the theta functions for D-and B-root lattices.
We propose construction of the exact conformal blocks of the twist fields for W-algebras of D-series, generalizing approach of [14,13], and obtain an explicit formula, expressing multipoint blocks in terms of the algebro-geometric objects on the branched cover with extra involution.
The basis of the generators of W (gl(N)) = W N ⊕ H algebra can be chosen in several different ways. In what follows the most convenient for our purposes is to use fermionic bilinears N α=1 ψ * α z + 1 2 t ψ α z − 1 2 (2.8) or, using the Hirota derivative D n z f (z) · g(z) = (∂ z 1 − ∂ z 2 ) n f (z 1 )g(z 2 )| z 1 =z 2 =z , : ψ * α (z) · ψ α (z) : (2.9) while another useful basis is the bosonic representation The formula (2.10) is equivalent to quantum Miura transform from [1]. To explain that the formula (2.9) is actually equivalent to (2.10) one can use description of W (gl(N)) as centralizer of screening operators, which coincide with gl(N) in this case. It is already proven that (2.10) is centralizer of screening operators [20], so it remains to show that (2.9) is centralizer as well, what can be done in several steps: 1. Consider all normally-ordered fermionic monomials : i ∂ k i ψ α i (z) i ∂ l i ψ * β i (z) :, which transform as tensors under the action of GL(N). By First fundamental theorem of invariant theory [21] the only invariants in such representation are given by all possible contractions, so they can be written as : i ( α ∂ k i ψ α (z)∂ l i ψ * α (z)) :.
Hence, the generators {U k (z)} are expressible in terms of {W k (z)} (and vice versa) by some non-linear triangular transformations, but we do not need here these explicit formulas 3 .
As before, we define the W-algebra W (so(n)) as commutant of so(n) ⊂ so(n) 1 . In contrast to the simply-laced cases we find this commutant for B-series not in completion of the U( so(2N + 1) 1 ), but in the entire fermionic algebra. An inclusion of algebras gl(N) ⊂ so(2N), acting on the same space, leads to inverse inclusion W (so(2N)) ⊂ W (gl(N)) (2.23) Similarly to (2.9) one can present the generators of the W (so(n))-algebra explicitly, using the real fermions The last current is bosonic in D N case and fermionic for B N . These expressions are obtained analogously to (2.9) with the help of invariant theory, the only important difference is that for SO(n) case there is also completely antisymmetric invariant tensor. We can rewrite these expressions using complex fermions (for the D N case one should just put here Ψ(z) = 0 in the expressions for U-currents and Ψ(z) = 1 in the expressions for the V -current) It is easy to see that odd generators vanish U 2k+1 = 0, while even generators in D N case coincide with those in W (gl(N)) algebra So finally we have the following sets of independent generators: 3 Twist-field representations from twisted fermions

Twisted representations and twist-fields
For any current algebra, generated by currents {Φ I (z)}, the commutation relations follow from their local OPE's However, to define the commutation relations, in addition to local OPE's one should also know the boundary conditions for the currents: in radial quantization -the analytic behaviour of Φ I (z) around zero. Any vertex operator V g (0), e.g. sitting at the origin 4 , can create nontrivial monodromy for our currents: for some linear automorphism of the current algebra.
Example Perhaps the simplest example of such nontrivial monodromy is the diagonal transformation of the fermionic fields which just shifts the mode expansion indices Instead of the OPE (2.2) one gets therefore which means that for the shifted fermions (3.4) one should use different normal ordering: This implies that for the diagonal components gl(N) 1 algebra one has extra shift J α (z) → J α (z) + θα z , while for the non-diagonal currents we obtain so that the commutation relations for this "twisted" Kac-Moody algebra become We see that these commutation relations differ from the conventional ones (2.7) only by the extra shift which can be hidden into the Cartan generators J αα,0 . However, in the twisted case gl(N) 1 does not contain zero modes, and we cannot think about the W-algebra as about commutant of some gl(N). But nevertheless we define the currents One can still use two basic facts: • since U k (e 2πi z) = U k (z), they are expanded in integer powers of z as before; • they satisfy the same algebraic relations for all values of monodromies {θ α }, because the OPE's of ψ α , ψ * α (and so the OPE's of U k ) do not depend on these monodromy parameters.
Consider now more general situation, when i.e. unlike (3.3), the monodromy is no longer diagonal 5 . It is clear that then the action on The most general transformation we consider in the O(n) case mixes ψ and ψ * : where it is convenient to introduce conventions ψ * −α = ψ α , α > 0, and ψ 0 can be absent. Matrix g here should preserve the anticommutation relations.
Consider now a sequence of algebras W algebra ⊂ Heisenberg algebra h ⊂ KM-algebra ⊂ Fermions.
Taking an element g ∈ G we construct a twisted representation of the fermionic algebra ψ, ψ * . Then, for G = GL(N) or G = SO(2N) one gets the KM algebra as invariant of the group Γ, acting on fermionic algebra. The group Γ is U(1) and Z/2Z in two cases correspondingly. Therefore the twisted representations of KM algebra are labeled by pairs (g, representation of Γ), in what follows we denote such pair byġ. We also denote by H˙g the corresponding representation of the KM algebra for G = GL(N) or G = SO (2N). For the G = SO(2N + 1) case H˙g is a representation of the fermionic algebra itself. Explicit description of H˙g and calculation of its characters is given in Section 4 using bosonization. However, to use bosonization one has to restrict the elements g ∈ N G (h) ⊂ G to the Cartan normalizer, and this will be the key object in our definition of the twist fields. In particular, bosonization means that we consider the space H˙g as a sum of twisted representation of the Heisenberg algebra h. These representations depend not only on the elements g ∈ N G (h) but also on additional data: eigenvalues of the zero modes in h. This extra, to be called r-charges below, data has discrete freedom, since the exponents of such eigenvalues are specified by g. We denote below the most refined data asg = (g, r). Finally, we consider the twisted representations of Heisenberg as representations of the W-algebra, already untwisted since W-algebra generatots are G-invariant.

Definition 1
We call the vertex operator V g = O g a twist field when g lies in the normalizer Such elements also preserve the Heisenberg subalgebra h = J 1 (z), . . . , J rank g (z) ⊂ g 1 g hg −1 = h (3.14) If different elements g 1 , g 2 ∈ N G (h) are conjugated in G: g 1 = Ωg 2 Ω −1 , then such conjugation identifies g 1 and g 2 twistings of the fermionic algebras. This conjugation also induces one-to-one correspondence between the set ofġ 1 and the set ofġ 2 , and maps the twisted representation H˙g 1 to H˙g 2 .
More formally, if we denote corresponding representations by T˙g(ĝ) :ĝ → EndH˙g, and the action of Ω by Ω 12 : H˙g 1 → H˙g 2 , then we have Ω 12 T˙g 1 (J(z))Ω −1 12 = T˙g 2 (J(z) Ω ). Note, that twisted representations of KM algebra H˙g 1 , H˙g 2 are not isomorphic due to appearance of conjugation by Ω: the current J(z) can have different monodromies in H˙g 1 and H˙g 2 . But the corresponding representations of W-algebra become equivalent (up to external automorphism in case of SO(2N)), see details in sec. 4.6. 6 .
If g 1 = Ωg 2 Ω −1 , with Ω ∈ N G (h), then the conjugation by Ω preserves h. Therefore this conjugation induces the transformation of twisted representations h in H˙g 1 into twisted representations of h in H˙g 2 , and induces one-to-one correspondence between the sets ofg 1 andg 2 . Hence we have an action of N G (h) on the set ofg.
Below we describe the structure of the Cartan normalizers N GL(N ) (h) and N O(n) (h) and specify notationsġ andg in these cases explicitly. We also describe the representatives of the all orbits in the set ofg under the action of N G (h).

Cartan normalizers
Structure of the Cartan normalizer for gl(N). Let us choose the Cartan subalgebra in a standard way h ⊃ diag(x 1 , . . . , x N ), so conjugation (3.13) can only permute the eigenvalues. Therefore we conclude that (3.15) or just g is a quasipermutation.
Let us now find the conjugacy classes in this group. Any element of N GL(N ) (h) has the form g = (c 1 . . . c k , (λ 1 , . . . , λ N )), where c i are the cyclic permutations -their only parameters are lengths l j = l(c j ). It is enough to consider just a single cycle of the length l = l(c) g = (c, (λ 1 , . . . , λ l )) (3.16) since any g can be decomposed into a product of such elements. Conjugation of this element by diagonal matrix is given by Therefore one can always adjust {µ i } to replace all {λ i } by the same number, e.g. to put These "averaged over a cycle" parameters have been called as r-charges in [13]. Hence, all elements of g ∈ N GL(N ) (h) can be conjugated to the products over the cycles where ψ α+l = ψ α , and we have included extra factor e iπ l−1 l into the definition of transformation in order to have simple formula det[l, e 2πir ] = e 2iπrl (3.20) and to simplify the identification between r and U(1) charge in Appendix B.3. In this caseġ is just a pair (g, tr log g), the value of tr log g is defined up to 2πZ, and this freedom corresponds to the representation of Γ = U(1) mentioned above. Elementg contains information about all r-chargesg = (g, r), for given g the r-charge r j is defined by g up to the shift by 1 l j Z. Ifg 1 andg 2 correspond to the sameġ, then the corresponding r-charges differ the by shift in certain lattice, see character formula (4.4) in Sect. 4. dψ −α dψ α + dΨ 2 (the last term is present only for the B N -series). In this basis the so(n) algebra (the algebra, preserving this form) becomes just the algebra of matrices, which are antisymmetric under the reflection w.r.t. the anti-diagonal. In particular, the Cartan elements are given by for B N -series (and for the D N -series 0 in the middle just should be removed). The action of an element from N O(n) (h) should preserve the chosen quadratic form, and, when acting on the diagonal matrix (3.21), it can either permute some eigenvalues, also doing it simultaneously in the both blocks, or interchange x α with −x α (the same as to change the sign of x α ). It is defined in this way up to a subgroup of diagonal matrices themselves. In other words where the last factor Z/2Z comes from changing sign of the extra fermion Ψ. This triple (s, σ, λ) ∈ N O(n) (h), with s ∈ S N , σ α ∈ Z/2Z and λ α ∈ C × , is embedded into O(n) as follows and in these formulas ψ −α = ψ * α and ψ * −α = ψ α is again implied. The structure of the actions in the semidirect product has the obvious from: Notice that normalizer of Cartan in SO(n) is distinguished by condition that N α=1 σ α = 1, and the Weyl group is given as the factor of this normalizer by the Cartan torus W(so(n)) = N SO(n) (h)/H (3.26) Consider now the conjugacy classes in N O(n) (h). First, conjugating an arbitrary element (s, σ, λ) by permutations, we again reduce the problem to the case when s = c is just a single cycle. Then one can further conjugate this element by (Z/2Z) N : and solving equations for {ǫ α }, remove all σ α = −1, except for, maybe, one. Hence: • For σ = (1, . . . , 1) the situation is the same as in gl(N) case: we can transform λ to (λ, . . . , λ). These conjugacy classes are therefore the same (but denoted by [l, λ] + ): • For, say, σ = (−1, 1, . . . , 1) let us conjugate this element by (1, 1, µ): In contrast to the previous case, here one can put all λ ′ i = 1, since one can put first µ 2 1 = i λ −1 i , and then solve N − 1 equations µ i+1 = λ i µ i not being restricted by any boundary conditions. It means that Therefore we can formulate: Lemma 1 One gets for the conjugacy classes and we are now ready to describe the twist fields in detail. As in the GL(N) case, to be precise one should add explicit values of the r-charges, i.e. to consider pairsg = (g, r). Moreover, for even n = 2N it is also useful to introducė g = (g, r), where r ∈ R K /Q D K is defined up to addition of the vectors from D K root lattice: r ∼ r mod Q D K 7 (for odd n we just takeġ = g).

Twist fields and bosonization for gl(N )
Take an element (3.18), whose action on fermions (in the fundamental and antifundamental representations), say for a single cycle, is g : (ψ * α (z), ψ α (z)) → (e iπ l−1 l e 2πir ψ * α+1 (z), e iπ 1−l l e −2πir ψ α+1 (z)), mod l (3.32) while the corresponding (adjoint) action on the Cartan is just Such formulas have simple geometric interpretation [25]: there is the branched cover in the vicinity of the point z = 0 given by ξ l = z, so that all these (fermionic and bosonic) fields are actually defined on different sheets ξ (α) = z 1/l e 2πiα/l of the cover: Using these formulas one can write down expansions for the fields on the cover, whose OPE's would be locally given bỹ Now one write for the mode expansion of fermions, which are already twisted on the covering curve by e 2πiσ : Due to (3.32) one should have ψ * (e 2πil z) = (−1) l−1 e 2πilr ψ * (z) and ψ(e 2πil z) = (−1) l−1 e −2πilr ψ(z), therefore one can take σ = lr, so that: with the commutation relations between their modes being J n/l , J m/l = nδ n+m,0 n, m ∈ Z (3.39) These twisted bosons provide one of the convenient languages for the twist field representations. The other one is provided by bosonization of the constituent fermions with the fixed fractional parts of the power expansions in (3.37) The corresponding bosons (see (B.45) in Appendix) always have integer mode expansion.

Twist fields and bosonization for so(n)
Let us mention first, that there is a difference between the groups N O(n) (h) and N SO(n) (h), since the action of the first one can also map V (z) → −V (z), so that one of the generators of the W-algebra V (e 2πi z) = −V (z) becomes a Ramond field, and we allow this extra minus sign below 8 . In addition to the conjugacy classes [l, λ] + , similar to those of gl(N), we now also have to study [l] − 's. First one has to identify the action of N O(n) (h) on the fermions, where just by definition: This means that the element of our interest is the complete cycle Therefore 2N complex fermions can be realized as a pushforward of a single real fermion η(ξ), living on a 2l-sheeted branched cover Here the branched cover z = ξ 2l can be realized as a sequence of two covers π 2 : ξ → ζ = ξ 2 and π l : ζ → ζ l = z, and it leads to more tricky global construction of the exact conformal blocks, see sect. 6 below.
which generates the global automorphism of the cover of order two, which is continued to the global automorphism of algebraic curve during the consideration of exact conformal blocks in sect. 6. It acts locally by ξ → −ξ. Using this element one can write the OPE of η(ξ) in the form: Now the analytic structure of this field can be obtained In order to ensure right monodromies (3.43) for ψ, ψ * one should get powers 1 2l Z in the r.h.s., which means that σ ∼ l − 1 2 ∼ 1 2 , and η(ξ) turns to be a Ramond fermion with the extra ramification Let us now construct (a twisted!) boson from this fermion by This boson behaves like follows under the action of twist field: To realize this situation we may take the Ramond boson on the cover in variable ζ: where commutation relations of modes are given by

Inverse bosonization formula for this real fermion looks like
with the Pauli matrix σ 1 = 0 1 1 0 , and it is discussed in detail in Appendix (B.1).

Characters for the twisted modules
Now we turn directly to the computation of characters, using bosonization rules. In order to do this one has to apply the following heuristic "master formula" for the trace over the space H˙g, which is the minimal space closed under the action of both W-algebra and twisted Kac-Moody algebra. For simply-laced cases, gl(N) and so(2N), H˙g is the module of corresponding Kac-Moody algebra, whereas in the so(2N + 1) case it should be entire fermionic Fock module due to presence of the fermionic W-current. Explicit descriptions of H˙g are the following: for gl(N) it is the subspace with fixed total fermionic charge, for so(2N) it is the subspace with fixed parity of total fermionic charge, and for so(2N + 1) it is entire space. Notice that this representation depends onġ -not just g, and also it contains all representations of W-algebra with differentg corresponding to the sameġ.
Denominator of (4.1) collects the contributions from the Fock descendants of twisted bosons (parameters θ Adj,k (g) are the eigenvalues of adjoint action of g on the Cartan subalgebra), and the numerator -contribution of the zero modes. This formula is heuristic, moreover, in some important cases we also get contribution from extra fermion, sometimes it is more informative to consider super-characters etc. Below we prove the following

gl(N ) twist fields
To be definite, let us fix an element g = K j=1 [l j , e 2πir j ] from (3.18) which, according to (3.32), performs the permutation of fermions with simultaneous multiplication by e In this setting N fermions can be bosonized in terms of K twisted bosons (see details in Appendix B.3), and here we just present the final formulas for α ∈ Z/l j Z, labeling the fields within [l j ]-cycle. For the conformal dimension one gets therefore (see (B.39), and computation by alternative methods in (5.15), (6.30)) and since we are computing character of the space, obtained by the action of gl(N) 1 , we have to take into account all vacua arising after the action of the shift operators e Q (i) −Q (j) , i.e. labeled by A K−1 root lattice. Hence, the character (4.1) for this case is given by In this formula the numerator collects contributions from the highest vectors χ ZM (they differ by the value of zero modes J  Consider now the twist fields (3.31) for g ∈ N O(2N ) (h), and take first K ′ = 0, so our twist has no minus-cycles The only difference from the previous situation with the gl(N) case is that now one also have extra currents J αβ = ψ * α (z)ψ * β (z) and Jᾱ β = ψ α (z)ψ β (z). It means that due to bosonization (B.45), (4.2) possible charge's shifts now include e ±(Q (i) +Q (j) ) , so the full lattice of the zeromode charges (one zero mode for each cycle [l i , e 2πir i ] + ) contains all points with or is just the root lattice Q D K . After corresponding modification of numerator and the same contribution of the twisted Heisenberg algebra to denominator, the formula for the character in this case acquires the form Now we have extra cycles of type [l ′ i ] − , so we have extra η-fermions that have to be bosonized in a different way (B.18): where {γ i , γ j } = 2δ ij are gamma-matrices (or generators of the Clifford algebra Cl K ′ (C)) in the smallest possible representation, which make different fermions anticommuting. Due to presence of K ′ cycles of type [l ′ i ] − , the zero-mode χ ZM (q) generating operators include now γ j e Q (i) , which perform integer shifts of i-th bosonic zero mode together with inessential action on fermionic vacua -now we do not have to imply that the number of shifts by e Q (i) should be even. Hence, instead of D K -lattice from (4.7) the numerator includes now summation over the root lattice Q B K , i.e.
where factor 2 [ K ′ +1 2 ]−1 corresponds to the dimension of the smallest representation of so(K ′ ), generated by γ i γ j . Another simple factor q ∆ 0 g contains the minimal conformal dimension (without contribution of the "r-charges") which will be computed below in (5.18), (6.30). Numerator of (4.10) contains K contributions from twisted bosons corresponding to plus-cycles, and K ′ contributions from twisted Ramond bosons corresponding to minus-cycles.

so(2N + 1) twist fields
The W-algebra W (so(2N +1)) contains fermionic operator V (z) = Ψ 1 (z) . . . Ψ 2N +1 (z), which cannot be expressed in terms of generators of so(2N +1) 1 since latter are all even in fermions. It means that to construct a module of the W -algebra one should use entire fermionic algebra. Taking into account the fermionic nature of this W-algebra one can consider Z/2Z graded modules and define two different characters where F is the fermionic number: One of the characters vanishes χ − (q) = 0 if at least one fermionic zero mode exists, since each state gets partner with opposite fermionic parity. Such fermionic zero modes are always present for the Ramond fermions and η-fermions, so the only case with non-trivial χ − (q) corresponds to: In this case our computation works as follows: take bosonization for the [l] + -cycles in terms of K twisted bosons (B.45), (4.2), then the fermionic operators produce the zero-mode shifts Moreover, we also have an extra "true" fermion Ψ(z) with F = F f = 1. Therefore the total trace can be computed, separating bosons and fermions, as where the traces over bosonic and fermionic spaces are given by Hence, the final answer for this character is given by where D-and D ′ -lattices are defined in (A.1).
Let us now turn to the computation of χ + (q). Choose an element from where a = 0, 1. The bosonized fermions e iϕ (i) (z) contain elements e Q (i) generating the B K root lattice, which together with contribution of the fermionic and Heisenberg modes finally give Here the only new part, comparing to the D N -case, is extra factor corresponding to (R or NS) fermionic contribution.

Character identities
In sect. 3 we have classified the twist fields by conjugacy classes in N G (h) (more precisely, by the orbits of N G (h) on the set ofg). However, it is possible that two different elements g 1 , g 2 ∈ N G (h) in the normalizer of Cartan are nevertheless conjugated in G: g 1 = Ωg 2 Ω −1 .
As was explained in sec. 3.1, conjugation by Ω maps twisted representation H˙g 1 to H˙g 2 . The explicit formula is Ω 12 T˙g 1 (J(z))Ω −1 This theorem is sometimes an origin of non-trivial identities and product formulas for the lattice theta-functions, and below we examine such examples. gl(N) case. Here any element is conjugated to a product of cycles of length one (see the exact definition of shifted r-charge in (3.18)): where v (l,r) j = r + 1−l+2j 2l . One gets therefore an identity . All conformal dimensions for vanishing r-charges are conveniently absorbed by the Dedekind eta-functions η(q) = q 1/24 ∞ n=1 (1 − q n ). This equality of characters can be checked by direct computation, see (A.17) in Appendix A for S = {0}. For a single cycle K = 1 this gives a product formula for the lattice A N −1 -theta function (A. 16), which for N = 2 was known yet to Gauss and has been originally used by Al. Zamolodchikov in the context of twist-field representations of the Virasoro algebra.
so(2N) case. For the conjugacy classes of the first type we have again (4.22), or which leads to very similar identities to the gl(N)-case. For example, one can easily rederive the product formula [17] for the D-lattice theta function For another type of the conjugacy classes [l] − , the situation is more tricky. The corresponding η-fermion can be separated into the parts with fixed monodromies around zero: so that the only non-trivial OPE is between η (a) and η (2l−a) . In particular, η (0) and η (l) are self-conjugated Ramond (R) and Neveu-Schwarz (NS) fermions, which can be combined into newη fermion, whereas all other components can be considered as charged twisted fermions ψ,ψ * :ψ Therefore one gets equivalence whereṽ (l) j = j 2l . Moreover, if we take the product of two cycles [1] − , then we can combine a pair of R-fermions and a pair of NS-fermions into two complex fermions with charges 0 and 1 2 , therefore This means literally that a pair of η-fermions is equivalent to two charged bosons: one with charge v = 0 and another one with charge v = 1 2 . Equivalence between these two representations leads to the simple identity (B.24), (B.25): Using this identity we can remove a pair of [1] − cycles from (4.10) shifting K ′ → K ′ − 2, and add two more directions to the lattice of charges B K → B K+2 with corresponding r-charges 0 and 1 2 .
so(2N) case, K ′ = 0. We have the consequence of identity (A.17) for the case S = 2Z: so(2N) case, K ′ > 0; so(2N + 1), K ′ > 0. In these cases everything can be expressed in factorized form using (A. 19) and checked explicitly, so these cases are not very interesting.
so(2N + 1) case, NS fermion. Here in addition to all identities that we had in the so(2N) case, we have two more identities that appear because of the fact that we can combine NS (or R) fermion with a pair of NS, R fermions to get one complex fermion with twist 0 (or twist 1 2 ) and one R-fermion (or NS-fermion). Thus Thanks to these identities in the cases K ′ = 0 we can transform any character with NS fermion to a character with R fermion, and vice versa.

Twist representations and modules of W -algebras
By definition, all our twisted representations of the Kac-Moody algebra are twist-field representations of the W -algebra. As was explained in previous section, if g 1 = Ωg 2 Ω −1 , then conjugation by Ω transforms the g 1 -twisted representation to the g 2 -twisted representation. Moreover, such conjugation transforms the W -algebra generators expressed through the g 1twisted fermions to those, expressed through the g 2 -twisted fermions, with a single exception: if Ω ∈ O(n) \ SO(n), the conjugation by Ω changes the sign of the last generator V (z), see (2.24). For odd n this is equivalent to the action of the operator (−1) F on representations of W algebra, but for even n this is an external automorphism of the W -algebra (coming from external automorphism of D N ). Therefore, the representations of W -algebra corresponding to conjugated g-twists are isomorphic, except for the case when Ω ∈ O(2N) \ SO(2N) -where only external automorphism of W -algebra maps one representation to another. The last detail is not crucial if twist g commutes with a certain element of O(2N) \ SO(2N) -in this case any conjugation Ω can be reduced to the conjugation by SO (2N). This happens when g belongs to the class n j=1 [1, e 2πiv j ] + with some v k = 0 or v k = 1 2 : for example, it can be obtained from a pair of minus-cycles, or from some plus-cycle with the fine-tuned r-charge.
It is sufficient to consider the case of twisting by g ∈ H, since any element of N G (h) is conjugated to an element from H. In this case subspaces of H˙g with all fixed fermion charges become representations of W-algebra 10 . The r-charges of the corresponding representations are given by shifts of the vector r = log g 2πi by root lattice of g. The explicit formulas are given below, but we want first to comment the irreducibility of representations. The Verma modules of W -algebras are irreducible if see [28], [27] (in particular Theorem 6.6.1) or [29] (eq (4.4)). For generic r this condition is satisfied and all modules, arising in the decomposition (subspaces of H˙g with all fixed fermion charges), are Verma modules due to coincidence of the characters. If g comes from the element of N G (h) with nontrivial cyclic structure, then r is not necessarily generic. For gl(N) case, as follows (4.22), the r-charges corresponding to a single cycle do satisfy (4.35), and for different cycles this condition also holds provided r are generic (no relations between r from different cycles). The same argument works for so(2N) with "plus-cycles", but if we have at least two "minus-cycles", the corresponding r-charges can violate condition (4.35), and not only Verma modules arise in the decomposition over irreducible representations.
In any case we have an identity of characters χ˙g(q) = χ 0 (q)χ˙g(q) (4.36) where χ 0 (q) is the character of Verma module, andχ˙g(q) is the character of the space of highest vectors. Hence, there is a non-trivial statement that all coefficients of the power expansion of the ratios χ˙g(q)/χ 0 (q) are positive integers, which can be proven using identities, derived in the previous section. The list of characters of the Verma modules, appeared above, is: • gl(N), so(2N) (NS sector). Algebra is generated by N bosonic currents, each of them producing 1 n>0 (1−q n ) , so the character is 10 This is a common well-known procedure, see e.g. [26] and references therein.
• so(2N) (R sector). One of these currents, V (z), becomes Ramond, with half-integer modes: • so(2N + 1) (NS sector). One current, V (z), becomes Neveu-Schwarz fermion, so taking into account its parity we get • so(2N + 1) (R sector). In the case of Ramond fermion V (z) character χ − 0 (q) vanishes because fermionic zero mode produces equal numbers of states with opposite fermionic parities: gl(N) case. Any element is conjugated to a product of cycles of length 1, sô so(2N) case, K ′ > 0, NS-sector. Again, any element is conjugated to [1, e 2πv j ] + , sô so(2N) case, R-sector. Here any element is conjugated to [1] because contribution from the cycle [1] − to the denominator cancels contribution from the Ramond boson V (z).
5 Characters from lattice algebras constructions 5.1 Twisted representation of g 1 Now we reformulate the results of previous sections using the notion of twisted representations of vertex algebras. Recall the corresponding setting (following, for example, [16]). Let V be a vertex algebra (equivalently vacuum representation of the vertex algebra), and σ be an automorphism of V of finite order l.
giving the boundary conditions for the currents, and agree with the vacuum vector and relations in V . In particular, it follows from the σ-equivariancy Consider now a Lie group G (either GL(N) or SO(2N), N ≥ 2), with g = Lie(G) being the corresponding Lie algebra. Denote by V(g) the irreducible vacuum representation of g of the level one. This space has a structure of the vertex algebra, i.e. for any v ∈ V(g) one can assign the current A v (z), this space of currents is generated by the currents J αβ (z) from sect. 2.
The vertex algebra V(g) is a lattice vertex algebra. Let Q g denote the root lattice of g, and introduce rank of g bosonic fields with the OPE ϕ i (z)ϕ j (w) = −δ ij log(z − w) + reg, and the stress-energy tensor T (z) = − 1 2 j : ∂ϕ j (z) 2 :, then the currents of V(g) can be presented in the bosonized form where α = (α 1 , . . . , α n ) ∈ Q g and a i,m are any positive integers, while the stress-energy tensor corresponding to standard conformal vector 1 2 J 2 j,−1 |0 = τ ∈ V(g) (here J j,n are modes of the field i∂ϕ j (z)). The group G acts on V (g), and in order to use lattice algebra description we consider only the subgroup N G (h) ⊂ G which preserves the Cartan subalgebra.
In [16] the representations of the lattice vertex algebra, twisted by automorphisms, arise from isometries of the lattice Q g . Here we restrict ourself to the isometries provided by action of the Weyl group W (this case was actually considered in [30] without language of twisted representations). Let s ∈ W be an element of the Weyl group, by g we denote its lifting to G, in other words g ∈ N G (h) such that adjoint action g on h coincides with s. We consider representation twisted by such g. Setting of [16] and [30] works for special g, for example such g should have finite order, but we will expand this to the generic g ∈ N G (h). Clearly, the conformal vector τ is invariant under the adjoint action of N G (h).
The g-twisted representations of V (g) in [16] are defined as a direct sum of twisted representations of h. By {e 2πiθ Adj,k } we denote eigenvalues of s, or of the adjoint action g adj on h, we set −1 < θ Adj,k ≤ 0, by {J k ∈ h} -the corresponding eigenvectors, and define the currents J k (z) = n∈Z J k,θ Adj,k +n z −θ Adj,k −n−1 (5.4) A g-twisted representation of the Heisenberg algebra h is a Fock module F µ with the highest weight vector v µ J k,θ Adj,k +n v µ = 0, n > 0, It has been proven in [16] that twisted representations of V (g) have the structure for certain finite set of µ 0 ∈ h * 0 . Here π s denotes projection from h * to h * 0 , corresponding to the element s ∈ W for the chosen adjoint action g adj . For any root α the corresponding current J α (z) acts from F µ to F µ+πsα and equals to the linear combination of vertex operators. Number d(s) denotes the defect of the element s ∈ W, its square is defined by Here P g denotes weight lattice of g, h ⊥ 0 denotes the space of linear functions vanishing on h 0 , | · | stands for the number of elements in the group. It can be proven that for any s the numbers d(s) is integer. In our case (GL(N) and SO(n) groups) this number always equals to some power of 2.
Formula (5.6) allows to calculate the character of module M, i.e. the trace of q L 0 . First, notice that the character of the Fock module F µ equals where ∆ µ is an eigenvalue of L 0 on the vector v µ . The value of ∆ µ consists of two contributions. The first comes from the terms with θ Adj = 0, and, as follows from (5.5), is equal to 1 2 (µ, µ). The second contribution comes from the normal ordering. The vectors J k ∈ h, corresponding to θ Adj,k = 0 can be always arranged into orthogonal pairs (J 1 , J 1 ′ ), (J 2 , J 2 ′ ), . . . with complementary eigenvalues θ Adj,k + θ Adj,k ′ = −1 11 . After normal ordering of the corresponding currents one gets where θ = θ Adj,k . The last term in the r.h.s., which appears due to [J k,n+θ , J k ′ ,m−θ ] = (n + θ)δ n+m,0 also gives a nontrivial contribution to the action of L 0 on highest vector v µ , since Altogether one gets and therefore, finally for the character of (5.6) Recall that the initial weight µ 0 in the setting of [16] should belong to the finite set in h * 0 (or h * 0 /π W Q). But we will generalize such representations and take any µ 0 ∈ h * 0 . This can be viewed as a twisting by more general elements g ∈ N G (h), which can have infinite order. Actually the corresponding elements are representatives of the conjugacy classes of N G (h) used in sect. 3. while π s Q gl(N ) is generated by the vectors 1 l i f i − 1 l j f j , so one can present any element of π s Q gl(N ) as 1 l j n j f j with n j = 0 and identify with that from Q gl(K) . Let µ 0 = j r j f j . Then the formula (5.12) takes here the form

Calculation of characters
where, since for any length l cycle θ Adj,k = −k/l, This formula coincides with (4.4), and the reason is that the corresponding element from N GL(N ) (h) is exactly (3.18), g = K j=1 [l j , e 2πir j ]. Indeed, let α = e a − e b , where a belongs to the cycle j and b belongs to the cycle j ′ then the current J α (z) shifts L 0 grading by r j − r j ′ + [rational number with denominator l j , l j ′ ].
SO(2N) case The root lattice Q so(2N ) = Q D N is generated by the vectors {e i − e j , e i + e j }, where again e 1 , . . . , e N denote the basis in R N . As we already discussed in sect. 3, there are two types of the Weyl group elements, the first type just permutes e i , while the second type permutes e i together with the sign changes.
The first case almost repeats the previous paragraph, without loss of generality we assume that the Weyl group element acts as (e 1 → e 2 → . . . → e l 1 → e 1 ), (e l 1 +1 → e l 1 +2 → . . . → e l 1 +l 2 → e l 1 +1 ), . . ., where l 1 , . . . , l K are again the lengths of the cycles. The s-invariant part of h * 0 is generated by the same "averaged" vectors (5.13), while π s Q D N is generated by the vectors 1 In other words, π s Q D N consist of vectors n j l j f j , where (n 1 , . . . , n k ) ∈ Q so(2K) . Let µ 0 = j r j f j , then the character formula (5.12) for this case acquires the form and coincides with (4.7). Here ∆ 0 s is defined in (5.15). The corresponding element from N SO(2N ) (h) has the form K j=1 [l j , e 2πir j ] + in the notations of sect. 3 (see (3.31)). For the second type (the corresponding element from N SO (2N can present the Weyl group element as product of K disjoint cycles of lengths l 1 , . . . , l K which just permute e i , and K ′ cycles of lengths l 1 ′ , . . . , l K ′ which permute e i with signs, see (3.31). Now, without loss of generality, we assume that s acts as (e 1 → e 2 → . . . → e l 1 → e 1 ), (e l 1 +1 → e l 1 +2 → . . . → e l 1 +l 2 → e l 1 +1 ), . . ., (e L+1 → e 2 → . . . → e L+l 1 ′ → −e 1 ), (e L+l 1 ′ +1 → e L+l 1 ′ +2 → . . . → e L+l 1 ′ +l 2 ′ → −e L+l 1 ′ +1 ), . . ., where L = l 1 + . . . + l K . The s-invariant part of h * 0 is generated by the same vectors (5.13), while π s Q D N is generated by the vectors 1 l i f i . One can say that π s Q D N consists of the vectors n j l j f j , where (n 1 , . . . , n k ) ∈ Q so(2K+1) = Q B N , so that for the character formula one gets where, since in addition to [l] + -cycles with θ Adj,k = −k/l one now has [l ′ ] − -cycles with θ ′ Adj,k = −(k − 1 2 )/l ′ , This formula coincides with (4.10). The number 2 K ′ /2−1 equals to d(σ), this is the first case where this number is nontrivial. Note, that we consider here only internal automorphisms, i.e. K ′ is even.

Characters from principal specialization of the Weyl-Kac formula
Fix element g ∈ G of finite order l. The g-twisted representations of V (g) are representations of the affine Lie algebra twisted by g. Recall that these twisted affine Lie algebras L(g, g) are defined in [15,Sec 8] as g invariant part of g[t, t −1 ] ⊕ Ck where g acts as By definition g is an internal automorphism, therefore the algebra L(g, g) is isomorphic to g (see Theorem [15, 8.5]), though natural homogeneous grading on L(g, g) differs from the homogeneous grading on g. Therefore the g-twisted representations of V (g) as a vector spaces are integrable representations of g 12 . Their characters can be computed using the Weyl-Kac character formula. This formula has simplest form in the principal specialization, i.e. computed on the element q ρ ∨ ∈ G. Here ρ ∨ ∈ h ⊕ Ck such that α i (ρ ∨ ) = 1, for all affine simple roots α i (including α 0 ) . Then the character of integrable highest weight module with the highest weight Λ equals (see [15, eq. (10.9.4)]) , (5.20) where ∆ ∨ + is the set of all positive (affine) coroots. Here h is the Coxeter number, it will be convenient to use q ρ ∨ /h instead of q ρ ∨ . The weight ρ is defined by (ρ, α ∨ i ) = 1 for all simple coroots α i (including affine root α 0 ).
The grading above in this section was the L 0 grading, and it was obtained using the twist by the element g ∈ N G (h). Now we take certain g such that g-twisted L 0 grading coincides with principal grading in (5.20). We take g in Cartan subgroup H and, as was explained above, choice g corresponds to the choice of µ 0 in (5.12).
In the principal grading used in (5.20) deg E α i = 1 h for all simple roots E α i (including affine root α 0 ). Therefore µ 0 ∈ P g + 1 h ρ, where P g is the weight lattice for g, ρ is defined by the formula (ρ, α i ) = 1 for all simple roots 13 .
Below we write explicit formulas for characters of twisted representation corresponding to such g (and such µ). In the simply laced case, computing the characters using two formulas (5.12) and (5.20) one gets an identity, which is actually the Macdonald identity [17].
Simple roots: mK + e ∨ i − e ∨ j , m ∈ Z, i = j Imaginary coroots: mK of multiplicity N, m ∈ Z. Note that the multiplicity of imaginary roots is N instead on N − 1 since we consider G = GL(N) instead of SL(N), and the corresponding affine algebra differs by one additional Heisenberg algebra.
The computation of the denominator in (5.20), using (5.21) gives while for the numerator (the same for all level k = 1 weights) one gets so that the character (5.20) in principal specialization One can compare the last expression with the formula (5.12) using the choice of µ 0 , as explained above. We get an identity which is a particular case of formula (4.23) from sect. 4.5, and again reproduces the product formula for the lattice A N −1 -theta function (A. 16).
Recall that the r.h.s. of (5.25) also has an interpretation of a character of the twisted Heisenberg algebra. This twist of the Heisenberg algebra emerges in the representation twisted by g with g Adj acting as the Coxeter element of the Weyl group, hence r.h.s. of (5.25) equals to the r.h.s. of (5.14) for a single cycle K = 1, l = N. This g is conjugate to used above in computing of l.h.s., therefore the characters of the twisted modules should be the same. The construction of level one representations in terms of principal Heisenberg subalgebra is well-known, see [31,32]. Another interpretation of the l.h.s in (5.25) is the sum of characters of the W -algebra namely W algebra of gl(N), (see sect. 4.6). SO(2N) case. Root system D Simple roots: α 0 = δ−e 1 −e 2 , α i = e i −e i+1 , 1 ≤ i < N, α N = e N −1 +e N Simple coroots: Now we again just compute the denominator 5.27) and the numerator (the same for all k = 1 weights) in (5.20), giving for the character .

(5.29)
As in previous case, comparing this with the formula (5.6), one gets an identity .
where the r.h.s. can be interpreted as a character of the representation of Heisenberg algebra twisted by g such that g Adj is Coxeter element. Again, this is the same as construction of level k = 1 representation in terms of principal Heisenberg subalgebra from [31,32]. The l.h.s formula (5.30) can be also interpreted as the sum of characters of the W (so(2N))-algebra, (see sect. 4.6). By now in this section we have considered only the simply laced case -the only one, when the algebra V (g) is lattice algebra or, in other words, when the level k = 1 representations can be constructed as a sum of representations of the Heisenberg algebra. However, the formula (5.20) is valid for any affine Kac-Moody algebra. Below we consider the case G = SO (2N +1), where the level k = 1 representations can be constructed using free fermions. (5.31) Compute again the denominator and the numerator in the formula (5.20). Now the numerator for Λ = Λ 0 and Λ = Λ 1 is the same (1 + q k ) Here we used the identities (B.12) and ∞ k=1 (1 − q 2k−1 )(1 − q k−1/2 ) −1 = ∞ k=1 (1 + q k−1/2 ). It is convenient to consider the direct sums of two representations L Λ 0 ⊕ L Λ 1 and L Λ N ⊕ L Λ N since these sums have construction in terms of fermions. Using (5.20) one gets The r.h.s. of these equations suggests the existence of the construction of these representation in terms of N-component twisted (principal) Heisenberg algebra and additional fermion (in NS and R sectors correspondingly), exactly this construction has been considered in sect. 3.4.
On the other hand these characters can be rewritten in terms of the simplest B-lattice theta-functions just using the Jacobi triple product identity Simple coroots: Imaginary coroots: (2m − 1)K of multiplicity 1, m ∈ Z 2mK of multiplicity 2, m ∈ Z \ {0}. (5.38) the computation leads to result, coinciding with formulas (5.32), (5.33), (5.34) for N = 2. Though the root system here has a bit different combinatorial structure, the fermionic construction is the same, using 5 real fermions.
6 Exact conformal blocks of W (so(2N )) twist fields 6.1 Operator algebra structure Now we are going to compute certain conformal blocks. We denote by |g the highest weight vector of the representation of twisted Heisenberg h. We denote corresponding field by Og.
The fields Og are primary fields for W algebra, so we compute conformal blocks for this algebra. 14 But our theory has more symmetry, it contains fermions and bosons with nontrivial boundary conditions (3.10) and (3.11). The presence of such operators provides additional restriction of the fusion of two fields First, the monodromy of the fused field should equal to the product of the monodromies h = g 1 g 2 . Second, we have a selection rule in terms of r-charges. Namely, for any zero mode in h, untwisted with respect to both g 1 , g 2 , corresponding r charge forḧ equals to the sum of r charges of g 1 , g 2 . In particular, we have equality for total r chargesḣ =ġ 1ġ2 . As an opposite example, if g 1 , g 2 are both diagonal (this corresponds to trivial the element of the Weyl group), then all r charges of h equal the sum of r charges for g 1 and g 2 .
In principle, such conformal block for twist fields can be studied for any g ∈ G, see [9] about their relation to the isomonodromy deformations. But here we restrict ourselves to the case g ∈ N G (h). If g corresponds to nontrivial element of the Weyl group, then corresponding fields are special, for example in case G = GL(2) all fields, corresponding to transposition, have conformal dimension 1 16 . The corresponding conformal blocks were found by Al. Zamolodchikov in [14]. Here we generalize his construction, the answer is given in terms of the geometry of the branched cover.

Global construction
It has been shown in [13] that conformal block of the generic W (gl(N)) twist fields is given by explicit formula, analogous to the famous Zamolodchikov's conformal blocks of the Virasoro twist fields with dimensions ∆ = 1 16 [14]. To generalize the construction of [13] to all twist fields {Og|g ∈ N G (h)} considered in this paper, one needs to glue local data in the vicinity of all twist field to some global structure. We consider below such construction for G = O(2N), since it can be entirely performed in terms of twisted bosons.
First, let us remind the local data in the vicinity of Og(0) already discussed in sect. 3: • 2l-fold cover z = ξ 2l with holomorphic involution σ : ξ → −ξ without stable points except the twist field positions.
• Bosonic field J(z) = (η(σ(z))η(z)), which is antisymmetric J(σ(z)) = −J(z) under the action of involution σ, and has first-order poles coming from zero-mode charges in the branch-points corresponding to cycles of type [l, e 2πir ] + . Now we want to compute spherical 2M-point conformal block where we fix intermediate fields Oḧ k such that h k ∈ G are diagonal, g 2k−1 g 2k = h k , r, charges for h k should be compatible with fusion Og 2k−1 Og 2k (q 2 ) to Oḧ k , and fusion of all Oḧ k should equal to identity. 15 In the discussion below we forget about fermion and consider only the twisted boson with current J(z). Now let us list the field-theoretic properties which fix this conformal block uniquely.
Let g corresponds to the cycle [l, λ] + , denote by |0 g the highest vector of the module of twist-field Og. Then we have J k/l>0 |0 g = 0. Therefore the most singular term of the 1-form J(z)dz in the vicinity of the twist field Og is the simple pole where the residue r is the r-charge. Similarly, if g corresponds to the cycle [l] − , then J(z)dz do not have pole in the vicinity of Og.
For two fields Og 2k−1 (z),Og 2k (z ′ ) as above (i.e. corresponding to the opposite elements of the Weyl group) the operator product expansion in the channel corresponding toḧ k has the form where Vḧ k (z ′ ) = Oḧ k (z ′ ) is a field with fixed charges a ∈ h (we used another letter V in order to stress that this is just exponent of the bosonic field). Hence where contour C j z,z ′ is the j-th preimage of the contour encircling two points z, z ′ on the base. We identify such contours with the A-cycles on the cover, and corresponding a's with A-periods of 1-form J(z)dz.
The standard OPE of two currents gives the stress-energy tensor and non-standard coefficient (4 instead of 2) arises due to involution σ. Summarizing these facts we get: • 2N-sheet branched cover π 2N : Σ → P 1 with the branch points {q 1 , . . . , q 2M } and ramification structure defined by the elements of Weyl group corresponding to {g 1 , g 2 . . . , g 2M −1 , g 2M }.
In particular, Σ is a disjoint union of two curves when all {g i } do not contain [l] − cycles.
• Odd meromorphic differential dS(σ(ξ)) = −dS(ξ) with the poles in preimages of q i and residues given by corresponding r-charges.
Using this data one can write for two auxiliary correlators Their explicit expressions are fixed uniquely by their analytic behaviour. Now let us study in detail the structure of the curve Σ in order to construct all these objects.

Curve with holomorphic involution
Involution σ defines the two-fold cover π 2 : Σ →Σ with the total number of branch points being 2K ′ = 2 M i=1 K ′ i , or exactly the total number of [l] − cycles in all elements {g k }. The Riemann-Hurwitz formula χ(Σ) = 2 · χ(Σ) − #BP then gives for the genus g(Σ) = 2g(Σ) + K ′ − 1 (6.12) Then a natural way to specify the A-cycles on Σ is the following [34]: first to take A g , A g on each copy ofΣ, whereg = g(Σ); and second, all other A-cycles that correspond to the branch cuts of the cover, connecting the branch points of π 2 : The action of involution on these cycles is obviously given by thus we have the decomposition of the real-valued first homology group into the even and odd parts Compute nowg = g(Σ) using the Riemann-Hurwitz formula for the cover of P 1 . Let K = M i=1 K i be the total number of [l, e 2πir ] + -type cycles in all elements {g 2k−1 }, as well as K ′ serves for the type [l ′ ] − . Then χ(Σ) = N · χ(P 1 ) − #BP gives (cf. with the formula (2.17) of [13])g For our purposes the most essential is the odd part H 1 (Σ, R) − of the homology. One can see these g − A-cycles explicitly as follows: two mutually inverse permutations of type [l] + produce l pairs of A-cycles A (1,2) i with constraints i A (1,2) i = 0. These cycles are permuted by σ (6.13), so they actually form l − 1 independent odd combinations, giving contribution to the r.h.s. of (6.16). For two mutually inverse elements of the type [l ′ ] − one gets instead 2l ′ A-cycles with constraint i A i = 0, and with the action of involution σ : A i → A i+l ′ , giving l ′ independent odd combinations {A i − A i+l ′ }, arising in the r.h.s. of (6.16), while the extra term −N corresponds to charge conservation in the infinity.

Computation of conformal block
Now we use the technique from [14,13] to compute the conformal block (6.2). For the vacuum expectation value of the stress-energy tensor (6.7) one gets from (6.11), (6.20) where t z andt z are the regularized parts of the bidifferentials K andK on diagonal in coordinate z: Expanding (6.25) at z → q i one gets (6.27) in local co-ordinates ξ 2l ′ = ζ l = z − q k , which gives for the conformal dimensions 16 of the fields Og (with generic o(2N) twist field of the type (4.8)) 30) 16 The counting here works as for the [l] + -cycles, and where the last term in the r.h.s. comes from the expansion dS ≈ r i dz z−q i + . . .. Without contributions of r-charges this formula is equivalent to (5.18), (6.30).
From the first order poles we obtain This system of equations for conformal block is obviously solved, so that we can formulate: Theorem 3 Conformal blocks (6.2) for generic W (o(2N)) twist fields are given by and

dS,
A I • B J = δ IJ , I, J = 1, . . . , g − (6.34) Equations (6.33) define so-called Bergmann tau-functions [35] for the curves Σ andΣ respectively, while the so-called Seiberg-Witten tau-function (6.34) can be read literally from [13] log τ SW (a, r, q) = 1 4 where T IJ is the g − × g − "odd block" of the period matrix of Σ, or the period matrix of corresponding Prym variety [34], the "odd" vector where q α k are preimages of q i and r α k -corresponding r-charges, and A J (P ) = P dω J is the Abel map to the Jacobian of Σ. The last term in the r.h.s. of (6.35) is given by where θ * is some odd Riemann theta-function for the curve Σ, and ∂θ * (0) ∂Z I dω I (z) (6.38) Remark: In the general N > 2 case conformal conformal block constructed above is not fixed by conjugacy classes of twists and by charges in the intermediate channels: it depends also on the geometry of the cover. This is a reminiscent of infinite-dimensional space of 3-point conformal blocks in the general case, but unlike that case now we deal only with finite-dimensional space, which can be easily studied.
6.5 Relation between W (so(2N )) and W (gl(N )) blocks It is interesting to compare the formulas from previous section with the formulas from [13] for the exact W (gl(N)) conformal blocks. Since, as we already discussed W (so(2N)) ⊂ W (gl(N)), any vertex operator of the W (gl(N)) algebra is a vertex operator of its subalgebra W (so(2N)), and it is clear from our construction that twist fields O˙g for the elements g ∼ [l, e 2πir ] + , are also the twist fields for W (gl(N)). Moreover, the corresponding Verma modules, generated by W (so(2N)) and by W (gl(N)), actually coincide 17 , and it means that corresponding conformal blocks of such fields in these two theories should coincide as well.
Indeed, in such a case Σ =Σ ⊔Σ, and therefore K(ξ, ξ ′ ) = 0 if ξ ′ , ξ are on different components, and K(ξ, ξ ′ ) =K(ξ, ξ ′ ) if they are on the same component, hence For holomorphic and meromorphic differentials, one has in this case in natural basis for the preimages {q α k } onΣ, and the period matrix of Σ consists of two nonzerog ×g blocks: Under such conditions formula (6.32) turns into G 0 (a, r, q) = τ B (Σ|q)τ SW (a, r, q) (6.42) where logτ SW (a, r, q) = 1 a ITIJ a J +g I=1 a IŨI (r) + 1 2Q (r) (6.43) with corresponding obvious modifications of formulas (6.36) and (6.37), which gives exactly the W (gl(N)) conformal block in terms of the data on smaller curveΣ. 17 These two modules coincide due to dimensional argument: they are both irreducible and have the same characters. Irreducibility follows from the fact that null-vector condition can be written as α, log g 2πi ∈ Z for a simple root α, and for generic generic r's it is violated, see also comments in sect. 4.6.

Conclusion
We have considered in this paper the twist fields for the W-algebras with integer Virasoro central charges, which are labeled by conjugacy classes in the Cartan normalizers N G (h) of corresponding Lie groups. In addition to the most common W N -algebras, corresponding to A-series (or W (gl(N)) = W N ⊕ H, coming from G = GL(N)), we have extended this construction for the G = O(n) case, which includes in addition to D-series the non simplylaced B-case with the half-integer Virasoro central charge.
In terms of two-dimensional conformal field theory our construction is based on the freefield representation, where generalization to the D-series and B-series exploits the theory of real fermions, which in the odd B-case cannot be fully bosonized, so that in addition to modules of the twisted Heisenberg algebra one has to take into account those of infinitedimensional Clifford algebra. This construction produces representations of the W-algebras (that are at the same time twisted representations of corresponding Kac-Moody algebras), which can be decomposed further into Verma modules. To find this decomposition we have computed the characters of twisted representations, using two alternative methods.
The first one comes from bosonization of the W-algebra or corresponding Kac-Moody algebra at level one. Dependently on particular element from N G (h) it identifies the representation space with a collection of the Fock modules for untwisted or twisted bosons. The essential new phenomenon, which appears in the case of orthogonal groups, is presence of different [l] − cycles in g ∈ N G (h) and necessity to use in such cases "exotic" bosonization for the Ramond-type fermions with non-local OPE on the cover.
Alternative method for computation of the characters uses pure algebraic construction of the twisted Kac-Moody algebras and the Weyl-Kac formula in principal gradation.
There are examples of elements g 1 , g 2 that are not conjugated in N G (h), but conjugated in G. Since two different constructions with elements g 1 and g 2 give different formulations of the same representation, computation of corresponding characters χ˙g 1 (q) and χ˙g 2 (q) leads to some simple but nontrivial identities for the corresponding lattice theta-functions, χ˙g 1 (q) = χ˙g 2 (q), which have been also proven by direct methods.
We have also derived an exact formula for the general conformal block of the twist fields in D-case, which directly generalizes corresponding construction for common W Nalgebra. The result, as is usual for Zamolodchikov's exact conformal block, is expressed in terms of geometry of covering curve (here with extra involution), and can be factorized into the classical "Seiberg-Witten" part, totally determined by the period matrix of the corresponding Prym variety, and the quasiclassical correction, expressed now in terms of two different canonical bi-differentials. In order to expand this method for the B-case one has to learn more about the theory of "exotic fermions" on Riemann surfaces, probably along the lines of [36,37], and we postpone this for a separate publication.
Another set of open problems is obviously related with generalization to other series and twisted fields related with external automorphisms. Here only the E-cases seem to be straightforward, since standard bosonization can be immediately applied in the simply-laced case, and there should be not many problems with the fermionic construction. However, it is not easy to predict what happens in the situation when Kac-Moody algebras at level k = 1 have fractional central charges, and the direct application of the methods developed in this paper is probably impossible. It is still not very clear, what is the role of these exact conformal blocks in the context of multi-dimensional supersymmetric gauge theories, since generally there is no Nekrasov combinatorial representation in most of the cases. We hope to return to these issues in the future.
Finally, there is an interesting question of possible generalization of our approach to the twisted representations with k = 1, which has been already considered in [40]. Some overlap with our formulas with sect. 8 of this paper suggests that such generalization could exist. We hope to return to this problem elsewhere.
A.1 First identity for A N −1 and D N Θ-functions One can describe the lattices A N −1 , D N and D ′ N in a similar way: The last lattice is actually just D N lattice, but shifted by vector (1, 0, . . . , 0). So all these definitions can be rewritten as where S ⊆ Z: in our cases it should be chosen to be {0}, 2Z, and 2Z+ 1, respectively. Notice also that for S = Z we get the simplest B N lattice. By definition For our purposes we need this function computed for the vector where l 1 + . . . + l K = N. Let us parameterize vector k as follows: where m i ∈ A l i −1 , and so that the first number is repeated a times, whereas the second one l − a times. Hence, vectors k ∈ L S are parameterized by vectors { m i ∈ A l i −1 } and integer numbers {n i ∈ Z; a i ∈ Z/l i Z}, restricted by The algorithm of decomposition (A.5) works as follows: first we sum up all components of k inside each cycle -each number divided by l i gives n i , whereas remainder gives a i . Subtracting (n i , . . . , n i ) + ω (l i ) a i , we are left with the vectors { m i } with vanishing sums of components.
Now it is easy to see that Θ( v + ω (l 1 ) a 1 ⊕ ω (l 2 ) a 2 ⊕ . . . ⊕ ω (l K ) a K ; q) = Θ( v; q) (A. 8) which follows from the fact that Θ( v; q) = Θ(σ( v); q), where σ is a permutation. For example, take σ a to be a-th power of the cyclic permutation, then: One can identify the last factor in the r.h.s. with the contribution of zero modes, related to the r-charges [13].

B Exotic bosonizations
Here we present some details of the bosonization procedures, used in the main text.