Effective Computation in Physics

Author: Anthony Scopatz and Kathryn D. Huff
Publisher: O'Reilly
Pages: 792
ISBN: 978-1491901533
Print: 1491901535
Kindle: B010ORQ8DG
Audience: All technical computer users interested in Python
Rating: 4
Reviewer: Alex Armstrong

A book on using computers in physics raises the question of what is special about physicists? Could part of the answer be that they use Python?

To me computation in physics means solving differential equations or perhaps performing simulations. This isn't what this book is about. It seems to take the view that the subject matter is a cross between how to use a computer, programming in Python, bits of more or less relevant computer science and using tools. This is fairly much how computation in physics has been since the early days, with the possible exception of the tools - and of course the language has changed. Physicists mostly acquire what they need to know as they go along and of course lots of mistakes and bad choices are made. 




The first part of the book is called Getting Started and its a traditional introduction to using Linux via the command prompt followed by an introduction to Python. Of course this assumes that you are using Linux and want to use the command prompt rather than some GUI interface. This is a very traditional introduction to command line Linux and to Python and it is in no way tailored to physics - not that I can imagine what that would be like.

The first chapter is about command line Linux followed by five chapters on Python. It starts off from the basics - variables, strings and then moves on to containers, flow of control, functions and finally objects. The explanations are straightforward and sufficient to get you started. You are not going to be an expert when you get to the end of the section and this raises the question of why you don't simply read a book on Python and/or Linux. 



Part II is called Getting It Done. This is a collection of chapters on a range of topics that you might consider useful to a physical scientist. Chapter 7 is about analysis and visualization -basically NumPy, Gnuplot, mathplot, Bokeh and Inkscape. Chapter 8 goes into regular expressions and Chapter 9 is back to NumPy but focusing on arrays this time

Chapter 10 is on storing files using HDF5. Chapter 11 is called Important Data Structures In Physics, but they are also important in other areas. Those covered include hashing, B-Trees, Data frames and K-D Trees. All interesting and all useful but a fairly narrow survey.

The penultimate chapter of this section is about parallel processing and it point out the problem of trying to do this using Python. This hardly scratches the surface of a complicated and evolving topic. It mentions MPI but there's not a word about Hadoop. The final chapter is about deployment and it covers some hot topics like using virtual machines and Docker. 

Part III is called Getting It Right and this isn't just about debugging and testing although they get a chapter each. It also covers using make, using Git and using GitHub. The chapters on debugging and testing are fairly standard. 

The final section of the book is called Getting it Out which roughly means how to make sure people use the software you have written. The first chapter is about documentation including automating documentation using Docstrings and Sphinx. Next we have something on text editing including LaTex; collaboration and ticketing systems; Licences, ownership and copyright.

This is quite a thick book but it attempts to tackle a very big topic - what a physicist should know about programming. According to this book the physicist's world doesn't differ much from any other technical computer user. There is a strong bias towards open sources software and, of course, Python. It doesn't tackle the hardware side of doing research and there is no mention of things like how Raspberry Pi could automate your experiments or how integrating iPython could help with data collection. There no mention of the use of tablets, apps or the wider use of cloud computing and of course Windows and OSX are very much "other countries". 

The big problem I have with this book is that I'm not sure what is specific to its intended audience. All of the topics covered can be found discussed in greater depth in other books. However, it is useful to have them all brought together as a sort of "this is what's out there" sort of introduction to technical computing.




If you are any sort of technical computer user then this might be a good starting place. Don't be put off if you are not a physicist.  



The C# Workshop (Packt)

Author: Jason Hales, Almantas Karpavicius and Mateus Viegas
Publisher: Packt
Date: September 2022
Pages: 780
ISBN: 978-1800566491
Print: 1800566492
Kindle: ‎ B0BGRBDJLS
Audience: C# developers
Rating:  4
Reviewer: Mike James
C# is not the language it once was - time for a revival?

The AWK Programming Language, 2nd Ed

Author: Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger
Publisher: Addison-Wesley
Pages: 240
ISBN: 978-0138269722
Print: 0138269726
Kindle: B0CCJ1N4X3
Audience: Developers interested in Awk
Rating: 5
Reviewer: Kay Ewbank

The name Brian Kernighan among the authors of this updated classic raises  [ ... ]

More Reviews

Last Updated ( Saturday, 25 November 2017 )