GroupRegister
class samplomatic.virtual_registers.GroupRegister(virtual_gates: ndarray)
Bases: VirtualRegister
A virtual register whose elements form a group.
Methods Summary
Column 1 | Column 2 |
|---|---|
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. |
left_inplace_multiply(other[, subsystem_idxs]) | Left inplace-multiply each virtual gate with the corresponding element of other. |
left_multiply(other[, subsystem_idxs]) | Left multiply each virtual gate with the corresponding element of other. |
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))
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
left_inplace_multiply
left_inplace_multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None))
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 – When the shapes do not match.
left_multiply
left_multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None)) → T
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 – When the shapes do not match.
multiply
abstractmethod multiply(other: T, subsystem_idxs: list[int] | slice = slice(None, None, None)) → T
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.