## Input Files/Formatting

### Numeric Types

The input files consist of 3 different numeric types - positive integers, real non-negative numbers and complex numbers. You must check that all the input files are formated with the correct structure and data types, otherwise the behaviour of the main program can't be predicted and it may crash. Here are some examples to correct and incorrect formating of all the numeric types.

__Positive Integers Examples:__

- "1" - correct
- "20" - correct
- "0" - incorrect - the number is not positive
- "1.0" - incorrect - the number is not integer (in programmatic way) (corrected - "1")
- "-20" - incorrect - the number is not positive

__Real Non-Negative Numbers Examples:__

- "10" - correct
- "10.0" - correct
- "2.71828" - correct
- "0" - correct
- "-1" - incorrect - the number is not nonnegative

__Complex Numbers Examples:__

- "1+3i" - correct
- "1.0+3.0i" - correct
- "1+3.0i" - correct
- "1+0i" - correct
- "0+1i" - correct
- "1" - incorrect - the number missing imaginary part, which must be explicitly written (corrected - "1+0i")
- "3i" - incorrect - the number missing real part, which must be explicitly written (corrected "0+3i")
- "1+i" - incorrect -the imaginary part value must be explicitly written (corrected "1+1i")

### PSI.txt Input File

This file defines the quantum state (in Fock basis) which is coupled to the entrance of the waveguide array. Each line represents a different basis vector which is part of the represantation of the initial quantum state in Fock basis. The first number at each line is the __complex__ coefficient of the superposition of the initial state in Fock basis represantation. All the other numbers in line are __positive integers__, each of which implies injection of a **single** photon to a waveguide specified by its index. For a waveguide array with $M$ waveguides the range of valid indices is all the integers between $1$ and $M$. The number of indices may vary from line to line. All the numbers in a line must be seperated by a comma (","). The last number in a line must not have a coma following it. All the complex coefficient are not required to be normalized (such that $\sum_i |c_i|^2=1$) - the program normalizes the coefficients automatically.

Consider the following PSI.txt file:

For $M=3$ waveguides its interpretation is $|\psi_0\rangle = \underbrace{{1 \over 2} |010\rangle}_\text{Line 1} +\underbrace{{i \over 2} |020\rangle}_\text{Line 2} +\underbrace{{-1-i \over 2} |111\rangle}_\text{Line 3} $

For $M=5$ waveguides its interpretation is $|\psi_0\rangle = \underbrace{{1 \over 2} |01000\rangle}_\text{Line 1} +\underbrace{{i \over 2} |02000\rangle}_\text{Line 2} +\underbrace{{-1-i \over 2} |11100\rangle}_\text{Line 3} $

For $M=2$ waveguides the input file is invalid - it tries to inject a photon to 3rd waveguide, wheras the array has only 2 waveguides.

### H.txt Input File

This file stores the Hamiltonian of the waveguide array, which defines the propagation and coupling properties of the system. For a waveguide array which consists of $M$ waveguides, the Hamiltonian is a hermitian $M \times M$ matrix. For a waveguide array which consists of $M=5$ waveguides the first line in the file will be "M 5" (the number is __positive integer__, notice uppercase style for M). The purpose of this line is to tell to the main program the size of the Hamiltonian, so it could preallocate memory to store the following matrix entries. The second line and beyond are the lines of the Hamiltoniam matrix. Each element is a __complex number__. All the elements in a line are seperated by a comma (","). The last element in the line should not have comma following it. Notice that because of the scalability of the problem, the elements of Hamiltonian file have no units.

Consider the following H.txt file:

This Hamiltonian defines an array of 5 identical waveguides, all with propagation constant of $\beta=1$ and nearest neighbour coupling with identical coupling coefficients that equal to $c=0.1$ (coherent coupling). Notice the first line which specifies the size of the Hamiltonian matrix.

### Z.txt Input File

This file consists of information about the $z$ values at which the intensities and correlations are wished to be calculated at. Notice - because of the scalability of the problem soved, the $z$ values have no units. There is an appropriate scaling between the $z$ values and the Hamiltonian entries (propagation constants and coupling coefficients). There are two possible methods to specify the $z$ values - "LIST" and "RANGE" (notice uppercase). The first line in the file must be the name of the method used. The second line should specify the values appropriate to the method chosen.

By specifying "LIST" method - the second line in the file should be a list of the $z$ values for the main program. The values should be comma seperated. The last value should not have comme following it. In this method all the values are __real nonnegative__. Example to such a file -

This file specifies 4 specific $z$ values for evaluation -

- $z = 0$
- $z = 1$
- $z = 1.2$
- $z = 1.234$

By specifying "RANGE" method - the second line should include (exactly) 3 numbers - minimal $z$ value, maximal $z$ value and the number of $z$ values in this range. In this method the first 2 values (minimal and maximal $z$ values) are __real nonnegative__, and the 3rd number is __positive integer__. The minimal and maximal values should be distinct, and the 3rd number must be at least 2. The last value should not have comma following it. Example to such a file -

This file specifies 7 $z$ values, which are

- $z = 5$
- $z = 5.833$
- $z = 6.667$
- $z = 7.5$
- $z = 8.333$
- $z = 9.1666$
- $z = 10$

(The actual values have double precision)