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
  • QPU Service Connection
  • Quantum object abstraction
  • Quantum Optimization
  • Second Quantization Functions
  • Tensor Network
  • Quantum Computation

Symbols

  • CliffordChannel
  • EinsteinSummation
  • GraphState
  • LocalComplement
  • PauliStabilizer
  • 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 Composition

Loading the framework and building the graph
Rendering the graph
The type taxonomy
Querying the graph
Reading an entry
Where this leaves us
Worked compositions
​
The public objects of
QuantumFramework
— states, operators, channels, circuits, measurements, transforms — compose with one another via typed transformations: a
QuantumOperator
acting on a
QuantumState
returns a
QuantumState
; a
QuantumDistance
of two
QuantumState
s returns a real number. This tech note introduces a paclet-agnostic tool, Wolfram/PacletFunctionGraph, that introspects any paclet and produces a directed function-relation graph capturing exactly these compositions. After working through it, you will be able to read the type signature of every public symbol, distinguish type-preserving from type-changing morphisms, and render or query the composition graph for any neighborhood of interest.

Loading the framework and building the graph

Load
QuantumFramework
and the Wolfram`PacletFunctionGraph` helper paclet. The latter is not yet published, so we point PacletDirectoryLoad at the dev copy in this repository. The Remove call clears any Global\` stubs interned by the front-end before the paclet was loaded, which would otherwise shadow the package's exports:
In[1]:=
Needs["Wolfram`QuantumFramework`"];​​​​PacletDirectoryLoad["~/QuantumFramework/OngoingProjects/Improving doc pages/PacletFunctionGraph"];​​Needs["Wolfram`PacletFunctionGraph`"];
Build the graph for QuantumFramework. BuildFunctionGraph loads the target paclet, walks its DownValues and SubValues to classify how every public symbol is called, and returns an Association keyed by symbol name. Predicate guards like _?QuantumStateQ or _?propQ are resolved automatically by walking each predicate's own DownValues — no manual configuration needed for any paclet:
In[4]:=
pacletRoot=ParentDirectory[NotebookDirectory[],3];​​graphData=BuildFunctionGraph[pacletRoot,"WriteFile"False];
The result is an Association. A top-level $Meta entry records when it was generated, the paclet identity, and any issues from generation:
In[6]:=
graphData["$Meta"]
Out[6]=
PacletWolfram/QuantumFramework,PacletVersion2.0.0,PrimaryContextWolfram`QuantumFramework`,GeneratedAt
Tue 12 May 2026 16:48:10GMT-7
,GenerationIssues{}
Symbol entries (one per public head) populate the rest of the Association:
In[7]:=
Keys[KeyDrop[graphData,"$Meta"]]
Out[7]=
{QuantumBasis,QuantumChannel,QuantumCircuitOperator,QuantumDistance,QuantumEntangledQ,QuantumEntanglementMonotone,QuantumEvolve,QuantumMeasurement,QuantumMeasurementOperator,QuantumMeasurementSimulation,QuantumOperator,QuantumPartialTrace,QuantumPhaseSpaceTransform,QuantumSimilarity,QuantumState,QuantumStateEstimate,QuantumTensorProduct,QuantumWignerTransform,QuditBasis,QuditName}

The type taxonomy

Every public head is classified into one of five Kinds. The Kind controls how the head fits into the composition picture:
Kind
Meaning
Examples
Constructor
Buildsanobjectofitsowntypefromrawdata.
QuantumState,QuantumBasis,QuantumMeasurement
Operator
Objectthatalsoactsasafunctiononatargetobject,typicallyreturningthesametype.
QuantumOperator,QuantumChannel,QuantumCircuitOperator
Transform
Functionthattakesoneobjectandreturnsthesameorarelatedtype.
QuantumPartialTrace,QuantumTensorProduct,QuantumWignerTransform
Predicate
FunctionreturningaBoolean(SymbolTrue|False).
QuantumEntangledQ
Distance
Functionreturningascalar(Real)fromtwostates.
QuantumDistance,QuantumSimilarity
Inspect the Kind distribution across the paclet:
In[8]:=
KeyValueMap[{#1,#2["Kind"]}&,KeyDrop[graphData,"$Meta"]]//TableForm
Out[8]//TableForm=
QuantumBasis
Constructor
QuantumChannel
Operator
QuantumCircuitOperator
Operator
QuantumDistance
Distance
QuantumEntangledQ
Predicate
QuantumEntanglementMonotone
Constructor
QuantumEvolve
Constructor
QuantumMeasurement
Constructor
QuantumMeasurementOperator
Operator
QuantumMeasurementSimulation
Constructor
QuantumOperator
Operator
QuantumPartialTrace
Transform
QuantumPhaseSpaceTransform
Transform
QuantumSimilarity
Distance
QuantumState
Constructor
QuantumStateEstimate
Constructor
QuantumTensorProduct
Transform
QuantumWignerTransform
Transform
QuditBasis
Constructor
QuditName
Constructor
The Kind tag drives vertex coloring in the rendered graphs (next section) and is the first filter when querying for symbols of a given role. A "Predicate" head is, for example, never a source of any outgoing flow edge — it returns a scalar, not a paclet object.

Reading an entry

Each symbol's entry records four fields: Kind, Accepts, OperatesOn, and ConsumedBy. Inspect QuantumState as an example:
In[9]:=
entry=graphData["QuantumState"];​​Keys[entry]
Out[10]=
{Kind,Accepts,OperatesOn,ConsumedBy}
Accepts is a list of input forms the head's constructor recognizes, classified by the WL
Head
of the user-typed argument and tagged with a Role: "Primary" (the canonical input), "Mutation" (constructor takes its own head to re-wrap), "Conversion" (takes another paclet head and reroutes), "NamedInstance" (a String like "Bell" selecting a catalog entry), "NamedArg" (a Rule like "Eigenvalues" -> v), or "PatternMachinery" (internal). Tally the heads to see the dominant input forms:
In[11]:=
Tally[#["Head"]&/@entry["Accepts"]]
Out[11]=
{{String,2},{Symbol,2},{SuperDagger,1},{Blank,1},{Association,1},{Rule,1},{QuantumOperator,1},{QuantumMeasurementOperator,1},{QuantumMeasurement,1},{QuantumChannel,1},{QuantumCircuitOperator,1},{QuditBasis,1},{QuantumBasis,1},{BlankNullSequence,2},{Except,1},{QuantumState,2},{PatternTest,1}}
Filter to just the entries whose Role is Primary or Conversion (the ones that produce graph edges):
In[12]:=
Select[entry["Accepts"],MemberQ[{"Primary","Mutation","Conversion"},#["Role"]]&]
Out[12]=
{HeadString,Description_String,RolePrimary,HeadSymbol,Descriptioncall form: (Wolfram`QuantumFramework`NamedStates`PackagePrivate`name:"Plus" | "Minus" | "Left" | "Right" | "PsiPlus" | "PsiMinus" | "PhiPlus" | "PhiMinus")[(Wolfram`QuantumFramework`NamedStates`PackagePrivate`n_Integer)?Positive],RolePrimary,HeadSuperDagger,Descriptioncall: SuperDagger[...],RolePrimary,HeadSymbol,Descriptioncall form: (Wolfram`QuantumFramework`NamedStates`PackagePrivate`name_String)[Wolfram`QuantumFramework`NamedStates`PackagePrivate`args___],RolePrimary,HeadAssociation,Description?AssociationQ,RolePrimary,HeadQuantumOperator,Description_QuantumOperator,RolePrimary,HeadQuantumMeasurementOperator,Description_QuantumMeasurementOperator,RolePrimary,HeadQuantumMeasurement,Description_QuantumMeasurement,RolePrimary,HeadQuantumChannel,Description_QuantumChannel,RolePrimary,HeadQuantumCircuitOperator,Description_QuantumCircuitOperator,RolePrimary,HeadQuditBasis,Description_QuditBasis,RoleConversion,HeadQuantumBasis,Description?QuantumBasisQ,RolePrimary,HeadBlankNullSequence,Description?QuantumBasisQ,RolePrimary,HeadQuantumState,Description?QuantumStateQ,RolePrimary,HeadBlankNullSequence,Description?QuantumStateQ,RolePrimary,HeadQuantumState,Description_QuantumState?QuantumStateQ,RoleMutation}
OperatesOn is non-
None
only for heads whose application has been recorded as F[args][target] in the kernel.
QuantumState
is a Constructor, not an Operator, so this is
None
:
In[13]:=
entry["OperatesOn"]
Out[13]=
StringHeadString,Descriptionliteral: "ValidQ",BlankHeadBlank,Description?propQ,QuantumStateHeadQuantumState,Description_QuantumState?QuantumStateQ,PatternSequenceHeadPatternSequence,Descriptioncall: PatternSequence[...],AssociationHeadAssociation,Description?AssociationQ
ConsumedBy is the reverse-edge list: every other paclet symbol that takes
QuantumState
as input. This answers “what can I pass a state into?”:
In[14]:=
entry["ConsumedBy"]
Out[14]=
{QuantumBasis,QuantumCircuitOperator,QuantumDistance,QuantumEntangledQ,QuantumEntanglementMonotone,QuantumMeasurement,QuantumMeasurementOperator,QuantumMeasurementSimulation,QuantumOperator,QuantumPartialTrace,QuantumPhaseSpaceTransform,QuantumSimilarity,QuantumState,QuantumTensorProduct,QuantumWignerTransform}

Worked compositions

The graph captures two structurally distinct kinds of composition. We walk through one example of each, then show a property-dispatch case that the graph deliberately does not record.

Type-preserving: operator application

An
Operator
-kind head applied to a target of type
T
typically returns a result of the same type
T
. In the flow graph this is a self-loop on
T
. Build a state, apply Pauli-X, and check the head:
In[15]:=
state=
QuantumState
["0"];​​operator=
QuantumOperator
["X"];​​result=operator[state];​​Head[result]
Out[18]=
QuantumState
Same head as the target. That preservation is precisely the OperatesOn field of an Operator-kind head, recording “what target type, what output type” for each application form:
In[19]:=
graphData["QuantumOperator"]["OperatesOn"]
Out[19]=
StringHeadString,Descriptionliteral: "ValidQ",BlankHeadBlank,Description?propQ,QuantumBasisHeadQuantumBasis,Description?QuantumBasisQ,BlankNullSequenceHeadBlankNullSequence,Descriptioncall: BlankNullSequence[...],QuantumStateHeadQuantumState,Description?QuantumStateQ,QuantumOperatorHeadQuantumOperator,Description?QuantumOperatorQ,QuantumMeasurementOperatorHeadQuantumMeasurementOperator,Description?QuantumMeasurementOperatorQ,QuantumChannelHeadQuantumChannel,Description?QuantumChannelQ,QuantumMeasurementHeadQuantumMeasurement,Description?QuantumMeasurementQ,QuantumCircuitOperatorHeadQuantumCircuitOperator,Description_QuantumCircuitOperator?QuantumCircuitOperatorQ,PatternSequenceHeadPatternSequence,Descriptioncall: PatternSequence[...],AssociationHeadAssociation,Description?AssociationQ

Type-changing: distance returns a Real

QuantumDistance's Accepts list confirms it consumes QuantumStates and a metric-name String:

Property dispatch (not captured by the graph)

Rendering the graph

The flow neighborhood of QuantumState: every incoming arrow is a head that flows into QuantumState (as constructor input or as the output of an operator that produces a state), and every outgoing arrow is a head that consumes a QuantumState. The bold black border marks the focal vertex; node color encodes Kind.
The paclet-wide flow view. Operator-like heads (green) cluster in the upper rows with self-loops indicating they preserve their target type; Transforms (yellow) sit one layer below; Distance / Predicate / Similarity (purple / red) are pure sinks with only incoming arrows:
If you only want the raw edge data, PacletFlowEdges returns a deduplicated list of {from, to} pairs. This is useful when feeding the graph into other tooling (e.g. computing centrality or partitioning):

Querying the graph

The graph is data — queryable with standard Association/list patterns.

What produces a QuantumState?

What consumes a QuantumState?

The mirror query: outgoing edges from QuantumState. Equivalent to (but easier to read than) the symmetric look-up in ConsumedBy:

Which heads are closed under their own action?

Which heads are sinks?

Where this leaves us

Three takeaways:
◼
  • • Every public QuantumFramework head has a typed signature recorded in the function-graph. The composition rules are not buried in kernel files — one call to BuildFunctionGraph produces a queryable Association.
  • The same workflow applies to any paclet: Needs["Wolfram`PacletFunctionGraph`"], BuildFunctionGraph["/path/to/SomePaclet"], then render or query.

    © 2026 Wolfram. All rights reserved.

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