def METHOD_NAME(state):
    """Calculates the purity of the partial trace of a two-qubit state."""
    mat = np.reshape(state, (2, 2))
    reduced_rho = np.dot(mat, np.conj(mat.T))
    return np.trace(np.dot(reduced_rho, reduced_rho))