continue calculation after power failure



Your computational steps could be improved.
1. I think that all the declare( ) statements have no affect.
2. You are trying to add rules to the simplification of "." 
(non-commutative multiplication).
   Why not write a program that does it more efficiently, instead of 
having hugely redundant matching?

If you insist on writing with patterns, why not do this:
   write a pattern that completely reduces in one step the expression

(Lx1^^k1.Rx1^^k2.Lx2^^k3. .... ). ket(x1,x2, .....)    completely,  
instead of just
decrementing k1 by 1,  and then looking for the pattern all over again?

My guess is that , for all occurrences of patterns with k in them, k is 
an integer.
It thus becomes unnecessary to explicitly check that k is an integer, 
which you
are doing over and over and over and over again.


3. while using expand() may do what you want,  it is notoriously 
inefficient.
Can you think of another way, perhaps via "map" to combine items rather
than  expand ( (......) . (.....))  ?

I also agree with Stavros below.  Unless your answer comes out to be 
quite small compared
with your inputs, it may be of any use.

RJF


On 4/19/2012 6:14 AM, Stavros Macrakis wrote:
> Razif,
>
> You can use the command 'save' to store your intermediate results into 
> a file, and 'load' to restore them.   You'll probably also want to 
> save some indication of which was the most recent result.  If I were 
> you, I would name the intermediate results rather than use '%'.
>
> Without looking at the details of your computation, a few simple 
> questions:
>
>   * How confident are you that this computation will complete in a
>     reasonable amount of time (with or without restarts)?  (What do
>     the intermediate times look like?)
>   * How confident are you that the final result will be useful?  What
>     are the sizes of the intermediate expressions, and how confident
>     are you that there will be enough simplifications that the final
>     result will be manageable?
>
>            -s
>
> On Thu, Apr 19, 2012 at 03:14, razif razali <razif66 at gmail.com 
> <mailto:razif66 at gmail.com>> wrote:
>
>     Here i attach my sample code.
>     Download both file in same folder and batch("pnn_42"); inside Maxima
>
>     On Thu, Apr 19, 2012 at 10:55 AM, razif razali <razif66 at gmail.com
>     <mailto:razif66 at gmail.com>> wrote:
>
>         How to periodically backup and rerun the calculation?
>
>         Before this I got not enough RAM but then I create large swap
>         memory for this and it run non stop for 4days before I got
>         power failure, I will attach my code here soon since I reply
>         this using phone..thanks RJF
>
>         On Apr 19, 2012 10:37 AM, "Richard Fateman"
>         <fateman at eecs.berkeley.edu <mailto:fateman at eecs.berkeley.edu>>
>         wrote:
>
>             Not automatically.
>
>             You would have to make periodic backup/restart by saving
>             stuff.
>
>             Getting maxima to re-load and restart from a backup on
>             auto-reboot is
>             presumably possible.
>
>             It is also possible that you could figure out how to make
>             your program
>             run faster.  4 days on a PC ?? Do you have enough memory??  Is
>             there a better algorithm??
>
>             RJF
>
>             On 4/18/2012 6:44 PM, razif razali wrote:
>>             Dear Maxima users,
>>
>>             I just want to ask if there any possibility that I can
>>             resume my calculation in MAXIMA if my PC suddenly reboot
>>             on it ownself since my calculation already takes 4days
>>             and it will take more time if I need to start from zero back.
>>
>>             Thanks a lot, hope to get reply from all of you soon.
>>
>>             -- 
>>             Regards,
>>
>>             RAZIF RAZALI,
>>             Tutor & Master Student,
>>             Physics Department,
>>             Faculty Of Science,
>>             Universiti Teknologi Malaysia(UTM).
>>             +60199393606 <tel:%2B60199393606>
>>
>>
>>
>>
>>
>>             _______________________________________________
>>             Maxima mailing list
>>             Maxima at math.utexas.edu  <mailto:Maxima at math.utexas.edu>
>>             http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
>
>
>     -- 
>     Regards,
>
>     RAZIF RAZALI,
>     Tutor & Master Student,
>     Physics Department,
>     Faculty Of Science,
>     Universiti Teknologi Malaysia(UTM).
>     +60199393606 <tel:%2B60199393606>
>
>
>
>
>     _______________________________________________
>     Maxima mailing list
>     Maxima at math.utexas.edu <mailto:Maxima at math.utexas.edu>
>     http://www.math.utexas.edu/mailman/listinfo/maxima
>
>