ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Typedefs | Functions
main.cpp File Reference
#include <alps/utility/copyright.hpp>
#include <iostream>
#include "dmrg/version.h"
#include <complex>
#include "dmrg/block_matrix/detail/alps.hpp"
#include "dmrg/block_matrix/indexing.h"
#include "dmrg/mp_tensors/mps.h"
#include "dmrg/mp_tensors/mpo.h"
#include "dmrg/mp_tensors/contractions.h"
#include "dmrg/mp_tensors/mps_mpo_ops.h"
#include "dmrg/mp_tensors/mpo_ops.h"
#include <boost/program_options.hpp>

Go to the source code of this file.

Typedefs

typedef alps::numeric::matrix
< double > 
matrix
 
typedef alps::numeric::matrix
< std::complex< double > > 
cmatrix
 
typedef NU1 grp
 

Functions

template<class Matrix , class SymmGroup >
void run (std::string const &chkp1, std::string const &chkp2)
 
int main (int argc, char **argv)
 

Typedef Documentation

typedef alps::numeric::matrix<std::complex<double> > cmatrix

Definition at line 35 of file main.cpp.

typedef NU1 grp

build with NU1 symmetry

Definition at line 48 of file main.cpp.

typedef alps::numeric::matrix<double> matrix

Definition at line 34 of file main.cpp.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 61 of file main.cpp.

62 {
63  try {
64  std::cout << "ALPS/MPS version " DMRG_VERSION_STRING " (2013-2014)\n"
65  << " Density Matrix Renormalization Group algorithm\n"
66  << " available from http://alps.comp-phys.org/\n"
67  << " copyright (c) 2013 Institute for Theoretical Physics, ETH Zurich\n"
68  << " copyright (c) 2010-2011 by Bela Bauer\n"
69  << " copyright (c) 2011-2013 by Michele Dolfi\n"
70  << " for details see the publication: \n"
71  << " M. Dolfi et al, in preparation\n"
72  << std::endl;
73  alps::print_copyright(std::cout);
74 
75  /// parse options
76  std::string chkp1, chkp2;
77 
78  namespace po = boost::program_options;
79  po::options_description desc("Allowed options");
80  desc.add_options()
81  ("help,h", "produce help message")
82  ("version", "print program version")
83  ("complex", "use complex numbers")
84  ("mps1", po::value<std::string>(&chkp1)->required(), "path to chkp of mps1")
85  ("mps2", po::value<std::string>(&chkp2)->required(), "path to chkp of mps2");
86  po::positional_options_description p;
87  p.add("mps1", 1);
88  p.add("mps2", 1);
89 
90  po::variables_map vm;
91  po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
92 
93  if (vm.count("help")) {
94  std::cout << desc << std::endl;
95  return 0;
96  }
97  if (vm.count("version")) {
98  std::cout << alps::version_string() << std::endl;
99  std::cout << DMRG_VERSION_STRING << std::endl;
100  return 0;
101  }
102 
103  po::notify(vm);
104 
105  /// compute
106  if (vm.count("complex")) run<cmatrix, grp>(chkp1, chkp2);
107  else run<matrix, grp>(chkp1, chkp2);
108 
109  } catch (std::exception & e) {
110  std::cerr << "Exception thrown:" << std::endl;
111  std::cerr << e.what() << std::endl;
112  exit(1);
113  }
114 }
void run(std::string const &chkp1, std::string const &chkp2)
Definition: main.cpp:52
#define DMRG_VERSION_STRING
Definition: version.h:35
template<class Matrix , class SymmGroup >
void run ( std::string const &  chkp1,
std::string const &  chkp2 
)

Definition at line 52 of file main.cpp.

53 {
54  MPS<Matrix, grp> mps1, mps2;
55  load(chkp1, mps1);
56  load(chkp2, mps2);
57 
58  std::cout << "<mps1 | mps2> = " << overlap(mps1, mps2) << std::endl;
59 }
void load(alps::hdf5::archive &ar, std::string const &path, TrivialGroup::charge &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
Definition: none.h:81
MPS< Matrix, SymmGroup >::scalar_type overlap(MPS< Matrix, SymmGroup > const &mps1, MPS< Matrix, SymmGroup > const &mps2)
Definition: mps_mpo_ops.h:136
Definition: mps.h:40