{"id":51393099,"url":"https://github.com/sona-tau/costas","last_synced_at":"2026-07-04T01:12:06.967Z","repository":{"id":348594200,"uuid":"1195646798","full_name":"sona-tau/costas","owner":"sona-tau","description":"A research repository of Costas arrays and permutation matrices.","archived":false,"fork":false,"pushed_at":"2026-04-02T03:34:05.000Z","size":54164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-02T08:21:58.068Z","etag":null,"topics":["julia","mathematics","permutation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sona-tau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-29T23:07:31.000Z","updated_at":"2026-04-02T03:46:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sona-tau/costas","commit_stats":null,"previous_names":["sona-tau/costas"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sona-tau/costas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sona-tau%2Fcostas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sona-tau%2Fcostas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sona-tau%2Fcostas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sona-tau%2Fcostas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sona-tau","download_url":"https://codeload.github.com/sona-tau/costas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sona-tau%2Fcostas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35106728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["julia","mathematics","permutation"],"created_at":"2026-07-04T01:12:06.406Z","updated_at":"2026-07-04T01:12:06.959Z","avatar_url":"https://github.com/sona-tau.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Costas Permutation Matrices\n\nA database of Costas arrays and related combinatorial data, with tools for\ncomputing and classifying them.\n\n## What is a Costas array?\n\nTake an $n \\times n$ grid. Place $n$ dots so that:\n- every row has exactly one dot, and\n- every column has exactly one dot.\n\nThis is just a permutation matrix. Now add one more rule: if you look at every\npair of dots and measure how far apart they are (both horizontally and\nvertically), all those distance vectors must be distinct.\n\nThat extra rule makes it a **Costas array**. They are rare. For $n = 1$ through\n$n = 5$ you can find them by hand. By $n = 16$ there are $21,104$ of them, and\nfinding them all requires serious computation. Beyond $n = 29$, we do not know\nhow many exist . . .\n\nCostas arrays were originally studied for use in sonar and radar, where their\ndistance property translates to an ideal ambiguity function. They are also\ninteresting as pure combinatorial objects.\n\n## What is in this repo?\n\n### Data (`data/`)\n\nPlain text files, one array per line, space-separated integers. Each line is a\npermutation of $1, 2, \\dots, n$ that satisfies the Costas property.\n\n```txt\n1 2 4 8 5 10 9 7 3 6\n1 2 5 7 3 10 9 6 4 8\n```\n\nThere is not a newline at the end of the file. This makes it easier to parse:\n1. open the file as a really long string\n2. split the string on newlines\n3. split each string on spaces\n4. parse each string as an integer\n\nIn there, you will find ASCII text files:\n- `costas_NxN.txt` all Costas arrays of order N\n- `classes_NxN.txt` all equivalence classes under the dihedral group D4[1]\n- `stabilizers_NxN.txt` arrays that get fixed by at least one non-identity\nelement of D4\n\n- [1]: the equivalence classes are a single array, in this case, the array with\nthe smallest lexicographic value\n\n### Non-square arrays\n\nThis might be a bit strange since Costas arrays of order N have to have N\npoints. In this case, this is a list very similar to the previous, but without\nthe entry: $1$. Because of this, the files are labeled `costas_(N-1)xN.txt`.\n\n\n### Source (`src/`)\n\n- `src/cpp` has a C++ implementation for the search and Costas property[2]\n- `src/julia` has a Julia implementation for the search and also utilities for\nclassification\n- `src/python` helpful tools for dealing with files[2]\n\n- [2]: these files are somewhat old and most of the project deals with Julia\nnow.\n\n### Jupyter Notebooks (`notebooks/`)\n\nThe Jupyter notebooks in this project are used for general research and to\nplay around with the data. No polished documents as of yet - 2026-04-01.\n\n## Data\n\nSimply split on each line and then split on spaces. For example, in Julia you\nwould do something like:\n\n```julia\nparseint = Base.Fix1(parse, int)\n\ncostas_10x10 = map.(parseint, split.(eachline(\"data/costas_10x10.txt\")))\n```\n\n## Verify the data\n\n```bash\nsha256sum --check SHA256SUMS\n```\n\n## Building\n\n```bash\nnix develop # This pulls in all the data\nmake        # This builds the C++ search engine\n```\n\n## Counts\n\n| Order | Costas arrays | D4 orbits |\n|:---:|:---:|:---:|\n| 1 | 1 | 1 |\n| 2 | 2 | 1 |\n| 3 | 4 | 1 |\n| 4 | 12 | 2 |\n| 5 | 40 | 6 |\n| 6 | 116 | 17 |\n| 7 | 200 | 30 |\n| 8 | 444 | 60 |\n| 9 | 760 | 100 |\n| 10 | 2160 | 277 |\n| 11 | 4367 | 555 |\n| 12 | 7852 | 990 |\n| 13 | 12828 | 1616 |\n| 14 | 17252 | 2168 |\n| 15 |       | 2467 |\n| 16 |       | 2648 |\n| 17 |       | 2294 |\n| 18 |       | 1892 |\n| 19 |       | 1283 |\n| 20 |       | 810 |\n\n# Credits\n\nThis work has been done in collaboration with:\n- Gustavo Torres Hance @gustavbit\n- Sergio Rodríguez de Jesús @sergiodrd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsona-tau%2Fcostas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsona-tau%2Fcostas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsona-tau%2Fcostas/lists"}