Interestingly, the transitive_closure() function in networkx (a python package) also doesn't create loops:
$ ipython
Python 3.6.4 (default, Dec 20 2017, 09:47:54)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import networkx as nx
In [2]: import numpy as np
In [3]: a = np.array([[0, 1, 1], [1, 0, 1], [1, 1, 0]])
In [4]: a
Out[4]:
array([[0, 1, 1],
[1, 0, 1],
[1, 1, 0]])
In [5]: G = nx.from_numpy_matrix(a, create_using=nx.MultiDiGraph())
In [6]: T = nx.transitive_closure(G)
In [7]: nx.to_numpy_matrix(T)
Out[7]:
matrix([[0., 2., 2.],
[2., 0., 2.],
[2., 2., 0.]])
The value '2' simply means two edges. But the diagonal values are all 0, just like in Mathematica. I am not sure why.