C1Register

class samplomatic.virtual_registers.C1Register(virtual_gates: ndarray)[source]

Bases: FiniteGroupRegister

Virtual register of C1 gates.

Here, we use an integer representation constructed from flattening the six cosets of the Pauli subgroup and the subgroup itself. Concretely, a value \(c\) corresponds to the unitary \(G^i H^j P(k)\) where \(k = c % 4, j = c // 4 % 2, i = c // 8 % 3\) and \(G = HS\).

Attributes Summary

CONVERTABLE_TYPES

Valid arguments for convert_to().

GATE_SHAPE

The array shape of any single virtual gate.

SUBSYSTEM_SIZE

The number of qubits each virtual gate acts on.

TYPE

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

inverse_table

The lookup table for the inverse.

lookup_table

The lookup table for the group operation.

Methods Summary

convert_to(register_type)

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

from_tableau(tableaus)

Return a new register from an array of tableaus.

identity(num_subsystems, num_samples)

Instantiate a new register of identity virtual gates.

to_tableau()

Return an array of tableaus with the same shape as this.

Attributes Documentation

CONVERTABLE_TYPES: frozenset[VirtualType] = frozenset({VirtualType.C1, VirtualType.U2})

Valid arguments for convert_to().

GATE_SHAPE: tuple[int, ...] = ()

The array shape of any single virtual gate.

SUBSYSTEM_SIZE: int = 1

The number of qubits each virtual gate acts on.

TYPE: VirtualType = 'c1'

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

inverse_table
lookup_table

Methods Documentation

convert_to(register_type)[source]

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.

classmethod from_tableau(tableaus: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) C1Register[source]

Return a new register from an array of tableaus.

Parameters:

tableaus – The tableaus corresponding the registers.

Returns:

A virtual register in the enumerated representation.

classmethod identity(num_subsystems, num_samples)[source]

Instantiate a new register of identity virtual gates.

to_tableau() ndarray[source]

Return an array of tableaus with the same shape as this.

Returns:

An array of tableaus.