Skip to main content
IBM Quantum Platform

PauliRegister

class samplomatic.virtual_registers.PauliRegister(virtual_gates)

GitHub

Bases: 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=XxZzP = X^x Z^z with x,z∈Z2x,z\in\mathbb{Z}_2, we order according to binary number zx.

Attributes Summary

Column 1
Column 2
CONVERTABLE_TYPESValid arguments for convert_to().
GATE_SHAPEThe array shape of any single virtual gate.
SUBSYSTEM_SIZEThe number of qubits each virtual gate acts on.
TYPEThe group name in 1-1 correspondence with this virtual gate type.

Methods Summary

Column 1
Column 2
convert_to(register_type)Convert this register type to some other type, if possible.
from_name(name)Return a Pauli register given its name.
identity(num_subsystems, num_samples)Instantiate a new register of identity virtual gates.
inplace_multiply(other[, subsystem_idxs])Inplace-multiply each virtual gate with the corresponding element of other.
invert()Return a new virtual register that inverts each virtual gate.
multiply(other[, subsystem_idxs])Multiply each virtual gate with the corresponding element of other.

Attributes Documentation

CONVERTABLE_TYPES

Type: frozenset[VirtualType]

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

Valid arguments for convert_to().

GATE_SHAPE

Type: tuple[int, ...]

Default value: ()

The array shape of any single virtual gate.

SUBSYSTEM_SIZE

Type: int

Default value: 1

The number of qubits each virtual gate acts on.

TYPE

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

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 – If this type cannot be converted to the specified type.

from_name

classmethod from_name(name: str) → PauliRegister

GitHub

Return a Pauli register given its name.

Parameters

name – The name of the Pauli.

Returns: The Pauli register.

Raises

VirtualGateError – If name is not in ‘PAULI_GATE_NAMES’.

identity

classmethod identity(num_subsystems, num_samples)

GitHub

Instantiate a new register of identity virtual gates.

inplace_multiply

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

GitHub

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 – When the shapes do not match.

invert

invert()

GitHub

Return a new virtual register that inverts each virtual gate.

multiply

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

GitHub

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 – When the shapes do not match.

Was this page helpful?
Report a bug, typo, or request content on GitHub.