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

# PauliRegister

*class* `samplomatic.virtual_registers.PauliRegister(virtual_gates)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/pauli_register.py#L38-L120)

Bases: [`GroupRegister`](/docs/api/samplomatic/auto/virtual-registers-group-register "samplomatic.virtual_registers.group_register.GroupRegister")

Virtual register of virtual projective Pauli gates.

Here, projective means we are modding out the centralizer, in other words, ignoring phases.

The Paulis I, X, Y, and Z correspond to 0, 2, 3, and 1 respectively. The non-alphabetical assignment of Y and Z is because it is more convenient in most calculations to have them in symplectic ordering. I.e., for a projective Pauli operation $P = X^x Z^z$ with $x,z\in\mathbb{Z}_2$, we order according to binary number zx.

**Attributes Summary**

|                                                                                                                                                       |                                                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`CONVERTABLE_TYPES`](#samplomatic.virtual_registers.PauliRegister.CONVERTABLE_TYPES "samplomatic.virtual_registers.PauliRegister.CONVERTABLE_TYPES") | Valid arguments for [`convert_to()`](#samplomatic.virtual_registers.PauliRegister.convert_to "samplomatic.virtual_registers.PauliRegister.convert_to"). |
| [`GATE_SHAPE`](#samplomatic.virtual_registers.PauliRegister.GATE_SHAPE "samplomatic.virtual_registers.PauliRegister.GATE_SHAPE")                      | The array shape of any single virtual gate.                                                                                                             |
| [`SUBSYSTEM_SIZE`](#samplomatic.virtual_registers.PauliRegister.SUBSYSTEM_SIZE "samplomatic.virtual_registers.PauliRegister.SUBSYSTEM_SIZE")          | The number of qubits each virtual gate acts on.                                                                                                         |
| [`TYPE`](#samplomatic.virtual_registers.PauliRegister.TYPE "samplomatic.virtual_registers.PauliRegister.TYPE")                                        | The group name in 1-1 correspondence with this virtual gate type.                                                                                       |

**Methods Summary**

|                                                                                                                                                                               |                                                                               |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [`convert_to`](#samplomatic.virtual_registers.PauliRegister.convert_to "samplomatic.virtual_registers.PauliRegister.convert_to")(register\_type)                              | Convert this register type to some other type, if possible.                   |
| [`from_name`](#samplomatic.virtual_registers.PauliRegister.from_name "samplomatic.virtual_registers.PauliRegister.from_name")(name)                                           | Return a Pauli register given its name.                                       |
| [`identity`](#samplomatic.virtual_registers.PauliRegister.identity "samplomatic.virtual_registers.PauliRegister.identity")(num\_subsystems, num\_samples)                     | Instantiate a new register of identity virtual gates.                         |
| [`inplace_multiply`](#samplomatic.virtual_registers.PauliRegister.inplace_multiply "samplomatic.virtual_registers.PauliRegister.inplace_multiply")(other\[, subsystem\_idxs]) | Inplace-multiply each virtual gate with the corresponding element of `other`. |
| [`invert`](#samplomatic.virtual_registers.PauliRegister.invert "samplomatic.virtual_registers.PauliRegister.invert")()                                                        | Return a new virtual register that inverts each virtual gate.                 |
| [`multiply`](#samplomatic.virtual_registers.PauliRegister.multiply "samplomatic.virtual_registers.PauliRegister.multiply")(other\[, subsystem\_idxs])                         | Multiply each virtual gate with the corresponding element of `other`.         |

**Attributes Documentation**

### CONVERTABLE\_TYPES

Type: [`frozenset`](https://docs.python.org/3/builtins/stdtypes.html#frozenset)\[[`VirtualType`](/docs/api/samplomatic/auto/virtual-registers-virtual-type "samplomatic.virtual_registers.virtual_type.VirtualType")]

Default value: `frozenset({VirtualType.C1, VirtualType.PAULI, VirtualType.U2, VirtualType.Z2})`

Valid arguments for [`convert_to()`](#samplomatic.virtual_registers.PauliRegister.convert_to "samplomatic.virtual_registers.PauliRegister.convert_to").

### GATE\_SHAPE

Type: [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple)\[[`int`](https://docs.python.org/3/builtins/functions.html#int), ...]

Default value: `()`

The array shape of any single virtual gate.

### SUBSYSTEM\_SIZE

Type: [`int`](https://docs.python.org/3/builtins/functions.html#int)

Default value: `1`

The number of qubits each virtual gate acts on.

### TYPE

Type: [`VirtualType`](/docs/api/samplomatic/auto/virtual-registers-virtual-type "samplomatic.virtual_registers.virtual_type.VirtualType")

Default value: `'pauli'`

The group name in 1-1 correspondence with this virtual gate type.

**Methods Documentation**

### convert\_to

`convert_to(register_type)`

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

Convert this register type to some other type, if possible.

**Parameters**

**register\_type** – The type of register to convert to.

**Returns**

A new register of the specified output type, or this instance if its type is `register_type`.

**Raises**

[**VirtualGateError**](/docs/api/samplomatic/auto/exceptions-virtual-gate-error "samplomatic.exceptions.VirtualGateError") – If this type cannot be converted to the specified type.

### from\_name

*classmethod* `from_name(name: str) → PauliRegister`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/pauli_register.py#L66-L81)

Return a Pauli register given its name.

**Parameters**

**name** – The name of the Pauli.

Returns: The Pauli register.

**Raises**

[**VirtualGateError**](/docs/api/samplomatic/auto/exceptions-virtual-gate-error "samplomatic.exceptions.VirtualGateError") – If `name` is not in ‘PAULI\_GATE\_NAMES’.

### identity

*classmethod* `identity(num_subsystems, num_samples)`

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

Instantiate a new register of identity virtual gates.

### inplace\_multiply

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

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/pauli_register.py#L104-L113)

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

`invert()`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/pauli_register.py#L115-L116)

Return a new virtual register that inverts each virtual gate.

### multiply

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

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/virtual_registers/pauli_register.py#L93-L102)

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.
