Partial Trace and Partial Transpose by José Luis Gómez-Muñoz http://homepage.cem.itesm.mx/lgomez/quantum/ jose.luis.gomez@itesm.mx This document is based on suggestions by Anirban Das Introduction This is a tutorial on the use of Quantum Mathematica add-on to calculate partial traces and partial transposes of operators in Dirac Notation Load the Package First load the Quantum`Notation` package. Write: Needs["Quantum`Notation`"] then press at the same time the keys -Û to evaluate. Mathematica will load the package: Needs@"Quantum`Notation`"D Quantum`Notation` Version 2.2.0. HJuly 2010L A Mathematica package for Quantum calculations in Dirac bra ket notation by José Luis Gómez Muñoz Execute SetQuantumAliases@D in order to use the keyboard to enter quantum objects in Dirac's notation SetQuantumAliases@D must be executed again in each new notebook that is created, only one time per notebook. In order to use the keyboard to enter quantum objects write: SetQuantumAliases[ ]; then press at the same time the keys -Û to evaluate. The semicolon prevents Mathematica from printing the help message. Remember that SetQuantumAliases[ ] must be evaluated again in each new notebook: SetQuantumAliases@D; Partial Traces Here we define a ket as a linear combination of eigenkets of two base operators. The base operators are named 1ˆ and 2ˆ. ψ\ = α 0 1ˆ, 0 2ˆ]+β 0 1ˆ, 1 2ˆ]+γ 1 1ˆ, 0 2ˆ]+δ 1 1ˆ, 1 2ˆ] α 0 1ˆ, 0 2ˆ]+β 0 1ˆ, 1 2ˆ]+γ 1 1ˆ, 0 2ˆ]+δ 1 1ˆ, 1 2ˆ] An operator can be obtained from the external product of the ket with its corresponding dual:
2 v7tracetranspose.nb mydensityop = Expand@ ψ\ Xψ D α α 0 1ˆ, 0 2ˆ] Y0 1ˆ, 0 2ˆ +β α 0 1ˆ, 1 2ˆ] Y0 1ˆ, 0 2ˆ + γ α 1 1ˆ, 0 2ˆ] Y0 1ˆ, 0 2ˆ +δ α 1 1ˆ, 1 2ˆ] Y0 1ˆ, 0 2ˆ + α β 0 1ˆ, 0 2ˆ] Y0 1ˆ, 1 2ˆ +β β 0 1ˆ, 1 2ˆ] Y0 1ˆ, 1 2ˆ +γ β 1 1ˆ, 0 2ˆ] Y0 1ˆ, 1 2ˆ + δ β 1 1ˆ, 1 2ˆ] Y0 1ˆ, 1 2ˆ +α γ 0 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +β γ 0 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ + γ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +δ γ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ +α δ 0 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ + β δ 0 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ +γ δ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ +δ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ Here is the partial trace of the operator, with respect to the base operator 1ˆ mypartialtrace1 = QuantumPartialTraceBmydensityop, 1ˆF α α 0 2ˆ] Y0 2ˆ +γ γ 0 2ˆ] Y0 2ˆ +β α 1 2ˆ] Y0 2ˆ +δ γ 1 2ˆ] Y0 2ˆ + α β 0 2ˆ] Y1 2ˆ +γ δ 0 2ˆ] Y1 2ˆ +β β 1 2ˆ] Y1 2ˆ +δ δ 1 2ˆ] Y1 2ˆ Here is the partial trace of the operator, with respect to the base operator 2ˆ mypartialtrace2 = QuantumPartialTraceBmydensityop, 2ˆF α α 0 1ˆ] Y0 1ˆ +β β 0 1ˆ] Y0 1ˆ +γ α 1 1ˆ] Y0 1ˆ +δ β 1 1ˆ] Y0 1ˆ + α γ 0 1ˆ] Y1 1ˆ +β δ 0 1ˆ] Y1 1ˆ +γ γ 1 1ˆ] Y1 1ˆ +δ δ 1 1ˆ] Y1 1ˆ Here is the trace of the operator. It is stored in the variable mytrace, in order to use it later in this document: mytrace = QuantumPartialTraceBmydensityop, :1ˆ, 2ˆ>F α α +β β +γ γ +δ δ Partial Transposes Here is the partial transpose of the operator defined above, with respect to the base operator 1ˆ. Partial Transpose is used as a witness of entanglement in Quantum Computing. mypartialtranspose1 = QuantumPartialTransposeBmydensityop, 1ˆF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δ 0 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ + γ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +γ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ +β γ 0 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ + β δ 0 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ +δ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ +δ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ Here is the transpose of the operator. Notice that it is stored in the variable "mytranspose", so that we can use it later in this document: mytranspose = QuantumPartialTransposeBmydensityop, :1ˆ, 2ˆ>F α γ 1 1ˆ, 0 2ˆ] Y0 1ˆ, 0 2ˆ +α δ 1 1ˆ, 1 2ˆ] Y0 1ˆ, 0 2ˆ + β α 0 1ˆ, 0 2ˆ] Y0 1ˆ, 1 2ˆ +β β 0 1ˆ, 1 2ˆ] Y0 1ˆ, 1 2ˆ +β γ 1 1ˆ, 0 2ˆ] Y0 1ˆ, 1 2ˆ + β δ 1 1ˆ, 1 2ˆ] Y0 1ˆ, 1 2ˆ +γ α 0 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +γ β 0 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ + γ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +γ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ +δ α 0 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ + δ β 0 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ +δ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ +δ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ Verifying traces and transposes with Matrix Notation We can transform the operator, which was defined above, from Dirac Notation to standard Mathematica Matrix Notation (list of lists). Therefore, we can take advantage of the built-in Mathematica commands for matrices: mymatrix = DiracToMatrixAmydensityop, 990 1ˆ, 1 1ˆ=, 90 2ˆ, 1 2ˆ==E 88α α, α β, α γ, α δ <, 8β α, β β, β γ, β δ <, 8γ α, γ β, γ γ, γ δ <, 8δ α, δ β, δ γ, δ δ << Here we can visualizar the Matrix in a textbook-like format: MatrixForm@mymatrixD α α α β α γ α δ β α β β β γ β δ γ α γ β γ γ γ δ δ α δ β δ γ δ δ This is the trace of the matrix. We store the result in the variable matrixtrace
4 v7tracetranspose.nb matrixtrace = Tr@mymatrixD α α +β β +γ γ +δ δ The trace "matrixtrace" was obtained by transforming the original Dirac expression to a Matrix, then calculating the trace of the matrix. On the other hand, the trace "mytrace" was obtained by direct application of the command QuantumPartialTrace to the original Dirac expression. As expected, both "matrixtrace" and "mytrace" are the same (notice the use of two equal symbols == in order to make the comparison): matrixtrace mytrace True This is the transpose of the matrix: matrixtranspose = Transpose@mymatrixD 88α α, β α, γ α, δ α <, 8α β, β β, γ β, δ β <, 8α γ, β γ, γ γ, δ γ <, 8α δ, β δ, γ δ, δ δ << The transpose is transformed to Dirac notation secondtranspose = MatrixToDirac@matrixtranspose, 82, 2<D α γ 1 1ˆ, 0 2ˆ] Y0 1ˆ, 0 2ˆ +α δ 1 1ˆ, 1 2ˆ] Y0 1ˆ, 0 2ˆ + β α 0 1ˆ, 0 2ˆ] Y0 1ˆ, 1 2ˆ +β β 0 1ˆ, 1 2ˆ] Y0 1ˆ, 1 2ˆ +β γ 1 1ˆ, 0 2ˆ] Y0 1ˆ, 1 2ˆ + β δ 1 1ˆ, 1 2ˆ] Y0 1ˆ, 1 2ˆ +γ α 0 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +γ β 0 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ + γ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 0 2ˆ +γ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 0 2ˆ +δ α 0 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ + δ β 0 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ +δ γ 1 1ˆ, 0 2ˆ] Y1 1ˆ, 1 2ˆ +δ δ 1 1ˆ, 1 2ˆ] Y1 1ˆ, 1 2ˆ The operator "secondtranspose" was obtained by transforming the original Dirac expression to a Matrix, then calculating the transpose of the matrix, and finally transforming back to Dirac notation. On the other hand, the operartor "mytranspose" was obtained by direct application of the command QuantumPartialTranspose to the original Dirac expression. As expected, both "secondtranspose" and "mytranspose" are the same (notice the use of two equal symbols == in order to make the comparison): secondtranspose mytranspose True
by José Luis Gómez-Muñoz http://homepage.cem.itesm.mx/lgomez/quantum/ jose.luis.gomez@itesm.mx v7tracetranspose.nb 5