The simulator works on a principle that the circuit is divided in short segments. Every component in the circuit contains an integer number of segments which all have the same length. The simulation make steps in time. The size of these time steps is equal to the time it takes for the light to travel through a segment. The total time interval that one would like the simulate is given in the number time steps that must be calculated. For each time step the photon density and phase for light going from Left to Right and for light going from Right to Left as well a the carrier density is calculated.
Open the file PHIsimv3_pars_InGaAsP_ridge.txt (click on the link).
The file contains a number of lines. Each line starts with a number. After the number a description is given. Don't worry (yet) about the values of the different parameters describing the behavior of the amplifier, loss of waveguides etc. Look for the lines which have the <------ in the comment. The first one from the top indicates the where the central wavelength is defined (1500 nm in this case). Then the next <----- is at the refractive group index and the <----- after that defines the optical path length of the segment in terms of number of central wavelength. This must be an integer number. The physical path length of a segment is thus the number of wavelengths times the wavelength divided by the refractive index. See also this page.
The next <----- indicates the number of time steps in the simulation. In this example 50000. The total time simulated is therefore 50000 * the number of wavelengts per segment * (vacuum) wavelength / (vacuum) speed of light.
The <----- below that specifies (part of) the name of the output files. The main output file with the data at the IO points for each time step gets the name "PHIsimout.txt" in this example. Other output files start with the name PHIsimout.
Then the next two <----- arrows indicate two numbers related to storing data in files that can be used for making videos or looking at the simulation in detail. If the first number is negative nothing is stored. If the first number is N (N>= 1) then every N time steps for every segment in the circuit the photon densities and phases (Left to Right and Right to Left) and carrier density are stored in five separate files. The second number indicates from which time step the storage of data starts. One has to be a bit careful in this starting point, these files quickly become very large. The data in these files can be used to make e.g. a video or they can be viewed using the PHIsim_view application. This application is described on a separate page.
Please note that the parameter value always needs to be the first thing on a new line and that it always need to be followed by characters. These characters are ignored, so you can write as much comment on the line are you want.
This is enough information for now on the parameter input file. We now start to look at the file with the device description.
Open the file device_input_Fabry_Perot_laser.txt (click on the link)
The file contains three main section or lists: the first is a list of components, the second is a list of connections between the components, the third is a list of sources. After these list one can add as much text as one wants.
The file starts with the list of circuit components. Each line defines one component. The first is the name of the component. It has to be unique. In the example all the names have 9 characters but you can make the names much longer or keep them shorter. Making the names equally long as done in the example by using underscore makes the file more readable in practice. After the name follows a number which indicates the type of component. Check the Circuit Components page for a listing of all possible components. The numbers and components types are also listed at the end of the example file. Then depending on the type of component there are more arguments. E.g. for a passive waveguide the length in units of number of segments is given. After the last argument there need to be at least one character. This can be used for comments as can be seen in the example.
Check all the circuit components in the example file and check all the parameters.
The device is an extended cavity linear laser. It has an unbalanced Mach-Zehnder interferometer inside. The reason for this is discussed at a later stage.
Note the list is ended by "-1 -1 #". The two IO segments LEFT_I/O, number 8 and RIGHT_IO, number 9, always have to be included in the list.
Then follows the list of connections. The list of connections consists of lines where each line describes one connection. Each line has the following structure:
name_comp_left port_ID_comp_left name_comp_right port_ID_comp_right # plus any text e.g with comments
The line makes that there is an optical connection between a component on the left hand side (name_comp_left) and a components on the right hand side (name_comp_right). Now a component can have multiple connections on the left and the right hand side. Each possibility for a connection on a component is named a port. For instance a splitter can have one port on the left and two ports on the right. That is why there is always a port_ID after the name. The port_ID is the character R or L (a port on the right hand side of the component, or on the left) plus a number starting from 0. E.g. R0, or L1 are port_IDs.
Check all the connections in the example file. All connections indicate from Left to Right.
IMPORTANT: All ports on all circuit components in the list must be connected. There is a special termination components for 'open' ports. Note that you need a pencil and paper to check this manually even for a simple circuit.
The list ends with a line xxx -1 xxx -1 # .
Then there is the list of sources. Optical amplifiers (SOA), saturable absorbers(SA) and phase modulators (ERM) need sources. In the example there is only an SOA which is connected to source number 0 (see component list). In the only line for the source list you see that source 0 is set at 0.2 Amps. This is a constant value for the simulation. It is also possible to provide time dependent signals in the input files for sources. But for now we use DC only.
The list is ended by "-1 -1 #" and the remainder of the file can be used for comments and other text.
More details on the device input file are presented on the page Device Input File.
The program PHIsim_inputv3 produces an input file for the program GraphViz so you can check the input more easily. The file PHIinput_graph.gv is generated. The extension .gv indicates it is GraphViz input file.
Download the software from the GraphViz website and install it according to the instructions. Please note that for Windows it is best to download version 2.38 via this link. This version has the program gvedit.exe which is easiest to use to generate the graphs. The current Windows installers do not install gvedit.
The .gv files can be opened in a text editor. It contains the so-called dot language and the file can be easily modified manually if needed (for documentation purposes e.g.).
Once GraphViz is installed you can double click the .gv file. This will open the .gv file and the editor will open and a screen in which you can see the graph presented below. This can be saved as e.g. a .png file (automatically).
This is all very interesting I here you say. But I would like to see what has been calculated and analyse the results. This can be done in a number of ways.
On the next page we will see how the simulations can run using a scripting language such Python.