Problem with usage messages and Dagger

24 views
Skip to first unread message

Thomas Bäckdahl

unread,
Apr 1, 2022, 5:03:21 AM4/1/22
to xa...@googlegroups.com
Hi!

There are some problems with usage messages failing. Part of it is due
to Dagger.
For instance in Mathematica 13.0 one can not even use
?Dagger
without getting
Dagger::unknown: Unknown StandardForm[Short[Shallow[HoldForm["conjugate
of symbol"], {10, 50}], 5]]
StandardForm[Short[Shallow[HoldForm[xAct`xTensor`Private`v], {10, 50}], 5]].
Throw::nocatch: Uncaught Throw[Null] returned to top level.

This particular problem seems to come from the definition
Dagger[x_Symbol] := Throw@Message[Dagger::unknown, "conjugate of
symbol", x];

One can get around the problem with the following lines
Unprotect[Dagger];
Dagger[x_Symbol] =.
Protect[Dagger];

I don't know why Dagger needed to throw an error when it acts on unknown
things. This is particularly problematic when Dagger appears in the
right hand side of a RuleDelayed or something. I don't know if the way
help messages are displayed has changed lately because I think ?Dagger
worked with older versions of Mathematica.

Regards
Thomas

Jose

unread,
Apr 1, 2022, 12:54:02 PM4/1/22
to xAct Tensor Computer Algebra
Hi Thomas,

Thanks for reporting this.

Yes, you are right that this definition should probably be removed. I think I added it initially to force having a definition for Dagger on every tensorial symbol. But it may become problematic, as you say.

Information changed in WL a few versions ago, to return an InformationData object containing useful computable information (in an association), instead of just printing definitions.

The problem you are seeing actually comes from an evaluation leak in the typesetting of LieD derivatives by xTensor, affecting this downvalue:

   Dagger[LieD[v_][expr_]] :> LieD[Dagger[v]][Dagger[expr]]

I'll fix this for the next version of xTensor.

Cheers,
Jose.

Thomas Bäckdahl

unread,
Apr 1, 2022, 2:14:14 PM4/1/22
to xa...@googlegroups.com
Hi Jose!

Thank you for tracking down these problems.

I think there are other evaluation leaks of this kind. Often when I have a complicated RuleDelayed, I get similar problems when this rule is displayed.
Is there any good way of stopping such evaluation leaks from happening?
Perhaps it is the tensor typesetting code that needs to catch all errors and just display things using InputForm if there are problems.

Regards
Thomas
--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xact/3d5e8336-a17a-472c-b465-e02bd416d4b8n%40googlegroups.com.

Jose

unread,
May 1, 2022, 7:09:37 PM5/1/22
to xAct Tensor Computer Algebra
Hi Thomas,

I'm afraid there is no simple way of avoid the various evaluation leaks in the typesetting code. It's a matter of reviewing all that code and catching/fixing the leaks one by one. This is an old part of xTensor that should be eventually overhauled.

As I just mentioned in another thread, one can always prevent typesetting by using InputForm, but of course we should not have to do that...

Cheers,
Jose.
Reply all
Reply to author
Forward
0 new messages