# Getting the denominator takes ages...

Hi,

I am trying to run the following code (I am including the full code, this is about representation theory but my question is much simpler):

```
B2 = WeylCharacterRing(['B', 2])
b2 = WeightRing(B2)
Weyl = B2(2, 2)
l = B2.rank()
z = [var('z0')]
for k in range(1, l):
z.append(var('z' + str(k)))
u = var('u')
def toPoly(v):
return prod([z[k]^v[k] for k in range(0, l)])
Molien = 1
W = Weyl.weight_multiplicities()
for w in W:
T = toPoly(-w)
Molien *= 1/(1-u*T)^W[w]
Molien = factor(Molien)
WeylDenom = prod(1-toPoly(-alpha) for alpha in b2.positive_roots())
MolienInt = factor(Molien*WeylDenom/prod(z[k] for k in range(0, l)))
DEN = MolienInt.denominator()
(...)
```

Everything works fine except for the very last line that seems to run forever. Yet it is pretty straightforward to get the denominator of **MolienInt**.

I made some tests using **PolynomialRing** but it also seems not to end and has also the drawback that the denominator is expanded while I need it to remain factored.

Can you help me?