Math & Scienceoperator in quantum mechanics

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
mnemo
Posts: 1
Joined: Tue Apr 07, 2015 12:53 pm

operator in quantum mechanics

Post by mnemo »

Dear all,

I am writing several equations of quantum mechanics and I have managed to create commands for ket, bra, product and mean as follow:

Code: Select all

\newcommand{\mean}[1]{\lf\langle #1\ri\rangle}
\newcommand{\bra}[1]{\lf\langle #1|\ri.}
\newcommand{\ket}[1]{\lf. |#1\ri\rangle}
\newcommand{\product}[2]{\lf\langle #1 | #2 \ri\rangle}
and I want that the different operators adapt their size to the element #1 or #2. With my commands, the \langle and the \rangle are ok but I did not find any way to adapt automatically the size of the |
Do you have any idea how to do it.
I am sure that this problem has been already fixed by someone and I am sorry if my email is redundant with another one.

regards
mnemo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

operator in quantum mechanics

Post by Johannes_B »

Hi and welcome,

there is really no need to re-invent the wheel. Please have a look at package physics. It should do what you want.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

operator in quantum mechanics

Post by cgnieder »

Hi mnemo,

Do you know the braket package?

Regards
site moderator & package author
Post Reply