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?

1
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}
5
  • 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. Jul 25 at 18:55
  • @barbarabeeton, Yes. You are right.
    – citsahcots
    Jul 25 at 20:00
  • @modnar: The spacing around = is wider than usual.
    – Werner
    Jul 25 at 20:09
  • @Werner, Thanks for pointing it out. It's fixed.
    – citsahcots
    Jul 25 at 20:22
  • 1
    @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
    Jul 25 at 21:17
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

0
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

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.

2
  • 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.) Jul 26 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.
    – Sebastiano
    Jul 26 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.