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

# samplomatic.Tag

*class* `samplomatic.Tag(ref: str = '')`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/annotations/tag.py#L18-L49)

Annotation to tag and instruction with a string reference.

When present on a `box` instruction, the barriers emitted during [`build()`](/docs/api/samplomatic/auto/build "samplomatic.build") include the `ref` of this annotation as part of their label information. In this way, when combined with the build function, a tag annotation can be used as a tracing mechanism to tie a “barrier sandwich” in a template circuit back to the box it came from in the original circuit.

**Parameters**

**ref** – A reference string.

### \_\_init\_\_

`__init__(ref: str = '')`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/annotations/tag.py#L33-L34)

## Methods

|                                                                            |   |
| -------------------------------------------------------------------------- | - |
| [`__init__`](#samplomatic.Tag.__init__ "samplomatic.Tag.__init__")(\[ref]) |   |

## Attributes

|             |                                   |
| ----------- | --------------------------------- |
| `namespace` |                                   |
| `ref`       | The reference string of this tag. |
