Opened 12 months ago

Last modified 12 months ago

## #25520 new defect

# Wrong 0th symbolic power of a matrix

Reported by: | tmonteil | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-8.3 |

Component: | symbolics | Keywords: | |

Cc: | mforets, slelievre | Merged in: | |

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

From this ask question, the symbolic power of a matrix gives a result that is correct when restricted to positive integers, but wrong on 0:

sage: A = matrix(QQbar,3,3,[[-2,-8,-12],[1,4,4],[0,0,1]]) sage: k = SR.var('k') sage: B = A^k sage: B [ -2^k -4*2^k -4*2^k - 4] [ 1/2*2^k 2*2^k 2*2^k] [ 0 0 1] sage: [B.subs(k=i) == A^i for i in range(20)] [False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True] sage: B.subs(k=0) [ -1 -4 -8] [1/2 2 2] [ 0 0 1]

**Note:**See TracTickets for help on using tickets.

This is not really something we can do anything about, I expect. It's just a consequence of

which is wrong for

`x=0`

.