Skip to content

Instantly share code, notes, and snippets.

@bbenno
Last active November 16, 2020 15:31
Show Gist options
  • Save bbenno/0b8ccc79aa74b2a135060d15ced901d2 to your computer and use it in GitHub Desktop.
Save bbenno/0b8ccc79aa74b2a135060d15ced901d2 to your computer and use it in GitHub Desktop.
DQCO LaTeX commands
% Import essential packages
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
% Define common constructs
\newcommand{\cat}[1]{|#1\rangle}
\newcommand{\bra}[1]{\langle#1|}
\newcommand{\bracat}[2]{\langle#1|#2\rangle}
\newcommand{\sqav}[1]{\big|#1\big|^2} % square of the absolute value
\newcommand{\csqrt}{\frac{1}{\sqrt{2}}}
\newcommand{\vb}[2]{\begin{pmatrix}#1\\#2\end{pmatrix}} % vertical basis
\newcommand{\hb}[2]{\begin{pmatrix}#1&#2\end{pmatrix}} % horizontal basis
% Common cat
\newcommand{\cz}{\cat{0}} % cat zero
\newcommand{\co}{\cat{1}} % cat one
\newcommand{\cp}{\cat{+}} % cat plus
\newcommand{\cm}{\cat{-}} % cat minus
% Common bra
\newcommand{\bz}{\bra{0}} % bra zero
\newcommand{\bo}{\bra{1}} % bra one
\newcommand{\bp}{\bra{+}} % bra plus
\newcommand{\bm}{\bra{-}} % bra minus
% Common bra _ cat _
\newcommand{\bczz}{\bracat{0}{0}} % bra zero, cat zero
\newcommand{\bczo}{\bracat{0}{1}} % bra zero, cat one
\newcommand{\bcoz}{\bracat{1}{0}} % bra one, cat zero
\newcommand{\bcoo}{\bracat{1}{1}} % bra one, cat one
\newcommand{\Ha}{\hat{H}} % Hadamar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment