1 | initial version |

This is an order in the number field $\mathbb{Q}(\sqrt{d})$:

```
sage: d = 5
sage: K.<a> = QuadraticField(d)
sage: R = K.order(a)
sage: R.basis()
[1, a]
sage: OK = K.ring_of_integers()
sage: OK.basis()
[1/2*a + 1/2, a]
sage: R.index_in(OK)
2
```

2 | No.2 Revision |

This is an order in the number field $\mathbb{Q}(\sqrt{d})$:

```
sage: d = 5
sage: K.<a> = QuadraticField(d)
sage: R = K.order(a)
sage: R.basis()
[1, a]
sage: OK = K.ring_of_integers()
sage: OK.basis()
[1/2*a + 1/2, a]
sage: R.index_in(OK)
2
```

Other options:

```
sage: d = 5
sage: ZZ[sqrt(d)]
Order in Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
sage: d = 5
sage: ZZ[AA(d).sqrt()]
Order in Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?
sage: d = 5
sage: K = QuadraticField(d)
sage: K
Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?
sage: ZZ[K.gen()]
Order in Number Field in a0 with defining polynomial x^2 - 5 with a0 = 2.236067977499790?
```

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.