-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStateFunctorStable.wl
More file actions
117 lines (57 loc) · 3.41 KB
/
StateFunctorStable.wl
File metadata and controls
117 lines (57 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
(* ::Package:: *)
AppendTo[$Path,NotebookDirectory[]];
BeginPackage["StateFunctorStable`",{"BasicStable`"}];
(* ::Title:: *)
(*Descriptions of Public (Unhidden) Functions*)
endFunctorObj::usage="endFunctorObj[rho,dimprim][subsys] returns a list of objects of the image of the endomorphism functor associated to the subsystem 'subsys' given the state 'rho'
and list of (primitive) system dimensions dimprim.";
endFunctorMor::usage="endFunctorMor[rho,dimprim][sys1,sys2] returns the morphism endFunctorObj[sys1] ->
endFunctorObj[sys2] which is given by extension 'by identity operator tensoring' then compressing to the appropriate
subspace of operators.";
GNSFunctorObj::usage="GNSFunctorObj[rho,dimprim][subsys] returns a list of objects of the image of the GNS functor associated to the subsystem 'subsys' given the state 'rho'
and list of (primitive) system dimensions dimprim.";
GNSFunctorMor::usage="GNSFunctorObj[rho,dimprim][subsys] returns a list of objects of the image of the GNS functor associated to the subsystem 'subsys' given the state 'rho'
and list of (primitive) system dimensions dimprim.";
localInProd::usage="localInProd[subsys]:";
(* ::Title:: *)
(*Function Definitions*)
Begin["`Private`"];
(* ::Section:: *)
(*Linear Algebraic Operations*)
matrixUnit::usage ="matrixUnit[v_,w_] returns the matrix v otimes w^{vee} where w^{vee} = <w,-> using the standard metric on C^n.";
matrixUnit[v_,w_]:=KroneckerProduct[v,Conjugate@w];
homSpace::usage="homSpace[vspace1,vspace2] takes in vector spaces vspacei (i = 1,2) in the form of a list of basis vectors {v^1_1,v^1_2....}
and outputs the vector space of homomorphisms = vspace_1 otimes (v_space_2)^{vee} from vspace1 to vspace2 in the form of a list of basis vectors v^i_1 otimes (v^j_2)^{vee}
where (v^j_2)^{vee} is the dual basis vector of v^j_2";
homSpace[vspace1_,vspace2_]:=Flatten[#,1]&@Outer[matrixUnit,vspace2,vspace1,1];
froebenius::usage="froebenius[A,B] takes in matrices A and B and returns the Froebenius inner product Tr[ConjugateTranspose[A].B].";
froebenius[A_,B_]:=Tr[ConjugateTranspose[A].B];
eigImage::usage = "eigImage[M] returns all eigenvectors of M associated to nonzero eigenvalues.";
eigImage[M_]:= Module[{Ev=Eigensystem[M]},
Pick[Ev[[2]],(#>0)&/@Ev[[1]]]];
stdBasis::usage="stdBasis[dim] takes in an integer dim and returns the standard basis on a vector space of dimension dim in the form {v_1,v_2,...v_dim}
where each of the v_i are 1 x dim arrays.";
stdBasis[dim_]:=If[dim==0, {{0}} , IdentityMatrix[dim]];
(* ::Section:: *)
(*Defining the Functors*)
powerMod[q_]:=If[#==0,0,Power[#,q]]&;
matrixPowerMod:=MatrixFunction[powerMod[#2],#1]&
suppProj[rho_]:=matrixPowerMod[rho,0];
endFunctorObj[rho_,dimprim_]:=homSpace[#,#]&@*(eigImage@reducedDensityMat[rho,#,dimprim]&);
endFunctorMor[rho_,dimprim_][sys1_,sys2_]:=Module[{supp},
supp=suppProj@reducedDensityMat[rho,sys2,dimprim];
supp.extendOp[#,sys1,sys2,dimprim[[sys2]]].supp&
];
GNSFunctorObj[rho_,dimprim_][subsys_]:=Module[{reducedState},
reducedState=reducedDensityMat[rho,subsys,dimprim];
dimSys=Dimensions[reducedState][[1]];
homSpace[eigImage@reducedState,stdBasis[dimSys]]
];
GNSFunctorMor[rho_,dimprim_][sys1_,sys2_]:=extendOp[#,sys1,sys2,dimprim[[sys2]]].suppProj[reducedDensityMat[rho,sys2,dimprim]]&;
(* ::Section:: *)
(*Local inner products on objects in image of functorObj*)
localInProd[subsys_]:=froebenius[#1,#2]&;
(* ::Title:: *)
(*End Matter*)
End[];
EndPackage[]