NVIDIA / cuda-quantum

C++ and Python support for the CUDA Quantum programming model for heterogeneous quantum-classical workflows
https://nvidia.github.io/cuda-quantum/
Other
423 stars 146 forks source link

Add support for modeling readout errors in noise model #1640

Open justinlietz opened 1 month ago

justinlietz commented 1 month ago

Required prerequisites

Describe the feature

Background

Readout errors are caused by imperfect qubit measurement, and are a common source of error in quantum computing. Properly modeling these errors in simulation can give the user tools to better understand how these errors when running on actual quantum devices. There is a large body of work studying readout error, particularly in the context of how to mitigate it [1], [2].

Description

Expand the CUDA-Q NoiseModel (https://github.com/NVIDIA/cuda-quantum/blob/main/runtime/common/NoiseModel.h) to include readout errors.

The implementation should include an independent qubit measurement error model, where only two parameters are needed from the user (the probability that 0 is measured as 1, and the probability that 1 is measured as 0), and applied to each measurement.

The implementation should also include a full multi-qubit error model, where the full confusion matrix is used as input, which describes how each possible bit-string output maps to the erroneous bit-strings. The readout error can be applied by multiplying the noise-free measurements after sample has been called, and the simulation has finished.

This feature requested first in issue #891.

References

[1] https://mitiq.readthedocs.io/en/stable/guide/rem-5-theory.html [2] https://arxiv.org/pdf/2006.14044

justinlietz commented 1 month ago

Some things to note: this implementation would at first just target sample, and will apply to any simulator. This is different from the Kraus operator noise modeling which currently only applies to the density matrix simulation.

duydl commented 2 weeks ago

@justinlietz Hi, I want to work on this issue. I would like to confirm if this flow:

Is this good enough or should it be lower to the quantum platform instead?

duydl commented 2 weeks ago

Hi @justinlietz. With further studying I think the readout_error should be applied here https://github.com/NVIDIA/cuda-quantum/blob/5bdaf82fb3c8d2045bc30ee5e7d306006e5ad99c/runtime/nvqir/CircuitSimulator.h#L659 Then the error would be for every subtype simulator. The error could be accessed from ExecutionContext. Though I am wondering if it should be applied to each measurement or all.

Could I get assigned and submit a PR for this issue?