Skip to content

Commit

Permalink
Attempted fix of Macaulay2#2907 by ringmap.cpp change
Browse files Browse the repository at this point in the history
Tried adding block to ringmap code to detect the weyl algebra and change
how ring maps are computed.
Changed the order of multiplication for weyl algebras.
This did not seem to alter the behavior in the reference issue.
  • Loading branch information
mdebellevue authored and mahrud committed Oct 30, 2024
1 parent 490000a commit 70546d2
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions M2/Macaulay2/e/ringmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,27 @@ ring_elem RingMap::eval_term(const Ring *sourceK, // source coeff ring
result_monom = M->make_one();
temp_monom = M->make_one();
}

if (!R->is_commutative_ring() || R->cast_to_SchurRing())
if (R->is_weyl_algebra())
{
for (index_varpower i = vp; i.valid(); ++i)
{
int v = first_var + i.var();
int e = i.exponent();
ring_elem g;
if (e >= 0)
g = _elem[v].bigelem;
else
g = R->invert(_elem[v].bigelem);
for (int j = 0; j < e; j++)
{
assert(v < nvars);
ring_elem tmp = R->mult(result, g);
R->remove(result);
result = tmp;
}
}
}
else if (!R->is_commutative_ring() || R->cast_to_SchurRing())
{
// This is the only non-commutative case so far
for (index_varpower i = vp; i.valid(); ++i)
Expand Down

0 comments on commit 70546d2

Please sign in to comment.