Hello! If applicable, put your complete code example down below. Make sure that your code:
- is 100% self-contained — someone can copy-paste exactly what is here and run it to
reproduce the behaviour you are observing - includes comments
# Put code here
```backend = FakeAlmadenV2()
noise_model = NoiseModel.from_backend(backend)
dev = qml.device("qiskit.aer", wires=n_qubits, noise_model=noise_model)
def qnode(inputs, w000, w001, w002, w003,
w016, w017, w018, w019,
w032, w033, w034, w035,
w100, w101, w102, w103,
w116, w117, w118, w119,
w132, w133, w134, w135):
qml.AmplitudeEmbedding(features=inputs, wires=range(4), normalize=True)
qml.RX(w000, wires=0)
qml.RX(w001, wires=1)
qml.RX(w002, wires=2)
qml.RX(w003, wires=3)
qml.RZ(w016, wires=0)
qml.RZ(w017, wires=1)
qml.RZ(w018, wires=2)
qml.RZ(w019, wires=3)
qml.CNOT(wires=[0, 1])
qml.CNOT(wires=[1, 2])
qml.CNOT(wires=[2, 3])
qml.CNOT(wires=[3, 0])
return (qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1)), qml.expval(qml.PauliZ(2)), qml.expval(qml.PauliZ(3)))
If you want help with diagnosing an error, please put the full error message below:
Put full error message here
qiskit.exceptions.QiskitError: ‘Sum of amplitudes-squared does not equal one.’
And, finally, make sure to include the versions of your packages. Specifically, show us the output of `qml.about()`.
Platform info: Linux-5.15.0-72-generic-x86_64-with-debian-bullseye-sid
Python version: 3.7.0
Numpy version: 1.21.6
Scipy version: 1.7.3
Installed devices:
- lightning.gpu (PennyLane-Lightning-GPU-0.26.0)
- lightning.qubit (PennyLane-Lightning-0.26.0)
- default.gaussian (PennyLane-0.26.0)
- default.mixed (PennyLane-0.26.0)
- default.qubit (PennyLane-0.26.0)
- default.qubit.autograd (PennyLane-0.26.0)
- default.qubit.jax (PennyLane-0.26.0)
- default.qubit.tf (PennyLane-0.26.0)
- default.qubit.torch (PennyLane-0.26.0)
- default.qutrit (PennyLane-0.26.0)
- qiskit.aer (PennyLane-qiskit-0.24.0)
- qiskit.basicaer (PennyLane-qiskit-0.24.0)
- qiskit.ibmq (PennyLane-qiskit-0.24.0)
- qiskit.ibmq.circuit_runner (PennyLane-qiskit-0.24.0)
- qiskit.ibmq.sampler (PennyLane-qiskit-0.24.0)
- ionq.qpu (PennyLane-IonQ-0.23.0)
- ionq.simulator (PennyLane-IonQ-0.23.0)
- projectq.classical (PennyLane-PQ-0.17.0)
- projectq.ibm (PennyLane-PQ-0.17.0)
- projectq.simulator (PennyLane-PQ-0.17.0)
None