BFT$_2$: a General Class of $2d$ $\mathcal{N}=(0,2)$ Theories, 3-Manifolds and Toric Geometry

We introduce and initiate the study of a general class of $2d$ $\mathcal{N}=(0,2)$ quiver gauge theories, defined in terms of certain 2-dimensional CW complexes on oriented 3-manifolds. We refer to this class of theories as BFT$_2$$\mbox{'}$s. They are natural generalizations of Brane Brick Models, which capture the gauge theories on D1-branes probing toric Calabi-Yau 4-folds. The dynamics and triality of the gauge theories translate into simple transformations of the underlying CW complexes. We introduce various combinatorial tools for analyzing these theories and investigate their connections to toric Calabi-Yau manifolds, which arise as their master and moduli spaces. Invariance of the moduli space is indeed a powerful criterion for identifying theories in the same triality class. We also investigate the reducibility of these theories.


Introduction
In this paper we will introduce and initiate the study of a general class of 2d N = (0, 2) gauge theories, which are defined in terms of 2-dimensional CW complexes on oriented 3manifolds (possibly with boundaries). Remarkably, many aspects of the dynamics of these theories translate into simple transformations of these objects, several questions enjoy a combinatorial description, and the theories have a close relation to toric geometry. In short, the new theories are generalizations of brane brick models (BBMs) to arbitrary 3-manifolds. BBMs encode the 2d N = (0, 2) quiver gauge theories on the worldvolume of D1-branes probing non-compact toric Calabi-Yau 4-fold (CY 4 ) singularities [1][2][3][4][5][6][7]. BBMs indeed significantly simplify the map between the gauge theory and the underlying CY 4 geometry. A BBM is a type IIA brane configuration consisting of D4-branes suspended from an NS5-brane that wraps a holomorphic surface Σ determined by the probed CY 4 . BBMs are connected to the D1-branes at the singularities via T-duality. The most important information carried by a BBM is encoded in a 2-dimensional CW complex on T 3 , the tropical limit of the coamoeba projection of Σ.
We will refer to the new class of theories as BFT 2 's. The motivation for this name is that these theories are natural generalizations of bipartite field theories (BFTs), a class of 4d N = 1 gauge theories defined by bipartite graphs on Riemann surfaces (with boundaries) [8][9][10][11][12][13] (see also [14,15] for closely related constructions). Having said that, we will see that the notion of bipartiteness does not seem to be relevant for this class of models. Therefore, the "B" letter might be interpreted as "bicolored". We expect similar generalizations of m-dimers [16], which we will denote BFT m , to exist for general m.
BFT 2 's fall within the modern and fruitful approach of defining quantum field theories in terms of geometric or combinatorial objects. In such constructions, the dynamics of the quantum field theory is often geometrized or translated into simple modifications of the underlying object. Moreover, complicated theories can usually be constructed by assembling simple building blocks. Examples of this general strategy abound, see e.g. for an incomplete selection [17][18][19][20].
This paper is organized as follows. §2 provides a brief review of 2d N = (0, 2) gauge theories. §3 introduces BFT 2 's and discusses their structure. §4 introduces various combinatorial tools, which are useful for the analysis of BFT 2 's. §5 explains the map between several transformations of the underlying CW complex and the dynamics of BFT 2 . §6 discusses two toric CYs that are associated to every BFT 2 , its master and moduli spaces. §7 presents an alternative procedure, based on flows, to map BFT 2 's to the corresponding toric CYs. Additional explicit examples are presented in §8, to illustrate the dependence of the master and moduli spaces on the geometry of the underlying 3-manifold. §9 discusses the invariance of the moduli space under triality, motivating its application to identify theories connected by the corresponding moves. §10 studies the interplay between triality, reduction and the moduli space. In §11, we conclude and present directions for future research.
• Chiral. Its on-shell degrees of freedom are a complex scalar φ and a chiral fermion ψ + .
• Fermi. Its only on-shell degree of freedom is a chiral fermion λ − . In addition, it contains an auxiliary field G. Every Fermi field Λ a is associated to two holomorphic functions of chiral superfields, which we call J a and E a . Λ a couples to J a through a gauge invariant term of the form while E a is introduced as a deformation of the chirality condition for Λ a . For these reasons, E a has the same quantum numbers (e.g. gauge quantum numbers) of Λ a , while J a has conjugate quantum numbers. Sometimes, it is practical to summarize the information regarding the J a and E a functions via a 2d N = (0, 2) "superpotential", which schematically has the following form 2) The theories are symmetric under the exchange of Λ a ↔ Λ a for any a, which should be accompanied by the switch of J a ↔ E a .
Integrating out the auxiliary fields in the vector multiplets, we obtain a usual D-term potential. For abelian theories, it becomes where α runs over the different factors of the gauge group and the t α are complexified Fayet-Iliopoulos parameters.
Integrating out the auxiliary fields G a in the Fermis Λ a , we obtain an analog of an F -term potential, where φ represents the scalar components of chiral fields, and Yukawa-like interactions between pairs of fermions and scalars. Consistency of the theory requires that the J-and E-terms satisfy the following "orthogonality" condition a tr [E a J a ] = 0 , (2.5) which is often referred to as the trace condition.
Finally, gauge anomalies need to vanish. In §3.3.1 we will elaborate on what this cancellation entails for the class of theories considered in this paper.
In Figure 1 we present a simple example of a BFT 2 defined on a 3-ball with S 2 boundary. 1 We will call it the cube model. We refer to the basic elements of G as bricks, faces, edges and vertices, where we have sorted them according to decreasing dimension, from 3d to 0d. There are two distinct types 1 For brevity, we will often refer to G and the corresponding gauge theory as BFT2 interchangeably.
of faces, which we will identify by coloring them gray and red. It is natural to classify these elements as internal or external, depending on their location with respect to ∂M 3 . Internal bricks are those surrounded entirely by faces in G, while all others are external. We refer to faces with at least one edge on ∂M 3 as external. Finally, external edges are those in ∂M 3 . We represent them by dotted lines. We restrict external edges to be connected to a single face. To prevent clutter in the figures, we will leave ∂M 3 implicit. Figure 1 shows the distinction between internal and external elements. In the coming section we elaborate on their interpretation and additional properties.

The Dictionary
Below, we present the map between the elements of G in M 3 and the corresponding 2d N = (0, 2) gauge theory.
• Bricks. Every brick is associated to a U (N ) group. 2 Internal and external bricks are mapped to gauge and global groups, respectively. This map is motivated by similar systems admitting an interpretation as brane configurations in string theory. In such cases, bricks are filled with stacks of D-branes suspended from heavier branes represented by G. Internal bricks are finite along all the directions transverse to the ones in which the gauge theory lives, therefore giving rise to gauge symmetries in 2d. On the contrary, external bricks can have an infinite extension in the internal dimensions, so D-branes filling them lead to global symmetries in 2d. As previously mentioned, BFT 2 's on T 3 without boundaries correspond to BBMs, which are indeed configurations consisting of D4-branes suspended from an NS5-brane. Whether more general BFT 2 's admit a string theory realization is an interesting question, which we differ to future work.
• Faces. Every face corresponds to a matter field transforming in the bifundamental representation of the two bricks it separates (or in the adjoint representation, if the brick on both sides is the same). There are two types of faces, gray or red, which represent the two types of matter superfields of 2d N = (0, 2) SUSY: chiral (gray) and Fermi (red). Chiral faces can have an arbitrary even number of edges, while Fermi faces have four edges. Both constraints on the number of edges are explained below. Moreover, chiral faces are oriented, while Fermi faces are unoriented, reflecting the symmetry between Fermis and conjugate Fermis. Below we introduce a prescription for orienting chiral faces.
Following the map between brick and gauge or global symmetry groups, faces correspond to: bifundamentals of the gauge group (when they separate two internal bricks), fundamental or antifundamental flavors (internal/external) or gauge singlets in a bifundamental representation of the global symmetry group (external/external). 2 In fact, in general it is possible for different bricks to have different ranks while keeping the theory consistent, i.e. free of gauge anomalies. In the case of BBMs, this corresponds to populating the bricks with different numbers of D4-branes. Throughout this paper, we will equal ranks for all the bricks. In fact, we will shortly identify a condition such that the BFT2 is anomaly free for equal ranks.
External faces: dynamical vs. non-dynamical . Let us consider the interpretation of fields associated to external faces more carefully. Thinking about brane configurations that could lead to gauge theories of this type, it is natural to contemplate the possibility of such external fields being dynamical or not. For the discussions in this paper, whether external chiral fields are regarded as dynamical or not is not so crucial. Such a distinction would only affect the interpretation of the geometries studied in §6. On the contrary, the treatment of external Fermis is more important.
In what follows, we will regard them as dynamical fields. More concretely, this choice means that these Fermis participate in the trace condition (see §3.3.2) and that we will require their J-and E-terms to vanish when computing moduli spaces (see §6). Interestingly, in the context of D-branes at CY 4 singularities it is indeed possible to obtain dynamical Fermis between global symmetry groups, by e.g. considering stacks of flavors D5-branes with 2d intersections [24].
• Edges. At every internal edge, a single Fermi face intersects with a number of chiral faces. 3 Such an edge translates into a monomial in the 2d N = (0, 2) superpotential, i.e. a J-or E-term coupling. 4 This monomial is the product of all the chiral fields and the single Fermi field (or its conjugate, as necessary by the orientation of the chiral fields) intersecting on it. We define the valence of an edge as the number of faces intersecting on it, which in turn determines the order of the corresponding superpotential term. Internal edges are colored white or black, depending on whether the corresponding monomial has a positive or negative sign, respectively.
External edges do not have a superpotential interpretation since a single face terminates on them. We therefore do not assign any color to them.
A BFT 2 with edge coloring fully encodes the superpotential, i.e. it even determines the signs of its monomials. It is interesting to note that this is a new addition to this class of constructions. In particular, this information was left implicit in previous studies of BBMs. We will see that including this data reveals interesting new structures.
Fermi faces and the toric condition of the superpotential. As we mentioned earlier, we restrict Fermi faces to have four edges. In addition, we will assign opposite signs to opposite internal edges of every Fermi, as illustrated in Figure 2.
3 In fact, it is possible for Fermis to meet at an edge. Explicit examples of such instances, in the context of BBMs, can be found in [2,3]. In such configurations, the determination of the superpotential from the CW complex is more involved. However, all the ideas that we present in the paper, particularly the concept of perfect matchings and the correspondence between BFT2's and toric geometry, apply to those theories without changes. For simplicity, in what follows we will continue restricting to the class of BFT2's in which Fermis do not have common edges. 4 The distinction between the two types of couplings is simply determined by the choice of orientation for the Fermi represented by the red face. These conditions result in a special structure for the superpotential, often referred to as the toric condition [1]. For every Fermi face, each pair of opposite edges translates into two superpotential couplings of the same type (i.e. either both J-or both Eterms) 5 with opposite signs. Therefore, for every Fermi Λ a we have the following contributions to the superpotential If a Fermi face is such that some of its edges is external, the corresponding term in (3.1) will simply be missing. In §6.1 we will discuss how the vanishing of J-and E-terms should be implemented in such cases.
The toric condition is crucial for the combinatorial description of BFT 2 's and their connection to toric geometry.
• Vertices. Interestingly, vertices have been overlooked in earlier studies of BBMs, despite being rather natural to ask for their interpretation. A deeper understanding of vertices will reveal several structures of BFT 2 's that were previously unnoticed.
We will define BFT 2 's such that two Fermis intersect at their corners at every vertex. 6 Therefore, four edges meet at every vertex. This structure plays an important role in the vanishing of the trace condition, as we will explain in §3.3.2. Figure 3 represents the simplest vertex configuration, in which each of the four edges intersecting in it is shared by a Fermi and two chirals, therefore corresponding to a cubic term in the superpotential. More generally, any of the chirals in the figure can be replaced by multiple chirals terminating on the same edge.

The Dual Quiver
The complete information defining a BFT 2 is equivalently captured by a special quiver embedded in M 3 , to which we will refer as the dual quiver. The dual quiver is obtained from G via standard graphical dualization. It not only summarizes the symmetries (gauge and global) plus field content of the theory, like an ordinary quiver, but it also encodes its superpotential. Every minimal plaquette in the dual quiver, i.e. every plaquette dual to an edge in G, corresponds to a term in the superpotential. 7 Figure 4 shows an example of a dual quiver. In the case of BBMs, dual quivers correspond to the so-called periodic quivers [2][3][4][5]7]. Chiral field orientation. In order to determine the orientation of chiral fields in the dual quiver, it is sufficient to understand what happens at the vertices of G. 8 Figure 5 shows 7 In principle, we could color plaquettes in the dual quiver to capture information regarding the signs of the superpotential terms. For simplicity of the figures, we will avoid doing so. 8 See [2] for an earlier discussion of the orientation of chiral fields in the dual quiver.
a vertex in G and the corresponding piece in the dual quiver, which takes the form of a tetrahedron. The six edges of the tetrahedron are divided into two Fermis and four chirals. Moreover, its four triangular faces are the plaquettes representing the four superpotential terms associated to the edges of G intersecting at the vertex. As in our previous discussion of vertices, every chiral arrow may actually represent multiple consecutive chirals. In such case, the associated plaquette would represent a superpotential term that is of higher than cubic order. This perspective leads to a beautiful prescription for orienting the chiral fields. The orientation of any of the chiral arrows in this tetrahedron fixes the orientations of all other chiral fields. In particular, as shown in Figure 5, every corner of the tetrahedron is such that it contains exactly one field of each possible type: a Fermi, an incoming chiral and an outgoing chiral. The entire dual quiver is obtained by combining several tetrahedra. More precisely, as we mentioned before, these elementary building blocks may not be strictly tetrahedra if some of the arrows represent multiple chirals.
A 2d N = (0, 2) quiver is equivalent to the quiver obtained by reversing all the chiral fields. This is the case because such transformation corresponds to reversing all fields in the quiver, i.e. exchanging the role of fundamental and antifundamental representations for all gauge and global groups, combined with the Fermi-conjugate Fermi symmetry. Therefore, once we pick the orientation of an arbitrary chiral field in the theory, the previous prescription exhausts all the freedom in the orientation of the chirals.

Additional Structural Constraints
We now discuss additional constraints on the structure of BFT 2 's.

Gauge Anomaly Cancellation
Since we are assuming that the BFT 2 's are consistent when the ranks of all bricks are equal, the cancellation of the SU (N ) 2 non-abelian anomaly for every gauge group requires that each internal brick satisfies where n χ i and n F i are the numbers of chiral and Fermi faces for internal brick i, respectively. Given that external bricks correspond to global symmetry groups, they do not need to satisfy this condition, i.e. they generically can have non-vanishing 't Hooft anomalies.
On the other hand, the U (1) factors of the bricks can generically have U (1) 2 i and mixed U (1) i U (1) j abelian anomalies [1]. If the BFT 2 has a string theory origin, abelian gauge anomalies hint at the existence of additional Fermi multiplets in appropriate determinant representations, located at specific places of the CW complex (see e.g [25][26][27][28] for related discussions). While the presence of these fields is important and interesting, we will not consider this issue any further. For the T-dual branes at singularities, these anomalies are generally cancelled by bulk fields in the closed string sector via the Green-Schwarz mechanism [29]. The interplay or possible map between the two mechanisms described above remains an interesting open question.

The Combinatorics of the Trace Condition
The trace condition (2.5) is a highly non-trivial constraint on the superpotential of 2d N = (0, 2) theories. Remarkably, this condition admits a beautiful combinatorial solution within the class of BFT 2 theories.
Every internal vertex is associated to two holomorphic gauge invariant monomials in chiral fields constructed as follows. Consider a vertex α at which four edges j 1 , e 1 , j 2 and e 2 intersect, where j 1 and e 1 belong to the Fermi face Λ 1 , while j 2 and e 2 belong to the Fermi face Λ 2 . The four edges translate into two J-and two E-terms in the superpotential as follows: j 1 ↔ Λ 1 J 1 , e 1 ↔Λ 1 E 1 , j 2 ↔ Λ 2 J 2 and e 2 ↔Λ 2 E 2 . Therefore, we can associate the vertex to the following sum The trace condition is the sum of such contributions over all the vertices of G. In fact, the two terms in (3.3) are the same up to at most a sign. To see this, it is convenient to consider the tetrahedron dual to the vertex, as shown in Figure 6. Explicitly, the four edges converging at the vertex correspond to the following super-potential terms W ⊃ s j 13 Λ 13 X 34 X 41 + s e 13Λ 13 X 12 X 23 + s j 24 Λ 24 X 41 X 12 + s e 24Λ 24 X 23 X 34 (3.4) where s j 13 , s e 13 , s j 24 and s e 24 are the signs of the terms, which are encoded in the edge coloring. As before, each of the chiral fields X ij can be replaced by a product of consecutive chiral arrows without affecting our argument. Then, (3.3) becomes s j 13 s e 13 X 12 X 23 X 34 X 41 + s j 24 s e 24 X 12 X 23 X 34 X 41 . Therefore, the trace condition is automatically satisfied if every vertex has either three positive and one negative edges, or three negative and one positive edges. Figure 7 illustrates the resulting two possible types of vertices. We will refer to this constraint on the coloring of edges as the vertex trace condition. Interestingly, this property is satisfied by all the BBMs constructed from D1-branes at toric CY 4 's [1][2][3][4][5][6][7]. However, it has never been noted or emphasized before. Here we have elevated it to a fundamental condition that needs to be satisfied BFT 2 's, which guarantees that the trace condition is automatically fulfilled. Quite likely, this property is a key ingredient for other combinatorial objects in BFT 2 's.
It is interesting to notice that, in general, combining the rule that opposite edges of Fermis must have opposite colors and the combinatorial trace condition, does not uniquely fix the coloring of edges. In fact, theories as simple as the cube model admit multiple edge colorings consistent with both conditions, as shown in Figure 8. In this example, it is straightforward to verify that both color choices are equivalent upon field redefinitions. It is natural to ask whether such differences can always be absorbed by field redefinitions and, if so, whether there is a "canonical" coloring. While these questions certainly deserve further study, they are beyond the scope of this paper. In particular, all the notions we will introduce are insensitive to this freedom.

Summary
The table below summarizes the correspondence between a 2-dimensional CW complex G in a 3-manifold M 3 and a BFT 2 and the basic rules for constructing this class of theories. Vanishing sum of the products of two J-and two Eterms intersecting at the vertex coming from Fermi fields a and b In addition, the following conditions must be satisfied: 1. Every external edge is connected to a single face.
3. Toric condition. Every Fermi face has four edges, where opposite internal edges have opposite colors.

Combinatorial trace condition. Every internal vertex is shared by four edges and
is of one of two types: three white and one black edges or three black and one white edges.

Combinatorial Tools
In this section we introduce various combinatorial objects which are useful in connecting CW complexes, gauge theory and toric geometry in the context of BFT 2 's

Perfect Matchings
The first class of objects are the almost perfect matchings of a BFT 2 . They were first introduced in [2] for BBMs, where they were called brick matchings. An alternative, equivalent definition was presented in [16], where they were also extended to m-dimers. Here we generalize them to general 3-manifolds with boundaries. For brevity, we will refer to them simply as perfect matchings.

Definition 1.
A perfect matching p is a collection of chiral fields such that for every Fermi field Λ a , the chiral fields in p cover either all the monomials in J a or all the monomials in E a exactly once.
Clearly, the toric condition of the superpotential of BFT 2 's is crucial for defining perfect matchings.
As explained in [2], it is possible, and often illuminating, to extend the definition of perfect matchings such that they also include Fermi fields. It is however sufficient to specify their chiral field content, since it uniquely fixes the Fermi fields. A systematic method for determining the perfect matchings of BBMs, generalizing the Kasteleyn matrix approach of bipartite graphs, was introduced in [16]. This method can be extended to general BFT 2 's, although we will not discuss it in this paper.
Remarkably, there is an alternative definition due to Richard Kenyon, which is identical the one for perfect matchings of bipartite graphs underlying ordinary BFTs (see e.g. [8]). 910 Definition 2. A perfect p is a subset of the chiral faces in G such that: 1. Every internal vertex is covered exactly once by a chiral face in p 2. Every external vertex belongs to either one or zero chiral faces in p.
Let us now show the equivalence between the two definitions. Consider a Fermi field Λ a and its corresponding J-and E-terms. Let us focus on a chiral field Y contained in a 9 We thank Richard Kenyon for private discussions leading to this insight. These conversations took place during a meeting of the NSF FRG in the Mathematical Sciences shared with Sebastián Franco, and benefitted from ideas from the other members of the group: Gregg Musiker, David Speyer and Lauren Williams. 10 Interestingly, given the map between vertices and the chiral cycles introduced in [16], it is possible to show that this definition of perfect matchings coincides with the one given in [16].
perfect matching. Without loss of generality, following the first definition we can assume that Y participates in the two monomials in J a (the case in which it participates in the two monomials in E a is identical). We can then write According to the dictionary, Λ a is translated into a 4-sided red face in G, in which the two monomials in J a and E a are represented by opposite edges. Moreover, as discussed in §3.3.2, each of the four vertices of Λ a , which we call α, β, γ and δ, gives rise to a contribution to the trace condition of the form (3.5), which in this case become 2) For each vertex, the first term comes from the Tr[J · E] for Λ a in (4.1), while the second term comes from Tr[J · E] products for other Fermi faces that intersect with Λ a on that vertex.
From (4.2), we easily conclude that for the perfect matching p, each vertex is covered exactly once by the chiral field Y in p, proving the equivalence between the two definitions. We present explicit examples of perfect matchings in §6 and §8.
We will consider the following map between chiral fields X i and perfect matchings p µ where c is the total number of perfect matchings, and P iµ is equal to 1 if the face in G associated to the chiral field X i is contained in p µ and zero otherwise [30], i.e.
We will see in the coming sections that the P -matrix defined above plays an important role when computing the moduli space of the BFT 2 's, i.e. in connecting them to toric geometry.

Flows
Another interesting concept for BFT 2 's is the one of flows, which are in one-to-one correspondence with perfect matchings. While perfect matchings are collections of faces in the CW complex, flows are oriented surfaces or, equivalently, collections of oriented edges giving rise to oriented paths in it. The flow p µ associated to a perfect matching p µ is defined as follows: 1. Pick a reference perfect matching p ref .
2. For every perfect matching, orient chiral faces according to the corresponding bifundamental field.
3. For any perfect matching p µ , define the associated flow as The surfaces resulting from this construction can be naturally completed by including the missing Fermis. Alternatively, flows can be represented as oriented paths on G. This is simply achieved by orienting the edges of the chiral faces in a perfect matching according to the right-hand rule. The orientations of the edges in p ref are reversed when constructing p µ = p µ − p ref .
Finally, we can also define the flows without referring to their graphical representation as follows: 1. Pick a reference perfect matching p ref .
2. Associate to every perfect matching p µ a variablep µ which is the product of the chiral fields it contains.
3. The corresponding flow p µ can then be written as In §7, we will present explicit examples of this construction.

Brick Variables
Another useful concept is the notion of brick variables, which are the natural generalizations of the face variables of ordinary BFTs [8]. The definition is rather intuitive, they are given by the surface around a brick (gauge or global), with orientation. While it is natural to include Fermi fields in brick variables, for later applications it is sufficient to focus on their chiral field content. Focusing on the chiral fields, the brick variable W i associated to the brick i is given by i.e. by the product of the outgoing chirals divided by the product of the incoming chirals. 11 Not all the brick variables are independent, since they satisfy 12 Proceeding as in §4.2 to translate the orientations of chiral faces into the orientations of their edges, it is possible to represent brick variables in terms of oriented edges. Figure  9 illustrates this construction. Further examples will be presented in §7 11 Adjoint chiral fields Xii would appear in both the numerator and denominator, hence do not participate in brick variables. 12 Assuming a single component M3. Figure 9. Example of the brick variable for the internal brick of the cube model in terms of oriented edges. When combining oriented faces, we will interchangeably talk about their addition/subtraction and multiplication/division depending on the context. We will use the former when referring to the combination of the faces in G and the latter when discussing the corresponding variables.

Modifications of the CW Complex from a BFT 2 Perspective
In this section we discuss the field theory interpretation of various possible modifications of the CW complex underlying a BFT 2 . All this operations have been previously discussed in the context of BBMs [2]. We include them here for completeness and to further elaborate on some of them.

Higgsing
Turning on a non-zero VEV for the scalar component of a bifundamental chiral field X ij translates into the removal of the corresponding face in G, which leads to the combination of the bricks i and j into a single brick, as illustrated in Figure 10. Figure 10. Giving a non-zero VEV to a chiral field translates into deleting the corresponding face, which is colored blue here. This results in the two adjacent bricks recombining into a single one.
Depending on the types of bricks that are combined, there are three possibilities, which in turn have different gauge theory interpretations: 13 • Internal-internal: higgsing of the corresponding U (N ) × U (N ) factor of the gauge group to the diagonal U (N ) subgroup.
• Internal-external: color-flavor locking of the U (N ) gauge ×U (N ) global symmetry associated to the bricks to the diagonal subgroup, which corresponds to a global symmetry.
• External-external: breaking of a U (N ) × U (N ) factor of the global symmetry to the diagonal subgroup.
For simplicity, we will collectively refer to all of them as higgsing, while keeping in mind the fact that they may not always involve two gauge groups. In addition, Deleting the face for X ij nicely implements the effect of replacing it by its VEV, which without loss of generality is set to be equal to 1, in the superpotential.

Massive Fields
Massive fields correspond to Fermi-chiral pairs connecting the same pair of nodes in the quiver for which the corresponding quadratic term is present in the superpotential (equivalently, such that either the J-or E-term for the Fermi field contains a term that is linear in the chiral field). Such mass terms translate to edges in G that connect a single Fermi face to a single chiral face.
Integrating Out Massive Fields. Without loss of generality, let us consider a massive pair consisting of fields Λ ij and X ji , with a J-type mass term Λ ij X ji in the superpotential. The case of an E-term mass is completely analogous. At low energies, Λ ij and X ji can be integrated out. The J-term associated to Λ ij takes the general form where the linear term in X ji corresponds to the mass term and f ji (X) represents a product of chiral fields associated to a concatenation of arrows in the quiver going from node i to node j. When integrating out the massive fields, we remove them from the theory, set J ji = 0 (therefore replacing X ji → f ji (X) as in (5.1)) and eliminate E ij , the E-term for Λ ij . This process is beautifully captured by a simple transformation of G, as shown in Figure  11. As any other chirall field, X ji has an even number of edges, which we denote 2n. Figure  11 corresponds to n = 2, but the picture and the discussion below extend to general n. For visualization, it is useful to divide the process into two stages. In the first step, we shrink the face associated to Λ ij until the massive edge merges with the opposite one into a single edge associated with f ji (X). This makes the Fermi face disappear. In the second step, the equation X ji = f ji (X) removes the chiral face X ji and glues its edges to the one for f ji (X), as shown in the last step.
Let us consider this process in further detail. Focusing for concreteness on the n = 2 case as in Figure 11, the terms of the superpotential containing the massive fields Λ ij and X ji have the general form where Λ a , a = 1, . . . , 2n − 1, are the Fermis connected to the extra edges of X ji and g a (X) are products of chiral fields. Without loss of generality, we have picked the orientation of the Λ a 's such that their couplings to X ij are J-terms.
In Figure 11, the chiral faces shown in green, which account for the fields in f ji (X), end up connected to (2n − 1) consecutive edges of the 2n-sided massive X ji face, capturing the fact that the X ji → f ji (X) replacement occurs in (2n − 1) terms. The superpotential (5.2) becomes It is interesting to note that for this to be possible in general, it might be necessary for some of the faces to be curved. This is not an issue for this paper, since we are exclusively concerned with combinatorial properties of BFT 2 's. Moreover, this feature is evaded if the (2n−1) edges are collinear or if additional fields become simultaneously massive. The latter is indeed the case in several explicit examples previously studied (see e.g. [2,3]), where integrating out all massive fields leads to configurations without multiple chiral faces glued to (2n − 1) consecutive edges.
Integrating In Massive Fields. The inverse process, namely integrating in massive fields, is described by going through Figure 11 in the opposite direction. This procedure has not been systematically discussed in the literature. Of course, there are in general multiple ways of introducing massive fields into a BFT 2 . Doing so, we can reduce the order of superpotential terms.
In order for integrating in fields to be possible, a necessary condition is for some chiral operator f ij (X), which accounts for a single chiral field or a collection of chiral fields, to participate in 2n − 1 consecutive edges. Due to this condition, integrating in massive fields in BFT 2 's is more restrictive than the ordinary BFT counterpart. Therefore, it would be interesting to investigate whether it is possible to make a general statement regarding the maximal attainable reduction in the order of the superpotential. For example, in ordinary BFTs it is always possible to reduce the superpotential to a form with only order 2 and order 3 terms [8]. This question is beyond the scope of this paper.
Mass Terms from Higgsing. Higgsing is one of various ways in which mass terms can be generated. In this case, a massive pair arises when an originally cubic term in the superpotential becomes quadratic after turning on a VEV for a chiral field. In terms of G, such a mass term corresponds to an edge which is initially attached to a Fermi and two chiral faces. When the face associated to the field acquiring the non-zero VEV is removed, a 2-valent edge representing a mass term is generated, as shown in Figure 12. We refer the interested reader to [2] for further discussion of the generation of mass terms via higgsing in BFT 2 's.

Triality
Triality is an IR equivalence among 2d N = (0, 2) gauge theories [23]. In this section we explain how, for the class of BFT 2 theories, triality is beautifully captured by certain transformations of G.

Triality for Quiver Theories
Let us first discuss triality for general quiver theories, i.e. not necessarily BFT 2 's. When a gauge node k is dualized, the theory is transformed as described below. 14 Ranks. The rank of the dualized node transforms according to where n χ jk is the number of chiral fields from node j to node k. The ranks of all other nodes remain the same.
Quiver. The field content around node k is modified according to the following rules: respectively. For later use, we generically refer to such fields in the original theory as X ik , Y kj , Λ kl , and to the corresponding duals asỸ ki ,Λ kj ,X lk .
(Q2) Chiral mesons. For every subquiver i → k → j, add a new chiral field i → j. I.e. for every pair X ik , Y kj in the original theory, include the meson M ij = X ik Y kj in the dual.
(Q3) Fermi mesons. For every subquiver i → kj, add a new Fermi field ij. I.e. for every pair X ik , Λ kj in the original theory, include the meson Ψ ij = X ik Λ kj in the dual.
(Q4) Remove chiral-Fermi massive pairs generated in the previous steps. 15 Superpotential. The superpotential transforms as follows: (W1) Replace every X ik Y kj product in the original superpotential by the corresponding meson M ij . Similarly, replace all X ik Λ kj products by Ψ ij .
(W2) Introduce new cubic couplings between the dual flavors and mesons (W3) Replace every Λ lk Y kj product in the original superpotential by the corresponding product of dual flavorsX lkΛkj . Namely, transform terms containing such product as follows where O jl is a holomorphic product of chiral fields connecting nodes j and l.
(W4) If the superpotential terms in (W3) are present, they also lead to new terms of the form for every incoming chiral X ik at the dualized node. The existence of at least one chiral field X ik , which is necessary for generating the mesonsΨ ik and M kj , does not need to be independently assumed in physically consistent theories. If this was not the case, other things would fail, e.g. the rank of the dual gauge group would be negative, according to (5.4). 16 15 In order to determine which fields are massive, knowledge of the superpotential is required. The transformation of the superpotential is explained below. Since we are interested in the low energy limit of the theory, integrating out massive fields is natural, albeit optional. 16 Relaxing this condition might be interesting from a more formal/mathematical point of view.
For a more detailed discussion of the transformation of the superpotential, see [31].
Triality is a duality of order 3, which means that acting with it three consecutive times on the same gauge node takes us back to the original theory. Interestingly, requiring that the rank of the dualized gauge group returns to itself in this process is equivalent to the SU (N k ) 2 anomaly cancellation condition for that node [31]. Generically, trialities on different nodes do not commute, which leads to a much richer space of dual theories in the case of multiple gauge nodes.

Triality for BFT 2 Theories: Dual Quivers and CW Complexes
Any gauge node/internal brick in a BFT 2 can be dualized by applying the prescription outlined above. However, we will focus on dualizations of nodes which starting from a BFT 2 result in another BFT 2 on the same 3-manifold, i.e. in another theory described by a CW complex (or equivalently by its dual quiver) on the original 3-manifold. 17 We will refer to such nodes as toric nodes. The closely related problem of triality in BBMs has been studied at length in [3,4]. Since triality is a local transformation, the discussion extends from BBMs to general BFT 2 's without changes.
Toric nodes. For a node k to be toric, a necessary condition is that starting from a toric phase, in which all ranks are equal to N , all ranks remain the same after dualizing it. Specializing (5.4) to a node k in a toric phase, we get We conclude that to obtain N k = N , we need n χ k,in = 2, i.e. toric nodes must have exactly two incoming chiral field arrows.
In the case of all equal ranks, the cancellation of the SU (N ) 2 anomaly (3.2), combined with n χ k,in = 2, implies that a toric node must have n χ k,out = n F k . (5.9) In summary, toric nodes have n χ k,in = 2 and n χ k,out = n F k ≥ 2. The lower bound is necessary to avoid SUSY breaking. Similarly, by reversing the orientation of chiral fields, we obtain toric nodes under the action of inverse triality, i.e. n χ k,out = 2 and n χ k,in = n F k ≥ 2. Finally, for the dual theory to be a BFT 2 on the same 3-manifold, triality should not generate mesons that cross over the dualized node or interlaced loops of fields in the dual quiver. A natural solution to this problem is given by a local configuration in the dual quiver of the general form shown in Figure 14 for the case of n χ k,out = n F k = 3. Such a node is dual to a cylindrical brick with a 2 n χ k,out -sided base as illustrated in Figure 13. Figure 13. Local configuration for a toric node with n χ k,out = n F k = 3 and its dual cylindrical brick. The dotted lines may be attached to other faces and represent superpotential terms.
The class of local transformations of the dual quiver illustrated in Figure 14 and the corresponding transformations G implement the appropriate modifications of the superpotential. Figure 14. Local transformation of the quiver under triality for a node with n χ k,out = n F k = 3. The initial configuration is the dual quiver of the cylindrical in Figure 13.
It is interesting to consider the simplest version of a toric node, which corresponds to n χ k,out = n F k = 2, in further detail. Figure 15 shows the local transformation of G associated to triality on such a node, to which we refer as a cube move. The edges of the cube have been colored to indicate how they deform under triality, together with the faces in G outside of the cube that are glued to them. The cube move is the analogue of the square move or urban renewal for ordinary BFTs (see [8] and references therein). As we explained in §3.1, while Fermi faces are always 4sided, chiral faces can in principle have an arbitrary number of even sides. For this reason, it is important to keep in mind that the chiral faces of the cube, which we have drawn as squares in Figure 15, can in principle have more than four sides. The additional vertices we added to some of the edges are intended as a reminder of this fact.
Cubic bricks are special in that they remain toric after triality. On the contrary, toric nodes with n χ k,out > 2 become non-toric after one dualization. Figure 16 illustrates how three consecutive dualizations on a cubic brick amount to the identity. In this figure, we have decided to integrate out massive fields only at the final step.

Reduction
The final transformation is a BFT 2 analogue of bubble reduction [32,33]. Such process was introduced in [7], by considering the field theory interpretation of BFT bubble reduction and finding its natural generalization.
In terms of the dual quiver, a BFT bubble corresponds to a node with one incoming and one outgoing bifundamental arrows. If all ranks are equal, this corresponds to an N f = N c gauge group. Bubble reduction is therefore equivalent to formally applying Seiberg duality to such a node. When doing so, the dualized node disappears, there are no dual flavors and only the corresponding mesons are left. A BFT 2 bubble is therefore naturally defined as a gauge node/internal brick that would disappear when formally acting on it with triality or inverse triality.
More precisely, a bubble that disappears under triality corresponds to a node with a single incoming chiral arrow, i.e. n χ k,in = 1, and n χ k,out = n F k + 1. Similarly, a bubble that disappears under inverse triality corresponds to a node with n χ k,out = 1 and n χ k,in = n F k + 1. Figure 17 shows a bubble and its elimination using triality. The node associated to the bubble disappears, while mesons connecting the other nodes are created. Interestingly, the same theory is obtained by higgsing with a VEV for the incoming chiral, which results in the merging of the bubble and the in node. This is analogous to bubble reduction in BFTs, which can also be thought of as the higgsing associated to deleting one of the two edges of the bubble. The elimination of a bubble with inverse triality is completely analogous.
Various explicit examples of bubble reduction will be presented in §9 and §10. Figure 17. A node with a single incoming chiral field is a BFT 2 bubble. Due to anomaly cancellation, n χ k,out = n F k + 1. The bubble is removed by triality. This process an also be interpreted as higgsing with a non-zero VEV for the incoming chiral.
Reduction and Higgsing. In [7], reducibility was related to the notion of inconsistency, which in the context of BBMs can be defined as the number of gauge groups (bricks) being larger than the normalized volume of the toric diagram of the underlying CY 4 .
As for ordinary BFTs, it is natural to expect that alternative definitions of reducibility exist. In particular, generalizing what occurs for BFTs [8], it is natural to also define reducibility as the existence of a moduli space (to be discussed in §6) preserving higgsing. In general, there might be multiple sets of chiral VEVs that reduce a given BFT 2 . The identification of such VEVs can be systematized using the correspondence between perfect matchings and fields in the quiver of (4.3) and (4.4), in conjunction with geometric ideas that will be introduced in §6. The previously mentioned equivalence between bubble reduction and higgsing is a case of this mechanism. However, explicit examples suggest that there can be BFT 2 's which are reducible by higgsing, but for which it is impossible to make bubbles explicit by sequences of trialities. It would be interesting to investigate whether the two definitions of reducibility are equivalent or if, instead, reduction by higgsing is more general.
Bubbles and higgsing might become manifest only after a series of trialities. General criteria for establishing the reducibility of BFT 2 's are desirable, but exceed the scope of this paper.

BFT 2 's and Toric Calabi-Yaus: Moduli Spaces
A remarkable property of BFT 2 's is that they are intimately related to toric CYs, which arise as their master and moduli spaces. Moreover, there is a one-to-one correspondence between perfect matchings and gauged linear sigma model (GLSM) fields in the toric description of these geometries, which significantly simplifies this map.
We will illustrate the ideas introduced in this section with the simple cube model, which for convenience we reproduce in Figure 18, together with its dual quiver.  where we have highlighted the single terms (in this case E-terms) associated to the unpaired edges of external Fermis in orange.

J-and E-flatness and Perfect Matchings
The map between chiral fields and perfect matchings introduced in (4.3) is such that J-and E-term equations are automatically satisfied, as we now review. This fact was originally established for BBMs in [2]. Given an internal Fermi Λ a , the toric condition on the superpotential (3.1) implies that the J-and E-term equations take the form Each of these two equations has a simple graphical interpretation as shown in Figure  19. The product of the chiral fields attached to an edge of a Fermi must be equal to the product of the chiral fields attached to the opposite edge. Using the map between chiral fields and perfect matchings in (4.3), these equations become From the definition of perfect matchings, it is clear that these equations are automatically satisfied, since every perfect matching appearing on the L.H.S. of one of these equations, also appears on its R.H.S. This is particularly manifest in Definition 1 from §4.1.
External Fermis. For external Fermis, we will only impose the vanishing of the equation associated to the two non-external opposite edges. Requiring that the single terms associated to the unpaired edges (e.g. the orange terms in (6.1) for the cube model) vanish would eliminate the entire moduli space. In the coming sections, we will see that this prescription leads to interesting geometries as the BFT 2 moduli spaces. Physically, we can regard this choice as attaching a single auxiliary chiral field (or several of them) to every external edge, which takes the necessary VEV to compensate the product of the chiral fields at the opposite edge. Finally, we note that imposing, albeit partially, the vanishing of J-or E-terms for external Fermis is in line with interpreting them as dynamical fields, as discussed in §3.1. Repeating the reasoning above, but with only one of the two equations in (6.3), we conclude that the map (4.3) solves all J-and E-term equations in the theory.

Master Space
The first interesting geometry associated to a BFT 2 is its master space, which we define as the space of solutions to J-and E-term equations. The concept of master space was first introduced in the context of 4d N = 1 gauge theories, where it corresponds to the space of solutions of F -term equations [34]. It was later extended to 2d N = (0, 2) gauge theories in [30]. Since the vanishing of D-terms is not imposed, the master space can be regarded as the full moduli space including baryonic directions.
Following the previous discussion, the master space of a BFT 2 can be efficiently parameterized in terms of perfect matchings. The cube model contains ten perfect matchings, which are shown in Figure 20. The P -matrix (4.4) encoding the map between chiral fields and the perfect matchings in Figure 20 is The master space of a BFT 2 is toric, i.e. it can be described by a GLSM. In addition, there is a one-to-one correspondence between perfect matchings and GLSM fields. In this language, the J-and E-term equations are translated into U (1) charges for the perfect matchings, which can be summarized in a charge matrix Q JE defined as follows Q JE = Ker P . The toric diagram of the master space is given by Ker Q JE , which is actually P . Every column of the P -matrix is the position of the corresponding perfect matching in the toric diagram. Moreover, every perfect matching is mapped to a different point. Given the analogous construction for plabic graphs [35] and its extension to general BFTs [8,9,12,36], it is natural to also refer to the toric diagram of the master space as the matching polytope.
For a simpler visualization of the geometry of the toric diagram, it is convenient to consider the row-reduced version of P . For (6.4), it becomes The master space is thus 7-complex dimensional, with a toric diagram consisting of ten different points. The entries in every column of G mast add up to 1, which furthermore implies that the master space is Calabi-Yau. Remarkably, the master spaces of all theories considered in this paper satisfy the CY condition. It is natural to expect that this is a general property of all BFT 2 's. Given that the toric diagram lives on a 6-dimensional hyperplane at distance 1 from the origin, it is sufficient to consider a projection onto it. The facts that the master space is 7d and that its toric diagram can be projected to 6d are not coincidences. As we will see in §7, these features were expected, since the cube model lives on a 3-ball and contains seven bricks, six of which are independent. This is analogous to what occurs for ordinary BFTs [8].

Mesonic Moduli Space
The second geometry naturally associated to a BFT 2 is its mesonic moduli space. For brevity, we will often refer to it just as the moduli space. For any 2d N = (0, 2) gauge theory, the moduli space is the space of solutions to vanishing J-, E-and D-terms. Therefore, it corresponds to projecting the master space onto the subspace of vanishing D-terms.
There is a D-term for every gauge group in the BFT 2 , i.e. for every internal brick. The transformation properties of the chiral fields under the gauge symmetry can be summarized in the charge matrix ∆. 18 This matrix has a row for every gauge group and a column for every chiral field. The non-zero entries on the column associated to a field X ij are a +1 on the i th row and a −1 on the j th row. All entries in columns for adjoint fields X ii vanish. For the cube model, there is a single internal brick, which corresponds to node 1 in the dual quiver shown in Figure 18, and therefore ∆ has a single row. It is given by Given the map between chiral fields and perfect matchings, we can regard the charges of chiral fields as resulting from charges of perfect matchings. Such charges are encoded in a matrix Q D , which satisfies ∆ = Q D · P T .
We conclude that the moduli space is a 6d toric variety. Similar to the master space, the toric diagram lies on a 5d hyperplane at distance 1 from the origin. This implies that the moduli space is a toric CY 6-fold. As we will explain in §7, the fact that the moduli space is 6d with a 5d toric diagram follows from the cube model having six external bricks, five of which are actually independent. From (6.13), we see that the toric diagram has nine distinct points and, interestingly, the perfect matchings p 1 and p 2 are mapped to the same point. This feature will also be addressed in this coming section from the perspective of flows. As we will illustrate in several examples, having non-trivial multiplicities of perfect matchings for points in the toric diagram, including extremal ones, is a generic property of BFT 2 's. Finally, it is interesting to mention that the toric diagram of the moduli space is the natural generalization of the matroid polytope, which is normally studied in the context of plabic graphs and BFTs [8,9,12,35,36], to BFT 2 's. Based on the evidence provided by all the examples in this paper, it seems reasonable to expect that the moduli spaces of all BFT 2 's satisfy the CY condition. We therefore conjecture that Conjecture The master and moduli spaces of every BFT 2 are toric Calabi-Yaus.
We expect the existence of a simple proof of this statement based on the combinatorics of Q JE and Q D .
Given its high dimensionality, visualizing the toric diagram defined by (6.13) is rather challenging. Figure 21 shows a 3d projection of it. While not particularly illuminating, this projection is special in that it does not make different points coincide. Figure 21. A 3d projection of the toric diagram for the moduli space, corresponding to (6.13). The projection corresponds to the following combination of rows: The procedure introduced in §6.2 and §6.3 for the computation of the moduli space applies to arbitrary BFT 2 theories, regardless of the underlying 3-manifold. It is the generalization of the fast forward algorithm to BFT 2 's . We refer the interested reader to e.g. [2,8,17] for previous discussions of this algorithm in various contexts, including brane tilings, BFTs and BBMs.

Geometry from Flows
In this section we introduce an alternative method for deriving the master and moduli spaces of BFT 2 's. More specifically, we will use flows and brick variables to map perfect matchings to points in the corresponding toric diagrams. Rather than presenting a lengthy discussion, we will simply illustrate the construction for the cube model.

Flows and Brick Variables
As explained in §4.2, we can associate a flow p µ to every perfect matching p µ , after picking a reference perfect matching. Figure 22 shows the flow for p 6 in the cube model, using p 7 as reference. As previously mentioned, flows can be equivalently regarded as oriented surfaces or as collections of oriented edges. Repeating this procedure, we can construct the flows associated to the ten perfect matchings of the cube model, which are shown in Figure 23.  Figure 20 using p 7 as the reference, whose associated flow is therefore trivial.
Equation (4.6) naturally generalizes to any oriented surface, including flows. Expressing the flows in terms of chiral fields, we obtain p 1 = X 14 X 15 X 46 X 56 X 47 X 57 p 6 = X 21 X 63 X 73 X 46 X 56 X 47 X 57 p 2 = X 21 X 31 X 46 X 56 X 47 X 57 X 46 X 56 X 47 X 57 In terms of chiral fields, the seven brick variables of the cube model become For completeness, Figure 24 shows the graphical representation of these brick variables in terms of oriented edges. Flows can be fully specified by expanding them in terms of a basis. For BFT 2 's on a 3-ball such as the cube model, brick variables provide a convenient basis in which any oriented surface can be expanded. More general 3-manifolds require additional "surface variables", analogous to the ones that arise for BFTs on general Riemann surfaces of higher genus and/or with multiple boundary components [36]. We will not discuss such variables in further detail in this paper, since the fast forward algorithm of §6 automatically produces all required additional variables. BBMs provide concrete examples in which there are three additional variables associated to the fundamental directions of T 3 , which can be regarded as the origin of the 3d toric diagrams of their CY 4 moduli spaces [1][2][3][4][5][6][7].
Let us momentarily distinguish explicitly between internal bricks W (int) i , i = 1, . . . , B i , and external ones W (ext) j , j = 1, . . . , B e , with B i and B e the numbers of internal and external bricks, respectively. We refer to the total number of bricks as B = B i + B e . These variables are subject to the constraint Be j=1 W (ext)j = 1. This implies that one of them is redundant which, without loss of generality, we can take to be one of the external bricks. This will turn out to be the manifestation, in the language of bricks, of the extra coordinate in the toric diagrams discussed in §6.
In terms of brick variables, the flows for the cube become We can either find these expansions directly or by comparing (7.1) and (7.2), which express flows and brick variables in terms of chiral fields. In (7.3), we have chosen to remove W 5 by expressing it in terms of the other brick variables.

Master and Moduli Spaces from Flows and Brick Variables
Following our previous discussion, in the case of 3-balls, flows p µ are mapped to points in a (B − 1)-dimensional space with integer coordinates, according to: 19 Coordinates : (a 1,µ , . . . , a B i ,µ , b 1,µ , . . . , b Be−1,µ ) (7.4) These coordinates can be organized as columns in a matrix. From (7.3), we obtain for the cube model which defines a 6d polytope with ten distinct points. Indeed, it is possible to show that this matrix is SL(6, Z) equivalent to (6.7). Flows therefore provide an alternative way of computing the toric diagram for the master space of a BFT 2 . This is a general result, since this procedure generates the linear relations between points in the toric diagram that encode the corresponding relations between GLSM fields. In the language of flows, the further projection onto vanishing of D-terms which is necessary for obtaining the moduli space simply translates into discarding the coordinates associated to the internal bricks. Thus, for the cube model we delete the W 1 row in (7.5), obtaining (7.6) Up to an SL(5, Z) transformation, this is equivalent to (the 5d projection of) (6.13) and hence defines the toric diagram of the moduli space. In this language, p 1 and p 2 descend to the same point in the toric diagram because they only differ by a contribution coming from the internal brick variable W 1 .

Additional Examples
The literature contains a vast list of explicit examples of BFT 2 's, in the form of BBMs (see e.g. [1][2][3][4][5][6][7]). Such theories correspond to BFT 2 's on T 3 without boundaries. In this section, we illustrate our ideas with additional examples, emphasizing the novel features of different 3-manifolds and the presence of boundaries. We pay particular attention to the geometry of the corresponding master and moduli spaces, their determination in terms of perfect matchings and the invariance of the moduli space under triality.

A Hexagonal Prism-Cube Model on a 3-Ball
Let us consider the example shown in Figure 25. G lives on a 3-ball, the internal bricks are a hexagonal prism and a cube, and it has eight external bricks. This theory has 27 perfect matchings, which are encoded in the following P -matrix (8.1) Figure 25. A hexagonal prism-cube model and its dual quiver.
While this matrix is not particularly illuminating, we include it to emphasize that it is straightforward to be explicit about the perfect matchings. Row-reducing the P -matrix, we obtain the toric diagram for the master space As expected, the master space is a CY 10-fold, since this theory lives on a 3-ball and has 10 bricks.
Finally, the moduli space is a CY 8-fold with toric diagram given by For simplicity, we have introduced a notation in which columns indicate the positions of points in the toric diagram and the last row shows the multiplicities of perfect matchings associated to each of them. Since this BFT 2 lives on a 3-ball, the dimensionality of the moduli space is equal to the number of external bricks.

A Model on T 2 × I
Consider the BFT 2 on T 2 times an interval shown in Figure 26. This theory has 54 perfect matchings. The corresponded P -matrix is presented in Appendix A. The moduli space is a CY 11-fold with toric diagram given by The dimensionality of the moduli space is a consequence of the eight external bricks, the two fundamental directions of T 2 and the two boundary components. We plan to revisit the systematics of this correspondence in future work.

Triality and the Moduli Space
It is natural to ask how to determine whether two BFT 2 's are related by sequences of cube moves and bubble reductions. This can be rather challenging since, if the theories are indeed connected, such transformations are generically not unique. Moreover, depending on the complexity of the theories, the necessary sequence of operations might be highly intricate. The moduli space, being invariant under both triality and reduction, is ideal for diagnosing whether two BFT 2 can be connected in this sense, without actually constructing the transformations that turn one theory into the other. To be precise, matching of the moduli space is a necessary condition. It would be interesting to establish whether it is also sufficient or if other moduli space-preserving transformations that go beyond triality and reduction exist.
The multiple triality phases of BBMs represent explicit examples of how dual BFT 2 's have the same moduli space (see e.g. [3,5,7]). Below we present a new example exhibiting a novel feature, a boundary. Further examples are presented in §10.

The Triality Dual of the Hexagonal Prism-Cube Model
Acting with triality on gauge group 2 of the hexagonal prism-cube model of §8.1, we obtain the theory shown in Figure 27. Dotted edges represent mass terms and we have not integrated out the corresponding massive fields. This theory has 23 perfect matchings, which give rise to a moduli space with toric diagram  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 This toric diagram agrees with the one for the original theory, given by (8.3), up to multiplicities of perfect matchings for some of its points. Several examples of theories with the same moduli space up to multiplicities of perfect matchings in the toric diagram can be found in the BBM literature [3,5,7]. Further examples are presented in the coming section.
Interestingly, integrating out the massive fields connected to node 1, this node ends up having a single incoming arrow. Node 1 would thus disappear upon acting on it with triality. This implies that the hexagonal prism-cube model is actually reducible.
We now investigate the moduli space of reducible BFT 2 's. For concreteness, we illustrate our discussion using the multi-cube family of theories schematically shown in Figure 28. The simplest theory in this class is the cube model we considered in previous sections. There are two families of these models, depending on whether the number of cubes is even or odd. For an even number of cubes, there is a relative 90 • rotation of the external faces at the two endpoints, as shown in Figure 29. This rotation is not present for an odd number of cubes, such as in the example in Figure 30. The multi-cube model with n cubes lives on a 3-ball, and has n internal and six external bricks. Following the discussion in previous sections, we thus expect their master spaces to be toric CY (n + 6)-folds, with (n + 5)-dimensional toric diagrams. Similarly, for any n, the moduli space should be a toric CY 6-fold with a 5d toric diagram. We will now explain that the agreement between the moduli spaces of all these theories extends beyond their dimension.
The single cube model was thoroughly studied in previous sections, with its master and moduli spaces captured by (6.7) and (6.13), respectively. Let us now consider the 2-and 3-cube models.

2-Cube Model
The 2-cube model is shown in Figure 29.
Following the procedure in §6, we compute its moduli space. There are 13 perfect matchings and the moduli space parameterized by them is encoded in the toric diagram defined by (10.1) Figure 29. The 2-cube model and its dual quiver.
Interestingly, despite the different multiplicities, the toric diagram coincides with the one for the single cube model in (6.13). The 1-and 2-cube models have the same moduli space.

3-Cube Model
The 3-cube model is shown in Figure 30. Computing its moduli space, we obtain 18 perfect matchings which form a toric diagram defined by the following matrix This process turns an n-cube model into an (n − 2)-cube one. Iterating this procedure, we can thus reduce odd and even n models all the way down to the 1-cube model and 2-cube model, respectively. Finally, the connection between even and odd n is also straightforward, albeit slightly more subtle. Dualizing any of the cubes in the 2-cube model we generate a model with a bubble, which after reduction, results in a single cube. In addition, there are some external massive faces which, due to the way in which we treat the corresponding fields, are equivalent to the single external faces of the basic 1-cube model. In summary, the n-cube models are reducible for n > 1 and can be connected by triality and reduction to the 1-cube theory. All of them share the same moduli space, which is the toric CY 6-fold associated to the toric diagram (6.13).

Conclusions and Outlook
We introduced and initiated the study of BFT 2 's, a general class of 2d N = (0, 2) gauge theories defined by 2-dimensional CW complexes on oriented 3-manifolds. While we primarily focused on examples with boundaries, in order to illustrate their novel features, theories without boundaries are also extremely interesting.
The dynamics of BFT 2 's is neatly captured by transformations of the CW complexes. A salient feature of this family of theories is its deep connection to combinatorial and geometric objects. These objects, such as the toric moduli spaces, which in turn are computed in terms of perfect matchings, provide powerful tools for addressing questions like the characterization of triality equivalence classes or diagnosing reducibility.
We identified structures, such as the ones leading to the automatic implementation of the trace condition, which were unnoticed in earlier considerations of BFT 2 's in the context of BBMs. We expect some of these new insights may shed light on open problems like, for instance, a better understanding of the BFT 2 analogues of zig-zag paths.
Our work suggests various natural directions for future investigation. Below we summarize some of them.
• Embedding additional sub-classes of BFT 2 's, beyond the well-studied BBMs, in string theory. Of particular interest are theories with boundaries. Natural scenarios for such constructions involve systems of (fractional) D1-branes and flavor D5-branes at toric CY 4-folds, and their T -dual configurations of NS5 and D4-branes. 20 • Understanding how the dimension of the moduli space depends on the topology of the underlying 3-manifold. While the methods introduced in §6 apply to any 3manifold, it would be illuminating to systematically determine a convenient basis of flows depending on the topology.
• Generalizations of dimer models based on m-graded quivers with superpotentials were introduced in [16], where they were referred to as m-dimers. They capture the open 20 It would also be interesting to engineer other classes of theories that are closely related to BFT2's, e.g.
ones in which (some of) the external Fermis are non-dynamical. Such theories would be similar in spirit to the close relatives of ordinary BFTs of [14,15].
string sector of the topological B-model on toric CY (m + 2)-folds. BBMs, which BFT 2 's generalize, correspond to m = 2. We expect similar generalizations of mdimers, which we can generically call BFT m , exist for m > 2. It would be interesting to work out the details of such theories.
• Ordinary BFTs have applications to a wide range of interesting systems, which goes from D-branes at CY 3-folds to scattering amplitudes [8]. BFT 2 's certainly include the gauge theories that arise on D-branes at CY 4-folds [2]. It would be interesting to determine whether their range of applicability is also broader.
• Finally, another interesting, albeit rather speculative, question is whether BFT 2 's admit natural generalizations of perfect orientations and boundary measurements. If so, do they give rise to certain notion of positive objects in some special cases? Such theories would become the analogues of ordinary BFTs associated to plabic graphs.
We expect to address some of these questions in future work.
A Perfect Matchings for the BFT 2 on T 2 × I The 54 perfect matchings for the BFT 2 on T 2 × I presented in §8.2 are summarized in the following P -matrix.