Ask Your Question

zorkkoi's profile - activity

2023-07-15 04:25:46 +0200 received badge  Famous Question (source)
2023-07-15 04:25:46 +0200 received badge  Notable Question (source)
2021-06-23 03:57:11 +0200 received badge  Popular Question (source)
2021-05-26 13:00:32 +0200 received badge  Popular Question (source)
2019-07-31 03:34:22 +0200 received badge  Supporter (source)
2019-07-30 21:11:40 +0200 received badge  Nice Question (source)
2019-07-30 17:20:19 +0200 asked a question Incorrect Eigenvalues/Eigenvectors

I'm trying to compute eigenvalues and eigenvectors for certain matrices. Most of the time sage is giving me what seems to be the correct output, but sometimes it's quite wrong and I'm not sure why this is happening. Here's a concrete example with a circulant matrix.

sage: M=matrix.circulant([1,-1/2*I,0,0,0,0,0,0,0,0,1/2*I])
sage: M.eigenvectors_right()
[(1, [(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)], 1)]

That is, it only returns a single eigenvector when I know there's in fact 11. A different issue appears with matrix.circulant([1,-1/2I,0,0,0,0,1/2I]), where now sage produces all the eigenvalues but produces no eigenvectors for most of these values.

2019-05-02 02:16:42 +0200 received badge  Student (source)
2018-01-24 02:19:57 +0200 commented answer Copying a Matrix

Thank you so much for that excellent answer, it was exactly what I was looking for!

2018-01-24 02:19:07 +0200 received badge  Scholar (source)
2018-01-23 20:25:02 +0200 asked a question Copying a Matrix

I'm trying to take the Singular Value Decomposition of the adjacency matrix of a graph A, but all my "reasonable" attempts at doing so have failed, see the code below.

I believe the problem has something to do with the matrix being immutable, so I've been trying to copy A into a different matrix M and then perform SVD on M. he only thing that I've found to work is to essentially build A from scratch, but there must be a better method.

sage: A=graphs.CycleGraph(3).adjacency_matrix()
#Method 1: Try and get SVD directly from A; gives error at last step.
#sage: A.change_ring(RDF)
#sage: A.SVD()

#Method 2: Try and copy A to a different matrix and then do SVD; gives error at last step.
# sage: M=copy(A)
# sage: M.change_ring(RDF)
# sage: M.SVD()

#Method 3: Build A up again from scratch and then do SVD; works, but is tedious.
sage: M=matrix(RDF,3,3)
sage: for i in [0..2]:
        for j in [0..2]:
            if(A[i,j]==1):
                M[i,j]=1
sage: M.SVD()