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

# SamplingNode

*class* `samplomatic.samplex.nodes.SamplingNode`

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

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 produces samples.

**Methods Summary**

|                                                                                                                                         |                                             |
| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`get_style`](#samplomatic.samplex.nodes.SamplingNode.get_style "samplomatic.samplex.nodes.SamplingNode.get_style")()                   | Return the style of this node when plotted. |
| [`sample`](#samplomatic.samplex.nodes.SamplingNode.sample "samplomatic.samplex.nodes.SamplingNode.sample")(registers, rng, inputs, ...) | Sample this node.                           |

**Methods Documentation**

### get\_style

`get_style()`

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

Return the style of this node when plotted.

### sample

*abstractmethod* `sample(registers: dict[str, VirtualRegister], rng: Generator, inputs: TensorInterface, num_randomizations: int)`

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

Sample this node.

**Parameters**

- **registers** – Where to sample into.
- **rng** – A randomness generator.
- **inputs** – Inputs of the sampling program.
- **num\_randomizations** – How many randomizations to draw.
