def kron(*factors: np.ndarray | complex, shape_len: int = 2) -> np.ndarray:
    """Computes the kronecker product of a sequence of values.

    A *args version of lambda args: functools.reduce(np.kron, args).

    Args:
        *factors: The matrices, tensors, and/or scalars to combine together
            using np.kron.
        shape_len: The expected number of dimensions in the output. Mainly
            determines the behavior of the empty kron product.

    Returns:
        The kronecker product of all the inputs.
    """
    product: np.ndarray = np.ones(shape=(1,) * shape_len)
    for m in factors:
        product = np.kron(product, m)
    return np.array(product)
Computes the kronecker product of a sequence of values.

    A *args version of lambda args: functools.reduce(np.kron, args).

    Args:
        *factors: The matrices, tensors, and/or scalars to combine together
            using np.kron.
        shape_len: The expected number of dimensions in the output. Mainly
            determines the behavior of the empty kron product.

    Returns:
        The kronecker product of all the inputs.
    
cirq-core/cirq/linalg/combinators.py