Skip to content

Commit

Permalink
Merge branch 'tutorial-autodoc' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
j-otsuki committed Nov 20, 2020
2 parents 97ac5e8 + 14c145a commit 4f344a6
Show file tree
Hide file tree
Showing 90 changed files with 497,839 additions and 106 deletions.
97 changes: 97 additions & 0 deletions doc/tutorial/afm.bak/afm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Antiferromagnetic state in 3D Hubbard model
============================================

In this tutorial, you will learn the following:

* How to define a lattice model using the Wannier90 interface
* How to calculate antiferromagnetic states
* How to set an initial guess for the self-energy

As a particular example, we consider the Hubbard model on a cubic lattice with nearest neighbor hopping of :math:`t=1`.
Within the single-site DMFT approximation, the model shows an antiferromagnetic transition at low temperature.
The transition temperature was estimated as :math:`T_\mathrm{c}/t\simeq 0.5` in `a previous study <https://link.aps.org/doi/10.1103/PhysRevB.72.060411>`_.
In this tutorial, we compute the antiferromagetic state below :math:`T_\mathrm{c}` using the ALPS/CT-HYB solver.
The complete input file is shown below.

.. literalinclude:: cubic.ini
:language: ini

Define lattice model
---------------------------

First, we define the hopping matrix of the 3D Hubbard model with a 2x2x2 unit cell.
Running :download:`mk_hr.py <mk_hr.py>` generates a text file (cubic_hr.dat) in the Wannier90 format.
The unit cell contains eight sites whose internal coordinates are (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1).

We now assume an antiferromagnetic order at :math:`q=(\pi, \pi, \pi)`.
To this end, we assign the eight sites (correlated shells) to two inequivalent shells by using the `corr_to_inequiv` parameter in the model section.

.. code-block:: bash
python mk_hr.py
Generate initial guess for self-energy
--------------------------------------

Second, we generate intial guesses for the (static) self-energies on the two inequivalent shells.
Running :download:`mk_init_se.py <mk_init_se.py>` generates `init_se_up.txt` and `init_se_down.txt`.

.. code-block:: bash
python mk_init_se.py
Self-consistent calculations
------------------------------
Now, DMFT calculations can be done as usual.

.. code-block:: bash
export MPIRUN="mpirun"
dcore_pre cubic.ini > output-pre
dcore cubic.ini --np 48 > output
dcore_post cubic.ini --np 48 > output-post
In the standard output of `dcore`, you will see that the magnetic moments converge to :math:`\simeq 0.43` (86 % of the saturated moment).

.. code-block:: bash
Density Matrix
Inequivalent Shell 0
Spin up
0.929-0.000j
Eigenvalues: [0.92877164]
Spin down
0.072-0.000j
Eigenvalues: [0.07229858]
Magnetic moment (only spin contribution, S=1/2 gives 0.5)
mx, my, mz : 0.0 0.0 0.428236533178
Inequivalent Shell 1
Spin up
0.078-0.000j
Eigenvalues: [0.0779467]
Spin down
0.930-0.000j
Eigenvalues: [0.92994248]
Magnetic moment (only spin contribution, S=1/2 gives 0.5)
mx, my, mz : 0.0 0.0 -0.425997888424
Inequivalent shell0

.. image:: check/iter_sigma-ish0.png
:width: 800
:align: center

Inequivalent shell1

.. image:: check/iter_sigma-ish1.png
:width: 800
:align: center
Binary file added doc/tutorial/afm.bak/check/iter_sigma-ish0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/tutorial/afm.bak/check/iter_sigma-ish1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions doc/tutorial/afm.bak/mk_init_se.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import print_function

import numpy
from itertools import product

norb = 1
mag = 1.0

with open('init_se_up.txt', 'w') as f:
for i, (isp, iorb) in enumerate(product(range(2), range(norb))):
print(isp, iorb, iorb, mag*(-1)**isp, 0.0, file=f)

with open('init_se_down.txt', 'w') as f:
for i, (isp, iorb) in enumerate(product(range(2), range(norb))):
print(isp, iorb, iorb, -mag*(-1)**isp, 0.0, file=f)
140 changes: 88 additions & 52 deletions doc/tutorial/afm/afm.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Antiferromagnetic state in 3D Hubbard model
Antiferromagnetic state
============================================

In this tutorial, you will learn the following:
Expand All @@ -7,38 +7,74 @@ In this tutorial, you will learn the following:
* How to calculate antiferromagnetic states
* How to set an initial guess for the self-energy

As a particular example, we consider the Hubbard model on a cubic lattice with nearest neighbor hopping of :math:`t=1`.
Within the single-site DMFT approximation, the model shows an antiferromagnetic transition at low temperature.
The transition temperature was estimated as :math:`T_\mathrm{c}/t\simeq 0.5` in `a previous study <https://link.aps.org/doi/10.1103/PhysRevB.72.060411>`_.
In this tutorial, we compute the antiferromagetic state below :math:`T_\mathrm{c}` using the ALPS/CT-HYB solver.
The complete input file is shown below.
As a particular example, we consider the Hubbard model on a square lattice (:doc:`/tutorial/square/square`).
Within the single-site DMFT approximation, the model shows an antiferromagnetic transition at low temperature (the Mermin-Wagner theorem is not fulfilled in DMFT).
The transition temperature was estimated as :math:`T_\mathrm{c}/t\simeq 0.23` for :math:`U=4`.
This means that the parameter set used in [:doc:`/tutorial/square/square`] is actually in the antiferromagnetic phase.
In this tutorial, we compute the antiferromagetic solution below :math:`T_\mathrm{c}` using a CT-HYB solver.

.. literalinclude:: cubic.ini
.. in `a previous study <https://link.aps.org/doi/10.1103/PhysRevB.72.060411>`_.
The complete input file is shown below:

:download:`square_afm.ini`

.. literalinclude:: square_afm.ini
:language: ini

Define lattice model
---------------------------

First, we define the hopping matrix of the 3D Hubbard model with a 2x2x2 unit cell.
Running :download:`mk_hr.py <mk_hr.py>` generates a text file (cubic_hr.dat) in the Wannier90 format.
The unit cell contains eight sites whose internal coordinates are (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1).
..
First, we define the hopping matrix of the 3D Hubbard model with a 2x2x2 unit cell.
Running :download:`mk_hr.py <mk_hr.py>` generates a text file (cubic_hr.dat) in the Wannier90 format.
The unit cell contains four sites whose internal coordinates are (0, 0), (0, 1), (1, 0), (1, 1).
We now assume an antiferromagnetic order characterized by the wave vector :math:`q=(\pi, \pi)`.
To this end, we assign the four sites (correlated shells) to two inequivalent shells by using the ``corr_to_inequiv`` parameter in the model section.

We now assume an antiferromagnetic order at :math:`q=(\pi, \pi, \pi)`.
To this end, we assign the eight sites (correlated shells) to two inequivalent shells by using the `corr_to_inequiv` parameter in the model section.
First, we define the hopping matrix of the 2D Hubbard model with a 2x2 unit cell.
Running the script :download:`mk_hr_2.py` as

.. code-block:: bash
python mk_hr.py
python mk_hr_2.py
a text file in the Wannier90 format is generated (:download:`afm_dim2_hr.dat`).
The unit cell contains four sites whose internal coordinates are (0, 0), (0, 1), (1, 0), (1, 1).

We now assume an antiferromagnetic order characterized by the wave vector :math:`q=(\pi, \pi)`.
To this end, we assign the four sites (correlated shells) to two inequivalent shells by using the ``corr_to_inequiv`` parameter in the model section.


Generate initial guess for self-energy
--------------------------------------

Second, we generate intial guesses for the (static) self-energies on the two inequivalent shells.
Running :download:`mk_init_se.py <mk_init_se.py>` generates `init_se_up.txt` and `init_se_down.txt`.
..
Second, we generate intial guesses for the (static) self-energies on the two inequivalent shells.
Running :download:`mk_init_se.py <mk_init_se.py>` generates `init_se_up.txt` and `init_se_down.txt`.
.. code-block:: bash
python mk_init_se.py
Second, we set up intial guesses for the (static) self-energies on the two inequivalent shells.
For one shell, we use the text file :download:`init_se_up.txt` containing

.. code-block:: bash
0 0 0 -1.0 0.0
1 0 0 1.0 0.0
and for the other, we use :download:`init_se_down.txt` containing

.. code-block:: bash
python mk_init_se.py
0 0 0 1.0 0.0
1 0 0 -1.0 0.0
Thus, spin moments tend to turn up on inequivalent shell0 and turn down on shell1.


Self-consistent calculations
------------------------------
Expand All @@ -52,46 +88,46 @@ Now, DMFT calculations can be done as usual.
dcore_post cubic.ini --np 48 > output-post
In the standard output of `dcore`, you will see that the magnetic moments converge to :math:`\simeq 0.43` (86 % of the saturated moment).
In the standard output of ``dcore``, you will see that the magnetic moments converge to :math:`\simeq 0.28` (57 % of the saturated moment).

.. code-block:: bash
Density Matrix
Inequivalent Shell 0
Spin up
0.929-0.000j
Eigenvalues: [0.92877164]
Spin down
0.072-0.000j
Eigenvalues: [0.07229858]
Magnetic moment (only spin contribution, S=1/2 gives 0.5)
mx, my, mz : 0.0 0.0 0.428236533178
Inequivalent Shell 1
Spin up
0.078-0.000j
Eigenvalues: [0.0779467]
Spin down
0.930-0.000j
Eigenvalues: [0.92994248]
Magnetic moment (only spin contribution, S=1/2 gives 0.5)
mx, my, mz : 0.0 0.0 -0.425997888424
Inequivalent shell0

.. image:: check/iter_sigma-ish0.png
:width: 800
Density Matrix
Inequivalent Shell 0
Spin up
0.784-0.000j
Eigenvalues: [0.7837032]
Spin down
0.218+0.000j
Eigenvalues: [0.2182982]
Magnetic moment (only spin contribution, S=1/2 gives 0.5)
mx,my,mz= 0.0 0.0 0.282702499302
Inequivalent Shell 1
Spin up
0.218-0.000j
Eigenvalues: [0.21842138]
Spin down
0.784-0.000j
Eigenvalues: [0.78360972]
Magnetic moment (only spin contribution, S=1/2 gives 0.5)
mx,my,mz= 0.0 0.0 -0.282594174364
The graph below is one of the figures generated by ``dcore_check``, which shows the convergence of the spin moment for inequivalent shell0:

.. image:: check/iter_spin-ish0.png
:width: 80%
:align: center

Inequivalent shell1
For inequivalent shell1, the spin moment points the opposite directions:

.. image:: check/iter_sigma-ish1.png
:width: 800
.. image:: check/iter_spin-ish1.png
:width: 80%
:align: center
Loading

0 comments on commit 4f344a6

Please sign in to comment.