Sie sind auf Seite 1von 9

Needs"Quantum`Notation`"

Quantum`Notation` Version 2.2.0. (July 2010)


A Mathematica package for Quantum calculations in Dirac braket notation
by Jos Luis GmezMuoz
Execute SetQuantumAliases[] in order to use
the keyboard to enter quantum objects in Dirac's notation
SetQuantumAliases[] must be executed again in each new
notebook that is created, only one time per notebook.
Here we define the basis states
ket0 1, 0; ket0 ket0; MatrixFormket0
ket1 0, 1; ket1 ket1; MatrixFormket1

1
0

0
1

With these basis vectors we define EPR
ij

ketEPR 1 Sqrt2 KroneckerProductket0, ket1 KroneckerProductket1, ket0;
MatrixFormketEPR
0
1
2

1
2
0
Now we create the state ketEPR
01
ketEPR
23
. So this
is our system which has to be measured with bell operator
Printed by Mathematica for Students
ketEPR
0123
KroneckerProductketEPR , ketEPR
ketEPR
0123
TransposeketEPR
0123

ketEPR
0123
NormalizeketEPR
0123
1
ketEPR
0123
TransposeketEPR
0123

MatrixFormketEPR
0123

{0], {0], {0], {0], {0],


1
2
,
1
2
, {0], {0],
1
2
,
1
2
, {0], {0], {0], {0], {0]
0, 0, 0, 0, 0,
1
2
,
1
2
, 0, 0,
1
2
,
1
2
, 0, 0, 0, 0, 0
0, 0, 0, 0, 0,
1
2
,
1
2
, 0, 0,
1
2
,
1
2
, 0, 0, 0, 0, 0
{0], {0], {0], {0], {0],
1
2
,
1
2
, {0], {0],
1
2
,
1
2
, {0], {0], {0], {0], {0]
0
0
0
0
0
1
2

1
2
0
0

1
2
1
2
0
0
0
0
0
Let's define the bell measurement operator.
bellOperator 1 Sqrt2 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1;
MatrixFormbellOperator
1
2
0 0
1
2
0
1
2

1
2
0
0
1
2
1
2
0
1
2
0 0
1
2
Our system consists of four bits. And we are going to measure the middle two bits.
fourBitOperator I bellOperator I
2 e nt angle m e nt - re s e arch. nb
Printed by Mathematica for Students
fourBitOperator KroneckerProductIdentityMatrix2,
KroneckerProductbellOperator, IdentityMatrix2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0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
{0, 0, , 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], {0, 0, 0, 0, 0, 0, 0, 0, 0, , 0, 0, 0, 0, 0, 1],
{0, 0, 0, 0, 0, 0, 0, 0, , 0, 0, 0, 0, 0, 1, 0], {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, , 0, 1, 0, 0],
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, , 0, 1, 0, 0, 0], {0, , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
{, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], {0, 0, 0, , 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
{0, 0, , 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
So, we got two eigenvalues each consists of eight eigenvectors.
Let us store the eigen vectors in a seperate variable.
e nt angle m e nt - re s e arch. nb 3
Printed by Mathematica for Students
V ES2; MatrixFormV
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
Then assign each vector to an individual variable.
4 e nt angle m e nt - re s e arch. nb
Printed by Mathematica for Students
VP V1, 2, 3, 4, 5, 6, 7, 8; OrthogonalizeVP
VM V9, 10, 11, 12, 13, 14, 15, 16; OrthogonalizeVM
0, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0, 0, 0, 0, 0,
1
2
,
0, 0, 0, 0, 0, 0, 0, 0,

2
, 0, 0, 0, 0, 0,
1
2
, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0,
1
2
, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0,
1
2
, 0, 0, 0,
0,

2
, 0, 0, 0, 0, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0,


2
, 0, 0, 0, 0, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,

2
, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,

2
, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0, 0, 0, 0, 0,
1
2
,
0, 0, 0, 0, 0, 0, 0, 0,

2
, 0, 0, 0, 0, 0,
1
2
, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0,
1
2
, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0,
1
2
, 0, 0, 0,
0,

2
, 0, 0, 0, 0, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0,

2
, 0, 0, 0, 0, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,

2
, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,

2
, 0,
1
2
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
e nt angle m e nt - re s e arch. nb 5
Printed by Mathematica for Students
ketP1 TransposeVP1;
ketP2 TransposeVP2;
ketP3 TransposeVP3;
ketP4 TransposeVP4;
ketP5 TransposeVP5;
ketP6 TransposeVP6;
ketP7 TransposeVP7;
ketP8 TransposeVP8;
ketM1 TransposeVM1;
ketM2 TransposeVM2;
ketM3 TransposeVM3;
ketM4 TransposeVM4;
ketM5 TransposeVM5;
ketM6 TransposeVM6;
ketM7 TransposeVM7;
ketM8 TransposeVM8;
braP1 ketP1;
braP2 ketP2;
braP3 ketP3;
braP4 ketP4;
braP5 ketP5;
braP6 ketP6;
braP7 ketP7;
braP8 ketP8;
braM1 ketM1;
braM2 ketM2;
braM3 ketM3;
braM4 ketM4;
braM5 ketM5;
braM6 ketM6;
braM7 ketM7;
braM8 ketM8;
Caltulating the projectors.
6 e nt angle m e nt - re s e arch. nb
Printed by Mathematica for Students
PP1 ketP1.braP1; MatrixFormPP1;
PP2 ketP2.braP2; MatrixFormPP2;
PP3 ketP3.braP3; MatrixFormPP3;
PP4 ketP4.braP4; MatrixFormPP4;
PP5 ketP5.braP5; MatrixFormPP5;
PP6 ketP6.braP6; MatrixFormPP6;
PP7 ketP7.braP7; MatrixFormPP7;
PP8 ketP8.braP8; MatrixFormPP8;
PM1 ketM1.braM1; MatrixFormPM1;
PM2 ketM2.braM2; MatrixFormPM2;
PM3 ketM3.braM3; MatrixFormPM3;
PM4 ketM4.braM4; MatrixFormPM4;
PM5 ketM5.braM5; MatrixFormPM5;
PM6 ketM6.braM6; MatrixFormPM6;
PM7 ketM7.braM7; MatrixFormPM7;
PM8 ketM8.braM8; MatrixFormPM8;
PP PP1 PP2 PP3 PP4 PP5 PP6 PP7 PP8; MatrixFormPP
PM PM1 PM2 PM3 PM4 PM5 PM6 PM7 PM8; MatrixFormPM
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Here we validate whether our projectors are correct.
e nt angle m e nt - re s e arch. nb 7
Printed by Mathematica for Students
PP.PP PP
PM.PM PM
PP.PM DiagonalMatrix0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
fourBitOperator
1
2
PP
1
2
PM
PP PM DiagonalMatrix1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
False
False
True
False
False
Now we calculate the bra of the system
braEPR
0123
ketEPR
0123
; MatrixFormbraEPR
0123

0 0 0 0 0
1
2

1
2
0 0
1
2
1
2
0 0 0 0 0
pm ExpandbraEPR
0123
.PM.ketEPR
0123
11
pp ExpandbraEPR
0123
.PP.ketEPR
0123
11
1
1
8 e nt angle m e nt - re s e arch. nb
Printed by Mathematica for Students
ketEPRP MapSimplify, TransposeNormalizeTransposePP.ketEPR
0123
1;
MatrixFormketEPRP
ketEPRM MapSimplify, TransposeNormalizeTransposePM.ketEPR
0123
1;
MatrixFormketEPRM


2 2
0
0

2 2
0
1
2 2

1
2 2
0
0

1
2 2
1
2 2
0


2 2
0
0

2 2

2 2
0
0


2 2
0
1
2 2

1
2 2
0
0

1
2 2
1
2 2
0

2 2
0
0


2 2
e nt angle m e nt - re s e arch. nb 9
Printed by Mathematica for Students

Das könnte Ihnen auch gefallen