Examples
All threads resolved!
All threads resolved!
Compare changes
- Johanna Zijderveld authored
+ 14
− 22
@@ -24,13 +24,7 @@ import numpy as np
@@ -38,6 +32,8 @@ import pymf.kwant_helper.utils as kwant_utils
@@ -50,26 +46,27 @@ $$ Hubbardd $$
To start the meanfield calculation we also need a starting guess. We will use our random guess generator for this. It creates a random Hermitian hopping dictionary based on the hopping keys provided and the number of degrees of freedom specified. As we don't expect the mean-field solution to contain terms more than the hoppings from the interacting part, we can use the hopping keys from the interacting part. We will use the same number of degrees as freedom as both the non-interacting and interacting part, so that they match.
After we have defined the guess, we feed it together with the model into the meanfield solver. The meanfield solver will return a hopping dictionary with the meanfield approximation. We can then add this solution to the non-interacting part to get the full solution. In order to get the solution, we specified the number of k-points to be used in the calculation. This refers to the k-grid used in the Brillouin zone for the density matrix.
We can now create a phase diagram of the gap of the interacting solution. In order to calculate the gap we first create a function which takes a hopping dictionary and a Fermi energy and returns the indirect gap. The gap is defined as the difference between the highest occupied and the lowest unoccupied energy level. We will use a dense k-grid to calculate the gap. In order to obtain the Hamiltonian on a dense k-grid, we use the `tb_to_khamvector` function from the `transforms` module.
@@ -88,9 +85,9 @@ Now that we can calculate the gap, we create a phase diagram of the gap as a fun
@@ -146,7 +143,7 @@ We choose a point in the phase diagram where we expect there to be a CDW phase a
@@ -185,7 +182,7 @@ for mf_sol in mf_sols.flatten():
@@ -200,8 +197,3 @@ plt.ylabel('U')