Menu

#62 Various test and code issues

Backlog
open
nobody
None
nobody
2023-12-16
2016-05-02
Ulf Lorenz
No

Some smaller issues that popped up while going through the tests:

  • Should we get rid of the conversion problems (especially signed vs. unsigned)? The current situation comes from the tensor library using signed-only values because negative indices have a meaning (count from the end), while I prefer unsigned because you do not have to reject negative values. If we stick with unsigned: Should we use size_t in accordance with std::vector etc.?
  • Chebychev tests: Remove the custom operators in favor of standard operators?
  • should we use tensor::index when looping over tensor indices?
  • use doubles explicitly in the demos and tests (i.e., "1.0" instead of "1")
  • combine some common code, especially error checking
    • check that representation != nullptr (or other things)
    • check that dimensions correct for representation
    • checks for value within range
  • handle product of non-Hermitian operators (see PrimitiveProduct header)
  • The various propagation observers have poor names, occasionally
  • LaserField could derive from TimeFunction, making things a little simpler.
  • Operator::applyToX() could have a variant for time-independent operators. This could be implemented directly by the Operator interface (throw if operator is time-dependent)
  • Interval1D is not tested anywhere
  • Liouvillian could get some code common to all Liouvillians
    ** error-checking (making sure the state is a density operator and has the correct grid)
    ** getGrid() as the grid supplied in a constructor
  • RandomNumberGenerator is used as a std::shared_ptr in the code, and & in the tests. Can this be redone, e.g., to use std::shared_ptr also in the tests?
  • maybe we could speed things up with more rvalue functionality in the interface; For example, if you supply a State&&, we could reuse the tensors in this state for doing in-place computations instead of allocating a new tensor. Or maybe use "*=," " +=" etc. more aggressively

  • test_all.sh could set the "-Werror" flag to have warnings be a critical failure

  • a demo where you need to play around with a state's coefficients would be nice

Discussion

<< < 1 2 (Page 2 of 2)
  • Ulf Lorenz

    Ulf Lorenz - 2022-11-21
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -13,7 +13,6 @@
     * The various propagation observers have poor names, occasionally
     * OscillatingField could derive from TimeFunction, making things a little simpler.
     * Operator::applyToX() could have a variant for time-independent operators. This could be implemented directly by the Operator interface (throw if operator is time-dependent)
    -* laser shape functors should not have the electric field strength as parameter; draw that out of the functors.
     * Interval1D is not tested anywhere
     * Liouvillian could get some code common to all Liouvillians
     ** error-checking (making sure the state is a density operator and has the correct grid)
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2022-12-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,22 +1,23 @@
     Some smaller issues that popped up while going through the tests:
    
     * Should we get rid of the conversion problems (especially signed vs. unsigned)? The current situation comes from the tensor library using signed-only values because negative indices have a meaning (count from the end), while I prefer unsigned because you do not have to reject negative values. If we stick with unsigned: Should we use size_t in accordance with std::vector etc.?
    -* Chebychev primitives tests: Remove the custom operators in favor of standard operators?
    +* Chebychev tests: Remove the custom operators in favor of standard operators?
     * should we use tensor::index when looping over tensor indices?
     * use doubles explicitly in the demos and tests (i.e., &#34;1.0&#34; instead of &#34;1&#34;)
     * combine some common code, especially error checking
         * check that representation != nullptr (or other things)
         * check that dimensions correct for representation
         * checks for value within range
    -* remove Grid::create and replace by a customized std::make_shared
    +* remove Grid::create and replace by a customized std::make_shared or such?
     * handle product of non-Hermitian operators (see PrimitiveProduct header)
     * The various propagation observers have poor names, occasionally
    -* OscillatingField could derive from TimeFunction, making things a little simpler.
    +* LaserField  could derive from TimeFunction, making things a little simpler.
     * Operator::applyToX() could have a variant for time-independent operators. This could be implemented directly by the Operator interface (throw if operator is time-dependent)
     * Interval1D is not tested anywhere
     * Liouvillian could get some code common to all Liouvillians
     ** error-checking (making sure the state is a density operator and has the correct grid)
     ** getGrid() as the grid supplied in a constructor
    +* RandomNumberGenerator is used as a std::shared_ptr in the code, and &amp; in the tests. Can this be redone, e.g., to use std::shared_ptr also in the tests?
    
     * test_all.sh could set the &#34;-Werror&#34; flag to have warnings be a critical failure
     * a demo where you need to play around with a state&#39;s coefficients would be nice
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2023-07-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,7 +8,6 @@
         * check that representation != nullptr (or other things)
         * check that dimensions correct for representation
         * checks for value within range
    -* remove Grid::create and replace by a customized std::make_shared or such?
     * handle product of non-Hermitian operators (see PrimitiveProduct header)
     * The various propagation observers have poor names, occasionally
     * LaserField  could derive from TimeFunction, making things a little simpler.
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2023-12-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -17,6 +17,7 @@
     ** error-checking (making sure the state is a density operator and has the correct grid)
     ** getGrid() as the grid supplied in a constructor
     * RandomNumberGenerator is used as a std::shared_ptr in the code, and &amp; in the tests. Can this be redone, e.g., to use std::shared_ptr also in the tests?
    +* maybe we could speed things up with more rvalue functionality in the interface; For example, if you supply a State&amp;&amp;, we could reuse the tensors in this state for doing in-place computations instead of allocating a new tensor. Or maybe use &#34;*=,&#34;  &#34; +=&#34;  etc. more aggressively
    
     * test_all.sh could set the &#34;-Werror&#34; flag to have warnings be a critical failure
     * a demo where you need to play around with a state&#39;s coefficients would be nice
    
     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.