-
Notifications
You must be signed in to change notification settings - Fork 4
/
detwf.hpp
114 lines (79 loc) · 2.78 KB
/
detwf.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* Copyright (c) 2013, Robert Rueger <[email protected]>
*
* This file is part of hVMC.
*
* hVMC is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* hVMC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with hVMC. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DETERMINANTAL_WAVEFUNCTIONS_H_INCLUDED
#define DETERMINANTAL_WAVEFUNCTIONS_H_INCLUDED
#include <vector>
#include <memory>
#define EIGEN_NO_AUTOMATIC_RESIZING
#include <eigen3/Eigen/Core>
#include "options.hpp"
#include "macros.h"
#include "fptype.hpp"
#include "lattice.hpp"
class VariationalHamiltonian final {
public:
// the number of lattice sites
const unsigned int L;
private:
// the variational Hamiltonian under p.h. transformation
Eigen::MatrixXfp int_H;
// masks for the vpar operators
std::vector<Eigen::MatrixXfp> int_V;
public:
VariationalHamiltonian( unsigned int L_init );
void add_anyterm( const Eigen::MatrixXfp& term );
void add_vparterm( const Eigen::MatrixXfp& mask, fptype vpar );
const Eigen::MatrixXfp& H() const;
const std::vector<Eigen::MatrixXfp>& V() const;
};
class DeterminantalWavefunction final {
private:
// the variational Hamiltonian
const VariationalHamiltonian int_varHam;
public:
// the number of particles (= number of states in the slater determinant)
const unsigned int Np;
private:
// the eigenstates
Eigen::MatrixXfp int_U;
// the associated energies
Eigen::VectorXfp int_epsilon;
// resulting matrices for the vpar operators
std::vector<Eigen::MatrixXfp> int_A;
public:
DeterminantalWavefunction(
const VariationalHamiltonian& varHam_init, unsigned int Np_init );
bool is_openshell() const;
const VariationalHamiltonian& varHam() const;
const Eigen::MatrixXfp& U() const;
Eigen::Block<const Eigen::MatrixXfp> M() const;
const Eigen::VectorXfp& epsilon() const;
const std::vector<Eigen::MatrixXfp>& A() const;
};
DeterminantalWavefunction build_detwf(
const std::shared_ptr<Lattice>& lat, unsigned int Ne,
const std::vector<double>& t,
const std::vector<double>& Delta, optpairsym_t pairsym,
double mu, double mu_m
);
double calc_tbdetwf_chempot(
const std::shared_ptr<Lattice>& lat, unsigned int Ne,
const std::vector<double>& t
);
#endif // DETERMINANTAL_WAVEFUNCTIONS_H_INCLUDED