Traceback error
Hello,
I am new to Sage Math and new to this forum. Basically, I have written code to generate a specific graph on 10 vertices from its adjacency matrix. I am receiving an error (pasted below), but when my advisor runs the same exact code on his machine, he does not receive an error. I do not know how to resolve this situation. I've pasted my code below, and the error that I receive follows. Any insight would be much appreciated, and let me know if you need more details (e.g., information about the machine I'm using, operating system, etc.).
sage: M = Matrix([(0,0,1,0,1,1,1,0,1,1), (0,0,0,1,1,1,0,1,1,1), \
(1,0,0,1,1,1,1,0,0,0), (0,1,1,0,1,1,0,1,0,0), (1,1,1,1,0,1,0,0,1,0), \
(1,1,1,1,1,0,0,0,0,1), (1,0,1,0,0,0,0,1,1,1), (0,1,0,1,0,0,1,0,1,1), \
(1,1,0,0,1,0,1,1,0,1), (1,1,0,0,0,1,1,1,1,0)])
sage: M
[0 0 1 0 1 1 1 0 1 1]
[0 0 0 1 1 1 0 1 1 1]
[1 0 0 1 1 1 1 0 0 0]
[0 1 1 0 1 1 0 1 0 0]
[1 1 1 1 0 1 0 0 1 0]
[1 1 1 1 1 0 0 0 0 1]
[1 0 1 0 0 0 0 1 1 1]
[0 1 0 1 0 0 1 0 1 1]
[1 1 0 0 1 0 1 1 0 1]
[1 1 0 0 0 1 1 1 1 0]
sage: G = Graph(M); G
Graph on 10 vertices
sage: G.plot().show()
Here is the error.
Traceback (most recent call last): [0 0 0 1 1 1 0 1 1 1]
File "", line 1, in <module>
File "/private/var/folders/sw/0pqlf1452k58z_jbk3_yv5m97h2tyd/T/tmpabbyzH/___code___.py", line 5
G = Graph(M); G
^
SyntaxError: invalid syntax
Could you please give us some informations so that someone can try to reproduce your problem:
The first line of the traceback looks strange. It contains a line of the result of printing the matrix M. Did you copy paste the output of
sage: M
?I am sorry for my late reply. Here is the information. To answer @tmonteil:
To answer @FrédéricC: No, to my knowledge there was no output of
sage M
.