Add Readout noise channel support#40
Open
volodymyr-hq wants to merge 4 commits into
Open
Conversation
On newer versions of Catalyst, `QuantumDevice.hpp` declared pure-virual `NamedOperation` member function with 7 parameters, while `qrack_device.cpp` overrides it with only 6 parameters, `optional_params` is missing. This difference in function signature causes the compiler to treat it as a brand new function, while the 7-parameter `NamedOperation` function declared in Catalyst remains uninherited. This leads to a compilation error (abstract class can't be constructed). This commit addresses that issue by adding the parameter to match the base class signature, although it is still unused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
readout_noise_probdevice kwarg toqrack.simulatorthat applies a symmetric per-bit Bernoulli flip to measurement outputs. Covers Sample, Counts, and Probs paths so the effective noise channel is the same regardless of which measurement process is used.This PR is related to Haiqu's work on adding Readout Error Mitigation (REM) support into Catalyst. Since no other device currently supported in Catalyst has readout noise channels, we decided to introduce it into
pennylane-qrackto verify correctness of our REM implementation. See PennyLaneAI/catalyst#2985 for more details.Changes
pennylane_qrack/qrack_device.py: parsereadout_noise_proband stringify it intodevice_kwargs.pennylane_qrack/qrack_device.cpp:std::mt19937member seeded fromstd::random_deviceand parses the new kwarg._SampleBodyand_CountsBody: per-shot XOR before binning._apply_readout_noise_to_probs: mixes the analytic(2^n)probability vector via per-bit 2x2 kronecker product.pennylane_qrack/QrackDeviceConfig.toml: drop the"analytic"restriction onProbabilityMP.