Repository navigation
Show a matrix power A^^n as A^⟨n⟩ (#1005) - #2605
Open
gunterkoenigsmann wants to merge 3 commits into
Open
gunterkoenigsmann wants to merge 3 commits into
gunterkoenigsmann wants to merge 3 commits into
Conversation
In Maxima A^n of a matrix is the elementwise power and A^^n the matrix
power, but wxMaxima drew both as a plain exponent. The flag wxMathML.lisp
already sent (mat="true") only reached copy as text; drawing, LaTeX,
MathML and RTF dropped it, and ToXML() didn't write it, so a saved
.wxmx turned a matrix power into an ordinary one.
The exponent of a matrix power is now drawn between angle brackets, as
Maxima's own 2D display does, with a tooltip explaining the difference.
The linear (broken) form reads A^^n. LaTeX export writes
A^{\langle n\rangle} like Maxima's tex(); MathML and OMML keep the
brackets; Matlab export writes A^n, Matlab's matrix power. Also covered:
an indexed base (a[1]^^2, SubSupCell), which wxMathML.lisp didn't flag
for an mqapply base, and Cell::Copy(), which lost the flag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdqsMALeBYMSmTayVuE3eJ
…nary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdqsMALeBYMSmTayVuE3eJ
A fraction or a nested power in the exponent got small glyph brackets in its middle. Cell::DrawAngleBracketsAround() now draws brackets spanning the exponent's height as lines when it is taller than the glyphs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdqsMALeBYMSmTayVuE3eJ
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Gunter · project thread
Closes #1005.
Why
In Maxima,
A^nof a matrix is the elementwise power andA^^nis the matrix power. wxMaxima drew both as a plain exponent, soA^^-1(the inverse) andA^-1(the matrix of reciprocals) looked the same.wxMathML.lispalready sentmat="true", but only copy-as-text used it. Drawing, LaTeX, MathML and RTF all dropped it, andToXML()never wrote it back, so saving and reloading a .wxmx turned a matrix power into an ordinary one.What
A^<n>. Hovering over it shows a tooltip explaining the difference.A^^n.A^{\langle n\rangle}, which is what Maxima'stex()writes.A^n, since^already is Matlab's matrix power.mat="true"is now saved.Cell::Copy()keeps the flag too; it used to lose it.a[1]^^2(SubSupCell): gets the same treatment.wxxml-mexpt-arrayalso didn't flag themqapplycase.Tests
New
test_MatrixPowercovers:Copy()for both cell typesUnit tests pass locally (under xvfb). I also checked live in Xvfb with a real Maxima:
B^^n; B^2; B^^(n+1); B^^-1; a[1]^^2;render as B^⟨n⟩, B², B^⟨n+1⟩, B^⟨-1⟩ and a₁^⟨2⟩.The
ExptCellGeometry.svgdiagram notes the brackets. NEWS.md is updated, and I hand-added the one new msgid to the POT.🤖 Generated with Claude Code
https://claude.ai/code/session_01VdqsMALeBYMSmTayVuE3eJ