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: Iterable[float] | None = None)[source]

Bases: PreNode

The propagation node type used during samplex building.

Attributes Summary

bounded_params

List of bounded params if operation is a fractional gate with a bounded parameter.

direction

The direction of virtual gates that cat 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.

Methods Summary

get_style()

Summarizes the style of this node when plotted via plot_graph().

Attributes Documentation

bounded_params: Iterable[float] | None = 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.

direction: Direction = <dataclasses._MISSING_TYPE object>

The direction of virtual gates that cat interact with this node.

mode: InstructionMode = <dataclasses._MISSING_TYPE object>

How the operation acts on virtual gates.

operation: Gate = <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: list[tuple[int | None, ParameterExpression]] = <dataclasses._MISSING_TYPE object>

The parameters required by the node.

partition: Partition[int] = <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: Partition[int] = <dataclasses._MISSING_TYPE object>

The subsystems that virtual gates act on.

Methods Documentation

get_style()[source]

Summarizes the style of this node when plotted via plot_graph().