Skip to content

Thursday morning Q and A session log

Daniel R. Grayson edited this page Jun 7, 2018 · 1 revision

i6 : res

o6 = resolution

o6 : MethodFunctionWithOptions

i7 : methods res

o7 = {(resolution, Ideal)        }
     {(resolution, Matrix)       }
     {(resolution, Module)       }
     {(resolution, MonomialIdeal)}

o7 : VerticalList

i8 : f = method()

o8 = f

o8 : MethodFunction

i9 : f 3
stdio:9:1:(3): error: no method found for applying f to:
     argument   :  3 (of class ZZ)

i10 : f Ideal := I -> "hi there"

o10 = -*Function[stdio:10:14-10:14]*-

o10 : FunctionClosure

i11 : f ideal 3

o11 = hi there

i12 : f 3
stdio:12:1:(3): error: no method found for applying f to:
     argument   :  3 (of class ZZ)

i13 : f (ideal 3, ideal 4)
stdio:13:1:(3): error: no method found for applying f to:
     argument 1 :  ideal 3 (of class Ideal)
     argument 2 :  ideal 4 (of class Ideal)

i14 : f ( Ideal , Ideal ) := ( I , J ) -> "whee!"

o14 = -*Function[stdio:14:34-14:34]*-

o14 : FunctionClosure

i15 : f (ideal 3, ideal 4)

o15 = whee!

i16 : g = x -> x+1

o16 = g

o16 : FunctionClosure

i17 : g 5

o17 = 6

i18 : g = x -> x+2

o18 = g

o18 : FunctionClosure

i19 : g 5

o19 = 7

i20 : g = (x,y) -> x+y+11

o20 = g

o20 : FunctionClosure

i21 : g 5
stdio:20:11:(3): error: expected 2 arguments but got 1

i22 : x -> x+1

o22 = -*Function[stdio:22:3-22:8]*-

o22 : FunctionClosure

i23 : o22 55

o23 = 56

i24 : (x -> x+1, x->x+2)

o24 = (-*Function[stdio:24:4-24:9]*-, -*Function[stdio:24:13-24:17]*-)

o24 : Sequence

i25 : o24#1 55

o25 = 57

i26 : (x -> x+1, x->x+2);

i27 : o26

o27 = (-*Function[stdio:26:4-26:9]*-, -*Function[stdio:26:13-26:17]*-)

o27 : Sequence

i28 : methods f

o28 = {(f, Ideal)       }
      {(f, Ideal, Ideal)}

o28 : VerticalList

i29 : h = x -> (
         if class x === Ideal then "hi"
         else if class x === Sequence and class x#0 === Ideal and class x#1 === Ideal then "whee"
         else error ("no method for h on argument ", toString x))

o29 = h

o29 : FunctionClosure

i30 : h ideal 3

o30 = hi

i31 : h (ideal 3, ideal 4)

o31 = whee

i32 : h 4
stdio:35:1:(3): error: no method for h on argument 4

i33 : options method

o33 = OptionTable{Binary => false                         }
                  Dispatch => {Thing, Thing, Thing, Thing}
                  Options => null
                  TypicalValue => Thing

o33 : OptionTable

i34 : options res

o34 = OptionTable{DegreeLimit => null           }
                  FastNonminimal => false
                  HardDegreeLimit => {}
                  LengthLimit => infinity
                  PairLimit => infinity
                  SortStrategy => 0
                  StopBeforeComputation => false
                  Strategy => null
                  SyzygyLimit => infinity

o34 : OptionTable

i35 : methods res

o35 = {(resolution, Ideal)        }
      {(resolution, Matrix)       }
      {(resolution, Module)       }
      {(resolution, MonomialIdeal)}

o35 : VerticalList

i36 : code oo

o36 = -- code for method: resolution(Ideal)
      /Applications/Macaulay2-1.11/share/Macaulay2/Core/res.m2:228:45-232:6: --source code:
      resolution Ideal := ChainComplex => options -> (I) -> resolution(
           if I.cache.?quotient 
           then I.cache.quotient
           else I.cache.quotient = cokernel generators I, -- used to be (ring I)^1/I, but that needs GB recomputation...
           options)
      ---------------------------------
      -- code for method: resolution(Matrix)
      /Applications/Macaulay2-1.11/share/Macaulay2/Core/res.m2:223:49-226:13: --source code:
      resolution Matrix := ChainComplexMap => options -> (f) -> extend(
           resolution(target f, options), 
           resolution(source f, options), 
           matrix f)
      ---------------------------------
      -- code for method: resolution(Module)
      /Applications/Macaulay2-1.11/share/Macaulay2/Core/res.m2:208:40-221:36: --source code:
      resolution Module := ChainComplex => o -> (M) -> (
           if M.cache.?ManualResolution then return M.cache.ManualResolution;
           C := runHooks(Module,symbol resolution,(o,M));
           if C =!= null then return C;
           R := ring M;
           if isField R then return chainComplex map(minimalPresentation M,R^0,0);
           k := ultimate(coefficientRing, R);
           oR := options R;
           if engineReady M and (options R).Heft =!= null
           then (resolutionInEngine default(o,if o.FastNonminimal then Strategy4 else if isQuotientRing R or isSkewCommutative R then Strategy2 else Strategy1))(M)
           else if k === ZZ then (resolutionBySyzygies o)(M)
           else if not isHomogeneous M and isCommutative R and degreeLength R === 1 then (resolutionByHomogenization o)(M)
           else (resolutionBySyzygies o)(M)
           )
      ---------------------------------
      -- code for method: resolution(MonomialIdeal)
      /Applications/Macaulay2-1.11/share/Macaulay2/Core/monideal.m2:237:53-237:78: --source code:
      resolution MonomialIdeal := ChainComplex => options -> I -> resolution ideal I

i37 : ReturnCellVars

o37 = ReturnCellVars

o37 : Symbol

i38 : needsPackage "Binomials"
--warning: symbol "ReturnCellVars" in User#"private dictionary" is shadowed by a symbol in Binomials.Dictionary
--  use the synonym ReturnCellVars$0

o38 = Binomials

o38 : Package

i39 : ReturnCellVars

o39 = ReturnCellVars

o39 : Symbol

i40 : package ReturnCellVars

o40 = Binomials

o40 : Package

i41 : package ReturnCellVars$0

o41 = User

o41 : Package

i42 : needsPackage Text
stdio:45:1:(3): error: no method found for applying needsPackage to:
     argument   :  Text (of class Package)

i43 : needsPackage "Text"

o43 = Text

o43 : Package

i44 : TEX

o44 = TEX

o44 : MarkUpType

i45 : help tex
--warning: tag has no documentation: User :: tex(STYLE), key (tex,STYLE)

o45 = tex
      ***

      Synopsis
      ========

        * Usage:tex x
        * Inputs:
            * x, any Macaulay2 object
        * Outputs:
            * a string, x converted to TeX format

      Description
      ===========

      +-----------------------------------------+
      |i1 : R = ZZ[a..f];                       |
      +-----------------------------------------+
      |i2 : tex matrix {{a^2+2,b,c},{d,e,f^3-a}}|
      |                                         |
      |o2 = $\bgroup\begin{pmatrix}a^{2}+2&     |
      |     b&                                  |
      |     c\\                                 |
      |     d&                                  |
      |     e&                                  |
      |     f^{3}-a\\                           |
      |     \end{pmatrix}\egroup$               |
      +-----------------------------------------+

      Caveat
      ======

      No attempt is made to wrap large matrices or equations.

      See also
      ========

        * "texMath" -- convert to TeX math format
        * "mathML" -- convert to MathML format
        * "showTex" -- convert to TeX and display on screen

      Ways to use tex :
      =================

        * "tex(STYLE)"

o45 : DIV

i46 : apropos "matrix"

o46 = {matrix, submatrix, submatrix', submatrixByDegrees}

o46 : List

i47 : apropos "atrix"

o47 = {ChangeMatrix, compactMatrixForm, diagonalMatrix, fillMatrix, genericMatrix,
      ----------------------------------------------------------------------------------------------
      genericSkewMatrix, genericSymmetricMatrix, getChangeMatrix, Matrix, matrix, MatrixExpression,
      ----------------------------------------------------------------------------------------------
      MinimalMatrix, MutableMatrix, mutableMatrix, randomMutableMatrix, submatrix, submatrix',
      ----------------------------------------------------------------------------------------------
      submatrixByDegrees, sylvesterMatrix, SyzygyMatrix}

o47 : List

i48 : apropos "[mM]atrix"

o48 = {ChangeMatrix, compactMatrixForm, diagonalMatrix, fillMatrix, genericMatrix,
      ----------------------------------------------------------------------------------------------
      genericSkewMatrix, genericSymmetricMatrix, getChangeMatrix, Matrix, matrix, MatrixExpression,
      ----------------------------------------------------------------------------------------------
      MinimalMatrix, MutableMatrix, mutableMatrix, randomMutableMatrix, submatrix, submatrix',
      ----------------------------------------------------------------------------------------------
      submatrixByDegrees, sylvesterMatrix, SyzygyMatrix}

o48 : List

i49 : compactMatrixForm

o49 = true

i50 : ChangeMatrix

o50 = ChangeMatrix

o50 : Symbol

i51 : help ChangeMatrix

o51 = ChangeMatrix
      ************

      Description
      ===========

      A symbol used as the name of an optional argument, for some function(s).

      Functions with optional argument named ChangeMatrix :
      =====================================================

        * "forceGB(..., ChangeMatrix => ...)" -- inform Macaulay2 about the change of basis matrix
          from GB to generators
        * gb(..., ChangeMatrix => ...), see "gb" -- compute a Gröbner basis
        * "hermite(..., ChangeMatrix => ...)"
        * "LLL(..., ChangeMatrix => ...)" -- also find change of basis matrix
        * markedGB(..., ChangeMatrix => ...), see "markedGB(Matrix,Matrix)" -- make a marked
          Gröbner basis
        * smithNormalForm(..., ChangeMatrix => ...), see "smithNormalForm(Matrix)" -- smith normal
          form for a matrix over ZZ or a PID

      For the programmer
      ==================

      The object "ChangeMatrix" is a symbol.

o51 : DIV

i52 : apropos "inomi"

o52 = {Binomial, binomial, binomialAssociatedPrimes, binomialCellularDecomposition,
      ----------------------------------------------------------------------------------------------
      binomialIsPrimary, binomialIsPrime, binomialMinimalPrimes, binomialPrimaryDecomposition,
      ----------------------------------------------------------------------------------------------
      binomialRadical, Binomials, binomialSolve, binomialUnmixedDecomposition,
      ----------------------------------------------------------------------------------------------
      cellularBinomialAssociatedPrimes, cellularBinomialIsPrimary,
      ----------------------------------------------------------------------------------------------
      cellularBinomialPrimaryDecomposition, cellularBinomialRadical,
      ----------------------------------------------------------------------------------------------
      cellularBinomialUnmixedDecomposition, isBinomial, makeBinomial, randomBinomialIdeal}

o52 : List

i53 : sin (3.4)

o53 = -.255541102026831

o53 : RR (of precision 53)

i54 : sin 3.4

o54 = -.255541102026831

o54 : RR (of precision 53)

i55 : R=QQ[x,y,z]

o55 = R

o55 : PolynomialRing

i56 : betti res coker vars R

             0 1 2 3
o56 = total: 1 3 3 1
          0: 1 3 3 1

o56 : BettiTally

i57 : apropos "eced"

o57 = {}

o57 : List

i58 : apropos "opera"

o58 = {operatorAttributes}

o58 : List

i59 : {1,2,3}

o59 = {1, 2, 3}

o59 : List

i60 : sin\o59

o60 = {.841471, .909297, .14112}

o60 : List

i61 : o59/sin

o61 = {.841471, .909297, .14112}

o61 : List

i62 : sin\sin\o59

o62 = {.745624, .789072, .140652}

o62 : List

i63 : o59/sin/sin

o63 = {.745624, .789072, .140652}

o63 : List

i64 : o59/sin/sin//length

o64 = 3

i65 : for i in o59 list (i,i^2,i^3)

o65 = {(1, 1, 1), (2, 4, 8), (3, 9, 27)}

o65 : List

i67 : for i in o59 do print i
1
2
3

i68 : for i to 20 do print i
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

i69 : apropos "user"

o69 = {userSymbols}

o69 : List

i70 : userSymbols 

o70 = userSymbols

o70 : FunctionClosure

i71 : userSymbols ()

o71 = {R, f, g, h, x, y, z}

o71 : List

i72 : dictionaryPath 

o72 = {Macaulay2Doc.Dictionary, Text.Dictionary, Binomials.Dictionary, SimpleDoc.Dictionary,
      ----------------------------------------------------------------------------------------------
      User#"private dictionary", User.Dictionary, Elimination.Dictionary, LLLBases.Dictionary,
      ----------------------------------------------------------------------------------------------
      IntegralClosure.Dictionary, PrimaryDecomposition.Dictionary, Classic.Dictionary,
      ----------------------------------------------------------------------------------------------
      TangentCone.Dictionary, ReesAlgebra.Dictionary, ConwayPolynomials.Dictionary,
      ----------------------------------------------------------------------------------------------
      InverseSystems.Dictionary, Core.Dictionary, OutputDictionary, PackageDictionary}

o72 : List

i73 : Binomials.Dictionary

o73 = Binomials.Dictionary

o73 : GlobalDictionary

i74 : keys oo

o74 = {Binomials$cellularBinomialRadical, cellularBinomialRadical, Binomials$randomBinomialIdeal,
      ----------------------------------------------------------------------------------------------
      randomBinomialIdeal, Binomials$binomialMinimalPrimes, binomialMinimalPrimes,
      ----------------------------------------------------------------------------------------------
      Binomials$latticeBasisIdeal, latticeBasisIdeal, Binomials$CellVariables, CellVariables,
      ----------------------------------------------------------------------------------------------
      Binomials$makeBinomial, makeBinomial, Binomials$ReturnCellVars, ReturnCellVars, Binomials$BCD,
      ----------------------------------------------------------------------------------------------
      BCD, Binomials$partialCharacter, partialCharacter, Binomials$binomialIsPrimary,
      ----------------------------------------------------------------------------------------------
      binomialIsPrimary, Binomials$binomialAssociatedPrimes, binomialAssociatedPrimes,
      ----------------------------------------------------------------------------------------------
      Binomials$cellularBinomialAssociatedPrimes, cellularBinomialAssociatedPrimes,
      ----------------------------------------------------------------------------------------------
      Binomials$isCellular, isCellular, Binomials$BPD, BPD, Binomials$ReturnPChars, ReturnPChars,
      ----------------------------------------------------------------------------------------------
      Binomials$ReturnPrimes, ReturnPrimes, Binomials$PartialCharacter, PartialCharacter,
      ----------------------------------------------------------------------------------------------
      Binomials$idealFromCharacter, idealFromCharacter, Binomials$binomialRadical, binomialRadical,
      ----------------------------------------------------------------------------------------------
      Binomials$BUD, BUD, Binomials$binomialUnmixedDecomposition, binomialUnmixedDecomposition,
      ----------------------------------------------------------------------------------------------
      Binomials$binomialPrimaryDecomposition, binomialPrimaryDecomposition, Binomials$isBinomial,
      ----------------------------------------------------------------------------------------------
      isBinomial, Binomials$cellularBinomialIsPrimary, cellularBinomialIsPrimary,
      ----------------------------------------------------------------------------------------------
      Binomials$cellularBinomialPrimaryDecomposition, cellularBinomialPrimaryDecomposition,
      ----------------------------------------------------------------------------------------------
      Binomials$cellularBinomialUnmixedDecomposition, cellularBinomialUnmixedDecomposition,
      ----------------------------------------------------------------------------------------------
      Binomials$extractInclusionMinimalIdeals, extractInclusionMinimalIdeals,
      ----------------------------------------------------------------------------------------------
      Binomials$binomialIsPrime, binomialIsPrime, Binomials$binomialSolve, binomialSolve,
      ----------------------------------------------------------------------------------------------
      Binomials$binomialCellularDecomposition, binomialCellularDecomposition, Binomials$isUnital,
      ----------------------------------------------------------------------------------------------
      isUnital}

o74 : List

i75 : set values o73

o75 = set {BCD, binomialAssociatedPrimes, binomialCellularDecomposition, binomialIsPrimary,
      ----------------------------------------------------------------------------------------------
      binomialIsPrime, binomialMinimalPrimes, binomialPrimaryDecomposition, binomialRadical,
      ----------------------------------------------------------------------------------------------
      binomialSolve, binomialUnmixedDecomposition, BPD, BUD, cellularBinomialAssociatedPrimes,
      ----------------------------------------------------------------------------------------------
      cellularBinomialIsPrimary, cellularBinomialPrimaryDecomposition, cellularBinomialRadical,
      ----------------------------------------------------------------------------------------------
      cellularBinomialUnmixedDecomposition, CellVariables, extractInclusionMinimalIdeals,
      ----------------------------------------------------------------------------------------------
      idealFromCharacter, isBinomial, isCellular, isUnital, latticeBasisIdeal, makeBinomial,
      ----------------------------------------------------------------------------------------------
      PartialCharacter, partialCharacter, randomBinomialIdeal, ReturnCellVars, ReturnPChars,
      ----------------------------------------------------------------------------------------------
      ReturnPrimes}

o75 : Set

i76 : Binomials

o76 = Binomials

o76 : Package

i77 : peek oo

o77 = Package{configuration file name => null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }
              Dictionary => Binomials.Dictionary
              documentation not loaded => true
              example data files => MutableHashTable{}
              example inputs => MutableHashTable{}
              example results => MutableHashTable{}
              exported mutable symbols => {}
              exported symbols => {CellVariables, binomialUnmixedDecomposition, binomialPrimaryDecomposition, isBinomial, makeBinomial, ReturnCellVars, cellularBinomialIsPrimary, cellularBinomialUnmixedDecomposition, cellularBinomialPrimaryDecomposition, BCD, extractInclusionMinimalIdeals, binomialIsPrime, partialCharacter, binomialIsPrimary, binomialAssociatedPrimes, binomialSolve, binomialCellularDecomposition, cellularBinomialAssociatedPrimes, isCellular, BPD, isUnital, ReturnPChars, cellularBinomialRadical, randomBinomialIdeal, ReturnPrimes, binomialMinimalPrimes, PartialCharacter, idealFromCharacter, binomialRadical, latticeBasisIdeal, BUD}
              index.html => /Applications/Macaulay2-1.11/share/doc/Macaulay2/Binomials/html/index.html
              loadDepth => 3
              Options => OptionTable{Authors => {{Name => Thomas Kahle, Email => [email protected], HomePage => http://www.thomas-kahle.de}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                     }
                                     AuxiliaryFiles => false
                                     CacheExampleOutput => null
                                     Certification => {journal name => The Journal of Software for Algebra and Geometry: Macaulay2, journal URI => http://j-sag.org/, article title => Decompositions of binomial ideals, acceptance date => 2012-02-06, published article URI => http://j-sag.org/Volume4/jsag-1-2012.pdf, published code URI => http://j-sag.org/Volume4/Binomials.m2, repository code URI => svn://svn.macaulay2.com/Macaulay2/trunk/M2/Macaulay2/packages/Binomials.m2, release at publication => 14467, version at publication => 1.0, volume number => 4, volume URI => http://j-sag.org/Volume4/}
                                     Configuration => OptionTable{}
                                     Date => January 2018
                                     DebuggingMode => false
                                     Headline => Specialized routines for binomial ideals
                                     HomePage => null
                                     InfoDirSection => Macaulay2 and its packages
                                     OptionalComponentsPresent => true
                                     PackageExports => {}
                                     PackageImports => {FourTiTwo, Cyclotomic}
                                     Reload => false
                                     UseCachedExampleOutput => false
                                     Version => 1.2.1
              package prefix => /Applications/Macaulay2-1.11/
              private dictionary => Binomials#"private dictionary"
              processed documentation => MutableHashTable{}
              raw documentation => MutableHashTable{}
              raw documentation database => /Applications/Macaulay2-1.11/lib/Macaulay2/x86_64-Darwin-MacOS-10.13.3/Binomials/cache/rawdocumentation-dcba-8.db
              source directory => /Applications/Macaulay2-1.11/share/Macaulay2/
              source file => /Applications/Macaulay2-1.11/share/Macaulay2/Binomials.m2
              test inputs => MutableHashTable{}
              test number => 0
              title => Binomials
              undocumented keys => MutableHashTable{}

i78 : Binomials#"exported symbols"

o78 = {CellVariables, binomialUnmixedDecomposition, binomialPrimaryDecomposition, isBinomial,
      ----------------------------------------------------------------------------------------------
      makeBinomial, ReturnCellVars, cellularBinomialIsPrimary, cellularBinomialUnmixedDecomposition,
      ----------------------------------------------------------------------------------------------
      cellularBinomialPrimaryDecomposition, BCD, extractInclusionMinimalIdeals, binomialIsPrime,
      ----------------------------------------------------------------------------------------------
      partialCharacter, binomialIsPrimary, binomialAssociatedPrimes, binomialSolve,
      ----------------------------------------------------------------------------------------------
      binomialCellularDecomposition, cellularBinomialAssociatedPrimes, isCellular, BPD, isUnital,
      ----------------------------------------------------------------------------------------------
      ReturnPChars, cellularBinomialRadical, randomBinomialIdeal, ReturnPrimes,
      ----------------------------------------------------------------------------------------------
      binomialMinimalPrimes, PartialCharacter, idealFromCharacter, binomialRadical,
      ----------------------------------------------------------------------------------------------
      latticeBasisIdeal, BUD}

o78 : List

i79 : -- this is a comment
      4

o79 = 4

i80 : 4 + -* this is, too *- 5

o80 = 9

i81 : " asdf \" asdf "

o81 =  asdf " asdf 

i82 : "
      

i82 : /// asdf \" asdf ///

o82 =  asdf \" asdf 

i83 : "a\tb"

o83 = a       b

i84 : "a\0b"

o84 = ab

i85 : "ab"

o85 = ab

i86 : 你好 = res coker vars R

       1      3      3      1
o86 = R  <-- R  <-- R  <-- R  <-- 0
                                   
      0      1      2      3      4

o86 : ChainComplex

i87 : 你好

       1      3      3      1
o87 = R  <-- R  <-- R  <-- R  <-- 0
                                   
      0      1      2      3      4

o87 : ChainComplex

i88 : ꙮ = res coker vars R

       1      3      3      1
o88 = R  <-- R  <-- R  <-- R  <-- 0
                                   
      0      1      2      3      4

o88 : ChainComplex

i89 : ꙮ

       1      3      3      1
o89 = R  <-- R  <-- R  <-- R  <-- 0
                                   
      0      1      2      3      4

o89 : ChainComplex

i90 : 😎😎😎😎
Clone this wiki locally