Tensor-network error mitigation (TEM): A Qiskit Function by Algorithmiq
Qiskit Functions are an experimental feature available only to IBM Quantum™ Premium Plan users. They are in preview release status and subject to change.
Overview
Algorithmiq’s Tensor-network Error Mitigation (TEM) method is a hybrid quantum-classical algorithm designed for performing noise mitigation entirely at the classical post-processing stage. With TEM, the user can compute the expectation values of observables mitigating the inevitable noise-induced errors that occur on quantum hardware with increased accuracy and cost efficiency, making it a highly attractive option for quantum researchers and industry practitioners alike.
The method consists of constructing a tensor network representing the inverse of the global noise channel affecting the state of the quantum processor and then applying the map to informationally complete measurement outcomes acquired from the noisy state to obtain unbiased estimators for the observables.
As an advantage, TEM leverages informationally complete measurements to give access to a vast set of mitigated expectation values of observables and has optimal sampling overhead on the quantum hardware, as described in Filippov at al. (2023), arXiv:2307.11740, and Filippov at al. (2024), arXiv:2403.13542. The measurement overhead refers to the number of additional measurements required to perform efficient error mitigation, a critical factor in the feasibility of quantum computations. Therefore, TEM has the potential to enable quantum advantage in complex scenarios, such as applications in the fields of quantum chaos, many-body physics, Hubbard dynamics, and small molecule chemistry simulations.
The main features and benefits of TEM can be summarized as:
- Optimal measurement overhead: TEM is optimal with respect to theoretical bounds, meaning that no method can achieve a smaller measurement overhead. In other words, TEM requires the minimum number of additional measurements to perform error mitigation. This in turns means that TEM uses minimal quantum runtime.
- Cost-effectiveness: Since TEM handles noise mitigation entirely in the post-processing stage, there is no need to add extra circuits to the quantum computer, which not only makes the computation cheaper but also diminishes the risk of introducing additional errors due to the imperfections of quantum devices.
- Estimation of multiple observables: Thanks to informationally-complete measurements, TEM efficiently estimates multiple observables with the same measurement data from the quantum computer.
- Measurement error mitigation: The TEM Qiskit Function also includes a proprietary measurement error mitigation method able to significantly reduce readout errors after a short calibration run.
- Accuracy: TEM significantly improves the accuracy and reliability of digital quantum simulations, making quantum algorithms more precise and dependable.
Description
The TEM function allows you to obtain error-mitigated expectation values for multiple observables on a quantum circuit with minimal sampling overhead. The circuit is measured with an informationally complete positive operator-valued measure (IC-POVM), and the collected measurement outcomes are processed on a classical computer. This measurement is used to perform the tensor network methods and build a noise-inversion map. The function applies a map that fully inverts the whole noisy circuit using tensor networks to represent the noisy layers.
Once the circuits are submitted to the function, they are transpiled and optimized to minimize the number of layers with two-qubit gates (the noisier gates on quantum devices). The noise affecting the layers is learned through Qiskit Runtime using a sparse Pauli-Lindblad noise model as described in E. van den Berg, Z. Minev, A. Kandala, K. Temme, Nat. Phys. (2023). arXiv:2201.09866.
The noise model is an accurate description of the noise on the device able to capture subtle features, including qubit cross-talk. However, noise on the devices can fluctuate and drift and the learned noise might not be accurate at the point at which the estimation is done. This might result in inaccurate results.
Get started
Authenticate using your IBM Quantum Platform API token, and select the TEM function as follows:
from qiskit_ibm_catalog import QiskitFunctionsCatalog
tem_function_name = "algorithmiq/tem"
catalog = QiskitFunctionsCatalog(token="<YOUR_IQP_API_TOKEN>")
# Load your function
tem = catalog.load(tem_function_name)
Example
The following snippet shows an example where TEM is used to compute the expectation values of an observable given a simple quantum circuit.
from qiskit import QuantumCircuit
from qiskit.quantum_info import SparsePauliOp
from qiskit_ibm_runtime import QiskitRuntimeService
# Create a quantum circuit
qc = QuantumCircuit(3)
qc.u(0.4, 0.9, -0.3, 0)
qc.u(-0.4, 0.2, 1.3, 1)
qc.u(-1.2, -1.2, 0.3, 2)
for _ in range(2):
qc.barrier()
qc.cx(0, 1)
qc.cx(2, 1)
qc.barrier()
qc.u(0.4, 0.9, -0.3, 0)
qc.u(-0.4, 0.2, 1.3, 1)
qc.u(-1.2, -1.2, 0.3, 2)
# Define the observables
observable = SparsePauliOp("IYX", 1.0)
# Define the execution options
service = QiskitRuntimeService()
backend_name = service.least_busy(operational=True).name
instance = "<IQP_HUB/IQP_GROUP/IQP_PROJECT>"
pub = (qc, [observable])
options = {"default_precision": 0.02}
job = tem.run(
pubs=[pub], instance=instance, backend_name=backend_name, options=options
)
Use the Qiskit Serverless APIs to check your Qiskit Function workload's status:
print(job.status())
You can return the results as:
result = job.result()
evs = result[0].data.evs
The expected value for the noiseless circuit for the given operator should be around 0.18409094298943401
.
Inputs
Parameters
Name | Type | Description | Required | Default | Example |
---|---|---|---|---|---|
pubs | 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. The circuits don't need to be ISA circuits. | Yes | N/A | (circuit, observables) |
backend_name | str | Name of the backend to make the query. | No | If not provided, the least busy backend will be used. | "ibm_fez" |
instance | str | The hub/group/project to use in that format. | Yes | N/A | "hub1/group1/project1" |
options | dict | Input options. See Options section for more details. | No | See Options section for more details. | {"max_bond_dimension": 100} |
TEM currently has the following limitations:
- Parametrized circuits are not supported. The parameters argument should be set to
None
if precision is specified. - Only circuits with linear connectivity 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.
Options
A dictionary containing the advanced options for the TEM. The dictionary may contain the keys in the following table. If any of the options are not provided, the default value listed in the table will be used. The default values are good for typical use of TEM.
Name | Choices | Description | Default |
---|---|---|---|
tem_max_bond_dimension | int | The maximum bond dimension to be used for the tensor networks. | 500 |
tem_compression_cutoff | float | The cutoff value to be used for the tensor networks. | 1e-16 |
max_execution_time | int or 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 Qiskit Runtime will apply. | None |
num_randomizations | int | The number of randomizations to be used for noise learning and gate twirling. | 32 |
max_layers_to_learn | int | The maximum number of unique layers to learn. | 4 |
mitigate_readout_error | bool | A Boolean flag indicating whether to perform readout error mitigation or not. | True |
num_readout_calibration_shots | int | The number of shots to be used for readout error mitigation. | 10000 |
default_precision | float | The default precision to be used for the PUBs for which the precision is not specified. | 0.02 |
seed | int or None | Set the seed of the random number generator for reproducibility. If None , don't set the seed. | None |
Outputs
A Qiskit PrimitiveResults containing the TEM-mitigated result. The result for each PUB is returned as a PubResult containing the following fields:
Name | Type | Description |
---|---|---|
data | DataBin | A Qiskit DataBin containing the TEM mitigated observable and its standard error. The DataBin has the following fields:
|
metadadata | dict | A dictionary containing additional results. The dictionary contains the following keys:
|
Fetching error messages
If your workload status is ERROR, use job.result() to fetch the error message as follows:
print(job.result())
Get support
Reach out to qiskit_ibm@algorithmiq.fi
Be sure to include the following information:
- Qiskit Function Job ID (
qiskit-ibm-catalog
),job.job_id
- A detailed description of the issue
- Any relevant error messages or codes
- Steps to reproduce the issue