Skip to content

Commit

Permalink
Added Bra and Ket Notation
Browse files Browse the repository at this point in the history
Co-authored-by: Ben <ben.is.located@gmail.com>
Co-authored-by: Michael Goff <mike@mathrules.us>
  • Loading branch information
3 people committed Aug 18, 2020
1 parent b41828a commit 1407379
Show file tree
Hide file tree
Showing 5 changed files with 1,248 additions and 1,059 deletions.
16 changes: 13 additions & 3 deletions sympy/parsing/latex/LaTeX.g4
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ R_BRACKET: ']';

BAR: '|';

R_BAR: '\\right|';
L_BAR: '\\left|';

L_ANGLE: '\\langle';
R_ANGLE: '\\rangle';
FUNC_LIM: '\\lim';
LIM_APPROACH_SYM:
'\\to'
Expand All @@ -69,8 +74,8 @@ LIM_APPROACH_SYM:
| '\\longrightarrow'
| '\\Longrightarrow';
FUNC_INT: '\\int';
FUNC_SUM: '\\sum';
FUNC_PROD: '\\prod';
FUNC_SUM: ('\\sum' | '\\Sigma');
FUNC_PROD: ('\\prod' | '\\Pi');

FUNC_EXP: '\\exp';
FUNC_LOG: '\\log';
Expand Down Expand Up @@ -224,7 +229,12 @@ abs_group: BAR expr BAR;
atom: (LETTER | SYMBOL) subexpr?
| NUMBER
| DIFFERENTIAL
| mathit;
| mathit
| bra
| ket;

bra: L_ANGLE expr (R_BAR | BAR);
ket: (L_BAR | BAR) expr R_ANGLE;

mathit: CMD_MATHIT L_BRACE mathit_text R_BRACE;
mathit_text: LETTER*;
Expand Down

0 comments on commit 1407379

Please sign in to comment.