3

I am trying to write this equation.

Enter image description here

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?

amanda
  • 65
  • 2
    Don't use eqnarray – it has bad spacing. For the brackets, you can see the answers to {https://tex.stackexchange.com/questions/229253/adding-braces-around-equations/229263#229263}. – Bernard Jul 25 '21 at 12:28

4 Answers4

9

How about this? enter image description here

\documentclass{article}
\begin{document}
\begin{equation}
  \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{equation}
\end{document}
citsahcots
  • 7,992
7

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}

\begin{equation}\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{equation}

\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.

enter image description here

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

enter image description here

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}

\begin{equation}\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{equation}

\end{document}

The output is the same, but you can do

\[
\AR{u}\quad
\AR{d}\quad
\AR{uu}\quad
\AR{uduudd}
\]

to get

enter image description here

egreg
  • 1,121,712
2

With Bmatrix* defined in mathtools:

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

\begin{document} \begin{equation}\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{equation} \end{document}

enter image description here

Sebastiano
  • 54,118
Zarko
  • 296,517
1

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}

enter image description here

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

Sebastiano
  • 54,118
  • 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.) – Peter Mortensen Jul 26 '21 at 09: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. – Sebastiano Jul 26 '21 at 11:01