Ask Your Question
1

identity matrix

asked 2017-01-05 19:47:54 +0200

Alan gravatar image

The square root of -1 is represented by I (as well as the usual i). The identity matrix of size n is represented by identity_matrix(n). It seems to me that a better choice would be I(n), but that isn't there. Why is happening here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-05 20:29:36 +0200

nbruin gravatar image

There are many notions and only a limited number of symbols. Symbols have different meanings in in different areas of mathematics, but in a computer algebra system a symbol can only be bound to one object at a time. I expect that i is I was introduced because of compatibility with other packages, and because "i" gets used as a counting variable very often, so is rather unsuitable as a symbol representing sqrt(-1).

If you want to use I(n) you can by setting I=identity_matrix at the start of your session (or even in your startup file .sage/init.sage). Just make sure to include that binding whenever you share code with other people who might not use it by default.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-01-05 19:47:54 +0200

Seen: 948 times

Last updated: Jan 05 '17