Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commutators and Bra-Ket Notation in Quantum Mechanics #328

Open
NV-Codes opened this issue Dec 31, 2024 · 4 comments
Open

Commutators and Bra-Ket Notation in Quantum Mechanics #328

NV-Codes opened this issue Dec 31, 2024 · 4 comments

Comments

@NV-Codes
Copy link
Contributor

NV-Codes commented Dec 31, 2024

MathCAT Version

MathCAT-0.6.6 (NVDA Add-On)

Description of Issue

Commutators

MathCAT treats $[A, B]$ and other expressions of that form as intervals, but such expressions represent commutators in quantum mechanics. For instance, MathCAT reads $[A, B]$ as "the interval from cap A to cap B, including cap A and cap B." For nested commutators, however, it becomes particularly hard to parse. For the commutator of A with the commutator of B with C ($[A, [B, C]]$), MathCAT reads, "the interval from cap A to the interval from cap B to cap C, including cap B and cap C, including cap A and the interval from cap B to cap C, including cap B and cap C."

Bra-Ket Notation

For bra-ket notation, MathCAT reasonably verbalizes the ket of alpha ($| \alpha \rangle$) as "vertical line alpha right angle bracket" and the bra of alpha ($\langle \alpha |$) as "left angle bracket alpha vertical line." For expectation values, howeover, MathCAT verbalizes $\langle \alpha | \hat{P} | \alpha \rangle$ as "left angle bracket, alpha, the absolute value of cap P hat, end absolute value, alpha, right angle bracket." Likewise, the inner product of the bra of alpha and the ket of beta ($\langle \alpha | \beta \rangle$) is verbalized as "left angle bracket, alpha divides beta, right angle bracket." (In those expressions where the vertical bar is verbalized as "divides," the symbol is treated as a symbol of relation and is surrounded by spaces in Nemeth.) In some equations that relate expressions of kets, the inferred "absolute value" extends across the equals sign, from one vertical bar to the next, and this is particularly confusing to parse.

Potential Resolution

Perhaps it is best not to infer that bracketed expressions of the form $[A, B]$ are instances of interval notation. It is not clear, without intent markup by the author, how MathCAT would be able to correctly verbalize bra-ket notation.

In either case, it seems that literal verbalization (issue #135) would be a good feature to offer, since it would leave interpretation to the user (as is the case for visual and braille interpretation).

The MathCAT User Guide states, "Expressions are never unambiguous in SimpleSpeak." It would seem that ClearSpeak is thus recommended for mathematicians, physicists, etc., but the inferences made by ClearSpeak can make interpreting certain types of expressions harder than interpreting literal verbalization of symbols.

@NSoiffer
Copy link
Owner

NSoiffer commented Jan 1, 2025

The Bra-Ket notation is a challenge to recognize and verbalize well. I would like to improve MathCAT's handling.

For the nested notation, that doesn't make any sense for intervals, so I should change the rule to prevent that being spoken as an interval (see #329).

Vertical bars are heavily used in math and have many different meanings. MathCAT tries to clean up ways that MathML generate them so it can interpret them. It's tricky. For example, in $\lbrace x | x^2 > 4\rbrace$, $x^2 > 4$ needs to an operand of of the vertical bar ("such that") but in a ket-notation, it wants to match with the >.

I never reached the level of physics courses where we used the bra-ket notation, so I don't have a good grasp of what makes sense for operands. If I had a betters sense of what is legal, I could refine how MathCAT parses/cleans up the MathML so that it (for example) pairs | with > and doesn't pair the vertical bars in other cases. Similarly, it would help in knowing when to match < with >. If MathCAT could do specialized clean up of bra-ket notation, then I can write speech rules that will speak them correctly. For example, it would stop the | in $\langle \alpha | \beta \rangle$ from being spoken as "divides".

@NV-Codes: if you are familiar with this notation, please write down as much information as possible about what operands of the notation typically look like so I can try to make MathCAT recognize them. Looking at the wikipedia page for the notation, the operands are almost always letters or modified letters, but not always. The same is true with your examples. Unfortunately, the MathML for them is rarely grouped well, and grouping them is needed for MathCAT to generate appropriate speech.

"Expressions are never unambiguous in SimpleSpeak."

It is unambiguous, but not necessarily appropriate (as with the interval example you mention). Once I implement "LiteralSpeak", then the inappropriate interpretation would go away, but also all the good interpretations. That may or may not be a good tradeoff.

@NV-Codes
Copy link
Contributor Author

NV-Codes commented Jan 4, 2025

Both bras and kets can take various forms:

  • Simultaneous eigen-kets of two operators can take the form $|a, b\rangle$.

  • The translation operator acts as follows: $\mathcal J (d \mathbf x' ) | \mathbf x' \rangle = | \mathbf x' + d \mathbf x' \rangle$.

  • Expectation values can take the form $\langle \alpha | A | \alpha \rangle$ or $\langle j, m | \mathbf J^2 | j, m \rangle = \langle j, m | (J_x^2 + J_y^2 + J_z^2) | j, m \rangle$.

  • An important relation in wave mechanics is $\langle \mathbf x' | L_z | \alpha \rangle = -i \hbar \frac{\partial}{\partial \phi} \langle \mathbf x' | \alpha \rangle$.

  • An inner product is a bra times a ket: $\langle \alpha | \beta \rangle$.

  • An outer product is a ket times a bra: $| S_{x+} \rangle \langle S_{x+} |$.

Please let me know if this helps.

@NV-Codes
Copy link
Contributor Author

NV-Codes commented Jan 5, 2025

I had previously been deterred from trying SimpleSpeak because of my misunderstanding that it is "never unambiguous" (an odd literal interpretation), and I had also maximized MathCAT's verbosity as a precaution to avoid misunderstanding, but I now find that I appreciate certain features of SimpleSpeak (e.g., less verbose descriptions of fractions than ClearSpeak at all verbosity levels). I will continue to experiment with different speech styles and verbosities, but I think it might be helpful to

  • correct the aforementioned incorrect statement from MathCAT's user guide.
  • provide a table that compares different combinations of speech styles and verbosities.

In general, are all possible combinations comparably unambiguous? Could "Terse" or "Medium" verbosity make an expression more ambiguous than "Verbose"?

I appreciate the clarification!

@lnelson2382
Copy link

All physics texts that I have seen use the LaTeX angle bracket commands \langle and \rangle rather than the greater-than and less-than symbols < > for bra-ket notation, which in mathML are realized as the Unicode symbols ⟨ ⟩. That would probably make it much less ambiguous to determine where bra-ket notation is being used, especially as every other instance I can think of where the angle bracket symbols are used, they are always paired directly with one another

In addition to the examples @NV-Codes gave, I have also seen bra-ket notation with the following contents:

  • Numbers, such as $|3\rangle$
  • Simple equations identifying the name and value of some constant, such as $\langle j=2|$
  • Multiple variable names separated by commas and/or semicolons: $| j_1 j_2; j_3 j_4 \rangle$

As far as pronunciation goes, there are effectively three types of object in bra-ket notation: the "bra" $\langle a |$, the "ket" $| a \rangle$, and the bra-ket product $\langle a | b \rangle$. The first two can probably be handled similarly to other paired delimiters like the absolute value, with the word "ket" or "bra", followed by the contents, followed by "end ket" or "end bra" (or by a pause in terse mode). I'm not sure what the best way to vocalize an inner product $\langle a | b \rangle$ would be - mathematically, this is just the product of the bra $\langle a |$ and the ket $| b \rangle$, so maybe it could be read as "bra a, end bra, ket b, end ket"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants