Algorithm for computing canonical bases and foldings of quantum groups | Synapse