Do I always have to write "self." ?

Andrew Dalke dalke at acm.org
Thu May 4 17:03:58 EDT 2000


Charles Hixson wrote:
> I don't really recall, h_bar may indeed be a dimensionless quantity.
> There are a few of them.  But c has the dimensionality of velocity
> (i.e., delta d / delta t).  Exactly which units you choose to use are
> up to your convenience.  If you choose them appropriately, c will
> equal 1 * (3,000,000 m)/(1 year), which specifies the ratio that your
> units must have in order for the value of c to equal 1.


h bar isn't not unitless; it's 1.0546 × 10-34 Joule*sec.

But yes, it's done by assuming units that make those values == 1.

My point, though, it that the units are not actually tracked when
doing the math.  Samuel A. Falvo II had said:

]  I see it as a tool a programmer can use to keep things
]  straight in his head, and on paper, precisely as a Physicist
]  would use units to keep things straight in his/her head.

and that doesn't occur.  The units are thrown away, and reconstituted
at the end to get the right standard units.

Quoting from "Quarks and Leptons" by Halzen and Martin:

   At this stage, it is necessary to break the flow of the
   physics discussion and to introue units appropriate to particle
   physics.  The two fundamental constants of relativistic quantum
   mechanics are Planck's constant, h, and the velocity of light
   in vacuo, c

          h bar == h/(2 pi) == 1.055E-34 J sec
          c == 2.998E08 m/sec

     It is convenient to use a system of units in which h bar is
   one unit of action (ML**2/T) and c is one unit of velocity (L/T).
   Our system of units will be completely defined if we now specify,
   say, our unit of energy (ML**2/T**2).  In particle physics, it is
   common to measure quantities in units of GeV (1GeV == 10**9
   electron volts), a choice motivated by the fact that the rest
   energy of the proton is roughly 1GeV.

     By choosing units with h bar == c == 1, it becomes unnecessary
   to write h bar and c explicitly in the formulas, thus saving a
   lot of time and trouble.  We can always use dimensional analysis
   to work out unambiguously where the h bar's and c's enter any
   formula.  Hence, with a slight by permissible laziness, it is
   customary to speak of mass (m), momentum (mc) and energy (mc**2)
   all in terms of GeV, and to measure length (h bar/mc) and time
   (Hbar / mc**2) in units of GeV**-1.


I think this quote is relevant to the discussion, because I think
tracking units is helpful while learning to program, but can be
ignored when you gain enough experience.  Hungarian notation can
be considered similarly, although I think they are not really needed
outside of untyped languages (like the assembly language notation
from where it came).

                    Andrew
                    dalke at acm.org







More information about the Python-list mailing list