One picture useful in thinking about qubits is geometric representation of single qubit state. Bloch sphere provides a useful means of visualizing the state of a single qubit, and often serves as an excellent testbed for ideas about quantum computation and quantum information. Single qubit state can be expressed as: = cos + sin where θ is azimuthal angle and lies in the range 0 ≤ θ ≤ π , andϕ is relative phase and lying in the range 0 ≤ ϕ ≤ 2π
|ψ〉
θ
2
|0〉
iϕ
e
θ
2
|1〉
Interactive visualization of single qubit state on Bloch sphere is shown below .
Out[]=
Code
Code
In[]:=
ManipulateSwitch[operator,"",var=QuantumOperator["S"]["Dagger"][QuantumState[state]];var["BlochPlot"],"",var=QuantumOperator["T"]["Dagger"][QuantumState[state]];var["BlochPlot"],_,var=QuantumOperator[operator][QuantumState[state]];var["BlochPlot"]],Style["Gates",Bold,Medium],{operator,"X",""},"X","Y","H","S","","T","",{"XRotation",θ}->"",{"YRotation",θ}->"",{"ZRotation",θ}->"",ControlType->RadioButton,Delimiter,{{θ,0,Style["Rotation gate parameter(ξ): ",Bold,Medium]},{0,π/8,π/4,π/2,π},ControlType->RadioButton},Delimiter,Style["Initial state",Bold,Medium],{{state,"1",""},{"0"->"\!\(\*TemplateBox[{\nRowBox[{\" \", \"0\", \" \"}]},\n\"Ket\"]\)","1"->"\!\(\*TemplateBox[{\nRowBox[{\" \", \"1\", \" \"}]},\n\"Ket\"]\)","Plus"->"\!\(\*TemplateBox[{\nRowBox[{\" \", \nRowBox[{\"+\", \" \"}]}]},\n\"Ket\"]\)","Minus"->"\!\(\*TemplateBox[{\nRowBox[{\" \", \nRowBox[{\"-\", \" \"}]}]},\n\"Ket\"]\)"},ControlType->RadioButton},Delimiter,Style["Initial state Formula",Bold,Medium],Spacer[{10,10}],Dynamic[Pane[QuantumState[state]["Formula"],{140,40}]],Delimiter,Style["Final state Formula",Bold,Medium],Spacer[{10,10}],Dynamic[Pane[var["Formula"]//Simplify,{440,70}]],Delimiter,Dynamic[GraphicsRow[{Style["Phase angle:",Bold,Medium],With[{outerRadius=1,innerRadius=1},Graphics[{{(*Sector:*)LightGreen,Disk[{0,0},{innerRadius,innerRadius},{0,var["BlochSphericalCoordinates"][[3]]}],Darker[Green],Circle[{0,0},{innerRadius,innerRadius},{0,var["BlochSphericalCoordinates"][[3]]}]},{(*Radiallines:*)Thickness[0.006],Green,Line[{{0,0},{outerRadius,0}}],Red,Line[{{0,0},outerRadius*{Cos[var["BlochSphericalCoordinates"][[3]]],Sin[var["BlochSphericalCoordinates"][[3]]]}}]},{(*Text:*)Text[StringForm["ϕ = ``",var["BlochSphericalCoordinates"][[3]]],{1,1}]},{(*Outercircle:*)Black,Circle[{0,0},outerRadius]}},Axes->True,Ticks->None,ImageSize->Small]],Style["Azimuthal angle:",Bold,Medium],With[{outerRadius=1,innerRadius=1},Graphics[{{(*Sector:*)LightPink,Disk[{0,0},{innerRadius,innerRadius},{0,var["BlochSphericalCoordinates"][[2]]}],Darker[Green],Circle[{0,0},{innerRadius,innerRadius},{0,var["BlochSphericalCoordinates"][[2]]}]},{(*Radiallines:*)Thickness[0.006],Green,Line[{{0,0},{outerRadius,0}}],Red,Line[{{0,0},outerRadius*{Cos[var["BlochSphericalCoordinates"][[2]]],Sin[var["BlochSphericalCoordinates"][[2]]]}}]},{(*Text:*)Text[StringForm["θ = ``",Simplify[var["BlochSphericalCoordinates"][[2]]]],{1,1}]},{(*Outercircle:*)Black,Circle[{0,0},outerRadius]}},Axes->True,Ticks->None,ImageSize->Small]]}],TrackedSymbols:>{var}],{{var,QuantumOperator[operator][QuantumState[state]]},None},ControlPlacement->Left,LabelStyle->Directive[Bold],SaveDefinitions->True,Deployed->True,InitializationGet["Wolfram`QuantumFramework`"]
†
S
†
T
†
S
†
T
R
x
R
y
R
z
Install the required Paclet.
In[]:=
PacletInstall[CloudObject["https://wolfr.am/DevWQCF"],ForceVersionInstall->True]
Out[]=
PacletObject
Note: You are required to run the code on your local machine in order to explore all the features of Interactive Bloch Sphere.
Note: You are required to run the code on your local machine in order to explore all the features of Interactive Bloch Sphere.