format: text

text:
# Untitled Document

Comments on “Gauge Theory of Composite Fermions: Particle-Flux Separation in Quantum Hall Systems” by I. Ichinose and Tetsuo Matsui, cond-mat/0210142, v 2, 7 Feb.2003  Keshav N. Shrivastava School of Physics, University of Hyderabad,
Hyderabad 500046, India

We find that work of Ichinose requires far too many quasiparticles. As a result, too many parameters are introduced to fit the mass of a composite fermion (CF) and hence experimentally, it will not be possible to identify all of such quasiparticles and their masses. Further, according to Ichinose, an electron decay should occur but it has not been found. It is much too unrealistic to expect an electron decay similar to the neutron decay. If the CF is really found it is not going to be relevent to the quantum Hall effect data. Therefore, the composite fermion (CF) model of quantum Hall effect is not well founded and should be discarded.

Corresponding author: keshav@mailaps.org
Fax: +91-402-301 0145.Phone: 301 0811.

1. Introduction

It has been suggested by Ichinose et al that there is a particle-flux separation (PFS) applicable to electrons. The electron splits into a $`\mathrm{`}\mathrm{`}chargeon\mathrm{"}`$ which carries the charge and a $`\mathrm{`}\mathrm{`}fluxon\mathrm{"}`$ which carries the magnetic field. The $`\mathrm{`}\mathrm{`}chargeons\mathrm{"}`$ are similar to composite fermions (CFs) which have been utilized to understand the quantum Hall effect data in GaAs/AlGaAs. It has been suggested that PFS is similar to charge-spin separation (CSS) in which electron dissociates into holon and spinon with holon carrying the charge but not the spin and the spinon carrying spin but not the charge. There is a concept of phase transition so that there is a critical temperature at which the particle-flux separation occurs. The electron splits into two particles, a $`\eta _x`$, $`\mathrm{`}\mathrm{`}chargeon\mathrm{"}`$ which is a fermion and a $`\mathrm{`}\mathrm{`}fluxon\mathrm{"}`$ which is a boson,

$$electron=chargeon(fermion,\eta _x)+fluxon(boson,\varphi _x).$$
(1)
The masses of these particles are $`m`$ for the electron mass in vacuum, $`m_e`$ for the electron mass in a solid, $`m_\varphi `$ the fluxon mass and $`m_\eta `$ the chargeon mass. The fermion operator $`\psi _x`$ is given by the product of a fermion operator and a boson operator,

$$\psi _x=\varphi _x\eta _x.$$
(2)
Actually the correct algebra in such a case would require a product wave function which has products of fermion wave function, chargeon wave function and the fluxon wave function. Then there are creation and annihilation operators of the three quasiparticles as,

$$\mathrm{\Psi }=\psi _x\varphi _x\eta _x$$
(3)
The number densities are given by the usual product, e.g.,

$$\varphi _x^{}\varphi _x=n.$$
(4)
The conclusion of this study is that (a) there are quasiparticles, electrons in vacuum, electrons in a solid, chargeons and fluxons. By attaching two fluxons to one electron, we make a composite fermion (CF). In addition to these there are spinons and holons. The electron splits into two quasiparticles, the spinon carries the spin but not the charge and the holon which carries the charge but not the spin,

$$electron=spinon+holon$$
(5)
The bound state of a $`\mathrm{`}\mathrm{`}chargeon\mathrm{"}`$ and a $`\mathrm{`}\mathrm{`}fluxon\mathrm{"}`$ is the usual electron. Thus so many quasiparticles, electron, $`electron^{}`$, chargeon, fluxon, spinon and holon have been introduced and hence their bound states must also occur in two reactions, chargeon+fluxon = electron, chargeon+chargeon, fluxon+fluxon, chargeon+spinon, chargeon+holon, fluxon+spinon, fluxon+holon, etc.

We wish to discuss if the electromagnetic theory of these new quasiparticles is correctly described and whether the masses have been added correctly.

2. Comments.

(i) Masses

Let us write the two reactions. (a) Electron splits into a $`\mathrm{`}\mathrm{`}chargeon\mathrm{"}`$ and a $`\mathrm{`}\mathrm{`}fluxon\mathrm{"}`$, and (b) the composite fermion (CF) is made by attaching two fluxons to one electron . Therefore, the simple mass equations are,

$$m_e=m_\eta +m_\varphi (\mathrm{\Delta }_e/c^2)$$
(6)
where $`m_e`$ is the mass of the electron, $`m_\eta `$ is the mass of the chargeon and $`m_\varphi `$ is that of fluxon. We believe that chargeon and the fluxon are very tightly bound so that there is a binding energy, $`\mathrm{\Delta }_e`$, the mass equivalent of which is $`\mathrm{\Delta }_e/c^2`$. The second equation is the mass of the CF. Since, it is made by attaching two fluxons to one electron, its mass reaction should be,

$$m_{CF}=m_e+2m_\varphi (\mathrm{\Delta }_{CF}/c^2)$$
(7)
to which the binding energy has beem included. Now we have the burden of measuring the masses,

$$(1)m_e,(2)m_\eta ,(3)m_\varphi ,(4)\mathrm{\Delta }_eand(5)\mathrm{\Delta }_{CF}$$
(8)
There are far too many masses to understand the experiments on resistivity in the quantum Hall effect so that adjusting five masses to get the one, experimentally measured mass, 0.4$`m_e`$ will not lead to definite values.

(ii) Electromagnetic theory.

According to well known Maxwell equations, it is not possible for a charged particle to go round a circle and not produce a field. The chargeon of mass $`m_\eta `$ is a charged particle but it does not produce a magnetic field. The field is produced by $`\mathrm{`}\mathrm{`}fluxon\mathrm{"}`$ of mass $`m_\varphi `$ but not by $`\mathrm{`}\mathrm{`}chargeon\mathrm{"}`$. Hence, chargeons do not exist. The $`m_{CF}`$ requires the existence of $`m_\varphi `$ which according to the earlier cited reaction requires $`m_\eta `$. Since $`\mathrm{`}\mathrm{`}chargeons\mathrm{"}`$ are excluded by Maxwell equations, the CF are also excluded by the Maxwell equations. So if CF are really existing particles, then there must be a new theory. Such a new theory will have five different masses as discussed above. According to the above discussion, the magnetic vector can be carried by an independent particle of mass, $`m_\varphi `$. So the electric vector will be carried by $`m_\eta `$. This means that E and H are carried by different quasiparticles. According to Maxwell equations, the time derivative of the electric field determines the curl H and the time derivative of the magnetic field determines curl E. If E and H are coupled, the Maxwell equations will be lost, which is contrary to the experimental measurements.

Therefore, CF are new objects not consistent with Maxwell equations. So the Maxwell equations can be modified and CF can be accepted as a new basic principle but there is no evidence in favour of the variety of masses. When the electron splits into a chargeon and a fluxon, a large binding energy is released but there is no evidence for the release of such energy. Similarly, when CF breaks into an electron and two fluxons, large energy should be released but there is no evidence of such an $`\mathrm{`}\mathrm{`}electronbomb\mathrm{"}`$ or a $`CF\mathrm{`}\mathrm{`}bomb\mathrm{"}`$. Indeed, the $`\mathrm{`}\mathrm{`}electrondecay\mathrm{"}`$ is unheard off. If it is possible to attach floxons to electrons, it must be possible to detach flux from the electron. This gives rise to a $`\mathrm{`}\mathrm{`}\mathrm{𝐝𝐞𝐜𝐨𝐦𝐩𝐨𝐬𝐢𝐭𝐞}\mathrm{𝐟𝐞𝐫𝐦𝐢𝐨𝐧}\mathrm{"}`$ (DF). The CFs are large objects and can not have the same density as that of the electron. The CF model is therefore internally inconsistent and should be discarded.

3. Additional Comments.

Ref.5 shows that the experimental identification of CF by Kukushkin et al  is not justified. Ref.7 shows the lack of even feature in the data of Pan et al . Ref.9 shows the absence of ESR in the flux attached field, meaning that flux attachment formula is not correct. Ref.10 shows that the observed $`\mathrm{`}\mathrm{`}oppositespin\mathrm{"}`$ aspect is not a part of the CF model and Kumada et al  have not given the references properly. Ref.12 shows that CF model is inconsistent because it did not consider $`\mathrm{`}\mathrm{`}decompositefermions\mathrm{"}`$. Ref.4 points out several inconsistencies in the CF model for example there are far to many parameters. Ref.13 shows that the spin flip is not a part of the CF model whereas Dujovne et al  find them. Ref. shows that E and H separation is required for the CF model but it does not occur in the data of Pan et al . Ref. 17 shows that $`\mathrm{`}\mathrm{`}111\mathrm{"}`$ is is a fermion and it is not a boson due to antisymmetry and hence the results of Simon et al , require to be corrected.

4. Conclusions.

Ichinose requires that the electron should have structure and the classical electrodynamics should break down. We point out that this type of theory introduces far too many masses to be compared with only one experimental value. The experiments have compared observations with the CF model but in all cases, the identification of the data with the CF is not justified. The stringent requirement of CF model is that flux is attached to the electron. This requirement is not justified and hence the CF model should be discarded. Ichinose \[19-21\] has also published several papers on the spin-charge decoupling but these are not applicable to the data on quantum Hall effect.

About the author: Keshav Shrivastava has obtained Ph.D. degree from the Indian Institute of Technology and D. Sc. from Calcutta University. He is a member of the American Physical Society, Fellow of the Institute of Physics (U.K.)and Fellow of the National Academy of Sciences, India. He has worked in the Harvard University, University of California at Santa Barbara, the University of Houston and the Royal Institute of Technology Stockholm. He has published 170 papers in the last 40 years. He is the author of two books. Shrivastava’s paper with Roy Anderson, published in J. Chem. Phys. 48, 4599(1967) was found to be useful by M. C. R. Symons,F. R. S. The letter with K. W. H. Stevens, J. Phys. C 3, L 64 (1970) was useful to D. I. Bolef, the paper with Vincent Jaccarino,Phys. Rev. B13, 299(1976) was useful to J. B. Goodenough, F. R. S. His paper, J. Phys. C 20, L789 (1987) on the microwave absorption, was useful to K. Alex Müller. His paper published in the Proc. Roy. Soc. A419, 287- 303(1988) was communicated by B. Bleaney, F.R.S. He discovered the flux quantized energy levels in superconductors and the correct theory of 1/3 charge in quantum Hall effect.

The correct theory of quantum Hall effect is given in ref.22.

5. References

1. Ikuo Ichinose and Tetsuo Matsui, cond-mat/0210142.
2. J. K. Jain, Phys. Rev. Lett. 63, 199 (1989).
3. K. Park and J. K. Jain, 80, 437 (1998)
4. K. N. Shrivastava, cond-mat/0210320.
5. K. N. Shrivastava, cond-mat/0202459.
6. I. V. Kukushkin et al, Nature 413, 409 (2002).
7. K. N. Shrivastava, cond-mat/0204627.
8. W. Pan et al, Phys. Rev. Lett. 88, 176802(2002).
9. K. N. Shrivastava, cond-mat/0207391.
10. K. N. Shrivastava, cond-mat/0209057
11. N. Kumada, et al, Phys. Rev. Lett. 89, 116802(2002).
12. K. N. Shrivastava, cond-mat/0209666
13. K. N. Shrivastava, cond-mat/0211223.
14. Dujovne, et al, cond-mat/0211022.
15. K. N. Shrivastava, cond-mat/0301380.
16. W. Pan et al, Phys. Rev. Lett. 90, 016801(2003)
17. K. N. Shrivastava, cond-mat/0302009.
18. S. H. Simon et al, cond-mat/0301203.
19. I. Ichinose, T. Matsui and M. Onoda, Phys. Rev. B 64,104516 (2001).
20. I. Ichinose and T. Matsui, Phys. Rev. Lett. 86, 942 (C)(2001).
21. I. Ichinose and M. Matsui, Phys. Rev. B 51, 11860 (1995).
22. K.N. Shrivastava, Introduction to quantum Hall effect,
Nova Science Pub. Inc., N. Y. (2002).

Note: Ref. 22 is available from:
Nova Science Publishers, Inc.,
400 Oser Avenue, Suite 1600,
Hauppauge, N. Y.. 11788-3619,
Tel.(631)-231-7269, Fax: (631)-231-8175,
ISBN 1-59033-419-1 US$`\$69`$.
E-mail: novascience@Earthlink.net


text:
# A New Limit on Signals of Lorentz Violation in Electrodynamics

## Abstract

We describe the results of an experiment to test for spacetime anisotropy terms that might exist from Lorentz violations. The apparatus consists of a pair of cylindrical superconducting cavity-stabilized oscillators operating in the TM010 mode with one axis east-west and the other vertical. Spatial anisotropy is detected by monitoring the beat frequency at the sidereal rate and its first harmonic. We see no anisotropy to a part in $`10^{13}`$. This puts a comparable bound on four linear combinations of parameters in the general Standard Model extension, and a weaker bound of $`<4\times 10^9`$ on three others.

Tests of spacetime anisotropy are generally divided into two main classes, one involving angle dependent effects and the other absolute velocity effects. Following Robertson Robertson , a treatment of potential Lorentz invariance violations involving idealized rods and clocks was developed by Mansouri and Sexl Mansouri  who considered the possibility of an anisotropic propagation velocity of light relative to a preferred frame. In this model, if a laboratory is assumed to be moving with a velocity $`v`$ at an angle $`\theta `$ relative to the axis of a preferred frame, the speed of light as a function of $`\theta `$ and $`v`$ is given by

$`{\displaystyle \frac{c(\theta ,v)}{c}}=1+\left({\displaystyle \frac{1}{2}}\beta +\delta \right)\left({\displaystyle \frac{v}{c}}\right)^2\mathrm{sin}^2\theta `$
$`+(\beta \alpha 1)\left({\displaystyle \frac{v}{c}}\right)^2`$ (1)
where $`\alpha `$ is the time dilation parameter, $`\beta `$ is the Lorentz contraction parameter,and $`\delta `$ tests for transverse contraction. In special relativity the last two terms on the right hand side of the equation are zero. Classical Michelson-Morley experiments attempt to measure the amplitude of the $`\theta `$-dependent term, while Kennedy-Thorndyke experiments set limits on the amplitude of the $`\theta `$-independent term. While useful to help categorize experiments, this approach has a number of limitations. For example, it fails to include effects on the measurement system itself and it does not take into account the full range of anisotropies allowable in nature.

Recently Kostelecký and Mewes Kostelecky  (KM) have pointed out that in the Standard Model Extension (SME) that describes general Lorentz violations Colladay , additional terms may exist which show signatures different from those expressed in Eq. (1). In particular, $`\mathrm{sin}\theta `$ and $`\mathrm{sin}2\theta `$ terms may exist independent of $`v`$ which could be detectable in the experiments, as well as terms first order in $`v/c`$. No systematic search for these terms appears to have been undertaken in the optical experiments conducted until now, although a number of tests have been performed with fermions and with astrophysical sources ref3 . Also, experiments involving the Earth’s rotation typically use co-rotating frequency references which complicates the analysis. A simple configuration that can be analyzed easily consists of a pair of cylindrical microwave cavity resonators operating on radial modes with their axes aligned in the east-west direction and optimally at $`45^{}`$ to the Earth’s axis, as indicated in Fig. 1. This apparatus will in general have a different sensitivity to the coefficients of the Lorentz violating terms than an optical cavity experiment because of the radial nature of the wave motions involved. Each cavity will provide its own fractional offset signal $`\delta \nu /\nu `$ from its unperturbed frequency. The beat signal from such a pair, $`\mathrm{\Delta }\nu /\nu =\delta \nu _1/\nu \delta \nu _2/\nu `$, takes the general form

$`{\displaystyle \frac{\mathrm{\Delta }\nu }{\nu }}`$ $`=`$ $`𝒜_s\mathrm{sin}\omega t+𝒜_c\mathrm{cos}\omega t`$ (2)
$`+_s\mathrm{sin}2\omega t+_c\mathrm{cos}2\omega t+𝒞`$
where the coefficients are linear combinations of potential Lorentz violating terms in the SME and $`2\pi /\omega `$ is the Earth’s sidereal period. The term $`𝒞`$ has an annual variation that can be neglected here. In zero and first order of $`v/c`$ the quantities $`𝒜`$ and $``$ contain exclusively SME terms, while higher order terms would of course include the more traditional effects described by Eq. (1). The cavity which is oriented in the east-west direction is maximally sensitive to the second harmonic terms in Eq. (2), while the cavity oriented $`45^{}`$ to the Earth’s axis is maximally sensitive to the first harmonic terms Kostelecky\_52 . A search for the lower order terms would probe for new physics that might for example correspond to residual effects left over from the birth of the universe. Because of the extreme sensitivity of modern cavity resonators and clocks it is possible to put useful bounds on such possibilities.

When limited to the photon sector the Lagrangian describing the SME can be written in the form noteref3

$`L_{photon}={\displaystyle \frac{1}{4}}F_{\mu \nu }F^{\mu \nu }{\displaystyle \frac{1}{4}}(k_F)_{\kappa \lambda \mu \nu }F^{\kappa \lambda }F^{\mu \nu }`$
$`+{\displaystyle \frac{1}{2}}(k_{AF})^\kappa ϵ_{\kappa \lambda \mu \nu }A^\lambda F^{\mu \nu }`$ (3)
Here $`A_\mu `$ are the photon fields, $`F_{\mu \nu }_\mu A_\nu _\nu A_\mu `$ and the coefficients $`k_F`$ and $`k_{AF}`$ control the magnitude of the Lorentz violations. Stringent limits exist on the size of the $`k_{AF}`$ term, but the CPT-even $`k_F`$ term is only partially constrained Kostelecky . KM define matrices $`\stackrel{~}{\kappa }_{e+}`$, $`\stackrel{~}{\kappa }_e`$, $`\stackrel{~}{\kappa }_{o+}`$ and $`\stackrel{~}{\kappa }_o`$ and $`\stackrel{~}{\kappa }_{tr}`$ with elements that are parity even and parity odd combinations of the coefficients $`k_F`$. These matrices arise naturally in the analogous situation of wave propagation in a homogeneous anisotropic medium. Astrophysical tests constrain $`\stackrel{~}{\kappa }_{e+}`$ and $`\stackrel{~}{\kappa }_o`$ at the $`10^{32}`$ level astro , while the other matrices are currently only weakly constrained. These include nine additional coefficients of $`k_F`$ of which eight are in principle accessible via the present experimental configuration. Of these, four contribute directly to a possible frequency shift and three at first order in $`v/c`$, leading to high sensitivity tests. Detailed expressions relating the coefficients of Lorentz violation to those in Eq. (2) have been given by KM up to first order in $`v/c`$.

In our experiment we compare the frequencies of two cylindrical superconducting microwave cavities operating in the TM010 mode Stein  which gives sensitivity to the velocity of light in radial directions. One cavity has its axis oriented to the local vertical at our latitude of $`37.4^{}`$ while the other axis is oriented to the local horizontal in the east-west direction. The cavities are made of niobium and are operated at about 1.4K in conventional helium Dewars. Microwave synthesizers are locked to the 8.6 GHz modes of the cavities using Pound frequency discrimination systems, and the difference frequency is mixed with an intermediate frequency oscillator to produce a beat signal in the 20 - 30 Hz range. Data was collected at irregular intervals over a 98-day period during a development program for a related experiment to be performed in space Sumo . Nine records were obtained, each corresponding to a continuous segment of data at least 24 hrs long. Frequency sampling was at one second intervals, with averaging of 100 second segments before curve fitting was performed. An example of one of the records is shown in Fig. 2(a). Typically the records were collected after some other form of testing on the apparatus was completed. This situation leads to arbitrary offsets of up to a few Hz between the records. Also, mechanical disturbances occasionally gave rise to a perceptible drift of the beat frequency amounting to a few mHz per day. We therefore fitted each record with the function

$`{\displaystyle \frac{\mathrm{\Delta }\nu }{\nu }}=\nu _0+\nu _1t+𝒜_s\mathrm{sin}(\omega t)+𝒜_c\mathrm{cos}(\omega t)`$
$`+_s\mathrm{sin}(2\omega t)+_c\mathrm{cos}(2\omega t)`$ (4)
where $`\nu _0`$ and $`\nu _1`$ were additional free parameters. The residuals from the fit to the record in Fig. 2(a) are shown in Fig. 2(b). The values obtained for the coefficients of the sinusoidal terms are listed in Table I along with the day of the record notetime . It can be seen that the amplitudes $`𝒜_s`$, $`𝒜_c`$, $`_s`$ and $`_c`$ are in the low $`10^{13}10^{14}`$ range, with no obvious trend with time. XY plots of the sine and cosine coefficients are shown in Figs. 3(a) and 3(b). To test for an alignment of the observed signals with inertial space we also made the XY plots after phase shifting the sine and cosine coefficients to sidereal time, obtaining the results in Figs. 3(c) and 3(d). For these plots the time origin was also shifted to the 2002 vernal equinox. No significant reduction of the scatter is evident.

A study of the behavior of the apparatus at other times disclosed a high sensitivity of the signal from one of the cavities to tilt which appears to be the dominant limit to the experiment. A second effect was the stability of the temperature of the cavity. This was controlled to within $`\pm 5\times 10^6`$ K using a germanium resistance thermometer mounted on the cavity and a servoed heater. The dominant source of temperature fluctuation was the 1.4 K cooling system. A proportional-integral temperature controller was used, but thermal gradients within the cavity assembly could cause some undetected coupling with room temperature. A ratio transformer bridge was used for the germanium thermometer with a reference resistor at 1.4 K. This configuration typically gives stabilities of better than 1 $`\mu `$K. The temperature coefficient of the cavity frequency was -28 Hz/K which would imply frequency offsets on the order of $`\pm 0.15`$ mHz, but this could be amplified by thermal gradient effects. With servo powers of the order $`10^5`$ W, temperature differences of as much as $`5\times 10^5`$ K would be expected in the cavity support structure. A number of correlation studies were performed but only a modest reduction of the amplitudes in Table I was obtained. Discussion of this aspect of the analysis is lengthy and will be presented elsewhere. We suspect that the signal amplitudes in Table I are dominated by mechanical effects in the low temperature apparatus.

From the plots in Fig. 3 it seems reasonable to conclude that there is no significant evidence for an inertially oriented frequency shift in our experiment. Treating the variation of the observed signal amplitudes as locally generated ”noise” we can average the data in each direction and derive bounds on any signal. Using the coefficients from Figs. 3(c) and 3(d) we obtain $`\overline{𝒜}_c=8.5\pm 10.4\times 10^{14}`$, $`\overline{𝒜}_s=4.2\pm 8.8\times 10^{14}`$, $`\overline{}_c=2.0\pm 4.3\times 10^{14}`$ and $`\overline{}_s=5.8\pm 5.9\times 10^{14}`$ where the errors correspond to the statistical 2$`\sigma `$ level. Because of the likely presence of unmodeled systematic effects and the small number of records, we consider the confidence level in these results to be closer to the 60% or 1$`\sigma `$ level. The results imply that certain linear combinations of the $`k_F`$ coefficients are constrained at the $`10^{13}`$ level. For example, neglecting contributions of order $`v/c`$ and higher, the $`𝒜_s`$ term can be written as $`𝒜_s^0=1/4\mathrm{sin}2\chi (3\stackrel{~}{\kappa }_{e+}+\stackrel{~}{\kappa }_e)^{YZ}`$ where $`\chi `$ is the colatitude of the experiment notexyz . Setting $`(\stackrel{~}{\kappa }_{e+})^{YZ}=0`$ on the basis of the extremely tight astrophysical bound $`<10^{32}`$, it is easy to show that $`𝒜_s^0=(1/16)\mathrm{sin}2\chi [(k_F)^{ZXYX}+(k_F)^{XZXY}(k_F)^{ZXXY}(k_F)^{XZYX}4(k_F)^{0Y0Z}]`$, which reduces to $`\mathrm{sin}2\chi [(k_F)^{XYXZ}(k_F)^{0Y0Z}]/4`$. Similar relations can be derived for the other amplitudes in Eq. (2). Alternatively, the experiment can be viewed as setting the following bounds on elements of the $`(\stackrel{~}{\kappa }_e)`$ matrix: $`(\stackrel{~}{\kappa }_e)^{YZ}<1.7\pm 3.6\times 10^{13}`$; $`(\stackrel{~}{\kappa }_e)^{XZ}<3.5\pm 4.3\times 10^{13}`$; $`(\stackrel{~}{\kappa }_e)^{XY}<1.4\pm 1.4\times 10^{13}`$; $`[(\stackrel{~}{\kappa }_e)^{XX}(\stackrel{~}{\kappa }_e)^{YY}]<1.0\pm 2.1\times 10^{13}`$.

As described by KM, three more coefficients are introduced at the level $`v/c`$, where $`v`$ is the velocity of the Earth around the Sun. The additional term in $`𝒜_s`$ can be written as

$`𝒜_s^1={\displaystyle \frac{v}{4c}}\mathrm{sin}2\chi \mathrm{cos}\mathrm{\Omega }T[\mathrm{sin}\eta (\stackrel{~}{\kappa }_{o+})^{ZX}\mathrm{cos}\eta (\stackrel{~}{\kappa }_{o+})^{YX}]`$ (5)
where $`2\pi /\mathrm{\Omega }`$ is the orbital period of the Earth, $`T`$ is the time measured from the vernal equinox and $`\eta `$ is the angle between the Earth’s orbital and equatorial planes. Evaluating this expression for our situation we obtain $`𝒜_s^1=9.75\times 10^6[(\stackrel{~}{\kappa }_{o+})^{YX}0.432(\stackrel{~}{\kappa }_{o+})^{ZX}]`$ where we have used the midvalue of $`T`$ over our data collection period. Clearly this expression is dependent on the duration of the experiment. In conjunction with $`𝒜_s^0`$ this term is also bounded at the level of $`4.2\times 10^{14}`$, implying a constraint on the term inside the square brackets of $`<4.0\pm 8.4\times 10^9`$, assuming no cancellation between the terms notesigma . Similar expressions can be derived for the other coefficients in Eq. (4). For clarity, the entire set of constraints obtained from the measurements is given in Table II. A more direct bound on the components of $`𝒜_s^1`$ could be obtained by extending the data gathering period to a larger fraction of a year when it would become reasonable to include the annual modulation terms in the fit to the data. At the present level, the experiment sets bounds of $`<4\times 10^9`$ on four expressions of the type in square brackets in Eq. (5). We note that by mixing the experimental bounds, a cleaner separation of the $`\stackrel{~}{\kappa }_{o+}`$ components can be obtained.

By restricting the Lagrangian in Eq. (3) to the photon sector, the model omits a range of potential effects from the material that makes up the apparatus. Within the full SME these possibilities lead to considerable complexity, but KM argue that complete cancellation of the photon sector effects is improbable due to the complexity of the forces involved. In very recent work Müller et al. Muller  have considered these effects and find a small enhancement of the photon effects in the case of ionic crystalline materials.

In summary, we have set bounds at the $`10^{13}`$ level on four combinations of parameters in the SME, and bounds at the $`10^9`$ level on four others. These bounds now constrain seven of the nine unknown coefficients $`k_F`$ in the model. We note that in a space-based version of this experiment Sumo , substantially greater sensitivity could be achieved, perhaps approaching the $`10^{17}`$ level for the four primary bounds.

We wish to thank J. Turneaure and S. Buchman for support in the early phases of the project, the NASA Office of Biological and Physical Research for its support with Grants No. NAG3-1940 and No. NAG8-1439, and the Jet Propulsion Laboratory for Contract No. 1203716.


text:
# Effect of the relativistic spin rotation on two–particle spin composition

## Abstract

The effect of the relativistic spin rotation on two–particle spin states, conditioned by the setting of the spins of the particles in their rest frames and by the noncommutativity of the Lorentz transformations along noncolinear directions, is discussed. Particularly, the transition from the c.m.s. of two spin-1/2 particles to the laboratory is considered. When the vectors of the c.m.s. particle velocities are not colinear with the velocity vector of the c.m.s., the angles of the relativistic spin rotation for the two particles are different. As a result, the relative fractions of the singlet and triplet states in the relativistic system of two spin-1/2 particles with a nonzero vector of relative momentum depend on the concrete frame in which the two-particle system is analyzed.

1 JINR, 141980 Dubna, Moscow region, Russia.
2 Institute of Physics ASCR, Na Slovance 2, 18221 Prague 8, Czech Republic.

1. Earlier the spin correlations in two-particle quantum systems were analyzed in detail as a tool allowing one to measure the space–time characteristics of particle production \[1-5\], to study the two–particle interaction and the production dynamics (see  and references therein) and to verify the consequences of the quantum–mechanical coherence with the help of Bell–type inequalities .

The spin state of the system of two particles in an arbitrary frame is described by the two-particle density matrix, the elements of which, $`\rho _{m_1m_{1}^{}{}_{}{}^{};m_2m_{2}^{}{}_{}{}^{}}^{(1,2)},`$ are given in the representation of the spin projections of the first and second particle in the corresponding rest frames onto the common coordinate axis $`z`$ (see, e.g., ).***The setting of the particle spins in their respective rest frames is based on the properties of the inhomogeneous Lorentz group and avoids the problem of the noncommutativity of the spin operators with the free Hamiltonian . This circumstance was not understood in Ref. , where the unnecessary condition of nonrelativistic particle velocities was required. However, one should take into account the relativistic spin rotation conditioned by the additional rotation of the spatial axes at the successive Lorentz transformations along noncolinear directions \[7-9\]. The relativistic rotation of the spatial axes leads to the nontransitivity of the parallelism in the theory of relativity (see  and references therein): generally, the parallel axes of the frames $`K_1`$ and $`K`$, $`K_2`$ and $`K`$ do not imply the parallel axes of the frames $`K_1`$ and $`K_2`$. The axes of all the three frames could be mutually parallel if only their velocities were colinear (for example, if $`K_1`$ and $`K_2`$ were the rest frames of the two particles and $`K`$ \- their c.m.s.).  As a result, the concrete description of a particle spin state depends on the frame from which the transition to the particle rest frame is performed. Particularly, the total spin composition of the two–particle state with a nonzero vector of relative momentum is generally frame–dependent due to different relativistic rotation angles of the two spins at the transition to the frame moving in the direction which is not colinear with the velocity vectors of both particles.

Usually, it is convenient to consider the spin correlations in the center-of-mass system (c.m.s.) of the particle pair. This is natural at the addition of the two–particle total spin and the relative orbital angular momentum into the conserved total angular momentum. In some cases, however, it may be useful to make transition to the laboratory, e.g., in the case when the particle scatterings are used as their spin analyzers .In principle, this transition is not necessary since one can transform the four–vectors defining the polarization analyzers first to the pair c.m.s. and then to the respective particle rest frames. Denoting $`M_l`$ and $`𝐩_l=\pm 𝐤`$ the masses and c.m.s. momenta of the two particles, $`l=1,2`$, their respective c.m.s. velocities in the units of the velocity of light ($`c=1`$) are $`𝐯_l=\pm 𝐤/\sqrt{𝐤^2+M_l^2}`$. Here and below the $`\pm `$ signs correspond to the first ($`l=1`$) and second ($`l=2`$) particle, respectively. We denote the corresponding laboratory velocities as $`\stackrel{~}{𝐯}_l`$ and the laboratory velocity of the particle pair as $`𝐕`$. At the Lorentz transformation from the c.m.s. of the particle pair to the laboratory frame with parallel respective spatial axes, the spins of the first and the second particle (in their respective rest frames) rotate in opposite directions around the axis which is parallel to the vector $`[\mathrm{𝐤𝐕}]`$.§§§ The relativistic spin rotation is the purely kinematical effect: the angles of the space rotation coincide with the angles between the vectors of the resulting velocities at the relativistic addition of velocities $`𝐯_l`$ and $`𝐕`$ in the direct and reverse orders .  The rotation angles $`\omega _l`$ are given by the Stapp formula  (see also ):

$$\mathrm{sin}\omega _l=\pm \gamma \gamma _lVv_l\mathrm{sin}\theta \frac{1+\gamma +\gamma _l+\stackrel{~}{\gamma }_l}{(1+\gamma )(1+\gamma _l)(1+\stackrel{~}{\gamma }_l)},$$
(1)
where the positive sign corresponds to the direction of the nearest rotation from the vector $`𝐤`$ to the vector $`𝐕`$; $`\theta `$ is the angle between the vectors $`𝐤`$ and $`𝐕`$ ($`0\theta \pi `$), $`v_l=|𝐯_l|`$, $`\stackrel{~}{v}_l=|\stackrel{~}{𝐯}_l|`$, $`V=|𝐕|`$ and $`\gamma _l=\left(1v_l^2\right)^{1/2}`$, $`\stackrel{~}{\gamma }_l=\left(1\stackrel{~}{v}_l^2\right)^{1/2}`$, $`\gamma =\left(1V^2\right)^{1/2}`$ are the Lorentz factors;

$$\stackrel{~}{\gamma }_l=\gamma _l\gamma \left(1\pm v_lV\mathrm{cos}\theta \right).$$
(2)
In the case of equal–mass particles the relations $`𝐯_1=𝐯_2,\gamma _1=\gamma _2`$ hold (but $`\stackrel{~}{\gamma }_1\stackrel{~}{\gamma }_2`$ when $`V\mathrm{cos}\theta 0`$).

Using the equality

$$(1+\gamma +\gamma _l+\stackrel{~}{\gamma }_l)^2=2(1+\gamma )(1+\gamma _l)(1+\stackrel{~}{\gamma }_l)(\gamma ^21)(\gamma _l^21)\mathrm{sin}^2\theta ,$$

one can write the analogous expressions for the cosines of the spin rotation angles:

$$\mathrm{cos}\omega _l=1\frac{(\gamma 1)(\gamma _l1)}{(1+\stackrel{~}{\gamma }_l)}\mathrm{sin}^2\theta .$$
$`(1a)`$
In the case of the colinearity of the velocity vectors $`𝐯_l`$ and $`𝐕`$, when $`\theta =0`$ or $`\theta =\pi `$, both the rotation angles are equal to zero.

At nonrelativistic velocities $`v_l`$ in the c.m.s. of the particle pair ($`\gamma _l1`$, $`\stackrel{~}{\gamma }_l\gamma `$), the angles $`\omega _l`$ of the spin rotation are small and scale with $`v_l`$:

$$\omega _l\pm \frac{\gamma }{\gamma +1}v_lV\mathrm{sin}\theta .$$
(3)
In the ultrarelativistic limit, when $`\gamma _l\mathrm{}`$, $`\stackrel{~}{\gamma }_l/\gamma _l\gamma \left(1\pm V\mathrm{cos}\theta \right)`$, one has

$$\mathrm{sin}\omega _l\pm V\mathrm{sin}\theta \frac{1+\gamma (1\pm V\mathrm{cos}\theta )}{(1+\gamma )(1\pm V\mathrm{cos}\theta )},\mathrm{cos}\omega _l1\frac{\gamma 1}{\gamma (1\pm V\mathrm{cos}\theta )}\mathrm{sin}^2\theta .$$
(4)
The relations (4) are valid exactly for massless particles (photons, neutrinos). In this case the rotation angles coincide with the aberration angles (the angles between the vectors $`𝐯_l`$ and $`\stackrel{~}{𝐯}_l`$); then the helicity (the spin projection of the particle onto the direction of its momentum) is the relativistic invariant .

Taking into account the relativistic spin rotation at the transition from the two–particle c.m.s. to the laboratory, the two–particle spin density matrix is transformed as follows:

$$\widehat{\rho }^{(1,2)}=\widehat{D}^{(1)}(\omega _1)\widehat{D}^{(2)}(\omega _2)\widehat{\rho }^{(1,2)}\widehat{D}^{(1)+}(\omega _1)\widehat{D}^{(2)+}(\omega _2),$$
(5)
where

$$\widehat{D}^{(l)}(\omega _l)=\mathrm{exp}(i\omega _l\widehat{𝐣}_l𝐧)$$
(6)
are the matrices of the space rotations generated by the vector spin operators $`\widehat{𝐣}_l`$, $`𝐧`$ is the unit vector parallel to the direction of the vector $`[\mathrm{𝐤𝐕}]`$.

2. In the case of two spin–1/2 particles, the two-particle spin density matrix has the structure :

$$\widehat{\rho }^{(1,2)}=\frac{1}{4}[\widehat{I}^{(1)}\widehat{I}^{(2)}+(\widehat{𝝈}^{(1)}𝐏_1)\widehat{I}^{(2)}+\widehat{I}^{(1)}(\widehat{𝝈}^{(2)}𝐏_2)+\underset{i=1}{\overset{3}{}}\underset{k=1}{\overset{3}{}}T_{ik}\widehat{\sigma }_i^{(1)}\widehat{\sigma }_k^{(2)}].$$
(7)
Here $`\widehat{I}`$ is the two-row unit matrix, $`\widehat{𝝈}`$ is the Pauli vector operator, $`𝐏_l=\widehat{𝝈}^{(l)}`$ are the polarization vectors, $`T_{ik}=\widehat{\sigma }_i^{(1)}\widehat{\sigma }_k^{(2)}`$ are the components of the correlation tensor, $`\{1,2,3\}\{x,y,z\}`$. The left and right indexes of the correlation tensor correspond to the rest frames of the first ($`l=1`$) and second ($`l=2`$) particle, respectively. The corresponding probability to select the particles with the polarizations $`𝜻^{(l)}`$ can be obtained by the substitution of the matrices $`\widehat{\sigma }_i^{(l)}`$ in the expression (7) with the corresponding projections $`\zeta _i^{(l)}`$. Particularly, when analyzing the polarization states with the help of particle decays, the vector analyzing power $`𝜻^{(l)}=\alpha _l𝐧_l`$, where $`\alpha _l`$ is the decay asymmetry corresponding to the decay analyzer unit vector $`𝐧_l`$. As a result , the correlation between the decay analyzers is determined by the product of the decay asymmetries and the trace of the spin correlation tensor

$$T=T_{xx}+T_{yy}+T_{zz}.$$

For example, the angular correlation $`𝐧_1𝐧_2=\mathrm{cos}\theta _{12}`$ between the directions of the three–momenta of the decay protons in the respective rest frames of two $`\mathrm{\Lambda }`$-hyperons decaying into the channel $`\mathrm{\Lambda }p+\pi ^{}`$ with the $`P`$-odd asymmetry $`\alpha =0.642`$ is described by the normalized probability density

$$W(\mathrm{cos}\theta _{12})=\frac{1}{2}\left(1+\alpha ^2\frac{T}{3}\mathrm{cos}\theta _{12}\right).$$
(8)
Clearly, the structure of both Eq. (7) and the corresponding angular distribution of the spin analyzers (e.g., Eq. (8)) does not depend on the system from which the transitions to the particle rest frames are performed. The system dependence manifests only through the relativistic rotations in the successive Lorentz transformations along noncolinear directions. The matrices of the space rotations due to the transition from the c.m.s. of two free spin-1/2 particles to the laboratory are the following:

$$\widehat{D}^{(l)}(\omega _l)=\mathrm{cos}\frac{\omega _l}{2}+i\widehat{𝝈}^{(l)}𝐧\mathrm{sin}\frac{\omega _l}{2}.$$
(9)
Selecting the $`z`$–axis parallel to the direction of the vector $`𝐧=[\mathrm{𝐤𝐕}]/|[\mathrm{𝐤𝐕}]|`$, and the axes $`x`$ and $`y`$ in the plane perpendicular to this vector, the polarization vectors and the spin correlation tensor transform at the transition to the laboratory in accordance with the (active) rotations around the z–axis by the angles $`\omega _1`$ and $`\omega _2`$ for the first and second particle, respectively:

$$\begin{array}{c}P_{lx}^{}=P_{lx}\mathrm{cos}\omega _lP_{ly}\mathrm{sin}\omega _l;P_{ly}^{}=P_{ly}\mathrm{cos}\omega _l+P_{lx}\mathrm{sin}\omega _l;P_{lz}^{}=P_{lz};\\ \\ T_{xx}^{}=(T_{xx}\mathrm{cos}\omega _1T_{yx}\mathrm{sin}\omega _1)\mathrm{cos}\omega _2(T_{xy}\mathrm{cos}\omega _1T_{yy}\mathrm{sin}\omega _1)\mathrm{sin}\omega _2;\\ \\ T_{yy}^{}=(T_{yy}\mathrm{cos}\omega _1+T_{xy}\mathrm{sin}\omega _1)\mathrm{cos}\omega _2+(T_{yx}\mathrm{cos}\omega _1+T_{xx}\mathrm{sin}\omega _1)\mathrm{sin}\omega _2;T_{zz}^{}=T_{zz};\\ \\ T_{xy}^{}=(T_{xy}\mathrm{cos}\omega _1T_{yy}\mathrm{sin}\omega _1)\mathrm{cos}\omega _2+(T_{xx}\mathrm{cos}\omega _1T_{yx}\mathrm{sin}\omega _1)\mathrm{sin}\omega _2;\\ \\ T_{yx}^{}=(T_{yx}\mathrm{cos}\omega _1+T_{xx}\mathrm{sin}\omega _1)\mathrm{cos}\omega _2(T_{yy}\mathrm{cos}\omega _1+T_{xy}\mathrm{sin}\omega _1)\mathrm{sin}\omega _2;\\ \\ T_{xz}^{}=T_{xz}\mathrm{cos}\omega _1T_{yz}\mathrm{sin}\omega _1;T_{zx}^{}=T_{zx}\mathrm{cos}\omega _2T_{zy}\mathrm{sin}\omega _2;\\ \\ T_{yz}^{}=T_{yz}\mathrm{cos}\omega _1+T_{xz}\mathrm{sin}\omega _1;T_{zy}^{}=T_{zy}\mathrm{cos}\omega _2+T_{zx}\mathrm{sin}\omega _2.\end{array}$$
(10)
Particularly, the trace of the spin correlation tensor transforms at the transition to the laboratory as:

$$T^{}=(T_{xx}+T_{yy})\mathrm{cos}(\omega _1\omega _2)+(T_{xy}T_{yx})\mathrm{sin}(\omega _1\omega _2)+T_{zz}$$
(11)
or, in the case of a symmetric tensor, as:

$$T^{}=T2(T_{xx}+T_{yy})\mathrm{sin}^2\frac{\omega _1\omega _2}{2}.$$
(12)
So, the c.m.s. trace $`T`$ in Eq. (8) is substituted by the laboratory one $`T^{}`$ calculated using Eq. (11) or (12) together with Eqs. (1) and (1a) for the spin rotation angles.

3. It was shown  (see also ) that the trace of the correlation tensor of a system of two spin-1/2 particles is the following linear combination of the relative fractions of singlet (the total spin $`S=0`$) and triplet ($`S=1`$) states:

$$T=\widehat{𝝈}^{(1)}\widehat{𝝈}^{(2)}=\rho _t3\rho _s,\rho _t+\rho _s=1.$$
(13)
When we have the pure singlet state of the particle pair in its c.m.s. ($`\rho _s=1,\rho _t=0,T_{ik}=\delta _{ik},T=3`$), the transformation to the laboratory gives

$$T^{}=3+4\mathrm{sin}^2\frac{\omega _1\omega _2}{2}.$$
(14)
It follows from Eqs. (13) and (14) that at the transition to the laboratory the relative fraction of the singlet state decreases in favor of a triplet state:

$$\rho _s^{}=\mathrm{cos}^2\frac{\omega _1\omega _2}{2},\rho _t^{}=\mathrm{sin}^2\frac{\omega _1\omega _2}{2}.$$
(15)
Thus the square of the total spin of two free particles with a nonzero vector of relative velocity is not a relativistic invariant (see ). Introducing the two–particle singlet state:

$$|\psi _{00}=\frac{1}{\sqrt{2}}\left(|+1/2_z^{(1)}|1/2_z^{(2)}|1/2_z^{(1)}|+1/2_z^{(2)}\right)$$
(16)
and the triplet state with the zero projection onto the rotation axis $`z`$:

$$|\psi _{10}=\frac{1}{\sqrt{2}}\left(|+1/2_z^{(1)}|1/2_z^{(2)}+|1/2_z^{(1)}|+1/2_z^{(2)}\right),$$
(17)
the result in Eq. (15) also follows directly from the matrices of space rotations in Eq. (9); the singlet state in the two–particle c.m.s. is transformed into the following superposition of the singlet and triplet states in the laboratory:

$$|\psi _s^{}=\mathrm{cos}\frac{\omega _1\omega _2}{2}|\psi _{00}+i\mathrm{sin}\frac{\omega _1\omega _2}{2}|\psi _{10}.$$
(18)
Similarly, the transformation of the pure triplet state $`|\psi _{10}`$ in the two–particle c.m.s. ($`\rho _s=0,\rho _t=1,T_{zz}=1,T_{xx}=T_{yy}=1,T=1`$) to the laboratory gives

$$T^{}=14\mathrm{sin}^2\frac{\omega _1\omega _2}{2},$$
(19)
the corresponding fractions being

$$\rho _s^{}=\mathrm{sin}^2\frac{\omega _1\omega _2}{2},\rho _t^{}=\mathrm{cos}^2\frac{\omega _1\omega _2}{2},$$
(20)
in accordance with the transformation:

$$\psi _t^{}=\mathrm{cos}\frac{\omega _1\omega _2}{2}|\psi _{10}+i\mathrm{sin}\frac{\omega _1\omega _2}{2}|\psi _{00}.$$
(21)
In the case of the unpolarized triplet in the two–particle c.m.s. ($`\rho _s=0,\rho _t=1,T_{ik}=\delta _{ik}/3,T=1`$ ), we have

$$T^{}=1\frac{4}{3}\mathrm{sin}^2\frac{\omega _1\omega _2}{2},$$
(22)
$$\rho _s^{}=\frac{1}{3}\mathrm{sin}^2\frac{\omega _1\omega _2}{2},\rho _t^{}=1\frac{1}{3}\mathrm{sin}^2\frac{\omega _1\omega _2}{2}.$$
(23)
Using Eqs. (1) and (1a), it is easy to show that in the case of two spin-1/2 particles with the same masses ($`\gamma _2=\gamma _1,v_2=v_1`$) the measure of the spin mixing can be written in the form:

$$\kappa \mathrm{sin}^2\frac{\omega _1\omega _2}{2}=\left(v_1V\right)^2\mathrm{sin}^2\theta \left[\left(\frac{1}{\gamma }+\frac{1}{\gamma _1}\right)^2+\left(v_1V\right)^2\mathrm{sin}^2\theta \right]^1.$$
(24)
The maximum of the mixing factor $`\kappa `$ corresponds to the angle $`\theta =\pi /2`$. In the ultrarelativistic limit, when $`\gamma _11,\gamma 1`$ and $`\mathrm{sin}\theta \mathrm{max}(1/\gamma ,\mathrm{\hspace{0.17em}1}/\gamma _1)`$, the factor $`\kappa `$ approaches unity. Then the singlet state in the two–particle c.m.s. becomes in the laboratory the triplet state with the zero projection of the total spin onto the spin rotation axis $`z`$ and, vice versa.

Thus, the effect of the relativistic spin rotation leads to the dependence of the total spin composition (the singlet and triplet fractions in particular) on the concrete frame in which the system of two-particles, moving with different velocity vectors, is analyzed. The physical origin of this dependence is the violation of the parallelism of the spatial axes of the particle rest frames, except for the case when the Lorentz transformations to these frames are done along the directions colinear with the relative velocity (e.g., from the c.m.s. of the two particles).

We would like to thank M.I. Shirokov for useful remarks.
This work was supported by GA Czech Republic, Grant. No. 292/01/0779, by Russian Foundation for Basic Research, Grant No. 03-02-16210, and within the Agreements IN2P3-ASCR No. 00-16 and IN2P3-Dubna No. 00-46.


text:
# Contents

## 1 Introduction

A typical upper-division undergraduate physics course, for example, the course in classical electrodynamics at the level of Griffiths’ text , involves extensive analytic problem solving. Students learn to solve Laplace’s equation in rectangular coordinates, in cylindrical coordinates, with Bessel functions, with Legendre polynomials. The methods taught are important in their own right and as methods to illustrate central physical concepts. But it would be better if numerical problem-solving methods were discussed at a similar level. Students today typically have in their dorm rooms, and even carry in their backpacks, computers with the power of a typical university central mainframe of the 1970’s. It would be wonderful to put this power to work both to developing intuition and in explicit problem-solving.

The inclusion of numerical calculations in the physics curriculum is even more important because our students typically go to careers, either in research or in industrial settings, in which the basic task is modelling of physical systems. Analytic methods are useful for estimates, or for working out the dependence on parameters, but understanding a realistic system in detail typically requires a computer simulation. So we should make clear to our students right away that it is straightforward to put the equations that appear in their classes onto a computer and obtain sensible physical results.

This problem is currently addressed in the physics curriculum in two ways. First, specific physics problems are encoded in computer programs which students can run as black boxes, changing the parameters and seeing what consequences develop. The ‘scripted applets’ of the Davidson College group represent a very beautiful development along this line . Such black-box programs are useful in introductory courses, but, for upper-division courses, they do not teach all of the skills one would like to develop. These programs are time-consuming to write, and it is often the philosophy that students should not touch the code. (The Davidson applets are designed so that not even professors modify the code.) But we would like students to write some code, and to understand how simple sets of instructions can iterate to the patterns that solve interesting equations of Nature. Often in undergraduate mechanics courses, instructors give students differential equations to be integrated by commercial packages such as Maple or Mathematica. Such projects have a similar black-box approach.

The other common approach is a computational physics course, on the model of the textbooks of Gould and Tobochnik  and Koonin . Such courses are often constructed around major projects. Students spend a large part of a semester learning a learing a computer environment, then construct an elaborate code for one particular application. Such a course is important to give students experience with large-scale computer applications and to begin studying sophisticated numerical methods. But it would be good also to allow students to do simpler numerical problems that tie in directly to material being covered in their core courses.

Ideally, a weekly problem set in mechanics or electrodynamics should consist of several analytical and one numerical problem. The reason this is not done as a matter of course is the difficulty of having students master the purely computer programming aspects of the task.

In this article, I propose a way of solving this problem. The method is based on the structure of the programming language Java. Java is an object-oriented computer language which allows programs that have a hierarchial structure. Thus, one can assign to students the writing of a small piece of code, perhaps one subroutine that carries out a numerical computation. This code can then fit together with a larger program that implements a graphical user interface for visualizing the results of the program. The user interface code can be assembled by the instructor; students need not be bothered by its complexity. Finally, the instructor’s task in writing this larger program can be simplified if the various user interface elements are drawn from a pre-assembled ‘class library’.

At heart, this is the familiar strategy of asking students to write a subroutine which can be tied to a larger package of code. The use of Java assists this in two ways. First, it allows the instructor to neatly encapsulate the part of the code for which the student is responsible, hiding the details of the graphical elements and user interface. Second, it makes available to the instructor a programming library that makes it rather simple to write graphical elements that are interesting and pleasing.

This strategy could also be carried out in other programming languages that allow easy access to graphical user interface components, for example, Visual Basic. The CUPS project has created a range of pleasing simulations in Pascal , and these are extensible by working at the code level. Java has the advantage that the same code runs on UNIX, Windows, or Macintosh systems, so that students can put together their assignments on whatever operating system is most convenient for them. In addition, Java belongs to a family of computer languages, including C, C++, and Pascal, in which numerical computations have a common syntax. The part of the code that the student must write is almost indistinguishable among these four languages, so their is no need for students to have prior experience in Java.

An extensive set of software resources for creating educational simulations in Java is being put together by Christian, Gould, and Tobochnik  as a part of their work for the second edition of the textbook . In contrast to that work, I provide here a minimal set of Java resources to provide exercises of the type I have described.

In this paper, I present this method of constructing problems with numerical solutions. In Section 2, I present a sample numerical exercise that I have given on a problem set. In Section 3, I give some further examples of such numerical exercises. All of these examples are based on a relatively simple class library of graphical elements that are specifically useful for programming exercises of this type. In Section 4, I describe the basic structure and format of this library. To illustrate its features, the master program for the first exercise is discussed in detail. Section 5 presents some conclusions. Appendix A gives the complete documentation for the class library. Appendix B gives a list of the example programs included in the software distribution.

The Java code for the class library and for the example programs discussed in this article can be found in a tar file at the web site at which the eprint of this paper is posted .

## 2 Laplace Applet

Textbook discussions of Laplace’s equation (e.g. ) note the fact that a solution $`\varphi (x)`$ is the average of the solution at neighboring points, and that this fact can be the basis for a numerical solution of Laplace’s equation. In this section, I will present a homework problem that allows a student to implement this observation in a numerical program and see it work.

Look at the computer program shown in Fig. 1. It is not so difficult to make sense of this program. Its idea is to sweep through an array phi\[i\]\[j\], updating successive values. The programs tests for the maximum change over the array and quits when this is sufficiently small. The algorithm for updating the array is not given. But one can explain in words that each array element can be, successively, set equal to the average of its neighbors, and that the equilibration of this process yields a solution of the Laplace equation.

To implement this algorithm, it is necessary to modify only one line of the code, replacing the assignment to newphi by

$`\mathtt{double\; newphi\; =}`$
$`\mathtt{(0.25)*(phi[i+1][j]+phi[i][j+1]+phi[i-1][j]+phi[i][j-1]);}.`$ (1)
This statement has the same form in C, C++, Pascal, or Java. It should be at least recognizable by students whose only programming experience is in Basic or FORTRAN.

The statement class Laplace extends LaplaceGUI indicates that the simple program Laplace.java shown in Fig. 1 is intended to work with functions and data structures defined in a parent program LaplaceGUI.java. This program, its parent PhysicsApplet.java, and a small file Laplace.html are given the directory Laplace in the software distribution mentioned at the end of the Introduction. These files can be made available for download on the course Web page. Compiling these programs together, one obtains a working simulation toy. The method of linking the programs depends on the precise operating system, but under UNIX (or Mac OS X) it is as simple as putting the four files in the same directory and typing javac Laplace.java. The compiled program, or ‘applet’, is then run by viewing the file Laplace.html with a Web browser. The student would not be expected to modify, or even open, any of these files except for the original Laplace.java. This file contains all of the physics; the others simply supply the computer interface.

The result of this process is a working application, a view of which is shown in Fig. 2. The applet shows a figure with a box that displays the values of the array phi in greyscale. In the specific example shown, phi is chosen to be a $`100\times 100`$ array. The box contain dots as fiducial marks at each tenth grid point, to facilitate specific numerical computations. By clicking on the buttons ‘Cathode’ and ‘Ground’, one can paint a set of boundary conditions with the mouse. Clicking on the button ‘Solve Laplace’ calls the method solve() in the program Laplace.java. As the array phi\[i\]\[j\] is updated, the values of phi are displayed on the screen in grayscale. Clicking on the button ‘Measure Voltage’ and then clicking on the screen causes the value of phi at that point to appear as a label under the box.

Once the applet is programmed and working correctly, it can be used for many illuminating exercises. Some of these are qualitative problems, for example, illustrating the principle of a Faraday cage by placing small grounded conductors around a cathode. Others are quantitative, for example, working out the size of edge effects on the capacitance of a capacitor of finite size. To aid in the latter calculation, the button ‘Compute Energy’ computes the electrostatic energy stored in the configuration shown from a discrete approximation to the expression $`d^2x\frac{1}{2}ϵ_0E^2`$. The problem set that contained this applet asked the student to implement a function Energy() that would be called by this button and return the result. The GUI would then take care of writing this result to the screen.

## 3 Further Examples

Many other computational exercises can be constructed along these lines. Eight additional applets are included with the software distribution. I describe two of these below.

The left-hand side of Fig. 3 shows an applet that computs the magnetic fields in an array of wires and magnetic material that can be drawn on the screen. The situation is uniform in the third dimension, with current flowing up or down through the screen. A fixed current, up or down, is assigned to squares colored, respective, green or red. These squares can be painted with the mouse. The student can also color in regions to be filled with a linear magnetic material (‘iron’) with adjustible permeability $`\mu `$. The magnetic fields are generated from a vector potential $`\stackrel{}{A}=(0,0,𝒜)`$, where $`𝒜`$ solves the Poisson equation

$$^2𝒜=\mu 𝒥,$$
(2)
in which $`𝒥`$ is the current density in the wires (in A/m2). The equation can be solved by the same relaxation method discussed in the previous section for the Laplace equation. The problem set containing this applet explained the strategy, then asked the students to work out the details using their experience with the Laplace applet of Section 2. They were then asked to use this Magnet applet to to solve qualitative examples in the theory of magnetism and quantitative problems of magnet design.

The right-hand side of Fig. 3 shows an applet that can be used to illustrate the basic principles of signal analysis. The applet displays three boxes on the screen. In the upper box, a waveform can be entered, either from the computer program as a mathematical function or by drawing with the mouse. The center box shows the (modulus of the) Fourier transform of the waveform. This is multiplied by a filter function which, again, can either be supplied by the program or drawn on the screen. To present this applet on a problem set, I supplied to the students five files: FourierLab.java, FourierTransform.java, FourierLabGUI.java, PhysicsApplet.java, and FourierLab.html. The last of these is simply used to display the compiled program. The file FourierLab.java contains the functions defining the initial waveform and filter. The file FourierTransform.java contains the methods called by the button ‘Transform’. The remaining two Java programs define the graphical user interface and are not meant to be modified by the student. They do not contain any of the physics of the computation.

The contents of FourierTransform.java given to the student are shown in Fig. 4. The structure is based on notions of object-oriented programming, but it is self-explanatory. The real-space function is a real-valued function $`f(x)`$, represented as an array f\[n\], $`n=0,\mathrm{},(N1)`$. The real and imaginary parts of the Fourier Transform are represented as arrays fcos\[m\] and fsin\[m\], $`m=0,\mathrm{},N/2`$. Using only the basic understanding of the treatment of arrays in any familiar programming language, it is straightforward to complete the Fourier transform algorithms so that they work correctly. (Java does have the peculiar feature that $`\mathrm{sin}x`$, $`\mathrm{cos}x`$ and $`\pi `$ are written Math.Sin(x), Math.Cos(x), and Math.PI; students must be told about this.) In principle, one could build different versions of FourierTransform.java from this basic structure, incoporating different algorithms for computing the Fourier Transform.

## 4 Construction of the Laplace Applet

The computer programs described in the previous two sections are constructed from a simple program, containing the actual physics and accessible to the student, and a more complex user interface program whose contents the student can ignore. Up to now, I have not discussed any aspect of the Java programming language. However, the object-oriented nature of this language is the key to the way that these programs are structured. In this section, I will first review some notions of object-oriented programming and then explain how these ideas are applied in the specific case of the Laplace applet.

In object-oriented programming, the basic element of a program is a ‘class’, a set of data variables together with function (‘methods’) that act on these variables. One class can be created from another in a parent-daughter relation. The daughter class is said to ‘inherit’ the variables and methods of the parent; new variables and methods intrinsic to the daughter can be added to these. In this way, a complex structure can be built up in stages. It is possible to define an ‘abstract class’ in which one or more methods are defined in principle but are not implemented. An abstract class cannot be created (‘instantiated’) in a computer program. However, a daughter of the abstract class which defines the required methods can be created and used. In Java, each individual class A is defined in a separate file A.java.

The Java language defines an ‘applet’, a mini-program accessible through a Web browser, as a predefined parent class. This Applet class manages the window in which the program appears and provides methods to draw in this window.

The definition of the Laplace applet starts from a parent class PhysicsApplet which is a daughter class of Applet. This class defines various user interface elements that are useful in constructing problem set applets of the type that I have presented above. A complete documentation of the classes, variables, and methods of PhysicsApplet is given in Appendix A. PhysicsApplet is an abstract class that leaves a large number of methods undefined. The Java language contains many hooks to graphical elements, making it straightforward to construct basic user interfaces. There are many excellent books that describe user interface programming in Java  However, I hope that the collection of specialized elements contained in PhysicsApplet will make it even a step easier for instructors to build their own programs of the type illustrated above.

The class LaplaceGUI is constructed as a daughter class of PhysicsApplet. The construction this class puts into the applet the specific displays and buttons described in Section 2. LaplaceGUI is still an abstract class. It defines almost all of the methods of PhysicsApplet but leaves undefined the methods solve(), which actually carries out the solution of Laplace’s equation, and Energy(), which computes the electrostatic energy. When the class Laplace adds a definition of solve() to this structure, as shown in Fig. 1, and also a definition of Energy(), all needed methods are defined and the class can be instantiated. In the writing of the Laplace class, the definitions of all of the other methods of LaplaceGUI can remain hidden.

The code for the class LaplaceGUI is shown in Figs 5–8. The program is lengthy, but it is all straightforward bookkeeping of the graphical elements.

The program begins by defining the basic array phi involved in the numerical computation, an array of integers State that keeps track of the boundary conditions drawn by the user, a graphic element of type ArrayDisplay, which produces the large square in described for the applet. and a graphic element of type TitleBanner, which displays a caption under this square.

The next segment of the program defines integer constants that label the options for the behavior of various elements of the program. Books on graphical user interfaces (notably ) ask that a user interface be ‘modeless’, so that the user has as many options as possible at any given time. The price of this feature is a complex programming style. My philosophy is just the reverse. I would like to make the programming task as easy as possible for the instructor, even if this costs the user some flexibility. Thus, the programming style is completely modal.

The first method in the code is the constructor, the initialization program for LaplaceGUI. The first line calls the initialization of PhysicsApplet, giving the title, setting the dimensions Nx, Ny of the arrays as $`100\times 100`$, and defining the size of lattice point as 4 pixels on the screen. The remaining lines initialize the arrays.

Most of the remaining methods in the program are abstract methods of the class PhysicsApplet. The task of defining these methods guides the programming of the interface. The first two of these methods reset one or both of the arrays to zero. The following method, buildPicture, fills in the picture at the center of the applet. The method refreshPicture redraws the picture when this is needed. (I advise you not to wait for the inscrutable processes of Java to decide when to redraw.) The method buildControls sets up the array of buttons at the bottom of the applet. PhysicsApplet defines two types of buttons, a CommandButton that executes a specific command and a ModeButton that turns on a specific mode, for example, for drawing on the screen. Commands and other actions requested by clicking the mouse are handled by doAction. The three methods immediately following buildControls implement application-specific parts of the methods for drawing in an ArrayDisplay.

The method WriteVectorValue is an abstract method of PhysicsApplet that is not needed by the Laplace Applet. The method Energy, which returns the electrostatic energy, is abstract at this level and is to be filled in by the student. This method is called in one of the lines of doAction.

At this point, the class LaplaceGUI has defined all of the abstract methods of the class PhysicsApplet except the crucial physics method solve. Once this method and the new method Energy are defined, the applet can be created and brought to the screen by the standard procedures of the Applet class. So the only task left for the program Laplace.java is to define these two methods.

The construction of LaplaceGUI has some tedious components, but this is the irreducible tedium of making sure that all of the buttons and controls needed for the analysis are in place. Once this job is done, all that is left to the student is to actually program the physics.

## 5 Conclusions

In this paper, I have described a system for programming numerical exercises to accompany core undergradudate physics courses. A class library PhysicsApplet supplies the underlying graphical and control elements. Using this resource, an instructor would write a program that defines the visual form of the numerical calculation as a Java applet. The actual programming of the numerical algorithm is left to the student. The hierarchial structure of the object-oriented Java programming language makes this system straightforward to implement. I hope that this model is one that will be helpful to many instructors in integrating numerical calculations into their teaching.

ACKNOWLEDGEMENTS

I am grateful to Patricia Burchat, Blas Cabrera, Norman Graf, and Tony Johnson for discussions of the subjects presented here, and to the students in Physics 120–121–122 at Stanford University, whose help and feedback was essential in developing these materials.

## Appendix A Documentation of the parent class PhysicsApplet

Java applets of the kind discussed in this paper can be created by assembling graphical elements and controls defined in the parent class PhysicsApplet. This is an abstract class in which the graphical elements appear as embedded classes. These elements are initialized and placed into the applet by defining the abstract methods of PhysicsApplet. In this appendix, I document the various elements that PhysicsApplet makes available and list the abstract methods that must be defined in order for a daughter class to be instantiated.

In the accompanying Java code, the file PhysicsApplet.java is contained in the directory Templates. This directory also contains a file called PhysicsApplet.h. Unlike C, Java does not make use of .h files. But the user can find in this file a list of the important variables and methods of all of the classes defined by PhysicsApplet.

### A.1 Global form and parameters

PhysicsApplet imposes the general form that an applet should have a title in a bar at the top, a picture in the center, and a set of controls at the bottom. The picture might typically display a numerical computation on a grid. For the user, the important global variables are:

| int Nx | grid points in $`x`$ |
| --- | --- |
| int Ny | grid points in $`y`$ |
| int pixelsize | pixels on the screen/grid point |

The class PhysicsApplet has a constructor that supplies the data for these variables. The constructor for a daughter class of PhysicsApplet should call this constructor by having as its first line

$$\mathtt{super("Applet\; Title",Nx,Ny,pixelsize,extraxsize);}$$
(3)
as shown in Fig. 4. The entry extrasize should equal the extra white space to be left around the picture, in pixels.

The constructor for the applet then places the title at the top, calls a routine

$$\mathtt{buildPicture();}$$
(4)
and calls a routine

$$\mathtt{buildControls();}$$
(5)
to set up the array of buttons. These are abstract methods of PhysicsApplet. A daughter class can define these methods by making use of the graphical elements described in the next two sections.

The size of the applet on the screen is actually determined by the information in the html file called by the Web browser. The file Laplace.html that controls the Laplace applet discussed in Section 2 has as its entire content:

$$\mathtt{<applet\; code="Laplace.class"\; width="500"\; height="600"></applet>}$$
(6)
The file specifies the width and height of the applet, in pixels. It is usually necessary to adjust these values so that the applet appears with the best size. The file Laplace.class is the compiled program from Laplace.java. The compilations generates many other associated class files; if these are in the same directory as the html file, the browser will pick these up when the program is run. Alternatively, it is possible to collect these class files in a single ‘Java archive’ or jar file. For the problem set exercises described here, I posted on the course Web page, in addition to the basic source code, the html file, the class file for the original (broken) form of the applet, and a jar file containing the remaining class files needed to implement the applet. Then, when a student accesses the html file on this Web page, the applet loads and displays its original behavior.

### A.2 Controls

To make programming the graphical user interface as easy as possible, the operation of the applet is modal. An integer mouseMode is a variable of PhysicsApplet. This variable controls the various mouse actions. Functions called by the mouse actions, e.g., writeFieldValue defined below, should test for the correct value of the mouseMode before performing the action.

The mouseMode can be changed by a ModeButton. The constructor is

$$\mathtt{ModeButton(String\; name,\; int\; ModeCode)}$$
(7)
The variables specify the name of the button and the value to which mouseMode should be set.

Another purpose of a button is to execute a command. All button commands are executed by the abstract method of PhysicsApplet

$$\mathtt{doAction(Code)}$$
(8)
When doAction is defined, the integer argument should go to a switch statement, and the command associated with the given code should then be executed. A button that called doAction with a given code is constructed by

$$\mathtt{CommandButton(String\; name,\; int\; CommandCode)}$$
(9)
It is often useful to include a scrollbar to control some physical variable. The constructor

$$\mathtt{PhysicsScrollbar(Value,\; Minimum,\; Maximum,\; CommandCode)}$$
(10)
creates a scrollbar with response between the values Minimum and Maximum. The default value is Value; the code to read the scrollbar is CommandCode. The scrollbar defined by this method uses a logarithmic scale internally, since this gives better control in parameter adjustment.

All three of these items can be directly included in the control panel

$$\mathtt{Panel\; Controls}$$
(11)
using the Panel method add(). This would be done in the definition of the method buildControls.

The applet also defines a Java class called a Thread that controls an abstract process. In the PhysicsApplet, this Thread executes the method solve(). More specifically, calling

$$\mathtt{startThread();}$$
(12)
lauches the solve() method. Calling

$$\mathtt{stopThread();}$$
(13)
causes a variable timetostop to be set to true. If solve() contains a loop, one can check for this condition and exit the loop if it is satisfied. This is done, for example, in the program Laplace.java shown in Fig. 1.

### A.3 Graphical elements

The graphical elements supplied by PhysicsApplet are embedded classes of this parent class. In this section, I describe these elements and list their public methods.

#### A.3.1 TitleBanner

A TitleBanner is a component that holds one line of text. A TitleBanner is initialized by writing

$$\mathtt{myBanner\; =\; new\; TitleBanner("Title",24);},$$
(14)
giving the initial text string and the font size. To change the text string, call

$$\mathtt{myBanner.write("New\; Text");}.$$
(15)
#### A.3.2 ArrayDisplay

An ArrayDisplay is a component that displays the values of an array in grayscale. The underlying data for this class are an array of doubles and an array of integers, both indexed from 0 to Nx, and from 0 to Ny ((Nx+1)(Ny+1) components). An ArrayDisplay is initialized by writing

$$\mathtt{myAD\; =\; new\; ArrayDisplay(A,\; ID,\; Color.red,\; Color.blue);},$$
(16)
where A is the array of doubles, ID is the array of integers. The constructor of the ArrayDisplay creates two vectors of colors,

$$\mathtt{DisplayColors[i]}\text{and}\mathtt{altDisplayColor[i]},$$
(17)
indexed over  i = 0 ... 10.

For an ArrayDisplay AA, calling AA.refresh() causes the display to be redrawn on the screen with the current values of the array.

To operate to ArrayDisplay, it is necessary to define three functions which are abstract methods of PhysicsApplet:

$`\mathtt{Color\; findColor(double\; a,\; int\; id)}`$
$`\mathtt{void\; writeFieldValue(double\; Val,\; int\; mode)}`$
$`\mathtt{void\; setArrays(int\; i,\; int\; j,\; int\; mode)}`$ (18)
The first of these functions takes a value a of an element of A and the value id of the corresponding element of ID and returns the color that the corresponding cell should be painted. The second takes a computed value and a mode number and is expected to issue a command to write the value to the screen. The third takes a coordinate pair (i,j) and a mode number and is expected to set the corresponding element of A or ID to a fixed value. The three methods are called by the mouse operations associated with the ArrayDisplay. All three methods are illustrated in the implementation of LaplaceGUI described in Section 4.

#### A.3.3 VectorDisplay

A VectorDisplay is a component that displays the values of two arrays as vectors on the screen. The underlying data for this class are two arrays of doubles and an array of integers, all indexed from 0 to Nx, and from 0 to Ny ((Nx+1)(Ny+1) components). A VectorDisplay is initialized by writing

$$\mathtt{myVD\; =\; new\; VectorDisplay(Bx,\; By,\; ID,\; bscale,\; Color.red,\; Color.blue);},$$
(19)
where Bx, By are the two arrays of doubles, ID is the array of integers, and bscale is an typical scale for the length of the vectors.

For a VectorDisplay VV, calling VV.refresh() causes the display to be redrawn on the screen with the current values of the arrays. Calling VV.resetscale(nbs) causes the display to be redrawn with the reference vector length bscale set to nbs.

To operate a VectorDisplay, it is necessary to define two functions that are abstract methods of PhysicsApplet:

$`\mathtt{void\; writeVectorValue(double\; Vx,\; double\; Vy,\; int\; mode)}`$
$`\mathtt{void\; setArrays(int\; i,\; int\; j,\; int\; mode)}`$ (20)
The first of these functions takes computed vector components and a mode number and is expected to issue a command to write the value to the screen. The second takes a coordinate pair (i,j) and a mode number and is expected to set the corresponding element of Bx, By, or ID to a fixed value. The three methods are called by the mouse operations associated with the VectorDisplay. Their operation is very similar to that for the corresponding functions in ArrayDisplay just above.

#### A.3.4 CurveDisplay

A CurveDisplay is a component that displays the values of two functions of $`x`$. The underlying data for this class are two vectors f\[n\] and h\[n\], both indexed from 0 to Nx. A CurveDisplay is initialized by writing

$`\mathtt{myCD\; =\; new\; CurveDisplay(Height,Zero,f,h,fscale,hscale,}`$
$`\mathtt{fcolor,\; hcolor,\; Mode);}`$ (21)
where Height is the height of the display in pixels, Zero is the vertical position of $`f=0`$ in pixels, f and h are the basic data vectors, fscale and hscale are anticipated maximum values of the functions, fcolor and hcolor are Java Color classes for each function (e.g., Color.red), and Mode is an integer. When the global variable MouseMode is set to this value, the user can redraw the function f with the mouse.

For a CurveDisplay CC, calling CC.refresh() causes the display to be redrawn on the screen with the current values of the arrays. Calling CC.resetfscale(newfscale) or CC.resethscale(newhscale) causes the display to be redrawn with the a change in the scale of the corresponding function.

#### A.3.5 PlotDisplay

A PlotDisplay is a component that displays a plot. A PlotDisplay is initialized by writing

$$\mathtt{myPD\; =\; new\; PlotDisplay(Xa,Xb,Ya,Yb,Xtick,Ytick);}$$
(22)
where the limits of the plot are specified as Xa to Xb, Ya to Yb, and the ticks on the edge of the plot in x and y are spaced by Xtick, Ytick.

For a PlotDisplay PP, calling PP.refresh() causes the display to be redrawn.

The plot is actually drawn by the method

$$\mathtt{void\; plot()}$$
(23)
which is an abstract method of PhysicsApplet. Points, text, and lines are drawn into the plot in PP by including the following calls in the body of plot:

$`\mathtt{PP.verticalAxis(x);}`$
$`\mathtt{PP.horizontalAxis(y);}`$
$`\mathtt{PP.plotPoint(x,xerror,y,yerror)}`$
$`\mathtt{PP.drawLine(x1,y1,x2,y2)}`$
$`\mathtt{PP.drawString("The\; Text",x,y);}`$ (24)
To plot a function, the PlotDisplay makes use of a helper class called a plotStream. This is, essentially, a collection of points. To create a plotStream inside a PhysicsApplet, simply call

$$\mathtt{plotStream\; PS\; =\; new\; plotStream()};$$
(25)
Points are added to a plotStream by the commands

$`\mathtt{PS.add(x,y);}`$
$`\mathtt{PS.add(x,\; y,\; yerror)}`$
$`\mathtt{PS.add(x,xerror,y,yerror)}`$ (26)
The number of elements in a plotStream is returned by PS.size(). However, the plotStream is designed so that the whole set of points can be plotted with one command. This can be done in a number of formats, by the PlotDisplay commands:

$`\mathtt{PP.plotPoints(PS);}`$
$`\mathtt{PP.plotLines(PS);}`$
$`\mathtt{PP.plotCurve(PS);}`$
$`\mathtt{PP.plotHistogram(PS);}`$ (27)
The first of these plots the points as data points, with error bars if the errors have been provided. The second plots the points as a broken-line function. The third plots the points by forming a smooth curve with a cubic spline. The fourth plots the points as a histogram, interpreting the x coordinates as the bin centers.

To change the plotting color to red, call PP.setColor(Color.red); any Color defined by Java may be used in the same way. The call PP.switchColor() cycles through the possible colors.

### A.4 Abstract methods of PhysicsApplet

To recapitulate, I list the abstract methods of PhysicsApplet that must be defined in a daughter class. If a method is not needed for the particular applet being constructed, it should be defined in a trivial way, e.g., with a body that is null or contains only return 0.

$`\mathtt{abstract\; void\; resetArrays();}`$
$`\mathtt{abstract\; void\; resetAll();}`$
$`\mathtt{abstract\; void\; buildPicture();}`$
$`\mathtt{abstract\; void\; refreshPicture();}`$
$`\mathtt{abstract\; void\; buildControls();}`$
$`\mathtt{abstract\; void\; doAction(int\; Code);}`$
$`\mathtt{abstract\; void\; solve();}`$
$`\mathtt{abstract\; Color\; findColor(double\; A,\; int\; S);}`$
$`\mathtt{abstract\; void\; writeFieldValue(double\; Val,\; int\; mode);}`$
$`\mathtt{abstract\; void\; writeVectorValue(double\; Vx,\; double\; Vy,\; int\; mode);}`$
$`\mathtt{abstract\; void\; setArrays(int\; i,\; int\; j,\; int\; mode);}`$
$`\mathtt{abstract\; void\; plot();}`$ (28)
## Appendix B Guide to the accompanying Java code

The Java code of PhysicsApplet.java and some example applets can be found as a tar file submitted with the eprint of this paper . This tar file unpacks to a set of ten directories. One of these, Templates, contains the file PhysicsApplet.java. The other nine each contain an example applet.

Each of these applets is given in the following form: If the name of the directory is B, the directory will contain files B.java, BGUI.java, B.html, myB.java, and myB.html. PhysicsApplet.java must be copied into the directory before compiling. The program B.java is the program given to students to complete. To compile it (on a UNIX system) type javac B.java; to run it, type appletviewer B.html. The program myB.java is the completed, working applet. It can be compiled and run in the same way.

The nine applets included in the distribution are the following:

* Laplace: An applet that solves the Laplace equation in two dimensions. This applet was described in Section 2.
* Dielectric: An applet that solves electrostatic problems with dielectric material in two dimensions
* Magnet: An applet that solves magnetostatic problems in two dimensions. This applet was described in Section 3.
* FourierLab: An applet that illustrates the Fourier Transform. This applet was described in Section 3. This directory includes an implementation of the Fast Fourier Transform adapted to the applet. To use it, change the name of the file myFastFourierTransform.java to myFourierTransform.java.
* Wave: An applet that solves a simplified form of the one-dimensional wave equation $`(/t/x)\varphi =0`$ (following ).
* Disperse: An applet that solves the one-dimensional wave equation by using the Fourier Transform, with an arbitrary input dispersion relation.
* Bessel: An applet that illustrates the numerical computation of the Bessel functions $`J_0(z)`$ and $`J_1(z)`$.
* Antennae: An applet that computes the radiation pattern from an array of antennae.
* Diffraction: An applet that, given an aperture drawn on the screen, computes its Fraunhofer diffraction pattern.