2d matrices with nearest hoppings (square lattice)
3 views (last 30 days)
Show older comments
2d matrices
0 Comments
Accepted Answer
Aman Banthia
on 27 Oct 2023
Hi Zahid,
I understand you are trying to simulate Anderson Localization in a 2D square lattice with open boundary conditions. You have introduced disorder by assigning random onsite energies from a Gaussian distribution.
Your code seems correct for generating a 2D square lattice with open boundary conditions and onsite disorder. Here are some points to note:
1. Random Values: You're generating random values from a Gaussian distribution with mean 0 and standard deviation `W` for the onsite energies. This is a common choice for the Anderson localization problem. The `normrnd` function is the correct function to use for this.
2. Hamiltonian Matrix: You're correctly setting up a Hamiltonian matrix for a 2D square lattice with open boundary conditions. The diagonal elements represent the onsite energies (with disorder), and the off-diagonal elements represent the hopping terms.
3. Density of States Calculation: You're calculating the density of states (DOS) by histogramming the eigenvalues of the Hamiltonian. This is a common way to estimate the DOS.
4. Normalization: You're normalizing the DOS by the bin width and the total number of sites. This is the correct way to normalize the DOS.
So, your code seems correct based on your description of the problem.
However, if you're not getting the expected results, you might want to check the following:
1. Disorder Strength: The `W` parameter controls the strength of the disorder. You might want to experiment with different values of `W` to see how it affects the results.
2. Histogram Bins: The number of bins in your histogram can affect the appearance of your DOS plot. You might want to try increasing the number of bins to see if it gives you a smoother DOS.
3. Eigenvalue Calculation: Calculating the eigenvalues of a large matrix can be computationally expensive and might introduce numerical errors. You might want to check if this is causing issues in your case.
Remember that the Anderson localization problem is a complex problem that can show different behaviors depending on the parameters and the dimensionality of the system. So, it might take some experimentation to get the results you expect.
Hope the above solution helps you.
Best Regards,
Aman Banthia
0 Comments
More Answers (0)
See Also
Categories
Find more on Particle & Nuclear Physics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!