ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
run_sim.hpp File Reference
#include <boost/filesystem.hpp>

Go to the source code of this file.

Functions

void run_sim (const boost::filesystem::path &infile, const boost::filesystem::path &outfile, bool write_xml=false, double time_limit=-1.)
 

Function Documentation

void run_sim ( const boost::filesystem::path &  infile,
const boost::filesystem::path &  outfile,
bool  write_xml = false,
double  time_limit = -1. 
)

Definition at line 36 of file run_measure.cpp.

38 {
39  maquis::cout.precision(10);
40 
41  /// Load parameters
42  DmrgParameters parms;
43  {
44  boost::filesystem::ifstream param_file(infile);
45  if (!param_file)
46  throw std::runtime_error(std::string("Could not open parameter file ") + infile.string() +".");
47  alps::Parameters p; p.extract_from_xml(param_file);
48  parms = DmrgParameters(p);
49  }
50 
51  /// Match parameters of ALPS DMRG
52  parms.set("chkpfile", (outfile.parent_path() / outfile.stem()).string() + ".chkp");
53  parms.set("resultfile", (outfile.parent_path() / outfile.stem()).string() + ".h5");
54  parms.set("run_seconds", time_limit);
55 
56  /// Start simulation
57  simulation_traits::shared_ptr sim = dmrg::symmetry_factory<simulation_traits>(parms);
58  sim->run(parms, write_xml, measure_only);
59 }
virtual void run()=0
Definition: sim.h:69
void set(std::string const &key, T const &value)
boost::shared_ptr< simulation_base > shared_ptr
Definition: simulation.hpp:46