Ticket #10142 (closed defect: invalid)

Opened 3 years ago

Last modified 2 years ago

Frequent crash in ode_solver

Reported by: mister.wardrop Owned by: burcin
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: calculus Keywords:
Cc: jdemeyer Work issues:
Report Upstream: N/A Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

I have been using Sagemath (several versions, but must recently, 4.5.2; but this bug existed in previous versions as well) for my Honours thesis in quantum mechanics, and have been making heavy use of the integration routines. The ode_solver regularly crashes for specific step-sizes. I have not been able to work out a systematic pattern, but if it doesn't work once, it continues not to work no matter how many times you try. It can crash for any step size; sometimes even for integers. It does, however, usually only crash on the final step. It also seems to be independent of the numerical solver.

When it crashes, it reports something like:

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (60, 0))

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/themadhatter/Honours/modelling/<ipython console> in <module>()

/home/themadhatter/Honours/modelling/lib/sequences.pyc in evolution(self, period, step, perturbations, carryon)
     16    
     17     def evolution(self,period=100,step=1,perturbations=None,carryon=False):
---> 18         return self.SYSTEM.integrate_numerically(perturbation=perturbations,self_entangle=True,step=step,period=period,projector=self.PROJECTOR,time_dependence=self.TIME_DEPENDENCE,carryon=carryon)
     19    
     20     def fidelity(self,period=100,step=1,perturbations=None,carryon=False):

/home/themadhatter/Honours/modelling/lib/hamiltonian.pyc in integrate_numerically(self, y_0, period, step, perturbations, error_rel, error_abs, self_entangle, projector, time_dependence, function, increase_dim, noise, carryon, params)
    560         else:
    561             integrator = self.Integrator(self,y_0,self_entangle=self_entangle,noise=noise,increase_dim=increase_dim,perturbations=perturbations,time_dependence=time_dependence,cache='numerical',error_rel=error_rel,error_abs=error_abs)
--> 562             return integrator.start(period,step)
    563     #
    564     # Integrate a given initial state using the Hamiltonian and compare to ideal evolution

/home/themadhatter/Honours/modelling/lib/hamiltonian.pyc in start(self, period, step)
    521        
    522         def start(self,period=100,step=1):
--> 523             self.results = self.integrate(self.y_0,period=period,step=step)
    524             if self.multiple:
    525                 return self.results

/home/themadhatter/Honours/modelling/lib/hamiltonian.pyc in integrate(self, y_0, period, step, t_offset)
    512            
    513             for y_0 in y_0s:
--> 514                 T.ode_solve(y_0=y_0,t_span=[0,period],params=params,num_points=int(period/step))
    515                 results.append(T.solution)
    516                 pb_run+=1

/home/themadhatter/sage/local/lib/python2.6/site-packages/sage/gsl/ode.so in sage.gsl.ode.ode_solver.ode_solve (sage/gsl/ode.c:4558)()

ValueError: error solving

I have been very careful in checking my code, and am confident that it is not a fault in my code. I have been working around it by changing the step-size adhoc... but when doing a series of runs; it is VERY annoying. ><

If you need more information, let me know. I am quite happy to give you my entire code; along with specific instructions on how to trigger the crash.

Please fix this!

Kind Regards,
Matthew

Change History

comment:1 Changed 2 years ago by kcrisman

Hi, This definitely needs more instructions on how to trigger the crash. Thanks!

comment:2 Changed 2 years ago by kcrisman

  • Priority changed from critical to major

comment:3 Changed 2 years ago by mister.wardrop

Sorry for the delay... I'll be just a few more days (at most). I've been very busy on another project. I know this qualifies as spam... but I want you to know I do intend to provide more information.

comment:4 Changed 2 years ago by mister.wardrop

  • Status changed from new to closed
  • Resolution set to invalid

Whoops!

I sat down today to do a thorough analysis of my code, and found that the error was actually in some progress bar code that I have been using, which throws an assertion error if progress is > 100; which it was by a smidgeon due to the approximations of float numbers.

My humble apologies for wasting your time... and my faith is bolstered in Sage :).

Thank you!

comment:5 Changed 2 years ago by mvngu

  • Milestone set to sage-duplicate/invalid/wontfix

comment:6 Changed 2 years ago by kcrisman

  • Cc jdemeyer added

To release manager: Just FYI that this was closed by the OP.

I guess we really need that new config for the actions!

Note: See TracTickets for help on using tickets.