Hey!
So I am trying to code the probability function in equation (3) of this paper and to recheck my calculation, I pass a sample of all 0s in my probability code and recheck it with sf.apps.similarity.prob_orbit_exact by passing in an all 0 sample as well. As we know that an all zero sample orbit can only have one sample (all 0), I am getting the probabilities different from these 2 methods. Could you please look into this? Here is the code:-
def probzu(A,S):
p=1
k= np.repeat(A, S, axis=0)
A1= np.repeat(k, S, axis=1)
z= np.abs(haf(A1)) ** 2
_, s, _ = np.linalg.svd(A, full_matrices=True)
c = 1 / ( np.max(s) + 1e-8 )
Ab = c * np.block([
[A, np.zeros(A.shape)],
[np.zeros(A.shape), A]
])
X = np.block([
[np.zeros(A.shape), np.identity(A.shape[0])],
[np.identity(A.shape[0]), np.zeros(A.shape)]
])
I = np.identity(Ab.shape[0])
Q = np.linalg.inv(I - X @ Ab)
B = math.sqrt(np.linalg.det(Q))
for i in range(len(S)):
p= p*math.factorial(S[i])
prob= z/(p*B)
return prob
A= np.array([[0,0,1,0,1],
[0,0,0,1,1],
[1,0,0,1,1],
[0,1,1,0,0],
[1,1,1,0,0]])
print(probzu(A,[0,0,0,0,0]))
print(sf.apps.similarity.prob_orbit_exact(nx.from_numpy_array(A),[0,0,0,0,0]))