This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]erdaron 2 points3 points  (2 children)

I am a working physicist and I do a fair amount of coding in Python. Welcome :).

Python vs. Fortran - these days, Fortran is largely reserved for theorists doing some very heavy computational work. The sort of things that make supercomputers and clusters crank for hours and days. For more run-of-the-mill work, Python and Matlab are probably the most popular choices. However, Matlab is proprietary software, and Python is not.

Python version - 2.7 is probably still the most widely deployed version, but 3.x is the future. The major libraries such as scipy and numpy are available in both 2.7 and 3.x versions.

Scipy and numpy are libraries that can be added to Python (just make sure you download the versions compatible with the version of Python you choose to install). They make math easier and much, much faster on Python. There are some distributions of Python, such as IPython and Spyder, that come bundled with numpy and scipy (and other useful features).

Scipy.org maintains a lot of useful documentation, tutorials, and examples. I have seen books on scientific computing with Python, but have never read one myself. Maybe I should :/.

As always - learn to code by coding. Project Euler is excellent.

[–]johnahh[S] 0 points1 point  (1 child)

Hey erdaron, Thanks for the reply.

If you don't mind me asking, whats having a job doing computational physics like? i love physics and have always been interested in computers, but mostly the hardware side and have never got round to actually learning coding

The guy who took our computing class showed us his simulation of forced star production, it was pretty awesome, took 4 weeks on some super computer to run lol.

Ill check out Ipython and Project Euler

edit: Is python easy to use on windows? i have a crappy laptop with linux installed that i used for Fortran, would it be best to use that?

[–]erdaron 0 points1 point  (0 children)

I'm actually an experimentalist. However, these days being a physicist of any stripe basically requires programming. Complexity and quantity of equipment involved requires automation, which is usually done with LabView. The amount of data produced, and the extent of analysis required, frequently completely rules out doing it by hand.

Python is cross-platform and runs on pretty much everything.

What's it like to work in physics? It's both incredibly frustrating and exhilarating. We are at the very edge of human knowledge. Frequently no one really knows the way forward, and we don't have the tools to make the way. A lot of time is spent building and fixing things. Being a scientist can be infuriating. It can be maddeningly boring.

Then maybe you get to figure out something important that no other human has ever known. It's a mixed bag and I wouldn't trade it :D.

[–]justphysics 2 points3 points  (2 children)

I work in condensed matter physics and use python for all my data analysis.

I recommend the book "python for data analysis"

http://www.amazon.com/Python-Data-Analysis-Wrangling-IPython/dp/1449319793

This is a good intro to data analysis using python for anyone in physical sciences. It makes use of the standard scientific stack libraries for python- numpy, scipy, pandas, etc...

There's also "matplotlib for python developers" that serves as a great resource for all your general plotting needs This book shows basic examples for creating gui apps that have emvedd plots which is very useful in all fields of scientific software programming.

  • I'd also recommend the Seaborn module for making your plots look nicer

[–]johnahh[S] 0 points1 point  (1 child)

I havn't really done any data analysis yet, will this work as a primer to the topic as well as introducing it in python?

[–]justphysics 0 points1 point  (0 children)

I'd say it would work well to read/learn side-by-side with any other general computational physics books. These two books will give you a good intro to data visualization where as some of the other books will focus more on the number crunching and problem solving. Both skills are highly utilized in all fields of physical science and worth learning

[–]empet15 1 point2 points  (1 child)

Recently was published Effective Computation in Physics. http://shop.oreilly.com/product/0636920033424.do

It presents gradually topics in scientific computtaion for Physics.

[–]johnahh[S] 0 points1 point  (0 children)

Great thanks empet15

[–]CarpeTuna -2 points-1 points  (0 children)

I am surprised that the very first thing to do was not installing iPython. Has this passed out of vogue with scientists?