- 
                Notifications
    You must be signed in to change notification settings 
- Fork 706
          Deprecate qnode call shots= kwarg
          #7906
        
          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
      
      
            JerryChen97
  merged 38 commits into
  master
from
shots-decoupling/deprecate_qnode_call_shots
  
      
      
   
  Jul 24, 2025 
      
    
                
     Merged
            
            
  
    Deprecate qnode call shots= kwarg
  
  #7906
              
                    JerryChen97
  merged 38 commits into
  master
from
shots-decoupling/deprecate_qnode_call_shots
  
      
      
   
  Jul 24, 2025 
              
            Conversation
  
    
      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
    
  
  
    
    | To see who's gonna fail! | 
| Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@            Coverage Diff             @@
##           master    #7906      +/-   ##
==========================================
- Coverage   99.68%   99.68%   -0.01%     
==========================================
  Files         540      540              
  Lines       55386    55389       +3     
==========================================
+ Hits        55214    55216       +2     
- Misses        172      173       +1     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
              
                    JerryChen97
  
              
              commented
              
                  
                    Jul 18, 2025 
                  
              
              
            
            
              
                    JerryChen97
  
              
              commented
              
                  
                    Jul 21, 2025 
                  
              
              
            
            
              
                    albi3ro
  
              
              reviewed
              
                  
                    Jul 22, 2025 
                  
              
              
            
            
              
                    astralcai
  
              
              reviewed
              
                  
                    Jul 22, 2025 
                  
              
              
            
            
              
                    astralcai
  
              
              reviewed
              
                  
                    Jul 22, 2025 
                  
              
              
            
            
    
  JerryChen97 
      added a commit
        to PennyLaneAI/catalyst
      that referenced
      this pull request
    
      Jul 22, 2025 
    
    
      
  
    
      
    
  
**Context:** See PennyLaneAI/pennylane#7906 for on-going deprecation of the shots= kwarg of QNode calls. Now we can use set_shots to assign the shots value to a qnode. **Description of the Change:** `frontend/test/pytest/test_measurements_shots_results.py` **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [[sc-95617](https://app.shortcut.com/xanaduai/story/95617)]
              
                    astralcai
  
              
              approved these changes
              
                  
                    Jul 23, 2025 
                  
              
              
            
            
              
                    albi3ro
  
              
              approved these changes
              
                  
                    Jul 23, 2025 
                  
              
              
            
            
| I'll merge this after the lightning's merges, to try minimizing the impact | 
    
  JerryChen97 
      added a commit
        to PennyLaneAI/pennylane-lightning
      that referenced
      this pull request
    
      Jul 23, 2025 
    
    
      
  
    
      
    
  
**Context:** See PennyLaneAI/pennylane#7906 for on-going deprecation of the `shots=` kwarg of `QNode` calls. Now we can use `set_shots` to assign the shots value to a qnode. **Description of the Change:** Changed two occurences inside `tests/test_native_mcm.py` with to `set_shots` **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [[sc-95617](https://app.shortcut.com/xanaduai/story/95617)] --------- Co-authored-by: ringo-but-quantum <[email protected]>
      
        
      
      
  
    3 tasks
  
    
  JerryChen97 
      added a commit
        to PennyLaneAI/qml
      that referenced
      this pull request
    
      Jul 23, 2025 
    
    
      
  
    
      
    
  
**Title:** **Summary:** Due to deprecation happenning in PennyLaneAI/pennylane#7906 we need to adjust the usages in demos accordingly. **Relevant references:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-95617] ---- If you are writing a demonstration, please answer these questions to facilitate the marketing process. * GOALS — Why are we working on this now? *Eg. Promote a new PL feature or show a PL implementation of a recent paper.* * AUDIENCE — Who is this for? *Eg. Chemistry researchers, PL educators, beginners in quantum computing.* * KEYWORDS — What words should be included in the marketing post? * Which of the following types of documentation is most similar to your file? (more details [here](https://www.notion.so/xanaduai/Different-kinds-of-documentation-69200645fe59442991c71f9e7d8a77f8)) - [x] Tutorial - [ ] Demo - [ ] How-to --------- Co-authored-by: Christina Lee <[email protected]>
  
    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.
  
    
  
    
Context:
Currently, about the
shotssource in the execution, there are three:set_shots,device, andshots=kwarg in qnode call.To smoothify our immigration to
set_shots, before the deprecation of devices' shots setup, we first deprecate the shots on qnode calls.Description of the Change:
Source code:
PennyLaneDeprecationWarningforshots in kwarginQNode.constructwho is the very last step before creatingtapespennylane/optimize/shot_adaptive.pyusesset_shotsinstead of qnode callsset_shotsvalue errors about the specific wrong typesAbout the test suites:
xfail'd and waiting for direct removal next releaseset_shotsBenefits:
One more step of decoupling; make the latter deprecations easier.
Possible Drawbacks:
Ecosys impact should be expected
Related GitHub Issues:
[sc-95617]