Commuting quantum circuits and complexity of Ising partition functions

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 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 imaginary-valued 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.


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 algorithms 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 [8,12,13], 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 [14]?If there is such a subclass of quantum computation that consists of experimental procedures much simpler than universal quantum computation 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 [15], a sampling problem according to the probability distribution of n 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 [16,17].Since a polynomial-time machine with an oracle for #P can solve all problems in the PH according to Toda's theorem [18], an exact classical simulation (in the strong sense [19,20] 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 [19,20] meaning a sampling according the probability distribution of the output), the PH collapses to the third level, which is unlikely to occur.(The detailed notions of classical simulation are provided in section 3.) This result brings a novel perspective on linear optical quantum computation and drives many researchers into the recent proof-of-principle experiments [21][22][23][24][25][26][27][28].
Another subclass of quantum computation of this kind is instantaneous quantum polynomial-time computation (IQP) proposed by Shepherd and Bremner [29].IQP consists only of commuting unitary gates, such as q  Î [ ] Z exp i k S k .Here q p Î [ ) 0, 2 is a rotational angle, Z k indicates the Pauli operator on the kth qubit, and S 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 +ñ Ä | n with +ñ º ñ + ñ | (| | ) 0 1 2, and the output qubits are measured in the X-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 [30].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 [15,31], the origin of the classical intractability of IQP is still not well understood.

Brief summary of the results
The purpose of this paper is to further explore IQP by relating it with computational complexity of calculating imaginary-valued Ising partition functions, which has been well studied in statistical physics, condensed matter physics, and computer science.
Specifically we obtain the following results (see figure 1): (i) 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 (theorems 1 and 2).(ii) By using the above relation, we specify classically simulatable classes of IQP, which correspond to exactly solvable Ising models (theorems 3 and 4).For example, IQP that consists only of nearest-neighbor twoqubit commuting gates in two-dimensions (2D) is classically simulatable, at least in the weak sense, irrespective of their rotational angles.
(iii) 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 (theorem 5).So there is no polynomial-time approximation scheme unless the PH collapses completely.
The first result bridges IQP and computational complexity of imaginary-valued Ising partition functions.Since an exact calculation of the partition functions takes an exponential time in the worst case, the above connection tells us the origin of hardness of classical simulation of IQP (an exact calculation of Ising partition functions is #P-hard even in the ferromagnetic case [32,33]).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 [19,20], 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 [19], 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) [34] on graph states [35], 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 [32,36,37].In the proof, we also utilize properties of graph states in order to renormalize random p i 2magnetic 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 [32,36,37].
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 [38].(Hereafter, such a property that a quantum computational task A 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 [19].
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 [30], which is employed to show the above result, is also utilized to provide a 'quantum proof' [39] of #P-hardness of approximating the permanent [17] and the Jones polynomial [40] with a multiplicative error.
The rest of the paper is organized as follows.In section 3, 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 [30] 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 section 4, 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 section 5, 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 section 6, 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 7 is devoted to conclusion and discussion.

Preliminary
In this section, we summarize preliminary knowledges to understand our main results.Fundamental properties of the graph states are provided in section 3.1.Complexity theoretical notions are provided in section 3.2.The existing results on IQP are reviewed in section 3.3, where the postselection argument is explained in detail.In section 3.4, we present an interesting application of post-BQP=PP theorem to show hardness of strong simulatability.Related works are summarized in section 3.5.

Graph states and their properties
In the proofs of the main theorems, we work with a measurement-based version of IQP, namely MBIQP, introduced by Hoban et al [41].The reason is that transformations on the resource state for MBQC [34], socalled graph states [35], 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.
The Pauli matrix on the ith qubit is denoted by ).The Hadamard gate is denoted H.The eigenstates of Z with eigenvalues +1 and −1 are denoted by ñ |0 and ñ |1 , respectively.The eigenstates of X with eigenvalues +1 and −1 are denoted by +ñ | and -ñ | , respectively.We denote the controlled-A gate acting on the ith (control) and jth (target) qubits by and .
, is a graph consisting of vertices V and edges E. We define the neighbor  i of i as the set of vertices adjacent to vertex i.An operator |G is defined as the simultaneous eigenstate of the operator K i with eigenvalue +1 for all i: The above relation reads that the graph state ñ |G is stabilized by the operator K i for all i.Such a state is called a stabilizer state.The operator K i , which stabilizes the stabilizer state, is called a stabilizer operator.A detailed description of the stabilizer formalism could be found in [42,43].
This can be confirmed as follows.The product state +ñ V is the eigenstate of X i with eigenvalue +1 for all Î i V , and hence +ñ = + ñ for both sides, we obtain where we used the fact that . This is the definition of the graph state, and we conclude ñ =  L +ñ . In the proofs of the main theorems, we repeatedly consider single-qubit projective measurements on the graph state and the resultant post-measurement graph state.In the following we will provide two important facts on the graph states under projective measurements in certain bases.
Fact 1 (Z-basis measurement).If the kth qubit of the graph state ñ |G is measured in the Z-basis, the resultant post-measurement state is the graph state associated with the graph ¢ º ⧹ G G k, where the byproduct operator See appendix A.1 for the proof.Intuitively, the Z-basis measurement on the kth qubit removes the kth qubit from the graph state, and then the byproduct operator B k is located according the measurement outcome m k .
Next we consider a projective measurement on the kth qubit in the q ñ º + ñ + -ñ Fact 2 (Remote Z-rotation).The projective measurement of the kth qubit on the graph state ñ See appendix A.2 for the proof.
The measurement in the q ñ {| } k m , k basis induces a multi-body Z rotation on the qubits adjacent to the kth qubit.The norms of the post-measurement states are both 1/2, which indicates that the outcomes = m 0, 1 k 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 [34].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 [35].

Definitions of complexity theoretical notions
Here we provide definitions of complexity theoretical notions, which are relevant to our main arguments.
When we consider classical simulation of quantum tasks, there are two important notions of simulatability.
Definition 2 (Strong and weak simulations [19,20]).Suppose  is a uniformly generated quantum circuit of a model of quantum computation A (e.g., IQP, one-clean-qubit model [44], and universal quantum computation, etc).The probability distribution of the output x (classical bits) is denoted by  ( | ) P x A .An efficient weak simulation of A is a classical polynomial-time randomized computation that samples x with the probability  ( | ) P x A .On the other hand, an efficient strong simulation of a quantum circuit  for a given output x is a classical polynomial-time (randomized) computation that calculates the probability with respect to an arbitrary subset ¢ x of the output bits x.
In addition to these notions of classical simulation, we can further consider types of approximations.In an approximated simulation with a multiplicative error < c 1 , we can replace the probability distribution  ( | ) P x A with its approximation  ( | ) P x A ap that lies inside the following approximation range Apparently, if we can simulate A 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 A can actually do.For example, an exact strong simulation of the output of universal quantum computation is #P-hard [19].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 [19].
In the proof of the main theorems, we frequently use the postselection argument; two complexity classes are compared by assuming a fictitious ability to postselect a desired output, whose probability can be exponentially small.To this end, the postselected class, post-A, is defined as a class of decision problems solvable by using a computational model associated with A (e.g.instantaneous polynomial-time quantum computation for IQP, universal quantum computation for BQP, and and polynomial-time classical randomized computation for BPP) with a bounded error under postselection [30].
Definition 3 (Postselected class).A language L is in the class post-A iff there exists a uniform family { } C w of circuits of a computational model associated with A, where a single line output register  w (for the Lmembership decision problem) and a (generally O(poly(n) )-line) postselection register  w are specified such that In [30], post-BQP is shown to be equal to PP, a class of probabilistic computation whose success probability is greater than 1/2 (possibly unbounded).
In the postselection argument, we compare two postselected complexity classes via the PH.The PH is a natural way of classifying the complexity of problems (languages) beyond NP (nondeterministic polynomialtime computation) using oracles.A computation A with an oracle for B is denoted by A B .Further, the nondeterministic version of A is denoted by 'N'A.The level-k class D k of the hierarchy is defined recursively by NP=P implies a collapse of the HP to the first level, that is, the PH collapses completely.It is known that P BPP post is included in D 3 [45], and PH ⊆ P PP [18].

Instantaneous quantum polynomial-time computation
Here we introduce IQP and its measurement-based version.We first define IQP: Definition 4 (IQP by Bremner et al [29,38]).Let n be the number of qubits.A commuting gate is defined by where q p Î [ ) 0, 2 j is a real number meaning the rotational angle, and { } S j is a set of subsets of , on which the commuting gates act.We refer to a poly(n) number of commuting gates, including the input state +ñ Ä | n and the X-basis measurements, as an IQP circuit.IQP is defined as a sampling problem from the IQP circuit, whose probability distribution is given by For each commuting circuit, we can naturally define a bipartite graph , where V A and U B are disjoint sets of vertices, and every edge Î E connects a vertex in j , that is, the set S j specifies the vertices v i that are connected with the vertex u j .For a given weighted bipartite graph , where a weight q j is defined on each vertex Î u U j B , we can define an IQP circuit.
By using definition 1 and fact 2, IQP can be rewritten as MBQC on a graph state ñ |G associated with the graph . In this case, the set  u j of vertices corresponds to S j .More precisely, for a given bipartite graph state and weights q { } j , measurement-based IQP (MBIQP) is defined as follows: Definition 5 (MBIQP by Hoban et al [41]).MBIQP is defined as a sampling problem according to the probability distribution .
The bit strings { } m v i and { } m u j correspond to the measurement outcomes on the qubits belonging to V A and U B , 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.
Lemma 1 (MBIQP=IQP by Hoban et al [41]).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 . By using this equality, we obtain where m v i and s i are related via In the above, we used the facts that each measurement outcome { } m u j is randomly distributed with probability 1/2, and the projection q á | j,0 results in the commuting gate q ( ) D S , j j (see fact 2).The above equality means that, regardless of the measurement outcomes { } m v i and { } m u j , we can simulate IQP by using MBIQP.On the other hand, by using a random bit string { } m u j with an equal probability 1/2 for each bit and { } s i sampled from the IQP circuit, we obtain , 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.
In order to simulate post-BQP, it is sufficient to consider post-IQP or post-MBIQP associated with planar bipartite graphs and q p = 8 j for all j [38].(As shown in section 6, we can obtain the same result not only for q p = 8 j but also for almost all angles q j .)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 q j from p p { } 4, 8, 0 .Specifically, q = 0 j corresponds to a deletion of vertex u j from the graph (see fact 1).q p = 4 In [38], Bremner, Jozsa, and Shepherd showed that if IQP is weakly simulatable by using a classical randomized algorithm with a multiplicative approximation error < < c 1 2 : then the PH collapses to the third level.The collapse of the PH to the third level is not as unlikely as NP=P but still thought to be highly implausible.
Lemma 2 (Hardness of IQP by Bremner et al [38]).If IQP is weakly simulatable by a classical polynomial time randomized algorithm within multiplicative error   c 1 2 , PP=post-BPP, resulting in a collapse of the PH to the third level.
Proof.(See also [38].)Let L be a language decided by post-IQP with a bounded error Suppose we have a classical polynomial-time randomized algorithm that weakly simulates IQP, i.e., a sampling according to the probability distribution Under postselection, we can simulate post-IQP, a sampling according to the probability distribution The multiplicative error for the conditional probability Using this and equations (2) and (3), we obtain are satisfied, we can construct a classical randomized algorithm that decides L 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 d < < 0 1 2. By using the fact that IQP is universal-under-postselection, we conclude that if < c 2 , PP=post-BQP=post-IQP ⊆ post-BPP.Apparently, post-BQP includes post-BPP, and hence PP=post-BPP.
Due to Toda's theorem [18], P with an oracle for PP includes whole classes in the PH, i.e., PH ⊆ P PP .On the other hand, P with an oracle for post-BPP is in the third level of the PH, i.e, BPP Í D -P post 3 .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. ,

Strong simulation and post-BQP=PP theorem
Aaronson's theorem, post-BQP=PP [30], is quite useful to obtain not only quantum complexity results combined with the postselection argument by Bremner et al [38], but also to provide 'quantum proofs' of classical complexity results [39].For example, in [30], Aaronson provided alternative and much simpler proof bases.A similar brickwork state is employed for hardness proof of an IQP with random measurements on a translation invariant lattice [89].
that PP is closed under intersection [48].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: Lemma 3 (Strong simulation and post-BQP=PP).Suppose a (classical or quantum) computation A is universal-under-postselection and has enough postselection ports, so that post-A=post-BQP.If the output of A is efficiently strongly simulatable with a multiplicative error < < c 1 2 (or if there is a fully polynomial-time classical approximation scheme for the output distribution of A), the PH collapses completely.
Proof.Suppose the probability distribution of the output of A can be strongly simulated with a multiplicative error < < c 1 2 : By using this, we can calculate the postselected probability distribution , it is sufficient to decide a complete problem in PP.Since P P PP P = # , the multiplicative approximation is enough to find a solution of #P-complete problem and hence P # -hard.Therefore, the existence of such an efficient strong simulation with the multiplicative error < < c 1 2 results in an entire collapse of the PH., The above lemma indicates that if a function f (x) of interest is given as a probability distribution of some quantum task that is universal-under-postselection, then computation of f (x) is #P-hard even in the approximated case with a multiplicative error.This argument has been utilized by Kuperberg to show #Phardness of approximating the Jones polynomial with a multiplicative error [40].In [17], Aaronson provided an alternative proof of #P-hardness of calculating the permanent [16] based on the above argument and the KLM scheme [49].We will also utilize it to provide the #P-hardness of a multiplicative approximation of Ising partition functions with an imaginary parameter region, in section 6.Moreover, lemma 3 also implies that there is a good chance for a quantum computer in an approximation a function f (x) with an additive error under an appropriate normalization through the Hadamard test [2][3][4].

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 [50], they have investigated rather general commuting quantum circuits of d-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.Recently, hardness of IQP is improved from sampling with a constant multiplicative error to that with a constant l 1 additive error, where the relation between IQP and Ising partition functions are utilized [51].
In [52], it has been shown that an approximated random state, t-design, can be generated by diagonal (i.e., commuting) quantum circuits [53,54] (see also a review [52]).Since random states are shown to be useful in various quantum information tasks [55][56][57], 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) [58], which approximates the partition function Z Ising of the size n with a multiplicative error 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 [59].The counting problem #BIS is conjectured to lie inbetween 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 [60].Moreover, it has been shown that a multiplicative approximation of antiferromagnetic Ising partition functions (below a certain threshold temperature) on d-regular graphs (  d 3) are NP-hard [61].All these earlier works have done on the Ising models with real coupling strengths and fields.A comprehensive classification of complexity of multiplicative approximation of complex-valued Ising partition functions (including our results) has been provided in [62].
In [63], 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 [64], it has been shown that calculations of partition functions of J 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 [65].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 [66].
Quantum algorithms to approximate the Ising partition functions in a complex parameter region have been studied so far using a transfer matrix method [5,67], an overlap mapping [7,[68][69][70], 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 [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 [71]).In [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 [69].Furthermore, the 2D Ising models are know to be universal, which means that we can embed an arbitrary classical spin models to its low energy sector [72].Thus the above quantum algorithm allows approximation of an arbitrary classical spin partition function with a certain approximation scale.

Bridging IQP and Ising partition functions
In this section, we establish a bridge between IQP and Ising partition functions.In section 4.1, we will first show that the joint probability distribution of the output of an IQP circuit associated with a graph G is given by normalized squared norm of the partition function of the Ising model defined by the graph G. Since there are exponentially many instances of the measurement outcomes, a straightforward sampling using the joint probability distributions does not work efficiently.To resolve this, 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.In section 4.2 we will establish a relationship between the marginal distribution with respect to a set M of the measured qubits and the Ising partition function defined on another graph GM , which is systematically constructed from the graph G and the set M.

Joint probability distribution
We define an Ising model, which may include multibody interactions, according to the bipartite graph and weights q { } j .The Ising model consists of the sites associated with the vertices Î v V i A and multibody interactions represented by the vertices Î u U j B .The spins engaged in the jth interaction and its coupling constant are given by  u j (or equivalently S j ) and q j , respectively.Definition 6 (Multibody Ising model with random p i 2magnetic fields).For a given bipartite graph and weights q { } j defined on the vertices in U B , a Hamiltonian of an Ising model with random p i 2magnetic fields is defined by The partition function of the Ising model is defined by where å s { } v i means the summation over all configuration s { } v i .
We should note that, in addition to the interactions defined by the graph and weights, random p i 2 magnetic fields are also introduced according to the bit string { } s v i .This corresponds to the measurement outcome of IQP as seen below.Furthermore, in section 5, these random p i 2magnetic fields will be successfully removed for a certain class of Ising models by renormalizing them into the coupling constants q { } j .The probability distribution of IQP associated with and weights q { } j is now shown to be equivalent to the normalized squared norm of the partition function of Ising model defined by the graph G and weights q { } j as follows: Theorem 1 (IQP and Ising partition functions).IQP associated with the graph and weights q { } j is equivalent to the sampling problem according to the normalized squared norm of an Ising partition function defined by the graph G and weights q { } j : .
Proof.We reformulate the left-hand side of equation (1) using the overlap mapping developed by Van den Nest et al [69,70]: where we define a binary variable s s º -¯( ) , and å s ¯vi indicates a summation over all binary strings.From the second to the third lines, we used the fact that ) 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 { } s i corresponds to the random p i 2magnetic 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 [32] that exact calculation of partition functions of the Ising models with real coupling strengths and magnetic fields is NP-hard even on the planar graphs.Furthermore, in general, exact calculation of partition functions of two-body Ising models with magnetic fields is #P-hard [33].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.

Marginal distribution
Even if we can calculate the probability distribution q ({ }|{ } { }) P s S , i j j IQP efficiently, it does not directly mean that the corresponding IQP is classically simulatable, since there are exponentially many varieties of the measurement outcomes { } s i .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 M of measured qubits and the partition function of an Ising model defined on a merged graph GM .The merged graph GM constructed by merging a subgraph G M corresponding to the measured part of the graph G and its copy ¢ G M (see figure 3). (The detailed definition of the subgraph G M and the merged graph GM are given in the proof of the following theorem.) is related to the Ising partition function defined by the merged graph GM 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 = m 0 u j for all Î u U j B .Based on the sets M and M , the sets of measured and unmeasured qubits in V A is defined as M A and MA , i.e., B is a set of vertices that are connected with any vertices in M A , i.e., The marginal distribution can be written as measurements on the reduced density matrix on the qubits M AB : , and Tr M AB indicates the partial trace with respect to the unmeasured qubits MAB .
We define a subset ¶ Ì M M AB AB as a set of vertices connected with any vertices in M AB , i.e., ).We refer to the qubits associated with the vertices in ¶M AB as the boundary qubits, since they are the boundary of the measured and unmeasured qubits in the graph state as shown in figure 3(a).
For the graph state ñ |G , the tracing out with respect to the unmeasured qubits MAB can be equivalently done by Z basis measurements on the boundary qubits and forgetting about the measurement outcomes.This is because, Z-basis measurements on the boundary qubits separate the measured and unmeasured qubits (see fact 1), and hence the tracing out of the qubits in ¶ ¯⧹ M M AB AB does not have any effect on the measured qubits M AB .From this observation we obtain is the set of the measurement outcomes on the boundary qubits, and we define a byproduct operator G M are connected iff there is an edge between them in the original graph G and its copy ¢ G .The graph state associated with the merged graph GM is written as where ¢( ) where we should note that the sign of the angle q j,0 is flipped.Next we consider a projection by Qñ Q¢ñ | | as follows:

AB
This indicates that the summation over exponentially many variables for the marginalization is taken simply in an overlap between the product state and the merged graph state.On the other hand, the overlap áQ á+ áQ¢ ñ is also reformulated as an Ising partition function as done in the proof of theorem 1.Specifically, the interaction patterns are given by the merged graph GM .The coupling strengths are given by two copies of q Î { } where we defined B .We should note that s i and ¢ s i take the same value but q j ʼs sign is flipped on its copy ¢ Î ¢ u M j B .From equations ( 6) and (7), , , That is, the marginal distribution with respect to the set M of the measured qubits is given by the normalized squared norm of the partition function of the Ising model defined by the merged graph GM ., The above theorem also indicates that the marginal distribution is equivalent to the square root of the joint probability of the IQP circuit associated with the merged graph GM , weights * q { } j and the measurement outcomes * { } s i : This indicates that if the joint probability distributions of the IQP circuits associated with a class of graphs can be calculated efficiently, and the class of graphs is closed under merging mentioned above, then the marginal distributions of such a class of IQP circuits can also be calculated efficiently.An example of such a class is planar graphs, where the merged graph ˜( ) G M k is also a planar graph with an appropriately chosen measurement order such that ( )  M k is always connected.Conditioned on the measurement outcome Î { } s i i M on the set M, the probability of obtaining the next measurement outcome s k is calculated by using the Bayes rule as By denoting the set of all measured qubits after the kth measurements as ( ) M k (since there is no order in the measurements in IQP, we can choose an arbitrary order of measurements for our convenience), we can reconstruct the joint probability distribution of IQP as follows: where the i k th qubit is measured at step k, i.e., . If the marginal distribution, that is, the Ising partition functions defined on ˜( ) G M k can be calculated efficiently for all ( ) M k for a measurement order, IQP is classically simulatable at least in the weak sense.
Note that even if we can calculate the marginal distributions for an appropriately chosen measurement order, it is not sufficient to show strong simulatability in a strict sense.In order to shown strong simulatability, we have to show that arbitrary marginal distributions can be calculated efficiently.In the next section, we will see a classically simulatable class based on planarity of the associated Ising models.However, if we choose a wrong measurement order, the merged graph results in a non-planar graph.In such a case, the marginal distribution is mapped into a partition function of an Ising model on a non-planar lattice, which is hard to calculate [32,73,74].To clarify this situation, we say almost strongly simulatable if there exists a measurement order, and all marginal distributions with respect it can be calculated efficiently.

Classical simulatable classes of IQP
In this section, we will provide two classes of IQP that are classically simulatable efficiently.One in section 5.1 is based on the sparsity of the commuting gates.The other in section 5.2 is based on the exact solvability of Ising models on the 2D planar lattices without magnetic fields [32,36,37].
In general, exact calculation of partition functions of Ising models in the presence of magnetic fields is highly intractable in classical computers even on 2D planar lattice [32,33].The Ising models, to which we have mapped IQP in section 4, include the random p i 2magnetic fields depending on the output { } s i .In both cases, we will show that if the geometries of the graphs have some properties, we can safely remove the magnetic fields renormalizing it into the coupling constants q { } j .

Classical simulatability: sparse commuting circuits
Let us define a . We consider a class of bipartite graphs with . We call such a bipartite graph as an independent-bipartite graph (IBG).Examples of the IBGs is depicted in figure 4(a).Later we will weaken the condition . Now we consider the Ising model associated with an IBG.If we consider only computational basis, we can replace the classical spin variable σ with the Pauli Z operator.Therefore, we can rewrite the Ising Hamiltonian equation (4) as å å .
Then the partition function is given by Our main goal here is to calculate 2 exactly.To this end, let us first consider the case = s 0 i for all v i .In this case, there is no magnetic field, and hence we can transform the Hamiltonian into an interaction-free Ising model by virtue of the properties of the IBGs.
Lemma 4 (Mapping to interaction-free Ising model).For any Ising model associated with an IBG, there exists a unitary operator W that transforms q ˆ({ } { } ) H G 0 , , j to interaction-free Ising Hamiltonian: Proof.Since the column vectors of R are independent, we can transform the matrix R to the identity matrix by using the Gauss-Jordan elimination method.Since the matrix R defines the graph and the Hamiltonian, the Gauss-Jordan elimination can be viewed as a transformation of the graph and the corresponding Hamiltonian.The graph associated with the identity matrix consists of pairs of vertices ( ) v u , i i connected by edges.Since each vertex in U B is always connected only one vertex in V A , the corresponding Ising Hamiltonian is interaction-free.
Each process in the Gauss-Jordan elimination for the matrix R can be implemented on the Hamiltonian by conjugations of controlled-Not (CNOT) and swapping gate operations.The CNOT gate from the ith to the jth qubits is equivalent to adding the jth row vector to the ith one on the matrix R. The swapping gate exchanges the labels { } v i of the vertices.Thus there exists a unitary operator W consisting of swapping and CNOT gates such that For example, in the case of the IBG shown in figure 4(a), the set of operators in the Hamiltonian is given by 2 .This can be mapped to 3 by using the unitary operator 2 1 , where S v v , wap i j is the swapping operation between qubits v i and v j .
By using such a W, the partition function can be calculated as Since the joint probability is factorized for each q j , we can easily calculate its marginal distribution (without using theorem 2 in this case).
Next we extend the above result to the general measurement outcomes { } s i .This is done by renormalizing the random p i 2magnetic fields into the coupling constants as follows.
Lemma 5 (Renormalization of p i 2magnetic fields).For any IQP associated with an IBG, we can find a bit string { } c u j such that Proof.Let us consider the corresponding MBIQP.From the definition of MBIQP, Since the row vectors of R are independent, we can find a vector c u j in for any { } m v i .By using this vector c u j , we obtain the following equality, By using this and the fact that K u j stabilizes ñ |G , we obtain where q q p º + ˜c 2 j j u j . Specifically, if we consider the case = m 0 u j , we obtain that .
, Let us consider the example shown in figure 4(a) again.For instance, if . By multiplying the stabilizer operators of the graph state with respect to the 4th and 6th vertices, we obtain another stabilizer operator 3 .Thus the action of ({ }) F 0, 0, 1 is equivalent to that of X X 4 6 , which rotates the angles q u 1 and q u 3 by p 2.
By combining lemmas 4 and 5, we can show classical simulatability of IQP associated with IBGs.
Proof.From lemmas 4 and 5, we can calculate q ({ }|{ }) P s i j IQP exactly for an IBG including its arbitrary marginal distributions.Thus such a class of IQP is classically simulatable for arbitrary angles q { } j in the strong sense., Finally, we slightly weaken the condition, , there exist W such that transforms the many-body Ising Hamiltonian to interaction-free Ising Hamiltonian as long as the column vectors of R are independent.In this case, the existence of c u j for all { } m u j is not guaranteed, and hence we have to find another way to deal with this situation.
To settle this, we add ancilla vertices B (The 5th qubit in figure 4(a) can be viewed as the ancilla qubit for the non-full rank graph in figure 4(c)).Due to theorem 3, we can exactly calculate the probability for the slightly enlarged problem, . Then, the probability q ({ }|{ }) , with which we want to sample { } s i , can be obtained by considering a specific case q A representative example of classically simulatable IQP circuits are depicted in figures 4(a) and (c).If we restrict ourselves into two-body Ising models (i.e., ), the meaning of independence becomes clear; independence means that the lattice does not contain any loop, such as Ising models on one-dimensional chain or tree graphs.Thus IQP with two-qubit commuting gates whose interaction geometry does not contain any loop can be efficiently simulated in the strong sense.In order to avoid the present class of classically simulatable IQP, the IQP circuits that consist of at least n (=| | V A ) commuting gates acting on different subsets { } S j of qubits are sufficient.

Classical simulatability: planar-IQP
Classical simulatability in the previous case is based on the sparsity of the commuting gates, where at most only n 1 commuting gates are included.In such a case we can calculate the partition functions without using theorem 2. Next we will provide another classically simulatable class of IQP, that includes commuting gates much more than n.Specifically, we will show below that IQP with two-qubit commuting gates acting on nearest-neighbor two qubits on the 2D planar graphs, which we call planar-IQP, is classically simulatable almost in the strong sense.That is, the probability distribution of the output and its marginal distribution for an appropriately chosen measurement order can be calculated efficiently.To this end, we first show, by using properties of the graph states, that for two-body Ising models we can always remove the random p i 2magnetic fields by appropriately renormalizing their effects into coupling constants q { } j .This allows us to map planar-IQP to two-body Ising models without magnetic fields.Then we utilize theorem 2 and exact solvability of twobody Ising models on planar lattices to construct an efficient classical simulation of IQP. Consider . Here the addition is taken modulo two.
Proof.The bipartite graph state is stabilized by . By using this, we obtain . , Thus we only consider the case , that is, the number of vertices with = m 1 v i is even.In such a case, we can show that modifying the coupling constants q { } j appropriately as follows can renormalize p i 2 magnetic fields.
Lemma 7 (Property of graph states 2).For any IQP associated with a connected bipartite graph G with = | | S 2 j for all j, by appropriately choosing q { ˜} j , where = { } s 0 i means that s i = 0 for all i.Equivalently, for the corresponding Ising models, we have that is, the random p i 2magnetic fields can be renormalized into the coupling constants q { ˜} j .
Proof.Consider the graph state ñ |G .Due to lemma 6, the number of = s 1 i is always even.The graph is connected.Thus we can always make pairs of vertices Î . Apparently this can be done in polynomial-time, since arbitrary paring is allowed.Let (see figures 5(b) and (c)).By using this fact, we can Then we obtain This leads that V A , we obtain the surface code state defined on a lattice , where vertex and edge corresponds to vertices in V A and U B of G respectively, and a qubit is assigned on each edge.This can be confirmed as follows.The post-measurement state is stabilized by i for all v i .Furthermore, for all faces f of the lattice stabilizes the post-measurement state, where ¶f is the set of the edges that are boundary of the face f.These two types operators are called star and plaquette operators in [75].The postmeasurement state or equivalently the surface code state is the ground state of the Hamiltonian, so-called Kitaev's toric code Hamiltonian, A projection by -ñ | v i results in the eigenvalue −1 of the star operator at vertex v i , which corresponds to the anyonic excitation in the Kitaev model.Then lemma 6 indicates that the parity of anyonic excitations is always even.They are created and annihilated in pairs.Lemma 7 corresponds a way to annihilate the pairs of the anyonic excitations.The trajectory of anyonic excitations in the annihilation process corresponds to  ( ) path .Now we are ready to show that classical simulatability of IQP consisting of 2D nearest-neighbor two-qubit commuting gates.
Theorem 4 (Classical simulatability: planar-IQP).Planer-IQP consisting of two-qubit commuting gates acting on nearest-neighbor qubits on the 2D planar graphs is classically simulatable almost in the strong sense.
Proof.According to theorem 1, the joint probability distribution of planar-IQP can be calculated from a twobody Ising partition function on a planar lattice.Since the graph G is a planar bipartite graph, we can easily find an order of measurements such that ˜( ) G M k is also planar at any measurement step k. (Any order of measurements such that the subgraph ( ) G M k becomes a connected graph for all k can be utilized.)Due to theorem 2, the marginal distributions are also given as Ising partition functions on planar lattices.Furthermore, in the merged graph, the vertices . For such Ising models, by using lemmas 6 and 7, the random magnetic p i 2fields can be renormalized into the coupling constants q q  { } { ˜} j .Thus all marginal distributions can be calculated from the two-body Ising partition functions on planar lattices without magnetic fields.On the other hand, it is well known that the partition function of two-body Ising models on planar lattices without magnetic fields can be calculated efficiently by expressing them as the Pfaffians [32,36,37].
Thus we conclude that IQP of this class can be simulated efficiently almost in the strong sense, which is sufficient for an efficient weak simulation with a recursive method., Note that a similar argument is also made in [76] by considering classical simulatability of MBQC on the planar surface codes [75] ) can be renormalized into the coupling constants q q  { } { ˜} j j , where an arbitrary perfect matching is chosen as shown in lemma 7. Thus we may construct an alternative proof of theorem 4 without using theorem 2. However, theorem 2, employing the properties of the graph states, is much straightforward and simple for our purpose.Furthermore, theorem 2 is valid not only for the case with = | | S 2 j , but also the general cases, which cannot be regarded as MBQC on the planar surface codes.
While we have shown planar-IQP is almost strongly simulatable, it seems not to be strongly simulatable in the strict sense.Suppose that we choose a measurement order { } ( ) M k such that any subgraph ( ) G M k consists of multiple disjoint subgraphs.In such a case, the merged graph becomes a non-planar graph of a higher genus.The Ising partition functions on lattices of a higher genus are hard to calculate in general [32,73,74].There seems to be an intermediate class of classical simulation, which we named almost strongly simulatable, between strongly simulatable (in the strict sense) and weakly simulatable.
The Pfaffian is the square root of the determinant, and hence the probability distribution of planar-IQP is given by the determinant of an appropriately defined 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 as matchgates [77][78][79][80][81]. 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 [31].This suggests that the sampling problems in physics can be classified in a unified way as sampling problems of elementary particles.
Important implications of theorem 4 are twofold.One is that planar-IQP can generate highly entangled state but its output is classically simulatable almost in the strong sense.This is also the case for the Clifford circuits and match gates, which generate genuinely entangled states but are classically simulatable [43,[77][78][79][80]. Secondary, if single-qubit rotations are added to planer-IQP, it becomes universal-under-postselection, whose weak simulation is intractable unless the PH collapses to the third level.Thus single-qubit rotations take a quite important rule for IQP to be classically intractable.Indeed, single-qubit rotations make a drastic change of computational complexity from almost strongly simulatable to not simulatable even in the weak sense.
We would like to note that a similar result is also obtained in a rather different situation [19].He showed that Toffoli-Diagonal circuits, which include quantum Fourier transformation for Shor's factorization algorithm, can be efficiently simulated if there is no basis change at the final round before the the computational basis measurements.Thus single-qubit rotations also play a very important role for the Toffoli-Diagonal circuits to be classically intractable.
Another consequence of theorem 4 lies in the context of experimental verification of quantum benefits.When we utilize IQP for the purpose of experimental verification of quantum benefits, we have to avoid planar-IQP, since a malicious quantum device can cheat experimentalists by classically sampling the results instead of implementing the IQP circuit.At the same time, the existence of efficient classical simulation for planar-IQP implies that checking the correctness of experiments of this class is much easier.Thus when experimentalists realize IQP, they should, at least, try to implement planar-IQP, since its correctness can be easily checked.It might be possible to efficiently ensure, under a plausible assumption, that two-qubit commuting gates are implemented appropriately, since experimental devices are usually well known and not so malicious.Hopefully, classical intractability of quantum devices may be verified by an efficient experimental verification of planar-IQP combined with other efficient witness or plausible assumptions [82].Moreover, planar commuting circuits can generate an interesting class of entangled states, called weighted graph states [35].The constructed classical simulation would be useful to check an experimental preparation of such states efficiently.

Hardness of approximating Ising partition functions
In this section, we utilize the established relationship between IQP and Ising partition functions in an opposite direction; by considering universal-under-postselection instances of IQP, we show that a multiplicative approximation of Ising partition functions with almost all imaginary coupling constants is #P-hard even on planar lattices with a bounded degree.Note that this argument based on universality-under-postselection and post-BQP=PP have been already utilized to show #P-hardness of approximating the permanent [17] and the Jones polynomial [40].
Theorem 5 (Hardness of approximating imaginary Ising partition functions).A multiplicative approximation of Ising partition functions with almost all imaginary coupling constants is #P-hard even on planar lattices with a bounded degree.Thus if there exists a fully polynomial-time classical approximation scheme, the PH collapses completely.
Proof.We consider IQP with a homogeneous rotational angle θ.As shown in [38], IQP associated with a bounded-degree planar graph with is universal-under-postselection when the homogeneous rotational angle is given by q p = 8.Thus a multiplicative approximation of the Ising partition functions with the homogeneous coupling constant q p = i i 8is #P-hard due to theorem 1 and lemma 3. The same result holds not only q p = i i 8but also q p = + ( ) ( ) m i i 2l 1 8 for integers l and m.Suppose the homogeneous coupling is given by an irrational angle i.e., q np = 2 with n Î [ ) 0, 1 If a set of instances of IQP is universal-under-postselection, post-IQP can simulate universal fault-tolerant quantum computation.If the error ò is sufficiently smaller than the threshold value of fault-tolerant quantum computation [84][85][86], we can reliably simulate universal quantum computation (i.e., BQP) and moreover PP with the help of postselection.(See [82,87] for an application of the fault-tolerance theory to the postselection argument, where it is shown that if the amount of the error is sufficiently small, we can solve a PP-complete problem under postselection.)Thus IQP with almost all rotational angles is universal-under-postselection.This fact and lemma 3 lead that a multiplicative approximation of the Ising partition functions is #P-hard for almost all imaginary coupling constants even on planar lattices with a bounded degree., The above result indicates that almost all imaginary Ising partition functions are substantially hard to calculate even in the approximated case with a multiplicative error.This result contrasts with the existence of a FPRAS in the ferromagnetic cases with magnetic fields shown by Jerrum and Sinclair [33] and antiferromagnetic cases on a sort of lattices shown by Sinclair, Srivastava, and Thurley [88].In these cases, an exact calculation is #P-hard but its approximation with a multiplicative error is easy.On the other hand, as noted in lemma 3, #Phardness associated with post-BQP=PP theorem is also holds in the approximated case automatically.
With the random magnetic fields, approximation of ferromagnetic Ising partition functions below a certain critical temperature belongs, under an approximation-preserving reduction, to a class #BIS, which is defined as a counting problem of the number of independent sets of a bipartite graph [59].Moreover, it has been shown that a multiplicative approximation of antiferromagnetic Ising partition functions on d-regular graphs (  d 3) are NP-hard [61].Compared with the complexity of these real Ising partition functions, the imaginary Ising partition functions seem to be much more intractable.
This result also contrasts with the recent studies on quantum computational complexity of Ising partition functions with imaginary coupling constants [2-5, 7, 67].These quantum algorithms calculate the Ising partition functions or, more generally, Jones or Tutte polynomials with additive error ò in polynomial time of  1 : where  and  ap are true and approximated values respectively, and Δ is a certain algorithmic scale.Furthermore, it has been shown that such an additive approximation is as powerful as solving BQP-complete problems (i.e., BQP-hard).This implies that these quantum algorithms do a nontrivial task that would be intractable on a classical computer.However, these quantum algorithms seem not to achieve an efficient multiplicative approximation, since it is #P-hard as shown above.

Conclusion and discussion
We have investigated IQP by relating it with computational complexity of Ising partition functions with imaginary coupling constants and magnetic fields.We found classes of IQP that are classically simulatable at least in the weak sense (and almost in the strong sense).Specifically, the IQP circuits consisting only of 2D nearest-neighbor two-qubit commuting gates, namely planar-IQP, are classically simulatable.However, if single-qubit rotations are allowed, planar-IQP becomes universal-under-postselection, which are as powerful, with the help of postselection, as PP.Thus single-qubit rotations make a drastic change of the IQP circuits from almost strongly simulatable to not simulatable even in the weak sense, which stems from hardness of the Ising models under magnetic fields.
The classical simulatability of planar-IQP stems from the exact solvability of Ising models on planar lattices without magnetic fields.Both classical computational complexity of Ising models on nonplanar lattices [32,73] and quantum computation complexity of MBQC on nonplanar surface codes [74] have been studied already.
While we did not addressed here, computational complexity of the IQP circuits consisting of two-qubit commuting gates with a nonplanar geometry is an intriguing future topic.
By considering strong simulation of IQP, we further explored hardness of a multiplicative approximation of the Ising partition functions.We have shown that a multiplicative approximation of Ising partition functions with almost all imaginary coupling constants is #P-hard even on planar lattices with a bounded-degree.
The results are relevant for the Ising models with imaginary parameters, which complements to the existing complexity results on those model with real parameters [32,33,62,72].The Ising models with real parameters are of prime importance in both computer science and physics.It would be intriguing to extrapolate the present results to the real parameters by using the correspondence between imaginary and real Ising partition functions shown in [7] (corollary 1), which allows us to compare preexisting classical complexity results with quantum one.

Figure 1 .
Figure 1.The summary of results obtained in this work.

j and p 8
correspond to Clifford and non-Clifford gates, respectively.Examples of graphs and weights of MBIQP that are universal-under-postselection are presented in figures 2(a) and (b).

Figure 2 . 4 j
Figure 2. (a) An example of a planar bipartite graph and weights for universal IQP, where q p p Î { } 0, 8, 4 j .(b) Another example of a planar bipartite graph and weights, where q p = 4 j

Figure 3 .
Figure 3. (a) The graph state ñ |G associated with the graph G.The gray and white circles indicate qubits associated with Î v V i A and Î u U j a set of edges whose two incident vertices both belong to È MAB (see figure3(a)).
1).Let us consider a merged graph GM that is constructed from the graph G M and its copy ¢ G M , and the boundary ¶M AB .Two copies of graph states, ñ |G M and ¢ ñ |G M , are merged via +ñ Ä ¶ | | | M AB as shown in figure 3(b).The vertices in ¶M AB and those in G M and ¢

Figure 4 .
Figure 4. Bipartite graph states (top) and associated commuting circuits (bottom).The white and gray shaded circles indicate qubits in U B and V A , respectively.(a) A graph that is independent and = | | | | V U

1 .
path , By doing this repeatedly for all pairs of = m 1 v i , i.e., a perfect matching of = m 1 v i vertices, we can transform all = m Let us define an arbitrary perfect matching  of vertices of = m 1 v i and a set  ( ) path of paths of the matching .By denoting the addition modulo two over ¢ u s j on all these paths by

Figure 5 .
Figure 5. (a) A planar lattice.(b) An associated bipartite graph state, where gray and white circles denote qubits in V A and U B , respectively.(c) A path between a pair of qubits in V A .(d) The corresponding commuting circuit.


that K k does not contain Z k .The postmeasurement state is stabilized by -¢ post-measurement state.(Note that B k m k anticommutes with ¢ K s i for all i but commutes with K i s with ¹ are arbitrary.For simplicity, we assume that G is connected.Let us consider properties of the graph state associated with such a planar bipartite graph G. j .
. Indeed, as mentioned before, if we apply the projection by +ñ Ä | j , we obtain an unnormalized planar surface code state consisting of the qubits on U B .The effect of = m 1 v i (i.e., the projection by + ñ | 1 [83]g an irrational number.Let m be an integer.Since np m 2 ( p mod 2 ) is distributed in a uniform fashion, we can find an approximation of p 8 with an additive error ò with some integer j in the sense of an appropriately defined distance such as the diamond norm[83].In the present case, the erroneous rotation  is unitary, and hence the diamond norm is equivalent to the square of the operator norm, which is given by j