Closed plutoniumm closed 1 year ago
The error message you're seeing (QiskitError: 'Cannot apply instruction with classical bits: measure') is because you are trying to simulate the circuit using a StatevectorSimulator, which does not support measurement. Since you are using EstimatorQNN, which is a parameterized quantum circuit for quantum machine learning, you need to use a quantum simulator that supports measurement. the output of the EstimatorQNN is not a single value, but rather a vector of values, one for each observable. In this case, you are using a single observable (SparsePauliOp.from_list([("Z" * qubits, 1+0j)])), so the output should be a single value. although I am not sure on this @plutoniumm
So i might really be using this wrong, can you (/Anyone else) help me out with some Papers or applications of this? I can't seem to find much in the docs
Hey sorry i figured out how to use this it seems i was using it in the wrong context alltogether it's not meant to be a layer in an NN
Environment
What is happening?
Circuit is not returning the correct sampled value for
EstimatorQNN
withSparsePauliOp
observable with 12 qubits. However I ran This Kaggle Example and it ran perfectlyHow can we reproduce the issue?
Basically it did H → Rx → Entable → H → Rx → H on all qubits
With
SparsePauliOp
thenobservables = [SparsePauliOp.from_list([("Z" * qubits, 1+0j)])];
This returns a
QiskitError: 'Cannot apply instruction with classical bits: measure'
with the defaultStatevector
sim methodWhat should happen?
An estimate value should come out as a list
Any suggestions?
I'm not sure where the error it it may just be me doing some very stupid mistake since the Kaggle ex ran and me changing the circuit didn't, so I apologise for that case in advance. Thanks for the library I'm really enjoying exploring it :)