---
title: PreEdge (latest version)
description: API reference for samplomatic.pre_samplex.PreEdge in the latest version of samplomatic
source: https://quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/pre-samplex-pre-edge
---

# PreEdge

*class* `samplomatic.pre_samplex.PreEdge(subsystems: Partition[int], direction: Direction, force_register_copy: bool = False)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/pre_samplex/graph_data.py#L69-L96)

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object)

Edge data on a samplex builder’s graph.

**Attributes Summary**

|                                                                                                                                     |                                                                                 |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [`direction`](#samplomatic.pre_samplex.PreEdge.direction "samplomatic.pre_samplex.PreEdge.direction")                               | Whether the edge is moving forwards or backwards in circuit-time.               |
| [`force_register_copy`](#samplomatic.pre_samplex.PreEdge.force_register_copy "samplomatic.pre_samplex.PreEdge.force_register_copy") | Whether the edge should force the receiving node to get a copy of the register. |
| [`subsystems`](#samplomatic.pre_samplex.PreEdge.subsystems "samplomatic.pre_samplex.PreEdge.subsystems")                            | The subsystems that virtual gates act on.                                       |

**Methods Summary**

|                                                                                                                                       |                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`add_subsystems`](#samplomatic.pre_samplex.PreEdge.add_subsystems "samplomatic.pre_samplex.PreEdge.add_subsystems")(new\_subsystems) | Add subsystems to an existing `PreEdge`                                                                                                                          |
| [`get_style`](#samplomatic.pre_samplex.PreEdge.get_style "samplomatic.pre_samplex.PreEdge.get_style")()                               | Summarizes the style of this node when plotted via [`plot_graph()`](/docs/api/samplomatic/auto/visualization-plot-graph "samplomatic.visualization.plot_graph"). |

**Attributes Documentation**

### direction

Type: [`Direction`](/docs/api/samplomatic/auto/constants-direction "samplomatic.constants.Direction")

Default value: `<dataclasses._MISSING_TYPE object>`

Whether the edge is moving forwards or backwards in circuit-time.

### force\_register\_copy

Type: [`bool`](https://docs.python.org/3/builtins/functions.html#bool)

Default value: `False`

Whether the edge should force the receiving node to get a copy of the register.

### subsystems

Type: [`Partition`](/docs/api/samplomatic/auto/partition-partition "samplomatic.partition.Partition")\[[`int`](https://docs.python.org/3/builtins/functions.html#int)]

Default value: `<dataclasses._MISSING_TYPE object>`

The subsystems that virtual gates act on.

**Methods Documentation**

### add\_subsystems

`add_subsystems(new_subsystems: Partition[int])`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/pre_samplex/graph_data.py#L93-L96)

Add subsystems to an existing `PreEdge`

### get\_style

`get_style() → EdgeStyle`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/pre_samplex/graph_data.py#L82-L91)

Summarizes the style of this node when plotted via [`plot_graph()`](/docs/api/samplomatic/auto/visualization-plot-graph "samplomatic.visualization.plot_graph").
