Skip to content
Snippets Groups Projects

Examples

Merged Kostas Vilkelis requested to merge examples into main
Compare and Show latest version
3 files
+ 36
14
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -11,7 +11,7 @@ kernelspec:
name: python3
---
# Graphene and extended Hubbard
# Graphene with interactions
## The physics
@@ -66,11 +66,11 @@ After we have defined the guess, we feed it together with the model into the mea
## Creating a phase diagram of the gap
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.
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_kgrid` function from pymf.
```{code-cell} ipython3
def compute_gap(h, fermi_energy=0, nk=100):
kham = pymf.tb_to_khamvector(h, nk, ks=None)
kham = pymf.tb_to_kgrid(h, nk)
vals = np.linalg.eigvalsh(kham)
emax = np.max(vals[vals <= fermi_energy])
@@ -104,7 +104,7 @@ def compute_phase_diagram(Us, Vs, int_builder, h_0):
mf_sols = np.asarray(mf_sols).reshape((len(Us), len(Vs)))
return gaps, mf_sols
```
We chose to initialize a new guess for each $U$ value, but not for each $V$ value. Instead, for consecutive $V$ values we use the previous mean-field solution as a guess. We do this because the mean-field solution is expected to be smooth in the interaction strength and therefore by using an inspired guess we can speed up the calculation.
We chose to initialize a new guess for each new $U$ and $V$ value. For certain mean-field problems, one might want to reuse the mean-field solution of a nearby parameter as the next guess in order to speed up computations. However, as the size of this system is still small, we can afford to initialize a new guess for each new $U$ and $V$ value.
We can now compute the phase diagram and then plot it
@@ -136,7 +136,7 @@ cdw_order_parameter = {}
cdw_order_parameter[(0,0)] = np.kron(sz, np.eye(2))
```
We choose a point in the phase diagram where we expect there to be a CDW phase and calculate the expectation value with the CDW order parameter. In order to do this we first construct the density matrix from the mean field solution. We perform this calculation over the complete phase diagram where we calculated the gap earlier:
We choose a point in the phase diagram where we expect there to be a CDW phase and calculate the expectation value with the CDW order parameter. In order to do this we first construct the density matrix from the mean field solution. As the mean-field solution is in terms of a hopping dictionary, we can now freely choose the number of k-points on which we want to calculate the density-matrix. We perform this calculation over the complete phase diagram where we calculated the gap earlier:
```{code-cell} ipython3
cdw_list = []
Loading