Skip to content

Ravieroy/Computational-Physics

Repository files navigation

Computational Physics Codes

Python_Codes MATLAB_Codes MATHEMATICA_Codes

:bowtie: Use the above links for more specifically curated list. Following is a more general list containing everything.


This repository contains all my computational physics codes. Most of the stuffs are pretty basic and was written during my Master's degree. Few stuffs are more advanced and those codes might help somebody who need it.

Following is the name and description of what the codes do. Will keep updating the codes and adding more.

MATLAB CODES

Name Description
Graphene_along_HSP Plots Graphene bands along high symmetry points
Graphene 3D band structure(BS) plot of Graphene by diagonalization
Weyl_review_paper Weyl semimetal 3D BS from Rev. Mod. Phys. 90, 015001 by N.P. Armitage
bdg_SQ BdG Hamiltonian in Real space and DOS for square lattice (MATLAB Live script)
Hex_nbd complete code to find the nearest neighbor for hexagonal lattice (MATLAB Live script)
Hexagonal_nbd complete code to find the nearest neighbor for hexagonal lattice
bdg_SQ.pdf BdG Hamiltonian in Real space and DOS for square lattice (PDF)
WSM.m MATLAB code for Weyl semimetals as discussed here
KPOINT KPOINT required for above code

The following codes were used for the paper Effect of population migration and punctuated lockdown on the spread of infectious diseases.

COVID_N_CITY COVID_Param
Lock_Punc_three_city Lock_punc
R0_m12_var R0_m13_inset
two_city

Python Codes

Jupyter Notebooks

Misc
Name Description
1D_Potential_Euler Phase Space Trajectories for $V(x)=(x^2−1)^2$ : Euler Method
1D_Potential_RK2 Phase Space Trajectories for $V(x)=(x^2−1)^2$ : RK-2 Method
1D_Potential_RK4 Phase Space Trajectories for $V(x)=(x^2−1)^2$ : RK-4 Method
1D_Potential_Verlet Phase Space Trajectories for $V(x)=(x^2−1)^2$ : Verlet Algorithm
rhoMu Animation for Mott transition in Hubbard Hamiltonian as function of U (Reference PDF is mentioned in notebook)
SIAM_MFT Basic Anderson Impurity Model (SIAM)
Superconducting_Gap Solving the self-consistent gap equation to get the infamous plot $\Delta(T)$ vs $T$
Halley's Comet Position Vs Time plot for Halley's comet
Ising Animation showing the fluctuation in Ising model
Simulated_Annealing Simulated Annealing
rho_VS_mu Same as rhoMu but only the plots (no animation)
Presentation Basic presentation made in Jupyter notebook on Hubbard model, Ising Model and SIAM
Presentation.slides HTML slides of the above Presentation (can be directly opened in browser)

TA-2022

These are the solution to the problems set during my TA in 2022 for the class Material Design.

Name Description
Assignment_0.pdf Assignment-0 Questions(PDF)
Assignment_0.tex Assignment-0 Questions(LaTex)
A0_P01 Solution to Problem 1
A0_P02 Solution to Problem 2
A0_P03 Solution to Problem 3
A0_P04 Solution to Problem 4
Assignment_1.pdf Assignment-1 Questions(PDF)
Assignment_1.pdf Assignment-1 Questions(LaTex)
A1_P01 Solution to Problem 1
A1_P02 Solution to Problem 2
A1_P03 Solution to Problem 3
A1_P04 Solution to Problem 4
A1_P05 Solution to Problem 5
Assignment_2.pdf Assignment-2 Questions(PDF)
Assignment_2.tex Assignment-2 Questions(LaTex)

Numerical Methods (BASICS)

These are codes from basic numerical methods class.

Name Description
Bisection_Method Finds roots of the function $x^3-20 =0$ by Bisection method
Bisection_Method_2 Finds roots of the function $x^3-20 =0$ by Bisection method(Method 2)
Compare Compare Euler, RK-2 and RK-4 method
Euler_method Euler method
Gauss_quad Gauss Quadrature method
Machine_precision Machine precision
Naive_Gauss Gauss Elimination method
Newton_Raphson Newton-Raphson method (Menu driven)
Newton_Raphson_2 Newton_Raphson_2 (BASIC)
RK_2 Runge-Kutta Method (RK-2)
RK_4 Runge-Kutta Method (RK-4)
Simpson's_3_8_Method Simpson's 3/8 Method
Simpson's_Method Simpson's 1/3 Method
Trapezoidal_Method Trapezoidal Method

Miscellaneous

These are miscellaneous codes written just for fun and learning

Name Description
Collatz_conjecture Implementation of Collatz Conjecture

VPython Codes

These are VPython codes which are great for learning basic stuffs and solve basic stuffs. Use Glowscript or Trinket to run these type of programs. Just make a free account there and run VPython codes there.

Name Description
Projectile_Motion_basic Basic implementation of Projectile Motion
Projectile_Motion_mult_balls Projectile motion with multiple balls
Projectile_Motion_with_air_Resistance Projectile Motion with air resistance

Mathematica Codes1

Name Description
Berry_Graphene.nb Berry Curvature of Graphene2
Berry_Graphene.pdf PDF format of notebook
SEIRS.nb SEIRS Model of Epidemiology
Epidemiology-Introduction.nb Introduction to Epidemiology3
Epidemiology-Application.nb More advanced application to different models3

Back to top

Footnotes

  1. Requires decent understanding of Mathematica and slightly deeper knowledge of the topic at hand.

  2. This code was written with the help of this stackexchange post by John Tiessen

  3. These codes were not written by me. These are codes from an online course I attended on Epidemiology. 2

About

Collection of computational physics codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published