The HashTable H should contain monomials as keys and polynomials as values, all of which should lie in the same ring. The keys represent monomials of each term (in $dx$ variables), and the value represent the coefficient.
i1 : R = QQ[x,y] o1 = R o1 : PolynomialRing |
i2 : H = new HashTable from {x^2 => x+y+3, y^2*x^5 => 2*x}
2
o2 = HashTable{x => x + y + 3}
5 2
x y => 2x
o2 : HashTable
|
i3 : D1 = diffOp H
5 2 2
o3 = 2x*dx dy + (x + y + 3)dx
o3 : DiffOp
|
Alternatively, diffOp can also create differential operators from lists of key => value pairs
i4 : D2 = diffOp {x^2 => x+y+3, y^2*x^5 => 2*x}
5 2 2
o4 = 2x*dx dy + (x + y + 3)dx
o4 : DiffOp
|
i5 : D1 == D2 o5 = true |
For a simpler way of creating differential operators, see diffOp(RingElement).
The constructors new DiffOp from HashTable and new DiffOp from List are for internal use only. Use diffOp(HashTable) and diffOp(List) instead.