\documentclass[12pt,letter,notitlepage]{article}
\usepackage{url,graphicx,bm,latexsym,amsmath,amssymb,comment,diagbox}
\pagestyle{plain}
\textwidth 6in
\textheight 9in
\topmargin -0.75in
\oddsidemargin 0.25in

%-----------------------
\begin{document}

\title{Perceived Randomness: Pseudo-Random Number Generators \& Human Interpretation}

\author{Kyle Carson \\
\url{kylecarson@cs.ucsb.edu} \\
Department of Computer Science \\
University of California Santa Barbara
}

\date{June 17, 2017}

\maketitle % \thispagestyle{plain} \thispagestyle{empty}

\begin{abstract}
Random number generators represent a core building block within cryptography, in some cases forming the basis of software and hardware encryption. While true randomness requires specially designed hardware, many software implementations, known "pseudo-random" or "deterministic" number generators, exist. From efficiency of computation to the level of precision, these software-implemented algorithms differ along many vectors. In applied cryptography and beyond, there exist instances where humans directly interacting with the results of these generators may interpret them with their own concept of what is considered random. In this paper, we compare various DRNGs in terms of multiple quality metrics. As an additional exercise, we analyze the shortcomings of these algorithms against human interpretation, and design a method which introduces various types of biasing to these generators with the intent of improving the "perceived randomness".
\end{abstract}

\section{Introduction}

While many deterministic number generators, or "DRNGs", share a basis in modular arithmetic of primes, the finer details of their implementation tend to play a crucial role in their overall performance. Contrary to "true" random number generators which are designed at the hardware level around some source of classical or quantum physical entropy, the randomness of DRNGs is backed by certain assumptions about the complexity or irreversible nature of the building blocks used to form the algorithms.

For a DRNG algorithm to be considered for all intents and purposes cryptographically secure, there exists a general set of properties and behaviors that need to be met. The algorithm should take some k-bit input as a seed, preferably from a source of true randomness, and should output some n-bit random value. Some part of this output should then contribute to the seeding of the next call to the algorithm, in a way that produces a statistically uniform distribution of random values over multiple calls. Of important note here is that, for a given seed, successive calls to a DRNG algorithm will produce some statics stream of values. That is, if one were to make successive calls again to the algorithm with the same initial seed as before, the stream of values produced will be exactly the same as before.

Some tests used to quantify the algorithms include the polynomial-time statistical test, which holds if no polynomial-time approach can distinguish the statistical difference of randomness between a DRNG and a truly random generator with probability greater than 0.5. Another test, the next-bit test, holds true if for the first m-bits of some output O, the m+1 bit cannot be predicted with statistical probability greater than 0.5. Following the basic model for structuring the algorithm and passing these tests quantifies a DRNG algorithm as cryptographically secure.

\section{DRNGs}

To attain a more applied understanding of these algorithms as described above, we've implemented seven different approaches including LCG, BBS, RSA, MSRSA, RAB, PG, and NR. Below we discuss the general principles for each algorithm, and anything of interest regarding each algorithms' actual implementation. All of the code was written in C, and can be found at \url{https://github.com/carsonkk/drngs}.

\subsection{LCG}

Linear Congruential Generator is a simple deterministic algorithm based on modular arithmetic of the previous output to produce the next output:
\[x_{\text{i+1}} = a * x_i + b ({\text{mod n}})\]
Depending on the values used to seed the algorithm, a sequence of some static window size is formed, such that once all of the values in the window have been produced, the sequence will wrap back around and repeat itself. There's many different options for what values to set the multiplicative and adder factors too depending on the application, however going by ANSI standard we set $a = 1103515245, b = 12345, n = 0x80000000$.

\subsection{BBS}

Blum-Blum-Shub is based on the following equation, where the modulus value is the multiplication of two large primes:
\[x_{\text{i+1}} = x_i^2 ({\text{mod n}})\]
\[n = p*q\]
Some important properties must hold for the algorithm to behave as desired, including the seed value and n being co-prime and the primes $p, q$ should both be congruent to $3{\text{mod 4}}$. The actual output of the single pass is used to seed the next pass, however the only information used from an output towards the generated value is a singular bit of the output. Common bit outputs include even parity, odd parity, and the least significant bit. Therefore to actually generate a value, one must define some desired level of precision and run the algorithm that many times to fully form a generated value.

This pattern of using a single bit and doing multiple passes for some level of precision is quite common, and ends up being used in all of the following algorithms

\subsection{RAB}

The Rabin algorithm is a modified form of the the BBS algorithm:
\[x'_{\text{i+1}} = x_i^2 ({\text{mod n}})\]
\[x_{\text{i+1}} = (x'_{\text{i+1}} < n/2) \text{ ? } x'_{\text{i+1}} \text{ : } n - x'_{\text{i+1}}\]
\[n = p*q\]

\subsection{RSA}

RSA like many of these algorithms is based on the factoring problem, using a much more involved series of equations to generate its asymmetric results:
\[x_{\text{i+1}} = x_i^e ({\text{mod n}})\]
\[e \in [2,\phi-1] {\text{ with }} gcd(e,\phi) = 1\]
\[\phi = (p-1)*(q-1)\]
\[n = p*q\]

\subsection{MSRSA}

A modified version of RSA, in this case referred to as Micali-Schnorr RSA, improves the overall efficiency of traditional RSA. Simply speaking, this is done by extracting more bits from each exponentiation, making modifications to both the range for the exponent $e$ and how the bits for both successive seeding and output are chosen.

\subsection{PG}

The Power Generator algorithm derives its strength from using primitive elements of a set for a given primes to perform modular exponentiation. Due to how expensive it is to compute primitive elements for significantly large primes, we pre-computed a set of primes and associated primitives and used them to drive the algorithm. While this greatly increased the efficiency of the computation, a less than desirable result of this was a significant limit on the range of values that could be generated, particularly when using smaller primes. A better approach would be to invest the computational power to generate primitives for large primes and index them for future use, however this would take a non-trivial amount of time to complete.
\[x_{\text{i+1}} = g^{x_i} ({\text{mod p}})\]

\subsection{NR}

The Naor-Reingold algorithm is similar to the Blum-Blum-Shub algorithm in that tis complexity is dependent upon the inability of an attacker to factor large prime integers. It uses a few building blocks of its own for it's computation, including a binary vectoring function, a modular product function, and a integer vector comparison function. The binary vectoring function ($bin_k(u)$) takes two integer parameters, $k$ and $u$, and translates the $k$-least-significant-bits of $u$ into a binary vector array. If $u$ has less bits than the value of $k$, the vector array's most-significant-bits are padded with 0's. The modular product function ($dot$) takes two binary vectors of the same length and takes the summation of the products of each bit from the two vectors, applying a modulus of 2 to the result. Finally the vector comparison function ($f(A,b)$) takes two vector parameters, $A$ which is of integers and length $2k$, and b which is a binary vector of length $k$. The values in $A$ are in pairs, where the first value is relevant if the corresponding bit in $b$ is 0, or the second value is relevant if the bit is 1. Thus the function selects each of the relevant integers from $A$ using $b$, then returns their summation. These functions are then used in the actual computation of the generated value:
\[b = {\text{bin}}_k(i)\]
\[u = f(A,b)\]
\[v = g^u ({\text{mod n}})\]
\[x_{\text{i+1}} = x_i {\text{ dot }} {\text{bin}}_{2k}(v)\]

\section{Testing}

\subsection{Setup}

The test setup for measuring the quality of each algorithm was based on two inter-related metrics: CPU cycles and real-world time of execution. To somewhat normalize the precision between each algorithm, each one's random function call uses the same methodology as LCG in which the upper-order magnitude of bits is used when returning the actual output. The experiment was performed multiple times, varying the number of successive calls made to each algorithm as outlined below in Table 1 and Table 2.

\begin{table}
\centering
\begin{tabular}{|l||*{7}{c|}}\hline
\backslashbox{Algo}{Calls}
&\makebox[3em]{10}&\makebox[3em]{25}&\makebox[3em]{100}&\makebox[3em]{250}
&\makebox[3em]{10000}&\makebox[3em]{100000}&\makebox[3em]{1000000}\\\hline\hline
LCG&0.0&0.0&0.0&0.0&0.0&0.001&0.012\\\hline
BBS&0.0&0.0&0.0&0.0&0.006&0.064&0.468\\\hline
RAB&0.0&0.0&0.0&0.0&0.008&0.077&0.524\\\hline
RSA&2.53&6.242&26.536&70.27&-&-&-\\\hline
MSRSA&0.0&0.0&0.0&0.0&0.051&0.275&2.432\\\hline
PG&0.0&0.0&0.0&0.0&0.033&0.276&2.206\\\hline
NR&4.89&28.934&444.311&504.85&-&-&-\\\hline
\end{tabular}
\caption{\label{tab:table-name}Algorithm speed in terms of real-world computation time (seconds)}
\end{table}

\begin{table}
\centering
\begin{tabular}{|l||*{7}{c|}}\hline
\backslashbox{Algo}{Calls}
&\makebox[3em]{10}&\makebox[3em]{25}&\makebox[3em]{100}&\makebox[3em]{250}
&\makebox[3em]{10000}&\makebox[3em]{100000}&\makebox[3em]{1000000}\\\hline\hline
LCG&1&1&2&3&100&1126&21486\\\hline
BBS&4&11&41&105&6750&60364&453863\\\hline
RAB&6&14&53&132&8616&68644&538605\\\hline
RSA&2044421&7107596&25926498&66659430&-&-&-\\\hline
MSRSA&41&32&243&607&37529&287388&2544693\\\hline
PG&29&55&214&533&37895&283791&2154358\\\hline
NR&4177409&27015995&416989667&2652261381&-&-&-\\\hline
\end{tabular}
\caption{\label{tab:table-name}Algorithm speed in terms of CPU cycles}
\end{table}

\subsection{Results}

From the data above we can see a massive disparity in the performance of RSA and NR compared to the rest of the algorithms. RSA's inefficiency in the case is do to the large size of $e$ as a result of the values used to seed the algorithm, requiring each pass to loop a non-trivial number of times. MSRSA avoids this by using a commonly agreed upon static value of $e$, greatly reducing the runtime. The results of PG are also a bit skewed, as it uses a relatively small index of prime/primitive pairs, where the primes themselves are quite small. This becomes more evident when using the $print$ test in the repository and observing the values output by each algorithm side-by-side, as the resolution of PG's output is noticeably more limited.

\section{BRAND}

While each of the aforementioned algorithms strives to produce a uniformly distributed set of seemingly random variables, they tend to have some shortcomings when used in applications. The range of values they produce are often limited to some {[}$0, RAND\_MAX${)}, which may be problematic in that both the desired range size may too big or too small, or the min and max values themselves aren't ideal. If a user wants to use one of these algorithms in an applied manner for a range they control, a naive solution is often something along the lines of:
\[val = min + rand() \% (max - min)\]
The problem with this is it introduces a statistically detectable bias when the modulus doesn't perfectly divide into the $RAND\_MAX$ of the $rand()$ function.

As a solution to this, we provide $brand$, a set of wrapper functions around C's implementation of $rand()$, which is fundamentally based upon LCG. With this library, the default $min$ and $max$ for the range of random values is still $0$ and $RAND\_MAX$, however now the user can set the limits of the range, then use the wrapper functions to generate a statistically uniform distribution of random variables within the given range.

The standard flow for using $brand$ is to first seed C's built in $rand()$ function however you like; typically this is done through a call to $srand(time(NULL))$. Next, the user can use $brand$'s limit setting functions $bsetn()$, $bsetx()$, and $bsetnx()$ to define the desired range. Next the user simply calls $brand()$ as many times as they want to get the desired value, and finally when they're done using the library call $bcln()$ to clean up dynamically allocated memory. An additional function $brandd()$ is also available, which uses $brand()$ internally to generate a random value in the range {[}$0.0,1.0${)}, with the resolution of the result controlled by the limits set.

With this we now have a well functioning RNG library based on LCG in which we can control the range, but now we want to add one more piece of functionality. When it comes to human perception of randomness, people tend to apply their own biases to what they perceive as random, sometimes without even realizing it. A prime example of this is the "shuffle" button in any sort of music or media software. The expectation when listening to a library of music with the shuffle button enabled is that the software will cycle through the music and select the order to play songs in at random. If, for example, a user has a library of 1,000 songs being shuffled, and the RNG function happens to select the same song twice back to back before playing any other song, the user will likely be annoyed by hearing a repeat, breaking their biased perception of "randomness".

Thus $brand$ has an additional wrapper function, $brandus()$, that aims to produce a uniquely random stream of values for a given range. For a given range of size $N$, it achieves this by allocating an array of length $N$ and setting each value of the array to be the corresponding value in the range. It then generates a random value within the range, removing the minimum offset, and uses that as an index into the array to find the value to return. With that value saved, it then shifts all values beyond the output value down in the array, effectively removing it from the set of available values, and decreases the maximum range value by one. Some performance implications of this include the cache array must be $O(N)$, an $O(1)$ lookup time as the random value generated is just an index, and a $(N/2)$ average update time factor.

While this works great for smaller ranges and always ensures a unique stream of random values for $N$ passes on a range of size $N$, it has two shortcomings. The first being that, when all $N$ values have been generated, it's behavior is that it will reset the values in the array and begin a new unique stream. This is fine, except that say in our previous example song 1000 plays at the very end in the first full pass, and the very beginning in the second full pass, then we'll have two back-to-back instances of the same object and will have again broken our notion of "perceived randomness". The second shortcoming is the memory footprint of this method. For any non-trivial range of values, the method will take up a substantial amount of memory as it needs to index every single value (at least initially).

Some potential future work for this cached indexing approach could include an alternative cache method which only caches the most recent $X$ amount of values out of the total $N$ range, where $X << N$. Some potential issues with this include lookup failures and having to do multiple retries, however these could likely be mitigated by [placing a strict limit on the size of the local cache relative to the overall size of the range.

\section{Conclusion}

DRNGs can vary widely in both the approaches they take to achieve cryptographic security and statistical randomness, and the actual performance that comes as a result. Some are much more specialized, such as RSA for asymmetric key encryption, while others are much more broad in their applications, like LCG. Beyond the algorithms themselves, ensuring statistical uniformity in a random distribution where the range or uniqueness of a value matters is surprisingly non-trivial to implement, however in applications that interface directly with users or use cases such as procedural generation, these properties can be invaluable.

\end{document}


\section{Definition of a photovoltaic panel model}
The last component of the simulated system is the photovoltaic panel: for this it has been needed to generate a table correlating panel's output power and input irradiation with the output current given to its load. The \emph{solar.m} file gives information about the relationship between voltage and irradiance and the output current.

As the photovoltaic panel has a critical current over which the output power descends quickly, values over these points have been cut in order to avoid a non-invertible behaviour: as it is needed to have the current as an output value for a function, it can't be that 2 different currents correspond to the same power and irradiance. In other terms, the $(I,P)$ curve must be invertible and thus \emph{monotonic}.

With this premise, data coming from \emph{solar.m} have been used together with sample data for irradiance (\emph{example\_variable\_set.mat}) and with a sample set of voltages (in the range $[0;0.65]$), to generate and analyze the lookup table for the $I(G,P)$ power. Units have been ported to IS ones in order to avoid confusion.

The output graph is as expected: in particular, it can be seen that the maximum power that the panel can accept depends almost linearly with the input irradiance. This is a good assumption, as by fixing the area the irradiance is proportional to the absorbed power of the panel, and thus proportional to its maximum output power.

\begin{figure}[h]
  \centering
  \includegraphics[width=5in]{power_irradiance_current}
  \caption{Obtained Power-Irradiance-Current surface}
\end{figure}


\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb,amsthm,tikz,parskip,lplfitch}
\usetikzlibrary{decorations.text,trees,positioning}

\title{Semantic Tableaux}
\author{Blat Blatnik}
\date{July, 2020}

\begin{document}
\maketitle

\tikzset{%
	l/.style={%
		baseline, level distance = 2em
	}
}

\section{First Order Logic (FOL)}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cc}
		\multicolumn{2}{c}{
		 	\begin{tikzpicture}[l]
		 	\node {$\lnot\lnot$ A}
		 	[->]
		 	child {node[below]{A}};
		 	\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B}
			[->]
			child {node[below,align=center]{A\\[4]B}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B)}
			[->]
			child {node[below]{$\lnot$A}}
			child {node[below]{$\lnot$B}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\lor$ B}
			[->]
			child {node[below]{A}}
			child {node[below]{B}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B)}
			[->]
			child {node[below,align=center]{$\lnot$A\\[4]$\lnot$B}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B}
			[->]
			child {node[below]{$\lnot$A}}
			child {node[below]{B}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B)}
			[->]
			child {node[below,align=center]{A\\[4]$\lnot$B}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\equiv$ B}
			[->]
			child {node[below,align=center]{A\\[4]B}}
			child {node[below,align=center]{$\lnot$A\\[4]$\lnot$B}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\equiv$ B)}
			[->]
			child {node[below,align=center]{$\lnot$A\\[4]B}}
			child {node[below,align=center]{A\\[4]$\lnot$B}};
		\end{tikzpicture}
		\\
	\end{tabular}
\end{center}

\vspace{2.0em}
\textbf{Closure condition}: A branch of closes if it contains both A and $\lnot$A.

\textbf{Counter-model procedure}: Take any open branch, if P occurs at any node in the branch, assign it 1, and if $\lnot$P occurs on any node, assign it 0.

\textbf{Designated values}: $1$

\pagebreak

\section{First Degree Entailment (FDE)}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, +}
				[->]
				child {node[below]{A, +}};
			\end{tikzpicture}
		}
		&
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
			\node {$\lnot\lnot$ A, --}
			[->]
			child {node[below]{A, --}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, +}
			[->]
			child {node[below,align=center]{A, +\\[4]B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\land$ B, --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), --}
			[->]
			child {node[below]{$\lnot$A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, +}
			[->]
			child {node[below]{A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), +}
			[->]
			child {node[below,align=center]{$\lnot$A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, --}
			[->]
			child {node[below,align=center]{A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
	\end{tabular}
\end{center}

\vspace{3em}
\textbf{Closure condition}: A branch closes if it contains both A, + and A, --.

\textbf{Counter-model procedure}: Take any open branch, if P, + occurs at any node in the branch assign it P$\rho$1, and if $\lnot$P, + occurs on any node, assign it P$\rho$0.

\textbf{Truth table}:
\begin{center}
	\renewcommand{\arraystretch}{1.2}
	\begin{tabular}{|c|c|}
		\hline
		$\lnot$ & \\\hline
		$0$ & $1$ \\
		$n$ & $n$ \\
		$b$ & $b$ \\
		$1$ & $0$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|cccc|}
		\hline
		$\land$ & $0$ & $n$ & $b$ & $1$ \\\hline
		$0$ & $0$ & $0$ & $0$ & $0$ \\
		$n$ & $0$ & $n$ & $0$ & $n$ \\
		$b$ & $0$ & $0$ & $b$ & $b$ \\
		$1$ & $0$ & $n$ & $b$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|cccc|}
		\hline
		$\lor$ & $0$ & $n$ & $b$ & $1$ \\\hline
		$0$ & $0$ & $n$ & $b$ & $1$ \\
		$n$ & $n$ & $n$ & $1$ & $1$ \\
		$b$ & $b$ & $1$ & $b$ & $1$ \\
		$1$ & $1$ & $1$ & $1$ & $1$ \\\hline
	\end{tabular}
\end{center}

\textbf{Designated values}: $1, b$

\pagebreak

\section{Kleene 3-valued logic (K$_3$)}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, +}
				[->]
				child {node[below]{A, +}};
			\end{tikzpicture}
		}
		&
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, --}
				[->]
				child {node[below]{A, --}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, +}
			[->]
			child {node[below,align=center]{A, +\\[4]B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\land$ B, --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), --}
			[->]
			child {node[below]{$\lnot$A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, +}
			[->]
			child {node[below]{A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), +}
			[->]
			child {node[below,align=center]{$\lnot$A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, --}
			[->]
			child {node[below,align=center]{A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), +}
			[->]
			child {node[below,align=center]{A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), --}
			[->]
			child {node[below,align=center]{A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
	\end{tabular}
\end{center}

\vspace{3em}
\textbf{Closure condition}: A branch closes if it contains both A, + and A, -- or both A, + and $\lnot$A, +.

\textbf{Counter-model procedure}: Take any open branch, if P, + occurs at any node in the branch assign it P$\rho$1, and if $\lnot$P, + occurs on any node, assign it P$\rho$0.

\textbf{Truth table}:
\begin{center}
	\renewcommand{\arraystretch}{1.2}
	\begin{tabular}{|c|c|}
		\hline
		$\lnot$ & \\\hline
		$0$ & $1$ \\
		$i$ & $i$ \\
		$1$ & $0$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\land$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $0$ & $0$ \\
		$i$ & $0$ & $i$ & $i$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\lor$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $i$ & $1$ \\
		$i$ & $i$ & $i$ & $1$ \\
		$1$ & $1$ & $1$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\supset$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $1$ & $1$ & $1$ \\
		$i$ & $i$ & $i$ & $1$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
\end{center}

\textbf{Designated values}: $1$

\pagebreak

\section{{\L}ukasiewicz 3-valued logic (\L$_3$)}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, +}
				[->]
				child {node[below]{A, +}};
			\end{tikzpicture}
		}
		&
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, --}
				[->]
				child {node[below]{A, --}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, +}
			[->]
			child {node[below,align=center]{A, +\\[4]B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\land$ B, --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), --}
			[->]
			child {node[below]{$\lnot$A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, +}
			[->]
			child {node[below]{A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), +}
			[->]
			child {node[below,align=center]{$\lnot$A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, --}
			[->]
			child {node[below,align=center]{A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{B, +}}
			child {node[below,align=center]{A $\lor$ $\lnot$A, -\\[4]B $\lor$ $\lnot$B, -}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), +}
			[->]
			child {node[below,align=center]{A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, --}
			[->]
			child {node[below,align=center]{A, +\\[4]B, --}}
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
	\end{tabular}
\end{center}

\vspace{3em}
\textbf{Closure condition}: A branch closes if it contains both A, + and A, -- or both A, + and $\lnot$A, +.

\textbf{Counter-model procedure}: Take any open branch, if P, + occurs at any node in the branch assign it P$\rho$1, and if $\lnot$P, + occurs on any node, assign it P$\rho$0.

\textbf{Designated values}: $1$

\textbf{Truth table}:
\begin{center}
	\renewcommand{\arraystretch}{1.2}
	\begin{tabular}{|c|c|}
		\hline
		$\lnot$ & \\\hline
		$0$ & $1$ \\
		$i$ & $i$ \\
		$1$ & $0$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\land$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $0$ & $0$ \\
		$i$ & $0$ & $i$ & $i$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\lor$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $i$ & $1$ \\
		$i$ & $i$ & $i$ & $1$ \\
		$1$ & $1$ & $1$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\supset$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $1$ & $1$ & $1$ \\
		$i$ & $i$ & $1$ & $1$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
\end{center}

\pagebreak

\section{Logic of Paradox (LP)}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, +}
				[->]
				child {node[below]{A, +}};
			\end{tikzpicture}
		}
		&
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, --}
				[->]
				child {node[below]{A, --}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, +}
			[->]
			child {node[below,align=center]{A, +\\[4]B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\land$ B, --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), --}
			[->]
			child {node[below]{$\lnot$A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, +}
			[->]
			child {node[below]{A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), +}
			[->]
			child {node[below,align=center]{$\lnot$A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, --}
			[->]
			child {node[below,align=center]{A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), +}
			[->]
			child {node[below,align=center]{A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), --}
			[->]
			child {node[below,align=center]{A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
		\\
	\end{tabular}
\end{center}

\vspace{3em}
\textbf{Closure condition}: A branch closes if it contains both A, + and A, -- or both A, -- and $\lnot$A, --.

\textbf{Counter-model procedure}: Take any open branch, if P, -- \emph{does not} occur on any node of the branch assign it P$\rho$1, and if $\lnot$P, -- \emph{does not} occur on any node, assign it P$\rho$0.

\textbf{Designated values}: $1, i$

\textbf{Truth table}:
\begin{center}
	\renewcommand{\arraystretch}{1.2}
	\begin{tabular}{|c|c|}
		\hline
		$\lnot$ & \\\hline
		$0$ & $1$ \\
		$i$ & $i$ \\
		$1$ & $0$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\land$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $0$ & $0$ \\
		$i$ & $0$ & $i$ & $i$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\lor$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $i$ & $1$ \\
		$i$ & $i$ & $i$ & $1$ \\
		$1$ & $1$ & $1$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\supset$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $1$ & $1$ & $1$ \\
		$i$ & $i$ & $i$ & $1$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
\end{center}

\pagebreak

\section{Mix 3-valued logic (RM$_3$)}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, +}
				[->]
				child {node[below]{A, +}};
			\end{tikzpicture}
		}
		&
		\multicolumn{2}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, --}
				[->]
				child {node[below]{A, --}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, +}
			[->]
			child {node[below,align=center]{A, +\\[4]B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), +}
			[->]
			child {node[below]{$\lnot$A, +}}
			child {node[below]{$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\land$ B, --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), --}
			[->]
			child {node[below]{$\lnot$A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, +}
			[->]
			child {node[below]{A, +}}
			child {node[below]{B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), +}
			[->]
			child {node[below,align=center]{$\lnot$A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, --}
			[->]
			child {node[below,align=center]{A, --\\[4]B, --}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), --}
			[->]
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, --}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, +}
			[->]
			child {node[below]{A, --}}
			child {node[below]{$\lnot$B, --}}
			child {node[below,align=center]{A $\land$ $\lnot$A, +\\[4]B $\land$ $\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), +}
			[->]
			child {node[below,align=center]{A, +\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, --}
			[->]
			child {node[below,align=center]{A, +\\[4]B, --}}
			child {node[below,align=center]{$\lnot$A, --\\[4]$\lnot$B, +}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), --}
			[->]
			child {node[below]{A, --}}
			child {node[below]{$\lnot$B, --}};
		\end{tikzpicture}
		\\
	\end{tabular}
\end{center}

\vspace{3em}
\textbf{Closure condition}: A branch closes if it contains both A, + and A, -- or both A, -- and $\lnot$A, --.

\textbf{Counter-model procedure}: Take any open branch, if P, -- \emph{does not} occur on any node of the branch assign it P$\rho$1, and if $\lnot$P, -- \emph{does not} occur on any node, assign it P$\rho$0.

\textbf{Designated values}: $1, i$

\textbf{Truth table}:
\begin{center}
	\renewcommand{\arraystretch}{1.2}
	\begin{tabular}{|c|c|}
		\hline
		$\lnot$ & \\\hline
		$0$ & $1$ \\
		$i$ & $i$ \\
		$1$ & $0$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\land$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $0$ & $0$ \\
		$i$ & $0$ & $i$ & $i$ \\
		$1$ & $0$ & $i$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\lor$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $0$ & $i$ & $1$ \\
		$i$ & $i$ & $i$ & $1$ \\
		$1$ & $1$ & $1$ & $1$ \\\hline
	\end{tabular}
	\quad
	\begin{tabular}{|c|ccc|}
		\hline
		$\supset$ & $0$ & $i$ & $1$ \\\hline
		$0$ & $1$ & $1$ & $1$ \\
		$i$ & $0$ & $i$ & $1$ \\
		$1$ & $0$ & $0$ & $1$ \\\hline
	\end{tabular}
\end{center}

\pagebreak

\section{Basic Modal Logic}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{4}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, $i$}
				[->]
				child {node[below]{A, $i$}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, $i$}
			[->]
			child {node[below,align=center]{A, $i$\\[4] B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), $i$}
			[->]
			child {node[below]{$\lnot$A, $i$}}
			child {node[below]{$\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, $i$}
			[->]
			child {node[below]{A, $i$}}
			child {node[below]{B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), $i$}
			[->]
			child {node[below,align=center]{$\lnot$A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, $i$}
			[->]
			child {node[below]{$\lnot$A, $i$}}
			child {node[below]{B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), $i$}
			[->]
			child {node[below,align=center]{A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\equiv$ B, $i$}
			[->]
			child {node[below,align=center]{A, $i$\\[4] B, $i$}}
			child {node[below,align=center]{$\lnot$A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\equiv$ B), $i$}
			[->]
			child {node[below,align=center]{$\lnot$A, $i$\\[4] B, $i$}}
			child {node[below,align=center]{A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node[align=center] {$\Box$ A, $i$\\[4]$i$ r $j$}
			[->]
			child {node[below,align=center]{A, $j$\\[4](every $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot \Box$ A, $i$}
			[->]
			child {node[below]{$\Diamond \lnot$ A, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\Diamond$ A, $i$}
			[->]
			child {node[below,align=center]{$i$ r $j$\\[4] A, $j$\\[4](new $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot \Diamond$ A, $i$}
			[->]
			child {node[below]{$\Box \lnot$ A, $i$}};
		\end{tikzpicture}
	\end{tabular}
\end{center}

\vspace{2.5em}
\textbf{Closure condition}: A branch of closes if it for some $i$, A, $i$ and $\lnot$ A, $i$ occur on the same branch.

\textbf{Counter-model procedure}: For each $i$ that occurs the word $w_i$ exists. If $i$ r $j$ occurs on the branch then $w_i$ R $w_j$. If P, $i$ occurs on the branch then $v_{w_i}$(P) = 1, if $\lnot$ P, i occurs on the branch then $v_{w_i}$(P) = 0.

\textbf{Extensions}
\begin{description}
	\item[$\rho$] reflexivity: for all $w$, $wRw$
	\item[$\sigma$] symmetry: for all $w_1$, $w_2$, if $w_1Rw_2$, then $w_2Rw_1$
	\item[$\tau$] transitivity: for all $w_1$, $w_2$, $w_3$, if $w_1Rw_2$ and $w_2Rw_3$, then $w_1Rw_3$
	\item[$\eta$] extendability: for all $w_1$, there is a $w_2$ such that $w_1Rw_2$
\end{description}

\section{Tense Logic}
\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
		\multicolumn{4}{c}{
			\begin{tikzpicture}[l]
				\node {$\lnot\lnot$ A, $i$}
				[->]
				child {node[below]{A, $i$}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
			\node {A $\land$ B, $i$}
			[->]
			child {node[below,align=center]{A, $i$ \\[4] B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\land$ B), $i$}
			[->]
			child {node[below]{$\lnot$A, $i$}}
			child {node[below]{$\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\lor$ B, $i$}
			[->]
			child {node[below]{A, $i$}}
			child {node[below]{B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\lor$ B), $i$}
			[->]
			child {node[below,align=center]{$\lnot$A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node {A $\supset$ B, $i$}
			[->]
			child {node[below]{$\lnot$A, $i$}}
			child {node[below]{B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\supset$ B), $i$}
			[->]
			child {node[below,align=center]{A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {A $\equiv$ B, $i$}
			[->]
			child {node[below,align=center]{A, $i$\\[4] B, $i$}}
			child {node[below,align=center]{$\lnot$A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$(A $\equiv$ B), $i$}
			[->]
			child {node[below,align=center]{$\lnot$A, $i$\\[4] B, $i$}}
			child {node[below,align=center]{A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node[align=center] {[F]A, $i$\\[4]$i$ r $j$}
			[->]
			child {node[below,align=center]{A, $j$\\[4](every $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$[F]A, $i$}
			[->]
			child {node[below]{$\langle$F$\rangle$$\lnot$ A, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\langle$F$\rangle$A, $i$}
			[->]
			child {node[below,align=center]{$i$ r $j$\\[4] A, $j$\\[4] (new $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$$\langle$F$\rangle$A, $i$}
			[->]
			child {node[below]{[F]$\lnot$ A, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
			\node[align=center] {[P]A, $i$\\[4]$j$ r $i$}
			[->]
			child {node[below,align=center]{A, $j$\\[4] (every $j$)}};
			\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$[P]A, $i$}
			[->]
			child {node[below]{$\langle$P$\rangle$$\lnot$ A, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\langle$P$\rangle$A, $i$}
			[->]
			child {node[below,align=center]{$j$ r $i$\\[4] A, $j$\\[4] (new $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
			\node {$\lnot$$\langle$P$\rangle$A, $i$}
			[->]
			child {node[below]{[P]$\lnot$ A, $i$}};
		\end{tikzpicture}
	\end{tabular}
\end{center}

\vspace{3em}
\textbf{Closure condition}: A branch of closes if it for some $i$, A, $i$ and $\lnot$ A, $i$ occur on the same branch.

\textbf{Counter-model procedure}: For each $i$ that occurs the word $w_i$ exists. If $i$ r $j$ occurs on the branch then $w_i$ R $w_j$. If P, $i$ occurs on the branch then $v_{w_i}$(P) = 1, if $\lnot$ P, i occurs on the branch then $v_{w_i}$(P) = 0. If there are lines of the form $i = j$, $j = k$, $...$, we only chose one of them, like $i$, and ignore the others.

\textbf{Extensions}
\begin{description}
	\item[$\delta$] denseness: if $iRj$ then for some $k$, $iRk$ and $kRj$
	\item[$\phi$] forward convergence: if $iRj$ and $iRk$ then $jRk$ or $j = k$ or $kRj$
	\item[$\beta$] backward convergence: if $jRi$ and $kRi$ then $jRk$ or $j = k$ or $kRj$
\end{description}

\pagebreak

\section{First Order Modal Logic}

\begin{center}
	\renewcommand{\arraystretch}{2.5}
	\begin{tabular}{cccc}
				\multicolumn{4}{c}{
			\begin{tikzpicture}[l]
			\node {$\lnot\lnot$ A, $i$}
			[->]
			child {node[below]{A, $i$}};
			\end{tikzpicture}
		}
		\\
		\begin{tikzpicture}[l]
		\node {A $\land$ B, $i$}
		[->]
		child {node[below,align=center]{A, $i$\\[4] B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot$(A $\land$ B), $i$}
		[->]
		child {node[below]{$\lnot$A, $i$}}
		child {node[below]{$\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {A $\lor$ B, $i$}
		[->]
		child {node[below]{A, $i$}}
		child {node[below]{B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot$(A $\lor$ B), $i$}
		[->]
		child {node[below,align=center]{$\lnot$A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
		\node {A $\supset$ B, $i$}
		[->]
		child {node[below]{$\lnot$A, $i$}}
		child {node[below]{B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot$(A $\supset$ B), $i$}
		[->]
		child {node[below,align=center]{A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {A $\equiv$ B, $i$}
		[->]
		child {node[below,align=center]{A, $i$\\[4] B, $i$}}
		child {node[below,align=center]{$\lnot$A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot$(A $\equiv$ B), $i$}
		[->]
		child {node[below,align=center]{$\lnot$A, $i$\\[4] B, $i$}}
		child {node[below,align=center]{A, $i$\\[4] $\lnot$B, $i$}};
		\end{tikzpicture}
		\\
		\begin{tikzpicture}[l]
		\node[align=center] {$\Box$ A, $i$\\[4]$i$ r $j$}
		[->]
		child {node[below,align=center]{A, $j$\\[4](every $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot \Box$ A, $i$}
		[->]
		child {node[below]{$\Diamond \lnot$ A, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\Diamond$ A, $i$}
		[->]
		child {node[below,align=center]{$i$ r $j$\\[4] A, $j$\\[4](new $j$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot \Diamond$ A, $i$}
		[->]
		child {node[below]{$\Box \lnot$ A, $i$}};
		\end{tikzpicture}
		\\
		\multicolumn{4}{c}{\textbf{Variable Domain}}
		\\
		\begin{tikzpicture}[l]
		\node {$\forall x$ A, $i$}
		[->]
		child {node[below]{$A_x(a)$, $i$}}
		child {node[below,align=center]{$\lnot$ $\mathfrak{E}a$, $i$\\[4](old $a$ if possible)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot \forall x$ A, $i$}
		[->]
		child {node[below]{$\exists x$ $\lnot$A, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\exists x$ A, $i$}
		[->]
		child {node[align=center,below]{$\mathfrak{E}a$, $i$\\[4]$A_x(a)$, $i$\\[4](new $a$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot \exists x$ A, $i$}
		[->]
		child {node[below]{$\forall x$ $\lnot$A, $i$}};
		\end{tikzpicture}
		\\
		\multicolumn{4}{c}{\textbf{Constant Domain}}
		\\
		\begin{tikzpicture}[l]
		\node {$\forall x$ A, $i$}
		[->]
		child {node[align=center, below]{$A_x(a)$, $i$\\[4](old $a$ if possible)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot \forall x$ A, $i$}
		[->]
		child {node[below]{$\exists x$ $\lnot$A, $i$}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\exists x$ A, $i$}
		[->]
		child {node[align=center, below]{$A_x(a)$, $i$\\[4](new $a$)}};
		\end{tikzpicture}
		&
		\begin{tikzpicture}[l]
		\node {$\lnot \exists x$ A, $i$}
		[->]
		child {node[below]{$\forall x$ $\lnot$A, $i$}};
		\end{tikzpicture}
	\end{tabular}
\end{center}

\textbf{Counter-models}:
Need to define:
\begin{itemize}
	\item which objects exist in which worlds: e.g. $D(w_1) = \lbrace \partial_a, \partial_b \rbrace$
	\item which predicates hold for which objects: e.g. $v_{w_1}(P) = \lbrace \partial_c \rbrace$
\end{itemize}

\pagebreak

\section{Fuzzy Logic}

\begin{align*}
	\lnot x   &= 1 - x\\
	x \land y &= \min(x, y)\\
	x \lor y  &= \max(x, y)\\
	x \lif y  &= \min(1, 1 - x + y)
\end{align*}

\textbf{Designated values}:
$A \models_{\textrm{\L}_{0.5}}$ if $v(A) \geq 0.5$ then $v(B) \geq 0.5$\\
Special case: \L$_{\aleph}$ - the only designated value is 1.

\section{Default Logic}

\[
	\beta = \frac{\phi : \psi_1, ..., \psi_n}{\chi}
	\textrm{ \quad for example \quad }
	\frac{bird(X) : flies(X)}{flies(X)}
\]

where:
\begin{description}
	\item $pre(\delta) = \phi$ (the prerequisites of $\delta$)
	\item $just(\delta) = \lbrace \psi_1, ..., \psi_n \rbrace$ (the justification of $\delta$)
	\item $cons(\delta) = \chi$ (the consequence of $\delta$)
\end{description}

\subsection{Processes}

\begin{description}
	\item $\prod = (\delta_0, \delta_1, ...)$ \quad can also be empty: $()$
	\item $Th(X) = $ all formulas that can be deduced from $X$.
	\item $In(\prod) = Th(M)$, where $M = W \cup \lbrace\, cons(\delta) \;|\; \delta \in \prod \,\rbrace$
	\item $Out(\prod) = Th(N)$, where $N = \lbrace\, \lnot just(\delta) \;|\; \delta \in \prod \,\rbrace$
	\item $\prod$ is \emph{closed} iff every $\delta \in D$ that is applicable to $In(\prod)$ is also in $\prod$.
	\item $\prod$ is \emph{successful} iff $In(\prod) \cap Out(\prod) = \emptyset$
	\item[Extensions] A set of formulas $E$ is an extension of the default theory $T$ iff there is some closed and successful process $\prod$ of $T$ such that $E = In(\prod)$
	\item[Skeptical consequence] $(W, D) \vdash_s \phi$ iff $\phi$ is in all extensions of $(W, D)$.
	\item[Credulous consequence] $(W, D) \vdash_c \phi$ iff $\phi$ is in at least one extension of $(W, D)$.
\end{description}

\section{Soundness and Completeness}

\subsection{Propositional Logic}

$\Sigma \models A$ iff for all valuations $v$, for all $B \in \Sigma$, $v(B) = 1$, then $v(A) = 1$.

$\Sigma \vdash A$ iff there is a closed tree whose initial list comprises the members of $\Sigma$ and the negation of $A$.

\begin{description}
	\item[Faithful] A valuation $v$ is \emph{faithful} to branch $b$ iff for every formula $D$ that occurs on $b$, $v(D) = 1$.
	\item[Induced] A valuation $v$ is \emph{induced} by branch $b$, iff for every propositional parameter $p$ that occurs on $b$, $v(p) = 1$ iff $p$ is a node on $b$, and $v(p) = 0$ iff $\lnot p$ is a node on $b$.
	\item[Soundness lemma] If $v$ is \emph{faithful} to a branch $b$, and a tableau rule is applied to $b$, then $v$ is faithful to at least \emph{one} of of the branches generated by the application of the rule.
	\item[Completeness lemma] If branch $b$ is \emph{complete} and \emph{open}, and if $v$ is the valuation \emph{induced} by $b$, then for all formulas $D$: if $D$ is on $b$, then $v(D) = 1$, and if $\lnot D$ is on $b$, then $v(D) = 0$.
\end{description}

\subsection{Modal Logic}

Basic modal logic, extensions $K_{\rho}$, $K_{\sigma}$, $K_{\tau}$, $K_{\eta}$, and any combination of extensions are all sound \emph{and} complete.

$\Sigma \models A$ iff for all valuations $v$, for all $B \in \Sigma$, $v(B) = 1$, then $v(A) = 1$.

$\Sigma \vdash A$ iff there is a closed tree whose initial list comprises the members of $\Sigma$ and the negation of $A$.

\begin{description}

	\item[Faithful] An interpretation $I = \langle W, R, v \rangle$ is \emph{faithful} to branch $b$ iff there is a map $f$ from $\mathbb{N}$ to $W$ such that:
	\begin{itemize}
		\item For every node $D, i$ on $b$, $D$ is true at world $f(i)$ in $I$.
		\item If $i$ r $j$ is on $b$, then $f(i)Rf(j)$ is in $R$.
	\end{itemize}

	\item[Induced]  If branch $b$ is \emph{complete} and \emph{open}, $I = \langle W, R, v \rangle$ is \emph{induced} by $b$ iff:
	\begin{itemize}
		\item $W$ = the set of all worlds $w_i$ such that $i$ appears on b.
		\item $w_iRw_j$ iff $i$ r $j$ occurs on b.
		\item If $p, i$ occurs on $b$, then $v_{w_i}(p) = 1$, and if $\lnot p, i$ occurs on  $b$, then $v_{w_i}(p) = 0$.
	\end{itemize}

	\item[Soundness lemma] If $I = \langle W, R, v \rangle$ is \emph{faithful} to branch $b$, and a tableau rule is applied to $b$, then $I$ is faithful to at least \emph{one} of of the branches generated by the application of the rule.

	\item[Completeness lemma] If branch $b$ is \emph{complete} and \emph{open}, and $I = \langle W, R, v \rangle$ is \emph{induced} by $b$, then for all formulas $D$ and for all $i$: if $D, i$ is on $b$, then $v_{w_i}(D) = 1$, and if $\lnot D, i$ is on $b$, then $v_{w_i}(D) = 0$.
\end{description}

\end{document}


\documentclass[fleqn, 10pt, twocolumn]{SelfArx}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\setlength{\columnsep}{0.55cm} % Distance between the two columns of text
\setlength{\fboxrule}{0.75pt} % Width of the border around the abstract

\usepackage[version=4]{mhchem}

\usepackage{fancyhdr}
\usepackage{here}
\usepackage{relsize}

\usepackage[locale=DE,output-decimal-marker={.}]{siunitx}
\usepackage{amsmath}
\sisetup{separate-uncertainty, per-mode=fraction,}
\usepackage{tikz}
\usepackage{pgfplots,pgfplotstable}
\usetikzlibrary{external}
\tikzexternalize[prefix=tikz/]

\usepackage{hyperref}

\pagestyle{fancy}
\fancyhf{}
\lhead{Felix Wechsler}
\rhead{Topic 3 \textit{Photonic crystal fibers}}
\definecolor{color1}{RGB}{0,0,90} % Color of the article title and sections
\definecolor{color2}{RGB}{0,20,20} % Color of the boxes behind the abstract and headings

\usepackage[%
  backend=biber,
  url=false,
  %style=alphabetic,
  % citestyle=authoryear,
  citestyle=numeric,
  maxnames=1,
  minnames=1,
  maxbibnames=99,
  giveninits,
  uniquename=init]{biblatex}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=issn, null]
    }
  }
}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=doi, null]
    }
  }
}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=isbn, null]
    }
  }
}

\addbibresource{references.bib}
\usepackage[symbol]{footmisc}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

\begin{document}%
\begin{center}
\colorbox{color2!10}{\large\relscale{1.13}\textcolor{color1}{\sffamily\bfseries Entrance Exam for MPSP Applicants}}
\end{center}
    \textit{Third harmonics can be generated by pumping Ti:sapphire laser femtosecond pulses into an Ar-filled hollow-core photonics crystal fiber (HC-PCF) \cite{Nold2010}.
        In this work\footnote{For more details about the numerical calculations see this GitHub repository \url{https://git.io/JtHKW}} we discuss several aspects of their generation and analysis.}

    \section{Derivation of Effective Refractive Index}
    The effective refractive index of the generated modes within the HC-PCF can by approximated by:
    \begin{align}
        n^{mn}(\lambda, p) = \sqrt{n^2_{\text{Ar}}(\lambda, p ) - \frac{u_{mn}^2}{k_0^2 a^2}}
        \label{eq1}
    \end{align}
    where $k_0=2\pi/\lambda$ is the wave number, $\lambda$ is the vacuum wavelength, $p_0$ and $p$ are a reference and the present pressure, respectively. $a$ is the
    effective radius of the fiber. $u_{mn}$ is the $n$th zero of a $m$th order Bessel function of the first kind. Since the fiber used in \cite{Nold2010} has a hexagonal core, \eqref{eq1} is only an approximation.
    \eqref{eq1} originates from two principles: a $\lambda$ dependent refractive index and an effective refractive index due to the present mode in a circular fiber.
    Firstly, we discuss the overall structure of the equation coming from the mode formed within the fiber. The field in the fiber is generated by a laser pulse. Once the laser is launched, Maxwell's equation and hence the Helmholtz equation have to be valid.
    % \begin{align}
    %     \left(\nabla^2 + k(\omega)\right) \mathbf E = 0
    %     \label{eq:helmholtz}
    % \end{align}
    It is known that the Helmholtz equation within a fiber with circular cross section is solved by Bessel functions \cite{Nickelson2019}.
    Numerically, a Finite Difference Mode Solver can be used to obtain the eigenvectors $\mathbf E$ representing the field and the eigenvalues $k^{mn}$ representing the wave number for more complex shapes. The analytical solution for cylindrical symmetries is
    \begin{align}
        k^{mn} = \sqrt{(n k_0)^2 - \left( \frac{u_{mn}}{a}\right)^2}
    \end{align}
    where $n$ is the refractive index of the medium.
    From the wave number we obtain the effective refractive index
    \begin{align}
        n^{mn} = \sqrt{n^2 - \left( \frac{u_{mn}}{a k_0}\right)^2}.
        \label{eq:mode}
    \end{align}
    Secondly, we can now introduce a wavelength and a pressure dependency to the equation. To describe the $\lambda$ dependency, several empirical approaches are possible.
    In the case of noble gases, the following Sellmeier equation turned out to be convenient \cite{Borzsonyi2008}
    \begin{align}
       n^2(\lambda, p_0)  = 1 + \frac{T_0}{T} \left(\frac{B_1}{1- (\lambda_1/\lambda)^2} + \frac{B_2}{1- (\lambda_2/\lambda)^2}  \right)
        \label{eq:wvl}
    \end{align}
    where $B_{1/2}$ and $\lambda_{1/2}$ are fitting parameters being gas specific.
    Furthermore, from the Lorentz-Lorenz theory
    we know that there is a linear relation between the squared refractive index and the pressure $p$ \cite{Borzsonyi2008}.
    Knowing $n^2(p_0) \sim p_0$ it is straightforward to see that
    \begin{align}
        n_{\text{Ar}}^2(\lambda, p) = \frac{p}{p_0} n^2(\lambda, p_0)
        \label{eq:p}
    \end{align}
    and therefore by measuring the Sellmeier parameters for a pressure $p_0$ we can plug Equation \ref{eq:wvl}, \ref{eq:p} into \ref{eq:mode} to obtain \eqref{eq1}.
    By introducing a first order Taylor approximation of $\sqrt{1+x} \approx 1 + \frac{x}{2}$, we can further simplify to obtain the equation below.
    \begin{align}
        n^{mn}(\lambda, p) \approx 1 + n^2(\lambda, p_0) \frac{p}{2p_0} -  \frac{u_{mn}^2}{2 k_0^2 a^2}
        \label{eq1a}
    \end{align}

    \section{Phase Matching}
    In third harmonics generation, two fundamental conditions need to hold: energy and momentum conservation.
    In the wave picture, momentum conservation is a phase matching condition and can be in the fiber mode expressed as
    \begin{align}
        \mathbf{k}^{mn} = 3 \cdot \mathbf k^{11}
    \end{align}
    and hence
    \begin{align}
        n^{11}(\lambda, p) - n^{mn}(\lambda / 3, p)= 0
        \label{eq:pm}
    \end{align}
    where $mn$ is the generated third harmonic mode and $11$ the pump mode.
    The left hand side of \eqref{eq:pm} can be visualized to find all possible solutions.
    We believe\footnote{Despite \citeauthor{Travers2011} state differently \cite{Travers2011}, we could only reproduce the results of \citeauthor{Nold2010} by decrementing $m$. This decrementation is mentioned by \citeauthor{Marcatili1964} \cite{Marcatili1964}.} that the hybrid mode $\text{HE}_{mn}$ corresponds to Bessel coefficients $u_{(m-1)n}$.
    Accordingly, $\text{HE}_{11}$ has the Bessel coefficients $u_{01}$.
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            \begin{axis}[
                xmin = 400, xmax = 1000,
                ymin = -5, ymax = 7.5,
                ytick = {-2.5, 0, ..., 7.5},
                height=5.5cm, width=8cm,
                xlabel = {$\lambda$ in \si{\nano\meter}},
                ylabel = {$(n^{11}(\lambda, p) - n^{mn}(\lambda/3, p)) \cdot 10^4$},
                legend pos = {north west},
                legend entries = {$\ce{Ar}-\text{HE}_{11}$, $\ce{Ar}-\text{HE}_{12}$, $\ce{Ar}-\text{HE}_{13}$, $\ce{Ar}-\text{HE}_{23}$, $\ce{Ar}-\text{HE}_{33}$}
                ]
                \draw[dashed] (axis cs:0,0) -- (axis cs:1200, 0);
                \draw[dashed] (axis cs:800,10) -- (axis cs:800, -10);
                \node at (axis cs:860, 5) {\footnotesize pump $\lambda$};
                \addplot[color=blue]
                    table[x index = 0, y index = 1]{../data/argon.txt};
                \addplot[color=red]
                    table[x index = 0, y index = 2]{../data/argon.txt};
                \addplot[color=green]
                    table[x index = 0, y index = 3]{../data/argon.txt};
                \addplot[color=orange]
                    table[x index = 0, y index = 4]{../data/argon.txt};
                \addplot[color=black!50!white]
                    table[x index = 0, y index = 5]{../data/argon.txt};
                \addplot[color=blue, dotted]
                    table[x index = 0, y index = 1]{../data/argon_low_pressure.txt};
            \end{axis}
        \end{tikzpicture}
        \caption{Refractive index difference of \ce{Ar} for different \text{HE} modes and $\text{HE}_{11}$ at $T=\SI{293}{\kelvin}$, $p=\SI{5000}{\milli\bar}$.}
        \label{plt:pm}
    \end{figure}
    From \autoref{plt:pm} it follows that intra-modal phase matching ($mn = 11$) is not possible since the $\text{HE}_{11}$ curve does not reach values where the refractive index difference is approximately 0.
    Even, at a low pressure of $p=\SI{100}{\milli\bar}$ the dotted blue line does not reach 0.
    Also mathematically it is clear that \eqref{eq:pm} cannot be solved for intra-modal phase matching because the only variable is $\lambda$ and since $n(\lambda)$ is a monotonic decreasing function, there is no solution for $\lambda$ and $\lambda/3$.
    However, $\text{HE}_{13}$ has a solution to the phase matching condition identifiable at $\lambda=\SI{800}{\nano\meter}$.
    Mathematically, $\lambda/3$ leads to a decrease in \eqref{eq:pm} which is then compensated by an increase of $u_{03}>u_{01}$.\\
    Instead of using \ce{Ar}-filled HC-PCF, third harmonics can be generated with \ce{Kr} as well.
    Using the Sellmeier coefficients for \ce{Kr}, we apply the phase matching condition to
    solve for the required pressure.
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            \begin{axis}[
                xmin = 0, xmax = 9,
                ymin = -3, ymax = 5.5,
                ytick = {-2, 0, 2, 4, 6},
                height=5.5cm, width=8cm,
                xlabel = {$p$ in \si{\bar}},
                ylabel = {$(n^{11}(\lambda, p) - n^{mn}(\lambda/3, p)) \cdot 10^4$ },
                legend pos = {north west},
                legend entries = {$\ce{Kr}-\text{HE}_{13}$, $\ce{Kr}-\text{HE}_{23}$, $\ce{Kr}-\text{HE}_{33}$}
                ]
                \draw[dashed] (axis cs:0,0) -- (axis cs:12, 0);
                \addplot[color=blue]
                    table[x index = 0, y index = 1]{../data/krypton.txt};
                \addplot[color=red]
                    table[x index = 0, y index = 2]{../data/krypton.txt};
                \addplot[color=green]
                    table[x index = 0, y index = 3]{../data/krypton.txt};
            \end{axis}
        \end{tikzpicture}
        \caption{Refractive index difference of \ce{Kr} for different \text{HE} modes and $\text{HE}_{11}$ at $T=\SI{293}{\kelvin}$,  $\lambda=\SI{800}{\nano\meter}$.}
        \label{plt:pressure}
    \end{figure}
    In \autoref{plt:pressure} we can see that for $p^{13}=\SI{2.4}{\bar}$, $p^{23}=\SI{5.3}{\bar}$ and $p^{33}=\SI{8.5}{\bar}$ the phase matching is fulfilled.
\section{\ce{Xe}-filled HC-PCF}
    \autoref{plt:pmxenon} shows the refractive index difference for a \ce{Xe}-filled HC-PCF\footnote{Note, there is a typo in \cite{Borzsonyi2008}. $C_1$ should be \SI{12.75e-3}{\micro\meter\squared} instead of \SI{12.75e-6}{\micro\meter\squared}. See \url{https://refractiveindex.info/?shelf=main&book=Xe&page=Borzsonyi}}.
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            \begin{axis}[
                xmin = 400, xmax = 1000,
                ymin = -5, ymax = 7.5,
                ytick = {-2.5, 0, ..., 7.5},
                height=5.5cm, width=8cm,
                xlabel = {$\lambda$ in \si{\nano\meter}},
                ylabel = {$(n^{11}(\lambda, p) - n^{mn}(\lambda/3, p)) \cdot 10^4$},
                legend pos = {north west},
                legend entries = {$\ce{Xe}-\text{HE}_{11}$, $\ce{Xe}-\text{HE}_{12}$,$\ce{Xe}-\text{HE}_{13}$, $\ce{Xe}-\text{HE}_{23}$, $\ce{Xe}-\text{HE}_{33}$}
                ]
                \draw[dashed] (axis cs:0,0) -- (axis cs:1200, 0);
                \draw[dashed] (axis cs:800,10) -- (axis cs:800, -10);
                \node at (axis cs:860, 5) {\footnotesize pump $\lambda$};
                \addplot[color=blue]
                    table[x index = 0, y index = 1]{../data/xenon.txt};
                \addplot[color=red]
                    table[x index = 0, y index = 2]{../data/xenon.txt};
                \addplot[color=green]
                    table[x index = 0, y index = 3]{../data/xenon.txt};
                \addplot[color=orange]
                    table[x index = 0, y index = 4]{../data/xenon.txt};
                \addplot[color=black!50!white]
                    table[x index = 0, y index = 5]{../data/xenon.txt};
            \end{axis}
        \end{tikzpicture}
        \caption{Refractive index difference of \ce{Xe} for different \text{HE} modes and $\text{HE}_{11}$ at $T=\SI{293}{\kelvin}$, $p=\SI{960}{\milli\bar}$.}
        \label{plt:pmxenon}
    \end{figure}
    It follows that third harmonic generation is possible for \ce{Xe} at lower pressures but even higher harmonics have been observed in \ce{Xe}
    \cite{Heckl2009}. Among the investigated noble gases, \ce{Xe} has the lowest absolute pressure and \ce{Ar} the highest required for third harmonic generation.
    The reason for the lower pressure is that \ce{Xe} has the largest dispersion \cite{Borzsonyi2008} leading to a smaller $p$ needed to compensate for the larger $u_{mn}$ in \eqref{eq:pm}.
    Consequently \ce{Ar} shows the lowest dispersion.
    It is worth to mention that the opportunity to use different gases enhances the use in practical applications of higher harmonics generation with HC-PCFs.
    \ce{Xe} and \ce{Ar} allow to vary the presssure by almost one order of magnitude but still generating third harmonics. Also, the linear pressure dependency in the phase matching condition
    allows to fine-tune efficiently for certain higher order modes.
    Furthermore, combining \eqref{eq1a} together with the ideal gas law, gas-filled HC-PCFs are robust against temperature induced pressure variations. For moderate gas chamber dimensions temperature changes due to absorption of radiation are negligible \cite{Serebryannikov2004}.
    In conclusion, noble gas-filled HC-PCFs allow for setups to be small, nonhazardous and insensitive to environmental changes and are therefore
    suitable candidates for generation of light in UV or EUV regimes.
    It can be conjectured, that other noble gases like Helium and Neon are also promising candidates since their Sellmeier coefficients are in the same order of magnitudes and the physical properties of noble gases are similar.

    \printbibliography

\end{document}


Discretization information for DISV grids is read from the file that is specified by ``DISV6'' as the file type.  Only one discretization input file (DISV6, DISU6 or DIS6) can be specified for a model.

The approach for numbering cell and cell vertices for the DISV Package is shown in figure~\ref{fig:gwf-fig3-2}.  The list of vertices for a cell must be in clockwise order.  Closing of the cell polygon by repeating the first vertex as the last vertex is not required in the present implementation.  Internally within the program, however, the first vertex number is added to the end of the vertex list in order to close the polygon.  Thus, users have the option for whether or not to close cell polygons.

\begin{figure}[ht]
	\centering
	\includegraphics[scale=1.0]{Figures/gwf-fig3-2}
	\caption{Schematic diagram showing the vertices and cells defined using the Discretization by Vertices Package. The list of vertices used to define each cell must be in clockwise order.  From \cite{modflow6gwf}}
	\label{fig:gwf-fig3-2}
\end{figure}

\vspace{5mm}
\subsubsection{Structure of Blocks}
\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwf-disv-options.dat}
\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwf-disv-dimensions.dat}
\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwf-disv-griddata.dat}
\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwf-disv-vertices.dat}
\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwf-disv-cell2d.dat}

\vspace{5mm}
\subsubsection{Explanation of Variables}
\begin{description}
\input{./mf6ivar/tex/gwf-disv-desc.tex}
\end{description}

\vspace{5mm}
\subsubsection{Example Input File}
\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwf-disv-example.dat}


\section{Point Group Theory}
\index{Groups|(} \index{Point-group!theory} \index{Symmetry!in group theory}
This Section is based on the original work of Peter Bischof in the UMNDO
program, and made available to me by Dr David Danovich.

Some point-group theory has been added to MOPAC.  The main functionalities
added are: \index{AUTOSYM}\index{Bischof@{\bf Bischof, Peter}}
\index{UMNDO}\index{Danovich@{\bf Danovich, David}}

\begin{itemize}
\item `Normal' symmetry relationships are now automatically recognized if
\comp{AUTOSYM} is specified.

\item The symmetry of the system is printed both at the start of the run and at
the end.  If the point-group changes, the change will be shown in the different
point-group symbols.

\item Molecular orbitals will be characterized by Irreducible Representation
(I.R.).

\item Normal coordinates generated in the vibrational calculation will be
characterized by I.R.

\item State functions will be characterized by I.R.

\item All rotation groups up to order 8, except D$_{8d}$, are available.

\item The cubic groups T, T$_h$, T$_d$, O, O$_h$, I, and I$_h$ are available.

\item The infinite groups C$_{\infty v}$, D$_{\infty h}$ and R$_3$ are
available.

\item In \comp{FORCE} or vibrational frequency calculations, symmetry will be
used to accelerate the calculation, thus a calculation of benzene would involve
two atoms, a C and a H atom, to be calculated, rather than the normal 12 atoms.

\item In vibrational frequency calculations, the Hessian or force matrix
will be symmetrized.  \index{sym\_force} \label{sym_force}
$$
F_{ij}=\frac{1}{h}\sum_hR(h)^TF_{ij}'R(h)
$$

This eliminates the normal small deviations from exact symmetry
\begin{htmlonly}
(\htmlref{a qualification appears
elsewhere}{fc})
\end{htmlonly}
\begin{latexonly}
(see also p.~\pageref{fc}
for a qualification)
\end{latexonly}.

\end{itemize}

\subsection*{Limitations}
\begin{itemize}
\index{Point Group D$_{8d}$ missing}\index{D$_{8d}$ missing}
\item Group D$_{8d}$ is missing.  This group is characterized by the presence
of a 16-fold S$_n$ axis.  Only S$_n$ operations up to S$_{12}$  are  checked
for.  As a  result, D$_{8d}$ would not be recognized.  However, this is a rare
point-group, and its loss should not be important.

\item Some systems which are insufficiently near to a given point group will be
assigned to the nearest sub-group.  For example, if SF$_6$ is distorted so that
two opposite F atoms are at a different distance to the other four, the system
might be classified as O$_h$ or D$_{4h}$, depending on the degree of
distortion.  This shows up mainly in methyl groups, e.g.\ neopentane, in which
optimization normally stops before the angles of the hydrogens are fully
optimized.
\end{itemize}

\subsection{Representation of Point Groups}
The 57 groups recognized in MOPAC are given in Table~\ref{pgs}.
\begin{table}
\caption{\label{pgs} Point Groups available within Symmetry Code}
\begin{center}
\begin{tabular}{lllllllll} \hline
 C$_1$&C$_{s} $ & C$_{i }$   &       &      &      &     &  O             \\
 C$_2$&C$_{2v}$ & C$_{2h}$   & D$_2$ & D$_{2d}$  & D$_{2h}$  &     &  T   \\
 C$_3$&C$_{3v}$ & C$_{3h}$   & D$_3$ & D$_{3d}$  & D$_{3h}$  &     &  T$_d$   \\
 C$_4$&C$_{4v}$ & C$_{4h}$   & D$_4$ & D$_{4d}$  & D$_{4h}$  & S$_4$  &  T$_h$   \\
 C$_5$&C$_{5v}$ & C$_{5h}$   & D$_5$ & D$_{5d}$  & D$_{5h}$  &     &  O$_h$   \\
 C$_6$&C$_{6v}$ & C$_{6h}$   & D$_6$ & D$_{6d}$  & D$_{6h}$  & S$_6$  &  I & I$_h$   \\
 C$_7$&C$_{7v}$ & C$_{7h}$   & D$_7$ & D$_{7d}$  & D$_{7h}$  &  &   C$_{\infty v}$
& D$_{\infty h}$ \\
 C$_8$&C$_{8v}$ & C$_{8h}$   & D$_8$ &      & D$_{8h}$ & S$_8$  &   R$_3$   \\ \hline
\end{tabular}
\end{center}
\end{table}

Each point group is represented by a subset of the associated point-group
table. For example, the group D$_{2h}$ is represented by the subset shown in
Table~\ref{d2h}. The operations selected for the subgroup are the identity, E,
and that minimum set of operations which is sufficient to allow all the
operations to be generated as products of these operations.  Thus, for the
highest finite point group, I$_h$, the generating operations are: E, I, C$_3$,
and C$_5$.  Although it is not obvious, all 120 operations of the group can be
generated as products of these four operations.

\begin{table}
\caption{\label{d2h}Subset of Group D$_{2h}$}
\begin{center}
\begin{tabular}{lrrrr} \\ \hline
  $\Gamma$ &  E  &  C$_{2y}$ & C$_{2z}$& I \\ \hline
A$_g$   \\
B$_{1g}$ &1 &  1  &-1  &  1  \\
B$_{2g}$ &1 & -1  & 1  &  1  \\
B$_{3g}$ &1 & -1  &-1  &  1  \\
A$_{u} $ &1 &  1  & 1  & -1  \\
B$_{1u}$ &1 &  1  &-1  & -1  \\
B$_{2u}$ &1 & -1  & 1  & -1  \\
B$_{3u}$ &1 & -1  &-1  & -1  \\ \hline
\end{tabular}\end{center}
\end{table}

Each point-group is assumed to contain the totally symmetric representation,
here \index{Euler matrices} A$_{1g}$.  Operations are represented as $3\times3$
Euler matrices, thus C$_{2x}$, C$_{2y}$  and C$_{2z}$  would be represented as
in Figure~\ref{c2op} \ All operations not given can be generated as products of
operations already known, thus C$_{2x}$ = C$_{2y}$ $\times$ C$_{2z}$.

% 9 lines, including this line
\begin{figure}
\begin{makeimage}
\end{makeimage}
\begin{center}\hfil
C$_{2x}$: \begin{tabular}{|rrr|}1&0&0\\0&-1&0\\0&0&-1\end{tabular}\hfil
C$_{2y}$: \begin{tabular}{|rrr|}-1&0&0\\0&1&0\\0&0&-1\end{tabular}\hfil
C$_{2z}$: \begin{tabular}{|rrr|}-1&0&0\\0&-1&0\\0&0&1\end{tabular}\hfil
\end{center}
\caption{\label{c2op} Representation of Symmetry Operations}
\end{figure}

In order to minimize storage, the characters in  character tables are stored
separately from the point groups.  This allows, e.g., C$_{2v}$, C$_{2h}$, and
D$_{2}$ to use the same character table.

\subsection{Identification of Point-Groups}
\index{Infinite groups}
\subsubsection*{Infinite Groups}
In order to identify the molecular point-group the system must be oriented in a
specific way.  Four families of point-groups are checked for: (1) the infinite
groups, (2) the cubic groups, (3)  groups with one high-symmetry axis, and (4)
the Abelian groups. Each family is treated differently.  First, the moments of
inertia are calculated.  If all are zero, the system is a single atom, and the
associated group is R$_3$.  If two moments are zero, the system is  either
C$_{\infty v}$ or D$_{\infty h}$; the presence of a horizontal plane of
symmetry distinguishes between them.

\index{Cubic Groups}
\subsubsection*{Cubic Groups}
Having eliminated the infinite groups, the three moments of inertia are checked
to see if they are all the same.  If they are, then the system is cubic.  Cubic
systems are oriented by identifying atoms of the set nearest to the center of
symmetry.  If there are 4, 6, 8, 12, or 20 of these, and the number of
equidistant nearest neighbors  is 3, 4, 3, 5, or 3, respectively, then the
atoms are
%probably
at the vertices of one of the Platonic solids (tetrahedron, octahedron, cube,
icosahedron, dodecahedron),
%Platonic solids (tetrahedron, octahedron, cube, icosahedron, dodecahedron).
%There are a few cases in which these two conditions are true, but the
%solid is nevertheless not platonic.
%To exclude thses rare case, use is made of the ratio of the edge distance
%to the (vertex to center) distance.  This ratio is unique for each of the
%platonic solids, if the
%computed value is correct the solid is unambiguously platonic,
and therefore all atoms of the set lie on high-symmetry axes.  The first  atom
is selected and used to define the $z$ axis.

\index{Platonic solids} \index{Buckminsterfullerene} If the number of atoms in
the set does not correspond to any of the Platonic solids, then the set is
checked for the existence of a equilateral triangle, a square, or a regular
pentagon.  When one of these is found, the center of the polygon is used to
define the $z$ axis.  An example of this type of system is C$_{60}$,
Buckminsterfullerene, which has a five-fold axis going through the center of a
pentagonal face.

Once the $z$ axis is identified, the system is checked for C$_n$ axes, $n$=3 to
$n$=8.  To complete the orientation, the system is rotated about the $z$ axis
so that two atoms, having equal $z$ coordinates, have equal $y$ coordinates.
The existence of rotation axes which are not coincidental with the $z$ axis and
the presence or absence of a center of inversion are then used to identify
which cubic group the system belongs to.

\index{Degenerate groups}
\subsubsection*{Other Degenerate Groups}
If the system has still not been identified, then the two equal moments of
inertia indicate a degenerate point group.  As with the cubic groups, the $y$ and
$z$ axes (and, by implication, the $x$ axis) are identified. The system is
oriented, and the C$_n$ and S$_n$ axes identified.

The degenerate groups, C$_n$, C$_{nv}$, C$_{nh}$, D$_n$, D$_{nd}$, D$_{nh}$,
S$_n$, are distinguished by the existence or absence of C$_2$ axes
perpendicular to the $z$ axis, and by planes of symmetry.

\index{Abelian groups}\index{Orientation!for symmetry}
\index{Symmetry!orientation of molecules}

\subsubsection*{Abelian Groups}
All that remains are the Abelian groups, C$_1$, C$_2$, C$_i$, C$_s$,  C$_{2v}$,
C$_{2h}$, D$_2$,  and D$_{2h}$.  After orienting the molecule, the axes are
swapped around so that the normal convention for orienting Abelian systems is
obeyed.  For groups C$_1$, C$_2$, C$_i$, and C$_s$, there is no possibility for
ambiguity.  For C$_{2v}$ and D$_2$, however, the orientation of the system
affects the labels of the irreducible representations.  To prevent ambiguity,
the convention for orienting Abelian molecules is:
\begin{itemize}
\item The axis with the largest number of atoms is the $z$  axis.
\item The plane with the largest number of atoms that includes the $z$ axis is
the $yz$  plane.
\end{itemize}
Thus for ethylene, the $\pi$ orbitals point along the $x$  axis.

\subsubsection*{Tolerance}
Normally, molecular geometries do not exactly correspond to the idealized
point-group.  Thus benzene might have slightly different bond-lengths and
angles.  Of course, symmetry could be used to prevent this, but in the
discussion here we assume that the symmetry of the system is unknown.  To allow
for these slight distortions, a small tolerance is built in to the tests for
symmetry elements. This starts off at 0.1\AA\ , but may be tightened
automatically if ambiguities are detected.  An example of such an ambiguity is
found in tropylium, C$_7$H$_7^+$ ion, where the C-C distance is 1.4 \AA .
Rotating the ring by 45 degrees (a C$_8$ operation) would place the atoms at a
distance of only 0.18\AA\  from equivalent positions.  C$_7$ and C$_8$ would
thus  give almost identical results.  To resolve such ambiguities, when they
arise, the tolerance is reduced, and the test re-run.

Even with this feature, some systems still resist classification.   A distorted
geometry might have some, but not all, elements of a high point group.  Perhaps
a distorted benzene has a C$_2$(z) and a C$_3$(z), but  not a C$_6$(z),
impossible in a real system.  As such it would appear to be different from all
real point groups.  To accommodate such defects a descent in symmetry is
carried out.  This consists of checking each point-group in turn, in order of
decreasing symmetry.  Once all of the elements of a point group are satisfied,
the system is assigned to that point group, even if the system contains more
symmetry than the point group.

By these two devices, a variable tolerance and the descent in symmetry, most
systems should be identified correctly, or at least as a sub-group of the full
point group.

\subsection{Orientation of the Abelian groups C$_{2v}$ and D$_{2h}$}
Unlike all other groups, two of the Abelian groups, C$_{2v}$ and  D$_{2h}$,
present novel problems in assigning the irreducible representations.  For most
groups, the symmetry axis is obvious, or of there are several axes, the
principal axis is obvious.  For C$_{2v}$ and D$_{2h}$ an ambiguity exists.
Consider, for example, ethylene, a system of point-group D$_{2h}$.  Should the
$z$ axis be perpendicular to the plane of the molecule---that is the unique
direction, or should it go through the two carbon atoms---that is also a unique
direction, but for a different reason, or should it be the third orthogonal
direction---which is also unique.  The choice of $z$ axis is important in order
to correctly assign the B$_{1g}$ and B$_{1u}$ of point-group D$_{2h}$.  For
both C$_{2v}$ and D$_{2h}$ the $x$ and $y$ axes must also be unambiguously
defined in order to distinguish  between B$_{2g}$ and B$_{3g}$ and between
B$_{2u}$ and B$_{3u}$ of  D$_{2h}$, and between B$_{1}$ and B$_{2}$ of
C$_{2v}$. Clearly a convention has to be decided upon, otherwise one persons
B$_{1g}$ might be a second persons B$_{2g}$ and a third persons B$_{3g}$.

The convention used in MOPAC is the following:

If there are three C$_2$ axes, the one with the largest number of atoms unmoved
by a C$_2$ operation is $z$.  If there is only one C$_2$ axis, that is $z$.

Once $z$ is defined, the $y$ axis is defined as the axis of the remaining two
axes which has the larger number of atoms unmoved by  the $\sigma$ symmetry
operations.

The $x$ axis is the remaining axis.

To see how this works, consider ethylene, with the C--C axis being along the
$x$ direction, and the plane of the system being $xy$. Under the eight
operations of D$_{2h}$, E, C$_{2z}$, C$_{2y}$, C$_{2x}$, $\sigma_{xy}$,
$\sigma_{xz}$, $\sigma _{yz}$, and $i$, the number of atoms unmoved are 6, 0,
0, 2, 6, 2, 0, and 0 respectively.

From this it follows that the old $x$ axis is now re-defined as the $z$ axis.
The new $y$ axis has to be chosen based on the number of atoms unmoved under
the $\sigma_{xy}$ and $\sigma_{xz}$ operations (6 and 2). The new $y$ axis is
defined as being the old $y$ axis.  The remaining new axis $x$ therefore is the
old $z$ axis.

The overall result is that the symmetry axes in ethylene are defined as: $z$ -
along the C--C bond; $y$ - in the molecular plane, perpendicular to the C--C
bond, and $x$ - out-of-plane.

In MOPAC the orientation of the molecule is defined by the user, therefore the
assignment of the symmetry axes might be confusing.  If the irreducible
representations of ethylene are assigned, and the atoms are defined  using
internal coordinates in the order C, C, H, H, H, H, then the $p$ orbitals will
reflect the orientation used in the previous discussion, but the
representations will be correct according to the conventions just defined.

\subsection{Molecular Orbitals}
Each M.O.\ is subjected to the operation
$$
\psi' = |R|\psi>
$$
from which the expectation value
$$
\chi=<\psi'|\psi>
$$
can readily be calculated.

\index{Degenerate M.O.s}
All $\chi$'s within a given degenerate manifold are summed:
$$
\chi_i = \sum_j\chi_j^{(i)}
$$
where $j$ runs over all components of the degenerate manifold $i$.

This results in a set of characters which can be compared to those stored in
the character tables.

Since molecular orbitals involve single electrons, the irreducible
representations \index{Irreducible representations} are rendered into lower
case before printing.

\subsection{Normal Coordinates}
\index{States!vibration} \index{Normal coordinates}\index{Coordinates!normal}
Analysis of normal coordinates is a little simpler than that of molecular
orbitals in that every atom contributes precisely three components to each
normal coordinate, an $x$, $y$, and $z$ component.  These transform in the same
way as the p$_x$, p$_y$, and p$_z$ atomic orbitals.

Because normal coordinates are states, the first letter of the irreducible
representation is capitalized.

\subsection{States}
\index{States!electronic}\index{States!symmetry of}
Calculating the characters for electronic states is much more complicated than
that for M.O.s or normal coordinates.

Consider the effect of an operation, $R$, on a state, $\Phi_a$.  The
character of the operation is given by
$$
\chi_{R,a} = <\Phi_a|R|\Phi_a>.
$$
A state function can be expressed as a linear combination of microstates:
$$
\Phi_a = \sum_jC_{ja}\Psi_j,
$$
so the character of the operation on the state function can be written in
terms of microstates as
$$
\chi_{R,a} =\sum_i\sum_jC_{ia}C_{ja}<\Psi_i|R|\Psi_j>.
$$
Each microstate, $\Psi_j$, can be represented by a \mi{Slater determinant}
of $N$ molecular orbitals
:
$$
\Psi_j = \frac{1}{\sqrt{N!}}\sum_{P=1}^{N!}(-1)^PP(\prod_{k=1}^N\psi_k^j)
$$
\index{Microstates} where the molecular orbitals in the microstate consist of a
selection of the M.O.s in the  active space\index{Active space!in C.I.}.
Before we continue, let us examine this idea:

Consider a full set of M.O.s:
$$
\psi_1\psi_2\psi_3\psi_4 \psi_5 \psi_6 \psi_7 \psi_8 \psi_9
\psi_{10}\psi_{11}\psi_{12}\psi_{13}\psi_{14}\psi_{15}\psi_{16}.
$$
Let the active space be the M.O.s  from 8 to 11.  Then microstates containing
two electrons would be:
\begin{center}
\hfil
$\psi_8\psi_9$
\hfil
$\psi_8\psi_{10}$
\hfil
$\psi_8\psi_{11}$
\hfil
$\psi_9\psi_{10}$
\hfil
$\psi_9\psi_{11}$
\hfil
$\psi_{10}\psi_{11}$.
\hfil
\end{center}
These microstates could be represented by M.O.\ orbital occupancies.
\begin{center}
\hfil
1100
\hfil
1010
\hfil
1001
\hfil
0110
\hfil
0101
\hfil
0011.
\hfil
\end{center}
Remember that the M.O.s here can be of either $\alpha$ or $\beta$ spin.

To continue, we need to evaluate $<\Psi_i|R|\Psi_j>$.  This can be expressed
in terms of M.O.s as:
$$
<\Psi_i|R|\Psi_j> = \frac{1}{N!}\sum_{P=1}^{N!}(-1)^PP(<\prod_{k=1}^N\psi_k^i)|
R|
\sum_{Q=1}^{N!}(-1)^QQ(\prod_{l=1}^N\psi_l^j)>.
$$

For convenience, we will represent the integral $<\psi_k^i|R|\psi_l^j>$ by
$\chi_{kl}^{ij}$.  This integral can be described as ``The integral over M.O.\
$\psi_k$ in microstate $\Psi_i$ with the result of operator $R$ acting
on M.O.\ $\psi_l$ in microstate $\Psi_j$.''

Using this abbreviation, $<\Psi_i|R|\Psi_j>$ can be written as:
$$
<\Psi_i|R|\Psi_j> =\frac{1}{N!}\sum_{P=1}^{N!} \sum_{Q=1}^{N!}(-1)^P(-1)^Q
P\prod_{k=1}^{N!}Q\prod_{l=1}^{N!}\chi_{kl}^{ij}.
$$
Although it is not immediately obvious, the right-hand term is a determinant,
of order $N$:
$$
<\Psi_i|R|\Psi_j> =\left|
\begin{array}{cccc}
\chi_{11}^{ij} & \chi_{21}^{ij} & \chi_{31}^{ij} & \ldots \\
\chi_{12}^{ij} & \chi_{22}^{ij} & \chi_{32}^{ij} & \ldots \\
\chi_{13}^{ij} & \chi_{23}^{ij} & \chi_{33}^{ij} & \ldots \\
 \ldots           &  \ldots           &   \ldots          & \ldots
\end{array}
\right|.
$$

For our purposes, solution of the determinant is best done explicitly. To see
why, note that the number of M.O.s involved in the C.I.\ (the active space) is
very small.  Because of this, the number of electrons, $N$, in the Slater
determinants is also small; $N$ has a maximum value of  20.  Next, use can be
made of the fact that no point-group operation can mix $\alpha$ and $\beta$
electrons.  This allows the integral to be split into two parts, each of which
has a maximum value  of $N$=10. Finally, remember that $N$ is the number of
electrons, not M.O.s, used in the active space.  A system of $N$ electrons has
the same symmetry as a system in which all the M.O.s which were occupied were
replaced with all the M.O.s which were not occupied (the positron
equivalent)\index{Positron equivalent}. (This assumes that if every M.O.\ were
occupied, then the state of the system would be totally symmetric.)   Using
this fact, we can replace the $N$ occupied M.O.s with $N'$ unoccupied M.O.s, if
$N' < N$.

When these three points are considered, we see that $N$ has a maximum value  of
5 (for a system of 10 M.O.s).  Each case can be considered separately.
\begin{description}
\item{For $N$ = 1:}
$$
<\Psi_i|R|\Psi_i> = \frac{1}{1}\sum_{P=1}^{1} \sum_{Q=1}^{1}(-1)^P(-1)^Q
P\prod_{k=1}^{1}Q\prod_{l=1}^{1}\chi_{kl}^{ii}
$$
or
$$
<\Psi_i|R|\Psi_i> = <\psi_1^i|R|\psi_1^i> = \chi_{11}^{ii}.
$$
\item{For $N$=2:}
$$
<\Psi_i|R|\Psi_j> = \frac{1}{2!}\sum_{P=1}^{2!} \sum_{Q=1}^{2!}(-1)^P(-1)^Q
P\prod_{k=1}^{2}Q\prod_{l=1}^{2}\chi_{kl}^{ij}
$$
or
$$
<\Psi_i|R|\Psi_j> = <\psi_1^i|R|\psi_1^j>-<\psi_2^i|R|\psi_2^j>
<\psi_1^i|R|\psi_2^j><\psi_1^i|R|\psi_2^j>
$$
or
$$
<\Psi_a|R|\Psi_a> = \chi_{11}^{ij}\chi_{22}^{ij}-\chi_{12}^{ij}\chi_{21}^{ij}.
$$
\item{For $N$=3:}
$$
<\Psi_i|R|\Psi_j> = \frac{1}{3!}\sum_{P=1}^{3!} \sum_{Q=1}^{3!}(-1)^P(-1)^Q
$$
\begin{eqnarray}
<\Psi_i|R|\Psi_j>& = &\ <\psi_1^i|R|\psi_1^j><\psi_2^i|R|\psi_2^j><\psi_3^i|R|\psi_3^j> \nonumber   \\
&&-<\psi_1^i|R|\psi_1^j><\psi_2^i|R|\psi_3^j><\psi_3^i|R|\psi_2^j> \nonumber  \\
&&-<\psi_1^i|R|\psi_2^j><\psi_2^i|R|\psi_1^j><\psi_3^i|R|\psi_3^j> \nonumber  \\
&&+<\psi_1^i|R|\psi_2^j><\psi_2^i|R|\psi_3^j><\psi_3^i|R|\psi_1^j> \nonumber  \\
&&+<\psi_1^i|R|\psi_3^j><\psi_2^i|R|\psi_1^j><\psi_3^i|R|\psi_2^j> \nonumber  \\
&&-<\psi_1^i|R|\psi_3^j><\psi_2^i|R|\psi_2^j><\psi_3^i|R|\psi_1^j>  \nonumber
\end{eqnarray}
or
\begin{eqnarray}
<\Psi_i|R|\Psi_j>&=&\chi_{11}^{ij}\chi_{22}^{ij}\chi_{33}^{ij}+
                            \chi_{12}^{ij}\chi_{23}^{ij}\chi_{31}^{ij}+
                            \chi_{13}^{ij}\chi_{21}^{ij}\chi_{32}^{ij} \nonumber \\
&&-\chi_{11}^{ij}\chi_{23}^{ij}\chi_{32}^{ij}
-\chi_{12}^{ij}\chi_{21}^{ij}\chi_{33}^{ij}
-\chi_{13}^{ij}\chi_{22}^{ij}\chi_{31}^{ij}). \nonumber
\end{eqnarray}
\end{description}

For higher numbers of electrons, the associated determinant is solved using
standard methods.

The total character, $<\Psi_a|R|\Psi_a>$, is obtained by multiplying the
characters for the $\alpha$ and $\beta$ parts together:
$$
<\Psi_a|R|\Psi_a> = <\Psi_a^{\alpha}|R|\Psi_a^{\alpha}>
<\Psi_a^{\beta}|R|\Psi_a^{\beta}>.
$$
If the positron equivalent is taken for only one set of electrons, e.g.\ either
the $\alpha$ or the $\beta$ set, but not both, then the  character has  to be
multiplied by the determinant of the M.O.\ transform.

These expressions can then be used in
$$
\chi_{R,a} =\sum_i\sum_jC_{ia}C_{ja}<\Psi_i|R|\Psi_j>.
$$
to give the expectation value for the state. Finally, if the state is
degenerate, the character is given by summing the components of the state.

For the atom, the \mi{Russell-Saunders} coupling scheme can be reproduced.
States allowed are $S$, $P$, $D$, $F$, $G$, $H$, $I$, $K$, $L$, and $M$. This
set is more than sufficient to allow all possible Russell-Saunders states
spanned by a basis set of $s$, $p$, and $d$ orbitals to be represented. The
highest angular momentum achievable with such a basis set is 8, i.e. $L$. For
simpler atoms (ones with only a $s-p$ basis set) the allowed states are
$p^0,p^6$: $^1S_g$,  $p^1,p^5$: $^2P_u$, $p^2,p^4$: $^1S_g + ^3\!\!P_g +
^1\!\!D_g$,  $p^3$: $^4\!S_u +^2\!\!P_u + ^2\!\!D_u$.

For the axial infinite groups, allowed states are: $\Sigma$, $\Pi$, $\Delta$,
$\Phi$, and $\Gamma$.  Even quite simple systems can achieve quite high angular
momentum, \index{Angular momentum} thus acetylene, with a \comp{C.I.=4}  (the
HOMO $\pi$ and LUMO $\pi^*$) will contain a $^1\Gamma_g$ state,  i.e., the
angular momentum will be 4.

At present J-J coupling is not supported.
\index{Groups|)}