MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: RE: Why do parentheses spuriously appear when I type in a formula?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34597] RE: [mg34553] RE: [mg34410] Why do parentheses spuriously appear when I type in a formula?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 29 May 2002 02:45:17 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hatmut and Bobby,

Why fight this parentheses war? It appears to be an inaccessible internal
part of Mathematica processing. Even if it is solved, is it a great way to
enter tensors? The idea of using a lot of Ctrl's to maneuver around the box
structure is not appealing if I have a number of tensors to enter.

I have attached a notebook that shows an alternative method for entering
tensors. Carl Woll helped me develop this. (It intially also had a
parentheses problem, this time on output.) Those in MathGroup who are
interested can contact me for the notebook.

I represent a tensor on input and output as a label followed by a two row,
GridBox. The GridBox is really just a matrix and it provides nice up and
down placement of the indices. I define overall parameters that control the
font sizes and spacings of the output format. The user can set alter
parameters. I define an alias for the input form that is entered by esc
tform esc. This brings up placeholders for the label and first up/down slot
of the tensor. Additional slots are easily provided with a Ctrl-comma, as is
down with any matrix. Instead of having to maneuver up and down, you can
just use Tab to go between the slots. The MakeExpression routine then
converts to an internal Tensor[label,indices] format. (I'm leaving the exact
internal tensor format vague in this communication - because that is also a
subject of debate.) Tensor labels are declared and in the input/output box
expressions the label is bound to the GridBox with an InvisibleApplication.
Application binds fairly tightly and that eliminates the parentheses between
tensors on output.

If you are really entering a lot of tensors in a notebook it is probably
even easier to define shortcuts, say,

g[i_,j_]:= Tensor[g, i and j as down indices]

and if you have a palette with the Tensor format on it, that cuts down more
on the typing.

What is easiest in everyday use should be the criterion for methods of
tensor entry.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


> From: DrBob [mailto:majort at cox-internet.com]
To: mathgroup at smc.vnet.net
>
> >>There is a clear visual difference between the two. Just compare
>
> >>Superscript[Subscript[T,b],a]
>
> >>Subscript[T,Superscript[b,a]]
>
> >>after deleting the parentheses that show up in the first case.
>
> I can't compare them, because I can't delete those parentheses!  (I
> tried.)
>
> Here are the five primary choices...
>
> {Superscript[Subscript[T, b], a],
>  Subscript[T, Superscript[b, a]],
>  Subscript[Superscript[T, a], b],
>  Subscript[T^a, b],
>  Subscript[T, b]^a}
>
> Pick the one you like.  Of these, the first apparently can't be entered
> with simple keystrokes.  The second and fifth can easily be entered with
> keystrokes.
>
> The third and fourth can be entered with keystrokes IF you delete the
> parentheses that appear automatically (but they're back if you
> evaluate).
>
> Bobby Treat
>
>


  • Prev by Date: RE: Re: In order = Out order
  • Next by Date: RE: basic operations in matrices
  • Previous by thread: Re: Why do parentheses spuriously appear when I type in a formula?
  • Next by thread: RE: RE: Why do parentheses spuriously appear when I type in a formula?