sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 462 forks source link

Implement the quantum Clifford algebra at a root of unity #34147

Closed tscrim closed 2 years ago

tscrim commented 2 years ago

This works for sufficiently large roots of unity: when q2k != 1. We provide a new implementation/basis when this q2k = 1.

CC: @fchapoton

Component: algebra

Keywords: quantum Clifford

Author: Travis Scrimshaw

Branch/Commit: 40aab1e

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/34147

tscrim commented 2 years ago
comment:1

A bit of refactoring to have some good programming practices. I also fixed a bug in the inverse not taking into account the coefficients and will use the (new-ish) general inverse code to check the generic case.


New commits:

6ef8f5fImplementing the quantum Clifford at a root of unity.
e29f119Use the generic inverse code when not a special case of a monomial.
tscrim commented 2 years ago

Branch: public/algebras/quantum_clifford_root_unity-34147

tscrim commented 2 years ago

Commit: e29f119

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from e29f119 to 2f7cd21

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

4f7107eMerge branch 'develop' into public/algebras/quantum_clifford_root_unity-34147
2f7cd21Fixing the quantum Clifford doc.
fchapoton commented 2 years ago
comment:3

please avoid using except Exception

otherwise looks good

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 2f7cd21 to 07ffd7a

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

07ffd7aDo not catch any exceptions; just let it fail.
tscrim commented 2 years ago
comment:5

Replying to @fchapoton:

please avoid using except Exception

I couldn't figure out which exceptions to actually catch, so I decided to just let it fail.

(BTW, this type of catching is done elsewhere in Sage. What is your suggestion for catching exceptions when you want to catch basically all of them?)

fchapoton commented 2 years ago
comment:6

here you may want to use the method .fraction_field and catch AttributeError

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 07ffd7a to 5b55aa0

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

5b55aa0Use the FractionField function instead.
tscrim commented 2 years ago
comment:8

Replying to @fchapoton:

here you may want to use the method .fraction_field and catch AttributeError

Fair point. I decided to use the FractionField function instead since that has a few other sageguards.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 5b55aa0 to 6f15344

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

6f15344Merge branch 'develop' into public/algebras/quantum_clifford_root_unity-34147
fchapoton commented 2 years ago
comment:10

linter badge says

sage/algebras/quantum_clifford.py:699:9: E306 expected 1 blank line before a nested definition, found 0
sage/algebras/quantum_clifford.py:738:9: E306 expected 1 blank line before a nested definition, found 0
2       E306 expected 1 blank line before a nested definition, found 0
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 6f15344 to 40aab1e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

40aab1eAdded whitespace for E306.
tscrim commented 2 years ago
comment:12

Fixed.

fchapoton commented 2 years ago
comment:13

ok, then let it be.

fchapoton commented 2 years ago

Reviewer: Frédéric Chapoton

tscrim commented 2 years ago
comment:14

Thank you!

vbraun commented 2 years ago

Changed branch from public/algebras/quantum_clifford_root_unity-34147 to 40aab1e