[sage-support] Re: Bug (inconsistent behaviour) of graph6_string/sparse6_string

2019-11-05 Thread Robert Samal
OK, I nearly forgot about the following: 

sage: K2=graphs.CompleteGraph(2)
sage: P=K2.cartesian_product(K2)
sage: print(P.graph6_string())
sage: print(P.sparse6_string())

Cr
:CoKN


However, my installation of nauty (and older installation of sage) claims, 
that to graph6_string "Cr" corresponds sparse6_string ":Cci". 
My running explanation is that graph6 and sparse6 use different ordering of 
the vertices, which is ... unfortunate. 

Not sure, if this is related, but I noticed that P.relabel() creates a 
mapping of original vertices to range(n) that looks random (I would expect 
the order to be according to the list P.vertices()). It would be nice to 
know, if this is expected behavious (and if the order may change in between 
different versions of Sage). Sorry for tugging a different question to one 
post; I thought it might be related. 


On Tuesday, November 5, 2019 at 1:43:23 AM UTC-8, Robert Samal wrote:
>
> I noticed the following strange behavior of 
> graph6_string()/sparse6_string() functions of graphs: 
>
> sage: K2=graphs.CompleteGraph(2)
> sage: P=K2.cartesian_product(K2)
>
> sage: print(P.sparse6_string())
> sage: print(Graph(P.graph6_string()).sparse6_string())
>
> :CoKN
> :Cci
>
>
> To explain: I understand, that Graph(P.graph6_string()) != P (as 
> graph6_string does not preserve the original set of vertices). 
> On the other hand, I was expecting that the ordering of vertices would be 
> the same, leading to the same sparse6_string(). 
>
> I understand that the problem stems from having vertices not of form 
> range(n). 
> However, even after looking at the documentation, I haven't been able to 
> decide, if this is a bug or feature ... 
> If the latter is the case, I suggest adding a visible warning (or perhaps 
> only give the string if the list of vertices is range(n)?). 
>
> Another observation, in the other direction I see the same behaviour: 
>
> sage: print(P.graph6_string())
> sage: print(Graph(P.sparse6_string(),loops=False, multiedges=False).
> graph6_string())
>
> Cr
> C]
>
>
> I am using sage 8.9 (python 3 and python 2 versions behave the same). 
> On the other hand, an older version of sage behaves in the expected way, 
> that is returns the same string twice. 
> Also adding P.relabel() before the tests leads to the expected result. 
>
>
>

-- 
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/b8150774-8dfe-497a-93db-7023128775c8%40googlegroups.com.


[sage-support] Bug (weird behaviour) of graph6_string/sparse6_string

2019-11-05 Thread Robert Samal
I noticed the following strange behavior of 
graph6_string()/sparse6_string() functions of graphs: 

sage: K2=graphs.CompleteGraph(2)
sage: P=K2.cartesian_product(K2)

sage: print(P.sparse6_string())
sage: print(Graph(P.graph6_string()).sparse6_string())

:CoKN
:Cci


To explain: I understand, that Graph(P.graph6_string()) != P (as 
graph6_string does not preserve the original set of vertices). 
On the other hand, I was expecting that the ordering of vertices would be 
the same, leading to the same sparse6_string(). 

I understand that the problem stems from having vertices not of form 
range(n). 
However, even after looking at the documentation, I haven't been able to 
decide, if this is a bug or feature ... 
If the latter is the case, I suggest adding a visible warning (or perhaps 
only give the string if the list of vertices is range(n)?). 

Another observation, in the other direction I see the same behaviour: 

sage: print(P.graph6_string())
sage: print(Graph(P.sparse6_string(),loops=False, multiedges=False).
graph6_string())

Cr
C]


I am using sage 8.9 (python 3 and python 2 versions behave the same). 
On the other hand, an older version of sage behaves in the expected way, 
that is returns the same string twice. 
Also adding P.relabel() before the tests leads to the expected result. 


-- 
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/9e12aab9-00d2-47af-9061-814646183f3f%40googlegroups.com.


[sage-support] symbolic manipulation -- insufficient simplification

2019-11-01 Thread Robert Samal
I observed the following weird behavior of the symbolic engine. 

sage: x/x
1
sage: x^2/x
x
sage: (x^2+x)/x
(x^2 + x)/x
sage: assume(x>0)
sage: assume(x,'real')
sage: assumptions()
[x > 0, x is real]
sage: (x^2+x)/x
(x^2 + x)/x

To clarify: first, I consider the first two simplifications slightly 
incorrect (x/x is undefined if x=0, or possibly if x is in some weird 
algebraic structure). However, if x/x==1 and x^2/x==x then I wonder why 
simplification of (x^2+x)/x is not done?

In this case, .simplify() does not help, .full_simplify() does. In my 
original example though, .full_simplify() did something crazy, so I was led 
to this. 

In general, is there some explanation regarding which simplifications one 
can expect to be done automatically and which by the two 
simplify-functions? 

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/1a730333-a573-40b8-8388-93eb5a54451d%40googlegroups.com.


Re: [sage-support] Re: solving a linear system of GF(3) -- strange TypeError

2019-10-09 Thread Robert Samal
Indeed it works in Sage 8.4. 
Thanks!

On Wednesday, October 9, 2019 at 8:34:41 AM UTC-7, Dima Pasechnik wrote:
>
> This got broken in Sage 8.5.
> (still works in 8.4)
>
>
>
> On Wed, Oct 9, 2019 at 6:09 AM David Joyner  > wrote:
>
>>
>>
>> On Wed, Oct 9, 2019 at 1:33 AM Robert Samal > > wrote:
>>
>>> Sorry, F=GF(3), I made my original example shorter and didn't read it 
>>> properly. 
>>>
>>> So the full problematic code is
>>>
>>> B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True)
>>> v=vector(GF(3), [1,1])
>>> B.solve_right(v)
>>>
>>>
>> Yes. I can confirm it works with "sparse=True" removed *or* if GF(3) is 
>> replaced by ZZ.
>> So there's an easy workaround but maybe the docs or the code has a bug? 
>> Thanks for reporting. 
>>
>> Thanks, 
>>>
>>> Robert
>>>
>>>
>>> On Tuesday, October 8, 2019 at 5:17:59 PM UTC-7, Robert Samal wrote:
>>>>
>>>> I am trying to solve a rather large linear systems of equations of 
>>>> GF(3). As the matrices are sparse, I thought that adding "sparse=True" to 
>>>> the constructor of the matrix could be of help. However, I ran to a 
>>>> strange 
>>>> error message. 
>>>>
>>>> B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True)
>>>> v=vector(F, [1,1])
>>>> B.solve_right(v)
>>>>
>>>> The above code yields the following
>>>>
>>>> TypeError: Cannot convert 
>>>> sage.matrix.matrix_modn_sparse.Matrix_modn_sparse to 
>>>> sage.matrix.matrix_integer_sparse.Matrix_integer_sparse
>>>>
>>>>
>>>> I am hesitant to paste the whole error message here, but it ends with 
>>>> reference to file 
>>>> SageMath/local/lib/python2.7/site-packages/sage/matrix/matrix_modn_sparse.pyx
>>>>  in 
>>>> sage.matrix.matrix_modn_sparse.Matrix_modn_sparse._solve_matrix_linbox 
>>>> (build/cythonized/sage/matrix/matrix_modn_sparse.cpp:11633). 
>>>>
>>>> I am using Sage 8.9, but the same issue was on 8.7 as well. 
>>>>
>>>> Few other observations:
>>>> -- works as expected for dense matrices -- or for sparse ones over integers
>>>> -- the same issue occurs whether y is a vector or a matrix
>>>> -- It behaves the same for systems with no solution.
>>>>
>>>> Is there some hidden limitation of sparse matrices over finite fields? 
>>>> I.e., is it a bug or feature? :-) 
>>>> I tried to RTFM, but couldn't find this discussed. The page for sparse 
>>>> matrices over
>>>> finite fields does not exactly promise the solve method, but it does not 
>>>> mention it 
>>>> would not work either. Is it possible to achieve what I want by other 
>>>> means (in Sage). 
>>>>
>>>> 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-s...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sage-support/6ac68e19-7c5a-4be1-ba10-1bac22cddc62%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/sage-support/6ac68e19-7c5a-4be1-ba10-1bac22cddc62%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> -- 
>> 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-s...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/CAEQuuAWQYKhtkVme8wHkJTj38QkmfnSJf3_Lhtqj9PxJmq8HcQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/sage-support/CAEQuuAWQYKhtkVme8wHkJTj38QkmfnSJf3_Lhtqj9PxJmq8HcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/5ce4410e-1ee7-4ebd-a5a6-903e893c1b77%40googlegroups.com.


[sage-support] Re: solving a linear system of GF(3) -- strange TypeError

2019-10-08 Thread Robert Samal
Sorry, F=GF(3), I made my original example shorter and didn't read it 
properly. 

So the full problematic code is

B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True)
v=vector(GF(3), [1,1])
B.solve_right(v)

Thanks, 

Robert


On Tuesday, October 8, 2019 at 5:17:59 PM UTC-7, Robert Samal wrote:
>
> I am trying to solve a rather large linear systems of equations of GF(3). 
> As the matrices are sparse, I thought that adding "sparse=True" to the 
> constructor of the matrix could be of help. However, I ran to a strange 
> error message. 
>
> B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True)
> v=vector(F, [1,1])
> B.solve_right(v)
>
> The above code yields the following
>
> TypeError: Cannot convert sage.matrix.matrix_modn_sparse.Matrix_modn_sparse 
> to sage.matrix.matrix_integer_sparse.Matrix_integer_sparse
>
>
> I am hesitant to paste the whole error message here, but it ends with 
> reference to file 
> SageMath/local/lib/python2.7/site-packages/sage/matrix/matrix_modn_sparse.pyx 
> in 
> sage.matrix.matrix_modn_sparse.Matrix_modn_sparse._solve_matrix_linbox 
> (build/cythonized/sage/matrix/matrix_modn_sparse.cpp:11633). 
>
> I am using Sage 8.9, but the same issue was on 8.7 as well. 
>
> Few other observations:
> -- works as expected for dense matrices -- or for sparse ones over integers
> -- the same issue occurs whether y is a vector or a matrix
> -- It behaves the same for systems with no solution.
>
> Is there some hidden limitation of sparse matrices over finite fields? 
> I.e., is it a bug or feature? :-) 
> I tried to RTFM, but couldn't find this discussed. The page for sparse 
> matrices over
> finite fields does not exactly promise the solve method, but it does not 
> mention it 
> would not work either. Is it possible to achieve what I want by other means 
> (in Sage). 
>
> 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/6ac68e19-7c5a-4be1-ba10-1bac22cddc62%40googlegroups.com.


[sage-support] solving a linear system of GF(3) -- strange TypeError

2019-10-08 Thread Robert Samal
I am trying to solve a rather large linear systems of equations of GF(3). 
As the matrices are sparse, I thought that adding "sparse=True" to the 
constructor of the matrix could be of help. However, I ran to a strange 
error message. 

B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True)
v=vector(F, [1,1])
B.solve_right(v)

The above code yields the following

TypeError: Cannot convert sage.matrix.matrix_modn_sparse.Matrix_modn_sparse to 
sage.matrix.matrix_integer_sparse.Matrix_integer_sparse


I am hesitant to paste the whole error message here, but it ends with reference 
to file 
SageMath/local/lib/python2.7/site-packages/sage/matrix/matrix_modn_sparse.pyx 
in 
sage.matrix.matrix_modn_sparse.Matrix_modn_sparse._solve_matrix_linbox 
(build/cythonized/sage/matrix/matrix_modn_sparse.cpp:11633). 

I am using Sage 8.9, but the same issue was on 8.7 as well. 

Few other observations:
-- works as expected for dense matrices -- or for sparse ones over integers
-- the same issue occurs whether y is a vector or a matrix
-- It behaves the same for systems with no solution.

Is there some hidden limitation of sparse matrices over finite fields? 
I.e., is it a bug or feature? :-) 
I tried to RTFM, but couldn't find this discussed. The page for sparse matrices 
over
finite fields does not exactly promise the solve method, but it does not 
mention it 
would not work either. Is it possible to achieve what I want by other means (in 
Sage). 

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/e8912161-212e-4e6f-aa69-a7461b2f6c09%40googlegroups.com.


[sage-support] Sage Crash Report

2016-12-27 Thread Robert Samal


-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.
***

IPython post-mortem report

{'commit_hash': u'1ba246d',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': 
'/home/samal/local/SageMath/local/lib/python2.7/site-packages/IPython',
 'ipython_version': '5.0.0',
 'os_name': 'posix',
 'platform': 'Linux-4.8.0-32-generic-x86_64-with-debian-stretch-sid',
 'sys_executable': '/home/samal/local/SageMath/local/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.10 (default, Oct 19 2016, 19:45:17) \n[GCC 5.4.0 
20160609]'}

***



***

Crash traceback:

---
---
ImportError  Python 2.7.10: /home/samal/local/SageMath/local/bin/python
   Tue Dec 27 13:08:43 2016
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/home/samal/local/SageMath/src/bin/sage-ipython in ()
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 """
  4 Sage IPython startup script.
  5 """
  6 
  7 from sage.repl.interpreter import SageTerminalApp
  8 
  9 app = SageTerminalApp.instance()
---> 10 app.initialize()
global app.initialize = >
 11 app.start()

 in initialize(self=, argv=None)

/home/samal/local/SageMath/local/lib/python2.7/site-packages/traitlets/config/application.py
 in catch_config_error(method=, 
app=, *args=(None,), **kwargs={})
 59 
 60 
#-
 61 # Application class
 62 
#-
 63 
 64 @decorator
 65 def catch_config_error(method, app, *args, **kwargs):
 66 """Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.
 67 
 68 On a TraitError (generally caused by bad config), this will print 
the trait's
 69 message, and exit the app.
 70 
 71 For use on init methods, to prevent invoking excepthook on invalid 
input.
 72 """
 73 try:
---> 74 return method(app, *args, **kwargs)
method = 
app = 
args = (None,)
kwargs = {}
 75 except (TraitError, ArgumentError) as e:
 76 app.print_help()
 77 app.log.fatal("Bad config encountered during initialization:")
 78 app.log.fatal(str(e))
 79 app.log.debug("Config at the time: %s", app.config)
 80 app.exit(1)
 81 
 82 
 83 class ApplicationError(Exception):
 84 pass
 85 
 86 
 87 class LevelFormatter(logging.Formatter):
 88 """Formatter with additional `highlevel` record
 89 

/home/samal/local/SageMath/local/lib/python2.7/site-packages/IPython/terminal/ipapp.py
 in initialize(self=, argv=None)
294 
295 return super(TerminalIPythonApp, self).parse_command_line(argv)
296 
297 @catch_config_error
298 def initialize(self, argv=None):
299 """Do actions after construct, but before starting the app."""
300 super(TerminalIPythonApp, self).initialize(argv)
301 if self.subapp is not None:
302 # don't bother initializing further, starting subapp
303 return
304 # print self.extra_args
305 if self.extra_args and not self.something_to_run:
306 self.file_to_run = self.extra_args[0]
307 self.init_path()
308 # create the shell
--> 309 self.init_shell()
self.init_shell = >
310 # and draw the banner
311 self.init_banner()
312 # Now a variety of things that happen after the banner is 
printed.
313 self.init_gui_pylab()
314 self.init_extensions()
315 self.init_code()
316 
317 def init_shell(self):
318 """initialize the InteractiveShell instance"""
319 # Create an InteractiveShell instance.
320 # shell.display_banner should always be False for the terminal
321 # based app, because we call shell.show_banner() by hand below
322  

[sage-support] Re: External viewer

2016-01-07 Thread Robert Samal
0)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x7f62803ba000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 
(0x7f62800d8000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 
(0x7f627fec5000)


On Thursday, January 7, 2016 at 6:38:53 PM UTC+1, Volker Braun wrote:
>
> Can you tell us more about what eog links to?
>
> $ sage -sh command -v eog
> /usr/bin/eog
> $ sage -sh ldd /usr/bin/eog # adjust path as necessary
>
> Also, are you overriding some paths?
>
> $ sage -sh -c env | grep PATH
>
>
>
> On Thursday, January 7, 2016 at 5:35:00 PM UTC+1, Robert Samal wrote:
>>
>>
>> On Thursday, January 7, 2016 at 5:16:38 PM UTC+1, Volker Braun wrote:
>>>
>>> What happens if you try to launch the viewer in a sage shell? 
>>>
>>> sage -sh xdg-open /path/to/image.png
>>>
>>
>> Good idea, didn't thought of that. I get some informative error messages 
>> (see below). 
>> I may try to work it out from here, but if it is a bug that can bite more 
>> people than just me (as opposed to a messy installation on my laptop), it's 
>> probably worth if somebody knowledgeable could spell out, what is the issue 
>> exactly. 
>>
>> Here is the output: 
>>
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `CXXABI_1.3.9' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `GLIBCXX_3.4.21' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `CXXABI_1.3.9' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `GLIBCXX_3.4.21' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `CXXABI_1.3.9' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `GLIBCXX_3.4.21' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `GLIBCXX_3.4.21' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `GLIBCXX_3.4.21' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9)
>> eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version 
>> `GLIBCXX_3.4.21' not found (required by 
>> /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
>>
>>
>>
>>
>>
>>  
>>
>>>
>>>
>>>
>>>  
>>>
>>
>>>
>>> On Thursday, January 7, 2016 at 4:49:44 PM UTC+1, Robert Samal wrote:
>>>>
>>>> Hi, 
>>>>
>>>> during some recent update of my laptop, sage ceased to show pictures 
>>>> from command-line. 
>>>> That is, for instance: 
>>>>
>>>> sage: plot(x^2, [x,0,1])
>>>> Yields output
>>>> "Launched png viewer for Graphics object consisting of 1 graphics 
>>>> primitive"
>>>>
>>>> Except no png viewer is launched (it used to start external 
>>>> image-viewer). 
>>>>
>>>> The png-files are properly created in the appropriate tmp folder. 
>>>>
>>>> Also starting pdf viewer works: 
>>>> sage: view(x^2)
>>>> ... starts a pdf viewer with x^2 typeset in tex. 
>>>>
>>>> I tried to check the viewer and everything seems to be OK: 
>>>> sage: from sage.misc.viewer import viewer
>>>> sage: viewer('pdf')
>>>> 'xdg-open'
>>>> sage: viewer('png')
>>>> 'xdg-open'
>>>>
>>>> And, when I try xdg-open in a shell (i.e., outside of sage), then it 
>>>> open correctly both png and pdf files. 
>>>>
>>>> Any ideas? It starts to be quite annoying (the only workaround I found 
>>>> is to save the plot to a png ...). 
>>>>
>>>> My system is ubuntu 15.10, 
>>>> SageMath Version 6.10, Release Date: 2015-12-18 -- obtained from file 
>>>> sage-6.10-Ubuntu_15.10-x86_64.tar.bz2. 
>>>>
>>>> But it did not work with sage 6.8 and 6.7 either. I'm not sure but I 
>>>> believe it worked with ubuntu 15.04 (and some previous version of sage). 
>>>>
>>>> Thanks in advance for any suggestion, 
>>>>
>>>> Robert Samal
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Multivariate polynomials: libsingular vs. polydict

2012-09-05 Thread Robert Samal

Hi, 

I'm trying to compute something using multivariate polynomials, and am 
struggling to understand the relation between polynomials of type 
and of type . 

How does one create one or the other? And, mainly: how can one convert from 
one to the other? 

What happened to me is that I unwillingly created some polynomial of one 
type and some of the other and than methods like 
P.coefficient(Q.monomials()[0]) object that they got argument of wrong 
type. (Here P and Q are polynomials of the respective types.) 

I'm sorry for not giving specific lines how to reproduce this, but -- in 
this case this is the point ... I got my polynomials P and Q over the 
course of several days and don't quite understand what happened. 

Thanks!

  Robert 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Linear programming in sage

2012-08-30 Thread Robert Samal
Thanks John!

Your suggestion

sage: p.solver_parameter("simplex_or_intopt", "simplex_then_intopt")
>

Works nicely also on sage v5.2. 

It would be worth to document it though. 
p.solve? doesn't mention anything (p = MixedIntegerLinearProgram() ), 
p.solver_parameter says that GLPK specific parameters are documented in 
GLPKBackend.solver_parameter which I didn't find. (I suppose one has to 
import it first.) 
Also I didn't find it in the sage tutorials describing 
MixedIntegerLinearProgram(). 

Anyway, thanks again!
Robert

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Linear programming in sage

2012-08-28 Thread Robert Samal

Hi,

I am trying to solve some linear programs in sage. 
>From the tutorial it seems that the right way to do this is nowadays 
the MixedIntegerLinearProgram() class. However, using the default 
glpk solver I can't find a way to distinguish between unbounded and 
unfeasible programs. That is 
  p = MixedIntegerLinearProgram()
  t = p.new_variable()
  p.add_constraint(t[0]<=-1)
  p.set_objective(t[0])
  p.solve()

(no solution) gives the same answer as 

  p = MixedIntegerLinearProgram()
  t = p.new_variable()
  p.set_objective(t[0])
  p.solve()

(unbounded problem). 
Is there some official way how to distinguish these two cases?

I suppose I could use cvxopt, but I fear it would be too slow for the real 
program I want to use it for. 

Thanks in advance,

  Robert Samal





-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] error in comparison of pi

2012-05-11 Thread Robert Samal
Hi! 

By some random experiments I discovered the following weirdness: 

sage: bool(piInfinity)
True

So far it seems that pi < Infinity is the only misbehaving comparison:  

sage: bool(pi<2*pi)
True
sage: bool(2*pihttp://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: semidefinite programming using csdp -- python import errors

2012-04-07 Thread Robert Samal
Thanks a lot, Dmitrii!

It works for me now. (Actually for quite some time, but now I can happily 
report, that
compared to cvxopt that I was using before, using csdp is about 10-times 
faster!)

I didn't know about sage -sh  , that is a very useful trick (perhaps it 
should
be documented more, or may be it is and I just didn't read documentation 
recently).
I was trying to manually modify the makefile to get csdp to compile using
sage libraries, but I wasn't up to the task ...

>and on all platorms, add -fopenmp to CFLAGS.
>As far as I know, Sage is compatible with openmp.

-fPIC on linux works as it should.

-fopenmp doesn't work for me (everything compiles, but the code doesn't 
run), but as the
code seems to be using multithreading anyway, I don't mind.

Thanks again,
  Robert

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Solving a simple equation

2012-03-27 Thread Robert Samal
Hi, 

I'm sorry if this is covered somewhere in the documentation -- but I'm 
puzzled by the following behaviour of solve:

sage: solve(sin(x)/cos(x)==1,x)
[sin(x) == cos(x)]
sage: solve(tan(x)==1,x)   
[x == 1/4*pi]

I would assume these two equation are equivalent, but evidently sage 
disagrees. Who is right? :-)
What can I do to get the solution automatically, without substituting tan 
manually? 

Thanks, 
 Robert Samal


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: semidefinite programming using csdp -- python import errors

2012-03-23 Thread Robert Samal

>
> Can you post the logs from doing sage -python setup.py instasll, as well 
> as explicit instructions (where to download, etc.) for how to duplicate 
> the error?
>
Sure. It's rather long, but I suppose if it works it would be useful for 
other people, too. I was hoping someone could spot the problem just from 
the above description.

Anyway, here you go:

1) download ATLAS library --- I did use debian package
apt-get install libatlas-base-dev  --install-suggests
  but one can also download from the web-site 
http://math-atlas.sourceforge.net/

  --> Now I discovered that sage has its own atlas libraries. Should I be 
trying
   to build against them? Do I need to build sage from source to do this?

2) download http://www.coin-or.org/download/source/Csdp/Csdp-6.1.1.tgz
unzip and install using the instructions. This is straightforward process
make
make install

3) download 
http://ifatwww.et.uni-magdeburg.de/syst/about_us/people/kern/downloads/pycsdp-0.10.zip
unzip, edit the setup.py to point to the Csdp library and includes, then run
python setup.py install as a root to install "to the system" .

To install to sage I tried
sage -python setup.py install
but I believe now that already here is a problem (or the problem?):
the installation using python finds the ATLAS library
  FOUND:
libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
library_dirs = ['/usr/lib/atlas-base/atlas', '/usr/lib/atlas-base']
language = f77
include_dirs = ['/usr/include/atlas']

while sage-python doesn't find it. Instead, it complains about missing 
directories
(full logs attached):
  
/data/local/sage-4.8-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/numpy/distutils/system_info.
  UserWarning: Specified path /home/wstein/build/sage-4.8/local/lib is 
invalid.
warnings.warn('Specified path %s is invalid.' % d)

Is this a bug? What should I do to use my libraries instead of wstein's? :-)
Do I need to compile my sage, so that I can add stuff to it?

Thanks!
   Robert


 

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


log_python_setup.py_install
Description: Binary data


log_sage_python_setup.py_install
Description: Binary data


[sage-support] semidefinite programming using csdp -- python import errors

2012-03-22 Thread Robert Samal

Hi,

I'm trying to use library Csdp <https://projects.coin-or.org/Csdp/> in Sage 
by means of Python numpy wrapper for CSDP called pycsdp (by B. 
Kern)<http://ifatwww.et.uni-magdeburg.de/syst/about_us/people/kern/index.shtml>.
 


I was assuming that it'll be easy, as one can generally run python scripts 
from sage.

So I installed Csdp library (built against ATLAS library for linear 
algebra), and installed the above said wrapper -- which is done in a 
standard python way by 
python setup.py install
 -- and it works. But only as a "stand-alone python script".

So, next to get it running in sage: I installed it for the sage-python by
sage -python setup.py install.

Now when I run a python script that works in standalone python,
I get an import error -- undefined symbol.

  Traceback (most recent call last):
File "example2.py", line 4, in 
  from pycsdp import _csdp
  ImportError: 
/data/local/sage-4.8-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/pycsdp/_csdp.so:
 
  undefined symbol: dnrm2_

I also found that the undefined symbol dnrm2_ is defined by the Csdp 
library, that I'd like to use. However, the setup.py script has the address 
of the library in it and it puts it where needed when installed by the 
"normal" python.

What should I do differently, to get this to work in sage? Could the ATLAS 
library I used to build Csdp be interfering with some standard sage 
libraries? (lapack etc.) 

Is there some different way to call python programs from sage, that 
wouldn't need to go through this?

Any ideas are appreciated, thanks for reading this,

   Robert Samal


P.S. I'm using
Sage Version 4.8, Release Date: 2012-01-20
with Debian/Wheezy


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: solve -- an easy issue with solution_dict=True)

2010-10-19 Thread Robert Samal
Speaking about solve(), is there a place to report equations it cannot
solve
(and I believe it should?).

I suppose putting it on the same Trac ticket is wrong practice? But
should
it be another ticket, or some yet other place?

Robert

> Yup.  solve() probably needs a general overhaul (and has for a while),
> but no one has had the time to do so.  With that in mind, could you
> open a ticket on the Trac server for this issue and point out the
> solution?  (If you are really ambitious, you can contribute a patch as
> well!)
>
> Thanks!
>
> - kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Graph drawing has issues with edge labels

2010-10-13 Thread Robert Samal
The ticket is here:
http://trac.sagemath.org/sage_trac/ticket/10124


> I see these sorts of issues too.  Can you open a ticket for this?
>
> Thanks,
>
> Jason

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] solve -- an easy issue with solution_dict=True)

2010-10-12 Thread Robert Samal
I observed that solve behaves inconsistently in the following regards:

sage: solve([x==1,x==-1],x)
[]

(this is as expected)
However:

solve([x==1,x==-1],x, solution_dict=True)

produces an error message. Easy to live with, but I was scared when I
first saw it :-).

It should be easy to correct, as the message reveals that the function
is trying to look at the 0-th
element of an empty list ...

/data/local/sage/local/lib/python2.6/site-packages/sage/symbolic/
relation.pyc in solve(f, *args, **kwds)
672 sol_list = string_to_list_of_solutions(repr(s))
673 if 'solution_dict' in kwds and
kwds['solution_dict']==True:
--> 674 if isinstance(sol_list[0], list):
675 sol_dict=[dict([[eq.left(),eq.right()] for eq
in solution])
676 for solution in sol_list]

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Graph drawing has issues with edge labels

2010-10-12 Thread Robert Samal

The following code should produce a drawing of the
Frucht graph with edges labeled 0 upto 17.
However, labels 16 and 17 are missing, while
15 is misplaced. The edge labels are set correctly
(as the last line shows), they only don't show up.
The weird thing is that other graphs work OK (at least those I tried).

  G=graphs.FruchtGraph()
  E=G.edges()
  for i in range(len(E)):
  G.set_edge_label(E[i][0],E[i][1],i)

  G.show(edge_labels=True)
  print G.edges()

Am I missing something? I don't care that much about this particular
graph,
but I'm mainly afraid that something weird is going on that will bite
me one day ...

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: small observation on range(i,j)

2008-11-11 Thread Robert Samal


> You might prefer the [1..n] notation, so you could do
>
> sage: [f(i) for i in [1..10]]
> [g(1), g(2), g(3), g(4), g(5), g(6), g(7), g(8), g(9), g(10)]
>
> (This really should be added to the wiki.)> sage: [f(i) for i in [1..10]]

Perhaps I'm missing something, but where do the g's come from? Isn't
that a typo?

sage: [f(i) for i in [1..10]]
[g(1), g(2), g(3), g(4), g(5), g(6), g(7), g(8), g(9), g(10)]


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Wrong limit

2008-11-11 Thread Robert Samal

Hi Minh,

> I think this issue has been fixed in sage-3.1.4. Under sage-3.1.4, the
> command
>
> sage: lim ( x*(sqrt(x^2)-sqrt(x))/sqrt(x^2 -x), x=oo)
> +Infinity
>
> returns what you'd expect.

That's great news, perhaps I should update more frequently.
By any chance, does somebody know what was the issue?

Not only am I curious, but I'd also like to know, how much should
I rely on results I get from sage in future.

Thanks,
  Robert



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Wrong limit

2008-11-11 Thread Robert Samal

(I'm not sure if this group is the right place to report bugs, but I'm
afraid I'd forgot about the issue
before I find the right place ...)

sage: lim ( x*(sqrt(x^2)-sqrt(x))/sqrt(x^2 -x), x=oo)
0

(The right answer is +Infinity, of course.)

after small modifications, the limit is evaluated correctly, e.g.:

sage: lim ( x*(sqrt(x^2)-sqrt(x))/sqrt(x^2), x=oo)
+Infinity

sage: lim ( x*(sqrt(x^2+x)-sqrt(x^2))/sqrt(x^2), x=oo)
1/2


What's wrong?
I am using
| SAGE Version 3.1.1, Release Date: 2008-08-17   |

Thanks,
Robert

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---