Skip to content

GraphvizCallGraph.from_bloq #1254

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

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

mpharrigan
Copy link
Collaborator

This adds a new factory method GraphvizCallGraph.from_bloq that will set up a nice call graph for you

  • It takes a bloq, and will generate the networkx call graph
  • It will query QECGatesCost and QubitCount
  • It will take those two things and draw them in a nice way. I added class methods to format the cost values, which could theoretically be overridden by an intrepid customizer.

Some drive-by improvements to handling symbolics in GateCounts.

I've also modified the show_call_graph convenience function to dispatch based on the input type: If it's a graph (like before) it will use the previous code path (which will eventually be deprecated when I go through and make sure all the bloqs have good-enough __str__ values). If a bloq is provided, it will use the new functionality. Watching some new users: It seems like people expected to be able to pass a bloq to show_call_graph and have it show the call graph.

@mpharrigan mpharrigan enabled auto-merge (squash) August 8, 2024 00:01
@mpharrigan mpharrigan merged commit dd3d2fa into quantumlib:main Aug 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants