Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCTrace tests failed #29

Open
eva5372 opened this issue Dec 5, 2024 · 4 comments
Open

NCTrace tests failed #29

eva5372 opened this issue Dec 5, 2024 · 4 comments

Comments

@eva5372
Copy link

eva5372 commented Dec 5, 2024

I have installed NCAlgebra through the Paclet distribution, meaning, in a Mathematica file I run:
PacletInstall["https://github.com/NCAlgebra/NC/blob/master/NCAlgebra-6.0.3.paclet?raw=true"];
Then I quit the kernel, restarted Mathematica and run
<< NCCORETEST `
This it what I get:

...

> 'NCTr'...
* 129 tests completed in 0. seconds.
* 116 succeeded.
* 13 failed.

...

> SUMMARY OF TESTS

* 23 files tested.
* 2302 tests completed in 5.20313 seconds.
* 2289 succeeded.
* 13 failed.


* Test #46 failed. Result:

    {a$28682, tp[b$28682], tp[a$28682], c$28682}

  differs from correct answer:

                     T         T
{a$28682, b$28682 , a$28682 , c$28682}


* Test #50 failed. Result:

    {a$28682, b$28682, tp[a$28682], tp[c$28682]}

  differs from correct answer:

                              T         T
{a$28682, b$28682, a$28682 , c$28682 }


* Test #54 failed. Result:

    {a$28682, b$28682, tp[a$28682], tp[c$28682]}

  differs from correct answer:

                              T         T
{a$28682, b$28682, a$28682 , c$28682 }


* Test #82 failed. Result:

    {a$28682 ** tp[b$28682]}

  differs from correct answer:

                       T
{a$28682 ** b$28682 }


* Test #85 failed. Result:

    {a$28682 ** tp[b$28682]}

  differs from correct answer:

                       T
{a$28682 ** b$28682 }


* Test #95 failed. Result:

    {a$28682 ** tp[c$28682] ** tp[b$28682]}

  differs from correct answer:

                       T           T
{a$28682 ** c$28682  ** b$28682 }


* Test #96 failed. Result:

    {a$28682 ** tp[b$28682] ** c$28682}

  differs from correct answer:

                       T
{a$28682 ** b$28682  ** c$28682}


* Test #97 failed. Result:

    {a$28682 ** b$28682 ** tp[c$28682]}

  differs from correct answer:

                                  T
{a$28682 ** b$28682 ** c$28682 }


* Test #98 failed. Result:

    {a$28682 ** tp[c$28682] ** b$28682}

  differs from correct answer:

                       T
{a$28682 ** c$28682  ** b$28682}


* Test #99 failed. Result:

    {a$28682 ** tp[b$28682] ** tp[c$28682]}

  differs from correct answer:

                       T           T
{a$28682 ** b$28682  ** c$28682 }


* Test #100 failed. Result:

    {a$28682 ** c$28682 ** tp[b$28682]}

  differs from correct answer:

                                  T
{a$28682 ** c$28682 ** b$28682 }


* Test #116 failed. Result:

    {a$28682 ** tp[c$28682] ** tp[d$28682] ** tp[b$28682]}

  differs from correct answer:

                       T           T           T
{a$28682 ** c$28682  ** d$28682  ** b$28682 }


* Test #117 failed. Result:

    {a$28682 ** tp[d$28682] ** b$28682 ** d$28682}

  differs from correct answer:

                       T
{a$28682 ** d$28682  ** b$28682 ** d$28682}

I have Mathematica version 14.1.0 in Windows 11
Have I done something wrong? And how can I fix it?

Regards,
Eva

Edit:
Additionally, running the demo file MostBasicCommands.nb, when running
tp[a**b]
gives me
b^Global`T ** a^Global`T
instead of
tp[b]**tp[a]

@mcdeoliveira
Copy link
Collaborator

Hi Eva, I do not seem to be able to reproduce your issue. The exponentiation with T as a convenience shorthand for transposition was introduced many versions ago and the only way in which it could be problematic is if you have another package that is currently overloading the properties of the letter T in any way. But even then, if that were to be the case, I would have expected that all tests with transposes would fail, and you seem to experience that only for the NCTr package.

There are two sides of the problem that you might want to debug separately. One is the display side. By default, when you type

tp[a]

you will see on the display

a^T

but if you issue FullForm it should still be tp. That is

tp[a]
FullForm[%]

should produce

a^T
tp[a]

This display behavior can be disabled by running

NCSetOutput[tp -> False]

after which

tp[a]

will display as

tp[a]

You should be able to go back to the old setting by letting

NCSetOutput[tp -> True]

Is that the case? If so, the display part is working fine.

As for the input side, you might want to check out the definitions for T before and after you load NCAlgebra. All you should see after loading NCAlgebra and typing

NCSetOutput[tp -> False]
??T

is

(NonCommutativeMultiplyPrivatea_? NonCommutativeQ)^T ^:= tp[NonCommutativeMultiplyPrivatea]

If you see anything else, it is coming from some other package.

Hope this helps you sorting out this issue. Keep me posted on what you find.

@eva5372
Copy link
Author

eva5372 commented Jan 7, 2025

Hi Mauricio,

Thank you so much for taking time to look into my issue. I have run the tests you suggested, and the problem seems to be that it doesn't detect T to have any definition. This is what I obtain:

In[1]:= << NCAlgebra`

During evaluation of In[1]:= NCAlgebra::SmallCapSymbolsNonCommutative: All lower cap single letter symbols (e.g. a,b,c,...) were set as noncommutative.

In[2]:= tp[a]

Out[2]= a

In[3]:= SetNonCommutative[a]

In[4]:= tp[a]

Out[4]= a^Global`T

In[5]:= FullForm[tp[a]]

Out[5]//FullForm= tp[a]

In[6]:= NCSetOutput[tp -> False]

In[7]:= tp[a]

Out[7]= tp[a]

In[8]:= ?? T

Out[8]= Missing["UnknownSymbol", "T"]

In[9]:= NCSetOutput[tp -> True]

In[10]:= tp[a]

Out[10]= a^Global`T

In[11]:= ?? T

Out[11]= Missing["UnknownSymbol", "T"]

I also checked if T has any definition before loading NCAlgebra and it doesn't. I also tried with \[Transpose] and also gives unknown symbol both before and after NCAlgebra is loaded.

Additionally, as you can see, even if when I load the package it says that all lower cap symbols are set to be noncommutative, unless I set them to be so individually, Mathematica treats them as commutative. I don't mind this, but maybe it is relevant.

I didn't load any other package in this session, so I don't think the issue should come from that.

Thank you so much again,
Best,
Eva

@mcdeoliveira
Copy link
Collaborator

Thanks Eva, that is still a mystery to me. I will try to run it on a different machine to see if I can replicate your behavior because I cannot replicated it on my current environments.

@eva5372
Copy link
Author

eva5372 commented Jan 21, 2025

Thank you for looking at it! I tried in my linux computer and I get the same issue... very weird!

Best,
Eva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants