Opened 7 years ago

Closed 7 years ago

# Bug in non-commutative imap

Reported by: Owned by: aheinle@… somebody dontKnow 4-1-0 and higher singular-kernel 4-0-3 plural, imap

### Description

Dear Singular team,

```ring R = 0,(x,z),dp;
def r = nc_algebra(1,-1);
setring r;
basering;
poly h = x3z2-2x2z+x2;
h;
ring R2 = 0,(z,x),dp;
def r2 = nc_algebra(1,1);
setring r2;
basering;
poly h = imap(r,h);
h;
```

When executed, it looks like the following:

```                      SINGULAR                                 /
A Computer Algebra System for Polynomial Computations       /   version 4.0.3
0<
by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Jan 2016
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> ring R = 0,(x,z),dp;
> def r = nc_algebra(1,-1);
> setring r;
> basering;
//   characteristic : 0
//   number of vars : 2
//        block   1 : ordering dp
//                  : names    x z
//        block   2 : ordering C
//   noncommutative relations:
//    zx=xz-1
> poly h = x3z2-2x2z+x2;
> h;
x3z2-2x2z+x2
> ring R2 = 0,(z,x),dp;
> def r2 = nc_algebra(1,1);
> setring r2;
> basering;
//   characteristic : 0
//   number of vars : 2
//        block   1 : ordering dp
//                  : names    z x
//        block   2 : ordering C
//   noncommutative relations:
//    xz=zx+1
> poly h = imap(r,h);
> h;
z2x3-2zx2+x2
>

```

You see that r1 and r2 are the same ring, namely the first Weyl algebra. In the mapping of h between r and r2, it looks like the positions of z and x are just swapped without applying the commutation rule. That is not a correct mapping hence.

When using map, this bug does not occur (Courtesy to Viktor Levandovskyy for the next lines):

```> map M=r,x,z;
> M(h);
z2x3+4zx2+x2+2x
>  x3*z2-2*x2*z+x2;
z2x3+4zx2+x2+2x
```

All the best,

Albert Heinle

### comment:1 Changed 7 years ago by hannes

Resolution: → fixed new → closed
Note: See TracTickets for help on using tickets.