Improved FRQI on superconducting processors and its restrictions in the NISQ era

In image processing, the amount of data to be processed grows rapidly, in particular when dealing with images of more than two dimensions or time series of images. Thus, efficient processing is a challenge, as data sizes may push even supercomputers to their limits. Quantum image processing promises to encode images with logarithmically less qubits than classical pixels in the image. In theory, this is a huge progress, but so far not many experiments have been conducted in practice, in particular on real backends. Often, the precise conversion of classical data to quantum states, the exact implementation, and the interpretation of the measurements in the classical context are challenging. We investigate these practical questions in this paper. In particular, we study the feasibility of the flexible representation of quantum images (FRQI). Furthermore, we check experimentally the limit in the current noisy intermediate-scale quantum era, i.e., up to which image size an image can be encoded, both on simulators and on real backends. Finally, we propose a method for simplifying the circuits needed for the FRQI. With our alteration, the number of gates can be reduced, especially the one of the error-prone controlled-NOT gates. As a consequence, the size of manageable images increases.


Introduction
With the help of increasingly powerful supercomputers, we are nowadays able to solve image processing problems that have been unsolvable just a few years ago.Especially in artificial intelligence and machine learning, higher computing power and the rise of deep convolutional neural networks recently enabled a leap forward.For some problems, often referred to as NP-hard problems, an exact solution using classical computers is not possible.Some of these NP-hard problems, however, can be solved efficiently on quantum computers, such as the integer factorization or discrete logarithm problem [1].One goal of research in the area of quantum computing is to demonstrate quantum supremacy, that is, to show the superiority of a quantum computer over classical supercomputers for solving a complex problem [2,3].
In image processing, it has become increasingly important to process very large images, e.g.images bigger than one gigabyte, efficiently.A classical solution for this is to apply algorithms to a sub-division of the image and to subsequently merge the results.To avoid such splitting of the data and the associated edge effects, the transfer of the problem to the quantum world is promising.
In general, quantum image processing consists of three parts: quantum image representation, quantum image processing algorithms, and quantum image measurement.In classical image processing, the focus is on the actual algorithm and its efficiency.In quantum image processing, it is of highest priority to convert classical images into quantum states.For this step, there is a variety of algorithms including the Qubit Lattice [4], the Real Ket quantum image representation [5], and the Flexible Representation of Quantum Images (FRQI) [6].These three methods are considered to be the fundamental image representation options and serve as basic building blocks of many algorithms and starting points for other quantum image representations, see e.g.[7,8,9,10].
In this paper, we take a closer look at FRQI.Often this method is only described in theory and not explicitly applied on real backends.Mostly, only the minimal image size of 2 × 2 pixels is considered.Here, we show how larger images can be implemented.Furthermore, we explore the current limitations in the noisy intermediate-scale quantum (NISQ) era, in which the results of the quantum computer are affected by noise.On a circuit-based superconducting quantum computer of IBM [11], we investigate up to which size an image can currently (August 2021) be encoded and measured.We increase the possible image size by improving the implementation of Qiskit [12] based on an idea that is also beneficial for other image representations and algorithms.This paper is organized as follows.In Section 2, we first explain the encoding of classical data into quantum states using the FRQI implementation.A naive implementation together with two pre-processing approaches is presented in Section 3. Additionally, we explain two approaches for recovering the classical data from the empirical probabilities of the quantum computing results.In Section 4, we introduce an alternative to the naive implementation which has advantages especially for larger images.In Section 5, we propose a way to extend both implementations to larger images.In Section 6, we present the experimental setup for evaluating the accuracy of the implementation on actual quantum computers.The results and the current maximum possible image size are discussed in Section 7. Section 8 concludes the paper.

FRQI image representation
For representing a 2 n × 2 n pixel gray value image, just 2n + 1 qubits are needed -2n qubits for the position and one qubit for the gray value information of the pixels.In the basis states, each qubit is in a two-dimensional state, either |0 or |1 .A combination of 2n qubits via the tensor product ⊗ yields 2 2n -dimensional computational basis states |i for the position information.For simplicity, the basis states |i are named by the decimal number i corresponding to the vector of zeros and ones read as binary number.
The gray value information of the pixels is encoded by where θ = (θ 0 , θ 1 , . . ., θ 2 2n −1 ) is a vector of angles encoding the gray values of each pixel.Section 3.1 provides more details on how to convert gray values into angles.In total, the two states for position and gray value information of every pixel are converted into the FRQI state by the formula Figure 1 shows a 2 × 2 sample gray value image and its FRQI state.
In quantum computing, the qubits are usually initialized in well-prepared states.In Qiskit [12], the |0 state is the initial one for all qubits.Thus, the initial state of a quantum circuit for FRQI is |0 ⊗2n+1 .To convert this initial state into the FRQI state from Equation (2), we apply single-and multi-qubit gates.The polynomial preparation theorem [6] shows, that the desired FRQI state can be constructed efficiently in two steps.First, all 2n position qubits have to be superposed to cover all 2 2n pixels in the classical image.This is achieved by using 2n Hadamard (H) gates in parallel for the position qubits.That is, we apply the tensor product I ⊗ H ⊗2n to the initial state  In the second step, controlled rotation gates are applied where Here, •| represents the adjoint of |• and |• •| is the outer product.The first part of Equation ( 5) describes the control qubits and the second part the rotation using the R y -gate [13] defined as Each multi-controlled operation, like the controlled rotation above, can be decomposed into single-qubit and two-qubit operations [13].This allows us to implement such operations on quantum computers.On these, all operations have to be transformed into basis gates, which for IBM's backends are currently identity (I), NOT (X), square-root NOT (SX), rotation (R z ), and controlled-NOT (CX) gates [11].Typically, an operation can be decomposed in several ways.The decomposition chosen is decisive for the number of gates required and the resulting noise level.
3 Practical implementation of FRQI Alternatively, we follow [14] and use the transformation to get angles in the required interval 0, π 2 .Of course, the arcsin in Equation ( 8) can also be replaced by an arccos to achieve angles in the required range.

MCRY-implementation
Independent of the two transformation variants, the multi-controlled rotation gates from Equation ( 5) must be converted into gates, which are executable on a real quantum computer.In Qiskit, the Multi-Controlled Y rotation gates (MCRY) are converted by some standard routines of Qiskit [12].The MCRY-gates only apply a rotation to the gray value qubit if all position qubits are in state |1 .Subsequently, the result of the rotation has to be transferred to the correct position qubit state by application of X-gates.This allows to encode the next pixel using state |1 of all position qubits.≡ (a) MCRY-gate for an arbitrary angle γi = 2θi and its decomposition into CX-and CU-gates.The CU-gates must be converted further into the basis gates.In total, 8 CX-, 12 SX-, and 12 Rz-gates are needed for one MCRY-gate without considering the coupling map (the number of CX-gates may increase due to additional SWAP-gates).
(b) Circuit for an arbitrary 2 × 2 gray value image using the MCRY-implementation.The pixel values are converted into angles θi for i ∈ {0, 1, 2, 3}.Hadamard gates are used for superposition, X-gates for rotation to the desired state.There is one MCRY-gate for each pixel value.One MCRY-gate is applied per input pixel.An example for a decomposition of one MCRY-gate with an arbitrary angle γ i = 2θ i is shown in Figure 2a.Here, the 2 is needed as prefactor in Equation ( 6) to get the sine and cosine terms required in Equation ( 1).
A MCRY-gate is decomposed into two CX-gates and three controlled-U-gates (CU).The latter have to be converted into basis gates available on the real backends.That is, 2 CX-, 4 SX-and 4 R z -gates per CU-gate.Thus the number of gates, especially CX-gates, increases further (8 CX-, 12 SX-, and 12 R z -gates for one MCRY-gate).The circuit for an arbitrary 2 × 2 example using MCRY-gates is visualized in Figure 2b.Note that in the graphical representation of gates and circuits, the top or gray value qubit is always the target qubit.The remaining qubits are controls.In this implementation, the number of CX-gates is high and requires the entanglement of all qubits.This means that we have to insert SWAP-gates for missing connections on the real backends.

Post-processing: Converting probabilities to gray values
The state of the quantum computer after running the above circuit cannot be determined exactly.By a measurement, frequencies of the possible states are observed.The classical representation of the output image then has to be determined from the thus derived empirical probability distribution.
Consider a state i = c ⊗ j, where c represents the state of the gray value qubit and j the state of the position qubits.Let p j|c=|0 the conditional probability of observing state j given that the gray value qubit is in state |0 .Analogously, p j|c=|1 is the conditional probability of observing j with gray value qubit in |1 .The output pixel value can be determined by for the linear conversion as given in Equation (7).The probabilities for the states with gray value qubit in state |0 are considered and normalized with the sum of the probabilities with gray value qubit in state |0 and |1 for each possible state.This ensures that the quotient in the first part of Equation ( 9) is in [0, 1] and the pixel values in the gray value range [0, 255].According to Equation (1), arccos is applied and the pixel values are retrieved by inverting Equation (7).
In the second approach, by definition, we only need to consider the states where the gray value qubit is in state |1 for retrieving the image.The output pixel values v out,i are given by  Obviously, states with gray value qubit in state |0 are not considered in Equation (10).Instead, the general weighting factor 2 n is used.When using a small numbers of measurements/shots and in the presence of noise, there is no way to ensure that p j|c=|0 + p j|c=|1 = 1/2 2n for j ∈ {0, 2 2n − 1}.This can lead to incorrectly weighted states and result in pixel values that are not in the gray value range [0, 255].Therefore, this approach is only useful if high number of measurements/shots can be performed.
Due to these problems, we choose the first approach and apply the linear transformation.

Modification of the MCRY-implementation: MARY-implementation
A more efficient method to implement the FRQI state for a 2 × 2 image is inspired by [14].The basic structure as well as the X-and Hadamard gates remain unchanged.However, instead of MCRY-gates we use MARY-gates for a part of the decomposition, leaving only CX-gates or single-qubit Y rotation gates in the implementation.Figure 3a shows a MARY-gate with an arbitrary angle γ i = 2θ i , which is decomposed into four R y -gates and four CX-gates.The R y -gates are further decomposed into SX-and R z -gates, but the number of CX-gates stays unchanged.
This way the number of error-prone CX-gates is halved in comparison to the MCRY-implementation.Furthermore, the CX-gates act only on mixed pairs of a gray value and a position qubit but not pairs of position qubits anymore.Consequently, not all three qubits have to be pairwise connected.Thus, the SWAP-gates required in the MCRYimplementation are avoided here.Figure 3b shows the circuit for an arbitrary 2 × 2 sample image.We only need to replace the MCRY-by MARY-gates.

Extension to larger images
For larger images, the difference between the two implementations is more pronounced.In both cases, the position qubits must be entangled with the gray value qubit.In the MCRY-implementation, only the additional position qubits are added to the Qiskit MCRY-gate as control qubits.The decomposition of these multi-controlled rotation gates is left to the transpilation step and does not have to be adapted by the user.The effort to adapt the implementation to another image size is therefore very low.However, the required number of CX-gates is very large, which increases the error rate, circuit depth, and execution time.To reduce the number of CX-gates, we adapt the MARY-implementation for the larger images.We have to entangle the additionally required position qubits with the gray value qubit.Similar to [14], we also use RCCX-or RCCCX-gates [15,16] to entangle three or four qubits, respectively.These simplified versions of the naively implemented Toffoli gate or multi-controlled X-gate with three control qubits have the advantage of reducing the number of CX-gates compared to the direct use of multi-controlled CX-gates, see Figure 4. Hence, we only need 3 or 6 CX-gates instead of 6 or 14, respectively.Note that the simplified versions of the gates have a different relative phase, so the elements in the matrix representation differ by a factor of e iπφ , φ ∈ R [16].Due to global phase invariance, this does not affect the results.
The main idea in constructing the circuits for larger images is to keep the operations on the gray value qubit the same as in [14] for all sizes, using X-gates to change the desired state and entangle the position qubits with the gray value qubit.
We can entangle two qubits with a CX-gate, three qubits with an RCCX-gate and four qubits with an RCCCX-gate.We have to combine these gates to entangle the 2n position qubits with the gray value qubit for a 2 n × 2 n pixel gray value image.For that we have two ways: enlarging the MARY-gates by replacing CX-gates with RCCX-, or RCCCX-gates or entangling the qubits before the MARY-gate and applying the corresponding gates symmetrically after the MARY-gate.
In practice, one of the approaches or a combination of both are chosen depending on the image size.
Enlarging the MARY-gate allows to entangle a maximum of ten qubits using RCCCX-gates.An example of a MARY8gate which entangles eight qubits is shown in Figure 5.For images smaller than 32 × 32, we can just increase the MARY-gate and keep the original workflow.However, for larger images, we have to both enlarge the MARY-gate and entangle outside the MARY-gate.Figure 6 shows this combined way for a 64 × 64 pixel gray value image.We entangle the position qubits before and symmetrically after the MARY8-gate.With the use of one ancilla qubit and one RCCX-gate, we can further combine the information from two position qubits.Using X-gates prepares the position qubits to receive information from other position qubits.This is achieved by two RCCCX-gates.Analogously, more RCCX-and RCCCX-gates can be used to encode images of other sizes.
Examples of possible circuits for image sizes 2 n × 2 n , with n = 1, . . ., 9, 13, are shown in the supplementary information in Section 10.This way, encoding of images of size 8.192 × 8.192 is conceivable by using one gray value qubit, three ancilla, and 26 position qubits as visualized in the supplementary information in Figure 18i.The ancilla qubits serve only as storage qubits for entangled position qubits.

Quantum computing environment used
Here, we describe our framework for realizing the methods from the previous section.It includes software, a classical computer, a quantum computer, and error models.
We use the open-source software development kit Qiskit [12] for working with IBM's circuit-based superconducting quantum computers [11].Via cloud access, they provide a variety of systems, also known as backends, which differ in the number and performance of the qubits and their connectivity.In this paper, we use the backends 'ibmqx2',  'ibmq_16_melbourne', 'ibmq_santiago', 'ibmq_manila', 'ibmq_toronto', and the German backend 'ibmq_ehningen'.
The corresponding coupling maps are shown in Figure 7.
The backends underlie external influences, so the values of the backends, like CX error, readout error, or decoherence times, can change hourly.Calibration should diminish this effect, errors are however averaged over 24 hours.Typical average values for CX error, readout error, decoherence times T1, T2, and frequency are shown in Table 1.
Currently, all IBM quantum computers are affected by the errors just addressed.Measurement error mitigation is a way to reduce the errors, especially the readout error, and to improve the results [17].The idea is to prepare all 2 n basis input states, execute them on the 'qasm_simulator' with an error model, and to compute the probability of measuring basis states differing from the true input.Based on this, a backend specific calibration matrix is calculated which compares the desired and the measured states.Applying the inverse of this calibration matrix finally yields the improved results.
Two error models are used in the following.The Pauli error is applied to the measurement of the 'qasm_simulator'.It consists in randomly flipping each bit in the output with a probability p meas .In contrast, the depolarizing error model captures imperfections in operations.While processing, the state of any qubit is replaced by a completely random state  with a probability of p gate .For two qubit gates, like CX-gates, the depolarizing error is applied independently to each qubit.For further details on these two error models and measurement error mitigation in general we refer to [17].
In addition to quantum computers, a classical computer is needed for testing algorithms, reducing errors, and generating and storing the circuits before sending them to the quantum computer.The latter is the main limitation as circuits for encoding larger images need a lot of gates and have to be stored completely in the RAM.We use a computer with an Intel Xeon E5-2670 processor running at 2.60 GHz, a total RAM of 64 GB, and Red Hat Enterprise Linux 7.9.
7 Results and comparison of MCRY-and MARY-implementations Our aim is to encode a classical image into a quantum state, measure the outcome, and compare the result with the classical input image.
We set the pixel values of the input image image in,i , i ∈ {0, 1, 2, 3}, to [10,85,170,255] to cover the whole gray value range.We start at pixel value 10, since 0 is not generally interesting as only identity gates are needed for encoding it.We measure deviation by the relative difference:  for a general image size of 2 n × 2 n .The term image out is the resulting image reconstructed from the measurements of the quantum computer, as described in Section 3.3.To compare the implementations, we ran the two circuits in one job on five different backends.This ensures that the same calibration is used for the two implementations and that differences in the outcome are not due to varying error rates or coherence times.Box plots for 42 executions between June 7 and June 14, 2021 are shown in Figure 8.
Obviously, the MARY-implementations perform better than those with the MCRY-gates.This is due to the lower circuit depth (see Figure 9), especially the lower number of CX-gates (see Figure 10).
Differences between the five backends are clearly visible, too.Backend 'ibmqx2' has three fully-connected qubits and (like 'ibmq_16_melbourne') no heavy-hexagonal topology (see Figure 7).This yields the lower variance of the outcomes for this backend.This is even more apparent for the MCRY-implementation, where we can benefit from the high connectivity of the qubits in that no SWAP-gates have to be used.Newer backends use a purely heavy-hexagonal topology or segments thereof because it yields lower error rates than more connected topologies [18].In Figure 8 this effect is visible in the lower relative difference of the younger backends 'ibmq_santiago', 'ibmq_manila', and 'ibmq_ehningen' compared to the older 'ibmq_16_melbourne' and 'ibmqx2'.
As shown in Figure 8, the MARY-implementation's results are more precise.Measurement error mitigation is a way to improve them further.
Here, we pursue two ways to obtain the calibration matrix.The first one, 'mitigation_own', is executed on the 'qasm_simulator' assuming a self-determined noise model.We follow the suggestions from [17] and assume Paulierrors for the measurements and depolarizing errors for X-and CX-gates.We set p meas = p gate = 10%, which exceeds  the actual error probabilities of the backends (see Table 1).This way, we can also account for other errors that cannot be incorporated directly, e.g., errors caused by the environment of the quantum computer.
For the second approach, 'mitigation_backend', we replace our noise model by the noise model from the Qiskit Aer Noise module [12] which is obtained via the command 'from_backend(backend)'.It includes all error rates, coherence times, and the coupling map of the backend to that specific time.The outcome for the MARY-implementation is shown in Figure 11.
Both variants of measurement error mitigation reduce the relative difference for all tested backends.Figure 11 shows, that 'mitigation_own' works better.This is probably because 'mitigation_backend' takes into account the actual daily qubit and gate errors of the backends but ignores other error sources such as crosstalk errors.In addition, other factors such as the environment of the quantum computer can also affect the result.With 'mitigation_own', we circumvent this problem by fixing the error to 10% which surely overestimates the true values.Changing or adjusting this value offers further potential for improving measurement error mitigation, but will not be considered further in this paper.
Relative differences in the range of 2 − 3%, in some executions also lower, can be achieved by using 'mitigation_own'.Thus, with our adjustments and improvements, it is possible to reconstruct the input image.The outcomes with the smallest, highest, and mean relative difference are shown in Figure 12. shots and in total 42 executions on the five backends.We show the output images with the smallest (best) and highest relative difference (worst) as well as the mean of the 42 executions and the five backends.The best results were obtained on backend 'ibmq_manila'.The worst cases came from 'ibmq_16_melbourne'.

Current maximal possible image sizes for simulator and NISQ quantum computer
In [14], an input image of size 32 × 32 was implemented.Following the same idea, we implement circuits for images of size 2 n × 2 n , where n ≤ 9 (details as supplementary information in Section 10).Input pixel values are chosen randomly up to a size of 16 × 16.From 32 × 32 on, we use downscaled versions of the 8-bit gray value Lena image [19], which originally has a size of 512 × 512 and is a standard test image in image processing.
We apply the steps from Sections 3, 4, and 5 to check feasibility but do not numerically compare the output with the original input.Results are strongly influenced by noise as the image size is larger than 2 × 2 and thus the associated circuit depth increases.This complicates the retrieval of an image enormously, since in a probabilistic model like FRQI the exact measurement of the probabilities for the individual states is crucial.The retrieved pixel values are all around 125 using the five backends from above or the backend 'ibmq_toronto' and do not reflect the input image at all.
We further illustrate this in Figure 13.Instead of the random image, we use a 4 × 4 pixel downscaled gray value image from the MNIST dataset [20].This image shows a well recognizable digit seven.However, even with the MARY-implementation and when including error mitigation, the seven is no longer visible in the output image.
Consequently, we can only recover images with a size up to 2 × 2 with FRQI on a real backend.Above that, the noise makes the recovery of an image impossible with the used implementation even when using measurement error mitigation.
Even with the noise free and fully connected 'qasm_simulator', using 8.192 shots for larger images results in images strongly deviating from the input image, as shown in Figure 14a.Even a much higher number of shots is no complete remedy (see Figure 14b).The visual differences for the downscaled 256 × 256 Lena image are shown in Figure 15.
The observed deviation is related to the number of states that can occur for a given image size.For example in the MARY-implementation, we only increase the size of the MARY-gates without adding an ancilla qubit for images smaller than 32 × 32.Therefore, we have in total 2 2n+1 possible states (like in the MCRY-implementation), where 2n + 1 is the number of required qubits.For images larger than or equal to 32 × 32, we have an ancilla qubit in addition to the positions qubits and the gray value qubit, so 2 2n+2 possible states are conceivable.This results in more than a million possible states for images of size 512 × 512, since 20 qubits are needed.Thus, accurate estimation of the distribution of possible states requires a sufficiently large sample.The number of possible states and the deviation from the input image grows exponentially as visualized in Figure 14.
The circuit depth increases exponentially, too.This is due to the entanglement of the position qubits with the gray value qubit and the associated exponential increase of the number of CX-gates.See Figure 16 for a visualization.
With 'qasm_simulator', the circuit depth can be determined up to an image size of 32 × 32 for MCRY-and 512 × 512 for MARY-implementation without exceeding memory (see Figure 16a).However, actual execution is no longer possible from these image sizes onwards with 64GB RAM available in the classical machine used for generating and storing the circuits.For the backend 'ibmq_toronto', the circuit depth allows calculation for image sizes up to 16 × 16 for the MCRYand 64 × 64 for the MARY-implementation only, see Figure 16b.This is due to the fact that more gates are needed compared to the simulator.Additionally, backend specific things like coupling maps and errors are considered in the transpilation step which increases the memory needed.For the real backend, circuit depths vary due to changing errors, which is why we average over 10 observations in Figure 16b.
The circuit depth is significantly higher for the MCRY-implementation which implies that more noise is accumulated in the process.Additionally, more memory has to be used which limits the executability of the MCRY-implementation.
All in all, we need more and more memory to generate the circuits for increasing image sizes.In the end, this is the limiting factor.The current possible image sizes that can be handled on 64GB RAM are shown in Table 2.For larger images, the available memory is exceeded and the job aborts.If we focus on the outcomes, the finite sampling shot noise increases the relative difference for the 'qasm_simulator'.The additional noise from gates and the environment further restricts the maximal image size for the real backend.In total, in spite of all suggested improvements, the reconstruction of the image with FRQI is only possible for 2 × 2 images on the real backends.
Additionally, there are also significant differences in the execution times of the MCRY-and the MARY-implementation.This is shown in Figure 17.The higher circuit depth and number of gates in the MCRY-implementation result in higher execution times for both the 'qasm_simulator' and IBM's backend 'ibmq_toronto'.This difference is more pronounced for larger image sizes.

Conclusion
In this paper, we investigate the practical use of one of the basic quantum image representations, namely FRQI.In particular, we determine the manageable image sizes both in terms of useable results and memory requirements.With exponentially increasing image size, the number of qubits increases only linearly.However, the number of possible  states increases exponentially.As a result, even when using 'qasm_simulator' and a fixed number of shots, it happens that pixel values of the output image cannot be distinguished from noise and therefore do not match those of the input image.
Furthermore, the number of gates required for encoding an image with increasing size increases exponentially, too.Thus the influence of per-gate errors increases at the same speed.Our simplified implementation reduces this effect.It saves a large number of gates, reduces errors that way, and enables faster computation.The basic idea is to replace the error-prone multi-controlled gates by simplified versions needing less CX-gates.With increasing image size, this strategy becomes more and more important.First, to obtain less confounded results.Second, to push the feasible image sizes to new frontiers.All quantum image representations and all quantum algorithms involving multi-controlled operations can benefit from the presented simplified implementation.Figure 18: Implemented circuits for varying image sizes shown via Qiskit's 'draw' function [12] with matplotlib output variant 'mpl'.

≡
(a) MARY-gate for an arbitrary angle γi = 2θi and its decomposition into CX-and Ry-gates.The Ry-gates must be converted further into the basis gates.In total, 4 CX-, 8 SX-, and 8 Rz-gates are needed for one MARY-gate without considering the coupling map (the number of CX-gates may increase due to additional SWAP-gates).(b)Circuit for an arbitrary 2 × 2 gray value image using the MARY-implementation.Pixel values are converted into angles θi, for i ∈ {0, 1, 2, 3}.Hadamard gates are used for superposition, X-gates for rotation to the desired state.There is one MARY-gate for each pixel value.

Figure 4 :
Figure 4: Gates for entangling qubits instead of using multi-controlled CX-gates.Their decompositions into singlequbit-gates and CX-gates are shown on the right.Top: RCCX-gate; Bottom: RCCCX-gate.

Figure 6 :
Figure 6: Circuit for one angle of a 64 × 64 image.Hadamard gates are used for superposition, RCCX-and RCCCXgates for entangling, and MARY8 for entangling and rotation.X-gates after the Hadamard gates are not shown here.

Figure 7 :
Figure 7: Backends used in this paper.The qubit frequencies (points) and the CX errors for the connections between the qubits (lines) are shown with various color values.Dark blue indicates small, purple high frequency/error.

Figure 12 : 2 × 2
Figure 12: 2 × 2 pixel gray value input image and resulting output images.We use the 'qasm_simulator' with 8.192 shots and in total 42 executions on the five backends.We show the output images with the smallest (best) and highest relative difference (worst) as well as the mean of the 42 executions and the five backends.The best results were obtained on backend 'ibmq_manila'.The worst cases came from 'ibmq_16_melbourne'.

Figure 13 : 4 × 4
Figure 13: 4 × 4 pixel downscaled gray value input image from the MNIST dataset[20] and resulting output images.We use the MARY-implementation, 8.192 shots for the 'qasm_simulator', and 'ibmq_toronto' as real backend.The results can only be improved slightly with the measurement error mitigation method.

Figure 14 :
Figure 14: Relative difference (in %) between image in and image out for varying image sizes, 'qasm_simulator' as backend and 8.192 or 10 6 shots.
(i) Circuit for one angle γi = 2θi of a 8.192 × 8.192 image.X-gates and Hadamard gates are not shown here.The decomposed MARY10-gate is shown in Figure 18d.

Table 1 :
Typical average calibration data of the six chosen backends.

Table 2 :
Current maximum executable and usable image sizes for MCRY-and MARY-implementation on 'qasm_simulator' with 8.192 shots and IBM's backend 'ibmq_toronto' limited to 64GB memory.The term executable refers to the possibility to run the algorithm without focusing on the outcomes.The term usable implies that the relative difference between input image and reconstructed image is less than 5%.maximumexecutable image size maximum usable image size