Skip to content

EuclideanDistanceDegree v1#4353

Open
whuang259 wants to merge 2 commits into
Macaulay2:developmentfrom
whuang259:development
Open

EuclideanDistanceDegree v1#4353
whuang259 wants to merge 2 commits into
Macaulay2:developmentfrom
whuang259:development

Conversation

@whuang259
Copy link
Copy Markdown

Attached is a pull request for the EuclideanDistanceDegree package, coauthored with @JoseMath

Comment thread M2/Macaulay2/packages/EuclideanDistanceDegree.m2 Outdated
Comment thread M2/Macaulay2/packages/EuclideanDistanceDegree.m2 Outdated
Comment thread M2/Macaulay2/packages/EuclideanDistanceDegree.m2 Outdated
Comment thread M2/Macaulay2/packages/EuclideanDistanceDegree.m2 Outdated
@d-torrance
Copy link
Copy Markdown
Member

d-torrance commented May 25, 2026

The example are all failing because bertini isn't installed on the GitHub runners:

-- -*- M2-comint -*- hash: 15398408180617996408

i1 : R = QQ[x,y];

i2 : F = G = {x^2+y^2-1};

i3 : NCO = newNumericalComputationOptions(F, G);

i4 : NCO#"TargetWeight" = apply(#gens R, i -> random RR);

i5 : GED = homotopyEDDegree(NCO, "Weight", true, true)
-- warning: experimental computation over inexact field begun
--          results not reliable (one warning given per session)
sh: 1: bertini: not found
true

stdio:5:22:(3):[1]: error: Bertini run failed. 
-- -*- M2-comint -*- hash: 15222729530691853413

i1 : R = QQ[x,y];

i2 : F = G = {x^2 + y^2 - 1};

i3 : sampleGen = () -> apply(#gens R, i -> random(RR));

i4 : aED = averageNumericEDDegree(F, G, 10, SampleGenerator => sampleGen)
sh: 1: bertini: not found
true

stdio:4:28:(3):[1]: error: Bertini run failed. 
-- -*- M2-comint -*- hash: 12902145464090925420

i1 : R = QQ[x,y];

i2 : F = G = {x^2 + y^2 - 1};

i3 : dir = temporaryFileName();

i4 : NCO = newNumericalComputationOptions(F, G, TempDirectory => dir);

i5 : NCO#"TargetWeight" = apply(#gens R, i -> 1_R);

i6 : UED = homotopyEDDegree(NCO, "Weight", true, true)
-- warning: experimental computation over inexact field begun
--          results not reliable (one warning given per session)
sh: 1: bertini: not found
true

stdio:6:22:(3):[1]: error: Bertini run failed. 
-- -*- M2-comint -*- hash: 6775569773143953516

i1 : R = QQ[x,y];

i2 : F = G = {x^2+y^2-1};

i3 : (U,W) = ({.12, .23}, {.15, .331});

i4 : UED = numericUnitEDDegree(F, G)
sh: 1: bertini: not found
true

stdio:4:25:(3):[1]: error: Bertini run failed. 
-- -*- M2-comint -*- hash: 399917589567742851

i1 : R = QQ[x,y];

i2 : F = {x^2 + y^2 - 1};

i3 : determinantalUnitEDDegree(F)

o3 = 2

i4 : leftKernelUnitEDDegree(F)
sh: 1: bertini: not found
Warning: The HomVariableGroup is written first and then the AffVariableGroup is written second.
true

stdio:4:22:(3):[1]: error: Bertini run failed. 
-- -*- M2-comint -*- hash: 10893047696075686640

i1 : R = QQ[x,y];

i2 : F = {x^2 + y^2 - 1};

i3 : (U,W) = ({.12, .23}, {.15, .331});

i4 : UED = leftKernelUnitEDDegree F
sh: 1: bertini: not found
Warning: The HomVariableGroup is written first and then the AffVariableGroup is written second.
true

stdio:4:28:(3):[1]: error: Bertini run failed. 
-- -*- M2-comint -*- hash: 17265651732443607604

i1 : R = QQ[x,y];

i2 : F = {x^2 + y^2 - 1};

i3 : dir = temporaryFileName();

i4 : GED = leftKernelGenericEDDegree(F, TempDirectory => dir)
sh: 1: bertini: not found
Warning: The HomVariableGroup is written first and then the AffVariableGroup is written second.
true

stdio:4:31:(3):[1]: error: Bertini run failed. 

On one hand, it's probably not a bad idea for us to install bertini in the GitHub runners, but on the other hand, it would be good if we could detect when it's not available and not try to run the examples.

One way to do this is with the OptionalComponentsPresent key to newPackage. You could just read it straight from the Bertini package, so something like:

newPackage("EuclideanDistanceDegree",
    ...
   OptionalComponentsPresent => (readPackage "Bertini").OptionalComponentsPresent,
   CacheExampleOutput => true,
   ...)

The CacheExampleOutput option will make it so that all the example output files are cached when you run installPackage locally and you can add them to git. That way, we'll be able to build the documentation even when bertini isn't available on the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants