C1Register¶
- class samplomatic.virtual_registers.C1Register(virtual_gates: ndarray)[source]¶
Bases:
FiniteGroupRegisterVirtual 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
Valid arguments for
convert_to().The array shape of any single virtual gate.
The number of qubits each virtual gate acts on.
The group name in 1-1 correspondence with this virtual gate type.
The lookup table for the inverse.
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.
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().
- 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.