Skip to content

Rename simulate_pattern and simulate_statevector into simulate#567

Open
thierry-martinez wants to merge 5 commits into
TeamGraphix:masterfrom
thierry-martinez:rename-simulate
Open

Rename simulate_pattern and simulate_statevector into simulate#567
thierry-martinez wants to merge 5 commits into
TeamGraphix:masterfrom
thierry-martinez:rename-simulate

Conversation

@thierry-martinez

@thierry-martinez thierry-martinez commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

This PR renames the methods Pattern.simulate_pattern and Circuit.simulate_statevector to simulate.

The new names are more appropriate than the previous ones:

Moreover, using the same simulate method name for both Pattern and Circuit makes 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 Circuit and Pattern with :members:, allowing more methods to be included automatically in the API reference. Along the way, a few docstrings have also been fixed.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (2d437e0) to head (f859d2d).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matulni matulni 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.

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.statevec to graphix.transpiler.SimulateResult.result or graphix.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_target is not used anywhere. This PR may be a good place to remove this dead code.

@pranav97nair pranav97nair 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.

LGTM, thanks for this update Thierry!

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.

3 participants