Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix storage order of noise kraus ops #1825

Merged
merged 9 commits into from
Jul 1, 2024

Conversation

1tnguyen
Copy link
Collaborator

@1tnguyen 1tnguyen commented Jun 17, 2024

Description

The row-major data storage was not consistently handled in our NoiseModel.

This is especially problematic for amplitude damping channel, whose Kraus matrices are not self-adjoint.

This PR:

  • Makes sure that we properly map flattened row-major data to Eigen matrices for validation as well as application.
    Note: the base Qpp gate application has done this row-major mapping for gate matrices correctly. We need to fix the apply noise channel path.

  • Fixes a unit tests: these unit tests are using column-major data for amplitude damping channels, probably to make it to work with the underlying inconsistency.

  • Adds 'u3' as a supported gate for noise modeling. We also need to let the QIR runtime (nvqir) propagate the gate to the simulator for the noise channel look-up to work.

  • Makes the py::buffer (numpy ndarray) to flattened row-major Kraus matrix mapping generic for both row and column major storage in numpy.

  • Adds unit test.

Fixed #1811

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jun 17, 2024
github-actions bot pushed a commit that referenced this pull request Jun 17, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jun 17, 2024
@1tnguyen 1tnguyen force-pushed the tnguyen/noise-model-storage-order branch from 424fe1b to 9273474 Compare June 17, 2024 06:14
github-actions bot pushed a commit that referenced this pull request Jun 17, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@1tnguyen 1tnguyen marked this pull request as ready for review June 17, 2024 07:48
Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems plausible to me. Might want someone else to check though.

python/runtime/common/py_NoiseModel.cpp Outdated Show resolved Hide resolved
runtime/common/NoiseModel.h Outdated Show resolved Hide resolved
github-actions bot pushed a commit that referenced this pull request Jul 1, 2024
Copy link

github-actions bot commented Jul 1, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@1tnguyen 1tnguyen merged commit ea0f950 into NVIDIA:main Jul 1, 2024
125 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2024
@bettinaheim bettinaheim added the bug fix To be listed under Bug Fixes in the release notes label Jul 29, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix To be listed under Bug Fixes in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

T1 Kraus channel failing CPTP test
3 participants