-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alberto Baiardi
committed
Dec 7, 2021
1 parent
3efd0f5
commit 5463f1f
Showing
57 changed files
with
2,731 additions
and
5,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
* Copyright (C) 2015 Laboratory for Physical Chemistry, ETH Zurich | ||
* 2012-2015 by Sebastian Keller <[email protected]> | ||
* | ||
* | ||
* This software is part of the ALPS Applications, published under the ALPS | ||
* Application License; you can use, redistribute it and/or modify it under | ||
* the terms of the license, either version 1 or (at your option) any later | ||
|
@@ -39,10 +38,9 @@ struct TermMaker { | |
typedef typename term_descriptor::value_type pos_op_t; | ||
typedef typename S::subcharge sc_t; | ||
|
||
static bool compare_tag(pos_op_t p1, | ||
pos_op_t p2) | ||
static bool compare_tag(const pos_op_t& p1, const pos_op_t& p2) | ||
{ | ||
return boost::tuples::get<0>(p1) < boost::tuples::get<0>(p2); | ||
return p1.first < p2.first; | ||
} | ||
|
||
static term_descriptor two_term(bool sign, std::vector<tag_type> const & fill_op, value_type scale, pos_t i, pos_t j, | ||
|
@@ -53,8 +51,8 @@ struct TermMaker { | |
term_descriptor term; | ||
term.is_fermionic = sign; | ||
term.coeff = scale; | ||
term.push_back(boost::make_tuple(i, op1[lat.get_prop<sc_t>("type", i)])); | ||
term.push_back(boost::make_tuple(j, op2[lat.get_prop<sc_t>("type", j)])); | ||
term.push_back(std::make_pair(i, op1[lat.get_prop<sc_t>("type", i)])); | ||
term.push_back(std::make_pair(j, op2[lat.get_prop<sc_t>("type", j)])); | ||
return term; | ||
} | ||
|
||
|
@@ -70,14 +68,14 @@ struct TermMaker { | |
std::pair<tag_type, value_type> ptag; | ||
if (i < j) { | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", i)], op1[lat.get_prop<sc_t>("type", i)]); | ||
term.push_back(boost::make_tuple(i, ptag.first)); | ||
term.push_back(boost::make_tuple(j, op2[lat.get_prop<sc_t>("type", j)])); | ||
term.push_back(std::make_pair(i, ptag.first)); | ||
term.push_back(std::make_pair(j, op2[lat.get_prop<sc_t>("type", j)])); | ||
term.coeff *= ptag.second; | ||
} | ||
else { | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", j)], op2[lat.get_prop<sc_t>("type", j)]); | ||
term.push_back(boost::make_tuple(i, op1[lat.get_prop<sc_t>("type", i)])); | ||
term.push_back(boost::make_tuple(j, ptag.first)); | ||
term.push_back(std::make_pair(i, op1[lat.get_prop<sc_t>("type", i)])); | ||
term.push_back(std::make_pair(j, ptag.first)); | ||
term.coeff *= -ptag.second; | ||
} | ||
return term; | ||
|
@@ -99,14 +97,14 @@ struct TermMaker { | |
std::pair<tag_type, value_type> ptag; | ||
if (i < j) { | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", i)], pre_ptag.first); | ||
term.push_back(boost::make_tuple(i, ptag.first)); | ||
term.push_back(boost::make_tuple(j, op3[lat.get_prop<sc_t>("type", j)])); | ||
term.push_back(std::make_pair(i, ptag.first)); | ||
term.push_back(std::make_pair(j, op3[lat.get_prop<sc_t>("type", j)])); | ||
term.coeff *= ptag.second * pre_ptag.second; | ||
} | ||
else { | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", j)], op3[lat.get_prop<sc_t>("type", j)]); | ||
term.push_back(boost::make_tuple(i, pre_ptag.first)); | ||
term.push_back(boost::make_tuple(j, ptag.first)); | ||
term.push_back(std::make_pair(i, pre_ptag.first)); | ||
term.push_back(std::make_pair(j, ptag.first)); | ||
term.coeff *= -ptag.second * pre_ptag.second; | ||
} | ||
return term; | ||
|
@@ -155,9 +153,9 @@ struct TermMaker { | |
} | ||
|
||
std::vector<pos_op_t> sterm; | ||
sterm.push_back( boost::make_tuple(pb, boson_op) ); | ||
sterm.push_back( boost::make_tuple(p1, op1) ); | ||
sterm.push_back( boost::make_tuple(p2, op2) ); | ||
sterm.push_back( std::make_pair(pb, boson_op) ); | ||
sterm.push_back( std::make_pair(p1, op1) ); | ||
sterm.push_back( std::make_pair(p2, op2) ); | ||
std::sort(sterm.begin(), sterm.end(), compare_tag); | ||
|
||
term.push_back(sterm[0]); | ||
|
@@ -186,18 +184,18 @@ struct TermMaker { | |
if(idx[c1] > idx[c2]) inv_count++; | ||
|
||
std::vector<pos_op_t> sterm; | ||
sterm.push_back(boost::make_tuple(i, op_i[lat.get_prop<sc_t>("type", i)])); | ||
sterm.push_back(boost::make_tuple(j, op_j[lat.get_prop<sc_t>("type", j)])); | ||
sterm.push_back(boost::make_tuple(k, op_k[lat.get_prop<sc_t>("type", k)])); | ||
sterm.push_back(boost::make_tuple(l, op_l[lat.get_prop<sc_t>("type", l)])); | ||
sterm.push_back(std::make_pair(i, op_i[lat.get_prop<sc_t>("type", i)])); | ||
sterm.push_back(std::make_pair(j, op_j[lat.get_prop<sc_t>("type", j)])); | ||
sterm.push_back(std::make_pair(k, op_k[lat.get_prop<sc_t>("type", k)])); | ||
sterm.push_back(std::make_pair(l, op_l[lat.get_prop<sc_t>("type", l)])); | ||
std::sort(sterm.begin(), sterm.end(), compare_tag); | ||
|
||
std::pair<tag_type, value_type> ptag; | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", boost::tuples::get<0>(sterm[0]))], boost::tuples::get<1>(sterm[0])); | ||
boost::tuples::get<1>(sterm[0]) = ptag.first; | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", sterm[0].first)], sterm[0].second); | ||
sterm[0].second = ptag.first; | ||
term.coeff *= ptag.second; | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", boost::tuples::get<0>(sterm[2]))], boost::tuples::get<1>(sterm[2])); | ||
boost::tuples::get<1>(sterm[2]) = ptag.first; | ||
ptag = op_table->get_product_tag(fill_op[lat.get_prop<sc_t>("type", sterm[2].first)], sterm[2].second); | ||
sterm[2].second = ptag.first; | ||
term.coeff *= ptag.second; | ||
|
||
if (inv_count % 2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.