3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 19:23:45 +01:00
Commit Graph

212 Commits

Author SHA1 Message Date
Olivier Parcollet
a730f093d6 arrays: fix fold and update documentation
- fold was not correct in e.g. passing an int as init instead of a
  double (was leading to narrowing in return).
- better return type deduction.
- there was an error in the doc (order of argument in the lambda !)
- add a more complex example (Frobenius norm of matrices).
2014-04-09 21:24:03 +02:00
Olivier Parcollet
db59c8e5fc correction: previous commit, forgot a namespace
- in some case, need to add triqs::clef in the macros.
(was not compiling doc).
2014-04-09 12:12:41 +02:00
Olivier Parcollet
2f2104e86e clef : correction of TRIQS_CLEF_IMPLEMENT_LAZY_METHOD for clang 3.3
- there was a compilation pb with clang 3.3
- replace the decltype (with this !) by an explicit type
2014-04-09 11:49:42 +02:00
Olivier Parcollet
4ae4dfd42b arrays: add lazy call to matrix_tensor_proxy
- correction to previous patch
2014-04-07 15:12:34 +02:00
Olivier Parcollet
e1e9ee20fd gf: correct auto_assign
- g(om_)(i_,j_) was not working.
- add the triqs_clef_auto_assign function for matrix_proxy.
- simplified a bit the triqs_clef_auto_assign for gf.
2014-04-07 13:21:36 +02:00
Olivier Parcollet
2fdba13bc5 clef: add version c14
- a slightly different version for c++14,
to avoid some decltype and have clearer error messages.
only in c++1y mode.
2014-04-06 22:26:22 +02:00
Olivier Parcollet
3fd3f38446 clef: fix lazy method call for gcc
- was not compiling on gcc (forward declaration issue).
- now clearer
- add a trivial print change in the mc class (to avoid trivial commit).
2014-04-06 13:01:17 +02:00
Olivier Parcollet
efb00ea5d3 clef: first version of generic sum function
- to improve with in the case where function return an expression
  template, not a regular type, with a make_regular function
2014-04-04 17:47:21 +02:00
Olivier Parcollet
edca014785 rng : preview 2014-04-02 20:36:54 +02:00
Michel Ferrero
82e3b3f02b Fix a bug in bosonic Fourier transform
Appears for full_bins and bosonic GFs.
2014-04-01 17:09:04 +02:00
Olivier Parcollet
5267798b48 arrays: a forgotten std::forward in lazy evaluations...
A(i_,0) was not compiling due to a missing forward ...
2014-03-28 17:20:16 +01:00
Olivier Parcollet
9c979ceb0b Fix #66: when mc_sign_type is complex
- for complex type sign, we do not do the previous check
(to be improved), since isinf, signbit are not defined for
complex numbers.
2014-03-28 15:38:40 +01:00
Olivier Parcollet
c996c3ff7d mc_tools : improve treatment of infinite mc ratios
- when the ratio returned by an attempt of a move is infinite,
previous code was just throwing TRIQS_RUNTIME_ERROR.

- Now when the ratio is infinite, it is replaced by a large number
  (>1 is enough for metropolis), and the sign is properly updated
  using std::signbit.

- NB :

- a double/float in C++ can be :  normal/ zero/ nan/ infinite / subnormal.
  Here, the code will recover only from infinite case.

- std::signbit works for infinite (according to standard).
2014-03-27 20:33:35 +01:00
Olivier Parcollet
8045598534 Attempt to fix gelss call in fit_tail.
uncommenting the resize fix the issue on linux.
valgrind reports no error any more.
What was the problem ?
2014-03-19 14:01:26 +01:00
tayral
558df98786 Split cpp from hpp (fit_tail) 2014-03-19 14:00:53 +01:00
Olivier Parcollet
377a0026ad add c14 less, greater 2014-03-16 00:11:56 +01:00
Michel Ferrero
5805c7c3aa Fix in off-diagonal elements of density()
This should fix the bug noticed by Leonid in off-diagonal
elements of the density matrix.

  modified:   triqs/gfs/local/functions.cpp
2014-03-08 13:46:31 +01:00
Olivier Parcollet
2f2044e74b gf : imfreq : clean evaluator on int
- evaluator on int was not using the same algorithm
as matsubara_freq, which can be surprising...
2014-03-04 22:11:36 +01:00
Olivier Parcollet
05c717e70f gf: imfreq : fix evaluator for n<0
- in positive only case, the evaluator for n<0
was wrong : must shift the integer by -1 for the fermions.
2014-03-04 20:22:33 +01:00
Olivier Parcollet
5128126055 arrays: change operator() && for const_view
Changed operator()(int, int...) && for array, and views.

- For const_view and regular type, returns value_type (i.e. a copy).
  NB : does make a copy, not a move. Ok for scalar type. TODO: think for complicated types.
  This allows codes like :
  f(x)(0,0) where f : x-> matrix or const_view
  to be correct in clef expression evaluation.

- For _view : return a value_type &, as before to allow :
    A(....)(0,0) = rhs;
  It is not possible to detect dangling refs in that case at compile time.
  Added a security in TRIQS_ARRAYS_DEBUG mode to detect a dangling ref at run time,
  i.e. the case where the view is "unique" (ref count ==1).
  This would be a quite bad design anyway ...

- also :

 - clean operator[] for vector (old workaround for old gcc...)
 - add IsView flag in ISP impl class, for the impl. of operator() &&
2014-03-02 17:11:48 +01:00
Olivier Parcollet
1e220d24c7 kronecker function and overload for matsubara_freq
Used in solver codes.
2014-03-02 17:11:48 +01:00
Olivier Parcollet
9911b18363 mc_tools : add access # proposed/accepted. Add debug_stream
- debug_stream : conditional ostream with a lambda condition for debug.
2014-02-28 17:20:55 +01:00
Olivier Parcollet
a1a29d6c85 gf: correct evaluator for gf imfreq (remove mesh_pt)
mesh_pt should NOT be done directly by (),
it should be casted to matsubara_freq.
Removed an old line of code which we forgot to clean
when introducing matsubara_freq
2014-02-28 15:57:34 +01:00
Olivier Parcollet
a25f742b33 Correction: left some C++14 used in debug...
- decltype(auto) was left behind in 2 places...
2014-02-26 17:49:44 +01:00
Olivier Parcollet
e1c113b745 Fix g(k,om) for tests
- evaluator
- G(k,tau) is real
- partial_eval for matrix_valued functions
- details : simplifying traits (using decay_t)
2014-02-26 16:24:51 +01:00
Olivier Parcollet
b8d7373177 arrays : fix auto_assign for chains assignment.
A(i_)(om_) << ...
for A an array of gf was not working.
Modified the auto_assign of arrays to handle the case when the object
in the array is itself autoassigned.
Using the model of std::vector adapter for clef, which works.
Also fixed the gf for a little details (gf_impl is usually in the expression tree, not gf).
2014-02-21 21:00:38 +01:00
Hartmut Hafermann
3d98857c13 adding missing map serialization header 2014-02-20 16:43:46 +01:00
Olivier Parcollet
73d81cc55a gf: correct bug in matsubara_freq mesh point
- bool at_end() for a mesh point means AFTER the last point ,
as end in STL. It was not correct ( +1 missing).
- also the at_end was not computed in the mesh product.
- it slightly changes the test_fit_tail --> just changed the output.
--> did this bug affect other functions/codes ?
2014-02-19 21:14:59 +01:00
tayral
8c1f7945e4 Various small fixes in imfreq Gfs.
- documentation of matsubara_freq_mesh
- fixing doc of fit_tail
- fixing right conventions for matsubara_freq_mesh
2014-02-19 11:59:47 +00:00
Olivier Parcollet
2b315fcdea gf : corrections
- correct previous commit (for scalar gf, the new check was not compiling)
- correct windowing of linear mesh (left point corrected as right point for rounding error
2014-02-18 19:25:29 +01:00
Olivier Parcollet
b76a61680c gf make_gf_from_g_and_tail : add security
- if shape (g) != shape(t) -> exception
2014-02-18 17:15:59 +01:00
tayral
708c47305c Extending fit_tail for scalar_valued (+ test)
-> extension by using reinterpret_scalar_valued_as_matrix_valued
2014-02-18 16:16:14 +01:00
tayral
da7e7ec971 Fixed fit_tail for pos. and neg. matsub + bosonic
-> code was previously assuming mesh with only positive, fermionic matsubara freqs
-> changed wn_min to n_min (was misleading, since it was an index, not a frequency) / same for <-> max
-> changed doc accordingly
2014-02-18 16:16:14 +01:00
tayral
82a6d21939 Fixed computation of density for full matsub mesh
-> Previously, calculation was implicitly assuming a mesh with only positive matsubara frequencies.
-> Added corresponding test
-> Also added test of density calculation with or without correct tail.
2014-02-18 16:16:14 +01:00
Olivier Parcollet
6e87bee850 lattice: clean old classes, add bz_mesh, gf on bz 2014-02-18 15:53:38 +01:00
Olivier Parcollet
e82d95d1a8 gf: add C++14 impl of meshes products
-  add c14 include
- the C++14 is lot more readable (due to generic lambda).
- for mesh/product.hpp -> now 2 versions (C++14 and C++11 for temporary
  backward compatibility).
2014-02-18 15:37:57 +01:00
Olivier Parcollet
96ef742344 c14, tuples : various fixes.
- Various details (for_each_enumerate impl)
- also put all tuple stuff in tuple_tools.hpp
- add std14 namespace for usage of c++14 helper types
2014-02-18 15:37:57 +01:00
Olivier Parcollet
a503ddae26 clef: correction of macro
- a strange issue, why was it not working ?
- anyway, the separation is useless (was a try).
2014-02-18 15:37:57 +01:00
Olivier Parcollet
76e39c826f arrays: add make_unit_matrix and norm2, norm2_sqr 2014-02-18 15:36:24 +01:00
Olivier Parcollet
1c9d6dacfa arrays: h5 read/write for arrays of complex types
- array of complex type (not fundamental) can now be saved/loaded to
  h5
- with a test with array<gf<...>>
2014-02-13 21:46:23 +01:00
Olivier Parcollet
7aedaef945 arrays : fix matrix = scalar for complex types
Pb :
M() = rhs; // rhs of type RHS
Currenlty does :
M(i,j) = (i==j ? rhs : RHS{})
Changed to
M(i,j) = (i==j ? rhs : RHS{0*rhs})

If RHS is a double, int ... Same result.
If RHS is a matrix, gf, currently the offdiag elements
are default constructed (i.e. of 0 size !).
Which can break operations later (matrix<matrix<double>>)
After change : all elements have the same size !
2014-02-12 21:50:58 +01:00
tayral
87dc9aeaa5 Add statistic tools
- binning, jackknife, autocorrelation, observable.
- DRAFT only : in development, debug. Doc to be written.
2014-02-12 09:41:07 +01:00
Olivier Parcollet
e182762bf2 clef : add apply_on_each_leaf
- apply_on_each_leaf: apply a function object to every leaf of the tree
- add some macros...
2014-02-10 21:04:27 +01:00
Olivier Parcollet
786bd7095e clef: further little corrections
- declaration order in template.
- some eval details
- do not undef the macro TRIQS_CLEF_STD_MATH_FNT_TO_MAKE_LAZY
for reuse in other part of the lib
2014-02-09 21:04:26 +01:00
Olivier Parcollet
7e1f2eb34b clef: cleaning
- use alias
- rename a few things, simplify
- some clang format
- add eval to ref wrapper
- correct evaluator general (return const &, no copy)
- correct declaration order of struct and operator OP
2014-02-09 16:11:39 +01:00
Olivier Parcollet
3f62825559 c14. add some helper traits to simplify
add_const_t and co....
fix include
2014-02-09 16:11:39 +01:00
Olivier Parcollet
dd6b996e5d arrays: to_python now raise exception when array is empty
- otherwise it was simply crashing .
- now raise a C++ exception
- adapted cython wrapper to catch it as a python exception
2014-02-04 15:04:40 +01:00
Hartmut Hafermann
65ed3a8dc2 gf: new tail fitting 2014-02-03 22:22:21 +01:00
Hartmut Hafermann
31ae772892 arrays: add gelss 2014-02-03 22:16:58 +01:00
Olivier Parcollet
85141350e7 remove warnings in compilation
- triqs & tests now compiles with -Wall on clang (3.2)
Checked on OS X.
Todo : recheck on other compilers.
2014-01-30 22:17:28 +01:00