如何在 Maxima 中将某些变量定义为不可交换

发布于 2024-12-03 02:11:55 字数 272 浏览 7 评论 0原文

例如,我想将 x 和 y 定义为不可交换的,将 a 和 b 定义为可交换的(像往常一样)。换句话说,

x y ≠ y x,  a x = x a,  a b = b a .

进一步,

(x + ay) (x - ay) = x^2 + a (yx - xy) - a^2 y^2

定义 x 和 y 的代码以及乘法符号(例如 *. )是什么?

For example, I'd like to define x and y as non-commutative, and a and b as commutative (as usual). In other words,

x y ≠ y x,  a x = x a,  a b = b a .

Further,

(x + a y) (x - a y) = x^2 + a (y x - x y) - a^2 y^2 .

What is a code for defining x and y, and a symbol for multiplication (such as * and . ) ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆悲凉 2024-12-10 02:11:55

您可以按照您想要的方式使用 Maxima 的可交换 * 和非可交换 . 产品,只需执行以下两个步骤即可:

  1. 声明符号 ab 作为标量:

    declare([a, b], scalar)$

  2. 启用dotscrules

    dotscrules: true$

    这将涉及标量的非交换积简化为交换积(ax 变为 a*x)。

现在你准备好了。例如,

expand((a*x + b*y) . (a*x - b*y))

返回

a*b*y.x - b^2*y^^2 - a*b*x.y + a^2*x^^2

(请注意,^^ 是非交换指数运算符)。

You can work with Maxima's commutative * and non-commutative . products in the way that you want by following the next two steps:

  1. Declare the symbols a and b as scalars:

    declare([a, b], scalar)$

  2. Enable dotscrules:

    dotscrules: true$

    This simplifies non-commutative products involving scalars to commutative products (i.e., a.x becomes a*x).

Now you are ready. For example,

expand((a*x + b*y) . (a*x - b*y))

returns

a*b*y.x - b^2*y^^2 - a*b*x.y + a^2*x^^2

(note that ^^ is the non-commutative exponentiation operator).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文