Ask Your Question

phoenix's profile - activity

2023-08-06 11:25:59 +0200 received badge  Famous Question (source)
2023-06-01 12:10:08 +0200 received badge  Famous Question (source)
2021-10-07 14:11:32 +0200 received badge  Popular Question (source)
2020-10-29 04:13:26 +0200 received badge  Famous Question (source)
2020-02-23 16:56:12 +0200 received badge  Notable Question (source)
2018-06-07 14:43:58 +0200 received badge  Popular Question (source)
2017-11-15 07:25:18 +0200 received badge  Notable Question (source)
2017-02-15 19:10:26 +0200 received badge  Popular Question (source)
2017-01-15 00:04:54 +0200 received badge  Famous Question (source)
2017-01-10 23:09:25 +0200 received badge  Popular Question (source)
2017-01-10 23:09:25 +0200 received badge  Notable Question (source)
2016-12-08 10:56:46 +0200 received badge  Notable Question (source)
2016-12-08 10:56:46 +0200 received badge  Popular Question (source)
2016-09-22 13:32:57 +0200 received badge  Famous Question (source)
2016-04-04 19:06:15 +0200 received badge  Student (source)
2015-08-31 15:45:13 +0200 received badge  Notable Question (source)
2015-07-24 13:54:58 +0200 received badge  Popular Question (source)
2015-05-10 01:23:31 +0200 received badge  Commentator
2015-05-10 01:23:31 +0200 commented answer Can I use the block_matrix command to create arbitrary sizes of block matrix arrays?

Some basic things about matrices don't seem to work, like, Z = matrix([[1,0],[2,3]]) Z.charpoly(y)

2015-05-09 23:42:06 +0200 commented answer Can I use the block_matrix command to create arbitrary sizes of block matrix arrays?

Thats a very generic description. Is there something specific which helps?

2015-05-09 20:40:56 +0200 asked a question Can I use the block_matrix command to create arbitrary sizes of block matrix arrays?

Like say I want to create a $4k \times 4k$ size matrix by putting together certain $4\times 4$ matrices into a $k \times k$ array.

  • Can the "block_matrix" command help me create such a $4k \times 4k$ array of 0s called $A$ ? (such later I can say something like $A[a,b] = X$ where $0 \leq a,b \leq k$ and $X$ is some $4\times 4$ matrix and that will assign the matrix $X$ at the $(a,b)$ array position)
2015-05-09 20:25:54 +0200 commented answer How to build a matrix thought of as an array of smaller matrices?

(3) And why is "d={}" different from starting as "d=[]" ?

2015-05-09 20:19:49 +0200 commented answer How to build a matrix thought of as an array of smaller matrices?

(2) Can you explain this " m = [[matrix(2, 2, 0)]*4 for _ in range(4)]" ? What exactly is this doing? Is m not defined as a matrix at this step?

2015-05-09 20:04:06 +0200 commented answer How to build a matrix thought of as an array of smaller matrices?

(1) Why does $d[0,2]$ make sense? $d$ is not a matrix but just an empty list. If assigning matrices to $d$'s tuple coordinates make sense then why not just read the data and list and assign the appropriate matrices to d's corresponding positions?

2015-05-08 19:38:32 +0200 asked a question How to build a matrix thought of as an array of smaller matrices?

Say I am given a data set which looks like $[ (0,2,A), (0,3,B), (1,2,C), (1,4,D) ]$ where $A,B,C,D$ are matrices all of the same dimension say $k$. (the data set will always have unique pairs of integers - as in if (1,2,) tuple occurs then (2,1,) tuple will not occur)

Now I want to create a 4x4 matrix say X of dimension $4k$ thought of as a 4x4 array of k-dimensional matrices. The arrays in $X$ are to be defined as $X(0,2) = A, X(2,0) = A^{-1}, X(0,3) = B, X(3,0) = B^{-1}, X(1,2) = C, X(2,1) = C^{-1}, X(1,4) = D, X(4,1) = D^{-1}$ and all other array positions in $X$ are to be filled in with $0$ matrices of dimension $k$.

  • How can one create such a X on SAGE?

    X is a matrix of matrices and I am not sure how one can define this on SAGE. Like saying "X(0,3) = B" is not going to make any obvious sense to SAGE. I necessarily need X to be a matrix so that i can later say calculate its characteristic polynomial.

[I showed this above example with just $4$ tuples. I want to eventually do it with much larger data sets]

2015-05-08 18:55:48 +0200 asked a question How does one install Sage in windows?

Can someone help me with the process?

I downloaded a .ova and a .vmdk file from the mirror

Now what?

2015-05-08 03:39:01 +0200 commented answer How can I get Sage to go over all possible maps between two sets?

Why is this slightly modified thing not working? def All_Maps(A,B): from itertools import product k = len (A) return product(B,repeat = k)

for f in All_Maps ([a,b],[0,1]): print f

2015-05-08 03:36:43 +0200 commented answer How can I get Sage to go over all possible maps between two sets?

Is that "repeat" a command?

2015-05-03 00:25:28 +0200 asked a question How can I get Sage to go over all possible maps between two sets?

What I want to do is this : Say I take a graph $K_{n,n}$ and choose an ordering for each edge arbitrarily - say denote each edge as $(i,j)$ where $i$ is in the left partition and $j$ is in the right partition. I have a set of matrices $A = { A_1, A_2,...,A_k }$. I want to iterate over all possible ways in which one could have assigned an A matrix to an edge of this graph.

  • How does one do that? (..apart from writing a massive sequence of nested loops!..)
2015-05-03 00:07:21 +0200 received badge  Scholar (source)
2015-02-10 18:52:32 +0200 commented answer How does one get Sage to make random choices?

Thanks! Somehow I got confused!

2015-02-10 03:46:36 +0200 commented answer How does one get Sage to make random choices?

@tmonteil I don't know in what kind of a course can this be a homework :D I am a researcher who recently started using Python and Sage for my research! Back to the question : I don't understand what you are saying. Roughly I would think that one needs to simulate a coin toss where heads come with probability $f(x)$. How is that equivalent to comparing $f(x)$ to a randomly generated number in the interval $[0,1]$ ? (If the two options are $a$ and $b$ then say I want to choose $a$ with a probability $f(x)$ and $b$ with a probability $1-f(x)$ and then I guess you mean that this is equivalent to choosing $a$ if the random number is (greater? or lesser?) then $f(x)$ or else otherwise?) I am not getting you.

2015-02-09 22:54:11 +0200 asked a question How does one get Sage to make random choices?

Like say in the middle of a code I compute a function value $f(x)$ and I knwo that $0 \leq f(x) \leq 1$. Now I want to write an if-then-else which will do one option with probability $f(x)$ and the other otion with probability $1-f(x)$. How does one make Sage do this?

Can somoen kindly show a template example to simulate this?

2015-01-20 21:57:03 +0200 received badge  Editor (source)
2015-01-20 21:55:47 +0200 asked a question About roots of a certain polynomial equation

Why is Sage hanging up trying to find roots of this equation?

0 = (x^2 - 6.00000000000000)*x^2 - 4*x*(e^(2/5*I*pi) + e^(-2/5*I*pi)) - e^(4/5*I*pi) - e^(-4/5*I*pi) - 1
2015-01-20 21:53:22 +0200 commented answer How to pick out the largest root of an equation?

If some of the roots turned out to be complex then would "max" throw up some kind of an error message which as an user I can catch ?