Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For anyone interested, here's what I came up with.

def weighted_ring_basis(n, weights):                                            
    if not 1 in weights:                                                        
        L = weights + [1]                                                       
        X = toric_varieties.WP(L)                                               
        G = X.rational_class_group()                                            
        OO = G.gens()[0]                                                        
        basis = (n*OO).lift().sections_monomials()                              
        return [f for f in basis if not f.dict().keys()[0][len(weights)]]       
    X = toric_varieties.WP(weights)                                             
    G = X.rational_class_group()                                                
    OO = G.gens()[0]                                                            
    return (n*OO).lift().sections_monomials()