ALPS Project: lattice library
Graph Concepts
Now that we have lattices we can adorn them by graphs, and thus create
a regular graph from a graph on a unit cell of a lattice.
See the corresponding discussion in the documentation of the
lattice XML schema on
http://xml.comp-phys.org/.
Ee will present the following concepts related to graphs on lattices:
LatticeGraph
is a refinement of FiniteLattice.
It is a lattice that contains a graph.
Infinite lattices are not allowed as long as the graph concept
is restricted to finite graphs.
Notation
L | a type that is a a model of LatticeGraph |
l | an object of type L |
Associated Type
lattice::graph_traits<L>::graph_type
A type that is a model of Graph. |
Expressions
lattice::graph(l) | return type lattice::graph_traits<L>::graph_type&,
the graph associated with the LatticeGraph. A similar
expression returning a const reference exists for const l |
A default implementation of the traits class and the lattice::graph function,
relying on appropriate member functions exists in the file graph_traits.h:
namespace alps {
template <class T>
struct graph_traits
{
typedef typename T::graph_type graph_type;
};
template <class T>
const typename graph_traits<T>::graph_type& graph(const T& x)
{
return x.graph();
}
}
An example implementation of a lattice graph can be found in latticegraph.h.
GraphUnitCell and UnitCellGraph
In order to build a LatticeGraoh from a unit cell,
we need a unit cell adorned with a special graph. This GraphUnitCell
is a refinement of UnitCell, and the UnitCellGraph
associated with the unit cell, a refinement of an PropertyGraph
allowing parallel edges and providing two special edge properties.
As edges can connect two different cells
each edge contains two edge properties denoting the cell offstes
for the source and target vertices. The offset of a cell has to be shifted by
these shifts to obtain the cell of the source or target vertex. Usually one
or both of them are zero offsets.
See the corresponding
discussion in the documentation of the lattice XML schema on
http://xml.comp-phys.org/ for more details and examples.
Notation
U | a type that is a a model of GraphUnitCell |
u | an object of type U |
Associated Types
lattice::source_offset_t | the edge property type for the source vertex offset |
lattice::target_offset_t | the edge property type for the target vertex offset |
lattice::graph_traits<U>::graph_type | a type that is a model of UnitCellGraph |
Expressions
lattice::graph(u) | return type lattice::graph_traits<U>::graph_type&,
the graph associated with the UnitCellGraph. A similar
expression returning a const reference exists for const u |
Example Implementation
A default implementation of the traits class and the lattice::graph function,
relying on appropriate member functions exists in the file
graph_traits.h.
An example implementation of a unit cell graph can be found in unitcell.h.
ReflectablePropertyGraph
is a refinement of a Boost PropertyGraph. Additionally it allows
reflection on the existence of properties. At the moment no flexible generic
interface has been finalized. We encourage discussion on this point.
Thus for now the only model is boost::adjacency_list. For properties
that are used in the lattice library see graphproperties.h
copyright (c) 1994-2010 by Matthias Troyer
Distributed under the Boost Software License, Version 1.0.
(See http://www.boost.org/LICENSE_1_0.txt)