---
title: AddTerminalRightDressedBoxes (latest version)
description: API reference for samplomatic.transpiler.passes.AddTerminalRightDressedBoxes in the latest version of samplomatic
source: https://quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/transpiler-passes-add-terminal-right-dressed-boxes
---

# AddTerminalRightDressedBoxes

*class* `samplomatic.transpiler.passes.AddTerminalRightDressedBoxes(*args, **kwargs)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/transpiler/passes/add_terminal_right_dressed_boxes.py#L69-L208)

Bases: [`TransformationPass`](/docs/api/qiskit/qiskit.transpiler.TransformationPass)

Add right-dressed boxes to collect uncollected virtual gates emitted by left-dressed boxes.

> **Note**
>
> All boxes added by this pass are empty, so consider combining this pass with [`AbsorbSingleQubitGates`](/docs/api/samplomatic/auto/transpiler-passes-absorb-single-qubit-gates "samplomatic.transpiler.passes.AbsorbSingleQubitGates") if you would like nearby single-qubit gates to be placed into the boxes this pass adds.

**Parameters**

- **group** – The group to use for the box.
- **decomposition** – The decomposition to use for the box.

**Methods Summary**

|                                                                                                                                                |                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`run`](#samplomatic.transpiler.passes.AddTerminalRightDressedBoxes.run "samplomatic.transpiler.passes.AddTerminalRightDressedBoxes.run")(dag) | Add right-dressed boxes to collect the uncollected leftwards virtual gates emitted. |

**Methods Documentation**

### run

`run(dag: DAGCircuit) → DAGCircuit`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/transpiler/passes/add_terminal_right_dressed_boxes.py#L159-L208)

Add right-dressed boxes to collect the uncollected leftwards virtual gates emitted.
