Mombu the Science Forum sponsored links

Go Back   Mombu the Science Forum > Science > Sqrt discrepancy, Mathematica
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 26th April 10:31
roger beresford
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica



In Mathematica 4.2, Sqrt[b-a] prints as -/(b-a) (Sqrt symbol), and
gives 2 when e.g. a->2,b->6
In Mathematica 5 it prints as i(a-b)^(1/2) and gives -2, not 2.
Is this do***ented, and how is it justified? It screws up a lot of my
programmes.
  Reply With Quote


  sponsored links


2 26th April 10:31
richard j. fateman
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica



Do***ented? Hah.
If it screws up a lot of your programs, then you could consider putting
Abs[] in some places. As you undoubtedly know, a positive real number
has TWO square roots. If you always want the positive one, that should
be your decision. You want Mathematica to make the decision, and
apparently it changed the way it does that between version 4.2 and 5. If
you want it to be "correct" all the time, I think it is unrealistic of
you to expect this to happen just in the simplifier for Sqrt[].
RJF
  Reply With Quote
3 26th April 10:31
jean-marc gulliet
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


I do not have at hand Mathematica 5.0 so I cannot check the behavior of
Sqrt for this specific version now. However, as far as I remember, I
have never noticed this behavior (I have used Mathematica since version
4.1.) Moreover, the do***entation about Sqrt does not record any change
since version 3.0 [1].

I suspect that you have some packages loaded in the kernel at some point
during the session, packages that modify the regular behavior of Sqrt
and force it to express the square root in terms of complex numbers.
Here is what I get with version 5.2:

In[1]:=
Sqrt[b - a]

Out[1]=
Sqrt[-a + b] In[2]:=
Sqrt[b - a] /. {a -> 2, b -> 6}

Out[2]=
2

In[3]:=
$Version

Out[3]=
"5.2 for Microsoft Windows (June 20, 2005)"

HTH,
Jean-Marc

[1] http://do***ents.wolfram.com/mathematica/functions/Sqrt
  Reply With Quote
4 26th April 10:31
roger beresford
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


snip

Apologies - this error only appears when I load a recently revised
Mathematica 5.0 package, which I had made compatible with Mathematica
4.2. It disappears when I Quit[]. I shall report back if I find what I
did wrong.
Roger Beresford.
  Reply With Quote
5 26th April 10:31
dana
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


Would this debugging technique work?

Sqrt[b-a] // Trace

--
HTH. :>)
Dana
Windows XP, Mathematica 5.2
  Reply With Quote
6 26th April 10:32
roger beresford
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


Thanks - it did.
The error appears after loading the "OPScalar" package from
Mathsource/4291. This provides a non-commutative "diamond" operator,
overwriting "**" . I shall now abandon my search for a non-commutative
extension to the determinant function. (I was not getting anywhere with it.)
  Reply With Quote
7 26th April 10:32
peter pein
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


Roger Beresford schrieb:


I guess you're writing about
http://library.wolfram.com/infocenter/MathSource/4271/ ,
not 4291.
  Reply With Quote
8 26th April 10:32
rusin
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


I'm not sure what this means but if you mean you want another function
"det2" defined for n x n matrices which has the property that
det2( A B ) = det2( A ) det2( B )
but whose values are not commutative (e.g. you want
det2 : M_n( R ) --> M_k( R )
for some k > 1 ) then your options are kind of limited.

First of all, this would make (the restriction of) det2 into a
homomorphism defined on the group GL_n(R) , a group which is
pretty close to being simple; if you want the values of det2 to
form a non-commutative group then the kernel of det2 cannot
contain all of SL_n and so it will have to be pretty small
(contained in the center of GL_n, which is the group of diagonal
matrices). In other words, such a det2 will be pretty
close to an injection; you will lose an important characteristic
of the ordinary determinant function, namely, that det(A) contains
some key information about A in a very small package.


Secondly, if you want homomorphisms of the semigroup M_n(R) into
matrix semigroups, and if you add the "algebraic" restriction that
det2( A ) must have all of its entries expressible as polynomials
(or even rational functions) of the entries in A, then there is
a recipe for creating all of them. For any fixed integer m, we can
view each matrix A as acting on an (n m)-dimensional vector space
(R^n) \tensor (R^n) \tensor ... \tensor (R^n) ; the action of M_n( R )
on this vector space is not irreducible when m > 1, but it is the
direct sum of irreducible components. Those summands give all such
homomorphisms.

For example if n = m = 2 you can split the action of M_2(R) on a
4-dimensional vector space into two components: the action on the
1-dimensional subspace of symmetric tensors ( v \tensor w + w \tensor v )
is the determinant mapping; there is also the 3-dimensional subspace
of anti-symmetric tensors which is its orthogonal complement, and
M_2(R) acts on this subspace too. If you choose a basis for it you
can write this "det2(A)" as a 3x3 matrix of quadratic polynomials
in the entries of the matrix A = ( ( a b ) ( c d ) ) , just as
det(A) = ( a d - b c ) is a 1x1 matrix of quadratic polynomials.

This is all very well-established stuff relating representations of
M_n(R) to those of the symmetric group S_m .

dave
  Reply With Quote
9 26th April 10:32
roger beresford
External User
 
Posts: 1
Default Sqrt discrepancy, Mathematica


To Peter Pein - More apologies - for faulty proofreading. Your link is
correct.

To Dave Rusin,
Thank you for your exposition, which (I must confess) I do not fully
understand. It may not be relevant, for you are looking at det2 in the
context of arrays as matrices. I need a function (cadet?) that relates
to arrays as vector-division Cayley tables, such as the Octonion
algebra. It is well known that octonions cannot be described by matrix
multiplication without an extension to the concept of a matrix.
The Sqrt discrepancy was a distraction from my investigation of
determinant conservation in non-abelian algebras; it has delayed my
introduction of a new thread "Non-Abelian Vector multiplication
"pseudo-powers". I suggest that further discussion is deferred for a
day or two, until this appears.
Roger Beresford.
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666