{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The La Jolla Circulant Weighing Matrix Repository\n", "\n", "This page is a jupyter notebook which allows users to access the data.\n", "\n", "A *circulant weighing matrix* is an $n \\times n$ matrix $W$ with entries from $\\{0, \\pm 1 \\}$ where each row is a cyclic shift of the one before, and \n", "\n", "$$W W^T = kI_n.$$\n", "Tan gave tables with existence results for $n \\leq 200$ and $k \\leq 100$. Arasu, Gordon and Zhang settled 12 of 34 open cases. \n", "\n", "This Jupyter notebook gives access to a database of known circulant weighing matrices and existence results for $n \\leq 1000$ and $k < 20^2$. To run it, use the binder launch button above.\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "cwparams = pd.read_csv('cwmparams.csv', sep='\t')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "cwparams is a database of known existence results." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
nsStatusReference
042AllEades and Hain
152NoEades and Hain
262AllEades and Hain
372AllEades
482AllEades and Hain
\n", "
" ], "text/plain": [ " n s Status Reference\n", "0 4 2 All Eades and Hain\n", "1 5 2 No Eades and Hain\n", "2 6 2 All Eades and Hain\n", "3 7 2 All Eades\n", "4 8 2 All Eades and Hain" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cwparams.head()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "cwlist = pd.read_csv('cwmlist.csv', sep='\t')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "cwlist is a database of known circulant weighing matrices." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
nsPNReference
0421,2,30Eades and Hain
1621,3,40Eades and Hain
2721,2,40Eades and Hain
3821,4,50Eades and Hain
4822,4,60Eades and Hain
\n", "
" ], "text/plain": [ " n s P N Reference\n", "0 4 2 1,2,3 0 Eades and Hain\n", "1 6 2 1,3,4 0 Eades and Hain\n", "2 7 2 1,2,4 0 Eades and Hain\n", "3 8 2 1,4,5 0 Eades and Hain\n", "4 8 2 2,4,6 0 Eades and Hain" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cwlist.head()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from cwm_code import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "cwm_code.py contains Python functions to access the database." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "No CW(28,3^2)s exist\n", "Reference: Ang, Arasu, Ma and Strassler\n" ] } ], "source": [ "get_status(cwparams,28,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "get_status() checks what is known about some parameters." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "10 CW(28,16)s in database\n", "P: {0,3,5,9,16,17,18,19,23,24},\tN: {1,2,4,10,14,15}\n", "P: {1,2,3,4,8,16,18,19,22,23},\tN: {0,5,9,14,15,17}\n", "P: {0,1,2,9,11,15,18,22,23,25},\tN: {4,7,8,14,16,21}\n", "P: {0,3,4,5,9,17,19,20,22,23},\tN: {1,6,8,14,15,18}\n", "P: {1,2,4,5,8,16,18,21,22,23},\tN: {0,7,9,14,15,19}\n", "P: {0,2,3,5,9,17,18,19,22,23},\tN: {1,4,8,14,15,16}\n", "P: {1,2,4,7,8,15,20,21,22,24},\tN: {0,6,10,14,16,18}\n", "P: {0,1,2,4,7,14,15,20,21,24},\tN: {6,8,10,16,18,22}\n", "P: {0,1,2,4,8,14,15,20,22,24},\tN: {6,7,10,16,18,21}\n", "P: {0,2,4,7,8,14,20,21,22,24},\tN: {1,6,10,15,16,18}\n" ] } ], "source": [ "show(cwlist,28,4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "show() displays all known CW's for a set of parameters." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "C = get_cw(cwlist,28,4,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "get_cw(n,s,i) pulls the $i$th $CW(n,s^2)$ out of the database." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P = [0, 3, 4, 5, 9, 17, 19, 20, 22, 23],\n", "N = [1, 6, 8, 14, 15, 18]\n", "\n", "is a CW(28,4^2)\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "is_cw(C)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "is_cw(C) verifies that $C$ is actually a circulant weighing matrix." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "56\t4\tYes\tArasu et al., 2006\n", "62\t4\tYes\tArasu et al., 2006\n", "70\t4\tYes\tArasu et al., 2006\n", "84\t4\tYes\tArasu et al., 2006\n", "93\t4\tAll\tArasu et al., 2006\n", "98\t4\tYes\tArasu et al., 2006\n", "66\t5\tAll\tArasu and Torban\t 1999\n", "99\t5\tAll\tArasu and Torban\t 1999\n", "91\t6\tYes\tArasu and Seberry (1998)\n" ] } ], "source": [ "n_range = [50,100]\n", "s_range = [4,6]\n", "comment = 'Arasu'\n", "status = ['Yes','All']\n", "search_cwm(cwparams,n_range,s_range,comment,status)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "search_cwm() reproduces the behavior of the original CWM website. It takes a range of $n$ and $s$, comment string and status list, and prints the parameters in the dataset matching the search." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.7.9" } }, "nbformat": 4, "nbformat_minor": 4 }