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

  • Bell's Theorem: CHSH inequality
  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • Getting Started
  • An IBM Quantum Error Map
  • Connecting to QPU Services
  • Quantum Machine Learning in Phase Space
  • Quantum object abstraction
  • Quantum Object Composition
  • Quantum Optimization
  • Second Quantization Functions
  • Sending Queries to IBM QPUs
  • Tensor Network
  • Time Evolution
  • Fast Gates on a Transmon
  • Quantum Computation

Guides

  • Wolfram Quantum Computation Framework

Symbols

  • CliffordChannel
  • EinsteinSummation
  • GraphState
  • IBMJob
  • IBMJobSubmit
  • LocalComplement
  • PauliStabilizer
  • QiskitCircuit
  • QiskitTarget
  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitMultiwayGraph [EXPERIMENTAL]
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumEvolve
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumMeasurementSimulation
  • QuantumMPS [EXPERIMENTAL]
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumPhaseSpaceTransform
  • QuantumQASM
  • QuantumShortcut [EXPERIMENTAL]
  • QuantumSimilarity
  • QuantumStateEstimate [EXPERIMENTAL]
  • QuantumState
  • QuantumTensorProduct
  • QuantumWignerMICTransform [EXPERIMENTAL]
  • QuantumWignerTransform [EXPERIMENTAL]
  • QuditBasis
  • QuditName
  • StabilizerFrame
  • StabilizerStateQ

Quantum object abstraction

QuditName
QuantumMeasurementOperator
QuditBasis
QuantumMeasurement
QuantumState
QuantumChannel
QuantumOperator
QuantumCircuitOperator
QuditName
[name,"Dual"->…]
a nice formatting for qudit names
QuditBasis
[<
…,{QuditName[…], i} -> tensor,…
QuantumBasis
[<
"Input" -> QuditBasis[…],"Output" -> QuditBasis[…],"Picture"->…,"Label"->…,"Parameters"->…
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
[QuantumMeasurementOperator[…]]
a wrapper for quantum measurement operator
QuantumChannel
[QuantumOperator[…]]
a wrapper for quantum operator
QuantumCircuitOperator
[<
"Elements" -> …, "Label" -> …
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[1]:=
QuditName
["Φ","Dual"True]
A qudit name, as Φ, in ket format:
In[2]:=
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
In[3]:=
QuditName
[]
A zero-dimension qudit is also possible:
In[4]:=
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:
In[5]:=
MatrixForm/@
QuditBasis
[2]["Representations"]
Show
MatrixForm
of a 3D qudit basis:
In[6]:=
MatrixForm/@
QuditBasis
[3]["Representations"]
Show
MatrixForm
of a 2D⊗3D qudit basis:
In[7]:=
MatrixForm/@
QuditBasis
[{"I","X"}]["Representations"]
The actual basis for the above example is generated by the tensor product of above tensors:
In[8]:=
MatrixForm/@
QuditBasis
[{"I","X"}]["Association"]
For example, the first element of above association is generated as
In[9]:=
TensorProduct[{1,0},{1,1}/Sqrt[2]]//MatrixForm
Unit-basis is defined as 1D-qudit case:
In[10]:=
QuditBasis
[]

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 the basis options:
In[11]:=
QuantumBasis
[{2},{3}]["Options"]
Pauli-X quantum basis:
In[12]:=
QuantumBasis
[2]//InputForm
Note in this case, there is no input, and only one output:
In[13]:=
QuantumBasis
[2]["Input"]
In[14]:=
QuantumBasis
[2]["Output"]
The diagram for the basis shows clearly the input and output:
In[15]:=
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:
In[16]:=
QuantumBasis
[{2},{2,3}]

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.
In[17]:=
state=
QuantumState
[{1,I,1,I,3,3I},{2,3}];​​state//InputForm
The above state is a conventional quantum state (a composite 2⊗3 dimensional state), with two outputs and no input:
In[18]:=
state["Diagram"]
Show input:
In[19]:=
state["Input"]
Show output:
In[20]:=
state["Output"]
Create a bra state, which is the conjugate-transpose of the original state:
In[21]:=
bra=
†
QuantumState["0"]
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:
In[22]:=
bra["Diagram"]
Return the input:
In[23]:=
bra["Input"]
Return the output:
In[24]:=
bra["Output"]
An inner product (bra-ket):
In[25]:=
braket=
†
QuantumState["Plus"]
@
QuantumState
["1"]
An inner product is a scalar (see the summary box above):
In[26]:=
braket["Scalar"]
The inner product is a pure scalar (no input, no output):
In[27]:=
AssociationMap[braket,{"Input","Output"}]
Create a ket-bra:
In[28]:=
ketbra=
QuantumState
["0"]@
†
QuantumState["1"]
Return the traditional form:
In[29]:=
TraditionalForm[ketbra]
A ket-bra is called map, which has both input and output:
In[30]:=
AssociationMap[ketbra,{"Input","Output"}]
Show diagram:
In[31]:=
ketbra["Diagram"]
The above ket-bra is
Composition
of
|0〉
and
〈1|
, which is reflected in its label.
In[32]:=
ketbra["Label"]
Show corresponding quantum basis
In[33]:=
ketbra["Basis"]//InputForm

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
In[34]:=
QuantumOperator
["X",{2}]//InputForm
Show diagram of a Pauli-X operator acting on 2nd qubit
In[35]:=
QuantumOperator
["X",{2}]["Diagram"]
Show the order of above operator (note the order has the form
{output,input}
)
In[36]:=
QuantumOperator
["X",{2}]["Order"]
Show input order
In[37]:=
QuantumOperator
["X",{2}]["InputOrder"]
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”|>]
The circuit rebuilt from its association:

© 2026 Wolfram. All rights reserved.

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