{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"id": "1494ba58-0b3b-4a26-8099-607d97f84dbb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Welcome to Nemo version 0.43.3\n",
"\n",
"Nemo comes with absolutely no warranty whatsoever\n",
"\n",
"Welcome to \n",
"\n",
"\u001b[31m _ _ _\u001b[39m\n",
"\u001b[31m | | | | | |\u001b[39m\n",
"\u001b[31m | |__| | ___ ___| | _____\u001b[39m\n",
"\u001b[31m | __ |/ _ \\/ __| |/ / _ \\\u001b[39m\n",
"\u001b[31m | | | | __/ (__| < __/\u001b[39m\n",
"\u001b[31m |_| |_|\\___|\\___|_|\\_\\___|\u001b[39m\n",
"\u001b[31m \u001b[39m\n",
"Version\u001b[32m 0.30.12 \u001b[39m... \n",
" ... which comes with absolutely no warranty whatsoever\n",
"(c) 2015-2024 by Claus Fieker, Tommy Hofmann and Carlo Sircana\n",
"\n",
" ___ ____ ____ _ ____\n",
" / _ \\ / ___| / ___| / \\ | _ \\ | Combining ANTIC, GAP, Polymake, Singular\n",
"| | | |\\___ \\| | / _ \\ | |_) | | Type \"?Oscar\" for more information\n",
"| |_| | ___) | |___ / ___ \\| _ < | Manual: https://docs.oscar-system.org\n",
" \\___/ |____/ \\____/_/ \\_\\_| \\_\\ | Version 1.0.2\n",
"\r"
]
}
],
"source": [
"using Oscar\n",
"using LinearAlgebra\n",
"using Oscar.Hecke"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "d71b297d-bb23-4b48-979d-ff877145342c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"twist (generic function with 1 method)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function twist(L, k)\n",
" Lm = gram_matrix(L)\n",
" n = minimum(size(Lm))\n",
" Lm_twist = Lm * (k * identity_matrix(ZZ, n))\n",
" L_twist = integer_lattice(gram = Lm_twist)\n",
" return L_twist\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "dbf01d4d-0528-46bc-b50a-05190c74f721",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Integer lattice of rank 1 and degree 1\n",
"with gram matrix\n",
"[1]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Integer lattice of rank 1 and degree 1\n",
"with gram matrix\n",
"[2]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Integer lattice of rank 8 and degree 8\n",
"with gram matrix\n",
"[-2 1 0 0 0 0 0 0]\n",
"[ 1 -2 1 0 0 0 0 0]\n",
"[ 0 1 -2 1 0 0 0 1]\n",
"[ 0 0 1 -2 1 0 0 0]\n",
"[ 0 0 0 1 -2 1 0 0]\n",
"[ 0 0 0 0 1 -2 1 0]\n",
"[ 0 0 0 0 0 1 -2 0]\n",
"[ 0 0 1 0 0 0 0 -2]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Integer lattice of rank 8 and degree 8\n",
"with gram matrix\n",
"[-4 2 0 0 0 0 0 0]\n",
"[ 2 -4 2 0 0 0 0 0]\n",
"[ 0 2 -4 2 0 0 0 2]\n",
"[ 0 0 2 -4 2 0 0 0]\n",
"[ 0 0 0 2 -4 2 0 0]\n",
"[ 0 0 0 0 2 -4 2 0]\n",
"[ 0 0 0 0 0 2 -4 0]\n",
"[ 0 0 2 0 0 0 0 -4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Integer lattice of rank 2 and degree 2\n",
"with gram matrix\n",
"[0 1]\n",
"[1 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Integer lattice of rank 2 and degree 2\n",
"with gram matrix\n",
"[0 2]\n",
"[2 0]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Z1 = root_lattice(:I, 1)\n",
"display(Z1)\n",
"\n",
"Z2 = twist(Z1, 2)\n",
"display(Z2)\n",
"\n",
"E8 = twist( root_lattice(:E, 8), -1)\n",
"display(E8)\n",
"\n",
"E82 = twist(E8, 2)\n",
"display(E82)\n",
"\n",
"H = hyperbolic_plane_lattice()\n",
"display(H)\n",
"\n",
"H2 = twist(H, 2)\n",
"display(H2)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "ecc4d9e0-e377-4062-ac9d-48216d6391d4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Integer lattice of rank 10 and degree 10\n",
"with gram matrix\n",
"[0 1 0 0 0 0 0 0 0 0]\n",
"[1 0 0 0 0 0 0 0 0 0]\n",
"[0 0 -2 1 0 0 0 0 0 0]\n",
"[0 0 1 -2 1 0 0 0 0 0]\n",
"[0 0 0 1 -2 1 0 0 0 1]\n",
"[0 0 0 0 1 -2 1 0 0 0]\n",
"[0 0 0 0 0 1 -2 1 0 0]\n",
"[0 0 0 0 0 0 1 -2 1 0]\n",
"[0 0 0 0 0 0 0 1 -2 0]\n",
"[0 0 0 0 1 0 0 0 0 -2]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Integer lattice of rank 10 and degree 10\n",
"with gram matrix\n",
"[0 2 0 0 0 0 0 0 0 0]\n",
"[2 0 0 0 0 0 0 0 0 0]\n",
"[0 0 -4 2 0 0 0 0 0 0]\n",
"[0 0 2 -4 2 0 0 0 0 0]\n",
"[0 0 0 2 -4 2 0 0 0 2]\n",
"[0 0 0 0 2 -4 2 0 0 0]\n",
"[0 0 0 0 0 2 -4 2 0 0]\n",
"[0 0 0 0 0 0 2 -4 2 0]\n",
"[0 0 0 0 0 0 0 2 -4 0]\n",
"[0 0 0 0 2 0 0 0 0 -4]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"E10 = direct_sum(H, E8)[1]\n",
"display(E10)\n",
"\n",
"E10_2 = twist(E10, 2)\n",
"display(E10_2)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "d3969319-46b7-472b-8947-66d6184eed96",
"metadata": {},
"outputs": [
{
"ename": "LoadError",
"evalue": "Type (:B) must be :A, :D, :E or :I",
"output_type": "error",
"traceback": [
"Type (:B) must be :A, :D, :E or :I",
"",
"Stacktrace:",
" [1] root_lattice(R::Symbol, n::Int64)",
" @ Hecke ~/.julia/packages/Hecke/rluKS/src/QuadForm/Quad/ZLattices.jl:686",
" [2] top-level scope",
" @ In[9]:1"
]
}
],
"source": [
"B7 = twist( root_lattice(:B, 7), -1)\n",
"display(B7)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "9ab1a809-9b83-4905-87bd-4664a4291413",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Integer lattice of rank 8 and degree 8\n",
"with gram matrix\n",
"[-4 2 0 0 0 0 0 0]\n",
"[ 2 -4 2 0 0 0 0 0]\n",
"[ 0 2 -4 2 0 0 0 2]\n",
"[ 0 0 2 -4 2 0 0 0]\n",
"[ 0 0 0 2 -4 2 0 0]\n",
"[ 0 0 0 0 2 -4 2 0]\n",
"[ 0 0 0 0 0 2 -4 0]\n",
"[ 0 0 2 0 0 0 0 -4]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Sdp = H2\n",
"Sen = direct_sum( twist(H, 2), twist(E8, 2) )[1]\n",
"Lnikp = direct_sum(H, H, H, twist(E8, 2) )[1]\n",
"\n",
"Tdp = direct_sum(H, twist(H, 2), E8, E8)[1]\n",
"Ten = direct_sum(H, twist(H, 2), twist(E8, 2) )[1]\n",
"Lnikm = twist(E8, 2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ad661ed1-2afe-4aee-88b8-024b634c481a",
"metadata": {},
"outputs": [],
"source": [
"# Return whether L is primary, that is whether L is integral and its discriminant group (see discriminant_group) is a p-group for some prime number p. \n",
"# In case it is, p is also returned as second output.\n",
"#Note that for unimodular lattices, this function returns (true, 1). \n",
"# If the lattice is not primary, the second return value is -1 by default.\n",
"\n",
"display( is_primary_with_prime(H) ) #unimodular\n",
"display( is_primary_with_prime(E8) ) #unimodular\n",
"display( is_primary_with_prime(E10) ) #unimodular\n",
"display( is_primary_with_prime(E10_2) ) #2-primary"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2a2f7ae6-8f80-4af2-a083-ef124b254683",
"metadata": {},
"outputs": [],
"source": [
"display( is_elementary_with_prime(H) ) #unimodular\n",
"display( is_elementary_with_prime(E8) ) #unimodular\n",
"display( is_elementary_with_prime(E10) ) #unimodular\n",
"display( is_elementary_with_prime(E10_2) ) #2-elementary"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "969e169d-f4c9-4fd6-96ab-ff9193a05dc0",
"metadata": {},
"outputs": [],
"source": [
"# Return the number of (positive, zero, negative) inertia of L.\n",
"\n",
"display(signature_tuple(H))\n",
"display(signature_tuple(E8))\n",
"display(signature_tuple(E10))\n",
"display(signature_tuple(E10_2))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1c33c547-f54c-4433-be3b-125c52929dd4",
"metadata": {},
"outputs": [],
"source": [
"discriminant_group(E10)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "34985de9-5577-4f3d-bff4-f5522136de75",
"metadata": {},
"outputs": [],
"source": [
"discriminant_group(E10_2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e4161911-5402-4ff1-a269-9be43b6f060c",
"metadata": {},
"outputs": [],
"source": [
"L = direct_sum(Z2, H2, E82)[1]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "eb8ccc7a-072e-422a-ba52-3237af518659",
"metadata": {},
"outputs": [],
"source": [
"display( signature_tuple(L) )\n",
"display( is_primary_with_prime(L) )\n",
"display( is_elementary_with_prime(L) )\n",
"display( discriminant_group(L) )"
]
},
{
"cell_type": "markdown",
"id": "ed290f9c-4a6b-4221-a4d0-d7d2a39dbf6f",
"metadata": {},
"source": [
"# Coparity\n",
"\n",
"AE22: Compactifications of moduli spaces of K3 surfaces with a nonsymplectic involution\n",
"\n",
"**Definition 2.3.** We define an additional invariant, coparity $\\delta_H$ as follows: $\\delta=0$ if for all $x \\in A_H$ one has $q_H(x) \\equiv 0(\\bmod \\mathbb{Z})$ and $\\delta=1$ otherwise. We will call lattices with $\\delta_H=0$ co-even and lattices with $\\delta_H=1$ co-odd."
]
},
{
"cell_type": "code",
"execution_count": 77,
"id": "a5c5609c-140d-4960-af6b-3a6a777a120b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"rad_invts (generic function with 1 method)"
]
},
"execution_count": 77,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function rad_invts(lat::ZZLat)\n",
" display(\"------------------------------------\")\n",
" is_elem = is_elementary_with_prime(lat)\n",
" if is_elem[1] == false || is_elem[2] != 2\n",
" display(\"Not a 2-elementary lattice:\")\n",
" display(is_elem)\n",
" return 0\n",
" end\n",
" #display(\"This is a p-elementary lattice.\")\n",
"\n",
" D_L = discriminant_group(lat)\n",
" display(D_L)\n",
" Q = D_L.gram_matrix_quadratic\n",
" G = D_L.ab_grp\n",
" #display(G)\n",
"\n",
" #display(\"Computing r..\")\n",
" r = rank(lat)\n",
"\n",
" #display(\"Computing a..\")\n",
" a = length( filter(x -> x == 2, elementary_divisors(G)) )\n",
"\n",
" #display(\"Computing delta...\")\n",
" \n",
" n = minimum(size(Q))\n",
" diags = [ Q[i, i] for i in 1:n ]\n",
" #show(\"Diagonal of Q:\")\n",
" #show(diags)\n",
" are_diags_ints = map(is_integer, diags)\n",
" all_integer_diags = reduce(&, are_diags_ints)\n",
" # = 1 if all integers, = 0 if any non-integer \n",
" \n",
" delta = 1 - all_integer_diags\n",
" # delta = 0 <=> image in Z, dellta=1 <=> non-integral image\n",
"\n",
" display(\"------------------------------------\")\n",
" \n",
" return (r, a, delta)\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 78,
"id": "a2eb443b-5ff4-4c4b-9746-6a3a7c568811",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^2\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2]\n",
"[1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(2, 2, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^10\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2 0 0 0 0 0 0 0 0]\n",
"[1//2 0 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 1//2 0 0 0 0 0 1//2]\n",
"[ 0 0 1//2 1 0 0 0 0 0 0]\n",
"[ 0 0 0 0 1 0 0 0 0 1//2]\n",
"[ 0 0 0 0 0 0 1//2 0 1//2 0]\n",
"[ 0 0 0 0 0 1//2 0 0 0 1//2]\n",
"[ 0 0 0 0 0 0 0 1 1//2 0]\n",
"[ 0 0 0 0 0 1//2 0 1//2 1 1//2]\n",
"[ 0 0 1//2 0 1//2 0 1//2 0 1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(10, 10, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^8\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2 0 0 0 0 0 1//2]\n",
"[1//2 1 0 0 0 0 0 0]\n",
"[ 0 0 1 0 0 0 0 1//2]\n",
"[ 0 0 0 0 1//2 0 1//2 0]\n",
"[ 0 0 0 1//2 0 0 0 1//2]\n",
"[ 0 0 0 0 0 1 1//2 0]\n",
"[ 0 0 0 1//2 0 1//2 1 1//2]\n",
"[1//2 0 1//2 0 1//2 0 1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(14, 8, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^2\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2]\n",
"[1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(20, 2, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^10\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2 0 0 0 0 0 0 0 0]\n",
"[1//2 0 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 1//2 0 0 0 0 0 1//2]\n",
"[ 0 0 1//2 1 0 0 0 0 0 0]\n",
"[ 0 0 0 0 1 0 0 0 0 1//2]\n",
"[ 0 0 0 0 0 0 1//2 0 1//2 0]\n",
"[ 0 0 0 0 0 1//2 0 0 0 1//2]\n",
"[ 0 0 0 0 0 0 0 1 1//2 0]\n",
"[ 0 0 0 0 0 1//2 0 1//2 1 1//2]\n",
"[ 0 0 1//2 0 1//2 0 1//2 0 1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(12, 10, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^8\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2 0 0 0 0 0 1//2]\n",
"[1//2 1 0 0 0 0 0 0]\n",
"[ 0 0 1 0 0 0 0 1//2]\n",
"[ 0 0 0 0 1//2 0 1//2 0]\n",
"[ 0 0 0 1//2 0 0 0 1//2]\n",
"[ 0 0 0 0 0 1 1//2 0]\n",
"[ 0 0 0 1//2 0 1//2 1 1//2]\n",
"[1//2 0 1//2 0 1//2 0 1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"\"------------------------------------\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(8, 8, 0)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display( rad_invts(Sdp) )\n",
"display( rad_invts( Sen ) )\n",
"display( rad_invts( Lnikp ) )\n",
"\n",
"display( rad_invts( Tdp ) )\n",
"display( rad_invts( Ten ) )\n",
"display( rad_invts( Lnikm ) )"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "92c284c1-d5c2-449c-820f-a6fe22916d52",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(true, 2)"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lat = Lnikp\n",
"is_elem = is_elementary_with_prime(lat)\n",
"if is_elem[1] == false || is_elem[2] != 2\n",
" display(\"Not a 2-elementary lattice:\")\n",
" display(is_elem)\n",
" return 0\n",
"end\n",
"is_elem"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "1e772ed7-fa85-4406-b412-0e233a4fe86d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Finite quadratic module\n",
" over integer ring\n",
"Abelian group: (Z/2)^8\n",
"Bilinear value module: Q/Z\n",
"Quadratic value module: Q/2Z\n",
"Gram matrix quadratic form: \n",
"[ 0 1//2 0 0 0 0 0 1//2]\n",
"[1//2 1 0 0 0 0 0 0]\n",
"[ 0 0 1 0 0 0 0 1//2]\n",
"[ 0 0 0 0 1//2 0 1//2 0]\n",
"[ 0 0 0 1//2 0 0 0 1//2]\n",
"[ 0 0 0 0 0 1 1//2 0]\n",
"[ 0 0 0 1//2 0 1//2 1 1//2]\n",
"[1//2 0 1//2 0 1//2 0 1//2 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(Z/2)^8"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"D_L = discriminant_group(lat);\n",
"display(D_L)\n",
"G = D_L.ab_grp;\n",
"display(G)\n",
"Q = D_L.gram_matrix_quadratic;"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "277d4964-35bb-4295-ab56-e1fee52bd5b4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"D_L = discriminant_group(lat)\n",
"Q = D_L.gram_matrix_quadratic\n",
"G = D_L.ab_grp\n",
"\n",
"# Computing r\n",
"r = rank(lat)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d482d7b7-f2fe-4e83-b376-ec8293105c22",
"metadata": {},
"outputs": [],
"source": [
"# Computing a\n",
" a = length( filter(x -> x == 2, elementary_divisors(G)) )"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bce8b460-bef0-40bd-8767-fdd79fe55717",
"metadata": {},
"outputs": [],
"source": [
"n = minimum(size(Q))\n",
"diags = [ Q[i, i] for i in 1:n ]\n",
"#show(\"Diagonal of Q:\")\n",
"#show(diags)\n",
"are_diags_ints = map(is_integer, diags)\n",
"all_integer_diags = reduce(&, are_diags_ints)\n",
"# = 1 if all integers, = 0 if any non-integer "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e4704912-cc55-4543-a26a-2b827cde6f94",
"metadata": {},
"outputs": [],
"source": [
"Q"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d40a6e0d-718d-4623-b609-57bf2edc4337",
"metadata": {},
"outputs": [],
"source": [
"delta = 1 - all_integer_diags\n",
" # delta = 0 <=> image in Z, dellta=1 <=> non-integral image"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "59a9a910-b644-4fd1-9715-ee18815619fe",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "2ca6e741-8e0c-4786-85aa-0f4f5fe00259",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.10.3",
"language": "julia",
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.10.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}