I am using the \usepackage{physics}
package and want to write something using bra-ket notation but with a double bar in the middle (physicist's notation in Quantum Chemistry). It can be written as \braket{0||0}
using the \usepackage{braket} package, however it is much more useful for me to use the {physics} package for the majority of my work. I cannot use the {braket} package as the command \braket is already a command in the {physics} package, and I don't want to tamper previous pages I've written using the physics
package. So I guess I have 2 questions.
1) Can you write the equation in the picture using the physics
package?
2) Is it possible to import both packages but call on the \braket
command from different packages when I choose? For example, I may want to use the command from the physics
package for my first equation, but the braket
package for my second equation.
Best Answer
The
physics
package can do this usingmatrix element
commands\matrixel
, or\mel
for short. The codeWill produce the desired output. If desired, an additional second argument can be inserted. (It is empty in the example.)
There are two other forms of the
\mel
command:\mel*
andmel**
. The no-star version adjusts the delimiter heights based on the first and third arguments, but not the second. The one-star version does no resizing at all. The two-star version resizes delimiters based on all three arguments. For example, the codeproduces the output:
Note that there appears to be a spacing inconsistency between the no-star and one-star versions, compared to the two-star version. The difference appears to be exactly a
thinspace
. Consider the following code and its output:The spacing on the left and right is equalized by inserting a negative thin space (
\!
) before\mel
or\mel*
.