summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-19 11:05:06 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-19 11:05:06 -0400
commitc41db143c477b627c8c690b621f7bb514e08bbbf (patch)
treeca0eb942e7828189d795226ebe89aa41487db748
parent6e2bb4738bf5df9c0552c6fdc25743c91e45ebe9 (diff)
downloadc++-c41db143c477b627c8c690b621f7bb514e08bbbf.tar.gz
c++-c41db143c477b627c8c690b621f7bb514e08bbbf.tar.bz2
c++-c41db143c477b627c8c690b621f7bb514e08bbbf.zip
polished up the documentation
-rw-r--r--doc/compile.rst26
-rw-r--r--doc/conf.py50
-rw-r--r--doc/finite_states.rst8
-rw-r--r--doc/graph.rst45
-rw-r--r--doc/measurement.rst92
-rw-r--r--doc/models.rst16
-rw-r--r--doc/system.rst76
7 files changed, 172 insertions, 141 deletions
diff --git a/doc/compile.rst b/doc/compile.rst
index 2a3b4a2..e4960a3 100644
--- a/doc/compile.rst
+++ b/doc/compile.rst
@@ -12,28 +12,18 @@ Building Without A Field
.. c:macro:: WOLFF_NO_FIELD
-When this flag is defined Wolff will not use a field. When a field isn't necessary, this will improve performance: no ghost site will be initialize and no time will be wasted checking the energy change with respect to a uncoupled ghost site.
+ When this flag is defined Wolff will not use a field. When a field isn't necessary, this will improve performance: no ghost site will be initialize and no time will be wasted checking the energy change with respect to a uncoupled ghost site.
-When defined, the constructor for :cpp:class:`system` becomes
-
-.. cpp:namespace:: cflags
-
-.. cpp:function:: system(graph, double, std::function <double(const X_t&, const X_t&)>)
-
-The resulting :cpp:class:`system` object does not have member objects :cpp:member:`B` or :cpp:member:`s0`, and :cpp:member:`system::G` does not have a ghost site initialized.
+ When defined, the constructor for :cpp:class:`system` becomes :cpp:any:`system(graph, double, std::function <double(const X_t&, const X_t&)>)`. The resulting :cpp:class:`system` object does not have member objects :cpp:any:`B` or :cpp:member:`s0`, and :cpp:member:`system::G` does not have a ghost site initialized.
Building With Bond Dependence
=============================
.. c:macro:: WOLFF_BOND_DEPENDENCE
-When this flag is defined Wolff will ask for the indices of the spins on each side a bond, allowing the implementation of random bonds or anisotropic interactions.
-
-When defined, the bond coupling must be a function of the form
+ When this flag is defined Wolff will ask for the indices of the spins on each side a bond, allowing the implementation of random bonds or anisotropic interactions.
-.. cpp:function:: double Z(v_t, const X_t&, v_t, const X_t&)
-
-where the first argument is the index of the first spin and the third argument is the index of the second spin. A function of this type is passed to :cpp:class:`system` in place of the original bond coupling.
+ When defined, the bond coupling must be a function of the form :cpp:any:`double Z(v_t, const X_t&, v_t, const X_t&)`, where the first argument is the index of the first spin and the third argument is the index of the second spin. A function of this type is passed to :cpp:class:`system` in place of the original bond coupling.
Building With Site Dependence
@@ -41,11 +31,7 @@ Building With Site Dependence
.. c:macro:: WOLFF_SITE_DEPENDENCE
-When this flag is defined Wolff will ask for the indices of the spin when measuring the external field, allowing the implementation of random fields or to emulate boundaries.
-
-When defined, the field coupling must be a function of the form
-
-.. cpp:function:: double B(v_t, const X_t&)
+ When this flag is defined Wolff will ask for the indices of the spin when measuring the external field, allowing the implementation of random fields or to emulate boundaries.
-where the first argument is the index of the spin. A function of this type is passed to :cpp:class:`system` in place of the original field coupling.
+ When defined, the field coupling must be a function of the form :cpp:any:`double B(v_t, const X_t&)`, where the first argument is the index of the spin. A function of this type is passed to :cpp:class:`system` in place of the original field coupling.
diff --git a/doc/conf.py b/doc/conf.py
index 112d4b7..1b6476d 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -19,14 +19,40 @@
# -- Project information -----------------------------------------------------
-project = 'wolff'
+from subprocess import Popen, PIPE
+
+def get_version():
+ """
+ Returns project version as string from 'git describe' command.
+ """
+ pipe = Popen('git describe --tags', stdout=PIPE, shell=True)
+ version = pipe.stdout.read()
+
+ if version:
+ return version
+ else:
+ return '0.0'
+
+def get_release():
+ """
+ Returns project version as string from 'git describe' command.
+ """
+ pipe = Popen('git describe --tags --always', stdout=PIPE, shell=True)
+ version = pipe.stdout.read()
+
+ if version:
+ return version
+ else:
+ return '0.0'
+
+project = 'Wolff'
copyright = '2018, Jaron Kent-Dobias'
author = 'Jaron Kent-Dobias'
# The short X.Y version
-version = ''
+version = '0.0'
# The full version, including alpha/beta/rc tags
-release = ''
+release = get_version().lstrip('v').rstrip()
# -- General configuration ---------------------------------------------------
@@ -64,10 +90,10 @@ language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
-exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+exclude_patterns = ['_build']
# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = None
+pygments_style = 'default'
# -- Options for HTML output -------------------------------------------------
@@ -75,7 +101,7 @@ pygments_style = None
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-html_theme = 'alabaster'
+html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -102,7 +128,7 @@ html_static_path = ['_static']
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
-htmlhelp_basename = 'wolffdoc'
+htmlhelp_basename = 'Wolffdoc'
# -- Options for LaTeX output ------------------------------------------------
@@ -129,7 +155,7 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'wolff.tex', 'wolff Documentation',
+ (master_doc, 'Wolff.tex', 'Wolff Documentation',
'Jaron Kent-Dobias', 'manual'),
]
@@ -139,7 +165,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'wolff', 'wolff Documentation',
+ (master_doc, 'Wolff', 'Wolff Documentation',
[author], 1)
]
@@ -150,8 +176,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'wolff', 'wolff Documentation',
- author, 'wolff', 'One line description of project.',
+ (master_doc, 'Wolff', 'Wolff Documentation',
+ author, 'Wolff', 'One line description of project.',
'Miscellaneous'),
]
@@ -174,4 +200,4 @@ epub_title = project
epub_exclude_files = ['search.html']
-# -- Extension configuration ------------------------------------------------- \ No newline at end of file
+# -- Extension configuration -------------------------------------------------
diff --git a/doc/finite_states.rst b/doc/finite_states.rst
index 5d1fce8..26178cd 100644
--- a/doc/finite_states.rst
+++ b/doc/finite_states.rst
@@ -5,20 +5,20 @@
Finite States
*************
-One of the slower steps in running the algorithm is taking the exponent involved in computing the bond activation probabilities for each prospective bond. When the spins in your system have a finite number of possible states, the algorithm can be sped up considerably by precomputing the bond activation probabilities for every possible combination pair spins. Once the appropriate things have been defined for your model, the header :file:`wolff/finite_states.hpp` can be invoked to automate this process. The provided model headers :file:`wolff/models/ising.hpp` and :file:`wolff/models/potts.hpp` demonstrate the expected usage.
+One of the slower steps in running the algorithm is taking the exponent involved in computing the bond activation probabilities for each prospective bond. When the spins in your system have a finite number of possible states, the algorithm can be sped up considerably by precomputing the bond activation probabilities for every possible pair of spins. Once the appropriate things have been defined for your model, the header :file:`wolff/finite_states.hpp` can be invoked to automate this process. The provided model headers :file:`wolff/models/ising.hpp` and :file:`wolff/models/potts.hpp` demonstrate the expected usage.
Required Definitions
====================
.. c:macro:: WOLFF_FINITE_STATES_N
-This macro must be defined and given a value equal to the number of states your model can take.
+ This macro must be defined and given a value equal to the number of states your model can take.
.. cpp:var:: const X_t finite_states_possible[WOLFF_FINITE_STATES_N]
-You must supply a constant array which lists each of the possible states of your individual spins.
+ You must supply a constant array which lists each of the possible states of your individual spins.
.. cpp:function:: q_t finite_states_enum(const X_t&)
-You must define a function which takes each state and returns its index in :cpp:var:`finite_states_possible`.
+ You must define a function which takes each state and returns its index in :cpp:var:`finite_states_possible`.
diff --git a/doc/graph.rst b/doc/graph.rst
index e44a14f..8a96e50 100644
--- a/doc/graph.rst
+++ b/doc/graph.rst
@@ -1,47 +1,52 @@
+.. default-domain:: cpp
+
******
Graphs
******
This class is defined in the header :file:`wolff/graph.hpp`.
-.. cpp:class:: graph
+.. class:: graph
+
+ Lattices are described by objects of class :class:`graph`, a minimal implementation of graphs.
- Lattices are described by objects of class :cpp:class:`graph`, a minimal implementation of graphs.
+ .. member:: D_t graph::D
-.. cpp:member:: D_t graph::D
+ The dimension of the graph. This property is unused by the core library.
- The dimension of the graph. This property is unused by the core library.
+ .. member:: L_t graph::L
-.. cpp:member:: L_t graph::L
+ The linear size of the graph. This property is unused by the core library.
- The linear size of the graph. This property is unused by the core library.
+ .. member:: v_t graph::ne
-.. cpp:member:: v_t graph::ne
+ The number of edges in the graph. This property is unused by the core library.
- The number of edges in the graph. This property is unused by the core library.
+ .. member:: v_t graph::nv
-.. cpp:member:: v_t graph::nv
+ The number of vertices in the graph.
- The number of vertices in the graph.
+ .. member:: std::vector<std::vector<v_t>> graph::adjacency
-.. cpp:member:: std::vector<std::vector<v_t>> graph::adjacency
+ The adjacency list for the graph. The :math:`i\text{th}` element of :member:`adjacency` is a standard library vector containing the indices of all vertices adjacent to vertex :math:`i`.
- The adjacency list for the graph. The :math:`i\text{th}` element of :cpp:member:`adjacency` is a standard library vector containing the indices of all vertices adjacent to vertex :math:`i`.
+ .. member:: std::vector<std::vector<double>> graph::coordinate
-.. cpp:member:: std::vector<std::vector<double>> graph::coordinate
+ The coordinates of the graph vertices. The :math:`i\text{th}` element of :var:`coordinate` is a standard library vector of length :var:`D` containing the spatial coordinates of vertex :math:`i`. This property is unused by the core library.
- The coordinates of the graph vertices. The :math:`i\text{th}` element of :cpp:var:`coordinate` is a standard library vector of length :cpp:var:`D` containing the spatial coordinates of vertex :math:`i`. This property is unused by the core library.
+ .. function:: graph::graph()
-.. cpp:function:: graph::graph()
+ The default constructor. Initializes an empty graph, i.e., :var:`D`, :var:`L`, :var:`ne`, and :var:`nv` are all zero and :var:`adjacency` and :var:`coordinate` are uninitialized.
- The default constructor. Initializes an empty graph, i.e., :cpp:var:`D`, :cpp:var:`L`, :cpp:var:`ne`, and :cpp:var:`nv` are all zero and :cpp:var:`adjacency` and :cpp:var:`coordinate` are uninitialized.
+ .. function:: graph::graph(D_t D, L_t L)
-.. cpp:function:: graph::graph(D_t D, L_t L)
+ Initializes a graph of a :var:`D`-dimensional hypercubic lattice with :var:`L` vertices per side. This is the only nontrivial graph constructor supplied by the core library. The library will work with arbitrary graphs, and if a different lattice is needed consider calling the default constructor and populating the member objects youself before handing the graph to the :class:`system` constructor.
- Calling the constructor with :cpp:var:`D` and :cpp:var:`L` will initialize the graph of a :cpp:var:`D`-dimensional hypercubic lattice with :cpp:var:`L` vertices per side. This is the only nontrivial graph constructor supplied by the core library.
+ :param D_t D: The dimension of space.
+ :param L_t L: The number of vertices per edge of the hypercube.
-.. cpp:function:: void graph::add_ghost()
+ .. function:: void graph::add_ghost()
- Calling this function on a graph object will add a ghost site to the graph. Explicitly, a new vertex is added that is adjacent to every other vertex in the graph. This vertex will have the last index, which is equal to number of vertices in the original graph.
+ Calling this function on a graph object will add a ghost site to the graph. Explicitly, a new vertex is added that is adjacent to every other vertex in the graph. This vertex will have the last index, which is equal to number of vertices in the original graph.
diff --git a/doc/measurement.rst b/doc/measurement.rst
index e71010d..1b4381c 100644
--- a/doc/measurement.rst
+++ b/doc/measurement.rst
@@ -1,84 +1,68 @@
+.. default-domain:: cpp
+
************
Measurements
************
One of the most complicated parts of using this library is setting up measurements to take during a run, but once understood they provide a powerful way to quickly measure arbitrary properties. The class is defined in the header :file:`wolff/measurement.hpp`.
-.. cpp:class:: template\<class R_t, class X_t> measurement
+.. class:: template<R_t, X_t> measurement
This class defines several virtual member functions. To use the library, you must supply your own measurement class that inherits this one and defines those functions, which may be trivial.
Each member function defines a hook that is run at a specific time during execution. These hooks can be used to modify member objects of your inheritor measurement class, and thereby extract information from the simulation.
-.. cpp:function:: template<void measurement::pre_cluster(N_t n, N_t N, const system<R_t, X_t>& S, v_t i0, const R_t& r)
-
- This hook is run prior to cluster formation. The arguments supplied are:
-
- =========================== ===
- :cpp:var:`n` the number of clusters already flipped
- :cpp:var:`N` the total number of clusters to flip
- :cpp:var:`S` the current system state
- :cpp:var:`i0` the index of the seed vertex for the cluster
- :cpp:var:`r` the transformation by which the cluster will be flipped
- =========================== ===
-
-.. cpp:function:: void measurement::plain_bond_visited(const system<R_t, X_t>& S, v_t i1, const X_t& s1_new, v_t i2, double dE)
+ .. function:: void measurement::pre_cluster(N_t n, N_t N, const system<R_t, X_t>& S, v_t i0, const R_t& r)
- This hook is run when an ordinary edge is visited during cluster formation, whether it is activated or not. The arguments supplied are:
+ This hook is run prior to cluster formation.
- ================================= ===
- :code:`const system<R_t, X_t>& S` the current system state
- :code:`v_t i1` the index of the vertex soon to be flipped
- :code:`const X_t& s1_new` the state vertex :cpp:var:`i1` will be flipped to
- :code:`v_t i2` the other vertex sharing the edge
- :code:`double dE` the change in energy that will result when the spin at site :cpp:var:`i1` is flipped
- ================================= ===
+ :param N_t n: The number of clusters already flipped.
+ :param N_t N: The total number of clusters to flip.
+ :param const system<R_t, X_t>& S: The current system state.
+ :param v_t i0: The index of the seed vertex for the cluster.
+ :param const R_t& r: The transformation by which the cluster will be flipped.
-.. cpp:function:: void measurement::plain_site_transformed(const system<R_t, X_t>& S, v_t i, const X_t& si_new)
+ .. function:: void measurement::plain_bond_visited(const system<R_t, X_t>& S, v_t i1, const X_t& s1_new, v_t i2, double dE)
- This hook is run when an ordinary site is about to be flipped. The arguments supplied are:
+ This hook is run when an ordinary edge is visited during cluster formation, whether it is activated or not.
- ================================= ===
- :code:`const system<R_t, X_t>& S` the current system state
- :code:`v_t i` the index of the vertex soon to be flipped
- :code:`const X_t& si_new` the state vertex :cpp:var:`i` will be flipped to
- ================================= ===
+ :param const system<R_t, X_t>& S: The current system state.
+ :param v_t i1: The index of the vertex soon to be flipped.
+ :param const X_t& s1_new: The state vertex :code:`i1` will be flipped to.
+ :param v_t i2: The other vertex sharing the edge.
+ :param double dE: The change in energy that will result when the spin at site :code:`i1` is flipped.
-|
+ .. cpp:function:: void measurement::plain_site_transformed(const system<R_t, X_t>& S, v_t i, const X_t& si_new)
-.. cpp:function:: void measurement::ghost_bond_visited(const system<R_t, X_t>& S, v_t i, const X_t& s0si_old, const X_t& s0si_new, double dE)
+ This hook is run when an ordinary site is about to be flipped.
- This hook is run when an edge containing the ghost site is visited during cluster formation, whether activated or not. The arguments supplied are:
+ :param const system<R_t, X_t>& S: The current system state.
+ :param v_t i: The index of the vertex soon to be flipped.
+ :param const X_t& si_new: The state vertex :code:`i` will be flipped to.
- ================================= ===
- :code:`const system<R_t, X_t>& S` the current system state
- :code:`v_t i` the index of the non-ghost site in this edge
- :code:`const X_t& s0si_old` the state that the spin on the non-ghost site has before the transformation is applied, rotated by the inverse action of the ghost site
- :code:`const X_t& s0si_new` the state that the spin on the non-ghost site will have after the transformation is applied, rotated by the inverse action of the ghost site
- :code:`double dE` the change in energy that will result when one site is transformed
- ================================= ===
+ .. cpp:function:: void measurement::ghost_bond_visited(const system<R_t, X_t>& S, v_t i, const X_t& s0si_old, const X_t& s0si_new, double dE)
-|
+ This hook is run when an edge containing the ghost site is visited during cluster formation, whether activated or not.
-.. cpp:function:: void measurement::ghost_site_transformed(const system<R_t, X_t>& S, const R_t& R_new)
+ :param const system<R_t, X_t>& S: The current system state.
+ :param v_t i: The index of the non-ghost site in this edge.
+ :param const X_t& s0si_old: The state that the spin on the non-ghost site has before the transformation is applied, rotated by the inverse action of the ghost site.
+ :param const X_t& s0si_new: The state that the spin on the non-ghost site will have after the transformation is applied, rotated by the inverse action of the ghost site.
+ :param double dE: The change in energy that will result when one site is transformed.
- This hook is run when the ghost site is about to be flipped. The arguments supplied are:
+ .. cpp:function:: void measurement::ghost_site_transformed(const system<R_t, X_t>& S, const R_t& R_new)
- ================================= ===
- :code:`const system<R_t, X_t>& S` the current system state
- :code:`const R_t& R_new` the state the ghost site will be flipped to
- ================================= ===
+ This hook is run when the ghost site is about to be flipped.
-|
+ :param const system<R_t, X_t>& S: The current system state.
+ :param const R_t& R_new: The state the ghost site will be flipped to.
-.. cpp:function:: void measurement::post_cluster(N_t n, N_t N, const system<R_t, X_t>& S)
+ .. cpp:function:: void measurement::post_cluster(N_t n, N_t N, const system<R_t, X_t>& S)
- This hook is run after a cluster has been flipped. The arguments supplied are:
+ This hook is run after a cluster has been flipped.
- ================================= ===
- :code:`N_t n` the number of clusters already flipped
- :code:`N_t N` the total number of clusters to flip
- :code:`const system<R_t, X_t>& S` the current system state
- ================================= ===
+ :param N_t n: The number of clusters already flipped.
+ :param N_t N: The total number of clusters to flip.
+ :param const system<R_t, X_t>& S: The current system state.
diff --git a/doc/models.rst b/doc/models.rst
index aa80ee6..e376e2e 100644
--- a/doc/models.rst
+++ b/doc/models.rst
@@ -3,8 +3,8 @@
Defining a Model
****************
-To define your own model, you need a class for spin states, a class for spin transformations, a bond and site coupling, and a generator of transformations.
-
+To define your own model, you need a class for spin states, a class for spin transformations, a bond and site coupling, and a generator of transformations. Many examples of models can be found in the headers contained in :file:`wolff/models/`.
+
Spin States
===========
@@ -23,18 +23,30 @@ Transformations
The action of the transformation on a spin, returning the transformed spin.
+ :param const X_t&: The spin state to transform.
+ :returns: The transformed spin state.
+
.. cpp:function:: R_t act(const R_t&)
The action of the transformation on another transformation, returning the transformed transformation.
+ :param const R_t&: The transformation state to transform.
+ :returns: The transformed spin state.
+
.. cpp:function:: X_t act_inverse(const X_t&)
The action of the inverse transformation on a spin, returning the transformed spin.
+ :param const X_t&: The spin state to transform.
+ :returns: The transformed spin state.
+
.. cpp:function:: R_t act_inverse(const R_t&)
The action of the inverse transformation on another transformation, returning the transformed transformation.
+ :param const R_t&: The transformation state to transform.
+ :returns: The transformed spin state.
+
Couplings
=========
diff --git a/doc/system.rst b/doc/system.rst
index 1751e2b..cb78a6d 100644
--- a/doc/system.rst
+++ b/doc/system.rst
@@ -1,61 +1,79 @@
+.. default-domain:: cpp
+
*************************************
Constructing a System & Running Wolff
*************************************
-The core of the library lies in the :cpp:class:`system` class and its member functions. Here, the state of your model is stored and cluster flip Monte Carlo can be carried out in various ways.
+This class and associated member functions are defined in the header files :file:`wolff.hpp`, :file:`wolff/system.hpp`, and :file:`wolff/cluster.hpp`.
-Note that the member objects and functions described here will change when compiled with certain compiler flags active, as described in :ref:`compile`.
+.. class:: template\<R_t, X_t> system
-.. cpp:class:: template\<class R_t, class X_t> system
+ The core of the library lies in the :class:`system` class and its member functions. Here, the state of your model is stored and cluster flip Monte Carlo can be carried out in various ways.
-Member Objects
-==============
+ Note that the member objects and functions described here will change when compiled with certain compiler flags active, as described in :ref:`compile`.
-.. cpp:member:: v_t system::nv
+ .. member:: v_t system::nv
- Stores the number of ordinary sites in the model.
+ Stores the number of ordinary sites in the model.
-.. cpp:member:: v_t system::ne
+ .. member:: v_t system::ne
- Stores the number of ordinary bonds in the model.
+ Stores the number of ordinary bonds in the model.
-.. cpp:member:: graph system::G
+ .. member:: graph system::G
- Stores the graph describing the lattice, including the ghost site.
+ Stores the graph describing the lattice, including the ghost site.
-.. cpp:member:: double system::T
+ .. member:: double system::T
- Stores the temperature of the model.
+ Stores the temperature of the model.
-.. cpp:member:: std::vector<X_t> system::s
+ .. member:: std::vector<X_t> system::s
- The :math:`i\text{th}` component stores the spin state of site :math:`i`.
+ The :math:`i\text{th}` component stores the spin state of site :math:`i`.
-.. cpp:member:: R_t system::s0
+ .. member:: R_t system::s0
- Stores the state of the ghost site.
+ Stores the state of the ghost site.
-.. cpp:member:: std::function <double(const X_t&, const X_t&)> system::Z
+ .. member:: std::function <double(const X_t&, const X_t&)> system::Z
- The function that returns the coupling between neighboring sites.
+ The function that returns the coupling between neighboring sites.
-.. cpp:member:: std::function <double(const X_t&)> system::B
+ .. member:: std::function <double(const X_t&)> system::B
- The function that returns the coupling to the field.
+ The function that returns the coupling to the field.
-Member Functions
-================
+ .. function:: system::system(graph G, double T, std::function <double(const X_t&, const X_t&)> Z, std::function <double(const X_t&)> B)
-.. cpp:function:: system::system(graph G, double T, std::function <double(const X_t&, const X_t&)> Z, std::function <double(const X_t&)> B)
+ The constructor for systems.
+
+ :param graph G: A lattice graph *without* the ghost spin added.
+ :param double T: The temperature.
+ :param std\:\:function<double(const X_t&, const X_t&)> Z: The bond coupling.
+ :param std\:\:function<double(const X_t&)> B: The field coupling.
+
+ The states of the spins and ghost site are initialized using the default constructors for :type:`X_t` and :type:`R_t`, respectively. :any:`nv` and :any:`ne` are taken directly from :any:`G`, after which the ghost site is added to :any:`G`.
- The constructor for systems. The arguments given are a graph :cpp:any:`G` *without* the ghost spin added, the temperature :cpp:any:`T`, and the coupling functions :cpp:any:`Z` and :cpp:any:`B`. The states of the spins and ghost site are initialized using the default constructors for :cpp:type:`X_t` and :cpp:type:`R_t`, respectively. :cpp:any:`nv` and :cpp:any:`ne` are taken directly from :cpp:any:`G`, after which the ghost site is added to :cpp:any:`G`.
+ .. function:: system::flip_cluster(v_t i0, const R_t& r, std::mt19937& rng, measurement<R_t, X_t>& A, double x = 1.0)
-.. cpp:function:: system::flip_cluster(v_t i0, const R_t& r, std::mt19937& rng, measurement<R_t, X_t>& A)
+ Performs one Wolff cluster flip to the system.
+
+ :param v_t i0: The index of the seed site.
+ :param const R_t& r: The transformation by which the cluster is flipped.
+ :param std\:\:mt19937& rng: A random number generator.
+ :param measurement<R_t, X_t>& A: Object whose class inherits :class:`measurement` and provides relevant measurement hooks.
+ :param double x = 1.0: Optional argument. When assigned, changes the bond activation probability to :math:`p=1-xe^{-\beta\Delta\mathcal H}`.
- Performs one Wolff cluster flip to the system. The cluster is seeded at vertex :cpp:any:`i0` and the spins added are transformed by :cpp:any:`r`. A random number generator :cpp:any:`rng` provides required random numbers during, and the relevant measurement hooks defined in the inherited class of :cpp:any:`A` are run during the cluster formation.
+ .. function:: system::run_wolff(N_t N, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, measurement<R_t, X_t>& A, std::mt19937& rng, double x = 1.0)
-.. cpp:function:: system::run_wolff(N_t N, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, measurement<R_t, X_t>& A, std::mt19937& rng)
+ Performs :any:`N` Wolff cluster flips to the system.
+
+ :param N_t N: Number of clusters to flip.
+ :param std\:\:function <R_t(std\:\:mt19937&, const system<R_t, X_t>&, v_t>)> r_gen: Generator of transformations for the cluster flips.
+ :param measurement<R_t, X_t>& A: Object whose class inherits :class:`measurement` and provides relevant measurement hooks.
+ :param std\:\:mt19937& rng: A random number generator.
+ :param double x = 1.0: Optional argument. When assigned, changes the bond activation probability to :math:`p=1-xe^{-\beta\Delta\mathcal H}`.
- Performs :cpp:any:`N` Wolff cluster flips to the system. One must provide a function :cpp:func:`r_gen` that takes a random number generator, the system state, and the index of the seed site and returns a transformation for each flip. Also required are an object from a class which inherits :cpp:class:`measurement` to run measurements, and a random number generator :cpp:any:`rng`.