ncalgebra / nc Goto Github PK
View Code? Open in Web Editor NEWNCAlgebra - Non Commutative Algebra Package for Mathematica
License: Other
NCAlgebra - Non Commutative Algebra Package for Mathematica
License: Other
Error as shown above occurs each time when <<NCAlgebra` is loaded in MMA. Although there has not been any issue detected during the operation of the basic commands listed in Chapter 4 of the user's manual, I am still worried about the potential hidden mistakes this loading error can lead to in future computations. So I was wondering if there is any way to fix it, and what type of computations are prone to mistakes led by this loading error.
The version of my NCAlgebra is 5.0.4 while that of my MMA is 12.3. My laptop runs on a Win10 system.
Thanks in advance.
I was hoping to use this package to do some computations in a noncommutative algebra over the complex numbers. This involves polynomials in noncommuting variables with symbolic scalar coefficients and some relations on the noncommuting variables; as far as I can tell the standard way to deal with this/simplify expressions is to use Groebner bases.
However, those methods don't seem to work if there are any commuting variables involved. Is this supported at all? Would it be simple to add, or does it break the algorithm used in some fundamental way? I don't know much about Groebner bases so I'm not sure.
Hello, I followed the instruction for web based installation within the Mathematica environment, but got an error
Untitled-4.pdf
.
While I attempt to get Series[ Exp[a x], {x,0,n} ]
where a
is some non commuting entity I noticed that Times
starts appearing instead of NonCommutativeMultiply
. This behaviour arise
when I set n to greater or equal to 3.
When I exdcute the following code you may notice some issues with the output:
As you can see at the screenshot I underlined the issue. Red underbrackets must contain **
but for some reason it is converted to Times
:
At the same time res
works as intended. And expected behaviour of the res2
is to coincide with res
.
UPD: there is even simplier way to reproduce this behaviour:
Environment:
WM 11.1
Windows 10
version of the NCAlgebra
is the latest at the moment: ffa5363
Link for the source code on my Google Drive: https://drive.google.com/file/d/1ZlI2XVTpFFSnqoT18D8fAvTp5c6LFF8N/view?usp=sharing
I am unable to install the NC algebra package. Our IT department said that this is because the security protocol for this server is out of date (should be TLS 1.2 instead of 1.0).
The table 5.1 of the famous book "The mathematical theory of symmetry in solids" by C. J. Bradley & A. P.
Cracknell (called the BC book hereafter), defined the relations, classes, character tables, and matrix representatives for the abstract groups needed in the tabulation of the representations of the 230 space groups. Here you can find a PDF version of the book's most recent 2010 revised edition.
But unfortunately, the book does not provide the multiplication table corresponding to these abstract groups. So, I want to construct the abstract group multiplication table using the group elements symbolically with the help of Wolfram language. For your information, I listed the abstract group information of G^3_8
given in the above book as an example:
And I also represented the corresponding result given by the SpaceGroupIrep package, which can be seen as a Mathematica based database and group theory toolkit built on the above-mentioned book:
I want to know if the NC
package can help me solve this problem. Any hints will be highly appreciated. See here for the related discussion.
Regards,
HZ
My testing is as follows:
In[1]:= (*
The following method doesn't rely on NCAlgebra package.
Unable to Simplify non-commutative Expression Further in Mathematica.
https://community.wolfram.com/groups/-/m/t/3076922*)
ClearAll["Global`*"]
Unprotect[NonCommutativeMultiply];
a_ ** (b_?NumberQ c_) := b*(a ** c)
(b_?NumberQ c_) ** a_ := b*(c ** a)
a_ ** (b_ + c_) := a ** b + a ** c
(b_ + c_) ** a_ := b ** a + c ** a
comm[x_, y_] := x ** y - y ** x
anticomm[x_, y_] := x ** y + y ** x
A ** anticomm[C, B] ** D - A ** C ** anticomm[D, B] +
anticomm[C, A] ** D ** B - C ** anticomm[D, A] ** B // Simplify
% == comm[A ** B, C ** D] // FullSimplify
Out[9]= A ** B ** C ** D - C ** D ** A ** B
Out[10]= True
<< NC`
<< NCAlgebra`
NC::Directory: You are using a paclet version of NCAlgebra.
NCAlgebra::SmallCapSymbolsNonCommutative: All lower cap single letter symbols (e.g. a,b,c,...) were set as noncommutative.
In[15]:= (*
The following method doesn't rely on NCAlgebra package.
Unable to Simplify non-commutative Expression Further in Mathematica.
https://community.wolfram.com/groups/-/m/t/3076922*)
ClearAll["Global`*"]
Unprotect[NonCommutativeMultiply];
a_ ** (b_?NumberQ c_) := b*(a ** c)
(b_?NumberQ c_) ** a_ := b*(c ** a)
a_ ** (b_ + c_) := a ** b + a ** c
(b_ + c_) ** a_ := b ** a + c ** a
comm[x_, y_] := x ** y - y ** x
anticomm[x_, y_] := x ** y + y ** x
A ** anticomm[C, B] ** D - A ** C ** anticomm[D, B] +
anticomm[C, A] ** D ** B - C ** anticomm[D, A] ** B // Simplify
% == comm[A ** B, C ** D] // FullSimplify
During evaluation of In[15]:= ClearAll::wrsym: Symbol T is Protected.
Out[23]= 0
Out[24]= True
As you can see, now the result is 0. Any tips for fixing this problem will be appreciated.
See here for the related discussion.
Regards,
Zhao
The functions do not seem to exist despite being listed in the documentation, or at least are not recognized by the Mathematica engine (13.2) as defined functions after installing the most recent version of the Paclet (6.0.0). Happens both on browser and cloud versions.
Steps to reproduce: Open the "Most Basic Commands" living documentation notebook, and scroll down to the section pertaining to the NCCoefficientRules
and NCCoefficientList
examples. Run the cells defining the necessary variables, and then the relevant example function calls. The functions do not execute and the actual output does not match the expected output as presented by the documentation.
I have found out that the NCTeX and NCTeXForm do not work at all for me. I have followed the relevant instructions step by step in Chapter 8 "Pretty Output with Notebooks and", especially those in 8.2 Using NCTeX and 8.3 Using NCTeXForm, but nothing has done the trick.
As shown in the screen shot, NCTeXForm will return the very same instruction untouched and the NCTeX will pop up a DOS interface and keep it ever since. If the DOS interface is closed manually, the NCTeX will give $Failed.
The version of NCAlgebra I have installed is 5.0.4, and my Mathematica version is 12.3, my laptop runs on a Windows 10 system. I have been an active latex user for decades. The built-in TeXForm and "Copy as Latex" of MMA work normally as well as other add-ins or apps using Latex. As for NCAlgebra, the basic commands work well up to now as long as << NCAlgebra is loaded after << NC
.
Is there any way to make the NCTeX and NCTeXForm work for me? Thanks in advance!
In Mathematica 11.0.1.0, PacletInstall["https://github.com/NCAlgebra/NC/blob/master/NCAlgebra-6.0.2.paclet?raw=true"];
returns PacletInstall::notavail: No paclet named https://github.com/NCAlgebra/NC/blob/master/NCAlgebra-6.0.2.paclet?raw=true is available for download from any currently enabled paclet sites.
I created one of the abstract group of order 192 used in this book with gap based on the set of defining relations (generating relations) as indicated by the first red box in the following screenshot:
Taking all the elements listed in the C5
conjugate class as indicated by the second red box on the above screenshot as an example, the following gap code snippet is used to check and confirm them:
# BC book, Page 279, G192_1
f:= FreeGroup("P","Q","R","S");
AssignGeneratorVariables(f);
g:= f/[ P^12, Q^4, R^4 , S^8, Q^2* R^2, S^6* P^6*Q^2*R, P^11*Q^3* P^7*Q^2*R, P^9* Q^3* P^3*Q, P^11*R^3 * P^10*Q*R, Q^3*R^3*P^6*Q^3*R, P^11*S^7* P^2*R*S, Q^3*S^7* P^3*Q^3*R*S, R^3*S^7*R*S ];
AssignGeneratorVariables(g);
# https://mail.google.com/mail/u/0/?ogbl#inbox/QgrcJHrhsvKxGMzNftjDBfhJzHDMpmXHRNL
# Call `IsFinite(g)` and then `conjugacyClasses` qill work.
IsFinite(g);;
cc:=ConjugacyClasses(g);;
C5:= [P^6*R, Q^3, P^9*Q^3*R, Q^2*R, P^6*Q, P^3*Q*R];
for rep in C5 do
pos_rep:=PositionProperty(cc,x->rep in x);
Print("Class: ",pos_rep,", Element: ",rep,", All elements: ", List(cc[pos_rep]),"\n");
od;
The results are as follows:
gap> f:= FreeGroup("P","Q","R","S");
<free group on the generators [ P, Q, R, S ]>
gap> AssignGeneratorVariables(f);
#I Global variable `P' is already defined and will be overwritten
#I Global variable `Q' is already defined and will be overwritten
#I Global variable `R' is already defined and will be overwritten
#I Global variable `S' is already defined and will be overwritten
#I Assigned the global variables [ P, Q, R, S ]
gap> g:= f/[ P^12, Q^4, R^4 , S^8, Q^2* R^2, S^6* P^6*Q^2*R, P^11*Q^3* P^7*Q^2*R, P^9* Q^3* P^3*Q, P^11*R^3 * P^10*Q*R, Q^3*R^3*P^6*Q^3*R, P^11*S^7* P^2*R*S, Q^3*S^7* P^3*Q^3*R*S, R^3*S^7*R*S ];
<fp group on the generators [ P, Q, R, S ]>
gap> AssignGeneratorVariables(g);
#I Global variable `P' is already defined and will be overwritten
#I Global variable `Q' is already defined and will be overwritten
#I Global variable `R' is already defined and will be overwritten
#I Global variable `S' is already defined and will be overwritten
#I Assigned the global variables [ P, Q, R, S ]
gap> IsFinite(g);;
gap> cc:=ConjugacyClasses(g);;
gap> C5:= [P^6*R, Q^3, P^9*Q^3*R, Q^2*R, P^6*Q, P^3*Q*R];
[ P^6*R, Q^3, P^9*Q^3*R, Q^2*R, P^6*Q, P^3*Q*R ]
gap> for rep in C5 do
> pos_rep:=PositionProperty(cc,x->rep in x);
> Print("Class: ",pos_rep,", Element: ",rep,", All elements: ", List(cc[pos_rep]),"\n");
> od;
Class: 24, Element: P^6*R, All elements: [ P^6*Q, P^5*Q*P, R^-1*P^6*Q*R, S^-1*P^6*Q*S, P^4*Q*P^2, Q^-1*P^4*(P*Q)^2 ]
Class: 24, Element: Q^3, All elements: [ P^6*Q, P^5*Q*P, R^-1*P^6*Q*R, S^-1*P^6*Q*S, P^4*Q*P^2, Q^-1*P^4*(P*Q)^2 ]
Class: 24, Element: P^9*Q^3*R, All elements: [ P^6*Q, P^5*Q*P, R^-1*P^6*Q*R, S^-1*P^6*Q*S, P^4*Q*P^2, Q^-1*P^4*(P*Q)^2 ]
Class: 24, Element: Q^2*R, All elements: [ P^6*Q, P^5*Q*P, R^-1*P^6*Q*R, S^-1*P^6*Q*S, P^4*Q*P^2, Q^-1*P^4*(P*Q)^2 ]
Class: 24, Element: P^6*Q, All elements: [ P^6*Q, P^5*Q*P, R^-1*P^6*Q*R, S^-1*P^6*Q*S, P^4*Q*P^2, Q^-1*P^4*(P*Q)^2 ]
Class: 24, Element: P^3*Q*R, All elements: [ P^6*Q, P^5*Q*P, R^-1*P^6*Q*R, S^-1*P^6*Q*S, P^4*Q*P^2, Q^-1*P^4*(P*Q)^2 ]
gap>
As you can see, they are encoded with different formulae, so, how to check and confirm the correspondence between them with the help of NCAlgebra
?
For related discussions, see here.
Regards,
HZ
Perhaps I am misunderstanding, but shouldn't the inverse of the inverse of a full rank matrix be the matrix?
Or perhaps I am asking the wrong question: Does NCInverse
compute a matrix inverse?
Currently if I execute this
SetNonCommutative[A11, A12, A22]
NCInverse[NCInverse[{{A11, A12}, {tp[A12], A22}}]]
I get
{{"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^T **
Superscript["A11",-1]] **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
"inv"[-Superscript["A11",-1] ** A12 **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] +
Superscript[
"A11",-1] ** (1 +
A12 ** "inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
A12^T ** Superscript["A11",-1]) **
"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^
T ** Superscript["A11",-1]] **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12]], -"inv"[
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^T **
Superscript["A11",-1]] ** (1 -
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
"inv"[-Superscript["A11",-1] ** A12 **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] +
Superscript[
"A11",-1] ** (1 +
A12 ** "inv"[
A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^T **
Superscript["A11",-1]) **
"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
A12^T ** Superscript["A11",-1]] **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12]] **
Superscript[
"A11",-1] ** (1 +
A12 ** "inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
A12^T ** Superscript["A11",-1]) **
"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
A12^T ** Superscript["A11",-1]])}, {"inv"[-Superscript[
"A11",-1] ** A12 **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] +
Superscript[
"A11",-1] ** (1 +
A12 ** "inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
A12^T ** Superscript["A11",-1]) **
"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^
T ** Superscript["A11",-1]] **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12]],
"inv"[-Superscript["A11",-1] ** A12 **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] +
Superscript[
"A11",-1] ** (1 +
A12 ** "inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] **
A12^T ** Superscript["A11",-1]) **
"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^
T ** Superscript["A11",-1]] **
"inv"[A22 - A12^T ** Superscript["A11",-1] ** A12]] **
Superscript[
"A11",-1] ** (1 +
A12 ** "inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^
T ** Superscript["A11",-1]) **
"inv"["inv"[A22 - A12^T ** Superscript["A11",-1] ** A12] ** A12^T **
Superscript["A11",-1]]}}
For a more legible screenshot:
However, I expect NCInverse[NCInverse[{{A11, A12}, {tp[A12], A22}}]]={{A11, A12}, {tp[A12], A22}}
. Am I being a dunce?
This was tested with NCAlgebra 6.0.0 installed by paclet, but I saw the same with 5.0.6 installed by git checkout.
I was recommended to come here from this stack exhange question.
I tried installing the package using the command:
Import["https://raw.githubusercontent.com/NCAlgebra/NC/master/NCExtras/\
NCWebInstall.m"];
Unfortunately I hit an error message saying, "$CharacterEncoding::sjis: The byte sequence {132,61} could not be interpreted as a character in the ShiftJIS character encoding."
Here is the full stack trace if it's helpful:
{\!\(\*
TagBox[
RowBox[{"Message", "[",
RowBox[{
StyleBox[
RowBox[{"$CharacterEncoding", "::", "sjis"}], "MessageName"], ",",
TagBox[
RowBox[{"{",
RowBox[{"132", ",", "61"}], "}"}],
HoldForm], ",",
TagBox["\<\"ShiftJIS\"\>",
HoldForm]}], "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"MatrixDecompositions.usage\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{
RowBox[{"<<", "\<\"MatrixDecompositions.usage\"\>"}], ";"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"MatrixDecompositions`\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"Needs", "[", "\<\"MatrixDecompositions`\"\>", "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCPoly`\"\>", ",", "\<\"MatrixDecompositions`\"\>"}],
"]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCPoly`\"\>", ",", "\<\"MatrixDecompositions`\"\>"}],
"]"}], ";"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"NCPoly`\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"Needs", "[", "\<\"NCPoly`\"\>", "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCPolyInterface`\"\>", ",", "\<\"NCPoly`\"\>",
",", "\<\"NCReplace`\"\>", ",", "\<\"NCUtil`\"\>",
",", "\<\"NonCommutativeMultiply`\"\>"}], "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCPolyInterface`\"\>", ",", "\<\"NCPoly`\"\>",
",", "\<\"NCReplace`\"\>", ",", "\<\"NCUtil`\"\>",
",", "\<\"NonCommutativeMultiply`\"\>"}], "]"}], ";"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"NCPolyInterface`\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"Needs", "[", "\<\"NCPolyInterface`\"\>", "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCPolynomial`\"\>", ",", "\<\"NCDot`\"\>",
",", "\<\"NCUtil`\"\>", ",", "\<\"NCPolyInterface`\"\>",
",", "\<\"NonCommutativeMultiply`\"\>"}], "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCPolynomial`\"\>", ",", "\<\"NCDot`\"\>",
",", "\<\"NCUtil`\"\>", ",", "\<\"NCPolyInterface`\"\>",
",", "\<\"NonCommutativeMultiply`\"\>"}], "]"}], ";"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"NCPolynomial`\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"Needs", "[", "\<\"NCPolynomial`\"\>", "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCCollect`\"\>", ",", "\<\"NCReplace`\"\>",
",", "\<\"NCPolynomial`\"\>", ",", "\<\"NCUtil`\"\>",
",", "\<\"NonCommutativeMultiply`\"\>"}], "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{
RowBox[{"BeginPackage", "[",
RowBox[{"\<\"NCCollect`\"\>", ",", "\<\"NCReplace`\"\>",
",", "\<\"NCPolynomial`\"\>", ",", "\<\"NCUtil`\"\>",
",", "\<\"NonCommutativeMultiply`\"\>"}], "]"}], ";"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"NCCollect`\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", "\<\"NCAlgebra`\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"Needs", "[", "\<\"NCAlgebra`\"\>", "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"Quiet", "[",
RowBox[{
RowBox[{"Needs", "[", "\<\"NCAlgebra`\"\>", "]"}], ",",
StyleBox[
RowBox[{"Needs", "::", "nocont"}], "MessageName"]}], "]"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"<<", \
"\<\"C:\\\\Users\\\\Steven\\\\AppData\\\\Local\\\\Temp\\\\m-0b5ce776-\
cc6b-408f-bf3f-5f0c895b128b\\\\NCWebInstall.m\"\>"}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{"\<\"Get\"\>", "->",
RowBox[{"<<", \
"\<\"C:\\\\Users\\\\Steven\\\\AppData\\\\Local\\\\Temp\\\\m-0b5ce776-\
cc6b-408f-bf3f-5f0c895b128b\\\\NCWebInstall.m\"\>"}]}],
HoldForm]\), \!\(\*
TagBox[
RowBox[{
RowBox[{"Import",
"[", "\<\"https://raw.githubusercontent.com/NCAlgebra/NC/master/\
NCExtras/NCWebInstall.m\"\>", "]"}], ";"}],
HoldForm]\)}
When loading the package using
<< NC << NCAlgebra
several error messages are thrown and Mathematica seems tot take forever to finish the job.
The messages I get (before it turns off showing messages) are the following:
Message[$IterationLimit::itlim,4096]
<<NCSimplifyRational <<NCAlgebra
$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of CommutativeQ[Pattern].
When importing NC`
using Needs
the package throws the following message:
Needs::nocont: Context NC` was not created when Needs was evaluated.
The package is still loaded and works, but the message is quite annoying. Is it avoidable?
On 5.6 in Mathematica 11.0.1.0, Windows 11 I am trying to do
testrule = u[1,2]**iu[2,1]->1-u[1,1]**iu[1,1]
but the result is
iu[2, 1] u[1, 2] -> 1 - iu[1, 1] u[1, 1]
That is, u
and iu
get swapped for some reason.
In the introductory notebook 1_MostBasicCommands.nb, in the section "Matrices," there appears the product NCDot[m1, m2], with the output
{{a**d+b**e,2 a+3 b},{c**d+d**e,2 c+3 d}}
However, with a freshly booted kernel in MMA 11.1.1.0, I get the output
{{a,b},{c,d}}**{{d,2},{e,3}}
I can get the documented output by writing
NCDot[m1, m2] // NCMatrixExpand
I installed the NCAlgebra package using the NCWebInstall in directory /Users/ben/Library/Mathematica/Applications
. Everything went well and the package is in the directory, but none of the commands work - << NC
, << NCAlgebra
, NCTest
, etc. all result in , e.g., `Get::noopen: Cannot open NCTEST.'
I tried reinstalling and the web installer informed me "There seems to be an installation of NCAlgebra 5.0.4 ...", so the package exists. I also checked the Mathematica $Path
and confirmed that /Users/ben/Library/Mathematica/Applications
is indeed part of the path.
In the document The fix is NCReplace
, the following example is shown:
On the same vein, the following substitution rule
NCReplace[2 a**b + c, 2 a -> b]
will return 2 ab + c intact since FullForm[2 ab] is indeed
Times[2, NonCommutativeMuliply[a, b]]
which is not structurally related to FullForm[2 a], which is Times[2, a]. Of course, in this case a simple solution is to use the alternative rule:
NCReplace[2 a**b + c, a -> b / 2]
which results in b**b + c, as one might expect.
But according to my test, the above two methods give the exactly same results:
In[34]:= << NC`
<< NCAlgebra`
During evaluation of In[34]:= NC::Directory: You are using the version of NCAlgebra which is found in: "/home/werner/.Mathematica/Applications/NC/".
During evaluation of In[34]:= NCAlgebra::SmallCapSymbolsNonCommutative: All lower cap single letter symbols (e.g. a,b,c,...) were set as noncommutative.
In[44]:= NCReplace[2 a ** b + c, 2 a -> b]
NCReplace[2 a ** b + c, a -> b/2]
Out[44]= c + 2 a ** b
Out[45]= c + 2 a ** b
The results represented in the document are consistent with the behavior of NCReplaceAll
:
In[46]:= NCReplaceAll[2 a ** b + c, 2 a -> b]
NCReplaceAll[2 a ** b + c, a -> b/2]
Out[46]= c + 2 a ** b
Out[47]= c + b ** b
Regards,
HZ
As shown in the pitcure.
The NCAlgebra version is development branch, commit 1fd0174.
The Mathematica version is 11.0.
NCAlgebra
version 6.0.2
fails to compute the gradient of the trace of a quadratic product. Works, fine in version 5.0.6final
.
Am I missing something?
Mathematica 13.3.1 Kernel for Linux x86 (64-bit)
Copyright 1988-2023 Wolfram Research, Inc.
PacletInstall["https://github.com/NCAlgebra/NC/blob/master/NCAlgebra-6.0.2.paclet?raw=true"];
<< NC`
<< NCAlgebra`
<< NCDiff`
NCGrad[tr[x**tp[x]], x]
NCPolynomial::NotPolynomial: Expression is not an nc polynomial.
NCGrad::Failed: Do not know how to calculate NCGrad. Expression tr[x ** tp[x]] is most likely not rational or invalid.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.