ALPS Project: lattice library

Header file: lattice/latticedescriptor.h

defines two lattice classes which can be constructed from XML input. These are

Synopsis

namespace alps {

class LatticeDescriptor : public coordinate_lattice<simple_lattice<>,std::vector<alps::StringValue> >
{
public:
typedef coordinate_lattice<simple_lattice<>,std::vector<alps::StringValue> > base_type;
typedef lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef lattice_traits<base_type>::offset_type offset_type;
typedef lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef lattice_traits<base_type>::vector_type vector_type;
typedef lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;

LatticeDescriptor() {}
LatticeDescriptor(const palmxml::XMLTag&, std::istream&);

void set_parameters(const alps::Parameters&);
template<class T>
void add_default_parameter(const std::string& name, const T& value)

void write_xml(std::ostream&, const std::string& new_name= "") const;
const std::string& name() const;
std::size_t dimension() const;
};

typedef std::map<std::string,LatticeDescriptor> LatticeMap;

class FiniteLatticeDescriptor : hypercubic_lattice<coordinate_lattice<simple_lattice<>,std::vector<alps::StringValue> >, std::vector<alps::StringValue> >
{
public:
typedef hypercubic_lattice<coordinate_lattice<simple_lattice<>,std::vector<alps::StringValue> >, std::vector<alps::StringValue> > base_type;
typedef lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef lattice_traits<base_type>::offset_type offset_type;
typedef lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef lattice_traits<base_type>::vector_type vector_type;
typedef lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
typedef lattice_traits<base_type>::cell_iterator cell_iterator;
typedef lattice_traits<base_type>::size_type size_type;

FiniteLatticeDescriptor() {}
FiniteLatticeDescriptor(const palmxml::XMLTag&, std::istream&,
const LatticeMap& = LatticeMap());

void set_parameters(const palm::Parameters&);
void write_xml(std::ostream&, const std::string& n= "") const;
const std::string& name() const;
std::size_t dimension() const;
};

typedef std::map<std::string,FiniteLatticeDescriptor> FiniteLatticeMap;

std::ostream& operator<<(std::ostream& out, const LatticeDescriptor& l);
std::ostream& operator<<(std::ostream& out, const FiniteLatticeDescriptor& l);
}

The LatticeDesriptor class

describes a lattice and fulfills the CoordinateLattice requirements. It can be constructed from the <LATTICE> element of the lattice XML schema on http://xml.comp-phys.org/.

Type definitions

typedef lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef lattice_traits<base_type>::offset_type offset_type;
typedef lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef lattice_traits<base_type>::vector_type vector_type;
typedef lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
these types are inherited from coordinate_lattice.

Constructors

LatticeDescriptor() {}
an empty lattice without any information.
LatticeDescriptor(const palmxml::XMLTag&, std::istream&);
reads the LatticeDescriptor in XML from a stream assuming the Lattice XML schema on http://xml.comp-phys.org. The start tag <LATTICE ...> has already been read and is passed as a palmxml::XMLTag.

Member functions

in addition to those inherited from the parent lattice:
void set_parameters(const alps::Parameters&);
sets parameters for the lattice, e.g. parammeters specifying the basis vectors.
  template<class T>
void add_default_parameter(const std::string& name, const T& value)

adds a new parameter and default value to the LatticeDescriptor.

void write_xml(std::ostream&, const std::string& new_name= "") const;
writes the lattice 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.
const std::string& name() const;
returns the name of the lattice
std::size_t dimension() const;
returns the dimension of the lattice.

The LatticeMap type

typedef std::map<std::string,LatticeDescriptor> LatticeMap;
can be used to keep a collection of LatticeDescriptor objects, indexed by their name.

The FiniteLatticeDesriptor class

describes a lattice and fulfills the FiniteLattice and CoordinateLattice requirements. It can be constructed from the <FINITELATTICE> element of the lattice XML schema on http://xml.comp-phys.org/.

Type definitions

typedef lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef lattice_traits<base_type>::offset_type offset_type;
typedef lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef lattice_traits<base_type>::vector_type vector_type;
typedef lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
typedef lattice_traits<base_type>::cell_iterator cell_iterator;
typedef lattice_traits<base_type>::size_type size_type;
these types are inherited from hypercubic_lattice.

Constructors

FiniteLatticeDescriptor() {}
an empty lattice without any information.
FiniteLatticeDescriptor(const palmxml::XMLTag&, std::istream&, 
const LatticeMap& = LatticeMap());
reads the FiniteLatticeDesriptor in XML from a stream assuming the Lattice XML schema on http://xml.comp-phys.org. The start tag <FINITELATTICE ...> has already been read and is passed as a palmxml::XMLTag

In the lattice schema the <FINITELATTICE ...> contains a <LATTICE ...> element. This can either describe the lattice fully, or refer to a lattice by name. The optional LatticeMap argument can be used to pass the known lattices.

Member functions

in addition to those inherited from the parent lattice:
void set_parameters(const palm::Parameters&);
The lattice schema allows the extent and boundary conditions to be specified by external parameters. The set_parameters function allows to pass a map of parameters, to fill the values of the parameters.
void write_xml(std::ostream&, const std::string& new_name= "") const;
writes the finite lattice 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.
const std::string& name() const;
returns the name of the lattice
std::size_t dimension() const;
returns the dimension of the lattice.

The FiniteLatticeMap type

typedef std::map<std::string,FiniteLatticeDescriptor> FiniteLatticeMap;
can be used to keep a collection of FiniteLatticeDescriptor objects, indexed by their name.

Output operators

std::ostream& operator<<(std::ostream& out, const LatticeDescriptor& l);
std::ostream& operator<<(std::ostream& out, const FiniteLatticeDescriptor& l);
write the LatticeDescriptor and FiniteLatticeDescriptor in XML, using the write_xml member functions.

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)