3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 13:53:40 +01:00

Update documentation

Changelog and some updates were done.
This commit is contained in:
Michel Ferrero 2013-10-16 17:36:19 +02:00 committed by Olivier Parcollet
parent 1517cdaaeb
commit 6a140d2950
6 changed files with 24 additions and 110 deletions

View File

@ -6,10 +6,15 @@ Changelog
This document describes the main changes in TRIQS. This document describes the main changes in TRIQS.
master (latest commit on github) version 1.1.0
-------------------------------- -------------
* The tails now have fixed size avoid mpi problems * New constructors for the gf [api change]
* Fix for gf expression templates
* The gf tails now have fixed size to avoid mpi problems
* Fixes in gf expression templates
* New python random generator interface
* Fixes for issues #11, #18, #25
version 1.0.0 version 1.0.0
------------- -------------

View File

@ -3,7 +3,7 @@ Table of contents
================= =================
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 5
index index
install install

View File

@ -1,64 +0,0 @@
A first external code
=====================
.. highlight:: c
As a first exercise you can try to write a Monte Carlo code for an Ising chain
in a magnetic field. Your goal is to write this code as an external project and
to use the Monte Carlo class provided by TRIQS.
Take some time to read the :ref:`Monte Carlo <montecarlo>` chapter, but don't
read the complete example at the end of the chapter because it is precisely
what you need to do here. You can check your implementation later.
.. _isingex:
Ising chain in magnetic field
-----------------------------
Here's the Hamiltonian for the problem of Ising spins in a magnetic field
.. math::
\mathcal{H} = -J \sum_{i=1}^N \sigma_i \sigma_{i+1} - h \sum_{i=1}^N \sigma_i.
The goal is to find the magnetization per spin :math:`m` of the system for
:math:`J = -1.0`, a magnetic field :math:`h = 0.5` as a function of
the inverse temperature :math:`\beta`. You can see how the results
change with the length of the chain :math:`N`.
Implementation hints
--------------------
Here are a couple of implementation hints that you might want to follow.
* In most Monte Carlo programs there is a *configuration* which is modified
along the simulation. Take enough time to think how this configuration
can be efficiently described and implement it in a separate file, say
:file:`configuration.hpp`. In this example, the configuration is a
collection of spins that can e.g. be described by a vector of integers.
+1 would be a spin up and -1 a spin down. If you're worried with memory
space, you could use a vector of booleans (true for up spins, false for
down spins).
* More to come...
Solution
--------
In the limit :math:`N \rightarrow \infty`, the solution for the magnetization
is
.. math::
m = \frac{\sinh(\beta h) + \frac{\sinh(\beta h)\cosh(\beta h)}{\sqrt{\sinh^2(\beta h) + e^{-4\beta J}}}}
{\cosh(\beta h) + \sqrt{\sinh^2(\beta h) + e^{-4\beta J}}}.
Here's a plot of :math:`m` versus :math:`\beta` for different values of :math:`N`:
.. image:: m_vs_beta.png
:width: 700
:align: center

View File

@ -1,24 +0,0 @@
Developing a project with TRIQS
===============================
Welcome to this tutorial! The goal of these notes is to give a practical
introduction to the development of a code that uses the TRIQS headers and
libraries. Rather than being completely general this tutorial will guide you
through the development of a simple CT-INT impurity solver.
At first, we will see how to write a code that uses TRIQS but that is not meant
to become part of TRIQS. This is especially relevant when you write a pure C++
code for your personal use. You will learn how to write a Monte Carlo
simulation with a simple example.
The next step will be to *pythonize* your code. This is very convenient to
change parameters or do simple pre-simulation calculations. It is also
the way most of TRIQS applications are done.
.. toctree::
:maxdepth: 2
triqs_library
first_mc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -2,6 +2,7 @@
Writing you own C++ code with TRIQS Writing you own C++ code with TRIQS
------------------------------------ ------------------------------------
Basically, this structure means that you have successfully installed TRIQS in Basically, this structure means that you have successfully installed TRIQS in
:file:`/home/triqs/install` and that you plan to have your new project under :file:`/home/triqs/install` and that you plan to have your new project under
:file:`/home/project`. Obviously you can choose any other directory but this :file:`/home/project`. Obviously you can choose any other directory but this
@ -47,28 +48,24 @@ the location of the TRIQS libraries. Here is what your simple
.. code-block :: cmake .. code-block :: cmake
# Append triqs installed files to the cmake load path # Append triqs installed files to the cmake load path
list(APPEND CMAKE_MODULE_PATH ${TRIQS_PATH}/share/triqs/cmake) list(APPEND CMAKE_MODULE_PATH ${TRIQS_PATH}/share/triqs/cmake)
# start configuration # Start configuration
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
project(myproj CXX) project(myproj CXX)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
# We use shared libraries # Load TRIQS, including all predefined variables from TRIQS installation
# option(BUILD_SHARED_LIBS "Build shared libraries" ON) find_package(TRIQS REQUIRED)
# Load TRIQS, including all predefined variables from TRIQS installation # Linking and include info
find_package(TRIQS REQUIRED) link_libraries(${TRIQS_LIBRARY_ALL})
include_directories(${TRIQS_INCLUDE_ALL})
# We want to be installed in the TRIQS tree
set(CMAKE_INSTALL_PREFIX ${TRIQS_PATH})
# Build the code, adding triqs in include and link flags
add_executable(example main.cpp)
include_directories(${TRIQS_INCLUDE_ALL})
target_link_libraries(example ${TRIQS_LIBRARY_ALL})
# Create executable
add_executable(example main.cpp)
triqs_set_rpath_for_target(example)
We're all set! Everything is ready to compile our project. If we want to build We're all set! Everything is ready to compile our project. If we want to build
everything in :file:`/home/project/build`, we do as follows: everything in :file:`/home/project/build`, we do as follows: