<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>* -- a binary operator, usually used for multiplication</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="__sl.html">next</a> | <a href="_-.html">previous</a> | <a href="__sl.html">forward</a> | <a href="_-.html">backward</a> | <a href="_operators.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="___The_sp__Macaulay2_splanguage.html" title="">The Macaulay2 language</a> > <a href="_operators.html" title="">operators</a> > <a href="__st.html" title="a binary operator, usually used for multiplication">*</a></div> <hr/> <div><h1>* -- a binary operator, usually used for multiplication</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>x * y</tt></div> </dd></dl> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div>The return type depends on the types of x and y. If they have the same type, then usually the return type is the common type of x and y.<p/> Multiplication involving ring elements (including integers, rational numbers, real and complex numbers), ideals, vectors, matrices, modules is generally the usual multiplication, or composition of functions.<p/> The intersection of sets is given by multiplication. See <a href="___Set_sp_st_sp__Set.html" title="intersection of sets">Set * Set</a>.<table class="examples"><tr><td><pre>i1 : set{hi,you,there} * set{hi,us,here,you} o1 = set {hi, you} o1 : Set</pre> </td></tr> </table> <p/> Multiplication involving a list attempts to multiply each element of the list.<table class="examples"><tr><td><pre>i2 : R = QQ[a..d];</pre> </td></tr> <tr><td><pre>i3 : a * {b,c,d} o3 = {a*b, a*c, a*d} o3 : List</pre> </td></tr> </table> <p/> Multiplication of matrices (<a href="___Matrix_sp_st_sp__Matrix.html" title="matrix multiplication">Matrix * Matrix</a>) or ring maps is the same as composition.<table class="examples"><tr><td><pre>i4 : f = map(R,R,{b,c,a,d}) o4 = map(R,R,{b, c, a, d}) o4 : RingMap R <--- R</pre> </td></tr> <tr><td><pre>i5 : g = map(R,R,{(a+b)^2,b^2,c^2,d^2}) 2 2 2 2 2 o5 = map(R,R,{a + 2a*b + b , b , c , d }) o5 : RingMap R <--- R</pre> </td></tr> <tr><td><pre>i6 : f*g 2 2 2 2 2 o6 = map(R,R,{b + 2b*c + c , c , a , d }) o6 : RingMap R <--- R</pre> </td></tr> <tr><td><pre>i7 : (f*g)(a) == f(g(a)) o7 = true</pre> </td></tr> </table> <p/> Submodules of modules may be produced using multiplication and addition.<table class="examples"><tr><td><pre>i8 : M = R^2; I = ideal(a+b,c); o9 : Ideal of R</pre> </td></tr> <tr><td><pre>i10 : N = I*M + a*R^2 o10 = image | a+b 0 c 0 a 0 | | 0 a+b 0 c 0 a | 2 o10 : R-module, submodule of R</pre> </td></tr> <tr><td><pre>i11 : isHomogeneous N o11 = true</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_times.html" title="multiplication">times</a> -- multiplication</span></li> <li><span><a href="_product.html" title="">product</a></span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>*</tt> :</h2> <ul><li>AffineVariety * AffineVariety</li> <li>CC * CC</li> <li>CC * QQ</li> <li>CC * RR</li> <li>CC * ZZ</li> <li>ChainComplexMap * ChainComplexMap</li> <li>Constant * Constant</li> <li>Constant * InexactNumber</li> <li>Constant * Number</li> <li>GradedModuleMap * GradedModuleMap</li> <li>Ideal * CoherentSheaf</li> <li>Ideal * Module</li> <li>Ideal * Ring</li> <li>Ideal * Vector</li> <li>InexactNumber * Constant</li> <li>Matrix * Number</li> <li>Matrix * RingElement</li> <li>Matrix * Vector</li> <li>Matrix * ZZ</li> <li>MonomialIdeal * Module</li> <li>MonomialIdeal * MonomialIdeal</li> <li>MonomialIdeal * Ring</li> <li>MutableMatrix * MutableMatrix</li> <li>Number * Constant</li> <li>Number * Matrix</li> <li>QQ * CC</li> <li>QQ * QQ</li> <li>QQ * RR</li> <li>QQ * ZZ</li> <li>Ring * Ideal</li> <li>Ring * MonomialIdeal</li> <li>Ring * RingElement</li> <li>Ring * Vector</li> <li>RingElement * ChainComplexMap</li> <li>RingElement * GradedModuleMap</li> <li>RingElement * Ideal</li> <li>RingElement * Matrix</li> <li>RingElement * Module</li> <li>RingElement * MonomialIdeal</li> <li>RingElement * MutableMatrix</li> <li>RingElement * RingElement</li> <li>RingElement * Vector</li> <li>RingMap * RingMap</li> <li>RR * CC</li> <li>RR * QQ</li> <li>RR * RR</li> <li>RR * ZZ</li> <li>Thing * List</li> <li>ZZ * CC</li> <li>ZZ * ProjectiveHilbertPolynomial</li> <li>ZZ * QQ</li> <li>ZZ * RR</li> <li>ZZ * ZZ</li> <li><span>QQ * BettiTally, see <span><a href="___Betti__Tally.html" title="the class of all Betti tallies">BettiTally</a> -- the class of all Betti tallies</span></span></li> <li><span>ZZ * BettiTally, see <span><a href="___Betti__Tally.html" title="the class of all Betti tallies">BettiTally</a> -- the class of all Betti tallies</span></span></li> <li><span>Constant * RingElement, see <span><a href="___Constant.html" title="">Constant</a></span></span></li> <li><span>RingElement * Constant, see <span><a href="___Constant.html" title="">Constant</a></span></span></li> <li><span>Expression * Expression, see <span><a href="___Expression.html" title="the class of all expressions">Expression</a> -- the class of all expressions</span></span></li> <li><span><a href="___Ideal_sp_st_sp__Ideal.html" title="product of ideals">Ideal * Ideal</a> -- product of ideals</span></li> <li><span>Ideal * MonomialIdeal, see <span><a href="___Ideal_sp_st_sp__Ideal.html" title="product of ideals">Ideal * Ideal</a> -- product of ideals</span></span></li> <li><span>MonomialIdeal * Ideal, see <span><a href="___Ideal_sp_st_sp__Ideal.html" title="product of ideals">Ideal * Ideal</a> -- product of ideals</span></span></li> <li><span><tt>InexactNumber * RingElement</tt> (missing documentation<!-- tag: (*,InexactNumber,RingElement) -->)</span></li> <li><span><a href="___Matrix_sp_st_sp__Matrix.html" title="matrix multiplication">Matrix * Matrix</a> -- matrix multiplication</span></li> <li><span><tt>RingElement * InexactNumber</tt> (missing documentation<!-- tag: (*,RingElement,InexactNumber) -->)</span></li> <li><span><a href="___Set_sp_st_sp__Set.html" title="intersection of sets">Set * Set</a> -- intersection of sets</span></li> </ul> </div> <div class="waystouse"><h2>For the programmer</h2> <p>The object <a href="__st.html" title="a binary operator, usually used for multiplication">*</a> is <span>a <a href="___Keyword.html">keyword</a></span>.</p> <div><div><p>This operator may be used as a binary operator in an expression like <tt>x*y</tt>. The user may install <a href="_binary_spmethods.html" title="">binary methods</a> for handling such expressions with code such as</p> <pre> X * Y := (x,y) -> ...</pre> <p>where <tt>X</tt> is the class of <tt>x</tt> and <tt>Y</tt> is the class of <tt>y</tt>.</p> </div> <div><p>This operator may be used as a prefix unary operator in an expression like <tt>*y</tt>. The user may <a href="_installing_spmethods.html">install a method</a> for handling such expressions with code such as</p> <pre> * Y := (y) -> ...</pre> <p>where <tt>Y</tt> is the class of <tt>y</tt>.</p> </div> </div> </div> </div> </body> </html>