0% found this document useful (0 votes)
667 views2 pages

Computational Physics

Computational physics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
667 views2 pages

Computational Physics

Computational physics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BOOKS

Editors: Larry Engelhardt, [email protected] | Stephen P. Weppner, [email protected]

Finally, a Python-Based Computational Physics Text


Eric Ayars | California State University, Chico

T
his is the book I’ve been waiting for. There are techniques. Explanations are clear and readable. The author
many good books on computational physics, and almost invariably begins with a thorough explanation of the
many more on programming in Python; but so far simplest approach, and then builds on those simple approach-
there has been a distinct lack of books on compu- es to more powerful techniques. Just about every section has
tational physics using Python. Computational Physics, by something that ties back to that “Accuracy and Speed” chap-
Mark Newman, is to my knowledge the first published at- ter; it’s not mind-numbingly rigorous, but it doesn’t skimp
tempt at filling that gap, and it’s pretty good. on ensuring that students understand the steps necessary to
For readers who have just awoken from a 15-year nap obtain trustworthy results. (Refreshingly, the students also
and are using this journal to find out what happened while have a chance of avoiding useless over-calculation!) In most
they were dozing, Python is a programming language that cases, the author finishes the section with a mention of the
almost perfectly hits the sweet spot between power and ease Python functions available through numpy or scipy that ef-
of use. Its simple syntax and enforced code structure make ficiently tackle that particular problem.
it ideal as a first programming language, but it’s still power- The book is surprisingly readable. It’s never going to
ful enough to be useful for all but the most arduous calcu- make it onto the reading list for Oprah’s book club, but it’s
lations. The lack of a textbook that uses Python for code a vast improvement over the typical “here’s how to do such-
examples and introduces the tools that Python offers has so and-such” book of numerical techniques. Topics I under-
far been a serious impediment to adoption of this otherwise stood completely beforehand were still interesting to read
ideal choice of language for the introductory programming about in the book. Topics I didn’t understand as well from
course for science majors; now that impediment is gone. my own classroom exposure to “Numerical Recipes in C”—
Romberg integration, for example—now make more sense to
Strengths me than ever before.
Newman begins with a chapter on the basics of Python syn-
tax and structure, which is sufficient to get most students Weaknesses
started on programming without prior experience. The Everyone who teaches a computational physics course will
chapter immediately following introduces the graphing ca- find something missing from whatever textbook they pick
pabilities of Python. This one-two combination allows stu- up. For me, with this text, those missing things are files and
dents to quickly start using what they’re learning in other curve fitting.
classes, which in turn increases their appreciation of the rest The entire coverage of curve fitting in this text fits with-
of the material. in one end-of-chapter problem. It’s a good problem, and the
Before getting into the rest of that material, though, the multistep approach the author takes is a nice introduction to
author takes students through a short chapter titled “Accu- least squares, but that’s it! There’s no mention at all of non-
racy and Speed.” This choice initially struck me as odd; but linear curve fitting, or of the excellent curve-fitting capabili-
interspersed throughout the rest of the book are discussions ties available in Python via the scipy module.
of precision, accuracy, and comparisons of the relative er- The lack of file-manipulation coverage is also disappoint-
rors of the different methods presented. The value of these ing. For many students in this sort of course, this one semes-
discussions to the student is greatly enhanced by this short ter may be the only formal computer programming training
chapter, which preemptively ties all that material together. they receive. Vanishingly few of those students will go on to
The rest of the book covers the usual spread of introduc- careers in computational physics, but most will end up need-
tory computational topics: integration and differentiation, ing to do something with computers on a regular basis. The
root-finding, Fourier topics, ODEs, PDEs, and Monte Carlo ability to read and write data files is invaluable to students in
the lab, and I’ve heard enough positive feedback about this

M ark Newman, Computational Physics, CreateSpace


Independent Publishing Platform, 2012,
ISBN: 978-1480145511, 562 pp.
from former students that I would hate to leave out this topic.
These omissions can be easily supplemented in class,
though; and a textbook that included everything every pro-
fessor ever wanted would be frightening.

6 Computing in Science & Engineering 1521-9615/14/$31.00 © 2014 IEEE Copublished by the IEEE CS and the AIP January/February 2014

This article is copyrighted as indicated in the article. Reuse of AIP content is subject to the terms at: http://scitationnew.aip.org/termsconditions. Downloaded to IP:
I teach a one-semester undergraduate course in computa-
tional physics; the students are mostly physics majors,
with an occasional chemist sprinkled in for variety. As is
2. H.P. Langtangen, A Primer on Scientific Programming with
Python (Texts in Computational Science and Engineering),
vol. 6, Springer, 2009.
the case in many other universities, there is no computer- 3. Shai Vaingast, Beginning Python Visualization: Crafting
programming prerequisite for this course, and it’s the only Visual Transformation Scripts, Apress, 2009.
programming course these science majors receive. The lack 4. Tao Pang, Computational Physics, Cambridge Univ. Press,
of a Python-based introductory textbook for this class has 1997.
been a problem to me. 5. N.J. Giordano, Computational Physics, Pearson Prentice Hall,
There are advanced texts1,2 and there are specialized 2nd ed., 2006.
texts,3 but none of these fit my needs for this course. I’ve
taught in the past with a Fortran-based book4 (rewriting all Eric Ayars is a professor of physics at California State University,
the example code in Python) and I’ve taught with the “lan- Chico. In addition to computation, his research interests include
guage-agnostic” version of Nicholas Giordano’s book,5 but development and applications of microcontroller systems for phys-
neither approach was really satisfactory. For the last couple ics and cross-disciplinary undergraduate research. Ayars has a
years, I’ve been writing my own book for use in this class. I PhD in physics from North Carolina State University, and can be
can stop now. I’ll keep my project around to supplement his reached at [email protected].
omissions, but realistically, Newman’s book is far superior
to my efforts and I’ll quite happily be adopting this book
the next time I teach the course.

References Selected articles and columns from IEEE Computer Society


1. R. Landau, M.J. Paez, and C. Bordeianu, A Survey of publications are also available for free at http://Computing-
IEEE_half_horizontal_Q6:Layout 1 4/21/11
Computational Physics, Python Multimodal 4:21 PMNow.computer.org.
eBook, 2011. Page 1

Experimenting with your hiring process?


Finding the best computing job or hire shouldn’t be left to chance.
IEEE Computer Society Jobs is your ideal recruitment resource, targeting
over 85,000 expert researchers and qualified top-level managers in software
engineering, robotics, programming, artificial intelligence, networking and
communications, consulting, modeling, data structures, and other computer
science-related fields worldwide. Whether you’re looking to hire or be hired,
IEEE Computer Society Jobs provides real results by matching hundreds of
relevant jobs with this hard-to-reach audience each month, in Computer
magazine and/or online-only!

http://www.computer.org/jobs
The IEEE Computer Society is a partner in the AIP Career Network, a collection of online job sites for scientists, engineers, and
computing professionals. Other partners include Physics Today, the American Association of Physicists in Medicine (AAPM), American
Association of Physics Teachers (AAPT), American Physical Society (APS), AVS Science and Technology, and the Society of Physics
Students (SPS) and Sigma Pi Sigma.

www.computer.org/cise 7

This article is copyrighted as indicated in the article. Reuse of AIP content is subject to the terms at: http://scitationnew.aip.org/termsconditions. Downloaded to IP:

You might also like