Tag Info

Hot answers tagged

7

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 ...


3

This appears to be a precision issue. Increase the precision. S[i_, j_] = 8 Sqrt[1.7^(3 i + 3 j - 6)]/ (1.7^(i - 1) + 1.7^(j - 1))^3 // Rationalize // Simplify; H[i_, j_] = -8 Sqrt[1.7^(3 i + 3 j - 6)]/ (1.7^(i - 1) + 1.7^(j - 1))^3* (0.01*(1.7^(i - 1) + 1.7^(j - 1)) - 0.01^2*1.7^(i + j - 2)) // Rationalize // Simplify; ...


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 ...


2

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}, ...


1

If you want a purely matrix-based approach, you can try: m = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}; AdjacencyGraph[m, VertexLabels -> "Name"] ADD = {1, 2}; VADD = 0 Range[Length[m]]; For[i = 1, i <= Length[ADD], i++, VADD[[i]] = 1]; m = Append[m, VADD]; VADD = Append[VADD, 0]; m = Transpose[Append[Transpose[m], VADD]] AdjacencyGraph[m, VertexLabels -> ...



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