Dichotomy for Graph Homomorphisms with Complex Values on Bounded Degree Graphs
DDichotomy for Graph Homomorphisms with ComplexValues on Bounded Degree Graphs
Jin-Yi Cai ∗ [email protected] Artem Govorov †‡ [email protected] Abstract
The complexity of graph homomorphisms has been a subject of intense study [11, 12, 4, 42,21, 17, 6, 20]. The partition function Z A ( · ) of graph homomorphism is defined by a symmetricmatrix A over C . We prove that the complexity dichotomy of [6] extends to bounded degreegraphs. More precisely, we prove that either G (cid:55)→ Z A ( G ) is computable in polynomial-timefor every G , or for some ∆ > G with maximum degree∆( G ) ≤ ∆. The tractability criterion on A for this dichotomy is explicit, and can be decidedin polynomial-time in the size of A . We also show that the dichotomy is effective in that eithera P-time algorithm for, or a reduction from Z A ( · ) can be constructed from A , in therespective cases. ∗ Department of Computer Sciences, University of Wisconsin-Madison. Supported by NSF CCF-1714275. † Department of Computer Sciences, University of Wisconsin-Madison. Supported by NSF CCF-1714275. ‡ Artem Govorov is the author’s preferred spelling of his name, rather than the official spelling Artsiom Hovarau. a r X i v : . [ c s . CC ] A p r Introduction
Given two graphs G and H , a graph homomorphism (GH) from G to H is a map f from thevertex set V ( G ) to V ( H ) such that, whenever ( u, v ) is an edge in G , ( f ( u ) , f ( v )) is an edge in H [32, 22]. In 1967, Lov´asz [32] proved that H and H (cid:48) are isomorphic iff for all G , the numberof homomorphisms from G to H and from G to H (cid:48) are the same. More generally, one considersweighted graphs H where every edge of H is given a weight. This is represented by a symmetricmatrix A and the set of all homomorphisms from G to H can be aggregated in a single sum-of-product expression called the partition function Z A ( G ) [13]. The number of homomorphisms from G to H is the special case where all edges of H have weight 1, and A is the 0-1 adjacency matrix of H . This partition function Z A ( G ) provides an elegant framework to express a wide-variety of graphproperties . These partition functions are also widely studied in statistical physics representing spinsystems [3, 24, 36, 37, 25, 19, 18].We use the standard definition for graph homomorphism and its partition function Z A ( G ). Ourgraphs G and H are undirected (unless otherwise specified). G is allowed to have multiple edgesbut no loops; it is simple if it has neither. H can have loops, multiple edges, and more generally,edge weights. We allow edge weights to be arbitrary complex numbers. ∗ Let A = ( A i,j ) be an m × m symmetric matrix with entries A i,j ∈ C , we define Z A ( G ) = (cid:88) ξ : V → [ m ] (cid:89) ( u,v ) ∈ E A ξ ( u ) ,ξ ( v ) (1.1)for every undirected graph G = ( V, E ).The complexity of the partition function Z A ( · ) has been shown to obey a dichotomy: Dependingon A , the computation G (cid:55)→ Z A ( G ) is either in polynomial time or A : In [11, 12], Dyer and Greenhill first proved thiscomplexity dichotomy for symmetric { , } -matrices A . In this case, Z A ( G ) counts the numberof graph homomorphisms without weight. Bulatov and Grohe [4, 42, 21] proved this for Z A ( · )where A is any nonnegative symmetric matrix. This was extended by Goldberg, Grohe, Jerrumand Thurley [17] to all real symmetric matrices. Finally, Cai, Chen and Lu [6] generalized this toall complex symmetric matrices. Every subsequent complexity dichotomy subsumes the previousone as a special case. In each case, an explicit tractability criterion on A is given such that if A satisfies the criterion then Z A ( · ) is computable in P-time, otherwise it is { , } -matrix A fails the tractabilitycondition then Z A ( · ) is ∗ To be computable in the strict Turing model, they are algebraic complex numbers. heorem 1.1. Let A be a symmetric and algebraic complex matrix. Then either G (cid:55)→ Z A ( G ) canbe computed in polynomial time on arbitrary graphs G , or for some ∆ > depending on A , it is G of maximum degree at most ∆ . The dichotomy criterion on A is the same as in [6]. This complexity dichotomy has an explicitform, and given A , it is decidable in polynomial time (in the size of A ) whether A satisfies thecriterion, and thus one can decide which case the partition function Z A ( · ) belongs to. However,there is a more demanding sense in which the dichotomy of [6] is not constructive. When A satisfiesthe criterion, then an explicit polynomial-time algorithm for G (cid:55)→ Z A ( G ) is given; but when A does not satisfy the criterion, it is only proved that a polynomial time reduction from Z A ( · ) exists and not given constructively. In this paper we remedy this situation and prove thatthe dichotomy in Theorem 1.1 can be made fully constructive.By the standard definition of graph homomorphism, the input graph G is allowed to havemultiple edges (but no loops). Our polynomial-time algorithm for G (cid:55)→ Z A ( G ) in the tractablecase of Theorem 1.1 works for graphs with multiple edges and loops. More importantly, we willprove that in the simple graphs G (i.e., without multiple edgesand without loops) in addition to being of bounded degree.We state this stronger form of Theorem 1.1 next. Theorem 1.2.
The complexity dichotomy criterion in Theorem 1.1 is polynomial-time decidable inthe size of A . If A satisfies the criterion, then G (cid:55)→ Z A ( G ) is computable in polynomial-time by anexplicit algorithm for any G (allowing multiple edges and loops). If A does not satisfy the criterion,then Z A ( G ) is G , and a polynomial-time reduction from Z A ( · ) can be constructed from A . Note that the P-time decidability of the dichotomy criterion is measured in the size of A . Whenwe say in the Z A ( · ) can be constructed,this notion of polynomial-time is measured in terms of the size of instances to G produced by the reduction as instances to Z A ( · )), and A isconsidered fixed—it defines the Z A ( · ). In the A produces a P-time reduction from Z A ( · ). However, we should point out that, in the A .The proof in [6] does not work for bounded degree graphs G . The main structure of the proofin [6] is a long sequence of successively stringent conditions which a matrix A must satisfy, or elseit is proved that Z A ( · ) is A imply that Z A ( · ) is computable in polynomial time. In each stage, assuming A satisfies the condition of thatstage, the matrix A (or another matrix A (cid:48) which has a better form, but Z A (cid:48) ( · ) is equivalent to Z A ( · ) in complexity) is passed on to the next stage. The condition often gives some structuralinformation that allows for a better representation of A , which is not available otherwise.However, close to the beginning of the 100-page proof in [6] (before Step 1.1, p. 949) there isa Lemma 7.1 which proves an equivalence of Z A ( · ) to another problem called COUNT ( A ). (Thisequivalence allows us to substitute A with a “purified” matrix B which defines an “equivalent”problem Z B ( · ), but B has desirable structural properties without which the proof in [6] cannotcontinue. This is before all the substantive proof in [6] gets started.) Unfortunately, the proof ofthis Lemma 7.1 uses graphs of unbounded degree, and we cannot find a way to modify the proof tomake it work for bounded degree graphs. We also remark that the method in the recent proof [20]2hat extended the Bulatov-Grohe dichotomy for nonnegative weights to bounded degree graphs isalso not sufficient here. However, a crucial construction, which is a refinement of a constructionfrom [20], is an important step in this paper.In addition to this crucial construction, the main idea in this paper is algebraic instead. Wewill introduce a new notion called multiplicative-block-rank-1 , and a related notion called modular-block-rank-1 . These are weaker notions than the block-rank-1 condition that was widely used inall previous dichotomies. We establish a fundamental implication that if A is not multiplicative-block-rank-1, then Z A ( · ) is A is proved to satisfy some additional conditions (or else we get non-multiplicative-block-rank-1 . In this paper we show that in each case, this property of non-multiplicative-block-rank-1 can be transferred from any subsequent stage to the previous stage.Thus here is a very rough high-level outline of our proof:For the purification step we cannot simply substitute A by its purified form and move to thenext stage. Instead we will keep both A and its purified form A , and pass both to subsequent stages.It is only with respect to the purified form A we can use combinatorial gadget constructions toconclude that the matrix has desirable properties. However, with a purely algebraic argument wenevertheless “transfer” these conclusions to the unpurified A . These algebraic arguments are interms of properties of polynomials, exponential polynomials, and properties of finitely generatedsubfields of C . Ultimately most of the algebraic arguments rely on a simple algebraic fact whichwe call the Vandermonde Argument (see Lemma 3.16). Then we go through the proof in [6]step-by-step. In each step, we show how to “transfer” the property of non-multiplicative-block-rank-1 of a later stage to the previous stage. This task is accomplished by three meta-arguments,Arguments 11.7, 11.10, and 12.1, i.e., (
Meta ), ( Meta ) and ( Meta ). These formulate our transferprocedure.The bulk of this paper will be dedicated to the proof of Theorem 1.1. After that we extendthe A , it is proved in [20]that its A ,this trick does not work. While real symmetric matrices can always be diagonalized, for complexsymmetric matrices this is not true, and more importantly, the Jordan normal form may containnontrivial nilpotent blocks, i.e., blocks of size greater than one and corresponding to eigenvalue 0.In this paper, we overcome this difficulty by not proving a reduction from the case of boundeddegree graphs to the case of bounded degree and simple graphs. Instead we use a transfer argumentof the property of non-multiplicative-block-rank-1 constructions. This is stated in Theorem 20.2.In order to prove it, we will heavily make use of the results from [7].The proof in [6] starts by reducing the matrix A to its connected components, and so wemay assume that A is connected. This is achieved by means of the so-called first pinning lemma(Lemma 4.1 from [6]). (After that, A undergoes the purification step defined in Section 7.1 from [6].)However, even though the proof of this first pinning lemma does preserve degree boundedness, theproof presented in [6] is not constructive and does not preserve simple graphs. While both issues can3e tackled by using results from [7], this would introduce unnecessary complications. Instead wechoose a different route. We will still use results from [7] to extend our dichotomy to simple graphs.However in our paper, we replace the main theme of the proof in [6] from one that is reduction basedto one that relies on the three meta-arguments that transfer gadget constructions from one stageto another. Thus we will not use any of the three pinning lemmas in [6]. In particular we use thetransfer method to move to any connected component of A without actually performing a formalcomplexity reduction. Additionally, in all subsequent stages, we apply one of the meta-arguments,( Meta ), ( Meta ) and ( Meta ) to obtain what is in effect a complexity reduction without the formalcomplexity reduction. Organization
This paper is organized as follows. After the introductory Section 1, in Section 2 we give somedefinitions of EVAL problems, and also the basic A ) for bounded degree graphs. Thisuses a new gadget and the Vandermonde Argument. In Section 6 we prove Theorem 6.1, which isagain algebraic in nature. In Section 7 we describe the reduction to connected components withoutusing pinning.Sections 8 and 9 give a detailed proof outline for the bipartite and the nonbipartite casesrespectively. This proof plan is carried out in the subsequent Section 10 to Section 19. We note inparticular that from this point our proof is essentially a meta-proof, i.e., we follow the proof in [6]closely, but use three meta-arguments, Arguments 11.7, 11.10, and 12.1, i.e., ( Meta ), ( Meta ) and( Meta ), to carry out the details. For the ease of readers we actually give the full proof (withoutthe meta-arguments) for Lemma 11.6, before introducing Argument 11.7 ( Meta ). This gives aconcrete demonstration how such a proof is, without ( Meta ), and how ( Meta ) transforms such aproof. For all subsequent proofs from Section 10 to Section 19 we always apply ( Meta ), ( Meta )and ( Meta ).In Section 20 we prove that the dichotomy in Theorem 1.1 can be extended to simple graphsin Theorem 20.2. In Section 21 (and in Appendix A.1) we show the polynomial time decidabilityof our dichotomies. In Section 22 we prove that our dichotomies are constructive in the sense ofTheorem 22.1. We also explain the changes that can be made to the proof in [6] to make that proofconstructive in Appendix A.2.An index of conditions and problem definitions is given in Figure 1. We let Q denote the set of rational numbers, and let R and C denote the set of algebraic real andalgebraic complex numbers, respectively. 4 U ) – ( U ) p. 37 ( U ) p. 39 ( R ) – ( R ) p. 40( L ) – ( L ) p. 41 ( D ) – ( D ) p. 42 ( U (cid:48) ) – ( U (cid:48) ) p. 43( U (cid:48) ) p. 44 ( R (cid:48) ) – ( R (cid:48) ) p. 45 ( L (cid:48) ) – ( L (cid:48) ) p. 46( D (cid:48) ) – ( D (cid:48) ) p. 47 ( T ) – ( T ) p. 48 ( S ) p. 50( S ) – ( S ) p. 51 ( Meta ) p. 54 ( Shape ) – ( Shape ) p. 56( Meta ) p. 57 ( Shape ) p. 60 ( Meta ) p. 67( GC ) p. 67 ( F ) – ( F ) p. 74 ( S (cid:48) ) – ( S (cid:48) ) p. 75( Shape (cid:48) ) – ( Shape (cid:48) ) p. 78 Z A ( G ) and EVAL ( A ) p. 6 Z C , D ( G ) and EVAL ( C , D ) p. 7 Z A , D ( G ) and EVAL( A , D ) p. 6 Z → C , D ( G ) and EVAL → ( C , D ) p. 7 Z ← C , D ( G ) and EVAL ← ( C , D ) p. 7 EVAL ↔ ( C , D ) p. 7 M Γ , A p. 9 M Γ , C , D p. 9 T p ( G ) and S r ( G ) p. 10 A (cid:12) p p. 10mult-brk-1 p. 12 mod-brk-1 p. 12 P n,p,(cid:96) p. 25 R d,n,p,(cid:96) p. 25 G n,p,(cid:96) p. 26 Z A , D and EVAL( A , D ) p. 32 Z q ( f ) and EVAL ( q ) p. 72 hom( G, H ) p. 84 H A , D p. 84 H A p. 84hom φ ( G, H ) p. 84 hom ( i,j ) ( G, H ) p. 84
PLG [ k ] p. 84 PLG simp [ k ] p. 84Figure 1: Index of Conditions and Problem Definitions For a positive integer n , we use [ n ] to denote the set { , . . . , n } and [0] = ∅ . We use [ m : n ],where m ≤ n , to denote { m, m + 1 , . . . , n } . We use n to denote the all-one vector of dimension n .Sometimes we omit n when the dimension is clear from the context. For a positive integer N , welet ω N = e πi/N , a primitive N th root of unity.Let x , y be two vectors in C n . Then we use (cid:104) x , y (cid:105) to denote their inner product, (cid:104) x , y (cid:105) = n (cid:88) i =1 x i · y i , and x ◦ y ∈ C n to denote their Hadamard product, ( x ◦ y ) i = x i · y i for all i ∈ [ n ].Let A = ( A i,j ) be a k × (cid:96) matrix. We use A i, ∗ ( i ∈ [ k ]) and A ∗ ,j ( j ∈ [ (cid:96) ]) to denote the i th rowvector and j th column vector of A , respectively. If A = ( A i,j ) and B = ( B s,t ) are k × (cid:96) and m × n matrices, respectively, we let C = A ⊗ B denote their tensor product: C is a km × (cid:96)n matrix whoserows and columns are indexed by [ k ] × [ m ] and [ (cid:96) ] × [ n ], respectively, such that C ( i,s ) , ( j,t ) = A i,j · B s,t , for all i ∈ [ k ], s ∈ [ m ], j ∈ [ (cid:96) ] and t ∈ [ n ].5iven an n × n symmetric complex matrix A , we use H = ( V, E ) to denote the followingundirected graph: V = [ n ] and ij ∈ E iff A i,j (cid:54) = 0. We say A is connected if H is connected, andwe say A has connected components A , . . . , A s if the connected components of H are V , . . . , V s ,and A i is the | V i | × | V i | submatrix of A restricted by V i ⊆ [ n ], for all i ∈ [ s ]. Moreover, we say A is bipartite if H is bipartite; otherwise, A is nonbipartite . Let Σ and Π be two permutations of [ n ].Then we use A Σ , Π to denote the n × n matrix whose ( i, j )th entry is A Σ( i ) , Π( j ) , i, j ∈ [ n ].We say C is the bipartization of a matrix F if C = (cid:18) T (cid:19) . We usually use D i to denote the ( i, i )th entry of a diagonal matrix D .We say a problem is tractable if it can be solved in polynomial time. Given two problems P and Q , we say P is polynomial-time reducible to Q , or P ≤ Q , if there is a polynomial-time algorithmthat solves P using an oracle for Q . These reductions are known as Cook reductions. We also say P is polynomial-time equivalent to Q , or P ≡ Q , if
P ≤ Q and
Q ≤ P . Model of computation
One technical issue is the model of computation with algebraic numbers.We adopt a standard model from [26] for computation in an algebraic number field as in [6]. Thisis precisely described in Section 2.2 in [6], see also [5].
EVAL ( A ) and EVAL ( C , D ) Let A = ( A i,j ) ∈ C m × m be a symmetric matrix. It defines a graph homomorphism problem EVAL ( A ) as follows: Given an undirected graph G = ( V, E ), compute Z A ( G ) = (cid:88) ξ : V → [ m ] wt A ( ξ ) , where wt A ( ξ ) = (cid:89) ( u,v ) ∈ E A ξ ( u ) ,ξ ( v ) . (2.1)We call ξ an assignment to the vertices of G , and wt A ( ξ ) the weight of ξ .This is the standard definition of the partition function of graph homomorphism; here G canhave multiple edges but no loops, while incorporated into the weight in A the underlying graph H can have multiple edges and loops. Our tractability result will apply to graphs G with multipleedges and loops, while the G when A is not assumed to be symmetric, namely we let the product for wt A ( ξ ) in (2.1)to range over directed egdes ( u, v ) of G .We denote by EVAL (∆) ( A ) the problem EVAL( A ) when restricted to graphs G with maximumdegree ∆( G ) ≤ ∆. Similar notations apply to the other EVAL problems introduced below.The problem EVAL ( A ) can be generalized to include vertex weights [11, 14, 33]. There areseveral versions that we will specify; the simplest is the following where a single diagonal matrix D specifies the weights for every vertex. Definition 2.1.
Let A ∈ C m × m be a symmetric matrix and D ∈ C m × m a diagonal matrix. Theproblem EVAL( A , D ) is defined as follows: Given an undirected graph G = ( V, E ) , compute Z A , D ( G ) = (cid:88) ξ : V → [ m ] (cid:89) w ∈ V D ξ ( w ) (cid:89) ( u,v ) ∈ E A ξ ( u ) ,ξ ( v ) . A ) is the special case EVAL( A , I m ).It turns out that for Theorem 1.1, the most important vertex weight dependent EVAL problemis the following problem EVAL ( C , D ). Definition 2.2 (Definition 2.1 from [6]) . Let C ∈ C m × m be a symmetric matrix, and D = (cid:0) D [0] , D [1] , . . . , D [ N − (cid:1) be a sequence of diagonal matrices in C m × m for some N ≥ . We define the following problem EVAL ( C , D ) : Given an undirected graph G = ( V, E ) , compute Z C , D ( G ) = (cid:88) ξ : V → [ m ] wt C , D ( ξ ) , (2.2) where wt C , D ( ξ ) = (cid:32) (cid:89) v ∈ V D [deg( v ) mod N ] ξ ( v ) (cid:33)(cid:32) (cid:89) ( u,v ) ∈ E C ξ ( u ) ,ξ ( v ) (cid:33) and deg( v ) denotes the degree of v in G . One can also define a version where the dependence on the degree is not subject to mod N . Weuse the same notation EVAL( A , D ) for this problem, which is only used in Section 5. Definition 2.3.
Let A ∈ C m × m be a symmetric matrix and D = { D [[ i ]] } ∞ i =0 a sequence of diagonalmatrices in C m × m . The problem EVAL( A , D ) is defined as follows: Given an undirected graph G = ( V, E ) , compute Z A , D ( G ) = (cid:88) ξ : V → [ m ] (cid:89) w ∈ V D [[deg( w )]] ξ ( w ) (cid:89) ( u,v ) ∈ E A ξ ( u ) ,ξ ( v ) . Definition 2.2 is the special case of Definition 2.3 where each D [[ i ]] = D [ i mod N ] for any i ≥ G be an undirected graph with connected components G , . . . , G s . Property 2.4. Z C , D ( G ) = Z C , D ( G ) × · · · × Z C , D ( G s ) . Property 2.4 implies that, to design an algorithm for
EVAL ( C , D ) or to reduce EVAL ( C , D ) toanother problem, it suffices to consider connected input graphs. It also preserves bounded degreegraphs for any degree bound ∆ ≥
0, since ∆( G i ) ≤ ∆( G ) for each i ∈ [ s ]. As EVAL ( A ) is a specialcase of EVAL ( C , D ) in which every D [ i ] is an identity matrix, Property 2.4 applies to EVAL ( A ) aswell.Next, suppose C is the bipartization of an m × n matrix F , so C is ( m + n ) × ( m + n ). Given agraph G and a vertex u in G , we use Ξ to denote the set of ξ : V → [ m + n ] with ξ ( u ) ∈ [ m ], andΞ to denote the set of ξ with ξ ( u ) ∈ [ m + 1 : m + n ]. Then let Z → C , D ( G, u ) = (cid:88) ξ ∈ Ξ wt C , D ( ξ ) and Z ← C , D ( G, u ) = (cid:88) ξ ∈ Ξ wt C , D ( ξ ) . The next property follows from the definitions.
Property 2.5. Z C , D ( G ) = Z → C , D ( G, u ) + Z ← C , D ( G, u ) .
7e use these two new functions to express the partition function when the matrix is in a tensorproduct form in the bipartite case. The following is Lemma 2.4 of [6].
Lemma 2.6.
For each i ∈ { , , } , let F [ i ] be an m i × n i complex matrix, where m = m m and n = n n ; let C [ i ] be the bipartization of F [ i ] ; and let D [ i ] = (cid:0) D [ i, , . . . , D [ i,N − (cid:1) be a sequence of ( m i + n i ) × ( m i + n i ) diagonal matrices for some N ≥ , where D [ i,r ] = (cid:18) P [ i,r ] Q [ i,r ] (cid:19) and P [ i,r ] , Q [ i,r ] are m i × m i , n i × n i diagonal matrices, respectively. Assume F [0] = F [1] ⊗ F [2] , P [0 ,r ] = P [1 ,r ] ⊗ P [2 ,r ] , and Q [0 ,r ] = Q [1 ,r ] ⊗ Q [2 ,r ] for all r ∈ [0 : N − . Then for any connected graph G and any vertex u ∗ in G , Z → C [0] , D [0] ( G, u ∗ ) = Z → C [1] , D [1] ( G, u ∗ ) · Z → C [2] , D [2] ( G, u ∗ ) and (2.3) Z ← C [0] , D [0] ( G, u ∗ ) = Z ← C [1] , D [1] ( G, u ∗ ) · Z ← C [2] , D [2] ( G, u ∗ ) . (2.4) Definition 2.7.
We define the problem
EVAL → ( C , D ) (resp., EVAL ← ( C , D ) ): Given a pair ( G, u ) where G = ( V, E ) is an undirected graph and u ∈ V , compute Z → C , D ( G ) (resp., Z ← C , D ( G ) ). Givena tuple ( → , u, G ) or ( ← , u, G ) , the problem EVAL ↔ ( C , D ) is to compute Z → C , D ( G ) or Z ← C , D ( G ) ,respectively. Restricting the inputs of each of the problems EVAL → ( C , D ), EVAL ← ( C , D ) and EVAL ↔ ( C , D )to the pairs ( G, u ) (for the first two), or the tuples ( → , G, u ) and ( ← , G, u ) (for the latter), where G = ( V, E ) is connected and u ∈ V , we get a problem polynomial-time equivalent to the corre-sponding original problem, so we only need to consider such pairs (tuples) as inputs, and fur-thermore all these problems are polynomial-time equivalent. This follows from the following:(1) a trivial extension of Property 2.4 for Z → C , D and Z ← C , D ; (2) Property 2.5; (3) the fact thatif G = ( V, E ) is not bipartite and u ∈ V , then Z → C , D ( G, u ) = Z ← C , D ( G, u ) = 0; and (4) the fact thatif G = ( U ∪ V, E ) is connected and bipartite, u ∈ U and v ∈ V , then Z → C , D ( G, u ) = Z ← C , D ( G, v ) and Z → C , D ( G, v ) = Z ← C , D ( G, u ).We have the following trivial property.
Property 2.8.
EVAL( C , D ) ≤ EVAL ↔ ( C , D ) . In [6], besides the first pinning lemma, two more pinning lemmas are proved, called the secondand third pinning lemmas, which give the reverse directions of Property 2.8 (under certain technicalconditions). However we are unable to prove the second pinning lemma constructively. The proofin this paper will be made constructive. In order to avoid nonconstructive steps, we will avoid usingany of the three pinning lemmas, which has the slight complication that we must use EVAL ↔ ( C , D )instead of EVAL( C , D ) in certain steps of the proof (see Theorem 8.3).In this paper, a crucial object is an edge gadget , which will be used in different EVAL frameworks.An edge gadget Γ is simply an undirected graph ( V, E ) with two distinguished (ordered) vertices u ∗ , v ∗ ∈ V . 8 efinition 2.9. Let A ∈ C m × m be a symmetric matrix and let Γ = (
V, E ) be an edge gadget withdistinguished vertices u ∗ , v ∗ (in this order). Define M Γ , A ∈ C m × m to be the edge weight matrix, orsignature, of Γ in the framework EVAL( A ) . More precisely, we define M Γ , A ∈ C m × m as follows:for i, j ∈ [ m ] , let M Γ , A ( i, j ) = (cid:88) ξ : V → [ m ] ξ ( u ∗ )= i, ξ ( v ∗ )= j wt Γ , A ( ξ ) , where wt Γ , A ( ξ ) = (cid:89) ( u,v ) ∈ E A ξ ( u ) ,ξ ( v ) . Note that while A is symmetric, the matrix M Γ , A is not symmetric in general. We give a moregeneral definition. Definition 2.10.
Let ( C , D ) be a pair from Definition 2.2 and let Γ = (
V, E ) be an edge gadgetwith distinguished vertices u ∗ , v ∗ (in this order). Define M Γ , C , D ∈ C m × m to be the edge weightmatrix, or signature, of Γ in the framework EVAL( C , D ) . More precisely, for i, j ∈ [ m ] , M Γ , C , D ( i, j ) = (cid:88) ξ : V → [ m ] ξ ( u ∗ )= i, ξ ( v ∗ )= j wt Γ , C , D ( ξ ) , where wt Γ , C , D ( ξ ) = (cid:32) (cid:89) v ∈ V \{ u ∗ ,v ∗ } D [deg( v ) mod N ] ξ ( v ) (cid:33)(cid:32) (cid:89) ( u,v ) ∈ E C ξ ( u ) ,ξ ( v ) (cid:33) . Note that the vertex weights corresponding to u ∗ and v ∗ are excluded from the product inthe definition of M Γ , C , D . Analogously, we can define the edge weight matrix of an edge gadgetaccording to Definitions 2.1 and 2.3. Lemma 2.11.
Let ( C , D ) be as in Definition 2.2 and Γ be an edge gadget with distinguished vertices u ∗ , v ∗ (in this order). If u ∗ , v ∗ lie in different connected components of Γ , then rank M Γ , C , D ≤ .Proof. Let Γ , . . . , Γ s ( s ≥
2) be the connected components of Γ, and suppose u ∗ ∈ Γ and v ∗ ∈ Γ .For w ∈ { u ∗ , v ∗ } from Γ (cid:96) ( (cid:96) ∈ { , } ) and any i ∈ [ m ], we write Z C , D (Γ (cid:96) , w, i ) = (cid:88) ξ : V (Γ (cid:96) ) → [ m ] ξ ( w )= i (cid:32) (cid:89) v ∈ V (Γ (cid:96) ) \{ w } D [deg( v ) mod N ] ξ ( v ) (cid:33)(cid:32) (cid:89) ( u,v ) ∈ E (Γ (cid:96) ) C ξ ( u ) ,ξ ( v ) (cid:33) . Then M Γ , C , D ( i, j ) = (cid:32) s (cid:89) k =3 Z C , D (Γ k ) (cid:33) Z C , D (Γ , u ∗ , i ) Z C , D (Γ , v ∗ , j )for i, j ∈ [ m ], and therefore rank M Γ , C , D ≤ u ∗ , v ∗ belong to the same connected component Γ , then M Γ , C , D = (cid:32) s (cid:89) k =1 Z C , D (Γ k ) (cid:33) M Γ , C , D . where (cid:81) sk =1 Z C , D (Γ k ) is a scalar factor. 9 v p − p u vr − r. . . Figure 2: The thickening T p e and the stretching S r e of an edge e = ( u, v ). u v u v Figure 3: The graphs T S e (on the left) and S T e (on the right) where e = ( u, v ).Since we will be only interested in edge gadgets with rank M Γ , C , D >
1, we may without loss ofgenerality assume Γ is connected.In case C is bipartite, we may assume any edge gadget Γ in the framework of EVAL ( C , D ) tobe (connected and) bipartite Γ = ( U ∪ V, E ), because for nonbipartite Γ, M Γ , C , D = 0. If u ∗ , v ∗ liein the same bipartite part of Γ (e.g., u ∗ , v ∗ ∈ U ), then M Γ , C , D has the form M Γ , C , D = (cid:32) M [0]Γ , C , D M [1]Γ , C , D (cid:33) . If u ∗ ∈ U and v ∗ ∈ V , then M Γ , C , D = (cid:32) M [0]Γ , C , D M [1]Γ , C , D (cid:33) . Any proof in our paper for the first case can be easily adapted to the second case. Therefore, forthe bipartite case, we will assume without loss of generality that u ∗ and v ∗ belong to the samebipartite part.Two simple operations are known as thickening and stretching . Let p, r ≥ p - thickening of an edge replaces it by p parallel edges, and an r - stretching replaces it by a pathof length r . In both cases we retain the endpoints. We denote by T p ( G ), respectively S r ( G ), thegraph obtained from G by p - thickening , respectively r - stretching , every edge of G . T p e and S r e are the special cases when the graph consists of a single edge e . See Figure 2 for an illustration.Thickenings and stretchings can be combined successively. Examples are shown in Figure 3.For a matrix A , its Hadamard power A (cid:12) p is the matrix obtained by replacing each entry of A with its p th power. Clearly, Z A ( T p G ) = Z A (cid:12) p ( G ) and Z A ( S r G ) = Z A r ( G ). More generally, for thevertex-weighted case, we have Z A , D ( T p G ) = Z A (cid:12) p , D ( G ) and Z A , D ( S r G ) = Z A ( DA ) r − , D ( G ). Here( DA ) = I m if A and D are m × m . 10 .3 Basic We say a symmetric matrix A ∈ C m × m is rectangular if there are pairwise disjoint nonemptysubsets of [ m ]: T , . . . , T r , P , . . . , P s , Q , . . . , Q s , for some r, s ≥
0, such that A i,j (cid:54) = 0 iff( i, j ) ∈ (cid:91) k ∈ [ r ] ( T k × T k ) ∪ (cid:91) l ∈ [ s ] [( P l × Q l ) ∪ ( Q l × P l )] .T k × T k , P l × Q l and Q l × P l are called blocks of A . Further, we say A is block-rank- A isrectangular and every block of A has rank one. Theorem 2.12 (Bulatov and Grohe [4]) . Let A be a symmetric matrix with nonnegative entries.Then EVAL( A ) is in polynomial time if A is block-rank- , and is We state some preliminaries of an algebraic nature.
Lemma 3.1.
Any finitely generated field over Q contains finitely many roots of unity. We will only need this lemma for finite dimensional extensions over Q (since we work withalgebraic numbers), although the lemma is true for not necessarily algebraic extensions. For analgebraic extension K , let k = [ K : Q ] < ∞ be the degree of the extension. The minimal polynomialover Q of a (primitive) root of unity of order r is the r -th cyclotomic polynomial Φ r ( x ) of degree ϕ ( r ), the Euler totient function, each having at most ϕ ( r ) roots in K . Clearly ϕ ( r ) ≥ (cid:112) r/ r ≥
1. Hence r ≤ ϕ ( r )) ≤ k . Thus the number of roots of unity in K is bounded by (cid:80) k r =1 ϕ ( r ).The following lemma is a well-known fact. Lemma 3.2.
Let K be a field. Assume G ⊂ K is a finite multiplicative subgroup. Then G is cyclic. The roots of unity in a field clearly form a multiplicative subgroup. From Lemmas 3.1 and 3.2we infer the following corollary.
Corollary 3.3.
In any finitely generated field over Q the roots of unity form a finite cyclic group. and modular-block-rank- In this subsection we introduce a new concept called multiplicative-block-rank-1 , and its relatednotion modular-block-rank-1 . They play an essential role in this paper.First, the definition of rectangularity of a matrix can be easily extended to not necessarilysymmetric or even square matrices. We say a matrix A ∈ C m × n is rectangular if its rows andcolumns can be permuted (separately) so that it becomes a block-diagonal matrix where each blockis a matrix with no zero elements, with possibly one block being an all-0 matrix. We say a matrix A ∈ C m × n is block-rank- A is rectangular and every (nonzero) block of A has rank one. (Thesenotions coincide with the ones given in subsection 2.3 when A is symmetric.) It is easy to see that11or every p ≥ A is rectangular iff A (cid:12) p is rectangular, and if A is block-rank-1, then so is A (cid:12) p .The converse of the latter statement is not true as shown by the example (cid:0) − (cid:1) .It is easy to show that A ∈ C m × n is rectangular iff the column locations of nonzero entries ofevery two rows either coincide or are disjoint. A symmetric statement holds when we exchange rowsand columns. It follows that A is not rectangular iff for some 1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) < n ,the 2 × A i,j ; k,(cid:96) = (cid:18) A i,k A i,(cid:96) A j,k A j,(cid:96) (cid:19) (3.1)contains exactly one zero entry. In this case we say that the tuple ( i, j, k, (cid:96) ) witnesses the non-rectangularity of A . Definition 3.4.
We say A ∈ C m × n is multiplicative-block-rank- (mult-brk- ) if there exists k ≥ such that A (cid:12) k is block-rank- . Clearly, every block-rank-1 matrix is mult-brk-1, and every mult-brk-1 matrix is rectangular.If follows from the definition that if A ∈ C m × n is not mult-brk-1, then for every p ≥ A (cid:12) p is notmult-brk-1. It is the notion of non-mult-brk- Definition 3.5.
We say A ∈ C m × n is modular-block-rank- (mod-brk- ) if the matrix ( | A i,j | ) m,ni,j =1 obtained from A by taking the complex norm entrywise is block-rank- . Clearly, a mult-brk-1 matrix is mod-brk-1; we will often use the contrapositive: every non-mod-brk-1 matrix is non-mult-brk-1. We also note that for a nonnegative real matrix A ∈ R m × n , A isblock-rank-1 iff mult-brk-1 iff A is mod-brk-1.Next, it is easy to see that the following hold:1. A ∈ C m × n is not block-rank-1 iff either A is not rectangular or A is rectangular but for some1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) ≤ n , the 2 × A i,j ; k,(cid:96) in (3.1) has no zero entriesand is nondegenerate. This is equivalent to saying that A ∈ C m × n is not block-rank-1 iff forsome 1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) ≤ n , the 2 × A i,j ; k,(cid:96) has at most one zeroentry and is nondegenerate.2. A ∈ C m × n is not mult-brk-1 iff either A is not rectangular or A is rectangular but for some1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) ≤ n , the 2 × A i,j ; k,(cid:96) in (3.1) has no zero entriesand its p th Hadamard power is nondegenerate for all p ≥
1. This is equivalent to saying that A ∈ C m × n is not mult-brk-1 iff for some 1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) ≤ n , the 2 × A i,j ; k,(cid:96) has at most one zero entry and ( A i,j ; k,(cid:96) ) (cid:12) p is nondegenerate for all p ≥ A ∈ C m × n is not mod-brk-1 iff either A is not rectangular or A is rectangular but for some1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) ≤ n , the 2 × | A | i,j ; k,(cid:96) = (cid:18) | A i,k | | A i,(cid:96) || A j,k | | A j,(cid:96) | (cid:19) has no zero entries and is nondegenerate. This is equivalent to saying that A ∈ C m × n is notmod-brk-1 iff for some 1 ≤ i < j ≤ m and 1 ≤ k < (cid:96) ≤ n , the 2 × | A | i,j ; k,(cid:96) hasat most one zero entry and is nondegenerate.In each case, we say that ( i, j, k, (cid:96) ) witnesses the respective property.The statement regarding non-mult-brk-1 requires a slight justification. Suppose A is non-mult-brk-1 but rectangular. Then for all p ≥ A (cid:12) p is not block-rank-1. Thus there exists ( i, j, k, (cid:96) )12depending on p ) such that A i,j ; k,(cid:96) has no zero entries and ( A i,j ; k,(cid:96) ) (cid:12) p is nondegenerate. If for every( i, j, k, (cid:96) ) for which A i,j ; k,(cid:96) has no zero entries, there exists some p ≥ i, j, k, (cid:96) ))such that ( A i,j ; k,(cid:96) ) (cid:12) p is degenerate, then ( A i,j ; k,(cid:96) ) (cid:12) pq is also degenerate for all q ≥
1. Thus if wetake a common multiplier of these p ’s we reach a contradiction.Any A = ( A i,j ) mi,j =1 ∈ C m × m has finitely many entries, so they are contained in a finitelygenerated field K = Q ( { A i,j } mi,j =1 ) over Q . By Corollary 3.3, the roots of unity in K form a finitecyclic group. Let R be (or any positive multiple of) the order of this finite cyclic group, and let B ∈ K m × m with entries from K . Then we have the following. Lemma 3.6. B is mult-brk- iff B (cid:12) R is block-rank-1.Proof. We prove the forward implication; the converse is trivial. Assume B is mult-brk-1. Then B is rectangular, and hence so is B (cid:12) R . By definition, there exists N ≥ B (cid:12) N is block-rank-1. We show that B (cid:12) R is block-rank-1. It suffices to show that for any i < j and k < (cid:96) ,if B i,j ; k,(cid:96) = (cid:18) B i,k B i,(cid:96) B j,k B j,(cid:96) (cid:19) has no zero entries, then ( B i,j ; k,(cid:96) ) (cid:12) R has rank 1. Since ( B i,j ; k,(cid:96) ) (cid:12) N has rank 1, we have B Ni,k B Nj,(cid:96) = B Ni,(cid:96) B Nj,k . So ( B i,k B j,(cid:96) ) / ( B i,(cid:96) B j,k ) is a root of unity in K ; thus it belongs to a cyclic group of order R (or of order dividing R ). It follows that B Ri,k B Rj,(cid:96) = B Ri,(cid:96) B Rj,k .The following statements can be easily checked.
Property 3.7.
Let A , . . . , A n be complex square matrices (where n ≥ ). Then diag( A , . . . , A n ) is mult-brk- iff each A i is mult-brk- . The same statement holds with mod-brk- . Property 3.8.
Let A , B be complex matrices. Then (cid:0) (cid:1) is mult-brk- iff both A , B are mult-brk- . The same statement holds with mod-brk- . Property 3.9.
Let A , B be complex matrices. Then A ⊗ B is mult-brk- iff either A or B is azero matrix, or both A and B are mult-brk- . The same statement holds with mod-brk- . Lemma 3.10.
Let ( C , D ) be as in Definition 2.2 and Γ be an edge gadget such that M Γ , C , D is notmult-brk- . Then the distinguished vertices u ∗ , v ∗ of Γ are in the same connected component Γ of Γ . Furthermore M Γ , C , D is not mult-brk- . The same holds with not mod-brk- .Proof. If u ∗ , v ∗ are in different connected components of Γ, then rank M Γ , C , D ≤ M Γ , C , D is mult-brk-1 (mod-brk-1), which is a contradiction. For the second part,it suffices to notice that the other connected components of Γ, if there is any, contribute a scalarmultiplier to M Γ , C , D . This scalar multiplier is nonzero because otherwise M Γ , C , D = 0, clearly acontradiction. Remark:
Since
EVAL ( A ) is a special case of EVAL ( C , D ) with every D [ i ] being the identity matrix,Lemma 3.10 applies to EVAL( A ). 13 .3 Purification As described in Introduction (Section 1), an important first step in the proof of the dichotomy in [6]is a process called purification . In this paper we cannot directly substitute A by its purification A because that reduction in [6] does not preserve the complexity in the bounded degree case.However, purification is still important for the proof in this paper. Definition 3.11 (Definition 7.2 from [6]) . Let A = { a , . . . , a n } be a set of n nonzero algebraicnumbers for some n ≥ . We say { g , . . . , g d } for some d ≥ is a generating set of A if1. every g i is a nonzero algebraic number in Q ( A ) ; and2. for every a ∈ A , there exists a unique tuple ( k , . . . , k d ) ∈ Z d such that ag k · · · g k d d is a root of unity. Clearly d = 0 iff the set A consists of roots of unity only. It follows from the definition that g k · · · g k d d of any nonzero ( k , . . . , k d ) ∈ Z d cannot be a root of unity. The following lemma isLemma 7.3 from [6]. Lemma 3.12.
Every set A of nonzero algebraic numbers has a generating set. We apply Lemma 3.12 to A = { A i,j : i, j ∈ [ m ] , A i,j (cid:54) = 0 } , the set of nonzero entries of A ∈ C m × m . The purification matrix A of A is constructed by essentially replacing every g i by the i th smallest prime p i . More precisely, we assume a particular generating set ( g , . . . , g d ) has beenchosen for A . Let p < . . . < p d denote the d smallest primes. For every i, j ∈ [ m ], let A i,j = 0 if A i,j = 0. Suppose A i,j (cid:54) = 0. Let ( k , . . . , k d ) be the unique tuple of integers such that ζ i,j = A i,j g k · · · g k d d is a root of unity. Then we define A i,j = p k · · · p k d d · ζ i,j . By taking the prime factorization of | A i,j | we can recover ( k , . . . , k d ) uniquely, and recover A i,j by A i,j = g k · · · g k d d · A i,j p k · · · p k d d . This matrix A will be called the purification of A obtained by going from ( g , . . . , g d ) to ( p , . . . , p d ).We can also adapt this purification process to be applied to any finite set of algebraic numbers.Clearly, A is connected iff A is connected; A is rectangular iff A is rectangular. Furthermore,we have the following lemma. Lemma 3.13. A is mult-brk- iff A is mult-brk- iff A is mod-brk- .Proof. We may assume A is rectangular for otherwise all sides are false. Suppose A (cid:12) N is block-rank-1 for some N ≥
1. Then for any 2 × (cid:0) a bc d (cid:1) of A without zero entries, we have a N d N = b N c N . We can write it in terms of the generators g , . . . , g d . Replacing a by a (cid:48) ζ where a (cid:48) is a product of integer powers of g , . . . , g d , and similarly for b, c and d , we get ( a (cid:48) N d (cid:48) N ) / ( b (cid:48) N c (cid:48) N ) isa root of unity, and thus so is ( a (cid:48) d (cid:48) ) / ( b (cid:48) c (cid:48) ). By the property of generators, ( a (cid:48) d (cid:48) ) / ( b (cid:48) c (cid:48) ) = 1. Since A is the purification of A obtained by going from ( g , . . . , g d ) to the primes ( p , . . . , p d ), we get A
14s mult-brk-1 and mod-brk-1. For the other directions, it is easy to see that for A , the statementsthat A is mod-brk-1 and mult-brk-1 are equivalent, so we can assume they both hold. Followingthe previous substitution procedure, for any 2 × (cid:0) a bc d (cid:1) of A without zero entries, wehave ( a (cid:48) d (cid:48) ) / ( b (cid:48) c (cid:48) ) = 1, and ( ad ) / ( bc ) is a root of unity of some order. Taking N to be a commonmultiple of these orders, we have A (cid:12) N is block-rank-1.The next lemma shows that, at least for unbounded degree graphs, the purification replacementdoes not affect the complexity. We emphasize that the stated equivalence in the next lemma is not claimed for bounded degree graphs. Lemma 3.14 (Lemma 7.4 from [6]) . Let A ∈ C m × m be a symmetric matrix with algebraic entries.Then EVAL ( A ) ≡ EVAL ( A ) . The following corollary will be used to prove the stronger Theorem 5.1. Note that the stated A ) in in this corollary is for graphs without degree bound. Corollary 3.15.
If a symmetric matrix A ∈ C m × m is not mult-brk- , then EVAL( A ) is By Lemma 3.14, EVAL( A ) ≡ EVAL( A ) (for graphs with unbounded degree). Let N bethe least common multiple of the orders of ζ ij for which A i,j (cid:54) = 0. Since A is not mult-brk-1, A is also not mult-brk-1. Then A (cid:12) N is not mult-brk-1, and since A (cid:12) N in nonnegative, it is notblock-rank-1. By the Bulatov-Grohe dichotomy, Theorem 2.12, EVAL( A (cid:12) N ) is Z A (cid:12) N ( G ) = Z A ( T N ( G )) for any graph G = ( V, E ) and its N -thickening T N ( G ), which provesthat EVAL( A (cid:12) N ) ≤ EVAL( A ). It follows that EVAL( A ) and so EVAL( A ) is We start with an exceedingly simple lemma, which ultimately underlies a lot of our algebraicreasonings in this paper. We will call this lemma and its corollaries the
Vandermonde Argument . Lemma 3.16.
Let n ≥ , and a i , x i ∈ C for ≤ i ≤ n . If n (cid:88) i =1 a i x ji = 0 , for all ≤ j < n, (3.2) then for any function f : C → C , we have (cid:80) ni =1 a i f ( x i ) = 0 . If (3.2) is true for ≤ j ≤ n , thenthe same conclusion holds for any function f satisfying f (0) = 0 .Proof. The statement is vacuously true if n = 0, since an empty sum is 0. Assume n ≥
1. Wepartition [ n ] into a disjoint union (cid:83) p(cid:96) =1 I (cid:96) such that i, i (cid:48) belong to the same I (cid:96) iff x i = x i (cid:48) . Then(3.2) is a Vandermonde system of rank p with a solution ( (cid:80) i ∈ I (cid:96) a i ) (cid:96) ∈ [ p ] . Thus (cid:80) i ∈ I (cid:96) a i = 0 forall 1 ≤ (cid:96) ≤ p . It follows that (cid:80) ni =1 a i f ( x i ) = 0 for any function f : C → C . If (3.2) is true for1 ≤ j ≤ n , then the same proof works except when some x i = 0. In that case, we can separate outthe term (cid:80) i ∈ I (cid:96) a i for the unique I (cid:96) that contains such i , and we get a Vandermonde system ofrank p − (cid:80) i ∈ I (cid:96) a i ) (cid:96) ∈ [ p ] ,(cid:96) (cid:54) = (cid:96) , which must be all zero.The next lemma is a multivariate version of Lemma 3.16. Lemma 3.17.
Let m ≥ , g ( x , . . . , x m ) = (cid:80) ( i ,...,i m ) ∈ I a i ,...,i m (cid:81) mj =1 x i j j ∈ C [ x , . . . , x m ] and λ , . . . , λ m ∈ C . If g ( λ k , . . . , λ km ) = 0 for ≤ k ≤ | I | , then g ( λ , . . . , λ m ) = 0 . roof. If m = 0, then g is a constant polynomial. So if g (cid:54) = 0 then | I | = 1 and the condition at k = 1 is non-vacuous, which leads to g = 0. Let m ≥
1. We have (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m ( m (cid:89) j =1 λ i j j ) k = 0for 1 ≤ k ≤ | I | . Let f : C → C be the conjugation function f ( z ) = z for z ∈ C . Note that f (0) = 0.Then by Lemma 3.16, we have g ( λ , . . . , λ m ) = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m m (cid:89) j =1 ( λ j ) i j = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m m (cid:89) j =1 λ i j j = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m f ( m (cid:89) j =1 λ i j j ) = 0 . Corollary 3.18.
Let m ≥ , g i ( x , . . . , x m ) ∈ C [ x , . . . , x m ] where ≤ i ≤ n , let g ( x , . . . , x m ) = (cid:81) ni =1 g i ( x , . . . , x m ) . Let λ , . . . , λ m ∈ C . Assume g i ( λ , . . . , λ m ) (cid:54) = 0 for all ≤ i ≤ n . Then forsome ≤ k ≤ | I | , here | I | is the number of terms in g , we have g i ( λ k , . . . , λ km ) (cid:54) = 0 for all ≤ i ≤ n .Proof. Suppose otherwise. Then for any 1 ≤ k ≤ | I | , there exists 1 ≤ i ≤ n such that g i ( λ k , . . . , λ km ) =0. Then for any 1 ≤ k ≤ | I | , g ( λ k , . . . , λ km ) = 0. Applying Lemma 3.17, we have g ( λ , . . . , λ m ) = 0contradicting g i ( λ , . . . , λ m ) (cid:54) = 0 for all 1 ≤ i ≤ n . Definition 3.19.
Let m ≥ . We call { b i | i ∈ [ m ] } ⊂ C \ { } multiplicatively independent if (cid:81) mj =1 b i j j = 1 where i j ∈ Z ( j ∈ [ m ] ) implies i j = 0 for all j ∈ [ m ] . Remark:
For m = 0, the empty set { b i | i ∈ [ m ] } is multiplicatively independent, as the statement i j = 0 for all j ∈ [ m ] is vacuously true because [ m ] = ∅ . Also we note that the generating set forany set of nonzero algebraic numbers is multiplicatively independent. Lemma 3.20.
Let m ≥ , let { b i | i ∈ [ m ] } ⊂ C \ { } be multiplicatively independent and let ε N ∈ C be a root of unity of order N where N ≥ . Assume ε i N (cid:81) mj =1 b i j j = ε i (cid:48) N (cid:81) mj =1 b i (cid:48) j j where ≤ i , i (cid:48) < N and i j , i (cid:48) j ∈ Z for ≤ j ≤ m . Then i j = i (cid:48) j for ≤ j ≤ m .Proof. Raising both sides of the given equality to the N th power, we get (cid:81) mj =1 b Ni j j = (cid:81) mj =1 b Ni (cid:48) j j so (cid:81) mj =1 b N ( i j − i (cid:48) j ) j = 1. Since b , . . . , b m are multiplicatively independent, we get N ( i j − i (cid:48) j ) = 0, so i j = i (cid:48) j for 1 ≤ j ≤ m . Then from the original equality we conclude that ε i N = ε i (cid:48) N . But ε N is a rootof unity of order N and 0 ≤ i , i (cid:48) < N so i = i (cid:48) . Lemma 3.21.
Let m ≥ and g ( x , x , . . . , x m ) = (cid:80) ( i ,...,i m ) ∈ I a i ,...,i m (cid:81) mj =0 x i j j ∈ C [ x ± , . . . , x ± m ] .Next, let b , . . . , b m ∈ C \ { } be multiplicatively independent and ε N ∈ C be a root of unity of order N where N ≥ . If g ( ε kN , b k , . . . , b km ) = 0 for ≤ k ≤ | I | , then for any c , . . . , c m ∈ C and t ∈ Z , g ( ε tN , c , . . . , c m ) = 0 . roof. We have (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m ε i N m (cid:89) j =1 b i j j k = 0for 1 ≤ k ≤ | I | . Let f : C → C be defined as f ( ε i N (cid:81) mj =1 b i j j ) = ε ti N (cid:81) mj =1 c i j j , where 0 ≤ i < N and i j ∈ Z for 1 ≤ j ≤ m , and f ( x ) = 0 if x is not of this form. Since b , . . . , b m are multiplicativelyindependent, Lemma 3.20 implies that f is well-defined. Note that f (0) = 0. Then by Lemma 3.16we have g ( ε tN , c , . . . , c m ) = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m ε ti N m (cid:89) j =1 c i j j = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m f ε i N m (cid:89) j =1 b i j j = 0 . Corollary 3.22.
Let m ≥ , b , . . . , b m ∈ C , let { g , . . . , g d } , where d ≥ , be a generating setfor the set of nonzero entries of ( b , . . . , b m ) , and let ( c , . . . , c m ) be the purification of ( b , . . . , b m ) obtained by going from ( g , . . . , g d ) to the d smallest primes ( p , . . . , p d ) . Let f ( x , . . . , x m ) = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m m (cid:89) j =1 x i j j ∈ C [ x , . . . , x m ] . If f ( c , . . . , c m ) (cid:54) = 0 , then f ( b (cid:96) , . . . , b (cid:96)m ) (cid:54) = 0 for some ≤ (cid:96) ≤ | I | .Proof. Clearly, b i = 0 iff c i = 0 for i ∈ [ m ]. Let J = { i ∈ [ m ] | b i = c i = 0 } . If J = [ m ] then thecorollary is obviously true. We may assume [ m ] \ J (cid:54) = ∅ . For each i ∈ [ m ], we have the following:if i ∈ J , then b i = c i = 0, and if i / ∈ J , then b i = ζ i g k i, · · · g k i,d d , c i = ζ i p k i, · · · p k i,d d , where ( k i, , . . . , k i,d ) ∈ Z d and ζ i is a root of unity, both of which must be then uniquely determined.Let N be the least common multiple of the orders of all ζ i where i ∈ [ m ] \ J , and let ε N ∈ C be aroot of unity of order N . Then for each i ∈ [ m ] \ J , we have some 0 ≤ k i, < N such that b i = ε k i, N g k i, · · · g k i,d d , c i = ε k i, N p k i, · · · p k i,d d . Now for each i ∈ [ m ], we define h i ( y , y , . . . , y d ) ∈ C [ y , y ± , . . . , y ± d ] as follows: if i ∈ J , we let h i ( y , y , . . . , y d ) = 0, and if i / ∈ J , we let h i ( y , y , . . . , y d ) = y k i, y k i, . . . y k i,d d . Next, let g ( y , y , . . . , y d ) = f ( h ( y , y , . . . , y d ) , . . . , h m ( y , y , . . . , y d )) . Expanding the above expression, combining terms with equal exponents and removing all zeroterms, we get g ( y , y , . . . , y d ) = (cid:88) ( i ,...,i m ) ∈ I a i ,...,i m m (cid:89) j =1 ( h j ( y , y , . . . , y d )) i j = (cid:88) ( j ,j ,...,j d ) ∈ I (cid:48) a (cid:48) j ,j ,...,j d y j y j · · · y j d d (3.3)17or some I (cid:48) . Notice that each h i is either 0 or a ratio of two monomials, so we have | I (cid:48) | ≤ | I | .Now we observe that g ( ε (cid:96)N , g (cid:96) , . . . , g (cid:96)d ) = f ( b (cid:96) , . . . , b (cid:96)m ) for all (cid:96) ≥
1, and g ( ε N , p , . . . , p d ) = f ( c , . . . , c m ) (cid:54) = 0. Since { g , . . . , g d } is a generating set for the set of nonzero entries of ( b , . . . , b m ), g , . . . , g d are multiplicatively independent. Then by Lemma 3.21, g ( ε (cid:96)N , g (cid:96) , . . . , g (cid:96)d ) (cid:54) = 0 for some1 ≤ (cid:96) ≤ | I (cid:48) | ≤ | I | , which completes the proof. We call a symbolic expression P ( x ) = (cid:80) ki =1 λ xi p i ( x ) an exponential polynomial (over C ), where k ≥ λ i ∈ C and p i ( x ) = (cid:80) ≤ j
1, for 1 ≤ i ≤ k . Here deg p i ( x ) < s i andwe assume the 0 polynomial has degree −∞ . Note that we can define P ( n ) = (cid:80) ki =1 λ ni p i ( n ) forintegers n ≥
0, and if all λ i (cid:54) = 0 this definition extends to Z . Clearly, all exponential polynomialsover C form a vector space over C . Lemma 3.23.
Let t ∈ Z . For any exponential polynomial P ( x ) with all λ i ∈ C \ { } and pairwisedistinct, if P ( n ) = 0 for t < n ≤ t + (cid:80) ki =1 s i , then for all ≤ i ≤ k , p i ( x ) = 0 is the zero polynomial,i.e., for all ≤ i ≤ k and ≤ j < s i we have a ij = 0 .Proof. We induct on S = (cid:80) ki =1 s i . If S = 0, as all s i ≥
1, this is only possible when k = 0. So P ( x ) = 0 and the statement is trivial. Let S ≥
1, so in particular k ≥
1. Without loss of generality,we may assume that s i ≥
1, and deg p i = s i − ≥ ≤ i ≤ k , as we can discard zero termsin p i ( x ), or zero polynomials p i ; this decreases S = (cid:80) ki =1 s i and we are done by induction.Let Q ( x ) = P ( x + 1) − λ P ( x ) = (cid:80) ki =1 λ xi q i ( x ) where q i ( x ) = λ i p i ( x + 1) − λ p i ( x ) for 1 ≤ i ≤ k .Note that either deg q = deg p − q = 0. Also deg q i = deg p i for 2 ≤ i ≤ k .By the given condition, we have Q ( n ) = P ( n + 1) − λ P ( n ) = 0 for t < n ≤ ( t + (cid:80) ki =1 s i ) −
1. Bythe induction hypothesis, q i ( x ) = 0 for 1 ≤ i ≤ k . However if k > q = deg p = s − ≥ > −∞ (as the leading coefficient of q is ( λ − λ ) a ,s − (cid:54) = 0), so q ( x ) (cid:54) = 0, a contradiction.Therefore k = 1. And q = 0 and λ (cid:54) = 0 imply that s = 1, and p ( x ) is a constant. Butfrom P ( t + 1) = 0 we get p ( t + 1) = 0. This shows that it is the zero constant, contradictingdeg p = s − > −∞ . Corollary 3.24.
Let s i ≥ , λ i ∈ C \ { } be pairwise distinct, where ≤ i ≤ k . Let t ∈ Z , and S = (cid:80) ki =1 s i . Define M = ( M n, ( i,j ) ) to be an S × S matrix as follows: the rows are indexed by n with t < n ≤ t + S , the columns are indexed by the pairs ( i, j ) where ≤ i ≤ k and ≤ j < s i andthe ( n, ( i, j )) entry of M is M n, ( i,j ) = λ ni n j . Then det M (cid:54) = 0 .Proof. Assume (cid:80) ≤ i ≤ k (cid:80) ≤ j
Let A and D be m × m matrices, where A is complex symmetric with all columnsnonzero and pairwise linearly independent, and D is positive diagonal. Then all columns of ADA are nonzero and pairwise linearly independent.Proof.
The case m = 1 is trivial. Assume m ≥
2. Let D = diag( α i ) mi =1 , and Π = diag( √ α i ) mi =1 .Then Π = D . We have ADA = Q T Q , where Q = ΠA . Then Q has pairwise linearly independentcolumns. Let q i denote the i th column of Q . By the Cauchy-Schwartz inequality, |(cid:104) q i , q j (cid:105)| < (cid:107) q i (cid:107) · (cid:107) q j (cid:107) , whenever i (cid:54) = j , since q i and q j are linearly independent, where the 2-norm (cid:107) q (cid:107) = (cid:112) (cid:104) q , q (cid:105) . Thenfor any 1 ≤ i < j ≤ m , the i th and j th columns of ADA contain a submatrix (cid:18) (cid:104) q i , q i (cid:105) (cid:104) q i , q j (cid:105)(cid:104) q j , q i (cid:105) (cid:104) q j , q j (cid:105) (cid:19) , so they are linearly independent. Lemma 3.26.
Let A and D be m × m matrices, where A is complex symmetric with all columnsnonzero and pairwise linearly independent, and D is positive diagonal. Then for all sufficientlylarge positive integers p , the matrix B = ( ADA ) (cid:12) p is nondegenerate.Proof. If m = 1, then any p ≥ m ≥
2. Following the proof of Lemma 3.25, we have |(cid:104) q i , q j (cid:105)| < (cid:107) q i (cid:107) · (cid:107) q j (cid:107) , for all 1 ≤ i < j ≤ m . Let γ = max ≤ i 1, and (cid:12)(cid:12) det (cid:0) ( A (cid:48) ) (cid:12) p (cid:1)(cid:12)(cid:12) ≥ (cid:32) m (cid:89) i =1 A (cid:48) ii (cid:33) p − (cid:32) m (cid:89) i =1 A (cid:48) ii (cid:33) p m (cid:88) j =1 m j γ pj ≥ (cid:32) m (cid:89) i =1 A (cid:48) ii (cid:33) p (cid:18) − mγ p − mγ p (cid:19) = (cid:32) m (cid:89) i =1 A (cid:48) ii (cid:33) p (cid:18) − mγ p − mγ p (cid:19) > . A high-level description of the proof of Theorem 1.1 In the proof of the dichotomy theorem in [6] a first preliminary step is to reduce the problemto connected graphs and matrices. This is stated as Lemma 4.6 (p. 940) in [6] and its proof isaccomplished by applying the so-called first pinning lemma (Lemma 4.1 (p. 937)). The proof ofthis first pinning lemma uses interpolation. Although the proof of this lemma in [6] can be donefor bounded degree graphs, it involves a noncontructive step that we want to avoid in this paper.Therefore we will make the transition to connected graphs by another technique that is based ontransforming gadgets.An important theorem in this paper is Theorem 5.1 which shows that if a complex symmetricmatrix A is not mult-brk-1, then EVAL( A ) remains M Γ , A that is not mult-brk-1, then for some ∆ > 0, the problem EVAL (∆) ( A ) is A has connected components { A i } i ∈ [ s ] , then1. Either EVAL ( A i ) is polynomial-time computable for every i , and this implies that EVAL ( A )is also polynomial-time computable;2. Or for some i ∈ [ s ], we have an edge gadget Γ such that M Γ , A i is not mult-brk-1, fromwhich we can get an edge gadget Γ (cid:48) such that M Γ (cid:48) , A is not mult-brk-1, and therefore byCorollary 5.3, we get (∆) ( A ), for some ∆ > connected and symmetric A . Our tractable casesare the same as in [6] and so our description will focus on how to prove G and produce a modified graph G ∗ by replacing each edge of G with the gadget. Moreover, one can define a suitable modified matrix A ∗ from the given matrix A and the gadget such that Z A ∗ ( G ) = Z A ( G ∗ ), for all undirected graphs G . This gives a reductionfrom EVAL ( A ∗ ) to EVAL ( A ). If the gadget has bounded degree k , it also gives a reduction from EVAL (∆) ( A ∗ ) to EVAL ( k ∆) ( A ) for any ∆ ≥ 0. If the gadget were to produce nonnegative symmetricmatrices A ∗ , then one could apply Theorem 2.12 and its extension to bounded degree graphs [20]to A ∗ .However, for complex matrices A , any graph gadget will only produce a matrix A ∗ whoseentries are polynomials of the entries of A , as they are obtained by arithmetic operations + and × .There are no nonconstant polynomials on C that always produce nonnegative output. Pointedly, conjugation is not an arithmetic operation. However, it is clear that for roots of unity, one can produce conjugation by multiplication.Thus, as in [6] we wish to replace our matrix A by its purification matrix. It is here the proofin [6] fundamentally does not go through for bounded degree graphs. An essential observation ofthis paper is that, in each of the steps in the proof of [6] we in fact can prove the following: Eitherthe matrix A satisfies some additional conditions, or we can produce an edge gadget Γ such that M Γ , A is not mult-brk-1. We state three meta-arguments, Arguments 11.7, 11.10, and 12.1, i.e.,( Meta ), ( Meta ) and ( Meta ), to formalize this ability to transfer such gadgets from one step ofthe proof to a previous step. Thus in the last step (when A does not satisfy all the tractabilityconditions) we have such a gadget whose signature matrix is not mult-brk-1, then in a finite numberof steps we can get such a gadget in the initial setting, and then invoke Corollary 5.3.To carry out this plan, we must separate out the cases where A is bipartite or nonbipartite.20or a (nonzero) symmetric, connected and nonbipartite A , it is mult-brk-1 iff it has the form A = ( A (cid:48) i,j ζ i,j ) where A (cid:48) = ( A (cid:48) i,j ) is symmetric, has no zero entries and has rank 1, and ζ i,j areroots of unity. For a (nonzero) symmetric, connected and bipartite A , it is mult-brk-1 iff it is thebipartization of a rectangular matrix B of the form ( B (cid:48) i,j ζ i,j ), where B (cid:48) = ( B (cid:48) i,j ) has no zero entriesand has rank 1, and ζ i,j are roots of unity. For convenience, in this section we will only describethe bipartite case in the discussion below; with some minor changes, similar statements hold fornonbipartite matrices A .In the bipartite case, if A is mult-brk-1, we have the rank one matrix ( B (cid:48) i,j ) which has the form( µ i ν j ) for some nonzero µ i , ν j . Thus B has the form B = µ µ . . . µ k ζ , ζ , . . . ζ ,m − k ζ , ζ , . . . ζ ,m − k ... ... . . . ... ζ k, ζ k, . . . ζ k,m − k ν ν . . . ν m − k , for some 1 ≤ k < m , in which µ i , ν j are nonzero, and every ζ i,j is a root of unity. The claim is that,for every (nonzero) symmetric, connected, and bipartite matrix A ∈ C m × m , either we can alreadyprove the EVAL (∆) ( A ) for some ∆ > 0, or we may assume A is the bipartizationof B of the above form. In the latter case we pass both A and its purification A to the next step.Continuing now with A and A , the next step is to further regularize its entries. In particularwe need to combine those rows and columns of the matrix where they are essentially the same,apart from a multiple of a root of unity. This process is called cyclotomic reduction . To carryout this process, we need to use the more general form EVAL ( C , D ) defined earlier in Section 2.2.Introduced in [6], the following type of matrices are called discrete unitary matrices. Definition 4.1 (discrete unitary matrix, Definition 3.1 from [6]) . Let F ∈ C m × m be a ( not nec-essarily symmetric ) matrix with entries ( F i,j ) . We call F an M -discrete unitary matrix , for somepositive integer M , if it satisfies the following conditions:1. Every entry F i,j of F is a root of unity, and F ,i = F i, = 1 for all i ∈ [ m ] .2. M is the least common multiple ( lcm ) of orders of all the entries F i,j of F .3. For all i (cid:54) = j ∈ [ m ] , we have (cid:104) F i, ∗ , F j, ∗ (cid:105) = 0 and (cid:104) F ∗ ,i , F ∗ ,j (cid:105) = 0 . Some of the simplest examples of discrete unitary matrices are as follows: (cid:18) − (cid:19) , − − − − − − , ω ω ω ω , ζ ζ − ζ ζ − ζ ζ − ζ − ζ ζ − ζ ζ − ζ ζ − ζ ζ ζ − , where ω = e πi/ and ζ = e πi/ . Tensor products of discrete unitary matrices are also discreteunitary matrices.Coming back to the proof outline, we show that either there exists an edge gadget Γ such that M Γ , A is not mult-brk-1 (which implies that EVAL (∆) ( A ) is > 0) or EVAL (∆) ( A )is equivalent to some EVAL (∆) ( C , D ), and the pair ( C , D ) satisfies some stringent conditions. Infact one can show that either EVAL (∆) ( A ) is > 0, or the pair ( C , D ) has atensor product form, and the problem EVAL ( C , D ) (and also for bounded degree graphs) can be21xpressed as a product of an outer problem EVAL ( C (cid:48) , K ) and an inner problem EVAL ( C (cid:48)(cid:48) , L ), where EVAL ( C (cid:48) , K ) is tractable, and thus we will focus on the inner problem EVAL ( C (cid:48)(cid:48) , L ). We rename( C , D ) as the pair ( C (cid:48)(cid:48) , L ). We show that C is the bipartization of a discrete unitary matrix F .In addition, there are further stringent requirements for D . Roughly speaking, the first matrix D [0] in D must be the identity matrix; and for any matrix D [ r ] in D , each entry of D [ r ] is eitherzero or a root of unity. We call these conditions, with some abuse of terminology, the discreteunitary requirements . The proof for these requirements in [6] is demanding and among the mostdifficult in that paper; but here we will use the meta-arguments, Arguments 11.10 and 12.1, i.e.,( Meta ) and ( Meta ), to observe that essentially the same proof can be cast in terms of transformingnon-mult-brk-1 gadgets from one setting to another.Next, assume that we have a problem EVAL ( C , D ) satisfying the discrete unitary requirementswith C being the bipartization of F . Recall that ω q = e πi/q . Definition 4.2 (Definition 3.2 from [6]) . Let q > be a prime power. The following q × q matrix F q is called the q -Fourier matrix : The ( x, y ) th entry of F q is ω xyq , x, y ∈ [0 : q − . We show that, either there exists an edge gadget Γ such that M Γ , C , D is not mod-brk-1 (whichimplies that it is not mult-brk-1 either), or after a permutation of rows and columns, F becomesthe tensor product of a collection of suitable Fourier matrices: F q ⊗ F q ⊗ · · · ⊗ F q d , where d ≥ q i is a prime power.Basically, we show that even with the stringent conditions imposed on the pair ( C , D ) by thediscrete unitary requirements, we still get EVAL (∆) ( C , D ), for some ∆ > 0, unless F is the tensor product of Fourier matrices. On the other hand, the tensor product decompositioninto Fourier matrices finally gives us a canonical way of writing the entries of F in a closed form.More exactly, we index the rows and columns of F using x = ( x , . . . , x d ) ∈ Z q × · · · × Z q d so that F x , y = (cid:89) i ∈ [ d ] ω x i y i q i , for any x , y ∈ Z q × · · · × Z q d .Assume q , . . . , q d are powers of s ≤ d distinct primes p , . . . , p s . We can also lump together allprime powers of the same prime p i , and view the set of indices as Z q × · · · × Z q d = G × · · · × G s , where G i is the finite Abelian group which is the direct product of all groups Z q j in the list with q j being a power of p i .This canonical tensor product decomposition of F gives a natural way to index the rows andcolumns of C and the diagonal matrices in D . More exactly, for x ∈ Z q × · · · × Z q d , we index thefirst half of the rows and columns of C and every D [ r ] in D using (0 , x ), and index the second halfof the rows and columns using (1 , x ).With this canonical expression of F and C , we further inquire into the structure of D . Thereare two more properties that we must demand of those diagonal matrices in D . If D does notsatisfy these additional properties, then EVAL (∆) ( C , D ) is > r , we define Λ r and ∆ r to be the support of D [ r ] , where Λ r refers to the first halfof the entries and ∆ r refers to the second half of the entries (here we use D i to denote the ( i, i )thentry of a diagonal matrix D ):Λ r = (cid:8) x : D [ r ](0 , x ) (cid:54) = 0 (cid:9) and ∆ r = (cid:8) x : D [ r ](1 , x ) (cid:54) = 0 (cid:9) . 22e let S denote the set of subscripts r such that Λ r (cid:54) = ∅ and T denote the set of r such that∆ r (cid:54) = ∅ . We can prove that for each r ∈ S , the support set Λ r must be a direct product of cosets,Λ r = (cid:81) si =1 Λ r,i , where Λ r,i are cosets in the Abelian groups G i , i = 1 , . . . , s , corresponding to theconstituent prime powers of the group; and for each r ∈ T , ∆ r = (cid:81) si =1 ∆ r,i is a direct product ofcosets in the same Abelian groups. Otherwise, EVAL (∆) ( C , D ) is > 0; moreprecisely, there is an edge gadget Γ such that M Γ , C , D is not mod-brk-1.Second, we show that for each r ∈ S and r ∈ T , respectively, D [ r ] on its support Λ r forthe first half of its entries and on ∆ r for the second half of its entries, respectively, possesses a quadratic structure; otherwise EVAL (∆) ( C , D ) is > 0. The quadratic structureis expressed as a set of exponential difference equations over bases which are appropriate roots ofunity of orders equal to various prime powers. These proof steps in [6] are the most demanding inthat paper; however here we apply the meta-arguments to the same proof and observe that theylet us transform non-mult-brk-1 gadgets from one setting to another.After all these necessary conditions, we finally show that, if C and D satisfy all these require-ments, there is a polynomial-time algorithm for EVAL ( C , D ) (to be precise, for EVAL ↔ ( C , D )) andthus, EVAL ( A ) is also in polynomial time. The tractability part of the proof is almost identical tothat of [6]. implies bounded degree hardness This section is dedicated to the proof of Theorem 5.1. Theorem 5.1. Let A ∈ C m × m be a symmetric matrix. If A is not mult-brk- , then for some ∆ > , the problem EVAL (∆) ( A ) is It will be convenient to state Theorem 5.1 for directed graphs as well. For a directed graph G = ( V, E ) we let deg( u ) denote the sum of its in-degree and out-degree for u ∈ V , and ∆( G ) =max u ∈ V deg( u ). Corollary 5.2. Let A ∈ C m × m (not necessary symmetric). If A is not mult-brk- , then for some ∆ > , the problem EVAL (∆) ( A ) is Recall that for not necessarily symmetric A , EVAL( A ) is defined for directed graphs G .Let A (cid:48) = (cid:18) AA T (cid:19) be the bipartization of the matrix A . Now let G be an undirected connectedgraph. If G is not bipartite, then Z A (cid:48) ( G ) = 0. Assume G = ( U ∪ V, E ) is bipartite with U ∪ V beinga bipartization of (the vertices of) G . Let −→ G and ←− G be the directed graphs obtained by orientingall edges of G from U to V , and from V to U , respectively. Then Z A (cid:48) ( G ) = Z A ( −→ G ) + Z A ( ←− G ).Note that ∆( −→ G ) = ∆( ←− G ) = ∆( G ). Therefore EVAL (∆) ( A (cid:48) ) ≤ EVAL (∆) ( A ) for any ∆ ≥ 0. ByProperty 3.8, A (cid:48) is not mult-brk-1. Then by Theorem 5.1, for some ∆ > 0, EVAL (∆) ( A (cid:48) ) is (∆) ( A ). Corollary 5.3. Let A ∈ C m × m be a symmetric matrix and let Γ be an edge gadget. If M Γ , A is notmult-brk- (which is true if M Γ , A is not mod-brk- ), then for some ∆ > , the problem EVAL (∆) ( A ) is roof. By Corollary 5.2, even if M Γ , A is not symmetric, the problem EVAL (∆) ( M Γ , A ) is > 0. Here the inputs to EVAL (∆) ( M Γ , A ) are directed graphs. Let u ∗ , v ∗ be the firstand second distinguished vertices of Γ, respectively. Given a directed graph G of ∆( G ) ≤ ∆, weconstruct an undirected graph G (cid:48) by replacing every directed edge e = ( u, v ) ∈ E ( G ) by a gadgetΓ, attaching u ∗ , v ∗ to u, v , respectively. Clearly, G (cid:48) can be constructed in polynomial time from G and Z A ( G (cid:48) ) = Z M Γ , A ( G ). Also note that ∆( G (cid:48) ) ≤ ∆(Γ)∆( G ) ≤ ∆(Γ)∆. Let ∆ (cid:48) = ∆(Γ)∆. Itfollows that EVAL (∆) ( M Γ , A ) ≤ EVAL (∆ (cid:48) ) ( A ) and therefore EVAL (∆ (cid:48) ) ( A ) is We now turn to the proof of Theorem 5.1. This proof adapts a gadget design from [20] whichextends the Bulatov-Grohe dichotomy, Theorem 2.12, to bounded degree and simple graphs.Let A ∈ C m × m be a symmetric matrix but not mult-brk-1. The first step is to eliminate pairwiselinearly dependent rows and columns of A . This step will naturally create nontrivial vertex weightseven though we initially start with the vertex unweighted case D = I m (see Definition 2.1).If A has a zero row or column i , then for any connected input graph G other than a singleisolated vertex, no map ξ : V ( G ) → [ m ] having a nonzero contribution to Z A ( G ) can map anyvertex of G to i . So, by crossing out all zero rows and columns (they have the same index setsince A is symmetric) we can express the problem EVAL (∆) ( A ) for ∆ ≥ A has no zero rows or columns. Also permuting the rows and columns of A simultaneously by the same permutation does not change the value of Z A ( · ), and so it does notchange the complexity of EVAL (∆) ( A ) for ∆ ≥ A are contiguously arranged. Then, after renaming theindices, the entries of A are of the following form: A ( i,j ) , ( i (cid:48) ,j (cid:48) ) = µ ij µ i (cid:48) j (cid:48) A (cid:48) i,i (cid:48) , where A (cid:48) is a complexsymmetric s × s matrix with all columns nonzero and pairwise linearly independent, 1 ≤ i, i (cid:48) ≤ s ,1 ≤ j ≤ m i , 1 ≤ j (cid:48) ≤ m i (cid:48) , (cid:80) si =1 m i = m , and all µ ij (cid:54) = 0. As m ≥ s ≥ Z A ( · ) can be written in a compressed form Z A ( G ) = (cid:88) ζ : V ( G ) → [ s ] (cid:89) w ∈ V ( G ) m ζ ( w ) (cid:88) j =1 µ deg( w ) ζ ( w ) j (cid:89) ( u,v ) ∈ E ( G ) A (cid:48) ζ ( u ) ,ζ ( v ) = Z A (cid:48) , D ( G ) , where D = { D [[ k ]] } ∞ k =0 consists of diagonal matrices, and D [[ k ]] i = (cid:80) m i j =1 µ kij for k ≥ ≤ i ≤ s .Note the dependence on the vertex degree deg( w ) for w ∈ V ( G ). Since the underlying graph G remains unchanged, this way we obtain the equivalence EVAL (∆) ( A ) ≡ EVAL (∆) ( A (cid:48) , D ) for any∆ ≥ 0. Here the superscript (∆) can be included or excluded, the statement remains true in bothcases. We also point out that the entries of the matrices D [[ k ]] ∈ D are computable in polynomialtime in the input size of A as well as in k . W (cid:96) For each (cid:96) ≥ 1, we define an operation W (cid:96) on directed edges. Let e = ( u, v ) be a directed edge(from u to v ) as follows. First, we apply a 2-stretching S on e = ( u, v ) viewed as an undirectededge. We get a path ( u, w, v ) of length 2, after this operation. We then (cid:96) -thicken the edge ( w, v )in ( u, w, v ). This is our W (cid:96) operation on e . This operation produces the graph W (cid:96) ( e ) in Figure 4.24 vu ‘ − ‘ Figure 4: The operation (edge gadget) W (cid:96) ( e ) where e = ( u, v ) is a directed edge from u to v u v Figure 5: An edge gadget W T ( e ). The gadget P n,p,(cid:96) is an n -chain of the edge gadget W (cid:96) T p ( e ). P n,p,(cid:96) and R d,n,p,(cid:96) We first introduce the edge gadget P n,p,(cid:96) , for all n, p, (cid:96) ≥ 1. It is obtained as follows. Given adirected edge e = ( u, v ), let S n e = ( u = u, u , . . . , u n = v ) be a path of length n from u to v .In S n e we orient every edge ( u i , u i +1 ) from u i to u i +1 (for 0 ≤ i ≤ n − T p S n e , which is obtained by applying T p on our S n e , while preserving the orientation of each edge.After that, on every directed edge of T p S n e we apply W (cid:96) which results in an undirected graphcontaining the original vertices u and v . We make u and v the first and second distingushedvertices, respectively, and we denote the resulting edge gadget by P n,p,(cid:96) . Succinctly, we can write P n,p,(cid:96) = W (cid:96) T p S n e , where e = ( u, v ) is a directed edge, T p and S n respect edge directions, and P n,p,(cid:96) has u, v as its first and second distinguished vertices, respectively. Note that P n,p,(cid:96) contains onlyundirected edges, while the roles of u and v are not symmetric; the specification of the direction ofedges is only for the purpose of describing the construction. (As an example, P n, , is an n -chainof the edge gadget W T ( e ) depicted in Figure 5.)To define the gadget R d,n,p,(cid:96) , for all d, n, p, (cid:96) ≥ 1, we start with a (directed) cycle on d vertices F , . . . , F d (call it a d -cycle), in which we orient F i to F i +1 for each i ∈ [ d ] (here F d +1 = F ). Thenreplace every edge ( F i , F i +1 ) of the d -cycle by a copy of P n,p,(cid:96) , whereby we identify the first andsecond distinguished vertices of P n,p,(cid:96) with F i and F i +1 , respectively. Finally we append a danglingedge at each vertex F i of the d -cycle. For the specific cases of d = 1 and d = 2, a 2-cycle hastwo vertices with 2 parallel directed edges of opposite orientations between them, and a 1-cycle isa directed loop on one vertex. The gadget R d,n,p,(cid:96) has d dangling edges in total. Note that all R d,n,p,(cid:96) are undirected loopless graphs, for d, n, p, (cid:96) ≥ 1. An example of a gadget R d,n,p,(cid:96) is shownin Figure 6. For the special cases d = 1 and d = 2, examples of gadgets R d,n,p,(cid:96) can be seen inFigure 7.We note that vertices in P n,p,(cid:96) have degrees at most p(cid:96) + p , and vertices in R d,n,p,(cid:96) have degreesat most p(cid:96) + p + 1, taking into account the dangling edges. These are independent of d and n .Clearly | V ( R d,n,p,(cid:96) ) | = dn ( p + 1) and | E ( R d,n,p,(cid:96) ) | = d (( (cid:96) + 1) np + 1), including the d dangling25 F F F F Figure 6: The gadget R , , , .edges.If we attach (cid:96) + 1 dangling edges at each F i , as we eventually will do, then the degree boundfor R d,n,p,(cid:96) is ( p + 1)( (cid:96) + 1), which is still independent of d and n . G n,p,(cid:96) using R d,n,p,(cid:96) Assume for now that G does not contain isolated vertices. We will replace every vertex u ∈ V ( G ) ofdegree d = d u = deg( u ) ≥ R d,n,p,(cid:96) and then ( (cid:96) + 1) -thicken the edges correspondingto E ( G ), for all n, p, (cid:96) ≥ 1. This defines the (undirected) graph G n,p,(cid:96) . The replacement operationcan be described in three steps: In step one, each u ∈ V ( G ) is replaced by a (directed) d -cycleon vertices F u , . . . , F ud , each having a dangling edge attached. Here we orient F ui to F ui +1 for each i ∈ [ d ] (and we set F ud +1 = F u ). The d dangling edges will be identified one-to-one with the d incident edges at u in G . If u and v are adjacent vertices in G , then the edge ( u, v ) in G will bereplaced by merging a pair of dangling edges, one from the d u -cycle at u and one from the d v -cycle at v . This edge remains undirected. Thus in step one we obtain a graph (cid:98) G , which basicallyreplaces every vertex u ∈ V ( G ) by a (directed) cycle of deg( u ) vertices. Then in step two, for every(directed) cycle in (cid:98) G that corresponds to some u ∈ V ( G ) we replace each (directed) edge on thecycle by a copy of the edge gadget P n,p,(cid:96) , whereby we respectively identify the first and seconddistinguished vertices of P n,p,(cid:96) with the tail and head of this (directed) edge. Finally, in step three,we ( (cid:96) + 1)-thicken all the edges obtained by merging pairs of dangling edges (these edges of (cid:98) G canbe identified with edges from E ( G )). 26 (a) R , , , F F (b) R , , , Figure 7: Examples of gadgets R d,n,p,(cid:96) for d = 1 , G n,p,(cid:96) ; later we will also refer to (cid:98) G . Sinceall gadgets R d,n,p,(cid:96) are loopless graphs, so are G n,p,(cid:96) for all n, p, (cid:96) ≥ 1. As a technical remark, if G contains vertices of degree 1, then the intermediate graph (cid:98) G has (directed) loops but all graphs G n,p,(cid:96) ( n, p, (cid:96) ≥ 1) do not. Also note that all vertices in G n,p,(cid:96) have degree at most ( p + 1)( (cid:96) + 1),which is independent of n and G .Next, it is not hard to see that | V ( G n,p,(cid:96) ) | = (cid:88) u ∈ V ( G ) d u n ( p + 1) = 2 n ( p + 1) | E ( G ) | , | E ( G n,p,(cid:96) ) | = ( (cid:96) + 1) | E ( G ) | + (cid:88) u ∈ V ( G ) d u ( (cid:96) + 1) np = ( (cid:96) + 1)(2 np + 1) | E ( G ) | . Hence the size of the graphs G n,p,(cid:96) is polynomially bounded in the size of G , n , p and (cid:96) .Soon we will choose a fixed p , and then a fixed (cid:96) , all depending only on A . Then we willchoose n to be bounded by a polynomial in the size of G ; whenever something is computable inpolynomial time in n , it is also computable in polynomial time in the size of G (we will simply sayin polynomial time). p and then picking (cid:96) Consider Z A (cid:48) , D ( G n,p,(cid:96) ). We first find suitable p ≥ 1, and then (cid:96) ≥ 1, so that our constructionallows us to compute a value of interest by interpolation. More precisely, we show that we can find p, (cid:96) ≥ B = ( A (cid:48) D [[ (cid:96) +1]] ( A (cid:48) ) (cid:12) (cid:96) ) (cid:12) p is nondegenerate, and all diagonal entriesin D [[ p ( (cid:96) +1)]] and D [[( p +1)( (cid:96) +1)]] are nonzero. We note that B is the signature matrix of the edgegadget W (cid:96) T p ( e ) (which, by definition, excludes the vertex weights of the two distinguished verticesof W (cid:96) T p ( e ) ), and P n,p,(cid:96) is just a chain of n copies of this edge gadget. In B = ( A (cid:48) D [[ (cid:96) +1]] ( A (cid:48) ) (cid:12) (cid:96) ) (cid:12) p ,the superscript [[ (cid:96) + 1]] is from the operator W (cid:96) which creates those degree (cid:96) + 1 vertices, thesuperscript (cid:12) (cid:96) is also from W (cid:96) , and the superscript (cid:12) p is from the thickening operator T p . An27xample of W (cid:96) T p ( e ) is shown, with (cid:96) = 3 and p = 5, in Figure 5, with the edge weight matrix( A (cid:48) D [[4]] ( A (cid:48) ) (cid:12) ) (cid:12) in the framework EVAL( A (cid:48) , D ). p Let H ∈ C s × s be a diagonal matrix with the i th diagonal entry H i = (cid:80) m i j =1 µ ij µ ij > ≤ i ≤ s .So H is positive diagonal. By Lemma 3.26, we can fix some p ≥ A (cid:48) HA (cid:48) ) (cid:12) p isnondegenerate. Also, clearly we have (cid:80) m i j =1 µ pij ( µ ij ) p > (cid:80) m i j =1 µ p +1 ij ( µ ij ) p +1 > ≤ i ≤ s .Thus, we have det (cid:16)(cid:0) A (cid:48) HA (cid:48) (cid:1) (cid:12) p (cid:17) (cid:54) = 0 , m i (cid:88) j =1 µ pij ( µ ij ) p (cid:54) = 0 , ≤ i ≤ s, m i (cid:88) j =1 µ p +1 ij ( µ ij ) p +1 (cid:54) = 0 , ≤ i ≤ s. (5.1)Now consider the following infinite sequence of systems of conditions indexed by (cid:96) ≥ det (cid:16) ( A (cid:48) D [[ (cid:96) +1]] ( A (cid:48) ) (cid:12) (cid:96) ) (cid:12) p (cid:17) (cid:54) = 0 , m i (cid:88) j =1 µ p + p(cid:96)ij (cid:54) = 0 , ≤ i ≤ s, m i (cid:88) j =1 µ ( p +1)+( p +1) (cid:96)ij (cid:54) = 0 , ≤ i ≤ s. (5.2) (cid:96) Our next goal is to find (cid:96) ≥ (cid:96) is satisfied.This will involve a Vandermonde Argument from subsecton 3.4. • Let X = ( X i,j ) si,j =1 be an s × s matrix whose entries are indeterminates X i,j for 1 ≤ i, j ≤ s ; • Let y = ( y ij ) s,m i i =1 ,j =1 be a tuple of indeterminates y ij (containing m = (cid:80) si =1 m i elements); • For each 1 ≤ i ≤ s , denote by y i, ∗ = ( y ij ) m i j =1 the subtuple of y whose entries are indetermi-nates y ij for 1 ≤ j ≤ m i ; • Let Z = Z ( y ) be a diagonal s × s matrix whose entries are Z i ( y ) = (cid:80) m i j =1 µ ij y ij for 1 ≤ i ≤ s ; • Let µ = ( µ ij ) s,m i i =1 ,j =1 (containing m elements), and for each 1 ≤ i ≤ s , let µ i, ∗ = ( µ ij ) m i j =1 ; • Finally, let f ( X , y ) = det (cid:0) ( A (cid:48) Z ( y ) X ) (cid:12) p (cid:1) ,f ,i ( y i, ∗ ) = m i (cid:88) j =1 µ pij y pij , ≤ i ≤ s , and f ,i ( y i, ∗ ) = m i (cid:88) j =1 µ p +1 ij y p +1 ij ≤ i ≤ s. 28e treat the expressions f ( X , y ), f ,i ( y i, ∗ ) and f ,i ( y i, ∗ ) where 1 ≤ i ≤ s as polynomials in X i,j ,where 1 ≤ i, j ≤ s , and y ij , where 1 ≤ i ≤ s and 1 ≤ j ≤ m i , even if some of these variables aremissing in some polynomials.Note that Z ( µ ) = H , so by (5.1) we have f (cid:0) A (cid:48) , µ (cid:1) = det (cid:0) ( A (cid:48) HA (cid:48) ) (cid:12) p (cid:1) (cid:54) = 0 ,f ,i (cid:0) µ i, ∗ (cid:1) = m i (cid:88) j =1 µ pij ( µ ij ) p (cid:54) = 0 , ≤ i ≤ s,f ,i (cid:0) µ i, ∗ (cid:1) = m i (cid:88) j =1 µ p +1 ij ( µ ij ) p +1 (cid:54) = 0 , ≤ i ≤ s, and, since Z ( µ (cid:12) (cid:96) ) = D [[ (cid:96) +1]] , f (cid:16) ( A (cid:48) ) (cid:12) (cid:96) , µ (cid:12) (cid:96) (cid:17) = det (cid:16) ( A (cid:48) D [[1+ (cid:96) ]] ( A (cid:48) ) (cid:12) (cid:96) ) (cid:12) p (cid:17) , (cid:96) ≥ ,f ,i (cid:16) µ (cid:12) (cid:96)i, ∗ (cid:17) = m i (cid:88) j =1 µ p + p(cid:96)ij , ≤ i ≤ s, (cid:96) ≥ ,f ,i (cid:16) µ (cid:12) (cid:96)i, ∗ (cid:17) = m i (cid:88) j =1 µ p +1+( p +1) (cid:96)ij , ≤ i ≤ s, (cid:96) ≥ . Now by Corollary 3.18, we get that for some (cid:96) ≥ 1, each condition in the system (5.2) indexedby (cid:96) is satisfied. So we fix such an (cid:96) ≥ 1. From (5.2) we get that B is nondegenerate and all diagonalentries in D [[ p + p(cid:96) ]] and D [[ p +1+( p +1) (cid:96) ]] are nonzero, so D [[ p + p(cid:96) ]] and D [[ p +1+( p +1) (cid:96) ]] are nondegenerateas well. ( n ) We now analyze the partition function value Z A (cid:48) , D ( G n,p,(cid:96) ). The edge gadget P n,p,(cid:96) has the edgeweight matrix L ( n ) = BD [[ p + p(cid:96) ]] B . . . BD [[ p + p(cid:96) ]] B (cid:124) (cid:123)(cid:122) (cid:125) D [[ p + p(cid:96) ]] appears n − ≥ = B ( D [[ p + p(cid:96) ]] B ) n − (5.3)= ( D [[ p + p(cid:96) ]] ) − / (( D [[ p + p(cid:96) ]] ) / B ( D [[ p + p(cid:96) ]] ) / ) n ( D [[ p + p(cid:96) ]] ) − / , (5.4)where in the notation L ( n ) we suppress the indices p, (cid:96) since they are fixed in what follows. The n − D [[ p + p(cid:96) ]] in (5.3) are due to those n − p + p(cid:96) . Here ( D [[ p + p(cid:96) ]] ) / is a diagonal matrix with arbitrarily chosen square roots of the corresponding entries of D [[ p + p(cid:96) ]] onthe main diagonal, and ( D [[ p + p(cid:96) ]] ) − / is its inverse. In G n,p,(cid:96) , all the vertices F ui on various cycleshave degree ( p + 1)( (cid:96) + 1) each, including both the incident edges internal to the gadget R d,n,p,(cid:96) and the ( (cid:96) + 1)-thickened merged dangling edges. These are the end vertices of the edge gadgets P n,p,(cid:96) , but the contributions by their vertex weights are not included in L ( n ) . In Z A (cid:48) , D ( G n,p,(cid:96) ) theymust be accounted for separately.Let (cid:101) B = ( D [[ p + p(cid:96) ]] ) / B ( D [[ p + p(cid:96) ]] ) / . Write the Jordan normal form of (cid:101) B as (cid:101) B = S − JS , where S is a nondegenate complex matrix and J = diag( J λ i ,s i ) qi =1 is the Jordan normal form matrix of (cid:101) B .29ere q ≥ s i ≥ (cid:80) qi =1 s i = s and each Jordan block J λ i ,s i is an s i × s i (upper triangular) matrix, and the λ i ’s are the eigenvalues of (cid:101) B . The eigenvalues λ i ’smay not be all distinct, but are all nonzero since (cid:101) B is nondegenerate. J λ i ,s i = λ i . . . λ i . . . λ i . . . . . . λ i 10 0 0 . . . λ i . Then (cid:101) B n = S − J n S , so the edge weight matrix for P n,p,(cid:96) becomes L ( n ) = ( D [[ p + p(cid:96) ]] ) − / (cid:101) B n ( D [[ p + p(cid:96) ]] ) − / = ( D [[ p + p(cid:96) ]] ) − / S − J n S ( D [[ p + p(cid:96) ]] ) − / . Note that L ( n ) as a matrix is formally defined for any n ≥ 0, and L (0) = ( D [[ p + p(cid:96) ]] ) − . This setting n = 0 does not correspond to any actual gadget, which might be called P ,p,(cid:96) , but we will “realize”this virtual gadget by interpolation in what follows.Clearly, (cid:101) B is nondegenerate as B and ( D [[ p + p(cid:96) ]] ) / both are, and so is J . All λ i (cid:54) = 0. If we writeout the closed form expression for the entries of J nλ i ,s i we get (cid:0) nj (cid:1) λ n − ji for 0 ≤ j < s i . Hence wecan write the ( i, j )th entry of L ( n ) as L ( n ) ij = (cid:80) ql =1 λ nl p ijl ( n ) for every n ≥ p ijl ( x ) ∈ C [ x ] with deg p ijl ( x ) ≤ s l − 1, whose coefficients depend on S , D [[ p + p(cid:96) ]] , J , but not on n ,for all 1 ≤ i, j ≤ s , and 1 ≤ l ≤ q .Note that for all n, p, (cid:96) ≥ 1, the gadget R d v ,n,p,(cid:96) for v ∈ V ( G ) employs exactly d v copies of P n,p,(cid:96) .Let t = (cid:80) v ∈ V ( G ) d v = 2 | E ( G ) | ; this is precisely the number of edge gadgets P n,p,(cid:96) in G n,p,(cid:96) . Inthe evaluation of the partition function Z A (cid:48) , D ( G n,p,(cid:96) ), we stratify the vertex assignments in G n,p,(cid:96) as follows. Denote by κ = ( k ij ) ≤ i,j ≤ s a tuple of nonnegative integers, where the indexing is overall s (ordered) pairs ( i, j ). There are a total of (cid:0) t + s − s − (cid:1) such tuples that satisfy (cid:80) ≤ i,j ≤ s k ij = t .For a fixed s , this is a polynomial in t , and thus a polynomial in the size of G . Denote by K the set of all such tuples κ . We will stratify all vertex assignments in G n,p,(cid:96) by κ ∈ K , namelyall assignments such that there are exactly k ij many constituent edge gadgets P n,p,(cid:96) with the twoordered end points assigned i and j , respectively.For each κ ∈ K , the edge gadgets P n,p,(cid:96) in total contribute (cid:81) ≤ i,j ≤ s ( L ( n ) ij ) k ij to the partitionfunction Z A (cid:48) , D ( G n,p,(cid:96) ). If we factor this product out for each κ ∈ K , we can express Z A (cid:48) , D ( G n,p,(cid:96) )as a linear combination of these products over all κ ∈ K , with polynomially many coefficient values c κ that are independent of all edge gadgets P n,p,(cid:96) . Another way to define these coefficients c κ is tothink in terms of (cid:98) G : For any κ = ( k ij ) ≤ i ≤ j ≤ s ∈ K , we say a vertex assignment on (cid:98) G is consistentwith κ if it assigns exactly k ij many directed cycle edges of (cid:98) G (i.e., those that belong to the directedcycles that replaced vertices in G ) as ordered pairs of vertices to the value ( i, j ). Let L (cid:48) be any(directed) edge signature to be assigned on each of these (directed) cycle edges in (cid:98) G , and keep theedge signature A (cid:48) on each edge of (cid:98) G obtained by ( (cid:96) + 1)-thickening of all the merged dangling edgesbetween any two such cycles, and each vertex receives its vertex weight according to D [[ p +1+( p +1) (cid:96) ]] .Then c κ is the sum, over all assignments consistent with κ , of the products of all edge weights andvertex weights other than the contributions by L (cid:48) , in the evaluation of the partition function. In30ther words, for each κ ∈ K , c κ = (cid:88) ζ : V ( (cid:98) G ) → [ s ] ζ is consistent with κ (cid:89) w ∈ V ( (cid:98) G ) D [[ p +1+( p +1) (cid:96) ]] ζ ( w ) (cid:89) ( u,v ) ∈ (cid:101) E ( A (cid:48) ζ ( u ) ,ζ ( v ) ) (cid:96) +1 , where (cid:101) E ⊆ E ( (cid:98) G ) are the non-cycle edges of (cid:98) G that are in 1-1 correspondence with E ( G ). Inparticular, | (cid:101) E | = | E ( G ) | .Importantly, the values c κ are independent of n . Thus for some polynomially many values c κ ,where κ ∈ K , we have for all n ≥ Z A (cid:48) , D ( G n,p,(cid:96) ) = (cid:88) κ ∈K c κ (cid:89) ≤ i,j ≤ s ( L ( n ) ij ) k ij = (cid:88) κ ∈K c κ (cid:89) ≤ i,j ≤ s ( q (cid:88) (cid:96) =1 λ n(cid:96) p ij(cid:96) ( n )) k ij . (5.5)Expanding out the last sum and rearranging the terms, for some polynomials f i ,...,i q ( x ) ∈ C [ x ]independent of n with deg f i ,...,i q ( x ) < st , we get Z A (cid:48) , D ( G n,p,(cid:96) ) = (cid:88) i + ... + i q = ti ,...,i q ≥ ( q (cid:89) j =1 λ i j j ) n f i ,...,i q ( n )for all n ≥ r pairwise distinct values among (cid:81) qj =1 λ i j j , denoted by χ i , where 1 ≤ i ≤ r .Note that all χ i (cid:54) = 0 since all λ j (cid:54) = 0. It is also clear that 1 ≤ r ≤ (cid:0) t + q − q − (cid:1) . Rearranging the termsin the previous sum, for some polynomials g i ( x ) = (cid:80) st − j =0 b ij x j ∈ C [ x ] where 1 ≤ i ≤ r , we get forall n ≥ Z A (cid:48) , D ( G n,p,(cid:96) ) = r (cid:88) i =1 χ ni g i ( n ) = r (cid:88) i =1 st − (cid:88) j =0 b ij χ ni n j (5.6)If we are given Z A (cid:48) , D ( G n,p,(cid:96) ) for polynomially many n ≥ 1, (5.6) represents a linear system withthe unknowns b ij . The number of unknowns is clearly ≤ rst , which is polynomial in the size ofthe input graph G since r ≤ (cid:0) t + q − q − (cid:1) , t = 2 | E ( G ) | , and s is a constant. The values χ ni n j where1 ≤ i ≤ r and 0 ≤ j < st can be clearly computed in polynomial time.We show how to compute the value r (cid:88) i =1 b i from the values Z A (cid:48) , D ( G n,p,(cid:96) ) , n ≥ χ i (cid:54) = 0 and are pairwise distinct,by Corollary 3.24, the square submatrix of the linear system (5.6) indexed by rows n = 1 , . . . , rst is nondegenerate. It follows that rows 1 , . . . , rst of this linear system are linearly independent.Therefore we can solve this system in polynomial time and find all the values b ij , and after thatcompute (cid:80) ri =1 b i .From (5.6), this value is formally Z A (cid:48) , D ( G n,p,(cid:96) ) at n = 0.31 .7 The problem EVAL( A , D ) We need to define a general EVAL problem, where the vertices and edges can individually takespecific weights. Let A be a set of (edge weight) m × m matrices and D a set of diagonal (vertexweight) m × m matrices. A GH-grid Ω = ( G, ρ ) consists of a graph G = ( V, E ) with possibly bothdirected and undirected edges, and loops, and ρ assigns to each edge e ∈ E or loop an A ( e ) ∈ A and to each vertex v ∈ V a D ( v ) ∈ D . (A loop is considered an edge of the form ( v, v ).) If e ∈ E is a directed edge then the tail and head correspond to rows and columns of A ( e ) , respectively; if e ∈ E is an undirected edge then A ( e ) must be symmetric. Definition 5.4. The problem EVAL( A , D ) is defined as follows: Given a GH-grid Ω = Ω( G ) ,compute Z A , D (Ω) = (cid:88) ξ : V → [ m ] (cid:89) w ∈ V D ( w ) ξ ( w ) (cid:89) e =( u,v ) ∈ E A ( e ) ξ ( u ) ,ξ ( v ) If A = { A } or D = { D } , then we simply write Z A , D ( · ) or Z A , D ( · ), respectively. We remarkthat the problem EVAL( A , D ) generalizes both problems EVAL( A ) and EVAL( A , D ), by taking A to be a single symmetric matrix, and by taking D to be a single diagonal matrix. But EVAL( A , D )is not naturally expressible as EVAL( A , D ) because the latter does not force the vertex-weightmatrix on a vertex according to its degree.Now we will consider a problem in the framework of Z A , D according to Definition 5.4. Let G ,p,(cid:96) be the GH-grid, with the underlying graph (cid:98) G , and every edge of the directed cycle in (cid:98) G isassigned the edge weight matrix ( D [[ p + p(cid:96) ]] ) − (which is L (0) even though we do not have an actualgadget for this), and we keep the vertex-weight matrices D [[ p +1+( p +1) (cid:96) ]] at all vertices. Note thateven though these cycle edges are directed, the matrix ( D [[ p + p(cid:96) ]] ) − is symmetric. The other edges,i.e., those undirected edges that came from the ( (cid:96) + 1)-thickenings of the original edges of G , willeach be assigned the edge weight matrix A (cid:48) . So, A = { ( D [[ p + p(cid:96) ]] ) − , A (cid:48) } , and D = { D [[ p +1+( p +1) (cid:96) ]] } for the specification in the problem EVAL( A , D ). We note that (cid:98) G may have (directed) loops, andDefinition 5.4 specifically allows this. Then (recall that 0 = 1) Z { ( D [[ p + p(cid:96) ]] ) − , A (cid:48) } , D [[ p +1+( p +1) (cid:96) ]] ( G ,p,(cid:96) ) = r (cid:88) i =1 χ i g i (0) = r (cid:88) i =1 st − (cid:88) j =0 b ij χ i j = r (cid:88) i =1 b i and we have just computed this value in polynomial time in the size of G from the values Z A (cid:48) , D ( G n,p,(cid:96) ),for n ≥ 1. In other words, we have achieved it by querying the oracle EVAL( A (cid:48) , D ) on the instances G n,p,(cid:96) (all of bounded degree), for n ≥ 1, in polynomial time.Equivalently, we have shown that we can simulate a virtual “gadget” R d, ,p,(cid:96) replacing everyoccurrence of R d,n,p,(cid:96) in G n,p,(cid:96) in polynomial time. The virtual gadget R d, ,p,(cid:96) has the edge signature( D [[ p + p(cid:96) ]] ) − in place of ( D [[ p + p(cid:96) ]] ) − / (cid:101) B n ( D [[ p + p(cid:96) ]] ) − / in each P n,p,(cid:96) , since( D [[ p + p(cid:96) ]] ) − / (cid:101) B ( D [[ p + p(cid:96) ]] ) − / = ( D [[ p + p(cid:96) ]] ) − / I s ( D [[ p + p(cid:96) ]] ) − / = ( D [[ p + p(cid:96) ]] ) − . Additionally, each vertex F ui retains the vertex-weight contribution with the matrix D [[ p +1+( p +1) (cid:96) ]] in R d, ,p,(cid:96) (recall that to get G n,p,(cid:96) , each merged dangling edge was ( (cid:96) + 1)-thickened, resulting ineach vertex F ui having degree ( p + 1)( (cid:96) + 1)). This precisely results in the GH-grid G ,p,(cid:96) .However, even though G ,p,(cid:96) still retains the cycles, since ( D [[ p + p(cid:96) ]] ) − is a diagonal matrix, eachvertex F ui in a cycle is forced to receive the same vertex assignment value in the domain set [ s ]; all32ther vertex assignments contribute zero in the evaluation of Z { ( D [[ p + p(cid:96) ]] ) − , A (cid:48) } , D [[ p +1+( p +1) (cid:96) ]] ( G ,p,(cid:96) ).This can be easily seen by traversing the vertices F u , . . . , F ud in a cycle that corresponds to avertex u in G , where d = deg( u ). Hence we can view each cycle employing the virtual gadget R d, ,p,(cid:96) as a single vertex that contributes only a diagonal matrix of nonzero vertex weights P [[ d ]] =( D [[ p +1+( p +1) (cid:96) ]] ( D [[ p + p(cid:96) ]] ) − ) d , where d is the vertex degree in G . Contracting each cycle to a singlevertex, we arrive at the ( (cid:96) + 1)-thickening T (cid:96) +1 ( G ) of the original graph G . For each edge e of G we can further collapse its ( (cid:96) + 1)-thickening back by assigning to e the edge weight matrix( A (cid:48) ) (cid:12) ( (cid:96) +1) . We still have to keep the vertex weight matrices at each vertex of T (cid:96) +1 ( G ): if a vertexin T (cid:96) +1 ( G ) has degree d ( (cid:96) + 1), then the corresponding vertex in G of degree d must keep the vertexweight matrix ( D [[ p +1+( p +1) (cid:96) ]] ( D [[ p + p(cid:96) ]] ) − ) d . After this step we arrive at the original graph G , andthe value of the corresponding partition function on G is Z { ( D [[ p + p(cid:96) ]] ) − , A (cid:48) } , D [[ p +1+( p +1) (cid:96) ]] ( G ,p,(cid:96) ). Moreformally, we have the following. Let P = { P [[ i ]] } ∞ i =0 , where we let P [[0]] = I s , and for i > 0, we have P [[ i ]] j = w ij where w j = (cid:80) m j k =1 µ p +1+( p +1) (cid:96)jk / (cid:80) m j k =1 µ p + p(cid:96)jk (cid:54) = 0 for 1 ≤ j ≤ q (each w j is well-definedand is nonzero by (5.2)). This shows that we now can interpolate the value Z ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ) = Z { ( D [[ p + p(cid:96) ]] ) − , A (cid:48) } , D [[ p +1+ p(cid:96) + (cid:96) ]] ( G ,p,(cid:96) ) using the values Z A (cid:48) , D ( G n,p,(cid:96) ) in polynomial time in the size of G . In the above, the graph G is arbitrary, except it has no isolated vertices. The case when G hasisolated vertices can be handled easily as follows.Given an arbitrary graph G , assume it has h ≥ G ∗ denote the graphobtained from G by their removal. Then G ∗ is of size not larger than G and h ≤ | V ( G ) | . Obviously, Z ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ) = ( (cid:80) si =1 P [[0]] i ) h Z ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ∗ ) = s h Z ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ∗ ). Here the integer s ≥ s h can be easily computed. Thus, knowing the value Z ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ∗ ) we cancompute the value Z ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ) in polynomial time. Further, since we only use the graphs G n,p,(cid:96) ,for n ≥ 1, during the interpolation, each being of degree at most ( p +1)( (cid:96) +1), combining it with thepossible isolated vertex removal step, we conclude EVAL(( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ) ≤ EVAL ( p +1)( (cid:96) +1) ( A (cid:48) , D ).Next, it is easy to see that for an arbitrary graph GZ ( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ( G ) = (cid:88) ζ : V ( G ) → [ s ] (cid:89) z ∈ V ( G ) P [[deg( z )]] ζ ( z ) (cid:89) ( u,v ) ∈ E ( G ) ( A (cid:48) ) (cid:12) ( (cid:96) +1) ζ ( u ) ,ζ ( v ) = (cid:88) ζ : V ( G ) → [ s ] (cid:89) z ∈ V ( G ) w deg( z ) ζ ( z ) (cid:89) ( u,v ) ∈ E ( G ) ( A (cid:48) ) (cid:12) ( (cid:96) +1) ζ ( u ) ,ζ ( v ) = (cid:88) ζ : V ( G ) → [ s ] (cid:89) ( u,v ) ∈ E ( G ) w ζ ( u ) w ζ ( v ) ( A (cid:48) ) (cid:12) ( (cid:96) +1) ζ ( u ) ,ζ ( v ) = (cid:88) ζ : V ( G ) → [ s ] (cid:89) ( u,v ) ∈ E ( G ) C ζ ( u ) ,ζ ( v ) = Z C ( G ) . Here C is an s × s matrix with the entries C i,j = ( A (cid:48) i,j ) (cid:96) +1 w i w j where 1 ≤ i, j ≤ s . Clearly, C is asymmetric matrix. In the above chain of equalities, we were able to redistribute the weights w i and w j into the edge weights ( A (cid:48) i,j ) (cid:96) +1 which resulted in the edge weights C i,j , so that precisely eachedge ( u, v ) in G gets two factors w ζ ( u ) and w ζ ( v ) since the vertex weights at u and v were w deg( u ) ζ ( u ) and w deg( v ) ζ ( v ) , respectively. This step is the final objective in our proof of Theorem 5.1; all precedinggadget constructions and interpolation steps are in preparation for being able to carry out this step.Because the underlying graph G is arbitrary, it follows that EVAL(( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ) ≡ EVAL( C ).33ombining this with the previous EVAL-reductions and equivalences, we obtainEVAL( C ) ≡ EVAL(( A (cid:48) ) (cid:12) ( (cid:96) +1) , P ) ≤ EVAL (( p +1)( (cid:96) +1)) ( A (cid:48) , D ) ≡ EVAL (( p +1)( (cid:96) +1)) ( A ) , so that EVAL( C ) ≤ EVAL (∆) ( A ), by taking ∆ = ( p + 1)( (cid:96) + 1).Remembering that our goal is to prove the A that is not mult-brk-1,we finally use this assumption. We first note that when we condensed A to A (cid:48) , all µ ij (cid:54) = 0. Thusup to nonzero row and column multipliers, any 2 by 2 submatrix witnessing non-mult-brk-1 for A is also a 2 by 2 submatrix of A (cid:48) witnessing non-mult-brk-1 for A (cid:48) . Hence A (cid:48) is also not mult-brk-1.Therefore so is ( A (cid:48) ) (cid:12) ( (cid:96) +1) . Finally, because all w i (cid:54) = 0, C is also not mult-brk-1. Hence EVAL( C ) is (∆) ( A ) is also p + 1)( (cid:96) + 1).This completes the proof of Theorem 5.1. from A to A Theorem 6.1. Let A ∈ C m × m be a symmetric matrix, let { g , . . . , g d } , where d ≥ , be a gener-ating set of nonzero entries of A , let A ∈ C m × m be the purification of A obtained by going from ( g , . . . , g d ) to the d smallest primes ( p , . . . , p d ) , and let Γ be an edge gadget. If M Γ , A is not mult-brk- (which is true if M Γ , A is not mod-brk- ), then for some p ≥ , the matrix M T p (Γ) , A = M Γ , A (cid:12) p is not mult-brk- .Proof. Let C = M Γ , A , and let B n = M Γ , A (cid:12) n for n ≥ 1. Since C is not mult-brk-1, there exist1 ≤ i < i ≤ m and 1 ≤ j < j ≤ m such that the 2 × C i ,i ; j ,j = (cid:18) C i ,j C i ,j C i ,j C i ,j (cid:19) contains at least three nonzero entries and for every n ≥ C (cid:12) ni ,i ; j ,j is nondegenerate, i.e., C ni ,j C ni ,j − C ni ,j C ni ,j (cid:54) = 0 . (6.1)By Corollary 3.3, the multiplicative group of roots of unity in the field F = Q ( { A i,j } mi,j =1 ) is afinite cyclic group. Let R be (or any positive multiple of) the order of this group. Next, let I = { i , i } × { j , j } and for each ( i, j ) ∈ I , consider the polynomial p i,j ( x i ,j , x i ,j , x i ,j , x i ,j ) = ( (cid:89) ( i (cid:48) ,j (cid:48) ) ∈ I ( i (cid:48) ,j (cid:48) ) (cid:54) =( i,j ) x i (cid:48) ,j (cid:48) )( x Ri ,j x Ri ,j − x Ri ,j x Ri ,j ) . Since there are at least three nonzero entries in C i ,i ; j ,j and by (6.1), for some ( a, b ) ∈ I , p a,b ( C i ,j , C i ,j , C i ,j , C i ,j ) (cid:54) = 0 . (6.2)Let X = ( X k,(cid:96) ) mk,(cid:96) =1 be a symmetric matrix of indeterminates in which X k,(cid:96) and X (cid:96),k are identified(i.e., X k,(cid:96) = X (cid:96),k ) for k, (cid:96) ∈ [ m ]. Consider the matrix M Γ , X . While we only defined M Γ , X wherethe entries of X are complex numbers, the definition extends to arbitrary commutative rings. Forthe matrix M Γ , X , every edge in Γ is assigned the matrix X , and therefore the entries of M Γ , X arecomplex polynomials in X . In other words, M Γ , X = ( f i,j ( X )) mi,j =1 for some f i,j ( X ) ∈ C [ X ], where34 , j ∈ [ m ]. (Here we view X = ( X k,(cid:96) ) mk,(cid:96) =1 as s list of entries.) More precisely, if u ∗ , v ∗ are thedistinguished vertices of Γ (in this order), then for each i, j ∈ [ m ], we can write f i,j (( X k,(cid:96) ) mk,(cid:96) =1 ) = (cid:88) ξ : V (Γ) → [ m ] ξ ( u ∗ )= i,ξ ( v ∗ )= j (cid:89) ( u,v ) ∈ E (Γ) X ξ ( u ) ,ξ ( v ) . Clearly, M Γ , A (cid:12) n = ( f i,j ( A (cid:12) n )) mi,j =1 so the entries of M Γ , A (cid:12) n belong to F , for n ≥ B n = M Γ , A (cid:12) n , we have B n ; i,j = f i,j ( A (cid:12) n ) for i, j ∈ [ m ] and n ≥ 1. Because C = M Γ , A we also have C i,j = f i,j ( A ) for i, j ∈ [ m ].Let q a,b (( X i,j ) mi,j =1 ) be a complex polynomial defined as q a,b ( X ) = p a,b ( f i ,j ( X ) , f i ,j ( X ) , f i ,j ( X ) , f i ,j ( X )) . Then (6.2) rewrites as q a,b ( A ) (cid:54) = 0 . Since A is the purification of A obtained by going from ( g , . . . , g d ) to ( p , . . . , p d ), by Corollary 3.22,we have q a,b ( A (cid:12) p ) (cid:54) = 0for some p ≥ q a,b ( X )). This is the same as p a,b ( B p ; i ,j , B p ; i ,j , B p ; i ,j , B p ; i ,j ) = ( (cid:89) ( i,j ) ∈ I ( i,j ) (cid:54) =( a,b ) B p ; i,j )( B Rp ; i ,j B Rp ; i ,j − B Rp ; i ,j B Rp ; i ,j ) (cid:54) = 0 . It follows that the matrix B p ; i ,i ; j ,j = (cid:18) B p ; i ,j B p ; i ,j B p ; i ,j B p ; i ,j (cid:19) has at most one zero entry (which can only be B p ; a,b ), and B Rp ; i ,j B Rp ; i ,j − B Rp ; i ,j B Rp ; i ,j (cid:54) = 0 . (6.3)If B p ; i ,i ; j ,j has precisely one zero entry, i.e., if B p ; a,b = 0, then clearly B p is not rectangular soneither is M (cid:12) R Γ , A (cid:12) p = B (cid:12) Rp implying that the latter is not block-rank-1. Assume B p ; i ,i ; j ,j hasno zero entries. In this case, (6.3) means that B (cid:12) Rp ; i ,i ; j ,j is nondegenerate and we conclude that M (cid:12) R Γ , A (cid:12) p = B (cid:12) Rp is not block-rank-1.Finally, by Lemma 3.6, M (cid:12) R Γ , A (cid:12) p is not block-rank-1 implies that M Γ , A (cid:12) p is not mult-brk-1. In this section we show that the complexity of EVAL ( A ) for bounded degree graphs can, just asin [6], be reduced to connected A . We will do so by a gadget based approach without invoking anypinning lemma in order to avoid some nonconstructive steps, which will be important later whenwe make claims about the effectiveness of the dichotomy theorem proved in this paper.For any symmetric matrix A ∈ C m × m , it is obvious that Z A ( · ) is unchanged by a simultaneousrow and column permutation on A by the same permutation, which amounts to renaming the35lements in [ m ]. Also, for any edge gadget Γ, the property of M Γ , A being mult-brk-1 (mod-brk-1)is unchanged. By a similar reasoning, we can freely multiply the matrix A by a nonzero scalar. Asimilar remark holds for a pair ( C , D ) from Definition 2.2. We often do these steps implicitly.The following lemma allows us to focus on the connected components of A ; it is a gadget basedversion of Lemma 4.6 from [6] (without using the first pinning lemma (Lemma 4.1) of [6]). Lemma 7.1. Let A ∈ C m × m be a symmetric matrix with components { A i } i ∈ [ s ] .1. If Γ is an edge gadget such that M Γ , A i is not mult-brk- for some i ∈ [ s ] , then there is anedge gadget Γ such that M Γ , A is not mult-brk- .2. If EVAL ( A i ) is polynomial-time computable for every i , then so is EVAL ( A ) .Proof. 1. By Lemma 3.10, we may replace Γ by the connected component Γ containing the twodistinguished vertices of Γ, and M Γ , A i is not mult-brk-1. Since Γ is connected, it is easy tosee that M Γ , A = diag( M Γ , A i ) i ∈ [ s ] . Then by Property 3.7, M Γ , A is not mult-brk-1.2. By Property 2.4, it suffices to restrict the input to connected graphs. For any connected G we have Z A ( G ) = (cid:80) si =1 Z A i ( G ) which shows that EVAL( A ) is polynomial-time computable.The theorems stated in Sections 8 and 9 will show that for connected A , either there is a gadgetΓ such that M Γ , A is not mult-brk-1 (which leads to EVAL (∆) ( A ) is > A ) is tractable (without degree restriction). Lemma 7.1 allows us to reach the sameconclusion for general A without assuming it is connected. We now give a proof outline of Theorem 1.1 for the case when A ∈ C m × m is connected and bipartite.For m = 1, the only bipartite graph on one vertex is an isolated vertex and EVAL ( A ) is triviallycomputable: Z A ( G ) = 0 if G contains any edge, and 1 otherwise. For m = 2, any connectedbipartite graph consists of a single edge, and again EVAL ( A ) clearly is tractable. More precisely, Z A ( G ) is 0 unless G is bipartite; for connected and bipartite G = ( V, E ), there are at most twoassignments ξ : V → { , } which could yield nonzero values; finally, if G has connected components G i , then Z A ( G ) is the product of Z A ( G i )’s. So we assume m > EVAL problem passed down by the previous step(Step 1 starts with EVAL ( A ) itself) and show that1. either there is an edge gadget whose signature is not mult-brk-1, or2. the matrix that defines the problem safisfies certain structural properties, or3. there is another EVAL problem inheriting all the structural conditions such that if for thelatter there is an edge gadget whose signature is not mult-brk-1, then for the former there is alsoan edge gadget whose signature is not mult-brk-1.Finally, in the last step, we show that if all the structural conditions are satisfied, then theproblem EVAL( A ) is polynomial-time solvable. We start with EVAL ( A ), where A ∈ C m × m is a fixed symmetric, connected, and bipartite matrixwith algebraic entries. In this step, we show that either A is not mult-brk-1 (so EVAL ∆ ( A ) > 0) or A has a regularized form. 36 efinition 8.1 (modification of Definition 5.1 from [6]) . Let A ∈ C m × m be a symmetric, connected,and bipartite matrix. We say it is a regularized bipartite matrix if there exist nonzero complexnumbers µ , . . . , µ m that generate a torsion-free multiplicative group (i.e., that contains no roots ofunity other that ) and an integer ≤ k < m such that1. A i,j = 0 for all i, j ∈ [ k ] ; A i,j = 0 for all i, j ∈ [ k + 1 : m ] ; and2. A i,j / ( µ i µ j ) = A j,i / ( µ i µ j ) is a root of unity for all i ∈ [ k ] , j ∈ [ k + 1 : m ] .We say A is a purified bipartite matrix if µ , . . . , µ m are positive rational numbers. In other words, A is regularized bipartite if there exists a k × ( m − k ) matrix B of the form B = µ µ . . . µ k ζ , ζ , . . . ζ ,m − k ζ , ζ , . . . ζ ,m − k ... ... . . . ... ζ k, ζ k, . . . ζ k,m − k µ k +1 µ k +2 . . . µ m , (8.1)where every µ i is a nonzero complex number such that µ , . . . , µ m generate a torsion-free multiplica-tive group and every ζ i,j is a root of unity, and A is the bipartization of B . If further µ , . . . , µ m are positive rational numbers, then A is purified bipartite. Theorem 8.2 (modification of Theorem 5.2 from [6]) . Let A ∈ C m × m be a symmetric, connectedand bipartite matrix with algebraic entries. Then A is mult-brk- iff A is a regularized bipartitematrix. In that case, if { g , . . . , g d } is a generating set of nonzero entries of A , then we can choose µ , . . . , µ m to belong to the multiplicative subgroup generated by { g , . . . , g d } .As a consequence, either A is not mult-brk- (a fortiori, EVAL (∆) ( A ) is ∆ > ) or A is a reqularized bipartite matrix. Note that if A is not a regularized bipartite matrix, then an edge e = ( u ∗ , v ∗ ) forms an edgegadget with the distinguished vertices u ∗ , v ∗ such that its signature M e, A = A is not mult-brk-1by Theorem 8.2. Now let A ∈ C m × m denote a regularized bipartite matrix. We show that either there is an edgegadget Γ such that M Γ , A is not mult-brk-1 (so EVAL (∆) ( A ) is > 0) or thereis a pair ( C , D ), where the matrix C is the bipartization of a discrete unitary matrix (see Section 4for the definition), such that ( C , D ) satisfies the following property: (A) If there is an edge gadgetΓ such that M Γ , C , D is not mult-brk-1, then there is an edge gadget Γ (cid:48) such that M Γ (cid:48) , A is notmult-brk-1; (B) If EVAL ↔ ( C , D ) is tractable then so is EVAL ( A ). Theorem 8.3 (modification of Theorem 5.3 from [6]) . Given a regularized bipartite matrix A ∈ C m × m , either (I) there exists an edge gadget Γ such that M Γ , A is not mult-brk- (a fortiori, EVAL (∆) ( A ) is ∆ > ) or (II) there exists a triple (( M, N ) , C , D ) such that1. for any edge gadget Γ such that M Γ , C , D is not mult-brk- , we can construct an edge gadget Γ (cid:48) so that M Γ (cid:48) , A is not mult-brk- ;2. EVAL( A ) ≤ EVAL ↔ ( C , D ) ; and3. (( M, N ) , C , D ) satisfies the following conditions: U ) C ∈ C n × n for some n ≥ , and D = (cid:0) D [0] , D [1] , . . . , D [ N − (cid:1) is a sequence of N n × n diagonal matrices over C for some even N > . ( U ) C is the bipartization of an M - discrete unitary matrix F ∈ C n × n , where M ≥ and M | N . (Note that C and F uniquely determine each other.) ( U ) D [0] is the n × n identity matrix, and for every r ∈ [ N − we have ∃ i ∈ [ n ] , D [ r ] i (cid:54) = 0 = ⇒ ∃ i (cid:48) ∈ [ n ] , D [ r ] i (cid:48) = 1 , and ∃ i ∈ [ n + 1 : 2 n ] , D [ r ] i (cid:54) = 0 = ⇒ ∃ i (cid:48) ∈ [ n + 1 : 2 n ] , D [ r ] i (cid:48) = 1 . ( U ) For all r ∈ [ N − and all i ∈ [2 n ] , D [ r ] i ∈ Q ( ω N ) and | D [ r ] i | ∈ { , } . In fact there are two levels of ( C , D ) involved in proving Theorem 8.3. Assuming M Γ , A ismult-brk-1 for every edge gadget Γ, the problem EVAL( A ) is first shown to be equivalent tosome EVAL( C , D ), which must further be factorizable as a tensor product of an outer problem EVAL ( C (cid:48) , K ) and an inner problem EVAL ( C (cid:48)(cid:48) , L ), where EVAL ( C (cid:48) , K ) is tractable. It is the inner( C (cid:48)(cid:48) , L ) we rename as EVAL( C , D ) in the conclusion of Theorem 8.3.In addition to ( C , D ), we will also need to introduce a purified pair ( C , D ), where C is apurification of C , as an auxiliary tool that will be used to relate to the purification matrix A . D After the first two steps, the original problem EVAL ( A ) is shown to be either tractable, or there isan edge gadget Γ such that M Γ , A is not mult-brk-1 (a fortiori, EVAL (∆) ( A ) is > C , D ) such that for any an edge gadget Γ such that M Γ , C , D is not mult-brk-1, there is an edge gadget Γ (cid:48) so that M Γ (cid:48) , A is not mult-brk-1; and EVAL( A ) ≤ EVAL ↔ ( C , D ).There are also positive integers M and N such that (( M, N ) , C , D ) satisfies conditions ( U )–( U ).For convenience, we use 2 m to denote the number of rows of C and D [ r ] , though it should benoted that this new m is indeed the n in Theorem 8.3, which is different from the m used in thefirst two steps. We also denote the upper-right m × m block of C by F .In this step, we adopt the following convention: Given an n × n matrix, we use [0 : n − n ], to index its rows and columns. For example, we index the rows of F using [0 : m − C using [0 : 2 m − M = 1. As F is M -discrete unitary, we must have m = 1.It is easy to check that EVAL ↔ ( C , D ) is tractable: C is a 2 × (cid:18) (cid:19) ; Z → C , D ( G ) and Z ← C , D ( G ) are 0 unless G is bipartite; for connected and bipartite G , there are at mosttwo assignments ξ : V → { , } which could yield nonzero values: at most one for Z → C , D ( G ) and atmost one for Z ← C , D ( G ); finally, if G has connected components G i , then the proof is similar.For the general case when the parameter M > F as wellas the diagonal matrices in D , and derive three necessary conditions on them so that any violationof these conditions will let us construct an edge gadget Γ such that M Γ , C , D is not mod-brk-1. Inthe tractability part, we prove that these conditions are actually sufficient for EVAL ↔ ( C , D ) to bepolynomial-time computable. 38 .3.1 Step 3.1: Entries of D [ r ] are either or powers of ω N In the first step within Step 3, we prove the following theorem: Theorem 8.4 (modification of Theorem 5.4 from [6]) . Suppose (( M, N ) , C , D ) satisfies ( U ) – ( U ) with M > . Then either there is an edge gadget Γ such that M Γ , C , D is not mod-brk- or (( M, N ) , C , D ) satisfies the following condition ( U ) : ( U ) For all r ∈ [ N − and i ∈ [0 : 2 n − , D [ r ] i is either or a power of ω N . Second, we show that either there exists an edge gadget Γ such that M Γ , C , D is not mod-brk-1, orwe can permute the rows and columns of F , so that the new F is the tensor product of a collectionof Fourier matrices defined below: Definition 8.5 (Definition 5.5 from [6]) . Let q > be a prime power, and k ≥ be an integer suchthat gcd ( k, q ) = 1 . We call the following q × q matrix F q,k a ( q, k ) - Fourier matrix : The ( x, y ) thentry of F q,k , where x, y ∈ [0 : q − , is ω kxyq = e πi (cid:0) kxy/q (cid:1) . In particular, when k = 1 , we use F q to denote F q, for short. Theorem 8.6 (modification of Theorem 5.6 from [6]) . Assume (( M, N ) , C , D ) satisfies conditions ( U ) – ( U ) and M > . Then either there exists an edge gadget Γ such that M Γ , C , D is not mod-brk- or there exist permutations Σ and Π of [0 : m − and a sequence q , q , . . . , q d of d prime powers,for some d ≥ , such that F Σ , Π = (cid:79) i ∈ [ d ] F q i . (8.2)Suppose there do exist permutations Σ , Π and prime powers q , . . . , q d such that F Σ , Π satisfies(8.2). Then we let C Σ , Π denote the bipartization of F Σ , Π and let D Σ , Π denote a sequence of N m × m diagonal matrices in which the r th matrix is D [ r ]Σ(0) . . . D [ r ]Σ( m − D [ r ]Π(0)+ m . . . D [ r ]Π( m − m , r ∈ [0 : N − EVAL ( C Σ , Π , D Σ , Π ) and EVAL ( C , D ) are really the same problem, we will let F , C and D denote F Σ , Π , C Σ , Π and D Σ , Π , respectively, with F = (cid:79) i ∈ [ d ] F q i . (8.3)39efore moving forward, we rearrange the prime powers q , q , . . . , q d and divide them into groupsaccording to different primes. We need the following notation. Let p = ( p , . . . , p s ) be a strictlyincreasing sequence of primes and t = ( t , . . . , t s ) be a sequence of positive integers. Let Q = { q i : i ∈ [ s ] } be a set of s sequences in which each q i is a nonincreasing sequence ( q i, , . . . , q i,t i ) of powersof p i . We let q i denote q i, for all i ∈ [ s ], let Z q i = (cid:89) j ∈ [ t i ] Z q i,j = Z q i, × · · · × Z q i,ti , for all i ∈ [ s ], and let Z Q = (cid:89) i ∈ [ s ] ,j ∈ [ t i ] Z q i,j = (cid:89) i ∈ [ s ] Z q i = Z q , × · · · × Z q ,t × · · · × Z q s, × · · · × Z q s,ts be the Cartesian products of the respective finite Abelian groups. Both Z Q and Z q i are finiteAbelian groups, under componentwise operations. This implies that both Z Q and Z q i are Z -modules and thus k x is well defined for all k ∈ Z and x in Z Q or Z q i . As Z -modules, we canalso refer to their members as “vectors”. When we use x to denote a vector in Z Q , we denoteits ( i, j )th entry by x i,j ∈ Z q i,j . We use x i to denote ( x i,j : j ∈ [ t i ]) ∈ Z q i , so x = ( x , . . . , x s ).Given x , y ∈ Z Q , we let x ± y denote the vector in Z Q whose ( i, j )th entry is x i,j ± y i,j (mod q i,j ) . Similarly, for each i ∈ [ s ], we can define x ± y for vectors x , y ∈ Z q i .From (8.3), there exist p , t , Q such that (( M, N ) , C , D , ( p , t , Q )) satisfies the following threeconditions ( R )–( R ), which we will refer to combined as ( R ).( R ) p = ( p , . . . , p s ) is a strictly increasing sequence of primes; t = ( t , . . . , t s ) is a sequence ofpositive integers; Q = { q i : i ∈ [ s ] } is a collection of s sequences, in which each q i = ( q i, , . . . , q i,t i )is a nonincreasing sequence of powers of p i .( R ) C is the bipartization of F ∈ C m × m and (( M, N ) , C , D ) satisfies ( U )–( U ).( R ) There is a bijection ρ : [0 : m − → Z Q (so m = (cid:81) i,j q i,j ) such that F a,b = (cid:89) i ∈ [ s ] ,j ∈ [ t i ] ω x i,j y i,j q i,j , for all a, b ∈ [0 : m − , (8.4)where ( x i,j : i ∈ [ s ] , j ∈ [ t i ]) = x = ρ ( a ) and ( y i,j : i ∈ [ s ] , j ∈ [ t i ]) = y = ρ ( b ). Note that (8.4)also gives us an expression of M using Q . It is the product of the largest prime powers q i = q i, foreach distinct prime p i : M = q q · · · q s . For convenience, we from now on use x ∈ Z Q to index the rows and columns of F : F x , y = F ρ − ( x ) ,ρ − ( y ) = (cid:89) i ∈ [ s ] ,j ∈ [ t i ] ω x i,j y i,j q i,j , for all x , y ∈ Z Q , (8.5)whenever we have a tuple (( M, N ) , C , D , ( p , t , Q )) that is known to satisfy condition ( R ). Weassume that F is indexed by ( x , y ) ∈ Z Q rather than ( a, b ) ∈ [0 : m − , and ( R ) refers to (8.5).Correspondingly, we use { , } × Z Q to index the entries of the matrices C and D [ r ] : (0 , x ) refersto the ( ρ − ( x ))th row or column, and (1 , x ) refers to the ( m + ρ − ( x ))th row or column. D Now we have a 4-tuple (( M, N ) , C , D , ( p , t , Q )) that satisfies ( R ). In this step, we prove for every r ∈ [ N − 1] (recall that D [0] is already known to be the identity matrix), the nonzero entries of the40 th matrix D [ r ] in D must have a very nice coset structure; otherwise there exists an edge gadgetΓ such that M Γ , C , D is not mod-brk-1.For every r ∈ [ N − r ⊆ Z Q and ∆ r ⊆ Z Q asΛ r = (cid:8) x ∈ Z Q : D [ r ](0 , x ) (cid:54) = 0 (cid:9) and ∆ r = (cid:8) x ∈ Z Q : D [ r ](1 , x ) (cid:54) = 0 (cid:9) . We use S to denote the set of r ∈ [ N − 1] such that Λ r (cid:54) = ∅ and T to denote the set of r ∈ [ N − r (cid:54) = ∅ . We recall the following standard definition of a coset of a group, specialized toour situation. Definition 8.7 (Definition 5.7 from [6]) . Let Φ be a nonempty subset of Z Q ( or Z q i for some i ∈ [ s ]) . We say Φ is a coset in Z Q ( or Z q i ) if there is a vector x ∈ Φ such that { x − x | x ∈ Φ } isa subgroup of Z Q ( or Z q i ) . Given a coset Φ ( in Z Q or Z q i ) , we use Φ lin to denote its correspondingsubgroup { x − x (cid:48) | x , x (cid:48) ∈ Φ } . Theorem 8.8 (modification of Theorem 5.8 from [6]) . Let (( M, N ) , C , D , ( p , t , Q )) be a -tuplethat satisfies ( R ) . Then either there is an edge gadget Γ such that M Γ , C , D is not mod-brk- or Λ r , ∆ r ⊆ Z Q satisfy the following condition ( L ) : ( L ) For every r ∈ S , Λ r = (cid:81) si =1 Λ r,i , where Λ r,i is a coset in Z q i , i ∈ [ s ] . ( L ) For every r ∈ T , ∆ r = (cid:81) si =1 ∆ r,i , where ∆ r,i is a coset in Z q i , i ∈ [ s ] . Suppose for any gadget Γ, M Γ , C , D is mod-brk-1. Then by Theorem 8.8, (( M, N ) , C , D , ( p , t , Q )) satisfies not only ( R ) but also ( L ). Actually, by ( U ), D also satisfies the following:( L ) There exist an a [ r ] ∈ Λ r for each r ∈ S , a b [ r ] ∈ ∆ r for each r ∈ T such that D [ r ](0 , a [ r ] ) = D [ r ](1 , b [ r ] ) = 1 . From now on, when we say condition ( L ), we mean all three conditions ( L )–( L ). In this final step within Step 3, we prove that for every r ∈ [ N − D [ r ] musthave a quadratic structure; otherwise there is an edge gadget Γ such that M Γ , C , D is not mod-brk-1.We start with some notation.Given x in Z q i for some i ∈ [ s ], we use ext r ( x ) (extension of x for short), where r ∈ S , todenote the following unique vector: (cid:16) a [ r ]1 , . . . , a [ r ] i − , x , a [ r ] i +1 , . . . , a [ r ] s (cid:17) ∈ Z Q . Similarly we let ext (cid:48) r ( x ), where r ∈ T , denote the following unique vector: (cid:16) b [ r ]1 , . . . , b [ r ] i − , x , b [ r ] i +1 , . . . , b [ r ] s (cid:17) ∈ Z Q . Let a be a vector in Z q i for some i ∈ [ s ]. Then we use (cid:101) a to denote the vector b ∈ Z Q such that b i = a and b j = for all other j (cid:54) = i . Also recall that q k = q k, . Theorem 8.9 (modification of Theorem 5.9 from [6]) . Let (( M, N ) , C , D , ( p , t , Q )) be a tuple thatsatisfies both ( R ) and ( L ) . Then either there is an edge gadget Γ such that M Γ , C , D is not mod-brk- ,or D satisfies the following condition ( D ) : D ) For all r ∈ S and x ∈ Λ r , we have D [ r ](0 , x ) = D [ r ](0 , ext r ( x )) D [ r ](0 , ext r ( x )) · · · D [ r ](0 , ext r ( x s )) . (8.6)( D ) For all r ∈ T and x ∈ ∆ r , we have D [ r ](1 , x ) = D [ r ](1 , ext (cid:48) r ( x )) D [ r ](1 , ext (cid:48) r ( x )) · · · D [ r ](1 , ext (cid:48) r ( x s )) . (8.7)( D ) For all r ∈ S , k ∈ [ s ] , and a ∈ Λ lin r,k , there are b ∈ Z q k and α ∈ Z N such that ω αN · F x , (cid:101) b = D [ r ](0 , x + (cid:101) a ) · D [ r ](0 , x ) for all x ∈ Λ r . (8.8)( D ) For all r ∈ T , k ∈ [ s ] , and a ∈ ∆ lin r,k , there are b ∈ Z q k and α ∈ Z N such that ω αN · F (cid:101) b , x = D [ r ](1 , x + (cid:101) a ) · D [ r ](1 , x ) for all x ∈ ∆ r . (8.9)Note that in ( D ) and ( D ), the expressions on the left-hand side do not depend on all othercomponents of x except the k th component x k , since all other components of (cid:101) b are . The state-ments in conditions ( D )–( D ) are a technically precise way to express the idea that there is aquadratic structure on the support of each diagonal matrix D [ r ] . We express it in terms of anexponential difference equation. Now we can state a theorem of tractability. Theorem 8.10 (modification of Theorem 5.10 from [6]) . Suppose that (( M, N ) , C , D , ( p , t , Q )) satisfies ( R ) , ( L ) , and ( D ) . Then the problem EVAL ↔ ( C , D ) can be solved in polynomial time. The definitions and theorems of the case for nonbipartite A is similar to the bipartite case. However,there are some nontrivial differences. We start with A ∈ C m × m , a symmetric, connected, and nonbipartite matrix with algebraic entries.The problem EVAL ( A ) is clearly tractable if m = 1; in the discussion below, we assume m > Definition 9.1 (modification of Definition 6.1 from [6]) . Let A ∈ C m × m be a symmetric, connected,and nonbipartite matrix. We say A is a regularized nonbipartite matrix if there exist nonzerocomplex numbers µ , . . . , µ m such that A i,j / ( µ i µ j ) is a root of unity for all i, j ∈ [ m ] . We may pre-multiply A by a nonzero scalar, and require that µ , . . . , µ m generate a torsion-free multiplicativegroup. We say A is a purified nonbipartite matrix if µ , . . . , µ m are positive rational numbers. A is regularized nonbipartite if A has the form A = µ µ . . . µ m ζ , ζ , . . . ζ ,m ζ , ζ , . . . ζ ,m ... ... . . . ... ζ m, ζ m, . . . ζ m,m µ µ . . . µ m , (9.1)where every µ i is a nonzero complex number such that µ , . . . , µ n generate a torsion-free multiplica-tive group, and ζ i,j = ζ j,i are all roots of unity. If further µ , . . . , µ m are positive rational numbers,then A is purified nonbipartite.When we go from A to its purified form A , we may pre-multiply A by a nonzero constant (inthe multiplicative group G generated by { g , . . . , g d } ) and then assume that the same generators { g , . . . , g d } are chosen for going from A to A , as for going from ( µ , . . . , µ m ) to its purification( µ , . . . , µ m ) and that µ , . . . , µ m belong to G . Thus, A has the form A = µ µ . . . µ m ζ , ζ , . . . ζ ,m ζ , ζ , . . . ζ ,m ... ... . . . ... ζ m, ζ m, . . . ζ m,m µ µ . . . µ m . (9.2)We prove the following theorem. Theorem 9.2 (modification of Theorem 6.2 from [6]) . Let A ∈ C m × m be a symmetric, connectedand nonbipartite matrix, where m > . Then A is mult-brk- iff A is a regularized nonbipartitematrix. In that case, if { g , . . . , g d } is a generating set of nonzero entries of A , then we can choose µ , . . . , m m to belong to the multiplicative group generated by { g , . . . , g d } . As a consequence, either A is not mult-brk- (a fortiori, EVAL (∆) ( A ) is ∆ > ) or A is a reqularizednonbipartite matrix. If A is not a regularized nonbipartite matrix, then an edge e = ( u ∗ , v ∗ ) forms an edge gadgetwith the distinguished vertices u ∗ , v ∗ such that M e, A = A is not mult-brk-1 by Theorem 9.2. Theorem 9.3 (modification of Theorem 6.3 from [6]) . Let A ∈ C m × m be a purified nonbipartitematrix. Then either (I) there exists an edge gadget Γ such that M Γ , A is not mult-brk- (a fortori, EVAL (∆) ( A ) is ∆ > ) or (II) there exists a triple (( M, N ) , F , D ) such that1. for any an edge gadget Γ such that M Γ , F , D is not mult-brk- , we can construct an edge gadget Γ (cid:48) so that M Γ (cid:48) , A is not mult-brk- ;2. EVAL( A ) ≤ EVAL( F , D ) ; and3. (( M, N ) , F , D ) satisfies ( U (cid:48) ) – ( U (cid:48) ) : ( U (cid:48) ) F ∈ C n × n for some n ≥ , and D = ( D [0] , . . . , D [ N − ) is a sequence of Nn × n diagonal matrices for some even N > . ( U (cid:48) ) F is a symmetric M -discrete unitary matrix, where M ≥ and M | N . ( U (cid:48) ) D [0] is the identity matrix. For each r ∈ [ N − , either D [ r ] = or D [ r ] has an entry equal to . U (cid:48) ) For all r ∈ [ N − and i ∈ [ n ] , D [ r ] i ∈ Q ( ω N ) and | D [ r ] i | ∈ { , } . In addition to ( F , D ), we will also need to introduce a purified pair ( F , D ), where F is apurification of F to relate to the purification matrix A . D Now suppose we have a tuple (( M, N ) , F , D ) that satisfies ( U (cid:48) )–( U (cid:48) ). For convenience we still use m to denote the number of rows and columns of F and each D [ r ] in D , though it should be notedthat this new m is indeed the n in Theorem 9.3, which is different from the m used in the first twosteps. Similar to the bipartite case, we adopt the following convention in this step: given an n × n matrix, we use [0 : n − n ], to index its rows and columns.We start with the special case when M = 1. Since F is M -discrete unitary, we must have m = 1and F = (1). In this case, it is clear that the problem EVAL ( F , D ) is tractable. So in the rest ofthis section, we always assume that M > [ r ] are either or powers of ω N Theorem 9.4 (modification of Theorem 6.4 from [6]) . Suppose (( M, N ) , F , D ) satisfies ( U (cid:48) ) – ( U (cid:48) ) ,and M > . Then either there exists an edge gadget Γ such that M Γ , F , D is not mod-brk- or (( M, N ) , F , D ) satisfies the following condition ( U (cid:48) ) : ( U (cid:48) ) For all r ∈ [ N − , entries of D [ r ] are either zero or powers of ω N . Let q be a prime power. We say W is a nondegenerate matrix in Z × q if Wx (cid:54) = for all x (cid:54) = ∈ Z q . Lemma 9.5 (Lemma 6.5 from [6]) . Let q be a prime power and W ∈ Z × q . The following state-ments are equivalent: (1) W is nondegenerate; (2) x (cid:55)→ Wx is a bijection from Z q to itself; and(3) det( W ) is invertible in Z q . Definition 9.6 (generalized Fourier matrix, Definition 6.6 from [6]) . Let q be a prime power and W = ( W ij ) be a symmetric nondegenerate matrix in Z × q . We say a q × q matrix F q, W is a ( q, W )-generalized Fourier matrix if there exists a bijection ρ from [0 : q − to [0 : q − suchthat ( F q, W ) i,j = ω W x y + W x y + W x y + W x y q for all i, j ∈ [0 : q − , where x = ( x , x ) = ρ ( i ) and y = ( y , y ) = ρ ( j ) . Theorem 9.7 (modification of Theorem 6.7 from [6]) . Suppose (( M, N ) , F , D ) satisfies conditions ( U (cid:48) ) – ( U (cid:48) ) . Then either there exists an edge gadget Γ such that M Γ , F , D is not mod-brk- or thereexist a permutation Σ of [0 : m − such that F Σ , Σ = (cid:32) g (cid:79) i =1 F d i , W [ i ] (cid:33) ⊗ (cid:32) (cid:96) (cid:79) i =1 F q i ,k i (cid:33) , where d = ( d , . . . , d g ) and W = ( W [1] , . . . , W [ g ] ) are two sequences, for some g ≥ . (Note thatthe g here can be , in which case d and W are empty.) For each i ∈ [ g ] , d i > is a power of nd W [ i ] is a × symmetric nondegenerate matrix over Z d i ; q = ( q , . . . , q (cid:96) ) and k = ( k , . . . , k (cid:96) ) are two sequences for some (cid:96) ≥ (again (cid:96) can be ). For each i ∈ [ (cid:96) ] , q i is a prime power, k i ∈ Z q i ,and gcd( q i , k i ) = 1 . Assume there does exist a permutation Σ, together with the four sequences, such that F Σ , Σ satisfies the equation above; otherwise, there exists an edge gadget Γ such that M Γ , F , D is not mod-brk-1. Then we apply Σ to D [ r ] , r ∈ [0 : N − D Σ of N diagonal matricesin which the r th matrix of D Σ is D [ r ]Σ(0) . . . D [ r ]Σ( m − . Clearly EVAL ( F Σ , Σ , D Σ ) and EVAL ( F , D ) are equivalent. From now on, we simply let F and D denote F Σ , Σ and D Σ , respectively. Thus, we have F = (cid:32) g (cid:79) i =1 F d i , W [ i ] (cid:33) ⊗ (cid:32) (cid:96) (cid:79) i =1 F q i ,k i (cid:33) . (9.3)Before moving forward to Step 3.3, we rearrange the prime powers in d and q and divide theminto groups according to different primes.By (9.3), there exist d , W , p , t , Q , and K such that the tuple (( M, N ) , F , D , ( d , W , p , t , Q , K ))satisfies the following condition ( R (cid:48) ):( R (cid:48) ) d = ( d , . . . , d g ) is a nonincreasing sequence of powers of 2 for some g ≥ W =( W [1] , . . . , W [ g ] ) is a sequence of symmetric nondegenerate 2 × Z d i (note that d and W can be empty); p = ( p , . . . , p s ) is a strictly increasing sequence of s primes for some s ≥ 1, starting with p = 2; t = ( t , . . . , t s ) is a sequence of integers with t ≥ t i ≥ i > Q = { q i : i ∈ [ s ] } is a collection of sequences in which each q i = ( q i, , . . . , q i,t i )is a nonincreasing sequence of powers of p i (only q can be empty as we always fix p = 2 evenwhen no powers of 2 occur in Q ); K = { k i : i ∈ [ s ] } is a collection of sequences in which each k i = ( k i, , . . . , k i,t i ) is a sequence of length t i . Finally, for all i ∈ [ s ] and j ∈ [ t i ], k i,j ∈ [0 : q i,j − k i,j , q i,j ) = gcd( k i,j , p i ) = 1.( R (cid:48) ) (( M, N ) , F , D ) satisfies conditions ( U (cid:48) )–( U (cid:48) ), and m = (cid:89) i ∈ [ g ] ( d i ) × (cid:89) i ∈ [ s ] ,j ∈ [ t i ] q i,j . ( R (cid:48) ) There is a bijection ρ from [0 : m − 1] to Z d × Z Q , where Z d = (cid:89) i ∈ [ g ] ( Z d i ) and Z Q = (cid:89) i ∈ [ s ] ,j ∈ [ t i ] Z q i,j , such that (for each a ∈ [0 : m − (cid:0) x ,i,j : i ∈ [ g ] , j ∈ { , } (cid:1) ∈ Z d and (cid:0) x ,i,j : i ∈ [ s ] , j ∈ [ t i ] (cid:1) ∈ Z Q 45o denote the components of x = ρ ( a ), where x ,i,j ∈ Z d i and x ,i,j ∈ Z q i,j ) F a,b = (cid:89) i ∈ [ g ] ω ( x ,i, x ,i, ) · W [ i ] · ( y ,i, y ,i, ) T d i (cid:89) i ∈ [ s ] ,j ∈ [ t i ] ω k i,j · x ,i,j y ,i,j q i,j for all a, b ∈ [0 : m − x ,i,j ) , ( x ,i,j )) = x = ρ ( a ) and y = ρ ( b ).For convenience, from now on we will directly use x ∈ Z d × Z Q to index the rows and columnsof F , i.e., F x , y ≡ F ρ − ( x ) ,ρ − ( y ) . D Now we have a tuple (( M, N ) , F , D , ( d , W , p , t , Q , K )) that satisfies ( R (cid:48) ). In the next step, weshow for every r ∈ [ N − 1] ( D [0] is already known to be the identity matrix) the nonzero entries of D [ r ] (in D ) must have a coset structure; otherwise there exists an edge gadget Γ such that M Γ , F , D is not mod-brk-1.For each r ∈ [ N − r ⊆ Z d × Z Q denote the set of x such that the entry of D [ r ] indexedby x is nonzero. We also use Z to denote the set of r ∈ [ N − 1] such that Γ r (cid:54) = ∅ . For convenience,we let ˜ Z q i , i ∈ [ s ], denote the following set (or group):˜ Z q i = (cid:40) Z q i if i > Z d × Z q if i = 1.This gives us a new way to denote the components of x ∈ Z d × Z Q = ˜ Z q × ˜ Z q × · · · × ˜ Z q s , i.e., x = ( x , . . . , x s ), where x i ∈ ˜ Z q i for each i ∈ [ s ]. Theorem 9.8 (modification of Theorem 6.8 from [6]) . Assume that (( M, N ) , F , D , ( d , W , p , t , Q , K )) satisfies condition ( R (cid:48) ) . Then either there exists an edge gadget Γ such that M Γ , F , D is not mod-brk- or D satisfies the following condition: ( L (cid:48) ) For every r ∈ Z , Γ r = (cid:81) si =1 Γ r,i , where Γ r,i is a coset in ˜ Z q i for all i ∈ [ s ] . Suppose for any gadget Γ, M Γ , F , D is mod-brk-1. Then by Theorem 9.8, the tuple (( M, N ) , F , D , ( d , W , p , t , Q , K )) satisfies not only ( R (cid:48) ) but also ( L (cid:48) ). By ( U (cid:48) ), D also satisfies the following:( L (cid:48) ) For every r ∈ Z , there exists an a [ r ] ∈ Γ r ⊆ Z d × Z Q such that the entry of D [ r ] indexedby a [ r ] is equal to 1.From now on, we refer to conditions ( L (cid:48) ) and ( L (cid:48) ) as condition ( L (cid:48) ). In this final step within Step 3 for the nonbipartite case, we show that for any index r ∈ [ N − D [ r ] must have a quadratic structure; otherwise there exists an edge gadgetΓ such that M Γ , F , D is not mod-brk-1.We need the following notation. Given x in ˜ Z q i for some i ∈ [ s ], we let ext r ( x ), where r ∈ Z ,denote the following unique vector: (cid:16) a [ r ]1 , . . . , a [ r ] i − , x , a [ r ] i +1 , . . . , a [ r ] s (cid:17) ∈ (cid:89) j ∈ [ s ] ˜ Z q j . a ∈ ˜ Z q i for some i ∈ [ s ], we let (cid:101) a = ( (cid:101) a , . . . , (cid:101) a s ) ∈ (cid:81) j ∈ [ s ] ˜ Z q j such that (cid:101) a i = a and all othercomponents are . Theorem 9.9 (modification of Theorem 6.9 from [6]) . Suppose (( M, N ) , F , D , ( d , W , p , t , Q , K )) satisfies ( R (cid:48) ) and ( L (cid:48) ) . Then either there exists an edge gadget Γ such that M Γ , F , D is not mod-brk- or D satisfies the following condition ( D (cid:48) ) : ( D (cid:48) ) For all r ∈ Z and x ∈ Γ r , we have D [ r ] x = D [ r ] ext r ( x ) D [ r ] ext r ( x ) · · · D [ r ] ext r ( x s ) . (9.4)( D (cid:48) ) For all r ∈ Z , k ∈ [ s ] , and a ∈ Γ lin r,k , there are b ∈ ˜ Z q k and α ∈ Z N such that ω αN · F (cid:101) b , x = D [ r ] x + (cid:101) a · D [ r ] x for all x ∈ Γ r . (9.5)Note that in (9.5), the expression on the left-hand side does not depend on other componentsof x except the k th component x k ∈ ˜ Z q k . Theorem 9.10 (modification of Theorem 6.10 from [6]) . If (( M, N ) , F , D , ( d , W , p , t , Q , K )) sat-isfies all conditions ( R (cid:48) ) , ( L (cid:48) ) , and ( D (cid:48) ) , then EVAL ( F , D ) can be solved in polynomial time. 10 Proof of Theorem 8.2 and Theorem 9.2 We prove Theorem 8.2 and Theorem 9.2 in this section. Proof of Theorem 8.2. Let A ∈ C m × m be a symmetric, connected, and bipartite matrix. If A is aregularized bipartite matrix, then by taking a common multiplier of the orders of the roots of unity ζ i,j ’s in (8.1) it is easy to see that A is mult-brk-1. We prove the other direction, so assume A ismult-brk-1. In particular, A is rectangular. Let A be the bipartization of some B ∈ C k × ( m − k ) forsome k ∈ [ m − B are nonzero. Let N ( i ) = { j | B i,j (cid:54) = 0 } denote the set ofneighbors of i ∈ [ k ]. If N ( i ) (cid:54) = N ( i (cid:48) ) for some i, i (cid:48) ∈ [ k ], since i and i (cid:48) are connected by a path, thereare successive vertices i = i, j , i , . . . , i (cid:96) = i (cid:48) , where i , i , . . . , i (cid:96) are on the LHS of the bipartitegraph, and for some s ∈ [ (cid:96) ] we have N ( i s ) (cid:54) = N ( i s +1 ) but they intersect. This violates A beingrectangular.So N ( i ) = N ( i (cid:48) ) for all i, i (cid:48) ∈ [ k ], and by A being connected it follows that N ( i ) = [ m − k ] forall i ∈ [ k ], i.e., all entries of B are nonzero.We are given some integer N ≥ A (cid:12) N is block-rank-1. It follows that B (cid:12) N has rank1. Let { g , . . . , g d } be a generating set for the entries of B . We can write B i,j = (cid:98) B i,j ζ i,j , where (cid:98) B i,j all belong to the torsion-free group generated by { g , . . . , g d } , and ζ i,j are roots of unity for i ∈ k and j ∈ [ m − k ]. Let N (cid:48) be the least common multiple of their orders. Since B (cid:12) N has rank1, all 2 by 2 submatrices of B (cid:12) N and thus of B (cid:12) NN (cid:48) have determinant 0. This implies that all 2by 2 submatrices of the matrix (cid:98) B = ( (cid:98) B i,j ) have determinant 0, since g , . . . , g d are multiplicativelyindependent. 47hus (cid:98) B = ( (cid:98) B i,j ) has rank 1. Writing (cid:98) B as a product of a column vector ( µ , . . . , µ k ) T and arow vector ( µ k +1 , . . . , µ m ), we get the form (8.1) for B . If we choose µ = 1, then the factorizationof B is unique, and all µ i belong to the multiplicative subgroup generated by { g , . . . , g d } . Proof of Theorem 9.2. Let A ∈ C m × m be a symmetric, connected, and nonbipartite matrix. Againif A is regularized nonbipartite, then it is easy to see that A is mult-brk-1. We prove the otherdirection, so assume A is mult-brk-1.Let A (cid:48) = (cid:18) AA (cid:19) be the bipartization of A , and by Property 3.8, A (cid:48) is mult-brk-1. We show A (cid:48) is connected sothat we can apply Theorem 8.2 to A (cid:48) . Since A is nonbipartite, there is an odd cycle. Since A is connected, for every i ∈ [ m ], there is a closed walk of odd length. Then for every i, j ∈ [ m ]there are both walks of odd length and even length, i = i , i , . . . , i s = j . This gives a walk in A (cid:48) between i and j of even length, and a walk in A (cid:48) between i and m + j of odd length. Now we applyTheorem 8.2 to A (cid:48) , and get an expression for A as in (8.1), where all µ i in (8.1) are nonzero, and allbelong to the multiplicative group G generated by { g , . . . , g d } , a generating set for the entries of A which must all be nonzero. As in the proof of Theorem 8.2 we can take µ = 1, then we can factorout µ k +1 (cid:54) = 0 (call it µ ), and rename the two sequences of diagonal values as µ = 1 , µ , . . . , µ m and ν = 1 , ν , . . . , ν m . They are all nonzero and all belong to G . So we have the following form: A = µ µ . . . µ m ζ , ζ , . . . ζ ,m ζ , ζ , . . . ζ ,m ... ... . . . ... ζ m, ζ m, . . . ζ m,m ν . . . ν m , where µ, µ , . . . , µ m , ν , . . . , ν m ∈ G , and ζ i,j are roots of unity. Since A is symmetric, we have µµ i ν j ζ i,j = µµ j ν i ζ j,i , for all i, j ∈ [ m ]. Since g , . . . , g d are multiplicatively independent, and( µ i ν j ) / ( µ j ν i ) ∈ G , we get ζ i,j = ζ j,i for all i, j ∈ [ m ]. Then µ i ν j = µ j ν i for all i, j ∈ [ m ]. Putting j = 1, we get µ i = ν i for all i ∈ [ m ]. 11 Proof of Theorem 8.3 In this section we adapt the proof from Section 8.1 of [6] to establish a connection between thesignature matrices M Γ , A and M Γ , C , D , for any edge gadget Γ, where A and ( C , D ) are related in aprecise way to be described in Definition 11.1. Essentially we will show that all the results fromSection 8.1 of [6] can be carried over to our setting.Let A be an m × m symmetric (but not necessarily bipartite) complex matrix, and let ( C , D )be a pair that satisfies the following condition ( T ):( T ) C is an n × n symmetric complex matrix.( T ) D = ( D [0] , . . . , D [ N − ) is a sequence of N n × n diagonal complex matrices for some N ≥ T ) Every diagonal entry in D [0] is a positive integer. Moreover, for each a ∈ [ n ], there existnonnegative integers α a, , . . . , α a,N − such that D [0] a = N − (cid:88) b =0 α a,b and D [ r ] a = N − (cid:88) b =0 α a,b · ω brN for all r ∈ [ N − α a, , . . . , α a,N − ) generates the a th entries of D . Definition 11.1 (Definition 8.1 from [6]) . Let R = { R a,b : a ∈ [ n ] , b ∈ [0 : N − } be a partitionof [ m ] ( note that any R a,b here may be empty ) such that for every a ∈ [ n ] , N − (cid:91) b =0 R a,b (cid:54) = ∅ . We say A can be generated by C using R if for all i, j ∈ [ m ] , A i,j = C a,a (cid:48) · ω b + b (cid:48) N , where i ∈ R a,b and j ∈ R a (cid:48) ,b (cid:48) . (11.1)Assuming ( C , D ) satisfies ( T ) and A is generated by C using R , it was shown in [6] that Z A ( G ) = Z C , D ( G ) for any undirected graph G . From this, EVAL( A ) ≡ EVAL( C , D ). This is thefollowing lemma, called the cyclotomic reduction lemma, in [6]. We will extend this to edge gadgetsin Lemma 11.3. Lemma 11.2 (cyclotomic reduction lemma (Lemma 8.2 from [6])) . Assume that ( C , D ) satisfies ( T ) with nonnegative integers α a,b . Let R = { R a,b } be a partition of [ m ] satisfying | R a,b | = α a,b and m = n (cid:88) a =1 N − (cid:88) b =0 α a,b ≥ n, and let A denote the matrix generated by C using R . Then EVAL ( A ) ≡ EVAL ( C , D ) . Given any pair ( C , D ) that satisfies ( T ), we prove the following lemma. Lemma 11.3 (cyclotomic transfer lemma for edge gadgets) . Assume that ( C , D ) satisfies ( T ) withnonnegative integers α a,b . Let R = { R a,b } be a partition of [ m ] satisfying | R a,b | = α a,b and m = n (cid:88) a =1 N − (cid:88) b =0 α a,b ≥ n, and let A denote the matrix generated by C using R . Let Γ = ( V, E ) be an edge gadget with twodistinguished vertices u ∗ and v ∗ (in this order), and let r = deg( u ∗ ) and r (cid:48) = deg( v ∗ ) . Then forany i, j ∈ [ m ] , M Γ , A ( i, j ) = ω rb + r (cid:48) b (cid:48) N M Γ , C , D ( a, a (cid:48) ) , where a, a (cid:48) ∈ [ n ] , R a,b (cid:51) i , R a (cid:48) ,b (cid:48) (cid:51) j are uniquelydetermined by ( i, j ) .Proof. We define a surjective map ρ from { ξ | ξ : V → [ m ] } to { η | η : V → [ n ] } . Let ξ : V → [ m ].Then η = ρ ( ξ ) is the following vertex assignment from V to [ n ]: For any v ∈ V , since R is a partitionof [ m ], there is a unique pair ( a ( v ) , b ( v )) such that ξ ( v ) ∈ R a ( v ) ,b ( v ) . Then let ρ ( ξ )( v ) = a ( v ), andwe also let ξ ( v ) = b ( v ). It is easy to check that ρ is surjective. We can write wt Γ , A ( ξ ) aswt Γ , A ( ξ ) = (cid:89) uv ∈ E A ξ ( u ) ,ξ ( v ) = (cid:89) uv ∈ E C η ( u ) ,η ( v ) · ω ξ ( u )+ ξ ( v ) N = (cid:89) uv ∈ E C η ( u ) ,η ( v ) · ω ξ ( u ) N · ω ξ ( v ) N . Fix i, j ∈ [ m ] and let i ∈ R a,b and j ∈ R a (cid:48) ,b (cid:48) . The ( i, j )th entry of the matrix M Γ , A is M Γ , A ( i, j ) = (cid:88) ξ : V → [ m ] ξ ( u ∗ )= i, ξ ( v ∗ )= j wt Γ , A ( ξ ) = (cid:88) η : V → [ n ] η ( u ∗ )= a, η ( v ∗ )= a (cid:48) (cid:88) ξ : V → [ m ] , ρ ( ξ )= ηξ ( u ∗ )= i, ξ ( v ∗ )= j wt Γ , A ( ξ ) . η : V → [ n ] with η ( u ∗ ) = a and η ( v ∗ ) = a (cid:48) , we have (cid:88) ξ : V → [ m ] , ρ ( ξ )= ηξ ( u ∗ )= i, ξ ( v ∗ )= j wt Γ , A ( ξ ) = (cid:89) uv ∈ E C η ( u ) ,η ( v ) × (cid:88) ξ : V → [ m ] , ρ ( ξ )= ηξ ( u ∗ )= i, ξ ( v ∗ )= j (cid:89) w ∈ V ω ξ ( w ) · deg( w ) N = (cid:89) uv ∈ E C η ( u ) ,η ( v ) × (cid:88) ξ : V → [ m ] , ρ ( ξ )= ηξ ( u ∗ )= i, ξ ( v ∗ )= j (cid:89) w ∈ V \{ u ∗ ,v ∗ } ω ξ ( w ) · deg( w ) N ω ξ ( u ∗ ) · deg( u ∗ ) N ω ξ ( v ∗ ) · deg( v ∗ ) N = (cid:89) uv ∈ E C η ( u ) ,η ( v ) × (cid:89) w ∈ V \{ u ∗ ,v ∗ } (cid:32) N − (cid:88) k =0 (cid:12)(cid:12) R η ( w ) ,k (cid:12)(cid:12) ω k · deg( w ) N (cid:33) ω b · rN ω b (cid:48) · r (cid:48) N = (cid:89) uv ∈ E C η ( u ) ,η ( v ) × (cid:89) w ∈ V \{ u ∗ ,v ∗ } D [deg( w ) mod N ] η ( w ) × ω br + b (cid:48) r (cid:48) N . Summing the above equality over all η : V → [ n ] with η ( u ∗ ) = a and η ( v ∗ ) = a (cid:48) , we obtain( M Γ , A )( i, j ) = (cid:88) η : V → [ n ] η ( u ∗ )= a, η ( v ∗ )= a (cid:48) (cid:89) uv ∈ E C η ( u ) ,η ( v ) × (cid:89) w ∈ V \{ u ∗ ,v ∗ } D [deg( w ) mod N ] η ( w ) × ω br + b (cid:48) r (cid:48) N = ω br + b (cid:48) r (cid:48) N M Γ , C , D ( a, a (cid:48) ) , and the lemma is proved.Given A and ( C , D ) as above, let A , C be the purifications of A , C , respectively. Then A isgenerated by C using the same R . If ( C , D ) satisfies condition ( T ), then so does the pair ( C , D ). Corollary 11.4. Under the conditions of Lemma 11.3, M Γ , A is mult-brk- (mod-brk- ) iff M Γ , C , D is mult-brk- (mod-brk- ). The same conclusion holds for M Γ , A and M Γ , C , D . We note that for the forward implicaiton in Corollary 11.4, the condition (cid:83) N − b =0 R a,b (cid:54) = ∅ iscrucial.From Corollary 11.4 and Theorem 6.1, we have the following corollary. Corollary 11.5 (inverse cyclotomic transfer lemma for edge gadgets) . Let A and ( C , D ) be asabove, satisfying condition ( T ) . Let A , C be the purifications of A , C , respectively. If Γ is anedge gadget, such that M Γ , C , D has a by submatrix (cid:18) M i,k M i,(cid:96) M j,k M j,(cid:96) (cid:19) that has no zero entries and | M i,k M j,(cid:96) | (cid:54) = | M i,(cid:96) M j,k | , then M Γ , C , D is not mod-brk- , and for some p ≥ , there is an edge gadget Γ (cid:48) = T p (Γ) , such that M Γ (cid:48) , A is not mult-brk- . Let A be a regularized bipartite matrix and let A be the purification of A obtained by going from agenerating set ( g , . . . , g d ) of nonzero entries of A to the d smallest primes ( p , . . . , p d ), d ≥ 0. Thereexist a positive integer N and six sequences µ , ν , µ , ν , m , and n such that ( A , ( N, µ , ν , m , n )),( A , ( N, µ , ν , m , n )) satisfy the following condition:50 S ) A is the bipartization of an m × n matrix B , so A is ( m + n ) × ( m + n ). µ = ( µ , . . . , µ s ) and ν = ( ν , . . . , ν t ) are two sequences, each consisting of pairwise distinct nonzero complex numberswhere s ≥ t ≥ µ , . . . , µ s , ν , . . . , ν t generate a torsion-free multiplicative group. m = ( m , . . . , m s ) and n = ( n , . . . , n t ) are two sequences of positive integers such that m = (cid:80) m i and n = (cid:80) n i . The rows of B are indexed by x = ( x , x ), where x ∈ [ s ] and x ∈ [ m x ]; thecolumns of B are indexed by y = ( y , y ), where y ∈ [ t ] and y ∈ [ n y ]. We have, for all x , y , B x , y = B ( x ,x ) , ( y ,y ) = µ x ν y S x , y , where S = { S x , y } is an m × n matrix in which every entry is a power of ω N : B = µ I m µ I m . . . µ s I m s S (1 , ∗ ) , (1 , ∗ ) S (1 , ∗ ) , (2 , ∗ ) . . . S (1 , ∗ ) , ( t, ∗ ) S (2 , ∗ ) , (1 , ∗ ) S (2 , ∗ ) , (2 , ∗ ) . . . S (2 , ∗ ) , ( t, ∗ ) ... ... . . . ... S ( s, ∗ ) , (1 , ∗ ) S ( s, ∗ ) , (2 , ∗ ) . . . S ( s, ∗ ) , ( t, ∗ ) ν I n ν I n . . . ν t I n t , where I k denotes the k × k identity matrix. B is the purification of B , A is the purification of A , and A is also the bipartization of B .We may assume µ = ( µ , . . . , µ s ) and ν = ( ν , . . . , ν t ), the purifications of µ and ν , respectively,are strictly decreasing sequences of positive rational numbers, by a simultaneous row and columnpermutation by the same permutation applied to both A and A . We have, for all x , y , B x , y = B ( x ,x ) , ( y ,y ) = µ x ν y S x , y , so that B = µ I m µ I m . . . µ s I m s S (1 , ∗ ) , (1 , ∗ ) S (1 , ∗ ) , (2 , ∗ ) . . . S (1 , ∗ ) , ( t, ∗ ) S (2 , ∗ ) , (1 , ∗ ) S (2 , ∗ ) , (2 , ∗ ) . . . S (2 , ∗ ) , ( t, ∗ ) ... ... . . . ... S ( s, ∗ ) , (1 , ∗ ) S ( s, ∗ ) , (2 , ∗ ) . . . S ( s, ∗ ) , ( t, ∗ ) ν I n ν I n . . . ν t I n t . Note that the matrix S consisting of roots of unity is the same for B and B .We let I = (cid:91) i ∈ [ s ] (cid:8) ( i, j ) : j ∈ [ m i ] (cid:9) and J = (cid:91) i ∈ [ t ] (cid:8) ( i, j ) : j ∈ [ n i ] (cid:9) , respectively. We use { } × I to index the first m rows (or columns) of A (and A ) and { } × J toindex the last n rows (or columns) of A (and A ). Given x ∈ I and j ∈ [ t ], we let S x , ( j, ∗ ) = (cid:0) S x , ( j, , . . . , S x , ( j,n j ) (cid:1) ∈ C n j denote the j th block of the x th row vector of S . Similarly, given y ∈ J and i ∈ [ s ], S ( i, ∗ ) , y = (cid:0) S ( i, , y , . . . , S ( i,m i ) , y (cid:1) ∈ C m i denotes the i th block of the y th column vector of S . Lemma 11.6 (modification of Lemma 8.5 from [6]) . Suppose ( A , ( N, µ , ν , m , n )) , ( A , ( N, µ , ν , m , n )) satisfy ( S ) . Then either there exists an edge gadget Γ such that M Γ , A is not mult-brk- , or ( A , ( N, µ , ν , m , n )) , ( A , ( N, µ , ν , m , n )) satisfy the following two conditions: vab pN − Figure 8: Gadget for constructing graph G [ p ] , p ≥ S ) For all x , x (cid:48) ∈ I , either there exists an integer k such that S x , ∗ = ω kN · S x (cid:48) , ∗ or for every j ∈ [ t ] , (cid:104) S x , ( j, ∗ ) , S x (cid:48) , ( j, ∗ ) (cid:105) = 0 . ( S ) For all y , y (cid:48) ∈ J , either there exists an integer k such that S ∗ , y = ω kN · S ∗ , y (cid:48) or for every i ∈ [ s ] , (cid:104) S ( i, ∗ ) , y , S ( i, ∗ ) , y (cid:48) (cid:105) = 0 .Proof. We adapt the proof for Lemma 8.5 from [6]. We prove ( S ) here; the proof of ( S ) is similar.Consider the edge gadget Γ [ p ] for each p ≥ [ p ] = ( V [ p ] , E [ p ] ) isdefined as follows: V [ p ] = (cid:8) u, v, a, b (cid:9) , where u, v are the distinguished vertices of Γ [ p ] (in this order) and E [ p ] contains the following edges:1. one edge ( u, a ) and ( b, v ) and2. ( pN − 1) parallel edges ( a, v ) and ( u, b ).The construction of Γ [ p ] gives us an ( m + n ) × ( m + n ) matrix A [ p ] = M Γ [ p ] , A .If there exists p ≥ 1, such that M Γ [ p ] , A is not mod-brk-1, then by Theorem 6.1, there exists (cid:96) ≥ 1, such that M T (cid:96) (Γ [ p ] ) , A is non-mult-brk-1 and we are done by taking Γ = T (cid:96) (Γ [ p ] ). So we mayassume that for all p ≥ A [ p ] = M Γ [ p ] , A is mod-brk-1.The entries of A [ p ] are as follows. First, A [ p ](0 , u ) , (1 , v ) = A [ p ](1 , v ) , (0 , u ) = 0 , for all u ∈ I and v ∈ J .So A [ p ] is a block diagonal matrix with two blocks of m × m and n × n , respectively. The entriesin the upper-left m × m block are A [ p ](0 , u ) , (0 , v ) = (cid:32)(cid:88) a ∈ J A (0 , u ) , (1 , a ) ( A (0 , v ) , (1 , a ) ) pN − (cid:33) (cid:32)(cid:88) b ∈ J ( A (0 , u ) , (1 , b ) ) pN − A (0 , v ) , (1 , b ) (cid:33) = (cid:32)(cid:88) a ∈ J B u , a ( B v , a ) pN − (cid:33) (cid:32)(cid:88) b ∈ J ( B u , b ) pN − B v , b (cid:33) for all u , v ∈ I . The first factor of the last expression is (cid:88) a ∈ J µ u ν a S u , a ( µ v ν a ) pN − S v , a = µ u µ pN − v (cid:88) i ∈ [ t ] ν pNi (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) . Similarly, we have for the second factor (cid:88) b ∈ J ( B u , b ) pN − B v , b = µ pN − u µ v (cid:88) i ∈ [ t ] ν pNi (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) . 52s a result, we have A [ p ](0 , u ) , (0 , v ) = ( µ u µ v ) pN (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:88) i ∈ [ t ] ν pNi (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) . It is clear that the upper-left m × m block of A [ p ] is nonnegative. This holds for its lower-right n × n block as well, so A [ p ] is a nonnegative matrix.Now let u (cid:54) = v be two arbitrary indices in I (if | I | = 1, ( S ) is trivially true); then we have A [ p ](0 , u ) , (0 , u ) A [ p ](0 , v ) , (0 , v ) = ( µ u µ v ) pN (cid:88) i ∈ [ t ] n i · ν pNi , which is positive, and A [ p ](0 , u ) , (0 , v ) A [ p ](0 , v ) , (0 , u ) = ( µ u µ v ) pN (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:88) i ∈ [ t ] ν pNi (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) . Since A [ p ] is mod-brk-1, (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:88) i ∈ [ t ] ν pNi (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ∈ , (cid:88) i ∈ [ t ] n i · ν pNi . (11.2)On the other hand, the following inequality always holds: For any p ≥ (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:88) i ∈ [ t ] ν pNi · (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ≤ (cid:88) i ∈ [ t ] n i · ν pNi . (11.3)If there exists p ≥ S must satisfy |(cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105)| = n i for all i ∈ [ t ] and thus S u , ( i, ∗ ) = ( ω N ) k i · S v , ( i, ∗ ) for some k i ∈ [0 : N − k i ’s must be the same. This is the first alternative in ( S ).Suppose (11.3) is a strict inequality for all p ≥ 1. Then from (11.2), (cid:88) i ∈ [ t ] ν pNi (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) = 0 for all p ≥ ν , . . . , ν t ) is strictly decreasing, these equations form a Vandermonde system. It follows that (cid:104) S u , ( i, ∗ ) , S v , ( i, ∗ ) (cid:105) = 0 for all i ∈ [ t ]. This is the second alternative in ( S ), which proves ( S ).In what follows, we assume ( A , ( N, µ , ν , m , n )) and ( A , ( N, µ , ν , m , n )) satisfy ( S ) , ( S ), and( S ).The proof of Lemma 11.6 was adapted from that of Lemma 8.5 in [6]. In fact, we will need toadapt many proofs from [6] in a similar fashion. In order to only highlight the essential point, weintroduce the following meta-argument . 53 rgument 11.7 ( Meta ) . We have the following:1. Either M Γ , A is mod-brk- for every edge gadget Γ , or there is an edge gadget Γ such that M Γ , A is not mod-brk- , so by Theorem 6.1, for some p ≥ , M T p (Γ) , A is not mult-brk- ;2. Referring to the matrix A from Section 8.2 in [6], all statements (including theorems, lemmas,corollaries, properties, etc. numbered from 8.5 to 8.7) from [6] can be proved under theassumption that every signature M Γ , A is mod-brk- , and whenever it is concluded that, as apossible scenario, EVAL( A ) is P-hard, this is because an edge gadget Γ has been constructedsuch that M Γ , A is not mod-brk- . This statement can be checked directly;3. Thus, in the notation of this paper, provided all the corresponding conditions for A (in placeof A from [6]) are satisfied, we can apply the corresponding reasoning from [6] for A andmake the corresponding conclusions for A . We have the following corollary, which is the same as Corollary 8.6 from [6]. Corollary 11.8. For all i ∈ [ s ] and j ∈ [ t ] , the ( i, j ) th block matrix S ( i, ∗ ) , ( j, ∗ ) of S has the samerank as S .Proof. The proof is the same as that of Corollary 8.6 from [6].Now suppose h = rank( S ). Then by Corollary 11.8, there must exist indices 1 ≤ i < . . . < i h ≤ m and 1 ≤ j < . . . < j h ≤ n such that the { (1 , i ) , . . . , (1 , i h ) } × { (1 , j ) , . . . , (1 , j h ) } submatrixof S has full rank h . Without loss of generality we assume i k = k and j k = k for all k ∈ [ h ] (ifthis is not true, we can apply an appropriate permutation Π to the rows and columns of A so thatthe new S has this property; this permutation is within the first block and so it does not affect themonotonicity of µ and ν ). We use H to denote this h × h matrix: H i,j = S (1 ,i ) , (1 ,j ) .By Corollary 11.8 and Lemma 11.6, for every index x ∈ I , there exists a unique pair of integers j ∈ [ h ] and k ∈ [0 : N − 1] such that S x , ∗ = ω kN · S (1 ,j ) , ∗ . (11.4)This gives us a partition of the index set { } × I : R = (cid:8) R (0 ,i,j ) ,k : i ∈ [ s ] , j ∈ [ h ] , k ∈ [0 : N − (cid:9) . For every x ∈ I , (0 , x ) ∈ R (0 ,i,j ) ,k if i = x and x , j, k satisfy (11.4). By Corollary 11.8, (cid:91) k ∈ [0: N − R (0 ,i,j ) ,k (cid:54) = ∅ for all i ∈ [ s ] and j ∈ [ h ].Similarly, for every index y ∈ J there exists a unique pair of integers j ∈ [ h ] and k ∈ [0 : N − S ∗ , y = ω kN · S ∗ , (1 ,j ) , (11.5)and we partition { } × J into R = (cid:8) R (1 ,i,j ) ,k : i ∈ [ t ] , j ∈ [ h ] , k ∈ [0 : N − (cid:9) . For every y ∈ J , (1 , y ) ∈ R (1 ,i,j ) ,k if i = y and y , j, k satisfy (11.5). By Corollary 11.8, (cid:91) k ∈ [0: N − R (1 ,i,j ) ,k (cid:54) = ∅ for all i ∈ [ t ] and j ∈ [ h ].54ow we define ( C , D ) and ( C , D ), and use the cyclotomic reduction lemma (Lemma 11.2) toshow that EVAL( A ) ≡ EVAL( C , D ) (and EVAL( A ) ≡ EVAL( C , D )), and use the cyclotomictransfer lemma for edge gadgets (Lemma 11.3) to show that for every edge gadget Γ, M Γ , A (resp., M Γ , A ) is mult-brk-1 iff M Γ , C , D (resp., M Γ , C , D ) is mult-brk-1. The same is true replacing mult-brk-1by mod-brk-1. This will allow us to move between the frameworks EVAL ( A ) (resp., EVAL ( A )) and EVAL ( C , D ) (resp., EVAL ( C , D )).First, C is an ( s + t ) h × ( s + t ) h matrix which is the bipartization of an sh × th matrix F . Weuse the set I (cid:48) ≡ [ s ] × [ h ] to index the rows of F and J (cid:48) ≡ [ t ] × [ h ] to index the columns of F . Wehave F x , y = µ x ν y H x ,y = µ x ν y S (1 ,x ) , (1 ,y ) for all x ∈ I (cid:48) , y ∈ J (cid:48) , or equivalently, F = µ I µ I . . . µ s I H H . . . HH H . . . H ... ... . . . ... H H . . . H ν I ν I . . . ν t I , where I is the h × h identity matrix. We use ( { } × I (cid:48) ) ∪ ( { } × J (cid:48) ) to index the rows and columnsof C .Second, D = ( D [0] , . . . , D [ N − ) is a sequence of N diagonal matrices of the same size as C . Weuse { } × I (cid:48) to index the first sh entries and { } × J (cid:48) to index the last th entries. The (0 , x )thentries of D are generated by ( | R (0 ,x ,x ) , | , . . . , | R (0 ,x ,x ) ,N − | ), and the (1 , y )th entries of D aregenerated by ( | R (1 ,y ,y ) , | , . . . , | R (1 ,y ,y ) ,N − | ): D [ r ](0 , x ) = N − (cid:88) k =0 (cid:12)(cid:12) R (0 ,x ,x ) ,k (cid:12)(cid:12) · ω krN and D [ r ](1 , y ) = N − (cid:88) k =0 (cid:12)(cid:12) R (1 ,y ,y ) ,k (cid:12)(cid:12) · ω krN , for all r ∈ [0 : N − , x = ( x , x ) ∈ I (cid:48) , and y = ( y , y ) ∈ J (cid:48) .The same purification producing the substitutions µ i → µ i for i ∈ [ s ] and ν i → ν i for i ∈ [ t ]goes from F to F , and from C to C , respectively the bipartizations of F and F .We have F x , y = µ x ν y H x ,y = µ x ν y S (1 ,x ) , (1 ,y ) for all x ∈ I (cid:48) , y ∈ J (cid:48) , or equivalently, F = µ I µ I . . . µ s I H H . . . HH H . . . H ... ... . . . ... H H . . . H ν I ν I . . . ν t I . This finishes the construction of ( C , D ) and ( C , D ). We prove the following lemma. Lemma 11.9 (modification of Lemma 8.7 from [6]) . The matrix A is generated from C using R ∪ R . As a consequence, EVAL( A ) ≡ EVAL( C , D ) and for any edge gadget Γ , M Γ , A is mult-brk- (mod-brk- ) iff M Γ , C , D is mult-brk- (mod-brk- ). The same statements hold with A and C replaced by A and C , respectively. roof. We only show that A can be generated from C using R ∪ R ; that A can be generatedfrom C using R ∪ R can be shown similarly.Let x , x (cid:48) ∈ I , (0 , x ) ∈ R (0 ,x ,j ) ,k , and (0 , x (cid:48) ) ∈ R (0 ,x (cid:48) ,j (cid:48) ) ,k (cid:48) . Then we have A (0 , x ) , (0 , x (cid:48) ) = C (0 ,x ,j ) , (0 ,x (cid:48) ,j (cid:48) ) = 0 , since A and C are the bipartizations of B and F , respectively, and the upper-left block is 0 in abipartization matrix. Therefore, it holds trivially that A (0 , x ) , (0 , x (cid:48) ) = C (0 ,x ,j ) , (0 ,x (cid:48) ,j (cid:48) ) · ω k + k (cid:48) N . Clearly, this also holds for the lower-right n × n block of A .Let x ∈ I , (0 , x ) ∈ R (0 ,x ,j ) ,k , y ∈ J , and (1 , y ) ∈ R (1 ,y ,j (cid:48) ) ,k (cid:48) for some j, k, j (cid:48) , k (cid:48) . By (11.4) and(11.5), we have A (0 , x ) , (1 , y ) = µ x ν y S x , y = µ x ν y S (1 ,j ) , y · ω kN = µ x ν y S (1 ,j ) , (1 ,j (cid:48) ) · ω k + k (cid:48) N = C (0 ,x ,j ) , (1 ,y ,j (cid:48) ) · ω k + k (cid:48) N . A similar equation also holds for the lower-left block. Thus, A can be generated from C using R ∪ R . Moreover, the construction of D implies that D can be generated from the partition R ∪ R .Now to obtain the remaining statements, we apply Lemma 11.2 and Corollary 11.4 to Lemma 11.3.Before moving forward to the next step, we summarize our progress so far. We showed thateither there is an edge gadget Γ such that M Γ , A is not mult-brk-1 or we can construct a pair ( C , D )along with a pair ( C , D ) such that EVAL( A ) ≡ EVAL( C , D ) and EVAL( A ) ≡ EVAL( C , D ).Furthermore, for any edge gadget Γ, M Γ , A is mult-brk-1 (mod-brk-1) iff M Γ , C , D is mult-brk-1(mod-brk-1), and the same is true for A and C in place of A and C , respectively, and ( C , D ),( C , D ) also satisfy the following conditions ( Shape )–( Shape ):( Shape ) C ∈ C m × m is the bipartization of an sh × th matrix F (so m = ( s + t ) h ; this m isdifferent from the m used at the beginning of Step 2.1). F has s × t blocks of h × h each, and weuse I = [ s ] × [ h ] and J = [ t ] × [ h ] to index the rows and columns of F , respectively. F and C arepurifications of F and C , respectively.( Shape ) There are two sequences µ = ( µ , . . . , µ s ) and ν = ( ν , . . . , ν t ), each consisting of pair-wise distinct nonzero complex numbers. µ , . . . , µ s , ν , . . . , ν t generate a torsion-free multiplicativegroup. There is also an h × h full-rank matrix H whose entries are all powers of ω N for somepositive integer N . The entries of F can be expressed using µ , ν , and H explicitly as follows: F x , y = µ x ν y H x ,y for all x ∈ I and y ∈ J .Moreover, the purification substitutes µ i → µ i for i ∈ [ s ] and ν i → ν i for i ∈ [ t ], and goes from F to F , and from C to C , respectively. µ = ( µ , . . . , µ s ) and ν = ( ν , . . . , ν t ) are strictly decreasingsequences of positive rational numbers. The entries of F can be expressed using µ , ν , and H explicitly as follows: F x , y = µ x ν y H x ,y for all x ∈ I and y ∈ J .56 Shape ) D = ( D [0] , . . . , D [ N − ) is a sequence of m × m diagonal matrices. We use ( { } × I ) ∪ ( { } × J ) to index the rows and columns of the matrices C (and C ) and D [ r ] . D satisfies ( T ), sofor all r ∈ [ N − x ∈ [ s ] × [ h ], and y ∈ [ t ] × [ h ], D [ r ](0 , x ) = D [ N − r ](0 , x ) and D [ r ](1 , y ) = D [ N − r ](1 , y ) . We introduce the following second meta-argument. Argument 11.10 ( Meta ) . We have the following:1. Either M Γ , C , D (equiv., M Γ , A ) is mod-brk- for every edge gadget Γ , or there is an edge gadget Γ such that M Γ , C , D (equiv., M Γ , A by Lemma 11.9) is not mod-brk- , so by Theorem 6.1, forsome p ≥ , M T p (Γ) , A is not mult-brk- ;2. Referring to the pair ( C , D ) from Section 8.3 in [6], all statements (including theorems,lemmas, corollaries, properties, etc. numbered from 8.8 to 8.23) from [6] can be proved underthe assumption that every signature M Γ , C , D is mod-brk- , and whenever it is concluded that,as a possible scenario, EVAL( C , D ) is P-hard, this is because an edge gadget, say, Γ hasbeen constructed such that M Γ , C , D is not mod-brk- . This statement can be checked directly;3. Thus, in the notation of this paper, provided all the corresponding conditions for ( C , D ) (inplace of ( C , D ) from [6]) are satisfied, we can apply the corresponding reasoning from [6] for ( C , D ) and make the corresponding conclusions for ( C , D ) . In Step 2.2, we prove the following lemma. Lemma 11.11 (modification of Lemma 8.8 from [6]) . Either there is an edge gadget Γ such that M Γ , A is not mult-brk- or H and D [0] satisfy the following two conditions: ( Shape ) (1 / √ h ) · H is a unitary matrix, i.e., (cid:104) H i, ∗ , H j, ∗ (cid:105) = (cid:104) H ∗ ,i , H ∗ ,j (cid:105) = 0 , for all i (cid:54) = j ∈ [ h ] . ( Shape ) D [0] satisfies, for all x ∈ I and for all y ∈ J , D [0](0 , x ) = D [0](0 , ( x , and D [0](1 , y ) = D [0](1 , ( y , . Proof. We rearrange the entries of D [0] indexed by { } × J into a t × h matrix X i,j = D [0](1 , ( i,j )) for all i ∈ [ t ] and j ∈ [ h ] (11.6)and rearrange its entries indexed by { } × I into an s × h matrix Y i,j = D [0](0 , ( i,j )) for all i ∈ [ s ] and j ∈ [ h ]. (11.7)Note that by condition ( T ), all entries of X and Y are positive integers.The proof has two stages. First, we show in Lemma 11.12 that either we can construct an edgegadget Γ such that M Γ , A is not mult-brk-1 or H , X and Y must satisfy (cid:104) H i, ∗ ◦ H j, ∗ , X k, ∗ (cid:105) = 0 for all k ∈ [ t ] and i (cid:54) = j ∈ [ h ] and (11.8) (cid:104) H ∗ ,i ◦ H ∗ ,j , Y k, ∗ (cid:105) = 0 for all k ∈ [ s ] and i (cid:54) = j ∈ [ h ]. (11.9)57e use U to denote the set of h -dimensional vectors that are orthogonal to H , ∗ ◦ H , ∗ , H , ∗ ◦ H , ∗ , . . . , H , ∗ ◦ H h, ∗ . The above set of h − h (cid:88) i =2 a i (cid:0) H , ∗ ◦ H i, ∗ (cid:1) = H , ∗ ◦ (cid:32) h (cid:88) i =2 a i H i, ∗ (cid:33) , and if (cid:80) hi =2 a i ( H , ∗ ◦ H i, ∗ ) = , then (cid:80) hi =2 a i H i, ∗ = since all entries of H , ∗ are nonzero. Because H has full rank, we have a i = 0, i = 2 , . . . , h . As a result, U is a linear space of dimension 1 over C . Second, we show in Lemma 11.13 that, assuming (11.8) and (11.9), either (cid:104) H i, ∗ ◦ H j, ∗ , ( X k, ∗ ) (cid:105) = 0 for all k ∈ [ t ] and i (cid:54) = j ∈ [ h ] and (11.10) (cid:104) H ∗ ,i ◦ H ∗ ,j , ( Y k, ∗ ) (cid:105) = 0 for all k ∈ [ s ] and i (cid:54) = j ∈ [ h ], (11.11)or we can construct an edge gadget Γ such that M Γ , A is not mult-brk-1. Here we use ( X k, ∗ ) todenote X k, ∗ ◦ X k, ∗ .Equations (11.8) and (11.10) then imply that both X k, ∗ and ( X k, ∗ ) are in U and thus they arelinearly dependent (since the dimension of U is 1). On the other hand, by ( T ), every entry in X k, ∗ is a positive integer. Therefore, X k, ∗ must have the form u · , for some positive integer u . Thesame argument works for Y k, ∗ and the latter must also have the form u (cid:48) · . By (11.8) and (11.9),this further implies that (cid:104) H i, ∗ , H j, ∗ (cid:105) = 0 and (cid:104) H ∗ ,i , H ∗ ,j (cid:105) = 0 for all i (cid:54) = j ∈ [ h ].This finishes the proof of Lemma 11.11.Now we proceed to the two stages of the proof. In the first stage, we prove the following lemma.Given ( C , D ) and ( C , D ) that satisfy conditions ( Shape )–( Shape ), let X and Y be defined in(11.6) and (11.7). Lemma 11.12 (modification of Lemma 8.9 from [6]) . Either H , X , Y satisfy (11.8) and (11.9) , orthere exists an edge gadget Γ such that M Γ , A is not mult-brk- .Proof. We adapt the proof of Lemma 8.9 from [6] but with ( C , D ) in place of ( C , D ) in [6]. It iseasy to see that ( C , D ) satisfies the conditions needed for the proof of Lemma 8.9 from [6], and sodo our H , X , Y derived from ( C , D ). We use the same edge gadget Γ = Γ [ p ] , for some p ≥ 1, inFigure 8, and get a signature matrix M Γ , C , D . By Corollary 11.5, either we get an edge gadget Γsuch that M Γ , C , D is not mod-brk-1, or the same equation (8.13) in [6] holds for our matrix M Γ , C , D .Thus (and this is essentially our Argument 11.10 ( Meta ) in action), we get that1. either our H , X , Y satisfy equations (11.8) and (11.9) (which are (8.8) and (8.9) from [6]),2. or there exists an edge gadget Γ (cid:48) = T (cid:96) (Γ), for some (cid:96) ≥ 1, such that M Γ (cid:48) , A is not mult-brk-1.All subsequent arguments invoking Argument 11.10 ( Meta ) follow a similar vein.In the second stage, we prove the following lemma.58 emma 11.13 (modification of Lemma 8.10 from [6]) . Suppose matrices H , X , and Y satisfy both (11.8) and (11.9) . Then either they also satisfy (11.10) and (11.11) or there exists an edge gadget Γ such that M Γ , A is not mult-brk- .Proof. We adapt the proof of Lemma 8.10 from [6] and apply it to ( C , D ) in place of ( C , D ) in [6].It is easy to see that ( C , D ) satisfies the conditions needed for the proof of Lemma 8.10 from [6],and so do our H , X , Y derived from ( C , D ). We use the same edge gadget Γ = Γ [ p ] , for some p ≥ u and v (in this order), andget a signature matrix R ( p ) = M Γ , C , D . By Corollary 11.5, either we get an edge gadget Γ such that R ( p ) is not mod-brk-1, or the same equations concerning R ( p ) in [6] (p. 963) hold for our matrix aswell. Thus by Argument 11.10 ( Meta ), we get that1. either our H , X , Y satisfy equations (11.10) and (11.11) (which are (8.10) and (8.11) from [6]),2. or there exists an edge gadget Γ (cid:48) = T (cid:96) (Γ), for some (cid:96) ≥ 1, such that M Γ (cid:48) , A is not mult-brk-1. Now we get pairs ( C , D ), ( C , D ) that satisfy ( Shape )–( Shape ). We can use ( Shape ) to express D [0] in a tensor product form. We define two diagonal matrices K [0] and L [0] as follows. K [0] is an( s + t ) × ( s + t ) diagonal matrix. We use (0 , i ), i ∈ [ s ], to index its first s rows and (1 , j ), j ∈ [ t ],to index its last t rows. Its diagonal entries are K [0](0 ,i ) = D [0](0 , ( i, and K [0](1 ,j ) = D [0](1 , ( j, , for all i ∈ [ s ] and j ∈ [ t ]. L [0] is the 2 h × h identity matrix. We use (0 , i ), i ∈ [ h ], to index its first h rows and (1 , j ), j ∈ [ h ],to index its last h rows. By ( Shape ), we have D [0](0 , x ) = K [0](0 ,x ) · L [0](0 ,x ) and D [0](1 , y ) = K [0](1 ,y ) · L [0](1 ,y ) (11.12)for all x ∈ I and y ∈ J , or equivalently, D [0] = (cid:32) D [0](0 , ∗ ) D [0](1 , ∗ ) (cid:33) = (cid:32) K [0](0 , ∗ ) ⊗ L [0](0 , ∗ ) K [0](1 , ∗ ) ⊗ L [0](1 , ∗ ) (cid:33) . (11.13)The goal of Step 2.3 is to prove a similar statement for D [ r ] , r ∈ [ N − EVAL ( C , D ) into two subproblems.In the proof of Lemma 11.11, we crucially used the property (from ( T )) that all the diagonalentries of D [0] are positive integers. However, for r ≥ 1, ( T ) only gives us some very weak propertiesabout D [ r ] . For example, the entries are not guaranteed to be real numbers. So the proof in [6] forStep 2.3 is difficult. However, our proof here simply follows Step 2.3 in [6] and use Argument 11.10( Meta ). We prove the following lemma. Lemma 11.14 (modification of Lemma 8.11 from [6]) . Let ( C , D ) be a pair that satisfies ( Shape )–( Shape ) . Then either there exists an edge gadget Γ such that M Γ , A is not mult-brk- or we havethe following additional condition: Shape ) There exist diagonal matrices K [0] and L [0] such that D [0] , K [0] , and L [0] satisfy (11.13) . Every entry of K [0] is a positive integer, and L [0] is the h × h identity matrix. Foreach r ∈ [ N − , there exist two diagonal matrices K [ r ] and L [ r ] . K [ r ] is an ( s + t ) × ( s + t ) matrix,and L [ r ] is a h × h matrix. We index K [ r ] and L [ r ] in the same way we index K [0] and L [0] ,respectively. Then D [ r ] = (cid:32) D [ r ](0 , ∗ ) D [ r ](1 , ∗ ) (cid:33) = (cid:32) K [ r ](0 , ∗ ) ⊗ L [ r ](0 , ∗ ) K [ r ](1 , ∗ ) ⊗ L [ r ](1 , ∗ ) (cid:33) . Moreover, the norm of every entry in L [ r ] is either or , and for any r ∈ [ N − , K [ r ](0 , ∗ ) = ⇐⇒ L [ r ](0 , ∗ ) = and K [ r ](1 , ∗ ) = ⇐⇒ L [ r ](1 , ∗ ) = ; L [ r ](0 , ∗ ) (cid:54) = = ⇒ ∃ i ∈ [ h ] , L [ r ](0 ,i ) = 1 and L [ r ](1 , ∗ ) (cid:54) = = ⇒ ∃ i ∈ [ h ] , L [ r ](1 ,i ) = 1 . We now present the proof of Lemma 11.14. Fix an r ∈ [ N − 1] to be any index. We use thefollowing notation. Consider the diagonal matrix D [ r ] . It has two parts: D [ r ](0 , ∗ ) ∈ C sh × sh and D [ r ](1 , ∗ ) ∈ C th × th . The first part has s blocks, where each block is a diagonal matrix with h entries. We will rearrangethe entries indexed by (0 , ∗ ) into another s × h matrix, which we denote as D (just as we did with D [0] in the proof of Lemma 11.11), where D i,j = D [ r ](0 , ( i,j )) for all i ∈ [ s ] and j ∈ [ h ].We first prove the following lemma by ( Meta ), and then use it to prove Lemma 11.14. Lemma 11.15 (modification of Lemma 8.12 from [6]) . Either there exists an edge gadget Γ suchthat M Γ , A is not mult-brk- , or we have(1) rank( D ) ≤ and(2) for each i ∈ [ s ] , all nonzero entries of D i, ∗ have the same norm.Proof of Lemma 11.15. In [6], Lemma 8.13 (vanishing lemma) was first proved in Section 8.4.1.This is a general lemma not specific to EVAL -problems, and remains valid in our setting. Thenthe proof of Lemma 8.12 is given in Section 8.4.2 in [6]. Let C be the purification of C which isobtained corresponding to the purification going from A to A . We apply the proof of Lemma 8.12from [6] to ( C , D ) in place of ( C , D ) from [6]. It is easy to see that ( C , D ) satisfies the conditionsneeded for the proof of Lemma 8.12 from [6]. We use the same gadget sequence Γ [ n ] as depicted inFigure 8.3 (p. 967 of [6]) with distinguished vertices u and v (in this order), and get a sequence ofsignature matrices R [ n ] = M Γ [ n ] , C , D . By going through the argument in [6], e.g., for Property 8.14(p. 969) we use Corollary 11.5 to reach the same conclusion. It follows that either we get an edgegadget Γ [ n ] for some n ≥ 1, such that R [ n ] is not mod-brk-1, or the two items (1) and (2) in thestatement of Lemma 11.15 hold.Thus by Argument 11.10 ( Meta ), either 1. there exists an edge gadget Γ (cid:48) = T (cid:96) (Γ [ n ] ) for some n, (cid:96) ≥ 1, such that M Γ (cid:48) , A is not mult-brk-1, or 2. rank( D ) ≤ i ∈ [ s ], all nonzeroentries of our D i, ∗ have the same norm. Proof of Lemma 11.14. Lemma 11.14 follows from Lemma 11.15 in the same way as Lemma 8.11follows from Lemma 8.12 (see p. 965 in [6]). 60 After Step 2.3, we obtain pairs ( C , D ) and ( C , D ) that satisfy conditions ( Shape )–( Shape ). By( Shape ), we have C = (cid:18) T (cid:19) = (cid:18) ⊗ H ( M ⊗ H ) T (cid:19) , where M is an s × t matrix of rank 1, M i,j = µ i ν j , and H is the h × h matrix defined in ( Shape ).By ( Shape ), we also have C = (cid:18) T (cid:19) = (cid:18) ⊗ H ( M ⊗ H ) T (cid:19) , where M , the purification of M obtained by respectively going from µ and ν to µ and ν is also an s × t matrix of rank 1, M i,j = µ i ν j . By ( Shape ) and ( Shape ), we have for every r ∈ [0 : N − D [ r ] = (cid:32) D [ r ](0 , ∗ ) D [ r ](1 , ∗ ) (cid:33) = (cid:32) K [ r ](0 , ∗ ) ⊗ L [ r ](0 , ∗ ) K [ r ](1 , ∗ ) ⊗ L [ r ](1 , ∗ ) (cid:33) . Every entry in L [ r ] either is 0 or has norm 1 and L [0] is the 2 h × h identity matrix.Thus C , C and D [ r ] are all expressed in a tensor product form. We now define three new EVAL problems by defining three pairs ( C (cid:48) , K ), ( C (cid:48) , K ) and ( C (cid:48)(cid:48) , L ). These give a decompositionof both problems EVAL ( C , D ) and EVAL ( C , D ) as a respective tensor product of two problems,an outer problem EVAL ( C (cid:48) , K ) for EVAL ( C , D ), and EVAL ( C (cid:48) , K ) for EVAL ( C , D ), and a common inner problem EVAL ( C (cid:48)(cid:48) , L ).More specifically, we define EVAL ( C (cid:48) , K ), EVAL ( C (cid:48) , K ) and EVAL ( C (cid:48)(cid:48) , L ) as follows. First, C (cid:48) isthe bipartization of M , so it is ( s + t ) × ( s + t ), and K is a sequence of N diagonal matrices also ofthis size: ( K [0] , . . . , K [ N − ). Also, C (cid:48) is the bipartization of M , so it is ( s + t ) × ( s + t ). Second, C (cid:48)(cid:48) is the bipartization of H , and it is 2 h × h , and L is the sequence of N diagonal matrices:( L [0] , . . . , L [ N − ).Next, we prove a lemma that essentially reduces EVAL ( C , D ) to its inner problem EVAL ( C (cid:48)(cid:48) , L ).This is a weakened version of Lemma 8.24 in [6], and it will only be used in our tractability proof.(The proof for Lemma 11.16 (weakened form of Lemma 8.24 from [6]) . EVAL( C , D ) ≤ EVAL ↔ ( C (cid:48)(cid:48) , L ) . More-over, EVAL → ( C , D ) ≤ EVAL → ( C (cid:48)(cid:48) , L ) and EVAL ← ( C , D ) ≤ EVAL ← ( C (cid:48)(cid:48) , L ) . The same is truefor ( C , D ) replacing ( C , D ) .Proof. We only prove for ( C , D ); the proof for ( C , D ) is the same. Let G be a connected undirectedgraph and let u ∗ be one of its vertices. Then by Property 2.5 and Lemma 2.6, we have Z C , D ( G ) = Z → C , D ( G, u ∗ ) + Z ← C , D ( G, u ∗ ) ,Z → C , D ( G, u ∗ ) = Z → C (cid:48) , K ( G, u ∗ ) · Z → C (cid:48)(cid:48) , L ( G, u ∗ ) , and Z ← C , D ( G, u ∗ ) = Z ← C (cid:48) , K ( G, u ∗ ) · Z ← C (cid:48)(cid:48) , L ( G, u ∗ ) . M has rank 1, both Z → C (cid:48) , K and Z ← C (cid:48) , K can be computed in polynomial time. We only prove for Z → C (cid:48) , K here. If G is not bipartite, Z → C (cid:48) , K ( G, u ∗ ) is trivially 0; otherwise let U ∪ V be the vertex setof G , u ∗ ∈ U , and every edge uv ∈ E has one vertex u from U and one vertex v from V . Let Ξdenote the set of assignments ξ which map U to [ s ] and V to [ t ]. Then (note that we use K [ r ] todenote K [ r mod N ] for any r ≥ N ) Z → C (cid:48) , K ( G, u ∗ ) = (cid:88) ξ ∈ Ξ (cid:32) (cid:89) uv ∈ E µ ξ ( u ) · ν ξ ( v ) (cid:33) (cid:32) (cid:89) u ∈ U K [deg( u )](0 ,ξ ( u )) (cid:33) (cid:32) (cid:89) v ∈ V K [deg( v )](1 ,ξ ( v )) (cid:33) = (cid:89) u ∈ U (cid:88) i ∈ [ s ] ( µ i ) deg( u ) · K [deg( u )](0 ,i ) × (cid:89) v ∈ V (cid:88) j ∈ [ t ] ( ν j ) deg( v ) · K [deg( v )](1 ,j ) , which can be computed in polynomial time. The lemma then follows.In [6], the proof of Lemma 8.24 uses Claim 8.25. We now prove a version of Claim 8.25 for edgegadgets, whereby we can circumvent Lemma 8.24 of [6]. Our version of Claim 8.25 is about thepurified ( C (cid:48) , D ).Let Γ = ( U ∪ V, E ) be a connected, bipartite edge gadget with distinguished vertices u ∗ , v ∗ (inthis order). In Claim 11.17 we assume u ∗ , v ∗ belong to the same bipartite part, say, u ∗ , v ∗ ∈ U .Thus, M Γ , C , D has the form M Γ , C , D = (cid:32) M [0]Γ , C , D M [1]Γ , C , D (cid:33) . The proof is easily adapted to the case if u ∗ ∈ U and v ∗ ∈ V . Claim 11.17 (modification of Claim 8.25 from [6]) . For any Γ as above, there is a connected,bipartite edge gadget Γ (cid:48) = ( U (cid:48) ∪ V (cid:48) , E (cid:48) ) with distinguished vertices u ∗ , v ∗ (in this order) such that u ∗ , v ∗ ∈ U ⊂ U (cid:48) and V ⊂ V (cid:48) , and M Γ (cid:48) , C (cid:48)(cid:48) , L = h | U ∪ V |− · M Γ , C (cid:48)(cid:48) , L . (11.14) For any i ∈ { , } , if M [ i ]Γ , C (cid:48)(cid:48) , L (cid:54) = , then we can choose Γ (cid:48) so that M [ i ]Γ (cid:48) , C (cid:48) , K has no zero entries.Proof. Let U = U \ { u ∗ , v ∗ } . We construct a bipartite edge gadget Γ (cid:48) = ( U (cid:48) ∪ V (cid:48) , E (cid:48) ) withparameters (cid:96) u ∈ [ s ] , (cid:96) v ∈ [ t ] to be determined shortly, for all u ∈ U , v ∈ V . First, U (cid:48) = U ∪ (cid:98) V and V (cid:48) = V ∪ (cid:99) U , where (cid:98) V = { (cid:98) v : v ∈ V } and (cid:99) U = { (cid:98) u : u ∈ U } . We make u ∗ , v ∗ the first and seconddistinguished vertices in Γ (cid:48) , respectively. The edge set E (cid:48) contains E over U ∪ V , and the followingedges: (cid:96) u N parallel edges between u and (cid:98) u , for every u ∈ U , and (cid:96) v N parallel edges between v and (cid:98) v , for every v ∈ V . Clearly, Γ (cid:48) is a connected and bipartite edge gadget. For each u ∈ U (and v ∈ V ), we use r u (and r v ) to denote its degree in Γ. Then in Γ (cid:48) the degrees of u ∈ U (and v ∈ V )are congruent to r u (and r v ) mod N , while the degrees of (cid:98) u ∈ (cid:99) U and (cid:98) v ∈ (cid:98) V are all congruent to 0mod N .To prove (11.14), we take any x, y ∈ [ h ]. Let η be an assignment that maps U and V to [ h ]such that η ( u ∗ ) = x and η ( v ∗ ) = y . Given η , let Ξ denote the set of assignments ξ over U (cid:48) ∪ V (cid:48) that map U (cid:48) and V (cid:48) to [ h ] and that satisfy ξ ( u ) = η ( u ) for all u ∈ U (so ξ ( u ∗ ) = x and ξ ( v ∗ ) = y )62nd ξ ( v ) = η ( v ) for all v ∈ V . Recall that in the definition of wt Γ (cid:48) , C (cid:48)(cid:48) , L ( ξ ) (see Defintion 2.10) thevertex weights of u ∗ and v ∗ are excluded. We have (cid:88) ξ ∈ Ξ wt Γ (cid:48) , C (cid:48)(cid:48) , L ( ξ ) = (cid:88) ξ ∈ Ξ (cid:89) uv ∈ E H η ( u ) ,η ( v ) (cid:89) u ∈ U ( H η ( u ) ,ξ ( (cid:98) u ) ) (cid:96) u N (cid:89) v ∈ V ( H ξ ( (cid:98) v ) ,η ( v ) ) (cid:96) v N × (cid:89) u ∈ U L [ r u ](0 ,η ( u )) L [0](1 ,ξ ( (cid:98) u )) (cid:32) (cid:89) v ∈ V L [ r v ](1 ,η ( v )) L [0](0 ,ξ ( (cid:98) v )) (cid:33) = (cid:88) ξ ∈ Ξ wt Γ , C (cid:48)(cid:48) , L ( η ) = h | (cid:99) U ∪ (cid:98) V | · wt Γ , C (cid:48)(cid:48) , L ( η ) . The second equation uses the fact that the entries of H are powers of ω N (thus ( H i,j ) N = 1) and L [0] is the identity matrix. It follows that the ( x, y )th entry of the signature matrix is M [0]Γ (cid:48) , C (cid:48)(cid:48) , L ( x, y ) = h | U ∪ V |− · M [0]Γ , C (cid:48)(cid:48) , L ( x, y )for each x, y ∈ [ h ]. The same proof works for M [1]Γ (cid:48) , C (cid:48)(cid:48) , L = h | U ∪ V |− · M [1]Γ , C (cid:48)(cid:48) , L by exchanging L [ r ](0 , ∗ ) with L [ r ](1 , ∗ ) in the above derivation. This proves (11.14).Now let M [ i ]Γ , C (cid:48)(cid:48) , L (cid:54) = for some i ∈ { , } . Without loss of generality assume M [0]Γ , C (cid:48)(cid:48) , L (cid:54) = . Forany u ∈ U , if K [ r u ](0 , ∗ ) = , then by condition ( Shape ), L [ r u ](0 , ∗ ) = as well. Then M [0]Γ , C (cid:48)(cid:48) , L = , acontradiction. So K [ r u ](0 , ∗ ) (cid:54) = for all u ∈ U . Similarly K [ r v ](1 , ∗ ) (cid:54) = , for all v ∈ V . (Note that thesestatements are also vacuously true if U = ∅ or V = ∅ .) Next we wish to choose (cid:96) u ∈ [ s ] for each u ∈ U , such that (cid:88) i ∈ [ s ] µ (cid:96) u N + r u i · K [ r u ](0 ,i ) (cid:54) = 0 . (11.15)If for all (cid:96) u ∈ [ s ] an equality holds in (11.15), this is a full-ranked Vandermonde system since µ > . . . > µ s > 0, which would force K [ r u ](0 , ∗ ) = , a contradiction. Thus for each u ∈ U , some (cid:96) u ∈ [ s ] can be chosen so that (11.15) holds. (It is also vacuously true if U = ∅ .) Similarly, foreach v ∈ V , we can choose (cid:96) v ∈ [ t ] such that (cid:88) i ∈ [ t ] ν (cid:96) v N + r v i · K [ r v ](1 ,i ) (cid:54) = 0 . (11.16)(Again, (11.16) is vacuously true if V = ∅ .)We use these parameters (cid:96) u , (cid:96) v in the construction of Γ (cid:48) .Next we prove M [0]Γ (cid:48) , C (cid:48) , K has no zero entries. For each x, y ∈ [ s ], we have (the sum is over all ξ U (cid:48) to [ s ], V (cid:48) to [ t ] and satisfy ξ ( u ∗ ) = x , ξ ( v ∗ ) = y ) M [0]Γ (cid:48) , C (cid:48) , K ( x, y ) = (cid:88) ξ (cid:89) uv ∈ E M ξ ( u ) ,ξ ( v ) (cid:89) u ∈ U M (cid:96) u Nξ ( u ) ,ξ ( (cid:98) u ) (cid:89) v ∈ V M (cid:96) v Nξ ( (cid:98) v ) ,ξ ( v ) × (cid:89) u ∈ U K [ r u ](0 ,ξ ( u )) K [0](1 ,ξ ( (cid:98) u )) (cid:32) (cid:89) v ∈ V K [ r v ](1 ,ξ ( v )) K [0](0 ,ξ ( (cid:98) v )) (cid:33) = µ r u ∗ x µ r v ∗ y (cid:89) u ∈ U (cid:88) i ∈ [ s ] µ (cid:96) u N + r u i · K [ r u ](0 ,i ) (cid:89) v ∈ V (cid:88) i ∈ [ t ] ν (cid:96) v N + r v i · K [ r v ](1 ,i ) × (cid:89) (cid:98) u ∈ (cid:99) U (cid:88) i ∈ [ t ] ν (cid:96) u Ni · K [0](1 ,i ) (cid:89) (cid:98) v ∈ (cid:98) V (cid:88) i ∈ [ s ] µ (cid:96) v Ni · K [0](0 ,i ) . It is nonzero for each x, y ∈ [ s ]: The first two factors are nonzero because µ x , µ y > 0; the middletwo factors are nonzero because of the way we picked (cid:96) u and (cid:96) v ; the latter two factors are nonzerobecause µ i , ν i > 0, and by ( Shape ), every entry of K [0] is a positive integer. (The middle twofactors are also nonzero even in the case U = ∅ or V = ∅ , as a product over an empty index set is1. The same is true for the last two factors.)If M [1]Γ , C (cid:48)(cid:48) , L (cid:54) = , then M [1]Γ (cid:48) , C (cid:48) , K has no zero entries. This can be proved by exchanging K [ r ](0 , ∗ ) with K [ r ](1 , ∗ ) in (11.15) and in (11.16). Corollary 11.18. Let Γ be an edge gadget such that M Γ , C (cid:48)(cid:48) , L is not mult-brk- (not mod-brk- ).Then there is a connected edge gadget Γ (cid:48) such that M Γ (cid:48) , C , D is not mult-brk- (not mod-brk- ).Proof. Let u ∗ , v ∗ be the first and second distinguished vertices of Γ, respectively. By Lemma 3.10, u ∗ , v ∗ lie in the same connected component of Γ, call it Γ , and M Γ , C (cid:48)(cid:48) , L is not mult-brk-1 (mod-brk-1), and so without loss of generality we may assume Γ = Γ . It is also immediate that Γ is abipartite edge gadget for otherwise M Γ , C (cid:48)(cid:48) , L = 0 which cannot be non-mult-brk-1 (non-mod-brk-1). We consider the case when u ∗ , v ∗ are in the same bipartite component of Γ; the other case issimilar. Since M Γ , C (cid:48)(cid:48) , L is not mult-brk-1 (not mod-brk-1), by Property 3.7, for some i ∈ { , } , M [ i ]Γ , C (cid:48)(cid:48) , L is not mult-brk-1 (not mod-brk-1), which is certainly nonzero. By Claim 11.17, there isa connected bipartite edge gadget Γ (cid:48) such that M [ i ]Γ (cid:48) , C (cid:48)(cid:48) , L is not mult-brk-1 (not mod-brk-1) for thesame i ∈ { , } , as demonstrated by (11.14). Also by Claim 11.17, for this i ∈ { , } , M [ i ]Γ (cid:48) , C (cid:48) , K (cid:54) = .We have M [ i ]Γ (cid:48) , C , D = M [ i ]Γ (cid:48) , C (cid:48) , K ⊗ M [ i ]Γ (cid:48) , C (cid:48)(cid:48) , L . By Property 3.9, M [ i ]Γ (cid:48) , C , D is not mult-brk-1 (not mod-brk-1). We are almost done with Step 2. It is (a normalized version of) the inner pair ( C (cid:48)(cid:48) , L ) that will berenamed ( C , D ) that fulfills the requirements in Theorem 8.3. The only conditions ( U i ) that are64ossibly violated by ( C (cid:48)(cid:48) , L ) are ( U ) ( N might be odd) and ( U ) ( H i, and H ,j might not be 1).We deal with ( U ) first.What we will do below is to normalize H (in C (cid:48)(cid:48) ), so that it becomes a discrete unitary matrixfor some positive integer M that divides N , while preserving the following: • Item 1. The complexity of EVAL → ( C (cid:48)(cid:48) , L ), EVAL ← ( C (cid:48)(cid:48) , L ) (and thus of EVAL ↔ ( C (cid:48)(cid:48) , L )); • Item 2. The validity of the condition M Γ , C (cid:48)(cid:48) , L is or is not mult-brk-1 (mod-brk-1) where Γ isany connected edge gadget.First, without loss of generality, we may assume H satisfies H , = 1 since otherwise we candivide H by H , , which does not affect the desired requirements. Then we construct the followingpair: ( X , Y ). X is the bipartization of an h × h matrix over C , whose ( i, j )th entry is H i,j H ,j H i, = H i,j / ( H ,j H i, ); Y is a sequence ( Y [0] , . . . , Y [ N − ) of 2 h × h diagonal matrices; Y [0] is the identitymatrix. Let S = { r ∈ [0 : N − 1] : L [ r ](0 , ∗ ) (cid:54) = } and T = { r ∈ [0 : N − 1] : L [ r ](1 , ∗ ) (cid:54) = } ;then we have Y [ r ](0 , ∗ ) = for all r / ∈ S and Y [ r ](1 , ∗ ) = for all r / ∈ T .For each r ∈ S (or r ∈ T ), by ( Shape ) there must be an a r ∈ [ h ] (or b r ∈ [ h ], resp.) such that the(0 , a r )th entry of L [ r ] is 1 (or the (1 , b r )th entry of L [ r ] is 1, resp.). Set Y [ r ](0 ,i ) = L [ r ](0 ,i ) (cid:18) H i, H a r , (cid:19) r for all i ∈ [ h ]; Y [ r ](1 ,j ) = L [ r ](1 ,j ) (cid:18) H ,j H ,b r (cid:19) r for all j ∈ [ h ].For the purpose of Item 1, we show that EVAL → ( C (cid:48)(cid:48) , L ) ≡ EVAL → ( X , Y ). Let G = ( U ∪ V, E ) bea connected bipartite undirected graph and let u ∗ be a vertex in U . For every r ∈ S (and r ∈ T ),we use U r ⊆ U (and V r ⊆ V , resp.) to denote the set of vertices with degree r mod N . It is clearthat if U r (cid:54) = ∅ for some r / ∈ S or if V r (cid:54) = ∅ for some r / ∈ T , both Z → C (cid:48)(cid:48) , L ( G, u ∗ ) and Z → X , Y ( G, u ∗ ) aretrivially zero. Otherwise, we have Z → C (cid:48)(cid:48) , L ( G, u ∗ ) = (cid:32)(cid:89) r ∈S ( H a r , ) r | U r | (cid:33) (cid:32) (cid:89) r ∈T ( H ,b r ) r | V r | (cid:33) · Z → X , Y ( G, u ∗ ) . So the problem of computing Z → X , Y is reducible to computing Z → C (cid:48)(cid:48) , L and vice versa. (Here we usethe fact the entries of H being powers of ω N are all nonzero.) In other words, EVAL → ( C (cid:48)(cid:48) , L ) ≡ EVAL → ( X , Y ). Similarly, we can prove EVAL ← ( C (cid:48)(cid:48) , L ) ≡ EVAL ← ( X , Y ). We conclude thatEVAL ↔ ( C (cid:48)(cid:48) , L ) ≡ EVAL ↔ ( X , Y ). This finishes Item 1.Now, for the purpose of Item 2, we show that for every connected edge gadget Γ, M Γ , C (cid:48)(cid:48) , L is mult-brk-1 (mod-brk-1) iff M Γ , X , Y is mult-brk-1 (mod-brk-1). Clearly, if Γ is not bipartite, then both M Γ , C (cid:48)(cid:48) , L and M Γ , X , Y are zero matrices and we are done. Thus we may assume that Γ is bipartite.As in Claim 11.17, we identify an edge gadget with its underlying graph. Let Γ = ( U ∪ V, E ) be aconnected bipartite edge gadget with distinguished vertices u ∗ , v ∗ (in this order). We consider thecase when u ∗ , v ∗ lie in the same bipartite part of Γ, say, u ∗ , v ∗ ∈ U . The case when u ∗ , v ∗ lie indifferent bipartite parts of Γ can be done similarly.First, we show that M [0]Γ , C (cid:48)(cid:48) , L is mult-brk-1 (mod-brk-1) iff M [0]Γ , X , Y is mult-brk-1 (mod-brk-1).Let r = deg( u ∗ ) and r = deg( v ∗ ). For every r ∈ S (and r ∈ T ), we use U r ⊆ U \ { u ∗ , v ∗ } (and V r ⊆ V , resp.) to denote the set of vertices with degree r mod N . It is clear that if U r (cid:54) = ∅ for65ome r / ∈ S or if V r (cid:54) = ∅ for some r / ∈ T , both M [0]Γ , C (cid:48)(cid:48) , L and M [0]Γ , X , Y are trivially zero matrices andwe are done. Otherwise, for each i, j ∈ [ h ], we have M [0]Γ , C (cid:48)(cid:48) , L ( i, j ) = ( H i, ) r ( H j, ) r (cid:32)(cid:89) r ∈S ( H a r , ) r | U r | (cid:33) (cid:32) (cid:89) r ∈T ( H ,b r ) r | V r | (cid:33) · M [0]Γ , X , Y ( i, j ) , where ( H i, ) r , ( H j, ) r (cid:54) = 0 (these two extra factors are due to the fact that vertex weights of u ∗ , v ∗ are not included in the signature matrices) and (cid:32)(cid:89) r ∈S ( H a r , ) r | U r | (cid:33) (cid:32) (cid:89) r ∈T ( H ,b r ) r | V r | (cid:33) (cid:54) = 0 . It follows that M [0]Γ , C (cid:48)(cid:48) , L is mult-brk-1 (mod-brk-1) iff M [0]Γ , X , Y is mult-brk-1 (mod-brk-1). Similarly, M [1]Γ , C (cid:48)(cid:48) , L is mult-brk-1 (mod-brk-1) iff M [1]Γ , X , Y is mult-brk-1 (mod-brk-1). From this, by Prop-erty 3.7, we conclude that M Γ , C (cid:48)(cid:48) , L is mult-brk-1 (mod-brk-1) iff M Γ , X , Y is mult-brk-1 (mod-brk-1).This finishes Item 2.One can verify that ( X , Y ) satisfies ( U )–( U ), except that N might be odd. In particular, theupper-right h × h block of X is an M -discrete unitary matrix for some positive integer M | N , and Y satisfies both ( U ) and ( U ) (which uses the fact that every entry of H is a power of ω N ).If N is even, then we are done with Step 2; otherwise we extend Y to be Y (cid:48) = { Y [0] , . . . , Y [ N − , Y [ N ] , . . . , Y [2 N − } , where Y [ r ] = Y [ r − N ] , for all r ∈ [ N : 2 N − EVAL → ( X , Y ) ≡ EVAL → ( X , Y (cid:48) ), since Z X , Y ( G ) = Z X , Y (cid:48) ( G ), for all undirected G , and similarly EVAL ← ( X , Y ) ≡ EVAL ← ( X , Y (cid:48) ). Thissatisfies Item 1. We also have M Γ , X , Y = M Γ , X , Y (cid:48) for all edge gadgets Γ. This satisfies Item 2. Sothe new tuple (( M, N ) , X , Y (cid:48) ) satisfies conditions ( U )–( U ).We state the above results for ( X , Y ), which is a normalization of ( C (cid:48)(cid:48) , L ). Lemma 11.19. EVAL → ( C (cid:48)(cid:48) , L ) ≡ EVAL → ( X , Y ) and EVAL ← ( C (cid:48)(cid:48) , L ) ≡ EVAL ← ( X , Y ) . As aconsequence, EVAL ↔ ( C (cid:48)(cid:48) , L ) ≡ EVAL ↔ ( X , L ) . Lemma 11.20. For any connected edge gadget Γ , we have M Γ , C (cid:48)(cid:48) , L is mult-brk- (mod-brk- ) iff M Γ , X , Y is mult-brk- (mod-brk- ). As a corollary, we have the following. Corollary 11.21. Let Γ be an edge gadget (not necessarily connected). If M Γ , X , Y is not mult-brk- (not mod-brk- ), then there is a connected edge gadget Γ (cid:48) such that M Γ (cid:48) , C (cid:48)(cid:48) , L is not mult-brk- (notmod-brk- ).Proof. Let u ∗ , v ∗ be the first and second distinguished vertices of Γ, correspondingly. By Lemma 3.10, u ∗ , v ∗ lie in the same connected component Γ of Γ and M Γ , X , Y is not mult-brk-1 (mod-brk-1).Taking Γ (cid:48) = Γ , we are done by Lemma 11.20.Combining Lemmas 11.9, 11.16 and 11.19, we obtain the following corollary. Corollary 11.22. EVAL( A ) ≤ EVAL ↔ ( X , Y ) . T p (Γ), where p ≥ 1, is alsoconnected. Corollary 11.23. Let Γ be an edge gadget (not necessarily connected). If M Γ , X , Y is not mult-brk- (not mod-brk- ), then there is a connected edge gadget Γ (cid:48) such that M Γ (cid:48) , A is not mult-brk- . Since ( X , Y ) already satisfies ( U )–( U ), Corollaries 11.22 and 11.23 finalize the proof of Theo-rem 8.3.We now rename ( C , D ) to be the pair ( X , Y ), which satisfies Theorem 8.3. 12 Proofs of Theorem 8.4 and Theorem 8.6 Let (( M, N ) , C , D ) be a tuple that satisfies ( U )–( U ) and let F ∈ C m × m be the upper-right blockof C . In this section, we index the rows and columns of an n × n matrix with [0 : n − Meta ). This ( Meta ) resembles ( Meta ) ata superficial level; however remember that past Step 2 the pair ( C , D ) that satisfies Theorem 8.3is the inner pair from Step 2, which is distinct from the pairs ( C , D ) and ( C , D ) referred to in( Meta ). In particular, the C of the inner pair is the bipartization of a square matrix H (nowredenoted as F ) consisting of roots of unity only, and clearly already purified (so here there is noseparate C ). Argument 12.1 ( Meta ) . We have the following:1. Either M Γ , C , D is mod-brk- for every edge gadget Γ , or there is an edge gadget Γ such that M Γ , C , D is not mod-brk- ;2. Referring to the pair ( C , D ) from Section 9 in [6], all statements from Section 9 throughSection 11 in [6] (including theorems, lemmas, corollaries, properties, etc. numbered from9.1 to 11.2) can be proved under the assumption that every signature M Γ , C , D is mod-brk- and whenever it is concluded that, as a possible scenario, EVAL( C , D ) is P-hard, this isbecause an edge gadget, say, Γ has been constructed such that M Γ , C , D is not mod-brk- . Thisstatement can be checked directly;3. Thus, provided our ( C , D ) satisfies all the corresponding conditions for ( C , D ) in [6], wecan apply the corresponding reasoning from [6] to our ( C , D ) and make the correspondingconclusions. We first show that either F satisfies the following condition or there exists an edge gadget Γ suchthat M Γ , C , D is not mod-brk-1: Lemma 12.2 (modification of Lemma 9.1 from [6]) . Let (( M, N ) , C , D ) be a tuple that satisfies ( U ) – ( U ) . Then either F satisfies the group condition ( GC ) , (row- GC ) for all i, j ∈ [0 : m − , ∃ k ∈ [0 : m − such that F k, ∗ = F i, ∗ ◦ F j, ∗ ; (column- GC ) for all i, j ∈ [0 : m − , ∃ k ∈ [0 : m − such that F ∗ ,k = F ∗ ,i ◦ F ∗ ,j ,or there exists an edge gadget Γ such that M Γ , C , D is not mod-brk- . roof. We prove this lemma by Argument 12.1 ( Meta ) adapting the proof of Lemma 9.1 from [6].The following details can be noted. The proof of Lemma 9.1 in [6] uses a family of gadgetsparameterized by p ≥ 1; the gadget for p = 1 is depicted in Figure 9.1 (p. 981 in [6]). We usethe same gadgets. Let Γ [ p ] , where p ≥ 1, denote these edge gadgets. Then in [6] for the obtainedmatrices A [ p ] , where p ≥ 1, it was noted that Z A [ p ] ( G ) = Z C , D ( G [ p ] ) for all G , where G [ p ] is thegraph obtained by replacing every edge of G by Γ [ p ] . This uses the fact that in Γ [ p ] the distinguishedvertices are each of degree divisible by N , and D [0] = I m . Thus in terms of signature matrices, A [ p ] = M Γ [ p ] , C , D for our ( C , D ), for all p ≥ ( GC ) , or we can exhibit an edge gadgetΓ [ p ] for some p ≥ 1, for which the signature matrix A [ p ] = M Γ [ p ] , C , D is not mod-brk-1.Similar remarks can be formulated in all subsequent arguments involving Argument 12.1 ( Meta ).Next we prove a property concerning discrete unitary matrices that satisfy ( GC ). Given an n × n matrix A , let A R denote the set of its row vectors { A i, ∗ } and A C denote the set of its columnvectors { A ∗ ,j } . For general matrices, it is possible that | A R | , | A C | < n , since A may have duplicaterows or columns. But if A is M -discrete unitary, then it is clear that | A R | = | A C | = n . Property 12.3 (Property 9.2 from [6]) . If A ∈ C n × n is an M -discrete unitary matrix that satisfies ( GC ) , then A R and A C are finite Abelian groups ( of order n ) under the Hadamard product.Proof. The proof is the same as that of Property 9.2 from [6]. In this section, we prove Theorem 8.4 by showing that ( U )–( U ) indeed imply ( U ).Assume for any edge gadget Γ, M Γ , C , D is mod-brk-1; otherwise we are done. By Lemma 12.2,(( M, N ) , C , D ) satisfies ( GC ). Fixing r to be any index in [ N − U ) for the ( i, i )thentries of D [ r ] , where i ∈ [ m : 2 m − D [ r ] is similar. For simplicity,let D be the m -dimensional vector such that D i = D [ r ] m + i for all i ∈ [0 : m − . Also let K = { i ∈ [0 : m − 1] : D i (cid:54) = 0 } . If | K | = 0, then there is nothing to prove; if | K | = 1, thenby ( U ), the only nonzero entry in D must be 1. So we assume | K | ≥ U ), it suffices to prove that D i is a root of unity for every i ∈ K . Lemma 12.4 (Lemma 9.3 from [6]) . If D ∈ Q ( ω N ) is a root of unity, then D must be a power of ω N . Next we show that every D i , i ∈ K , is a root of unity. Suppose for a contradiction that this is nottrue. The next lemma is Lemma 9.4 from [6], and the same proof works. Define Z = ( Z , . . . , Z m − ),where Z i = ( D i ) N . Lemma 12.5 (Lemma 9.4 from [6]) . Suppose there is a k ∈ K such that Z k is not a root of unity.Then there exists an infinite integer sequence { P n } such that when n → ∞ , the vector sequence (( Z k ) P n : k ∈ K ) approaches, but never reaches, the all-one vector | K | . Meta ) adapting the reasoning after the proof of Lemma 9.4from Section 9.2 in [6] to prove Theorem 8.4. The following details can be noted. The proof in [6]uses a family of gadgets parameterized by p ≥ 1; this gadget family is depicted in Figure 9.2 (p. 985in [6]). We use the same gadgets. Let Γ [ p ] , where p ≥ 1, denote these edge gadgets. Then in [6]for the obtained matrices A [ p ] , where p ≥ 1, it was noted that Z A [ p ] ( G ) = Z C , D ( G [ p ] ) for all G ,where G [ p ] is the graph obtained by replacing every edge of G by Γ [ p ] . This uses the fact that inΓ [ p ] the distinguished vertices are each of degree divisible by N , and D [0] = I m . Thus in terms ofsignature matrices, A [ p ] = M Γ [ p ] , C , D for our ( C , D ), for all p ≥ [ p ] for some p ≥ 1, for which the signature matrix A [ p ] = M Γ [ p ] , C , D is not mod-brk-1. The same sequence of Lemma 9.5, Property 9.6, and Lemma 9.7 in [6] (with the same proof) nowimplies our Theorem 8.6. For the reader’s convenience we restate these here.Suppose (( M, N ) , C , D ) satisfies ( U )–( U ) and ( GC ); otherwise there exists an edge gadget Γsuch that M Γ , C , D is not mod-brk-1. Lemma 12.6 (Lemma 9.5 from [6]) . Let F ∈ C m × m be an M -discrete unitary matrix that satisfies ( GC ) , where M = pq , p, q > , and gcd( p, q ) = 1 . Then there exist two permutations Π and Σ over [0 : m − such that F Π , Σ = F (cid:48) ⊗ F (cid:48)(cid:48) , where F (cid:48) is a p -discrete unitary matrix, F (cid:48)(cid:48) is a q -discreteunitary matrix, and both of them satisfy ( GC ) . Property 12.7 (Property 9.6 from [6]) . Let A be an M -discrete unitary matrix that satisfies thegroup condition ( GC ) . If M is a prime power, then one of its entries is equal to ω M . Lemma 12.8 (Lemma 9.7 from [6]) . Let F ∈ C m × m be an M -discrete unitary matrix that satisfies ( GC ) . Moreover, M = p k is a prime power for some k ≥ . Then there exist two permutations Π and Σ such that F Π , Σ = F M ⊗ F (cid:48) , where F (cid:48) is an M (cid:48) -discrete unitary matrix, M (cid:48) = p k (cid:48) for some k (cid:48) ≤ k , and F (cid:48) satisfies ( GC ) . Theorem 8.6 then follows. 13 Proof of Theorem 8.8 As described in Section 8.3.2, after Theorem 8.6 is proved, we may assume that we have a 4-tuple (( M, N ) , C , D , ( p , t , Q )) that satisfies condition ( R ). Also we may assume that M Γ , C , D ismod-brk-1 for every edge gadget Γ; otherwise, we are done.The purpose of Section 10 in [6] is to prove Theorem 5.8 in [6]. We have the correspondingstatement, Theorem 8.8. (Note that starting from Section 12, ( C , D ) is the same in this paper asthe ( C , D ) in [6] starting from Section 9.) Lemma 10.1 from [6] is still valid without change, whichgives a direct product form for Λ r and ∆ r , once it is proved that they are indeed cosets in Z Q .This is stated in Conditions ( L ) and ( L ), respectively.The main content of Theorem 5.8 in [6] is to prove that Λ r and ∆ r are indeed cosets in Z Q , for all r ∈ [ N − C , D ) is M Γ , C , D is mod-brk-1 for every edge gadget Γ. To this end, we apply Argument 12.1( Meta ) to adapt the proof of Theorem 5.8 in Section 10 of [6], now for Theorem 8.8.69he following details can be noted. The proof in Section 10 of [6] uses an edge gadget, whichwe will denote by Γ = Γ r , one for each fixed r ∈ T ; this gadget is depicted in Figure 10.1 (p. 992in [6]). We use the same gadget Γ. In [6] for the obtained matrix A corresponding to Γ (this A isnot to be confused with the beginning matrix A that gives rise to the pair ( C , D )), it was notedthat Z A ( G ) = Z C , D ( G (cid:48) ), for all G , where G (cid:48) is the graph obtained by replacing every edge of G by Γ. This uses the fact that in Γ the distinguished vertices are each of degree divisible by N , and D [0] = I m . Thus in terms of signature matrices, this new matrix A = M Γ , C , D for our ( C , D ).Then just as in [6], we either get the desired properties, or for the edge gadget Γ, the signaturematrix M Γ , C , D is not mod-brk-1. Similarly we can prove for ∆ r , for r ∈ S .This allows the rest of the proof on pp. 992–994 from [6] to go through. In particular, wemay repeat the proofs of Lemmas 10.2 and 10.3 from [6] (these have no direct relation to edgegadgets) and finally finish the proof of Theorem 8.8, showing that ( L ), ( L ) hold. That ( L ) holdsis concluded at the end of Section 8.3.3. Now that we have proved Theorem 8.8, we know that either there exists an edge gadget Γ suchthat M Γ , C , D is not mod-brk-1, or we may assume that ( L ) holds. Thus, Λ r and ∆ r are cosets. Thenext is Corollary 10.4 from [6]; the same proof works. Corollary 13.1 (Corollary 10.4 from [6]) . Let H be the m × | ∆ r | submatrix obtained from F byrestricting to the columns indexed by ∆ r . Then for any two rows H u , ∗ and H v , ∗ , where u , v ∈ Z Q ,either there exists some α ∈ Z M such that H u , ∗ = ω αM · H v , ∗ or (cid:104) H u , ∗ , H v , ∗ (cid:105) = 0 .Similarly we denote by G the | Λ r | × m submatrix obtained from F by restricting to the rowsindexed by Λ r . Then for any two columns G ∗ , u and G ∗ , v , where u , v ∈ Z Q , either there exists an α ∈ Z M such that G ∗ , u = ω αM · G ∗ , v or (cid:104) G ∗ , u , G ∗ , v (cid:105) = 0 . As part of a discrete unitary matrix F , all columns { H ∗ , u | u ∈ ∆ r } of H must be orthogonal andthus rank( H ) = | ∆ r | . We denote by n the cardinality | ∆ r | . There must be n linearly independentrows in H . We may start with b = and assume the n vectors b = , b , . . . , b n − ∈ Z Q arethe indices of a set of linearly independent rows. By Corollary 13.1, these must be orthogonal asrow vectors (over C ). Since the rank of the matrix H is exactly n , it is clear that all other rowsmust be a multiple of these rows, since the only alternative is to be orthogonal to them all, byCorollary 13.1 again, which is absurd. A symmetric statement for G also holds. 14 Proof of Theorem 8.9 Let (( M, N ) , C , D , ( p , t , Q )) be a tuple that satisfies ( R ) and ( L ) including ( L ). We also assumethat M Γ , C , D is mod-brk-1 for every edge gadget Γ. By ( L ), we have Λ r = (cid:81) si =1 Λ r,i for every r ∈ S and ∆ r = (cid:81) si =1 ∆ r,i for every r ∈ T , where both Λ r,i and ∆ r,i are cosets in Z q i .The purpose of Section 11 in [6] is to prove Theorem 5.9 in [6]. We have the correspondingstatement, Theorem 8.9, which is to establish a quadratic structure of the nonzero entries of thediagonal matrices D [ r ] , more specifically, for the first half entries of D [ r ] when r ∈ S , and the secondhalf entries of D [ r ] when r ∈ T . Below we prove ( D ) and ( D ). The other parts, i.e., ( D ) and( D ), of Theorem 8.9 are proved similarly.Let G denote the | Λ r | × m submatrix of F whose row set is Λ r ⊆ Z Q . The following lemma isLemma 11.1 from [6], and remains valid in our setting with the same proof. Let n = | Λ r | ≥ (cid:13).(cid:13).(cid:13) .(cid:13).(cid:13).(cid:13).(cid:13).(cid:13).(cid:13) .(cid:13).(cid:13).(cid:13) x(cid:13) y(cid:13) v(cid:13)u(cid:13)w(cid:13) z(cid:13)w(cid:13)'(cid:13) z(cid:13)'(cid:13)d(cid:13) d(cid:13) d(cid:13) d(cid:13) r(cid:13)+(cid:13)1(cid:13) b(cid:13)a(cid:13) c(cid:13) a(cid:13) c(cid:13) a(cid:13) N(cid:13)-(cid:13)1(cid:13) c(cid:13) N(cid:13)-(cid:13)1(cid:13) d(cid:13)'(cid:13) d(cid:13)'(cid:13) d(cid:13)'(cid:13) d(cid:13)'(cid:13) b(cid:13)a(cid:13) c(cid:13) a(cid:13) c(cid:13) a(cid:13) N(cid:13)-(cid:13)1(cid:13) c(cid:13) N(cid:13)-(cid:13)1(cid:13) '(cid:13) '(cid:13) '(cid:13) '(cid:13) '(cid:13) '(cid:13) '(cid:13) N(cid:13)-(cid:13)1(cid:13) (cid:13) (cid:13)e(cid:13)d(cid:13)g(cid:13)e(cid:13)s(cid:13)1(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)e(cid:13)d(cid:13)g(cid:13)e(cid:13) Figure 9: The gadget Γ [1] with distinguished vertices u and v . Lemma 14.1 (Lemma 11.1 from [6]) . There exist vectors b = , b , . . . , b n − ∈ Z Q such that1. { G ∗ , b i : i ∈ [0 : n − } forms an orthogonal basis;2. for all b ∈ Z Q , ∃ i ∈ [0 : n − and α ∈ Z M such that G ∗ , b = ω αM · G ∗ , b i ;3. let A i be the set of b ∈ Z Q s.t. G ∗ , b is linearly dependent on G ∗ , b i ; then | A | = | A | = . . . = | A n − | = m/n. A symmetric statement also holds for the m × | ∆ r | submatrix of F whose column set is ∆ r ,where we replace n = | Λ r | by | ∆ r | .We use Argument 12.1 ( Meta ) adapting the proof in Section 11 in [6] to prove Theorem 8.9.The following details can be noted. The proof in Section 11 of [6] uses an edge gadget construction,one for each r ∈ S , which is described on pp. 996–997. This gadget Γ [1] with distinguished vertices u and v (in this order), reproduced here in Figure 9, was Figure 11.1 in [6]. The actual gadget usedin the proof is to take two copies of Γ [1] , and identify the respective copies of the vertices u, v, x, y .We will call it Γ = Γ [2] , and will use it in the proof of Theorem 8.9. In [6] for the obtained matrix A corresponding to Γ (again this A is not to be confused with the beginning matrix A that givesrise to the pair ( C , D )), it was noted that Z A ( G ) = Z C , D ( G [2] ), for all G , where G [2] is the graphobtained by replacing every edge of G by Γ. This uses the fact that in Γ the distinguished vertices71re each of degree divisible by N , and D [0] = I m . Thus in terms of signature matrices, this new A = M Γ , C , D for our ( C , D ). Then just as in [6] we either get the desired properties, or for the edgegadget Γ, the signature matrix M Γ , C , D is not mod-brk-1. The key facts in this derivation in [6]are the expression for A (0 , u ) , (0 , v ) in equation (11.3) and the assertion in (11.5) on page 999. UsingArgument 12.1 ( Meta ), we derive the same equations here.The rest of the proof (on pp. 997–1001) from [6] all go through. In particular, we may repeatthe proofs of Lemma 11.2 from [6] and finally prove Theorem 8.9. 15 Tractability: Proof of Theorem 8.10 In this section we describe the proof of Theorem 8.10. identical to the tractability proof of Section 12in [6]. This technical point is our avoidance of using the so-called pinning lemmas in [6] (especiallyfor the so-called second pinning lemma (Lemma 4.3 from [6]), which we painstakingly avoided,because we could not find a constructive proof of it and , later in the paper we will claim ourdichotomy in this paper is effective, which requires this constructivity). Thus, if a reader is notconcerned with this effectiveness, one can safely skip this section, and simply use the proof in [6].Let (( M, N ) , C , D , ( p , t , Q )) be a tuple that satisfies ( R ), ( L ), ( D ). We show that EVAL ↔ ( C , D )is tractable by reducing it to the following problem. Let q = p k be a prime power for some prime p and positive integer k . The input of EVAL ( q ) is a quadratic polynomial f ( x , x , . . . , x n ) = (cid:80) i,j ∈ [ n ] a i,j x i x j , where a i,j ∈ Z q for all i, j , and the output is Z q ( f ) = (cid:88) x ,...,x n ∈ Z q ω f ( x ,...,x n ) q . In [6] the following theorem is shown. Theorem 15.1 (Theorem 12.1 from [6]) . Let q be a prime power. Then EVAL ( q ) can be solved inpolynomial time ( in n , the number of variables ) . The reduction goes as follows. First, we use conditions ( R ) , ( L ) and ( D ) to show that EVAL ↔ ( C , D )can be decomposed into s smaller problems, where s is the number of primes in the sequence p : EVAL ↔ ( C [1] , D [1] ) , . . . , EVAL ↔ ( C [ s ] , D [ s ] ) . If each of these s problems is tractable, then so is EVAL ↔ ( C , D ). Second, we reduce each EVAL ↔ ( C [ i ] , D [ i ] ) to EVAL ( q ) for some appropriate primepower q that will become clear later. It follows from Theorem 15.1 that all EVAL ↔ ( C [ i ] , D [ i ] )’s canbe solved in polynomial time. For each integer i ∈ [ s ], we define a 2 m i × m i matrix C [ i ] where m i = | Z q i | : C [ i ] is the bipartizationof the following m i × m i matrix F [ i ] , where F [ i ] x , y = (cid:89) j ∈ [ t i ] ω x j y j q i,j for all x = ( x , . . . , x t i ) , y = ( y , . . . , y t i ) ∈ Z q i . (15.1)We index the rows and columns of F [ i ] by x ∈ Z q i and index the rows and columns of C [ i ] by { , } × Z q i . We let x j , j ∈ [ t i ], denote the j th entry of x ∈ Z q i,j . By ( R ), F x , y = F [1] x , y · F [2] x , y · · · F [ s ] x s , y s for all x , y ∈ Z Q . (15.2)72or each integer i ∈ [ s ], we define a sequence of N m i × m i diagonal matrices D [ i ] = (cid:0) D [ i, , . . . , D [ i,N − (cid:1) . D [ i, is the 2 m i × m i identity matrix; for every r ∈ [ N − D [ i,r ](0 , ∗ ) = if r / ∈ S and D [ i,r ](0 , x ) = D [ r ](0 , ext r ( x )) for all x ∈ Z q i if r ∈ S ; D [ i,r ](1 , ∗ ) = if r / ∈ T and D [ i,r ](1 , x ) = D [ r ](1 , ext (cid:48) r ( x )) for all x ∈ Z q i if r ∈ T . By conditions ( D ) and ( D ), we have D [ r ]( b, x ) = D [1 ,r ]( b, x ) · · · D [ s,r ]( b, x s ) for all b ∈ { , } and x ∈ Z Q . (15.3)Equation (15.3) is valid for all x ∈ Z Q . For example, for b = 0 and x ∈ Z Q − Λ r , the left-hand sideis 0 because x / ∈ Λ r . The right-hand side is also 0, because there exists an index i ∈ [ s ] such that x i / ∈ Λ r,i and thus ext r ( x i ) / ∈ Λ r . It then follows from (15.1), (15.3), and the following lemma thatif EVAL ↔ ( C [ i ] , D [ i ] ) is in polynomial time for all i ∈ [ s ], then EVAL ↔ ( C , D ) is also in polynomialtime. Lemma 15.2 (modification of Lemma 12.2 from [6]) . Suppose we have the following matrices: foreach i ∈ { , , } , C [ i ] is the bipartization of an m i × m i complex matrix F [ i ] ; D [ i ] = ( D [ i, , . . . , D [ i,N − ) is a sequence of N m i × m i diagonal matrices for some N ≥ , where D [ i,r ] = (cid:18) P [ i,r ] Q [ i,r ] (cid:19) and P [ i,r ] and Q [ i,r ] are m i × m i diagonal matrices; F [0] = F [1] ⊗ F [2] , P [0 ,r ] = P [1 ,r ] ⊗ P [2 ,r ] and Q [0 ,r ] = Q [1 ,r ] ⊗ Q [2 ,r ] for all r ∈ [0 : N − 1] ( so m = m m ) . If EVAL ↔ ( C [1] , D [1] ) and EVAL ↔ ( C [2] , D [2] ) are tractable,then EVAL ↔ ( C [0] , D [0] ) is also tractable.Proof. As shown earlier, it suffices to restrict the inputs to ( ← , G, u ∗ ) and ( → , G, u ∗ ) where u ∗ ∈ V ( G ) and G is connected. Now we can simply apply Lemma 2.6. Remark: We note that unlike the proof of Lemma 12.2 from [6], in the proof of Lemma 15.2 wedo not invoke the so-called second pinning lemma (Lemma 4.3 from [6]) with the goal of giving aconstructive proof. See Section 22 for further discussions on the topic of constructivity.We now use condition ( D ) to prove the following lemma. Lemma 15.3 (Lemma 12.3 from [6]) . Given r ∈ T , i ∈ [ s ] and a ∈ ∆ lin r,i , there exist b ∈ Z q i and α ∈ Z N such that the following equation holds for all x ∈ ∆ r,i : D [ i,r ](1 , x + a ) · D [ i,r ](1 , x ) = ω αN · F [ i ] b , x . Proof. The proof is the same as that of Lemma 12.3 from [6].One can also prove a similar lemma for the other block of D [ i,r ] , using ( D ).73 For convenience, in this step we abuse the notation slightly and use EVAL ↔ ( C , D ) to denote oneof the subproblems EVAL ↔ ( C [ i ] , D [ i ] ), i ∈ [ s ], defined in the last step. Then by using conditions( R ) , ( L ), and ( D ), we summarize the properties of this new pair ( C , D ) that we need in the reductionas follows:( F ) There is a prime p and a nonincreasing sequence π = ( π , . . . , π h ) of powers of the same p . F is an m × m complex matrix, where m = π π · · · π h , and C is the bipartization of F . Welet π denote π . We also use Z π ≡ Z π × · · · × Z π h to index the rows and columns of F . Then F satisfies F x , y = (cid:89) i ∈ [ h ] ω x i y i π i for all x = ( x , . . . , x h ) and y = ( y , . . . , y h ) ∈ Z π ,where we use x i ∈ Z π i to denote the i th entry of x , i ∈ [ h ].( F ) D = ( D [0] , . . . , D [ N − ) is a sequence of N m × m diagonal matrices for some N ≥ π | N . D [0] is the identity matrix, and every diagonal entry of D [ r ] , r ∈ [ N − ω N . We use { , } × Z π to index the rows and columns of matrices C and D [ r ] . (Thecondition π | N is from the condition M | N in ( U ), and the expression of M in terms of the primepowers, stated after ( R ). The π here is one of the q i = q i, there.)( F ) For each r ∈ [0 : N − r and ∆ r to denoteΛ r = { x ∈ Z π (cid:12)(cid:12) D [ r ](0 , x ) (cid:54) = 0 } and ∆ r = { x ∈ Z π (cid:12)(cid:12) D [ r ](1 , x ) (cid:54) = 0 } . We use S to denote the set of r such that Λ r (cid:54) = ∅ and T to denote the set of r such that ∆ r (cid:54) = ∅ .Then for every r ∈ S , Λ r is a coset in Z π ; for every r ∈ T , ∆ r is a coset in Z π . For each r ∈ S (and r ∈ T ), there is an a [ r ] ∈ Λ r ( b [ r ] ∈ ∆ r , resp.) such that D [ r ](0 , a [ r ] ) = 1 (cid:16) and D [ r ](1 , b [ r ] ) = 1, resp. (cid:17) . ( F ) For all r ∈ S and a ∈ Λ lin r , there exist b ∈ Z π and α ∈ Z N such that D [ r ](0 , x + a ) D [ r ](0 , x ) = ω αN · F x , b for all x ∈ Λ r ;for all r ∈ T and a ∈ ∆ lin r , there exist b ∈ Z π and α ∈ Z N such that D [ r ](1 , x + a ) D [ r ](1 , x ) = ω αN · F b , x for all x ∈ ∆ r . To consider Z → C , D , let G be a connected graph and u ∗ ∈ V ( G ). Below we reduce the computationof Z → C , D ( G, u ∗ ) to EVAL ( (cid:98) π ), where (cid:98) π = π if p (cid:54) = 2 and (cid:98) π = 2 π if p = 2. The Z ← part can be dealtwith similarly.Given a ∈ Z π i for some i ∈ [ h ], let (cid:98) a denote an element in Z (cid:98) π such that (cid:98) a ≡ a (mod π i ). As π i | π = π | (cid:98) π , this lifting of a is certainly feasible. For definiteness, we can choose a itself if weconsider a to be an integer between 0 and π i − G is not bipartite, then Z → C , D ( G ) is trivially 0. From now on we assume G = ( U ∪ V, E )to be bipartite: every edge has one vertex in U and one vertex in V . We can assume u ∗ ∈ U .Now we can proceed exactly as in Section 12.2 (Step 2) of [6] starting from line -4, p. 1003.This is because in [6], a reduction from Z → C , D ( G, u ∗ ) to EVAL ( (cid:98) π ) was also obtained. This way wecan simply repeat the rest of Section 12.2 from [6]. After that we can repeat the material of Section12.3 from [6] which will give us the proof of Theorem 15.1.74 Let A be a regularized nonbipartite matrix and let A be the purification of A obtained by goingfrom a generating set ( g , . . . , g d ) of nonzero entries of A to the d smallest primes ( p , . . . , p d ),( d ≥ A and A (this permutation is obtained by collecting the entries of A of equal normin decreasing order), we may assume that there exist a positive integer N , and three sequences κ , κ , and m such that ( A , ( N, κ , m )) and ( A , ( N, κ , m )) satisfy the following condition:( S (cid:48) ) A is an m × m symmetric matrix. κ = ( κ , . . . , κ s ) is a sequence of pairwise distinctnonzero complex numbers, where s ≥ m = ( m , . . . , m s ) is a sequence of positive integers suchthat m = (cid:80) m i . The rows and columns of A are indexed by x = ( x , x ), where x ∈ [ s ] and x ∈ [ m x ]. For all x , y , A satisfies A x , y = A ( x ,x ) , ( y ,y ) = κ x κ y S x , y , where S = { S x , y } is a symmetric matrix in which every entry is a power of ω N : A = κ I m κ I m . . . κ s I m s S (1 , ∗ ) , (1 , ∗ ) S (1 , ∗ ) , (2 , ∗ ) . . . S (1 , ∗ ) , ( s, ∗ ) S (2 , ∗ ) , (1 , ∗ ) S (2 , ∗ ) , (2 , ∗ ) . . . S (2 , ∗ ) , ( s, ∗ ) ... ... . . . ... S ( s, ∗ ) , (1 , ∗ ) S ( s, ∗ ) , (2 , ∗ ) . . . S ( s, ∗ ) , ( s, ∗ ) κ I m κ I m . . . κ s I m s where I m i is the m i × m i identity matrix.We can also assume that κ , . . . , κ s are in the multiplicative subgroup generated by { g , . . . , g d } .The purification matrix A is also m × m symmetric. κ = ( κ , . . . , κ s ) is the purification of κ = ( κ , . . . , κ s ) obtained by going from ( g , . . . , g d ) to the d smallest primes ( p , . . . , p d ), and is astrictly decreasing sequence of positive rational numbers, where s ≥ 1. The rows and columns of A are also indexed by x = ( x , x ), where x ∈ [ s ] and x ∈ [ m x ]. For all x , y , A satisfies A x , y = A ( x ,x ) , ( y ,y ) = κ x κ y S x , y , so that A = κ I m κ I m . . . κ s I m s S (1 , ∗ ) , (1 , ∗ ) S (1 , ∗ ) , (2 , ∗ ) . . . S (1 , ∗ ) , ( s, ∗ ) S (2 , ∗ ) , (1 , ∗ ) S (2 , ∗ ) , (2 , ∗ ) . . . S (2 , ∗ ) , ( s, ∗ ) ... ... . . . ... S ( s, ∗ ) , (1 , ∗ ) S ( s, ∗ ) , (2 , ∗ ) . . . S ( s, ∗ ) , ( s, ∗ ) κ I m κ I m . . . κ s I m s . We let I = { ( i, j ) : i ∈ [ s ] , j ∈ [ m i ] } . The proof of Theorem 9.3, just like the proof of Theorem 8.3, consists of five steps. It uses thefollowing strategy. We construct from A its bipartization A (cid:48) , a 2 m × m symmetric matrix. Wealso construct from A its bipartization A (cid:48) . Then we just apply the lemmas for the bipartite caseto A (cid:48) and A (cid:48) , and show that either there is an edge gadget Γ such that M Γ , A (cid:48) is not mult-brk-1 or A (cid:48) has certain properties. These properties are then transferred to A .To this end, we need the following lemma. Lemma 16.1 (modification of Lemma 13.1 from [6]) . Let A be a symmetric matrix, and let A (cid:48) beits bipartization. Let Γ be an edge gadget such that M Γ , A (cid:48) is not mult-brk- (not mod-brk- ). Thenthere is an edge gadget Γ (cid:48) such that M Γ (cid:48) , A is not mult-brk- (not mod-brk- ). roof. Let u ∗ , v ∗ be the first and second distinguished vertices of Γ, correspondingly. By Lemma 3.10, u ∗ , v ∗ lie in the same connected component of Γ, call it Γ , and M Γ , A (cid:48) is not mult-brk-1 (not mod-brk-1). It is also immediate that Γ is a bipartite edge gadget for otherwise M Γ , A (cid:48) = 0, whichcontradicts M Γ , A (cid:48) being non-mult-brk-1 (non-mod-brk-1). Let Γ = ( U ∪ V, E ) be a bipartizationof Γ . It is easy to check that the following hold.1. If u ∗ , v ∗ are in the same bipartite part of Γ , say u ∗ , v ∗ ∈ U , then M Γ , A (cid:48) = (cid:18) M Γ , A M Γ , A (cid:19) ;2. If u ∗ , v ∗ are in different bipartite parts of Γ , say u ∗ ∈ U and v ∗ ∈ V , then M Γ , A (cid:48) = (cid:18) M Γ , A M Γ , A (cid:19) . Now by Properties 3.7 and 3.8, we get that M Γ , A is not mult-brk-1 (not mod-brk-1) so takingΓ (cid:48) = Γ we are done. Lemma 16.2 (modification of Lemma 13.2 from [6]) . Suppose that ( A , ( N, κ , m )) and ( A , ( N, κ , m )) satisfy ( S (cid:48) ) . Then either there exists an edge gadget Γ such that M Γ , A is not mult-brk- or ( A , ( N, κ , m )) and ( A , ( N, κ , m )) satisfy the following condition: ( S (cid:48) ) For all x , x (cid:48) ∈ I , either there exists an integer k such that S x , ∗ = ω kN · S x (cid:48) , ∗ , or for every j ∈ [ s ] , (cid:104) S x , ( j, ∗ ) , S x (cid:48) , ( j, ∗ ) (cid:105) = 0 . Proof. Let A (cid:48) and A (cid:48) be the bipartizations of A and A , respectively. Suppose that for any edgegadget Γ, M Γ , A is mult-brk-1. From Lemma 16.1, for any edge gadget Γ, M Γ , A (cid:48) is mult-brk-1. Weapply Lemma 11.6 to the sequences ( A (cid:48) , ( N, κ , κ , m , m )) and ( A (cid:48) , ( N, κ , κ , m , m )). The S matricesof A (cid:48) and A (cid:48) are the same; it is also the same S from A and A here. The condition ( S ) is satisfied.So by Lemma 11.6 together with the assumption that for any edge gadget Γ, M Γ , A (cid:48) is mult-brk-1, S satisfies ( S ) which is exactly the same as ( S (cid:48) ) here. (For Lemma 11.6, S also needs to satisfy( S ), but since S is symmetric here, ( S ) is the same as ( S ).)We have the following corollary, which is the same as Corollary 13.3 from [6]. The proof is thesame as that of Corollary 11.8 (see Corollary 8.6 in [6]). Corollary 16.3. For all i, j ∈ [ s ] , S ( i, ∗ ) , ( j, ∗ ) has the same rank as S . Next we build pairs ( F , D ) and ( F , D ), and apply the cyclotomic reduction lemma (Lemma 11.2)and the cyclotomic transfer lemma for edge gadgets (Lemma 11.3) on A and A .Let h = rank( S ). By Corollary 16.3 and condition ( S (cid:48) ), there exist 1 ≤ i < . . . < i h ≤ m suchthat the h columns { S (1 , ∗ ) , (1 ,i ) , . . . , S (1 , ∗ ) , (1 ,i h ) } are pairwise orthogonal, and these columns form asubmatrix of rank h . Without loss of generality, we may assume i k = k for all k ∈ [ h ] (if this isnot the case, we can apply an appropriate permutation Π to the rows and columns of A so thatthe new S has this property; this does not affect the monotonicity of κ since the permutation Π iswithin the first block).Since S is symmetric, the h rows { S (1 , , (1 , ∗ ) , . . . , S (1 ,h ) , (1 , ∗ ) } are pairwise orthogonal. By con-dition ( S (cid:48) ), for every h < i ≤ m , the i th row S (1 ,i ) , (1 , ∗ ) is a multiple of one of the h rows76 S (1 , , (1 , ∗ ) , . . . , S (1 ,h ) , (1 , ∗ ) } , otherwise together they would form a submatrix of rank h +1 > rank( S ).Thus each truncated h -dimensional row vector ( S (1 ,i ) , (1 , , . . . , S (1 ,i ) , (1 ,h ) ) for h < i ≤ m is also amultiple of one of the truncated h row vectors ( S (1 ,i (cid:48) ) , (1 , , . . . , S (1 ,i (cid:48) ) , (1 ,h ) ) for some 1 ≤ i (cid:48) ≤ h .Therefore the row rank of the upper-left-most h × h submatrix of S (1 , ∗ ) , (1 , ∗ ) is h .Let H denote this h × h symmetric matrix: H i,j = S (1 ,i ) , (1 ,j ) , i, j ∈ [ h ], and it has rank h . FromCorollary 16.3 and Lemma 16.2, for every index x ∈ I , there exist two unique integers j ∈ [ h ] and k ∈ [0 : N − 1] such that S x , ∗ = ω kN · S (1 ,j ) , ∗ and S ∗ , x = ω kN · S ∗ , (1 ,j ) . (16.1)This gives us a partition of the index set I R = (cid:8) R ( i,j ) ,k : i ∈ [ s ] , j ∈ [ h ] , k ∈ [0 : N − (cid:9) . For every x ∈ I , x ∈ R ( i,j ) ,k iff i = x and x , j, k satisfy (16.1). By Corollary 16.3, (cid:91) k ∈ [0: N − R ( i,j ) ,k (cid:54) = ∅ for all i ∈ [ s ] and j ∈ [ h ].Now we define ( F , D ) and ( F , D ), and use Lemmas 11.2, 11.3, and R to show that EVAL( A ) ≡ EVAL( F , D ), and EVAL( A ) ≡ EVAL( F , D ), and that for every edge gadget Γ, M Γ , A (resp., M Γ , A )is mult-brk-1 (mod-brk-1) iff M Γ , F , D (resp., M Γ , F , D ) is mult-brk-1 (mod-brk-1). This will allow usto move between the frameworks EVAL ( A ) (resp., EVAL ( A )) and EVAL ( F , D ) (resp., EVAL ( F , D )).First, F is an sh × sh matrix. We use I (cid:48) = [ s ] × [ h ] to index the rows and columns of F . Then F x , y = κ x κ y H x ,y = κ x κ y S (1 ,x ) , (1 ,y ) for all x , y ∈ I (cid:48) ,or equivalently, F = κ I κ I . . . κ s I H H . . . HH H . . . H ... ... . . . ... H H . . . H κ I κ I . . . κ s I , where I is the h × h identity matrix.Second, D = ( D [0] , . . . , D [ N − ) is a sequence of N diagonal matrices of the same size as F . Weuse I (cid:48) to index its diagonal entries. The x th entries are D [ r ] x = N − (cid:88) k =0 (cid:12)(cid:12) R ( x ,x ) ,k (cid:12)(cid:12) · ω krN for all r ∈ [0 : N − , x ∈ I (cid:48) .Finally, F is an sh × sh matrix. We also use I (cid:48) = [ s ] × [ h ] to index the rows and columns of F .Then F x , y = κ x κ y H x ,y = κ x κ y S (1 ,x ) , (1 ,y ) for all x , y ∈ I (cid:48) ,or equivalently, F = κ I κ I . . . κ s I H H . . . HH H . . . H ... ... . . . ... H H . . . H κ I κ I . . . κ s I . We use Lemmas 11.2 and 11.3 to prove the next lemma.77 emma 16.4 (modification of Lemma 13.4 from [6]) . The matrix A is generated from F using R . As a consequence, EVAL( A ) ≡ EVAL( F , D ) and for any edge gadget Γ , M Γ , A is mult-brk- (mod-brk- ) iff M Γ , F , D is mult-brk- (mod-brk- ). The same statements hold with A and F replacedby A and F , respectively.Proof. We show that A can be generated from F using R ; that A can be generated from F using R is shown similarly. Let x , y ∈ I , x ∈ R ( x ,j ) ,k and y ∈ R ( y ,j (cid:48) ) ,k (cid:48) for some j, k, j (cid:48) , k (cid:48) . By (16.1), A x , y = κ x κ y S x , y = κ x κ y S (1 ,j ) , (1 ,j (cid:48) ) · ω k + k (cid:48) N = F ( x ,j ) , ( y ,j (cid:48) ) · ω k + k (cid:48) N . So A can be generated from F using R . The construction of D implies that D can be generatedfrom R . Then the lemma follows from Lemmas 11.2 and 11.3. Corollary 16.5. If Γ is an edge gadget such that M Γ , F , D is not mult-brk- (which is true inparticular if M Γ , F , D is not mod-brk- ), then for some p ≥ , M T p (Γ) , A is not mult-brk- .Proof. By Lemma 16.4, M Γ , A is not mult-brk-1. Then by Theorem 6.1, for some p ≥ M T p (Γ) , A is not mult-brk-1.In light of Corollary 16.5, our goal will be either to construct an edge gadget Γ such that M Γ , F , D is not mult-brk-1 (in fact, not mod-brk-1) or impose additional conditions on ( F , D ) (and ( F , D )),by adapting the corresponding proofs from [6]. Now we have pairs ( F , D ) and ( F , D ) that satisfy the following condition ( Shape (cid:48) ):( Shape (cid:48) ) F ∈ C m × m is a symmetric s × s block matrix. (Note that the m here is differentfrom the m used in ( S (cid:48) ) and Step 2.1.) We use I = [ s ] × [ h ] to index its rows and columns, where m = sh .Similarly, the purification matrix F ∈ C m × m is also a symmetric s × s block matrix.( Shape (cid:48) ) There is a sequence κ = ( κ , . . . , κ s ) of pairwise distinct nonzero complex numberssuch that κ , . . . , κ s are in the multiplicative subgroup generated by { g , . . . , g d } . In particular, κ , . . . , κ s generate a torsion-free multiplicative group. There is also an h × h matrix H of full rank,whose entries are all powers of ω N , for some N ≥ 1. We have F x , y = κ x κ y H x ,y for all x , y ∈ I. Moreover, there is a strictly decreasing sequence κ = ( κ , . . . , κ s ), the purification of κ obtainedby going from ( g , . . . , g d ) to the d smallest primes ( p , . . . , p d ), consisting of positive rationalnumbers. We have F x , y = κ x κ y H x ,y for all x , y ∈ I. ( Shape (cid:48) ) D = ( D [0] , . . . , D [ N − ) is a sequence of N m × m diagonal matrices. D satisfies ( T ),so for all r ∈ [ N − 1] and x ∈ I , we have D [ r ] x = D [ N − r ] x . M Γ , F , D is mult-brk-1.We define ( C , D (cid:48) ) and ( C , D (cid:48) ): C is the bipartization of F ; C is the bipartization of F ; D (cid:48) is asequence of N copies of (cid:18) D [ r ] D [ r ] (cid:19) . The proof of the following lemma is the same as that of Lemma 16.1. Lemma 16.6 (modification of Lemma 13.5 from [6]) . Let Γ be an edge gadget such that M Γ , C , D (cid:48) isnot mult-brk- (not mod-brk- ). Then there is an edge gadget Γ (cid:48) such that M Γ (cid:48) , F , D is not mult-brk- (not mod-brk- ). The same conclusion holds for M Γ , C , D (cid:48) and M Γ (cid:48) , F , D . By the contrapositive of Lemma 16.6, and our assumption that for any edge gadget Γ, M Γ , F , D is mult-brk-1, we get that for any edge gadget Γ, M Γ , C , D (cid:48) is mult-brk-1. By ( Shape (cid:48) )–( Shape (cid:48) ),( C , D (cid:48) ) and ( C , D (cid:48) ) also satisfy ( Shape )–( Shape ). It then follows from Lemma 11.11 and Lemma11.14 that ( C , D (cid:48) ) and ( C , D (cid:48) ) also satisfy ( Shape )–( Shape ). By the way ( C , D (cid:48) ) and ( C , D (cid:48) ) arebuilt from ( F , D ) and ( F , D ), the latter two must satisfy the following conditions:( Shape (cid:48) ) H / √ h is unitary: (cid:104) H i, ∗ , H j, ∗ (cid:105) = (cid:104) H ∗ ,i , H ∗ ,j (cid:105) = 0 for all i (cid:54) = j ∈ [ h ].( Shape (cid:48) ) For all x ∈ I , D [0] x = D [0]( x , . ( Shape (cid:48) ) For each r ∈ [ N − K [ r ] ∈ C s × s , L [ r ] ∈ C h × h . The normof every diagonal entry in L [ r ] is either 0 or 1. We have D [ r ] = K [ r ] ⊗ L [ r ] , for all r ∈ [ N − r ∈ [ N − K [ r ] = implies L [ r ] = ; L [ r ] (cid:54) = implies one of its entries is 1.In particular, ( Shape (cid:48) ) means that by setting K [0] i = D [0]( i, and L [0] j = 1 for all i ∈ [ s ] and j ∈ [ h ],we have D [0] = K [0] ⊗ L [0] . By ( T ) in ( Shape (cid:48) ), the entries of K [0] are positive integers. Suppose ( F , D ) and ( F , D ) satisfy ( Shape (cid:48) )–( Shape (cid:48) ). From ( Shape (cid:48) ) we have F = M ⊗ H , where M is an s × s matrix of rank 1: M i,j = κ i κ j for all i, j ∈ [ s ]. From ( Shape (cid:48) ) we also have F = M ⊗ H ,where M is also an s × s matrix of rank 1: M i,j = κ i κ j for all i, j ∈ [ s ].We reduce EVAL ( F , D ) to two problems EVAL ( M , K ) and EVAL ( H , L ), where K = (cid:0) K [0] , . . . , K [ N − (cid:1) and L = (cid:0) L [0] , . . . , L [ N − (cid:1) . By the tensor product expression of EVAL ( F , D ) in terms of the two problems EVAL ( M , K ) (theouter problem) and EVAL ( H , L ) (the inner problem), and the fact that EVAL ( M , K ) is tractable, wehave a reduction from EVAL ( F , D ) to EVAL ( H , L ). The proof of the following lemma is essentiallythe same as that of Lemma 11.16. Lemma 16.7 (weakened form of Lemma 13.6 from [6]) . EVAL ( F , D ) ≤ EVAL ( H , L ) . EVAL ( F , D ) in terms of EVAL ( M , K ) and EVAL ( H , L ),we have the following relation M Γ , F , D = M Γ , M , K ⊗ M Γ , H , L , for any edge gadget Γ (not necessarily connected). This relation will allow us to transfer an edgegadget that is not mult-brk-1 (not mod-brk-1) for ( H , L ) to an edge gadget that is not mult-brk-1(not mod-brk-1) for ( F , D ), provided that M Γ , M , K is nonzero. The proof of the following claim isessentially the same as that of Claim 11.17. Claim 16.8 (modification of Claim 8.25 from [6]) . For any connected edge gadget Γ = ( V, E ) withdistinguished vertices u ∗ , v ∗ (in this order), there is a connected edge gadget Γ (cid:48) = ( V (cid:48) , E (cid:48) ) withdistinguished vertices u ∗ , v ∗ (in this order) such that u ∗ , v ∗ ∈ V ⊂ V (cid:48) , and M Γ (cid:48) , H , L = h | V |− · M Γ , H , L . (16.2) Furthermore, if M Γ , H , L (cid:54) = , then we can choose Γ (cid:48) such that M Γ (cid:48) , M , K has no zero entries. From Claim 16.8, we have the following corollary whose proof is essentially the same as that ofCorollary 11.18. Corollary 16.9. Let Γ be an edge gadget such that M Γ , H , L is not mult-brk- (not mod-brk- ).Then there is a connected edge gadget Γ (cid:48) such that M Γ (cid:48) , F , D is not mult-brk- (not mod-brk- ). Finally we normalize the matrix H in the same way we did for the bipartite case and obtain a newpair ( Z , Y ) such that1. ( Z , Y ) satisfies conditions ( U (cid:48) )–( U (cid:48) );2. EVAL( A ) ≤ EVAL( Z , Y );3. for any edge gadget (not necessarily connected) Γ, if M Γ , Z , Y is not mult-brk-1 (not mod-brk-1), then there is a connected edge gadget Γ (cid:48) such that M Γ (cid:48) , A is not mult-brk-1.Below we rename the pair ( Z , Y ) (which is the normalized inner pair ( H , L )) as ( F , D ). 17 Proofs of Theorem 9.4 and Theorem 9.7 Suppose (( M, N ) , F , D ) satisfies ( U (cid:48) )–( U (cid:48) ). We prove Theorem 9.4 and 9.7 in this section. We firstprove that if F does not satisfy the group condition ( GC ), then there exists an edge gadget Γ suchthat M Γ , F , D is not mod-brk-1. This is done by applying Lemma 12.2 (for the bipartite case) to thebipartization C of F . Lemma 17.1 (modification of Lemma 14.1 from [6]) . Suppose (( M, N ) , F , D ) satisfies conditions ( U (cid:48) ) – ( U (cid:48) ) . Then either the matrix F satisfies the group condition ( GC ) or there is an edge gadget Γ such that M Γ , F , D is not mod-brk- .Proof. Assume for every edge gadget Γ, M Γ , F , D is mod-brk-1. Let C and E = ( E [0] , . . . , E [ N − ) be C = (cid:18) (cid:19) and E [ r ] = (cid:18) D [ r ] 00 D [ r ] (cid:19) for all r ∈ [0 : N − U (cid:48) )–( U (cid:48) ), (( M, N ) , C , E ) satisfies ( U )–( U ). Arguing similarly to Lemma 16.6, from the con-trapositive, we infer that for any edge gadget Γ, M Γ , C , E is mod-brk-1. It follows from Lemma 12.2that F satisfies the group condition ( GC ). 80 We prove Theorem 9.4 again, using C and E defined above.We are given that (( M, N ) , F , D ) satisfies ( U (cid:48) )–( U (cid:48) ), and M > 1. So (( M, N ) , C , E ) satisfiesconditions ( U )–( U ). Suppose for every edge gadget Γ, M Γ , F , D is mod-brk-1. By Lemma 16.6, forevery edge gadget Γ, M Γ , C , E is mod-brk-1. By Lemma 17.1, F satisfies the group condition ( GC ) .Now by Theorem 8.4, the tuple (( M, N ) , C , E ) satisfies ( U ). Thus, for all r ∈ [ N − D [ r ] is either 0 or a power of ω N . This establishes ( U (cid:48) ). Theorem 9.4 is proved. In this section we prove Theorem 9.7. However, here we cannot simply reduce it, using ( C , E ),to the bipartite case (Theorem 8.6), because in Theorem 9.7, we are only allowed to permute therows and columns symmetrically, while in Theorem 8.6, one can use two different permutations topermute the rows and columns. But as we will see below, for most of the lemmas we need here, theirproofs are exactly the same as those for the bipartite case. The only exception is the counterpartof Lemma 12.8, in which we have to bring in the generalized Fourier matrices (see Definitions 8.5and 9.6).Suppose F satisfies ( GC ). Let F R denote the set of row vectors { F i, ∗ } of F and F C denote theset of column vectors { F ∗ ,j } of F . Since F satisfies ( GC ), by Property 12.3, both F R and F C arefinite Abelian groups of order m , under the Hadamard product.We start by proving a symmetric version of Lemma 12.6, stating that when M = pq andgcd( p, q ) = 1 (note that p and q are not necessarily primes), a permutation of F is the tensorproduct of two smaller discrete unitary matrices, both of which satisfy the group condition. Lemma 17.2 (Lemma 14.2 from [6]) . Suppose F ∈ C m × m is symmetric and M -discrete unitaryand satisfies ( GC ) . Moreover, M = pq , p, q > , and gcd( p, q ) = 1 . Then there is a permutation Π of [0 : m − such that F Π , Π = F (cid:48) ⊗ F (cid:48)(cid:48) , where F (cid:48) is a symmetric p -discrete unitary matrix, F (cid:48)(cid:48) isa symmetric q -discrete unitary matrix, and both of them satisfy ( GC ) .Proof. The proof is the same as that of Lemma 14.2 from [6].As a result, we only need to deal with the case when M = p β is a prime power. Lemma 17.3 (Lemma 14.3 from [6]) . Suppose F ∈ C m × m is symmetric and M -discrete unitaryand satisfies ( GC ) . Moreover, M = p β is a prime power, p (cid:54) = 2 , and β ≥ . Then there must existan integer k ∈ [0 : m − such that p (cid:45) α k,k , where F k,k = ω α k,k M .Proof. For i, j ∈ [0 : m − α i,j denote the integer in [0 : M − 1] such that F i,j = ω α i,j M .Assume the lemma is not true, that is, p | α k,k for all k . Then because F is M -discrete unitary, and M = p β , there must exist i (cid:54) = j ∈ [0 : m − 1] such that p (cid:45) α i,j .By ( GC ), there exists a k ∈ [0 : m − 1] such that F k, ∗ = F i, ∗ ◦ F j, ∗ . However, ω α k,k M = F k,k = F i,k F j,k = F k,i F k,j = F i,i F j,i F i,j F j,j = ω α i,i + α j,j +2 α i,i M , and α k,k ≡ α i,i + α j,j + 2 α i,j (mod M ) implies that 0 ≡ α i,j (mod p ). Since p (cid:54) = 2 and p (cid:45) α i,j , we get a contradiction. 81he next lemma is the symmetric version of Lemma 12.8 showing that when there exists adiagonal entry F k,k such that p (cid:45) α k,k , F is the tensor product of a Fourier matrix and a discreteunitary matrix satisfying the group condition ( GC ) . Note that this lemma also applies to the casewhen p = 2. So the only case left is when p = 2 but 2 | α i,i for all i ∈ [0 : m − Lemma 17.4 (Lemma 14.4 from [6]) . Suppose F ∈ C m × m is symmetric and M -discrete unitaryand satisfies ( GC ) . Moreover, M = p β is a prime power. If there exists a k ∈ [0 : m − such that F k,k = ω αM and p (cid:45) α , then there exists a permutation Π such that F Π , Π = F M,α ⊗ F (cid:48) , where F (cid:48) isa symmetric and M (cid:48) -discrete unitary matrix that satisfies condition ( GC ) with M (cid:48) | M .Proof. The proof is the same as that of Lemma 14.4 from [6].Finally, we deal with the case when p = 2 and 2 | α i,i for all i ∈ [0 : m − Lemma 17.5 (Lemma 14.5 from [6]) . Suppose F ∈ C m × m is symmetric and M -discrete unitaryand satisfies ( GC ) , with M = 2 β and | α i,i for all i ∈ [0 : m − . Then there exist a permutation Π and a × symmetric nondegenerate matrix W over Z M (see Section 9.3.2 and Definition 9.6) ,such that F Π , Π = F M, W ⊗ F (cid:48) , where F (cid:48) is a symmetric, M (cid:48) -discrete unitary matrix that satisfies ( GC ) with M (cid:48) | M .Proof. The proof is the same as that of Lemma 14.5 from [6].Theorem 9.7 then follows from Lemmas 17.3, 17.4, and 17.5. 18 Proofs of Theorem 9.8 and Theorem 9.9 Suppose (( M, N ) , F , D , ( d , W , p , t , Q , K )) satisfies condition ( R (cid:48) ). We prove Theorem 9.8: eitherthere exists an edge gadget Γ such that M Γ , F , D is not mod-brk-1 or D satisfies conditions ( L (cid:48) ) and( L (cid:48) ).Suppose for any edge gadget Γ, M Γ , F , D is mod-brk-1. We use ( C , E ) to denote the bipartizationof ( F , D ), where E = ( E [0] , . . . , E [ N − ). The plan is to show that ( C , E ) with appropriate p (cid:48) , t (cid:48) ,and Q (cid:48) satisfies ( R ).To see this, we permute C and E using the following permutation Σ. We index the rows andcolumns of C and E [ r ] using { , } × Z d × Z Q . We set Σ(1 , y ) = (1 , y ) for all y ∈ Z d × Z Q , that is,Σ fixes pointwise the second half of the rows and columns, and Σ(0 , x ) = (0 , x (cid:48) ), where x (cid:48) satisfies x ,i, = W [ i ]1 , x (cid:48) ,i, + W [ i ]2 , x (cid:48) ,i, , x ,i, = W [ i ]1 , x (cid:48) ,i, + W [ i ]2 , x (cid:48) ,i, for all i ∈ [ g ],and x ,i,j = k i,j · x (cid:48) ,i,j for all i ∈ [ s ] , j ∈ [ t i ]. See ( R (cid:48) ) for the definitions of these symbols.Before proving properties of C Σ , Σ and E Σ , we need to verify that Σ is indeed a permutation.This follows from the fact that W [ i ] , for every i ∈ [ g ], is nondegenerate over Z d i , and k i,j for all i ∈ [ s ] and j ∈ [ t i ] satisfies gcd( k i,j , q i,j ) = 1 (so x (cid:48) above is unique). We use Σ to denote the(0 , ∗ )-part of Σ and I to denote the identity map:Σ(0 , x ) = (0 , Σ ( x )) = (0 , x (cid:48) ) for all x ∈ Z d × Z Q .Now we can write C Σ , Σ and E Σ = ( E [0]Σ , . . . , E [ N − ) as C Σ , Σ = (cid:18) Σ ,I F I, Σ (cid:19) and E [ r ]Σ = (cid:32) D [ r ]Σ 00 D [ r ] (cid:33) (18.1)82or all r ∈ [0 : N − • Observation 1: For any edge gadget Γ, M Γ , C Σ , Σ , E Σ is mod-brk-1 iff M Γ , C , E is mod-brk-1, andfor any edge gadget Γ such that M Γ , C , E is not mod-brk-1 there is an edge gadget Γ (cid:48) such that M Γ (cid:48) , F , D is not mod-brk-1; and, thus for any edge gadget Γ, M C Σ , Σ , E Σ is mod-brk-1. • Observation 2: F Σ ,I satisfies (cid:0) F Σ ,I (cid:1) x , y = F x (cid:48) , y = (cid:89) i ∈ [ g ] ω ( x (cid:48) ,i, x (cid:48) ,i, ) · W [ i ] · ( y ,i, y ,i, ) T d i (cid:89) i ∈ [ s ] ,j ∈ [ t i ] ω k i,j · x (cid:48) ,i,j y ,i,j q i,j = (cid:89) i ∈ [ g ] ω x ,i, y ,i, + x ,i, y ,i, d i (cid:89) i ∈ [ s ] ,j ∈ [ t i ] ω x ,i,j y ,i,j q i,j . By Observation 2, it is easy to show that C Σ , Σ and E Σ (together with appropriate q (cid:48) , t (cid:48) , Q (cid:48) )satisfy condition ( R ). Since by Observation 1, for any edge gadget Γ, M C Σ , Σ , E Σ is mod-brk-1, itfollows from Theorem 8.8 and (18.1) that (the lower half) D [ r ] satisfies ( L ), and then ( L ). Thisproves Theorem 9.8 since ( L (cid:48) ) and ( L (cid:48) ) follow from ( L ) and ( L ), respectively.We continue to prove Theorem 9.9. Suppose for any edge gadget Γ, M Γ , F , D is mod-brk-1. Thenthe argument above shows that ( C Σ , Σ , E Σ ) (with appropriate p (cid:48) , t (cid:48) , Q (cid:48) ) satisfies both ( R ) and ( L ).Since by Observation 1, for any edge gadget Γ, M Γ , C Σ , Σ , E Σ is mod-brk-1, by Theorem 8.9 and(18.1), D [ r ] satisfies ( D ) and ( D ) for every r ∈ Z . ( D (cid:48) ) follows from ( D ).To prove ( D (cid:48) ), let F (cid:48) = F Σ ,I . By ( D ), for any r ∈ Z , k ∈ [ s ] and a ∈ Γ lin r,k , there exist b ∈ ˜ Z q k and α ∈ Z N such that ω αN · F (cid:48) (cid:101) b , x = D [ r ] x + (cid:101) a · D [ r ] x for all x ∈ Γ r , where F (cid:48) (cid:101) b , ∗ = F Σ ( (cid:101) b ) , ∗ .Since Σ works within each prime factor, there exists a b (cid:48) ∈ ˜ Z q k such that Σ ( (cid:101) b ) = (cid:101) b (cid:48) and ( D (cid:48) )follows. 19 Tractability: Proof of Theorem 9.10 The statement of Theorem 9.10 is exactly the same as that of Theorem 6.10 in [6] whose proof isgiven in Section 16 in [6]. We just repeat a short outline given at the beginning of Section 16 in [6].The proof of Theorem 9.10 is similar to that of Theorem 8.10 for the bipartite case presentedin Section 15.Let (( M, N ) , F , D , ( d , W , p , t , Q , K )) be a tuple that satisfies ( R (cid:48) ) , ( L (cid:48) ), and ( D (cid:48) ). The proofhas two steps. First we use ( R (cid:48) ) , ( L (cid:48) ) , ( D (cid:48) ) to decompose EVAL ( F , D ) into s subproblems (recall s isthe length of the sequence p ), denoted by EVAL ( F [ i ] , D [ i ] ), i ∈ [ s ], such that if every EVAL ( F [ i ] , D [ i ] )is tractable, then so is EVAL ( F , D ). Second, we reduce each EVAL ( F [ i ] , D [ i ] ) to EVAL ( π ) for someprime power π .By Theorem 15.1, EVAL ( π ) can be solved in polynomial time for any fixed prime power π . Thus, EVAL ( F [ i ] , D [ i ] ) is tractable for all i ∈ [ s ], and so is EVAL ( F , D ). Remark: The difference of the proof of tractability for the nonbipartite case versus the bipartitecase resides in what we will state in Section 22 for the constructivity of our results. The proof forthe bipartite case (Theorem 5.10) in [6] involves the second pinning lemma (Lemma 4.3 from [6], ofwhich we do not have a constructive proof, and we avoid in this paper), while in the nonbipartite83ase (Theorem 6.10) the proof in [6] does not. Consequently, here for the nonbipartite case we cansimply use the proof in [6]. 20 Dichotomy over simple graphs of bounded degree We need to introduce additional definitions. Recall that [ k ] = { , . . . , k } for integer k ≥ 0, wherewe denote [0] = ∅ .A weighted graph H = H A , D is determined by a symmetric matrix A ∈ C m × m for edge weightsand a vector (or equivalently a diagonal matrix) D = ( D , . . . , D m ) for vertex weights. In thissection, we assume all D i (cid:54) = 0, otherwise we delete the corresponding row and column of A .The following notation from [14] is often convenient. Let G be an unweighted graph (with possiblemultiple edges, but no loops) and H a weighted graph given by ( A , D ), we define (see Definition 2.1)hom( G, H ) = Z A , D ( G ) = (cid:88) φ : V ( G ) → V ( H ) D φ hom φ ( G, H ) , (20.1)where for φ : V ( G ) → V ( H ), D φ = (cid:89) w ∈ V ( G ) D φ ( w ) and hom φ ( G, H ) = (cid:89) uv ∈ E ( G ) A φ ( u ) ,φ ( v ) . When all D i = 1, we say this is the edge-weighted case, and we denote H by H A .A k -labeled graph ( k ≥ 0) is a finite graph in which k nodes are labeled by 1 , , . . . , k (thegraph can have any number of unlabeled nodes). Two k -labeled graphs are isomorphic if there isa label-preserving isomorphism between them. U k denotes the k -labeled graph on k nodes with noedges. In particular, U is the empty graph with no nodes and no edges. The product G G oftwo k -labeled graphs G and G is defined as follows: take their disjoint union, and then identifynodes with the same label. Hence for two 0-labeled graphs, G G is just the disjoint union of G and G . Clearly, the graph product is associative and commutative with the identity U k , sothe set of all (isomorphism classes) of k -labeled graphs togegher with the product operation formsa commutative monoid which we denote by PLG [ k ]. We denote by PLG simp [ k ] the submonoidof simple graphs in PLG [ k ]; these are graphs with no loops, at most one edge between any twovertices i and j , and no edge between labeled vertices. Clearly, PLG simp [ k ] is closed under theproduct operation.Fix a weighted graph H given by ( A , D ), and let G be a k -labeled graph. Let ψ : [ k ] → V ( H ).We say φ : V ( G ) → V ( H ) extends ψ , if φ ( u i ) = ψ ( i ) for the i th labeled vertex u i ∈ V ( G ), i ∈ [ k ].If φ extends ψ , we write D φ/ψ = (cid:81) w ∈ V ( G ) \{ u i : i ∈ [ k ] } D φ ( w ) to denote the product of vertex weights other than D ψ ( i ) , i ∈ [ k ], andhom ψ ( G, H ) = (cid:88) φ : V ( G ) → V ( H ) φ extends ψ D φ/ψ hom φ ( G, H ) . (20.2)Note that a 2-labeled graph is synonymous with an edge gadget. If u ∗ , v ∗ are the (ordered)two distinguished vertices of an edge gadget Γ, then M Γ , A , D is the matrix with hom ψ (Γ , H ) as its( i, j )th entry, where ψ (1) = i and ψ (2) = j . We also denote this as hom ( i,j ) (Γ , H ).84iven a weighted graph H specified by ( A , D ), we call two vertices i, j ∈ V ( H ) twins if the i th row and j th row of A are identical (by symmetry, the i th column and j th column of A areidentical as well). Note that the vertex weights D do not participate in this definition. If H hasno twins, we call it twin-free.The twin relation partitions V ( H ) into nonempty equivalence classes, I , . . . , I s where s ≥ twin contraction graph (cid:101) H , having I , . . . , I s as vertices, with vertex weight (cid:80) t ∈ I r D t for I r , and edge weight between I r and I q to be A u,v for some arbitrary u ∈ I r and v ∈ I q . Afterthat, we remove all vertices in (cid:101) H with zero vertex weights together with all incident edges (stillcalled (cid:101) H ). This defines a twin-free (cid:101) H . Clearly, hom( G, H ) = hom( G, (cid:101) H ) for all G .An isomorphism from a weighted graph H to another H (cid:48) is a bijection σ : V ( H ) → V ( H (cid:48) ) thatpreserves vertex and edge weights. It is obvious that for any weighted graphs H and H (cid:48) , and maps ϕ : [ k ] → V ( H ) and ψ : [ k ] → V ( H (cid:48) ) such that ψ = σ ◦ ϕ for some isomorphism σ : V ( H ) → V ( H (cid:48) )from H to H (cid:48) , we have hom ϕ ( G, H ) = hom ψ ( G, H (cid:48) ) for every G ∈ PLG [ k ]. When H (cid:48) = H , wedenote by Aut( H ) the group of weighted graph automorphisms of H , i.e., isomorphisms from H toitself.We will need the following result from [7], which is proved for directed and undirected graphswith weights from any field of characteristic 0. We will only use it for C -weighted undirected graphs. Theorem 20.1. Let H, H (cid:48) be twin-free C -weighted graphs. Suppose ϕ : [ k ] → V ( H ) and ψ : [ k ] → V ( H (cid:48) ) where k ≥ . If hom ϕ ( G, H ) = hom ψ ( G, H (cid:48) ) for every G ∈ PLG simp [ k ] , then | V ( H ) | = | V ( H (cid:48) ) | , and there exists an isomorphism σ : V ( H ) → V ( H (cid:48) ) from H to H (cid:48) such that ψ = σ ◦ ϕ . Note that in Theorem 20.1 all vertex weights are nonzero; this is by our definition of weightedgraphs in this section. So when we apply this theorem we need to make sure that this is satisfied.If H is a weighted graph, ϕ : [ k ] → V ( H ) where k ≥ ϕ ([ k ])are removed during the twin reduction of H to (cid:101) H , then by defining (cid:101) ϕ ( i ) = (cid:103) ϕ ( i ) for each i ∈ [ k ],where (cid:103) ϕ ( i ) denotes the equivalence class that ϕ ( i ) belongs to in V ( (cid:101) H ), we get a well-defined map (cid:101) ϕ : [ k ] → V ( (cid:101) H ). Then it is easy to check that hom ϕ ( G, H ) = hom (cid:101) ϕ ( G, (cid:101) H ) for any G ∈ PLG simp [ k ].Given weighted graphs H = H A , D and H (cid:48) = H A (cid:48) , D (cid:48) , the tensor product of H and H (cid:48) is a graphdenoted by H × H (cid:48) with vertex set V ( H ) × V ( H (cid:48) ), each vertex ( u, u (cid:48) ) has weight D u D (cid:48) u (cid:48) , and theedge between ( u, u (cid:48) ) and ( v, v (cid:48) ) has weight A u,v A (cid:48) u (cid:48) ,v (cid:48) . Clearly, if H and H (cid:48) have no zero vertexweights, then neither does H × H (cid:48) . Also note that if H and H (cid:48) are edge-weighted graphs (i.e.,all vertex weights are 1), then so is H × H (cid:48) . Clearly, H × H (cid:48) and H (cid:48) × H are isomorphic, andalso ( H × H (cid:48) ) × H (cid:48)(cid:48) and H × ( H (cid:48) × H (cid:48)(cid:48) ) are isomorphic. The edge weight matrix corresponding to H A × H A (cid:48) is A ⊗ A (cid:48) , and the pair corresponding to H A , D × H A (cid:48) , D (cid:48) is ( A ⊗ A (cid:48) , D ⊗ D (cid:48) ).Now if H and H (cid:48) are weighted graphs, ϕ : [ k ] → V ( H ) and ψ : [ k ] → V ( H (cid:48) ), thenhom ϕ × ψ ( G, H × H (cid:48) ) = hom ϕ ( G, H ) · hom ψ ( G, H (cid:48) )for any G ∈ PLG simp [ k ]. Here ϕ × ψ : [ k ] → V ( H × H (cid:48) ) is defined by ( ϕ × ψ )( i ) = ( ϕ ( i ) , ψ ( i )).Similarly, we can define the tensor product of any finite number of graphs and show similarproperties.Now we are ready to prove that the simple graphs of bounded degree. Theorem 20.2. Let A ∈ C m × m be a symmetric matrix and Γ be an edge gadget. If M Γ , A is notmult-brk- , then there exists a simple edge gadget Γ (cid:48) such that the matrix M Γ (cid:48) , A is not mult-brk- . roof. Let u ∗ , v ∗ be the distinguished vertices of Γ (in this order). Let C = M Γ , A . Then C i,j = (cid:88) ξ : V (Γ) → [ m ] ξ ( u ∗ )= i, ξ ( v ∗ )= j (cid:89) ( u,v ) ∈ E (Γ) A ξ ( u ) ,ξ ( v ) = hom ( i,j ) (Γ , H A )for 1 ≤ i, j ≤ m . By Lemma 3.1, in the field Q ( { A i,j } mi,j =1 ) the roots of unity form a finitecyclic group. Suppose R is (or any positive multiple of) this order. We can fix a root of unity ε R ∈ Q ( { A i,j } mi,j =1 ) of order R .Since C is not mult-brk-1, for some 1 ≤ i < i ≤ m and 1 ≤ j < j ≤ m , the 2 × (cid:18) C i ,j C i ,j C i ,j C i ,j (cid:19) contains at least three nonzero entries and its R th Hadamard power is nondegerate, i.e., C Ri ,j C Ri ,j − C Ri ,j C Ri ,j (cid:54) = 0 . Let ( x, y ) ∈ { i , i } × { j , j } be so that for I = ( { i , i } × { j , j } ) \ { x, y } = { ( a , b ) , ( a , b ) , ( a , b ) } , we have C i,j (cid:54) = 0 for each ( i, j ) ∈ I . Then( (cid:89) ( i,j ) ∈ I C i,j ) C Ri ,j C Ri ,j (cid:54) = ( (cid:89) ( i,j ) ∈ I C i,j ) C Ri ,j C Ri ,j which is the same as( (cid:89) ( i,j ) ∈ I hom ( i,j ) (Γ , H A ))(hom ( i ,j ) (Γ , H A )) R (hom ( i ,j ) (Γ , H A )) R (cid:54) = ( (cid:89) ( i,j ) ∈ I hom ( i,j ) (Γ , H A ))(hom ( i ,j ) (Γ , H A )) R (hom ( i ,j ) (Γ , H A )) R . (20.3)Let x = ( a , a , a , i , . . . , i (cid:124) (cid:123)(cid:122) (cid:125) R times , i , . . . , i (cid:124) (cid:123)(cid:122) (cid:125) R times ) , x = ( a , a , a , i , . . . , i (cid:124) (cid:123)(cid:122) (cid:125) R times , i , . . . , i (cid:124) (cid:123)(cid:122) (cid:125) R times ) y = ( b , b , b , j , . . . , j (cid:124) (cid:123)(cid:122) (cid:125) R times , j , . . . , j (cid:124) (cid:123)(cid:122) (cid:125) R times ) , y = ( b , b , b , j , . . . , j (cid:124) (cid:123)(cid:122) (cid:125) R times , j , . . . , j (cid:124) (cid:123)(cid:122) (cid:125) R times )so x , x , y , y ∈ [ m ] R +3 (here x = x ). Next, put H (cid:48) = H A ⊗ (2 R +3) so V ( H ) = [ m ] R +3 . Then(20.3) becomes hom ( x ,y ) (Γ , H (cid:48) ) (cid:54) = hom ( x ,y ) (Γ , H (cid:48) ) . (20.4)Consider the graph (cid:102) H (cid:48) obtained from H (cid:48) after the twin reduction step. Since H (cid:48) = H A ⊗ (2 R +3) is onlyedge-weighted (all vertex weights are 1), during the twin reduction step the vertices corresponding tothe twin equivalence classes have positive integer weights, so none of them are removed. Thus every86 ∈ V ( H (cid:48) ) maps to some well-defined (cid:101) u ∈ V ( (cid:102) H (cid:48) ) under this reduction step. Then (cid:102) x , (cid:102) x , (cid:101) y , (cid:101) y ∈ V ( (cid:102) H (cid:48) ) andhom ( x ,y ) (Γ , H (cid:48) ) = hom ( (cid:102) x , (cid:101) y ) (Γ , (cid:102) H (cid:48) ) , hom ( x ,y ) (Γ , H (cid:48) ) = hom ( (cid:102) x , (cid:101) y ) (Γ , (cid:102) H (cid:48) )and therefore hom ( (cid:102) x , (cid:101) y ) (Γ , (cid:102) H (cid:48) ) (cid:54) = hom ( (cid:102) x , (cid:101) y ) (Γ , (cid:102) H (cid:48) ) . (20.5)It follows that there is no automorphism ϕ ∈ Aut( (cid:102) H (cid:48) ) such that ϕ ( (cid:102) x ) = (cid:102) x and ϕ ( (cid:101) y ) = (cid:101) y ,otherwise (20.5) is not true. Now applying Theorem 20.1 we get that for some Γ (cid:48) ∈ PLG simp [2],hom ( (cid:102) x , (cid:101) y ) (Γ (cid:48) , (cid:102) H (cid:48) ) (cid:54) = hom ( (cid:102) x , (cid:101) y ) (Γ (cid:48) , (cid:102) H (cid:48) ) . The 2-labeled simple graph Γ (cid:48) is just a simple edge gadget with two (ordered) distinguished vertices(and no edge between these two vertices). Becausehom ( x ,y ) (Γ (cid:48) , H (cid:48) ) = hom ( (cid:102) x , (cid:101) y ) (Γ (cid:48) , (cid:102) H (cid:48) ) , hom ( x ,y ) (Γ (cid:48) , H (cid:48) ) = hom ( (cid:102) x , (cid:101) y ) (Γ (cid:48) , (cid:102) H (cid:48) )we get hom ( x ,y ) (Γ (cid:48) , H (cid:48) ) (cid:54) = hom ( x ,y ) (Γ (cid:48) , H (cid:48) )and therefore( (cid:89) ( i,j ) ∈ I hom ( i,j ) (Γ (cid:48) , H A ))(hom ( i ,j ) (Γ (cid:48) , H A )) R (hom ( i ,j ) (Γ (cid:48) , H A )) R (cid:54) = ( (cid:89) ( i,j ) ∈ I hom ( i,j ) (Γ (cid:48) , H A ))(hom ( i ,j ) (Γ (cid:48) , H A )) R (hom ( i ,j ) (Γ (cid:48) , H A )) R . (20.6)Putting B = M Γ (cid:48) , A , we obtain B i,j = (cid:88) ξ : V (Γ (cid:48) ) → [ m ] ξ ( u ∗ )= i, ξ ( v ∗ )= j (cid:89) ( u,v ) ∈ E (Γ (cid:48) ) A ξ ( u ) ,ξ ( v ) = hom ( i,j ) (Γ (cid:48) , H A )for 1 ≤ i, j ≤ m . Then (20.6) rewrites as( (cid:89) ( i,j ) ∈ I B i,j ) B Ri ,j B Ri ,j (cid:54) = ( (cid:89) ( i,j ) ∈ I B i,j ) B Ri ,j B Ri ,j . (20.7)This means that (1) B i,j (cid:54) = 0 for each ( i, j ) ∈ I , so the 2 × (cid:18) B i ,j B i ,j B i ,j B i ,j (cid:19) has at least three nonzero entries, and (2) its R th Hadamard power is nondegenerate. This certifiesthat B (cid:12) R is not block-rank-1. Since B i,j = hom ( i,j ) (Γ (cid:48) , H A ) ∈ Q ( { A i,j } mi,j =1 ) for i, j ∈ [ m ], fromLemma 3.6 it follows that B is not mult-brk-1 and we are done.87 emark: Using the proof of Theorem 20.1 in [7], we can actually construct such Γ (cid:48) ∈ PLG simp [2]explicitly given A .Now we prove the following statement which follows from Corollary 5.2. We use a subscriptsimp and a superscript (∆) to denote the restriction of an EVAL problem to simple graphs ofmaximum degree at most ∆. Corollary 20.3. Let A ∈ C m × m a symmetric matrix. Let Γ be a simple edge gadget. If M Γ , A isnot mult-brk- , then for some ∆ > , the problem EVAL (∆)simp ( A ) is We repeat the proof of Corollary 5.3. Because the edge gadget Γ is simple, the graph G (cid:48) obtained by substituting the simple edge gadget for every edge is also simple in addition to havingbounded degree. The Corollary follows.The M Γ , A is not mult-brk-1. Applying Theorem 20.2 and Corollary 20.3, we have proved the followingtheorem. Theorem 20.4. Let A be a symmetric and algebraic complex matrix. Then either Z A ( · ) can becomputed in polynomial time on arbitrary graphs G , or for some ∆ > depending on A , it is simple graphs of degree at most ∆ . 21 Decidability in polynomial time of Theorems 1.1 and 20.4 In this section, we prove that the following decision problem is computable in polynomial time inthe size of A : Given a symmetric A ∈ C m × m with algebraic entries, decide whether A satisfies thetractability criterion in Theorem 1.1 (which is the same as in Theorem 20.4). Thus in polynomialtime we can decide in which category does EVAL( A ) fall, either EVAL( A ) is tractable for arbitrarygraphs, or for some ∆ > (∆)simp ( A ) is 22 Constructivity By now, we have obtained the dichotomy for EVAL( A ) (where A is a complex symmetric matrixwith algebraic entries) for bounded degree graphs, Theorem 1.1, and its extension to boundeddegree simple graphs, Theorem 20.4. We will argue that this dichotomy and its extension are bothconstrucitve. This notion of constructivity is understood in the following sense. Theorem 22.1. There is an algorithm such that on input a symmetric and algebraic complexmatrix A , . if EVAL( A ) is tractable by the tractability criterion in this paper, then outputs an algorithmthat computes G (cid:55)→ Z A ( G ) in polynomial time in the size of the input graph G ;2. else , outputs a polynomial-time reduction from a canonical , to EVAL (∆)simp ( A ) for some ∆ > depending on A . By contrast, the existing proof of the dichotomy in [6] is not constructive in this sense. We firstargue why Theorem 1.1 is constructive and then we do the same for Theorem 20.4. After that,we will show that we can also make the main dichotomy, Theorem 1.1 from [6], constructive bymaking some adjustments to its proof. In order to have a constructive proof of Theorem 1.1, we entirely avoided using the three pinninglemmas from [6] (Lemmas 4.1, 4.3 and Corollary 8.4 of [6], respectively). All our proofs have beenintentionally designed to avoid these pinning steps wherever [6] made use of them.First, we show that all edge gadgets we used in our proofs through the meta-arguments Argu-ments 11.7, 11.10, and 12.1, i.e., ( Meta ), ( Meta ) and ( Meta ) can be obtained constructively.This starts with all the reused edge gadgets from [6]. Whenever we said that there exists anedge gadget Γ obtained by adapting a proof from [6] whose signature matrix (e.g., M Γ , A , M Γ , C , D ,etc.) is not mult-brk-1 or mod-brk-1, such an edge gadget can always be found in finite time. Aseemingly questionable point related to this is the use of limiting arguments in some of the proofsfrom [6]. (More precisely, it is done in Section 8.4.2 of [6] on pp. 966 – 977, as part of the proofof Lemma 8.12, and in Section 9.2 on pp. 983 – 988, as part of the proof of Theorem 5.4.) Allsuch arguments can be captured by the following statement: Assuming some of the tractabilityconditions imposed at the corresponding step are not satisfied, for the constructed sequence ofgadgets say (Γ n ) ∞ n =1 , there is an n ≥ M n (e.g., M n = M Γ n , A ) isnot mult-brk-1 or mod-brk-1. But for a fixed n this non-mult-brk-1 or non-mod-brk-1 conditionis computable in our strict Turing model of computation, and so by an open-ended search we areguaranteed to find an n for which M n is not mult-brk-1 or mod-brk-1. The other edge gadgetconstructions from [6] are easily seen to be constructive, even if they are parametrized. As theseparameters can be explicitly bounded, they are computable in finite time as well.This way we can assume that all reused edge gadgets from [6] can be computed as well as thoseobtained through the meta-arguments Arguments 11.7, 11.10, and 12.1, i.e., ( Meta ), ( Meta ) and( Meta ). Thus all gadgets are constructively obtained before the thickening stage from Theorem 6.1is applied. Now we argue the constructivity of Theorem 6.1.We point out that all invocations of Theorem 6.1 in this paper eventually arise from the applica-tions of the meta-arguments Arguments 11.7, 11.10, and 12.1, i.e., ( Meta ), ( Meta ) and ( Meta ),and the nonbipartite case invokes the bipartite case. In order to apply Theorem 6.1, we have towork with the order R of the finite cyclic group of roots of unity in Q ( { A i,j } mi,j =1 ) (see Corollary 3.3).Since the entries of A ∈ C m × m are algebraic over Q , we have k = [ Q ( { A i,j } mi,j =1 ) : Q ] < ∞ and itcan be computed.We know that (cid:112) R/ ≤ ϕ ( R ) ≤ [ Q ( { A i,j } mi,j =1 ) : Q ] = k and therefore R ≤ k . In the proofof Theorem 6.1, an explicitly bounded p ≥ q a,b ( X ). This p depends only on m , R and Γ. We fix Γ in our reasoning because wecan compute it as justified above. To determine R , one can use a P-time factoring algorithm forpolynomials over an algebraic number field and factor all cyclotomic polynomials of degree up to89 k [29, 28, 27]. Alternatively to just get a computable upper bound, one can also avoid factoringpolynomials and note that R | (2 k )!. Then we use a positive multiple (2 k )! = Rr of R , where r ≥ Rr in placeof R . Then p ≥ M (cid:12) ( Rr )Γ , A (cid:12) p isnot block-rank-1. All other steps concerning edge gadgets can be easily seen to be constructive.This way we have justified that all edge gadgets Γ (including the ones obtained after applyingTheorem 6.1) can be computed.When we regularize a matrix for both the bipartite case and the nonbipartite cases, we invokeTheorem 5.1 from Theorem 6.1 directly if A is not mult-brk-1. In this case an edge is our gadget.Now consider the constructivity of Theorem 5.1, Corollaries 5.2 and 5.3 (excluding the Bulatov-Grohe dichotomy Theorem 2.12).The Meta ), ( Meta ) and ( Meta ). The proof of Corollary 5.3 is a simple invocation of Corollary 5.2whose proof in turn is a simple invocation of Theorem 5.1, so provided the proof of Theorem 5.1is constucitive, the proof Corollary 5.3 is constructive as well. We now argue that the proof ofTheorem 5.1 is indeed constructive.The construction in the proof of Theorem 5.1 depends on two parameters, first p ≥ (cid:96) ≥ 1. The parameter p ≥ p in the size of A and D . We can take the first p ≥(cid:98) ln(2 m ) / ln(1 /γ ) (cid:99) + 1 in the proof of Lemma 3.26, and γ can be constructed from the entries of A and D in polynomial time. This shows that this lower bound for p is polynomial in the size of A and D , and so p can be computed in polynomial time in the size of A and D . Having chosen p ≥ 1, we can further bound (cid:96) ≥ A ∈ C m × m in the context of Lemmas 3.14. The proof of Corollary 3.15 alsoinvokes dichotomy by Bulatov and Grohe (Theorem 2.12). Now we argue how to make Theorem 2.12constructive. This is the most nontrivial step for the constructivity of Theorem 1.1.In order to discuss the constructivity of Theorem 2.12, we need to introduce a very importantpinning step.Let A be an m × m symmetric complex matrix. We define a new problem EVALP ( A ), whichis the pinned version of EVAL ( A ): The input is a triple ( G, w, i ), where G ∈ PLG [1] is a 1-labeledgraph with a distinguished vertex w ∈ V ( G ), and a domain element i ∈ [ m ]; the output ishom ( i ) ( G, H A ) = (cid:88) ξ : V ( G ) → [ m ] , ξ ( w )= i (cid:89) uv ∈ E ( G ) A ξ ( u ) ,ξ ( v ) . (In [6] this is denoted as Z A ( G, w, i ).) It is easy to see that EVAL ( A ) ≤ EVALP ( A ). The otherdirection also holds. Lemma 22.2 (First pinning lemma, Lemma 4.1 from [6]) . EVALP ( A ) ≡ EVAL ( A ) . The proof of the first pinning lemma in [6] is nonconstructive. To describe this, we define anequivalence relation ∼ over [ m ]: i ∼ j if for any G ∈ PLG [1], hom ( i ) ( G, H A ) = hom ( j ) ( G, H A ).90iven a symmetric A ∈ C m × m , it was not known how to compute ∼ . (In [6] it was noted thatit may be possible to compute this using [39], but in fact the techniques given in that paper appearto be insufficient. This can in fact be computed using results in [7], in particular, the proof ofTheorem 20.1 which is constructive.) It can be checked that other than ∼ , the first pinning lemma(Lemma 4.1 in [6]) is proved constructively.Concerning the nonnegative case, it can be checked that, with the exception of the so-called pin-ning steps, the proofs of the Bulatov-Grohe dichotomy Theorem 2.12 in [4, 42, 21] are constructivein the above sense. In the terminology of [6], this corresponds to the first pinning lemma restrictedto the case when A is a nonnegative symmetric matrix with algebraic entries. Therefore it sufficesto show how to compute ∼ in the nonnegative case in order to make the proof of Theorem 2.12constructive.This can be done by applying the results in [33] (see also [34] for a small correction suggestedby Martin Dyer which needs to be applied to this paper). However, this method can involve anopen-ended search, with no a priori time bounds.To be more concrete, given i, j ∈ [ m ] and a symmetric nonnegative A ∈ R m × m , we determinewhether i ∼ j as follows. Recall that (cid:103) H A denotes the twin-free graph obtained after applying thetwin compression step to A . As all vertices in H A have weight 1, during the twin compressionstep no vertex is removed, so each i ∈ [ m ] maps to (cid:101) i ∈ (cid:103) H A having a positive integer vertex weight.Then hom ( i ) ( G, H A ) = hom ( (cid:101) i ) ( G, (cid:103) H A ), for any G ∈ PLG [1]. Then for any i, j ∈ [ m ], i ∼ j iffhom ( (cid:101) i ) ( G, (cid:103) H A ) = hom ( (cid:101) j ) ( G, (cid:103) H A ) for all G ∈ PLG [1]. Because (cid:103) H A is twin-free, by Lemma 2.4from [33] this is equivalent to the existence of a (cid:101) ϕ ∈ Aut( (cid:103) H A ) such that (cid:101) ϕ ( (cid:101) i ) = (cid:101) j .However, in case i (cid:54)∼ j , finding a separating “witness” G ∈ PLG [1] for which hom ( (cid:101) i ) ( G, (cid:103) H A ) (cid:54) =hom ( (cid:101) j ) ( G, (cid:103) H A ) may require an open-ended search because the proof of Lemma 2.4 from [33] isnonconstructive. In this context, this means that we can enumerate all graphs from PLG [1] andsearch for such a separating “witness ”; we know that eventually we will find one.We point out that the result and proof in [7] do provide an explicit finite set of witnesses tocheck.This completes the discussion on the constructivity for the ↔ ( C , D ) instead of just EVAL( C , D ). These problems are equivalent, but the equivalenceproof is not constructive.) In the nonbipartite case, the tractability proof is the same as in [6](Section 16) and does not invoke the second pinning lemma (Lemma 4.3 from [6]). We note thatboth proofs are reliant of Theorem 15.1 (Theorem 12.3 from [6]) and its proof is partitioned intoLemma 12.7 (for the case q = p k where p is an odd prime and k is a positive integer) and Lemma12.9 (for the case q = 2 k where k is a positive integer) from Section 12.3 in [6]). We note that theproof of Lemma 12.9 for the case k = 1 (so q = 2) uses the tractability result from [8, Theorem 6.30]or [31] but they are both constructive. The rest can be easily seen to be constructive. We canconclude that our tractability proof is indeed constructive.We have proved Theorem 22.1, the constructivity of Theorem 1.1.91 The dichotomy in Theorem 20.4 is a continuation of the dichotomy from Theorem 1.1. We showhow to make constructive transfers to simple graphs for non-mult-brk-1 or non-mod-brk-1 gadgets.We only need to take care of Theorem 20.2 and Corollary 20.3.Theorem 20.2 is used to construct simple edge gadgets. The constructivity of this theorementirely depends on that of Theorem 20.1 from [7] and the ability to compute R , the order of thefinite cyclic group of roots of unity in Q ( { A i,j } mi,j =1 ).The proof of Theorem 20.1 in [7] actually produces an explicit finite list of graphs G ∈PLG simp [ k ], such that if there is no isomorphism from H to H (cid:48) , then hom ϕ ( G, H ) (cid:54) = hom ψ ( G, H (cid:48) )for some G on this list. When applied inside the proof of Theorem 20.2 with k = 2, this results inan explicit finite list of edge gadgets that contains an edge gadget Γ (cid:48) promised by Theorem 20.2.(One can also avoid running the polynomial factoring algorithm [29, 28, 27] by using a positivemultiple Rr = (2 k )! instead of R .)The References [1] A. I. Barvinok. Combinatorics and Complexity of Partition Functions , volume 30 of Algorithmsand combinatorics . Springer, 2017.[2] A. I. Barvinok and P. Sober´on. Computing the partition function for graph homomorphisms. Combinatorica , 37(4):633–650, 2017.[3] R. J. Baxter. Exactly Solved Models in Statistical Mechanics . Academic Press, London, 1982.[4] A. Bulatov and M. Grohe. The complexity of partition functions. Theor. Comput. Sci. , 348(2-3):148–186, 2005. A preliminary version appeared in ICALP 2004: 294–306.[5] J.-Y. Cai and X. Chen. Complexity Dichotomies for Counting Problems , volume 1: BooleanDomain. Cambridge University Press, 2017. doi:10.1017/9781107477063 .[6] J.-Y. Cai, X. Chen, and P. Lu. Graph homomorphisms with complex values: A dichotomytheorem. SIAM J. Comput. , 42(3):924–1029, 2013.927] J.-Y. Cai and A. Govorov. On a theorem of Lov´asz that hom( · , H ) determines the isomorphismtype of H . In Proceedings of the 11th Innovations in Theoretical Computer Science (ITCS) ,pages 17:1–17:15, 2020. Full version available at https://arxiv.org/abs/1909.03693 .[8] L. Carlitz. Kloosterman sums and finite field extensions. Acta Arithmetica , 16(2):179–193,1969.[9] P. Dusart. The k th prime is greater than k (log k + log log k − 1) for k ≥ Mathematics ofComputation , 68(225):411–415, 1999.[10] M. E. Dyer, A. M. Frieze, and M. Jerrum. On counting independent sets in sparse graphs. SIAM J. Comput. , 31(5):1527–1541, 2002.[11] M. E. Dyer and C. S. Greenhill. The complexity of counting graph homomorphisms. RandomStruct. Algorithms , 17(3-4):260–289, 2000. A preliminary version appeared in SODA 2000:246–255.[12] M. E. Dyer and C. S. Greenhill. Corrigendum: The complexity of counting graph homomor-phisms. Random Struct. Algorithms , 25(3):346–352, 2004.[13] M. Freedman, L. Lov´asz, and A. Schrijver. Reflection positivity, rank connectivity, andhomomorphism of graphs. Journal of the American Mathematical Society , 20:37–51, 2007.[14] M. Freedman, L. Lov´asz, and A. Schrijver. Reflection positivity, rank connectivity, and homo-morphism of graphs. J. Amer. Math. Soc. , 20(1):37–51, 2007.[15] G. Ge. Algorithms related to multiplicative representations of algebraic numbers . PhD thesis,University of California, Berkeley, 1993.[16] G. Ge. Testing equalities of multiplicative representations in polynomial time. In Proceedingsof the 34th Annual IEEE Symposium on Foundations of Computer Science (FOCS) , pages422–426, 1993.[17] L. A. Goldberg, M. Grohe, M. Jerrum, and M. Thurley. A complexity dichotomy for partitionfunctions with mixed signs. SIAM J. Comput. , 39(7):3336–3402, 2010.[18] L.A. Goldberg and H. Guo. The complexity of approximating complex-valued Ising and Tuttepartition functions. Computational Complexity , 26(4):765–833, 2017.[19] L.A. Goldberg and M. Jerrum. Approximating the partition function of the ferromagneticPotts model. J. ACM , 59(5):25:1–25:31, 2012.[20] A. Govorov, J.-Y. Cai, and M. Dyer. A dichotomy for bounded degree graph homomorphismswith nonnegative weights. arXiv:2002.02021 , 2020. URL: https://arxiv.org/abs/2002.02021 .[21] M. Grohe and M. Thurley. Counting homomorphisms and partition functions. In M. Groheand J. Makowsky, editors, Model Theoretic Methods in Finite Combinatorics , volume 558 of Contemporary Mathematics , pages 243–292. American Mathematical Society, 2011.[22] P. Hell and J. Neˇsetˇril. Graphs and Homomorphisms . Oxford University Press, 2004.9323] T. Helmuth, W. Perkins, and G. Regts. Algorithmic Pirogov-Sinai theory. In Proceedings of the51st Annual ACM SIGACT Symposium on Theory of Computing (STOC) , pages 1009–1020,2019.[24] E. Ising. Beitrag zur Theorie des Frromagnetismus. Z. Phys. , 31(1):253–258, 1925.[25] M. Jerrum and A. Sinclair. Polynomial-time approximation algorithms for the Ising model. SIAM J. Comput. , 22(5):1087–1116, 1993.[26] H. W. Lenstra Jr. Algorithms in algebraic number theory. Bull. Amer. Math. Soc. , 26(2):211–244, 1992.[27] S. Landau. Factoring polynomials over algebraic number fields. SIAM Journal on Computing ,14(1):184–195, 1985.[28] A. K. Lenstra. Factoring polynomials over algebraic number fields. In J. A. van Hulzen, editor, Computer Algebra , volume 162 of Lecture Notes in Computer Science , pages 245–254. SpringerBerlin Heidelberg, 1983.[29] A. K. Lenstra, H. W. Lenstra Jr., and L´aszl´o Lov´asz. Factoring polynomials with rationalcoefficients. Mathematische Annalen , 261(4):515–534, 1982.[30] L. Li, P. Lu, and Y. Yin. Correlation decay up to uniqueness in spin systems. In Proceedings ofthe 24th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA) , pages 67–84, 2013.[31] R. Lidl and H. Niederreiter. Finite fields . volume 20 of Encyclopedia of Mathematics and itsApplications. Cambridge University Press, Cambridge, 1997.[32] L. Lov´asz. Operations with structures. Acta Mathematica Hungarica , 18:321–328, 1967.[33] L. Lov´asz. The rank of connection matrices and the dimension of graph algebras. Eur. J.Comb. , 27(6):962–970, 2006.[34] L. Lov´asz. On the dimension of graph algebras for homomorphism functions, 2013. https://web.cs.elte.hu/~lovasz/book/homnotes-6-4-1.pdf .[35] H. Peters and G. Regts. Location of zeros for the partition function of the Ising model onbounded degree graphs. arXiv:1810.01699 , 2018. URL: https://arxiv.org/abs/1810.01699 .[36] R. B. Potts. Some generalized order-disorder transformations. Mathematical Proceedings ofthe Cambridge Philosophical Society , 48(1):106–109, 1952.[37] R. B. Potts and J. C. Ward. The combinatrial method and the two-dimensional Ising model. Progress of Theoretical Physics , 13(1):38–46, 1955.[38] B. Rosser. Explicit bounds for some functions of prime numbers. American Journal of Math-ematics , 63(1):211–232, 1941.[39] A. Schrijver. Graph invariants in the spin model. J. Comb. Theory Ser. B , 99(2):502–511,2009. 9440] A. Sinclair, P. Srivastava, and M. Thurley. Approximation algorithms for two-state anti-ferromagnetic spin systems on bounded degree graphs. In Proceedings of the 23rd AnnualACM-SIAM Symposium on Discrete Algorithms (SODA) , pages 941–953, 2012.[41] A. Sly. Computational transition at the uniqueness threshold. In Proceedings of the 51stAnnual IEEE Symposium on Foundations of Computer Science (FOCS) , pages 287–296, 2010.[42] M. Thurley. The Complexity of Partition Functions . PhD thesis, Humboldt Universit¨at zuBerlin, 2009.[43] D. Weitz. Counting independent sets up to the tree threshold. In Proceedings of the 38thAnnual ACM SIGACT Symposium on Theory of Computing (STOC) , pages 140–149, 2006. A Appendix A.1 P-time decidability of Theorems 1.1 and 20.4 We go through the proof of Theorems 1.1, and verify that the tractability criterion is polynomialtime decidable.In our proof of Theorems 1.1 and 20.4, the case EVAL (∆)simp ( A ) is > M Γ , A is not mult-brk-1. On the other hand, thetractability criterion described in this paper, when applied to A , is essentially the same as thatin [6]. Therefore, the polynomial time decidability of Theorems 1.1 and 20.4 will basically followthat of the dichotomy in [6]. We only point out a few slight differences.The first step is the reduction to connected components done in Section 4.3 in [6]. We performa corresponding step in Section 7. Then the tractability criteria in both papers consist of workingwith each connected component of A separately so we may assume A is connected. Then we areeither in the bipartite or the nonbipartite case. From Theorem 17.1 (Section 17) in [6] which usesthe results from [15, 16] (formulated as Theorem 17.3 in [6]), it follows that for a complex matrix A a generating set G = { g , . . . , g d } ⊂ Q ( A ) of the set of nonzero entries A of A can be found inpolynomial time. Then a purification A of A (obtained by going from ( g , . . . , g d ) to ( p , . . . , p d ))can also be computed in polynomial time. Here we use the fact that we can get d ≤ m efficiently.We note that this inequality is true because the group generated by the nonzero elements of A is afinitely generated abelian group generated by at most m generators and it has rank at most m ,and the approach described in the proof of Theorem 17.1 (Section 17) in [6] uses this principle.Also, we use the fact the d smallest primes p < . . . < p d can be computed in polynomial time in d . † The difference between [6] and our paper is that in [6] a purification was applied immediatelyto the connected A (in both bipartite and nonbipartite cases) so from that point A was assumedto be already purified, whereas in our paper we compute its purification A and then both A , A are passed on to the next step. This subtle difference is indicated in conditions ( S )–( S ) (resp.( S (cid:48) )– S (cid:48) ) between the two papers. (Of course, for this to happen we need A to be a regularizedmatrix, otherwise we terminate and the corresponding problem is Shape ) (resp. ( Shape (cid:48) )) conditions, the difference is that in [6] the pair ( C , D ) is obtained † This statement follows from the prime number theorem, i.e., π ( n ) ∼ n/ ln( n ) for large n . However, we can usean explicit bound log n + log log n − < p n n < log n + log log n for n ≥ A , whereas in our paper ( C , D ) results from the nonpurified A and ( C , D )from its purification A . Finally, the tractability criteria in both papers converge when we get toconditions ( U – U ) (resp. ( U (cid:48) – U (cid:48) )) for the inner pairs. At this point, ( C , D ) denotes the normalizedinner pair ( X , Y ) in both papers.We note that the tractability criterion from [6], when applied to our matrix A , is actuallyconsistent with the tractability criterion from this paper. In [6], it will first convert A to A andthen produce ( C , D ) (if possible), and after that it goes to the inner pair, renamed ( C , D ), ifpossible, and the rest is trivial. A.2 Making the dichotomy in [6] constructive Now we remark how to make the dichotomy in [6] (Theorem 1.1) constructive. The nonconstructivesteps for the proof are the following (page numbers below refer to [6]):1. The first pinning lemma (Lemma 4.1) from Section 4.1 on p. 937. We need to apply it forcomplex symmetric A (with algebraic entries). Its usages are(a) in Section 4.1 on p. 940 to reduce to connected matrices;(b) in the proof of the third pinning lemma (Corollary 8.4).2. The second pinning lemma (Lemma 4.3) from Section 4.1 on p. 938 (and its direct Corol-lary 4.4 on p. 938). Its usages are(a) in the proof of Lemma 8.24 from Section 8.5 (Step 2.4) on p. 978 (lines -17 – -15):it is used to show that the problems of computing Z → C (cid:48)(cid:48) , L and Z ← C (cid:48)(cid:48) , L are reducible toEVAL( C (cid:48)(cid:48) , L );(b) in Section 8.6 (Step 2.5 which is the normalization step for the bipartite case) on p. 980(lines -17 – -13): it is used (implicitly) to show that the problems of computing Z → C , D and Z ← C , D (resp. Z → X , Y and Z ← X , Y ) are reducible to EVAL( C , D ) (resp. EVAL( X , Y ));(c) in Section 12.1 (inside the tractability part for the bipartite case) in the proof ofLemma 12.2 on p. 1002 (lines -14 – -13): it is used to show that Z → C [ i ] , D [ i ] and Z ← C [ i ] , D [ i ] are reducible to EVAL( C [ i ] , D [ i ] ) for i ∈ { , } .We see that all applications of the second pinning lemma are limited to its weaker form,namely Corollary 4.4. We also note that we do not need to use the second pinning lemma(a) in Section 13.3 (Step 2.4, inside the reduction part for the nonbipartite case) to proveLemma 13.6 (EVAL( F , D ) ≡ EVAL( H , L )) from Section 13.3 (Step 2.4) on p. 1016;(b) in Section 13.4 (Step 2.5 which is the normalization step for the nonbipartite case) onp. 1016 (lines 7 – 9).3. The third pinning lemma (Corollary 8.3) from Section 8.1 on p. 954. Its usages are(a) in the proof of Lemma 8.24 from Section 8.5 (Step 2.4) on p. 978 (lines -14 – -11):it is used to show that the problems of computing Z → C , D and Z ← C , D are reducible toEVAL( C , D );(b) we need it to prove Lemma 13.6 (EVAL( F , D ) ≡ EVAL( H , L )) from Section 13.3 (Step2.4) on p. 1016.4. The pinning steps resulting from the applications of the Bulatov-Grohe dichotomy (Theorem2.4 in [6]) which, as discussed earlier in Section 22.1 all boil down to the first pinning lemmabut for nonnegative symmetric A .The proof of the first pinning lemma can be made constructive by the results from [7] for complexsymmetric A . As a consequence, this makes the proof of the third pinning lemma constructive96ince it only invokes a single application of the first pinning lemma and this invocation is its onlynonconstructive step. In addition, this makes the applications of the Bulatov-Grohe dichotomyconstructive.We do not know how to make the proof of the second pinning lemma constructive but we willshow how to avoid it entirely while preserving the validity or the dichotomy from [6] (Theorem 1.1)by making slight modifications to its proof.1. In Section 8.5 on p. 978, we reformulate Lemma 8.24 to state EVAL( C , D ) ≡ EVAL ↔ ( C (cid:48)(cid:48) , L ).To prove this, we reason as follows: For one direction, by the argument in the proof ofLemma 8.24, EVAL( C , D ) ≤ EVAL ↔ ( C (cid:48)(cid:48) , L ). For the other direction, the main conse-quence of Claim 8.25 is that EVAL ↔ ( C (cid:48)(cid:48) , L ) ≤ EVAL ↔ ( C , D ). Also it is quite clear thatEVAL ↔ ( C , D ) ≤ EVALP( C , D ), the pinned version of EVAL( C , D ). Then, by the third pin-ning lemma whose proof has been made constructive, we have EVALP( C , D ) ≡ EVAL( C , D ).We conclude that EVAL( C , D ) ≡ EVAL ↔ ( C (cid:48)(cid:48) , L ), which implies our reformulation of Lemma8.24. This way we do not use the second pinning lemma here.2. Continuing the previous step, in Section 8.6 we now have an equivalence to EVAL ↔ ( C (cid:48)(cid:48) , L ).Then the normalization step described on p. 980 results in a pair ( X , Y ) for which we nowhave EVAL ↔ ( C (cid:48)(cid:48) , L ) ≡ EVAL ↔ ( X , Y ). This way we do not use the second pinning lemmahere either. Note that we still have access to EVAL( X , Y ) as EVAL( X , Y ) ≤ EVAL ↔ ( X , Y ).Thus we can still use EVAL( X , Y ) for the ↔ ( X , Y ) instead of EVAL( X , Y ). Therest of the A ) ≤ EVAL ↔ ( C , D ) constructively. (Note that here( C , D ) is renamed for the pair ( X , Y ) at the beginning of Section 9 on p. 980 and is differentfrom the previous one.) However, regarding tractability for the bipartite case we need to showthat EVAL ↔ ( C , D ) is tractable, instead of just EVAL( C , D ) specified in Theorem 5.3 on p.941, without involving nonconstructive steps. We show how to do it by making adjustmentto the proof of this theorem given in Section 12. In Section 12.1, we reformulate Lemma 12.2,replacing EVAL( C [ i ] , D [ i ] ) by EVAL ↔ ( C [ i ] , D [ i ] ) for i ∈ { , , } , respectively. With theseadjustments the proof goes through without involving the second pinning lemma. Finally,we note that in Section 12.2, it was actually proved that EVAL → ( C , D ) ≤ EVAL( (cid:98) π ) (i.e., Z → C , D ( G, u ∗ ) is reducible to the problem EVAL( (cid:98) π ) (see p. 980 line -4). As mentioned in [6],EVAL ← ( C , D ) ≤ EVAL( (cid:98) π ) can be shown similarly. Combining these we get EVAL ↔ ( C , D ) ≤ EVAL( (cid:98) π ) constructively. The tractability of EVAL( (cid:98) π ) is evidenced by Theorem 12.1 on p.1001 which is shown in Section 12.3 on p. 1008 and is constructive as noted in Section 22.1.4. As noted earlier for the nonbipartite case (both Theorem A.1 (Constructive version of Theorem 1.1 [6]) . There is an algorithm such that on inputa symmetric and algebraic complex matrix A ,1. if EVAL( A ) is tractable by the tractability criterion in [6], then outputs an algorithm thatcomputes G (cid:55)→ Z A ( G ) in polynomial time in the size of the input graph G ; . else , outputs a polynomial-time reduction from a canonical , to EVAL( A ) . Remark: