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}]];
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];

(* generate a projector matrix from a pure state *)
tp[x_]:=Outer[Times,Conjugate[x],x]
tp[x_,y_]:=Outer[Times,Conjugate[x],y]

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

Cooper Pair Box Qubit :

Full Hamiltonian :

(Subscript[H, CPB]) = (Subscript[Σ, N])Ec(((N-Ng))^2)|N><N|- (EJ/2)(Subscript[Σ, N])(|N+1><N|+|N><N+1|)

DiagonalMatrix[{1,2,4,3,2}]//MatrixForm

EC DiagonalMatrix[Table[(((n-ng))^2),{n,-3,3}]]//MatrixForm

HCPB[N_,EC_,EJ_,ng_]:=EC DiagonalMatrix[Table[(((n-ng))^2),{n,-N,N}]]-(EJ/2)(DiagonalMatrix[Table[1,{n,-N,N-1}],1]+DiagonalMatrix[Table[1,{n,-N,N-1}],-1])

HCPB[3,EC,EJ,ng]//MatrixForm

Calculate the spectrum :

n = 0 :

en0=Plot[EC (((0-ng))^2)/.{EC->1},{ng,-2,2},PlotStyle->{Thickness[0.01]},AxesOrigin->{0,-0.5},FrameLabel->{"ng","energy"},Frame->True]

n = 1

en1=Plot[EC (((1-ng))^2)/.{EC->1},{ng,-2,4},PlotStyle->{Darker@Red,Thickness[0.01]},AxesOrigin->{0,-0.5},FrameLabel->{"ng","energy"},Frame->True];
Show[en0,en1]

n = -1

en2=Plot[EC (((-1-ng))^2)/.{EC->1},{ng,-2,4},PlotStyle->{Darker@Green,Thickness[0.01]},AxesOrigin->{0,-1},FrameLabel->{"ng","energy"},Frame->True];
Show[en0,en1,en2]

Manipulate[Plot[Evaluate[Eigenvalues[HCPB[2,1,EJ,ng]]],{ng,-2,2},PlotRange->{{-2,2},{-0.5,2}},PlotStyle->{Thickness[0.01]},AxesOrigin->{0,-1},FrameLabel->{"ng","energy"},Frame->True],{EJ,0,0.5,0.1}]

Question 1 :

CPB Two level approximation

Clear[EC,EJ,ng]
HCPB2=1/2(({{EC(1-2 ng), EJ}, {EJ, EC(2 ng-1)}}))

Find eigenvalues of the 2-level Hamiltonian :

Eigs2=Eigenvalues[HCPB2]//Simplify

Manipulate[
Plot[{Eigs2[[1]]/.{EC->1,EJ->0},Eigs2[[2]]/.{EC->1,EJ->0},Eigs2[[1]]/.{EC->1,EJ->EJ1},Eigs2[[2]]/.{EC->1,EJ->EJ1}},{ng,0,1},Frame->True,PlotStyle->{Directive[Black,Dashed],Directive[Black,Dashed],Blue,Red},Axes->{True,False},AxesStyle->LightGray],{{EJ1,0.1},0,1}]

By rotation :

S=MatrixExp[I (θ/2)σy];

(* transformed Pauli matrices *)
σzt=S\[ConjugateTranspose].σz.S//ComplexExpand//FullSimplify;
%//MatrixForm
σxt=S\[ConjugateTranspose].σx.S//ComplexExpand//FullSimplify;
%//MatrixForm

transformed Hamiltonian :

((-Eel)/2)σzt-(EJ/2)σxt//MatrixForm

σx - term :

-(EJ/2)Cos[θ]-(Eel/2) Sin[θ]/.{θ->-ArcTan[EJ/Eel]}//ComplexExpand//FullSimplify

σz - term :

-(Eel/2) Cos[θ]+(EJ/2)Sin[θ]/.{θ->-ArcTan[EJ/Eel]}//ComplexExpand//FullSimplify
%/.{Eel->(EC(1-2 ng))}//ComplexExpand//FullSimplify

Transition Frequency :

transf=(Sqrt[(EJ^2)+(EC^2) (((-1+2 ng))^2)])

Plot[transf/.{EC->1,EJ->1},{ng,0,1},Frame->True,FrameLabel->{"ng","Ω"}]

Cavity

<<PhysicalConstants`

3 D - Cavity

(Sqrt[PlanckConstant/(2π)/2/VacuumPermittivity])(Sqrt[((2π 50 (10^9))/(700 (10^(-9))))])

1 D Cavity

(Sqrt[PlanckConstant/(2π)/2/(VacuumPermittivity)])(Sqrt[((2π 10 (10^9))/( (10^(-5)) (10^(-9))))])