3 research outputs found
Learn Physics by Programming in Haskell
We describe a method for deepening a student's understanding of basic physics
by asking the student to express physical ideas in a functional programming
language. The method is implemented in a second-year course in computational
physics at Lebanon Valley College. We argue that the structure of Newtonian
mechanics is clarified by its expression in a language (Haskell) that supports
higher-order functions, types, and type classes. In electromagnetic theory, the
type signatures of functions that calculate electric and magnetic fields
clearly express the functional dependency on the charge and current
distributions that produce the fields. Many of the ideas in basic physics are
well-captured by a type or a function.Comment: In Proceedings TFPIE 2014, arXiv:1412.473
Learn Quantum Mechanics with Haskell
To learn quantum mechanics, one must become adept in the use of various
mathematical structures that make up the theory; one must also become familiar
with some basic laboratory experiments that the theory is designed to explain.
The laboratory ideas are naturally expressed in one language, and the
theoretical ideas in another. We present a method for learning quantum
mechanics that begins with a laboratory language for the description and
simulation of simple but essential laboratory experiments, so that students can
gain some intuition about the phenomena that a theory of quantum mechanics
needs to explain. Then, in parallel with the introduction of the mathematical
framework on which quantum mechanics is based, we introduce a calculational
language for describing important mathematical objects and operations, allowing
students to do calculations in quantum mechanics, including calculations that
cannot be done by hand. Finally, we ask students to use the calculational
language to implement a simplified version of the laboratory language, bringing
together the theoretical and laboratory ideas.Comment: In Proceedings TFPIE 2015/6, arXiv:1611.0865