0
$\begingroup$

I have an expression that contains both matrices and scalars:

linear combination of n matrices

H0 and H[k] are (non-commuting) matrices, and all the us are scalars of the underlying field (complex).

How do I inform Mathematica of this fact?

In particular, I want to compute expressions that contain commuations of various of these A matrices. When I use . or ** as the operator for matrix multiplications, Mathematica is unable to simplify the results (because, naturally, it assumes that u do not commute either).

I have come across the NCalgebra package, though I am unsure how I would apply it to my problem, as I have an symbolic number n+1 of members in the algebra.

$\endgroup$
5
  • 1
    $\begingroup$ This is probably not enough information for a full answer. You should show an example of an expression that doesn't work as you would like, together with the desired result, as well as complete definitions. Otherwise, I'm afraid that all we can suggest is searching the site for "noncommutative" and "non-commutative". This has been discussed many times before. $\endgroup$ Commented Dec 28, 2020 at 15:30
  • $\begingroup$ As a matter of fact, I just found this other question, that this one is indeed a duplicate of. No answers there either I am afraid. $\endgroup$ Commented Dec 28, 2020 at 17:49
  • 2
    $\begingroup$ Please add an example! The main problem with the question you link was that there was no code in it. We cannot answer questions if we don't have code and specific examples to play with. $\endgroup$ Commented Dec 28, 2020 at 23:11
  • $\begingroup$ it would take some work, but you could perhaps try defining your own product symbol, which simplifies to . only in the cases you want it to—you could also maybe make it look the way you'd want via e.g. the notation package. (You could also maybe unprotect Dot and add some definitions to it that perform the simplifications you're looking for...) $\endgroup$ Commented Jan 4, 2021 at 4:46
  • $\begingroup$ Thanks for your help, I managed to solve my problem with one of the answers posted here. $\endgroup$ Commented Jan 4, 2021 at 12:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.