Skip to main content
IBM Quantum Platform
Información sobre la traducción

Próximamente habrá traducciones a otros idiomas de esta página.

Algorithmiq Tensor-network error mitigation API reference


Inputs

Caution

TEM currently has the following limitations:

  • Parametrized circuits are not supported. The parameters argument should be set to None if precision is specified. This restriction will be removed in future versions.
  • Only circuits without loops are supported. This restriction will be removed in future versions.
  • Non-unitary gates, such as reset, measure, and all forms of control flow are not supported. Support for reset will be added in upcoming releases.

Parameters

pubs

Tipo: Iterable[EstimatorPubLike]

An iterable of PUB-like (primitive unified bloc) objects, such as tuples (circuit, observables) or (circuit, observables, parameters, precision). See Overview of PUBs for more information. If a non-ISA circuit is passed, it will be transpiled with optimal settings. If an ISA circuit is passed, it will not be transpiled; in this case, the observable must be defined on the whole QPU.

  • Required: Yes
  • Example: (circuit, observables)

backend_name

Tipo: str

Valor predeterminado: Least busy backend

Name of the backend to make the query

  • Required: No
  • Example: "ibm_fez"

Options

Tipo: dict

Input options for this function are specified as a nested dictionary. See the full list of options and their default values.

  • Required: No
  • Example: {"max_bond_dimension": 100}

A dictionary containing the advanced options for the TEM. The dictionary may contain the keys in the following list. If any of the options are not provided, the default value listed in the list will be used. The default values are good for typical use of TEM.

Options list

tem_max_bond_dimension

Tipo: int

Valor predeterminado: 500

The maximum bond dimension to be used for the tensor networks.

tem_compression_cutoff

Tipo: float

Valor predeterminado: 1e-16

The cutoff value to be used for the tensor networks.

compute_shadows_bias_from_observable

Tipo: bool

Valor predeterminado: False

A boolean flag indicating whether the bias for the classical shadows measurement protocol should be tailored to the PUB observable or not. If False, the classical shadows protocol (equal probability of measuring Z, X, Y) will be used.

shadows_bias

Tipo: np.ndarray

Valor predeterminado: np.array([1 / 3, 1 / 3, 1 / 3])

The bias to be used for the randomized classical shadows measurement protocol, a 1d or 2d array of size 3 or shape (num_qubits, 3) respectively. Order is ZXY.

max_execution_time

Tipo: int or None

Valor predeterminado: None

The maximum execution time on the QPU in seconds. If the runtime exceeds this value, the job will be canceled. If None, a default limit set by IBM Quantum Compute Service will apply.

num_randomizations

Tipo: int

Valor predeterminado: 32

The number of randomizations to be used for noise learning and gate twirling.

max_layers_to_learn

Tipo: int

Valor predeterminado: True

The maximum number of unique layers to learn.

mitigate_readout_error

Tipo: bool

Valor predeterminado: True

A boolean flag indicating whether to perform readout error mitigation or not.

num_readout_calibration_shots

Tipo: int

Valor predeterminado: 10000

The number of shots to be used for readout error mitigation.

default_precision

Tipo: float

Valor predeterminado: 0.02

The default precision to be used for the PUBs for which the precision is not specified.

seed

Tipo: int or None

Valor predeterminado: None

Set the seed of the random number generator for reproducibility. If None, don't set the seed.

shots_per_randomization

Tipo: int

Valor predeterminado: 128

The total number of shots to use per random learning circuit.

layer_pair_depths

Tipo: list[int]

Valor predeterminado: [0, 1, 2, 4, 16, 32]

The circuit depths (measured in number of pairs) to use in learning experiments.

layer_noise_model

Tipo: NoiseLearnerResult, Sequence[LayerError], or None

Valor predeterminado: None

The precomputed noise learner result from a previously executed run.

private

Tipo: bool

Valor predeterminado: False

Whether the QPU jobs should be private. Setting it to True will prevent subsequent downloads of the experiment data and is recommended for confidential jobs.

tem_enforce_linear_circuit

Tipo: bool

Valor predeterminado: False

Whether to enforce the circuit to be in linear topology.

Precision

The precision of the results can be requested in three ways. The precision can be passed in the PUB, and it will apply to that PUB only. Otherwise, a default_precision can be passed in the options as specified above. Finally, for advanced use, the specific number of shots per PUB can be passed in the options with default_shots, and it will override any other precision option.

If a default_precision or a per-PUB value is passed, the number of shots is estimated in order to achieve the desired precision. This is done based on the chosen QPU parameters and error rates as follows:

  • Calculating the error per layered gate (EPLG), which quantifies the noise introduced by layers of two-qubit gates. If backend properties are available, it extracts the relevant fidelity; otherwise, it uses a default value.
  • Counting the number of two-qubit gates in the circuit, as these are typically the main contributors to noise.
  • Computing a noise prefactor based on the number of two-qubit gates and the EPLG.
  • Using the requested precision, it estimates the required number of shots by scaling with the noise prefactor and the inverse of the square of the precision.

This approach ensures that the number of shots is sufficient to achieve the desired precision, taking into account both the circuit structure and the backend's noise characteristics.


Outputs

A Qiskit PrimitiveResults containing the TEM-mitigated result. The result for each PUB is returned as a PubResult containing the following fields:

data

Tipo: Databin

A Qiskit DataBin containing the TEM mitigated observable and its standard error. The DataBin has the following fields:

  • evs: The TEM-mitigated observable value.
  • stds: The standard error of the TEM-mitigated observable.

metadata

Tipo: dict

A dictionary containing additional results. The dictionary contains the following keys:

  • "evs_non_mitigated": The observable value without error mitigation.
  • "stds_non_mitigated": The standard error of the result without error mitigation.
  • "evs_mitigated_no_readout_mitigation": The observable value with error mitigation but without readout error mitigation.
  • "stds_mitigated_no_readout_mitigation": The standard error of the result with error mitigation but without readout error mitigation.
  • "evs_non_mitigated_with_readout_mitigation": The observable value without error mitigation but with readout error mitigation.
  • "stds_non_mitigated_with_readout_mitigation": The standard error of the result without error mitigation but with readout error mitigation.
  • "resource_usage": A dictionary containing the time resources used by the TEM.
¿Le ha resultado útil esta página?
Informe de un error, de una errata o solicite contenido en GitHub.