Wolfram quantum framework

quantum@wolfram.coom

https://www.wolfram.com/quantum-computation-framework/
https://resources.wolframcloud.com/PacletRepository/resources/Wolfram/QuantumFramework/
https://resources.wolframcloud.com/ExampleRepository/category/quantum-computation

Wed Oct 16, 1:30 PM - 2:00 PM PDT (30 minutes)
Second Quantization and Its Applications in Quantum Optics

Wed Oct 16, 2:00 PM - 2:30 PM PDT (30 minutes)
Hybrid Optimization for Variational Quantum Linear Solvers

QuantumFramework Paclet

Install the paclet and load it:

PacletInstall["Wolfram/QuantumFramework"]
Needs["Wolfram`QuantumFramework`"]

Quit

?QuantumPhaseSpaceTransform

?Wolfram`QuantumFramework`*

QuantumEvolve

Time evolution

Hamiltonian: H=(∑_(j=1)^2)(-(Δ/2)(Subscript[σ, j]^z)+(τ/2)(Subscript[σ, j]^x))+(Subscript[J, xy])((Subscript[σ, 1]^(+))(Subscript[σ, 2]^(-))+(Subscript[σ, 1]^(-))(Subscript[σ, 2]^(+)))

h=-(Δ/2)(QuantumOperator["Z"]+QuantumOperator["Z",{2}])+(τ/2)(QuantumOperator["X"]+QuantumOperator["X",{2}])+j(QuantumOperator["Up"]@QuantumOperator["Down",{2}]+QuantumOperator["Down"]@QuantumOperator["Up",{2}]);

Lindblad jump operators:  (Subscript[L, 1,2])=(Sqrt[(γ/2)])(ξ±1)((Subscript[σ, 1]^(+))∓(Subscript[σ, 2]^(+)))

Clear[Ls]

Ls[ξ_]:=MapThread[{ev,evec}|->ev Sum[Sqrt[γ] evec[[k]] QuantumOperator["Up",{k}],{k,2}],QuantumOperator[{{1,-ξ},{-ξ,1}}]["Eigensystem"]]

Parameters:

Δ=1; (*detuning*)
τ=1; (*Rabi*)
tf=100; (*overal time of evolution*)
j=.25; (*interaction coupling*)
γ=.05; (*strength of damping rate*)

Time evolution of 2-qubit quantum state

ρt[ξ_]:=QuantumEvolve[h,Ls[ξ],QuantumState["01"],{t,0,tf}]

ρt[0.1]

ρt[0.1][.4]

ρt[0.1][1]["AmplitudesPlot",ChartLegends->Automatic]

Given ξ and time (as a list), returns expectation-value of (Subscript[σ, z]) for qubits:

qubitExpectation[ξ_,trange_]:=With[{ρ=ρt[ξ]},Table[Table[Evaluate[QuantumPartialTrace[ρ,{q}]["ProbabilitiesList"].{1,-1}],{t,trange}],{q,2}]]

Bloch visualization

Trajectory of each particle in the Bloch sphere (blue one is qubit-1, orange one is qubit-2)

Manipulate[Table[With[{r=ρt[ξ]},
Show[QuantumState["UniformMixture"]["BlochPlot"],ParametricPlot3D[Evaluate@{Re@QuantumPartialTrace[r[t],{1}]["BlochVector"],Re@QuantumPartialTrace[r[t],{2}]["BlochVector"]},{t,0,τ}],ViewPoint->{-π,2π,2π},ImageSize->200,PlotLabel->"ξ="<>ToString[ξ]]],{ξ,{-1,0,1}}],{τ,.01,tf}]

Expectation values

Mean value of (Subscript[σ, z]) for qubits:

Row@Table[
Plot[Evaluate@qubitExpectation[ξ,{t}],{t,0,tf},PlotRange->{-1,1},ImageSize->300,AspectRatio->1,PlotLabel->Replace[ξ,{-1->"anti-correlated",0->"uncorrelated",1->"correlated"}],AxesLabel->{"t","⟨(Subscript[σ, z])⟩"}],{ξ,{-1,0,1}}]

Different ways of evolving and computing expectation values

Qutrit:

d=3;n=3;
H=QuantumOperator["RandomHermitian"[d]];
Ls=Table[QuantumOperator["RandomHermitian"[d]],n];
γs=RandomReal[1,n];
ρ=QuantumState["RandomMixed",d];

ℋ=QuantumOperator["Hamiltonian"[H,Ls,γs]];
ℒ=QuantumOperator["Liouvillian"[H,Ls,γs]];

ℋ

ℋ==I ℒ

Ls

ℋ

QuantumEvolve[H,Ls->γs,ρ][1]//Chop//TraditionalForm

QuantumEvolve[ℋ,ρ,t][1]//Chop//TraditionalForm

QuantumEvolve[ℋ,ρ,{t,0,2}][1]//Chop//TraditionalForm

QuantumEvolve[ℋ,None,t][1][ρ]//Chop//TraditionalForm

QuantumEvolve[ℋ,None,{t,0,2}][1][ρ]//Chop//TraditionalForm

Exp[-I ℋ t]

QuantumEvolve[ℋ,None,t][1][ρ]//Chop//TraditionalForm
Exp[-I ℋ]@ρ//Chop//TraditionalForm
Exp[ℒ]@ρ//Chop//TraditionalForm
QuantumEvolve[H,Ls->γs,ρ,{t,0,2}][1]//Chop//TraditionalForm
QuantumEvolve[H ,Ls->γs,None,{t,0,2}][1][ρ]//Chop//TraditionalForm

QuantumWeylTransform@QuantumEvolve[ℋ["Double"],ρ["Double"],{t,0,2}][1]//Chop//TraditionalForm

Expectation values:

𝒪=QuantumOperator["RandomHermitian"[d]]

QuantumMeasurementOperator[𝒪]

QuantumMeasurementOperator[𝒪][QuantumEvolve[ℋ,ρ][1]]["Mean"]

QuantumMeasurementOperator[QuantumEvolve[-(SuperDagger[ℋ]),𝒪["MatrixQuantumState"]][1]["Operator"]][ρ]["Mean"]

QuantumMeasurementOperator[𝒪][QuantumEvolve[ℋ,ρ][1]]

In phase space:

QuantumWeylTransform@QuantumEvolve[H,Ls->γs,QuantumPhaseSpaceTransform@ρ,{t,0,2}][1]//Chop//TraditionalForm
QuantumWeylTransform@QuantumEvolve[ℋ,QuantumPhaseSpaceTransform@ρ,{t,0,2}][1]//Chop//TraditionalForm
QuantumWeylTransform@QuantumEvolve[QuantumPhaseSpaceTransform[ℋ],QuantumState[QuantumPhaseSpaceTransform[ρ],"Schrodinger"],{t,0,2}][1]//Chop//TraditionalForm
QuantumWeylTransform@QuantumEvolve[ℋ,QuantumPhaseSpaceTransform[ρ,"QBismSIC"[d]],{t,0,2}][1]//Chop//TraditionalForm
QuantumWeylTransform[QuantumPhaseSpaceTransform[Exp[ℒ],"QBismSIC"[d]]@QuantumPhaseSpaceTransform[ρ,"QBismSIC"[d]]]//Chop//TraditionalForm

QuantumPhaseSpaceTransform[(SuperDagger[QuantumEvolve[ℋ,ρ][1]]),"Wootters"[d]][QuantumPhaseSpaceTransform[𝒪["MatrixQuantumState"],"Wootters"[d]]]["Scalar"]//Chop
QuantumPhaseSpaceTransform[(SuperDagger[𝒪["MatrixQuantumState"]]),"Wootters"[d]][QuantumPhaseSpaceTransform[QuantumEvolve[ℋ,ρ][1],"Wootters"[d]]]["Scalar"]//Chop
QuantumPhaseSpaceTransform[(SuperDagger[ρ]),"Wootters"[d]][QuantumPhaseSpaceTransform[QuantumEvolve[-(SuperDagger[ℋ]),𝒪["MatrixQuantumState"]][1],"Wootters"[d]]]["Scalar"]//Chop
QuantumPhaseSpaceTransform[(SuperDagger[𝒪["MatrixQuantumState"]]),"Wootters"[d]][Exp[QuantumPhaseSpaceTransform[ℒ,"Wootters"[d]]][QuantumPhaseSpaceTransform[ρ,"Wootters"[d]]]]["Scalar"]//Chop
QuantumPhaseSpaceTransform[(SuperDagger[ρ]),"Wootters"[d]][Exp[QuantumPhaseSpaceTransform[(SuperDagger[ℒ]),"Wootters"[d]]][QuantumPhaseSpaceTransform[𝒪["MatrixQuantumState"],"Wootters"[d]]]]["Scalar"]//Chop
QuantumPhaseSpaceTransform[(SuperDagger[ρ]),"Wootters"[d]][QuantumPhaseSpaceTransform[(SuperDagger[Exp[ℒ]]),"Wootters"[d]][QuantumPhaseSpaceTransform[𝒪["MatrixQuantumState"],"Wootters"[d]]]]["Scalar"]//Chop

PhaseSpace

Quantum Double space

ρ=QuantumState["RandomMixed","Label"->"ρ"];

ρ["Double"]

ρ["DensityMatrix"]//Normal

QuantumCircuitOperator[{ρ}]["Bend"]

QuantumCircuitOperator[{ρ,(SuperStar[ρ])->2}]
%[]

U=QuantumOperator["RandomUnitary","Label"->"𝒰"];

U["Double"]

QuantumCircuitOperator[{"Uncurry",U,(SuperStar[U])->2,"Curry"}]["Diagram","ShowWireDimensions"->True]

QuantumCircuitOperator[{"Uncurry",U,(SuperStar[U])->2,"Curry"}]==U["Double"]

QuantumCircuitOperator[{ρ,U}]["Double"]["Diagram","ShowWireDimensions"->True]

σ=QuantumState["RandomMixed","Label"->"σ"]

QuantumCircuitOperator[{σ,U}]

Mixed maps and super-maps

QuantumOperator["Measurement"["X"]]

QuantumOperator["Channel"["BitFlip"[p]]]

QuantumOperator["Measurement"["X"]][ρ]

QuantumPhaseSpaceTransform

QuditBasis[""]

QuantumPhaseSpaceTransform[σ,"Feynman"]

QuantumPhaseSpaceTransform[ρ,"Wigner"]

QuantumPhaseSpaceTransform[σ,"QBismSIC"]

QuantumPhaseSpaceTransform[QuantumMeasurementOperator[]]

QuantumPhaseSpaceTransform[U]

QuantumBasis["QBismSIC",QuditBasis["QBismSIC"]["Inverse"]]

QuantumPhaseSpaceTransform[U,QuantumBasis["QBismSIC",QuditBasis["QBismSIC"]["Inverse"]]]["Table"]

QuantumBasis[QuditBasis["QBismSIC"]["Inverse"],"QBismSIC"]

QuantumPhaseSpaceTransform[QuantumOperator["I"],QuantumBasis[QuditBasis["QBismSIC"]["Inverse"],"QBismSIC"]]["Table"]

QuantumPhaseSpaceTransform[QuantumCircuitOperator["Fourier"[4]],QuantumBasis["QBismSIC",QuditBasis["QBismSIC"]["Inverse"]]]

Through[["Operators"]["Table"]]

ρ

U

QuantumState[{a,b}]

QuantumState["RandomPure"[5]]

QuantumPositiveTransform

QuantumPositiveTransform[ρ,"Wigner"]

QuantumPhaseSpaceTransform[ρ,"Wigner"]

ρ["SectorChart"]

Parametric circuits

qc=QuantumCircuitOperator["CHSH"[θ],"Parameters"->θ]

qc[.1]

qc[<|θ->Pi/4|>]

ZX

QuantumCircuitOperator["GHZ"]

ContractTensorNetwork@ZXTensorNetwork[QuantumCircuitOperator["GHZ"],"Simplify"->True]