Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use a copy of K instead, e.g.

sage: K = diagonal_matrix( QQ, [1,2,3,4,5] )
sage: K1 = copy(K)
sage: K1[0,0] += 1
sage: K1

[2 0 0 0 0]
[0 2 0 0 0]
[0 0 3 0 0]
[0 0 0 4 0]
[0 0 0 0 5]
sage: K

[1 0 0 0 0]
[0 2 0 0 0]
[0 0 3 0 0]
[0 0 0 4 0]
[0 0 0 0 5]