Difference between revisions of "ApCoCoA-1:NC.Add"

From ApCoCoAWiki
(New page: <command> <title>Gbmr.MRAdd</title> <short_description> Addition of two polynomials over a monoid ring. </short_description> <syntax> Gbmr.MRAdd(X:STRING, Ordering:STRING, R:LIST, F1:LIST,...)
 
m (replaced <quotes> tag by real quotes)
 
(72 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
{{Version|1}}
 
<command>
 
<command>
<title>Gbmr.MRAdd</title>
+
<title>NC.Add</title>
 
<short_description>
 
<short_description>
Addition of two polynomials over a monoid ring.
+
Addition of two polynomials in a non-commutative polynomial ring.
 
</short_description>
 
</short_description>
 
<syntax>
 
<syntax>
Gbmr.MRAdd(X:STRING, Ordering:STRING, R:LIST, F1:LIST, F2:LIST):LIST
+
NC.Add(F1:LIST, F2:LIST):LIST
 
</syntax>
 
</syntax>
 
<description>
 
<description>
 
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them.
 
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them.
 +
<par/>
 +
Please set non-commutative polynomial ring (via the command <ref>ApCoCoA-1:Use|Use</ref>) and word ordering (via the function <ref>ApCoCoA-1:NC.SetOrdering|NC.SetOrdering</ref>) before calling this function. The default word ordering is the length-lexicographic ordering ("LLEX"). For more information, please check the relevant commands and functions.
 
<itemize>
 
<itemize>
<item>@param <em>X:</em> an finite set of letters. It is of STRING type. Notice that every letter in <tt>X</tt> MUST appear only once.The order of letters in <tt>X</tt> is very important, since it induces a term ordering.</item>
+
<item>@param <em>F1, F2:</em> two non-commutative polynomials, which are left and right operands of addition respectively. Each polynomial is represented as a LIST of LISTs, and each element in every inner LIST involves only one indeterminate or none (a constant). For example, the polynomial <tt>f=2x[2]y[1]x[2]^2-9y[2]x[1]^2x[2]^3+5</tt> is represented as F:=[[2x[1],y[1],x[2]^2], [-9y[2],x[1]^2,x[2]^3], [5]]. The zero polynomial <tt>0</tt> is represented as the empty LIST [].</item>
<item>@param <em>Ordering:</em> a term ordering induced by the order of letters in <tt>X</tt>. It is represented as a STRING, which is a shortened-form of a name of corresponding term ordering. Notice that <quotes>LLEX</quotes> (length-lexicographic ordering) and <quotes>ELIM</quotes> (elimination ordering) are the only orderings supported currently.</item>
+
<item>@return: a LIST which represents the polynomial equal to <tt>F1+F2</tt>.</item>
<item>@param <em>R:</em> a finite set of relations and it is of LIST type. Each element in <tt>R</tt> has form <tt>[w_{l}, w_{r}]</tt>, where w_{l} and w_{r} are terms in M. Each term is represented as a STRING. For example, xy^2x is represented as <quotes>xyyx</quotes>, identity element is represented as an empty STRING <quotes></quotes>, and relation (yx, xy) is represented as <tt>[<quotes>yx</quotes>, <quotes>xy</quotes>]</tt>.</item>
 
<item>@param <em>F1, F2:</em> two polynomials, where are left and right operands of addition respectively. Each polynomial is represented as a LIST of LISTs, which are pairs of form <tt>[a_{i}, w_{i}]</tt>. For example, polynomial <tt>F:=xy-y+1</tt> is represented as <tt>F:=[[1,<quotes>xy</quotes>], [-1, <quotes>y</quotes>], [1,<quotes></quotes>]]</tt>. Zero polynomial is represented as an empty LIST <tt>[]</tt>.</item>
 
<item>@return: a LIST which represents a polynomial equal to <tt>F1+F2</tt>.</item>
 
 
</itemize>
 
</itemize>
 
<example>
 
<example>
X := <quotes>abc</quotes>;
+
USE ZZ/(31)[x[1..2],y[1..2]];
Ordering := <quotes>LLEX</quotes>; 
+
F1:= [[2x[1],x[2]], [13y[2]], [5]]; -- 2x[1]x[2]+13y[2]+5
Relations := [[<quotes>aa</quotes>,<quotes></quotes>], [<quotes>bb</quotes>,<quotes></quotes>], [<quotes>ab</quotes>,<quotes>c</quotes>], [<quotes>ac</quotes>, <quotes>b</quotes>], [<quotes>cb</quotes>, <quotes>a</quotes>]];
+
F2:= [[2y[1],y[2]], [19y[2]], [2]]; -- 2y[1]y[2]+19y[2]+2
F1 := []; -- F1=0
+
NC.Add(F1,F2);
F2 := []; -- F2=0
 
Gbmr.MRAdd(X, Ordering, Relations, F1,F2);
 
ERROR: Undefined indeterminate e
 
CONTEXT: $cocoa5.PrintTime(1 * e - 05)
 
-------------------------------
 
[ ]
 
-------------------------------
 
 
 
X := <quotes>abc</quotes>; 
 
Ordering := <quotes>LLEX</quotes>; 
 
Relations := [[<quotes>aa</quotes>,<quotes></quotes>], [<quotes>bb</quotes>,<quotes></quotes>], [<quotes>ab</quotes>,<quotes>c</quotes>], [<quotes>ac</quotes>, <quotes>b</quotes>], [<quotes>cb</quotes>, <quotes>a</quotes>]]; 
 
F1 := []; -- F1=0 
 
F2 := [[1,<quotes>b</quotes>],[1,<quotes>ba</quotes>]]; -- F2=b+ba
 
Gbmr.MRAdd(X, Ordering, Relations, F1,F2);
 
ERROR: Undefined indeterminate e
 
CONTEXT: $cocoa5.PrintTime(33 / 10 * e - 05)
 
-------------------------------
 
[[1, <quotes>ba</quotes>], [1, <quotes>b</quotes>]]
 
-------------------------------
 
  
X := <quotes>abc</quotes>; 
+
[[2x[1], x[2]], [2y[1], y[2]], [y[2]], [7]]
Ordering := <quotes>LLEX</quotes>; 
 
Relations := [[<quotes>aa</quotes>,<quotes></quotes>], [<quotes>bb</quotes>,<quotes></quotes>], [<quotes>ab</quotes>,<quotes>c</quotes>], [<quotes>ac</quotes>, <quotes>b</quotes>], [<quotes>cb</quotes>, <quotes>a</quotes>]]; 
 
F1 := [[1,<quotes>a</quotes>],[1,<quotes></quotes>]]; -- F1=a+1 
 
F2 := [[1,<quotes>b</quotes>],[1,<quotes>ac</quotes>]]; -- F2=b+ac=2b
 
Gbmr.MRAdd(X, Ordering, Relations, F1,F2);
 
ERROR: Undefined indeterminate e
 
CONTEXT: $cocoa5.PrintTime(24 / 10 * e - 05)
 
 
-------------------------------
 
-------------------------------
[[1, <quotes>a</quotes>], [2, <quotes>b</quotes>], [1, <quotes></quotes>]]
+
</example>
-------------------------------</example>
 
 
</description>
 
</description>
 
<seealso>
 
<seealso>
<see>Gbmr.MRSubtract</see>
+
<see>ApCoCoA-1:Use|Use</see>
<see>Gbmr.MRMultiply</see>
+
<see>ApCoCoA-1:NC.SetOrdering|NC.SetOrdering</see>
<see>Gbmr.MRBP</see>
+
<see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
<see>Gbmr.MRIntersection</see>
 
<see>Gbmr.MRKernelOfHomomorphism</see>
 
<see>Gbmr.MRMinimalPolynomials</see>
 
<see>Introduction to CoCoAServer</see>
 
 
</seealso>
 
</seealso>
 
<types>
 
<types>
 
<type>apcocoaserver</type>
 
<type>apcocoaserver</type>
<type>groebner</type>
+
<type>polynomial</type>
 +
<type>non_commutative</type>
 
</types>
 
</types>
<key>gbmr.MRAdd</key>
+
<key>ncpoly.Add</key>
<key>MRAdd</key>
+
<key>NC.Add</key>
<wiki-category>Package_gbmr</wiki-category>
+
<key>Add</key>
 +
<wiki-category>ApCoCoA-1:Package_ncpoly</wiki-category>
 
</command>
 
</command>

Latest revision as of 13:33, 29 October 2020

This article is about a function from ApCoCoA-1.

NC.Add

Addition of two polynomials in a non-commutative polynomial ring.

Syntax

NC.Add(F1:LIST, F2:LIST):LIST

Description

Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.

Please set non-commutative polynomial ring (via the command Use) and word ordering (via the function NC.SetOrdering) before calling this function. The default word ordering is the length-lexicographic ordering ("LLEX"). For more information, please check the relevant commands and functions.

  • @param F1, F2: two non-commutative polynomials, which are left and right operands of addition respectively. Each polynomial is represented as a LIST of LISTs, and each element in every inner LIST involves only one indeterminate or none (a constant). For example, the polynomial f=2x[2]y[1]x[2]^2-9y[2]x[1]^2x[2]^3+5 is represented as F:=[[2x[1],y[1],x[2]^2], [-9y[2],x[1]^2,x[2]^3], [5]]. The zero polynomial 0 is represented as the empty LIST [].

  • @return: a LIST which represents the polynomial equal to F1+F2.

Example

USE ZZ/(31)[x[1..2],y[1..2]];
F1:= [[2x[1],x[2]], [13y[2]], [5]]; -- 2x[1]x[2]+13y[2]+5
F2:= [[2y[1],y[2]], [19y[2]], [2]]; -- 2y[1]y[2]+19y[2]+2
NC.Add(F1,F2);

[[2x[1], x[2]], [2y[1], y[2]], [y[2]], [7]]
-------------------------------

See also

Use

NC.SetOrdering

Introduction to CoCoAServer