Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ dist
*.egg-info
*.pgf
.ipynb_checkpoints
src/hilbert_modgroup/version.py
src/hilbert_modgroup/version.py
.idea/
.cache/
.tox/
.sage/
.local/
__pycache__/
*.DISABLED
305 changes: 305 additions & 0 deletions examples_extended/Example_coset.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "3b221a5e-d6b4-4421-aad7-988f124ea38d",
"metadata": {},
"source": [
"# Computing Right Coset Representatives. \n",
"## $K = \\mathbb{Q}(\\sqrt{10})$, $\\widehat{\\Gamma}(\\mathcal{O}_K\\oplus \\mathfrak{a}, \\mathfrak{n})$, where $\\mathfrak{a} = (2, \\sqrt{10})$, $\\mathfrak{n} = (3, 1+\\sqrt{10})$.\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "bc9054af-7a36-4e67-91fe-24a552bcd632",
"metadata": {},
"outputs": [],
"source": [
"from hilbert_modgroup.extended.all import ExtendedHilbertModularGroup, ExtendedHilbertPullback, NFCusp_wrt_lattice_ideal\n",
"K.<a> = QuadraticField(10)\n",
"lattice_ideal = K.fractional_ideal(2, a)\n",
"level_ideal = K.fractional_ideal(3, 1+a)\n",
"H1 = ExtendedHilbertModularGroup(K, lattice_ideal, level_ideal = level_ideal, tp_units = True)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "b2796116-be7f-4415-ae86-3ff9881feef6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[\n",
"[ 1 3/2*a - 3] [ 1 -1/2*a + 2]\n",
"[ -a - 2 -8], [ -a - 2 -a + 2],\n",
"\n",
"[ a + 6 -17/2*a + 17] [1 0]\n",
"[ -a - 2 -2*a + 12], [0 1]\n",
"]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"right_coset = H1.coset_matrices()\n",
"right_coset"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1e81e4eb-145d-44db-b35d-f697a3d0b63c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "7cf87439-7353-4862-b3b3-cff09b6d226f",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "61707006-487f-4d7f-acc3-4d50400415ec",
"metadata": {},
"source": [
"## Algorithm Steps: "
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "151deb13-bcc8-449e-b5ee-c4ec748ee873",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[Fractional ideal (1), Fractional ideal (3, a + 1)]"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Div = divisors(level_ideal) #Finding divisors\n",
"Div"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "a60413df-428a-4d3d-94c3-19de66beab31",
"metadata": {},
"outputs": [],
"source": [
"delta = Div[0] #Fixing one divisor"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "645dcb4c-adaf-46bc-a56c-fabb6f8eb78b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Fractional ideal (3, a + 2)"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"it = K.primes_of_degree_one_iter() #Finding delta'\n",
"deltap = next(it)\n",
"while not deltap.is_coprime(level_ideal) or not (deltap * delta * lattice_ideal).is_principal():\n",
" deltap = next(it)\n",
"c = (delta * lattice_ideal * deltap).gens_reduced()[0]\n",
"deltap "
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "19dd1229-64d6-4645-be38-cbfe430b8a2c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-a - 2"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c # Finding c"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "d3895fc8-c902-4f87-b438-0063767cf785",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Fractional ideal (1)"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"I = delta + level_ideal/delta # Value of I for this delta\n",
"I"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "308468c1-3ffd-4d2a-8bfa-1b093ae9c66c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[-a, 0, a]"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"D = [] # Finding residues of O_k/(n/delta)\n",
"for r in (level_ideal/delta).residues():\n",
" D.append(r)\n",
"D"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "2c4a950e-a3b4-46c5-a51d-81116de0b976",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[\n",
"[ 1 3/2*a - 3] [ 1 -1/2*a + 2]\n",
"[ -a - 2 -8], [ -a - 2 -a + 2],\n",
"\n",
"[ a + 6 -17/2*a + 17]\n",
"[ -a - 2 -2*a + 12]\n",
"]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"L = [] # Finding all coset representative correspoding to fixed delta\n",
"for r in (level_ideal / delta).residues():\n",
" if I.is_coprime(r):\n",
" M = delta.prime_to_idealM_part(level_ideal / delta)\n",
" u = (deltap * M).element_1_mod(level_ideal / delta)\n",
" d = u * r + (1 - u)\n",
" if d.is_zero():\n",
" L.append(H1.ambient_group().create_element(1, -1 / c, c, d))\n",
" else:\n",
" B = K.fractional_ideal(c * lattice_ideal.inverse()).element_1_mod(K.fractional_ideal(d))\n",
" b = -B / c\n",
" a = (1 - B) / d\n",
" L.append(H1.ambient_group().create_element(a, b, c, d))\n",
"L"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "53e850d1-608e-421c-b554-51ae349cca64",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "92f4ed0f-9b92-4f09-bdba-dcfc02aec635",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "c30248ed-5888-49b9-aab3-fbce6d35a234",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "b7e620a4-8839-4f85-b50a-a96d8822a738",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "20d520d9-772a-482b-bb06-e938d3dd9d78",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "passagemath 10.8.2",
"language": "sage",
"name": "sagemath"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading