Install the quantum framework

Install quantum paclet: https://www.wolfram.com/quantum-computation-framework/
In[]:=
PacletInstall["https://wolfr.am/DevWQCF",ForceVersionInstall->True]​​<<Wolfram`QuantumFramework`
Out[]=
PacletObject
Name: Wolfram/QuantumFramework
Version: 1.3.7

Please read the documentation of QuantumBasis or QuantumWignerTransform for more details

Create visualization of qubit in different phase space

Work flow:
​pointNames: these are names of some quantum state we will use as reference points, for future geometric transformation
​labels: common states along Cartesian axis in Bloch sphere. We will use them to show how there are transformed in the phase space.
​refpoints: Bloch vectors of pointNames.
​spheres: list of different phase space representation (which are different basis for a qubit).
​center: the center of multi-dimensional of geometric object in the phase space of corresponding basis.
​points: the phase space points of pointNames in a give basis, relative to the center.
​labelPoints: the phase space points of labels in a give basis, relative to the center.
​ConvexHullMesh part: a geometric transformation from Bloch to phase space, but manipulating the transformation of refpoints
In[]:=
list=Module{refpoints,pointNames,spheres,labels,labelPoints},​​pointNames={"1","0","+","R"};​​labels={"1","0","+","-","R","L"};​​refpoints=1
2
Prepend[#,Norm[#]]&@QuantumState[#]["BlochVector"]&/@pointNames;​​spheres={"Wigner","WignerMIC","Wootters","Tetrahedron","Pauli","GellMann","GellMannMIC","GellMannBlochMIC","QBismSIC","Feynman","RandomMIC","RandomMIC"[Method->"Bloch"]};​​AssociationMap[​​Block[{basis=QuditBasis[#],center,points},​​center=QuantumPhaseSpaceTransform[QuantumState["UniformMixture"],basis]["StateVector"];​​points=Chop[QuantumState[QuantumState[#]["Double"],basis]["StateVector"]-center]&/@pointNames//Normal;​​labelPoints=Chop[QuantumState[QuantumState[#]["Double"],basis]["StateVector"]-center]&/@labels//Normal;​​Graphics3D[{PointSize[0.03],​​Transpose[{{Blue,Green,Red},Through[{Point,Line}[#]]&/@{{{0,0,1},{0,0,-1}},{{1,0,0},{-1,0,0}},{{0,1,0},{0,-1,0}}}}],​​​​Transpose[{{Blue,Green,Red},Through[{Point,Line}[#]]&/@Partition[Re@Chop@N@Rest[#]&/@Normal[labelPoints+Threaded[center]],2]}],​​Opacity[.5],(*Sphere[],*)ColorData[97][1],ConvexHullMesh[Chop@*Rest/@(Threaded[center]+AffineTransform[Transpose[points].Inverse[Transpose[refpoints]]]@RandomPoint[Sphere[{0,0,0,0}],6000]),MeshCellStyle->{1->None}]​​},Boxed->False]]&,spheres];
To see the visualization better, we create a list of of them from different angles.
In[]:=
img=Table[GraphicsGrid[Partition[KeyValueMap[Show[​​#2,QuantumState["UniformMixture"]["BlochPlot","ShowAxes"->False,ImageSize->Small],ViewVector->{5{Cos[θ]Sin[θ],Cos[θ]^2,Sin[θ]},{0,0,0}},ViewAngle->Pi/4,PlotLabel->#1]&]@list,UpTo[3]],ImageSize->Large,FrameAll],{θ,0,4π,.1}];
In[]:=
ParametricPlot3D[{5{Cos[θ]Sin[θ],Cos[θ]^2,Sin[θ]},{0,0,0}},{θ,0,4π}]
Out[]=
Export them as GIF
In[]:=
Export[NotebookDirectory[]<>"qubit_basis.gif",img,AnimationRepetitions->Infinity]
Visualize it
In[]:=
AnimatedImage[Import[NotebookDirectory[]<>"qubit_basis.gif"]]
Out[]=

CITE THIS NOTEBOOK

Qubit in the phase space: quasi-probability, simplex and different look into quantum states​
by Wolfram quantum team: quantum AT wolfram.com
Wolfram Community, STAFF PICKS, May 3, 2024
​https://community.wolfram.com/groups/-/m/t/3169726