Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

QuantumFramework

Tutorials

  • Getting Started

Guides

  • Wolfram Quantum Computation Framework

Tech Notes

  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • Quantum object abstraction
  • Tensor Network
  • Quantum Computation

Symbols

  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitMultiwayGraph[EXPERIMENTAL]
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumEvolve
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumMeasurementSimulation
  • QuantumMPS [EXPERIMENTAL]
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumStateEstimate[EXPERIMENTAL]
  • QuantumState
  • QuantumTensorProduct
  • QuditBasis
  • QuditName
Quantum object abstraction
QuditName[name,"Dual"->...]
a nice formatting for qudit names
QuditBasis[<|...,{QuditName[...], i} -> tensor,...|>]
an association for qudit names and their corresponding tensor representation
QuantumBasis[<|"Input" -> QuditBasis[...],"Output" -> QuditBasis[...],"Picture"->...,"Label"->...,"ParameterSpec"->...|>]
input and output, and their corresponding qudit basis
QuantumState[tensor, QuantumBasis[...]]
tensor in a given quantum basis
QuantumOperator[QuantumState[...], order]
quantum state with order
QuantumMeasurementOperator[QuantumOperator[...], target]
quantum operator with target
QuantumMeasurement[QuantumMeasurementOperator[...]]
a wrapper for quantum measurement operator
QuantumChannel[QuantumOperator[...]]
a wrapper for quantum operator
QuantumCircuitOperator[<|"Elements" -> ..., "Label" -> ...|>]
a wrapper for a list of quantum operators and their composition
We will briefly discuss how the abstraction is done in our framework and how quantum objects depend on each other.

QuditName

QuditName is a convenient wrapper around qudit names with unique formatting. It support both bra and ket formatting. Its general input is as follows: QuditName[name,”Dual”->boo], where boo can be True or False.
A qudit name, as Φ, in ket format:
In[69]:=
QuditName
["Φ","Dual"True]
Out[69]=
〈Φ|
A qudit name, as Φ, in bra format:
In[268]:=
QuditName
["Φ","Dual"False]
Out[268]=
|Φ〉
1D qudit: it does not represent a physical qudit, and we will use it as dummy qudit
We should also consider the cases of no qudit, which is defined as follows
In[148]:=
QuditName
[I.,"Dual"False]
Out[148]=

We will explain in the following sections why it is important to have a well-defined no-qudit case.

QuditBasis

The next level of abstraction is QuditBasis, which is a wrapper for an association with keys as
names
and values as the corresponding tensor representation.
The key-value has this form: {QuditName[...],qn}->tensor, where qn enumerates qudits.
Print the input form of a 2D qudit basis:
In[81]:=
MatrixForm/@
QuditBasis
[2]1
Out[81]=
{|0〉,1}
1
0
,{|1〉,1}
0
1

Print the input form of a 2Dx3D qudit basis, in matrix form:
In[271]:=
MatrixForm/@
QuditBasis
[{2,"X"}]1
Out[271]=
{|0〉,1}
1
0
,{|1〉,1}
0
1
,
ψ
x
-
,2
-
1
2
1
2
,
ψ
x
+
,2
1
2
1
2

Note the actual basis for above example is generated by tensor product of above tensors
In[273]:=
MatrixForm/@
QuditBasis
[{2,"X"}]["Association"]
Out[273]=
0
ψ
x
-

-
1
2
1
2
0
0
,0
ψ
x
+

1
2
1
2
0
0
,1
ψ
x
-

0
0
-
1
2
1
2
,1
ψ
x
+

0
0
1
2
1
2

For example, the first element of above association is generated as
In[277]:=
TensorProduct{1,0},{-1,1}
2
//MatrixForm
Out[277]//MatrixForm=
-
1
2
1
2
0
0
As mentioned before, no-qudit basis is defined using no-qudit name
In[147]:=
QuditBasis

QuditName
[I.,"Dual"False],11
Out[147]=
QuditBasis
Qudits: 0
Dimension: 1


QuantumBasis

The next level of abstraction is our framework is QuantumBasis. Its generic form is as follows: QuantumBasis[<|“Input” -> QuditBasis[...], “Output” -> QuditBasis[...], “Picture” -> ..., “Label” -> ..., “ParameterSpec” -> ...|>].
Let’s consider a few examples:
As one can see, here the most important additional information are input and output. The rest are what we call as “Meta” data of that quantum object:
In[109]:=
QuantumBasis
[2]["Meta"]
Out[109]=
{PictureSchrödinger,LabelNone,ParameterSpec{}}
Pauli-X quantum basis:
In[105]:=
QuantumBasis
[2]//InputForm
Out[105]//InputForm=
QuantumBasis[<|Input -> QuditBasis[<|{QuditName[I., Dual -> False], 1} -> 1|>],
Output -> QuditBasis[<|{QuditName[0, Dual -> False], 1} -> SparseArray[Automatic, {2}, 0,
{1, {{0, 1}, {{1}}}, {1}}], {QuditName[1, Dual -> False], 1} -> SparseArray[Automatic, {2}, 0,
{1, {{0, 1}, {{2}}}, {1}}]|>], Picture -> Schrödinger, Label -> None, ParameterSpec -> {}|>]
Note in this case, there is no input, and only one output
In[106]:=
QuantumBasis
[2]["Input"]
Out[106]=
QuditBasis
Qudits: 0
Dimension: 1

In[107]:=
QuantumBasis
[2]["Output"]
Out[107]=
QuditBasis
Qudits: 1
Dimension: 2

The diagram for the basis shows clearly the input and output:
In[108]:=
QuantumBasis
[2]["Diagram"]
Out[108]=
In[125]:=
QuantumBasis
[{2,3}]["Diagram"]
Out[125]=
Note that in our framework, the bold format is used for input, which corresponds to column indices (covariant ones, or bra), while the normal format is for output, which corresponds to row indices (contravariant ones, or ket). For example, look at the summary box of the following basis:
In[36]:=
QuantumBasis
[{2},{2,3}]
Out[36]=

QuantumState

The next level of abstraction is QuantumState, which has the general form of QuantumState[tensor, QuantumBasis[...]], with the tensor can be state vector, density matrix and more.
In[120]:=
state=
QuantumState
[{1,,1,,3,3},{2,3}];​​state//InputForm
Out[121]//InputForm=
QuantumState[SparseArray[Automatic, {6}, 0, {1, {{0, 6}, {{1}, {2}, {3}, {4}, {5}, {6}}},
{1, I, 1, I, 3, 3*I}}], QuantumBasis[<|Input -> QuditBasis[<|{QuditName[I., Dual -> False], 1} -> 1|>],
Output -> QuditBasis[<|{QuditName[0, Dual -> False], 1} -> SparseArray[Automatic, {2}, 0,
{1, {{0, 1}, {{1}}}, {1}}], {QuditName[1, Dual -> False], 1} -> SparseArray[Automatic, {2}, 0,
{1, {{0, 1}, {{2}}}, {1}}], {QuditName[0, Dual -> False], 2} -> SparseArray[Automatic, {3}, 0,
{1, {{0, 1}, {{1}}}, {1}}], {QuditName[1, Dual -> False], 2} -> SparseArray[Automatic, {3}, 0,
{1, {{0, 1}, {{2}}}, {1}}], {QuditName[2, Dual -> False], 2} -> SparseArray[Automatic, {3}, 0,
{1, {{0, 1}, {{3}}}, {1}}]|>], Picture -> Schrödinger, Label -> None, ParameterSpec -> {}|>]]
In[124]:=
state["Diagram"]
Out[124]=
In[122]:=
state["Input"]

QuantumOperator

The next level of abstraction in our framework is QuantumOperator, which is QuantumOperator[QuantumState[...], order]. In other words, one can see it as a quantum state plus an order, where the order describes where the operator acts.

QuantumMeasurementOperator

QuantumMeasurement

It is a wrapper for quantum measurement operator, that represents a quantum measurement

QuantumChannel

It is a wrapper for quantum operators, representing a quantum channel

QuantumCircuitOperator

QuantumCircuitOperator is abstracted as an association with elements as list of operators, ops, and a circuit label, i.e. QuantumCircuitOperator[<|”Elements” -> ops, “Label” -> “Bell”|>]

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com