-
Notifications
You must be signed in to change notification settings - Fork 604
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
V0.14.1 bump #1083
Merged
Merged
V0.14.1 bump #1083
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0aa1f0f
PR 1082
antalszava f8209bb
PR 1072
josh146 be516b8
Update vqe.py (#1077)
antalszava 11e5445
PR 1074
josh146 8c29ac4
Add jax skip (#1066)
trbromley 7474fac
update changelog
josh146 20bd15b
update version number
josh146 63adb9b
Apply suggestions from code review
josh146 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
Version number (major.minor.patch[-label]) | ||
""" | ||
|
||
__version__ = "0.14.0" | ||
__version__ = "0.14.1" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ class Hamiltonian: | |
simplify (bool): Specifies whether the Hamiltonian is simplified upon initialization | ||
(like-terms are combined). The default value is `False`. | ||
|
||
.. seealso:: :class:`~.ExpvalCost`, :func:`~.generate_hamiltonian` | ||
.. seealso:: :class:`~.ExpvalCost`, :func:`~.molecular_hamiltonian` | ||
|
||
**Example:** | ||
|
||
|
@@ -66,7 +66,7 @@ class Hamiltonian: | |
>>> print(H) | ||
(0.8) [Hermitian0'1] | ||
|
||
Alternatively, the :func:`~.generate_hamiltonian` function from the | ||
Alternatively, the :func:`~.molecular_hamiltonian` function from the | ||
:doc:`/introduction/chemistry` module can be used to generate a molecular | ||
Hamiltonian. | ||
""" | ||
|
@@ -90,8 +90,8 @@ def __init__(self, coeffs, observables, simplify=False): | |
"Could not create circuits. Some or all observables are not valid." | ||
) | ||
|
||
self._coeffs = coeffs | ||
self._ops = observables | ||
self._coeffs = list(coeffs) | ||
self._ops = list(observables) | ||
|
||
if simplify: | ||
self.simplify() | ||
|
@@ -396,7 +396,7 @@ class ExpvalCost: | |
callable: a cost function with signature ``cost_fn(params, **kwargs)`` that evaluates | ||
the expectation of the Hamiltonian on the provided device(s) | ||
|
||
.. seealso:: :class:`~.Hamiltonian`, :func:`~.generate_hamiltonian`, :func:`~.map`, :func:`~.dot` | ||
.. seealso:: :class:`~.Hamiltonian`, :func:`~.molecular_hamiltonian`, :func:`~.map`, :func:`~.dot` | ||
|
||
**Example:** | ||
|
||
|
@@ -486,6 +486,10 @@ def __init__( | |
self._multiple_devices = isinstance(device, Sequence) | ||
"""Bool: Records if multiple devices are input""" | ||
|
||
if all(c == 0 for c in coeffs) or not coeffs: | ||
self.cost_fn = lambda *args, **kwargs: np.array(0) | ||
return | ||
Comment on lines
+489
to
+491
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for relocating this! 🚀 |
||
|
||
tape_mode = qml.tape_mode_active() | ||
self._optimize = optimize | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this has already been code reviewed, but for my understanding - we have added the
max_expansion
attribute but have we implemented the effects of changingmax_expansion
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! The change is on line 781,
max_expansion=10
.