This volume introduces optics through the use of simulations, namely, Python. Students, researchers and engineers will be able to use Python simulations to better understand the basic concepts of optics and professors will be able to provide immediate visualisations of the complex ideas. Optics is an enabling science that forms a basis for our technological civilization. Courses in optics are a required part of the engineering or physics undergraduate curriculum in many universities worldwide. The aim of Understanding Optics with Python is twofold: first, to describe certain basic ideas of classical physical and geometric optics; second, to introduce the reader to computer simulations of physical phenomena. The text is aimed more broadly for those who wish to use numerical/computational modeling as an educational tool that promotes interactive teaching (and learning). In addition, it offers an alternative to developing countries where the necessary equipment to carry out the appropriate experiments is not available as a result of financial constraints. This approach contributes to a better diffusion of knowledge about optics. The examples given in this book are comparable to those found in standard textbooks on optics and are suitable for self-study. This text enables the user to study and understand optics using hands-on simulations with Python. Python is our programming language of choice because of its open-source availability, extensive functionality, and an enormous online support. Essentials of programming in Python 3.x, including graphical user interface, are also provided. The codes in the book are available for download on the book's website. Discusses most standard topics of traditional physical and geometrical optics through Python and PyQt5 Provides visualizations and in-depth descriptions of Python's programming language and simulations Includes simulated laboratories where students are provided a "hands-on" exploration of Python software Coding and programming featured within the text are available for download on the book's corresponding website. "Understanding Optics with Python by Vasudevan Lakshminarayanan, Hassen Ghalila, Ahmed Ammar, and L. Srinivasa Varadharajan is born around a nice idea: using simulations to provide the students with a powerful tool to understand and master optical phenomena. The choice of the Python language is perfectly matched with the overall goal of the book, as the Python language provides a completely free and easy-to-learn platform with huge cross-platform compatibility, where the reader of the book can conduct his or her own numerical experiments to learn faster and better."- Costantino De Angelis, University of Brescia, Italy "Teaching an important programming language like Python through concrete examples from optics is a natural and, in my view, very effective approach. I believe that this book will be used by students and appreciated greatly by instructors. The topic of modelling optical effects and systems where the students should already have a physical background provides great motivation for students to learn the basics of a powerful programming language without the intimidation factor that often goes with a formal computer science course." - John Dudley, FEMTO-ST Institute, Besanon, France Cover Half Title Title Page Copyright Page Dedication Table of Contents Preface Chapter 1: Introduction to Python 1.1 Why Python? 1.2 Python Setup 1.2.1 Which Distribution Do We Need? 1.2.2 Installing Anaconda 1.2.3 The Anaconda Navigator 1.2.3.1 How to Start Anaconda Navigator 1.2.3.2 Jupyter/IPython QtConsole 1.2.3.3 Spyder 1.3 Coding with Jupyter/IPython QtConsole 1.3.1 Comments 1.3.2 Hello World! 1.3.3 Use Python As a Calculator 1.3.3.1 Numbers 1.3.3.2 Values and Types 1.3.4 Variables and Reserved Keywords 1.3.4.1 Variables 1.3.4.2 Keywords 1.3.5 Container Types 1.3.5.1 Strings 1.3.5.2 Lists 1.3.5.3 Tuples 1.3.5.4 Dictionaries 1.3.6 Control Structures 1.3.6.1 Condition Checking 1.3.6.2 The if/elif/else Construction 1.3.6.3 The for/range Loop 1.3.6.4 The while Loop 1.3.6.5 Continue and Break 1.4 Modules and Scripts 1.4.1 Modules 1.4.2 Write and Run Python Scripts with Spyder 1.4.3 Defining Functions 1.4.4 Classes 1.5 Widely Used Python Libraries for Science and Engineering 1.5.1 Numerical Python Library: NumPy 1.5.1.1 Creating Numpy Arrays 1.5.1.2 Using Array-Generating Functions 1.5.1.3 Index Slicing 1.5.1.4 Read/Write Data 1.5.2 Data Visualization Python Library: matplotlib 1.5.2.1 Getting Started 1.5.2.2 Multiple Axes 1.5.2.3 Basic Text Commands 1.5.2.4 Line and Marker Styles 1.5.3 Scientific Python Library: scipy 1.5.3.1 Special Functions 1.5.3.2 Bessel Functions 1.5.3.3 Fresnel Integrals 1.5.3.4 Interpolation 1.6 Conclusion Chapter 2: GUI Programming with Python and Qt 2.1 First Steps in GUI Application using PyQt5 2.1.1 Importing PyQt5 and Creating a PyQt5 Window 2.1.2 PyQt Classes 2.1.2.1 PyQT Application Structure 2.1.2.2 Widgets, Events, and Signals 2.1.2.3 QLabel 2.1.2.4 QPushButton 2.1.2.5 QSpinBox 2.1.2.6 QSlider 2.2 The Qt Designer 2.2.1 The Qt Designer Window 2.2.2 The Property Editor 2.2.3 Layout 2.2.4 Qt Designer Preview 2.2.5 Qt Ui File 2.2.6 Matplotlib Widget 2.2.7 An Example: Fraunhoffer Diffraction 2.2.8 Conversion from UI file to Python Code 2.2.8.1 Using Line Command 2.2.8.2 Using a Python Code 2.2.9 The Application: Fraunhofer Diffraction 2.3 Coding GUI Elements 2.4 Conclusion Chapter 3: Electromagnetic Waves 3.1 Introduction 3.2 Maxwell’s Equations and Electromagnetic Waves 3.3 Wave Equation 3.4 Poynting Vector 3.5 Phase Velocity and Group Velocity 3.6 Harmonic Waves 3.7 Python Code for Drawing a Wave Chapter 4: Radiometry and Photometry 4.1 Radiometry 4.2 Photometry Chapter 5: Fermat’s Principle, Reflection, and Refraction 5.1 Introduction 5.2 Fermat’s Principle 5.3 Reflection 5.3.1 Plane Mirrors 5.4 Fresnel Reflection 5.5 Refraction and Snell’s Law 5.5.1 Apparent Depth 5.5.2 Glass Slab 5.6 The Ray Equation Chapter 6: Lenses and Mirrors 6.1 Introduction 6.2 Sign Convention 6.3 Paraxial Approximation 6.4 Refractive Power of a Spherical Surface 6.5 Focal Lengths 6.6 Ray Diagrams 6.7 Magnification 6.8 Lensmaker’s Formula 6.9 Image Formation by Lenses 6.10 Newton’s Formula 6.11 Spherical Mirrors Chapter 7: Thick Lenses and Lens Systems 7.1 Cardinal Points 7.1.1 Focal Points 7.1.2 Principal Points 7.1.3 Nodal Planes 7.2 Multiple Refracting Surfaces Chapter 8: Polarization 8.1 Linear Polarization 8.2 Circular Polarization 8.3 Elliptical Polarization 8.4 Malus’s Law 8.5 Jones Vector 8.5.1 Linear Polarization 8.5.2 Circular Polarization 8.5.3 Elliptical Polarization 8.6 Jones Matrices 8.6.1 Linear Polarizer 8.6.2 Half-Wave and Quarter-Wave Plates 8.6.3 Circular Polarization 8.6.4 Elliptical Polarization 8.7 Optical Rotation Chapter 9: Interference 9.1 Generalities 9.1.1 Necessary Conditions 9.1.1.1 Polarization 9.1.1.2 Waves Identically Polarized 9.1.1.3 Asynchronous Waves with Constant Initial Phase Shift 9.1.1.4 SynchronousWaves with Constant Initial Phase Shift 9.1.1.5 Synchronous Waves with Random Initial Phase Shift 9.1.1.6 SynchronousWaves with Constant Initial Phase Shift and Arbitrary Polarization 9.1.1.7 Fringe Width 9.1.2 Beat and Propagation Velocity 9.1.2.1 Group Velocity and Phase Velocity 9.2 Wavefront Division 9.2.1 Young Double Slits 9.2.1.1 Optical Path Difference and Phase Shift 9.2.1.2 Slits of Arbitrary Width 9.2.1.3 Infinitely Thin Slits and Fringe Width 9.2.1.4 Contrast or Visibility 9.2.1.5 Fringe Orientation 9.2.2 Lloyd Mirror 9.2.2.1 OPD and Phase Shift 9.2.3 Fresnel Mirrors 9.2.3.1 OPD and Phase Shift 9.2.4 Fresnel Biprism 9.2.4.1 OPD and Phase Shift 9.2.5 Billet Bilens 9.2.5.1 OPD and Phase Shift 9.2.6 Meslin Lenses 9.3 Amplitude Division 9.3.1 Parallel-Faced Plates 9.3.1.1 General Considerations 9.3.1.2 Glass Plates 9.3.2 Corners 9.3.2.1 Newton’s Rings 9.3.2.2 Prismatic Plates 9.3.3 Michelson Interferometer 9.3.3.1 Fringes of Equal Inclination 9.3.3.2 Fringes of Equal Thickness 9.3.4 Mach–Zehnder Interferometer 9.3.5 Fabry–Perot Interferometer 9.3.5.1 Interferometer Efficiency Chapter 10: Coherence 10.1 Spatial Coherence 10.1.1 Double Mirrors 10.1.2 Broad Slit 10.2 Temporal Coherence 10.2.1 White Light 10.2.2 Finite Number of Wavelengths 10.2.3 Rectangular Continuum Spectra 10.2.4 Gaussian Profile Chapter 11: Diffraction 11.1 Fraunhofer Diffraction 11.1.1 Rectangular Aperture 11.1.2 Single Slit 11.1.3 Double Slit 11.1.3.1 Two Slits of Different Widths 11.1.3.2 Two Identical Slits: Young Double Slits 11.1.4 Diffraction Grating 11.1.5 Circular Aperture 11.1.5.1 Point Source 11.1.5.2 Rayleigh Criteria 11.2 Fresnel Diffraction 11.2.1 Fresnel Integrals 11.2.1.1 Diffracted Intensity 11.2.1.2 Fresnel Integrals Properties 11.2.2 Clothoid 11.2.2.1 Clothoid Properties 11.2.2.2 Diffraction by a Single Slit 11.2.2.3 Diffraction by an Edge 11.2.3 Diffraction by a Single Slit 11.2.4 Diffraction by an Edge Appendix A Fresnel Integrals Index This Book Introduces Optics Through The Use Of Simulations, Namely, Python. Students, Researchers, And Engineers Will Be Able To Use Python Simulations To Better Understand The Basic Concepts Of Optics And Professors Will Be Able To Provide Immediate Visualizations Of The Complex Ideas. Readers Will Learn Programming In Python. Throughout This Book, A Simulated Laboratory Will Be Provided Where Students Can Learn By Hands On Exploration. The Text Will Cover All The Standard Topics Of Traditional Optics.--provided By Publisher. Cover; Half Title; Title Page; Copyright Page; Dedication; Table Of Contents; Preface; Chapter 1: Introduction To Python; 1.1 Why Python?; 1.2 Python Setup; 1.2.1 Which Distribution Do We Need?; 1.2.2 Installing Anaconda; 1.2.3 The Anaconda Navigator; 1.2.3.1 How To Start Anaconda Navigator; 1.2.3.2 Jupyter/ipython Qtconsole; 1.2.3.3 Spyder; 1.3 Coding With Jupyter/ipython Qtconsole; 1.3.1 Comments; 1.3.2 Hello World!; 1.3.3 Use Python As A Calculator; 1.3.3.1 Numbers; 1.3.3.2 Values And Types; 1.3.4 Variables And Reserved Keywords; 1.3.4.1 Variables; 1.3.4.2 Keywords; 1.3.5 Container Types. 1.3.5.1 Strings1.3.5.2 Lists; 1.3.5.3 Tuples; 1.3.5.4 Dictionaries; 1.3.6 Control Structures; 1.3.6.1 Condition Checking; 1.3.6.2 The If/elif/else Construction; 1.3.6.3 The For/range Loop; 1.3.6.4 The While Loop; 1.3.6.5 Continue And Break; 1.4 Modules And Scripts; 1.4.1 Modules; 1.4.2 Write And Run Python Scripts With Spyder; 1.4.3 Defining Functions; 1.4.4 Classes; 1.5 Widely Used Python Libraries For Science And Engineering; 1.5.1 Numerical Python Library: Numpy; 1.5.1.1 Creating Numpy Arrays; 1.5.1.2 Using Array-generating Functions; 1.5.1.3 Index Slicing; 1.5.1.4 Read/write Data. 1.5.2 Data Visualization Python Library: Matplotlib1.5.2.1 Getting Started; 1.5.2.2 Multiple Axes; 1.5.2.3 Basic Text Commands; 1.5.2.4 Line And Marker Styles; 1.5.3 Scientific Python Library: Scipy; 1.5.3.1 Special Functions; 1.5.3.2 Bessel Functions; 1.5.3.3 Fresnel Integrals; 1.5.3.4 Interpolation; 1.6 Conclusion; Chapter 2: Gui Programming With Python And Qt; 2.1 First Steps In Gui Application Using Pyqt5; 2.1.1 Importing Pyqt5 And Creating A Pyqt5 Window; 2.1.2 Pyqt Classes; 2.1.2.1 Pyqt Application Structure; 2.1.2.2 Widgets, Events, And Signals; 2.1.2.3 Qlabel; 2.1.2.4 Qpushbutton. 2.1.2.5 Qspinbox2.1.2.6 Qslider; 2.2 The Qt Designer; 2.2.1 The Qt Designer Window; 2.2.2 The Property Editor; 2.2.3 Layout; 2.2.4 Qt Designer Preview; 2.2.5 Qt Ui File; 2.2.6 Matplotlib Widget; 2.2.7 An Example: Fraunhoffer Diffraction; 2.2.8 Conversion From Ui File To Python Code; 2.2.8.1 Using Line Command; 2.2.8.2 Using A Python Code; 2.2.9 The Application: Fraunhofer Diffraction; 2.3 Coding Gui Elements; 2.4 Conclusion; Chapter 3: Electromagnetic Waves; 3.1 Introduction; 3.2 Maxwellâ#x80;#x99;s Equations And Electromagnetic Waves; 3.3 Wave Equation; 3.4 Poynting Vector. 3.5 Phase Velocity And Group Velocity3.6 Harmonic Waves; 3.7 Python Code For Drawing A Wave; Chapter 4: Radiometry And Photometry; 4.1 Radiometry; 4.2 Photometry; Chapter 5: Fermatâ#x80;#x99;s Principle, Reflection, And Refraction; 5.1 Introduction; 5.2 Fermatâ#x80;#x99;s Principle; 5.3 Reflection; 5.3.1 Plane Mirrors; 5.4 Fresnel Reflection; 5.5 Refraction And Snellâ#x80;#x99;s Law; 5.5.1 Apparent Depth; 5.5.2 Glass Slab; 5.6 The Ray Equation; Chapter 6: Lenses And Mirrors; 6.1 Introduction; 6.2 Sign Convention; 6.3 Paraxial Approximation; 6.4 Refractive Power Of A Spherical Surface; 6.5 Focal Lengths. Vasudevan Lakshminarayanan [and Three Others]. Includes Bibliographical References And Index. Optics is an enabling science that forms a basis for our technological civilization. Courses in optics are a required part of the engineering or physics undergraduate curriculum in many universities worldwide. The aim of Understanding Optics with Python is twofold: first, to describe certain basic ideas of classical physical and geometric optics; second, to introduce the reader to computer simulations of physical phenomena. The text is aimed more broadly for those who wish to use numerical/computational modeling as an educational tool that promotes interactive teaching (and learning). In addition, it offers an alternative to developing countries where the necessary equipment to carry out the appropriate experiments is not available as a result of financial constraints. This approach contributes to a better diffusion of knowledge about optics. The examples given in this book are comparable to those found in standard textbooks on optics and are suitable for self-study. This text enables the user to study and understand optics using hands-on simulations with Python. Python is our programming language of choice because of its open-source availability, extensive functionality, and an enormous online support. Essentials of programming in Python 3.x, including graphical user interface, are also provided. The codes in the book are available for download on the book's website. Discusses most standard topics of traditional physical and geometrical optics through Python and PyQt5 Provides visualizations and in-depth descriptions of Python's programming language and simulations Includes simulated laboratories where students are provided a'hands-on'exploration of Python software Coding and programming featured within the text are available for download on the book's corresponding website.'Understanding Optics with Python by Vasudevan Lakshminarayanan, Hassen Ghalila, Ahmed Ammar, and L. Srinivasa Varadharajan is born around a nice idea: using simulations to provide the students with a powerful tool to understand and master optical phenomena. The choice of the Python language is perfectly matched with the overall goal of the book, as the Python language provides a completely free and easy-to-learn platform with huge cross-platform compatibility, where the reader of the book can conduct his or her own numerical experiments to learn faster and better.'— Costantino De Angelis, University of Brescia, Italy'Teaching an important programming language like Python through concrete examples from optics is a natural and, in my view, very effective approach. I believe that this book will be used by students and appreciated greatly by instructors. The topic of modelling optical effects and systems where the students should already have a physical background provides great motivation for students to learn the basics of a powerful programming language without the intimidation factor that often goes with a formal computer science course.'— John Dudley, FEMTO-ST Institute, Besançon, France "The aim of this book is twofold: first, to describe certain basic ideas of classical physical and geometric optics; second, to introduce the reader to computer simulations of physical phenomena."