Tag Info

Hot answers tagged

6

Oleksandr remarked on the memory required for a dense matrix. I shall attempt to explore SparseArray limitations. From this error message it appears that the dimensions of the array must be machine integers: SparseArray[{}, {2, 2}^70] SparseArray::adims: Array dimension specification {1180591620717411303424,1180591620717411303424} should be ...


2

I would make use of Mathematica patterns in the assumptions: Assuming[{Dm[a_, a_][x_] == Dm[a_, a_][-x_]}, Simplify[Transpose[dmat[q]] == dmat[-q]]] (* True *) This tells Simplifythat a matrix element with equal indices (i.e. a diagonal element) is an even function. The problem with your code is that with Apply, you are replacing the equal sign with an ...


1

Perhaps you can use EdgeAdd and/or VertexAdd. For example: am1 = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}; ag1 = AdjacencyGraph[am1, VertexLabels -> Placed["Name", Center], VertexSize -> Medium] ag2 = EdgeAdd[ag1, 2 <-> 4] AdjacencyMatrix[ag1] // Normal (* {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}} *) AdjacencyMatrix[ag2] // Normal (* {{0, 1, 1, 0}, ...



Only top voted, non community-wiki answers of a minimum length are eligible