Skip to content

Integrate petgraph#28

Merged
daehiff merged 1 commit into
mainfrom
integrate-petgraph
Jun 10, 2025
Merged

Integrate petgraph#28
daehiff merged 1 commit into
mainfrom
integrate-petgraph

Conversation

@daehiff

@daehiff daehiff commented Mar 31, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread Cargo.toml Outdated
Comment thread benches/connectivity.rs
Comment thread src/architecture/connectivity.rs Outdated
Comment thread Cargo.toml Outdated
Comment thread benches/connectivity.rs
@daehiff daehiff requested review from Aerylia and Copilot and removed request for Copilot April 2, 2025 05:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates petgraph into the project by removing legacy architectures (Line and Complete) and consolidating functionality into a new Connectivity implementation that leverages petgraph’s algorithms. Key changes include:

  • Removal of src/architecture/line.rs and src/architecture/complete.rs.
  • Implementation and enhancement of Connectivity with new functions for line, grid, and complete architectures as well as CX ladder extraction.
  • Updates to tests, benchmarks, and Cargo.toml to support petgraph and related dependencies.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/architecture/line.rs Entirely removed to consolidate architecture implementations into Connectivity.
src/architecture/connectivity.rs Added petgraph integration, new connectivity constructors (line, grid, complete), and CX ladder extraction API.
src/architecture/complete.rs Removed as its functionality is replaced by Connectivity.
src/architecture.rs Updated to include the new LadderError enum and an extended Architecture trait.
benches/connectivity.rs Added benchmarks for new connectivity functionality.
benches/clifford_tableau.rs Updated benchmark configuration to include connectivity benchmarks.
Cargo.toml Adjusted petgraph dependency revision and added the rand dependency.
Comments suppressed due to low confidence (3)

src/architecture/connectivity.rs:326

  • Using .sort() inline in the assertion causes both sides to evaluate to () since .sort() sorts in place. Consider assigning the result to a mutable variable, sorting it, and then comparing the sorted vectors.
                .unwrap().sort(),

src/architecture/connectivity.rs:367

  • Calling .sort() here returns unit; this could lead to improper test comparisons. Refactor the test to sort the returned vector separately before the assertion.
                .unwrap().sort(),

src/architecture/connectivity.rs:378

  • The inline use of .sort() results in a unit value, which makes the comparison invalid. Store the ladder results in a mutable variable, sort them, and then perform the equality check.
                .unwrap().sort(),

@daehiff daehiff force-pushed the integrate-petgraph branch from c5ce2fc to 59b7436 Compare April 2, 2025 06:06
@daehiff daehiff requested a review from Copilot April 8, 2025 07:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/architecture/connectivity.rs:316

  • The use of .sort() directly in the assert_eq! call is problematic because .sort() returns () instead of the sorted vector. Consider assigning the ladder outputs to mutable variables, sorting them, and then comparing the sorted vectors.
new_architecture.get_cx_ladder(&vec![1, 2, 3, 4], &2).unwrap().sort(),

Comment thread src/architecture/connectivity.rs Outdated
Comment thread src/architecture/connectivity.rs
Comment thread src/architecture/connectivity.rs
Comment thread src/architecture.rs Outdated

@Aerylia Aerylia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some minor comments regarding function signatures end tests

Comment thread src/architecture.rs
Comment thread src/architecture/connectivity.rs
Comment thread src/architecture/connectivity.rs
Comment thread src/architecture/connectivity.rs
Signed-off-by: daehiff <winderl13@gmail.com>
@daehiff daehiff force-pushed the integrate-petgraph branch from 3ebed56 to 8031626 Compare June 10, 2025 21:35
@daehiff daehiff merged commit 3bd6776 into main Jun 10, 2025
2 checks passed
@Aerylia Aerylia deleted the integrate-petgraph branch November 4, 2025 16:21
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.

4 participants