SageMath
by l3gi0n
49m ago
After installing Sagemath through WSL+conda-forge on Windows. Is there a way to use Jupyterlab desktop on windows with sagemath ..read more
SageMath
by Anton Nedelin
16h ago
I have the following problem. I want to define expression which contains elements of several Weyl Character Rings. The problem comes from physics. I have expression for theory with several symmetries, which can be of the same or different groups which involves characters of these groups representations. Let's take a simplest example of such expression $x = \chi_{R_1}(U)\chi_{R_2}(V)$ where $U\in G_1$, $V\in G_2$ are matrices in groups $G_1$ and $G_2$ and $R_{1,2}$ are corresponding representations. Let's say I want to find $x^2$ (or any other power) expanded in terms of irreps. If $G_1 \neq ..read more SageMath by sagelearner 3d ago I am trying to write a code using SAGE to find all subgroups of$\mathbb{Z}^*_n$where the elements of subgroups are elements of$\mathbb{Z}_n$. To elaborate, when I am using the command .subgroups(), it returns the subgroups in generator-relator form and not as integers. Is there anyway to do it ..read more SageMath by Anton Nedelin 3d ago I have the following problem. I want to define expression which contains elements of several Weyl Character Rings. The problem comes from physics. I have expression for theory with several symmetries, which can be of the same or different groups which involves characters of these groups representations. Let's take a simplest example of such expression$x = \chi_{R_1}(U)\chi_{R_2}(V)$where$U\in G_1 $,$V\in G_2 $are matrices in groups$G_1$and$G_2$and$R_{1,2}$are corresponding representations. Let's say I want to find$x^2$(or any other power) expanded in terms of irreps. If$G_1 \neq ..read more
SageMath
by mathstudent
3d ago
I have defined a function G such that G(alpha) is in QSym = QuasisymmetricFunctions(K) for alpha in Compositions. Is there a way to declare G as a basis of QSym, so that I can access functions like G(f) to give me the G-expansion of f where f is in QSym ..read more
SageMath
by Moerkx
5d ago
I know that PolynomialRing has the keyword "sparse" which defaults to False. sage: S = PolynomialRing(QQ, "x", sparse=False) sage: S is PolynomialRing(QQ, "x") True But the output of .coefficients() is still sparse in the sense that it does only show non-zero coefficients sage: p = S([1, 0, 2]) sage: p.coefficients() [1, 2] I know that I could reconstruct the polynomial using .exponents() sage: p.exponents() [0, 2] sage: x = S.gen() sage: p == sum(coef*x**exp for coef, exp in zip(p.coefficients(), p.exponents()) True But is there an easy way to make .coefficients() retu ..read more
SageMath
by mn124700
1w ago
I'm using Sagemath in Jupyter lab. Some of my cells contain cython code, and I keep getting the following warnings: ld: warning: duplicate -rpath '/private/var/tmp/sage-10.3-current/local/lib' ignored ld: warning: duplicate -rpath '/private/var/tmp/sage-10.3-current/local/lib' ignored ld: warning: duplicate -rpath '/private/var/tmp/sage-10.3-current/local/lib' ignored ld: warning: duplicate -rpath '/private/var/tmp/sage-10.3-current/local/lib' ignored ld: warning: passed two min versions (10.9, 10.9) for platform macOS. Using 10.9. ld: warning: passed two min versions (10.9, 10.9) for platform ..read more
SageMath
by Doron
1w ago
I'm trying to find the inverse of the polynomial $$7X^2 + 1$$ in the Galois ring $$GR(2^3, 3)$$ where the modulus polynomial is $$h(X) = X^3 + X + 1$$. However, I keep encountering the error "Flint exception (Impossible inverse): Cannot invert modulo $$2 4$$." Here is the SageMath code I'm using: k = 3 d = 3 R = IntegerModRing(2**k) GR = PolynomialRing(R, 'X') X = GR.gen() h = X^3 + X + 1 GaloisRing = GR.quotient(h, 'X') poly = GaloisRing(7*X^2 + 1) poly_elem = poly.lift() poly_modulus = h g, u, v = xgcd(poly_elem, poly_modulus) if g != 1: raise ValueError(f"The element {elem} does not h ..read more
SageMath
by Max Alekseyev
1w ago
Let's start with sage: x,p,q = var('x p q') sage: ( exp(p*x - q*x)^(1/(p-q)) ).full_simplify() e^x So far so good. Let's bring an extra factor to the picture: sage: ( (exp(p*x - q*x)/q)^(1/(p-q)) ).full_simplify() (e^(p*x - q*x)/q)^(1/(p - q)) There is no simplification here. Why? Also: sage: ( (exp(p*x - q*x)/q)^(1/(p-q)) ).factor() (e^(p*x - q*x)/q)^(1/(p - q)) does not produce the expected exp(x)*q^(-1/(p-q)). How to get that result ..read more
SageMath
by mn124700
1w ago
How do I get PIL images to display in SageMath on JupyterLab 4.2.4? I tried this... from IPython.display import display from PIL import Image img1 = toimage(data) # PIL image display(img1) All I get for the output is... PIL.Image.Image image mode=RGB size=720x360 at 0x184D1AE10 Any advice? Thanks. Eric ..read more

OR