This commit is contained in:
matthias@quintern.xyz 2024-07-14 16:04:46 +02:00
parent 4faf0ba2a3
commit 0ea383ec9d
21 changed files with 21028 additions and 236 deletions

View File

@ -1,5 +1,5 @@
\def\vecr{{\vec{r}}} \def\vecr{{\vec{r}}}
\kef\abohr{a_\textrm{B}} \def\abohr{a_\textrm{B}}
\Section[ \Section[
\eng{Hydrogen Atom} \eng{Hydrogen Atom}
@ -178,3 +178,5 @@
\ger{Effekte im Magnetfeld} \ger{Effekte im Magnetfeld}
]{mag_effects} ]{mag_effects}
\TODO{all} \TODO{all}
\\\TODO{Hunds rules}

22
src/bib/cm.bib Normal file
View File

@ -0,0 +1,22 @@
@Article{Bian2021,
author={Bian, Ke
and Gerber, Christoph
and Heinrich, Andreas J.
and M{\"u}ller, Daniel J.
and Scheuring, Simon
and Jiang, Ying},
title={Scanning probe microscopy},
journal={Nature Reviews Methods Primers},
year={2021},
month={May},
day={13},
volume={1},
number={1},
pages={36},
abstract={Scanning probe microscopy (SPM), a key invention in nanoscience, has by now been extended to a wide spectrum of basic and applied fields. Its application to basic science led to a paradigm shift in the understanding and perception of matter at its nanoscopic and even atomic levels. SPM uses a sharp tip to physically raster-scan samples and locally collect information from the surface. Various signals can be directly detected by SPM in real space with atomic or nanoscale resolution, which provides insights into the structural, electronic, vibrational, optical, magnetic, (bio)chemical and mechanical properties. This Primer introduces the key aspects and general features of SPM and SPM set-up and variations, with particular focus on scanning tunnelling microscopy and atomic force microscopy. We outline how to conduct SPM experiments, as well as data analysis of SPM imaging, spectroscopy and manipulation. Recent applications of SPM to physics, chemistry, materials science and biology are then highlighted, with representative examples. We outline issues with reproducibility, and standards on open data are discussed. This Primer also raises awareness of the ongoing challenges and possible ways to overcome these difficulties, followed by an outlook of future possible directions.},
issn={2662-8449},
doi={10.1038/s43586-021-00033-2},
url={https://doi.org/10.1038/s43586-021-00033-2}
}

View File

@ -229,3 +229,120 @@
\TODO{TODO} \TODO{TODO}
\Section[
\eng{Measurement techniques}
\ger{Messtechniken}
]{meas}
\Subsection[
\eng{ARPES}
\ger{ARPES}
]{arpes}
what?
in?
how?
plot
\Subsection[
\eng{Scanning probe microscopy SPM}
\ger{Rastersondenmikroskopie (SPM)}
]{spm}
\begin{ttext}
\eng{Images of surfaces are taken by scanning the specimen with a physical probe.}
\ger{Bilder der Oberfläche einer Probe werden erstellt, indem die Probe mit einer Sonde abgetastet wird.}
\end{ttext}
\Eng[name]{Name}
\Ger[name]{Name}
\Eng[application]{Application}
\Ger[application]{Anwendung}
\begin{minipagetable}{amf}
\entry{name}{
\eng{Atomic force microscopy (AMF)}
\ger{Atomare Rasterkraftmikroskopie (AMF)}
}
\entry{application}{
\eng{Surface stuff}
\ger{Oberflächenzeug}
}
\entry{how}{
\eng{With needle}
\ger{Mit Nadel}
}
\end{minipagetable}
\begin{minipage}{0.5\textwidth}
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{img/cm_amf.pdf}
\caption{\cite{Bian2021}}
\end{figure}
\end{minipage}
\begin{minipagetable}{stm}
\entry{name}{
\eng{Scanning tunneling microscopy (STM)}
\ger{Rastertunnelmikroskop (STM)}
}
\entry{application}{
\eng{Surface stuff}
\ger{Oberflächenzeug}
}
\entry{how}{
\eng{With TUnnel}
\ger{Mit TUnnel}
}
\end{minipagetable}
\begin{minipage}{0.5\textwidth}
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{img/cm_stm.pdf}
\caption{\cite{Bian2021}}
\end{figure}
\end{minipage}
\Section[
\eng{Fabrication techniques}
\ger{Herstellungsmethoden}
]{fab}
\begin{minipagetable}{cvd}
\entry{name}{
\eng{Chemical vapor deposition (CVD)}
\ger{Chemische Gasphasenabscheidung (CVD)}
}
\entry{how}{
\eng{
A substrate is exposed to volatile precursors, which react and/or decompose on the heated substrate surface to produce the desired deposit.
By-products are removed by gas flow through the chamber.
}
\ger{
An der erhitzten Oberfläche eines Substrates wird aufgrund einer chemischen Reaktion mit einem Gas eine Feststoffkomponente abgeschieden.
Nebenprodukte werden durch den Gasfluss durch die Kammer entfernt.
}
}
\entry{application}{
\eng{
\begin{itemize}
\item Polysilicon \ce{Si}
\item Silicon dioxide \ce{SiO_2}
\item Graphene
\item Diamond
\end{itemize}
}
\ger{
\begin{itemize}
\item Poly-silicon \ce{Si}
\item Siliziumdioxid \ce{SiO_2}
\item Graphen
\item Diamant
\end{itemize}
}
}
\end{minipagetable}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=\textwidth]{img/cm_cvd_english.pdf}
\end{minipage}

View File

@ -110,7 +110,7 @@
\begin{formula}{eigendecomp} \begin{formula}{eigendecomp}
\desc{Eigendecomposition}{}{$A$ diagonalizable, columns of $V$ are eigenvectors $v_i$, $\Lambda$ diagonal matrix with eigenvalues $\lambda_i$ on the diagonal} \desc{Eigendecomposition}{}{$A$ diagonalizable, columns of $V$ are eigenvectors $v_i$, $\Lambda$ diagonal matrix with eigenvalues $\lambda_i$ on the diagonal}
\desc[german]{Eigenwertzerlegung}{}{$A$ diagonalisierbar, Spalten von $V$ sind die Eigenvektoren $v_i$, $\Lambda$ Diagonalmatrix mit Eigenwerten $\lambda_$ auf der Diagonalen} \desc[german]{Eigenwertzerlegung}{}{$A$ diagonalisierbar, Spalten von $V$ sind die Eigenvektoren $v_i$, $\Lambda$ Diagonalmatrix mit Eigenwerten $\lambda_i$ auf der Diagonalen}
\eq{A = V \Lambda V^{-1}} \eq{A = V \Lambda V^{-1}}
\end{formula} \end{formula}

View File

@ -2,37 +2,50 @@
% \usepackage[utf8]{inputenc} % \usepackage[utf8]{inputenc}
\usepackage[german]{babel} \usepackage[german]{babel}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{mathtools} % ENVIRONMENTS etc
\usepackage{MnSymbol} % for >>> \ggg sign \usepackage{adjustbox}
% \usepackage{esdiff} % derivatives \usepackage{colortbl} % color table
% esdiff breaks when taking \dot{q} has argument \usepackage{tabularx} % bravais table
\usepackage{derivative} \usepackage{multirow} % for superconducting qubit table
\usepackage{bbold} % \mathbb font \usepackage{hhline} % for superconducting qubit table
\usepackage{braket} % TOOLING
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{etoolbox} \usepackage{etoolbox}
\usepackage{luacode}
\usepackage{expl3} % switch case and other stuff \usepackage{expl3} % switch case and other stuff
\usepackage{substr} \usepackage{substr}
\usepackage{xcolor} \usepackage{xcolor}
\usepackage{float} \usepackage{float}
\usepackage{tikz} % drawings
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{calc}
\usepackage{circuitikz}
\usepackage[hidelinks]{hyperref} \usepackage[hidelinks]{hyperref}
\usepackage{subcaption} \usepackage{subcaption}
\usepackage[shortlabels]{enumitem} % easily change enum symbols to i), a. etc \usepackage[shortlabels]{enumitem} % easily change enum symbols to i), a. etc
\usepackage{colortbl} % color table
\usepackage{tabularx} % bravais table
\usepackage{adjustbox}
\usepackage{multirow} % for superconducting qubit table
\usepackage{hhline} % for superconducting qubit table
\hypersetup{colorlinks = true, % Colours links instead of ugly boxes \hypersetup{colorlinks = true, % Colours links instead of ugly boxes
urlcolor = blue, % Colour for external hyperlinks urlcolor = blue, % Colour for external hyperlinks
linkcolor = cyan, % Colour of internal links linkcolor = cyan, % Colour of internal links
citecolor = red % Colour of citations citecolor = red % Colour of citations
} }
% \usepackage[version=4,arrows=pgf-filled]{mhchem} \usepackage{translations}
\input{util/translation.tex}
\usepackage{sectsty}
\usepackage{titlesec}
\input{util/colorscheme.tex}
% GRAPHICS
\usepackage{tikz} % drawings
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{calc}
\usepackage{circuitikz}
% SCIENCE PACKAGES
\usepackage{mathtools}
\usepackage{MnSymbol} % for >>> \ggg sign
% \usepackage{esdiff} % derivatives
% esdiff breaks when taking \dot{q} has argument
\usepackage{derivative}
\usepackage[version=4,arrows=pgf-filled]{mhchem}
\usepackage{bbold} % \mathbb font
\usepackage{braket}
\usepackage{siunitx} \usepackage{siunitx}
\sisetup{output-decimal-marker = {,}} \sisetup{output-decimal-marker = {,}}
\sisetup{separate-uncertainty} \sisetup{separate-uncertainty}
@ -40,9 +53,8 @@
\sisetup{exponent-product=\ensuremath{\cdot}} \sisetup{exponent-product=\ensuremath{\cdot}}
\usepackage{translations}
\newcommand{\TODO}[1]{{\color{red}TODO:#1}} \newcommand{\TODO}[1]{{\color{bright_red}TODO:#1}}
\newcommand{\ts}{\textsuperscript} \newcommand{\ts}{\textsuperscript}
% put an explanation above an equal sign % put an explanation above an equal sign
@ -54,69 +66,7 @@
\overset{\substack{\mathrlap{\text{\hspace{-1em}#2}}\\\downarrow}}{#1}} \overset{\substack{\mathrlap{\text{\hspace{-1em}#2}}\\\downarrow}}{#1}}
%
% TRANSLATION COMMANDS
%
% The lower case commands use \fqname based keys, the upper case absolute keys.
% Example:
% \dt[example]{german}{Beispiel} % defines the key \fqname:example
% \ger[example]{Beispiel} % defines the key \fqname:example
% \DT[example]{german}{Beispiel} % defines the key example
% \Ger[example]{Beispiel} % defines the key example
%
% For ease of use in the ttext environment and the optional argument of the \Part, \Section, ... commands,
% all "define translation" commands use \fqname as default key
% Get a translation
% expandafter required because the translation commands dont expand anything
% shortcuts for translations
% 1: key
\newcommand{\gt}[1]{\expandafter\GetTranslation\expandafter{\fqname:#1}}
\newcommand{\GT}[1]{\expandafter\GetTranslation\expandafter{#1}}
\newcommand{\IfTranslationExists}{
\IfTranslation{\languagename}
}
\newcommand{\iftranslation}[1]{\expandafter\IfTranslationExists\expandafter{\fqname:#1}}
% Define a new translation
% [1]: key, 2: lang, 3: translation
\newcommand{\dt}[3][\fqname]{
% hack because using expandafter on the second arg didnt work
\def\tempaddtranslation{\addtranslation{#2}}
\ifstrequal{#1}{\fqname}{
\expandafter\tempaddtranslation\expandafter{\fqname}{#3}
}{
\expandafter\tempaddtranslation\expandafter{\fqname:#1}{#3}
}
}
\newcommand{\DT}[3][\fqname]{
% hack because using expandafter on the second arg didnt work
\def\tempaddtranslation{\addtranslation{#2}}
\ifstrequal{#1}{\fqname}{
\expandafter\tempaddtranslation\expandafter{\fqname}{#3}
}{
\expandafter\tempaddtranslation\expandafter{#1}{#3}
}
}
% [1]: key, 2: translation
\newcommand{\ger}[2][\fqname]{\dt[#1]{german}{#2}}
\newcommand{\eng}[2][\fqname]{\dt[#1]{english}{#2}}
\newcommand{\Ger}[2][\fqname]{\DT[#1]{german}{#2}}
\newcommand{\Eng}[2][\fqname]{\DT[#1]{english}{#2}}
% use this to define text in different languages for the key <env arg>
% the translation for <env arg> when the environment ends.
% (temporarily change fqname to the \fqname:<env arg> to allow
% the use of \eng and \ger without the key parameter)
\newenvironment{ttext}[1][desc]{
\edef\realfqname{\fqname}
\edef\fqname{\fqname:#1}
}{
\expandafter\GT\expandafter{\fqname} \\
\edef\fqname{\realfqname}
}
% "automate" sectioning % "automate" sectioning
% start <section>, get heading from translation, set label % start <section>, get heading from translation, set label
@ -160,14 +110,18 @@
\label{sec:\fqname} \label{sec:\fqname}
} }
% Make the translation of #1 a reference to a equation
% 1: key
\newcommand{\fqEqRef}[1]{ \newcommand{\fqEqRef}[1]{
\hyperref[eq:#1]{\GT{#1}} \hyperref[eq:#1]{\GT{#1}}
} }
% Make the translation of #1 a reference to a section
% 1: key
\newcommand{\fqSecRef}[1]{ \newcommand{\fqSecRef}[1]{
\hyperref[sec:#1]{\GT{#1}} \hyperref[sec:#1]{\GT{#1}}
} }
\usepackage{xstring} % \usepackage{xstring}
\input{circuit.tex} \input{circuit.tex}
@ -178,8 +132,8 @@
\author{Matthias Quintern} \author{Matthias Quintern}
\date{\today} \date{\today}
\input{macros.tex} \input{util/macros.tex}
\input{environments.tex} \input{util/environments.tex}
\begin{document} \begin{document}
@ -188,7 +142,7 @@
\newpage \newpage
\setcounter{page}{1} \setcounter{page}{1}
\input{translations.tex} \input{util/translations.tex}
\input{linalg.tex} \input{linalg.tex}

View File

@ -25,7 +25,7 @@
\desc{Median}{Value separating lower half from top half}{$x$ dataset with $n$ elements} \desc{Median}{Value separating lower half from top half}{$x$ dataset with $n$ elements}
\desc[german]{Median}{Teilt die untere von der oberen Hälfte}{$x$ Reihe mit $n$ Elementen} \desc[german]{Median}{Teilt die untere von der oberen Hälfte}{$x$ Reihe mit $n$ Elementen}
\eq{ \eq{
\textrm{med}(x) = \left\{ \begin{array}{ll} x_{(n+1)/2} & \text{$n$ \GT{odd}} \\ \frac{x_{(n/2)}+x_{((n/2)+1)}}{2} & \text{$n$ \GT{even}} \end{array} \right \textrm{med}(x) = \left\{ \begin{array}{ll} x_{(n+1)/2} & \text{$n$ \GT{odd}} \\ \frac{x_{(n/2)}+x_{((n/2)+1)}}{2} & \text{$n$ \GT{even}} \end{array} \right.
} }
\end{formula} \end{formula}
@ -45,10 +45,6 @@
\eng{Distributions} \eng{Distributions}
\ger{Verteilungen} \ger{Verteilungen}
]{distributions} ]{distributions}
\Subsubsection[ \Subsubsection[
\eng{Gauß/Normal distribution} \eng{Gauß/Normal distribution}
\ger{Gauß/Normal-Verteilung} \ger{Gauß/Normal-Verteilung}

View File

@ -162,14 +162,16 @@
\end{formula} \end{formula}
\begin{table}[h!] \begin{minipage}{0.8\textwidth}
\centering \begingroup
\begin{tabular}{ p{1cm} |p{1cm}||p{2.8cm}|p{2cm}|p{2cm}|p{2cm}|} \setlength{\tabcolsep}{0.9em} % horizontal
\renewcommand{\arraystretch}{2} % vertical
\begin{tabular}{ p{0.5cm} |p{0.8cm}||p{2.2cm}|p{1.9cm}|p{1.9cm}|p{1.8cm}|}
\multicolumn{1}{c}{}& \multicolumn{1}{c}{} &\multicolumn{4}{c}{$E_L/(E_J-E_L)$} \\ \multicolumn{1}{c}{}& \multicolumn{1}{c}{} &\multicolumn{4}{c}{$E_L/(E_J-E_L)$} \\
\cline{3-6} \cline{3-6}
\multicolumn{1}{c}{} & & $0$ & $\ll$ 1 & $\sim 1$ & $\gg 1$\\ \multicolumn{1}{c}{} & & $0$ & $\ll$ 1 & $\sim 1$ & $\gg 1$\\
\hhline{~|=====|} \hhline{~|=====|}
\multirow{4}{*}{$E_J/E_C$} & $\ll 1$ & cooper-pair box & & & \\ \multirow{4}{*}{$\frac{E_J}{E_C}$} & $\ll 1$ & cooper-pair box & & & \\
\cline{2-6} \cline{2-6}
& $\sim 1$ & quantronium & fluxonium & &\\ & $\sim 1$ & quantronium & fluxonium & &\\
\cline{2-6} \cline{2-6}
@ -178,10 +180,18 @@
& $\ggg 1$ & & & phase qubit & \\ & $\ggg 1$ & & & phase qubit & \\
\cline{2-6} \cline{2-6}
\end{tabular} \end{tabular}
\caption{``periodic table'' of superconducting quantum circuits} \endgroup
\label{Juncatalog} \end{minipage}
\begin{minipage}{0.2\textwidth}
\end{table} \begin{tikzpicture}[scale=2]
\draw[-latex,line width=2pt] (0,1)--++(0,1) node[midway,above,sloped] () {charge noise};
\draw[-latex,line width=2pt] (0,1)--++(0,1) node[midway,below,sloped] () {sensitivity};
\draw[-latex,line width=2pt] (0,0)--++(1,1) node[midway,above,sloped] () {flux noise};
\draw[-latex,line width=2pt] (0,0)--++(1,1) node[midway,below,sloped] () {sensitivity};
\draw[-latex,line width=2pt] (0,0)--++(1,-1) node[midway,above,sloped] () {critical current};
\draw[-latex,line width=2pt] (0,0)--++(1,-1) node[midway,below,sloped] () {noise sensitivity};
\end{tikzpicture}
\end{minipage}
\Subsection[ \Subsection[
@ -191,13 +201,24 @@
\begin{ttext} \begin{ttext}
\eng{ \eng{
= voltage bias junction\\= charge qubit? = voltage bias junction\\= charge qubit?
\begin{itemize}
\item large anharmonicity
\item sensitive to charge noise
\end{itemize}
} }
\ger{} \ger{}
\end{ttext} \end{ttext}
\begin{formula}{circuit}
\desc{Cooper Pair Box / Charge qubit}{
\begin{itemize}
\gooditem large anharmonicity
\baditem sensitive to charge noise
\end{itemize}
}{}
\desc[german]{Cooper Pair Box / Charge Qubit}{
\begin{itemize}
\gooditem Große Anharmonizität
\baditem Sensibel für charge noise
\end{itemize}
}{}
\content{
\centering
\begin{circuitikz} \begin{circuitikz}
\draw (0,0) to[sV=$V_\text{g}$] (0,2); \draw (0,0) to[sV=$V_\text{g}$] (0,2);
% \draw (0,0) to (2,0); % \draw (0,0) to (2,0);
@ -205,10 +226,10 @@
\draw (2,0) to[josephsoncap=$C_\text{J}$] (2,2); \draw (2,0) to[josephsoncap=$C_\text{J}$] (2,2);
\draw (0,0) to (2,0); \draw (0,0) to (2,0);
\end{circuitikz} \end{circuitikz}
}
\end{formula}
\TODO{maybe include graphic from page 48, intro to qed circuits}
\begin{formula}{hamiltonian} \begin{formula}{hamiltonian}
\desc{Hamiltonian}{}{} \desc{Hamiltonian}{}{}
\desc[german]{Hamiltonian}{}{} \desc[german]{Hamiltonian}{}{}
@ -224,27 +245,25 @@
\desc{Transmon qubit}{ \desc{Transmon qubit}{
Josephson junction with a shunt \textbf{capacitance}. Josephson junction with a shunt \textbf{capacitance}.
\begin{itemize} \begin{itemize}
\item charge noise insensitive \gooditem charge noise insensitive
\item small anharmonicity \baditem small anharmonicity
\end{itemize} \end{itemize}
}{} }{}
\desc[ger]{Transmon Qubit}{ \desc[german]{Transmon Qubit}{
Josephson-Kontakt mit einem parallelen \textbf{kapzitiven Element}. Josephson-Kontakt mit einem parallelen \textbf{kapzitiven Element}.
\begin{itemize} \begin{itemize}
\item Charge noise resilient \gooditem Charge noise resilient
\item Geringe Anharmonizität $\alpha$ \baditem Geringe Anharmonizität $\alpha$
\end{itemize} \end{itemize}
}{} }{}
\content{ \content{
\centering \centering
\begin{circuitikz} \begin{circuitikz}
\draw (0,0) to[sV=$V_\text{g}$] ++(0,3) % \draw (0,0) to[sV=$V_\text{g}$] ++(0,3)
to[capacitor=$C_\text{g}$] ++(2,0) % to[capacitor=$C_\text{g}$] ++(2,0)
to[capacitor=$C_C$] ++(0,-3) \draw (0,0) to ++(2,0) to ++(0,-0.5) to[josephsoncap=$C_\text{J}$] ++(-0,-2) to ++(0,-0.5) to ++(-2,0)
to ++(-2,0); to[capacitor=$C_C$] ++(0,3);
\draw (2,3) to ++(2,0) to ++(0,-0.5) to[josephsoncap=$C_\text{J}$] ++(-0,-2) to ++(0,-0.5) to ++(-2,0);
\end{circuitikz} \end{circuitikz}
\\\TODO{Ist beim Transmon noch die Voltage source dran?}
} }
\end{formula} \end{formula}
@ -264,11 +283,12 @@
\content{ \content{
\centering \centering
\begin{circuitikz} \begin{circuitikz}
\draw (0,0) to[sV=$V_\text{g}$] ++(0,3) % \draw (0,0) to[sV=$V_\text{g}$] ++(0,3)
to[capacitor=$C_\text{g}$] ++(2,0) % to[capacitor=$C_\text{g}$] ++(2,0)
to[capacitor=$C_C$] ++(0,-3) \draw (0,0) to ++(-2,0)
to ++(-2,0); to ++(3,0) to ++(0,-0.5) \squidloop{loop}{SQUID} to ++(0,-0.5) to ++(-3,0)
\draw (2,3) to ++(3,0) to ++(0,-0.5) \squidloop{loop}{SQUID} to ++(0,-0.5) to ++(-3,0); to[capacitor=$C_C$] ++(0,3);
\end{circuitikz} \end{circuitikz}
} }
\end{formula} \end{formula}
@ -284,6 +304,52 @@
\eq{\hat{H} = 4E_C \hat{n}^2 - \frac{1}{2} E_\text{J,eff}(\Phi_\text{ext}) \sum_{n}\left[\ket{n}\bra{n+1} + \ket{n+1}\bra{n}\right]} \eq{\hat{H} = 4E_C \hat{n}^2 - \frac{1}{2} E_\text{J,eff}(\Phi_\text{ext}) \sum_{n}\left[\ket{n}\bra{n+1} + \ket{n+1}\bra{n}\right]}
\end{formula} \end{formula}
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{img/qubit_transmon.pdf}
\caption{Transmon and so TODO}
\label{fig:img-qubit_transmon-pdf}
\end{figure}
\Subsection[
\eng{Phase qubit}
\ger{Phase Qubit}
]{phase}
\begin{formula}{circuit}
\desc{Phase qubit}{}{}
\desc[german]{Phase Qubit}{}{}
\content{
\centering
\begin{circuitikz}
% \draw (0,0) to[sV=$V_\text{g}$] ++(0,3)
% to ++(2,0) coordinate(top1)
% to ++(2,0) coordinate(top2)
% to ++(2,0) coordinate(top3);
% \draw (0,0)
% to ++(2,0) coordinate(bot1)
% to ++(2,0) coordinate(bot2)
% to ++(2,0) coordinate(bot3);
\draw[color=gray] (0,0) to[capacitor=$C_C$] (0,-2);
% \draw (top1) to ++(0,-0.5) to[josephsoncap=$C_\text{J}$] ++(-0,-2) to (bot2);
\draw(0,0) to ++(2,0) to[josephsoncap=$C_\text{J}$] ++(0,-2) to ++(-2,0);
\draw (2,0) to ++(2,0) to[cute inductor=$E_L$] ++(0,-2) to ++(-2,0);
\node at (3,-1.5) {$\Phi_\text{ext}$};
\end{circuitikz}
\\\TODO{Ist beim Fluxonium noch die Voltage source dran?}
}
\end{formula}
\begin{formula}{hamiltonian}
\desc{Hamiltonian}{}{$\delta = \frac{\phi}{\phi_0}$}
\desc[german]{Hamiltonian}{}{}
\eq{\hat{H} = E_C \hat{n}^2 - E_J \cos \hat{\delta} + E_L(\hat{\delta} - \delta_s)^2}
\end{formula}
\Eng[TESTT]{This is only a test}
\Ger[TESTT]{}
\GT{TESTT}
\Subsection[ \Subsection[
\eng{Flux qubit} \eng{Flux qubit}
@ -296,15 +362,30 @@
\content{ \content{
\centering \centering
\begin{circuitikz} \begin{circuitikz}
\draw (0,0) to[sV=$V_\text{g}$] ++(0,3) \draw (0,0) to[josephsoncap=$\alpha E_\text{J}$, scale=0.8, transform shape] (0,-3);
to ++(2,0) coordinate(top1); \draw (0,0) to ++(3,0)
\draw[color=gray] (top1) to[capacitor=$C_C$] ++(0,-3); to[josephsoncap=$E_\text{J}$] ++(0,-1.5)
\draw (top1) to ++(2,0) coordinate(top2) to ++(0,-0.5) to[josephsoncap=$E_\text{J}$] ++(0,-1.5)
to[josephsoncap=$C_\text{J}$] ++(-0,-2) to ++(0,-0.5) to ++(-2,0) to ++(-2,0); to ++(-3,0);
\draw (top2) to ++(2,0) to[cute inductor=$E_L$] ++(0,-3) to ++(-2,0); \node at (1.5,-1.5) {$\Phi_\text{ext}$};
\node at (5,0.5) {$\Phi_\text{ext}$};
\end{circuitikz} \end{circuitikz}
\\\TODO{Ist beim Fluxonium noch die Voltage source dran?} % \begin{circuitikz}
% \draw (0,0) to[sV=$V_\text{g}$] ++(0,3)
% to ++(2,0) coordinate(top1)
% to ++(2,0) coordinate(top2)
% to ++(2,0) coordinate(top3);
% \draw (0,0)
% to ++(2,0) coordinate(bot1)
% to ++(2,0) coordinate(bot2)
% to ++(2,0) coordinate(bot3);
% \draw[color=gray] (top1) to[capacitor=$C_C$] (bot1);
% % \draw (top1) to ++(0,-0.5) to[josephsoncap=$C_\text{J}$] ++(-0,-2) to (bot2);
% \draw[scale=0.8, transform shape] (top2) to[josephsoncap=$\alpha E_\text{J}$] (bot2);
% \draw (top3)
% to[josephsoncap=$E_\text{J}$] ++(0,-1.5)
% to[josephsoncap=$E_\text{J}$] (bot3);
% \node at (5,0.5) {$\Phi_\text{ext}$};
% \end{circuitikz}
} }
\end{formula} \end{formula}
@ -326,13 +407,12 @@
\content{ \content{
\centering \centering
\begin{circuitikz} \begin{circuitikz}
\draw (0,0) to[sV=$V_\text{g}$] ++(0,3) % \draw (0,0) to[sV=$V_\text{g}$] ++(0,3)
to ++(2,0) coordinate(top1); % to ++(2,0) coordinate(top1);
\draw[color=gray] (top1) to[capacitor=$C_C$] ++(0,-3); \draw[color=gray] (0,0) to ++(-2,0) to[capacitor=$C_C$] ++(0,-3) to ++(2,0);
\draw (top1) to ++(2,0) coordinate(top2) to ++(0,-0.5) \draw (0,0) to[josephsoncap=$C_\text{J}$] ++(-0,-3);
to[josephsoncap=$C_\text{J}$] ++(-0,-2) to ++(0,-0.5) to ++(-2,0) to ++(-2,0); \draw (0,0) to ++(2,0) to[cute inductor=$E_L$] ++(0,-3) to ++(-2,0);
\draw (top2) to ++(2,0) to[cute inductor=$E_L$] ++(0,-3) to ++(-2,0); \node at (1,-0.5) {$\Phi_\text{ext}$};
\node at (5,0.5) {$\Phi_\text{ext}$};
\end{circuitikz} \end{circuitikz}
\\\TODO{Ist beim Fluxonium noch die Voltage source dran?} \\\TODO{Ist beim Fluxonium noch die Voltage source dran?}
} }
@ -347,7 +427,7 @@
\begin{figure}[h] \begin{figure}[h]
\centering \centering
\includegraphics[width=0.8\textwidth]{img/qubit_flux_onium.pdf} \includegraphics[width=\textwidth]{img/qubit_flux_onium.pdf}
\caption{img/} \caption{img/}
\label{fig:img-} \label{fig:img-}
\end{figure} \end{figure}
@ -392,8 +472,8 @@
\end{formula} \end{formula}
\begin{ttext}[long] \begin{ttext}[long]
\eng{$\Gamma_{1\uparrow}$ is supressed because of detailed balance} \eng{$\Gamma_{1\uparrow}$ is supressed at low temperatures because of detailed balance}
\ger{$\Gamma_{1\uparrow}$ ist unterdrückt wegen detailed balance} \ger{$\Gamma_{1\uparrow}$ ist bei niedrigen Temperaturen unterdrückt wegen detailed balance}
\end{ttext} \end{ttext}
\begin{formula}{dephasing} \begin{formula}{dephasing}
@ -415,13 +495,6 @@
\alpha^*\beta \e^{-\Gamma_2 t} & \abs{\beta}^2 \e^{-\Gamma_1 t} \end{pmatrix} } \alpha^*\beta \e^{-\Gamma_2 t} & \abs{\beta}^2 \e^{-\Gamma_1 t} \end{pmatrix} }
\end{formula} \end{formula}
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{img/qubit_transmon.pdf}
\caption{Transmon and so TODO}
\label{fig:img-qubit_transmon-pdf}
\end{figure}

46
src/readme.md Normal file
View File

@ -0,0 +1,46 @@
# Knowledge Collection
This is supposed to be a compact, searchable collection of the most important stuff I had to during my physics studides,
because it would be a shame if I forget it all!
# LaTeX Guideline
Here is some info to help myself remember why I did things the way I did.
In general, most content should be written with macros, so that the behaviour can be changed later.
## `fqname`
All translation keys and LaTeX labels should use a structured approach:
`<key type>:<partname>:<section name>:<subsection name>:<...>:<name>`
The `<partname>:...:<lowest section name>` will be defined as `fqname` (fully qualified name) macro when using the `\Part`, `\Section`, ... macros.
`<key type>` should be
- equation: `eq`
- table: `tab`
- figure: `fig`
- parts, (sub)sections: `sec`
## Multilanguage
All text should be defined as a translation (`translations` package, see `util/translation.tex`) and then used using the `gt` or `GT` macros.
The english translation of any key must be defined, because it will also be used as fallback.
Never make a macro that would have to be changed if a new language was added, eg dont do
```tex
% 1: key, 2: english version, 3: german version
\newcommand{\mycmd}[3]{
\dosomestuff{english}{#1}{#2}
\dosomestuff{german}{#1}{#3}
}
\mycmd{key}{this is english}{das ist deutsch}
```
Instead, do
```tex
% [1]: lang, 2: key, 2: text
\newcommand{\mycmd}[3][english]{
\dosomestuff{#1}{#2}{#3}
}
\mycmd{key}{this is english}
\mycmd[german]{key}{das ist deutsch}
```

File diff suppressed because one or more lines are too long

View File

@ -19,11 +19,13 @@ def texvar(var, val, math=True):
if math: s += "$" if math: s += "$"
return s return s
def export(fig, name): def export(fig, name, notightlayout=False):
if not skipasserts: if not skipasserts:
assert os.path.abspath(".").endswith("scripts"), "Please run from the `scripts` directory" assert os.path.abspath(".").endswith("scripts"), "Please run from the `scripts` directory"
filename = os.path.join(outdir, name + filetype) filename = os.path.join(outdir, name + filetype)
fig.savefig(filename, bbox_inches="tight") if not notightlayout:
fig.tight_layout()
fig.savefig(filename) #, bbox_inches="tight")
@np.vectorize @np.vectorize

View File

@ -65,11 +65,13 @@ export(transmon_cpb(), "qubit_transmon")
def flux_onium(): def flux_onium():
fig, axs = plt.subplots(1, 2, squeeze=True, figsize=(full,full)) fig, axs = plt.subplots(1, 3, squeeze=True, figsize=(full,full/2))
fluxs = np.linspace(-2, 2, 101) fluxs = np.linspace(0.4, 0.6, 50)
EJ = 35.0 EJ = 35.0
alpha = 0.6 alpha = 0.3
fluxqubit = scq.FluxQubit(EJ1 = EJ, # todo find useful parameters
fluxqubit = scq.FluxQubit(
EJ1 = EJ,
EJ2 = EJ, EJ2 = EJ,
EJ3 = alpha*EJ, EJ3 = alpha*EJ,
ECJ1 = 1.0, ECJ1 = 1.0,
@ -79,12 +81,22 @@ def flux_onium():
ECg2 = 50.0, ECg2 = 50.0,
ng1 = 0.0, ng1 = 0.0,
ng2 = 0.0, ng2 = 0.0,
flux = 0.5, flux = 1,
ncut = 10) ncut = 10)
fluxqubit.plot_evals_vs_paramvals("flux", fluxs, evals_count=5, subtract_ground=True, fig_ax=(fig, axs[0])) fluxqubit.plot_evals_vs_paramvals("flux", fluxs, evals_count=5, subtract_ground=False, fig_ax=(fig, axs[0]))
axs[0].set_title(f"Flux {texvar('alpha', alpha)}")
alpha = 0.8
fluxqubit.EJ3 = alpha * EJ
fluxqubit.ECJ3 = 1.0/alpha
fluxqubit.plot_evals_vs_paramvals("flux", fluxs, evals_count=5, subtract_ground=False, fig_ax=(fig, axs[1]))
axs[1].set_title(f"Flux {texvar('alpha', alpha)}")
# axs[0].set_xlim(0.4, 0.6)
fluxs = np.linspace(-1.1, 1.1, 101)
fluxonium = scq.Fluxonium(EJ=9, EC=3, EL=0.5, flux=1, cutoff=100) fluxonium = scq.Fluxonium(EJ=9, EC=3, EL=0.5, flux=1, cutoff=100)
fluxonium.plot_evals_vs_paramvals("flux", fluxs, evals_count=5, subtract_ground=True, fig_ax=(fig, axs[1])) fluxonium.plot_evals_vs_paramvals("flux", fluxs, evals_count=5, subtract_ground=True, fig_ax=(fig, axs[2]))
axs[2].set_title("Fluxonium")
return fig return fig
export(flux_onium(), "qubit_flux_onium") export(flux_onium(), "qubit_flux_onium")

View File

@ -651,7 +651,7 @@
\begin{formula}{generalized_zeta} \begin{formula}{generalized_zeta}
\desc{Generalized zeta function}{}{} \desc{Generalized zeta function}{}{}
\desc[german]{Verallgemeinerte Zeta-Funktion}{}{} \desc[german]{Verallgemeinerte Zeta-Funktion}{}{}
\eq{\left \begin{array}{l}g_\nu(z)\\f_\nu(z)\end{array}\right\} \coloneq \frac{1}{\Gamma(\nu)} \int_0^\infty \d x\, \frac{x^{\nu-1}}{\e^x z^{-1} \mp 1}} \eq{\left. \begin{array}{l}g_\nu(z)\\f_\nu(z)\end{array}\right\} \coloneq \frac{1}{\Gamma(\nu)} \int_0^\infty \d x\, \frac{x^{\nu-1}}{\e^x z^{-1} \mp 1}}
\end{formula} \end{formula}
\Subsection[ \Subsection[
@ -677,7 +677,7 @@
\begin{formula}{partition_sum} \begin{formula}{partition_sum}
\desc{Partition sum}{}{$p = 0,\,1$} \desc{Partition sum}{}{$p = 0,\,1$}
\desc[german]{Zustandssumme}{}{$p = 0,\,1$} \desc[german]{Zustandssumme}{}{$p = 0,\,1$}
\eq{Z_\text{g} = \prod_{p} \left(1+\e^{-\beta(\epsilon_p - \mu)\right)}} \eq{Z_\text{g} = \prod_{p} \left(1+\e^{-\beta(\epsilon_p - \mu)}\right)}
\end{formula} \end{formula}
\begin{formula}{occupation} \begin{formula}{occupation}
\desc{Occupation number}{Fermi-Dirac distribution. At $T=0$ \textit{Fermi edge} at $\epsilon=\mu$}{} \desc{Occupation number}{Fermi-Dirac distribution. At $T=0$ \textit{Fermi edge} at $\epsilon=\mu$}{}

10268
src/svgs/cm_amf.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 422 KiB

View File

@ -0,0 +1,8 @@
<svg width="231mm" height="97mm" version="1.1" viewBox="0 0 231 97" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="231" height="97" fill="#fff"/>
<g id="d" transform="matrix(1 0 0-1 9 127)">
<g fill="none" stroke-width="1.5"><path d="m7 75h25l26-25h102l24 25h27" stroke="#000"/><path id="c" d="m61 39 48 4-48 4m48-8h-48v8h48" stroke="#f70"/><use transform="matrix(-1 0 0 1 218 0)" xlink:href="#c"/></g>
<path id="a" d="m77 78v-19h4v19" fill="#ccf" stroke="#00f" stroke-width=".5"/><use transform="translate(63)" xlink:href="#a"/><use transform="translate(7)" xlink:href="#a"/><use transform="translate(14)" xlink:href="#a"/><use transform="translate(21)" xlink:href="#a"/><use transform="translate(28)" xlink:href="#a"/>
<use transform="translate(35)" xlink:href="#a"/><use transform="translate(42)" xlink:href="#a"/><use transform="translate(49)" xlink:href="#a"/><use transform="translate(56)" xlink:href="#a"/><path id="b" d="m-5 78v-1h11l-1-1 7 2" fill="#21d"/><use transform="translate(207)" xlink:href="#b"/></g>
<use transform="matrix(1 0 0-1 0 98)" xlink:href="#d"/>
<g style="font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman'" font-size="6px" text-anchor="middle"><text x="20" y="57">(a): Source</text><text x="20" y="63"> materials</text><text x="20" y="69">+ carrier gas</text><text x="118" y="73">(b) Substrates</text><text x="118" y="7">(c): heater</text><text x="118" y="93">(c): heater</text></g></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

9973
src/svgs/cm_stm.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 432 KiB

View File

@ -75,11 +75,6 @@
\end{formula} \end{formula}
\begin{ttext} \begin{ttext}
\eng{A 2D insulator with a non-zero } \eng{A 2D insulator with a non-zero Chern number is called a \textbf{topological insulator}}
\end{ttext} \end{ttext}

73
src/util/colorscheme.tex Normal file
View File

@ -0,0 +1,73 @@
% Define Gruvbox colors
\definecolor{dark0_hard}{HTML}{1d2021}
\definecolor{dark0}{HTML}{282828}
\definecolor{dark0_soft}{HTML}{32302f}
\definecolor{dark1}{HTML}{3c3836}
\definecolor{dark2}{HTML}{504945}
\definecolor{dark3}{HTML}{665c54}
\definecolor{dark4}{HTML}{7c6f64}
\definecolor{medium}{HTML}{928374}
\definecolor{light0_hard}{HTML}{f9f5d7}
\definecolor{light0}{HTML}{fbf1c7}
\definecolor{light0_soft}{HTML}{f2e5bc}
\definecolor{light1}{HTML}{ebdbb2}
\definecolor{light2}{HTML}{d5c4a1}
\definecolor{light3}{HTML}{bdae93}
\definecolor{light4}{HTML}{a89984}
\definecolor{bright_red}{HTML}{fb4934}
\definecolor{bright_green}{HTML}{b8bb26}
\definecolor{bright_yellow}{HTML}{fabd2f}
\definecolor{bright_blue}{HTML}{83a598}
\definecolor{bright_purple}{HTML}{d3869b}
\definecolor{bright_aqua}{HTML}{8ec07c}
\definecolor{bright_orange}{HTML}{fe8019}
\definecolor{neutral_red}{HTML}{cc241d}
\definecolor{neutral_green}{HTML}{98971a}
\definecolor{neutral_yellow}{HTML}{d79921}
\definecolor{neutral_blue}{HTML}{458588}
\definecolor{neutral_purple}{HTML}{b16286}
\definecolor{neutral_aqua}{HTML}{689d6a}
\definecolor{neutral_orange}{HTML}{d65d0e}
\definecolor{faded_red}{HTML}{9d0006}
\definecolor{faded_green}{HTML}{79740e}
\definecolor{faded_yellow}{HTML}{b57614}
\definecolor{faded_blue}{HTML}{076678}
\definecolor{faded_purple}{HTML}{8f3f71}
\definecolor{faded_aqua}{HTML}{427b58}
\definecolor{faded_orange}{HTML}{af3a03}
% Use Gruvbox colors for various elements
% \pagecolor{light0_hard}
% \color{dark0_hard}
% \pagecolor{dark0_hard}
% \color{light0_hard}
% Section headings in bright colors
\titleformat{\section}
{\color{neutral_purple}\normalfont\Large\bfseries}
{\color{neutral_purple}\thesection}{1em}{}
\titleformat{\subsection}
{\color{neutral_blue}\normalfont\large\bfseries}
{\color{neutral_blue}\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\color{neutral_aqua}\normalfont\normalsize\bfseries}
{\color{neutral_aqua}\thesubsubsection}{1em}{}
\titleformat{\paragraph}
{\color{neutral_green}\normalfont\normalsize\bfseries}
{\color{neutral_green}\theparagraph}{1em}{}
\titleformat{\subparagraph}
{\color{neutral_purple}\normalfont\normalsize\bfseries}
{\color{neutral_purple}\thesubparagraph}{1em}{}
% Links in neutral colors
\hypersetup{
colorlinks=true,
linkcolor=neutral_red,
citecolor=neutral_green,
filecolor=neutral_blue,
urlcolor=neutral_orange
}

View File

@ -1,3 +1,17 @@
% use this to define text in different languages for the key <env arg>
% the translation for <env arg> when the environment ends.
% (temporarily change fqname to the \fqname:<env arg> to allow
% the use of \eng and \ger without the key parameter)
% [1]: key
\newenvironment{ttext}[1][desc]{
\edef\realfqname{\fqname}
\edef\fqname{\fqname:#1}
}{
\expandafter\GT\expandafter{\fqname} \\
\edef\fqname{\realfqname}
}
\def\descwidth{0.3\textwidth} \def\descwidth{0.3\textwidth}
\def\eqwidth{0.6\textwidth} \def\eqwidth{0.6\textwidth}
@ -11,7 +25,7 @@
\gt{#2} \gt{#2}
}{} }{}
\iftranslation{#3}{ \iftranslation{#3}{
\\ {\color{darkgray} \gt{#3}} \\ {\color{dark1} \gt{#3}}
}{} }{}
\end{minipage} \end{minipage}
} }
@ -26,7 +40,7 @@
#2 #2
\noindent\iftranslation{#3}{ \noindent\iftranslation{#3}{
\begingroup \begingroup
\color{darkgray} \color{dark1}
\gt{#3} \gt{#3}
% \edef\temp{\GT{#1_defs}} % \edef\temp{\GT{#1_defs}}
% \expandafter\StrSubstitute\expandafter{\temp}{:}{\\} % \expandafter\StrSubstitute\expandafter{\temp}{:}{\\}
@ -47,7 +61,7 @@
\NameWithExplanation[\descwidth]{#1}{#1_desc} \NameWithExplanation[\descwidth]{#1}{#1_desc}
\hfill \hfill
\ContentBoxWithExplanation[\eqwidth]{#2}{#1_defs} \ContentBoxWithExplanation[\eqwidth]{#2}{#1_defs}
\textcolor{lightgray}{\hrule} \textcolor{dark3}{\hrule}
\vspace{0.5\baselineskip} \vspace{0.5\baselineskip}
% \par % \par
% \hrule % \hrule
@ -114,7 +128,7 @@
\label{fig:\fqname:#2} \label{fig:\fqname:#2}
\end{figure} \end{figure}
\end{minipage} \end{minipage}
\textcolor{lightgray}{\hrule} \textcolor{dark3}{\hrule}
\vspace{0.5\baselineskip} \vspace{0.5\baselineskip}
} }
@ -173,12 +187,15 @@
$\qtysign$ $[\SI{\qtyunit}] = [\SI{\qtybaseunits}]$ - \qtycomment \\ $\qtysign$ $[\SI{\qtyunit}] = [\SI{\qtybaseunits}]$ - \qtycomment \\
\ignorespacesafterend \ignorespacesafterend
} }
\def\distrightwidth{0.45\textwidth}
\def\distleftwidth{0.45\textwidth}
% Table for distributions
% create entries for parameters using \disteq
\newenvironment{distribution}[0]{ \def\distrightwidth{0.45\textwidth}
\def\distleftwidth{0.45\textwidth}
% Table for distributions
% create entries for parameters using \disteq
\newenvironment{distribution}{
% 1: param name (translation key) % 1: param name (translation key)
% 2: math % 2: math
\newcommand{\disteq}[2]{ \newcommand{\disteq}[2]{
@ -191,13 +208,13 @@
mean = "eq:pt:mean", mean = "eq:pt:mean",
variance = "eq:pt:variance" variance = "eq:pt:variance"
} }
if cases["\luaescapestring{#1}"] \string~= nil then if cases["\luaescapestring{##1}"] \string~= nil then
tex.sprint("\\hyperref["..cases["\luaescapestring{#1}"].."]{\\GT{#1}}") tex.sprint("\\hyperref["..cases["\luaescapestring{##1}"].."]{\\GT{##1}}")
else else
tex.sprint("\\GT{#1}") tex.sprint("\\GT{##1}")
end end
} }
& #2 \\ \hline & ##2 \\ \hline
} }
\hfill \hfill
\begin{minipage}{\distrightwidth} \begin{minipage}{\distrightwidth}
@ -206,8 +223,52 @@
\renewcommand{\arraystretch}{2} % vertical \renewcommand{\arraystretch}{2} % vertical
\begin{tabular}{|l|>{$\displaystyle}c<{$}|} \begin{tabular}{|l|>{$\displaystyle}c<{$}|}
\hline \hline
}{ }{
\end{tabular} \end{tabular}
\endgroup \endgroup
\end{minipage} \end{minipage}
}
% A 2 column table in a minipage
% create entries for parameters using \entry
% 1: minipage width
% 2: key of the table
\newenvironment{minipagetable}[2][0.5\textwidth]{
% save real fq name
\edef\tmpFqname{\fqname}
\edef\tmpMinipagetableWidth{#1}
\edef\tmpMinipagetableName{#2}
\directlua{
entries = {}
} }
% 1: field name (translation key)
% 2: translation define statements (field content)
\newcommand{\entry}[2]{
% temporarily set fqname so that the translation commands dont need an explicit key
\edef\fqname{\tmpFqname:#2:##1}
##2
\edef\fqname{\tmpFqname}
\directlua{
table.insert(entries, "\luaescapestring{##1}")
}
}
}{
% \hfill
\begin{minipage}{\tmpMinipagetableWidth}
\begingroup
\setlength{\tabcolsep}{0.9em} % horizontal
\renewcommand{\arraystretch}{2} % vertical
\begin{tabularx}{\textwidth}{|l|X|}
\hline
\directlua{
for _, k in ipairs(entries) do
tex.print("\\GT{" .. k .. "} & \\gt{\tmpMinipagetableName:" .. k .. "}\\\\")
end
}
\hline
\end{tabularx}
\endgroup
\end{minipage}
% reset the fqname
}

View File

@ -1,3 +1,6 @@
\def\gooditem{\item[{$\color{neutral_red}\bullet$}]}
\def\baditem{\item[{$\color{neutral_green}\bullet$}]}
\def\Grad{\vec{\nabla}} \def\Grad{\vec{\nabla}}
\def\Div{\vec{\nabla} \cdot} \def\Div{\vec{\nabla} \cdot}
\def\Rot{\vec{\nabla} \times} \def\Rot{\vec{\nabla} \times}

66
src/util/translation.tex Normal file
View File

@ -0,0 +1,66 @@
%
% TRANSLATION COMMANDS
%
% The lower case commands use \fqname based keys, the upper case absolute keys.
% Example:
% \dt[example]{german}{Beispiel} % defines the key \fqname:example
% \ger[example]{Beispiel} % defines the key \fqname:example
% \DT[example]{german}{Beispiel} % defines the key example
% \Ger[example]{Beispiel} % defines the key example
%
% For ease of use in the ttext environment and the optional argument of the \Part, \Section, ... commands,
% all "define translation" commands use \fqname as default key
% Get a translation
% expandafter required because the translation commands dont expand anything
% shortcuts for translations
% 1: key
\newcommand{\gt}[1]{\expandafter\GetTranslation\expandafter{\fqname:#1}}
\newcommand{\GT}[1]{\expandafter\GetTranslation\expandafter{#1}}
\newcommand{\IfTranslationExists}{
% \IfTranslation{\languagename}
\IfTranslation{english} % only check english. All translations must be defined for english
}
\newcommand{\iftranslation}[1]{\expandafter\IfTranslationExists\expandafter{\fqname:#1}}
% Define a translation and also make the fallback if it is the english translation
% 1: lang, 2: key, 3: translation
\newcommand{\addtranslationcustom}[3]{
\ifstrequal{#1}{english}{
\addtranslationfallback{#2}{#3}
}{}
\addtranslation{#1}{#2}{#3}
}
% Define a new translation
% [1]: key, 2: lang, 3: translation
\newcommand{\dt}[3][\fqname]{
\ifstrempty{#3}{}{ % dont add empty translations so that the fallback will be used instead
% hack because using expandafter on the second arg didnt work
\def\tempaddtranslation{\addtranslationcustom{#2}}
\ifstrequal{#1}{\fqname}{
\expandafter\tempaddtranslation\expandafter{\fqname}{#3}
}{
\expandafter\tempaddtranslation\expandafter{\fqname:#1}{#3}
}
}
}
\newcommand{\DT}[3][\fqname]{
\ifstrempty{#3}{}{ % dont add empty translations so that the fallback will be used instead
% hack because using expandafter on the second arg didnt work
\def\tempaddtranslation{\addtranslationcustom{#2}}
\ifstrequal{#1}{\fqname}{
\expandafter\tempaddtranslation\expandafter{\fqname}{#3}
}{
\expandafter\tempaddtranslation\expandafter{#1}{#3}
}
}
}
% [1]: key, 2: translation
\newcommand{\ger}[2][\fqname]{\dt[#1]{german}{#2}}
\newcommand{\eng}[2][\fqname]{\dt[#1]{english}{#2}}
\newcommand{\Ger}[2][\fqname]{\DT[#1]{german}{#2}}
\newcommand{\Eng}[2][\fqname]{\DT[#1]{english}{#2}}