Top Banner
Using the Keyboard to Enter Quantum Computing Notation in Mathematica by José Luis Gómez-Muñoz http://homepage.cem.itesm.mx/lgomez/quantum/ [email protected] Introduction This is a tutorial on the use of Quantum`Computing` Mathematica add-on to enter Quantum Computing notation (kets, gates, quantum circuits, etc) in Mathematica. Load the Package First load the Quantum`Computing` package. Write: Needs["Quantum`Computing`"]; then press at the same time the keys ˜-Û to evaluate. Mathematica will load the package and it will printa a welcome message: Needs@"Quantum`Computing`"D Quantum`Computing` Version 2.2.0. HJuly 2010L A Mathematica package for Quantum Computing in Dirac bra-ket notation and plotting of quantum circuits by José Luis Gómez-Muñoz Execute SetComputingAliases@D in order to use the keyboard to enter quantum objects in Dirac's notation SetComputingAliases@D must be executed again in each new notebook that is created In order to use the keyboard to enter quantum objects write: SetComputingAliases[ ]; then press at the same time the keys ˜-Û to evaluate. Mathematica will print a message with all the new keyboard aliases. Remember that SetComputingAliases[ ] must be evaluated again in each new notebook: SetComputingAliases@D
20

Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

Mar 16, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

Using the Keyboard to Enter Quantum Computing

Notation in Mathematica by José Luis Gómez-Muñoz

http://homepage.cem.itesm.mx/lgomez/quantum/

[email protected]

Introduction

This is a tutorial on the use of Quantum`Computing ̀Mathematica add-on to enter Quantum Computing notation (kets, gates,

quantum circuits, etc) in Mathematica.

Load the Package

First load the Quantum`Computing ̀package. Write:

Needs["Quantum`Computing`"];

then press at the same time the keys ˜-Û to evaluate. Mathematica will load the package and it will printa a welcome

message:

Needs@"Quantum`Computing`"D

Quantum`Computing` Version 2.2.0. HJuly 2010LA Mathematica package for Quantum Computing

in Dirac bra−ket notation and plotting of quantum circuits

by José Luis Gómez−Muñoz

Execute SetComputingAliases@D in order to use

the keyboard to enter quantum objects in Dirac's notation

SetComputingAliases@D must be executed again in each new notebook that is created

In order to use the keyboard to enter quantum objects write:

SetComputingAliases[ ];

then press at the same time the keys ˜-Û to evaluate. Mathematica will print a message with all the new keyboard

aliases. Remember that SetComputingAliases[ ] must be evaluated again in each new notebook:

SetComputingAliases@D

Page 2: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

ALIASES:

@ESCDon@ESCD Quantum concatenation symbol

Hoperator application, inner product and outer productL@ESCDqket0@ESCD Ket of qubit 0 template

@ESCDqbra0@ESCD Bra of qubit 0 template

@ESCDqket1@ESCD Ket of qubit 1 template

@ESCDqbra1@ESCD Bra of qubit 1 template

@ESCDqket@ESCD Ket of qubit template

@ESCDqqket@ESCD Ket of two qubits template

@ESCDqqqket@ESCD Ket of three qubits template

@ESCDqbra@ESCD Bra of qubit template

@ESCDqqbra@ESCD Bra of two qubits template

@ESCDqqqbra@ESCD Bra of three qubits template

@ESCDtoqb@ESCD Base−10 Integer to binary qubit template

@ESCDket@ESCD Ket template

@ESCDbra@ESCD Bra template

@ESCDqb@ESCD Qubit template

@ESCDqv@ESCD Qubit−value template

@ESCDqketbra@ESCD Element of a one−qubit operator template

@ESCDqqketbra@ESCD Element of a two−qubits operator template

@ESCDqqqketbra@ESCD Element of a three−qubits operator template

@ESCDk+@ESCD Plus ket Heigenstate of the first Pauli matrixL@ESCDb+@ESCD Plus bra

@ESCDk−@ESCD Minus ket Heigenstate of the first Pauli matrixL@ESCDb−@ESCD Minus bra

@ESCDk00@ESCD Ket of Bell State 00

@ESCDk01@ESCD Ket of Bell State 01

@ESCDk10@ESCD Ket of Bell State 10

@ESCDk11@ESCD Ket of Bell State 11

@ESCDb00@ESCD Bra of Bell State 00

@ESCDb01@ESCD Bra of Bell State 01

@ESCDb10@ESCD Bra of Bell State 10

@ESCDb11@ESCD Bra of Bell State 11

@ESCDkphi+@ESCD Ket of Bell State phi+

@ESCDkpsi+@ESCD Ket of Bell State psi+

@ESCDkphi−@ESCD Ket of Bell State phi−

@ESCDkpsi−@ESCD Ket of Bell State psi−

@ESCDbphi+@ESCD Bra of Bell State phi+

@ESCDbpsi+@ESCD Bra of Bell State psi+

@ESCDbphi−@ESCD Bra of Bell State phi−

@ESCDbpsi−@ESCD Bra of Bell State psi−

@ESCDher@ESCD Hermitian conjugate template

@ESCDcon@ESCD Complex conjugate template

@ESCDnorm@ESCD Quantum norm template

@ESCDtrace@ESCD Partial trace template

@ESCDtp@ESCD Tensor−product symbol

@ESCDtprod@ESCD Tensor−product template

@ESCDtprodqb@ESCD Tensor−product of Qubit template

@ D @ D

2 v7qcaliases.nb

Page 3: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

@ESCDtpow@ESCD Tensor−power template

@ESCDtpowqb@ESCD Tensor−power of Qubit template

@ESCDs0@ESCD 0th−Pauli operator HIdentityL template

@ESCDs1@ESCD 1st−Pauli operator HXL template

@ESCDs2@ESCD 2nd−Pauli operator HYL template

@ESCDs3@ESCD 3rd−Pauli operator HZL template

@ESCDso@ESCD 0th−Pauli operator HIdentityL template

@ESCDsx@ESCD 1st−Pauli operator HXL template

@ESCDsy@ESCD 2nd−Pauli operator HYL template

@ESCDsz@ESCD 3rd−Pauli operator HZL template

@ESCDsp@ESCD General Pauli operator template

@ESCDig@ESCD Identity gate template

@ESCDxg@ESCD Pauli−X gate

@ESCDyg@ESCD Pauli−Y gate

@ESCDzg@ESCD Pauli−Z gate

@ESCDhg@ESCD Haddamard gate

@ESCDpg@ESCD Parametric phase gate

@ESCDsg@ESCD S Phase gate

@ESCDtg@ESCD T πê8 gate

@ESCDswap@ESCD Swap gate

@ESCDcgate@ESCD Controlled−Gate template

@ESCDccgate@ESCD Controlled−controlled−Gate template

@ESCDcccgate@ESCD Controlled−controlled−controlled−Gate template

@ESCDcnot@ESCD Controlled−Not template

@ESCDccnot@ESCD Controlled−controlled−Not template

@ESCDcccnot@ESCD Controlled−controlled−controlled−Not template

@ESCDtoff@ESCD Toffoli gate

@ESCDfred@ESCD Fredkin gate

@ESCDqg@ESCD Quantum gate of one argument

@ESCDqqg@ESCD Quantum gate of one argument applied to two qubits

@ESCDqqqg@ESCD Quantum gate of one argument applied to three qubits

@ESCDqgg@ESCD Quantum gate of two arguments

@ESCDqggg@ESCD Quantum gate of three arguments

@ESCDpqg@ESCD Parametric quantum gate of one argument

@ESCDqr@ESCD Quantum register template

@ESCDqrg@ESCD Quantum−register gate template

SetComputingAliases@D must be executed again in

each new notebook that is created, only one time per notebook.

Entering Quantum Computing Notation

In order to enter a logical zero in the first qubit, press the following keys (Warning: do not type the letter O instead of the

number 0. Do not type the letter I nor the letter l instead of the number 1):

[ESC]qket0[ESC]

then press the [TAB] key in order to select the place-holder Ñ and press:

1

then press at the same time the keys ˜-Û to evaluate:

01ˆ]

01ˆ]

v7qcaliases.nb 3

Page 4: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

Quantum Computing kets can be easily entered. For example, press:

[ESC]k+[ESC][TAB]3

then press at the same time the keys ˜-Û to evaluate:

+3ˆ]

+3ˆ]

The command QuantumEvaluate gives the representation of this ket in terms of the computational basis:

QuantumEvaluateA +3ˆ]E

03ˆ]2

+13ˆ]2

In order to enter the ket of the first Bell state, press the keys:

[ESC]k00[ESC]

then press the [TAB] one or two times in order to select the first place-holder Ñ and press:

1[TAB]2

then press at the same time the keys ˜-Û to evaluate:

���,1

ˆ,2ˆ]

���,1

ˆ,2ˆ]

The command QuantumEvaluate gives the representation of this ket in terms of the computational basis:

QuantumEvaluateA ���,1

ˆ,2ˆ]E

01ˆ, 0

2ˆ]

2

+11ˆ, 1

2ˆ]

2

In order to enter the ket of the first Bell state in the Phi-Psi notation, press the keys:

[ESC]kphi+[ESC]

then press the [TAB] one or two times in order to select the first place-holder Ñ and press:

1[TAB]2

then press at the same time the keys ˜-Û to evaluate:

Φ1ˆ,2ˆ

+ ^

Φ1ˆ,2ˆ

+ ^

The command QuantumEvaluate gives the representation of this ket in terms of the computational basis:

4 v7qcaliases.nb

Page 5: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

QuantumEvaluateB Φ1ˆ,2ˆ

+ ^F

01ˆ, 0

2ˆ]

2

+11ˆ, 1

2ˆ]

2

In order to enter a tensor product of qubits, press the keys:

[ESC]qket0[ESC][ESC]tp[ESC][ESC]qket1[ESC]

then press the [TAB] key one or two times in order to select the first place-holder Ñ and press:

1[TAB]2

(Warning: Do not type the letter O instead of the number 0. Do not type the letter I nor the letter l instead of the number 1)

then press at the same time the keys ˜-Û to evaluate:

01ˆ] ⊗ 1

2ˆ]

01ˆ, 1

2ˆ]

In order to enter the ket of two qubits with logical zero, press the keys:

[ESC]qqket[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

0[TAB]1[TAB]0[TAB]2

then press at the same time the keys ˜-Û to evaluate:

01ˆ, 0

2ˆ]

01ˆ, 0

2ˆ]

In order to enter an internal product, press the keys:

[ESC]qbra0[ESC][ESC]on[ESC][ESC]qket1[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

4[TAB]4

(Notice that in the bra and in the ket the qubit number is the SAME)

then press at the same time the keys ˜-Û to evaluate.

The relative position of the bras, kets and operators determines without any ambiguity if [ESC]on[ESC] is an internal

product, an external product or an operator application.

Y04ˆ ⋅ 1

4ˆ]

0

We can obtain specific information for Quantum Mathematica commands. For example, write:

? QuantumEvaluate

then press at the same time the keys ˜-Û

v7qcaliases.nb 5

Page 6: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

? QuantumEvaluate

QuantumEvaluate@exprD gives Dirac Kets and Bras for expr.Notice that expr is made of quantum gates connected by the quantum product ÿ

In order to enter the quantum product ÿ execute SetComputingAliases@D. Then press:@ESCDon@ESCD Quantum product template

SetComputingAliases@D must be executed again in each new notebook that is created, only one time per notebook.

Here we obtain a matrix element of the Hadamard-Gate operator:

QuantumEvaluate[ [ESC]qbra1[ESC][ESC]on[ESC][ESC]hg[ESC][ESC]on[ESC][ESC]qket1[ESC] ]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

1[TAB]1[TAB]1

then press at the same time the keys ˜-Û to evaluate:

QuantumEvaluateAY11ˆ ⋅ �

1ˆ ⋅ 1

1ˆ]E

−1

2

Here we can see the matrix that corresponds to the Hadamard-Gate.

QuantumMatrixFormA�1ˆE

1

2

1

2

1

2

−1

2

QuantumMatrixForm[] and QuantumTensorForm[] give an output that is adequate for displaying purposes. On the other

hand, for calculation purposes, is better to use QuantumMatrix[] and QuantumTensor[], which give a standard Mathematica

matrix (list) as an output:

QuantumMatrixA�1ˆE

:: 1

2

,1

2

>, : 1

2

, −1

2

>>

The Pauli gates can be entered:

QuantumEvaluate[ [ESC]yg[ESC] ] [TAB]3

then press at the same time the keys ˜-Û to evaluate:

QuantumEvaluateA�3ˆE

� 13ˆ] ⋅ Y0

3ˆ − � 0

3ˆ] ⋅ Y1

This is the tensor form of the operator. Notice that it is assumed that there is only one qubit, eventhogh the label of that qubit

is "3". Below it is explained how to indicate that more qubits also exist:

6 v7qcaliases.nb

Page 7: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

QuantumTensorFormA�3ˆE

K 0 −�

� 0O

Here we use identity gates to obtain a tensor form of the operator acting on the third qubit, taking into account that the first

and second qubits also exist.

QuantumTensorForm[ [ESC]ig[ESC] [ESC]tp[ESC] [ESC]ig[ESC] [ESC]tp[ESC] [ESC]yg[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

1 [TAB]2 [TAB]3

then press at the same time the keys ˜-Û to evaluate.

(NOTE: The template [ESC]tp[ESC] and the template [ESC]on[ESC] give exactly the same result in any calculation. Both of

them mean internal product, external product, operator application, etc. Their precise meaning is given without ambiguity by

the objects before and after them. So you can use [ESC]on[ESC] instead of [ESC]tp[ESC] and viceversa in any calculation)

QuantumTensorFormA�1ˆ ⊗ �

2ˆ ⊗ �

3ˆE

K 0 −�

� 0O K 0 0

0 0O

K 0 0

0 0O K 0 −�

� 0O

K 0 0

0 0O K 0 0

0 0O

K 0 0

0 0O K 0 0

0 0O

K 0 0

0 0O K 0 0

0 0O

K 0 0

0 0O K 0 0

0 0O

K 0 −�

� 0O K 0 0

0 0O

K 0 0

0 0O K 0 −�

� 0O

Another way to specify that qubits 1ˆ

and 2ˆ

exist is using the option QubitList. The arrow Ø can be entered pressing the keys

[ESC]->[ESC]

QuantumTensorFormA�3ˆ, QubitList → 81, 2, 3<E

K 0 −�

� 0O K 0 0

0 0O

K 0 0

0 0O K 0 −�

� 0O

K 0 0

0 0O K 0 0

0 0O

K 0 0

0 0O K 0 0

0 0O

K 0 0

0 0O K 0 0

0 0O

K 0 0

0 0O K 0 0

0 0O

K 0 −�

� 0O K 0 0

0 0O

K 0 0

0 0O K 0 −�

� 0O

In order to print the Truth table for an operator, press the keys:

QuantumTableForm[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

a[TAB]b[TAB]a

then press at the same time the keys ˜-Û to evaluate.

(NOTE: The template [ESC]tp[ESC] and the template [ESC]on[ESC] give exactly the same result in any calculation. Both of

them mean internal product, external product, operator application, etc. Their precise meaning is given without ambiguity by

the objects before and after them. So you can use [ESC]on[ESC] instead of [ESC]tp[ESC] and viceversa in any calculation)

v7qcaliases.nb 7

Page 8: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

QuantumTableFormB�8aˆ<A��

bˆE ⋅ �

aˆF

Input Output

0 0aˆ, 0

bˆ] 0

aˆ,0

bˆ]

2

+1aˆ,1

bˆ]

2

1 0aˆ, 1

bˆ] 0

aˆ,1

bˆ]

2

+1aˆ,0

bˆ]

2

2 1aˆ, 0

bˆ] 0

aˆ,0

bˆ]

2

−1aˆ,1

bˆ]

2

3 1aˆ, 1

bˆ] 0

aˆ,1

bˆ]

2

−1aˆ,0

bˆ]

2

The TraditionalForm representation is closer to the notation used in textbooks and papers:

TraditionalFormBQuantumTableFormB �8aˆ<A��

bˆE ⋅ �

aˆFF

Input Output

0 00\ 00\2

+11\

2

1 01\ 01\2

+10\

2

2 10\ 00\2

-11\

2

3 11\ 01\2

-10\

2

In order to obtain the operator in Dirac notation, press the keys:

QuantumEvaluate[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

a[TAB]b[TAB]a

then press at the same time the keys ˜-Û to evaluate:

QuantumEvaluateB�8aˆ<A��

bˆE ⋅ �

aˆF

0aˆ, 0

bˆ] ⋅ Y0

aˆ, 0

2

+

1aˆ, 1

bˆ] ⋅ Y0

aˆ, 0

2

+

0aˆ, 1

bˆ] ⋅ Y0

aˆ, 1

2

+

1aˆ, 0

bˆ] ⋅ Y0

aˆ, 1

2

+

0aˆ, 0

bˆ] ⋅ Y1

aˆ, 0

2

1aˆ, 1

bˆ] ⋅ Y1

aˆ, 0

2

+

0aˆ, 1

bˆ] ⋅ Y1

aˆ, 1

2

1aˆ, 0

bˆ] ⋅ Y1

aˆ, 1

2

The TraditionalForm representation is closer to the notation used in textbooks and papers:

TraditionalFormBQuantumEvaluateB�8aˆ<A��

bˆE ⋅ �

aˆFF

00\X00

2

+11\X00

2

+01\X01

2

+10\X01

2

+00\X10

2

-11\X10

2

+01\X11

2

-10\X11

2

TeXForm produces a TEX output that can be copy-pasted to a TEX editor:

8 v7qcaliases.nb

Page 9: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

TeXFormBTraditionalFormBQuantumEvaluateB�8aˆ<B��@bˆDF ⋅ �@aˆDFFF

\frac{|00\rangle \langle 00|}{\sqrt{2}}+\frac{|11\rangle \langle

00|}{\sqrt{2}}+\frac{|01\rangle \langle

01|}{\sqrt{2}}+\frac{|10\rangle \langle

01|}{\sqrt{2}}+\frac{|00\rangle \langle

10|}{\sqrt{2}}-\frac{|11\rangle \langle

10|}{\sqrt{2}}+\frac{|01\rangle \langle

11|}{\sqrt{2}}-\frac{|10\rangle \langle 11|}{\sqrt{2}}

In order to obtain the operator in Pauli operators, press the keys:

PauliExpand[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

a[TAB]b[TAB]a

then press at the same time the keys ˜-Û to evaluate:

PauliExpandB�8aˆ<A��

bˆE ⋅ �

aˆF

σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

+

σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

+

� σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

+

σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

+

σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

� σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

+

σ�,a

ˆ ⋅ σ�,b

ˆ

2 2

The TraditionalForm representation is closer to the notation used in textbooks and papers:

TraditionalFormBPauliExpandB�8aˆ<A��

bˆE ⋅ �

aˆFF

-Â sa

�sb

2 2

+sa�s

b

2 2

+sa�s

b

2 2

-sa�sb

2 2

+sa�s

b

2 2

+Â sa

�sb

2 2

+sa�s

b

2 2

+sa�sb

2 2

TeXForm produces a TEX output that can be copy-pasted to a TEX editor:

TeXFormBTraditionalFormBPauliExpandB�8aˆ<A��

bˆE ⋅ �

aˆFFF

-\frac{i \sigma _a^{\mathcal{Y}}\sigma _b^{\mathcal{X}}}{2

\sqrt{2}}+\frac{\sigma _a^{\mathcal{Z}}\sigma

_b^{\mathcal{X}}}{2 \sqrt{2}}+\frac{\sigma

_a^{\mathcal{X}}\sigma _b^{\mathit{0}}}{2

\sqrt{2}}-\frac{\sigma _a^{\mathit{0}}\sigma

_b^{\mathcal{X}}}{2 \sqrt{2}}+\frac{\sigma

_a^{\mathcal{X}}\sigma _b^{\mathcal{X}}}{2 \sqrt{2}}+\frac{i

\sigma _a^{\mathcal{Y}}\sigma _b^{\mathit{0}}}{2

\sqrt{2}}+\frac{\sigma _a^{\mathcal{Z}}\sigma

_b^{\mathit{0}}}{2 \sqrt{2}}+\frac{\sigma _a^{\mathit{0}}\sigma

_b^{\mathit{0}}}{2 \sqrt{2}}

v7qcaliases.nb 9

Page 10: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

In order to see the circuit operator in Tensor notation, press the keys:

QuantumTensorForm[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

a[TAB]b[TAB]a

then press at the same time the keys ˜-Û to evaluate:

QuantumTensorFormB�8aˆ<A��

bˆE ⋅ �

aˆF

1

2

0

01

2

1

2

0

01

2

01

2

1

2

0

0 −1

2

−1

2

0

Remember that for actual Mathematica calculations QuantumTensor[] must be used instead of QuantumTensorForm[]:

QuantumTensorB�8aˆ<A��

bˆE ⋅ �

aˆF

:::: 1

2

, 0>, :0, 1

2

>>, :: 1

2

, 0>, :0, 1

2

>>>,

:::0, 1

2

>, : 1

2

, 0>>, ::0, −1

2

>, :− 1

2

, 0>>>>

In order to see the circuit operator in Matrix notation, press the keys:

QuantumMatrixForm[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

a[TAB]b[TAB]a

then press at the same time the keys ˜-Û to evaluate:

QuantumMatrixFormB�8aˆ<A��

bˆE ⋅ �

aˆF

1

2

01

2

0

01

2

01

2

01

2

0 −1

2

1

2

0 −1

2

0

Remember that for actual Mathematica calculations QuantumMatrix[] must be used instead of QuantumMatrixForm[]:

QuantumMatrixB�8aˆ<A��

bˆE ⋅ �

aˆF

:: 1

2

, 0,1

2

, 0>, :0, 1

2

, 0,1

2

>, :0, 1

2

, 0, −1

2

>, : 1

2

, 0, −1

2

, 0>>

10 v7qcaliases.nb

Page 11: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

In order to generate a Bell state from a state of two qubits with logical zero, press the keys:

QuantumEvaluate[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC][ESC]on[ESC][ESC]qqket[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

1[TAB]2[TAB]1[TAB]0[TAB]1[TAB]0[TAB]2

then press at the same time the keys ˜-Û to evaluate:

QuantumEvaluateB�81ˆ<A��

2ˆE ⋅ �

1ˆ ⋅ 0

1ˆ, 0

2ˆ]F

01ˆ, 0

2ˆ]

2

+11ˆ, 1

2ˆ]

2

In order to plot the quantum circuit, press the keys:

QuantumPlot[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC][ESC]on[ESC][ESC]qqket[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

1[TAB]2[TAB]1[TAB]0[TAB]1[TAB]0[TAB]2

then press at the same time the keys ˜-Û to evaluate:

QuantumPlotB�81ˆ<A��

2ˆE ⋅ �

1ˆ ⋅ 0

1ˆ, 0

2ˆ]F

1

2

0\

0\

In order to plot in 3D the quantum circuit, press the keys:

QuantumPlot3D[ [ESC]cnot[ESC][ESC]on[ESC][ESC]hg[ESC][ESC]on[ESC][ESC]qqket[ESC] ]

Then press the [TAB] key several times to select the first "place holder" Ñ, and press the keys:

1[TAB]2[TAB]1[TAB]0[TAB]1[TAB]0[TAB]2

then press at the same time the keys ˜-Û to evaluate:

QuantumPlot3DB�81ˆ<A��

2ˆE ⋅ �

1ˆ ⋅ 0

1ˆ, 0

2ˆ]F

v7qcaliases.nb 11

Page 12: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

In order to enter the tensor product of a quantum expression, press the keys:

[ESC]tprod[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

j[TAB]1[TAB]3[TAB]

Then press the keys:

[ESC]cnot[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

j [TAB] j+1

then press at the same time the keys ˜-Û to evaluate:

⊗j=1

3

�8jˆ<B��

j+1ˆ F

�81ˆ<A��

2ˆE ⋅ �

82ˆ<A��3ˆE ⋅ �

83ˆ<A��4ˆE

In order to plot the circuit of a tensor product of a quantum expression, press the keys:

QuantumPlot[ [ESC]tprod[ESC] ]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

j[TAB]1[TAB]3[TAB]

Then press the keys:

[ESC]cnot[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

j [TAB] j+1

then press at the same time the keys ˜-Û to evaluate:

QuantumPlotB⊗j=1

3

�8jˆ<B��

j+1ˆ FF

1

2

3

4

12 v7qcaliases.nb

Page 13: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

In order to plot in 3D the circuit of a tensor product of a quantum expression, press the keys:

QuantumPlot3D[ [ESC]tprod[ESC] ]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

j[TAB]1[TAB]3[TAB]

Then press the keys:

[ESC]cnot[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

j [TAB] j+1

then press at the same time the keys ˜-Û to evaluate:

QuantumPlot3DB⊗j=1

3

�8jˆ<B��

j+1ˆ FF

The same tensor product can be entered as a "tensor power". Press the keys:

QuantumPlot[ [ESC]tpow[ESC] ]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

[ESC]cnot[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

1[TAB]2[TAB]3

then press at the same time the keys ˜-Û to evaluate:

QuantumPlotBJ�81ˆ<A��

2ˆEN⊗3F

1

2

3

4

v7qcaliases.nb 13

Page 14: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

On the other hand, a "normal power" is very different from a "tensor power". Press the keys:

QuantumPlot[ [ESC]po[ESC] , QuantumGatePowers[ESC]->[ESC]False ]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

[ESC]cnot[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

1[TAB]2[TAB]3

then press at the same time the keys ˜-Û to evaluate:

QuantumPlotBJ�81ˆ<A��

2ˆEN

3

, QuantumGatePowers → FalseF

1

2

This is a more elaborated circuit. Notice how the syntaxis indicates if a gate is before or after the measuring meters. Press

[ESC]cgate[ESC] for the controlled-gate template �8ˆ<@D; [ESC]cnot[ESC] for the control-not template �8ˆ<A��@ˆDE;

[ESC]xg[ESC] for the �@ˆD template, etc.

QuantumPlotB�81ˆ<A

3ˆE ⋅ �

82ˆ<A�3ˆE ⋅ QubitMeasurementB�

1ˆ ⋅ �

81ˆ<A��2ˆE, :1ˆ, 2

ˆ>FF

1

2

3

� �

Plot of the same circuit, now applied to the initial ket ���,2

ˆ,3ˆ] ⊗ Ia 0

1ˆ] + b 1

1ˆ]M

QuantumPlotB�81ˆ<A

3ˆE ⋅ �

82ˆ<A�3ˆE ⋅

QubitMeasurementB�1ˆ ⋅ �

81ˆ<A��2ˆE ⋅ �

��,2ˆ,3ˆ] ⊗ Ia 0

1ˆ] + b 1

1ˆ]M, :1ˆ, 2

ˆ>FF

1

2

3

� �

14 v7qcaliases.nb

Page 15: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

Evaluation of the same circuit, applied to the initial ket ���,2

ˆ,3ˆ] ⊗ Ia 0

1ˆ] + b 1

1ˆ]M. Notice that all possible

outputs have the 3rd qubit in the combination a 03ˆ] + b 1

3ˆ], therefore this circuit "teleports" (cuts and pastes) the

initial state from qubit 1ˆ

(which initially is a 01ˆ] + b 1

1ˆ]) to the qubit 3

ˆ (which finally becomes

a 03ˆ] + b 1

3ˆ])

QuantumEvaluateB�81ˆ<A

3ˆE ⋅ �

82ˆ<A�3ˆE ⋅

QubitMeasurementB�1ˆ ⋅ �

81ˆ<A��2ˆE ⋅ �

��,2ˆ,3ˆ] ⊗ Ia 0

1ˆ] + b 1

1ˆ]M, :1ˆ, 2

ˆ>FF

Probability Measurement State

1

4990

1ˆ, 0

2ˆ== 0

1ˆ] ⊗ 0

2ˆ] ⊗

a 03ˆ]

a a∗+b b∗+

b 13ˆ]

a a∗+b b∗

1

4990

1ˆ, 1

2ˆ== 0

1ˆ] ⊗ 1

2ˆ] ⊗

a 03ˆ]

a a∗+b b∗+

b 13ˆ]

a a∗+b b∗

1

4991

1ˆ, 0

2ˆ== 1

1ˆ] ⊗ 0

2ˆ] ⊗

a 03ˆ]

a a∗+b b∗+

b 13ˆ]

a a∗+b b∗

1

4991

1ˆ, 1

2ˆ== 1

1ˆ] ⊗ 1

2ˆ] ⊗

a 03ˆ]

a a∗+b b∗+

b 13ˆ]

a a∗+b b∗

Probability Measurement State

In order to represent a 9 as a binary number made of 5 qubits, press the keys:

[ESC]toqb[ESC] [TAB] 9 [TAB] 5

then press at the same time the keys ˜-Û to evaluate:

9\5

01ˆ, 1

2ˆ, 0

3ˆ, 0

4ˆ, 1

5ˆ]

This is a normalized, equally-weighted, linear combination of the computational basis kets for three qubits. Press

[ESC]si[ESC] for the sigma notation template ⁄

1

8

‚j=0

7

j\3

1

2 2

I 01ˆ, 0

2ˆ, 0

3ˆ] + 0

1ˆ, 0

2ˆ, 1

3ˆ] + 0

1ˆ, 1

2ˆ, 0

3ˆ] + 0

1ˆ,

12ˆ, 1

3ˆ] + 1

1ˆ, 0

2ˆ, 0

3ˆ] + 1

1ˆ, 0

2ˆ, 1

3ˆ] + 1

1ˆ, 1

2ˆ, 0

3ˆ] + 1

1ˆ, 1

2ˆ, 1

3ˆ]M

Here we calculate the norm. Press [ESC]norm[ESC] for the norm template ∞¥

1

8

‚j=0

7

j\3

1

This is a normalized, equally-weighted, linear combination of the computational basis kets for four qubits:

v7qcaliases.nb 15

Page 16: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

n = 24;

1

n

‚j=0

n−1

j\Log@2,nD

1

4I 0

1ˆ, 0

2ˆ, 0

3ˆ, 0

4ˆ] + 0

1ˆ, 0

2ˆ, 0

3ˆ, 1

4ˆ] + 0

1ˆ, 0

2ˆ, 1

3ˆ, 0

4ˆ] + 0

1ˆ, 0

2ˆ, 1

3ˆ, 1

4ˆ] +

01ˆ, 1

2ˆ, 0

3ˆ, 0

4ˆ] + 0

1ˆ, 1

2ˆ, 0

3ˆ, 1

4ˆ] + 0

1ˆ, 1

2ˆ, 1

3ˆ, 0

4ˆ] + 0

1ˆ, 1

2ˆ, 1

3ˆ, 1

4ˆ] +

11ˆ, 0

2ˆ, 0

3ˆ, 0

4ˆ] + 1

1ˆ, 0

2ˆ, 0

3ˆ, 1

4ˆ] + 1

1ˆ, 0

2ˆ, 1

3ˆ, 0

4ˆ] + 1

1ˆ, 0

2ˆ, 1

3ˆ, 1

4ˆ] +

11ˆ, 1

2ˆ, 0

3ˆ, 0

4ˆ] + 1

1ˆ, 1

2ˆ, 0

3ˆ, 1

4ˆ] + 1

1ˆ, 1

2ˆ, 1

3ˆ, 0

4ˆ] + 1

1ˆ, 1

2ˆ, 1

3ˆ, 1

4ˆ]M

In order to save the definition of a ket, press the keys:

[ESC]ket[ESC] = a [ESC]qket[ESC] +b [ESC]qket[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

[ESC]psi[ESC][TAB]0[TAB]1[TAB]1[TAB]1

then press at the same time the keys ˜-Û to evaluate:

ψ\ = a 01ˆ] + b 1

1ˆ]

a 01ˆ] + b 1

1ˆ]

The correspondig bra can be used:

[ESC]bra[ESC] [TAB] [ESC]psi[ESC]

then press at the same time the keys ˜-Û to evaluate:

a∗ Y01ˆ + b∗ Y1

An external product can be calculated from the ket that was defined. Press the keys:

Expand[ [ESC]ket[ESC] [ESC]on[ESC] [ESC]bra[ESC] ]

then press the keys:

[TAB] [ESC]psi[ESC] [TAB] [ESC]psi[ESC]

then press at the same time the keys ˜-Û to evaluate:

Expand@ ψ\ ⋅ Xψ D

a a∗ 01ˆ] ⋅ Y0

1ˆ + b a∗ 1

1ˆ] ⋅ Y0

1ˆ + a b∗ 0

1ˆ] ⋅ Y1

1ˆ + b b∗ 1

1ˆ] ⋅ Y1

An internal product can be calculated from the ket that was defined. Press the keys:

[ESC]bra[ESC] [ESC]on[ESC] [ESC]ket[ESC] [TAB] [ESC]psi[ESC] [TAB] [ESC]psi[ESC]

then press at the same time the keys ˜-Û to evaluate:

Xψ ⋅ ψ\

a a∗ + b b∗

16 v7qcaliases.nb

Page 17: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

The norm of a quantum expression can be calculated. Press the keys:

[ESC]norm[ESC] [TAB] [ESC]ket[ESC] [TAB] [ESC]psi[ESC]

then press at the same time the keys ˜-Û to evaluate:

∞ ψ\¥

a a∗ + b b∗

Advanced Mathematica technical info: The definition is stored as an "upvalue" of psi y

? [ESC]psi[ESC]

then press at the same time the keys ˜-Û to evaluate:

? ψ

Global`ψ

ψ\ ^= a 01ˆ] + b 1

1ˆ]

In order to save the definition of another ket, press the keys:

[ESC]ket[ESC] = x [ESC]qket[ESC] +y [ESC]qket[ESC]

Then press the [TAB] key one or more times to select the first "place holder" Ñ, and press the keys:

[ESC]x[ESC][TAB]0[TAB]1[TAB]1[TAB]1

then press at the same time the keys ˜-Û to evaluate:

ξ\ = x 01ˆ] + y 1

1ˆ]

x 01ˆ] + y 1

1ˆ]

Different operations can be performed on the kets that were defined, and the results (output) of those operations are valid

Mathematica expressions that can be copy-pasted and used as part of Mathematica input in other commands:

Xξ ⋅ ψ\

a x∗ + b y∗

Different operations can be performed on the kets that were defined, and the results (output) of those operations are valid

Mathematica expressions that can be copy-pasted and used as part of Mathematica input in other commands:

Expand@ ξ\ ⋅ Xψ D

x a∗ 01ˆ] ⋅ Y0

1ˆ + y a∗ 1

1ˆ] ⋅ Y0

1ˆ + x b∗ 0

1ˆ] ⋅ Y1

1ˆ + y b∗ 1

1ˆ] ⋅ Y1

A "Power" can be entered pressing [ESC]po[ESC]

v7qcaliases.nb 17

Page 18: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

ExpandAH ξ\ ⋅ Xψ L2E

x2 Ha∗L2 01ˆ] ⋅ Y0

1ˆ + x y a∗ b∗ 0

1ˆ] ⋅ Y0

1ˆ + x y Ha∗L2 1

1ˆ] ⋅ Y0

1ˆ + y2 a∗ b∗ 1

1ˆ] ⋅ Y0

1ˆ +

x2 a∗ b∗ 01ˆ] ⋅ Y1

1ˆ + x y Hb∗L2 0

1ˆ] ⋅ Y1

1ˆ + x y a∗ b∗ 1

1ˆ] ⋅ Y1

1ˆ + y2 Hb∗L2 1

1ˆ] ⋅ Y1

A "Tensor Power" HL⊗ is very different from a "Power" HL

In a TensorPower, the same expression is evaluated at different qubits

The "Tensor Power" can be entered by pressing [ESC]tpow[ESC]

ExpandBH ξ\ ⋅ Xψ L⊗2F

x2 Ha∗L2 01ˆ, 0

2ˆ] ⋅ Y0

1ˆ, 0

2ˆ + x y Ha∗L2 0

1ˆ, 1

2ˆ] ⋅ Y0

1ˆ, 0

2ˆ +

x y Ha∗L2 11ˆ, 0

2ˆ] ⋅ Y0

1ˆ, 0

2ˆ + y2 Ha∗L2 1

1ˆ, 1

2ˆ] ⋅ Y0

1ˆ, 0

2ˆ +

x2 a∗ b∗ 01ˆ, 0

2ˆ] ⋅ Y0

1ˆ, 1

2ˆ + x y a∗ b∗ 0

1ˆ, 1

2ˆ] ⋅ Y0

1ˆ, 1

2ˆ + x y a∗ b∗ 1

1ˆ, 0

2ˆ] ⋅ Y0

1ˆ, 1

2ˆ +

y2 a∗ b∗ 11ˆ, 1

2ˆ] ⋅ Y0

1ˆ, 1

2ˆ + x2 a∗ b∗ 0

1ˆ, 0

2ˆ] ⋅ Y1

1ˆ, 0

2ˆ + x y a∗ b∗ 0

1ˆ, 1

2ˆ] ⋅ Y1

1ˆ, 0

2ˆ +

x y a∗ b∗ 11ˆ, 0

2ˆ] ⋅ Y1

1ˆ, 0

2ˆ + y2 a∗ b∗ 1

1ˆ, 1

2ˆ] ⋅ Y1

1ˆ, 0

2ˆ + x2 Hb∗L2 0

1ˆ, 0

2ˆ] ⋅ Y1

1ˆ, 1

2ˆ +

x y Hb∗L2 01ˆ, 1

2ˆ] ⋅ Y1

1ˆ, 1

2ˆ + x y Hb∗L2 1

1ˆ, 0

2ˆ] ⋅ Y1

1ˆ, 1

2ˆ + y2 Hb∗L2 1

1ˆ, 1

2ˆ] ⋅ Y1

1ˆ, 1

Partial trace template: [ESC]trace[ESC]

Tensor power template: [ESC]tpow[ESC]

Tr2ˆBH ξ\ ⋅ Xψ L⊗2F

x Ix Ha∗L2 01ˆ] ⋅ Y0

1ˆ + y Ha∗L2 1

1ˆ] ⋅ Y0

1ˆ + x a∗ b∗ 0

1ˆ] ⋅ Y1

1ˆ + y a∗ b∗ 1

1ˆ] ⋅ Y1

1ˆ M +

y Ix a∗ b∗ 01ˆ] ⋅ Y0

1ˆ + y a∗ b∗ 1

1ˆ] ⋅ Y0

1ˆ + x Hb∗L2 0

1ˆ] ⋅ Y1

1ˆ + y Hb∗L2 1

1ˆ] ⋅ Y1

1ˆ M

Partial trace template: [ESC]trace[ESC]

Tensor power template: [ESC]tpow[ESC]

ExpandBTr2ˆBH ξ\ ⋅ Xψ L⊗2FF

x2 Ha∗L2 01ˆ] ⋅ Y0

1ˆ + x y a∗ b∗ 0

1ˆ] ⋅ Y0

1ˆ + x y Ha∗L2 1

1ˆ] ⋅ Y0

1ˆ + y2 a∗ b∗ 1

1ˆ] ⋅ Y0

1ˆ +

x2 a∗ b∗ 01ˆ] ⋅ Y1

1ˆ + x y Hb∗L2 0

1ˆ] ⋅ Y1

1ˆ + x y a∗ b∗ 1

1ˆ] ⋅ Y1

1ˆ + y2 Hb∗L2 1

1ˆ] ⋅ Y1

Partial trace template: [ESC]trace[ESC]

Tensor power template: [ESC]tpow[ESC]

TraditionalFormBExpandBTr2ˆBH ξ\ ⋅ Xψ L⊗2FFF

x2 a� b� 0\X1 + x y a� b� 0\X0 + x y a� b� 1\X1 + y2 a� b� 1\X0 +

x2 Ia�M2 0\X0 + x y Ia�M2 1\X0 + x y Ib�M2 0\X1 + y2 Ib�M2 1\X1

Partial trace template: [ESC]trace[ESC]

Tensor power template: [ESC]tpow[ESC]

18 v7qcaliases.nb

Page 19: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

Tr2ˆBH ξ\ ⋅ Xψ L⊗2F ⋅ 0

1ˆ, 0

3ˆ]

x Ix Ha∗L2 01ˆ, 0

3ˆ] + y Ha∗L2 1

1ˆ, 0

3ˆ]M + y Ix a∗ b∗ 0

1ˆ, 0

3ˆ] + y a∗ b∗ 1

1ˆ, 0

3ˆ]M

The standard Mathematica command Simplify[] can be used:

SimplifyBTr2ˆBH ξ\ ⋅ Xψ L⊗2F ⋅ 0

1ˆ, 0

3ˆ]F

a∗ Hx a∗ + y b∗L Ix 01ˆ, 0

3ˆ] + y 1

1ˆ, 0

3ˆ]M

Press [ESC]her[ESC] for the Hermitian conjugate template HL†

H ψ\L†

a∗ Y01ˆ + b∗ Y1

Press [ESC]her[ESC] for the Hermitian conjugate template HL† and [ESC]tg[ESC] for the ˆ template

I1ˆM†

1ˆ†

Press [ESC]her[ESC] for the Hermitian conjugate template HL† and [ESC]tg[ESC] for the ˆ template

PauliExpandAI1ˆM†E

1

4J2 + H1 − �L 2 N σ

�,1ˆ +

1

4J2 − H1 − �L 2 N σ

�,1ˆ

TraditionalForm:

TraditionalFormAPauliExpandAI1ˆM†EE

1

4K2 - H1 - ÂL 2 Os1

� +1

4K2 + H1 - ÂL 2 Os1

Press [ESC]qqft[ESC] for the template of the two-qubits Quantum Fourier Transform �ˆ,ˆ

v7qcaliases.nb 19

Page 20: Using the Keyboard to Enter Quantum Computing Notation in Mathematicahomepage.cem.itesm.mx/lgomez/quantum/v7qcaliases.pdf · 2010. 7. 5. · @ESC Dket @ESC D Ket template @ESC Dbra

QuantumTableFormA� 1ˆ,2ˆE

Input Output

0 01ˆ, 0

2ˆ] 0.5 0

1ˆ, 0

2ˆ] + 0.5 0

1ˆ, 1

2ˆ] + 0.5 1

1ˆ, 0

2ˆ] + 0.5 1

1ˆ, 1

2ˆ]

1 01ˆ, 1

2ˆ] 0.5 0

1ˆ, 0

2ˆ] + 0.5 � 0

1ˆ, 1

2ˆ] − 0.5 1

1ˆ, 0

2ˆ] − 0.5 � 1

1ˆ, 1

2ˆ]

2 11ˆ, 0

2ˆ] 0.5 0

1ˆ, 0

2ˆ] − 0.5 0

1ˆ, 1

2ˆ] + 0.5 1

1ˆ, 0

2ˆ] − 0.5 1

1ˆ, 1

2ˆ]

3 11ˆ, 1

2ˆ] 0.5 0

1ˆ, 0

2ˆ] − 0.5 � 0

1ˆ, 1

2ˆ] − 0.5 1

1ˆ, 0

2ˆ] + 0.5 � 1

1ˆ, 1

2ˆ]

Press [ESC]qqqft[ESC] for the template of the three-qubits Quantum Fourier Transform �ˆ,ˆ,ˆ

QuantumEvaluateA� aˆ,bˆ,cˆ ⋅ 1

aˆ, 0

bˆ, 1

cˆ]E

0.353553 0aˆ, 0

bˆ, 0

cˆ] − H0.25 + 0.25 �L 0

aˆ, 0

bˆ, 1

cˆ] +

0.353553 � 0aˆ, 1

bˆ, 0

cˆ] + H0.25 − 0.25 �L 0

aˆ, 1

bˆ, 1

cˆ] − 0.353553 1

aˆ, 0

bˆ, 0

cˆ] +

H0.25 + 0.25 �L 1aˆ, 0

bˆ, 1

cˆ] − 0.353553 � 1

aˆ, 1

bˆ, 0

cˆ] − H0.25 − 0.25 �L 1

aˆ, 1

bˆ, 1

cˆ]

Press [ESC]qqqft[ESC] for the template of the three-qubits Quantum Fourier Transform �ˆ,ˆ,ˆ

Scroll to the right in order to see the complete answer

TraditionalFormAQuantumTableFormA� aˆ,bˆ,cˆEE

Input Output

0 000\ 0.353553 000\ + 0.353553 001\ + 0.353553 010\ + 0.353553 011\ + 0.353553 100\ + 0.353553 10

1 001\ 0.353553 000\ + H0.25 + 0.25 ÂL 001\ + 0.353553 Â 010\ - H0.25 - 0.25 ÂL 011\ - 0.353553 100\ - H0.25

2 010\ 0.353553 000\ + 0.353553 Â 001\ - 0.353553 010\ - 0.353553 Â 011\ + 0.353553 100\ + 0.353553 Â

3 011\ 0.353553 000\ - H0.25 - 0.25 ÂL 001\ - 0.353553 Â 010\ + H0.25 + 0.25 ÂL 011\ - 0.353553 100\ + H0.25

4 100\ 0.353553 000\ - 0.353553 001\ + 0.353553 010\ - 0.353553 011\ + 0.353553 100\ - 0.353553 10

5 101\ 0.353553 000\ - H0.25 + 0.25 ÂL 001\ + 0.353553 Â 010\ + H0.25 - 0.25 ÂL 011\ - 0.353553 100\ + H0.25

6 110\ 0.353553 000\ - 0.353553 Â 001\ - 0.353553 010\ + 0.353553 Â 011\ + 0.353553 100\ - 0.353553 Â

7 111\ 0.353553 000\ + H0.25 - 0.25 ÂL 001\ - 0.353553 Â 010\ - H0.25 + 0.25 ÂL 011\ - 0.353553 100\ - H0.25

by José Luis Gómez-Muñoz

http://homepage.cem.itesm.mx/lgomez/quantum/

[email protected]

20 v7qcaliases.nb