This question contained the problem of NullSpace, but previous ones not.
This is a problem seems like my previous one, but there is some details different. I find that perhaps one method can not solve all the cases with different parameter. And thus, this question is not a duplicate of another question.
t is a generated matrix containg kz. kz are obtained by solve Det[t]==0. I find that when s and m are set as some cases (e.g. s=5,m=2), I substitue the NSolve[Numerator[Together[N@Det[Chop[t]]]] == 0, kz] into t, of course Det[t]==0, this means there must exist NullSpace[t]. However, NullSpace[t] gives a {},Why? How to solve this problem. Many Thanks! The codes are as following:
Clear["`*"]
s = 5;
m = 2;
th = Pi/4;
fi = Pi/6;
vh = 16;
mu = 11;
delta = 8;
HBAR = SetPrecision[1.05457266*10^(-34), 100];
ME = SetPrecision[9.1093897*10^(-31), 100];
ELEC = SetPrecision[1.60217733*10^(-19), 100];
Kh = Rationalize[0.211, 0];
vKh[1] := {0, 0, 0}
vKh[2] := {Kh, 0, 0};
vKh[3] := {-Kh, 0, 0};
vKh[4] := {0, Kh, 0};
vKh[5] := {0, -Kh, 0};
vKh[0] := {0, -Kh, 0};
vKh[i_] := vKh[Mod[i, 5]];
kc = Sqrt[2*ME*ELEC/HBAR^2]*10^(-11);
ku := kc*Sqrt[mu + delta];
kd := kc*Sqrt[mu - delta];
a3 = {Pi/Kh, Pi/Kh, Sqrt[2]*Pi/Kh};
k := {-ku*Sin[th]*Cos[fi], -ku*Sin[th]*Sin[fi], kz};
vkz[i_] :=
If[Mod[i, 5] != 0, {0, 0, (i - Mod[i, 5])/5*Kh*Sqrt[2]/(m + 1)}, {0,
0, (i - Mod[i, 5] - 5)/5*Kh*Sqrt[2]/(m + 1)}];
f[i_, i_] :=
Total[(k + vKh[i])^2] - ku^2 - kz^2 + (kz + Total[vkz[i]])^2;
f[i_, j_] :=
If[i == j, f[i, i],
kc^2*vh*Total[
Table[Exp[I*n*Total[(vKh[j] + vkz[j] - vKh[i] + vkz[i])*a3]], {n,
0, m}]]];
t := Array[f, {5*s, 5*s}];
slu := Select[
kz /. NSolve[Numerator[Together[N@Det[Chop[t]]]] == 0, kz],
Re[#] >= 0 && Im[#] >= 0 &];
td[i_] := t /. kz -> slu[[i]];
nu[i_] := NullSpace[Chop[td[i]]];
Det[Chop[td[1]]]
nu[1]
HBAR = SetPrecision[1.05457266*10^(-34), 100]and so forth. After we take the determinant, we can go back to machine precision and callNSolveon the numerator i.e.NSolve[Numerator[Together[N@Det[Chop[t]]]] == 0, kz]. – Greg Hurst Aug 06 '18 at 03:38Toleranceoption forNullSpace. – Greg Hurst Aug 06 '18 at 04:24Eigenvalues@td[1]show no eigenvalues close to zero. It seemsDet[td[1]] != 0!? – Michael E2 Aug 06 '18 at 04:44Det[Chop[td[1]]]is zero, then at least one of the eigenvalues should be very small, say, less than10^-8times the largest eigenvalue if calculated at machine precision. The largest eigenvalue oftd[1]is less than 1.07 in abs. val. and the smallest is greater than 0.014, which is not very small. The determinant is the product of 25 such numbers will range in magnitude from1down to10^-50; it's roughly10^-27in your case. – Michael E2 Aug 06 '18 at 13:43Det[t]is performed at machine or other insufficient precision. Is that not distinctive enough? – Michael E2 Aug 06 '18 at 19:41tturn out to all have a similar size. I think the problem is in the numerics ofDet[t], which is connected to the size of the entries, which in turn depends on the constants. – Michael E2 Aug 06 '18 at 20:03