Skip to content

Commit

Permalink
added is_commutative_ring -> false for FreeAlgebra
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Oct 30, 2024
1 parent 490000a commit d594308
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions M2/Macaulay2/e/M2FreeAlgebra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class M2FreeAlgebraOrQuotient : public Ring
virtual const M2FreeAlgebraOrQuotient * cast_to_M2FreeAlgebraOrQuotient() const { return this; }
virtual M2FreeAlgebraOrQuotient * cast_to_M2FreeAlgebraOrQuotient() { return this; }

bool is_commutative_ring() const { return false; }
};

class M2FreeAlgebra : public M2FreeAlgebraOrQuotient
Expand Down
4 changes: 3 additions & 1 deletion M2/Macaulay2/e/M2FreeAlgebraQuotient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class M2FreeAlgebraQuotient : public M2FreeAlgebraOrQuotient

int numVars() const { return monoid().numVars(); }
int n_vars() const { return numVars(); }


bool is_quotient_ring() const { return true; }

// these are all the functions from Ring that must exist for M2FreeAlgebraQuotient to be instantiated
virtual int index_of_var(const ring_elem a) const;

Expand Down
13 changes: 13 additions & 0 deletions M2/Macaulay2/tests/normal/ringmap7.m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
needsPackage "WeylAlgebras"
needsPackage "AssociativeAlgebras"

D = ZZ/101[x,dx, WeylAlgebra => {x => dx}]
R = ZZ/101<|dy,y|>/(dy*y - 1 - y*dy)

f = map(R, D, {y,dy})

assert(f(dx*x) == y*dy+1)
assert(f(x*dx) == y*dy)

assert(f(dx*x^2) == y^2*dy+2*y)
assert(f(x^2*dx) == y^2*dy)

0 comments on commit d594308

Please sign in to comment.