Re: [sage-support] Re: polyhedra with strict inequalities and Ehrhart

2021-07-08 Thread Dima Pasechnik
On Thu, Jul 8, 2021 at 7:15 PM kcrisman  wrote:
>
>
>> I presume you can enumerate vertices and facets,
>
>
> Unsure on how easy it will be to do this for my use case.
>
>>
>> or remove redundant inequalities in a more direct way.
>
>
> On a case-by-case basis, in principle, yes, this is the approach taken in the 
> particular literature I'm looking at.

 However, what I really want is the Ehrhart quasi-polynomials for
these things, and it would be "best" to automate it completely from
the original inequalities, which take a very predictable form.

maybe you could actually figure out the the irredundant ones? (which
would amount - dually- to repeatedly adding  inequalities to a pool
and check that the pool elements are - dually -  in convex position,
removing
ones which are not.)
If this sort of sieving is not implemented in Sage then it should.

Also, aside from Normaliz, PPL
(https://www.bugseng.com/products/ppl/documentation/user/ppl-user-1.2-html/index.html),
on which Sage's rational polyhedra code is based, has  all these
non-closed, half-closed, etc
things, they just have not made it fully into Sage interface.


>  Maybe it will be easiest to use non-strict inequalities, and then subtract 
> off (as Matthias implies) the lower-dimensional equalities.  Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/217a12f1-88df-401e-9c98-397394110808n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq2q%2Bt9MLLqS%2BCxmsbpJ94v4fdPpB25WZ46Ui%3DGRE8MU9Q%40mail.gmail.com.


Re: [sage-support] Re: polyhedra with strict inequalities and Ehrhart

2021-07-08 Thread kcrisman


> I presume you can enumerate vertices and facets, 
>

Unsure on how easy it will be to do this for my use case.
 

> or remove redundant inequalities in a more direct way.
>

On a case-by-case basis, in principle, yes, this is the approach taken in 
the particular literature I'm looking at.  However, what I really want is 
the Ehrhart quasi-polynomials for these things, and it would be "best" to 
automate it completely from the original inequalities, which take a very 
predictable form.   Maybe it will be easiest to use non-strict 
inequalities, and then subtract off (as Matthias implies) the 
lower-dimensional equalities.  Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/217a12f1-88df-401e-9c98-397394110808n%40googlegroups.com.


[sage-support] Re: Possible bugs in SR

2021-07-08 Thread Nils Bruin
On Thursday, 8 July 2021 at 09:49:18 UTC-7 Emmanuel Charpentier wrote:

> Dear Nils, dear list,
>
> Le jeudi 8 juillet 2021 à 01:01:44 UTC+2, Nils Bruin a écrit :
>
>> I think the main problem in f(x) is a preparser problem: 
>> https://trac.sagemath.org/ticket/11621
>>
>
> This is likely ; I don't see how to check this, but I'll accept it for now.
>
> You can check it in the following way, which makes it behave as the 
problem on the ticket: move the plus at the start of the second line to the 
end of the first line. Now the preparser mangles the string into an 
ungrammatical one, rather than a grammatical one with a different meaning. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/6594e5c2-9001-466a-9f0c-5663432eca56n%40googlegroups.com.


[sage-support] Re: wslg and sage ?

2021-07-08 Thread Henri Girard
I answer to myself works like on linux (ubuntu focal) I just installed 
sagemath and jupyter-notebook


for infos

Le 08/07/2021 à 15:48, Henri Girard a écrit :


Hi,

I just discovered wsl2/wslg windows native X support. GitHub - 
microsoft/wslg : Activation du sous-système Windows pour Linux pour 
inclure la prise en charge des scénarios liés aux serveurs Wayland et 
X 


I was wondering if someone already tested it ?

And the must tried to run sagemath with it ?

Any info will be best ?

Henri





--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/ab47d479-123e-2433-00ab-5fa1384ffc8c%40gmail.com.


[sage-support] Re: Possible bugs in SR

2021-07-08 Thread Emmanuel Charpentier
Dear Nils, dear list,

Le jeudi 8 juillet 2021 à 01:01:44 UTC+2, Nils Bruin a écrit :

> I think the main problem in f(x) is a preparser problem: 
> https://trac.sagemath.org/ticket/11621
>

This is likely ; I don't see how to check this, but I'll accept it for now.


The other problems could just be numerical instability. The normal 
> precision is 53 bits, which is good for about 16 decimal digits. The 
> constants in the formula are more than that, so if there is significant 
> cancellation, it may be this is just expected. Perhaps try and evaluatie 
> with a larger precision? .n(500) or so? If the answers are now closer then 
> it could just be numerical. The factored expression should give a different 
> evaluation scheme for what is presumably the same quantity.
>

This does not happen : the discrepancy does not change when raising the 
precision.

I still think that something is wroing in SR handling, and I'll try to 
exhibit it in an understandable way. Stay tuned...

Thanks a lot !
 

> On Wednesday, 7 July 2021 at 13:46:33 UTC-7 Emmanuel Charpentier wrote:
>
>> The same ask.sagemath question 
>> 
>>  
>> may have revealed two different bugs in symbolics handling.
>> Input interpretation. Raw input, with spaces, indents and newlines : 
>>
>> f(x) = (3/174465461165747500*pi*(-175*I*pi*x^3 - 3125*(224*pi + 
>> 45*sqrt(448*pi + 2025) + 2025)*x^2
>> + 17500*I*pi*x)
>> *sqrt(92821652156334811582567480952850314403/10*pi^2/(224*pi + 
>> 45*sqrt(448*pi + 2025) + 2025)
>>   + 9848979414202449817586228719725*pi*sqrt(448*pi + 2025)
>>   /(224*pi + 45*sqrt(448*pi + 2025) + 2025) + 
>> 771351762089863616280858441176625*pi
>>   /(224*pi + 45*sqrt(448*pi + 2025) + 2025) + 
>> 659225266976959904108326638192187500*sqrt(448*pi + 2025)
>>   /(224*pi + 45*sqrt(448*pi + 2025) + 2025) + 
>> 29665137013963195684874698718648437500
>>   /(224*pi + 45*sqrt(448*pi + 2025) + 2025))
>> /(63*pi^2*x^4 - (504000*I*pi^2 + 67500*I*pi*(sqrt(448*pi + 2025) + 
>> 45))*x^3
>>   - 300*(560224*pi^2 + 45*pi*(sqrt(448*pi + 2025) + 45))*x^2 + 
>> 84*pi^2
>>   - (-5040*I*pi^2 - 675*I*pi*(sqrt(448*pi + 
>> 2025) + 45))*x))
>>
>> Single-line reformatted code (deleting blanks, indents and newlines, 
>> adding a space before ‘+’ and ‘-‘) 
>>
>> g(x) = (3/174465461165747500*pi*(-175*I*pi*x^3 - 3125*(224*pi + 
>> 45*sqrt(448*pi + 2025) + 2025)*x^2 + 
>> 17500*I*pi*x)*sqrt(92821652156334811582567480952850314403/10*pi^2/(224*pi
>>  + 45*sqrt(448*pi + 2025) + 2025) + 
>> 9848979414202449817586228719725*pi*sqrt(448*pi + 2025)/(224*pi + 
>> 45*sqrt(448*pi + 2025) + 2025) + 
>> 771351762089863616280858441176625*pi/(224*pi + 45*sqrt(448*pi + 2025) + 
>> 2025) + 659225266976959904108326638192187500*sqrt(448*pi + 2025)/(224*pi + 
>> 45*sqrt(448*pi + 2025) + 2025) + 
>> 29665137013963195684874698718648437500/(224*pi + 45*sqrt(448*pi + 2025) + 
>> 2025))/(63*pi^2*x^4 - (504000*I*pi^2 + 67500*I*pi*(sqrt(448*pi + 2025) + 
>> 45))*x^3 - 300*(560224*pi^2 + 45*pi*(sqrt(448*pi + 2025) + 45))*x^2 + 
>> 84*pi^2 - (-5040*I*pi^2 - 
>> 675*I*pi*(sqrt(448*pi + 2025) + 45))*x))
>>
>> Notwithstanding formatting differences, these functions should be equal ; 
>> they are *not* :
>>
>> sage: f(1).n()
>> 418409.917305474 + 1.28757494213663e11*I
>> sage: g(1).n()
>> 1.39111866114058e-12 + 6.95559330500736e-6*I
>>
>> factor bug 
>>
>> sage: F = f.real()^2 + f.imag()^2
>> sage: Ff = (f.real()^2 + f.imag()^2).factor()
>> sage: G = g.real()^2 + g.imag()^2
>> sage: Gf = (g.real()^2 + g.imag()^2).factor()
>> sage: F(1).n()
>> 1.65784923163565e22
>> sage: Ff(1).n()
>> 4.77205703148314e29
>> sage: G(1).n()
>> 4.83802782246652e-11
>> sage: Gf(1).n()
>> 0.00139260822082924
>>
>> These two bugs may have a common origin in SR code (pynac comes to mind).
>>
>> My question is : how to file bugs about these ones, which seem extremely 
>> serious (silent errors in basic symbolics abilities) ?
>> ​
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/05ae081c-bf95-465a-96f8-39aa2443d450n%40googlegroups.com.


[sage-support] wslg and sage ?

2021-07-08 Thread Henri Girard

Hi,

I just discovered wsl2/wslg windows native X support. GitHub - 
microsoft/wslg : Activation du sous-système Windows pour Linux pour 
inclure la prise en charge des scénarios liés aux serveurs Wayland et X 



I was wondering if someone already tested it ?

And the must tried to run sagemath with it ?

Any info will be best ?

Henri



--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/ab7634fc-5923-cd2c-2026-11cbd2fa5c4c%40gmail.com.


Re: [sage-support] how do I do this exercise that asks me given a bilinear form and a subspace determine the root base of the bilinear form restricted to the subspace

2021-07-08 Thread David Joyner
def es(b,W):
: m=dimension(span(A))
: n=W.dimension()
: B=W.basis()
: if transpose(A)!=A:
: print("La matrice deve essere simmetrica")
: return
: else:
: componenti=[var('x'+str(i)) for i in range(1,m+1)]
: w=(SR^m).linear_combination_of_basis(componenti)
: d=[b(B[i],w) for i in range(0,n)]
: return d

is the same thing but a few typos were fixed.


On Thu, Jul 8, 2021 at 5:55 AM Cosimo Romito 
wrote:

> sage:
> def es(b,W):
> m=dimension(span(A))
> n=W.dimension()
> B=W.basis()
> if transpose(A)<>A:
> print("La matrice deve essere simmetrica")
> return
> else:
> componenti=[var('x'+str(i)) for i in range(1,m+1)]
> w=(SR^m).linear_combination_of_basis(componenti)
> d=[b(B[i],w) for i in range(0,n)]
>
> return d
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/fc67971d-aab4-46c6-83b7-ffe125f2fc8fn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAEQuuAVxagoSf8wtONVrt%2BxR81iWgJd0WBV1PutF_WMDXLZg5Q%40mail.gmail.com.


[sage-support] how do I do this exercise that asks me given a bilinear form and a subspace determine the root base of the bilinear form restricted to the subspace

2021-07-08 Thread Cosimo Romito
sage:
def es(b,W):
m=dimension(span(A))
n=W.dimension()
B=W.basis()
if transpose(A)<>A:
print("La matrice deve essere simmetrica")
return 
else:
componenti=[var('x'+str(i)) for i in range(1,m+1)]
w=(SR^m).linear_combination_of_basis(componenti)
d=[b(B[i],w) for i in range(0,n)]

return d
   

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/fc67971d-aab4-46c6-83b7-ffe125f2fc8fn%40googlegroups.com.


Re: [sage-support] Re: polyhedra with strict inequalities and Ehrhart

2021-07-08 Thread Dima Pasechnik
On Wed, 7 Jul 2021, 22:36 kcrisman,  wrote:

>
> Normaliz already supports half-open polyhedra, see section 3.12 ("open
>> facets") in the Normaliz manual
>> see https://github.com/Normaliz/Normaliz/blob/master/doc/Normaliz.pdf
>>
>
> Thank you!  But, based on the tickets I've just been cc:ed on, probably
> there is no current easy Sage interface for these?   Also, it's only
> certain of the inequalities I would want to be strict - is that too much to
> ask?  Maybe "Semiopen polyhedra" is more like what I'm looking for - I do
> not know the facets, only the inequalities, which in more complicated
> examples than the one I provided tend to have nontrivial interactions.
>

I presume you can enumerate vertices and facets, or remove redundant
inequalities in a more direct way.
Algorithmically these are easier tasks than counting integer points, IMHO.

-- 
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/0bbfa6be-7b3c-4fd5-8ab7-b63430850305n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq1kxXDo9rF7WDVeNB3Dn-_Q42JuDX3mr08zVmDiR6yFUQ%40mail.gmail.com.