Ask Your Question

drumath's profile - activity

2024-02-09 06:20:36 +0200 received badge  Popular Question (source)
2022-12-04 11:30:50 +0200 edited question Create single-column matrix (aka. column vector)

Create single-column matrix (aka. column vector) I have a function that creates matrices of dimension $3r\times r$ with

2022-12-04 11:29:28 +0200 received badge  Editor (source)
2022-12-04 11:29:28 +0200 edited question Create single-column matrix (aka. column vector)

Create single-column matrix (aka. column vector) I have a function that creates matrices of dimension $3r\times r$ with

2022-12-04 11:18:32 +0200 commented question Create single-column matrix (aka. column vector)

Thanks for the idea @John Palmieri, it should work, yes. I wanted to know if there's something I'm missing but folks her

2022-12-04 11:02:32 +0200 commented question Create single-column matrix (aka. column vector)

Thanks for the idea @John, it should work, yes. I wanted to know if there's something I'm missing but folks here also sa

2022-12-04 11:00:27 +0200 commented answer Create single-column matrix (aka. column vector)

Thank you for pointing out .gens() and also for the improved implementation. I have been trying to migrate from Mathemat

2022-12-04 10:57:06 +0200 marked best answer Create single-column matrix (aka. column vector)

I have a function that creates matrices of dimension $3r\times r$ with variables:

def create_matrix_with_variables(r):
    m=3*r
    variable_names_string=['b_%d_%d' %(i,j) for (i,j) in cartesian_product([range(1,m+1),range(1,r+1)])]
    parent_ring=ZZ[variable_names_string]
    betas=list(parent_ring.variable_names())
    beta=matrix(parent_ring,m,r,betas)
    return beta

create_matrix_with_variables(2)
create_matrix_with_variables(1)

It works for $r>1$ but fails for $r=1$. I would love to post a screenshot but my karma is not enough. How do I do this correctly for $r=1$? I am using Sage 9.7 on mac in jupyter. Thanks.

UPDATE: Bugfix ticket submitted here: https://trac.sagemath.org/ticket/34821

2022-12-04 10:57:06 +0200 received badge  Scholar (source)
2022-12-02 21:23:19 +0200 received badge  Student (source)
2022-12-01 20:00:00 +0200 asked a question Create single-column matrix (aka. column vector)

Create single-column matrix (aka. column vector) I have a function that creates matrices of dimension $3r\times r$ with