+ M2 --no-readline --print-width 262 Macaulay2, version 1.7 with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition, ReesAlgebra, TangentCone i4 : factor 234534653564 2 o4 = 2 17*41*47*1789849 o4 : Expression of class Product i5 : peek oo 2 o5 = Product{2 , 17, 41, 47, 1789849} i6 : new Product from {3,4,5,6} o6 = 3*4*5*6 o6 : Expression of class Product i7 : R=ZZ[a..e]; i8 : M=R^4; i9 : M 4 o9 = R o9 : R-module, free i10 : M_1 o10 = | 0 | | 1 | | 0 | | 0 | 4 o10 : R i11 : M_0 o11 = | 1 | | 0 | | 0 | | 0 | 4 o11 : R i12 : new Product from {M_1,M_2,M_3} o12 = /| 0 |\/| 0 |\/| 0 |\ || 1 |||| 0 |||| 0 || || 0 |||| 1 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ o12 : Expression of class Product i13 : 2 * oo o13 = 2/| 0 |\/| 0 |\/| 0 |\ || 1 |||| 0 |||| 0 || || 0 |||| 1 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ o13 : Expression of class Product i14 : oo + new Product from {M_2,M_0,M_1+M_3} o14 = 2/| 0 |\/| 0 |\/| 0 |\ + /| 0 |\/| 1 |\/| 0 |\ || 1 |||| 0 |||| 0 || || 0 |||| 0 |||| 1 || || 0 |||| 1 |||| 0 || || 1 |||| 0 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ \| 0 |/\| 0 |/\| 1 |/ o14 : Expression of class Sum i15 : factor 34893480 3 o15 = 2 3*5*101*2879 o15 : Expression of class Product i16 : value oo o16 = 34893480 i17 : new Product from {M_1,M_2,M_3} o17 = /| 0 |\/| 0 |\/| 0 |\ || 1 |||| 0 |||| 0 || || 0 |||| 1 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ o17 : Expression of class Product i18 : value oo stdio:18:9:(3): error: no method for binary operator * applied to objects: -- 4 -- | 0 | (of class R ) -- | 1 | -- | 0 | -- | 0 | -- 4 -- * | 0 | (of class R ) -- | 0 | -- | 1 | -- | 0 | i19 : M_1 o19 = | 0 | | 1 | | 0 | | 0 | 4 o19 : R i20 : class oo 4 o20 = R o20 : R-module, free i21 : parent oo o21 = Vector o21 : Type i22 : parent QQ^11 o22 = Vector o22 : Type i23 : methods Vector o23 = {(**, Vector, Vector) } {(*, Ideal, Vector) } {(*, Matrix, Vector) } {(*, Number, Vector) } {(*, Ring, Vector) } {(*, RingElement, Vector) } {(+, Vector, Vector) } {(-, Vector, Vector) } {(/, Module, Vector) } {(==, Vector, Vector) } {(_, Vector, ZZ) } {(contract, Matrix, Vector) } {(contract, Number, Vector) } {(contract, RingElement, Vector) } {(contract, Vector, Matrix) } {(contract, Vector, Number) } {(contract, Vector, RingElement) } {(contract, Vector, Vector) } {(degree, Vector) } {(diff, Matrix, Vector) } {(diff, RingElement, Vector) } {(diff, Vector, Matrix) } {(diff, Vector, RingElement) } {(diff, Vector, Vector) } {(entries, Vector) } {(homogenize, Vector, RingElement) } {(homogenize, Vector, RingElement, List)} {(isHomogeneous, Vector) } {(leadComponent, Vector) } {(leadTerm, Vector) } {(matrix, Vector) } {(module, Vector) } {(net, Vector) } {(NewFromMethod, Matrix, Vector) } {(NewFromMethod, Vector, Matrix) } {(norm, Vector) } {(ring, Vector) } {(saturate, Vector) } {(saturate, Vector, Ideal) } {(saturate, Vector, RingElement) } {(SPACE, Matrix, Vector) } {(SPACE, RingMap, Vector) } {(substitute, Vector, List) } {(substitute, Vector, Matrix) } {(substitute, Vector, Option) } {(substitute, Vector, Ring) } {(substitute, Vector, RingFamily) } {(toExternalString, Vector) } {(toString, Vector) } o23 : VerticalList i24 : help (symbol **, Vector, Vector) o24 = Vector ** Vector -- tensor product ********************************** Synopsis ======== * Usage:v ** w * Operator: "**" * Inputs: * v, a vector * w, a vector * Outputs: * a vector, the tensor product of v and w Description =========== If v is in the module M, and w is in the module N, then v**w is in the module M**N. +-----------------------------------------+ |i1 : R = ZZ[a..d]; | +-----------------------------------------+ |i2 : F = R^3 | | | | 3 | |o2 = R | | | |o2 : R-module, free | +-----------------------------------------+ |i3 : G = coker vars R | | | |o3 = cokernel | a b c d | | | | | 1 | |o3 : R-module, quotient of R | +-----------------------------------------+ |i4 : v = (a-37)*F_1 | | | |o4 = | 0 | | | | a-37 | | | | 0 | | | | | 3 | |o4 : R | +-----------------------------------------+ |i5 : v ** G_0 | | | |o5 = | 0 | | | | -37 | | | | 0 | | | | |o5 : cokernel | a b c d 0 0 0 0 0 0 0 0 || | | 0 0 0 0 a b c d 0 0 0 0 || | | 0 0 0 0 0 0 0 0 a b c d || +-----------------------------------------+ See also ======== * "Module ** Module" -- tensor product o24 : DIV i25 : help o25 = initial help ************ Welcome to Macaulay2 Try entering '2+2' at your next input prompt, which begins with i. The two output prompts begin with o. The first one, with the equal sign, '=', gives the value computed from your input, and the second one, with the colon, ':', tells what type of thing the value is. Type one of these commands to get started reading the documentation: * copyright -- the copyright * help "Macaulay2" -- top node of the documentation. * help "reading the documentation" -- * help "getting started" -- * help "a first Macaulay2 session" -- * help x -- display the documentation for x * ? f -- display brief documentation for a function f * printWidth = 80 -- set print width to 80 characters * viewHelp -- view documentation in a browser * viewHelp x -- view documentation on x in browser To read the documentation in info form, in case you happen to be running Macaulay2 in a terminal window, replace "help" by "infoHelp" in any of the commands above. o25 : DIV i26 : M_1 ** M_2 o26 = | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | 16 o26 : R i27 : Vector * Vector := (v,w) -> v**w; i28 : new Product from {M_1,M_2} o28 = /| 0 |\/| 0 |\ || 1 |||| 0 || || 0 |||| 1 || \| 0 |/\| 0 |/ o28 : Expression of class Product i29 : value oo o29 = | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | 16 o29 : R i30 : new Product from {M_1,M_2,M_3} o30 = /| 0 |\/| 0 |\/| 0 |\ || 1 |||| 0 |||| 0 || || 0 |||| 1 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ o30 : Expression of class Product i32 : oo+oo o32 = /| 0 |\/| 0 |\/| 0 |\ + /| 0 |\/| 0 |\/| 0 |\ || 1 |||| 0 |||| 0 || || 1 |||| 0 |||| 0 || || 0 |||| 1 |||| 0 || || 0 |||| 1 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ \| 0 |/\| 0 |/\| 1 |/ o32 : Expression of class Sum i33 : peek oo o33 = Sum{/| 0 |\/| 0 |\/| 0 |\, /| 0 |\/| 0 |\/| 0 |\} || 1 |||| 0 |||| 0 || || 1 |||| 0 |||| 0 || || 0 |||| 1 |||| 0 || || 0 |||| 1 |||| 0 || \| 0 |/\| 0 |/\| 1 |/ \| 0 |/\| 0 |/\| 1 |/ i34 : showStructure Vector o34 = Thing : BasicList : Vector o34 : Descent i35 : showStructure o35 = Thing : BasicList : Command Constant DocumentTag Eliminate Expression : Adjacent AssociativeExpression : Equation Product Sum BinaryOperation Divide FunctionApplication Holder : OneExpression ZeroExpression MatrixExpression Minus NonAssociativeProduct Parenthesize Power RowExpression SparseMonomialVectorExpression SparseVectorExpression Subscript Superscript Table FilePosition ForestNode Hybrid IndeterminateNumber IndexedVariable InfiniteNumber LowerBound Manipulator MutableList : Bag Option Partition ProductOrder PushforwardComputation RingElement : R SumOfTwists Time TreeNode URL Vector VisibleList : Array List : VerticalList Sequence Boolean CompiledFunctionBody Database Dictionary : GlobalDictionary LocalDictionary File Function : CompiledFunction CompiledFunctionClosure : MethodFunction FunctionClosure : CacheFunction MethodFunctionWithOptions FunctionBody HashTable : CoherentSheaf Ideal : MonomialIdeal ImmutableType : Module ModuleMap : Matrix MonoidElement MutableHashTable : CacheTable Descent GradedModule : ChainComplex GradedModuleMap : ChainComplexMap GroebnerBasis IndexedVariableTable Package Resolution ScriptedFunctor Type : HeaderType Monoid : OrderedMonoid : GeneralOrderedMonoid Ring : EngineRing : FractionField GaloisField InexactField : ComplexField RealField PolynomialRing QuotientRing RingFamily : InexactFieldFamily SelfInitializingType WrapperType Variety : AffineVariety ProjectiveVariety MutableMatrix OptionTable : GroebnerBasisOptions ProjectiveHilbertPolynomial RingMap SheafOfRings Tally : Set VirtualTally : BettiTally Net : String NetFile Nothing : InexactNumber * Number : InexactNumber : CC RR QQ ZZ Pseudocode Symbol : Keyword SymbolBody Task o35 : Descent i36 : QQ[x] o36 = QQ[x] o36 : PolynomialRing i37 : QQ[t,u] o37 = QQ[t, u] o37 : PolynomialRing i38 : showStructure o38 = Thing : BasicList : Command Constant DocumentTag Eliminate Expression : Adjacent AssociativeExpression : Equation Product Sum BinaryOperation Divide FunctionApplication Holder : OneExpression ZeroExpression MatrixExpression Minus NonAssociativeProduct Parenthesize Power RowExpression SparseMonomialVectorExpression SparseVectorExpression Subscript Superscript Table FilePosition ForestNode Hybrid IndeterminateNumber IndexedVariable InfiniteNumber LowerBound Manipulator MutableList : Bag Option Partition ProductOrder PushforwardComputation RingElement : QQ[t, u] QQ[x] R SumOfTwists Time TreeNode URL Vector VisibleList : Array List : VerticalList Sequence Boolean CompiledFunctionBody Database Dictionary : GlobalDictionary LocalDictionary File Function : CompiledFunction CompiledFunctionClosure : MethodFunction FunctionClosure : CacheFunction MethodFunctionWithOptions FunctionBody HashTable : CoherentSheaf Ideal : MonomialIdeal ImmutableType : Module ModuleMap : Matrix MonoidElement MutableHashTable : CacheTable Descent GradedModule : ChainComplex GradedModuleMap : ChainComplexMap GroebnerBasis IndexedVariableTable Package Resolution ScriptedFunctor Type : HeaderType Monoid : OrderedMonoid : GeneralOrderedMonoid Ring : EngineRing : FractionField GaloisField InexactField : ComplexField RealField PolynomialRing QuotientRing RingFamily : InexactFieldFamily SelfInitializingType WrapperType Variety : AffineVariety ProjectiveVariety MutableMatrix OptionTable : GroebnerBasisOptions ProjectiveHilbertPolynomial RingMap SheafOfRings Tally : Set VirtualTally : BettiTally Net : String NetFile Nothing : InexactNumber * Number : InexactNumber : CC RR QQ ZZ Pseudocode Symbol : Keyword SymbolBody Task o38 : Descent i39 : describe R o39 = ZZ[a..e, Degrees => {5:1}, Heft => {1}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 1] {GRevLex => {5:1} } {Position => Up } i40 : a o40 = a o40 : R i41 : t o41 = t o41 : QQ[t, u] i42 : x o42 = x o42 : QQ[x] i43 : A = class x o43 = A o43 : PolynomialRing i44 : B = QQ[x,y] o44 = B o44 : PolynomialRing i45 : x+y o45 = x + y o45 : B i46 : x o46 = x o46 : B i47 : use A o47 = A o47 : PolynomialRing i48 : x o48 = x o48 : A i49 : x+y stdio:49:2:(3): error: expected pair to have a method for '+' i50 : use B o50 = B o50 : PolynomialRing i51 : x o51 = x o51 : B i52 : B_0 o52 = x o52 : B i53 : f = x -> x+3 o53 = f o53 : FunctionClosure i54 : g = (x) -> x+5 o54 = g o54 : FunctionClosure i55 : g = (x,y) -> x+5 o55 = g o55 : FunctionClosure i56 : g(3,4) o56 = 8 i57 : g = (x) -> x+5 o57 = g o57 : FunctionClosure i58 : g(3,4) stdio:57:9:(3): error: expected 1 argument, but got 2 i59 : f(3,4) stdio:53:11:(3):[1]: error: no method for binary operator + applied to objects: -- (3, 4) (of class Sequence) -- + 3 (of class ZZ) i60 : f 3 o60 = 6 i61 : 3 4 stdio:61:1:(3): error: no method for adjacent objects: -- 3 (of class ZZ) -- SPACE 4 (of class ZZ) i62 : TensorProduct = new Type of BasicList o62 = TensorProduct o62 : Type i63 : new TensorProduct from {M_2,M_3} o63 = TensorProduct{| 0 |, | 0 |} | 0 | | 0 | | 1 | | 0 | | 0 | | 1 | o63 : TensorProduct i64 : 2 * oo stdio:64:3:(3): error: no method for binary operator * applied to objects: -- 2 (of class ZZ) -- * TensorProduct{| 0 |, | 0 |} (of class TensorProduct) -- | 0 | | 0 | -- | 1 | | 0 | -- | 0 | | 1 | i65 : TensorProduct = new Type of List o65 = TensorProduct o65 : Type i66 : new TensorProduct from {M_2,M_3} o66 = {| 0 |, | 0 |} | 0 | | 0 | | 1 | | 0 | | 0 | | 1 | o66 : TensorProduct i67 : 2 * oo o67 = {| 0 |, | 0 |} | 0 | | 0 | | 2 | | 0 | | 0 | | 2 | o67 : TensorProduct i68 : TensorProduct = new Type of Expression o68 = TensorProduct o68 : Type i69 : showStructure o69 = Thing : BasicList : Command Constant DocumentTag Eliminate Expression : Adjacent AssociativeExpression : Equation Product Sum BinaryOperation Divide FunctionApplication Holder : OneExpression ZeroExpression MatrixExpression Minus NonAssociativeProduct Parenthesize Power RowExpression SparseMonomialVectorExpression SparseVectorExpression Subscript Superscript Table TensorProduct FilePosition ForestNode Hybrid IndeterminateNumber IndexedVariable InfiniteNumber LowerBound Manipulator MutableList : Bag Option Partition ProductOrder PushforwardComputation RingElement : A B QQ[t, u] R SumOfTwists Time TreeNode Type{} URL Vector VisibleList : Array List : Type{} VerticalList Sequence Boolean CompiledFunctionBody Database Dictionary : GlobalDictionary LocalDictionary File Function : CompiledFunction CompiledFunctionClosure : MethodFunction FunctionClosure : CacheFunction MethodFunctionWithOptions FunctionBody HashTable : CoherentSheaf Ideal : MonomialIdeal ImmutableType : Module ModuleMap : Matrix MonoidElement MutableHashTable : CacheTable Descent GradedModule : ChainComplex GradedModuleMap : ChainComplexMap GroebnerBasis IndexedVariableTable Package Resolution ScriptedFunctor Type : HeaderType Monoid : OrderedMonoid : GeneralOrderedMonoid Ring : EngineRing : FractionField GaloisField InexactField : ComplexField RealField PolynomialRing QuotientRing RingFamily : InexactFieldFamily SelfInitializingType WrapperType Variety : AffineVariety ProjectiveVariety MutableMatrix OptionTable : GroebnerBasisOptions ProjectiveHilbertPolynomial RingMap SheafOfRings Tally : Set VirtualTally : BettiTally Net : String NetFile Nothing : InexactNumber * Number : InexactNumber : CC RR QQ ZZ Pseudocode Symbol : Keyword SymbolBody Task o69 : Descent i70 : new TensorProduct from {M_2,M_3} o70 = TensorProduct{| 0 |, | 0 |} | 0 | | 0 | | 1 | | 0 | | 0 | | 1 | o70 : Expression of class TensorProduct i71 : 2 * oo o71 = 2*TensorProduct{| 0 |, | 0 |} | 0 | | 0 | | 1 | | 0 | | 0 | | 1 | o71 : Expression of class Product i72 : peekoo o72 = peekoo o72 : Symbol i73 : peek oo o73 = peekoo i74 : peek o71 o74 = Product{2, TensorProduct{| 0 |, | 0 |}} | 0 | | 0 | | 1 | | 0 | | 0 | | 1 | i75 : help "operators" o75 = operators ********* Here we present all of the unary and binary operators in the language. They are members of the class "Keyword". The binary operators are "!=" "#" "#?" "%" "&" "*" "**" "+" "++" "," "-" "->" "." ".." "..<" ".?" "/" "//" ":" ":=" ";" "<" "<-" "<<" "<=" "<==" "<===" "<==>" "=" "=!=" "==" "===" "===>" "==>" "=>" ">" ">=" ">>" "?" "@" "@@" "\" "\\" "^" "^**" "^^" "_" "|" "|-" "||" "and" "or" "SPACE" , the unary prefix operators are "#" "*" "+" "," "-" "<" "<<" "<=" "<==" "<===" ">" ">=" "?" "|-" "not" , and the unary postfix operators are "!" "(*)" "," ";" "^*" "_*" "~" . Of those, the ones for which users may install new methods are the binary operators "%" "&" "*" "**" "+" "++" "-" ".." "..<" "/" "//" ":" "<<" "<==" "<===" "<==>" "==" "===>" "==>" ">>" "?" "@" "@@" "\" "\\" "^" "^**" "^^" "_" "|" "|-" "||" "and" "or" "SPACE" , the unary prefix operators "*" "+" "-" "<" "<<" "<=" "<==" "<===" ">" ">=" "?" "|-" "not" , and the unary postfix operators "!" "(*)" "^*" "_*" "~" . Menu ---- assignment * "=" -- assignment * ":=" -- assignment of method or new local variable * "<-" -- assignment with left side evaluated equality testing * "==" -- equality * "!=" -- inequality * ===, see "Thing === Thing" -- strict equality * "=!=" -- strict inequality comparison of objects * "<" -- less than * "<=" -- less than or equal * ">" -- greater than * ">=" -- greater than or equal * "?" -- comparison operator predicates * "and" -- conjunction * "or" -- disjunction * "not" -- negation functions * "SPACE" -- blank operator; often used for function application, making polynomial rings * "->" -- make a function * "@@" -- a binary operator * "\\" -- a binary operator * "\" -- a binary operator subscripting and object access * "_" -- a binary operator, used for subscripting and access to elements * "." -- access to elements whose key is a symbol * ".?" -- check for presence of elements whose key is a symbol * "#" -- length, or access to elements * "#?" -- check for presence of elements arithmetic operators * "!" -- factorial * "+" -- a unary or binary operator, usually used for addition * "-" -- a unary or binary operator, usually used for negation or subtraction * "*" -- a binary operator, usually used for multiplication * "/" -- a binary operator, usually used for division * "//" -- a binary operator, usually used for quotient * "%" -- a binary operator, usually used for remainder and reduction * "^" -- a binary operator, usually used for powers * "&" -- a binary operator * "++" -- a binary operator, usually used for direct sum * "**" -- a binary operator, usually used for tensor product or Cartesian product * "^**" -- a binary operator, usually used for tensor or Cartesian power * "~" -- a unary postfix operator * "(*)" -- a unary postfix operator, used for indicating a graded object * ":" -- a binary operator, uses include repetition; ideal quotients miscellaneous operators * ".." -- a binary operator, used for sequences of consecutive items * "..<" -- a binary operator, used for sequences of consecutive items, not including the endpoint * "<<" -- a binary operator (file output, ...) * ">>" -- a binary operator, uses include bit shifting, or attaching optional inputs to functions * "|" -- a binary operator, often used for horizontal concatenation * "||" -- a binary operator, often used for vertical concatenation * "@" -- a binary operator * "^^" -- a binary operator * "|-" -- a binary operator * "<==>" -- a binary operator * "===>" -- a binary operator * "==>" -- a binary operator * "<===" -- a unary and binary operator * "<==" -- a unary and binary operator built in operators * "=>" -- produce an Option * "," -- the comma, used for separating entries in a list or sequence * ";" -- statement separator further information * "precedence of operators" * "operatorAttributes" o75 : DIV i76 : * "precedence of operators" o76 = precedence of operators *********************** One aspect of parsing precedence is associativity. A left-associative operator is one, such as "*", with the property that x * y * z is parsed as (x * y) * z. A right-associative operator is one, such as "=", with the property that x = y = z is parsed as x = (y = z). These operators are left associative: "#" "#?" "%" "&" "*" "**" "+" "++" "," "-" "." ".." "..<" ".?" "/" "//" "<<" "@@" "^" "^**" "^^" "_" "|" "||", and these operators are right associative: "!=" "->" ":" ":=" ";" "<" "<-" "<=" "<==" "<===" "<==>" "=" "=!=" "==" "===" "===>" "==>" "=>" ">" ">=" ">>" "?" "@" "\" "\\" "|-" "and" "or" "SPACE" . Here are the operators arranged in order of increasing parsing precedence. For example, * has higher parsing precedence than +, and hence 2+3*5 is parsed as though it had been written as 2+(3*5). The symbol "SPACE" represents the operator that is used when two things are adjacent in program code. +-------------------------------------+ | 8 ; | | | |10 , | | | |14 -> := <- = => >> | | | |18 << | | | |20 |- | | | |22 <=== ===> | | | |24 <==> | | | |26 <== ==> | | | |28 or | | | |30 and | | | |32 not | | | |34 != < <= =!= == === > >= ?| | | |36 || | | | |38 : | | | |40 | | | | |42 ^^ | | | |44 & | | | |46 .. ..< | | | |48 + ++ - | | | |50 ** | | | |54 % * / // \ \\ | | | |56 @ | | | |58 SPACE | | | |60 (*) | | | |62 @@ | | | |64 ^* _* ~ | | | |66 # #? . .? ^ ^** _ | | | |68 ! | +-------------------------------------+ See also ======== * "parsing precedence, in detail" o76 : DIV i77 :