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

  • Diagram
  • Exploring Fundamentals of Quantum Theory
  • Quantum Computation

Symbols

  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumStateEstimate
  • QuantumState
  • QuantumTensorProduct
  • QuditBasis
  • QuditName
Wolfram`QuantumFramework`
QuantumCircuitOperator
​
QuantumCircuitOperator[{op1,op2,op3,...}]
represents a quantum circuit with list of quantum operations, e.g., quantum operator, quantum channel or quantum measurement operators.
​
Details and Options

Examples  
(26)
Basic Examples  
(10)
Create a quantum circuit composed of only single qubit gates:
In[1]:=
qc=
QuantumCircuitOperator

QuantumOperator
["X"],
QuantumOperator
["Y",{2}];
Draw the associated circuit diagram:
In[2]:=
qc["Diagram"]
Out[2]=
Note the above circuit has a shorthand representation, too:
In[3]:=
QuantumCircuitOperator
["XY"]["Diagram"]
Out[3]=
​
Create a circuit with multi-qubit gates:
In[1]:=
qc=
QuantumCircuitOperator

QuantumOperator
["CNOT"],
QuantumOperator
[{"H",2}];
Associated circuit diagram:
In[2]:=
qc["Diagram"]
Out[2]=
Note the above circuit has a shorthand representation, too:
In[3]:=
QuantumCircuitOperator
[{"CNOT",{"H",2}}]qc
Out[3]=
True
​
Create circuits using the named ones.
Bell circuit:
In[1]:=
QuantumCircuitOperator
["Bell"]["Diagram"]
Out[1]=
​
The Toffoli circuit:
In[1]:=
QuantumCircuitOperator
["Toffoli"]["Diagram"]
Out[1]=
​
For the quantum Fourier circuit, we have
QuantumCircuitOperator[{"Fourier",n}]
with n the number of qubits. For example, the Fourier circuit of 2-qubits:
In[1]:=
QuantumCircuitOperator
["Fourier"]["Diagram"]
Out[1]=
Fourier circuit of 5-qubits:
In[2]:=
QuantumCircuitOperator
[{"Fourier",5}]["Diagram"]
Out[2]=
​
For the quantum phase estimation, we have
QuantumCircuitOperator[{"PhaseEstimation",u,n}]
which takes two input arguments: a unitary operator U, and an integer n. The integer n specifies the number of qubits and
controlled-
j
U
operators in the circuit, with j=0,1,…,n-1. The accuracy of phase estimation and the success probability depends on n.
In[1]:=
QuantumCircuitOperator
"PhaseEstimation",
QuantumOperator
[{"Phase",2π/5}],3["Diagram"]
Out[1]=
​
Given a graph, the corresponding circuit (which generates quantum graph/cluster states) is a series of controlled-Z operators on edges of graph:
In[1]:=
Graph[RandomGraph[{4,5}],VertexLabels"Name"]
Out[1]=
In[2]:=
QuantumCircuitOperator
[{"Graph",%}]["Diagram"]
Out[2]=
​
For the Bernstein–Vazirani algorithm, one needs to specify a secret string bit as s as follows: for the oracle we have
QuantumCircuitOperator[{BernsteinVaziraniOracle,s}]
, and for the whole circuit e
QuantumCircuitOperator[{BernsteinVazirani,s}]
. For example, the Bernstein–Vazirani oracle for the secret bit of 101:
In[1]:=
QuantumCircuitOperator
[{"BernsteinVaziraniOracle","101"}]["Diagram"]
Out[1]=
The Bernstein–Vazirani circuit for the secret bit of 101:
In[2]:=
QuantumCircuitOperator
[{"BernsteinVazirani","101"}]["Diagram"]
Out[2]=
​
Boolean oracle for a given Boolean function:
One can also get the decomposition of a Boolean oracle, in terms of CNOTs and Z-rotation:
For the diffusion part of the Grover circuit (also called, the amplification part), one only needs to specify the number of qubits:
Another way of storing the solution of a Boolean function is to save it as a phase, rather than on an ancillary qubit. This can be archived by using a phase oracle, that add an overall phase of π if the quantum state is a solution of the Boolean function.
The corresponding diffusion part, given a phase oracle:
One can also create the overall Grover circuit, using controlled-1 gates and a Boolean oracle:
One can also create the overall Grover circuit, using controlled-0 gates and a Boolean oracle:
One can also create the overall Grover circuit, using controlled-1 gates and a phase oracle:
One can also create the overall Grover circuit, using controlled-0 gates and a phase oracle:
​
One can find Trotter-Suzuki decomposition, to approximate a time evolution.
First order, only:
2nd order:
2nd order, with 4 steps:
4th order, only 1 step:

© 2025 Wolfram. All rights reserved.

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