Mathematica Asked on March 14, 2021
Im trying to evaluate some dot products with eigenvectors and matrices using Mathematica. My problem is the following:
To an given matrix 6×6:
h[kx_, ky_, t1_, B1_, B2_,
B3_] := -4 t1 (tx (Cos[kx]) + ty (Cos[ky])) -
B1*O1- B2*O2 -
B3*O3
Where the variables tx
, ty
, O1
, O2
, O3
, T
are given on the code down on this post.
I need to get the 2 lowest eigenvalues and their associated eigenvectors at kx=0
, ky=0
, to do so, i use
NLowestEiv[expr_, n_] :=
Sort[Transpose[Eigensystem[expr]], Re[#1[[1]]] < Re[#2[[1]]] &][[1 ;; n]]
NLowestEiv[h[0,0,1,B1,0,0],2]
For B1
between -1 and 1
And then compute this w matrix:
w=Table[Conjugate[NLowestEiv[h[0,0,1,B1,0,0],2]][[i]].Conjugate[NLowestEiv[h[0,0,1, B1,0,0],2]][[j]],{i,1,2},{j,1,2}]
For different values of B1.
The problem is, the result that i need depends on the signal of the elements of w
and mathematica, due to the computational precision return really small values and oscilates very much between positive and negative values. This oscilation can be seen by using manipulate or plot:
Manipulate[Conjugate[NLowestEiv[h[0,0,1,B1,0,0],2]][[1]].Conjugate[NLowestEiv[h[0,0,1, B1,0,0],2]][[2]]], {B1,0,0}
Plot[Conjugate[NLowestEiv[h[0,0,1,B1,0,0],2]][[1]].Conjugate[NLowestEiv[h[0,0,1, B1,0,0],2]][[2]]], {B1,0,0}
How can i eliminate this oscilation?? I tried to use If as conditionals but can´t make it work.
Here is the definition of the matrices used on the top
O1={{10, 0, 0, 0, 0, 0}, {0, -2, 0, 0, 0, 0}, {0, 0, -8, 0, 0, 0}, {0, 0,
0, -8, 0, 0}, {0, 0, 0, 0, -2, 0}, {0, 0, 0, 0, 0, 10}}
O2={{60, 0, 0, 0, 0, 0}, {0, -180, 0, 0, 0, 0}, {0, 0, 120, 0, 0, 0}, {0,
0, 0, 120, 0, 0}, {0, 0, 0, 0, -180, 0}, {0, 0, 0, 0, 0, 60}}
O3={{0, 0, 0, 0, 12 Sqrt[5], 0}, {0, 0, 0, 0, 0, 12 Sqrt[5]}, {0, 0, 0,
0, 0, 0}, {0, 0, 0, 0, 0, 0}, {12 Sqrt[5], 0, 0, 0, 0, 0}, {0,
12 Sqrt[5], 0, 0, 0, 0}}
tx={{15/56, 0, -((3 Sqrt[5/2])/28), 0, (3 Sqrt[5])/56, 0}, {0, 3/56,
0, -(3/(28 Sqrt[2])), 0, (3 Sqrt[5])/56}, {-((3 Sqrt[5/2])/28), 0,
3/28, 0, -(3/(28 Sqrt[2])), 0}, {0, -(3/(28 Sqrt[2])), 0, 3/28,
0, -((3 Sqrt[5/2])/28)}, {(3 Sqrt[5])/56, 0, -(3/(28 Sqrt[2])), 0,
3/56, 0}, {0, (3 Sqrt[5])/56, 0, -((3 Sqrt[5/2])/28), 0, 15/56}}
ty={{15/56, 0, -((3 Sqrt[5/2])/28), 0, (3 Sqrt[5])/56, 0}, {0, 3/56,
0, -(3/(28 Sqrt[2])), 0, (3 Sqrt[5])/56}, {-((3 Sqrt[5/2])/28), 0,
3/28, 0, -(3/(28 Sqrt[2])), 0}, {0, -(3/(28 Sqrt[2])), 0, 3/28,
0, -((3 Sqrt[5/2])/28)}, {(3 Sqrt[5])/56, 0, -(3/(28 Sqrt[2])), 0,
3/56, 0}, {0, (3 Sqrt[5])/56, 0, -((3 Sqrt[5/2])/28), 0, 15/56}}
T={{0, 0, 0, 0, 0, -1}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, -1, 0, 0}, {0, 0,
1, 0, 0, 0}, {0, -1, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}}
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP