Closed kevinsung closed 1 year ago
If you run the Estimator with shots=None the result has shots=1024.
shots=None
shots=1024
from qiskit import QuantumCircuit, QuantumRegister, transpile from qiskit.quantum_info import SparsePauliOp from qiskit_aer.primitives import Estimator hamiltonian = SparsePauliOp("X") qubits = QuantumRegister(1) circuit = QuantumCircuit(qubits) circuit.measure_all() estimator = Estimator() job = estimator.run(circuit, hamiltonian, shots=None) result = job.result() result.metadata
[{'shots': 1024, 'variance': (0.9972190856933594+0j), 'simulator_metadata': [{'noise': 'ideal', 'batched_shots_optimization': False, 'measure_sampling': True, 'parallel_shots': 1, 'remapped_qubits': False, 'active_input_qubits': [0], 'num_clbits': 1, 'parallel_state_update': 8, 'sample_measure_time': 0.000191442, 'num_qubits': 1, 'device': 'CPU', 'input_qubit_map': [[0, 0]], 'method': 'stabilizer', 'fusion': {'enabled': False}}]}]
shots should be None. I'm not sure what variance here means but if it depends on the number of shots then it is also incorrect.
shots
variance
Thank you for your reporting an issue. This is not a bug, but it should raise an error because shots=None can only be done in the case of approximation=True. I'll fix this until 0.12.1.
approximation=True
s/error/warning/
Informations
What is the current behavior?
If you run the Estimator with
shots=None
the result hasshots=1024
.Steps to reproduce the problem
What is the expected behavior?
shots
should be None. I'm not sure whatvariance
here means but if it depends on the number of shots then it is also incorrect.Suggested solutions