Rubik-Tensor / README.md
Jean-baptiste Aujogue
Gradio Interface (#2)
f12b6ac unverified
|
raw
history blame
2.87 kB

Rubik-Tensor

Setup

This project uses uv 0.7 as environment & dependency manager, and python 3.11 as core interpreter. Install the project with

uv venv
-- Activate env --
uv sync
pre-commit install

Usage

Launch the web interface

python -m rubik interface

Use the python API

from rubik.cube import Cube

cube = Cube(size=3)

# display cube state
print(cube)
#     UUU        
#     UUU
#     UUU
# LLL CCC RRR BBB
# LLL CCC RRR BBB
# LLL CCC RRR BBB
#     DDD
#     DDD
#     DDD

# display history of moves
print(cube.history)
# []

# scramble the cube using 1000 random moves (this resets the history)
cube.scramble(num_moves=1000, seed=0)

# rotate it in some way (this gets appended to history)
cube.rotate('X2 X1i Y1i Z1i Y0 Z0i X2 X1i Y1i Z1i Y0 Z0i')

Roadmap

Fully tensorized Rubik Cube model

  • ☑️ Tensorized states.
  • ☑️ Tensorized actions.
  • ☑️ Interface for performing actions.

Movement explorer

  • ⬜ Explore changes resulting from a sequences of moves.
  • ⬜ Find least sequences of moves satisfying some input constrains.

Visualization interface

Base solvers following rule-based policies

References

Python implementations & rule-based solvers

Open-source projects related to Rubik's Cube, sorted by number of stars:

Machine Learning based solver models

  • 2025, CayleyPy Cube, Github, Paper

  • 2025, Solving A Rubik’s Cube with Supervised Learning – Intuitively and Exhaustively Explained, Blog post

  • 2024, Solving Rubik's Cube Without Tricky Sampling, Paper.
    This involves training a scorer, that estimates the number of moves transforming a given source state into a given target state, where the latter is not necessarily a solved cube. Data are synthetically generated performing random moves and factorizing repeated identical moves.

  • 2023, Curious Transformer, Github

  • 2021, Efficient Cube, Github, Paper