Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
srbhp committed Jan 17, 2025
1 parent f7e2523 commit 66692ca
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run:
sudo apt-get update
&& sudo apt-get install sphinx-doc doxygen graphviz libhdf5-dev --yes
&& pip3 install sphinx-rtd-theme breathe sphinx-sitemap sphinx==7.1 exhale pydata-sphinx-theme
&& pip3 install sphinx-rtd-theme breathe sphinx-sitemap sphinx==7.1 exhale pydata-sphinx-theme myst-parser
&& wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
&& echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
&& sudo apt update
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
*log*
.vscode/
*.pdf
*tempfile*
.ccls-cache/
.cache/
build/

poetry.lock
compile_commands.json
30 changes: 19 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
""" "
README.md
"""

import os
import sys

Expand All @@ -19,6 +23,21 @@
# there may be others here already, e.g. 'sphinx.ext.mathjax'
"breathe",
"exhale",
# inbuilt extensions
# "sphinx.ext.autodoc",
# "sphinx.ext.autosectionlabel",
# "sphinx.ext.autosummary",
# "sphinx.ext.coverage",
# "sphinx.ext.extlinks",
# "sphinx.ext.graphviz",
# "sphinx.ext.imgconverter",
# "sphinx.ext.inheritance_diagram",
# "sphinx.ext.intersphinx",
# "sphinx.ext.linkcode",
# "sphinx.ext.napoleon",
# "sphinx.ext.todo",
# "sphinx.ext.viewcode",
"myst_parser",
]

# Setup the breathe extension
Expand Down Expand Up @@ -67,16 +86,6 @@
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
# sidebar
# html_sidebars = {
# "**": [
# "about.html",
# "navigation.html",
# "relations.html",
# "searchbox.html",
# "donate.html",
# ]
# }
html_theme_options = {
"header_links_before_dropdown": 4,
"icon_links": [
Expand All @@ -92,7 +101,6 @@
}
],
}
html_theme_options = {}


# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
4 changes: 4 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Examples
========

.. include:: ../examples/**.md
62 changes: 60 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,69 @@ these member vairables:
* std::vector<std::vector<int>> n_Q


Docs
====
Example : Single Impurity Anderson Impurity (SIAM)
---------------------------------------------------
`(See : examples/rgflowSIAM/main.cpp)`

Define the impurity Model wth onsite energy `eps` and Coulomb energy `U_int`.

.. code-block:: cpp
spinhalf impurity(eps, U_int);
The bath for the SIAM is also constructed in the same way.

.. code-block:: cpp
spinhalf bathModel(0, 0); // set parameters
Once we have created the bath and the impurity we can
construct a `nrgcore` object which will take care of
many things that we need to do for the `NRG iterations`.
This includes calculating static and dynamic quantities
of the Impurity.

.. code-block:: cpp
nrgcore<spinhalf, spinhalf> siam(impurity, bathModel);
siam.set_parameters(1024); // set max number of states to be kept
siam.add_bath_site({V, V}, 1.0); // V is the coupling og the impurity and first bath site.
siam.update_internal_state();
Next we iteratively add the bath sites in the same way. We
also create HDF5 file object to save the Eigenvalues.


.. code-block:: cpp
// file where outputput will be wriiten
h5stream::h5stream rfile("resultSIAM.h5");
// Iterative add bath sites
for (int in = 0; in < nMax; in++) {
double rescale = 1.0;
if (in > 0) {
rescale = std::sqrt(LAMBDA);
}
siam.add_bath_site({hopping(in, LAMBDA), hopping(in, LAMBDA)}, rescale);
// Update System Operators now here if we need to.
// This has to be done before updating the systems internal state.
siam.update_internal_state();
// Save the eigenvalue of the current iteration
rfile.write(siam.all_eigenvalue, "Eigenvalues" + std::to_string(in));
}
rfile.close();
Plot the RG flow `(See : examples/rgflowSIAM/plot.py)`.

.. image:: ../docs/image/rgflowSIAM.png
:width: 100%
:alt: RG flow plot


Docs
====

.. toctree::
:maxdepth: 2
:caption: Contents:
Expand Down
Empty file added examples/entropyKondo/readme.md
Empty file.
Empty file added examples/entropySIAM/readme.md
Empty file.
Empty file.
Empty file.
Empty file added examples/freeModel/readme.md
Empty file.
Empty file added examples/rabiAnderson/readme.md
Empty file.
Empty file.
Empty file added examples/rgflowKondo/readme.md
Empty file.
Empty file added examples/rgflowSIAM/readme.md
Empty file.
Empty file.
5 changes: 0 additions & 5 deletions nrgcore/include/models/freeModel.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#pragma once
#include "models/fermionBasis.hpp"
#include "nrgcore/qOperator.hpp"
#include "nrgcore/qsymmetry.hpp"
#include "utils/qmatrix.hpp"
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstddef>
#include <iostream>
#include <map>
#include <optional>
#include <string>
#include <vector>
class freeModel : public fermionBasis {
/** This is single channel free model class
Expand Down
2 changes: 0 additions & 2 deletions nrgcore/include/utils/configPerser.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#pragma once
#include <algorithm>
#include <fstream>
#include <iostream>
#include <map>
#include <regex>
#include <string>
#include <vector>
class configPerser {
// # start starts with comment
// spaces are ignored
Expand Down
2 changes: 1 addition & 1 deletion nrgcore/include/utils/h5stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class dspace {
};
// ---- -----------------------------------
/**
* @class gspace: Read and write metadata to a `H5::Group` object.
* @class gspace: reading and write metadata to a `H5::Group` object.
* @brief
*
*/
Expand Down
Binary file added resultsZero.h5
Binary file not shown.

0 comments on commit 66692ca

Please sign in to comment.