Skip to content
Snippets Groups Projects
Commit 545ff1d3 authored by Johanna Zijderveld's avatar Johanna Zijderveld
Browse files

fix small mistakes and add to index

parent 4a66cc49
No related branches found
No related tags found
1 merge request!7Examples
Pipeline #179623 passed
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
...@@ -42,7 +42,7 @@ We verify this tight-binding model by plotting the band structure and observing ...@@ -42,7 +42,7 @@ We verify this tight-binding model by plotting the band structure and observing
# Set number of k-points # Set number of k-points
nk = 100 nk = 100
ks = np.linspace(0, 2*np.pi, nk, endpoint=False) ks = np.linspace(0, 2*np.pi, nk, endpoint=False)
hamiltonians_0 = pymf.tb_to_khamvector(h_0, nk, 1, ks=ks) hamiltonians_0 = pymf.tb_to_khamvector(h_0, nk, ks=ks)
vals, vecs = np.linalg.eigh(hamiltonians_0) vals, vecs = np.linalg.eigh(hamiltonians_0)
plt.plot(ks, vals, c="k") plt.plot(ks, vals, c="k")
...@@ -69,12 +69,14 @@ $$ ...@@ -69,12 +69,14 @@ $$
This is simply constructed by writing: This is simply constructed by writing:
```{code-cell} ipython3 ```{code-cell} ipython3
U=0.5
h_int = {(0,): U * np.kron(np.ones((2, 2)), np.eye(2)),} h_int = {(0,): U * np.kron(np.ones((2, 2)), np.eye(2)),}
``` ```
In order to find a meanfield solution, we combine the non interacting Hamiltonian with the interaction Hamiltonian and the relevant filling into a `Model` object. We then generate a starting guess for the meanfield solution and solve the model using the `solver` function. It is important to note that the guess will influence the possible solutions which the `solver` can find in the meanfield procedure. The `generate_guess` function generates a random Hermitian tight-binding dictionary, with the keys provided as hopping vectors and the values of the size as specified. In order to find a meanfield solution, we combine the non interacting Hamiltonian with the interaction Hamiltonian and the relevant filling into a `Model` object. We then generate a starting guess for the meanfield solution and solve the model using the `solver` function. It is important to note that the guess will influence the possible solutions which the `solver` can find in the meanfield procedure. The `generate_guess` function generates a random Hermitian tight-binding dictionary, with the keys provided as hopping vectors and the values of the size as specified.
```{code-cell} ipython3 ```{code-cell} ipython3
filling = 2
full_model = pymf.Model(h_0, h_int, filling) full_model = pymf.Model(h_0, h_int, filling)
guess = pymf.generate_guess(frozenset(h_int), ndof=4) guess = pymf.generate_guess(frozenset(h_int), ndof=4)
mf_sol = pymf.solver(full_model, guess, nk=nk) mf_sol = pymf.solver(full_model, guess, nk=nk)
......
...@@ -20,6 +20,7 @@ kernelspec: ...@@ -20,6 +20,7 @@ kernelspec:
mf_notes.md mf_notes.md
graphene_example.md graphene_example.md
hubbard_1d.md
``` ```
## What is pymf? ## What is pymf?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment