def _apply_unitary_strat(
    val: Any, args: ApplyMixtureArgs, is_density_matrix: bool
) -> np.ndarray | None:
    """Attempt to use `apply_unitary` and return the result.

    If `val` does not support `apply_unitary` returns None.
    """
    left_args = ApplyUnitaryArgs(
        target_tensor=args.target_tensor,
        available_buffer=args.auxiliary_buffer0,
        axes=args.left_axes,
    )
    left_result = apply_unitary(val, left_args, None)
    if left_result is None:
        return None

    if not is_density_matrix:
        return left_result

    # cast is ok, is_density_matrix being false tells us right_axes isn't None.
    right_args = ApplyUnitaryArgs(
        target_tensor=np.conjugate(left_result),
        available_buffer=args.auxiliary_buffer0,
        axes=cast(tuple[int], args.right_axes),
    )
    right_result = apply_unitary(val, right_args)
    np.conjugate(right_result, out=right_result)
    return right_result
Attempt to use `apply_unitary` and return the result.

    If `val` does not support `apply_unitary` returns None.
    
cirq-core/cirq/protocols/apply_mixture_protocol.py