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 noisy_simulator panic when initializing with non-square Kraus matrices #1826

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

orpuente-MS
Copy link
Contributor

@orpuente-MS orpuente-MS commented Aug 8, 2024

When initializing an Operation, the first thing we do is transposing the matrices, nalgebra panics internally when transposing non-square matrices. This PR moves the transposition operation after the dimensions check to gracefully handle that case and adds a unit test to check for this in the future.

Notes:

  1. This bug was introduced in the performance improvement PR.
  2. It doesn't affect well-formed programs; it just affects programs using ill-formed Kraus operators.

Copy link

github-actions bot commented Aug 8, 2024

Benchmark for f6bfb5b

Click to view benchmark
Test Base PR %
Array append evaluation 340.2±2.53µs 335.3±6.32µs -1.44%
Array literal evaluation 280.5±2.03µs 185.9±0.80µs -33.73%
Array update evaluation 417.1±3.09µs 413.5±2.86µs -0.86%
Core + Standard library compilation 21.2±0.34ms 21.2±0.25ms 0.00%
Deutsch-Jozsa evaluation 5.0±0.06ms 5.0±0.06ms 0.00%
Large file parity evaluation 34.5±0.48ms 34.5±0.55ms 0.00%
Large input file compilation 12.8±0.29ms 13.0±0.33ms +1.56%
Large input file compilation (interpreter) 49.2±0.90ms 50.7±1.84ms +3.05%
Large nested iteration 33.5±0.35ms 32.8±0.17ms -2.09%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1563.4±29.86µs 1553.1±31.10µs -0.66%
Perform Runtime Capabilities Analysis (RCA) on large file sample 7.8±0.13ms 7.7±0.07ms -1.28%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1418.8±28.54µs 1418.7±44.89µs -0.01%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 27.6±0.14ms 27.6±0.22ms 0.00%
Teleport evaluation 92.8±3.23µs 92.5±3.48µs -0.32%

@orpuente-MS orpuente-MS added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 3b2bbda Aug 13, 2024
19 checks passed
@orpuente-MS orpuente-MS deleted the oscarpuente/fix-noisy_simulator-panic branch August 13, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants