PS sorry I forgot to mention this happens in 5.7 and 5.11 on a Mac OSX 5.6.8

On Friday, August 16, 2013 10:40:25 PM UTC+1, GaryMak wrote:
>
> Hi all
>
> I hesitate to declare a <<bug>>, since it's probably something I cannot 
> find in the help, but the following is very strange ....
>
> The following code always seems to output many vectors "quad" of length 4 
> each of whose numerical approx "quad.n()" is a vector which only has length 
> 3 ...
>
> ###########  START CODE ###########
>
> vec = vector([1.0,1.0,1.0,1.0])
> ZZ = diagonal_matrix([exp(2*pi*I/4)^ii for ii in range(0,4)])
>
> for ss in range(0,100):
>     quad = vector([0,0,0,0])
>     for jj in range(0,4):
>         indy = round(random()*4.0)
>         if len(quad.n())==3:
>             print quad.n(), quad
>         quad = quad + vec*ZZ^indy
>
> ###########  END CODE ###########
>
> I believe I have eliminated every non-essential: for example, even though 
> the loop in the vble "jj" is not explicitly used, it nevertheless seems to 
> be necessary to produce this weird behaviour, as does some complex number 
> being in the calcs, and most bizarrely, so is the fact that "indy" be 
> random! (ie it does not happen if I just fix "indy" to be 0,1,2,3 or 4).
>
> Needless to say, this is rather tricky to work around!
>
> Many thanks in advance for any help.
>
> Best regards
>
> Gary.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to