1 | | As reported on [http://ask.sagemath.org/question/27196/multiplying-matrices-with-different-parents/ this ask question] |

2 | | |

3 | | {{{ |

4 | | sage: _ = var('A,B') |

5 | | sage: (A + 3*B)*Zmod(9)(6) |

6 | | 0*B |

7 | | }}} |

8 | | |

9 | | while the result should be `6*A`. |

10 | | |

11 | | It seems that the internal state of these objects is really messed up: |

12 | | {{{ |

13 | | sage: _ = var('A,B') |

14 | | sage: (3*A + 3*B)*Zmod(9)(6) # Yes, the output is really empty! |

15 | | |

16 | | sage: (3*A + 3*B)*Zmod(9)(6)*A |

17 | | ------------------------------------------------------------------------ |

18 | | Unhandled SIGSEGV: A segmentation fault occurred in Sage. |

19 | | This probably occurred because a *compiled* component of Sage has a bug |

20 | | in it and is not properly wrapped with sig_on(), sig_off(). |

21 | | Sage will now terminate. |

22 | | ------------------------------------------------------------------------ |

23 | | }}} |

| 1 | > {{{ |

| 2 | > sage: f(x) = Zmod(7)(1) * x**2 + Zmod(9)(1) * x**3 |

| 3 | > sage: f(1) |

| 4 | > 2 |

| 5 | > sage: Zmod(7)(1) + Zmod(9)(1) |

| 6 | ... |

| 7 | TypeError: unsupported operand parent(s) for '+': 'Ring of integers modulo 7' and 'Ring of integers modulo 9' |

| 8 | > }}} |