approximate_noise_model#
- approximate_noise_model(model, *, operator_string=None, operator_dict=None, operator_list=None)[source]#
Replace all noises in a noise model with ones approximated by a mixture of operators (channels).
- Parameters:
model (NoiseModel) – the noise model to be approximated. All noises in the model must be 1- or 2-qubit noises.
operator_string (string) – a name for a pre-made set of building blocks for the output channel (Default: None). Possible values are
'pauli'
,'reset'
,'clifford'
.operator_dict (dict) – a dictionary whose values are the building blocks for the output channel (Default: None). E.g. {“x”: XGate(), “y”: YGate()}, keys “x” and “y” are not used in transformation.
operator_list (list) – list of building block operators for the output channel (Default: None). E.g. [XGate(), YGate()]
- Returns:
the approximate noise model.
- Return type:
- Raises:
NoiseError – if any invalid argument is specified or approximation failed.
MissingOptionalLibraryError – if cvxpy is not installed.
Note
The operator input precedence is:
list
<dict
<string
. If astring
is given,dict
is overwritten; if adict
is given,list
is overwritten. Thestring
supports only 1- or 2-qubit errors and its possible values are'pauli'
,'reset'
,'clifford'
. The'clifford'
does not support 2-qubit errors.