1 | initial version |

Computing the n-th power of a matrix, where n is a symbolic variable, is possible.

Using that, you could solve your problem as follows.

```
sage: J = matrix([[1, 0, 0], [0, -1/2-1/2*I, 0], [0, 0, -1/2 + 1/2*I]])
sage: n = SR.var('n')
sage: J^n
[ 1 0 0]
[ 0 (-1/2*I - 1/2)^n 0]
[ 0 0 (1/2*I - 1/2)^n]
sage: J.parent()([lim(x, n=infinity) for x in (J^n).list()])
[1 0 0]
[0 0 0]
[0 0 0]
```

2 | No.2 Revision |

Computing the n-th power of a matrix, where n is a symbolic variable, is possible.

Using that, you could solve your problem as follows.

```
sage: J = matrix([[1, 0, 0], [0, -1/2-1/2*I, 0], [0, 0, -1/2 + 1/2*I]])
sage: n = SR.var('n')
sage: J^n
[ 1 0 0]
[ 0 (-1/2*I - 1/2)^n 0]
[ 0 0 (1/2*I - 1/2)^n]
sage: J.parent()([lim(x, n=infinity) for x in (J^n).list()])
[1 0 0]
[0 0 0]
[0 0 0]
```

Edit: this is simpler and more readable:

```
sage: J = matrix([[1, 0, 0], [0, -1/2-1/2*I, 0], [0, 0, -1/2 + 1/2*I]])
sage: n = SR.var('n')
sage: (J^n).apply_map(lambda x: lim(x, n=oo))
[1 0 0]
[0 0 0]
[0 0 0]
```

3 | No.3 Revision |

Computing the n-th power of a matrix, where n is a symbolic variable, is possible.

Using that, you could solve your problem as follows.

```
sage: J = matrix([[1, 0, 0], [0, -1/2-1/2*I, 0], [0, 0, -1/2 + 1/2*I]])
sage: n = SR.var('n')
sage: J^n
[ 1 0 0]
[ 0 (-1/2*I - 1/2)^n 0]
[ 0 0 (1/2*I - 1/2)^n]
sage: J.parent()([lim(x, n=infinity) for x in (J^n).list()])
[1 0 0]
[0 0 0]
[0 0 0]
```

Edit: this is simpler and more readable:

```
sage: J = matrix([[1, 0, 0], [0, -1/2-1/2*I, 0], [0, 0, -1/2 + 1/2*I]])
sage: n = SR.var('n')
sage: (J^n).apply_map(lambda x: lim(x, n=oo))
[1 0 0]
[0 0 0]
[0 0 0]
```

You could then define a function and apply it to any matrix.

```
sage: def limit_of_power(m):
....: n = SR.var('n')
....: return (m^n).apply_map(lambda x: limit(x, n=oo))
....:
sage: limit_of_power(J)
[1 0 0]
[0 0 0]
[0 0 0]
```

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.