Giter Club home page Giter Club logo

macaulay2 / m2 Goto Github PK

View Code? Open in Web Editor NEW
322.0 29.0 218.0 86.77 MB

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.

Home Page: http://macaulay2.com

Makefile 3.46% Shell 0.23% C 12.14% TeX 0.49% C++ 65.33% CSS 0.48% Emacs Lisp 0.02% Awk 0.03% JavaScript 4.32% Scilab 0.27% HTML 2.91% Perl 0.05% Yacc 0.38% Lex 0.03% M4 2.22% Python 0.04% Roff 3.41% CMake 4.02% AppleScript 0.01% Rich Text Format 0.17%
algebraic-geometry commutative-algebra symbolic-computation mathematics groebner-basis homological-algebra projective-geometry resolutions modules rings

m2's Introduction

			       Macaulay2

Macaulay2 is a system for computing in commutative algebra, algebraic geometry
and related fields.  The system was originally written by Dan Grayson and Mike
Stillman.  David Eisenbud joined the project a number of years ago, and many
users are writing packages for the system, and some are contributing source
code.  See our web page 

  http://macaulay2.com/

for more details and for downloading binary releases.

The source code is available at

   https://github.com/Macaulay2/M2.

One uses the program "git" to access it.  For brief instructions about how to
use git, see

  https://github.com/Macaulay2/M2/wiki/Git-for-Macaulay2-Contributors .

Report bugs via the github issue tracker at

  http://github.com/Macaulay2/M2/.  

The directory containing this file is the top level directory of the directory
tree that contains the following subdirectories:

    M2	     The subdirectory "M2" contains everything needed by a user to
	     build Macaulay2, and the file "M2/INSTALL" gives instructions for
	     doing so.

    bugs     The subdirectory "bugs" is where we keep track of older bug 
    	     reports.

-----------------------------------------------------------------------------

Contributions to the code of Macaulay2 are welcome.

  To make a contribution, submit a "pull request" on github.  If the
  contribution involves changing an existing package in a non-trivial way, we
  will normally contact the authors to get their approval of the change.  If a
  new package with mathematical content is submitted, it will normally be
  accepted if it can be installed with "installPackage" and the tests pass as
  determined by "check", in the latest version of Macaulay2.

  To start working on an existing github "issue", volunteer to work on it, so
  you can get "assigned" to the issue, thereby preventing duplication of
  effort.

  To report a bug, submit an "issue" on github.

m2's People

Contributors

abrahammcs avatar antonleykin avatar d-torrance avatar dangrayson avatar danroozemond avatar eisenbud avatar fchapoton avatar fhinkel avatar franksottile avatar ggsmith avatar giovannistagliano avatar haerski avatar jakobkroeker avatar jankoboehm avatar jchen419 avatar jkyang92 avatar klee669 avatar kroner avatar kschwede avatar larswinther avatar lkastner avatar mahrud avatar michaelaburr avatar mikestillman avatar moorewf avatar ollieclarke8787 avatar pevernow avatar pzinn avatar timduff35 avatar tom111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m2's Issues

settle all the older bug reports

Every file in https://github.com/Macaulay2/M2/tree/master/bugs/dan and https://github.com/Macaulay2/M2/tree/master/bugs/mike is a bug report or an idea for a feature to add to M2. Go through all of them and settle them, one way or another. Remove the file after settling.

To attract more attention to such a bug report (e.g., from potential debugging people), report it as an issue here, including all information from the file, and remove the file from the repository. Reporting it as an issue here also makes it possible for someone other than Dan and Mike to be assigned to solve it.

This issue can serve as a link to the list of older bugs.

"Duplicate large block deallocation" message when calling numRealTrace from realroots.m2

M2 aborts after outputting the message "Duplicate large block deallocation" when running the following code:

https://gist.github.com/larstiq/5676124 (it seems github does not support file attachements but wants one to post a "gist", hrmph).

It fails on 64bit Debian Wheezy and Ubuntu 12.04 computers. The computation is
still running on my 32bit laptop but it may just be slow.

The code depends on http://www.math.tamu.edu/~sottile/research/ps/realroots.m2 as featured in
the chapter "From Enumerative Geometry to Solving Systems of Polynomial Equations" of the
"Computations in algebraic geometry with Macaulay2" book.

install problems in Ubuntu 12.04

I'm probably doing something wrong but I'm not sure what. I installed liblapack3gf but apt-get keeps asking for liblapack3. Similar problem with libntl0--I added several results of apt-cache search libntl but none of them seem to satisfy the package manager. I've tried installing by editing /etc/apt/sources.list then sudo apt-get update and sudo apt-get install macaulay2 as well as sudo dpkg -i [the package from macaulay2 webpage].

resultant gives wrong answer if one of the polynomials is of degree 0

Fix both resultant and sylvesterMatrix. Also figure out what should be done if one of the polynomials is 0.

i12 : for i to 3 list sylvesterMatrix (11*(x+a)^i,x+b,x)

o12 = {| 1 |, {0} | 11a b |, {0} | 11a2 b 0 |, {0} | 11a3 b 0 0 |}
              {1} | 11  1 |  {1} | 22a  1 b |  {1} | 33a2 1 b 0 |
                             {2} | 11   0 1 |  {2} | 33a  0 1 b |
                                               {3} | 11   0 0 1 |

o12 : List

i13 : for i to 3 list resultant (11*(x+a)^i,x+b,x)

                        2              2     3      2         2      3
o13 = {1, 11a - 11b, 11a  - 22a*b + 11b , 11a  - 33a b + 33a*b  - 11b }

o13 : List

handling of constant factors when factoring polynomials

We should fix it so "factor" does something uniform and predictable when it comes to the constant unit factors it extracts. Ideally each irreducible factor would be monic in the ordering of the ring. Since factor calls Singular-Factory, which uses a different monomial ordering, post-processing to clean up the factorization is required.

Thanks to Paul Zinn-Justin for suggesting it.

.emacs-Maculay2 may also need to set PATH variable

To use M2 in Emacs we run setupEmacs() which installs among other things this code

;; add "/usr/local/bin" to exec-path if it isn't there
(if (not (member "/usr/local/bin" exec-path))
     (setq exec-path (cons "/usr/local/bin" exec-path)))

On MacOS Mavericks with vanilla "Emacs.app" this was not sufficient to run M2 from Emacs: the M2 executable was not found. What worked was to modify the PATH variable of the Emacs shell environment like so:

(setenv "PATH" 
    (concat
     "/usr/local/bin" ":"
     (getenv "PATH")))

Maybe this code should be added to .emacs-Maculay2 ? I don't know the difference between the shell PATH and the exec-path variable, though.

embedded hash_map in embedded frobby fails to build on MacOS Mavericks

Hi,
I'm compiling the latest git on MacOS Mavericks. The compiler is llvm from Xcode:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.2
Thread model: posix

When compiling the automatically downloaded frobby, it fails as follows

In file included from src/hash_map/hash_map:64:
src/hash_map/hashtable.h:79:14: error: no member named '_Construct' in namespace
'std'
using std::_Construct;
~~~~~^
src/hash_map/hashtable.h:80:14: error: no member named '_Destroy' in namespace
'std'
using std::_Destroy;
~~~~~^
src/hash_map/hashtable.h:84:14: error: no member named '__iterator_category' in
namespace 'std'
using std::__iterator_category;
~~~~~^

and so on... Is this supposed to work, or is gcc mandatory?

improve documentation of keyword 'export', 'doc'

Dear Dan,

in the documentation of the 'export' keyword it is not mentioned, that variables should sometimes(?) be protected from evaluation by putting them into quotes (").
Do you think, such a remark should be added?

Same issue for 'doc'

What is/would be the first place to find this information?

Best,

Jack

M2 in terminal mode

Running M2 in terminal mode could be improved by making "viewHelp" pop up "lynx" or "info" optionally, and waiting for it to finish, instead of having it try to pop up a web browser asynchronously, since there may be no web browser present. Notice that M2 runs in a terminal on the sagemath cloud.

toExternalString bug for modules

Hello,

as in following example, sometimes it is not possible to reconstruct an object from a string due to a lazy string output. Example:

     rng := ZZ/3
     value toExternalString  matrix { {3_rng,3_rng} }

will fail since 'ZZ/3' is not enclosed in braces.

possible solution:
modify toExternalString for modules by replacing line 218 and 219 in m2/modules

218    then toString ring M | "^" | numgens M
219    else toString ring M | "^" | toExternalString (- degrees M)

with

    then "(" | toString ring M | ")^" | numgens M
    else "(" | toString ring M | ")^" | toExternalString (- degrees M)

additivity of timing

Timing is not additive if memory is allocated:

i3 : timing sum apply (100, i -> first timing (10000000:0))

o3 = 7.5996
 -- 14.4016 seconds

Find out why.

quotient of a Weyl algebra by a left ideal

Reported by: anton (on trac)

Forming a QuotientRing as in the example below should produce an error (for noncommutative algebras)... as this makes little sense.

i1 : W = QQ[x,dx,WeylAlgebra=>{x=>dx}]

o1 = W

o1 : PolynomialRing

i2 : A := W/ideal dx

  W
o2 = --                                                                         
 dx

o2 : QuotientRing

i3 : dx_A*x_A == (dx*x)_A

o3 = false

An alternative behaviour would be to return the module W^1/I.

Document the build/test workflow

Reported by: charles (on trac)

There should be a wiki page for keeping track of everything involved in the workflow for build/test of M2.

overriding methods implemented internally

It appears that one can override methods implemented internally, but can't use them.

toList Matrix := M -> flatten entries M
M = matrix{{1}}
class M
toList M

stdio:4:1:(3): error: expected list, sequence, or set

subtle error with beginDocumentation()

Hello,

consider a package with code behind 'beginDocumentation()':

if the package is installed by hand or loaded in its directory everything is fine,

but after 'installingPackage' and a Macaulay2 restart, M2 does not recognize functions placed below 'beginDocumentation'. Even if it is mentioned in the Macaulay2 documentation,
-this mistake is unfortunately not detected during installation process.
-prevents the programmer to place documentation near to the code it documents.

Question,
can this mistake at least be detected automatically,
or is it possible to allow code behind 'beginDocumentation'?

(strong) const correctness in M2 possible?

I would like to see strong const correctness in M2.
What would be roughly the required effort to achieve that? (I guess it is a big project)

Without strong const correctness it is too easy for a user ( maybe also for a programmer) to break code unintentionally, especially if it is desired to use user defined methods as parameters for object construction.

The dual of a map between free modules is not a map between free modules

Here is code demonstrating the problem:

R = QQ[x,y]
f = random(R^{2:1},R^2)
isFreeModule source dual f

another way to see this is to run

source Hom(f, R^1)

It seems that in recent versions of the trunk the dual comes out as the submodule generated by the basis vectors which is then not recognized as a free module. Maybe isFreeModule should be fixed?

This makes compiling the documentation of the function remainder' (in Macaulay2/packages/Maculay2Doc/doc3.m2) fail. It was also reported here:
https://groups.google.com/d/topic/macaulay2/mWMgqxSdPJA/discussion

I compiled M2 from trunk on Nov 13, 2012 and back then it still worked.

mingw 64 port

We'd like to port Macaulay2 code to native Windows binary code.

One way is to use cygwin as the build system and mingw64 as the target host system. The branch https://github.com/Macaulay2/M2/tree/release-1.6-mingw represents a start on the work, based on the stable 1.6 branch, in that the program builds and links.

The remaining problems are:

  • that we can't call pari from M2 because pari compiles itself without gmp/mpir support, and that's because the mpir limbs are 64 bit and pari wants them to be 32 bit. This involves writing two-way conversion routines in C between the two types of big integers.
  • that when cygwin starts M2 then M2 can't find the file setup.m2. That's because the root of the cygwin file system is different from the root of the windows file system. This involves a bit of rewriting of startup.m2.in.
  • the program crashes often. The debugger shows memory scrambling, so it's problem a libgc/pthreads problem. This will be a hard bug to figure out and probably require much time in gdb.

I might be able to return to this in August, but if someone else wants to try, assign yourself and give it a try!

bug with multidegree of empty affine variety

there's a simple bug with multidegree: (tested up to v1.6)
say R=QQ[x].
degree ideal(1_R)
gives 0, as should be.
however
multidegree ideal(1_R)
produces 1 -- which would be the correct answer for ideal(0_R), but certainly not for ideal(1_R) (for which it should produce 0).
the bug persists for any (multi)grading of the ring.

edit: the bug seems to be in line 357 of modules2.m2 which should probably read
if c === infinity then 0_A else part(c,onem numerator poincare M))

Ubuntu repository problem

When a line

deb-src http://www.math.uiuc.edu/Macaulay2/Repositories/Ubuntu precise main

gets added to /etc/apt/sources.list somehow, the error message

Could not download all repository indexes

appears. Figure out whether we can fix that by adding some empty indices to our repository.

lyubeznik complex error

Reported by: esaenz-d (on trac)

In function lyubeznik complex from package "SimplicialComplexes?" I obtain the following strange error message apparently when it tries to construct a SimplicialComplex? from an empty list
I=monomialIdeal(x2,y2,x_z,y_t)
oo16 : MonomialIdeal? of R
ii17 : lyubeznikComplex I
new nonfaces in degree 1: {}
new nonfaces in degree 2: {}
new nonfaces in degree 3: {}
new nonfaces in degree 4: {}
stdio:2:1:(3): error: expected a polynomial ring without quotient elements

fromDual on inhomogeneous inputs

fromDual gives meaningless answers for inhomogeneous inputs.

i1 : R = QQ[x]

o1 = R

o1 : PolynomialRing

i2 : C = betti res coker vars R

            0 1
o2 = total: 1 1
         0: 1 1

o2 : BettiTally

repository set up script for users

Under Debian and Ubuntu, it would be convenient for users to have a short shell script that could be run as root and would download the Macaulay2 public key, install it, and then use it to call "apt-get" to install Macaulay2. The script would be easy to write. Thanks to Thomas Kahle for the idea.

Lapack detection in the build system is faulty

The lapack detection code in the build system tries to find lapack by trying to find
-llapack -lblas -lf77blask like this:

              AC_SEARCH_LIBS(sgemv,blas f77blas,,BUILD_lapack=yes)
              AC_SEARCH_LIBS(dgetrf,lapack,,BUILD_lapack=yes)

On some systems this will fail although a valid lapack implementation is available. For instance for atlas the correct linker flags are:

-latllapack -latlcblas -lf77blas

On platforms where pkg-config is available this could be fixed by quering for the correct link line like so:

$ pkg-config --libs lapack blas

On recent linux systems this returns the correct -l flags.

inverse of a matrix with random CC entries freezes

Reported by: anton (on trac)

i1 : R = CC; inverse map(R^1, R^1, (i,j)->random R)      
-- warning: experimental computation over inexact field begun
--          results not reliable (one warning given per session)

o2 = | .819187-.5071i |

        1          1
o2 : Matrix CC    <--- CC
      53         53

i3 : R = CC; inverse map(R^2,R^2,(i,j)->random R) -- freezes! 

change class templates to function templates

We need to organize the linear algebra templates with mutable matrices better.

e.g. how best to handle routines like the following:
solve(A,b,x)

We need general functions to cover cases that have not been implemented
We need specializations to call ffpack/linbox code
We need specializations to call M2 code, for rings not considered in linbox.

The problem with template member functions is that their definition needs to be present when the class is instantiated. If it is in a cpp file, this might not be the case (i.e. it could grab the wrong version of the routine). If it is in a hpp file, we seem to get multiply defined functions, causing link error.

What is the best way to organize the code so that this is not a problem, and the code is clean and easy to maintain?

redundant ideal generator

I'm using Macaulay to examine rings of the form k + x^n k[[x]].
I started by creating the ring R = k + x^3 k[[x]]. I constructed this in Macaulay by taking k[[x_3,x_4,x_5]], where x_n is meant to represent x^n, and modding out by the ideal

I=ideal(x_3^3-x_4*x_5,x_4^2-x_3*x_5,x_5^2-x_3^2*x^4). 

When I computed the colon ideal A_1 : A_2, where

A_1=ideal(x_3,x_5)  
A_2=ideal(x_3^2,x_3*x_4)

I got the result

                 2   2
o7 = ideal (x , x , x ). 
             4   5   3

This appears to be a bug, since:

i9 : x_4*x_3^2

      2
o9 = x
      5

which shows that (x_5)^2 is a redundant generator for the ideal. I hoped that Macaulay would return the minimum generating set of the ideal, which it generally does successfully. Is this actually the intended behavior, or is Macaulay failing to detect that the one generator can be found from the others?

This is not a functional error, since the ideal returned was the correct ideal, simply with a redundant generator.

RPM fails to build on Fedora 16

Reported by: charles (on trac)

There seems to be a problem with the dependency tokens in the RPM Spec file:

cat libraries-used \
| while read x ; \
do rpm --query -f "$x" | sed 's/\([^.]*\)-\([0-9][0-9._]*[0-9]\)\(-.*$\|$\)/\1 \2/' ;\
done | fgrep -v 'is not owned by any package' | sort | uniq | sed -e 's=.*/==' -e 's=\.list$==' >packages-used
sed -e '/Requires/,$d' \
-e 's/^Release: .*/Release: 1/' <Macaulay2-body.spec >Macaulay2.spec
( echo -n "Requires: Macaulay2-common = 1.5" && \
  cat packages-used | while read pkg rel ; do echo -n ", $pkg >= $rel" ; done && \
  echo ) >>Macaulay2.spec
sed -e '1,/Requires/d' -e 's/%PKG_RPM%/Macaulay2-1.5-1.x86_64-Linux-Fedora-16.rpm/g' <Macaulay2-body.spec >>Macaulay2.spec
(cd files && find . -type d -a -name Macaulay2 -prune -o -type f) | sed -e 's=^\.="=' -e 's=$="=' >>Macaulay2.spec
fakeroot rpmbuild --sign --buildroot /home/fedora/src/branch/1.5/M2/BUILD/boyd/builds.tmp/fedora64/distributions/rpm/files -bb Macaulay2.spec
error: line 9: Dependency tokens must begin with alpha-numeric, '_' or '/': Requires: Macaulay2-common = 1.5, blas >= 3.3.1, cddlib-094f-11.fc16.x86_64 >= , gdbm >= 1.8.3, glibc >= 2.14.90, glpk >= 4.45, gmp >= 4.3.2, lapack >= 3.3.1, libgcc >= 4.6.3, libgfortran >= 4.6.3, libquadmath >= 4.6.3, libstdc++ >= 4.6.3, libxml2 >= 2.7.8, ncurses-libs >= 5.9, ntl >= 5.5.2, pari >= 2.3.5, zlib >= 1.2.5
rpm: --addsign: No such file or directory
make[3]: *** [../../Macaulay2-1.5-1.x86_64-Linux-Fedora-16.rpm] Error 1
make[3]: Leaving directory `/home/fedora/src/branch/1.5/M2/BUILD/boyd/builds.tmp/fedora64/distributions/rpm'
make[2]: *** [all-in-rpm] Error 2
make[2]: Leaving directory `/home/fedora/src/branch/1.5/M2/BUILD/boyd/builds.tmp/fedora64/distributions'
make[1]: *** [all-in-distributions] Error 2
make[1]: Leaving directory `/home/fedora/src/branch/1.5/M2/BUILD/boyd/builds.tmp/fedora64'
make: *** [all] Error 2

This is the line in question:

Requires: Macaulay2-common = 1.5, blas >= 3.3.1, cddlib-094f-11.fc16.x86_64 >= , gdbm >= 1.8.3, glibc >= 2.14.90, glpk >= 4.45, gmp >= 4.3.2, lapack >= 3.3.1, libgcc >= 4.6.3, libgfortran >= 4.6.3, libquadmath >= 4.6.3, libstdc++ >= 4.6.3, libxml2 >= 2.7.8, ncurses-libs >= 5.9, ntl >= 5.5.2, pari >= 2.3.5, zlib >= 1.2.5

The 'cddlib--094f-11.fc16.x86_64' line looks wrong to me.

minimalPresentation for modules over ZZ

The following bug was reported by Brett Barwick, on May 16, 2013.

R = ZZ[x,y]
f = matrix{{x^3,3_y+1,y^3+2_x*y^2}}
P = minimalPresentation ker f
res P

This worked on earlier versions of M2, but not 1.6 (the module P is way more complicated than it should be, and so the resolution is much more complicated). A workaround is to replace "ker f" with "trim ker f", resulting in a much simpler presentation. But this should not be necessary.

Issue when comparing reals

I'm running version 1.6 in Ubuntu 12.04. I would expect that the following should be "true".

i1 : 1.1 - 1 == .1

o1 = false

unknown engine error with mutable matrix and clean

Reported by: kroner

Using clean on a MutableMatrix produces unknown engine error.

i12 : A = new MutableMatrix from matrix{{1_RR}}

o12 = | 1 |

o12 : MutableMatrix

i13 : clean(0.1,A)
stdio:13:1:(3): error: unknown engine error

hashtables as functions

Hashtables are just like functions with a finite domain. So why not make
the following code work when X is a hashtable?

i25 : apply ( {a,b,c}, X)
stdio:28:1:(3):[1]: error: expected argument 2 to be a function

It wouldn't interfere with any old code, and something just like it seems to be
wanted. (The code above would return the list {X#a, X#b, X#c} of values.)

precise versioning

Add one more field to the version info: the git commit number and whether there are locally modified files. All the version info should also be made available in a small file somewhere in the directory tree inside the binary distribution tar, deb and rpm files.

bug in induced map?

I believe that the following exposes a bug in induced map.

  • M2 --no-readline --print-width 190
    Macaulay2, version 1.6
    with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition, ReesAlgebra, TangentCone

i1 : A = QQ[x,y,z,w]

o1 = A

o1 : PolynomialRing

i2 : M = image id_(A^2)

o2 = image | 1 0 |
| 0 1 |

                         2

o2 : A-module, submodule of A

i3 : f = genericMatrix(A,2,2)

o3 = | x z |
| y w |

         2       2

o3 : Matrix A <--- A

i4 : inducedMap(0 * M, M, f)
stdio:4:1:(3): error: inducedMap: expected matrix to induce a map

i5 : inducedMap(0 * M, M, f, Verify => false)

o5 = 0

o5 : Matrix

Lapack support is not optional anymore

The build system tests for lapack being present and there is also an option to disable it. This does not reflect reality as the M2 engine code unconditionally depends on lapack. It should be added to the dependencies and the configure code should be updated.

slight problem loading setup.m2

d/startup.m2.in has a slight bug that prevents setup.m2 when loading if
the parent directory of bin has a name ending with our architecture name

just add a "/" when checking the suffix

i1 : exe

o1 = /home/member/dgrayson/src/M2/Macaulay2-1.6-1.x86_64-Linux-CentOSrelease-6.4/bin/M2

i2 : prefixDirectory

o2 = /home/member/dgrayson/src/M2/Macaulay2-1.6-1.

i14 : dir exe | "/"

o14 = /home/member/dgrayson/src/M2/Macaulay2-1.6-1.x86_64-Linux-CentOSrelease-6.4/bin/

i15 : Layout#2#"bin"

o15 = x86_64-Linux-CentOSrelease-6.4/bin/

     currentLayout = (
          if issuffix(Layout#2#"bin",bindir) then Layout#2 else
          if issuffix(Layout#1#"bin",bindir) then Layout#1
          );

comparing a Hilbert polynomial to zero

Hi,

I was trying to compare a Hilbert polynomial to zero and discovered that M2 doesn't let me do this. I would like to be able to do this, and kludge that lets me do this is below.

I don't think this is a bug per-say and maybe I should be posting this to google groups instead of here.

Nonetheless, here is the code.

Macaulay2, version 1.6
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition, ReesAlgebra, TangentCone

i1 : A = QQ[x,y,z,w]

o1 = A

o1 : PolynomialRing

i2 : I = coker gens monomialCurveIdeal(A,{1,2,3})

o2 = cokernel | z2-yw yz-xw y2-xz |

                            1
o2 : A-module, quotient of A

i3 : hilbertPolynomial(I)

o3 = - 2_P  + 3_P
          0      1

o3 : ProjectiveHilbertPolynomial

i4 : hilbertPolynomial(I) != 0
stdio:4:22:(3): error: no method for binary operator == applied to objects:
--            - 2_P  + 3_P  (of class ProjectiveHilbertPolynomial)
--                 0      1
--     ==     0 (of class ZZ)

On the other hand,

i5 : hilbertPolynomial(A^0) 

o5 = 0

o5 : ProjectiveHilbertPolynomial

i6 : hilbertPolynomial(A^0) == hilbertPolynomial(I)

o6 = false

I want i4 to return false like i6 does.
Here is a very bad kludge to get around this.

i7 : 
     -- here is a VERY bad kludge to check if a hilbert polynomial is zero.
     hilbertPolynomial ZZ := ProjectiveHilbertPolynomial => o -> (M) -> ( 
         new ProjectiveHilbertPolynomial from {}
         )

o7 = ProjectiveHilbertPolynomial => {_Function[stdio:9:58-10:9]_}

o7 : Option

i8 : ProjectiveHilbertPolynomial == ZZ := (M,N) -> (M == hilbertPolynomial N)

o8 = {_Function[stdio:12:44-12:71]_}

o8 : FunctionClosure

i9 : 
     hilbertPolynomial(A^0) == 0

o9 = true

i10 : hilbertPolynomial(I) != 0

o10 = true

i11 : hilbertPolynomial(A^0) != 0

o11 = false

Any suggestions?

package program paths

Packages, such as Nauty, that run external programs, should look not just in one directory for the program, but also in the directories on the PATH. That way, on systems where those programs are provided by separate packages, such as gentoo, would not have to patch Nauty to get it to find the program.

info pages ignored under ubuntu

The ubuntu package installer causes our use of "install-info" to be ignored, and we are instructed to use "debhelper" to get "trigger support". It's a sensible thing, because then the directory of info pages is made just once per upgrade, rather than being updated once per package. But the result is that no info pages are being listed in the info menu. On the upside, hardly anyone reads the info pages.

improve the makefiles for building Macaulay2

The makefiles for building Macaulay2 should be improved so that:

  • dependencies are computed correctly, especially between files in different
    subdirectories

  • make can benefit from running in parallel, so ensure there are no needless dependencies

  • there is just one makefile that governs the whole build, so inter-directory dependencies
    are handle more efficiently

  • consider also using cmake or scons instead of make

install-info obsolete under debian

When installing macaulay2-com, the following warning message appears many times:

Ignoring install-info called from maintainer script
The package macaulay2-common should be rebuilt with new debhelper to get trigger support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.