Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Heavy square code to generators #313

Merged
merged 23 commits into from
Aug 23, 2021
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
add reference on the docs
nahumsa committed Jul 24, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bee8ec86c73a46abbca9db712e26df330dd52871
20 changes: 19 additions & 1 deletion src/generators.rs
Original file line number Diff line number Diff line change
@@ -1072,7 +1072,25 @@ pub fn directed_binomial_tree_graph(
})
}

/// Generate an undirected heavy square graph.
/// Generate an undirected heavy square graph. Fig. 6 of
/// https://arxiv.org/abs/1907.09528.
/// An ASCII diagram of the graph is given by:
///
/// ... S ...
/// \ / \
/// ... D D D ...
/// | | |
/// ... F-S-F-S-F-...
/// | | |
/// ... D D D ...
/// | | |
/// ... F-S-F-S-F-...
/// | | |
/// .........
/// | | |
/// ... D D D ...
/// \ / \
/// ... S ...
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a variant of the heavy square lattice (see Fig 10.b, right-hand side) whose edge case handling (lines 1054-1075 in the present PR) is a bit different. No comment on whether it's worth including as an option, but it is definitely worth mentioning in the docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any suggestion how this can be mentioned in the docstring?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only important thing is to bring to the reader's attention that there is another variant and to disambiguate which you mean. So, something like:

NOTE: This function generates the four-frequency variant of the heavy square code. See Fig 10.b left of /1907.09528 , and compare Fig 10.b right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note was added on 60a150b.

/// :param int d: distance of the code.
/// :param bool multigraph: When set to False the output