Functional framework for representing and transforming quantum channels
aa r X i v : . [ qu a n t - ph ] J u l Functional framework for representing and transformingquantum channels
Jaros law Adam MiszczakInstitute of Theoretical and Applied Informatics,Polish Academy of SciencesBa ltycka 5, 44-100 Gliwice, Poland [email protected]
Abstract
We develop a framework which aims to simplify the analysis of quantum states and quan-tum operations by harnessing the potential of function programming paradigm. We show thatthe introduced framework allows a seamless manipulation of quantum channels, in particularto convert between different representations of quantum channels, and thus that the use offunctional programming concepts facilitates the manipulation of abstract objects used in thelanguage of quantum theory.For the purpose of our presentation we will use
Mathematica computer algebra system.This choice is motivated twofold. First, it offers a rich programming language based on thefunctional paradigm. Second, this programming language is combined with powerful symbolicand numeric manipulation capabilities.
Keywords quantum channels, functional programming, scientific computing
Functional programming is frequently seen as an attractive alternative to the traditional methodsused in scientific computing, which are based mainly on the imperative programming paradigm [3].Among the features of functional languages which make them suitable for the use in this area isthe easiness of execution of the functional code in the parallel environments.The main aim of this work is to show that the functional programming concepts facilitatethe use of abstract objects used in the language of quantum theory. We develop a frameworkwhich aims to simplify the analysis of quantum states and quantum operations by harnessing thepotential of functional programming paradigm. For the purpose of our presentation we will use
Mathematica computer algebra system. This choice is motivated twofold. First, it offers a richprogramming language based on the functional paradigm. Second, this programming language iscombined with powerful symbolic and numeric manipulation capabilities.During the last few years a number of simulators of quantum information processing has beendeveloped using
Mathematica computing system [8, 5, 7, 2]. Unfortunately, these packages do notuse functional programming capabilities of this system and are focused on pure states and unitaryoperations. Moreover, they focus on the quantum mechanical systems which can be representedusing state vectors and include only a basic functionality required for the purpose of manipulatingand analyzing quantum states.In this paper we follow the pragmatic approach and we provide a set of useful constructionswhich can be helpful for the analysis of quantum channels. At the same time we advocate the use offunctional programming in this approach. We argue that by using the functional language elementsprovided by
Mathematica one can easily and efficiently convert between different representationsof quantum channels.
Functional syntax for quantum channels
In the following we assume that the quantum systems are represented by finite-dimensional densitymatrices, i.e. positive semidefinite complex matrices with unit trace. The space of density matricesof dimension d is denoted by Ω d . We use res , unres operations [6] for converting between matrixand vector forms of states and operators. In the Mathematica language function res is defined asa synonym for a built-in function
Flatten
Res =
Function [m,
Flatten [m]];
This function transforms a matrix m into a vector in a row order. Function unres , which is areverse transformation, is defined in Mathematica as Unres =
Function [m,
Partition [m,
Sqrt [ Length [m]]]]; and it uses built-in function
Partition to get back from a one-dimensional list to a matrix.As the space of density matrices is unitary with Hilbert-Schmidt scalar product, we introduce afunction
HSInner =
Function [x,
Function [y, Tr [x. ConjugateTranspose [y]]]]; which, thanks to the curried form, allows using a partial application in the application of thisscalar product.Unfortunately
Mathematica does not provide a straightforward support for the partial applica-tion of functions. The language does not allow using functions with too few parameters and onehas to explicitly use empty slots ( -signs) to define a partially applied function. For this reason inorder to use the functional version of some procedures, it is necessary to provide a curried versionof these functions.
Let us illustrate the above considerations with the simplest example – the transposition map. Thismap is defined as ρ ρ T , (1)and can be expressed in Mathematica as trans = Function [x,
Transpose [x]] or using more compact syntax as trans =
Transpose [ .One should note that this map is not completely positive, hence it does not represent a validquantum channel. Nevertheless, it is useful for presenting basic transformations which can beperformed on quantum channels.If we would like to apply this function on some state ρ we simply write trans[ ρ ] . In manysituations however, one needs to apply a map on a list rhos of states or matrices. In this case wesimply map the functions representing the map on the list using Map function as
Map [trans, rhos] or using more compact syntax as trans /@ rhos . In order to use channels defined by parametrized expression, one can employ partially appliedfunctions. The simplest example of such channels is a depolarizing channel Ψ D ( p,d ) defined asΨ D ( p,d ) ( ρ ) = (1 − p ) ρ + p n n , (2)where we assume that ρ ∈ M n and n denotes the identity matrix of the appropriate size.Using the notation introduced in Section 2.1, this channel can be represented by a function dep = Function [d,
Function [p,
Function [x,(1-p)x + p
IdentityMatrix [d]/d]]]; ere we follow the convention that the function parameters should be organized in such a way, thatby providing all but one of them, we obtain a function accepting quantum state as an argument. Inthe above case the first two parameters represent the dimension and the reliability of the channel(the probability of introducing no errors).Function dep requires three arguments and its application on state ρ is achieved by firstdeclaring the instance of the channel for a fixed dimension ( e.g d=4) dep4 = dep[4]; and next using this function with a specific probability pdep4[p][ ρ ]; However, one can use dep function to define the expression in which only two arguments areprovided g = (dep[ and this allows obtaining a general definition of the depolarizing channel with a fixed parameter p , identical to the following definition Function [d,
Function [x, (1-p) x + p
IdentityMatrix [d]/d]];
Function g accepts two arguments representing the dimension and the input state. Its appli-cation on some state ρ ∈ M reads g[4][ ρ ]; and this syntax allows the selection of an argument which should be fixed during the manipulation. As channels are linear mappings, it is possible, at least in finite-dimensional case, to representthem by matrices. Let us assume that we are dealing with d = n × n dimensional matrices.The base in n -dimensional space M n is given by matrices, which can be obtained by using Unres operations on the base vectors in the d -dimensional space C d , d = n , as base = Map [Unres[UnitVector[d,
Range [d]]; where
Range [d] returns a list containing numbers 1 , , . . . , d . In the following we assume thatthe d -dimensional matrix base can be obtained using function BaseMatrices[d] defined as
BaseMatrices =
Function [d,
Map [Unres[UnitVector[d,
Range [d]]];
If the list fBase contains the images of the quantum channel f on the base fBase = f /@ base then the natural representation can be calculated by unreshaping the images of the map on thebase matrices in M d , {Res /@ fBase} Combining this into one function gives
NaturalRepresentation =
Function [f,
Function [d,
With [{base=BaseMatrices[dˆ2]},
Map [Res[f[
We denote the natural representation of the channel Φ by M Φ , assuming that this matrix isobtained in the standard basis. Matrix M Φ is sometimes called a supermatrix for the channel Φ.The above considerations can be summarized as the following definition. Definition 1 (Natural representation)
For a given channel Ψ , the natural representation of Φ by M Φ is defined as ( M Φ ) i. = res Φ( b i ) (3) where ( A ) i. denotes i -th column of the matrix A and b i , i = 1 , n denotes base matrices in M n . or example, in order to obtain the matrix representation of the depolarizing channel dep acting on one qubit, one should use NaturalRepresentation function as
NaturalRepresentation[dep[2][p]][2]
In a similar manner one can check that the natural representation of the one-qubit transpositionchannel transNaturalRepresentation[trans][2] is equal to the SWAP gate.
Clearly one can represent a given channel in a matrix form using not only a canonical base, butany orthonormal basis in C n . In this situation one cannot use the method described above as itrelies on the special form of the canonical base matrices.The straightforward method of calculating a matrix representation, is based on the formula( M b Φ ) ij = tr [ b i Φ( b j ) † ] , (4)where b i , i = 1 , . . . , n denotes the base. Definition 2 (General natural representation)
For a given channel Ψ , the general naturalrepresentation of Φ in base b is defined as ( M b Φ ) ij = tr [Φ( b i ) b † j ] , (5) where b i , i = 1 , n denote base matrices in M n . This definition can be implemented using
Outer function as
Function [f,
Function [b,
Outer [HSInner[
Map [f,b], b, 1]]]; where base is a given base or, alternatively, by using
Map function as
Function [f,
Function [b,
Map [ Map [
Map [HSInner,
Map [f, b]]]]];
This method requires n multiplications of n × n matrices and is highly inefficient.The simplest method is to reconstruct a change of basis matrix M B , M B = Map [Res, b] and use it to obtain M b Φ as M b Φ = M B M Φ M † B . (6) Complete positivity, one of the requirements for the map between finite-dimensional spaces canbe formulated using Choi-Jamiolkowski representation of a map [4, 1]. This representation in thecontext of quantum channels is known as Jamiolkowski isomorphism and here the image of thisisomorphism is denoted as J Φ .The Choi-Jamiolkowski representation is closely related to the natural representation. Thenatural representation of the channel acting on n × n -dimensional matrices is always obtained withrespect to some bases { b i } i =1 ,n , where n is the dimension of the state space.If one uses base b i to obtain the natural representation of the channel Φ resulting in matrix M b Φ , then the Choi-Jamiolkowski matrix for this channel is obtained as {J b Φ } i,j = tr [ M b Φ ( b i ⊗ b j )] , (7)for i, j = 1 , n . efinition 3 (Choi-Jamiolkowski matrix) Let { b i } be a base in C n . The Choi-Jamiolkowskimatrix corresponding to a general natural representation in base { b i } is defined as {J b Φ } i,j = tr [ M b Φ ( b i ⊗ b j )] . (8)The Choi-Jamiolkowski representation of the channel Φ can be also obtained using several othermethods. One of the simplest formulas is the one expressing J Φ as a sum J Φ = d X i =1 Φ( e i ) ⊗ e i . (9)Assuming that base represents matrix base in d -dimensional space, this representation can beused by mapping cjBase = Map [KroneckerProduct[f[ and accumulating the results
Plus /@ cjBase
Combining the above into one function gives
ChoiJamiolkowskiRepresentation =
Function [f,
Function [d,
With [{base=BaseMatrices[d]},
Map [ Plus ,[ Map [KroneckerProduct[f[
The Choi-Jamiolkowski representation of a channel is related to the natural representation,one can easily construct a Choi-Jamiolkowski matrix corresponding to a given generalized naturalrepresentation.
Acknowledgements
This work was supported by the Polish Ministry of Science and HigherEducation under the grant number IP2011 036371 and by the Polish National Science Centre underthe grant number DEC-2011/03/D/ST6/00413. Author would like to acknowledge stimulatingdiscussions with Z. Pucha la, P. Gawron, D. Kurzyk, V. Jagadish and P. Zawadzki.
References [1] M.-D. Choi. Completely positive linear maps on complex matrices.
Linear Algebr. Appl. ,10(3):285–290, 1975.[2] J. L. G´omez-Mu˜noz and F. Delgado-Cepeda. Quantum 2.3 for Mathematica 8, 2011-. Softwareavailable on-line at http://homepage.cem.itesm.mx/lgomez/ .[3] K. Hinsen. The promises of functional programming.
Comput. Sci. Eng. , 11(4):86–90, 2009.[4] A. Jamio lkowski. Linear transformations which preserve trace and positive semidefiniteness ofoperators.
Rep. Math. Phys. , 3(4):275–278, 1972.[5] B. Juli´a-D´ıaz, J.M. Burdis, and F. Tabakin. QDENSITY—a Mathematica quantum computersimulation.
Comput. Phys. Commun. , 174(11):914934, 2006.[6] J.A. Miszczak. Singular value decomposition and matrix reorderings in quantum informationtheory.
Int. J. Mod. Phys. C , 22(9):897–918, 2011.[7] F. Tabakin and B. Juli´a-D´ıaz. QCWAVE – a Mathematica quantum computer simulationupdate.
Comput. Phys. Commun. , 182(8):16931707, 2011.[8] H. Touchette and P. Dumais. The quantum computation package for Mathematica 4.0. Softwareavailable on-line at http://crypto.cs.mcgill.ca/QuCalc/http://crypto.cs.mcgill.ca/QuCalc/