ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
entanglement.h
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-2011 by Bela Bauer <bauerb@phys.ethz.ch>
7  * 2011-2013 Michele Dolfi <dolfim@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 
28 #ifndef MEASUREMENTS_ENTANGLEMENT_H
29 #define MEASUREMENTS_ENTANGLEMENT_H
30 
33 
34 namespace measurements {
35 
36  template <class Matrix, class SymmGroup>
37  class entropies : public measurement<Matrix, SymmGroup> {
39  public:
41  : base("Entropy")
42  {
43  this->cast_to_real = true;
44  }
45 
46  void evaluate(MPS<Matrix, SymmGroup> const& mps, boost::optional<reduced_mps<Matrix, SymmGroup> const&> rmps = boost::none)
47  {
49  }
50 
51  protected:
53  {
54  return new entropies(*this);
55  }
56  };
57 
58  template <class Matrix, class SymmGroup>
59  class renyi_entropies : public measurement<Matrix, SymmGroup> {
61  public:
63  : base("Renyi2")
64  {
65  this->cast_to_real = true;
66  }
67 
68  void evaluate(MPS<Matrix, SymmGroup> const& mps, boost::optional<reduced_mps<Matrix, SymmGroup> const&> rmps = boost::none)
69  {
71  }
72 
73  protected:
75  {
76  return new renyi_entropies(*this);
77  }
78  };
79 
80 }
81 
82 #endif
void evaluate(MPS< Matrix, SymmGroup > const &mps, boost::optional< reduced_mps< Matrix, SymmGroup > const & > rmps=boost::none)
Definition: entanglement.h:46
std::vector< double > calculate_bond_entropies(MPS< Matrix, SymmGroup > &mps)
Definition: mps_mpo_ops.h:252
measurement< Matrix, SymmGroup > * do_clone() const
Definition: entanglement.h:52
std::vector< typename MPS< Matrix, SymmGroup >::scalar_type > vector_results
Definition: measurement.h:80
definition of Measurement base class
measurement< Matrix, SymmGroup > * do_clone() const
Definition: entanglement.h:74
Definition: mps.h:40
functions to operate on MPS and MPO (compute expectation values, etc.)
void evaluate(MPS< Matrix, SymmGroup > const &mps, boost::optional< reduced_mps< Matrix, SymmGroup > const & > rmps=boost::none)
Definition: entanglement.h:68
std::vector< double > calculate_bond_renyi_entropies(MPS< Matrix, SymmGroup > &mps, double n, std::vector< int > *measure_es_where=NULL, entanglement_spectrum_type *spectra=NULL)
Definition: mps_mpo_ops.h:186
bool cast_to_real
Definition: measurement.h:77