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
  • Example Repository Functions
  • 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
  • QuantumPhaseSpaceTransform
  • 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"…,"Parameters"…|>]
input and output, and their corresponding qudit basis
QuantumState
[state, QuantumBasis[…]]
state representation in a given quantum basis
QuantumOperator
[QuantumState[…], order]
quantum state with order
QuantumMeasurementOperator
[QuantumOperator[…], targets]
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 supports both bra and ket formatting. Its general input is as follows:
QuditName
[name,"Dual"bool]
, where bool can be
True
or
False
.
A qudit name, as Φ, in bra format:
In[57]:=
QuditName
["Φ","Dual"True]
Out[57]=
〈Φ|
A qudit name, as Φ, in ket format:
QuditName
["Φ","Dual"False]
|Φ〉
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
QuditName
[]

A zero-dimension qudit is also possible:
QuditName
[{}]
∅
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[…],i}tensor
, where i enumerates qudits (to describe many qudit systems).
Show
MatrixForm
of a qubit basis:
MatrixForm/@
QuditBasis
[2]["Representations"]
{|0〉,1}
1
0
,{|1〉,1}
0
1

Show
MatrixForm
of a 3D qudit basis:
MatrixForm/@
QuditBasis
[3]["Representations"]
{|0〉,1}
1
0
0
,{|1〉,1}
0
1
0
,{|2〉,1}
0
0
1

Show
MatrixForm
of a 2D⊗3D qudit basis:
MatrixForm/@
QuditBasis
[{"I","X"}]["Representations"]
{|0〉,1}
1
0
,{|1〉,1}
0
1
,{|

+
〉,2}
1
2
1
2
,{|

−
〉,2}
1
2
-
1
2

The actual basis for the above example is generated by the tensor product of above tensors:
MatrixForm/@
QuditBasis
[{"I","X"}]["Association"]
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
TensorProduct{1,0},{1,1}
2
//MatrixForm
1
2
1
2
0
0
Unit-basis is defined as 1D-qudit case:
QuditBasis
[]
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"…,"Parameters"…|>]
.
In contrast to previous quantum objects, the key additions for
QuantumBasis
are the input and output information. All other details are categorized as the "Meta" data.
QuantumBasis
[{2},{3}]["Meta"]
{PictureSchrödinger,LabelNone,ParameterSpec{}}
Pauli-X quantum basis:
QuantumBasis
[2]//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 -> I,
ParameterSpec -> {}|>]
Note in this case, there is no input, and only one output:
QuantumBasis
[2]["Input"]
QuditBasis
Qudits: 0
Dimension: 1

QuantumBasis
[2]["Output"]
QuditBasis
Qudits: 1
Dimension: 2

The diagram for the basis shows clearly the input and output:
QuantumBasis
[2]["Diagram"]
In the Wolfram Quantum Framework, the bold formatting in the summary box signifies input, corresponding to column indices (covariant, or bra), whereas the 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:
QuantumBasis
[{2},{2,3}]
QuantumBasis
Picture: Schrödinger
Rank: 3
Dimension: 12
​
Qudits: {1,2}
​
Dimensions: {2 |
2
,
3
}
​
Element dimensions: {2,2,3}
​
Parameters: {}
​

QuantumState
The next level of abstraction is
QuantumState
, which has the general form of
QuantumState
[state,QuantumBasis[…]]
, with state can be a state vector or a density matrix.
state=
QuantumState
[{1,,1,,3,3},{2,3}];​​state//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 (a composite 2⊗3 dimensional state), with two outputs and no input:
state["Diagram"]
Show input:
Show output:
Create a bra state, which is the conjugate-transpose of the original state:
A state with no output and only input is called an effect (see the above summary box).
As one can see, a bra has no output, but only input:
Return the input:
Return the output:
An inner product (bra-ket):
An inner product is a scalar (see the summary box above):
The inner product is a pure scalar (no input, no output):
Create a ket-bra:
Return the traditional form:
A ket-bra is called map, which has both input and output:
Show diagram:
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