16#ifndef POMEROL_INCLUDE_POMEROL_MISC_HPP
17#define POMEROL_INCLUDE_POMEROL_MISC_HPP
21#include <libcommute/algebra_ids.hpp>
22#include <libcommute/loperator/loperator.hpp>
23#include <libcommute/loperator/state_vector.hpp>
26#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
29#include <Eigen/Sparse>
31#ifdef POMEROL_USE_OPENMP
35#if __cplusplus >= 201402L
36#define POMEROL_DEPRECATED [[deprecated]]
38#define POMEROL_DEPRECATED
54#define MSG_PREFIX __FILE__ << ":" << __LINE__ << ": "
58#define DEBUG(MSG) std::cout << MSG_PREFIX << MSG << '\n'
63#define INFO(MSG) std::cout << MSG << '\n'
65#define INFO_NONEWLINE(MSG) std::cout << MSG
67#define ERROR(MSG) std::cerr << MSG_PREFIX << MSG << '\n'
82 Eigen::Matrix<ComplexType, Eigen::Dynamic, Eigen::Dynamic, Eigen::AutoAlign | Eigen::RowMajor>;
86template <
bool Complex>
using MelemType =
typename std::conditional<Complex, ComplexType, RealType>::type;
90template <
typename ScalarType>
91using LOperatorType = libcommute::loperator<ScalarType, libcommute::fermion, libcommute::boson>;
95template <
bool Complex>
96using LOperatorTypeRC = libcommute::loperator<MelemType<Complex>, libcommute::fermion, libcommute::boson>;
100template <
bool Complex>
102 Eigen::Matrix<MelemType<Complex>, Eigen::Dynamic, Eigen::Dynamic, Eigen::AutoAlign | Eigen::RowMajor>;
107using RealVectorType = Eigen::Matrix<RealType, Eigen::Dynamic, 1, Eigen::AutoAlign>;
111template <
bool Complex>
using VectorType = Eigen::Matrix<MelemType<Complex>, Eigen::Dynamic, 1, Eigen::AutoAlign>;
115template <
bool Complex>
using ColMajorMatrixType = Eigen::SparseMatrix<MelemType<Complex>, Eigen::ColMajor>;
118template <
bool Complex>
using RowMajorMatrixType = Eigen::SparseMatrix<MelemType<Complex>, Eigen::RowMajor>;
126 std::array<std::size_t, 3>
const perm;
144 std::array<std::size_t, 4>
const perm;
Pomerol version information.
typename std::conditional< Complex, ComplexType, RealType >::type MelemType
std::ostream & operator<<(std::ostream &os, Channel channel)
Eigen::Matrix< ComplexType, Eigen::Dynamic, 1, Eigen::AutoAlign > ComplexVectorType
Dense complex vector.
libcommute::loperator< ScalarType, libcommute::fermion, libcommute::boson > LOperatorType
static ComplexType const I
Imaginary unit .
Eigen::Matrix< MelemType< Complex >, Eigen::Dynamic, 1, Eigen::AutoAlign > VectorType
std::array< Permutation3, 6 > const permutations3
An array of all 3! = 6 permutations of 3 elements.
Eigen::Matrix< ComplexType, Eigen::Dynamic, Eigen::Dynamic, Eigen::AutoAlign|Eigen::RowMajor > ComplexMatrixType
Dense complex matrix.
std::complex< double > ComplexType
Complex floating point type.
libcommute::sv_index_type QuantumState
Index of a many-body state.
std::array< Permutation4, 24 > const permutations4
An array of all 4! = 24 permutations of 4 elements.
libcommute::loperator< MelemType< Complex >, libcommute::fermion, libcommute::boson > LOperatorTypeRC
unsigned int ParticleIndex
Index of a single particle degree of freedom.
Channel
Channel, in which a susceptibility function is defined.
Eigen::SparseMatrix< MelemType< Complex >, Eigen::ColMajor > ColMajorMatrixType
Eigen::Matrix< MelemType< Complex >, Eigen::Dynamic, Eigen::Dynamic, Eigen::AutoAlign|Eigen::RowMajor > MatrixType
double RealType
Real floating point type.
Eigen::SparseMatrix< MelemType< Complex >, Eigen::RowMajor > RowMajorMatrixType
Eigen::Matrix< RealType, Eigen::Dynamic, 1, Eigen::AutoAlign > RealVectorType
Dense real vector.
std::size_t hash_binned_real(double x, double bin_size)
@ PP
Particle-particle channel.
@ PH
Particle-hole channel.
@ xPH
Crossed particle-hole channel.
The main namespace of the library.
Permutation of 3 elements.
std::array< std::size_t, 3 > const perm
A permuted list of integers (0, 1, 2)
bool operator!=(Permutation3 const &rhs) const
bool operator==(Permutation3 const &rhs) const
int const sign
Signature of the permutation.
friend std::ostream & operator<<(std::ostream &os, Permutation3 const &p)
Permutation of 4 elements.
friend std::ostream & operator<<(std::ostream &os, Permutation4 const &p)
int const sign
Signature of the permutation.
std::array< std::size_t, 4 > const perm
A permuted list of integers (0, 1, 2, 3)
bool operator==(Permutation4 const &rhs) const
bool operator!=(Permutation4 const &rhs) const