Skip to content

Estimator with approximation=True gives poor approximation #1986

@kevinsung

Description

@kevinsung

Informations

  • Qiskit Aer version: 0.13.0
  • Python version: 3.10.12
  • Operating system: Arch Linux

What is the current behavior?

I initialize a noise model from a fake backend. I run the estimator with a simple circuit and observable. The ideal expectation value is 1.0. approximation=True gives 0.981. approximation=False gives 0.916.

Steps to reproduce the problem

from qiskit import QuantumCircuit
from qiskit.providers.fake_provider import FakeGuadalupeV2
from qiskit.quantum_info import SparsePauliOp
from qiskit_aer.primitives import Estimator
from qiskit_aer.noise import NoiseModel


qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)

observable = SparsePauliOp("ZZ")

fake_backend = FakeGuadalupeV2()
noise_model = NoiseModel.from_backend(fake_backend)

print("approximation=True")
estimator = Estimator(backend_options=dict(noise_model=noise_model), approximation=True)
job = estimator.run(qc, [observable])
result = job.result()
exp_value = result.values[0]
print(exp_value)
print()

print("approximation=False")
estimator = Estimator(backend_options=dict(noise_model=noise_model), approximation=False)
job = estimator.run(qc, [observable], shots=100000)
result = job.result()
exp_value = result.values[0]
print(exp_value)
approximation=True
[/tmp/ipykernel_93816/3992086219.py:18](https://file+.vscode-resource.vscode-cdn.net/tmp/ipykernel_93816/3992086219.py:18): DeprecationWarning: ``qiskit_aer.primitives.estimator.Estimator.__init__()``'s argument ``approximation`` is deprecated as of qiskit-aer 0.13. It will be removed no earlier than 3 months after the release date. approximation=True will be default in the future.
  estimator = Estimator(backend_options=dict(noise_model=noise_model), approximation=True)
0.9817418982111457

approximation=False
[/tmp/ipykernel_93816/3992086219.py:26](https://file+.vscode-resource.vscode-cdn.net/tmp/ipykernel_93816/3992086219.py:26): DeprecationWarning: ``qiskit_aer.primitives.estimator.Estimator.__init__()``'s argument ``approximation`` is deprecated as of qiskit-aer 0.13. It will be removed no earlier than 3 months after the release date. approximation=True will be default in the future.
  estimator = Estimator(backend_options=dict(noise_model=noise_model), approximation=False)
[/tmp/ipykernel_93816/3992086219.py:26](https://file+.vscode-resource.vscode-cdn.net/tmp/ipykernel_93816/3992086219.py:26): DeprecationWarning: Option approximation=False is deprecated as of qiskit-aer 0.13. It will be removed no earlier than 3 months after the release date. Instead, use BackendEstmator from qiskit.primitives.
  estimator = Estimator(backend_options=dict(noise_model=noise_model), approximation=False)
0.91606

What is the expected behavior?

Should be a better approximation.

Suggested solutions

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions