Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Kash interface #25488

Closed
BrentBaccala opened this issue Jun 1, 2018 · 27 comments
Closed

Improved Kash interface #25488

BrentBaccala opened this issue Jun 1, 2018 · 27 comments

Comments

@BrentBaccala
Copy link
Contributor

The current interface to the optional kash package has limited utility. No way is provided to convert Kash expressions to Sage expressions, and Kash names like sage1 might be re-used even if there are outstanding references to subexpressions like sage1.1 (so this is also a bug fix, in addition to an enhancement).

This ticket fixes several bugs in the Kash interface, and allows a translation dictionary to be passed to a Kash object's sage() method, mapping Kash objects to Sage objects, allowing conversions like this:

    sage: kQ = kash.RationalField()
    sage: kR = kQ.PolynomialAlgebra()

    sage: R.<x> = QQ[]
    sage: ka = (x^2+x).subs({x : kR.1})
    sage541.1^2 + sage541.1
    sage: ka.sage({kR.1: x})
    x^2 + x

Also, keyword arguments are now passed correctly to Kash functions.

Component: interfaces: optional

Keywords: kash

Author: Brent Baccala

Branch/Commit: c8f01e7

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/25488

@BrentBaccala
Copy link
Contributor Author

comment:1

In the course of preparing this ticket, I realized that the default bool() routine in interface/interface.py is almost certainly wrong and would always need to be overridden.

Why? Since the default implementation of is_zero() (in structure/element.pyx) returns not self, almost everything needs to type-convert to a boolean True, except for zero, which should type-convert to False.

interface.py's default bool() routine has it backwards - it tests for equality to _true_symbol() (and everything else returns False), instead of inequality to _false_symbol() (and everything else returns True).

Maybe we should open another ticket for that. For Kash, where we have separate boolean and integer types, we need to compare to both FALSE and 0, so I think we need to override the method no matter what.


New commits:

00463deimprove Kash interface
5768ed4improve Kash interface
16289fcTrac #25488: fix boolean conversion in kash interface

@BrentBaccala
Copy link
Contributor Author

Commit: 16289fc

@BrentBaccala
Copy link
Contributor Author

Author: Brent Baccala

@BrentBaccala
Copy link
Contributor Author

Branch: public/25488

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2018

Changed commit from 16289fc to 84e58af

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 21, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

84e58afTrac #25488: evade bizarre dictionary problem

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2018

Changed commit from 84e58af to c629174

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 22, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

c629174Trac #25488: fix kash _contains() method

@dimpase
Copy link
Member

dimpase commented Jul 10, 2018

comment:4

We are in fact thinking about removing support for kash completely.
The last release of kash was 10 years ago, and as it's only binary releases, there are increasingly fewer computers out there capable of running it.

@BrentBaccala
Copy link
Contributor Author

comment:5

Replying to @dimpase:

We are in fact thinking about removing support for kash completely.
The last release of kash was 10 years ago, and as it's only binary releases, there are increasingly fewer computers out there capable of running it.

Removing kash makes a lot of sense.

The problem is that it's the only thing we've got right now to compute bases for Riemann-Roch spaces over QQ.

Kwankyu Lee has written some new function field code that can handle Riemann-Roch calculations over finite fields, but even that code is taking forever to move into the released code base.

Somebody (maybe me) needs to expand the function field code to handle QQ, and get it into master, before we remove kash.

Although, I admit that next to nobody knows how to use kash to do those calculations.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2019

Changed commit from c629174 to b557a97

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

b557a97Trac #25488: allow optional keyword arguments to be passed to Kash functions

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 18, 2019

Changed commit from b557a97 to a802923

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 18, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

a802923Trac #25488: handle Sage values (like elements of QQbar) whose print representation can't be parsed

@fchapoton
Copy link
Contributor

comment:8

this is missing the optional kash tag:

kash.function_call('ComplexToPolar', [1+I], {'Results' : 1})

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 10, 2019

Changed commit from a802923 to f2c1a1f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 10, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

2b1bd8dMerge tag '8.7' into public/25488
f2c1a1fTrac #25488: add optional kash tag to test case

@BrentBaccala

This comment has been minimized.

@embray
Copy link
Contributor

embray commented Jul 3, 2019

comment:11

Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically).

@embray embray modified the milestones: sage-8.8, sage-8.9 Jul 3, 2019
@embray
Copy link
Contributor

embray commented Dec 30, 2019

comment:12

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-8.9, sage-9.1 Dec 30, 2019
@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 14, 2020

comment:13

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 Apr 14, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 30, 2020

comment:14

The patchbot complains about some docstring issues

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 14, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

4a8a8a6Merge branch 'public/25488' in 9.2.rc2
c8f01e7flake8 refreshment for kash interface

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 14, 2020

Changed commit from f2c1a1f to c8f01e7

@fchapoton
Copy link
Contributor

comment:16

patchbot is now green

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@dimpase
Copy link
Member

dimpase commented Nov 6, 2020

Reviewer: Dima Pasechnik

@vbraun
Copy link
Member

vbraun commented Nov 22, 2020

Changed branch from public/25488 to c8f01e7

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

No branches or pull requests

6 participants