Skip to content
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

ParametrizedEvolution: Use params in super call #3730

Merged
merged 8 commits into from
Feb 7, 2023

Conversation

AlbertMitjans
Copy link
Contributor

Use params in super().__init__ call to update the num_params attribute.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

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.

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for the quick mod!

Could you add a test that checks the difference in behaviour within a tape between a ParametrizedEvolution that has been called and one that hasn't?

pennylane/pulse/parametrized_evolution.py Show resolved Hide resolved
pennylane/pulse/parametrized_evolution.py Outdated Show resolved Hide resolved
tests/pulse/test_parametrized_evolution.py Show resolved Hide resolved
tests/ops/qubit/test_matrix_ops.py Show resolved Hide resolved
pennylane/pulse/parametrized_evolution.py Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #3730 (4e78b04) into master (58d8243) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3730   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files         329      329           
  Lines       28759    28829   +70     
=======================================
+ Hits        28683    28753   +70     
  Misses         76       76           
Impacted Files Coverage Δ
pennylane/math/__init__.py 100.00% <ø> (ø)
pennylane/ops/qubit/parametric_ops.py 99.90% <ø> (ø)
pennylane/math/multi_dispatch.py 100.00% <100.00%> (ø)
pennylane/math/single_dispatch.py 99.70% <100.00%> (+<0.01%) ⬆️
pennylane/ops/qubit/special_unitary.py 100.00% <100.00%> (ø)
pennylane/pulse/parametrized_evolution.py 95.55% <100.00%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Nice idea to return a new operator! I think this makes the handling nicer :)

Just two tiny questions left to approve (see comments).

pennylane/pulse/parametrized_evolution.py Outdated Show resolved Hide resolved
pennylane/math/single_dispatch.py Show resolved Hide resolved
doc/releases/changelog-dev.md Show resolved Hide resolved
Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Thanks @AlbertMitjans !

@AlbertMitjans AlbertMitjans enabled auto-merge (squash) February 7, 2023 14:05
@AlbertMitjans AlbertMitjans merged commit 4c18b94 into master Feb 7, 2023
@AlbertMitjans AlbertMitjans deleted the evolution-parameters branch February 7, 2023 14:14
mudit2812 pushed a commit that referenced this pull request Apr 13, 2023
* ✨ feat (ParametrizedEvolution): Use params as trainable parameters.

* ✏️ chore (changelog): Add changelog entry.

* 🧪 tests (ParametrizedEvolution): change test.

* 🧪 tests (evolve): Fix test.

* 🚀 perf (ParametrizedEvolution): Return a new instance in __call__.

* ✏️ chore (changelog): Add changelog entry.

* 🔧 refactor (ParametrizedEvolution): Improve dict concatenation.

* 🧪 tests (ndim): Add test.
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.

2 participants