Tag Info

New answers tagged


I'm not quite sure how you obtained a $9\times 9$ matrix. Here is a workaround, in any event: KroneckerProduct[List /@ {a, b, c}, List /@ {p, q, r}] // Flatten {a p, a q, a r, b p, b q, b r, c p, c q, c r}


The documentation for MatrixPower[] indicates that you can take the action of a matrix power on a given vector. In particular, to get a single column of a matrix power, you thus need the action of the matrix power on an appropriate unit vector. For instance, n = 6; mat = SparseArray[{{j_, k_} /; j + k == n + 1 :> 1, {k_, k_} :> 1}, {n, n}]; m = 4; ...


You could try the following, although I have tested it only with your example, so it would be interesting to explore its robustness further. Clear[linIndep] linIndep[list_List] := Module[ {coeffarray, reduced}, coeffarray = CoefficientArrays[list, Variables[list]][[2]]; reduced = LatticeReduce[coeffarray]; reduced.Variables[list] ] list ...


I just tried to clean up the code a bit. With respect to sortVecs, I used Ordering which is really what you were going for. You were wasting a little bit of time by taking the conjugate of one of the vectors, when the eigenvectors in vecls are all real-valued. Should you move to a different form for H that gives complex eigenvectors, just uncomment the ...


a = {{1, 4}, {6, 4}}; ContourPlot[{x, y}.a.{x, y} == 0, {x, -5, 5}, {y, -5, 5}] or a = {{2, 4}, {6, 4}}; RegionPlot[{x, y}.a.{x, y} < 0, {x, -5, 5}, {y, -5, 5}]


Preamble You should be able to adapt this solution to your specific case, but I have taken the liberty of altering your code somewhat and even changing the definitions of some of the matrices. I will explain why I did what I did so that you can alter things to fit with your definitions. Main alterations: Instead of Setting the values of your Subscripted ...

Top 50 recent answers are included