This is for producing templates {{bra}}, {{ket}}, and {{bra-ket}}. It can also produce quantum state vectors in bra–ket notation, using wikicode, ideally with {{math}}, as an alternative to LaTeX in <math> mode, but using this template ( {{braket}} ) is more clumsy than the simpler and more directly applicable {{bra}}, {{ket}}, and {{bra-ket}}.
Application
There are three parameters, use as many as needed in this order:
if 1 is set to bra or ket: enter the first symbol for the bra or ket,
if 1 is set to bra-ket: enter the symbol for the bra part of the inner product
Symbol 2:
if 1 is set to bra or ket: this parameter is not needed.
if 1 is set to bra-ket: enter the symbol for the ket part of the inner product
If 1 is set to bra-ket, the symbols are entered in the order they are read, left to right. The symbols can of course be bold, italic, underlined, any unicode symbol, etc.
Examples
Ket
A ket can be written: |ψ⟩, that is {{braket|ket|ψ}}.
Using {{math}}, a ket can be written: |ψ⟩, that is {{math|{{braket|ket|ψ}}}}.
Bra
A bra can be written: ⟨ψ| = |ψ⟩†, that is {{braket|bra|ψ}} = {{braket|ket|ψ}}<sup>†</sup>.
Using {{math}}, a bra can be written: ⟨ψ| = |ψ⟩†, that is {{math|{{braket|bra|ψ}} {{=}} {{braket|ket|ψ}}<sup>†</sup>}}.
Bra-ket
The inner product of the kets |ξ⟩ and |ψ⟩ can be written: ⟨ψ|ξ⟩ = ⟨ξ|ψ⟩†, that is {{braket|bra-ket|ψ|ξ}} = {{braket|bra-ket|ξ|ψ}}<sup>†</sup>.
Using {{math}}, the inner product of the kets |ξ⟩ and |ψ⟩ can be written: ⟨ψ|ξ⟩ = ⟨ξ|ψ⟩†, that is {{math|{{braket|bra-ket|ψ|ξ}} {{=}} {{braket|bra-ket|ξ|ψ}}<sup>†</sup>}}.
Outer products
The outer product of the kets |ξ⟩ and |ψ⟩ can be written: |ψ⟩⟨ξ| = [|ξ⟩⟨ψ|]†, that is {{braket|ket|ψ}}{{braket|bra|ξ}} = [{{braket|ket|ξ}}{{braket|bra|ψ}}]<sup>†</sup>.
Using {{math}}, the outer product of the kets |ξ⟩ and |ψ⟩ can be written: |ψ⟩⟨ξ| = [|ξ⟩⟨ψ|]†, that is {{braket|ket|ψ}}{{braket|bra|ξ}} {{=}} [{{braket|ket|ξ}}{{braket|bra|ψ}}]<sup>†</sup>.
The inner product of the kets |ξ⟩ and Ĥ|ψ⟩ is written using a bra and ket separately between the operator (there is no third parameter for the operator symbol):