TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
worker.hpp
1// Copyright (c) 2017-2018 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
2// Copyright (c) 2017-2018 Centre national de la recherche scientifique (CNRS)
3// Copyright (c) 2018-2020 Simons Foundation
4// Copyright (c) 2017 Igor Krivenko
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You may obtain a copy of the License at
17// https://www.gnu.org/licenses/gpl-3.0.txt
18//
19// Authors: Maxime Charlebois, Michel Ferrero, Igor Krivenko, Nils Wentzell
20
21#pragma once
22
23#include "../atom_diag.hpp"
25
26#include <climits>
27#include <vector>
28
29using namespace triqs::hilbert_space;
30
31namespace triqs::atom_diag {
32
33 // Division of Hilbert Space into Hilbert subspaces, using either autopartitioning or quantum numbers.
34 template <bool Complex> struct atom_diag_worker {
35
36 //using atom_diag = atom_diag<Complex>;
37 using scalar_t = typename atom_diag<Complex>::scalar_t;
38 using matrix_t = typename atom_diag<Complex>::matrix_t;
39 using many_body_op_t = typename atom_diag<Complex>::many_body_op_t;
40
41 atom_diag_worker(atom_diag<Complex> *hdiag, int n_min = 0, int n_max = INT_MAX) : hdiag(hdiag), n_min(n_min), n_max(n_max) {}
42
43 //void autopartition();
44 void autopartition(many_body_op_t const &hyb = many_body_op_t());
45 void partition_with_qn(std::vector<many_body_op_t> const &qn_vector);
46
47 private:
48 atom_diag<Complex> *hdiag;
49 int n_min, n_max;
50
51 // Create matrix of an operator acting from one subspace to another
52 matrix_t make_op_matrix(many_body_op_t const &op, int from_sp, int to_sp) const;
53
54 void complete();
55 bool fock_state_filter(fock_state_t s);
56 };
57
58} // namespace triqs::atom_diag
Provides a lightweight exact diagonalization solver for fermionic Hamiltonians.
matrix< scalar_t > matrix_t
Dense matrix type with scalar entries of type scalar_t.
Definition atom_diag.hpp:97
triqs::operators::many_body_operator_generic< scalar_t > many_body_op_t
Many-body operator type compatible with scalar_t.
std::conditional_t< Complex, std::complex< double >, double > scalar_t
Scalar type of the matrix elements: double or std::complex<double>.
Definition atom_diag.hpp:94
uint64_t fock_state_t
Integer type representing a fermionic fock state .
Provides a class to represent Hilbert (Fock) spaces.