⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 introduction.html

📁 麻省理工的计算光子晶体的程序
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><TITLE>Introduction</TITLE><LINK rel="Contents" href="index.html"><LINK rel="Copyright" href="license.html"><LINK rel="Start" href="index.html"></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF">Go to the <a href="installation.html">next</a> or <a href="index.html">main</a> section.<hr><h1>Introduction</h1><p><strong>MIT Photonic-Bands</strong> is a software package tocompute definite-frequency eigenstates of Maxwell's equations inperiodic dielectric structures.  Its primary intended application isthe study of <strong>photonic crystals</strong>: periodic dielectricstructures exhibiting a band gap in their optical modes, prohibitingpropagation of light in that frequency range.  However, it could alsobe easily applied to compute other optical dispersion relations andeigenstates (e.g. for conventional waveguides such as fiber-optic cables).<p>This manual assumes that the reader is familiar with concepts fromsolid-state physics such as eigenstates, band structures, and Bloch'stheorem.  We also do not attempt (much) to instruct the reader onphotonic crystals or other optical applications for which this codemight be useful.  For an excellent introduction to all of these topicsin the context of photonic crystals, see the book <ahref="http://shop.barnesandnoble.com/booksearch/isbnInquiry.asp?isbn=0691037442"title="the book at BarnesandNoble.com"><i>Photonic Crystals: Moldingthe Flow of Light</i></a>, by J. D. Joannopoulos, R. D. Meade, andJ. N. Winn (Princeton, 1995).<p>Some of the main design goals we were thinking about when wedeveloped this package were the following (see also the <ahref="http://ab-initio.mit.edu/mpb/index.html#features">featurelist</a> at the MPB home page):<ul><li>Fully vectorial, three-dimensional calculations for arbitraryBloch wavevectors.  (The only approximation is the spatialdiscretization, or equivalently the planewave cutoff.)<p><li>Flexible interface.  Readable, extensible, scriptable...seealso the <ahref="http://ab-initio.mit.edu/libctl/doc/introduction.html">libctldesign goals</a>.<p><li>Parallel.  (Can run on a single-processor machine, but is alsosupports parallel machines with MPI.)<p><li>"Targeted" eigensolver: find modes nearest to a specifiedfrequency, not just the lowest-frequency bands.  (For defectcalculations.)<p><li>Leverage existing software (LAPACK, BLAS, FFTW, HDF, MPI, GUILE...).<p><li>Modularity.  The eigensolver, Maxwell's equations, user interface,and so on, should be oblivious to each other as much as possible.This way, they can be debugged separately, combined in various ways,replaced, used in other programs...all the usual benefits of modulardesign.<p><li>Take advantage of inversion symmetry in the dielectricfunction, but don't require it.  (This means that we have to handleboth real and complex fields.)</ul><h2><a name="freq-vs-time">Frequency-Domain vs. Time-Domain</a></h2><p>There are two common computational approaches to studyingdielectric structures such as photonic crystals: frequency-domain andtime-domain.  We feel that each has its own place in a researcher'stoolbox, and each has unique advantages and disadvantages.  <b>MPB isfrequency-domain</b>; that is, it does a direct computation of theeigenstates and eigenvalues of Maxwell's equations (using a planewavebasis).  Each field computed has a definite frequency.  In contrast,time-domain techniques iterate Maxwell's equations in time; thecomputed fields have a definite time (at each time step) but not adefinite frequency <i>per se</i>.  It seems worthwhile to say a fewwords about each method, and to explain why we want a frequency-domaincode.  (Our group has both time-domain and frequency-domain software,and we use both techniques extensively.)<p>Time-domain methods are well-suited to computing things thatinvolve evolution of the fields, such as transmission and resonancedecay-time calculations.  They can also be used to calculate bandstructures and for finding resonant modes, by looking for peaks in theFourier transform of the system response to some input.  The mainadvantage of this is that you get all the frequencies (peaks) at oncefrom a calculation involving propagation of a single field.  There areseveral disadvantages to this technique, however.  First, it is hardto be confident that you have found all of the states--you may havecoupled weakly to some state by accident, or two states may be closein frequency and appear as a single peak; this is especiallyproblematic in higher-order resonant-cavity and waveguidecalculations.  Second, in the Fourier transform, the frequencyresolution is inversely related to the simulation time; to get 10times the resolution you must run your simulation 10 times as long.Third, the time-step size must be proportional to the spatial-gridsize for numerical stability; thus, if you double the spatialresolution, you must double the number of time steps (the length ofyour simulation), even if you are looking at states with the samefrequency as before.  Fourth, you only get the frequencies of thestates; to get the eigenstates themselves (so that you can see whatthe modes look like and do calculations with them), you must run thesimulation again, once for each state that you want, and for a timeinversely proportional to the frequency-spacing between adjacentstates (i.e. a long time for closely-spaced states).<p>In contrast, frequency-domain methods like those in MPB are in manyways better-suited to calculating band structures and eigenstates.(Here, we consider the case of an <em>iterative</em> eigensolver likethe one in MPB, which iteratively improves approximate eigenstates.Dense solvers, which factorize the matrix directly, are impracticalfor large problems because of the huge size of the matrix, and becausethey compute many more eigenvectors than are desired.  In iterativemethods, the operator is only applied to individual vectors and isnever itself computed explicitly.)  First, you don't have to worryabout missing states--even closely-spaced modes will appear as twoeigenvalues in the result.  Second, the error in the frequency in aniterative eigensolver typically decays exponentially with the numberof iterations, so the number of iterations is logarithmic in thedesired tolerance.  Third, the number of iterations typically remainsalmost constant even as you increase the resolution (the work for eachiteration increases, of course, but that happens in time-domain too).Fourth, you get both the frequencies and the eigenstates at the sametime, so you can look at the modes immediately (even closely-spacedones).<p>A traditional disadvantage of frequency-domain methods was that youhad to compute all of the lowest eigenstates, up to the desired one,even if you didn't care about the lower ones.  This was especiallyproblematic in defect calculations, in which a large supercell isused, because in that case the lower bands are "folded" many times inthe Brillouin zone.  Thus, you often had to compute a large number ofbands in order to get to the one you wanted (incurring large costsboth in time and in storage).  These disadvantages largely disappearin MPB, however, with the advent of its "targeted" eigensolver--withit, you can solve directly for the localized defect states (i.e thestates in the band gap) without computing the lower bands.<h2><a name="history">History</a></h2><p>In order to shed some light on the past development and designdecisions of the Photonic-Bands package, I thought I'd write a fewparagraphs about its history.  Read on to enjoy my narcissistramblings.<p>Many different people have written codes to compute the modes ofperiodic dielectric materials (although we don't know of any othersthat have been freely released).  I have had experience with severalprograms written within our group, and this experience has guided thedesign of MIT Photonic-Bands.<p>The first program of this sort that I came in contact with, and thecode that was used in our group until the development of this package,was initially written around 1990 (in Fortran 77) by R. D. Meade.  Asthis software grew organically over time, several problems becameapparent.  First, the input format was inflexible (difficult to addnew features without breaking old simulations), sensitive towhitespace and other formatting, and required repeated entry ofinformation that was often the same from file to file.  Often, pre-and post-processing steps were required using additional scripts andtools.  Second, the many parts of the program had become intertwined,lacking modularity or a clear flow of control; this made it difficultto follow or modify substantially.  Parallelizing it, or removingconstraints that it imposed like inversion symmetry, or even replacingthe input format seemed impractical. Besides, even reading code withvariables named <code>gxgzco</code> (in common block<code>cabgv</code>) (honest!) is a mind-altering experience.<p>After an initial experience in the Spring of 1996 at writing a codebased on a wavelet, rather than a planewave, basis (which turned outnot to be practical), I set out to write a replacement for our Fortraneigensolver.  My main aims at this time (Fall 1996) were a moreflexible and powerful input format and a code that would be amenableto parallelization.  I succeeded in achieving a working code withsimilar convergence to the old code (after <ahref="http://prola.aps.org/abstract/PRB/v55/p15942_1">some pain</a>),but I discovered several things.  I had lots of fun learning to use<code>lex</code> and <code>yacc</code> (Yet Another Compiler-Compiler)to make a flexible, C-like input format with variables and otheradvanced features.  Having input files that were almost, but notquite, like a programming language made me realize, however, that whatI really wanted <em>was</em> a programming language--no matter howmany features I added, I always wanted one more "simple" thing.  Asfar as parallelization, I quickly realized that I had a problem: Ineeded a parallel FFT, and the only ones that were available wereproprietary (non-portable), used incompatible data distributionformats, and were often designed to be called only from speciallanguages like HPF.  That, plus my dissatisfaction with the availablefree FFTs, led me to embark on a side project (with my friend MatteoFrigo of MIT's Laboratory for Computer Science) to develop a new, freeFFT library, <a href="http://www.fftw.org">FFTW</a>, that includedportable parallel routines.  Also, I decided that attempting tosupport too many models of parallel programming (threads, MPI, Cray<code>shmem</code>) in one program resulted in a mess; it was betterto stick with MPI (supporting running only a single process too, ofcourse).  Another mistake I discovered was that I allowed theeigensolver to get too intertwined with the specific problem ofMaxwell's equations--the eigensolver knew about the data structuresfor the fields, etcetera, making it difficult to plug in replacementeigensolvers, test things in isolation, or to implement features likethe "targeted" eigensolver of Photonic-Bands (which diagonalizes adifferent operator).  The whole program was too mired in complexity.Finally, in the interim I had learned about block eigensolveralgorithms.  Not only can such algorithms leverage prepackaged,highly-optimized routines like BLAS and LAPACK, but they also promisedto be inherently more suited for parallelization (since they removethe serial process of solving for the bands one by one).  All of thesethings convinced me that I needed to rewrite the code again fromscratch.<p>So, I started work on the new package (in Spring 1998), this timedetermined to develop and debug each component (matrix operations,eigensolver, maxwell operator, user input) in isolation.  At the sametime, I was thinking about how I would implement the user controllanguage, wanting to develop a general tool that could be applied toother problems and software in our research.  It seemed clear that, inorder to get other people to use it in their programs, as well as toavoid a lot of the manual labor that went into my previous effort, Iwanted to automatically generate the user/program interface from anabstract specification.  As for the control language, I brieflyconsidered implementing my own, but was happily led to GNU Guileinstead, which gave me a powerful language with little effort.  Soarmed, I set out to write libctl (which generates the Guile interfacefrom an abstract Scheme specification), partially as an experiment tosee how hard it would be and what the result would look like.  After aweekend of work, it was obvious that I had a powerful tool; I spentcouple of weeks adding some finishing touches, writing documentation,and so on, and proudly showed it off to my groupmates in the hope thatthey could use it for their programs.  Without a real example of aprogram using libctl, however, it was hard to convince them to plug ascripting language into their existing, working codes.  So, I wentback to puttering at my eigensolvers.<p>Of course, all this time I was allegedly doing real research, andlong periods would go by with little progress on the Photonic-Bandspackage.  The original, Fortran code was still working, and in timeone learned to bear its quirks and limitations with stoicism, althoughwe cringed every time we had to show it to anyone else.  By the summerof 1999, I had a working block eigensolver (supporting severaliteration-scheme variants), a Maxwell operator to plug into theeigensolver (including a "targeted" operator, whose convergence I wasunhappy with), and a test program to do convergence experiments onbands of a Bragg mirror.  I hadn't attached any general userinterface, field output, or other necessary components.  At thispoint, Dr. Doug Allan of Corning (a former student ofProf. Joannopoulos), heard about the new code--in particular, thetargeted eigensolver--and began clamoring to try it out.  Not put offby my excuses, he asked for a copy of my current code, regardless ofits status, to play with.  Not wanting to refuse, but aghast at theprospect of someone seeing my masterpiece only half-painted, I toldhim to give me a week...in which time I added the interface anddiscovered that I had a useful tool. Over the next week, I added manyfeatures, fixed bugs, and wrote documentation, drawing near to arelease at last...<hr>Go to the <a href="installation.html">next</a> or <a href="index.html">main</a> section.</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -