Converting from Ideal Basis to Binary Quadratic Form

84 Views Asked by At

I understand there is a correspondence between binary quadratic forms and ideals in quadratic number fields. I am working in quadratic number fields and I am working with ideals of the form $$I = (A, \frac{B+C\sqrt{D}}{2E}) $$ and only in cases where $E\mid B$ and $E\mid C$. When I convert this to a binary quadratic form, the discriminant of the form ends up being $(\frac{C}{E})^2D$ which makes sense, but its not equal to $D$ as I would want. What am I doing wrong?

This is what I am using to convert: Ideal to BQF