---
title: GroupRegister (latest version)
description: API reference for samplomatic.virtual_registers.GroupRegister in the latest version of samplomatic
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/virtual-registers-group-register
---

# GroupRegister

*class* `samplomatic.virtual_registers.GroupRegister(virtual_gates: ndarray)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/group_register.py#L24-L91)

Bases: [`VirtualRegister`](/docs/api/samplomatic/auto/virtual-registers-virtual-register "samplomatic.virtual_registers.virtual_register.VirtualRegister")

A virtual register whose elements form a group.

**Methods Summary**

|                                                                                                                                                                                              |                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [`inplace_multiply`](#samplomatic.virtual_registers.GroupRegister.inplace_multiply "samplomatic.virtual_registers.GroupRegister.inplace_multiply")(other\[, subsystem\_idxs])                | Inplace-multiply each virtual gate with the corresponding element of `other`.      |
| [`invert`](#samplomatic.virtual_registers.GroupRegister.invert "samplomatic.virtual_registers.GroupRegister.invert")()                                                                       | Return a new virtual register that inverts each virtual gate.                      |
| [`left_inplace_multiply`](#samplomatic.virtual_registers.GroupRegister.left_inplace_multiply "samplomatic.virtual_registers.GroupRegister.left_inplace_multiply")(other\[, subsystem\_idxs]) | Left inplace-multiply each virtual gate with the corresponding element of `other`. |
| [`left_multiply`](#samplomatic.virtual_registers.GroupRegister.left_multiply "samplomatic.virtual_registers.GroupRegister.left_multiply")(other\[, subsystem\_idxs])                         | Left multiply each virtual gate with the corresponding element of `other`.         |
| [`multiply`](#samplomatic.virtual_registers.GroupRegister.multiply "samplomatic.virtual_registers.GroupRegister.multiply")(other\[, subsystem\_idxs])                                        | Multiply each virtual gate with the corresponding element of `other`.              |

**Methods Documentation**

### inplace\_multiply

*abstractmethod* `inplace_multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None))`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/group_register.py#L48-L60)

Inplace-multiply each virtual gate with the corresponding element of `other`.

**Parameters**

- **other** – Another virtual register of the same type.
- **subsystem\_idxs** – The indices of the subsystems to multiply, in self.

**Raises**

[**VirtualGateError**](/docs/api/samplomatic/auto/exceptions-virtual-gate-error "samplomatic.exceptions.VirtualGateError") – When the shapes do not match.

### invert

*abstractmethod* `invert() → T`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/group_register.py#L27-L29)

Return a new virtual register that inverts each virtual gate.

### left\_inplace\_multiply

`left_inplace_multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None))`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/group_register.py#L79-L91)

Left inplace-multiply each virtual gate with the corresponding element of `other`.

**Parameters**

- **other** – Another virtual register of the same type.
- **subsystem\_idxs** – The indices of the subsystems to multiply, in self.

**Raises**

[**VirtualGateError**](/docs/api/samplomatic/auto/exceptions-virtual-gate-error "samplomatic.exceptions.VirtualGateError") – When the shapes do not match.

### left\_multiply

`left_multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None)) → T`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/group_register.py#L62-L77)

Left multiply each virtual gate with the corresponding element of `other`.

**Parameters**

- **other** – Another virtual register of the same type.
- **subsystem\_idxs** – The indices of the subsystems to multiply, in self.

**Returns**

A new virtual register of the same type.

**Raises**

[**VirtualGateError**](/docs/api/samplomatic/auto/exceptions-virtual-gate-error "samplomatic.exceptions.VirtualGateError") – When the shapes do not match.

### multiply

*abstractmethod* `multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None)) → T`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/group_register.py#L31-L46)

Multiply each virtual gate with the corresponding element of `other`.

**Parameters**

- **other** – Another virtual register of the same type.
- **subsystem\_idxs** – The indices of the subsystems to multiply, in self.

**Returns**

A new virtual register of the same type.

**Raises**

[**VirtualGateError**](/docs/api/samplomatic/auto/exceptions-virtual-gate-error "samplomatic.exceptions.VirtualGateError") – When the shapes do not match.
