Commuting Quantum Circuits and Complexity of Ising Partition Functions

# Commuting Quantum Circuits and Complexity of Ising Partition Functions

Keisuke Fujii Tomoyuki Morimae ASRLD Unit, Gunma University
July 3, 2019
###### Abstract

Instantaneous quantum polynomial-time (IQP) computation is a class of quantum computation consisting only of commuting two-qubit gates and is not universal. Nevertheless, it has been shown that if there is a classical algorithm that can simulate IQP efficiently, the polynomial hierarchy (PH) collapses to the third level, which is highly implausible. However, the origin of the classical intractability is still less understood. Here we establish a relationship between IQP and computational complexity of calculating the partition functions of Ising models. We apply the established relationship in two opposite directions. One direction is to find subclasses of IQP that are classically efficiently simulatable by using exact solvability of certain types of Ising models. Another direction is applying quantum computational complexity of IQP to investigate (im)possibility of efficient classical approximations of Ising partition functions with imaginary coupling constants. Specifically, we show that a multiplicative approximation of Ising partition functions is #P-hard for almost all imaginary coupling constants even on planar lattices of a bounded degree.

## 1 Introduction

Quantum computation has a great possibility to offer substantial advantages in solving some sorts of mathematical problems and also in simulating physical dynamics of quantum systems. A representative instance is Shor’s factoring algorithm [1], which solves integer factoring problems in polynomial time, while no polynomial-time classical algorithm has been known. Recently, quantum algorithm for approximating Jones polynomial [2, 3], Tutte polynomial [4], and Ising partition functions [5, 6, 7] have been found and they are shown to be BQP-complete in certain parameter regions. Furthermore, there are some evidences that quantum computation, more precisely, BQP (bounded-error quantum polynomial-time computation [8]), can solve problems outside the polynomial hierarchy (PH[9, 10]) [11]. These results strike the extended Church-Turing thesis [12, 13, 8], which states that every reasonable physical computing devices can be simulated efficiently (with a polynomial overhead) on a probabilistic Turing machine. One of the most revolutionary and challenging goals of human beings is to realize a universal quantum computer and verify such quantum benefits in experiments. However, experimental verification, which is the most essential part in science, is still extremely hard to achieve, requiring a huge number of qubits and extremely high accuracy in controls.

Is there any possible pathway to verify computational complexity benefits of quantum systems that are realizable in the near future, say, one-hundred-qubit (or particle) systems under reasonable accuracy of controls? If there is such a subclass of quantum computation that consists of experimental procedures much simpler than universal quantum computer but is still hard to simulate efficiently in classical computers, experimental verification of complex quantum systems reaches a new phase.

Aaronson and Arkhipov introduced BOSONSAMPLING [14], a sampling problem according to the probability distribution of bosons scattered by linear optical unitary operations. The probability distribution is given by the permanent of a complex matrix, which is determined by the linear optical unitary operations. Calculation of the permanent of complex matrices is known to be #P-hard [15, 16]. Since a polynomial-time machine with an oracle for #P can solve all problems in the PH according to Toda’s theorem [17], an exact classical simulation (in the strong sense [18, 19] meaning a calculation of the probability distribution of the output) of BOSONSAMPLING is highly intractable in a classical computer. They showed under assumptions of plausible conjectures that if there exists an efficient classical approximation of BOSONSAMPLING (classical simulation in the weak sense [18, 19] meaning a sampling according the probability distribution of the output), the PH collapses to the third level, which unlikely occurs. (The detailed notions of classical simulation are provided in Sec. 2.) This result brings a novel perspective on linear optical quantum computation and drives many researchers into the recent proof-of-principle experiments  [20, 21, 22, 23, 24, 25, 26, 27].

Another subclass of quantum computation of this kind is instantaneous quantum polynomial-time computation (IQP) proposed by Shepherd and Bremner [28]. IQP consists only of commuting unitary gates, such as . Here is a rotational angle, indicates the Pauli operator on the th qubit, and indicates a set of qubits on which the commuting gate acts. (A detailed definition will be provided in the next section.) The input is given by with , and the output qubits are measured in the -basis. Since all unitary operations are commutable with each other, there is no temporal structure in the circuits. (This is the reason why it is called instantaneous quantum polynomial-time computation.) The commutability implies that IQP cannot perform an arbitrary unitary operation for the input qubits and hence seems to be less powerful than standard quantum computation, i.e., BQP. Nevertheless, Bremner, Jozsa, and Shepherd showed that if there exists an efficient classical algorithm that samples the outcomes according to the probability distribution of IQP with a certain multiplicative approximation error, then the PH collapses to the third level. While the collapse of the PH to the third level is not as unlikely as P = NP, it is also considered to be highly implausible. This result is obtained by introducing postselection and using the fact that post-BQP = PP shown by Aaronson [29]. Here postselection means that an additional ability to choose, without any computational cost, arbitrary measurement outcomes of possibly exponentially decreasing probabilities. However, in comparison to BOSONSAMPLING  [14, 30], the origin of the classical intractability of IQP is still not well understood.

The purpose of this paper is to further explore IQP by relating it with computational complexity of calculating Ising partition functions, which has been well studied in statistical physics, condensed matter physics, and computer science.

Specifically we obtain the following results (see Fig. 1):

1. We reformulate IQP from a viewpoint of computational complexity of calculating Ising partition functions. The probability distribution of the output of IQP including its marginal distributions is mapped into an Ising partition function with imaginary coupling constants (Theorem 1 and Theorem 2).

2. By using the above relation, we specify classically simulatable classes of IQP, which correspond to exactly solvable Ising models (Theorem 3 and Theorem 4). For example, IQP that consists only of nearest-neighbor two-qubit commuting gates in two dimensions (2D) is classically simulatable, at least in the weak sense, irrespective of their rotational angles.

3. We show that a multiplicative approximation of the Ising partition functions with almost all imaginary coupling constants is #P-hard even on 2D planar lattices with a bounded degree. So there is no polynomial-time approximation scheme unless the PH collapses completely.

The first result bridges IQP and computational complexity of Ising partition functions, which tells us the origin of hardness of classical simulation of IQP, since exact calculation of Ising partition functions is #P-hard even in the ferromagnetic case [31, 32]. Only restricted models are known to be exactly solvable such as Ising models on the 2D planar lattices without magnetic fields.

One might naively expect that a subclass of IQP, which is mapped into an exactly solvable Ising model, is classically simulatable in the strong sense [18, 19], since the joint probability distribution of the output can be calculated efficiently. However, there are exponentially many instances of the measurement outcome, and hence an efficient calculation of the joint probability distribution of an output does not directly applied to an efficient weak simulation of IQP. For example, in Ref. [18], it is pointed out that there exists the case where the joint probability distribution is easily calculated but its marginals are rather hard to calculate. In order to construct an efficient weak simulation of IQP, we need the marginal distributions, which allow a recursive simulation of the sampling problem by using the Bayes theorem. To this end, we map not only the joint probability distribution but also the marginal distributions of IQP into the Ising partition functions on another lattices. In the proof, we virtually utilize measurement-based quantum computation (MBQC) [33] on graph states [34], which are defined associated with the IQP circuits.

The established relationship between IQP and Ising partition functions is useful since computational complexity of Ising models have been well studied. We can apply preexisting knowledge to understand quantum computational complexity of IQP. Specifically, in the second result, we provide classical simulatable classes of IQP by using exact solvability of certain types of Ising models. We provide two examples of classically simulatable classes of IQP. One is based on the sparsity of the commuting gates. Another is a class of IQP that consists only of two-qubit commuting gates acting on nearest-neighbor qubits on the 2D planar graphs, which we call planar-IQP. Planar-IQP is mapped into a two-body Ising model on a 2D planar lattice without magnetic fields, which is known to be solvable by using the Pfaffian method [31, 35, 36]. In the proof, we also utilize properties of graph states in order to renormalize random magnetic fields into two-body interactions, which originated from the random nature of the measurements. Then the marginal distributions can be efficiently calculated irrespective of their rotational angles by using the Pfaffian method [31, 35, 36].

On the other hand, IQP consisting of single- and two-qubit commuting gates acting on a 2D planar graph is sufficient to simulate universal quantum computation under postselection  [37]. (Hereafter, such a property that a quantum computational task can simulate universal quantum computation under postselection is called as universal-under-postselection.) This fact and the above classically simulatable class imply that single-qubit rotations play a very important role for IQP to be classically intractable. Actually single-qubit rotations make a drastic change of complexity from almost strongly simulatable to not simulatable even in the weak sense. A similar result is also obtained for Toffoli-Diagonal circuits, where the Hadamard gates at the final round plays very important role [18].

When experimentalists utilize IQP for the purpose of verification of quantum benefits in malicious experimental setups, they should avoid the IQP circuits of these classically simulatable classes, since a malicious experimental device can cheat experimentalists by a classical sampling instead of implementing the IQP circuits. In most cases, however, experimental setups are well organized and not so malicious. Thus it might be possible to use these classically simulatable classes combined with any physically relevant assumption as an efficient benchmark of commuting quantum circuits, since the ideal output distribution can be efficiently calculated. Since planar commuting circuits can generate an interesting class of entangled states called weighted graph states [34], the constructed efficient classical simulation would be useful for an experimental verification of the weighted graph states.

In the above classically simulatable class, the probability distribution is given by the determinant, i.e., square of the Pfaffian, of a complex matrix. This result contrasts with BOSONSAMPLING related with the permanent of a complex matrix. The exact solvability with the determinant (Pfaffian) naturally reminds us free-fermionic models, which have been also studied in standard quantum computation as match gates [38, 39, 40, 41, 42]. Since a determinant can be mapped into a probability amplitude of a free-fermionic system, the classically simulatable class of IQP can be regarded as FERMIONSAMPLING discussed in Ref. [30]. This suggests that the sampling problems in physics can be classified in a unified way as sampling problems of elementary particles.

In the final result, we apply the first result in an opposite direction, from quantum complexity to classical one. We consider certain universal-under-postselection instances of IQP to understand classical complexity of calculating the Ising partition functions. Specifically we show that a multiplicative approximation of Ising partition functions (corresponding to a strong simulation of IQP with a multiplicative error) is #P-hard for almost all imaginary coupling constants even on 2D planar lattices with a bounded degree. Hence if there exists a fully polynomial-time classical approximation scheme, it results in a complete collapse of the PH. This can be viewed as a “quantum proof” of #P-hardness of approximating the imaginary Ising partition functions. Aaronson’s post-BQP = PP theorem [29], which is employed to show the above result, is also utilized to provide a “quantum proof” [43] of #P-hardness of approximating the permanent [16] and the Jones polynomial [44] with a multiplicative error.

The rest of the paper is organized as follows. In Sec. 2, we introduce the definition and useful properties of the graph states in order to fix the notation. Then we review IQP and the postselection argument introduced by Bremner, Jozsa, and Shepherd. We also mention how to utilize post-BQP = PP theorem by Aaronson [29] to obtain classical complexity results. As the final part of the preliminary section, we summarize related works on commuting quantum circuits and quantum and classical computational complexity of calculating the Ising partition functions. In Sec. 3, we establish a relationship between IQP and Ising partition functions, not only for the joint probability distribution of the output but also for its marginal distributions. In Sec. 4, we demonstrate two classically simulatable classes of IQP. One is based on the sparsity of the IQP circuits. Another is based on exact solvability of the Ising models on the 2D planar lattice without magnetic fields. In Sec. 5, we apply the relationship between IQP and Ising partition functions in an opposite direction to investigate (im)possibility of an efficient classical approximation scheme of the Ising partition functions with imaginary coupling constants. Section  6 is devoted to conclusion and discussion.

## 2 Preliminary

In the proofs of the main theorems, we work with a measurement-based version of IQP, namely MBIQP, introduced by Hoban et al. [45]. The reason is that transformations on the resource state for MBQC [33], so-called graph states [34], are much easier and more intuitive than transformations on the unitary gates themselves. Here we introduce the definition and useful properties of graph states in order to fix the notations.

### 2.1 Basic Notations

The Pauli matrix on the th qubit is denoted by (). The Hadamard gate is denoted . The eigenstates of with eigenvalues and are denoted by and , respectively. The eigenstates of with eigenvalues and are denoted by and , respectively. We denote the controlled- gate acting on the th (control) and th (target) qubits by . Specifically, and .

### 2.2 Graph states

###### Definition 1 (Graph state)

Suppose is a graph consisting of vertices and edges . We define the neighbor of as the set of vertices adjacent to vertex . An operator is defined for each vertex . The graph state is defined as the simultaneous eigenstate of the operator with eigenvalue for all :

 Ki|G⟩=|G⟩.

The above relation reads that the graph state is stabilized by the operator for all . Such a state is called a stabilizer state. The operator , which stabilizes the stabilizer state, is called a stabilizer operator. A detailed description of the stabilizer formalism could be found in Refs. [46, 47].

The graph state is generated from a tensor product state of by performing on the pairs of qubits connected by edges :

 |G⟩=⎛⎝∏(i,j)∈EΛi,j(Z)⎞⎠|+⟩⊗|V|.

This can be confirmed as follows. The product state is the eigenstate of with eigenvalue for all , and hence . By applying for both sides, we obtain

 ⎛⎝∏(i,j)∈EΛi,j(Z)⎞⎠Xi|+⟩⊗|V| = ⎛⎝∏(i,j)∈EΛi,j(Z)⎞⎠|+⟩⊗|V| ⇔Ki⎛⎝∏(i,j)∈EΛi,j(Z)⎞⎠|+⟩⊗|V| = ⎛⎝∏(i,j)∈EΛi,j(Z)⎞⎠|+⟩⊗|V|,

where we used the fact that . This is the definition of the graph state, and we conclude .

In the proofs of the main theorems, we repeatedly consider projective measurements on the graph state and the resultant post-measurement graph state. In the following we will see two important transformations on the graph states by projective measurements in certain bases.

###### Remark 1 (Z-basis measurement)

If the th qubit of the graph state is measured in the -basis, the resultant post-measurement state is the graph state associated with the graph , where the byproduct operator is located according to the measurement outcome , i.e., .

Proof: We observe the effect of the measurement on the stabilizer operator . If nor , the measurement does not make any effect on a stabilizer , and hence the post-measurement state is stabilized by such a . If , anticommutes with and hence does not stabilize the post-measurement state anymore. Instead, stabilizes the post-measurement state , where is the measurement outcome. If , we define a new stabilizer operator such that does not contain . The post-measurement state is stabilized by . Thus the graph state with the byproduct operator, , is the post-measurement state. (Note that anticommutes with s for all but commutes with s with and .)

Intuitively, the -basis measurement on the th qubit removes the th qubit from the graph state, and then the byproduct operator is located according the measurement outcome .

Next we consider a projective measurement on the th qubit in the basis, where is the measurement outcome.

###### Remark 2 (Remote Z-rotation)

The projective measurement of the th qubit on the graph state in the basis results in

 exp⎡⎣i(θk+mkπ/2)⎛⎝∏j∈NkZj⎞⎠⎤⎦|G∖k⟩/√2.

Proof: By using the fact that

we can calculate the projection as follows:

 ⟨θk,mk|k|G⟩ = ⟨θk,mk|k⎛⎝∏j∈NkΛ(Z)kj⎞⎠|+⟩k|G∖k⟩ = ⟨+|kei(θk+mkπ/2)ZkHk⎛⎝∏j∈NkΛ(Z)kj⎞⎠|+⟩k|G∖k⟩ = ⎡⎣cos(θk+mkπ/2)I+isin(θk+mkπ/2)⎛⎝∏j∈NkZj⎞⎠⎤⎦|G∖k⟩/√2 = exp⎡⎣i(θk+mkπ/2)⎛⎝∏j∈NkZj⎞⎠⎤⎦|G∖k⟩/√2.

.

The measurement in the basis induces a multi-body rotation on the qubits adjacent to the th qubit. The norms of the post-measurement states are both , which indicates that the outcomes appear randomly.

Another class of measurements, which is frequently used in MBQC, is the measurement in a basis. It is known that adaptive measurements in these bases on a certain graph state is enough to perform universal quantum computation, i.e., BQP [33]. Here the adaptive measurement means to change the following measurement angles according to the previous measurement outcomes in order to handle the random nature of the measurements. This process is often called a feedforward. A wide variety of graph states have been known to be universal resources for MBQC [34].

### 2.3 Strong and weak simulations of quantum circuits

Here we provide definitions of two important notions for classical simulation of quantum circuits, strong and weak simulations [18, 19].

###### Definition 2 (Strong and weak simulations)

Suppose is a uniformly generated quantum circuit of a model of quantum computation (e.g., IQP, one-clean-qubit model [48], and universal quantum computation, etc.). The probability distribution of the output (classical bits) is denoted by . An efficient weak simulation of is a classical polynomial-time randomized computation that samples with the probability .

On the other hand, an efficient strong simulation of a quantum circuit for a given output is a classical polynomial-time (randomized) computation that calculates the probability including its marginal distributions with respect to an arbitrary subset of the output bits .

In addition to these notions of classical simulation, we can further consider types of approximations. In an approximated simulation with a multiplicative error , we can replace the probability distribution with its approximation that lies inside the following approximation range

 1cPA(x|C)≤PapA(x|C)≤cPA(x|C).

Apparently, if we can simulate in the strong sense, we can sample the output in the weak sense. Thus a strong simulation trivially includes a weak one. In fact, it has been known that a strong simulation is much harder than a weak simulation, i.e., what a model of quantum computation can actually do. For example, an exact strong simulation of the output of universal quantum computation is #P-hard [18]. We should also note that, in strong simulation, calculation of the marginal distributions is crucial, since there is the case where a strong simulation of the output probability (joint probability) is easy but its marginal distributions are hard to calculate [18].

### 2.4 Instantaneous quantum polynomial-time computation

Here we introduce IQP and its measurement-based version. We first define IQP:

###### Definition 3 (Iqp by Bremner et al. [28, 37])

Let be the number of qubits. A commuting gate is defined by

 D(θj,Sj)≡exp[iθj∏k∈SjZk],

where is a real number meaning the rotational angle, and is a set of subsets of , on which the commuting gates act. We refer to a poly() number of commuting gates, including the input state and the -basis measurements, as an IQP circuit. IQP is defined as a sampling problem from the IQP circuit, whose probability distribution is given by

 PIQP({si}|{θj},{Sj})≡∣∣ ∣∣n⨂i=1⟨+si|∏jD(θj,Sj)|+⟩⊗n∣∣ ∣∣2,

where is the measurement outcome and .

For each commuting circuit, we can naturally define a bipartite graph , where and are disjoint sets of vertices, and every edge connects a vertex in with another in . Each vertex is associated with the th input qubit of the IQP circuit, and hence . Each vertex is associated with the th commuting gate , and hence . The set of edge is defined as , that is, the set specifies the vertices that are connected with the vertex . For a given weighted bipartite graph , where a weight is defined on each vertex , we can define an IQP circuit.

By using Definition 1 and Remark 2, IQP can be rewritten as MBQC on a graph state associated with the graph . In this case, the set of vertices corresponds to . More precisely, for a given bipartite graph state and weights , measurement-based IQP (MBIQP) is defined as follows:

###### Definition 4 (MBIQP by Hoban et al. [45])

MBIQP is defined as a sampling problem according to the probability distribution

 PMBIQP({mvi},{muj}|{θj},G)≡∣∣ ∣∣⨂vi∈VA⟨+mvi|⨂uj∈UB⟨θj,muj||G⟩∣∣ ∣∣2,

where , and .

The bit strings and correspond to the measurement outcomes on the qubits belonging to and , respectively. We should note that there is no temporal order in the measurements since there is no feedforward of the measurement angles in MBIQP.

Then we can prove MBIQP=IQP.

###### Remark 3 (Mbiqp = Iqp by Hoban et al. [45])

MBIQP and IQP are equivalent in the sense that if one sampler exists, another sampler can be simulated.

Proof: Since a stabilizer operator of the graph state is given by , for each vertex . By using this equality, we obtain

 PMBIQP({mvi},{muj}|{θj},G) = ∣∣ ∣∣⨂vi∈VA⟨+mvi|⨂uj∈UB⟨θj,muj|⎛⎝∏uj∈UBKmujuj⎞⎠|G⟩∣∣ ∣∣2 (1) = ∣∣ ∣ ∣∣⨂vi∈VA⟨+mvi|⨂uj∈UB⟨θj,0|⎡⎢⎣∏uj∈UB⎛⎜⎝∏vi∈NujZvi⎞⎟⎠muj⎤⎥⎦|G⟩∣∣ ∣ ∣∣2 = 2−|UB|PIQP({si}|{θj},{Sj})

where and are related via

 si≡mvi⊕⎛⎜⎝⨁uj∈Nvimuj⎞⎟⎠.

In the above, we used the facts that each measurement outcome is randomly distributed with probability , and the projection results in the commuting gate (see Remark 2). The above equality means that, regardless of the measurement outcomes and , we can simulate IQP by using MBIQP.

On the other hand, by using a random bit string with an equal probability 1/2 for each bit and sampled from the IQP circuit, we obtain and , which is equivalent to the output of MBIQP.

As mentioned previously, there is no feedforward for the measurement angles in MBIQP, and hence the measurements can be done simultaneously. This means that MBIQP cannot perform universal quantum computation in MBIQP unless constant depth circuits can simulate universal quantum computation. However, if postselection is allowed, we can choose the measurement outcomes in such a way that no byproduct operator is applied. Thus, with an appropriately chosen graph structure and weights, we can simulate universal quantum computation with the commuting circuits under postselection. This means that MBIQP with an appropriate graph state and weights (measurement angles) is universal-under-postselection, and hence post-MBIQP = post-BQP. On the other hand, Aaronson showed that post-BQP = PP [29]. Accordingly, post-IQP=post-MBIQP = PP.

Here postselected class, post-, is defined as a class of decision problems solvable by using a computational model associated with (e.g. instantaneous polynomial-time quantum computation for , universal quantum computation for , and and polynomial-time classical randomized computation for ) with a bounded error under postselection. More precisely, a language is in the class post- iff there exists a uniform family of circuits of a computational model associated with , where a single line output register (for the -membership decision problem) and a (generally O(poly(n) )-line) postselection register are specified such that

1. if then ,

2. if then ,

with a constant .

In order to simulate post-BQP, it is sufficient to consider post-IQP or post-MBIQP associated with planar bipartite graphs with and for all  [37]. (As shown in Sec. 5, we can obtain the same result not only for but also for almost all angles .) In this case, each instance is encoded into a structure of a graph. In another encoding, we can fix the structure of the graph but choose each angle from . Specifically, corresponds to a deletion of vertex from the graph (see Remark 1). and correspond to Clifford and non-Clifford gates, respectively. Examples of graphs and weights of MBIQP that are universal-under-postselection are presented in Fig. 2 (a) and (b).

In Ref. [37], Bremner, Jozsa, and Shepherd showed that if IQP is weakly simulatable by using a classical randomized algorithm with a multiplicative approximation error :

 1cPIQP≤PapIQP≤cPIQP,

then the PH collapses to the third level. The PH is a natural way of classifying the complexity of problems (languages) beyond NP (nondeterministic polynomial-time computation). The level- class of the hierarchy is defined recursively by . Then the PH is defined as the union of them. Here A indicates computation A with an oracle for B and means the nondeterministic version of A. NP=P implies a collapse of the HP at the first level, that is, the PH collapses completely. The collapse of the PH to the third level is not as unlikely as NP=P but still thought to be highly implausible.

###### Remark 4 (Hardness of Iqp by Bremner et al. [37])

If IQP is weakly simulatable by a classical polynomial time randomized algorithm within multiplicative error , PP post-BPP, resulting in a collapse of the PH to the third level.

Proof: (See also Ref. [37].) Let be a language decided by post-IQP with a bounded error , that is,

 if w∈L, PIQP(Ow=1|Pw=00...0)≥1/2+δ, (2) if w∉L, PIQP(Ow=1|Pw=00...0)≤1/2−δ, (3)

with a constant . Suppose we have a classical polynomial-time randomized algorithm that weakly simulates IQP, i.e., a sampling according to the probability distribution with a multiplicative error . Under postselection, we can simulate post-IQP, a sampling according to the probability distribution

 PapIQP(Qw=x|Pw=00..0)=PapIQP(Ow=x,Pw=00...0)PapIQP(Pw=00...0).

The multiplicative error for the conditional probability is bounded by :

 1c2PIQP(Qw=x|Pw=00..0)≤PapIQP(Qw=x|Pw=00..0)≤c2PIQP(Qw=x|Pw=00..0).

Using this and Eqs. (2) and (3), we obtain

 if w∉L, PapIQP(Qw=1|Pw=00..0)≤c2(1/2−δ).

Thus if both and are satisfied, we can construct a classical randomized algorithm that decides with bounded error. In other words, post-IQP post-BPP. Since post-IQP does not depend on the level of error , we can choose any value . By using the fact that IQP is universal-under-postselection, we conclude that if , PP = post-BQP = post-IQP post-BPP. Apparently, post-BQP includes post-BPP, and hence PP = post-BPP.

Due to Toda’s theorem [17], P with an oracle for PP includes whole classes in the PH, i.e., PH P. On the other hand, P with an oracle for post-BPP is in the third level of the PH, i.e, P. Thus PP = post-BPP implies a collapse of the PH to the third level, which is highly implausible. In other words, unless the PH collapses to the third level, there exists no efficient weak classical simulation of IQP.

### 2.5 Strong simulation and post-Bqp = Pp theorem

Aaronson’s theorem, post-BQP = PP [29], is quite useful to obtain not only quantum complexity results combined with the postselection argument by Bremner, Jozsa, and Shepherd [37], but also to provide “quantum proofs” of classical complexity results [43]. For example, in Ref. [29], Aaronson provided alternative and much simpler proof that PP is closed under intersection [51]. Moreover, by using post-BQP = PP, we can show that strong simulation of some computational tasks, which are as hard as post-BQP under postselection, is #P-hard even in an approximated case with a multiplicative error:

###### Remark 5 (Strong simulation and post-Bqp = Pp)

Suppose a (classical or quantum) computation is universal-under-postselection and has enough postselection ports, so that post- = post-BQP. Then an exact strong simulation of is as hard as an exact strong simulation of the output of universal quantum computer and hence #P-hard. Moreover, an approximated strong simulation of with a multiplicative error is also #P-hard. Thus if the output of is efficiently strongly simulatable (or equivalently if there is a fully polynomial-time classical approximation scheme for the output distribution of ), #P-hard problems are solved efficiently, and hence the PH collapses completely.

Proof: Suppose the probability distribution of the output of can be strongly simulated with a multiplicative error :

 1cPA(Ow=x,Pw=00...0)≤PapA(Ow=x,Pw=00...0)≤cPA(Ow=x,Pw=00...0).

By using this, we can calculate the postselected probability distribution

 PapA(Ow=x|Pw=00...0)=PapA(Ow=x,Pw=00...0)∑x′=0,1PapA(Ow=x′,Pw=00...0)

with a multiplicative error . Since post- post-BQP PP, if we can calculate efficiently with a multiplicative error , it is sufficient to decide a complete problem in PP. Since , the multiplicative approximation is enough to find a solution of -complete problem and hence -hard. Moreover, the multiplicative approximation results in an entire collapse of the PH.

The above remark indicates that if a function of interest is given as a probability distribution of some quantum task that is universal-under-postselection, then computation of is #P-hard even in the approximated case with a multiplicative error. This argument has been utilized by Kuperberg to show #P-hardness of approximating the Jones polynomial with a multiplicative error [44]. In Ref. [16], Aaronson provided an alternative proof of #P-hardness of calculating the permanent [15] based on the above argument and the KLM scheme [52]. We will also utilize it to provide the #P-hardness of a multiplicative approximation of Ising partition functions with an imaginary parameter region, in Sec. 5. Moreover, Remark 5 also implies that there is a good chance for a quantum computer in an approximation a function with an additive error under an appropriate normalization through the Hadamard test [2, 3, 4].

### 2.6 Related works

As a final part of the preliminary section, we review related works on computational complexity of commuting quantum circuits and Ising partition functions.

In Ref. [53], they have investigated rather general commuting quantum circuits of -level (qudit) systems. Not only the diagonal gates in the computational basis, but also general commuting gates are considered. Specifically they showed that a single qudit output (or at most polylogarithmic number of qudits) of 2-local commuting quantum circuits is strongly simulatable with an exponential accuracy. Moreover, a single qudit output of 3-local commuting quantum circuits cannot be strongly simulated, unless every problem in #P has a polynomial-time classical algorithm. The former result and intractability of IQP with two-local commuting gates imply that a polynomial size of the output is essential for commuting quantum circuits to be hard for a weak classical simulation.

In Ref. [54], it has been shown that an approximated random state, -design, can be generated by diagonal (i.e., commuting) quantum circuits [55, 56] (see also a review [54]). Since random states are shown to be useful in various quantum information tasks [57, 58, 59], they are one of the most important applications of commuting quantum circuits.

For the ferromagnetic Ising models with a constant magnetic field on arbitrary graphs, there exists a fully polynomial-time randomized approximation scheme (FPRAS) [60], which approximates the partition function of the size with a multiplicative error in a time. However, under the random magnetic fields, approximation of ferromagnetic Ising partition functions below a certain critical temperature equivalent, under an approximation-preserving reduction, to #BIS, which is a counting problem of the number of independent sets of a bipartite graph [61]. The counting problem #BIS is conjectured to lie in-between FPRAS and #SAT under an approximation-preserving reduction. Here #SAT indicates a counting problem of the number of satisfying configurations, and does not have an efficient (polynomial) multiplicative approximation unless NP=RP [62]. Moreover, it has been shown that a multiplicative approximation of antiferromagnetic Ising partition functions (below a certain threshold temperature) on -regular graphs () are NP-hard [63]. A comprehensive classification of complexity of multiplicative approximation of complex-valued Ising partition functions has been provided in Ref. [64].

In Ref. [65], a quantum algorithm to prepare quantum states encoding the thermal states of Ising models has been proposed for a restricted type of lattice structures. In Ref. [66], it has been shown that calculations of partition functions of random-bond Ising models are equivalent to quadratically signed weight enumerators, with an oracle for which classical probabilistic computation is polynomially equivalent to quantum computation [67]. Based on this mapping, certain quantum circuits corresponding to Ising models on planar lattices without magnetic fields have been shown to be efficiently simulatable by a classical computer in the strong sense [68].

Quantum algorithms to approximate the Ising partition functions in a complex parameter region have been studied so far using a transfer matrix method [69, 5], an overlap mapping  [70, 71, 72, 7], and a path integral method [6]. Specifically, certain sets of instances are shown to be BQP-complete, which means that such algorithms can actually do a nontrivial task, which would be intractable on a classical computer. In Ref. [6], a quantum algorithm for an additive approximation of real Ising partition functions on square lattices has been proposed by using an analytic continuation (see also a Fourier sampling scheme for spin models for estimating free energy [73]). In Ref. [7], another quantum algorithm for an additive approximation of square-lattice Ising partition functions with completely general parameters including real physical ones has been constructed based on a linear operator simulation by a unitary circuit with ancilla qubits (see also a linear operator simulation for an additive approximation of Tutte polynomials [4]). Specifically, in this case, the achievable approximation scale was also calculated explicitly. The Ising partition functions on square lattices with magnetic fields are know to be universal in the sense that the partition function of any other classical spin model can be mapped into an Ising partition function by choosing a certain parameter [71]. Thus the above quantum algorithm allows approximation of an arbitrary classical spin partition function with a certain approximation scale.

## 3 Bridging Iqp and Ising partition functions

In this section, we establish a bridge between IQP and Ising partition functions. We will first show that the joint probability distribution of the output of an IQP circuit associated with a graph is given by normalized squared norm of the partition function of the Ising model defined by the graph . This is shown first by mapping IQP into MBIQP and then by using the overlapping map [70], which relates the Ising partition functions with an inner product between a product state and the graph state . However, this is not sufficient for our purpose. Since there are exponentially many instances of the measurement outcomes, a straightforward sampling using the joint probability distributions does not work efficiently. Instead, we simulate IQP in a recursive way according to the conditional distribution on the previous measurement outcomes by using the Bayes theorem. To this end, we need the marginal distributions with respect to the measured qubits. If the marginal distribution can be calculated efficiently, the recursive method succeeds to simulate a sampling according to the joint probability distribution of IQP efficiently. In this section, we will also establish a relationship between the marginal distribution with respect to a set of the measured qubits and the Ising partition function defined on another graph , which is systematically constructed from the graph and the set .

### 3.1 Joint probability distribution

We define an Ising model, which may include multibody interactions, according to the bipartite graph and weights . The Ising model consists of the sites associated with the vertices and multibody interactions represented by the vertices . The spins engaged in the th interaction and its coupling constant are given by (or equivalently ) and , respectively.

###### Definition 5 (Multibody Ising Model with random iπ/2 magnetic fields)

For a given bipartite graph and weights defined on the vertices in , a Hamiltonian of an Ising model with random magnetic fields is defined by

 H({si},{θj},G)≡−∑vi∈VAiπsi1−σvi2−∑uj∈UBiθj⎛⎜⎝∏vi∈Nujσvi⎞⎟⎠, (4)

where is an Ising variable defined on each vertex . The partition function of the Ising model is defined by

 Z({svi},{θj},G)=∑{σvi}e−H({si},{θj},G),

where means the summation over all configuration .

We should note that, in addition to the interactions defined by the graph and weights, random magnetic fields are also introduced according to the bit string . This corresponds to the measurement outcome of as seen below. Furthermore, in Sec. 4, these random magnetic fields will be successfully removed for a certain class of Ising models by renormalizing them into the coupling constants .

The probability distribution of IQP associated with and weights is now shown to be equivalent to the normalized squared norm of the partition function of Ising model defined by the graph and weights as follows:

###### Theorem 1 (Iqp and Ising partition functions)

IQP associated with the graph and weights is equivalent to the sampling problem according to the normalized squared norm of an Ising partition function defined by the graph and weights :

 PIQP({si}|{θj},{Sj}) = 2|UB|PMBIQP({mvi},{muj}|{θj},G) =

Proof: We reformulate the left hand side of Eq. (1) using the overlap mapping developed by Van den Nest, Dür, and Briegel [71, 72]:

 PIQP({si}|{θj},{Sj}) (5) = 2|UB|PMBIQP({mvi},{muj}|{θj},G) = 2|UB|∣∣ ∣∣⎛⎝⨂vi∈VA⟨+si|⎞⎠⎛⎝⨂uj∈UB⟨θj,0|H⎞⎠∏uj∈UBHuj|G⟩∣∣ ∣∣2 = 2|UB|∣∣ ∣∣⎛⎝⨂vi∈VA⟨0|+eisiπ⟨1|√2⎞⎠⎛⎝⨂uj∈UB⟨0|eiθj+⟨1|e−iθj√2⎞⎠⎛⎜⎝2−|VA|/2∑{¯σvi}|{¯σvi}⟩⨂uj∈UB∣∣ ∣∣⨁vi∈Nuj¯σvi⟩⎞⎟⎠∣∣ ∣∣2 = 2|UB|∣∣ ∣∣2−|UB|/2−|VA|∑{¯σvi}exp⎡⎣∑vi∈VAiπsi¯σvi⎤⎦exp⎡⎢⎣∑uj∈UB−i⎡⎢⎣2θj⎛⎜⎝⨁vi∈Nuj¯σvi⎞⎟⎠−θj⎤⎥⎦⎤⎥⎦∣∣ ∣∣2 = 2−2|VA|∣∣ ∣∣∑{σi}e−H({si},{θj},G)∣∣ ∣∣2 =

where we define a binary variable , and indicates a summation over all binary strings. From the second to the third lines, we used the fact that

 |G⟩ = ⎛⎜⎝∏uj∈UB∏vi∈NujΛvi,uj(Z)⎞⎟⎠|+⟩⊗|VA||+⟩⊗|UB| = ⎛⎝∏uj∈UBHuj⎞⎠⎛⎜⎝∏uj∈UB∏vi∈NujΛvi,uj(X)⎞⎟⎠∑{¯σvi}|{¯σvi}⟩|0⟩⊗|UB| = ⎛⎝∏uj∈UBHuj⎞⎠∑{¯σvi}|{¯σvi}⟩⨂uj∈UB|⊕vi∈Nuj¯σvi⟩.

Equation (5) shows that IQP is equivalent to the sampling problem according to the probabilities proportional to the squared norm of the partition functions of an Ising model with imaginary coupling constants. Note that the measurement outcome correspond to the random magnetic fields.

The present sampling problem is not related directly to what is well studied in the fields of statistical physics, such as the Metropolis sampling according to the Boltzmann distribution. However, as we will see below, the relation between IQP and Ising partition functions leads us to several interesting results about complexity of IQP, since calculation of the Ising partition functions are well studied in both fields of statistical physics and computer science. It was shown in Ref. [31] that exact calculation of partition functions of two-body Ising models with magnetic fields even on the planar graphs is NP-hard. Furthermore, in general, exact calculation of partition functions of two-body Ising models with magnetic fields is #P-hard [32]. No polynomial-time approximation scheme with multiplicative error exists unless NP=RP. While IQP does not provide the exact values of the partition functions, it is surprising that the sampling according to the partition functions of many-body Ising models with imaginary coupling constants, can be done in IQP, which consists only of commuting gates and seems much weaker than BQP.

Only in the limited cases, the partition function of an Ising model can be calculated efficiently. Such an example is two-body Ising models on the 2D planar lattices without magnetic fields. In the next section, we show that certain classes of IQP are classically simulatable, at least in the weak sense, by using the fact that the associated Ising models are exactly solvable. To this end, we need not only the joint distribution of the output of IQP circuits but also the marginal distributions with respect to measured qubits, in order to simulate the sampling problem recursively.

### 3.2 Marginal distribution

Even if we can calculate the probability distribution efficiently, it does not directly mean that the corresponding IQP is classically simulatable, since there are exponentially many varieties of the measurement outcomes . An efficient weak classical simulation of IQP requires the marginal distribution with respect to measured qubits, by which we can simulate IQP recursively. In the following we will establish a mapping between the marginal distribution with respect to the set of measured qubits and the partition function of an Ising model defined on a merged graph . The merged graph constructed by merging a subgraph corresponding to the measured part of the graph and its copy (see Fig. 3). (The detailed definition of the subgraph and the merged graph are given in the proof of the following theorem.)

###### Theorem 2 (Marginal distribution of Iqp)

Let and be sets of the measured and unmeasured qubits, respectively (and hence and ). A marginal distribution with respect to the set

 PIQP({si}i∈M|{θj},{Sj},M)≡∑{si}i∈¯MPIQP({si}|{θj},{Sj})

is related to the Ising partition function defined by the merged graph and weights .

Proof: In order to prove this, we consider the corresponding MBIQP. However, it is just for a proof, and hence we do not need to simulate MBIQP in classical simulation as seen later. Thus without loss of generality, we can assume that the measurement outcome is subject to for all .

Based on the sets and , the sets of measured and unmeasured qubits in is defined as and , i.e., . We define a subgraph , where is a set of vertices that are connected with any vertices in , i.e., . is a set of edges whose two incident vertices both belong to . We denote simply by and by (see Fig. 3 (a)).

The marginal distribution can be written as measurements on the reduced density matrix on the qubits :

 PIQP({si}i∈M|{θj},{Sj},M) = ⟨Θ|Tr¯MAB[|G⟩⟨G|]|Θ⟩,

where , and indicates the partial trace with respect to the unmeasured qubits .

We define a subset as a set of vertices connected with any vertices in , i.e., (note that ). We refer to the qubits associated with the vertices in as the boundary qubits, since they are the boundary of the measured and unmeasured qubits in the graph state as shown in Fig. 3 (a).

For the graph state , the tracing out with respect to the unmeasured qubits can be equivalently done by basis measurements on the boundary qubits and forgetting about the measurement outcomes. This is because, -basis measurements on the boundary qubits separate the measured and unmeasured qubits (see Remark 1), and hence the tracing out of the qubits in does not have any effect on the measured qubits . From this observation we obtain

 Tr¯MAB[|G⟩⟨G|]=2−|∂MAB|∑{mvi}∂MAB⎛⎝∏vi∈∂MABB(vi)mvi⎞⎠|GM⟩⟨GM|⎛⎝∏vi∈∂MABB(vi)mvi⎞⎠

where