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

Resolve error from texted-based circuit drawer for tapes #1994

Merged
merged 7 commits into from
Dec 8, 2021

Conversation

dime10
Copy link
Contributor

@dime10 dime10 commented Dec 7, 2021

Context:
As discovered in issue #1967, the text-based circuit drawer throws an error when the operations list of a circuit contains a tape. This can happen manually when nesting a tape inside a circuit or tape, e.g.:

import pennylane as qml

dev = qml.device("default.qubit", wires=3)

@qml.qnode(dev)
def qpe_circuit():
    with qml.tape.QuantumTape():
        qml.PauliX(0)
        qml.CNOT(wires=[0,2])
    qml.Hadamard(1)
    return qml.state()

print(qml.draw(qpe_circuit)())

but also when an operation needs to be decomposed before printing, such as an adjoint template without a defined .adjoint() method that manipulates the .inv attribute instead, e.g. (v0.19.0 only, fixed in current dev branch):

dev = qml.device("default.qubit", wires=2)

@qml.qnode(dev)
def qpe_circuit():
    qml.adjoint(qml.QuantumPhaseEstimation)(
        qml.PauliX.matrix,
        target_wires=[0],
        estimation_wires=[1],
    )
    return qml.state()

print(qml.draw(qpe_circuit)())

Description of the Change:
The issue is resolved by adding support for drawing tapes as operations to the circuit drawer.
The contents of the tape are also drawn separately and attached to the main circuit drawing in a manner similar to how matrix arguments are already included.
Nested tapes are also supported and rendered by recursive traversal, e.g.:

@qml.qnode(dev)
def qpe_circuit():
    with qml.tape.QuantumTape():
        qml.PauliX(0)
        qml.CNOT(wires=[0,2])
        with qml.tape.QuantumTape():
            qml.QuantumPhaseEstimation(qml.PauliY.matrix, target_wires=[1], estimation_wires=[2])
            qml.CNOT(wires=[1,2])
    qml.Hadamard(1)
    with qml.tape.QuantumTape():
        qml.SWAP(wires=[0,1])
    return qml.state()

is drawn as:

 0: ──╭QuantumTape:T0─────╭QuantumTape:T1──╭┤ State 
 1: ──├QuantumTape:T0──H──╰QuantumTape:T1──├┤ State 
 2: ──╰QuantumTape:T0──────────────────────╰┤ State 
T0 =
 0: ──X──╭C───────────────────┤  
 2: ─────╰X──╭QuantumTape:T2──┤  
 1: ─────────╰QuantumTape:T2──┤  
T2 =
 1: ──╭QuantumPhaseEstimation(M0)──╭C──┤  
 2: ──╰QuantumPhaseEstimation(M0)──╰X──┤  
M0 =
[[ 0.+0.j -0.-1.j]
 [ 0.+1.j  0.+0.j]]


T1 =
 0: ──╭SWAP──┤  
 1: ──╰SWAP──┤  

Benefits: No errors are thrown when the drawer attempts to render a tape.

Possible Drawbacks:

Related GitHub Issues: Closes #1967

Tapes appearing in the operations list of circuits (or other tapes) are
now drawn as an opaque tape object, and its contents are appended to the
circuit drawing as a subcircuit.
When a circuit to be printed contains tapes nested within, the index
printed to identify each tape, matrix argument, etc. is now passed to
lower levels of nesting (and passed back up) to retain unique names for
circuit elements.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2021

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.

@antalszava antalszava self-requested a review December 7, 2021 17:03
@codecov
Copy link

codecov bot commented Dec 7, 2021

Codecov Report

❗ No coverage uploaded for pull request base (v0.20.0-rc0@1472c87). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             v0.20.0-rc0    #1994   +/-   ##
==============================================
  Coverage               ?   99.12%           
==============================================
  Files                  ?      221           
  Lines                  ?    16790           
  Branches               ?        0           
==============================================
  Hits                   ?    16643           
  Misses                 ?      147           
  Partials               ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1472c87...f9dd849. Read the comment docs.

Copy link
Contributor

@antalszava antalszava 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 resolving this @dime10 🌟 😍

Had a couple of suggestions, but nothing blocking. 👍

@@ -59,23 +59,24 @@ def __init__(
charset=None,
show_all_wires=False,
max_length=None,
_offsets=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

A docstring entry is missing for this argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was wondering if we exclude it from the public API somehow as it's only used internally but I'll add a docstring :)

pennylane/drawer/representation_resolver.py Outdated Show resolved Hide resolved
pennylane/drawer/representation_resolver.py Outdated Show resolved Hide resolved


class RepresentationResolver:
"""Resolves the string representation of PennyLane objects.

Args:
charset (CharSet, optional): The CharSet to be used for representation resolution.
offsets (dict(string, int), optional): Offset the printed index of different symbol types in nested circuits.
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor suggestion: may be good to rename this argument to make it more descriptive: e.g., custom_offsets or offset_per_unit or something better 😄 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about label_offsets?

from .circuit_drawer import CircuitDrawer

grid, obs = op.graph.greedy_layers()
charset_string = next((k for k, v in CHARSETS.items() if v is self.charset), None)
Copy link
Contributor

Choose a reason for hiding this comment

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

How come we'd need a generator solution, would this line correspond to something like this?

charset_string = self.charset if self.charset in CHARSETS else None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah originally I was using tape.draw() which only accepts a string descriptor of the charset (self.charset stores the charset class), but since I'm using CircuitDrawer directly now this can be removed. The generator construct is just one way to reverse a dictionary mapping (CHARSETS is a dictionary of {string: class}).

@dime10
Copy link
Contributor Author

dime10 commented Dec 8, 2021

Thanks a lot for your review @antalszava :)

@dime10 dime10 merged commit c76b0fa into v0.20.0-rc0 Dec 8, 2021
@dime10 dime10 deleted the issue_1967 branch December 8, 2021 15:27
@dime10
Copy link
Contributor Author

dime10 commented Dec 8, 2021

[sc-11982]

antalszava added a commit that referenced this pull request Dec 9, 2021
* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

* Resolve error from texted-based circuit drawer for tapes (#1994)

* Add support for drawing tapes to textdrawer

Tapes appearing in the operations list of circuits (or other tapes) are
now drawn as an opaque tape object, and its contents are appended to the
circuit drawing as a subcircuit.

* Fix charset of tape subcircuits

* Add persistent indices to ops in nested circuits

When a circuit to be printed contains tapes nested within, the index
printed to identify each tape, matrix argument, etc. is now passed to
lower levels of nesting (and passed back up) to retain unique names for
circuit elements.

* Add tests for drawing nested tapes

* Changelog

* Review: docstrings, arg name, generator

* Make multi_dispatch treat scipy same as numpy (#2001)

* Make multi_dispatch treat scipy same as numpy

* Changelog

* Add test to assert warning is no longer raised

* Use pytest.mark instead of warnings module for filter

Adding a warning filter using the warnings module seems to persist
across unit tests.

* Remove empty circuits and device tests to check supported operations  (#1979)

* check supported operations in more places

* add PauliX to measurment qnodes

* Incrementing the version number to `0.21.0-dev` (#1988)

* changelogs

* changelog

* version number bumps

* clean changelog file

* RC to master (#1995)

* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* eliminate empty circuits, minor rewriting

* black, changelog, fix probs

* fix merging with rc branch

* state non empty circuit

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

* Update pennylane/drawer/representation_resolver.py

* Update pennylane/drawer/representation_resolver.py

* have a single self.label_offsets dictionary for linting purposes

* organize tape drawing into its own method

* no too many return statements check

* format

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>
antalszava added a commit that referenced this pull request Dec 10, 2021
* Merge release candidate into master (#2003)

* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

* Resolve error from texted-based circuit drawer for tapes (#1994)

* Add support for drawing tapes to textdrawer

Tapes appearing in the operations list of circuits (or other tapes) are
now drawn as an opaque tape object, and its contents are appended to the
circuit drawing as a subcircuit.

* Fix charset of tape subcircuits

* Add persistent indices to ops in nested circuits

When a circuit to be printed contains tapes nested within, the index
printed to identify each tape, matrix argument, etc. is now passed to
lower levels of nesting (and passed back up) to retain unique names for
circuit elements.

* Add tests for drawing nested tapes

* Changelog

* Review: docstrings, arg name, generator

* Make multi_dispatch treat scipy same as numpy (#2001)

* Make multi_dispatch treat scipy same as numpy

* Changelog

* Add test to assert warning is no longer raised

* Use pytest.mark instead of warnings module for filter

Adding a warning filter using the warnings module seems to persist
across unit tests.

* Remove empty circuits and device tests to check supported operations  (#1979)

* check supported operations in more places

* add PauliX to measurment qnodes

* Incrementing the version number to `0.21.0-dev` (#1988)

* changelogs

* changelog

* version number bumps

* clean changelog file

* RC to master (#1995)

* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* eliminate empty circuits, minor rewriting

* black, changelog, fix probs

* fix merging with rc branch

* state non empty circuit

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

* Update pennylane/drawer/representation_resolver.py

* Update pennylane/drawer/representation_resolver.py

* have a single self.label_offsets dictionary for linting purposes

* organize tape drawing into its own method

* no too many return statements check

* format

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>

* Style2

Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>
antalszava added a commit that referenced this pull request Dec 14, 2021
* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

* Resolve error from texted-based circuit drawer for tapes (#1994)

* Add support for drawing tapes to textdrawer

Tapes appearing in the operations list of circuits (or other tapes) are
now drawn as an opaque tape object, and its contents are appended to the
circuit drawing as a subcircuit.

* Fix charset of tape subcircuits

* Add persistent indices to ops in nested circuits

When a circuit to be printed contains tapes nested within, the index
printed to identify each tape, matrix argument, etc. is now passed to
lower levels of nesting (and passed back up) to retain unique names for
circuit elements.

* Add tests for drawing nested tapes

* Changelog

* Review: docstrings, arg name, generator

* Make multi_dispatch treat scipy same as numpy (#2001)

* Make multi_dispatch treat scipy same as numpy

* Changelog

* Add test to assert warning is no longer raised

* Use pytest.mark instead of warnings module for filter

Adding a warning filter using the warnings module seems to persist
across unit tests.

* Remove empty circuits and device tests to check supported operations  (#1979)

* check supported operations in more places

* add PauliX to measurment qnodes

* Incrementing the version number to `0.21.0-dev` (#1988)

* changelogs

* changelog

* version number bumps

* clean changelog file

* RC to master (#1995)

* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* eliminate empty circuits, minor rewriting

* black, changelog, fix probs

* fix merging with rc branch

* state non empty circuit

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

* Update pennylane/drawer/representation_resolver.py

* Update pennylane/drawer/representation_resolver.py

* have a single self.label_offsets dictionary for linting purposes

* organize tape drawing into its own method

* no too many return statements check

* format

* [WIP] Jit probs bug (#1998)

* trying to use jax unique function to allow for compilation

* testing

* Overrided the estimate_probability method in the default_qubit_jax
device to allow for jit-ing when working with qml.probs

* Apply suggestions from code review

* missed comment

* lint

* Added tests

* fixed bug with fill value

* cleaning up

* Fix missing function call in metric tensor example (#2008)

* Update docs of `qml.fourier.reconstruct` and `qml.QubitDensityMatrix` (#2005)

* reconstruct fixes

* QubitDensityMatrix fix

* revert merge master commit

* minor doc fixes (#2009)

* fix typo in CVNeuralNetLayers UsageDetails

* Fix some minor doc example for drawer (#2010)

* Merge release candidate into master (#2003)

* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

* Resolve error from texted-based circuit drawer for tapes (#1994)

* Add support for drawing tapes to textdrawer

Tapes appearing in the operations list of circuits (or other tapes) are
now drawn as an opaque tape object, and its contents are appended to the
circuit drawing as a subcircuit.

* Fix charset of tape subcircuits

* Add persistent indices to ops in nested circuits

When a circuit to be printed contains tapes nested within, the index
printed to identify each tape, matrix argument, etc. is now passed to
lower levels of nesting (and passed back up) to retain unique names for
circuit elements.

* Add tests for drawing nested tapes

* Changelog

* Review: docstrings, arg name, generator

* Make multi_dispatch treat scipy same as numpy (#2001)

* Make multi_dispatch treat scipy same as numpy

* Changelog

* Add test to assert warning is no longer raised

* Use pytest.mark instead of warnings module for filter

Adding a warning filter using the warnings module seems to persist
across unit tests.

* Remove empty circuits and device tests to check supported operations  (#1979)

* check supported operations in more places

* add PauliX to measurment qnodes

* Incrementing the version number to `0.21.0-dev` (#1988)

* changelogs

* changelog

* version number bumps

* clean changelog file

* RC to master (#1995)

* Fix metric tensor for circuits with inverted gates (#1987)

* fix metric tensor for inverse gates

* changelog

* modify test for block diagonal

* undo tmp change

* AmplitudeEmbedding: Fix warning from implicit cast of complex to real (#1990)

* Fix warning from implicit cast of complex to real

* Changelog

* Fix warning without failing other tests

* V0.20.0: remove deprecated features (#1981)

* remove the decorator

* remove the decorator tests

* remove the remaining template decorator use

* Remove the default.tensor devices

* no mention of default.tensor.tf

* remove fourier.spectrum

* no default.tensor entry points

* no beta devices ref in docs

* remove the diag_approx keyword argument of qml.metric_tensor and qml.QNGOptimizer

* changelog

* changelog formatting

* Remove the metric_tensor method of the old QNode; remove tests and adjust an example for QNG

* remove unused variable

* Fix error mitigation tests

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* eliminate empty circuits, minor rewriting

* black, changelog, fix probs

* fix merging with rc branch

* state non empty circuit

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

* Update pennylane/drawer/representation_resolver.py

* Update pennylane/drawer/representation_resolver.py

* have a single self.label_offsets dictionary for linting purposes

* organize tape drawing into its own method

* no too many return statements check

* format

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>

* Style2

Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>

* Tape validation for the JAX interface (batch execute) (#2011)

* add tape validation to the JAX interface to provide users with a descriptive error message

* formatting

* changelog

* Fix behaviour of `qml.gradients.gradient_transform` for multiple array arguments (#1989)

* Fix gradient_transform for complex QNode shapes

Previously, the gradient transform did not account for the shape of
classical jacobians produced by `qml.jacobian` for complex QNode
argument scenarious, leading to a shape mismatch error during tensor
contraction of the classical and quantum jacobian. This is resolved by
distinguishing between the case of a single classical Jacobian for a
single QNode argument, and multiple classical Jacobians stacked together
when all QNode arguments have the same shape. The two cases require
different tensor manipulations as `qml.jacobian` behaves differently in
each.

Two test cases are added that include multiple vector arguments to a
QNode and non-trainable QNode arguments mixed with trainable ones.

* Format

* Changelog

* Fix coverage

by removing some "fallback" branches and adding dummy test.

* Update doc/releases/changelog-dev.md

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Review: small corrections

* Proposal: leave old behaviour as fallback branch

* Review: remove tf & torch logic, comment

* Review: raise warning for unknown cjac shape

Co-authored-by: Antal Szava <antalszava@gmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Fix docstrings for `CommutingEvolution` (#2012)

* Example and docstrings

* Undo.

* Use the correct GPU device internally with `default.qubit.torch` (#1982)

* changes

* format

* docstring

* lint

* Update pennylane/devices/default_qubit_torch.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/devices/default_qubit_torch.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* no cover; extend docstring

* format; correct typo

* revert

* no cover for GPU part

* format

Co-authored-by: Christina Lee <christina@xanadu.ai>

* updated docstring example (#2019)

* Fix Barrier example

* `v0.20.0` release notes (#1977)

* current release

* rename latest changelog

* reorder the entries, create sections

* version, release notes file

* Update doc/releases/changelog-0.20.0.md

* Update doc/releases/changelog-0.20.0.md

Co-authored-by: Josh Izaac <josh146@gmail.com>

* Update doc/releases/changelog-0.20.0.md

Co-authored-by: Josh Izaac <josh146@gmail.com>

* init module: breaking

* Apply suggested changes

* Apply suggested changes

* rendering issues

* mutable kwarg

* apply suggestions

* move to breaking changes

* Lie opt example

* Update doc/releases/changelog-0.20.0.md

Co-authored-by: Josh Izaac <josh146@gmail.com>

* transformation example in the notes

* updates

* Fix examples

* fix refs

* contributors

* More PRs listed

* PauliError

* PauliError

* custom ops as attribute

* Update changelog-0.20.0.md

* Update changelog-0.20.0.md

Co-authored-by: Josh Izaac <josh146@gmail.com>

* readd changelog item

* correct version numbers

* nl

* disallow qml.probs with default.qubit.jax when using a shot vector

* no else

Co-authored-by: David Wierichs <davidwierichs@gmail.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Romain <rmoyard@gmail.com>
Co-authored-by: Josh Izaac <josh146@gmail.com>
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.

None yet

2 participants