# How can I write an equation with two curly brackets?

I am trying to write this equation.

I used these commands:

\begin{eqnarray}\label{eqn1}
|1, \:\: \:1\rangle &=& \uparrow \uparrow   \nonumber \\
|1, \:\:\: 0\rangle &=& \frac{1}{\sqrt{2}}\big(\uparrow \downarrow + \downarrow\uparrow \big) \\
|1, -1\rangle &=& \downarrow \downarrow   \nonumber \\ \nonumber
\end{eqnarray}

But how can I add the two curly brackets?

\documentclass{article}
\begin{document}
$$\label{eqn1} \setlength{\arraycolsep}{0pt} \left\{ \begin{array}{lcl} |1, \phantom{-}1\rangle &{}={}& \uparrow \uparrow \\ |1, \phantom{-}0\rangle &=& \frac{1}{\sqrt{2}}\big(\uparrow \downarrow + \downarrow\uparrow \big) \\ |1, -1\rangle &=& \downarrow \downarrow \end{array} \right\}$$
\end{document}
• If it's desired to have the rightmost digits within the |...\rangle aligned, that can be accomplished by using \phantom{$-$} rather than approximating the width by spaces. Commented Jul 25, 2021 at 18:55
• @barbarabeeton, Yes. You are right. Commented Jul 25, 2021 at 20:00
• @modnar: The spacing around = is wider than usual.
– Werner
Commented Jul 25, 2021 at 20:09
• @Werner, Thanks for pointing it out. It's fixed. Commented Jul 25, 2021 at 20:22
• @modnar: 1.5pt is not the correct width. You should rather \setlength{arraycolsep}{0pt} and then use {}={} as it will set the appropriate \mathrel space.
– Werner
Commented Jul 25, 2021 at 21:17

Never use eqnarray.

Your particular alignment can be obtained with alignedat; the argument 2 means that we want two pairs of right/left aligned columns. We leave empty the right aligned columns so to emulate two left aligned columns.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\foo}[2]{\mathopen|{#1}\ {#2}\rangle}
\newcommand{\uua}{{\uparrow}{\uparrow}}
\newcommand{\uda}{{\uparrow}{\downarrow}}
\newcommand{\dua}{{\downarrow}{\uparrow}}
\newcommand{\dda}{{\downarrow}{\downarrow}}

\begin{document}

\label{eqn1} \left\{ \begin{alignedat}{2} &\foo{1}{1} &&= \uua \\ &\foo{1}{0} &&= \frac{1}{\sqrt{2}}\bigl(\uda + \dua\bigr) \\ &\foo{1}{-1} &&= \dda \end{alignedat} \right\}

\end{document}

Choose a better name for \foo, based on the name of the symbol. All the braces I used in the definitions are important.

As an aside, avoid labeling like eqn1: use a string that describes the equation.

You may want \tfrac instead of \frac and the output would be

If you need combinations of the arrows (any number of them), you can use

\documentclass{article}
\usepackage{amsmath}

\newcommand{\foo}[2]{\mathopen|{#1}\ {#2}\rangle}

\ExplSyntaxOn

\NewDocumentCommand{\AR}{m}
{
\str_map_inline:nn { #1 }
{
\str_case:nn { ##1 } { {u}{{\uparrow}} {d}{{\downarrow}} }
}
}

\ExplSyntaxOff

\begin{document}

\label{eqn1} \left\{ \begin{alignedat}{2} &\foo{1}{1} &&= \AR{uu} \\ &\foo{1}{0} &&= \tfrac{1}{\sqrt{2}}\bigl(\AR{ud} + \AR{du}\bigr) \\ &\foo{1}{-1} &&= \AR{dd} \end{alignedat} \right\}

\end{document}

The output is the same, but you can do

$\AR{u}\quad \AR{d}\quad \AR{uu}\quad \AR{uduudd}$

to get

With Bmatrix* defined in mathtools:

\documentclass[border=3.14,varwidth]{standalone}
\usepackage{mathtools}

\begin{document}
$$\label{eqn1} \setlength\arraycolsep{1pt} \begin{Bmatrix*}[r] |1, & 1\rangle =& \uparrow\uparrow & \\ |1, & 0\rangle =& \frac{1}{\sqrt{2}}& \!\bigl(\uparrow \downarrow + \downarrow\uparrow \bigr) \\ |1, & -1\rangle =& \downarrow\downarrow & \end{Bmatrix*}$$
\end{document}

Another idea it is to use braket package with newcommand to predefinite symbols of Table 142 of the documentation The Comprehensive LATEX Symbol List and with a style that it is similar to the first image: you see the packages

\usepackage{newtxtext,newtxmath}

You will have:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{newtxtext,newtxmath}
\usepackage{graphicx}
\usepackage{braket}

\newcommand{\uupa}{\rotatebox[origin=c]{90}{$\rightleftarrows$}}
\newcommand{\dupa}{\rotatebox[origin=c]{90}{$\leftrightarrows$}}
\begin{document}
$\Set{\begin{array}{lcl} \Ket{1, 1} & = & \upuparrows\\ \Ket{1, 0} & = & \frac{1}{\sqrt{2}}(\uupa+\dupa) \\ \Ket{1, -1} & = & \downdownarrows \end{array}}$
\end{document}

Remember that the \Set command give a bit of spaces to left and the right the curly bracket.

• The name of the package really is "braket" (not "bracket"). Perhaps add an (authoritative) reference to it to make it more clear (by indirect means)? (But without "Edit:", "Update:", or similar - the answer should appear as if it was written right now.) Commented Jul 26, 2021 at 9:23
• @PeterMortensen Hi Peter, I see braket and not bracket :-(..(in fact there is not an edit). Sometimes when I use this package I write bracket; but when I compile I find the error :-). I don't know what to write also because my English is limited and I have to use the translator. You are allowed to edit my answer if you prefer. Don't worry. My best regards. Commented Jul 26, 2021 at 11:01