I have six vectors defined like this:
r1 = {-(1/2), -(Sqrt[3]/2)};
r2 = {1/2, -(Sqrt[3]/2)};
r3= {1, 0};
r4 = {1/2, Sqrt[3]/2};
r5 = {-(1/2), Sqrt[3]/2};
r6 = {-1, 0};
Now I can create a function matrix Ht from these.
Ht = ConstantArray[0, {24, 24}];
Ht[[1, 20]] = Exp[I k.(r1-r2)];
Ht[[19, 2]] = -Exp[I k.(r1-r2)];
Ht[[3, 22]] = Exp[I k.(r3-r4)];
Ht[[21, 4]] = -Exp[I k.(r3-r4)];
Ht[[5, 24]] = Exp[I k.(r5-r6)];
Ht[[23, 6]] = -Exp[I k.(r5 - r6)];
Now I need a H1 which would be a function of 'k'. Something like:
H1[k_] := Ht
Is it possible?? Please help.
Set(=) instead ofSetDelayed(:=). http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/18487#18487 – Szabolcs Aug 19 '16 at 11:59H1[k_] = Htcreates a function in terms ofk.Clear[H1]first if there are previous definitions. – Szabolcs Aug 19 '16 at 12:11H1[k_]=Htand it worked, Thanks Szabolcs – Pratyay Ghosh Aug 20 '16 at 06:25