[sage-support] Re: Function defined with matrices won't plug in values for function

2018-11-30 Thread Nils Bruin
On Friday, November 30, 2018 at 1:59:40 PM UTC-8, saad khalid wrote: > > However, when I try to compute this h(.1), the function doesn't plug in .1 > in for s in the function, and it returns: > > [ s + 1 0] > [ 0 -s + 1] > > > What exactly is happening? > > The problem is that a matrix ov

Re: [sage-support] Function defined with matrices won't plug in values for function

2018-11-30 Thread saad khalid
I'm quite confused, why do you think this is not implemented? It seems like the kind of thing that is so simple, it should "just work." Is there some strange complication that could arise by defining it over SR that I'm not thinking of? I feel like it should be possible to define the function an

[sage-support] Re: Weird behavior in sagecell

2018-11-30 Thread david.guichard
Thanks! On Friday, November 30, 2018 at 5:02:27 PM UTC-8, slelievre wrote: > > > Fri 2018-11-30 23:43:00 UTC, David Guichard: >> >> In this page, >> >> http://skink.whitman.edu/~guichard/sage/two_plots_clean.html >> >> I have two sagecells, each to do a 3d plot. If I evaluate the first one, >> it

Re: [sage-support] Re: Weird behavior in sagecell

2018-11-30 Thread Samuel Lelièvre
Sat 2018-12-01 01:02 UTC, slelievre: > > Fri 2018-11-30 23:43 UTC, David Guichard: >> >> In this page, >> >> http://skink.whitman.edu/~guichard/sage/two_plots_clean.html >> >> I have two sagecells, each to do a 3d plot. If I evaluate the first one, it >> works as expected. If I then evaluate the s

[sage-support] Re: Weird behavior in sagecell

2018-11-30 Thread slelievre
Fri 2018-11-30 23:43:00 UTC, David Guichard: > > In this page, > > http://skink.whitman.edu/~guichard/sage/two_plots_clean.html > > I have two sagecells, each to do a 3d plot. If I evaluate the first one, > it works as expected. If I then evaluate the second, it graphs correctly, > but it also r

[sage-support] Weird behavior in sagecell

2018-11-30 Thread david.guichard
In this page, http://skink.whitman.edu/~guichard/sage/two_plots_clean.html I have two sagecells, each to do a 3d plot. If I evaluate the first one, it works as expected. If I then evaluate the second, it graphs correctly, but it also replaces the first plot with a copy of the second. Neither of

Re: [sage-support] Function defined with matrices won't plug in values for function

2018-11-30 Thread Dima Pasechnik
It seems that doing this kind of thing over SR is not implemented. However, you can do something like this: R.=QQ[] Mz = matrix(R,[[0,1],[1,0]]) Mx = matrix(R,[[1,0],[0,-1]]) M1 = matrix(R,[[1,0],[0,1]]) h = M1 + s*Mx sage: h(s=1/2) [3/2 0] [ 0 1/2] Here h is a matrix with entries in R, and su

[sage-support] Function defined with matrices won't plug in values for function

2018-11-30 Thread saad khalid
Hi all, I'm not sure what is happening, but I defined some matrices: Mz = matrix([[0,1],[1,0]]) Mx = matrix([[1,0],[0,-1]]) M1 = matrix([[1,0],[0,1]]) And then I tried defining a function where I multiply these matrices by some variable and add them together: h(s) = M1 + s*Mx h(.1) However, wh

[sage-support] Pauli matrices

2018-11-30 Thread saad khalid
Hey everyone: Perhaps I am missing something very obvious, but is there an implementation of the pauli spin matrices in Sage? They are simple enough to define, but ubiquitous enough that I would have assumed they were predefined. -- You received this message because you are subscribed to the