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
  • Quantum Object Composition

Guides

  • Wolfram Quantum Computation Framework

Tech Notes

  • Bell's Theorem: CHSH inequality
  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • An IBM Quantum Error Map
  • QPU Service Connection
  • Quantum object abstraction
  • Quantum Optimization
  • Second Quantization Functions
  • Sending Queries to IBM QPUs
  • Tensor Network
  • Quantum Computation

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
Wolfram`QuantumFramework`
QuantumCircuitOperator
​
QuantumCircuitOperator
[{
obj
1
,
obj
2
,
obj
3
,...}]
represents a quantum circuit with a list of quantum objects
obj
i
, e.g., quantum operator, quantum channel, quantum state or quantum measurement operators.
​
​
QuantumCircuitOperator
[obj]
wraps a single quantum object (operator, channel, state or measurement operator) as a one-element circuit.
​
​
QuantumCircuitOperator
[objorder]
places obj on the qudit positions given by order.
​
​
QuantumCircuitOperator
["name"]
or
QuantumCircuitOperator
["name"[args]]
gives a named circuit, such as
"Bell"
,
"Toffoli"
or
"Grover"[f]
.
​
​
QuantumCircuitOperator
[qs]
gives a circuit that prepares the quantum state qs.
​
​
QuantumCircuitOperator
["string"]
gives a tensor-product gate from a string of single-qubit gate letters, such as
"IXYZ"
.
​
​
QuantumCircuitOperator
[qasm]
imports a circuit from an OpenQASM string or file.
​
​
QuantumCircuitOperator
[qc,opts]
rebuilds an existing circuit qc with new options.
​
Details and Options
▪
QuantumCircuitOperator[…]["prop"] will give the property prop of the circuit.
▪
The following properties prop are supported:
​
​
"Arity"
the arity of the circuit: the number of input qudits it acts on
"Width"
the number of wires (qudits) the circuit spans
"Depth"
the depth of the circuit: the number of gate layers
"OperatorCount"
or
"GateCount"
the total number of operators (gates) in the circuit
"InputDimensions"
/
"OutputDimensions"
the list of input / output qudit dimensions of the circuit
"Operators"
the list of operators (gates) in the circuit
"CircuitOperator"
the circuit operator: the single quantum operator representing the overall transformation done by the circuit
"Association"
the underlying data of the circuit, as an Association
"Orders"
the list of orders (input/output qudits) of the operators in the circuit
"Label"
the label of the circuit
"Picture"
the picture of the circuit (e.g. Schrodinger, Heisenberg or PhaseSpace)
"Parameters"
the list of parameters of a parametrized circuit
"ParameterArity"
the number of parameters of the circuit
"Properties"
the list of supported properties
"Diagram"
the diagram of the quantum circuit
"Topology"
the circuit topology graph, with qudits/wires as vertices and gates as edges
"TensorNetwork"
the corresponding tensor network representing the circuit
"TensorNetworkGraph"
the graph of the circuit's tensor network
"QASM"
the circuit in OpenQASM 3.0
"QiskitCircuit"
or
"Qiskit"
the corresponding circuit in Qiskit (note you need Python as external evaluator for this property)
"Shift"
,n
shift the order of the circuit (the qudits it acts on) by n
▪
There are many named-circuits,
QuantumCircuitOperator
[{"circuitname",...}]
, for example, Bell, Toffoli, Grover (and its many oracles), quantum phase estimation, quantum fourier transform, Bernstein-Vazirani algorithm (and its many oracles), Graph and etc.
​
​
"Bell"
Bell-state preparation circuit ({H, CNOT}); prepares a Bell pair from the all-zeros state
"GHZ"[n]
preparation circuit for the n-qubit GHZ state (H, then a CNOT chain)
"Graph"[g]
graph-state preparation circuit for a graph g (Hadamard on each vertex, then an entangling gate along each edge)
"QuantumState"[qs]
or
"StatePreparation"[qs]
a circuit that prepares the quantum state qs (qubit states via the multiplexer / RZY decomposition, general qudits via a block-diagonal construction)
"Number"[n,qubits]
encodes the integer n as a computational basis state (X gates on the 1-bits of n)
"PhaseNumber"[n,qubits,h]
encodes the number n in qubits qubits as relative phases; with a leading Hadamard layer (one H per qubit) when h is True
"Toffoli"
Toffoli (CCNOT) gate as a Clifford+T decomposition (15 gates)
"Fredkin"
Fredkin (controlled-SWAP) gate as a decomposition (18 gates)
"Magic"
the magic-basis circuit mapping the computational basis to the Bell basis ({S, S, H, CNOT})
"Fourier"[n]
n-qubit quantum Fourier transform (QFT)
"InverseFourier"[n]
n-qubit inverse quantum Fourier transform
"BooleanOracle"[f]
Boolean oracle for a Boolean function f (ESOP-decomposed into multi-controlled NOT gates)
"BooleanOracleR"[f]
Boolean oracle for a Boolean function f built from rotation gates (controlled rotations and CNOTs; default rotation
"RZ"[Pi]
)
"PhaseOracle"[f]
phase oracle for a Boolean function f (encodes f in the phase via kickback)
"GrayOracle"[angles,prec]
Gray-code-optimized rotation oracle encoding a list or function of angles to precision prec (default
"RY"
rotations)
"Grover"[f]
Grover operator (oracle and diffusion) for a Boolean function f
"Grover0"[f]
Grover operator for f, with the diffusion reflecting about the all-zeros state (controlled-on-0 gate)
"GroverPhase"[f]
Grover operator for f using a phase oracle
"GroverPhase0"[f]
Grover operator for f using a phase oracle, with controlled-on-0 diffusion
"GroverDiffusion"[n]
the Grover diffusion (amplitude-amplification) operator on n qubits
"GroverDiffusion0"[n]
Grover diffusion on n qubits, with a controlled-on-0 gate
"GroverPhaseDiffusion"[n]
Grover diffusion on n qubits, for a phase oracle
"GroverPhaseDiffusion0"[n]
Grover diffusion on n qubits, for a phase oracle and with a controlled-on-0 gate
"Deutsch"[f]
Deutsch circuit for a Boolean function f (single-qubit Deutsch-Jozsa)
"DeutschPhase"[f]
Deutsch circuit for f using a phase oracle
"DeutschJozsa"[k,n]
or
"DeutschJozsa"[BooleanFunction[k-1,n]]
Deutsch-Jozsa circuit for the (k-1)th Boolean function in n variables
"DeutschJozsaPhase"[k,n]
or
"DeutschJozsaPhase"[BooleanFunction[k-1,n]]
Deutsch-Jozsa circuit using the phase oracle of the (k-1)th Boolean function in n variables
"DeutschJozsaBooleanOracle"[k,n]
or
"DeutschJozsaBooleanOracle"[BooleanFunction[k-1,n]]
Deutsch-Jozsa Boolean oracle of the (k-1)th Boolean function in n variables
"DeutschJozsaPhaseOracle"[k,n]
or
"DeutschJozsaPhaseOracle"[BooleanFunction[k-1,n]]
Deutsch-Jozsa phase oracle of the (k-1)th Boolean function in n variables
"BernsteinVazirani"[s]
Bernstein-Vazirani circuit for a secret bit-string s
"BernsteinVaziraniOracle"[s]
Bernstein-Vazirani oracle for a secret binary vector or bit-string s
"Simon"[s]
Simon circuit for a secret binary vector or bit-string s
"SimonOracle"[s]
Simon oracle for a secret binary vector or bit-string s
"PhaseEstimation"[u,n]
quantum phase-estimation circuit for a unitary operator u using n counting qubits (qubit operators only)
"Trotterization"[ops,order,reps,t]
Trotter-Suzuki decomposition of a list of operators ops, for a given order (1, 2, 4, 6, …), number of repetitions reps, and time t (based on Suzuki's recursion relation)
"Controlled"[qc,c1,c0]
or
"C"[qc,c1,c0]
the controlled version of a circuit qc, controlled on the c1 qubits (value 1) and the c0 qubits (value 0)
"Multiplexer"[op1,op2,...]
a multiplexer (uniformly-controlled gate): applies the operator selected by the binary value of the control qubits
"ControlledMultiplexer"[m,v]
the multiplexer-based linear-solver circuit produced by QuantumLinearSolve for a matrix m and vector v
"Switch"[a,b]
quantum-switch circuit of two operators a and b (their order of application coherently controlled)
"CHSH"
CHSH Bell-test circuit with measurement angle
θ
(default
π/4
)
"LeggettGarg"
Leggett-Garg circuit for the Leggett-Garg inequality, with measurement angle
θ
(default
π/4
)
"WignerCHSH"
CHSH circuit in the Wigner (WignerMIC) basis, with measurement angle
θ
(default
π/4
)
▪
Tutorials
▪
Related Workflows
​
Examples  
(39)
Basic Examples  
(4)
Create a quantum circuit composed of only single qubit gates:
In[1]:=
qc=
QuantumCircuitOperator

QuantumOperator
["X"],​​
QuantumOperator
["Y",{2}]
Out[1]=
QuantumCircuitOperator
​

Draw the associated circuit diagram:
In[2]:=
qc["Diagram"]
Out[2]=
Shorthand representation of the circuit:
Recover a shorthand specification of the circuit:
The shorthand, fed back to the constructor, rebuilds the same circuit:
Create a circuit with multi-qubit gates:
Draw the associated circuit diagram:
The above circuit has a shorthand representation, too:
The dashed line between the two Hadamards indicates that they are defined as a tensor product, although they are separable. Compare it with this case, where each gate is placed separately:
A quantum state is transformed by applying the circuit to it:
If no input is given, the initial state is taken to be the corresponding register state:
A quantum circuit can include many kinds of quantum objects: here a state, gates, a noise channel, a phase, and measurements:
Draw its circuit diagram:
The outcome probabilities after running the circuit on the register state:

© 2026 Wolfram. All rights reserved.

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