Menu

#165 Add a plotting function for 1D to the Python version

0.3.3
done
nobody
nobody
2021-05-27
2019-08-15
Ulf Lorenz
No
What and Why

Plotting has never been very useful in the C++ code, and issue [#110] is not going to change that, I fear. The basic problem is that we write out Gnuplot files that the user has to run to get some postscript files that she can look at or bundle together into a movie. This is way too complicated for "just looking at the wavefunction".

On the other hand, Python comes with this nice matplotlib package that allows very simple Matlab-style plots. A simple improvement would be then to add a special python-only observer to the Python package that does the plotting using Matplotlib and Python-only code.

Here, we only make a small demo in the form of a 1D wavefunction plotter. While pretty straightforward in principle, there are some risks associated with this issue

  • It may be that we have to modify the build process to bundle the C++-based Python interface and some additional Python code into a module. Needs some thinking and testing.
  • The plotting module should be a PropagationObserver, so that it can be used "natively". This may require trampoline classes and all that complexity that I have avoided so far.

Note: Plotting always requires the DVR, not the weighted DVR like virtually everything else.


  • Added the whole infrastructure to support various observers and filters written in Python, in particular with a separate package for Python-only extensions (i.e., plotters)
  • Added two rudimentary Plotters with a few customization arguments (ranges etc.)
    • added file output, but no video => this is a bit more involved
  • rearranged and cleaned up the building of the Python code

Related

Tickets: #110
Tickets: #136
Tickets: #178
Tickets: #210

Discussion

  • Ulf Lorenz

    Ulf Lorenz - 2019-09-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,3 +8,5 @@
    
     * It may be that we have to modify the build process to bundle the C++-based Python interface and some additional Python code into a module. Needs some thinking and testing.
     * The plotting module should be a PropagationObserver, so that it can be used "natively". This may require trampoline classes and all that complexity that I have avoided so far.
    +
    +Note: Plotting always requires the DVR, not the weighted DVR like virtually everything else.
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2019-12-31
    • Milestone: Backlog --> 0.4 goal
     
  • Ulf Lorenz

    Ulf Lorenz - 2020-01-01
    • labels: --> Matlab-version
     
  • Ulf Lorenz

    Ulf Lorenz - 2021-01-30
    • Milestone: 0.4 goal --> 0.3.3
     
  • Ulf Lorenz

    Ulf Lorenz - 2021-05-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,3 +10,10 @@
     * The plotting module should be a PropagationObserver, so that it can be used "natively". This may require trampoline classes and all that complexity that I have avoided so far.
    
     Note: Plotting always requires the DVR, not the weighted DVR like virtually everything else.
    +
    +----
    +
    +* Added the whole infrastructure to support various observers and filters written in Python, in particular with a separate package for Python-only extensions (i.e., plotters)
    +* Added two rudimentary Plotters with a few customization arguments (ranges etc.)
    +    * added file output, but no video => this is a bit more involved
    +* rearranged and cleaned up the building of the Python code
    
    • status: open --> done
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.