0% found this document useful (0 votes)
14 views

Perfectly Python

Uploaded by

Akash Gaonkar
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)
14 views

Perfectly Python

Uploaded by

Akash Gaonkar
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/ 3

BOOK

SECTION
REVIEWS
TITLE
Editor: Michael Jay Schillaci, [email protected]

Perfectly Python
Michael Jay Schillaci | Harris Corporation

time-independent methods in quantum mechanics as well


J. Wang, Computational Modeling and Visualization of Physical
as classical and quantum scattering. The author wisely deals
Systems with Python, Wiley, 2016.
with the problem of delivering sufficient depth of coverage
by providing tutorial-like examples, complete code listings,
and exercises at the end of each chapter.

W
ritten in a no-nonsense style, Jay Wang’s The introductory chapter provides a wealth of infor-
Computational Modeling and Visualization of mation for the novice programmer. It begins with an over-
Physical Systems with Python provides the ever- view of the syntax and control structures of the interpretive
growing community of Python learners and language and also discusses file handling, compatibility
users with a thorough text and valuable resource. Ideally concerns for 2.7x and 3.xx conversion, and speed and exten-
suited for use as a course text in advanced undergraduate or sibility (via Numba, Cython, F2Py, and so on), issues that
graduate curricula, this relatively slim volume offers coverage will appeal to the Python acolyte. All programmers will be
that is broad and deep, and the presentation is well thought happy that the text also includes material on plotting with
out. With standard topics ranging from planetary motion, Matplotlib and Numpy arrays with explicit code examples
dynamics, and chaos to oscillation, waves, electricity, and for creation, indexing, and slicing. The discussion on mul-
magnetism, the text also includes excellent chapters on sim- tidimensional arrays and universal functions is terse, but its
ple random problems and thermal systems. It distinguishes inclusion points to the volume’s usefulness as both a text-
itself from others by also covering both time-dependent and book and as a handy reference resource for programmers

November/December 2017 Copublished by the IEEE CS and the AIP 1521-9615/17/$33.00 © 2017 IEEE Computing in Science & Engineering 51
BOOK REVIEWS

As some of my own research is in classical and post-Newtonian


theories of gravity, I found the text’s treatment of orbital motion to be
of particular interest. The author does a wonderful job of presenting
the basic physics and then discussing the importance of units and
scales before introducing the Runge-Lenz vector.
and researchers. Indeed, the entire text is replete with notes velocity datasets. While these points might not be of interest
on debugging and optimization, and its many references to to all readers, this same care and attention to detail—and
appendices and online resources makes for a tight if some- extension beyond the basics—is found throughout the book.
times dense read. For those readers more interested in how programming
The integration of the Python code and the nascent aspects come to bear on the scientific content covered, I
background material is seamless and well accomplished. found many gems while reading through the volume and
From a pedagogical viewpoint, the author’s delivery is excel- running many of the programs. For example, in visualiz-
lent, and the chapter structure generally progresses from ing harmonic motion, the author first introduces standard
coverage of the theoretical background (equations) to the numerical methods and power spectrum and then uses
logical steps needed for a programmed solution. These are SciPy’s linear algebra modules to demonstrate matrix diago-
often given in numbered or bulleted lists (pseudo code), nalization methods and normal mode identification. He then
a feature that again points to the volume’s ease of use for takes the opportunity to extend these methods to model the
beginning students. Some readers will find the background displacement of a string under a load and demonstrates how
material rife with vectors and other dense mathemati- the Lapack routines are used to solve the resulting linear sys-
cal notation, so educators who use the text might have to tem of equations. This sequential and cumulative approach
unpack some of it for their students. Where the book really makes the book more accessible to novice programmers
delivers is that most of the problems posed in the main text and more relevant to those who are more advanced. In this
include a full implementation for a coded solution and visu- regard, the bulk of the provided code is well documented
alization of the results. and expertly written. The author almost always utilizes pro-
The beginning chapters dealing with classical problems, cedural programming methods by implementing a series of
such as projectile motion with and without resistance, do functions, and most speed concerns are mitigated with the @
an excellent job of covering the basic physics but also dem- jit compiler decorator. In some cases, object-oriented meth-
onstrate the rationale behind some of the most widely used ods are implemented, and the bulk of reading and writing of
numerical methods (such as Runge-Kutta and leapfrog) so data files is handled using the pickle module.
that students are prepared to use these methods to solve sys- The scientific scope of the book will likely be intimidat-
tems of equations efficiently. These goals, of course, require ing to some readers. This is particularly true with the mate-
some straightforward use of arrays and visualization, and rial on electromagnetic phenomena where finite-element,
the text stands out by providing tight and extensible code mesh, and interpolation methods are discussed, as these
and also by demonstrating simple methods for creating methods assume a level of mathematical knowledge and
scenes that can greatly enhance the final product. sophistication that many (undergraduate) readers might not
As some of my own research is in classical and post- have. Significantly, the inclusion of the system matrix and
Newtonian theories of gravity, I found the text’s treatment mesh generation material in this chapter allows more robust
of orbital motion to be of particular interest. The author and realistic simulations to be developed throughout the
does a wonderful job of presenting the basic physics and remainder of the text. The sophistication of the numerical
then discussing the importance of units and scales before techniques will also challenge some readers. For example,
introducing the Runge-Lenz vector. He then takes the time when tackling important problems in quantum mechan-
to discuss why time transformations via step-size adjust- ics, a spatially discretized leapfrog method is introduced.
ments must be used. The volume also goes well beyond The text does a good job of outlining the reasons and steps
the basics as exemplified by the inclusion of material on needed to implement this algorithm and then applies it to
precession due to relativistic corrections. Here, the author the quantum oscillator and free-fall problems. In his char-
walks the reader through straightforward methods to cre- acteristic fashion, the author then extends the discussion
ate animations and plots that demonstrate the success of beyond the scope of most other books and also demon-
Einstein’s theory in explaining the precession of Mercury, strates methods for visualizing the position and momentum
introducing readers to advanced methods using radial space amplitudes for 2D quantum waves.

52  November/December 2017
It’s also worth noting that the text’s material on simple undergraduate and graduate curricula where scientific com-
random systems does a great job of introducing a stochastic puting plays a role. Its collection of expertly documented
model for Brownian motion and also discusses importance and written Python code also makes it an ideal desk refer-
sampling methods. The text illustrates its depth here by ence for programmers and researchers alike that is, in short,
delving into statistical theory and giving a comprehensive perfectly Python.
treatment of nonuniform distributions, providing a guided
project to show how these can be generated via the rejec- Michael Jay Schillaci is the former managing director of the
tion method. With similar completeness, the author covers McCausland Center for Brain Imaging at the University of South
more advanced material on thermodynamic and scattering Carolina, served as associate professor of physics at Roberts Wes-
processes, and develops code that’s relevant to many areas of leyan College, and currently works as an imaging scientist and
pure and applied research. software engineer in the geospatial systems division at Harris Cor-
poration. His research interests include computational physics,
cognitive neuroscience, and classical theories of gravity. Schillaci

W ith exhaustive, wide-ranging, and careful coverage


of many areas in classical, quantum, and relativistic
physics, Jay Wang’s book deserves to become a standard in
has a PhD in physics from the University of Arkansas at Fayette-
ville. He’s a member of the American Physical Society. Contact
him at [email protected].

JULY/AUGUST 2016
IEEE SOFTWARE
July/August 2016

SOFTWARE IEEE Software offers


QUALITY JANUARY/FEBRUARY 2016

pioneering ideas,
IEEE SOFTWARE
SOFTWARE QUALITY

WWW.COMPUTER.ORG/SOFTWARE

expert analyses, and


thoughtful insights for
January/February 2016

ARCHITECTURAL DESIGN PRINCIPLES // 15

software professionals
WHY LARGE IT PROJECTS FAIL // 117

who need to keep up


Volume 33 Number 4

WWW.COMPUTER.ORG/SOFTWARE

with rapid technology


THE FUTURE OF SOFTWARE ENGINEERING

TINY PROGRAMMING TOOLS // 24 change. It’s the authority


REQUIREMENTS

on translating software
& SOCIAL RESPONSIBILITY // 109
MARCH/APRIL 2016
IEEE SOFTWARE

WWW.COMPUTER.ORG/SOFTWARE

theory into practice.

www.computer.org/
Volume 33 Number 1
March/April 2016

CODE CLARITY // 22 software/subscribe


SOFTWARE
ON A COMET // 81
BIG DATA
Volume 33 Number 2

www.computer.org/cise  53

You might also like