Replies: 2 comments 1 reply
-
I think the above code can be modified by changing the base URL to ping @Krastanov So, the modified code is: using HTTP
using Gumbo
using Cascadia
function best_quantum_code(n::Int, k::Int, q::Int; verbose::Bool=false)
if !(q in [2, 3, 4, 5, 7, 8])
throw(ArgumentError("q (= $q) must be in [2, 3, 4, 5, 7, 8]"))
end
if !(1 ≤ n ≤ 256)
throw(ArgumentError("n (= $n) must be in the range 1 ≤ n ≤ 256"))
end
if !(0 ≤ k ≤ n)
throw(ArgumentError("k (= $k) must be in the range 0 ≤ k ≤ n"))
end
# Correct base URL for quantum codes
base_url = "https://codetables.de/QECC.php"
params = "?q=$q&n=$n&k=$k"
url = base_url * params
if verbose
println("Querying URL: $url")
end
response = HTTP.get(url)
if response.status != 200
error("Failed to retrieve data: HTTP status $(response.status)")
end
html_content = String(response.body)
document = parsehtml(html_content)
pre_tags = eachmatch(sel"pre", document.root)
if isempty(pre_tags)
error("Error parsing data: <PRE> tags not found in the response.")
end
pre_content = nodeText(pre_tags[1])
return pre_content
end
function nodeText(node)
text = ""
for child in children(node)
if isa(child, HTMLText)
text *= child.text
else
text *= nodeText(child)
end
end
return text
end Output :) julia> n = 8
8
julia> k = 3
3
julia> code_details = best_quantum_code(n, k, q, verbose=true)
Querying URL: https://codetables.de/QECC.php?q=4&n=8&k=3
"Construction of a [[8,3,3]] quantum code:\n[1]: [[8, 3, 3]] quantum code over GF(2^2)\n Construction from a stored generator matrix\n\n stabilizer matrix:\n\n [1 0 0 0 1 0 1 1|0 0 1 0 1 1 0 1]\n [0 0 0 1 0 1 1 1|1 0 1 0 0 1 1 0]\n [0 1 0 0 1 1 1 0|0 0 1 1 1 0 1 0]\n [0 0 0 1 0 1 1 1|0 1 0 1 1 0 0 1]\n [0 0 1 1 1 0 1 0|0 0 0 1 0 1 1 1]\n\nlast modified: 2005-06-24\n"
julia> println(code_details)
Construction of a [[8,3,3]] quantum code:
[1]: [[8, 3, 3]] quantum code over GF(2^2)
Construction from a stored generator matrix
stabilizer matrix:
[1 0 0 0 1 0 1 1|0 0 1 0 1 1 0 1]
[0 0 0 1 0 1 1 1|1 0 1 0 0 1 1 0]
[0 1 0 0 1 1 1 0|0 0 1 1 1 0 1 0]
[0 0 0 1 0 1 1 1|0 1 0 1 1 0 0 1]
[0 0 1 1 1 0 1 0|0 0 0 1 0 1 1 1]
last modified: 2005-06-24 The above code can be modified to calculate the query the _tables with bounds on quantum codes [[n,k,d]]q |
Beta Was this translation helpful? Give feedback.
-
Having some form of access to these resources would be very valuable but there are multiple issues:
|
Beta Was this translation helpful? Give feedback.
-
Maybe adding a function that queries an online database (codetables.de) and returns the best-known code for a given set of parameters, along with its construction details. Inspired by Sage's Access functions to online databases for coding theory.
The website codetables.de provides comprehensive tables of the best-known linear codes over various finite fields, along with their construction details.
Julia implementation of Sage's functionality of accessing codetables.de
Output:
This feature is a fun addition that may not be strictly necessary 😅 Although, I have read some papers that use this database
codetables.de
so maybe researchers may want to have access to databases to query parameters, bounds on minimum distance, etc. It could be helpful when constructing quantum codes from classical seed codes. Thanks to Eric for bringing up this topic.Beta Was this translation helpful? Give feedback.
All reactions