def anticom(A,B):
    """
    Compute the anticommutator between matrices A and B.
    
    Arguments:
        A,B -- square matrices 
    
    Return:
        antcom -- square matrix of the anticommutator {A,B}

    """
    antcom = A.dot(B) + B.dot(A)
    return antcom