Globally optimizing QAOA circuit depth for constrained optimization problems

We develop a global variable substitution method that reduces $n$-variable monomials in combinatorial optimization problems to equivalent instances with monomials in fewer variables. We apply this technique to $3$-SAT and analyze the optimal quantum circuit depth needed to solve the reduced problem using the quantum approximate optimization algorithm. For benchmark $3$-SAT problems, we find that the upper bound of the circuit depth is smaller when the problem is formulated as a product and uses the substitution method to decompose gates than when the problem is written in the linear formulation, which requires no decomposition.


I. INTRODUCTION
The quantum approximate optimization algorithm (QAOA) was introduced to approximately solve combinatorial optimization problems [1,2]. QAOA research has mostly focused on a small subset of combinatorial optimization (CO) problems such as MaxCut, MaxIndSet, and Max k-cover [3][4][5][6][7][8][9]. These problems can be easily written as quadratic unconstrained binary optimization (QUBO) problems by identifying each variable with a qubit. QUBOs are implementable on current hardware [10,11]. Recent work has examined how QAOA can be used on CO problems that can be written as polynomial unconstrained binary optimization problems [12,13]. When solving a CO problem using QAOA, each monomial in k vertices in the problem formulation corresponds to a k qubit gate. The circuit depth for one layer of QAOA for combinatorial optimization (PUBO) problems was shown in [14] to be the edge chromatic number of the graph, or hypergraph, derived from these problems. When the combinatorial optimization problem can be written as a QUBO, the derived graph is not a hypergraph, so the edge chromatic number is either the maximum degree, or the maximum degree plus one [15]. When the derived graph is a hypergraph, the edge chromatic number may be more difficult to compute. Some classes of combinatorial optimization problems, however, can be written in more than one way, where each formulation may have monomials of different sizes. For example, Boolean satsfiability (SAT) problems can be written as a QUBO or a more general PUBO. SAT problems have been studied extensively in a classical setting [16,17] and form the backbone of complexity theory. They can be written in a linear form, which requires two-qubit gates to implement, or a product form, which requires larger multi-qubit gates. Since these larger multi-qubit gates are not easily implementable on current hardware, polynomial formulations must be decomposed into sums of two variable monomials. We show in the context of 3-SAT that decomposing the PUBO can lead to a shallower circuit needing fewer qubits than using the natural QUBO formulation [14]. This has implications for more general combinatorial problems, as modeling approaches can have a significant impact on the design of the resulting circuit.
In this paper, we first review QAOA, the classical linear and product formulations of SAT problems, and how they translate to QUBOs in Sec. II. Then, in Sec. III, we introduce a substitution method, called the global variable substitution (GVS) method, to decompose monomials consisting of k ≥ 3 variables into ones that can be implemented on current hardware. Next, we discuss how to optimize GVS for 3-SAT problems in Sec. IV and then apply this work to instances from the SATLIB Benchmark Problems suite [18] in Sec. V. Finally, we summarize the results and discuss future work in Sec. VI.

II. QAOA AND COMBINATORIAL OPTIMIZATION PROBLEM REVIEW
In this section, we review QAOA, dualization, and the 3-SAT problem.

A. QAOA
In order to use QAOA to solve a CO problem, we apply two operators, U (C, γ) = e −iCγ and U (B, β) = e −iBβ , in succession on an initial state. The initial state is the uniform superposition, |s = 1 √ 2 n z |z , where the sum is over the computation basis |z . The outcome of one iteration of QAOA is |γ, β = U (B, β)U (C, γ)|s .
Here C encodes the problem to be solved and B is a mixing operator. Often, C is the sum over a collection of clauses, C = a C a , and B is typically v is the Pauli-X operator acting on the v th qubit. For more detail about QAOA, see [1,2,19].
There is a direct correlation between the circuit depth and level of noise in a quantum circuit [20][21][22], so it is important to consider the circuit depth when developing a circuit that implements QAOA. In the next subsection, we review dualization and the related previous work that determines the circuit depth of one iteration of QAOA.

B. Dualization and Circuit Depth
Previously [14], we considered the method of dualizing constraints to solve CO problems of the form where p i is contained in the collection of polynomial constraints P . Both p i and c are polynomial functions in R n [x 1 , x 2 , ..., x n ] and b i ∈ R. We eliminate constraints via dualization by subtracting b i from both sides, adding in slack variables, squaring both sides, and adding the new expression to the objective function [14]. The derived (hyper)graph from dualization is one in which there is a vertex for each variable and (hyper)edges between variables that appear in a monomial together. For example, if x 1 x 2 appears in the dualization, there is an edge between vertices x 1 and x 2 . In graph theory, a proper edge coloring of a graph is a function f : E(G) → [k] such that if two edges share a vertex, they receive different values, e.g. uv and xv, f (uv) = f (xv). Given the set [k] = {1, ..., k}, each element of this set can be thought of as a color, hence the name edge coloring. The smallest number m such that a proper edge coloring of a graph G is possible with m colors is denoted χ (G) and called either the chromatic index or the edge chromatic number. It has been shown that chromatic index of the derived (hyper)graph is directly related to the circuit depth of one iteration of QAOA, if the size of each monomial in the objective function is at most the gate size the hardware can support [14]. In particular, the following theorem holds: 14]). Let H be the hypergraph derived from a combinatorial optimization problem instance. Every proper edge coloring of H corresponds to a valid circuit for a PUBO, where the depth of the shallowest circuit is χ (H) + 1.

C. SAT
A Boolean satisfiability problem (SAT) is one type of CO problem that has the form of Eqs. (1)-(3). It is defined by a collection of clauses, C, consisting of N literals. The goal is to determine if the values TRUE or FALSE can be assigned to each literal in a clause such that every clause is TRUE. This problem is classically NP-complete [23], even when each clause contains only three literals. When each clause contains precisely three literals, the problem is known as a 3-SAT problem. We will use 3-SAT as the key example throughout the paper. Each clause has the form y i ∨ y j ∨ y k where y i ∈ {x i , x i }. Now, we look at two formulations of 3-SAT problems.

SAT linear formulation
Let {z c } c∈C be the collection of variables indicating if clause c is satisfied, and x i be the indicator variable denoting if literal i is satisfied. Let T RU E c be the set of literals that must be true to satisfy c, and F ALSE c the rest. Then, 3-SAT can be written as xi=T RU Ec Equation (5) has this form because 3-SAT is defined to have only OR conditions, so at least one x i must be satisfied when z c = 1. Standard QAOA does not have a way to incorporate constraints; we therefore adopt the aforementioned strategy of dualizing the constraints to yield an unconstrained optimization problem suitable for QAOA as follows.
Before we can dualize Eq. (5), we must change the inequality so it matches that of Eq. (2). We therefore take the contrapositive of each constraint so Eq. (5) has the form xi=T RU E (1 − x i ) + xi=F ALSE x i ≤ 2 + z c . We can express this constraint as an equality, by introducing two slack variables δ c,1 and δ c,2 that guarantee equality holds for any choice of x i satisfying the constraint.
Let us define The quantity f c ({x i , δ c,j }, z c ) is equal to zero when the constraints are satisfied. 3-SAT can now be expressed as an unconstrained optimization problem by introducing −λf 2 c as a penalty term where λ is a large number [24]. The variables x i , δ c,j , and z c can take values of either 0 or 1, however, choices that violate f c = 0 give penalties λf c ({x i , δ c,i }, z c ) 2 < 0. This ensures that the optimal solution is identical to the original constrained problem. Since we introduce two δ variables and one z per clause in the dualization, this formulation requires 3|C| ancillary qubits. The term −λ c∈C f c ({x i , δ c,j }, z c ) 2 must be expanded in order to determine all of the edges of the derived graph. The circuit depth for one layer of QAOA is the chromatic index plus one, and the chromatic index is either the maximum degree of the derived graph, or the maximum degree of the derived graph plus one. Thus, the circuit depth is either the maximum degree of the derived graph plus one or the maximum degree of the derived graph plus two.
To compute the maximum degree, let C xi ⊂ C be the set of clauses containing x i . Then the degree of the x i in the derived graph is where C xi,xj = C xi ∩ C xj is the set of clauses containing both x i and x j . This value lies between 3|C xi | and 5|C xi |. The lower bound is because x i is adjacent to both δ variables and one z per clause and the upper bound is because x i can also be adjacent to distinct x j and x k in each clause. Notice that deg(δ i,j ) = 5 and deg(z c ) = 5. Since deg(x i ) ≥ 5 for some i, the maximum degree of the graph is max i {deg(x i )}, so the circuit depth for one layer of QAOA is either The product reformulation and expansion of 3-SAT clauses. In this chart, we let x b x c = u b,c . The last three columns count the contribution to the degree of each variable from the monomials in two vertices that are not substituted. This contribution is only added the first time the two variable monomial appears. For example, if x a x b appears in more than one clause, we only add one to the degrees of x a and x b . Since x b x c = u b,c , we do not add one to the degrees of x b and x c whenever x b x c appears in a clause. The number in each degree column is added to the degree from Thm. 2 to calculate the degree of vertex x i in the derived graph.

SAT product formulation
Alternatively, SAT can be written as a product of monomials. To see this, note that Thus, we can write SAT as the polynomial unconstrained binary optimization (PUBO) problem There are no ancillary qubits needed to write this PUBO, however expanding it does give monomials in three variables, as seen in Tab. I. A straightforward implementation of an n variable monomial requires an n-qubit gate, however, current hardware is often limited to two-qubit gates. We therefore need a method to decompose these large monomials into products of at most two variables.

D. Example: linear and product formulations
Consider the 3-SAT problem Example 1.
Labeling the indicator variable for the first clause z 1 , the second z 2 , and so on, we can write the objective function for this problem as max 4 c=1 z c subject to the constraints We consider the circuit depth for one layer of QAOA to solve this problem. First, we look at the linear characterization found in Sec. II C 1. Then, we look at the product formulation and compare the degrees of the resulting derived graphs to determine the circuit depth for one layer of QAOA from each method, assuming three qubit gates are possible. We next devise a variable-substitution method to use the product formulation in Section III, and analyze the circuit depth for a two-qubit gate implementation of the product formulation in subsection III B 2.

Linear Formulation
When we use the linear formulation of the above problem, the contrapositive of the simplified dualized constraint for the first clause is In order to dualize the constraint, we add in two slack variables, δ 1,1 and δ 1,2 and change the inequality to equality to obtain Upon squaring both sides, we get all terms of the form The other clauses are handled similarly and the derived graph is found in Fig. 1. The degree of the vertex that is maximal in the derived graph is thirteen, so the circuit depth is either fourteen or fifteen for one layer of QAOA.

Product Formulation
Instead of solving the linear formulation, each clause can be rewritten as a product of combinations of x i and (1 − x j ). For Ex. 1, the first statement holds if and only if (1 − x 1 )(1 − x 2 )x 3 holds. Upon expanding, we get the expression The other clauses are handled similarly. If there are three-qubit gates, this method requires no ancillary qubits.
Expanding the product formulation of a single 3-SAT clause results in a monomial that contains three variables and possibly one or more monomials in two variables. The variables that occur in degree two monomials are all contained in the three variable monomial. Since each monomial represents a gate that acts on the qubits contained in the monomial, we need only implement the three-qubit gates from each clause. Thus, we can eliminate all edges from the derived graph and are left with a hypergraph, Fig. 2. The circuit depth is equal to the chromatic index of the hypergraph plus one.

III. GLOBAL VARIABLE SUBSTITUTION
The previous section assumes that three-qubit gates are possible on the hardware, however, that may not always be the case. Thus, we examine how to decompose monomials in three or more variables via a process called global variable substitution (GVS). In order to substitute variables, we require constraints on the problem to ensure the substitution is valid. We then eliminate the constraints via dualization and can determine the circuit depth of one layer of QAOA.
Let us define a substitution of size s as one in which s variables are combined into one e.g., x 1 x 2 ...x s = u 1,2,...,s . Throughout the remainder of this paper we use the boldface variable j to refer to lists of indices, When we wish to refer to specific substitutions, we will specify indices of the variables, e.g.
The goal of this work is to write an n variable monomial as a product of two variables. One variable replaces s of the variables of the original monomial, and another variable is substituted for the remaining n − s. Since the order of the variables in each monomial is not important, we assume without loss of generality that the first s variables are substituted for one variable and the last n − s for the other. In this formulation, we allow no overlap in the substitutions, i.e. if x i is a variable in the substitution of size s, then it is not a variable in the substitution of size n − s.
In order to substitute a new variable u 1,...,s for x 1 ...x s , we add in the constraints where |u j | denotes the number of variables u j replaces and m u j ∈ {1, ..., s}, depending on if x i takes the value of 0 or 1 for each x i . The first constraint ensures that if x i = 1 ∀ i, then u 1,2,...,s = 1, while the second guarantees that if x i = 0 for some i, then u 1,2,...s = 0. Note that |u j | = s j , so the two can be used interchangeably. After dualizing these constraints, we are able to determine the degree of each vertex in the derived graph. To facilitate the discussion, in Theorem 1 we focus only on the vertices and edges associated with the dualized substitution terms, which form a sub-graph of the total derived graph. We then show how these are related to the total derived graph and describe how to compute the circuit depth for one layer of QAOA in Section III B 1.

A. Degree of substituted variables
We now give a formula for the degrees of vertices δ c,k and u j , as well as determine the contribution of each substitution to the degree of x i . These degrees, in conjunction with the x i x j terms, can be used to compute the circuit depth, as shown explicitly in the example of subsection III B 2.
Theorem 2. Let U denote the set of all substitutions made. Let us denote the set of substitutions containing x i as U i . For u j ∈ U we let |u j | denote the number of variables substituted in substitution u j . The number of edges incident to each vertex in the derived graph due to the substitution is denoted deg s (v) and is where m u j denotes the number of δ c,k variables in Eq. (7) for the substitution j, z i,p is an indicator variable denoting whether or not U i ∩ U p = {∅}, |C xi | refers to the number of monomials containing x i which do not have any u s containing x i substituted, and |C u j | refers to the number of monomials with more than two variables using the substitution u j .
Proof. First, we will consider the degree of each δ c,k by counting the number of terms that contain δ c,k in each dualized constraint. Note that in the first constraint, there are 1 + |u j | + m variables total, so |u j | + m of these are multiplied times a single δ c,k term upon dualization. Thus, the degree of δ c,k in this constraint is |u j |+m. In each of the following constraints, note that there are three variables: u j , x i and δ c,k . Thus, the degree of δ c,k from these constraints is 2. Since the δ c,k terms in each constraint are different, they do not add, so deg s δ c,k ∈ {2, |u j | + m u j }.
Next, we consider the degree of each x i in the graph derived from the dualization. In the first constraint, there are |u j | + m u j terms containing each x i and there is exactly one constraint aside from the first that contains x i . This constraint only has two terms containing x i , but the contribution to the degree from this is one since the edge u j x i already exists in the graph from the first constraint. Now, we must consider how many u j contain x i as a variable. If there is more than one substitution containing x i , there are multiple constraints that have the form of the first one. Each of those constraints contain new u j variables and new δ c,k variables since the substitutions are different. Thus, the only double counting that can happen is in products of x i x j , since these are the only other edges possible in the graph derived from the dualization. We must subtract the number of times each of these terms occurs in each constraint except for one. Additionally, we must count the clauses that contain x i but in which x i is not contained in a substitution, since it will be incident to the substitution in the derived graph. We denote the number of these clauses as |C xi |. Then, deg s ( Finally, we need to consider the degree of each substituted variable, u j . The first constraint contributes |u j | + m to the degree and the other |u j | constraints contribute 1 to the degree since the first constraint accounts for the u j x i terms. Finally, each u j is substituted into a clause, so is multiplied by the variable not contained in the substitution. We denote the number of clauses into which u j is substituted as |C u j |. Thus, deg s u j = 2|u j | + m u j + |C u j |.
The derived graph for the problem consists of variables and edges induced by the substitution, as well as variables and edges x i x j that exist in the original problem. The variables specific to the substitutions, δ c,k and u j , have degrees determined solely by Thm. 2. The chromatic index of the derived graph is the circuit depth for one layer of QAOA, and the maximum of the degrees from Thm. 2 plus one provides a lower bound for this quantity. We show how to compute the exact circuit depth in Section III B 1, including the extra edge terms x i x j .

B. 3-SAT
Notice that Thm. 2 reduces to , 1}, and m = 1. This is the degree for each variable due to the substitution. In order to determine the total degree, we need to look at two variable terms in the expansions and add one to the degree for each unique term.

Counting edges in 3-SAT that are not due to substitutions
To compute the circuit depth for one layer of QAOA, we must compute the maximum vertex degree in the derived graph. We focus here on the example of 3-SAT. A similar approach can be used to decompose other classes of combinatorial optimization problems. In order to calculate the total degree of a vertex in the derived graph from 3-SAT, we need to add the degrees of a vertex due to a substitution u j , from Thm. 2, to the degree from two vertex monomials that were not substituted. Since δ c,k and u i,j are introduced in order to make the substitutions, their degrees are exactly the quantity in Thm. 2.
In order to count the number of edges induced by pairs that are not substituted, we define P as the set of all two variable monomials that result from the expansion of the product formulation of each clause in a 3-SAT instance. These two variable monomials will be denoted s i,j . For example, if we have the clauses ( x 4 x 5 and the substitutions u 1,3 and u 4,5 are made, in this case, P = {x 2 x 3 , x 2 x 4 }. The subset of P containing a vertex a is denoted P a . Here, P 2 = P , since x 2 is in each monomial, P 3 = {x 2 x 3 }, and P 4 = {x 2 x 4 }. Let ||P || = (|P 1 |, |P 2 |, ..., |P n |).
These sets can be used to determine the number of edges incident to a vertex x i that are from the two variable terms in the expansions of each clause, which we denote deg e (x i ). Let us fix variable x i . Since |P i | counts the number of two variable terms containing x i , it is added to Thm. 2. If one of the two variable terms from the expansion of the clauses is substituted, i.e. if x i x j ∈ P i and u i,j is a substitution, then adding |P i | to the degree double counts the edge x i x j . Thus, the number of substitutions that appear in P i need to be subtracted. If S i is the set of substitutions containing variable x i and y s is an indicator variable that determines if the substitution s i,j was used, the total degree of x i is where deg e (x i ) = − si,j ∈Pi y si,j + |P i |.

Example: Global variable substitution
To give an example of the GVS method, we will apply it to the product formulation of Ex. 1. We want to decompose the three-variable terms into two-variable terms by substituting a new variable to represent the product of the variables. In order to do so, we first choose substitutions and then create the derived graph. For Ex. 1, we substitute x 1 x 3 = u 1,3 and x 2 x 5 = u 2,5 . Thus, the first clause, which can be written as With the substitution x 1 x 3 = u 1,3 , the edge x 1 x 3 is already accounted for in the first constraint. We then need only add the edge between x 2 and x 3 to the derived graph since the monomial x 2 x 3 exists in the expansion of the first clause. Note that each clause can be decomposed similarly and will end up with a sum of terms, at least one of which contains three variables, with the others containing one or two depending on the number of (1 − x i ) expressions. The other edges that need to be added due to the two variable terms in the expansions are x 1 x 4 , x 3 x 4 , x 1 x 2 and x 2 x 4 . See Tab. I for the contribution of unsubstituted monomials from a particular clause to deg e (x i ) for a generic substitution x b x c = u b,c . The increase in degree ranges from 0 to 2, with the maximum addition being k − 1 for general k-SAT.
Next, we list each constraint of the form Eqs. (7)-(8) and dualize them. For the first clause c = 1 in the example, When dualizing these constraints, the terms are added to the objective function, up to constant λ, and similar terms are added for the u 2,5 substitution. Since all variables, v, in the equations above have the value zero or one, v 2 = v. The entire derived graph can be seen in Fig.  3. Note that the degrees match the theorem plus the number of edges induced by pairs that are not substituted. The largest degree vertex is x 2 , which has degree eight, so the circuit depth for one layer of QAOA is either nine or ten. This is less than the circuit depth for the linear 3-SAT formulation and requires fewer ancillary qubits.

IV. OPTIMIZING GLOBAL VARIABLE SUBSTITUTIONS FOR 3-SAT
As seen above, the number of substitutions impacts the degrees of the vertices. We want to minimize both the number of ancillary qubits and the maximum degree of the derived graph. This problem is difficult for large gates, but in this section, we explore how to solve this problem with gates with three or fewer variables such as in 3-SAT.

A. Global Variable Substitution Integer Program
Each substitution introduces new variables that correspond to ancillary qubits and impacts the degree of each vertex in the derived graph. In order to determine which of the possible combinations of substitutions are feasible, we create a graph G = (V (G), E(G)), which we call the covering graph. There are two sets of vertices in this graph. One set is the set of all 2-sets representing all possible two-variable substitutions u i,j = x i x j . We call this set of vertices S and denote the pairs x i x j in S as s i,j . Each s i,j is a possible substitution, but not each s i,j will result in a substitution u i,j . The other set is the one containing all three variable terms from the expansion, which we will call the expansion 3-set, ES 3 . Edges are placed between vertices g and h if the variables in the label of g are a proper subset of the variables in the label of h. There are no edges between any sets of the same size, making the graph bipartite. See Fig. 4 for an example, where S is the left set of vertices and ES 3 is the right set for Example 1.
The nature of this problem naturally lends itself to a set covering or bipartite matching style formulation as each substitution u i,j can cover, or be matched with, any clause containing the literals in that substitution. We have chosen to use a set covering problem formulation, i.e. we want to find a subset of S such that each vertex in ES 3 is incident to a vertex in the subset. Since covering a vertex in ES 3 more than once leads to unnecessary ancillary qubits and increases the degree, we need to add constraints to ensure that each clause c ∈ C is covered by exactly one substitution u i,j . Notice that more than one covering may be possible as seen in Fig. 4.
The objective of 3-SAT is to minimize the maximum degrees found in Eq. which are derived from the GVS method. The covering graph developed in the previous paragraphs is used to aid in the minimization process. The integer program formulation of this problem is subject to the set covering constraints.
Each clause x i x j x k = c is covered by a pair s i,j = x i x j and has a variable x k that is not in a substitution. The indicator variable z(c, s i,j , x k ) is defined as The full integer program formulation to minimize the maximum degree vertex in the derived graph, obj, is as follows: Eq. (15) is our objective function. We have added the penalty 1 10|C| * si,j ∈S y si,j in Eq. (15) which minimizes the total number of unique substitutions to help minimize the number of ancillary qubits. Eq. (16) indicates that the maximum degree of each vertex must be less than or equal to the objective value. The last term of this constraint counts the number of clauses that contain variable x a but in which x a is not substituted. This is equivalent to |C xa | in Thm. 2 and the example. Similarly, Eq. (17) indicates that the maximum degree of any substituted variable must be less than or equal to the objective value. These two constraints effectively allow us to minimize the maximum degree of the graph. Note, the degree of the slack variables are not included in this formulation as they are either 2 or 3 and will never yield the maximum degree in a problem of sufficient size. Eq. (18) is our set covering constraint. This asserts that each c ∈ C is required to be covered by exactly one covering s i,j , x k . Eq. (19) asserts that if at least one c ∈ C substitutes the pair s i,j , y si,j is set to 1.
After determining these sets, we are able to formulate our constraints. First we add a constraint for each literal vertex v a ∈ V in the form of Eq. (16). For a = 1: deg(x 1 ) = 3y s1,2 + 3y s1,3 + 3y s1,4 + 4y s1,5 + z(c 0 , s 2,3 , x 1 ) + z(c 1 , s 3,4 , x 1 ) + z(c 3 , s 2,5 , x 1 ) + 3 ≤ obj Next, we add a constraint for each unique substitution u s corresponding to an s ∈ S in the form of Eq. (17). For s = (x 1 , x 2 ): For each c ∈ C we add a constraint in the form of Eq. (18) to assert that a clause c must be covered by exactly one of its three potential coverings found in Tab. II. For clause c 0 : Finally, for each covering containing a pair s i,j , we add a constraint in the form of Eq. (19). This asserts that if any covering containing s i,j is selected for a substitution, x si,j is forced to 1. For s = (x 1 , x 2 ) we add the constraints: The solution to this IP is y 1,3 , y 2,5 = 1 z(c 0 , s 1,3 , x 2 ), z(c 1 , s 1,3 , x 4 ), z(c 2 , s 2,5 , x 4 ), z(c 3 , s 2,5 , x 1 ) = 1, which indicates that the optimal solution is to substitute pairs s 1,3 and s 2,5 . Using these substitutions, ∆ G = 8 and the degree of each vertex in the derived graph is deg(x 1 ) = 7 deg(x 2 ) = 8 deg(x 3 ) = 6 deg(x 4 ) = 5 deg(x 5 ) = 4 deg(u 1,3 ) = 7 deg(u 2,5 ) = 7 so the circuit depth is at most nine.

B. Heuristic Approximation
The previous integer programming approach will provide an optimal solution. However, depending on the 3-SAT instance, it might be a very difficult problem to solve. As an alternative, we have developed a heuristic to approximate it. Greedy algorithms are a common way to approximate large scale set covering problems [25]. Generally, this involves a greedy selection of elements that cover the greatest amount of sets until all sets are covered. We have chosen to use a similar approach as the degree of the graph derived using GVS is directly impacted by the number of substitutions made. Therefore, we expect by selecting the coverings with the highest degree in the covering graph, we will be able to minimize the total number of substitutions made and obtain a locally minimal solution. Let U be the set of uncovered clauses. Let K be the set of covered clauses. At the beginning of the iteration, K is empty and U = C, where C is the set of all clauses in the 3-SAT instance. The greedy algorithm is described in Alg. 1. Often in step 2, multiple s i,j pairs may cover the same number of clauses. To break these ties, we randomly select a pair s i,j of the current largest degree in the covering graph.

Algorithm 1 Greedy by Covering Heuristic
while |U | > 0 do select si,j ∈ S which covers the the greatest number of u ∈ U add all covered u to K remove all covered u from U remove si,j from S end while

V. COMPUTATIONAL RESULTS
In this section, we evaluate the performance of the product 3-SAT model and covering heuristic formulated to apply the global variable substitution method to large 3-SAT instances. Since the circuit depth for one iteration of QAOA is the maximum degree plus one or the maximum degree plus two, in all cases, we take the circuit depth to be the maximum degree plus two since is the upper bound of the circuit depth for one iteration. Thus, we compare the upper bound of the circuit depth for one iteration achieved using the integer programming model and covering heuristic, which we denote ∆ I.P and ∆ C respectively, to the upper bound of the circuit depth, denoted ∆ L , calculated using the linear model described in Section II C 1. We apply each formulation and method to 3-SAT problem instances from the SATLIB Benchmark Suite developed by Holger Hoos and Thomas Stütze [18]. This suite is composed of thousands of SAT instances of varying families and sizes. We choose the first instance of each problem set to evaluate.
The results in Tab. III indicate that the graphs derived using the product formulation combined with the GVS method result in significantly lower circuit depth for one iteration of QAOA than the graphs derived from the linear formulation. For every problem instance, ∆ IP < 1/2∆ L . The heuristic does not yield as large of a reduction, but most instances see a significant reduction in degree compared to the linear method. It is interesting to note that as the size of each 3-SAT instance increases, the ∆ of the derived graph does not increase significantly. We can attribute this to the uniformity in the ratio of the literals to clauses and the uniformity of the distribution of those literals amongst all problem instances.
In nearly every 3-SAT instance, the GVS integer program makes more than or approximately equal to the amount of substitutions made by the covering heuristic method. However, the maximum degree of the IP derived graphs ∆ IP   The unsatisfiable instances are denoted 'uufn-|C|'. These instance names indicate the number of literals n and clauses C in each problem instance. We choose the maximum degree to be the y-axis since the circuit depth for one iteration is either the maximum degree plus one or the maximum degree plus two. are significantly lower than ∆ C . This trend can be seen in Figs. 5a-5b which plot the maximum degree of the derived graph against the number of substitutions made for the uniform 3-SAT instances. This seems to indicate that simply minimizing the number of substitutions does not necessarily minimize the maximum degree of the GVS derived graph. In particular the uf50-218 instance from [18], which is a satisfiable instance with 50 variables and 218 clauses, achieves ∆ IP = 41, which is accomplished by making 141 substitutions. The covering heuristic makes three more substitutions than the LP, but produces ∆ C = 54. The unsatisfiable instance of the same size, uuf50-218, achieves ∆ IP = 41 by making 138 substitutions. The covering heuristic in this instance made only six more substitutions, but resulted in a ∆ C = 50. To investigate this trend, we plot the distribution of the degrees of each vertex in the derived graph for each method.
As shown in Fig. 6a-6d, the degrees of the literal vertices v i are larger than those of the substitution vertices u i,j for each 3-SAT instance we evaluated. We can attribute this to the GVS method of determining the degree for each vertex in the derived graph and the sparseness of the literals in each instance. Each unique pair s i,j which is substituted will add three or four edges to the degree of the literal vertices v i and v j . However, making this substitution only adds one edge to the corresponding substitution vertex u i,j . In both instances displayed here, a literal x i is included in approximately thirteen clauses. Clearly, this severely limits the amount of clauses each substitution is able to cover. Consequently, this significantly increases the degree of each literal vertex as more unique substitutions are required to cover all clauses and simultaneously limits the degree of each substitution vertex u i,j since each s i,j is used very few times. We can see this represented in Figures 6b and 6d as nearly 40% of the substitutions made in both instances only cover one clause. The most clauses covered by a any substitution is five.
The distribution of literal vertices of the integer program differs significantly from the distribution of the heuristics in both problem instances. A majority of the literal vertices in the graph derived from the IP take on the value of ∆ IP . It is clear that the integer program is not simply minimizing the number of substitutions made, but rather appears to limit the amount of substitutions per literal x i . For these sparse and uniform 3-SAT instances, the best method of minimizing the max degree of any v i is to attempt to distribute the number of substitutions made evenly amongst all literal vertices v i .

VI. DISCUSSION
In this paper, we analyze an approach to minimizing the circuit depth of the quantum approximate optimization algorithm by expressing general combinatorial optimization problems in varying forms. We compare a linear formulation that is the natural choice in conventional optimization algorithms with a product formulation that we posit as natural for QAOA. The product formulation leads to monomials in more than two variables, which cannot be directly implemented on a quantum computer with two qubit gates. Thus, we introduce the global variable substitution method to decompose them into two variable terms which can be implemented on a quantum computer with two qubit gates. For each of these formulations, we analytically compute the circuit depth in terms of the maximum degree of a graph derived from the problem instance and formulation. We demonstrate that the product formulation gives shallower circuits then the linear formulation for benchmark 3-SAT problems.
The global variable substitution requires constraints that must be satisfied in order to obtain the optimal solution, as does the linear formulation. We can derive graphs for the linear and product formulations from the objective function and the appropriate constraints. The circuit depth is directly related to the maximum degree of the derived graph.
We evaluate the circuit depth of the product formulation with global variable substitutions by writing an integer program that computes the minimal circuit depth of the linear formulation and product formulation for a collection of benchmark problems. In all cases, the product formulation gives circuit depth roughly half that of the linear formulation. The linear formulation for 3-SAT requires exactly three ancillary qubits per clause, where the product formulation requires four per substitution, although substitutions can sometimes be reused to reduce the number of ancillary qubits. We find several additional interesting features of the approach.
We find that minimizing the number of substitutions per problem instance does not necessarily minimize the maximum degree. For example, when solving "uf-100-430", the covering heuristic makes 329 substitutions for a maximum degree of 60, whereas the IP makes 330 substitutions for a maximum degree of 46. We also note that the objective function for the IP can be modified to limit the number of substitutions. While this may drive up the degree of vertices, it also reduces the number of ancillary qubits, as each substitution requires four additional qubits. Thus, the problem formulation can be changed to accommodate different hardware.
The focus of this work has been on using the product formulation of 3-SAT instances to minimize QAOA circuit depth relative to a conventional linear formulation. Extending the analysis of linear and product formulations to more general problems will help determine additional types of problems that benefit from this approach. Additionally, there may be other formulations for specific problems that result in shallower circuits than the linear or product formulations. While the product formulation with GVS gives shallower circuits for 3-SAT, future work should determine if the reformulation gives a comparable outcome to the linear formulation in the same number of QAOA iterations. A final note is that the global variable substitution method can be used to rewrite problems in terms of gates acting on m qubits. If more general gates become available on quantum computers, then a similar analysis could lead to new approaches for minimizing depth.