Rename simulate_pattern and simulate_statevector into simulate#567
Open
thierry-martinez wants to merge 5 commits into
Open
Rename simulate_pattern and simulate_statevector into simulate#567thierry-martinez wants to merge 5 commits into
simulate_pattern and simulate_statevector into simulate#567thierry-martinez wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #567 +/- ##
=======================================
Coverage 90.58% 90.58%
=======================================
Files 49 49
Lines 7481 7481
=======================================
Hits 6777 6777
Misses 704 704 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
matulni
reviewed
Jul 20, 2026
matulni
left a comment
Contributor
There was a problem hiding this comment.
Thanks a lot for this work, it improves the codebase!
Two comments:
- While we are at it, do you think it would be possible to rename
graphix.transpiler.SimulateResult.statevectographix.transpiler.SimulateResult.resultorgraphix.transpiler.SimulateResult.state(it's more accurate, since it sometimes contains a density matrix object) ? - Not from this PR, but I believe that the function
graphix.transpiler._check_targetis not used anywhere. This PR may be a good place to remove this dead code.
pranav97nair
approved these changes
Jul 22, 2026
pranav97nair
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for this update Thierry!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR renames the methods
Pattern.simulate_patternandCircuit.simulate_statevectortosimulate.The new names are more appropriate than the previous ones:
Pattern.simulate_patternunnecessarily repeated the type in the method name.Circuit.simulate_statevectorhas been inaccurate since Addbackendargument toCircuit.simulate_statevector#512 because the circuit simulator now supports density matrix simulation as well.Moreover, using the same
simulatemethod name for bothPatternandCircuitmakes the API more consistent.This is a step toward a cleaner simulation API, as proposed in #493.
This PR also updates the documentation. It replaces the explicit method listings for
CircuitandPatternwith:members:, allowing more methods to be included automatically in the API reference. Along the way, a few docstrings have also been fixed.