Hi all,
I am currently working on graph isomorphism.
If I understood well this paper:
“Graph isomorphism and gaussian boson sampling. arXiv preprint arXiv:1810.10644, 2018”
two isomorphic graphs always have the same feature vector (minus a small difference because of sampling, at least the exact calculation should return the same values).
I decided to feature vectors for all the 4-node non-isomorphic graphs (which correspond to 11 graphs).
I defined them by their adjacency matrix and used the
sf.apps.similarity.feature_vector_events
function. I was expecting the feature vectors to be all different (since I perform the exact calculation) but I actually noticed that C_{4} and S_{3} have the same feature vectors! They are also identical for two other graphs: the one-edge graph and the two-connected-edges graph (see picture at the bottom of this post).
Here is a code to reproduce the feature vectors:
import numpy as np
import networkx as nx
from strawberryfields.apps import similarity
# list of non isomorphic 4 nodes graphs
# one edge
oe_a = np.array([[0.0, 1.0, 0.0, 0.0],
[1.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0]])
# two edges connected
tec_a = np.array([[0.0, 1.0, 1.0, 0.0],
[1.0, 0.0, 0.0, 0.0],
[1.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0]])
# S3
sta_a = np.array([[0.0, 1.0, 1.0, 1.0],
[1.0, 0.0, 0.0, 0.0],
[1.0, 0.0, 0.0, 0.0],
[1.0, 0.0, 0.0, 0.0]])
# C4
sq_a = np.array([[0.0, 1.0, 0.0, 1.0],
[1.0, 0.0, 1.0, 0.0],
[0.0, 1.0, 0.0, 1.0],
[1.0, 0.0, 1.0, 0.0]])
orbit = [2, 4]
print("Feature vectors for 4 nodes graphs, from adjacency matrices (exact calculation)")
print("One edge ", similarity.feature_vector_events(nx.Graph(oe_a), orbit))
print("Two edges connected ", similarity.feature_vector_events(nx.Graph(tec_a), orbit))
print("S3 ", similarity.feature_vector_events(nx.Graph(sta_a), orbit))
print("C4 ", similarity.feature_vector_events(nx.Graph(sq_a), orbit))
As you can see, all of the above return
[0.20408163265306095, 0.14577259475218624]
which are identical.
Is it a bug or something I didn’t get in the theory?
Thanks in advance.
Edgard