Neat¶
- class Neat(backend, noise_model=None)[source]¶
Bases:
objectA class to help understand the expected performance of estimator jobs.
The “Noisy Estimator Analyzer Tool” (or “NEAT”) is a convenience tool that users of the
Estimatorprimitive can employ to analyze and predict the performance of their queries. Its simulate method usesqiskit-aerto simulate the estimation task classically efficiently, either in ideal conditions or in the presence of noise. The simulations’ results can be compared with other simulation results or with primitive results results to draw custom figures of merit.- Parameters:
backend (Backend) – A backend.
noise_model (Optional[NoiseModel]) – A noise model for the operations of the given backend. If
None, it defaults to the noise model generated byNoiseModel.from_backend().
Attributes
- noise_model¶
The noise model used by this analyzer tool for the noisy simulations.
Methods
- ideal_sim(pubs, cliffordize=False, seed_simulator=None, precision=0)[source]¶
Perform an ideal, noiseless simulation of the estimator task specified by
pubs.This function uses
qiskit-aer’sEstimatorclass to simulate the estimation task classically.Note
To ensure scalability, every circuit in
pubsis required to be a Clifford circuit, so that it can be simulated efficiently regardless of its size. For estimation tasks that involve non-Clifford circuits, the recommended workflow consists of mapping the non-Clifford circuits to the nearest Clifford circuits using theConvertISAToCliffordtranspiler pass, or equivalently, to use the Neat’sto_clifford()convenience method. Alternatively, settingcliffordizetoTrueensures that theto_clifford()method is applied automatically to the givenpubsprior to the simulation.- Parameters:
pubs (Sequence[EstimatorPubLike]) – The PUBs specifying the estimation task of interest.
cliffordize (bool) – Whether or not to automatically apply the
ConvertISAToCliffordtranspiler pass to the givenpubsbefore performing the simulations.seed_simulator (int | None) – A seed for the simulator.
precision (float) – The target precision for the estimates of each expectation value in the returned results.
- Returns:
The results of the simulation.
- Return type:
- noisy_sim(pubs, cliffordize=False, seed_simulator=None, precision=0)[source]¶
Perform a noisy simulation of the estimator task specified by
pubs.This function uses
qiskit-aer’sEstimatorclass to simulate the estimation task classically.Note
To ensure scalability, every circuit in
pubsis required to be a Clifford circuit, so that it can be simulated efficiently regardless of its size. For estimation tasks that involve non-Clifford circuits, the recommended workflow consists of mapping the non-Clifford circuits to the nearest Clifford circuits using theConvertISAToCliffordtranspiler pass, or equivalently, to use the Neat’sto_clifford()convenience method. Alternatively, settingcliffordizetoTrueensures that theto_clifford()method is applied automatically to the givenpubsprior to the simulation.- Parameters:
pubs (Sequence[EstimatorPubLike]) – The PUBs specifying the estimation task of interest.
cliffordize (bool) – Whether or not to automatically apply the
ConvertISAToCliffordtranspiler pass to the givenpubsbefore performing the simulations.seed_simulator (int | None) – A seed for the simulator.
precision (float) – The target precision for the estimates of each expectation value in the returned results.
- Returns:
The results of the simulation.
- Return type:
- to_clifford(pubs)[source]¶
Return the cliffordized version of the given
pubs.This convenience method runs the
ConvertISAToCliffordtranspiler pass on the PUBs’ circuits.- Parameters:
pubs (Sequence[EstimatorPubLike]) – The PUBs to turn into Clifford PUBs.
- Returns:
The Clifford PUBs.
- Return type:
list[EstimatorPub]