ALPS Project: tools

A number of tools and XSLT stylesheets are being developed to simplify working with the XML files created by the ALPS libraries and programs. Please checkout some XML plot file examples.

Documentation

Tools

archive

archivecat

Usage:
archivecat filename [filename [filename ...]]
takes a list of XML files containing results of simulation checkpoints in a <SIMULATION> element of the QMCXML schema. The tool strips off the leading processing instructions and wraps the various simulations inside a <ARCHIVE> element. This archive of simulation results can then be used by XSLT transformers, using for example the stylesheets provided below.

xslttransform

is a wrapper for XSLT processors to provide a uniform interface. The usage is:
xslttransform file [stylesheet]
If the stylesheet argument is not given, the default stylesheet is taken from the XML input file.

The XSLT processor is chosen as follows:

extracttext

is a script which takes an XML plot file following the XML schema for plot data and an XML archive file containing results of simulation checkpoints in a <SIMULATION> element of the QMCXML schema as provided by archivecat. Alternatively a list of XML task files can be processed which the script wraps into an archive using archivecat.
The tool first parses the plot file using plot2xsl.xsl generating a temporary settings file plotsettings.xsl which is subquently used by archive2plot.xsl to extract the specified data into a temporary plot file following the XML schema for plot data. In a last step plot2text.xsl is invoked to transform the temporary plot file into tabular plain text output.

Alternative usage:

extracttext plot-filename archive-filename
extracttext plot-filename task-filename [task-filename [task-filename ...]]

extracthtml

is a script which offers the same functionality as extracttext with the exception of converting the temporary plot file into tabular HTML output.

Alternative usage:

extracthtml plot-filename archive-filename
extracthtml plot-filename task-filename [task-filename [task-filename ...]]

plot2text

Usage:
plot2text filename
takes a XML plot file as argument and transforms it into tabular plain text output.

plot2html

Usage:
plot2html filename
takes a XML plot file as argument and transforms it into tabular HTML output.

XSLT stylesheets

XSLT transformations are the easisest way of extracting specific information from the large XML output files produced by thye ALPS libraries and programs. While we are working on a more flexible set of tools we provide some examples of simple XSLT style sheets that can help the beginning XSLT user:

plot2xsl.xsl

is an XSLT stylesheet to extract information from an XML plot file following the XML
schema for plot data which specifies which information from a Monte Carlo output file should be extracted by the XSLT stylesheet archive2plot.xsl. The information is temporarily stored in yet another XSLT stylesheet (plotsettings.xsl).

archive2plot.xsl

is an XSLT stylesheet to extract information from a Monte Carlo output file and plot the value of a measured quantity as a function of a parameter, another measured quantity or an index as specified in the included XSLT stylesheet plotsettings.xsl generated by plot2xsl.xsl. This information is stored in a file following the XML schema for plot data.

plot2text.xsl

takes the output of e.g. the archive2plot.xsl transformation, stored in a file following the XML schema for plot data and converts it to tabular plain text output.

ALPS.xsl

takes the output of e.g. the archive2plot.xsl transformation, stored in a file following the XML schema for plot data and converts it to tabular HTML output. This is also the default stylesheet attached with the output of archive2plot.xsl to allow easy viewing in an XSLT supporting web browser. These stylesheets are installed in the xml subdirectory of the library installation directory.

We encourage your participation in the development of more flexible and powerful XSLT transformation tools.


XML plot file examples

Example 1: Energy versus temperature

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ALPS.xsl"?>

<plot name="Energy versus temperature for some model">
  <!-- general plot description -->
  <legend show="true"/>
  <xaxis label="Temperature" type="PARAMETER" name="T"/>
  <yaxis label="Energy"      type="SCALAR_AVERAGE"/>  

  <!-- set description -->
  <set label="sprint "/>
</plot>

Example 2: Energy versus temperature for all system sizes

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ALPS.xsl"?>

<plot name="Energy versus temperature for some model">
  <!-- general plot description -->
  <legend show="true"/>
  <xaxis label="Temperature" type="PARAMETER" name="T"/>
  <yaxis label="Energy"      type="SCALAR_AVERAGE"/>
  
  <!-- loop over all system sizes -->
  <for-each name="SystemSize"/>
   
  <!-- define some parameters -->
  <constraint name="U"  condition="=3.0" />
  <constraint name="U'" condition="=4.0" />
  <constraint name="t"  condition="=1.0" />
  <constraint name="t'" condition="=2.0" />

  <!-- restrict energy range -->
  <constraint name="Energy"  type="SCALAR_AVERAGE" condition="&lt;0" />

  <!-- set descriptions -->
  <set label="start "/>
</plot>
Constraints used in this example

The first constraint <for-each name="SystemSize"/> used in this example describes a loop over all possible values of the specified parameter. In the given example multiple sets are generated one for each system size found in the archive.
The second set of constraints, e.g. <constraint name="U" condition="=3.0" />, is used to specify a set of parameters, such as U=3.0 U'=4.0 t=1.0 t'=2.0 in the given example.
The last constraint <constraint name="Energy" type="SCALAR_AVERAGE" condition="<0" /> restricts the energy range to negative values.
The set label will be automatically generated from the prefix label label="start " in the set description and all the given constraints.

Example 3: Green's function versus distance

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ALPS.xsl"?>

<plot name="Green's function versus distance for some model">
  <!-- general plot description -->
  <legend show="true"/>
  <xaxis label="Distance" type="INDEX"/>
  <yaxis label="Green's function" type="VECTOR_AVERAGE"/>

  <!-- index constraints -->
  <constraint label="d" type="INDEX" condition="&gt;=2" />
  <constraint label="d" type="INDEX" condition="&lt;5" />

  <set label="Some parameters of interest"/>
</plot>
Constraints used in this example

With the two index constraints shown in this example only Green's functions for distances d=2,3,4 are shown.

Example 4: Winding number versus energy

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ALPS.xsl"?>

<plot name="Winding number^2 versus energy for some model">
  <!-- general plot description -->
  <legend show="true"/>
  <xaxis label="Energy" type="SCALAR_AVERAGE"/>
  <yaxis label="Winding number^2" type="VECTOR_AVERAGE" index="0"/>

  <!-- set descriptions -->
  <set label="Not neccessarily useful"/>
</plot>

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)