PauliFrame#
-
class cuquantum.
stabilizer. PauliFrame( - x_bits: ndarray | cp.ndarray,
- z_bits: ndarray | cp.ndarray,
- num_qubits: int | None = None,
- bit_packed: bool = False,
A weight-less Pauli string.
This class is primarily used for visualizing the simulation output and is not intended to be constructed in batch quantities. When provided with a device array, the bits are automatically transferred to the CPU and unpacked if needed.
If the intention is to calculate a property derived from many Pauli strings, the best performance is achieved by directly manipulating the GPU-based Pauli table.
Methods
- __init__(
- x_bits: ndarray | cp.ndarray,
- z_bits: ndarray | cp.ndarray,
- num_qubits: int | None = None,
- bit_packed: bool = False,
Initialize a PauliFrame.
x_bits and z_bits can both be either a CPU array or a GPU array. If
bit_packed=False: array withnum_qubitselements of dtypeuint8orboolIfbit_packed=True: array withceil(num_qubits/8)elements of dtypeuint32- Parameters:
x_bits – X bits for each qubit.
z_bits – Z bits for each qubit (same format as x_bits).
num_qubits – Number of qubits. Must be specified if
bit_packed=Truebit_packed – Whether the input bits are in packed format (default:
False)
Attributes