Skip to content

Conversation

@PietropaoloFrisoni
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni commented Jul 24, 2025

Context: Currently, qml.evolve accepts a num_steps keyword argument, which is intended to control the Trotter decomposition of time evolution. However, on devices like default.qubit that support analytic evolution, this argument is silently ignored. This leads to ambiguous behaviour: users may assume that specifying num_steps explicitly forces Trotterization, but this is not the case.

To resolve this ambiguity, we are remove support for the num_steps argument in qml.evolve and Evolution (making qml.evolve analytic-only).

Note: this deprecation doesn't have a release scheduled for removal yet. Therefore, I just mention that this argument will be removed in a future version

Description of the Change: As above.

[sc-94755]

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@PietropaoloFrisoni PietropaoloFrisoni changed the title Deprecating feature and counting failures Deprecate num_steps in qml.evolve and enforce analytic-only behaviour Jul 24, 2025
@PietropaoloFrisoni PietropaoloFrisoni changed the title Deprecate num_steps in qml.evolve and enforce analytic-only behaviour Deprecate num_steps in qml.evolve Jul 24, 2025
@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (490b913) to head (1014e12).
⚠️ Report is 419 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7954      +/-   ##
==========================================
- Coverage   99.68%   99.68%   -0.01%     
==========================================
  Files         542      542              
  Lines       55622    55628       +6     
==========================================
+ Hits        55449    55454       +5     
- Misses        173      174       +1     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@comp-phys-marc comp-phys-marc left a comment

Choose a reason for hiding this comment

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

Just wondering abut having more examples.

Copy link
Contributor

@JerryChen97 JerryChen97 left a comment

Choose a reason for hiding this comment

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

Would like to hear how people think about remove time @isaacdevlugt @Alex-Preciado
I would say let's just remove it 0.44, unless more concern regarding plugins etc coming up here

Copy link
Contributor

@comp-phys-marc comp-phys-marc left a comment

Choose a reason for hiding this comment

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

LGTM

@PietropaoloFrisoni PietropaoloFrisoni added this pull request to the merge queue Jul 25, 2025
Merged via the queue into master with commit 8c7e294 Jul 25, 2025
54 checks passed
@PietropaoloFrisoni PietropaoloFrisoni deleted the Deprecating_num_steps_evolution branch July 25, 2025 15:10
github-merge-queue bot pushed a commit that referenced this pull request Aug 1, 2025
The `num_steps` argument of `qml.evolve` and `qml.ops.Evolution` has
been deprecated
([here](#7954)). But, the
deprecation warning was added to both functions, even though one
unconditionally calls the other. So, this PR removes the deprecation
warning from `qml.evolve` as the message was identical, and the
deprecation warning from `Evolution` would be raised regardless.

[sc-94755] [sc-96567]

---------

Co-authored-by: Isaac De Vlugt <[email protected]>
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.

5 participants