Chapter 1 Introduction Nanophotonics and spectroscopy have developed rapidly in recent years[1-2]. The experimental research on nanophotonics is blooming. In addition to experimen- tal research on the principles and applications of nanophotonics, computational simulation research on its various physical mechanisms and phenomena is equally important[3-5]. The simulation of the optical properties of molecules or crystals, such as electronic spectra (absorption and emission spectra, etc.), vibrational spec- troscopy has an extraordinary guiding signi.cance for experiments. In addition to the calculation and simulation of phenomena, the current computational simulation technology can also explain and analyze the physical mechanisms contained in these phenomena[6]. However, there are many modern computing simulation technology programs, and the usage methods and applicable scenarios are also very di.erent. For users who are new to computational simulation, the threshold for conducting scienti.c research activities based on computational simulation is very high. For researchers who already have a certain foundation, it is di\cult to master all kinds of software programs, strange keywords and programming languages, and a series of script auxiliary programs. Therefore, beginners need a detailed book to get started with this technology, and those who have the basics need a desk book to quickly query commands and script usage. Therefore, this book is an introductory book and a long-term desk book for graduate students and general researchers who need to be engaged in photonics and optics. You will encounter three concepts in computing simulation: modeling, comput- 2 Computational Simulation in Nanophotonics and Spectroscopy ing and simulation. Modeling is the premise of computation and simulation, and refers to the logical process of combining actual scenes with calculations, such as how to choose methods, how to set up systems, and load conditions[7]. Computation is parallel to simulation. Generally, computation is to obtain a con.guration (molec- ular structure) or properties of a small system, such as .rst-principles calculation and DFT. Computation requires relatively high accuracy of results, and generally requires mathematical knowledge, so it can be called calculation. Simulation focuses on the description of \evolution", such as phase .eld method and molecular dynam- ics, and is generally used to test whether the conclusions obtained from experiments can be explained by microscopic processes. There may be a phenomenological theory in simulation. The phenomenological theory is a simpli.cation of the real scene and is used to expand the processing scale. The .nite element method is also generally classi.ed as simulation (maybe because it is often inaccurate). For example, for metal matrix composites, the simulation of mechanical properties is based on .nite element, modelling is the geometric model and the constitutive relationship; the interface bonding simulation is based on molecular dynamics, and modelling is the possible orientation relationship and atomic species; the physical properties of the precipitated phase are calculated. Based on .rst principles, modelling is the type of lattice, etc. A large number of modeling and calculations exist in materials science and engineering. Computational materials science has been widely discussed as early as around 1990, and there are many outputs. Computational materials science is not an \aspect", it is a large subject, and the gap between di.erent methods is like ceramics and polymers. You need to be clear enough about what you want to do, what method to use, and then read the literature extensively to judge the prospects. Machine learning has been widely used in materials science. Typical examples are high-entropy alloy composition design and amorphous metals. It should be noted that the machine learning method is only a data processing method. It is good at discovering laws from data, but data is the most rare in materials science. In materials research, why do we need rational design and computational simu- lation? In other words, what is the di.erence between material rational design and Chapter 1 Introduction 3 computational simulation and traditional research, and what opportunities does it bring to materials science research[8-9]? What is the development trend of China and the core science and technology that need to be focused and prioritized? As we all know, the development of advanced materials is the basis of scienti.c and technological progress and the forerunner of high-tech development, and is the key to improving national. What are China's development trend and the core science and technology that need to be focused and prioritized? As we all know, the de- velopment of advanced materials is the basis of scienti.c and technological progress and the forerunner of high-tech development, and is the key to improving national competitiveness. For a long time, the .eld of materials science has relied on exper- iment and empirical model theory. Understanding the properties of di.erent ma- terials, adopting the model of \experience-guided experiment", optimizes material performance and explores new materials along the chain of \processing-structure- property-performance". The development cycle is long and the cost is high. Shorten the development cycle of new materials and reduce. The research and development cost and the realization of the \reverse" material structure, composition and pro- cessing plan from the speci.c performance are the ultimate goal of materials science research. The realization of this goal requires the rational design and computational simulation of materials. Understanding of materials has gone from the macro to the micro, and has experienced the scienti.c paradigm of \experience" and \mod- els". For example, the law of thermodynamics is a theoretical model with broad meaning. But over time, for many scienti.c problems in materials, theoretical mod- els Increasingly complex, it is impossible to analyze and solve directly. In recent decades, computers' rapid development has allowed people to calculate and simulate the complex real world based on \theoretical models", which is a new paradigm for materials science research. As the third paradigm of materials science research, the rational design and computational simulation of materials can be regarded as using computers to carry out \experimental" research (theoretical experiment). By preparing \samples" (building models), the development of advanced \experimen- tal instruments" (theoretical methods, calculation methods and procedures, etc.), 4 Computational Simulation in Nanophotonics and Spectroscopy obtain the original \experimental data" (calculation results). Compared with tra- ditional experimental research, the rational design of materials is computational simulation can use theoretical models to process, summarize, and analyze compu- tational data to obtain observable physical quantities and reveal the structure of materials at the atomic level through electronic structure calculations based on .rst principles. The internal connection between physical properties and the exploration of microscopic mechanisms. This di.erence allows us to predict the structure and performance of materials through computational simulation research and establish the relationship between the structure and physical properties of the material at the atomic level and further design for speci.c properties new materials. The research mode of materials has changed from the traditional \experience guided experiment" to \rational design and calculation simulation, experimental veri.cation", short- ening the research and development cycle of new materials. In addition, the fact that cannot be ignored is that computers are getting cheaper and unit calculations capabilities are getting stronger and stronger; on the contrary, the requirements for experimental technology in the exploration of new materials are getting higher and higher, and the cost of experiments is increasing rapidly; if the rational design and computational simulation of materials can quickly provide su\ciently accurate results, at the same time, the computational cost will become more than experimen- tal. When it is lower, the R&D cost of new materials can be reduced through the rational design and computational simulation of materials. The most challenging core problem facing the rational design and computational simulation of materials is how to quickly obtain su\ciently accurate results to guide experimental research. The answer to this question is the \experimental instrument" that the Institute of Material Rational Design and Computational Simulation relies on. Therefore, the core science and technology that we need to focus on and prioritize is developing advanced theoretical calculation methods and software. The real material system spans a large time and space scale, and the issues involved are complex. Structure is the most basic problem in material science re- search and the basis of material performance. Due to the highly complex potential Chapter 1 Introduction 5 energy surface of materials. It has long been a challenge to predict the possible structure of a material from a given chemical composition. The performance of a material is determined by the nature of the material's response to the external .eld (force, heat, light, electricity, magnetism, etc.) in the service environment problems. All depend on the electronic state of the material, and the description of the elec- tronic structure of the material system often requires the calculation of the electronic structure based on .rst principles. Although the world has taken the lead in devel- oping a series of quantum chemical calculation methods and software, it initially and satisfactorily solves the problem of the ground state electronic structure of simple material systems. However, real material systems' performance generally involves electronic excited states, excited state evolution dynamics, and surface reaction dy- namics. Development of electronic structure calculation methods and programs can be bescribing the electronic structure of complex material systems quickly and ac- curately is the key to determining the e\ciency and reliability of material rational design and computational simulation. On the other hand, with the improvement of experimental technology and computing power. The ability to collect \big data" has greatly exceeded our ability to analyze this data. The development trend of rational design and computational simulation: collecting and integrating data generated by experiments and computational simulations in materials science research, combin- ing basic physical principles, databases, information science, and machine learning technology to decipher the material \processing-structure-property" research chain is driven by \big data" to drive the rational design and computational simulation of new materials. Although similar \big data" driving technologies have been widely used in many .elds, the unique data complexity of the material .eld And diver- sity requires the development of new big data methods and procedures to further promote the rapid, quantitative and reliable prediction of material structure, perfor- mance and dynamic evolution process, and .nally realize the rational design driven by material \big data". Under the background, in 2011, the National Science and Technology Commission of the United States issued the \Material Genome Project", which combines three technologies such as high-throughput computing, experiments 6 Computational Simulation in Nanophotonics and Spectroscopy and special databases to collaboratively improve the level of material manufactur- ing and enhance the national competitiveness of the United States. At the same time, Chinese scientists have also taken active actions to meet this opportunity and challenge, and laid out Chinas Material Genome Project[10]. It can be said that the core of the Material Genome Project is to rationally design materials based on cal- culations and big data analysis. In general, as a new paradigm for materials science research, the rational design and computational simulation of materials will promote the rapid development of materials science research. At the same time, the rational design and computational simulation of materials, as the core foundation of ma- terial genome genetic engineering, are urgently developing independent intellectual property rights and international leadership. The computing method and software platform of the company will be the key to whether we can seize this opportunity and achieve a leading position. This book introduces the principles and applications of computational simulation problems in nanophotonics and spectroscopy. It is mainly divided into two parts: principle and program application. The calculation principle can also be divided into quantum mechanics calculation and classical mechanics simulation. It mainly uses .rst-principles techniques in the framework of quantum mechanics and quantum chemistry to simulate and analyze molecular systems and solid systems and their surfaces; and use classical electromagnetic .eld theory to perform .nite element calculations on the optical properties and phenomena of materials. Including the analysis and application of subwavelength optics and surface plasmons. While intro- ducing the principles, theories, and physical formulas, this book will also list speci.c calculation and simulation methods, such as program input .les, model building methods, and subsequent analysis and drawing methods. Some batch-processing utility script programs will also be given for the convenience of users. This book aims to enable beginners to get started with computational simulation technology as soon as possible and get help from the book for a long time. For colored .gure please scan the QR code.