-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A standalone tutorial for TB_to_sympy
.
#16
base: unstable
Are you sure you want to change the base?
A standalone tutorial for TB_to_sympy
.
#16
Conversation
4995b13
to
8040a7b
Compare
…orrelated systems.
…escription: - Introduced an example where I call sympyfy on a simple-structured Lathanum Cuprate material under different scenarios. - Changed the introduction to include the fact that w90 includes all hopping parameters but that the user has the option of using PythTB to include cutoffs on the hopping amplitude and hopping distance. - Made sure to highlight the fact that the numerical expression isn't wholly numerical but depends on the k-space vector variables.
… of the full vs cutoff model of the Lanthanum cuprate compound
…gure (at 0.01 eV min_hopping_norm)
…ns to the text in the introduction
So that I could import it into my tutorial.
…ent energy cutoffs
…early convey the message
…he tutorial notebook
…on by replacing it with a for loop that basically does the same plotting work for us
8040a7b
to
94bc592
Compare
Hello @the-hampel. Thanks for approving my changes. Shall I close this PR? What is remaining? |
Hi @Collins-kariuk, @Wentzell will have a final look and than we will merge the tutorial. So please leave it open for now. Thanks! |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ```TB_to_sympy``` function takes hopping amplitudes to generate a TB model. The hopping amplitudes are obtained from the Wannier90 package, which fits the band structure obtained from density functional theory (DFT) for a set of orbitals. The larger the hopping amplitude, the more significant it is. For instance, a hopping amplitude of 0.00005 eV does not contribute as much to the movement of an electron as a hopping amplitude of 0.05 eV. There is a need for a cutoff either in the hopping distances or the hopping amplitudes. A minimal model can neglect these smaller amplitudes. Using the PythTB package's ```model``` function, we select only the hopping amplitudes bigger than the cutoff or smaller than the cutoff distance, restricting the hopping processes to be closer." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not quite correct? It does not generate a TB model, it takes a pre-constructed one. Also it could be obtained out of a Wannier90 calculation or could just be a model Hamiltonian.
The output is an analytic expression of that same TB model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"In second quantization, the TB Hamiltonian is given by:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean 'a generic form of a TB Hamiltonian reads' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"- $\\sigma$ is the spin and $c^{\\dagger}$\n", | ||
"- $c$ are creation and annihilation operators.\n", | ||
"\n", | ||
"In this tutorial, we examine a system with one orbital and one site per unit cell. By performing a Fourier transform of the Hamiltonian from real space to momentum space, we obtain $H(k)$, which is achieved using the ```TB_to_sympy``` function.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would drop here the part ", which is achieved using the TB_to_sympy
function."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped.
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"```TB_to_sympy``` is defined as:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to: 'The documentation of the TB_to_sympy
function reads'
Also, why don't you use ?TB_to_sympy
to generate documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also now used ?TB_to_sympy to generate documentation. Thank you for this. I did not know one could do this.
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The only required parameter for our function is ```TBL```, a TRIQS TBLattice Object (Tight-Binding Lattice Object). To obtain ```TBL```, you can use TRIQS-provided functions that allow conversion of your model to a TRIQS TBLattice object. These functions are:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TBL doesn't need to come out of a conversion, it can be directly defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The main distinction between the analytical and numerical expressions is that the numerical expression depends on ```kx```, ```ky```, and ```kz```, while the analytical expression additionally depends on the lattice vectors, ```a1```, ```a2```, and ```a3```. The lattice vectors define the orientation and shape of the crystal unit cell and can be replaced with numerical values using the ```units``` function from the TRIQS TB lattice object." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not clear. You should state that the numerical expression is uses euclidian unit vectors and the analytical expression uses reciprocal basis vectors ai
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def minimal_model(w90_input, fermi_ev, cutoff):\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of object is w90_input
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a docstring to the minimal_model
function to make it clear.
This was done after the whole rebasing fiasco. Hopefully, it didn't alter anything major. I had to delete the tutorial notebook first as I was rebasing which is why I am adding the tutorial wholly now.
Hello @Wentzell , I have implemented your proposed changes. They are visible in the Sympyfy analytic expresser branch. I am not sure whether I should open another pull request so I have not. If you need me to, I will. Let me know if there are other things I can do. |
I would like to contribute to the TRIQS tutorial repository, an accompanying tutorial I wrote with the help of my mentors Olivier Gingras and Sophie Beck regarding my
TB_to_sympy
which returns the analytical form of the momentum space Hamiltonian of the tight-binding model from a tight-binding lattice object by utilizing the Fourier series.This function has already been merged into TRIQS and can be found in the utils.py file. The tutorial provides the user with a brief introduction to the tight-binding model and enables the user to interact with different parameters of my function; as well as comparing minimal tight-binding models.