def __init__(
        self,
        target_tensor: np.ndarray,
        out_buffer: np.ndarray,
        auxiliary_buffer0: np.ndarray,
        auxiliary_buffer1: np.ndarray,
        left_axes: Iterable[int],
        right_axes: Iterable[int] | None = None,
    ):
        """Args for apply mixture.

        Args:
            target_tensor: The input tensor that needs to be left (and
                potentially right) multiplied and summed, representing the
                effect of the mixture. The tensor will have the shape
                (2, 2, 2, ..., 2). It can  correspond to a state vector or a
                density matrix.
            out_buffer: Pre-allocated workspace with the same shape and
                dtype as the target tensor. If buffers are used, the result
                should end up in this buffer. It is the responsibility of
                calling code to notice if the result is this buffer.
            auxiliary_buffer0: Pre-allocated workspace with the same shape and
                dtype as the target tensor.
            auxiliary_buffer1: Pre-allocated workspace with the same shape
                and dtype as the target tensor.
            left_axes: Which axes to multiply the left action of the mixture
                upon.
            right_axes: Which axes to multiply the right action of the mixture
                upon. If provided we will assume `target_tensor` is a density
                matrix, otherwise it will be assumed `target_tensor` is a
                state vector.
        """
        self.target_tensor = target_tensor
        self.out_buffer = out_buffer
        self.auxiliary_buffer0 = auxiliary_buffer0
        self.auxiliary_buffer1 = auxiliary_buffer1
        self.left_axes = tuple(left_axes)
        self.right_axes = None
        if right_axes is not None:
            self.right_axes = tuple(right_axes)
Args for apply mixture.

        Args:
            target_tensor: The input tensor that needs to be left (and
                potentially right) multiplied and summed, representing the
                effect of the mixture. The tensor will have the shape
                (2, 2, 2, ..., 2). It can  correspond to a state vector or a
                density matrix.
            out_buffer: Pre-allocated workspace with the same shape and
                dtype as the target tensor. If buffers are used, the result
                should end up in this buffer. It is the responsibility of
                calling code to notice if the result is this buffer.
            auxiliary_buffer0: Pre-allocated workspace with the same shape and
                dtype as the target tensor.
            auxiliary_buffer1: Pre-allocated workspace with the same shape
                and dtype as the target tensor.
            left_axes: Which axes to multiply the left action of the mixture
                upon.
            right_axes: Which axes to multiply the right action of the mixture
                upon. If provided we will assume `target_tensor` is a density
                matrix, otherwise it will be assumed `target_tensor` is a
                state vector.
        
cirq-core/cirq/protocols/apply_mixture_protocol.py