Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2689

Re: Defining Formatting and Notation

From David Bailey <dave@removedbailey.co.uk>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Defining Formatting and Notation
Date 2011-05-25 09:55 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <irijmf$qc9$1@smc.vnet.net> (permalink)
References <iraq0r$lm0$1@smc.vnet.net>

Show all headers | View raw


On 22/05/2011 11:54, Stefan Salanski wrote:
> Hello,
> I've been working on compiling what I've learned about quantum
> mechanics into a Mathematica notebook, and was wondering if anyone
> could help with creating definitions for certain symbols.
> An example of something which I have working is:
> Subscript[\[Psi], n_\[InvisibleComma]l_\[InvisibleComma]m_][
>    r_, \[Theta]_, \[Phi]_] :=
>   Sqrt[(2/(n a))^3 (n - l -
>          1)!/(2 n ((n + l)!)^3)] Exp[-r/(n a)] (2 r/(n a))^l LaguerreL[
>     n - l - 1, 2 l + 1, 2 r/(n a)]*(n + l)! SphericalHarmonicY[l,
>     m, \[Theta], \[Phi]]
> This looks just like one would write the hydrogen wavefunctions, and
> evaluates as desired as well.
>
> What I am having difficulty with, is defining the Bra and Ket
> notation, specifically defining the notation to be as when using them
> as linear operators (http://en.wikipedia.org/wiki/Bra-
> ket_notation#Linear_operators).
> I would like to define what looks like this (after evaluation) :
> "\!\(\*TemplateBox[{\"state1\"},\n\"Bra\"]\)observable\!\
> (\*TemplateBox[{\"state2\"},\n\"Ket\"]\)"
> to be some function of [state1,state2,observable], but I always run
> into the problem where it simply recognizes
> Bra[state1] observable Ket[state2]
> as observable*Bra[state1]*Ket[state2], the product of 3 individual and
> separate terms, which is definitely not what I'm looking for.
> I've looked through tutorial/Operators and tutorial/SpecialCharacters-
> MathematicalAndOtherNotation, to no avail. Any suggestions?
> -Stefan S
>
At 8.0.1, Bra[1] and Ket[1] do display in the normal quantum mechanical 
notation, without actually evaluating. This is, of course, exactly what 
you need, because you provide the definition as required.

However, although there is also a System` symbol called BraKet, I can't 
find a way to use it to expressions like:

<a|b> or <a|H|b>

David Bailey
http://www.dbaileyconsultancy.co.uk

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Defining Formatting and Notation Stefan Salanski <wutchamacallit27@gmail.com> - 2011-05-22 10:54 +0000
  Re: Defining Formatting and Notation David Bailey <dave@removedbailey.co.uk> - 2011-05-25 09:55 +0000
    Re: Defining Formatting and Notation Peter Breitfeld <phbrf@t-online.de> - 2011-05-25 23:34 +0000

csiph-web