Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Courses Which course would be most useful for a computational physicist?

  1. Sep 17, 2011 #1
    Hi all, long time reader, 2nd time poster.

    The long story:
    I'm a physics major in my senior year, and I've recently developed an interest in computational physics/chemistry and I'm considering pursuing it in graduate school. I became interested in computational science when I took a basic programming course, and began doing some research involving density functional theory.

    I have room for one elective next semester before I graduate, so I need advice about which one to pick. I have already taken a basic course in programming (java: data types, control structures, basic OOP, etc.) and I'm taking one right now about data structures (java: abstract data types, recursion, searching, sorting, etc). I'm also currently taking a course in computational physics using Fortran.

    The short story:
    Which of these courses would be most useful for a computational physicist?

    Course 1:
    Assembly Language and Computer Organization

    Topics in Assembly Language Concepts, introduction to Computer Organization, Machine Representation of Information, Models of Computer Architecture, Instruction and Addressing Fundamentals, Control Structures.

    1. To learn elements of a Von Neumann computer and its implementations.
    2. To understand integer, character, and float data presentations.
    3. To understand RISC and CISC processor architecture.
    4. To understand stack (in memory) and its usage in processing functions.
    5. To understand concepts of linking, interrupts, and traps.
    6. To have a working knowledge of C and assembly language.


    Course 2:
    Object Oriented Programming (in Java)
    Introduction and analysis of the object-oriented programming paradigm and concepts. Design of classes and objects in problem solving. Use of object libraries.

    1. Describe the differences between procedural and object-oriented programming paradigms.
    2. Write small to medium size computer programs using an object-oriented approach.
    3. Apply object-oriented concepts to algorithm development.
    4. Create solutions using reusable software components from object libraries and application programming interface (API).
    5. Develop maintainable and reusable software and analyze their characteristics.

    I plan on learning the contents of both courses eventually, I'm just wondering which course would be of the most immediate use.

    Last edited: Sep 17, 2011
  2. jcsd
  3. Sep 17, 2011 #2

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    Object oriented programming would be of immediate use....

    The assembly course with it's hardware would be useful later when you want to take advantage of multi-core machines to their fullest.
  4. Sep 17, 2011 #3
    If you have already done data structures etc then any further OOP can generally be learned by picking up a book. Assembly is much harder to learn on your own and getting an understanding on how a computer actually works can help a lot when coding. I would go with the assembly course.

    (spoken as a coder, not a physicist)
  5. Sep 17, 2011 #4
    I can't see how learning assembly and computer organization will aid you in computational physics that much. Assembly and computer organization is mostly useful if you want to go into computer engineering or anything which deals with computer hardware. For immediate use I would definitely have to say object oriented programming would be better.

    However, assembly and computer organization is an interesting topic (at least I find this) and it wouldn't hurt you to know how a computer works. IMO just take whichever course seems most interesting.
  6. Sep 17, 2011 #5


    User Avatar
    Science Advisor
    Homework Helper

    Course #2 doesn't say what language it uses.

    If it's anouther Java course, you probably won't learn much from it, but if it uses C++ and some "real" application libraries (Windows or whatever) that will be another step foward.

    I don't think course #1 is very relevant unless you want to get involved in programming embedded systems etc - which might not be everybody's idea of "computational physics", but somebody has to make the instrumentation work to do the experiments!

    Course #1 appears to be teaching you what computers were like in 1970, not what they are today. You have to start the learning process somewhere, of course, but it doesn't go far enough to be much practical use getting the best performance out of modern high-performance computers (or even modern PCs) IMO. (But microcontrollers etc are still pretty muich like all computers were in the 1970s)
  7. Sep 17, 2011 #6
    Yeah, it's another course in Java. Sorry about that, I edited the OP to include that.

    Thanks for the responses so far! I did expect them to be somewhat mixed. It is a tough choice after all, which is why I'm asking in the first place :smile:
  8. Sep 18, 2011 #7
    I would rather do course #1. Number two is easy enough to do on your own, and you will understand OOP easily without taking a class on it (infact, just read any OOP language's best reference books and you'll get the ideas pretty quick, for weird stuff like C++ this is a near requirement otherwise you're gonna get fudged). Something more fundamental I might not take the time to learn, but could prove useful. Also, if I weren't trained in areas like that I might find it hard to work through it completely alone, and in those cases it may help to have a teacher around to explains things a little differently.

    I'd definitely spring for hte first course if you're willing to also learn to be a better programmer in your free time. It just seems like a more efficient use of your time, especially since OOP is something you'll see a ton of if you work on programming regularly, so it becomes easy to pick it up based on pure repetition.
  9. Sep 19, 2011 #8
    Course #1 is going to be far, far, far more useful to you. You'll need to learn OOP also, but that's easier to do on your own.

    If you are doing any numerical programming you are going to have to think very carefully about how the processor is running the code, and I've been in situations where I've had to look at the disassembled code to figure out the bottlenecks.

    The other thing is that a good chunk of graduate research involves trying to figure out what to do with the newest hardware.
  10. Sep 19, 2011 #9
    I echo the majority view that course #1 is more useful, but would like to point out to caveats:

    1) If you are looking to find some employment after as a programmer after your BSc. course #2 may be the better choice. Not because of what you're taught there; as already said you can learn the course contents by yourself. But because you have a formal proof of having some background in OOP.

    2) It's not your question but as someone who works in the field I feel compelled to point it out anyways: If you are interested in computational physics or chemistry, then pretty much any physics, chemistry, or math course is more helpful to you than either of the two courses. We have quite a few PhD students with little background in programming in my department. But in my experience everyone's limiting factor still is the math and physics knowledge (understanding the physical relevance of the simulation, knowing what kind of experiments are being done in the field, being able to autonomously set up a proper statistical data analysis, knowing physical effects that may affect the performance of the simulation, being able to set up software tests against analytical solutions, ...), not the programming skills. Taking a computer programming course as a computational physicist is like taking a do-it-yourself course as an experimental physicist: possibly helpful, but less impact on professional work than a proper science course.
  11. Sep 19, 2011 #10
    Interesting point, I will consider that. I'm actually taking all of the physics I can next semester (thermal and solid state), but I'll take a look at what chemistry and math courses are offered.

    I'm leaning towards course #1 at the moment, due to the suggestions, but also because the programming course I'm taking now (data structures) involves much more OOP than I anticipated. We've spent a couple weeks covering the basics, and the rest of the class will be carried out using OOP.
  12. Sep 21, 2011 #11
    As someone else that works in the field, I'd have to disagree with that. A lot depends on exactly the topic of your dissertation, but if you work in hard core numerical analysis then you are going to have to be an extremely sharp computer programmer.

    In my field it's quite different. In high performance computing, a tiny difference can make the difference between a simulation that takes two weeks to run, and one which doesn't run at all. For example, one thing that makes a big difference is the order that you write you for-loops. If you write the for-loops in the wrong way, then you fragment memory, the compiler does not used vectorized instructions, and your simulation is dead.

    Also for precision work, hardware issues matter. I recently spent a week tracking down some differences that ended up having to do with different floating point representations on different operating systems.

    C++ is useful because with templates, you can have the compiler take a for-loop and vectorize it, so you get OOP *and* decent performance. Using OOP is starting to be essential because you have code that typically are between 20K and 100K source lines of code.

    Depends on the field. This isn't true for my field.

    The problem with computer programming courses is that most CS courses aren't geared toward high performance computing.
  13. Sep 21, 2011 #12
    No one cares if you have formal proof of anything. In a job interview, I can tell by talking with someone for 10 minutes if they understand OOP at a basic level, and give me an hour, and I can tell if they understand it deeply.

    If you understand it, I don't care where you learned it from.
  14. Sep 21, 2011 #13


    User Avatar
    Science Advisor

    I recommend you learn both if you want to this kind of stuff, even if you learn one by coursework and the other in your own time.

    I think twofish-quants argument is valid and if you have done some basic programming in any procedural language, the assembler course would be very good.

    I don't know if you can get access to a vector machine or supercomputer, but if you can, that would provide a great environment for doing some applied computational work. These kind of machines are designed for computational stuff, and in many environments this is the kind of thing that gets used.

    I remember two-fish talking about using GPU's for computation, and I'm not really surprised since they offer a lot of processing power and are pretty cheap in the overall scheme of things. For this kind of thing you might get a standardized interface like OpenGL or DirectX and write some assembler programs for the graphics card. If you are interested also, there are bit-coin mining distro's for linux that use the GPU to "mine" for bitcoins.

    Once you know the constructs used in flow control, learning the object oriented way isn't really that hard. Classes are just structures pretty much for the most part and basically your function pointers in the data structures can do more advanced things with the paradigm of inheritance, but in the end it's just a data structure, and if you have programmed in C using that kind of style, then OOP is not really a tough transition.

    Also one last point: it is definitely a good idea to work with platforms that use both assembler/machine code and native procedural/OOP code. If you are able to easily integrate the two, then that is good experience. You will learn all about with using linking programs, but in my opinion, it is important that you learn how to incorporate different kinds of programs/platforms into your repositories.
  15. Sep 21, 2011 #14
    @twofish-quant: Formal proofs are not for job interviews, they are for being invited to job interviews. Considering your comments on taking programming classes: Since those stem from your experience (that doesn't quite seem to fit with mine) you probably have a point. Perhaps it depends on whether you put the emphasis in "Computational Physics" on "computer" or on "physics". I personally consider it quite important that I am a physicist, not an engineer or a programmer.
    Last edited: Sep 21, 2011
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook