TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
arrays.hpp
Go to the documentation of this file.
1// Copyright (c) 2013-2017 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
2// Copyright (c) 2013-2017 Centre national de la recherche scientifique (CNRS)
3// Copyright (c) 2019-2023 Simons Foundation
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You may obtain a copy of the License at
16// https://www.gnu.org/licenses/gpl-3.0.txt
17//
18// Authors: Olivier Parcollet, Nils Wentzell
19
20#pragma once
21
26
27// for python code generator, we need to know what to include...
28#define TRIQS_INCLUDED_ARRAYS
29
30#include <cassert>
31
32#include <complex>
33#include <h5/h5.hpp>
34#include <nda/nda.hpp>
35#include <nda/h5.hpp>
36#include <nda/mpi.hpp>
37#include <nda/blas.hpp>
38#include <nda/lapack.hpp>
39#include <nda/linalg/det.hpp>
40#include <nda/linalg/inv.hpp>
41#include <nda/clef/adapters/math.hpp>
42#include <nda/clef/sum.hpp>
43
46
47#define TRIQS_CLEF_MAKE_FNT_LAZY CLEF_MAKE_FNT_LAZY
48#define TRIQS_CLEF_IMPLEMENT_LAZY_CALL CLEF_IMPLEMENT_LAZY_CALL
49
50namespace stdutil = nda::stdutil;
51
52namespace triqs {
53
54 namespace clef = nda::clef;
55 using dcomplex = std::complex<double>;
56 using namespace std::literals::complex_literals;
57
58 using nda::range;
59
60} // namespace triqs
61
62namespace triqs::arrays {
63
64 using namespace nda;
65
66 using nda::blas::dot;
67
68 template <typename... T> std::array<long, sizeof...(T)> make_shape(T... x) { return {long(x)...}; }
69
70} // namespace triqs::arrays
71
72namespace nda {
73
74 // Rotate the index n to 0, preserving the relative order of the other indices
75 template <int N, typename A> auto rotate_index_view(A &&a) {
76 return permuted_indices_view<encode(nda::permutations::cycle<get_rank<A>>(-1, N + 1))>(std::forward<A>(a));
77 }
78
79} // namespace nda
Macros that define a legacy (pre C++20) concept-tag trait pair.
TRIQS exception hierarchy and related macros.