1

Just starting out with Mathematica and trying to use the Dirac Equation. I'm working with the following form of the Dirac Equation:

$$ i \hbar \gamma^\mu \partial_\mu \psi - m c \psi = 0 $$

And my input is the following:

ToExpression["i \hbar \gamma^\mu \partial_\mu \psi - m c \psi = 0", TeX]

My expected output would be the Wolfram representation of the Dirac equation, but instead I'm getting a conditional. I'm guessing this is probably a novice mistake. The output Mathematica gives me is:

$$ \psi \neq 0 \ \&\& \ \mu == cm $$

Any idea what I'm doing wrong here? Thanks for your help.

Update Re: Duplicate

The suggested duplicate seems to answer most questions except for dealing with special symbols. It's understood that in the above, \hbar or $\hbar$ has to be imported. I am unaware of how to do this and appreciate if someone can help.

  • ToExpression["i \hbar \gamma^\mu \partial_\mu \psi - m c \psi = 0", \ TeXForm, Hold] but this doesnt import \hbar – k_v Mar 26 '15 at 05:05
  • Reading from the two previous comments, I gather that 1) I am not properly escaping my "" and 2) \hbar is not properly imported. Is \hbar not native to Wolfram and/or is there a link explaining how to "import" special symbols? Thanks! – crockpotveggies Mar 26 '15 at 05:08
  • 2
    Yes to both 1) and 2). And hbar is indeed not properly imported. As I say in the linked answer, the LaTeX import abilities are limited. It's usually best to write equations directly in Mathematica than to import them from LaTeX. It's sad but true. Maybe one can say something beyond this if you explain what you want to do with the imported formula. – Jens Mar 26 '15 at 05:13
  • @Jens got it, so in general sometimes I have to "guess" how to build the equation if something doesn't seem right through a little trial and error. Thanks for helping! I might try to post an answer to this for others having similar issues specifically with the Dirac Equation. – crockpotveggies Mar 26 '15 at 05:17
  • @Jens and sorry accidentally skipped over the second part of your comment. My goal is to start using Wolfram as a "worksheet" of the Dirac equation and start solving for different variables. So if wanted to something like a partial derivative, I could do so. – crockpotveggies Mar 26 '15 at 05:25
  • 1
    The ultimate problem is what I mentioned in my first comment: the goal of ToExpression is to create a Mathematica expression, and what you're getting is an expression that doesn't actually correspond to the Dirac equation mathematically, even if it visually looks like your LaTeX input. And that doesn't depend on $\hbar$ being there or not. It's the symbols $\mu$ in super and subscripts. Their meaning is lost. – Jens Mar 26 '15 at 05:25
  • Got it, so what you're saying is if I use Wolfram notation such as \[Gamma] Mathematica doesn't correspond to the Dirac equation mathematically? And I need to "fill in the blanks" and start creating matrices and functions. – crockpotveggies Mar 26 '15 at 05:29
  • I don't know what your goal is, but you can see what happens when you don't add the Hold attribute. The evaluation will give nonsense unless you're much more explicit in the LaTeX input. – Jens Mar 26 '15 at 05:43
  • Just in case someone stumbles on this from Google and is attempting to work with the Dirac equation, I found this notebook that had a lot of what I was looking for: http://www.feyncalc.org/FeynCalcBook/ – crockpotveggies Mar 27 '15 at 22:12

0 Answers0