Expand description
The Rust core of paulistrings-rs: operators evolved in the Pauli basis under gates and noise channels, stored as a GF(2)-bucketed PauliSum and optionally partitioned over NUMA domains, MPI ranks or CUDA devices.
These docs are a developer guide; the user-facing API is the Python package, documented at https://lkdvos.github.io/paulistrings-rs/.
Structs§
- And
- Both policies: a term is kept if both keep it, and both layer passes run, first then second.
- Approx
TopN - Retain
nterms, cutting at an octave of|c|²instead of selecting exactly. - Build
Accumulator - Incremental builder for a
crate::PauliSumfrom unsorted terms; repeated keys sum. - Circuit
- An ordered list of channels on
num_qubitsqubits, user-definedcrate::Channelimpls included. - Coefficient
Threshold - Drop terms whose coefficient magnitude is at most
epsilon. - Collapse
Sample - Replace the sum by one Pauli string, drawn with probability
|c|² / Σ|c|²and given coefficient1, whenever it holds more thancacheterms. - CpuSet
- A set of logical CPU indices; an unsorted literal is tolerated, since every consumer normalizes.
- Device
Layer Record - What one device partition counted for a layer beyond the shared record.
- Distributed
Sum - One process’s partition of a sum split across a
Transport’s group, held across calls so a driver scatters once, steps many times and gathers once. - Gf2Hash
- The GF(2)-linear hash
h(v) = H·vfrom a Pauli keyv = (x, z)to a bucket index, for a dense randomHdrawn from a seed. - Layer
Scratch - Reusable layer working set for
propagate_with, which keeps its capacity across layers and calls and carries the opt-in traces. - Or
- Either of two per-term filters: a term is kept if either keeps it.
- Output
Buffer - The terms one
Channel::applycall emits, pushed withpush. - Partition
Config - Placement plus the knobs the partitioned engine reads alongside it.
- Partition
Layer Record - What one layer did across the whole group; the per-partition vectors are indexed by rank.
- Partition
Rows - The
pGF(2) rowspart(v) = P·vthat split a sum across2^ppartitions: a partition holds exactly the terms withpart(v)equal to its rank. - Partition
Runtime - The resolved placement and its pinned pools, built once and shared behind an
Arcby everyPartitionedSumthat runs on it. - Partition
Trace - Per-layer records of propagations in application order, accumulated until drained by a driver’s
take_trace. - Partitioned
Sum - A
PauliSumsplit across the partitions of aPartitionRuntime, held across calls so a driver scatters and gathers once. - Pauli
Rotation - A rotation
U = exp(-i · θ · P / 2)about a Pauli generatorPof any weight. - Pauli
String - A Pauli operator on up to
64·Wqubits,Wbeing the number of 64-bit words perx/zpart. - Pauli
Sum - Weighted sum of Pauli strings, stored as structure-of-arrays columns partitioned into buckets by a GF(2)-linear hash.
- Phase
- A phase factor
i^kwithk ∈ {0, 1, 2, 3};+multiplies phases. - Product
Basis - A product of single-qubit stabilizer states, one per qubit: on qubit
qan axisA_q ∈ {X, Y, Z}with a signs_q ∈ {+1, -1}, i.e.|ψ⟩ = ⊗_q |A_q, s_q⟩. - Propagate
Options - Tuning knobs for
propagate_with;Defaultis whatpropagateuses. - PtmChannel
- A one- or two-qubit gate or noise channel, stored as its Pauli-transfer matrix.
- Scatter
Options - How a
scatter_withruns its partitions and picks the rows the sum splits by. - Stabilizer
State - A stabilizer state on
num_qubitsqubits, held as a reduced tableau of signed generators. - TopN
- Retain the
nterms of largest coefficient magnitude. - Weight
Cutoff - Drop terms whose Pauli weight (number of non-identity qubits) exceeds
k.
Enums§
- Builtin
Truncation - Any builtin policy or combinator as one runtime value, the form the device drivers take.
- Direction
- Propagation direction: channels in order, or in reverse with adjoints for backpropagating observables.
- Partition
RowPolicy - Which partition rows a scatter splits by: a seeded GF(2)-random draw, or a qubit cut that keeps a channel local when its qubits share a block.
- Pauli
Axis - One of the three single-qubit Pauli axes: the axis a
ProductBasisqubit is an eigenstate of. - Placement
- How partitions map onto the machine.
- Scatter
Rows - The partition rows a
scatter_withsplits by. - Stabilizer
Error - Why a set of generators does not define a stabilizer state.
- Topology
Error - What can go wrong discovering topology or resolving a
PartitionConfig.
Constants§
- P_
MAX_ BITS - Maximum number of partition bits, i.e.
P ≤ 64partitions.
Traits§
- Channel
- A gate or noise channel: maps a Pauli string to a small weighted sum of Pauli strings.
- Collectives
- The group operations a partition needs besides the exchange: its rank, the reductions, and a barrier.
- Transport
- The per-layer all-to-all exchange between the partitions of a group.
- Truncation
Policy - A truncation strategy: a per-term filter, a per-layer pass, or both.
Functions§
- numa_
nodes - The NUMA nodes visible in the current affinity mask, ascending by node id, each intersected with the mask.
- propagate
- Propagate
sumthroughcircuitunderpolicy. - propagate_
partitioned - Propagates
sumthroughcircuiton a partitioned engine built fromconfig, and gathers the result. - propagate_
with propagatewith a caller-heldLayerScratchandPropagateOptions.- support_
mask - Pack qubit indices into a
Channel::supportbitmask; order and duplicates do not matter.