Skip to main content
added 1 character in body
Source Link
L.K.
  • 693
  • 1
  • 7
  • 17

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} & 0 & 0 \\ -\frac{1}{2} e^{-i k} & -20 \pi & -\frac{1}{2} & 0 & 0 & 0 \\ 0 & -\frac{1}{2} & 0 & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} \\ -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 0 & -\frac{1}{2} & 0 \\ 0 & 0 & 0 & -\frac{1}{2} & 20 \pi & -\frac{e^{i k}}{2} \\ 0 & 0 & -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 20 \pi \\ \end{array} \right)

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} & 0 & 0 \\ -\frac{1}{2} e^{-i k} & -20 \pi & -\frac{1}{2} & 0 & 0 & 0 \\ 0 & -\frac{1}{2} & 0 & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} \\ -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 0 & -\frac{1}{2} & 0 \\ 0 & 0 & 0 & -\frac{1}{2} & 20 \pi & -\frac{e^{i k}}{2} \\ 0 & 0 & -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 20 \pi \\ \end{array} \right)

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} & 0 & 0 \\ -\frac{1}{2} e^{-i k} & -20 \pi & -\frac{1}{2} & 0 & 0 & 0 \\ 0 & -\frac{1}{2} & 0 & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} \\ -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 0 & -\frac{1}{2} & 0 \\ 0 & 0 & 0 & -\frac{1}{2} & 20 \pi & -\frac{e^{i k}}{2} \\ 0 & 0 & -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 20 \pi \\ \end{array} \right)
matrix missing
Source Link
L.K.
  • 693
  • 1
  • 7
  • 17

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 & 0 \\ -e^{-i k} \text{j2} & -20 \pi & -\frac{\text{j1}}{2} & 0 & 0 & 0 \\ 0 & -\frac{\text{j1}}{2} & 0 & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} \\ -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 \\ 0 & 0 & 0 & -\frac{\text{j1}}{2} & 20 \pi & -e^{i k} \text{j2} \\ 0 & 0 & -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 20 \pi \\ \end{array}\begin{array}{cccccc} -20 \pi & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} & 0 & 0 \\ -\frac{1}{2} e^{-i k} & -20 \pi & -\frac{1}{2} & 0 & 0 & 0 \\ 0 & -\frac{1}{2} & 0 & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} \\ -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 0 & -\frac{1}{2} & 0 \\ 0 & 0 & 0 & -\frac{1}{2} & 20 \pi & -\frac{e^{i k}}{2} \\ 0 & 0 & -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 20 \pi \\ \end{array} \right)

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 & 0 \\ -e^{-i k} \text{j2} & -20 \pi & -\frac{\text{j1}}{2} & 0 & 0 & 0 \\ 0 & -\frac{\text{j1}}{2} & 0 & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} \\ -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 \\ 0 & 0 & 0 & -\frac{\text{j1}}{2} & 20 \pi & -e^{i k} \text{j2} \\ 0 & 0 & -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 20 \pi \\ \end{array} \right)

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} & 0 & 0 \\ -\frac{1}{2} e^{-i k} & -20 \pi & -\frac{1}{2} & 0 & 0 & 0 \\ 0 & -\frac{1}{2} & 0 & -\frac{e^{i k}}{2} & 0 & -\frac{1}{2} \\ -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 0 & -\frac{1}{2} & 0 \\ 0 & 0 & 0 & -\frac{1}{2} & 20 \pi & -\frac{e^{i k}}{2} \\ 0 & 0 & -\frac{1}{2} & 0 & -\frac{1}{2} e^{-i k} & 20 \pi \\ \end{array} \right)
matrix missing
Source Link
L.K.
  • 693
  • 1
  • 7
  • 17

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

(i) Is there a way the size issue can be overcome?
(ii) Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 & 0 \\ -e^{-i k} \text{j2} & -20 \pi & -\frac{\text{j1}}{2} & 0 & 0 & 0 \\ 0 & -\frac{\text{j1}}{2} & 0 & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} \\ -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 \\ 0 & 0 & 0 & -\frac{\text{j1}}{2} & 20 \pi & -e^{i k} \text{j2} \\ 0 & 0 & -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 20 \pi \\ \end{array} \right)

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]

(i) Is there a way the size issue can be overcome?
(ii) Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

I am having a Hermitian Matrix(HCF[k]) depending on a parameter $k$.

My job is to plot the Eigenvalues of the matrix as the parameter $k$ is changed.

But I am facing some problems.
(i) My Mathematica file size, which is of around whopping 90Mb, when HCF[k] is around $284\times284$.
(ii) This part of code is very slow as the size of HCF[k] is increasing.

kdel = 0.00001; (* offset *)
kIn = -π - kdel;  (*Initial value of k *)
kFin = π + kdel;  (*Final value of k *)
kInc = 0.001; (*Increment of k*)

eigeng = 
 ParallelTable[Eigenvalues[HCF[k]], {k, kIn, kFin, kInc}];


kList = ParallelTable[k, {k, kIn, kFin, kInc}];


kFList = ParallelTable[kList, {i, Transpose@eigeng}];

dataToPlot = Flatten[{kFList\[Transpose], eigeng}\[Transpose], {{1, 3}, {2}}];

Graphics[{Point[{#1, #2}]} & @@@ dataToPlot, Frame -> True,
...(* for the aesthetic of plot, i.e. axis title, range and bla bla*)]
  • Is there a way the size issue can be overcome?
  • Is there a way the code can be sped up a little bit?(I checked my rest of the code, it is very fast, which I did by breaking and evaluating it into small cells).

Addendum

  • Form of HCF[k], as it is huge I will try to show you how it looks for small size say
    \left( \begin{array}{cccccc} -20 \pi & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 & 0 \\ -e^{-i k} \text{j2} & -20 \pi & -\frac{\text{j1}}{2} & 0 & 0 & 0 \\ 0 & -\frac{\text{j1}}{2} & 0 & -e^{i k} \text{j2} & 0 & -\frac{\text{j1}}{2} \\ -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 0 & -\frac{\text{j1}}{2} & 0 \\ 0 & 0 & 0 & -\frac{\text{j1}}{2} & 20 \pi & -e^{i k} \text{j2} \\ 0 & 0 & -\frac{\text{j1}}{2} & 0 & -e^{-i k} \text{j2} & 20 \pi \\ \end{array} \right)
edited body
Source Link
L.K.
  • 693
  • 1
  • 7
  • 17
Loading
deleted 8 characters in body
Source Link
Feyre
  • 8.7k
  • 2
  • 29
  • 48
Loading
Source Link
L.K.
  • 693
  • 1
  • 7
  • 17
Loading