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


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

Defining Formatting and Notation

From Stefan Salanski <wutchamacallit27@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Defining Formatting and Notation
Date 2011-05-22 10:54 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iraq0r$lm0$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | NextNext 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