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

Hexagonal graph with consecutive node indices #397

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

georgios-ts
Copy link
Collaborator

Closes #373.

This commit modifies hexagonal_lattice_graph and directed_hexagonal_lattice_graph to create graphs with consecutive node indices. This is possible with minor changes in the logic of the original source code, roughly we should shift the node indexes by one (or two in the last column) except the first column that we don't need a shift.

This is important if we ever use these functions to generate a CouplingMap in terra where the underlying graph assumes consecutive node indices.

@mtreinish mtreinish added this to the 0.10.0 milestone Jul 26, 2021
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1068262658

  • 98 of 102 (96.08%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 96.215%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/generators.rs 98 102 96.08%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 1 97.72%
Totals Coverage Status
Change from base Build 1060816472: -0.004%
Covered Lines: 8491
Relevant Lines: 8825

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for fixing this! Everything LGTM and I tested it locally for a bunch of inputs and it all looked good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

retworkx.generators.hexagonal_lattice_graph does not generate consecutive nodes
3 participants