def _apply_mixture_from_mixture_strat(
    val: Any, args: ApplyMixtureArgs, is_density_matrix: bool
) -> np.ndarray | None:
    """Attempt to use unitary matrices in _mixture_ and return the result."""
    method = getattr(val, '_mixture_', None)
    if method is None:
        return None
    prob_mix = method()
    if prob_mix is NotImplemented or prob_mix is None:
        return None
    args.out_buffer[:] = 0
    np.copyto(dst=args.auxiliary_buffer1, src=args.target_tensor)
    for prob, op in prob_mix:
        np.copyto(dst=args.target_tensor, src=args.auxiliary_buffer1)
        right_result = _apply_unitary_strat(op, args, is_density_matrix)
        if right_result is None:
            right_result = _apply_unitary_from_matrix_strat(op, args, is_density_matrix)

        args.out_buffer += prob * right_result

    return args.out_buffer
Attempt to use unitary matrices in _mixture_ and return the result.
cirq-core/cirq/protocols/apply_mixture_protocol.py