Skip to main content

passagemath: Algorithms for Rubik's cube

Project description

passagemath is open source mathematical software in Python, released under the GNU General Public Licence GPLv2+.

It is a fork of SageMath, which has been developed 2005-2026 under the motto “Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB”.

The passagemath fork uses the motto “Creating a Free Passage Between the Scientific Python Ecosystem and Mathematical Software Communities.” It was created in October 2024 with the following goals:

Moreover, the passagemath project:

  • provides a stable, frequently updated version of the Sage distribution,

  • integrates additional mathematical software, notably Macaulay2, a full set of GAP packages, and the Combinatorial Matrix Recognition library,

  • curates a library of Sage user packages.

Full documentation is available online.

passagemath attempts to support and provides binary wheels suitable for all major Linux distributions and recent versions of macOS.

Binary wheels for native Windows (x86_64, ARM) are are available for a subset of the passagemath distributions. Use of the full functionality of passagemath on Windows currently requires the use of Windows Subsystem for Linux (WSL) or virtualization.

The supported Python versions in the passagemath-10.8.x series are 3.11.x-3.14.x; the passagemath-10.6.x series (EOL 2026-10) still supports Python 3.10.x.

About this pip-installable distribution package

This pip-installable distribution passagemath-rubiks provides an interface to several programs for working with Rubik’s cubes.

Michael Reid (GPL) http://www.cflmath.com/~reid/Rubik/optimal_solver.html

  • optimal - uses many pre-computed tables to find an optimal solution to the 3x3x3 Rubik’s cube

Dik T. Winter (MIT License)

  • cube - uses Kociemba’s algorithm to iteratively find a short solution to the 3x3x3 Rubik’s cube

  • size222 - solves a 2x2x2 Rubik’s cube

Eric Dietz (GPL) https://web.archive.org/web/20121212175710/http://www.wrongway.org/?rubiksource

  • cu2 - A fast, non-optimal 2x2x2 solver

  • cubex - A fast, non-optimal 3x3x3 solver

  • mcube - A fast, non-optimal 4x4x4 solver

What is included

  • Interface

  • Features (via passagemath-environment)

  • Binary wheels on PyPI contain prebuilt copies of rubiks executables.

Examples

Using rubiks programs on the command line:

$ pipx run --pip-args="--prefer-binary" --spec "passagemath-rubiks" sage -sh -c cubex

Finding the installation location of a rubiks program:

$ pipx run --pip-args="--prefer-binary" --spec "passagemath-rubiks[test]" ipython

In [1]: from sage.features.rubiks import cubex

In [2]: cubex().absolute_filename()

Using the Python interface:

$ pipx run --pip-args="--prefer-binary" --spec "passagemath-rubiks[test]" ipython

In [1]: from sage.interfaces.rubik import *

In [2]: C = RubiksCube("R U F L B D")

In [3]: sol = CubexSolver().solve(C.facets()); sol
Out[3]: "U' L' L' U L U' L U D L L D' L' D L' D' L D L' U' L D' L' U L' B' U' L' U B L D L D' U' L' U L B L B' L' U L U' L' F' L' F L' F L F' L' D' L' D D L D' B L B' L B' L B F' L F F B' L F' B D' D' L D B' B' L' D' B U' U' L' B' D' F' F' L D F'"

Using sage.groups.perm_gps:

$ pipx run --pip-args="--prefer-binary" --spec "passagemath-rubiks[test]" ipython

In [1]: from passagemath_rubiks import *

In [2]: rubik = CubeGroup(); state = rubik.faces("R")

In [3]: rubik.solve(state)
Out[3]: 'R'

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

passagemath_rubiks-10.8.5rc1-cp314-cp314t-macosx_13_0_x86_64.whl (214.4 kB view details)

Uploaded CPython 3.14tmacOS 13.0+ x86-64

passagemath_rubiks-10.8.5rc1-cp314-cp314t-macosx_13_0_arm64.whl (206.2 kB view details)

Uploaded CPython 3.14tmacOS 13.0+ ARM64

passagemath_rubiks-10.8.5rc1-cp312-abi3-macosx_13_0_x86_64.whl (214.3 kB view details)

Uploaded CPython 3.12+macOS 13.0+ x86-64

passagemath_rubiks-10.8.5rc1-cp312-abi3-macosx_13_0_arm64.whl (205.7 kB view details)

Uploaded CPython 3.12+macOS 13.0+ ARM64

passagemath_rubiks-10.8.5rc1-cp311-cp311-macosx_13_0_x86_64.whl (213.6 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

passagemath_rubiks-10.8.5rc1-cp311-cp311-macosx_13_0_arm64.whl (205.1 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file passagemath_rubiks-10.8.5rc1-cp314-cp314t-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for passagemath_rubiks-10.8.5rc1-cp314-cp314t-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0f990246140daf149248c543a0b032a83fe025fe7a56bc602cb5cc54f38ae4d1
MD5 341e499c8ab61f459954dd4a379d0bff
BLAKE2b-256 54e867945ec92ea188152d2b784ad718b85a92b68ba256babfdc323a412c7643

See more details on using hashes here.

File details

Details for the file passagemath_rubiks-10.8.5rc1-cp314-cp314t-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for passagemath_rubiks-10.8.5rc1-cp314-cp314t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 09b149d94b65f14b1aa2f4d6e8a599d7f1c1620d14faf4f0fa65a7b21e0903b4
MD5 1cc196dd4eb6e71a65bf203570f1b1dd
BLAKE2b-256 f90cbf1cfa42c25f47765da704992fdf8d1ac63ed1f462638384e3cb65526ae2

See more details on using hashes here.

File details

Details for the file passagemath_rubiks-10.8.5rc1-cp312-abi3-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for passagemath_rubiks-10.8.5rc1-cp312-abi3-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d32484066fff5379a3bbb1648f5031627d92a9e14590b1c3d9a190bb9eff9671
MD5 ea626b0b7fa39e26f432264beb6052ec
BLAKE2b-256 07e69ca77f12e14ec94c7a651fd517b0411bd9c0b2cfc162b225ffce3f80c4b1

See more details on using hashes here.

File details

Details for the file passagemath_rubiks-10.8.5rc1-cp312-abi3-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for passagemath_rubiks-10.8.5rc1-cp312-abi3-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 77f0a8e50d7f3beac27ec03d058f16e7b67c0acc045bf4ec5351366c221273d7
MD5 aed37470769e79fa0271ee6c64e29284
BLAKE2b-256 417cf65a27251f73b8cf200e1b391a73f0cf1535f8c78c2ca399f9b49f30146a

See more details on using hashes here.

File details

Details for the file passagemath_rubiks-10.8.5rc1-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for passagemath_rubiks-10.8.5rc1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 454531909194befbe2c92be93c53fa1ce452ac9fbc037730d3cfb894f47582a0
MD5 9187309877c7b1eeb18cfebb88e45070
BLAKE2b-256 deefd9eb797c6dbc8a7e4e4f0e0ec4905d990325cf5f6113e924270c1d2a1eda

See more details on using hashes here.

File details

Details for the file passagemath_rubiks-10.8.5rc1-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for passagemath_rubiks-10.8.5rc1-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 21d2fd97de2f7a602c75a1ef8680b384359c3e71ea98656e2d908a12dc66511b
MD5 1b9bcedf530fab4e6325dcefc090e6ba
BLAKE2b-256 f1b9d67d24ffd5fa568bcf9e9e0475d5559d3855c67a74e924901871eccf35b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page