Cambridge University Press, 2024. — 559 p. — ISBN: 978-1-009-10204-9.
This accessible and self-contained guide provides a comprehensive introduction to the popular programming language Python, with a focus on applications in chemistry and chemical physics. Ideally suited to students and researchers of chemistry learning to employ Python for problem-solving in their research, this fast-paced primer first builds a solid foundation in the programming language before progressing to advanced concepts and applications in chemistry. The required syntax and data structures are established and then applied to solve problems computationally. Popular numerical packages are described in detail, including NumPy, SciPy, Matplotlib, SymPy, and Pandas. EEnd-of-chapterproblems are included throughout, with worked solutions available within the book. Additional resources, datasets, and Jupyter Notebooks are provided on a companion website, allowing readers to reinforce their understanding and gain confidence in applying their knowledge through a hands-on approach.
This book aims to provide a resource for students, teachers, and researchers in chemistry who want to use Python in their work. Over the last 10 years, the Python programming language has been widely adopted by scientists, who appreciate its expressive syntax, gentle learning curve, and numerous packages and libraries that facilitate numerical work.
The book is composed of relatively short chapters, each with a specific job. Mostly, these jobs fall into one of two categories: to act as a tutorial on a specific part of the Python language or one of its libraries or to demonstrate the application of Python to a particular concept in chemistry. For students and teachers, these example applications are chosen to go beyond what can be reasonably achieved with a pencil, paper, and a calculator: A brief overview of the chemical concepts is usually given, but there is no in-depth tutorial on these topics. Rather, it is assumed that the reader has some familiarity with the topic and wishes to use Python to solve larger or more complex problems than those usually presented in textbooks. For example, the chapter on Huckel molecular orbital theory (Chapter 33) outlines the assumptions behind this approach to modeling the electronic structure of organic molecules and then demonstrates the use of Python in determining the? molecular orbitals of benzene, which (using an unsymmetrized basis) involves a 6? 6 matrix determinant: not a problem to be solved by hand.
Researchers are also increasingly using Python in their work as a computational tool, to manage and transform data, to produce publication-quality figures and visualizations, and even (using the JupyterLab package) as a replacement for laboratory notebooks, and to disseminate data and reproducible analysis. Indeed, the Jupyter Notebook was listed in an article in the journal Nature as one of the ten computer codes that have transformed science.
Basic Python Usage.
Strings.
Lists and Loops.
Comparisons and Flow Control.
Functions.
Data Structures.
File Input/Output.
Basic NumPy.
Graph Plotting with Matplotlib.
The Steady-State Approximation.
Liquid–Vapor Equilibrium.
Jupyter Notebook.
LaTeX.
Chemistry Databases and File Formats.
More NumPy and Matplotlib.
Thermodynamic Cycles.
Vectors, Matrices, and Linear Algebra.
Linear Least Squares Fitting I.
Linear Least Squares Fitting II.
Numerical Integration.
Optimization with scipy.optimize.
Vibrational Spectroscopy.
The Morse Oscillator.
Solving Ordinary Differential Equations.
The Oregonator.
Root-Finding with scipy.optimize.
Rotational Spectroscopy.
Peak Finding.
Fitting the Vibrational Spectrum of CO.
pandas.
Simulating a Powder Diffraction Spectrum.
The Hückel Approximation.
Nonlinear Fitting and Constrained Optimization.
SymPy.
Molecular Orbital Theory for H+.
Approximations of the Helium Atom Electronic Energy.
Computational Chemistry with Psi4 and Python.
Atomic Structure.
Solution.