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

198 Commits

Author SHA1 Message Date
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
Olivier Parcollet
9f0915acb6 gfs, matsubara: correct unary - for matsubara_freq
- The unary - of matsubara_freq was not correct ...
missing () around the ==
2014-01-30 21:29:53 +01:00
Olivier Parcollet
eda6eb90a2 arrays: correction of value_type of matrix_expr
- forgot to correct the value_type of matrix_expr, and vector_expr
as was done long ago for arrays...
- also added cases for arrays until dim 10
- TODO : replace this trait in arrays with a tuple tools for any dim..
  not urgent.
2014-01-30 20:28:30 +01:00
Olivier Parcollet
91978da6db gfs: mesh product, rename shape method...
- just a renaming for readibility.
2014-01-30 20:28:30 +01:00
Olivier Parcollet
ff3de6c5e7 mc_tools: simplify measure_aux
- for pieces that need to be precomputed for several
measures.
- put them under shared_ptr, and register then with add_measure_aux.
- they must be callable, as void ().
- TODO : add this in the doc when tested
2014-01-30 20:28:30 +01:00
tayral
1811d53179 Added density for scalar_valued gf (and test thereof) 2014-01-20 17:55:07 +01:00
tayral
2d1dec4c3d Fixed antiperiodicity property of imtime
- the condition p%2 ==1 was wrong if p<0 (never true!)
- added corresponding test (gf_notail)

Conflicts:
	triqs/gfs/imtime.hpp

Fixed by O.P. : already fixed in Laura's pull request ...
2014-01-20 17:54:33 +01:00
Laura Messio
359deae18d correction of a bug in imtime (evaluator_fnt_on_mesh) + corresponding test added 2014-01-20 17:49:47 +01:00
Laura Messio
04cf39a361 deprecated gfs files removed 2014-01-20 17:49:47 +01:00
Olivier Parcollet
b2603dcf3a Fix for clang 1y with gcc lib
- add a workaround for a gcc issue in fisrt_include.
- --> make sure that the first include is :
either a triqs lib
or first_include
2014-01-20 10:50:52 +01:00
Olivier Parcollet
0f85b08693 add trace for ImmutableMatrix 2014-01-12 20:46:10 +01:00
Olivier Parcollet
6820f4865a gf : target_shape_t. change size_t to int
- to avoid narrowing pbs.
- otherwise {n,n}, with n int does not work, which is crazy.
2014-01-10 21:47:33 +01:00
Olivier Parcollet
9474937470 shared_ptr<void> can not be constructed directly in c++14
- Fix for compilation on clang 3.4 in c++1y mode.
2014-01-07 14:33:57 +01:00
Olivier Parcollet
b644b38a6a gf: imfreq. general case, fix python interface
- Fix constructor, now taking n_points like the positive_only case
- Fix python, h5read, for general case (i.e. all frequencies).
2014-01-07 14:30:40 +01:00
Olivier Parcollet
2200e2680f gf: imfreq: fix out of bound product gf imfreq
- gf<cartesian_product<imfreq,imfreq>> was not correct
  when out bounds. Fixed evaluator.
- tensor_proxy : fix the trait for algebra which was incorrect.
- TODO: clean code (repetition, put in mesh some windowing).
2014-01-06 19:16:25 +01:00