PrePropagate
class samplomatic.pre_samplex.PrePropagate(subsystems: Partition[int], direction: Direction, operation: Gate, partition: Partition[int], mode: InstructionMode, params: list[tuple[int | None, ParameterExpression]], bounded_params: list[float] | None = None, commutant_twirl: bool = False, *, trace_info: TraceInfo | None = None)
Bases: PreNode
The propagation node type used during samplex building.
Attributes Summary
Column 1 | Column 2 |
|---|---|
bounded_params | List of bounded params if operation is a fractional gate with a bounded parameter. |
commutant_twirl | Whether this operation should be twirled with its commutant. |
direction | The direction of virtual gates that can interact with this node. |
mode | How the operation acts on virtual gates. |
operation | The operation to propagate through. |
params | The parameters required by the node. |
partition | A partition of subsystem indices, each of which is propagated jointly. |
subsystems | The subsystems that virtual gates act on. |
trace_info | Debug trace information, populated when building with debug=True. |
Methods Summary
Column 1 | Column 2 |
|---|---|
from_cluster(nodes) | |
get_style() | Summarizes the style of this node when plotted via plot_graph(). |
to_key() |
Attributes Documentation
bounded_params
Default value: None
List of bounded params if operation is a fractional gate with a bounded parameter.
If the node involves a relevant operation with a single subsystem, the parameter is automatically extracted from the operation.
commutant_twirl
Type: bool
Default value: False
Whether this operation should be twirled with its commutant.
If the operation is not a fractional gate, this value will be False. If it is a fractional gate, True signals that it should be twirled by its commutant, while False signals that its angle has been bound to a Clifford.
direction
Type: Direction
Default value: <dataclasses._MISSING_TYPE object>
The direction of virtual gates that can interact with this node.
mode
Type: InstructionMode
Default value: <dataclasses._MISSING_TYPE object>
How the operation acts on virtual gates.
operation
Type: Gate
Default value: <dataclasses._MISSING_TYPE object>
The operation to propagate through.
Even when the PrePropagate represents more than one subsystem (i.e more than one operation) only a single common Gate object is stored, and possible parameters are stored elsewhere.
params
Type: list[tuple[int | None, ParameterExpression]]
Default value: <dataclasses._MISSING_TYPE object>
The parameters required by the node.
partition
Default value: <dataclasses._MISSING_TYPE object>
A partition of subsystem indices, each of which is propagated jointly.
For example, a CX gate propagates pairs of single-qubit subsystems jointly. In this case, a partition would be a list of pairs of subsystem indices, where pairs are disjoint from each other.
subsystems
Default value: <dataclasses._MISSING_TYPE object>
The subsystems that virtual gates act on.
trace_info
Type: TraceInfo | None
Default value: None
Debug trace information, populated when building with debug=True.
Methods Documentation
from_cluster
classmethod from_cluster(nodes: list[PrePropagate]) → PrePropagate
get_style
to_key
to_key() → PrePropagateKey