ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
factory_none.hpp
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * ALPS MPS DMRG Project
4  *
5  * Copyright (C) 2013 Institute for Theoretical Physics, ETH Zurich
6  * 2011-2012 by Michele Dolfi <dolfim@phys.ethz.ch>
7  * 2012 by Jan Gukelberger <gukelberger@phys.ethz.ch>
8  *
9  * This software is part of the ALPS Applications, published under the ALPS
10  * Application License; you can use, redistribute it and/or modify it under
11  * the terms of the license, either version 1 or (at your option) any later
12  * version.
13  *
14  * You should have received a copy of the ALPS Application License along with
15  * the ALPS Applications; see the file LICENSE.txt. If not, the license is also
16  * available from http://alps.comp-phys.org/.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
21  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
22  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
23  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24  * DEALINGS IN THE SOFTWARE.
25  *
26  *****************************************************************************/
27 
30 
31 template<class Matrix>
33  static boost::shared_ptr<model_impl<Matrix, TrivialGroup> > parse
34  (Lattice const& lattice, BaseParameters & parms)
35  {
36  typedef boost::shared_ptr<model_impl<Matrix, TrivialGroup> > impl_ptr;
37  if (parms["MODEL"] == std::string("boson Hubbard"))
38  return impl_ptr( new BoseHubbardNone<Matrix>(lattice, parms) );
39  else if (parms["MODEL"] == std::string("super boson Hubbard"))
40  return impl_ptr( new SuperBoseHubbardNone<Matrix>(lattice, parms) );
41  else {
42  throw std::runtime_error("Don't know this model with NONE symmetry group!");
43  return impl_ptr();
44  }
45  }
46 };
pimpl resolved Lattice
Definition: lattice.h:84
static boost::shared_ptr< model_impl< Matrix, SymmGroup > > parse(Lattice const &, BaseParameters &)