%% $OpenXM: OpenXM/src/ox_math/documents/samplelog-sm1.txt,v 1.3 1999/11/08 00:36:56 takayama Exp $ samplelog-sm1.txt : sm1 から, ox_math を呼び出す例. 例題は, Mathematica Book (S.Wolfram) A Tour of Mathematica より とった. 1999, 11/5 Fri, 11:20: [nobuki@yama nobuki]$ sm1 Kan/StackMachine1 1991 April --- 1998. Release 2.991030 (C) N. Takayama gc 4.14 (C) Boehm, Demers, GNU MP 2.0.2 (C) Free Software Foundation, Open XM. This software may be freely distributed as is with no warranty expressed. Info: http://www.math.kobe-u.ac.jp/KAN, kan@math.kobe-u.ac.jp. ? for help. Ready sm1>macro package : dr.sm1, 9/26,1995 --- Version 9/8, 1999. sm1>macro package : module1.sm1, 1994 -- Nov 8, 1998 sm1>(ox.sm1) run ; ox.sm1, --- open sm1 protocol module 10/1,1999 (C) N.Takayama. oxhelp for help sm1>(ox_launch) usage ; [remote remote-OpenXM-bin remote-ox-server remote-login-name myhostname] ox_launch client Example 1: [(tau.math.kobe-u.ac.jp) (/home/taka/OpenXM/bin) (/home/taka/OpenXM/src/ox_math/ox_math) (taka) (dc4.math.kobe-u.ac.jp) ] ox_launch /@@@.oxmath set sm1> [(tau.math.kobe-u.ac.jp) (/home/taka/OpenXM/bin) (/home/taka/OpenXM/src/ox_math/ox_math) (taka) (yama.math.kobe-u.ac.jp) ] ox_launch /@@@.oxmath set ; Hello from open. serverName is yama.math.kobe-u.ac.jp and portnumber is 0 Done the initialization. port =1026 [ 4 , 1026 , 3 , 1024 ] Executing the command : ssh -f tau.math.kobe-u.ac.jp -l taka "/home/taka/OpenXM/bin/oxlog /usr/X11R6/bin/xterm -icon -e /home/taka/OpenXM/bin/ox -reverse -ox /home/taka/OpenXM/src/ox_math/ox_math -host yama.math.kobe-u.ac.jp -data 1026 -control 1024 -pass 269770415 " [ taka@tau.math.kobe-u.ac.jp's password: Trying to accept... Accepted. Trying to accept... Accepted. Control port 1024 : Connected. Stream port 1026 : Connected. Byte order for control process is network byte order. Byte order for engine process is network byte order. sm1>@@@.oxmath (N[Sqrt[10],40]) oxsubmit ; sm1>@@@.oxmath oxpopcmo :: $3.16227766016837933199889354443271853372$ sm1>@@@.oxmath (FindRoot[BesselJ[0,x],{x,10.5}) oxsubmit ; sm1>@@@.oxmath :: [ $client$ , Name=Buffered IO by FILE2, FILE *=82d2000 , 1026 , 5 , 1024 , 0 , 0 , 0 , 0 , 0 , %[null] , 0 , 0 ] sm1>@@@.oxmath oxpopcmo :: Class.indeterminate $$Failed$ sm1>@@@.oxmath (FindRoot[BesselJ[0,x],{x,10.5}]) oxsubmit ; sm1>@@@.oxmath oxpopcmo :: [ $List$ , [ $Rule$ , Class.indeterminate $x$ , $18.071063872589566$ ] ] sm1>@@@.oxmath (NIntegrate[Sin[Sin[x]], {x,0,Pi}]) oxsubmit ; sm1>@@@.oxmath oxpopcmo :: $1.7864874819500596$ sm1>@@@.oxmath (FactorInteger[ 20654065386]) oxsubmit ; sm1>@@@.oxmath oxpopcmo :: [ $List$ , [ $List$ , 2 , 1 ] , [ $List$ , 3 , 2 ] , [ $List$ , 43 , 1 ] , [ $List$ , 26684839 , 1 ] ] sm1>@@@.oxmath (Plot[Sin[x^3],{x,-2,2}]) oxsubmit ; Plot を頼むと Mathematica は以下のような巨大なデータをおくりかえしてきて くれる. .......... $0.058848715846176042$ , $0.00020380318568878926$ ] , [ $List$ , $0.063925582957708782$ , $0.00026123062327715319$ ] , [ $List$ , $0.075483797260236019$ , $0.00043009184219683475$ ] , [ $List$ , $0.085389058362520226$ , $0.00062259645710993009$ ] , [ $List$ , $0.094800203092095747$ , $0.00085197676453212636$ ] , [ $List$ , $0.1124643743927272$ , $0.001422475413813041$ ] , [ $List$ , $0.13147941741224145$ , $0.0022728613274591624$ ] , [ $List$ , $0.15222475922816323$ , $0.0035274022435660929$ ] , [ $List$ , $0.17456638178891035$ , $0.0053196098687267566$ ] , [ $List$ , $0.19560281767103044$ , $0.0074837843683483452$ ] , [ $List$ , $0.2349136621617281$ , $0.012963213138804636$ ] , [ $List$ , $0.27724798215631957$ , $0.021309453311807332$ ] , [ $List$ , $0.32301927231130739$ , $0.033697918471413596$ ] , [ $List$ , $0.36298144245228797$ , $0.047806582612823653$ ] , [ $List$ , $0.40682416150617157$ , $0.06728093428390626$ ] , [ $List$ , $0.49531661779027614$ , $0.12122139733321755$ ] , [ $List$ , $0.577319191041195$ , $0.19123382135485076$ ] , [ $List$ , $0.66518232937340627$ , $0.29009067257088256$ ] , [ $List$ , $0.83898250724819956$ , $0.55682026463112355$ ] , [ $List$ , $0.92597335379970913$ , $0.71313087969680655$ ] , [ $List$ , $1.0064165849354911$ , $0.85177998519206055$ ] , [ $List$ , $1.0467183689036557$ , $0.91145412211964616$ ] , [ $List$ , $1.0845351444477094$ , $0.95675903914962124$ ] , [ $List$ , $1.1035191959241926$ , $0.97435028116126077$ ] , [ $List$ , $1.1239738197801938$ , $0.98864205621250267$ ] , [ $List$ , $1.1350366272041006$ , $0.99411754672915609$ ] , [ $List$ , $1.14059782862615$ , $0.99622480932896185$ ] , [ $List$ , $1.1466780326819648$ , $0.99801217555180666$ ] , [ $List$ , $1.1518918871031776$ , $0.9991011313229109$ ] , [ $List$ , $1.1548094669240425$ , $0.99952695300130912$ ] , [ $List$ , $1.1574591361017637$ , $0.99979730104303988$ ] , [ $List$ , $1.1626173398883621$ , $0.99999976249588263$ ] , [ $List$ , $1.167484562435281$ , $0.99978970359145969$ ] , [ $List$ , $1.1723357744205902$ , $0.99918289320997544$ ] , [ $List$ , $1.1775447829536554$ , $0.99807854960111486$ ] , [ $List$ , $1.1824617391562282$ , $0.99659548150788801$ ] , [ $List$ , $1.1869521986730704$ , $0.99485858038227182$ ] , [ $List$ , $1.1979348243966028$ , $0.98902406922202202$ ] , [ $List$ , $1.2083558624748583$ , $0.98132703485916639$ ] , [ $List$ , $1.2190984883554299$ , ...... sm1> @@@.oxmath (Integrate[x/(1-x^3),x]) oxsubmit ; sm1>@@@.oxmath oxpopcmo :: [ $Plus$ , [ $Times$ , -1 , [ $Power$ , 3 , [ $Rational$ , -1 , 2 ] ] , [ $ArcTan$ , [ $Times$ , [ $Power$ , 3 , [ $Rational$ , -1 , 2 ] ] , [ $Plus$ , 1 , [ $Times$ , 2 , Class.indeterminate $x$ ] ] ] ] ] , [ $Times$ , [ $Rational$ , -1 , 3 ] , [ $Log$ , [ $Plus$ , -1 , Class.indeterminate $x$ ] ] ] , [ $Times$ , [ $Rational$ , 1 , 6 ] , [ $Log$ , [ $Plus$ , 1 , Class.indeterminate $x$ , [ $Power$ , Class.indeterminate $x$ , 2 ] ] ] ] ] sm1>@@@.oxmath ( <@@@.oxmath oxpopcmo :: Class.indeterminate $$Failed$ ファイルは読み込めない. --------- From mathematica to sm1 bash$ pwd /home/taka/OpenXM/src/ox_math bash$ uname -a SunOS tau 5.7 Generic sun4u sparc SUNW,Ultra-5_10 bash$ date Sun Nov 7 09:03:55 JST 1999 bash$ math couldn't set locale correctly Mathematica 3.0 for Solaris Copyright 1988-97 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= Install["math2ox"] couldn't set locale correctly Out[1]= LinkObject['./math2ox', 1, 1] In[2]:= OxStart["../bin/ox_sm1"] Trying to connect port 53613, ip=ffbef06c connected. Trying to connect port 53614, ip=ffbef06c connected. Socket#18: login!. password = (otpasswd), 9 bytes. received = (otpasswd), 9 bytes. Socket#20: login!. password = (otpasswd), 9 bytes. received = (otpasswd), 9 bytes. sm1>macro package : dr.sm1, 9/26,1995 --- Version 9/8, 1999. sm1>macro package : module1.sm1, 1994 -- Nov 8, 1998 sm1>--------------------------------------------------- open (localhost) Out[2]= 0 In[3]:= OxExecute["1 1 add "] Out[3]= 0 In[4]:= (CMO_STRING[4],[size=8],$1 1 add $), In[4]:= OxPopString[] Out[4]= 2 In[5]:= Quit oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. oxSocketSelect0() returns 1, but there is no data. You peer may be killed. [control] control function_id is -1 Sending the kill signal to the child. sm1 の gb (グレブナ基底計算), deRham ( de Rham コホモロジ計算) を呼び出す例. bash$ math couldn't set locale correctly Mathematica 3.0 for Solaris Copyright 1988-97 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= Install["math2ox"] couldn't set locale correctly Out[1]= LinkObject['./math2ox', 1, 1] In[2]:= OxStart["../lib/sm1/bin/ox_sm1_forAsir"] Trying to connect port 53620, ip=ffbef05c connected. Trying to connect port 53621, ip=ffbef05c connected. Socket#18: login!. password = (otpasswd), 9 bytes. received = (otpasswd), 9 bytes. Socket#20: login!. password = (otpasswd), 9 bytes. received = (otpasswd), 9 bytes. sm1>macro package : dr.sm1, 9/26,1995 --- Version 9/8, 1999. sm1>macro package : module1.sm1, 1994 -- Nov 8, 1998 sm1>cohom.sm1 is the top of an experimental package to compute restrictions of all degrees based on restall.sm1 and restall_s.sm1 See, http://www.math.kobe-u.ac.jp to get these files of the latest version. Note that the package b-function.sm1 cannot be used with this package. r-interface.sm1 (C) N.Takayama, restriction, deRham hol.sm1, basic package for holonomic systems (C) N.Takayama, 1999, 6/05 rank characteristic ch rrank gb pgb syz genericAnn annfs sm1>gkz.sm1 generates gkz systems (C) N.Takayama, 1998, 11/8, cf. rrank in hol.sm1 gkz sm1>appell.sm1 generates Appell hypergeometric differential equations (C) N.Takayama, 1998, 11/8, cf. rank in hol.sm1 appell1 appell4 sm1>resol0.sm1, package to construct schreyer resolutions -- not minimal (C) N.Takayama, 1999, 5/18. resol0, resol1 complex.sm1 : 1999, 9/28, res-div, res-solv, res-kernel-image, res-dual In this package, complex is expressed in terms of matrices. restall.sm1 ... compute all the cohomology groups of the restriction of a D-module to tt = (t_1,...,t_d) = (0,...,0). non-Schreyer Version: 19980415 by T.Oaku usage: [(P1)...] [(t1)...] bfm --> the b-function [(P1)...] [(t1)...] k0 k1 deg restall --> cohomologies of restriction [(P1)...] [(t1)...] intbfm --> the b-function for integration [(P1)...] [(t1)...] k0 k1 deg intall --> cohomologies of integration restall_s.sm1...compute all the cohomology groups of the restriction of a D-module to tt = (t_1,...,t_d) = (0,...,0). Schreyer Version: 19990521 by N.Takayama & T.Oaku usage: [(P1)...] [(t1)...] k0 k1 deg restall_s -> cohomologies of restriction [(P1)...] [(t1)...] k0 k1 deg intall_s --> cohomologies of integration No truncation from below in restall The variable Schreyer is set to 2. Loading tower.sm1 in the standard context. You cannot use Schyrer 1. It is controlled from cohom.sm1 SSkan/lib/callsm1.sm1, 1999/6/23. --------------------------------------------------- open (localhost) Out[2]= 0 D での左イデアル の GB を weight (x,y,Dx,Dy) = (0,0,1,1) で求める. In[3]:= OxExecute[" [[(x dx + y dy-2) ( x dx x dx + y dy)] (x,y) [[(dx) 1 (dy) 1]]] gb "] Out[3]= 0 In[4]:= (CMO_STRING[4],[size=68],$ [[(x dx + y dy-2) ( x dx x dx + y dy)] (x,y) [[(dx) 1 (dy) 1]]] gb $), In[4]:= OxPopString[] Out[4]= [ [ x*dx+y*dy-2 , -y^2*dy^2-2*x*dx ] , [ x*dx+y*dy , -y^2*dy^2 ] \ > ] これが GB こちらが weight vector での主部 (特性多様体) H^i( C^2 \setminus V(x^3-y^2) , C) の次元 In[5]:= OxExecute[" [(x^3-y^2) (x,y)] deRham "] Out[5]= 0 In[6]:= (CMO_STRING[4],[size=26],$ [(x^3-y^2) (x,y)] deRham $),[ [ -3*y*dx^2+2*x*dy , -2*x*dx-3*y*dy+1 ] , [ x , y ] ] bfm sm1>sm1>b-function is -216*s^3+432*s^2-264*s+48 [ [ -3*y*dx^2+2*x*dy , -2*x*dx-3*y*dy+1 ] , [ x , y ] , 1 , 2 ] restall1_s Computing a free resolution ... A free resolution obtained. 0-th cohomology: [ 0 , [ ] ] sm1>-1-th cohomology: [ 1 , [ ] ] sm1>-2-th cohomology: [ 2 , [ -1 ] ] In[6]:= OxPopString[] Out[6]= [ 1 , 1 , 0 ] In[7]:= OxClose[] [control] control function_id is 1024 [control] control_kill I have closed the connection to an Open XM server. Out[7]= 0 In[8]:= In[8]:= Sending the kill signal to the child. In[8]:= Quit bash$ これは失敗例. bash$ math couldn't set locale correctly Mathematica 3.0 for Solaris Copyright 1988-97 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= Install["../bin/ox_sm1"] couldn't set locale correctly sm1 version : 2.991106 sm1 url : http://www.math.kobe-u.ac.jp/KAN name = ox_sm1 engineByteOrder=0 Interrupt during LinkConnect> abort ?? Your options are: continue (or c) to continue exit (or quit) to exit Mathematica back out (or b) to back out of the MathLink call--the link may die. Interrupt during LinkConnect> quit --------------- sm1 の array をあらわす [ ] を { } に変えて --------------- sm1 の出力を ToExpression で読み込む例 [tau]bash bash$ cd OpenXM bash$ cd src/ox_math bash$ math couldn't set locale correctly Mathematica 3.0 for Solaris Copyright 1988-97 Wolfram Research, Inc. -- Motif graphics initialized -- In[1]:= Install["math2ox"] couldn't set locale correctly Out[1]= LinkObject['./math2ox', 1, 1] In[2]:= OxStart["/home/taka/OpenXM/lib/sm1/bin/ox_sm1_forAsir"] Trying to connect port 53755, ip=ffbef02c connected. Trying to connect port 53756, ip=ffbef02c connected. Socket#18: login!. password = (otpasswd), 9 bytes. received = (otpasswd), 9 bytes. Socket#20: login!. password = (otpasswd), 9 bytes. received = (otpasswd), 9 bytes. sm1>macro package : dr.sm1, 9/26,1995 --- Version 11/8, 1999. sm1>macro package : module1.sm1, 1994 -- Nov 8, 1998 sm1>cohom.sm1 is the top of an experimental package to compute restrictions 省略 Loading tower.sm1 in the standard context. You cannot use Schyrer 1. It is controlled from cohom.sm1 SSkan/lib/callsm1.sm1, 1999/6/23. --------------------------------------------------- open (localhost) Out[2]= 0 In[10]:= OxExecute[" [(LeftBracket) ({)] system_variable [(RightBracket) (})] system_variable "] [ を { へ, ] を } へ. Out[10]= 0 In[11]:= (CMO_STRING[4],[size=74],$ [(LeftBracket) ({)] system_variable [(RightBracket) (})] system_variable $), In[11]:= OxExecute[" [[(x dx + y dy + 1) (x dx x dx - y dy)] (x,y) [[(dx) 1 (dy) 1]]] gb "] グレブナ基底を Q で. weight は dx=1, dy=1. Out[11]= 0 In[12]:= (CMO_STRING[4],[size=81],$ [[(x dx + y dy + 1) (x dx x dx - y dy)] (x,y) [[(dx) 1 (dy) 1]]] gb $), In[12]:= ans = OxPopString[] Out[12]= {{x*dx+y*dy+1 , -y^2*dy^2+x*dx-y*dy} , {x*dx+y*dy , -y^2*dy^2}} グレブナ基底が文字列でかえる. 最初が Groebner, 2 番目が weight dx=1, dy=1 での主要部. In[13]:= ans2 = ToExpression[ans] Mathematica の多項式に変換. 2 2 2 2 Out[13]= {{1 + dx x + dy y, dx x - dy y - dy y }, {dx x + dy y, -(dy y )}} In[17]:= OxExecute[" [[(x dx x dx + y dy y dy -4) (x dx y dy -1)] (x,y) [[(dx) 1]]] gb "] dx の weight を 1 にして, グレブナ基底を計算. ****** dx の 消去法 Out[17]= 0 In[18]:= (CMO_STRING[4],[size=79],$ [[(x dx x dx + y dy y dy -4) (x dx y dy -1)] (x,y) [[(dx) 1]]] gb $), In[18]:= ans = OxPopString[] Out[18]= {{x*dx+y^3*dy^3+3*y^2*dy^2-3*y*dy ,\ > -y^4*dy^4-6*y^3*dy^3-3*y^2*dy^2+3*y*dy-1} , {x*dx ,\ > -y^4*dy^4-6*y^3*dy^3-3*y^2*dy^2+3*y*dy-1}} dx を含まない微分作用素があるのに注意!! つまり dy についての 常微分方程式がでた. In[19]:= ToExpression[ans] 2 2 3 3 Out[19]= {{dx x - 3 dy y + 3 dy y + dy y , 2 2 3 3 4 4 > -1 + 3 dy y - 3 dy y - 6 dy y - dy y }, 2 2 3 3 4 4 > {dx x, -1 + 3 dy y - 3 dy y - 6 dy y - dy y }} In[20]:=