Bra - Maple Help

Physics[Bra] - create a Bra state vector of a discrete or continuous space of quantum states in Dirac's notation

Physics[Ket] - create a Ket state vector of a discrete or continuous space of quantum states in Dirac's notation

 Calling Sequence Ket(A, n1, n2, ...) Bra(A, n1, n2, ...)

Parameters

 A - label; identifies the basis of quantum states to which the Bra or Ket belongs (see Setup) n1, n2, ... - a sequence of "quantum numbers," or algebraic expressions representing them (the sequence could be empty)

Description

 • The Dirac Bra-Ket notation is the standard notation in quantum mechanics, although it can also be used to denote abstract vectors and linear functionals in general.
 • In quantum mechanics, a Ket state vector is used to represent the quantum state of a physical system. In this implementation, Kets are assumed to be non-degenerate, the correspondence between Kets and quantum states is one-to-one, and a set of Kets can always be said to form a basis of a (sub)space of quantum states.
 • The first argument in $\mathrm{Ket}\left(A,\mathrm{n1},\mathrm{n2}\dots \right)$ is a label identifying the basis to which the Ket belongs. Recall that a single space of quantum states can be represented by different bases, so the scalar product of Kets of these different bases is, generally speaking, not zero. To represent fermionic state vectors, use an anticommutative label; see Setup for more information.
 • The second and subsequent N arguments of the Ket function represent "quantum numbers," and identify one Ket from another inside the basis. In this sense, the concept of a quantum number is equivalent to the concept of components of a standard vector in a Euclidean N-dimensional space, if the different components are associated with the different values of the quantum number. However, note that in the case of quantum-state vectors, there can be many quantum numbers (the N-dimensional Euclidean analog of that would be a tensor, not a vector). Kets with many quantum numbers belong to the tensor product of spaces that can be represented with Kets of only one quantum number.
 • When the label, A, of a Ket has also been set as a quantum operator, the Ket is automatically an eigenvector of this operator with a quantum number as its eigenvalue. To specify which quantum number, use the operator indexed with the position of the quantum number; for example, ${A}_{2}·\mathrm{Ket}\left(A,n,m\right)$ will result in $m\mathrm{Ket}\left(A,n,m\right)$.
 • A Bra is also a vector in a space of quantum states and corresponds to a Ket vector in the sense that one is obtained from the other through Hermitian conjugation. Bras are elements of the dual of the space, associated with the corresponding Kets.
 • The set of Kets formed by attributing all possible values to its quantum numbers forms a basis for the corresponding space of quantum states. To construct projectors onto this basis, use the Projector command. To set the dimension, possibly different, of each of the quantum numbers of the Kets of a basis of quantum states, see Setup.
 • The space of states spanned by a basis of Kets can be either continuous or discrete. To make the label (first argument) of a Bra or Ket be associated with a continuous space of states, use the Setup command, as in $\mathrm{Setup}\left(\mathrm{continuousbasis}=A\right)$; otherwise, it is assumed that the Bra or Ket corresponds to a discrete space of states.
 • The Physics[.] is the computational representation for the scalar (also called inner) product between any two of a Bra, a Ket, or a quantum operator, the latter set to be so by the Setup command or returned by the Annihilation, Creation, or Projector commands.
 • For scalar products involving Bras and Kets of the same basis and with quantum numbers, the result is expressed in terms of KroneckerDeltas, when the state vectors belong to a discrete space of states, or in terms of Dirac functions when they belong to a continuous space of states. In this sense, Bras and Kets with quantum numbers are analogous to 3-D Euclidean "unit vectors."
 • When the scalar product cannot be resolved, the operation is returned unevaluated, expressed by using the Bracket command (note the 'c' between Bra and Ket). For details regarding when a scalar product is returned unevaluated, see Physics[.].
 • To represent the tensor product of Bras and Kets, use the Physics[*] operator, as in $|A>* (a quantum operator) or $|A>*|B>$ (a Ket of the tensor product of spaces).
 • Two important operations, representing the annihilation and creation of 'particles' in a given state, are performed by using the linear operators returned by the Annihilation and Creation commands. These operators diminish and augment by one, respectively, the "quantum numbers" over which they act; see the respective help pages and the examples below.
 • To set bracket rules involving Bra and Ket state vectors, use the Setup command; see the examples below.

Examples

Consider two Kets belonging to the same basis, labeled with the letter $\mathrm{\psi }$ (psi).

 > $\mathrm{with}\left(\mathrm{Physics}\right):$
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (1)
 > $\mathrm{K1}≔\mathrm{Ket}\left(\mathrm{\psi },n,m\right)$
 ${\mathrm{K1}}{≔}{\mathrm{Ket}}{}\left({\mathrm{ψ}}{,}{n}{,}{m}\right)$ (2)
 > $\mathrm{K2}≔\mathrm{Ket}\left(\mathrm{\psi },r,s\right)$
 ${\mathrm{K2}}{≔}{\mathrm{Ket}}{}\left({\mathrm{ψ}}{,}{r}{,}{s}\right)$ (3)

To construct the corresponding Bras, you can enter them directly, by using the Bra command (see BK1), or by taking the Hermitian conjugate, by using the Dagger command (see BK2).

 > $\mathrm{BK1}≔\mathrm{Bra}\left(\mathrm{\psi },n,m\right)$
 ${\mathrm{BK1}}{≔}{\mathrm{Bra}}{}\left({\mathrm{ψ}}{,}{n}{,}{m}\right)$ (4)
 > $\mathrm{BK2}≔\mathrm{Dagger}\left(\mathrm{K2}\right)$
 ${\mathrm{BK2}}{≔}{\mathrm{Bra}}{}\left({\mathrm{ψ}}{,}{r}{,}{s}\right)$ (5)

To perform the scalar product, use the Bracket command (note the 'c' between 'Bra' and 'ket') or the scalar product operator, Physics[.].

 > $\mathrm{BK1}·\mathrm{K2}$
 ${{\mathrm{\delta }}}_{{n}{,}{r}}{}{{\mathrm{\delta }}}_{{m}{,}{s}}$ (6)
 > $\mathrm{Bracket}\left(\mathrm{BK1},\mathrm{K2}\right)$
 ${{\mathrm{\delta }}}_{{n}{,}{r}}{}{{\mathrm{\delta }}}_{{m}{,}{s}}$ (7)

Note that the above is the product of two Kronecker deltas. This is so because these Kets are assumed to be part of a discrete basis. To indicate that they belong to a continuous space of states, use the Setup command.

 > $\mathrm{Setup}\left(\mathrm{continuousbasis}=\mathrm{\psi }\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{continuousbasis}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumcontinuousbasis}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumcontinuousbasis}}{=}\left\{{\mathrm{\psi }}\right\}\right]$ (8)
 > $\mathrm{Bracket}\left(\mathrm{BK1},\mathrm{K2}\right)$
 ${\mathrm{Dirac}}{}\left(\left[{-}{r}{+}{n}{,}{-}{s}{+}{m}\right]\right)$ (9)

In the above, you see a 2-dimensional Dirac function. To set the label psi in this example to represent a discrete basis, use the Setup command again, but first you need to clear the previous setting.

 > $\mathrm{Setup}\left(\mathrm{clear},\mathrm{continuousbasis}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{continuousbasis}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumcontinuousbasis}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumcontinuousbasis}}{=}{\mathrm{none}}\right]$ (10)
 > $\mathrm{Setup}\left(\mathrm{discretebasis}=\mathrm{\psi }\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{discretebasis}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumdiscretebasis}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumdiscretebasis}}{=}\left\{{\mathrm{\psi }}\right\}\right]$ (11)

For discrete bases, it is possible to define creation and annihilation operators acting on Kets belonging to this space of states (that is, to the basis labeled by the Ket's first argument). For these purposes, use the Annihilation and Creation operators (see the optional argument notation = explicit to make explicit the label and quantum numbers onto which the operator returned acts).

 > $\mathrm{am1}≔\mathrm{Annihilation}\left(\mathrm{\psi },1\right)$
 ${\mathrm{am1}}{≔}{{a}}^{{-}}$ (12)
 > $\mathrm{am2}≔\mathrm{Annihilation}\left(\mathrm{\psi },2,\mathrm{notation}=\mathrm{explicit}\right)$
 ${\mathrm{am2}}{≔}{{{a}}^{{-}}}_{{{\mathrm{\psi }}}_{{2}}}$ (13)

In the above, am1 and am2 represent the annihilation operators with respect to the first and second quantum numbers, respectively; their action over the Kets $\mathrm{K1}$ and $\mathrm{K2}$ is

 > $\mathrm{am1}\left(\mathrm{K1}\right)$
 $\sqrt{{n}}{}{\mathrm{Ket}}{}\left({\mathrm{ψ}}{,}{n}{-}{1}{,}{m}\right)$ (14)
 > $\mathrm{am2}\left(\mathrm{K2}\right)$
 $\sqrt{{s}}{}{\mathrm{Ket}}{}\left({\mathrm{ψ}}{,}{r}{,}{s}{-}{1}\right)$ (15)

Below are the corresponding creation operators.

 > $\mathrm{ap1}≔\mathrm{Creation}\left(\mathrm{\psi },1\right)$
 ${\mathrm{ap1}}{≔}{{a}}^{{+}}$ (16)
 > $\mathrm{ap2}≔\mathrm{Creation}\left(\mathrm{\psi },2\right)$
 ${\mathrm{ap2}}{≔}{{a}}^{{+}}$ (17)

Note that the application of these annihilation and creation operators can be performed as shown with the annihilation operators am1 and am2 above, or by using the Physics[.] scalar product operator.

 > $\mathrm{ap1}·\mathrm{K1}$
 $\sqrt{{n}{+}{1}}{}{\mathrm{Ket}}{}\left({\mathrm{ψ}}{,}{n}{+}{1}{,}{m}\right)$ (18)
 > $\mathrm{ap2}·\mathrm{K2}$
 $\sqrt{{s}{+}{1}}{}{\mathrm{Ket}}{}\left({\mathrm{ψ}}{,}{r}{,}{s}{+}{1}\right)$ (19)

As an example involving the creation of a bracket rule, let $|R,x,y,z>$ and $|P,\mathrm{px},\mathrm{py},\mathrm{pz}>$ represent "position" and "momentum" state vectors; their scalar product is unknown to the system.

 > $\mathrm{Bracket}\left(\mathrm{Bra}\left(R,x,y,z\right),\mathrm{Ket}\left(P,p\left[x\right],p\left[y\right],p\left[z\right]\right)\right)$
 ${\mathrm{Bracket}}{}\left({\mathrm{Bra}}{}\left({R}{,}{x}{,}{y}{,}{z}\right){,}{\mathrm{Ket}}{}\left({P}{,}{{p}}_{{x}}{,}{{p}}_{{y}}{,}{{p}}_{{z}}\right)\right)$ (20)

Let their scalar product be the corresponding normalized plane wave (see References below).

 > $=\frac{1}{{\left(2\mathrm{\pi }\right)}^{\frac{3}{2}}}\mathrm{exp}\left(I\left(xp\left[x\right]+yp\left[y\right]+zp\left[z\right]\right)\right)$
 ${\mathrm{Bracket}}{}\left({\mathrm{Bra}}{}\left({R}{,}{x}{,}{y}{,}{z}\right){,}{\mathrm{Ket}}{}\left({P}{,}{{p}}_{{x}}{,}{{p}}_{{y}}{,}{{p}}_{{z}}\right)\right){=}\frac{\sqrt{{2}}{}{{ⅇ}}^{{I}{}\left({x}{}{{p}}_{{x}}{+}{y}{}{{p}}_{{y}}{+}{z}{}{{p}}_{{z}}\right)}}{{4}{}{{\mathrm{\pi }}}^{{3}}{{2}}}}$ (21)

To set the above as a rule when computing Brackets between the vectors $R$ and $P$, use the Setup command.

 > $\mathrm{Setup}\left(\right)$
 $\left[{\mathrm{bracketrules}}{=}\left\{{\mathrm{%Bracket}}{}\left({\mathrm{%Bra}}{}\left({R}{,}{x}{,}{y}{,}{z}\right){,}{\mathrm{%Ket}}{}\left({P}{,}{{p}}_{{x}}{,}{{p}}_{{y}}{,}{{p}}_{{z}}\right)\right){=}\frac{{1}}{{4}}{}\frac{\sqrt{{2}}{}{\mathrm{exp}}{}\left({I}{}\left({x}{}{{p}}_{{x}}{+}{y}{}{{p}}_{{y}}{+}{z}{}{{p}}_{{z}}\right)\right)}{{{\mathrm{π}}}^{{3}{/}{2}}}\right\}\right]$ (22)

Now this rule is used automatically.

 > $\mathrm{%Bracket}\left(\mathrm{Bra}\left(R,a,b,c\right),\mathrm{Ket}\left(P,d,e,f\right)\right)$
 ${\mathrm{%Bracket}}{}\left({\mathrm{Bra}}{}\left({R}{,}{a}{,}{b}{,}{c}\right){,}{\mathrm{Ket}}{}\left({P}{,}{d}{,}{e}{,}{f}\right)\right)$ (23)
 > $\mathrm{value}\left(\right)$
 $\frac{\sqrt{{2}}{}{{ⅇ}}^{{I}{}\left({a}{}{d}{+}{b}{}{e}{+}{f}{}{c}\right)}}{{4}{}{{\mathrm{\pi }}}^{{3}}{{2}}}}$ (24)
 > $\mathrm{Setup}\left(\mathrm{continuousbasis}=\left\{P,R\right\}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{continuousbasis}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{quantumcontinuousbasis}{}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumcontinuousbasis}}{=}\left\{{P}{,}{R}\right\}\right]$ (25)
 > $\mathrm{Projector}\left(\mathrm{Ket}\left(P,p\left[1\right],p\left[2\right],p\left[3\right]\right)\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{*}}{}\left({\mathrm{Ket}}{}\left({P}{,}{{p}}_{{1}}{,}{{p}}_{{2}}{,}{{p}}_{{3}}\right){,}{\mathrm{Bra}}{}\left({P}{,}{{p}}_{{1}}{,}{{p}}_{{2}}{,}{{p}}_{{3}}\right)\right){,}{{p}}_{{1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{p}}_{{2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{p}}_{{3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right)$ (26)
 > $\mathrm{Bra}\left(R,x\left[1\right],x\left[2\right],x\left[3\right]\right)·$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left(\frac{{1}}{{4}}{}\frac{\sqrt{{2}}{}{\mathrm{exp}}{}\left({I}{}\left({{p}}_{{1}}{}{{x}}_{{1}}{+}{{p}}_{{2}}{}{{x}}_{{2}}{+}{{p}}_{{3}}{}{{x}}_{{3}}\right)\right){}{\mathrm{Bra}}{}\left({P}{,}{{p}}_{{1}}{,}{{p}}_{{2}}{,}{{p}}_{{3}}\right)}{{{\mathrm{π}}}^{{3}{/}{2}}}{,}{{p}}_{{1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{p}}_{{2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{p}}_{{3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right)$ (27)
 > $·\mathrm{Ket}\left(R,x\left[1\right],x\left[2\right],x\left[3\right]\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left(\frac{{1}}{{4}}{}\frac{\sqrt{{2}}{}{\mathrm{exp}}{}\left({-}{I}{}\left({{p}}_{{1}}{}{{x}}_{{1}}{+}{{p}}_{{2}}{}{{x}}_{{2}}{+}{{p}}_{{3}}{}{{x}}_{{3}}\right)\right){}{\mathrm{Ket}}{}\left({P}{,}{{p}}_{{1}}{,}{{p}}_{{2}}{,}{{p}}_{{3}}\right)}{{{\mathrm{π}}}^{{3}{/}{2}}}{,}{{p}}_{{1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{p}}_{{2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{p}}_{{3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right)$ (28)
 > 

The result above for $⟨P|R⟩$ was computed by using the rule stated for $⟨R|P⟩$, but you can also state the rule for $⟨P|R⟩$ in addition, by using the Setup command with the keyword additionally, or by stating the two rules at the same time.

References

 Cohen-Tannoudji, C.; Diu, B.; and Laloe, F. Quantum Mechanics. Chapter II. Paris, France: Hermann, 1977.