Two troubles

29 views
Skip to first unread message

Koushik Ray

unread,
Mar 22, 2024, 2:23:59 AMMar 22
to Macaulay2
Hi all,
I have 2 naive queries.
1) How to invert a matrix in Macaulay2?
inverse(m) with a given non-singular m does not seem to work.
A simple code like:

m = matrix{{1,2},{3,4}}
inverse m

says "matrix not invertible"

2) The other trouble is with finding triangulations. I tried this from the Macaulay2 page:

loadPackage"Polyhedra";
A = matrix {{0, 1, 2, 3, 4, 5, 6}, {0, 1, 4, 9, 16, 25, 36}, {0, 1, 8, 27, 64, 125, 216}}
tri = topcomRegularFineTriangulation A
topcomRegularTriangulationWeights(A, tri)

The output is this:

Macaulay2, version 1.19.1
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, LLLBases, MinimalPrimes, PrimaryDecomposition, ReesAlgebra, Saturation, TangentCone
stdio:5:7:(3): error: no method for adjacent objects:
--            topcomRegularFineTriangulation (of class Symbol)
--    SPACE   | 0 1 2 3  4  5   6   | (of class Matrix)
--            | 0 1 4 9  16 25  36  |
--            | 0 1 8 27 64 125 216 |
stdio:6:1:(3): error: no method for adjacent objects:
--            topcomRegularTriangulationWeights (of class Symbol)
--    SPACE   (| 0 1 2 3  4  5   6   |, tri) (of class Sequence)
--             | 0 1 4 9  16 25  36  |
--             | 0 1 8 27 64 125 216 |


Is there a problem with the installation or I am missing something?
Thank you for you help.

Best Regards -Koushik Ray


Torrance, Douglas

unread,
Mar 22, 2024, 6:59:07 AMMar 22
to maca...@googlegroups.com
1. Your matrix isn't invertible over the integers. You probably want a matrix over the rationals:

matrix(QQ, {{1, 2}, {3, 4}})

2. Those functions are exported by the "Topcom" package, so you'll need to call:

needsPackage "Topcom"

Koushik Ray

unread,
Mar 22, 2024, 9:20:15 AMMar 22
to Macaulay2
Hi Douglas,
Thank you for the reply.
The first solution worked.

But the triangulation does not work even with Topcom. It issues the same error message.
Earlier I used Polyhedra, since on the Topcom page it says not to call it directly, but to use e.g. Polyhedra which calls it.
By the way, the Topcom package is indeed there in macaulay2's path.
I also tried the web version of Macaulay2 and the code does not work.

Thank you again.
Best regards -Koushik

Torrance, Douglas

unread,
Mar 22, 2024, 10:11:25 AMMar 22
to maca...@googlegroups.com
I checked the M2 interface, and it doesn't work there because the TOPCOM program isn't available:

i3 : tri = topcomRegularFineTriangulation A

stdio:4:36:(3): error: could not find topcom

The following worked for me locally:

i1 : needsPackage "Topcom";

i2 : A = matrix {{0, 1, 2, 3, 4, 5, 6}, {0, 1, 4, 9, 16, 25, 36}, {0, 1, 8, 27, 64, 125, 216}};

3 7
o2 : Matrix ZZ <-- ZZ

i3 : tri = topcomRegularFineTriangulation A

o3 = {{0, 1, 2, 3}, {1, 2, 3, 4}, {0, 1, 3, 4}, {2, 3, 4, 5}, {1, 2, 4, 5}, {0, 1, 4, 5}, {3, 4, 5, 6}, {2, 3, 5, 6}, {1, 2, 5, 6},
-------------------------------------------------------------------------------------------------------------------------------
{0, 1, 5, 6}}

o3 : List

i4 : topcomRegularTriangulationWeights(A, tri)

5 5 1
o4 = {-, -, -, 0, 0, 0, 0}
2 6 6

o4 : List

What version of Macaulay2 are you using? There were some changes to the Topcom starting in Macaulay2 1.21. If you're using Macaulay2 1.20 or older, then you'll want to use "regularFineTriangulation" and "regularTriangulationWeights" instead.

Koushik Ray

unread,
Mar 22, 2024, 10:22:00 AMMar 22
to maca...@googlegroups.com
Thank you again, Douglas.
Indeed, I am on V1.19.1. That's what I got installing it with apt get on Ubuntu 22.04.4.

Let me check the commands you prescribe.
Best Regards... Koushik 

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/87ttkyjr08.fsf%40piedmont.edu.

Torrance, Douglas

unread,
Mar 22, 2024, 10:30:37 AMMar 22
to maca...@googlegroups.com, Koushik Ray
FYI, you can get the latest version of Macaulay2 on Ubuntu 22.04 using the PPA:

sudo add-apt-repository ppa:macaulay2/macaulay2
sudo apt install macaulay2

Koushik Ray

unread,
Mar 23, 2024, 6:21:35 AMMar 23
to maca...@googlegroups.com
Thank you, Douglas, this worked.
Best Regards... Koushik 

On Fri, 22 Mar 2024, 19:41 'Torrance, Douglas' via Macaulay2, <maca...@googlegroups.com> wrote:
Reply all
Reply to author
Forward
0 new messages