Ask Your Question
1

identity matrix

asked 8 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 8 years ago

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.

Preview: (hide)
link

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: 8 years ago

Seen: 1,970 times

Last updated: Jan 05 '17