---
title: CollectionNode (latest version)
description: API reference for samplomatic.samplex.nodes.CollectionNode in the latest version of samplomatic
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/samplex-nodes-collection-node
---

# CollectionNode

*class* `samplomatic.samplex.nodes.CollectionNode`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/collection_node.py#L25-L45)

Bases: [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC), [`Node`](/docs/api/samplomatic/auto/samplex-nodes-node "samplomatic.samplex.nodes.node.Node")

A node that collects register state for return.

**Methods Summary**

|                                                                                                                                            |                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
| [`collect`](#samplomatic.samplex.nodes.CollectionNode.collect "samplomatic.samplex.nodes.CollectionNode.collect")(registers, outputs, rng) | Collect.                                    |
| [`get_style`](#samplomatic.samplex.nodes.CollectionNode.get_style "samplomatic.samplex.nodes.CollectionNode.get_style")()                  | Return the style of this node when plotted. |

**Methods Documentation**

### collect

*abstractmethod* `collect(registers: dict[str, VirtualRegister], outputs: SamplexOutput, rng: Generator)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/collection_node.py#L28-L38)

Collect.

**Parameters**

- **registers** – Registers to collect from.
- **outputs** – Where to output.
- **rng** – A randomness generator.

### get\_style

`get_style()`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/samplex/nodes/collection_node.py#L40-L45)

Return the style of this node when plotted.
