Skip to content

Integrate petgraph keefefixes#33

Merged
daehiff merged 28 commits into
mainfrom
integrate-petgraph-keefefixes
Jul 4, 2025
Merged

Integrate petgraph keefefixes#33
daehiff merged 28 commits into
mainfrom
integrate-petgraph-keefefixes

Conversation

@keefehuang

@keefehuang keefehuang commented Jun 5, 2025

Copy link
Copy Markdown
Collaborator

Main updates:

  • Cleaned up the code, removing unneeded casts, vec! calls, mut declarations.
  • Added weighted variants of tests for get_cx_ladder to ensure correctness.
  • Reimplemented remove_node and disconnect, utilizing node weights to keep track of actual nodes as node ids are reshuffled every time a node is removed.
    remove_node is a private function that allows the modification of graphs.
    disconnect is added to the Architecture trait, creating a new graph with a single node disconnected as required for synthesis algorithms
    add_node is removed entirely as node id is not consistent, this would require the tracking of the previous max size if we want to ensure single assignment.
  • Updated get_cx_ladder with tests to ensure correctnes with disconnect. Added check to ensure all requested nodes in ladder exist in graph.

daehiff and others added 19 commits April 1, 2025 00:12
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This test does not correctly test for considered weight.
Remove unnecessary mut declarations.
Remove unnecessary vec! calls
Remove unused imports
Remove unneeded casts
Remove unused imports
Test only checks for correct creation.
This Error type is not used in any situation.
The implemented Ungraph reshuffles node ids each time a node is removed.
Hence, a method to track the correct nodes is required.
As we do not use node weights, we can now use these as effective node identifiers.
Updated the function `remove_node` and tests to ensure correct trackable behavior.
Updated the Architecture trait to include `disconnect` as a means to update graphs during synthesis.
Disconnect creates a new Architecture object while leaving the prior Architecture unchanged, as is required for some algorithms.
Added tests to check behavior.
Note that each time a new graph is created, the node order is effectively sorted, though the overall structure remains as expected.
`add_node` is removed as tracking the original size of the circuit is required if we use node weight to track nodes.
The assumption is that we have all available quantum resources from the beginning.
Can be updated in the future for future proofing, but should be good enough for now.
Ensure that the algorithms identifies the best path if it finds one.
The unweighted case has many equivalent solutions, which are bounded by length.
Use node weights to track nodes.
Ensure that an error is thrown if a cx ladder containing non-existant nodes is requested.
Add new LadderError when a node is not found.
@keefehuang keefehuang requested a review from daehiff June 5, 2025 12:12
@daehiff daehiff force-pushed the integrate-petgraph branch from 04eff6c to 3ebed56 Compare June 10, 2025 21:26
Comment thread src/architecture/connectivity.rs

@daehiff daehiff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Generally looks good to me, but the commit history seems messy. Let's merge #28 first?

@daehiff daehiff force-pushed the integrate-petgraph branch from 3ebed56 to 8031626 Compare June 10, 2025 21:35
@daehiff daehiff mentioned this pull request Jun 10, 2025
@daehiff daehiff changed the base branch from integrate-petgraph to main June 10, 2025 22:11
Keefe Huang added 3 commits June 26, 2025 17:11
Update to custom branch of petgraph
Updated variant does not clone graph multiple times when running steiner tree algorithms.
Keefe Huang added 5 commits July 1, 2025 15:51
@daehiff daehiff merged commit d10145f into main Jul 4, 2025
2 checks passed
@Aerylia Aerylia deleted the integrate-petgraph-keefefixes 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.

2 participants