Init

Some Functions

(* general pure state in polar coordinates *)
State[θ_,ϕ_]:={Cos[θ/2],Sin[θ/2]Exp[I ϕ]}
(*normalized state with real first argument *)
StateNorm[x_List]:=Module[{arg1=Arg[x[[1]]],arg2=Arg[x[[2]]],normx=x/Norm[x],θ,ϕ},
θ=2Chop@ArcCos[normx[[1]]Exp[-I arg1]];
ϕ=Mod[arg2-arg1,2π];
{Cos[θ/2],Sin[θ/2]Exp[I ϕ]}]
(* outputs the polar coordinate from a state vector *)
blochcoord[state_]:=Module[{arg1=Arg[state[[1]]],arg2=Arg[state[[2]]],normx=state/Norm[state],θ,ϕ},
θ=Abs[2Chop@ArcCos[normx[[1]]Exp[-I arg1]]];
ϕ=Abs@Mod[arg2-arg1,2π];
{θ,ϕ}]
blochcoordcart[state_]:={Sin[#[[1]]]Cos[#[[2]]],Sin[#[[1]]]Sin[#[[2]]],Cos[#[[1]]]}&[blochcoord[state]]

(* define a bloch sphere graph *)
With[{r=1},xy=ParametricPlot3D[{r Cos[θ],r Sin[θ],0},{θ,0,2 π},PlotStyle->{Dashed,Opacity[0.3]},Boxed->False,Axes->False];
yz=ParametricPlot3D[{0,r Cos[θ],r Sin[θ]},{θ,0,2 π},PlotStyle->{Dashed,Opacity[0.3]},Boxed->False,Axes->False];
xz=ParametricPlot3D[{r Cos[θ],0,r Sin[θ]},{θ,0,2 π},PlotStyle->{Dashed,Opacity[0.3]},Boxed->False,Axes->False];
bloch=Show[Graphics3D[{Blue,Opacity[.15],Sphere[{0,0,0},r],Black,Opacity[1],Thick,Line[{{0,r,0},{0,-r,0}}],Line[{{0,0,r},{0,0,-r}}],Line[{{r,0,0},{-r,0,0}}],Text[Style["z+",FontSize->16,FontWeight->Bold,FontColor->GrayLevel[.3]],{0,0,1.3 r}],Text[Style["z-",FontSize->16,FontWeight->Bold,FontColor->GrayLevel[.3]],{0,0,-1.3 r}],Text[Style["x+",FontSize->16,FontWeight->Bold,FontColor->GrayLevel[.3]],{1.3 r,0,0}],Text[Style["x-",FontSize->16,FontWeight->Bold,FontColor->GrayLevel[.3]],{-1.3 r,0,0}],Text[Style["y+",FontSize->16,FontWeight->Bold,FontColor->GrayLevel[.3]],{0,1.3 r,0}],Text[Style["y-",FontSize->16,FontWeight->Bold,FontColor->GrayLevel[.3]],{0,-1.3 r,0}]}],xy,xz,yz,Boxed->False]];
(* generate vector for bloch sphere representation *)
Options[blochvec]={color->Blue};
blochvec[{θ_,ϕ_},OptionsPattern[]]:=Graphics3D[{OptionValue[color],Thickness[0.02],Line[{{0,0,0},{Sin[θ]Cos[ϕ],Sin[θ]Sin[ϕ],Cos[θ]}}]}]
blocharrow[{θ_,ϕ_},opts:OptionsPattern[]]:=Arrow3D[{0,0,0},{Sin[θ]Cos[ϕ],Sin[θ]Sin[ϕ],Cos[θ]},opts]

σx=(({{0, 1}, {1, 0}}));σy=(({{0, -I}, {I, 0}}));σz=(({{1, 0}, {0, -1}}));
(* draw vector for bloch sphere taking an arbitrary pure input state *)
blochvecstate[state_]:=blochvec@blochcoord[state]
blocharrowstate[state_,opts:OptionsPattern[]]:=blocharrow[blochcoord[state],opts]
(*bloch vector for mixed states *)
blochvecmsphere[r_,θ_,ϕ_]:=Graphics3D[{Blue,Thickness[0.02],Line[{{0,0,0},r{Sin[θ]Cos[ϕ],Sin[θ]Sin[ϕ],Cos[θ]}}]}]
blochvecmsphere[{r_,θ_,ϕ_}]:=blochvec[r,θ,ϕ]
blochvecmarrowsphere[{r_,θ_,ϕ_},opts:OptionsPattern[]]:=Arrow3D[{0,0,0},r{Sin[θ]Cos[ϕ],Sin[θ]Sin[ϕ],Cos[θ]},opts]
(* cartesian coordinates *)
blochvecmcart[x_,y_,z_]:=Graphics3D[{Blue,Thickness[0.02],Line[{{0,0,0},{x,y,z}}]}]
blochvecmcart[{x_,y_,z_}]:=blochvecmcart[x,y,z]
blochvecmarrowcart[{x_,y_,z_},opts:OptionsPattern[]]:=Arrow3D[{0,0,0},{x,y,z},opts]
(* show vector with sphere *)
vectoronsphere[vec_]:=Show[bloch,vec,SphericalRegion->True]
(* Bloch-sphere coordinates from arbitrary state *)
MatrixToBloch[x_]:={Tr[σx.x],Tr[σy.x],Tr[σz.x]}

Urot[α_,t_,θ_,ϕ_]:=(({{Cos[α t/2] - I Cos[θ]Sin[α t /2], -I Exp[-I ϕ] Sin[θ] Sin[α t/2]}, {(-I Exp[I ϕ]) Sin[θ] Sin[α t/2], Cos[α t/2] + I Cos[θ]Sin[α t /2]}}))

RX[α_]:=Urot[α,1,π/2,0]
RY[α_]:=Urot[α,1,π/2,π/2]
RZ[α_]:=Urot[α,1,0,0]

SetOptions[ParametricPlot3D,PlotStyle->{Thick,Red},PlotRange->{{-1,1},{-1,1},{-1,1}},ImageSize->300,Axes->False,Boxed->False];
BlochSphere=Graphics3D[{Opacity[0.4],Sphere[{0,0,0},1]},Boxed->False];
BlochMesh=SphericalPlot3D[1,{θ,0,2 Pi},{ϕ,0,2Pi},MeshFunctions->{#4&},Mesh->{{Pi/2}},PlotStyle->Directive[Opacity[0]],Boxed->False,Axes->False];

Options[Arrow3D]={color->Red};
Arrow3D[a_,b_,OptionsPattern[]]:=Module[{l,n,rm,a3d,offset,col,arrowheadlength,thickness,arrowslope},
       col=OptionValue[color];
n=b-a;
l=Norm[n];
offset=l-1;
thickness=0.02;
arrowslope=0.3;
arrowheadlength=0.2;
rm=If[Abs[n]==l {0,0,1},Sign[n[[3]]]*IdentityMatrix[3],RotationMatrix[{{0,0,1},n}]];
If[l>0,
a3d={ParametricPlot3D[rm.{(arrowslope v) Cos[u],(arrowslope v) Sin[u],1-v+offset},{u,0,2 π},{v,0,arrowheadlength},Mesh->None,PlotStyle->Directive[col]],ParametricPlot3D[rm.{v Cos[u],v Sin[u],1-arrowheadlength+offset},{u,0,2 π},{v,0,arrowslope*arrowheadlength},PlotStyle->Directive[col],Mesh->None],Graphics3D[{col,Cylinder[{a,b-arrowheadlength/l (b-a)},thickness]}]},
a3d=Graphics3D[{col,Sphere[a,3thickness]}]];
a3d];

Coupling  of qubit to the environment

Capacitively coupled qubit :

SetOptions[Plot,BaseStyle->{FontFamily->"Arial",FontSize->14}];

Calculate impedance Z(ω) as seen from the qubit circuit: Capacitance (Subscript[C, g])and coaxial cable with impedance (Subscript[Z, 0])in series:

(((Z0-I/(ω Cp)))^(-1))//ComplexExpand

Real Part of (Z^(-1))=(Z0/((Z0^2)+(1/((Cp^2) (ω^2)))))

((((Z0/((Z0^2)+(1/((Cp^2) (ω^2)))))))^(-1))//FullSimplify
Plot[((%)^(-1))/.{ω->(10^9)ω0,Z0->50,Cp->(10^(-15))},{ω0,1,(10^5)},PlotRange->All,Frame->True,FrameLabel->{"ω [Grad/s]","Γ [1/s]"}]

-> High pass filter

Qubit coupled to an LC-oscillator:

ΓLC=I /(ω Cpg)+((((((Z0-I /(ω Cpg)))^(-1))+(Zres^(-1))))^(-1))/.Zres->((((Rr^(-1))+(((-I /(ω Cpr)))^(-1))+(((I ω Lr))^(-1))))^(-1))//FullSimplify
%//ComplexExpand

ReΓLC=(1/(Rr ((((-(1/(Lr ω))+Cpr ω+((Cpg ω)/(1+(Cpg^2) (Z0^2) (ω^2)))))^2)+((((1/Rr)+(((Cpg^2) Z0 (ω^2))/(1+(Cpg^2) (Z0^2) (ω^2)))))^2))))+(((Cpg^2) Z0 (ω^2))/((1+(Cpg^2) (Z0^2) (ω^2)) ((((-(1/(Lr ω))+Cpr ω+((Cpg ω)/(1+(Cpg^2) (Z0^2) (ω^2)))))^2)+((((1/Rr)+(((Cpg^2) Z0 (ω^2))/(1+(Cpg^2) (Z0^2) (ω^2)))))^2))))//FullSimplify

Plot[ReΓLC/.{ω->ω0 (10^9),Z0->50,Cpg->(10^(-15)),Lr->(10^(-9)),Cpr->(10^(-12)),Rr->500},{ω0,0,50},PlotRange->All,Frame->True,FrameLabel->{"ω [Grad/s]","Γ [1/s]"}]

Bloch equations :

BE=MapThread[Equal,{{x'[τ],y'[τ],z'[τ]},Cross[{x[τ],y[τ],z[τ]},{ϵx[τ],ϵy[τ],ϵz[τ]}]}];
BE//MatrixForm

inital state = excited state; B - field in z - direction

Block[{ϵx,ϵy,ϵz,x,y,z,ini,tini,tfinal,rx,ry,rz},

ϵx[τ_]=0;ϵy[τ_]=0;ϵz[τ_]=1;

ini={x[0]==0,y[0]==0,z[0]==1};

tini=0; tfinal=2π;
v1[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@BE,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Animate[vectoronsphere@blochvecmarrowcart[v1[t]],{t,tini,tfinal},AnimationRunning->False]
]

inital state = excited state; B - field in x - direction

Block[{ϵx,ϵy,ϵz,x,y,z,ini,tini,tfinal,rx,ry,rz},

ϵx[τ_]=1;ϵy[τ_]=0;ϵz[τ_]=0;

ini={x[0]==0,y[0]==0,z[0]==1};

tini=0; tfinal=2π;
v2[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@BE,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Animate[vectoronsphere@blochvecmarrowcart[v2[t]],{t,tini,tfinal},AnimationRunning->False]
]

inital state = superposition state in some direction; B - field in x - direction

Block[{ϵx,ϵy,ϵz,x,y,z,ini,tini,tfinal,rx,ry,rz},

ϵx[τ_]=1;ϵy[τ_]=0;ϵz[τ_]=0;

ini={x[0]==1/(Sqrt[2]),y[0]==1/(Sqrt[2]),z[0]==0};

tini=0; tfinal=2π;
v3[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@BE,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Animate[vectoronsphere@blochvecmarrowcart[v3[t]],{t,tini,tfinal},AnimationRunning->False]
]

with decay :

equs=MapThread[Equal,{{x'[τ],y'[τ],z'[τ]},Cross[{x[τ],y[τ],z[τ]},{ϵx[τ],ϵy[τ],ϵz[τ]}]-{((x[τ])/T2),((y[τ])/T2),(((z[τ]-zs))/T1)}}];
equs//MatrixForm

For (OverVector[ϵ])=(0,0,1), decay of excited state

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal,rx,ry,rz},

ϵx[τ_]=0;ϵy[τ_]=0;ϵz[τ_]=1;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==0,z[0]==1};

T1=1;
T2=∞;

tini=0; tfinal=2π;
vec1[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Manipulate[vectoronsphere@blochvecmarrowcart[vec1[t]],{t,tini,tfinal}]
]

For (OverVector[ϵ])=(0,0,1), decay of ground state

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal},

ϵx[τ_]=0;ϵy[τ_]=0;ϵz[τ_]=1;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==0,z[0]==-1};

T1=1;
T2=∞;

tini=0; tfinal=2π;
vec2[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Animate[vectoronsphere@blochvecmarrowcart[vec2[t]],{t,tini,tfinal},AnimationRunning->False]
]

For (OverVector[ϵ])=(0,0,1), dephasing of superposition state

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal},

ϵx[τ_]=0;ϵy[τ_]=0;ϵz[τ_]=3;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==1,z[0]==0};

T1=∞;
T2=2;

tini=0.; tfinal=2π;
vec3[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Animate[Show[ParametricPlot3D[vec3[θ],{θ,0,a}],vectoronsphere@blochvecmarrowcart[vec3[a]]],{{a,$MachineEpsilon},tini,tfinal},AnimationRunning->False]
]

For (OverVector[ϵ])=(0,0,1), dephasing and relaxation of superposition state

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal},

ϵx[τ_]=0;ϵy[τ_]=0;ϵz[τ_]=3;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==1,z[0]==0};

T1=3;
T2=1.5;

tini=0.; tfinal=4π;
vec4[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];
Animate[Show[ParametricPlot3D[vec4[θ],{θ,0,a}],vectoronsphere@blochvecmarrowcart[vec4[a]]],{{a,$MachineEpsilon},tini,tfinal},AnimationRunning->False]
]

Steady state solutions at resonance and in rotating frame at the driving frequency

Strong driving such that Rabi rate is much larger than decay rate

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal},

ϵx[τ_]=20;ϵy[τ_]=0;ϵz[τ_]=.0;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==0,z[0]==-1};

T1=1;
T2=1;

tini=0.; tfinal=π;

vec5l[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];

Animate[Show[bloch,
ParametricPlot3D[vec5l[θ],{θ,0,a+$MachineEpsilon},PlotStyle->Directive[Green]],
blochvecmarrowcart[vec5l[a],color->Green]],{{a,(10^4)$MachineEpsilon},tini+100$MachineEpsilon,tfinal},AnimationRunning->False]
]

Decay rate approximately Rabi rate :

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal},

ϵx[τ_]=1;ϵy[τ_]=0;ϵz[τ_]=.0;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==0,z[0]==-1};

T1=1;
T2=1;

tini=0.; tfinal=2π;
vec5m[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];

Animate[Show[bloch,ParametricPlot3D[vec5m[θ],{θ,0,a},PlotStyle->Directive[Darker@Yellow]],
blochvecmarrowcart[vec5m[a],color->Yellow]],{{a,(10^4)$MachineEpsilon},tini+$MachineEpsilon,tfinal},AnimationRunning->False]]

Decay faster than Rabi rate:

Block[{ϵx,ϵy,ϵz,x,y,z,T1,T2,zs,ini,tini,tfinal},

ϵx[τ_]=.1;ϵy[τ_]=0;ϵz[τ_]=.0;

zs=-1; (* steady state *)
ini={x[0]==0,y[0]==0,z[0]==-1};

T1=1;
T2=1;

tini=0.; tfinal=π;
vec5s[τ_]={x[τ],y[τ],z[τ]}/.First@NDSolve[{Sequence@@equs,Sequence@@ini},{x[τ],y[τ],z[τ]},{τ,tini,tfinal}];


Animate[Show[bloch,ParametricPlot3D[vec5s[θ],{θ,0,a+$MachineEpsilon}],vectoronsphere@blochvecmarrowcart[vec5s[a]]],{{a,(10^4)$MachineEpsilon},tini+100$MachineEpsilon,tfinal},AnimationRunning->False]
]

© Stefan Filipp, 11/2009