Comments (2)
As per discussion, this may be due to a missing conversion prior to calling compute_decomposition
. The following works fine
import pennylane as qml
for num_qubits in range(2, 20):
wires = list(range(num_qubits))
op = qml.MultiControlledX(wires=wires, work_wires=[num_qubits])
print(op.decomposition())
from pennylane.
Yep, that's exactly why. The line that raises an error tries to add a list with a scalar when you directly use compute_decomposition
. When op.decomposition
is used, the control wires are wrapped in a Wires
object, which supports addition with scalars, hence why op.decomposition
works as expected.
from pennylane.
Related Issues (20)
- Improve measurement support in from_qasm
- Support native measurement-based snapshots in Default Clifford
- Improve operator support for new `assert_equal` function: Group 2
- Add a QutritChannel operation
- [BUG] Error when using `PauliRot` and `torch` interface HOT 3
- PennyLane Torch Implementation Question HOT 6
- Issue when using batched data on StronglyEntanglingLayers template.[BUG] HOT 3
- [BUG] `sum_expand` producing incorrect result dimensions
- [BUG] lighthing.qubit torch layer batch size issue HOT 1
- [BUG] Specs does not take into account transforms HOT 3
- How to support Prod observables in custom devices? HOT 3
- [BUG] Can't differentiate `dynamic_one_shot` with `autograd` and `jax` HOT 1
- [BUG] `dynamic_one_shot` does not work with TensorFlow HOT 1
- [BUG] CNOT decomposes to CNOT
- [BUG] Some decompositions/transforms do not preserve derivatives
- [BUG] `defer_measurements` does not work with `qml.cond` applied to controlled gates HOT 3
- Define `BasisStateProjector.compute_sparse_matrix`
- [BUG] `KerasLayer` has unintended side effects on its QNode HOT 1
- [BUG] Documentation generated does not show the parameters for subclasses of Operation. HOT 1
- Add support for Quantum ESPRESSO
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.