Non-adaptive measurement-based quantum computation on IBM Q

We test the quantumness of IBM’s quantum computer IBM Quantum System One in Ehningen, Germany. We generate generalised n-qubit GHZ states and measure Bell inequalities to investigate the n-party entanglement of the GHZ states. The implemented Bell inequalities are derived from non-adaptive measurement-based quantum computation (NMQC), a type of quantum computing that links the successful computation of a non-linear function to the violation of a multipartite Bell-inequality. The goal is to compute a multivariate Boolean function that clearly differentiates non-local correlations from local hidden variables (LHVs). Since it has been shown that LHVs can only compute linear functions, whereas quantum correlations are capable of outputting every possible Boolean function it thus serves as an indicator of multipartite entanglement. Here, we compute various non-linear functions with NMQC on IBM’s quantum computer IBM Quantum System One and thereby demonstrate that the presented method can be used to characterize quantum devices. We find a violation for a maximum of seven qubits and compare our results to an existing implementation of NMQC using photons.


INTRODUCTION
Commercially available quantum computers (QCs) have arrived in the NISQ (noisy intermediate-scale quantum) era [1].Equipped with 10s to 100s of of noisy qubits, these devices already enable the implementation of quantum operations and thus basic quantum algorithms [2].Despite the lack of error correction, algorithms and techniques adapted to the strengths and shortcomings of the computers could facilitate non-classical computation within the near future.To compare the performance of the large range of different quantum devices and to find the best-suited QC for a specific problem, benchmarking, i.e., reproducibly measuring the performance of quantum devices, becomes especially important [3].
To be independent of the architecture and capture the complexity of quantum machines, benchmarking protocols go beyond comparing the various hardware characteristics [4,5].The goal is to find protocols that give maximal information about the performance of a quantum device [2].Examples for such hardware benchmarks are randomised benchmarking [6], cross-entropy benchmarks [7], or the quantum volume [4,8].Besides that, application benchmarks exist which test the performance of NISQ devices based on their execution of different applications or algorithms and help one to understand how good QCs can deal with different tasks [2,5].
In this work, we make use of a method called non-adaptive measurement-based quantum computation (NMQC) to characterise an IBM QC with 27 superconducting qubits.
The goal in NMQC is to compute a multivariate function.While local hidden variables (LHVs) can only output linear functions, quantum correlations can compute all Boolean functions.The success of such a computation can be related to the violation of a (generalised) Bell inequality and proves the advantage over classical resources [19].So far, binary NMQC has been implemented with four-photon GHZ states [20].Here, we use GHZ states on an IBM QC to implement NMQC with more than four qubits.This allows us to test the quantum correlations of the generated GHZ states and therefore the non-classicality of the respective IBM quantum computer.
In particular, we implement NMQC for one two-bit function, three three-bit functions, and one four-bit, one five-bit, and one six-bit function on the superconducting quantum computing system IBM Quantum System One (QSO) and demonstrate that it exhibits multipartite entanglement.For qubit numbers lower or equal to five, we utilise quantum readout error mitigation [21] to reduce noise from local measurement errors.For higher qubit numbers, we utilise the error mitigation tools provided by Qiskit [22].We demonstrate violations of the associated Bell inequalities for up to seven qubits, which indicates the non-classical properties of the quantum computing system.

A. NMQC
First, let us briefly describe the general idea of NMQC (for a detailed overview over the procedure see Fig. 1 and, e.g.Refs.[19,23]): Starting from a classical n-bit input string x = (x 0 , x 1 , . . ., x n−1 ) ∈ {0, 1} n , which is sampled from a probability distribution ξ(x), the goal is to compute any multivariate Boolean function f : {0, 1} n → {0, 1}.For this, one has access to a restricted classical computer limited to addition mod 2, which can be used for classical pre-and post-processing (see Fig. 1).The core of NMQC is embodied by non-adaptive measurements on an l-qubit resource state, with l ≤ n.It has been shown that if the measurement statistics are described by local hidden variables (LHVs) [24], i.e. one uses a classical resource state, the output of NMQC is restricted to linear functions.As the pre-processor is already capable of outputting linear functions LHVs thus do not "boost" the pre-processor's computational power [19].
In contrast, non-local quantum correlations, can elevate the pre-processor to classical universality.The generalised l-qubit GHZ state enables the computation of all functions f : {0, 1} n → {0, 1} with at most l = 2 n − 1 qubits.The computation of a non-linear function requires non-locality [25] and can be seen as a type of GHZ paradox [19].Thus, the successful execution of NMQC demonstrates non-locality.Note that in our case the non-locality is realised by single-qubit measurements on an multipartite entangled state and we can use the two terms non-locality and multipartite entanglement interchangeably.
In general, it can be shown that the average success probability pS = p(z = f (x)), i.e. the probability that the output z is identical to the value of the target function f (x), is related to a normalised Bell inequality β with a classical (LHV) bound β c and a quantum bound β q [19]: The expectation values are defined: where p(z = k|x) is the probability that z is equal to k for the input x.
It has been shown that the GHZ state always maximally violates the given Bell inequalities and minimises the number of required qubits for a violation [26,27].It is thus optimal for NMQC [19] and we will use it as a resource in the following investigations on IBM QSO.

B. Tested Functions and Bell inequalities
The NMQC computations for the four-qubit GHZ state presented in this work result from the two-variate function: and the three three-variate functions: where ∨ is the logical OR operator and ⊕ denotes addition mod 2. Note that the same functions have been used to implement NMQC using a four-photon GHZ state in Ref. [20].
In the case of the two-bit function NAND 2 (x), we use a uniform probability distribution ξ(x) = 1  4 , which yields the Bell inequality [see Eq. ( 2)]: This restricted computation can be seen as a matrix vector multiplication: s = (P x)⊕, where P is an l-by-n binary matrix and ⊕ denotes that the matrix vector product is evaluated w.r.t.mod 2 operations.Each bit si = 0, 1 in s now determines the settings for the measurement on the ith qubit of the l-qubit resource state.For each subsystem, there are two measurement operators mi(si), one can choose from (here mi(0) ≡ X and mi(1) ≡ Y , with X and Y denoting the Pauli operators).Each measurement yields one of two possible measurement results Mi ∈ {−1, 1}, which can be mapped to bits mi ∈ {0, 1}: Mi = (−1) m i .The measurements are performed on a correlated l-qubit resource and the measurement results mi ∈ {0, 1} are summed up by the parity computer: z ≡ i mi.Finally, if z = f (x) for this input x, the computation was successful.Note that if z = f (x) for every x, we say that an NMQC scheme is deterministic.The figure has been adapted from [23].
The relation between the measurement settings and the measurements, i.e., mi (s i ) = X/Y for s i = 0/1 (i ∈ {0, 1, 2, 3}) allows us to rewrite the Bell inequality (8) in terms of the four measurements: where we additionally made use of the following relation between measurement settings and the input bits x i : In the same manner one finds the Bell inequalities for the three three-variate functions given in Eqns.(5-7) [20].The inequalities and the respective pre-processing implemented in Sec.IV are shown in Table I.
To perform NMQC for five-to seven-qubit GHZ states we use the generalisation of h 3 (x), namely h k (x), for k = 4, 5 and 6: For any k the sampling distribution is uniform, i.e. ξ(x) = 1/2 k , and the pre-processing is given by: The Bell inequality induced by h k (x) and defined by the pre-processing (12) and the uniform sampling distribution has the quantum bound q = 1.This can be seen by explicitly computing all expectation values.The classical bounds can either be found numerically or inferred from the connection between NMQC and classical Reed-Muller error-correcting codes, as pointed out in [28].They are equal to c = 2 2 ) for odd k.We elaborate on this in Appendix B and further show that in order to compute the k-bit function h k (x) with NMQC, one only requires k + 1 qubits.

III. NMQC ON IBM QUANTUM SYSTEM ONE
IBM QSO in Ehningen, Germany, is a 27-qubit QC, which we used to run NMQC for up to seven qubits.Testing a possible violation of Bell inequalities for different qubit configurations of the QC allows for a characterisation of the whole QC or a subset of qubits.
The QC's architecture is shown in Fig. 2, where each qubit (vertex) is marked by its physical qubit number and edges denote physical connections between qubits.Here, physical connection means that two qubits are directly coupled, which allows for a direct implementation of twoqubit gates between those qubits.In the following, when mentioning the physical qubit numbers, we refer to the numbering depicted in Fig. 2. At the time of the experiment, the quantum computer contained a Falcon r5.11 processor and its backend version was 3.1.9.
We perform two experiments on IBM QSO: (i) In Sec.IV A, the physical qubits are chosen by Qiskit and the quantum circuit is optimised by Qiskit, and (ii) in Sec.IV B the physical qubits are chosen manually and the quantum circuit is optimised by our own method (see Sec. III A).In both experiments the goal is to generate generalised GHZ states [see Eqn.(1)] as a resource to perform NMQC.
While in (i) we only test a single configuration, i.e. the one chosen by Qiskit, in (ii) we generate and test every possible l-qubit configuration, where l is the number of qubits.By "qubit configuration", we mean the collection of l physical qubits that are physically connected in the quantum computer (see Fig. 2).For each tested Bell inequality in (ii) we then average over all measured bounds for the distinct distributions to determine the measured bound of the whole QC.
In the second experiment (see Sec. IV B), where we average over all possible qubit configurations, the qubit onto which the Hadamard gate acts is the one with the largest numbers of neighbours in the configuration and the one with the smallest readout-error rate.The readout-error rates are obtained form the backend's calibration data which is updated before every NMQC run.If the calibration data changed during an NMQC run, the measured data was discarded and the run repeated.The CNOT gates are arranged in such a way that as many as possible of them can be carried out simultaneously, which minimises the circuit depth [18].Note that CNOT gates are only applied between physically connected qubits.

B. Error mitigation
We post-process the measured data for up to five qubits, using the quantum readout error mitigation (QREM) [21].This method has been used, for example, in [18], where it has led to considerable improvements in 3. Theoretical scheme for the creation of a GHZ state.First a Hadamard (H) is applied on the virtual qubit q0.Then n − 1 CNOT gates are carried out between the qubits qi (control) and qi+1 (target), where i runs from i = 0 to i = n − 1.
the fidelity of a generated multi-qubit GHZ state.It aims at mitigating readout errors, which are errors during the measurement of the state of a single qubit and the main assumption is that these measurement errors are local.We explain the details in Appendix A.
To improve the results for NMQC using six and seven qubits, QREM seems to be insufficient.In fact, we observed a negative effect on the measured bounds and thus switch to the measurement error mitigation (MEM) provided by Qiskit [22].In contrast to QREM Qiskit's MEM does not assume measurement errors to be local but global.This means that instead of n 2 × 2 calibration matrices A i one needs to determine a single 2 n × 2 n calibration matrix A by preparing and measuring all 2 n basis states.

IV. RESULTS
Here, we present the average values for the violations of the associated Bell inequalities of NMQC listed above.We start with the first experiment, in which the physical qubits are chosen by Qiskit (Sec.IV A).There, the circuits for NMQC were all transpiled using the option "optimisation level 3", i.e. heavy optimisation including noise-adaptive qubit mapping and gate cancellation [22].We differentiate between two sub-experiments: one, where the circuits were transpiled using the option "layout method=dense", which chooses the most connected subset of qubits with the lowest noise and one, where the circuits were transpiled using the option "layout method=noise adaptive", which tries to map the virtual to physical qubits in a manner that reduces the noise [22].
In the second experiment we choose the qubits manually (Sec.IV B), testing all possible qubit configurations to generate the n-qubit GHZ states and perform NMQC.II.

A. Transpilation optimisation level 3
Fig. 4 shows the measured bounds of the Bell inequalities for optimisation level 3 and two different layout methods.Each Bell inequality was tested in 70 separate runs, where in each run every circuit, induced by the respective function, has been executed 1000 times, i.e. 1000 runs.One can see that for both methods all measured values, except for h 6 (x), i.e. seven qubits, are above the classical bounds which translates to a quantum advantage in the associated NMQC games, even when taking into consideration the standard deviations determined from the 70 runs.This, in turn, means that the quantum average success probability of the probabilistic NMQC games is higher than the LHV one, indicating multipartite entanglement.For this experiment one can say that the performance of both methods "dense" and "noise adaptive" provided by Qiskit was similar.

B. Transpilation optimisation level 0 and error mitigation
Fig. 5 (a) shows the measured bounds of the Bell inequalities averaged over all possible qubit configurations for four (OR 3 (x), OR ⊕ 3 (x), NAND 2 (x) and h 3 (x)), five (h 4 (x)), six (h 5 (x)), and seven (h 6 (x)) qubits and the mitigated bounds improved by error correction.The error correction techniques applied are QREM (four and five qubits) and Qiskit's integrated MEM (six and seven qubits) (see Sec. III B).For every qubit configuration there is exactly one NMQC run with 1000 shots per circuit [29].In Fig. 5 (b) we show the measured bounds of the qubit configuration, which produced the highest violation (exact values and the physical qubit numbers are shown in Table II).
One can see from the plots and the data [see Fig.   II] that not only the configurations, which produced the highest values, but also the averaged results are significantly higher than the classical bounds of the respective Bell inequalities for any tested function and number of qubits.Especially for more than three qubits the averaged values are higher than in the case of letting Qiskit choose the qubit configuration (see Sec. IV A).In the case of the single configurations one should keep in mind that these results only express a single run (see Appendix C).
The presented error margins correspond to the 99% confidence intervals of the measured values with respect to 1000 bootstrapped samples for each function except for h 6 (x), where we used 100 bootstrapped samples.We chose bootstrapping [30] instead of sampling at different moments in time as the performance of the quantum processor varied considerably.Due to the heavy bias introduced by the optimization procedure used in error mitigation, we omitted error margins as statistical errors are not a meaningful measure in this situation.

C. Comparison to Photonic NMQC
In Ref. [20] binary NMQC has been implemented using four-photon GHZ states, testing the functions OR 3 (x), OR ⊕ 3 (x), NAND 2 (x) and h 3 (x).Here, we compare our results using IBM QSO to the photonic results.
In Fig. 6 a) we show the measured bounds from the photonic experiments and the respective standard deviations.For a better comparison, we calculate the difference between these values and the results presented in Sec.IV B, with and without error mitigation, i.e. ∆β meas/max = β meas/max (photons)−β meas/max (QSO) and ∆β corr meas/max = β corr meas/max (photons) − β corr meas/max (QSO).In Fig. 6 b) we plot the difference to the measured bounds averaged over all qubit configurations (see Fig. 5 a)) and in Fig. 6 c) we plot the difference to the measured bounds of the qubit configuration which produced the highest values (see Fig. 5 b)).
We find that the photonic values are higher than the  II.uncorrected results using IBM QSO comparing to both the averaged bounds and the highest bounds (except ∆β max for OR 3 ).Using error mitigation the averaged values come closer to the photonic results but only exceed them in the case of OR 3 .Only when applying error mitigation to the highest values produced by a single qubit configuration the photonic results are exceeded for every function.Additionally, one has to take into account that the values measured on IBM QSO strongly vary depending on the configuration and the time of execution (see Appendix C).The possibility to go to larger numbers of qubits remains a big advantage of IBM QSO.

V. CONCLUSION AND OUTLOOK
On average, we have reached violations of all measured Bell inequalities for all tested functions listed in section II B on the 27-qubit IBM QSO in Ehningen, Germany.In the cases where Qiskit has chosen exactely one configuration of physical qubits for every experiment violations have been measured for all functions for up to six qubits.In contrast, in the cases where we have tested all possible l-qubit configurations, l being the required number of qubits, and averaged over all results, the averaged measured bounds clearly violate the tested Bell inequalities (with and without error mitigation) for up to seven qubits.Since we have not only investigated a single qubit configuration, but averaged over all possible configurations, we have thereby tested the quantumness of the device.This means that we have demonstrated a shows the difference to the averaged measured bounds.Without error mitigation the photonic values are always larger and ∆βmeas is positive.With error mitigation the differences become smaller, but only for OR3 the mitigated result exceeds the photonic value.(c) shows the difference to the highest values produced by a single configuration.Even without error mitigation the differences ∆βmax are small, however only for OR3 the photonic value is smaller and ∆βmax becomes negative.With error mitigation the results produced by QSO exceed the photonic values and ∆β corr max is always negative.
computational advantage in terms of NMQC using the device IBM QSO and thus its non-local behaviour for up to seven qubits.Further we have compared our results using four qubits to an existing implementation of NMQC using four-photon GHZ states [20].
To improve the results and carry out NMQC for h k (x) for k > 7 one could apply more sophisticated error mitigation/correction techniques [18].It would also be interesting to find other functions that translate to convenient Bell inequalities to test the non-classicality of quantum computers using this computational test.For this one could use the relation between NMQC and Reed-Muller codes hinted at in Sec.II B. However, as the performance of the qubits varies widely over time it should definitely be taken into account in order to obtain larger GHZ state fidelities and thus better results.It is likely that in the future, more sophisticated qubit mapping methods will be developed, such as [31], which in combination with error mitigation and error correction methods could facilitate NMQC with large numbers of qubits.
Another possibility to reduce errors and noise in the generation of the GHZ states could be to minimise the depth of the quantum circuit.In [32] a method has been discussed in which GHZ states of arbitrary size can be generated with constant circuit depth.Although additional ancilla qubits are needed here the advantage gained from the constant circuit depth would presumably beat possible problems caused by the increased number of qubits.From the generation of linear graph states on IBM QCs, which also has a constant depth, it is known that entangled states of much larger size can be generated [14,16].
In conclusion, we have implemented NMQC for up to seven qubits using a 27-qubit IBM QC.We have shown that the calculation of non-linear Boolean functions and the simultaneous violation of multipartite Bell inequalities can be used to characterise quantum devices.This method can easily be extended to different quantum computing systems with qubits but also to higherdimensional systems [23].

)FIG. 1 .
FIG.1.The figure shows the general scheme of NMQC.At the beginning, an input string x ∈ {0, 1} n is sent to the parity computer, which in turn computes the bit string s ∈ {0, 1} l .This restricted computation can be seen as a matrix vector multiplication: s = (P x)⊕, where P is an l-by-n binary matrix and ⊕ denotes that the matrix vector product is evaluated w.r.t.mod 2 operations.Each bit si = 0, 1 in s now determines the settings for the measurement on the ith qubit of the l-qubit resource state.For each subsystem, there are two measurement operators mi(si), one can choose from (here mi(0) ≡ X and mi(1) ≡ Y , with X and Y denoting the Pauli operators).Each measurement yields one of two possible measurement results Mi ∈ {−1, 1}, which can be mapped to bits mi ∈ {0, 1}: Mi = (−1) m i .The measurements are performed on a correlated l-qubit resource and the measurement results mi ∈ {0, 1} are summed up by the parity computer: z ≡ i mi.Finally, if z = f (x) for this input x, the computation was successful.Note that if z = f (x) for every x, we say that an NMQC scheme is deterministic.The figure has been adapted from[23].

FIG. 2 .
FIG. 2. Architecture of IBM Quantum System One for different examples of l-qubit configurations.The nodes indicate qubits, marked by the physical qubit numbers and the edges denote which ones are physically connected.The qubit configurations are marked in red and the respective qubits are labelled by Q k , where k is the physical qubit number.(a) 4-qubit configuration 0-1-2-4.(b) 6-qubit configuration 8-9-11-14-16-19.
Rows 3-5 show the resulting prefactors of the different measurement results in the Bell inequalities.The classical (quantum) bound βc (βq) of each Bell inequality are presented in the two separate columns on the right.

FIG. 4 .
FIG.4.Measured bounds of the Bell inequalities, averaged over 70 runs with 1000 shots per circuit, induced by the functions OR3(x), OR ⊕ 3 (x), NAND2(x) and h k (x) for 3 ≤ k ≤ 6 and their standard deviations for (a) optimisation level 3 and the "dense" layout method and (b) optimisation level 3 and the "noise adaptive" layout method.The red (diagonally striped \\)/grey (dotted) bars denote the theoretically achievable quantum/classical bounds and the white (diagonally striped //) bars stand for the measured values.The exact values for all measured bounds are listed in TableII.

5
Fig.5(a) shows the measured bounds of the Bell inequalities averaged over all possible qubit configurations for four (OR 3 (x), OR ⊕ 3 (x), NAND 2 (x) and h 3 (x)), five (h 4 (x)), six (h 5 (x)), and seven (h 6 (x)) qubits and the mitigated bounds improved by error correction.The error correction techniques applied are QREM (four and five qubits) and Qiskit's integrated MEM (six and seven qubits) (see Sec. III B).For every qubit configuration there is exactly one NMQC run with 1000 shots per circuit[29].In Fig.5(b) we show the measured bounds of the qubit configuration, which produced the highest violation (exact values and the physical qubit numbers are shown in TableII).One can see from the plots and the data [see Fig. 5(a) and (b) and TableII] that not only the configurations, which produced the highest values, but also the Fig.5(a) shows the measured bounds of the Bell inequalities averaged over all possible qubit configurations for four (OR 3 (x), OR ⊕ 3 (x), NAND 2 (x) and h 3 (x)), five (h 4 (x)), six (h 5 (x)), and seven (h 6 (x)) qubits and the mitigated bounds improved by error correction.The error correction techniques applied are QREM (four and five qubits) and Qiskit's integrated MEM (six and seven qubits) (see Sec. III B).For every qubit configuration there is exactly one NMQC run with 1000 shots per circuit[29].In Fig.5(b) we show the measured bounds of the qubit configuration, which produced the highest violation (exact values and the physical qubit numbers are shown in TableII).One can see from the plots and the data [see Fig. 5(a) and (b) and TableII] that not only the configurations, which produced the highest values, but also the

FIG. 5 .
FIG. 5. (a) Measured average bounds of the Bell inequalities induced by the functions OR3(x), OR ⊕ 3 (x), NAND2(x) and h k (x) for 3 ≤ k ≤ 6 and their standard deviations for optimisation level 0 and the mitigated bounds.The red (diagonally striped \\)/grey (dotted) bars denote the theoretically achievable quantum/classical bounds and the white (diagonally striped //) bars stand for the measured values.The orange (plain) bars denote mitigated bounds.(b) Measured and mitigated bounds of the qubit configuration which produced the highest values, induced by the same functions for optimisation level 0. The exact values for all measured bounds as well as the qubit configurations are listed in TableII.

FIG. 6 .
FIG.6.(a) Measured average bounds of the Bell inequalities induced by the functions OR3(x), OR ⊕ 3 (x), NAND2(x) and h3(x) and their standard deviations for a photonic implementation of NMQC using four-photon GHZ states[20].The red (diagonally striped \\)/grey (dotted) bars denote the theoretically achievable quantum/classical bounds and the white (diagonally striped //) bars stand for the measured values.(b) and (c) Difference between the photonic results and the results presented in Sec.IV B, with and without error mitigation, i.e. ∆β meas/max = β meas/max (photons) − β meas/max (QSO) (white (diagonally striped //) bars) and ∆β corr meas/max = β corr meas/max (photons) − β corr meas/max (QSO) (orange (plain) bars).(b) shows the difference to the averaged measured bounds.Without error mitigation the photonic values are always larger and ∆βmeas is positive.With error mitigation the differences become smaller, but only for OR3 the mitigated result exceeds the photonic value.(c) shows the difference to the highest values produced by a single configuration.Even without error mitigation the differences ∆βmax are small, however only for OR3 the photonic value is smaller and ∆βmax becomes negative.With error mitigation the results produced by QSO exceed the photonic values and ∆β corr max is always negative.

FIG. 7 .
FIG. 7. (Mitigated) measured bounds of the Bell inequality for every qubit configuration induced by the functions OR 3 (x).

associated Bell inequality for h 3 FIG. 8 .
FIG. 8. (Mitigated) measured bounds of the Bell inequality for every qubit configuration induced by the functions h3(x).

TABLE I .
Bell inequalities for the three three-variate functions OR3(x), OR ⊕ 3 (x) and h3(x) given in Eqns.