Comments (3)
Hi @waelitani ,
The order in which you add the decorators is very important. The @qml.qnode(dev)
decorator should always be placed immediately above your quantum function. Then you can add other transforms above the QNode decorator. I tried it and it fixed the issue. let me know if it works for you!
from pennylane.
Placing the the qml.qnode decorator closest to the function definition seems to render the transform decorator ineffective. For example, adding @qml.transforms.broadcast_expand
above it, would still throw the error:
ValueError: Broadcasting with MottonenStatePreparation is not supported. Please use the qml.transforms.broadcast_expand transform to use broadcasting with MottonenStatePreparation.
when using, say AmplitudeEmbedding
, with the the lightning.qubit
device.
I am not certain if this would be fixed by preserving the call signature, as fixed by 5857.
from pennylane.
This would tie into Issue #4460, which is a separate long standing issue we are needing to solve.
This may also tie into the fact we do gradient preprocessing before user transforms. I'll look into that.
from pennylane.
Related Issues (20)
- [BUG] Second-oder derivatives fail with shots enabled for product of input variables HOT 1
- [BUG] `split_non_commuting` is not differentiable with trainable observables
- [BUG] hadamard gradient does not work with wires-broadcasted measurements
- [BUG] Precision error in two-qubit decomposition of qml.QubitUnitary HOT 10
- Add an `is_pure` method in `qml.math.quantum` for quick purity checks on density matrices HOT 3
- [BUG] split_non_commuting not used when running qml.var HOT 3
- [BUG] Incorrect answers from qml.var due to sum hashing
- [BUG] Controlled time evolution with `lightning.qubit` gives incorrect results
- [BUG] Using qml.apply on measurementProcess separated by commas returns () HOT 1
- Device support for `ExpecationMP` with eigvals and wires representation
- [BUG] Calculating the matrix of a broadcasted `GlobalPhase` with wires
- Improve decomposition in ``TrotterProduct``
- Add matrix support for fermionic objects
- [BUG][QUESTION] Cutting: Correctness of `qcut_processing_fn_sample`. HOT 2
- [BUG] Metric tensor fails under certain combinations of device and differentiation method HOT 1
- [BUG] QNGO doesn't work with circuits that take more than one argument HOT 1
- [BUG] Switching device from default.qubit to qiskit.aer makes workflow non-differentiable HOT 4
- [BUG] `dynamic_one_shot` sample probability not always bounded by 1.
- [BUG] HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pennylane.