Ask Your Question
1

How to use a software package available for SageMath

asked 2018-10-17 04:21:30 -0600

Matteo gravatar image

updated 2018-10-17 04:22:01 -0600

Hi. I know SageMath is meant for math (so here user should post questions related mainly to math problems with Sage), but I'm testing SageMath capabilities about use/loading of external libraries created by user (c, fortran, etc...), that is like a complete environment able to process other prog languages like C and Fortran (mainly for scientific purposes).

I've found here that SageMath can load and use some external libraries (not only python libraries) to allow user to perform some tasks with them.

For example I'd like to know how to use the Rubik program (a C program) for fun and for testing by using SageMath (specifically SageMathCell). It is listed in position 82 of the list here.

Can you kindly show me a procedure to load/compile/use this library available for SageMath? I'd like to run the compiled code to solve (only for fun) some virtual/random Rubik cubes. The procedure for Rubik library could help me to understand how to run other libraries listed in the link above.

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2018-10-17 05:29:34 -0600

slelievre gravatar image

updated 2018-10-17 05:30:49 -0600

The reference manual available on the SageMath documentation site has a page about interfaces:

The list there includes an item for Rubik's cube solvers:

See also:

edit flag offensive delete link more

Comments

Nice! Thank you @slelievre, so SageMath has several interfaces for a lot of existing libraries!

And if I wanted to modify the source code of Rubik, by downloading the original version it in my cloud service and by modifying some pieces of code inside it, how could I reload it in SageMath (specifically SageMathCell) in order to use my modified code instead of the original one the user finds here?

In other words how could I modify the following sage commands (shown here) to use the modified version of "optimal.c" in my cloud?

from sage.interfaces.rubik import *
C = RubiksCube("R U")
CubexSolver().solve(C.facets())

Thank you

Matteo gravatar imageMatteo ( 2018-10-17 05:53:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-10-17 04:21:30 -0600

Seen: 59 times

Last updated: Oct 17 '18