ALPS Project: lattice library

Header file: lattice/unitcell.h

defines an empty unite cell class EmptyUnitCell and a unit cell decorated with a graph GraphUnitCell.

Synopsis

namespace alps {

class EmptyUnitCell {
public:
EmptyUnitCell(std::size_t dim=0);
std::size_t dimension() const;
};

dimensional_traits<EmptyUnitCell>::dimension_type dimension(const EmptyUnitCell& c);

class GraphUnitCell
{
public:
boost::adjacency_list<boost::vecS,boost::vecS,boost::directedS,/*...*/> graph_type;

GraphUnitCell();
GraphUnitCell(const XMLTag&, std::istream&);

const GraphUnitCell& operator=(const EmptyUnitCell& e);

void write_xml(oxstream&) const;
graph_type& graph();
const graph_type& graph() const;
std::size_t dimension() const;
const std::string& name() const;
};

dimensional_traits< GraphUnitCell>::dimension_type dimension(const GraphUnitCell& c);

oxstream& operator<<(oxstream& out, const GraphUnitCell& u)
std::ostream& operator<<(std::ostream& out, const GraphUnitCell& u)

typedef std::map<std::string,GraphUnitCell> UnitCellMap;

}

The EmptyUnitCell class

describes an empty unit cell and fulfills the Dimensional and UnitCell requirements. The dimension is the only property of this unit cell.

Constructor

EmptyUnitCell(std::size_t dim=0);
The constrictors takes an optional dimension argument.

Member functions

std::size_t dimension() const;
returns the dimension of the unit cell.

The GraphUnitCell class

describes a unit cell with a graph and fulfills the Dimensional and GraphUnitCell requirements. It is created from XML input.

Type definitions

boost::adjacency_list<boost::vecS,boost::vecS,boost::directedS,/*...*/> graph_type;
The graph is a directed adjacency list graph. The directed property is necessary for a graph with more than one edge between two vertices. The internal properties are:
Vertex property Type Note
vertex_type_t type_type
The type (color) of the vertex
coordinate_t coordinate_type The coordinate of the vertex
vertex_index_t The vertex index, predefined for boost::adjacency_list
Edge property Type Note
edge_type_t type_type
The type (color) of the edge
source_offset_t std::vector<int> cell offset of the source vertex
target_offset_t std::vector<int> cell offset of the target vertex
bond_vector_t
coordinate_type vector connecting two sites of the bond, relative to the basis vectors of the lattice

Constructors

GraphUnitCell();
the default constructor.
GraphUnitCell(const XMLTag&, std::istream&);
reads the unit cell in XML from a stream assuming the Lattice XML schema on http://xml.comp-phys.org. The start tag <UNITCELL ...> has already been read and is passed as a XMLTag argument.

Member functions

void write_xml(oxstream&, const std::string& name= "") const;
writes the unit cell in XML, using the same Lattice XML schema on http://xml.comp-phys.org. It can optionally be renamed by passing a new name as the second argument.
graph_type& graph();
const graph_type& graph() const;
return the graph associated with the unit cell.
std::size_t dimension() const;
the dimension of the unit cell
const std::string& name() const;
the name of the unit cell, as read from the XML input.

Operators

oxstream& operator<<(oxstream& out, const lattice:: GraphUnitCell& u)
std::ostream& operator<<(std::ostream& out, const lattice:: GraphUnitCell& u)
The output to an oxstream or std::ostream uses the write_xml member function.

The UnitCellMap type

typedef std::map<std::string,GraphUnitCell> UnitCellMap;
is a map from the name of unit cells, to a GraphUnitCell, used when parsing XML input for lattices.

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)