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

  • Bell's Theorem
  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • Quantum object abstraction
  • Tensor Network

Symbols

  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitMultiwayGraph [EXPERIMENTAL]
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumEvolve
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumMeasurementSimulation
  • QuantumMPS [EXPERIMENTAL]
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumShortcut [EXPERIMENTAL]
  • QuantumStateEstimate [EXPERIMENTAL]
  • QuantumState
  • QuantumTensorProduct
  • QuantumWignerMICTransform [EXPERIMENTAL]
  • QuantumWignerTransform [EXPERIMENTAL]
  • QuditBasis
  • QuditName
Quantum object abstraction
QuditName
QuantumMeasurementOperator
QuditBasis
QuantumMeasurement
QuantumState
QuantumChannel
QuantumOperator
QuantumCircuitOperator
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 bra format:
In[69]:=
QuditName
["Φ","Dual"False]
Out[69]=
〈Φ|
A qudit name, as Φ, in ket format:
In[268]:=
QuditName
["Φ","Dual"False]
Out[268]=
|Φ〉
1D qudit 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[...],en}->tensor, where en enumerates qudits (to describe many qudit systems).
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 3D qudit basis:
In[12]:=
MatrixForm/@
QuditBasis
[3]1
Out[12]=
{|0〉,1}
1
0
0
,{|1〉,1}
0
1
0
,{|2〉,1}
0
0
1

Print the input form of a 2Dx3D qudit basis, in matrix form:
In[13]:=
MatrixForm/@
QuditBasis
[{2,"X"}]1
Out[13]=
{|0〉,1}
1
0
,{|1〉,1}
0
1
,{|

+
〉,2}
1
2
1
2
,{|

−
〉,2}
1
2
-
1
2

Note the actual basis for above example is generated by tensor product of above tensors
In[14]:=
MatrixForm/@
QuditBasis
[{2,"X"}]["Association"]
Out[14]=
0

+

1
2
1
2
0
0
,0

−

1
2
-
1
2
0
0
,1

+

0
0
1
2
1
2
,1

−

0
0
1
2
-
1
2

For example, the first element of above association is generated as
In[15]:=
TensorProduct{1,0},{1,1}
2
//MatrixForm
Out[15]//MatrixForm=
1
2
1
2
0
0
As mentioned before, no-qudit basis is defined using no-qudit name
In[16]:=
QuditBasis

QuditName
[I.,"Dual"False],11
Out[16]=
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:
In contrast to earlier quantum objects, the key additions for quantum basis are the input and output information. All other details are categorized as the "Meta" data associated with that particular quantum object.
In[17]:=
QuantumBasis
[{2},{3}]["Meta"]
Out[17]=
{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 Wolfram quantum framework, bold formatting in the summary box signifies input, corresponding to column indices (covariant, or bra), whereas normal formatting represents output, corresponding to row indices (contravariant, or ket). An illustration of this distinction can be found in the summary box of the following basis, for instance:
In[21]:=
QuantumBasis
[{2},{2,3}]
Out[21]=
QuantumBasis
Picture: Schrödinger
Rank: 3
Dimension: 12
​
Qudits: {1,2}
​
Dimensions: {2 |
2
,
3
}
​
Element dimensions: {2,2,3}
​

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 -> {}|>]]
The above state is a conventional quantum state, with two outputs and no input:
In[124]:=
state["Diagram"]
Out[124]=
Show input:
Show output
Create a bra state
Show input form of above state
As one can see, a bra has no output, but only input:
Show input
Show output
Consider an inner product (bra-ket)
Note it is a pure scalar (no input, no output)
Consider a ket-bra (which has both input and output)
Show diagram
Show input
Show output
Show corresponding quantum basis
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.
Show input form of Pauli-x operator, acting on 2nd qubit
Show diagram of a Pauli-X operator acting on 2nd qubit
Show input order
Show output order
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