In[]:=
PacletInstall["Wolfram/QuantumFramework",UpdatePacletSites->True]Needs["Wolfram`QuantumFramework`"]SeedRandom[42];
Out[]=
PacletObject
Quantum states come in two forms or types, they’re represented either by vectors when pure:
|ψ〉
In[]:=
ψ=QuantumState["RandomPure","Label"->"ψ"]
Out[]=
QuantumState
Or as general density matrices when mixed:
ρ
In[]:=
ρ=QuantumState["RandomMixed","Label"->"ρ"]
Out[]=
QuantumState
Pure vector states can also be represented by matrices by taking a product with its dual :
|ψ〉〈ψ|
In[]:=
ψ["ToMatrix"]
Out[]=
QuantumState
Which diagrammatically looks like a map or an operator (there is both an input and an output):
In[]:=
QuantumCircuitOperator,ψ["Diagram"]
†
ψ
Out[]=
To not confuse matrix states with operators, matrix states are visualized with a thick border:
In[]:=
ρ["CircuitDiagram"]
Out[]=
The composition of a pure state with its dual is a vector map or an operator:
In[]:=
ψ@
†
ψ
Out[]=
QuantumState
In[]:=
QuantumOperator[%]
Out[]=
QuantumOperator
In[]:=
ψ@["CircuitDiagram"]
†
ψ
Out[]=
The operation of turning such a map into a state is called a Bend, because it’s similar in spirit to turning a straight wire (Identity) into a bent one (Cup) by bending its input to produce a second output:
In[]:=
QuantumCircuitOperator["I"]->QuantumCircuitOperator["Cup"]
Out[]=
QuantumCircuitOperatorQuantumCircuitOperator
If pure states are bent, then a simple tensor product of two separate states is formed, the original state with its conjugate:
In[]:=
QuantumCircuitOperator[{ψ}]["Bend"]
Out[]=
QuantumCircuitOperator
While a matrix state is bent into non-separable state indicated by the dashed line:
In[]:=
QuantumCircuitOperator[{ρ}]["Bend"]
Out[]=
QuantumCircuitOperator
The reverse operation is naturally called Unbend, which turns a vector state with qudits into a matrix state with qudits:
2n
n
In[]:=
QuantumCircuitOperator[{ψ}]["Bend"][]
Out[]=
QuantumState
In[]:=
%["Unbend"]
Out[]=
QuantumState
In[]:=
%==ψ
Out[]=
True
When a circuit with matrix states and matrix maps is being evaluated, what is actually being evaluated is its bent version:
In[]:=
QuantumCircuitOperator[{ρ,ρ->2,"H","CNOT"}]["Bend"]
Out[]=
QuantumCircuitOperator
Which by default unbends the final state back into its matrix form automatically:
In[]:=
QuantumCircuitOperator[{ρ,ρ->2,"H","CNOT"}][]
Out[]=
QuantumState
In[]:=
QuantumCircuitOperator[{ρ,ρ->2,"H","CNOT"}]["Bend"][]["Unbend"]
Out[]=
QuantumState
This bending operation also turns any two-sided product ρU, which is so common in quantum theory, into a one-sided one by making digrams extend into just a single direction and effectively hiding the conjugate part behind the thick boundary of mixed states:
†
U
In[]:=
QuantumCircuitOperator[{ρ,U=QuantumOperator["RandomUnitary","Label"->"U"]}]["Diagram"]
Out[]=
In[]:=
QuantumCircuitOperator"Cup",,ρ["Operator"],U["Diagram"]
†
U
Out[]=
This mixed density matrix representation usually doesn’t go beyond states, but turns out it is very convenient tool to represent all kinds of quantum operations diagrammatically under the same unifying formalism.
Then evaluating the following diagram will compute the inner product with itself:
Which returns a scalar state corresponding to state’s purity:
Another useful mixed effect is Trace, which is just the dual of the UniformMixture state and it serves as a diagramatic version of taking a partial trace of a state:
If qudits can be traced out diagrammatically, then they can be reset to any new state by this mechanism:
Which can be composed into a single Reset mixed map:
Another use case of Trace is to represent quantum channels and measurements by pre-tracing the environment and discarding measurement results.
By default channels and measurements create an extra auxiliary qudit above a circuit diagram:
By default channels and measurements create an extra auxiliary qudit above a circuit diagram:
But it is possible to trace these out:
Which exactly what DiscardExtraQudits method is doing:
The discarded measurement operator as expected results in a combination of decoherence to a classical state (Measure) and re-encoding it back as a quantum state (Encode):
Mixed maps can also express a non-separable two-sided product, when a density matrix is wrapped around a single large operator:
For example, it is useful to represent active basis transformation in phase space.
Active transformation in ordinary Hilbert space is then just an Identity operator with output in the specific basis:
In phase space however, one needs to effectively use the inverse basis matrix as the above large gate. But with a mixed map it is again a simple composition:
Which yields the quasi-probabilities of the state directly as components of the density matrix:
Solving the above equation with all its commutators and anti-commutators can be performed by the QuantumEvolve:
In summary mixed maps is a powerful tool to construct very complicated quantum processes and its potential is yet to be explored fully.
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Matrix states and mixed maps
by Nikolay Murzin
Wolfram Community, STAFF PICKS, May 7, 2024
https://community.wolfram.com/groups/-/m/t/3171433
by Nikolay Murzin
Wolfram Community, STAFF PICKS, May 7, 2024
https://community.wolfram.com/groups/-/m/t/3171433