def _check_qwc(pauli1, pauli2):
    """Checks whether two pauli terms are qubitwise commute to each other

    :param pauli1, pauli2: Pauli term in the form of a string
    """
    for index in range(len(pauli1)):
        sigma1 = pauli1[index]
        sigma2 = pauli2[index]
        if 'i' in [sigma1, sigma2]:
            continue
        elif sigma1 == sigma2:
            continue
        else:
            return False

    return True