SciELO - Scientific Electronic Library Online

 
vol.66 issue2Experimental and fractional analysis of half-value thicknesses of polyethylene absorberWheat germ, mamey seed, walnut, coconut, and linseed oil thermal characterization using photothermal techniques author indexsubject indexsearch form
Home Pagealphabetic serial listing  

Services on Demand

Journal

Article

Indicators

Related links

  • Have no similar articlesSimilars in SciELO

Share


Revista mexicana de física

Print version ISSN 0035-001X

Rev. mex. fis. vol.66 n.2 México Mar./Apr. 2020  Epub Mar 26, 2021

https://doi.org/10.31349/revmexfis.66.239 

Research

Other areas in physics

Performance and error modeling of Deutsch’s algorithm in IBM Q

E. Buksmana 

A. L. Fonseca de Oliveiraa 

C. Allendea 

aFacultad de Ingeniería, Universidad ORT Uruguay, Uruguay. e-mail: buksman@ort.edu.uy; fonseca@ort.edu.uy; allende@ort.edu.uy


Abstract

The performance of quantum computers today can be studied by analyzing the effect of errors in the result of simple quantum algorithms. The modeling and characterization of these errors is relevant to correct them, for example, with quantum correcting codes. In this article, we characterize the error of the five qubits quantum computer ibmqx4 (IBM Q), using a Deutsch algorithm and modeling the error by Generalized Amplitude Damping (GAD) and a unitary misalignment operation.

Keywords: Quantum computation and information; quantum Deutsch’s algorithm; quantum error models; IBM quantum experience

PACS: 03.67.a; 03.67.Lx; 03.65.Yz

1. Introduction

The idea of using the quantum mechanics as a calculation tool arose from the pioneering works of Feynman and Deutsch [1,2] in the 80s. It is based on the use of properties as superposition and entanglement for the realization of computational task. This requires a quantum computer that works at the microscopic level. This way, a quantum computer could solve certain known problems, more efficiently than can be done with classical computers [3], enabling advances in cryptography, drug research and development, faster data analysis, and improve artificial intelligence [4].

Major companies such as Google, Intel, Microsoft and IBM, among others, have embarked on the building of quantum computers, being able to handle up to a several tens of qubits today. In particular, the IBM Q machine used here, is a scalable quantum computer, based on superconducting technology that has the advantage of being open access through the internet [5].

Several algorithms based on quantum advantage have been proposed; among the most important are the Grover algorithm and the Shor factoring algorithm. The Grover algorithm [6] is a search algorithm of an element in a disordered base. The known classical algorithms are of order O(N), while the quantum algorithm allows to determine with high probability the desired element with an order O(N). The Shor factoring algorithm [7] reduces the calculation time from a sub-exponential order in classical computing to a polynomial order in quantum computers.

However, the fact that quantum systems cannot be completely isolated from the environment, together with systematic imperfections on gate applications, inexact state preparations, and inaccurate measurements, induces errors in any quantum computational task [8,9]. While there is a faulttolerant methods based on the correction of errors below a certain threshold [10], these methods are very expensive in computational resources. In other hand, the development of new tools in order to characterize and analyze the effect and propagation of quantum errors is an important issue in order to try correct them with the least possible complexity.

In this article, we analyze the error propagation in the Deutsch algorithm (DA), a special case of the general Deutsch-Jozsa algorithm [11], implemented in the quantum computer ibmqx4 (IBM Q). Some authors have implemented this algorithm in the IBM Q computer (for example to solve a learning parity problem [12,13]) but only some work has been done modeling the error of this technology [14]. The mixed state resulting from the algorithm is determined, and the error is characterized using an isotropic index [15], and is then modeled by a standard Generalized Amplitude Damping error (GAD) and a misalignment unitary error model(MA).

The public interested in research in the area of quantum algorithms, must be aware of the need to identified and model the errors, to ultimately correct and/or control them to obtain a satisfactory result.

2. Quantum computing overview

2.1 States

The qubit, the unit of quantum computation, denoted by |ψ⟩, is analog to a bit in a standard computation, and it is represented by a unitary vector, called a pure state. For example, for one qubit state, the vector |ψ⟩ = α|0⟩ + β|1⟩, is a linear superposition of vectors |0⟩ and |1⟩, where α and β are complex numbers that meet |α|2 + |β|2 = 1. The vectors |0⟩ and |1⟩ are defined in the computational base as [16]

|0=10,|1=01. (1)

A pure state of several qubits, is expressed as the linear combination on complex field of Kronecker product [17], of states of one qubit, denoted here by ⊗. For example for two qubits, any pure state is represented by a vector |ψ⟩ = α|0⟩ ⊗ |0⟩ + β|0⟩ ⊗ |1⟩ + γ|1⟩ ⊗ |0⟩ + δ|1⟩ ⊗ |1⟩, where α,β,γ,δ are complex numbers and the vector has unitary norm.

|ψ=αβγδ. (2)

2.2. Evolution of states

The evolution of a quantum closed system is a reversible process, and can be represented by a unitary transformation U, on the state |ψ⟩, U|ψ⟩ = e iH∆t |ψ⟩ where H is the Hamiltonian of the physical system and ∆t the time duration of the process [16]. This representation is especially useful, since you can see the unitary transformations as quantum gates, similar to the role of classic gates in classical computation. Some transformations commonly used in quantum circuits are shown in the Table I.

TABLE I Common Unitary matrices. 

Gate name Matrix representation
Hadamard gate H=12111-1
Pauli X gate X=σx=0110
Pauli Y gate Y=σy=0-ii0
Pauli Z gate Z=σz=100-1
Cnot gate Cnot=1001000000000110

The entanglement of a composed state (more than one qubit), is a unique feature of quantum states, that has no analogy on classical computing. For example, the two qubit state GHZ [16] is a state of maximum entanglement which can be generated by the application of a Cnot gate I to two independent qubits |ψ

Cnotψ=Cnot12(|0+|1|0

=12(|0|0+|1|1) (3)

as illustrated in Fig. 1.

FIGURE 1 Cnot gate aplied to state |ψ⟩. 

2.3. Open systems

When we have partial information of the state, i.e., we only have information of a subsystem of the total system, the state must be represented by a positive definite hermitic matrix of unitary trace, called the density matrix of a mixed state. Any pure state can be also described by a density matrix, but the inverse is not true. For the pure state |ψ⟩ = α|0⟩ + β|1⟩, the density matrix denoted by |ψ⟩⟨ψ| is

ρ=|ψψ|=αα*αβ*α*βββ*. (4)

In the rest of the article we will refer to the state of the system as the representation via the density matrix.

The decoherence can be thought of as an unwanted interaction with the environment [18]. When a quantum system is open, the interaction between the system S and the environment E can be represented as a unitary matrix of the whole system. If we only have information about the system S, it can no longer be described as a unitary vector, but can be described by a density matrix, which is the statistical average of an assembly of pure states.

The quantum evolution of a closed system can still be represented by a unitary matrix. When the state is represented by a density matrix ρ, the evolution of the state is given by ρ’ = UρU [16].

2.4. Measurements

Unlike the reversible evolution of a closed process, quantum measurement is an irreversible process that collapses the quantum state. For example, for the one qubit state |ψ⟩, the state collapses to |0⟩ or |1⟩, with probabilities |α|2 and |β|2 respectively. In general, the measurements can be represented by operators. If we restrict ourselves to projective measurements, a physical observable M, called in this context the measurement base, can be described by the projectors P i , generated by the eigenvectors of M,

M=iλiPi=iλiuiui (5)

where λ i and u i are the eigenvalues and eigenvectors respectively of M. Then, the probability after projective measurement of the state ρ is [16]

Pi=TrPiρ, (6)

and the state after measurement becomes ρ

ρ'=iPiρPi. (7)

3. Modeling quantum errors

Every computational system is unavoidably affected by errors. In particular, the implementation of gates, the preparation of states and the measurement, can have systematic errors [19], as well as errors due to the interaction with the environment, called decoherence errors [18]. Systematic errors could be modeled as random unitary matrices, but usually they have a preferential error direction. Both type of errors can modeled by Operator Sum Representation ([20]) and characterized using the isotropic index [15].

The decoherence can be modeled by a sum of operators (Operator Sum Representation [20]) applied to the state of the system, determined to better adjust the noise for each type of technology.

A quantum operation over a state ρ denoted ε(ρ) can be expressed as a function of Kraus operators (E k ) as shown

ερ=kEkρEk (8)

where E k satisfy kEkEk=I, where I is the identity matrix, of the same dimension as E k .

3.1. Generalized amplitude damping error (GAD)

One of the standard models commonly used in the literature is a Generalized Amplitude Damping error (GAD), that could be interpreted as the interaction between a system and a thermal bath at fixed temperature. The model depends on two parameters: one related to the contact time with the thermal bath, represented as a probability of error γ ∈ [0,1], and the second related to the temperature of the thermal bath, represented by a parameter p ∈ (1/2,1]. For GAD error the Kraus operators are [16],

E0=p1001-γ, E1=p000γ,

E2=1-p1-γ001,

E3=1-p00γ0 (9)

3.2. Systematic errors

In addition to a decoherence error, quantum computers suffer from systematic errors like classical machines. The error can be expressed by a rotation G, which could have a preferential direction in space. For example, a deviation ∈ by rotation in X direction, can be represented by the unitary matrix G = e i²X where the resulting state due to error ρ is

ε(ρ)=GρG (10)

3.3. Isotropic error state

An isotropic error state is a mixed state that results of isotropic errors, i.e., errors that depends only of the distance from the original state, or reference state (r.s.) [15].

In the case of a n qubits reference state |0⟩ n = |0...0⟩ the mixed density matrix ρ iso representing an isotropic error state has the form

ρiso=λ00000λ10000λ1. (11)

In the general case, let |ϕ⟩ be a reference state (r.s.) and M a basis change matrix so that |0⟩ = M|ϕ⟩. A mixed state ρ is an isotropic error state (r.s.|ϕ⟩) if the the state ρ¯=MρM can be expressed as

ρ¯=2nλ1I2n+λ0-λ1ρ0,λ0λ12nλ0I2n+2n-1λ1-λ0ρN0,λ0<λ1, (12)

where ρ 0 = |0⟩ n ⟨0| n and

ρN0=I-ρ02n-1=12n-100000100001, (13)

the orthogonal isotropic mixed state relative to the reference state |0⟩ n .

Applying the inverse transform, the orthogonal isotropic mixed state of ρ ϕ = | ϕ⟩⟨ϕ | is

ρNϕ=MρN0M=I-ρϕ2n-1 (14)

3.4. Isotropic index

To identify and characterize the errors, the isotropic double index defined in [15] is used. This index separates the part that cannot be corrected due to the total loss of information, called weight w, and the alignment A with respect to the expected reference state that, theoretically could be corrected.

Considering the pure reference state of n qubits, ρ ϕ = |ϕ⟩⟨ϕ|, and the decomposition of a state ρ after a noisy process acting on ρ ϕ , ρ=p(I/2n)+(1-p)ρ^. The double index is defined as:

• The Isotropic Alignment A,

A=Fid(ρ^,ρϕ)-Fid(ρ^,ρNϕ) (15)

where Fid is the fidelity between quantum states.

• The isotropic weight is

w=2nλ, (16)

with λ being the smallest eigenvalue of ρ.

The alignment A takes values in the interval [−1,1].

When it is completely aligned with the pure reference state |ϕ⟩, A = 1, and when it is completely misaligned, A = −1. The weight take values in the interval [0,1]. When the state ρ is pure w = 0 (the inverse is true only for one qubit state) and for a state without any information, w = 1 (for one qubit state is the state maximum mixedness).

As an example, if we consider the one qubit reference state |0⟩ and the mixed state after some noisy process ρ

ρ=0.50.40.40.5=0.2I2+0.8|++|. (17)

where |+ = (1/ 2)(|0+1|). The weight is w = 0.2 and the alignment is A = 0, which means that it is aligned with the |+⟩ state, and not with the reference state |0⟩. By making a rotation G of the ρ state

G=121-111 (18)

it could be realigned to the reference state

GρG=120.9000.1=0.2I2+0.8|00|. (19)

4. Error analysis on Deutsch algorithm

4.1. Deutsch algorithm

The Deutsch quantum algorithm, one of the first proposed, solves in the framework of quantum computing a problem that cannot be solved in a unique step of calculation using classical computation. Although the algorithm proposed by David Deutsch is not of immediate application, it is the basis of important algorithms based on oracles such as Grover’s search of known advantage over standard computation.

The idea is defined as follows; given a black box, known as the oracle, which consists of an unknown binary function of one bit f (x) : {0,1} → {0,1}, the goal is to decide in a deterministic way if the function is balanced or constant using the oracle only one time. The classical algorithms need two instances of application of the oracle to solve the problem in a deterministic way, while quantum Deutsch algorithm uses the oracle a single instance, as long as there are no errors in the calculation process. The Deutsch algorithm can be summarized in the following scheme shown in the Fig. 2.

FIGURE 2 The Deutsch Algorithm. 

Beginning with the two-qubit initial state |0⟩ ⊗ |0⟩, a X gate is applied in the second qubit getting |0⟩ ⊗ |1⟩. After applying a Hadamard transform to each qubit, the result is (1/2)(|0⟩ + |1⟩)⊗(|0⟩ − |1⟩). Applying the oracle (with one of four possible binary functions) to the current state, and ignoring the second qubit (because at this stage the qubits are independent), we get

120+(-1)f(0)f(1)1 (20)

Finally, applying a Hadamard transform to this state we have

12[(1+-1f0f1)0

+(1--1f0f1))1]. (21)

Then it is concluded immediately that, the result is 0 for constant functions, and 1 for balanced ones.

4.2 Deutsch algorithm (DA) implementation on IBM Q

In order to analyze the performance of the algorithm in the IBM Q machine, the four possible functions of the oracle have to be implemented, i.e, f 0 constant zero, f 1 constant one, f Id identity and f NOT inverse function. Each of these functions are implemented with the previous quantum gates Table I, and are shown in Figs. 3, 4, 5, and 6.

FIGURE 3 DA IBM Q implementation, with constant zero function f 0

FIGURE 4 DA IBM Q implementation, with identity function f Id

FIGURE 5 DA IBM Q implementation, with inverse function f NOT

FIGURE 6 DA IBM Q implementation, with constant one function f 1

To study the effect of the error on the resolution of the problem, the measurement of the third qubit is made (q[3]). The result in an ideal case without error, should be 0 if the function is constant and 1 if the binary function is balanced. However, the actual result is affected due to several sources of error, which distort it with respect to the ideal case. To analyze this distortion, statistical experiments were carried out, that allow us to determine in an approximate way the representative assemble of the final state, i.e., the final mixed state denoted by ρ.

4.3. Quantum state tomography (QST)

To find experimentally the density matrix of a state, a method called quantum state tomography is used [16]. Measurements must be made in the three bases (axes) of the space, X,Y and Z, to recover the density matrix state. The state ρ is given by [16]

ρ=12(Id+TrρXX+TrρYY+TrρZZ (22)

where Tr(ρX), Tr(ρY), Tr(ρZ), are obtained, approaching the expected value by the statistical average. For example, by spectral decomposition Z = (+1)P 0 + (−1)P 1, then, Tr(ρZ) = Tr(ρP 0) − Tr(ρP 1), that by Eq. (6), Tr(ρZ) = P(0) − P(1), where P(0) and P(1) are the probabilities of measuring 0 and 1 respectively. Similar calculations were done for X and Y operators.

The IBM Q computer, can measure only in the canonical base (Z). Then, to measure on another base, the last two identities in Figs. 3, 4, 5, and 6, must be replaced. For example, to measure in the base X, a rotation of a q[3] qubit must be made, using in place of I d I d , the matrix HI d , and to measure in the Y basis, the identities must be replaced by S H, where

S=100-i,

as shown in Fig. 7.

FIGURE 7 DA IBM Q implementation, for f Id in Y basis. 

For each of the four possible binary functions, the experiments were performed 8192 times (in IBM Q computer), and the resulting density matrices and probabilities of success are obtained and shown in Table II.

TABLE II Probability of success for each binary function. 

Binary function Resulting matrix Ideal result Probability
f 0 0.94910.0462- 0.0664i0.0462 + 0.0664i0.0509 0 0.9491
f I 0.14970.0270- 0.0160i0.0270 + 0.0160i0.8503 1 0.8503
f NOT 0.17480.1079-0.0576i0.1079+0.0576i0.8252 1 0.8252
f 1 0.94950.0510-0.0645i0.0510 + 0.0645i0.0505 0 0.9495

4.4.Modeling GAD error in IBM Q

After a statistical analysis of experimental data, it was determined that the model that best suited this algorithm and quantum machine (IBM Q) is a Generalized Amplitude Damping (GAD) error model [15]. Running a numerical simulation of this error and comparing with experimental data, the parameters that best adjust to the Eq. (9) for the four functions at the same time are:

γ=0.1947,p=0.7761. (23)

4.5. The misalignment error model (MA)

The resulting experimental states (IBM Q) show some misalignment with respect to the expected states (for each of the 4 functions) that cannot be modeled with a GAD error (see Table III).

TABLE III Double Isotropic Index (Weight and Misalignment as defined in Eqs. (15) and (16)) and Fidelity between the IBM Q experimental result and the simulated error model. 

Binary function Ideal result Weight (w) Misalignment (A) Fidelity
f 0 0 0.0873 0.9070 0.9999
f Id 1 0.2965 0.9544 0.9976
f NOT 1 0.3051 0.8049 0.9996
f 1 0 0.0862 0.9056 0.9999

The GAD error model can generate a certain weight (w) in the pure states resulting from the algorithm, but it cannot generate a misalignment with respect to these. We propose a method that consists of a unitary transformation (rotation) applied to three qubits (two qubits of the algorithm and one auxiliary one) that quantifies the misalignment of the state.

In order to determine the appropiate rotation that has to be applied to each function, knowing the theoretical result (0 for f 0, f 1 and 1 for f I , f Not ) we generate a rotation from that state to the experimental one (G f0 , G f1 for 0 , and G fI , G fNot for 1), in the same manner as 18. Finally, an approximation to the geometric mean is applied to both cases given by

G0=elogGf0+logGf12,G1=elogGfI+logGfNot2 (24)

resulting in

G0=0.9960.053 + 0.069i0.090-0.594 + 0.799i,

G1=0.994-0.097 + 0.055i-0.111-0.863 + 0.493i (25)

Since the result of the algorithm is a priori unknown, the proposed model applies a conditional operator depending on the result as shown in Fig. 8.

FIGURE 8 The Misalignment error model (MA). 

The result of the model, quantified using the fidelity between the IBM Q experimental result and the simulated one, is shown in the Table III.

5. Results and conclusions

In this work we have modeled the propagation of errors in a real quantum machine, such as IBM Q (ibmqx4). The resulting mixed states of a quantum Deutsch algorithm, are found by means of a QST method. Through the characterization using an isotropic index, the error has been modeled, in which the loss of information is given by a GAD error model, and the misaligned part by means of unitary conditional matrix (MA error model). As shown in Table III, the largest source of error in this case is the decoherence, given by the weight (w) and modeled by GAD error model. Furthermore, the Misalignment error improves the error model bringing fidelities close to one.

The proposed error model fits very well with the experimental results, and can be the first step for the future correction of systematic errors in quantum systems.

References

1. R. P. Feynman, Int J. Theor. Phys., 21 (1882) 467-488. [ Links ]

2. D. Deutsch and R. Penrose, Proc. R. Soc. Lond. 400 (1985) 97117. [ Links ]

3. R. Raz and A. Tal, Weizmann Institute Electronic Colloquium on Computation Complexity Report No. 107, 2018. [ Links ]

4. V. Dunjko and H. J. Briegel, Rep. Prog. Phys., 81 (2018) 074001. [ Links ]

5. IBM Quantum Experience, www.research.ibm.com/ibm-q. [ Links ]

6. L. K. Grover, in Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, Pennsylvania, 1996, edited by G. L. Miller (Association for Computing Machinery, New York, 1996), p. 212. [ Links ]

7. P. W. Shor, Phys. Rev. A, 52 (1995) R2493-R2496. [ Links ]

8. S.J Devitt, W. Munro, and K. Nemoto. Rep. Prog. Phys. 76 (2013) 076001. [ Links ]

9. M. Otten and S. K. Gray, Phys. Rev. A., 99 (2019) 012338. [ Links ]

10. D. Gottesman, in Encyclopedia of Mathematical Physics, edited by J.-P. Francݧoise, G. L. Naber, and T. S. Tsun (Elsevier, Oxford, 2006), p. 196-201. [ Links ]

11. D. Deutsch and R. Jozsa, Proc. R. Soc. Lond. A 439 (1992) 553-558. [ Links ]

12. D. Ferrari and M. Amoretti, Int. J. Quantum Inf. , 16 (2018) 1840006. [ Links ]

13. D. Riste et al., npj Quantum Inf., 3 (2017). [ Links ]

14. R. Harper and S. T. Flammia, Phys. Rev. Lett., 122 (2019) 080504. [ Links ]

15. A. L. Fonseca de Oliveira, E. Buksman, I. Cohn, and J. García López de La- calle, Quantum Inf. Process. 16 (2017) 48. [ Links ]

16. M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information (Cambridge University Press, 2000). [ Links ]

17. H. V. Henderson and S. R. Searle, Linear and Multilinear Algebra 9 (1981) 271-288. [ Links ]

18. R. Alicki, M. Horodecki, P. Horodecki, and R. Horodecki, Phys. Rev. A . 65 (2002) 062101. [ Links ]

19. D. Greenbaum and Z. Dutton, Quantum Sci. Technol. 3 (2018) 015007. [ Links ]

20. K. Kraus, Effects, and Operations. edited by A. Böhm, J. D. Dollard, W. H. Wootters (Springer-Verlag, Berlin, 1983). [ Links ]

Received: September 12, 2019; Accepted: October 30, 2019

Creative Commons License This is an open-access article distributed under the terms of the Creative Commons Attribution License